@mongodb-js/compass-web 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/228.mjs +2 -0
- package/dist/228.mjs.LICENSE.txt +13 -0
- package/dist/268.mjs +2 -0
- package/dist/268.mjs.LICENSE.txt +5 -0
- package/dist/3.mjs +1 -0
- package/dist/305.mjs +23 -0
- package/dist/{mongodb-js__compass-components.js.LICENSE.txt → 305.mjs.LICENSE.txt} +1 -53
- package/dist/427.mjs +2 -0
- package/dist/{faker-js__faker.js.LICENSE.txt → 427.mjs.LICENSE.txt} +0 -2
- package/dist/680.mjs +339 -0
- package/dist/680.mjs.LICENSE.txt +19 -0
- package/dist/735.mjs +2 -0
- package/dist/{index.js.LICENSE.txt → 735.mjs.LICENSE.txt} +2 -58
- package/dist/752.mjs +2 -0
- package/dist/752.mjs.LICENSE.txt +17 -0
- package/dist/790.mjs +2 -0
- package/dist/790.mjs.LICENSE.txt +11 -0
- package/dist/compass-web.d.ts +11 -1
- package/dist/compass-web.mjs +210 -0
- package/dist/index-bde52cb3.mjs +1 -0
- package/package.json +29 -29
- package/dist/ag-grid-community.js +0 -2
- package/dist/ag-grid-community.js.LICENSE.txt +0 -6
- package/dist/bson-transpilers.js +0 -2
- package/dist/bson-transpilers.js.LICENSE.txt +0 -12
- package/dist/bson.js +0 -2
- package/dist/bson.js.LICENSE.txt +0 -10
- package/dist/faker-js__faker.js +0 -2
- package/dist/index.js +0 -220
- package/dist/mongodb-js__compass-components.js +0 -351
package/dist/bson-transpilers.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see bson-transpilers.js.LICENSE.txt */
|
|
2
|
-
(()=>{var __webpack_modules__={8631:(e,t,n)=>{"use strict";n(4995),n(8451);const{BsonTranspilersAttributeError:r,BsonTranspilersArgumentError:a,BsonTranspilersInternalError:i,BsonTranspilersReferenceError:o,BsonTranspilersRuntimeError:s,BsonTranspilersTypeError:l,BsonTranspilersUnimplementedError:p}=n(1005),{removeQuotes:u}=n(1604),m=n(6083);e.exports=e=>class extends e{constructor(){super(),this.idiomatic=!0,this.clearImports(),this.state={declarations:new m}}clearImports(){this.requiredImports={},[300,301,302,303,304,305,306].forEach((e=>this.requiredImports[e]=[]))}returnResult(e){const t=`visit${this.startRule.replace(/^\w/,(e=>e.toUpperCase()))}`;if(!this.startRule||!(t in this))throw new i("Unimplemented Visitor: the entry rule for the compiler must be set");return this[t](e)}returnResultWithDeclarations(e){let t=this.returnResult(e);return this.getState().declarations.length()>0&&(t=`${this.getState().declarations.toString()+"\n\n"}${t}`),t}start(e,t=!1){return(t?this.returnResultWithDeclarations(e):this.returnResult(e)).trim()}getState(){return this.state}clearDeclarations(){this.getState().declarations.clear()}getImports(e,t){const n=this.Imports.import.template?this.Imports.import.template:e=>Object.values(e).filter(((t,n)=>Object.values(e).indexOf(t)===n)).join("\n");[300,301,302,303,304,305,306].forEach((e=>{e in this.requiredImports&&0===this.requiredImports[e].length&&(this.requiredImports[e]=!1)})),this.requiredImports.driver=!!t;const r={};for(const t of Object.keys(this.requiredImports))this.requiredImports[t]&&this.Imports[t]&&this.Imports[t].template&&(r[t]=this.Imports[t].template(this.requiredImports[t],e));return n(r)}deepCopyRequiredImports(){const e=Object.assign({},this.requiredImports);return[300,301,302,303,304,305,306].forEach((t=>{e[t]=Array.from(this.requiredImports[t])})),e}unimplemented(e){const t=this.renameNode(e.constructor.name);throw new p(`'${t}' not yet implemented`)}skipFakeNodesDown(e,t){return e}_getType(e){if(void 0!==e.type)return e;if(!e.children)return null;for(const t of e.children){const e=this._getType(t);if(e)return e}return null}findTypedNode(e){const t=this._getType(e);if(!t)throw new i("Type not set on any child nodes");return t}getParentOriginalType(e){return void 0!==e.originalType?e.originalType:e.parentCtx?this.getParentOriginalType(e.parentCtx):null}compareTypes(e,t,n,r){if(-1!==e.indexOf(t)||-1!==e.indexOf(t.id))return r;const a=[this.Types._integer,this.Types._decimal,this.Types._hex,this.Types._octal,this.Types._long];for(let r=0;r<e.length;r++)if(-1!==a.indexOf(t)&&-1!==a.indexOf(e[r])){if("_octal"===t.id)return this.leafHelper(e[r],{type:e[r],originalType:t.id,getText:()=>this.visit(n)});const a=this.skipFakeNodesDown(n);return a.originalType=t,a.type=e[r],this.leafHelper(e[r],a)}return-1!==e.indexOf(this.Types._numeric)&&(-1!==a.indexOf(t)||106===t.code||105===t.code||104===t.code)||a.some((t=>-1!==e.indexOf(t)))&&(106===t.code||105===t.code||104===t.code||t===this.Types._numeric)?r:null}castType(e,t){const n=this.visit(t);let r=this.findTypedNode(t).type,a=this.compareTypes(e,r,t,n);for(;null===a;){if(null===r.type)return null;r=r.type,a=this.compareTypes(e,r,t,n)}return a}checkArguments(e,t,n,r){const i=[];if(0===t.length){if(0===e.length||-1!==e[0].indexOf(null))return i;throw new a(`Argument count mismatch: '${n}' requires least one argument`)}if(t.length>e.length)throw new a(`Argument count mismatch: '${n}' expects ${e.length} args and got ${t.length}`);for(let o=0;o<e.length;o++){if(void 0===t[o]){if(-1!==e[o].indexOf(null))return i;throw new a(`Argument count mismatch: too few arguments passed to '${n}'`)}const s=this.checkNamedArgs(e[o],t[o],r),l=this.castType(...s);if(null===l){const r=`Argument type mismatch: '${n}' expects types ${e[o].map((e=>{const t=e&&e.id?e.id:e;return e?t:"[optional]"})).join(", ")} but got type ${this.findTypedNode(t[o]).type.id} for argument at index ${o}`;throw new a(r)}i.push(l)}return i}returnFunctionCallLhs(e,t){return t}returnFunctionCallLhsRhs(e,t,n,r){return`${e}${t=n.argsTemplate?n.argsTemplate.bind(this.getState())(r,...t):`(${t.join(", ")})`}`}returnAttributeAccess(e,t,n){return n&&n.attr[t].template?n.attr[t].template(e,t):`${e}.${t}`}returnParenthesis(e){return`(${e})`}returnSet(e,t){return this.visitChildren(t)}generateFunctionCall(e){const t=this.getFunctionCallName(e),n=this.visit(t);let r=n,a=this.findTypedNode(t).type;if("string"==typeof a&&(a=this.Types[a]),`process${a.id}`in this)return this[`process${a.id}`](e);if(`emit${a.id}`in this)return this[`emit${a.id}`](e);if(e.type=a.type,!a.callable)throw new l(`${a.id} is not callable`);const i=a.args,o=this.checkArguments(i,this.getArguments(e),a.id,a.namedArgs);a.argsTemplate&&(r=this.visit(this.getIfIdentifier(t)));const s=this.returnFunctionCallLhsRhs(n,o,a,r),p=a.callable===this.SYMBOL_TYPE.CONSTRUCTOR;return this.Syntax.new.template?this.Syntax.new.template(s,!p,a.code):s}generateIdentifier(e){const t=this.visitChildren(e);if(e.type=this.Symbols[t],void 0===e.type)throw new o(`Symbol '${t}' is undefined`);return this.requiredImports[e.type.code]=!0,e.type.template?e.type.template():this.returnFunctionCallLhs(e.type.code,t)}generateAttributeAccess(e){if("emitAttributeAccess"in this)return this.emitAttributeAccess(e);const t=this.getAttributeLHS(e),n=this.visit(t),a=this.getAttributeRHS(e).getText();let i=this.findTypedNode(t).type;for("string"==typeof i&&(i=this.Types[i]);null!==i&&!Object.prototype.hasOwnProperty.call(i.attr,a);){if(i.id in this.BsonTypes&&null!==this.BsonTypes[i.id].id)throw new r(`'${a}' not an attribute of ${i.id}`);i=i.type,"string"==typeof i&&(i=this.Types[i])}return null===i?(e.type=this.Types._undefined,this.returnAttributeAccess(n,a,i)):(e.type=i.attr[a],this.returnAttributeAccess(n,a,i))}generateCall(e,t,n,r,a,i,o){if(`emit${t.id}`in this)return this[`emit${t.id}`](e);const s=t.template?t.template():r,l=t.argsTemplate?t.argsTemplate.bind(this.getState())(s,...n):a,p=o?"":s;return this.Syntax.new.template?this.Syntax.new.template(`${p}${l}`,i,t.code):`${p}${l}`}generateObjectLiteral(e){if(this.idiomatic&&"emitIdiomaticObjectLiteral"in this)return this.emitIdiomaticObjectLiteral(e);const t=this.Types._object;if(`emit${t.id}`in this)return this[`emit${t.id}`](e);e.type=t,this.requiredImports[10]=!0,e.indentDepth=this.findIndentDepth(e)+1;let n="";const r=this.getKeyValueList(e);return n=e.type.argsTemplate?e.type.argsTemplate.bind(this.getState())(this.getKeyValueList(e).map((e=>[this.getKeyStr(e),this.visit(this.getValue(e))])),e.indentDepth):this.visit(r),e.indentDepth--,e.type.template?e.type.template.bind(this.getState())(n,e.indentDepth):this.visitChildren(e)}generateArrayLiteral(e){const t=this.Types._array;if(`emit${t.id}`in this)return this[`emit${t.id}`](e);e.type=t,e.indentDepth=this.findIndentDepth(e)+1,this.requiredImports[9]=!0;let n="";const r=this.getList(e).map((e=>this.visit(e)));return n=e.type.argsTemplate?r.map(((t,n)=>{const a=!r[n+1];return e.type.argsTemplate.bind(this.getState())(t,e.indentDepth,a)})).join(""):r.join(", "),e.type.template?e.type.template(n,e.indentDepth):this.visitChildren(e)}generateNumericClass(e){const t=this.getFunctionCallName(e),n=this.visit(t);let r=this.findTypedNode(t).type;"string"==typeof r&&(r=this.Types[r]),e.type=r.type,`emit${r.id}`in this&&this[`emit${r.id}`](e);const a=r.args;let i,o=this.checkArguments(a,this.getArguments(e),r.id,r.namedArgs);if(0===o.length)o=["0"],i=this.Types._integer;else{const t=this.getArgumentAt(e,0),n=this.findTypedNode(t);i=void 0!==n.originalType?n.originalType:n.type}return this.generateCall(e,r,[o[0],i.id],n,`(${o.join(", ")})`)}generateLiteral(e,t,n,r,a){if(`emit${t.id}`in this)return this[`emit${t.id}`](e);if(t.template){const e=t.template(...n);return this.Syntax.new.template?this.Syntax.new.template(e,a,t.code):e}return r}leafHelper(e,t){t.type=e,this.requiredImports[t.type.code]=!0;const n=this.getParentOriginalType(t),r=null===n?t.type:n;if(`process${t.type.id}`in this)return this[`process${t.type.id}`](t);if(`emit${t.type.id}`in this)return this[`emit${t.type.id}`](t);const a=t.getText();return this.generateLiteral(t,t.type,[a,r.id],a,!0)}findIndentDepth(e){for(;void 0===e.indentDepth;)if(null==(e=e.parentCtx))return-1;return e.indentDepth}generateBSONRegex(e,t,n){if(`emit${t.id}`in this)return this[`emit${t.id}`](e);e.type=t;const r=this.checkArguments(n.args,this.getArguments(e),t.id,n.namedArgs),a=this.Syntax.bsonRegexFlags?this.Syntax.bsonRegexFlags:{i:"i",m:"m",x:"x",s:"s",l:"l",u:"u"};let i=null;const o=r[0];if(2===r.length){i=r[1];for(let e=1;e<i.length-1;e++)if(!(i[e]in a))throw new s(`Invalid flag '${i[e]}' passed to Regexp`);i=i.replace(/[imxlsu]/g,(e=>a[e]))}return this.generateCall(e,n,[o,i],"Regex",`(${o}${i?", "+i:""})`)}generateBSONCode(e,t,n,r){if(`emit${t.id}`in this)return this[`emit${t.id}`](e);e.type=t;const i=this.getArguments(e);if(1!==i.length&&2!==i.length)throw new a("Argument count mismatch: Code requires one or two arguments");let o,s="";if(r){const t=this.getArgumentAt(e,0);if(s=this.visit(t),this.findTypedNode(t).type!==this.Types._string)throw new a("Argument type mismatch: Code requires first argument to be a string")}else s=u(this.getArgumentAt(e,0).getText());let l="";if(2===i.length){const t=this.idiomatic;this.idiomatic=!1;const r=this.checkNamedArgs([this.Types._object],this.getArgumentAt(e,1),n.namedArgs);if(o=this.castType(...r),null===o)throw new a("Code expects argument 'scope' to be object");this.idiomatic=t,l=`, ${o}`,this.requiredImports[113]=!0,this.requiredImports[10]=!0}return this.generateCall(e,n,[s,o],"Code",`(${s}${l})`)}generateObjectIdFromTime(e){const t=this.getFunctionCallName(e),n=this.visit(t);let r=this.findTypedNode(t).type;"string"==typeof r&&(r=this.Types[r]);const a=this.checkArguments(r.args,this.getArguments(e),r.id,r.namedArgs),i=200!==this.findTypedNode(this.getArgumentAt(e,0)).type.code;return this.generateCall(e,r,[a[0],i],n,`(${a.join(", ")})`,!0)}generateFuncDefExpression(){throw new p("Support for exporting functions to languages other than javascript is not yet available.")}visitChildren(e,t){const n={start:0,step:1,separator:"",ignore:[],children:e.children};Object.assign(n,t||{}),n.end="end"in n?n.end:n.children.length-1;let r="";for(let e=n.start;e<=n.end;e+=n.step)-1===n.ignore.indexOf(e)&&(r=`${r}${this.visit(n.children[e])}${e===n.end?"":n.separator}`);return r}visitEof(){return this.Syntax.eof.template?this.Syntax.eof.template():""}visitEos(){return this.Syntax.eos.template?this.Syntax.eos.template():"\n"}visitTerminal(e){return e.getText()}}},6083:(e,t,n)=>{"use strict";n(4995),e.exports=class{constructor(){this.clear()}addVar(e,t,n){const r=this.alreadyDeclared(e,t,n);if(void 0!==r)return r;const a=this.next(e,t);return this.vars[n(a)]=a,a}addFunc(e){this.funcs[e]||(this.funcs[e]=!0)}alreadyDeclared(e,t,n){const r=this.candidates(e,t);for(var a=0;a<r.length;a++){const r=`${this.varTemplateRoot(e,t)}${a>0?a:""}`,i=this.vars[n(r)];if(void 0!==i)return i}}candidates(e,t){const n=this.varTemplateRoot(e,t);return Object.values(this.vars).filter((e=>e.startsWith(n)))}clear(){this.vars={},this.funcs={}}length(){return Object.keys(this.vars).length+Object.keys(this.funcs).length}next(e,t){const n=this.candidates(e,t),r=n.length>0?n.length:"";return`${this.varTemplateRoot(e,t)}${r}`}toString(e="\n\n"){return[...Object.keys(this.vars),...Object.keys(this.funcs)].join(e)}varTemplateRoot(e,t){return`${t}${e}`}}},2798:(e,t,n)=>{"use strict";const r=n(5525),{BsonTranspilersSyntaxError:a}=n(1005);class i extends r.error.ErrorListener{syntaxError(e,t,n,r,i,o){throw new a(i,{symbol:t,line:n,column:r,payload:o})}}e.exports=i},7483:e=>{"use strict";e.exports=e=>class extends e{constructor(){super()}}},394:e=>{"use strict";e.exports=e=>class extends e{constructor(){super()}}},2208:(e,t,n)=>{"use strict";n(4995),n(8854),n(8451);const{doubleQuoteStringify:r,removeQuotes:a}=n(1604),{BsonTranspilersRuntimeError:i,BsonTranspilersUnimplementedError:o}=n(1005);e.exports=e=>class extends e{constructor(){super(),this.field_opts=["gt","lt","lte","gte","eq","ne","nin","in","not","exists","type","all","size","elemMatch","mod","regex","sum","avg","first","last","max","min","push","addToSet","stdDevSamp","stdDevPop","bitsAllSet","bitsAllClear","bitsAnySet","bitsAnyClear","geoWithin","geoIntersects","near","nearSphere"],this.opts=["match","skip","limit","out","sortByCount","count","or","nor","and"],this.builderImports=[["all","and","bitsAllClear","bitsAllSet","bitsAnyClear","bitsAnySet","elemMatch","eq","exists","expr","geoIntersects","geoWithin","geoWithinBox","geoWithinCenter","geoWithinCenterSphere","geoWithinPolygon","gt","gte","in","lt","lte","mod","ne","near","nearSphere","nin","nor","not","or","regex","size","text","type","where","options"],["addFields","bucket","bucketAuto","count","facet","graphLookup","group","limit","lookup","match","out","project","replaceRoot","sample","skip","sort","sortByCount","unwind"],["addToSet","avg","first","last","max","min","push","stdDevPop","stdDevSamp","sum"]].reduce(((e,t,n)=>(t.forEach((t=>{e[t]=n+300})),e)),{})}emitIdiomaticObjectLiteral(e){e.type=this.Types._object,e.indentDepth=this.findIndentDepth(e)+1;let t=!1,n="";const a=this.getKeyValueList(e);return a.length?(n=a.map((n=>{const a=this.getKeyStr(n),o=this.getValue(n);if(a.startsWith("$")){const n=a.substr(1);if(this.builderImports[n]&&this.requiredImports[this.builderImports[n]].push(n),"regex"===n&&(t=!0),`handle${n}`in this)return this[`handle${n}`](this.getObjectChild(o),n,e);if(-1!==this.field_opts.indexOf(n)){if(!this.isSubObject(e))throw new i(`$${n} cannot be top-level`);return this.handleFieldOp(o,n,e)}if(-1!==this.opts.indexOf(n))return`${a.substr(1)}(${this.visit(o)})`}const s=this.visit(o),l=this.getObjectChild(o);return this.isFilter(l)?s:(this.requiredImports[300].push("eq"),`eq(${r(a)}, ${s})`)})),n.length>1&&!t?(this.requiredImports[300].push("and"),`and(${n.join(", ")})`):n[0]):(this.requiredImports[10]=!0,"new Document()")}handleFieldOp(e,t,n){const a=this.getParentKeyStr(n);return`${t}(${r(a)}, ${this.visit(e)})`}isFilter(e){const t=this.getKeyValueList(e);for(let e=0;e<t.length;e++){const n=t[e],r=this.getKeyStr(n);if(-1!==this.field_opts.indexOf(r.substr(1)))return!0}return!1}handleSingleSubfield(e,t,n,r){const a=this.assertIsNonemptyObject(e,t);let o="";if(a.forEach((e=>{const a=this.getKeyStr(e);if(a!==n)throw new i(`Unrecognized option to $${t}: ${a}`);this.idiomatic=r,o=this.visit(this.getValue(e)),this.idiomatic=!0})),""===o)throw new i(`Missing option '${n}' in $${t}`);return`${t}(${o})`}handleOptionsObject(e,t,n,r,a){const o=this.assertIsNonemptyObject(e,t),s={};o.forEach((e=>{const a=this.getKeyStr(e);if(-1===n.indexOf(a)&&-1===r.indexOf(a))throw new i(`Unrecognized option to $${t}: ${a}`);s[a]=this.visit(this.getValue(e))})),n.map((e=>{if(!(e in s))throw new i(`Missing option '${e}' in $${t}`)}));let l="";return Object.keys(s).length>n.length&&(this.requiredImports[306].push(a[t]),l=`, new ${a[t]}()${Object.keys(s).filter((e=>-1!==r.indexOf(e))).map((e=>void 0!==a&&e in a?a[e](s[e]):`.${e}(${s[e]})`)).join("")}`),`${t}(${n.map((e=>s[e])).join(", ")}${l})`}handleMultipleSubfields(e,t,n,r,a){const o=this.assertIsNonemptyObject(e,t),s=[],l={};if(o.forEach((e=>{const t=this.getKeyStr(e);-1!==n.indexOf(t)?s.push(this.visit(this.getValue(e))):(this.idiomatic=a,l[t]=this.visit(this.getValue(e)),this.idiomatic=!0)})),s.length!==n.length)throw new i(`Required option missing from ${t}`);return`${t}(${s.concat(Object.keys(l).map((e=>r(e,l[e])))).join(", ")})`}handleproject(e){const t=this.assertIsNonemptyObject(e,"project"),n={};t.forEach((e=>{const t=this.getKeyStr(e),a=this.getValue(e).getText();if("true"===a.toLowerCase()||"1"===a)"_id"!==t&&(n.includes=n.includes?`${n.includes}, ${r(t)}`:`include(${r(t)}`,this.requiredImports[303].push("include"));else if("false"===a.toLowerCase()||"0"===a)"_id"!==t?(n.excludes=n.excludes?`${n.excludes}, ${r(t)}`:`exclude(${r(t)}`,this.requiredImports[303].push("exclude")):(n.excludeId="excludeId()",this.requiredImports[303].push("excludeId"));else{const a=this.visit(this.getValue(e));n.computed=n.computed?`${n.computed}, computed(${r(t)}, ${a})`:`computed(${r(t)}, ${a})`,this.requiredImports[303].push("computed")}})),n.includes&&(n.includes=`${n.includes})`),n.excludes&&(n.excludes=`${n.excludes})`);const a=Object.values(n);let i;return 1===a.length?i=a[0]:(i=`fields(${a.join(", ")})`,this.requiredImports[303].push("fields")),`project(${i})`}handlenot(e,t,n){const r=this.assertIsNonemptyObject(e,t),a=this.getValue(r[0]),i=this.getKeyStr(r[0]).substr(1);return this.requiredImports[300].push(i),`${t}(${this.handleFieldOp(a,i,n)})`}handlemod(e,t,n){const a=this.getList(e);if(2!==a.length)throw new i("$mod requires an array of 2-elements");const o=this.getParentKeyStr(n),s=a.map((e=>this.visit(e)));return`${t}(${r(o)}, ${s.join(", ")})`}handleregex(e,t,n){const a=this.getParentKeyStr(n),i={r:"",o:""};return this.getKeyValueList(n).forEach((e=>{const t=this.getKeyStr(e);"$regex"===t&&(i.r=this.visit(this.getValue(e))),"$options"===t&&(i.o=`, ${this.visit(this.getValue(e))}`)})),`${t}(${r(a)}, ${i.r}${i.o})`}handleoptions(){return""}handlewhere(e){let t;return t="getParent"in e?e.getParent().getText():e.getText(),`where(${r(t)})`}handlesort(e){const t=this.assertIsNonemptyObject(e,"sort"),n=[];let a;return t.forEach((e=>{const t=this.getKeyStr(e),a=this.getValue(e).getText();if("1"===a)n.push(`ascending(${r(t)})`),this.requiredImports[304].push("ascending");else if("-1"===a)n.push(`descending(${r(t)})`),this.requiredImports[304].push("descending");else{if(!a.match(new RegExp(/{(?:'|")?\$meta(?:'|")?:(?:'|")textScore*(?:'|")}/)))throw new i("$sort key ordering must be specified using a number or {$meta: 'textScore'}");n.push(`metaTextScore(${r(t)})`),this.requiredImports[304].push("metaTextScore")}})),n.length>1?(a=`orderBy(${n.join(", ")})`,this.requiredImports[304].push("orderBy")):a=n[0],`sort(${a})`}handlegeoWithin(e,t,n){this.requiredImports[300].splice(this.requiredImports[300].indexOf("geoWithin"),1);const a=this.assertIsNonemptyObject(e,t),o=r(this.getParentKeyStr(n)),s={};if(a.forEach((e=>{const t=this.getKeyStr(e);s[t]=this.getValue(e)})),1!==Object.keys(s).length)throw new i("$geoWithin takes an object with only 1 field");const l=Object.keys(s)[0];switch(l){case"$geometry":return this.requiredImports[300].push("geoWithin"),`geoWithin(${o}, ${this.handlegeometry(s[l])})`;case"$box":return this.requiredImports[300].push("geoWithinBox"),`geoWithinBox(${o}, ${this.combineCoordinates(s[l],2,"",!0,(e=>this.combineCoordinates(e,2,"",!0,(e=>this.visit(e)))))})`;case"$polygon":return this.requiredImports[300].push("geoWithinPolygon"),`geoWithinPolygon(${o}, ${this.visit(s[l])})`;case"$centerSphere":case"$center":{const e=this.assertIsNonemptyArray(s[l]);if(2!==e.length)throw new i(`${l} takes array of length 2`);const t=this.combineCoordinates(e[0],2,"",!0,(e=>this.visit(e))),n=`geoWithin${l[1].toUpperCase()}${l.substr(2)}`;return this.requiredImports[300].push(n),`${n}(${o}, ${t}, ${this.visit(e[1])})`}default:throw new i(`unrecognized option ${l} to $geoWithin`)}}handlenear(e,t,n){const a=this.assertIsNonemptyObject(e,t),o=r(this.getParentKeyStr(n)),s={};if(a.forEach((e=>{const t=this.getKeyStr(e);s[t]=this.getValue(e)})),["$geometry","$minDistance","$maxDistance"].map((e=>{if(!(e in s))throw new i(`Missing required field ${e} in $${t}`)})),3!==Object.keys(s).length)throw new i(`Too many fields to $${t}`);return`${t}(${o}, ${this.handlegeometry(s.$geometry)}, ${this.visit(s.$maxDistance)}, ${this.visit(s.$minDistance)})`}handlenearSphere(e,t,n){return this.handlenear(e,t,n)}generateposition(e){const t=this.assertIsNonemptyArray(e,"geometry");if(2!==t.length)throw new i("Position must be 2 coordinates");return this.requiredImports[305].push("Position"),`new Position(${this.visit(t[0])}, ${this.visit(t[1])})`}assertIsNonemptyArray(e,t){const n=this.getArray(e);if(!n||0===this.getList(n).length)throw new i(`$${t} requires a non-empty array`);return this.getList(n)}assertIsNonemptyObject(e,t){this.getObject(e)&&(e=this.getObject(e));const n=this.getKeyValueList(e);if(0===n.length)throw new i(`$${t} requires a non-empty document`);return n}combineCoordinates(e,t,n,r,a){r||(this.requiredImports[9]=!0);const o=this.assertIsNonemptyArray(e,"geometry");if(o.length<t)throw new i(`${n||"$geometry inner array"} must have at least ${t} elements (has ${o.length})`);let s=o.map((e=>a?a(e):this.generateposition(e))).join(", ");return s=r?s:`Arrays.asList(${s})`,n?(this.requiredImports[305].push(n),`new ${n}(${s})`):s}generatepoint(e){return`new Point(${this.generateposition(e)})`}generatemultipoint(e){return this.combineCoordinates(e,1,"MultiPoint")}generatelinestring(e){return this.combineCoordinates(e,2,"LineString")}generatemultilinestring(e){return this.combineCoordinates(e,1,"MultiLineString",!1,(e=>this.combineCoordinates(e,2)))}generatepolygon(e){return`new Polygon(${this.combineCoordinates(e,1,"PolygonCoordinates",!0,(e=>this.combineCoordinates(e,4)))})`}generatemultipolygon(e){return this.combineCoordinates(e,1,"MultiPolygon",!1,(e=>this.combineCoordinates(e,1,"PolygonCoordinates",!0,(e=>this.combineCoordinates(e,4)))))}generategeometrycollection(e){return`new GeometryCollection(Arrays.asList(${this.assertIsNonemptyArray(e,"geometry").map((e=>{const t=this.getObject(e);if(!t)throw new i("$GeometryCollection requires objects");return this.handlegeometry(t)})).join(", ")}))`}handlegeometry(e){const t=this.assertIsNonemptyObject(e,"geometry"),n={};if(t.forEach((e=>{const t=this.getKeyStr(e);if("type"===t)n.type=a(this.visit(this.getValue(e)));else{if("coordinates"!==t)throw"crs"===t?new o("Coordinate reference systems not currently supported"):new i(`Unrecognized option to $geometry: ${t}`);n.coordinates=this.getValue(e)}})),!n.type||!n.coordinates)throw new i("Missing option to $geometry");if(!this.getArray(n.coordinates)||0===this.getList(this.getArray(n.coordinates)).length)throw new i("Invalid coordinates option for $geometry");if(`generate${n.type.toLowerCase()}`in this)return this.requiredImports[305].push(n.type),this[`generate${n.type.toLowerCase()}`](n.coordinates);throw new i(`Unrecognized GeoJSON type "${n.type}"`)}handlesample(e){return this.handleSingleSubfield(e,"sample","size",!0)}handlereplaceRoot(e){return this.handleSingleSubfield(e,"replaceRoot","newRoot",!1)}handlegraphLookup(e){return this.handleOptionsObject(e,"graphLookup",["from","startWith","connectFromField","connectToField","as"],["maxDepth","depthField","restrictSearchWithMatch"],{graphLookup:"GraphLookupOptions"})}handlelookup(e){return this.handleOptionsObject(e,"lookup",["from","localField","foreignField","as"],[],{lookup:"LookupOptions"})}handlebucket(e){return this.handleOptionsObject(e,"bucket",["groupBy","boundaries"],["default","output"],{bucket:"BucketOptions",default:e=>`.defaultBucket(${e})`})}handlebucketAuto(e){return this.handleOptionsObject(e,"bucketAuto",["groupBy","buckets"],["granularity","output"],{bucketAuto:"BucketAutoOptions",granularity:e=>`.granularity(BucketGranularity.fromString(${e}))`})}handletext(e){return this.handleOptionsObject(e,"text",["$search"],["$language","$caseSensitive","$diacriticSensitive"],{text:"TextSearchOptions",$language:e=>`.language(${e})`,$caseSensitive:e=>`.caseSensitive(${e})`,$diacriticSensitive:e=>`.diacriticSensitive(${e})`})}handleunwind(e){const t=this.deepCopyRequiredImports(),n=this.visit(e.parentCtx);return this.requiredImports=t,"_string"===this.findTypedNode(e.parentCtx).type.id?`unwind(${n})`:this.handleOptionsObject(e,"unwind",["path"],["includeArrayIndex","preserveNullAndEmptyArrays"],{unwind:"UnwindOptions"})}handlegroup(e){return this.handleMultipleSubfields(e,"group",["_id"],((e,t)=>t),!0)}handlefacet(e){return this.requiredImports[306].push("Facet"),this.handleMultipleSubfields(e,"facet",[],((e,t)=>`new Facet(${r(e)}, ${t})`),!0)}handleaddFields(e){return this.requiredImports[306].push("Field"),this.handleMultipleSubfields(e,"addFields",[],((e,t)=>`new Field(${r(e)}, ${t})`),!1)}}},4307:e=>{"use strict";e.exports=e=>class extends e{constructor(){super()}generateFuncDefExpression(e){const t=e.start.source[1].strdata,n=e.start.start,r=e.stop.stop;return t.slice(n,r+1)}}},3636:(e,t,n)=>{"use strict";var r=n(5081).hp;n(4995),n(8451);const a=n(5106),i=n(7520),{BsonTranspilersArgumentError:o,BsonTranspilersRuntimeError:s,BsonTranspilersUnimplementedError:l}=n(1005),{removeQuotes:p}=n(1604);e.exports=e=>class extends e{constructor(){super(),this.startRule="program",this.visitThisExpression=this.visitDeleteExpression=this.visitVoidExpression=this.visitTypeofExpression=this.visitInExpression=this.visitInstanceofExpression=this.visitAssignmentExpression=this.visitAssignmentOperatorExpression=this.visitMemberIndexExpression=this.visitTernaryExpression=this.visitFunctionDeclaration=this.visitVariableStatement=this.visitIfStatement=this.visitDoWhileStatement=this.visitWhileStatement=this.visitForStatement=this.visitForVarStatement=this.visitForInStatement=this.visitForVarInStatement=this.visitContinueStatement=this.visitBreakStatement=this.visitReturnStatement=this.visitWithStatement=this.visitLabelledStatement=this.visitSwitchStatement=this.visitThrowStatement=this.visitTryStatement=this.visitDebuggerStatement=this.unimplemented}visitProgram(e){if(e.getChildCount()<2)throw new s("Expression contains 0 statements. Input should be a single statement");return this.visitChildren(e)}visitSourceElements(e){if(1!==e.sourceElement().length)throw new s(`Expression contains ${e.sourceElement().length} statements. Input should be a single statement`);return this.visitChildren(e)}visitEmptyStatement(){throw new s("Expression contains 0 statements. Input should be a single statement")}visitFuncCallExpression(e){return this.generateFunctionCall(e)}visitIdentifierExpression(e){return this.generateIdentifier(e)}visitGetAttributeExpression(e){return this.generateAttributeAccess(e)}visitObjectLiteral(e){return this.generateObjectLiteral(e)}visitArrayLiteral(e){return this.generateArrayLiteral(e)}visitNullLiteral(e){return this.leafHelper(this.Types._null,e)}visitUndefinedLiteral(e){return this.leafHelper(this.Types._undefined,e)}visitBooleanLiteral(e){return this.leafHelper(this.Types._bool,e)}visitStringLiteral(e){return this.leafHelper(this.Types._string,e)}visitRegularExpressionLiteral(e){return this.leafHelper(this.Types._regex,e)}visitIntegerLiteral(e){return this.leafHelper(this.Types._long,e)}visitDecimalLiteral(e){return this.leafHelper(this.Types._decimal,e)}visitHexIntegerLiteral(e){return this.leafHelper(this.Types._hex,e)}visitOctalIntegerLiteral(e){return this.leafHelper(this.Types._octal,e)}visitElision(e){return e.type=this.Types._undefined,e.type.template?e.type.template():"null"}visitNewExpression(e){e.singleExpression().wasNew=!0;const t=this.visit(e.singleExpression());return e.type=this.findTypedNode(e.singleExpression()).type,t}visitRelationalExpression(e){e.type=this.Types._boolean;const t=this.visit(e.singleExpression()[0]),n=this.visit(e.singleExpression()[1]),r=this.visit(e.children[1]);return this.Syntax.equality?this.Syntax.equality.template(t,r,n):this.visitChildren(e)}visitEqualityExpression(e){e.type=this.Types._boolean;const t=this.visit(e.singleExpression()[0]),n=this.visit(e.singleExpression()[1]),r=this.visit(e.children[1]);return this.Syntax.equality?this.Syntax.equality.template(t,r,n):this.visitChildren(e)}visitLogicalAndExpression(e){return this.Syntax.and?this.Syntax.and.template(e.singleExpression().map((e=>this.visit(e)))):this.visitChildren(e)}visitLogicalOrExpression(e){return this.Syntax.or?this.Syntax.or.template(e.singleExpression().map((e=>this.visit(e)))):this.visitChildren(e)}visitNotExpression(e){return this.Syntax.not?this.Syntax.not.template(this.visit(e.singleExpression())):this.visitChildren(e)}visitBitAndExpression(e){if(this.Syntax.binary.template){const t=e.children.map((e=>this.visit(e)));return this.Syntax.binary.template(t)}return this.visitChildren(e)}visitBitXOrExpression(e){if(this.Syntax.binary.template){const t=e.children.map((e=>this.visit(e)));return this.Syntax.binary.template(t)}return this.visitChildren(e)}visitBitOrExpression(e){if(this.Syntax.binary.template){const t=e.children.map((e=>this.visit(e)));return this.Syntax.binary.template(t)}return this.visitChildren(e)}visitBitNotExpression(e){return this.Syntax.unary.template?this.Syntax.unary.template("~",this.visit(e.singleExpression())):this.visitChildren(e)}visitUnaryPlusExpression(e){return this.Syntax.unary.template?this.Syntax.unary.template("+",this.visit(e.singleExpression())):this.visitChildren(e)}visitUnaryMinusExpression(e){return this.Syntax.unary.template?this.Syntax.unary.template("-",this.visit(e.singleExpression())):this.visitChildren(e)}visitAdditiveExpression(e){if(this.Syntax.binary.template){const t=e.children.map((e=>this.visit(e)));return this.Syntax.binary.template(t)}return this.visitChildren(e)}visitMultiplicativeExpression(e){if(this.Syntax.binary.template){const t=e.children.map((e=>this.visit(e)));return this.Syntax.binary.template(t)}return this.visitChildren(e)}visitBitShiftExpression(e){if(this.Syntax.binary.template){const t=e.children.map((e=>this.visit(e)));return this.Syntax.binary.template(t)}return this.visitChildren(e)}visitParenthesizedExpression(e){if(this.Syntax.parens.template){const t=this.visit(e.expressionSequence());return this.Syntax.parens.template(t)}return this.visitChildren(e)}visitFuncDefExpression(e){return this.generateFuncDefExpression(e)}processNumber(e){return this.generateNumericClass(e)}processInt32(e){return this.generateNumericClass(e)}processDouble(e){return this.generateNumericClass(e)}processRegExp(e){return this.checkArguments(this.Symbols.RegExp.args,this.getArguments(e),"RegExp"),this.process_regex(e)}process_regex(e){let t,n;e.type=this.Types._regex;try{const r=this.executeJavascript(e.getText());t=r.source,n=r.flags}catch(e){throw new s(e.message)}let r=n.replace(/[imuyg]/g,(e=>this.Syntax.regexFlags[e]));return r=""===r?"":`${r.split("").sort().join("")}`,this.generateLiteral(e,e.type,[t,r],"RegExp")}processBSONRegExp(e){return this.generateBSONRegex(e,this.Types.BSONRegExpType,this.Symbols.BSONRegExp)}processCodeFromJS(e){return this.generateBSONCode(e,this.Types.Code,this.Symbols.Code,!1)}processObjectId(e){e.type=this.Types.ObjectId;const t=this.Symbols.ObjectId,n=this.getArguments(e);let r;this.checkArguments(t.args,n,"ObjectId");try{r=this.executeJavascript(`new ${e.getText()}`).toHexString()}catch(e){throw new s(e.message)}const a=0===n.length?[]:[r];return this.generateCall(e,t,a,"ObjectId",`(${r})`)}processLong(e){e.type=this.Types.Long;const t=this.Symbols.Long;let n;this.checkArguments(t.args,this.getArguments(e),"Long");try{n=this.executeJavascript(`new ${e.getText()}`).toString()}catch(e){throw new s(e.message)}return this.generateCall(e,t,[n,"_long"],"Long",`(${n})`)}processLongfromBits(e){return"emitLongfromBits"in this?this.emitLongfromBits(e):this.processLong(e)}processDecimal128(e){e.type=this.Types.Decimal128;const t=this.Symbols.Decimal128;let n;if(1!==this.getArguments(e).length)throw new o("Argument count mismatch: Decimal128 requires one argument");try{n=this.executeJavascript(`new ${e.getText()}`).toString()}catch(e){if("TypeError"===e.name||"ERR_INVALID_ARG_TYPE"===e.code)throw new o(e.message);throw new s(e.message)}return this.generateCall(e,t,[n],"Decimal128",`(${n})`)}processLongtoString(e){e.type=this.Types._string;const t=e.singleExpression().singleExpression();let n;this.checkArguments([[this.Types._numeric,null]],this.getArguments(e),"Long toString");try{n=this.executeJavascript(`new ${t.getText()}`).toString()}catch(e){throw new s(e.message)}return e.type.template?e.type.template(n):`'${n}'`}processDate(e){const t=!(e.getText().includes("ISODate")||e.wasNew),n=this.Symbols.Date;e.type=this.Types.Date,t&&(e.type=this.Types._string,this.requiredImports[201]=!0);const r=this.getArguments(e);let a=null;if(0!==r.length){try{this.checkArguments(this.Symbols.Date.args,r,"Date")}catch(e){throw new o("Invalid argument to Date: requires no args, one string/number, or up to 7 numbers")}let t=e.getText();t=t.startsWith("new ")?t:`new ${t}`;try{a=this.executeJavascript(t)}catch(e){throw new s(e.message)}}const i=`Date(${a?this.Types._string.template(a.toUTCString()):""})`;return this.generateCall(e,n,[a,t],"",i,t,!0)}processObjectIdCreateFromTime(e){return this.generateObjectIdFromTime(e)}processBinary(){throw new l("Binary type not supported")}renameNode(e){return e?e.replace("_stmt",""):"Expression"}checkNamedArgs(e,t){return[e,t]}executeJavascript(e){const t={RegExp,BSONRegExp:i.BSONRegExp,DBRef:i.DBRef,Decimal128:i.Decimal128,Double:i.Double,Int32:i.Int32,Long:i.Long,Int64:i.Long,Map:i.Map,MaxKey:i.MaxKey,MinKey:i.MinKey,ObjectID:i.ObjectId,ObjectId:i.ObjectId,BSONSymbol:i.BSONSymbol,Timestamp:i.Timestamp,Code:function(e,t){return new i.Code(e,t)},Date:function(e){const t=Array.from(arguments);return 1===t.length?new Date(e):new Date(Date.UTC(...t))},Buffer:r,__result:{}};return a.runInContext("__result = "+e,a.createContext(t))}getArguments(e){return"arguments"in e&&"argumentList"in e.arguments()&&e.arguments().argumentList()?e.arguments().argumentList().singleExpression():[]}getArgumentAt(e,t){return this.getArguments(e)[t]}getFunctionCallName(e){return e.singleExpression()}getIfIdentifier(e){return"identifierName"in e?e.singleExpression():e}getAttributeLHS(e){return e.singleExpression()}getAttributeRHS(e){return e.identifierName()}getList(e){if(!("elementList"in e)||!e.elementList())return[];const t=e.elementList().elision(),n=e.elementList().singleExpression();return e.elementList().children.filter((e=>-1!==t.indexOf(e)||-1!==n.indexOf(e)))}getArray(e){return"arrayLiteral"in e&&e.arrayLiteral()}getObject(e){return"objectLiteral"in e&&e.objectLiteral()}getKeyValueList(e){return"propertyNameAndValueList"in e&&e.propertyNameAndValueList()?e.propertyNameAndValueList().propertyAssignment():[]}getKeyStr(e){return p(this.visit(e.propertyName()))}getValue(e){return e.singleExpression()}isSubObject(e){return"propertyName"in e.parentCtx.parentCtx}getParentKeyStr(e){return this.getKeyStr(e.parentCtx.parentCtx)}getObjectChild(e){return e.getChild(0)}}},8811:(e,t,n)=>{"use strict";n(2282),n(8451),n(6327);const r=n(7520),{BsonTranspilersReferenceError:a,BsonTranspilersTypeError:i,BsonTranspilersRuntimeError:o}=n(1005),{removeQuotes:s}=n(1604);e.exports=e=>class extends e{constructor(){super(),this.IGNORE="a unique thing"}start(e){return this.returnResult(e)}generateCall(e,t,n){if(`emit${t.id}`in this)return this[`emit${t.id}`](e,...n);const r=this.visit(this.getFunctionCallName(e));return this.returnFunctionCallLhsRhs(r,n,t)}visitChildren(e,t){const n={start:0,step:1,separator:"",ignore:[],children:e.children};Object.assign(n,t||{}),n.end="end"in n?n.end:n.children.length-1;const r=[];for(let e=n.start;e<=n.end;e+=n.step)-1===n.ignore.indexOf(e)&&r.push(this.visit(n.children[e]));const a=r.filter((e=>e!==this.IGNORE));return 1===a.length?a[0]:a}returnFunctionCallRhs(e){return e}returnFunctionCallLhs(e,t){const n={100:r.Code,101:r.ObjectId,102:r.Binary,103:r.DBRef,104:r.Double,105:r.Int32,106:r.Long,107:r.MinKey,108:r.MaxKey,109:r.BSONRegExp,110:r.Timestamp,111:r.BSONSymbol,112:r.Decimal128,200:Date,8:RegExp,2:Number,10:Object}[e];if(void 0===n)throw new a(`Cannot instantiate ${t} with code=${e}`);return n}returnFunctionCallLhsRhs(e,t,n){if(1===t.length&&void 0===t[0]&&(t=[]),n&&n.argsTemplate)return n.argsTemplate.bind(this.getState())(e,...t);let r;try{r=n.callable===this.SYMBOL_TYPE.CONSTRUCTOR?new e(...t):e(...t)}catch(n){if(!n.message.includes("constructor"))throw n.message=`Error constructing type: ${n.message}`,n;try{r=e(...t)}catch(e){throw e.message=`Error constructing type: ${e.message}`,e}}return r}returnAttributeAccess(e,t,n){if(null===n)throw new i(`Error: ${t} is undefined and cannot be called`);let r=e[t];return n.attr[t].template&&(r=n.attr[t].template(e,t),"function"==typeof r)?function(){return r(...arguments)}:"function"==typeof r?function(){return e[t](...arguments)}:r}returnParenthesis(e){return e}returnSet(e){return e}returnComparison(e){return e.children.reduce(((e,t,n,r)=>{if(n===r.length-1)return e;if(n%2==0)return e;const a=this.visit(t);if("object"==typeof a&&2===a.length&&a.every((e=>-1!==["in","is","not"].indexOf(e))))return this.Syntax.equality.template(e,"!=",this.visit(r[n+1]));if(-1!==[">","<","<=",">=","<>","==","!=","is"].indexOf(a))return this.Syntax.equality.template(e,a,this.visit(r[n+1]));if("in"===a||"notin"===a)return this.Syntax.in.template.bind(this.state)(e,a,this.visit(r[n+1]));throw new o(`Unrecognized operation ${a}`)}),this.visit(e.children[0]))}emitLongfromBits(e){e.type=this.Types.Long;const t=this.Symbols.Long.attr.fromBits,n=this.checkArguments(t.args,this.getArguments(e),"Long.fromBits");return r.Long.fromBits(...n)}emitRegex(e,t,n){return new r.BSONRegExp(t,n)}emit_array(e){return e.type=this.Types._array,this.requiredImports[9]=!0,this.getList(e).map((e=>this.visit(e)))}emit_object(e){e.type=this.Types._object,this.requiredImports[10]=!0;const t={};return this.getKeyValueList(e).map((e=>{const n=this.getKeyStr(e);t[n]="$where"===n?s(this.getValue(e).getText()):this.visit(this.getValue(e))})),t}emitdatetime(e,t,n){return null===t&&n?Date():null===t?new Date:t}emitDate(e,t,n){return null===t&&n?Date():null===t?new Date:t}emitNumber(e,t){return Number(t)}emitint(e,t){return new r.Int32(t)}emitfloat(e,t){return new r.Double(t)}}},1206:(e,t,n)=>{"use strict";const r=n(4702);e.exports=e=>class extends e{constructor(){super(),this.state.utils=new r}}},4702:e=>{"use strict";e.exports=class{constructor(){}convertToString(e){return void 0===e?"":e}toPHPArray(e){return(e=this.convertToString(e)).length>0&&"["!==e.charAt(0)&&(e=`[${e}]`),e}removePHPObject(e){return 0===(e=this.convertToString(e)).indexOf("(object) ")&&(e=e.slice(9)),e}removeStringQuotes(e){return("'"===(e=this.convertToString(e)).charAt(0)&&"'"===e.charAt(e.length-1)||'"'===e.charAt(0)&&'"'===e.charAt(e.length-1))&&(e=e.substr(1,e.length-2)),e}stringify(e){return`${(e=this.removeStringQuotes(e)).replace(/\\([\s\S])/g,"\\$1")}`}stringifyWithSingleQuotes(e){return`'${(e=this.removeStringQuotes(e)).replace(/\\([\s\S])|(')/g,"\\$1$2")}'`}stringifyWithDoubleQuotes(e){return`"${(e=this.removeStringQuotes(e)).replace(/\\([\s\S])|(")/g,"\\$1$2")}"`}}},3470:e=>{"use strict";e.exports=e=>class extends e{constructor(){super()}}},4520:e=>{"use strict";e.exports=e=>class extends e{constructor(){super()}}},4630:e=>{"use strict";e.exports=e=>class extends e{constructor(){super()}}},4127:(e,t,n)=>{"use strict";var r=n(5081).hp;const a=n(5106),i=n(7520),{BsonTranspilersRuntimeError:o,BsonTranspilersUnimplementedError:s}=n(1005);e.exports=e=>class extends e{constructor(){super()}processNumberLong(e){return this.generateNumericClass(e)}executeJavascript(e){const t={RegExp,DBRef:i.DBRef,Map:i.Map,MaxKey:i.MaxKey,MinKey:i.MinKey,ObjectId:i.ObjectId,BSONSymbol:i.BSONSymbol,Timestamp:i.Timestamp,Decimal128:i.Decimal128,Long:i.Long,Int32:i.Int32,Double:i.Double,Code:function(e,t){return new i.Code(e,t)},NumberDecimal:function(e){return void 0===e&&(e="0"),i.Decimal128.fromString(e.toString())},NumberInt:function(e){return parseInt(e,10)},NumberLong:function(e){return void 0===e&&(e=0),i.Long.fromNumber(e)},ISODate:function(e){return new Date(e)},Date:function(e){const t=Array.from(arguments);return 1===t.length?new Date(e):new Date(Date.UTC(...t))},Buffer:r,__result:{}};return a.runInContext("__result = "+e,a.createContext(t))}processBinData(){throw new s("BinData type not supported")}processNumberDecimal(e){e.type=this.Types.NumberDecimal;const t=this.Symbols.NumberDecimal;let n;try{n=this.executeJavascript(`new ${e.getText()}`).toString()}catch(e){throw new o(e.message)}if("emitNumberDecimal"in this)return this.emitNumberDecimal(e,n);const r=t.template?t.template():this.returnFunctionCallLhs(t.code,"NumberDecimal"),a=this.returnFunctionCallLhsRhs(r,[n],t,r);return this.Syntax.new.template?this.Syntax.new.template(a,!1,e.type.code):this.returnFunctionCallLhsRhs(r,[n],t,r)}processISODate(e){return e.wasNew=!0,this.processDate(e)}processCode(e){e.type=this.Types.Code;const t=this.Symbols.Code,n=t.template?t.template():this.returnFunctionCallLhs(t.code,"Code");if(0===this.getArguments(e).length){const r=this.returnFunctionCallLhsRhs(n,[],t,n);return this.Syntax.new.template?this.Syntax.new.template(r,!1,e.type.code):r}return this.generateBSONCode(e,e.type,t,!0)}}},1005:(e,t,n)=>{"use strict";n(8854);const r=n(9206),a={};Object.keys(r).forEach((e=>{const t=`BsonTranspilers${e}Error`,n=`E_BSONTRANSPILERS_${e.toUpperCase()}`,i=r[e].message;a[t]=class extends Error{constructor(e,r){const o=e||i;super(),this.name=t,this.code=n,this.message=o,r&&"stack"in r?this.stack=r.stack:Error.captureStackTrace(this,a[t]),Object.assign(this,r||{})}}})),e.exports=a},1604:e=>{"use strict";e.exports={doubleQuoteStringify:function(e){let t=e.toString();return("'"===t.charAt(0)&&"'"===t.charAt(t.length-1)||'"'===t.charAt(0)&&'"'===t.charAt(t.length-1))&&(t=t.substr(1,t.length-2)),`"${t.replace(/\\([\s\S])|(")/g,"\\$1$2")}"`},singleQuoteStringify:function(e){let t=e.toString();return("'"===t.charAt(0)&&"'"===t.charAt(t.length-1)||'"'===t.charAt(0)&&'"'===t.charAt(t.length-1))&&(t=e.substr(1,t.length-2)),`'${t.replace(/\\([\s\S])|(')/g,"\\$1$2")}'`},removeQuotes:function(e){let t=e.toString();return('"'===t.charAt(0)&&'"'===t.charAt(t.length-1)||"'"===t.charAt(0)&&"'"===t.charAt(t.length-1))&&(t=t.substr(1,t.length-2)),t}}},70:(e,t,n)=>{"use strict";n(8451);const r=n(5525),a=n(2287),i=n(9770),o=n(1619)._,s=n(2798),{BsonTranspilersInternalError:l,BsonTranspilersUnimplementedError:p}=n(1005),u=n(1671),m=n(8631),c=n(3636),h=n(4127),g=n(2208),T=n(3470),y=n(7483),d=n(4307),f=n(8811),S=n(4520),b=n(394),x=n(4630),A=n(1206),L=n(493),E=n(6691),I=n(7178),D=n(2850),v=n(4314),_=n(741),C=n(9503),O=n(303),B=n(7905),j=(e,t)=>{const n=new r.InputStream(e),o=new a.ECMAScriptLexer(n);o.strictMode=!1;const l=new r.CommonTokenStream(o),p=new i.ECMAScriptParser(l);p.buildParseTrees=!0;const u=new s;return p.removeErrorListeners(),p.addErrorListener(u),p[t]()},N=(e,t,n,r)=>{const a=new(n(t)),i=u.load(r);["BasicTypes","BsonTypes","NativeTypes","SymbolTypes","BsonTypes","BsonSymbols","NativeSymbols","SymbolTypes"].map((e=>{if(!(e in i))throw new l(`Invalid Symbol Table: missing ${e}`)})),Object.assign(a,{SYMBOL_TYPE:i.SymbolTypes,BsonTypes:i.BsonTypes,Symbols:Object.assign({},i.BsonSymbols,i.NativeSymbols),Types:Object.assign({},i.BasicTypes,i.BsonTypes,i.NativeTypes),Syntax:i.Syntax,Imports:i.Imports});const o=(t,n,r)=>{try{const i=e(t,a.startRule);return a.idiomatic=void 0===n?a.idiomatic:n,r||(a.clearImports(),a.clearDeclarations()),a.start(i,!r)}catch(e){if(e.code&&e.code.includes("BSONTRANSPILERS"))throw e;throw new l(e.message,e)}finally{a.idiomatic=!0}};return{compileWithDriver:(e,t)=>{a.clearImports(),a.clearDeclarations();const n={};if(Object.keys(e).map((r=>{n[r]="options"===r||"exportMode"===r?e[r]:o(e[r],t,!0)})),!("options"in n&&"uri"in n.options&&"database"in n.options&&"collection"in n.options))throw new l("Missing required metadata to generate drivers syntax");if(!("aggregation"in n)&&!("filter"in n))throw new l("Need to pass 'aggregation' or 'filter' when compiling with driver syntax");if(!a.Syntax.driver)throw new p("Generating driver syntax not implemented for current language");return a.Syntax.driver.bind(a.getState())(n)},compile:o,getImports:(e,t)=>a.getImports(e,t)}};e.exports={shell:{java:N(j,h(c(m(o))),g,L),python:N(j,h(c(m(o))),T,E),csharp:N(j,h(c(m(o))),y,I),javascript:N(j,h(c(m(o))),d,D),object:N(j,h(c(m(o))),f,v),ruby:N(j,h(c(m(o))),S,_),go:N(j,h(c(m(o))),b,C),rust:N(j,h(c(m(o))),x,O),php:N(j,h(c(m(o))),A,B)},getTree:{shell:j}}},2287:(e,t,n)=>{n(8451);var r=n(5525),a=["悋Ꜫ脳맭䅼㯧瞆奤","kϏ\b\t\t","\t\t\t\t","\b\t\b\t\t\t\n\t\n\v\t\v","\f\t\f\r\t\r\t\t","\t\t\t\t","\t\t\t","\t\t\t\t","\t\t\t",'\t\t \t !\t!"\t"#',"\t#$\t$%\t%&\t&'\t'(\t()\t)","*\t*+\t+,\t,-\t-.\t./\t/0\t0","1\t12\t23\t34\t45\t56\t67\t7","8\t89\t9:\t:;\t;<\t<=\t=>\t>","?\t?@\t@A\tAB\tBC\tCD\tDE\tE","F\tFG\tGH\tHI\tIJ\tJK\tKL\tL","M\tMN\tNO\tOP\tPQ\tQR\tRS\tS","T\tTU\tUV\tVW\tWX\tXY\tYZ\tZ","[\t[\\\t\\]\t]^\t^_\t_`\t`a\ta","b\tbc\tcd\tde\tef\tfg\tgh\th","i\tij\tjk\tkl\tlm\tmn\tno\to","p\tpq\tqr\trs\tst\ttu\tuv\tv","w\twx\txy\tyz\tz{\t{|\t|}\t}","~\t~\t\t\t","\t\t\t
\t","
\t\t\t","\t\t","","","\b\b\t\t","\n\n\v\v\f\f\r","\r","","","","","",""," !!",'!""""####',"$$%%&&'''(","(()))***+","++,,,---..","..////0000","0111222333","4444455555","5555566666","66666Ʒ\n6777ƻ\n","78888ǀ\n8\f88ǃ\v8","88dž\n8888NJ\n8\r88Nj","88Ǐ\n88Ǒ\n89999ǖ","\n9\r99Ǘ::::ǝ\n:\r::Ǟ",":::::ǥ\n:\r::Ǧ:","ǩ\n:;;;;;;<<","<=========","==>>>>>>>?","????@@@@@A","AAABBBBCCC","CCCDDDDDDD","DEEEEEEEFF","FFFGGGGGGG","GGHHHHIIII","IIIJJJJJJK","KKKKKKKKLL","LLLLLLLMMM","MMNNNNNOOO","OOOOOPPPQQ","QQQQRRRRRR","RSSSTTTTUU","UUUUVVVVVW","WWWWWWWXXX","XXXYYYYYYZ","ZZZZZZ[[[[","[[[\\\\\\\\\\\\","\\\\\\\\\\\\]]]","]]^^^^^^^^","^________`","``````````","aaaaaaaaab","bbbbbbbbbb","ccccccccdd","dddddeeĕ\ne\fe","ẻ\vefff̍\nf\fff̐\vf","ffff̕\nf\fff̘\vff","f̛\nfgg̞\ng\rgg̟g","ghhhhh̨\nh\fhh̫\v","hhhhhhiiii","i̶\ni\fii̹\viiijj","kkkkk̓\nkllll","l͉\nlmmmmm͏\nmn","nn͓\nnooooppp","pppqqrrsss","sͦ\nstttuuuuͮ\n","uvvwwxxyyy","y\ny\fyyͼ\vyy;\nyzz","z\nzzz΅\nz\rzzΆ{{","{{{\n{||||||","|Ε\n|}}Θ\n}~~Λ\n~","Ξ\nΡ\n","","Ω\n\fά\v","ί\n\fβ\v","
η\n
","μ\n","","υ\n\fψ\v","ώ\n","̩\t\v","\r\b\t\n\v\f\r","!#%')+","-/13579;= ?!A","\"C#E$G%I&K'M(O)Q*S+U,W-Y.[/]0_1a2c3e4g5i6k7m8o9q:s;u<w=y>{?}@","ABC
DEFGHIJ","KLMNOPQ¡R£S¥T§","U©V«WX¯Y±Z³[µ\\·]¹^»","_½`¿aÁbÃcÅdÇeÉfËgÍhÏ","iÑjÓkÕ×ÙÛÝ","ßáãåçé","ëíïñóõ","÷ùûýÿā","ăąćĉċč","ďđē","\f\fZZzzQQqq",'\v\v\r""¢¢\f\f$$^',"^\f\f))^^\v$$))^^ddhhppttvvxx","\f\f$$))2;^^ddhhppttvxzzwwzz","2;2;CHch293;GGgg","--//&&aaĄC\\c|¬¬··","¼¼ÂØÚøúȡȤȵɒʯ","ʲʺʽ˃˒˓ˢ˦˰˰ͼͼ","ΈΈΊΌΎΎΐΣΥϐϒϙ","ϜϵЂ҃ҎӆӉӊӍӎӒӷ","ӺӻԳ՛՛գ։גײ״","أؼقٌٳەۗۗۧۨۼ۾","ܒܒܔܮނާइऻिि॒॒","ग़ॣইকপবল","সয়ৡৣ৲৳ਇ","ਕਪਬਲਵਸਜ਼ਫ਼","ੴ੶ઇઍએએઑઓકપ","બલવષિિૢૢ","ଇକପବଲଵସ","ିିୟୡୣஇஐஒஔ","ஜஞஞபரஷ","ஹఇఎఐఒఔపబవష","ౢౣಇಎಐಒಔಪಬವಷ","ೠೠೢೣഇഎഐഒഔപബ഻","ൢൣඇගඳඵලෂ","ฃาิีโ่ຄຆຆຉຊ","ຌຌຏຏຖນປມຣລວວ","ຩຩຬອຯາິີໆ່່","ໞໟ༂༂གཬྊྍဂဣဥဩ","ါာၒၗႢჇგჸᄂᅛᅡᆤ","ᆪᇻሂለሊቈቊቊቌቒቘ","ቚቚቜቢኈኊኊኌኒኰ","ኲኲኴኺዀዂዂዄዊዐ","ዒዘዚደዲጐጒጒጔጚጠ","ጢፈፊᎢᐃᙸᚃ᚜ᚢ᛬","គ឵ᠢᢂᢪḂẝẢỻἂ","ἚἢὊὒὙὛὛὝὝ","ὟὟὡᾂᾶᾸι῀῀ῄῆ","Ὲ῎ῒῘ῝ῢ΅ῴῶῸ῾","₁₁℄℄℉℉ℌℕ℗℗ℛ℟","ΩΩℨℨKKℬℯℱℳℵ℻","Ⅲↅ〇〉〣〫〳〷〺〼ぃゖ","ゟ゠ィーヾㄇㄮㄳ㆐ㆢㆹ","㐂㐂䶷䶷丂丂龧龧ꀂ갂갂","車隷flﬕײַײַﬡשׁ","שּׁטּךּמּנּנּףּצּרּ﮳","ﯕ﴿ﵒﶔﷲ﷽ﹲﹴﹶﹶ","ﹸC\c|ィᅣᅩ","ᅯᅵf̂͐ͤ҅͢҈","ֻֽֿׁׁ֣֥֓׃ׄ׆׆","ٍٗٲٲۘ۞ۡۦ۩۪۬ۯ","ܓܓܲިःअााीॏ","॓ॖ।॥ঃঅা্","ਾਾੀ","੍ੲੳઃઅાાીેૉો","્ଃଅାାୀ୍","அீைொௌ","ఃఅీెైొౌౘ಄ಅ","ೀೆೈೊೌഄഅീ","ൈൊൌ൏൙൙අෑූ","ෘෘේ෴ำำึ้๐","ຳຳຶົຽ໊༚༛༷༷","༹༹༻༻ཀཁཱི྆ྈྉྒྙ","ྛ྾࿈࿈ီဴးျၘၛា៕","⃒⃞⃣⃣〬〱゛゜ﬠﬠ","︢︥2;٢٫۲ۻ२ॱ২","ৱ੨ੱ૨૱୨ୱ௩௱౨೨","ೱ൨൱๒๛໒༢༫၂။፫","፳២᠒2;\taa⁁⁂ヽ","ヽ︵︶﹏﹑aaァァ\b\f\f",",,11]^\f\f11]^","\f\f^_Ϟ","","\t\v","\r","","","","","!#","%'",")+","-/","135","79",";=","?A","CE","GIK","MO","QS","UW","Y[","]_a","ce","gi","km","oq","suw","y{","}","","
","","","","","","","¡£","¥§","©«","¯","±³","µ·","¹»","½¿","ÁÃ","ÅÇ","ÉË","ÍÏ","ÑÓ","ĕě","ğ\tġ","\vģ\rĥ","ħĩ","īĭ","įı","ijĵ","ķ!ĺ","#Ľ%Ŀ","'Ł)Ń","+Ņ-Ň/ʼn","1ŋ3Ŏ","5ő7ŕ","9ŗ;ř","=Ŝ?ş","AŢCťEũ","GŭIů","KűMų","OŶQŹ","SżUſ","WƂYƅ[ƈ","]ƌ_Ɛ","aƕcƘ","eƛgƞ","iƣkƶ","mƸoǐqǒ","sǨuǪ","wǰydz","{Ǿ}ȅ","Ȋȏ","ȓ
ȗ","ȝȥ","Ȭȱ","ȺȾ","Ʌɋ","ɔɝ","ɢɧ","ɯ¡ɲ","£ɸ¥ɿ","§ʂ©ʆ","«ʌʑ","¯ʙ±ʟ","³ʥµʬ","·ʳ¹ʿ","»˄½ˍ","¿˕Áˠ","Ã˩Å˴","Ç˼É̃","Ë̚Í̝","Ị̈Ṉ̃","Ó̼Õ͂","×͈Ù͎","Û͒Ý͔","ß͘á͞","ã͠åͥ","çͧéͭ","ëͯíͱ","ïͳñͽ","óͿõΌ","÷ΔùΗ","ûΚýΝ","ÿΠā","ăΤąΦ","ćΰĉζ","ċλčν","ďοđς","ēύĕĖ","Ėė1ėĘą","Ęę1ęĚć","ĚěĜ\t","ĜĝĝĞ\b","ĞğĠ]","Ġ\bġĢ_","Ģ\nģĤ*Ĥ","\fĥĦ+Ħ","ħĨ}Ĩ","ĩĪĪ","īĬ=Ĭ","ĭĮ.Į","įİ?İ","ıIJAIJ","ijĴ<Ĵ","ĵĶ0Ķ","ķĸ-ĸĹ","-Ĺ ĺĻ",'/Ļļ/ļ"',"Ľľ-ľ$","Ŀŀ/ŀ&Ł","łł(Ń","ń#ń*Ņņ",",ņ,Ňň","1ň.ʼnŊ'","Ŋ0ŋŌ@","Ōō@ō2Ŏ","ŏ>ŏŐ>Ő4","őŒ@Œœ","@œŔ@Ŕ6","ŕŖ>Ŗ8","ŗŘ@Ř:ř","Ś>Śś?ś<","Ŝŝ@ŝŞ","?Ş>şŠ?","Šš?š@","Ţţ#ţŤ?Ť","BťŦ?Ŧŧ","?ŧŨ?ŨD","ũŪ#Ūū?","ūŬ?ŬF","ŭŮ(ŮHů","Ű`ŰJűŲ","~ŲLųŴ","(Ŵŵ(ŵN","Ŷŷ~ŷŸ~","ŸPŹź,ź","Ż?ŻRżŽ","1Žž?žT","ſƀ'ƀƁ?","ƁVƂƃ-","ƃƄ?ƄXƅ","Ɔ/ƆƇ?ƇZ","ƈƉ>ƉƊ",">ƊƋ?Ƌ\\","ƌƍ@ƍƎ@","ƎƏ?Ə^Ɛ","Ƒ@Ƒƒ@ƒƓ","@ƓƔ?Ɣ`","ƕƖ(ƖƗ?","ƗbƘƙ`","ƙƚ?ƚdƛ","Ɯ~ƜƝ?Ɲf","ƞƟpƟƠ","wƠơnơƢn","ƢhƣƤw","ƤƥpƥƦfƦ","ƧgƧƨhƨƩ","kƩƪpƪƫ","gƫƬfƬj","ƭƮvƮƯt","ƯưwưƷgƱ","ƲhƲƳcƳƴ","nƴƵuƵƷ","gƶƭƶƱ","ƷlƸƺ","ñyƹƻózƺƹ","ƺƻƻn","Ƽƽñyƽǁ0","ƾǀëvƿƾ","ǀǃǁƿ","ǁǂǂDž","ǃǁDŽdžóz","DžDŽDždž","džǑLJlj0","LjNJëvljLj","NJNjNjlj","Njnjnjǎ","ǍǏózǎǍ","ǎǏǏǑ","ǐƼǐLJ","ǑpǒǓ2","ǓǕ\tǔǖíwǕ","ǔǖǗǗ","ǕǗǘǘ","rǙǚ:ǚǜ","2ǛǝïxǜǛ","ǝǞǞǜ","Ǟǟǟǩ","Ǡǡ:ǡǢ","2ǢǤ\tǣǥï","xǤǣǥǦ","ǦǤǦǧ","ǧǩǨǙ","ǨǠǩt","ǪǫdǫǬt","ǬǭgǭǮc","Ǯǯmǯvǰ","DZfDZDzqDzx","dzǴkǴǵ","pǵǶuǶǷv","ǷǸcǸǹp","ǹǺeǺǻgǻ","ǼqǼǽhǽz","ǾǿvǿȀ","{ȀȁrȁȂg","ȂȃqȃȄh","Ȅ|ȅȆeȆ","ȇcȇȈuȈȉ","gȉ~Ȋȋ","gȋȌnȌȍu","ȍȎgȎ","ȏȐpȐȑg","ȑȒyȒ","ȓȔxȔȕcȕ","ȖtȖȗ","ȘeȘșcșȚ","vȚțețȜ","jȜȝȞ","hȞȟkȟȠp","ȠȡcȡȢn","ȢȣnȣȤ{Ȥ","ȥȦtȦ","ȧgȧȨvȨȩ","wȩȪtȪȫ","pȫȬȭ","xȭȮqȮȯk","ȯȰfȰ","ȱȲeȲȳq","ȳȴpȴȵvȵ","ȶkȶȷpȷȸ","wȸȹgȹ","ȺȻhȻȼ","qȼȽtȽ","Ⱦȿuȿɀy","ɀɁkɁɂv","ɂɃeɃɄjɄ","ɅɆyɆ","ɇjɇɈkɈɉ","nɉɊgɊ","ɋɌfɌɍ","gɍɎdɎɏw","ɏɐiɐɑi","ɑɒgɒɓtɓ","ɔɕhɕ","ɖwɖɗpɗɘ","eɘəvəɚ","kɚɛqɛɜp","ɜɝɞv","ɞɟjɟɠk","ɠɡuɡ","ɢɣyɣɤkɤ","ɥvɥɦjɦ","ɧɨfɨɩ","gɩɪhɪɫ","cɫɬwɬɭn","ɭɮvɮ","ɯɰkɰɱh","ɱ ɲɳv","ɳɴjɴɵtɵ","ɶqɶɷyɷ¢","ɸɹfɹɺ","gɺɻnɻɼ","gɼɽvɽɾg","ɾ¤ɿʀk","ʀʁpʁ¦","ʂʃvʃʄt","ʄʅ{ʅ¨","ʆʇeʇʈnʈ","ʉcʉʊuʊʋ","uʋªʌʍ","gʍʎpʎʏ","wʏʐoʐ¬","ʑʒgʒʓz","ʓʔvʔʕg","ʕʖpʖʗfʗ","ʘuʘ®ʙ","ʚuʚʛwʛʜ","rʜʝgʝʞ","tʞ°ʟʠ","eʠʡqʡʢp","ʢʣuʣʤv","ʤ²ʥʦg","ʦʧzʧʨrʨ","ʩqʩʪtʪʫ","vʫ´ʬʭ","kʭʮoʮʯ","rʯʰqʰʱt","ʱʲvʲ¶","ʳʴ\\ʴʵk","ʵʶoʶʷrʷ","ʸnʸʹgʹʺ","oʺʻgʻʼ","pʼʽvʽʾu","ʾ¸ʿˀ]","ˀˁnˁ˂g","˂˃v˃º","˄˅^˅ˆrˆ","ˇtˇˈkˈˉ","xˉˊcˊˋ","vˋˌgˌ¼","ˍˎ_\bˎˏr","ˏːwːˑdˑ","˒n˒˓k˓˔","e˔¾˕˖","`\t˖˗k˗˘p","˘˙v˙˚g","˚˛t˛˜h˜","˝c˝˞e˞˟","g˟Àˠˡ","a\nˡˢrˢˣc","ˣˤeˤ˥m","˥˦c˦˧i˧","˨g˨Â˩","˪b\v˪˫r˫ˬ","tˬ˭q˭ˮ","vˮ˯g˯˰e","˰˱v˱˲g","˲˳f˳Ä","˴˵c\f˵˶u˶˷","v˷˸c˸˹","v˹˺k˺˻e","˻Æ˼˽d\r","˽˾{˾˿k˿","̀g̀́ń̂","f̂È̃̇","õ{̄̆÷|̅̄","̆̉̇̅","̇̈̈Ê","̉̇̊̎","$̋̍Õǩ̋","̍̐̎̌","̎̏̏̑","̛̐̎̑$","̖̒)̓̕×","l̘̔̓̕","̖̖̗̔","̗̙̘̖","̛̙)̊̚","̛̒̚Ì","̜̞\t̝̜","̞̟̟̝","̡̟̠̠","̡̢\bg̢Î","̣̤1̤̥,","̨̥̩̦\v","̧̨̦̫","̧̩̪̩","̪̬̫̩","̬̭,̭̮1̮","̯̯̰\bh̰Ð","̱̲1̲̳","1̷̴̶̳","\n̵̴̶̹","̷̵̷̸","̸̷̺̹","̺̻\bi̻Ò","̼̽\v̽Ô","̾̓\n̿̀","^̀̓Ùḿ̓ç","t͂̾͂̿","͂́̓Ö","͉̈́\n͆ͅ^","͉͆Ùm͇͉çt","͈͈̈́ͅ","͈͇͉Ø","͊͏Ûn͋͏2͌","͏Ýo͍͏ßp͎͊","͎͎͋͌","͎͍͏Ú","͓͐áq͓͑","ãr͒͐͒͑","͓Ü͔͕","z͕͖íw͖͗","íw͗Þ͙͘","w͙͚íw͚͛í","w͛͜íw͜͝íw","͝à͟͞\t\b͟","â͠͡\n\t͡ä","ͦ͢áqͣͦ","ëvͤͦ\t\nͥ͢","ͥͣͥͤ","ͦæͧͨ^","ͨͩéuͩè","ͪͫͫͮ\f","ͬͮͭͪ","ͭͬͮê","ͯͰ\t\vͰì","ͱͲ\t\fͲî","ͳʹ\t\rʹð","͵;2Ͷͺ\tͷ","ëvͷ","ͼͺͺ","ͻͻ;ͼ","ͺͽ͵ͽ","Ͷ;òͿ","\t\t","΄","΅ëv΄","΅ΆΆ΄","Ά··ô","Έù}Ή","\tΊ^","ßpΌΈΌΉ","ΌΊö","ΎΕõ{ΏΕ","û~ΐΕýΑΕ","ÿΒΕāΓΕ","ăΔΎΔΏ","ΔΐΔΑ","ΔΒΔΓ","ΕøΖΘ\t","ΗΖΘú","ΙΛ\tΚΙ","ΛüΜΞ\t","ΝΜΞþ","ΟΡ\tΠΟ","ΡĀΣ","ΣĂΤΥ","ΥĄΦΪ","ĉ
ΧΩċΨΧ","ΩάΪΨ","ΪΫΫĆ","άΪέί","÷|ήέίβ","ΰήΰα","αĈβΰ","γη\nδη","ďεηđζγ","ζδζε","ηĊθμ\n","ιμďκμ","đλθλι","λκμČ","νξ\nξĎ","οπ^πρ","čρĐςφ","]συēτσ","υψφτ","φχχω","ψφωϊ","_ϊĒϋώ\n","όώďύϋ","ύόώĔ","+ƶƺǁDžNjǎǐǗ","ǞǦǨ̷̖̟̩͈̇̎͂̚","͎͒ͥͭͺͽΆΌΔΗΚ","ΝΠΪΰζλφύ"].join(""),i=(new r.atn.ATNDeserializer).deserialize(a),o=i.decisionToState.map((function(e,t){return new r.dfa.DFA(e,t)}));function s(e){return r.Lexer.call(this,e),this._interp=new r.atn.LexerATNSimulator(this,i,o,new r.PredictionContextCache),this}s.prototype=Object.create(r.Lexer.prototype),s.prototype.constructor=s,Object.defineProperty(s.prototype,"atn",{get:function(){return i}}),s.EOF=r.Token.EOF,s.RegularExpressionLiteral=1,s.LineTerminator=2,s.OpenBracket=3,s.CloseBracket=4,s.OpenParen=5,s.CloseParen=6,s.OpenBrace=7,s.CloseBrace=8,s.SemiColon=9,s.Comma=10,s.Assign=11,s.QuestionMark=12,s.Colon=13,s.Dot=14,s.PlusPlus=15,s.MinusMinus=16,s.Plus=17,s.Minus=18,s.BitNot=19,s.Not=20,s.Multiply=21,s.Divide=22,s.Modulus=23,s.RightShiftArithmetic=24,s.LeftShiftArithmetic=25,s.RightShiftLogical=26,s.LessThan=27,s.MoreThan=28,s.LessThanEquals=29,s.GreaterThanEquals=30,s.Equals=31,s.NotEquals=32,s.IdentityEquals=33,s.IdentityNotEquals=34,s.BitAnd=35,s.BitXOr=36,s.BitOr=37,s.And=38,s.Or=39,s.MultiplyAssign=40,s.DivideAssign=41,s.ModulusAssign=42,s.PlusAssign=43,s.MinusAssign=44,s.LeftShiftArithmeticAssign=45,s.RightShiftArithmeticAssign=46,s.RightShiftLogicalAssign=47,s.BitAndAssign=48,s.BitXorAssign=49,s.BitOrAssign=50,s.NullLiteral=51,s.UndefinedLiteral=52,s.BooleanLiteral=53,s.IntegerLiteral=54,s.DecimalLiteral=55,s.HexIntegerLiteral=56,s.OctalIntegerLiteral=57,s.Break=58,s.Do=59,s.Instanceof=60,s.Typeof=61,s.Case=62,s.Else=63,s.New=64,s.Var=65,s.Catch=66,s.Finally=67,s.Return=68,s.Void=69,s.Continue=70,s.For=71,s.Switch=72,s.While=73,s.Debugger=74,s.Function=75,s.This=76,s.With=77,s.Default=78,s.If=79,s.Throw=80,s.Delete=81,s.In=82,s.Try=83,s.Class=84,s.Enum=85,s.Extends=86,s.Super=87,s.Const=88,s.Export=89,s.Import=90,s.Implements=91,s.Let=92,s.Private=93,s.Public=94,s.Interface=95,s.Package=96,s.Protected=97,s.Static=98,s.Yield=99,s.Identifier=100,s.StringLiteral=101,s.WhiteSpaces=102,s.MultiLineComment=103,s.SingleLineComment=104,s.UnexpectedCharacter=105,s.prototype.channelNames=["DEFAULT_TOKEN_CHANNEL","HIDDEN"],s.prototype.modeNames=["DEFAULT_MODE"],s.prototype.literalNames=[null,null,null,"'['","']'","'('","')'","'{'","'}'","';'","','","'='","'?'","':'","'.'","'++'","'--'","'+'","'-'","'~'","'!'","'*'","'/'","'%'","'>>'","'<<'","'>>>'","'<'","'>'","'<='","'>='","'=='","'!='","'==='","'!=='","'&'","'^'","'|'","'&&'","'||'","'*='","'/='","'%='","'+='","'-='","'<<='","'>>='","'>>>='","'&='","'^='","'|='","'null'","'undefined'",null,null,null,null,null,"'break'","'do'","'instanceof'","'typeof'","'case'","'else'","'new'","'var'","'catch'","'finally'","'return'","'void'","'continue'","'for'","'switch'","'while'","'debugger'","'function'","'this'","'with'","'default'","'if'","'throw'","'delete'","'in'","'try'","'class'","'enum'","'extends'","'super'","'const'","'export'","'import'"],s.prototype.symbolicNames=[null,"RegularExpressionLiteral","LineTerminator","OpenBracket","CloseBracket","OpenParen","CloseParen","OpenBrace","CloseBrace","SemiColon","Comma","Assign","QuestionMark","Colon","Dot","PlusPlus","MinusMinus","Plus","Minus","BitNot","Not","Multiply","Divide","Modulus","RightShiftArithmetic","LeftShiftArithmetic","RightShiftLogical","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals","NotEquals","IdentityEquals","IdentityNotEquals","BitAnd","BitXOr","BitOr","And","Or","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","LeftShiftArithmeticAssign","RightShiftArithmeticAssign","RightShiftLogicalAssign","BitAndAssign","BitXorAssign","BitOrAssign","NullLiteral","UndefinedLiteral","BooleanLiteral","IntegerLiteral","DecimalLiteral","HexIntegerLiteral","OctalIntegerLiteral","Break","Do","Instanceof","Typeof","Case","Else","New","Var","Catch","Finally","Return","Void","Continue","For","Switch","While","Debugger","Function","This","With","Default","If","Throw","Delete","In","Try","Class","Enum","Extends","Super","Const","Export","Import","Implements","Let","Private","Public","Interface","Package","Protected","Static","Yield","Identifier","StringLiteral","WhiteSpaces","MultiLineComment","SingleLineComment","UnexpectedCharacter"],s.prototype.ruleNames=["RegularExpressionLiteral","LineTerminator","OpenBracket","CloseBracket","OpenParen","CloseParen","OpenBrace","CloseBrace","SemiColon","Comma","Assign","QuestionMark","Colon","Dot","PlusPlus","MinusMinus","Plus","Minus","BitNot","Not","Multiply","Divide","Modulus","RightShiftArithmetic","LeftShiftArithmetic","RightShiftLogical","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals","NotEquals","IdentityEquals","IdentityNotEquals","BitAnd","BitXOr","BitOr","And","Or","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","LeftShiftArithmeticAssign","RightShiftArithmeticAssign","RightShiftLogicalAssign","BitAndAssign","BitXorAssign","BitOrAssign","NullLiteral","UndefinedLiteral","BooleanLiteral","IntegerLiteral","DecimalLiteral","HexIntegerLiteral","OctalIntegerLiteral","Break","Do","Instanceof","Typeof","Case","Else","New","Var","Catch","Finally","Return","Void","Continue","For","Switch","While","Debugger","Function","This","With","Default","If","Throw","Delete","In","Try","Class","Enum","Extends","Super","Const","Export","Import","Implements","Let","Private","Public","Interface","Package","Protected","Static","Yield","Identifier","StringLiteral","WhiteSpaces","MultiLineComment","SingleLineComment","UnexpectedCharacter","DoubleStringCharacter","SingleStringCharacter","EscapeSequence","CharacterEscapeSequence","HexEscapeSequence","UnicodeEscapeSequence","SingleEscapeCharacter","NonEscapeCharacter","EscapeCharacter","LineContinuation","LineTerminatorSequence","DecimalDigit","HexDigit","OctalDigit","DecimalIntegerLiteral","ExponentPart","IdentifierStart","IdentifierPart","UnicodeLetter","UnicodeCombiningMark","UnicodeDigit","UnicodeConnectorPunctuation","ZWNJ","ZWJ","RegularExpressionBody","RegularExpressionFlags","RegularExpressionFirstChar","RegularExpressionChar","RegularExpressionNonTerminator","RegularExpressionBackslashSequence","RegularExpressionClass","RegularExpressionClassChar"],s.prototype.grammarFileName="ECMAScript.g4",s.prototype.strictMode=!0,s.prototype.lastToken=null,s.prototype.getStrictMode=function(){return this.strictMode},s.prototype.setStrictMode=function(e){this.strictMode=e},s.prototype.nextToken=function(){var e=r.Lexer.prototype.nextToken.call(this);return e.channel==r.Token.DEFAULT_CHANNEL&&(this.lastToken=e),e},s.prototype.isRegexPossible=function(){if(null==this.lastToken)return!0;switch(this.lastToken.type){case s.Identifier:case s.NullLiteral:case s.UndefinedLiteral:case s.BooleanLiteral:case s.This:case s.CloseBracket:case s.CloseParen:case s.OctalIntegerLiteral:case s.IntegerLiteral:case s.DecimalLiteral:case s.HexIntegerLiteral:case s.StringLiteral:case s.PlusPlus:case s.MinusMinus:return!1;default:return!0}},s.prototype.sempred=function(e,t,n){switch(t){case 0:return this.RegularExpressionLiteral_sempred(e,n);case 56:return this.OctalIntegerLiteral_sempred(e,n);case 90:return this.Implements_sempred(e,n);case 91:return this.Let_sempred(e,n);case 92:return this.Private_sempred(e,n);case 93:return this.Public_sempred(e,n);case 94:return this.Interface_sempred(e,n);case 95:return this.Package_sempred(e,n);case 96:return this.Protected_sempred(e,n);case 97:return this.Static_sempred(e,n);case 98:return this.Yield_sempred(e,n);default:throw"No registered predicate for:"+t}},s.prototype.RegularExpressionLiteral_sempred=function(e,t){if(0===t)return this.isRegexPossible();throw"No predicate with index:"+t},s.prototype.OctalIntegerLiteral_sempred=function(e,t){switch(t){case 1:case 2:return!this.strictMode;default:throw"No predicate with index:"+t}},s.prototype.Implements_sempred=function(e,t){if(3===t)return this.strictMode;throw"No predicate with index:"+t},s.prototype.Let_sempred=function(e,t){if(4===t)return this.strictMode;throw"No predicate with index:"+t},s.prototype.Private_sempred=function(e,t){if(5===t)return this.strictMode;throw"No predicate with index:"+t},s.prototype.Public_sempred=function(e,t){if(6===t)return this.strictMode;throw"No predicate with index:"+t},s.prototype.Interface_sempred=function(e,t){if(7===t)return this.strictMode;throw"No predicate with index:"+t},s.prototype.Package_sempred=function(e,t){if(8===t)return this.strictMode;throw"No predicate with index:"+t},s.prototype.Protected_sempred=function(e,t){if(9===t)return this.strictMode;throw"No predicate with index:"+t},s.prototype.Static_sempred=function(e,t){if(10===t)return this.strictMode;throw"No predicate with index:"+t},s.prototype.Yield_sempred=function(e,t){if(11===t)return this.strictMode;throw"No predicate with index:"+t},t.ECMAScriptLexer=s},8525:(e,t,n)=>{var r=n(5525);function a(){return r.tree.ParseTreeListener.call(this),this}a.prototype=Object.create(r.tree.ParseTreeListener.prototype),a.prototype.constructor=a,a.prototype.enterProgram=function(e){},a.prototype.exitProgram=function(e){},a.prototype.enterSourceElements=function(e){},a.prototype.exitSourceElements=function(e){},a.prototype.enterSourceElement=function(e){},a.prototype.exitSourceElement=function(e){},a.prototype.enterStatement=function(e){},a.prototype.exitStatement=function(e){},a.prototype.enterStatementOrBlock=function(e){},a.prototype.exitStatementOrBlock=function(e){},a.prototype.enterBlock=function(e){},a.prototype.exitBlock=function(e){},a.prototype.enterStatementList=function(e){},a.prototype.exitStatementList=function(e){},a.prototype.enterVariableStatement=function(e){},a.prototype.exitVariableStatement=function(e){},a.prototype.enterVariableDeclarationList=function(e){},a.prototype.exitVariableDeclarationList=function(e){},a.prototype.enterVariableDeclaration=function(e){},a.prototype.exitVariableDeclaration=function(e){},a.prototype.enterInitialiser=function(e){},a.prototype.exitInitialiser=function(e){},a.prototype.enterEmptyStatement=function(e){},a.prototype.exitEmptyStatement=function(e){},a.prototype.enterExpressionStatement=function(e){},a.prototype.exitExpressionStatement=function(e){},a.prototype.enterIfStatement=function(e){},a.prototype.exitIfStatement=function(e){},a.prototype.enterDoWhileStatement=function(e){},a.prototype.exitDoWhileStatement=function(e){},a.prototype.enterWhileStatement=function(e){},a.prototype.exitWhileStatement=function(e){},a.prototype.enterForStatement=function(e){},a.prototype.exitForStatement=function(e){},a.prototype.enterForVarStatement=function(e){},a.prototype.exitForVarStatement=function(e){},a.prototype.enterForInStatement=function(e){},a.prototype.exitForInStatement=function(e){},a.prototype.enterForVarInStatement=function(e){},a.prototype.exitForVarInStatement=function(e){},a.prototype.enterContinueStatement=function(e){},a.prototype.exitContinueStatement=function(e){},a.prototype.enterBreakStatement=function(e){},a.prototype.exitBreakStatement=function(e){},a.prototype.enterReturnStatement=function(e){},a.prototype.exitReturnStatement=function(e){},a.prototype.enterWithStatement=function(e){},a.prototype.exitWithStatement=function(e){},a.prototype.enterSwitchStatement=function(e){},a.prototype.exitSwitchStatement=function(e){},a.prototype.enterCaseBlock=function(e){},a.prototype.exitCaseBlock=function(e){},a.prototype.enterCaseClauses=function(e){},a.prototype.exitCaseClauses=function(e){},a.prototype.enterCaseClause=function(e){},a.prototype.exitCaseClause=function(e){},a.prototype.enterDefaultClause=function(e){},a.prototype.exitDefaultClause=function(e){},a.prototype.enterLabelledStatement=function(e){},a.prototype.exitLabelledStatement=function(e){},a.prototype.enterThrowStatement=function(e){},a.prototype.exitThrowStatement=function(e){},a.prototype.enterTryStatement=function(e){},a.prototype.exitTryStatement=function(e){},a.prototype.enterCatchProduction=function(e){},a.prototype.exitCatchProduction=function(e){},a.prototype.enterFinallyProduction=function(e){},a.prototype.exitFinallyProduction=function(e){},a.prototype.enterDebuggerStatement=function(e){},a.prototype.exitDebuggerStatement=function(e){},a.prototype.enterFunctionDeclaration=function(e){},a.prototype.exitFunctionDeclaration=function(e){},a.prototype.enterFormalParameterList=function(e){},a.prototype.exitFormalParameterList=function(e){},a.prototype.enterFunctionBody=function(e){},a.prototype.exitFunctionBody=function(e){},a.prototype.enterArrayLiteral=function(e){},a.prototype.exitArrayLiteral=function(e){},a.prototype.enterElementList=function(e){},a.prototype.exitElementList=function(e){},a.prototype.enterElision=function(e){},a.prototype.exitElision=function(e){},a.prototype.enterObjectLiteral=function(e){},a.prototype.exitObjectLiteral=function(e){},a.prototype.enterPropertyNameAndValueList=function(e){},a.prototype.exitPropertyNameAndValueList=function(e){},a.prototype.enterPropertyAssignmentExpression=function(e){},a.prototype.exitPropertyAssignmentExpression=function(e){},a.prototype.enterPropertyGetter=function(e){},a.prototype.exitPropertyGetter=function(e){},a.prototype.enterPropertySetter=function(e){},a.prototype.exitPropertySetter=function(e){},a.prototype.enterPropertyName=function(e){},a.prototype.exitPropertyName=function(e){},a.prototype.enterPropertySetParameterList=function(e){},a.prototype.exitPropertySetParameterList=function(e){},a.prototype.enterArguments=function(e){},a.prototype.exitArguments=function(e){},a.prototype.enterArgumentList=function(e){},a.prototype.exitArgumentList=function(e){},a.prototype.enterExpressionSequence=function(e){},a.prototype.exitExpressionSequence=function(e){},a.prototype.enterTernaryExpression=function(e){},a.prototype.exitTernaryExpression=function(e){},a.prototype.enterLogicalAndExpression=function(e){},a.prototype.exitLogicalAndExpression=function(e){},a.prototype.enterFuncDefExpression=function(e){},a.prototype.exitFuncDefExpression=function(e){},a.prototype.enterPreIncrementExpression=function(e){},a.prototype.exitPreIncrementExpression=function(e){},a.prototype.enterObjectLiteralExpression=function(e){},a.prototype.exitObjectLiteralExpression=function(e){},a.prototype.enterInExpression=function(e){},a.prototype.exitInExpression=function(e){},a.prototype.enterLogicalOrExpression=function(e){},a.prototype.exitLogicalOrExpression=function(e){},a.prototype.enterNotExpression=function(e){},a.prototype.exitNotExpression=function(e){},a.prototype.enterPreDecreaseExpression=function(e){},a.prototype.exitPreDecreaseExpression=function(e){},a.prototype.enterThisExpression=function(e){},a.prototype.exitThisExpression=function(e){},a.prototype.enterUnaryMinusExpression=function(e){},a.prototype.exitUnaryMinusExpression=function(e){},a.prototype.enterPostDecreaseExpression=function(e){},a.prototype.exitPostDecreaseExpression=function(e){},a.prototype.enterAssignmentExpression=function(e){},a.prototype.exitAssignmentExpression=function(e){},a.prototype.enterTypeofExpression=function(e){},a.prototype.exitTypeofExpression=function(e){},a.prototype.enterInstanceofExpression=function(e){},a.prototype.exitInstanceofExpression=function(e){},a.prototype.enterUnaryPlusExpression=function(e){},a.prototype.exitUnaryPlusExpression=function(e){},a.prototype.enterDeleteExpression=function(e){},a.prototype.exitDeleteExpression=function(e){},a.prototype.enterEqualityExpression=function(e){},a.prototype.exitEqualityExpression=function(e){},a.prototype.enterBitXOrExpression=function(e){},a.prototype.exitBitXOrExpression=function(e){},a.prototype.enterMultiplicativeExpression=function(e){},a.prototype.exitMultiplicativeExpression=function(e){},a.prototype.enterBitShiftExpression=function(e){},a.prototype.exitBitShiftExpression=function(e){},a.prototype.enterParenthesizedExpression=function(e){},a.prototype.exitParenthesizedExpression=function(e){},a.prototype.enterGetAttributeExpression=function(e){},a.prototype.exitGetAttributeExpression=function(e){},a.prototype.enterAdditiveExpression=function(e){},a.prototype.exitAdditiveExpression=function(e){},a.prototype.enterRelationalExpression=function(e){},a.prototype.exitRelationalExpression=function(e){},a.prototype.enterPostIncrementExpression=function(e){},a.prototype.exitPostIncrementExpression=function(e){},a.prototype.enterFuncCallExpression=function(e){},a.prototype.exitFuncCallExpression=function(e){},a.prototype.enterBitNotExpression=function(e){},a.prototype.exitBitNotExpression=function(e){},a.prototype.enterNewExpression=function(e){},a.prototype.exitNewExpression=function(e){},a.prototype.enterLiteralExpression=function(e){},a.prototype.exitLiteralExpression=function(e){},a.prototype.enterArrayLiteralExpression=function(e){},a.prototype.exitArrayLiteralExpression=function(e){},a.prototype.enterMemberIndexExpression=function(e){},a.prototype.exitMemberIndexExpression=function(e){},a.prototype.enterIdentifierExpression=function(e){},a.prototype.exitIdentifierExpression=function(e){},a.prototype.enterBitAndExpression=function(e){},a.prototype.exitBitAndExpression=function(e){},a.prototype.enterBitOrExpression=function(e){},a.prototype.exitBitOrExpression=function(e){},a.prototype.enterAssignmentOperatorExpression=function(e){},a.prototype.exitAssignmentOperatorExpression=function(e){},a.prototype.enterVoidExpression=function(e){},a.prototype.exitVoidExpression=function(e){},a.prototype.enterAssignmentOperator=function(e){},a.prototype.exitAssignmentOperator=function(e){},a.prototype.enterNullLiteral=function(e){},a.prototype.exitNullLiteral=function(e){},a.prototype.enterUndefinedLiteral=function(e){},a.prototype.exitUndefinedLiteral=function(e){},a.prototype.enterBooleanLiteral=function(e){},a.prototype.exitBooleanLiteral=function(e){},a.prototype.enterStringLiteral=function(e){},a.prototype.exitStringLiteral=function(e){},a.prototype.enterRegularExpressionLiteral=function(e){},a.prototype.exitRegularExpressionLiteral=function(e){},a.prototype.enterNumericLiteralWrapper=function(e){},a.prototype.exitNumericLiteralWrapper=function(e){},a.prototype.enterIntegerLiteral=function(e){},a.prototype.exitIntegerLiteral=function(e){},a.prototype.enterDecimalLiteral=function(e){},a.prototype.exitDecimalLiteral=function(e){},a.prototype.enterHexIntegerLiteral=function(e){},a.prototype.exitHexIntegerLiteral=function(e){},a.prototype.enterOctalIntegerLiteral=function(e){},a.prototype.exitOctalIntegerLiteral=function(e){},a.prototype.enterIdentifierName=function(e){},a.prototype.exitIdentifierName=function(e){},a.prototype.enterReservedWord=function(e){},a.prototype.exitReservedWord=function(e){},a.prototype.enterKeyword=function(e){},a.prototype.exitKeyword=function(e){},a.prototype.enterFutureReservedWord=function(e){},a.prototype.exitFutureReservedWord=function(e){},a.prototype.enterGetter=function(e){},a.prototype.exitGetter=function(e){},a.prototype.enterSetter=function(e){},a.prototype.exitSetter=function(e){},a.prototype.enterEos=function(e){},a.prototype.exitEos=function(e){},a.prototype.enterEof=function(e){},a.prototype.exitEof=function(e){},t.K=a},9770:(e,t,n)=>{n(8451);var r=n(5525),a=n(8525).K,i=n(1619)._,o=["悋Ꜫ脳맭䅼㯧瞆奤","kʔ\t\t\t","\t\t\t","\b\t\b\t\t\t\n\t\n\v\t\v\f\t\f","\r\t\r\t\t\t","\t\t\t\t","\t\t\t","\t\t\t\t","\t\t\t",'\t \t !\t!"\t"#\t#$\t$',"%\t%&\t&'\t'(\t()\t)*\t*+\t+",",\t,-\t-.\t./\t/0\t01\t12\t2","3\t34\t45\t56\t67\t78\t89\t9","t\nw\n","~\n","\r","\n","","\n","\n","\n\f\v","\b\b¤\n\b\r\b\b¥","\t\t\t\t\n\n\n\n¯\n\n","\f\n\n²\v\n\v\v\v¶","\n\v\f\f\f\r\r","","Æ\n","","","Ù\n","Ý\n","á\n","ë\n","ï\n","","","","ą\n","Ċ\n","đ\n","Ę\n","","","Ī\n","Į\n","İ\nĵ","\n\rĶ","Ľ\n","ł\n","","","","Ś\n",""," "," Ŭ\n !!",'!!Ŷ\n!\f!!Ź\v!""ż\n"',"######ƃ\n####Ƈ","\n#$$Ɗ\n$\f$$ƍ\v$$$Ɛ","\n$\f$$Ɠ\v$$$$$Ƙ\n$\f$","$ƛ\v$$$ƞ\n$$Ơ\n$\f$$ƣ","\v$$ƥ\n$%%&&&&","&&Ʈ\n&&&&Ʋ\n&''","''Ʒ\n'\f''ƺ\v'(((","(((((((((","((((((((Ǐ\n()",")))ǔ\n)**+++ǚ\n","+++ǝ\n+++,,,,Ǥ","\n,\f,,ǧ\v,----Ǭ\n-\f-","-ǯ\v-....Ǵ\n...",".Ǹ\n.........",".Ȃ\n.........","..........","..........ȟ","\n..........","..........","..........","..........","..........","..........",".......ɢ\n.\f..ɥ","\v.//000000","0ɯ\n011111ɵ\n12","22ɹ\n23333ɾ\n34","4556666777","788888ʐ\n8999","Z:\b\n\f",' "$&(*,.02468:<>@BDFHJLNPRTVXZ\\^`bdfhjlnp',"\v"," !$*455","77<UVe˒s","}","\b\n","\f£","§«","³·","º¼","¾Ą",' Ć"č$Ĕ',"&ě(ġ","*ħ,Ĵ",".ĸ0ľ","2Ń4Ň","6ř8ś:š","<Ť>ŧ","@ŲBŻ","DƆFƤ","HƦJƱ","LƳNǎPǓ","RǕTǗ","VǠXǨ","ZȞ\\ɦ","^ɮ`ɴ","bɸdɽfɿ","hʁjʃ","lʇnʏ","pʑrt","srsttv","uwvuvw","wxxyp9y","z{{|n8|~","}z~","}","\b","> ","","
\t\r",""," ",'"$',"&2","(46","<
","","","","","","","\t","\f\b","","\v\t","\b",""," "," ¡\n","¡\r¢¤\n£","¢¤¥¥","£¥¦¦","§¨C¨","©\n©ªn8ª","«°\v¬","\f¯\v®¬","¯²°®","°±±","²°³µ","f´¶\fµ´","µ¶¶","·¸\r¸¹Z.","¹º»\v","»¼½X-½","¾¿Q¿","ÀÀÁX-ÁÂ","\bÂÅ\nÃÄ","AÄÆ\nÅÃ","ÅÆÆ","ÇÈ=ÈÉ\n","ÉÊKÊË","ËÌX-ÌÍ\bÍ","În8ÎąÏÐ","KÐÑÑÒ","X-ÒÓ\bÓÔ\n","ÔąÕÖI","ÖØ×ÙX-","Ø×ØÙ","ÙÚÚÜ\v","ÛÝX-ÜÛÜ","ÝÝÞÞ","à\vßáX-àß","àááâ","âã\bãą","\näåIåæ","æçCçè","\nèê\véë","X-êéêë","ëììî\v","íïX-îí","îïïð","ðñ\bñò\n","òąóôI","ôõõöZ.ö","÷T÷øX-øù","\bùú\núą","ûüIüý","ýþCþÿ","\vÿĀTĀāX-","āĂ\bĂă\nă","ąĄÇĄ","ÏĄÕĄ","äĄóĄ","ûąĆ","ĉHćĈĈ","Ċfĉćĉ","ĊĊċċ","Čn8Č!čĐ","<Ďďďđ","fĐĎĐđ","đĒĒē","n8ē#ĔėF","ĕĖĖĘX-ė","ĕėĘĘ","ęęĚn8Ě%","ěĜOĜĝ","ĝĞX-Ğğ\b","ğĠ\nĠ'","ġĢJĢģ","ģĤX-Ĥĥ\bĥĦ","*Ħ)ħĩ","\tĨĪ,ĩĨ","ĩĪĪį","īĭ0ĬĮ,","ĭĬĭĮ","Įİįī","įİİı","ıIJ\nIJ+","ijĵ.Ĵij","ĵĶĶĴ","Ķķķ-","ĸĹ@ĹĺX-ĺļ","ĻĽ\bļĻ","ļĽĽ/","ľĿPĿŁ","ŀł\bŁŀ","Łłł1","ŃńfńŅ","Ņņ\bņ3","ŇňRňʼn","ʼnŊX-Ŋŋn8","ŋ5ŌōUō","Ŏ\fŎŏ8ŏŚ","ŐőUőŒ","\fŒœ:œŚ","ŔŕUŕŖ","\fŖŗ8ŗŘ:","ŘŚřŌ","řŐřŔ","Ś7śŜD","ŜŝŝŞf","Şş\bşŠ\fŠ","9šŢEŢţ","\fţ;Ťť","LťŦn8Ŧ=","ŧŨMŨũfũ","ūŪŬ@!ūŪ","ūŬŬŭ","ŭŮ\bŮů",'\tůŰB"Űű\n',"ű?Ųŷf","ųŴ\fŴŶf","ŵųŶŹ","ŷŵŷŸ","ŸAŹŷ","źżŻź","ŻżżC","ŽžžƇ","ſƀƀƂF$Ɓ","ƃ\fƂƁƂ","ƃƃƄƄ","ƅƅƇƆ","ŽƆſƇ","EƈƊH%Ɖƈ","ƊƍƋƉ","Ƌƌƌƥ","ƍƋƎƐ","H%ƏƎƐƓ","ƑƏƑƒ","ƒƔƓƑ","ƔơZ.ƕƙ\f","ƖƘH%ƗƖƘ","ƛƙƗƙ","ƚƚƝƛ","ƙƜƞZ.ƝƜ","ƝƞƞƠ","ƟƕƠƣ","ơƟơƢ","Ƣƥƣơ","ƤƋƤƑ","ƥGƦƧ","\fƧIƨƩ","\tƩƲ\nƪƫ\t","ƫƭL'ƬƮ\fƭ","ƬƭƮƮ","ƯƯư\nư","ƲƱƨƱ","ƪƲKƳ","ƸN(ƴƵ\fƵƷ","N(ƶƴƷƺ","ƸƶƸƹ","ƹMƺƸ","ƻƼP)Ƽƽ","ƽƾZ.ƾǏ","ƿǀj6ǀǁǁ","ǂ\bǂǃ\tǃDŽ",'B"DŽDž\nDžǏ',"džLJl7LJLj","LjljR*ljNJ\bNJ",'Nj\tNjnjB"njǍ',"\nǍǏǎƻ","ǎƿǎdž","ǏOǐǔ","b2Ǒǔgǒǔ`1Ǔ","ǐǓǑǓ","ǒǔQǕ","ǖfǖSǗǙ","ǘǚV,Ǚǘ","Ǚǚǚǜ","Ǜǝ\fǜǛ","ǜǝǝǞ","Ǟǟ\bǟU","ǠǥZ.ǡǢ\f","ǢǤZ.ǣǡǤ","ǧǥǣǥ","ǦǦWǧ","ǥǨǭZ.ǩǪ","\fǪǬZ.ǫǩ","Ǭǯǭǫ","ǭǮǮY","ǯǭǰDZ\b.","DZdzMDzǴf","dzDzdzǴ","ǴǵǵǷ","ǶǸ@!ǷǶǷ","ǸǸǹǹ","Ǻ\bǺǻ\tǻǼ",'B"Ǽǽ\nǽȟ',"ǾǿBǿȁZ.","ȀȂT+ȁȀȁ","ȂȂȟȃ","ȄSȄȟZ. ȅȆG","ȆȟZ.ȇȈ?Ȉ","ȟZ.ȉȊȊȟ","Z.ȋȌȌȟ","Z.ȍȎȎȟZ.","ȏȐȐȟZ.ȑ","ȒȒȟZ.ȓȔ","ȔȟZ.ȕȟ","NȖȟfȗȟ^0","ȘȟD#șȟJ&Țț","țȜX-Ȝȝ\b","ȝȟȞǰ","ȞǾȞȃ","ȞȅȞȇ","ȞȉȞȋ","ȞȍȞȏ","ȞȑȞȓ","ȞȕȞȖ","ȞȗȞȘ","ȞșȞȚ","ȟɣȠȡ\f","ȡȢ\tȢɢZ.ȣ","Ȥ\fȤȥ\tȥɢ","Z.Ȧȧ\fȧȨ\t","ȨɢZ.ȩȪ\fȪ","ȫ\tȫɢZ.Ȭȭ\f","ȭȮ>ȮɢZ.","ȯȰ\fȰȱTȱ","ɢZ.Ȳȳ\fȳȴ\t","ȴɢZ.ȵȶ\f","ȶȷ%ȷɢZ.ȸȹ","\fȹȺ&Ⱥɢ","Z.Ȼȼ\fȼȽ'","ȽɢZ.Ⱦȿ\f\rȿɀ","(ɀɢZ.Ɂɂ\f\f","ɂɃ)ɃɢZ.\rɄɅ\f","\vɅɆɆɇ","Z.ɇɈɈɉZ.\fɉ","ɢɊɋ\f&ɋɌ","ɌɍX-ɍɎ","Ɏɢɏɐ\f","%ɐɑɑɢ","b2ɒɓ\f$ɓɢT+ɔ",'ɕ\f"ɕɖ.ɖɢ',"ɗɘ\f!ɘə.","əɢɚɛ\f\n","ɛɜ\rɜɢX-ɝɞ","\f\tɞɟ\\/ɟɠX-","ɠɢɡȠ","ɡȣɡȦ","ɡȩɡȬ","ɡȯɡȲ","ɡȵɡȸ","ɡȻɡȾ","ɡɁɡɄ","ɡɊɡɏ","ɡɒɡɔ","ɡɗɡɚ","ɡɝɢɥ","ɣɡɣɤ","ɤ[ɥɣ","ɦɧ\tɧ]ɨ","ɯ5ɩɯ6ɪɯ","7ɫɯgɬɯ","ɭɯ`1ɮɨ","ɮɩɮɪ","ɮɫɮɬ","ɮɭɯ_","ɰɵ8ɱɵ9","ɲɵ:ɳɵ;","ɴɰɴɱ","ɴɲɴɳ","ɵaɶɹfɷ","ɹd3ɸɶɸɷ","ɹcɺɾ","f4ɻɾh5ɼɾ\t\b","ɽɺɽɻ","ɽɼɾe","ɿʀ\t\tʀgʁʂ","\t\nʂiʃʄ6","ʄʅfʅʆP)ʆ","kʇʈ7ʈʉ","fʉʊP)ʊm","ʋʐ\vʌʐ","ʍʐ8ʎʐ8","ʏʋʏʌ","ʏʍʏʎ","ʐoʑʒ","ʒq<sv¥","°µÅØÜàêîĄĉĐė","ĩĭįĶļŁřūŷŻƂƆ","ƋƑƙƝơƤƭƱƸǎǓǙ","ǜǥǭdzǷȁȞɡɣɮɴɸ","ɽʏ"].join(""),s=(new r.atn.ATNDeserializer).deserialize(o),l=s.decisionToState.map((function(e,t){return new r.dfa.DFA(e,t)})),p=new r.PredictionContextCache,u=[null,null,null,"'['","']'","'('","')'","'{'","'}'","';'","','","'='","'?'","':'","'.'","'++'","'--'","'+'","'-'","'~'","'!'","'*'","'/'","'%'","'>>'","'<<'","'>>>'","'<'","'>'","'<='","'>='","'=='","'!='","'==='","'!=='","'&'","'^'","'|'","'&&'","'||'","'*='","'/='","'%='","'+='","'-='","'<<='","'>>='","'>>>='","'&='","'^='","'|='","'null'","'undefined'",null,null,null,null,null,"'break'","'do'","'instanceof'","'typeof'","'case'","'else'","'new'","'var'","'catch'","'finally'","'return'","'void'","'continue'","'for'","'switch'","'while'","'debugger'","'function'","'this'","'with'","'default'","'if'","'throw'","'delete'","'in'","'try'","'class'","'enum'","'extends'","'super'","'const'","'export'","'import'"],m=[null,"RegularExpressionLiteral","LineTerminator","OpenBracket","CloseBracket","OpenParen","CloseParen","OpenBrace","CloseBrace","SemiColon","Comma","Assign","QuestionMark","Colon","Dot","PlusPlus","MinusMinus","Plus","Minus","BitNot","Not","Multiply","Divide","Modulus","RightShiftArithmetic","LeftShiftArithmetic","RightShiftLogical","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals","NotEquals","IdentityEquals","IdentityNotEquals","BitAnd","BitXOr","BitOr","And","Or","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","LeftShiftArithmeticAssign","RightShiftArithmeticAssign","RightShiftLogicalAssign","BitAndAssign","BitXorAssign","BitOrAssign","NullLiteral","UndefinedLiteral","BooleanLiteral","IntegerLiteral","DecimalLiteral","HexIntegerLiteral","OctalIntegerLiteral","Break","Do","Instanceof","Typeof","Case","Else","New","Var","Catch","Finally","Return","Void","Continue","For","Switch","While","Debugger","Function","This","With","Default","If","Throw","Delete","In","Try","Class","Enum","Extends","Super","Const","Export","Import","Implements","Let","Private","Public","Interface","Package","Protected","Static","Yield","Identifier","StringLiteral","WhiteSpaces","MultiLineComment","SingleLineComment","UnexpectedCharacter"],c=["program","sourceElements","sourceElement","statement","statementOrBlock","block","statementList","variableStatement","variableDeclarationList","variableDeclaration","initialiser","emptyStatement","expressionStatement","ifStatement","iterationStatement","continueStatement","breakStatement","returnStatement","withStatement","switchStatement","caseBlock","caseClauses","caseClause","defaultClause","labelledStatement","throwStatement","tryStatement","catchProduction","finallyProduction","debuggerStatement","functionDeclaration","formalParameterList","functionBody","arrayLiteral","elementList","elision","objectLiteral","propertyNameAndValueList","propertyAssignment","propertyName","propertySetParameterList","arguments","argumentList","expressionSequence","singleExpression","assignmentOperator","literal","numericLiteral","identifierName","reservedWord","keyword","futureReservedWord","getter","setter","eos","eof"];function h(e){return r.Parser.call(this,e),this._interp=new r.atn.ParserATNSimulator(this,s,l,p),this.ruleNames=c,this.literalNames=u,this.symbolicNames=m,h.prototype.here=function(e){var t=r.Parser.prototype.getCurrentToken.call(this).tokenIndex-1,n=this._input.get(t);return n.channel==r.Lexer.HIDDEN&&n.type==e},h.prototype.lineTerminatorAhead=function(){var e=r.Parser.prototype.getCurrentToken.call(this).tokenIndex-1,t=this._input.get(e);if(t.channel!=r.Lexer.HIDDEN)return!1;var n=t.text,a=t.type;return a==h.MultiLineComment&&-1!==n.indexOf("\r")||-1!==n.indexOf("\n")||a==h.LineTerminator},this}function g(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_program,this}function T(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_sourceElements,this}function y(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_sourceElement,this}function d(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_statement,this}function f(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_statementOrBlock,this}function S(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_block,this}function b(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_statementList,this}function x(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_variableStatement,this}function A(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_variableDeclarationList,this}function L(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_variableDeclaration,this}function E(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_initialiser,this}function I(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_emptyStatement,this}function D(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_expressionStatement,this}function v(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_ifStatement,this}function _(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_iterationStatement,this}function C(e,t){return _.call(this,e),_.prototype.copyFrom.call(this,t),this}function O(e,t){return _.call(this,e),_.prototype.copyFrom.call(this,t),this}function B(e,t){return _.call(this,e),_.prototype.copyFrom.call(this,t),this}function j(e,t){return _.call(this,e),_.prototype.copyFrom.call(this,t),this}function N(e,t){return _.call(this,e),_.prototype.copyFrom.call(this,t),this}function w(e,t){return _.call(this,e),_.prototype.copyFrom.call(this,t),this}function R(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_continueStatement,this}function F(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_breakStatement,this}function k(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_returnStatement,this}function $(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_withStatement,this}function P(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_switchStatement,this}function M(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_caseBlock,this}function U(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_caseClauses,this}function q(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_caseClause,this}function G(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_defaultClause,this}function H(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_labelledStatement,this}function V(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_throwStatement,this}function K(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_tryStatement,this}function Y(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_catchProduction,this}function X(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_finallyProduction,this}function z(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_debuggerStatement,this}function W(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_functionDeclaration,this}function J(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_formalParameterList,this}function Z(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_functionBody,this}function Q(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_arrayLiteral,this}function ee(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_elementList,this}function te(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_elision,this}function ne(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_objectLiteral,this}function re(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_propertyNameAndValueList,this}function ae(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_propertyAssignment,this}function ie(e,t){return ae.call(this,e),ae.prototype.copyFrom.call(this,t),this}function oe(e,t){return ae.call(this,e),ae.prototype.copyFrom.call(this,t),this}function se(e,t){return ae.call(this,e),ae.prototype.copyFrom.call(this,t),this}function le(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_propertyName,this}function pe(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_propertySetParameterList,this}function ue(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_arguments,this}function me(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_argumentList,this}function ce(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_expressionSequence,this}function he(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_singleExpression,this}function ge(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Te(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function ye(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function de(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function fe(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Se(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function be(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function xe(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Ae(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Le(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Ee(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Ie(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function De(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function ve(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function _e(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Ce(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Oe(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Be(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function je(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Ne(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function we(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Re(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Fe(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function ke(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function $e(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Pe(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Me(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Ue(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function qe(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Ge(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function He(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Ve(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Ke(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Ye(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Xe(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function ze(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function We(e,t){return he.call(this,e),he.prototype.copyFrom.call(this,t),this}function Je(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_assignmentOperator,this}function Ze(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_literal,this}function Qe(e,t){return Ze.call(this,e),Ze.prototype.copyFrom.call(this,t),this}function et(e,t){return Ze.call(this,e),Ze.prototype.copyFrom.call(this,t),this}function tt(e,t){return Ze.call(this,e),Ze.prototype.copyFrom.call(this,t),this}function nt(e,t){return Ze.call(this,e),Ze.prototype.copyFrom.call(this,t),this}function rt(e,t){return Ze.call(this,e),Ze.prototype.copyFrom.call(this,t),this}function at(e,t){return Ze.call(this,e),Ze.prototype.copyFrom.call(this,t),this}function it(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_numericLiteral,this}function ot(e,t){return it.call(this,e),it.prototype.copyFrom.call(this,t),this}function st(e,t){return it.call(this,e),it.prototype.copyFrom.call(this,t),this}function lt(e,t){return it.call(this,e),it.prototype.copyFrom.call(this,t),this}function pt(e,t){return it.call(this,e),it.prototype.copyFrom.call(this,t),this}function ut(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_identifierName,this}function mt(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_reservedWord,this}function ct(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_keyword,this}function ht(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_futureReservedWord,this}function gt(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_getter,this}function Tt(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_setter,this}function yt(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_eos,this}function dt(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=h.RULE_eof,this}h.prototype=Object.create(r.Parser.prototype),h.prototype.constructor=h,Object.defineProperty(h.prototype,"atn",{get:function(){return s}}),h.EOF=r.Token.EOF,h.RegularExpressionLiteral=1,h.LineTerminator=2,h.OpenBracket=3,h.CloseBracket=4,h.OpenParen=5,h.CloseParen=6,h.OpenBrace=7,h.CloseBrace=8,h.SemiColon=9,h.Comma=10,h.Assign=11,h.QuestionMark=12,h.Colon=13,h.Dot=14,h.PlusPlus=15,h.MinusMinus=16,h.Plus=17,h.Minus=18,h.BitNot=19,h.Not=20,h.Multiply=21,h.Divide=22,h.Modulus=23,h.RightShiftArithmetic=24,h.LeftShiftArithmetic=25,h.RightShiftLogical=26,h.LessThan=27,h.MoreThan=28,h.LessThanEquals=29,h.GreaterThanEquals=30,h.Equals=31,h.NotEquals=32,h.IdentityEquals=33,h.IdentityNotEquals=34,h.BitAnd=35,h.BitXOr=36,h.BitOr=37,h.And=38,h.Or=39,h.MultiplyAssign=40,h.DivideAssign=41,h.ModulusAssign=42,h.PlusAssign=43,h.MinusAssign=44,h.LeftShiftArithmeticAssign=45,h.RightShiftArithmeticAssign=46,h.RightShiftLogicalAssign=47,h.BitAndAssign=48,h.BitXorAssign=49,h.BitOrAssign=50,h.NullLiteral=51,h.UndefinedLiteral=52,h.BooleanLiteral=53,h.IntegerLiteral=54,h.DecimalLiteral=55,h.HexIntegerLiteral=56,h.OctalIntegerLiteral=57,h.Break=58,h.Do=59,h.Instanceof=60,h.Typeof=61,h.Case=62,h.Else=63,h.New=64,h.Var=65,h.Catch=66,h.Finally=67,h.Return=68,h.Void=69,h.Continue=70,h.For=71,h.Switch=72,h.While=73,h.Debugger=74,h.Function=75,h.This=76,h.With=77,h.Default=78,h.If=79,h.Throw=80,h.Delete=81,h.In=82,h.Try=83,h.Class=84,h.Enum=85,h.Extends=86,h.Super=87,h.Const=88,h.Export=89,h.Import=90,h.Implements=91,h.Let=92,h.Private=93,h.Public=94,h.Interface=95,h.Package=96,h.Protected=97,h.Static=98,h.Yield=99,h.Identifier=100,h.StringLiteral=101,h.WhiteSpaces=102,h.MultiLineComment=103,h.SingleLineComment=104,h.UnexpectedCharacter=105,h.RULE_program=0,h.RULE_sourceElements=1,h.RULE_sourceElement=2,h.RULE_statement=3,h.RULE_statementOrBlock=4,h.RULE_block=5,h.RULE_statementList=6,h.RULE_variableStatement=7,h.RULE_variableDeclarationList=8,h.RULE_variableDeclaration=9,h.RULE_initialiser=10,h.RULE_emptyStatement=11,h.RULE_expressionStatement=12,h.RULE_ifStatement=13,h.RULE_iterationStatement=14,h.RULE_continueStatement=15,h.RULE_breakStatement=16,h.RULE_returnStatement=17,h.RULE_withStatement=18,h.RULE_switchStatement=19,h.RULE_caseBlock=20,h.RULE_caseClauses=21,h.RULE_caseClause=22,h.RULE_defaultClause=23,h.RULE_labelledStatement=24,h.RULE_throwStatement=25,h.RULE_tryStatement=26,h.RULE_catchProduction=27,h.RULE_finallyProduction=28,h.RULE_debuggerStatement=29,h.RULE_functionDeclaration=30,h.RULE_formalParameterList=31,h.RULE_functionBody=32,h.RULE_arrayLiteral=33,h.RULE_elementList=34,h.RULE_elision=35,h.RULE_objectLiteral=36,h.RULE_propertyNameAndValueList=37,h.RULE_propertyAssignment=38,h.RULE_propertyName=39,h.RULE_propertySetParameterList=40,h.RULE_arguments=41,h.RULE_argumentList=42,h.RULE_expressionSequence=43,h.RULE_singleExpression=44,h.RULE_assignmentOperator=45,h.RULE_literal=46,h.RULE_numericLiteral=47,h.RULE_identifierName=48,h.RULE_reservedWord=49,h.RULE_keyword=50,h.RULE_futureReservedWord=51,h.RULE_getter=52,h.RULE_setter=53,h.RULE_eos=54,h.RULE_eof=55,g.prototype=Object.create(r.ParserRuleContext.prototype),g.prototype.constructor=g,g.prototype.eof=function(){return this.getTypedRuleContext(dt,0)},g.prototype.sourceElements=function(){return this.getTypedRuleContext(T,0)},g.prototype.sourceElement=function(){return this.getTypedRuleContext(y,0)},g.prototype.enterRule=function(e){e instanceof a&&e.enterProgram(this)},g.prototype.exitRule=function(e){e instanceof a&&e.exitProgram(this)},g.prototype.accept=function(e){return e instanceof i?e.visitProgram(this):e.visitChildren(this)},h.ProgramContext=g,h.prototype.program=function(){var e=new g(this,this._ctx,this.state);this.enterRule(e,0,h.RULE_program);var t=0;try{this.enterOuterAlt(e,1),this.state=113,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,0,this._ctx)&&(this.state=112,this.sourceElements()),this.state=116,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<h.RegularExpressionLiteral|1<<h.OpenBracket|1<<h.OpenParen|1<<h.OpenBrace|1<<h.SemiColon|1<<h.PlusPlus|1<<h.MinusMinus|1<<h.Plus|1<<h.Minus|1<<h.BitNot|1<<h.Not)||!(t-51&-32)&&1<<t-51&(1<<h.NullLiteral-51|1<<h.UndefinedLiteral-51|1<<h.BooleanLiteral-51|1<<h.IntegerLiteral-51|1<<h.DecimalLiteral-51|1<<h.HexIntegerLiteral-51|1<<h.OctalIntegerLiteral-51|1<<h.Break-51|1<<h.Do-51|1<<h.Typeof-51|1<<h.New-51|1<<h.Var-51|1<<h.Return-51|1<<h.Void-51|1<<h.Continue-51|1<<h.For-51|1<<h.Switch-51|1<<h.While-51|1<<h.Debugger-51|1<<h.Function-51|1<<h.This-51|1<<h.With-51|1<<h.If-51|1<<h.Throw-51|1<<h.Delete-51)||!(t-83&-32)&&1<<t-83&(1<<h.Try-83|1<<h.Identifier-83|1<<h.StringLiteral-83))&&(this.state=115,this.sourceElement()),this.state=118,this.eof()}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},T.prototype=Object.create(r.ParserRuleContext.prototype),T.prototype.constructor=T,T.prototype.sourceElement=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(y):this.getTypedRuleContext(y,e)},T.prototype.eos=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(yt):this.getTypedRuleContext(yt,e)},T.prototype.enterRule=function(e){e instanceof a&&e.enterSourceElements(this)},T.prototype.exitRule=function(e){e instanceof a&&e.exitSourceElements(this)},T.prototype.accept=function(e){return e instanceof i?e.visitSourceElements(this):e.visitChildren(this)},h.SourceElementsContext=T,h.prototype.sourceElements=function(){var e=new T(this,this._ctx,this.state);this.enterRule(e,2,h.RULE_sourceElements);try{this.enterOuterAlt(e,1),this.state=123,this._errHandler.sync(this);var t=1;do{if(1!==t)throw new r.error.NoViableAltException(this);this.state=120,this.sourceElement(),this.state=121,this.eos(),this.state=125,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,2,this._ctx)}while(2!=t&&t!=r.atn.ATN.INVALID_ALT_NUMBER)}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},y.prototype=Object.create(r.ParserRuleContext.prototype),y.prototype.constructor=y,y.prototype.statement=function(){return this.getTypedRuleContext(d,0)},y.prototype.functionDeclaration=function(){return this.getTypedRuleContext(W,0)},y.prototype.enterRule=function(e){e instanceof a&&e.enterSourceElement(this)},y.prototype.exitRule=function(e){e instanceof a&&e.exitSourceElement(this)},y.prototype.accept=function(e){return e instanceof i?e.visitSourceElement(this):e.visitChildren(this)},h.SourceElementContext=y,h.prototype.sourceElement=function(){var e=new y(this,this._ctx,this.state);this.enterRule(e,4,h.RULE_sourceElement);try{switch(this.state=129,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,3,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=127,this.statement();break;case 2:this.enterOuterAlt(e,2),this.state=128,this.functionDeclaration()}}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},d.prototype=Object.create(r.ParserRuleContext.prototype),d.prototype.constructor=d,d.prototype.variableStatement=function(){return this.getTypedRuleContext(x,0)},d.prototype.emptyStatement=function(){return this.getTypedRuleContext(I,0)},d.prototype.expressionStatement=function(){return this.getTypedRuleContext(D,0)},d.prototype.ifStatement=function(){return this.getTypedRuleContext(v,0)},d.prototype.iterationStatement=function(){return this.getTypedRuleContext(_,0)},d.prototype.continueStatement=function(){return this.getTypedRuleContext(R,0)},d.prototype.breakStatement=function(){return this.getTypedRuleContext(F,0)},d.prototype.returnStatement=function(){return this.getTypedRuleContext(k,0)},d.prototype.withStatement=function(){return this.getTypedRuleContext($,0)},d.prototype.labelledStatement=function(){return this.getTypedRuleContext(H,0)},d.prototype.switchStatement=function(){return this.getTypedRuleContext(P,0)},d.prototype.throwStatement=function(){return this.getTypedRuleContext(V,0)},d.prototype.tryStatement=function(){return this.getTypedRuleContext(K,0)},d.prototype.debuggerStatement=function(){return this.getTypedRuleContext(z,0)},d.prototype.enterRule=function(e){e instanceof a&&e.enterStatement(this)},d.prototype.exitRule=function(e){e instanceof a&&e.exitStatement(this)},d.prototype.accept=function(e){return e instanceof i?e.visitStatement(this):e.visitChildren(this)},h.StatementContext=d,h.prototype.statement=function(){var e=new d(this,this._ctx,this.state);this.enterRule(e,6,h.RULE_statement);try{switch(this.state=145,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,4,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=131,this.variableStatement();break;case 2:this.enterOuterAlt(e,2),this.state=132,this.emptyStatement();break;case 3:this.enterOuterAlt(e,3),this.state=133,this.expressionStatement();break;case 4:this.enterOuterAlt(e,4),this.state=134,this.ifStatement();break;case 5:this.enterOuterAlt(e,5),this.state=135,this.iterationStatement();break;case 6:this.enterOuterAlt(e,6),this.state=136,this.continueStatement();break;case 7:this.enterOuterAlt(e,7),this.state=137,this.breakStatement();break;case 8:this.enterOuterAlt(e,8),this.state=138,this.returnStatement();break;case 9:this.enterOuterAlt(e,9),this.state=139,this.withStatement();break;case 10:this.enterOuterAlt(e,10),this.state=140,this.labelledStatement();break;case 11:this.enterOuterAlt(e,11),this.state=141,this.switchStatement();break;case 12:this.enterOuterAlt(e,12),this.state=142,this.throwStatement();break;case 13:this.enterOuterAlt(e,13),this.state=143,this.tryStatement();break;case 14:this.enterOuterAlt(e,14),this.state=144,this.debuggerStatement()}}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},f.prototype=Object.create(r.ParserRuleContext.prototype),f.prototype.constructor=f,f.prototype.block=function(){return this.getTypedRuleContext(S,0)},f.prototype.statement=function(){return this.getTypedRuleContext(d,0)},f.prototype.enterRule=function(e){e instanceof a&&e.enterStatementOrBlock(this)},f.prototype.exitRule=function(e){e instanceof a&&e.exitStatementOrBlock(this)},f.prototype.accept=function(e){return e instanceof i?e.visitStatementOrBlock(this):e.visitChildren(this)},h.StatementOrBlockContext=f,h.prototype.statementOrBlock=function(){var e=new f(this,this._ctx,this.state);this.enterRule(e,8,h.RULE_statementOrBlock);try{switch(this.state=149,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,5,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=147,this.block();break;case 2:this.enterOuterAlt(e,2),this.state=148,this.statement()}}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},S.prototype=Object.create(r.ParserRuleContext.prototype),S.prototype.constructor=S,S.prototype.OpenBrace=function(){return this.getToken(h.OpenBrace,0)},S.prototype.CloseBrace=function(){return this.getToken(h.CloseBrace,0)},S.prototype.statement=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(d):this.getTypedRuleContext(d,e)},S.prototype.enterRule=function(e){e instanceof a&&e.enterBlock(this)},S.prototype.exitRule=function(e){e instanceof a&&e.exitBlock(this)},S.prototype.accept=function(e){return e instanceof i?e.visitBlock(this):e.visitChildren(this)},h.BlockContext=S,h.prototype.block=function(){var e=new S(this,this._ctx,this.state);this.enterRule(e,10,h.RULE_block);var t=0;try{for(this.enterOuterAlt(e,1),this.state=151,this.match(h.OpenBrace),this.state=155,this._errHandler.sync(this),t=this._input.LA(1);!(-32&t)&&1<<t&(1<<h.RegularExpressionLiteral|1<<h.OpenBracket|1<<h.OpenParen|1<<h.OpenBrace|1<<h.SemiColon|1<<h.PlusPlus|1<<h.MinusMinus|1<<h.Plus|1<<h.Minus|1<<h.BitNot|1<<h.Not)||!(t-51&-32)&&1<<t-51&(1<<h.NullLiteral-51|1<<h.UndefinedLiteral-51|1<<h.BooleanLiteral-51|1<<h.IntegerLiteral-51|1<<h.DecimalLiteral-51|1<<h.HexIntegerLiteral-51|1<<h.OctalIntegerLiteral-51|1<<h.Break-51|1<<h.Do-51|1<<h.Typeof-51|1<<h.New-51|1<<h.Var-51|1<<h.Return-51|1<<h.Void-51|1<<h.Continue-51|1<<h.For-51|1<<h.Switch-51|1<<h.While-51|1<<h.Debugger-51|1<<h.Function-51|1<<h.This-51|1<<h.With-51|1<<h.If-51|1<<h.Throw-51|1<<h.Delete-51)||!(t-83&-32)&&1<<t-83&(1<<h.Try-83|1<<h.Identifier-83|1<<h.StringLiteral-83);)this.state=152,this.statement(),this.state=157,this._errHandler.sync(this),t=this._input.LA(1);this.state=158,this.match(h.CloseBrace)}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},b.prototype=Object.create(r.ParserRuleContext.prototype),b.prototype.constructor=b,b.prototype.statementOrBlock=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(f):this.getTypedRuleContext(f,e)},b.prototype.enterRule=function(e){e instanceof a&&e.enterStatementList(this)},b.prototype.exitRule=function(e){e instanceof a&&e.exitStatementList(this)},b.prototype.accept=function(e){return e instanceof i?e.visitStatementList(this):e.visitChildren(this)},h.StatementListContext=b,h.prototype.statementList=function(){var e=new b(this,this._ctx,this.state);this.enterRule(e,12,h.RULE_statementList);var t=0;try{this.enterOuterAlt(e,1),this.state=161,this._errHandler.sync(this),t=this._input.LA(1);do{this.state=160,this.statementOrBlock(),this.state=163,this._errHandler.sync(this),t=this._input.LA(1)}while(!(-32&t)&&1<<t&(1<<h.RegularExpressionLiteral|1<<h.OpenBracket|1<<h.OpenParen|1<<h.OpenBrace|1<<h.SemiColon|1<<h.PlusPlus|1<<h.MinusMinus|1<<h.Plus|1<<h.Minus|1<<h.BitNot|1<<h.Not)||!(t-51&-32)&&1<<t-51&(1<<h.NullLiteral-51|1<<h.UndefinedLiteral-51|1<<h.BooleanLiteral-51|1<<h.IntegerLiteral-51|1<<h.DecimalLiteral-51|1<<h.HexIntegerLiteral-51|1<<h.OctalIntegerLiteral-51|1<<h.Break-51|1<<h.Do-51|1<<h.Typeof-51|1<<h.New-51|1<<h.Var-51|1<<h.Return-51|1<<h.Void-51|1<<h.Continue-51|1<<h.For-51|1<<h.Switch-51|1<<h.While-51|1<<h.Debugger-51|1<<h.Function-51|1<<h.This-51|1<<h.With-51|1<<h.If-51|1<<h.Throw-51|1<<h.Delete-51)||!(t-83&-32)&&1<<t-83&(1<<h.Try-83|1<<h.Identifier-83|1<<h.StringLiteral-83))}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},x.prototype=Object.create(r.ParserRuleContext.prototype),x.prototype.constructor=x,x.prototype.Var=function(){return this.getToken(h.Var,0)},x.prototype.variableDeclarationList=function(){return this.getTypedRuleContext(A,0)},x.prototype.eos=function(){return this.getTypedRuleContext(yt,0)},x.prototype.enterRule=function(e){e instanceof a&&e.enterVariableStatement(this)},x.prototype.exitRule=function(e){e instanceof a&&e.exitVariableStatement(this)},x.prototype.accept=function(e){return e instanceof i?e.visitVariableStatement(this):e.visitChildren(this)},h.VariableStatementContext=x,h.prototype.variableStatement=function(){var e=new x(this,this._ctx,this.state);this.enterRule(e,14,h.RULE_variableStatement);try{this.enterOuterAlt(e,1),this.state=165,this.match(h.Var),this.state=166,this.variableDeclarationList(),this.state=167,this.eos()}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},A.prototype=Object.create(r.ParserRuleContext.prototype),A.prototype.constructor=A,A.prototype.variableDeclaration=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(L):this.getTypedRuleContext(L,e)},A.prototype.Comma=function(e){return void 0===e&&(e=null),null===e?this.getTokens(h.Comma):this.getToken(h.Comma,e)},A.prototype.enterRule=function(e){e instanceof a&&e.enterVariableDeclarationList(this)},A.prototype.exitRule=function(e){e instanceof a&&e.exitVariableDeclarationList(this)},A.prototype.accept=function(e){return e instanceof i?e.visitVariableDeclarationList(this):e.visitChildren(this)},h.VariableDeclarationListContext=A,h.prototype.variableDeclarationList=function(){var e=new A(this,this._ctx,this.state);this.enterRule(e,16,h.RULE_variableDeclarationList);try{this.enterOuterAlt(e,1),this.state=169,this.variableDeclaration(),this.state=174,this._errHandler.sync(this);for(var t=this._interp.adaptivePredict(this._input,8,this._ctx);2!=t&&t!=r.atn.ATN.INVALID_ALT_NUMBER;)1===t&&(this.state=170,this.match(h.Comma),this.state=171,this.variableDeclaration()),this.state=176,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,8,this._ctx)}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},L.prototype=Object.create(r.ParserRuleContext.prototype),L.prototype.constructor=L,L.prototype.Identifier=function(){return this.getToken(h.Identifier,0)},L.prototype.initialiser=function(){return this.getTypedRuleContext(E,0)},L.prototype.enterRule=function(e){e instanceof a&&e.enterVariableDeclaration(this)},L.prototype.exitRule=function(e){e instanceof a&&e.exitVariableDeclaration(this)},L.prototype.accept=function(e){return e instanceof i?e.visitVariableDeclaration(this):e.visitChildren(this)},h.VariableDeclarationContext=L,h.prototype.variableDeclaration=function(){var e=new L(this,this._ctx,this.state);this.enterRule(e,18,h.RULE_variableDeclaration);try{this.enterOuterAlt(e,1),this.state=177,this.match(h.Identifier),this.state=179,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,9,this._ctx)&&(this.state=178,this.initialiser())}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},E.prototype=Object.create(r.ParserRuleContext.prototype),E.prototype.constructor=E,E.prototype.Assign=function(){return this.getToken(h.Assign,0)},E.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},E.prototype.enterRule=function(e){e instanceof a&&e.enterInitialiser(this)},E.prototype.exitRule=function(e){e instanceof a&&e.exitInitialiser(this)},E.prototype.accept=function(e){return e instanceof i?e.visitInitialiser(this):e.visitChildren(this)},h.InitialiserContext=E,h.prototype.initialiser=function(){var e=new E(this,this._ctx,this.state);this.enterRule(e,20,h.RULE_initialiser);try{this.enterOuterAlt(e,1),this.state=181,this.match(h.Assign),this.state=182,this.singleExpression(0)}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},I.prototype=Object.create(r.ParserRuleContext.prototype),I.prototype.constructor=I,I.prototype.SemiColon=function(){return this.getToken(h.SemiColon,0)},I.prototype.enterRule=function(e){e instanceof a&&e.enterEmptyStatement(this)},I.prototype.exitRule=function(e){e instanceof a&&e.exitEmptyStatement(this)},I.prototype.accept=function(e){return e instanceof i?e.visitEmptyStatement(this):e.visitChildren(this)},h.EmptyStatementContext=I,h.prototype.emptyStatement=function(){var e=new I(this,this._ctx,this.state);this.enterRule(e,22,h.RULE_emptyStatement);try{this.enterOuterAlt(e,1),this.state=184,this.match(h.SemiColon)}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},D.prototype=Object.create(r.ParserRuleContext.prototype),D.prototype.constructor=D,D.prototype.expressionSequence=function(){return this.getTypedRuleContext(ce,0)},D.prototype.enterRule=function(e){e instanceof a&&e.enterExpressionStatement(this)},D.prototype.exitRule=function(e){e instanceof a&&e.exitExpressionStatement(this)},D.prototype.accept=function(e){return e instanceof i?e.visitExpressionStatement(this):e.visitChildren(this)},h.ExpressionStatementContext=D,h.prototype.expressionStatement=function(){var e=new D(this,this._ctx,this.state);this.enterRule(e,24,h.RULE_expressionStatement);try{this.enterOuterAlt(e,1),this.state=186,this.expressionSequence()}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},v.prototype=Object.create(r.ParserRuleContext.prototype),v.prototype.constructor=v,v.prototype.If=function(){return this.getToken(h.If,0)},v.prototype.OpenParen=function(){return this.getToken(h.OpenParen,0)},v.prototype.expressionSequence=function(){return this.getTypedRuleContext(ce,0)},v.prototype.CloseParen=function(){return this.getToken(h.CloseParen,0)},v.prototype.statementOrBlock=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(f):this.getTypedRuleContext(f,e)},v.prototype.Else=function(){return this.getToken(h.Else,0)},v.prototype.enterRule=function(e){e instanceof a&&e.enterIfStatement(this)},v.prototype.exitRule=function(e){e instanceof a&&e.exitIfStatement(this)},v.prototype.accept=function(e){return e instanceof i?e.visitIfStatement(this):e.visitChildren(this)},h.IfStatementContext=v,h.prototype.ifStatement=function(){var e=new v(this,this._ctx,this.state);this.enterRule(e,26,h.RULE_ifStatement);try{this.enterOuterAlt(e,1),this.state=188,this.match(h.If),this.state=189,this.match(h.OpenParen),this.state=190,this.expressionSequence(),this.state=191,this.match(h.CloseParen),this.state=192,this.statementOrBlock(),this.state=195,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,10,this._ctx)&&(this.state=193,this.match(h.Else),this.state=194,this.statementOrBlock())}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},_.prototype=Object.create(r.ParserRuleContext.prototype),_.prototype.constructor=_,_.prototype.copyFrom=function(e){r.ParserRuleContext.prototype.copyFrom.call(this,e)},C.prototype=Object.create(_.prototype),C.prototype.constructor=C,h.ForVarStatementContext=C,C.prototype.For=function(){return this.getToken(h.For,0)},C.prototype.OpenParen=function(){return this.getToken(h.OpenParen,0)},C.prototype.Var=function(){return this.getToken(h.Var,0)},C.prototype.variableDeclarationList=function(){return this.getTypedRuleContext(A,0)},C.prototype.SemiColon=function(e){return void 0===e&&(e=null),null===e?this.getTokens(h.SemiColon):this.getToken(h.SemiColon,e)},C.prototype.CloseParen=function(){return this.getToken(h.CloseParen,0)},C.prototype.statementOrBlock=function(){return this.getTypedRuleContext(f,0)},C.prototype.expressionSequence=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(ce):this.getTypedRuleContext(ce,e)},C.prototype.enterRule=function(e){e instanceof a&&e.enterForVarStatement(this)},C.prototype.exitRule=function(e){e instanceof a&&e.exitForVarStatement(this)},C.prototype.accept=function(e){return e instanceof i?e.visitForVarStatement(this):e.visitChildren(this)},O.prototype=Object.create(_.prototype),O.prototype.constructor=O,h.ForVarInStatementContext=O,O.prototype.For=function(){return this.getToken(h.For,0)},O.prototype.OpenParen=function(){return this.getToken(h.OpenParen,0)},O.prototype.Var=function(){return this.getToken(h.Var,0)},O.prototype.variableDeclaration=function(){return this.getTypedRuleContext(L,0)},O.prototype.In=function(){return this.getToken(h.In,0)},O.prototype.expressionSequence=function(){return this.getTypedRuleContext(ce,0)},O.prototype.CloseParen=function(){return this.getToken(h.CloseParen,0)},O.prototype.statementOrBlock=function(){return this.getTypedRuleContext(f,0)},O.prototype.enterRule=function(e){e instanceof a&&e.enterForVarInStatement(this)},O.prototype.exitRule=function(e){e instanceof a&&e.exitForVarInStatement(this)},O.prototype.accept=function(e){return e instanceof i?e.visitForVarInStatement(this):e.visitChildren(this)},B.prototype=Object.create(_.prototype),B.prototype.constructor=B,h.WhileStatementContext=B,B.prototype.While=function(){return this.getToken(h.While,0)},B.prototype.OpenParen=function(){return this.getToken(h.OpenParen,0)},B.prototype.expressionSequence=function(){return this.getTypedRuleContext(ce,0)},B.prototype.CloseParen=function(){return this.getToken(h.CloseParen,0)},B.prototype.statementOrBlock=function(){return this.getTypedRuleContext(f,0)},B.prototype.enterRule=function(e){e instanceof a&&e.enterWhileStatement(this)},B.prototype.exitRule=function(e){e instanceof a&&e.exitWhileStatement(this)},B.prototype.accept=function(e){return e instanceof i?e.visitWhileStatement(this):e.visitChildren(this)},j.prototype=Object.create(_.prototype),j.prototype.constructor=j,h.ForStatementContext=j,j.prototype.For=function(){return this.getToken(h.For,0)},j.prototype.OpenParen=function(){return this.getToken(h.OpenParen,0)},j.prototype.SemiColon=function(e){return void 0===e&&(e=null),null===e?this.getTokens(h.SemiColon):this.getToken(h.SemiColon,e)},j.prototype.CloseParen=function(){return this.getToken(h.CloseParen,0)},j.prototype.statementOrBlock=function(){return this.getTypedRuleContext(f,0)},j.prototype.expressionSequence=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(ce):this.getTypedRuleContext(ce,e)},j.prototype.enterRule=function(e){e instanceof a&&e.enterForStatement(this)},j.prototype.exitRule=function(e){e instanceof a&&e.exitForStatement(this)},j.prototype.accept=function(e){return e instanceof i?e.visitForStatement(this):e.visitChildren(this)},N.prototype=Object.create(_.prototype),N.prototype.constructor=N,h.DoWhileStatementContext=N,N.prototype.Do=function(){return this.getToken(h.Do,0)},N.prototype.statementOrBlock=function(){return this.getTypedRuleContext(f,0)},N.prototype.While=function(){return this.getToken(h.While,0)},N.prototype.OpenParen=function(){return this.getToken(h.OpenParen,0)},N.prototype.expressionSequence=function(){return this.getTypedRuleContext(ce,0)},N.prototype.CloseParen=function(){return this.getToken(h.CloseParen,0)},N.prototype.eos=function(){return this.getTypedRuleContext(yt,0)},N.prototype.enterRule=function(e){e instanceof a&&e.enterDoWhileStatement(this)},N.prototype.exitRule=function(e){e instanceof a&&e.exitDoWhileStatement(this)},N.prototype.accept=function(e){return e instanceof i?e.visitDoWhileStatement(this):e.visitChildren(this)},w.prototype=Object.create(_.prototype),w.prototype.constructor=w,h.ForInStatementContext=w,w.prototype.For=function(){return this.getToken(h.For,0)},w.prototype.OpenParen=function(){return this.getToken(h.OpenParen,0)},w.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},w.prototype.In=function(){return this.getToken(h.In,0)},w.prototype.expressionSequence=function(){return this.getTypedRuleContext(ce,0)},w.prototype.CloseParen=function(){return this.getToken(h.CloseParen,0)},w.prototype.statementOrBlock=function(){return this.getTypedRuleContext(f,0)},w.prototype.enterRule=function(e){e instanceof a&&e.enterForInStatement(this)},w.prototype.exitRule=function(e){e instanceof a&&e.exitForInStatement(this)},w.prototype.accept=function(e){return e instanceof i?e.visitForInStatement(this):e.visitChildren(this)},h.IterationStatementContext=_,h.prototype.iterationStatement=function(){var e=new _(this,this._ctx,this.state);this.enterRule(e,28,h.RULE_iterationStatement);var t=0;try{switch(this.state=258,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,16,this._ctx)){case 1:e=new N(this,e),this.enterOuterAlt(e,1),this.state=197,this.match(h.Do),this.state=198,this.statementOrBlock(),this.state=199,this.match(h.While),this.state=200,this.match(h.OpenParen),this.state=201,this.expressionSequence(),this.state=202,this.match(h.CloseParen),this.state=203,this.eos();break;case 2:e=new B(this,e),this.enterOuterAlt(e,2),this.state=205,this.match(h.While),this.state=206,this.match(h.OpenParen),this.state=207,this.expressionSequence(),this.state=208,this.match(h.CloseParen),this.state=209,this.statementOrBlock();break;case 3:e=new j(this,e),this.enterOuterAlt(e,3),this.state=211,this.match(h.For),this.state=212,this.match(h.OpenParen),this.state=214,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<h.RegularExpressionLiteral|1<<h.OpenBracket|1<<h.OpenParen|1<<h.OpenBrace|1<<h.PlusPlus|1<<h.MinusMinus|1<<h.Plus|1<<h.Minus|1<<h.BitNot|1<<h.Not)||!(t-51&-32)&&1<<t-51&(1<<h.NullLiteral-51|1<<h.UndefinedLiteral-51|1<<h.BooleanLiteral-51|1<<h.IntegerLiteral-51|1<<h.DecimalLiteral-51|1<<h.HexIntegerLiteral-51|1<<h.OctalIntegerLiteral-51|1<<h.Typeof-51|1<<h.New-51|1<<h.Void-51|1<<h.Function-51|1<<h.This-51|1<<h.Delete-51)||t===h.Identifier||t===h.StringLiteral)&&(this.state=213,this.expressionSequence()),this.state=216,this.match(h.SemiColon),this.state=218,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<h.RegularExpressionLiteral|1<<h.OpenBracket|1<<h.OpenParen|1<<h.OpenBrace|1<<h.PlusPlus|1<<h.MinusMinus|1<<h.Plus|1<<h.Minus|1<<h.BitNot|1<<h.Not)||!(t-51&-32)&&1<<t-51&(1<<h.NullLiteral-51|1<<h.UndefinedLiteral-51|1<<h.BooleanLiteral-51|1<<h.IntegerLiteral-51|1<<h.DecimalLiteral-51|1<<h.HexIntegerLiteral-51|1<<h.OctalIntegerLiteral-51|1<<h.Typeof-51|1<<h.New-51|1<<h.Void-51|1<<h.Function-51|1<<h.This-51|1<<h.Delete-51)||t===h.Identifier||t===h.StringLiteral)&&(this.state=217,this.expressionSequence()),this.state=220,this.match(h.SemiColon),this.state=222,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<h.RegularExpressionLiteral|1<<h.OpenBracket|1<<h.OpenParen|1<<h.OpenBrace|1<<h.PlusPlus|1<<h.MinusMinus|1<<h.Plus|1<<h.Minus|1<<h.BitNot|1<<h.Not)||!(t-51&-32)&&1<<t-51&(1<<h.NullLiteral-51|1<<h.UndefinedLiteral-51|1<<h.BooleanLiteral-51|1<<h.IntegerLiteral-51|1<<h.DecimalLiteral-51|1<<h.HexIntegerLiteral-51|1<<h.OctalIntegerLiteral-51|1<<h.Typeof-51|1<<h.New-51|1<<h.Void-51|1<<h.Function-51|1<<h.This-51|1<<h.Delete-51)||t===h.Identifier||t===h.StringLiteral)&&(this.state=221,this.expressionSequence()),this.state=224,this.match(h.CloseParen),this.state=225,this.statementOrBlock();break;case 4:e=new C(this,e),this.enterOuterAlt(e,4),this.state=226,this.match(h.For),this.state=227,this.match(h.OpenParen),this.state=228,this.match(h.Var),this.state=229,this.variableDeclarationList(),this.state=230,this.match(h.SemiColon),this.state=232,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<h.RegularExpressionLiteral|1<<h.OpenBracket|1<<h.OpenParen|1<<h.OpenBrace|1<<h.PlusPlus|1<<h.MinusMinus|1<<h.Plus|1<<h.Minus|1<<h.BitNot|1<<h.Not)||!(t-51&-32)&&1<<t-51&(1<<h.NullLiteral-51|1<<h.UndefinedLiteral-51|1<<h.BooleanLiteral-51|1<<h.IntegerLiteral-51|1<<h.DecimalLiteral-51|1<<h.HexIntegerLiteral-51|1<<h.OctalIntegerLiteral-51|1<<h.Typeof-51|1<<h.New-51|1<<h.Void-51|1<<h.Function-51|1<<h.This-51|1<<h.Delete-51)||t===h.Identifier||t===h.StringLiteral)&&(this.state=231,this.expressionSequence()),this.state=234,this.match(h.SemiColon),this.state=236,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<h.RegularExpressionLiteral|1<<h.OpenBracket|1<<h.OpenParen|1<<h.OpenBrace|1<<h.PlusPlus|1<<h.MinusMinus|1<<h.Plus|1<<h.Minus|1<<h.BitNot|1<<h.Not)||!(t-51&-32)&&1<<t-51&(1<<h.NullLiteral-51|1<<h.UndefinedLiteral-51|1<<h.BooleanLiteral-51|1<<h.IntegerLiteral-51|1<<h.DecimalLiteral-51|1<<h.HexIntegerLiteral-51|1<<h.OctalIntegerLiteral-51|1<<h.Typeof-51|1<<h.New-51|1<<h.Void-51|1<<h.Function-51|1<<h.This-51|1<<h.Delete-51)||t===h.Identifier||t===h.StringLiteral)&&(this.state=235,this.expressionSequence()),this.state=238,this.match(h.CloseParen),this.state=239,this.statementOrBlock();break;case 5:e=new w(this,e),this.enterOuterAlt(e,5),this.state=241,this.match(h.For),this.state=242,this.match(h.OpenParen),this.state=243,this.singleExpression(0),this.state=244,this.match(h.In),this.state=245,this.expressionSequence(),this.state=246,this.match(h.CloseParen),this.state=247,this.statementOrBlock();break;case 6:e=new O(this,e),this.enterOuterAlt(e,6),this.state=249,this.match(h.For),this.state=250,this.match(h.OpenParen),this.state=251,this.match(h.Var),this.state=252,this.variableDeclaration(),this.state=253,this.match(h.In),this.state=254,this.expressionSequence(),this.state=255,this.match(h.CloseParen),this.state=256,this.statementOrBlock()}}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},R.prototype=Object.create(r.ParserRuleContext.prototype),R.prototype.constructor=R,R.prototype.Continue=function(){return this.getToken(h.Continue,0)},R.prototype.eos=function(){return this.getTypedRuleContext(yt,0)},R.prototype.Identifier=function(){return this.getToken(h.Identifier,0)},R.prototype.enterRule=function(e){e instanceof a&&e.enterContinueStatement(this)},R.prototype.exitRule=function(e){e instanceof a&&e.exitContinueStatement(this)},R.prototype.accept=function(e){return e instanceof i?e.visitContinueStatement(this):e.visitChildren(this)},h.ContinueStatementContext=R,h.prototype.continueStatement=function(){var e=new R(this,this._ctx,this.state);this.enterRule(e,30,h.RULE_continueStatement);try{if(this.enterOuterAlt(e,1),this.state=260,this.match(h.Continue),this.state=263,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,17,this._ctx)){if(this.state=261,this.here(h.LineTerminator))throw new r.error.FailedPredicateException(this,"!this.here(ECMAScriptParser.LineTerminator)");this.state=262,this.match(h.Identifier)}this.state=265,this.eos()}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},F.prototype=Object.create(r.ParserRuleContext.prototype),F.prototype.constructor=F,F.prototype.Break=function(){return this.getToken(h.Break,0)},F.prototype.eos=function(){return this.getTypedRuleContext(yt,0)},F.prototype.Identifier=function(){return this.getToken(h.Identifier,0)},F.prototype.enterRule=function(e){e instanceof a&&e.enterBreakStatement(this)},F.prototype.exitRule=function(e){e instanceof a&&e.exitBreakStatement(this)},F.prototype.accept=function(e){return e instanceof i?e.visitBreakStatement(this):e.visitChildren(this)},h.BreakStatementContext=F,h.prototype.breakStatement=function(){var e=new F(this,this._ctx,this.state);this.enterRule(e,32,h.RULE_breakStatement);try{if(this.enterOuterAlt(e,1),this.state=267,this.match(h.Break),this.state=270,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,18,this._ctx)){if(this.state=268,this.here(h.LineTerminator))throw new r.error.FailedPredicateException(this,"!this.here(ECMAScriptParser.LineTerminator)");this.state=269,this.match(h.Identifier)}this.state=272,this.eos()}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},k.prototype=Object.create(r.ParserRuleContext.prototype),k.prototype.constructor=k,k.prototype.Return=function(){return this.getToken(h.Return,0)},k.prototype.eos=function(){return this.getTypedRuleContext(yt,0)},k.prototype.expressionSequence=function(){return this.getTypedRuleContext(ce,0)},k.prototype.enterRule=function(e){e instanceof a&&e.enterReturnStatement(this)},k.prototype.exitRule=function(e){e instanceof a&&e.exitReturnStatement(this)},k.prototype.accept=function(e){return e instanceof i?e.visitReturnStatement(this):e.visitChildren(this)},h.ReturnStatementContext=k,h.prototype.returnStatement=function(){var e=new k(this,this._ctx,this.state);this.enterRule(e,34,h.RULE_returnStatement);try{if(this.enterOuterAlt(e,1),this.state=274,this.match(h.Return),this.state=277,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,19,this._ctx)){if(this.state=275,this.here(h.LineTerminator))throw new r.error.FailedPredicateException(this,"!this.here(ECMAScriptParser.LineTerminator)");this.state=276,this.expressionSequence()}this.state=279,this.eos()}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},$.prototype=Object.create(r.ParserRuleContext.prototype),$.prototype.constructor=$,$.prototype.With=function(){return this.getToken(h.With,0)},$.prototype.OpenParen=function(){return this.getToken(h.OpenParen,0)},$.prototype.expressionSequence=function(){return this.getTypedRuleContext(ce,0)},$.prototype.CloseParen=function(){return this.getToken(h.CloseParen,0)},$.prototype.statementOrBlock=function(){return this.getTypedRuleContext(f,0)},$.prototype.enterRule=function(e){e instanceof a&&e.enterWithStatement(this)},$.prototype.exitRule=function(e){e instanceof a&&e.exitWithStatement(this)},$.prototype.accept=function(e){return e instanceof i?e.visitWithStatement(this):e.visitChildren(this)},h.WithStatementContext=$,h.prototype.withStatement=function(){var e=new $(this,this._ctx,this.state);this.enterRule(e,36,h.RULE_withStatement);try{this.enterOuterAlt(e,1),this.state=281,this.match(h.With),this.state=282,this.match(h.OpenParen),this.state=283,this.expressionSequence(),this.state=284,this.match(h.CloseParen),this.state=285,this.statementOrBlock()}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},P.prototype=Object.create(r.ParserRuleContext.prototype),P.prototype.constructor=P,P.prototype.Switch=function(){return this.getToken(h.Switch,0)},P.prototype.OpenParen=function(){return this.getToken(h.OpenParen,0)},P.prototype.expressionSequence=function(){return this.getTypedRuleContext(ce,0)},P.prototype.CloseParen=function(){return this.getToken(h.CloseParen,0)},P.prototype.caseBlock=function(){return this.getTypedRuleContext(M,0)},P.prototype.enterRule=function(e){e instanceof a&&e.enterSwitchStatement(this)},P.prototype.exitRule=function(e){e instanceof a&&e.exitSwitchStatement(this)},P.prototype.accept=function(e){return e instanceof i?e.visitSwitchStatement(this):e.visitChildren(this)},h.SwitchStatementContext=P,h.prototype.switchStatement=function(){var e=new P(this,this._ctx,this.state);this.enterRule(e,38,h.RULE_switchStatement);try{this.enterOuterAlt(e,1),this.state=287,this.match(h.Switch),this.state=288,this.match(h.OpenParen),this.state=289,this.expressionSequence(),this.state=290,this.match(h.CloseParen),this.state=291,this.caseBlock()}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},M.prototype=Object.create(r.ParserRuleContext.prototype),M.prototype.constructor=M,M.prototype.OpenBrace=function(){return this.getToken(h.OpenBrace,0)},M.prototype.CloseBrace=function(){return this.getToken(h.CloseBrace,0)},M.prototype.caseClauses=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(U):this.getTypedRuleContext(U,e)},M.prototype.defaultClause=function(){return this.getTypedRuleContext(G,0)},M.prototype.enterRule=function(e){e instanceof a&&e.enterCaseBlock(this)},M.prototype.exitRule=function(e){e instanceof a&&e.exitCaseBlock(this)},M.prototype.accept=function(e){return e instanceof i?e.visitCaseBlock(this):e.visitChildren(this)},h.CaseBlockContext=M,h.prototype.caseBlock=function(){var e=new M(this,this._ctx,this.state);this.enterRule(e,40,h.RULE_caseBlock);try{this.enterOuterAlt(e,1),this.state=293,this.match(h.OpenBrace),this.state=295,this._errHandler.sync(this),this._input.LA(1)===h.Case&&(this.state=294,this.caseClauses()),this.state=301,this._errHandler.sync(this),this._input.LA(1)===h.Default&&(this.state=297,this.defaultClause(),this.state=299,this._errHandler.sync(this),this._input.LA(1)===h.Case&&(this.state=298,this.caseClauses())),this.state=303,this.match(h.CloseBrace)}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},U.prototype=Object.create(r.ParserRuleContext.prototype),U.prototype.constructor=U,U.prototype.caseClause=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(q):this.getTypedRuleContext(q,e)},U.prototype.enterRule=function(e){e instanceof a&&e.enterCaseClauses(this)},U.prototype.exitRule=function(e){e instanceof a&&e.exitCaseClauses(this)},U.prototype.accept=function(e){return e instanceof i?e.visitCaseClauses(this):e.visitChildren(this)},h.CaseClausesContext=U,h.prototype.caseClauses=function(){var e=new U(this,this._ctx,this.state);this.enterRule(e,42,h.RULE_caseClauses);var t=0;try{this.enterOuterAlt(e,1),this.state=306,this._errHandler.sync(this),t=this._input.LA(1);do{this.state=305,this.caseClause(),this.state=308,this._errHandler.sync(this),t=this._input.LA(1)}while(t===h.Case)}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},q.prototype=Object.create(r.ParserRuleContext.prototype),q.prototype.constructor=q,q.prototype.Case=function(){return this.getToken(h.Case,0)},q.prototype.expressionSequence=function(){return this.getTypedRuleContext(ce,0)},q.prototype.Colon=function(){return this.getToken(h.Colon,0)},q.prototype.statementList=function(){return this.getTypedRuleContext(b,0)},q.prototype.enterRule=function(e){e instanceof a&&e.enterCaseClause(this)},q.prototype.exitRule=function(e){e instanceof a&&e.exitCaseClause(this)},q.prototype.accept=function(e){return e instanceof i?e.visitCaseClause(this):e.visitChildren(this)},h.CaseClauseContext=q,h.prototype.caseClause=function(){var e=new q(this,this._ctx,this.state);this.enterRule(e,44,h.RULE_caseClause);var t=0;try{this.enterOuterAlt(e,1),this.state=310,this.match(h.Case),this.state=311,this.expressionSequence(),this.state=312,this.match(h.Colon),this.state=314,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<h.RegularExpressionLiteral|1<<h.OpenBracket|1<<h.OpenParen|1<<h.OpenBrace|1<<h.SemiColon|1<<h.PlusPlus|1<<h.MinusMinus|1<<h.Plus|1<<h.Minus|1<<h.BitNot|1<<h.Not)||!(t-51&-32)&&1<<t-51&(1<<h.NullLiteral-51|1<<h.UndefinedLiteral-51|1<<h.BooleanLiteral-51|1<<h.IntegerLiteral-51|1<<h.DecimalLiteral-51|1<<h.HexIntegerLiteral-51|1<<h.OctalIntegerLiteral-51|1<<h.Break-51|1<<h.Do-51|1<<h.Typeof-51|1<<h.New-51|1<<h.Var-51|1<<h.Return-51|1<<h.Void-51|1<<h.Continue-51|1<<h.For-51|1<<h.Switch-51|1<<h.While-51|1<<h.Debugger-51|1<<h.Function-51|1<<h.This-51|1<<h.With-51|1<<h.If-51|1<<h.Throw-51|1<<h.Delete-51)||!(t-83&-32)&&1<<t-83&(1<<h.Try-83|1<<h.Identifier-83|1<<h.StringLiteral-83))&&(this.state=313,this.statementList())}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},G.prototype=Object.create(r.ParserRuleContext.prototype),G.prototype.constructor=G,G.prototype.Default=function(){return this.getToken(h.Default,0)},G.prototype.Colon=function(){return this.getToken(h.Colon,0)},G.prototype.statementList=function(){return this.getTypedRuleContext(b,0)},G.prototype.enterRule=function(e){e instanceof a&&e.enterDefaultClause(this)},G.prototype.exitRule=function(e){e instanceof a&&e.exitDefaultClause(this)},G.prototype.accept=function(e){return e instanceof i?e.visitDefaultClause(this):e.visitChildren(this)},h.DefaultClauseContext=G,h.prototype.defaultClause=function(){var e=new G(this,this._ctx,this.state);this.enterRule(e,46,h.RULE_defaultClause);var t=0;try{this.enterOuterAlt(e,1),this.state=316,this.match(h.Default),this.state=317,this.match(h.Colon),this.state=319,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<h.RegularExpressionLiteral|1<<h.OpenBracket|1<<h.OpenParen|1<<h.OpenBrace|1<<h.SemiColon|1<<h.PlusPlus|1<<h.MinusMinus|1<<h.Plus|1<<h.Minus|1<<h.BitNot|1<<h.Not)||!(t-51&-32)&&1<<t-51&(1<<h.NullLiteral-51|1<<h.UndefinedLiteral-51|1<<h.BooleanLiteral-51|1<<h.IntegerLiteral-51|1<<h.DecimalLiteral-51|1<<h.HexIntegerLiteral-51|1<<h.OctalIntegerLiteral-51|1<<h.Break-51|1<<h.Do-51|1<<h.Typeof-51|1<<h.New-51|1<<h.Var-51|1<<h.Return-51|1<<h.Void-51|1<<h.Continue-51|1<<h.For-51|1<<h.Switch-51|1<<h.While-51|1<<h.Debugger-51|1<<h.Function-51|1<<h.This-51|1<<h.With-51|1<<h.If-51|1<<h.Throw-51|1<<h.Delete-51)||!(t-83&-32)&&1<<t-83&(1<<h.Try-83|1<<h.Identifier-83|1<<h.StringLiteral-83))&&(this.state=318,this.statementList())}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},H.prototype=Object.create(r.ParserRuleContext.prototype),H.prototype.constructor=H,H.prototype.Identifier=function(){return this.getToken(h.Identifier,0)},H.prototype.Colon=function(){return this.getToken(h.Colon,0)},H.prototype.statement=function(){return this.getTypedRuleContext(d,0)},H.prototype.enterRule=function(e){e instanceof a&&e.enterLabelledStatement(this)},H.prototype.exitRule=function(e){e instanceof a&&e.exitLabelledStatement(this)},H.prototype.accept=function(e){return e instanceof i?e.visitLabelledStatement(this):e.visitChildren(this)},h.LabelledStatementContext=H,h.prototype.labelledStatement=function(){var e=new H(this,this._ctx,this.state);this.enterRule(e,48,h.RULE_labelledStatement);try{this.enterOuterAlt(e,1),this.state=321,this.match(h.Identifier),this.state=322,this.match(h.Colon),this.state=323,this.statement()}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},V.prototype=Object.create(r.ParserRuleContext.prototype),V.prototype.constructor=V,V.prototype.Throw=function(){return this.getToken(h.Throw,0)},V.prototype.expressionSequence=function(){return this.getTypedRuleContext(ce,0)},V.prototype.eos=function(){return this.getTypedRuleContext(yt,0)},V.prototype.enterRule=function(e){e instanceof a&&e.enterThrowStatement(this)},V.prototype.exitRule=function(e){e instanceof a&&e.exitThrowStatement(this)},V.prototype.accept=function(e){return e instanceof i?e.visitThrowStatement(this):e.visitChildren(this)},h.ThrowStatementContext=V,h.prototype.throwStatement=function(){var e=new V(this,this._ctx,this.state);this.enterRule(e,50,h.RULE_throwStatement);try{if(this.enterOuterAlt(e,1),this.state=325,this.match(h.Throw),this.state=326,this.here(h.LineTerminator))throw new r.error.FailedPredicateException(this,"!this.here(ECMAScriptParser.LineTerminator)");this.state=327,this.expressionSequence(),this.state=328,this.eos()}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},K.prototype=Object.create(r.ParserRuleContext.prototype),K.prototype.constructor=K,K.prototype.Try=function(){return this.getToken(h.Try,0)},K.prototype.block=function(){return this.getTypedRuleContext(S,0)},K.prototype.catchProduction=function(){return this.getTypedRuleContext(Y,0)},K.prototype.finallyProduction=function(){return this.getTypedRuleContext(X,0)},K.prototype.enterRule=function(e){e instanceof a&&e.enterTryStatement(this)},K.prototype.exitRule=function(e){e instanceof a&&e.exitTryStatement(this)},K.prototype.accept=function(e){return e instanceof i?e.visitTryStatement(this):e.visitChildren(this)},h.TryStatementContext=K,h.prototype.tryStatement=function(){var e=new K(this,this._ctx,this.state);this.enterRule(e,52,h.RULE_tryStatement);try{switch(this.state=343,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,26,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=330,this.match(h.Try),this.state=331,this.block(),this.state=332,this.catchProduction();break;case 2:this.enterOuterAlt(e,2),this.state=334,this.match(h.Try),this.state=335,this.block(),this.state=336,this.finallyProduction();break;case 3:this.enterOuterAlt(e,3),this.state=338,this.match(h.Try),this.state=339,this.block(),this.state=340,this.catchProduction(),this.state=341,this.finallyProduction()}}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},Y.prototype=Object.create(r.ParserRuleContext.prototype),Y.prototype.constructor=Y,Y.prototype.Catch=function(){return this.getToken(h.Catch,0)},Y.prototype.OpenParen=function(){return this.getToken(h.OpenParen,0)},Y.prototype.Identifier=function(){return this.getToken(h.Identifier,0)},Y.prototype.CloseParen=function(){return this.getToken(h.CloseParen,0)},Y.prototype.block=function(){return this.getTypedRuleContext(S,0)},Y.prototype.enterRule=function(e){e instanceof a&&e.enterCatchProduction(this)},Y.prototype.exitRule=function(e){e instanceof a&&e.exitCatchProduction(this)},Y.prototype.accept=function(e){return e instanceof i?e.visitCatchProduction(this):e.visitChildren(this)},h.CatchProductionContext=Y,h.prototype.catchProduction=function(){var e=new Y(this,this._ctx,this.state);this.enterRule(e,54,h.RULE_catchProduction);try{this.enterOuterAlt(e,1),this.state=345,this.match(h.Catch),this.state=346,this.match(h.OpenParen),this.state=347,this.match(h.Identifier),this.state=348,this.match(h.CloseParen),this.state=349,this.block()}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},X.prototype=Object.create(r.ParserRuleContext.prototype),X.prototype.constructor=X,X.prototype.Finally=function(){return this.getToken(h.Finally,0)},X.prototype.block=function(){return this.getTypedRuleContext(S,0)},X.prototype.enterRule=function(e){e instanceof a&&e.enterFinallyProduction(this)},X.prototype.exitRule=function(e){e instanceof a&&e.exitFinallyProduction(this)},X.prototype.accept=function(e){return e instanceof i?e.visitFinallyProduction(this):e.visitChildren(this)},h.FinallyProductionContext=X,h.prototype.finallyProduction=function(){var e=new X(this,this._ctx,this.state);this.enterRule(e,56,h.RULE_finallyProduction);try{this.enterOuterAlt(e,1),this.state=351,this.match(h.Finally),this.state=352,this.block()}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},z.prototype=Object.create(r.ParserRuleContext.prototype),z.prototype.constructor=z,z.prototype.Debugger=function(){return this.getToken(h.Debugger,0)},z.prototype.eos=function(){return this.getTypedRuleContext(yt,0)},z.prototype.enterRule=function(e){e instanceof a&&e.enterDebuggerStatement(this)},z.prototype.exitRule=function(e){e instanceof a&&e.exitDebuggerStatement(this)},z.prototype.accept=function(e){return e instanceof i?e.visitDebuggerStatement(this):e.visitChildren(this)},h.DebuggerStatementContext=z,h.prototype.debuggerStatement=function(){var e=new z(this,this._ctx,this.state);this.enterRule(e,58,h.RULE_debuggerStatement);try{this.enterOuterAlt(e,1),this.state=354,this.match(h.Debugger),this.state=355,this.eos()}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},W.prototype=Object.create(r.ParserRuleContext.prototype),W.prototype.constructor=W,W.prototype.Function=function(){return this.getToken(h.Function,0)},W.prototype.Identifier=function(){return this.getToken(h.Identifier,0)},W.prototype.OpenParen=function(){return this.getToken(h.OpenParen,0)},W.prototype.CloseParen=function(){return this.getToken(h.CloseParen,0)},W.prototype.OpenBrace=function(){return this.getToken(h.OpenBrace,0)},W.prototype.functionBody=function(){return this.getTypedRuleContext(Z,0)},W.prototype.CloseBrace=function(){return this.getToken(h.CloseBrace,0)},W.prototype.formalParameterList=function(){return this.getTypedRuleContext(J,0)},W.prototype.enterRule=function(e){e instanceof a&&e.enterFunctionDeclaration(this)},W.prototype.exitRule=function(e){e instanceof a&&e.exitFunctionDeclaration(this)},W.prototype.accept=function(e){return e instanceof i?e.visitFunctionDeclaration(this):e.visitChildren(this)},h.FunctionDeclarationContext=W,h.prototype.functionDeclaration=function(){var e=new W(this,this._ctx,this.state);this.enterRule(e,60,h.RULE_functionDeclaration);try{this.enterOuterAlt(e,1),this.state=357,this.match(h.Function),this.state=358,this.match(h.Identifier),this.state=359,this.match(h.OpenParen),this.state=361,this._errHandler.sync(this),this._input.LA(1)===h.Identifier&&(this.state=360,this.formalParameterList()),this.state=363,this.match(h.CloseParen),this.state=364,this.match(h.OpenBrace),this.state=365,this.functionBody(),this.state=366,this.match(h.CloseBrace)}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},J.prototype=Object.create(r.ParserRuleContext.prototype),J.prototype.constructor=J,J.prototype.Identifier=function(e){return void 0===e&&(e=null),null===e?this.getTokens(h.Identifier):this.getToken(h.Identifier,e)},J.prototype.Comma=function(e){return void 0===e&&(e=null),null===e?this.getTokens(h.Comma):this.getToken(h.Comma,e)},J.prototype.enterRule=function(e){e instanceof a&&e.enterFormalParameterList(this)},J.prototype.exitRule=function(e){e instanceof a&&e.exitFormalParameterList(this)},J.prototype.accept=function(e){return e instanceof i?e.visitFormalParameterList(this):e.visitChildren(this)},h.FormalParameterListContext=J,h.prototype.formalParameterList=function(){var e=new J(this,this._ctx,this.state);this.enterRule(e,62,h.RULE_formalParameterList);var t=0;try{for(this.enterOuterAlt(e,1),this.state=368,this.match(h.Identifier),this.state=373,this._errHandler.sync(this),t=this._input.LA(1);t===h.Comma;)this.state=369,this.match(h.Comma),this.state=370,this.match(h.Identifier),this.state=375,this._errHandler.sync(this),t=this._input.LA(1)}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},Z.prototype=Object.create(r.ParserRuleContext.prototype),Z.prototype.constructor=Z,Z.prototype.sourceElements=function(){return this.getTypedRuleContext(T,0)},Z.prototype.enterRule=function(e){e instanceof a&&e.enterFunctionBody(this)},Z.prototype.exitRule=function(e){e instanceof a&&e.exitFunctionBody(this)},Z.prototype.accept=function(e){return e instanceof i?e.visitFunctionBody(this):e.visitChildren(this)},h.FunctionBodyContext=Z,h.prototype.functionBody=function(){var e=new Z(this,this._ctx,this.state);this.enterRule(e,64,h.RULE_functionBody);var t=0;try{this.enterOuterAlt(e,1),this.state=377,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<h.RegularExpressionLiteral|1<<h.OpenBracket|1<<h.OpenParen|1<<h.OpenBrace|1<<h.SemiColon|1<<h.PlusPlus|1<<h.MinusMinus|1<<h.Plus|1<<h.Minus|1<<h.BitNot|1<<h.Not)||!(t-51&-32)&&1<<t-51&(1<<h.NullLiteral-51|1<<h.UndefinedLiteral-51|1<<h.BooleanLiteral-51|1<<h.IntegerLiteral-51|1<<h.DecimalLiteral-51|1<<h.HexIntegerLiteral-51|1<<h.OctalIntegerLiteral-51|1<<h.Break-51|1<<h.Do-51|1<<h.Typeof-51|1<<h.New-51|1<<h.Var-51|1<<h.Return-51|1<<h.Void-51|1<<h.Continue-51|1<<h.For-51|1<<h.Switch-51|1<<h.While-51|1<<h.Debugger-51|1<<h.Function-51|1<<h.This-51|1<<h.With-51|1<<h.If-51|1<<h.Throw-51|1<<h.Delete-51)||!(t-83&-32)&&1<<t-83&(1<<h.Try-83|1<<h.Identifier-83|1<<h.StringLiteral-83))&&(this.state=376,this.sourceElements())}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},Q.prototype=Object.create(r.ParserRuleContext.prototype),Q.prototype.constructor=Q,Q.prototype.OpenBracket=function(){return this.getToken(h.OpenBracket,0)},Q.prototype.CloseBracket=function(){return this.getToken(h.CloseBracket,0)},Q.prototype.elementList=function(){return this.getTypedRuleContext(ee,0)},Q.prototype.Comma=function(){return this.getToken(h.Comma,0)},Q.prototype.enterRule=function(e){e instanceof a&&e.enterArrayLiteral(this)},Q.prototype.exitRule=function(e){e instanceof a&&e.exitArrayLiteral(this)},Q.prototype.accept=function(e){return e instanceof i?e.visitArrayLiteral(this):e.visitChildren(this)},h.ArrayLiteralContext=Q,h.prototype.arrayLiteral=function(){var e=new Q(this,this._ctx,this.state);this.enterRule(e,66,h.RULE_arrayLiteral);try{switch(this.state=388,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,31,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=379,this.match(h.OpenBracket),this.state=380,this.match(h.CloseBracket);break;case 2:this.enterOuterAlt(e,2),this.state=381,this.match(h.OpenBracket),this.state=382,this.elementList(),this.state=384,this._errHandler.sync(this),this._input.LA(1)===h.Comma&&(this.state=383,this.match(h.Comma)),this.state=386,this.match(h.CloseBracket)}}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},ee.prototype=Object.create(r.ParserRuleContext.prototype),ee.prototype.constructor=ee,ee.prototype.elision=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(te):this.getTypedRuleContext(te,e)},ee.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(he):this.getTypedRuleContext(he,e)},ee.prototype.Comma=function(e){return void 0===e&&(e=null),null===e?this.getTokens(h.Comma):this.getToken(h.Comma,e)},ee.prototype.enterRule=function(e){e instanceof a&&e.enterElementList(this)},ee.prototype.exitRule=function(e){e instanceof a&&e.exitElementList(this)},ee.prototype.accept=function(e){return e instanceof i?e.visitElementList(this):e.visitChildren(this)},h.ElementListContext=ee,h.prototype.elementList=function(){var e=new ee(this,this._ctx,this.state);this.enterRule(e,68,h.RULE_elementList);var t=0;try{switch(this.state=418,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,37,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=393,this._errHandler.sync(this);for(var n=this._interp.adaptivePredict(this._input,32,this._ctx);2!=n&&n!=r.atn.ATN.INVALID_ALT_NUMBER;)1===n&&(this.state=390,this.elision()),this.state=395,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,32,this._ctx);break;case 2:for(this.enterOuterAlt(e,2),this.state=399,this._errHandler.sync(this),t=this._input.LA(1);t===h.Comma;)this.state=396,this.elision(),this.state=401,this._errHandler.sync(this),t=this._input.LA(1);for(this.state=402,this.singleExpression(0),this.state=415,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,36,this._ctx);2!=n&&n!=r.atn.ATN.INVALID_ALT_NUMBER;){if(1===n){for(this.state=403,this.match(h.Comma),this.state=407,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,34,this._ctx);2!=n&&n!=r.atn.ATN.INVALID_ALT_NUMBER;)1===n&&(this.state=404,this.elision()),this.state=409,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,34,this._ctx);this.state=411,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<h.RegularExpressionLiteral|1<<h.OpenBracket|1<<h.OpenParen|1<<h.OpenBrace|1<<h.PlusPlus|1<<h.MinusMinus|1<<h.Plus|1<<h.Minus|1<<h.BitNot|1<<h.Not)||!(t-51&-32)&&1<<t-51&(1<<h.NullLiteral-51|1<<h.UndefinedLiteral-51|1<<h.BooleanLiteral-51|1<<h.IntegerLiteral-51|1<<h.DecimalLiteral-51|1<<h.HexIntegerLiteral-51|1<<h.OctalIntegerLiteral-51|1<<h.Typeof-51|1<<h.New-51|1<<h.Void-51|1<<h.Function-51|1<<h.This-51|1<<h.Delete-51)||t===h.Identifier||t===h.StringLiteral)&&(this.state=410,this.singleExpression(0))}this.state=417,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,36,this._ctx)}}}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},te.prototype=Object.create(r.ParserRuleContext.prototype),te.prototype.constructor=te,te.prototype.Comma=function(){return this.getToken(h.Comma,0)},te.prototype.enterRule=function(e){e instanceof a&&e.enterElision(this)},te.prototype.exitRule=function(e){e instanceof a&&e.exitElision(this)},te.prototype.accept=function(e){return e instanceof i?e.visitElision(this):e.visitChildren(this)},h.ElisionContext=te,h.prototype.elision=function(){var e=new te(this,this._ctx,this.state);this.enterRule(e,70,h.RULE_elision);try{this.enterOuterAlt(e,1),this.state=420,this.match(h.Comma)}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},ne.prototype=Object.create(r.ParserRuleContext.prototype),ne.prototype.constructor=ne,ne.prototype.OpenBrace=function(){return this.getToken(h.OpenBrace,0)},ne.prototype.CloseBrace=function(){return this.getToken(h.CloseBrace,0)},ne.prototype.propertyNameAndValueList=function(){return this.getTypedRuleContext(re,0)},ne.prototype.Comma=function(){return this.getToken(h.Comma,0)},ne.prototype.enterRule=function(e){e instanceof a&&e.enterObjectLiteral(this)},ne.prototype.exitRule=function(e){e instanceof a&&e.exitObjectLiteral(this)},ne.prototype.accept=function(e){return e instanceof i?e.visitObjectLiteral(this):e.visitChildren(this)},h.ObjectLiteralContext=ne,h.prototype.objectLiteral=function(){var e=new ne(this,this._ctx,this.state);this.enterRule(e,72,h.RULE_objectLiteral);try{switch(this.state=431,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,39,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=422,this.match(h.OpenBrace),this.state=423,this.match(h.CloseBrace);break;case 2:this.enterOuterAlt(e,2),this.state=424,this.match(h.OpenBrace),this.state=425,this.propertyNameAndValueList(),this.state=427,this._errHandler.sync(this),this._input.LA(1)===h.Comma&&(this.state=426,this.match(h.Comma)),this.state=429,this.match(h.CloseBrace)}}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},re.prototype=Object.create(r.ParserRuleContext.prototype),re.prototype.constructor=re,re.prototype.propertyAssignment=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(ae):this.getTypedRuleContext(ae,e)},re.prototype.Comma=function(e){return void 0===e&&(e=null),null===e?this.getTokens(h.Comma):this.getToken(h.Comma,e)},re.prototype.enterRule=function(e){e instanceof a&&e.enterPropertyNameAndValueList(this)},re.prototype.exitRule=function(e){e instanceof a&&e.exitPropertyNameAndValueList(this)},re.prototype.accept=function(e){return e instanceof i?e.visitPropertyNameAndValueList(this):e.visitChildren(this)},h.PropertyNameAndValueListContext=re,h.prototype.propertyNameAndValueList=function(){var e=new re(this,this._ctx,this.state);this.enterRule(e,74,h.RULE_propertyNameAndValueList);try{this.enterOuterAlt(e,1),this.state=433,this.propertyAssignment(),this.state=438,this._errHandler.sync(this);for(var t=this._interp.adaptivePredict(this._input,40,this._ctx);2!=t&&t!=r.atn.ATN.INVALID_ALT_NUMBER;)1===t&&(this.state=434,this.match(h.Comma),this.state=435,this.propertyAssignment()),this.state=440,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,40,this._ctx)}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},ae.prototype=Object.create(r.ParserRuleContext.prototype),ae.prototype.constructor=ae,ae.prototype.copyFrom=function(e){r.ParserRuleContext.prototype.copyFrom.call(this,e)},ie.prototype=Object.create(ae.prototype),ie.prototype.constructor=ie,h.PropertySetterContext=ie,ie.prototype.setter=function(){return this.getTypedRuleContext(Tt,0)},ie.prototype.OpenParen=function(){return this.getToken(h.OpenParen,0)},ie.prototype.propertySetParameterList=function(){return this.getTypedRuleContext(pe,0)},ie.prototype.CloseParen=function(){return this.getToken(h.CloseParen,0)},ie.prototype.OpenBrace=function(){return this.getToken(h.OpenBrace,0)},ie.prototype.functionBody=function(){return this.getTypedRuleContext(Z,0)},ie.prototype.CloseBrace=function(){return this.getToken(h.CloseBrace,0)},ie.prototype.enterRule=function(e){e instanceof a&&e.enterPropertySetter(this)},ie.prototype.exitRule=function(e){e instanceof a&&e.exitPropertySetter(this)},ie.prototype.accept=function(e){return e instanceof i?e.visitPropertySetter(this):e.visitChildren(this)},oe.prototype=Object.create(ae.prototype),oe.prototype.constructor=oe,h.PropertyAssignmentExpressionContext=oe,oe.prototype.propertyName=function(){return this.getTypedRuleContext(le,0)},oe.prototype.Colon=function(){return this.getToken(h.Colon,0)},oe.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},oe.prototype.enterRule=function(e){e instanceof a&&e.enterPropertyAssignmentExpression(this)},oe.prototype.exitRule=function(e){e instanceof a&&e.exitPropertyAssignmentExpression(this)},oe.prototype.accept=function(e){return e instanceof i?e.visitPropertyAssignmentExpression(this):e.visitChildren(this)},se.prototype=Object.create(ae.prototype),se.prototype.constructor=se,h.PropertyGetterContext=se,se.prototype.getter=function(){return this.getTypedRuleContext(gt,0)},se.prototype.OpenParen=function(){return this.getToken(h.OpenParen,0)},se.prototype.CloseParen=function(){return this.getToken(h.CloseParen,0)},se.prototype.OpenBrace=function(){return this.getToken(h.OpenBrace,0)},se.prototype.functionBody=function(){return this.getTypedRuleContext(Z,0)},se.prototype.CloseBrace=function(){return this.getToken(h.CloseBrace,0)},se.prototype.enterRule=function(e){e instanceof a&&e.enterPropertyGetter(this)},se.prototype.exitRule=function(e){e instanceof a&&e.exitPropertyGetter(this)},se.prototype.accept=function(e){return e instanceof i?e.visitPropertyGetter(this):e.visitChildren(this)},h.PropertyAssignmentContext=ae,h.prototype.propertyAssignment=function(){var e=new ae(this,this._ctx,this.state);this.enterRule(e,76,h.RULE_propertyAssignment);try{switch(this.state=460,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,41,this._ctx)){case 1:e=new oe(this,e),this.enterOuterAlt(e,1),this.state=441,this.propertyName(),this.state=442,this.match(h.Colon),this.state=443,this.singleExpression(0);break;case 2:e=new se(this,e),this.enterOuterAlt(e,2),this.state=445,this.getter(),this.state=446,this.match(h.OpenParen),this.state=447,this.match(h.CloseParen),this.state=448,this.match(h.OpenBrace),this.state=449,this.functionBody(),this.state=450,this.match(h.CloseBrace);break;case 3:e=new ie(this,e),this.enterOuterAlt(e,3),this.state=452,this.setter(),this.state=453,this.match(h.OpenParen),this.state=454,this.propertySetParameterList(),this.state=455,this.match(h.CloseParen),this.state=456,this.match(h.OpenBrace),this.state=457,this.functionBody(),this.state=458,this.match(h.CloseBrace)}}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},le.prototype=Object.create(r.ParserRuleContext.prototype),le.prototype.constructor=le,le.prototype.identifierName=function(){return this.getTypedRuleContext(ut,0)},le.prototype.StringLiteral=function(){return this.getToken(h.StringLiteral,0)},le.prototype.numericLiteral=function(){return this.getTypedRuleContext(it,0)},le.prototype.enterRule=function(e){e instanceof a&&e.enterPropertyName(this)},le.prototype.exitRule=function(e){e instanceof a&&e.exitPropertyName(this)},le.prototype.accept=function(e){return e instanceof i?e.visitPropertyName(this):e.visitChildren(this)},h.PropertyNameContext=le,h.prototype.propertyName=function(){var e=new le(this,this._ctx,this.state);this.enterRule(e,78,h.RULE_propertyName);try{switch(this.state=465,this._errHandler.sync(this),this._input.LA(1)){case h.NullLiteral:case h.BooleanLiteral:case h.Break:case h.Do:case h.Instanceof:case h.Typeof:case h.Case:case h.Else:case h.New:case h.Var:case h.Catch:case h.Finally:case h.Return:case h.Void:case h.Continue:case h.For:case h.Switch:case h.While:case h.Debugger:case h.Function:case h.This:case h.With:case h.Default:case h.If:case h.Throw:case h.Delete:case h.In:case h.Try:case h.Class:case h.Enum:case h.Extends:case h.Super:case h.Const:case h.Export:case h.Import:case h.Implements:case h.Let:case h.Private:case h.Public:case h.Interface:case h.Package:case h.Protected:case h.Static:case h.Yield:case h.Identifier:this.enterOuterAlt(e,1),this.state=462,this.identifierName();break;case h.StringLiteral:this.enterOuterAlt(e,2),this.state=463,this.match(h.StringLiteral);break;case h.IntegerLiteral:case h.DecimalLiteral:case h.HexIntegerLiteral:case h.OctalIntegerLiteral:this.enterOuterAlt(e,3),this.state=464,this.numericLiteral();break;default:throw new r.error.NoViableAltException(this)}}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},pe.prototype=Object.create(r.ParserRuleContext.prototype),pe.prototype.constructor=pe,pe.prototype.Identifier=function(){return this.getToken(h.Identifier,0)},pe.prototype.enterRule=function(e){e instanceof a&&e.enterPropertySetParameterList(this)},pe.prototype.exitRule=function(e){e instanceof a&&e.exitPropertySetParameterList(this)},pe.prototype.accept=function(e){return e instanceof i?e.visitPropertySetParameterList(this):e.visitChildren(this)},h.PropertySetParameterListContext=pe,h.prototype.propertySetParameterList=function(){var e=new pe(this,this._ctx,this.state);this.enterRule(e,80,h.RULE_propertySetParameterList);try{this.enterOuterAlt(e,1),this.state=467,this.match(h.Identifier)}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},ue.prototype=Object.create(r.ParserRuleContext.prototype),ue.prototype.constructor=ue,ue.prototype.OpenParen=function(){return this.getToken(h.OpenParen,0)},ue.prototype.CloseParen=function(){return this.getToken(h.CloseParen,0)},ue.prototype.argumentList=function(){return this.getTypedRuleContext(me,0)},ue.prototype.Comma=function(){return this.getToken(h.Comma,0)},ue.prototype.enterRule=function(e){e instanceof a&&e.enterArguments(this)},ue.prototype.exitRule=function(e){e instanceof a&&e.exitArguments(this)},ue.prototype.accept=function(e){return e instanceof i?e.visitArguments(this):e.visitChildren(this)},h.ArgumentsContext=ue,h.prototype.arguments=function(){var e=new ue(this,this._ctx,this.state);this.enterRule(e,82,h.RULE_arguments);var t=0;try{this.enterOuterAlt(e,1),this.state=469,this.match(h.OpenParen),this.state=471,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<h.RegularExpressionLiteral|1<<h.OpenBracket|1<<h.OpenParen|1<<h.OpenBrace|1<<h.PlusPlus|1<<h.MinusMinus|1<<h.Plus|1<<h.Minus|1<<h.BitNot|1<<h.Not)||!(t-51&-32)&&1<<t-51&(1<<h.NullLiteral-51|1<<h.UndefinedLiteral-51|1<<h.BooleanLiteral-51|1<<h.IntegerLiteral-51|1<<h.DecimalLiteral-51|1<<h.HexIntegerLiteral-51|1<<h.OctalIntegerLiteral-51|1<<h.Typeof-51|1<<h.New-51|1<<h.Void-51|1<<h.Function-51|1<<h.This-51|1<<h.Delete-51)||t===h.Identifier||t===h.StringLiteral)&&(this.state=470,this.argumentList()),this.state=474,this._errHandler.sync(this),(t=this._input.LA(1))===h.Comma&&(this.state=473,this.match(h.Comma)),this.state=476,this.match(h.CloseParen)}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},me.prototype=Object.create(r.ParserRuleContext.prototype),me.prototype.constructor=me,me.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(he):this.getTypedRuleContext(he,e)},me.prototype.Comma=function(e){return void 0===e&&(e=null),null===e?this.getTokens(h.Comma):this.getToken(h.Comma,e)},me.prototype.enterRule=function(e){e instanceof a&&e.enterArgumentList(this)},me.prototype.exitRule=function(e){e instanceof a&&e.exitArgumentList(this)},me.prototype.accept=function(e){return e instanceof i?e.visitArgumentList(this):e.visitChildren(this)},h.ArgumentListContext=me,h.prototype.argumentList=function(){var e=new me(this,this._ctx,this.state);this.enterRule(e,84,h.RULE_argumentList);try{this.enterOuterAlt(e,1),this.state=478,this.singleExpression(0),this.state=483,this._errHandler.sync(this);for(var t=this._interp.adaptivePredict(this._input,45,this._ctx);2!=t&&t!=r.atn.ATN.INVALID_ALT_NUMBER;)1===t&&(this.state=479,this.match(h.Comma),this.state=480,this.singleExpression(0)),this.state=485,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,45,this._ctx)}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},ce.prototype=Object.create(r.ParserRuleContext.prototype),ce.prototype.constructor=ce,ce.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(he):this.getTypedRuleContext(he,e)},ce.prototype.Comma=function(e){return void 0===e&&(e=null),null===e?this.getTokens(h.Comma):this.getToken(h.Comma,e)},ce.prototype.enterRule=function(e){e instanceof a&&e.enterExpressionSequence(this)},ce.prototype.exitRule=function(e){e instanceof a&&e.exitExpressionSequence(this)},ce.prototype.accept=function(e){return e instanceof i?e.visitExpressionSequence(this):e.visitChildren(this)},h.ExpressionSequenceContext=ce,h.prototype.expressionSequence=function(){var e=new ce(this,this._ctx,this.state);this.enterRule(e,86,h.RULE_expressionSequence);try{this.enterOuterAlt(e,1),this.state=486,this.singleExpression(0),this.state=491,this._errHandler.sync(this);for(var t=this._interp.adaptivePredict(this._input,46,this._ctx);2!=t&&t!=r.atn.ATN.INVALID_ALT_NUMBER;)1===t&&(this.state=487,this.match(h.Comma),this.state=488,this.singleExpression(0)),this.state=493,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,46,this._ctx)}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},he.prototype=Object.create(r.ParserRuleContext.prototype),he.prototype.constructor=he,he.prototype.copyFrom=function(e){r.ParserRuleContext.prototype.copyFrom.call(this,e)},ge.prototype=Object.create(he.prototype),ge.prototype.constructor=ge,h.TernaryExpressionContext=ge,ge.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(he):this.getTypedRuleContext(he,e)},ge.prototype.QuestionMark=function(){return this.getToken(h.QuestionMark,0)},ge.prototype.Colon=function(){return this.getToken(h.Colon,0)},ge.prototype.enterRule=function(e){e instanceof a&&e.enterTernaryExpression(this)},ge.prototype.exitRule=function(e){e instanceof a&&e.exitTernaryExpression(this)},ge.prototype.accept=function(e){return e instanceof i?e.visitTernaryExpression(this):e.visitChildren(this)},Te.prototype=Object.create(he.prototype),Te.prototype.constructor=Te,h.LogicalAndExpressionContext=Te,Te.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(he):this.getTypedRuleContext(he,e)},Te.prototype.And=function(){return this.getToken(h.And,0)},Te.prototype.enterRule=function(e){e instanceof a&&e.enterLogicalAndExpression(this)},Te.prototype.exitRule=function(e){e instanceof a&&e.exitLogicalAndExpression(this)},Te.prototype.accept=function(e){return e instanceof i?e.visitLogicalAndExpression(this):e.visitChildren(this)},ye.prototype=Object.create(he.prototype),ye.prototype.constructor=ye,h.FuncDefExpressionContext=ye,ye.prototype.Function=function(){return this.getToken(h.Function,0)},ye.prototype.OpenParen=function(){return this.getToken(h.OpenParen,0)},ye.prototype.CloseParen=function(){return this.getToken(h.CloseParen,0)},ye.prototype.OpenBrace=function(){return this.getToken(h.OpenBrace,0)},ye.prototype.functionBody=function(){return this.getTypedRuleContext(Z,0)},ye.prototype.CloseBrace=function(){return this.getToken(h.CloseBrace,0)},ye.prototype.Identifier=function(){return this.getToken(h.Identifier,0)},ye.prototype.formalParameterList=function(){return this.getTypedRuleContext(J,0)},ye.prototype.enterRule=function(e){e instanceof a&&e.enterFuncDefExpression(this)},ye.prototype.exitRule=function(e){e instanceof a&&e.exitFuncDefExpression(this)},ye.prototype.accept=function(e){return e instanceof i?e.visitFuncDefExpression(this):e.visitChildren(this)},de.prototype=Object.create(he.prototype),de.prototype.constructor=de,h.PreIncrementExpressionContext=de,de.prototype.PlusPlus=function(){return this.getToken(h.PlusPlus,0)},de.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},de.prototype.enterRule=function(e){e instanceof a&&e.enterPreIncrementExpression(this)},de.prototype.exitRule=function(e){e instanceof a&&e.exitPreIncrementExpression(this)},de.prototype.accept=function(e){return e instanceof i?e.visitPreIncrementExpression(this):e.visitChildren(this)},fe.prototype=Object.create(he.prototype),fe.prototype.constructor=fe,h.ObjectLiteralExpressionContext=fe,fe.prototype.objectLiteral=function(){return this.getTypedRuleContext(ne,0)},fe.prototype.enterRule=function(e){e instanceof a&&e.enterObjectLiteralExpression(this)},fe.prototype.exitRule=function(e){e instanceof a&&e.exitObjectLiteralExpression(this)},fe.prototype.accept=function(e){return e instanceof i?e.visitObjectLiteralExpression(this):e.visitChildren(this)},Se.prototype=Object.create(he.prototype),Se.prototype.constructor=Se,h.InExpressionContext=Se,Se.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(he):this.getTypedRuleContext(he,e)},Se.prototype.In=function(){return this.getToken(h.In,0)},Se.prototype.enterRule=function(e){e instanceof a&&e.enterInExpression(this)},Se.prototype.exitRule=function(e){e instanceof a&&e.exitInExpression(this)},Se.prototype.accept=function(e){return e instanceof i?e.visitInExpression(this):e.visitChildren(this)},be.prototype=Object.create(he.prototype),be.prototype.constructor=be,h.LogicalOrExpressionContext=be,be.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(he):this.getTypedRuleContext(he,e)},be.prototype.Or=function(){return this.getToken(h.Or,0)},be.prototype.enterRule=function(e){e instanceof a&&e.enterLogicalOrExpression(this)},be.prototype.exitRule=function(e){e instanceof a&&e.exitLogicalOrExpression(this)},be.prototype.accept=function(e){return e instanceof i?e.visitLogicalOrExpression(this):e.visitChildren(this)},xe.prototype=Object.create(he.prototype),xe.prototype.constructor=xe,h.NotExpressionContext=xe,xe.prototype.Not=function(){return this.getToken(h.Not,0)},xe.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},xe.prototype.enterRule=function(e){e instanceof a&&e.enterNotExpression(this)},xe.prototype.exitRule=function(e){e instanceof a&&e.exitNotExpression(this)},xe.prototype.accept=function(e){return e instanceof i?e.visitNotExpression(this):e.visitChildren(this)},Ae.prototype=Object.create(he.prototype),Ae.prototype.constructor=Ae,h.PreDecreaseExpressionContext=Ae,Ae.prototype.MinusMinus=function(){return this.getToken(h.MinusMinus,0)},Ae.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},Ae.prototype.enterRule=function(e){e instanceof a&&e.enterPreDecreaseExpression(this)},Ae.prototype.exitRule=function(e){e instanceof a&&e.exitPreDecreaseExpression(this)},Ae.prototype.accept=function(e){return e instanceof i?e.visitPreDecreaseExpression(this):e.visitChildren(this)},Le.prototype=Object.create(he.prototype),Le.prototype.constructor=Le,h.ThisExpressionContext=Le,Le.prototype.This=function(){return this.getToken(h.This,0)},Le.prototype.enterRule=function(e){e instanceof a&&e.enterThisExpression(this)},Le.prototype.exitRule=function(e){e instanceof a&&e.exitThisExpression(this)},Le.prototype.accept=function(e){return e instanceof i?e.visitThisExpression(this):e.visitChildren(this)},Ee.prototype=Object.create(he.prototype);Ee.prototype.constructor=Ee,h.UnaryMinusExpressionContext=Ee,Ee.prototype.Minus=function(){return this.getToken(h.Minus,0)},Ee.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},Ee.prototype.enterRule=function(e){e instanceof a&&e.enterUnaryMinusExpression(this)},Ee.prototype.exitRule=function(e){e instanceof a&&e.exitUnaryMinusExpression(this)},Ee.prototype.accept=function(e){return e instanceof i?e.visitUnaryMinusExpression(this):e.visitChildren(this)},Ie.prototype=Object.create(he.prototype),Ie.prototype.constructor=Ie,h.PostDecreaseExpressionContext=Ie,Ie.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},Ie.prototype.MinusMinus=function(){return this.getToken(h.MinusMinus,0)},Ie.prototype.enterRule=function(e){e instanceof a&&e.enterPostDecreaseExpression(this)},Ie.prototype.exitRule=function(e){e instanceof a&&e.exitPostDecreaseExpression(this)},Ie.prototype.accept=function(e){return e instanceof i?e.visitPostDecreaseExpression(this):e.visitChildren(this)},De.prototype=Object.create(he.prototype),De.prototype.constructor=De,h.AssignmentExpressionContext=De,De.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},De.prototype.Assign=function(){return this.getToken(h.Assign,0)},De.prototype.expressionSequence=function(){return this.getTypedRuleContext(ce,0)},De.prototype.enterRule=function(e){e instanceof a&&e.enterAssignmentExpression(this)},De.prototype.exitRule=function(e){e instanceof a&&e.exitAssignmentExpression(this)},De.prototype.accept=function(e){return e instanceof i?e.visitAssignmentExpression(this):e.visitChildren(this)},ve.prototype=Object.create(he.prototype),ve.prototype.constructor=ve,h.TypeofExpressionContext=ve,ve.prototype.Typeof=function(){return this.getToken(h.Typeof,0)},ve.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},ve.prototype.enterRule=function(e){e instanceof a&&e.enterTypeofExpression(this)},ve.prototype.exitRule=function(e){e instanceof a&&e.exitTypeofExpression(this)},ve.prototype.accept=function(e){return e instanceof i?e.visitTypeofExpression(this):e.visitChildren(this)},_e.prototype=Object.create(he.prototype),_e.prototype.constructor=_e,h.InstanceofExpressionContext=_e,_e.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(he):this.getTypedRuleContext(he,e)},_e.prototype.Instanceof=function(){return this.getToken(h.Instanceof,0)},_e.prototype.enterRule=function(e){e instanceof a&&e.enterInstanceofExpression(this)},_e.prototype.exitRule=function(e){e instanceof a&&e.exitInstanceofExpression(this)},_e.prototype.accept=function(e){return e instanceof i?e.visitInstanceofExpression(this):e.visitChildren(this)},Ce.prototype=Object.create(he.prototype),Ce.prototype.constructor=Ce,h.UnaryPlusExpressionContext=Ce,Ce.prototype.Plus=function(){return this.getToken(h.Plus,0)},Ce.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},Ce.prototype.enterRule=function(e){e instanceof a&&e.enterUnaryPlusExpression(this)},Ce.prototype.exitRule=function(e){e instanceof a&&e.exitUnaryPlusExpression(this)},Ce.prototype.accept=function(e){return e instanceof i?e.visitUnaryPlusExpression(this):e.visitChildren(this)},Oe.prototype=Object.create(he.prototype),Oe.prototype.constructor=Oe,h.DeleteExpressionContext=Oe,Oe.prototype.Delete=function(){return this.getToken(h.Delete,0)},Oe.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},Oe.prototype.enterRule=function(e){e instanceof a&&e.enterDeleteExpression(this)},Oe.prototype.exitRule=function(e){e instanceof a&&e.exitDeleteExpression(this)},Oe.prototype.accept=function(e){return e instanceof i?e.visitDeleteExpression(this):e.visitChildren(this)},Be.prototype=Object.create(he.prototype),Be.prototype.constructor=Be,h.EqualityExpressionContext=Be,Be.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(he):this.getTypedRuleContext(he,e)},Be.prototype.Equals=function(){return this.getToken(h.Equals,0)},Be.prototype.NotEquals=function(){return this.getToken(h.NotEquals,0)},Be.prototype.IdentityEquals=function(){return this.getToken(h.IdentityEquals,0)},Be.prototype.IdentityNotEquals=function(){return this.getToken(h.IdentityNotEquals,0)},Be.prototype.enterRule=function(e){e instanceof a&&e.enterEqualityExpression(this)},Be.prototype.exitRule=function(e){e instanceof a&&e.exitEqualityExpression(this)},Be.prototype.accept=function(e){return e instanceof i?e.visitEqualityExpression(this):e.visitChildren(this)},je.prototype=Object.create(he.prototype),je.prototype.constructor=je,h.BitXOrExpressionContext=je,je.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(he):this.getTypedRuleContext(he,e)},je.prototype.BitXOr=function(){return this.getToken(h.BitXOr,0)},je.prototype.enterRule=function(e){e instanceof a&&e.enterBitXOrExpression(this)},je.prototype.exitRule=function(e){e instanceof a&&e.exitBitXOrExpression(this)},je.prototype.accept=function(e){return e instanceof i?e.visitBitXOrExpression(this):e.visitChildren(this)},Ne.prototype=Object.create(he.prototype),Ne.prototype.constructor=Ne,h.MultiplicativeExpressionContext=Ne,Ne.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(he):this.getTypedRuleContext(he,e)},Ne.prototype.Multiply=function(){return this.getToken(h.Multiply,0)},Ne.prototype.Divide=function(){return this.getToken(h.Divide,0)},Ne.prototype.Modulus=function(){return this.getToken(h.Modulus,0)},Ne.prototype.enterRule=function(e){e instanceof a&&e.enterMultiplicativeExpression(this)},Ne.prototype.exitRule=function(e){e instanceof a&&e.exitMultiplicativeExpression(this)},Ne.prototype.accept=function(e){return e instanceof i?e.visitMultiplicativeExpression(this):e.visitChildren(this)},we.prototype=Object.create(he.prototype),we.prototype.constructor=we,h.BitShiftExpressionContext=we,we.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(he):this.getTypedRuleContext(he,e)},we.prototype.LeftShiftArithmetic=function(){return this.getToken(h.LeftShiftArithmetic,0)},we.prototype.RightShiftArithmetic=function(){return this.getToken(h.RightShiftArithmetic,0)},we.prototype.RightShiftLogical=function(){return this.getToken(h.RightShiftLogical,0)},we.prototype.enterRule=function(e){e instanceof a&&e.enterBitShiftExpression(this)},we.prototype.exitRule=function(e){e instanceof a&&e.exitBitShiftExpression(this)},we.prototype.accept=function(e){return e instanceof i?e.visitBitShiftExpression(this):e.visitChildren(this)},Re.prototype=Object.create(he.prototype),Re.prototype.constructor=Re,h.ParenthesizedExpressionContext=Re,Re.prototype.OpenParen=function(){return this.getToken(h.OpenParen,0)},Re.prototype.expressionSequence=function(){return this.getTypedRuleContext(ce,0)},Re.prototype.CloseParen=function(){return this.getToken(h.CloseParen,0)},Re.prototype.enterRule=function(e){e instanceof a&&e.enterParenthesizedExpression(this)},Re.prototype.exitRule=function(e){e instanceof a&&e.exitParenthesizedExpression(this)},Re.prototype.accept=function(e){return e instanceof i?e.visitParenthesizedExpression(this):e.visitChildren(this)},Fe.prototype=Object.create(he.prototype),Fe.prototype.constructor=Fe,h.GetAttributeExpressionContext=Fe,Fe.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},Fe.prototype.Dot=function(){return this.getToken(h.Dot,0)},Fe.prototype.identifierName=function(){return this.getTypedRuleContext(ut,0)},Fe.prototype.enterRule=function(e){e instanceof a&&e.enterGetAttributeExpression(this)},Fe.prototype.exitRule=function(e){e instanceof a&&e.exitGetAttributeExpression(this)},Fe.prototype.accept=function(e){return e instanceof i?e.visitGetAttributeExpression(this):e.visitChildren(this)},ke.prototype=Object.create(he.prototype),ke.prototype.constructor=ke,h.AdditiveExpressionContext=ke,ke.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(he):this.getTypedRuleContext(he,e)},ke.prototype.Plus=function(){return this.getToken(h.Plus,0)},ke.prototype.Minus=function(){return this.getToken(h.Minus,0)},ke.prototype.enterRule=function(e){e instanceof a&&e.enterAdditiveExpression(this)},ke.prototype.exitRule=function(e){e instanceof a&&e.exitAdditiveExpression(this)},ke.prototype.accept=function(e){return e instanceof i?e.visitAdditiveExpression(this):e.visitChildren(this)},$e.prototype=Object.create(he.prototype),$e.prototype.constructor=$e,h.RelationalExpressionContext=$e,$e.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(he):this.getTypedRuleContext(he,e)},$e.prototype.LessThan=function(){return this.getToken(h.LessThan,0)},$e.prototype.MoreThan=function(){return this.getToken(h.MoreThan,0)},$e.prototype.LessThanEquals=function(){return this.getToken(h.LessThanEquals,0)},$e.prototype.GreaterThanEquals=function(){return this.getToken(h.GreaterThanEquals,0)},$e.prototype.enterRule=function(e){e instanceof a&&e.enterRelationalExpression(this)},$e.prototype.exitRule=function(e){e instanceof a&&e.exitRelationalExpression(this)},$e.prototype.accept=function(e){return e instanceof i?e.visitRelationalExpression(this):e.visitChildren(this)},Pe.prototype=Object.create(he.prototype),Pe.prototype.constructor=Pe,h.PostIncrementExpressionContext=Pe,Pe.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},Pe.prototype.PlusPlus=function(){return this.getToken(h.PlusPlus,0)},Pe.prototype.enterRule=function(e){e instanceof a&&e.enterPostIncrementExpression(this)},Pe.prototype.exitRule=function(e){e instanceof a&&e.exitPostIncrementExpression(this)},Pe.prototype.accept=function(e){return e instanceof i?e.visitPostIncrementExpression(this):e.visitChildren(this)},Me.prototype=Object.create(he.prototype),Me.prototype.constructor=Me,h.FuncCallExpressionContext=Me,Me.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},Me.prototype.arguments=function(){return this.getTypedRuleContext(ue,0)},Me.prototype.enterRule=function(e){e instanceof a&&e.enterFuncCallExpression(this)},Me.prototype.exitRule=function(e){e instanceof a&&e.exitFuncCallExpression(this)},Me.prototype.accept=function(e){return e instanceof i?e.visitFuncCallExpression(this):e.visitChildren(this)},Ue.prototype=Object.create(he.prototype),Ue.prototype.constructor=Ue,h.BitNotExpressionContext=Ue,Ue.prototype.BitNot=function(){return this.getToken(h.BitNot,0)},Ue.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},Ue.prototype.enterRule=function(e){e instanceof a&&e.enterBitNotExpression(this)},Ue.prototype.exitRule=function(e){e instanceof a&&e.exitBitNotExpression(this)},Ue.prototype.accept=function(e){return e instanceof i?e.visitBitNotExpression(this):e.visitChildren(this)},qe.prototype=Object.create(he.prototype),qe.prototype.constructor=qe,h.NewExpressionContext=qe,qe.prototype.New=function(){return this.getToken(h.New,0)},qe.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},qe.prototype.arguments=function(){return this.getTypedRuleContext(ue,0)},qe.prototype.enterRule=function(e){e instanceof a&&e.enterNewExpression(this)},qe.prototype.exitRule=function(e){e instanceof a&&e.exitNewExpression(this)},qe.prototype.accept=function(e){return e instanceof i?e.visitNewExpression(this):e.visitChildren(this)},Ge.prototype=Object.create(he.prototype),Ge.prototype.constructor=Ge,h.LiteralExpressionContext=Ge,Ge.prototype.literal=function(){return this.getTypedRuleContext(Ze,0)},Ge.prototype.enterRule=function(e){e instanceof a&&e.enterLiteralExpression(this)},Ge.prototype.exitRule=function(e){e instanceof a&&e.exitLiteralExpression(this)},Ge.prototype.accept=function(e){return e instanceof i?e.visitLiteralExpression(this):e.visitChildren(this)},He.prototype=Object.create(he.prototype),He.prototype.constructor=He,h.ArrayLiteralExpressionContext=He,He.prototype.arrayLiteral=function(){return this.getTypedRuleContext(Q,0)},He.prototype.enterRule=function(e){e instanceof a&&e.enterArrayLiteralExpression(this)},He.prototype.exitRule=function(e){e instanceof a&&e.exitArrayLiteralExpression(this)},He.prototype.accept=function(e){return e instanceof i?e.visitArrayLiteralExpression(this):e.visitChildren(this)},Ve.prototype=Object.create(he.prototype),Ve.prototype.constructor=Ve,h.MemberIndexExpressionContext=Ve,Ve.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},Ve.prototype.OpenBracket=function(){return this.getToken(h.OpenBracket,0)},Ve.prototype.expressionSequence=function(){return this.getTypedRuleContext(ce,0)},Ve.prototype.CloseBracket=function(){return this.getToken(h.CloseBracket,0)},Ve.prototype.enterRule=function(e){e instanceof a&&e.enterMemberIndexExpression(this)},Ve.prototype.exitRule=function(e){e instanceof a&&e.exitMemberIndexExpression(this)},Ve.prototype.accept=function(e){return e instanceof i?e.visitMemberIndexExpression(this):e.visitChildren(this)},Ke.prototype=Object.create(he.prototype),Ke.prototype.constructor=Ke,h.IdentifierExpressionContext=Ke,Ke.prototype.Identifier=function(){return this.getToken(h.Identifier,0)},Ke.prototype.enterRule=function(e){e instanceof a&&e.enterIdentifierExpression(this)},Ke.prototype.exitRule=function(e){e instanceof a&&e.exitIdentifierExpression(this)},Ke.prototype.accept=function(e){return e instanceof i?e.visitIdentifierExpression(this):e.visitChildren(this)},Ye.prototype=Object.create(he.prototype),Ye.prototype.constructor=Ye,h.BitAndExpressionContext=Ye,Ye.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(he):this.getTypedRuleContext(he,e)},Ye.prototype.BitAnd=function(){return this.getToken(h.BitAnd,0)},Ye.prototype.enterRule=function(e){e instanceof a&&e.enterBitAndExpression(this)},Ye.prototype.exitRule=function(e){e instanceof a&&e.exitBitAndExpression(this)},Ye.prototype.accept=function(e){return e instanceof i?e.visitBitAndExpression(this):e.visitChildren(this)},Xe.prototype=Object.create(he.prototype),Xe.prototype.constructor=Xe,h.BitOrExpressionContext=Xe,Xe.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(he):this.getTypedRuleContext(he,e)},Xe.prototype.BitOr=function(){return this.getToken(h.BitOr,0)},Xe.prototype.enterRule=function(e){e instanceof a&&e.enterBitOrExpression(this)},Xe.prototype.exitRule=function(e){e instanceof a&&e.exitBitOrExpression(this)},Xe.prototype.accept=function(e){return e instanceof i?e.visitBitOrExpression(this):e.visitChildren(this)},ze.prototype=Object.create(he.prototype),ze.prototype.constructor=ze,h.AssignmentOperatorExpressionContext=ze,ze.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},ze.prototype.assignmentOperator=function(){return this.getTypedRuleContext(Je,0)},ze.prototype.expressionSequence=function(){return this.getTypedRuleContext(ce,0)},ze.prototype.enterRule=function(e){e instanceof a&&e.enterAssignmentOperatorExpression(this)},ze.prototype.exitRule=function(e){e instanceof a&&e.exitAssignmentOperatorExpression(this)},ze.prototype.accept=function(e){return e instanceof i?e.visitAssignmentOperatorExpression(this):e.visitChildren(this)},We.prototype=Object.create(he.prototype),We.prototype.constructor=We,h.VoidExpressionContext=We,We.prototype.Void=function(){return this.getToken(h.Void,0)},We.prototype.singleExpression=function(){return this.getTypedRuleContext(he,0)},We.prototype.enterRule=function(e){e instanceof a&&e.enterVoidExpression(this)},We.prototype.exitRule=function(e){e instanceof a&&e.exitVoidExpression(this)},We.prototype.accept=function(e){return e instanceof i?e.visitVoidExpression(this):e.visitChildren(this)},h.prototype.singleExpression=function(e){void 0===e&&(e=0);var t=this._ctx,n=this.state,a=new he(this,this._ctx,n),i=88;this.enterRecursionRule(a,88,h.RULE_singleExpression,e);var o=0;try{switch(this.enterOuterAlt(a,1),this.state=540,this._errHandler.sync(this),this._input.LA(1)){case h.Function:a=new ye(this,a),this._ctx=a,this.state=495,this.match(h.Function),this.state=497,this._errHandler.sync(this),(o=this._input.LA(1))===h.Identifier&&(this.state=496,this.match(h.Identifier)),this.state=499,this.match(h.OpenParen),this.state=501,this._errHandler.sync(this),(o=this._input.LA(1))===h.Identifier&&(this.state=500,this.formalParameterList()),this.state=503,this.match(h.CloseParen),this.state=504,this.match(h.OpenBrace),this.state=505,this.functionBody(),this.state=506,this.match(h.CloseBrace);break;case h.New:a=new qe(this,a),this._ctx=a,this.state=508,this.match(h.New),this.state=509,this.singleExpression(0),this.state=511,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,49,this._ctx)&&(this.state=510,this.arguments());break;case h.Delete:a=new Oe(this,a),this._ctx=a,this.state=513,this.match(h.Delete),this.state=514,this.singleExpression(30);break;case h.Void:a=new We(this,a),this._ctx=a,this.state=515,this.match(h.Void),this.state=516,this.singleExpression(29);break;case h.Typeof:a=new ve(this,a),this._ctx=a,this.state=517,this.match(h.Typeof),this.state=518,this.singleExpression(28);break;case h.PlusPlus:a=new de(this,a),this._ctx=a,this.state=519,this.match(h.PlusPlus),this.state=520,this.singleExpression(27);break;case h.MinusMinus:a=new Ae(this,a),this._ctx=a,this.state=521,this.match(h.MinusMinus),this.state=522,this.singleExpression(26);break;case h.Plus:a=new Ce(this,a),this._ctx=a,this.state=523,this.match(h.Plus),this.state=524,this.singleExpression(25);break;case h.Minus:a=new Ee(this,a),this._ctx=a,this.state=525,this.match(h.Minus),this.state=526,this.singleExpression(24);break;case h.BitNot:a=new Ue(this,a),this._ctx=a,this.state=527,this.match(h.BitNot),this.state=528,this.singleExpression(23);break;case h.Not:a=new xe(this,a),this._ctx=a,this.state=529,this.match(h.Not),this.state=530,this.singleExpression(22);break;case h.This:a=new Le(this,a),this._ctx=a,this.state=531,this.match(h.This);break;case h.Identifier:a=new Ke(this,a),this._ctx=a,this.state=532,this.match(h.Identifier);break;case h.RegularExpressionLiteral:case h.NullLiteral:case h.UndefinedLiteral:case h.BooleanLiteral:case h.IntegerLiteral:case h.DecimalLiteral:case h.HexIntegerLiteral:case h.OctalIntegerLiteral:case h.StringLiteral:a=new Ge(this,a),this._ctx=a,this.state=533,this.literal();break;case h.OpenBracket:a=new He(this,a),this._ctx=a,this.state=534,this.arrayLiteral();break;case h.OpenBrace:a=new fe(this,a),this._ctx=a,this.state=535,this.objectLiteral();break;case h.OpenParen:a=new Re(this,a),this._ctx=a,this.state=536,this.match(h.OpenParen),this.state=537,this.expressionSequence(),this.state=538,this.match(h.CloseParen);break;default:throw new r.error.NoViableAltException(this)}this._ctx.stop=this._input.LT(-1),this.state=609,this._errHandler.sync(this);for(var s=this._interp.adaptivePredict(this._input,52,this._ctx);2!=s&&s!=r.atn.ATN.INVALID_ALT_NUMBER;){if(1===s)switch(null!==this._parseListeners&&this.triggerExitRuleEvent(),this.state=607,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,51,this._ctx)){case 1:if(a=new Ne(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=542,!this.precpred(this._ctx,21))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 21)");this.state=543,-32&(o=this._input.LA(1))||!(1<<o&(1<<h.Multiply|1<<h.Divide|1<<h.Modulus))?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume()),this.state=544,this.singleExpression(22);break;case 2:if(a=new ke(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=545,!this.precpred(this._ctx,20))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 20)");this.state=546,(o=this._input.LA(1))!==h.Plus&&o!==h.Minus?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume()),this.state=547,this.singleExpression(21);break;case 3:if(a=new we(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=548,!this.precpred(this._ctx,19))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 19)");this.state=549,-32&(o=this._input.LA(1))||!(1<<o&(1<<h.RightShiftArithmetic|1<<h.LeftShiftArithmetic|1<<h.RightShiftLogical))?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume()),this.state=550,this.singleExpression(20);break;case 4:if(a=new $e(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=551,!this.precpred(this._ctx,18))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 18)");this.state=552,-32&(o=this._input.LA(1))||!(1<<o&(1<<h.LessThan|1<<h.MoreThan|1<<h.LessThanEquals|1<<h.GreaterThanEquals))?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume()),this.state=553,this.singleExpression(19);break;case 5:if(a=new _e(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=554,!this.precpred(this._ctx,17))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 17)");this.state=555,this.match(h.Instanceof),this.state=556,this.singleExpression(18);break;case 6:if(a=new Se(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=557,!this.precpred(this._ctx,16))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 16)");this.state=558,this.match(h.In),this.state=559,this.singleExpression(17);break;case 7:if(a=new Be(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=560,!this.precpred(this._ctx,15))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 15)");this.state=561,(o=this._input.LA(1))-31&-32||!(1<<o-31&(1<<h.Equals-31|1<<h.NotEquals-31|1<<h.IdentityEquals-31|1<<h.IdentityNotEquals-31))?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume()),this.state=562,this.singleExpression(16);break;case 8:if(a=new Ye(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=563,!this.precpred(this._ctx,14))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 14)");this.state=564,this.match(h.BitAnd),this.state=565,this.singleExpression(15);break;case 9:if(a=new je(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=566,!this.precpred(this._ctx,13))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 13)");this.state=567,this.match(h.BitXOr),this.state=568,this.singleExpression(14);break;case 10:if(a=new Xe(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=569,!this.precpred(this._ctx,12))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 12)");this.state=570,this.match(h.BitOr),this.state=571,this.singleExpression(13);break;case 11:if(a=new Te(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=572,!this.precpred(this._ctx,11))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 11)");this.state=573,this.match(h.And),this.state=574,this.singleExpression(12);break;case 12:if(a=new be(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=575,!this.precpred(this._ctx,10))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 10)");this.state=576,this.match(h.Or),this.state=577,this.singleExpression(11);break;case 13:if(a=new ge(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=578,!this.precpred(this._ctx,9))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 9)");this.state=579,this.match(h.QuestionMark),this.state=580,this.singleExpression(0),this.state=581,this.match(h.Colon),this.state=582,this.singleExpression(10);break;case 14:if(a=new Ve(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=584,!this.precpred(this._ctx,36))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 36)");this.state=585,this.match(h.OpenBracket),this.state=586,this.expressionSequence(),this.state=587,this.match(h.CloseBracket);break;case 15:if(a=new Fe(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=589,!this.precpred(this._ctx,35))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 35)");this.state=590,this.match(h.Dot),this.state=591,this.identifierName();break;case 16:if(a=new Me(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=592,!this.precpred(this._ctx,34))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 34)");this.state=593,this.arguments();break;case 17:if(a=new Pe(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=594,!this.precpred(this._ctx,32))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 32)");if(this.state=595,this.here(h.LineTerminator))throw new r.error.FailedPredicateException(this,"!this.here(ECMAScriptParser.LineTerminator)");this.state=596,this.match(h.PlusPlus);break;case 18:if(a=new Ie(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=597,!this.precpred(this._ctx,31))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 31)");if(this.state=598,this.here(h.LineTerminator))throw new r.error.FailedPredicateException(this,"!this.here(ECMAScriptParser.LineTerminator)");this.state=599,this.match(h.MinusMinus);break;case 19:if(a=new De(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=600,!this.precpred(this._ctx,8))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 8)");this.state=601,this.match(h.Assign),this.state=602,this.expressionSequence();break;case 20:if(a=new ze(this,new he(this,t,n)),this.pushNewRecursionContext(a,i,h.RULE_singleExpression),this.state=603,!this.precpred(this._ctx,7))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 7)");this.state=604,this.assignmentOperator(),this.state=605,this.expressionSequence()}this.state=611,this._errHandler.sync(this),s=this._interp.adaptivePredict(this._input,52,this._ctx)}}catch(e){if(!(e instanceof r.error.RecognitionException))throw e;a.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.unrollRecursionContexts(t)}return a},Je.prototype=Object.create(r.ParserRuleContext.prototype),Je.prototype.constructor=Je,Je.prototype.MultiplyAssign=function(){return this.getToken(h.MultiplyAssign,0)},Je.prototype.DivideAssign=function(){return this.getToken(h.DivideAssign,0)},Je.prototype.ModulusAssign=function(){return this.getToken(h.ModulusAssign,0)},Je.prototype.PlusAssign=function(){return this.getToken(h.PlusAssign,0)},Je.prototype.MinusAssign=function(){return this.getToken(h.MinusAssign,0)},Je.prototype.LeftShiftArithmeticAssign=function(){return this.getToken(h.LeftShiftArithmeticAssign,0)},Je.prototype.RightShiftArithmeticAssign=function(){return this.getToken(h.RightShiftArithmeticAssign,0)},Je.prototype.RightShiftLogicalAssign=function(){return this.getToken(h.RightShiftLogicalAssign,0)},Je.prototype.BitAndAssign=function(){return this.getToken(h.BitAndAssign,0)},Je.prototype.BitXorAssign=function(){return this.getToken(h.BitXorAssign,0)},Je.prototype.BitOrAssign=function(){return this.getToken(h.BitOrAssign,0)},Je.prototype.enterRule=function(e){e instanceof a&&e.enterAssignmentOperator(this)},Je.prototype.exitRule=function(e){e instanceof a&&e.exitAssignmentOperator(this)},Je.prototype.accept=function(e){return e instanceof i?e.visitAssignmentOperator(this):e.visitChildren(this)},h.AssignmentOperatorContext=Je,h.prototype.assignmentOperator=function(){var e=new Je(this,this._ctx,this.state);this.enterRule(e,90,h.RULE_assignmentOperator);var t=0;try{this.enterOuterAlt(e,1),this.state=612,(t=this._input.LA(1))-40&-32||!(1<<t-40&(1<<h.MultiplyAssign-40|1<<h.DivideAssign-40|1<<h.ModulusAssign-40|1<<h.PlusAssign-40|1<<h.MinusAssign-40|1<<h.LeftShiftArithmeticAssign-40|1<<h.RightShiftArithmeticAssign-40|1<<h.RightShiftLogicalAssign-40|1<<h.BitAndAssign-40|1<<h.BitXorAssign-40|1<<h.BitOrAssign-40))?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},Ze.prototype=Object.create(r.ParserRuleContext.prototype),Ze.prototype.constructor=Ze,Ze.prototype.copyFrom=function(e){r.ParserRuleContext.prototype.copyFrom.call(this,e)},Qe.prototype=Object.create(Ze.prototype),Qe.prototype.constructor=Qe,h.NumericLiteralWrapperContext=Qe,Qe.prototype.numericLiteral=function(){return this.getTypedRuleContext(it,0)},Qe.prototype.enterRule=function(e){e instanceof a&&e.enterNumericLiteralWrapper(this)},Qe.prototype.exitRule=function(e){e instanceof a&&e.exitNumericLiteralWrapper(this)},Qe.prototype.accept=function(e){return e instanceof i?e.visitNumericLiteralWrapper(this):e.visitChildren(this)},et.prototype=Object.create(Ze.prototype),et.prototype.constructor=et,h.UndefinedLiteralContext=et,et.prototype.UndefinedLiteral=function(){return this.getToken(h.UndefinedLiteral,0)},et.prototype.enterRule=function(e){e instanceof a&&e.enterUndefinedLiteral(this)},et.prototype.exitRule=function(e){e instanceof a&&e.exitUndefinedLiteral(this)},et.prototype.accept=function(e){return e instanceof i?e.visitUndefinedLiteral(this):e.visitChildren(this)},tt.prototype=Object.create(Ze.prototype),tt.prototype.constructor=tt,h.StringLiteralContext=tt,tt.prototype.StringLiteral=function(){return this.getToken(h.StringLiteral,0)},tt.prototype.enterRule=function(e){e instanceof a&&e.enterStringLiteral(this)},tt.prototype.exitRule=function(e){e instanceof a&&e.exitStringLiteral(this)},tt.prototype.accept=function(e){return e instanceof i?e.visitStringLiteral(this):e.visitChildren(this)},nt.prototype=Object.create(Ze.prototype),nt.prototype.constructor=nt,h.RegularExpressionLiteralContext=nt,nt.prototype.RegularExpressionLiteral=function(){return this.getToken(h.RegularExpressionLiteral,0)},nt.prototype.enterRule=function(e){e instanceof a&&e.enterRegularExpressionLiteral(this)},nt.prototype.exitRule=function(e){e instanceof a&&e.exitRegularExpressionLiteral(this)},nt.prototype.accept=function(e){return e instanceof i?e.visitRegularExpressionLiteral(this):e.visitChildren(this)},rt.prototype=Object.create(Ze.prototype),rt.prototype.constructor=rt,h.BooleanLiteralContext=rt,rt.prototype.BooleanLiteral=function(){return this.getToken(h.BooleanLiteral,0)},rt.prototype.enterRule=function(e){e instanceof a&&e.enterBooleanLiteral(this)},rt.prototype.exitRule=function(e){e instanceof a&&e.exitBooleanLiteral(this)},rt.prototype.accept=function(e){return e instanceof i?e.visitBooleanLiteral(this):e.visitChildren(this)},at.prototype=Object.create(Ze.prototype),at.prototype.constructor=at,h.NullLiteralContext=at,at.prototype.NullLiteral=function(){return this.getToken(h.NullLiteral,0)},at.prototype.enterRule=function(e){e instanceof a&&e.enterNullLiteral(this)},at.prototype.exitRule=function(e){e instanceof a&&e.exitNullLiteral(this)},at.prototype.accept=function(e){return e instanceof i?e.visitNullLiteral(this):e.visitChildren(this)},h.LiteralContext=Ze,h.prototype.literal=function(){var e=new Ze(this,this._ctx,this.state);this.enterRule(e,92,h.RULE_literal);try{switch(this.state=620,this._errHandler.sync(this),this._input.LA(1)){case h.NullLiteral:e=new at(this,e),this.enterOuterAlt(e,1),this.state=614,this.match(h.NullLiteral);break;case h.UndefinedLiteral:e=new et(this,e),this.enterOuterAlt(e,2),this.state=615,this.match(h.UndefinedLiteral);break;case h.BooleanLiteral:e=new rt(this,e),this.enterOuterAlt(e,3),this.state=616,this.match(h.BooleanLiteral);break;case h.StringLiteral:e=new tt(this,e),this.enterOuterAlt(e,4),this.state=617,this.match(h.StringLiteral);break;case h.RegularExpressionLiteral:e=new nt(this,e),this.enterOuterAlt(e,5),this.state=618,this.match(h.RegularExpressionLiteral);break;case h.IntegerLiteral:case h.DecimalLiteral:case h.HexIntegerLiteral:case h.OctalIntegerLiteral:e=new Qe(this,e),this.enterOuterAlt(e,6),this.state=619,this.numericLiteral();break;default:throw new r.error.NoViableAltException(this)}}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},it.prototype=Object.create(r.ParserRuleContext.prototype),it.prototype.constructor=it,it.prototype.copyFrom=function(e){r.ParserRuleContext.prototype.copyFrom.call(this,e)},ot.prototype=Object.create(it.prototype),ot.prototype.constructor=ot,h.HexIntegerLiteralContext=ot,ot.prototype.HexIntegerLiteral=function(){return this.getToken(h.HexIntegerLiteral,0)},ot.prototype.enterRule=function(e){e instanceof a&&e.enterHexIntegerLiteral(this)},ot.prototype.exitRule=function(e){e instanceof a&&e.exitHexIntegerLiteral(this)},ot.prototype.accept=function(e){return e instanceof i?e.visitHexIntegerLiteral(this):e.visitChildren(this)},st.prototype=Object.create(it.prototype),st.prototype.constructor=st,h.OctalIntegerLiteralContext=st,st.prototype.OctalIntegerLiteral=function(){return this.getToken(h.OctalIntegerLiteral,0)},st.prototype.enterRule=function(e){e instanceof a&&e.enterOctalIntegerLiteral(this)},st.prototype.exitRule=function(e){e instanceof a&&e.exitOctalIntegerLiteral(this)},st.prototype.accept=function(e){return e instanceof i?e.visitOctalIntegerLiteral(this):e.visitChildren(this)},lt.prototype=Object.create(it.prototype),lt.prototype.constructor=lt,h.DecimalLiteralContext=lt,lt.prototype.DecimalLiteral=function(){return this.getToken(h.DecimalLiteral,0)},lt.prototype.enterRule=function(e){e instanceof a&&e.enterDecimalLiteral(this)},lt.prototype.exitRule=function(e){e instanceof a&&e.exitDecimalLiteral(this)},lt.prototype.accept=function(e){return e instanceof i?e.visitDecimalLiteral(this):e.visitChildren(this)},pt.prototype=Object.create(it.prototype),pt.prototype.constructor=pt,h.IntegerLiteralContext=pt,pt.prototype.IntegerLiteral=function(){return this.getToken(h.IntegerLiteral,0)},pt.prototype.enterRule=function(e){e instanceof a&&e.enterIntegerLiteral(this)},pt.prototype.exitRule=function(e){e instanceof a&&e.exitIntegerLiteral(this)},pt.prototype.accept=function(e){return e instanceof i?e.visitIntegerLiteral(this):e.visitChildren(this)},h.NumericLiteralContext=it,h.prototype.numericLiteral=function(){var e=new it(this,this._ctx,this.state);this.enterRule(e,94,h.RULE_numericLiteral);try{switch(this.state=626,this._errHandler.sync(this),this._input.LA(1)){case h.IntegerLiteral:e=new pt(this,e),this.enterOuterAlt(e,1),this.state=622,this.match(h.IntegerLiteral);break;case h.DecimalLiteral:e=new lt(this,e),this.enterOuterAlt(e,2),this.state=623,this.match(h.DecimalLiteral);break;case h.HexIntegerLiteral:e=new ot(this,e),this.enterOuterAlt(e,3),this.state=624,this.match(h.HexIntegerLiteral);break;case h.OctalIntegerLiteral:e=new st(this,e),this.enterOuterAlt(e,4),this.state=625,this.match(h.OctalIntegerLiteral);break;default:throw new r.error.NoViableAltException(this)}}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},ut.prototype=Object.create(r.ParserRuleContext.prototype),ut.prototype.constructor=ut,ut.prototype.Identifier=function(){return this.getToken(h.Identifier,0)},ut.prototype.reservedWord=function(){return this.getTypedRuleContext(mt,0)},ut.prototype.enterRule=function(e){e instanceof a&&e.enterIdentifierName(this)},ut.prototype.exitRule=function(e){e instanceof a&&e.exitIdentifierName(this)},ut.prototype.accept=function(e){return e instanceof i?e.visitIdentifierName(this):e.visitChildren(this)},h.IdentifierNameContext=ut,h.prototype.identifierName=function(){var e=new ut(this,this._ctx,this.state);this.enterRule(e,96,h.RULE_identifierName);try{switch(this.state=630,this._errHandler.sync(this),this._input.LA(1)){case h.Identifier:this.enterOuterAlt(e,1),this.state=628,this.match(h.Identifier);break;case h.NullLiteral:case h.BooleanLiteral:case h.Break:case h.Do:case h.Instanceof:case h.Typeof:case h.Case:case h.Else:case h.New:case h.Var:case h.Catch:case h.Finally:case h.Return:case h.Void:case h.Continue:case h.For:case h.Switch:case h.While:case h.Debugger:case h.Function:case h.This:case h.With:case h.Default:case h.If:case h.Throw:case h.Delete:case h.In:case h.Try:case h.Class:case h.Enum:case h.Extends:case h.Super:case h.Const:case h.Export:case h.Import:case h.Implements:case h.Let:case h.Private:case h.Public:case h.Interface:case h.Package:case h.Protected:case h.Static:case h.Yield:this.enterOuterAlt(e,2),this.state=629,this.reservedWord();break;default:throw new r.error.NoViableAltException(this)}}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},mt.prototype=Object.create(r.ParserRuleContext.prototype),mt.prototype.constructor=mt,mt.prototype.keyword=function(){return this.getTypedRuleContext(ct,0)},mt.prototype.futureReservedWord=function(){return this.getTypedRuleContext(ht,0)},mt.prototype.NullLiteral=function(){return this.getToken(h.NullLiteral,0)},mt.prototype.BooleanLiteral=function(){return this.getToken(h.BooleanLiteral,0)},mt.prototype.enterRule=function(e){e instanceof a&&e.enterReservedWord(this)},mt.prototype.exitRule=function(e){e instanceof a&&e.exitReservedWord(this)},mt.prototype.accept=function(e){return e instanceof i?e.visitReservedWord(this):e.visitChildren(this)},h.ReservedWordContext=mt,h.prototype.reservedWord=function(){var e=new mt(this,this._ctx,this.state);this.enterRule(e,98,h.RULE_reservedWord);var t=0;try{switch(this.state=635,this._errHandler.sync(this),this._input.LA(1)){case h.Break:case h.Do:case h.Instanceof:case h.Typeof:case h.Case:case h.Else:case h.New:case h.Var:case h.Catch:case h.Finally:case h.Return:case h.Void:case h.Continue:case h.For:case h.Switch:case h.While:case h.Debugger:case h.Function:case h.This:case h.With:case h.Default:case h.If:case h.Throw:case h.Delete:case h.In:case h.Try:this.enterOuterAlt(e,1),this.state=632,this.keyword();break;case h.Class:case h.Enum:case h.Extends:case h.Super:case h.Const:case h.Export:case h.Import:case h.Implements:case h.Let:case h.Private:case h.Public:case h.Interface:case h.Package:case h.Protected:case h.Static:case h.Yield:this.enterOuterAlt(e,2),this.state=633,this.futureReservedWord();break;case h.NullLiteral:case h.BooleanLiteral:this.enterOuterAlt(e,3),this.state=634,(t=this._input.LA(1))!==h.NullLiteral&&t!==h.BooleanLiteral?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume());break;default:throw new r.error.NoViableAltException(this)}}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},ct.prototype=Object.create(r.ParserRuleContext.prototype),ct.prototype.constructor=ct,ct.prototype.Break=function(){return this.getToken(h.Break,0)},ct.prototype.Do=function(){return this.getToken(h.Do,0)},ct.prototype.Instanceof=function(){return this.getToken(h.Instanceof,0)},ct.prototype.Typeof=function(){return this.getToken(h.Typeof,0)},ct.prototype.Case=function(){return this.getToken(h.Case,0)},ct.prototype.Else=function(){return this.getToken(h.Else,0)},ct.prototype.New=function(){return this.getToken(h.New,0)},ct.prototype.Var=function(){return this.getToken(h.Var,0)},ct.prototype.Catch=function(){return this.getToken(h.Catch,0)},ct.prototype.Finally=function(){return this.getToken(h.Finally,0)},ct.prototype.Return=function(){return this.getToken(h.Return,0)},ct.prototype.Void=function(){return this.getToken(h.Void,0)},ct.prototype.Continue=function(){return this.getToken(h.Continue,0)},ct.prototype.For=function(){return this.getToken(h.For,0)},ct.prototype.Switch=function(){return this.getToken(h.Switch,0)},ct.prototype.While=function(){return this.getToken(h.While,0)},ct.prototype.Debugger=function(){return this.getToken(h.Debugger,0)},ct.prototype.Function=function(){return this.getToken(h.Function,0)},ct.prototype.This=function(){return this.getToken(h.This,0)},ct.prototype.With=function(){return this.getToken(h.With,0)},ct.prototype.Default=function(){return this.getToken(h.Default,0)},ct.prototype.If=function(){return this.getToken(h.If,0)},ct.prototype.Throw=function(){return this.getToken(h.Throw,0)},ct.prototype.Delete=function(){return this.getToken(h.Delete,0)},ct.prototype.In=function(){return this.getToken(h.In,0)},ct.prototype.Try=function(){return this.getToken(h.Try,0)},ct.prototype.enterRule=function(e){e instanceof a&&e.enterKeyword(this)},ct.prototype.exitRule=function(e){e instanceof a&&e.exitKeyword(this)},ct.prototype.accept=function(e){return e instanceof i?e.visitKeyword(this):e.visitChildren(this)},h.KeywordContext=ct,h.prototype.keyword=function(){var e=new ct(this,this._ctx,this.state);this.enterRule(e,100,h.RULE_keyword);var t=0;try{this.enterOuterAlt(e,1),this.state=637,(t=this._input.LA(1))-58&-32||!(1<<t-58&(1<<h.Break-58|1<<h.Do-58|1<<h.Instanceof-58|1<<h.Typeof-58|1<<h.Case-58|1<<h.Else-58|1<<h.New-58|1<<h.Var-58|1<<h.Catch-58|1<<h.Finally-58|1<<h.Return-58|1<<h.Void-58|1<<h.Continue-58|1<<h.For-58|1<<h.Switch-58|1<<h.While-58|1<<h.Debugger-58|1<<h.Function-58|1<<h.This-58|1<<h.With-58|1<<h.Default-58|1<<h.If-58|1<<h.Throw-58|1<<h.Delete-58|1<<h.In-58|1<<h.Try-58))?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},ht.prototype=Object.create(r.ParserRuleContext.prototype),ht.prototype.constructor=ht,ht.prototype.Class=function(){return this.getToken(h.Class,0)},ht.prototype.Enum=function(){return this.getToken(h.Enum,0)},ht.prototype.Extends=function(){return this.getToken(h.Extends,0)},ht.prototype.Super=function(){return this.getToken(h.Super,0)},ht.prototype.Const=function(){return this.getToken(h.Const,0)},ht.prototype.Export=function(){return this.getToken(h.Export,0)},ht.prototype.Import=function(){return this.getToken(h.Import,0)},ht.prototype.Implements=function(){return this.getToken(h.Implements,0)},ht.prototype.Let=function(){return this.getToken(h.Let,0)},ht.prototype.Private=function(){return this.getToken(h.Private,0)},ht.prototype.Public=function(){return this.getToken(h.Public,0)},ht.prototype.Interface=function(){return this.getToken(h.Interface,0)},ht.prototype.Package=function(){return this.getToken(h.Package,0)},ht.prototype.Protected=function(){return this.getToken(h.Protected,0)},ht.prototype.Static=function(){return this.getToken(h.Static,0)},ht.prototype.Yield=function(){return this.getToken(h.Yield,0)},ht.prototype.enterRule=function(e){e instanceof a&&e.enterFutureReservedWord(this)},ht.prototype.exitRule=function(e){e instanceof a&&e.exitFutureReservedWord(this)},ht.prototype.accept=function(e){return e instanceof i?e.visitFutureReservedWord(this):e.visitChildren(this)},h.FutureReservedWordContext=ht,h.prototype.futureReservedWord=function(){var e=new ht(this,this._ctx,this.state);this.enterRule(e,102,h.RULE_futureReservedWord);var t=0;try{this.enterOuterAlt(e,1),this.state=639,(t=this._input.LA(1))-84&-32||!(1<<t-84&(1<<h.Class-84|1<<h.Enum-84|1<<h.Extends-84|1<<h.Super-84|1<<h.Const-84|1<<h.Export-84|1<<h.Import-84|1<<h.Implements-84|1<<h.Let-84|1<<h.Private-84|1<<h.Public-84|1<<h.Interface-84|1<<h.Package-84|1<<h.Protected-84|1<<h.Static-84|1<<h.Yield-84))?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},gt.prototype=Object.create(r.ParserRuleContext.prototype),gt.prototype.constructor=gt,gt.prototype.Identifier=function(){return this.getToken(h.Identifier,0)},gt.prototype.propertyName=function(){return this.getTypedRuleContext(le,0)},gt.prototype.enterRule=function(e){e instanceof a&&e.enterGetter(this)},gt.prototype.exitRule=function(e){e instanceof a&&e.exitGetter(this)},gt.prototype.accept=function(e){return e instanceof i?e.visitGetter(this):e.visitChildren(this)},h.GetterContext=gt,h.prototype.getter=function(){var e=new gt(this,this._ctx,this.state);this.enterRule(e,104,h.RULE_getter);try{if(this.enterOuterAlt(e,1),this.state=641,!this._input.LT(1).text.startsWith("get"))throw new r.error.FailedPredicateException(this,'this._input.LT(1).text.startsWith("get")');this.state=642,this.match(h.Identifier),this.state=643,this.propertyName()}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},Tt.prototype=Object.create(r.ParserRuleContext.prototype),Tt.prototype.constructor=Tt,Tt.prototype.Identifier=function(){return this.getToken(h.Identifier,0)},Tt.prototype.propertyName=function(){return this.getTypedRuleContext(le,0)},Tt.prototype.enterRule=function(e){e instanceof a&&e.enterSetter(this)},Tt.prototype.exitRule=function(e){e instanceof a&&e.exitSetter(this)},Tt.prototype.accept=function(e){return e instanceof i?e.visitSetter(this):e.visitChildren(this)},h.SetterContext=Tt,h.prototype.setter=function(){var e=new Tt(this,this._ctx,this.state);this.enterRule(e,106,h.RULE_setter);try{if(this.enterOuterAlt(e,1),this.state=645,!this._input.LT(1).text.startsWith("set"))throw new r.error.FailedPredicateException(this,'this._input.LT(1).text.startsWith("set")');this.state=646,this.match(h.Identifier),this.state=647,this.propertyName()}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},yt.prototype=Object.create(r.ParserRuleContext.prototype),yt.prototype.constructor=yt,yt.prototype.SemiColon=function(){return this.getToken(h.SemiColon,0)},yt.prototype.EOF=function(){return this.getToken(h.EOF,0)},yt.prototype.enterRule=function(e){e instanceof a&&e.enterEos(this)},yt.prototype.exitRule=function(e){e instanceof a&&e.exitEos(this)},yt.prototype.accept=function(e){return e instanceof i?e.visitEos(this):e.visitChildren(this)},h.EosContext=yt,h.prototype.eos=function(){var e=new yt(this,this._ctx,this.state);this.enterRule(e,108,h.RULE_eos);try{switch(this.state=653,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,57,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=649,this.match(h.SemiColon);break;case 2:this.enterOuterAlt(e,2),this.state=650,this.match(h.EOF);break;case 3:if(this.enterOuterAlt(e,3),this.state=651,!this.lineTerminatorAhead())throw new r.error.FailedPredicateException(this,"this.lineTerminatorAhead()");break;case 4:if(this.enterOuterAlt(e,4),this.state=652,this._input.LT(1).type!=h.CloseBrace)throw new r.error.FailedPredicateException(this,"this._input.LT(1).type == ECMAScriptParser.CloseBrace")}}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},dt.prototype=Object.create(r.ParserRuleContext.prototype),dt.prototype.constructor=dt,dt.prototype.EOF=function(){return this.getToken(h.EOF,0)},dt.prototype.enterRule=function(e){e instanceof a&&e.enterEof(this)},dt.prototype.exitRule=function(e){e instanceof a&&e.exitEof(this)},dt.prototype.accept=function(e){return e instanceof i?e.visitEof(this):e.visitChildren(this)},h.EofContext=dt,h.prototype.eof=function(){var e=new dt(this,this._ctx,this.state);this.enterRule(e,110,h.RULE_eof);try{this.enterOuterAlt(e,1),this.state=655,this.match(h.EOF)}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e},h.prototype.sempred=function(e,t,n){switch(t){case 15:return this.continueStatement_sempred(e,n);case 16:return this.breakStatement_sempred(e,n);case 17:return this.returnStatement_sempred(e,n);case 25:return this.throwStatement_sempred(e,n);case 44:return this.singleExpression_sempred(e,n);case 52:return this.getter_sempred(e,n);case 53:return this.setter_sempred(e,n);case 54:return this.eos_sempred(e,n);default:throw"No predicate with index:"+t}},h.prototype.continueStatement_sempred=function(e,t){if(0===t)return!this.here(h.LineTerminator);throw"No predicate with index:"+t},h.prototype.breakStatement_sempred=function(e,t){if(1===t)return!this.here(h.LineTerminator);throw"No predicate with index:"+t},h.prototype.returnStatement_sempred=function(e,t){if(2===t)return!this.here(h.LineTerminator);throw"No predicate with index:"+t},h.prototype.throwStatement_sempred=function(e,t){if(3===t)return!this.here(h.LineTerminator);throw"No predicate with index:"+t},h.prototype.singleExpression_sempred=function(e,t){switch(t){case 4:return this.precpred(this._ctx,21);case 5:return this.precpred(this._ctx,20);case 6:return this.precpred(this._ctx,19);case 7:return this.precpred(this._ctx,18);case 8:return this.precpred(this._ctx,17);case 9:return this.precpred(this._ctx,16);case 10:return this.precpred(this._ctx,15);case 11:return this.precpred(this._ctx,14);case 12:return this.precpred(this._ctx,13);case 13:return this.precpred(this._ctx,12);case 14:return this.precpred(this._ctx,11);case 15:return this.precpred(this._ctx,10);case 16:return this.precpred(this._ctx,9);case 17:return this.precpred(this._ctx,36);case 18:return this.precpred(this._ctx,35);case 19:return this.precpred(this._ctx,34);case 20:return this.precpred(this._ctx,32);case 21:case 23:return!this.here(h.LineTerminator);case 22:return this.precpred(this._ctx,31);case 24:return this.precpred(this._ctx,8);case 25:return this.precpred(this._ctx,7);default:throw"No predicate with index:"+t}},h.prototype.getter_sempred=function(e,t){if(26===t)return this._input.LT(1).text.startsWith("get");throw"No predicate with index:"+t},h.prototype.setter_sempred=function(e,t){if(27===t)return this._input.LT(1).text.startsWith("set");throw"No predicate with index:"+t},h.prototype.eos_sempred=function(e,t){switch(t){case 28:return this.lineTerminatorAhead();case 29:return this._input.LT(1).type==h.CloseBrace;default:throw"No predicate with index:"+t}},t.ECMAScriptParser=h},1619:(e,t,n)=>{var r=n(5525);function a(){return r.tree.ParseTreeVisitor.call(this),this}a.prototype=Object.create(r.tree.ParseTreeVisitor.prototype),a.prototype.constructor=a,a.prototype.visitProgram=function(e){return this.visitChildren(e)},a.prototype.visitSourceElements=function(e){return this.visitChildren(e)},a.prototype.visitSourceElement=function(e){return this.visitChildren(e)},a.prototype.visitStatement=function(e){return this.visitChildren(e)},a.prototype.visitStatementOrBlock=function(e){return this.visitChildren(e)},a.prototype.visitBlock=function(e){return this.visitChildren(e)},a.prototype.visitStatementList=function(e){return this.visitChildren(e)},a.prototype.visitVariableStatement=function(e){return this.visitChildren(e)},a.prototype.visitVariableDeclarationList=function(e){return this.visitChildren(e)},a.prototype.visitVariableDeclaration=function(e){return this.visitChildren(e)},a.prototype.visitInitialiser=function(e){return this.visitChildren(e)},a.prototype.visitEmptyStatement=function(e){return this.visitChildren(e)},a.prototype.visitExpressionStatement=function(e){return this.visitChildren(e)},a.prototype.visitIfStatement=function(e){return this.visitChildren(e)},a.prototype.visitDoWhileStatement=function(e){return this.visitChildren(e)},a.prototype.visitWhileStatement=function(e){return this.visitChildren(e)},a.prototype.visitForStatement=function(e){return this.visitChildren(e)},a.prototype.visitForVarStatement=function(e){return this.visitChildren(e)},a.prototype.visitForInStatement=function(e){return this.visitChildren(e)},a.prototype.visitForVarInStatement=function(e){return this.visitChildren(e)},a.prototype.visitContinueStatement=function(e){return this.visitChildren(e)},a.prototype.visitBreakStatement=function(e){return this.visitChildren(e)},a.prototype.visitReturnStatement=function(e){return this.visitChildren(e)},a.prototype.visitWithStatement=function(e){return this.visitChildren(e)},a.prototype.visitSwitchStatement=function(e){return this.visitChildren(e)},a.prototype.visitCaseBlock=function(e){return this.visitChildren(e)},a.prototype.visitCaseClauses=function(e){return this.visitChildren(e)},a.prototype.visitCaseClause=function(e){return this.visitChildren(e)},a.prototype.visitDefaultClause=function(e){return this.visitChildren(e)},a.prototype.visitLabelledStatement=function(e){return this.visitChildren(e)},a.prototype.visitThrowStatement=function(e){return this.visitChildren(e)},a.prototype.visitTryStatement=function(e){return this.visitChildren(e)},a.prototype.visitCatchProduction=function(e){return this.visitChildren(e)},a.prototype.visitFinallyProduction=function(e){return this.visitChildren(e)},a.prototype.visitDebuggerStatement=function(e){return this.visitChildren(e)},a.prototype.visitFunctionDeclaration=function(e){return this.visitChildren(e)},a.prototype.visitFormalParameterList=function(e){return this.visitChildren(e)},a.prototype.visitFunctionBody=function(e){return this.visitChildren(e)},a.prototype.visitArrayLiteral=function(e){return this.visitChildren(e)},a.prototype.visitElementList=function(e){return this.visitChildren(e)},a.prototype.visitElision=function(e){return this.visitChildren(e)},a.prototype.visitObjectLiteral=function(e){return this.visitChildren(e)},a.prototype.visitPropertyNameAndValueList=function(e){return this.visitChildren(e)},a.prototype.visitPropertyAssignmentExpression=function(e){return this.visitChildren(e)},a.prototype.visitPropertyGetter=function(e){return this.visitChildren(e)},a.prototype.visitPropertySetter=function(e){return this.visitChildren(e)},a.prototype.visitPropertyName=function(e){return this.visitChildren(e)},a.prototype.visitPropertySetParameterList=function(e){return this.visitChildren(e)},a.prototype.visitArguments=function(e){return this.visitChildren(e)},a.prototype.visitArgumentList=function(e){return this.visitChildren(e)},a.prototype.visitExpressionSequence=function(e){return this.visitChildren(e)},a.prototype.visitTernaryExpression=function(e){return this.visitChildren(e)},a.prototype.visitLogicalAndExpression=function(e){return this.visitChildren(e)},a.prototype.visitFuncDefExpression=function(e){return this.visitChildren(e)},a.prototype.visitPreIncrementExpression=function(e){return this.visitChildren(e)},a.prototype.visitObjectLiteralExpression=function(e){return this.visitChildren(e)},a.prototype.visitInExpression=function(e){return this.visitChildren(e)},a.prototype.visitLogicalOrExpression=function(e){return this.visitChildren(e)},a.prototype.visitNotExpression=function(e){return this.visitChildren(e)},a.prototype.visitPreDecreaseExpression=function(e){return this.visitChildren(e)},a.prototype.visitThisExpression=function(e){return this.visitChildren(e)},a.prototype.visitUnaryMinusExpression=function(e){return this.visitChildren(e)},a.prototype.visitPostDecreaseExpression=function(e){return this.visitChildren(e)},a.prototype.visitAssignmentExpression=function(e){return this.visitChildren(e)},a.prototype.visitTypeofExpression=function(e){return this.visitChildren(e)},a.prototype.visitInstanceofExpression=function(e){return this.visitChildren(e)},a.prototype.visitUnaryPlusExpression=function(e){return this.visitChildren(e)},a.prototype.visitDeleteExpression=function(e){return this.visitChildren(e)},a.prototype.visitEqualityExpression=function(e){return this.visitChildren(e)},a.prototype.visitBitXOrExpression=function(e){return this.visitChildren(e)},a.prototype.visitMultiplicativeExpression=function(e){return this.visitChildren(e)},a.prototype.visitBitShiftExpression=function(e){return this.visitChildren(e)},a.prototype.visitParenthesizedExpression=function(e){return this.visitChildren(e)},a.prototype.visitGetAttributeExpression=function(e){return this.visitChildren(e)},a.prototype.visitAdditiveExpression=function(e){return this.visitChildren(e)},a.prototype.visitRelationalExpression=function(e){return this.visitChildren(e)},a.prototype.visitPostIncrementExpression=function(e){return this.visitChildren(e)},a.prototype.visitFuncCallExpression=function(e){return this.visitChildren(e)},a.prototype.visitBitNotExpression=function(e){return this.visitChildren(e)},a.prototype.visitNewExpression=function(e){return this.visitChildren(e)},a.prototype.visitLiteralExpression=function(e){return this.visitChildren(e)},a.prototype.visitArrayLiteralExpression=function(e){return this.visitChildren(e)},a.prototype.visitMemberIndexExpression=function(e){return this.visitChildren(e)},a.prototype.visitIdentifierExpression=function(e){return this.visitChildren(e)},a.prototype.visitBitAndExpression=function(e){return this.visitChildren(e)},a.prototype.visitBitOrExpression=function(e){return this.visitChildren(e)},a.prototype.visitAssignmentOperatorExpression=function(e){return this.visitChildren(e)},a.prototype.visitVoidExpression=function(e){return this.visitChildren(e)},a.prototype.visitAssignmentOperator=function(e){return this.visitChildren(e)},a.prototype.visitNullLiteral=function(e){return this.visitChildren(e)},a.prototype.visitUndefinedLiteral=function(e){return this.visitChildren(e)},a.prototype.visitBooleanLiteral=function(e){return this.visitChildren(e)},a.prototype.visitStringLiteral=function(e){return this.visitChildren(e)},a.prototype.visitRegularExpressionLiteral=function(e){return this.visitChildren(e)},a.prototype.visitNumericLiteralWrapper=function(e){return this.visitChildren(e)},a.prototype.visitIntegerLiteral=function(e){return this.visitChildren(e)},a.prototype.visitDecimalLiteral=function(e){return this.visitChildren(e)},a.prototype.visitHexIntegerLiteral=function(e){return this.visitChildren(e)},a.prototype.visitOctalIntegerLiteral=function(e){return this.visitChildren(e)},a.prototype.visitIdentifierName=function(e){return this.visitChildren(e)},a.prototype.visitReservedWord=function(e){return this.visitChildren(e)},a.prototype.visitKeyword=function(e){return this.visitChildren(e)},a.prototype.visitFutureReservedWord=function(e){return this.visitChildren(e)},a.prototype.visitGetter=function(e){return this.visitChildren(e)},a.prototype.visitSetter=function(e){return this.visitChildren(e)},a.prototype.visitEos=function(e){return this.visitChildren(e)},a.prototype.visitEof=function(e){return this.visitChildren(e)},t._=a},7178:e=>{e.exports='SymbolTypes:\n VAR: &var 0\n CONSTRUCTOR: &constructor 1\n FUNC: &func 2\n# Internal patterns to save typing\n__type: &__type\n id: null\n callable: *var\n args: null\n type: null\n attr: {}\n template: null\n argsTemplate: null\n__func: &__func\n callable: *func\n args: []\n attr: {}\n template: null\n argsTemplate: null\n\n# C# Templates\nTemplates:\n # Misc\n RegexFlags: &RegexFlags\n i: \'i\'\n m: \'m\'\n u: \'\'\n y: \'\'\n g: \'\'\n BSONRegexFlags: &BSONRegexFlags\n i: \'i\'\n m: \'m\'\n x: \'x\'\n s: \'s\'\n l: \'\'\n u: \'\'\n # Syntax\n DriverTemplate: &DriverTemplate null\n EqualitySyntaxTemplate: &EqualitySyntaxTemplate !!js/function >\n (lhs, op, rhs) => {\n if (op.includes(\'!\') || op.includes(\'not\')) {\n return `${lhs} != ${rhs}`;\n }\n else if (op === \'==\' || op === \'===\' || op === \'is\') {\n return `${lhs} == ${rhs}`;\n }\n return `${lhs} ${op} ${rhs}`;\n }\n InSyntaxTemplate: &InSyntaxTemplate !!js/function >\n (lhs, op, rhs) => {\n let str = \'!=\';\n if (op.includes(\'!\') || op.includes(\'not\')) {\n str = \'==\';\n }\n return `${rhs}.indexOf(${lhs}) ${str} -1`\n }\n AndSyntaxTemplate: &AndSyntaxTemplate !!js/function >\n (args) => {\n return args.join(\' && \');\n }\n OrSyntaxTemplate: &OrSyntaxTemplate !!js/function >\n (args) => {\n return args.join(\' || \');\n }\n NotSyntaxTemplate: &NotSyntaxTemplate !!js/function >\n (arg) => {\n return `!${arg}`;\n }\n UnarySyntaxTemplate: &UnarySyntaxTemplate null\n BinarySyntaxTemplate: &BinarySyntaxTemplate !!js/function >\n (args) => {\n return args.reduce((s, op, i, arr) => {\n if (i % 2 === 0) {\n return s;\n }\n const rhs = arr[i + 1];\n switch(op) {\n case \'//\':\n return `Math.floor(${s}, ${rhs})`;\n case \'**\':\n return `Math.pow(${s}, ${rhs})`;\n default:\n return `${s} ${op} ${rhs}`;\n }\n }, args[0]);\n }\n ParensSyntaxTemplate: &ParensSyntaxTemplate null\n EosSyntaxTemplate: &EosSyntaxTemplate null\n EofSyntaxTemplate: &EofSyntaxTemplate null\n NewTemplate: &NewSyntaxTemplate !!js/function >\n (expr, skip, code) => {\n // Add classes that don\'t use "new" to array\n // So far: [Symbol, Decimal128/NumberDecimal, Long/NumberLong, MinKey, MaxKey, Date.now, Double, Int32, Number, Date]\n noNew = [111, 112, 106, 107, 108, 200.1, 104, 105, 2, 200];\n if (skip || (code && noNew.indexOf(code) !== -1)) {\n return expr;\n }\n return `new ${expr}`;\n }\n # BSON Object Type templates\n CodeTypeTemplate: &CodeTypeTemplate null\n StringTypeTemplate: &StringTypeTemplate !!js/function >\n (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === \'\\\'\' && str.charAt(str.length - 1) === \'\\\'\') ||\n (str.charAt(0) === \'"\' && str.charAt(str.length - 1) === \'"\')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `"${newStr.replace(/\\\\([\\s\\S])|(")/g, \'\\\\$1$2\')}"`;\n }\n RegexTypeTemplate: &RegexTypeTemplate !!js/function >\n (pattern, flags) => {\n flags = flags === \'\' ? \'\' : `(?${flags})`;\n // Double-quote stringify\n const str = flags + pattern;\n let newStr = str;\n if (\n (str.charAt(0) === \'\\\'\' && str.charAt(str.length - 1) === \'\\\'\') ||\n (str.charAt(0) === \'"\' && str.charAt(str.length - 1) === \'"\')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `Regex("${newStr.replace(/\\\\([\\s\\S])|(")/g, \'\\\\$1$2\')}")`;\n }\n BoolTypeTemplate: &BoolTypeTemplate !!js/function >\n (literal) => {\n return literal.toLowerCase();\n }\n IntegerTypeTemplate: &IntegerTypeTemplate null\n DecimalTypeTemplate: &DecimalTypeTemplate null\n LongBasicTypeTemplate: &LongBasicTypeTemplate null\n HexTypeTemplate: &HexTypeTemplate null\n OctalTypeTemplate: &OctalTypeTemplate !!js/function >\n (literal) => {\n literal = literal.replace(/[oO]+/g, \'0\')\n return parseInt(literal, 8).toString()\n }\n NumericTypeTemplate: &NumericTypeTemplate null\n ArrayTypeTemplate: &ArrayTypeTemplate !!js/function >\n (literal, depth) => {\n depth++;\n const indent = \'\\n\' + \' \'.repeat(depth);\n const initialIndent = \'\\n\' + \' \'.repeat(depth-1);\n if (literal === \'\') {\n return \'new BsonArray()\'\n }\n\n return `new BsonArray${initialIndent}{${literal}${initialIndent}}`;\n }\n ArrayTypeArgsTemplate: &ArrayTypeArgsTemplate !!js/function >\n (arg, depth, last) => {\n depth++;\n const indent = \'\\n\' + \' \'.repeat(depth);\n const arr = arg.split(\', new\').join(`, ${indent}new`)\n\n return last ? `${indent}${arr}` : `${indent}${arr},`;\n }\n NullTypeTemplate: &NullTypeTemplate !!js/function >\n () => {\n return \'BsonNull.Value\';\n }\n UndefinedTypeTemplate: &UndefinedTypeTemplate !!js/function >\n () => {\n return \'BsonUndefined.Value\';\n }\n ObjectTypeTemplate: &ObjectTypeTemplate !!js/function >\n (literal) => {\n if (literal === \'\') {\n return `new BsonDocument()`;\n }\n return literal;\n }\n ObjectTypeArgsTemplate: &ObjectTypeArgsTemplate !!js/function >\n (args, depth) => {\n if (args.length === 0) {\n return \'new BsonDocument()\';\n }\n depth++;\n const indent = \'\\n\' + \' \'.repeat(depth);\n const initialIndent = \'\\n\' + \' \'.repeat(depth-1);\n const doubleStringify = (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === \'\\\'\' && str.charAt(str.length - 1) === \'\\\'\') ||\n (str.charAt(0) === \'"\' && str.charAt(str.length - 1) === \'"\')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `"${newStr.replace(/\\\\([\\s\\S])|(")/g, \'\\\\$1$2\')}"`;\n }\n\n if (args.length === 1) {\n return `new BsonDocument(${doubleStringify(args[0][0])}, ${args[0][1]})`;\n }\n\n const pairs = args.map((pair) => {\n return `${indent}{ ${doubleStringify(pair[0])}, ${pair[1]} }`;\n }).join(\', \');\n\n return `new BsonDocument${initialIndent}{${pairs}${initialIndent}}`\n }\n # BSON Object Method templates\n CodeCodeTemplate: &CodeCodeTemplate !!js/function >\n (lhs) => {\n return `${lhs}.Code`;\n }\n CodeCodeArgsTemplate: &CodeCodeArgsTemplate null\n CodeScopeTemplate: &CodeScopeTemplate !!js/function >\n (lhs) => {\n return `${lhs}.Scope`;\n }\n CodeScopeArgsTemplate: &CodeScopeArgsTemplate null\n # Since in python, generated from attr access instead of func call, add () in template.\n ObjectIdToStringTemplate: &ObjectIdToStringTemplate !!js/function >\n (lhs) => {\n return `${lhs}.ToString()`;\n }\n ObjectIdToStringArgsTemplate: &ObjectIdToStringArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n ObjectIdEqualsTemplate: &ObjectIdEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs}.Equals`;\n }\n ObjectIdEqualsArgsTemplate: &ObjectIdEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n if (arg.indexOf(\'new\') === 0) {\n arg = arg.replace(/new /g, \'\')\n }\n return `(new ${arg})`;\n }\n\n ObjectIdGetTimestampTemplate: &ObjectIdGetTimestampTemplate !!js/function >\n (lhs) => {\n return `${lhs}.Timestamp`;\n }\n ObjectIdGetTimestampArgsTemplate: &ObjectIdGetTimestampArgsTemplate !!js/function >\n (lhs) => {\n return \'\';\n }\n BinaryValueTemplate: &BinaryValueTemplate !!js/function >\n (lhs) => {\n return `${lhs}.ToString`;\n }\n BinaryValueArgsTemplate: &BinaryValueArgsTemplate null\n BinaryLengthTemplate: &BinaryLengthTemplate !!js/function >\n () => {\n return \'\';\n }\n BinaryLengthArgsTemplate: &BinaryLengthArgsTemplate !!js/function >\n (lhs) => {\n return `${lhs}.Bytes.Length`;\n }\n BinaryToStringTemplate: &BinaryToStringTemplate !!js/function >\n (lhs) => {\n return `${lhs}.ToString`;\n }\n BinaryToStringArgsTemplate: &BinaryToStringArgsTemplate null\n BinarySubtypeTemplate: &BinarySubtypeTemplate !!js/function >\n (lhs) => {\n return `${lhs}.SubType`;\n }\n BinarySubtypeArgsTemplate: &BinarySubtypeArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n DBRefGetDBTemplate: &DBRefGetDBTemplate !!js/function >\n (lhs) => {\n return `${lhs}.DatabaseName`;\n }\n DBRefGetDBArgsTemplate: &DBRefGetDBArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n DBRefGetCollectionTemplate: &DBRefGetCollectionTemplate !!js/function >\n (lhs) => {\n return `${lhs}.CollectionName`;\n }\n DBRefGetCollectionArgsTemplate: &DBRefGetCollectionArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n DBRefGetIdTemplate: &DBRefGetIdTemplate !!js/function >\n (lhs) => {\n return `${lhs}.Id`;\n }\n DBRefGetIdArgsTemplate: &DBRefGetIdArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n LongEqualsTemplate: &LongEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} == `;\n }\n LongEqualsArgsTemplate: &LongEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n LongToIntTemplate: &LongToIntTemplate !!js/function >\n (lhs) => {\n return `(int) ${lhs}`;\n }\n LongToIntArgsTemplate: &LongToIntArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n LongToStringTemplate: &LongToStringTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n LongToStringArgsTemplate: &LongToStringArgsTemplate null\n LongToNumberTemplate: &LongToNumberTemplate !!js/function >\n (lhs) => {\n return `(double) ${lhs}`;\n }\n LongToNumberArgsTemplate: &LongToNumberArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n LongAddTemplate: &LongAddTemplate !!js/function >\n (lhs) => {\n return `${lhs} +`;\n }\n LongAddArgsTemplate: &LongAddArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongSubtractTemplate: &LongSubtractTemplate !!js/function >\n (lhs) => {\n return `${lhs} -`;\n }\n LongSubtractArgsTemplate: &LongSubtractArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongMultiplyTemplate: &LongMultiplyTemplate !!js/function >\n (lhs) => {\n return `${lhs} *`;\n }\n LongMultiplyArgsTemplate: &LongMultiplyArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongDivTemplate: &LongDivTemplate !!js/function >\n (lhs) => {\n return `${lhs} /`;\n }\n LongDivArgsTemplate: &LongDivArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongModuloTemplate: &LongModuloTemplate !!js/function >\n (lhs) => {\n return `${lhs} %`;\n }\n LongModuloArgsTemplate: &LongModuloArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongAndTemplate: &LongAndTemplate !!js/function >\n (lhs) => {\n return `${lhs} &`;\n }\n LongAndArgsTemplate: &LongAndArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongOrTemplate: &LongOrTemplate !!js/function >\n (lhs) => {\n return `${lhs} |`;\n }\n LongOrArgsTemplate: &LongOrArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongXorTemplate: &LongXorTemplate !!js/function >\n (lhs) => {\n return `${lhs} ^`;\n }\n LongXorArgsTemplate: &LongXorArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongShiftLeftTemplate: &LongShiftLeftTemplate !!js/function >\n (lhs) => {\n return `${lhs} <<`;\n }\n LongShiftLeftArgsTemplate: &LongShiftLeftArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongShiftRightTemplate: &LongShiftRightTemplate !!js/function >\n (lhs) => {\n return `${lhs} >>`;\n }\n LongShiftRightArgsTemplate: &LongShiftRightArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongCompareTemplate: &LongCompareTemplate !!js/function >\n (lhs) => {\n return `${lhs} - `;\n }\n LongCompareArgsTemplate: &LongCompareArgsTemplate !!js/function >\n (lhs, arg) => {\n return arg;\n }\n LongIsOddTemplate: &LongIsOddTemplate !!js/function >\n (lhs) => {\n return `${lhs}`;\n }\n LongIsOddArgsTemplate: &LongIsOddArgsTemplate !!js/function >\n () => {\n return \' % 2 == 1\';\n }\n LongIsZeroTemplate: &LongIsZeroTemplate !!js/function >\n (lhs) => {\n return `${lhs} == 0`;\n }\n LongIsZeroArgsTemplate: &LongIsZeroArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n LongIsNegativeTemplate: &LongIsNegativeTemplate !!js/function >\n (lhs) => {\n return `${lhs} < 0`;\n }\n LongIsNegativeArgsTemplate: &LongIsNegativeArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n LongNegateTemplate: &LongNegateTemplate !!js/function >\n () => {\n return \'-\';\n }\n LongNegateArgsTemplate: &LongNegateArgsTemplate !!js/function >\n (lhs) => {\n return `${lhs}`;\n }\n LongNotTemplate: &LongNotTemplate !!js/function >\n () => {\n return \'~\';\n }\n LongNotArgsTemplate: &LongNotArgsTemplate !!js/function >\n (lhs) => {\n return `${lhs}`;\n }\n LongNotEqualsTemplate: &LongNotEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} !=`;\n }\n LongNotEqualsArgsTemplate: &LongNotEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanTemplate: &LongGreaterThanTemplate !!js/function >\n (lhs) => {\n return `${lhs} >`;\n }\n LongGreaterThanArgsTemplate: &LongGreaterThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanOrEqualTemplate: &LongGreaterThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs} >=`;\n }\n LongGreaterThanOrEqualArgsTemplate: &LongGreaterThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanTemplate: &LongLessThanTemplate !!js/function >\n (lhs) => {\n return `${lhs} <`;\n }\n LongLessThanArgsTemplate: &LongLessThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanOrEqualTemplate: &LongLessThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs} <=`;\n }\n LongLessThanOrEqualArgsTemplate: &LongLessThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongFloatApproxTemplate: &LongFloatApproxTemplate !!js/function >\n (lhs) => {\n return `(float) ${lhs}`;\n }\n LongTopTemplate: &LongTopTemplate !!js/function >\n (lhs) => {\n return `${lhs} >> 32`;\n }\n LongBottomTemplate: &LongBottomTemplate !!js/function >\n (lhs) => {\n return `${lhs} & 0x0000ffff`;\n }\n TimestampToStringTemplate: &TimestampToStringTemplate !!js/function >\n (lhs) => {\n return `${lhs}.ToString`;\n }\n TimestampToStringArgsTemplate: &TimestampToStringArgsTemplate null\n TimestampEqualsTemplate: &TimestampEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs}.Equals`;\n }\n TimestampEqualsArgsTemplate: &TimestampEqualsArgsTemplate null\n TimestampGetLowBitsTemplate: &TimestampGetLowBitsTemplate !!js/function >\n (lhs) => {\n return `${lhs}.ToUniversalTime`;\n }\n TimestampGetLowBitsArgsTemplate: &TimestampGetLowBitsArgsTemplate null\n TimestampGetHighBitsTemplate: &TimestampGetHighBitsTemplate !!js/function >\n (lhs) => {\n return `${lhs}.Increment`;\n }\n TimestampGetHighBitsArgsTemplate: &TimestampGetHighBitsArgsTemplate !!js/function >\n (lhs) => {\n return \'\';\n }\n TimestampTTemplate: &TimestampTTemplate !!js/function >\n (lhs) => {\n return `${lhs}.ToUniversalTime()`;\n }\n TimestampITemplate: &TimestampITemplate !!js/function >\n (lhs) => {\n return `${lhs}.Increment`;\n }\n TimestampAsDateTemplate: &TimestampAsDateTemplate !!js/function >\n (lhs) => {\n return `new DateTime(1970, 1, 1).AddSeconds(${lhs}.Timestamp)`;\n }\n TimestampAsDateArgsTemplate: &TimestampAsDateArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n TimestampCompareTemplate: &TimestampCompareTemplate !!js/function >\n (lhs) => {\n return `${lhs}.CompareTo`;\n }\n TimestampCompareArgsTemplate: &TimestampCompareArgsTemplate null\n TimestampNotEqualsTemplate: &TimestampNotEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} != `;\n }\n TimestampNotEqualsArgsTemplate: &TimestampNotEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampGreaterThanTemplate: &TimestampGreaterThanTemplate !!js/function >\n (lhs) => {\n return `${lhs} > `;\n }\n TimestampGreaterThanArgsTemplate: &TimestampGreaterThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampGreaterThanOrEqualTemplate: &TimestampGreaterThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs} >= `;\n }\n TimestampGreaterThanOrEqualArgsTemplate: &TimestampGreaterThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampLessThanTemplate: &TimestampLessThanTemplate !!js/function >\n (lhs) => {\n return `${lhs} < `;\n }\n TimestampLessThanArgsTemplate: &TimestampLessThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampLessThanOrEqualTemplate: &TimestampLessThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs} <= `;\n }\n TimestampLessThanOrEqualArgsTemplate: &TimestampLessThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n SymbolValueOfTemplate: &SymbolValueOfTemplate !!js/function >\n (lhs) => {\n return `${lhs}`;\n }\n SymbolValueOfArgsTemplate: &SymbolValueOfArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n SymbolInspectTemplate: &SymbolInspectTemplate !!js/function >\n (lhs) => {\n return `${lhs}`;\n }\n SymbolInspectArgsTemplate: &SymbolInspectArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n SymbolToStringTemplate: &SymbolToStringTemplate !!js/function >\n (lhs) => {\n return `${lhs}`;\n }\n SymbolToStringArgsTemplate: &SymbolToStringArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n # Symbol Templates\n CodeSymbolTemplate: &CodeSymbolTemplate !!js/function > # Also has process method\n () => {\n return \'BsonJavaScript\';\n }\n CodeSymbolArgsTemplate: &CodeSymbolArgsTemplate !!js/function >\n (lhs, code, scope) => {\n // Double quote stringify\n let newStr = code === undefined ? \'\' : code;\n const str = newStr;\n if (\n (str.charAt(0) === \'\\\'\' && str.charAt(str.length - 1) === \'\\\'\') ||\n (str.charAt(0) === \'"\' && str.charAt(str.length - 1) === \'"\')) {\n newStr = str.substr(1, str.length - 2);\n }\n code = `"${newStr.replace(/\\\\([\\s\\S])|(")/g, \'\\\\$1$2\')}"`;\n return (scope === undefined) ? `(${code})` : `WithScope(${code}, ${scope})`;\n }\n ObjectIdSymbolTemplate: &ObjectIdSymbolTemplate !!js/function >\n () => {\n return \'ObjectId\';\n }\n ObjectIdSymbolArgsTemplate: &ObjectIdSymbolArgsTemplate !!js/function >\n (lhs, str) => {\n if (!str || str.length === 0) {\n return \'()\';\n }\n let newStr = str;\n if (\n (str.charAt(0) === \'\\\'\' && str.charAt(str.length - 1) === \'\\\'\') ||\n (str.charAt(0) === \'"\' && str.charAt(str.length - 1) === \'"\')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `("${newStr.replace(/\\\\([\\s\\S])|(")/g, \'\\\\$1$2\')}")`;\n }\n BinarySymbolTemplate: &BinarySymbolTemplate !!js/function >\n () => {\n return \'BsonBinaryData\';\n }\n BinarySymbolArgsTemplate: &BinarySymbolArgsTemplate !!js/function >\n (lhs, bytes, type) => {\n const str = bytes;\n let newStr = str;\n if (\n (str.charAt(0) === \'\\\'\' && str.charAt(str.length - 1) === \'\\\'\') ||\n (str.charAt(0) === \'"\' && str.charAt(str.length - 1) === \'"\')) {\n newStr = str.substr(1, str.length - 2);\n }\n bytes = `"${newStr.replace(/\\\\([\\s\\S])|(")/g, \'\\\\$1$2\')}"`;\n\n if (type === null) {\n return `(System.Text.Encoding.ASCII.GetBytes(${bytes}))`;\n }\n return `(System.Text.Encoding.ASCII.GetBytes(${bytes}), ${type})`;\n }\n BinarySymbolSubtypeDefaultTemplate: &BinarySymbolSubtypeDefaultTemplate !!js/function >\n () => {\n return \'BsonBinarySubType.Binary\';\n }\n BinarySymbolSubtypeFunctionTemplate: &BinarySymbolSubtypeFunctionTemplate !!js/function >\n () => {\n return \'BsonBinarySubType.Function\';\n }\n BinarySymbolSubtypeByteArrayTemplate: &BinarySymbolSubtypeByteArrayTemplate !!js/function >\n () => {\n return \'BsonBinarySubType.OldBinary\';\n }\n BinarySymbolSubtypeUuidOldTemplate: &BinarySymbolSubtypeUuidOldTemplate !!js/function >\n () => {\n return \'BsonBinarySubType.UuidLegacy\';\n }\n BinarySymbolSubtypeUuidTemplate: &BinarySymbolSubtypeUuidTemplate !!js/function >\n () => {\n return \'BsonBinarySubType.UuidStandard\';\n }\n BinarySymbolSubtypeMd5Template: &BinarySymbolSubtypeMd5Template !!js/function >\n () => {\n return \'BsonBinarySubType.MD5\';\n }\n BinarySymbolSubtypeUserDefinedTemplate: &BinarySymbolSubtypeUserDefinedTemplate !!js/function >\n () => {\n return \'BsonBinarySubType.UserDefined\';\n }\n DBRefSymbolTemplate: &DBRefSymbolTemplate !!js/function >\n () => {\n return \'MongoDBRef\';\n }\n DBRefSymbolArgsTemplate: &DBRefSymbolArgsTemplate null\n DoubleSymbolTemplate: &DoubleSymbolTemplate !!js/function >\n () => {\n return \'\';\n }\n DoubleSymbolArgsTemplate: &DoubleSymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n\n if (type === \'_hex\') {\n return `Convert.ToDouble(${arg})`;\n }\n if (type === \'_string\') {\n return `Convert.ToDouble(${arg})`;\n }\n\n if (type === \'_decimal\') {\n return arg;\n }\n\n return `${Math.round(arg).toFixed(1)}`;\n }\n Int32SymbolTemplate: &Int32SymbolTemplate !!js/function >\n () => {\n return \'\';\n }\n Int32SymbolArgsTemplate: &Int32SymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n\n if (type === \'_hex\' || type === \'_decimal\' || type === \'_string\') {\n return `Convert.ToInt32(${arg})`;\n }\n\n return arg;\n }\n LongSymbolTemplate: &LongSymbolTemplate !!js/function >\n () => {\n return \'\';\n }\n LongSymbolArgsTemplate: &LongSymbolArgsTemplate !!js/function >\n (lhs, arg) => {\n if (!arg || arg.length === 0) {\n arg = \'0\';\n }\n if (arg.indexOf(\'\\\'\') === 0 || arg.indexOf(\'"\') === 0) {\n return `Convert.ToInt64(${arg})`;\n }\n return `${arg}L`;\n }\n LongSymbolMaxTemplate: &LongSymbolMaxTemplate !!js/function >\n () => {\n return \'Int64.MaxValue\';\n }\n LongSymbolMaxArgsTemplate: &LongSymbolMaxArgsTemplate null\n LongSymbolMinTemplate: &LongSymbolMinTemplate !!js/function >\n () => {\n return \'Int64.MinValue\';\n }\n LongSymbolMinArgsTemplate: &LongSymbolMinArgsTemplate null\n LongSymbolZeroTemplate: &LongSymbolZeroTemplate !!js/function >\n (lhs) => {\n return \'0L\';\n }\n LongSymbolZeroArgsTemplate: &LongSymbolZeroArgsTemplate null\n LongSymbolOneTemplate: &LongSymbolOneTemplate !!js/function >\n (lhs) => {\n return \'1L\';\n }\n LongSymbolOneArgsTemplate: &LongSymbolOneArgsTemplate null\n LongSymbolNegOneTemplate: &LongSymbolNegOneTemplate !!js/function >\n (lhs) => {\n return \'-1L\';\n }\n LongSymbolNegOneArgsTemplate: &LongSymbolNegOneArgsTemplate null\n LongSymbolFromBitsTemplate: &LongSymbolFromBitsTemplate !!js/function > # Also has process method\n () => {\n return \'\';\n }\n LongSymbolFromBitsArgsTemplate: &LongSymbolFromBitsArgsTemplate null\n LongSymbolFromIntTemplate: &LongSymbolFromIntTemplate !!js/function >\n () => {\n return \'\';\n }\n LongSymbolFromIntArgsTemplate: &LongSymbolFromIntArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}L`;\n }\n LongSymbolFromNumberTemplate: &LongSymbolFromNumberTemplate null\n LongSymbolFromNumberArgsTemplate: &LongSymbolFromNumberArgsTemplate null\n LongSymbolFromStringTemplate: &LongSymbolFromStringTemplate !!js/function >\n () => {\n return \'Convert.ToInt64\';\n }\n LongSymbolFromStringArgsTemplate: &LongSymbolFromStringArgsTemplate !!js/function >\n (lhs, arg1, arg2) => {\n if (arg2) {\n return `(${arg1}, ${arg2})`\n }\n return `(${arg1}, 10)`\n }\n MinKeySymbolTemplate: &MinKeySymbolTemplate !!js/function >\n () => {\n return \'BsonMinKey\';\n }\n MinKeySymbolArgsTemplate: &MinKeySymbolArgsTemplate !!js/function >\n () => {\n return \'.Value\';\n }\n MaxKeySymbolTemplate: &MaxKeySymbolTemplate !!js/function >\n () => {\n return \'BsonMaxKey\';\n }\n MaxKeySymbolArgsTemplate: &MaxKeySymbolArgsTemplate !!js/function >\n () => {\n return \'.Value\';\n }\n TimestampSymbolTemplate: &TimestampSymbolTemplate !!js/function >\n () => {\n return \'BsonTimestamp\';\n }\n TimestampSymbolArgsTemplate: &TimestampSymbolArgsTemplate !!js/function >\n (lhs, arg1, arg2) => {\n if (typeof arg1 === \'undefined\') {\n return \'(0, 0)\'\n }\n return `(${arg1}, ${arg2})`;\n }\n SymbolSymbolTemplate: &SymbolSymbolTemplate !!js/function >\n () => {\n return \'\';\n }\n SymbolSymbolArgsTemplate: &SymbolSymbolArgsTemplate !!js/function >\n (_, arg) => {\n return arg; // no parens because generates as a string\n }\n BSONRegExpSymbolTemplate: &BSONRegExpSymbolTemplate !!js/function >\n () => {\n return \'BsonRegularExpression\';\n }\n BSONRegExpSymbolArgsTemplate: &BSONRegExpSymbolArgsTemplate !!js/function >\n (lhs, pattern, flags) => {\n const doubleStringify = (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === \'\\\'\' && str.charAt(str.length - 1) === \'\\\'\') ||\n (str.charAt(0) === \'"\' && str.charAt(str.length - 1) === \'"\')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `"${newStr.replace(/\\\\([\\s\\S])|(")/g, \'\\\\$1$2\')}"`;\n }\n return `(${doubleStringify(pattern)}${flags ? \', \' + doubleStringify(flags) : \'\'})`;\n }\n Decimal128SymbolTemplate: &Decimal128SymbolTemplate !!js/function >\n () => {\n return \'Decimal128\';\n }\n Decimal128SymbolArgsTemplate: &Decimal128SymbolArgsTemplate !!js/function >\n (_, str) => { // just stringify\n let newStr = str;\n if (\n (str.charAt(0) === \'\\\'\' && str.charAt(str.length - 1) === \'\\\'\') ||\n (str.charAt(0) === \'"\' && str.charAt(str.length - 1) === \'"\')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `.Parse("${newStr.replace(/\\\\([\\s\\S])|(")/g, \'\\\\$1$2\')}")`;\n }\n Decimal128SymbolFromStringTemplate: &Decimal128SymbolFromStringTemplate !!js/function >\n (lhs) => {\n return `${lhs}.Parse`;\n }\n Decimal128SymbolFromStringArgsTemplate: &Decimal128SymbolFromStringArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(${arg})`;\n }\n Decimal128ToStringTemplate: &Decimal128ToStringTemplate !!js/function >\n (lhs) => {\n return `${lhs}.ToString`;\n }\n Decimal128ToStringArgsTemplate: &Decimal128ToStringArgsTemplate null\n # BSON Util Templates\n ObjectIdCreateFromHexStringTemplate: &ObjectIdCreateFromHexStringTemplate !!js/function >\n (lhs) => {\n return `new ${lhs}`;\n }\n ObjectIdCreateFromHexStringArgsTemplate: &ObjectIdCreateFromHexStringArgsTemplate null\n ObjectIdCreateFromTimeTemplate: &ObjectIdCreateFromTimeTemplate !!js/function >\n () => {\n return `new ObjectId.GenerateNewId`;\n }\n ObjectIdCreateFromTimeArgsTemplate: &ObjectIdCreateFromTimeArgsTemplate !!js/function >\n (lhs, arg, isNumber) => {\n if (isNumber) {\n return `(Convert.ToInt32(${arg}))`;\n }\n return `(${arg})`;\n }\n ObjectIdIsValidTemplate: &ObjectIdIsValidTemplate !!js/function >\n (lhs) => {\n return `new ${lhs}`;\n }\n ObjectIdIsValidArgsTemplate: &ObjectIdIsValidArgsTemplate null\n # JS Symbol Templates\n NumberSymbolTemplate: &NumberSymbolTemplate !!js/function >\n () => {\n return \'\';\n }\n NumberSymbolArgsTemplate: &NumberSymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n\n if (type === \'_string\') {\n if (arg.indexOf(\'.\') !== -1) {\n return `float.Parse(${arg})`\n }\n return `int.Parse(${arg})`;\n }\n\n if (arg.indexOf(\'.\') !== -1) {\n return `(float) ${arg}`\n }\n return `(int) ${arg}`;\n }\n DateSymbolTemplate: &DateSymbolTemplate !!js/function >\n () => {\n return \'DateTime\';\n }\n DateSymbolArgsTemplate: &DateSymbolArgsTemplate !!js/function >\n (lhs, date, isString) => {\n let toStr = isString? \'.ToString("ddd MMM dd yyyy HH\\\':\\\'mm\\\':\\\'ss UTC")\' : \'\';\n\n if (date === null) {\n return `${lhs}.Now${toStr}`;\n }\n\n const dateStr = [\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds()\n ].join(\', \');\n\n return `new ${lhs}(${dateStr})${toStr}`;\n }\n DateSymbolNowTemplate: &DateSymbolNowTemplate !!js/function >\n () => {\n return \'DateTime.Now\';\n }\n DateSymbolNowArgsTemplate: &DateSymbolNowArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n RegExpSymbolTemplate: &RegExpSymbolTemplate !!js/function > # Also has process method\n () => {\n return \'Regex\';\n }\n RegExpSymbolArgsTemplate: &RegExpSymbolArgsTemplate null\n ImportTemplate: &ImportTemplate !!js/function >\n (args) => {\n const universal = [\'using MongoDB.Bson;\', \'using MongoDB.Driver;\'];\n const all = universal.concat(Object.values(args));\n return all.join(\'\\n\');\n }\n DriverImportTemplate: &DriverImportTemplate null\n 0ImportTemplate: &0ImportTemplate null\n 1ImportTemplate: &1ImportTemplate null\n 2ImportTemplate: &2ImportTemplate null\n 3ImportTemplate: &3ImportTemplate null\n 4ImportTemplate: &4ImportTemplate null\n 5ImportTemplate: &5ImportTemplate null\n 6ImportTemplate: &6ImportTemplate null\n 7ImportTemplate: &7ImportTemplate null\n 8ImportTemplate: &8ImportTemplate !!js/function >\n () => {\n return \'using System.Text.RegularExpressions;\';\n }\n 9ImportTemplate: &9ImportTemplate null\n 10ImportTemplate: &10ImportTemplate null\n 11ImportTemplate: &11ImportTemplate null\n 12ImportTemplate: &12ImportTemplate null\n 100ImportTemplate: &100ImportTemplate null\n 101ImportTemplate: &101ImportTemplate null\n 102ImportTemplate: &102ImportTemplate null\n 103ImportTemplate: &103ImportTemplate null\n 104ImportTemplate: &104ImportTemplate null\n 105ImportTemplate: &105ImportTemplate null\n 106ImportTemplate: &106ImportTemplate null\n 107ImportTemplate: &107ImportTemplate null\n 108ImportTemplate: &108ImportTemplate null\n 109ImportTemplate: &109ImportTemplate null\n 110ImportTemplate: &110ImportTemplate null\n 111ImportTemplate: &111ImportTemplate null\n 112ImportTemplate: &112ImportTemplate null\n 113ImportTemplate: &113ImportTemplate null\n 114ImportTemplate: &114ImportTemplate null\n 200ImportTemplate: &200ImportTemplate !!js/function >\n () => {\n return \'using System;\';\n }\n 201ImportTemplate: &201ImportTemplate null\n 300ImportTemplate: &300ImportTemplate null\n 301ImportTemplate: &301ImportTemplate null\n 302ImportTemplate: &302ImportTemplate null\n 303ImportTemplate: &303ImportTemplate null\n 304ImportTemplate: &304ImportTemplate null\n 305ImportTemplate: &305ImportTemplate null\n 306ImportTemplate: &306ImportTemplate null\n# Universal types\n# Everything inherits from StringType because we haven\'t implemented any of them.\nBasicTypes:\n # Universal basic types\n _bool: &BoolType\n <<: *__type\n id: "_bool"\n code: 0\n template: *BoolTypeTemplate\n _integer: &IntegerType\n <<: *__type\n id: "_integer"\n code: 1\n template: *IntegerTypeTemplate\n _long: &LongBasicType\n <<: *__type\n id: "_long"\n code: 2\n template: *LongBasicTypeTemplate\n _decimal: &DecimalType\n <<: *__type\n id: "_decimal"\n code: 3\n template: *DecimalTypeTemplate\n _hex: &HexType\n <<: *__type\n id: "_hex"\n code: 4\n template: *HexTypeTemplate\n _octal: &OctalType\n <<: *__type\n id: "_octal"\n code: 5\n template: *OctalTypeTemplate\n _numeric: &NumericType\n <<: *__type\n id: "_numeric"\n code: 6\n template: *NumericTypeTemplate\n _string: &StringType\n <<: *__type\n id: "_string"\n code: 7\n template: *StringTypeTemplate\n _regex: &RegexType\n <<: *__type\n id: "_regex"\n code: 8\n template: *RegexTypeTemplate\n _array: &ArrayType\n <<: *__type\n id: "_array"\n code: 9\n template: *ArrayTypeTemplate\n argsTemplate: *ArrayTypeArgsTemplate\n _object: &ObjectType\n <<: *__type\n id: "_object"\n code: 10\n template: *ObjectTypeTemplate\n argsTemplate: *ObjectTypeArgsTemplate\n _null: &NullType\n <<: *__type\n id: "_null"\n code: 11\n template: *NullTypeTemplate\n _undefined: &UndefinedType\n <<: *__type\n id: "_undefined"\n code: 12\n template: *UndefinedTypeTemplate\n\nSyntax:\n equality:\n template: *EqualitySyntaxTemplate\n in:\n template: *InSyntaxTemplate\n and:\n template: *AndSyntaxTemplate\n or:\n template: *OrSyntaxTemplate\n not:\n template: *NotSyntaxTemplate\n unary:\n template: *UnarySyntaxTemplate\n binary:\n template: *BinarySyntaxTemplate\n parens:\n template: *ParensSyntaxTemplate\n eos:\n template: *EosSyntaxTemplate\n eof:\n template: *EofSyntaxTemplate\n # The new template takes in expr, and an optional skip argument and optional\n # id argument. The skip argument is a boolean that if true then doesn\'t add\n # new. The code argument is the symbol code being called. The template will check\n # if it is an exception, i.e. a type that is a constructor but may not use new.\n new:\n template: *NewSyntaxTemplate\n # The regex flags that change symbols between languages can be defined here.\n # Flags that aren\'t defined can be left blank and will be ignored.\n regexFlags: *RegexFlags\n bsonRegexFlags: *BSONRegexFlags\n driver: *DriverTemplate\nImports:\n import:\n template: *ImportTemplate\n driver:\n template: *DriverImportTemplate\n 0:\n template: *0ImportTemplate\n 1:\n template: *1ImportTemplate\n 2:\n template: *2ImportTemplate\n 3:\n template: *3ImportTemplate\n 4:\n template: *4ImportTemplate\n 5:\n template: *5ImportTemplate\n 6:\n template: *6ImportTemplate\n 7:\n template: *7ImportTemplate\n 8:\n template: *8ImportTemplate\n 9:\n template: *9ImportTemplate\n 10:\n template: *10ImportTemplate\n 11:\n template: *11ImportTemplate\n 12:\n template: *12ImportTemplate\n 100:\n template: *100ImportTemplate\n 101:\n template: *101ImportTemplate\n 102:\n template: *102ImportTemplate\n 103:\n template: *103ImportTemplate\n 104:\n template: *104ImportTemplate\n 105:\n template: *105ImportTemplate\n 106:\n template: *106ImportTemplate\n 107:\n template: *107ImportTemplate\n 108:\n template: *108ImportTemplate\n 109:\n template: *109ImportTemplate\n 110:\n template: *110ImportTemplate\n 111:\n template: *111ImportTemplate\n 112:\n template: *112ImportTemplate\n 113:\n template: *113ImportTemplate\n 114:\n template: *114ImportTemplate\n 200:\n template: *200ImportTemplate\n 201:\n template: *201ImportTemplate\n 300:\n template: *300ImportTemplate\n 301:\n template: *301ImportTemplate\n 302:\n template: *302ImportTemplate\n 303:\n template: *303ImportTemplate\n 304:\n template: *304ImportTemplate\n 305:\n template: *305ImportTemplate\n 306:\n template: *306ImportTemplate\nBsonTypes:\n Code: &CodeType\n <<: *__type\n id: "Code"\n code: 100\n type: *ObjectType\n attr:\n code:\n callable: *var\n args: null\n attr: null\n id: "code"\n type: *StringType\n template: *CodeCodeTemplate\n argsTemplate: *CodeCodeArgsTemplate\n scope:\n callable: *var\n args: null\n attr: null\n id: "scope"\n type: *StringType\n template: *CodeScopeTemplate\n argsTemplate: *CodeScopeArgsTemplate\n ObjectId: &ObjectIdType\n <<: *__type\n id: "ObjectId"\n code: 101\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: "toString"\n type: *StringType\n template: *ObjectIdToStringTemplate\n argsTemplate: *ObjectIdToStringArgsTemplate\n equals:\n <<: *__func\n id: "equals"\n args:\n - [ "ObjectId" ]\n type: *BoolType\n template: *ObjectIdEqualsTemplate\n argsTemplate: *ObjectIdEqualsArgsTemplate\n getTimestamp:\n <<: *__func\n id: "getTimestamp"\n type: *IntegerType\n template: *ObjectIdGetTimestampTemplate\n argsTemplate: *ObjectIdGetTimestampArgsTemplate\n BinData: &BinaryType\n <<: *__type\n id: "BinData"\n code: 102\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: "toString"\n type: *StringType\n template: *BinaryToStringTemplate\n argsTemplate: *BinaryToStringArgsTemplate\n base64:\n <<: *__func\n id: "base64"\n type: *StringType\n template: *BinaryValueTemplate\n argsTemplate: *BinaryValueArgsTemplate\n length:\n <<: *__func\n id: "length"\n type: *IntegerType\n template: *BinaryLengthTemplate\n argsTemplate: *BinaryLengthArgsTemplate\n subtype:\n <<: *__func\n id: "subtype"\n type: *IntegerType\n template: *BinarySubtypeTemplate\n argsTemplate: *BinarySubtypeArgsTemplate\n DBRef: &DBRefType\n <<: *__type\n id: "DBRef"\n code: 103\n type: *ObjectType\n attr:\n getDb:\n <<: *__func\n id: "getDb"\n type: *StringType\n template: *DBRefGetDBTemplate\n argsTemplate: *DBRefGetDBArgsTemplate\n $db:\n callable: *var\n args: null\n attr: null\n id: "$db"\n type: *StringType\n template: *DBRefGetDBTemplate\n argsTemplate: *DBRefGetDBArgsTemplate\n getCollection:\n <<: *__func\n id: "getCollection"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n getRef:\n <<: *__func\n id: "getRef"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n $ref:\n callable: *var\n args: null\n attr: null\n id: "$ref"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n getId:\n <<: *__func\n id: "getId"\n type: *StringType\n template: *DBRefGetIdTemplate\n argsTemplate: *DBRefGetIdArgsTemplate\n $id:\n callable: *var\n args: null\n attr: null\n id: "$id"\n type: *StringType\n template: *DBRefGetIdTemplate\n argsTemplate: *DBRefGetIdArgsTemplate\n NumberInt: &Int32Type\n <<: *__type\n id: "NumberInt"\n code: 105\n type: *ObjectType\n attr: {}\n NumberLong: &LongType\n <<: *__type\n id: "NumberLong"\n code: 106\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: "LongtoString" # Needs process method\n args:\n - [ *IntegerType, null ]\n type: *StringType\n template: *LongToStringTemplate\n argsTemplate: *LongToStringArgsTemplate\n equals:\n <<: *__func\n id: "equals"\n args:\n - [ "Long" ]\n type: *BoolType\n template: *LongEqualsTemplate\n argsTemplate: *LongEqualsArgsTemplate\n toInt:\n <<: *__func\n id: "toInt"\n type: *IntegerType\n template: *LongToIntTemplate\n argsTemplate: *LongToIntArgsTemplate\n toNumber:\n <<: *__func\n id: "toNumber"\n type: *DecimalType\n template: *LongToNumberTemplate\n argsTemplate: *LongToNumberArgsTemplate\n compare:\n <<: *__func\n id: "compare"\n args:\n - [ "Long" ]\n type: *StringType\n template: *LongCompareTemplate\n argsTemplate: *LongCompareArgsTemplate\n isOdd:\n <<: *__func\n id: "isOdd"\n type: *BoolType\n template: *LongIsOddTemplate\n argsTemplate: *LongIsOddArgsTemplate\n isZero:\n <<: *__func\n id: "isZero"\n type: *BoolType\n template: *LongIsZeroTemplate\n argsTemplate: *LongIsZeroArgsTemplate\n isNegative:\n <<: *__func\n id: "isNegative"\n type: *BoolType\n template: *LongIsNegativeTemplate\n argsTemplate: *LongIsNegativeArgsTemplate\n negate:\n <<: *__func\n id: "negate"\n type: "Long"\n template: *LongNegateTemplate\n argsTemplate: *LongNegateArgsTemplate\n not:\n <<: *__func\n id: "not"\n type: "Long"\n template: *LongNotTemplate\n argsTemplate: *LongNotArgsTemplate\n notEquals:\n <<: *__func\n id: "notEquals"\n args:\n - [ "Long" ]\n type: *BoolType\n template: *LongNotEqualsTemplate\n argsTemplate: *LongNotEqualsArgsTemplate\n greaterThan:\n <<: *__func\n id: "greaterThan"\n args:\n - [ "Long" ]\n type: *BoolType\n template: *LongGreaterThanTemplate\n argsTemplate: *LongGreaterThanArgsTemplate\n greaterThanOrEqual:\n <<: *__func\n id: "greaterThanOrEqual"\n args:\n - [ "Long" ]\n type: *BoolType\n template: *LongGreaterThanOrEqualTemplate\n argsTemplate: *LongGreaterThanOrEqualArgsTemplate\n lessThan:\n <<: *__func\n id: "lessThan"\n args:\n - [ "Long" ]\n type: *BoolType\n template: *LongLessThanTemplate\n argsTemplate: *LongLessThanArgsTemplate\n lessThanOrEqual:\n <<: *__func\n id: "lessThanOrEqual"\n args:\n - [ "Long" ]\n type: *BoolType\n template: *LongLessThanOrEqualTemplate\n argsTemplate: *LongLessThanOrEqualArgsTemplate\n add:\n <<: *__func\n id: "add"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongAddTemplate\n argsTemplate: *LongAddArgsTemplate\n subtract:\n <<: *__func\n id: "subtract"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongSubtractTemplate\n argsTemplate: *LongSubtractArgsTemplate\n multiply:\n <<: *__func\n id: "multiply"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongMultiplyTemplate\n argsTemplate: *LongMultiplyArgsTemplate\n div:\n <<: *__func\n id: "div"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongDivTemplate\n argsTemplate: *LongDivArgsTemplate\n modulo:\n <<: *__func\n id: "modulo"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongModuloTemplate\n argsTemplate: *LongModuloArgsTemplate\n and:\n <<: *__func\n id: "and"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongAndTemplate\n argsTemplate: *LongAndArgsTemplate\n or:\n <<: *__func\n id: "or"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongOrTemplate\n argsTemplate: *LongOrArgsTemplate\n xor:\n <<: *__func\n id: "xor"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongXorTemplate\n argsTemplate: *LongXorArgsTemplate\n shiftLeft:\n <<: *__func\n id: "shiftLeft"\n args:\n - [ *IntegerType ]\n type: "Long"\n template: *LongShiftLeftTemplate\n argsTemplate: *LongShiftLeftArgsTemplate\n shiftRight:\n <<: *__func\n id: "shiftRight"\n args:\n - [ *IntegerType ]\n type: "Long"\n template: *LongShiftRightTemplate\n argsTemplate: *LongShiftRightArgsTemplate\n MinKeyType: &MinKeyType\n <<: *__type\n id: "MinKey"\n code: 107\n type: *ObjectType\n MaxKeyType: &MaxKeyType\n <<: *__type\n id: "MaxKey"\n code: 108\n type: *ObjectType\n Timestamp: &TimestampType\n <<: *__type\n id: "Timestamp"\n code: 110\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: "toString"\n type: *StringType\n template: *TimestampToStringTemplate\n argsTemplate: *TimestampToStringArgsTemplate\n equals:\n <<: *__func\n id: "equals"\n args:\n - [ "Timestamp" ]\n type: *BoolType\n template: *TimestampEqualsTemplate\n argsTemplate: *TimestampEqualsArgsTemplate\n getLowBits:\n <<: *__func\n id: "getLowBits"\n type: *IntegerType\n template: *TimestampGetLowBitsTemplate\n argsTemplate: *TimestampGetLowBitsArgsTemplate\n getHighBits:\n <<: *__func\n id: "getHighBits"\n type: *IntegerType\n template: *TimestampGetHighBitsTemplate\n argsTemplate: *TimestampGetHighBitsArgsTemplate\n compare:\n <<: *__func\n id: "compare"\n args:\n - [ "Timestamp" ]\n type: *StringType\n template: *TimestampCompareTemplate\n argsTemplate: *TimestampCompareArgsTemplate\n notEquals:\n <<: *__func\n id: "notEquals"\n args:\n - [ "Timestamp" ]\n type: *BoolType\n template: *TimestampNotEqualsTemplate\n argsTemplate: *TimestampNotEqualsArgsTemplate\n greaterThan:\n <<: *__func\n id: "greaterThan"\n args:\n - [ "Timestamp" ]\n type: *BoolType\n template: *TimestampGreaterThanTemplate\n argsTemplate: *TimestampGreaterThanArgsTemplate\n greaterThanOrEqual:\n <<: *__func\n id: "greaterThanOrEqual"\n args:\n - [ "Timestamp" ]\n type: *BoolType\n template: *TimestampGreaterThanOrEqualTemplate\n argsTemplate: *TimestampGreaterThanOrEqualArgsTemplate\n lessThan:\n <<: *__func\n id: "lessThan"\n args:\n - [ "Timestamp" ]\n type: *BoolType\n template: *TimestampLessThanTemplate\n argsTemplate: *TimestampLessThanArgsTemplate\n lessThanOrEqual:\n <<: *__func\n id: "lessThanOrEqual"\n args:\n - [ "Timestamp" ]\n type: *BoolType\n template: *TimestampLessThanOrEqualTemplate\n argsTemplate: *TimestampLessThanOrEqualArgsTemplate\n BSONSymbol: &SymbolType\n <<: *__type\n id: "BSONSymbol"\n code: 111\n type: *ObjectType\n attr:\n valueOf:\n <<: *__func\n id: "valueOf"\n type: *StringType\n template: *SymbolValueOfTemplate\n argsTemplate: *SymbolValueOfArgsTemplate\n toString:\n <<: *__func\n id: "toString"\n type: *StringType\n template: *SymbolToStringTemplate\n argsTemplate: *SymbolToStringArgsTemplate\n inspect:\n <<: *__func\n id: "inspect"\n type: *StringType\n template: *SymbolInspectTemplate\n argsTemplate: *SymbolInspectArgsTemplate\n Double: &DoubleType\n <<: *__type\n id: "Double"\n code: 104\n type: *ObjectType\n attr: {}\n Decimal128: &Decimal128Type\n <<: *__type\n id: "Decimal128"\n code: 112\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: "toString"\n type: *StringType\n template: *Decimal128ToStringTemplate\n argsTemplate: *Decimal128ToStringArgsTemplate\n NumberDecimal: &NumberDecimalType\n <<: *__type\n id: "NumberDecimal"\n code: 112\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: "toString"\n type: *StringType\n template: *Decimal128ToStringTemplate\n argsTemplate: *Decimal128ToStringArgsTemplate\n\n\n SUBTYPE_DEFAULT:\n id: "SUBTYPE_DEFAULT"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeDefaultTemplate\n SUBTYPE_FUNCTION:\n id: "SUBTYPE_FUNCTION"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeFunctionTemplate\n SUBTYPE_BYTE_ARRAY:\n id: "SUBTYPE_BYTE_ARRAY"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeByteArrayTemplate\n SUBTYPE_UUID_OLD:\n id: "SUBTYPE_UUID_OLD"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUuidOldTemplate\n SUBTYPE_UUID:\n id: "SUBTYPE_UUID"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUuidTemplate\n SUBTYPE_MD5:\n id: "SUBTYPE_MD5"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeMd5Template\n SUBTYPE_USER_DEFINED:\n id: "SUBTYPE_USER_DEFINED"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUserDefinedTemplate\n BSONRegExpType: &BSONRegExpType\n <<: *__type\n id: "BSONRegExp"\n code: 109\n type: *ObjectType\nNativeTypes:\n Date: &DateType\n <<: *__type\n id: "Date"\n code: 200\n type: *ObjectType\n attr: {} # TODO: no built-in date methods added yet\n RegExp: &RegExpType\n <<: *__type\n id: "RegExp"\n code: 8\n type: *ObjectType\n attr: {}\n\n\nBsonSymbols:\n Code: &CodeSymbol\n id: "Code"\n code: 100\n callable: *constructor\n args:\n - [ *StringType, null ]\n - [ *ObjectType, null ]\n type: *CodeType\n attr: {}\n template: *CodeSymbolTemplate\n argsTemplate: *CodeSymbolArgsTemplate\n ObjectId: &ObjectIdSymbol\n id: "ObjectId"\n code: 101\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n type: *ObjectIdType\n attr:\n createFromHexString:\n <<: *__func\n id: "createFromHexString"\n args:\n - [ *StringType ]\n type: *ObjectIdType\n template: *ObjectIdCreateFromHexStringTemplate\n argsTemplate: *ObjectIdCreateFromHexStringArgsTemplate\n createFromTime:\n <<: *__func\n id: "ObjectIdCreateFromTime"\n args:\n - [ *NumericType, *DateType ]\n type: *ObjectIdType\n template: *ObjectIdCreateFromTimeTemplate\n argsTemplate: *ObjectIdCreateFromTimeArgsTemplate\n isValid:\n <<: *__func\n id: "isValid"\n args:\n - [ *StringType ]\n type: *BoolType\n template: *ObjectIdIsValidTemplate\n argsTemplate: *ObjectIdIsValidArgsTemplate\n template: *ObjectIdSymbolTemplate\n argsTemplate: *ObjectIdSymbolArgsTemplate\n BinData: &BinarySymbol\n id: "BinData"\n code: 102\n callable: *constructor\n args:\n - [ *IntegerType ]\n - [ *StringType ]\n type: *BinaryType\n attr: {}\n template: *BinarySymbolTemplate\n argsTemplate: *BinarySymbolArgsTemplate\n DBRef:\n id: "DBRef"\n code: 103\n callable: *constructor\n args:\n - [ *StringType ]\n - [ *ObjectIdType ]\n - [ *StringType, null ]\n type: *DBRefType\n attr: {}\n template: *DBRefSymbolTemplate\n argsTemplate: *DBRefSymbolArgsTemplate\n NumberInt:\n id: "Int32"\n code: 105\n callable: *constructor\n args:\n - [ *NumericType, *StringType, null ]\n type: *Int32Type\n attr: {}\n template: *Int32SymbolTemplate\n argsTemplate: *Int32SymbolArgsTemplate\n NumberLong:\n id: "NumberLong"\n code: 106\n callable: *constructor\n args:\n - [ *IntegerType, *StringType, null ]\n type: *LongType\n attr: {}\n template: *LongSymbolTemplate\n argsTemplate: *LongSymbolArgsTemplate\n MinKey:\n id: "MinKey"\n code: 107\n callable: *constructor\n args: []\n type: *MinKeyType\n attr: {}\n template: *MinKeySymbolTemplate\n argsTemplate: *MinKeySymbolArgsTemplate\n MaxKey:\n id: "MaxKey"\n code: 108\n callable: *constructor\n args: []\n type: *MaxKeyType\n attr: {}\n template: *MaxKeySymbolTemplate\n argsTemplate: *MaxKeySymbolArgsTemplate\n Timestamp:\n id: "Timestamp"\n code: 110\n callable: *constructor\n args:\n - [ *IntegerType, null ]\n - [ *IntegerType, null ]\n type: *TimestampType\n attr: {}\n template: *TimestampSymbolTemplate\n argsTemplate: *TimestampSymbolArgsTemplate\n Symbol:\n id: "Symbol"\n code: 111\n callable: *constructor\n args:\n - [ *StringType ]\n type: *SymbolType\n attr: {}\n template: *SymbolSymbolTemplate\n argsTemplate: *SymbolSymbolArgsTemplate\n NumberDecimal:\n id: "NumberDecimal"\n code: 112\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n type: *Decimal128Type\n attr: {}\n template: *Decimal128SymbolTemplate\n argsTemplate: *Decimal128SymbolArgsTemplate\n BSONRegExp:\n id: "BSONRegExp"\n code: 109\n callable: *constructor\n args:\n - [ *StringType ]\n - [ *StringType, null ]\n type: *BSONRegExpType\n attr: {}\n template: *BSONRegExpSymbolTemplate\n argsTemplate: *BSONRegExpSymbolArgsTemplate\n BSONSymbol:\n id: "BSONSymbol"\n code: 111\n callable: *constructor\n args:\n - [ *StringType ]\n type: *SymbolType\n attr: {}\n template: *SymbolSymbolTemplate\n argsTemplate: *SymbolSymbolArgsTemplate\n Decimal128:\n id: "Decimal128"\n code: 112\n callable: *constructor\n args:\n - [ *ObjectType ]\n type: *Decimal128Type\n attr:\n fromString:\n id: "fromString"\n callable: *func\n args:\n - [ *StringType ]\n type: *Decimal128Type\n attr: {}\n template: *Decimal128SymbolFromStringTemplate\n argsTemplate: *Decimal128SymbolFromStringArgsTemplate\n template: *Decimal128SymbolTemplate\n argsTemplate: *Decimal128SymbolArgsTemplate\n Double:\n id: "Double"\n code: 104\n callable: *constructor\n args:\n - [ *NumericType, *StringType ]\n type: *DoubleType\n attr: {}\n template: *DoubleSymbolTemplate\n argsTemplate: *DoubleSymbolArgsTemplate\n Int32:\n id: "Int32"\n code: 105\n callable: *constructor\n args:\n - [ *NumericType, *StringType ]\n type: *Int32Type\n attr: {}\n template: *Int32SymbolTemplate\n argsTemplate: *Int32SymbolArgsTemplate\n Long:\n id: "Long"\n code: 106\n callable: *constructor\n args:\n - [ *IntegerType ]\n - [ *IntegerType ]\n type: *LongType\n attr:\n MAX_VALUE:\n id: "MAX_VALUE"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolMaxTemplate\n argsTemplate: *LongSymbolMaxArgsTemplate\n MIN_VALUE:\n id: "MIN_VALUE"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolMinTemplate\n argsTemplate: *LongSymbolMinArgsTemplate\n ZERO:\n id: "ZERO"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolZeroTemplate\n argsTemplate: *LongSymbolZeroArgsTemplate\n ONE:\n id: "ONE"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolOneTemplate\n argsTemplate: *LongSymbolOneArgsTemplate\n NEG_ONE:\n id: "NEG_ONE"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolNegOneTemplate\n argsTemplate: *LongSymbolNegOneArgsTemplate\n fromBits:\n id: "LongfromBits" # Needs process method\n callable: *func\n args:\n - [ *IntegerType ]\n - [ *IntegerType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromBitsTemplate\n argsTemplate: *LongSymbolFromBitsArgsTemplate\n fromInt:\n id: "fromInt"\n callable: *func\n args:\n - [ *IntegerType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromIntTemplate\n argsTemplate: *LongSymbolFromIntArgsTemplate\n fromNumber:\n id: "fromNumber"\n callable: *func\n args:\n - [ *NumericType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromNumberTemplate\n argsTemplate: *LongSymbolFromNumberArgsTemplate\n fromString:\n id: "fromString"\n callable: *func\n args:\n - [ *StringType ]\n - [ *IntegerType, null ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromStringTemplate\n argsTemplate: *LongSymbolFromStringArgsTemplate\n template: *LongSymbolTemplate\n argsTemplate: *LongSymbolArgsTemplate\n\nNativeSymbols:\n Number:\n id: "Number"\n code: 2\n callable: *constructor\n args:\n - [ *IntegerType, *StringType, null ]\n type: *NumericType\n attr: {} # TODO: no built-in number funcs added yet\n template: *NumberSymbolTemplate\n argsTemplate: *NumberSymbolArgsTemplate\n Date: # Needs emit method\n id: "Date"\n code: 200\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n type: *DateType\n attr: # TODO: add more date funcs?\n now:\n id: "now"\n code: 200.1\n callable: *func\n args: []\n type: *DateType\n attr: {}\n template: *DateSymbolNowTemplate\n argsTemplate: *DateSymbolNowArgsTemplate\n template: *DateSymbolTemplate\n argsTemplate: *DateSymbolArgsTemplate\n ISODate: # Needs emit method\n id: "ISODate"\n code: 200\n callable: *constructor\n args:\n - [ *StringType, null ]\n type: *DateType\n attr:\n now:\n id: "now"\n callable: *constructor\n args: []\n type: *DateType\n attr: {}\n template: *DateSymbolNowTemplate\n argsTemplate: *DateSymbolNowArgsTemplate\n template: *DateSymbolTemplate\n argsTemplate: *DateSymbolArgsTemplate\n RegExp: # Needs process method\n id: "RegExp"\n code: 8\n callable: *constructor\n args:\n - [ *StringType, *RegexType ]\n - [ *StringType, null ]\n type: *RegExpType\n attr: {} # TODO: no built-in regex funcs added yet\n template: *RegExpSymbolTemplate\n argsTemplate: *RegExpSymbolArgsTemplate\n\n'},9503:e=>{e.exports="SymbolTypes:\n VAR: &var 0\n CONSTRUCTOR: &constructor 1\n FUNC: &func 2\n# Internal patterns to save typing\n__type: &__type\n id: null\n callable: *var\n args: null\n type: null\n attr: {}\n template: null\n argsTemplate: null\n__func: &__func\n callable: *func\n args: []\n attr: {}\n template: null\n argsTemplate: null\n\n#############################################\n# Sample Templates #\n# #\n# The expected arguments are commented next #\n# to the template itself. Currently all are #\n# set to null, but to define a function #\n# replace 'null' with '!!js/function > \\n #\n# and a function defined below. #\n# #\n# See the other template files for examples #\n# #\n# Good to know: #\n# lhs is left-hand-side of the expression #\n# rhs is right-hand-side of the expression #\n# All args are strings unless noted #\n# - arg? is boolean #\n# - arg# is number #\n# #\n#############################################\nTemplates:\n ########\n # Misc #\n ########\n\n # Filter out regex flags that have translations or are unsupported.\n RegexFlags: &RegexFlags\n i: 'i'\n m: 'm'\n u: 'u'\n y: 'y'\n g: 'g'\n BSONRegexFlags: &BSONRegexFlags\n i: 'i'\n m: 'm'\n x: 'x'\n s: 's'\n l: 'l'\n u: 'u'\n\n #############################################\n # Syntax #\n # #\n # Templates for language syntax expressions #\n # #\n #############################################\n\n DriverTemplate: &DriverTemplate !!js/function >\n (spec) => {\n const options = spec.options;\n const uri = spec.options.uri\n const filter = spec.filter || {};\n const exportMode = spec.exportMode;\n delete spec.options;\n delete spec.filter;\n delete spec.exportMode;\n\n const indent = (depth) => ' '.repeat(depth)\n\n let driverMethod;\n switch (exportMode) {\n case 'Delete Query':\n driverMethod = 'DeleteMany';\n break;\n case 'Update Query':\n driverMethod = 'UpdateMany';\n break;\n default:\n driverMethod = 'Find';\n }\n\n const comment = []\n .concat('// Requires the MongoDB Go Driver')\n .concat('// https://go.mongodb.org/mongo-driver')\n .join('\\n');\n\n const connect = []\n .concat('ctx := context.TODO()')\n .concat(this.declarations.length() > 0 ? `\\n${this.declarations.toString()}\\n` : '')\n .concat('// Set client options')\n .concat(`clientOptions := options.Client().ApplyURI(\"${uri}\")`)\n .concat('')\n .concat('// Connect to MongoDB')\n .concat('client, err := mongo.Connect(ctx, clientOptions)')\n .concat('if err != nil {')\n .concat(' log.Fatal(err)')\n .concat('}')\n .concat('defer func() {')\n .concat(' if err := client.Disconnect(ctx); err != nil {')\n .concat(' log.Fatal(err)')\n .concat(' }')\n .concat('}()')\n .join('\\n');\n\n const coll = []\n .concat(`coll := client.Database(\"${options.database}\").Collection(\"${options.collection}\")`)\n .join('\\n');\n\n if ('aggregation' in spec) {\n return []\n .concat(comment)\n .concat(connect)\n .concat('')\n .concat('// Open an aggregation cursor')\n .concat(`${coll}`)\n .concat(`_, err = coll.Aggregate(ctx, ${spec.aggregation})`)\n .concat('if err != nil {')\n .concat(' log.Fatal(err)')\n .concat('}')\n .join('\\n');\n }\n\n const findOptions = []\n if (spec.project)\n findOptions.push(`options.Find().SetProjection(${spec.project})`);\n if (spec.sort)\n findOptions.push(`options.Find().SetSort(${spec.sort})`);\n\n const optsStr = findOptions.length > 0 ? `,\\n${indent(1)}${findOptions.join(`,\\n${indent(1)}`)}` : ''\n\n return []\n .concat(comment)\n .concat(connect)\n .concat('')\n .concat(`${coll}`)\n .concat(`_, err = coll.${driverMethod}(ctx, ${filter}${optsStr})`)\n .concat('if err != nil {')\n .concat(' log.Fatal(err)')\n .concat('}')\n .join('\\n');\n }\n EqualitySyntaxTemplate: &EqualitySyntaxTemplate !!js/function >\n (lhs, op, rhs) => {\n if (op.includes('!') || op.includes('not')) {\n return `${lhs} != ${rhs}`;\n }\n else if (op === '==' || op === '===' || op === 'is') {\n return `${lhs} == ${rhs}`;\n }\n return `${lhs} ${op} ${rhs}`;\n }\n InSyntaxTemplate: &InSyntaxTemplate !!js/function >\n (lhs, op, rhs) => {\n this.declarations.addFunc([]\n .concat(`var contains = func(elems bson.A, v interface{}) bool {`)\n .concat(' for _, s := range elems {')\n .concat(' if v == s {')\n .concat(' return true')\n .concat(' }')\n .concat(' }')\n .concat(' return false')\n .concat('}')\n .join('\\n'));\n let prefix = '';\n if (op.includes('!') || op.includes('not'))\n prefix = '!';\n return `${prefix}contains(${rhs}, ${lhs})`;\n }\n AndSyntaxTemplate: &AndSyntaxTemplate !!js/function >\n (args) => args.join(' && ')\n OrSyntaxTemplate: &OrSyntaxTemplate !!js/function >\n (args) => args.join(' || ')\n NotSyntaxTemplate: &NotSyntaxTemplate !!js/function >\n (arg) => `!${arg}`\n UnarySyntaxTemplate: &UnarySyntaxTemplate !!js/function >\n (op, val) => {\n switch(op) {\n case '+':\n return val;\n case '~':\n return `!${val}`;\n default:\n return `${op}${val}`;\n }\n return `${op}${val}`;\n }\n BinarySyntaxTemplate: &BinarySyntaxTemplate !!js/function >\n (args) => {\n return args.reduce((s, op, i, arr) => {\n if (i % 2 === 0) {\n return s;\n }\n const rhs = arr[i + 1];\n switch(op) {\n case '//':\n return `${s} / ${rhs}`\n case '**':\n return `math.Pow(${s}, ${rhs})`\n default:\n return `${s} ${op} ${rhs}`;\n }\n }, args[0]);\n }\n ParensSyntaxTemplate: &ParensSyntaxTemplate null\n EosTemplate: &EosSyntaxTemplate null # No args. End-of-line\n EofTemplate: &EofSyntaxTemplate null # No args. End-of-file\n FloorDivTemplate: &FloorDivSyntaxTemplate null # Args: lhs, rhs\n PowerTemplate: &PowerSyntaxTemplate null # Args: lhs, rhs\n NewTemplate: &NewSyntaxTemplate null # Args: expression, skip?, code# [to check if meant to be skipped]\n\n #############################################\n # Literal Types #\n # #\n # Templates for literal type instance. Most #\n # get passed the literal itself as an arg. #\n # #\n #############################################\n StringTypeTemplate: &StringTypeTemplate !!js/function >\n (str) => {\n // Double quote stringify\n const singleQuoted = str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'';\n const doubleQuoted = str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"';\n if (singleQuoted || doubleQuoted)\n str = str.substr(1, str.length - 2);\n return `\"${str.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\"`;\n }\n RegexTypeTemplate: &RegexTypeTemplate !!js/function >\n (pattern, flags) => {\n // Wrap string in double quotes\n const doubleStringify = (str) => {\n const singleQuoted = str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'';\n const doubleQuoted = str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"';\n if (singleQuoted || doubleQuoted)\n str = str.substr(1, str.length - 2);\n return `\"${str.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\"`;\n }\n\n const structParts = [];\n structParts.push(`Pattern: ${doubleStringify(pattern)}`);\n if (flags)\n structParts.push(`Options: ${doubleStringify(flags)}`);\n return `primitive.Regex{${structParts.join(\", \")}}`;\n }\n BoolTypeTemplate: &BoolTypeTemplate !!js/function >\n (literal) => literal.toLowerCase()\n IntegerTypeTemplate: &IntegerTypeTemplate null # args: literal, argType (i.e. '_string', '_decimal' etc)\n DecimalTypeTemplate: &DecimalTypeTemplate null # args: literal, argType\n LongBasicTypeTemplate: &LongBasicTypeTemplate null # args: literal, argType\n HexTypeTemplate: &HexTypeTemplate null # args: literal, argType\n OctalTypeTemplate: &OctalTypeTemplate null # args: literal, argType\n NumericTypeTemplate: &NumericTypeTemplate null # args: literal, argType\n ArrayTypeTemplate: &ArrayTypeTemplate !!js/function >\n (literal, depth) => {\n depth++;\n const indent = '\\n' + ' '.repeat(depth);\n const closingIndent = '\\n' + ' '.repeat(depth - 1);\n if (literal === '')\n return 'bson.A{}';\n return `bson.A{${literal}${closingIndent}}`;\n }\n ArrayTypeArgsTemplate: &ArrayTypeArgsTemplate !!js/function >\n (arg, depth, last) => {\n depth++;\n const indent = '\\n' + ' '.repeat(depth);\n return `${indent}${arg},`;\n }\n NullTypeTemplate: &NullTypeTemplate !!js/function >\n () => 'primitive.Null{}'\n UndefinedTypeTemplate: &UndefinedTypeTemplate !!js/function >\n () => 'primitive.Undefined{}'\n ObjectTypeTemplate: &ObjectTypeTemplate !!js/function >\n (literal) => `bson.D{${literal}}`\n ObjectTypeArgsTemplate: &ObjectTypeArgsTemplate !!js/function >\n (args, depth) => {\n // If there are no args, then there is nothing for us to format\n if (args.length === 0)\n return '';\n\n depth++;\n const indent = '\\n' + ' '.repeat(depth);\n const closingIndent = '\\n' + ' '.repeat(depth - 1);\n\n // Indent every line of a string\n const indentBlock = (string, count = 1, options = {}) => {\n const {\n indent = ' ',\n includeEmptyLines = false\n } = options;\n\n const regex = includeEmptyLines ? /^/gm : /^(?!\\s*$)/gm;\n return string.replace(regex, indent.repeat(count));\n }\n\n // Wrap string in double quotes\n const doubleStringify = (str) => {\n const singleQuoted = str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'';\n const doubleQuoted = str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"';\n if (singleQuoted || doubleQuoted)\n str = str.substr(1, str.length - 2);\n return `\"${str.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\"`;\n }\n\n // Check if a string is multiple lines i.e. has a break point\n const isMultiline = (element) => /\\r|\\n/.exec(element)\n\n // Format element by go type\n const fmt = (element) => {\n const hash = { multiline: isMultiline(element) };\n const typeFormatters = {\n 'bson.A': (el, hash) => isMultiline(el) ? indentBlock(`${indent}${el},${indent}`) : ` ${el}`,\n 'bson.D': (el, hash) => isMultiline(el) ? indentBlock(`${indent}${el},${indent}`) : ` ${el}`,\n default: (el, hash) => isMultiline(el) ? el : ` ${el}`\n };\n hash.el = typeFormatters.default(element);\n for (const type in typeFormatters)\n if (element.startsWith(type)) {\n hash.el = typeFormatters[type](element);\n break;\n }\n return hash;\n }\n\n // Get the {key, value} pair for the bson.D object\n const getPairs = (args, sep = `,${indent}`) => {\n const hash = { multiline: false }\n hash.el = args.map((pair) => {\n const fmtPair = fmt(pair[1])\n if (!hash.multiline && fmtPair.multiline)\n hash.multiline = true\n return `{${doubleStringify(pair[0])},${fmtPair.el}}`\n }).join(sep)\n return hash\n }\n\n const pairs = getPairs(args);\n const singleLine = args.length <= 1 && !pairs.multiline;\n const prefix = singleLine ? '' : indent;\n const suffix = singleLine ? '' : ',' + closingIndent;\n return `${prefix}${pairs.el}${suffix}`;\n }\n\n #############################################\n # Symbols #\n # #\n # Templates for symbols, can be either #\n # functions or variables. #\n # #\n # The *SymbolTemplates return names and #\n # usually don't take any arguments. The #\n # *SymbolArgsTemplates are invoked for func #\n # calls. The first argument is always the #\n # lhs, i.e. the symbol returned from the #\n # corresponding SymbolTemplate. The rest of #\n # the arguments are the processed arguments #\n # passed to the original function. #\n # #\n #############################################\n CodeSymbolTemplate: &CodeSymbolTemplate !!js/function >\n () => 'primitive.CodeWithScope'\n CodeSymbolArgsTemplate: &CodeSymbolArgsTemplate !!js/function >\n (_, code, scope) => {\n if (code === undefined)\n return `{}`;\n\n if (scope !== undefined)\n scope = `Scope: ${scope}`;\n\n const singleQuoted = code.charAt(0) === '\\'' && code.charAt(code.length - 1) === '\\'';\n const doubleQuoted = code.charAt(0) === '\"' && code.charAt(code.length - 1) === '\"';\n if (singleQuoted || doubleQuoted)\n code = code.substr(1, code.length - 2);\n\n code = `Code: primitive.JavaScript(\"${code.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\")`;\n return (scope === undefined) ? `{${code}}` : `{${code}, ${scope}}`;\n }\n ObjectIdSymbolTemplate: &ObjectIdSymbolTemplate !!js/function >\n () => ''\n ObjectIdSymbolArgsTemplate: &ObjectIdSymbolArgsTemplate !!js/function >\n (_, arg) => {\n if (arg === undefined || arg === '')\n return 'primitive.NewObjectID()';\n\n // Double quote stringify\n const singleQuoted = arg.charAt(0) === '\\'' && arg.charAt(arg.length - 1) === '\\'';\n const doubleQuoted = arg.charAt(0) === '\"' && arg.charAt(arg.length - 1) === '\"';\n if (singleQuoted || doubleQuoted)\n arg = arg.substr(1, arg.length - 2);\n arg = `\"${arg.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\"`;\n this.declarations.addFunc([]\n .concat('var objectIDFromHex = func(hex string) primitive.ObjectID {')\n .concat(` objectID, err := primitive.ObjectIDFromHex(hex)`)\n .concat(' if err != nil {')\n .concat(' log.Fatal(err)')\n .concat(' }')\n .concat(' return objectID')\n .concat('}')\n .join('\\n'));\n return `objectIDFromHex(${arg})`\n }\n BinarySymbolTemplate: &BinarySymbolTemplate null\n BinarySymbolArgsTemplate: &BinarySymbolArgsTemplate null\n BinarySymbolSubtypeDefaultTemplate: &BinarySymbolSubtypeDefaultTemplate null\n BinarySymbolSubtypeFunctionTemplate: &BinarySymbolSubtypeFunctionTemplate null\n BinarySymbolSubtypeByteArrayTemplate: &BinarySymbolSubtypeByteArrayTemplate null\n BinarySymbolSubtypeUuidOldTemplate: &BinarySymbolSubtypeUuidOldTemplate null\n BinarySymbolSubtypeUuidTemplate: &BinarySymbolSubtypeUuidTemplate null\n BinarySymbolSubtypeMd5Template: &BinarySymbolSubtypeMd5Template null\n BinarySymbolSubtypeUserDefinedTemplate: &BinarySymbolSubtypeUserDefinedTemplate null\n DBRefSymbolTemplate: &DBRefSymbolTemplate null # No args\n DBRefSymbolArgsTemplate: &DBRefSymbolArgsTemplate null\n DoubleSymbolTemplate: &DoubleSymbolTemplate !!js/function >\n () => ''\n DoubleSymbolArgsTemplate: &DoubleSymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n if (!arg)\n arg = 0;\n switch(type) {\n case '_string':\n this.declarations.addFunc([]\n .concat('var parseFloat64 = func(str string) float64 {')\n .concat(' f64, err := strconv.ParseFloat(str, 64)')\n .concat(' if err != nil {')\n .concat(' log.Fatal(err)')\n .concat(' }')\n .concat(' return f64')\n .concat('}')\n .join('\\n'));\n return `parseFloat64(${arg})`\n default:\n return `float64(${arg})`;\n }\n }\n Int32SymbolTemplate: &Int32SymbolTemplate !!js/function >\n () => ''\n Int32SymbolArgsTemplate: &Int32SymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n if (!arg)\n arg = 0\n switch(type) {\n case '_string':\n this.declarations.addFunc([]\n .concat('var parseInt32 = func(str string) int32 {')\n .concat('i64, err := strconv.ParseInt(str, 10, 32)')\n .concat(' if err != nil {')\n .concat(' log.Fatal(err)')\n .concat(' }')\n .concat(' return int32(i64)')\n .concat('}')\n .join('\\n'));\n return `parseInt32(${arg})`;\n default:\n return `int32(${arg})`;\n }\n }\n LongSymbolTemplate: &LongSymbolTemplate !!js/function >\n () => ''\n LongSymbolArgsTemplate: &LongSymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n if (!arg)\n arg = 0\n switch(type) {\n case '_string':\n this.declarations.addFunc([]\n .concat('var parseInt = func(str string) int64 {')\n .concat(' i64, err := strconv.ParseInt(str, 10, 64)')\n .concat(' if err != nil {')\n .concat(' log.Fatal(err)')\n .concat(' }')\n .concat(' return i64')\n .concat('}')\n .join('\\n'));\n return `parseInt64(${arg})`;\n default:\n return `int64(${arg})`;\n }\n }\n RegExpSymbolTemplate: &RegExpSymbolTemplate !!js/function >\n () => 'regex'\n RegExpSymbolArgsTemplate: &RegExpSymbolArgsTemplate null # Args: lhs, pattern, flags\n SymbolSymbolTemplate: &SymbolSymbolTemplate !!js/function >\n () => 'primitive.Symbol'\n SymbolSymbolArgsTemplate: &SymbolSymbolArgsTemplate null\n BSONRegExpSymbolTemplate: &BSONRegExpSymbolTemplate !!js/function >\n () => 'primitive.Regex'\n BSONRegExpSymbolArgsTemplate: &BSONRegExpSymbolArgsTemplate !!js/function >\n (_, pattern, flags) => {\n // Wrap string in double quotes\n const doubleStringify = (str) => {\n const singleQuoted = str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'';\n const doubleQuoted = str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"';\n if (singleQuoted || doubleQuoted)\n str = str.substr(1, str.length - 2);\n return `\"${str.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\"`;\n }\n\n const structParts = [];\n structParts.push(`Pattern: ${doubleStringify(pattern)}`);\n if (flags)\n structParts.push(`Options: ${doubleStringify(flags)}`);\n return `(${structParts.join(\", \")})`;\n }\n Decimal128SymbolTemplate: &Decimal128SymbolTemplate !!js/function >\n () => ''\n Decimal128SymbolArgsTemplate: &Decimal128SymbolArgsTemplate !!js/function >\n (_, arg) => {\n if (!arg)\n arg = '\"0\"';\n\n // Double quote stringify\n const singleQuoted = arg.charAt(0) === '\\'' && arg.charAt(arg.length - 1) === '\\'';\n const doubleQuoted = arg.charAt(0) === '\"' && arg.charAt(arg.length - 1) === '\"';\n if (singleQuoted || doubleQuoted)\n arg = arg.substr(1, arg.length - 2);\n arg = `\"${arg.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\"`;\n\n this.declarations.addFunc([]\n .concat('var parseDecimal128 = func(str string) primitive.Decimal128 {')\n .concat(' d128, err := primitive.ParseDecimal128(str)')\n .concat(' if err != nil {')\n .concat(' log.Fatal(err)')\n .concat(' }')\n .concat(' return d128')\n .concat('}')\n .join('\\n'));\n return `parseDecimal128(${arg})`;\n }\n MinKeySymbolTemplate: &MinKeySymbolTemplate !!js/function >\n () => 'primitive.MinKey'\n MinKeySymbolArgsTemplate: &MinKeySymbolArgsTemplate !!js/function >\n () => '{}'\n MaxKeySymbolTemplate: &MaxKeySymbolTemplate !!js/function >\n () => 'primitive.MaxKey'\n MaxKeySymbolArgsTemplate: &MaxKeySymbolArgsTemplate !!js/function >\n () => '{}'\n TimestampSymbolTemplate: &TimestampSymbolTemplate !!js/function >\n () => 'primitive.Timestamp'\n TimestampSymbolArgsTemplate: &TimestampSymbolArgsTemplate !!js/function >\n (lhs, low, high) => {\n if (low === undefined) {\n low = 0;\n high = 0;\n }\n return `{T: ${low}, I: ${high}}`\n }\n # non bson-specific\n NumberSymbolTemplate: &NumberSymbolTemplate !!js/function >\n () => ''\n NumberSymbolArgsTemplate: &NumberSymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n\n switch(type) {\n case '_string':\n if (arg.indexOf('.') !== -1) {\n this.declarations.addFunc([]\n .concat('var parseFloat64 = func(str string) float64 {')\n .concat(' f64, err := strconv.ParseFloat(str, 64)')\n .concat(' if err != nil {')\n .concat(' log.Fatal(err)')\n .concat(' }')\n .concat(' return f64')\n .concat('}')\n .join('\\n'));\n return `parseFloat64(${arg})`\n }\n this.declarations.addFunc([]\n .concat('var parseInt = func(str string) int64 {')\n .concat(' i64, err := strconv.ParseInt(str, 10, 64)')\n .concat(' if err != nil {')\n .concat(' log.Fatal(err)')\n .concat(' }')\n .concat(' return i64')\n .concat('}')\n .join('\\n'));\n return `parseInt64(${arg})`;\n default:\n return `${arg}`\n }\n }\n DateSymbolTemplate: &DateSymbolTemplate !!js/function >\n () => 'time.Date'\n DateSymbolArgsTemplate: &DateSymbolArgsTemplate !!js/function >\n (lhs, date, isString) => {\n if (date === null)\n return `time.Now()`;\n\n const dateStr = [\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n '0',\n 'time.UTC'\n ].join(', ');\n\n return `${lhs}(${dateStr})`\n }\n\n #############################################\n # Object Attributes/Methods #\n # #\n # These're variables or functions called on #\n # instantiated objects. For example, #\n # ObjectId().isValid() or Timestamp().t #\n # #\n # They follow the same pattern with the\n # *Template/*ArgsTemplates: usually no args #\n # to the Template and lhs plus any original #\n # arguments to the ArgsTemplate. #\n # #\n #############################################\n CodeCodeTemplate: &CodeCodeTemplate !!js/function >\n (lhs) => `${lhs}.Code`\n CodeCodeArgsTemplate: &CodeCodeArgsTemplate null\n CodeScopeTemplate: &CodeScopeTemplate !!js/function >\n (lhs) => lhs\n CodeScopeArgsTemplate: &CodeScopeArgsTemplate null\n ObjectIdToStringTemplate: &ObjectIdToStringTemplate !!js/function >\n (lhs) => `${lhs}.String()`\n ObjectIdToStringArgsTemplate: &ObjectIdToStringArgsTemplate !!js/function >\n () => ''\n ObjectIdEqualsTemplate: &ObjectIdEqualsTemplate !!js/function >\n () => ''\n ObjectIdEqualsArgsTemplate: &ObjectIdEqualsArgsTemplate !!js/function >\n (arg1, arg2) => `${arg1} == ${arg2}`\n ObjectIdGetTimestampTemplate: &ObjectIdGetTimestampTemplate !!js/function >\n (lhs) => `${lhs}.Timestamp()`\n ObjectIdGetTimestampArgsTemplate: &ObjectIdGetTimestampArgsTemplate !!js/function >\n () => ''\n ObjectIdIsValidTemplate: &ObjectIdIsValidTemplate !!js/function >\n () => `primitive.IsValidObjectID`\n ObjectIdIsValidArgsTemplate: &ObjectIdIsValidArgsTemplate null\n BinaryValueTemplate: &BinaryValueTemplate null\n BinaryValueArgsTemplate: &BinaryValueArgsTemplate null\n BinaryLengthTemplate: &BinaryLengthTemplate null\n BinaryLengthArgsTemplate: &BinaryLengthArgsTemplate null\n BinaryToStringTemplate: &BinaryToStringTemplate null\n BinaryToStringArgsTemplate: &BinaryToStringArgsTemplate null\n BinarySubtypeTemplate: &BinarySubtypeTemplate null\n BinarySubtypeArgsTemplate: &BinarySubtypeArgsTemplate null\n DBRefGetDBTemplate: &DBRefGetDBTemplate null\n DBRefGetCollectionTemplate: &DBRefGetCollectionTemplate null\n DBRefGetIdTemplate: &DBRefGetIdTemplate null\n DBRefGetDBArgsTemplate: &DBRefGetDBArgsTemplate null\n DBRefGetCollectionArgsTemplate: &DBRefGetCollectionArgsTemplate null\n DBRefGetIdArgsTemplate: &DBRefGetIdArgsTemplate null\n DBRefToStringTemplate: &DBRefToStringTemplate null\n DBRefToStringArgsTemplate: &DBRefToStringArgsTemplate null\n DoubleValueOfTemplate: &DoubleValueOfTemplate null\n DoubleValueOfArgsTemplate: &DoubleValueOfArgsTemplate null\n Int32ValueOfTemplate: &Int32ValueOfTemplate null\n Int32ValueOfArgsTemplate: &Int32ValueOfArgsTemplate null\n Int32ToStringTemplate: &Int32ToStringTemplate null\n Int32ToStringArgsTemplate: &Int32ToStringArgsTemplate null\n LongEqualsTemplate: &LongEqualsTemplate !!js/function >\n (lhs) => `${lhs} == `\n LongEqualsArgsTemplate: &LongEqualsArgsTemplate !!js/function >\n (_, arg) => arg\n LongToStringTemplate: &LongToStringTemplate !!js/function >\n (lhs) => `strconv.Itoa(${lhs})`\n LongToStringArgsTemplate: &LongToStringArgsTemplate !!js/function >\n () => ''\n LongToIntTemplate: &LongToIntTemplate !!js/function >\n (lhs) => `int(${lhs})`\n LongToIntArgsTemplate: &LongToIntArgsTemplate !!js/function >\n () => ''\n LongValueOfTemplate: &LongValueOfTemplate null\n LongValueOfArgsTemplate: &LongValueOfArgsTemplate null\n LongToNumberTemplate: &LongToNumberTemplate !!js/function >\n (lhs) => `float64(${lhs})`\n LongToNumberArgsTemplate: &LongToNumberArgsTemplate !!js/function >\n (arg) => ''\n LongAddTemplate: &LongAddTemplate !!js/function >\n (lhs) => `${lhs} + `\n LongAddArgsTemplate: &LongAddArgsTemplate !!js/function >\n (_, args) => args\n LongSubtractTemplate: &LongSubtractTemplate !!js/function >\n (lhs) => `${lhs} - `\n LongSubtractArgsTemplate: &LongSubtractArgsTemplate !!js/function >\n (_, arg) => arg\n LongMultiplyTemplate: &LongMultiplyTemplate !!js/function >\n (lhs) => `${lhs} * `\n LongMultiplyArgsTemplate: &LongMultiplyArgsTemplate !!js/function >\n (_, arg) => arg\n LongDivTemplate: &LongDivTemplate !!js/function >\n (lhs) => `${lhs} / `\n LongDivArgsTemplate: &LongDivArgsTemplate !!js/function >\n (_, arg) => arg\n LongModuloTemplate: &LongModuloTemplate !!js/function >\n (lhs) => `${lhs} % `\n LongModuloArgsTemplate: &LongModuloArgsTemplate !!js/function >\n (_, arg) => arg\n LongAndTemplate: &LongAndTemplate !!js/function >\n (lhs) => `${lhs} & `\n LongAndArgsTemplate: &LongAndArgsTemplate !!js/function >\n (_, arg) => arg\n LongOrTemplate: &LongOrTemplate !!js/function >\n (lhs) => `${lhs} | `\n LongOrArgsTemplate: &LongOrArgsTemplate !!js/function >\n (_, arg) => arg\n LongXorTemplate: &LongXorTemplate !!js/function >\n (lhs) => `${lhs} ^ `\n LongXorArgsTemplate: &LongXorArgsTemplate !!js/function >\n (_, arg) => arg\n LongShiftLeftTemplate: &LongShiftLeftTemplate !!js/function >\n (lhs) => `${lhs} << `\n LongShiftLeftArgsTemplate: &LongShiftLeftArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongShiftRightTemplate: &LongShiftRightTemplate !!js/function >\n (lhs) => `${lhs} >> `\n LongShiftRightArgsTemplate: &LongShiftRightArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongCompareTemplate: &LongCompareTemplate !!js/function >\n (lhs) => `${lhs} - `\n LongCompareArgsTemplate: &LongCompareArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongIsOddTemplate: &LongIsOddTemplate !!js/function >\n (arg) => `${arg} % 2 == 1`\n LongIsOddArgsTemplate: &LongIsOddArgsTemplate !!js/function >\n () => ''\n LongIsZeroTemplate: &LongIsZeroTemplate !!js/function >\n (arg) => `${arg} == int64(0)`\n LongIsZeroArgsTemplate: &LongIsZeroArgsTemplate !!js/function >\n () => ''\n LongIsNegativeTemplate: &LongIsNegativeTemplate !!js/function >\n (arg) => `${arg} < int64(0)`\n LongIsNegativeArgsTemplate: &LongIsNegativeArgsTemplate !!js/function >\n () => ''\n LongNegateTemplate: &LongNegateTemplate !!js/function >\n () => '-'\n LongNegateArgsTemplate: &LongNegateArgsTemplate !!js/function >\n (lhs) => lhs\n LongNotTemplate: &LongNotTemplate !!js/function >\n () => '^'\n LongNotArgsTemplate: &LongNotArgsTemplate !!js/function >\n (lhs) => lhs\n LongNotEqualsTemplate: &LongNotEqualsTemplate !!js/function >\n (lhs) => `${lhs} != `\n LongNotEqualsArgsTemplate: &LongNotEqualsArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongGreaterThanTemplate: &LongGreaterThanTemplate !!js/function >\n (lhs) => `${lhs} > `\n LongGreaterThanArgsTemplate: &LongGreaterThanArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongGreaterThanOrEqualTemplate: &LongGreaterThanOrEqualTemplate !!js/function >\n (lhs) => `${lhs} >= `\n LongGreaterThanOrEqualArgsTemplate: &LongGreaterThanOrEqualArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongLessThanTemplate: &LongLessThanTemplate !!js/function >\n (lhs) => `${lhs} < `\n LongLessThanArgsTemplate: &LongLessThanArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongLessThanOrEqualTemplate: &LongLessThanOrEqualTemplate !!js/function >\n (lhs) => `${lhs} <= `\n LongLessThanOrEqualArgsTemplate: &LongLessThanOrEqualArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongFloatApproxTemplate: &LongFloatApproxTemplate !!js/function >\n (arg) => `float64(${arg})`\n LongTopTemplate: &LongTopTemplate !!js/function >\n (arg) => `${arg} >> 32`\n LongBottomTemplate: &LongBottomTemplate !!js/function >\n (arg) => `${arg} & 0x0000ffff`\n TimestampToStringTemplate: &TimestampToStringTemplate !!js/function >\n (lhs) => `time.Unix(${lhs}.T, 0).String`\n TimestampToStringArgsTemplate: &TimestampToStringArgsTemplate null\n () => '()'\n TimestampEqualsTemplate: &TimestampEqualsTemplate !!js/function >\n (lhs) => `${lhs}.Equal`\n TimestampEqualsArgsTemplate: &TimestampEqualsArgsTemplate !!js/function >\n (_, rhs) => `(${rhs})`\n TimestampGetLowBitsTemplate: &TimestampGetLowBitsTemplate !!js/function >\n (lhs) => `${lhs}.T`\n TimestampGetLowBitsArgsTemplate: &TimestampGetLowBitsArgsTemplate !!js/function >\n () => ''\n TimestampGetHighBitsTemplate: &TimestampGetHighBitsTemplate !!js/function >\n (lhs) => `${lhs}.I`\n TimestampGetHighBitsArgsTemplate: &TimestampGetHighBitsArgsTemplate !!js/function >\n () => ''\n TimestampTTemplate: &TimestampTTemplate !!js/function >\n (lhs) => `${lhs}.T`\n TimestampITemplate: &TimestampITemplate !!js/function >\n (lhs) => `${lhs}.I`\n TimestampAsDateTemplate: &TimestampAsDateTemplate !!js/function >\n (lhs) => `time.Unix(${lhs}.T, 0)`\n TimestampAsDateArgsTemplate: &TimestampAsDateArgsTemplate !!js/function >\n () => ''\n TimestampCompareTemplate: &TimestampCompareTemplate !!js/function >\n () => 'primitive.CompareTimestamp'\n TimestampCompareArgsTemplate: &TimestampCompareArgsTemplate !!js/function >\n (lhs, rhs) => `(${lhs}, ${rhs})`\n TimestampNotEqualsTemplate: &TimestampNotEqualsTemplate !!js/function >\n (lhs) => `!${lhs}.Equal`\n TimestampNotEqualsArgsTemplate: &TimestampNotEqualsArgsTemplate !!js/function >\n (_, rhs) => `(${rhs})`\n TimestampGreaterThanTemplate: &TimestampGreaterThanTemplate !!js/function >\n () => ''\n TimestampGreaterThanArgsTemplate: &TimestampGreaterThanArgsTemplate !!js/function >\n (lhs, rhs) => `primitive.CompareTimestamp(${lhs}, ${rhs}) == 1`\n TimestampGreaterThanOrEqualTemplate: &TimestampGreaterThanOrEqualTemplate !!js/function >\n () => ''\n TimestampGreaterThanOrEqualArgsTemplate: &TimestampGreaterThanOrEqualArgsTemplate !!js/function >\n (arg1, arg2) => `primitive.CompareTimestamp(${arg1}, ${arg2}) >= 0`\n TimestampLessThanTemplate: &TimestampLessThanTemplate !!js/function >\n (lhs) => ''\n TimestampLessThanArgsTemplate: &TimestampLessThanArgsTemplate !!js/function >\n (lhs, rhs) => `primitive.CompareTimestamp(${lhs}, ${rhs}) == -1`\n TimestampLessThanOrEqualTemplate: &TimestampLessThanOrEqualTemplate !!js/function >\n () => ''\n TimestampLessThanOrEqualArgsTemplate: &TimestampLessThanOrEqualArgsTemplate !!js/function >\n (arg1, arg2) => `primitive.CompareTimestamp(${arg1}, ${arg2}) <= 0`\n SymbolValueOfTemplate: &SymbolValueOfTemplate !!js/function >\n () => ''\n SymbolValueOfArgsTemplate: &SymbolValueOfArgsTemplate !!js/function >\n (arg) => arg\n SymbolInspectTemplate: &SymbolInspectTemplate !!js/function >\n () => ''\n SymbolInspectArgsTemplate: &SymbolInspectArgsTemplate !!js/function >\n (arg) => arg\n SymbolToStringTemplate: &SymbolToStringTemplate !!js/function >\n () => ''\n SymbolToStringArgsTemplate: &SymbolToStringArgsTemplate !!js/function >\n (lhs) => `string(${lhs})`\n Decimal128ToStringTemplate: &Decimal128ToStringTemplate !!js/function >\n (lhs) => `${lhs}.String()`\n Decimal128ToStringArgsTemplate: &Decimal128ToStringArgsTemplate !!js/function >\n () => ''\n # non bson-specific\n DateSymbolNowTemplate: &DateSymbolNowTemplate !!js/function >\n () => 'time.Now()'\n DateSymbolNowArgsTemplate: &DateSymbolNowArgsTemplate !!js/function >\n () => ''\n\n #############################################\n # Symbol Attributes/Methods #\n # #\n # These're variables or functions called on #\n # symbols. Also called bson-utils. #\n # #\n # They are basically the same thing as #\n # object attributes/methods, but need to be #\n # distinguished since they are separate #\n # namespaces that happen to have the same #\n # name which is v confusing. #\n # #\n # For example, ObjectId().toString() is an #\n # object method, while ObjectId.fromString #\n # is a symbol attribute. These are two #\n # separate ObjectId related namespaces that #\n # don't overlap. #\n # #\n #############################################\n LongSymbolMaxTemplate: &LongSymbolMaxTemplate !!js/function >\n () => 'int(^uint(0) >> 1)'\n LongSymbolMaxArgsTemplate: &LongSymbolMaxArgsTemplate null\n LongSymbolMinTemplate: &LongSymbolMinTemplate !!js/function >\n () => '-(1+int(^uint(0) >> 1))'\n LongSymbolMinArgsTemplate: &LongSymbolMinArgsTemplate null\n LongSymbolZeroTemplate: &LongSymbolZeroTemplate !!js/function >\n () => 'int64(0)'\n LongSymbolZeroArgsTemplate: &LongSymbolZeroArgsTemplate null\n LongSymbolOneTemplate: &LongSymbolOneTemplate !!js/function >\n () => 'int64(1)'\n LongSymbolOneArgsTemplate: &LongSymbolOneArgsTemplate null\n LongSymbolNegOneTemplate: &LongSymbolNegOneTemplate !!js/function >\n () => 'int64(-1)'\n LongSymbolNegOneArgsTemplate: &LongSymbolNegOneArgsTemplate null\n LongSymbolFromBitsTemplate: &LongSymbolFromBitsTemplate !!js/function >\n () => 'int64'\n LongSymbolFromBitsArgsTemplate: &LongSymbolFromBitsArgsTemplate null\n LongSymbolFromIntTemplate: &LongSymbolFromIntTemplate !!js/function >\n () => 'int64'\n LongSymbolFromIntArgsTemplate: &LongSymbolFromIntArgsTemplate null\n LongSymbolFromNumberTemplate: &LongSymbolFromNumberTemplate !!js/function >\n () => 'int64'\n LongSymbolFromNumberArgsTemplate: &LongSymbolFromNumberArgsTemplate null\n LongSymbolFromStringTemplate: &LongSymbolFromStringTemplate !!js/function >\n () => ''\n LongSymbolFromStringArgsTemplate: &LongSymbolFromStringArgsTemplate !!js/function >\n (_, arg) => {\n this.declarations.addFunc([]\n .concat('var int64FromString = func(str string) int64 {')\n .concat(' f64, err := strconv.Atoi(str)')\n .concat(' if err != nil {')\n .concat(' log.Fatal(err)')\n .concat(' }')\n .concat(' return f64')\n .concat('}')\n .join('\\n'));\n return `int64FromString(${arg})`;\n }\n Decimal128SymbolFromStringTemplate: &Decimal128SymbolFromStringTemplate !!js/function >\n () => ''\n Decimal128SymbolFromStringArgsTemplate: &Decimal128SymbolFromStringArgsTemplate !!js/function >\n (_, arg) => {\n this.declarations.addFunc([]\n .concat('var parseDecimal128 = func(str string) primitive.Decimal128 {')\n .concat(' d128, err := primitive.ParseDecimal128(str)')\n .concat(' if err != nil {')\n .concat(' log.Fatal(err)')\n .concat(' }')\n .concat(' return d128')\n .concat('}')\n .join('\\n'));\n return `parseDecimal128(${arg})`;\n }\n ObjectIdCreateFromHexStringTemplate: &ObjectIdCreateFromHexStringTemplate !!js/function >\n () => ''\n ObjectIdCreateFromHexStringArgsTemplate: &ObjectIdCreateFromHexStringArgsTemplate !!js/function >\n (_, arg) => {\n this.declarations.addFunc([]\n .concat('var objectIDFromHex = func(hex string) primitive.ObjectID {')\n .concat(` objectID, err := primitive.ObjectIDFromHex(hex)`)\n .concat(' if err != nil {')\n .concat(' log.Fatal(err)')\n .concat(' }')\n .concat(' return objectID')\n .concat('}')\n .join('\\n'));\n return `objectIDFromHex(${arg})`\n }\n ObjectIdCreateFromTimeTemplate: &ObjectIdCreateFromTimeTemplate !!js/function >\n () => 'primitive.NewObjectIDFromTimestamp'\n ObjectIdCreateFromTimeArgsTemplate: &ObjectIdCreateFromTimeArgsTemplate !!js/function >\n (_, arg, isNumber) => isNumber ? `(time.Unix(${arg}, int64(0)))` : `(${arg})`\n # non bson-specific would go here, but there aren't any atm.\n\n #############################################\n # Imports #\n # #\n # Each type has a 'code' that is consistent #\n # between languages. The import templates #\n # for each code generate the required #\n # statement for each type. No args. #\n # #\n # The ImportTemplate collects everything #\n # into one statement. #\n # #\n #############################################\n ImportTemplate: &ImportTemplate !!js/function >\n (args) => {\n const imports = Object.values(args).flat()\n const driverImports = args.driver || [];\n delete args['driver'];\n\n const flattenedArgs = Array.from(new Set([...driverImports, ...imports])).sort();\n const universal = [];\n const all = universal\n .concat(flattenedArgs)\n .map((i) => ` \"${i}\"`);\n return []\n .concat('import (')\n .concat(all.join('\\n'))\n .concat(')')\n .join('\\n');\n }\n DriverImportTemplate: &DriverImportTemplate !!js/function >\n () => {\n return [\n \"go.mongodb.org/mongo-driver/mongo\",\n \"go.mongodb.org/mongo-driver/mongo/options\",\n \"context\",\n \"log\"\n ]\n }\n 0ImportTemplate: &0ImportTemplate null\n 1ImportTemplate: &1ImportTemplate null\n 2ImportTemplate: &2ImportTemplate null\n 3ImportTemplate: &3ImportTemplate null\n 4ImportTemplate: &4ImportTemplate null\n 5ImportTemplate: &5ImportTemplate null\n 6ImportTemplate: &6ImportTemplate null\n 7ImportTemplate: &7ImportTemplate null\n 8ImportTemplate: &8ImportTemplate !!js/function >\n (args) => ['go.mongodb.org/mongo-driver/bson/primitive']\n 9ImportTemplate: &9ImportTemplate null\n 10ImportTemplate: &10ImportTemplate !!js/function >\n () => ['go.mongodb.org/mongo-driver/bson']\n 11ImportTemplate: &11ImportTemplate null\n 12ImportTemplate: &12ImportTemplate null\n 100ImportTemplate: &100ImportTemplate !!js/function >\n (args) => ['go.mongodb.org/mongo-driver/bson/primitive']\n 101ImportTemplate: &101ImportTemplate !!js/function >\n (args) => ['go.mongodb.org/mongo-driver/bson/primitive', 'log']\n 102ImportTemplate: &102ImportTemplate null\n 103ImportTemplate: &103ImportTemplate null\n 104ImportTemplate: &104ImportTemplate !!js/function >\n (args) => ['log', 'strconv']\n 105ImportTemplate: &105ImportTemplate !!js/function >\n (args) => ['log', 'strconv']\n 106ImportTemplate: &106ImportTemplate !!js/function >\n (args) => ['log', 'strconv']\n 107ImportTemplate: &107ImportTemplate !!js/function >\n (args) => ['go.mongodb.org/mongo-driver/bson/primitive']\n 108ImportTemplate: &108ImportTemplate !!js/function >\n (args) => ['go.mongodb.org/mongo-driver/bson/primitive']\n 109ImportTemplate: &109ImportTemplate !!js/function >\n (args) => ['go.mongodb.org/mongo-driver/bson/primitive']\n 110ImportTemplate: &110ImportTemplate !!js/function >\n (args) => ['go.mongodb.org/mongo-driver/bson/primitive']\n 111ImportTemplate: &111ImportTemplate !!js/function >\n (args) => ['go.mongodb.org/mongo-driver/bson/primitive']\n 112ImportTemplate: &112ImportTemplate !!js/function >\n (args) => ['go.mongodb.org/mongo-driver/bson/primitive', 'log']\n 113ImportTemplate: &113ImportTemplate null\n 114ImportTemplate: &114ImportTemplate null\n 200ImportTemplate: &200ImportTemplate !!js/function >\n (args) => ['time.Time']\n 201ImportTemplate: &201ImportTemplate null\n 300ImportTemplate: &300ImportTemplate null\n 301ImportTemplate: &301ImportTemplate null\n 302ImportTemplate: &302ImportTemplate null\n 303ImportTemplate: &303ImportTemplate null\n 304ImportTemplate: &304ImportTemplate null\n 305ImportTemplate: &305ImportTemplate null\n 306ImportTemplate: &306ImportTemplate null\n# Universal types\n# Everything inherits from StringType because we haven't implemented any of them.\nBasicTypes:\n # Universal basic types\n _bool: &BoolType\n <<: *__type\n id: \"_bool\"\n code: 0\n template: *BoolTypeTemplate\n _integer: &IntegerType\n <<: *__type\n id: \"_integer\"\n code: 1\n template: *IntegerTypeTemplate\n _long: &LongBasicType\n <<: *__type\n id: \"_long\"\n code: 2\n template: *LongBasicTypeTemplate\n _decimal: &DecimalType\n <<: *__type\n id: \"_decimal\"\n code: 3\n template: *DecimalTypeTemplate\n _hex: &HexType\n <<: *__type\n id: \"_hex\"\n code: 4\n template: *HexTypeTemplate\n _octal: &OctalType\n <<: *__type\n id: \"_octal\"\n code: 5\n template: *OctalTypeTemplate\n _numeric: &NumericType\n <<: *__type\n id: \"_numeric\"\n code: 6\n template: *NumericTypeTemplate\n _string: &StringType\n <<: *__type\n id: \"_string\"\n code: 7\n template: *StringTypeTemplate\n _regex: &RegexType\n <<: *__type\n id: \"_regex\"\n code: 8\n template: *RegexTypeTemplate\n _array: &ArrayType\n <<: *__type\n id: \"_array\"\n code: 9\n template: *ArrayTypeTemplate\n argsTemplate: *ArrayTypeArgsTemplate\n _object: &ObjectType\n <<: *__type\n id: \"_object\"\n code: 10\n template: *ObjectTypeTemplate\n argsTemplate: *ObjectTypeArgsTemplate\n _null: &NullType\n <<: *__type\n id: \"_null\"\n code: 11\n template: *NullTypeTemplate\n _undefined: &UndefinedType\n <<: *__type\n id: \"_undefined\"\n code: 12\n template: *UndefinedTypeTemplate\n\nSyntax:\n equality:\n template: *EqualitySyntaxTemplate\n in:\n template: *InSyntaxTemplate\n and:\n template: *AndSyntaxTemplate\n or:\n template: *OrSyntaxTemplate\n not:\n template: *NotSyntaxTemplate\n unary:\n template: *UnarySyntaxTemplate\n binary:\n template: *BinarySyntaxTemplate\n parens:\n template: *ParensSyntaxTemplate\n eos:\n template: *EosSyntaxTemplate\n eof:\n template: *EofSyntaxTemplate\n # The new template takes in expr, and an optional skip argument and optional\n # id argument. The skip argument is a boolean that if true then doesn't add\n # new. The code argument is the symbol code being called. The template will check\n # if it is an exception, i.e. a type that is a constructor but may not use new.\n new:\n template: *NewSyntaxTemplate\n # The regex flags that change symbols between languages can be defined here.\n # Flags that aren't defined can be left blank and will be ignored.\n regexFlags: *RegexFlags\n bsonRegexFlags: *BSONRegexFlags\n driver: *DriverTemplate\nImports:\n import:\n template: *ImportTemplate\n driver:\n template: *DriverImportTemplate\n 0:\n template: *0ImportTemplate\n 1:\n template: *1ImportTemplate\n 2:\n template: *2ImportTemplate\n 3:\n template: *3ImportTemplate\n 4:\n template: *4ImportTemplate\n 5:\n template: *5ImportTemplate\n 6:\n template: *6ImportTemplate\n 7:\n template: *7ImportTemplate\n 8:\n template: *8ImportTemplate\n 9:\n template: *9ImportTemplate\n 10:\n template: *10ImportTemplate\n 11:\n template: *11ImportTemplate\n 12:\n template: *12ImportTemplate\n 100:\n template: *100ImportTemplate\n 101:\n template: *101ImportTemplate\n 102:\n template: *102ImportTemplate\n 103:\n template: *103ImportTemplate\n 104:\n template: *104ImportTemplate\n 105:\n template: *105ImportTemplate\n 106:\n template: *106ImportTemplate\n 107:\n template: *107ImportTemplate\n 108:\n template: *108ImportTemplate\n 109:\n template: *109ImportTemplate\n 110:\n template: *110ImportTemplate\n 111:\n template: *111ImportTemplate\n 112:\n template: *112ImportTemplate\n 113:\n template: *113ImportTemplate\n 114:\n template: *114ImportTemplate\n 200:\n template: *200ImportTemplate\n 201:\n template: *201ImportTemplate\n 300:\n template: *300ImportTemplate\n 301:\n template: *301ImportTemplate\n 302:\n template: *302ImportTemplate\n 303:\n template: *303ImportTemplate\n 304:\n template: *304ImportTemplate\n 305:\n template: *305ImportTemplate\n 306:\n template: *306ImportTemplate\nBsonTypes:\n Code: &CodeType\n <<: *__type\n id: \"Code\"\n code: 100\n type: *ObjectType\n attr:\n code:\n callable: *var\n args: null\n attr: null\n id: \"code\"\n type: *StringType\n template: *CodeCodeTemplate\n argsTemplate: *CodeCodeArgsTemplate\n scope:\n callable: *var\n args: null\n attr: null\n id: \"scope\"\n type: *StringType\n template: *CodeScopeTemplate\n argsTemplate: *CodeScopeArgsTemplate\n ObjectId: &ObjectIdType\n <<: *__type\n id: \"ObjectId\"\n code: 101\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *ObjectIdToStringTemplate\n argsTemplate: *ObjectIdToStringArgsTemplate\n equals:\n <<: *__func\n id: \"equals\"\n args:\n - [ \"ObjectId\" ]\n type: *BoolType\n template: *ObjectIdEqualsTemplate\n argsTemplate: *ObjectIdEqualsArgsTemplate\n getTimestamp:\n <<: *__func\n id: \"getTimestamp\"\n type: *IntegerType\n template: *ObjectIdGetTimestampTemplate\n argsTemplate: *ObjectIdGetTimestampArgsTemplate\n BinData: &BinaryType\n <<: *__type\n id: \"BinData\"\n code: 102\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *BinaryToStringTemplate\n argsTemplate: *BinaryToStringArgsTemplate\n base64:\n <<: *__func\n id: \"base64\"\n type: *StringType\n template: *BinaryValueTemplate\n argsTemplate: *BinaryValueArgsTemplate\n length:\n <<: *__func\n id: \"length\"\n type: *IntegerType\n template: *BinaryLengthTemplate\n argsTemplate: *BinaryLengthArgsTemplate\n subtype:\n <<: *__func\n id: \"subtype\"\n type: *IntegerType\n template: *BinarySubtypeTemplate\n argsTemplate: *BinarySubtypeArgsTemplate\n DBRef: &DBRefType\n <<: *__type\n id: \"DBRef\"\n code: 103\n type: *ObjectType\n attr:\n getDb:\n <<: *__func\n id: \"getDb\"\n type: *StringType\n template: *DBRefGetDBTemplate\n argsTemplate: *DBRefGetDBArgsTemplate\n $db:\n callable: *var\n args: null\n attr: null\n id: \"$db\"\n type: *StringType\n template: *DBRefGetDBTemplate\n argsTemplate: *DBRefGetDBArgsTemplate\n getCollection:\n <<: *__func\n id: \"getCollection\"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n getRef:\n <<: *__func\n id: \"getRef\"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n $ref:\n callable: *var\n args: null\n attr: null\n id: \"$ref\"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n getId:\n <<: *__func\n id: \"getId\"\n type: *StringType\n template: *DBRefGetIdTemplate\n argsTemplate: *DBRefGetIdArgsTemplate\n $id:\n callable: *var\n args: null\n attr: null\n id: \"$id\"\n type: *StringType\n template: *DBRefGetIdTemplate\n argsTemplate: *DBRefGetIdArgsTemplate\n NumberInt: &Int32Type\n <<: *__type\n id: \"NumberInt\"\n code: 105\n type: *ObjectType\n attr: {}\n NumberLong: &LongType\n <<: *__type\n id: \"NumberLong\"\n code: 106\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"LongtoString\" # Needs process method\n args:\n - [ *IntegerType, null ]\n type: *StringType\n template: *LongToStringTemplate\n argsTemplate: *LongToStringArgsTemplate\n equals:\n <<: *__func\n id: \"equals\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongEqualsTemplate\n argsTemplate: *LongEqualsArgsTemplate\n toInt:\n <<: *__func\n id: \"toInt\"\n type: *IntegerType\n template: *LongToIntTemplate\n argsTemplate: *LongToIntArgsTemplate\n toNumber:\n <<: *__func\n id: \"toNumber\"\n type: *DecimalType\n template: *LongToNumberTemplate\n argsTemplate: *LongToNumberArgsTemplate\n compare:\n <<: *__func\n id: \"compare\"\n args:\n - [ \"Long\" ]\n type: *StringType\n template: *LongCompareTemplate\n argsTemplate: *LongCompareArgsTemplate\n isOdd:\n <<: *__func\n id: \"isOdd\"\n type: *BoolType\n template: *LongIsOddTemplate\n argsTemplate: *LongIsOddArgsTemplate\n isZero:\n <<: *__func\n id: \"isZero\"\n type: *BoolType\n template: *LongIsZeroTemplate\n argsTemplate: *LongIsZeroArgsTemplate\n isNegative:\n <<: *__func\n id: \"isNegative\"\n type: *BoolType\n template: *LongIsNegativeTemplate\n argsTemplate: *LongIsNegativeArgsTemplate\n negate:\n <<: *__func\n id: \"negate\"\n type: \"Long\"\n template: *LongNegateTemplate\n argsTemplate: *LongNegateArgsTemplate\n not:\n <<: *__func\n id: \"not\"\n type: \"Long\"\n template: *LongNotTemplate\n argsTemplate: *LongNotArgsTemplate\n notEquals:\n <<: *__func\n id: \"notEquals\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongNotEqualsTemplate\n argsTemplate: *LongNotEqualsArgsTemplate\n greaterThan:\n <<: *__func\n id: \"greaterThan\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongGreaterThanTemplate\n argsTemplate: *LongGreaterThanArgsTemplate\n greaterThanOrEqual:\n <<: *__func\n id: \"greaterThanOrEqual\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongGreaterThanOrEqualTemplate\n argsTemplate: *LongGreaterThanOrEqualArgsTemplate\n lessThan:\n <<: *__func\n id: \"lessThan\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongLessThanTemplate\n argsTemplate: *LongLessThanArgsTemplate\n lessThanOrEqual:\n <<: *__func\n id: \"lessThanOrEqual\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongLessThanOrEqualTemplate\n argsTemplate: *LongLessThanOrEqualArgsTemplate\n add:\n <<: *__func\n id: \"add\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongAddTemplate\n argsTemplate: *LongAddArgsTemplate\n subtract:\n <<: *__func\n id: \"subtract\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongSubtractTemplate\n argsTemplate: *LongSubtractArgsTemplate\n multiply:\n <<: *__func\n id: \"multiply\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongMultiplyTemplate\n argsTemplate: *LongMultiplyArgsTemplate\n div:\n <<: *__func\n id: \"div\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongDivTemplate\n argsTemplate: *LongDivArgsTemplate\n modulo:\n <<: *__func\n id: \"modulo\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongModuloTemplate\n argsTemplate: *LongModuloArgsTemplate\n and:\n <<: *__func\n id: \"and\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongAndTemplate\n argsTemplate: *LongAndArgsTemplate\n or:\n <<: *__func\n id: \"or\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongOrTemplate\n argsTemplate: *LongOrArgsTemplate\n xor:\n <<: *__func\n id: \"xor\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongXorTemplate\n argsTemplate: *LongXorArgsTemplate\n shiftLeft:\n <<: *__func\n id: \"shiftLeft\"\n args:\n - [ *IntegerType ]\n type: \"Long\"\n template: *LongShiftLeftTemplate\n argsTemplate: *LongShiftLeftArgsTemplate\n shiftRight:\n <<: *__func\n id: \"shiftRight\"\n args:\n - [ *IntegerType ]\n type: \"Long\"\n template: *LongShiftRightTemplate\n argsTemplate: *LongShiftRightArgsTemplate\n MinKeyType: &MinKeyType\n <<: *__type\n id: \"MinKey\"\n code: 107\n type: *ObjectType\n MaxKeyType: &MaxKeyType\n <<: *__type\n id: \"MaxKey\"\n code: 108\n type: *ObjectType\n Timestamp: &TimestampType\n <<: *__type\n id: \"Timestamp\"\n code: 110\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *TimestampToStringTemplate\n argsTemplate: *TimestampToStringArgsTemplate\n equals:\n <<: *__func\n id: \"equals\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampEqualsTemplate\n argsTemplate: *TimestampEqualsArgsTemplate\n getLowBits:\n <<: *__func\n id: \"getLowBits\"\n type: *IntegerType\n template: *TimestampGetLowBitsTemplate\n argsTemplate: *TimestampGetLowBitsArgsTemplate\n getHighBits:\n <<: *__func\n id: \"getHighBits\"\n type: *IntegerType\n template: *TimestampGetHighBitsTemplate\n argsTemplate: *TimestampGetHighBitsArgsTemplate\n compare:\n <<: *__func\n id: \"compare\"\n args:\n - [ \"Timestamp\" ]\n type: *StringType\n template: *TimestampCompareTemplate\n argsTemplate: *TimestampCompareArgsTemplate\n notEquals:\n <<: *__func\n id: \"notEquals\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampNotEqualsTemplate\n argsTemplate: *TimestampNotEqualsArgsTemplate\n greaterThan:\n <<: *__func\n id: \"greaterThan\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampGreaterThanTemplate\n argsTemplate: *TimestampGreaterThanArgsTemplate\n greaterThanOrEqual:\n <<: *__func\n id: \"greaterThanOrEqual\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampGreaterThanOrEqualTemplate\n argsTemplate: *TimestampGreaterThanOrEqualArgsTemplate\n lessThan:\n <<: *__func\n id: \"lessThan\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampLessThanTemplate\n argsTemplate: *TimestampLessThanArgsTemplate\n lessThanOrEqual:\n <<: *__func\n id: \"lessThanOrEqual\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampLessThanOrEqualTemplate\n argsTemplate: *TimestampLessThanOrEqualArgsTemplate\n BSONSymbol: &SymbolType\n <<: *__type\n id: \"BSONSymbol\"\n code: 111\n type: *ObjectType\n attr:\n valueOf:\n <<: *__func\n id: \"valueOf\"\n type: *StringType\n template: *SymbolValueOfTemplate\n argsTemplate: *SymbolValueOfArgsTemplate\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *SymbolToStringTemplate\n argsTemplate: *SymbolToStringArgsTemplate\n inspect:\n <<: *__func\n id: \"inspect\"\n type: *StringType\n template: *SymbolInspectTemplate\n argsTemplate: *SymbolInspectArgsTemplate\n Double: &DoubleType\n <<: *__type\n id: \"Double\"\n code: 104\n type: *ObjectType\n attr: {}\n Decimal128: &Decimal128Type\n <<: *__type\n id: \"Decimal128\"\n code: 112\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *Decimal128ToStringTemplate\n argsTemplate: *Decimal128ToStringArgsTemplate\n NumberDecimal: &NumberDecimalType\n <<: *__type\n id: \"NumberDecimal\"\n code: 112\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *Decimal128ToStringTemplate\n argsTemplate: *Decimal128ToStringArgsTemplate\n\n\n SUBTYPE_DEFAULT:\n id: \"SUBTYPE_DEFAULT\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeDefaultTemplate\n SUBTYPE_FUNCTION:\n id: \"SUBTYPE_FUNCTION\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeFunctionTemplate\n SUBTYPE_BYTE_ARRAY:\n id: \"SUBTYPE_BYTE_ARRAY\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeByteArrayTemplate\n SUBTYPE_UUID_OLD:\n id: \"SUBTYPE_UUID_OLD\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUuidOldTemplate\n SUBTYPE_UUID:\n id: \"SUBTYPE_UUID\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUuidTemplate\n SUBTYPE_MD5:\n id: \"SUBTYPE_MD5\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeMd5Template\n SUBTYPE_USER_DEFINED:\n id: \"SUBTYPE_USER_DEFINED\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUserDefinedTemplate\n BSONRegExpType: &BSONRegExpType\n <<: *__type\n id: \"BSONRegExp\"\n code: 109\n type: *ObjectType\nNativeTypes:\n Date: &DateType\n <<: *__type\n id: \"Date\"\n code: 200\n type: *ObjectType\n attr: {} # TODO: no built-in date methods added yet\n RegExp: &RegExpType\n <<: *__type\n id: \"RegExp\"\n code: 8\n type: *ObjectType\n attr: {}\n\n\nBsonSymbols:\n Code: &CodeSymbol\n id: \"Code\"\n code: 100\n callable: *constructor\n args:\n - [ *StringType, null ]\n - [ *ObjectType, null ]\n type: *CodeType\n attr: {}\n template: *CodeSymbolTemplate\n argsTemplate: *CodeSymbolArgsTemplate\n ObjectId: &ObjectIdSymbol\n id: \"ObjectId\"\n code: 101\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n type: *ObjectIdType\n attr:\n createFromHexString:\n <<: *__func\n id: \"createFromHexString\"\n args:\n - [ *StringType ]\n type: *ObjectIdType\n template: *ObjectIdCreateFromHexStringTemplate\n argsTemplate: *ObjectIdCreateFromHexStringArgsTemplate\n createFromTime:\n <<: *__func\n id: \"ObjectIdCreateFromTime\"\n args:\n - [ *NumericType, *DateType ]\n type: *ObjectIdType\n template: *ObjectIdCreateFromTimeTemplate\n argsTemplate: *ObjectIdCreateFromTimeArgsTemplate\n isValid:\n <<: *__func\n id: \"isValid\"\n args:\n - [ *StringType ]\n type: *BoolType\n template: *ObjectIdIsValidTemplate\n argsTemplate: *ObjectIdIsValidArgsTemplate\n template: *ObjectIdSymbolTemplate\n argsTemplate: *ObjectIdSymbolArgsTemplate\n BinData: &BinarySymbol\n id: \"BinData\"\n code: 102\n callable: *constructor\n args:\n - [ *IntegerType ]\n - [ *StringType ]\n type: *BinaryType\n attr: {}\n template: *BinarySymbolTemplate\n argsTemplate: *BinarySymbolArgsTemplate\n DBRef:\n id: \"DBRef\"\n code: 103\n callable: *constructor\n args:\n - [ *StringType ]\n - [ *ObjectIdType ]\n - [ *StringType, null ]\n type: *DBRefType\n attr: {}\n template: *DBRefSymbolTemplate\n argsTemplate: *DBRefSymbolArgsTemplate\n NumberInt:\n id: \"Int32\"\n code: 105\n callable: *constructor\n args:\n - [ *NumericType, *StringType, null ]\n type: *Int32Type\n attr: {}\n template: *Int32SymbolTemplate\n argsTemplate: *Int32SymbolArgsTemplate\n NumberLong:\n id: \"NumberLong\"\n code: 106\n callable: *constructor\n args:\n - [ *IntegerType, *StringType, null ]\n type: *LongType\n attr: {}\n template: *LongSymbolTemplate\n argsTemplate: *LongSymbolArgsTemplate\n MinKey:\n id: \"MinKey\"\n code: 107\n callable: *constructor\n args: []\n type: *MinKeyType\n attr: {}\n template: *MinKeySymbolTemplate\n argsTemplate: *MinKeySymbolArgsTemplate\n MaxKey:\n id: \"MaxKey\"\n code: 108\n callable: *constructor\n args: []\n type: *MaxKeyType\n attr: {}\n template: *MaxKeySymbolTemplate\n argsTemplate: *MaxKeySymbolArgsTemplate\n Timestamp:\n id: \"Timestamp\"\n code: 110\n callable: *constructor\n args:\n - [ *IntegerType, null ]\n - [ *IntegerType, null ]\n type: *TimestampType\n attr: {}\n template: *TimestampSymbolTemplate\n argsTemplate: *TimestampSymbolArgsTemplate\n Symbol:\n id: \"Symbol\"\n code: 111\n callable: *constructor\n args:\n - [ *StringType ]\n type: *SymbolType\n attr: {}\n template: *SymbolSymbolTemplate\n argsTemplate: *SymbolSymbolArgsTemplate\n NumberDecimal:\n id: \"NumberDecimal\"\n code: 112\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n type: *Decimal128Type\n attr: {}\n template: *Decimal128SymbolTemplate\n argsTemplate: *Decimal128SymbolArgsTemplate\n BSONRegExp:\n id: \"BSONRegExp\"\n code: 109\n callable: *constructor\n args:\n - [ *StringType ]\n - [ *StringType, null ]\n type: *BSONRegExpType\n attr: {}\n template: *BSONRegExpSymbolTemplate\n argsTemplate: *BSONRegExpSymbolArgsTemplate\n BSONSymbol:\n id: \"BSONSymbol\"\n code: 111\n callable: *constructor\n args:\n - [ *StringType ]\n type: *SymbolType\n attr: {}\n template: *SymbolSymbolTemplate\n argsTemplate: *SymbolSymbolArgsTemplate\n Decimal128:\n id: \"Decimal128\"\n code: 112\n callable: *constructor\n args:\n - [ *ObjectType ]\n type: *Decimal128Type\n attr:\n fromString:\n id: \"fromString\"\n callable: *func\n args:\n - [ *StringType ]\n type: *Decimal128Type\n attr: {}\n template: *Decimal128SymbolFromStringTemplate\n argsTemplate: *Decimal128SymbolFromStringArgsTemplate\n template: *Decimal128SymbolTemplate\n argsTemplate: *Decimal128SymbolArgsTemplate\n Double:\n id: \"Double\"\n code: 104\n callable: *constructor\n args:\n - [ *NumericType, *StringType ]\n type: *DoubleType\n attr: {}\n template: *DoubleSymbolTemplate\n argsTemplate: *DoubleSymbolArgsTemplate\n Int32:\n id: \"Int32\"\n code: 105\n callable: *constructor\n args:\n - [ *NumericType, *StringType ]\n type: *Int32Type\n attr: {}\n template: *Int32SymbolTemplate\n argsTemplate: *Int32SymbolArgsTemplate\n Long:\n id: \"Long\"\n code: 106\n callable: *constructor\n args:\n - [ *IntegerType ]\n - [ *IntegerType ]\n type: *LongType\n attr:\n MAX_VALUE:\n id: \"MAX_VALUE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolMaxTemplate\n argsTemplate: *LongSymbolMaxArgsTemplate\n MIN_VALUE:\n id: \"MIN_VALUE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolMinTemplate\n argsTemplate: *LongSymbolMinArgsTemplate\n ZERO:\n id: \"ZERO\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolZeroTemplate\n argsTemplate: *LongSymbolZeroArgsTemplate\n ONE:\n id: \"ONE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolOneTemplate\n argsTemplate: *LongSymbolOneArgsTemplate\n NEG_ONE:\n id: \"NEG_ONE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolNegOneTemplate\n argsTemplate: *LongSymbolNegOneArgsTemplate\n fromBits:\n id: \"LongfromBits\" # Needs process method\n callable: *func\n args:\n - [ *IntegerType ]\n - [ *IntegerType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromBitsTemplate\n argsTemplate: *LongSymbolFromBitsArgsTemplate\n fromInt:\n id: \"fromInt\"\n callable: *func\n args:\n - [ *IntegerType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromIntTemplate\n argsTemplate: *LongSymbolFromIntArgsTemplate\n fromNumber:\n id: \"fromNumber\"\n callable: *func\n args:\n - [ *NumericType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromNumberTemplate\n argsTemplate: *LongSymbolFromNumberArgsTemplate\n fromString:\n id: \"fromString\"\n callable: *func\n args:\n - [ *StringType ]\n - [ *IntegerType, null ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromStringTemplate\n argsTemplate: *LongSymbolFromStringArgsTemplate\n template: *LongSymbolTemplate\n argsTemplate: *LongSymbolArgsTemplate\n\nNativeSymbols:\n Number:\n id: \"Number\"\n code: 2\n callable: *constructor\n args:\n - [ *IntegerType, *StringType, null ]\n type: *NumericType\n attr: {} # TODO: no built-in number funcs added yet\n template: *NumberSymbolTemplate\n argsTemplate: *NumberSymbolArgsTemplate\n Date: # Needs emit method\n id: \"Date\"\n code: 200\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n type: *DateType\n attr: # TODO: add more date funcs?\n now:\n id: \"now\"\n code: 200.1\n callable: *func\n args: []\n type: *DateType\n attr: {}\n template: *DateSymbolNowTemplate\n argsTemplate: *DateSymbolNowArgsTemplate\n template: *DateSymbolTemplate\n argsTemplate: *DateSymbolArgsTemplate\n ISODate: # Needs emit method\n id: \"ISODate\"\n code: 200\n callable: *constructor\n args:\n - [ *StringType, null ]\n type: *DateType\n attr:\n now:\n id: \"now\"\n callable: *constructor\n args: []\n type: *DateType\n attr: {}\n template: *DateSymbolNowTemplate\n argsTemplate: *DateSymbolNowArgsTemplate\n template: *DateSymbolTemplate\n argsTemplate: *DateSymbolArgsTemplate\n RegExp: # Needs process method\n id: \"RegExp\"\n code: 8\n callable: *constructor\n args:\n - [ *StringType, *RegexType ]\n - [ *StringType, null ]\n type: *RegExpType\n attr: {} # TODO: no built-in regex funcs added yet\n template: *RegExpSymbolTemplate\n argsTemplate: *RegExpSymbolArgsTemplate\n\n"},493:e=>{e.exports="SymbolTypes:\n VAR: &var 0\n CONSTRUCTOR: &constructor 1\n FUNC: &func 2\n# Internal patterns to save typing\n__type: &__type\n id: null\n callable: *var\n args: null\n type: null\n attr: {}\n template: null\n argsTemplate: null\n__func: &__func\n callable: *func\n args: []\n attr: {}\n template: null\n argsTemplate: null\n\n# Java Templates\nTemplates:\n # Misc\n RegexFlags: &RegexFlags\n i: 'i'\n m: 'm'\n u: 'u'\n y: ''\n g: ''\n BSONRegexFlags: &BSONRegexFlags\n i: 'i'\n m: 'm'\n x: 'x'\n s: 's'\n l: 'l'\n u: 'u'\n # Syntax\n DriverTemplate: &DriverTemplate !!js/function >\n (spec) => {\n const comment = `/*\n * Requires the MongoDB Java Driver.\n * https://mongodb.github.io/mongo-java-driver`;\n\n const str = spec.options.uri;\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n const uri = `\"${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\"`;\n const exportMode = spec.exportMode;\n delete spec.exportMode;\n\n const connection = `MongoClient mongoClient = new MongoClient(\n new MongoClientURI(\n ${uri}\n )\n );\n\n MongoDatabase database = mongoClient.getDatabase(\"${spec.options.database}\");\n\n MongoCollection<Document> collection = database.getCollection(\"${spec.options.collection}\");`;\n\n let driverMethod;\n let driverResult;\n switch (exportMode) {\n case 'Delete Query':\n driverMethod = 'deleteMany';\n driverResult = 'DeleteResult';\n break;\n case 'Update Query':\n driverMethod = 'updateMany';\n driverResult = 'UpdateResult';\n break;\n default:\n driverMethod = 'find';\n driverResult = 'FindIterable<Document>';\n }\n if ('aggregation' in spec) {\n return `${comment}\\n */\\n\\n${connection}\n\n AggregateIterable<Document> result = collection.aggregate(${spec.aggregation});`;\n }\n\n let warning = '';\n const defs = Object.keys(spec).reduce((s, k) => {\n if (!spec[k]) return s;\n if (k === 'options' || k === 'maxTimeMS' || k === 'skip' || k === 'limit' || k === 'collation') return s;\n if (s === '') return `Bson ${k} = ${spec[k]};`;\n return `${s}\n Bson ${k} = ${spec[k]};`;\n }, '');\n\n const result = Object.keys(spec).reduce((s, k) => {\n switch (k) {\n case 'options':\n case 'filter':\n return s;\n case 'maxTimeMS':\n return `${s}\n .maxTime(${spec[k]}, TimeUnit.MICROSECONDS)`;\n case 'skip':\n case 'limit':\n return `${s}\n .${k}((int)${spec[k]})`;\n case 'project':\n return `${s}\n .projection(project)`;\n case 'collation':\n warning = '\\n *\\n * Warning: translating collation to Java not yet supported, so will be ignored';\n return s;\n case 'exportMode':\n return s;\n default:\n if (!spec[k]) return s;\n return `${s}\n .${k}(${k})`;\n }\n }, `${driverResult} result = collection.${driverMethod}(filter)`);\n\n return `${comment}${warning}\\n */\\n\\n${defs}\n\n ${connection}\n\n ${result};`;\n }\n EqualitySyntaxTemplate: &EqualitySyntaxTemplate !!js/function >\n (lhs, op, rhs) => {\n if (op.includes('!') || op.includes('not')) {\n return `${lhs} != ${rhs}`;\n } else if (op === '==' || op === '===' || op === 'is') {\n return `${lhs} == ${rhs}`;\n }\n return `${lhs} ${op} ${rhs}`;\n }\n InSyntaxTemplate: &InSyntaxTemplate !!js/function >\n (lhs, op, rhs) => {\n let str = '';\n if (op.includes('!') || op.includes('not')) {\n str = '!';\n }\n return `${str}${rhs}.contains(${lhs})`\n }\n AndSyntaxTemplate: &AndSyntaxTemplate !!js/function >\n (args) => {\n return args.join(' && ');\n }\n OrSyntaxTemplate: &OrSyntaxTemplate !!js/function >\n (args) => {\n return args.join(' || ');\n }\n NotSyntaxTemplate: &NotSyntaxTemplate !!js/function >\n (arg) => {\n return `!${arg}`;\n }\n UnarySyntaxTemplate: &UnarySyntaxTemplate null\n BinarySyntaxTemplate: &BinarySyntaxTemplate !!js/function >\n (args) => {\n return args.reduce((s, op, i, arr) => {\n if (i % 2 === 0) {\n return s;\n }\n const rhs = arr[i + 1];\n switch(op) {\n case '//':\n return `floor(${s})`;\n case '**':\n return `pow(${s}, ${rhs})`;\n default:\n return `${s} ${op} ${rhs}`;\n }\n }, args[0]);\n }\n ParensSyntaxTemplate: &ParensSyntaxTemplate null\n EosSyntaxTemplate: &EosSyntaxTemplate null\n EofSyntaxTemplate: &EofSyntaxTemplate null\n NewTemplate: &NewSyntaxTemplate !!js/function >\n (expr, skip, code) => {\n // Add codes of classes that don't need new.\n // Currently: Decimal128/NumberDecimal, Long/NumberLong, Double, Int32, Number, regex, Date\n noNew = [112, 106, 104, 105, 2, 8, 200];\n if (skip || (code && noNew.indexOf(code) !== -1)) {\n return expr;\n }\n return `new ${expr}`;\n }\n # BSON Object Type templates\n CodeTypeTemplate: &CodeTypeTemplate null\n StringTypeTemplate: &StringTypeTemplate !!js/function >\n (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `\"${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\"`;\n }\n RegexTypeTemplate: &RegexTypeTemplate !!js/function >\n (pattern, flags) => {\n flags = flags === '' ? '' : `(?${flags})`;\n // Double escape characters except for slashes\n const escaped = pattern.replace(/\\\\/, '\\\\\\\\');\n\n // Double-quote stringify\n const str = escaped + flags;\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `Pattern.compile(\"${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\")`;\n }\n BoolTypeTemplate: &BoolTypeTemplate !!js/function >\n (literal) => {\n return literal.toLowerCase();\n }\n IntegerTypeTemplate: &IntegerTypeTemplate null\n DecimalTypeTemplate: &DecimalTypeTemplate !!js/function >\n (literal, type) => {\n if (type === '_integer' || type === '_long' || type === '_decimal') {\n return `${literal}d`;\n }\n return `(double) ${literal}`;\n }\n LongBasicTypeTemplate: &LongBasicTypeTemplate !!js/function >\n (literal, type) => {\n if (type === '_integer' || type === '_long') {\n return `${literal}L`;\n }\n return `new Long(${literal})`;\n }\n HexTypeTemplate: &HexTypeTemplate null # TODO\n OctalTypeTemplate: &OctalTypeTemplate !!js/function >\n (literal, type) => {\n if ((literal.charAt(0) === '0' && literal.charAt(1) === '0') ||\n (literal.charAt(0) === '0' && (literal.charAt(1) === 'o' || literal.charAt(1) === 'O'))) {\n return `0${literal.substr(2, literal.length - 1)}`;\n }\n return literal;\n }\n NumericTypeTemplate: &NumericTypeTemplate null\n ArrayTypeTemplate: &ArrayTypeTemplate !!js/function >\n (literal, depth) => {\n depth++;\n // TODO: figure out how to best do depth in an array and where to\n // insert and indent\n const indent = '\\n' + ' '.repeat(depth);\n // have an indent on every ', new Document' in an array not\n // entirely perfect, but at least makes this more readable/also\n // compiles\n const arr = literal.split(', new').join(`, ${indent}new`)\n\n return `Arrays.asList(${arr})`;\n }\n ArrayTypeArgsTemplate: &ArrayTypeArgsTemplate null\n NullTypeTemplate: &NullTypeTemplate !!js/function >\n () => {\n return 'new BsonNull()';\n }\n UndefinedTypeTemplate: &UndefinedTypeTemplate !!js/function >\n () => {\n return 'new BsonUndefined()';\n }\n ObjectTypeTemplate: &ObjectTypeTemplate !!js/function >\n (literal, depth) => {\n\n if (literal === '') {\n return `new Document()`;\n }\n return literal;\n }\n ObjectTypeArgsTemplate: &ObjectTypeArgsTemplate !!js/function >\n (args, depth) => {\n if (args.length === 0) {\n return 'new Document()';\n }\n depth++;\n const indent = '\\n' + ' '.repeat(depth);\n const doubleStringify = (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `\"${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\"`;\n }\n const start = `new Document(${doubleStringify(args[0][0])}, ${args[0][1]})`;\n\n args = args.slice(1);\n const result = args.reduce((str, pair) => {\n return `${str}${indent}.append(${doubleStringify(pair[0])}, ${pair[1]})`;\n }, start);\n\n return `${result}`;\n }\n DoubleTypeTemplate: &DoubleTypeTemplate !!js/function >\n (literal, type) => {\n if (type === '_integer' || type === '_long' || type === '_decimal') {\n return `${literal}d`;\n }\n return `(double) ${literal}`;\n }\n DoubleTypeArgsTemplate: &DoubleTypeArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongTypeTemplate: &LongTemplate !!js/function >\n () => {\n return '';\n }\n LongTypeArgsTemplate: &LongSymbolArgsTemplate null\n # BSON Object Method templates\n ObjectIdToStringTemplate: &ObjectIdToStringTemplate !!js/function >\n (lhs) => {\n return `${lhs}.toHexString()`;\n }\n ObjectIdToStringArgsTemplate: &ObjectIdToStringArgsTemplate !!js/function >\n () => {\n return '';\n }\n ObjectIdEqualsTemplate: &ObjectIdEqualsTemplate null\n ObjectIdEqualsArgsTemplate: &ObjectIdEqualsArgsTemplate null\n ObjectIdGetTimestampTemplate: &ObjectIdGetTimestampTemplate !!js/function >\n (lhs) => {\n return `${lhs}.getTimestamp()`;\n }\n ObjectIdGetTimestampArgsTemplate: &ObjectIdGetTimestampArgsTemplate !!js/function >\n () => {\n return '';\n }\n CodeCodeTemplate: &CodeCodeTemplate !!js/function >\n (lhs) => {\n return `${lhs}.getCode()`;\n }\n CodeCodeArgsTemplate: &CodeCodeArgsTemplate null\n CodeScopeTemplate: &CodeScopeTemplate !!js/function >\n (lhs) => {\n return `${lhs}.getScope()`;\n }\n CodeScopeArgsTemplate: &CodeScopeArgsTemplate null\n BinaryValueTemplate: &BinaryValueTemplate !!js/function >\n (lhs) => {\n return `${lhs}.getData`;\n }\n BinaryValueArgsTemplate: &BinaryValueArgsTemplate null\n BinaryLengthTemplate: &BinaryLengthTemplate null\n BinaryLengthArgsTemplate: &BinaryLengthArgsTemplate null\n BinaryToStringTemplate: &BinaryToStringTemplate null\n BinaryToStringArgsTemplate: &BinaryToStringArgsTemplate null\n BinarySubtypeTemplate: &BinarySubtypeTemplate !!js/function >\n (lhs) => {\n return `${lhs}.getType()`;\n }\n BinarySubtypeArgsTemplate: &BinarySubtypeArgsTemplate !!js/function >\n () => {\n return '';\n }\n DBRefGetDBTemplate: &DBRefGetDBTemplate !!js/function >\n (lhs) => {\n return `${lhs}.getDatabaseName()`;\n }\n DBRefGetDBArgsTemplate: &DBRefGetDBArgsTemplate !!js/function >\n () => {\n return '';\n }\n DBRefGetCollectionTemplate: &DBRefGetCollectionTemplate !!js/function >\n (lhs) => {\n return `${lhs}.getCollectionName()`;\n }\n DBRefGetCollectionArgsTemplate: &DBRefGetCollectionArgsTemplate !!js/function >\n () => {\n return '';\n }\n DBRefGetIdTemplate: &DBRefGetIdTemplate !!js/function >\n (lhs) => {\n return `${lhs}.getId()`;\n }\n DBRefGetIdArgsTemplate: &DBRefGetIdArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongEqualsTemplate: &LongEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} ==`;\n }\n LongEqualsArgsTemplate: &LongEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongToStringTemplate: &LongToStringTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n LongToStringArgsTemplate: &LongToStringArgsTemplate null\n LongToIntTemplate: &LongToIntTemplate !!js/function >\n (lhs) => {\n return `(int) ${lhs}`;\n }\n LongToIntArgsTemplate: &LongToIntArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongToNumberTemplate: &LongToNumberTemplate !!js/function >\n (lhs) => {\n return `(double) ${lhs}`;\n }\n LongToNumberArgsTemplate: &LongToNumberArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongAddTemplate: &LongAddTemplate !!js/function >\n (lhs) => {\n return `${lhs} +`;\n }\n LongAddArgsTemplate: &LongAddArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongSubtractTemplate: &LongSubtractTemplate !!js/function >\n (arg) => {\n return `${arg} -`;\n }\n LongSubtractArgsTemplate: &LongSubtractArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongMultiplyTemplate: &LongMultiplyTemplate !!js/function >\n (arg) => {\n return `${arg} *`;\n }\n LongMultiplyArgsTemplate: &LongMultiplyArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongDivTemplate: &LongDivTemplate !!js/function >\n (lhs) => {\n return `${lhs} /`;\n }\n LongDivArgsTemplate: &LongDivArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongModuloTemplate: &LongModuloTemplate !!js/function >\n (lhs) => {\n return `${lhs} %`;\n }\n LongModuloArgsTemplate: &LongModuloArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongAndTemplate: &LongAndTemplate !!js/function >\n (lhs) => {\n return `${lhs} &`;\n }\n LongAndArgsTemplate: &LongAndArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongOrTemplate: &LongOrTemplate !!js/function >\n (lhs) => {\n return `${lhs} |`;\n }\n LongOrArgsTemplate: &LongOrArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongXorTemplate: &LongXorTemplate !!js/function >\n (lhs) => {\n return `${lhs} ^`;\n }\n LongXorArgsTemplate: &LongXorArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongShiftLeftTemplate: &LongShiftLeftTemplate !!js/function >\n () => {\n return 'Long.rotateLeft';\n }\n LongShiftLeftArgsTemplate: &LongShiftLeftArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(${lhs}, ${arg})`;\n }\n LongShiftRightTemplate: &LongShiftRightTemplate !!js/function >\n () => {\n return 'Long.rotateRight';\n }\n LongShiftRightArgsTemplate: &LongShiftRightArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(${lhs}, ${arg})`;\n }\n LongCompareTemplate: &LongCompareTemplate !!js/function >\n (lhs) => {\n return `${lhs} -`;\n }\n LongCompareArgsTemplate: &LongCompareArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongIsOddTemplate: &LongIsOddTemplate !!js/function >\n (lhs) => {\n return `(${lhs} % 2) == 1`;\n }\n LongIsOddArgsTemplate: &LongIsOddArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongIsZeroTemplate: &LongIsZeroTemplate !!js/function >\n (lhs) => {\n return `${lhs} == 0`;\n }\n LongIsZeroArgsTemplate: &LongIsZeroArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongIsNegativeTemplate: &LongIsNegativeTemplate !!js/function >\n (lhs) => {\n return `${lhs} < 0`;\n }\n LongIsNegativeArgsTemplate: &LongIsNegativeArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongNegateTemplate: &LongNegateTemplate !!js/function >\n () => {\n return '-';\n }\n LongNegateArgsTemplate: &LongNegateArgsTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n LongNotTemplate: &LongNotTemplate !!js/function >\n () => {\n return '~';\n }\n LongNotArgsTemplate: &LongNotArgsTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n LongNotEqualsTemplate: &LongNotEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} !=`;\n }\n LongNotEqualsArgsTemplate: &LongNotEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanTemplate: &LongGreaterThanTemplate !!js/function >\n (lhs) => {\n return `${lhs} >`;\n }\n LongGreaterThanArgsTemplate: &LongGreaterThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanOrEqualTemplate: &LongGreaterThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs} >=`;\n }\n LongGreaterThanOrEqualArgsTemplate: &LongGreaterThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanTemplate: &LongLessThanTemplate !!js/function >\n (lhs) => {\n return `${lhs} <`;\n }\n LongLessThanArgsTemplate: &LongLessThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanOrEqualTemplate: &LongLessThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs} <=`;\n }\n LongLessThanOrEqualArgsTemplate: &LongLessThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongFloatApproxTemplate: &LongFloatApproxTemplate !!js/function >\n (lhs) => {\n return `(float) ${lhs}`;\n }\n LongTopTemplate: &LongTopTemplate !!js/function >\n (lhs) => {\n return `${lhs} >> 32`;\n }\n LongBottomTemplate: &LongBottomTemplate !!js/function >\n (lhs) => {\n return `${lhs} & 0x0000ffff`;\n }\n TimestampToStringTemplate: &TimestampToStringTemplate null\n TimestampToStringArgsTemplate: &TimestampToStringArgsTemplate null\n TimestampEqualsTemplate: &TimestampEqualsTemplate null\n TimestampEqualsArgsTemplate: &TimestampEqualsArgsTemplate null\n TimestampGetLowBitsTemplate: &TimestampGetLowBitsTemplate !!js/function >\n (lhs) => {\n return `${lhs}.getTime`;\n }\n TimestampGetLowBitsArgsTemplate: &TimestampGetLowBitsArgsTemplate null\n TimestampGetHighBitsTemplate: &TimestampGetHighBitsTemplate !!js/function >\n (lhs) => {\n return `${lhs}.getInc`;\n }\n TimestampGetHighBitsArgsTemplate: &TimestampGetHighBitsArgsTemplate null\n TimestampTTemplate: &TimestampTTemplate !!js/function >\n (lhs) => {\n return `${lhs}.getTime()`;\n }\n TimestampITemplate: &TimestampITemplate !!js/function >\n (lhs) => {\n return `${lhs}.getInc()`;\n }\n TimestampAsDateTemplate: &TimestampAsDateTemplate !!js/function >\n (lhs) => {\n return `new java.util.Date(${lhs}.getTime())`;\n }\n TimestampAsDateArgsTemplate: &TimestampAsDateArgsTemplate !!js/function >\n () => {\n return '';\n }\n TimestampCompareTemplate: &TimestampCompareTemplate !!js/function >\n (lhs) => {\n return `${lhs}.compareTo`;\n }\n TimestampCompareArgsTemplate: &TimestampCompareArgsTemplate null\n TimestampNotEqualsTemplate: &TimestampNotEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs}.compareTo`;\n }\n TimestampNotEqualsArgsTemplate: &TimestampNotEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(${arg}) != 0`;\n }\n TimestampGreaterThanTemplate: &TimestampGreaterThanTemplate !!js/function >\n (lhs) => {\n return `${lhs}.compareTo`;\n }\n TimestampGreaterThanArgsTemplate: &TimestampGreaterThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(${arg}) > 0`;\n }\n TimestampGreaterThanOrEqualTemplate: &TimestampGreaterThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs}.compareTo`;\n }\n TimestampGreaterThanOrEqualArgsTemplate: &TimestampGreaterThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(${arg}) >= 0`;\n }\n TimestampLessThanTemplate: &TimestampLessThanTemplate !!js/function >\n (lhs) => {\n return `${lhs}.compareTo`;\n }\n TimestampLessThanArgsTemplate: &TimestampLessThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(${arg}) < 0`;\n }\n TimestampLessThanOrEqualTemplate: &TimestampLessThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs}.compareTo`;\n }\n TimestampLessThanOrEqualArgsTemplate: &TimestampLessThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(${arg}) <= 0`;\n }\n SymbolValueOfTemplate: &SymbolValueOfTemplate !!js/function >\n (lhs) => {\n return `${lhs}.getSymbol`;\n }\n SymbolValueOfArgsTemplate: &SymbolValueOfArgsTemplate null\n SymbolInspectTemplate: &SymbolInspectTemplate !!js/function >\n (lhs) => {\n return `${lhs}.getSymbol`;\n }\n SymbolInspectArgsTemplate: &SymbolInspectArgsTemplate null\n SymbolToStringTemplate: &SymbolToStringTemplate !!js/function >\n (lhs) => {\n return `${lhs}.toString`;\n }\n SymbolToStringArgsTemplate: &SymbolToStringArgsTemplate null\n # Symbol Templates\n CodeSymbolTemplate: &CodeSymbolTemplate !!js/function > # Also has process method\n () => {\n return 'Code';\n }\n CodeSymbolArgsTemplate: &CodeSymbolArgsTemplate !!js/function > # Also has process method\n (lhs, code, scope) => {\n // Double quote stringify\n let newStr = code === undefined ? '' : code;\n const str = newStr;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n code = `\"${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\"`;\n return (scope === undefined) ? `(${code})` : `WithScope(${code}, ${scope})`;\n }\n ObjectIdSymbolTemplate: &ObjectIdSymbolTemplate null\n ObjectIdSymbolArgsTemplate: &ObjectIdSymbolArgsTemplate !!js/function >\n (lhs, str) => {\n if (!str || str.length === 0) {\n return '()';\n }\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `(\"${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\")`;\n }\n BinarySymbolTemplate: &BinarySymbolTemplate null\n BinarySymbolArgsTemplate: &BinarySymbolArgsTemplate !!js/function >\n (lhs, bytes, type) => {\n const str = bytes;\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n bytes = `\"${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\"`;\n\n if (type === null) {\n return `(${bytes}.getBytes(\"UTF-8\"))`;\n }\n return `(${type}, ${bytes}.getBytes(\"UTF-8\"))`;\n }\n BinarySymbolSubtypeDefaultTemplate: &BinarySymbolSubtypeDefaultTemplate !!js/function >\n () => {\n return 'BsonBinarySubType.BINARY';\n }\n BinarySymbolSubtypeFunctionTemplate: &BinarySymbolSubtypeFunctionTemplate !!js/function >\n () => {\n return 'BsonBinarySubType.FUNCTION';\n }\n BinarySymbolSubtypeByteArrayTemplate: &BinarySymbolSubtypeByteArrayTemplate !!js/function >\n () => {\n return 'BsonBinarySubType.BINARY';\n }\n BinarySymbolSubtypeUuidOldTemplate: &BinarySymbolSubtypeUuidOldTemplate !!js/function >\n () => {\n return 'BsonBinarySubType.UUID_LEGACY';\n }\n BinarySymbolSubtypeUuidTemplate: &BinarySymbolSubtypeUuidTemplate !!js/function >\n () => {\n return 'BsonBinarySubType.UUID_STANDARD';\n }\n BinarySymbolSubtypeMd5Template: &BinarySymbolSubtypeMd5Template !!js/function >\n () => {\n return 'BsonBinarySubType.MD5';\n }\n BinarySymbolSubtypeUserDefinedTemplate: &BinarySymbolSubtypeUserDefinedTemplate !!js/function >\n () => {\n return 'BsonBinarySubType.USER_DEFINED';\n }\n DBRefSymbolTemplate: &DBRefSymbolTemplate null\n DBRefSymbolArgsTemplate: &DBRefSymbolArgsTemplate !!js/function >\n (lhs, coll, id, db) => {\n const dbstr = db === undefined ? '' : `${db}, `;\n return `(${dbstr}${coll}, ${id})`;\n }\n DoubleSymbolTemplate: &DoubleSymbolTemplate !!js/function >\n () => {\n return '';\n }\n DoubleSymbolArgsTemplate: &DoubleSymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n if (type === '_string') {\n return `Double.parseDouble(${arg})`;\n }\n if (type === '_integer' || type === '_long' || type === '_double' || type === '_decimal') {\n if (arg.includes('L') || arg.includes('d')) {\n return `${arg.substr(0, arg.length - 1)}d`;\n }\n return `${arg}d`;\n }\n return `(double) ${arg}`;\n }\n Int32SymbolTemplate: &Int32SymbolTemplate !!js/function >\n () => {\n return '';\n }\n Int32SymbolArgsTemplate: &Int32SymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n if (type === '_string') {\n return `Integer.parseInt(${arg})`;\n }\n if (type === '_integer' || type === '_long') {\n if (arg.includes('L') || arg.includes('d')) {\n return arg.substr(0, arg.length - 1);\n }\n return arg;\n }\n return `(int) ${arg}`;\n }\n LongSymbolTemplate: &LongSymbolTemplate !!js/function >\n () => {\n return '';\n }\n LongSymbolArgsTemplate: &LongSymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n if (type === '_string') {\n return `Long.parseLong(${arg})`;\n }\n if (type === '_integer' || type === '_long') {\n if (arg.includes('d') || arg.includes('L')) {\n return `${arg.substr(0, arg.length - 1)}L`;\n }\n return `${arg}L`;\n }\n return `new Long(${arg})`;\n }\n LongSymbolMaxTemplate: &LongSymbolMaxTemplate !!js/function >\n () => {\n return 'Long.MAX_VALUE';\n }\n LongSymbolMaxArgsTemplate: &LongSymbolMaxArgsTemplate null\n LongSymbolMinTemplate: &LongSymbolMinTemplate !!js/function >\n () => {\n return 'Long.MIN_VALUE';\n }\n LongSymbolMinArgsTemplate: &LongSymbolMinArgsTemplate null\n LongSymbolZeroTemplate: &LongSymbolZeroTemplate !!js/function >\n () => {\n return '0L';\n }\n LongSymbolZeroArgsTemplate: &LongSymbolZeroArgsTemplate null\n LongSymbolOneTemplate: &LongSymbolOneTemplate !!js/function >\n () => {\n return '1L';\n }\n LongSymbolOneArgsTemplate: &LongSymbolOneArgsTemplate null\n LongSymbolNegOneTemplate: &LongSymbolNegOneTemplate !!js/function >\n () => {\n return '-1L';\n }\n LongSymbolNegOneArgsTemplate: &LongSymbolNegOneArgsTemplate null\n LongSymbolFromBitsTemplate: &LongSymbolFromBitsTemplate !!js/function > # Also has process method\n () => {\n return '';\n }\n LongSymbolFromBitsArgsTemplate: &LongSymbolFromBitsArgsTemplate null\n LongSymbolFromIntTemplate: &LongSymbolFromIntTemplate !!js/function >\n () => {\n return '';\n }\n LongSymbolFromIntArgsTemplate: &LongSymbolFromIntArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}L`;\n }\n LongSymbolFromNumberTemplate: &LongSymbolFromNumberTemplate !!js/function >\n () => {\n return '';\n }\n LongSymbolFromNumberArgsTemplate: &LongSymbolFromNumberArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}L`;\n }\n LongSymbolFromStringTemplate: &LongSymbolFromStringTemplate !!js/function >\n (lhs) => {\n return `Long.parseLong`;\n }\n LongSymbolFromStringArgsTemplate: &LongSymbolFromStringArgsTemplate null\n MinKeySymbolTemplate: &MinKeySymbolTemplate null\n MinKeySymbolArgsTemplate: &MinKeySymbolArgsTemplate null\n MaxKeySymbolTemplate: &MaxKeySymbolTemplate null\n MaxKeySymbolArgsTemplate: &MaxKeySymbolArgsTemplate null\n TimestampSymbolTemplate: &TimestampSymbolTemplate !!js/function >\n () => {\n return 'BSONTimestamp';\n }\n TimestampSymbolArgsTemplate: &TimestampSymbolArgsTemplate !!js/function >\n (lhs, arg1, arg2) => {\n return `(${arg1 === undefined ? 0 : arg1}, ${arg2 === undefined ? 0 : arg2})`;\n }\n SymbolSymbolTemplate: &SymbolSymbolTemplate !!js/function >\n () => {\n return 'Symbol';\n }\n SymbolSymbolArgsTemplate: &SymbolSymbolArgsTemplate null\n BSONRegExpSymbolTemplate: &BSONRegExpSymbolTemplate !!js/function >\n () => {\n return 'BsonRegularExpression';\n }\n BSONRegExpSymbolArgsTemplate: &BSONRegExpSymbolArgsTemplate !!js/function >\n (lhs, pattern, flags) => {\n const doubleStringify = (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `\"${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\"`;\n }\n return `(${doubleStringify(pattern)}${flags ? ', ' + doubleStringify(flags) : ''})`;\n }\n Decimal128SymbolTemplate: &Decimal128SymbolTemplate !!js/function >\n () => {\n return 'Decimal128';\n }\n Decimal128SymbolArgsTemplate: &Decimal128SymbolArgsTemplate !!js/function >\n (_, str) => { // just stringify\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `.parse(\"${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\")`;\n }\n Decimal128SymbolFromStringTemplate: &Decimal128SymbolFromStringTemplate !!js/function >\n (lhs) => {\n return `${lhs}.parse`;\n }\n Decimal128SymbolFromStringArgsTemplate: &Decimal128SymbolFromStringArgsTemplate null\n Decimal128ToStringTemplate: &Decimal128ToStringTemplate null\n Decimal128ToStringArgsTemplate: &Decimal128ToStringArgsTemplate null\n # BSON Util Templates\n ObjectIdCreateFromHexStringTemplate: &ObjectIdCreateFromHexStringTemplate !!js/function >\n () => {\n return 'new ObjectId';\n }\n ObjectIdCreateFromHexStringArgsTemplate: &ObjectIdCreateFromHexStringArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(${arg})`;\n }\n ObjectIdCreateFromTimeTemplate: &ObjectIdCreateFromTimeTemplate !!js/function >\n () => {\n return 'new ObjectId';\n }\n ObjectIdCreateFromTimeArgsTemplate: &ObjectIdCreateFromTimeArgsTemplate !!js/function >\n (lhs, arg, isNumber) => {\n if (isNumber) {\n return `(new java.util.Date(${arg.replace(/L$/, '000L')}))`;\n }\n return `(${arg})`;\n }\n ObjectIdIsValidTemplate: &ObjectIdIsValidTemplate !!js/function >\n () => {\n return 'ObjectId.isValid';\n }\n ObjectIdIsValidArgsTemplate: &ObjectIdIsValidArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(${arg})`;\n }\n # JS Symbol Templates\n NumberSymbolTemplate: &NumberSymbolTemplate !!js/function >\n () => {\n return '';\n }\n NumberSymbolArgsTemplate: &NumberSymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n if (type === '_string') {\n return `Double.parseDouble(${arg})`;\n }\n if (type === '_integer' || type === '_long' || type === '_decimal') {\n if (arg.includes('L') || arg.includes('d')) {\n return `${arg.substr(0, arg.length - 1)}d`;\n }\n return `${arg}d`;\n }\n return `(double) ${arg}`;\n }\n DateSymbolTemplate: &DateSymbolTemplate !!js/function >\n () => {\n return 'java.util.Date';\n }\n DateSymbolArgsTemplate: &DateSymbolArgsTemplate !!js/function >\n (lhs, date, isString) => {\n let toStr = (d) => d;\n if (isString) {\n toStr = (d) => `new SimpleDateFormat(\"EEE MMMMM dd yyyy HH:mm:ss\").format(${d})`;\n }\n if (date === null) {\n return toStr(`new ${lhs}()`);\n }\n return toStr(`new ${lhs}(${date.getTime()}L)`);\n }\n DateSymbolNowTemplate: &DateSymbolNowTemplate !!js/function >\n () => {\n return '';\n }\n DateSymbolNowArgsTemplate: &DateSymbolNowArgsTemplate !!js/function >\n () => {\n return 'new java.util.Date().getTime()';\n }\n RegExpSymbolTemplate: &RegExpSymbolTemplate !!js/function >\n () => {\n return 'Pattern';\n }\n RegExpSymbolArgsTemplate: &RegExpSymbolArgsTemplate null\n ImportTemplate: &ImportTemplate null\n DriverImportTemplate: &DriverImportTemplate !!js/function >\n (_, mode) => {\n let imports = 'import com.mongodb.MongoClient;\\n' +\n 'import com.mongodb.MongoClientURI;\\n' +\n 'import com.mongodb.client.MongoCollection;\\n' +\n 'import com.mongodb.client.MongoDatabase;\\n' +\n 'import org.bson.conversions.Bson;\\n' +\n 'import java.util.concurrent.TimeUnit;\\n' +\n 'import org.bson.Document;\\n';\n if (mode === 'Query') {\n imports += 'import com.mongodb.client.FindIterable;';\n } else if (mode === 'Pipeline') {\n imports += 'import com.mongodb.client.AggregateIterable;';\n } else if (mode === 'Delete Query') {\n imports += 'import com.mongodb.client.result.DeleteResult;';\n }\n return imports;\n }\n 0ImportTemplate: &0ImportTemplate null\n 1ImportTemplate: &1ImportTemplate null\n 2ImportTemplate: &2ImportTemplate null\n 3ImportTemplate: &3ImportTemplate null\n 4ImportTemplate: &4ImportTemplate null\n 5ImportTemplate: &5ImportTemplate null\n 6ImportTemplate: &6ImportTemplate null\n 7ImportTemplate: &7ImportTemplate null\n 8ImportTemplate: &8ImportTemplate !!js/function >\n () => {\n return 'import java.util.regex.Pattern;';\n }\n 9ImportTemplate: &9ImportTemplate !!js/function >\n () => {\n return 'import java.util.Arrays;';\n }\n 10ImportTemplate: &10ImportTemplate !!js/function >\n () => {\n return 'import org.bson.Document;';\n }\n 11ImportTemplate: &11ImportTemplate !!js/function >\n () => {\n return 'import org.bson.BsonNull;';\n }\n 12ImportTemplate: &12ImportTemplate !!js/function >\n () => {\n return 'import org.bson.BsonUndefined;';\n }\n 100ImportTemplate: &100ImportTemplate !!js/function >\n () => {\n return 'import org.bson.types.Code;';\n }\n 113ImportTemplate: &113ImportTemplate !!js/function >\n () => {\n return 'import org.bson.types.CodeWithScope;';\n }\n 101ImportTemplate: &101ImportTemplate !!js/function >\n () => {\n return 'import org.bson.types.ObjectId;';\n }\n 102ImportTemplate: &102ImportTemplate !!js/function >\n () => {\n return 'import org.bson.types.Binary;';\n }\n 103ImportTemplate: &103ImportTemplate !!js/function >\n () => {\n return 'import com.mongodb.DBRef;';\n }\n 104ImportTemplate: &104ImportTemplate null\n 105ImportTemplate: &105ImportTemplate null\n 106ImportTemplate: &106ImportTemplate null\n 107ImportTemplate: &107ImportTemplate !!js/function >\n () => {\n return 'import org.bson.types.MinKey;';\n }\n 108ImportTemplate: &108ImportTemplate !!js/function >\n () => {\n return 'import org.bson.types.MaxKey;';\n }\n 109ImportTemplate: &109ImportTemplate !!js/function >\n () => {\n return 'import org.bson.BsonRegularExpression;';\n }\n 110ImportTemplate: &110ImportTemplate !!js/function >\n () => {\n return 'import org.bson.types.BSONTimestamp;';\n }\n 111ImportTemplate: &111ImportTemplate !!js/function >\n () => {\n return 'import org.bson.types.Symbol;';\n }\n 112ImportTemplate: &112ImportTemplate !!js/function >\n () => {\n return 'import org.bson.types.Decimal128;';\n }\n 114ImportTemplate: &114ImportTemplate !!js/function >\n () => {\n return 'import org.bson.BsonBinarySubType;';\n }\n 200ImportTemplate: &200ImportTemplate null\n 201ImportTemplate: &201ImportTemplate !!js/function >\n () => {\n return 'import java.text.SimpleDateFormat;';\n }\n 300ImportTemplate: &300ImportTemplate !!js/function >\n (classes) => {\n return classes\n .filter((f, i) => (classes.indexOf(f) === i && f !== 'options'))\n .sort()\n .map((c) => {\n return `import static com.mongodb.client.model.Filters.${c};`;\n }).join('\\n');\n }\n 301ImportTemplate: &301ImportTemplate !!js/function >\n (classes) => {\n return classes\n .filter((f, i) => (classes.indexOf(f) === i))\n .sort()\n .map((c) => {\n return `import static com.mongodb.client.model.Aggregates.${c};`;\n }).join('\\n');\n }\n 302ImportTemplate: &302ImportTemplate !!js/function >\n (classes) => {\n return classes\n .filter((f, i) => (classes.indexOf(f) === i))\n .sort()\n .map((c) => {\n return `import static com.mongodb.client.model.Accumulators.${c};`;\n }).join('\\n');\n }\n 303ImportTemplate: &303ImportTemplate !!js/function >\n (classes) => {\n return classes\n .filter((f, i) => (classes.indexOf(f) === i))\n .sort()\n .map((c) => {\n return `import static com.mongodb.client.model.Projections.${c};`;\n }).join('\\n');\n }\n 304ImportTemplate: &304ImportTemplate !!js/function >\n (classes) => {\n return classes\n .filter((f, i) => (classes.indexOf(f) === i))\n .sort()\n .map((c) => {\n return `import static com.mongodb.client.model.Sorts.${c};`;\n }).join('\\n');\n }\n 305ImportTemplate: &305ImportTemplate !!js/function >\n (classes) => {\n return classes\n .filter((f, i) => (classes.indexOf(f) === i))\n .sort()\n .map((c) => {\n return `import com.mongodb.client.model.geojson.${c};`;\n }).join('\\n');\n }\n 306ImportTemplate: &306ImportTemplate !!js/function >\n (classes) => {\n return classes\n .filter((f, i) => (classes.indexOf(f) === i))\n .sort()\n .map((c) => {\n return `import com.mongodb.client.model.${c};`;\n }).join('\\n');\n }\n# Universal types\n# Everything inherits from StringType because we haven't implemented any of them.\nBasicTypes:\n # Universal basic types\n _bool: &BoolType\n <<: *__type\n id: \"_bool\"\n code: 0\n template: *BoolTypeTemplate\n _integer: &IntegerType\n <<: *__type\n id: \"_integer\"\n code: 1\n template: *IntegerTypeTemplate\n _long: &LongBasicType\n <<: *__type\n id: \"_long\"\n code: 2\n template: *LongBasicTypeTemplate\n _decimal: &DecimalType\n <<: *__type\n id: \"_decimal\"\n code: 3\n template: *DecimalTypeTemplate\n _hex: &HexType\n <<: *__type\n id: \"_hex\"\n code: 4\n template: *HexTypeTemplate\n _octal: &OctalType\n <<: *__type\n id: \"_octal\"\n code: 5\n template: *OctalTypeTemplate\n _numeric: &NumericType\n <<: *__type\n id: \"_numeric\"\n code: 6\n template: *NumericTypeTemplate\n _string: &StringType\n <<: *__type\n id: \"_string\"\n code: 7\n template: *StringTypeTemplate\n _regex: &RegexType\n <<: *__type\n id: \"_regex\"\n code: 8\n template: *RegexTypeTemplate\n _array: &ArrayType\n <<: *__type\n id: \"_array\"\n code: 9\n template: *ArrayTypeTemplate\n argsTemplate: *ArrayTypeArgsTemplate\n _object: &ObjectType\n <<: *__type\n id: \"_object\"\n code: 10\n template: *ObjectTypeTemplate\n argsTemplate: *ObjectTypeArgsTemplate\n _null: &NullType\n <<: *__type\n id: \"_null\"\n code: 11\n template: *NullTypeTemplate\n _undefined: &UndefinedType\n <<: *__type\n id: \"_undefined\"\n code: 12\n template: *UndefinedTypeTemplate\n\nSyntax:\n equality:\n template: *EqualitySyntaxTemplate\n in:\n template: *InSyntaxTemplate\n and:\n template: *AndSyntaxTemplate\n or:\n template: *OrSyntaxTemplate\n not:\n template: *NotSyntaxTemplate\n unary:\n template: *UnarySyntaxTemplate\n binary:\n template: *BinarySyntaxTemplate\n parens:\n template: *ParensSyntaxTemplate\n eos:\n template: *EosSyntaxTemplate\n eof:\n template: *EofSyntaxTemplate\n # The new template takes in expr, and an optional skip argument and optional\n # id argument. The skip argument is a boolean that if true then doesn't add\n # new. The code argument is the symbol code being called. The template will check\n # if it is an exception, i.e. a type that is a constructor but may not use new.\n new:\n template: *NewSyntaxTemplate\n # The regex flags that change symbols between languages can be defined here.\n # Flags that aren't defined can be left blank and will be ignored.\n regexFlags: *RegexFlags\n bsonRegexFlags: *BSONRegexFlags\n driver: *DriverTemplate\nImports:\n import:\n template: *ImportTemplate\n driver:\n template: *DriverImportTemplate\n 0:\n template: *0ImportTemplate\n 1:\n template: *1ImportTemplate\n 2:\n template: *2ImportTemplate\n 3:\n template: *3ImportTemplate\n 4:\n template: *4ImportTemplate\n 5:\n template: *5ImportTemplate\n 6:\n template: *6ImportTemplate\n 7:\n template: *7ImportTemplate\n 8:\n template: *8ImportTemplate\n 9:\n template: *9ImportTemplate\n 10:\n template: *10ImportTemplate\n 11:\n template: *11ImportTemplate\n 12:\n template: *12ImportTemplate\n 100:\n template: *100ImportTemplate\n 101:\n template: *101ImportTemplate\n 102:\n template: *102ImportTemplate\n 103:\n template: *103ImportTemplate\n 104:\n template: *104ImportTemplate\n 105:\n template: *105ImportTemplate\n 106:\n template: *106ImportTemplate\n 107:\n template: *107ImportTemplate\n 108:\n template: *108ImportTemplate\n 109:\n template: *109ImportTemplate\n 110:\n template: *110ImportTemplate\n 111:\n template: *111ImportTemplate\n 112:\n template: *112ImportTemplate\n 113:\n template: *113ImportTemplate\n 114:\n template: *114ImportTemplate\n 200:\n template: *200ImportTemplate\n 201:\n template: *201ImportTemplate\n 300:\n template: *300ImportTemplate\n 301:\n template: *301ImportTemplate\n 302:\n template: *302ImportTemplate\n 303:\n template: *303ImportTemplate\n 304:\n template: *304ImportTemplate\n 305:\n template: *305ImportTemplate\n 306:\n template: *306ImportTemplate\nBsonTypes:\n Code: &CodeType\n <<: *__type\n id: \"Code\"\n code: 100\n type: *ObjectType\n attr:\n code:\n callable: *var\n args: null\n attr: null\n id: \"code\"\n type: *StringType\n template: *CodeCodeTemplate\n argsTemplate: *CodeCodeArgsTemplate\n scope:\n callable: *var\n args: null\n attr: null\n id: \"scope\"\n type: *StringType\n template: *CodeScopeTemplate\n argsTemplate: *CodeScopeArgsTemplate\n ObjectId: &ObjectIdType\n <<: *__type\n id: \"ObjectId\"\n code: 101\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *ObjectIdToStringTemplate\n argsTemplate: *ObjectIdToStringArgsTemplate\n equals:\n <<: *__func\n id: \"equals\"\n args:\n - [ \"ObjectId\" ]\n type: *BoolType\n template: *ObjectIdEqualsTemplate\n argsTemplate: *ObjectIdEqualsArgsTemplate\n getTimestamp:\n <<: *__func\n id: \"getTimestamp\"\n type: *IntegerType\n template: *ObjectIdGetTimestampTemplate\n argsTemplate: *ObjectIdGetTimestampArgsTemplate\n BinData: &BinaryType\n <<: *__type\n id: \"BinData\"\n code: 102\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *BinaryToStringTemplate\n argsTemplate: *BinaryToStringArgsTemplate\n base64:\n <<: *__func\n id: \"base64\"\n type: *StringType\n template: *BinaryValueTemplate\n argsTemplate: *BinaryValueArgsTemplate\n length:\n <<: *__func\n id: \"length\"\n type: *IntegerType\n template: *BinaryLengthTemplate\n argsTemplate: *BinaryLengthArgsTemplate\n subtype:\n <<: *__func\n id: \"subtype\"\n type: *IntegerType\n template: *BinarySubtypeTemplate\n argsTemplate: *BinarySubtypeArgsTemplate\n DBRef: &DBRefType\n <<: *__type\n id: \"DBRef\"\n code: 103\n type: *ObjectType\n attr:\n getDb:\n <<: *__func\n id: \"getDb\"\n type: *StringType\n template: *DBRefGetDBTemplate\n argsTemplate: *DBRefGetDBArgsTemplate\n $db:\n callable: *var\n args: null\n attr: null\n id: \"$db\"\n type: *StringType\n template: *DBRefGetDBTemplate\n argsTemplate: *DBRefGetDBArgsTemplate\n getCollection:\n <<: *__func\n id: \"getCollection\"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n getRef:\n <<: *__func\n id: \"getRef\"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n $ref:\n callable: *var\n args: null\n attr: null\n id: \"$ref\"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n getId:\n <<: *__func\n id: \"getId\"\n type: *StringType\n template: *DBRefGetIdTemplate\n argsTemplate: *DBRefGetIdArgsTemplate\n $id:\n callable: *var\n args: null\n attr: null\n id: \"$id\"\n type: *StringType\n template: *DBRefGetIdTemplate\n argsTemplate: *DBRefGetIdArgsTemplate\n NumberInt: &Int32Type\n <<: *__type\n id: \"NumberInt\"\n code: 105\n type: *ObjectType\n attr: {}\n NumberLong: &LongType\n <<: *__type\n id: \"NumberLong\"\n code: 106\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"LongtoString\" # Needs process method\n args:\n - [ *IntegerType, null ]\n type: *StringType\n template: *LongToStringTemplate\n argsTemplate: *LongToStringArgsTemplate\n equals:\n <<: *__func\n id: \"equals\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongEqualsTemplate\n argsTemplate: *LongEqualsArgsTemplate\n toInt:\n <<: *__func\n id: \"toInt\"\n type: *IntegerType\n template: *LongToIntTemplate\n argsTemplate: *LongToIntArgsTemplate\n toNumber:\n <<: *__func\n id: \"toNumber\"\n type: *DecimalType\n template: *LongToNumberTemplate\n argsTemplate: *LongToNumberArgsTemplate\n compare:\n <<: *__func\n id: \"compare\"\n args:\n - [ \"Long\" ]\n type: *StringType\n template: *LongCompareTemplate\n argsTemplate: *LongCompareArgsTemplate\n isOdd:\n <<: *__func\n id: \"isOdd\"\n type: *BoolType\n template: *LongIsOddTemplate\n argsTemplate: *LongIsOddArgsTemplate\n isZero:\n <<: *__func\n id: \"isZero\"\n type: *BoolType\n template: *LongIsZeroTemplate\n argsTemplate: *LongIsZeroArgsTemplate\n isNegative:\n <<: *__func\n id: \"isNegative\"\n type: *BoolType\n template: *LongIsNegativeTemplate\n argsTemplate: *LongIsNegativeArgsTemplate\n negate:\n <<: *__func\n id: \"negate\"\n type: \"Long\"\n template: *LongNegateTemplate\n argsTemplate: *LongNegateArgsTemplate\n not:\n <<: *__func\n id: \"not\"\n type: \"Long\"\n template: *LongNotTemplate\n argsTemplate: *LongNotArgsTemplate\n notEquals:\n <<: *__func\n id: \"notEquals\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongNotEqualsTemplate\n argsTemplate: *LongNotEqualsArgsTemplate\n greaterThan:\n <<: *__func\n id: \"greaterThan\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongGreaterThanTemplate\n argsTemplate: *LongGreaterThanArgsTemplate\n greaterThanOrEqual:\n <<: *__func\n id: \"greaterThanOrEqual\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongGreaterThanOrEqualTemplate\n argsTemplate: *LongGreaterThanOrEqualArgsTemplate\n lessThan:\n <<: *__func\n id: \"lessThan\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongLessThanTemplate\n argsTemplate: *LongLessThanArgsTemplate\n lessThanOrEqual:\n <<: *__func\n id: \"lessThanOrEqual\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongLessThanOrEqualTemplate\n argsTemplate: *LongLessThanOrEqualArgsTemplate\n add:\n <<: *__func\n id: \"add\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongAddTemplate\n argsTemplate: *LongAddArgsTemplate\n subtract:\n <<: *__func\n id: \"subtract\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongSubtractTemplate\n argsTemplate: *LongSubtractArgsTemplate\n multiply:\n <<: *__func\n id: \"multiply\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongMultiplyTemplate\n argsTemplate: *LongMultiplyArgsTemplate\n div:\n <<: *__func\n id: \"div\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongDivTemplate\n argsTemplate: *LongDivArgsTemplate\n modulo:\n <<: *__func\n id: \"modulo\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongModuloTemplate\n argsTemplate: *LongModuloArgsTemplate\n and:\n <<: *__func\n id: \"and\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongAndTemplate\n argsTemplate: *LongAndArgsTemplate\n or:\n <<: *__func\n id: \"or\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongOrTemplate\n argsTemplate: *LongOrArgsTemplate\n xor:\n <<: *__func\n id: \"xor\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongXorTemplate\n argsTemplate: *LongXorArgsTemplate\n shiftLeft:\n <<: *__func\n id: \"shiftLeft\"\n args:\n - [ *IntegerType ]\n type: \"Long\"\n template: *LongShiftLeftTemplate\n argsTemplate: *LongShiftLeftArgsTemplate\n shiftRight:\n <<: *__func\n id: \"shiftRight\"\n args:\n - [ *IntegerType ]\n type: \"Long\"\n template: *LongShiftRightTemplate\n argsTemplate: *LongShiftRightArgsTemplate\n MinKeyType: &MinKeyType\n <<: *__type\n id: \"MinKey\"\n code: 107\n type: *ObjectType\n MaxKeyType: &MaxKeyType\n <<: *__type\n id: \"MaxKey\"\n code: 108\n type: *ObjectType\n Timestamp: &TimestampType\n <<: *__type\n id: \"Timestamp\"\n code: 110\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *TimestampToStringTemplate\n argsTemplate: *TimestampToStringArgsTemplate\n equals:\n <<: *__func\n id: \"equals\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampEqualsTemplate\n argsTemplate: *TimestampEqualsArgsTemplate\n getLowBits:\n <<: *__func\n id: \"getLowBits\"\n type: *IntegerType\n template: *TimestampGetLowBitsTemplate\n argsTemplate: *TimestampGetLowBitsArgsTemplate\n getHighBits:\n <<: *__func\n id: \"getHighBits\"\n type: *IntegerType\n template: *TimestampGetHighBitsTemplate\n argsTemplate: *TimestampGetHighBitsArgsTemplate\n compare:\n <<: *__func\n id: \"compare\"\n args:\n - [ \"Timestamp\" ]\n type: *StringType\n template: *TimestampCompareTemplate\n argsTemplate: *TimestampCompareArgsTemplate\n notEquals:\n <<: *__func\n id: \"notEquals\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampNotEqualsTemplate\n argsTemplate: *TimestampNotEqualsArgsTemplate\n greaterThan:\n <<: *__func\n id: \"greaterThan\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampGreaterThanTemplate\n argsTemplate: *TimestampGreaterThanArgsTemplate\n greaterThanOrEqual:\n <<: *__func\n id: \"greaterThanOrEqual\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampGreaterThanOrEqualTemplate\n argsTemplate: *TimestampGreaterThanOrEqualArgsTemplate\n lessThan:\n <<: *__func\n id: \"lessThan\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampLessThanTemplate\n argsTemplate: *TimestampLessThanArgsTemplate\n lessThanOrEqual:\n <<: *__func\n id: \"lessThanOrEqual\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampLessThanOrEqualTemplate\n argsTemplate: *TimestampLessThanOrEqualArgsTemplate\n BSONSymbol: &SymbolType\n <<: *__type\n id: \"BSONSymbol\"\n code: 111\n type: *ObjectType\n attr:\n valueOf:\n <<: *__func\n id: \"valueOf\"\n type: *StringType\n template: *SymbolValueOfTemplate\n argsTemplate: *SymbolValueOfArgsTemplate\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *SymbolToStringTemplate\n argsTemplate: *SymbolToStringArgsTemplate\n inspect:\n <<: *__func\n id: \"inspect\"\n type: *StringType\n template: *SymbolInspectTemplate\n argsTemplate: *SymbolInspectArgsTemplate\n Double: &DoubleType\n <<: *__type\n id: \"Double\"\n code: 104\n type: *ObjectType\n attr: {}\n Decimal128: &Decimal128Type\n <<: *__type\n id: \"Decimal128\"\n code: 112\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *Decimal128ToStringTemplate\n argsTemplate: *Decimal128ToStringArgsTemplate\n NumberDecimal: &NumberDecimalType\n <<: *__type\n id: \"NumberDecimal\"\n code: 112\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *Decimal128ToStringTemplate\n argsTemplate: *Decimal128ToStringArgsTemplate\n\n\n SUBTYPE_DEFAULT:\n id: \"SUBTYPE_DEFAULT\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeDefaultTemplate\n SUBTYPE_FUNCTION:\n id: \"SUBTYPE_FUNCTION\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeFunctionTemplate\n SUBTYPE_BYTE_ARRAY:\n id: \"SUBTYPE_BYTE_ARRAY\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeByteArrayTemplate\n SUBTYPE_UUID_OLD:\n id: \"SUBTYPE_UUID_OLD\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUuidOldTemplate\n SUBTYPE_UUID:\n id: \"SUBTYPE_UUID\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUuidTemplate\n SUBTYPE_MD5:\n id: \"SUBTYPE_MD5\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeMd5Template\n SUBTYPE_USER_DEFINED:\n id: \"SUBTYPE_USER_DEFINED\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUserDefinedTemplate\n BSONRegExpType: &BSONRegExpType\n <<: *__type\n id: \"BSONRegExp\"\n code: 109\n type: *ObjectType\nNativeTypes:\n Date: &DateType\n <<: *__type\n id: \"Date\"\n code: 200\n type: *ObjectType\n attr: {} # TODO: no built-in date methods added yet\n RegExp: &RegExpType\n <<: *__type\n id: \"RegExp\"\n code: 8\n type: *ObjectType\n attr: {}\n\n\nBsonSymbols:\n Code: &CodeSymbol\n id: \"Code\"\n code: 100\n callable: *constructor\n args:\n - [ *StringType, null ]\n - [ *ObjectType, null ]\n type: *CodeType\n attr: {}\n template: *CodeSymbolTemplate\n argsTemplate: *CodeSymbolArgsTemplate\n ObjectId: &ObjectIdSymbol\n id: \"ObjectId\"\n code: 101\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n type: *ObjectIdType\n attr:\n createFromHexString:\n <<: *__func\n id: \"createFromHexString\"\n args:\n - [ *StringType ]\n type: *ObjectIdType\n template: *ObjectIdCreateFromHexStringTemplate\n argsTemplate: *ObjectIdCreateFromHexStringArgsTemplate\n createFromTime:\n <<: *__func\n id: \"ObjectIdCreateFromTime\"\n args:\n - [ *NumericType, *DateType ]\n type: *ObjectIdType\n template: *ObjectIdCreateFromTimeTemplate\n argsTemplate: *ObjectIdCreateFromTimeArgsTemplate\n isValid:\n <<: *__func\n id: \"isValid\"\n args:\n - [ *StringType ]\n type: *BoolType\n template: *ObjectIdIsValidTemplate\n argsTemplate: *ObjectIdIsValidArgsTemplate\n template: *ObjectIdSymbolTemplate\n argsTemplate: *ObjectIdSymbolArgsTemplate\n BinData: &BinarySymbol\n id: \"BinData\"\n code: 102\n callable: *constructor\n args:\n - [ *IntegerType ]\n - [ *StringType ]\n type: *BinaryType\n attr: {}\n template: *BinarySymbolTemplate\n argsTemplate: *BinarySymbolArgsTemplate\n DBRef:\n id: \"DBRef\"\n code: 103\n callable: *constructor\n args:\n - [ *StringType ]\n - [ *ObjectIdType ]\n - [ *StringType, null ]\n type: *DBRefType\n attr: {}\n template: *DBRefSymbolTemplate\n argsTemplate: *DBRefSymbolArgsTemplate\n NumberInt:\n id: \"Int32\"\n code: 105\n callable: *constructor\n args:\n - [ *NumericType, *StringType, null ]\n type: *Int32Type\n attr: {}\n template: *Int32SymbolTemplate\n argsTemplate: *Int32SymbolArgsTemplate\n NumberLong:\n id: \"NumberLong\"\n code: 106\n callable: *constructor\n args:\n - [ *IntegerType, *StringType, null ]\n type: *LongType\n attr: {}\n template: *LongSymbolTemplate\n argsTemplate: *LongSymbolArgsTemplate\n MinKey:\n id: \"MinKey\"\n code: 107\n callable: *constructor\n args: []\n type: *MinKeyType\n attr: {}\n template: *MinKeySymbolTemplate\n argsTemplate: *MinKeySymbolArgsTemplate\n MaxKey:\n id: \"MaxKey\"\n code: 108\n callable: *constructor\n args: []\n type: *MaxKeyType\n attr: {}\n template: *MaxKeySymbolTemplate\n argsTemplate: *MaxKeySymbolArgsTemplate\n Timestamp:\n id: \"Timestamp\"\n code: 110\n callable: *constructor\n args:\n - [ *IntegerType, null ]\n - [ *IntegerType, null ]\n type: *TimestampType\n attr: {}\n template: *TimestampSymbolTemplate\n argsTemplate: *TimestampSymbolArgsTemplate\n Symbol:\n id: \"Symbol\"\n code: 111\n callable: *constructor\n args:\n - [ *StringType ]\n type: *SymbolType\n attr: {}\n template: *SymbolSymbolTemplate\n argsTemplate: *SymbolSymbolArgsTemplate\n NumberDecimal:\n id: \"NumberDecimal\"\n code: 112\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n type: *Decimal128Type\n attr: {}\n template: *Decimal128SymbolTemplate\n argsTemplate: *Decimal128SymbolArgsTemplate\n BSONRegExp:\n id: \"BSONRegExp\"\n code: 109\n callable: *constructor\n args:\n - [ *StringType ]\n - [ *StringType, null ]\n type: *BSONRegExpType\n attr: {}\n template: *BSONRegExpSymbolTemplate\n argsTemplate: *BSONRegExpSymbolArgsTemplate\n BSONSymbol:\n id: \"BSONSymbol\"\n code: 111\n callable: *constructor\n args:\n - [ *StringType ]\n type: *SymbolType\n attr: {}\n template: *SymbolSymbolTemplate\n argsTemplate: *SymbolSymbolArgsTemplate\n Decimal128:\n id: \"Decimal128\"\n code: 112\n callable: *constructor\n args:\n - [ *ObjectType ]\n type: *Decimal128Type\n attr:\n fromString:\n id: \"fromString\"\n callable: *func\n args:\n - [ *StringType ]\n type: *Decimal128Type\n attr: {}\n template: *Decimal128SymbolFromStringTemplate\n argsTemplate: *Decimal128SymbolFromStringArgsTemplate\n template: *Decimal128SymbolTemplate\n argsTemplate: *Decimal128SymbolArgsTemplate\n Double:\n id: \"Double\"\n code: 104\n callable: *constructor\n args:\n - [ *NumericType, *StringType ]\n type: *DoubleType\n attr: {}\n template: *DoubleSymbolTemplate\n argsTemplate: *DoubleSymbolArgsTemplate\n Int32:\n id: \"Int32\"\n code: 105\n callable: *constructor\n args:\n - [ *NumericType, *StringType ]\n type: *Int32Type\n attr: {}\n template: *Int32SymbolTemplate\n argsTemplate: *Int32SymbolArgsTemplate\n Long:\n id: \"Long\"\n code: 106\n callable: *constructor\n args:\n - [ *IntegerType ]\n - [ *IntegerType ]\n type: *LongType\n attr:\n MAX_VALUE:\n id: \"MAX_VALUE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolMaxTemplate\n argsTemplate: *LongSymbolMaxArgsTemplate\n MIN_VALUE:\n id: \"MIN_VALUE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolMinTemplate\n argsTemplate: *LongSymbolMinArgsTemplate\n ZERO:\n id: \"ZERO\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolZeroTemplate\n argsTemplate: *LongSymbolZeroArgsTemplate\n ONE:\n id: \"ONE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolOneTemplate\n argsTemplate: *LongSymbolOneArgsTemplate\n NEG_ONE:\n id: \"NEG_ONE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolNegOneTemplate\n argsTemplate: *LongSymbolNegOneArgsTemplate\n fromBits:\n id: \"LongfromBits\" # Needs process method\n callable: *func\n args:\n - [ *IntegerType ]\n - [ *IntegerType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromBitsTemplate\n argsTemplate: *LongSymbolFromBitsArgsTemplate\n fromInt:\n id: \"fromInt\"\n callable: *func\n args:\n - [ *IntegerType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromIntTemplate\n argsTemplate: *LongSymbolFromIntArgsTemplate\n fromNumber:\n id: \"fromNumber\"\n callable: *func\n args:\n - [ *NumericType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromNumberTemplate\n argsTemplate: *LongSymbolFromNumberArgsTemplate\n fromString:\n id: \"fromString\"\n callable: *func\n args:\n - [ *StringType ]\n - [ *IntegerType, null ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromStringTemplate\n argsTemplate: *LongSymbolFromStringArgsTemplate\n template: *LongSymbolTemplate\n argsTemplate: *LongSymbolArgsTemplate\n\nNativeSymbols:\n Number:\n id: \"Number\"\n code: 2\n callable: *constructor\n args:\n - [ *IntegerType, *StringType, null ]\n type: *NumericType\n attr: {} # TODO: no built-in number funcs added yet\n template: *NumberSymbolTemplate\n argsTemplate: *NumberSymbolArgsTemplate\n Date: # Needs emit method\n id: \"Date\"\n code: 200\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n type: *DateType\n attr: # TODO: add more date funcs?\n now:\n id: \"now\"\n code: 200.1\n callable: *func\n args: []\n type: *DateType\n attr: {}\n template: *DateSymbolNowTemplate\n argsTemplate: *DateSymbolNowArgsTemplate\n template: *DateSymbolTemplate\n argsTemplate: *DateSymbolArgsTemplate\n ISODate: # Needs emit method\n id: \"ISODate\"\n code: 200\n callable: *constructor\n args:\n - [ *StringType, null ]\n type: *DateType\n attr:\n now:\n id: \"now\"\n callable: *constructor\n args: []\n type: *DateType\n attr: {}\n template: *DateSymbolNowTemplate\n argsTemplate: *DateSymbolNowArgsTemplate\n template: *DateSymbolTemplate\n argsTemplate: *DateSymbolArgsTemplate\n RegExp: # Needs process method\n id: \"RegExp\"\n code: 8\n callable: *constructor\n args:\n - [ *StringType, *RegexType ]\n - [ *StringType, null ]\n type: *RegExpType\n attr: {} # TODO: no built-in regex funcs added yet\n template: *RegExpSymbolTemplate\n argsTemplate: *RegExpSymbolArgsTemplate\n\n"},2850:e=>{e.exports='SymbolTypes:\n VAR: &var 0\n CONSTRUCTOR: &constructor 1\n FUNC: &func 2\n# Internal patterns to save typing\n__type: &__type\n id: null\n callable: *var\n args: null\n type: null\n attr: {}\n template: null\n argsTemplate: null\n__func: &__func\n callable: *func\n args: []\n attr: {}\n template: null\n argsTemplate: null\n\n# Javascript Templates\nTemplates:\n # Misc\n RegexFlags: &RegexFlags\n i: \'i\'\n m: \'m\'\n u: \'u\'\n y: \'y\'\n g: \'g\'\n BSONRegexFlags: &BSONRegexFlags\n i: \'i\'\n m: \'m\'\n x: \'x\'\n s: \'s\'\n l: \'l\'\n u: \'u\'\n # Syntax\n DriverTemplate: &DriverTemplate !!js/function |\n (spec) => {\n const comment = `/*\n * Requires the MongoDB Node.js Driver\n * https://mongodb.github.io/node-mongodb-native\n */`;\n const translateKey = {\n project: \'projection\'\n };\n\n const exportMode = spec.exportMode;\n delete spec.exportMode;\n\n const args = {};\n Object.keys(spec).forEach((k) => {\n if (k !== \'options\') {\n args[k in translateKey ? translateKey[k] : k] = spec[k];\n }\n });\n\n let cmd;\n let defs;\n if (exportMode == \'Delete Query\') {\n defs = `const filter = ${args.filter};\\n`;\n cmd = `const result = coll.deleteMany(filter);`;\n }\n if (\'aggregation\' in spec) {\n const agg = spec.aggregation;\n cmd = `const cursor = coll.aggregate(agg);\\nconst result = await cursor.toArray();`;\n defs = `const agg = ${agg};\\n`;\n } else if (!cmd) {\n let opts = \'\';\n\n if (Object.keys(args).length > 0) {\n defs = Object.keys(args).reduce((s, k) => {\n if (k !== \'filter\') {\n if (opts === \'\') {\n opts = `${k}`;\n } else {\n opts = `${opts}, ${k}`;\n }\n }\n return `${s}const ${k} = ${args[k]};\\n`;\n }, \'\');\n opts = opts === \'\' ? \'\' : `, { ${opts} }`;\n }\n cmd = `const cursor = coll.find(filter${opts});\\nconst result = await cursor.toArray();`;\n }\n return `${comment}\\n\\n${defs}\n const client = await MongoClient.connect(\n \'${spec.options.uri}\'\n );\n const coll = client.db(\'${spec.options.database}\').collection(\'${spec.options.collection}\');\n ${cmd}\n await client.close();`;\n }\n EqualitySyntaxTemplate: &EqualitySyntaxTemplate !!js/function >\n (lhs, op, rhs) => {\n if (op.includes(\'!\') || op.includes(\'not\')) {\n return `${lhs} !== ${rhs}`;\n } else if (op === \'==\' || op === \'===\' || op === \'is\') {\n return `${lhs} === ${rhs}`;\n }\n return `${lhs} ${op} ${rhs}`;\n }\n InSyntaxTemplate: &InSyntaxTemplate !!js/function >\n (lhs, op, rhs) => {\n let str = \'!==\';\n if (op.includes(\'!\') || op.includes(\'not\')) {\n str = \'===\';\n }\n return `${rhs}.indexOf(${lhs}) ${str} -1`\n }\n AndSyntaxTemplate: &AndSyntaxTemplate !!js/function >\n (args) => {\n return args.join(\' && \');\n }\n OrSyntaxTemplate: &OrSyntaxTemplate !!js/function >\n (args) => {\n return args.join(\' || \');\n }\n NotSyntaxTemplate: &NotSyntaxTemplate !!js/function >\n (arg) => {\n return `!${arg}`;\n }\n UnarySyntaxTemplate: &UnarySyntaxTemplate null\n BinarySyntaxTemplate: &BinarySyntaxTemplate !!js/function >\n (args) => {\n return args.reduce((s, op, i, arr) => {\n if (i % 2 === 0) {\n return s;\n }\n const rhs = arr[i + 1];\n switch(op) {\n case \'//\':\n return `Math.floor(${s}, ${rhs})`;\n case \'**\':\n return `Math.pow(${s}, ${rhs})`;\n default:\n return `${s} ${op} ${rhs}`;\n }\n }, args[0]);\n }\n ParensSyntaxTemplate: &ParensSyntaxTemplate null\n EosSyntaxTemplate: &EosSyntaxTemplate null\n EofSyntaxTemplate: &EofSyntaxTemplate null\n NewTemplate: &NewSyntaxTemplate !!js/function >\n (expr, skip, code) => {\n // Add classes that don\'t use "new" to array.\n // So far: [Date.now, Decimal128/NumberDecimal, Long/NumberLong]\n noNew = [200.1, 112, 106];\n if (skip || (code && noNew.indexOf(code) !== -1)) {\n return expr;\n }\n return `new ${expr}`;\n }\n # BSON Object Type templates\n CodeTypeTemplate: &CodeTypeTemplate null\n StringTypeTemplate: &StringTypeTemplate !!js/function >\n (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === \'\\\'\' && str.charAt(str.length - 1) === \'\\\'\') ||\n (str.charAt(0) === \'"\' && str.charAt(str.length - 1) === \'"\')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `\'${newStr.replace(/\\\\([\\s\\S])|(\')/g, \'\\\\$1$2\')}\'`;\n }\n RegexTypeTemplate: &RegexTypeTemplate !!js/function >\n (pattern, flags) => {\n const str = pattern;\n let newStr = str;\n if (\n (str.charAt(0) === \'\\\'\' && str.charAt(str.length - 1) === \'\\\'\') ||\n (str.charAt(0) === \'"\' && str.charAt(str.length - 1) === \'"\')) {\n newStr = str.substr(1, str.length - 2);\n }\n pattern = `\'${newStr.replace(/\\\\([\\s\\S])|(\')/g, \'\\\\$1$2\')}\'`;\n return `RegExp(${pattern}${flags ? \', \' + \'\\\'\' + flags + \'\\\'\': \'\'})`;\n }\n BoolTypeTemplate: &BoolTypeTemplate !!js/function >\n (literal) => {\n return literal.toLowerCase();\n }\n IntegerTypeTemplate: &IntegerTypeTemplate null\n DecimalTypeTemplate: &DecimalTypeTemplate null\n LongBasicTypeTemplate: &LongBasicTypeTemplate null\n HexTypeTemplate: &HexTypeTemplate null\n OctalTypeTemplate: &OctalTypeTemplate null\n NumericTypeTemplate: &NumericTypeTemplate null\n ArrayTypeTemplate: &ArrayTypeTemplate !!js/function >\n (literal, depth) => {\n depth++;\n if (literal === \'\') {\n return \'[]\'\n }\n const indent = \'\\n\' + \' \'.repeat(depth);\n const closingIndent = \'\\n\' + \' \'.repeat(depth - 1);\n\n return `[${indent}${literal}${closingIndent}]`;\n }\n ArrayTypeArgsTemplate: &ArrayTypeArgsTemplate null\n NullTypeTemplate: &NullTypeTemplate !!js/function >\n () => {\n return \'null\';\n }\n UndefinedTypeTemplate: &UndefinedTypeTemplate !!js/function >\n () => {\n return \'undefined\';\n }\n ObjectTypeTemplate: &ObjectTypeTemplate !!js/function >\n (literal) => {\n if (literal === \'\') {\n return \'{}\';\n }\n return literal;\n }\n ObjectTypeArgsTemplate: &ObjectTypeArgsTemplate !!js/function >\n (args, depth) => {\n if (args.length === 0) {\n return \'{}\';\n }\n depth++;\n const indent = \'\\n\' + \' \'.repeat(depth);\n const closingIndent = \'\\n\' + \' \'.repeat(depth - 1);\n const singleStringify = (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === \'\\\'\' && str.charAt(str.length - 1) === \'\\\'\') ||\n (str.charAt(0) === \'"\' && str.charAt(str.length - 1) === \'"\')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `\'${newStr.replace(/\\\\([\\s\\S])|(\')/g, \'\\\\$1$2\')}\'`;\n }\n const pairs = args.map((arg) => {\n return `${indent}${singleStringify(arg[0])}: ${arg[1]}`;\n }).join(\', \');\n\n return `{${pairs}${closingIndent}}`\n }\n # BSON Object Method templates\n CodeCodeTemplate: &CodeCodeTemplate null\n CodeCodeArgsTemplate: &CodeCodeArgsTemplate null\n CodeScopeTemplate: &CodeScopeTemplate null\n CodeScopeArgsTemplate: &CodeScopeArgsTemplate null\n ObjectIdToStringTemplate: &ObjectIdToStringTemplate null\n ObjectIdToStringArgsTemplate: &ObjectIdToStringArgsTemplate null\n ObjectIdEqualsTemplate: &ObjectIdEqualsTemplate null\n ObjectIdEqualsArgsTemplate: &ObjectIdEqualsArgsTemplate null\n ObjectIdGetTimestampTemplate: &ObjectIdGetTimestampTemplate null\n ObjectIdGetTimestampArgsTemplate: &ObjectIdGetTimestampArgsTemplate null\n BinaryValueTemplate: &BinaryValueTemplate null\n BinaryValueArgsTemplate: &BinaryValueArgsTemplate null\n BinaryLengthTemplate: &BinaryLengthTemplate null\n BinaryLengthArgsTemplate: &BinaryLengthArgsTemplate null\n BinaryToStringTemplate: &BinaryToStringTemplate null\n BinaryToStringArgsTemplate: &BinaryToStringArgsTemplate null\n BinarySubtypeTemplate: &BinarySubtypeTemplate !!js/function >\n (lhs) => {\n return `${lhs}.sub_type`;\n }\n BinarySubtypeArgsTemplate: &BinarySubtypeArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n DBRefGetDBTemplate: &DBRefGetDBTemplate !!js/function >\n (lhs) => {\n return `${lhs}.db`;\n }\n DBRefGetCollectionTemplate: &DBRefGetCollectionTemplate !!js/function >\n (lhs) => {\n return `${lhs}.namespace`;\n }\n DBRefGetIdTemplate: &DBRefGetIdTemplate !!js/function >\n (lhs) => {\n return `${lhs}.oid`;\n }\n DBRefGetDBArgsTemplate: &DBRefGetDBArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n DBRefGetCollectionArgsTemplate: &DBRefGetCollectionArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n DBRefGetIdArgsTemplate: &DBRefGetIdArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n LongEqualsTemplate: &LongEqualsTemplate null\n LongEqualsArgsTemplate: &LongEqualsArgsTemplate null\n LongToStringTemplate: &LongToStringTemplate null\n LongToStringArgsTemplate: &LongToStringArgsTemplate null\n LongToIntTemplate: &LongToIntTemplate !!js/function >\n (lhs) => {\n return `${lhs}.toInt`;\n }\n LongToIntArgsTemplate: &LongToIntArgsTemplate null\n LongToNumberTemplate: &LongToNumberTemplate null\n LongToNumberArgsTemplate: &LongToNumberArgsTemplate null\n LongAddTemplate: &LongAddTemplate null\n LongAddArgsTemplate: &LongAddArgsTemplate null\n LongSubtractTemplate: &LongSubtractTemplate null\n LongSubtractArgsTemplate: &LongSubtractArgsTemplate null\n LongMultiplyTemplate: &LongMultiplyTemplate null\n LongMultiplyArgsTemplate: &LongMultiplyArgsTemplate null\n LongDivTemplate: &LongDivTemplate null\n LongDivArgsTemplate: &LongDivArgsTemplate null\n LongModuloTemplate: &LongModuloTemplate null\n LongModuloArgsTemplate: &LongModuloArgsTemplate null\n LongAndTemplate: &LongAndTemplate null\n LongAndArgsTemplate: &LongAndArgsTemplate null\n LongOrTemplate: &LongOrTemplate null\n LongOrArgsTemplate: &LongOrArgsTemplate null\n LongXorTemplate: &LongXorTemplate null\n LongXorArgsTemplate: &LongXorArgsTemplate null\n LongShiftLeftTemplate: &LongShiftLeftTemplate null\n LongShiftLeftArgsTemplate: &LongShiftLeftArgsTemplate null\n LongShiftRightTemplate: &LongShiftRightTemplate null\n LongShiftRightArgsTemplate: &LongShiftRightArgsTemplate null\n LongCompareTemplate: &LongCompareTemplate null\n LongCompareArgsTemplate: &LongCompareArgsTemplate null\n LongIsOddTemplate: &LongIsOddTemplate null\n LongIsOddArgsTemplate: &LongIsOddArgsTemplate null\n LongIsZeroTemplate: &LongIsZeroTemplate null\n LongIsZeroArgsTemplate: &LongIsZeroArgsTemplate null\n LongIsNegativeTemplate: &LongIsNegativeTemplate null\n LongIsNegativeArgsTemplate: &LongIsNegativeArgsTemplate null\n LongNegateTemplate: &LongNegateTemplate null\n LongNegateArgsTemplate: &LongNegateArgsTemplate null\n LongNotTemplate: &LongNotTemplate null\n LongNotArgsTemplate: &LongNotArgsTemplate null\n LongNotEqualsTemplate: &LongNotEqualsTemplate null\n LongNotEqualsArgsTemplate: &LongNotEqualsArgsTemplate null\n LongGreaterThanTemplate: &LongGreaterThanTemplate null\n LongGreaterThanArgsTemplate: &LongGreaterThanArgsTemplate null\n LongGreaterThanOrEqualTemplate: &LongGreaterThanOrEqualTemplate null\n LongGreaterThanOrEqualArgsTemplate: &LongGreaterThanOrEqualArgsTemplate null\n LongLessThanTemplate: &LongLessThanTemplate null\n LongLessThanArgsTemplate: &LongLessThanArgsTemplate null\n LongLessThanOrEqualTemplate: &LongLessThanOrEqualTemplate null\n LongLessThanOrEqualArgsTemplate: &LongLessThanOrEqualArgsTemplate null\n LongFloatApproxTemplate: &LongFloatApproxTemplate !!js/function >\n (lhs) => {\n return `${lhs}.toNumber()`;\n }\n LongTopTemplate: &LongTopTemplate !!js/function >\n (lhs) => {\n return `${lhs}.getHighBits()`;\n }\n LongBottomTemplate: &LongBottomTemplate !!js/function >\n (lhs) => {\n return `${lhs}.getLowBits()`;\n }\n TimestampToStringTemplate: &TimestampToStringTemplate null\n TimestampToStringArgsTemplate: &TimestampToStringArgsTemplate null\n TimestampEqualsTemplate: &TimestampEqualsTemplate null\n TimestampEqualsArgsTemplate: &TimestampEqualsArgsTemplate null\n TimestampGetLowBitsTemplate: &TimestampGetLowBitsTemplate !!js/function >\n (lhs) => {\n return `${lhs}.getLowBits`;\n }\n TimestampGetLowBitsArgsTemplate: &TimestampGetLowBitsArgsTemplate null\n TimestampGetHighBitsTemplate: &TimestampGetHighBitsTemplate !!js/function >\n (lhs) => {\n return `${lhs}.getHighBits`;\n }\n TimestampGetHighBitsArgsTemplate: &TimestampGetHighBitsArgsTemplate null\n TimestampTTemplate: &TimestampTTemplate !!js/function >\n (lhs) => {\n return `${lhs}.getLowBits()`;\n }\n TimestampITemplate: &TimestampITemplate !!js/function >\n (lhs) => {\n return `${lhs}.getHighBits()`;\n }\n TimestampAsDateTemplate: &TimestampAsDateTemplate !!js/function >\n (lhs) => {\n return `new Date(${lhs}.getHighBits() * 1000)`;\n }\n TimestampAsDateArgsTemplate: &TimestampAsDateArgsTemplate !!js/function >\n () => {\n return \'\';\n }\n TimestampCompareTemplate: &TimestampCompareTemplate null\n TimestampCompareArgsTemplate: &TimestampCompareArgsTemplate null\n TimestampNotEqualsTemplate: &TimestampNotEqualsTemplate null\n TimestampNotEqualsArgsTemplate: &TimestampNotEqualsArgsTemplate null\n TimestampGreaterThanTemplate: &TimestampGreaterThanTemplate null\n TimestampGreaterThanArgsTemplate: &TimestampGreaterThanArgsTemplate null\n TimestampGreaterThanOrEqualTemplate: &TimestampGreaterThanOrEqualTemplate null\n TimestampGreaterThanOrEqualArgsTemplate: &TimestampGreaterThanOrEqualArgsTemplate null\n TimestampLessThanTemplate: &TimestampLessThanTemplate null\n TimestampLessThanArgsTemplate: &TimestampLessThanArgsTemplate null\n TimestampLessThanOrEqualTemplate: &TimestampLessThanOrEqualTemplate null\n TimestampLessThanOrEqualArgsTemplate: &TimestampLessThanOrEqualArgsTemplate null\n SymbolValueOfTemplate: &SymbolValueOfTemplate null\n SymbolValueOfArgsTemplate: &SymbolValueOfArgsTemplate null\n SymbolInspectTemplate: &SymbolInspectTemplate null\n SymbolInspectArgsTemplate: &SymbolInspectArgsTemplate null\n SymbolToStringTemplate: &SymbolToStringTemplate null\n SymbolToStringArgsTemplate: &SymbolToStringArgsTemplate null\n # Symbol Templates\n CodeSymbolTemplate: &CodeSymbolTemplate null\n CodeSymbolArgsTemplate: &CodeSymbolArgsTemplate !!js/function >\n (lhs, code, scope) => {\n code = code === undefined ? \'\\\'\\\'\' : code;\n scope = scope === undefined ? \'\' : `, ${scope}`;\n return `(${code}${scope})`;\n }\n ObjectIdSymbolTemplate: &ObjectIdSymbolTemplate null\n ObjectIdSymbolArgsTemplate: &ObjectIdSymbolArgsTemplate !!js/function >\n (lhs, str) => {\n if (!str || str.length === 0) {\n return \'()\';\n }\n let newStr = str;\n if (\n (str.charAt(0) === \'\\\'\' && str.charAt(str.length - 1) === \'\\\'\') ||\n (str.charAt(0) === \'"\' && str.charAt(str.length - 1) === \'"\')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `(\'${newStr.replace(/\\\\([\\s\\S])|(")/g, \'\\\\$1$2\')}\')`;\n }\n BinarySymbolTemplate: &BinarySymbolTemplate !!js/function >\n () => {\n return \'Binary\';\n }\n BinarySymbolArgsTemplate: &BinarySymbolArgsTemplate !!js/function >\n (lhs, buffer, subtype) => {\n return `(${buffer.toString(\'base64\')}, \'${subtype}\')`;\n }\n BinarySymbolSubtypeDefaultTemplate: &BinarySymbolSubtypeDefaultTemplate null\n BinarySymbolSubtypeFunctionTemplate: &BinarySymbolSubtypeFunctionTemplate null\n BinarySymbolSubtypeByteArrayTemplate: &BinarySymbolSubtypeByteArrayTemplate null\n BinarySymbolSubtypeUuidOldTemplate: &BinarySymbolSubtypeUuidOldTemplate null\n BinarySymbolSubtypeUuidTemplate: &BinarySymbolSubtypeUuidTemplate null\n BinarySymbolSubtypeMd5Template: &BinarySymbolSubtypeMd5Template null\n BinarySymbolSubtypeUserDefinedTemplate: &BinarySymbolSubtypeUserDefinedTemplate null\n DBRefSymbolTemplate: &DBRefSymbolTemplate null\n DBRefSymbolArgsTemplate: &DBRefSymbolArgsTemplate null\n DoubleSymbolTemplate: &DoubleSymbolTemplate !!js/function >\n () => {\n return \'Double\';\n }\n DoubleSymbolArgsTemplate: &DoubleSymbolArgsTemplate null\n Int32SymbolTemplate: &Int32SymbolTemplate !!js/function >\n () => {\n return \'Int32\';\n }\n Int32SymbolArgsTemplate: &Int32SymbolArgsTemplate !!js/function >\n (lhs, arg) => {\n arg = arg === undefined ? 0 : arg;\n return `(${arg})`;\n }\n LongSymbolTemplate: &LongSymbolTemplate !!js/function >\n () => {\n return \'\';\n }\n LongSymbolArgsTemplate: &LongSymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n if (type === \'_string\') {\n return `Long.fromString(${arg})`;\n }\n return `Long.fromNumber(${arg})`;\n }\n LongSymbolMaxTemplate: &LongSymbolMaxTemplate null\n LongSymbolMaxArgsTemplate: &LongSymbolMaxArgsTemplate null\n LongSymbolMinTemplate: &LongSymbolMinTemplate null\n LongSymbolMinArgsTemplate: &LongSymbolMinArgsTemplate null\n LongSymbolZeroTemplate: &LongSymbolZeroTemplate null\n LongSymbolZeroArgsTemplate: &LongSymbolZeroArgsTemplate null\n LongSymbolOneTemplate: &LongSymbolOneTemplate null\n LongSymbolOneArgsTemplate: &LongSymbolOneArgsTemplate null\n LongSymbolNegOneTemplate: &LongSymbolNegOneTemplate null\n LongSymbolNegOneArgsTemplate: &LongSymbolNegOneArgsTemplate null\n LongSymbolFromBitsTemplate: &LongSymbolFromBitsTemplate null\n LongSymbolFromBitsArgsTemplate: &LongSymbolFromBitsArgsTemplate null\n LongSymbolFromIntTemplate: &LongSymbolFromIntTemplate null\n LongSymbolFromIntArgsTemplate: &LongSymbolFromIntArgsTemplate null\n LongSymbolFromNumberTemplate: &LongSymbolFromNumberTemplate null\n LongSymbolFromNumberArgsTemplate: &LongSymbolFromNumberArgsTemplate null\n LongSymbolFromStringTemplate: &LongSymbolFromStringTemplate null\n LongSymbolFromStringArgsTemplate: &LongSymbolFromStringArgsTemplate null\n MinKeySymbolTemplate: &MinKeySymbolTemplate null\n MinKeySymbolArgsTemplate: &MinKeySymbolArgsTemplate null\n MaxKeySymbolTemplate: &MaxKeySymbolTemplate null\n MaxKeySymbolArgsTemplate: &MaxKeySymbolArgsTemplate null\n TimestampSymbolTemplate: &TimestampSymbolTemplate null\n TimestampSymbolArgsTemplate: &TimestampSymbolArgsTemplate !!js/function >\n (lhs, arg1, arg2) => {\n return `(${arg1 === undefined ? 0 : arg1}, ${arg2 === undefined ? 0 : arg2})`;\n }\n SymbolSymbolTemplate: &SymbolSymbolTemplate !!js/function >\n () => {\n return \'BSONSymbol\';\n }\n SymbolSymbolArgsTemplate: &SymbolSymbolArgsTemplate null\n BSONRegExpSymbolTemplate: &BSONRegExpSymbolTemplate !!js/function >\n () => {\n return \'BSONRegExp\';\n }\n BSONRegExpSymbolArgsTemplate: &BSONRegExpSymbolArgsTemplate !!js/function >\n (lhs, pattern, flags) => {\n const singleStringify = (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === \'\\\'\' && str.charAt(str.length - 1) === \'\\\'\') ||\n (str.charAt(0) === \'"\' && str.charAt(str.length - 1) === \'"\')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `\'${newStr.replace(/\\\\([\\s\\S])|(")/g, \'\\\\$1$2\')}\'`;\n }\n return `(${singleStringify(pattern)}${flags ? \', \' + singleStringify(flags) : \'\'})`;\n }\n Decimal128SymbolTemplate: &Decimal128SymbolTemplate !!js/function >\n () => {\n return \'Decimal128\';\n }\n Decimal128SymbolArgsTemplate: &Decimal128SymbolArgsTemplate !!js/function >\n (lhs, arg) => {\n arg = arg === undefined ? \'0\' : arg.toString();\n if (arg.charAt(0) === \'\\\'\' && arg.charAt(arg.length - 1) === \'\\\'\') {\n return `.fromString(${arg})`;\n }\n return `.fromString(\'${arg}\')`;\n }\n Decimal128SymbolFromStringTemplate: &Decimal128SymbolFromStringTemplate null\n Decimal128SymbolFromStringArgsTemplate: &Decimal128SymbolFromStringArgsTemplate null\n Decimal128ToStringTemplate: &Decimal128ToStringTemplate null\n Decimal128ToStringArgsTemplate: &Decimal128ToStringArgsTemplate null\n # BSON Util Templates\n ObjectIdCreateFromHexStringTemplate: &ObjectIdCreateFromHexStringTemplate null\n ObjectIdCreateFromHexStringArgsTemplate: &ObjectIdCreateFromHexStringArgsTemplate null\n ObjectIdCreateFromTimeTemplate: &ObjectIdCreateFromTimeTemplate !!js/function >\n () => {\n return `ObjectId.createFromTime`;\n }\n ObjectIdCreateFromTimeArgsTemplate: &ObjectIdCreateFromTimeArgsTemplate !!js/function >\n (lhs, arg, isNumber) => {\n if (!isNumber) {\n return `(${arg}.getTime() / 1000)`;\n }\n return `(${arg})`;\n }\n ObjectIdIsValidTemplate: &ObjectIdIsValidTemplate !!js/function >\n (lhs) => {\n return `${lhs}.isValid`;\n }\n ObjectIdIsValidArgsTemplate: &ObjectIdIsValidArgsTemplate null\n # JS Symbol Templates\n NumberSymbolTemplate: &NumberSymbolTemplate !!js/function >\n () => {\n return \'Number\';\n }\n NumberSymbolArgsTemplate: &NumberSymbolArgsTemplate !!js/function >\n (lhs, arg) => {\n arg = arg === undefined ? \'0\' : arg;\n return `(${arg})`;\n }\n DateSymbolTemplate: &DateSymbolTemplate !!js/function >\n () => {\n return \'Date\';\n }\n DateSymbolArgsTemplate: &DateSymbolArgsTemplate null\n DateSymbolNowTemplate: &DateSymbolNowTemplate !!js/function >\n () => {\n return \'Date.now\';\n }\n DateSymbolNowArgsTemplate: &DateSymbolNowArgsTemplate null\n RegExpSymbolTemplate: &RegExpSymbolTemplate !!js/function >\n () => {\n return \'RegExp\';\n }\n RegExpSymbolArgsTemplate: &RegExpSymbolArgsTemplate null\n ImportTemplate: &ImportTemplate !!js/function >\n (args) => {\n const bson = [];\n const other = [];\n Object.keys(args).map(\n (m) => {\n if (m > 99 && m < 200) {\n bson.push(args[m]);\n } else {\n other.push(args[m]);\n }\n }\n );\n if (bson.length) {\n other.push(`import {\\n ${bson.join(\',\\n \')}\\n} from \'mongodb\';`);\n }\n return other.join(\'\\n\');\n }\n DriverImportTemplate: &DriverImportTemplate !!js/function >\n () => {\n return `import { MongoClient } from \'mongodb\';`;\n }\n 0ImportTemplate: &0ImportTemplate null\n 1ImportTemplate: &1ImportTemplate null\n 2ImportTemplate: &2ImportTemplate null\n 3ImportTemplate: &3ImportTemplate null\n 4ImportTemplate: &4ImportTemplate null\n 5ImportTemplate: &5ImportTemplate null\n 6ImportTemplate: &6ImportTemplate null\n 7ImportTemplate: &7ImportTemplate null\n 8ImportTemplate: &8ImportTemplate null\n 9ImportTemplate: &9ImportTemplate null\n 10ImportTemplate: &10ImportTemplate null\n 11ImportTemplate: &11ImportTemplate null\n 12ImportTemplate: &12ImportTemplate null\n 100ImportTemplate: &100ImportTemplate !!js/function >\n () => {\n return \'Code\';\n }\n 101ImportTemplate: &101ImportTemplate !!js/function >\n () => {\n return \'ObjectId\';\n }\n 102ImportTemplate: &102ImportTemplate !!js/function >\n () => {\n return \'Binary\';\n }\n 103ImportTemplate: &103ImportTemplate !!js/function >\n () => {\n return \'DBRef\';\n }\n 104ImportTemplate: &104ImportTemplate !!js/function >\n () => {\n return \'Double\';\n }\n 105ImportTemplate: &105ImportTemplate !!js/function >\n () => {\n return \'Int32\';\n }\n 106ImportTemplate: &106ImportTemplate !!js/function >\n () => {\n return \'Long\';\n }\n 107ImportTemplate: &107ImportTemplate !!js/function >\n () => {\n return \'MinKey\';\n }\n 108ImportTemplate: &108ImportTemplate !!js/function >\n () => {\n return \'MaxKey\';\n }\n 109ImportTemplate: &109ImportTemplate !!js/function >\n () => {\n return \'BSONRegExp\';\n }\n 110ImportTemplate: &110ImportTemplate !!js/function >\n () => {\n return \'Timestamp\';\n }\n 111ImportTemplate: &111ImportTemplate !!js/function >\n () => {\n return \'BSONSymbol\';\n }\n 112ImportTemplate: &112ImportTemplate !!js/function >\n () => {\n return \'Decimal128\';\n }\n 113ImportTemplate: &113ImportTemplate null\n 114ImportTemplate: &114ImportTemplate null\n 200ImportTemplate: &200ImportTemplate null\n 201ImportTemplate: &201ImportTemplate null\n 300ImportTemplate: &300ImportTemplate null\n 301ImportTemplate: &301ImportTemplate null\n 302ImportTemplate: &302ImportTemplate null\n 303ImportTemplate: &303ImportTemplate null\n 304ImportTemplate: &304ImportTemplate null\n 305ImportTemplate: &305ImportTemplate null\n 306ImportTemplate: &306ImportTemplate null\n# Universal types\n# Everything inherits from StringType because we haven\'t implemented any of them.\nBasicTypes:\n # Universal basic types\n _bool: &BoolType\n <<: *__type\n id: "_bool"\n code: 0\n template: *BoolTypeTemplate\n _integer: &IntegerType\n <<: *__type\n id: "_integer"\n code: 1\n template: *IntegerTypeTemplate\n _long: &LongBasicType\n <<: *__type\n id: "_long"\n code: 2\n template: *LongBasicTypeTemplate\n _decimal: &DecimalType\n <<: *__type\n id: "_decimal"\n code: 3\n template: *DecimalTypeTemplate\n _hex: &HexType\n <<: *__type\n id: "_hex"\n code: 4\n template: *HexTypeTemplate\n _octal: &OctalType\n <<: *__type\n id: "_octal"\n code: 5\n template: *OctalTypeTemplate\n _numeric: &NumericType\n <<: *__type\n id: "_numeric"\n code: 6\n template: *NumericTypeTemplate\n _string: &StringType\n <<: *__type\n id: "_string"\n code: 7\n template: *StringTypeTemplate\n _regex: &RegexType\n <<: *__type\n id: "_regex"\n code: 8\n template: *RegexTypeTemplate\n _array: &ArrayType\n <<: *__type\n id: "_array"\n code: 9\n template: *ArrayTypeTemplate\n argsTemplate: *ArrayTypeArgsTemplate\n _object: &ObjectType\n <<: *__type\n id: "_object"\n code: 10\n template: *ObjectTypeTemplate\n argsTemplate: *ObjectTypeArgsTemplate\n _null: &NullType\n <<: *__type\n id: "_null"\n code: 11\n template: *NullTypeTemplate\n _undefined: &UndefinedType\n <<: *__type\n id: "_undefined"\n code: 12\n template: *UndefinedTypeTemplate\n\nSyntax:\n equality:\n template: *EqualitySyntaxTemplate\n in:\n template: *InSyntaxTemplate\n and:\n template: *AndSyntaxTemplate\n or:\n template: *OrSyntaxTemplate\n not:\n template: *NotSyntaxTemplate\n unary:\n template: *UnarySyntaxTemplate\n binary:\n template: *BinarySyntaxTemplate\n parens:\n template: *ParensSyntaxTemplate\n eos:\n template: *EosSyntaxTemplate\n eof:\n template: *EofSyntaxTemplate\n # The new template takes in expr, and an optional skip argument and optional\n # id argument. The skip argument is a boolean that if true then doesn\'t add\n # new. The code argument is the symbol code being called. The template will check\n # if it is an exception, i.e. a type that is a constructor but may not use new.\n new:\n template: *NewSyntaxTemplate\n # The regex flags that change symbols between languages can be defined here.\n # Flags that aren\'t defined can be left blank and will be ignored.\n regexFlags: *RegexFlags\n bsonRegexFlags: *BSONRegexFlags\n driver: *DriverTemplate\nImports:\n import:\n template: *ImportTemplate\n driver:\n template: *DriverImportTemplate\n 0:\n template: *0ImportTemplate\n 1:\n template: *1ImportTemplate\n 2:\n template: *2ImportTemplate\n 3:\n template: *3ImportTemplate\n 4:\n template: *4ImportTemplate\n 5:\n template: *5ImportTemplate\n 6:\n template: *6ImportTemplate\n 7:\n template: *7ImportTemplate\n 8:\n template: *8ImportTemplate\n 9:\n template: *9ImportTemplate\n 10:\n template: *10ImportTemplate\n 11:\n template: *11ImportTemplate\n 12:\n template: *12ImportTemplate\n 100:\n template: *100ImportTemplate\n 101:\n template: *101ImportTemplate\n 102:\n template: *102ImportTemplate\n 103:\n template: *103ImportTemplate\n 104:\n template: *104ImportTemplate\n 105:\n template: *105ImportTemplate\n 106:\n template: *106ImportTemplate\n 107:\n template: *107ImportTemplate\n 108:\n template: *108ImportTemplate\n 109:\n template: *109ImportTemplate\n 110:\n template: *110ImportTemplate\n 111:\n template: *111ImportTemplate\n 112:\n template: *112ImportTemplate\n 113:\n template: *113ImportTemplate\n 114:\n template: *114ImportTemplate\n 200:\n template: *200ImportTemplate\n 201:\n template: *201ImportTemplate\n 300:\n template: *300ImportTemplate\n 301:\n template: *301ImportTemplate\n 302:\n template: *302ImportTemplate\n 303:\n template: *303ImportTemplate\n 304:\n template: *304ImportTemplate\n 305:\n template: *305ImportTemplate\n 306:\n template: *306ImportTemplate\nBsonTypes:\n Code: &CodeType\n <<: *__type\n id: "Code"\n code: 100\n type: *ObjectType\n attr:\n code:\n callable: *var\n args: null\n attr: null\n id: "code"\n type: *StringType\n template: *CodeCodeTemplate\n argsTemplate: *CodeCodeArgsTemplate\n scope:\n callable: *var\n args: null\n attr: null\n id: "scope"\n type: *StringType\n template: *CodeScopeTemplate\n argsTemplate: *CodeScopeArgsTemplate\n ObjectId: &ObjectIdType\n <<: *__type\n id: "ObjectId"\n code: 101\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: "toString"\n type: *StringType\n template: *ObjectIdToStringTemplate\n argsTemplate: *ObjectIdToStringArgsTemplate\n equals:\n <<: *__func\n id: "equals"\n args:\n - [ "ObjectId" ]\n type: *BoolType\n template: *ObjectIdEqualsTemplate\n argsTemplate: *ObjectIdEqualsArgsTemplate\n getTimestamp:\n <<: *__func\n id: "getTimestamp"\n type: *IntegerType\n template: *ObjectIdGetTimestampTemplate\n argsTemplate: *ObjectIdGetTimestampArgsTemplate\n BinData: &BinaryType\n <<: *__type\n id: "BinData"\n code: 102\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: "toString"\n type: *StringType\n template: *BinaryToStringTemplate\n argsTemplate: *BinaryToStringArgsTemplate\n base64:\n <<: *__func\n id: "base64"\n type: *StringType\n template: *BinaryValueTemplate\n argsTemplate: *BinaryValueArgsTemplate\n length:\n <<: *__func\n id: "length"\n type: *IntegerType\n template: *BinaryLengthTemplate\n argsTemplate: *BinaryLengthArgsTemplate\n subtype:\n <<: *__func\n id: "subtype"\n type: *IntegerType\n template: *BinarySubtypeTemplate\n argsTemplate: *BinarySubtypeArgsTemplate\n DBRef: &DBRefType\n <<: *__type\n id: "DBRef"\n code: 103\n type: *ObjectType\n attr:\n getDb:\n <<: *__func\n id: "getDb"\n type: *StringType\n template: *DBRefGetDBTemplate\n argsTemplate: *DBRefGetDBArgsTemplate\n $db:\n callable: *var\n args: null\n attr: null\n id: "$db"\n type: *StringType\n template: *DBRefGetDBTemplate\n argsTemplate: *DBRefGetDBArgsTemplate\n getCollection:\n <<: *__func\n id: "getCollection"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n getRef:\n <<: *__func\n id: "getRef"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n $ref:\n callable: *var\n args: null\n attr: null\n id: "$ref"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n getId:\n <<: *__func\n id: "getId"\n type: *StringType\n template: *DBRefGetIdTemplate\n argsTemplate: *DBRefGetIdArgsTemplate\n $id:\n callable: *var\n args: null\n attr: null\n id: "$id"\n type: *StringType\n template: *DBRefGetIdTemplate\n argsTemplate: *DBRefGetIdArgsTemplate\n NumberInt: &Int32Type\n <<: *__type\n id: "NumberInt"\n code: 105\n type: *ObjectType\n attr: {}\n NumberLong: &LongType\n <<: *__type\n id: "NumberLong"\n code: 106\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: "LongtoString" # Needs process method\n args:\n - [ *IntegerType, null ]\n type: *StringType\n template: *LongToStringTemplate\n argsTemplate: *LongToStringArgsTemplate\n equals:\n <<: *__func\n id: "equals"\n args:\n - [ "Long" ]\n type: *BoolType\n template: *LongEqualsTemplate\n argsTemplate: *LongEqualsArgsTemplate\n toInt:\n <<: *__func\n id: "toInt"\n type: *IntegerType\n template: *LongToIntTemplate\n argsTemplate: *LongToIntArgsTemplate\n toNumber:\n <<: *__func\n id: "toNumber"\n type: *DecimalType\n template: *LongToNumberTemplate\n argsTemplate: *LongToNumberArgsTemplate\n compare:\n <<: *__func\n id: "compare"\n args:\n - [ "Long" ]\n type: *StringType\n template: *LongCompareTemplate\n argsTemplate: *LongCompareArgsTemplate\n isOdd:\n <<: *__func\n id: "isOdd"\n type: *BoolType\n template: *LongIsOddTemplate\n argsTemplate: *LongIsOddArgsTemplate\n isZero:\n <<: *__func\n id: "isZero"\n type: *BoolType\n template: *LongIsZeroTemplate\n argsTemplate: *LongIsZeroArgsTemplate\n isNegative:\n <<: *__func\n id: "isNegative"\n type: *BoolType\n template: *LongIsNegativeTemplate\n argsTemplate: *LongIsNegativeArgsTemplate\n negate:\n <<: *__func\n id: "negate"\n type: "Long"\n template: *LongNegateTemplate\n argsTemplate: *LongNegateArgsTemplate\n not:\n <<: *__func\n id: "not"\n type: "Long"\n template: *LongNotTemplate\n argsTemplate: *LongNotArgsTemplate\n notEquals:\n <<: *__func\n id: "notEquals"\n args:\n - [ "Long" ]\n type: *BoolType\n template: *LongNotEqualsTemplate\n argsTemplate: *LongNotEqualsArgsTemplate\n greaterThan:\n <<: *__func\n id: "greaterThan"\n args:\n - [ "Long" ]\n type: *BoolType\n template: *LongGreaterThanTemplate\n argsTemplate: *LongGreaterThanArgsTemplate\n greaterThanOrEqual:\n <<: *__func\n id: "greaterThanOrEqual"\n args:\n - [ "Long" ]\n type: *BoolType\n template: *LongGreaterThanOrEqualTemplate\n argsTemplate: *LongGreaterThanOrEqualArgsTemplate\n lessThan:\n <<: *__func\n id: "lessThan"\n args:\n - [ "Long" ]\n type: *BoolType\n template: *LongLessThanTemplate\n argsTemplate: *LongLessThanArgsTemplate\n lessThanOrEqual:\n <<: *__func\n id: "lessThanOrEqual"\n args:\n - [ "Long" ]\n type: *BoolType\n template: *LongLessThanOrEqualTemplate\n argsTemplate: *LongLessThanOrEqualArgsTemplate\n add:\n <<: *__func\n id: "add"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongAddTemplate\n argsTemplate: *LongAddArgsTemplate\n subtract:\n <<: *__func\n id: "subtract"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongSubtractTemplate\n argsTemplate: *LongSubtractArgsTemplate\n multiply:\n <<: *__func\n id: "multiply"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongMultiplyTemplate\n argsTemplate: *LongMultiplyArgsTemplate\n div:\n <<: *__func\n id: "div"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongDivTemplate\n argsTemplate: *LongDivArgsTemplate\n modulo:\n <<: *__func\n id: "modulo"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongModuloTemplate\n argsTemplate: *LongModuloArgsTemplate\n and:\n <<: *__func\n id: "and"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongAndTemplate\n argsTemplate: *LongAndArgsTemplate\n or:\n <<: *__func\n id: "or"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongOrTemplate\n argsTemplate: *LongOrArgsTemplate\n xor:\n <<: *__func\n id: "xor"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongXorTemplate\n argsTemplate: *LongXorArgsTemplate\n shiftLeft:\n <<: *__func\n id: "shiftLeft"\n args:\n - [ *IntegerType ]\n type: "Long"\n template: *LongShiftLeftTemplate\n argsTemplate: *LongShiftLeftArgsTemplate\n shiftRight:\n <<: *__func\n id: "shiftRight"\n args:\n - [ *IntegerType ]\n type: "Long"\n template: *LongShiftRightTemplate\n argsTemplate: *LongShiftRightArgsTemplate\n MinKeyType: &MinKeyType\n <<: *__type\n id: "MinKey"\n code: 107\n type: *ObjectType\n MaxKeyType: &MaxKeyType\n <<: *__type\n id: "MaxKey"\n code: 108\n type: *ObjectType\n Timestamp: &TimestampType\n <<: *__type\n id: "Timestamp"\n code: 110\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: "toString"\n type: *StringType\n template: *TimestampToStringTemplate\n argsTemplate: *TimestampToStringArgsTemplate\n equals:\n <<: *__func\n id: "equals"\n args:\n - [ "Timestamp" ]\n type: *BoolType\n template: *TimestampEqualsTemplate\n argsTemplate: *TimestampEqualsArgsTemplate\n getLowBits:\n <<: *__func\n id: "getLowBits"\n type: *IntegerType\n template: *TimestampGetLowBitsTemplate\n argsTemplate: *TimestampGetLowBitsArgsTemplate\n getHighBits:\n <<: *__func\n id: "getHighBits"\n type: *IntegerType\n template: *TimestampGetHighBitsTemplate\n argsTemplate: *TimestampGetHighBitsArgsTemplate\n compare:\n <<: *__func\n id: "compare"\n args:\n - [ "Timestamp" ]\n type: *StringType\n template: *TimestampCompareTemplate\n argsTemplate: *TimestampCompareArgsTemplate\n notEquals:\n <<: *__func\n id: "notEquals"\n args:\n - [ "Timestamp" ]\n type: *BoolType\n template: *TimestampNotEqualsTemplate\n argsTemplate: *TimestampNotEqualsArgsTemplate\n greaterThan:\n <<: *__func\n id: "greaterThan"\n args:\n - [ "Timestamp" ]\n type: *BoolType\n template: *TimestampGreaterThanTemplate\n argsTemplate: *TimestampGreaterThanArgsTemplate\n greaterThanOrEqual:\n <<: *__func\n id: "greaterThanOrEqual"\n args:\n - [ "Timestamp" ]\n type: *BoolType\n template: *TimestampGreaterThanOrEqualTemplate\n argsTemplate: *TimestampGreaterThanOrEqualArgsTemplate\n lessThan:\n <<: *__func\n id: "lessThan"\n args:\n - [ "Timestamp" ]\n type: *BoolType\n template: *TimestampLessThanTemplate\n argsTemplate: *TimestampLessThanArgsTemplate\n lessThanOrEqual:\n <<: *__func\n id: "lessThanOrEqual"\n args:\n - [ "Timestamp" ]\n type: *BoolType\n template: *TimestampLessThanOrEqualTemplate\n argsTemplate: *TimestampLessThanOrEqualArgsTemplate\n BSONSymbol: &SymbolType\n <<: *__type\n id: "BSONSymbol"\n code: 111\n type: *ObjectType\n attr:\n valueOf:\n <<: *__func\n id: "valueOf"\n type: *StringType\n template: *SymbolValueOfTemplate\n argsTemplate: *SymbolValueOfArgsTemplate\n toString:\n <<: *__func\n id: "toString"\n type: *StringType\n template: *SymbolToStringTemplate\n argsTemplate: *SymbolToStringArgsTemplate\n inspect:\n <<: *__func\n id: "inspect"\n type: *StringType\n template: *SymbolInspectTemplate\n argsTemplate: *SymbolInspectArgsTemplate\n Double: &DoubleType\n <<: *__type\n id: "Double"\n code: 104\n type: *ObjectType\n attr: {}\n Decimal128: &Decimal128Type\n <<: *__type\n id: "Decimal128"\n code: 112\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: "toString"\n type: *StringType\n template: *Decimal128ToStringTemplate\n argsTemplate: *Decimal128ToStringArgsTemplate\n NumberDecimal: &NumberDecimalType\n <<: *__type\n id: "NumberDecimal"\n code: 112\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: "toString"\n type: *StringType\n template: *Decimal128ToStringTemplate\n argsTemplate: *Decimal128ToStringArgsTemplate\n\n\n SUBTYPE_DEFAULT:\n id: "SUBTYPE_DEFAULT"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeDefaultTemplate\n SUBTYPE_FUNCTION:\n id: "SUBTYPE_FUNCTION"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeFunctionTemplate\n SUBTYPE_BYTE_ARRAY:\n id: "SUBTYPE_BYTE_ARRAY"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeByteArrayTemplate\n SUBTYPE_UUID_OLD:\n id: "SUBTYPE_UUID_OLD"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUuidOldTemplate\n SUBTYPE_UUID:\n id: "SUBTYPE_UUID"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUuidTemplate\n SUBTYPE_MD5:\n id: "SUBTYPE_MD5"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeMd5Template\n SUBTYPE_USER_DEFINED:\n id: "SUBTYPE_USER_DEFINED"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUserDefinedTemplate\n BSONRegExpType: &BSONRegExpType\n <<: *__type\n id: "BSONRegExp"\n code: 109\n type: *ObjectType\nNativeTypes:\n Date: &DateType\n <<: *__type\n id: "Date"\n code: 200\n type: *ObjectType\n attr: {} # TODO: no built-in date methods added yet\n RegExp: &RegExpType\n <<: *__type\n id: "RegExp"\n code: 8\n type: *ObjectType\n attr: {}\n\n\nBsonSymbols:\n Code: &CodeSymbol\n id: "Code"\n code: 100\n callable: *constructor\n args:\n - [ *StringType, null ]\n - [ *ObjectType, null ]\n type: *CodeType\n attr: {}\n template: *CodeSymbolTemplate\n argsTemplate: *CodeSymbolArgsTemplate\n ObjectId: &ObjectIdSymbol\n id: "ObjectId"\n code: 101\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n type: *ObjectIdType\n attr:\n createFromHexString:\n <<: *__func\n id: "createFromHexString"\n args:\n - [ *StringType ]\n type: *ObjectIdType\n template: *ObjectIdCreateFromHexStringTemplate\n argsTemplate: *ObjectIdCreateFromHexStringArgsTemplate\n createFromTime:\n <<: *__func\n id: "ObjectIdCreateFromTime"\n args:\n - [ *NumericType, *DateType ]\n type: *ObjectIdType\n template: *ObjectIdCreateFromTimeTemplate\n argsTemplate: *ObjectIdCreateFromTimeArgsTemplate\n isValid:\n <<: *__func\n id: "isValid"\n args:\n - [ *StringType ]\n type: *BoolType\n template: *ObjectIdIsValidTemplate\n argsTemplate: *ObjectIdIsValidArgsTemplate\n template: *ObjectIdSymbolTemplate\n argsTemplate: *ObjectIdSymbolArgsTemplate\n BinData: &BinarySymbol\n id: "BinData"\n code: 102\n callable: *constructor\n args:\n - [ *IntegerType ]\n - [ *StringType ]\n type: *BinaryType\n attr: {}\n template: *BinarySymbolTemplate\n argsTemplate: *BinarySymbolArgsTemplate\n DBRef:\n id: "DBRef"\n code: 103\n callable: *constructor\n args:\n - [ *StringType ]\n - [ *ObjectIdType ]\n - [ *StringType, null ]\n type: *DBRefType\n attr: {}\n template: *DBRefSymbolTemplate\n argsTemplate: *DBRefSymbolArgsTemplate\n NumberInt:\n id: "Int32"\n code: 105\n callable: *constructor\n args:\n - [ *NumericType, *StringType, null ]\n type: *Int32Type\n attr: {}\n template: *Int32SymbolTemplate\n argsTemplate: *Int32SymbolArgsTemplate\n NumberLong:\n id: "NumberLong"\n code: 106\n callable: *constructor\n args:\n - [ *IntegerType, *StringType, null ]\n type: *LongType\n attr: {}\n template: *LongSymbolTemplate\n argsTemplate: *LongSymbolArgsTemplate\n MinKey:\n id: "MinKey"\n code: 107\n callable: *constructor\n args: []\n type: *MinKeyType\n attr: {}\n template: *MinKeySymbolTemplate\n argsTemplate: *MinKeySymbolArgsTemplate\n MaxKey:\n id: "MaxKey"\n code: 108\n callable: *constructor\n args: []\n type: *MaxKeyType\n attr: {}\n template: *MaxKeySymbolTemplate\n argsTemplate: *MaxKeySymbolArgsTemplate\n Timestamp:\n id: "Timestamp"\n code: 110\n callable: *constructor\n args:\n - [ *IntegerType, null ]\n - [ *IntegerType, null ]\n type: *TimestampType\n attr: {}\n template: *TimestampSymbolTemplate\n argsTemplate: *TimestampSymbolArgsTemplate\n Symbol:\n id: "Symbol"\n code: 111\n callable: *constructor\n args:\n - [ *StringType ]\n type: *SymbolType\n attr: {}\n template: *SymbolSymbolTemplate\n argsTemplate: *SymbolSymbolArgsTemplate\n NumberDecimal:\n id: "NumberDecimal"\n code: 112\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n type: *Decimal128Type\n attr: {}\n template: *Decimal128SymbolTemplate\n argsTemplate: *Decimal128SymbolArgsTemplate\n BSONRegExp:\n id: "BSONRegExp"\n code: 109\n callable: *constructor\n args:\n - [ *StringType ]\n - [ *StringType, null ]\n type: *BSONRegExpType\n attr: {}\n template: *BSONRegExpSymbolTemplate\n argsTemplate: *BSONRegExpSymbolArgsTemplate\n BSONSymbol:\n id: "BSONSymbol"\n code: 111\n callable: *constructor\n args:\n - [ *StringType ]\n type: *SymbolType\n attr: {}\n template: *SymbolSymbolTemplate\n argsTemplate: *SymbolSymbolArgsTemplate\n Decimal128:\n id: "Decimal128"\n code: 112\n callable: *constructor\n args:\n - [ *ObjectType ]\n type: *Decimal128Type\n attr:\n fromString:\n id: "fromString"\n callable: *func\n args:\n - [ *StringType ]\n type: *Decimal128Type\n attr: {}\n template: *Decimal128SymbolFromStringTemplate\n argsTemplate: *Decimal128SymbolFromStringArgsTemplate\n template: *Decimal128SymbolTemplate\n argsTemplate: *Decimal128SymbolArgsTemplate\n Double:\n id: "Double"\n code: 104\n callable: *constructor\n args:\n - [ *NumericType, *StringType ]\n type: *DoubleType\n attr: {}\n template: *DoubleSymbolTemplate\n argsTemplate: *DoubleSymbolArgsTemplate\n Int32:\n id: "Int32"\n code: 105\n callable: *constructor\n args:\n - [ *NumericType, *StringType ]\n type: *Int32Type\n attr: {}\n template: *Int32SymbolTemplate\n argsTemplate: *Int32SymbolArgsTemplate\n Long:\n id: "Long"\n code: 106\n callable: *constructor\n args:\n - [ *IntegerType ]\n - [ *IntegerType ]\n type: *LongType\n attr:\n MAX_VALUE:\n id: "MAX_VALUE"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolMaxTemplate\n argsTemplate: *LongSymbolMaxArgsTemplate\n MIN_VALUE:\n id: "MIN_VALUE"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolMinTemplate\n argsTemplate: *LongSymbolMinArgsTemplate\n ZERO:\n id: "ZERO"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolZeroTemplate\n argsTemplate: *LongSymbolZeroArgsTemplate\n ONE:\n id: "ONE"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolOneTemplate\n argsTemplate: *LongSymbolOneArgsTemplate\n NEG_ONE:\n id: "NEG_ONE"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolNegOneTemplate\n argsTemplate: *LongSymbolNegOneArgsTemplate\n fromBits:\n id: "LongfromBits" # Needs process method\n callable: *func\n args:\n - [ *IntegerType ]\n - [ *IntegerType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromBitsTemplate\n argsTemplate: *LongSymbolFromBitsArgsTemplate\n fromInt:\n id: "fromInt"\n callable: *func\n args:\n - [ *IntegerType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromIntTemplate\n argsTemplate: *LongSymbolFromIntArgsTemplate\n fromNumber:\n id: "fromNumber"\n callable: *func\n args:\n - [ *NumericType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromNumberTemplate\n argsTemplate: *LongSymbolFromNumberArgsTemplate\n fromString:\n id: "fromString"\n callable: *func\n args:\n - [ *StringType ]\n - [ *IntegerType, null ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromStringTemplate\n argsTemplate: *LongSymbolFromStringArgsTemplate\n template: *LongSymbolTemplate\n argsTemplate: *LongSymbolArgsTemplate\n\nNativeSymbols:\n Number:\n id: "Number"\n code: 2\n callable: *constructor\n args:\n - [ *IntegerType, *StringType, null ]\n type: *NumericType\n attr: {} # TODO: no built-in number funcs added yet\n template: *NumberSymbolTemplate\n argsTemplate: *NumberSymbolArgsTemplate\n Date: # Needs emit method\n id: "Date"\n code: 200\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n type: *DateType\n attr: # TODO: add more date funcs?\n now:\n id: "now"\n code: 200.1\n callable: *func\n args: []\n type: *DateType\n attr: {}\n template: *DateSymbolNowTemplate\n argsTemplate: *DateSymbolNowArgsTemplate\n template: *DateSymbolTemplate\n argsTemplate: *DateSymbolArgsTemplate\n ISODate: # Needs emit method\n id: "ISODate"\n code: 200\n callable: *constructor\n args:\n - [ *StringType, null ]\n type: *DateType\n attr:\n now:\n id: "now"\n callable: *constructor\n args: []\n type: *DateType\n attr: {}\n template: *DateSymbolNowTemplate\n argsTemplate: *DateSymbolNowArgsTemplate\n template: *DateSymbolTemplate\n argsTemplate: *DateSymbolArgsTemplate\n RegExp: # Needs process method\n id: "RegExp"\n code: 8\n callable: *constructor\n args:\n - [ *StringType, *RegexType ]\n - [ *StringType, null ]\n type: *RegExpType\n attr: {} # TODO: no built-in regex funcs added yet\n template: *RegExpSymbolTemplate\n argsTemplate: *RegExpSymbolArgsTemplate\n\n'},4314:e=>{e.exports='SymbolTypes:\n VAR: &var 0\n CONSTRUCTOR: &constructor 1\n FUNC: &func 2\n# Internal patterns to save typing\n__type: &__type\n id: null\n callable: *var\n args: null\n type: null\n attr: {}\n template: null\n argsTemplate: null\n__func: &__func\n callable: *func\n args: []\n attr: {}\n template: null\n argsTemplate: null\n\n#############################################\n# Sample Templates #\n# #\n# The expected arguments are commented next #\n# to the template itself. Currently all are #\n# set to null, but to define a function #\n# replace \'null\' with \'!!js/function > \\n #\n# and a function defined below. #\n# #\n# See the other template files for examples #\n# #\n# Good to know: #\n# lhs is left-hand-side of the expression #\n# rhs is right-hand-side of the expression #\n# All args are strings unless noted #\n# - arg? is boolean #\n# - arg# is number #\n# #\n#############################################\nTemplates:\n ########\n # Misc #\n ########\n\n # Filter out regex flags that have translations or are unsupported.\n RegexFlags: &RegexFlags\n i: \'i\'\n m: \'m\'\n u: \'u\'\n y: \'y\'\n g: \'g\'\n BSONRegexFlags: &BSONRegexFlags\n i: \'i\'\n m: \'m\'\n x: \'x\'\n s: \'s\'\n l: \'l\'\n u: \'u\'\n\n #############################################\n # Syntax #\n # #\n # Templates for language syntax expressions #\n # #\n #############################################\n\n DriverTemplate: &DriverTemplate null\n EqualitySyntaxTemplate: &EqualitySyntaxTemplate !!js/function >\n (lhs, op, rhs) => {\n if (op.includes(\'!\') || op.includes(\'not\')) {\n return lhs !== rhs;\n }\n if (op === \'==\' || op === \'===\' || op === \'is\') {\n if (typeof(lhs) === \'object\' && \'equals\' in lhs) {\n // Use \'.equals\' for objects, if it exists.\n return lhs.equals(rhs);\n }\n return lhs === rhs;\n }\n if (op === \'>\') {\n return lhs > rhs;\n }\n if (op === \'<\') {\n return lhs < rhs;\n }\n if (op === \'>=\') {\n return lhs >= rhs;\n }\n if (op === \'<=\') {\n return lhs <= rhs;\n }\n throw new Error(`unrecognized operation: ${op}`);\n }\n InSyntaxTemplate: &InSyntaxTemplate !!js/function >\n (lhs, op, rhs) => {\n if (op.includes(\'!\') || op.includes(\'not\')) {\n if (typeof rhs === \'array\') {\n return rhs.indexOf(lhs) === -1;\n }\n return !(lhs in rhs);\n }\n if (typeof rhs === \'array\') {\n return rhs.indexOf(lhs) !== -1;\n }\n return lhs in rhs;\n }\n\n AndSyntaxTemplate: &AndSyntaxTemplate !!js/function >\n (args) => {\n return args.reduce((t, k, i) => {\n return t && k;\n });\n }\n OrSyntaxTemplate: &OrSyntaxTemplate !!js/function >\n (args) => {\n return args.reduce((t, k, i) => {\n return t || k;\n });\n }\n NotSyntaxTemplate: &NotSyntaxTemplate !!js/function >\n (arg) => {\n return !arg;\n }\n UnarySyntaxTemplate: &UnarySyntaxTemplate !!js/function >\n (op, arg) => {\n switch(op) {\n case \'+\':\n return +arg;\n case \'-\':\n return -arg;\n case \'~\':\n return ~arg;\n default:\n throw new Error(`unrecognized operation: ${op}`);\n }\n }\n BinarySyntaxTemplate: &BinarySyntaxTemplate !!js/function >\n (args) => {\n return args.reduce((s, op, i, arr) => {\n if (i % 2 === 0) {\n return s;\n }\n const rhs = arr[i + 1];\n switch(op) {\n case \'+\':\n return s + rhs;\n case \'-\':\n return s - rhs;\n case \'*\':\n return s * rhs;\n case \'/\':\n return s / rhs;\n case \'**\':\n return Math.pow(s, rhs);\n case \'//\':\n return Math.floor(s, rhs);\n case \'%\':\n return s % rhs;\n case \'>>\':\n return s >> rhs;\n case \'<<\':\n return s << rhs;\n case \'|\':\n return s | rhs;\n case \'&\':\n return s & rhs;\n case \'^\':\n return s ^ rhs;\n default:\n throw new Error(`unrecognized operation: ${op}`);\n }\n }, args[0]);\n }\n ParensSyntaxTemplate: &ParensSyntaxTemplate !!js/function >\n (arg) => {\n return arg;\n }\n EosSyntaxTemplate: &EosSyntaxTemplate !!js/function >\n () => {\n return \'a unique thing\';\n }\n EofSyntaxTemplate: &EofSyntaxTemplate !!js/function >\n () => {\n return \'a unique thing\';\n }\n FloorDivTemplate: &FloorDivSyntaxTemplate null # Args: lhs, rhs\n PowerTemplate: &PowerSyntaxTemplate null # Args: lhs, rhs\n NewTemplate: &NewSyntaxTemplate null # Args: expression, skip?, code# [to check if meant to be skipped]\n\n #############################################\n # Literal Types #\n # #\n # Templates for literal type instance. Most #\n # get passed the literal itself as an arg. #\n # #\n #############################################\n StringTypeTemplate: &StringTypeTemplate !!js/function >\n (str) => {\n let newStr = str.toString();\n if (\n (newStr.charAt(0) === \'"\' && newStr.charAt(newStr.length - 1) === \'"\') ||\n (newStr.charAt(0) === \'\\\'\' && newStr.charAt(newStr.length - 1) === \'\\\'\')\n ) {\n newStr = newStr.substr(1, newStr.length - 2);\n }\n return newStr;\n }\n RegexTypeTemplate: &RegexTypeTemplate !!js/function >\n (pattern, flags) => {\n return new RegExp(pattern, flags);\n }\n BoolTypeTemplate: &BoolTypeTemplate !!js/function >\n (str) => {\n return str.toLowerCase() === \'true\';\n }\n IntegerTypeTemplate: &IntegerTypeTemplate !!js/function >\n (arg) => {\n return parseInt(arg, 10);\n }\n DecimalTypeTemplate: &DecimalTypeTemplate !!js/function >\n (arg) => {\n return parseFloat(arg);\n }\n LongBasicTypeTemplate: &LongBasicTypeTemplate !!js/function >\n (arg) => {\n return parseInt(arg, 10);\n }\n HexTypeTemplate: &HexTypeTemplate !!js/function >\n (arg) => {\n return parseInt(arg, 16);\n }\n OctalTypeTemplate: &OctalTypeTemplate !!js/function >\n (arg) => {\n arg = arg.replace(/[oO]/g, \'\')\n return parseInt(arg, 8);\n }\n NumericTypeTemplate: &NumericTypeTemplate !!js/function >\n (arg) => {\n if (arg.contains(\'x\')) {\n return parseInt(arg, 16);\n }\n if (arg.contains(\'o\') || arg.startsWith(\'0\')) {\n arg = arg.replace(/o/g, \'\')\n return parseInt(arg, 8);\n }\n return parseFloat(arg);\n }\n ArrayTypeTemplate: &ArrayTypeTemplate null\n ArrayTypeArgsTemplate: &ArrayTypeArgsTemplate null # Args: single array element, nestedness, lastElement? (note: not being used atm)\n NullTypeTemplate: &NullTypeTemplate !!js/function >\n () => {\n return null;\n }\n UndefinedTypeTemplate: &UndefinedTypeTemplate !!js/function >\n () => {\n return undefined;\n }\n ObjectTypeTemplate: &ObjectTypeTemplate null # Args: literal (for empty array, is empty string. Otherwise all set)\n ObjectTypeArgsTemplate: &ObjectTypeArgsTemplate null # Args: single object element [2] (i.e. array with [key, value]), nestedness#\n\n #############################################\n # Symbols #\n # #\n # Templates for symbols, can be either #\n # functions or variables. #\n # #\n # The *SymbolTemplates return names and #\n # usually don\'t take any arguments. The #\n # *SymbolArgsTemplates are invoked for func #\n # calls. The first argument is always the #\n # lhs, i.e. the symbol returned from the #\n # corresponding SymbolTemplate. The rest of #\n # the arguments are the processed arguments #\n # passed to the original function. #\n # #\n #############################################\n CodeSymbolTemplate: &CodeSymbolTemplate null # No args\n CodeSymbolArgsTemplate: &CodeSymbolArgsTemplate null # Args: code, scope\n ObjectIdSymbolTemplate: &ObjectIdSymbolTemplate null # No args\n ObjectIdSymbolArgsTemplate: &ObjectIdSymbolArgsTemplate null # Args: lhs, string (can be empty or null for no arg)\n BinarySymbolTemplate: &BinarySymbolTemplate null\n BinarySymbolArgsTemplate: &BinarySymbolArgsTemplate null\n BinarySymbolSubtypeDefaultTemplate: &BinarySymbolSubtypeDefaultTemplate null\n BinarySymbolSubtypeFunctionTemplate: &BinarySymbolSubtypeFunctionTemplate null\n BinarySymbolSubtypeByteArrayTemplate: &BinarySymbolSubtypeByteArrayTemplate null\n BinarySymbolSubtypeUuidOldTemplate: &BinarySymbolSubtypeUuidOldTemplate null\n BinarySymbolSubtypeUuidTemplate: &BinarySymbolSubtypeUuidTemplate null\n BinarySymbolSubtypeMd5Template: &BinarySymbolSubtypeMd5Template null\n BinarySymbolSubtypeUserDefinedTemplate: &BinarySymbolSubtypeUserDefinedTemplate null\n DBRefSymbolTemplate: &DBRefSymbolTemplate null # No args\n DBRefSymbolArgsTemplate: &DBRefSymbolArgsTemplate null # Args: lhs, coll, id, db\n DoubleSymbolTemplate: &DoubleSymbolTemplate null # No args\n DoubleSymbolArgsTemplate: &DoubleSymbolArgsTemplate null # Args: lhs, arg, argType (i.e. \'_string\', \'_double\')\n Int32SymbolTemplate: &Int32SymbolTemplate null # No args\n Int32SymbolArgsTemplate: &Int32SymbolArgsTemplate null # Args: lhs, arg, argType\n LongSymbolTemplate: &LongSymbolTemplate null # No args\n LongSymbolArgsTemplate: &LongSymbolArgsTemplate !!js/function > # Args: lhs, arg, argType\n (lhs, arg) => {\n return lhs.fromNumber(arg);\n }\n RegExpSymbolTemplate: &RegExpSymbolTemplate null # No args\n RegExpSymbolArgsTemplate: &RegExpSymbolArgsTemplate null # Args: lhs, pattern, flags\n SymbolSymbolTemplate: &SymbolSymbolTemplate null # No args\n SymbolSymbolArgsTemplate: &SymbolSymbolArgsTemplate null # Args: lhs, arg\n BSONRegExpSymbolTemplate: &BSONRegExpSymbolTemplate null # No args\n BSONRegExpSymbolArgsTemplate: &BSONRegExpSymbolArgsTemplate null # Args: lhs, pattern, flags\n Decimal128SymbolTemplate: &Decimal128SymbolTemplate null # No args\n Decimal128SymbolArgsTemplate: &Decimal128SymbolArgsTemplate null # Args: lhs, arg\n MinKeySymbolTemplate: &MinKeySymbolTemplate null # No args\n MinKeySymbolArgsTemplate: &MinKeySymbolArgsTemplate null # No args\n MaxKeySymbolTemplate: &MaxKeySymbolTemplate null # No args\n MaxKeySymbolArgsTemplate: &MaxKeySymbolArgsTemplate null # No args\n TimestampSymbolTemplate: &TimestampSymbolTemplate null # No args\n TimestampSymbolArgsTemplate: &TimestampSymbolArgsTemplate null # Args: lhs, low, high\n # non bson-specific\n NumberSymbolTemplate: &NumberSymbolTemplate !!js/function >\n () => {\n return Number;\n }\n NumberSymbolArgsTemplate: &NumberSymbolArgsTemplate null # Args: lhs, arg, argType\n DateSymbolTemplate: &DateSymbolTemplate null # No args\n DateSymbolArgsTemplate: &DateSymbolArgsTemplate !!js/function >\n (lhs, date, isString) => {\n if (isString) {\n return date.toString();\n }\n return date;\n }\n\n #############################################\n # Object Attributes/Methods #\n # #\n # These\'re variables or functions called on #\n # instantiated objects. For example, #\n # ObjectId().isValid() or Timestamp().t #\n # #\n # They follow the same pattern with the\n # *Template/*ArgsTemplates: usually no args #\n # to the Template and lhs plus any original #\n # arguments to the ArgsTemplate. #\n # #\n #############################################\n CodeCodeTemplate: &CodeCodeTemplate null\n CodeCodeArgsTemplate: &CodeCodeArgsTemplate null\n CodeScopeTemplate: &CodeScopeTemplate null\n CodeScopeArgsTemplate: &CodeScopeArgsTemplate null\n ObjectIdToStringTemplate: &ObjectIdToStringTemplate !!js/function >\n (lhs, rhs) => {\n return lhs.toString();\n }\n ObjectIdToStringArgsTemplate: &ObjectIdToStringArgsTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n ObjectIdEqualsTemplate: &ObjectIdEqualsTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n ObjectIdEqualsArgsTemplate: &ObjectIdEqualsArgsTemplate !!js/function >\n (lhs, rhs) => {\n return lhs.equals(rhs);\n }\n ObjectIdGetTimestampTemplate: &ObjectIdGetTimestampTemplate !!js/function >\n (lhs, rhs) => {\n return lhs.getTimestamp();\n }\n ObjectIdGetTimestampArgsTemplate: &ObjectIdGetTimestampArgsTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n ObjectIdIsValidTemplate: &ObjectIdIsValidTemplate !!js/function >\n (lhs, rhs) => {\n return lhs.isValid;\n }\n ObjectIdIsValidArgsTemplate: &ObjectIdIsValidArgsTemplate null\n BinaryValueTemplate: &BinaryValueTemplate null\n BinaryValueArgsTemplate: &BinaryValueArgsTemplate null\n BinaryLengthTemplate: &BinaryLengthTemplate null\n BinaryLengthArgsTemplate: &BinaryLengthArgsTemplate null\n BinaryToStringTemplate: &BinaryToStringTemplate null\n BinaryToStringArgsTemplate: &BinaryToStringArgsTemplate null\n BinarySubtypeTemplate: &BinarySubtypeTemplate null\n BinarySubtypeArgsTemplate: &BinarySubtypeArgsTemplate null\n DBRefGetDBTemplate: &DBRefGetDBTemplate !!js/function >\n (lhs, rhs) => {\n return lhs.db;\n }\n DBRefGetCollectionTemplate: &DBRefGetCollectionTemplate !!js/function >\n (lhs, rhs) => {\n return lhs.collection;\n }\n DBRefGetIdTemplate: &DBRefGetIdTemplate !!js/function >\n (lhs, rhs) => {\n return lhs.oid;\n }\n DBRefGetDBArgsTemplate: &DBRefGetDBArgsTemplate !!js/function >\n (lhs, rhs) => {\n return lhs;\n }\n DBRefGetCollectionArgsTemplate: &DBRefGetCollectionArgsTemplate !!js/function >\n (lhs, rhs) => {\n return lhs;\n }\n DBRefGetIdArgsTemplate: &DBRefGetIdArgsTemplate !!js/function >\n (lhs, rhs) => {\n return lhs;\n }\n LongEqualsTemplate: &LongEqualsTemplate null\n LongEqualsArgsTemplate: &LongEqualsArgsTemplate null\n LongToStringTemplate: &LongToStringTemplate null\n LongToStringArgsTemplate: &LongToStringArgsTemplate null\n LongToIntTemplate: &LongToIntTemplate null\n LongToIntArgsTemplate: &LongToIntArgsTemplate null\n LongValueOfTemplate: &LongValueOfTemplate null\n LongValueOfArgsTemplate: &LongValueOfArgsTemplate null\n LongToNumberTemplate: &LongToNumberTemplate null\n LongToNumberArgsTemplate: &LongToNumberArgsTemplate null\n LongAddTemplate: &LongAddTemplate null\n LongAddArgsTemplate: &LongAddArgsTemplate null\n LongSubtractTemplate: &LongSubtractTemplate null\n LongSubtractArgsTemplate: &LongSubtractArgsTemplate null\n LongMultiplyTemplate: &LongMultiplyTemplate null\n LongMultiplyArgsTemplate: &LongMultiplyArgsTemplate null\n LongDivTemplate: &LongDivTemplate null\n LongDivArgsTemplate: &LongDivArgsTemplate null\n LongModuloTemplate: &LongModuloTemplate null\n LongModuloArgsTemplate: &LongModuloArgsTemplate null\n LongAndTemplate: &LongAndTemplate null\n LongAndArgsTemplate: &LongAndArgsTemplate null\n LongOrTemplate: &LongOrTemplate null\n LongOrArgsTemplate: &LongOrArgsTemplate null\n LongXorTemplate: &LongXorTemplate null\n LongXorArgsTemplate: &LongXorArgsTemplate null\n LongShiftLeftTemplate: &LongShiftLeftTemplate null\n LongShiftLeftArgsTemplate: &LongShiftLeftArgsTemplate null\n LongShiftRightTemplate: &LongShiftRightTemplate null\n LongShiftRightArgsTemplate: &LongShiftRightArgsTemplate null\n LongCompareTemplate: &LongCompareTemplate null\n LongCompareArgsTemplate: &LongCompareArgsTemplate null\n LongIsOddTemplate: &LongIsOddTemplate null\n LongIsOddArgsTemplate: &LongIsOddArgsTemplate null\n LongIsZeroTemplate: &LongIsZeroTemplate null\n LongIsZeroArgsTemplate: &LongIsZeroArgsTemplate null\n LongIsNegativeTemplate: &LongIsNegativeTemplate null\n LongIsNegativeArgsTemplate: &LongIsNegativeArgsTemplate null\n LongNegateTemplate: &LongNegateTemplate null\n LongNegateArgsTemplate: &LongNegateArgsTemplate null\n LongNotTemplate: &LongNotTemplate null\n LongNotArgsTemplate: &LongNotArgsTemplate null\n LongNotEqualsTemplate: &LongNotEqualsTemplate null\n LongNotEqualsArgsTemplate: &LongNotEqualsArgsTemplate null\n LongGreaterThanTemplate: &LongGreaterThanTemplate null\n LongGreaterThanArgsTemplate: &LongGreaterThanArgsTemplate null\n LongGreaterThanOrEqualTemplate: &LongGreaterThanOrEqualTemplate null\n LongGreaterThanOrEqualArgsTemplate: &LongGreaterThanOrEqualArgsTemplate null\n LongLessThanTemplate: &LongLessThanTemplate null\n LongLessThanArgsTemplate: &LongLessThanArgsTemplate null\n LongLessThanOrEqualTemplate: &LongLessThanOrEqualTemplate null\n LongLessThanOrEqualArgsTemplate: &LongLessThanOrEqualArgsTemplate null\n LongFloatApproxTemplate: &LongFloatApproxTemplate !!js/function >\n (lhs, rhs) => {\n return lhs.toNumber();\n }\n LongTopTemplate: &LongTopTemplate !!js/function >\n (lhs, rhs) => {\n return lhs.high;\n }\n LongBottomTemplate: &LongBottomTemplate !!js/function >\n (lhs, rhs) => {\n return lhs.low;\n }\n TimestampToStringTemplate: &TimestampToStringTemplate null\n TimestampToStringArgsTemplate: &TimestampToStringArgsTemplate null\n TimestampEqualsTemplate: &TimestampEqualsTemplate null\n TimestampEqualsArgsTemplate: &TimestampEqualsArgsTemplate null\n TimestampGetLowBitsTemplate: &TimestampGetLowBitsTemplate !!js/function >\n (lhs, rhs) => {\n return lhs.getLowBits();\n }\n TimestampGetLowBitsArgsTemplate: &TimestampGetLowBitsArgsTemplate !!js/function >\n (lhs, rhs) => {\n return lhs;\n }\n TimestampGetHighBitsTemplate: &TimestampGetHighBitsTemplate !!js/function >\n (lhs, rhs) => {\n return lhs.getHighBits();\n }\n TimestampGetHighBitsArgsTemplate: &TimestampGetHighBitsArgsTemplate !!js/function >\n (lhs, rhs) => {\n return lhs;\n }\n TimestampTTemplate: &TimestampTTemplate !!js/function >\n (lhs, rhs) => {\n return lhs.getLowBits();\n }\n TimestampITemplate: &TimestampITemplate !!js/function >\n (lhs, rhs) => {\n return lhs.getHighBits();\n }\n TimestampAsDateTemplate: &TimestampAsDateTemplate !!js/function >\n (lhs, rhs) => {\n return new Date(lhs.getHighBits() * 1000);\n }\n TimestampAsDateArgsTemplate: &TimestampAsDateArgsTemplate !!js/function >\n (lhs, rhs) => {\n return lhs;\n }\n TimestampCompareTemplate: &TimestampCompareTemplate null\n TimestampCompareArgsTemplate: &TimestampCompareArgsTemplate null\n TimestampNotEqualsTemplate: &TimestampNotEqualsTemplate null\n TimestampNotEqualsArgsTemplate: &TimestampNotEqualsArgsTemplate null\n TimestampGreaterThanTemplate: &TimestampGreaterThanTemplate null\n TimestampGreaterThanArgsTemplate: &TimestampGreaterThanArgsTemplate null\n TimestampGreaterThanOrEqualTemplate: &TimestampGreaterThanOrEqualTemplate null\n TimestampGreaterThanOrEqualArgsTemplate: &TimestampGreaterThanOrEqualArgsTemplate null\n TimestampLessThanTemplate: &TimestampLessThanTemplate null\n TimestampLessThanArgsTemplate: &TimestampLessThanArgsTemplate null\n TimestampLessThanOrEqualTemplate: &TimestampLessThanOrEqualTemplate null\n TimestampLessThanOrEqualArgsTemplate: &TimestampLessThanOrEqualArgsTemplate null\n SymbolValueOfTemplate: &SymbolValueOfTemplate null\n SymbolValueOfArgsTemplate: &SymbolValueOfArgsTemplate null\n SymbolInspectTemplate: &SymbolInspectTemplate null\n SymbolInspectArgsTemplate: &SymbolInspectArgsTemplate null\n SymbolToStringTemplate: &SymbolToStringTemplate null\n SymbolToStringArgsTemplate: &SymbolToStringArgsTemplate null\n Decimal128ToStringTemplate: &Decimal128ToStringTemplate null\n Decimal128ToStringArgsTemplate: &Decimal128ToStringArgsTemplate null\n # non bson-specific\n DateSymbolNowTemplate: &DateSymbolNowTemplate !!js/function >\n () => {\n return Date.now;\n }\n DateSymbolNowArgsTemplate: &DateSymbolNowArgsTemplate null\n\n #############################################\n # Symbol Attributes/Methods #\n # #\n # These\'re variables or functions called on #\n # symbols. Also called bson-utils. #\n # #\n # They are basically the same thing as #\n # object attributes/methods, but need to be #\n # distinguished since they are separate #\n # namespaces that happen to have the same #\n # name which is v confusing. #\n # #\n # For example, ObjectId().toString() is an #\n # object method, while ObjectId.fromString #\n # is a symbol attribute. These are two #\n # separate ObjectId related namespaces that #\n # don\'t overlap. #\n # #\n #############################################\n LongSymbolMaxTemplate: &LongSymbolMaxTemplate null\n LongSymbolMaxArgsTemplate: &LongSymbolMaxArgsTemplate null\n LongSymbolMinTemplate: &LongSymbolMinTemplate null\n LongSymbolMinArgsTemplate: &LongSymbolMinArgsTemplate null\n LongSymbolZeroTemplate: &LongSymbolZeroTemplate null\n LongSymbolZeroArgsTemplate: &LongSymbolZeroArgsTemplate null\n LongSymbolOneTemplate: &LongSymbolOneTemplate null\n LongSymbolOneArgsTemplate: &LongSymbolOneArgsTemplate null\n LongSymbolNegOneTemplate: &LongSymbolNegOneTemplate null\n LongSymbolNegOneArgsTemplate: &LongSymbolNegOneArgsTemplate null\n LongSymbolFromBitsTemplate: &LongSymbolFromBitsTemplate null\n LongSymbolFromBitsArgsTemplate: &LongSymbolFromBitsArgsTemplate null\n LongSymbolFromIntTemplate: &LongSymbolFromIntTemplate null\n LongSymbolFromIntArgsTemplate: &LongSymbolFromIntArgsTemplate null\n LongSymbolFromNumberTemplate: &LongSymbolFromNumberTemplate null\n LongSymbolFromNumberArgsTemplate: &LongSymbolFromNumberArgsTemplate null\n LongSymbolFromStringTemplate: &LongSymbolFromStringTemplate null\n LongSymbolFromStringArgsTemplate: &LongSymbolFromStringArgsTemplate null\n Decimal128SymbolFromStringTemplate: &Decimal128SymbolFromStringTemplate null\n Decimal128SymbolFromStringArgsTemplate: &Decimal128SymbolFromStringArgsTemplate null\n ObjectIdCreateFromHexStringTemplate: &ObjectIdCreateFromHexStringTemplate null\n ObjectIdCreateFromHexStringArgsTemplate: &ObjectIdCreateFromHexStringArgsTemplate null\n ObjectIdCreateFromTimeTemplate: &ObjectIdCreateFromTimeTemplate !!js/function >\n (lhs, rhs) => {\n return lhs.createFromTime;\n }\n ObjectIdCreateFromTimeArgsTemplate: &ObjectIdCreateFromTimeArgsTemplate null\n # non bson-specific would go here, but there aren\'t any atm.\n\n #############################################\n # Imports #\n # #\n # Each type has a \'code\' that is consistent #\n # between languages. The import templates #\n # for each code generate the required #\n # statement for each type. No args. #\n # #\n # The ImportTemplate collects everything #\n # into one statement. #\n # #\n #############################################\n ImportTemplate: &ImportTemplate null\n DriverImportTemplate: &DriverImportTemplate null\n 0ImportTemplate: &0ImportTemplate null\n 1ImportTemplate: &1ImportTemplate null\n 2ImportTemplate: &2ImportTemplate null\n 3ImportTemplate: &3ImportTemplate null\n 4ImportTemplate: &4ImportTemplate null\n 5ImportTemplate: &5ImportTemplate null\n 6ImportTemplate: &6ImportTemplate null\n 7ImportTemplate: &7ImportTemplate null\n 8ImportTemplate: &8ImportTemplate null\n 9ImportTemplate: &9ImportTemplate null\n 10ImportTemplate: &10ImportTemplate null\n 11ImportTemplate: &11ImportTemplate null\n 12ImportTemplate: &12ImportTemplate null\n 100ImportTemplate: &100ImportTemplate null\n 101ImportTemplate: &101ImportTemplate null\n 102ImportTemplate: &102ImportTemplate null\n 103ImportTemplate: &103ImportTemplate null\n 104ImportTemplate: &104ImportTemplate null\n 105ImportTemplate: &105ImportTemplate null\n 106ImportTemplate: &106ImportTemplate null\n 107ImportTemplate: &107ImportTemplate null\n 108ImportTemplate: &108ImportTemplate null\n 109ImportTemplate: &109ImportTemplate null\n 110ImportTemplate: &110ImportTemplate null\n 111ImportTemplate: &111ImportTemplate null\n 112ImportTemplate: &112ImportTemplate null\n 113ImportTemplate: &113ImportTemplate null\n 114ImportTemplate: &114ImportTemplate null\n 200ImportTemplate: &200ImportTemplate null\n 201ImportTemplate: &201ImportTemplate null\n 300ImportTemplate: &300ImportTemplate null\n 301ImportTemplate: &301ImportTemplate null\n 302ImportTemplate: &302ImportTemplate null\n 303ImportTemplate: &303ImportTemplate null\n 304ImportTemplate: &304ImportTemplate null\n 305ImportTemplate: &305ImportTemplate null\n 306ImportTemplate: &306ImportTemplate null\n# Universal types\n# Everything inherits from StringType because we haven\'t implemented any of them.\nBasicTypes:\n # Universal basic types\n _bool: &BoolType\n <<: *__type\n id: "_bool"\n code: 0\n template: *BoolTypeTemplate\n _integer: &IntegerType\n <<: *__type\n id: "_integer"\n code: 1\n template: *IntegerTypeTemplate\n _long: &LongBasicType\n <<: *__type\n id: "_long"\n code: 2\n template: *LongBasicTypeTemplate\n _decimal: &DecimalType\n <<: *__type\n id: "_decimal"\n code: 3\n template: *DecimalTypeTemplate\n _hex: &HexType\n <<: *__type\n id: "_hex"\n code: 4\n template: *HexTypeTemplate\n _octal: &OctalType\n <<: *__type\n id: "_octal"\n code: 5\n template: *OctalTypeTemplate\n _numeric: &NumericType\n <<: *__type\n id: "_numeric"\n code: 6\n template: *NumericTypeTemplate\n _string: &StringType\n <<: *__type\n id: "_string"\n code: 7\n template: *StringTypeTemplate\n _regex: &RegexType\n <<: *__type\n id: "_regex"\n code: 8\n template: *RegexTypeTemplate\n _array: &ArrayType\n <<: *__type\n id: "_array"\n code: 9\n template: *ArrayTypeTemplate\n argsTemplate: *ArrayTypeArgsTemplate\n _object: &ObjectType\n <<: *__type\n id: "_object"\n code: 10\n template: *ObjectTypeTemplate\n argsTemplate: *ObjectTypeArgsTemplate\n _null: &NullType\n <<: *__type\n id: "_null"\n code: 11\n template: *NullTypeTemplate\n _undefined: &UndefinedType\n <<: *__type\n id: "_undefined"\n code: 12\n template: *UndefinedTypeTemplate\n\nSyntax:\n equality:\n template: *EqualitySyntaxTemplate\n in:\n template: *InSyntaxTemplate\n and:\n template: *AndSyntaxTemplate\n or:\n template: *OrSyntaxTemplate\n not:\n template: *NotSyntaxTemplate\n unary:\n template: *UnarySyntaxTemplate\n binary:\n template: *BinarySyntaxTemplate\n parens:\n template: *ParensSyntaxTemplate\n eos:\n template: *EosSyntaxTemplate\n eof:\n template: *EofSyntaxTemplate\n # The new template takes in expr, and an optional skip argument and optional\n # id argument. The skip argument is a boolean that if true then doesn\'t add\n # new. The code argument is the symbol code being called. The template will check\n # if it is an exception, i.e. a type that is a constructor but may not use new.\n new:\n template: *NewSyntaxTemplate\n # The regex flags that change symbols between languages can be defined here.\n # Flags that aren\'t defined can be left blank and will be ignored.\n regexFlags: *RegexFlags\n bsonRegexFlags: *BSONRegexFlags\n driver: *DriverTemplate\nImports:\n import:\n template: *ImportTemplate\n driver:\n template: *DriverImportTemplate\n 0:\n template: *0ImportTemplate\n 1:\n template: *1ImportTemplate\n 2:\n template: *2ImportTemplate\n 3:\n template: *3ImportTemplate\n 4:\n template: *4ImportTemplate\n 5:\n template: *5ImportTemplate\n 6:\n template: *6ImportTemplate\n 7:\n template: *7ImportTemplate\n 8:\n template: *8ImportTemplate\n 9:\n template: *9ImportTemplate\n 10:\n template: *10ImportTemplate\n 11:\n template: *11ImportTemplate\n 12:\n template: *12ImportTemplate\n 100:\n template: *100ImportTemplate\n 101:\n template: *101ImportTemplate\n 102:\n template: *102ImportTemplate\n 103:\n template: *103ImportTemplate\n 104:\n template: *104ImportTemplate\n 105:\n template: *105ImportTemplate\n 106:\n template: *106ImportTemplate\n 107:\n template: *107ImportTemplate\n 108:\n template: *108ImportTemplate\n 109:\n template: *109ImportTemplate\n 110:\n template: *110ImportTemplate\n 111:\n template: *111ImportTemplate\n 112:\n template: *112ImportTemplate\n 113:\n template: *113ImportTemplate\n 114:\n template: *114ImportTemplate\n 200:\n template: *200ImportTemplate\n 201:\n template: *201ImportTemplate\n 300:\n template: *300ImportTemplate\n 301:\n template: *301ImportTemplate\n 302:\n template: *302ImportTemplate\n 303:\n template: *303ImportTemplate\n 304:\n template: *304ImportTemplate\n 305:\n template: *305ImportTemplate\n 306:\n template: *306ImportTemplate\nBsonTypes:\n Code: &CodeType\n <<: *__type\n id: "Code"\n code: 100\n type: *ObjectType\n attr:\n code:\n callable: *var\n args: null\n attr: null\n id: "code"\n type: *StringType\n template: *CodeCodeTemplate\n argsTemplate: *CodeCodeArgsTemplate\n scope:\n callable: *var\n args: null\n attr: null\n id: "scope"\n type: *StringType\n template: *CodeScopeTemplate\n argsTemplate: *CodeScopeArgsTemplate\n ObjectId: &ObjectIdType\n <<: *__type\n id: "ObjectId"\n code: 101\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: "toString"\n type: *StringType\n template: *ObjectIdToStringTemplate\n argsTemplate: *ObjectIdToStringArgsTemplate\n equals:\n <<: *__func\n id: "equals"\n args:\n - [ "ObjectId" ]\n type: *BoolType\n template: *ObjectIdEqualsTemplate\n argsTemplate: *ObjectIdEqualsArgsTemplate\n getTimestamp:\n <<: *__func\n id: "getTimestamp"\n type: *IntegerType\n template: *ObjectIdGetTimestampTemplate\n argsTemplate: *ObjectIdGetTimestampArgsTemplate\n BinData: &BinaryType\n <<: *__type\n id: "BinData"\n code: 102\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: "toString"\n type: *StringType\n template: *BinaryToStringTemplate\n argsTemplate: *BinaryToStringArgsTemplate\n base64:\n <<: *__func\n id: "base64"\n type: *StringType\n template: *BinaryValueTemplate\n argsTemplate: *BinaryValueArgsTemplate\n length:\n <<: *__func\n id: "length"\n type: *IntegerType\n template: *BinaryLengthTemplate\n argsTemplate: *BinaryLengthArgsTemplate\n subtype:\n <<: *__func\n id: "subtype"\n type: *IntegerType\n template: *BinarySubtypeTemplate\n argsTemplate: *BinarySubtypeArgsTemplate\n DBRef: &DBRefType\n <<: *__type\n id: "DBRef"\n code: 103\n type: *ObjectType\n attr:\n getDb:\n <<: *__func\n id: "getDb"\n type: *StringType\n template: *DBRefGetDBTemplate\n argsTemplate: *DBRefGetDBArgsTemplate\n $db:\n callable: *var\n args: null\n attr: null\n id: "$db"\n type: *StringType\n template: *DBRefGetDBTemplate\n argsTemplate: *DBRefGetDBArgsTemplate\n getCollection:\n <<: *__func\n id: "getCollection"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n getRef:\n <<: *__func\n id: "getRef"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n $ref:\n callable: *var\n args: null\n attr: null\n id: "$ref"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n getId:\n <<: *__func\n id: "getId"\n type: *StringType\n template: *DBRefGetIdTemplate\n argsTemplate: *DBRefGetIdArgsTemplate\n $id:\n callable: *var\n args: null\n attr: null\n id: "$id"\n type: *StringType\n template: *DBRefGetIdTemplate\n argsTemplate: *DBRefGetIdArgsTemplate\n NumberInt: &Int32Type\n <<: *__type\n id: "NumberInt"\n code: 105\n type: *ObjectType\n attr: {}\n NumberLong: &LongType\n <<: *__type\n id: "NumberLong"\n code: 106\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: "LongtoString" # Needs process method\n args:\n - [ *IntegerType, null ]\n type: *StringType\n template: *LongToStringTemplate\n argsTemplate: *LongToStringArgsTemplate\n equals:\n <<: *__func\n id: "equals"\n args:\n - [ "Long" ]\n type: *BoolType\n template: *LongEqualsTemplate\n argsTemplate: *LongEqualsArgsTemplate\n toInt:\n <<: *__func\n id: "toInt"\n type: *IntegerType\n template: *LongToIntTemplate\n argsTemplate: *LongToIntArgsTemplate\n toNumber:\n <<: *__func\n id: "toNumber"\n type: *DecimalType\n template: *LongToNumberTemplate\n argsTemplate: *LongToNumberArgsTemplate\n compare:\n <<: *__func\n id: "compare"\n args:\n - [ "Long" ]\n type: *StringType\n template: *LongCompareTemplate\n argsTemplate: *LongCompareArgsTemplate\n isOdd:\n <<: *__func\n id: "isOdd"\n type: *BoolType\n template: *LongIsOddTemplate\n argsTemplate: *LongIsOddArgsTemplate\n isZero:\n <<: *__func\n id: "isZero"\n type: *BoolType\n template: *LongIsZeroTemplate\n argsTemplate: *LongIsZeroArgsTemplate\n isNegative:\n <<: *__func\n id: "isNegative"\n type: *BoolType\n template: *LongIsNegativeTemplate\n argsTemplate: *LongIsNegativeArgsTemplate\n negate:\n <<: *__func\n id: "negate"\n type: "Long"\n template: *LongNegateTemplate\n argsTemplate: *LongNegateArgsTemplate\n not:\n <<: *__func\n id: "not"\n type: "Long"\n template: *LongNotTemplate\n argsTemplate: *LongNotArgsTemplate\n notEquals:\n <<: *__func\n id: "notEquals"\n args:\n - [ "Long" ]\n type: *BoolType\n template: *LongNotEqualsTemplate\n argsTemplate: *LongNotEqualsArgsTemplate\n greaterThan:\n <<: *__func\n id: "greaterThan"\n args:\n - [ "Long" ]\n type: *BoolType\n template: *LongGreaterThanTemplate\n argsTemplate: *LongGreaterThanArgsTemplate\n greaterThanOrEqual:\n <<: *__func\n id: "greaterThanOrEqual"\n args:\n - [ "Long" ]\n type: *BoolType\n template: *LongGreaterThanOrEqualTemplate\n argsTemplate: *LongGreaterThanOrEqualArgsTemplate\n lessThan:\n <<: *__func\n id: "lessThan"\n args:\n - [ "Long" ]\n type: *BoolType\n template: *LongLessThanTemplate\n argsTemplate: *LongLessThanArgsTemplate\n lessThanOrEqual:\n <<: *__func\n id: "lessThanOrEqual"\n args:\n - [ "Long" ]\n type: *BoolType\n template: *LongLessThanOrEqualTemplate\n argsTemplate: *LongLessThanOrEqualArgsTemplate\n add:\n <<: *__func\n id: "add"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongAddTemplate\n argsTemplate: *LongAddArgsTemplate\n subtract:\n <<: *__func\n id: "subtract"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongSubtractTemplate\n argsTemplate: *LongSubtractArgsTemplate\n multiply:\n <<: *__func\n id: "multiply"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongMultiplyTemplate\n argsTemplate: *LongMultiplyArgsTemplate\n div:\n <<: *__func\n id: "div"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongDivTemplate\n argsTemplate: *LongDivArgsTemplate\n modulo:\n <<: *__func\n id: "modulo"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongModuloTemplate\n argsTemplate: *LongModuloArgsTemplate\n and:\n <<: *__func\n id: "and"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongAndTemplate\n argsTemplate: *LongAndArgsTemplate\n or:\n <<: *__func\n id: "or"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongOrTemplate\n argsTemplate: *LongOrArgsTemplate\n xor:\n <<: *__func\n id: "xor"\n args:\n - [ "Long" ]\n type: "Long"\n template: *LongXorTemplate\n argsTemplate: *LongXorArgsTemplate\n shiftLeft:\n <<: *__func\n id: "shiftLeft"\n args:\n - [ *IntegerType ]\n type: "Long"\n template: *LongShiftLeftTemplate\n argsTemplate: *LongShiftLeftArgsTemplate\n shiftRight:\n <<: *__func\n id: "shiftRight"\n args:\n - [ *IntegerType ]\n type: "Long"\n template: *LongShiftRightTemplate\n argsTemplate: *LongShiftRightArgsTemplate\n MinKeyType: &MinKeyType\n <<: *__type\n id: "MinKey"\n code: 107\n type: *ObjectType\n MaxKeyType: &MaxKeyType\n <<: *__type\n id: "MaxKey"\n code: 108\n type: *ObjectType\n Timestamp: &TimestampType\n <<: *__type\n id: "Timestamp"\n code: 110\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: "toString"\n type: *StringType\n template: *TimestampToStringTemplate\n argsTemplate: *TimestampToStringArgsTemplate\n equals:\n <<: *__func\n id: "equals"\n args:\n - [ "Timestamp" ]\n type: *BoolType\n template: *TimestampEqualsTemplate\n argsTemplate: *TimestampEqualsArgsTemplate\n getLowBits:\n <<: *__func\n id: "getLowBits"\n type: *IntegerType\n template: *TimestampGetLowBitsTemplate\n argsTemplate: *TimestampGetLowBitsArgsTemplate\n getHighBits:\n <<: *__func\n id: "getHighBits"\n type: *IntegerType\n template: *TimestampGetHighBitsTemplate\n argsTemplate: *TimestampGetHighBitsArgsTemplate\n compare:\n <<: *__func\n id: "compare"\n args:\n - [ "Timestamp" ]\n type: *StringType\n template: *TimestampCompareTemplate\n argsTemplate: *TimestampCompareArgsTemplate\n notEquals:\n <<: *__func\n id: "notEquals"\n args:\n - [ "Timestamp" ]\n type: *BoolType\n template: *TimestampNotEqualsTemplate\n argsTemplate: *TimestampNotEqualsArgsTemplate\n greaterThan:\n <<: *__func\n id: "greaterThan"\n args:\n - [ "Timestamp" ]\n type: *BoolType\n template: *TimestampGreaterThanTemplate\n argsTemplate: *TimestampGreaterThanArgsTemplate\n greaterThanOrEqual:\n <<: *__func\n id: "greaterThanOrEqual"\n args:\n - [ "Timestamp" ]\n type: *BoolType\n template: *TimestampGreaterThanOrEqualTemplate\n argsTemplate: *TimestampGreaterThanOrEqualArgsTemplate\n lessThan:\n <<: *__func\n id: "lessThan"\n args:\n - [ "Timestamp" ]\n type: *BoolType\n template: *TimestampLessThanTemplate\n argsTemplate: *TimestampLessThanArgsTemplate\n lessThanOrEqual:\n <<: *__func\n id: "lessThanOrEqual"\n args:\n - [ "Timestamp" ]\n type: *BoolType\n template: *TimestampLessThanOrEqualTemplate\n argsTemplate: *TimestampLessThanOrEqualArgsTemplate\n BSONSymbol: &SymbolType\n <<: *__type\n id: "BSONSymbol"\n code: 111\n type: *ObjectType\n attr:\n valueOf:\n <<: *__func\n id: "valueOf"\n type: *StringType\n template: *SymbolValueOfTemplate\n argsTemplate: *SymbolValueOfArgsTemplate\n toString:\n <<: *__func\n id: "toString"\n type: *StringType\n template: *SymbolToStringTemplate\n argsTemplate: *SymbolToStringArgsTemplate\n inspect:\n <<: *__func\n id: "inspect"\n type: *StringType\n template: *SymbolInspectTemplate\n argsTemplate: *SymbolInspectArgsTemplate\n Double: &DoubleType\n <<: *__type\n id: "Double"\n code: 104\n type: *ObjectType\n attr: {}\n Decimal128: &Decimal128Type\n <<: *__type\n id: "Decimal128"\n code: 112\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: "toString"\n type: *StringType\n template: *Decimal128ToStringTemplate\n argsTemplate: *Decimal128ToStringArgsTemplate\n NumberDecimal: &NumberDecimalType\n <<: *__type\n id: "NumberDecimal"\n code: 112\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: "toString"\n type: *StringType\n template: *Decimal128ToStringTemplate\n argsTemplate: *Decimal128ToStringArgsTemplate\n\n\n SUBTYPE_DEFAULT:\n id: "SUBTYPE_DEFAULT"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeDefaultTemplate\n SUBTYPE_FUNCTION:\n id: "SUBTYPE_FUNCTION"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeFunctionTemplate\n SUBTYPE_BYTE_ARRAY:\n id: "SUBTYPE_BYTE_ARRAY"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeByteArrayTemplate\n SUBTYPE_UUID_OLD:\n id: "SUBTYPE_UUID_OLD"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUuidOldTemplate\n SUBTYPE_UUID:\n id: "SUBTYPE_UUID"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUuidTemplate\n SUBTYPE_MD5:\n id: "SUBTYPE_MD5"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeMd5Template\n SUBTYPE_USER_DEFINED:\n id: "SUBTYPE_USER_DEFINED"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUserDefinedTemplate\n BSONRegExpType: &BSONRegExpType\n <<: *__type\n id: "BSONRegExp"\n code: 109\n type: *ObjectType\nNativeTypes:\n Date: &DateType\n <<: *__type\n id: "Date"\n code: 200\n type: *ObjectType\n attr: {} # TODO: no built-in date methods added yet\n RegExp: &RegExpType\n <<: *__type\n id: "RegExp"\n code: 8\n type: *ObjectType\n attr: {}\n\n\nBsonSymbols:\n Code: &CodeSymbol\n id: "Code"\n code: 100\n callable: *constructor\n args:\n - [ *StringType, null ]\n - [ *ObjectType, null ]\n type: *CodeType\n attr: {}\n template: *CodeSymbolTemplate\n argsTemplate: *CodeSymbolArgsTemplate\n ObjectId: &ObjectIdSymbol\n id: "ObjectId"\n code: 101\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n type: *ObjectIdType\n attr:\n createFromHexString:\n <<: *__func\n id: "createFromHexString"\n args:\n - [ *StringType ]\n type: *ObjectIdType\n template: *ObjectIdCreateFromHexStringTemplate\n argsTemplate: *ObjectIdCreateFromHexStringArgsTemplate\n createFromTime:\n <<: *__func\n id: "ObjectIdCreateFromTime"\n args:\n - [ *NumericType, *DateType ]\n type: *ObjectIdType\n template: *ObjectIdCreateFromTimeTemplate\n argsTemplate: *ObjectIdCreateFromTimeArgsTemplate\n isValid:\n <<: *__func\n id: "isValid"\n args:\n - [ *StringType ]\n type: *BoolType\n template: *ObjectIdIsValidTemplate\n argsTemplate: *ObjectIdIsValidArgsTemplate\n template: *ObjectIdSymbolTemplate\n argsTemplate: *ObjectIdSymbolArgsTemplate\n BinData: &BinarySymbol\n id: "BinData"\n code: 102\n callable: *constructor\n args:\n - [ *IntegerType ]\n - [ *StringType ]\n type: *BinaryType\n attr: {}\n template: *BinarySymbolTemplate\n argsTemplate: *BinarySymbolArgsTemplate\n DBRef:\n id: "DBRef"\n code: 103\n callable: *constructor\n args:\n - [ *StringType ]\n - [ *ObjectIdType ]\n - [ *StringType, null ]\n type: *DBRefType\n attr: {}\n template: *DBRefSymbolTemplate\n argsTemplate: *DBRefSymbolArgsTemplate\n NumberInt:\n id: "Int32"\n code: 105\n callable: *constructor\n args:\n - [ *NumericType, *StringType, null ]\n type: *Int32Type\n attr: {}\n template: *Int32SymbolTemplate\n argsTemplate: *Int32SymbolArgsTemplate\n NumberLong:\n id: "NumberLong"\n code: 106\n callable: *constructor\n args:\n - [ *IntegerType, *StringType, null ]\n type: *LongType\n attr: {}\n template: *LongSymbolTemplate\n argsTemplate: *LongSymbolArgsTemplate\n MinKey:\n id: "MinKey"\n code: 107\n callable: *constructor\n args: []\n type: *MinKeyType\n attr: {}\n template: *MinKeySymbolTemplate\n argsTemplate: *MinKeySymbolArgsTemplate\n MaxKey:\n id: "MaxKey"\n code: 108\n callable: *constructor\n args: []\n type: *MaxKeyType\n attr: {}\n template: *MaxKeySymbolTemplate\n argsTemplate: *MaxKeySymbolArgsTemplate\n Timestamp:\n id: "Timestamp"\n code: 110\n callable: *constructor\n args:\n - [ *IntegerType, null ]\n - [ *IntegerType, null ]\n type: *TimestampType\n attr: {}\n template: *TimestampSymbolTemplate\n argsTemplate: *TimestampSymbolArgsTemplate\n Symbol:\n id: "Symbol"\n code: 111\n callable: *constructor\n args:\n - [ *StringType ]\n type: *SymbolType\n attr: {}\n template: *SymbolSymbolTemplate\n argsTemplate: *SymbolSymbolArgsTemplate\n NumberDecimal:\n id: "NumberDecimal"\n code: 112\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n type: *Decimal128Type\n attr: {}\n template: *Decimal128SymbolTemplate\n argsTemplate: *Decimal128SymbolArgsTemplate\n BSONRegExp:\n id: "BSONRegExp"\n code: 109\n callable: *constructor\n args:\n - [ *StringType ]\n - [ *StringType, null ]\n type: *BSONRegExpType\n attr: {}\n template: *BSONRegExpSymbolTemplate\n argsTemplate: *BSONRegExpSymbolArgsTemplate\n BSONSymbol:\n id: "BSONSymbol"\n code: 111\n callable: *constructor\n args:\n - [ *StringType ]\n type: *SymbolType\n attr: {}\n template: *SymbolSymbolTemplate\n argsTemplate: *SymbolSymbolArgsTemplate\n Decimal128:\n id: "Decimal128"\n code: 112\n callable: *constructor\n args:\n - [ *ObjectType ]\n type: *Decimal128Type\n attr:\n fromString:\n id: "fromString"\n callable: *func\n args:\n - [ *StringType ]\n type: *Decimal128Type\n attr: {}\n template: *Decimal128SymbolFromStringTemplate\n argsTemplate: *Decimal128SymbolFromStringArgsTemplate\n template: *Decimal128SymbolTemplate\n argsTemplate: *Decimal128SymbolArgsTemplate\n Double:\n id: "Double"\n code: 104\n callable: *constructor\n args:\n - [ *NumericType, *StringType ]\n type: *DoubleType\n attr: {}\n template: *DoubleSymbolTemplate\n argsTemplate: *DoubleSymbolArgsTemplate\n Int32:\n id: "Int32"\n code: 105\n callable: *constructor\n args:\n - [ *NumericType, *StringType ]\n type: *Int32Type\n attr: {}\n template: *Int32SymbolTemplate\n argsTemplate: *Int32SymbolArgsTemplate\n Long:\n id: "Long"\n code: 106\n callable: *constructor\n args:\n - [ *IntegerType ]\n - [ *IntegerType ]\n type: *LongType\n attr:\n MAX_VALUE:\n id: "MAX_VALUE"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolMaxTemplate\n argsTemplate: *LongSymbolMaxArgsTemplate\n MIN_VALUE:\n id: "MIN_VALUE"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolMinTemplate\n argsTemplate: *LongSymbolMinArgsTemplate\n ZERO:\n id: "ZERO"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolZeroTemplate\n argsTemplate: *LongSymbolZeroArgsTemplate\n ONE:\n id: "ONE"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolOneTemplate\n argsTemplate: *LongSymbolOneArgsTemplate\n NEG_ONE:\n id: "NEG_ONE"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolNegOneTemplate\n argsTemplate: *LongSymbolNegOneArgsTemplate\n fromBits:\n id: "LongfromBits" # Needs process method\n callable: *func\n args:\n - [ *IntegerType ]\n - [ *IntegerType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromBitsTemplate\n argsTemplate: *LongSymbolFromBitsArgsTemplate\n fromInt:\n id: "fromInt"\n callable: *func\n args:\n - [ *IntegerType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromIntTemplate\n argsTemplate: *LongSymbolFromIntArgsTemplate\n fromNumber:\n id: "fromNumber"\n callable: *func\n args:\n - [ *NumericType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromNumberTemplate\n argsTemplate: *LongSymbolFromNumberArgsTemplate\n fromString:\n id: "fromString"\n callable: *func\n args:\n - [ *StringType ]\n - [ *IntegerType, null ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromStringTemplate\n argsTemplate: *LongSymbolFromStringArgsTemplate\n template: *LongSymbolTemplate\n argsTemplate: *LongSymbolArgsTemplate\n\nNativeSymbols:\n Number:\n id: "Number"\n code: 2\n callable: *constructor\n args:\n - [ *IntegerType, *StringType, null ]\n type: *NumericType\n attr: {} # TODO: no built-in number funcs added yet\n template: *NumberSymbolTemplate\n argsTemplate: *NumberSymbolArgsTemplate\n Date: # Needs emit method\n id: "Date"\n code: 200\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n type: *DateType\n attr: # TODO: add more date funcs?\n now:\n id: "now"\n code: 200.1\n callable: *func\n args: []\n type: *DateType\n attr: {}\n template: *DateSymbolNowTemplate\n argsTemplate: *DateSymbolNowArgsTemplate\n template: *DateSymbolTemplate\n argsTemplate: *DateSymbolArgsTemplate\n ISODate: # Needs emit method\n id: "ISODate"\n code: 200\n callable: *constructor\n args:\n - [ *StringType, null ]\n type: *DateType\n attr:\n now:\n id: "now"\n callable: *constructor\n args: []\n type: *DateType\n attr: {}\n template: *DateSymbolNowTemplate\n argsTemplate: *DateSymbolNowArgsTemplate\n template: *DateSymbolTemplate\n argsTemplate: *DateSymbolArgsTemplate\n RegExp: # Needs process method\n id: "RegExp"\n code: 8\n callable: *constructor\n args:\n - [ *StringType, *RegexType ]\n - [ *StringType, null ]\n type: *RegExpType\n attr: {} # TODO: no built-in regex funcs added yet\n template: *RegExpSymbolTemplate\n argsTemplate: *RegExpSymbolArgsTemplate\n\n'},7905:e=>{e.exports="SymbolTypes:\n VAR: &var 0\n CONSTRUCTOR: &constructor 1\n FUNC: &func 2\n# Internal patterns to save typing\n__type: &__type\n id: null\n callable: *var\n args: null\n type: null\n attr: {}\n template: null\n argsTemplate: null\n__func: &__func\n callable: *func\n args: []\n attr: {}\n template: null\n argsTemplate: null\n\n#############################################\n# Sample Templates #\n# #\n# The expected arguments are commented next #\n# to the template itself. Currently all are #\n# set to null, but to define a function #\n# replace 'null' with '!!js/function > \\n #\n# and a function defined below. #\n# #\n# See the other template files for examples #\n# #\n# Good to know: #\n# lhs is left-hand-side of the expression #\n# rhs is right-hand-side of the expression #\n# All args are strings unless noted #\n# - arg? is boolean #\n# - arg# is number #\n# #\n#############################################\nTemplates:\n ########\n # Misc #\n ########\n\n # Filter out regex flags that have translations or are unsupported.\n RegexFlags: &RegexFlags\n i: 'i'\n m: 'm'\n u: ''\n y: ''\n g: ''\n BSONRegexFlags: &BSONRegexFlags\n i: 'i'\n m: 'm'\n x: 'x'\n s: 's'\n l: ''\n u: ''\n\n #############################################\n # Syntax #\n # #\n # Templates for language syntax expressions #\n # #\n #############################################\n\n DriverTemplate: &DriverTemplate !!js/function >\n (spec) => {\n const getKey = k => {\n let translateKey = {\n project: 'projection',\n }\n return k in translateKey ? translateKey[k] : k\n };\n const options = spec.options;\n const filter = spec.filter || {};\n const exportMode = spec.exportMode;\n delete spec.options;\n delete spec.filter;\n delete spec.exportMode;\n\n comment = []\n .concat('// Requires the MongoDB PHP Driver')\n .concat('// https://www.mongodb.com/docs/drivers/php/')\n .join('\\n')\n ;\n const client = `$client = new Client('${options.uri}');`;\n const collection = `$collection = $client->selectCollection('${options.database}', '${options.collection}');`;\n\n if ('aggregation' in spec) {\n // Note: toPHPArray() may not be required here as Compass should always provide an array for spec.aggregation\n return []\n .concat(comment)\n .concat('')\n .concat(client)\n .concat(collection)\n .concat(`$cursor = $collection->aggregate(${this.utils.toPHPArray(spec.aggregation)});`)\n .join('\\n')\n ;\n }\n\n let driverMethod;\n switch (exportMode) {\n case 'Delete Query':\n driverMethod = 'delete_many';\n break;\n case 'Update Query':\n driverMethod = 'update_many';\n break;\n default:\n driverMethod = 'find';\n }\n\n let args = Object.keys(spec).reduce(\n (result, k) => {\n let val = this.utils.removePHPObject(spec[k]);\n const divider = result === '' ? '' : ',\\n';\n return `${result}${divider} '${getKey(k)}' => ${val}`;\n },\n ''\n );\n args = args ? `, [\\n${args}\\n]` : '';\n\n return []\n .concat(comment)\n .concat('')\n .concat(client)\n .concat(collection)\n .concat(`$cursor = $collection->${driverMethod}(${this.utils.removePHPObject(filter)}${args});`)\n .join('\\n')\n ;\n }\n EqualitySyntaxTemplate: &EqualitySyntaxTemplate !!js/function >\n (lhs, op, rhs) => {\n // Identity comparison\n if (op.includes('is')) {\n if (op.includes('not')) {\n return `${lhs} !== ${rhs}`;\n } else {\n return `${lhs} === ${rhs}`;\n }\n }\n // Not equal\n if (op.includes('!') || op.includes('not')) {\n return `${lhs} != ${rhs}`;\n }\n // Equal\n if (op === '==' || op === '===') {\n return `${lhs} == ${rhs}`;\n }\n // All other cases\n return `${lhs} ${op} ${rhs}`;\n }\n InSyntaxTemplate: &InSyntaxTemplate !!js/function >\n (lhs, op, rhs) => {\n // array\n if (rhs.charAt(0) === '[' && rhs.charAt(rhs.length - 1) === ']') {\n let not = '';\n if (op.includes('!') || op.includes('not')) {\n not = '! ';\n }\n return `${not}\\\\in_array(${lhs}, ${rhs})`;\n }\n \n //object\n if (rhs.indexOf('(object) ') === 0) {\n let not = '';\n if (op.includes('!') || op.includes('not')) {\n not = '! ';\n }\n return `${not}\\\\property_exists(${rhs}, ${lhs})`;\n }\n \n // string - all other cases\n let targop = '!==';\n if (op.includes('!') || op.includes('not')) {\n targop = '===';\n }\n return `\\\\strpos(${rhs}, ${lhs}) ${targop} false`;\n }\n AndSyntaxTemplate: &AndSyntaxTemplate !!js/function >\n (args) => {\n return args.join(' && ');\n }\n OrSyntaxTemplate: &OrSyntaxTemplate !!js/function >\n (args) => {\n return args.join(' || ');\n }\n NotSyntaxTemplate: &NotSyntaxTemplate !!js/function >\n (arg) => {\n return `! ${arg}`;\n }\n UnarySyntaxTemplate: &UnarySyntaxTemplate !!js/function >\n (op, arg) => {\n switch(op) {\n case '+':\n return `+${arg}`;\n case '-':\n return `-${arg}`;\n case '~':\n return `~${arg}`;\n default:\n throw new Error(`unrecognized operation: ${op}`);\n }\n }\n BinarySyntaxTemplate: &BinarySyntaxTemplate !!js/function >\n (args) => {\n return args.reduce((s, op, i, arr) => {\n if (i % 2 === 0) {\n return s;\n }\n const rhs = arr[i + 1];\n switch(op) {\n case '+':\n return `${s} + ${rhs}`;\n case '-':\n return `${s} - ${rhs}`;\n case '*':\n return `${s} * ${rhs}`;\n case '/':\n return `${s} / ${rhs}`;\n case '**':\n return `${s} ** ${rhs}`;\n case '//':\n return `\\\\intdiv(${s}, ${rhs})`;\n case '%':\n return `${s} % ${rhs}`;\n case '>>':\n return `${s} >> ${rhs}`;\n case '<<':\n return `${s} << ${rhs}`;\n case '|':\n return `${s} | ${rhs}`;\n case '&':\n return `${s} & ${rhs}`;\n case '^':\n return `${s} ^ ${rhs}`;\n default:\n throw new Error(`unrecognized operation: ${op}`);\n }\n }, args[0]);\n }\n ParensSyntaxTemplate: &ParensSyntaxTemplate null\n EosTemplate: &EosSyntaxTemplate null # No args. End-of-line\n EofTemplate: &EofSyntaxTemplate null # No args. End-of-file\n FloorDivTemplate: &FloorDivSyntaxTemplate null # Args: lhs, rhs\n PowerTemplate: &PowerSyntaxTemplate null # Args: lhs, rhs\n NewTemplate: &NewSyntaxTemplate null # Args: expression, skip?, code# [to check if meant to be skipped]\n\n #############################################\n # Literal Types #\n # #\n # Templates for literal type instance. Most #\n # get passed the literal itself as an arg. #\n # #\n #############################################\n StringTypeTemplate: &StringTypeTemplate !!js/function >\n (str) => {\n // This is some standalone object context, which is generated to parse \n // node and doesn't have access to main Generator object. Thus we can't\n // use utility function call. All ~Template calls use this type of \n // context. All ~ArgsTemplate have access to utility functions.\n \n stringifyWithSingleQuotes = (str) => {\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')\n ) {\n str = str.substr(1, str.length - 2);\n }\n return `'${str.replace(/\\\\([\\s\\S])|(')/g, '\\\\$1$2')}'`;\n };\n\n return `${stringifyWithSingleQuotes(str)}`;\n }\n RegexTypeTemplate: &RegexTypeTemplate !!js/function >\n (pattern, flags) => {\n // This is some standalone object context, which is generated to parse \n // node and doesn't have access to main Generator object. Thus we can't\n // use utility function call. All ~Template calls use this type of \n // context. All ~ArgsTemplate have access to utility functions.\n\n stringifyWithDoubleQuotes = (str) => {\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')\n ) {\n str = str.substr(1, str.length - 2);\n }\n return `${str.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}`;\n };\n \n pattern = `\"${stringifyWithDoubleQuotes(pattern)}\"`;\n flags = flags ? `, \"${flags}\"` : '';\n\n return `new Regex(${pattern}${flags})`;\n }\n BoolTypeTemplate: &BoolTypeTemplate !!js/function >\n (literal) => {\n return literal.toLowerCase();\n }\n IntegerTypeTemplate: &IntegerTypeTemplate null # args: literal, argType (i.e. '_string', '_decimal' etc)\n DecimalTypeTemplate: &DecimalTypeTemplate null # args: literal, argType\n LongBasicTypeTemplate: &LongBasicTypeTemplate null # args: literal, argType\n HexTypeTemplate: &HexTypeTemplate null # args: literal, argType\n OctalTypeTemplate: &OctalTypeTemplate !!js/function >\n (literal) => {\n let offset = 0;\n\n if (\n literal.charAt(0) === '0' &&\n (literal.charAt(1) === '0' || literal.charAt(1) === 'o' || literal.charAt(1) === 'O')\n ) {\n offset = 2;\n } else if (literal.charAt(0) === '0') {\n offset = 1;\n }\n\n literal = `0${literal.substr(offset, literal.length - 1)}`;\n\n return literal;\n }\n NumericTypeTemplate: &NumericTypeTemplate null # args: literal, argType\n ArrayTypeTemplate: &ArrayTypeTemplate !!js/function >\n (literal, depth) => {\n if (literal === '') {\n return '[]'\n }\n return `[${literal}]`;\n }\n ArrayTypeArgsTemplate: &ArrayTypeArgsTemplate null # Args: single array element, nestedness, lastElement? (note: not being used atm)\n NullTypeTemplate: &NullTypeTemplate !!js/function >\n () => {\n return 'null';\n }\n UndefinedTypeTemplate: &UndefinedTypeTemplate !!js/function >\n () => {\n return 'null';\n }\n ObjectTypeTemplate: &ObjectTypeTemplate !!js/function >\n (literal) => {\n return `${literal}`;\n }\n ObjectTypeArgsTemplate: &ObjectTypeArgsTemplate !!js/function >\n (args, depth) => {\n let isObjectCastRequired = true;\n \n if (args.length === 0) {\n return `(object) []`;\n }\n\n const isExpectedIndex = (actualIndex, expectedIndex) => {\n return '' + actualIndex === '' + expectedIndex;\n }\n \n let indexTest = 0;\n let pairs = args.map((arg) => {\n if (isObjectCastRequired && !isExpectedIndex(arg[0], indexTest)) {\n isObjectCastRequired = false;\n }\n indexTest++;\n return `${this.utils.stringifyWithSingleQuotes(arg[0])} => ${arg[1]}`;\n }).join(', ');\n\n // Rebuilding pairs for numeric sequential indexes without quotes\n if (isObjectCastRequired) {\n pairs = args.map((arg) => {\n return `${arg[0]} => ${arg[1]}`;\n }).join(', ');\n }\n\n return `${isObjectCastRequired ? '(object) ' : ''}[${pairs}]`;\n }\n\n #############################################\n # Symbols #\n # #\n # Templates for symbols, can be either #\n # functions or variables. #\n # #\n # The *SymbolTemplates return names and #\n # usually don't take any arguments. The #\n # *SymbolArgsTemplates are invoked for func #\n # calls. The first argument is always the #\n # lhs, i.e. the symbol returned from the #\n # corresponding SymbolTemplate. The rest of #\n # the arguments are the processed arguments #\n # passed to the original function. #\n # #\n #############################################\n CodeSymbolTemplate: &CodeSymbolTemplate !!js/function >\n () => {\n return 'new Javascript';\n }\n CodeSymbolArgsTemplate: &CodeSymbolArgsTemplate !!js/function >\n (lhs, code, scope) => {\n return !scope \n ? `(${this.utils.stringifyWithSingleQuotes(code)})` \n : `(${this.utils.stringifyWithSingleQuotes(code)}, ${scope})`\n ;\n }\n ObjectIdSymbolTemplate: &ObjectIdSymbolTemplate !!js/function >\n () => {\n return 'new ObjectId';\n }\n ObjectIdSymbolArgsTemplate: &ObjectIdSymbolArgsTemplate !!js/function >\n (lhs, id) => {\n return !id \n ? `()` \n : `(${this.utils.stringifyWithSingleQuotes(id)})`\n ;\n }\n BinarySymbolTemplate: &BinarySymbolTemplate !!js/function >\n () => {\n return 'new Binary';\n }\n BinarySymbolArgsTemplate: &BinarySymbolArgsTemplate !!js/function >\n (lhs, bytes, type) => {\n if (type === null) {\n type = 'Binary::TYPE_GENERIC';\n }\n return `(${this.utils.stringifyWithSingleQuotes(bytes)}, ${type})`;\n }\n BinarySymbolSubtypeDefaultTemplate: &BinarySymbolSubtypeDefaultTemplate !!js/function >\n () => {\n return 'Binary::TYPE_GENERIC';\n }\n BinarySymbolSubtypeFunctionTemplate: &BinarySymbolSubtypeFunctionTemplate !!js/function >\n () => {\n return 'Binary::TYPE_FUNCTION';\n }\n BinarySymbolSubtypeByteArrayTemplate: &BinarySymbolSubtypeByteArrayTemplate !!js/function >\n () => {\n return 'Binary::TYPE_OLD_BINARY';\n }\n BinarySymbolSubtypeUuidOldTemplate: &BinarySymbolSubtypeUuidOldTemplate !!js/function >\n () => {\n return 'Binary::TYPE_OLD_UUID';\n }\n BinarySymbolSubtypeUuidTemplate: &BinarySymbolSubtypeUuidTemplate !!js/function >\n () => {\n return 'Binary::TYPE_UUID';\n }\n BinarySymbolSubtypeMd5Template: &BinarySymbolSubtypeMd5Template !!js/function >\n () => {\n return 'Binary::TYPE_MD5';\n }\n BinarySymbolSubtypeUserDefinedTemplate: &BinarySymbolSubtypeUserDefinedTemplate !!js/function >\n () => {\n return 'Binary::TYPE_USER_DEFINED';\n }\n DBRefSymbolTemplate: &DBRefSymbolTemplate !!js/function >\n () => {\n return ''\n }\n DBRefSymbolArgsTemplate: &DBRefSymbolArgsTemplate !!js/function >\n (lhs, coll, id, db) => {\n let coll_string = `'$ref' => ${this.utils.stringifyWithSingleQuotes(coll)}`;\n let id_string = `, '$id' => ${id}`;\n let db_string = db ? `, '$db' => ${this.utils.stringifyWithSingleQuotes(db)}` : `, '$db' => null`;\n return `[${coll_string}${id_string}${db_string}]`;\n }\n DoubleSymbolTemplate: &DoubleSymbolTemplate !!js/function >\n () => {\n return '';\n }\n DoubleSymbolArgsTemplate: &DoubleSymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n if (type === '_decimal' || type === '_double') {\n return arg;\n }\n if (type === '_integer' || type === '_long') {\n return `${arg}.0`;\n }\n return `(float) ${arg}`;\n }\n Int32SymbolTemplate: &Int32SymbolTemplate !!js/function >\n () => {\n return '';\n }\n Int32SymbolArgsTemplate: &Int32SymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n if (type === '_integer' || type === '_long' || type === '_hex' || type === '_octal') {\n return arg;\n }\n return `(int) ${arg}`;\n }\n LongSymbolTemplate: &LongSymbolTemplate !!js/function >\n () => {\n return ''\n }\n LongSymbolArgsTemplate: &LongSymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n if (type === '_integer' || type === '_long' || type === '_hex' || type === '_octal') {\n return arg;\n }\n return `(int) ${arg}`;\n }\n RegExpSymbolTemplate: &RegExpSymbolTemplate !!js/function >\n () => {\n return 'new Regex';\n }\n RegExpSymbolArgsTemplate: &RegExpSymbolArgsTemplate null # Args: lhs, pattern, flags\n SymbolSymbolTemplate: &SymbolSymbolTemplate !!js/function >\n () => {\n return '';\n }\n SymbolSymbolArgsTemplate: &SymbolSymbolArgsTemplate !!js/function >\n (lhs, arg) => {\n return arg;\n }\n BSONRegExpSymbolTemplate: &BSONRegExpSymbolTemplate !!js/function >\n () => {\n return 'new Regex';\n }\n BSONRegExpSymbolArgsTemplate: &BSONRegExpSymbolArgsTemplate !!js/function >\n (lhs, pattern, flags) => {\n return `(${this.utils.stringifyWithDoubleQuotes(pattern)}${flags ? ', ' + this.utils.stringifyWithDoubleQuotes(flags) : ''})`;\n }\n Decimal128SymbolTemplate: &Decimal128SymbolTemplate !!js/function >\n () => {\n return 'new Decimal128';\n }\n Decimal128SymbolArgsTemplate: &Decimal128SymbolArgsTemplate !!js/function >\n (lhs, arg) => {\n arg = arg === undefined ? '0' : arg.toString();\n return `('${this.utils.removeStringQuotes(arg)}')`;\n }\n MinKeySymbolTemplate: &MinKeySymbolTemplate !!js/function >\n () => {\n return 'new MinKey';\n }\n MinKeySymbolArgsTemplate: &MinKeySymbolArgsTemplate !!js/function >\n () => {\n return `()`;\n }\n MaxKeySymbolTemplate: &MaxKeySymbolTemplate !!js/function >\n () => {\n return 'new MaxKey';\n }\n MaxKeySymbolArgsTemplate: &MaxKeySymbolArgsTemplate !!js/function >\n () => {\n return `()`;\n }\n TimestampSymbolTemplate: &TimestampSymbolTemplate !!js/function >\n () => {\n return 'new Timestamp';\n }\n TimestampSymbolArgsTemplate: &TimestampSymbolArgsTemplate !!js/function >\n (lhs, arg1, arg2) => {\n // PHP orders increment and timestamp args differently (see: PHPC-845)\n return `(${arg2 === undefined ? 0 : arg2}, ${arg1 === undefined ? 0 : arg1})`;\n }\n # non bson-specific\n NumberSymbolTemplate: &NumberSymbolTemplate !!js/function >\n () => ''\n NumberSymbolArgsTemplate: &NumberSymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n\n switch(type) {\n case '_string':\n if ((arg.indexOf('.') !== -1) && (arg.indexOf('.') !== arg.length - 2)) {\n return `(float) ${arg}`\n }\n return `(int) ${arg}`\n default:\n return `${arg}`\n }\n }\n DateSymbolTemplate: &DateSymbolTemplate !!js/function >\n () => {\n return 'UTCDateTime';\n }\n DateSymbolArgsTemplate: &DateSymbolArgsTemplate !!js/function >\n (lhs, date, isString) => {\n if (date === null) {\n return `new ${lhs}()`;\n }\n return isString \n ? `(new ${lhs}(${date.getTime()}))->toDateTime()->format(\\\\DateTimeInterface::RFC3339_EXTENDED)`\n : `new ${lhs}(${date.getTime()})`\n ;\n }\n DateSymbolNowTemplate: &DateSymbolNowTemplate !!js/function >\n () => {\n return `new UTCDateTime()`;\n }\n DateSymbolNowArgsTemplate: &DateSymbolNowArgsTemplate !!js/function >\n (args) => {\n return '';\n }\n\n #############################################\n # Object Attributes/Methods #\n # #\n # These're variables or functions called on #\n # instantiated objects. For example, #\n # ObjectId().isValid() or Timestamp().t #\n # #\n # They follow the same pattern with the\n # *Template/*ArgsTemplates: usually no args #\n # to the Template and lhs plus any original #\n # arguments to the ArgsTemplate. #\n # #\n #############################################\n CodeCodeTemplate: &CodeCodeTemplate !!js/function >\n (lhs) => {\n return `(${lhs})->getCode()`;\n }\n CodeCodeArgsTemplate: &CodeCodeArgsTemplate !!js/function >\n () => {\n return '';\n }\n CodeScopeTemplate: &CodeScopeTemplate !!js/function >\n (lhs) => {\n return `(${lhs})->getScope()`;\n }\n CodeScopeArgsTemplate: &CodeScopeArgsTemplate !!js/function >\n () => {\n return '';\n }\n ObjectIdToStringTemplate: &ObjectIdToStringTemplate !!js/function >\n (lhs) => {\n return `(string) ${lhs}`;\n }\n ObjectIdToStringArgsTemplate: &ObjectIdToStringArgsTemplate !!js/function >\n () => {\n return '';\n }\n ObjectIdEqualsTemplate: &ObjectIdEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} == `;\n }\n ObjectIdEqualsArgsTemplate: &ObjectIdEqualsArgsTemplate !!js/function >\n (arg) => {\n return `${arg}`;\n }\n ObjectIdGetTimestampTemplate: &ObjectIdGetTimestampTemplate !!js/function >\n (lhs) => {\n return `(${lhs})->getTimestamp()`;\n }\n ObjectIdGetTimestampArgsTemplate: &ObjectIdGetTimestampArgsTemplate !!js/function >\n () => {\n return '';\n }\n ObjectIdIsValidTemplate: &ObjectIdIsValidTemplate !!js/function >\n (lhs) => {\n return ``;\n }\n ObjectIdIsValidArgsTemplate: &ObjectIdIsValidArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(\\\\ctype_xdigit(${this.utils.stringifyWithSingleQuotes(arg)}) && \\\\strlen(${this.utils.stringifyWithSingleQuotes(arg)}) == 24)`;\n }\n BinaryValueTemplate: &BinaryValueTemplate !!js/function >\n (lhs) => {\n return `(${lhs})->getData()`;\n }\n BinaryValueArgsTemplate: &BinaryValueArgsTemplate !!js/function >\n () => {\n return '';\n }\n BinaryLengthTemplate: &BinaryLengthTemplate !!js/function >\n (lhs) => {\n return `\\\\strlen((${lhs})->getData())`;\n }\n BinaryLengthArgsTemplate: &BinaryLengthArgsTemplate !!js/function >\n () => {\n return '';\n }\n BinaryToStringTemplate: &BinaryToStringTemplate !!js/function >\n (lhs) => {\n return `(${lhs})->getData()`;\n }\n BinaryToStringArgsTemplate: &BinaryToStringArgsTemplate !!js/function >\n () => {\n return '';\n }\n BinarySubtypeTemplate: &BinarySubtypeTemplate !!js/function >\n (lhs) => {\n return `(${lhs})->getType()`;\n }\n BinarySubtypeArgsTemplate: &BinarySubtypeArgsTemplate !!js/function >\n () => {\n return '';\n }\n DBRefGetDBTemplate: &DBRefGetDBTemplate !!js/function >\n (lhs) => {\n return `${lhs}['$db']`;\n }\n DBRefGetCollectionTemplate: &DBRefGetCollectionTemplate !!js/function >\n (lhs) => {\n return `${lhs}['$ref']`;\n }\n DBRefGetIdTemplate: &DBRefGetIdTemplate !!js/function >\n (lhs) => {\n return `${lhs}['$id']`;\n }\n DBRefGetDBArgsTemplate: &DBRefGetDBArgsTemplate !!js/function >\n (lhs) => {\n return '';\n }\n DBRefGetCollectionArgsTemplate: &DBRefGetCollectionArgsTemplate !!js/function >\n (lhs) => {\n return '';\n }\n DBRefGetIdArgsTemplate: &DBRefGetIdArgsTemplate !!js/function >\n (lhs) => {\n return '';\n }\n DBRefToStringTemplate: &DBRefToStringTemplate null\n DBRefToStringArgsTemplate: &DBRefToStringArgsTemplate null\n DoubleValueOfTemplate: &DoubleValueOfTemplate null\n DoubleValueOfArgsTemplate: &DoubleValueOfArgsTemplate null\n Int32ValueOfTemplate: &Int32ValueOfTemplate null\n Int32ValueOfArgsTemplate: &Int32ValueOfArgsTemplate null\n Int32ToStringTemplate: &Int32ToStringTemplate !!js/function >\n (lhs) => {\n return `(string) ${lhs}`;\n }\n Int32ToStringArgsTemplate: &Int32ToStringArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongEqualsTemplate: &LongEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} ==`;\n }\n LongEqualsArgsTemplate: &LongEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongToStringTemplate: &LongToStringTemplate !!js/function >\n (lhs) => {\n return `(string) ${lhs}`;\n }\n LongToStringArgsTemplate: &LongToStringArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongToIntTemplate: &LongToIntTemplate !!js/function >\n (lhs) => {\n return `${lhs}`;\n }\n LongToIntArgsTemplate: &LongToIntArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongValueOfTemplate: &LongValueOfTemplate null\n LongValueOfArgsTemplate: &LongValueOfArgsTemplate null\n LongToNumberTemplate: &LongToNumberTemplate !!js/function >\n (lhs) => {\n return `(float) ${lhs}`;\n }\n LongToNumberArgsTemplate: &LongToNumberArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongAddTemplate: &LongAddTemplate !!js/function >\n (lhs) => {\n return `${lhs} +`;\n }\n LongAddArgsTemplate: &LongAddArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongSubtractTemplate: &LongSubtractTemplate !!js/function >\n (arg) => {\n return `${arg} -`;\n }\n LongSubtractArgsTemplate: &LongSubtractArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongMultiplyTemplate: &LongMultiplyTemplate !!js/function >\n (arg) => {\n return `${arg} *`;\n }\n LongMultiplyArgsTemplate: &LongMultiplyArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongDivTemplate: &LongDivTemplate !!js/function >\n (lhs) => {\n return `${lhs} /`;\n }\n LongDivArgsTemplate: &LongDivArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongModuloTemplate: &LongModuloTemplate !!js/function >\n (lhs) => {\n return `${lhs} %`;\n }\n LongModuloArgsTemplate: &LongModuloArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongAndTemplate: &LongAndTemplate !!js/function >\n (lhs) => {\n return `${lhs} &`;\n }\n LongAndArgsTemplate: &LongAndArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongOrTemplate: &LongOrTemplate !!js/function >\n (lhs) => {\n return `${lhs} |`;\n }\n LongOrArgsTemplate: &LongOrArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongXorTemplate: &LongXorTemplate !!js/function >\n (lhs) => {\n return `${lhs} ^`;\n }\n LongXorArgsTemplate: &LongXorArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongShiftLeftTemplate: &LongShiftLeftTemplate !!js/function >\n (lhs) => {\n return `${lhs} <<`;\n }\n LongShiftLeftArgsTemplate: &LongShiftLeftArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongShiftRightTemplate: &LongShiftRightTemplate !!js/function >\n (lhs) => {\n return `${lhs} >>`;\n }\n LongShiftRightArgsTemplate: &LongShiftRightArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongCompareTemplate: &LongCompareTemplate !!js/function >\n (lhs) => {\n return `${lhs} <=>`;\n }\n LongCompareArgsTemplate: &LongCompareArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongIsOddTemplate: &LongIsOddTemplate !!js/function >\n (lhs) => {\n return `(${lhs} % 2) === 1`;\n }\n LongIsOddArgsTemplate: &LongIsOddArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongIsZeroTemplate: &LongIsZeroTemplate !!js/function >\n (lhs) => {\n return `${lhs} === 0`;\n }\n LongIsZeroArgsTemplate: &LongIsZeroArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongIsNegativeTemplate: &LongIsNegativeTemplate !!js/function >\n (lhs) => {\n return `${lhs} < 0`;\n }\n LongIsNegativeArgsTemplate: &LongIsNegativeArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongNegateTemplate: &LongNegateTemplate !!js/function >\n () => {\n return '-';\n }\n LongNegateArgsTemplate: &LongNegateArgsTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n LongNotTemplate: &LongNotTemplate !!js/function >\n () => {\n return '~';\n }\n LongNotArgsTemplate: &LongNotArgsTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n LongNotEqualsTemplate: &LongNotEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} !=`;\n }\n LongNotEqualsArgsTemplate: &LongNotEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanTemplate: &LongGreaterThanTemplate !!js/function >\n (lhs) => {\n return `${lhs} >`;\n }\n LongGreaterThanArgsTemplate: &LongGreaterThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanOrEqualTemplate: &LongGreaterThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs} >=`;\n }\n LongGreaterThanOrEqualArgsTemplate: &LongGreaterThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanTemplate: &LongLessThanTemplate !!js/function >\n (lhs) => {\n return `${lhs} <`;\n }\n LongLessThanArgsTemplate: &LongLessThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanOrEqualTemplate: &LongLessThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs} <=`;\n }\n LongLessThanOrEqualArgsTemplate: &LongLessThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongFloatApproxTemplate: &LongFloatApproxTemplate !!js/function >\n (lhs) => {\n return `(float) ${lhs}`;\n }\n LongTopTemplate: &LongTopTemplate !!js/function >\n (lhs) => {\n return `${lhs} >> 32`;\n }\n LongBottomTemplate: &LongBottomTemplate !!js/function >\n (lhs) => {\n return `${lhs} & 0x00000000ffffffff`;\n }\n TimestampToStringTemplate: &TimestampToStringTemplate !!js/function >\n (lhs) => {\n return `(string) ${lhs}`;\n }\n TimestampToStringArgsTemplate: &TimestampToStringArgsTemplate !!js/function >\n () => {\n return '';\n }\n TimestampEqualsTemplate: &TimestampEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} == `;\n }\n TimestampEqualsArgsTemplate: &TimestampEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampGetLowBitsTemplate: &TimestampGetLowBitsTemplate !!js/function >\n (lhs) => {\n return `(${lhs})->getTimestamp()`;\n }\n TimestampGetLowBitsArgsTemplate: &TimestampGetLowBitsArgsTemplate !!js/function >\n () => {\n return ''\n }\n TimestampGetHighBitsTemplate: &TimestampGetHighBitsTemplate !!js/function >\n (lhs) => {\n return `(${lhs})->getIncrement()`;\n }\n TimestampGetHighBitsArgsTemplate: &TimestampGetHighBitsArgsTemplate !!js/function >\n () => {\n return ''\n }\n TimestampTTemplate: &TimestampTTemplate !!js/function >\n (lhs) => {\n return `(${lhs})->getTimestamp()`;\n }\n TimestampITemplate: &TimestampITemplate !!js/function >\n (lhs) => {\n return `(${lhs})->getIncrement()`;\n }\n TimestampAsDateTemplate: &TimestampAsDateTemplate !!js/function >\n (lhs) => {\n return `new UTCDateTime((${lhs})->getTimestamp() * 1000)`;\n }\n TimestampAsDateArgsTemplate: &TimestampAsDateArgsTemplate null\n TimestampCompareTemplate: &TimestampCompareTemplate !!js/function >\n (lhs) => {\n return `${lhs} <=> `;\n }\n TimestampCompareArgsTemplate: &TimestampCompareArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampNotEqualsTemplate: &TimestampNotEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} != `;\n }\n TimestampNotEqualsArgsTemplate: &TimestampNotEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampGreaterThanTemplate: &TimestampGreaterThanTemplate !!js/function >\n (lhs) => {\n return `${lhs} > `;\n }\n TimestampGreaterThanArgsTemplate: &TimestampGreaterThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampGreaterThanOrEqualTemplate: &TimestampGreaterThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs} >= `;\n }\n TimestampGreaterThanOrEqualArgsTemplate: &TimestampGreaterThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampLessThanTemplate: &TimestampLessThanTemplate !!js/function >\n (lhs) => {\n return `${lhs} < `;\n }\n TimestampLessThanArgsTemplate: &TimestampLessThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampLessThanOrEqualTemplate: &TimestampLessThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs} <= `;\n }\n TimestampLessThanOrEqualArgsTemplate: &TimestampLessThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n SymbolValueOfTemplate: &SymbolValueOfTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n SymbolValueOfArgsTemplate: &SymbolValueOfArgsTemplate !!js/function >\n () => {\n return '';\n }\n SymbolInspectTemplate: &SymbolInspectTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n SymbolInspectArgsTemplate: &SymbolInspectArgsTemplate !!js/function >\n () => {\n return '';\n }\n SymbolToStringTemplate: &SymbolToStringTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n SymbolToStringArgsTemplate: &SymbolToStringArgsTemplate !!js/function >\n (lhs) => {\n return '';\n }\n Decimal128ToStringTemplate: &Decimal128ToStringTemplate !!js/function >\n (lhs) => {\n return `(string) ${lhs}`;\n }\n Decimal128ToStringArgsTemplate: &Decimal128ToStringArgsTemplate !!js/function >\n (lhs) => {\n return '';\n }\n\n #############################################\n # Symbol Attributes/Methods #\n # #\n # These're variables or functions called on #\n # symbols. Also called bson-utils. #\n # #\n # They are basically the same thing as #\n # object attributes/methods, but need to be #\n # distinguished since they are separate #\n # namespaces that happen to have the same #\n # name which is v confusing. #\n # #\n # For example, ObjectId().toString() is an #\n # object method, while ObjectId.fromString #\n # is a symbol attribute. These are two #\n # separate ObjectId related namespaces that #\n # don't overlap. #\n # #\n #############################################\n LongSymbolMaxTemplate: &LongSymbolMaxTemplate !!js/function >\n () => {\n return '\\\\PHP_INT_MAX';\n }\n LongSymbolMaxArgsTemplate: &LongSymbolMaxArgsTemplate null\n LongSymbolMinTemplate: &LongSymbolMinTemplate !!js/function >\n () => {\n return '\\\\PHP_INT_MIN';\n }\n LongSymbolMinArgsTemplate: &LongSymbolMinArgsTemplate null\n LongSymbolZeroTemplate: &LongSymbolZeroTemplate !!js/function >\n () => {\n return '0';\n }\n LongSymbolZeroArgsTemplate: &LongSymbolZeroArgsTemplate null\n LongSymbolOneTemplate: &LongSymbolOneTemplate !!js/function >\n () => {\n return '1';\n }\n LongSymbolOneArgsTemplate: &LongSymbolOneArgsTemplate null\n LongSymbolNegOneTemplate: &LongSymbolNegOneTemplate !!js/function >\n () => {\n return '-1';\n }\n LongSymbolNegOneArgsTemplate: &LongSymbolNegOneArgsTemplate null\n LongSymbolFromBitsTemplate: &LongSymbolFromBitsTemplate !!js/function >\n () => {\n return '';\n }\n LongSymbolFromBitsArgsTemplate: &LongSymbolFromBitsArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(int) ${arg}`;\n }\n LongSymbolFromIntTemplate: &LongSymbolFromIntTemplate !!js/function >\n () => {\n return '';\n }\n LongSymbolFromIntArgsTemplate: &LongSymbolFromIntArgsTemplate !!js/function >\n (lhs, arg) => {\n return arg;\n }\n LongSymbolFromNumberTemplate: &LongSymbolFromNumberTemplate !!js/function >\n () => {\n return '';\n }\n LongSymbolFromNumberArgsTemplate: &LongSymbolFromNumberArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(int) ${arg}`;\n }\n LongSymbolFromStringTemplate: &LongSymbolFromStringTemplate !!js/function >\n () => {\n return '';\n }\n LongSymbolFromStringArgsTemplate: &LongSymbolFromStringArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(int) ${arg}`;\n }\n Decimal128SymbolFromStringTemplate: &Decimal128SymbolFromStringTemplate !!js/function >\n () => {\n return 'new Decimal128';\n }\n Decimal128SymbolFromStringArgsTemplate: &Decimal128SymbolFromStringArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(${arg})`;\n }\n ObjectIdCreateFromHexStringTemplate: &ObjectIdCreateFromHexStringTemplate !!js/function >\n () => {\n return 'new ObjectId';\n }\n ObjectIdCreateFromHexStringArgsTemplate: &ObjectIdCreateFromHexStringArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(${arg})`;\n }\n ObjectIdCreateFromTimeTemplate: &ObjectIdCreateFromTimeTemplate !!js/function >\n () => {\n return 'new ObjectId';\n }\n ObjectIdCreateFromTimeArgsTemplate: &ObjectIdCreateFromTimeArgsTemplate !!js/function >\n (lhs, arg, isNumber) => {\n if (!isNumber) {\n return `(\\\\str_pad(\\\\bin2hex(\\\\pack('N', (${arg})->toDateTime()->getTimestamp())), 24, '0'))`;\n }\n return `(\\\\str_pad(\\\\bin2hex(\\\\pack('N', ${arg})), 24, '0'))`;\n }\n # non bson-specific would go here, but there aren't any atm.\n\n #############################################\n # Imports #\n # #\n # Each type has a 'code' that is consistent #\n # between languages. The import templates #\n # for each code generate the required #\n # statement for each type. No args. #\n # #\n # The ImportTemplate collects everything #\n # into one statement. #\n # #\n #############################################\n ImportTemplate: &ImportTemplate !!js/function >\n (args) => {\n let set = new Set(Object.values(args));\n return [...set].sort().join('\\n');\n }\n DriverImportTemplate: &DriverImportTemplate !!js/function >\n () => {\n return `use MongoDB\\\\Client;`;\n }\n 0ImportTemplate: &0ImportTemplate null\n 1ImportTemplate: &1ImportTemplate null\n 2ImportTemplate: &2ImportTemplate null\n 3ImportTemplate: &3ImportTemplate null\n 4ImportTemplate: &4ImportTemplate null\n 5ImportTemplate: &5ImportTemplate null\n 6ImportTemplate: &6ImportTemplate null\n 7ImportTemplate: &7ImportTemplate null\n # Common internal Regexp\n 8ImportTemplate: &8ImportTemplate !!js/function >\n () => {\n return `use MongoDB\\\\BSON\\\\Regex;`;\n }\n 9ImportTemplate: &9ImportTemplate null\n 10ImportTemplate: &10ImportTemplate null\n 11ImportTemplate: &11ImportTemplate null\n 12ImportTemplate: &12ImportTemplate null\n # Code\n 100ImportTemplate: &100ImportTemplate !!js/function >\n () => {\n return `use MongoDB\\\\BSON\\\\Javascript;`;\n }\n # ObjectId\n 101ImportTemplate: &101ImportTemplate !!js/function >\n () => {\n return `use MongoDB\\\\BSON\\\\ObjectId;`;\n }\n # Binary\n 102ImportTemplate: &102ImportTemplate !!js/function >\n () => {\n return `use MongoDB\\\\BSON\\\\Binary;`;\n }\n # DBRef\n 103ImportTemplate: &103ImportTemplate null\n 104ImportTemplate: &104ImportTemplate null\n 105ImportTemplate: &105ImportTemplate null\n # Int64\n 106ImportTemplate: &106ImportTemplate null\n # MinKey\n 107ImportTemplate: &107ImportTemplate !!js/function >\n () => {\n return `use MongoDB\\\\BSON\\\\MinKey;`;\n }\n # MaxKey\n 108ImportTemplate: &108ImportTemplate !!js/function >\n () => {\n return `use MongoDB\\\\BSON\\\\MaxKey;`;\n }\n # Regex\n 109ImportTemplate: &109ImportTemplate !!js/function >\n () => {\n return `use MongoDB\\\\BSON\\\\Regex;`;\n }\n # Timestamp\n 110ImportTemplate: &110ImportTemplate !!js/function >\n () => {\n return `use MongoDB\\\\BSON\\\\Timestamp;`;\n }\n 111ImportTemplate: &111ImportTemplate null\n # Decimal128\n 112ImportTemplate: &112ImportTemplate !!js/function >\n () => {\n return `use MongoDB\\\\BSON\\\\Decimal128;`;\n }\n 113ImportTemplate: &113ImportTemplate null\n 114ImportTemplate: &114ImportTemplate null\n 200ImportTemplate: &200ImportTemplate !!js/function >\n () => {\n return `use MongoDB\\\\BSON\\\\UTCDateTime;`;\n }\n 201ImportTemplate: &201ImportTemplate null\n 300ImportTemplate: &300ImportTemplate null\n 301ImportTemplate: &301ImportTemplate null\n 302ImportTemplate: &302ImportTemplate null\n 303ImportTemplate: &303ImportTemplate null\n 304ImportTemplate: &304ImportTemplate null\n 305ImportTemplate: &305ImportTemplate null\n 306ImportTemplate: &306ImportTemplate null\n# Universal types\n# Everything inherits from StringType because we haven't implemented any of them.\nBasicTypes:\n # Universal basic types\n _bool: &BoolType\n <<: *__type\n id: \"_bool\"\n code: 0\n template: *BoolTypeTemplate\n _integer: &IntegerType\n <<: *__type\n id: \"_integer\"\n code: 1\n template: *IntegerTypeTemplate\n _long: &LongBasicType\n <<: *__type\n id: \"_long\"\n code: 2\n template: *LongBasicTypeTemplate\n _decimal: &DecimalType\n <<: *__type\n id: \"_decimal\"\n code: 3\n template: *DecimalTypeTemplate\n _hex: &HexType\n <<: *__type\n id: \"_hex\"\n code: 4\n template: *HexTypeTemplate\n _octal: &OctalType\n <<: *__type\n id: \"_octal\"\n code: 5\n template: *OctalTypeTemplate\n _numeric: &NumericType\n <<: *__type\n id: \"_numeric\"\n code: 6\n template: *NumericTypeTemplate\n _string: &StringType\n <<: *__type\n id: \"_string\"\n code: 7\n template: *StringTypeTemplate\n _regex: &RegexType\n <<: *__type\n id: \"_regex\"\n code: 8\n template: *RegexTypeTemplate\n _array: &ArrayType\n <<: *__type\n id: \"_array\"\n code: 9\n template: *ArrayTypeTemplate\n argsTemplate: *ArrayTypeArgsTemplate\n _object: &ObjectType\n <<: *__type\n id: \"_object\"\n code: 10\n template: *ObjectTypeTemplate\n argsTemplate: *ObjectTypeArgsTemplate\n _null: &NullType\n <<: *__type\n id: \"_null\"\n code: 11\n template: *NullTypeTemplate\n _undefined: &UndefinedType\n <<: *__type\n id: \"_undefined\"\n code: 12\n template: *UndefinedTypeTemplate\n\nSyntax:\n equality:\n template: *EqualitySyntaxTemplate\n in:\n template: *InSyntaxTemplate\n and:\n template: *AndSyntaxTemplate\n or:\n template: *OrSyntaxTemplate\n not:\n template: *NotSyntaxTemplate\n unary:\n template: *UnarySyntaxTemplate\n binary:\n template: *BinarySyntaxTemplate\n parens:\n template: *ParensSyntaxTemplate\n eos:\n template: *EosSyntaxTemplate\n eof:\n template: *EofSyntaxTemplate\n # The new template takes in expr, and an optional skip argument and optional\n # id argument. The skip argument is a boolean that if true then doesn't add\n # new. The code argument is the symbol code being called. The template will check\n # if it is an exception, i.e. a type that is a constructor but may not use new.\n new:\n template: *NewSyntaxTemplate\n # The regex flags that change symbols between languages can be defined here.\n # Flags that aren't defined can be left blank and will be ignored.\n regexFlags: *RegexFlags\n bsonRegexFlags: *BSONRegexFlags\n driver: *DriverTemplate\nImports:\n import:\n template: *ImportTemplate\n driver:\n template: *DriverImportTemplate\n 0:\n template: *0ImportTemplate\n 1:\n template: *1ImportTemplate\n 2:\n template: *2ImportTemplate\n 3:\n template: *3ImportTemplate\n 4:\n template: *4ImportTemplate\n 5:\n template: *5ImportTemplate\n 6:\n template: *6ImportTemplate\n 7:\n template: *7ImportTemplate\n 8:\n template: *8ImportTemplate\n 9:\n template: *9ImportTemplate\n 10:\n template: *10ImportTemplate\n 11:\n template: *11ImportTemplate\n 12:\n template: *12ImportTemplate\n 100:\n template: *100ImportTemplate\n 101:\n template: *101ImportTemplate\n 102:\n template: *102ImportTemplate\n 103:\n template: *103ImportTemplate\n 104:\n template: *104ImportTemplate\n 105:\n template: *105ImportTemplate\n 106:\n template: *106ImportTemplate\n 107:\n template: *107ImportTemplate\n 108:\n template: *108ImportTemplate\n 109:\n template: *109ImportTemplate\n 110:\n template: *110ImportTemplate\n 111:\n template: *111ImportTemplate\n 112:\n template: *112ImportTemplate\n 113:\n template: *113ImportTemplate\n 114:\n template: *114ImportTemplate\n 200:\n template: *200ImportTemplate\n 201:\n template: *201ImportTemplate\n 300:\n template: *300ImportTemplate\n 301:\n template: *301ImportTemplate\n 302:\n template: *302ImportTemplate\n 303:\n template: *303ImportTemplate\n 304:\n template: *304ImportTemplate\n 305:\n template: *305ImportTemplate\n 306:\n template: *306ImportTemplate\nBsonTypes:\n Code: &CodeType\n <<: *__type\n id: \"Code\"\n code: 100\n type: *ObjectType\n attr:\n code:\n callable: *var\n args: null\n attr: null\n id: \"code\"\n type: *StringType\n template: *CodeCodeTemplate\n argsTemplate: *CodeCodeArgsTemplate\n scope:\n callable: *var\n args: null\n attr: null\n id: \"scope\"\n type: *StringType\n template: *CodeScopeTemplate\n argsTemplate: *CodeScopeArgsTemplate\n ObjectId: &ObjectIdType\n <<: *__type\n id: \"ObjectId\"\n code: 101\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *ObjectIdToStringTemplate\n argsTemplate: *ObjectIdToStringArgsTemplate\n equals:\n <<: *__func\n id: \"equals\"\n args:\n - [ \"ObjectId\" ]\n type: *BoolType\n template: *ObjectIdEqualsTemplate\n argsTemplate: *ObjectIdEqualsArgsTemplate\n getTimestamp:\n <<: *__func\n id: \"getTimestamp\"\n type: *IntegerType\n template: *ObjectIdGetTimestampTemplate\n argsTemplate: *ObjectIdGetTimestampArgsTemplate\n BinData: &BinaryType\n <<: *__type\n id: \"BinData\"\n code: 102\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *BinaryToStringTemplate\n argsTemplate: *BinaryToStringArgsTemplate\n base64:\n <<: *__func\n id: \"base64\"\n type: *StringType\n template: *BinaryValueTemplate\n argsTemplate: *BinaryValueArgsTemplate\n length:\n <<: *__func\n id: \"length\"\n type: *IntegerType\n template: *BinaryLengthTemplate\n argsTemplate: *BinaryLengthArgsTemplate\n subtype:\n <<: *__func\n id: \"subtype\"\n type: *IntegerType\n template: *BinarySubtypeTemplate\n argsTemplate: *BinarySubtypeArgsTemplate\n DBRef: &DBRefType\n <<: *__type\n id: \"DBRef\"\n code: 103\n type: *ObjectType\n attr:\n getDb:\n <<: *__func\n id: \"getDb\"\n type: *StringType\n template: *DBRefGetDBTemplate\n argsTemplate: *DBRefGetDBArgsTemplate\n $db:\n callable: *var\n args: null\n attr: null\n id: \"$db\"\n type: *StringType\n template: *DBRefGetDBTemplate\n argsTemplate: *DBRefGetDBArgsTemplate\n getCollection:\n <<: *__func\n id: \"getCollection\"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n getRef:\n <<: *__func\n id: \"getRef\"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n $ref:\n callable: *var\n args: null\n attr: null\n id: \"$ref\"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n getId:\n <<: *__func\n id: \"getId\"\n type: *StringType\n template: *DBRefGetIdTemplate\n argsTemplate: *DBRefGetIdArgsTemplate\n $id:\n callable: *var\n args: null\n attr: null\n id: \"$id\"\n type: *StringType\n template: *DBRefGetIdTemplate\n argsTemplate: *DBRefGetIdArgsTemplate\n NumberInt: &Int32Type\n <<: *__type\n id: \"NumberInt\"\n code: 105\n type: *ObjectType\n attr: {}\n NumberLong: &LongType\n <<: *__type\n id: \"NumberLong\"\n code: 106\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"LongtoString\" # Needs process method\n args:\n - [ *IntegerType, null ]\n type: *StringType\n template: *LongToStringTemplate\n argsTemplate: *LongToStringArgsTemplate\n equals:\n <<: *__func\n id: \"equals\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongEqualsTemplate\n argsTemplate: *LongEqualsArgsTemplate\n toInt:\n <<: *__func\n id: \"toInt\"\n type: *IntegerType\n template: *LongToIntTemplate\n argsTemplate: *LongToIntArgsTemplate\n toNumber:\n <<: *__func\n id: \"toNumber\"\n type: *DecimalType\n template: *LongToNumberTemplate\n argsTemplate: *LongToNumberArgsTemplate\n compare:\n <<: *__func\n id: \"compare\"\n args:\n - [ \"Long\" ]\n type: *StringType\n template: *LongCompareTemplate\n argsTemplate: *LongCompareArgsTemplate\n isOdd:\n <<: *__func\n id: \"isOdd\"\n type: *BoolType\n template: *LongIsOddTemplate\n argsTemplate: *LongIsOddArgsTemplate\n isZero:\n <<: *__func\n id: \"isZero\"\n type: *BoolType\n template: *LongIsZeroTemplate\n argsTemplate: *LongIsZeroArgsTemplate\n isNegative:\n <<: *__func\n id: \"isNegative\"\n type: *BoolType\n template: *LongIsNegativeTemplate\n argsTemplate: *LongIsNegativeArgsTemplate\n negate:\n <<: *__func\n id: \"negate\"\n type: \"Long\"\n template: *LongNegateTemplate\n argsTemplate: *LongNegateArgsTemplate\n not:\n <<: *__func\n id: \"not\"\n type: \"Long\"\n template: *LongNotTemplate\n argsTemplate: *LongNotArgsTemplate\n notEquals:\n <<: *__func\n id: \"notEquals\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongNotEqualsTemplate\n argsTemplate: *LongNotEqualsArgsTemplate\n greaterThan:\n <<: *__func\n id: \"greaterThan\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongGreaterThanTemplate\n argsTemplate: *LongGreaterThanArgsTemplate\n greaterThanOrEqual:\n <<: *__func\n id: \"greaterThanOrEqual\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongGreaterThanOrEqualTemplate\n argsTemplate: *LongGreaterThanOrEqualArgsTemplate\n lessThan:\n <<: *__func\n id: \"lessThan\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongLessThanTemplate\n argsTemplate: *LongLessThanArgsTemplate\n lessThanOrEqual:\n <<: *__func\n id: \"lessThanOrEqual\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongLessThanOrEqualTemplate\n argsTemplate: *LongLessThanOrEqualArgsTemplate\n add:\n <<: *__func\n id: \"add\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongAddTemplate\n argsTemplate: *LongAddArgsTemplate\n subtract:\n <<: *__func\n id: \"subtract\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongSubtractTemplate\n argsTemplate: *LongSubtractArgsTemplate\n multiply:\n <<: *__func\n id: \"multiply\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongMultiplyTemplate\n argsTemplate: *LongMultiplyArgsTemplate\n div:\n <<: *__func\n id: \"div\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongDivTemplate\n argsTemplate: *LongDivArgsTemplate\n modulo:\n <<: *__func\n id: \"modulo\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongModuloTemplate\n argsTemplate: *LongModuloArgsTemplate\n and:\n <<: *__func\n id: \"and\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongAndTemplate\n argsTemplate: *LongAndArgsTemplate\n or:\n <<: *__func\n id: \"or\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongOrTemplate\n argsTemplate: *LongOrArgsTemplate\n xor:\n <<: *__func\n id: \"xor\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongXorTemplate\n argsTemplate: *LongXorArgsTemplate\n shiftLeft:\n <<: *__func\n id: \"shiftLeft\"\n args:\n - [ *IntegerType ]\n type: \"Long\"\n template: *LongShiftLeftTemplate\n argsTemplate: *LongShiftLeftArgsTemplate\n shiftRight:\n <<: *__func\n id: \"shiftRight\"\n args:\n - [ *IntegerType ]\n type: \"Long\"\n template: *LongShiftRightTemplate\n argsTemplate: *LongShiftRightArgsTemplate\n MinKeyType: &MinKeyType\n <<: *__type\n id: \"MinKey\"\n code: 107\n type: *ObjectType\n MaxKeyType: &MaxKeyType\n <<: *__type\n id: \"MaxKey\"\n code: 108\n type: *ObjectType\n Timestamp: &TimestampType\n <<: *__type\n id: \"Timestamp\"\n code: 110\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *TimestampToStringTemplate\n argsTemplate: *TimestampToStringArgsTemplate\n equals:\n <<: *__func\n id: \"equals\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampEqualsTemplate\n argsTemplate: *TimestampEqualsArgsTemplate\n getLowBits:\n <<: *__func\n id: \"getLowBits\"\n type: *IntegerType\n template: *TimestampGetLowBitsTemplate\n argsTemplate: *TimestampGetLowBitsArgsTemplate\n getHighBits:\n <<: *__func\n id: \"getHighBits\"\n type: *IntegerType\n template: *TimestampGetHighBitsTemplate\n argsTemplate: *TimestampGetHighBitsArgsTemplate\n compare:\n <<: *__func\n id: \"compare\"\n args:\n - [ \"Timestamp\" ]\n type: *StringType\n template: *TimestampCompareTemplate\n argsTemplate: *TimestampCompareArgsTemplate\n notEquals:\n <<: *__func\n id: \"notEquals\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampNotEqualsTemplate\n argsTemplate: *TimestampNotEqualsArgsTemplate\n greaterThan:\n <<: *__func\n id: \"greaterThan\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampGreaterThanTemplate\n argsTemplate: *TimestampGreaterThanArgsTemplate\n greaterThanOrEqual:\n <<: *__func\n id: \"greaterThanOrEqual\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampGreaterThanOrEqualTemplate\n argsTemplate: *TimestampGreaterThanOrEqualArgsTemplate\n lessThan:\n <<: *__func\n id: \"lessThan\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampLessThanTemplate\n argsTemplate: *TimestampLessThanArgsTemplate\n lessThanOrEqual:\n <<: *__func\n id: \"lessThanOrEqual\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampLessThanOrEqualTemplate\n argsTemplate: *TimestampLessThanOrEqualArgsTemplate\n BSONSymbol: &SymbolType\n <<: *__type\n id: \"BSONSymbol\"\n code: 111\n type: *ObjectType\n attr:\n valueOf:\n <<: *__func\n id: \"valueOf\"\n type: *StringType\n template: *SymbolValueOfTemplate\n argsTemplate: *SymbolValueOfArgsTemplate\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *SymbolToStringTemplate\n argsTemplate: *SymbolToStringArgsTemplate\n inspect:\n <<: *__func\n id: \"inspect\"\n type: *StringType\n template: *SymbolInspectTemplate\n argsTemplate: *SymbolInspectArgsTemplate\n Double: &DoubleType\n <<: *__type\n id: \"Double\"\n code: 104\n type: *ObjectType\n attr: {}\n Decimal128: &Decimal128Type\n <<: *__type\n id: \"Decimal128\"\n code: 112\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *Decimal128ToStringTemplate\n argsTemplate: *Decimal128ToStringArgsTemplate\n NumberDecimal: &NumberDecimalType\n <<: *__type\n id: \"NumberDecimal\"\n code: 112\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *Decimal128ToStringTemplate\n argsTemplate: *Decimal128ToStringArgsTemplate\n\n\n SUBTYPE_DEFAULT:\n id: \"SUBTYPE_DEFAULT\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeDefaultTemplate\n SUBTYPE_FUNCTION:\n id: \"SUBTYPE_FUNCTION\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeFunctionTemplate\n SUBTYPE_BYTE_ARRAY:\n id: \"SUBTYPE_BYTE_ARRAY\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeByteArrayTemplate\n SUBTYPE_UUID_OLD:\n id: \"SUBTYPE_UUID_OLD\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUuidOldTemplate\n SUBTYPE_UUID:\n id: \"SUBTYPE_UUID\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUuidTemplate\n SUBTYPE_MD5:\n id: \"SUBTYPE_MD5\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeMd5Template\n SUBTYPE_USER_DEFINED:\n id: \"SUBTYPE_USER_DEFINED\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUserDefinedTemplate\n BSONRegExpType: &BSONRegExpType\n <<: *__type\n id: \"BSONRegExp\"\n code: 109\n type: *ObjectType\nNativeTypes:\n Date: &DateType\n <<: *__type\n id: \"Date\"\n code: 200\n type: *ObjectType\n attr: {} # TODO: no built-in date methods added yet\n RegExp: &RegExpType\n <<: *__type\n id: \"RegExp\"\n code: 8\n type: *ObjectType\n attr: {}\n\n\nBsonSymbols:\n Code: &CodeSymbol\n id: \"Code\"\n code: 100\n callable: *constructor\n args:\n - [ *StringType, null ]\n - [ *ObjectType, null ]\n type: *CodeType\n attr: {}\n template: *CodeSymbolTemplate\n argsTemplate: *CodeSymbolArgsTemplate\n ObjectId: &ObjectIdSymbol\n id: \"ObjectId\"\n code: 101\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n type: *ObjectIdType\n attr:\n createFromHexString:\n <<: *__func\n id: \"createFromHexString\"\n args:\n - [ *StringType ]\n type: *ObjectIdType\n template: *ObjectIdCreateFromHexStringTemplate\n argsTemplate: *ObjectIdCreateFromHexStringArgsTemplate\n createFromTime:\n <<: *__func\n id: \"ObjectIdCreateFromTime\"\n args:\n - [ *NumericType, *DateType ]\n type: *ObjectIdType\n template: *ObjectIdCreateFromTimeTemplate\n argsTemplate: *ObjectIdCreateFromTimeArgsTemplate\n isValid:\n <<: *__func\n id: \"isValid\"\n args:\n - [ *StringType ]\n type: *BoolType\n template: *ObjectIdIsValidTemplate\n argsTemplate: *ObjectIdIsValidArgsTemplate\n template: *ObjectIdSymbolTemplate\n argsTemplate: *ObjectIdSymbolArgsTemplate\n BinData: &BinarySymbol\n id: \"BinData\"\n code: 102\n callable: *constructor\n args:\n - [ *IntegerType ]\n - [ *StringType ]\n type: *BinaryType\n attr: {}\n template: *BinarySymbolTemplate\n argsTemplate: *BinarySymbolArgsTemplate\n DBRef:\n id: \"DBRef\"\n code: 103\n callable: *constructor\n args:\n - [ *StringType ]\n - [ *ObjectIdType ]\n - [ *StringType, null ]\n type: *DBRefType\n attr: {}\n template: *DBRefSymbolTemplate\n argsTemplate: *DBRefSymbolArgsTemplate\n NumberInt:\n id: \"Int32\"\n code: 105\n callable: *constructor\n args:\n - [ *NumericType, *StringType, null ]\n type: *Int32Type\n attr: {}\n template: *Int32SymbolTemplate\n argsTemplate: *Int32SymbolArgsTemplate\n NumberLong:\n id: \"NumberLong\"\n code: 106\n callable: *constructor\n args:\n - [ *IntegerType, *StringType, null ]\n type: *LongType\n attr: {}\n template: *LongSymbolTemplate\n argsTemplate: *LongSymbolArgsTemplate\n MinKey:\n id: \"MinKey\"\n code: 107\n callable: *constructor\n args: []\n type: *MinKeyType\n attr: {}\n template: *MinKeySymbolTemplate\n argsTemplate: *MinKeySymbolArgsTemplate\n MaxKey:\n id: \"MaxKey\"\n code: 108\n callable: *constructor\n args: []\n type: *MaxKeyType\n attr: {}\n template: *MaxKeySymbolTemplate\n argsTemplate: *MaxKeySymbolArgsTemplate\n Timestamp:\n id: \"Timestamp\"\n code: 110\n callable: *constructor\n args:\n - [ *IntegerType, null ]\n - [ *IntegerType, null ]\n type: *TimestampType\n attr: {}\n template: *TimestampSymbolTemplate\n argsTemplate: *TimestampSymbolArgsTemplate\n Symbol:\n id: \"Symbol\"\n code: 111\n callable: *constructor\n args:\n - [ *StringType ]\n type: *SymbolType\n attr: {}\n template: *SymbolSymbolTemplate\n argsTemplate: *SymbolSymbolArgsTemplate\n NumberDecimal:\n id: \"NumberDecimal\"\n code: 112\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n type: *Decimal128Type\n attr: {}\n template: *Decimal128SymbolTemplate\n argsTemplate: *Decimal128SymbolArgsTemplate\n BSONRegExp:\n id: \"BSONRegExp\"\n code: 109\n callable: *constructor\n args:\n - [ *StringType ]\n - [ *StringType, null ]\n type: *BSONRegExpType\n attr: {}\n template: *BSONRegExpSymbolTemplate\n argsTemplate: *BSONRegExpSymbolArgsTemplate\n BSONSymbol:\n id: \"BSONSymbol\"\n code: 111\n callable: *constructor\n args:\n - [ *StringType ]\n type: *SymbolType\n attr: {}\n template: *SymbolSymbolTemplate\n argsTemplate: *SymbolSymbolArgsTemplate\n Decimal128:\n id: \"Decimal128\"\n code: 112\n callable: *constructor\n args:\n - [ *ObjectType ]\n type: *Decimal128Type\n attr:\n fromString:\n id: \"fromString\"\n callable: *func\n args:\n - [ *StringType ]\n type: *Decimal128Type\n attr: {}\n template: *Decimal128SymbolFromStringTemplate\n argsTemplate: *Decimal128SymbolFromStringArgsTemplate\n template: *Decimal128SymbolTemplate\n argsTemplate: *Decimal128SymbolArgsTemplate\n Double:\n id: \"Double\"\n code: 104\n callable: *constructor\n args:\n - [ *NumericType, *StringType ]\n type: *DoubleType\n attr: {}\n template: *DoubleSymbolTemplate\n argsTemplate: *DoubleSymbolArgsTemplate\n Int32:\n id: \"Int32\"\n code: 105\n callable: *constructor\n args:\n - [ *NumericType, *StringType ]\n type: *Int32Type\n attr: {}\n template: *Int32SymbolTemplate\n argsTemplate: *Int32SymbolArgsTemplate\n Long:\n id: \"Long\"\n code: 106\n callable: *constructor\n args:\n - [ *IntegerType ]\n - [ *IntegerType ]\n type: *LongType\n attr:\n MAX_VALUE:\n id: \"MAX_VALUE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolMaxTemplate\n argsTemplate: *LongSymbolMaxArgsTemplate\n MIN_VALUE:\n id: \"MIN_VALUE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolMinTemplate\n argsTemplate: *LongSymbolMinArgsTemplate\n ZERO:\n id: \"ZERO\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolZeroTemplate\n argsTemplate: *LongSymbolZeroArgsTemplate\n ONE:\n id: \"ONE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolOneTemplate\n argsTemplate: *LongSymbolOneArgsTemplate\n NEG_ONE:\n id: \"NEG_ONE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolNegOneTemplate\n argsTemplate: *LongSymbolNegOneArgsTemplate\n fromBits:\n id: \"LongfromBits\" # Needs process method\n callable: *func\n args:\n - [ *IntegerType ]\n - [ *IntegerType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromBitsTemplate\n argsTemplate: *LongSymbolFromBitsArgsTemplate\n fromInt:\n id: \"fromInt\"\n callable: *func\n args:\n - [ *IntegerType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromIntTemplate\n argsTemplate: *LongSymbolFromIntArgsTemplate\n fromNumber:\n id: \"fromNumber\"\n callable: *func\n args:\n - [ *NumericType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromNumberTemplate\n argsTemplate: *LongSymbolFromNumberArgsTemplate\n fromString:\n id: \"fromString\"\n callable: *func\n args:\n - [ *StringType ]\n - [ *IntegerType, null ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromStringTemplate\n argsTemplate: *LongSymbolFromStringArgsTemplate\n template: *LongSymbolTemplate\n argsTemplate: *LongSymbolArgsTemplate\n\nNativeSymbols:\n Number:\n id: \"Number\"\n code: 2\n callable: *constructor\n args:\n - [ *IntegerType, *StringType, null ]\n type: *NumericType\n attr: {} # TODO: no built-in number funcs added yet\n template: *NumberSymbolTemplate\n argsTemplate: *NumberSymbolArgsTemplate\n Date: # Needs emit method\n id: \"Date\"\n code: 200\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n type: *DateType\n attr: # TODO: add more date funcs?\n now:\n id: \"now\"\n code: 200.1\n callable: *func\n args: []\n type: *DateType\n attr: {}\n template: *DateSymbolNowTemplate\n argsTemplate: *DateSymbolNowArgsTemplate\n template: *DateSymbolTemplate\n argsTemplate: *DateSymbolArgsTemplate\n ISODate: # Needs emit method\n id: \"ISODate\"\n code: 200\n callable: *constructor\n args:\n - [ *StringType, null ]\n type: *DateType\n attr:\n now:\n id: \"now\"\n callable: *constructor\n args: []\n type: *DateType\n attr: {}\n template: *DateSymbolNowTemplate\n argsTemplate: *DateSymbolNowArgsTemplate\n template: *DateSymbolTemplate\n argsTemplate: *DateSymbolArgsTemplate\n RegExp: # Needs process method\n id: \"RegExp\"\n code: 8\n callable: *constructor\n args:\n - [ *StringType, *RegexType ]\n - [ *StringType, null ]\n type: *RegExpType\n attr: {} # TODO: no built-in regex funcs added yet\n template: *RegExpSymbolTemplate\n argsTemplate: *RegExpSymbolArgsTemplate\n\n"},6691:e=>{e.exports="SymbolTypes:\n VAR: &var 0\n CONSTRUCTOR: &constructor 1\n FUNC: &func 2\n# Internal patterns to save typing\n__type: &__type\n id: null\n callable: *var\n args: null\n type: null\n attr: {}\n template: null\n argsTemplate: null\n__func: &__func\n callable: *func\n args: []\n attr: {}\n template: null\n argsTemplate: null\n\n# Python Templates\nTemplates:\n # Misc\n RegexFlags: &RegexFlags\n i: 'i'\n m: 'm'\n u: 'a'\n y: ''\n g: 's'\n BSONRegexFlags: &BSONRegexFlags\n i: 'i'\n m: 'm'\n x: 'x'\n s: 's'\n l: 'l'\n u: 'u'\n # Syntax\n\n # filter, project, sort, collation, skip, limit, maxTimeMS\n DriverTemplate: &DriverTemplate !!js/function >\n (spec) => {\n const comment = `# Requires the PyMongo package.\n # https://api.mongodb.com/python/current`;\n const translateKey = {\n filter: 'filter',\n project: 'projection',\n sort: 'sort',\n collation: 'collation',\n skip: 'skip',\n limit: 'limit',\n maxTimeMS: 'max_time_ms'\n };\n const options = spec.options;\n const exportMode = spec.exportMode;\n delete spec.options;\n delete spec.exportMode;\n\n const connect = `client = MongoClient('${options.uri}')`;\n const coll = `client['${options.database}']['${options.collection}']`;\n\n let driverMethod;\n switch (exportMode) {\n case 'Delete Query':\n driverMethod = 'delete_many';\n break;\n case 'Update Query':\n driverMethod = 'update_many';\n break;\n default:\n driverMethod = 'find';\n }\n\n if ('aggregation' in spec) {\n return `${comment}\\n\\n${connect}\\nresult = ${coll}.aggregate(${spec.aggregation})`;\n }\n\n const vars = Object.keys(spec).reduce(\n (result, k) => {\n if (k === 'sort') {\n return `${result}\\n${k}=list(${spec[k]}.items())`;\n }\n return `${result}\\n${k}=${spec[k]}`;\n },\n connect\n );\n\n const args = Object.keys(spec).reduce(\n (result, k) => {\n const divider = result === '' ? '' : ',\\n';\n return `${result}${divider} ${\n k in translateKey ? translateKey[k] : k\n }=${k}`;\n },\n ''\n );\n const cmd = `result = ${coll}.${driverMethod}(\\n${args}\\n)`;\n\n return `${comment}\\n\\n${vars}\\n\\n${cmd}`;\n }\n EqualitySyntaxTemplate: &EqualitySyntaxTemplate !!js/function >\n (lhs, op, rhs) => {\n if (op.includes('!')) {\n return `${lhs} != ${rhs}`;\n }\n else if (op === '==' || op === '===' || op === 'is') {\n return `${lhs} == ${rhs}`;\n }\n return `${lhs} ${op} ${rhs}`;\n }\n InSyntaxTemplate: &InSyntaxTemplate !!js/function >\n (lhs, op, rhs) => {\n let str = 'in';\n if (op.includes('!') || op.includes('not')) {\n str = 'not in';\n }\n return `${lhs} ${str} ${rhs}`\n }\n AndSyntaxTemplate: &AndSyntaxTemplate !!js/function >\n (args) => {\n return args.join(' and ');\n }\n OrSyntaxTemplate: &OrSyntaxTemplate !!js/function >\n (args) => {\n return args.join(' or ');\n }\n NotSyntaxTemplate: &NotSyntaxTemplate !!js/function >\n (arg) => {\n return `not ${arg}`;\n }\n UnarySyntaxTemplate: &UnarySyntaxTemplate null\n BinarySyntaxTemplate: &BinarySyntaxTemplate !!js/function >\n (args) => {\n return args.reduce((s, op, i, arr) => {\n if (i % 2 === 0) {\n return s;\n }\n const rhs = arr[i + 1];\n switch(op) {\n case '//':\n return `${s} // ${rhs}`;\n case '**':\n return `${s} ** ${rhs}`;\n default:\n return `${s} ${op} ${rhs}`;\n }\n }, args[0]);\n }\n ParensSyntaxTemplate: &ParensSyntaxTemplate null\n EosSyntaxTemplate: &EosSyntaxTemplate null\n EofSyntaxTemplate: &EofSyntaxTemplate null\n NewTemplate: &NewSyntaxTemplate null\n # BSON Object Type templates\n CodeTypeTemplate: &CodeTypeTemplate null\n StringTypeTemplate: &StringTypeTemplate !!js/function >\n (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `'${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}'`;\n }\n RegexTypeTemplate: &RegexTypeTemplate !!js/function >\n (pattern, flags) => {\n flags = flags === '' ? '' : `(?${flags})`;\n const escaped = pattern.replace(/\\\\(?!\\/)/, '\\\\\\\\');\n\n // Double-quote stringify\n const str = escaped + flags;\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `re.compile(r\"${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\")`;\n }\n BoolTypeTemplate: &BoolTypeTemplate !!js/function >\n (str) => {\n return `${str.charAt(0).toUpperCase()}${str.slice(1)}`;\n }\n IntegerTypeTemplate: &IntegerTypeTemplate null\n DecimalTypeTemplate: &DecimalTypeTemplate null\n LongBasicTypeTemplate: &LongBasicTypeTemplate null\n HexTypeTemplate: &HexTypeTemplate null\n OctalTypeTemplate: &OctalTypeTemplate !!js/function >\n (literal) => {\n let offset = 0;\n\n if (\n literal.charAt(0) === '0' &&\n (literal.charAt(1) === '0' || literal.charAt(1) === 'o' || literal.charAt(1) === 'O')\n ) {\n offset = 2;\n } else if (literal.charAt(0) === '0') {\n offset = 1;\n }\n\n literal = `0o${literal.substr(offset, literal.length - 1)}`;\n\n return literal;\n }\n NumericTypeTemplate: &NumericTypeTemplate null\n ArrayTypeTemplate: &ArrayTypeTemplate !!js/function >\n (literal, depth) => {\n depth++;\n if (literal === '') {\n return '[]'\n }\n const indent = '\\n' + ' '.repeat(depth);\n const closingIndent = '\\n' + ' '.repeat(depth - 1);\n\n return `[${indent}${literal}${closingIndent}]`;\n }\n ArrayTypeArgsTemplate: &ArrayTypeArgsTemplate null\n NullTypeTemplate: &NullTypeTemplate !!js/function >\n () => {\n return 'None';\n }\n UndefinedTypeTemplate: &UndefinedTypeTemplate !!js/function >\n () => {\n return 'None';\n }\n ObjectTypeTemplate: &ObjectTypeTemplate !!js/function >\n (literal, depth) => {\n if (literal === '') {\n return '{}';\n }\n return literal;\n }\n ObjectTypeArgsTemplate: &ObjectTypeArgsTemplate !!js/function >\n (args, depth) => {\n if (args.length === 0) {\n return '{}';\n }\n depth++;\n const indent = '\\n' + ' '.repeat(depth);\n const closingIndent = '\\n' + ' '.repeat(depth - 1);\n const singleStringify = (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `'${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}'`;\n }\n\n const pairs = args.map((arg) => {\n return `${indent}${singleStringify(arg[0])}: ${arg[1]}`;\n }).join(', ');\n\n return `{${pairs}${closingIndent}}`;\n }\n # BSON Object Method templates\n CodeCodeTemplate: &CodeCodeTemplate !!js/function >\n (lhs) => {\n return `str(${lhs})`;\n }\n CodeCodeArgsTemplate: &CodeCodeArgsTemplate null\n CodeScopeTemplate: &CodeScopeTemplate null\n CodeScopeArgsTemplate: &CodeScopeArgsTemplate null\n ObjectIdToStringTemplate: &ObjectIdToStringTemplate !!js/function >\n (lhs) => {\n return `str(${lhs})`;\n }\n ObjectIdToStringArgsTemplate: &ObjectIdToStringArgsTemplate !!js/function >\n (lhs) => {\n return '';\n }\n ObjectIdEqualsTemplate: &ObjectIdEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} ==`;\n }\n ObjectIdEqualsArgsTemplate: &ObjectIdEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n ObjectIdGetTimestampTemplate: &ObjectIdGetTimestampTemplate !!js/function >\n (lhs) => {\n return `${lhs}.generation_time`;\n }\n ObjectIdGetTimestampArgsTemplate: &ObjectIdGetTimestampArgsTemplate !!js/function >\n () => {\n return '';\n }\n BinaryValueTemplate: &BinaryValueTemplate !!js/function >\n () => {\n return '';\n }\n BinaryValueArgsTemplate: &BinaryValueArgsTemplate !!js/function >\n (lhs) => {\n return `str(${lhs})`;\n }\n BinaryLengthTemplate: &BinaryLengthTemplate !!js/function >\n () => {\n return '';\n }\n BinaryLengthArgsTemplate: &BinaryLengthArgsTemplate !!js/function >\n (lhs) => {\n return `len(${lhs})`;\n }\n BinaryToStringTemplate: &BinaryToStringTemplate !!js/function >\n () => {\n return '';\n }\n BinaryToStringArgsTemplate: &BinaryToStringArgsTemplate !!js/function >\n (lhs) => {\n return `str(${lhs})`;\n }\n BinarySubtypeTemplate: &BinarySubtypeTemplate !!js/function >\n (lhs) => {\n return `${lhs}.subtype`;\n }\n BinarySubtypeArgsTemplate: &BinarySubtypeArgsTemplate null\n DBRefGetDBTemplate: &DBRefGetDBTemplate !!js/function >\n (lhs) => {\n return `${lhs}.database`;\n }\n DBRefGetCollectionTemplate: &DBRefGetCollectionTemplate !!js/function >\n (lhs) => {\n return `${lhs}.collection`;\n }\n DBRefGetIdTemplate: &DBRefGetIdTemplate !!js/function >\n (lhs) => {\n return `${lhs}.id`;\n }\n DBRefGetIdArgsTemplate: &DBRefGetIdArgsTemplate !!js/function\n () => {\n return '';\n }\n DBRefGetDBArgsTemplate: &DBRefGetDBArgsTemplate !!js/function >\n () => {\n return '';\n }\n DBRefGetCollectionArgsTemplate: &DBRefGetCollectionArgsTemplate !!js/function\n () => {\n return '';\n }\n LongEqualsTemplate: &LongEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} ==`;\n }\n LongEqualsArgsTemplate: &LongEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongToIntTemplate: &LongToIntTemplate !!js/function >\n (lhs) => {\n return `int(${lhs})`;\n }\n LongToIntArgsTemplate: &LongToIntArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongToStringTemplate: &LongToStringTemplate !!js/function >\n () => {\n return 'str';\n }\n LongToStringArgsTemplate: &LongToStringArgsTemplate !!js/function >\n (lhs) => {\n return `(${lhs})`;\n }\n LongToNumberTemplate: &LongToNumberTemplate !!js/function >\n (lhs) => {\n return `float(${lhs})`;\n }\n LongToNumberArgsTemplate: &LongToNumberArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongAddTemplate: &LongAddTemplate !!js/function >\n (lhs) => {\n return `${lhs} +`;\n }\n LongAddArgsTemplate: &LongAddArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongSubtractTemplate: &LongSubtractTemplate !!js/function >\n (arg) => {\n return `${arg} -`;\n }\n LongSubtractArgsTemplate: &LongSubtractArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongMultiplyTemplate: &LongMultiplyTemplate !!js/function >\n (arg) => {\n return `${arg} *`;\n }\n LongMultiplyArgsTemplate: &LongMultiplyArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongDivTemplate: &LongDivTemplate !!js/function >\n (lhs) => {\n return `${lhs} /`;\n }\n LongDivArgsTemplate: &LongDivArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongModuloTemplate: &LongModuloTemplate !!js/function >\n (lhs) => {\n return `${lhs} %`;\n }\n LongModuloArgsTemplate: &LongModuloArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongAndTemplate: &LongAndTemplate !!js/function >\n (lhs) => {\n return `${lhs} &`;\n }\n LongAndArgsTemplate: &LongAndArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongOrTemplate: &LongOrTemplate !!js/function >\n (lhs) => {\n return `${lhs} |`;\n }\n LongOrArgsTemplate: &LongOrArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongXorTemplate: &LongXorTemplate !!js/function >\n (lhs) => {\n return `${lhs} ^`;\n }\n LongXorArgsTemplate: &LongXorArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongShiftLeftTemplate: &LongShiftLeftTemplate !!js/function >\n (lhs) => {\n return `${lhs} <<`;\n }\n LongShiftLeftArgsTemplate: &LongShiftLeftArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongShiftRightTemplate: &LongShiftRightTemplate !!js/function >\n (lhs) => {\n return `${lhs} >>`;\n }\n LongShiftRightArgsTemplate: &LongShiftRightArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongCompareTemplate: &LongCompareTemplate !!js/function >\n (lhs) => {\n return `${lhs} -`;\n }\n LongCompareArgsTemplate: &LongCompareArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongIsOddTemplate: &LongIsOddTemplate !!js/function >\n (lhs) => {\n return `(${lhs} % 2) == 1`;\n }\n LongIsOddArgsTemplate: &LongIsOddArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongIsZeroTemplate: &LongIsZeroTemplate !!js/function >\n (lhs) => {\n return `${lhs} == 0`;\n }\n LongIsZeroArgsTemplate: &LongIsZeroArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongIsNegativeTemplate: &LongIsNegativeTemplate !!js/function >\n (lhs) => {\n return `${lhs} < 0`;\n }\n LongIsNegativeArgsTemplate: &LongIsNegativeArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongNegateTemplate: &LongNegateTemplate !!js/function >\n () => {\n return '-';\n }\n LongNegateArgsTemplate: &LongNegateArgsTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n LongNotTemplate: &LongNotTemplate !!js/function >\n () => {\n return '~';\n }\n LongNotArgsTemplate: &LongNotArgsTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n LongNotEqualsTemplate: &LongNotEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} !=`;\n }\n LongNotEqualsArgsTemplate: &LongNotEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanTemplate: &LongGreaterThanTemplate !!js/function >\n (lhs) => {\n return `${lhs} >`;\n }\n LongGreaterThanArgsTemplate: &LongGreaterThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanOrEqualTemplate: &LongGreaterThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs} >=`;\n }\n LongGreaterThanOrEqualArgsTemplate: &LongGreaterThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanTemplate: &LongLessThanTemplate !!js/function >\n (lhs) => {\n return `${lhs} <`;\n }\n LongLessThanArgsTemplate: &LongLessThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanOrEqualTemplate: &LongLessThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs} <=`;\n }\n LongLessThanOrEqualArgsTemplate: &LongLessThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongFloatApproxTemplate: &LongFloatApproxTemplate !!js/function >\n (lhs) => {\n return `float(${lhs})`;\n }\n LongTopTemplate: &LongTopTemplate !!js/function >\n (lhs) => {\n return `${lhs} >> 32`;\n }\n LongBottomTemplate: &LongBottomTemplate !!js/function >\n (lhs) => {\n return `${lhs} & 0x0000ffff`;\n }\n TimestampToStringTemplate: &TimestampToStringTemplate !!js/function >\n () => {\n return 'str';\n }\n TimestampToStringArgsTemplate: &TimestampToStringArgsTemplate !!js/function >\n (lhs) => {\n return `(${lhs})`;\n }\n TimestampEqualsTemplate: &TimestampEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} ==`;\n }\n TimestampEqualsArgsTemplate: &TimestampEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n TimestampGetLowBitsTemplate: &TimestampGetLowBitsTemplate !!js/function >\n (lhs) => {\n return `${lhs}.time`;\n }\n TimestampGetLowBitsArgsTemplate: &TimestampGetLowBitsArgsTemplate !!js/function >\n () => {\n return '';\n }\n TimestampGetHighBitsTemplate: &TimestampGetHighBitsTemplate !!js/function >\n (lhs) => {\n return `${lhs}.inc`;\n }\n TimestampGetHighBitsArgsTemplate: &TimestampGetHighBitsArgsTemplate !!js/function >\n () => {\n return '';\n }\n TimestampTTemplate: &TimestampTTemplate !!js/function >\n (lhs) => {\n return `${lhs}.time`;\n }\n TimestampITemplate: &TimestampITemplate !!js/function >\n (lhs) => {\n return `${lhs}.inc`;\n }\n TimestampAsDateTemplate: &TimestampAsDateTemplate null\n TimestampAsDateArgsTemplate: &TimestampAsDateArgsTemplate !!js/function >\n () => {\n return '.as_datetime()';\n }\n TimestampCompareTemplate: &TimestampCompareTemplate !!js/function >\n (lhs) => {\n return `(${lhs}.as_datetime() - `;\n }\n TimestampCompareArgsTemplate: &TimestampCompareArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}.as_datetime()).total_seconds()`;\n }\n TimestampNotEqualsTemplate: &TimestampNotEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} !=`;\n }\n TimestampNotEqualsArgsTemplate: &TimestampNotEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n TimestampGreaterThanTemplate: &TimestampGreaterThanTemplate !!js/function >\n (lhs) => {\n return `${lhs} >`;\n }\n TimestampGreaterThanArgsTemplate: &TimestampGreaterThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n TimestampGreaterThanOrEqualTemplate: &TimestampGreaterThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs} >=`;\n }\n TimestampGreaterThanOrEqualArgsTemplate: &TimestampGreaterThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n TimestampLessThanTemplate: &TimestampLessThanTemplate !!js/function >\n (lhs) => {\n return `${lhs} <`;\n }\n TimestampLessThanArgsTemplate: &TimestampLessThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n TimestampLessThanOrEqualTemplate: &TimestampLessThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs} <=`;\n }\n TimestampLessThanOrEqualArgsTemplate: &TimestampLessThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n SymbolValueOfTemplate: &SymbolValueOfTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n SymbolValueOfArgsTemplate: &SymbolValueOfArgsTemplate !!js/function >\n () => {\n return '';\n }\n SymbolInspectTemplate: &SymbolInspectTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n SymbolInspectArgsTemplate: &SymbolInspectArgsTemplate !!js/function >\n () => {\n return '';\n }\n SymbolToStringTemplate: &SymbolToStringTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n SymbolToStringArgsTemplate: &SymbolToStringArgsTemplate !!js/function >\n () => {\n return '';\n }\n # Symbol Templates\n CodeSymbolTemplate: &CodeSymbolTemplate !!js/function > # Also has process method\n () => {\n return 'Code';\n }\n CodeSymbolArgsTemplate: &CodeSymbolArgsTemplate !!js/function > # Also has process method\n (lhs, code, scope) => {\n // Single quote stringify\n const scopestr = scope === undefined ? '' : `, ${scope}`;\n let newStr = code === undefined ? '' : code;\n const str = newStr;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n code = `'${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}'`;\n return `(${code}${scopestr})`;\n }\n ObjectIdSymbolTemplate: &ObjectIdSymbolTemplate null\n ObjectIdSymbolArgsTemplate: &ObjectIdSymbolArgsTemplate !!js/function >\n (lhs, str) => {\n if (!str || str.length === 0) {\n return '()';\n }\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `('${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}')`;\n }\n BinarySymbolTemplate: &BinarySymbolTemplate null\n BinarySymbolArgsTemplate: &BinarySymbolArgsTemplate !!js/function >\n (lhs, bytes, type) => {\n const str = bytes;\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n bytes = `'${newStr.replace(/\\\\([\\s\\S])|(')/g, '\\\\$1$2')}'`;\n\n if (type === null) {\n return `(b${bytes})`;\n }\n return `(b${bytes}, ${type})`;\n }\n BinarySymbolSubtypeDefaultTemplate: &BinarySymbolSubtypeDefaultTemplate !!js/function >\n () => {\n return 'binary.BINARY_SUBTYPE';\n }\n BinarySymbolSubtypeFunctionTemplate: &BinarySymbolSubtypeFunctionTemplate !!js/function >\n () => {\n return 'binary.FUNCTION_SUBTYPE';\n }\n BinarySymbolSubtypeByteArrayTemplate: &BinarySymbolSubtypeByteArrayTemplate !!js/function >\n () => {\n return 'binary.BINARY_SUBTYPE';\n }\n BinarySymbolSubtypeUuidOldTemplate: &BinarySymbolSubtypeUuidOldTemplate !!js/function >\n () => {\n return 'binary.OLD_UUID_SUBTYPE';\n }\n BinarySymbolSubtypeUuidTemplate: &BinarySymbolSubtypeUuidTemplate !!js/function >\n () => {\n return 'binary.UUID_SUBTYPE';\n }\n BinarySymbolSubtypeMd5Template: &BinarySymbolSubtypeMd5Template !!js/function >\n () => {\n return 'binary.MD5_SUBTYPE';\n }\n BinarySymbolSubtypeUserDefinedTemplate: &BinarySymbolSubtypeUserDefinedTemplate !!js/function >\n () => {\n return 'binary.USER_DEFINED_SUBTYPE';\n }\n DBRefSymbolTemplate: &DBRefSymbolTemplate null\n DBRefSymbolArgsTemplate: &DBRefSymbolArgsTemplate null\n DoubleSymbolTemplate: &DoubleSymbolTemplate !!js/function >\n () => {\n return 'float';\n }\n DoubleSymbolArgsTemplate: &DoubleSymbolArgsTemplate null\n Int32SymbolTemplate: &Int32SymbolTemplate !!js/function >\n () => {\n return 'int';\n }\n Int32SymbolArgsTemplate: &Int32SymbolArgsTemplate !!js/function >\n (lhs, arg) => {\n arg = arg === undefined ? 0 : arg;\n const str = arg.toString();\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n return `('${newStr}')`;\n } else {\n return `(${newStr})`;\n }\n }\n LongSymbolTemplate: &LongSymbolTemplate !!js/function >\n () => {\n return 'Int64';\n }\n LongSymbolArgsTemplate: &LongSymbolArgsTemplate null\n LongSymbolMaxTemplate: &LongSymbolMaxTemplate !!js/function >\n () => {\n return 'sys.maxsize';\n }\n LongSymbolMaxArgsTemplate: &LongSymbolMaxArgsTemplate null\n LongSymbolMinTemplate: &LongSymbolMinTemplate !!js/function >\n () => {\n return '-sys.maxsize -1';\n }\n LongSymbolMinArgsTemplate: &LongSymbolMinArgsTemplate null\n LongSymbolZeroTemplate: &LongSymbolZeroTemplate !!js/function >\n () => {\n return 'Int64(0)';\n }\n LongSymbolZeroArgsTemplate: &LongSymbolZeroArgsTemplate null\n LongSymbolOneTemplate: &LongSymbolOneTemplate !!js/function >\n () => {\n return 'Int64(1)';\n }\n LongSymbolOneArgsTemplate: &LongSymbolOneArgsTemplate null\n LongSymbolNegOneTemplate: &LongSymbolNegOneTemplate !!js/function >\n () => {\n return 'Int64(-1)';\n }\n LongSymbolNegOneArgsTemplate: &LongSymbolNegOneArgsTemplate null\n LongSymbolFromBitsTemplate: &LongSymbolFromBitsTemplate !!js/function > # Also has process method\n () => {\n return 'Int64';\n }\n LongSymbolFromBitsArgsTemplate: &LongSymbolFromBitsArgsTemplate null\n LongSymbolFromIntTemplate: &LongSymbolFromIntTemplate !!js/function >\n () => {\n return 'Int64';\n }\n LongSymbolFromIntArgsTemplate: &LongSymbolFromIntArgsTemplate null\n LongSymbolFromNumberTemplate: &LongSymbolFromNumberTemplate !!js/function >\n () => {\n return 'Int64';\n }\n LongSymbolFromNumberArgsTemplate: &LongSymbolFromNumberArgsTemplate null\n LongSymbolFromStringTemplate: &LongSymbolFromStringTemplate !!js/function >\n (lhs, arg) => {\n return 'Int64';\n }\n LongSymbolFromStringArgsTemplate: &LongSymbolFromStringArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(int(${arg}))`;\n }\n MinKeySymbolTemplate: &MinKeySymbolTemplate null\n MinKeySymbolArgsTemplate: &MinKeySymbolArgsTemplate null\n MaxKeySymbolTemplate: &MaxKeySymbolTemplate null\n MaxKeySymbolArgsTemplate: &MaxKeySymbolArgsTemplate null\n TimestampSymbolTemplate: &TimestampSymbolTemplate !!js/function >\n () => {\n return 'Timestamp';\n }\n TimestampSymbolArgsTemplate: &TimestampSymbolArgsTemplate !!js/function >\n (lhs, arg1, arg2) => {\n return `(${arg1 === undefined ? 0 : arg1}, ${arg2 === undefined ? 0 : arg2})`;\n }\n SymbolSymbolTemplate: &SymbolSymbolTemplate !!js/function >\n () => {\n return '';\n }\n SymbolSymbolArgsTemplate: &SymbolSymbolArgsTemplate !!js/function >\n (lhs, arg) => {\n return arg;\n }\n BSONRegExpSymbolTemplate: &BSONRegExpSymbolTemplate !!js/function >\n () => {\n return 'Regex';\n }\n BSONRegExpSymbolArgsTemplate: &BSONRegExpSymbolArgsTemplate !!js/function >\n (lhs, pattern, flags) => {\n const singleStringify = (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `'${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}'`;\n }\n return `(${singleStringify(pattern)}${flags ? ', ' + singleStringify(flags) : ''})`;\n }\n Decimal128SymbolTemplate: &Decimal128SymbolTemplate !!js/function >\n () => {\n return 'Decimal128';\n }\n Decimal128SymbolArgsTemplate: &Decimal128SymbolArgsTemplate !!js/function >\n (lhs, str) => {\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `('${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}')`;\n }\n Decimal128SymbolFromStringTemplate: &Decimal128SymbolFromStringTemplate !!js/function >\n () => {\n return 'Decimal128';\n }\n Decimal128SymbolFromStringArgsTemplate: &Decimal128SymbolFromStringArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(${arg})`;\n }\n Decimal128ToStringTemplate: &Decimal128ToStringTemplate !!js/function >\n () => {\n return 'str';\n }\n Decimal128ToStringArgsTemplate: &Decimal128ToStringArgsTemplate !!js/function >\n (lhs) => {\n return `(${lhs})`;\n }\n # BSON Util Templates\n ObjectIdCreateFromHexStringTemplate: &ObjectIdCreateFromHexStringTemplate !!js/function >\n () => {\n return 'ObjectId';\n }\n ObjectIdCreateFromHexStringArgsTemplate: &ObjectIdCreateFromHexStringArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(${arg})`;\n }\n ObjectIdCreateFromTimeTemplate: &ObjectIdCreateFromTimeTemplate !!js/function >\n () => {\n return `ObjectId.from_datetime`;\n }\n ObjectIdCreateFromTimeArgsTemplate: &ObjectIdCreateFromTimeArgsTemplate !!js/function >\n (lhs, arg, isNumber) => {\n if (isNumber) {\n return `(datetime.fromtimestamp(${arg}))`;\n }\n return `(${arg})`;\n }\n ObjectIdIsValidTemplate: &ObjectIdIsValidTemplate !!js/function >\n (lhs) => {\n return `${lhs}.is_valid`;\n }\n ObjectIdIsValidArgsTemplate: &ObjectIdIsValidArgsTemplate null\n # JS Symbol Templates\n NumberSymbolTemplate: &NumberSymbolTemplate !!js/function >\n () => {\n return '';\n }\n NumberSymbolArgsTemplate: &NumberSymbolArgsTemplate !!js/function >\n (lhs, arg) => {\n arg = arg === undefined ? 0 : arg;\n const str = arg.toString();\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n return `float('${newStr}')`;\n } else {\n return `${newStr}`;\n }\n }\n DateSymbolTemplate: &DateSymbolTemplate !!js/function >\n () => {\n return 'datetime';\n }\n DateSymbolArgsTemplate: &DateSymbolArgsTemplate !!js/function >\n (lhs, date, isString) => {\n const toStr = isString ? '.strftime(\\'%a %b %d %Y %H:%M:%S %Z\\')' : '';\n\n if (date === null) {\n return `${lhs}.utcnow()${toStr}`;\n }\n\n const dateStr = [\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds()\n ].join(', ');\n\n return `${lhs}(${dateStr}, tzinfo=timezone.utc)${toStr}`;\n }\n DateSymbolNowTemplate: &DateSymbolNowTemplate !!js/function >\n () => {\n return 'datetime.utcnow';\n }\n DateSymbolNowArgsTemplate: &DateSymbolNowArgsTemplate null\n RegExpSymbolTemplate: &RegExpSymbolTemplate !!js/function > # Also has process method\n () => {\n return 're';\n }\n RegExpSymbolArgsTemplate: &RegExpSymbolArgsTemplate null\n ImportTemplate: &ImportTemplate !!js/function >\n (args) => {\n const bson = [];\n const other = [];\n Object.keys(args).map(\n (m) => {\n if (m > 99 && m < 200) {\n bson.push(args[m]);\n } else {\n other.push(args[m]);\n }\n }\n );\n if (bson.length) {\n other.push(`from bson import ${bson.join(', ')}`);\n }\n return other.join('\\n');\n }\n DriverImportTemplate: &DriverImportTemplate !!js/function >\n () => {\n return 'from pymongo import MongoClient';\n }\n 0ImportTemplate: &0ImportTemplate null\n 1ImportTemplate: &1ImportTemplate null\n 2ImportTemplate: &2ImportTemplate null\n 3ImportTemplate: &3ImportTemplate null\n 4ImportTemplate: &4ImportTemplate null\n 5ImportTemplate: &5ImportTemplate null\n 6ImportTemplate: &6ImportTemplate null\n 7ImportTemplate: &7ImportTemplate null\n 8ImportTemplate: &8ImportTemplate !!js/function >\n () => {\n return 'import re';\n }\n 9ImportTemplate: &9ImportTemplate null\n 10ImportTemplate: &10ImportTemplate null\n 11ImportTemplate: &11ImportTemplate null\n 12ImportTemplate: &12ImportTemplate null\n 100ImportTemplate: &100ImportTemplate !!js/function >\n () => {\n return 'Code';\n }\n 101ImportTemplate: &101ImportTemplate !!js/function >\n () => {\n return 'ObjectId';\n }\n 102ImportTemplate: &102ImportTemplate !!js/function >\n () => {\n return 'Binary';\n }\n 103ImportTemplate: &103ImportTemplate !!js/function >\n () => {\n return 'DBRef';\n }\n 104ImportTemplate: &104ImportTemplate null\n 105ImportTemplate: &105ImportTemplate null\n 106ImportTemplate: &106ImportTemplate !!js/function >\n () => {\n return 'Int64';\n }\n 107ImportTemplate: &107ImportTemplate !!js/function >\n () => {\n return 'MinKey';\n }\n 108ImportTemplate: &108ImportTemplate !!js/function >\n () => {\n return 'MaxKey';\n }\n 109ImportTemplate: &109ImportTemplate !!js/function >\n () => {\n return 'Regex';\n }\n 110ImportTemplate: &110ImportTemplate !!js/function >\n () => {\n return 'Timestamp';\n }\n 111ImportTemplate: &111ImportTemplate null\n 112ImportTemplate: &112ImportTemplate !!js/function >\n () => {\n return 'Decimal128';\n }\n 113ImportTemplate: &113ImportTemplate null\n 114ImportTemplate: &114ImportTemplate null\n 200ImportTemplate: &200ImportTemplate !!js/function >\n () => {\n return 'from datetime import datetime, tzinfo, timezone';\n }\n 201ImportTemplate: &201ImportTemplate null\n 300ImportTemplate: &300ImportTemplate null\n 301ImportTemplate: &301ImportTemplate null\n 302ImportTemplate: &302ImportTemplate null\n 303ImportTemplate: &303ImportTemplate null\n 304ImportTemplate: &304ImportTemplate null\n 305ImportTemplate: &305ImportTemplate null\n 306ImportTemplate: &306ImportTemplate null\n# Universal types\n# Everything inherits from StringType because we haven't implemented any of them.\nBasicTypes:\n # Universal basic types\n _bool: &BoolType\n <<: *__type\n id: \"_bool\"\n code: 0\n template: *BoolTypeTemplate\n _integer: &IntegerType\n <<: *__type\n id: \"_integer\"\n code: 1\n template: *IntegerTypeTemplate\n _long: &LongBasicType\n <<: *__type\n id: \"_long\"\n code: 2\n template: *LongBasicTypeTemplate\n _decimal: &DecimalType\n <<: *__type\n id: \"_decimal\"\n code: 3\n template: *DecimalTypeTemplate\n _hex: &HexType\n <<: *__type\n id: \"_hex\"\n code: 4\n template: *HexTypeTemplate\n _octal: &OctalType\n <<: *__type\n id: \"_octal\"\n code: 5\n template: *OctalTypeTemplate\n _numeric: &NumericType\n <<: *__type\n id: \"_numeric\"\n code: 6\n template: *NumericTypeTemplate\n _string: &StringType\n <<: *__type\n id: \"_string\"\n code: 7\n template: *StringTypeTemplate\n _regex: &RegexType\n <<: *__type\n id: \"_regex\"\n code: 8\n template: *RegexTypeTemplate\n _array: &ArrayType\n <<: *__type\n id: \"_array\"\n code: 9\n template: *ArrayTypeTemplate\n argsTemplate: *ArrayTypeArgsTemplate\n _object: &ObjectType\n <<: *__type\n id: \"_object\"\n code: 10\n template: *ObjectTypeTemplate\n argsTemplate: *ObjectTypeArgsTemplate\n _null: &NullType\n <<: *__type\n id: \"_null\"\n code: 11\n template: *NullTypeTemplate\n _undefined: &UndefinedType\n <<: *__type\n id: \"_undefined\"\n code: 12\n template: *UndefinedTypeTemplate\n\nSyntax:\n equality:\n template: *EqualitySyntaxTemplate\n in:\n template: *InSyntaxTemplate\n and:\n template: *AndSyntaxTemplate\n or:\n template: *OrSyntaxTemplate\n not:\n template: *NotSyntaxTemplate\n unary:\n template: *UnarySyntaxTemplate\n binary:\n template: *BinarySyntaxTemplate\n parens:\n template: *ParensSyntaxTemplate\n eos:\n template: *EosSyntaxTemplate\n eof:\n template: *EofSyntaxTemplate\n # The new template takes in expr, and an optional skip argument and optional\n # id argument. The skip argument is a boolean that if true then doesn't add\n # new. The code argument is the symbol code being called. The template will check\n # if it is an exception, i.e. a type that is a constructor but may not use new.\n new:\n template: *NewSyntaxTemplate\n # The regex flags that change symbols between languages can be defined here.\n # Flags that aren't defined can be left blank and will be ignored.\n regexFlags: *RegexFlags\n bsonRegexFlags: *BSONRegexFlags\n driver: *DriverTemplate\nImports:\n import:\n template: *ImportTemplate\n driver:\n template: *DriverImportTemplate\n 0:\n template: *0ImportTemplate\n 1:\n template: *1ImportTemplate\n 2:\n template: *2ImportTemplate\n 3:\n template: *3ImportTemplate\n 4:\n template: *4ImportTemplate\n 5:\n template: *5ImportTemplate\n 6:\n template: *6ImportTemplate\n 7:\n template: *7ImportTemplate\n 8:\n template: *8ImportTemplate\n 9:\n template: *9ImportTemplate\n 10:\n template: *10ImportTemplate\n 11:\n template: *11ImportTemplate\n 12:\n template: *12ImportTemplate\n 100:\n template: *100ImportTemplate\n 101:\n template: *101ImportTemplate\n 102:\n template: *102ImportTemplate\n 103:\n template: *103ImportTemplate\n 104:\n template: *104ImportTemplate\n 105:\n template: *105ImportTemplate\n 106:\n template: *106ImportTemplate\n 107:\n template: *107ImportTemplate\n 108:\n template: *108ImportTemplate\n 109:\n template: *109ImportTemplate\n 110:\n template: *110ImportTemplate\n 111:\n template: *111ImportTemplate\n 112:\n template: *112ImportTemplate\n 113:\n template: *113ImportTemplate\n 114:\n template: *114ImportTemplate\n 200:\n template: *200ImportTemplate\n 201:\n template: *201ImportTemplate\n 300:\n template: *300ImportTemplate\n 301:\n template: *301ImportTemplate\n 302:\n template: *302ImportTemplate\n 303:\n template: *303ImportTemplate\n 304:\n template: *304ImportTemplate\n 305:\n template: *305ImportTemplate\n 306:\n template: *306ImportTemplate\nBsonTypes:\n Code: &CodeType\n <<: *__type\n id: \"Code\"\n code: 100\n type: *ObjectType\n attr:\n code:\n callable: *var\n args: null\n attr: null\n id: \"code\"\n type: *StringType\n template: *CodeCodeTemplate\n argsTemplate: *CodeCodeArgsTemplate\n scope:\n callable: *var\n args: null\n attr: null\n id: \"scope\"\n type: *StringType\n template: *CodeScopeTemplate\n argsTemplate: *CodeScopeArgsTemplate\n ObjectId: &ObjectIdType\n <<: *__type\n id: \"ObjectId\"\n code: 101\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *ObjectIdToStringTemplate\n argsTemplate: *ObjectIdToStringArgsTemplate\n equals:\n <<: *__func\n id: \"equals\"\n args:\n - [ \"ObjectId\" ]\n type: *BoolType\n template: *ObjectIdEqualsTemplate\n argsTemplate: *ObjectIdEqualsArgsTemplate\n getTimestamp:\n <<: *__func\n id: \"getTimestamp\"\n type: *IntegerType\n template: *ObjectIdGetTimestampTemplate\n argsTemplate: *ObjectIdGetTimestampArgsTemplate\n BinData: &BinaryType\n <<: *__type\n id: \"BinData\"\n code: 102\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *BinaryToStringTemplate\n argsTemplate: *BinaryToStringArgsTemplate\n base64:\n <<: *__func\n id: \"base64\"\n type: *StringType\n template: *BinaryValueTemplate\n argsTemplate: *BinaryValueArgsTemplate\n length:\n <<: *__func\n id: \"length\"\n type: *IntegerType\n template: *BinaryLengthTemplate\n argsTemplate: *BinaryLengthArgsTemplate\n subtype:\n <<: *__func\n id: \"subtype\"\n type: *IntegerType\n template: *BinarySubtypeTemplate\n argsTemplate: *BinarySubtypeArgsTemplate\n DBRef: &DBRefType\n <<: *__type\n id: \"DBRef\"\n code: 103\n type: *ObjectType\n attr:\n getDb:\n <<: *__func\n id: \"getDb\"\n type: *StringType\n template: *DBRefGetDBTemplate\n argsTemplate: *DBRefGetDBArgsTemplate\n $db:\n callable: *var\n args: null\n attr: null\n id: \"$db\"\n type: *StringType\n template: *DBRefGetDBTemplate\n argsTemplate: *DBRefGetDBArgsTemplate\n getCollection:\n <<: *__func\n id: \"getCollection\"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n getRef:\n <<: *__func\n id: \"getRef\"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n $ref:\n callable: *var\n args: null\n attr: null\n id: \"$ref\"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n getId:\n <<: *__func\n id: \"getId\"\n type: *StringType\n template: *DBRefGetIdTemplate\n argsTemplate: *DBRefGetIdArgsTemplate\n $id:\n callable: *var\n args: null\n attr: null\n id: \"$id\"\n type: *StringType\n template: *DBRefGetIdTemplate\n argsTemplate: *DBRefGetIdArgsTemplate\n NumberInt: &Int32Type\n <<: *__type\n id: \"NumberInt\"\n code: 105\n type: *ObjectType\n attr: {}\n NumberLong: &LongType\n <<: *__type\n id: \"NumberLong\"\n code: 106\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"LongtoString\" # Needs process method\n args:\n - [ *IntegerType, null ]\n type: *StringType\n template: *LongToStringTemplate\n argsTemplate: *LongToStringArgsTemplate\n equals:\n <<: *__func\n id: \"equals\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongEqualsTemplate\n argsTemplate: *LongEqualsArgsTemplate\n toInt:\n <<: *__func\n id: \"toInt\"\n type: *IntegerType\n template: *LongToIntTemplate\n argsTemplate: *LongToIntArgsTemplate\n toNumber:\n <<: *__func\n id: \"toNumber\"\n type: *DecimalType\n template: *LongToNumberTemplate\n argsTemplate: *LongToNumberArgsTemplate\n compare:\n <<: *__func\n id: \"compare\"\n args:\n - [ \"Long\" ]\n type: *StringType\n template: *LongCompareTemplate\n argsTemplate: *LongCompareArgsTemplate\n isOdd:\n <<: *__func\n id: \"isOdd\"\n type: *BoolType\n template: *LongIsOddTemplate\n argsTemplate: *LongIsOddArgsTemplate\n isZero:\n <<: *__func\n id: \"isZero\"\n type: *BoolType\n template: *LongIsZeroTemplate\n argsTemplate: *LongIsZeroArgsTemplate\n isNegative:\n <<: *__func\n id: \"isNegative\"\n type: *BoolType\n template: *LongIsNegativeTemplate\n argsTemplate: *LongIsNegativeArgsTemplate\n negate:\n <<: *__func\n id: \"negate\"\n type: \"Long\"\n template: *LongNegateTemplate\n argsTemplate: *LongNegateArgsTemplate\n not:\n <<: *__func\n id: \"not\"\n type: \"Long\"\n template: *LongNotTemplate\n argsTemplate: *LongNotArgsTemplate\n notEquals:\n <<: *__func\n id: \"notEquals\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongNotEqualsTemplate\n argsTemplate: *LongNotEqualsArgsTemplate\n greaterThan:\n <<: *__func\n id: \"greaterThan\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongGreaterThanTemplate\n argsTemplate: *LongGreaterThanArgsTemplate\n greaterThanOrEqual:\n <<: *__func\n id: \"greaterThanOrEqual\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongGreaterThanOrEqualTemplate\n argsTemplate: *LongGreaterThanOrEqualArgsTemplate\n lessThan:\n <<: *__func\n id: \"lessThan\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongLessThanTemplate\n argsTemplate: *LongLessThanArgsTemplate\n lessThanOrEqual:\n <<: *__func\n id: \"lessThanOrEqual\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongLessThanOrEqualTemplate\n argsTemplate: *LongLessThanOrEqualArgsTemplate\n add:\n <<: *__func\n id: \"add\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongAddTemplate\n argsTemplate: *LongAddArgsTemplate\n subtract:\n <<: *__func\n id: \"subtract\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongSubtractTemplate\n argsTemplate: *LongSubtractArgsTemplate\n multiply:\n <<: *__func\n id: \"multiply\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongMultiplyTemplate\n argsTemplate: *LongMultiplyArgsTemplate\n div:\n <<: *__func\n id: \"div\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongDivTemplate\n argsTemplate: *LongDivArgsTemplate\n modulo:\n <<: *__func\n id: \"modulo\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongModuloTemplate\n argsTemplate: *LongModuloArgsTemplate\n and:\n <<: *__func\n id: \"and\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongAndTemplate\n argsTemplate: *LongAndArgsTemplate\n or:\n <<: *__func\n id: \"or\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongOrTemplate\n argsTemplate: *LongOrArgsTemplate\n xor:\n <<: *__func\n id: \"xor\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongXorTemplate\n argsTemplate: *LongXorArgsTemplate\n shiftLeft:\n <<: *__func\n id: \"shiftLeft\"\n args:\n - [ *IntegerType ]\n type: \"Long\"\n template: *LongShiftLeftTemplate\n argsTemplate: *LongShiftLeftArgsTemplate\n shiftRight:\n <<: *__func\n id: \"shiftRight\"\n args:\n - [ *IntegerType ]\n type: \"Long\"\n template: *LongShiftRightTemplate\n argsTemplate: *LongShiftRightArgsTemplate\n MinKeyType: &MinKeyType\n <<: *__type\n id: \"MinKey\"\n code: 107\n type: *ObjectType\n MaxKeyType: &MaxKeyType\n <<: *__type\n id: \"MaxKey\"\n code: 108\n type: *ObjectType\n Timestamp: &TimestampType\n <<: *__type\n id: \"Timestamp\"\n code: 110\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *TimestampToStringTemplate\n argsTemplate: *TimestampToStringArgsTemplate\n equals:\n <<: *__func\n id: \"equals\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampEqualsTemplate\n argsTemplate: *TimestampEqualsArgsTemplate\n getLowBits:\n <<: *__func\n id: \"getLowBits\"\n type: *IntegerType\n template: *TimestampGetLowBitsTemplate\n argsTemplate: *TimestampGetLowBitsArgsTemplate\n getHighBits:\n <<: *__func\n id: \"getHighBits\"\n type: *IntegerType\n template: *TimestampGetHighBitsTemplate\n argsTemplate: *TimestampGetHighBitsArgsTemplate\n compare:\n <<: *__func\n id: \"compare\"\n args:\n - [ \"Timestamp\" ]\n type: *StringType\n template: *TimestampCompareTemplate\n argsTemplate: *TimestampCompareArgsTemplate\n notEquals:\n <<: *__func\n id: \"notEquals\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampNotEqualsTemplate\n argsTemplate: *TimestampNotEqualsArgsTemplate\n greaterThan:\n <<: *__func\n id: \"greaterThan\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampGreaterThanTemplate\n argsTemplate: *TimestampGreaterThanArgsTemplate\n greaterThanOrEqual:\n <<: *__func\n id: \"greaterThanOrEqual\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampGreaterThanOrEqualTemplate\n argsTemplate: *TimestampGreaterThanOrEqualArgsTemplate\n lessThan:\n <<: *__func\n id: \"lessThan\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampLessThanTemplate\n argsTemplate: *TimestampLessThanArgsTemplate\n lessThanOrEqual:\n <<: *__func\n id: \"lessThanOrEqual\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampLessThanOrEqualTemplate\n argsTemplate: *TimestampLessThanOrEqualArgsTemplate\n BSONSymbol: &SymbolType\n <<: *__type\n id: \"BSONSymbol\"\n code: 111\n type: *ObjectType\n attr:\n valueOf:\n <<: *__func\n id: \"valueOf\"\n type: *StringType\n template: *SymbolValueOfTemplate\n argsTemplate: *SymbolValueOfArgsTemplate\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *SymbolToStringTemplate\n argsTemplate: *SymbolToStringArgsTemplate\n inspect:\n <<: *__func\n id: \"inspect\"\n type: *StringType\n template: *SymbolInspectTemplate\n argsTemplate: *SymbolInspectArgsTemplate\n Double: &DoubleType\n <<: *__type\n id: \"Double\"\n code: 104\n type: *ObjectType\n attr: {}\n Decimal128: &Decimal128Type\n <<: *__type\n id: \"Decimal128\"\n code: 112\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *Decimal128ToStringTemplate\n argsTemplate: *Decimal128ToStringArgsTemplate\n NumberDecimal: &NumberDecimalType\n <<: *__type\n id: \"NumberDecimal\"\n code: 112\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *Decimal128ToStringTemplate\n argsTemplate: *Decimal128ToStringArgsTemplate\n\n\n SUBTYPE_DEFAULT:\n id: \"SUBTYPE_DEFAULT\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeDefaultTemplate\n SUBTYPE_FUNCTION:\n id: \"SUBTYPE_FUNCTION\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeFunctionTemplate\n SUBTYPE_BYTE_ARRAY:\n id: \"SUBTYPE_BYTE_ARRAY\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeByteArrayTemplate\n SUBTYPE_UUID_OLD:\n id: \"SUBTYPE_UUID_OLD\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUuidOldTemplate\n SUBTYPE_UUID:\n id: \"SUBTYPE_UUID\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUuidTemplate\n SUBTYPE_MD5:\n id: \"SUBTYPE_MD5\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeMd5Template\n SUBTYPE_USER_DEFINED:\n id: \"SUBTYPE_USER_DEFINED\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUserDefinedTemplate\n BSONRegExpType: &BSONRegExpType\n <<: *__type\n id: \"BSONRegExp\"\n code: 109\n type: *ObjectType\nNativeTypes:\n Date: &DateType\n <<: *__type\n id: \"Date\"\n code: 200\n type: *ObjectType\n attr: {} # TODO: no built-in date methods added yet\n RegExp: &RegExpType\n <<: *__type\n id: \"RegExp\"\n code: 8\n type: *ObjectType\n attr: {}\n\n\nBsonSymbols:\n Code: &CodeSymbol\n id: \"Code\"\n code: 100\n callable: *constructor\n args:\n - [ *StringType, null ]\n - [ *ObjectType, null ]\n type: *CodeType\n attr: {}\n template: *CodeSymbolTemplate\n argsTemplate: *CodeSymbolArgsTemplate\n ObjectId: &ObjectIdSymbol\n id: \"ObjectId\"\n code: 101\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n type: *ObjectIdType\n attr:\n createFromHexString:\n <<: *__func\n id: \"createFromHexString\"\n args:\n - [ *StringType ]\n type: *ObjectIdType\n template: *ObjectIdCreateFromHexStringTemplate\n argsTemplate: *ObjectIdCreateFromHexStringArgsTemplate\n createFromTime:\n <<: *__func\n id: \"ObjectIdCreateFromTime\"\n args:\n - [ *NumericType, *DateType ]\n type: *ObjectIdType\n template: *ObjectIdCreateFromTimeTemplate\n argsTemplate: *ObjectIdCreateFromTimeArgsTemplate\n isValid:\n <<: *__func\n id: \"isValid\"\n args:\n - [ *StringType ]\n type: *BoolType\n template: *ObjectIdIsValidTemplate\n argsTemplate: *ObjectIdIsValidArgsTemplate\n template: *ObjectIdSymbolTemplate\n argsTemplate: *ObjectIdSymbolArgsTemplate\n BinData: &BinarySymbol\n id: \"BinData\"\n code: 102\n callable: *constructor\n args:\n - [ *IntegerType ]\n - [ *StringType ]\n type: *BinaryType\n attr: {}\n template: *BinarySymbolTemplate\n argsTemplate: *BinarySymbolArgsTemplate\n DBRef:\n id: \"DBRef\"\n code: 103\n callable: *constructor\n args:\n - [ *StringType ]\n - [ *ObjectIdType ]\n - [ *StringType, null ]\n type: *DBRefType\n attr: {}\n template: *DBRefSymbolTemplate\n argsTemplate: *DBRefSymbolArgsTemplate\n NumberInt:\n id: \"Int32\"\n code: 105\n callable: *constructor\n args:\n - [ *NumericType, *StringType, null ]\n type: *Int32Type\n attr: {}\n template: *Int32SymbolTemplate\n argsTemplate: *Int32SymbolArgsTemplate\n NumberLong:\n id: \"NumberLong\"\n code: 106\n callable: *constructor\n args:\n - [ *IntegerType, *StringType, null ]\n type: *LongType\n attr: {}\n template: *LongSymbolTemplate\n argsTemplate: *LongSymbolArgsTemplate\n MinKey:\n id: \"MinKey\"\n code: 107\n callable: *constructor\n args: []\n type: *MinKeyType\n attr: {}\n template: *MinKeySymbolTemplate\n argsTemplate: *MinKeySymbolArgsTemplate\n MaxKey:\n id: \"MaxKey\"\n code: 108\n callable: *constructor\n args: []\n type: *MaxKeyType\n attr: {}\n template: *MaxKeySymbolTemplate\n argsTemplate: *MaxKeySymbolArgsTemplate\n Timestamp:\n id: \"Timestamp\"\n code: 110\n callable: *constructor\n args:\n - [ *IntegerType, null ]\n - [ *IntegerType, null ]\n type: *TimestampType\n attr: {}\n template: *TimestampSymbolTemplate\n argsTemplate: *TimestampSymbolArgsTemplate\n Symbol:\n id: \"Symbol\"\n code: 111\n callable: *constructor\n args:\n - [ *StringType ]\n type: *SymbolType\n attr: {}\n template: *SymbolSymbolTemplate\n argsTemplate: *SymbolSymbolArgsTemplate\n NumberDecimal:\n id: \"NumberDecimal\"\n code: 112\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n type: *Decimal128Type\n attr: {}\n template: *Decimal128SymbolTemplate\n argsTemplate: *Decimal128SymbolArgsTemplate\n BSONRegExp:\n id: \"BSONRegExp\"\n code: 109\n callable: *constructor\n args:\n - [ *StringType ]\n - [ *StringType, null ]\n type: *BSONRegExpType\n attr: {}\n template: *BSONRegExpSymbolTemplate\n argsTemplate: *BSONRegExpSymbolArgsTemplate\n BSONSymbol:\n id: \"BSONSymbol\"\n code: 111\n callable: *constructor\n args:\n - [ *StringType ]\n type: *SymbolType\n attr: {}\n template: *SymbolSymbolTemplate\n argsTemplate: *SymbolSymbolArgsTemplate\n Decimal128:\n id: \"Decimal128\"\n code: 112\n callable: *constructor\n args:\n - [ *ObjectType ]\n type: *Decimal128Type\n attr:\n fromString:\n id: \"fromString\"\n callable: *func\n args:\n - [ *StringType ]\n type: *Decimal128Type\n attr: {}\n template: *Decimal128SymbolFromStringTemplate\n argsTemplate: *Decimal128SymbolFromStringArgsTemplate\n template: *Decimal128SymbolTemplate\n argsTemplate: *Decimal128SymbolArgsTemplate\n Double:\n id: \"Double\"\n code: 104\n callable: *constructor\n args:\n - [ *NumericType, *StringType ]\n type: *DoubleType\n attr: {}\n template: *DoubleSymbolTemplate\n argsTemplate: *DoubleSymbolArgsTemplate\n Int32:\n id: \"Int32\"\n code: 105\n callable: *constructor\n args:\n - [ *NumericType, *StringType ]\n type: *Int32Type\n attr: {}\n template: *Int32SymbolTemplate\n argsTemplate: *Int32SymbolArgsTemplate\n Long:\n id: \"Long\"\n code: 106\n callable: *constructor\n args:\n - [ *IntegerType ]\n - [ *IntegerType ]\n type: *LongType\n attr:\n MAX_VALUE:\n id: \"MAX_VALUE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolMaxTemplate\n argsTemplate: *LongSymbolMaxArgsTemplate\n MIN_VALUE:\n id: \"MIN_VALUE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolMinTemplate\n argsTemplate: *LongSymbolMinArgsTemplate\n ZERO:\n id: \"ZERO\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolZeroTemplate\n argsTemplate: *LongSymbolZeroArgsTemplate\n ONE:\n id: \"ONE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolOneTemplate\n argsTemplate: *LongSymbolOneArgsTemplate\n NEG_ONE:\n id: \"NEG_ONE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolNegOneTemplate\n argsTemplate: *LongSymbolNegOneArgsTemplate\n fromBits:\n id: \"LongfromBits\" # Needs process method\n callable: *func\n args:\n - [ *IntegerType ]\n - [ *IntegerType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromBitsTemplate\n argsTemplate: *LongSymbolFromBitsArgsTemplate\n fromInt:\n id: \"fromInt\"\n callable: *func\n args:\n - [ *IntegerType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromIntTemplate\n argsTemplate: *LongSymbolFromIntArgsTemplate\n fromNumber:\n id: \"fromNumber\"\n callable: *func\n args:\n - [ *NumericType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromNumberTemplate\n argsTemplate: *LongSymbolFromNumberArgsTemplate\n fromString:\n id: \"fromString\"\n callable: *func\n args:\n - [ *StringType ]\n - [ *IntegerType, null ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromStringTemplate\n argsTemplate: *LongSymbolFromStringArgsTemplate\n template: *LongSymbolTemplate\n argsTemplate: *LongSymbolArgsTemplate\n\nNativeSymbols:\n Number:\n id: \"Number\"\n code: 2\n callable: *constructor\n args:\n - [ *IntegerType, *StringType, null ]\n type: *NumericType\n attr: {} # TODO: no built-in number funcs added yet\n template: *NumberSymbolTemplate\n argsTemplate: *NumberSymbolArgsTemplate\n Date: # Needs emit method\n id: \"Date\"\n code: 200\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n type: *DateType\n attr: # TODO: add more date funcs?\n now:\n id: \"now\"\n code: 200.1\n callable: *func\n args: []\n type: *DateType\n attr: {}\n template: *DateSymbolNowTemplate\n argsTemplate: *DateSymbolNowArgsTemplate\n template: *DateSymbolTemplate\n argsTemplate: *DateSymbolArgsTemplate\n ISODate: # Needs emit method\n id: \"ISODate\"\n code: 200\n callable: *constructor\n args:\n - [ *StringType, null ]\n type: *DateType\n attr:\n now:\n id: \"now\"\n callable: *constructor\n args: []\n type: *DateType\n attr: {}\n template: *DateSymbolNowTemplate\n argsTemplate: *DateSymbolNowArgsTemplate\n template: *DateSymbolTemplate\n argsTemplate: *DateSymbolArgsTemplate\n RegExp: # Needs process method\n id: \"RegExp\"\n code: 8\n callable: *constructor\n args:\n - [ *StringType, *RegexType ]\n - [ *StringType, null ]\n type: *RegExpType\n attr: {} # TODO: no built-in regex funcs added yet\n template: *RegExpSymbolTemplate\n argsTemplate: *RegExpSymbolArgsTemplate\n\n"},741:e=>{e.exports="SymbolTypes:\n VAR: &var 0\n CONSTRUCTOR: &constructor 1\n FUNC: &func 2\n# Internal patterns to save typing\n__type: &__type\n id: null\n callable: *var\n args: null\n type: null\n attr: {}\n template: null\n argsTemplate: null\n__func: &__func\n callable: *func\n args: []\n attr: {}\n template: null\n argsTemplate: null\n\n#############################################\n# Sample Templates #\n# #\n# The expected arguments are commented next #\n# to the template itself. Currently all are #\n# set to null, but to define a function #\n# replace 'null' with '!!js/function > \\n #\n# and a function defined below. #\n# #\n# See the other template files for examples #\n# #\n# Good to know: #\n# lhs is left-hand-side of the expression #\n# rhs is right-hand-side of the expression #\n# All args are strings unless noted #\n# - arg? is boolean #\n# - arg# is number #\n# #\n#############################################\nTemplates:\n ########\n # Misc #\n ########\n\n # Filter out regex flags that have translations or are unsupported.\n RegexFlags: &RegexFlags\n i: 'i'\n m: 'm'\n u: ''\n y: ''\n g: ''\n BSONRegexFlags: &BSONRegexFlags\n i: 'i'\n m: 'm'\n x: 'x'\n s: ''\n l: ''\n u: ''\n\n #############################################\n # Syntax #\n # #\n # Templates for language syntax expressions #\n # #\n #############################################\n\n DriverTemplate: &DriverTemplate !!js/function >\n (spec) => {\n comment = '# Requires the MongoDB Ruby Driver\\n# https://docs.mongodb.com/ruby-driver/master/';\n\n const getKey = k => {\n let translateKey = {\n project: 'projection',\n maxTimeMS: 'max_time_ms'\n }\n return k in translateKey ? translateKey[k] : k\n };\n const options = spec.options;\n const filter = spec.filter || {}\n const exportMode = spec.exportMode;\n\n delete spec.options;\n delete spec.filter\n delete spec.exportMode;\n\n const connect = `client = Mongo::Client.new('${options.uri}', :database => '${options.database}')`;\n const coll = `client.database['${options.collection}']`;\n\n let driverMethod;\n switch (exportMode) {\n case 'Delete Query':\n driverMethod = 'delete_many';\n break;\n case 'Update Query':\n driverMethod = 'update_many';\n break;\n default:\n driverMethod = 'find';\n }\n\n if ('aggregation' in spec) {\n return `${comment}\\n\\n${connect}\\nresult = ${coll}.aggregate(${spec.aggregation})`;\n }\n\n const vars = Object.keys(spec).reduce(\n (result, k) => {\n return `${result}\\n${getKey(k)} = ${spec[k]}`;\n },\n connect\n );\n\n const args = Object.keys(spec).reduce(\n (result, k) => {\n const divider = result === '' ? '' : ',\\n';\n return `${result}${divider} ${getKey(k)}: ${getKey(k)}`;\n },\n ''\n );\n\n const cmd = `result = ${coll}.${driverMethod}(${filter}${args ? `, {\\n${args}\\n}` : ''})`;\n\n return `${comment}\\n\\n${vars}\\n\\n${cmd}`;\n }\n EqualitySyntaxTemplate: &EqualitySyntaxTemplate !!js/function >\n (lhs, op, rhs) => {\n if (op.includes('is')) {\n let not = op.includes('not') ? '!' : ''\n return `${not}${lhs}.equal?(${rhs})`\n } else if (op.includes('!') || op.includes('not')) {\n return `${lhs} != ${rhs}`;\n } else if (op === '==' || op === '===') {\n return `${lhs} == ${rhs}`;\n }\n return `${lhs} ${op} ${rhs}`;\n }\n InSyntaxTemplate: &InSyntaxTemplate !!js/function >\n (lhs, op, rhs) => {\n let str = '';\n if (op.includes('!') || op.includes('not')) {\n str = '!';\n }\n return `${str}${rhs}.include?(${lhs})`\n }\n AndSyntaxTemplate: &AndSyntaxTemplate !!js/function >\n (args) => {\n return args.join(' && ');\n }\n OrSyntaxTemplate: &OrSyntaxTemplate !!js/function >\n (args) => {\n return args.join(' || ');\n }\n NotSyntaxTemplate: &NotSyntaxTemplate !!js/function >\n (arg) => {\n return `!${arg}`;\n }\n UnarySyntaxTemplate: &UnarySyntaxTemplate null\n BinarySyntaxTemplate: &BinarySyntaxTemplate !!js/function >\n (args) => {\n return args.reduce((s, op, i, arr) => {\n if (i % 2 === 0) {\n return s;\n }\n const rhs = arr[i + 1];\n switch(op) {\n case '//':\n return `${s}.div(${rhs})`;\n case '**':\n return `${s} ** ${rhs}`;\n default:\n return `${s} ${op} ${rhs}`;\n }\n }, args[0]);\n }\n ParensSyntaxTemplate: &ParensSyntaxTemplate null\n EosTemplate: &EosSyntaxTemplate null # No args. End-of-line\n EofTemplate: &EofSyntaxTemplate null # No args. End-of-file\n FloorDivTemplate: &FloorDivSyntaxTemplate null # Args: lhs, rhs\n PowerTemplate: &PowerSyntaxTemplate null # Args: lhs, rhs\n NewTemplate: &NewSyntaxTemplate null # Args: expression, skip?, code# [to check if meant to be skipped]\n\n #############################################\n # Literal Types #\n # #\n # Templates for literal type instance. Most #\n # get passed the literal itself as an arg. #\n # #\n #############################################\n StringTypeTemplate: &StringTypeTemplate !!js/function >\n (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `'${newStr.replace(/\\\\([\\s\\S])|(')/g, '\\\\$1$2')}'`;\n }\n RegexTypeTemplate: &RegexTypeTemplate !!js/function >\n (pattern, flags) => {\n const str = pattern;\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n pattern = `${newStr.replace(/\\\\([\\s\\S])/g, '\\\\$1')}`;\n return `/${pattern}/${flags ? flags : ''}`;\n }\n BoolTypeTemplate: &BoolTypeTemplate !!js/function >\n (literal) => {\n return literal.toLowerCase();\n }\n IntegerTypeTemplate: &IntegerTypeTemplate null # args: literal, argType (i.e. '_string', '_decimal' etc)\n DecimalTypeTemplate: &DecimalTypeTemplate null # args: literal, argType\n LongBasicTypeTemplate: &LongBasicTypeTemplate null # args: literal, argType\n HexTypeTemplate: &HexTypeTemplate null # args: literal, argType\n OctalTypeTemplate: &OctalTypeTemplate !!js/function >\n (literal) => {\n let offset = 0;\n\n if (\n literal.charAt(0) === '0' &&\n (literal.charAt(1) === '0' || literal.charAt(1) === 'o' || literal.charAt(1) === 'O')\n ) {\n offset = 2;\n } else if (literal.charAt(0) === '0') {\n offset = 1;\n }\n\n literal = `0o${literal.substr(offset, literal.length - 1)}`;\n\n return literal;\n }\n NumericTypeTemplate: &NumericTypeTemplate null # args: literal, argType\n ArrayTypeTemplate: &ArrayTypeTemplate !!js/function >\n (literal, depth) => {\n depth++;\n if (literal === '') {\n return '[]'\n }\n const indent = '\\n' + ' '.repeat(depth);\n const closingIndent = '\\n' + ' '.repeat(depth - 1);\n\n return `[${indent}${literal}${closingIndent}]`;\n }\n ArrayTypeArgsTemplate: &ArrayTypeArgsTemplate null # Args: single array element, nestedness, lastElement? (note: not being used atm)\n NullTypeTemplate: &NullTypeTemplate !!js/function >\n () => {\n return 'nil';\n }\n UndefinedTypeTemplate: &UndefinedTypeTemplate !!js/function >\n () => {\n return 'nil';\n }\n ObjectTypeTemplate: &ObjectTypeTemplate !!js/function >\n (literal) => {\n if (literal === '') {\n return '{}';\n }\n return literal;\n }\n ObjectTypeArgsTemplate: &ObjectTypeArgsTemplate !!js/function >\n (args, depth) => {\n if (args.length === 0) {\n return '{}';\n }\n depth++;\n const indent = '\\n' + ' '.repeat(depth);\n const closingIndent = '\\n' + ' '.repeat(depth - 1);\n const singleStringify = (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `'${newStr.replace(/\\\\([\\s\\S])|(')/g, '\\\\$1$2')}'`;\n }\n const pairs = args.map((arg) => {\n return `${indent}${singleStringify(arg[0])} => ${arg[1]}`;\n }).join(',');\n\n return `{${pairs}${closingIndent}}`\n }\n\n #############################################\n # Symbols #\n # #\n # Templates for symbols, can be either #\n # functions or variables. #\n # #\n # The *SymbolTemplates return names and #\n # usually don't take any arguments. The #\n # *SymbolArgsTemplates are invoked for func #\n # calls. The first argument is always the #\n # lhs, i.e. the symbol returned from the #\n # corresponding SymbolTemplate. The rest of #\n # the arguments are the processed arguments #\n # passed to the original function. #\n # #\n #############################################\n CodeSymbolTemplate: &CodeSymbolTemplate !!js/function >\n () => {\n return 'BSON::Code'\n }\n CodeSymbolArgsTemplate: &CodeSymbolArgsTemplate !!js/function >\n (lhs, code, scope) => {\n const singleStringify = (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `'${newStr.replace(/\\\\([\\s\\S])|(')/g, '\\\\$1$2')}'`;\n }\n if (code === undefined) {\n return '.new'\n }\n return !scope ? `.new(${singleStringify(code)})` : `WithScope.new(${singleStringify(code)}, ${scope})`\n }\n ObjectIdSymbolTemplate: &ObjectIdSymbolTemplate !!js/function >\n () => {\n return 'BSON::ObjectId';\n }\n ObjectIdSymbolArgsTemplate: &ObjectIdSymbolArgsTemplate !!js/function >\n (lhs, id) => {\n const singleStringify = (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `'${newStr.replace(/\\\\([\\s\\S])|(')/g, '\\\\$1$2')}'`;\n }\n return !id ? '.new' : `(${singleStringify(id)})`;\n }\n BinarySymbolTemplate: &BinarySymbolTemplate null\n BinarySymbolArgsTemplate: &BinarySymbolArgsTemplate null\n BinarySymbolSubtypeDefaultTemplate: &BinarySymbolSubtypeDefaultTemplate null\n BinarySymbolSubtypeFunctionTemplate: &BinarySymbolSubtypeFunctionTemplate null\n BinarySymbolSubtypeByteArrayTemplate: &BinarySymbolSubtypeByteArrayTemplate null\n BinarySymbolSubtypeUuidOldTemplate: &BinarySymbolSubtypeUuidOldTemplate null\n BinarySymbolSubtypeUuidTemplate: &BinarySymbolSubtypeUuidTemplate null\n BinarySymbolSubtypeMd5Template: &BinarySymbolSubtypeMd5Template null\n BinarySymbolSubtypeUserDefinedTemplate: &BinarySymbolSubtypeUserDefinedTemplate null\n DBRefSymbolTemplate: &DBRefSymbolTemplate !!js/function >\n () => {\n return 'BSON::DBRef'\n }\n DBRefSymbolArgsTemplate: &DBRefSymbolArgsTemplate !!js/function >\n (lhs, coll, id, db) => {\n const singleStringify = (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `'${newStr.replace(/\\\\([\\s\\S])|(')/g, '\\\\$1$2')}'`;\n }\n\n let db_string = db ? `,\\n '$db' => ${singleStringify(db)}` : ''\n return `.new(\\n '$ref' => ${singleStringify(coll)},\\n '$id' => ${id}${db_string}\\n)`\n }\n DoubleSymbolTemplate: &DoubleSymbolTemplate !!js/function >\n () => {\n return '';\n }\n DoubleSymbolArgsTemplate: &DoubleSymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n if (type === '_decimal' || type === '_double') {\n return arg;\n }\n return `${arg}.to_f`;\n }\n Int32SymbolTemplate: &Int32SymbolTemplate !!js/function >\n () => {\n return '';\n }\n Int32SymbolArgsTemplate: &Int32SymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n if (type === '_integer' || type === '_long') {\n return arg;\n }\n return `${arg}.to_i`;\n }\n LongSymbolTemplate: &LongSymbolTemplate !!js/function >\n () => {\n return ''\n }\n LongSymbolArgsTemplate: &LongSymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n if (type === '_integer' || type === '_long') {\n return arg;\n }\n return `${arg}.to_i`;\n }\n RegExpSymbolTemplate: &RegExpSymbolTemplate !!js/function >\n () => {\n return '';\n }\n RegExpSymbolArgsTemplate: &RegExpSymbolArgsTemplate null # Args: lhs, pattern, flags\n SymbolSymbolTemplate: &SymbolSymbolTemplate !!js/function >\n () => {\n return '';\n }\n SymbolSymbolArgsTemplate: &SymbolSymbolArgsTemplate !!js/function >\n (lhs, arg) => {\n arg = arg === undefined ? '' : arg;\n const str = arg.toString();\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n return `:'${newStr}'`;\n } else {\n return `${newStr}.to_sym`;\n }\n }\n BSONRegExpSymbolTemplate: &BSONRegExpSymbolTemplate !!js/function >\n () => {\n return '';\n }\n BSONRegExpSymbolArgsTemplate: &BSONRegExpSymbolArgsTemplate !!js/function >\n (lhs, pattern, flags) => {\n const singleStringify = (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `${newStr.replace(/\\\\([\\s\\S])/g, '\\\\$1')}`;\n }\n return `/${singleStringify(pattern)}/${flags ? singleStringify(flags) : ''}`;\n }\n Decimal128SymbolTemplate: &Decimal128SymbolTemplate !!js/function >\n () => {\n return 'BSON::Decimal128';\n }\n Decimal128SymbolArgsTemplate: &Decimal128SymbolArgsTemplate !!js/function >\n (lhs, arg) => {\n arg = arg === undefined ? '0' : arg.toString();\n if (arg.charAt(0) === '\\'' && arg.charAt(arg.length - 1) === '\\'') {\n return `.new(${arg})`;\n }\n return `.new('${arg}')`;\n }\n MinKeySymbolTemplate: &MinKeySymbolTemplate !!js/function >\n () => {\n return 'BSON::MinKey';\n }\n MinKeySymbolArgsTemplate: &MinKeySymbolArgsTemplate !!js/function >\n () => {\n return '.new';\n }\n MaxKeySymbolTemplate: &MaxKeySymbolTemplate !!js/function >\n () => {\n return 'BSON::MaxKey';\n }\n MaxKeySymbolArgsTemplate: &MaxKeySymbolArgsTemplate !!js/function >\n () => {\n return '.new';\n }\n TimestampSymbolTemplate: &TimestampSymbolTemplate !!js/function >\n () => {\n return 'BSON::Timestamp';\n }\n TimestampSymbolArgsTemplate: &TimestampSymbolArgsTemplate !!js/function >\n (lhs, arg1, arg2) => {\n return `.new(${arg1 === undefined ? 0 : arg1}, ${arg2 === undefined ? 0 : arg2})`;\n }\n # non bson-specific\n NumberSymbolTemplate: &NumberSymbolTemplate !!js/function >\n () => {\n return '';\n }\n NumberSymbolArgsTemplate: &NumberSymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n const str = arg.toString();\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n return `'${newStr}'.to_f`;\n } else if (type === '_decimal' || type === '_double') {\n return newStr;\n } else {\n return `${newStr}.to_f`;\n }\n }\n DateSymbolTemplate: &DateSymbolTemplate !!js/function >\n () => {\n return 'Time';\n }\n DateSymbolArgsTemplate: &DateSymbolArgsTemplate !!js/function >\n (lhs, date, isString) => {\n const toStr = isString ? '.strftime(\\'%a %b %d %Y %H:%M:%S %Z\\')' : '';\n\n if (date === null) {\n return `${lhs}.new.utc${toStr}`;\n }\n\n const dateStr = [\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds()\n ].join(', ');\n\n return `${lhs}.utc(${dateStr})${toStr}`;\n }\n\n DateSymbolNowTemplate: &DateSymbolNowTemplate !!js/function >\n () => {\n return 'Time.now.utc';\n }\n DateSymbolNowArgsTemplate: &DateSymbolNowArgsTemplate !!js/function >\n (args) => {\n return '';\n }\n\n #############################################\n # Object Attributes/Methods #\n # #\n # These're variables or functions called on #\n # instantiated objects. For example, #\n # ObjectId().isValid() or Timestamp().t #\n # #\n # They follow the same pattern with the\n # *Template/*ArgsTemplates: usually no args #\n # to the Template and lhs plus any original #\n # arguments to the ArgsTemplate. #\n # #\n #############################################\n CodeCodeTemplate: &CodeCodeTemplate !!js/function >\n (lhs) => {\n return `${lhs}.javascript`;\n }\n CodeCodeArgsTemplate: &CodeCodeArgsTemplate !!js/function >\n () => {\n return '';\n }\n CodeScopeTemplate: &CodeScopeTemplate !!js/function >\n (lhs) => {\n return `${lhs}.scope`;\n }\n CodeScopeArgsTemplate: &CodeScopeArgsTemplate !!js/function >\n () => {\n return '';\n }\n ObjectIdToStringTemplate: &ObjectIdToStringTemplate !!js/function >\n (lhs) => {\n return `${lhs}.to_s`;\n }\n ObjectIdToStringArgsTemplate: &ObjectIdToStringArgsTemplate !!js/function >\n () => {\n return '';\n }\n ObjectIdEqualsTemplate: &ObjectIdEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} == `;\n }\n ObjectIdEqualsArgsTemplate: &ObjectIdEqualsArgsTemplate !!js/function >\n (arg) => {\n return `${arg}`;\n }\n ObjectIdGetTimestampTemplate: &ObjectIdGetTimestampTemplate !!js/function >\n (lhs) => {\n return `${lhs}.to_time`;\n }\n ObjectIdGetTimestampArgsTemplate: &ObjectIdGetTimestampArgsTemplate !!js/function >\n () => {\n return '';\n }\n ObjectIdIsValidTemplate: &ObjectIdIsValidTemplate !!js/function >\n (lhs) => {\n return `${lhs}.legal?`\n }\n ObjectIdIsValidArgsTemplate: &ObjectIdIsValidArgsTemplate null\n BinaryValueTemplate: &BinaryValueTemplate null\n BinaryValueArgsTemplate: &BinaryValueArgsTemplate null\n BinaryLengthTemplate: &BinaryLengthTemplate null\n BinaryLengthArgsTemplate: &BinaryLengthArgsTemplate null\n BinaryToStringTemplate: &BinaryToStringTemplate null\n BinaryToStringArgsTemplate: &BinaryToStringArgsTemplate null\n BinarySubtypeTemplate: &BinarySubtypeTemplate null\n BinarySubtypeArgsTemplate: &BinarySubtypeArgsTemplate null\n DBRefGetDBTemplate: &DBRefGetDBTemplate !!js/function >\n (lhs) => {\n return `${lhs}.database`;\n }\n DBRefGetCollectionTemplate: &DBRefGetCollectionTemplate !!js/function >\n (lhs) => {\n return `${lhs}.collection`;\n }\n DBRefGetIdTemplate: &DBRefGetIdTemplate !!js/function >\n (lhs) => {\n return `${lhs}.id`;\n }\n DBRefGetDBArgsTemplate: &DBRefGetDBArgsTemplate !!js/function >\n (lhs) => {\n return '';\n }\n DBRefGetCollectionArgsTemplate: &DBRefGetCollectionArgsTemplate !!js/function >\n (lhs) => {\n return '';\n }\n DBRefGetIdArgsTemplate: &DBRefGetIdArgsTemplate !!js/function >\n (lhs) => {\n return '';\n }\n DBRefToStringTemplate: &DBRefToStringTemplate !!js/function >\n (lhs) => {\n return '${lhs}.to_s';\n }\n DBRefToStringArgsTemplate: &DBRefToStringArgsTemplate !!js/function >\n () => {\n return '';\n }\n DoubleValueOfTemplate: &DoubleValueOfTemplate null\n DoubleValueOfArgsTemplate: &DoubleValueOfArgsTemplate null\n Int32ValueOfTemplate: &Int32ValueOfTemplate null\n Int32ValueOfArgsTemplate: &Int32ValueOfArgsTemplate null\n Int32ToStringTemplate: &Int32ToStringTemplate null\n Int32ToStringArgsTemplate: &Int32ToStringArgsTemplate null\n LongEqualsTemplate: &LongEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} ==`;\n }\n LongEqualsArgsTemplate: &LongEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongToIntTemplate: &LongToIntTemplate !!js/function >\n (lhs) => {\n return `${lhs}`;\n }\n LongToIntArgsTemplate: &LongToIntArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongToStringTemplate: &LongToStringTemplate !!js/function >\n (lhs) => {\n return `${lhs}.to_s`;\n }\n LongToStringArgsTemplate: &LongToStringArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongToNumberTemplate: &LongToNumberTemplate !!js/function >\n (lhs) => {\n return `${lhs}.to_f`;\n }\n LongToNumberArgsTemplate: &LongToNumberArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongAddTemplate: &LongAddTemplate !!js/function >\n (lhs) => {\n return `${lhs} +`;\n }\n LongAddArgsTemplate: &LongAddArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongSubtractTemplate: &LongSubtractTemplate !!js/function >\n (arg) => {\n return `${arg} -`;\n }\n LongSubtractArgsTemplate: &LongSubtractArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongMultiplyTemplate: &LongMultiplyTemplate !!js/function >\n (arg) => {\n return `${arg} *`;\n }\n LongMultiplyArgsTemplate: &LongMultiplyArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongDivTemplate: &LongDivTemplate !!js/function >\n (lhs) => {\n return `${lhs} /`;\n }\n LongDivArgsTemplate: &LongDivArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongModuloTemplate: &LongModuloTemplate !!js/function >\n (lhs) => {\n return `${lhs} %`;\n }\n LongModuloArgsTemplate: &LongModuloArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongAndTemplate: &LongAndTemplate !!js/function >\n (lhs) => {\n return `${lhs} &`;\n }\n LongAndArgsTemplate: &LongAndArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongOrTemplate: &LongOrTemplate !!js/function >\n (lhs) => {\n return `${lhs} |`;\n }\n LongOrArgsTemplate: &LongOrArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongXorTemplate: &LongXorTemplate !!js/function >\n (lhs) => {\n return `${lhs} ^`;\n }\n LongXorArgsTemplate: &LongXorArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongShiftLeftTemplate: &LongShiftLeftTemplate !!js/function >\n (lhs) => {\n return `${lhs} <<`;\n }\n LongShiftLeftArgsTemplate: &LongShiftLeftArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongShiftRightTemplate: &LongShiftRightTemplate !!js/function >\n (lhs) => {\n return `${lhs} >>`;\n }\n LongShiftRightArgsTemplate: &LongShiftRightArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongCompareTemplate: &LongCompareTemplate !!js/function >\n (lhs) => {\n return `${lhs} -`;\n }\n LongCompareArgsTemplate: &LongCompareArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongIsOddTemplate: &LongIsOddTemplate !!js/function >\n (lhs) => {\n return `(${lhs} % 2) == 1`;\n }\n LongIsOddArgsTemplate: &LongIsOddArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongIsZeroTemplate: &LongIsZeroTemplate !!js/function >\n (lhs) => {\n return `${lhs} == 0`;\n }\n LongIsZeroArgsTemplate: &LongIsZeroArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongIsNegativeTemplate: &LongIsNegativeTemplate !!js/function >\n (lhs) => {\n return `${lhs} < 0`;\n }\n LongIsNegativeArgsTemplate: &LongIsNegativeArgsTemplate !!js/function >\n () => {\n return '';\n }\n LongNegateTemplate: &LongNegateTemplate !!js/function >\n () => {\n return '-';\n }\n LongNegateArgsTemplate: &LongNegateArgsTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n LongNotTemplate: &LongNotTemplate !!js/function >\n () => {\n return '~';\n }\n LongNotArgsTemplate: &LongNotArgsTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n LongNotEqualsTemplate: &LongNotEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} !=`;\n }\n LongNotEqualsArgsTemplate: &LongNotEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanTemplate: &LongGreaterThanTemplate !!js/function >\n (lhs) => {\n return `${lhs} >`;\n }\n LongGreaterThanArgsTemplate: &LongGreaterThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanOrEqualTemplate: &LongGreaterThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs} >=`;\n }\n LongGreaterThanOrEqualArgsTemplate: &LongGreaterThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanTemplate: &LongLessThanTemplate !!js/function >\n (lhs) => {\n return `${lhs} <`;\n }\n LongLessThanArgsTemplate: &LongLessThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanOrEqualTemplate: &LongLessThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs} <=`;\n }\n LongLessThanOrEqualArgsTemplate: &LongLessThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongFloatApproxTemplate: &LongFloatApproxTemplate !!js/function >\n (lhs) => {\n return `${lhs}.to_f`;\n }\n LongTopTemplate: &LongTopTemplate !!js/function >\n (lhs) => {\n return `${lhs} >> 32`;\n }\n LongBottomTemplate: &LongBottomTemplate !!js/function >\n (lhs) => {\n return `${lhs} & 0x0000ffff`;\n }\n TimestampToStringTemplate: &TimestampToStringTemplate !!js/function >\n (lhs) => {\n return `${lhs}.to_s`;\n }\n TimestampToStringArgsTemplate: &TimestampToStringArgsTemplate !!js/function >\n () => {\n return '';\n }\n TimestampEqualsTemplate: &TimestampEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} == `;\n }\n TimestampEqualsArgsTemplate: &TimestampEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampGetLowBitsTemplate: &TimestampGetLowBitsTemplate !!js/function >\n (lhs) => {\n return `${lhs}.seconds`;\n }\n TimestampGetLowBitsArgsTemplate: &TimestampGetLowBitsArgsTemplate !!js/function >\n () => {\n return ''\n }\n TimestampGetHighBitsTemplate: &TimestampGetHighBitsTemplate !!js/function >\n (lhs) => {\n return `${lhs}.increment`;\n }\n TimestampGetHighBitsArgsTemplate: &TimestampGetHighBitsArgsTemplate !!js/function >\n () => {\n return ''\n }\n TimestampTTemplate: &TimestampTTemplate !!js/function >\n (lhs) => {\n return `${lhs}.seconds`;\n }\n TimestampITemplate: &TimestampITemplate !!js/function >\n (lhs) => {\n return `${lhs}.increment`;\n }\n TimestampAsDateTemplate: &TimestampAsDateTemplate !!js/function >\n (lhs) => {\n return `Time.at(${lhs}.increment).utc`;\n }\n TimestampAsDateArgsTemplate: &TimestampAsDateArgsTemplate null\n TimestampCompareTemplate: &TimestampCompareTemplate !!js/function >\n (lhs) => {\n return `${lhs} <=> `;\n }\n TimestampCompareArgsTemplate: &TimestampCompareArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampNotEqualsTemplate: &TimestampNotEqualsTemplate !!js/function >\n (lhs) => {\n return `${lhs} != `;\n }\n TimestampNotEqualsArgsTemplate: &TimestampNotEqualsArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampGreaterThanTemplate: &TimestampGreaterThanTemplate !!js/function >\n (lhs) => {\n return `${lhs} > `;\n }\n TimestampGreaterThanArgsTemplate: &TimestampGreaterThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampGreaterThanOrEqualTemplate: &TimestampGreaterThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs} >= `;\n }\n TimestampGreaterThanOrEqualArgsTemplate: &TimestampGreaterThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampLessThanTemplate: &TimestampLessThanTemplate !!js/function >\n (lhs) => {\n return `${lhs} < `;\n }\n TimestampLessThanArgsTemplate: &TimestampLessThanArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampLessThanOrEqualTemplate: &TimestampLessThanOrEqualTemplate !!js/function >\n (lhs) => {\n return `${lhs} <= `;\n }\n TimestampLessThanOrEqualArgsTemplate: &TimestampLessThanOrEqualArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}`;\n }\n SymbolValueOfTemplate: &SymbolValueOfTemplate !!js/function >\n (lhs) => {\n return lhs;\n }\n SymbolValueOfArgsTemplate: &SymbolValueOfArgsTemplate !!js/function >\n () => {\n return '';\n }\n SymbolInspectTemplate: &SymbolInspectTemplate !!js/function >\n (lhs) => {\n return `${lhs}.inspect`;\n }\n SymbolInspectArgsTemplate: &SymbolInspectArgsTemplate !!js/function >\n () => {\n return '';\n }\n SymbolToStringTemplate: &SymbolToStringTemplate !!js/function >\n (lhs) => {\n let extractRegex = (lhs) => {\n let r = /^:'(.*)'$/;\n let arr = r.exec(lhs);\n return arr ? arr[1] : ''\n\n }\n let res = extractRegex(lhs)\n return res ? `'${res}'` : `${lhs}.to_s`;\n }\n SymbolToStringArgsTemplate: &SymbolToStringArgsTemplate !!js/function >\n (lhs) => {\n return '';\n }\n Decimal128ToStringTemplate: &Decimal128ToStringTemplate !!js/function >\n (lhs) => {\n return `${lhs}.to_s`;\n }\n Decimal128ToStringArgsTemplate: &Decimal128ToStringArgsTemplate !!js/function >\n (lhs) => {\n return '';\n }\n\n #############################################\n # Symbol Attributes/Methods #\n # #\n # These're variables or functions called on #\n # symbols. Also called bson-utils. #\n # #\n # They are basically the same thing as #\n # object attributes/methods, but need to be #\n # distinguished since they are separate #\n # namespaces that happen to have the same #\n # name which is v confusing. #\n # #\n # For example, ObjectId().toString() is an #\n # object method, while ObjectId.fromString #\n # is a symbol attribute. These are two #\n # separate ObjectId related namespaces that #\n # don't overlap. #\n # #\n #############################################\n LongSymbolMaxTemplate: &LongSymbolMaxTemplate !!js/function >\n () => {\n return '9223372036854775807';\n }\n LongSymbolMaxArgsTemplate: &LongSymbolMaxArgsTemplate null\n LongSymbolMinTemplate: &LongSymbolMinTemplate !!js/function >\n () => {\n return '-9223372036854775808';\n }\n LongSymbolMinArgsTemplate: &LongSymbolMinArgsTemplate null\n LongSymbolZeroTemplate: &LongSymbolZeroTemplate !!js/function >\n () => {\n return '0';\n }\n LongSymbolZeroArgsTemplate: &LongSymbolZeroArgsTemplate null\n LongSymbolOneTemplate: &LongSymbolOneTemplate !!js/function >\n () => {\n return '1';\n }\n LongSymbolOneArgsTemplate: &LongSymbolOneArgsTemplate null\n LongSymbolNegOneTemplate: &LongSymbolNegOneTemplate !!js/function >\n () => {\n return '-1';\n }\n LongSymbolNegOneArgsTemplate: &LongSymbolNegOneArgsTemplate null\n LongSymbolFromBitsTemplate: &LongSymbolFromBitsTemplate !!js/function >\n () => {\n return '';\n }\n LongSymbolFromBitsArgsTemplate: &LongSymbolFromBitsArgsTemplate null\n LongSymbolFromIntTemplate: &LongSymbolFromIntTemplate !!js/function >\n () => {\n return '';\n }\n LongSymbolFromIntArgsTemplate: &LongSymbolFromIntArgsTemplate !!js/function >\n (lhs, arg) => {\n return arg;\n }\n LongSymbolFromNumberTemplate: &LongSymbolFromNumberTemplate null\n LongSymbolFromNumberArgsTemplate: &LongSymbolFromNumberArgsTemplate null\n LongSymbolFromStringTemplate: &LongSymbolFromStringTemplate !!js/function >\n () => {\n return '';\n }\n LongSymbolFromStringArgsTemplate: &LongSymbolFromStringArgsTemplate !!js/function >\n (lhs, arg) => {\n return `${arg}.to_i`;\n }\n Decimal128SymbolFromStringTemplate: &Decimal128SymbolFromStringTemplate !!js/function >\n () => {\n return 'BSON::Decimal128';\n }\n Decimal128SymbolFromStringArgsTemplate: &Decimal128SymbolFromStringArgsTemplate !!js/function >\n (lhs, arg) => {\n return `.new(${arg})`;\n }\n ObjectIdCreateFromHexStringTemplate: &ObjectIdCreateFromHexStringTemplate !!js/function >\n () => {\n return 'BSON::ObjectId';\n }\n ObjectIdCreateFromHexStringArgsTemplate: &ObjectIdCreateFromHexStringArgsTemplate !!js/function >\n (lhs, arg) => {\n return `(${arg})`;\n }\n ObjectIdCreateFromTimeTemplate: &ObjectIdCreateFromTimeTemplate !!js/function >\n () => {\n return 'BSON::ObjectId.from_time';\n }\n ObjectIdCreateFromTimeArgsTemplate: &ObjectIdCreateFromTimeArgsTemplate !!js/function >\n (lhs, arg, isNumber) => {\n if (!isNumber) {\n return `(${arg})`;\n }\n return `(Time.at(${arg}))`;\n }\n # non bson-specific would go here, but there aren't any atm.\n\n #############################################\n # Imports #\n # #\n # Each type has a 'code' that is consistent #\n # between languages. The import templates #\n # for each code generate the required #\n # statement for each type. No args. #\n # #\n # The ImportTemplate collects everything #\n # into one statement. #\n # #\n #############################################\n ImportTemplate: &ImportTemplate !!js/function >\n (args) => {\n let set = new Set(Object.values(args))\n if (set.has(`require 'mongo'`)) return `require 'mongo'`\n return [...set].sort().join('\\n');\n }\n DriverImportTemplate: &DriverImportTemplate !!js/function >\n () => {\n return `require 'mongo'`\n }\n 0ImportTemplate: &0ImportTemplate null\n 1ImportTemplate: &1ImportTemplate null\n 2ImportTemplate: &2ImportTemplate null\n 3ImportTemplate: &3ImportTemplate null\n 4ImportTemplate: &4ImportTemplate null\n 5ImportTemplate: &5ImportTemplate null\n 6ImportTemplate: &6ImportTemplate null\n 7ImportTemplate: &7ImportTemplate null\n 8ImportTemplate: &8ImportTemplate null\n 9ImportTemplate: &9ImportTemplate null\n 10ImportTemplate: &10ImportTemplate null\n 11ImportTemplate: &11ImportTemplate null\n 12ImportTemplate: &12ImportTemplate null\n 100ImportTemplate: &100ImportTemplate !!js/function >\n () => {\n return `require 'bson'`\n }\n 101ImportTemplate: &101ImportTemplate !!js/function >\n () => {\n return `require 'bson'`\n }\n 102ImportTemplate: &102ImportTemplate !!js/function >\n () => {\n return `require 'bson'`\n }\n 103ImportTemplate: &103ImportTemplate !!js/function >\n () => {\n return `require 'bson'`\n }\n 104ImportTemplate: &104ImportTemplate null\n 105ImportTemplate: &105ImportTemplate null\n 106ImportTemplate: &106ImportTemplate null\n 107ImportTemplate: &107ImportTemplate !!js/function >\n () => {\n return `require 'bson'`\n }\n 108ImportTemplate: &108ImportTemplate !!js/function >\n () => {\n return `require 'bson'`\n }\n 109ImportTemplate: &109ImportTemplate null\n 110ImportTemplate: &110ImportTemplate !!js/function >\n () => {\n return `require 'bson'`\n }\n 111ImportTemplate: &111ImportTemplate null\n 112ImportTemplate: &112ImportTemplate !!js/function >\n () => {\n return `require 'bson'`\n }\n 113ImportTemplate: &113ImportTemplate null\n 114ImportTemplate: &114ImportTemplate null\n 200ImportTemplate: &200ImportTemplate null\n 201ImportTemplate: &201ImportTemplate null\n 300ImportTemplate: &300ImportTemplate null\n 301ImportTemplate: &301ImportTemplate null\n 302ImportTemplate: &302ImportTemplate null\n 303ImportTemplate: &303ImportTemplate null\n 304ImportTemplate: &304ImportTemplate null\n 305ImportTemplate: &305ImportTemplate null\n 306ImportTemplate: &306ImportTemplate null\n# Universal types\n# Everything inherits from StringType because we haven't implemented any of them.\nBasicTypes:\n # Universal basic types\n _bool: &BoolType\n <<: *__type\n id: \"_bool\"\n code: 0\n template: *BoolTypeTemplate\n _integer: &IntegerType\n <<: *__type\n id: \"_integer\"\n code: 1\n template: *IntegerTypeTemplate\n _long: &LongBasicType\n <<: *__type\n id: \"_long\"\n code: 2\n template: *LongBasicTypeTemplate\n _decimal: &DecimalType\n <<: *__type\n id: \"_decimal\"\n code: 3\n template: *DecimalTypeTemplate\n _hex: &HexType\n <<: *__type\n id: \"_hex\"\n code: 4\n template: *HexTypeTemplate\n _octal: &OctalType\n <<: *__type\n id: \"_octal\"\n code: 5\n template: *OctalTypeTemplate\n _numeric: &NumericType\n <<: *__type\n id: \"_numeric\"\n code: 6\n template: *NumericTypeTemplate\n _string: &StringType\n <<: *__type\n id: \"_string\"\n code: 7\n template: *StringTypeTemplate\n _regex: &RegexType\n <<: *__type\n id: \"_regex\"\n code: 8\n template: *RegexTypeTemplate\n _array: &ArrayType\n <<: *__type\n id: \"_array\"\n code: 9\n template: *ArrayTypeTemplate\n argsTemplate: *ArrayTypeArgsTemplate\n _object: &ObjectType\n <<: *__type\n id: \"_object\"\n code: 10\n template: *ObjectTypeTemplate\n argsTemplate: *ObjectTypeArgsTemplate\n _null: &NullType\n <<: *__type\n id: \"_null\"\n code: 11\n template: *NullTypeTemplate\n _undefined: &UndefinedType\n <<: *__type\n id: \"_undefined\"\n code: 12\n template: *UndefinedTypeTemplate\n\nSyntax:\n equality:\n template: *EqualitySyntaxTemplate\n in:\n template: *InSyntaxTemplate\n and:\n template: *AndSyntaxTemplate\n or:\n template: *OrSyntaxTemplate\n not:\n template: *NotSyntaxTemplate\n unary:\n template: *UnarySyntaxTemplate\n binary:\n template: *BinarySyntaxTemplate\n parens:\n template: *ParensSyntaxTemplate\n eos:\n template: *EosSyntaxTemplate\n eof:\n template: *EofSyntaxTemplate\n # The new template takes in expr, and an optional skip argument and optional\n # id argument. The skip argument is a boolean that if true then doesn't add\n # new. The code argument is the symbol code being called. The template will check\n # if it is an exception, i.e. a type that is a constructor but may not use new.\n new:\n template: *NewSyntaxTemplate\n # The regex flags that change symbols between languages can be defined here.\n # Flags that aren't defined can be left blank and will be ignored.\n regexFlags: *RegexFlags\n bsonRegexFlags: *BSONRegexFlags\n driver: *DriverTemplate\nImports:\n import:\n template: *ImportTemplate\n driver:\n template: *DriverImportTemplate\n 0:\n template: *0ImportTemplate\n 1:\n template: *1ImportTemplate\n 2:\n template: *2ImportTemplate\n 3:\n template: *3ImportTemplate\n 4:\n template: *4ImportTemplate\n 5:\n template: *5ImportTemplate\n 6:\n template: *6ImportTemplate\n 7:\n template: *7ImportTemplate\n 8:\n template: *8ImportTemplate\n 9:\n template: *9ImportTemplate\n 10:\n template: *10ImportTemplate\n 11:\n template: *11ImportTemplate\n 12:\n template: *12ImportTemplate\n 100:\n template: *100ImportTemplate\n 101:\n template: *101ImportTemplate\n 102:\n template: *102ImportTemplate\n 103:\n template: *103ImportTemplate\n 104:\n template: *104ImportTemplate\n 105:\n template: *105ImportTemplate\n 106:\n template: *106ImportTemplate\n 107:\n template: *107ImportTemplate\n 108:\n template: *108ImportTemplate\n 109:\n template: *109ImportTemplate\n 110:\n template: *110ImportTemplate\n 111:\n template: *111ImportTemplate\n 112:\n template: *112ImportTemplate\n 113:\n template: *113ImportTemplate\n 114:\n template: *114ImportTemplate\n 200:\n template: *200ImportTemplate\n 201:\n template: *201ImportTemplate\n 300:\n template: *300ImportTemplate\n 301:\n template: *301ImportTemplate\n 302:\n template: *302ImportTemplate\n 303:\n template: *303ImportTemplate\n 304:\n template: *304ImportTemplate\n 305:\n template: *305ImportTemplate\n 306:\n template: *306ImportTemplate\nBsonTypes:\n Code: &CodeType\n <<: *__type\n id: \"Code\"\n code: 100\n type: *ObjectType\n attr:\n code:\n callable: *var\n args: null\n attr: null\n id: \"code\"\n type: *StringType\n template: *CodeCodeTemplate\n argsTemplate: *CodeCodeArgsTemplate\n scope:\n callable: *var\n args: null\n attr: null\n id: \"scope\"\n type: *StringType\n template: *CodeScopeTemplate\n argsTemplate: *CodeScopeArgsTemplate\n ObjectId: &ObjectIdType\n <<: *__type\n id: \"ObjectId\"\n code: 101\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *ObjectIdToStringTemplate\n argsTemplate: *ObjectIdToStringArgsTemplate\n equals:\n <<: *__func\n id: \"equals\"\n args:\n - [ \"ObjectId\" ]\n type: *BoolType\n template: *ObjectIdEqualsTemplate\n argsTemplate: *ObjectIdEqualsArgsTemplate\n getTimestamp:\n <<: *__func\n id: \"getTimestamp\"\n type: *IntegerType\n template: *ObjectIdGetTimestampTemplate\n argsTemplate: *ObjectIdGetTimestampArgsTemplate\n BinData: &BinaryType\n <<: *__type\n id: \"BinData\"\n code: 102\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *BinaryToStringTemplate\n argsTemplate: *BinaryToStringArgsTemplate\n base64:\n <<: *__func\n id: \"base64\"\n type: *StringType\n template: *BinaryValueTemplate\n argsTemplate: *BinaryValueArgsTemplate\n length:\n <<: *__func\n id: \"length\"\n type: *IntegerType\n template: *BinaryLengthTemplate\n argsTemplate: *BinaryLengthArgsTemplate\n subtype:\n <<: *__func\n id: \"subtype\"\n type: *IntegerType\n template: *BinarySubtypeTemplate\n argsTemplate: *BinarySubtypeArgsTemplate\n DBRef: &DBRefType\n <<: *__type\n id: \"DBRef\"\n code: 103\n type: *ObjectType\n attr:\n getDb:\n <<: *__func\n id: \"getDb\"\n type: *StringType\n template: *DBRefGetDBTemplate\n argsTemplate: *DBRefGetDBArgsTemplate\n $db:\n callable: *var\n args: null\n attr: null\n id: \"$db\"\n type: *StringType\n template: *DBRefGetDBTemplate\n argsTemplate: *DBRefGetDBArgsTemplate\n getCollection:\n <<: *__func\n id: \"getCollection\"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n getRef:\n <<: *__func\n id: \"getRef\"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n $ref:\n callable: *var\n args: null\n attr: null\n id: \"$ref\"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n getId:\n <<: *__func\n id: \"getId\"\n type: *StringType\n template: *DBRefGetIdTemplate\n argsTemplate: *DBRefGetIdArgsTemplate\n $id:\n callable: *var\n args: null\n attr: null\n id: \"$id\"\n type: *StringType\n template: *DBRefGetIdTemplate\n argsTemplate: *DBRefGetIdArgsTemplate\n NumberInt: &Int32Type\n <<: *__type\n id: \"NumberInt\"\n code: 105\n type: *ObjectType\n attr: {}\n NumberLong: &LongType\n <<: *__type\n id: \"NumberLong\"\n code: 106\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"LongtoString\" # Needs process method\n args:\n - [ *IntegerType, null ]\n type: *StringType\n template: *LongToStringTemplate\n argsTemplate: *LongToStringArgsTemplate\n equals:\n <<: *__func\n id: \"equals\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongEqualsTemplate\n argsTemplate: *LongEqualsArgsTemplate\n toInt:\n <<: *__func\n id: \"toInt\"\n type: *IntegerType\n template: *LongToIntTemplate\n argsTemplate: *LongToIntArgsTemplate\n toNumber:\n <<: *__func\n id: \"toNumber\"\n type: *DecimalType\n template: *LongToNumberTemplate\n argsTemplate: *LongToNumberArgsTemplate\n compare:\n <<: *__func\n id: \"compare\"\n args:\n - [ \"Long\" ]\n type: *StringType\n template: *LongCompareTemplate\n argsTemplate: *LongCompareArgsTemplate\n isOdd:\n <<: *__func\n id: \"isOdd\"\n type: *BoolType\n template: *LongIsOddTemplate\n argsTemplate: *LongIsOddArgsTemplate\n isZero:\n <<: *__func\n id: \"isZero\"\n type: *BoolType\n template: *LongIsZeroTemplate\n argsTemplate: *LongIsZeroArgsTemplate\n isNegative:\n <<: *__func\n id: \"isNegative\"\n type: *BoolType\n template: *LongIsNegativeTemplate\n argsTemplate: *LongIsNegativeArgsTemplate\n negate:\n <<: *__func\n id: \"negate\"\n type: \"Long\"\n template: *LongNegateTemplate\n argsTemplate: *LongNegateArgsTemplate\n not:\n <<: *__func\n id: \"not\"\n type: \"Long\"\n template: *LongNotTemplate\n argsTemplate: *LongNotArgsTemplate\n notEquals:\n <<: *__func\n id: \"notEquals\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongNotEqualsTemplate\n argsTemplate: *LongNotEqualsArgsTemplate\n greaterThan:\n <<: *__func\n id: \"greaterThan\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongGreaterThanTemplate\n argsTemplate: *LongGreaterThanArgsTemplate\n greaterThanOrEqual:\n <<: *__func\n id: \"greaterThanOrEqual\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongGreaterThanOrEqualTemplate\n argsTemplate: *LongGreaterThanOrEqualArgsTemplate\n lessThan:\n <<: *__func\n id: \"lessThan\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongLessThanTemplate\n argsTemplate: *LongLessThanArgsTemplate\n lessThanOrEqual:\n <<: *__func\n id: \"lessThanOrEqual\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongLessThanOrEqualTemplate\n argsTemplate: *LongLessThanOrEqualArgsTemplate\n add:\n <<: *__func\n id: \"add\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongAddTemplate\n argsTemplate: *LongAddArgsTemplate\n subtract:\n <<: *__func\n id: \"subtract\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongSubtractTemplate\n argsTemplate: *LongSubtractArgsTemplate\n multiply:\n <<: *__func\n id: \"multiply\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongMultiplyTemplate\n argsTemplate: *LongMultiplyArgsTemplate\n div:\n <<: *__func\n id: \"div\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongDivTemplate\n argsTemplate: *LongDivArgsTemplate\n modulo:\n <<: *__func\n id: \"modulo\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongModuloTemplate\n argsTemplate: *LongModuloArgsTemplate\n and:\n <<: *__func\n id: \"and\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongAndTemplate\n argsTemplate: *LongAndArgsTemplate\n or:\n <<: *__func\n id: \"or\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongOrTemplate\n argsTemplate: *LongOrArgsTemplate\n xor:\n <<: *__func\n id: \"xor\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongXorTemplate\n argsTemplate: *LongXorArgsTemplate\n shiftLeft:\n <<: *__func\n id: \"shiftLeft\"\n args:\n - [ *IntegerType ]\n type: \"Long\"\n template: *LongShiftLeftTemplate\n argsTemplate: *LongShiftLeftArgsTemplate\n shiftRight:\n <<: *__func\n id: \"shiftRight\"\n args:\n - [ *IntegerType ]\n type: \"Long\"\n template: *LongShiftRightTemplate\n argsTemplate: *LongShiftRightArgsTemplate\n MinKeyType: &MinKeyType\n <<: *__type\n id: \"MinKey\"\n code: 107\n type: *ObjectType\n MaxKeyType: &MaxKeyType\n <<: *__type\n id: \"MaxKey\"\n code: 108\n type: *ObjectType\n Timestamp: &TimestampType\n <<: *__type\n id: \"Timestamp\"\n code: 110\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *TimestampToStringTemplate\n argsTemplate: *TimestampToStringArgsTemplate\n equals:\n <<: *__func\n id: \"equals\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampEqualsTemplate\n argsTemplate: *TimestampEqualsArgsTemplate\n getLowBits:\n <<: *__func\n id: \"getLowBits\"\n type: *IntegerType\n template: *TimestampGetLowBitsTemplate\n argsTemplate: *TimestampGetLowBitsArgsTemplate\n getHighBits:\n <<: *__func\n id: \"getHighBits\"\n type: *IntegerType\n template: *TimestampGetHighBitsTemplate\n argsTemplate: *TimestampGetHighBitsArgsTemplate\n compare:\n <<: *__func\n id: \"compare\"\n args:\n - [ \"Timestamp\" ]\n type: *StringType\n template: *TimestampCompareTemplate\n argsTemplate: *TimestampCompareArgsTemplate\n notEquals:\n <<: *__func\n id: \"notEquals\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampNotEqualsTemplate\n argsTemplate: *TimestampNotEqualsArgsTemplate\n greaterThan:\n <<: *__func\n id: \"greaterThan\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampGreaterThanTemplate\n argsTemplate: *TimestampGreaterThanArgsTemplate\n greaterThanOrEqual:\n <<: *__func\n id: \"greaterThanOrEqual\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampGreaterThanOrEqualTemplate\n argsTemplate: *TimestampGreaterThanOrEqualArgsTemplate\n lessThan:\n <<: *__func\n id: \"lessThan\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampLessThanTemplate\n argsTemplate: *TimestampLessThanArgsTemplate\n lessThanOrEqual:\n <<: *__func\n id: \"lessThanOrEqual\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampLessThanOrEqualTemplate\n argsTemplate: *TimestampLessThanOrEqualArgsTemplate\n BSONSymbol: &SymbolType\n <<: *__type\n id: \"BSONSymbol\"\n code: 111\n type: *ObjectType\n attr:\n valueOf:\n <<: *__func\n id: \"valueOf\"\n type: *StringType\n template: *SymbolValueOfTemplate\n argsTemplate: *SymbolValueOfArgsTemplate\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *SymbolToStringTemplate\n argsTemplate: *SymbolToStringArgsTemplate\n inspect:\n <<: *__func\n id: \"inspect\"\n type: *StringType\n template: *SymbolInspectTemplate\n argsTemplate: *SymbolInspectArgsTemplate\n Double: &DoubleType\n <<: *__type\n id: \"Double\"\n code: 104\n type: *ObjectType\n attr: {}\n Decimal128: &Decimal128Type\n <<: *__type\n id: \"Decimal128\"\n code: 112\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *Decimal128ToStringTemplate\n argsTemplate: *Decimal128ToStringArgsTemplate\n NumberDecimal: &NumberDecimalType\n <<: *__type\n id: \"NumberDecimal\"\n code: 112\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *Decimal128ToStringTemplate\n argsTemplate: *Decimal128ToStringArgsTemplate\n\n\n SUBTYPE_DEFAULT:\n id: \"SUBTYPE_DEFAULT\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeDefaultTemplate\n SUBTYPE_FUNCTION:\n id: \"SUBTYPE_FUNCTION\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeFunctionTemplate\n SUBTYPE_BYTE_ARRAY:\n id: \"SUBTYPE_BYTE_ARRAY\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeByteArrayTemplate\n SUBTYPE_UUID_OLD:\n id: \"SUBTYPE_UUID_OLD\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUuidOldTemplate\n SUBTYPE_UUID:\n id: \"SUBTYPE_UUID\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUuidTemplate\n SUBTYPE_MD5:\n id: \"SUBTYPE_MD5\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeMd5Template\n SUBTYPE_USER_DEFINED:\n id: \"SUBTYPE_USER_DEFINED\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUserDefinedTemplate\n BSONRegExpType: &BSONRegExpType\n <<: *__type\n id: \"BSONRegExp\"\n code: 109\n type: *ObjectType\nNativeTypes:\n Date: &DateType\n <<: *__type\n id: \"Date\"\n code: 200\n type: *ObjectType\n attr: {} # TODO: no built-in date methods added yet\n RegExp: &RegExpType\n <<: *__type\n id: \"RegExp\"\n code: 8\n type: *ObjectType\n attr: {}\n\n\nBsonSymbols:\n Code: &CodeSymbol\n id: \"Code\"\n code: 100\n callable: *constructor\n args:\n - [ *StringType, null ]\n - [ *ObjectType, null ]\n type: *CodeType\n attr: {}\n template: *CodeSymbolTemplate\n argsTemplate: *CodeSymbolArgsTemplate\n ObjectId: &ObjectIdSymbol\n id: \"ObjectId\"\n code: 101\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n type: *ObjectIdType\n attr:\n createFromHexString:\n <<: *__func\n id: \"createFromHexString\"\n args:\n - [ *StringType ]\n type: *ObjectIdType\n template: *ObjectIdCreateFromHexStringTemplate\n argsTemplate: *ObjectIdCreateFromHexStringArgsTemplate\n createFromTime:\n <<: *__func\n id: \"ObjectIdCreateFromTime\"\n args:\n - [ *NumericType, *DateType ]\n type: *ObjectIdType\n template: *ObjectIdCreateFromTimeTemplate\n argsTemplate: *ObjectIdCreateFromTimeArgsTemplate\n isValid:\n <<: *__func\n id: \"isValid\"\n args:\n - [ *StringType ]\n type: *BoolType\n template: *ObjectIdIsValidTemplate\n argsTemplate: *ObjectIdIsValidArgsTemplate\n template: *ObjectIdSymbolTemplate\n argsTemplate: *ObjectIdSymbolArgsTemplate\n BinData: &BinarySymbol\n id: \"BinData\"\n code: 102\n callable: *constructor\n args:\n - [ *IntegerType ]\n - [ *StringType ]\n type: *BinaryType\n attr: {}\n template: *BinarySymbolTemplate\n argsTemplate: *BinarySymbolArgsTemplate\n DBRef:\n id: \"DBRef\"\n code: 103\n callable: *constructor\n args:\n - [ *StringType ]\n - [ *ObjectIdType ]\n - [ *StringType, null ]\n type: *DBRefType\n attr: {}\n template: *DBRefSymbolTemplate\n argsTemplate: *DBRefSymbolArgsTemplate\n NumberInt:\n id: \"Int32\"\n code: 105\n callable: *constructor\n args:\n - [ *NumericType, *StringType, null ]\n type: *Int32Type\n attr: {}\n template: *Int32SymbolTemplate\n argsTemplate: *Int32SymbolArgsTemplate\n NumberLong:\n id: \"NumberLong\"\n code: 106\n callable: *constructor\n args:\n - [ *IntegerType, *StringType, null ]\n type: *LongType\n attr: {}\n template: *LongSymbolTemplate\n argsTemplate: *LongSymbolArgsTemplate\n MinKey:\n id: \"MinKey\"\n code: 107\n callable: *constructor\n args: []\n type: *MinKeyType\n attr: {}\n template: *MinKeySymbolTemplate\n argsTemplate: *MinKeySymbolArgsTemplate\n MaxKey:\n id: \"MaxKey\"\n code: 108\n callable: *constructor\n args: []\n type: *MaxKeyType\n attr: {}\n template: *MaxKeySymbolTemplate\n argsTemplate: *MaxKeySymbolArgsTemplate\n Timestamp:\n id: \"Timestamp\"\n code: 110\n callable: *constructor\n args:\n - [ *IntegerType, null ]\n - [ *IntegerType, null ]\n type: *TimestampType\n attr: {}\n template: *TimestampSymbolTemplate\n argsTemplate: *TimestampSymbolArgsTemplate\n Symbol:\n id: \"Symbol\"\n code: 111\n callable: *constructor\n args:\n - [ *StringType ]\n type: *SymbolType\n attr: {}\n template: *SymbolSymbolTemplate\n argsTemplate: *SymbolSymbolArgsTemplate\n NumberDecimal:\n id: \"NumberDecimal\"\n code: 112\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n type: *Decimal128Type\n attr: {}\n template: *Decimal128SymbolTemplate\n argsTemplate: *Decimal128SymbolArgsTemplate\n BSONRegExp:\n id: \"BSONRegExp\"\n code: 109\n callable: *constructor\n args:\n - [ *StringType ]\n - [ *StringType, null ]\n type: *BSONRegExpType\n attr: {}\n template: *BSONRegExpSymbolTemplate\n argsTemplate: *BSONRegExpSymbolArgsTemplate\n BSONSymbol:\n id: \"BSONSymbol\"\n code: 111\n callable: *constructor\n args:\n - [ *StringType ]\n type: *SymbolType\n attr: {}\n template: *SymbolSymbolTemplate\n argsTemplate: *SymbolSymbolArgsTemplate\n Decimal128:\n id: \"Decimal128\"\n code: 112\n callable: *constructor\n args:\n - [ *ObjectType ]\n type: *Decimal128Type\n attr:\n fromString:\n id: \"fromString\"\n callable: *func\n args:\n - [ *StringType ]\n type: *Decimal128Type\n attr: {}\n template: *Decimal128SymbolFromStringTemplate\n argsTemplate: *Decimal128SymbolFromStringArgsTemplate\n template: *Decimal128SymbolTemplate\n argsTemplate: *Decimal128SymbolArgsTemplate\n Double:\n id: \"Double\"\n code: 104\n callable: *constructor\n args:\n - [ *NumericType, *StringType ]\n type: *DoubleType\n attr: {}\n template: *DoubleSymbolTemplate\n argsTemplate: *DoubleSymbolArgsTemplate\n Int32:\n id: \"Int32\"\n code: 105\n callable: *constructor\n args:\n - [ *NumericType, *StringType ]\n type: *Int32Type\n attr: {}\n template: *Int32SymbolTemplate\n argsTemplate: *Int32SymbolArgsTemplate\n Long:\n id: \"Long\"\n code: 106\n callable: *constructor\n args:\n - [ *IntegerType ]\n - [ *IntegerType ]\n type: *LongType\n attr:\n MAX_VALUE:\n id: \"MAX_VALUE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolMaxTemplate\n argsTemplate: *LongSymbolMaxArgsTemplate\n MIN_VALUE:\n id: \"MIN_VALUE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolMinTemplate\n argsTemplate: *LongSymbolMinArgsTemplate\n ZERO:\n id: \"ZERO\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolZeroTemplate\n argsTemplate: *LongSymbolZeroArgsTemplate\n ONE:\n id: \"ONE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolOneTemplate\n argsTemplate: *LongSymbolOneArgsTemplate\n NEG_ONE:\n id: \"NEG_ONE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolNegOneTemplate\n argsTemplate: *LongSymbolNegOneArgsTemplate\n fromBits:\n id: \"LongfromBits\" # Needs process method\n callable: *func\n args:\n - [ *IntegerType ]\n - [ *IntegerType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromBitsTemplate\n argsTemplate: *LongSymbolFromBitsArgsTemplate\n fromInt:\n id: \"fromInt\"\n callable: *func\n args:\n - [ *IntegerType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromIntTemplate\n argsTemplate: *LongSymbolFromIntArgsTemplate\n fromNumber:\n id: \"fromNumber\"\n callable: *func\n args:\n - [ *NumericType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromNumberTemplate\n argsTemplate: *LongSymbolFromNumberArgsTemplate\n fromString:\n id: \"fromString\"\n callable: *func\n args:\n - [ *StringType ]\n - [ *IntegerType, null ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromStringTemplate\n argsTemplate: *LongSymbolFromStringArgsTemplate\n template: *LongSymbolTemplate\n argsTemplate: *LongSymbolArgsTemplate\n\nNativeSymbols:\n Number:\n id: \"Number\"\n code: 2\n callable: *constructor\n args:\n - [ *IntegerType, *StringType, null ]\n type: *NumericType\n attr: {} # TODO: no built-in number funcs added yet\n template: *NumberSymbolTemplate\n argsTemplate: *NumberSymbolArgsTemplate\n Date: # Needs emit method\n id: \"Date\"\n code: 200\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n type: *DateType\n attr: # TODO: add more date funcs?\n now:\n id: \"now\"\n code: 200.1\n callable: *func\n args: []\n type: *DateType\n attr: {}\n template: *DateSymbolNowTemplate\n argsTemplate: *DateSymbolNowArgsTemplate\n template: *DateSymbolTemplate\n argsTemplate: *DateSymbolArgsTemplate\n ISODate: # Needs emit method\n id: \"ISODate\"\n code: 200\n callable: *constructor\n args:\n - [ *StringType, null ]\n type: *DateType\n attr:\n now:\n id: \"now\"\n callable: *constructor\n args: []\n type: *DateType\n attr: {}\n template: *DateSymbolNowTemplate\n argsTemplate: *DateSymbolNowArgsTemplate\n template: *DateSymbolTemplate\n argsTemplate: *DateSymbolArgsTemplate\n RegExp: # Needs process method\n id: \"RegExp\"\n code: 8\n callable: *constructor\n args:\n - [ *StringType, *RegexType ]\n - [ *StringType, null ]\n type: *RegExpType\n attr: {} # TODO: no built-in regex funcs added yet\n template: *RegExpSymbolTemplate\n argsTemplate: *RegExpSymbolArgsTemplate\n\n"},303:e=>{e.exports="SymbolTypes:\n VAR: &var 0\n CONSTRUCTOR: &constructor 1\n FUNC: &func 2\n# Internal patterns to save typing\n__type: &__type\n id: null\n callable: *var\n args: null\n type: null\n attr: {}\n template: null\n argsTemplate: null\n__func: &__func\n callable: *func\n args: []\n attr: {}\n template: null\n argsTemplate: null\n\n#############################################\n# Sample Templates #\n# #\n# The expected arguments are commented next #\n# to the template itself. Currently all are #\n# set to null, but to define a function #\n# replace 'null' with '!!js/function > \\n #\n# and a function defined below. #\n# #\n# See the other template files for examples #\n# #\n# Good to know: #\n# lhs is left-hand-side of the expression #\n# rhs is right-hand-side of the expression #\n# All args are strings unless noted #\n# - arg? is boolean #\n# - arg# is number #\n# #\n#############################################\nTemplates:\n ########\n # Misc #\n ########\n\n # Filter out regex flags that have translations or are unsupported.\n RegexFlags: &RegexFlags\n i: 'i'\n m: 'm'\n u: 'u'\n y: ''\n g: ''\n BSONRegexFlags: &BSONRegexFlags\n i: 'i'\n m: 'm'\n x: 'x'\n s: 's'\n l: 'l'\n u: 'u'\n\n #############################################\n # Syntax #\n # #\n # Templates for language syntax expressions #\n # #\n #############################################\n\n DriverTemplate: &DriverTemplate !!js/function >\n (spec) => {\n const comment = `// Requires the MongoDB crate.\\n// https://crates.io/crates/mongodb`;\n \n const options = spec.options;\n const filter = spec.filter || 'None';\n const exportMode = spec.exportMode;\n delete spec.options;\n delete spec.filter;\n delete spec.exportMode;\n\n const connect = `let client = Client::with_uri_str(\"${options.uri}\").await?;`\n const coll = `client.database(\"${options.database}\").collection::<Document>(\"${options.collection}\")`;\n\n if ('aggregation' in spec) {\n let agg = spec.aggregation;\n if (agg.charAt(0) != '[') {\n agg = `[${agg}]`;\n }\n return `${comment}\\n\\n${connect}\\nlet result = ${coll}.aggregate(${agg}, None).await?;`;\n }\n\n let driverMethod;\n let optionsName;\n switch (exportMode) {\n case 'Delete Query':\n driverMethod = 'delete_many';\n optionsName = 'DeleteOptions';\n break;\n case 'Update Query':\n driverMethod = 'update_many';\n optionsName = 'UpdateOptions';\n break;\n default:\n driverMethod = 'find';\n optionsName = 'FindOptions';\n break;\n }\n\n const findOpts = [];\n for (const k in spec) {\n let optName = k;\n let optValue = spec[k];\n switch(k) {\n case 'project':\n optName = 'projection';\n break;\n case 'maxTimeMS':\n optName = 'max_time';\n optValue = `std::time::Duration::from_millis(${optValue})`;\n break;\n }\n findOpts.push(` .${optName}(${optValue})`);\n }\n let optStr = '';\n if (findOpts.length > 0) {\n optStr = `let options = mongodb::options::${optionsName}::builder()\\n${findOpts.join('\\n')}\\n .build();\\n`;\n }\n let optRef = optStr ? 'options' : 'None';\n const cmd = `let result = ${coll}.${driverMethod}(${filter}, ${optRef}).await?;`;\n\n return `${comment}\\n\\n${connect}\\n${optStr}${cmd}`;\n }\n EqualitySyntaxTemplate: &EqualitySyntaxTemplate !!js/function >\n (lhs, op, rhs) => {\n if (op.includes('!') || op.includes('not')) {\n return `${lhs} != ${rhs}`;\n }\n else if (op === '==' || op === '===' || op === 'is') {\n return `${lhs} == ${rhs}`;\n }\n return `${lhs} ${op} ${rhs}`;\n }\n InSyntaxTemplate: &InSyntaxTemplate !!js/function >\n (lhs, op, rhs) => {\n let prefix = '';\n if (op.includes('!') || op.includes('not')) {\n prefix = '!';\n }\n return `${prefix}${rhs}.contains(&${lhs})`\n }\n AndSyntaxTemplate: &AndSyntaxTemplate !!js/function >\n (args) => {\n return args.join(' && ');\n }\n OrSyntaxTemplate: &OrSyntaxTemplate !!js/function >\n (args) => {\n return args.join(' || ');\n }\n NotSyntaxTemplate: &NotSyntaxTemplate !!js/function >\n (arg) => {\n return `!${arg}`;\n }\n UnarySyntaxTemplate: &UnarySyntaxTemplate !!js/function >\n (op, val) => {\n switch(op) {\n case '+':\n return val;\n case '~':\n return `!${val}`;\n default:\n return `${op}${val}`;\n }\n return `${op}${val}`;\n }\n BinarySyntaxTemplate: &BinarySyntaxTemplate !!js/function >\n (args) => {\n return args.reduce((s, op, i, arr) => {\n if (i % 2 === 0) {\n return s;\n }\n const rhs = arr[i + 1];\n switch(op) {\n case '//':\n return `${s} / ${rhs}`\n case '**':\n return `${s}.pow(${rhs})`\n default:\n return `${s} ${op} ${rhs}`;\n }\n }, args[0]);\n }\n ParensSyntaxTemplate: &ParensSyntaxTemplate null\n EosTemplate: &EosSyntaxTemplate null # No args. End-of-line\n EofTemplate: &EofSyntaxTemplate null # No args. End-of-file\n FloorDivTemplate: &FloorDivSyntaxTemplate null # Args: lhs, rhs\n PowerTemplate: &PowerSyntaxTemplate null # Args: lhs, rhs\n NewTemplate: &NewSyntaxTemplate null # Args: expression, skip?, code# [to check if meant to be skipped]\n\n #############################################\n # Literal Types #\n # #\n # Templates for literal type instance. Most #\n # get passed the literal itself as an arg. #\n # #\n #############################################\n StringTypeTemplate: &StringTypeTemplate !!js/function >\n (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `\"${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\"`;\n }\n RegexTypeTemplate: &RegexTypeTemplate !!js/function >\n (pattern, flags) => {\n // Double-quote stringify\n let newPat = pattern;\n if (\n (pattern.charAt(0) === '\\'' && pattern.charAt(pattern.length - 1) === '\\'') ||\n (pattern.charAt(0) === '\"' && pattern.charAt(pattern.length - 1) === '\"')) {\n newPat = pattern.substr(1, pattern.length - 2);\n }\n return `Regex { pattern: \"${newPat.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\".to_string(), options: \"${flags}\".to_string() }`;\n }\n BoolTypeTemplate: &BoolTypeTemplate !!js/function >\n (literal) => {\n return literal.toLowerCase();\n }\n IntegerTypeTemplate: &IntegerTypeTemplate null # args: literal, argType (i.e. '_string', '_decimal' etc)\n DecimalTypeTemplate: &DecimalTypeTemplate null # args: literal, argType\n LongBasicTypeTemplate: &LongBasicTypeTemplate null\n HexTypeTemplate: &HexTypeTemplate !!js/function >\n (literal, type) => {\n if (literal.charAt(1) === 'X') {\n return literal.charAt(0) + 'x' + literal.substring(2);\n }\n return literal;\n }\n OctalTypeTemplate: &OctalTypeTemplate !!js/function >\n (literal, type) => {\n switch(literal.charAt(1)) {\n case 'o':\n return literal;\n case 'O':\n case '0':\n return literal.charAt(0) + 'o' + literal.substring(2);\n default:\n return literal.charAt(0) + 'o' + literal.substring(1);\n }\n }\n NumericTypeTemplate: &NumericTypeTemplate null # args: literal, argType\n ArrayTypeTemplate: &ArrayTypeTemplate !!js/function >\n (literal, depth) => {\n if (literal === '') {\n return '[]'\n }\n return `[${literal}]`;\n }\n ArrayTypeArgsTemplate: &ArrayTypeArgsTemplate !!js/function >\n (element, depth, isLast) => {\n depth++;\n const indent = '\\n' + ' '.repeat(depth);\n const closingIndent = isLast ? '\\n' + ' '.repeat(depth - 1) : ',';\n return `${indent}${element}${closingIndent}`;\n }\n NullTypeTemplate: &NullTypeTemplate !!js/function >\n () => 'Bson::Null'\n UndefinedTypeTemplate: &UndefinedTypeTemplate !!js/function >\n () => 'Bson::Undefined'\n ObjectTypeTemplate: &ObjectTypeTemplate !!js/function >\n (literal) => `doc! {${literal}}`\n ObjectTypeArgsTemplate: &ObjectTypeArgsTemplate !!js/function >\n (args, depth) => {\n if (args.length === 0) {\n return '';\n }\n depth++;\n const indent = '\\n' + ' '.repeat(depth);\n const closingIndent = '\\n' + ' '.repeat(depth - 1);\n const doubleStringify = (str) => {\n let newStr = str;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n return `\"${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\"`;\n }\n\n const pairs = args.map((pair) => {\n return `${indent}${doubleStringify(pair[0])}: ${pair[1]}`;\n }).join(',');\n\n return `${pairs}${closingIndent}`;\n\n }\n\n #############################################\n # Symbols #\n # #\n # Templates for symbols, can be either #\n # functions or variables. #\n # #\n # The *SymbolTemplates return names and #\n # usually don't take any arguments. The #\n # *SymbolArgsTemplates are invoked for func #\n # calls. The first argument is always the #\n # lhs, i.e. the symbol returned from the #\n # corresponding SymbolTemplate. The rest of #\n # the arguments are the processed arguments #\n # passed to the original function. #\n # #\n #############################################\n CodeSymbolTemplate: &CodeSymbolTemplate !!js/function >\n () => ''\n CodeSymbolArgsTemplate: &CodeSymbolArgsTemplate !!js/function >\n (lhs, code, scope) => {\n // Double quote stringify\n let newStr = code === undefined ? '' : code;\n const str = newStr;\n if (\n (str.charAt(0) === '\\'' && str.charAt(str.length - 1) === '\\'') ||\n (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"')) {\n newStr = str.substr(1, str.length - 2);\n }\n code = `\"${newStr.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\".to_string()`;\n if (scope === undefined) {\n return `Bson::JavaScriptCode(${code})`;\n } else {\n return `JavaScriptCodeWithScope { code: ${code}, scope: ${scope} }`;\n }\n }\n ObjectIdSymbolTemplate: &ObjectIdSymbolTemplate !!js/function >\n () => 'ObjectId'\n ObjectIdSymbolArgsTemplate: &ObjectIdSymbolArgsTemplate !!js/function >\n (lhs, arg) => {\n if (arg === undefined || arg === '') {\n return '::new()';\n }\n // Double quote stringify\n let newArg = arg;\n if (\n (arg.charAt(0) === '\\'' && arg.charAt(arg.length - 1) === '\\'') ||\n (arg.charAt(0) === '\"' && arg.charAt(arg.length - 1) === '\"')) {\n newArg = arg.substr(1, arg.length - 2);\n }\n newArg = `\"${newArg.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\"`;\n return `::parse_str(${newArg})?`;\n }\n BinarySymbolTemplate: &BinarySymbolTemplate null\n BinarySymbolArgsTemplate: &BinarySymbolArgsTemplate null\n BinarySymbolSubtypeDefaultTemplate: &BinarySymbolSubtypeDefaultTemplate !!js/function >\n () => 'BinarySubtype::Generic'\n BinarySymbolSubtypeFunctionTemplate: &BinarySymbolSubtypeFunctionTemplate !!js/function >\n () => 'BinarySubtype::Function'\n BinarySymbolSubtypeByteArrayTemplate: &BinarySymbolSubtypeByteArrayTemplate !!js/function >\n () => 'BinarySubtype::BinaryOld'\n BinarySymbolSubtypeUuidOldTemplate: &BinarySymbolSubtypeUuidOldTemplate !!js/function >\n () => 'BinarySubtype::UuidOld'\n BinarySymbolSubtypeUuidTemplate: &BinarySymbolSubtypeUuidTemplate !!js/function >\n () => 'BinarySubtype::Uuid'\n BinarySymbolSubtypeMd5Template: &BinarySymbolSubtypeMd5Template !!js/function >\n () => 'BinarySubtype::Md5'\n BinarySymbolSubtypeUserDefinedTemplate: &BinarySymbolSubtypeUserDefinedTemplate !!js/function >\n (arg) => `BinarySubtype::UserDefined(${arg})`\n DBRefSymbolTemplate: &DBRefSymbolTemplate null # No args\n DBRefSymbolArgsTemplate: &DBRefSymbolArgsTemplate null # Args: lhs, coll, id, db\n DoubleSymbolTemplate: &DoubleSymbolTemplate !!js/function >\n () => ''\n DoubleSymbolArgsTemplate: &DoubleSymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n if (type === '_decimal' || type === '_double') {\n return arg;\n }\n if (type === '_integer' || type === '_long') {\n return `${arg}.0`;\n }\n if (type === '_string') {\n return `${arg}.parse::<f32>()?`;\n }\n return `f32::try_from(${arg})?`;\n }\n Int32SymbolTemplate: &Int32SymbolTemplate !!js/function >\n () => ''\n Int32SymbolArgsTemplate: &Int32SymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n if (type === '_integer' || type === '_long' || type === '_hex' || type === '_octal') {\n return arg;\n }\n if (type === '_string') {\n return `${arg}.parse::<i32>()?`;\n }\n return `i32::try_from(${arg})?`;\n }\n LongSymbolTemplate: &LongSymbolTemplate !!js/function >\n () => ''\n LongSymbolArgsTemplate: &LongSymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n if (type === '_integer' || type === '_long' || type === '_hex' || type === '_octal') {\n return `${arg}i64`;\n }\n if (type === '_string') {\n return `${arg}.parse::<i64>()?`;\n }\n return `i64::try_from(${arg})?`;\n }\n RegExpSymbolTemplate: &RegExpSymbolTemplate !!js/function >\n () => 'Regex'\n RegExpSymbolArgsTemplate: &RegExpSymbolArgsTemplate null # Args: lhs, pattern, flags\n SymbolSymbolTemplate: &SymbolSymbolTemplate !!js/function >\n () => 'Bson::Symbol'\n SymbolSymbolArgsTemplate: &SymbolSymbolArgsTemplate !!js/function >\n (_, arg) => `(${arg})`\n BSONRegExpSymbolTemplate: &BSONRegExpSymbolTemplate !!js/function >\n () => 'Regex'\n BSONRegExpSymbolArgsTemplate: &BSONRegExpSymbolArgsTemplate !!js/function >\n (_, pattern, flags) => {\n if (flags === null || flags === undefined) {\n flags = '';\n }\n if (\n (flags.charAt(0) === '\\'' && flags.charAt(flags.length - 1) === '\\'') ||\n (flags.charAt(0) === '\"' && flags.charAt(flags.length - 1) === '\"')) {\n flags = flags.substr(1, flags.length - 2);\n }\n // Double-quote stringify\n let newPat = pattern;\n if (\n (pattern.charAt(0) === '\\'' && pattern.charAt(pattern.length - 1) === '\\'') ||\n (pattern.charAt(0) === '\"' && pattern.charAt(pattern.length - 1) === '\"')) {\n newPat = pattern.substr(1, pattern.length - 2);\n }\n return ` { pattern: \"${newPat.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\", flags: \"${flags}\" }`;\n }\n Decimal128SymbolTemplate: &Decimal128SymbolTemplate null # No args\n Decimal128SymbolArgsTemplate: &Decimal128SymbolArgsTemplate null # Args: lhs, arg\n MinKeySymbolTemplate: &MinKeySymbolTemplate !!js/function >\n () => 'Bson::MinKey'\n MinKeySymbolArgsTemplate: &MinKeySymbolArgsTemplate !!js/function >\n () => ''\n MaxKeySymbolTemplate: &MaxKeySymbolTemplate !!js/function >\n () => 'Bson::MaxKey'\n MaxKeySymbolArgsTemplate: &MaxKeySymbolArgsTemplate !!js/function >\n () => ''\n TimestampSymbolTemplate: &TimestampSymbolTemplate !!js/function >\n () => 'Timestamp'\n TimestampSymbolArgsTemplate: &TimestampSymbolArgsTemplate !!js/function >\n (lhs, low, high) => {\n if (low === undefined) {\n low = 0;\n high = 0;\n }\n return ` { time: ${low}, increment: ${high} }`\n }\n # non bson-specific\n NumberSymbolTemplate: &NumberSymbolTemplate !!js/function >\n () => ''\n NumberSymbolArgsTemplate: &NumberSymbolArgsTemplate !!js/function >\n (lhs, arg, type) => {\n arg = arg === undefined ? 0 : arg;\n\n switch(type) {\n case '_string':\n if (arg.indexOf('.') !== -1) {\n return `${arg}.parse::<f32>()?`;\n }\n return `${arg}.parse::<i32>()?`;\n case '_integer':\n case '_long':\n case '_decimal':\n return `${arg}`;\n default:\n return `f32::try_from(${arg})?`;\n }\n }\n DateSymbolTemplate: &DateSymbolTemplate !!js/function >\n () => 'DateTime'\n DateSymbolArgsTemplate: &DateSymbolArgsTemplate !!js/function >\n (lhs, date, isString) => {\n let toStr = isString ? '.to_rfc3339_string()' : '';\n if (date === null) {\n return `${lhs}::now()${toStr}`;\n }\n return `${lhs}::parse_rfc3339_str(\"${date.toISOString()}\")?${toStr}`;\n }\n\n #############################################\n # Object Attributes/Methods #\n # #\n # These're variables or functions called on #\n # instantiated objects. For example, #\n # ObjectId().isValid() or Timestamp().t #\n # #\n # They follow the same pattern with the\n # *Template/*ArgsTemplates: usually no args #\n # to the Template and lhs plus any original #\n # arguments to the ArgsTemplate. #\n # #\n #############################################\n CodeCodeTemplate: &CodeCodeTemplate null\n CodeCodeArgsTemplate: &CodeCodeArgsTemplate null\n CodeScopeTemplate: &CodeScopeTemplate !!js/function >\n (lhs) => `${lhs}.scope`\n CodeScopeArgsTemplate: &CodeScopeArgsTemplate null\n ObjectIdToStringTemplate: &ObjectIdToStringTemplate !!js/function >\n (lhs) => `${lhs}.to_hex()`\n ObjectIdToStringArgsTemplate: &ObjectIdToStringArgsTemplate !!js/function >\n () => ''\n ObjectIdEqualsTemplate: &ObjectIdEqualsTemplate !!js/function >\n (lhs) => `${lhs} == `\n ObjectIdEqualsArgsTemplate: &ObjectIdEqualsArgsTemplate !!js/function >\n (_, arg) => arg\n ObjectIdGetTimestampTemplate: &ObjectIdGetTimestampTemplate !!js/function >\n (lhs) => `${lhs}.timestamp()`\n ObjectIdGetTimestampArgsTemplate: &ObjectIdGetTimestampArgsTemplate !!js/function >\n () => ''\n ObjectIdIsValidTemplate: &ObjectIdIsValidTemplate null\n ObjectIdIsValidArgsTemplate: &ObjectIdIsValidArgsTemplate null\n BinaryValueTemplate: &BinaryValueTemplate !!js/function >\n (arg) => `${arg}.bytes`\n BinaryValueArgsTemplate: &BinaryValueArgsTemplate !!js/function >\n () => ''\n BinaryLengthTemplate: &BinaryLengthTemplate !!js/function >\n (arg) => `${arg}.bytes.len()`\n BinaryLengthArgsTemplate: &BinaryLengthArgsTemplate !!js/function >\n () => ''\n BinaryToStringTemplate: &BinaryToStringTemplate !!js/function >\n (arg) => `format!(\"{}\", ${arg})`\n BinaryToStringArgsTemplate: &BinaryToStringArgsTemplate !!js/function >\n () => ''\n BinarySubtypeTemplate: &BinarySubtypeTemplate !!js/function >\n (arg) => `${arg}.subtype`\n BinarySubtypeArgsTemplate: &BinarySubtypeArgsTemplate !!js/function >\n () => ''\n DBRefGetDBTemplate: &DBRefGetDBTemplate null\n DBRefGetCollectionTemplate: &DBRefGetCollectionTemplate null\n DBRefGetIdTemplate: &DBRefGetIdTemplate null\n DBRefGetDBArgsTemplate: &DBRefGetDBArgsTemplate null\n DBRefGetCollectionArgsTemplate: &DBRefGetCollectionArgsTemplate null\n DBRefGetIdArgsTemplate: &DBRefGetIdArgsTemplate null\n DBRefToStringTemplate: &DBRefToStringTemplate null\n DBRefToStringArgsTemplate: &DBRefToStringArgsTemplate null\n DoubleValueOfTemplate: &DoubleValueOfTemplate null\n DoubleValueOfArgsTemplate: &DoubleValueOfArgsTemplate null\n Int32ValueOfTemplate: &Int32ValueOfTemplate null\n Int32ValueOfArgsTemplate: &Int32ValueOfArgsTemplate null\n Int32ToStringTemplate: &Int32ToStringTemplate null\n Int32ToStringArgsTemplate: &Int32ToStringArgsTemplate null\n LongEqualsTemplate: &LongEqualsTemplate !!js/function >\n (lhs) => `${lhs} == `\n LongEqualsArgsTemplate: &LongEqualsArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongToStringTemplate: &LongToStringTemplate !!js/function >\n (arg) => arg\n LongToStringArgsTemplate: &LongToStringArgsTemplate null\n LongToIntTemplate: &LongToIntTemplate !!js/function >\n (arg) => `${arg} as i32`\n LongToIntArgsTemplate: &LongToIntArgsTemplate !!js/function >\n () => ''\n LongValueOfTemplate: &LongValueOfTemplate null\n LongValueOfArgsTemplate: &LongValueOfArgsTemplate null\n LongToNumberTemplate: &LongToNumberTemplate !!js/function >\n (arg) => `${arg} as f64`\n LongToNumberArgsTemplate: &LongToNumberArgsTemplate !!js/function >\n () => ''\n LongAddTemplate: &LongAddTemplate !!js/function >\n (lhs) => `${lhs} + `\n LongAddArgsTemplate: &LongAddArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongSubtractTemplate: &LongSubtractTemplate !!js/function >\n (lhs) => `${lhs} - `\n LongSubtractArgsTemplate: &LongSubtractArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongMultiplyTemplate: &LongMultiplyTemplate !!js/function >\n (lhs) => `${lhs} * `\n LongMultiplyArgsTemplate: &LongMultiplyArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongDivTemplate: &LongDivTemplate !!js/function >\n (lhs) => `${lhs} / `\n LongDivArgsTemplate: &LongDivArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongModuloTemplate: &LongModuloTemplate !!js/function >\n (lhs) => `${lhs} % `\n LongModuloArgsTemplate: &LongModuloArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongAndTemplate: &LongAndTemplate !!js/function >\n (lhs) => `${lhs} & `\n LongAndArgsTemplate: &LongAndArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongOrTemplate: &LongOrTemplate !!js/function >\n (lhs) => `${lhs} | `\n LongOrArgsTemplate: &LongOrArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongXorTemplate: &LongXorTemplate !!js/function >\n (lhs) => `${lhs} ^ `\n LongXorArgsTemplate: &LongXorArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongShiftLeftTemplate: &LongShiftLeftTemplate !!js/function >\n (lhs) => `${lhs} << `\n LongShiftLeftArgsTemplate: &LongShiftLeftArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongShiftRightTemplate: &LongShiftRightTemplate !!js/function >\n (lhs) => `${lhs} >> `\n LongShiftRightArgsTemplate: &LongShiftRightArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongCompareTemplate: &LongCompareTemplate !!js/function >\n (lhs) => `${lhs} - `\n LongCompareArgsTemplate: &LongCompareArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongIsOddTemplate: &LongIsOddTemplate !!js/function >\n (arg) => `${arg} % 2 == 1`\n LongIsOddArgsTemplate: &LongIsOddArgsTemplate !!js/function >\n () => ''\n LongIsZeroTemplate: &LongIsZeroTemplate !!js/function >\n (arg) => `${arg} == 0`\n LongIsZeroArgsTemplate: &LongIsZeroArgsTemplate !!js/function >\n () => ''\n LongIsNegativeTemplate: &LongIsNegativeTemplate !!js/function >\n (arg) => `${arg} < 0`\n LongIsNegativeArgsTemplate: &LongIsNegativeArgsTemplate !!js/function >\n () => ''\n LongNegateTemplate: &LongNegateTemplate !!js/function >\n () => '-'\n LongNegateArgsTemplate: &LongNegateArgsTemplate !!js/function >\n (arg) => arg\n LongNotTemplate: &LongNotTemplate !!js/function >\n () => '~'\n LongNotArgsTemplate: &LongNotArgsTemplate !!js/function >\n (arg) => arg\n LongNotEqualsTemplate: &LongNotEqualsTemplate !!js/function >\n (lhs) => `${lhs} != `\n LongNotEqualsArgsTemplate: &LongNotEqualsArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongGreaterThanTemplate: &LongGreaterThanTemplate !!js/function >\n (lhs) => `${lhs} > `\n LongGreaterThanArgsTemplate: &LongGreaterThanArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongGreaterThanOrEqualTemplate: &LongGreaterThanOrEqualTemplate !!js/function >\n (lhs) => `${lhs} >= `\n LongGreaterThanOrEqualArgsTemplate: &LongGreaterThanOrEqualArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongLessThanTemplate: &LongLessThanTemplate !!js/function >\n (lhs) => `${lhs} < `\n LongLessThanArgsTemplate: &LongLessThanArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongLessThanOrEqualTemplate: &LongLessThanOrEqualTemplate !!js/function >\n (lhs) => `${lhs} <= `\n LongLessThanOrEqualArgsTemplate: &LongLessThanOrEqualArgsTemplate !!js/function >\n (_, rhs) => rhs\n LongFloatApproxTemplate: &LongFloatApproxTemplate !!js/function >\n (arg) => `${arg} as f32`\n LongTopTemplate: &LongTopTemplate !!js/function >\n (arg) => `${arg} >> 32`\n LongBottomTemplate: &LongBottomTemplate !!js/function >\n (arg) => `${arg} & 0x0000ffff`\n TimestampToStringTemplate: &TimestampToStringTemplate !!js/function >\n (arg) => `${arg}.to_string()`\n TimestampToStringArgsTemplate: &TimestampToStringArgsTemplate !!js/function >\n () => ''\n TimestampEqualsTemplate: &TimestampEqualsTemplate !!js/function >\n (lhs) => `${lhs} == `\n TimestampEqualsArgsTemplate: &TimestampEqualsArgsTemplate !!js/function >\n (_, rhs) => rhs\n TimestampGetLowBitsTemplate: &TimestampGetLowBitsTemplate !!js/function >\n (arg) => `${arg}.time`\n TimestampGetLowBitsArgsTemplate: &TimestampGetLowBitsArgsTemplate !!js/function >\n () => ''\n TimestampGetHighBitsTemplate: &TimestampGetHighBitsTemplate !!js/function >\n (arg) => `${arg}.increment`\n TimestampGetHighBitsArgsTemplate: &TimestampGetHighBitsArgsTemplate !!js/function >\n () => ''\n TimestampTTemplate: &TimestampTTemplate !!js/function >\n (arg) => `${arg}.time`\n TimestampITemplate: &TimestampITemplate !!js/function >\n (arg) => `${arg}.increment`\n TimestampAsDateTemplate: &TimestampAsDateTemplate !!js/function >\n (arg) => `DateTime::from_millis(${arg}.time)`\n TimestampAsDateArgsTemplate: &TimestampAsDateArgsTemplate !!js/function >\n () => ''\n TimestampCompareTemplate: &TimestampCompareTemplate !!js/function >\n (arg) => `${arg}.cmp`\n TimestampCompareArgsTemplate: &TimestampCompareArgsTemplate !!js/function >\n (_, rhs) => `(${rhs})`\n TimestampNotEqualsTemplate: &TimestampNotEqualsTemplate !!js/function >\n (lhs) => `${lhs} != `\n TimestampNotEqualsArgsTemplate: &TimestampNotEqualsArgsTemplate !!js/function >\n (_, rhs) => rhs\n TimestampGreaterThanTemplate: &TimestampGreaterThanTemplate !!js/function >\n (lhs) => `${lhs} > `\n TimestampGreaterThanArgsTemplate: &TimestampGreaterThanArgsTemplate !!js/function >\n (_, rhs) => rhs\n TimestampGreaterThanOrEqualTemplate: &TimestampGreaterThanOrEqualTemplate !!js/function >\n (lhs) => `${lhs} >= `\n TimestampGreaterThanOrEqualArgsTemplate: &TimestampGreaterThanOrEqualArgsTemplate !!js/function >\n (_, rhs) => rhs\n TimestampLessThanTemplate: &TimestampLessThanTemplate !!js/function >\n (lhs) => `${lhs} < `\n TimestampLessThanArgsTemplate: &TimestampLessThanArgsTemplate !!js/function >\n (_, rhs) => rhs\n TimestampLessThanOrEqualTemplate: &TimestampLessThanOrEqualTemplate !!js/function >\n (lhs) => `${lhs} <= `\n TimestampLessThanOrEqualArgsTemplate: &TimestampLessThanOrEqualArgsTemplate !!js/function >\n (_, rhs) => rhs\n SymbolValueOfTemplate: &SymbolValueOfTemplate !!js/function >\n (arg) => `${arg}.as_symbol().unwrap()`\n SymbolValueOfArgsTemplate: &SymbolValueOfArgsTemplate !!js/function >\n () => ''\n SymbolInspectTemplate: &SymbolInspectTemplate !!js/function >\n (arg) => `format!(\"{:?}\", ${arg})`\n SymbolInspectArgsTemplate: &SymbolInspectArgsTemplate !!js/function >\n () => ''\n SymbolToStringTemplate: &SymbolToStringTemplate !!js/function >\n (arg) => `${arg}.as_symbol().unwrap()`\n SymbolToStringArgsTemplate: &SymbolToStringArgsTemplate !!js/function >\n () => ''\n Decimal128ToStringTemplate: &Decimal128ToStringTemplate null\n Decimal128ToStringArgsTemplate: &Decimal128ToStringArgsTemplate null\n # non bson-specific\n DateSymbolNowTemplate: &DateSymbolNowTemplate !!js/function >\n () => 'DateTime::now()'\n DateSymbolNowArgsTemplate: &DateSymbolNowArgsTemplate !!js/function >\n () => ''\n\n #############################################\n # Symbol Attributes/Methods #\n # #\n # These're variables or functions called on #\n # symbols. Also called bson-utils. #\n # #\n # They are basically the same thing as #\n # object attributes/methods, but need to be #\n # distinguished since they are separate #\n # namespaces that happen to have the same #\n # name which is v confusing. #\n # #\n # For example, ObjectId().toString() is an #\n # object method, while ObjectId.fromString #\n # is a symbol attribute. These are two #\n # separate ObjectId related namespaces that #\n # don't overlap. #\n # #\n #############################################\n LongSymbolMaxTemplate: &LongSymbolMaxTemplate !!js/function >\n () => 'i64::MAX'\n LongSymbolMaxArgsTemplate: &LongSymbolMaxArgsTemplate !!js/function >\n () => ''\n LongSymbolMinTemplate: &LongSymbolMinTemplate !!js/function >\n () => 'i64::MIN'\n LongSymbolMinArgsTemplate: &LongSymbolMinArgsTemplate !!js/function >\n () => ''\n LongSymbolZeroTemplate: &LongSymbolZeroTemplate !!js/function >\n () => '0i64'\n LongSymbolZeroArgsTemplate: &LongSymbolZeroArgsTemplate !!js/function >\n () => ''\n LongSymbolOneTemplate: &LongSymbolOneTemplate !!js/function >\n () => '1i64'\n LongSymbolOneArgsTemplate: &LongSymbolOneArgsTemplate !!js/function >\n () => ''\n LongSymbolNegOneTemplate: &LongSymbolNegOneTemplate !!js/function >\n () => '-1i64'\n LongSymbolNegOneArgsTemplate: &LongSymbolNegOneArgsTemplate !!js/function >\n () => ''\n LongSymbolFromBitsTemplate: &LongSymbolFromBitsTemplate !!js/function >\n () => ''\n LongSymbolFromBitsArgsTemplate: &LongSymbolFromBitsArgsTemplate !!js/function >\n (_, arg) => `${arg}i64`\n LongSymbolFromIntTemplate: &LongSymbolFromIntTemplate !!js/function >\n () => ''\n LongSymbolFromIntArgsTemplate: &LongSymbolFromIntArgsTemplate !!js/function >\n (_, arg) => `${arg}i64`\n LongSymbolFromNumberTemplate: &LongSymbolFromNumberTemplate !!js/function >\n () => ''\n LongSymbolFromNumberArgsTemplate: &LongSymbolFromNumberArgsTemplate !!js/function >\n (_, arg) => `${arg} as i64`\n LongSymbolFromStringTemplate: &LongSymbolFromStringTemplate !!js/function >\n () => ''\n LongSymbolFromStringArgsTemplate: &LongSymbolFromStringArgsTemplate !!js/function >\n (_, arg, radix) => {\n if (radix) {\n return `i64::from_str_radix(${arg}, ${radix})?`;\n }\n return `${arg}.parse::<i64>()?`;\n }\n Decimal128SymbolFromStringTemplate: &Decimal128SymbolFromStringTemplate null\n Decimal128SymbolFromStringArgsTemplate: &Decimal128SymbolFromStringArgsTemplate null\n ObjectIdCreateFromHexStringTemplate: &ObjectIdCreateFromHexStringTemplate !!js/function >\n (lhs) => lhs\n ObjectIdCreateFromHexStringArgsTemplate: &ObjectIdCreateFromHexStringArgsTemplate !!js/function >\n (lhs, arg) => {\n // Double quote stringify\n let newArg = arg;\n if (\n (arg.charAt(0) === '\\'' && arg.charAt(arg.length - 1) === '\\'') ||\n (arg.charAt(0) === '\"' && arg.charAt(arg.length - 1) === '\"')) {\n newArg = arg.substr(1, arg.length - 2);\n }\n newArg = `\"${newArg.replace(/\\\\([\\s\\S])|(\")/g, '\\\\$1$2')}\"`;\n return `::parse_str(${newArg})?`;\n }\n ObjectIdCreateFromTimeTemplate: &ObjectIdCreateFromTimeTemplate null\n ObjectIdCreateFromTimeArgsTemplate: &ObjectIdCreateFromTimeArgsTemplate null\n # non bson-specific would go here, but there aren't any atm.\n\n #############################################\n # Imports #\n # #\n # Each type has a 'code' that is consistent #\n # between languages. The import templates #\n # for each code generate the required #\n # statement for each type. No args. #\n # #\n # The ImportTemplate collects everything #\n # into one statement. #\n # #\n #############################################\n ImportTemplate: &ImportTemplate !!js/function >\n (args) => {\n let merged = new Set(Object.values(args));\n return [...merged].sort().join('\\n');\n }\n DriverImportTemplate: &DriverImportTemplate !!js/function >\n () => 'use mongodb::Client;'\n 0ImportTemplate: &0ImportTemplate null\n 1ImportTemplate: &1ImportTemplate null\n 2ImportTemplate: &2ImportTemplate null\n 3ImportTemplate: &3ImportTemplate null\n 4ImportTemplate: &4ImportTemplate null\n 5ImportTemplate: &5ImportTemplate null\n 6ImportTemplate: &6ImportTemplate null\n 7ImportTemplate: &7ImportTemplate null\n 8ImportTemplate: &8ImportTemplate !!js/function >\n () => 'use mongodb::bson::Regex;'\n 9ImportTemplate: &9ImportTemplate null\n 10ImportTemplate: &10ImportTemplate !!js/function >\n () => 'use mongodb::bson::doc;'\n # Null\n 11ImportTemplate: &11ImportTemplate !!js/function >\n () => 'use mongodb::bson::Bson;'\n # Undefined\n 12ImportTemplate: &12ImportTemplate !!js/function >\n () => 'use mongodb::bson::Bson;'\n # Code\n 100ImportTemplate: &100ImportTemplate !!js/function >\n () => 'use mongodb::bson::Bson;'\n 101ImportTemplate: &101ImportTemplate !!js/function >\n () => 'use mongodb::bson::oid::ObjectId;'\n 102ImportTemplate: &102ImportTemplate !!js/function >\n () => 'use mongodb::bson::Binary;'\n 103ImportTemplate: &103ImportTemplate null\n 104ImportTemplate: &104ImportTemplate null\n 105ImportTemplate: &105ImportTemplate null\n 106ImportTemplate: &106ImportTemplate null\n # MinKey\n 107ImportTemplate: &107ImportTemplate !!js/function >\n () => 'use mongodb::bson::Bson;'\n # MaxKey\n 108ImportTemplate: &108ImportTemplate !!js/function >\n () => 'use mongodb::bson::Bson;'\n 109ImportTemplate: &109ImportTemplate !!js/function >\n () => 'use mongodb::bson::Regex;'\n 110ImportTemplate: &110ImportTemplate !!js/function >\n () => 'use mongodb::bson::Timestamp;'\n 111ImportTemplate: &111ImportTemplate null\n 112ImportTemplate: &112ImportTemplate null\n 113ImportTemplate: &113ImportTemplate !!js/function >\n () => 'use mongodb::bson::JavaScriptCodeWithScope;'\n 114ImportTemplate: &114ImportTemplate !!js/function >\n () => 'use mongodb::bson::spec::BinarySubtype;'\n 200ImportTemplate: &200ImportTemplate !!js/function >\n () => 'use mongodb::bson::DateTime;'\n 201ImportTemplate: &201ImportTemplate null\n 300ImportTemplate: &300ImportTemplate null\n 301ImportTemplate: &301ImportTemplate null\n 302ImportTemplate: &302ImportTemplate null\n 303ImportTemplate: &303ImportTemplate null\n 304ImportTemplate: &304ImportTemplate null\n 305ImportTemplate: &305ImportTemplate null\n 306ImportTemplate: &306ImportTemplate null\n# Universal types\n# Everything inherits from StringType because we haven't implemented any of them.\nBasicTypes:\n # Universal basic types\n _bool: &BoolType\n <<: *__type\n id: \"_bool\"\n code: 0\n template: *BoolTypeTemplate\n _integer: &IntegerType\n <<: *__type\n id: \"_integer\"\n code: 1\n template: *IntegerTypeTemplate\n _long: &LongBasicType\n <<: *__type\n id: \"_long\"\n code: 2\n template: *LongBasicTypeTemplate\n _decimal: &DecimalType\n <<: *__type\n id: \"_decimal\"\n code: 3\n template: *DecimalTypeTemplate\n _hex: &HexType\n <<: *__type\n id: \"_hex\"\n code: 4\n template: *HexTypeTemplate\n _octal: &OctalType\n <<: *__type\n id: \"_octal\"\n code: 5\n template: *OctalTypeTemplate\n _numeric: &NumericType\n <<: *__type\n id: \"_numeric\"\n code: 6\n template: *NumericTypeTemplate\n _string: &StringType\n <<: *__type\n id: \"_string\"\n code: 7\n template: *StringTypeTemplate\n _regex: &RegexType\n <<: *__type\n id: \"_regex\"\n code: 8\n template: *RegexTypeTemplate\n _array: &ArrayType\n <<: *__type\n id: \"_array\"\n code: 9\n template: *ArrayTypeTemplate\n argsTemplate: *ArrayTypeArgsTemplate\n _object: &ObjectType\n <<: *__type\n id: \"_object\"\n code: 10\n template: *ObjectTypeTemplate\n argsTemplate: *ObjectTypeArgsTemplate\n _null: &NullType\n <<: *__type\n id: \"_null\"\n code: 11\n template: *NullTypeTemplate\n _undefined: &UndefinedType\n <<: *__type\n id: \"_undefined\"\n code: 12\n template: *UndefinedTypeTemplate\n\nSyntax:\n equality:\n template: *EqualitySyntaxTemplate\n in:\n template: *InSyntaxTemplate\n and:\n template: *AndSyntaxTemplate\n or:\n template: *OrSyntaxTemplate\n not:\n template: *NotSyntaxTemplate\n unary:\n template: *UnarySyntaxTemplate\n binary:\n template: *BinarySyntaxTemplate\n parens:\n template: *ParensSyntaxTemplate\n eos:\n template: *EosSyntaxTemplate\n eof:\n template: *EofSyntaxTemplate\n # The new template takes in expr, and an optional skip argument and optional\n # id argument. The skip argument is a boolean that if true then doesn't add\n # new. The code argument is the symbol code being called. The template will check\n # if it is an exception, i.e. a type that is a constructor but may not use new.\n new:\n template: *NewSyntaxTemplate\n # The regex flags that change symbols between languages can be defined here.\n # Flags that aren't defined can be left blank and will be ignored.\n regexFlags: *RegexFlags\n bsonRegexFlags: *BSONRegexFlags\n driver: *DriverTemplate\nImports:\n import:\n template: *ImportTemplate\n driver:\n template: *DriverImportTemplate\n 0:\n template: *0ImportTemplate\n 1:\n template: *1ImportTemplate\n 2:\n template: *2ImportTemplate\n 3:\n template: *3ImportTemplate\n 4:\n template: *4ImportTemplate\n 5:\n template: *5ImportTemplate\n 6:\n template: *6ImportTemplate\n 7:\n template: *7ImportTemplate\n 8:\n template: *8ImportTemplate\n 9:\n template: *9ImportTemplate\n 10:\n template: *10ImportTemplate\n 11:\n template: *11ImportTemplate\n 12:\n template: *12ImportTemplate\n 100:\n template: *100ImportTemplate\n 101:\n template: *101ImportTemplate\n 102:\n template: *102ImportTemplate\n 103:\n template: *103ImportTemplate\n 104:\n template: *104ImportTemplate\n 105:\n template: *105ImportTemplate\n 106:\n template: *106ImportTemplate\n 107:\n template: *107ImportTemplate\n 108:\n template: *108ImportTemplate\n 109:\n template: *109ImportTemplate\n 110:\n template: *110ImportTemplate\n 111:\n template: *111ImportTemplate\n 112:\n template: *112ImportTemplate\n 113:\n template: *113ImportTemplate\n 114:\n template: *114ImportTemplate\n 200:\n template: *200ImportTemplate\n 201:\n template: *201ImportTemplate\n 300:\n template: *300ImportTemplate\n 301:\n template: *301ImportTemplate\n 302:\n template: *302ImportTemplate\n 303:\n template: *303ImportTemplate\n 304:\n template: *304ImportTemplate\n 305:\n template: *305ImportTemplate\n 306:\n template: *306ImportTemplate\nBsonTypes:\n Code: &CodeType\n <<: *__type\n id: \"Code\"\n code: 100\n type: *ObjectType\n attr:\n code:\n callable: *var\n args: null\n attr: null\n id: \"code\"\n type: *StringType\n template: *CodeCodeTemplate\n argsTemplate: *CodeCodeArgsTemplate\n scope:\n callable: *var\n args: null\n attr: null\n id: \"scope\"\n type: *StringType\n template: *CodeScopeTemplate\n argsTemplate: *CodeScopeArgsTemplate\n ObjectId: &ObjectIdType\n <<: *__type\n id: \"ObjectId\"\n code: 101\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *ObjectIdToStringTemplate\n argsTemplate: *ObjectIdToStringArgsTemplate\n equals:\n <<: *__func\n id: \"equals\"\n args:\n - [ \"ObjectId\" ]\n type: *BoolType\n template: *ObjectIdEqualsTemplate\n argsTemplate: *ObjectIdEqualsArgsTemplate\n getTimestamp:\n <<: *__func\n id: \"getTimestamp\"\n type: *IntegerType\n template: *ObjectIdGetTimestampTemplate\n argsTemplate: *ObjectIdGetTimestampArgsTemplate\n BinData: &BinaryType\n <<: *__type\n id: \"BinData\"\n code: 102\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *BinaryToStringTemplate\n argsTemplate: *BinaryToStringArgsTemplate\n base64:\n <<: *__func\n id: \"base64\"\n type: *StringType\n template: *BinaryValueTemplate\n argsTemplate: *BinaryValueArgsTemplate\n length:\n <<: *__func\n id: \"length\"\n type: *IntegerType\n template: *BinaryLengthTemplate\n argsTemplate: *BinaryLengthArgsTemplate\n subtype:\n <<: *__func\n id: \"subtype\"\n type: *IntegerType\n template: *BinarySubtypeTemplate\n argsTemplate: *BinarySubtypeArgsTemplate\n DBRef: &DBRefType\n <<: *__type\n id: \"DBRef\"\n code: 103\n type: *ObjectType\n attr:\n getDb:\n <<: *__func\n id: \"getDb\"\n type: *StringType\n template: *DBRefGetDBTemplate\n argsTemplate: *DBRefGetDBArgsTemplate\n $db:\n callable: *var\n args: null\n attr: null\n id: \"$db\"\n type: *StringType\n template: *DBRefGetDBTemplate\n argsTemplate: *DBRefGetDBArgsTemplate\n getCollection:\n <<: *__func\n id: \"getCollection\"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n getRef:\n <<: *__func\n id: \"getRef\"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n $ref:\n callable: *var\n args: null\n attr: null\n id: \"$ref\"\n type: *StringType\n template: *DBRefGetCollectionTemplate\n argsTemplate: *DBRefGetCollectionArgsTemplate\n getId:\n <<: *__func\n id: \"getId\"\n type: *StringType\n template: *DBRefGetIdTemplate\n argsTemplate: *DBRefGetIdArgsTemplate\n $id:\n callable: *var\n args: null\n attr: null\n id: \"$id\"\n type: *StringType\n template: *DBRefGetIdTemplate\n argsTemplate: *DBRefGetIdArgsTemplate\n NumberInt: &Int32Type\n <<: *__type\n id: \"NumberInt\"\n code: 105\n type: *ObjectType\n attr: {}\n NumberLong: &LongType\n <<: *__type\n id: \"NumberLong\"\n code: 106\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"LongtoString\" # Needs process method\n args:\n - [ *IntegerType, null ]\n type: *StringType\n template: *LongToStringTemplate\n argsTemplate: *LongToStringArgsTemplate\n equals:\n <<: *__func\n id: \"equals\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongEqualsTemplate\n argsTemplate: *LongEqualsArgsTemplate\n toInt:\n <<: *__func\n id: \"toInt\"\n type: *IntegerType\n template: *LongToIntTemplate\n argsTemplate: *LongToIntArgsTemplate\n toNumber:\n <<: *__func\n id: \"toNumber\"\n type: *DecimalType\n template: *LongToNumberTemplate\n argsTemplate: *LongToNumberArgsTemplate\n compare:\n <<: *__func\n id: \"compare\"\n args:\n - [ \"Long\" ]\n type: *StringType\n template: *LongCompareTemplate\n argsTemplate: *LongCompareArgsTemplate\n isOdd:\n <<: *__func\n id: \"isOdd\"\n type: *BoolType\n template: *LongIsOddTemplate\n argsTemplate: *LongIsOddArgsTemplate\n isZero:\n <<: *__func\n id: \"isZero\"\n type: *BoolType\n template: *LongIsZeroTemplate\n argsTemplate: *LongIsZeroArgsTemplate\n isNegative:\n <<: *__func\n id: \"isNegative\"\n type: *BoolType\n template: *LongIsNegativeTemplate\n argsTemplate: *LongIsNegativeArgsTemplate\n negate:\n <<: *__func\n id: \"negate\"\n type: \"Long\"\n template: *LongNegateTemplate\n argsTemplate: *LongNegateArgsTemplate\n not:\n <<: *__func\n id: \"not\"\n type: \"Long\"\n template: *LongNotTemplate\n argsTemplate: *LongNotArgsTemplate\n notEquals:\n <<: *__func\n id: \"notEquals\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongNotEqualsTemplate\n argsTemplate: *LongNotEqualsArgsTemplate\n greaterThan:\n <<: *__func\n id: \"greaterThan\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongGreaterThanTemplate\n argsTemplate: *LongGreaterThanArgsTemplate\n greaterThanOrEqual:\n <<: *__func\n id: \"greaterThanOrEqual\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongGreaterThanOrEqualTemplate\n argsTemplate: *LongGreaterThanOrEqualArgsTemplate\n lessThan:\n <<: *__func\n id: \"lessThan\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongLessThanTemplate\n argsTemplate: *LongLessThanArgsTemplate\n lessThanOrEqual:\n <<: *__func\n id: \"lessThanOrEqual\"\n args:\n - [ \"Long\" ]\n type: *BoolType\n template: *LongLessThanOrEqualTemplate\n argsTemplate: *LongLessThanOrEqualArgsTemplate\n add:\n <<: *__func\n id: \"add\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongAddTemplate\n argsTemplate: *LongAddArgsTemplate\n subtract:\n <<: *__func\n id: \"subtract\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongSubtractTemplate\n argsTemplate: *LongSubtractArgsTemplate\n multiply:\n <<: *__func\n id: \"multiply\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongMultiplyTemplate\n argsTemplate: *LongMultiplyArgsTemplate\n div:\n <<: *__func\n id: \"div\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongDivTemplate\n argsTemplate: *LongDivArgsTemplate\n modulo:\n <<: *__func\n id: \"modulo\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongModuloTemplate\n argsTemplate: *LongModuloArgsTemplate\n and:\n <<: *__func\n id: \"and\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongAndTemplate\n argsTemplate: *LongAndArgsTemplate\n or:\n <<: *__func\n id: \"or\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongOrTemplate\n argsTemplate: *LongOrArgsTemplate\n xor:\n <<: *__func\n id: \"xor\"\n args:\n - [ \"Long\" ]\n type: \"Long\"\n template: *LongXorTemplate\n argsTemplate: *LongXorArgsTemplate\n shiftLeft:\n <<: *__func\n id: \"shiftLeft\"\n args:\n - [ *IntegerType ]\n type: \"Long\"\n template: *LongShiftLeftTemplate\n argsTemplate: *LongShiftLeftArgsTemplate\n shiftRight:\n <<: *__func\n id: \"shiftRight\"\n args:\n - [ *IntegerType ]\n type: \"Long\"\n template: *LongShiftRightTemplate\n argsTemplate: *LongShiftRightArgsTemplate\n MinKeyType: &MinKeyType\n <<: *__type\n id: \"MinKey\"\n code: 107\n type: *ObjectType\n MaxKeyType: &MaxKeyType\n <<: *__type\n id: \"MaxKey\"\n code: 108\n type: *ObjectType\n Timestamp: &TimestampType\n <<: *__type\n id: \"Timestamp\"\n code: 110\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *TimestampToStringTemplate\n argsTemplate: *TimestampToStringArgsTemplate\n equals:\n <<: *__func\n id: \"equals\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampEqualsTemplate\n argsTemplate: *TimestampEqualsArgsTemplate\n getLowBits:\n <<: *__func\n id: \"getLowBits\"\n type: *IntegerType\n template: *TimestampGetLowBitsTemplate\n argsTemplate: *TimestampGetLowBitsArgsTemplate\n getHighBits:\n <<: *__func\n id: \"getHighBits\"\n type: *IntegerType\n template: *TimestampGetHighBitsTemplate\n argsTemplate: *TimestampGetHighBitsArgsTemplate\n compare:\n <<: *__func\n id: \"compare\"\n args:\n - [ \"Timestamp\" ]\n type: *StringType\n template: *TimestampCompareTemplate\n argsTemplate: *TimestampCompareArgsTemplate\n notEquals:\n <<: *__func\n id: \"notEquals\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampNotEqualsTemplate\n argsTemplate: *TimestampNotEqualsArgsTemplate\n greaterThan:\n <<: *__func\n id: \"greaterThan\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampGreaterThanTemplate\n argsTemplate: *TimestampGreaterThanArgsTemplate\n greaterThanOrEqual:\n <<: *__func\n id: \"greaterThanOrEqual\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampGreaterThanOrEqualTemplate\n argsTemplate: *TimestampGreaterThanOrEqualArgsTemplate\n lessThan:\n <<: *__func\n id: \"lessThan\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampLessThanTemplate\n argsTemplate: *TimestampLessThanArgsTemplate\n lessThanOrEqual:\n <<: *__func\n id: \"lessThanOrEqual\"\n args:\n - [ \"Timestamp\" ]\n type: *BoolType\n template: *TimestampLessThanOrEqualTemplate\n argsTemplate: *TimestampLessThanOrEqualArgsTemplate\n BSONSymbol: &SymbolType\n <<: *__type\n id: \"BSONSymbol\"\n code: 111\n type: *ObjectType\n attr:\n valueOf:\n <<: *__func\n id: \"valueOf\"\n type: *StringType\n template: *SymbolValueOfTemplate\n argsTemplate: *SymbolValueOfArgsTemplate\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *SymbolToStringTemplate\n argsTemplate: *SymbolToStringArgsTemplate\n inspect:\n <<: *__func\n id: \"inspect\"\n type: *StringType\n template: *SymbolInspectTemplate\n argsTemplate: *SymbolInspectArgsTemplate\n Double: &DoubleType\n <<: *__type\n id: \"Double\"\n code: 104\n type: *ObjectType\n attr: {}\n Decimal128: &Decimal128Type\n <<: *__type\n id: \"Decimal128\"\n code: 112\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *Decimal128ToStringTemplate\n argsTemplate: *Decimal128ToStringArgsTemplate\n NumberDecimal: &NumberDecimalType\n <<: *__type\n id: \"NumberDecimal\"\n code: 112\n type: *ObjectType\n attr:\n toString:\n <<: *__func\n id: \"toString\"\n type: *StringType\n template: *Decimal128ToStringTemplate\n argsTemplate: *Decimal128ToStringArgsTemplate\n\n\n SUBTYPE_DEFAULT:\n id: \"SUBTYPE_DEFAULT\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeDefaultTemplate\n SUBTYPE_FUNCTION:\n id: \"SUBTYPE_FUNCTION\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeFunctionTemplate\n SUBTYPE_BYTE_ARRAY:\n id: \"SUBTYPE_BYTE_ARRAY\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeByteArrayTemplate\n SUBTYPE_UUID_OLD:\n id: \"SUBTYPE_UUID_OLD\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUuidOldTemplate\n SUBTYPE_UUID:\n id: \"SUBTYPE_UUID\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUuidTemplate\n SUBTYPE_MD5:\n id: \"SUBTYPE_MD5\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeMd5Template\n SUBTYPE_USER_DEFINED:\n id: \"SUBTYPE_USER_DEFINED\"\n callable: *var\n args: null\n code: 113\n type: *IntegerType\n template: *BinarySymbolSubtypeUserDefinedTemplate\n BSONRegExpType: &BSONRegExpType\n <<: *__type\n id: \"BSONRegExp\"\n code: 109\n type: *ObjectType\nNativeTypes:\n Date: &DateType\n <<: *__type\n id: \"Date\"\n code: 200\n type: *ObjectType\n attr: {} # TODO: no built-in date methods added yet\n RegExp: &RegExpType\n <<: *__type\n id: \"RegExp\"\n code: 8\n type: *ObjectType\n attr: {}\n\n\nBsonSymbols:\n Code: &CodeSymbol\n id: \"Code\"\n code: 100\n callable: *constructor\n args:\n - [ *StringType, null ]\n - [ *ObjectType, null ]\n type: *CodeType\n attr: {}\n template: *CodeSymbolTemplate\n argsTemplate: *CodeSymbolArgsTemplate\n ObjectId: &ObjectIdSymbol\n id: \"ObjectId\"\n code: 101\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n type: *ObjectIdType\n attr:\n createFromHexString:\n <<: *__func\n id: \"createFromHexString\"\n args:\n - [ *StringType ]\n type: *ObjectIdType\n template: *ObjectIdCreateFromHexStringTemplate\n argsTemplate: *ObjectIdCreateFromHexStringArgsTemplate\n createFromTime:\n <<: *__func\n id: \"ObjectIdCreateFromTime\"\n args:\n - [ *NumericType, *DateType ]\n type: *ObjectIdType\n template: *ObjectIdCreateFromTimeTemplate\n argsTemplate: *ObjectIdCreateFromTimeArgsTemplate\n isValid:\n <<: *__func\n id: \"isValid\"\n args:\n - [ *StringType ]\n type: *BoolType\n template: *ObjectIdIsValidTemplate\n argsTemplate: *ObjectIdIsValidArgsTemplate\n template: *ObjectIdSymbolTemplate\n argsTemplate: *ObjectIdSymbolArgsTemplate\n BinData: &BinarySymbol\n id: \"BinData\"\n code: 102\n callable: *constructor\n args:\n - [ *IntegerType ]\n - [ *StringType ]\n type: *BinaryType\n attr: {}\n template: *BinarySymbolTemplate\n argsTemplate: *BinarySymbolArgsTemplate\n DBRef:\n id: \"DBRef\"\n code: 103\n callable: *constructor\n args:\n - [ *StringType ]\n - [ *ObjectIdType ]\n - [ *StringType, null ]\n type: *DBRefType\n attr: {}\n template: *DBRefSymbolTemplate\n argsTemplate: *DBRefSymbolArgsTemplate\n NumberInt:\n id: \"Int32\"\n code: 105\n callable: *constructor\n args:\n - [ *NumericType, *StringType, null ]\n type: *Int32Type\n attr: {}\n template: *Int32SymbolTemplate\n argsTemplate: *Int32SymbolArgsTemplate\n NumberLong:\n id: \"NumberLong\"\n code: 106\n callable: *constructor\n args:\n - [ *IntegerType, *StringType, null ]\n type: *LongType\n attr: {}\n template: *LongSymbolTemplate\n argsTemplate: *LongSymbolArgsTemplate\n MinKey:\n id: \"MinKey\"\n code: 107\n callable: *constructor\n args: []\n type: *MinKeyType\n attr: {}\n template: *MinKeySymbolTemplate\n argsTemplate: *MinKeySymbolArgsTemplate\n MaxKey:\n id: \"MaxKey\"\n code: 108\n callable: *constructor\n args: []\n type: *MaxKeyType\n attr: {}\n template: *MaxKeySymbolTemplate\n argsTemplate: *MaxKeySymbolArgsTemplate\n Timestamp:\n id: \"Timestamp\"\n code: 110\n callable: *constructor\n args:\n - [ *IntegerType, null ]\n - [ *IntegerType, null ]\n type: *TimestampType\n attr: {}\n template: *TimestampSymbolTemplate\n argsTemplate: *TimestampSymbolArgsTemplate\n Symbol:\n id: \"Symbol\"\n code: 111\n callable: *constructor\n args:\n - [ *StringType ]\n type: *SymbolType\n attr: {}\n template: *SymbolSymbolTemplate\n argsTemplate: *SymbolSymbolArgsTemplate\n NumberDecimal:\n id: \"NumberDecimal\"\n code: 112\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n type: *Decimal128Type\n attr: {}\n template: *Decimal128SymbolTemplate\n argsTemplate: *Decimal128SymbolArgsTemplate\n BSONRegExp:\n id: \"BSONRegExp\"\n code: 109\n callable: *constructor\n args:\n - [ *StringType ]\n - [ *StringType, null ]\n type: *BSONRegExpType\n attr: {}\n template: *BSONRegExpSymbolTemplate\n argsTemplate: *BSONRegExpSymbolArgsTemplate\n BSONSymbol:\n id: \"BSONSymbol\"\n code: 111\n callable: *constructor\n args:\n - [ *StringType ]\n type: *SymbolType\n attr: {}\n template: *SymbolSymbolTemplate\n argsTemplate: *SymbolSymbolArgsTemplate\n Decimal128:\n id: \"Decimal128\"\n code: 112\n callable: *constructor\n args:\n - [ *ObjectType ]\n type: *Decimal128Type\n attr:\n fromString:\n id: \"fromString\"\n callable: *func\n args:\n - [ *StringType ]\n type: *Decimal128Type\n attr: {}\n template: *Decimal128SymbolFromStringTemplate\n argsTemplate: *Decimal128SymbolFromStringArgsTemplate\n template: *Decimal128SymbolTemplate\n argsTemplate: *Decimal128SymbolArgsTemplate\n Double:\n id: \"Double\"\n code: 104\n callable: *constructor\n args:\n - [ *NumericType, *StringType ]\n type: *DoubleType\n attr: {}\n template: *DoubleSymbolTemplate\n argsTemplate: *DoubleSymbolArgsTemplate\n Int32:\n id: \"Int32\"\n code: 105\n callable: *constructor\n args:\n - [ *NumericType, *StringType ]\n type: *Int32Type\n attr: {}\n template: *Int32SymbolTemplate\n argsTemplate: *Int32SymbolArgsTemplate\n Long:\n id: \"Long\"\n code: 106\n callable: *constructor\n args:\n - [ *IntegerType ]\n - [ *IntegerType ]\n type: *LongType\n attr:\n MAX_VALUE:\n id: \"MAX_VALUE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolMaxTemplate\n argsTemplate: *LongSymbolMaxArgsTemplate\n MIN_VALUE:\n id: \"MIN_VALUE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolMinTemplate\n argsTemplate: *LongSymbolMinArgsTemplate\n ZERO:\n id: \"ZERO\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolZeroTemplate\n argsTemplate: *LongSymbolZeroArgsTemplate\n ONE:\n id: \"ONE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolOneTemplate\n argsTemplate: *LongSymbolOneArgsTemplate\n NEG_ONE:\n id: \"NEG_ONE\"\n callable: *var\n args: null\n type: *LongType\n attr: {}\n template: *LongSymbolNegOneTemplate\n argsTemplate: *LongSymbolNegOneArgsTemplate\n fromBits:\n id: \"LongfromBits\" # Needs process method\n callable: *func\n args:\n - [ *IntegerType ]\n - [ *IntegerType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromBitsTemplate\n argsTemplate: *LongSymbolFromBitsArgsTemplate\n fromInt:\n id: \"fromInt\"\n callable: *func\n args:\n - [ *IntegerType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromIntTemplate\n argsTemplate: *LongSymbolFromIntArgsTemplate\n fromNumber:\n id: \"fromNumber\"\n callable: *func\n args:\n - [ *NumericType ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromNumberTemplate\n argsTemplate: *LongSymbolFromNumberArgsTemplate\n fromString:\n id: \"fromString\"\n callable: *func\n args:\n - [ *StringType ]\n - [ *IntegerType, null ]\n type: *LongType\n attr: {}\n template: *LongSymbolFromStringTemplate\n argsTemplate: *LongSymbolFromStringArgsTemplate\n template: *LongSymbolTemplate\n argsTemplate: *LongSymbolArgsTemplate\n\nNativeSymbols:\n Number:\n id: \"Number\"\n code: 2\n callable: *constructor\n args:\n - [ *IntegerType, *StringType, null ]\n type: *NumericType\n attr: {} # TODO: no built-in number funcs added yet\n template: *NumberSymbolTemplate\n argsTemplate: *NumberSymbolArgsTemplate\n Date: # Needs emit method\n id: \"Date\"\n code: 200\n callable: *constructor\n args:\n - [ *StringType, *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n - [ *NumericType, null ]\n type: *DateType\n attr: # TODO: add more date funcs?\n now:\n id: \"now\"\n code: 200.1\n callable: *func\n args: []\n type: *DateType\n attr: {}\n template: *DateSymbolNowTemplate\n argsTemplate: *DateSymbolNowArgsTemplate\n template: *DateSymbolTemplate\n argsTemplate: *DateSymbolArgsTemplate\n ISODate: # Needs emit method\n id: \"ISODate\"\n code: 200\n callable: *constructor\n args:\n - [ *StringType, null ]\n type: *DateType\n attr:\n now:\n id: \"now\"\n callable: *constructor\n args: []\n type: *DateType\n attr: {}\n template: *DateSymbolNowTemplate\n argsTemplate: *DateSymbolNowArgsTemplate\n template: *DateSymbolTemplate\n argsTemplate: *DateSymbolArgsTemplate\n RegExp: # Needs process method\n id: \"RegExp\"\n code: 8\n callable: *constructor\n args:\n - [ *StringType, *RegexType ]\n - [ *StringType, null ]\n type: *RegExpType\n attr: {} # TODO: no built-in regex funcs added yet\n template: *RegExpSymbolTemplate\n argsTemplate: *RegExpSymbolArgsTemplate\n\n"},3724:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o,promises:()=>r,readFileSync:()=>i,rmSync:()=>a});const r={chmod:()=>Promise.resolve(),access:()=>Promise.reject(new Error("Not supported in browser environment")),readFile:()=>Promise.reject(new Error("Not supported in browser environment"))};function a(){}function i(){}const o={promises:r,rmSync:a,readFileSync:i}},6345:(e,t,n)=>{var r=n(2792).Token,a=n(4479).Lexer,i=n(3922).Interval;function o(){return this}function s(e){return o.call(this),this.tokenSource=e,this.tokens=[],this.index=-1,this.fetchedEOF=!1,this}s.prototype=Object.create(o.prototype),s.prototype.constructor=s,s.prototype.mark=function(){return 0},s.prototype.release=function(e){},s.prototype.reset=function(){this.seek(0)},s.prototype.seek=function(e){this.lazyInit(),this.index=this.adjustSeekIndex(e)},s.prototype.get=function(e){return this.lazyInit(),this.tokens[e]},s.prototype.consume=function(){if(!(this.index>=0&&(this.fetchedEOF?this.index<this.tokens.length-1:this.index<this.tokens.length))&&this.LA(1)===r.EOF)throw"cannot consume EOF";this.sync(this.index+1)&&(this.index=this.adjustSeekIndex(this.index+1))},s.prototype.sync=function(e){var t=e-this.tokens.length+1;return!(t>0)||this.fetch(t)>=t},s.prototype.fetch=function(e){if(this.fetchedEOF)return 0;for(var t=0;t<e;t++){var n=this.tokenSource.nextToken();if(n.tokenIndex=this.tokens.length,this.tokens.push(n),n.type===r.EOF)return this.fetchedEOF=!0,t+1}return e},s.prototype.getTokens=function(e,t,n){if(void 0===n&&(n=null),e<0||t<0)return null;this.lazyInit();var a=[];t>=this.tokens.length&&(t=this.tokens.length-1);for(var i=e;i<t;i++){var o=this.tokens[i];if(o.type===r.EOF)break;(null===n||n.contains(o.type))&&a.push(o)}return a},s.prototype.LA=function(e){return this.LT(e).type},s.prototype.LB=function(e){return this.index-e<0?null:this.tokens[this.index-e]},s.prototype.LT=function(e){if(this.lazyInit(),0===e)return null;if(e<0)return this.LB(-e);var t=this.index+e-1;return this.sync(t),t>=this.tokens.length?this.tokens[this.tokens.length-1]:this.tokens[t]},s.prototype.adjustSeekIndex=function(e){return e},s.prototype.lazyInit=function(){-1===this.index&&this.setup()},s.prototype.setup=function(){this.sync(0),this.index=this.adjustSeekIndex(0)},s.prototype.setTokenSource=function(e){this.tokenSource=e,this.tokens=[],this.index=-1,this.fetchedEOF=!1},s.prototype.nextTokenOnChannel=function(e,t){if(this.sync(e),e>=this.tokens.length)return-1;for(var n=this.tokens[e];n.channel!==this.channel;){if(n.type===r.EOF)return-1;e+=1,this.sync(e),n=this.tokens[e]}return e},s.prototype.previousTokenOnChannel=function(e,t){for(;e>=0&&this.tokens[e].channel!==t;)e-=1;return e},s.prototype.getHiddenTokensToRight=function(e,t){if(void 0===t&&(t=-1),this.lazyInit(),e<0||e>=this.tokens.length)throw e+" not in 0.."+this.tokens.length-1;var n=this.nextTokenOnChannel(e+1,a.DEFAULT_TOKEN_CHANNEL),r=e+1,i=-1===n?this.tokens.length-1:n;return this.filterForChannel(r,i,t)},s.prototype.getHiddenTokensToLeft=function(e,t){if(void 0===t&&(t=-1),this.lazyInit(),e<0||e>=this.tokens.length)throw e+" not in 0.."+this.tokens.length-1;var n=this.previousTokenOnChannel(e-1,a.DEFAULT_TOKEN_CHANNEL);if(n===e-1)return null;var r=n+1,i=e-1;return this.filterForChannel(r,i,t)},s.prototype.filterForChannel=function(e,t,n){for(var r=[],i=e;i<t+1;i++){var o=this.tokens[i];-1===n?o.channel!==a.DEFAULT_TOKEN_CHANNEL&&r.push(o):o.channel===n&&r.push(o)}return 0===r.length?null:r},s.prototype.getSourceName=function(){return this.tokenSource.getSourceName()},s.prototype.getText=function(e){this.lazyInit(),this.fill(),null==e&&(e=new i(0,this.tokens.length-1));var t=e.start;t instanceof r&&(t=t.tokenIndex);var n=e.stop;if(n instanceof r&&(n=n.tokenIndex),null===t||null===n||t<0||n<0)return"";n>=this.tokens.length&&(n=this.tokens.length-1);for(var a="",o=t;o<n+1;o++){var s=this.tokens[o];if(s.type===r.EOF)break;a+=s.text}return a},s.prototype.fill=function(){for(this.lazyInit();1e3===this.fetch(1e3););},t.f=s},1792:(e,t,n)=>{var r=n(1989).InputStream,a="undefined"==typeof window&&"undefined"==typeof importScripts?n(3724):null,i={fromString:function(e){return new r(e,!0)},fromBlob:function(e,t,n,a){var i=FileReader();i.onload=function(e){var t=new r(e.target.result,!0);n(t)},i.onerror=a,i.readAsText(e,t)},fromBuffer:function(e,t){return new r(e.toString(t),!0)},fromPath:function(e,t,n){a.readFile(e,t,(function(e,t){var a=null;null!==t&&(a=new r(t,!0)),n(e,a)}))},fromPathSync:function(e,t){var n=a.readFileSync(e,t);return new r(n,!0)}};t.CharStreams=i},4965:(e,t,n)=>{var r=n(2792).CommonToken;function a(){return this}function i(e){return a.call(this),this.copyText=void 0!==e&&e,this}i.prototype=Object.create(a.prototype),i.prototype.constructor=i,i.DEFAULT=new i,i.prototype.create=function(e,t,n,a,i,o,s,l){var p=new r(e,t,a,i,o);return p.line=s,p.column=l,null!==n?p.text=n:this.copyText&&null!==e[1]&&(p.text=e[1].getText(i,o)),p},i.prototype.createThin=function(e,t){var n=new r(null,e);return n.text=t,n},t.p=i},443:(e,t,n)=>{var r=n(2792).Token,a=n(6345).f;function i(e,t){return a.call(this,e),this.channel=void 0===t?r.DEFAULT_CHANNEL:t,this}i.prototype=Object.create(a.prototype),i.prototype.constructor=i,i.prototype.adjustSeekIndex=function(e){return this.nextTokenOnChannel(e,this.channel)},i.prototype.LB=function(e){if(0===e||this.index-e<0)return null;for(var t=this.index,n=1;n<=e;)t=this.previousTokenOnChannel(t-1,this.channel),n+=1;return t<0?null:this.tokens[t]},i.prototype.LT=function(e){if(this.lazyInit(),0===e)return null;if(e<0)return this.LB(-e);for(var t=this.index,n=1;n<e;)this.sync(t+1)&&(t=this.nextTokenOnChannel(t+1,this.channel)),n+=1;return this.tokens[t]},i.prototype.getNumberOfOnChannelTokens=function(){var e=0;this.fill();for(var t=0;t<this.tokens.length;t++){var n=this.tokens[t];if(n.channel===this.channel&&(e+=1),n.type===r.EOF)break}return e},t.CommonTokenStream=i},4295:(e,t,n)=>{var r=n(1989).InputStream,a="undefined"==typeof window&&"undefined"==typeof importScripts?n(3724):null;function i(e,t){var n=a.readFileSync(e,"utf8");return r.call(this,n,t),this.fileName=e,this}i.prototype=Object.create(r.prototype),i.prototype.constructor=i,t.FileStream=i},1989:(e,t,n)=>{var r=n(2792).Token;function a(e,t){return this.name="<empty>",this.strdata=e,this.decodeToUnicodeCodePoints=t||!1,function(e){if(e._index=0,e.data=[],e.decodeToUnicodeCodePoints)for(var t=0;t<e.strdata.length;){var n=e.strdata.codePointAt(t);e.data.push(n),t+=n<=65535?1:2}else for(t=0;t<e.strdata.length;t++){var r=e.strdata.charCodeAt(t);e.data.push(r)}e._size=e.data.length}(this),this}n(4618),n(3591),Object.defineProperty(a.prototype,"index",{get:function(){return this._index}}),Object.defineProperty(a.prototype,"size",{get:function(){return this._size}}),a.prototype.reset=function(){this._index=0},a.prototype.consume=function(){if(this._index>=this._size)throw"cannot consume EOF";this._index+=1},a.prototype.LA=function(e){if(0===e)return 0;e<0&&(e+=1);var t=this._index+e-1;return t<0||t>=this._size?r.EOF:this.data[t]},a.prototype.LT=function(e){return this.LA(e)},a.prototype.mark=function(){return-1},a.prototype.release=function(e){},a.prototype.seek=function(e){e<=this._index?this._index=e:this._index=Math.min(e,this._size)},a.prototype.getText=function(e,t){if(t>=this._size&&(t=this._size-1),e>=this._size)return"";if(this.decodeToUnicodeCodePoints){for(var n="",r=e;r<=t;r++)n+=String.fromCodePoint(this.data[r]);return n}return this.strdata.slice(e,t+1)},a.prototype.toString=function(){return this.strdata},t.InputStream=a},3922:(e,t,n)=>{var r=n(2792).Token;function a(e,t){return this.start=e,this.stop=t,this}function i(){this.intervals=null,this.readOnly=!1}a.prototype.contains=function(e){return e>=this.start&&e<this.stop},a.prototype.toString=function(){return this.start===this.stop-1?this.start.toString():this.start.toString()+".."+(this.stop-1).toString()},Object.defineProperty(a.prototype,"length",{get:function(){return this.stop-this.start}}),i.prototype.first=function(e){return null===this.intervals||0===this.intervals.length?r.INVALID_TYPE:this.intervals[0].start},i.prototype.addOne=function(e){this.addInterval(new a(e,e+1))},i.prototype.addRange=function(e,t){this.addInterval(new a(e,t+1))},i.prototype.addInterval=function(e){if(null===this.intervals)this.intervals=[],this.intervals.push(e);else{for(var t=0;t<this.intervals.length;t++){var n=this.intervals[t];if(e.stop<n.start)return void this.intervals.splice(t,0,e);if(e.stop===n.start)return void(this.intervals[t].start=e.start);if(e.start<=n.stop)return this.intervals[t]=new a(Math.min(n.start,e.start),Math.max(n.stop,e.stop)),void this.reduce(t)}this.intervals.push(e)}},i.prototype.addSet=function(e){if(null!==e.intervals)for(var t=0;t<e.intervals.length;t++){var n=e.intervals[t];this.addInterval(new a(n.start,n.stop))}return this},i.prototype.reduce=function(e){if(e<this.intervalslength-1){var t=this.intervals[e],n=this.intervals[e+1];t.stop>=n.stop?(this.intervals.pop(e+1),this.reduce(e)):t.stop>=n.start&&(this.intervals[e]=new a(t.start,n.stop),this.intervals.pop(e+1))}},i.prototype.complement=function(e,t){var n=new i;n.addInterval(new a(e,t+1));for(var r=0;r<this.intervals.length;r++)n.removeRange(this.intervals[r]);return n},i.prototype.contains=function(e){if(null===this.intervals)return!1;for(var t=0;t<this.intervals.length;t++)if(this.intervals[t].contains(e))return!0;return!1},Object.defineProperty(i.prototype,"length",{get:function(){var e=0;return this.intervals.map((function(t){e+=t.length})),e}}),i.prototype.removeRange=function(e){if(e.start===e.stop-1)this.removeOne(e.start);else if(null!==this.intervals)for(var t=0,n=0;n<this.intervals.length;n++){var r=this.intervals[t];if(e.stop<=r.start)return;if(e.start>r.start&&e.stop<r.stop){this.intervals[t]=new a(r.start,e.start);var i=new a(e.stop,r.stop);return void this.intervals.splice(t,0,i)}e.start<=r.start&&e.stop>=r.stop?(this.intervals.splice(t,1),t-=1):e.start<r.stop?this.intervals[t]=new a(r.start,e.start):e.stop<r.stop&&(this.intervals[t]=new a(e.stop,r.stop)),t+=1}},i.prototype.removeOne=function(e){if(null!==this.intervals)for(var t=0;t<this.intervals.length;t++){var n=this.intervals[t];if(e<n.start)return;if(e===n.start&&e===n.stop-1)return void this.intervals.splice(t,1);if(e===n.start)return void(this.intervals[t]=new a(n.start+1,n.stop));if(e===n.stop-1)return void(this.intervals[t]=new a(n.start,n.stop-1));if(e<n.stop-1){var r=new a(n.start,e);return n.start=e+1,void this.intervals.splice(t,0,r)}}},i.prototype.toString=function(e,t,n){return e=e||null,t=t||null,n=n||!1,null===this.intervals?"{}":null!==e||null!==t?this.toTokenString(e,t):n?this.toCharString():this.toIndexString()},i.prototype.toCharString=function(){for(var e=[],t=0;t<this.intervals.length;t++){var n=this.intervals[t];n.stop===n.start+1?n.start===r.EOF?e.push("<EOF>"):e.push("'"+String.fromCharCode(n.start)+"'"):e.push("'"+String.fromCharCode(n.start)+"'..'"+String.fromCharCode(n.stop-1)+"'")}return e.length>1?"{"+e.join(", ")+"}":e[0]},i.prototype.toIndexString=function(){for(var e=[],t=0;t<this.intervals.length;t++){var n=this.intervals[t];n.stop===n.start+1?n.start===r.EOF?e.push("<EOF>"):e.push(n.start.toString()):e.push(n.start.toString()+".."+(n.stop-1).toString())}return e.length>1?"{"+e.join(", ")+"}":e[0]},i.prototype.toTokenString=function(e,t){for(var n=[],r=0;r<this.intervals.length;r++)for(var a=this.intervals[r],i=a.start;i<a.stop;i++)n.push(this.elementName(e,t,i));return n.length>1?"{"+n.join(", ")+"}":n[0]},i.prototype.elementName=function(e,t,n){return n===r.EOF?"<EOF>":n===r.EPSILON?"<EPSILON>":e[n]||t[n]},t.Interval=a,t.m=i},4e3:(e,t,n)=>{var r=n(8720).Set,a=n(8720).BitSet,i=n(2792).Token,o=n(6664).G,s=(n(3922).Interval,n(3922).m),l=n(6005).RuleStopState,p=n(2552).RuleTransition,u=n(2552).NotSetTransition,m=n(2552).WildcardTransition,c=n(2552).AbstractPredicateTransition,h=n(4997),g=h.predictionContextFromRuleContext,T=h.PredictionContext,y=h.SingletonPredictionContext;function d(e){this.atn=e}d.HIT_PRED=i.INVALID_TYPE,d.prototype.getDecisionLookahead=function(e){if(null===e)return null;for(var t=e.transitions.length,n=[],i=0;i<t;i++){n[i]=new s;var o=new r;this._LOOK(e.transition(i).target,null,T.EMPTY,n[i],o,new a,!1,!1),(0===n[i].length||n[i].contains(d.HIT_PRED))&&(n[i]=null)}return n},d.prototype.LOOK=function(e,t,n){var i=new s,o=null!==(n=n||null)?g(e.atn,n):null;return this._LOOK(e,t,o,i,new r,new a,!0,!0),i},d.prototype._LOOK=function(e,t,n,r,a,s,h,g){var f=new o({state:e,alt:0,context:n},null);if(!a.contains(f)){if(a.add(f),e===t){if(null===n)return void r.addOne(i.EPSILON);if(n.isEmpty()&&g)return void r.addOne(i.EOF)}if(e instanceof l){if(null===n)return void r.addOne(i.EPSILON);if(n.isEmpty()&&g)return void r.addOne(i.EOF);if(n!==T.EMPTY){for(var S=0;S<n.length;S++){var b=this.atn.states[n.getReturnState(S)],x=s.contains(b.ruleIndex);try{s.remove(b.ruleIndex),this._LOOK(b,t,n.getParent(S),r,a,s,h,g)}finally{x&&s.add(b.ruleIndex)}}return}}for(var A=0;A<e.transitions.length;A++){var L=e.transitions[A];if(L.constructor===p){if(s.contains(L.target.ruleIndex))continue;var E=y.create(n,L.followState.stateNumber);try{s.add(L.target.ruleIndex),this._LOOK(L.target,t,E,r,a,s,h,g)}finally{s.remove(L.target.ruleIndex)}}else if(L instanceof c)h?this._LOOK(L.target,t,n,r,a,s,h,g):r.addOne(d.HIT_PRED);else if(L.isEpsilon)this._LOOK(L.target,t,n,r,a,s,h,g);else if(L.constructor===m)r.addRange(i.MIN_USER_TOKEN_TYPE,this.atn.maxTokenType);else{var I=L.label;null!==I&&(L instanceof u&&(I=I.complement(i.MIN_USER_TOKEN_TYPE,this.atn.maxTokenType)),r.addSet(I))}}}},t.a=d},4479:(e,t,n)=>{var r=n(2792).Token,a=n(2231).f,i=n(4965).p,o=n(2233).RecognitionException,s=n(2233).LexerNoViableAltException;function l(e){return a.call(this),this._input=e,this._factory=i.DEFAULT,this._tokenFactorySourcePair=[this,e],this._interp=null,this._token=null,this._tokenStartCharIndex=-1,this._tokenStartLine=-1,this._tokenStartColumn=-1,this._hitEOF=!1,this._channel=r.DEFAULT_CHANNEL,this._type=r.INVALID_TYPE,this._modeStack=[],this._mode=l.DEFAULT_MODE,this._text=null,this}l.prototype=Object.create(a.prototype),l.prototype.constructor=l,l.DEFAULT_MODE=0,l.MORE=-2,l.SKIP=-3,l.DEFAULT_TOKEN_CHANNEL=r.DEFAULT_CHANNEL,l.HIDDEN=r.HIDDEN_CHANNEL,l.MIN_CHAR_VALUE=0,l.MAX_CHAR_VALUE=1114111,l.prototype.reset=function(){null!==this._input&&this._input.seek(0),this._token=null,this._type=r.INVALID_TYPE,this._channel=r.DEFAULT_CHANNEL,this._tokenStartCharIndex=-1,this._tokenStartColumn=-1,this._tokenStartLine=-1,this._text=null,this._hitEOF=!1,this._mode=l.DEFAULT_MODE,this._modeStack=[],this._interp.reset()},l.prototype.nextToken=function(){if(null===this._input)throw"nextToken requires a non-null input stream.";var e=this._input.mark();try{for(;;){if(this._hitEOF)return this.emitEOF(),this._token;this._token=null,this._channel=r.DEFAULT_CHANNEL,this._tokenStartCharIndex=this._input.index,this._tokenStartColumn=this._interp.column,this._tokenStartLine=this._interp.line,this._text=null;for(var t=!1;;){this._type=r.INVALID_TYPE;var n=l.SKIP;try{n=this._interp.match(this._input,this._mode)}catch(e){if(!(e instanceof o))throw console.log(e.stack),e;this.notifyListeners(e),this.recover(e)}if(this._input.LA(1)===r.EOF&&(this._hitEOF=!0),this._type===r.INVALID_TYPE&&(this._type=n),this._type===l.SKIP){t=!0;break}if(this._type!==l.MORE)break}if(!t)return null===this._token&&this.emit(),this._token}}finally{this._input.release(e)}},l.prototype.skip=function(){this._type=l.SKIP},l.prototype.more=function(){this._type=l.MORE},l.prototype.mode=function(e){this._mode=e},l.prototype.pushMode=function(e){this._interp.debug&&console.log("pushMode "+e),this._modeStack.push(this._mode),this.mode(e)},l.prototype.popMode=function(){if(0===this._modeStack.length)throw"Empty Stack";return this._interp.debug&&console.log("popMode back to "+this._modeStack.slice(0,-1)),this.mode(this._modeStack.pop()),this._mode},Object.defineProperty(l.prototype,"inputStream",{get:function(){return this._input},set:function(e){this._input=null,this._tokenFactorySourcePair=[this,this._input],this.reset(),this._input=e,this._tokenFactorySourcePair=[this,this._input]}}),Object.defineProperty(l.prototype,"sourceName",{get:function(){return this._input.sourceName}}),l.prototype.emitToken=function(e){this._token=e},l.prototype.emit=function(){var e=this._factory.create(this._tokenFactorySourcePair,this._type,this._text,this._channel,this._tokenStartCharIndex,this.getCharIndex()-1,this._tokenStartLine,this._tokenStartColumn);return this.emitToken(e),e},l.prototype.emitEOF=function(){var e=this.column,t=this.line,n=this._factory.create(this._tokenFactorySourcePair,r.EOF,null,r.DEFAULT_CHANNEL,this._input.index,this._input.index-1,t,e);return this.emitToken(n),n},Object.defineProperty(l.prototype,"type",{get:function(){return this.type},set:function(e){this._type=e}}),Object.defineProperty(l.prototype,"line",{get:function(){return this._interp.line},set:function(e){this._interp.line=e}}),Object.defineProperty(l.prototype,"column",{get:function(){return this._interp.column},set:function(e){this._interp.column=e}}),l.prototype.getCharIndex=function(){return this._input.index},Object.defineProperty(l.prototype,"text",{get:function(){return null!==this._text?this._text:this._interp.getText(this._input)},set:function(e){this._text=e}}),l.prototype.getAllTokens=function(){for(var e=[],t=this.nextToken();t.type!==r.EOF;)e.push(t),t=this.nextToken();return e},l.prototype.notifyListeners=function(e){var t=this._tokenStartCharIndex,n=this._input.index,r=this._input.getText(t,n),a="token recognition error at: '"+this.getErrorDisplay(r)+"'";this.getErrorListenerDispatch().syntaxError(this,null,this._tokenStartLine,this._tokenStartColumn,a,e)},l.prototype.getErrorDisplay=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t.join("")},l.prototype.getErrorDisplayForChar=function(e){return e.charCodeAt(0)===r.EOF?"<EOF>":"\n"===e?"\\n":"\t"===e?"\\t":"\r"===e?"\\r":e},l.prototype.getCharErrorDisplay=function(e){return"'"+this.getErrorDisplayForChar(e)+"'"},l.prototype.recover=function(e){this._input.LA(1)!==r.EOF&&(e instanceof s?this._interp.consume(this._input):this._input.consume())},t.Lexer=l},7402:(e,t,n)=>{var r=n(2792).Token,a=n(9024).ParseTreeListener,i=n(2231).f,o=n(1519).$,s=n(2677).ATNDeserializer,l=n(1091).$,p=n(9024).TerminalNode,u=n(9024).ErrorNode;function m(e){return a.call(this),this.parser=e,this}function c(e){return i.call(this),this._input=null,this._errHandler=new o,this._precedenceStack=[],this._precedenceStack.push(0),this._ctx=null,this.buildParseTrees=!0,this._tracer=null,this._parseListeners=null,this._syntaxErrors=0,this.setInputStream(e),this}m.prototype=Object.create(a.prototype),m.prototype.constructor=m,m.prototype.enterEveryRule=function(e){console.log("enter "+this.parser.ruleNames[e.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)},m.prototype.visitTerminal=function(e){console.log("consume "+e.symbol+" rule "+this.parser.ruleNames[this.parser._ctx.ruleIndex])},m.prototype.exitEveryRule=function(e){console.log("exit "+this.parser.ruleNames[e.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)},c.prototype=Object.create(i.prototype),c.prototype.contructor=c,c.bypassAltsAtnCache={},c.prototype.reset=function(){null!==this._input&&this._input.seek(0),this._errHandler.reset(this),this._ctx=null,this._syntaxErrors=0,this.setTrace(!1),this._precedenceStack=[],this._precedenceStack.push(0),null!==this._interp&&this._interp.reset()},c.prototype.match=function(e){var t=this.getCurrentToken();return t.type===e?(this._errHandler.reportMatch(this),this.consume()):(t=this._errHandler.recoverInline(this),this.buildParseTrees&&-1===t.tokenIndex&&this._ctx.addErrorNode(t)),t},c.prototype.matchWildcard=function(){var e=this.getCurrentToken();return e.type>0?(this._errHandler.reportMatch(this),this.consume()):(e=this._errHandler.recoverInline(this),this._buildParseTrees&&-1===e.tokenIndex&&this._ctx.addErrorNode(e)),e},c.prototype.getParseListeners=function(){return this._parseListeners||[]},c.prototype.addParseListener=function(e){if(null===e)throw"listener";null===this._parseListeners&&(this._parseListeners=[]),this._parseListeners.push(e)},c.prototype.removeParseListener=function(e){if(null!==this._parseListeners){var t=this._parseListeners.indexOf(e);t>=0&&this._parseListeners.splice(t,1),0===this._parseListeners.length&&(this._parseListeners=null)}},c.prototype.removeParseListeners=function(){this._parseListeners=null},c.prototype.triggerEnterRuleEvent=function(){if(null!==this._parseListeners){var e=this._ctx;this._parseListeners.map((function(t){t.enterEveryRule(e),e.enterRule(t)}))}},c.prototype.triggerExitRuleEvent=function(){if(null!==this._parseListeners){var e=this._ctx;this._parseListeners.slice(0).reverse().map((function(t){e.exitRule(t),t.exitEveryRule(e)}))}},c.prototype.getTokenFactory=function(){return this._input.tokenSource._factory},c.prototype.setTokenFactory=function(e){this._input.tokenSource._factory=e},c.prototype.getATNWithBypassAlts=function(){var e=this.getSerializedATN();if(null===e)throw"The current parser does not support an ATN with bypass alternatives.";var t=this.bypassAltsAtnCache[e];if(null===t){var n=new l;n.generateRuleBypassTransitions=!0,t=new s(n).deserialize(e),this.bypassAltsAtnCache[e]=t}return t};var h=n(4479).Lexer;c.prototype.compileParseTreePattern=function(e,t,n){if(null===(n=n||null)&&null!==this.getTokenStream()){var r=this.getTokenStream().tokenSource;r instanceof h&&(n=r)}if(null===n)throw"Parser can't discover a lexer to use";return new ParseTreePatternMatcher(n,this).compile(e,t)},c.prototype.getInputStream=function(){return this.getTokenStream()},c.prototype.setInputStream=function(e){this.setTokenStream(e)},c.prototype.getTokenStream=function(){return this._input},c.prototype.setTokenStream=function(e){this._input=null,this.reset(),this._input=e},c.prototype.getCurrentToken=function(){return this._input.LT(1)},c.prototype.notifyErrorListeners=function(e,t,n){n=n||null,null===(t=t||null)&&(t=this.getCurrentToken()),this._syntaxErrors+=1;var r=t.line,a=t.column;this.getErrorListenerDispatch().syntaxError(this,t,r,a,e,n)},c.prototype.consume=function(){var e=this.getCurrentToken();e.type!==r.EOF&&this.getInputStream().consume();var t,n=null!==this._parseListeners&&this._parseListeners.length>0;return(this.buildParseTrees||n)&&((t=this._errHandler.inErrorRecoveryMode(this)?this._ctx.addErrorNode(e):this._ctx.addTokenNode(e)).invokingState=this.state,n&&this._parseListeners.map((function(e){t instanceof u||void 0!==t.isErrorNode&&t.isErrorNode()?e.visitErrorNode(t):t instanceof p&&e.visitTerminal(t)}))),e},c.prototype.addContextToParseTree=function(){null!==this._ctx.parentCtx&&this._ctx.parentCtx.addChild(this._ctx)},c.prototype.enterRule=function(e,t,n){this.state=t,this._ctx=e,this._ctx.start=this._input.LT(1),this.buildParseTrees&&this.addContextToParseTree(),null!==this._parseListeners&&this.triggerEnterRuleEvent()},c.prototype.exitRule=function(){this._ctx.stop=this._input.LT(-1),null!==this._parseListeners&&this.triggerExitRuleEvent(),this.state=this._ctx.invokingState,this._ctx=this._ctx.parentCtx},c.prototype.enterOuterAlt=function(e,t){e.setAltNumber(t),this.buildParseTrees&&this._ctx!==e&&null!==this._ctx.parentCtx&&(this._ctx.parentCtx.removeLastChild(),this._ctx.parentCtx.addChild(e)),this._ctx=e},c.prototype.getPrecedence=function(){return 0===this._precedenceStack.length?-1:this._precedenceStack[this._precedenceStack.length-1]},c.prototype.enterRecursionRule=function(e,t,n,r){this.state=t,this._precedenceStack.push(r),this._ctx=e,this._ctx.start=this._input.LT(1),null!==this._parseListeners&&this.triggerEnterRuleEvent()},c.prototype.pushNewRecursionContext=function(e,t,n){var r=this._ctx;r.parentCtx=e,r.invokingState=t,r.stop=this._input.LT(-1),this._ctx=e,this._ctx.start=r.start,this.buildParseTrees&&this._ctx.addChild(r),null!==this._parseListeners&&this.triggerEnterRuleEvent()},c.prototype.unrollRecursionContexts=function(e){this._precedenceStack.pop(),this._ctx.stop=this._input.LT(-1);var t=this._ctx;if(null!==this._parseListeners)for(;this._ctx!==e;)this.triggerExitRuleEvent(),this._ctx=this._ctx.parentCtx;else this._ctx=e;t.parentCtx=e,this.buildParseTrees&&null!==e&&e.addChild(t)},c.prototype.getInvokingContext=function(e){for(var t=this._ctx;null!==t;){if(t.ruleIndex===e)return t;t=t.parentCtx}return null},c.prototype.precpred=function(e,t){return t>=this._precedenceStack[this._precedenceStack.length-1]},c.prototype.inContext=function(e){return!1},c.prototype.isExpectedToken=function(e){var t=this._interp.atn,n=this._ctx,a=t.states[this.state],i=t.nextTokens(a);if(i.contains(e))return!0;if(!i.contains(r.EPSILON))return!1;for(;null!==n&&n.invokingState>=0&&i.contains(r.EPSILON);){var o=t.states[n.invokingState].transitions[0];if((i=t.nextTokens(o.followState)).contains(e))return!0;n=n.parentCtx}return!(!i.contains(r.EPSILON)||e!==r.EOF)},c.prototype.getExpectedTokens=function(){return this._interp.atn.getExpectedTokens(this.state,this._ctx)},c.prototype.getExpectedTokensWithinCurrentRule=function(){var e=this._interp.atn,t=e.states[this.state];return e.nextTokens(t)},c.prototype.getRuleIndex=function(e){var t=this.getRuleIndexMap()[e];return null!==t?t:-1},c.prototype.getRuleInvocationStack=function(e){null===(e=e||null)&&(e=this._ctx);for(var t=[];null!==e;){var n=e.ruleIndex;n<0?t.push("n/a"):t.push(this.ruleNames[n]),e=e.parentCtx}return t},c.prototype.getDFAStrings=function(){return this._interp.decisionToDFA.toString()},c.prototype.dumpDFA=function(){for(var e=!1,t=0;t<this._interp.decisionToDFA.length;t++){var n=this._interp.decisionToDFA[t];n.states.length>0&&(e&&console.log(),this.printer.println("Decision "+n.decision+":"),this.printer.print(n.toString(this.literalNames,this.symbolicNames)),e=!0)}},c.prototype.getSourceName=function(){return this._input.sourceName},c.prototype.setTrace=function(e){e?(null!==this._tracer&&this.removeParseListener(this._tracer),this._tracer=new m(this),this.addParseListener(this._tracer)):(this.removeParseListener(this._tracer),this._tracer=null)},t.Parser=c},5425:(e,t,n)=>{var r=n(2200).m,a=n(9024),i=a.INVALID_INTERVAL,o=a.TerminalNode,s=a.TerminalNodeImpl,l=a.ErrorNodeImpl,p=n(3922).Interval;function u(e,t){e=e||null,t=t||null,r.call(this,e,t),this.ruleIndex=-1,this.children=null,this.start=null,this.stop=null,this.exception=null}function m(e,t,n){return u.call(e,t),this.ruleIndex=n,this}u.prototype=Object.create(r.prototype),u.prototype.constructor=u,u.prototype.copyFrom=function(e){this.parentCtx=e.parentCtx,this.invokingState=e.invokingState,this.children=null,this.start=e.start,this.stop=e.stop,e.children&&(this.children=[],e.children.map((function(e){e instanceof l&&(this.children.push(e),e.parentCtx=this)}),this))},u.prototype.enterRule=function(e){},u.prototype.exitRule=function(e){},u.prototype.addChild=function(e){return null===this.children&&(this.children=[]),this.children.push(e),e},u.prototype.removeLastChild=function(){null!==this.children&&this.children.pop()},u.prototype.addTokenNode=function(e){var t=new s(e);return this.addChild(t),t.parentCtx=this,t},u.prototype.addErrorNode=function(e){var t=new l(e);return this.addChild(t),t.parentCtx=this,t},u.prototype.getChild=function(e,t){if(t=t||null,null===this.children||e<0||e>=this.children.length)return null;if(null===t)return this.children[e];for(var n=0;n<this.children.length;n++){var r=this.children[n];if(r instanceof t){if(0===e)return r;e-=1}}return null},u.prototype.getToken=function(e,t){if(null===this.children||t<0||t>=this.children.length)return null;for(var n=0;n<this.children.length;n++){var r=this.children[n];if(r instanceof o&&r.symbol.type===e){if(0===t)return r;t-=1}}return null},u.prototype.getTokens=function(e){if(null===this.children)return[];for(var t=[],n=0;n<this.children.length;n++){var r=this.children[n];r instanceof o&&r.symbol.type===e&&t.push(r)}return t},u.prototype.getTypedRuleContext=function(e,t){return this.getChild(t,e)},u.prototype.getTypedRuleContexts=function(e){if(null===this.children)return[];for(var t=[],n=0;n<this.children.length;n++){var r=this.children[n];r instanceof e&&t.push(r)}return t},u.prototype.getChildCount=function(){return null===this.children?0:this.children.length},u.prototype.getSourceInterval=function(){return null===this.start||null===this.stop?i:new p(this.start.tokenIndex,this.stop.tokenIndex)},r.EMPTY=new u,m.prototype=Object.create(u.prototype),m.prototype.constructor=m,t.ParserRuleContext=u},4997:(e,t,n)=>{var r=n(2200).m,a=n(8720).Hash;function i(e){this.cachedHashCode=e}function o(){return this.cache={},this}function s(e,t){var n=0;if(null!==e){var r=new a;r.update(e,t),n=r.finish()}i.call(this,n),this.parentCtx=e,this.returnState=t}function l(){return s.call(this,null,i.EMPTY_RETURN_STATE),this}function p(e,t){var n=new a;n.update(e,t);var r=n.finish();return i.call(this,r),this.parents=e,this.returnStates=t,this}i.EMPTY=null,i.EMPTY_RETURN_STATE=2147483647,i.globalNodeCount=1,i.id=i.globalNodeCount,i.prototype.isEmpty=function(){return this===i.EMPTY},i.prototype.hasEmptyPath=function(){return this.getReturnState(this.length-1)===i.EMPTY_RETURN_STATE},i.prototype.hashCode=function(){return this.cachedHashCode},i.prototype.updateHashCode=function(e){e.update(this.cachedHashCode)},o.prototype.add=function(e){if(e===i.EMPTY)return i.EMPTY;var t=this.cache[e]||null;return null!==t?t:(this.cache[e]=e,e)},o.prototype.get=function(e){return this.cache[e]||null},Object.defineProperty(o.prototype,"length",{get:function(){return this.cache.length}}),s.prototype=Object.create(i.prototype),s.prototype.contructor=s,s.create=function(e,t){return t===i.EMPTY_RETURN_STATE&&null===e?i.EMPTY:new s(e,t)},Object.defineProperty(s.prototype,"length",{get:function(){return 1}}),s.prototype.getParent=function(e){return this.parentCtx},s.prototype.getReturnState=function(e){return this.returnState},s.prototype.equals=function(e){return this===e||e instanceof s&&this.hashCode()===e.hashCode()&&this.returnState===e.returnState&&(null==this.parentCtx?null==e.parentCtx:this.parentCtx.equals(e.parentCtx))},s.prototype.toString=function(){var e=null===this.parentCtx?"":this.parentCtx.toString();return 0===e.length?this.returnState===i.EMPTY_RETURN_STATE?"$":""+this.returnState:this.returnState+" "+e},l.prototype=Object.create(s.prototype),l.prototype.constructor=l,l.prototype.isEmpty=function(){return!0},l.prototype.getParent=function(e){return null},l.prototype.getReturnState=function(e){return this.returnState},l.prototype.equals=function(e){return this===e},l.prototype.toString=function(){return"$"},i.EMPTY=new l,p.prototype=Object.create(i.prototype),p.prototype.constructor=p,p.prototype.isEmpty=function(){return this.returnStates[0]===i.EMPTY_RETURN_STATE},Object.defineProperty(p.prototype,"length",{get:function(){return this.returnStates.length}}),p.prototype.getParent=function(e){return this.parents[e]},p.prototype.getReturnState=function(e){return this.returnStates[e]},p.prototype.equals=function(e){return this===e||e instanceof p&&this.hashCode()===e.hashCode()&&this.returnStates===e.returnStates&&this.parents===e.parents},p.prototype.toString=function(){if(this.isEmpty())return"[]";for(var e="[",t=0;t<this.returnStates.length;t++)t>0&&(e+=", "),this.returnStates[t]!==i.EMPTY_RETURN_STATE?(e+=this.returnStates[t],null!==this.parents[t]?e=e+" "+this.parents[t]:e+="null"):e+="$";return e+"]"},t.merge=function e(t,n,r,a){if(t===n)return t;if(t instanceof s&&n instanceof s)return function(t,n,r,a){if(null!==a){var o=a.get(t,n);if(null!==o)return o;if(null!==(o=a.get(n,t)))return o}var l=function(e,t,n){if(n){if(e===i.EMPTY)return i.EMPTY;if(t===i.EMPTY)return i.EMPTY}else{if(e===i.EMPTY&&t===i.EMPTY)return i.EMPTY;if(e===i.EMPTY){var r=[t.returnState,i.EMPTY_RETURN_STATE];return new p([t.parentCtx,null],r)}if(t===i.EMPTY)return r=[e.returnState,i.EMPTY_RETURN_STATE],new p([e.parentCtx,null],r)}return null}(t,n,r);if(null!==l)return null!==a&&a.set(t,n,l),l;if(t.returnState===n.returnState){var u=e(t.parentCtx,n.parentCtx,r,a);if(u===t.parentCtx)return t;if(u===n.parentCtx)return n;var m=s.create(u,t.returnState);return null!==a&&a.set(t,n,m),m}var c=null;if((t===n||null!==t.parentCtx&&t.parentCtx===n.parentCtx)&&(c=t.parentCtx),null!==c){var h=[t.returnState,n.returnState];t.returnState>n.returnState&&(h[0]=n.returnState,h[1]=t.returnState);var g=new p(T=[c,c],h);return null!==a&&a.set(t,n,g),g}h=[t.returnState,n.returnState];var T=[t.parentCtx,n.parentCtx];t.returnState>n.returnState&&(h[0]=n.returnState,h[1]=t.returnState,T=[n.parentCtx,t.parentCtx]);var y=new p(T,h);return null!==a&&a.set(t,n,y),y}(t,n,r,a);if(r){if(t instanceof l)return t;if(n instanceof l)return n}return t instanceof s&&(t=new p([t.getParent()],[t.returnState])),n instanceof s&&(n=new p([n.getParent()],[n.returnState])),function(t,n,r,a){if(null!==a){var o=a.get(t,n);if(null!==o)return o;if(null!==(o=a.get(n,t)))return o}for(var l=0,u=0,m=0,c=[],h=[];l<t.returnStates.length&&u<n.returnStates.length;){var g=t.parents[l],T=n.parents[u];if(t.returnStates[l]===n.returnStates[u]){var y=t.returnStates[l];if(y===i.EMPTY_RETURN_STATE&&null===g&&null===T||null!==g&&null!==T&&g===T)h[m]=g,c[m]=y;else{var d=e(g,T,r,a);h[m]=d,c[m]=y}l+=1,u+=1}else t.returnStates[l]<n.returnStates[u]?(h[m]=g,c[m]=t.returnStates[l],l+=1):(h[m]=T,c[m]=n.returnStates[u],u+=1);m+=1}if(l<t.returnStates.length)for(var f=l;f<t.returnStates.length;f++)h[m]=t.parents[f],c[m]=t.returnStates[f],m+=1;else for(f=u;f<n.returnStates.length;f++)h[m]=n.parents[f],c[m]=n.returnStates[f],m+=1;if(m<h.length){if(1===m){var S=s.create(h[0],c[0]);return null!==a&&a.set(t,n,S),S}h=h.slice(0,m),c=c.slice(0,m)}var b=new p(h,c);return b===t?(null!==a&&a.set(t,n,t),t):b===n?(null!==a&&a.set(t,n,n),n):(function(e){for(var t={},n=0;n<e.length;n++){var r=e[n];r in t||(t[r]=r)}for(var a=0;a<e.length;a++)e[a]=t[e[a]]}(h),null!==a&&a.set(t,n,b),b)}(t,n,r,a)},t.PredictionContext=i,t.PredictionContextCache=o,t.SingletonPredictionContext=s,t.predictionContextFromRuleContext=function e(t,n){if(null==n&&(n=r.EMPTY),null===n.parentCtx||n===r.EMPTY)return i.EMPTY;var a=e(t,n.parentCtx),o=t.states[n.invokingState].transitions[0];return s.create(a,o.followState.stateNumber)},t.getCachedPredictionContext=function e(t,n,r){if(t.isEmpty())return t;var a=r[t]||null;if(null!==a)return a;if(null!==(a=n.get(t)))return r[t]=a,a;for(var o=!1,l=[],u=0;u<l.length;u++){var m=e(t.getParent(u),n,r);if(o||m!==t.getParent(u)){if(!o){l=[];for(var c=0;c<t.length;c++)l[c]=t.getParent(c);o=!0}l[u]=m}}if(!o)return n.add(t),r[t]=t,t;var h;return h=0===l.length?i.EMPTY:1===l.length?s.create(l[0],t.getReturnState(0)):new p(l,t.returnStates),n.add(h),r[h]=h,r[t]=h,h}},2231:(e,t,n)=>{var r=n(2792).Token,a=n(8158).q,i=n(8158).X;function o(){return this._listeners=[a.INSTANCE],this._interp=null,this._stateNumber=-1,this}o.tokenTypeMapCache={},o.ruleIndexMapCache={},o.prototype.checkVersion=function(e){"4.7.2"!==e&&console.log("ANTLR runtime and generated code versions disagree: 4.7.2!="+e)},o.prototype.addErrorListener=function(e){this._listeners.push(e)},o.prototype.removeErrorListeners=function(){this._listeners=[]},o.prototype.getTokenTypeMap=function(){var e=this.getTokenNames();if(null===e)throw"The current recognizer does not provide a list of token names.";var t=this.tokenTypeMapCache[e];return void 0===t&&((t=e.reduce((function(e,t,n){e[t]=n}))).EOF=r.EOF,this.tokenTypeMapCache[e]=t),t},o.prototype.getRuleIndexMap=function(){var e=this.ruleNames;if(null===e)throw"The current recognizer does not provide a list of rule names.";var t=this.ruleIndexMapCache[e];return void 0===t&&(t=e.reduce((function(e,t,n){e[t]=n})),this.ruleIndexMapCache[e]=t),t},o.prototype.getTokenType=function(e){var t=this.getTokenTypeMap()[e];return void 0!==t?t:r.INVALID_TYPE},o.prototype.getErrorHeader=function(e){return"line "+e.getOffendingToken().line+":"+e.getOffendingToken().column},o.prototype.getTokenErrorDisplay=function(e){if(null===e)return"<no token>";var t=e.text;return null===t&&(t=e.type===r.EOF?"<EOF>":"<"+e.type+">"),"'"+(t=t.replace("\n","\\n").replace("\r","\\r").replace("\t","\\t"))+"'"},o.prototype.getErrorListenerDispatch=function(){return new i(this._listeners)},o.prototype.sempred=function(e,t,n){return!0},o.prototype.precpred=function(e,t){return!0},Object.defineProperty(o.prototype,"state",{get:function(){return this._stateNumber},set:function(e){this._stateNumber=e}}),t.f=o},2200:(e,t,n)=>{var r=n(9024).RuleNode,a=n(9024).INVALID_INTERVAL,i=n(906).INVALID_ALT_NUMBER;function o(e,t){return r.call(this),this.parentCtx=e||null,this.invokingState=t||-1,this}o.prototype=Object.create(r.prototype),o.prototype.constructor=o,o.prototype.depth=function(){for(var e=0,t=this;null!==t;)t=t.parentCtx,e+=1;return e},o.prototype.isEmpty=function(){return-1===this.invokingState},o.prototype.getSourceInterval=function(){return a},o.prototype.getRuleContext=function(){return this},o.prototype.getPayload=function(){return this},o.prototype.getText=function(){return 0===this.getChildCount()?"":this.children.map((function(e){return e.getText()})).join("")},o.prototype.getAltNumber=function(){return i},o.prototype.setAltNumber=function(e){},o.prototype.getChild=function(e){return null},o.prototype.getChildCount=function(){return 0},o.prototype.accept=function(e){return e.visitChildren(this)},t.m=o;var s=n(6687).Trees;o.prototype.toStringTree=function(e,t){return s.toStringTree(this,e,t)},o.prototype.toString=function(e,t){e=e||null,t=t||null;for(var n=this,r="[";null!==n&&n!==t;){if(null===e)n.isEmpty()||(r+=n.invokingState);else{var a=n.ruleIndex;r+=a>=0&&a<e.length?e[a]:""+a}null===n.parentCtx||null===e&&n.parentCtx.isEmpty()||(r+=" "),n=n.parentCtx}return r+"]"}},2792:(e,t)=>{function n(){return this.source=null,this.type=null,this.channel=null,this.start=null,this.stop=null,this.tokenIndex=null,this.line=null,this.column=null,this._text=null,this}function r(e,t,a,i,o){return n.call(this),this.source=void 0!==e?e:r.EMPTY_SOURCE,this.type=void 0!==t?t:null,this.channel=void 0!==a?a:n.DEFAULT_CHANNEL,this.start=void 0!==i?i:-1,this.stop=void 0!==o?o:-1,this.tokenIndex=-1,null!==this.source[0]?(this.line=e[0].line,this.column=e[0].column):this.column=-1,this}n.INVALID_TYPE=0,n.EPSILON=-2,n.MIN_USER_TOKEN_TYPE=1,n.EOF=-1,n.DEFAULT_CHANNEL=0,n.HIDDEN_CHANNEL=1,Object.defineProperty(n.prototype,"text",{get:function(){return this._text},set:function(e){this._text=e}}),n.prototype.getTokenSource=function(){return this.source[0]},n.prototype.getInputStream=function(){return this.source[1]},r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.EMPTY_SOURCE=[null,null],r.prototype.clone=function(){var e=new r(this.source,this.type,this.channel,this.start,this.stop);return e.tokenIndex=this.tokenIndex,e.line=this.line,e.column=this.column,e.text=this.text,e},Object.defineProperty(r.prototype,"text",{get:function(){if(null!==this._text)return this._text;var e=this.getInputStream();if(null===e)return null;var t=e.size;return this.start<t&&this.stop<t?e.getText(this.start,this.stop):"<EOF>"},set:function(e){this._text=e}}),r.prototype.toString=function(){var e=this.text;return e=null!==e?e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):"<no text>","[@"+this.tokenIndex+","+this.start+":"+this.stop+"='"+e+"',<"+this.type+">"+(this.channel>0?",channel="+this.channel:"")+","+this.line+":"+this.column+"]"},t.Token=n,t.CommonToken=r},8720:(e,t)=>{function n(e){return"["+e.join(", ")+"]"}function r(e,t){return e.equals(t)}function a(e){return e.hashCode()}function i(e,t){return this.data={},this.hashFunction=e||a,this.equalsFunction=t||r,this}function o(){return this.data=[],this}function s(e,t){return this.data={},this.hashFunction=e||a,this.equalsFunction=t||r,this}function l(){return this.data={},this}function p(){return this}function u(){return this.count=0,this.hash=0,this}String.prototype.seed=String.prototype.seed||Math.round(Math.random()*Math.pow(2,32)),String.prototype.hashCode=function(){var e,t,n,r,a,i,o,s,l=this.toString();for(e=3&l.length,t=l.length-e,n=String.prototype.seed,a=3432918353,i=461845907,s=0;s<t;)o=255&l.charCodeAt(s)|(255&l.charCodeAt(++s))<<8|(255&l.charCodeAt(++s))<<16|(255&l.charCodeAt(++s))<<24,++s,n=27492+(65535&(r=5*(65535&(n=(n^=o=(65535&(o=(o=(65535&o)*a+(((o>>>16)*a&65535)<<16)&4294967295)<<15|o>>>17))*i+(((o>>>16)*i&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(r>>>16)&65535)<<16);switch(o=0,e){case 3:o^=(255&l.charCodeAt(s+2))<<16;case 2:o^=(255&l.charCodeAt(s+1))<<8;case 1:n^=o=(65535&(o=(o=(65535&(o^=255&l.charCodeAt(s)))*a+(((o>>>16)*a&65535)<<16)&4294967295)<<15|o>>>17))*i+(((o>>>16)*i&65535)<<16)&4294967295}return n^=l.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0},Object.defineProperty(i.prototype,"length",{get:function(){var e=0;for(var t in this.data)0===t.indexOf("hash_")&&(e+=this.data[t].length);return e}}),i.prototype.add=function(e){var t="hash_"+this.hashFunction(e);if(t in this.data){for(var n=this.data[t],r=0;r<n.length;r++)if(this.equalsFunction(e,n[r]))return n[r];return n.push(e),e}return this.data[t]=[e],e},i.prototype.contains=function(e){return null!=this.get(e)},i.prototype.get=function(e){var t="hash_"+this.hashFunction(e);if(t in this.data)for(var n=this.data[t],r=0;r<n.length;r++)if(this.equalsFunction(e,n[r]))return n[r];return null},i.prototype.values=function(){var e=[];for(var t in this.data)0===t.indexOf("hash_")&&(e=e.concat(this.data[t]));return e},i.prototype.toString=function(){return n(this.values())},o.prototype.add=function(e){this.data[e]=!0},o.prototype.or=function(e){var t=this;Object.keys(e.data).map((function(e){t.add(e)}))},o.prototype.remove=function(e){delete this.data[e]},o.prototype.contains=function(e){return!0===this.data[e]},o.prototype.values=function(){return Object.keys(this.data)},o.prototype.minValue=function(){return Math.min.apply(null,this.values())},o.prototype.hashCode=function(){var e=new u;return e.update(this.values()),e.finish()},o.prototype.equals=function(e){return e instanceof o&&this.hashCode()===e.hashCode()},Object.defineProperty(o.prototype,"length",{get:function(){return this.values().length}}),o.prototype.toString=function(){return"{"+this.values().join(", ")+"}"},Object.defineProperty(s.prototype,"length",{get:function(){var e=0;for(var t in this.data)0===t.indexOf("hash_")&&(e+=this.data[t].length);return e}}),s.prototype.put=function(e,t){var n="hash_"+this.hashFunction(e);if(n in this.data){for(var r=this.data[n],a=0;a<r.length;a++){var i=r[a];if(this.equalsFunction(e,i.key)){var o=i.value;return i.value=t,o}}return r.push({key:e,value:t}),t}return this.data[n]=[{key:e,value:t}],t},s.prototype.containsKey=function(e){var t="hash_"+this.hashFunction(e);if(t in this.data)for(var n=this.data[t],r=0;r<n.length;r++){var a=n[r];if(this.equalsFunction(e,a.key))return!0}return!1},s.prototype.get=function(e){var t="hash_"+this.hashFunction(e);if(t in this.data)for(var n=this.data[t],r=0;r<n.length;r++){var a=n[r];if(this.equalsFunction(e,a.key))return a.value}return null},s.prototype.entries=function(){var e=[];for(var t in this.data)0===t.indexOf("hash_")&&(e=e.concat(this.data[t]));return e},s.prototype.getKeys=function(){return this.entries().map((function(e){return e.key}))},s.prototype.getValues=function(){return this.entries().map((function(e){return e.value}))},s.prototype.toString=function(){return"["+this.entries().map((function(e){return"{"+e.key+":"+e.value+"}"})).join(", ")+"]"},l.prototype.get=function(e){return(e="k-"+e)in this.data?this.data[e]:null},l.prototype.put=function(e,t){e="k-"+e,this.data[e]=t},l.prototype.values=function(){var e=this.data;return Object.keys(this.data).map((function(t){return e[t]}))},u.prototype.update=function(){for(var e=0;e<arguments.length;e++){var t=arguments[e];if(null!=t)if(Array.isArray(t))this.update.apply(t);else{var n=0;switch(typeof t){case"undefined":case"function":continue;case"number":case"boolean":n=t;break;case"string":n=t.hashCode();break;default:t.updateHashCode(this);continue}n=(n*=3432918353)<<15|n>>>17,n*=461845907,this.count=this.count+1;var r=this.hash^n;r=5*(r=r<<13|r>>>19)+3864292196,this.hash=r}}},u.prototype.finish=function(){var e=this.hash^4*this.count;return e^=e>>>16,e*=2246822507,e^=e>>>13,(e*=3266489909)^e>>>16},p.prototype.get=function(e,t){var n=this[e]||null;return null===n?null:n[t]||null},p.prototype.set=function(e,t,n){var r=this[e]||null;null===r&&(r={},this[e]=r),r[t]=n},t.Hash=u,t.Set=i,t.Map=s,t.BitSet=o,t.AltDict=l,t.DoubleDict=p,t.hashStuff=function(){var e=new u;return e.update.apply(arguments),e.finish()},t.escapeWhitespace=function(e,t){return e=e.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r"),t&&(e=e.replace(/ /g,"·")),e},t.arrayToString=n,t.titleCase=function(e){return e.replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1)}))},t.equalArrays=function(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e==t)return!0;if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n]&&!e[n].equals(t[n]))return!1;return!0}},906:(e,t,n)=>{var r=n(4e3).a,a=n(3922).m;function i(e,t){return this.grammarType=e,this.maxTokenType=t,this.states=[],this.decisionToState=[],this.ruleToStartState=[],this.ruleToStopState=null,this.modeNameToStartState={},this.ruleToTokenType=null,this.lexerActions=null,this.modeToStartState=[],this}i.prototype.nextTokensInContext=function(e,t){return new r(this).LOOK(e,null,t)},i.prototype.nextTokensNoContext=function(e){return null!==e.nextTokenWithinRule||(e.nextTokenWithinRule=this.nextTokensInContext(e,null),e.nextTokenWithinRule.readOnly=!0),e.nextTokenWithinRule},i.prototype.nextTokens=function(e,t){return void 0===t?this.nextTokensNoContext(e):this.nextTokensInContext(e,t)},i.prototype.addState=function(e){null!==e&&(e.atn=this,e.stateNumber=this.states.length),this.states.push(e)},i.prototype.removeState=function(e){this.states[e.stateNumber]=null},i.prototype.defineDecisionState=function(e){return this.decisionToState.push(e),e.decision=this.decisionToState.length-1,e.decision},i.prototype.getDecisionState=function(e){return 0===this.decisionToState.length?null:this.decisionToState[e]};var o=n(2792).Token;i.prototype.getExpectedTokens=function(e,t){if(e<0||e>=this.states.length)throw"Invalid state number.";var n=this.states[e],r=this.nextTokens(n);if(!r.contains(o.EPSILON))return r;var i=new a;for(i.addSet(r),i.removeOne(o.EPSILON);null!==t&&t.invokingState>=0&&r.contains(o.EPSILON);){var s=this.states[t.invokingState].transitions[0];r=this.nextTokens(s.followState),i.addSet(r),i.removeOne(o.EPSILON),t=t.parentCtx}return r.contains(o.EPSILON)&&i.addOne(o.EOF),i},i.INVALID_ALT_NUMBER=0,t.ATN=i},6664:(e,t,n)=>{var r=n(6005).DecisionState,a=n(8828).Ij,i=n(8720).Hash;function o(e,t){if(null===e){var n={state:null,alt:null,context:null,semanticContext:null};return t&&(n.reachesIntoOuterContext=0),n}var r={};return r.state=e.state||null,r.alt=void 0===e.alt?null:e.alt,r.context=e.context||null,r.semanticContext=e.semanticContext||null,t&&(r.reachesIntoOuterContext=e.reachesIntoOuterContext||0,r.precedenceFilterSuppressed=e.precedenceFilterSuppressed||!1),r}function s(e,t){return this.checkContext(e,t),e=o(e),t=o(t,!0),this.state=null!==e.state?e.state:t.state,this.alt=null!==e.alt?e.alt:t.alt,this.context=null!==e.context?e.context:t.context,this.semanticContext=null!==e.semanticContext?e.semanticContext:null!==t.semanticContext?t.semanticContext:a.NONE,this.reachesIntoOuterContext=t.reachesIntoOuterContext,this.precedenceFilterSuppressed=t.precedenceFilterSuppressed,this}function l(e,t){s.call(this,e,t);var n=e.lexerActionExecutor||null;return this.lexerActionExecutor=n||(null!==t?t.lexerActionExecutor:null),this.passedThroughNonGreedyDecision=null!==t&&this.checkNonGreedyDecision(t,this.state),this}s.prototype.checkContext=function(e,t){null!==e.context&&void 0!==e.context||null!==t&&null!==t.context&&void 0!==t.context||(this.context=null)},s.prototype.hashCode=function(){var e=new i;return this.updateHashCode(e),e.finish()},s.prototype.updateHashCode=function(e){e.update(this.state.stateNumber,this.alt,this.context,this.semanticContext)},s.prototype.equals=function(e){return this===e||e instanceof s&&this.state.stateNumber===e.state.stateNumber&&this.alt===e.alt&&(null===this.context?null===e.context:this.context.equals(e.context))&&this.semanticContext.equals(e.semanticContext)&&this.precedenceFilterSuppressed===e.precedenceFilterSuppressed},s.prototype.hashCodeForConfigSet=function(){var e=new i;return e.update(this.state.stateNumber,this.alt,this.semanticContext),e.finish()},s.prototype.equalsForConfigSet=function(e){return this===e||e instanceof s&&this.state.stateNumber===e.state.stateNumber&&this.alt===e.alt&&this.semanticContext.equals(e.semanticContext)},s.prototype.toString=function(){return"("+this.state+","+this.alt+(null!==this.context?",["+this.context.toString()+"]":"")+(this.semanticContext!==a.NONE?","+this.semanticContext.toString():"")+(this.reachesIntoOuterContext>0?",up="+this.reachesIntoOuterContext:"")+")"},l.prototype=Object.create(s.prototype),l.prototype.constructor=l,l.prototype.updateHashCode=function(e){e.update(this.state.stateNumber,this.alt,this.context,this.semanticContext,this.passedThroughNonGreedyDecision,this.lexerActionExecutor)},l.prototype.equals=function(e){return this===e||e instanceof l&&this.passedThroughNonGreedyDecision==e.passedThroughNonGreedyDecision&&(this.lexerActionExecutor?this.lexerActionExecutor.equals(e.lexerActionExecutor):!e.lexerActionExecutor)&&s.prototype.equals.call(this,e)},l.prototype.hashCodeForConfigSet=l.prototype.hashCode,l.prototype.equalsForConfigSet=l.prototype.equals,l.prototype.checkNonGreedyDecision=function(e,t){return e.passedThroughNonGreedyDecision||t instanceof r&&t.nonGreedy},t.G=s,t.I=l},3218:(e,t,n)=>{var r=n(906).ATN,a=n(8720),i=a.Hash,o=a.Set,s=n(8828).Ij,l=n(4997).merge;function p(e){return e.hashCodeForConfigSet()}function u(e,t){return e===t||null!==e&&null!==t&&e.equalsForConfigSet(t)}function m(e){return this.configLookup=new o(p,u),this.fullCtx=void 0===e||e,this.readOnly=!1,this.configs=[],this.uniqueAlt=0,this.conflictingAlts=null,this.hasSemanticContext=!1,this.dipsIntoOuterContext=!1,this.cachedHashCode=-1,this}function c(){return m.call(this),this.configLookup=new o,this}m.prototype.add=function(e,t){if(void 0===t&&(t=null),this.readOnly)throw"This set is readonly";e.semanticContext!==s.NONE&&(this.hasSemanticContext=!0),e.reachesIntoOuterContext>0&&(this.dipsIntoOuterContext=!0);var n=this.configLookup.add(e);if(n===e)return this.cachedHashCode=-1,this.configs.push(e),!0;var r=!this.fullCtx,a=l(n.context,e.context,r,t);return n.reachesIntoOuterContext=Math.max(n.reachesIntoOuterContext,e.reachesIntoOuterContext),e.precedenceFilterSuppressed&&(n.precedenceFilterSuppressed=!0),n.context=a,!0},m.prototype.getStates=function(){for(var e=new o,t=0;t<this.configs.length;t++)e.add(this.configs[t].state);return e},m.prototype.getPredicates=function(){for(var e=[],t=0;t<this.configs.length;t++){var n=this.configs[t].semanticContext;n!==s.NONE&&e.push(n.semanticContext)}return e},Object.defineProperty(m.prototype,"items",{get:function(){return this.configs}}),m.prototype.optimizeConfigs=function(e){if(this.readOnly)throw"This set is readonly";if(0!==this.configLookup.length)for(var t=0;t<this.configs.length;t++){var n=this.configs[t];n.context=e.getCachedContext(n.context)}},m.prototype.addAll=function(e){for(var t=0;t<e.length;t++)this.add(e[t]);return!1},m.prototype.equals=function(e){return this===e||e instanceof m&&a.equalArrays(this.configs,e.configs)&&this.fullCtx===e.fullCtx&&this.uniqueAlt===e.uniqueAlt&&this.conflictingAlts===e.conflictingAlts&&this.hasSemanticContext===e.hasSemanticContext&&this.dipsIntoOuterContext===e.dipsIntoOuterContext},m.prototype.hashCode=function(){var e=new i;return this.updateHashCode(e),e.finish()},m.prototype.updateHashCode=function(e){this.readOnly?(-1===this.cachedHashCode&&((e=new i).update(this.configs),this.cachedHashCode=e.finish()),e.update(this.cachedHashCode)):e.update(this.configs)},Object.defineProperty(m.prototype,"length",{get:function(){return this.configs.length}}),m.prototype.isEmpty=function(){return 0===this.configs.length},m.prototype.contains=function(e){if(null===this.configLookup)throw"This method is not implemented for readonly sets.";return this.configLookup.contains(e)},m.prototype.containsFast=function(e){if(null===this.configLookup)throw"This method is not implemented for readonly sets.";return this.configLookup.containsFast(e)},m.prototype.clear=function(){if(this.readOnly)throw"This set is readonly";this.configs=[],this.cachedHashCode=-1,this.configLookup=new o},m.prototype.setReadonly=function(e){this.readOnly=e,e&&(this.configLookup=null)},m.prototype.toString=function(){return a.arrayToString(this.configs)+(this.hasSemanticContext?",hasSemanticContext="+this.hasSemanticContext:"")+(this.uniqueAlt!==r.INVALID_ALT_NUMBER?",uniqueAlt="+this.uniqueAlt:"")+(null!==this.conflictingAlts?",conflictingAlts="+this.conflictingAlts:"")+(this.dipsIntoOuterContext?",dipsIntoOuterContext":"")},c.prototype=Object.create(m.prototype),c.prototype.constructor=c,t.Q=m,t.F=c},1091:(e,t)=>{function n(e){return void 0===e&&(e=null),this.readOnly=!1,this.verifyATN=null===e||e.verifyATN,this.generateRuleBypassTransitions=null!==e&&e.generateRuleBypassTransitions,this}n.defaultOptions=new n,n.defaultOptions.readOnly=!0,t.$=n},2677:(e,t,n)=>{var r=n(2792).Token,a=n(906).ATN,i=n(1266).E,o=n(6005),s=o.ATNState,l=o.BasicState,p=o.DecisionState,u=o.BlockStartState,m=o.BlockEndState,c=o.LoopEndState,h=o.RuleStartState,g=o.RuleStopState,T=o.TokensStartState,y=o.PlusLoopbackState,d=o.StarLoopbackState,f=o.StarLoopEntryState,S=o.PlusBlockStartState,b=o.StarBlockStartState,x=o.BasicBlockStartState,A=n(2552),L=A.Transition,E=A.AtomTransition,I=A.SetTransition,D=A.NotSetTransition,v=A.RuleTransition,_=A.RangeTransition,C=A.ActionTransition,O=A.EpsilonTransition,B=A.WildcardTransition,j=A.PredicateTransition,N=A.PrecedencePredicateTransition,w=n(3922).m,R=(n(3922).Interval,n(1091).$),F=n(327),k=F.LexerActionType,$=F.LexerSkipAction,P=F.LexerChannelAction,M=F.LexerCustomAction,U=F.LexerMoreAction,q=F.LexerTypeAction,G=F.LexerPushModeAction,H=F.LexerPopModeAction,V=F.LexerModeAction,K="59627784-3BE5-417A-B9EB-8131A7286089",Y=["AADB8D7E-AEEF-4415-AD2B-8204D6CF042E",K],X=K;function z(e,t){var n=[];return n[e-1]=t,n.map((function(e){return t}))}function W(e){return null==e&&(e=R.defaultOptions),this.deserializationOptions=e,this.stateFactories=null,this.actionFactories=null,this}W.prototype.isFeatureSupported=function(e,t){var n=Y.indexOf(e);return!(n<0)&&Y.indexOf(t)>=n},W.prototype.deserialize=function(e){this.reset(e),this.checkVersion(),this.checkUUID();var t=this.readATN();this.readStates(t),this.readRules(t),this.readModes(t);var n=[];return this.readSets(t,n,this.readInt.bind(this)),this.isFeatureSupported(K,this.uuid)&&this.readSets(t,n,this.readInt32.bind(this)),this.readEdges(t,n),this.readDecisions(t),this.readLexerActions(t),this.markPrecedenceDecisions(t),this.verifyATN(t),this.deserializationOptions.generateRuleBypassTransitions&&t.grammarType===i.PARSER&&(this.generateRuleBypassTransitions(t),this.verifyATN(t)),t},W.prototype.reset=function(e){var t=e.split("").map((function(e){var t=e.charCodeAt(0);return t>1?t-2:t+65533}));t[0]=e.charCodeAt(0),this.data=t,this.pos=0},W.prototype.checkVersion=function(){var e=this.readInt();if(3!==e)throw"Could not deserialize ATN with version "+e+" (expected 3)."},W.prototype.checkUUID=function(){var e=this.readUUID();if(Y.indexOf(e)<0)throw X;this.uuid=e},W.prototype.readATN=function(){var e=this.readInt(),t=this.readInt();return new a(e,t)},W.prototype.readStates=function(e){for(var t,n,r,a=[],i=[],o=this.readInt(),l=0;l<o;l++){var p=this.readInt();if(p!==s.INVALID_TYPE){var m=this.readInt();65535===m&&(m=-1);var c=this.stateFactory(p,m);if(p===s.LOOP_END){var h=this.readInt();a.push([c,h])}else if(c instanceof u){var g=this.readInt();i.push([c,g])}e.addState(c)}else e.addState(null)}for(t=0;t<a.length;t++)(n=a[t])[0].loopBackState=e.states[n[1]];for(t=0;t<i.length;t++)(n=i[t])[0].endState=e.states[n[1]];var T=this.readInt();for(t=0;t<T;t++)r=this.readInt(),e.states[r].nonGreedy=!0;var y=this.readInt();for(t=0;t<y;t++)r=this.readInt(),e.states[r].isPrecedenceRule=!0},W.prototype.readRules=function(e){var t,n=this.readInt();for(e.grammarType===i.LEXER&&(e.ruleToTokenType=z(n,0)),e.ruleToStartState=z(n,0),t=0;t<n;t++){var a=this.readInt(),o=e.states[a];if(e.ruleToStartState[t]=o,e.grammarType===i.LEXER){var s=this.readInt();65535===s&&(s=r.EOF),e.ruleToTokenType[t]=s}}for(e.ruleToStopState=z(n,0),t=0;t<e.states.length;t++){var l=e.states[t];l instanceof g&&(e.ruleToStopState[l.ruleIndex]=l,e.ruleToStartState[l.ruleIndex].stopState=l)}},W.prototype.readModes=function(e){for(var t=this.readInt(),n=0;n<t;n++){var r=this.readInt();e.modeToStartState.push(e.states[r])}},W.prototype.readSets=function(e,t,n){for(var r=this.readInt(),a=0;a<r;a++){var i=new w;t.push(i);var o=this.readInt();0!==this.readInt()&&i.addOne(-1);for(var s=0;s<o;s++){var l=n(),p=n();i.addRange(l,p)}}},W.prototype.readEdges=function(e,t){var n,r,a,i,o,s=this.readInt();for(n=0;n<s;n++){var l=this.readInt(),p=this.readInt(),m=this.readInt(),c=this.readInt(),h=this.readInt(),g=this.readInt();i=this.edgeFactory(e,m,l,p,c,h,g,t),e.states[l].addTransition(i)}for(n=0;n<e.states.length;n++)for(a=e.states[n],r=0;r<a.transitions.length;r++){var T=a.transitions[r];if(T instanceof v){var b=-1;e.ruleToStartState[T.target.ruleIndex].isPrecedenceRule&&0===T.precedence&&(b=T.target.ruleIndex),i=new O(T.followState,b),e.ruleToStopState[T.target.ruleIndex].addTransition(i)}}for(n=0;n<e.states.length;n++){if((a=e.states[n])instanceof u){if(null===a.endState)throw"IllegalState";if(null!==a.endState.startState)throw"IllegalState";a.endState.startState=a}if(a instanceof y)for(r=0;r<a.transitions.length;r++)(o=a.transitions[r].target)instanceof S&&(o.loopBackState=a);else if(a instanceof d)for(r=0;r<a.transitions.length;r++)(o=a.transitions[r].target)instanceof f&&(o.loopBackState=a)}},W.prototype.readDecisions=function(e){for(var t=this.readInt(),n=0;n<t;n++){var r=this.readInt(),a=e.states[r];e.decisionToState.push(a),a.decision=n}},W.prototype.readLexerActions=function(e){if(e.grammarType===i.LEXER){var t=this.readInt();e.lexerActions=z(t,null);for(var n=0;n<t;n++){var r=this.readInt(),a=this.readInt();65535===a&&(a=-1);var o=this.readInt();65535===o&&(o=-1);var s=this.lexerActionFactory(r,a,o);e.lexerActions[n]=s}}},W.prototype.generateRuleBypassTransitions=function(e){var t,n=e.ruleToStartState.length;for(t=0;t<n;t++)e.ruleToTokenType[t]=e.maxTokenType+t+1;for(t=0;t<n;t++)this.generateRuleBypassTransition(e,t)},W.prototype.generateRuleBypassTransition=function(e,t){var n,r,a=new x;a.ruleIndex=t,e.addState(a);var i=new m;i.ruleIndex=t,e.addState(i),a.endState=i,e.defineDecisionState(a),i.startState=a;var o=null,s=null;if(e.ruleToStartState[t].isPrecedenceRule){for(s=null,n=0;n<e.states.length;n++)if(r=e.states[n],this.stateIsEndStateFor(r,t)){s=r,o=r.loopBackState.transitions[0];break}if(null===o)throw"Couldn't identify final state of the precedence rule prefix section."}else s=e.ruleToStopState[t];for(n=0;n<e.states.length;n++){r=e.states[n];for(var p=0;p<r.transitions.length;p++){var u=r.transitions[p];u!==o&&u.target===s&&(u.target=i)}}for(var c=e.ruleToStartState[t],h=c.transitions.length;h>0;)a.addTransition(c.transitions[h-1]),c.transitions=c.transitions.slice(-1);e.ruleToStartState[t].addTransition(new O(a)),i.addTransition(new O(s));var g=new l;e.addState(g),g.addTransition(new E(i,e.ruleToTokenType[t])),a.addTransition(new O(g))},W.prototype.stateIsEndStateFor=function(e,t){if(e.ruleIndex!==t)return null;if(!(e instanceof f))return null;var n=e.transitions[e.transitions.length-1].target;return n instanceof c&&n.epsilonOnlyTransitions&&n.transitions[0].target instanceof g?e:null},W.prototype.markPrecedenceDecisions=function(e){for(var t=0;t<e.states.length;t++){var n=e.states[t];if(n instanceof f&&e.ruleToStartState[n.ruleIndex].isPrecedenceRule){var r=n.transitions[n.transitions.length-1].target;r instanceof c&&r.epsilonOnlyTransitions&&r.transitions[0].target instanceof g&&(n.isPrecedenceDecision=!0)}}},W.prototype.verifyATN=function(e){if(this.deserializationOptions.verifyATN)for(var t=0;t<e.states.length;t++){var n=e.states[t];if(null!==n)if(this.checkCondition(n.epsilonOnlyTransitions||n.transitions.length<=1),n instanceof S)this.checkCondition(null!==n.loopBackState);else if(n instanceof f)if(this.checkCondition(null!==n.loopBackState),this.checkCondition(2===n.transitions.length),n.transitions[0].target instanceof b)this.checkCondition(n.transitions[1].target instanceof c),this.checkCondition(!n.nonGreedy);else{if(!(n.transitions[0].target instanceof c))throw"IllegalState";this.checkCondition(n.transitions[1].target instanceof b),this.checkCondition(n.nonGreedy)}else n instanceof d?(this.checkCondition(1===n.transitions.length),this.checkCondition(n.transitions[0].target instanceof f)):n instanceof c?this.checkCondition(null!==n.loopBackState):n instanceof h?this.checkCondition(null!==n.stopState):n instanceof u?this.checkCondition(null!==n.endState):n instanceof m?this.checkCondition(null!==n.startState):n instanceof p?this.checkCondition(n.transitions.length<=1||n.decision>=0):this.checkCondition(n.transitions.length<=1||n instanceof g)}},W.prototype.checkCondition=function(e,t){if(!e)throw null==t&&(t="IllegalState"),t},W.prototype.readInt=function(){return this.data[this.pos++]},W.prototype.readInt32=function(){return this.readInt()|this.readInt()<<16},W.prototype.readLong=function(){return 4294967295&this.readInt32()|this.readInt32()<<32};var J=function(){for(var e=[],t=0;t<256;t++)e[t]=(t+256).toString(16).substr(1).toUpperCase();return e}();W.prototype.readUUID=function(){for(var e=[],t=7;t>=0;t--){var n=this.readInt();e[2*t+1]=255&n,e[2*t]=n>>8&255}return J[e[0]]+J[e[1]]+J[e[2]]+J[e[3]]+"-"+J[e[4]]+J[e[5]]+"-"+J[e[6]]+J[e[7]]+"-"+J[e[8]]+J[e[9]]+"-"+J[e[10]]+J[e[11]]+J[e[12]]+J[e[13]]+J[e[14]]+J[e[15]]},W.prototype.edgeFactory=function(e,t,n,a,i,o,s,l){var p=e.states[a];switch(t){case L.EPSILON:return new O(p);case L.RANGE:return new _(p,0!==s?r.EOF:i,o);case L.RULE:return new v(e.states[i],o,s,p);case L.PREDICATE:return new j(p,i,o,0!==s);case L.PRECEDENCE:return new N(p,i);case L.ATOM:return new E(p,0!==s?r.EOF:i);case L.ACTION:return new C(p,i,o,0!==s);case L.SET:return new I(p,l[i]);case L.NOT_SET:return new D(p,l[i]);case L.WILDCARD:return new B(p);default:throw"The specified transition type: "+t+" is not valid."}},W.prototype.stateFactory=function(e,t){if(null===this.stateFactories){var n=[];n[s.INVALID_TYPE]=null,n[s.BASIC]=function(){return new l},n[s.RULE_START]=function(){return new h},n[s.BLOCK_START]=function(){return new x},n[s.PLUS_BLOCK_START]=function(){return new S},n[s.STAR_BLOCK_START]=function(){return new b},n[s.TOKEN_START]=function(){return new T},n[s.RULE_STOP]=function(){return new g},n[s.BLOCK_END]=function(){return new m},n[s.STAR_LOOP_BACK]=function(){return new d},n[s.STAR_LOOP_ENTRY]=function(){return new f},n[s.PLUS_LOOP_BACK]=function(){return new y},n[s.LOOP_END]=function(){return new c},this.stateFactories=n}if(e>this.stateFactories.length||null===this.stateFactories[e])throw"The specified state type "+e+" is not valid.";var r=this.stateFactories[e]();if(null!==r)return r.ruleIndex=t,r},W.prototype.lexerActionFactory=function(e,t,n){if(null===this.actionFactories){var r=[];r[k.CHANNEL]=function(e,t){return new P(e)},r[k.CUSTOM]=function(e,t){return new M(e,t)},r[k.MODE]=function(e,t){return new V(e)},r[k.MORE]=function(e,t){return U.INSTANCE},r[k.POP_MODE]=function(e,t){return H.INSTANCE},r[k.PUSH_MODE]=function(e,t){return new G(e)},r[k.SKIP]=function(e,t){return $.INSTANCE},r[k.TYPE]=function(e,t){return new q(e)},this.actionFactories=r}if(e>this.actionFactories.length||null===this.actionFactories[e])throw"The specified lexer action type "+e+" is not valid.";return this.actionFactories[e](t,n)},t.ATNDeserializer=W},1938:(e,t,n)=>{var r=n(2117).X,a=n(3218).Q,i=n(4997).getCachedPredictionContext;function o(e,t){return this.atn=e,this.sharedContextCache=t,this}o.ERROR=new r(2147483647,new a),o.prototype.getCachedContext=function(e){return null===this.sharedContextCache?e:i(e,this.sharedContextCache,{})},t.e=o},6005:(e,t)=>{function n(){return this.atn=null,this.stateNumber=n.INVALID_STATE_NUMBER,this.stateType=null,this.ruleIndex=0,this.epsilonOnlyTransitions=!1,this.transitions=[],this.nextTokenWithinRule=null,this}function r(){return n.call(this),this.stateType=n.BASIC,this}function a(){return n.call(this),this.decision=-1,this.nonGreedy=!1,this}function i(){return a.call(this),this.endState=null,this}function o(){return i.call(this),this.stateType=n.BLOCK_START,this}function s(){return n.call(this),this.stateType=n.BLOCK_END,this.startState=null,this}function l(){return n.call(this),this.stateType=n.RULE_STOP,this}function p(){return n.call(this),this.stateType=n.RULE_START,this.stopState=null,this.isPrecedenceRule=!1,this}function u(){return a.call(this),this.stateType=n.PLUS_LOOP_BACK,this}function m(){return i.call(this),this.stateType=n.PLUS_BLOCK_START,this.loopBackState=null,this}function c(){return i.call(this),this.stateType=n.STAR_BLOCK_START,this}function h(){return n.call(this),this.stateType=n.STAR_LOOP_BACK,this}function g(){return a.call(this),this.stateType=n.STAR_LOOP_ENTRY,this.loopBackState=null,this.isPrecedenceDecision=null,this}function T(){return n.call(this),this.stateType=n.LOOP_END,this.loopBackState=null,this}function y(){return a.call(this),this.stateType=n.TOKEN_START,this}n.INVALID_TYPE=0,n.BASIC=1,n.RULE_START=2,n.BLOCK_START=3,n.PLUS_BLOCK_START=4,n.STAR_BLOCK_START=5,n.TOKEN_START=6,n.RULE_STOP=7,n.BLOCK_END=8,n.STAR_LOOP_BACK=9,n.STAR_LOOP_ENTRY=10,n.PLUS_LOOP_BACK=11,n.LOOP_END=12,n.serializationNames=["INVALID","BASIC","RULE_START","BLOCK_START","PLUS_BLOCK_START","STAR_BLOCK_START","TOKEN_START","RULE_STOP","BLOCK_END","STAR_LOOP_BACK","STAR_LOOP_ENTRY","PLUS_LOOP_BACK","LOOP_END"],n.INVALID_STATE_NUMBER=-1,n.prototype.toString=function(){return this.stateNumber},n.prototype.equals=function(e){return e instanceof n&&this.stateNumber===e.stateNumber},n.prototype.isNonGreedyExitState=function(){return!1},n.prototype.addTransition=function(e,t){void 0===t&&(t=-1),0===this.transitions.length?this.epsilonOnlyTransitions=e.isEpsilon:this.epsilonOnlyTransitions!==e.isEpsilon&&(this.epsilonOnlyTransitions=!1),-1===t?this.transitions.push(e):this.transitions.splice(t,1,e)},r.prototype=Object.create(n.prototype),r.prototype.constructor=r,a.prototype=Object.create(n.prototype),a.prototype.constructor=a,i.prototype=Object.create(a.prototype),i.prototype.constructor=i,o.prototype=Object.create(i.prototype),o.prototype.constructor=o,s.prototype=Object.create(n.prototype),s.prototype.constructor=s,l.prototype=Object.create(n.prototype),l.prototype.constructor=l,p.prototype=Object.create(n.prototype),p.prototype.constructor=p,u.prototype=Object.create(a.prototype),u.prototype.constructor=u,m.prototype=Object.create(i.prototype),m.prototype.constructor=m,c.prototype=Object.create(i.prototype),c.prototype.constructor=c,h.prototype=Object.create(n.prototype),h.prototype.constructor=h,g.prototype=Object.create(a.prototype),g.prototype.constructor=g,T.prototype=Object.create(n.prototype),T.prototype.constructor=T,y.prototype=Object.create(a.prototype),y.prototype.constructor=y,t.ATNState=n,t.BasicState=r,t.DecisionState=a,t.BlockStartState=i,t.BlockEndState=s,t.LoopEndState=T,t.RuleStartState=p,t.RuleStopState=l,t.TokensStartState=y,t.PlusLoopbackState=u,t.StarLoopbackState=h,t.StarLoopEntryState=g,t.PlusBlockStartState=m,t.StarBlockStartState=c,t.BasicBlockStartState=o},1266:(e,t)=>{function n(){}n.LEXER=0,n.PARSER=1,t.E=n},1976:(e,t,n)=>{var r=n(2792).Token,a=n(4479).Lexer,i=n(906).ATN,o=n(1938).e,s=n(2117).X,l=(n(3218).Q,n(3218).F),p=n(4997).PredictionContext,u=n(4997).SingletonPredictionContext,m=n(6005).RuleStopState,c=n(6664).I,h=n(2552).Transition,g=n(9886).I,T=n(2233).LexerNoViableAltException;function y(e){e.index=-1,e.line=0,e.column=-1,e.dfaState=null}function d(){return y(this),this}function f(e,t,n,r){return o.call(this,t,r),this.decisionToDFA=n,this.recog=e,this.startIndex=-1,this.line=1,this.column=0,this.mode=a.DEFAULT_MODE,this.prevAccept=new d,this}d.prototype.reset=function(){y(this)},f.prototype=Object.create(o.prototype),f.prototype.constructor=f,f.debug=!1,f.dfa_debug=!1,f.MIN_DFA_EDGE=0,f.MAX_DFA_EDGE=127,f.match_calls=0,f.prototype.copyState=function(e){this.column=e.column,this.line=e.line,this.mode=e.mode,this.startIndex=e.startIndex},f.prototype.match=function(e,t){this.match_calls+=1,this.mode=t;var n=e.mark();try{this.startIndex=e.index,this.prevAccept.reset();var r=this.decisionToDFA[t];return null===r.s0?this.matchATN(e):this.execATN(e,r.s0)}finally{e.release(n)}},f.prototype.reset=function(){this.prevAccept.reset(),this.startIndex=-1,this.line=1,this.column=0,this.mode=a.DEFAULT_MODE},f.prototype.matchATN=function(e){var t=this.atn.modeToStartState[this.mode];f.debug&&console.log("matchATN mode "+this.mode+" start: "+t);var n=this.mode,r=this.computeStartState(e,t),a=r.hasSemanticContext;r.hasSemanticContext=!1;var i=this.addDFAState(r);a||(this.decisionToDFA[this.mode].s0=i);var o=this.execATN(e,i);return f.debug&&console.log("DFA after matchATN: "+this.decisionToDFA[n].toLexerString()),o},f.prototype.execATN=function(e,t){f.debug&&console.log("start state closure="+t.configs),t.isAcceptState&&this.captureSimState(this.prevAccept,e,t);for(var n=e.LA(1),a=t;;){f.debug&&console.log("execATN loop starting closure: "+a.configs);var i=this.getExistingTargetState(a,n);if(null===i&&(i=this.computeTargetState(e,a,n)),i===o.ERROR)break;if(n!==r.EOF&&this.consume(e),i.isAcceptState&&(this.captureSimState(this.prevAccept,e,i),n===r.EOF))break;n=e.LA(1),a=i}return this.failOrAccept(this.prevAccept,e,a.configs,n)},f.prototype.getExistingTargetState=function(e,t){if(null===e.edges||t<f.MIN_DFA_EDGE||t>f.MAX_DFA_EDGE)return null;var n=e.edges[t-f.MIN_DFA_EDGE];return void 0===n&&(n=null),f.debug&&null!==n&&console.log("reuse state "+e.stateNumber+" edge to "+n.stateNumber),n},f.prototype.computeTargetState=function(e,t,n){var r=new l;return this.getReachableConfigSet(e,t.configs,r,n),0===r.items.length?(r.hasSemanticContext||this.addDFAEdge(t,n,o.ERROR),o.ERROR):this.addDFAEdge(t,n,null,r)},f.prototype.failOrAccept=function(e,t,n,a){if(null!==this.prevAccept.dfaState){var i=e.dfaState.lexerActionExecutor;return this.accept(t,i,this.startIndex,e.index,e.line,e.column),e.dfaState.prediction}if(a===r.EOF&&t.index===this.startIndex)return r.EOF;throw new T(this.recog,t,this.startIndex,n)},f.prototype.getReachableConfigSet=function(e,t,n,a){for(var o=i.INVALID_ALT_NUMBER,s=0;s<t.items.length;s++){var l=t.items[s],p=l.alt===o;if(!p||!l.passedThroughNonGreedyDecision){f.debug&&console.log("testing %s at %s\n",this.getTokenName(a),l.toString(this.recog,!0));for(var u=0;u<l.state.transitions.length;u++){var m=l.state.transitions[u],h=this.getReachableTarget(m,a);if(null!==h){var g=l.lexerActionExecutor;null!==g&&(g=g.fixOffsetBeforeMatch(e.index-this.startIndex));var T=a===r.EOF,y=new c({state:h,lexerActionExecutor:g},l);this.closure(e,y,n,p,!0,T)&&(o=l.alt)}}}}},f.prototype.accept=function(e,t,n,r,a,i){f.debug&&console.log("ACTION %s\n",t),e.seek(r),this.line=a,this.column=i,null!==t&&null!==this.recog&&t.execute(this.recog,e,n)},f.prototype.getReachableTarget=function(e,t){return e.matches(t,0,a.MAX_CHAR_VALUE)?e.target:null},f.prototype.computeStartState=function(e,t){for(var n=p.EMPTY,r=new l,a=0;a<t.transitions.length;a++){var i=t.transitions[a].target,o=new c({state:i,alt:a+1,context:n},null);this.closure(e,o,r,!1,!1,!1)}return r},f.prototype.closure=function(e,t,n,r,a,i){var o=null;if(f.debug&&console.log("closure("+t.toString(this.recog,!0)+")"),t.state instanceof m){if(f.debug&&(null!==this.recog?console.log("closure at %s rule stop %s\n",this.recog.ruleNames[t.state.ruleIndex],t):console.log("closure at rule stop %s\n",t)),null===t.context||t.context.hasEmptyPath()){if(null===t.context||t.context.isEmpty())return n.add(t),!0;n.add(new c({state:t.state,context:p.EMPTY},t)),r=!0}if(null!==t.context&&!t.context.isEmpty())for(var s=0;s<t.context.length;s++)if(t.context.getReturnState(s)!==p.EMPTY_RETURN_STATE){var l=t.context.getParent(s),u=this.atn.states[t.context.getReturnState(s)];o=new c({state:u,context:l},t),r=this.closure(e,o,n,r,a,i)}return r}t.state.epsilonOnlyTransitions||r&&t.passedThroughNonGreedyDecision||n.add(t);for(var h=0;h<t.state.transitions.length;h++){var g=t.state.transitions[h];null!==(o=this.getEpsilonTarget(e,t,g,n,a,i))&&(r=this.closure(e,o,n,r,a,i))}return r},f.prototype.getEpsilonTarget=function(e,t,n,i,o,s){var l=null;if(n.serializationType===h.RULE){var p=u.create(t.context,n.followState.stateNumber);l=new c({state:n.target,context:p},t)}else{if(n.serializationType===h.PRECEDENCE)throw"Precedence predicates are not supported in lexers.";if(n.serializationType===h.PREDICATE)f.debug&&console.log("EVAL rule "+n.ruleIndex+":"+n.predIndex),i.hasSemanticContext=!0,this.evaluatePredicate(e,n.ruleIndex,n.predIndex,o)&&(l=new c({state:n.target},t));else if(n.serializationType===h.ACTION)if(null===t.context||t.context.hasEmptyPath()){var m=g.append(t.lexerActionExecutor,this.atn.lexerActions[n.actionIndex]);l=new c({state:n.target,lexerActionExecutor:m},t)}else l=new c({state:n.target},t);else n.serializationType===h.EPSILON?l=new c({state:n.target},t):n.serializationType!==h.ATOM&&n.serializationType!==h.RANGE&&n.serializationType!==h.SET||s&&n.matches(r.EOF,0,a.MAX_CHAR_VALUE)&&(l=new c({state:n.target},t))}return l},f.prototype.evaluatePredicate=function(e,t,n,r){if(null===this.recog)return!0;if(!r)return this.recog.sempred(null,t,n);var a=this.column,i=this.line,o=e.index,s=e.mark();try{return this.consume(e),this.recog.sempred(null,t,n)}finally{this.column=a,this.line=i,e.seek(o),e.release(s)}},f.prototype.captureSimState=function(e,t,n){e.index=t.index,e.line=this.line,e.column=this.column,e.dfaState=n},f.prototype.addDFAEdge=function(e,t,n,r){if(void 0===n&&(n=null),void 0===r&&(r=null),null===n&&null!==r){var a=r.hasSemanticContext;if(r.hasSemanticContext=!1,n=this.addDFAState(r),a)return n}return t<f.MIN_DFA_EDGE||t>f.MAX_DFA_EDGE||(f.debug&&console.log("EDGE "+e+" -> "+n+" upon "+t),null===e.edges&&(e.edges=[]),e.edges[t-f.MIN_DFA_EDGE]=n),n},f.prototype.addDFAState=function(e){for(var t=new s(null,e),n=null,r=0;r<e.items.length;r++){var a=e.items[r];if(a.state instanceof m){n=a;break}}null!==n&&(t.isAcceptState=!0,t.lexerActionExecutor=n.lexerActionExecutor,t.prediction=this.atn.ruleToTokenType[n.state.ruleIndex]);var i=this.decisionToDFA[this.mode],o=i.states.get(t);if(null!==o)return o;var l=t;return l.stateNumber=i.states.length,e.setReadonly(!0),l.configs=e,i.states.add(l),l},f.prototype.getDFA=function(e){return this.decisionToDFA[e]},f.prototype.getText=function(e){return e.getText(this.startIndex,e.index-1)},f.prototype.consume=function(e){e.LA(1)==="\n".charCodeAt(0)?(this.line+=1,this.column=0):this.column+=1,e.consume()},f.prototype.getTokenName=function(e){return-1===e?"EOF":"'"+String.fromCharCode(e)+"'"},t.LexerATNSimulator=f},327:(e,t)=>{function n(){}function r(e){return this.actionType=e,this.isPositionDependent=!1,this}function a(){return r.call(this,n.SKIP),this}function i(e){return r.call(this,n.TYPE),this.type=e,this}function o(e){return r.call(this,n.PUSH_MODE),this.mode=e,this}function s(){return r.call(this,n.POP_MODE),this}function l(){return r.call(this,n.MORE),this}function p(e){return r.call(this,n.MODE),this.mode=e,this}function u(e,t){return r.call(this,n.CUSTOM),this.ruleIndex=e,this.actionIndex=t,this.isPositionDependent=!0,this}function m(e){return r.call(this,n.CHANNEL),this.channel=e,this}function c(e,t){return r.call(this,t.actionType),this.offset=e,this.action=t,this.isPositionDependent=!0,this}n.CHANNEL=0,n.CUSTOM=1,n.MODE=2,n.MORE=3,n.POP_MODE=4,n.PUSH_MODE=5,n.SKIP=6,n.TYPE=7,r.prototype.hashCode=function(){var e=new Hash;return this.updateHashCode(e),e.finish()},r.prototype.updateHashCode=function(e){e.update(this.actionType)},r.prototype.equals=function(e){return this===e},a.prototype=Object.create(r.prototype),a.prototype.constructor=a,a.INSTANCE=new a,a.prototype.execute=function(e){e.skip()},a.prototype.toString=function(){return"skip"},i.prototype=Object.create(r.prototype),i.prototype.constructor=i,i.prototype.execute=function(e){e.type=this.type},i.prototype.updateHashCode=function(e){e.update(this.actionType,this.type)},i.prototype.equals=function(e){return this===e||e instanceof i&&this.type===e.type},i.prototype.toString=function(){return"type("+this.type+")"},o.prototype=Object.create(r.prototype),o.prototype.constructor=o,o.prototype.execute=function(e){e.pushMode(this.mode)},o.prototype.updateHashCode=function(e){e.update(this.actionType,this.mode)},o.prototype.equals=function(e){return this===e||e instanceof o&&this.mode===e.mode},o.prototype.toString=function(){return"pushMode("+this.mode+")"},s.prototype=Object.create(r.prototype),s.prototype.constructor=s,s.INSTANCE=new s,s.prototype.execute=function(e){e.popMode()},s.prototype.toString=function(){return"popMode"},l.prototype=Object.create(r.prototype),l.prototype.constructor=l,l.INSTANCE=new l,l.prototype.execute=function(e){e.more()},l.prototype.toString=function(){return"more"},p.prototype=Object.create(r.prototype),p.prototype.constructor=p,p.prototype.execute=function(e){e.mode(this.mode)},p.prototype.updateHashCode=function(e){e.update(this.actionType,this.mode)},p.prototype.equals=function(e){return this===e||e instanceof p&&this.mode===e.mode},p.prototype.toString=function(){return"mode("+this.mode+")"},u.prototype=Object.create(r.prototype),u.prototype.constructor=u,u.prototype.execute=function(e){e.action(null,this.ruleIndex,this.actionIndex)},u.prototype.updateHashCode=function(e){e.update(this.actionType,this.ruleIndex,this.actionIndex)},u.prototype.equals=function(e){return this===e||e instanceof u&&this.ruleIndex===e.ruleIndex&&this.actionIndex===e.actionIndex},m.prototype=Object.create(r.prototype),m.prototype.constructor=m,m.prototype.execute=function(e){e._channel=this.channel},m.prototype.updateHashCode=function(e){e.update(this.actionType,this.channel)},m.prototype.equals=function(e){return this===e||e instanceof m&&this.channel===e.channel},m.prototype.toString=function(){return"channel("+this.channel+")"},c.prototype=Object.create(r.prototype),c.prototype.constructor=c,c.prototype.execute=function(e){this.action.execute(e)},c.prototype.updateHashCode=function(e){e.update(this.actionType,this.offset,this.action)},c.prototype.equals=function(e){return this===e||e instanceof c&&this.offset===e.offset&&this.action===e.action},t.LexerActionType=n,t.LexerSkipAction=a,t.LexerChannelAction=m,t.LexerCustomAction=u,t.LexerIndexedCustomAction=c,t.LexerMoreAction=l,t.LexerTypeAction=i,t.LexerPushModeAction=o,t.LexerPopModeAction=s,t.LexerModeAction=p},9886:(e,t,n)=>{var r=n(8720).hashStuff,a=n(327).LexerIndexedCustomAction;function i(e){return this.lexerActions=null===e?[]:e,this.cachedHashCode=r(e),this}i.append=function(e,t){return new i(null===e?[t]:e.lexerActions.concat([t]))},i.prototype.fixOffsetBeforeMatch=function(e){for(var t=null,n=0;n<this.lexerActions.length;n++)!this.lexerActions[n].isPositionDependent||this.lexerActions[n]instanceof a||(null===t&&(t=this.lexerActions.concat([])),t[n]=new a(e,this.lexerActions[n]));return null===t?this:new i(t)},i.prototype.execute=function(e,t,n){var r=!1,i=t.index;try{for(var o=0;o<this.lexerActions.length;o++){var s=this.lexerActions[o];if(s instanceof a){var l=s.offset;t.seek(n+l),s=s.action,r=n+l!==i}else s.isPositionDependent&&(t.seek(i),r=!1);s.execute(e)}}finally{r&&t.seek(i)}},i.prototype.hashCode=function(){return this.cachedHashCode},i.prototype.updateHashCode=function(e){e.update(this.cachedHashCode)},i.prototype.equals=function(e){if(this===e)return!0;if(e instanceof i){if(this.cachedHashCode!=e.cachedHashCode)return!1;if(this.lexerActions.length!=e.lexerActions.length)return!1;for(var t=this.lexerActions.length,n=0;n<t;++n)if(!this.lexerActions[n].equals(e.lexerActions[n]))return!1;return!0}return!1},t.I=i},7537:(e,t,n)=>{var r=n(8720),a=r.Set,i=r.BitSet,o=r.DoubleDict,s=n(906).ATN,l=n(6005).ATNState,p=n(6664).G,u=n(3218).Q,m=n(2792).Token,c=n(2117).X,h=n(2117).PredPrediction,g=n(1938).e,T=n(5941).PredictionMode,y=n(2200).m,d=(n(5425).ParserRuleContext,n(8828).Ij),f=(n(6005).StarLoopEntryState,n(6005).RuleStopState),S=n(4997).PredictionContext,b=n(3922).Interval,x=n(2552),A=x.Transition,L=x.SetTransition,E=x.NotSetTransition,I=x.RuleTransition,D=x.ActionTransition,v=n(2233).NoViableAltException,_=n(4997).SingletonPredictionContext,C=n(4997).predictionContextFromRuleContext;function O(e,t,n,r){return g.call(this,t,r),this.parser=e,this.decisionToDFA=n,this.predictionMode=T.LL,this._input=null,this._startIndex=0,this._outerContext=null,this._dfa=null,this.mergeCache=null,this}O.prototype=Object.create(g.prototype),O.prototype.constructor=O,O.prototype.debug=!1,O.prototype.debug_closure=!1,O.prototype.debug_add=!1,O.prototype.debug_list_atn_decisions=!1,O.prototype.dfa_debug=!1,O.prototype.retry_debug=!1,O.prototype.reset=function(){},O.prototype.adaptivePredict=function(e,t,n){(this.debug||this.debug_list_atn_decisions)&&console.log("adaptivePredict decision "+t+" exec LA(1)=="+this.getLookaheadName(e)+" line "+e.LT(1).line+":"+e.LT(1).column),this._input=e,this._startIndex=e.index,this._outerContext=n;var r=this.decisionToDFA[t];this._dfa=r;var a=e.mark(),i=e.index;try{var o;if(null===(o=r.precedenceDfa?r.getPrecedenceStartState(this.parser.getPrecedence()):r.s0)){null===n&&(n=y.EMPTY),(this.debug||this.debug_list_atn_decisions)&&console.log("predictATN decision "+r.decision+" exec LA(1)=="+this.getLookaheadName(e)+", outerContext="+n.toString(this.parser.ruleNames));var s=this.computeStartState(r.atnStartState,y.EMPTY,!1);r.precedenceDfa?(r.s0.configs=s,s=this.applyPrecedenceFilter(s),o=this.addDFAState(r,new c(null,s)),r.setPrecedenceStartState(this.parser.getPrecedence(),o)):(o=this.addDFAState(r,new c(null,s)),r.s0=o)}var l=this.execATN(r,o,e,i,n);return this.debug&&console.log("DFA after predictATN: "+r.toString(this.parser.literalNames)),l}finally{this._dfa=null,this.mergeCache=null,e.seek(i),e.release(a)}},O.prototype.execATN=function(e,t,n,r,a){var i;(this.debug||this.debug_list_atn_decisions)&&console.log("execATN decision "+e.decision+" exec LA(1)=="+this.getLookaheadName(n)+" line "+n.LT(1).line+":"+n.LT(1).column);var o=t;this.debug&&console.log("s0 = "+t);for(var l=n.LA(1);;){var p=this.getExistingTargetState(o,l);if(null===p&&(p=this.computeTargetState(e,o,l)),p===g.ERROR){var u=this.noViableAlt(n,a,o.configs,r);if(n.seek(r),(i=this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(o.configs,a))!==s.INVALID_ALT_NUMBER)return i;throw u}if(p.requiresFullContext&&this.predictionMode!==T.SLL){var c=null;if(null!==p.predicates){this.debug&&console.log("DFA state has preds in DFA sim LL failover");var h=n.index;if(h!==r&&n.seek(r),1===(c=this.evalSemanticContext(p.predicates,a,!0)).length)return this.debug&&console.log("Full LL avoided"),c.minValue();h!==r&&n.seek(h)}this.dfa_debug&&console.log("ctx sensitive state "+a+" in "+p);var y=this.computeStartState(e.atnStartState,a,!0);return this.reportAttemptingFullContext(e,c,p.configs,r,n.index),this.execATNWithFullContext(e,p,y,n,r,a)}if(p.isAcceptState){if(null===p.predicates)return p.prediction;var d=n.index;n.seek(r);var f=this.evalSemanticContext(p.predicates,a,!0);if(0===f.length)throw this.noViableAlt(n,a,p.configs,r);return 1===f.length||this.reportAmbiguity(e,p,r,d,!1,f,p.configs),f.minValue()}o=p,l!==m.EOF&&(n.consume(),l=n.LA(1))}},O.prototype.getExistingTargetState=function(e,t){var n=e.edges;return null===n?null:n[t+1]||null},O.prototype.computeTargetState=function(e,t,n){var a=this.computeReachSet(t.configs,n,!1);if(null===a)return this.addDFAEdge(e,t,n,g.ERROR),g.ERROR;var i=new c(null,a),o=this.getUniqueAlt(a);if(this.debug){var l=T.getConflictingAltSubsets(a);console.log("SLL altSubSets="+r.arrayToString(l)+", previous="+t.configs+", configs="+a+", predict="+o+", allSubsetsConflict="+T.allSubsetsConflict(l)+", conflictingAlts="+this.getConflictingAlts(a))}return o!==s.INVALID_ALT_NUMBER?(i.isAcceptState=!0,i.configs.uniqueAlt=o,i.prediction=o):T.hasSLLConflictTerminatingPrediction(this.predictionMode,a)&&(i.configs.conflictingAlts=this.getConflictingAlts(a),i.requiresFullContext=!0,i.isAcceptState=!0,i.prediction=i.configs.conflictingAlts.minValue()),i.isAcceptState&&i.configs.hasSemanticContext&&(this.predicateDFAState(i,this.atn.getDecisionState(e.decision)),null!==i.predicates&&(i.prediction=s.INVALID_ALT_NUMBER)),this.addDFAEdge(e,t,n,i)},O.prototype.predicateDFAState=function(e,t){var n=t.transitions.length,r=this.getConflictingAltsOrUniqueAlt(e.configs),a=this.getPredsForAmbigAlts(r,e.configs,n);null!==a?(e.predicates=this.getPredicatePredictions(r,a),e.prediction=s.INVALID_ALT_NUMBER):e.prediction=r.minValue()},O.prototype.execATNWithFullContext=function(e,t,n,r,a,i){(this.debug||this.debug_list_atn_decisions)&&console.log("execATNWithFullContext "+n);var o=!1,l=null,p=n;r.seek(a);for(var u=r.LA(1),c=-1;;){if(null===(l=this.computeReachSet(p,u,!0))){var h=this.noViableAlt(r,i,p,a);r.seek(a);var g=this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(p,i);if(g!==s.INVALID_ALT_NUMBER)return g;throw h}var y=T.getConflictingAltSubsets(l);if(this.debug&&console.log("LL altSubSets="+y+", predict="+T.getUniqueAlt(y)+", resolvesToJustOneViableAlt="+T.resolvesToJustOneViableAlt(y)),l.uniqueAlt=this.getUniqueAlt(l),l.uniqueAlt!==s.INVALID_ALT_NUMBER){c=l.uniqueAlt;break}if(this.predictionMode!==T.LL_EXACT_AMBIG_DETECTION){if((c=T.resolvesToJustOneViableAlt(y))!==s.INVALID_ALT_NUMBER)break}else if(T.allSubsetsConflict(y)&&T.allSubsetsEqual(y)){o=!0,c=T.getSingleViableAlt(y);break}p=l,u!==m.EOF&&(r.consume(),u=r.LA(1))}return l.uniqueAlt!==s.INVALID_ALT_NUMBER?(this.reportContextSensitivity(e,c,l,a,r.index),c):(this.reportAmbiguity(e,t,a,r.index,o,null,l),c)},O.prototype.computeReachSet=function(e,t,n){this.debug&&console.log("in computeReachSet, starting closure: "+e),null===this.mergeCache&&(this.mergeCache=new o);for(var r=new u(n),i=null,l=0;l<e.items.length;l++){var c=e.items[l];if(this.debug_add&&console.log("testing "+this.getTokenName(t)+" at "+c),c.state instanceof f)(n||t===m.EOF)&&(null===i&&(i=[]),i.push(c),this.debug_add&&console.log("added "+c+" to skippedStopStates"));else for(var h=0;h<c.state.transitions.length;h++){var g=c.state.transitions[h],y=this.getReachableTarget(g,t);if(null!==y){var d=new p({state:y},c);r.add(d,this.mergeCache),this.debug_add&&console.log("added "+d+" to intermediate")}}}var S=null;if(null===i&&t!==m.EOF&&(1===r.items.length||this.getUniqueAlt(r)!==s.INVALID_ALT_NUMBER)&&(S=r),null===S){S=new u(n);for(var b=new a,x=t===m.EOF,A=0;A<r.items.length;A++)this.closure(r.items[A],S,b,!1,n,x)}if(t===m.EOF&&(S=this.removeAllConfigsNotInRuleStopState(S,S===r)),!(null===i||n&&T.hasConfigInRuleStopState(S)))for(var L=0;L<i.length;L++)S.add(i[L],this.mergeCache);return 0===S.items.length?null:S},O.prototype.removeAllConfigsNotInRuleStopState=function(e,t){if(T.allConfigsInRuleStopStates(e))return e;for(var n=new u(e.fullCtx),r=0;r<e.items.length;r++){var a=e.items[r];if(a.state instanceof f)n.add(a,this.mergeCache);else if(t&&a.state.epsilonOnlyTransitions&&this.atn.nextTokens(a.state).contains(m.EPSILON)){var i=this.atn.ruleToStopState[a.state.ruleIndex];n.add(new p({state:i},a),this.mergeCache)}}return n},O.prototype.computeStartState=function(e,t,n){for(var r=C(this.atn,t),i=new u(n),o=0;o<e.transitions.length;o++){var s=e.transitions[o].target,l=new p({state:s,alt:o+1,context:r},null),m=new a;this.closure(l,i,m,!0,n,!1)}return i},O.prototype.applyPrecedenceFilter=function(e){for(var t,n=[],r=new u(e.fullCtx),a=0;a<e.items.length;a++)if(1===(t=e.items[a]).alt){var i=t.semanticContext.evalPrecedence(this.parser,this._outerContext);null!==i&&(n[t.state.stateNumber]=t.context,i!==t.semanticContext?r.add(new p({semanticContext:i},t),this.mergeCache):r.add(t,this.mergeCache))}for(a=0;a<e.items.length;a++)if(1!==(t=e.items[a]).alt){if(!t.precedenceFilterSuppressed){var o=n[t.state.stateNumber]||null;if(null!==o&&o.equals(t.context))continue}r.add(t,this.mergeCache)}return r},O.prototype.getReachableTarget=function(e,t){return e.matches(t,0,this.atn.maxTokenType)?e.target:null},O.prototype.getPredsForAmbigAlts=function(e,t,n){for(var a=[],i=0;i<t.items.length;i++){var o=t.items[i];e.contains(o.alt)&&(a[o.alt]=d.orContext(a[o.alt]||null,o.semanticContext))}var s=0;for(i=1;i<n+1;i++){var l=a[i]||null;null===l?a[i]=d.NONE:l!==d.NONE&&(s+=1)}return 0===s&&(a=null),this.debug&&console.log("getPredsForAmbigAlts result "+r.arrayToString(a)),a},O.prototype.getPredicatePredictions=function(e,t){for(var n=[],r=!1,a=1;a<t.length;a++){var i=t[a];null!==e&&e.contains(a)&&n.push(new h(i,a)),i!==d.NONE&&(r=!0)}return r?n:null},O.prototype.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule=function(e,t){var n=this.splitAccordingToSemanticValidity(e,t),r=n[0],a=n[1],i=this.getAltThatFinishedDecisionEntryRule(r);return i!==s.INVALID_ALT_NUMBER||a.items.length>0&&(i=this.getAltThatFinishedDecisionEntryRule(a))!==s.INVALID_ALT_NUMBER?i:s.INVALID_ALT_NUMBER},O.prototype.getAltThatFinishedDecisionEntryRule=function(e){for(var t=[],n=0;n<e.items.length;n++){var r=e.items[n];(r.reachesIntoOuterContext>0||r.state instanceof f&&r.context.hasEmptyPath())&&t.indexOf(r.alt)<0&&t.push(r.alt)}return 0===t.length?s.INVALID_ALT_NUMBER:Math.min.apply(null,t)},O.prototype.splitAccordingToSemanticValidity=function(e,t){for(var n=new u(e.fullCtx),r=new u(e.fullCtx),a=0;a<e.items.length;a++){var i=e.items[a];i.semanticContext!==d.NONE?i.semanticContext.evaluate(this.parser,t)?n.add(i):r.add(i):n.add(i)}return[n,r]},O.prototype.evalSemanticContext=function(e,t,n){for(var r=new i,a=0;a<e.length;a++){var o=e[a];if(o.pred!==d.NONE){var s=o.pred.evaluate(this.parser,t);if((this.debug||this.dfa_debug)&&console.log("eval pred "+o+"="+s),s&&((this.debug||this.dfa_debug)&&console.log("PREDICT "+o.alt),r.add(o.alt),!n))break}else if(r.add(o.alt),!n)break}return r},O.prototype.closure=function(e,t,n,r,a,i){this.closureCheckingStopState(e,t,n,r,a,0,i)},O.prototype.closureCheckingStopState=function(e,t,n,r,a,i,o){if((this.debug||this.debug_closure)&&(console.log("closure("+e.toString(this.parser,!0)+")"),e.reachesIntoOuterContext>50))throw"problem";if(e.state instanceof f){if(!e.context.isEmpty()){for(var s=0;s<e.context.length;s++)if(e.context.getReturnState(s)!==S.EMPTY_RETURN_STATE){var l=this.atn.states[e.context.getReturnState(s)],u=e.context.getParent(s),m={state:l,alt:e.alt,context:u,semanticContext:e.semanticContext},c=new p(m,null);c.reachesIntoOuterContext=e.reachesIntoOuterContext,this.closureCheckingStopState(c,t,n,r,a,i-1,o)}else{if(a){t.add(new p({state:e.state,context:S.EMPTY},e),this.mergeCache);continue}this.debug&&console.log("FALLING off rule "+this.getRuleName(e.state.ruleIndex)),this.closure_(e,t,n,r,a,i,o)}return}if(a)return void t.add(e,this.mergeCache);this.debug&&console.log("FALLING off rule "+this.getRuleName(e.state.ruleIndex))}this.closure_(e,t,n,r,a,i,o)},O.prototype.closure_=function(e,t,n,r,a,i,o){var s=e.state;s.epsilonOnlyTransitions||t.add(e,this.mergeCache);for(var l=0;l<s.transitions.length;l++)if(0!=l||!this.canDropLoopEntryEdgeInLeftRecursiveRule(e)){var p=s.transitions[l],u=r&&!(p instanceof D),m=this.getEpsilonTarget(e,p,u,0===i,a,o);if(null!==m){var c=i;if(e.state instanceof f){if(null!==this._dfa&&this._dfa.precedenceDfa&&p.outermostPrecedenceReturn===this._dfa.atnStartState.ruleIndex&&(m.precedenceFilterSuppressed=!0),m.reachesIntoOuterContext+=1,n.add(m)!==m)continue;t.dipsIntoOuterContext=!0,c-=1,this.debug&&console.log("dips into outer ctx: "+m)}else{if(!p.isEpsilon&&n.add(m)!==m)continue;p instanceof I&&c>=0&&(c+=1)}this.closureCheckingStopState(m,t,n,u,a,c,o)}}},O.prototype.canDropLoopEntryEdgeInLeftRecursiveRule=function(e){var t=e.state;if(t.stateType!=l.STAR_LOOP_ENTRY)return!1;if(t.stateType!=l.STAR_LOOP_ENTRY||!t.isPrecedenceDecision||e.context.isEmpty()||e.context.hasEmptyPath())return!1;for(var n=e.context.length,r=0;r<n;r++)if((o=this.atn.states[e.context.getReturnState(r)]).ruleIndex!=t.ruleIndex)return!1;var a=t.transitions[0].target.endState.stateNumber,i=this.atn.states[a];for(r=0;r<n;r++){var o,s=e.context.getReturnState(r);if(1!=(o=this.atn.states[s]).transitions.length||!o.transitions[0].isEpsilon)return!1;var p=o.transitions[0].target;if(!(o.stateType==l.BLOCK_END&&p==t||o==i||p==i||p.stateType==l.BLOCK_END&&1==p.transitions.length&&p.transitions[0].isEpsilon&&p.transitions[0].target==t))return!1}return!0},O.prototype.getRuleName=function(e){return null!==this.parser&&e>=0?this.parser.ruleNames[e]:"<rule "+e+">"},O.prototype.getEpsilonTarget=function(e,t,n,r,a,i){switch(t.serializationType){case A.RULE:return this.ruleTransition(e,t);case A.PRECEDENCE:return this.precedenceTransition(e,t,n,r,a);case A.PREDICATE:return this.predTransition(e,t,n,r,a);case A.ACTION:return this.actionTransition(e,t);case A.EPSILON:return new p({state:t.target},e);case A.ATOM:case A.RANGE:case A.SET:return i&&t.matches(m.EOF,0,1)?new p({state:t.target},e):null;default:return null}},O.prototype.actionTransition=function(e,t){if(this.debug){var n=-1==t.actionIndex?65535:t.actionIndex;console.log("ACTION edge "+t.ruleIndex+":"+n)}return new p({state:t.target},e)},O.prototype.precedenceTransition=function(e,t,n,a,i){this.debug&&(console.log("PRED (collectPredicates="+n+") "+t.precedence+">=_p, ctx dependent=true"),null!==this.parser&&console.log("context surrounding pred is "+r.arrayToString(this.parser.getRuleInvocationStack())));var o=null;if(n&&a)if(i){var s=this._input.index;this._input.seek(this._startIndex);var l=t.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(s),l&&(o=new p({state:t.target},e))}else{var u=d.andContext(e.semanticContext,t.getPredicate());o=new p({state:t.target,semanticContext:u},e)}else o=new p({state:t.target},e);return this.debug&&console.log("config from pred transition="+o),o},O.prototype.predTransition=function(e,t,n,a,i){this.debug&&(console.log("PRED (collectPredicates="+n+") "+t.ruleIndex+":"+t.predIndex+", ctx dependent="+t.isCtxDependent),null!==this.parser&&console.log("context surrounding pred is "+r.arrayToString(this.parser.getRuleInvocationStack())));var o=null;if(n&&(t.isCtxDependent&&a||!t.isCtxDependent))if(i){var s=this._input.index;this._input.seek(this._startIndex);var l=t.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(s),l&&(o=new p({state:t.target},e))}else{var u=d.andContext(e.semanticContext,t.getPredicate());o=new p({state:t.target,semanticContext:u},e)}else o=new p({state:t.target},e);return this.debug&&console.log("config from pred transition="+o),o},O.prototype.ruleTransition=function(e,t){this.debug&&console.log("CALL rule "+this.getRuleName(t.target.ruleIndex)+", ctx="+e.context);var n=t.followState,r=_.create(e.context,n.stateNumber);return new p({state:t.target,context:r},e)},O.prototype.getConflictingAlts=function(e){var t=T.getConflictingAltSubsets(e);return T.getAlts(t)},O.prototype.getConflictingAltsOrUniqueAlt=function(e){var t=null;return e.uniqueAlt!==s.INVALID_ALT_NUMBER?(t=new i).add(e.uniqueAlt):t=e.conflictingAlts,t},O.prototype.getTokenName=function(e){if(e===m.EOF)return"EOF";if(null!==this.parser&&null!==this.parser.literalNames){if(!(e>=this.parser.literalNames.length&&e>=this.parser.symbolicNames.length))return(this.parser.literalNames[e]||this.parser.symbolicNames[e])+"<"+e+">";console.log(e+" ttype out of range: "+this.parser.literalNames),console.log(""+this.parser.getInputStream().getTokens())}return""+e},O.prototype.getLookaheadName=function(e){return this.getTokenName(e.LA(1))},O.prototype.dumpDeadEndConfigs=function(e){console.log("dead end configs: ");for(var t=e.getDeadEndConfigs(),n=0;n<t.length;n++){var r=t[n],a="no edges";if(r.state.transitions.length>0){var i=r.state.transitions[0];i instanceof AtomTransition?a="Atom "+this.getTokenName(i.label):i instanceof L&&(a=(i instanceof E?"~":"")+"Set "+i.set)}console.error(r.toString(this.parser,!0)+":"+a)}},O.prototype.noViableAlt=function(e,t,n,r){return new v(this.parser,e,e.get(r),e.LT(1),n,t)},O.prototype.getUniqueAlt=function(e){for(var t=s.INVALID_ALT_NUMBER,n=0;n<e.items.length;n++){var r=e.items[n];if(t===s.INVALID_ALT_NUMBER)t=r.alt;else if(r.alt!==t)return s.INVALID_ALT_NUMBER}return t},O.prototype.addDFAEdge=function(e,t,n,r){if(this.debug&&console.log("EDGE "+t+" -> "+r+" upon "+this.getTokenName(n)),null===r)return null;if(r=this.addDFAState(e,r),null===t||n<-1||n>this.atn.maxTokenType)return r;if(null===t.edges&&(t.edges=[]),t.edges[n+1]=r,this.debug){var a=null===this.parser?null:this.parser.literalNames,i=null===this.parser?null:this.parser.symbolicNames;console.log("DFA=\n"+e.toString(a,i))}return r},O.prototype.addDFAState=function(e,t){if(t==g.ERROR)return t;var n=e.states.get(t);return null!==n?n:(t.stateNumber=e.states.length,t.configs.readOnly||(t.configs.optimizeConfigs(this),t.configs.setReadonly(!0)),e.states.add(t),this.debug&&console.log("adding new DFA state: "+t),t)},O.prototype.reportAttemptingFullContext=function(e,t,n,r,a){if(this.debug||this.retry_debug){var i=new b(r,a+1);console.log("reportAttemptingFullContext decision="+e.decision+":"+n+", input="+this.parser.getTokenStream().getText(i))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportAttemptingFullContext(this.parser,e,r,a,t,n)},O.prototype.reportContextSensitivity=function(e,t,n,r,a){if(this.debug||this.retry_debug){var i=new b(r,a+1);console.log("reportContextSensitivity decision="+e.decision+":"+n+", input="+this.parser.getTokenStream().getText(i))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportContextSensitivity(this.parser,e,r,a,t,n)},O.prototype.reportAmbiguity=function(e,t,n,r,a,i,o){if(this.debug||this.retry_debug){var s=new b(n,r+1);console.log("reportAmbiguity "+i+":"+o+", input="+this.parser.getTokenStream().getText(s))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportAmbiguity(this.parser,e,n,r,a,i,o)},t.ParserATNSimulator=O},5941:(e,t,n)=>{n(8720).Set;var r=n(8720).Map,a=n(8720).BitSet,i=n(8720).AltDict,o=n(906).ATN,s=n(6005).RuleStopState,l=n(3218).Q,p=n(6664).G,u=n(8828).Ij,m=(n(8720).Hash,n(8720).hashStuff);function c(){return this}n(8720).equalArrays,c.SLL=0,c.LL=1,c.LL_EXACT_AMBIG_DETECTION=2,c.hasSLLConflictTerminatingPrediction=function(e,t){if(c.allConfigsInRuleStopStates(t))return!0;if(e===c.SLL&&t.hasSemanticContext){for(var n=new l,r=0;r<t.items.length;r++){var a=t.items[r];a=new p({semanticContext:u.NONE},a),n.add(a)}t=n}var i=c.getConflictingAltSubsets(t);return c.hasConflictingAltSet(i)&&!c.hasStateAssociatedWithOneAlt(t)},c.hasConfigInRuleStopState=function(e){for(var t=0;t<e.items.length;t++)if(e.items[t].state instanceof s)return!0;return!1},c.allConfigsInRuleStopStates=function(e){for(var t=0;t<e.items.length;t++)if(!(e.items[t].state instanceof s))return!1;return!0},c.resolvesToJustOneViableAlt=function(e){return c.getSingleViableAlt(e)},c.allSubsetsConflict=function(e){return!c.hasNonConflictingAltSet(e)},c.hasNonConflictingAltSet=function(e){for(var t=0;t<e.length;t++)if(1===e[t].length)return!0;return!1},c.hasConflictingAltSet=function(e){for(var t=0;t<e.length;t++)if(e[t].length>1)return!0;return!1},c.allSubsetsEqual=function(e){for(var t=null,n=0;n<e.length;n++){var r=e[n];if(null===t)t=r;else if(r!==t)return!1}return!0},c.getUniqueAlt=function(e){var t=c.getAlts(e);return 1===t.length?t.minValue():o.INVALID_ALT_NUMBER},c.getAlts=function(e){var t=new a;return e.map((function(e){t.or(e)})),t},c.getConflictingAltSubsets=function(e){var t=new r;return t.hashFunction=function(e){m(e.state.stateNumber,e.context)},t.equalsFunction=function(e,t){return e.state.stateNumber==t.state.stateNumber&&e.context.equals(t.context)},e.items.map((function(e){var n=t.get(e);null===n&&(n=new a,t.put(e,n)),n.add(e.alt)})),t.getValues()},c.getStateToAltMap=function(e){var t=new i;return e.items.map((function(e){var n=t.get(e.state);null===n&&(n=new a,t.put(e.state,n)),n.add(e.alt)})),t},c.hasStateAssociatedWithOneAlt=function(e){for(var t=c.getStateToAltMap(e).values(),n=0;n<t.length;n++)if(1===t[n].length)return!0;return!1},c.getSingleViableAlt=function(e){for(var t=null,n=0;n<e.length;n++){var r=e[n].minValue();if(null===t)t=r;else if(t!==r)return o.INVALID_ALT_NUMBER}return t},t.PredictionMode=c},8828:(e,t,n)=>{var r=n(8720).Set,a=n(8720).Hash;function i(){return this}function o(e,t,n){return i.call(this),this.ruleIndex=void 0===e?-1:e,this.predIndex=void 0===t?-1:t,this.isCtxDependent=void 0!==n&&n,this}function s(e){i.call(this),this.precedence=void 0===e?0:e}function l(e,t){i.call(this);var n=new r;e instanceof l?e.opnds.map((function(e){n.add(e)})):n.add(e),t instanceof l?t.opnds.map((function(e){n.add(e)})):n.add(t);var a=s.filterPrecedencePredicates(n);if(a.length>0){var o=null;a.map((function(e){(null===o||e.precedence<o.precedence)&&(o=e)})),n.add(o)}return this.opnds=n.values(),this}function p(e,t){i.call(this);var n=new r;e instanceof p?e.opnds.map((function(e){n.add(e)})):n.add(e),t instanceof p?t.opnds.map((function(e){n.add(e)})):n.add(t);var a=s.filterPrecedencePredicates(n);if(a.length>0){var o=a.sort((function(e,t){return e.compareTo(t)})),l=o[o.length-1];n.add(l)}return this.opnds=n.values(),this}i.prototype.hashCode=function(){var e=new a;return this.updateHashCode(e),e.finish()},i.prototype.evaluate=function(e,t){},i.prototype.evalPrecedence=function(e,t){return this},i.andContext=function(e,t){if(null===e||e===i.NONE)return t;if(null===t||t===i.NONE)return e;var n=new l(e,t);return 1===n.opnds.length?n.opnds[0]:n},i.orContext=function(e,t){if(null===e)return t;if(null===t)return e;if(e===i.NONE||t===i.NONE)return i.NONE;var n=new p(e,t);return 1===n.opnds.length?n.opnds[0]:n},o.prototype=Object.create(i.prototype),o.prototype.constructor=o,i.NONE=new o,o.prototype.evaluate=function(e,t){var n=this.isCtxDependent?t:null;return e.sempred(n,this.ruleIndex,this.predIndex)},o.prototype.updateHashCode=function(e){e.update(this.ruleIndex,this.predIndex,this.isCtxDependent)},o.prototype.equals=function(e){return this===e||e instanceof o&&this.ruleIndex===e.ruleIndex&&this.predIndex===e.predIndex&&this.isCtxDependent===e.isCtxDependent},o.prototype.toString=function(){return"{"+this.ruleIndex+":"+this.predIndex+"}?"},s.prototype=Object.create(i.prototype),s.prototype.constructor=s,s.prototype.evaluate=function(e,t){return e.precpred(t,this.precedence)},s.prototype.evalPrecedence=function(e,t){return e.precpred(t,this.precedence)?i.NONE:null},s.prototype.compareTo=function(e){return this.precedence-e.precedence},s.prototype.updateHashCode=function(e){e.update(31)},s.prototype.equals=function(e){return this===e||e instanceof s&&this.precedence===e.precedence},s.prototype.toString=function(){return"{"+this.precedence+">=prec}?"},s.filterPrecedencePredicates=function(e){var t=[];return e.values().map((function(e){e instanceof s&&t.push(e)})),t},l.prototype=Object.create(i.prototype),l.prototype.constructor=l,l.prototype.equals=function(e){return this===e||e instanceof l&&this.opnds===e.opnds},l.prototype.updateHashCode=function(e){e.update(this.opnds,"AND")},l.prototype.evaluate=function(e,t){for(var n=0;n<this.opnds.length;n++)if(!this.opnds[n].evaluate(e,t))return!1;return!0},l.prototype.evalPrecedence=function(e,t){for(var n=!1,r=[],a=0;a<this.opnds.length;a++){var o=this.opnds[a],s=o.evalPrecedence(e,t);if(n|=s!==o,null===s)return null;s!==i.NONE&&r.push(s)}if(!n)return this;if(0===r.length)return i.NONE;var l=null;return r.map((function(e){l=null===l?e:i.andContext(l,e)})),l},l.prototype.toString=function(){var e="";return this.opnds.map((function(t){e+="&& "+t.toString()})),e.length>3?e.slice(3):e},p.prototype=Object.create(i.prototype),p.prototype.constructor=p,p.prototype.constructor=function(e){return this===e||e instanceof p&&this.opnds===e.opnds},p.prototype.updateHashCode=function(e){e.update(this.opnds,"OR")},p.prototype.evaluate=function(e,t){for(var n=0;n<this.opnds.length;n++)if(this.opnds[n].evaluate(e,t))return!0;return!1},p.prototype.evalPrecedence=function(e,t){for(var n=!1,r=[],a=0;a<this.opnds.length;a++){var o=this.opnds[a],s=o.evalPrecedence(e,t);if(n|=s!==o,s===i.NONE)return i.NONE;null!==s&&r.push(s)}if(!n)return this;if(0===r.length)return null;return r.map((function(e){return e})),null},p.prototype.toString=function(){var e="";return this.opnds.map((function(t){e+="|| "+t.toString()})),e.length>3?e.slice(3):e},t.Ij=i,t.Yi=s,t.mT=o},2552:(e,t,n)=>{var r=n(2792).Token,a=(n(3922).Interval,n(3922).m),i=n(8828).mT,o=n(8828).Yi;function s(e){if(null==e)throw"target cannot be null.";return this.target=e,this.isEpsilon=!1,this.label=null,this}function l(e,t){return s.call(this,e),this.label_=t,this.label=this.makeLabel(),this.serializationType=s.ATOM,this}function p(e,t,n,r){return s.call(this,e),this.ruleIndex=t,this.precedence=n,this.followState=r,this.serializationType=s.RULE,this.isEpsilon=!0,this}function u(e,t){return s.call(this,e),this.serializationType=s.EPSILON,this.isEpsilon=!0,this.outermostPrecedenceReturn=t,this}function m(e,t,n){return s.call(this,e),this.serializationType=s.RANGE,this.start=t,this.stop=n,this.label=this.makeLabel(),this}function c(e){return s.call(this,e),this}function h(e,t,n,r){return c.call(this,e),this.serializationType=s.PREDICATE,this.ruleIndex=t,this.predIndex=n,this.isCtxDependent=r,this.isEpsilon=!0,this}function g(e,t,n,r){return s.call(this,e),this.serializationType=s.ACTION,this.ruleIndex=t,this.actionIndex=void 0===n?-1:n,this.isCtxDependent=void 0!==r&&r,this.isEpsilon=!0,this}function T(e,t){return s.call(this,e),this.serializationType=s.SET,null!=t?this.label=t:(this.label=new a,this.label.addOne(r.INVALID_TYPE)),this}function y(e,t){return T.call(this,e,t),this.serializationType=s.NOT_SET,this}function d(e){return s.call(this,e),this.serializationType=s.WILDCARD,this}function f(e,t){return c.call(this,e),this.serializationType=s.PRECEDENCE,this.precedence=t,this.isEpsilon=!0,this}s.EPSILON=1,s.RANGE=2,s.RULE=3,s.PREDICATE=4,s.ATOM=5,s.ACTION=6,s.SET=7,s.NOT_SET=8,s.WILDCARD=9,s.PRECEDENCE=10,s.serializationNames=["INVALID","EPSILON","RANGE","RULE","PREDICATE","ATOM","ACTION","SET","NOT_SET","WILDCARD","PRECEDENCE"],s.serializationTypes={EpsilonTransition:s.EPSILON,RangeTransition:s.RANGE,RuleTransition:s.RULE,PredicateTransition:s.PREDICATE,AtomTransition:s.ATOM,ActionTransition:s.ACTION,SetTransition:s.SET,NotSetTransition:s.NOT_SET,WildcardTransition:s.WILDCARD,PrecedencePredicateTransition:s.PRECEDENCE},l.prototype=Object.create(s.prototype),l.prototype.constructor=l,l.prototype.makeLabel=function(){var e=new a;return e.addOne(this.label_),e},l.prototype.matches=function(e,t,n){return this.label_===e},l.prototype.toString=function(){return this.label_},p.prototype=Object.create(s.prototype),p.prototype.constructor=p,p.prototype.matches=function(e,t,n){return!1},u.prototype=Object.create(s.prototype),u.prototype.constructor=u,u.prototype.matches=function(e,t,n){return!1},u.prototype.toString=function(){return"epsilon"},m.prototype=Object.create(s.prototype),m.prototype.constructor=m,m.prototype.makeLabel=function(){var e=new a;return e.addRange(this.start,this.stop),e},m.prototype.matches=function(e,t,n){return e>=this.start&&e<=this.stop},m.prototype.toString=function(){return"'"+String.fromCharCode(this.start)+"'..'"+String.fromCharCode(this.stop)+"'"},c.prototype=Object.create(s.prototype),c.prototype.constructor=c,h.prototype=Object.create(c.prototype),h.prototype.constructor=h,h.prototype.matches=function(e,t,n){return!1},h.prototype.getPredicate=function(){return new i(this.ruleIndex,this.predIndex,this.isCtxDependent)},h.prototype.toString=function(){return"pred_"+this.ruleIndex+":"+this.predIndex},g.prototype=Object.create(s.prototype),g.prototype.constructor=g,g.prototype.matches=function(e,t,n){return!1},g.prototype.toString=function(){return"action_"+this.ruleIndex+":"+this.actionIndex},T.prototype=Object.create(s.prototype),T.prototype.constructor=T,T.prototype.matches=function(e,t,n){return this.label.contains(e)},T.prototype.toString=function(){return this.label.toString()},y.prototype=Object.create(T.prototype),y.prototype.constructor=y,y.prototype.matches=function(e,t,n){return e>=t&&e<=n&&!T.prototype.matches.call(this,e,t,n)},y.prototype.toString=function(){return"~"+T.prototype.toString.call(this)},d.prototype=Object.create(s.prototype),d.prototype.constructor=d,d.prototype.matches=function(e,t,n){return e>=t&&e<=n},d.prototype.toString=function(){return"."},f.prototype=Object.create(c.prototype),f.prototype.constructor=f,f.prototype.matches=function(e,t,n){return!1},f.prototype.getPredicate=function(){return new o(this.precedence)},f.prototype.toString=function(){return this.precedence+" >= _p"},t.Transition=s,t.AtomTransition=l,t.SetTransition=T,t.NotSetTransition=y,t.RuleTransition=p,t.ActionTransition=g,t.EpsilonTransition=u,t.RangeTransition=m,t.WildcardTransition=d,t.PredicateTransition=h,t.PrecedencePredicateTransition=f,t.AbstractPredicateTransition=c},4699:(e,t,n)=>{t.ATN=n(906).ATN,t.ATNDeserializer=n(2677).ATNDeserializer,t.LexerATNSimulator=n(1976).LexerATNSimulator,t.ParserATNSimulator=n(7537).ParserATNSimulator,t.PredictionMode=n(5941).PredictionMode},6186:(e,t,n)=>{var r=n(8720).Set,a=n(2117).X,i=n(6005).StarLoopEntryState,o=n(3218).Q,s=n(4054).DFASerializer,l=n(4054).LexerDFASerializer;function p(e,t){if(void 0===t&&(t=0),this.atnStartState=e,this.decision=t,this._states=new r,this.s0=null,this.precedenceDfa=!1,e instanceof i&&e.isPrecedenceDecision){this.precedenceDfa=!0;var n=new a(null,new o);n.edges=[],n.isAcceptState=!1,n.requiresFullContext=!1,this.s0=n}return this}p.prototype.getPrecedenceStartState=function(e){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";return e<0||e>=this.s0.edges.length?null:this.s0.edges[e]||null},p.prototype.setPrecedenceStartState=function(e,t){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";e<0||(this.s0.edges[e]=t)},p.prototype.setPrecedenceDfa=function(e){if(this.precedenceDfa!==e){if(this._states=new DFAStatesSet,e){var t=new a(null,new o);t.edges=[],t.isAcceptState=!1,t.requiresFullContext=!1,this.s0=t}else this.s0=null;this.precedenceDfa=e}},Object.defineProperty(p.prototype,"states",{get:function(){return this._states}}),p.prototype.sortedStates=function(){return this._states.values().sort((function(e,t){return e.stateNumber-t.stateNumber}))},p.prototype.toString=function(e,t){return e=e||null,t=t||null,null===this.s0?"":new s(this,e,t).toString()},p.prototype.toLexerString=function(){return null===this.s0?"":new l(this).toString()},t.DFA=p},4054:(e,t)=>{function n(e,t,n){return this.dfa=e,this.literalNames=t||[],this.symbolicNames=n||[],this}function r(e){return n.call(this,e,null),this}n.prototype.toString=function(){if(null===this.dfa.s0)return null;for(var e="",t=this.dfa.sortedStates(),n=0;n<t.length;n++){var r=t[n];if(null!==r.edges)for(var a=r.edges.length,i=0;i<a;i++){var o=r.edges[i]||null;null!==o&&2147483647!==o.stateNumber&&(e=(e=(e=(e=(e=(e=e.concat(this.getStateString(r))).concat("-")).concat(this.getEdgeLabel(i))).concat("->")).concat(this.getStateString(o))).concat("\n"))}}return 0===e.length?null:e},n.prototype.getEdgeLabel=function(e){return 0===e?"EOF":null!==this.literalNames||null!==this.symbolicNames?this.literalNames[e-1]||this.symbolicNames[e-1]:String.fromCharCode(e-1)},n.prototype.getStateString=function(e){var t=(e.isAcceptState?":":"")+"s"+e.stateNumber+(e.requiresFullContext?"^":"");return e.isAcceptState?null!==e.predicates?t+"=>"+e.predicates.toString():t+"=>"+e.prediction.toString():t},r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.prototype.getEdgeLabel=function(e){return"'"+String.fromCharCode(e)+"'"},t.DFASerializer=n,t.LexerDFASerializer=r},2117:(e,t,n)=>{var r=n(3218).Q,a=n(8720),i=a.Hash,o=a.Set;function s(e,t){return this.alt=t,this.pred=e,this}function l(e,t){return null===e&&(e=-1),null===t&&(t=new r),this.stateNumber=e,this.configs=t,this.edges=null,this.isAcceptState=!1,this.prediction=0,this.lexerActionExecutor=null,this.requiresFullContext=!1,this.predicates=null,this}s.prototype.toString=function(){return"("+this.pred+", "+this.alt+")"},l.prototype.getAltSet=function(){var e=new o;if(null!==this.configs)for(var t=0;t<this.configs.length;t++){var n=this.configs[t];e.add(n.alt)}return 0===e.length?null:e},l.prototype.equals=function(e){return this===e||e instanceof l&&this.configs.equals(e.configs)},l.prototype.toString=function(){var e=this.stateNumber+":"+this.configs;return this.isAcceptState&&(e+="=>",null!==this.predicates?e+=this.predicates:e+=this.prediction),e},l.prototype.hashCode=function(){var e=new i;return e.update(this.configs),this.isAcceptState&&(null!==this.predicates?e.update(this.predicates):e.update(this.prediction)),e.finish()},t.X=l,t.PredPrediction=s},4687:(e,t,n)=>{t.DFA=n(6186).DFA,t.DFASerializer=n(4054).DFASerializer,t.LexerDFASerializer=n(4054).LexerDFASerializer,t.PredPrediction=n(2117).PredPrediction},1215:(e,t,n)=>{var r=n(8720).BitSet,a=n(8158).ErrorListener,i=n(3922).Interval;function o(e){return a.call(this),e=e||!0,this.exactOnly=e,this}o.prototype=Object.create(a.prototype),o.prototype.constructor=o,o.prototype.reportAmbiguity=function(e,t,n,r,a,o,s){if(!this.exactOnly||a){var l="reportAmbiguity d="+this.getDecisionDescription(e,t)+": ambigAlts="+this.getConflictingAlts(o,s)+", input='"+e.getTokenStream().getText(new i(n,r))+"'";e.notifyErrorListeners(l)}},o.prototype.reportAttemptingFullContext=function(e,t,n,r,a,o){var s="reportAttemptingFullContext d="+this.getDecisionDescription(e,t)+", input='"+e.getTokenStream().getText(new i(n,r))+"'";e.notifyErrorListeners(s)},o.prototype.reportContextSensitivity=function(e,t,n,r,a,o){var s="reportContextSensitivity d="+this.getDecisionDescription(e,t)+", input='"+e.getTokenStream().getText(new i(n,r))+"'";e.notifyErrorListeners(s)},o.prototype.getDecisionDescription=function(e,t){var n=t.decision,r=t.atnStartState.ruleIndex,a=e.ruleNames;if(r<0||r>=a.length)return""+n;var i=a[r]||null;return null===i||0===i.length?""+n:n+" ("+i+")"},o.prototype.getConflictingAlts=function(e,t){if(null!==e)return e;for(var n=new r,a=0;a<t.items.length;a++)n.add(t.items[a].alt);return"{"+n.values().join(", ")+"}"},t.DiagnosticErrorListener=o},8158:(e,t)=>{function n(){return this}function r(){return n.call(this),this}function a(e){if(n.call(this),null===e)throw"delegates";return this.delegates=e,this}n.prototype.syntaxError=function(e,t,n,r,a,i){},n.prototype.reportAmbiguity=function(e,t,n,r,a,i,o){},n.prototype.reportAttemptingFullContext=function(e,t,n,r,a,i){},n.prototype.reportContextSensitivity=function(e,t,n,r,a,i){},r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.INSTANCE=new r,r.prototype.syntaxError=function(e,t,n,r,a,i){console.error("line "+n+":"+r+" "+a)},a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.prototype.syntaxError=function(e,t,n,r,a,i){this.delegates.map((function(o){o.syntaxError(e,t,n,r,a,i)}))},a.prototype.reportAmbiguity=function(e,t,n,r,a,i,o){this.delegates.map((function(s){s.reportAmbiguity(e,t,n,r,a,i,o)}))},a.prototype.reportAttemptingFullContext=function(e,t,n,r,a,i){this.delegates.map((function(o){o.reportAttemptingFullContext(e,t,n,r,a,i)}))},a.prototype.reportContextSensitivity=function(e,t,n,r,a,i){this.delegates.map((function(o){o.reportContextSensitivity(e,t,n,r,a,i)}))},t.ErrorListener=n,t.q=r,t.X=a},1519:(e,t,n)=>{var r=n(2792).Token,a=n(2233),i=a.NoViableAltException,o=a.InputMismatchException,s=a.FailedPredicateException,l=a.ParseCancellationException,p=n(6005).ATNState,u=n(3922).Interval,m=n(3922).m;function c(){}function h(){return c.call(this),this.errorRecoveryMode=!1,this.lastErrorIndex=-1,this.lastErrorStates=null,this}function g(){return h.call(this),this}c.prototype.reset=function(e){},c.prototype.recoverInline=function(e){},c.prototype.recover=function(e,t){},c.prototype.sync=function(e){},c.prototype.inErrorRecoveryMode=function(e){},c.prototype.reportError=function(e){},h.prototype=Object.create(c.prototype),h.prototype.constructor=h,h.prototype.reset=function(e){this.endErrorCondition(e)},h.prototype.beginErrorCondition=function(e){this.errorRecoveryMode=!0},h.prototype.inErrorRecoveryMode=function(e){return this.errorRecoveryMode},h.prototype.endErrorCondition=function(e){this.errorRecoveryMode=!1,this.lastErrorStates=null,this.lastErrorIndex=-1},h.prototype.reportMatch=function(e){this.endErrorCondition(e)},h.prototype.reportError=function(e,t){this.inErrorRecoveryMode(e)||(this.beginErrorCondition(e),t instanceof i?this.reportNoViableAlternative(e,t):t instanceof o?this.reportInputMismatch(e,t):t instanceof s?this.reportFailedPredicate(e,t):(console.log("unknown recognition error type: "+t.constructor.name),console.log(t.stack),e.notifyErrorListeners(t.getOffendingToken(),t.getMessage(),t)))},h.prototype.recover=function(e,t){this.lastErrorIndex===e.getInputStream().index&&null!==this.lastErrorStates&&this.lastErrorStates.indexOf(e.state)>=0&&e.consume(),this.lastErrorIndex=e._input.index,null===this.lastErrorStates&&(this.lastErrorStates=[]),this.lastErrorStates.push(e.state);var n=this.getErrorRecoverySet(e);this.consumeUntil(e,n)},h.prototype.sync=function(e){if(!this.inErrorRecoveryMode(e)){var t=e._interp.atn.states[e.state],n=e.getTokenStream().LA(1),a=e.atn.nextTokens(t);if(!a.contains(r.EPSILON)&&!a.contains(n))switch(t.stateType){case p.BLOCK_START:case p.STAR_BLOCK_START:case p.PLUS_BLOCK_START:case p.STAR_LOOP_ENTRY:if(null!==this.singleTokenDeletion(e))return;throw new o(e);case p.PLUS_LOOP_BACK:case p.STAR_LOOP_BACK:this.reportUnwantedToken(e);var i=new m;i.addSet(e.getExpectedTokens());var s=i.addSet(this.getErrorRecoverySet(e));this.consumeUntil(e,s)}}},h.prototype.reportNoViableAlternative=function(e,t){var n,a=e.getTokenStream();n=null!==a?t.startToken.type===r.EOF?"<EOF>":a.getText(new u(t.startToken.tokenIndex,t.offendingToken.tokenIndex)):"<unknown input>";var i="no viable alternative at input "+this.escapeWSAndQuote(n);e.notifyErrorListeners(i,t.offendingToken,t)},h.prototype.reportInputMismatch=function(e,t){var n="mismatched input "+this.getTokenErrorDisplay(t.offendingToken)+" expecting "+t.getExpectedTokens().toString(e.literalNames,e.symbolicNames);e.notifyErrorListeners(n,t.offendingToken,t)},h.prototype.reportFailedPredicate=function(e,t){var n="rule "+e.ruleNames[e._ctx.ruleIndex]+" "+t.message;e.notifyErrorListeners(n,t.offendingToken,t)},h.prototype.reportUnwantedToken=function(e){if(!this.inErrorRecoveryMode(e)){this.beginErrorCondition(e);var t=e.getCurrentToken(),n="extraneous input "+this.getTokenErrorDisplay(t)+" expecting "+this.getExpectedTokens(e).toString(e.literalNames,e.symbolicNames);e.notifyErrorListeners(n,t,null)}},h.prototype.reportMissingToken=function(e){if(!this.inErrorRecoveryMode(e)){this.beginErrorCondition(e);var t=e.getCurrentToken(),n="missing "+this.getExpectedTokens(e).toString(e.literalNames,e.symbolicNames)+" at "+this.getTokenErrorDisplay(t);e.notifyErrorListeners(n,t,null)}},h.prototype.recoverInline=function(e){var t=this.singleTokenDeletion(e);if(null!==t)return e.consume(),t;if(this.singleTokenInsertion(e))return this.getMissingSymbol(e);throw new o(e)},h.prototype.singleTokenInsertion=function(e){var t=e.getTokenStream().LA(1),n=e._interp.atn,r=n.states[e.state].transitions[0].target;return!!n.nextTokens(r,e._ctx).contains(t)&&(this.reportMissingToken(e),!0)},h.prototype.singleTokenDeletion=function(e){var t=e.getTokenStream().LA(2);if(this.getExpectedTokens(e).contains(t)){this.reportUnwantedToken(e),e.consume();var n=e.getCurrentToken();return this.reportMatch(e),n}return null},h.prototype.getMissingSymbol=function(e){var t,n=e.getCurrentToken(),a=this.getExpectedTokens(e).first();t=a===r.EOF?"<missing EOF>":"<missing "+e.literalNames[a]+">";var i=n,o=e.getTokenStream().LT(-1);return i.type===r.EOF&&null!==o&&(i=o),e.getTokenFactory().create(i.source,a,t,r.DEFAULT_CHANNEL,-1,-1,i.line,i.column)},h.prototype.getExpectedTokens=function(e){return e.getExpectedTokens()},h.prototype.getTokenErrorDisplay=function(e){if(null===e)return"<no token>";var t=e.text;return null===t&&(t=e.type===r.EOF?"<EOF>":"<"+e.type+">"),this.escapeWSAndQuote(t)},h.prototype.escapeWSAndQuote=function(e){return"'"+(e=(e=(e=e.replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t"))+"'"},h.prototype.getErrorRecoverySet=function(e){for(var t=e._interp.atn,n=e._ctx,a=new m;null!==n&&n.invokingState>=0;){var i=t.states[n.invokingState].transitions[0],o=t.nextTokens(i.followState);a.addSet(o),n=n.parentCtx}return a.removeOne(r.EPSILON),a},h.prototype.consumeUntil=function(e,t){for(var n=e.getTokenStream().LA(1);n!==r.EOF&&!t.contains(n);)e.consume(),n=e.getTokenStream().LA(1)},g.prototype=Object.create(h.prototype),g.prototype.constructor=g,g.prototype.recover=function(e,t){for(var n=e._ctx;null!==n;)n.exception=t,n=n.parentCtx;throw new l(t)},g.prototype.recoverInline=function(e){this.recover(e,new o(e))},g.prototype.sync=function(e){},t.BailErrorStrategy=g,t.$=h},2233:(e,t,n)=>{var r=n(2552).PredicateTransition;function a(e){return Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,a):(new Error).stack,this.message=e.message,this.recognizer=e.recognizer,this.input=e.input,this.ctx=e.ctx,this.offendingToken=null,this.offendingState=-1,null!==this.recognizer&&(this.offendingState=this.recognizer.state),this}function i(e,t,n,r){return a.call(this,{message:"",recognizer:e,input:t,ctx:null}),this.startIndex=n,this.deadEndConfigs=r,this}function o(e,t,n,r,i,o){o=o||e._ctx,r=r||e.getCurrentToken(),n=n||e.getCurrentToken(),t=t||e.getInputStream(),a.call(this,{message:"",recognizer:e,input:t,ctx:o}),this.deadEndConfigs=i,this.startToken=n,this.offendingToken=r}function s(e){a.call(this,{message:"",recognizer:e,input:e.getInputStream(),ctx:e._ctx}),this.offendingToken=e.getCurrentToken()}function l(e,t,n){a.call(this,{message:this.formatMessage(t,n||null),recognizer:e,input:e.getInputStream(),ctx:e._ctx});var i=e._interp.atn.states[e.state].transitions[0];return i instanceof r?(this.ruleIndex=i.ruleIndex,this.predicateIndex=i.predIndex):(this.ruleIndex=0,this.predicateIndex=0),this.predicate=t,this.offendingToken=e.getCurrentToken(),this}function p(){return Error.call(this),Error.captureStackTrace(this,p),this}a.prototype=Object.create(Error.prototype),a.prototype.constructor=a,a.prototype.getExpectedTokens=function(){return null!==this.recognizer?this.recognizer.atn.getExpectedTokens(this.offendingState,this.ctx):null},a.prototype.toString=function(){return this.message},i.prototype=Object.create(a.prototype),i.prototype.constructor=i,i.prototype.toString=function(){var e="";return this.startIndex>=0&&this.startIndex<this.input.size&&(e=this.input.getText((this.startIndex,this.startIndex))),"LexerNoViableAltException"+e},o.prototype=Object.create(a.prototype),o.prototype.constructor=o,s.prototype=Object.create(a.prototype),s.prototype.constructor=s,l.prototype=Object.create(a.prototype),l.prototype.constructor=l,l.prototype.formatMessage=function(e,t){return null!==t?t:"failed predicate: {"+e+"}?"},p.prototype=Object.create(Error.prototype),p.prototype.constructor=p,t.RecognitionException=a,t.NoViableAltException=o,t.LexerNoViableAltException=i,t.InputMismatchException=s,t.FailedPredicateException=l,t.ParseCancellationException=p},1336:(e,t,n)=>{t.RecognitionException=n(2233).RecognitionException,t.NoViableAltException=n(2233).NoViableAltException,t.LexerNoViableAltException=n(2233).LexerNoViableAltException,t.InputMismatchException=n(2233).InputMismatchException,t.FailedPredicateException=n(2233).FailedPredicateException,t.DiagnosticErrorListener=n(1215).DiagnosticErrorListener,t.BailErrorStrategy=n(1519).BailErrorStrategy,t.ErrorListener=n(8158).ErrorListener},5525:(e,t,n)=>{t.atn=n(4699),t.codepointat=n(4618),t.dfa=n(4687),t.fromcodepoint=n(3591),t.tree=n(6393),t.error=n(1336),t.Token=n(2792).Token,t.CharStreams=n(1792).CharStreams,t.CommonToken=n(2792).CommonToken,t.InputStream=n(1989).InputStream,t.FileStream=n(4295).FileStream,t.CommonTokenStream=n(443).CommonTokenStream,t.Lexer=n(4479).Lexer,t.Parser=n(7402).Parser;var r=n(4997);t.PredictionContextCache=r.PredictionContextCache,t.ParserRuleContext=n(5425).ParserRuleContext,t.Interval=n(3922).Interval,t.Utils=n(8720)},4618:()=>{String.prototype.codePointAt||function(){"use strict";var e=function(){try{var e={},t=Object.defineProperty,n=t(e,e,e)&&t}catch(e){}return n}(),t=function(e){if(null==this)throw TypeError();var t=String(this),n=t.length,r=e?Number(e):0;if(r!=r&&(r=0),!(r<0||r>=n)){var a,i=t.charCodeAt(r);return i>=55296&&i<=56319&&n>r+1&&(a=t.charCodeAt(r+1))>=56320&&a<=57343?1024*(i-55296)+a-56320+65536:i}};e?e(String.prototype,"codePointAt",{value:t,configurable:!0,writable:!0}):String.prototype.codePointAt=t}()},3591:()=>{var e,t,n,r;String.fromCodePoint||(e=function(){try{var e={},t=Object.defineProperty,n=t(e,e,e)&&t}catch(e){}return n}(),t=String.fromCharCode,n=Math.floor,r=function(e){var r,a,i=[],o=-1,s=arguments.length;if(!s)return"";for(var l="";++o<s;){var p=Number(arguments[o]);if(!isFinite(p)||p<0||p>1114111||n(p)!=p)throw RangeError("Invalid code point: "+p);p<=65535?i.push(p):(r=55296+((p-=65536)>>10),a=p%1024+56320,i.push(r,a)),(o+1==s||i.length>16384)&&(l+=t.apply(null,i),i.length=0)}return l},e?e(String,"fromCodePoint",{value:r,configurable:!0,writable:!0}):String.fromCodePoint=r)},9024:(e,t,n)=>{var r=n(2792).Token,a=n(3922).Interval,i=new a(-1,-2);function o(){return this}function s(){return o.call(this),this}function l(){return s.call(this),this}function p(){return l.call(this),this}function u(){return l.call(this),this}function m(){return u.call(this),this}function c(){return this}function h(){return this}function g(e){return u.call(this),this.parentCtx=null,this.symbol=e,this}function T(e){return g.call(this,e),this}function y(){return this}n(8720),s.prototype=Object.create(o.prototype),s.prototype.constructor=s,l.prototype=Object.create(s.prototype),l.prototype.constructor=l,p.prototype=Object.create(l.prototype),p.prototype.constructor=p,u.prototype=Object.create(l.prototype),u.prototype.constructor=u,m.prototype=Object.create(u.prototype),m.prototype.constructor=m,c.prototype.visit=function(e){return Array.isArray(e)?e.map((function(e){return e.accept(this)}),this):e.accept(this)},c.prototype.visitChildren=function(e){return e.children?this.visit(e.children):null},c.prototype.visitTerminal=function(e){},c.prototype.visitErrorNode=function(e){},h.prototype.visitTerminal=function(e){},h.prototype.visitErrorNode=function(e){},h.prototype.enterEveryRule=function(e){},h.prototype.exitEveryRule=function(e){},g.prototype=Object.create(u.prototype),g.prototype.constructor=g,g.prototype.getChild=function(e){return null},g.prototype.getSymbol=function(){return this.symbol},g.prototype.getParent=function(){return this.parentCtx},g.prototype.getPayload=function(){return this.symbol},g.prototype.getSourceInterval=function(){if(null===this.symbol)return i;var e=this.symbol.tokenIndex;return new a(e,e)},g.prototype.getChildCount=function(){return 0},g.prototype.accept=function(e){return e.visitTerminal(this)},g.prototype.getText=function(){return this.symbol.text},g.prototype.toString=function(){return this.symbol.type===r.EOF?"<EOF>":this.symbol.text},T.prototype=Object.create(g.prototype),T.prototype.constructor=T,T.prototype.isErrorNode=function(){return!0},T.prototype.accept=function(e){return e.visitErrorNode(this)},y.prototype.walk=function(e,t){if(t instanceof m||void 0!==t.isErrorNode&&t.isErrorNode())e.visitErrorNode(t);else if(t instanceof u)e.visitTerminal(t);else{this.enterRule(e,t);for(var n=0;n<t.getChildCount();n++){var r=t.getChild(n);this.walk(e,r)}this.exitRule(e,t)}},y.prototype.enterRule=function(e,t){var n=t.getRuleContext();e.enterEveryRule(n),n.enterRule(e)},y.prototype.exitRule=function(e,t){var n=t.getRuleContext();n.exitRule(e),e.exitEveryRule(n)},y.DEFAULT=new y,t.RuleNode=p,t.ErrorNode=m,t.TerminalNode=u,t.ErrorNodeImpl=T,t.TerminalNodeImpl=g,t.ParseTreeListener=h,t.ParseTreeVisitor=c,t.ParseTreeWalker=y,t.INVALID_INTERVAL=i},6687:(e,t,n)=>{var r=n(8720),a=n(2792).Token,i=(n(9024).RuleNode,n(9024).ErrorNode),o=n(9024).TerminalNode,s=n(5425).ParserRuleContext,l=n(2200).m,p=n(906).INVALID_ALT_NUMBER;function u(){}u.toStringTree=function(e,t,n){t=t||null,null!==(n=n||null)&&(t=n.ruleNames);var a=u.getNodeText(e,t);a=r.escapeWhitespace(a,!1);var i=e.getChildCount();if(0===i)return a;var o="("+a+" ";i>0&&(a=u.toStringTree(e.getChild(0),t),o=o.concat(a));for(var s=1;s<i;s++)a=u.toStringTree(e.getChild(s),t),o=o.concat(" "+a);return o.concat(")")},u.getNodeText=function(e,t,n){if(t=t||null,null!==(n=n||null)&&(t=n.ruleNames),null!==t){if(e instanceof l){var r=e.getAltNumber();return r!=p?t[e.ruleIndex]+":"+r:t[e.ruleIndex]}if(e instanceof i)return e.toString();if(e instanceof o&&null!==e.symbol)return e.symbol.text}var s=e.getPayload();return s instanceof a?s.text:e.getPayload().toString()},u.getChildren=function(e){for(var t=[],n=0;n<e.getChildCount();n++)t.push(e.getChild(n));return t},u.getAncestors=function(e){var t=[];for(e=e.getParent();null!==e;)t=[e].concat(t),e=e.getParent();return t},u.findAllTokenNodes=function(e,t){return u.findAllNodes(e,t,!0)},u.findAllRuleNodes=function(e,t){return u.findAllNodes(e,t,!1)},u.findAllNodes=function(e,t,n){var r=[];return u._findAllNodes(e,t,n,r),r},u._findAllNodes=function(e,t,n,r){n&&e instanceof o?e.symbol.type===t&&r.push(e):!n&&e instanceof s&&e.ruleIndex===t&&r.push(e);for(var a=0;a<e.getChildCount();a++)u._findAllNodes(e.getChild(a),t,n,r)},u.descendants=function(e){for(var t=[e],n=0;n<e.getChildCount();n++)t=t.concat(u.descendants(e.getChild(n)));return t},t.Trees=u},6393:(e,t,n)=>{var r=n(9024);t.Trees=n(6687).Trees,t.RuleNode=r.RuleNode,t.ParseTreeListener=r.ParseTreeListener,t.ParseTreeVisitor=r.ParseTreeVisitor,t.ParseTreeWalker=r.ParseTreeWalker},3841:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,i=s(e),o=i[0],l=i[1],p=new a(function(e,t,n){return 3*(t+n)/4-n}(0,o,l)),u=0,m=l>0?o-4:o;for(n=0;n<m;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],p[u++]=t>>16&255,p[u++]=t>>8&255,p[u++]=255&t;return 2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,p[u++]=255&t),1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,p[u++]=t>>8&255,p[u++]=255&t),p},t.fromByteArray=function(e){for(var t,r=e.length,a=r%3,i=[],o=16383,s=0,p=r-a;s<p;s+=o)i.push(l(e,s,s+o>p?p:s+o));return 1===a?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===a&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),i.join("")};for(var n=[],r=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)n[o]=i[o],r[i.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,r){for(var a,i,o=[],s=t;s<r;s+=3)a=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(n[(i=a)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},308:e=>{e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},7237:(e,t,n)=>{var r=n(1288);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},3723:(e,t,n)=>{var r=n(9279),a=n(8228),i=n(1072),o=function(e){return function(t,n,o){var s,l=r(t),p=a(l.length),u=i(o,p);if(e&&n!=n){for(;p>u;)if((s=l[u++])!=s)return!0}else for(;p>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},1517:(e,t,n)=>{"use strict";var r=n(308),a=n(7237),i=n(362),o=n(1709),s=n(574),l=n(4433),p=n(1523),u=n(8225),m=n(3648),c=u("Promise"),h=p.set,g=p.get,T=l("toStringTag");e.exports=function(e,t){var n=function(e){e.next=r(e.iterator.next),e.done=!1,e.ignoreArgument=!t,h(this,e)};return n.prototype=s(i(m),{next:function(n){var r=this,i=!!arguments.length;return new c((function(o){var s=g(r),l=i?[s.ignoreArgument?void 0:n]:t?[]:[void 0];s.ignoreArgument=!1,o(s.done?{done:!0,value:void 0}:a(e.call(s,c,l)))}))},return:function(e){var t=this;return new c((function(n,r){var i=g(t),o=i.iterator;i.done=!0;var s=o.return;if(void 0===s)return n({done:!0,value:e});c.resolve(s.call(o,e)).then((function(t){a(t),n({done:!0,value:e})}),r)}))},throw:function(e){var t=this;return new c((function(n,r){var a=g(t),i=a.iterator;a.done=!0;var o=i.throw;if(void 0===o)return r(e);n(o.call(i,e))}))}}),t||o(n.prototype,T,"Generator"),n}},321:(e,t,n)=>{"use strict";var r=n(308),a=n(7237),i=n(8225)("Promise"),o=[].push,s=function(e){var t=0==e,n=1==e,s=2==e,l=3==e;return function(e,p){a(e);var u=r(e.next),m=t?[]:void 0;return t||r(p),new i((function(r,c){var h=function(t,n){try{var r=e.return;if(void 0!==r)return i.resolve(r.call(e)).then((function(){t(n)}),(function(e){c(e)}))}catch(e){return c(e)}t(n)},g=function(e){h(c,e)},T=function(){try{i.resolve(a(u.call(e))).then((function(e){try{if(a(e).done)r(t?m:!l&&(s||void 0));else{var u=e.value;t?(o.call(m,u),T()):i.resolve(p(u)).then((function(e){n?T():s?e?T():h(r,!1):e?h(r,l||u):T()}),g)}}catch(e){g(e)}}),g)}catch(e){g(e)}};T()}))}};e.exports={toArray:s(0),forEach:s(1),every:s(2),some:s(3),find:s(4)}},3648:(e,t,n)=>{var r,a,i=n(3893),o=n(3079),s=n(362),l=n(9421),p=n(1709),u=n(4433),m=n(9701),c="USE_FUNCTION_CONSTRUCTOR",h=u("asyncIterator"),g=i.AsyncIterator,T=o.AsyncIteratorPrototype;if(T)r=T;else if("function"==typeof g)r=g.prototype;else if(o[c]||i[c])try{a=l(l(l(Function("return async function*(){}()")()))),l(a)===Object.prototype&&(r=a)}catch(e){}r?m&&(r=s(r)):r={},"function"!=typeof r[h]&&p(r,h,(function(){return this})),e.exports=r},3758:e=>{var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},7302:(e,t,n)=>{var r=n(7572),a=n(1145),i=n(2657),o=n(7419);e.exports=function(e,t){for(var n=a(t),s=o.f,l=i.f,p=0;p<n.length;p++){var u=n[p];r(e,u)||s(e,u,l(t,u))}}},2577:(e,t,n)=>{var r=n(8073);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},1709:(e,t,n)=>{var r=n(9774),a=n(7419),i=n(9754);e.exports=r?function(e,t,n){return a.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},9754:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},9774:(e,t,n)=>{var r=n(8073);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},1305:(e,t,n)=>{var r=n(3893),a=n(1288),i=r.document,o=a(i)&&a(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},6254:(e,t,n)=>{var r=n(8225);e.exports=r("navigator","userAgent")||""},2586:(e,t,n)=>{var r,a,i=n(3893),o=n(6254),s=i.process,l=i.Deno,p=s&&s.versions||l&&l.version,u=p&&p.v8;u?a=(r=u.split("."))[0]<4?1:r[0]+r[1]:o&&(!(r=o.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=o.match(/Chrome\/(\d+)/))&&(a=r[1]),e.exports=a&&+a},8197:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},4692:(e,t,n)=>{var r=n(3893),a=n(2657).f,i=n(1709),o=n(828),s=n(8674),l=n(7302),p=n(8906);e.exports=function(e,t){var n,u,m,c,h,g=e.target,T=e.global,y=e.stat;if(n=T?r:y?r[g]||s(g,{}):(r[g]||{}).prototype)for(u in t){if(c=t[u],m=e.noTargetGet?(h=a(n,u))&&h.value:n[u],!p(T?u:g+(y?".":"#")+u,e.forced)&&void 0!==m){if(typeof c==typeof m)continue;l(c,m)}(e.sham||m&&m.sham)&&i(c,"sham",!0),o(n,u,c,e)}}},8073:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},8225:(e,t,n)=>{var r=n(3893);e.exports=function(e,t){return arguments.length<2?"function"==typeof(n=r[e])?n:void 0:r[e]&&r[e][t];var n}},3893:(e,t,n)=>{var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},7572:(e,t,n)=>{var r=n(1595),a={}.hasOwnProperty;e.exports=Object.hasOwn||function(e,t){return a.call(r(e),t)}},6595:e=>{e.exports={}},6075:(e,t,n)=>{var r=n(8225);e.exports=r("document","documentElement")},55:(e,t,n)=>{var r=n(9774),a=n(8073),i=n(1305);e.exports=!r&&!a((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},3785:(e,t,n)=>{var r=n(8073),a=n(3758),i="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==a(e)?i.call(e,""):Object(e)}:Object},3220:(e,t,n)=>{var r=n(3079),a=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return a.call(e)}),e.exports=r.inspectSource},1523:(e,t,n)=>{var r,a,i,o=n(8417),s=n(3893),l=n(1288),p=n(1709),u=n(7572),m=n(3079),c=n(6017),h=n(6595),g="Object already initialized",T=s.WeakMap;if(o||m.state){var y=m.state||(m.state=new T),d=y.get,f=y.has,S=y.set;r=function(e,t){if(f.call(y,e))throw new TypeError(g);return t.facade=e,S.call(y,e,t),t},a=function(e){return d.call(y,e)||{}},i=function(e){return f.call(y,e)}}else{var b=c("state");h[b]=!0,r=function(e,t){if(u(e,b))throw new TypeError(g);return t.facade=e,p(e,b,t),t},a=function(e){return u(e,b)?e[b]:{}},i=function(e){return u(e,b)}}e.exports={set:r,get:a,has:i,enforce:function(e){return i(e)?a(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!l(t)||(n=a(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},8906:(e,t,n)=>{var r=n(8073),a=/#|\.prototype\./,i=function(e,t){var n=s[o(e)];return n==p||n!=l&&("function"==typeof t?r(t):!!t)},o=i.normalize=function(e){return String(e).replace(a,".").toLowerCase()},s=i.data={},l=i.NATIVE="N",p=i.POLYFILL="P";e.exports=i},1288:e=>{e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},9701:e=>{e.exports=!1},8719:(e,t,n)=>{var r=n(8225),a=n(5102);e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return"function"==typeof t&&Object(e)instanceof t}},8774:(e,t,n)=>{var r=n(2586),a=n(8073);e.exports=!!Object.getOwnPropertySymbols&&!a((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},8417:(e,t,n)=>{var r=n(3893),a=n(3220),i=r.WeakMap;e.exports="function"==typeof i&&/native code/.test(a(i))},362:(e,t,n)=>{var r,a=n(7237),i=n(7399),o=n(8197),s=n(6595),l=n(6075),p=n(1305),u=n(6017),m="prototype",c="script",h=u("IE_PROTO"),g=function(){},T=function(e){return"<"+c+">"+e+"</"+c+">"},y=function(e){e.write(T("")),e.close();var t=e.parentWindow.Object;return e=null,t},d=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;d="undefined"!=typeof document?document.domain&&r?y(r):(t=p("iframe"),n="java"+c+":",t.style.display="none",l.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(T("document.F=Object")),e.close(),e.F):y(r);for(var a=o.length;a--;)delete d[m][o[a]];return d()};s[h]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(g[m]=a(e),n=new g,g[m]=null,n[h]=e):n=d(),void 0===t?n:i(n,t)}},7399:(e,t,n)=>{var r=n(9774),a=n(7419),i=n(7237),o=n(8298);e.exports=r?Object.defineProperties:function(e,t){i(e);for(var n,r=o(t),s=r.length,l=0;s>l;)a.f(e,n=r[l++],t[n]);return e}},7419:(e,t,n)=>{var r=n(9774),a=n(55),i=n(7237),o=n(9783),s=Object.defineProperty;t.f=r?s:function(e,t,n){if(i(e),t=o(t),i(n),a)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},2657:(e,t,n)=>{var r=n(9774),a=n(8363),i=n(9754),o=n(9279),s=n(9783),l=n(7572),p=n(55),u=Object.getOwnPropertyDescriptor;t.f=r?u:function(e,t){if(e=o(e),t=s(t),p)try{return u(e,t)}catch(e){}if(l(e,t))return i(!a.f.call(e,t),e[t])}},7798:(e,t,n)=>{var r=n(5350),a=n(8197).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,a)}},2379:(e,t)=>{t.f=Object.getOwnPropertySymbols},9421:(e,t,n)=>{var r=n(7572),a=n(1595),i=n(6017),o=n(2577),s=i("IE_PROTO"),l=Object.prototype;e.exports=o?Object.getPrototypeOf:function(e){return e=a(e),r(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?l:null}},5350:(e,t,n)=>{var r=n(7572),a=n(9279),i=n(3723).indexOf,o=n(6595);e.exports=function(e,t){var n,s=a(e),l=0,p=[];for(n in s)!r(o,n)&&r(s,n)&&p.push(n);for(;t.length>l;)r(s,n=t[l++])&&(~i(p,n)||p.push(n));return p}},8298:(e,t,n)=>{var r=n(5350),a=n(8197);e.exports=Object.keys||function(e){return r(e,a)}},8363:(e,t)=>{"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,a=r&&!n.call({1:2},1);t.f=a?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},8188:(e,t,n)=>{var r=n(1288);e.exports=function(e,t){var n,a;if("string"===t&&"function"==typeof(n=e.toString)&&!r(a=n.call(e)))return a;if("function"==typeof(n=e.valueOf)&&!r(a=n.call(e)))return a;if("string"!==t&&"function"==typeof(n=e.toString)&&!r(a=n.call(e)))return a;throw TypeError("Can't convert object to primitive value")}},1145:(e,t,n)=>{var r=n(8225),a=n(7798),i=n(2379),o=n(7237);e.exports=r("Reflect","ownKeys")||function(e){var t=a.f(o(e)),n=i.f;return n?t.concat(n(e)):t}},574:(e,t,n)=>{var r=n(828);e.exports=function(e,t,n){for(var a in t)r(e,a,t[a],n);return e}},828:(e,t,n)=>{var r=n(3893),a=n(1709),i=n(7572),o=n(8674),s=n(3220),l=n(1523),p=l.get,u=l.enforce,m=String(String).split("String");(e.exports=function(e,t,n,s){var l,p=!!s&&!!s.unsafe,c=!!s&&!!s.enumerable,h=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof t||i(n,"name")||a(n,"name",t),(l=u(n)).source||(l.source=m.join("string"==typeof t?t:""))),e!==r?(p?!h&&e[t]&&(c=!0):delete e[t],c?e[t]=n:a(e,t,n)):c?e[t]=n:o(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&p(this).source||s(this)}))},1296:e=>{e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},8674:(e,t,n)=>{var r=n(3893);e.exports=function(e,t){try{Object.defineProperty(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},6017:(e,t,n)=>{var r=n(2759),a=n(9530),i=r("keys");e.exports=function(e){return i[e]||(i[e]=a(e))}},3079:(e,t,n)=>{var r=n(3893),a=n(8674),i="__core-js_shared__",o=r[i]||a(i,{});e.exports=o},2759:(e,t,n)=>{var r=n(9701),a=n(3079);(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.17.3",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},1072:(e,t,n)=>{var r=n(8972),a=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?a(n+t,0):i(n,t)}},9279:(e,t,n)=>{var r=n(3785),a=n(1296);e.exports=function(e){return r(a(e))}},8972:e=>{var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)}},8228:(e,t,n)=>{var r=n(8972),a=Math.min;e.exports=function(e){return e>0?a(r(e),9007199254740991):0}},1595:(e,t,n)=>{var r=n(1296);e.exports=function(e){return Object(r(e))}},6099:(e,t,n)=>{var r=n(1288),a=n(8719),i=n(8188),o=n(4433)("toPrimitive");e.exports=function(e,t){if(!r(e)||a(e))return e;var n,s=e[o];if(void 0!==s){if(void 0===t&&(t="default"),n=s.call(e,t),!r(n)||a(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===t&&(t="number"),i(e,t)}},9783:(e,t,n)=>{var r=n(6099),a=n(8719);e.exports=function(e){var t=r(e,"string");return a(t)?t:String(t)}},9530:e=>{var t=0,n=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++t+n).toString(36)}},5102:(e,t,n)=>{var r=n(8774);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},4433:(e,t,n)=>{var r=n(3893),a=n(2759),i=n(7572),o=n(9530),s=n(8774),l=n(5102),p=a("wks"),u=r.Symbol,m=l?u:u&&u.withoutSetter||o;e.exports=function(e){return i(p,e)&&(s||"string"==typeof p[e])||(s&&i(u,e)?p[e]=u[e]:p[e]=m("Symbol."+e)),p[e]}},2282:(e,t,n)=>{"use strict";var r=n(4692),a=n(321).every;r({target:"AsyncIterator",proto:!0,real:!0},{every:function(e){return a(this,e)}})},4995:(e,t,n)=>{"use strict";var r=n(4692),a=n(308),i=n(7237),o=n(1517)((function(e,t){var n=this,r=n.filterer;return new e((function(a,o){var s=function(){try{e.resolve(i(n.next.apply(n.iterator,t))).then((function(t){try{if(i(t).done)n.done=!0,a({done:!0,value:void 0});else{var l=t.value;e.resolve(r(l)).then((function(e){e?a({done:!1,value:l}):s()}),o)}}catch(e){o(e)}}),o)}catch(e){o(e)}};s()}))}));r({target:"AsyncIterator",proto:!0,real:!0},{filter:function(e){return new o({iterator:i(this),filterer:a(e)})}})},8854:(e,t,n)=>{"use strict";var r=n(4692),a=n(321).forEach;r({target:"AsyncIterator",proto:!0,real:!0},{forEach:function(e){return a(this,e)}})},8451:(e,t,n)=>{"use strict";var r=n(4692),a=n(308),i=n(7237),o=n(1517)((function(e,t){var n=this,r=n.mapper;return e.resolve(i(n.next.apply(n.iterator,t))).then((function(t){return i(t).done?(n.done=!0,{done:!0,value:void 0}):e.resolve(r(t.value)).then((function(e){return{done:!1,value:e}}))}))}));r({target:"AsyncIterator",proto:!0,real:!0},{map:function(e){return new o({iterator:i(this),mapper:a(e)})}})},6327:(e,t,n)=>{"use strict";var r=n(4692),a=n(308),i=n(7237),o=n(8225)("Promise");r({target:"AsyncIterator",proto:!0,real:!0},{reduce:function(e){var t=i(this),n=a(t.next),r=arguments.length<2,s=r?void 0:arguments[1];return a(e),new o((function(a,l){var p=function(){try{o.resolve(i(n.call(t))).then((function(t){try{if(i(t).done)r?l(TypeError("Reduce of empty iterator with no initial value")):a(s);else{var n=t.value;r?(r=!1,s=n,p()):o.resolve(e(s,n)).then((function(e){s=e,p()}),l)}}catch(e){l(e)}}),l)}catch(e){l(e)}};p()}))}})},8707:function(e){var t;t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={exports:{},id:r,loaded:!1};return e[r].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(3),i=n(8),o=n(15);function s(e,t,n){var o=null,s=function(e,t){n&&n(e,t),o&&o.visit(e,t)},l="function"==typeof n?s:null,p=!1;if(t){p="boolean"==typeof t.comment&&t.comment;var u="boolean"==typeof t.attachComment&&t.attachComment;(p||u)&&((o=new r.CommentHandler).attach=u,t.comment=!0,l=s)}var m,c=!1;t&&"string"==typeof t.sourceType&&(c="module"===t.sourceType),m=t&&"boolean"==typeof t.jsx&&t.jsx?new a.JSXParser(e,t,l):new i.Parser(e,t,l);var h=c?m.parseModule():m.parseScript();return p&&o&&(h.comments=o.comments),m.config.tokens&&(h.tokens=m.tokens),m.config.tolerant&&(h.errors=m.errorHandler.errors),h}t.parse=s,t.parseModule=function(e,t,n){var r=t||{};return r.sourceType="module",s(e,r,n)},t.parseScript=function(e,t,n){var r=t||{};return r.sourceType="script",s(e,r,n)},t.tokenize=function(e,t,n){var r,a=new o.Tokenizer(e,t);r=[];try{for(;;){var i=a.getNextToken();if(!i)break;n&&(i=n(i)),r.push(i)}}catch(e){a.errorHandler.tolerate(e)}return a.errorHandler.tolerant&&(r.errors=a.errors()),r};var l=n(2);t.Syntax=l.Syntax,t.version="4.0.1"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),a=function(){function e(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return e.prototype.insertInnerComments=function(e,t){if(e.type===r.Syntax.BlockStatement&&0===e.body.length){for(var n=[],a=this.leading.length-1;a>=0;--a){var i=this.leading[a];t.end.offset>=i.start&&(n.unshift(i.comment),this.leading.splice(a,1),this.trailing.splice(a,1))}n.length&&(e.innerComments=n)}},e.prototype.findTrailingComments=function(e){var t=[];if(this.trailing.length>0){for(var n=this.trailing.length-1;n>=0;--n){var r=this.trailing[n];r.start>=e.end.offset&&t.unshift(r.comment)}return this.trailing.length=0,t}var a=this.stack[this.stack.length-1];if(a&&a.node.trailingComments){var i=a.node.trailingComments[0];i&&i.range[0]>=e.end.offset&&(t=a.node.trailingComments,delete a.node.trailingComments)}return t},e.prototype.findLeadingComments=function(e){for(var t,n=[];this.stack.length>0&&(i=this.stack[this.stack.length-1])&&i.start>=e.start.offset;)t=i.node,this.stack.pop();if(t){for(var r=(t.leadingComments?t.leadingComments.length:0)-1;r>=0;--r){var a=t.leadingComments[r];a.range[1]<=e.start.offset&&(n.unshift(a),t.leadingComments.splice(r,1))}return t.leadingComments&&0===t.leadingComments.length&&delete t.leadingComments,n}for(r=this.leading.length-1;r>=0;--r){var i;(i=this.leading[r]).start<=e.start.offset&&(n.unshift(i.comment),this.leading.splice(r,1))}return n},e.prototype.visitNode=function(e,t){if(!(e.type===r.Syntax.Program&&e.body.length>0)){this.insertInnerComments(e,t);var n=this.findTrailingComments(t),a=this.findLeadingComments(t);a.length>0&&(e.leadingComments=a),n.length>0&&(e.trailingComments=n),this.stack.push({node:e,start:t.start.offset})}},e.prototype.visitComment=function(e,t){var n="L"===e.type[0]?"Line":"Block",r={type:n,value:e.value};if(e.range&&(r.range=e.range),e.loc&&(r.loc=e.loc),this.comments.push(r),this.attach){var a={comment:{type:n,value:e.value,range:[t.start.offset,t.end.offset]},start:t.start.offset};e.loc&&(a.comment.loc=e.loc),e.type=n,this.leading.push(a),this.trailing.push(a)}},e.prototype.visit=function(e,t){"LineComment"===e.type||"BlockComment"===e.type?this.visitComment(e,t):this.attach&&this.visitNode(e,t)},e}();t.CommentHandler=a},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(e,t,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=n(5),s=n(6),l=n(7),p=n(8),u=n(13),m=n(14);function c(e){var t;switch(e.type){case s.JSXSyntax.JSXIdentifier:t=e.name;break;case s.JSXSyntax.JSXNamespacedName:var n=e;t=c(n.namespace)+":"+c(n.name);break;case s.JSXSyntax.JSXMemberExpression:var r=e;t=c(r.object)+"."+c(r.property)}return t}u.TokenName[100]="JSXIdentifier",u.TokenName[101]="JSXText";var h=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}return a(t,e),t.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():e.prototype.parsePrimaryExpression.call(this)},t.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},t.prototype.finishJSX=function(){this.nextToken()},t.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},t.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.scanXHTMLEntity=function(e){for(var t="&",n=!0,r=!1,a=!1,o=!1;!this.scanner.eof()&&n&&!r;){var s=this.scanner.source[this.scanner.index];if(s===e)break;if(r=";"===s,t+=s,++this.scanner.index,!r)switch(t.length){case 2:a="#"===s;break;case 3:a&&(n=(o="x"===s)||i.Character.isDecimalDigit(s.charCodeAt(0)),a=a&&!o);break;default:n=(n=n&&!(a&&!i.Character.isDecimalDigit(s.charCodeAt(0))))&&!(o&&!i.Character.isHexDigit(s.charCodeAt(0)))}}if(n&&r&&t.length>2){var l=t.substr(1,t.length-2);a&&l.length>1?t=String.fromCharCode(parseInt(l.substr(1),10)):o&&l.length>2?t=String.fromCharCode(parseInt("0"+l.substr(1),16)):a||o||!m.XHTMLEntities[l]||(t=m.XHTMLEntities[l])}return t},t.prototype.lexJSX=function(){var e=this.scanner.source.charCodeAt(this.scanner.index);if(60===e||62===e||47===e||58===e||61===e||123===e||125===e)return{type:7,value:s=this.scanner.source[this.scanner.index++],lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index};if(34===e||39===e){for(var t=this.scanner.index,n=this.scanner.source[this.scanner.index++],r="";!this.scanner.eof()&&(l=this.scanner.source[this.scanner.index++])!==n;)r+="&"===l?this.scanXHTMLEntity(n):l;return{type:8,value:r,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index}}if(46===e){var a=this.scanner.source.charCodeAt(this.scanner.index+1),o=this.scanner.source.charCodeAt(this.scanner.index+2),s=46===a&&46===o?"...":".";return t=this.scanner.index,this.scanner.index+=s.length,{type:7,value:s,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index}}if(96===e)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(i.Character.isIdentifierStart(e)&&92!==e){for(t=this.scanner.index,++this.scanner.index;!this.scanner.eof();){var l=this.scanner.source.charCodeAt(this.scanner.index);if(i.Character.isIdentifierPart(l)&&92!==l)++this.scanner.index;else{if(45!==l)break;++this.scanner.index}}return{type:100,value:this.scanner.source.slice(t,this.scanner.index),lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index}}return this.scanner.lex()},t.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var e=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(e)),e},t.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var e=this.scanner.index,t="";!this.scanner.eof();){var n=this.scanner.source[this.scanner.index];if("{"===n||"<"===n)break;++this.scanner.index,t+=n,i.Character.isLineTerminator(n.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===n&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var r={type:101,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index};return t.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(r)),r},t.prototype.peekJSXToken=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.lexJSX();return this.scanner.restoreState(e),t},t.prototype.expectJSX=function(e){var t=this.nextJSXToken();7===t.type&&t.value===e||this.throwUnexpectedToken(t)},t.prototype.matchJSX=function(e){var t=this.peekJSXToken();return 7===t.type&&t.value===e},t.prototype.parseJSXIdentifier=function(){var e=this.createJSXNode(),t=this.nextJSXToken();return 100!==t.type&&this.throwUnexpectedToken(t),this.finalize(e,new o.JSXIdentifier(t.value))},t.prototype.parseJSXElementName=function(){var e=this.createJSXNode(),t=this.parseJSXIdentifier();if(this.matchJSX(":")){var n=t;this.expectJSX(":");var r=this.parseJSXIdentifier();t=this.finalize(e,new o.JSXNamespacedName(n,r))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var a=t;this.expectJSX(".");var i=this.parseJSXIdentifier();t=this.finalize(e,new o.JSXMemberExpression(a,i))}return t},t.prototype.parseJSXAttributeName=function(){var e,t=this.createJSXNode(),n=this.parseJSXIdentifier();if(this.matchJSX(":")){var r=n;this.expectJSX(":");var a=this.parseJSXIdentifier();e=this.finalize(t,new o.JSXNamespacedName(r,a))}else e=n;return e},t.prototype.parseJSXStringLiteralAttribute=function(){var e=this.createJSXNode(),t=this.nextJSXToken();8!==t.type&&this.throwUnexpectedToken(t);var n=this.getTokenRaw(t);return this.finalize(e,new l.Literal(t.value,n))},t.prototype.parseJSXExpressionAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new o.JSXExpressionContainer(t))},t.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},t.prototype.parseJSXNameValueAttribute=function(){var e=this.createJSXNode(),t=this.parseJSXAttributeName(),n=null;return this.matchJSX("=")&&(this.expectJSX("="),n=this.parseJSXAttributeValue()),this.finalize(e,new o.JSXAttribute(t,n))},t.prototype.parseJSXSpreadAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new o.JSXSpreadAttribute(t))},t.prototype.parseJSXAttributes=function(){for(var e=[];!this.matchJSX("/")&&!this.matchJSX(">");){var t=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();e.push(t)}return e},t.prototype.parseJSXOpeningElement=function(){var e=this.createJSXNode();this.expectJSX("<");var t=this.parseJSXElementName(),n=this.parseJSXAttributes(),r=this.matchJSX("/");return r&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new o.JSXOpeningElement(t,r,n))},t.prototype.parseJSXBoundaryElement=function(){var e=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var t=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(e,new o.JSXClosingElement(t))}var n=this.parseJSXElementName(),r=this.parseJSXAttributes(),a=this.matchJSX("/");return a&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new o.JSXOpeningElement(n,a,r))},t.prototype.parseJSXEmptyExpression=function(){var e=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(e,new o.JSXEmptyExpression)},t.prototype.parseJSXExpressionContainer=function(){var e,t=this.createJSXNode();return this.expectJSX("{"),this.matchJSX("}")?(e=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),e=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(t,new o.JSXExpressionContainer(e))},t.prototype.parseJSXChildren=function(){for(var e=[];!this.scanner.eof();){var t=this.createJSXChildNode(),n=this.nextJSXText();if(n.start<n.end){var r=this.getTokenRaw(n),a=this.finalize(t,new o.JSXText(n.value,r));e.push(a)}if("{"!==this.scanner.source[this.scanner.index])break;var i=this.parseJSXExpressionContainer();e.push(i)}return e},t.prototype.parseComplexJSXElement=function(e){for(var t=[];!this.scanner.eof();){e.children=e.children.concat(this.parseJSXChildren());var n=this.createJSXChildNode(),r=this.parseJSXBoundaryElement();if(r.type===s.JSXSyntax.JSXOpeningElement){var a=r;if(a.selfClosing){var i=this.finalize(n,new o.JSXElement(a,[],null));e.children.push(i)}else t.push(e),e={node:n,opening:a,closing:null,children:[]}}if(r.type===s.JSXSyntax.JSXClosingElement){e.closing=r;var l=c(e.opening.name);if(l!==c(e.closing.name)&&this.tolerateError("Expected corresponding JSX closing tag for %0",l),!(t.length>0))break;i=this.finalize(e.node,new o.JSXElement(e.opening,e.children,e.closing)),(e=t[t.length-1]).children.push(i),t.pop()}}return e},t.prototype.parseJSXElement=function(){var e=this.createJSXNode(),t=this.parseJSXOpeningElement(),n=[],r=null;if(!t.selfClosing){var a=this.parseComplexJSXElement({node:e,opening:t,closing:r,children:n});n=a.children,r=a.closing}return this.finalize(e,new o.JSXElement(t,n,r))},t.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var e=this.parseJSXElement();return this.finishJSX(),e},t.prototype.isStartOfExpression=function(){return e.prototype.isStartOfExpression.call(this)||this.match("<")},t}(p.Parser);t.JSXParser=h},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};t.Character={fromCodePoint:function(e){return e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023))},isWhiteSpace:function(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0},isLineTerminator:function(e){return 10===e||13===e||8232===e||8233===e},isIdentifierStart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&n.NonAsciiIdentifierStart.test(t.Character.fromCodePoint(e))},isIdentifierPart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&n.NonAsciiIdentifierPart.test(t.Character.fromCodePoint(e))},isDecimalDigit:function(e){return e>=48&&e<=57},isHexDigit:function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},isOctalDigit:function(e){return e>=48&&e<=55}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6);t.JSXClosingElement=function(e){this.type=r.JSXSyntax.JSXClosingElement,this.name=e};t.JSXElement=function(e,t,n){this.type=r.JSXSyntax.JSXElement,this.openingElement=e,this.children=t,this.closingElement=n};t.JSXEmptyExpression=function(){this.type=r.JSXSyntax.JSXEmptyExpression};t.JSXExpressionContainer=function(e){this.type=r.JSXSyntax.JSXExpressionContainer,this.expression=e};t.JSXIdentifier=function(e){this.type=r.JSXSyntax.JSXIdentifier,this.name=e};t.JSXMemberExpression=function(e,t){this.type=r.JSXSyntax.JSXMemberExpression,this.object=e,this.property=t};t.JSXAttribute=function(e,t){this.type=r.JSXSyntax.JSXAttribute,this.name=e,this.value=t};t.JSXNamespacedName=function(e,t){this.type=r.JSXSyntax.JSXNamespacedName,this.namespace=e,this.name=t};t.JSXOpeningElement=function(e,t,n){this.type=r.JSXSyntax.JSXOpeningElement,this.name=e,this.selfClosing=t,this.attributes=n};t.JSXSpreadAttribute=function(e){this.type=r.JSXSyntax.JSXSpreadAttribute,this.argument=e};t.JSXText=function(e,t){this.type=r.JSXSyntax.JSXText,this.value=e,this.raw=t}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.ArrayExpression=function(e){this.type=r.Syntax.ArrayExpression,this.elements=e};t.ArrayPattern=function(e){this.type=r.Syntax.ArrayPattern,this.elements=e};t.ArrowFunctionExpression=function(e,t,n){this.type=r.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n,this.async=!1};t.AssignmentExpression=function(e,t,n){this.type=r.Syntax.AssignmentExpression,this.operator=e,this.left=t,this.right=n};t.AssignmentPattern=function(e,t){this.type=r.Syntax.AssignmentPattern,this.left=e,this.right=t};t.AsyncArrowFunctionExpression=function(e,t,n){this.type=r.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n,this.async=!0};t.AsyncFunctionDeclaration=function(e,t,n){this.type=r.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=!1,this.expression=!1,this.async=!0};t.AsyncFunctionExpression=function(e,t,n){this.type=r.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=!1,this.expression=!1,this.async=!0};t.AwaitExpression=function(e){this.type=r.Syntax.AwaitExpression,this.argument=e};t.BinaryExpression=function(e,t,n){var a="||"===e||"&&"===e;this.type=a?r.Syntax.LogicalExpression:r.Syntax.BinaryExpression,this.operator=e,this.left=t,this.right=n};t.BlockStatement=function(e){this.type=r.Syntax.BlockStatement,this.body=e};t.BreakStatement=function(e){this.type=r.Syntax.BreakStatement,this.label=e};t.CallExpression=function(e,t){this.type=r.Syntax.CallExpression,this.callee=e,this.arguments=t};t.CatchClause=function(e,t){this.type=r.Syntax.CatchClause,this.param=e,this.body=t};t.ClassBody=function(e){this.type=r.Syntax.ClassBody,this.body=e};t.ClassDeclaration=function(e,t,n){this.type=r.Syntax.ClassDeclaration,this.id=e,this.superClass=t,this.body=n};t.ClassExpression=function(e,t,n){this.type=r.Syntax.ClassExpression,this.id=e,this.superClass=t,this.body=n};t.ComputedMemberExpression=function(e,t){this.type=r.Syntax.MemberExpression,this.computed=!0,this.object=e,this.property=t};t.ConditionalExpression=function(e,t,n){this.type=r.Syntax.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=n};t.ContinueStatement=function(e){this.type=r.Syntax.ContinueStatement,this.label=e};t.DebuggerStatement=function(){this.type=r.Syntax.DebuggerStatement};t.Directive=function(e,t){this.type=r.Syntax.ExpressionStatement,this.expression=e,this.directive=t};t.DoWhileStatement=function(e,t){this.type=r.Syntax.DoWhileStatement,this.body=e,this.test=t};t.EmptyStatement=function(){this.type=r.Syntax.EmptyStatement};t.ExportAllDeclaration=function(e){this.type=r.Syntax.ExportAllDeclaration,this.source=e};t.ExportDefaultDeclaration=function(e){this.type=r.Syntax.ExportDefaultDeclaration,this.declaration=e};t.ExportNamedDeclaration=function(e,t,n){this.type=r.Syntax.ExportNamedDeclaration,this.declaration=e,this.specifiers=t,this.source=n};t.ExportSpecifier=function(e,t){this.type=r.Syntax.ExportSpecifier,this.exported=t,this.local=e};t.ExpressionStatement=function(e){this.type=r.Syntax.ExpressionStatement,this.expression=e};t.ForInStatement=function(e,t,n){this.type=r.Syntax.ForInStatement,this.left=e,this.right=t,this.body=n,this.each=!1};t.ForOfStatement=function(e,t,n){this.type=r.Syntax.ForOfStatement,this.left=e,this.right=t,this.body=n};t.ForStatement=function(e,t,n,a){this.type=r.Syntax.ForStatement,this.init=e,this.test=t,this.update=n,this.body=a};t.FunctionDeclaration=function(e,t,n,a){this.type=r.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=a,this.expression=!1,this.async=!1};t.FunctionExpression=function(e,t,n,a){this.type=r.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=a,this.expression=!1,this.async=!1};t.Identifier=function(e){this.type=r.Syntax.Identifier,this.name=e};t.IfStatement=function(e,t,n){this.type=r.Syntax.IfStatement,this.test=e,this.consequent=t,this.alternate=n};t.ImportDeclaration=function(e,t){this.type=r.Syntax.ImportDeclaration,this.specifiers=e,this.source=t};t.ImportDefaultSpecifier=function(e){this.type=r.Syntax.ImportDefaultSpecifier,this.local=e};t.ImportNamespaceSpecifier=function(e){this.type=r.Syntax.ImportNamespaceSpecifier,this.local=e};t.ImportSpecifier=function(e,t){this.type=r.Syntax.ImportSpecifier,this.local=e,this.imported=t};t.LabeledStatement=function(e,t){this.type=r.Syntax.LabeledStatement,this.label=e,this.body=t};t.Literal=function(e,t){this.type=r.Syntax.Literal,this.value=e,this.raw=t};t.MetaProperty=function(e,t){this.type=r.Syntax.MetaProperty,this.meta=e,this.property=t};t.MethodDefinition=function(e,t,n,a,i){this.type=r.Syntax.MethodDefinition,this.key=e,this.computed=t,this.value=n,this.kind=a,this.static=i};t.Module=function(e){this.type=r.Syntax.Program,this.body=e,this.sourceType="module"};t.NewExpression=function(e,t){this.type=r.Syntax.NewExpression,this.callee=e,this.arguments=t};t.ObjectExpression=function(e){this.type=r.Syntax.ObjectExpression,this.properties=e};t.ObjectPattern=function(e){this.type=r.Syntax.ObjectPattern,this.properties=e};t.Property=function(e,t,n,a,i,o){this.type=r.Syntax.Property,this.key=t,this.computed=n,this.value=a,this.kind=e,this.method=i,this.shorthand=o};t.RegexLiteral=function(e,t,n,a){this.type=r.Syntax.Literal,this.value=e,this.raw=t,this.regex={pattern:n,flags:a}};t.RestElement=function(e){this.type=r.Syntax.RestElement,this.argument=e};t.ReturnStatement=function(e){this.type=r.Syntax.ReturnStatement,this.argument=e};t.Script=function(e){this.type=r.Syntax.Program,this.body=e,this.sourceType="script"};t.SequenceExpression=function(e){this.type=r.Syntax.SequenceExpression,this.expressions=e};t.SpreadElement=function(e){this.type=r.Syntax.SpreadElement,this.argument=e};t.StaticMemberExpression=function(e,t){this.type=r.Syntax.MemberExpression,this.computed=!1,this.object=e,this.property=t};t.Super=function(){this.type=r.Syntax.Super};t.SwitchCase=function(e,t){this.type=r.Syntax.SwitchCase,this.test=e,this.consequent=t};t.SwitchStatement=function(e,t){this.type=r.Syntax.SwitchStatement,this.discriminant=e,this.cases=t};t.TaggedTemplateExpression=function(e,t){this.type=r.Syntax.TaggedTemplateExpression,this.tag=e,this.quasi=t};t.TemplateElement=function(e,t){this.type=r.Syntax.TemplateElement,this.value=e,this.tail=t};t.TemplateLiteral=function(e,t){this.type=r.Syntax.TemplateLiteral,this.quasis=e,this.expressions=t};t.ThisExpression=function(){this.type=r.Syntax.ThisExpression};t.ThrowStatement=function(e){this.type=r.Syntax.ThrowStatement,this.argument=e};t.TryStatement=function(e,t,n){this.type=r.Syntax.TryStatement,this.block=e,this.handler=t,this.finalizer=n};t.UnaryExpression=function(e,t){this.type=r.Syntax.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0};t.UpdateExpression=function(e,t,n){this.type=r.Syntax.UpdateExpression,this.operator=e,this.argument=t,this.prefix=n};t.VariableDeclaration=function(e,t){this.type=r.Syntax.VariableDeclaration,this.declarations=e,this.kind=t};t.VariableDeclarator=function(e,t){this.type=r.Syntax.VariableDeclarator,this.id=e,this.init=t};t.WhileStatement=function(e,t){this.type=r.Syntax.WhileStatement,this.test=e,this.body=t};t.WithStatement=function(e,t){this.type=r.Syntax.WithStatement,this.object=e,this.body=t};t.YieldExpression=function(e,t){this.type=r.Syntax.YieldExpression,this.argument=e,this.delegate=t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),a=n(10),i=n(11),o=n(7),s=n(12),l=n(2),p=n(13),u="ArrowParameterPlaceHolder",m=function(){function e(e,t,n){void 0===t&&(t={}),this.config={range:"boolean"==typeof t.range&&t.range,loc:"boolean"==typeof t.loc&&t.loc,source:null,tokens:"boolean"==typeof t.tokens&&t.tokens,comment:"boolean"==typeof t.comment&&t.comment,tolerant:"boolean"==typeof t.tolerant&&t.tolerant},this.config.loc&&t.source&&null!==t.source&&(this.config.source=String(t.source)),this.delegate=n,this.errorHandler=new a.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new s.Scanner(e,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return e.prototype.throwError=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var a=Array.prototype.slice.call(arguments,1),i=e.replace(/%(\d)/g,(function(e,t){return r.assert(t<a.length,"Message reference must be in range"),a[t]})),o=this.lastMarker.index,s=this.lastMarker.line,l=this.lastMarker.column+1;throw this.errorHandler.createError(o,s,l,i)},e.prototype.tolerateError=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var a=Array.prototype.slice.call(arguments,1),i=e.replace(/%(\d)/g,(function(e,t){return r.assert(t<a.length,"Message reference must be in range"),a[t]})),o=this.lastMarker.index,s=this.scanner.lineNumber,l=this.lastMarker.column+1;this.errorHandler.tolerateError(o,s,l,i)},e.prototype.unexpectedTokenError=function(e,t){var n,r=t||i.Messages.UnexpectedToken;if(e?(t||(r=2===e.type?i.Messages.UnexpectedEOS:3===e.type?i.Messages.UnexpectedIdentifier:6===e.type?i.Messages.UnexpectedNumber:8===e.type?i.Messages.UnexpectedString:10===e.type?i.Messages.UnexpectedTemplate:i.Messages.UnexpectedToken,4===e.type&&(this.scanner.isFutureReservedWord(e.value)?r=i.Messages.UnexpectedReserved:this.context.strict&&this.scanner.isStrictModeReservedWord(e.value)&&(r=i.Messages.StrictReservedWord))),n=e.value):n="ILLEGAL",r=r.replace("%0",n),e&&"number"==typeof e.lineNumber){var a=e.start,o=e.lineNumber,s=this.lastMarker.index-this.lastMarker.column,l=e.start-s+1;return this.errorHandler.createError(a,o,l,r)}return a=this.lastMarker.index,o=this.lastMarker.line,l=this.lastMarker.column+1,this.errorHandler.createError(a,o,l,r)},e.prototype.throwUnexpectedToken=function(e,t){throw this.unexpectedTokenError(e,t)},e.prototype.tolerateUnexpectedToken=function(e,t){this.errorHandler.tolerate(this.unexpectedTokenError(e,t))},e.prototype.collectComments=function(){if(this.config.comment){var e=this.scanner.scanComments();if(e.length>0&&this.delegate)for(var t=0;t<e.length;++t){var n=e[t],r=void 0;r={type:n.multiLine?"BlockComment":"LineComment",value:this.scanner.source.slice(n.slice[0],n.slice[1])},this.config.range&&(r.range=n.range),this.config.loc&&(r.loc=n.loc);var a={start:{line:n.loc.start.line,column:n.loc.start.column,offset:n.range[0]},end:{line:n.loc.end.line,column:n.loc.end.column,offset:n.range[1]}};this.delegate(r,a)}}else this.scanner.scanComments()},e.prototype.getTokenRaw=function(e){return this.scanner.source.slice(e.start,e.end)},e.prototype.convertToken=function(e){var t={type:p.TokenName[e.type],value:this.getTokenRaw(e)};if(this.config.range&&(t.range=[e.start,e.end]),this.config.loc&&(t.loc={start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}),9===e.type){var n=e.pattern,r=e.flags;t.regex={pattern:n,flags:r}}return t},e.prototype.nextToken=function(){var e=this.lookahead;this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.collectComments(),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart);var t=this.scanner.lex();return this.hasLineTerminator=e.lineNumber!==t.lineNumber,t&&this.context.strict&&3===t.type&&this.scanner.isStrictModeReservedWord(t.value)&&(t.type=4),this.lookahead=t,this.config.tokens&&2!==t.type&&this.tokens.push(this.convertToken(t)),e},e.prototype.nextRegexToken=function(){this.collectComments();var e=this.scanner.scanRegExp();return this.config.tokens&&(this.tokens.pop(),this.tokens.push(this.convertToken(e))),this.lookahead=e,this.nextToken(),e},e.prototype.createNode=function(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}},e.prototype.startNode=function(e,t){void 0===t&&(t=0);var n=e.start-e.lineStart,r=e.lineNumber;return n<0&&(n+=t,r--),{index:e.start,line:r,column:n}},e.prototype.finalize=function(e,t){if(this.config.range&&(t.range=[e.index,this.lastMarker.index]),this.config.loc&&(t.loc={start:{line:e.line,column:e.column},end:{line:this.lastMarker.line,column:this.lastMarker.column}},this.config.source&&(t.loc.source=this.config.source)),this.delegate){var n={start:{line:e.line,column:e.column,offset:e.index},end:{line:this.lastMarker.line,column:this.lastMarker.column,offset:this.lastMarker.index}};this.delegate(t,n)}return t},e.prototype.expect=function(e){var t=this.nextToken();7===t.type&&t.value===e||this.throwUnexpectedToken(t)},e.prototype.expectCommaSeparator=function(){if(this.config.tolerant){var e=this.lookahead;7===e.type&&","===e.value?this.nextToken():7===e.type&&";"===e.value?(this.nextToken(),this.tolerateUnexpectedToken(e)):this.tolerateUnexpectedToken(e,i.Messages.UnexpectedToken)}else this.expect(",")},e.prototype.expectKeyword=function(e){var t=this.nextToken();4===t.type&&t.value===e||this.throwUnexpectedToken(t)},e.prototype.match=function(e){return 7===this.lookahead.type&&this.lookahead.value===e},e.prototype.matchKeyword=function(e){return 4===this.lookahead.type&&this.lookahead.value===e},e.prototype.matchContextualKeyword=function(e){return 3===this.lookahead.type&&this.lookahead.value===e},e.prototype.matchAssign=function(){if(7!==this.lookahead.type)return!1;var e=this.lookahead.value;return"="===e||"*="===e||"**="===e||"/="===e||"%="===e||"+="===e||"-="===e||"<<="===e||">>="===e||">>>="===e||"&="===e||"^="===e||"|="===e},e.prototype.isolateCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,r=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var a=e.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=t,this.context.isAssignmentTarget=n,this.context.firstCoverInitializedNameError=r,a},e.prototype.inheritCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,r=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var a=e.call(this);return this.context.isBindingElement=this.context.isBindingElement&&t,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,this.context.firstCoverInitializedNameError=r||this.context.firstCoverInitializedNameError,a},e.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(2===this.lookahead.type||this.match("}")||this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},e.prototype.parsePrimaryExpression=function(){var e,t,n,r=this.createNode();switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),e=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(r,new o.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,i.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new o.Literal(t.value,n));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new o.Literal("true"===t.value,n));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new o.Literal(null,n));break;case 10:e=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,e=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":e=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":e=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,t=this.nextRegexToken(),n=this.getTokenRaw(t),e=this.finalize(r,new o.RegexLiteral(t.regex,n,t.pattern,t.flags));break;default:e=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?e=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?e=this.finalize(r,new o.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?e=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),e=this.finalize(r,new o.ThisExpression)):e=this.matchKeyword("class")?this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:e=this.throwUnexpectedToken(this.nextToken())}return e},e.prototype.parseSpreadElement=function(){var e=this.createNode();this.expect("...");var t=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(e,new o.SpreadElement(t))},e.prototype.parseArrayInitializer=function(){var e=this.createNode(),t=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),t.push(null);else if(this.match("...")){var n=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),t.push(n)}else t.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(e,new o.ArrayExpression(t))},e.prototype.parsePropertyMethod=function(e){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var t=this.context.strict,n=this.context.allowStrictDirective;this.context.allowStrictDirective=e.simple;var r=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&e.firstRestricted&&this.tolerateUnexpectedToken(e.firstRestricted,e.message),this.context.strict&&e.stricted&&this.tolerateUnexpectedToken(e.stricted,e.message),this.context.strict=t,this.context.allowStrictDirective=n,r},e.prototype.parsePropertyMethodFunction=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters(),r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new o.FunctionExpression(null,n.params,r,!1))},e.prototype.parsePropertyMethodAsyncFunction=function(){var e=this.createNode(),t=this.context.allowYield,n=this.context.await;this.context.allowYield=!1,this.context.await=!0;var r=this.parseFormalParameters(),a=this.parsePropertyMethod(r);return this.context.allowYield=t,this.context.await=n,this.finalize(e,new o.AsyncFunctionExpression(null,r.params,a))},e.prototype.parseObjectPropertyKey=function(){var e,t=this.createNode(),n=this.nextToken();switch(n.type){case 8:case 6:this.context.strict&&n.octal&&this.tolerateUnexpectedToken(n,i.Messages.StrictOctalLiteral);var r=this.getTokenRaw(n);e=this.finalize(t,new o.Literal(n.value,r));break;case 3:case 1:case 5:case 4:e=this.finalize(t,new o.Identifier(n.value));break;case 7:"["===n.value?(e=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):e=this.throwUnexpectedToken(n);break;default:e=this.throwUnexpectedToken(n)}return e},e.prototype.isPropertyKey=function(e,t){return e.type===l.Syntax.Identifier&&e.name===t||e.type===l.Syntax.Literal&&e.value===t},e.prototype.parseObjectProperty=function(e){var t,n=this.createNode(),r=this.lookahead,a=null,s=null,l=!1,p=!1,u=!1,m=!1;if(3===r.type){var c=r.value;this.nextToken(),l=this.match("["),a=(m=!(this.hasLineTerminator||"async"!==c||this.match(":")||this.match("(")||this.match("*")||this.match(",")))?this.parseObjectPropertyKey():this.finalize(n,new o.Identifier(c))}else this.match("*")?this.nextToken():(l=this.match("["),a=this.parseObjectPropertyKey());var h=this.qualifiedPropertyName(this.lookahead);if(3===r.type&&!m&&"get"===r.value&&h)t="get",l=this.match("["),a=this.parseObjectPropertyKey(),this.context.allowYield=!1,s=this.parseGetterMethod();else if(3===r.type&&!m&&"set"===r.value&&h)t="set",l=this.match("["),a=this.parseObjectPropertyKey(),s=this.parseSetterMethod();else if(7===r.type&&"*"===r.value&&h)t="init",l=this.match("["),a=this.parseObjectPropertyKey(),s=this.parseGeneratorMethod(),p=!0;else if(a||this.throwUnexpectedToken(this.lookahead),t="init",this.match(":")&&!m)!l&&this.isPropertyKey(a,"__proto__")&&(e.value&&this.tolerateError(i.Messages.DuplicateProtoProperty),e.value=!0),this.nextToken(),s=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))s=m?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),p=!0;else if(3===r.type)if(c=this.finalize(n,new o.Identifier(r.value)),this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),u=!0;var g=this.isolateCoverGrammar(this.parseAssignmentExpression);s=this.finalize(n,new o.AssignmentPattern(c,g))}else u=!0,s=c;else this.throwUnexpectedToken(this.nextToken());return this.finalize(n,new o.Property(t,a,l,s,p,u))},e.prototype.parseObjectInitializer=function(){var e=this.createNode();this.expect("{");for(var t=[],n={value:!1};!this.match("}");)t.push(this.parseObjectProperty(n)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(e,new o.ObjectExpression(t))},e.prototype.parseTemplateHead=function(){r.assert(this.lookahead.head,"Template literal must start with a template head");var e=this.createNode(),t=this.nextToken(),n=t.value,a=t.cooked;return this.finalize(e,new o.TemplateElement({raw:n,cooked:a},t.tail))},e.prototype.parseTemplateElement=function(){10!==this.lookahead.type&&this.throwUnexpectedToken();var e=this.createNode(),t=this.nextToken(),n=t.value,r=t.cooked;return this.finalize(e,new o.TemplateElement({raw:n,cooked:r},t.tail))},e.prototype.parseTemplateLiteral=function(){var e=this.createNode(),t=[],n=[],r=this.parseTemplateHead();for(n.push(r);!r.tail;)t.push(this.parseExpression()),r=this.parseTemplateElement(),n.push(r);return this.finalize(e,new o.TemplateLiteral(n,t))},e.prototype.reinterpretExpressionAsPattern=function(e){switch(e.type){case l.Syntax.Identifier:case l.Syntax.MemberExpression:case l.Syntax.RestElement:case l.Syntax.AssignmentPattern:break;case l.Syntax.SpreadElement:e.type=l.Syntax.RestElement,this.reinterpretExpressionAsPattern(e.argument);break;case l.Syntax.ArrayExpression:e.type=l.Syntax.ArrayPattern;for(var t=0;t<e.elements.length;t++)null!==e.elements[t]&&this.reinterpretExpressionAsPattern(e.elements[t]);break;case l.Syntax.ObjectExpression:for(e.type=l.Syntax.ObjectPattern,t=0;t<e.properties.length;t++)this.reinterpretExpressionAsPattern(e.properties[t].value);break;case l.Syntax.AssignmentExpression:e.type=l.Syntax.AssignmentPattern,delete e.operator,this.reinterpretExpressionAsPattern(e.left)}},e.prototype.parseGroupExpression=function(){var e;if(this.expect("("),this.match(")"))this.nextToken(),this.match("=>")||this.expect("=>"),e={type:u,params:[],async:!1};else{var t=this.lookahead,n=[];if(this.match("..."))e=this.parseRestElement(n),this.expect(")"),this.match("=>")||this.expect("=>"),e={type:u,params:[e],async:!1};else{var r=!1;if(this.context.isBindingElement=!0,e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var a=[];for(this.context.isAssignmentTarget=!1,a.push(e);2!==this.lookahead.type&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var i=0;i<a.length;i++)this.reinterpretExpressionAsPattern(a[i]);r=!0,e={type:u,params:a,async:!1}}else if(this.match("...")){for(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),a.push(this.parseRestElement(n)),this.expect(")"),this.match("=>")||this.expect("=>"),this.context.isBindingElement=!1,i=0;i<a.length;i++)this.reinterpretExpressionAsPattern(a[i]);r=!0,e={type:u,params:a,async:!1}}else a.push(this.inheritCoverGrammar(this.parseAssignmentExpression));if(r)break}r||(e=this.finalize(this.startNode(t),new o.SequenceExpression(a)))}if(!r){if(this.expect(")"),this.match("=>")&&(e.type===l.Syntax.Identifier&&"yield"===e.name&&(r=!0,e={type:u,params:[e],async:!1}),!r)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),e.type===l.Syntax.SequenceExpression)for(i=0;i<e.expressions.length;i++)this.reinterpretExpressionAsPattern(e.expressions[i]);else this.reinterpretExpressionAsPattern(e);var s=e.type===l.Syntax.SequenceExpression?e.expressions:[e];e={type:u,params:s,async:!1}}this.context.isBindingElement=!1}}}return e},e.prototype.parseArguments=function(){this.expect("(");var e=[];if(!this.match(")"))for(;;){var t=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAssignmentExpression);if(e.push(t),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),e},e.prototype.isIdentifierName=function(e){return 3===e.type||4===e.type||1===e.type||5===e.type},e.prototype.parseIdentifierName=function(){var e=this.createNode(),t=this.nextToken();return this.isIdentifierName(t)||this.throwUnexpectedToken(t),this.finalize(e,new o.Identifier(t.value))},e.prototype.parseNewExpression=function(){var e,t=this.createNode(),n=this.parseIdentifierName();if(r.assert("new"===n.name,"New expression must start with `new`"),this.match("."))if(this.nextToken(),3===this.lookahead.type&&this.context.inFunctionBody&&"target"===this.lookahead.value){var a=this.parseIdentifierName();e=new o.MetaProperty(n,a)}else this.throwUnexpectedToken(this.lookahead);else{var i=this.isolateCoverGrammar(this.parseLeftHandSideExpression),s=this.match("(")?this.parseArguments():[];e=new o.NewExpression(i,s),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return this.finalize(t,e)},e.prototype.parseAsyncArgument=function(){var e=this.parseAssignmentExpression();return this.context.firstCoverInitializedNameError=null,e},e.prototype.parseAsyncArguments=function(){this.expect("(");var e=[];if(!this.match(")"))for(;;){var t=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAsyncArgument);if(e.push(t),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),e},e.prototype.parseLeftHandSideExpressionAllowCall=function(){var e,t=this.lookahead,n=this.matchContextualKeyword("async"),r=this.context.allowIn;for(this.context.allowIn=!0,this.matchKeyword("super")&&this.context.inFunctionBody?(e=this.createNode(),this.nextToken(),e=this.finalize(e,new o.Super),this.match("(")||this.match(".")||this.match("[")||this.throwUnexpectedToken(this.lookahead)):e=this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var a=this.parseIdentifierName();e=this.finalize(this.startNode(t),new o.StaticMemberExpression(e,a))}else if(this.match("(")){var i=n&&t.lineNumber===this.lookahead.lineNumber;this.context.isBindingElement=!1,this.context.isAssignmentTarget=!1;var s=i?this.parseAsyncArguments():this.parseArguments();if(e=this.finalize(this.startNode(t),new o.CallExpression(e,s)),i&&this.match("=>")){for(var l=0;l<s.length;++l)this.reinterpretExpressionAsPattern(s[l]);e={type:u,params:s,async:!0}}}else if(this.match("["))this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("["),a=this.isolateCoverGrammar(this.parseExpression),this.expect("]"),e=this.finalize(this.startNode(t),new o.ComputedMemberExpression(e,a));else{if(10!==this.lookahead.type||!this.lookahead.head)break;var p=this.parseTemplateLiteral();e=this.finalize(this.startNode(t),new o.TaggedTemplateExpression(e,p))}return this.context.allowIn=r,e},e.prototype.parseSuper=function(){var e=this.createNode();return this.expectKeyword("super"),this.match("[")||this.match(".")||this.throwUnexpectedToken(this.lookahead),this.finalize(e,new o.Super)},e.prototype.parseLeftHandSideExpression=function(){r.assert(this.context.allowIn,"callee of new expression always allow in keyword.");for(var e=this.startNode(this.lookahead),t=this.matchKeyword("super")&&this.context.inFunctionBody?this.parseSuper():this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var n=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),t=this.finalize(e,new o.ComputedMemberExpression(t,n))}else if(this.match("."))this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("."),n=this.parseIdentifierName(),t=this.finalize(e,new o.StaticMemberExpression(t,n));else{if(10!==this.lookahead.type||!this.lookahead.head)break;var a=this.parseTemplateLiteral();t=this.finalize(e,new o.TaggedTemplateExpression(t,a))}return t},e.prototype.parseUpdateExpression=function(){var e,t=this.lookahead;if(this.match("++")||this.match("--")){var n=this.startNode(t),r=this.nextToken();e=this.inheritCoverGrammar(this.parseUnaryExpression),this.context.strict&&e.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(e.name)&&this.tolerateError(i.Messages.StrictLHSPrefix),this.context.isAssignmentTarget||this.tolerateError(i.Messages.InvalidLHSInAssignment);var a=!0;e=this.finalize(n,new o.UpdateExpression(r.value,e,a)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(e=this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall),!this.hasLineTerminator&&7===this.lookahead.type&&(this.match("++")||this.match("--"))){this.context.strict&&e.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(e.name)&&this.tolerateError(i.Messages.StrictLHSPostfix),this.context.isAssignmentTarget||this.tolerateError(i.Messages.InvalidLHSInAssignment),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var s=this.nextToken().value;a=!1,e=this.finalize(this.startNode(t),new o.UpdateExpression(s,e,a))}return e},e.prototype.parseAwaitExpression=function(){var e=this.createNode();this.nextToken();var t=this.parseUnaryExpression();return this.finalize(e,new o.AwaitExpression(t))},e.prototype.parseUnaryExpression=function(){var e;if(this.match("+")||this.match("-")||this.match("~")||this.match("!")||this.matchKeyword("delete")||this.matchKeyword("void")||this.matchKeyword("typeof")){var t=this.startNode(this.lookahead),n=this.nextToken();e=this.inheritCoverGrammar(this.parseUnaryExpression),e=this.finalize(t,new o.UnaryExpression(n.value,e)),this.context.strict&&"delete"===e.operator&&e.argument.type===l.Syntax.Identifier&&this.tolerateError(i.Messages.StrictDelete),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else e=this.context.await&&this.matchContextualKeyword("await")?this.parseAwaitExpression():this.parseUpdateExpression();return e},e.prototype.parseExponentiationExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseUnaryExpression);if(t.type!==l.Syntax.UnaryExpression&&this.match("**")){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var n=t,r=this.isolateCoverGrammar(this.parseExponentiationExpression);t=this.finalize(this.startNode(e),new o.BinaryExpression("**",n,r))}return t},e.prototype.binaryPrecedence=function(e){var t=e.value;return 7===e.type?this.operatorPrecedence[t]||0:4===e.type&&("instanceof"===t||this.context.allowIn&&"in"===t)?7:0},e.prototype.parseBinaryExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseExponentiationExpression),n=this.lookahead,r=this.binaryPrecedence(n);if(r>0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var a=[e,this.lookahead],i=t,s=this.isolateCoverGrammar(this.parseExponentiationExpression),l=[i,n.value,s],p=[r];!((r=this.binaryPrecedence(this.lookahead))<=0);){for(;l.length>2&&r<=p[p.length-1];){s=l.pop();var u=l.pop();p.pop(),i=l.pop(),a.pop();var m=this.startNode(a[a.length-1]);l.push(this.finalize(m,new o.BinaryExpression(u,i,s)))}l.push(this.nextToken().value),p.push(r),a.push(this.lookahead),l.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var c=l.length-1;t=l[c];for(var h=a.pop();c>1;){var g=a.pop(),T=h&&h.lineStart;m=this.startNode(g,T),u=l[c-1],t=this.finalize(m,new o.BinaryExpression(u,l[c-2],t)),c-=2,h=g}}return t},e.prototype.parseConditionalExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var n=this.context.allowIn;this.context.allowIn=!0;var r=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=n,this.expect(":");var a=this.isolateCoverGrammar(this.parseAssignmentExpression);t=this.finalize(this.startNode(e),new o.ConditionalExpression(t,r,a)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return t},e.prototype.checkPatternParam=function(e,t){switch(t.type){case l.Syntax.Identifier:this.validateParam(e,t,t.name);break;case l.Syntax.RestElement:this.checkPatternParam(e,t.argument);break;case l.Syntax.AssignmentPattern:this.checkPatternParam(e,t.left);break;case l.Syntax.ArrayPattern:for(var n=0;n<t.elements.length;n++)null!==t.elements[n]&&this.checkPatternParam(e,t.elements[n]);break;case l.Syntax.ObjectPattern:for(n=0;n<t.properties.length;n++)this.checkPatternParam(e,t.properties[n].value)}e.simple=e.simple&&t instanceof o.Identifier},e.prototype.reinterpretAsCoverFormalsList=function(e){var t,n=[e],r=!1;switch(e.type){case l.Syntax.Identifier:break;case u:n=e.params,r=e.async;break;default:return null}t={simple:!0,paramSet:{}};for(var a=0;a<n.length;++a)(o=n[a]).type===l.Syntax.AssignmentPattern?o.right.type===l.Syntax.YieldExpression&&(o.right.argument&&this.throwUnexpectedToken(this.lookahead),o.right.type=l.Syntax.Identifier,o.right.name="yield",delete o.right.argument,delete o.right.delegate):r&&o.type===l.Syntax.Identifier&&"await"===o.name&&this.throwUnexpectedToken(this.lookahead),this.checkPatternParam(t,o),n[a]=o;if(this.context.strict||!this.context.allowYield)for(a=0;a<n.length;++a){var o;(o=n[a]).type===l.Syntax.YieldExpression&&this.throwUnexpectedToken(this.lookahead)}if(t.message===i.Messages.StrictParamDupe){var s=this.context.strict?t.stricted:t.firstRestricted;this.throwUnexpectedToken(s,t.message)}return{simple:t.simple,params:n,stricted:t.stricted,firstRestricted:t.firstRestricted,message:t.message}},e.prototype.parseAssignmentExpression=function(){var e;if(!this.context.allowYield&&this.matchKeyword("yield"))e=this.parseYieldExpression();else{var t=this.lookahead,n=t;if(e=this.parseConditionalExpression(),3===n.type&&n.lineNumber===this.lookahead.lineNumber&&"async"===n.value&&(3===this.lookahead.type||this.matchKeyword("yield"))){var r=this.parsePrimaryExpression();this.reinterpretExpressionAsPattern(r),e={type:u,params:[r],async:!0}}if(e.type===u||this.match("=>")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var a=e.async,s=this.reinterpretAsCoverFormalsList(e);if(s){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var p=this.context.strict,m=this.context.allowStrictDirective;this.context.allowStrictDirective=s.simple;var c=this.context.allowYield,h=this.context.await;this.context.allowYield=!0,this.context.await=a;var g=this.startNode(t);this.expect("=>");var T=void 0;if(this.match("{")){var y=this.context.allowIn;this.context.allowIn=!0,T=this.parseFunctionSourceElements(),this.context.allowIn=y}else T=this.isolateCoverGrammar(this.parseAssignmentExpression);var d=T.type!==l.Syntax.BlockStatement;this.context.strict&&s.firstRestricted&&this.throwUnexpectedToken(s.firstRestricted,s.message),this.context.strict&&s.stricted&&this.tolerateUnexpectedToken(s.stricted,s.message),e=a?this.finalize(g,new o.AsyncArrowFunctionExpression(s.params,T,d)):this.finalize(g,new o.ArrowFunctionExpression(s.params,T,d)),this.context.strict=p,this.context.allowStrictDirective=m,this.context.allowYield=c,this.context.await=h}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(i.Messages.InvalidLHSInAssignment),this.context.strict&&e.type===l.Syntax.Identifier){var f=e;this.scanner.isRestrictedWord(f.name)&&this.tolerateUnexpectedToken(n,i.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(f.name)&&this.tolerateUnexpectedToken(n,i.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(e):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1);var S=(n=this.nextToken()).value,b=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new o.AssignmentExpression(S,e,b)),this.context.firstCoverInitializedNameError=null}}return e},e.prototype.parseExpression=function(){var e=this.lookahead,t=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var n=[];for(n.push(t);2!==this.lookahead.type&&this.match(",");)this.nextToken(),n.push(this.isolateCoverGrammar(this.parseAssignmentExpression));t=this.finalize(this.startNode(e),new o.SequenceExpression(n))}return t},e.prototype.parseStatementListItem=function(){var e;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,4===this.lookahead.type)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,i.Messages.IllegalExportDeclaration),e=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,i.Messages.IllegalImportDeclaration),e=this.parseImportDeclaration();break;case"const":e=this.parseLexicalDeclaration({inFor:!1});break;case"function":e=this.parseFunctionDeclaration();break;case"class":e=this.parseClassDeclaration();break;case"let":e=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:e=this.parseStatement()}else e=this.parseStatement();return e},e.prototype.parseBlock=function(){var e=this.createNode();this.expect("{");for(var t=[];!this.match("}");)t.push(this.parseStatementListItem());return this.expect("}"),this.finalize(e,new o.BlockStatement(t))},e.prototype.parseLexicalBinding=function(e,t){var n=this.createNode(),r=this.parsePattern([],e);this.context.strict&&r.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(r.name)&&this.tolerateError(i.Messages.StrictVarName);var a=null;return"const"===e?this.matchKeyword("in")||this.matchContextualKeyword("of")||(this.match("=")?(this.nextToken(),a=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(i.Messages.DeclarationMissingInitializer,"const")):(!t.inFor&&r.type!==l.Syntax.Identifier||this.match("="))&&(this.expect("="),a=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(n,new o.VariableDeclarator(r,a))},e.prototype.parseBindingList=function(e,t){for(var n=[this.parseLexicalBinding(e,t)];this.match(",");)this.nextToken(),n.push(this.parseLexicalBinding(e,t));return n},e.prototype.isLexicalDeclaration=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.scanner.lex();return this.scanner.restoreState(e),3===t.type||7===t.type&&"["===t.value||7===t.type&&"{"===t.value||4===t.type&&"let"===t.value||4===t.type&&"yield"===t.value},e.prototype.parseLexicalDeclaration=function(e){var t=this.createNode(),n=this.nextToken().value;r.assert("let"===n||"const"===n,"Lexical declaration must be either let or const");var a=this.parseBindingList(n,e);return this.consumeSemicolon(),this.finalize(t,new o.VariableDeclaration(a,n))},e.prototype.parseBindingRestElement=function(e,t){var n=this.createNode();this.expect("...");var r=this.parsePattern(e,t);return this.finalize(n,new o.RestElement(r))},e.prototype.parseArrayPattern=function(e,t){var n=this.createNode();this.expect("[");for(var r=[];!this.match("]");)if(this.match(","))this.nextToken(),r.push(null);else{if(this.match("...")){r.push(this.parseBindingRestElement(e,t));break}r.push(this.parsePatternWithDefault(e,t)),this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(n,new o.ArrayPattern(r))},e.prototype.parsePropertyPattern=function(e,t){var n,r,a=this.createNode(),i=!1,s=!1;if(3===this.lookahead.type){var l=this.lookahead;n=this.parseVariableIdentifier();var p=this.finalize(a,new o.Identifier(l.value));if(this.match("=")){e.push(l),s=!0,this.nextToken();var u=this.parseAssignmentExpression();r=this.finalize(this.startNode(l),new o.AssignmentPattern(p,u))}else this.match(":")?(this.expect(":"),r=this.parsePatternWithDefault(e,t)):(e.push(l),s=!0,r=p)}else i=this.match("["),n=this.parseObjectPropertyKey(),this.expect(":"),r=this.parsePatternWithDefault(e,t);return this.finalize(a,new o.Property("init",n,i,r,!1,s))},e.prototype.parseObjectPattern=function(e,t){var n=this.createNode(),r=[];for(this.expect("{");!this.match("}");)r.push(this.parsePropertyPattern(e,t)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(n,new o.ObjectPattern(r))},e.prototype.parsePattern=function(e,t){var n;return this.match("[")?n=this.parseArrayPattern(e,t):this.match("{")?n=this.parseObjectPattern(e,t):(!this.matchKeyword("let")||"const"!==t&&"let"!==t||this.tolerateUnexpectedToken(this.lookahead,i.Messages.LetInLexicalBinding),e.push(this.lookahead),n=this.parseVariableIdentifier(t)),n},e.prototype.parsePatternWithDefault=function(e,t){var n=this.lookahead,r=this.parsePattern(e,t);if(this.match("=")){this.nextToken();var a=this.context.allowYield;this.context.allowYield=!0;var i=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=a,r=this.finalize(this.startNode(n),new o.AssignmentPattern(r,i))}return r},e.prototype.parseVariableIdentifier=function(e){var t=this.createNode(),n=this.nextToken();return 4===n.type&&"yield"===n.value?this.context.strict?this.tolerateUnexpectedToken(n,i.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(n):3!==n.type?this.context.strict&&4===n.type&&this.scanner.isStrictModeReservedWord(n.value)?this.tolerateUnexpectedToken(n,i.Messages.StrictReservedWord):(this.context.strict||"let"!==n.value||"var"!==e)&&this.throwUnexpectedToken(n):(this.context.isModule||this.context.await)&&3===n.type&&"await"===n.value&&this.tolerateUnexpectedToken(n),this.finalize(t,new o.Identifier(n.value))},e.prototype.parseVariableDeclaration=function(e){var t=this.createNode(),n=this.parsePattern([],"var");this.context.strict&&n.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(i.Messages.StrictVarName);var r=null;return this.match("=")?(this.nextToken(),r=this.isolateCoverGrammar(this.parseAssignmentExpression)):n.type===l.Syntax.Identifier||e.inFor||this.expect("="),this.finalize(t,new o.VariableDeclarator(n,r))},e.prototype.parseVariableDeclarationList=function(e){var t={inFor:e.inFor},n=[];for(n.push(this.parseVariableDeclaration(t));this.match(",");)this.nextToken(),n.push(this.parseVariableDeclaration(t));return n},e.prototype.parseVariableStatement=function(){var e=this.createNode();this.expectKeyword("var");var t=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(e,new o.VariableDeclaration(t,"var"))},e.prototype.parseEmptyStatement=function(){var e=this.createNode();return this.expect(";"),this.finalize(e,new o.EmptyStatement)},e.prototype.parseExpressionStatement=function(){var e=this.createNode(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new o.ExpressionStatement(t))},e.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(i.Messages.StrictFunction),this.parseStatement()},e.prototype.parseIfStatement=function(){var e,t=this.createNode(),n=null;this.expectKeyword("if"),this.expect("(");var r=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),e=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),n=this.parseIfClause())),this.finalize(t,new o.IfStatement(r,e,n))},e.prototype.parseDoWhileStatement=function(){var e=this.createNode();this.expectKeyword("do");var t=this.context.inIteration;this.context.inIteration=!0;var n=this.parseStatement();this.context.inIteration=t,this.expectKeyword("while"),this.expect("(");var r=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(e,new o.DoWhileStatement(n,r))},e.prototype.parseWhileStatement=function(){var e,t=this.createNode();this.expectKeyword("while"),this.expect("(");var n=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var r=this.context.inIteration;this.context.inIteration=!0,e=this.parseStatement(),this.context.inIteration=r}return this.finalize(t,new o.WhileStatement(n,e))},e.prototype.parseForStatement=function(){var e,t,n,r=null,a=null,s=null,p=!0,u=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){r=this.createNode(),this.nextToken();var m=this.context.allowIn;this.context.allowIn=!1;var c=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=m,1===c.length&&this.matchKeyword("in")){var h=c[0];h.init&&(h.id.type===l.Syntax.ArrayPattern||h.id.type===l.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(i.Messages.ForInOfLoopInitializer,"for-in"),r=this.finalize(r,new o.VariableDeclaration(c,"var")),this.nextToken(),e=r,t=this.parseExpression(),r=null}else 1===c.length&&null===c[0].init&&this.matchContextualKeyword("of")?(r=this.finalize(r,new o.VariableDeclaration(c,"var")),this.nextToken(),e=r,t=this.parseAssignmentExpression(),r=null,p=!1):(r=this.finalize(r,new o.VariableDeclaration(c,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){r=this.createNode();var g=this.nextToken().value;this.context.strict||"in"!==this.lookahead.value?(m=this.context.allowIn,this.context.allowIn=!1,c=this.parseBindingList(g,{inFor:!0}),this.context.allowIn=m,1===c.length&&null===c[0].init&&this.matchKeyword("in")?(r=this.finalize(r,new o.VariableDeclaration(c,g)),this.nextToken(),e=r,t=this.parseExpression(),r=null):1===c.length&&null===c[0].init&&this.matchContextualKeyword("of")?(r=this.finalize(r,new o.VariableDeclaration(c,g)),this.nextToken(),e=r,t=this.parseAssignmentExpression(),r=null,p=!1):(this.consumeSemicolon(),r=this.finalize(r,new o.VariableDeclaration(c,g)))):(r=this.finalize(r,new o.Identifier(g)),this.nextToken(),e=r,t=this.parseExpression(),r=null)}else{var T=this.lookahead;if(m=this.context.allowIn,this.context.allowIn=!1,r=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=m,this.matchKeyword("in"))this.context.isAssignmentTarget&&r.type!==l.Syntax.AssignmentExpression||this.tolerateError(i.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(r),e=r,t=this.parseExpression(),r=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&r.type!==l.Syntax.AssignmentExpression||this.tolerateError(i.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(r),e=r,t=this.parseAssignmentExpression(),r=null,p=!1;else{if(this.match(",")){for(var y=[r];this.match(",");)this.nextToken(),y.push(this.isolateCoverGrammar(this.parseAssignmentExpression));r=this.finalize(this.startNode(T),new o.SequenceExpression(y))}this.expect(";")}}if(void 0===e&&(this.match(";")||(a=this.parseExpression()),this.expect(";"),this.match(")")||(s=this.parseExpression())),!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),n=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var d=this.context.inIteration;this.context.inIteration=!0,n=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=d}return void 0===e?this.finalize(u,new o.ForStatement(r,a,s,n)):p?this.finalize(u,new o.ForInStatement(e,t,n)):this.finalize(u,new o.ForOfStatement(e,t,n))},e.prototype.parseContinueStatement=function(){var e=this.createNode();this.expectKeyword("continue");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier();t=n;var r="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)||this.throwError(i.Messages.UnknownLabel,n.name)}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.throwError(i.Messages.IllegalContinue),this.finalize(e,new o.ContinueStatement(t))},e.prototype.parseBreakStatement=function(){var e=this.createNode();this.expectKeyword("break");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier(),r="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)||this.throwError(i.Messages.UnknownLabel,n.name),t=n}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.context.inSwitch||this.throwError(i.Messages.IllegalBreak),this.finalize(e,new o.BreakStatement(t))},e.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(i.Messages.IllegalReturn);var e=this.createNode();this.expectKeyword("return");var t=(this.match(";")||this.match("}")||this.hasLineTerminator||2===this.lookahead.type)&&8!==this.lookahead.type&&10!==this.lookahead.type?null:this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new o.ReturnStatement(t))},e.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(i.Messages.StrictModeWith);var e,t=this.createNode();this.expectKeyword("with"),this.expect("(");var n=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),e=this.parseStatement()),this.finalize(t,new o.WithStatement(n,e))},e.prototype.parseSwitchCase=function(){var e,t=this.createNode();this.matchKeyword("default")?(this.nextToken(),e=null):(this.expectKeyword("case"),e=this.parseExpression()),this.expect(":");for(var n=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)n.push(this.parseStatementListItem());return this.finalize(t,new o.SwitchCase(e,n))},e.prototype.parseSwitchStatement=function(){var e=this.createNode();this.expectKeyword("switch"),this.expect("(");var t=this.parseExpression();this.expect(")");var n=this.context.inSwitch;this.context.inSwitch=!0;var r=[],a=!1;for(this.expect("{");!this.match("}");){var s=this.parseSwitchCase();null===s.test&&(a&&this.throwError(i.Messages.MultipleDefaultsInSwitch),a=!0),r.push(s)}return this.expect("}"),this.context.inSwitch=n,this.finalize(e,new o.SwitchStatement(t,r))},e.prototype.parseLabelledStatement=function(){var e,t=this.createNode(),n=this.parseExpression();if(n.type===l.Syntax.Identifier&&this.match(":")){this.nextToken();var r=n,a="$"+r.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,a)&&this.throwError(i.Messages.Redeclaration,"Label",r.name),this.context.labelSet[a]=!0;var s=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),s=this.parseClassDeclaration();else if(this.matchKeyword("function")){var p=this.lookahead,u=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(p,i.Messages.StrictFunction):u.generator&&this.tolerateUnexpectedToken(p,i.Messages.GeneratorInLegacyContext),s=u}else s=this.parseStatement();delete this.context.labelSet[a],e=new o.LabeledStatement(r,s)}else this.consumeSemicolon(),e=new o.ExpressionStatement(n);return this.finalize(t,e)},e.prototype.parseThrowStatement=function(){var e=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(i.Messages.NewlineAfterThrow);var t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new o.ThrowStatement(t))},e.prototype.parseCatchClause=function(){var e=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var t=[],n=this.parsePattern(t),r={},a=0;a<t.length;a++){var s="$"+t[a].value;Object.prototype.hasOwnProperty.call(r,s)&&this.tolerateError(i.Messages.DuplicateBinding,t[a].value),r[s]=!0}this.context.strict&&n.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(i.Messages.StrictCatchVariable),this.expect(")");var p=this.parseBlock();return this.finalize(e,new o.CatchClause(n,p))},e.prototype.parseFinallyClause=function(){return this.expectKeyword("finally"),this.parseBlock()},e.prototype.parseTryStatement=function(){var e=this.createNode();this.expectKeyword("try");var t=this.parseBlock(),n=this.matchKeyword("catch")?this.parseCatchClause():null,r=this.matchKeyword("finally")?this.parseFinallyClause():null;return n||r||this.throwError(i.Messages.NoCatchOrFinally),this.finalize(e,new o.TryStatement(t,n,r))},e.prototype.parseDebuggerStatement=function(){var e=this.createNode();return this.expectKeyword("debugger"),this.consumeSemicolon(),this.finalize(e,new o.DebuggerStatement)},e.prototype.parseStatement=function(){var e;switch(this.lookahead.type){case 1:case 5:case 6:case 8:case 10:case 9:e=this.parseExpressionStatement();break;case 7:var t=this.lookahead.value;e="{"===t?this.parseBlock():"("===t?this.parseExpressionStatement():";"===t?this.parseEmptyStatement():this.parseExpressionStatement();break;case 3:e=this.matchAsyncFunction()?this.parseFunctionDeclaration():this.parseLabelledStatement();break;case 4:switch(this.lookahead.value){case"break":e=this.parseBreakStatement();break;case"continue":e=this.parseContinueStatement();break;case"debugger":e=this.parseDebuggerStatement();break;case"do":e=this.parseDoWhileStatement();break;case"for":e=this.parseForStatement();break;case"function":e=this.parseFunctionDeclaration();break;case"if":e=this.parseIfStatement();break;case"return":e=this.parseReturnStatement();break;case"switch":e=this.parseSwitchStatement();break;case"throw":e=this.parseThrowStatement();break;case"try":e=this.parseTryStatement();break;case"var":e=this.parseVariableStatement();break;case"while":e=this.parseWhileStatement();break;case"with":e=this.parseWithStatement();break;default:e=this.parseExpressionStatement()}break;default:e=this.throwUnexpectedToken(this.lookahead)}return e},e.prototype.parseFunctionSourceElements=function(){var e=this.createNode();this.expect("{");var t=this.parseDirectivePrologues(),n=this.context.labelSet,r=this.context.inIteration,a=this.context.inSwitch,i=this.context.inFunctionBody;for(this.context.labelSet={},this.context.inIteration=!1,this.context.inSwitch=!1,this.context.inFunctionBody=!0;2!==this.lookahead.type&&!this.match("}");)t.push(this.parseStatementListItem());return this.expect("}"),this.context.labelSet=n,this.context.inIteration=r,this.context.inSwitch=a,this.context.inFunctionBody=i,this.finalize(e,new o.BlockStatement(t))},e.prototype.validateParam=function(e,t,n){var r="$"+n;this.context.strict?(this.scanner.isRestrictedWord(n)&&(e.stricted=t,e.message=i.Messages.StrictParamName),Object.prototype.hasOwnProperty.call(e.paramSet,r)&&(e.stricted=t,e.message=i.Messages.StrictParamDupe)):e.firstRestricted||(this.scanner.isRestrictedWord(n)?(e.firstRestricted=t,e.message=i.Messages.StrictParamName):this.scanner.isStrictModeReservedWord(n)?(e.firstRestricted=t,e.message=i.Messages.StrictReservedWord):Object.prototype.hasOwnProperty.call(e.paramSet,r)&&(e.stricted=t,e.message=i.Messages.StrictParamDupe)),"function"==typeof Object.defineProperty?Object.defineProperty(e.paramSet,r,{value:!0,enumerable:!0,writable:!0,configurable:!0}):e.paramSet[r]=!0},e.prototype.parseRestElement=function(e){var t=this.createNode();this.expect("...");var n=this.parsePattern(e);return this.match("=")&&this.throwError(i.Messages.DefaultRestParameter),this.match(")")||this.throwError(i.Messages.ParameterAfterRestParameter),this.finalize(t,new o.RestElement(n))},e.prototype.parseFormalParameter=function(e){for(var t=[],n=this.match("...")?this.parseRestElement(t):this.parsePatternWithDefault(t),r=0;r<t.length;r++)this.validateParam(e,t[r],t[r].value);e.simple=e.simple&&n instanceof o.Identifier,e.params.push(n)},e.prototype.parseFormalParameters=function(e){var t;if(t={simple:!0,params:[],firstRestricted:e},this.expect("("),!this.match(")"))for(t.paramSet={};2!==this.lookahead.type&&(this.parseFormalParameter(t),!this.match(")"))&&(this.expect(","),!this.match(")")););return this.expect(")"),{simple:t.simple,params:t.params,stricted:t.stricted,firstRestricted:t.firstRestricted,message:t.message}},e.prototype.matchAsyncFunction=function(){var e=this.matchContextualKeyword("async");if(e){var t=this.scanner.saveState();this.scanner.scanComments();var n=this.scanner.lex();this.scanner.restoreState(t),e=t.lineNumber===n.lineNumber&&4===n.type&&"function"===n.value}return e},e.prototype.parseFunctionDeclaration=function(e){var t=this.createNode(),n=this.matchContextualKeyword("async");n&&this.nextToken(),this.expectKeyword("function");var r,a=!n&&this.match("*");a&&this.nextToken();var s=null,l=null;if(!e||!this.match("(")){var p=this.lookahead;s=this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(p.value)&&this.tolerateUnexpectedToken(p,i.Messages.StrictFunctionName):this.scanner.isRestrictedWord(p.value)?(l=p,r=i.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(p.value)&&(l=p,r=i.Messages.StrictReservedWord)}var u=this.context.await,m=this.context.allowYield;this.context.await=n,this.context.allowYield=!a;var c=this.parseFormalParameters(l),h=c.params,g=c.stricted;l=c.firstRestricted,c.message&&(r=c.message);var T=this.context.strict,y=this.context.allowStrictDirective;this.context.allowStrictDirective=c.simple;var d=this.parseFunctionSourceElements();return this.context.strict&&l&&this.throwUnexpectedToken(l,r),this.context.strict&&g&&this.tolerateUnexpectedToken(g,r),this.context.strict=T,this.context.allowStrictDirective=y,this.context.await=u,this.context.allowYield=m,n?this.finalize(t,new o.AsyncFunctionDeclaration(s,h,d)):this.finalize(t,new o.FunctionDeclaration(s,h,d,a))},e.prototype.parseFunctionExpression=function(){var e=this.createNode(),t=this.matchContextualKeyword("async");t&&this.nextToken(),this.expectKeyword("function");var n,r=!t&&this.match("*");r&&this.nextToken();var a,s=null,l=this.context.await,p=this.context.allowYield;if(this.context.await=t,this.context.allowYield=!r,!this.match("(")){var u=this.lookahead;s=this.context.strict||r||!this.matchKeyword("yield")?this.parseVariableIdentifier():this.parseIdentifierName(),this.context.strict?this.scanner.isRestrictedWord(u.value)&&this.tolerateUnexpectedToken(u,i.Messages.StrictFunctionName):this.scanner.isRestrictedWord(u.value)?(a=u,n=i.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(u.value)&&(a=u,n=i.Messages.StrictReservedWord)}var m=this.parseFormalParameters(a),c=m.params,h=m.stricted;a=m.firstRestricted,m.message&&(n=m.message);var g=this.context.strict,T=this.context.allowStrictDirective;this.context.allowStrictDirective=m.simple;var y=this.parseFunctionSourceElements();return this.context.strict&&a&&this.throwUnexpectedToken(a,n),this.context.strict&&h&&this.tolerateUnexpectedToken(h,n),this.context.strict=g,this.context.allowStrictDirective=T,this.context.await=l,this.context.allowYield=p,t?this.finalize(e,new o.AsyncFunctionExpression(s,c,y)):this.finalize(e,new o.FunctionExpression(s,c,y,r))},e.prototype.parseDirective=function(){var e=this.lookahead,t=this.createNode(),n=this.parseExpression(),r=n.type===l.Syntax.Literal?this.getTokenRaw(e).slice(1,-1):null;return this.consumeSemicolon(),this.finalize(t,r?new o.Directive(n,r):new o.ExpressionStatement(n))},e.prototype.parseDirectivePrologues=function(){for(var e=null,t=[];;){var n=this.lookahead;if(8!==n.type)break;var r=this.parseDirective();t.push(r);var a=r.directive;if("string"!=typeof a)break;"use strict"===a?(this.context.strict=!0,e&&this.tolerateUnexpectedToken(e,i.Messages.StrictOctalLiteral),this.context.allowStrictDirective||this.tolerateUnexpectedToken(n,i.Messages.IllegalLanguageModeDirective)):!e&&n.octal&&(e=n)}return t},e.prototype.qualifiedPropertyName=function(e){switch(e.type){case 3:case 8:case 1:case 5:case 6:case 4:return!0;case 7:return"["===e.value}return!1},e.prototype.parseGetterMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();n.params.length>0&&this.tolerateError(i.Messages.BadGetterArity);var r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new o.FunctionExpression(null,n.params,r,!1))},e.prototype.parseSetterMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();1!==n.params.length?this.tolerateError(i.Messages.BadSetterArity):n.params[0]instanceof o.RestElement&&this.tolerateError(i.Messages.BadSetterRestParameter);var r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new o.FunctionExpression(null,n.params,r,!1))},e.prototype.parseGeneratorMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();this.context.allowYield=!1;var r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new o.FunctionExpression(null,n.params,r,!0))},e.prototype.isStartOfExpression=function(){var e=!0,t=this.lookahead.value;switch(this.lookahead.type){case 7:e="["===t||"("===t||"{"===t||"+"===t||"-"===t||"!"===t||"~"===t||"++"===t||"--"===t||"/"===t||"/="===t;break;case 4:e="class"===t||"delete"===t||"function"===t||"let"===t||"new"===t||"super"===t||"this"===t||"typeof"===t||"void"===t||"yield"===t}return e},e.prototype.parseYieldExpression=function(){var e=this.createNode();this.expectKeyword("yield");var t=null,n=!1;if(!this.hasLineTerminator){var r=this.context.allowYield;this.context.allowYield=!1,(n=this.match("*"))?(this.nextToken(),t=this.parseAssignmentExpression()):this.isStartOfExpression()&&(t=this.parseAssignmentExpression()),this.context.allowYield=r}return this.finalize(e,new o.YieldExpression(t,n))},e.prototype.parseClassElement=function(e){var t=this.lookahead,n=this.createNode(),r="",a=null,s=null,l=!1,p=!1,u=!1,m=!1;if(this.match("*"))this.nextToken();else if(l=this.match("["),"static"===(a=this.parseObjectPropertyKey()).name&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(t=this.lookahead,u=!0,l=this.match("["),this.match("*")?this.nextToken():a=this.parseObjectPropertyKey()),3===t.type&&!this.hasLineTerminator&&"async"===t.value){var c=this.lookahead.value;":"!==c&&"("!==c&&"*"!==c&&(m=!0,t=this.lookahead,a=this.parseObjectPropertyKey(),3===t.type&&"constructor"===t.value&&this.tolerateUnexpectedToken(t,i.Messages.ConstructorIsAsync))}var h=this.qualifiedPropertyName(this.lookahead);return 3===t.type?"get"===t.value&&h?(r="get",l=this.match("["),a=this.parseObjectPropertyKey(),this.context.allowYield=!1,s=this.parseGetterMethod()):"set"===t.value&&h&&(r="set",l=this.match("["),a=this.parseObjectPropertyKey(),s=this.parseSetterMethod()):7===t.type&&"*"===t.value&&h&&(r="init",l=this.match("["),a=this.parseObjectPropertyKey(),s=this.parseGeneratorMethod(),p=!0),!r&&a&&this.match("(")&&(r="init",s=m?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),p=!0),r||this.throwUnexpectedToken(this.lookahead),"init"===r&&(r="method"),l||(u&&this.isPropertyKey(a,"prototype")&&this.throwUnexpectedToken(t,i.Messages.StaticPrototype),!u&&this.isPropertyKey(a,"constructor")&&(("method"!==r||!p||s&&s.generator)&&this.throwUnexpectedToken(t,i.Messages.ConstructorSpecialMethod),e.value?this.throwUnexpectedToken(t,i.Messages.DuplicateConstructor):e.value=!0,r="constructor")),this.finalize(n,new o.MethodDefinition(a,l,s,r,u))},e.prototype.parseClassElementList=function(){var e=[],t={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():e.push(this.parseClassElement(t));return this.expect("}"),e},e.prototype.parseClassBody=function(){var e=this.createNode(),t=this.parseClassElementList();return this.finalize(e,new o.ClassBody(t))},e.prototype.parseClassDeclaration=function(e){var t=this.createNode(),n=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var r=e&&3!==this.lookahead.type?null:this.parseVariableIdentifier(),a=null;this.matchKeyword("extends")&&(this.nextToken(),a=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var i=this.parseClassBody();return this.context.strict=n,this.finalize(t,new o.ClassDeclaration(r,a,i))},e.prototype.parseClassExpression=function(){var e=this.createNode(),t=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var n=3===this.lookahead.type?this.parseVariableIdentifier():null,r=null;this.matchKeyword("extends")&&(this.nextToken(),r=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var a=this.parseClassBody();return this.context.strict=t,this.finalize(e,new o.ClassExpression(n,r,a))},e.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;for(var e=this.createNode(),t=this.parseDirectivePrologues();2!==this.lookahead.type;)t.push(this.parseStatementListItem());return this.finalize(e,new o.Module(t))},e.prototype.parseScript=function(){for(var e=this.createNode(),t=this.parseDirectivePrologues();2!==this.lookahead.type;)t.push(this.parseStatementListItem());return this.finalize(e,new o.Script(t))},e.prototype.parseModuleSpecifier=function(){var e=this.createNode();8!==this.lookahead.type&&this.throwError(i.Messages.InvalidModuleSpecifier);var t=this.nextToken(),n=this.getTokenRaw(t);return this.finalize(e,new o.Literal(t.value,n))},e.prototype.parseImportSpecifier=function(){var e,t,n=this.createNode();return 3===this.lookahead.type?(t=e=this.parseVariableIdentifier(),this.matchContextualKeyword("as")&&(this.nextToken(),t=this.parseVariableIdentifier())):(t=e=this.parseIdentifierName(),this.matchContextualKeyword("as")?(this.nextToken(),t=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(n,new o.ImportSpecifier(t,e))},e.prototype.parseNamedImports=function(){this.expect("{");for(var e=[];!this.match("}");)e.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),e},e.prototype.parseImportDefaultSpecifier=function(){var e=this.createNode(),t=this.parseIdentifierName();return this.finalize(e,new o.ImportDefaultSpecifier(t))},e.prototype.parseImportNamespaceSpecifier=function(){var e=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(i.Messages.NoAsAfterImportNamespace),this.nextToken();var t=this.parseIdentifierName();return this.finalize(e,new o.ImportNamespaceSpecifier(t))},e.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(i.Messages.IllegalImportDeclaration);var e,t=this.createNode();this.expectKeyword("import");var n=[];if(8===this.lookahead.type)e=this.parseModuleSpecifier();else{if(this.match("{")?n=n.concat(this.parseNamedImports()):this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(n.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.match("{")?n=n.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var r=this.lookahead.value?i.Messages.UnexpectedToken:i.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}this.nextToken(),e=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(t,new o.ImportDeclaration(n,e))},e.prototype.parseExportSpecifier=function(){var e=this.createNode(),t=this.parseIdentifierName(),n=t;return this.matchContextualKeyword("as")&&(this.nextToken(),n=this.parseIdentifierName()),this.finalize(e,new o.ExportSpecifier(t,n))},e.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(i.Messages.IllegalExportDeclaration);var e,t=this.createNode();if(this.expectKeyword("export"),this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var n=this.parseFunctionDeclaration(!0);e=this.finalize(t,new o.ExportDefaultDeclaration(n))}else this.matchKeyword("class")?(n=this.parseClassDeclaration(!0),e=this.finalize(t,new o.ExportDefaultDeclaration(n))):this.matchContextualKeyword("async")?(n=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression(),e=this.finalize(t,new o.ExportDefaultDeclaration(n))):(this.matchContextualKeyword("from")&&this.throwError(i.Messages.UnexpectedToken,this.lookahead.value),n=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression(),this.consumeSemicolon(),e=this.finalize(t,new o.ExportDefaultDeclaration(n)));else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var r=this.lookahead.value?i.Messages.UnexpectedToken:i.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}this.nextToken();var a=this.parseModuleSpecifier();this.consumeSemicolon(),e=this.finalize(t,new o.ExportAllDeclaration(a))}else if(4===this.lookahead.type){switch(n=void 0,this.lookahead.value){case"let":case"const":n=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":n=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}e=this.finalize(t,new o.ExportNamedDeclaration(n,[],null))}else if(this.matchAsyncFunction())n=this.parseFunctionDeclaration(),e=this.finalize(t,new o.ExportNamedDeclaration(n,[],null));else{var s=[],l=null,p=!1;for(this.expect("{");!this.match("}");)p=p||this.matchKeyword("default"),s.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");this.expect("}"),this.matchContextualKeyword("from")?(this.nextToken(),l=this.parseModuleSpecifier(),this.consumeSemicolon()):p?(r=this.lookahead.value?i.Messages.UnexpectedToken:i.Messages.MissingFromClause,this.throwError(r,this.lookahead.value)):this.consumeSemicolon(),e=this.finalize(t,new o.ExportNamedDeclaration(null,s,l))}return e},e}();t.Parser=m},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assert=function(e,t){if(!e)throw new Error("ASSERT: "+t)}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this.errors=[],this.tolerant=!1}return e.prototype.recordError=function(e){this.errors.push(e)},e.prototype.tolerate=function(e){if(!this.tolerant)throw e;this.recordError(e)},e.prototype.constructError=function(e,t){var n=new Error(e);try{throw n}catch(e){Object.create&&Object.defineProperty&&(n=Object.create(e),Object.defineProperty(n,"column",{value:t}))}return n},e.prototype.createError=function(e,t,n,r){var a="Line "+t+": "+r,i=this.constructError(a,n);return i.index=e,i.lineNumber=t,i.description=r,i},e.prototype.throwError=function(e,t,n,r){throw this.createError(e,t,n,r)},e.prototype.tolerateError=function(e,t,n,r){var a=this.createError(e,t,n,r);if(!this.tolerant)throw a;this.recordError(a)},e}();t.ErrorHandler=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),a=n(4),i=n(11);function o(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function s(e){return"01234567".indexOf(e)}var l=function(){function e(e,t){this.source=e,this.errorHandler=t,this.trackComment=!1,this.isModule=!1,this.length=e.length,this.index=0,this.lineNumber=e.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return e.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},e.prototype.restoreState=function(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart},e.prototype.eof=function(){return this.index>=this.length},e.prototype.throwUnexpectedToken=function(e){return void 0===e&&(e=i.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.tolerateUnexpectedToken=function(e){void 0===e&&(e=i.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.skipSingleLineComment=function(e){var t,n,r=[];for(this.trackComment&&(r=[],t=this.index-e,n={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{}});!this.eof();){var i=this.source.charCodeAt(this.index);if(++this.index,a.Character.isLineTerminator(i)){if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart-1};var o={multiLine:!1,slice:[t+e,this.index-1],range:[t,this.index-1],loc:n};r.push(o)}return 13===i&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,r}}return this.trackComment&&(n.end={line:this.lineNumber,column:this.index-this.lineStart},o={multiLine:!1,slice:[t+e,this.index],range:[t,this.index],loc:n},r.push(o)),r},e.prototype.skipMultiLineComment=function(){var e,t,n=[];for(this.trackComment&&(n=[],e=this.index-2,t={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var r=this.source.charCodeAt(this.index);if(a.Character.isLineTerminator(r))13===r&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===r){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,this.trackComment){t.end={line:this.lineNumber,column:this.index-this.lineStart};var i={multiLine:!0,slice:[e+2,this.index-2],range:[e,this.index],loc:t};n.push(i)}return n}++this.index}else++this.index}return this.trackComment&&(t.end={line:this.lineNumber,column:this.index-this.lineStart},i={multiLine:!0,slice:[e+2,this.index],range:[e,this.index],loc:t},n.push(i)),this.tolerateUnexpectedToken(),n},e.prototype.scanComments=function(){var e;this.trackComment&&(e=[]);for(var t=0===this.index;!this.eof();){var n=this.source.charCodeAt(this.index);if(a.Character.isWhiteSpace(n))++this.index;else if(a.Character.isLineTerminator(n))++this.index,13===n&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t=!0;else if(47===n)if(47===(n=this.source.charCodeAt(this.index+1))){this.index+=2;var r=this.skipSingleLineComment(2);this.trackComment&&(e=e.concat(r)),t=!0}else{if(42!==n)break;this.index+=2,r=this.skipMultiLineComment(),this.trackComment&&(e=e.concat(r))}else if(t&&45===n){if(45!==this.source.charCodeAt(this.index+1)||62!==this.source.charCodeAt(this.index+2))break;this.index+=3,r=this.skipSingleLineComment(3),this.trackComment&&(e=e.concat(r))}else{if(60!==n||this.isModule)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;this.index+=4,r=this.skipSingleLineComment(4),this.trackComment&&(e=e.concat(r))}}return e},e.prototype.isFutureReservedWord=function(e){switch(e){case"enum":case"export":case"import":case"super":return!0;default:return!1}},e.prototype.isStrictModeReservedWord=function(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},e.prototype.isRestrictedWord=function(e){return"eval"===e||"arguments"===e},e.prototype.isKeyword=function(e){switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}},e.prototype.codePointAt=function(e){var t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){var n=this.source.charCodeAt(e+1);n>=56320&&n<=57343&&(t=1024*(t-55296)+n-56320+65536)}return t},e.prototype.scanHexEscape=function(e){for(var t="u"===e?4:2,n=0,r=0;r<t;++r){if(this.eof()||!a.Character.isHexDigit(this.source.charCodeAt(this.index)))return null;n=16*n+o(this.source[this.index++])}return String.fromCharCode(n)},e.prototype.scanUnicodeCodePointEscape=function(){var e=this.source[this.index],t=0;for("}"===e&&this.throwUnexpectedToken();!this.eof()&&(e=this.source[this.index++],a.Character.isHexDigit(e.charCodeAt(0)));)t=16*t+o(e);return(t>1114111||"}"!==e)&&this.throwUnexpectedToken(),a.Character.fromCodePoint(t)},e.prototype.getIdentifier=function(){for(var e=this.index++;!this.eof();){var t=this.source.charCodeAt(this.index);if(92===t)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!a.Character.isIdentifierPart(t))break;++this.index}return this.source.slice(e,this.index)},e.prototype.getComplexIdentifier=function(){var e,t=this.codePointAt(this.index),n=a.Character.fromCodePoint(t);for(this.index+=n.length,92===t&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,e=this.scanUnicodeCodePointEscape()):null!==(e=this.scanHexEscape("u"))&&"\\"!==e&&a.Character.isIdentifierStart(e.charCodeAt(0))||this.throwUnexpectedToken(),n=e);!this.eof()&&(t=this.codePointAt(this.index),a.Character.isIdentifierPart(t));)n+=e=a.Character.fromCodePoint(t),this.index+=e.length,92===t&&(n=n.substr(0,n.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,e=this.scanUnicodeCodePointEscape()):null!==(e=this.scanHexEscape("u"))&&"\\"!==e&&a.Character.isIdentifierPart(e.charCodeAt(0))||this.throwUnexpectedToken(),n+=e);return n},e.prototype.octalToDecimal=function(e){var t="0"!==e,n=s(e);return!this.eof()&&a.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,n=8*n+s(this.source[this.index++]),"0123".indexOf(e)>=0&&!this.eof()&&a.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+s(this.source[this.index++]))),{code:n,octal:t}},e.prototype.scanIdentifier=function(){var e,t=this.index,n=92===this.source.charCodeAt(t)?this.getComplexIdentifier():this.getIdentifier();if(3!=(e=1===n.length?3:this.isKeyword(n)?4:"null"===n?5:"true"===n||"false"===n?1:3)&&t+n.length!==this.index){var r=this.index;this.index=t,this.tolerateUnexpectedToken(i.Messages.InvalidEscapedReservedWord),this.index=r}return{type:e,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.scanPunctuator=function(){var e=this.index,t=this.source[this.index];switch(t){case"(":case"{":"{"===t&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,t="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:">>>="===(t=this.source.substr(this.index,4))?this.index+=4:"==="===(t=t.substr(0,3))||"!=="===t||">>>"===t||"<<="===t||">>="===t||"**="===t?this.index+=3:"&&"===(t=t.substr(0,2))||"||"===t||"=="===t||"!="===t||"+="===t||"-="===t||"*="===t||"/="===t||"++"===t||"--"===t||"<<"===t||">>"===t||"&="===t||"|="===t||"^="===t||"%="===t||"<="===t||">="===t||"=>"===t||"**"===t?this.index+=2:(t=this.source[this.index],"<>=!+-*%&|^/".indexOf(t)>=0&&++this.index)}return this.index===e&&this.throwUnexpectedToken(),{type:7,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanHexLiteral=function(e){for(var t="";!this.eof()&&a.Character.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),a.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+t,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanBinaryLiteral=function(e){for(var t,n="";!this.eof()&&("0"===(t=this.source[this.index])||"1"===t);)n+=this.source[this.index++];return 0===n.length&&this.throwUnexpectedToken(),this.eof()||(t=this.source.charCodeAt(this.index),(a.Character.isIdentifierStart(t)||a.Character.isDecimalDigit(t))&&this.throwUnexpectedToken()),{type:6,value:parseInt(n,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanOctalLiteral=function(e,t){var n="",r=!1;for(a.Character.isOctalDigit(e.charCodeAt(0))?(r=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&a.Character.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return r||0!==n.length||this.throwUnexpectedToken(),(a.Character.isIdentifierStart(this.source.charCodeAt(this.index))||a.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(n,8),octal:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.isImplicitOctalLiteral=function(){for(var e=this.index+1;e<this.length;++e){var t=this.source[e];if("8"===t||"9"===t)return!1;if(!a.Character.isOctalDigit(t.charCodeAt(0)))return!0}return!0},e.prototype.scanNumericLiteral=function(){var e=this.index,t=this.source[e];r.assert(a.Character.isDecimalDigit(t.charCodeAt(0))||"."===t,"Numeric literal must start with a decimal digit or a decimal point");var n="";if("."!==t){if(n=this.source[this.index++],t=this.source[this.index],"0"===n){if("x"===t||"X"===t)return++this.index,this.scanHexLiteral(e);if("b"===t||"B"===t)return++this.index,this.scanBinaryLiteral(e);if("o"===t||"O"===t)return this.scanOctalLiteral(t,e);if(t&&a.Character.isOctalDigit(t.charCodeAt(0))&&this.isImplicitOctalLiteral())return this.scanOctalLiteral(t,e)}for(;a.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];t=this.source[this.index]}if("."===t){for(n+=this.source[this.index++];a.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];t=this.source[this.index]}if("e"===t||"E"===t)if(n+=this.source[this.index++],"+"!==(t=this.source[this.index])&&"-"!==t||(n+=this.source[this.index++]),a.Character.isDecimalDigit(this.source.charCodeAt(this.index)))for(;a.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];else this.throwUnexpectedToken();return a.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseFloat(n),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanStringLiteral=function(){var e=this.index,t=this.source[e];r.assert("'"===t||'"'===t,"String literal must starts with a quote"),++this.index;for(var n=!1,o="";!this.eof();){var s=this.source[this.index++];if(s===t){t="";break}if("\\"===s)if((s=this.source[this.index++])&&a.Character.isLineTerminator(s.charCodeAt(0)))++this.lineNumber,"\r"===s&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;else switch(s){case"u":if("{"===this.source[this.index])++this.index,o+=this.scanUnicodeCodePointEscape();else{var l=this.scanHexEscape(s);null===l&&this.throwUnexpectedToken(),o+=l}break;case"x":var p=this.scanHexEscape(s);null===p&&this.throwUnexpectedToken(i.Messages.InvalidHexEscapeSequence),o+=p;break;case"n":o+="\n";break;case"r":o+="\r";break;case"t":o+="\t";break;case"b":o+="\b";break;case"f":o+="\f";break;case"v":o+="\v";break;case"8":case"9":o+=s,this.tolerateUnexpectedToken();break;default:if(s&&a.Character.isOctalDigit(s.charCodeAt(0))){var u=this.octalToDecimal(s);n=u.octal||n,o+=String.fromCharCode(u.code)}else o+=s}else{if(a.Character.isLineTerminator(s.charCodeAt(0)))break;o+=s}}return""!==t&&(this.index=e,this.throwUnexpectedToken()),{type:8,value:o,octal:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanTemplate=function(){var e="",t=!1,n=this.index,r="`"===this.source[n],o=!1,s=2;for(++this.index;!this.eof();){var l=this.source[this.index++];if("`"===l){s=1,o=!0,t=!0;break}if("$"===l){if("{"===this.source[this.index]){this.curlyStack.push("${"),++this.index,t=!0;break}e+=l}else if("\\"===l)if(l=this.source[this.index++],a.Character.isLineTerminator(l.charCodeAt(0)))++this.lineNumber,"\r"===l&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;else switch(l){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"u":if("{"===this.source[this.index])++this.index,e+=this.scanUnicodeCodePointEscape();else{var p=this.index,u=this.scanHexEscape(l);null!==u?e+=u:(this.index=p,e+=l)}break;case"x":var m=this.scanHexEscape(l);null===m&&this.throwUnexpectedToken(i.Messages.InvalidHexEscapeSequence),e+=m;break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:"0"===l?(a.Character.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(i.Messages.TemplateOctalLiteral),e+="\0"):a.Character.isOctalDigit(l.charCodeAt(0))?this.throwUnexpectedToken(i.Messages.TemplateOctalLiteral):e+=l}else a.Character.isLineTerminator(l.charCodeAt(0))?(++this.lineNumber,"\r"===l&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index,e+="\n"):e+=l}return t||this.throwUnexpectedToken(),r||this.curlyStack.pop(),{type:10,value:this.source.slice(n+1,this.index-s),cooked:e,head:r,tail:o,lineNumber:this.lineNumber,lineStart:this.lineStart,start:n,end:this.index}},e.prototype.testRegExp=function(e,t){var n=e,r=this;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,(function(e,t,n){var a=parseInt(t||n,16);return a>1114111&&r.throwUnexpectedToken(i.Messages.InvalidRegExp),a<=65535?String.fromCharCode(a):""})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,""));try{RegExp(n)}catch(e){this.throwUnexpectedToken(i.Messages.InvalidRegExp)}try{return new RegExp(e,t)}catch(e){return null}},e.prototype.scanRegExpBody=function(){var e=this.source[this.index];r.assert("/"===e,"Regular expression literal must start with a slash");for(var t=this.source[this.index++],n=!1,o=!1;!this.eof();)if(t+=e=this.source[this.index++],"\\"===e)e=this.source[this.index++],a.Character.isLineTerminator(e.charCodeAt(0))&&this.throwUnexpectedToken(i.Messages.UnterminatedRegExp),t+=e;else if(a.Character.isLineTerminator(e.charCodeAt(0)))this.throwUnexpectedToken(i.Messages.UnterminatedRegExp);else if(n)"]"===e&&(n=!1);else{if("/"===e){o=!0;break}"["===e&&(n=!0)}return o||this.throwUnexpectedToken(i.Messages.UnterminatedRegExp),t.substr(1,t.length-2)},e.prototype.scanRegExpFlags=function(){for(var e="";!this.eof();){var t=this.source[this.index];if(!a.Character.isIdentifierPart(t.charCodeAt(0)))break;if(++this.index,"\\"!==t||this.eof())e+=t;else if("u"===(t=this.source[this.index])){++this.index;var n=this.index,r=this.scanHexEscape("u");if(null!==r)for(e+=r;n<this.index;++n)this.source[n];else this.index=n,e+="u";this.tolerateUnexpectedToken()}else this.tolerateUnexpectedToken()}return e},e.prototype.scanRegExp=function(){var e=this.index,t=this.scanRegExpBody(),n=this.scanRegExpFlags();return{type:9,value:"",pattern:t,flags:n,regex:this.testRegExp(t,n),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.lex=function(){if(this.eof())return{type:2,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};var e=this.source.charCodeAt(this.index);return a.Character.isIdentifierStart(e)?this.scanIdentifier():40===e||41===e||59===e?this.scanPunctuator():39===e||34===e?this.scanStringLiteral():46===e?a.Character.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():a.Character.isDecimalDigit(e)?this.scanNumericLiteral():96===e||125===e&&"${"===this.curlyStack[this.curlyStack.length-1]?this.scanTemplate():e>=55296&&e<57343&&a.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},e}();t.Scanner=l},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenName={},t.TokenName[1]="Boolean",t.TokenName[2]="<end>",t.TokenName[3]="Identifier",t.TokenName[4]="Keyword",t.TokenName[5]="Null",t.TokenName[6]="Numeric",t.TokenName[7]="Punctuator",t.TokenName[8]="String",t.TokenName[9]="RegularExpression",t.TokenName[10]="Template"},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",lang:"⟨",rang:"⟩"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),a=n(12),i=n(13),o=function(){function e(){this.values=[],this.curly=this.paren=-1}return e.prototype.beforeFunctionExpression=function(e){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(e)>=0},e.prototype.isRegexStart=function(){var e=this.values[this.values.length-1],t=null!==e;switch(e){case"this":case"]":t=!1;break;case")":var n=this.values[this.paren-1];t="if"===n||"while"===n||"for"===n||"with"===n;break;case"}":if(t=!1,"function"===this.values[this.curly-3])t=!!(r=this.values[this.curly-4])&&!this.beforeFunctionExpression(r);else if("function"===this.values[this.curly-4]){var r;t=!(r=this.values[this.curly-5])||!this.beforeFunctionExpression(r)}}return t},e.prototype.push=function(e){7===e.type||4===e.type?("{"===e.value?this.curly=this.values.length:"("===e.value&&(this.paren=this.values.length),this.values.push(e.value)):this.values.push(null)},e}(),s=function(){function e(e,t){this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=!!t&&"boolean"==typeof t.tolerant&&t.tolerant,this.scanner=new a.Scanner(e,this.errorHandler),this.scanner.trackComment=!!t&&"boolean"==typeof t.comment&&t.comment,this.trackRange=!!t&&"boolean"==typeof t.range&&t.range,this.trackLoc=!!t&&"boolean"==typeof t.loc&&t.loc,this.buffer=[],this.reader=new o}return e.prototype.errors=function(){return this.errorHandler.errors},e.prototype.getNextToken=function(){if(0===this.buffer.length){var e=this.scanner.scanComments();if(this.scanner.trackComment)for(var t=0;t<e.length;++t){var n=e[t],r=this.scanner.source.slice(n.slice[0],n.slice[1]),a={type:n.multiLine?"BlockComment":"LineComment",value:r};this.trackRange&&(a.range=n.range),this.trackLoc&&(a.loc=n.loc),this.buffer.push(a)}if(!this.scanner.eof()){var o=void 0;this.trackLoc&&(o={start:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},end:{}});var s="/"===this.scanner.source[this.scanner.index]&&this.reader.isRegexStart()?this.scanner.scanRegExp():this.scanner.lex();this.reader.push(s);var l={type:i.TokenName[s.type],value:this.scanner.source.slice(s.start,s.end)};if(this.trackRange&&(l.range=[s.start,s.end]),this.trackLoc&&(o.end={line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},l.loc=o),9===s.type){var p=s.pattern,u=s.flags;l.regex={pattern:p,flags:u}}this.buffer.push(l)}}return this.buffer.shift()},e}();t.Tokenizer=s}])},e.exports=t()},5624:(e,t)=>{t.read=function(e,t,n,r,a){var i,o,s=8*a-r-1,l=(1<<s)-1,p=l>>1,u=-7,m=n?a-1:0,c=n?-1:1,h=e[t+m];for(m+=c,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=256*i+e[t+m],m+=c,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=r;u>0;o=256*o+e[t+m],m+=c,u-=8);if(0===i)i=1-p;else{if(i===l)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,r),i-=p}return(h?-1:1)*o*Math.pow(2,i-r)},t.write=function(e,t,n,r,a,i){var o,s,l,p=8*i-a-1,u=(1<<p)-1,m=u>>1,c=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,g=r?1:-1,T=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+m>=1?c/l:c*Math.pow(2,1-m))*l>=2&&(o++,l/=2),o+m>=u?(s=0,o=u):o+m>=1?(s=(t*l-1)*Math.pow(2,a),o+=m):(s=t*Math.pow(2,m-1)*Math.pow(2,a),o=0));a>=8;e[n+h]=255&s,h+=g,s/=256,a-=8);for(o=o<<a|s,p+=a;p>0;e[n+h]=255&o,h+=g,o/=256,p-=8);e[n+h-g]|=128*T}},5106:(__unused_webpack_module,exports)=>{var indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1},Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var n in e)t.push(n);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)},defineProp=function(){try{return Object.defineProperty({},"_",{}),function(e,t,n){Object.defineProperty(e,t,{writable:!0,enumerable:!1,configurable:!0,value:n})}}catch(e){return function(e,t,n){e[t]=n}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(e){if(!(this instanceof Script))return new Script(e);this.code=e};Script.prototype.runInContext=function(e){if(!(e instanceof Context))throw new TypeError("needs a 'context' argument.");var t=document.createElement("iframe");t.style||(t.style={}),t.style.display="none",document.body.appendChild(t);var n=t.contentWindow,r=n.eval,a=n.execScript;!r&&a&&(a.call(n,"null"),r=n.eval),forEach(Object_keys(e),(function(t){n[t]=e[t]})),forEach(globals,(function(t){e[t]&&(n[t]=e[t])}));var i=Object_keys(n),o=r.call(n,this.code);return forEach(Object_keys(n),(function(t){(t in e||-1===indexOf(i,t))&&(e[t]=n[t])})),forEach(globals,(function(t){t in e||defineProp(e,t,n[t])})),document.body.removeChild(t),o},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(e){var t=Script.createContext(e),n=this.runInContext(t);return e&&forEach(Object_keys(t),(function(n){e[n]=t[n]})),n},forEach(Object_keys(Script.prototype),(function(e){exports[e]=Script[e]=function(t){var n=Script(t);return n[e].apply(n,[].slice.call(arguments,1))}})),exports.isContext=function(e){return e instanceof Context},exports.createScript=function(e){return exports.Script(e)},exports.createContext=Script.createContext=function(e){var t=new Context;return"object"==typeof e&&forEach(Object_keys(e),(function(n){t[n]=e[n]})),t}},1671:(e,t,n)=>{"use strict";var r=n(9650);e.exports=r},9650:(e,t,n)=>{"use strict";var r=n(8238),a=n(2876);function i(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}e.exports.Type=n(6277),e.exports.Schema=n(2286),e.exports.FAILSAFE_SCHEMA=n(472),e.exports.JSON_SCHEMA=n(47),e.exports.CORE_SCHEMA=n(9314),e.exports.DEFAULT_SAFE_SCHEMA=n(7482),e.exports.DEFAULT_FULL_SCHEMA=n(3746),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.safeLoad=r.safeLoad,e.exports.safeLoadAll=r.safeLoadAll,e.exports.dump=a.dump,e.exports.safeDump=a.safeDump,e.exports.YAMLException=n(1440),e.exports.MINIMAL_SCHEMA=n(472),e.exports.SAFE_SCHEMA=n(7482),e.exports.DEFAULT_SCHEMA=n(3746),e.exports.scan=i("scan"),e.exports.parse=i("parse"),e.exports.compose=i("compose"),e.exports.addConstructor=i("addConstructor")},8936:e=>{"use strict";function t(e){return null==e}e.exports.isNothing=t,e.exports.isObject=function(e){return"object"==typeof e&&null!==e},e.exports.toArray=function(e){return Array.isArray(e)?e:t(e)?[]:[e]},e.exports.repeat=function(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r},e.exports.isNegativeZero=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},e.exports.extend=function(e,t){var n,r,a,i;if(t)for(n=0,r=(i=Object.keys(t)).length;n<r;n+=1)e[a=i[n]]=t[a];return e}},2876:(e,t,n)=>{"use strict";var r=n(8936),a=n(1440),i=n(3746),o=n(7482),s=Object.prototype.toString,l=Object.prototype.hasOwnProperty,p=9,u=10,m=13,c=32,h=33,g=34,T=35,y=37,d=38,f=39,S=42,b=44,x=45,A=58,L=61,E=62,I=63,D=64,v=91,_=93,C=96,O=123,B=124,j=125,N={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},w=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function R(e){var t,n,i;if(t=e.toString(16).toUpperCase(),e<=255)n="x",i=2;else if(e<=65535)n="u",i=4;else{if(!(e<=4294967295))throw new a("code point within a string may not be greater than 0xFFFFFFFF");n="U",i=8}return"\\"+n+r.repeat("0",i-t.length)+t}function F(e){this.schema=e.schema||i,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=r.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,r,a,i,o,s,p;if(null===t)return{};for(n={},a=0,i=(r=Object.keys(t)).length;a<i;a+=1)o=r[a],s=String(t[o]),"!!"===o.slice(0,2)&&(o="tag:yaml.org,2002:"+o.slice(2)),(p=e.compiledTypeMap.fallback[o])&&l.call(p.styleAliases,s)&&(s=p.styleAliases[s]),n[o]=s;return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function k(e,t){for(var n,a=r.repeat(" ",t),i=0,o=-1,s="",l=e.length;i<l;)-1===(o=e.indexOf("\n",i))?(n=e.slice(i),i=l):(n=e.slice(i,o+1),i=o+1),n.length&&"\n"!==n&&(s+=a),s+=n;return s}function $(e,t){return"\n"+r.repeat(" ",e.indent*t)}function P(e){return e===c||e===p}function M(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&65279!==e||65536<=e&&e<=1114111}function U(e,t){return M(e)&&65279!==e&&e!==b&&e!==v&&e!==_&&e!==O&&e!==j&&e!==A&&(e!==T||t&&function(e){return M(e)&&!P(e)&&65279!==e&&e!==m&&e!==u}(t))}function q(e){return/^\n* /.test(e)}var G=1,H=2,V=3,K=4,Y=5;function X(e,t,n,r){e.dump=function(){if(0===t.length)return"''";if(!e.noCompatMode&&-1!==w.indexOf(t))return"'"+t+"'";var i=e.indent*Math.max(1,n),o=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),s=r||e.flowLevel>-1&&n>=e.flowLevel;switch(function(e,t,n,r,a){var i,o,s,l,p=!1,m=!1,c=-1!==r,N=-1,w=M(l=e.charCodeAt(0))&&65279!==l&&!P(l)&&l!==x&&l!==I&&l!==A&&l!==b&&l!==v&&l!==_&&l!==O&&l!==j&&l!==T&&l!==d&&l!==S&&l!==h&&l!==B&&l!==L&&l!==E&&l!==f&&l!==g&&l!==y&&l!==D&&l!==C&&!P(e.charCodeAt(e.length-1));if(t)for(i=0;i<e.length;i++){if(!M(o=e.charCodeAt(i)))return Y;s=i>0?e.charCodeAt(i-1):null,w=w&&U(o,s)}else{for(i=0;i<e.length;i++){if((o=e.charCodeAt(i))===u)p=!0,c&&(m=m||i-N-1>r&&" "!==e[N+1],N=i);else if(!M(o))return Y;s=i>0?e.charCodeAt(i-1):null,w=w&&U(o,s)}m=m||c&&i-N-1>r&&" "!==e[N+1]}return p||m?n>9&&q(e)?Y:m?K:V:w&&!a(e)?G:H}(t,s,e.indent,o,(function(t){return function(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)}))){case G:return t;case H:return"'"+t.replace(/'/g,"''")+"'";case V:return"|"+z(t,e.indent)+W(k(t,i));case K:return">"+z(t,e.indent)+W(k(function(e,t){for(var n,r,a,i=/(\n+)([^\n]*)/g,o=(a=-1!==(a=e.indexOf("\n"))?a:e.length,i.lastIndex=a,J(e.slice(0,a),t)),s="\n"===e[0]||" "===e[0];r=i.exec(e);){var l=r[1],p=r[2];n=" "===p[0],o+=l+(s||n||""===p?"":"\n")+J(p,t),s=n}return o}(t,o),i));case Y:return'"'+function(e){for(var t,n,r,a="",i=0;i<e.length;i++)(t=e.charCodeAt(i))>=55296&&t<=56319&&(n=e.charCodeAt(i+1))>=56320&&n<=57343?(a+=R(1024*(t-55296)+n-56320+65536),i++):a+=!(r=N[t])&&M(t)?e[i]:r||R(t);return a}(t)+'"';default:throw new a("impossible error: invalid scalar style")}}()}function z(e,t){var n=q(e)?String(t):"",r="\n"===e[e.length-1];return n+(!r||"\n"!==e[e.length-2]&&"\n"!==e?r?"":"-":"+")+"\n"}function W(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function J(e,t){if(""===e||" "===e[0])return e;for(var n,r,a=/ [^ ]/g,i=0,o=0,s=0,l="";n=a.exec(e);)(s=n.index)-i>t&&(r=o>i?o:s,l+="\n"+e.slice(i,r),i=r+1),o=s;return l+="\n",e.length-i>t&&o>i?l+=e.slice(i,o)+"\n"+e.slice(o+1):l+=e.slice(i),l.slice(1)}function Z(e,t,n){var r,i,o,p,u,m;for(o=0,p=(i=n?e.explicitTypes:e.implicitTypes).length;o<p;o+=1)if(((u=i[o]).instanceOf||u.predicate)&&(!u.instanceOf||"object"==typeof t&&t instanceof u.instanceOf)&&(!u.predicate||u.predicate(t))){if(e.tag=n?u.tag:"?",u.represent){if(m=e.styleMap[u.tag]||u.defaultStyle,"[object Function]"===s.call(u.represent))r=u.represent(t,m);else{if(!l.call(u.represent,m))throw new a("!<"+u.tag+'> tag resolver accepts not "'+m+'" style');r=u.represent[m](t,m)}e.dump=r}return!0}return!1}function Q(e,t,n,r,i,o){e.tag=null,e.dump=n,Z(e,n,!1)||Z(e,n,!0);var l=s.call(e.dump);r&&(r=e.flowLevel<0||e.flowLevel>t);var p,m,c="[object Object]"===l||"[object Array]"===l;if(c&&(m=-1!==(p=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||m||2!==e.indent&&t>0)&&(i=!1),m&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(c&&m&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),"[object Object]"===l)r&&0!==Object.keys(e.dump).length?(function(e,t,n,r){var i,o,s,l,p,m,c="",h=e.tag,g=Object.keys(n);if(!0===e.sortKeys)g.sort();else if("function"==typeof e.sortKeys)g.sort(e.sortKeys);else if(e.sortKeys)throw new a("sortKeys must be a boolean or a function");for(i=0,o=g.length;i<o;i+=1)m="",r&&0===i||(m+=$(e,t)),l=n[s=g[i]],Q(e,t+1,s,!0,!0,!0)&&((p=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&u===e.dump.charCodeAt(0)?m+="?":m+="? "),m+=e.dump,p&&(m+=$(e,t)),Q(e,t+1,l,!0,p)&&(e.dump&&u===e.dump.charCodeAt(0)?m+=":":m+=": ",c+=m+=e.dump));e.tag=h,e.dump=c||"{}"}(e,t,e.dump,i),m&&(e.dump="&ref_"+p+e.dump)):(function(e,t,n){var r,a,i,o,s,l="",p=e.tag,u=Object.keys(n);for(r=0,a=u.length;r<a;r+=1)s="",0!==r&&(s+=", "),e.condenseFlow&&(s+='"'),o=n[i=u[r]],Q(e,t,i,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Q(e,t,o,!1,!1)&&(l+=s+=e.dump));e.tag=p,e.dump="{"+l+"}"}(e,t,e.dump),m&&(e.dump="&ref_"+p+" "+e.dump));else if("[object Array]"===l){var h=e.noArrayIndent&&t>0?t-1:t;r&&0!==e.dump.length?(function(e,t,n,r){var a,i,o="",s=e.tag;for(a=0,i=n.length;a<i;a+=1)Q(e,t+1,n[a],!0,!0)&&(r&&0===a||(o+=$(e,t)),e.dump&&u===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}(e,h,e.dump,i),m&&(e.dump="&ref_"+p+e.dump)):(function(e,t,n){var r,a,i="",o=e.tag;for(r=0,a=n.length;r<a;r+=1)Q(e,t,n[r],!1,!1)&&(0!==r&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}(e,h,e.dump),m&&(e.dump="&ref_"+p+" "+e.dump))}else{if("[object String]"!==l){if(e.skipInvalid)return!1;throw new a("unacceptable kind of an object to dump "+l)}"?"!==e.tag&&X(e,e.dump,t,o)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function ee(e,t){var n,r,a=[],i=[];for(te(e,a,i),n=0,r=i.length;n<r;n+=1)t.duplicates.push(a[i[n]]);t.usedDuplicates=new Array(r)}function te(e,t,n){var r,a,i;if(null!==e&&"object"==typeof e)if(-1!==(a=t.indexOf(e)))-1===n.indexOf(a)&&n.push(a);else if(t.push(e),Array.isArray(e))for(a=0,i=e.length;a<i;a+=1)te(e[a],t,n);else for(a=0,i=(r=Object.keys(e)).length;a<i;a+=1)te(e[r[a]],t,n)}function ne(e,t){var n=new F(t=t||{});return n.noRefs||ee(e,n),Q(n,0,e,!0,!0)?n.dump+"\n":""}e.exports.dump=ne,e.exports.safeDump=function(e,t){return ne(e,r.extend({schema:o},t))}},1440:e=>{"use strict";function t(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},e.exports=t},8238:(e,t,n)=>{"use strict";var r=n(8936),a=n(1440),i=n(7992),o=n(7482),s=n(3746),l=Object.prototype.hasOwnProperty,p=1,u=2,m=3,c=4,h=1,g=2,T=3,y=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,d=/[\x85\u2028\u2029]/,f=/[,\[\]\{\}]/,S=/^(?:!|!!|![a-z\-]+!)$/i,b=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function x(e){return Object.prototype.toString.call(e)}function A(e){return 10===e||13===e}function L(e){return 9===e||32===e}function E(e){return 9===e||32===e||10===e||13===e}function I(e){return 44===e||91===e||93===e||123===e||125===e}function D(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function v(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"
":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function _(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var C=new Array(256),O=new Array(256),B=0;B<256;B++)C[B]=v(B)?1:0,O[B]=v(B);function j(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||s,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function N(e,t){return new a(t,new i(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function w(e,t){throw N(e,t)}function R(e,t){e.onWarning&&e.onWarning.call(null,N(e,t))}var F={YAML:function(e,t,n){var r,a,i;null!==e.version&&w(e,"duplication of %YAML directive"),1!==n.length&&w(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&w(e,"ill-formed argument of the YAML directive"),a=parseInt(r[1],10),i=parseInt(r[2],10),1!==a&&w(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=i<2,1!==i&&2!==i&&R(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,a;2!==n.length&&w(e,"TAG directive accepts exactly two arguments"),r=n[0],a=n[1],S.test(r)||w(e,"ill-formed tag handle (first argument) of the TAG directive"),l.call(e.tagMap,r)&&w(e,'there is a previously declared suffix for "'+r+'" tag handle'),b.test(a)||w(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[r]=a}};function k(e,t,n,r){var a,i,o,s;if(t<n){if(s=e.input.slice(t,n),r)for(a=0,i=s.length;a<i;a+=1)9===(o=s.charCodeAt(a))||32<=o&&o<=1114111||w(e,"expected valid JSON character");else y.test(s)&&w(e,"the stream contains non-printable characters");e.result+=s}}function $(e,t,n,a){var i,o,s,p;for(r.isObject(n)||w(e,"cannot merge mappings; the provided source object is unacceptable"),s=0,p=(i=Object.keys(n)).length;s<p;s+=1)o=i[s],l.call(t,o)||(t[o]=n[o],a[o]=!0)}function P(e,t,n,r,a,i,o,s){var p,u;if(Array.isArray(a))for(p=0,u=(a=Array.prototype.slice.call(a)).length;p<u;p+=1)Array.isArray(a[p])&&w(e,"nested arrays are not supported inside keys"),"object"==typeof a&&"[object Object]"===x(a[p])&&(a[p]="[object Object]");if("object"==typeof a&&"[object Object]"===x(a)&&(a="[object Object]"),a=String(a),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(i))for(p=0,u=i.length;p<u;p+=1)$(e,t,i[p],n);else $(e,t,i,n);else e.json||l.call(n,a)||!l.call(t,a)||(e.line=o||e.line,e.position=s||e.position,w(e,"duplicated mapping key")),t[a]=i,delete n[a];return t}function M(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):w(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function U(e,t,n){for(var r=0,a=e.input.charCodeAt(e.position);0!==a;){for(;L(a);)a=e.input.charCodeAt(++e.position);if(t&&35===a)do{a=e.input.charCodeAt(++e.position)}while(10!==a&&13!==a&&0!==a);if(!A(a))break;for(M(e),a=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&R(e,"deficient indentation"),r}function q(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!E(t)))}function G(e,t){1===t?e.result+=" ":t>1&&(e.result+=r.repeat("\n",t-1))}function H(e,t){var n,r,a=e.tag,i=e.anchor,o=[],s=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),r=e.input.charCodeAt(e.position);0!==r&&45===r&&E(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,U(e,!0,-1)&&e.lineIndent<=t)o.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,Y(e,t,m,!1,!0),o.push(e.result),U(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)w(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!s&&(e.tag=a,e.anchor=i,e.kind="sequence",e.result=o,!0)}function V(e){var t,n,r,a,i=!1,o=!1;if(33!==(a=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&w(e,"duplication of a tag property"),60===(a=e.input.charCodeAt(++e.position))?(i=!0,a=e.input.charCodeAt(++e.position)):33===a?(o=!0,n="!!",a=e.input.charCodeAt(++e.position)):n="!",t=e.position,i){do{a=e.input.charCodeAt(++e.position)}while(0!==a&&62!==a);e.position<e.length?(r=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):w(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==a&&!E(a);)33===a&&(o?w(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),S.test(n)||w(e,"named tag handle cannot contain such characters"),o=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),f.test(r)&&w(e,"tag suffix cannot contain flow indicator characters")}return r&&!b.test(r)&&w(e,"tag name cannot contain such characters: "+r),i?e.tag=r:l.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:w(e,'undeclared tag handle "'+n+'"'),!0}function K(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&w(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!E(n)&&!I(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&w(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Y(e,t,n,a,i){var o,s,y,d,f,S,b,x,v=1,B=!1,j=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=s=y=c===n||m===n,a&&U(e,!0,-1)&&(B=!0,e.lineIndent>t?v=1:e.lineIndent===t?v=0:e.lineIndent<t&&(v=-1)),1===v)for(;V(e)||K(e);)U(e,!0,-1)?(B=!0,y=o,e.lineIndent>t?v=1:e.lineIndent===t?v=0:e.lineIndent<t&&(v=-1)):y=!1;if(y&&(y=B||i),1!==v&&c!==n||(b=p===n||u===n?t:t+1,x=e.position-e.lineStart,1===v?y&&(H(e,x)||function(e,t,n){var r,a,i,o,s,l=e.tag,p=e.anchor,m={},h={},g=null,T=null,y=null,d=!1,f=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=m),s=e.input.charCodeAt(e.position);0!==s;){if(r=e.input.charCodeAt(e.position+1),i=e.line,o=e.position,63!==s&&58!==s||!E(r)){if(!Y(e,n,u,!1,!0))break;if(e.line===i){for(s=e.input.charCodeAt(e.position);L(s);)s=e.input.charCodeAt(++e.position);if(58===s)E(s=e.input.charCodeAt(++e.position))||w(e,"a whitespace character is expected after the key-value separator within a block mapping"),d&&(P(e,m,h,g,T,null),g=T=y=null),f=!0,d=!1,a=!1,g=e.tag,T=e.result;else{if(!f)return e.tag=l,e.anchor=p,!0;w(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!f)return e.tag=l,e.anchor=p,!0;w(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===s?(d&&(P(e,m,h,g,T,null),g=T=y=null),f=!0,d=!0,a=!0):d?(d=!1,a=!0):w(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,s=r;if((e.line===i||e.lineIndent>t)&&(Y(e,t,c,!0,a)&&(d?T=e.result:y=e.result),d||(P(e,m,h,g,T,y,i,o),g=T=y=null),U(e,!0,-1),s=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==s)w(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return d&&P(e,m,h,g,T,null),f&&(e.tag=l,e.anchor=p,e.kind="mapping",e.result=m),f}(e,x,b))||function(e,t){var n,r,a,i,o,s,l,u,m,c,h=!0,g=e.tag,T=e.anchor,y={};if(91===(c=e.input.charCodeAt(e.position)))a=93,s=!1,r=[];else{if(123!==c)return!1;a=125,s=!0,r={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=r),c=e.input.charCodeAt(++e.position);0!==c;){if(U(e,!0,t),(c=e.input.charCodeAt(e.position))===a)return e.position++,e.tag=g,e.anchor=T,e.kind=s?"mapping":"sequence",e.result=r,!0;h||w(e,"missed comma between flow collection entries"),m=null,i=o=!1,63===c&&E(e.input.charCodeAt(e.position+1))&&(i=o=!0,e.position++,U(e,!0,t)),n=e.line,Y(e,t,p,!1,!0),u=e.tag,l=e.result,U(e,!0,t),c=e.input.charCodeAt(e.position),!o&&e.line!==n||58!==c||(i=!0,c=e.input.charCodeAt(++e.position),U(e,!0,t),Y(e,t,p,!1,!0),m=e.result),s?P(e,r,y,u,l,m):i?r.push(P(e,null,y,u,l,m)):r.push(l),U(e,!0,t),44===(c=e.input.charCodeAt(e.position))?(h=!0,c=e.input.charCodeAt(++e.position)):h=!1}w(e,"unexpected end of the stream within a flow collection")}(e,b)?j=!0:(s&&function(e,t){var n,a,i,o,s,l=h,p=!1,u=!1,m=t,c=0,y=!1;if(124===(o=e.input.charCodeAt(e.position)))a=!1;else{if(62!==o)return!1;a=!0}for(e.kind="scalar",e.result="";0!==o;)if(43===(o=e.input.charCodeAt(++e.position))||45===o)h===l?l=43===o?T:g:w(e,"repeat of a chomping mode identifier");else{if(!((i=48<=(s=o)&&s<=57?s-48:-1)>=0))break;0===i?w(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?w(e,"repeat of an indentation width identifier"):(m=t+i-1,u=!0)}if(L(o)){do{o=e.input.charCodeAt(++e.position)}while(L(o));if(35===o)do{o=e.input.charCodeAt(++e.position)}while(!A(o)&&0!==o)}for(;0!==o;){for(M(e),e.lineIndent=0,o=e.input.charCodeAt(e.position);(!u||e.lineIndent<m)&&32===o;)e.lineIndent++,o=e.input.charCodeAt(++e.position);if(!u&&e.lineIndent>m&&(m=e.lineIndent),A(o))c++;else{if(e.lineIndent<m){l===T?e.result+=r.repeat("\n",p?1+c:c):l===h&&p&&(e.result+="\n");break}for(a?L(o)?(y=!0,e.result+=r.repeat("\n",p?1+c:c)):y?(y=!1,e.result+=r.repeat("\n",c+1)):0===c?p&&(e.result+=" "):e.result+=r.repeat("\n",c):e.result+=r.repeat("\n",p?1+c:c),p=!0,u=!0,c=0,n=e.position;!A(o)&&0!==o;)o=e.input.charCodeAt(++e.position);k(e,n,e.position,!1)}}return!0}(e,b)||function(e,t){var n,r,a;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=a=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(k(e,r,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;r=e.position,e.position++,a=e.position}else A(n)?(k(e,r,a,!0),G(e,U(e,!1,t)),r=a=e.position):e.position===e.lineStart&&q(e)?w(e,"unexpected end of the document within a single quoted scalar"):(e.position++,a=e.position);w(e,"unexpected end of the stream within a single quoted scalar")}(e,b)||function(e,t){var n,r,a,i,o,s,l;if(34!==(s=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(s=e.input.charCodeAt(e.position));){if(34===s)return k(e,n,e.position,!0),e.position++,!0;if(92===s){if(k(e,n,e.position,!0),A(s=e.input.charCodeAt(++e.position)))U(e,!1,t);else if(s<256&&C[s])e.result+=O[s],e.position++;else if((o=120===(l=s)?2:117===l?4:85===l?8:0)>0){for(a=o,i=0;a>0;a--)(o=D(s=e.input.charCodeAt(++e.position)))>=0?i=(i<<4)+o:w(e,"expected hexadecimal character");e.result+=_(i),e.position++}else w(e,"unknown escape sequence");n=r=e.position}else A(s)?(k(e,n,r,!0),G(e,U(e,!1,t)),n=r=e.position):e.position===e.lineStart&&q(e)?w(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}w(e,"unexpected end of the stream within a double quoted scalar")}(e,b)?j=!0:function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!E(r)&&!I(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&w(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),l.call(e.anchorMap,n)||w(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],U(e,!0,-1),!0}(e)?(j=!0,null===e.tag&&null===e.anchor||w(e,"alias node should not have any properties")):function(e,t,n){var r,a,i,o,s,l,p,u,m=e.kind,c=e.result;if(E(u=e.input.charCodeAt(e.position))||I(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(E(r=e.input.charCodeAt(e.position+1))||n&&I(r)))return!1;for(e.kind="scalar",e.result="",a=i=e.position,o=!1;0!==u;){if(58===u){if(E(r=e.input.charCodeAt(e.position+1))||n&&I(r))break}else if(35===u){if(E(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&q(e)||n&&I(u))break;if(A(u)){if(s=e.line,l=e.lineStart,p=e.lineIndent,U(e,!1,-1),e.lineIndent>=t){o=!0,u=e.input.charCodeAt(e.position);continue}e.position=i,e.line=s,e.lineStart=l,e.lineIndent=p;break}}o&&(k(e,a,i,!1),G(e,e.line-s),a=i=e.position,o=!1),L(u)||(i=e.position+1),u=e.input.charCodeAt(++e.position)}return k(e,a,i,!1),!!e.result||(e.kind=m,e.result=c,!1)}(e,b,p===n)&&(j=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===v&&(j=y&&H(e,x))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&w(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),d=0,f=e.implicitTypes.length;d<f;d+=1)if((S=e.implicitTypes[d]).resolve(e.result)){e.result=S.construct(e.result),e.tag=S.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else l.call(e.typeMap[e.kind||"fallback"],e.tag)?(S=e.typeMap[e.kind||"fallback"][e.tag],null!==e.result&&S.kind!==e.kind&&w(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+S.kind+'", not "'+e.kind+'"'),S.resolve(e.result)?(e.result=S.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):w(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):w(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||j}function X(e){var t,n,r,a,i=e.position,o=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(a=e.input.charCodeAt(e.position))&&(U(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==a));){for(o=!0,a=e.input.charCodeAt(++e.position),t=e.position;0!==a&&!E(a);)a=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&w(e,"directive name must not be less than one character in length");0!==a;){for(;L(a);)a=e.input.charCodeAt(++e.position);if(35===a){do{a=e.input.charCodeAt(++e.position)}while(0!==a&&!A(a));break}if(A(a))break;for(t=e.position;0!==a&&!E(a);)a=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==a&&M(e),l.call(F,n)?F[n](e,n,r):R(e,'unknown document directive "'+n+'"')}U(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,U(e,!0,-1)):o&&w(e,"directives end mark is expected"),Y(e,e.lineIndent-1,c,!1,!0),U(e,!0,-1),e.checkLineBreaks&&d.test(e.input.slice(i,e.position))&&R(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&q(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,U(e,!0,-1)):e.position<e.length-1&&w(e,"end of the stream or a document separator is expected")}function z(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new j(e,t),r=e.indexOf("\0");for(-1!==r&&(n.position=r,w(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)X(n);return n.documents}function W(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var r=z(e,n);if("function"!=typeof t)return r;for(var a=0,i=r.length;a<i;a+=1)t(r[a])}function J(e,t){var n=z(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new a("expected a single document in the stream, but found more")}}e.exports.loadAll=W,e.exports.load=J,e.exports.safeLoadAll=function(e,t,n){return"object"==typeof t&&null!==t&&void 0===n&&(n=t,t=null),W(e,t,r.extend({schema:o},n))},e.exports.safeLoad=function(e,t){return J(e,r.extend({schema:o},t))}},7992:(e,t,n)=>{"use strict";var r=n(8936);function a(e,t,n,r,a){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=a}a.prototype.getSnippet=function(e,t){var n,a,i,o,s;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",a=this.position;a>0&&-1==="\0\r\n
\u2028\u2029".indexOf(this.buffer.charAt(a-1));)if(a-=1,this.position-a>t/2-1){n=" ... ",a+=5;break}for(i="",o=this.position;o<this.buffer.length&&-1==="\0\r\n
\u2028\u2029".indexOf(this.buffer.charAt(o));)if((o+=1)-this.position>t/2-1){i=" ... ",o-=5;break}return s=this.buffer.slice(a,o),r.repeat(" ",e)+n+s+i+"\n"+r.repeat(" ",e+this.position-a+n.length)+"^"},a.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(n+=":\n"+t),n},e.exports=a},2286:(e,t,n)=>{"use strict";var r=n(8936),a=n(1440),i=n(6277);function o(e,t,n){var r=[];return e.include.forEach((function(e){n=o(e,t,n)})),e[t].forEach((function(e){n.forEach((function(t,n){t.tag===e.tag&&t.kind===e.kind&&r.push(n)})),n.push(e)})),n.filter((function(e,t){return-1===r.indexOf(t)}))}function s(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach((function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new a("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")})),this.compiledImplicit=o(this,"implicit",[]),this.compiledExplicit=o(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function r(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}(this.compiledImplicit,this.compiledExplicit)}s.DEFAULT=null,s.create=function(){var e,t;switch(arguments.length){case 1:e=s.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new a("Wrong number of arguments for Schema.create function")}if(e=r.toArray(e),t=r.toArray(t),!e.every((function(e){return e instanceof s})))throw new a("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every((function(e){return e instanceof i})))throw new a("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new s({include:e,explicit:t})},e.exports=s},9314:(e,t,n)=>{"use strict";var r=n(2286);e.exports=new r({include:[n(47)]})},3746:(e,t,n)=>{"use strict";var r=n(2286);e.exports=r.DEFAULT=new r({include:[n(7482)],explicit:[n(7124),n(3027),n(6238)]})},7482:(e,t,n)=>{"use strict";var r=n(2286);e.exports=new r({include:[n(9314)],implicit:[n(1398),n(5222)],explicit:[n(5637),n(9801),n(4587),n(4342)]})},472:(e,t,n)=>{"use strict";var r=n(2286);e.exports=new r({explicit:[n(9737),n(9097),n(676)]})},47:(e,t,n)=>{"use strict";var r=n(2286);e.exports=new r({include:[n(472)],implicit:[n(1661),n(224),n(1903),n(1104)]})},6277:(e,t,n)=>{"use strict";var r=n(1440),a=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],i=["scalar","sequence","mapping"];e.exports=function(e,t){var n,o;if(t=t||{},Object.keys(t).forEach((function(t){if(-1===a.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=(n=t.styleAliases||null,o={},null!==n&&Object.keys(n).forEach((function(e){n[e].forEach((function(t){o[String(t)]=e}))})),o),-1===i.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},5637:(e,t,n)=>{"use strict";var r;try{r=n(5081).hp}catch(e){}var a=n(6277),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new a("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,a=e.length,o=i;for(n=0;n<a;n++)if(!((t=o.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,a=e.replace(/[\r\n=]/g,""),o=a.length,s=i,l=0,p=[];for(t=0;t<o;t++)t%4==0&&t&&(p.push(l>>16&255),p.push(l>>8&255),p.push(255&l)),l=l<<6|s.indexOf(a.charAt(t));return 0==(n=o%4*6)?(p.push(l>>16&255),p.push(l>>8&255),p.push(255&l)):18===n?(p.push(l>>10&255),p.push(l>>2&255)):12===n&&p.push(l>>4&255),r?r.from?r.from(p):new r(p):p},predicate:function(e){return r&&r.isBuffer(e)},represent:function(e){var t,n,r="",a=0,o=e.length,s=i;for(t=0;t<o;t++)t%3==0&&t&&(r+=s[a>>18&63],r+=s[a>>12&63],r+=s[a>>6&63],r+=s[63&a]),a=(a<<8)+e[t];return 0==(n=o%3)?(r+=s[a>>18&63],r+=s[a>>12&63],r+=s[a>>6&63],r+=s[63&a]):2===n?(r+=s[a>>10&63],r+=s[a>>4&63],r+=s[a<<2&63],r+=s[64]):1===n&&(r+=s[a>>2&63],r+=s[a<<4&63],r+=s[64],r+=s[64]),r}})},224:(e,t,n)=>{"use strict";var r=n(6277);e.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},1104:(e,t,n)=>{"use strict";var r=n(8936),a=n(6277),i=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),o=/^[-+]?[0-9]+e/;e.exports=new a("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!i.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n,r,a;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,a=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:t.indexOf(":")>=0?(t.split(":").forEach((function(e){a.unshift(parseFloat(e,10))})),t=0,r=1,a.forEach((function(e){t+=e*r,r*=60})),n*t):n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||r.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(e))return"-0.0";return n=e.toString(10),o.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},1903:(e,t,n)=>{"use strict";var r=n(8936),a=n(6277);function i(e){return 48<=e&&e<=55}function o(e){return 48<=e&&e<=57}e.exports=new a("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=e.length,a=0,s=!1;if(!r)return!1;if("-"!==(t=e[a])&&"+"!==t||(t=e[++a]),"0"===t){if(a+1===r)return!0;if("b"===(t=e[++a])){for(a++;a<r;a++)if("_"!==(t=e[a])){if("0"!==t&&"1"!==t)return!1;s=!0}return s&&"_"!==t}if("x"===t){for(a++;a<r;a++)if("_"!==(t=e[a])){if(!(48<=(n=e.charCodeAt(a))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;s=!0}return s&&"_"!==t}for(;a<r;a++)if("_"!==(t=e[a])){if(!i(e.charCodeAt(a)))return!1;s=!0}return s&&"_"!==t}if("_"===t)return!1;for(;a<r;a++)if("_"!==(t=e[a])){if(":"===t)break;if(!o(e.charCodeAt(a)))return!1;s=!0}return!(!s||"_"===t)&&(":"!==t||/^(:[0-5]?[0-9])+$/.test(e.slice(a)))},construct:function(e){var t,n,r=e,a=1,i=[];return-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),"-"!==(t=r[0])&&"+"!==t||("-"===t&&(a=-1),t=(r=r.slice(1))[0]),"0"===r?0:"0"===t?"b"===r[1]?a*parseInt(r.slice(2),2):"x"===r[1]?a*parseInt(r,16):a*parseInt(r,8):-1!==r.indexOf(":")?(r.split(":").forEach((function(e){i.unshift(parseInt(e,10))})),r=0,n=1,i.forEach((function(e){r+=e*n,n*=60})),a*r):a*parseInt(r,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!r.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},6238:(e,t,n)=>{"use strict";var r;try{r=n(8707)}catch(e){"undefined"!=typeof window&&(r=window.esprima)}var a=n(6277);e.exports=new a("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(e){if(null===e)return!1;try{var t="("+e+")",n=r.parse(t,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&("ArrowFunctionExpression"===n.body[0].expression.type||"FunctionExpression"===n.body[0].expression.type)}catch(e){return!1}},construct:function(e){var t,n="("+e+")",a=r.parse(n,{range:!0}),i=[];if("Program"!==a.type||1!==a.body.length||"ExpressionStatement"!==a.body[0].type||"ArrowFunctionExpression"!==a.body[0].expression.type&&"FunctionExpression"!==a.body[0].expression.type)throw new Error("Failed to resolve function");return a.body[0].expression.params.forEach((function(e){i.push(e.name)})),t=a.body[0].expression.body.range,"BlockStatement"===a.body[0].expression.body.type?new Function(i,n.slice(t[0]+1,t[1]-1)):new Function(i,"return "+n.slice(t[0],t[1]))},predicate:function(e){return"[object Function]"===Object.prototype.toString.call(e)},represent:function(e){return e.toString()}})},3027:(e,t,n)=>{"use strict";var r=n(6277);e.exports=new r("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";if("/"===t[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==t[t.length-r.length-1])return!1}return!0},construct:function(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return"/"===t[0]&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)},predicate:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},represent:function(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}})},7124:(e,t,n)=>{"use strict";var r=n(6277);e.exports=new r("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(e){return void 0===e},represent:function(){return""}})},676:(e,t,n)=>{"use strict";var r=n(6277);e.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},5222:(e,t,n)=>{"use strict";var r=n(6277);e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})},1661:(e,t,n)=>{"use strict";var r=n(6277);e.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},9801:(e,t,n)=>{"use strict";var r=n(6277),a=Object.prototype.hasOwnProperty,i=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,o,s,l=[],p=e;for(t=0,n=p.length;t<n;t+=1){if(r=p[t],s=!1,"[object Object]"!==i.call(r))return!1;for(o in r)if(a.call(r,o)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==l.indexOf(o))return!1;l.push(o)}return!0},construct:function(e){return null!==e?e:[]}})},4587:(e,t,n)=>{"use strict";var r=n(6277),a=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,i,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(r=s[t],"[object Object]"!==a.call(r))return!1;if(1!==(i=Object.keys(r)).length)return!1;o[t]=[i[0],r[i[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,r,a,i,o=e;for(i=new Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],a=Object.keys(r),i[t]=[a[0],r[a[0]]];return i}})},9097:(e,t,n)=>{"use strict";var r=n(6277);e.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},4342:(e,t,n)=>{"use strict";var r=n(6277),a=Object.prototype.hasOwnProperty;e.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(a.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})},9737:(e,t,n)=>{"use strict";var r=n(6277);e.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},1398:(e,t,n)=>{"use strict";var r=n(6277),a=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");e.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==a.exec(e)||null!==i.exec(e))},construct:function(e){var t,n,r,o,s,l,p,u,m=0,c=null;if(null===(t=a.exec(e))&&(t=i.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(n,r,o));if(s=+t[4],l=+t[5],p=+t[6],t[7]){for(m=t[7].slice(0,3);m.length<3;)m+="0";m=+m}return t[9]&&(c=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(c=-c)),u=new Date(Date.UTC(n,r,o,s,l,p,m)),c&&u.setTime(u.getTime()-c),u},instanceOf:Date,represent:function(e){return e.toISOString()}})},5081:(e,t,n)=>{"use strict";const r=n(3841),a=n(5624),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=l,t.IS=50;const o=2147483647;function s(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return m(e)}return p(e,t,n)}function p(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|T(e,t);let r=s(n);const a=r.write(e,t);return a!==n&&(r=r.slice(0,a)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(z(e,ArrayBuffer)||e&&z(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(z(e,SharedArrayBuffer)||e&&z(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return l.from(r,t,n);const a=function(e){if(l.isBuffer(e)){const t=0|g(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||W(e.length)?s(0):c(e):"Buffer"===e.type&&Array.isArray(e.data)?c(e.data):void 0}(e);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function m(e){return u(e),s(e<0?0:0|g(e))}function c(e){const t=e.length<0?0:0|g(e.length),n=s(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function h(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,l.prototype),r}function g(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function T(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let a=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(e).length;default:if(a)return r?-1:K(e).length;t=(""+t).toLowerCase(),a=!0}}function y(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return D(this,t,n);case"ascii":return _(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function d(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function f(e,t,n,r,a){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),W(n=+n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:S(e,t,n,r,a);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):S(e,[t],n,r,a);throw new TypeError("val must be string, number or Buffer")}function S(e,t,n,r,a){let i,o=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,n/=2}function p(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){let r=-1;for(i=n;i<s;i++)if(p(e,i)===p(t,-1===r?0:i-r)){if(-1===r&&(r=i),i-r+1===l)return r*o}else-1!==r&&(i-=i-r),r=-1}else for(n+l>s&&(n=s-l),i=n;i>=0;i--){let n=!0;for(let r=0;r<l;r++)if(p(e,i+r)!==p(t,r)){n=!1;break}if(n)return i}return-1}function b(e,t,n,r){n=Number(n)||0;const a=e.length-n;r?(r=Number(r))>a&&(r=a):r=a;const i=t.length;let o;for(r>i/2&&(r=i/2),o=0;o<r;++o){const r=parseInt(t.substr(2*o,2),16);if(W(r))return o;e[n+o]=r}return o}function x(e,t,n,r){return X(K(t,e.length-n),e,n,r)}function A(e,t,n,r){return X(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function L(e,t,n,r){return X(Y(t),e,n,r)}function E(e,t,n,r){return X(function(e,t){let n,r,a;const i=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,a=n%256,i.push(a),i.push(r);return i}(t,e.length-n),e,n,r)}function I(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function D(e,t,n){n=Math.min(e.length,n);const r=[];let a=t;for(;a<n;){const t=e[a];let i=null,o=t>239?4:t>223?3:t>191?2:1;if(a+o<=n){let n,r,s,l;switch(o){case 1:t<128&&(i=t);break;case 2:n=e[a+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(i=l));break;case 3:n=e[a+1],r=e[a+2],128==(192&n)&&128==(192&r)&&(l=(15&t)<<12|(63&n)<<6|63&r,l>2047&&(l<55296||l>57343)&&(i=l));break;case 4:n=e[a+1],r=e[a+2],s=e[a+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(l=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,l>65535&&l<1114112&&(i=l))}}null===i?(i=65533,o=1):i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i),a+=o}return function(e){const t=e.length;if(t<=v)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=v));return n}(r)}l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,n){return p(e,t,n)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,n){return function(e,t,n){return u(e),e<=0?s(e):void 0!==t?"string"==typeof n?s(e).fill(t,n):s(e).fill(t):s(e)}(e,t,n)},l.allocUnsafe=function(e){return m(e)},l.allocUnsafeSlow=function(e){return m(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(z(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),z(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let a=0,i=Math.min(n,r);a<i;++a)if(e[a]!==t[a]){n=e[a],r=t[a];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=l.allocUnsafe(t);let a=0;for(n=0;n<e.length;++n){let t=e[n];if(z(t,Uint8Array))a+t.length>r.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(r,a)):Uint8Array.prototype.set.call(r,t,a);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,a)}a+=t.length}return r},l.byteLength=T,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)d(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)d(this,t,t+3),d(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)d(this,t,t+7),d(this,t+1,t+6),d(this,t+2,t+5),d(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?D(this,0,e):y.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const n=t.IS;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},i&&(l.prototype[i]=l.prototype.inspect),l.prototype.compare=function(e,t,n,r,a){if(z(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),t<0||n>e.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(this===e)return 0;let i=(a>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0);const s=Math.min(i,o),p=this.slice(r,a),u=e.slice(t,n);for(let e=0;e<s;++e)if(p[e]!==u[e]){i=p[e],o=u[e];break}return i<o?-1:o<i?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return f(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return f(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const a=this.length-t;if((void 0===n||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let i=!1;for(;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":case"latin1":case"binary":return A(this,e,t,n);case"base64":return L(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const v=4096;function _(e,t,n){let r="";n=Math.min(e.length,n);for(let a=t;a<n;++a)r+=String.fromCharCode(127&e[a]);return r}function C(e,t,n){let r="";n=Math.min(e.length,n);for(let a=t;a<n;++a)r+=String.fromCharCode(e[a]);return r}function O(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let a="";for(let r=t;r<n;++r)a+=J[e[r]];return a}function B(e,t,n){const r=e.slice(t,n);let a="";for(let e=0;e<r.length-1;e+=2)a+=String.fromCharCode(r[e]+256*r[e+1]);return a}function j(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,a,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function w(e,t,n,r,a){q(t,r,a,e,n,7);let i=Number(t&BigInt(4294967295));e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function R(e,t,n,r,a){q(t,r,a,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}function F(e,t,n,r,a,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function k(e,t,n,r,i){return t=+t,n>>>=0,i||F(e,0,n,4),a.write(e,t,n,r,23,4),n+4}function $(e,t,n,r,i){return t=+t,n>>>=0,i||F(e,0,n,8),a.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,l.prototype),r},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||j(e,t,this.length);let r=this[e],a=1,i=0;for(;++i<t&&(a*=256);)r+=this[e+i]*a;return r},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||j(e,t,this.length);let r=this[e+--t],a=1;for(;t>0&&(a*=256);)r+=this[e+--t]*a;return r},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=Z((function(e){G(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,a=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(a)<<BigInt(32))})),l.prototype.readBigUInt64BE=Z((function(e){G(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],a=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(a)})),l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||j(e,t,this.length);let r=this[e],a=1,i=0;for(;++i<t&&(a*=256);)r+=this[e+i]*a;return a*=128,r>=a&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||j(e,t,this.length);let r=t,a=1,i=this[e+--r];for(;r>0&&(a*=256);)i+=this[e+--r]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||j(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||j(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=Z((function(e){G(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),l.prototype.readBigInt64BE=Z((function(e){G(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)})),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||j(e,4,this.length),a.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||j(e,4,this.length),a.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||j(e,8,this.length),a.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||j(e,8,this.length),a.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||N(this,e,t,n,Math.pow(2,8*n)-1,0);let a=1,i=0;for(this[t]=255&e;++i<n&&(a*=256);)this[t+i]=e/a&255;return t+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||N(this,e,t,n,Math.pow(2,8*n)-1,0);let a=n-1,i=1;for(this[t+a]=255&e;--a>=0&&(i*=256);)this[t+a]=e/i&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=Z((function(e,t=0){return w(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=Z((function(e,t=0){return R(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);N(this,e,t,n,r-1,-r)}let a=0,i=1,o=0;for(this[t]=255&e;++a<n&&(i*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/i|0)-o&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);N(this,e,t,n,r-1,-r)}let a=n-1,i=1,o=0;for(this[t+a]=255&e;--a>=0&&(i*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/i|0)-o&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=Z((function(e,t=0){return w(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=Z((function(e,t=0){return R(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(e,t,n){return k(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return k(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return $(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return $(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const a=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),a},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{const i=l.isBuffer(e)?e:l.from(e,r),o=i.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<n-t;++a)this[a+t]=i[a%o]}return this};const P={};function M(e,t,n){P[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function U(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function q(e,t,n,r,a,i){if(e>n||e<t){const r="bigint"==typeof t?"n":"";let a;throw a=i>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(i+1)}${r}`:`>= -(2${r} ** ${8*(i+1)-1}${r}) and < 2 ** ${8*(i+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new P.ERR_OUT_OF_RANGE("value",a,e)}!function(e,t,n){G(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||H(t,e.length-(n+1))}(r,a,i)}function G(e,t){if("number"!=typeof e)throw new P.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,n){if(Math.floor(e)!==e)throw G(e,n),new P.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new P.ERR_BUFFER_OUT_OF_BOUNDS;throw new P.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}M("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),M("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),M("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,a=n;return Number.isInteger(n)&&Math.abs(n)>2**32?a=U(String(n)):"bigint"==typeof n&&(a=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(a=U(a)),a+="n"),r+=` It must be ${t}. Received ${a}`,r}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function K(e,t){let n;t=t||1/0;const r=e.length;let a=null;const i=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!a){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&i.push(239,191,189);continue}a=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function Y(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function X(e,t,n,r){let a;for(a=0;a<r&&!(a+n>=t.length||a>=e.length);++a)t[a+n]=e[a];return a}function z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function W(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let a=0;a<16;++a)t[r+a]=e[n]+e[a]}return t}();function Z(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},7520:e=>{"use strict";e.exports=require("./bson.js")},9206:e=>{"use strict";e.exports=JSON.parse('{"Syntax":{"message":"Invalid syntax"},"Type":{"message":"Unexpected type"},"Argument":{"message":"Invalid argument"},"Runtime":{"message":"Generic error"},"Unimplemented":{"message":"Functionality not implemented"},"Reference":{"message":"Reference error"},"Attribute":{"message":"Attribute error"},"Internal":{"message":"An internal error occurred"},"Range":{"message":"Value is out of range"}}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(70);module.exports=__webpack_exports__})();
|