@mongodb-js/compass-web 0.36.1 → 1.0.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.
Files changed (37) hide show
  1. package/dist/106.e50960c29b57a8b92ec5.mjs +2 -0
  2. package/dist/128.2ec06394c7c1718c925f.mjs +1 -0
  3. package/dist/14.ee5055b184ec8814d6f7.mjs +2 -0
  4. package/dist/{941.489a74e5b1130ccb5673.mjs.LICENSE.txt → 14.ee5055b184ec8814d6f7.mjs.LICENSE.txt} +5 -17
  5. package/dist/260.52fdf61d69ac2a2921dc.mjs +2 -0
  6. package/dist/260.52fdf61d69ac2a2921dc.mjs.LICENSE.txt +13 -0
  7. package/dist/302.34205d8fa79ef45d79b5.mjs +1 -0
  8. package/dist/318.ca5407b8a126de079455.mjs +2 -0
  9. package/dist/318.ca5407b8a126de079455.mjs.LICENSE.txt +34 -0
  10. package/dist/560.e85e11aa098b341006f3.mjs +23 -0
  11. package/dist/568.5af0b00ce345e98d8b78.mjs +1 -0
  12. package/dist/714.fde8d188a97cdddc2703.mjs +344 -0
  13. package/dist/717.e27dd37bf389fe1e1fe3.mjs +1 -0
  14. package/dist/810.c52538ab1ee7a0892ac8.mjs +2 -0
  15. package/dist/{832.e3ec48107659934f74e7.mjs.LICENSE.txt → 810.c52538ab1ee7a0892ac8.mjs.LICENSE.txt} +0 -7
  16. package/dist/assets-manifest.json +13 -11
  17. package/dist/compass-web.d.ts +8 -291
  18. package/dist/compass-web.mjs +20 -48
  19. package/dist/index-0b9a48a6.e104f028edf21b1c2537.mjs +29 -0
  20. package/dist/index-bde52cb3.96252163ac8fa874fc4c.mjs +1 -0
  21. package/package.json +40 -41
  22. package/dist/157.ab4998e7eb2874601f10.mjs +0 -2
  23. package/dist/157.ab4998e7eb2874601f10.mjs.LICENSE.txt +0 -11
  24. package/dist/183.652977da27df0eb51f2b.mjs +0 -23
  25. package/dist/187.761186d8e743ea68ec17.mjs +0 -2
  26. package/dist/503.edf8a9c8de8551ffb233.mjs +0 -378
  27. package/dist/811.caf23f67d965d1c56224.mjs +0 -1
  28. package/dist/819.a2cb944a78e8da07819a.mjs +0 -2
  29. package/dist/819.a2cb944a78e8da07819a.mjs.LICENSE.txt +0 -8
  30. package/dist/832.e3ec48107659934f74e7.mjs +0 -2
  31. package/dist/941.489a74e5b1130ccb5673.mjs +0 -2
  32. package/dist/957.77fd779cd858963de4c6.mjs +0 -1
  33. package/dist/965.521bb6d90f74d9a364b7.mjs +0 -1
  34. package/dist/index-bde52cb3.dcb93bf5aae17031a20c.mjs +0 -1
  35. /package/dist/{187.761186d8e743ea68ec17.mjs.LICENSE.txt → 106.e50960c29b57a8b92ec5.mjs.LICENSE.txt} +0 -0
  36. /package/dist/{183.652977da27df0eb51f2b.mjs.LICENSE.txt → 560.e85e11aa098b341006f3.mjs.LICENSE.txt} +0 -0
  37. /package/dist/{503.edf8a9c8de8551ffb233.mjs.LICENSE.txt → 714.fde8d188a97cdddc2703.mjs.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- export const __webpack_esm_id__=354;export const __webpack_esm_ids__=[354];export const __webpack_esm_modules__={1694:e=>{e.exports=e=>class extends e{constructor(){super()}}},3263:(e,t,n)=>{var r=n(49871);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},3377: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# 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: !!js/function &DriverTemplate >\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: !!js/function &EqualitySyntaxTemplate >\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: !!js/function &InSyntaxTemplate >\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: !!js/function &AndSyntaxTemplate >\n (args) => {\n return args.join(' and ');\n }\n OrSyntaxTemplate: !!js/function &OrSyntaxTemplate >\n (args) => {\n return args.join(' or ');\n }\n NotSyntaxTemplate: !!js/function &NotSyntaxTemplate >\n (arg) => {\n return `not ${arg}`;\n }\n UnarySyntaxTemplate: &UnarySyntaxTemplate null\n BinarySyntaxTemplate: !!js/function &BinarySyntaxTemplate >\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: !!js/function &StringTypeTemplate >\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: !!js/function &RegexTypeTemplate >\n (pattern, flags) => {\n flags = flags === '' ? '' : `(?${flags})`;\n\n // Double-quote stringify\n const str = pattern + 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: !!js/function &BoolTypeTemplate >\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: !!js/function &OctalTypeTemplate >\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: !!js/function &ArrayTypeTemplate >\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: !!js/function &NullTypeTemplate >\n () => {\n return 'None';\n }\n UndefinedTypeTemplate: !!js/function &UndefinedTypeTemplate >\n () => {\n return 'None';\n }\n ObjectTypeTemplate: !!js/function &ObjectTypeTemplate >\n (literal, depth) => {\n if (literal === '') {\n return '{}';\n }\n return literal;\n }\n ObjectTypeArgsTemplate: !!js/function &ObjectTypeArgsTemplate >\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: !!js/function &CodeCodeTemplate >\n (lhs) => {\n return `str(${lhs})`;\n }\n CodeCodeArgsTemplate: &CodeCodeArgsTemplate null\n CodeScopeTemplate: &CodeScopeTemplate null\n CodeScopeArgsTemplate: &CodeScopeArgsTemplate null\n ObjectIdToStringTemplate: !!js/function &ObjectIdToStringTemplate >\n (lhs) => {\n return `str(${lhs})`;\n }\n ObjectIdToStringArgsTemplate: !!js/function &ObjectIdToStringArgsTemplate >\n (lhs) => {\n return '';\n }\n ObjectIdEqualsTemplate: !!js/function &ObjectIdEqualsTemplate >\n (lhs) => {\n return `${lhs} ==`;\n }\n ObjectIdEqualsArgsTemplate: !!js/function &ObjectIdEqualsArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n ObjectIdGetTimestampTemplate: !!js/function &ObjectIdGetTimestampTemplate >\n (lhs) => {\n return `${lhs}.generation_time`;\n }\n ObjectIdGetTimestampArgsTemplate:\n !!js/function &ObjectIdGetTimestampArgsTemplate >\n () => {\n return '';\n }\n BinaryValueTemplate: !!js/function &BinaryValueTemplate >\n () => {\n return '';\n }\n BinaryValueArgsTemplate: !!js/function &BinaryValueArgsTemplate >\n (lhs) => {\n return `str(${lhs})`;\n }\n BinaryLengthTemplate: !!js/function &BinaryLengthTemplate >\n () => {\n return '';\n }\n BinaryLengthArgsTemplate: !!js/function &BinaryLengthArgsTemplate >\n (lhs) => {\n return `len(${lhs})`;\n }\n BinaryToStringTemplate: !!js/function &BinaryToStringTemplate >\n () => {\n return '';\n }\n BinaryToStringArgsTemplate: !!js/function &BinaryToStringArgsTemplate >\n (lhs) => {\n return `str(${lhs})`;\n }\n BinarySubtypeTemplate: !!js/function &BinarySubtypeTemplate >\n (lhs) => {\n return `${lhs}.subtype`;\n }\n BinarySubtypeArgsTemplate: &BinarySubtypeArgsTemplate null\n DBRefGetDBTemplate: !!js/function &DBRefGetDBTemplate >\n (lhs) => {\n return `${lhs}.database`;\n }\n DBRefGetCollectionTemplate: !!js/function &DBRefGetCollectionTemplate >\n (lhs) => {\n return `${lhs}.collection`;\n }\n DBRefGetIdTemplate: !!js/function &DBRefGetIdTemplate >\n (lhs) => {\n return `${lhs}.id`;\n }\n DBRefGetIdArgsTemplate: !!js/function &DBRefGetIdArgsTemplate () => {\n return '';\n }\n DBRefGetDBArgsTemplate: !!js/function &DBRefGetDBArgsTemplate >\n () => {\n return '';\n }\n DBRefGetCollectionArgsTemplate:\n !!js/function &DBRefGetCollectionArgsTemplate () => {\n return '';\n }\n LongEqualsTemplate: !!js/function &LongEqualsTemplate >\n (lhs) => {\n return `${lhs} ==`;\n }\n LongEqualsArgsTemplate: !!js/function &LongEqualsArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongToIntTemplate: !!js/function &LongToIntTemplate >\n (lhs) => {\n return `int(${lhs})`;\n }\n LongToIntArgsTemplate: !!js/function &LongToIntArgsTemplate >\n () => {\n return '';\n }\n LongToStringTemplate: !!js/function &LongToStringTemplate >\n () => {\n return 'str';\n }\n LongToStringArgsTemplate: !!js/function &LongToStringArgsTemplate >\n (lhs) => {\n return `(${lhs})`;\n }\n LongToNumberTemplate: !!js/function &LongToNumberTemplate >\n (lhs) => {\n return `float(${lhs})`;\n }\n LongToNumberArgsTemplate: !!js/function &LongToNumberArgsTemplate >\n () => {\n return '';\n }\n LongAddTemplate: !!js/function &LongAddTemplate >\n (lhs) => {\n return `${lhs} +`;\n }\n LongAddArgsTemplate: !!js/function &LongAddArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongSubtractTemplate: !!js/function &LongSubtractTemplate >\n (arg) => {\n return `${arg} -`;\n }\n LongSubtractArgsTemplate: !!js/function &LongSubtractArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongMultiplyTemplate: !!js/function &LongMultiplyTemplate >\n (arg) => {\n return `${arg} *`;\n }\n LongMultiplyArgsTemplate: !!js/function &LongMultiplyArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongDivTemplate: !!js/function &LongDivTemplate >\n (lhs) => {\n return `${lhs} /`;\n }\n LongDivArgsTemplate: !!js/function &LongDivArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongModuloTemplate: !!js/function &LongModuloTemplate >\n (lhs) => {\n return `${lhs} %`;\n }\n LongModuloArgsTemplate: !!js/function &LongModuloArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongAndTemplate: !!js/function &LongAndTemplate >\n (lhs) => {\n return `${lhs} &`;\n }\n LongAndArgsTemplate: !!js/function &LongAndArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongOrTemplate: !!js/function &LongOrTemplate >\n (lhs) => {\n return `${lhs} |`;\n }\n LongOrArgsTemplate: !!js/function &LongOrArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongXorTemplate: !!js/function &LongXorTemplate >\n (lhs) => {\n return `${lhs} ^`;\n }\n LongXorArgsTemplate: !!js/function &LongXorArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongShiftLeftTemplate: !!js/function &LongShiftLeftTemplate >\n (lhs) => {\n return `${lhs} <<`;\n }\n LongShiftLeftArgsTemplate: !!js/function &LongShiftLeftArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongShiftRightTemplate: !!js/function &LongShiftRightTemplate >\n (lhs) => {\n return `${lhs} >>`;\n }\n LongShiftRightArgsTemplate: !!js/function &LongShiftRightArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongCompareTemplate: !!js/function &LongCompareTemplate >\n (lhs) => {\n return `${lhs} -`;\n }\n LongCompareArgsTemplate: !!js/function &LongCompareArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongIsOddTemplate: !!js/function &LongIsOddTemplate >\n (lhs) => {\n return `(${lhs} % 2) == 1`;\n }\n LongIsOddArgsTemplate: !!js/function &LongIsOddArgsTemplate >\n () => {\n return '';\n }\n LongIsZeroTemplate: !!js/function &LongIsZeroTemplate >\n (lhs) => {\n return `${lhs} == 0`;\n }\n LongIsZeroArgsTemplate: !!js/function &LongIsZeroArgsTemplate >\n () => {\n return '';\n }\n LongIsNegativeTemplate: !!js/function &LongIsNegativeTemplate >\n (lhs) => {\n return `${lhs} < 0`;\n }\n LongIsNegativeArgsTemplate: !!js/function &LongIsNegativeArgsTemplate >\n () => {\n return '';\n }\n LongNegateTemplate: !!js/function &LongNegateTemplate >\n () => {\n return '-';\n }\n LongNegateArgsTemplate: !!js/function &LongNegateArgsTemplate >\n (lhs) => {\n return lhs;\n }\n LongNotTemplate: !!js/function &LongNotTemplate >\n () => {\n return '~';\n }\n LongNotArgsTemplate: !!js/function &LongNotArgsTemplate >\n (lhs) => {\n return lhs;\n }\n LongNotEqualsTemplate: !!js/function &LongNotEqualsTemplate >\n (lhs) => {\n return `${lhs} !=`;\n }\n LongNotEqualsArgsTemplate: !!js/function &LongNotEqualsArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanTemplate: !!js/function &LongGreaterThanTemplate >\n (lhs) => {\n return `${lhs} >`;\n }\n LongGreaterThanArgsTemplate: !!js/function &LongGreaterThanArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanOrEqualTemplate:\n !!js/function &LongGreaterThanOrEqualTemplate >\n (lhs) => {\n return `${lhs} >=`;\n }\n LongGreaterThanOrEqualArgsTemplate:\n !!js/function &LongGreaterThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanTemplate: !!js/function &LongLessThanTemplate >\n (lhs) => {\n return `${lhs} <`;\n }\n LongLessThanArgsTemplate: !!js/function &LongLessThanArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanOrEqualTemplate: !!js/function &LongLessThanOrEqualTemplate >\n (lhs) => {\n return `${lhs} <=`;\n }\n LongLessThanOrEqualArgsTemplate:\n !!js/function &LongLessThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongFloatApproxTemplate: !!js/function &LongFloatApproxTemplate >\n (lhs) => {\n return `float(${lhs})`;\n }\n LongTopTemplate: !!js/function &LongTopTemplate >\n (lhs) => {\n return `${lhs} >> 32`;\n }\n LongBottomTemplate: !!js/function &LongBottomTemplate >\n (lhs) => {\n return `${lhs} & 0x0000ffff`;\n }\n TimestampToStringTemplate: !!js/function &TimestampToStringTemplate >\n () => {\n return 'str';\n }\n TimestampToStringArgsTemplate: !!js/function &TimestampToStringArgsTemplate >\n (lhs) => {\n return `(${lhs})`;\n }\n TimestampEqualsTemplate: !!js/function &TimestampEqualsTemplate >\n (lhs) => {\n return `${lhs} ==`;\n }\n TimestampEqualsArgsTemplate: !!js/function &TimestampEqualsArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n TimestampGetLowBitsTemplate: !!js/function &TimestampGetLowBitsTemplate >\n (lhs) => {\n return `${lhs}.time`;\n }\n TimestampGetLowBitsArgsTemplate:\n !!js/function &TimestampGetLowBitsArgsTemplate >\n () => {\n return '';\n }\n TimestampGetHighBitsTemplate: !!js/function &TimestampGetHighBitsTemplate >\n (lhs) => {\n return `${lhs}.inc`;\n }\n TimestampGetHighBitsArgsTemplate:\n !!js/function &TimestampGetHighBitsArgsTemplate >\n () => {\n return '';\n }\n TimestampTTemplate: !!js/function &TimestampTTemplate >\n (lhs) => {\n return `${lhs}.time`;\n }\n TimestampITemplate: !!js/function &TimestampITemplate >\n (lhs) => {\n return `${lhs}.inc`;\n }\n TimestampAsDateTemplate: &TimestampAsDateTemplate null\n TimestampAsDateArgsTemplate: !!js/function &TimestampAsDateArgsTemplate >\n () => {\n return '.as_datetime()';\n }\n TimestampCompareTemplate: !!js/function &TimestampCompareTemplate >\n (lhs) => {\n return `(${lhs}.as_datetime() - `;\n }\n TimestampCompareArgsTemplate: !!js/function &TimestampCompareArgsTemplate >\n (lhs, arg) => {\n return `${arg}.as_datetime()).total_seconds()`;\n }\n TimestampNotEqualsTemplate: !!js/function &TimestampNotEqualsTemplate >\n (lhs) => {\n return `${lhs} !=`;\n }\n TimestampNotEqualsArgsTemplate:\n !!js/function &TimestampNotEqualsArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n TimestampGreaterThanTemplate: !!js/function &TimestampGreaterThanTemplate >\n (lhs) => {\n return `${lhs} >`;\n }\n TimestampGreaterThanArgsTemplate:\n !!js/function &TimestampGreaterThanArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n TimestampGreaterThanOrEqualTemplate:\n !!js/function &TimestampGreaterThanOrEqualTemplate >\n (lhs) => {\n return `${lhs} >=`;\n }\n TimestampGreaterThanOrEqualArgsTemplate:\n !!js/function &TimestampGreaterThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n TimestampLessThanTemplate: !!js/function &TimestampLessThanTemplate >\n (lhs) => {\n return `${lhs} <`;\n }\n TimestampLessThanArgsTemplate: !!js/function &TimestampLessThanArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n TimestampLessThanOrEqualTemplate:\n !!js/function &TimestampLessThanOrEqualTemplate >\n (lhs) => {\n return `${lhs} <=`;\n }\n TimestampLessThanOrEqualArgsTemplate:\n !!js/function &TimestampLessThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n SymbolValueOfTemplate: !!js/function &SymbolValueOfTemplate >\n (lhs) => {\n return lhs;\n }\n SymbolValueOfArgsTemplate: !!js/function &SymbolValueOfArgsTemplate >\n () => {\n return '';\n }\n SymbolInspectTemplate: !!js/function &SymbolInspectTemplate >\n (lhs) => {\n return lhs;\n }\n SymbolInspectArgsTemplate: !!js/function &SymbolInspectArgsTemplate >\n () => {\n return '';\n }\n SymbolToStringTemplate: !!js/function &SymbolToStringTemplate >\n (lhs) => {\n return lhs;\n }\n SymbolToStringArgsTemplate: !!js/function &SymbolToStringArgsTemplate >\n () => {\n return '';\n }\n # Symbol Templates\n CodeSymbolTemplate:\n !!js/function &CodeSymbolTemplate > # Also has process method\n () => {\n return 'Code';\n }\n CodeSymbolArgsTemplate:\n !!js/function &CodeSymbolArgsTemplate > # 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: !!js/function &ObjectIdSymbolArgsTemplate >\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: !!js/function &BinarySymbolArgsTemplate >\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:\n !!js/function &BinarySymbolSubtypeDefaultTemplate >\n () => {\n return 'binary.BINARY_SUBTYPE';\n }\n BinarySymbolSubtypeFunctionTemplate:\n !!js/function &BinarySymbolSubtypeFunctionTemplate >\n () => {\n return 'binary.FUNCTION_SUBTYPE';\n }\n BinarySymbolSubtypeByteArrayTemplate:\n !!js/function &BinarySymbolSubtypeByteArrayTemplate >\n () => {\n return 'binary.BINARY_SUBTYPE';\n }\n BinarySymbolSubtypeUuidOldTemplate:\n !!js/function &BinarySymbolSubtypeUuidOldTemplate >\n () => {\n return 'binary.OLD_UUID_SUBTYPE';\n }\n BinarySymbolSubtypeUuidTemplate:\n !!js/function &BinarySymbolSubtypeUuidTemplate >\n () => {\n return 'binary.UUID_SUBTYPE';\n }\n BinarySymbolSubtypeMd5Template:\n !!js/function &BinarySymbolSubtypeMd5Template >\n () => {\n return 'binary.MD5_SUBTYPE';\n }\n BinarySymbolSubtypeUserDefinedTemplate:\n !!js/function &BinarySymbolSubtypeUserDefinedTemplate >\n () => {\n return 'binary.USER_DEFINED_SUBTYPE';\n }\n DBRefSymbolTemplate: &DBRefSymbolTemplate null\n DBRefSymbolArgsTemplate: &DBRefSymbolArgsTemplate null\n DoubleSymbolTemplate: !!js/function &DoubleSymbolTemplate >\n () => {\n return 'float';\n }\n DoubleSymbolArgsTemplate: &DoubleSymbolArgsTemplate null\n Int32SymbolTemplate: !!js/function &Int32SymbolTemplate >\n () => {\n return 'int';\n }\n Int32SymbolArgsTemplate: !!js/function &Int32SymbolArgsTemplate >\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: !!js/function &LongSymbolTemplate >\n () => {\n return 'Int64';\n }\n LongSymbolArgsTemplate: &LongSymbolArgsTemplate null\n LongSymbolMaxTemplate: !!js/function &LongSymbolMaxTemplate >\n () => {\n return 'sys.maxsize';\n }\n LongSymbolMaxArgsTemplate: &LongSymbolMaxArgsTemplate null\n LongSymbolMinTemplate: !!js/function &LongSymbolMinTemplate >\n () => {\n return '-sys.maxsize -1';\n }\n LongSymbolMinArgsTemplate: &LongSymbolMinArgsTemplate null\n LongSymbolZeroTemplate: !!js/function &LongSymbolZeroTemplate >\n () => {\n return 'Int64(0)';\n }\n LongSymbolZeroArgsTemplate: &LongSymbolZeroArgsTemplate null\n LongSymbolOneTemplate: !!js/function &LongSymbolOneTemplate >\n () => {\n return 'Int64(1)';\n }\n LongSymbolOneArgsTemplate: &LongSymbolOneArgsTemplate null\n LongSymbolNegOneTemplate: !!js/function &LongSymbolNegOneTemplate >\n () => {\n return 'Int64(-1)';\n }\n LongSymbolNegOneArgsTemplate: &LongSymbolNegOneArgsTemplate null\n LongSymbolFromBitsTemplate:\n !!js/function &LongSymbolFromBitsTemplate > # Also has process method\n () => {\n return 'Int64';\n }\n LongSymbolFromBitsArgsTemplate: &LongSymbolFromBitsArgsTemplate null\n LongSymbolFromIntTemplate: !!js/function &LongSymbolFromIntTemplate >\n () => {\n return 'Int64';\n }\n LongSymbolFromIntArgsTemplate: &LongSymbolFromIntArgsTemplate null\n LongSymbolFromNumberTemplate: !!js/function &LongSymbolFromNumberTemplate >\n () => {\n return 'Int64';\n }\n LongSymbolFromNumberArgsTemplate: &LongSymbolFromNumberArgsTemplate null\n LongSymbolFromStringTemplate: !!js/function &LongSymbolFromStringTemplate >\n (lhs, arg) => {\n return 'Int64';\n }\n LongSymbolFromStringArgsTemplate:\n !!js/function &LongSymbolFromStringArgsTemplate >\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: !!js/function &TimestampSymbolTemplate >\n () => {\n return 'Timestamp';\n }\n TimestampSymbolArgsTemplate: !!js/function &TimestampSymbolArgsTemplate >\n (lhs, arg1, arg2) => {\n return `(${arg1 === undefined ? 0 : arg1}, ${arg2 === undefined ? 0 : arg2})`;\n }\n SymbolSymbolTemplate: !!js/function &SymbolSymbolTemplate >\n () => {\n return '';\n }\n SymbolSymbolArgsTemplate: !!js/function &SymbolSymbolArgsTemplate >\n (lhs, arg) => {\n return arg;\n }\n BSONRegExpSymbolTemplate: !!js/function &BSONRegExpSymbolTemplate >\n () => {\n return 'Regex';\n }\n BSONRegExpSymbolArgsTemplate: !!js/function &BSONRegExpSymbolArgsTemplate >\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: !!js/function &Decimal128SymbolTemplate >\n () => {\n return 'Decimal128';\n }\n Decimal128SymbolArgsTemplate: !!js/function &Decimal128SymbolArgsTemplate >\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:\n !!js/function &Decimal128SymbolFromStringTemplate >\n () => {\n return 'Decimal128';\n }\n Decimal128SymbolFromStringArgsTemplate:\n !!js/function &Decimal128SymbolFromStringArgsTemplate >\n (lhs, arg) => {\n return `(${arg})`;\n }\n Decimal128ToStringTemplate: !!js/function &Decimal128ToStringTemplate >\n () => {\n return 'str';\n }\n Decimal128ToStringArgsTemplate:\n !!js/function &Decimal128ToStringArgsTemplate >\n (lhs) => {\n return `(${lhs})`;\n }\n # BSON Util Templates\n ObjectIdCreateFromHexStringTemplate:\n !!js/function &ObjectIdCreateFromHexStringTemplate >\n () => {\n return 'ObjectId';\n }\n ObjectIdCreateFromHexStringArgsTemplate:\n !!js/function &ObjectIdCreateFromHexStringArgsTemplate >\n (lhs, arg) => {\n return `(${arg})`;\n }\n ObjectIdCreateFromTimeTemplate:\n !!js/function &ObjectIdCreateFromTimeTemplate >\n () => {\n return `ObjectId.from_datetime`;\n }\n ObjectIdCreateFromTimeArgsTemplate:\n !!js/function &ObjectIdCreateFromTimeArgsTemplate >\n (lhs, arg, isNumber) => {\n if (isNumber) {\n return `(datetime.fromtimestamp(${arg}))`;\n }\n return `(${arg})`;\n }\n ObjectIdIsValidTemplate: !!js/function &ObjectIdIsValidTemplate >\n (lhs) => {\n return `${lhs}.is_valid`;\n }\n ObjectIdIsValidArgsTemplate: &ObjectIdIsValidArgsTemplate null\n # JS Symbol Templates\n NumberSymbolTemplate: !!js/function &NumberSymbolTemplate >\n () => {\n return '';\n }\n NumberSymbolArgsTemplate: !!js/function &NumberSymbolArgsTemplate >\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: !!js/function &DateSymbolTemplate >\n () => {\n return 'datetime';\n }\n DateSymbolArgsTemplate: !!js/function &DateSymbolArgsTemplate >\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: !!js/function &DateSymbolNowTemplate >\n () => {\n return 'datetime.utcnow';\n }\n DateSymbolNowArgsTemplate: &DateSymbolNowArgsTemplate null\n RegExpSymbolTemplate:\n !!js/function &RegExpSymbolTemplate > # Also has process method\n () => {\n return 're';\n }\n RegExpSymbolArgsTemplate: &RegExpSymbolArgsTemplate null\n ImportTemplate: !!js/function &ImportTemplate >\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: !!js/function &DriverImportTemplate >\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: !!js/function &8ImportTemplate >\n () => {\n return 'import re';\n }\n 9ImportTemplate: &9ImportTemplate null\n 10ImportTemplate: &10ImportTemplate null\n 11ImportTemplate: &11ImportTemplate null\n 12ImportTemplate: &12ImportTemplate null\n 100ImportTemplate: !!js/function &100ImportTemplate >\n () => {\n return 'Code';\n }\n 101ImportTemplate: !!js/function &101ImportTemplate >\n () => {\n return 'ObjectId';\n }\n 102ImportTemplate: !!js/function &102ImportTemplate >\n () => {\n return 'Binary';\n }\n 103ImportTemplate: !!js/function &103ImportTemplate >\n () => {\n return 'DBRef';\n }\n 104ImportTemplate: &104ImportTemplate null\n 105ImportTemplate: &105ImportTemplate null\n 106ImportTemplate: !!js/function &106ImportTemplate >\n () => {\n return 'Int64';\n }\n 107ImportTemplate: !!js/function &107ImportTemplate >\n () => {\n return 'MinKey';\n }\n 108ImportTemplate: !!js/function &108ImportTemplate >\n () => {\n return 'MaxKey';\n }\n 109ImportTemplate: !!js/function &109ImportTemplate >\n () => {\n return 'Regex';\n }\n 110ImportTemplate: !!js/function &110ImportTemplate >\n () => {\n return 'Timestamp';\n }\n 111ImportTemplate: &111ImportTemplate null\n 112ImportTemplate: !!js/function &112ImportTemplate >\n () => {\n return 'Decimal128';\n }\n 113ImportTemplate: &113ImportTemplate null\n 114ImportTemplate: &114ImportTemplate null\n 200ImportTemplate: !!js/function &200ImportTemplate >\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"},4541: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# 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: !!js/function &DriverTemplate >\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: !!js/function &EqualitySyntaxTemplate >\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: !!js/function &InSyntaxTemplate >\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: !!js/function &AndSyntaxTemplate >\n (args) => {\n return args.join(' && ');\n }\n OrSyntaxTemplate: !!js/function &OrSyntaxTemplate >\n (args) => {\n return args.join(' || ');\n }\n NotSyntaxTemplate: !!js/function &NotSyntaxTemplate >\n (arg) => {\n return `!${arg}`;\n }\n UnarySyntaxTemplate: !!js/function &UnarySyntaxTemplate >\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: !!js/function &BinarySyntaxTemplate >\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: !!js/function &StringTypeTemplate >\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: !!js/function &RegexTypeTemplate >\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: !!js/function &BoolTypeTemplate >\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: !!js/function &HexTypeTemplate >\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: !!js/function &OctalTypeTemplate >\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: !!js/function &ArrayTypeTemplate >\n (literal, depth) => {\n if (literal === '') {\n return '[]'\n }\n return `[${literal}]`;\n }\n ArrayTypeArgsTemplate: !!js/function &ArrayTypeArgsTemplate >\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: !!js/function &NullTypeTemplate >\n () => 'Bson::Null'\n UndefinedTypeTemplate: !!js/function &UndefinedTypeTemplate >\n () => 'Bson::Undefined'\n ObjectTypeTemplate: !!js/function &ObjectTypeTemplate >\n (literal) => `doc! {${literal}}`\n ObjectTypeArgsTemplate: !!js/function &ObjectTypeArgsTemplate >\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: !!js/function &CodeSymbolTemplate >\n () => ''\n CodeSymbolArgsTemplate: !!js/function &CodeSymbolArgsTemplate >\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: !!js/function &ObjectIdSymbolTemplate >\n () => 'ObjectId'\n ObjectIdSymbolArgsTemplate: !!js/function &ObjectIdSymbolArgsTemplate >\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:\n !!js/function &BinarySymbolSubtypeDefaultTemplate >\n () => 'BinarySubtype::Generic'\n BinarySymbolSubtypeFunctionTemplate:\n !!js/function &BinarySymbolSubtypeFunctionTemplate >\n () => 'BinarySubtype::Function'\n BinarySymbolSubtypeByteArrayTemplate:\n !!js/function &BinarySymbolSubtypeByteArrayTemplate >\n () => 'BinarySubtype::BinaryOld'\n BinarySymbolSubtypeUuidOldTemplate:\n !!js/function &BinarySymbolSubtypeUuidOldTemplate >\n () => 'BinarySubtype::UuidOld'\n BinarySymbolSubtypeUuidTemplate:\n !!js/function &BinarySymbolSubtypeUuidTemplate >\n () => 'BinarySubtype::Uuid'\n BinarySymbolSubtypeMd5Template:\n !!js/function &BinarySymbolSubtypeMd5Template >\n () => 'BinarySubtype::Md5'\n BinarySymbolSubtypeUserDefinedTemplate:\n !!js/function &BinarySymbolSubtypeUserDefinedTemplate >\n (arg) => `BinarySubtype::UserDefined(${arg})`\n DBRefSymbolTemplate: &DBRefSymbolTemplate null # No args\n DBRefSymbolArgsTemplate: &DBRefSymbolArgsTemplate null # Args: lhs, coll, id, db\n DoubleSymbolTemplate: !!js/function &DoubleSymbolTemplate >\n () => ''\n DoubleSymbolArgsTemplate: !!js/function &DoubleSymbolArgsTemplate >\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: !!js/function &Int32SymbolTemplate >\n () => ''\n Int32SymbolArgsTemplate: !!js/function &Int32SymbolArgsTemplate >\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: !!js/function &LongSymbolTemplate >\n () => ''\n LongSymbolArgsTemplate: !!js/function &LongSymbolArgsTemplate >\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: !!js/function &RegExpSymbolTemplate >\n () => 'Regex'\n RegExpSymbolArgsTemplate: &RegExpSymbolArgsTemplate null # Args: lhs, pattern, flags\n SymbolSymbolTemplate: !!js/function &SymbolSymbolTemplate >\n () => 'Bson::Symbol'\n SymbolSymbolArgsTemplate: !!js/function &SymbolSymbolArgsTemplate >\n (_, arg) => `(${arg})`\n BSONRegExpSymbolTemplate: !!js/function &BSONRegExpSymbolTemplate >\n () => 'Regex'\n BSONRegExpSymbolArgsTemplate: !!js/function &BSONRegExpSymbolArgsTemplate >\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: !!js/function &MinKeySymbolTemplate >\n () => 'Bson::MinKey'\n MinKeySymbolArgsTemplate: !!js/function &MinKeySymbolArgsTemplate >\n () => ''\n MaxKeySymbolTemplate: !!js/function &MaxKeySymbolTemplate >\n () => 'Bson::MaxKey'\n MaxKeySymbolArgsTemplate: !!js/function &MaxKeySymbolArgsTemplate >\n () => ''\n TimestampSymbolTemplate: !!js/function &TimestampSymbolTemplate >\n () => 'Timestamp'\n TimestampSymbolArgsTemplate: !!js/function &TimestampSymbolArgsTemplate >\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: !!js/function &NumberSymbolTemplate >\n () => ''\n NumberSymbolArgsTemplate: !!js/function &NumberSymbolArgsTemplate >\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: !!js/function &DateSymbolTemplate >\n () => 'DateTime'\n DateSymbolArgsTemplate: !!js/function &DateSymbolArgsTemplate >\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: !!js/function &CodeScopeTemplate >\n (lhs) => `${lhs}.scope`\n CodeScopeArgsTemplate: &CodeScopeArgsTemplate null\n ObjectIdToStringTemplate: !!js/function &ObjectIdToStringTemplate >\n (lhs) => `${lhs}.to_hex()`\n ObjectIdToStringArgsTemplate: !!js/function &ObjectIdToStringArgsTemplate >\n () => ''\n ObjectIdEqualsTemplate: !!js/function &ObjectIdEqualsTemplate >\n (lhs) => `${lhs} == `\n ObjectIdEqualsArgsTemplate: !!js/function &ObjectIdEqualsArgsTemplate >\n (_, arg) => arg\n ObjectIdGetTimestampTemplate: !!js/function &ObjectIdGetTimestampTemplate >\n (lhs) => `${lhs}.timestamp()`\n ObjectIdGetTimestampArgsTemplate:\n !!js/function &ObjectIdGetTimestampArgsTemplate >\n () => ''\n ObjectIdIsValidTemplate: &ObjectIdIsValidTemplate null\n ObjectIdIsValidArgsTemplate: &ObjectIdIsValidArgsTemplate null\n BinaryValueTemplate: !!js/function &BinaryValueTemplate >\n (arg) => `${arg}.bytes`\n BinaryValueArgsTemplate: !!js/function &BinaryValueArgsTemplate >\n () => ''\n BinaryLengthTemplate: !!js/function &BinaryLengthTemplate >\n (arg) => `${arg}.bytes.len()`\n BinaryLengthArgsTemplate: !!js/function &BinaryLengthArgsTemplate >\n () => ''\n BinaryToStringTemplate: !!js/function &BinaryToStringTemplate >\n (arg) => `format!(\"{}\", ${arg})`\n BinaryToStringArgsTemplate: !!js/function &BinaryToStringArgsTemplate >\n () => ''\n BinarySubtypeTemplate: !!js/function &BinarySubtypeTemplate >\n (arg) => `${arg}.subtype`\n BinarySubtypeArgsTemplate: !!js/function &BinarySubtypeArgsTemplate >\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: !!js/function &LongEqualsTemplate >\n (lhs) => `${lhs} == `\n LongEqualsArgsTemplate: !!js/function &LongEqualsArgsTemplate >\n (_, rhs) => rhs\n LongToStringTemplate: !!js/function &LongToStringTemplate >\n (arg) => arg\n LongToStringArgsTemplate: &LongToStringArgsTemplate null\n LongToIntTemplate: !!js/function &LongToIntTemplate >\n (arg) => `${arg} as i32`\n LongToIntArgsTemplate: !!js/function &LongToIntArgsTemplate >\n () => ''\n LongValueOfTemplate: &LongValueOfTemplate null\n LongValueOfArgsTemplate: &LongValueOfArgsTemplate null\n LongToNumberTemplate: !!js/function &LongToNumberTemplate >\n (arg) => `${arg} as f64`\n LongToNumberArgsTemplate: !!js/function &LongToNumberArgsTemplate >\n () => ''\n LongAddTemplate: !!js/function &LongAddTemplate >\n (lhs) => `${lhs} + `\n LongAddArgsTemplate: !!js/function &LongAddArgsTemplate >\n (_, rhs) => rhs\n LongSubtractTemplate: !!js/function &LongSubtractTemplate >\n (lhs) => `${lhs} - `\n LongSubtractArgsTemplate: !!js/function &LongSubtractArgsTemplate >\n (_, rhs) => rhs\n LongMultiplyTemplate: !!js/function &LongMultiplyTemplate >\n (lhs) => `${lhs} * `\n LongMultiplyArgsTemplate: !!js/function &LongMultiplyArgsTemplate >\n (_, rhs) => rhs\n LongDivTemplate: !!js/function &LongDivTemplate >\n (lhs) => `${lhs} / `\n LongDivArgsTemplate: !!js/function &LongDivArgsTemplate >\n (_, rhs) => rhs\n LongModuloTemplate: !!js/function &LongModuloTemplate >\n (lhs) => `${lhs} % `\n LongModuloArgsTemplate: !!js/function &LongModuloArgsTemplate >\n (_, rhs) => rhs\n LongAndTemplate: !!js/function &LongAndTemplate >\n (lhs) => `${lhs} & `\n LongAndArgsTemplate: !!js/function &LongAndArgsTemplate >\n (_, rhs) => rhs\n LongOrTemplate: !!js/function &LongOrTemplate >\n (lhs) => `${lhs} | `\n LongOrArgsTemplate: !!js/function &LongOrArgsTemplate >\n (_, rhs) => rhs\n LongXorTemplate: !!js/function &LongXorTemplate >\n (lhs) => `${lhs} ^ `\n LongXorArgsTemplate: !!js/function &LongXorArgsTemplate >\n (_, rhs) => rhs\n LongShiftLeftTemplate: !!js/function &LongShiftLeftTemplate >\n (lhs) => `${lhs} << `\n LongShiftLeftArgsTemplate: !!js/function &LongShiftLeftArgsTemplate >\n (_, rhs) => rhs\n LongShiftRightTemplate: !!js/function &LongShiftRightTemplate >\n (lhs) => `${lhs} >> `\n LongShiftRightArgsTemplate: !!js/function &LongShiftRightArgsTemplate >\n (_, rhs) => rhs\n LongCompareTemplate: !!js/function &LongCompareTemplate >\n (lhs) => `${lhs} - `\n LongCompareArgsTemplate: !!js/function &LongCompareArgsTemplate >\n (_, rhs) => rhs\n LongIsOddTemplate: !!js/function &LongIsOddTemplate >\n (arg) => `${arg} % 2 == 1`\n LongIsOddArgsTemplate: !!js/function &LongIsOddArgsTemplate >\n () => ''\n LongIsZeroTemplate: !!js/function &LongIsZeroTemplate >\n (arg) => `${arg} == 0`\n LongIsZeroArgsTemplate: !!js/function &LongIsZeroArgsTemplate >\n () => ''\n LongIsNegativeTemplate: !!js/function &LongIsNegativeTemplate >\n (arg) => `${arg} < 0`\n LongIsNegativeArgsTemplate: !!js/function &LongIsNegativeArgsTemplate >\n () => ''\n LongNegateTemplate: !!js/function &LongNegateTemplate >\n () => '-'\n LongNegateArgsTemplate: !!js/function &LongNegateArgsTemplate >\n (arg) => arg\n LongNotTemplate: !!js/function &LongNotTemplate >\n () => '~'\n LongNotArgsTemplate: !!js/function &LongNotArgsTemplate >\n (arg) => arg\n LongNotEqualsTemplate: !!js/function &LongNotEqualsTemplate >\n (lhs) => `${lhs} != `\n LongNotEqualsArgsTemplate: !!js/function &LongNotEqualsArgsTemplate >\n (_, rhs) => rhs\n LongGreaterThanTemplate: !!js/function &LongGreaterThanTemplate >\n (lhs) => `${lhs} > `\n LongGreaterThanArgsTemplate: !!js/function &LongGreaterThanArgsTemplate >\n (_, rhs) => rhs\n LongGreaterThanOrEqualTemplate:\n !!js/function &LongGreaterThanOrEqualTemplate >\n (lhs) => `${lhs} >= `\n LongGreaterThanOrEqualArgsTemplate:\n !!js/function &LongGreaterThanOrEqualArgsTemplate >\n (_, rhs) => rhs\n LongLessThanTemplate: !!js/function &LongLessThanTemplate >\n (lhs) => `${lhs} < `\n LongLessThanArgsTemplate: !!js/function &LongLessThanArgsTemplate >\n (_, rhs) => rhs\n LongLessThanOrEqualTemplate: !!js/function &LongLessThanOrEqualTemplate >\n (lhs) => `${lhs} <= `\n LongLessThanOrEqualArgsTemplate:\n !!js/function &LongLessThanOrEqualArgsTemplate >\n (_, rhs) => rhs\n LongFloatApproxTemplate: !!js/function &LongFloatApproxTemplate >\n (arg) => `${arg} as f32`\n LongTopTemplate: !!js/function &LongTopTemplate >\n (arg) => `${arg} >> 32`\n LongBottomTemplate: !!js/function &LongBottomTemplate >\n (arg) => `${arg} & 0x0000ffff`\n TimestampToStringTemplate: !!js/function &TimestampToStringTemplate >\n (arg) => `${arg}.to_string()`\n TimestampToStringArgsTemplate: !!js/function &TimestampToStringArgsTemplate >\n () => ''\n TimestampEqualsTemplate: !!js/function &TimestampEqualsTemplate >\n (lhs) => `${lhs} == `\n TimestampEqualsArgsTemplate: !!js/function &TimestampEqualsArgsTemplate >\n (_, rhs) => rhs\n TimestampGetLowBitsTemplate: !!js/function &TimestampGetLowBitsTemplate >\n (arg) => `${arg}.time`\n TimestampGetLowBitsArgsTemplate:\n !!js/function &TimestampGetLowBitsArgsTemplate >\n () => ''\n TimestampGetHighBitsTemplate: !!js/function &TimestampGetHighBitsTemplate >\n (arg) => `${arg}.increment`\n TimestampGetHighBitsArgsTemplate:\n !!js/function &TimestampGetHighBitsArgsTemplate >\n () => ''\n TimestampTTemplate: !!js/function &TimestampTTemplate >\n (arg) => `${arg}.time`\n TimestampITemplate: !!js/function &TimestampITemplate >\n (arg) => `${arg}.increment`\n TimestampAsDateTemplate: !!js/function &TimestampAsDateTemplate >\n (arg) => `DateTime::from_millis(${arg}.time)`\n TimestampAsDateArgsTemplate: !!js/function &TimestampAsDateArgsTemplate >\n () => ''\n TimestampCompareTemplate: !!js/function &TimestampCompareTemplate >\n (arg) => `${arg}.cmp`\n TimestampCompareArgsTemplate: !!js/function &TimestampCompareArgsTemplate >\n (_, rhs) => `(${rhs})`\n TimestampNotEqualsTemplate: !!js/function &TimestampNotEqualsTemplate >\n (lhs) => `${lhs} != `\n TimestampNotEqualsArgsTemplate:\n !!js/function &TimestampNotEqualsArgsTemplate >\n (_, rhs) => rhs\n TimestampGreaterThanTemplate: !!js/function &TimestampGreaterThanTemplate >\n (lhs) => `${lhs} > `\n TimestampGreaterThanArgsTemplate:\n !!js/function &TimestampGreaterThanArgsTemplate >\n (_, rhs) => rhs\n TimestampGreaterThanOrEqualTemplate:\n !!js/function &TimestampGreaterThanOrEqualTemplate >\n (lhs) => `${lhs} >= `\n TimestampGreaterThanOrEqualArgsTemplate:\n !!js/function &TimestampGreaterThanOrEqualArgsTemplate >\n (_, rhs) => rhs\n TimestampLessThanTemplate: !!js/function &TimestampLessThanTemplate >\n (lhs) => `${lhs} < `\n TimestampLessThanArgsTemplate: !!js/function &TimestampLessThanArgsTemplate >\n (_, rhs) => rhs\n TimestampLessThanOrEqualTemplate:\n !!js/function &TimestampLessThanOrEqualTemplate >\n (lhs) => `${lhs} <= `\n TimestampLessThanOrEqualArgsTemplate:\n !!js/function &TimestampLessThanOrEqualArgsTemplate >\n (_, rhs) => rhs\n SymbolValueOfTemplate: !!js/function &SymbolValueOfTemplate >\n (arg) => `${arg}.as_symbol().unwrap()`\n SymbolValueOfArgsTemplate: !!js/function &SymbolValueOfArgsTemplate >\n () => ''\n SymbolInspectTemplate: !!js/function &SymbolInspectTemplate >\n (arg) => `format!(\"{:?}\", ${arg})`\n SymbolInspectArgsTemplate: !!js/function &SymbolInspectArgsTemplate >\n () => ''\n SymbolToStringTemplate: !!js/function &SymbolToStringTemplate >\n (arg) => `${arg}.as_symbol().unwrap()`\n SymbolToStringArgsTemplate: !!js/function &SymbolToStringArgsTemplate >\n () => ''\n Decimal128ToStringTemplate: &Decimal128ToStringTemplate null\n Decimal128ToStringArgsTemplate: &Decimal128ToStringArgsTemplate null\n # non bson-specific\n DateSymbolNowTemplate: !!js/function &DateSymbolNowTemplate >\n () => 'DateTime::now()'\n DateSymbolNowArgsTemplate: !!js/function &DateSymbolNowArgsTemplate >\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: !!js/function &LongSymbolMaxTemplate >\n () => 'i64::MAX'\n LongSymbolMaxArgsTemplate: !!js/function &LongSymbolMaxArgsTemplate >\n () => ''\n LongSymbolMinTemplate: !!js/function &LongSymbolMinTemplate >\n () => 'i64::MIN'\n LongSymbolMinArgsTemplate: !!js/function &LongSymbolMinArgsTemplate >\n () => ''\n LongSymbolZeroTemplate: !!js/function &LongSymbolZeroTemplate >\n () => '0i64'\n LongSymbolZeroArgsTemplate: !!js/function &LongSymbolZeroArgsTemplate >\n () => ''\n LongSymbolOneTemplate: !!js/function &LongSymbolOneTemplate >\n () => '1i64'\n LongSymbolOneArgsTemplate: !!js/function &LongSymbolOneArgsTemplate >\n () => ''\n LongSymbolNegOneTemplate: !!js/function &LongSymbolNegOneTemplate >\n () => '-1i64'\n LongSymbolNegOneArgsTemplate: !!js/function &LongSymbolNegOneArgsTemplate >\n () => ''\n LongSymbolFromBitsTemplate: !!js/function &LongSymbolFromBitsTemplate >\n () => ''\n LongSymbolFromBitsArgsTemplate:\n !!js/function &LongSymbolFromBitsArgsTemplate >\n (_, arg) => `${arg}i64`\n LongSymbolFromIntTemplate: !!js/function &LongSymbolFromIntTemplate >\n () => ''\n LongSymbolFromIntArgsTemplate: !!js/function &LongSymbolFromIntArgsTemplate >\n (_, arg) => `${arg}i64`\n LongSymbolFromNumberTemplate: !!js/function &LongSymbolFromNumberTemplate >\n () => ''\n LongSymbolFromNumberArgsTemplate:\n !!js/function &LongSymbolFromNumberArgsTemplate >\n (_, arg) => `${arg} as i64`\n LongSymbolFromStringTemplate: !!js/function &LongSymbolFromStringTemplate >\n () => ''\n LongSymbolFromStringArgsTemplate:\n !!js/function &LongSymbolFromStringArgsTemplate >\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:\n !!js/function &ObjectIdCreateFromHexStringTemplate >\n (lhs) => lhs\n ObjectIdCreateFromHexStringArgsTemplate:\n !!js/function &ObjectIdCreateFromHexStringArgsTemplate >\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: !!js/function &ImportTemplate >\n (args) => {\n let merged = new Set(Object.values(args));\n return [...merged].sort().join('\\n');\n }\n DriverImportTemplate: !!js/function &DriverImportTemplate >\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: !!js/function &8ImportTemplate >\n () => 'use mongodb::bson::Regex;'\n 9ImportTemplate: &9ImportTemplate null\n 10ImportTemplate: !!js/function &10ImportTemplate >\n () => 'use mongodb::bson::doc;'\n # Null\n 11ImportTemplate: !!js/function &11ImportTemplate >\n () => 'use mongodb::bson::Bson;'\n # Undefined\n 12ImportTemplate: !!js/function &12ImportTemplate >\n () => 'use mongodb::bson::Bson;'\n # Code\n 100ImportTemplate: !!js/function &100ImportTemplate >\n () => 'use mongodb::bson::Bson;'\n 101ImportTemplate: !!js/function &101ImportTemplate >\n () => 'use mongodb::bson::oid::ObjectId;'\n 102ImportTemplate: !!js/function &102ImportTemplate >\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: !!js/function &107ImportTemplate >\n () => 'use mongodb::bson::Bson;'\n # MaxKey\n 108ImportTemplate: !!js/function &108ImportTemplate >\n () => 'use mongodb::bson::Bson;'\n 109ImportTemplate: !!js/function &109ImportTemplate >\n () => 'use mongodb::bson::Regex;'\n 110ImportTemplate: !!js/function &110ImportTemplate >\n () => 'use mongodb::bson::Timestamp;'\n 111ImportTemplate: &111ImportTemplate null\n 112ImportTemplate: &112ImportTemplate null\n 113ImportTemplate: !!js/function &113ImportTemplate >\n () => 'use mongodb::bson::JavaScriptCodeWithScope;'\n 114ImportTemplate: !!js/function &114ImportTemplate >\n () => 'use mongodb::bson::spec::BinarySubtype;'\n 200ImportTemplate: !!js/function &200ImportTemplate >\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"},6266:(e,t,n)=>{var r=n(67787).Buffer;n(59648);const a=n(49888),l=n(62444),{BsonTranspilersArgumentError:o,BsonTranspilersRuntimeError:s,BsonTranspilersUnimplementedError:i}=n(65815),{removeQuotes:p}=n(67366);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 l=`Date(${a?this.Types._string.template(a.toUTCString()):""})`;return this.generateCall(e,n,[a,t],"",l,t,!0)}processObjectIdCreateFromTime(e){return this.generateObjectIdFromTime(e)}processBinary(){throw new i("Binary type not supported")}renameNode(e){return e?e.replace("_stmt",""):"Expression"}checkNamedArgs(e,t){return[e,t]}executeJavascript(e){const t={RegExp,BSONRegExp:l.BSONRegExp,DBRef:l.DBRef,Decimal128:l.Decimal128,Double:l.Double,Int32:l.Int32,Long:l.Long,Int64:l.Long,Map:l.Map,MaxKey:l.MaxKey,MinKey:l.MinKey,ObjectID:l.ObjectId,ObjectId:l.ObjectId,BSONSymbol:l.BSONSymbol,Timestamp:l.Timestamp,Code:function(e,t){return new l.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)}}},7156:e=>{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")}"`}}},9804:(e,t,n)=>{var r=n(49871),a=n(3263).K,l=n(35613)._,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”","(”4‘”6","’”<“…","“†“‡","“ˆ“‰","“Š“‹","“Œ“","“Ž“","““‘","“’”\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),i=s.decisionToState.map((function(e,t){return new r.dfa.DFA(e,t)})),p=new r.PredictionContextCache,m=[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'"],u=[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"],g=["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 T(e){return r.Parser.call(this,e),this._interp=new r.atn.ParserATNSimulator(this,s,i,p),this.ruleNames=g,this.literalNames=m,this.symbolicNames=u,T.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},T.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==T.MultiLineComment&&-1!==n.indexOf("\r")||-1!==n.indexOf("\n")||a==T.LineTerminator},this}function c(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=T.RULE_program,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=T.RULE_sourceElements,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=T.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=T.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=T.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=T.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=T.RULE_statementList,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=T.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=T.RULE_variableDeclarationList,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=T.RULE_variableDeclaration,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=T.RULE_initialiser,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=T.RULE_emptyStatement,this}function O(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=T.RULE_expressionStatement,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=T.RULE_ifStatement,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=T.RULE_iterationStatement,this}function E(e,t){return B.call(this,e),B.prototype.copyFrom.call(this,t),this}function D(e,t){return B.call(this,e),B.prototype.copyFrom.call(this,t),this}function R(e,t){return B.call(this,e),B.prototype.copyFrom.call(this,t),this}function C(e,t){return B.call(this,e),B.prototype.copyFrom.call(this,t),this}function N(e,t){return B.call(this,e),B.prototype.copyFrom.call(this,t),this}function v(e,t){return B.call(this,e),B.prototype.copyFrom.call(this,t),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=T.RULE_continueStatement,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=T.RULE_breakStatement,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=T.RULE_returnStatement,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=T.RULE_withStatement,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=T.RULE_switchStatement,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=T.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=T.RULE_caseClauses,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=T.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=T.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=T.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=T.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=T.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=T.RULE_catchProduction,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=T.RULE_finallyProduction,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=T.RULE_debuggerStatement,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=T.RULE_functionDeclaration,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=T.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=T.RULE_functionBody,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=T.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=T.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=T.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=T.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=T.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=T.RULE_propertyAssignment,this}function le(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 ie(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=T.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=T.RULE_propertySetParameterList,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=T.RULE_arguments,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=T.RULE_argumentList,this}function ge(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=T.RULE_expressionSequence,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=T.RULE_singleExpression,this}function ce(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function ye(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function he(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function de(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function fe(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Se(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function be(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Le(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Ae(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Ie(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function xe(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function _e(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Oe(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function je(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Be(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Ee(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function De(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Re(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Ce(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Ne(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function ve(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function $e(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function we(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Fe(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Me(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function qe(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Pe(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Ue(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function ke(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Ge(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function He(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Ve(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Ke(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Ye(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Ze(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function We(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Xe(e,t){return Te.call(this,e),Te.prototype.copyFrom.call(this,t),this}function Qe(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=T.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=T.RULE_literal,this}function Je(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 lt(e,t,n){return void 0===t&&(t=null),null==n&&(n=-1),r.ParserRuleContext.call(this,t,n),this.parser=e,this.ruleIndex=T.RULE_numericLiteral,this}function ot(e,t){return lt.call(this,e),lt.prototype.copyFrom.call(this,t),this}function st(e,t){return lt.call(this,e),lt.prototype.copyFrom.call(this,t),this}function it(e,t){return lt.call(this,e),lt.prototype.copyFrom.call(this,t),this}function pt(e,t){return lt.call(this,e),lt.prototype.copyFrom.call(this,t),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=T.RULE_identifierName,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=T.RULE_reservedWord,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=T.RULE_keyword,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=T.RULE_futureReservedWord,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=T.RULE_getter,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=T.RULE_setter,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=T.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=T.RULE_eof,this}T.prototype=Object.create(r.Parser.prototype),T.prototype.constructor=T,Object.defineProperty(T.prototype,"atn",{get:function(){return s}}),T.EOF=r.Token.EOF,T.RegularExpressionLiteral=1,T.LineTerminator=2,T.OpenBracket=3,T.CloseBracket=4,T.OpenParen=5,T.CloseParen=6,T.OpenBrace=7,T.CloseBrace=8,T.SemiColon=9,T.Comma=10,T.Assign=11,T.QuestionMark=12,T.Colon=13,T.Dot=14,T.PlusPlus=15,T.MinusMinus=16,T.Plus=17,T.Minus=18,T.BitNot=19,T.Not=20,T.Multiply=21,T.Divide=22,T.Modulus=23,T.RightShiftArithmetic=24,T.LeftShiftArithmetic=25,T.RightShiftLogical=26,T.LessThan=27,T.MoreThan=28,T.LessThanEquals=29,T.GreaterThanEquals=30,T.Equals=31,T.NotEquals=32,T.IdentityEquals=33,T.IdentityNotEquals=34,T.BitAnd=35,T.BitXOr=36,T.BitOr=37,T.And=38,T.Or=39,T.MultiplyAssign=40,T.DivideAssign=41,T.ModulusAssign=42,T.PlusAssign=43,T.MinusAssign=44,T.LeftShiftArithmeticAssign=45,T.RightShiftArithmeticAssign=46,T.RightShiftLogicalAssign=47,T.BitAndAssign=48,T.BitXorAssign=49,T.BitOrAssign=50,T.NullLiteral=51,T.UndefinedLiteral=52,T.BooleanLiteral=53,T.IntegerLiteral=54,T.DecimalLiteral=55,T.HexIntegerLiteral=56,T.OctalIntegerLiteral=57,T.Break=58,T.Do=59,T.Instanceof=60,T.Typeof=61,T.Case=62,T.Else=63,T.New=64,T.Var=65,T.Catch=66,T.Finally=67,T.Return=68,T.Void=69,T.Continue=70,T.For=71,T.Switch=72,T.While=73,T.Debugger=74,T.Function=75,T.This=76,T.With=77,T.Default=78,T.If=79,T.Throw=80,T.Delete=81,T.In=82,T.Try=83,T.Class=84,T.Enum=85,T.Extends=86,T.Super=87,T.Const=88,T.Export=89,T.Import=90,T.Implements=91,T.Let=92,T.Private=93,T.Public=94,T.Interface=95,T.Package=96,T.Protected=97,T.Static=98,T.Yield=99,T.Identifier=100,T.StringLiteral=101,T.WhiteSpaces=102,T.MultiLineComment=103,T.SingleLineComment=104,T.UnexpectedCharacter=105,T.RULE_program=0,T.RULE_sourceElements=1,T.RULE_sourceElement=2,T.RULE_statement=3,T.RULE_statementOrBlock=4,T.RULE_block=5,T.RULE_statementList=6,T.RULE_variableStatement=7,T.RULE_variableDeclarationList=8,T.RULE_variableDeclaration=9,T.RULE_initialiser=10,T.RULE_emptyStatement=11,T.RULE_expressionStatement=12,T.RULE_ifStatement=13,T.RULE_iterationStatement=14,T.RULE_continueStatement=15,T.RULE_breakStatement=16,T.RULE_returnStatement=17,T.RULE_withStatement=18,T.RULE_switchStatement=19,T.RULE_caseBlock=20,T.RULE_caseClauses=21,T.RULE_caseClause=22,T.RULE_defaultClause=23,T.RULE_labelledStatement=24,T.RULE_throwStatement=25,T.RULE_tryStatement=26,T.RULE_catchProduction=27,T.RULE_finallyProduction=28,T.RULE_debuggerStatement=29,T.RULE_functionDeclaration=30,T.RULE_formalParameterList=31,T.RULE_functionBody=32,T.RULE_arrayLiteral=33,T.RULE_elementList=34,T.RULE_elision=35,T.RULE_objectLiteral=36,T.RULE_propertyNameAndValueList=37,T.RULE_propertyAssignment=38,T.RULE_propertyName=39,T.RULE_propertySetParameterList=40,T.RULE_arguments=41,T.RULE_argumentList=42,T.RULE_expressionSequence=43,T.RULE_singleExpression=44,T.RULE_assignmentOperator=45,T.RULE_literal=46,T.RULE_numericLiteral=47,T.RULE_identifierName=48,T.RULE_reservedWord=49,T.RULE_keyword=50,T.RULE_futureReservedWord=51,T.RULE_getter=52,T.RULE_setter=53,T.RULE_eos=54,T.RULE_eof=55,c.prototype=Object.create(r.ParserRuleContext.prototype),c.prototype.constructor=c,c.prototype.eof=function(){return this.getTypedRuleContext(dt,0)},c.prototype.sourceElements=function(){return this.getTypedRuleContext(y,0)},c.prototype.sourceElement=function(){return this.getTypedRuleContext(h,0)},c.prototype.enterRule=function(e){e instanceof a&&e.enterProgram(this)},c.prototype.exitRule=function(e){e instanceof a&&e.exitProgram(this)},c.prototype.accept=function(e){return e instanceof l?e.visitProgram(this):e.visitChildren(this)},T.ProgramContext=c,T.prototype.program=function(){var e=new c(this,this._ctx,this.state);this.enterRule(e,0,T.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<<T.RegularExpressionLiteral|1<<T.OpenBracket|1<<T.OpenParen|1<<T.OpenBrace|1<<T.SemiColon|1<<T.PlusPlus|1<<T.MinusMinus|1<<T.Plus|1<<T.Minus|1<<T.BitNot|1<<T.Not)||!(t-51&-32)&&1<<t-51&(1<<T.NullLiteral-51|1<<T.UndefinedLiteral-51|1<<T.BooleanLiteral-51|1<<T.IntegerLiteral-51|1<<T.DecimalLiteral-51|1<<T.HexIntegerLiteral-51|1<<T.OctalIntegerLiteral-51|1<<T.Break-51|1<<T.Do-51|1<<T.Typeof-51|1<<T.New-51|1<<T.Var-51|1<<T.Return-51|1<<T.Void-51|1<<T.Continue-51|1<<T.For-51|1<<T.Switch-51|1<<T.While-51|1<<T.Debugger-51|1<<T.Function-51|1<<T.This-51|1<<T.With-51|1<<T.If-51|1<<T.Throw-51|1<<T.Delete-51)||!(t-83&-32)&&1<<t-83&(1<<T.Try-83|1<<T.Identifier-83|1<<T.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},y.prototype=Object.create(r.ParserRuleContext.prototype),y.prototype.constructor=y,y.prototype.sourceElement=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(h):this.getTypedRuleContext(h,e)},y.prototype.eos=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(ht):this.getTypedRuleContext(ht,e)},y.prototype.enterRule=function(e){e instanceof a&&e.enterSourceElements(this)},y.prototype.exitRule=function(e){e instanceof a&&e.exitSourceElements(this)},y.prototype.accept=function(e){return e instanceof l?e.visitSourceElements(this):e.visitChildren(this)},T.SourceElementsContext=y,T.prototype.sourceElements=function(){var e=new y(this,this._ctx,this.state);this.enterRule(e,2,T.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},h.prototype=Object.create(r.ParserRuleContext.prototype),h.prototype.constructor=h,h.prototype.statement=function(){return this.getTypedRuleContext(d,0)},h.prototype.functionDeclaration=function(){return this.getTypedRuleContext(X,0)},h.prototype.enterRule=function(e){e instanceof a&&e.enterSourceElement(this)},h.prototype.exitRule=function(e){e instanceof a&&e.exitSourceElement(this)},h.prototype.accept=function(e){return e instanceof l?e.visitSourceElement(this):e.visitChildren(this)},T.SourceElementContext=h,T.prototype.sourceElement=function(){var e=new h(this,this._ctx,this.state);this.enterRule(e,4,T.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(L,0)},d.prototype.emptyStatement=function(){return this.getTypedRuleContext(_,0)},d.prototype.expressionStatement=function(){return this.getTypedRuleContext(O,0)},d.prototype.ifStatement=function(){return this.getTypedRuleContext(j,0)},d.prototype.iterationStatement=function(){return this.getTypedRuleContext(B,0)},d.prototype.continueStatement=function(){return this.getTypedRuleContext($,0)},d.prototype.breakStatement=function(){return this.getTypedRuleContext(w,0)},d.prototype.returnStatement=function(){return this.getTypedRuleContext(F,0)},d.prototype.withStatement=function(){return this.getTypedRuleContext(M,0)},d.prototype.labelledStatement=function(){return this.getTypedRuleContext(H,0)},d.prototype.switchStatement=function(){return this.getTypedRuleContext(q,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(W,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 l?e.visitStatement(this):e.visitChildren(this)},T.StatementContext=d,T.prototype.statement=function(){var e=new d(this,this._ctx,this.state);this.enterRule(e,6,T.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 l?e.visitStatementOrBlock(this):e.visitChildren(this)},T.StatementOrBlockContext=f,T.prototype.statementOrBlock=function(){var e=new f(this,this._ctx,this.state);this.enterRule(e,8,T.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(T.OpenBrace,0)},S.prototype.CloseBrace=function(){return this.getToken(T.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 l?e.visitBlock(this):e.visitChildren(this)},T.BlockContext=S,T.prototype.block=function(){var e=new S(this,this._ctx,this.state);this.enterRule(e,10,T.RULE_block);var t=0;try{for(this.enterOuterAlt(e,1),this.state=151,this.match(T.OpenBrace),this.state=155,this._errHandler.sync(this),t=this._input.LA(1);!(-32&t)&&1<<t&(1<<T.RegularExpressionLiteral|1<<T.OpenBracket|1<<T.OpenParen|1<<T.OpenBrace|1<<T.SemiColon|1<<T.PlusPlus|1<<T.MinusMinus|1<<T.Plus|1<<T.Minus|1<<T.BitNot|1<<T.Not)||!(t-51&-32)&&1<<t-51&(1<<T.NullLiteral-51|1<<T.UndefinedLiteral-51|1<<T.BooleanLiteral-51|1<<T.IntegerLiteral-51|1<<T.DecimalLiteral-51|1<<T.HexIntegerLiteral-51|1<<T.OctalIntegerLiteral-51|1<<T.Break-51|1<<T.Do-51|1<<T.Typeof-51|1<<T.New-51|1<<T.Var-51|1<<T.Return-51|1<<T.Void-51|1<<T.Continue-51|1<<T.For-51|1<<T.Switch-51|1<<T.While-51|1<<T.Debugger-51|1<<T.Function-51|1<<T.This-51|1<<T.With-51|1<<T.If-51|1<<T.Throw-51|1<<T.Delete-51)||!(t-83&-32)&&1<<t-83&(1<<T.Try-83|1<<T.Identifier-83|1<<T.StringLiteral-83);)this.state=152,this.statement(),this.state=157,this._errHandler.sync(this),t=this._input.LA(1);this.state=158,this.match(T.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 l?e.visitStatementList(this):e.visitChildren(this)},T.StatementListContext=b,T.prototype.statementList=function(){var e=new b(this,this._ctx,this.state);this.enterRule(e,12,T.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<<T.RegularExpressionLiteral|1<<T.OpenBracket|1<<T.OpenParen|1<<T.OpenBrace|1<<T.SemiColon|1<<T.PlusPlus|1<<T.MinusMinus|1<<T.Plus|1<<T.Minus|1<<T.BitNot|1<<T.Not)||!(t-51&-32)&&1<<t-51&(1<<T.NullLiteral-51|1<<T.UndefinedLiteral-51|1<<T.BooleanLiteral-51|1<<T.IntegerLiteral-51|1<<T.DecimalLiteral-51|1<<T.HexIntegerLiteral-51|1<<T.OctalIntegerLiteral-51|1<<T.Break-51|1<<T.Do-51|1<<T.Typeof-51|1<<T.New-51|1<<T.Var-51|1<<T.Return-51|1<<T.Void-51|1<<T.Continue-51|1<<T.For-51|1<<T.Switch-51|1<<T.While-51|1<<T.Debugger-51|1<<T.Function-51|1<<T.This-51|1<<T.With-51|1<<T.If-51|1<<T.Throw-51|1<<T.Delete-51)||!(t-83&-32)&&1<<t-83&(1<<T.Try-83|1<<T.Identifier-83|1<<T.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},L.prototype=Object.create(r.ParserRuleContext.prototype),L.prototype.constructor=L,L.prototype.Var=function(){return this.getToken(T.Var,0)},L.prototype.variableDeclarationList=function(){return this.getTypedRuleContext(A,0)},L.prototype.eos=function(){return this.getTypedRuleContext(ht,0)},L.prototype.enterRule=function(e){e instanceof a&&e.enterVariableStatement(this)},L.prototype.exitRule=function(e){e instanceof a&&e.exitVariableStatement(this)},L.prototype.accept=function(e){return e instanceof l?e.visitVariableStatement(this):e.visitChildren(this)},T.VariableStatementContext=L,T.prototype.variableStatement=function(){var e=new L(this,this._ctx,this.state);this.enterRule(e,14,T.RULE_variableStatement);try{this.enterOuterAlt(e,1),this.state=165,this.match(T.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(I):this.getTypedRuleContext(I,e)},A.prototype.Comma=function(e){return void 0===e&&(e=null),null===e?this.getTokens(T.Comma):this.getToken(T.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 l?e.visitVariableDeclarationList(this):e.visitChildren(this)},T.VariableDeclarationListContext=A,T.prototype.variableDeclarationList=function(){var e=new A(this,this._ctx,this.state);this.enterRule(e,16,T.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(T.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},I.prototype=Object.create(r.ParserRuleContext.prototype),I.prototype.constructor=I,I.prototype.Identifier=function(){return this.getToken(T.Identifier,0)},I.prototype.initialiser=function(){return this.getTypedRuleContext(x,0)},I.prototype.enterRule=function(e){e instanceof a&&e.enterVariableDeclaration(this)},I.prototype.exitRule=function(e){e instanceof a&&e.exitVariableDeclaration(this)},I.prototype.accept=function(e){return e instanceof l?e.visitVariableDeclaration(this):e.visitChildren(this)},T.VariableDeclarationContext=I,T.prototype.variableDeclaration=function(){var e=new I(this,this._ctx,this.state);this.enterRule(e,18,T.RULE_variableDeclaration);try{this.enterOuterAlt(e,1),this.state=177,this.match(T.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},x.prototype=Object.create(r.ParserRuleContext.prototype),x.prototype.constructor=x,x.prototype.Assign=function(){return this.getToken(T.Assign,0)},x.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,0)},x.prototype.enterRule=function(e){e instanceof a&&e.enterInitialiser(this)},x.prototype.exitRule=function(e){e instanceof a&&e.exitInitialiser(this)},x.prototype.accept=function(e){return e instanceof l?e.visitInitialiser(this):e.visitChildren(this)},T.InitialiserContext=x,T.prototype.initialiser=function(){var e=new x(this,this._ctx,this.state);this.enterRule(e,20,T.RULE_initialiser);try{this.enterOuterAlt(e,1),this.state=181,this.match(T.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},_.prototype=Object.create(r.ParserRuleContext.prototype),_.prototype.constructor=_,_.prototype.SemiColon=function(){return this.getToken(T.SemiColon,0)},_.prototype.enterRule=function(e){e instanceof a&&e.enterEmptyStatement(this)},_.prototype.exitRule=function(e){e instanceof a&&e.exitEmptyStatement(this)},_.prototype.accept=function(e){return e instanceof l?e.visitEmptyStatement(this):e.visitChildren(this)},T.EmptyStatementContext=_,T.prototype.emptyStatement=function(){var e=new _(this,this._ctx,this.state);this.enterRule(e,22,T.RULE_emptyStatement);try{this.enterOuterAlt(e,1),this.state=184,this.match(T.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},O.prototype=Object.create(r.ParserRuleContext.prototype),O.prototype.constructor=O,O.prototype.expressionSequence=function(){return this.getTypedRuleContext(ge,0)},O.prototype.enterRule=function(e){e instanceof a&&e.enterExpressionStatement(this)},O.prototype.exitRule=function(e){e instanceof a&&e.exitExpressionStatement(this)},O.prototype.accept=function(e){return e instanceof l?e.visitExpressionStatement(this):e.visitChildren(this)},T.ExpressionStatementContext=O,T.prototype.expressionStatement=function(){var e=new O(this,this._ctx,this.state);this.enterRule(e,24,T.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},j.prototype=Object.create(r.ParserRuleContext.prototype),j.prototype.constructor=j,j.prototype.If=function(){return this.getToken(T.If,0)},j.prototype.OpenParen=function(){return this.getToken(T.OpenParen,0)},j.prototype.expressionSequence=function(){return this.getTypedRuleContext(ge,0)},j.prototype.CloseParen=function(){return this.getToken(T.CloseParen,0)},j.prototype.statementOrBlock=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(f):this.getTypedRuleContext(f,e)},j.prototype.Else=function(){return this.getToken(T.Else,0)},j.prototype.enterRule=function(e){e instanceof a&&e.enterIfStatement(this)},j.prototype.exitRule=function(e){e instanceof a&&e.exitIfStatement(this)},j.prototype.accept=function(e){return e instanceof l?e.visitIfStatement(this):e.visitChildren(this)},T.IfStatementContext=j,T.prototype.ifStatement=function(){var e=new j(this,this._ctx,this.state);this.enterRule(e,26,T.RULE_ifStatement);try{this.enterOuterAlt(e,1),this.state=188,this.match(T.If),this.state=189,this.match(T.OpenParen),this.state=190,this.expressionSequence(),this.state=191,this.match(T.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(T.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},B.prototype=Object.create(r.ParserRuleContext.prototype),B.prototype.constructor=B,B.prototype.copyFrom=function(e){r.ParserRuleContext.prototype.copyFrom.call(this,e)},E.prototype=Object.create(B.prototype),E.prototype.constructor=E,T.ForVarStatementContext=E,E.prototype.For=function(){return this.getToken(T.For,0)},E.prototype.OpenParen=function(){return this.getToken(T.OpenParen,0)},E.prototype.Var=function(){return this.getToken(T.Var,0)},E.prototype.variableDeclarationList=function(){return this.getTypedRuleContext(A,0)},E.prototype.SemiColon=function(e){return void 0===e&&(e=null),null===e?this.getTokens(T.SemiColon):this.getToken(T.SemiColon,e)},E.prototype.CloseParen=function(){return this.getToken(T.CloseParen,0)},E.prototype.statementOrBlock=function(){return this.getTypedRuleContext(f,0)},E.prototype.expressionSequence=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(ge):this.getTypedRuleContext(ge,e)},E.prototype.enterRule=function(e){e instanceof a&&e.enterForVarStatement(this)},E.prototype.exitRule=function(e){e instanceof a&&e.exitForVarStatement(this)},E.prototype.accept=function(e){return e instanceof l?e.visitForVarStatement(this):e.visitChildren(this)},D.prototype=Object.create(B.prototype),D.prototype.constructor=D,T.ForVarInStatementContext=D,D.prototype.For=function(){return this.getToken(T.For,0)},D.prototype.OpenParen=function(){return this.getToken(T.OpenParen,0)},D.prototype.Var=function(){return this.getToken(T.Var,0)},D.prototype.variableDeclaration=function(){return this.getTypedRuleContext(I,0)},D.prototype.In=function(){return this.getToken(T.In,0)},D.prototype.expressionSequence=function(){return this.getTypedRuleContext(ge,0)},D.prototype.CloseParen=function(){return this.getToken(T.CloseParen,0)},D.prototype.statementOrBlock=function(){return this.getTypedRuleContext(f,0)},D.prototype.enterRule=function(e){e instanceof a&&e.enterForVarInStatement(this)},D.prototype.exitRule=function(e){e instanceof a&&e.exitForVarInStatement(this)},D.prototype.accept=function(e){return e instanceof l?e.visitForVarInStatement(this):e.visitChildren(this)},R.prototype=Object.create(B.prototype),R.prototype.constructor=R,T.WhileStatementContext=R,R.prototype.While=function(){return this.getToken(T.While,0)},R.prototype.OpenParen=function(){return this.getToken(T.OpenParen,0)},R.prototype.expressionSequence=function(){return this.getTypedRuleContext(ge,0)},R.prototype.CloseParen=function(){return this.getToken(T.CloseParen,0)},R.prototype.statementOrBlock=function(){return this.getTypedRuleContext(f,0)},R.prototype.enterRule=function(e){e instanceof a&&e.enterWhileStatement(this)},R.prototype.exitRule=function(e){e instanceof a&&e.exitWhileStatement(this)},R.prototype.accept=function(e){return e instanceof l?e.visitWhileStatement(this):e.visitChildren(this)},C.prototype=Object.create(B.prototype),C.prototype.constructor=C,T.ForStatementContext=C,C.prototype.For=function(){return this.getToken(T.For,0)},C.prototype.OpenParen=function(){return this.getToken(T.OpenParen,0)},C.prototype.SemiColon=function(e){return void 0===e&&(e=null),null===e?this.getTokens(T.SemiColon):this.getToken(T.SemiColon,e)},C.prototype.CloseParen=function(){return this.getToken(T.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(ge):this.getTypedRuleContext(ge,e)},C.prototype.enterRule=function(e){e instanceof a&&e.enterForStatement(this)},C.prototype.exitRule=function(e){e instanceof a&&e.exitForStatement(this)},C.prototype.accept=function(e){return e instanceof l?e.visitForStatement(this):e.visitChildren(this)},N.prototype=Object.create(B.prototype),N.prototype.constructor=N,T.DoWhileStatementContext=N,N.prototype.Do=function(){return this.getToken(T.Do,0)},N.prototype.statementOrBlock=function(){return this.getTypedRuleContext(f,0)},N.prototype.While=function(){return this.getToken(T.While,0)},N.prototype.OpenParen=function(){return this.getToken(T.OpenParen,0)},N.prototype.expressionSequence=function(){return this.getTypedRuleContext(ge,0)},N.prototype.CloseParen=function(){return this.getToken(T.CloseParen,0)},N.prototype.eos=function(){return this.getTypedRuleContext(ht,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 l?e.visitDoWhileStatement(this):e.visitChildren(this)},v.prototype=Object.create(B.prototype),v.prototype.constructor=v,T.ForInStatementContext=v,v.prototype.For=function(){return this.getToken(T.For,0)},v.prototype.OpenParen=function(){return this.getToken(T.OpenParen,0)},v.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,0)},v.prototype.In=function(){return this.getToken(T.In,0)},v.prototype.expressionSequence=function(){return this.getTypedRuleContext(ge,0)},v.prototype.CloseParen=function(){return this.getToken(T.CloseParen,0)},v.prototype.statementOrBlock=function(){return this.getTypedRuleContext(f,0)},v.prototype.enterRule=function(e){e instanceof a&&e.enterForInStatement(this)},v.prototype.exitRule=function(e){e instanceof a&&e.exitForInStatement(this)},v.prototype.accept=function(e){return e instanceof l?e.visitForInStatement(this):e.visitChildren(this)},T.IterationStatementContext=B,T.prototype.iterationStatement=function(){var e=new B(this,this._ctx,this.state);this.enterRule(e,28,T.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(T.Do),this.state=198,this.statementOrBlock(),this.state=199,this.match(T.While),this.state=200,this.match(T.OpenParen),this.state=201,this.expressionSequence(),this.state=202,this.match(T.CloseParen),this.state=203,this.eos();break;case 2:e=new R(this,e),this.enterOuterAlt(e,2),this.state=205,this.match(T.While),this.state=206,this.match(T.OpenParen),this.state=207,this.expressionSequence(),this.state=208,this.match(T.CloseParen),this.state=209,this.statementOrBlock();break;case 3:e=new C(this,e),this.enterOuterAlt(e,3),this.state=211,this.match(T.For),this.state=212,this.match(T.OpenParen),this.state=214,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<T.RegularExpressionLiteral|1<<T.OpenBracket|1<<T.OpenParen|1<<T.OpenBrace|1<<T.PlusPlus|1<<T.MinusMinus|1<<T.Plus|1<<T.Minus|1<<T.BitNot|1<<T.Not)||!(t-51&-32)&&1<<t-51&(1<<T.NullLiteral-51|1<<T.UndefinedLiteral-51|1<<T.BooleanLiteral-51|1<<T.IntegerLiteral-51|1<<T.DecimalLiteral-51|1<<T.HexIntegerLiteral-51|1<<T.OctalIntegerLiteral-51|1<<T.Typeof-51|1<<T.New-51|1<<T.Void-51|1<<T.Function-51|1<<T.This-51|1<<T.Delete-51)||t===T.Identifier||t===T.StringLiteral)&&(this.state=213,this.expressionSequence()),this.state=216,this.match(T.SemiColon),this.state=218,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<T.RegularExpressionLiteral|1<<T.OpenBracket|1<<T.OpenParen|1<<T.OpenBrace|1<<T.PlusPlus|1<<T.MinusMinus|1<<T.Plus|1<<T.Minus|1<<T.BitNot|1<<T.Not)||!(t-51&-32)&&1<<t-51&(1<<T.NullLiteral-51|1<<T.UndefinedLiteral-51|1<<T.BooleanLiteral-51|1<<T.IntegerLiteral-51|1<<T.DecimalLiteral-51|1<<T.HexIntegerLiteral-51|1<<T.OctalIntegerLiteral-51|1<<T.Typeof-51|1<<T.New-51|1<<T.Void-51|1<<T.Function-51|1<<T.This-51|1<<T.Delete-51)||t===T.Identifier||t===T.StringLiteral)&&(this.state=217,this.expressionSequence()),this.state=220,this.match(T.SemiColon),this.state=222,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<T.RegularExpressionLiteral|1<<T.OpenBracket|1<<T.OpenParen|1<<T.OpenBrace|1<<T.PlusPlus|1<<T.MinusMinus|1<<T.Plus|1<<T.Minus|1<<T.BitNot|1<<T.Not)||!(t-51&-32)&&1<<t-51&(1<<T.NullLiteral-51|1<<T.UndefinedLiteral-51|1<<T.BooleanLiteral-51|1<<T.IntegerLiteral-51|1<<T.DecimalLiteral-51|1<<T.HexIntegerLiteral-51|1<<T.OctalIntegerLiteral-51|1<<T.Typeof-51|1<<T.New-51|1<<T.Void-51|1<<T.Function-51|1<<T.This-51|1<<T.Delete-51)||t===T.Identifier||t===T.StringLiteral)&&(this.state=221,this.expressionSequence()),this.state=224,this.match(T.CloseParen),this.state=225,this.statementOrBlock();break;case 4:e=new E(this,e),this.enterOuterAlt(e,4),this.state=226,this.match(T.For),this.state=227,this.match(T.OpenParen),this.state=228,this.match(T.Var),this.state=229,this.variableDeclarationList(),this.state=230,this.match(T.SemiColon),this.state=232,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<T.RegularExpressionLiteral|1<<T.OpenBracket|1<<T.OpenParen|1<<T.OpenBrace|1<<T.PlusPlus|1<<T.MinusMinus|1<<T.Plus|1<<T.Minus|1<<T.BitNot|1<<T.Not)||!(t-51&-32)&&1<<t-51&(1<<T.NullLiteral-51|1<<T.UndefinedLiteral-51|1<<T.BooleanLiteral-51|1<<T.IntegerLiteral-51|1<<T.DecimalLiteral-51|1<<T.HexIntegerLiteral-51|1<<T.OctalIntegerLiteral-51|1<<T.Typeof-51|1<<T.New-51|1<<T.Void-51|1<<T.Function-51|1<<T.This-51|1<<T.Delete-51)||t===T.Identifier||t===T.StringLiteral)&&(this.state=231,this.expressionSequence()),this.state=234,this.match(T.SemiColon),this.state=236,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<T.RegularExpressionLiteral|1<<T.OpenBracket|1<<T.OpenParen|1<<T.OpenBrace|1<<T.PlusPlus|1<<T.MinusMinus|1<<T.Plus|1<<T.Minus|1<<T.BitNot|1<<T.Not)||!(t-51&-32)&&1<<t-51&(1<<T.NullLiteral-51|1<<T.UndefinedLiteral-51|1<<T.BooleanLiteral-51|1<<T.IntegerLiteral-51|1<<T.DecimalLiteral-51|1<<T.HexIntegerLiteral-51|1<<T.OctalIntegerLiteral-51|1<<T.Typeof-51|1<<T.New-51|1<<T.Void-51|1<<T.Function-51|1<<T.This-51|1<<T.Delete-51)||t===T.Identifier||t===T.StringLiteral)&&(this.state=235,this.expressionSequence()),this.state=238,this.match(T.CloseParen),this.state=239,this.statementOrBlock();break;case 5:e=new v(this,e),this.enterOuterAlt(e,5),this.state=241,this.match(T.For),this.state=242,this.match(T.OpenParen),this.state=243,this.singleExpression(0),this.state=244,this.match(T.In),this.state=245,this.expressionSequence(),this.state=246,this.match(T.CloseParen),this.state=247,this.statementOrBlock();break;case 6:e=new D(this,e),this.enterOuterAlt(e,6),this.state=249,this.match(T.For),this.state=250,this.match(T.OpenParen),this.state=251,this.match(T.Var),this.state=252,this.variableDeclaration(),this.state=253,this.match(T.In),this.state=254,this.expressionSequence(),this.state=255,this.match(T.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},$.prototype=Object.create(r.ParserRuleContext.prototype),$.prototype.constructor=$,$.prototype.Continue=function(){return this.getToken(T.Continue,0)},$.prototype.eos=function(){return this.getTypedRuleContext(ht,0)},$.prototype.Identifier=function(){return this.getToken(T.Identifier,0)},$.prototype.enterRule=function(e){e instanceof a&&e.enterContinueStatement(this)},$.prototype.exitRule=function(e){e instanceof a&&e.exitContinueStatement(this)},$.prototype.accept=function(e){return e instanceof l?e.visitContinueStatement(this):e.visitChildren(this)},T.ContinueStatementContext=$,T.prototype.continueStatement=function(){var e=new $(this,this._ctx,this.state);this.enterRule(e,30,T.RULE_continueStatement);try{if(this.enterOuterAlt(e,1),this.state=260,this.match(T.Continue),this.state=263,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,17,this._ctx)){if(this.state=261,this.here(T.LineTerminator))throw new r.error.FailedPredicateException(this,"!this.here(ECMAScriptParser.LineTerminator)");this.state=262,this.match(T.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},w.prototype=Object.create(r.ParserRuleContext.prototype),w.prototype.constructor=w,w.prototype.Break=function(){return this.getToken(T.Break,0)},w.prototype.eos=function(){return this.getTypedRuleContext(ht,0)},w.prototype.Identifier=function(){return this.getToken(T.Identifier,0)},w.prototype.enterRule=function(e){e instanceof a&&e.enterBreakStatement(this)},w.prototype.exitRule=function(e){e instanceof a&&e.exitBreakStatement(this)},w.prototype.accept=function(e){return e instanceof l?e.visitBreakStatement(this):e.visitChildren(this)},T.BreakStatementContext=w,T.prototype.breakStatement=function(){var e=new w(this,this._ctx,this.state);this.enterRule(e,32,T.RULE_breakStatement);try{if(this.enterOuterAlt(e,1),this.state=267,this.match(T.Break),this.state=270,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,18,this._ctx)){if(this.state=268,this.here(T.LineTerminator))throw new r.error.FailedPredicateException(this,"!this.here(ECMAScriptParser.LineTerminator)");this.state=269,this.match(T.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},F.prototype=Object.create(r.ParserRuleContext.prototype),F.prototype.constructor=F,F.prototype.Return=function(){return this.getToken(T.Return,0)},F.prototype.eos=function(){return this.getTypedRuleContext(ht,0)},F.prototype.expressionSequence=function(){return this.getTypedRuleContext(ge,0)},F.prototype.enterRule=function(e){e instanceof a&&e.enterReturnStatement(this)},F.prototype.exitRule=function(e){e instanceof a&&e.exitReturnStatement(this)},F.prototype.accept=function(e){return e instanceof l?e.visitReturnStatement(this):e.visitChildren(this)},T.ReturnStatementContext=F,T.prototype.returnStatement=function(){var e=new F(this,this._ctx,this.state);this.enterRule(e,34,T.RULE_returnStatement);try{if(this.enterOuterAlt(e,1),this.state=274,this.match(T.Return),this.state=277,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,19,this._ctx)){if(this.state=275,this.here(T.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},M.prototype=Object.create(r.ParserRuleContext.prototype),M.prototype.constructor=M,M.prototype.With=function(){return this.getToken(T.With,0)},M.prototype.OpenParen=function(){return this.getToken(T.OpenParen,0)},M.prototype.expressionSequence=function(){return this.getTypedRuleContext(ge,0)},M.prototype.CloseParen=function(){return this.getToken(T.CloseParen,0)},M.prototype.statementOrBlock=function(){return this.getTypedRuleContext(f,0)},M.prototype.enterRule=function(e){e instanceof a&&e.enterWithStatement(this)},M.prototype.exitRule=function(e){e instanceof a&&e.exitWithStatement(this)},M.prototype.accept=function(e){return e instanceof l?e.visitWithStatement(this):e.visitChildren(this)},T.WithStatementContext=M,T.prototype.withStatement=function(){var e=new M(this,this._ctx,this.state);this.enterRule(e,36,T.RULE_withStatement);try{this.enterOuterAlt(e,1),this.state=281,this.match(T.With),this.state=282,this.match(T.OpenParen),this.state=283,this.expressionSequence(),this.state=284,this.match(T.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},q.prototype=Object.create(r.ParserRuleContext.prototype),q.prototype.constructor=q,q.prototype.Switch=function(){return this.getToken(T.Switch,0)},q.prototype.OpenParen=function(){return this.getToken(T.OpenParen,0)},q.prototype.expressionSequence=function(){return this.getTypedRuleContext(ge,0)},q.prototype.CloseParen=function(){return this.getToken(T.CloseParen,0)},q.prototype.caseBlock=function(){return this.getTypedRuleContext(P,0)},q.prototype.enterRule=function(e){e instanceof a&&e.enterSwitchStatement(this)},q.prototype.exitRule=function(e){e instanceof a&&e.exitSwitchStatement(this)},q.prototype.accept=function(e){return e instanceof l?e.visitSwitchStatement(this):e.visitChildren(this)},T.SwitchStatementContext=q,T.prototype.switchStatement=function(){var e=new q(this,this._ctx,this.state);this.enterRule(e,38,T.RULE_switchStatement);try{this.enterOuterAlt(e,1),this.state=287,this.match(T.Switch),this.state=288,this.match(T.OpenParen),this.state=289,this.expressionSequence(),this.state=290,this.match(T.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},P.prototype=Object.create(r.ParserRuleContext.prototype),P.prototype.constructor=P,P.prototype.OpenBrace=function(){return this.getToken(T.OpenBrace,0)},P.prototype.CloseBrace=function(){return this.getToken(T.CloseBrace,0)},P.prototype.caseClauses=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(U):this.getTypedRuleContext(U,e)},P.prototype.defaultClause=function(){return this.getTypedRuleContext(G,0)},P.prototype.enterRule=function(e){e instanceof a&&e.enterCaseBlock(this)},P.prototype.exitRule=function(e){e instanceof a&&e.exitCaseBlock(this)},P.prototype.accept=function(e){return e instanceof l?e.visitCaseBlock(this):e.visitChildren(this)},T.CaseBlockContext=P,T.prototype.caseBlock=function(){var e=new P(this,this._ctx,this.state);this.enterRule(e,40,T.RULE_caseBlock);try{this.enterOuterAlt(e,1),this.state=293,this.match(T.OpenBrace),this.state=295,this._errHandler.sync(this),this._input.LA(1)===T.Case&&(this.state=294,this.caseClauses()),this.state=301,this._errHandler.sync(this),this._input.LA(1)===T.Default&&(this.state=297,this.defaultClause(),this.state=299,this._errHandler.sync(this),this._input.LA(1)===T.Case&&(this.state=298,this.caseClauses())),this.state=303,this.match(T.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(k):this.getTypedRuleContext(k,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 l?e.visitCaseClauses(this):e.visitChildren(this)},T.CaseClausesContext=U,T.prototype.caseClauses=function(){var e=new U(this,this._ctx,this.state);this.enterRule(e,42,T.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===T.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},k.prototype=Object.create(r.ParserRuleContext.prototype),k.prototype.constructor=k,k.prototype.Case=function(){return this.getToken(T.Case,0)},k.prototype.expressionSequence=function(){return this.getTypedRuleContext(ge,0)},k.prototype.Colon=function(){return this.getToken(T.Colon,0)},k.prototype.statementList=function(){return this.getTypedRuleContext(b,0)},k.prototype.enterRule=function(e){e instanceof a&&e.enterCaseClause(this)},k.prototype.exitRule=function(e){e instanceof a&&e.exitCaseClause(this)},k.prototype.accept=function(e){return e instanceof l?e.visitCaseClause(this):e.visitChildren(this)},T.CaseClauseContext=k,T.prototype.caseClause=function(){var e=new k(this,this._ctx,this.state);this.enterRule(e,44,T.RULE_caseClause);var t=0;try{this.enterOuterAlt(e,1),this.state=310,this.match(T.Case),this.state=311,this.expressionSequence(),this.state=312,this.match(T.Colon),this.state=314,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<T.RegularExpressionLiteral|1<<T.OpenBracket|1<<T.OpenParen|1<<T.OpenBrace|1<<T.SemiColon|1<<T.PlusPlus|1<<T.MinusMinus|1<<T.Plus|1<<T.Minus|1<<T.BitNot|1<<T.Not)||!(t-51&-32)&&1<<t-51&(1<<T.NullLiteral-51|1<<T.UndefinedLiteral-51|1<<T.BooleanLiteral-51|1<<T.IntegerLiteral-51|1<<T.DecimalLiteral-51|1<<T.HexIntegerLiteral-51|1<<T.OctalIntegerLiteral-51|1<<T.Break-51|1<<T.Do-51|1<<T.Typeof-51|1<<T.New-51|1<<T.Var-51|1<<T.Return-51|1<<T.Void-51|1<<T.Continue-51|1<<T.For-51|1<<T.Switch-51|1<<T.While-51|1<<T.Debugger-51|1<<T.Function-51|1<<T.This-51|1<<T.With-51|1<<T.If-51|1<<T.Throw-51|1<<T.Delete-51)||!(t-83&-32)&&1<<t-83&(1<<T.Try-83|1<<T.Identifier-83|1<<T.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(T.Default,0)},G.prototype.Colon=function(){return this.getToken(T.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 l?e.visitDefaultClause(this):e.visitChildren(this)},T.DefaultClauseContext=G,T.prototype.defaultClause=function(){var e=new G(this,this._ctx,this.state);this.enterRule(e,46,T.RULE_defaultClause);var t=0;try{this.enterOuterAlt(e,1),this.state=316,this.match(T.Default),this.state=317,this.match(T.Colon),this.state=319,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<T.RegularExpressionLiteral|1<<T.OpenBracket|1<<T.OpenParen|1<<T.OpenBrace|1<<T.SemiColon|1<<T.PlusPlus|1<<T.MinusMinus|1<<T.Plus|1<<T.Minus|1<<T.BitNot|1<<T.Not)||!(t-51&-32)&&1<<t-51&(1<<T.NullLiteral-51|1<<T.UndefinedLiteral-51|1<<T.BooleanLiteral-51|1<<T.IntegerLiteral-51|1<<T.DecimalLiteral-51|1<<T.HexIntegerLiteral-51|1<<T.OctalIntegerLiteral-51|1<<T.Break-51|1<<T.Do-51|1<<T.Typeof-51|1<<T.New-51|1<<T.Var-51|1<<T.Return-51|1<<T.Void-51|1<<T.Continue-51|1<<T.For-51|1<<T.Switch-51|1<<T.While-51|1<<T.Debugger-51|1<<T.Function-51|1<<T.This-51|1<<T.With-51|1<<T.If-51|1<<T.Throw-51|1<<T.Delete-51)||!(t-83&-32)&&1<<t-83&(1<<T.Try-83|1<<T.Identifier-83|1<<T.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(T.Identifier,0)},H.prototype.Colon=function(){return this.getToken(T.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 l?e.visitLabelledStatement(this):e.visitChildren(this)},T.LabelledStatementContext=H,T.prototype.labelledStatement=function(){var e=new H(this,this._ctx,this.state);this.enterRule(e,48,T.RULE_labelledStatement);try{this.enterOuterAlt(e,1),this.state=321,this.match(T.Identifier),this.state=322,this.match(T.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(T.Throw,0)},V.prototype.expressionSequence=function(){return this.getTypedRuleContext(ge,0)},V.prototype.eos=function(){return this.getTypedRuleContext(ht,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 l?e.visitThrowStatement(this):e.visitChildren(this)},T.ThrowStatementContext=V,T.prototype.throwStatement=function(){var e=new V(this,this._ctx,this.state);this.enterRule(e,50,T.RULE_throwStatement);try{if(this.enterOuterAlt(e,1),this.state=325,this.match(T.Throw),this.state=326,this.here(T.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(T.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(Z,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 l?e.visitTryStatement(this):e.visitChildren(this)},T.TryStatementContext=K,T.prototype.tryStatement=function(){var e=new K(this,this._ctx,this.state);this.enterRule(e,52,T.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(T.Try),this.state=331,this.block(),this.state=332,this.catchProduction();break;case 2:this.enterOuterAlt(e,2),this.state=334,this.match(T.Try),this.state=335,this.block(),this.state=336,this.finallyProduction();break;case 3:this.enterOuterAlt(e,3),this.state=338,this.match(T.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(T.Catch,0)},Y.prototype.OpenParen=function(){return this.getToken(T.OpenParen,0)},Y.prototype.Identifier=function(){return this.getToken(T.Identifier,0)},Y.prototype.CloseParen=function(){return this.getToken(T.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 l?e.visitCatchProduction(this):e.visitChildren(this)},T.CatchProductionContext=Y,T.prototype.catchProduction=function(){var e=new Y(this,this._ctx,this.state);this.enterRule(e,54,T.RULE_catchProduction);try{this.enterOuterAlt(e,1),this.state=345,this.match(T.Catch),this.state=346,this.match(T.OpenParen),this.state=347,this.match(T.Identifier),this.state=348,this.match(T.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},Z.prototype=Object.create(r.ParserRuleContext.prototype),Z.prototype.constructor=Z,Z.prototype.Finally=function(){return this.getToken(T.Finally,0)},Z.prototype.block=function(){return this.getTypedRuleContext(S,0)},Z.prototype.enterRule=function(e){e instanceof a&&e.enterFinallyProduction(this)},Z.prototype.exitRule=function(e){e instanceof a&&e.exitFinallyProduction(this)},Z.prototype.accept=function(e){return e instanceof l?e.visitFinallyProduction(this):e.visitChildren(this)},T.FinallyProductionContext=Z,T.prototype.finallyProduction=function(){var e=new Z(this,this._ctx,this.state);this.enterRule(e,56,T.RULE_finallyProduction);try{this.enterOuterAlt(e,1),this.state=351,this.match(T.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},W.prototype=Object.create(r.ParserRuleContext.prototype),W.prototype.constructor=W,W.prototype.Debugger=function(){return this.getToken(T.Debugger,0)},W.prototype.eos=function(){return this.getTypedRuleContext(ht,0)},W.prototype.enterRule=function(e){e instanceof a&&e.enterDebuggerStatement(this)},W.prototype.exitRule=function(e){e instanceof a&&e.exitDebuggerStatement(this)},W.prototype.accept=function(e){return e instanceof l?e.visitDebuggerStatement(this):e.visitChildren(this)},T.DebuggerStatementContext=W,T.prototype.debuggerStatement=function(){var e=new W(this,this._ctx,this.state);this.enterRule(e,58,T.RULE_debuggerStatement);try{this.enterOuterAlt(e,1),this.state=354,this.match(T.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},X.prototype=Object.create(r.ParserRuleContext.prototype),X.prototype.constructor=X,X.prototype.Function=function(){return this.getToken(T.Function,0)},X.prototype.Identifier=function(){return this.getToken(T.Identifier,0)},X.prototype.OpenParen=function(){return this.getToken(T.OpenParen,0)},X.prototype.CloseParen=function(){return this.getToken(T.CloseParen,0)},X.prototype.OpenBrace=function(){return this.getToken(T.OpenBrace,0)},X.prototype.functionBody=function(){return this.getTypedRuleContext(z,0)},X.prototype.CloseBrace=function(){return this.getToken(T.CloseBrace,0)},X.prototype.formalParameterList=function(){return this.getTypedRuleContext(Q,0)},X.prototype.enterRule=function(e){e instanceof a&&e.enterFunctionDeclaration(this)},X.prototype.exitRule=function(e){e instanceof a&&e.exitFunctionDeclaration(this)},X.prototype.accept=function(e){return e instanceof l?e.visitFunctionDeclaration(this):e.visitChildren(this)},T.FunctionDeclarationContext=X,T.prototype.functionDeclaration=function(){var e=new X(this,this._ctx,this.state);this.enterRule(e,60,T.RULE_functionDeclaration);try{this.enterOuterAlt(e,1),this.state=357,this.match(T.Function),this.state=358,this.match(T.Identifier),this.state=359,this.match(T.OpenParen),this.state=361,this._errHandler.sync(this),this._input.LA(1)===T.Identifier&&(this.state=360,this.formalParameterList()),this.state=363,this.match(T.CloseParen),this.state=364,this.match(T.OpenBrace),this.state=365,this.functionBody(),this.state=366,this.match(T.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},Q.prototype=Object.create(r.ParserRuleContext.prototype),Q.prototype.constructor=Q,Q.prototype.Identifier=function(e){return void 0===e&&(e=null),null===e?this.getTokens(T.Identifier):this.getToken(T.Identifier,e)},Q.prototype.Comma=function(e){return void 0===e&&(e=null),null===e?this.getTokens(T.Comma):this.getToken(T.Comma,e)},Q.prototype.enterRule=function(e){e instanceof a&&e.enterFormalParameterList(this)},Q.prototype.exitRule=function(e){e instanceof a&&e.exitFormalParameterList(this)},Q.prototype.accept=function(e){return e instanceof l?e.visitFormalParameterList(this):e.visitChildren(this)},T.FormalParameterListContext=Q,T.prototype.formalParameterList=function(){var e=new Q(this,this._ctx,this.state);this.enterRule(e,62,T.RULE_formalParameterList);var t=0;try{for(this.enterOuterAlt(e,1),this.state=368,this.match(T.Identifier),this.state=373,this._errHandler.sync(this),t=this._input.LA(1);t===T.Comma;)this.state=369,this.match(T.Comma),this.state=370,this.match(T.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(y,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 l?e.visitFunctionBody(this):e.visitChildren(this)},T.FunctionBodyContext=z,T.prototype.functionBody=function(){var e=new z(this,this._ctx,this.state);this.enterRule(e,64,T.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<<T.RegularExpressionLiteral|1<<T.OpenBracket|1<<T.OpenParen|1<<T.OpenBrace|1<<T.SemiColon|1<<T.PlusPlus|1<<T.MinusMinus|1<<T.Plus|1<<T.Minus|1<<T.BitNot|1<<T.Not)||!(t-51&-32)&&1<<t-51&(1<<T.NullLiteral-51|1<<T.UndefinedLiteral-51|1<<T.BooleanLiteral-51|1<<T.IntegerLiteral-51|1<<T.DecimalLiteral-51|1<<T.HexIntegerLiteral-51|1<<T.OctalIntegerLiteral-51|1<<T.Break-51|1<<T.Do-51|1<<T.Typeof-51|1<<T.New-51|1<<T.Var-51|1<<T.Return-51|1<<T.Void-51|1<<T.Continue-51|1<<T.For-51|1<<T.Switch-51|1<<T.While-51|1<<T.Debugger-51|1<<T.Function-51|1<<T.This-51|1<<T.With-51|1<<T.If-51|1<<T.Throw-51|1<<T.Delete-51)||!(t-83&-32)&&1<<t-83&(1<<T.Try-83|1<<T.Identifier-83|1<<T.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},J.prototype=Object.create(r.ParserRuleContext.prototype),J.prototype.constructor=J,J.prototype.OpenBracket=function(){return this.getToken(T.OpenBracket,0)},J.prototype.CloseBracket=function(){return this.getToken(T.CloseBracket,0)},J.prototype.elementList=function(){return this.getTypedRuleContext(ee,0)},J.prototype.Comma=function(){return this.getToken(T.Comma,0)},J.prototype.enterRule=function(e){e instanceof a&&e.enterArrayLiteral(this)},J.prototype.exitRule=function(e){e instanceof a&&e.exitArrayLiteral(this)},J.prototype.accept=function(e){return e instanceof l?e.visitArrayLiteral(this):e.visitChildren(this)},T.ArrayLiteralContext=J,T.prototype.arrayLiteral=function(){var e=new J(this,this._ctx,this.state);this.enterRule(e,66,T.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(T.OpenBracket),this.state=380,this.match(T.CloseBracket);break;case 2:this.enterOuterAlt(e,2),this.state=381,this.match(T.OpenBracket),this.state=382,this.elementList(),this.state=384,this._errHandler.sync(this),this._input.LA(1)===T.Comma&&(this.state=383,this.match(T.Comma)),this.state=386,this.match(T.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(Te):this.getTypedRuleContext(Te,e)},ee.prototype.Comma=function(e){return void 0===e&&(e=null),null===e?this.getTokens(T.Comma):this.getToken(T.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 l?e.visitElementList(this):e.visitChildren(this)},T.ElementListContext=ee,T.prototype.elementList=function(){var e=new ee(this,this._ctx,this.state);this.enterRule(e,68,T.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===T.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(T.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<<T.RegularExpressionLiteral|1<<T.OpenBracket|1<<T.OpenParen|1<<T.OpenBrace|1<<T.PlusPlus|1<<T.MinusMinus|1<<T.Plus|1<<T.Minus|1<<T.BitNot|1<<T.Not)||!(t-51&-32)&&1<<t-51&(1<<T.NullLiteral-51|1<<T.UndefinedLiteral-51|1<<T.BooleanLiteral-51|1<<T.IntegerLiteral-51|1<<T.DecimalLiteral-51|1<<T.HexIntegerLiteral-51|1<<T.OctalIntegerLiteral-51|1<<T.Typeof-51|1<<T.New-51|1<<T.Void-51|1<<T.Function-51|1<<T.This-51|1<<T.Delete-51)||t===T.Identifier||t===T.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(T.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 l?e.visitElision(this):e.visitChildren(this)},T.ElisionContext=te,T.prototype.elision=function(){var e=new te(this,this._ctx,this.state);this.enterRule(e,70,T.RULE_elision);try{this.enterOuterAlt(e,1),this.state=420,this.match(T.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(T.OpenBrace,0)},ne.prototype.CloseBrace=function(){return this.getToken(T.CloseBrace,0)},ne.prototype.propertyNameAndValueList=function(){return this.getTypedRuleContext(re,0)},ne.prototype.Comma=function(){return this.getToken(T.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 l?e.visitObjectLiteral(this):e.visitChildren(this)},T.ObjectLiteralContext=ne,T.prototype.objectLiteral=function(){var e=new ne(this,this._ctx,this.state);this.enterRule(e,72,T.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(T.OpenBrace),this.state=423,this.match(T.CloseBrace);break;case 2:this.enterOuterAlt(e,2),this.state=424,this.match(T.OpenBrace),this.state=425,this.propertyNameAndValueList(),this.state=427,this._errHandler.sync(this),this._input.LA(1)===T.Comma&&(this.state=426,this.match(T.Comma)),this.state=429,this.match(T.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(T.Comma):this.getToken(T.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 l?e.visitPropertyNameAndValueList(this):e.visitChildren(this)},T.PropertyNameAndValueListContext=re,T.prototype.propertyNameAndValueList=function(){var e=new re(this,this._ctx,this.state);this.enterRule(e,74,T.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(T.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)},le.prototype=Object.create(ae.prototype),le.prototype.constructor=le,T.PropertySetterContext=le,le.prototype.setter=function(){return this.getTypedRuleContext(yt,0)},le.prototype.OpenParen=function(){return this.getToken(T.OpenParen,0)},le.prototype.propertySetParameterList=function(){return this.getTypedRuleContext(pe,0)},le.prototype.CloseParen=function(){return this.getToken(T.CloseParen,0)},le.prototype.OpenBrace=function(){return this.getToken(T.OpenBrace,0)},le.prototype.functionBody=function(){return this.getTypedRuleContext(z,0)},le.prototype.CloseBrace=function(){return this.getToken(T.CloseBrace,0)},le.prototype.enterRule=function(e){e instanceof a&&e.enterPropertySetter(this)},le.prototype.exitRule=function(e){e instanceof a&&e.exitPropertySetter(this)},le.prototype.accept=function(e){return e instanceof l?e.visitPropertySetter(this):e.visitChildren(this)},oe.prototype=Object.create(ae.prototype),oe.prototype.constructor=oe,T.PropertyAssignmentExpressionContext=oe,oe.prototype.propertyName=function(){return this.getTypedRuleContext(ie,0)},oe.prototype.Colon=function(){return this.getToken(T.Colon,0)},oe.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,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 l?e.visitPropertyAssignmentExpression(this):e.visitChildren(this)},se.prototype=Object.create(ae.prototype),se.prototype.constructor=se,T.PropertyGetterContext=se,se.prototype.getter=function(){return this.getTypedRuleContext(ct,0)},se.prototype.OpenParen=function(){return this.getToken(T.OpenParen,0)},se.prototype.CloseParen=function(){return this.getToken(T.CloseParen,0)},se.prototype.OpenBrace=function(){return this.getToken(T.OpenBrace,0)},se.prototype.functionBody=function(){return this.getTypedRuleContext(z,0)},se.prototype.CloseBrace=function(){return this.getToken(T.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 l?e.visitPropertyGetter(this):e.visitChildren(this)},T.PropertyAssignmentContext=ae,T.prototype.propertyAssignment=function(){var e=new ae(this,this._ctx,this.state);this.enterRule(e,76,T.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(T.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(T.OpenParen),this.state=447,this.match(T.CloseParen),this.state=448,this.match(T.OpenBrace),this.state=449,this.functionBody(),this.state=450,this.match(T.CloseBrace);break;case 3:e=new le(this,e),this.enterOuterAlt(e,3),this.state=452,this.setter(),this.state=453,this.match(T.OpenParen),this.state=454,this.propertySetParameterList(),this.state=455,this.match(T.CloseParen),this.state=456,this.match(T.OpenBrace),this.state=457,this.functionBody(),this.state=458,this.match(T.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},ie.prototype=Object.create(r.ParserRuleContext.prototype),ie.prototype.constructor=ie,ie.prototype.identifierName=function(){return this.getTypedRuleContext(mt,0)},ie.prototype.StringLiteral=function(){return this.getToken(T.StringLiteral,0)},ie.prototype.numericLiteral=function(){return this.getTypedRuleContext(lt,0)},ie.prototype.enterRule=function(e){e instanceof a&&e.enterPropertyName(this)},ie.prototype.exitRule=function(e){e instanceof a&&e.exitPropertyName(this)},ie.prototype.accept=function(e){return e instanceof l?e.visitPropertyName(this):e.visitChildren(this)},T.PropertyNameContext=ie,T.prototype.propertyName=function(){var e=new ie(this,this._ctx,this.state);this.enterRule(e,78,T.RULE_propertyName);try{switch(this.state=465,this._errHandler.sync(this),this._input.LA(1)){case T.NullLiteral:case T.BooleanLiteral:case T.Break:case T.Do:case T.Instanceof:case T.Typeof:case T.Case:case T.Else:case T.New:case T.Var:case T.Catch:case T.Finally:case T.Return:case T.Void:case T.Continue:case T.For:case T.Switch:case T.While:case T.Debugger:case T.Function:case T.This:case T.With:case T.Default:case T.If:case T.Throw:case T.Delete:case T.In:case T.Try:case T.Class:case T.Enum:case T.Extends:case T.Super:case T.Const:case T.Export:case T.Import:case T.Implements:case T.Let:case T.Private:case T.Public:case T.Interface:case T.Package:case T.Protected:case T.Static:case T.Yield:case T.Identifier:this.enterOuterAlt(e,1),this.state=462,this.identifierName();break;case T.StringLiteral:this.enterOuterAlt(e,2),this.state=463,this.match(T.StringLiteral);break;case T.IntegerLiteral:case T.DecimalLiteral:case T.HexIntegerLiteral:case T.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(T.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 l?e.visitPropertySetParameterList(this):e.visitChildren(this)},T.PropertySetParameterListContext=pe,T.prototype.propertySetParameterList=function(){var e=new pe(this,this._ctx,this.state);this.enterRule(e,80,T.RULE_propertySetParameterList);try{this.enterOuterAlt(e,1),this.state=467,this.match(T.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},me.prototype=Object.create(r.ParserRuleContext.prototype),me.prototype.constructor=me,me.prototype.OpenParen=function(){return this.getToken(T.OpenParen,0)},me.prototype.CloseParen=function(){return this.getToken(T.CloseParen,0)},me.prototype.argumentList=function(){return this.getTypedRuleContext(ue,0)},me.prototype.Comma=function(){return this.getToken(T.Comma,0)},me.prototype.enterRule=function(e){e instanceof a&&e.enterArguments(this)},me.prototype.exitRule=function(e){e instanceof a&&e.exitArguments(this)},me.prototype.accept=function(e){return e instanceof l?e.visitArguments(this):e.visitChildren(this)},T.ArgumentsContext=me,T.prototype.arguments=function(){var e=new me(this,this._ctx,this.state);this.enterRule(e,82,T.RULE_arguments);var t=0;try{this.enterOuterAlt(e,1),this.state=469,this.match(T.OpenParen),this.state=471,this._errHandler.sync(this),(!(-32&(t=this._input.LA(1)))&&1<<t&(1<<T.RegularExpressionLiteral|1<<T.OpenBracket|1<<T.OpenParen|1<<T.OpenBrace|1<<T.PlusPlus|1<<T.MinusMinus|1<<T.Plus|1<<T.Minus|1<<T.BitNot|1<<T.Not)||!(t-51&-32)&&1<<t-51&(1<<T.NullLiteral-51|1<<T.UndefinedLiteral-51|1<<T.BooleanLiteral-51|1<<T.IntegerLiteral-51|1<<T.DecimalLiteral-51|1<<T.HexIntegerLiteral-51|1<<T.OctalIntegerLiteral-51|1<<T.Typeof-51|1<<T.New-51|1<<T.Void-51|1<<T.Function-51|1<<T.This-51|1<<T.Delete-51)||t===T.Identifier||t===T.StringLiteral)&&(this.state=470,this.argumentList()),this.state=474,this._errHandler.sync(this),(t=this._input.LA(1))===T.Comma&&(this.state=473,this.match(T.Comma)),this.state=476,this.match(T.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},ue.prototype=Object.create(r.ParserRuleContext.prototype),ue.prototype.constructor=ue,ue.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(Te):this.getTypedRuleContext(Te,e)},ue.prototype.Comma=function(e){return void 0===e&&(e=null),null===e?this.getTokens(T.Comma):this.getToken(T.Comma,e)},ue.prototype.enterRule=function(e){e instanceof a&&e.enterArgumentList(this)},ue.prototype.exitRule=function(e){e instanceof a&&e.exitArgumentList(this)},ue.prototype.accept=function(e){return e instanceof l?e.visitArgumentList(this):e.visitChildren(this)},T.ArgumentListContext=ue,T.prototype.argumentList=function(){var e=new ue(this,this._ctx,this.state);this.enterRule(e,84,T.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(T.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},ge.prototype=Object.create(r.ParserRuleContext.prototype),ge.prototype.constructor=ge,ge.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(Te):this.getTypedRuleContext(Te,e)},ge.prototype.Comma=function(e){return void 0===e&&(e=null),null===e?this.getTokens(T.Comma):this.getToken(T.Comma,e)},ge.prototype.enterRule=function(e){e instanceof a&&e.enterExpressionSequence(this)},ge.prototype.exitRule=function(e){e instanceof a&&e.exitExpressionSequence(this)},ge.prototype.accept=function(e){return e instanceof l?e.visitExpressionSequence(this):e.visitChildren(this)},T.ExpressionSequenceContext=ge,T.prototype.expressionSequence=function(){var e=new ge(this,this._ctx,this.state);this.enterRule(e,86,T.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(T.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},Te.prototype=Object.create(r.ParserRuleContext.prototype),Te.prototype.constructor=Te,Te.prototype.copyFrom=function(e){r.ParserRuleContext.prototype.copyFrom.call(this,e)},ce.prototype=Object.create(Te.prototype),ce.prototype.constructor=ce,T.TernaryExpressionContext=ce,ce.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(Te):this.getTypedRuleContext(Te,e)},ce.prototype.QuestionMark=function(){return this.getToken(T.QuestionMark,0)},ce.prototype.Colon=function(){return this.getToken(T.Colon,0)},ce.prototype.enterRule=function(e){e instanceof a&&e.enterTernaryExpression(this)},ce.prototype.exitRule=function(e){e instanceof a&&e.exitTernaryExpression(this)},ce.prototype.accept=function(e){return e instanceof l?e.visitTernaryExpression(this):e.visitChildren(this)},ye.prototype=Object.create(Te.prototype),ye.prototype.constructor=ye,T.LogicalAndExpressionContext=ye,ye.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(Te):this.getTypedRuleContext(Te,e)},ye.prototype.And=function(){return this.getToken(T.And,0)},ye.prototype.enterRule=function(e){e instanceof a&&e.enterLogicalAndExpression(this)},ye.prototype.exitRule=function(e){e instanceof a&&e.exitLogicalAndExpression(this)},ye.prototype.accept=function(e){return e instanceof l?e.visitLogicalAndExpression(this):e.visitChildren(this)},he.prototype=Object.create(Te.prototype),he.prototype.constructor=he,T.FuncDefExpressionContext=he,he.prototype.Function=function(){return this.getToken(T.Function,0)},he.prototype.OpenParen=function(){return this.getToken(T.OpenParen,0)},he.prototype.CloseParen=function(){return this.getToken(T.CloseParen,0)},he.prototype.OpenBrace=function(){return this.getToken(T.OpenBrace,0)},he.prototype.functionBody=function(){return this.getTypedRuleContext(z,0)},he.prototype.CloseBrace=function(){return this.getToken(T.CloseBrace,0)},he.prototype.Identifier=function(){return this.getToken(T.Identifier,0)},he.prototype.formalParameterList=function(){return this.getTypedRuleContext(Q,0)},he.prototype.enterRule=function(e){e instanceof a&&e.enterFuncDefExpression(this)},he.prototype.exitRule=function(e){e instanceof a&&e.exitFuncDefExpression(this)},he.prototype.accept=function(e){return e instanceof l?e.visitFuncDefExpression(this):e.visitChildren(this)},de.prototype=Object.create(Te.prototype),de.prototype.constructor=de,T.PreIncrementExpressionContext=de,de.prototype.PlusPlus=function(){return this.getToken(T.PlusPlus,0)},de.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,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 l?e.visitPreIncrementExpression(this):e.visitChildren(this)},fe.prototype=Object.create(Te.prototype),fe.prototype.constructor=fe,T.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 l?e.visitObjectLiteralExpression(this):e.visitChildren(this)},Se.prototype=Object.create(Te.prototype),Se.prototype.constructor=Se,T.InExpressionContext=Se,Se.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(Te):this.getTypedRuleContext(Te,e)},Se.prototype.In=function(){return this.getToken(T.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 l?e.visitInExpression(this):e.visitChildren(this)},be.prototype=Object.create(Te.prototype),be.prototype.constructor=be,T.LogicalOrExpressionContext=be,be.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(Te):this.getTypedRuleContext(Te,e)},be.prototype.Or=function(){return this.getToken(T.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 l?e.visitLogicalOrExpression(this):e.visitChildren(this)},Le.prototype=Object.create(Te.prototype),Le.prototype.constructor=Le,T.NotExpressionContext=Le,Le.prototype.Not=function(){return this.getToken(T.Not,0)},Le.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,0)},Le.prototype.enterRule=function(e){e instanceof a&&e.enterNotExpression(this)},Le.prototype.exitRule=function(e){e instanceof a&&e.exitNotExpression(this)},Le.prototype.accept=function(e){return e instanceof l?e.visitNotExpression(this):e.visitChildren(this)},Ae.prototype=Object.create(Te.prototype),Ae.prototype.constructor=Ae,T.PreDecreaseExpressionContext=Ae,Ae.prototype.MinusMinus=function(){return this.getToken(T.MinusMinus,0)},Ae.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,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 l?e.visitPreDecreaseExpression(this):e.visitChildren(this)},Ie.prototype=Object.create(Te.prototype),Ie.prototype.constructor=Ie,T.ThisExpressionContext=Ie,Ie.prototype.This=function(){return this.getToken(T.This,0)},Ie.prototype.enterRule=function(e){e instanceof a&&e.enterThisExpression(this)},Ie.prototype.exitRule=function(e){e instanceof a&&e.exitThisExpression(this)},Ie.prototype.accept=function(e){return e instanceof l?e.visitThisExpression(this):e.visitChildren(this)},xe.prototype=Object.create(Te.prototype);xe.prototype.constructor=xe,T.UnaryMinusExpressionContext=xe,xe.prototype.Minus=function(){return this.getToken(T.Minus,0)},xe.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,0)},xe.prototype.enterRule=function(e){e instanceof a&&e.enterUnaryMinusExpression(this)},xe.prototype.exitRule=function(e){e instanceof a&&e.exitUnaryMinusExpression(this)},xe.prototype.accept=function(e){return e instanceof l?e.visitUnaryMinusExpression(this):e.visitChildren(this)},_e.prototype=Object.create(Te.prototype),_e.prototype.constructor=_e,T.PostDecreaseExpressionContext=_e,_e.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,0)},_e.prototype.MinusMinus=function(){return this.getToken(T.MinusMinus,0)},_e.prototype.enterRule=function(e){e instanceof a&&e.enterPostDecreaseExpression(this)},_e.prototype.exitRule=function(e){e instanceof a&&e.exitPostDecreaseExpression(this)},_e.prototype.accept=function(e){return e instanceof l?e.visitPostDecreaseExpression(this):e.visitChildren(this)},Oe.prototype=Object.create(Te.prototype),Oe.prototype.constructor=Oe,T.AssignmentExpressionContext=Oe,Oe.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,0)},Oe.prototype.Assign=function(){return this.getToken(T.Assign,0)},Oe.prototype.expressionSequence=function(){return this.getTypedRuleContext(ge,0)},Oe.prototype.enterRule=function(e){e instanceof a&&e.enterAssignmentExpression(this)},Oe.prototype.exitRule=function(e){e instanceof a&&e.exitAssignmentExpression(this)},Oe.prototype.accept=function(e){return e instanceof l?e.visitAssignmentExpression(this):e.visitChildren(this)},je.prototype=Object.create(Te.prototype),je.prototype.constructor=je,T.TypeofExpressionContext=je,je.prototype.Typeof=function(){return this.getToken(T.Typeof,0)},je.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,0)},je.prototype.enterRule=function(e){e instanceof a&&e.enterTypeofExpression(this)},je.prototype.exitRule=function(e){e instanceof a&&e.exitTypeofExpression(this)},je.prototype.accept=function(e){return e instanceof l?e.visitTypeofExpression(this):e.visitChildren(this)},Be.prototype=Object.create(Te.prototype),Be.prototype.constructor=Be,T.InstanceofExpressionContext=Be,Be.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(Te):this.getTypedRuleContext(Te,e)},Be.prototype.Instanceof=function(){return this.getToken(T.Instanceof,0)},Be.prototype.enterRule=function(e){e instanceof a&&e.enterInstanceofExpression(this)},Be.prototype.exitRule=function(e){e instanceof a&&e.exitInstanceofExpression(this)},Be.prototype.accept=function(e){return e instanceof l?e.visitInstanceofExpression(this):e.visitChildren(this)},Ee.prototype=Object.create(Te.prototype),Ee.prototype.constructor=Ee,T.UnaryPlusExpressionContext=Ee,Ee.prototype.Plus=function(){return this.getToken(T.Plus,0)},Ee.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,0)},Ee.prototype.enterRule=function(e){e instanceof a&&e.enterUnaryPlusExpression(this)},Ee.prototype.exitRule=function(e){e instanceof a&&e.exitUnaryPlusExpression(this)},Ee.prototype.accept=function(e){return e instanceof l?e.visitUnaryPlusExpression(this):e.visitChildren(this)},De.prototype=Object.create(Te.prototype),De.prototype.constructor=De,T.DeleteExpressionContext=De,De.prototype.Delete=function(){return this.getToken(T.Delete,0)},De.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,0)},De.prototype.enterRule=function(e){e instanceof a&&e.enterDeleteExpression(this)},De.prototype.exitRule=function(e){e instanceof a&&e.exitDeleteExpression(this)},De.prototype.accept=function(e){return e instanceof l?e.visitDeleteExpression(this):e.visitChildren(this)},Re.prototype=Object.create(Te.prototype),Re.prototype.constructor=Re,T.EqualityExpressionContext=Re,Re.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(Te):this.getTypedRuleContext(Te,e)},Re.prototype.Equals=function(){return this.getToken(T.Equals,0)},Re.prototype.NotEquals=function(){return this.getToken(T.NotEquals,0)},Re.prototype.IdentityEquals=function(){return this.getToken(T.IdentityEquals,0)},Re.prototype.IdentityNotEquals=function(){return this.getToken(T.IdentityNotEquals,0)},Re.prototype.enterRule=function(e){e instanceof a&&e.enterEqualityExpression(this)},Re.prototype.exitRule=function(e){e instanceof a&&e.exitEqualityExpression(this)},Re.prototype.accept=function(e){return e instanceof l?e.visitEqualityExpression(this):e.visitChildren(this)},Ce.prototype=Object.create(Te.prototype),Ce.prototype.constructor=Ce,T.BitXOrExpressionContext=Ce,Ce.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(Te):this.getTypedRuleContext(Te,e)},Ce.prototype.BitXOr=function(){return this.getToken(T.BitXOr,0)},Ce.prototype.enterRule=function(e){e instanceof a&&e.enterBitXOrExpression(this)},Ce.prototype.exitRule=function(e){e instanceof a&&e.exitBitXOrExpression(this)},Ce.prototype.accept=function(e){return e instanceof l?e.visitBitXOrExpression(this):e.visitChildren(this)},Ne.prototype=Object.create(Te.prototype),Ne.prototype.constructor=Ne,T.MultiplicativeExpressionContext=Ne,Ne.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(Te):this.getTypedRuleContext(Te,e)},Ne.prototype.Multiply=function(){return this.getToken(T.Multiply,0)},Ne.prototype.Divide=function(){return this.getToken(T.Divide,0)},Ne.prototype.Modulus=function(){return this.getToken(T.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 l?e.visitMultiplicativeExpression(this):e.visitChildren(this)},ve.prototype=Object.create(Te.prototype),ve.prototype.constructor=ve,T.BitShiftExpressionContext=ve,ve.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(Te):this.getTypedRuleContext(Te,e)},ve.prototype.LeftShiftArithmetic=function(){return this.getToken(T.LeftShiftArithmetic,0)},ve.prototype.RightShiftArithmetic=function(){return this.getToken(T.RightShiftArithmetic,0)},ve.prototype.RightShiftLogical=function(){return this.getToken(T.RightShiftLogical,0)},ve.prototype.enterRule=function(e){e instanceof a&&e.enterBitShiftExpression(this)},ve.prototype.exitRule=function(e){e instanceof a&&e.exitBitShiftExpression(this)},ve.prototype.accept=function(e){return e instanceof l?e.visitBitShiftExpression(this):e.visitChildren(this)},$e.prototype=Object.create(Te.prototype),$e.prototype.constructor=$e,T.ParenthesizedExpressionContext=$e,$e.prototype.OpenParen=function(){return this.getToken(T.OpenParen,0)},$e.prototype.expressionSequence=function(){return this.getTypedRuleContext(ge,0)},$e.prototype.CloseParen=function(){return this.getToken(T.CloseParen,0)},$e.prototype.enterRule=function(e){e instanceof a&&e.enterParenthesizedExpression(this)},$e.prototype.exitRule=function(e){e instanceof a&&e.exitParenthesizedExpression(this)},$e.prototype.accept=function(e){return e instanceof l?e.visitParenthesizedExpression(this):e.visitChildren(this)},we.prototype=Object.create(Te.prototype),we.prototype.constructor=we,T.GetAttributeExpressionContext=we,we.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,0)},we.prototype.Dot=function(){return this.getToken(T.Dot,0)},we.prototype.identifierName=function(){return this.getTypedRuleContext(mt,0)},we.prototype.enterRule=function(e){e instanceof a&&e.enterGetAttributeExpression(this)},we.prototype.exitRule=function(e){e instanceof a&&e.exitGetAttributeExpression(this)},we.prototype.accept=function(e){return e instanceof l?e.visitGetAttributeExpression(this):e.visitChildren(this)},Fe.prototype=Object.create(Te.prototype),Fe.prototype.constructor=Fe,T.AdditiveExpressionContext=Fe,Fe.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(Te):this.getTypedRuleContext(Te,e)},Fe.prototype.Plus=function(){return this.getToken(T.Plus,0)},Fe.prototype.Minus=function(){return this.getToken(T.Minus,0)},Fe.prototype.enterRule=function(e){e instanceof a&&e.enterAdditiveExpression(this)},Fe.prototype.exitRule=function(e){e instanceof a&&e.exitAdditiveExpression(this)},Fe.prototype.accept=function(e){return e instanceof l?e.visitAdditiveExpression(this):e.visitChildren(this)},Me.prototype=Object.create(Te.prototype),Me.prototype.constructor=Me,T.RelationalExpressionContext=Me,Me.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(Te):this.getTypedRuleContext(Te,e)},Me.prototype.LessThan=function(){return this.getToken(T.LessThan,0)},Me.prototype.MoreThan=function(){return this.getToken(T.MoreThan,0)},Me.prototype.LessThanEquals=function(){return this.getToken(T.LessThanEquals,0)},Me.prototype.GreaterThanEquals=function(){return this.getToken(T.GreaterThanEquals,0)},Me.prototype.enterRule=function(e){e instanceof a&&e.enterRelationalExpression(this)},Me.prototype.exitRule=function(e){e instanceof a&&e.exitRelationalExpression(this)},Me.prototype.accept=function(e){return e instanceof l?e.visitRelationalExpression(this):e.visitChildren(this)},qe.prototype=Object.create(Te.prototype),qe.prototype.constructor=qe,T.PostIncrementExpressionContext=qe,qe.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,0)},qe.prototype.PlusPlus=function(){return this.getToken(T.PlusPlus,0)},qe.prototype.enterRule=function(e){e instanceof a&&e.enterPostIncrementExpression(this)},qe.prototype.exitRule=function(e){e instanceof a&&e.exitPostIncrementExpression(this)},qe.prototype.accept=function(e){return e instanceof l?e.visitPostIncrementExpression(this):e.visitChildren(this)},Pe.prototype=Object.create(Te.prototype),Pe.prototype.constructor=Pe,T.FuncCallExpressionContext=Pe,Pe.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,0)},Pe.prototype.arguments=function(){return this.getTypedRuleContext(me,0)},Pe.prototype.enterRule=function(e){e instanceof a&&e.enterFuncCallExpression(this)},Pe.prototype.exitRule=function(e){e instanceof a&&e.exitFuncCallExpression(this)},Pe.prototype.accept=function(e){return e instanceof l?e.visitFuncCallExpression(this):e.visitChildren(this)},Ue.prototype=Object.create(Te.prototype),Ue.prototype.constructor=Ue,T.BitNotExpressionContext=Ue,Ue.prototype.BitNot=function(){return this.getToken(T.BitNot,0)},Ue.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,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 l?e.visitBitNotExpression(this):e.visitChildren(this)},ke.prototype=Object.create(Te.prototype),ke.prototype.constructor=ke,T.NewExpressionContext=ke,ke.prototype.New=function(){return this.getToken(T.New,0)},ke.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,0)},ke.prototype.arguments=function(){return this.getTypedRuleContext(me,0)},ke.prototype.enterRule=function(e){e instanceof a&&e.enterNewExpression(this)},ke.prototype.exitRule=function(e){e instanceof a&&e.exitNewExpression(this)},ke.prototype.accept=function(e){return e instanceof l?e.visitNewExpression(this):e.visitChildren(this)},Ge.prototype=Object.create(Te.prototype),Ge.prototype.constructor=Ge,T.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 l?e.visitLiteralExpression(this):e.visitChildren(this)},He.prototype=Object.create(Te.prototype),He.prototype.constructor=He,T.ArrayLiteralExpressionContext=He,He.prototype.arrayLiteral=function(){return this.getTypedRuleContext(J,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 l?e.visitArrayLiteralExpression(this):e.visitChildren(this)},Ve.prototype=Object.create(Te.prototype),Ve.prototype.constructor=Ve,T.MemberIndexExpressionContext=Ve,Ve.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,0)},Ve.prototype.OpenBracket=function(){return this.getToken(T.OpenBracket,0)},Ve.prototype.expressionSequence=function(){return this.getTypedRuleContext(ge,0)},Ve.prototype.CloseBracket=function(){return this.getToken(T.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 l?e.visitMemberIndexExpression(this):e.visitChildren(this)},Ke.prototype=Object.create(Te.prototype),Ke.prototype.constructor=Ke,T.IdentifierExpressionContext=Ke,Ke.prototype.Identifier=function(){return this.getToken(T.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 l?e.visitIdentifierExpression(this):e.visitChildren(this)},Ye.prototype=Object.create(Te.prototype),Ye.prototype.constructor=Ye,T.BitAndExpressionContext=Ye,Ye.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(Te):this.getTypedRuleContext(Te,e)},Ye.prototype.BitAnd=function(){return this.getToken(T.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 l?e.visitBitAndExpression(this):e.visitChildren(this)},Ze.prototype=Object.create(Te.prototype),Ze.prototype.constructor=Ze,T.BitOrExpressionContext=Ze,Ze.prototype.singleExpression=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(Te):this.getTypedRuleContext(Te,e)},Ze.prototype.BitOr=function(){return this.getToken(T.BitOr,0)},Ze.prototype.enterRule=function(e){e instanceof a&&e.enterBitOrExpression(this)},Ze.prototype.exitRule=function(e){e instanceof a&&e.exitBitOrExpression(this)},Ze.prototype.accept=function(e){return e instanceof l?e.visitBitOrExpression(this):e.visitChildren(this)},We.prototype=Object.create(Te.prototype),We.prototype.constructor=We,T.AssignmentOperatorExpressionContext=We,We.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,0)},We.prototype.assignmentOperator=function(){return this.getTypedRuleContext(Qe,0)},We.prototype.expressionSequence=function(){return this.getTypedRuleContext(ge,0)},We.prototype.enterRule=function(e){e instanceof a&&e.enterAssignmentOperatorExpression(this)},We.prototype.exitRule=function(e){e instanceof a&&e.exitAssignmentOperatorExpression(this)},We.prototype.accept=function(e){return e instanceof l?e.visitAssignmentOperatorExpression(this):e.visitChildren(this)},Xe.prototype=Object.create(Te.prototype),Xe.prototype.constructor=Xe,T.VoidExpressionContext=Xe,Xe.prototype.Void=function(){return this.getToken(T.Void,0)},Xe.prototype.singleExpression=function(){return this.getTypedRuleContext(Te,0)},Xe.prototype.enterRule=function(e){e instanceof a&&e.enterVoidExpression(this)},Xe.prototype.exitRule=function(e){e instanceof a&&e.exitVoidExpression(this)},Xe.prototype.accept=function(e){return e instanceof l?e.visitVoidExpression(this):e.visitChildren(this)},T.prototype.singleExpression=function(e){void 0===e&&(e=0);var t=this._ctx,n=this.state,a=new Te(this,this._ctx,n),l=88;this.enterRecursionRule(a,88,T.RULE_singleExpression,e);var o=0;try{switch(this.enterOuterAlt(a,1),this.state=540,this._errHandler.sync(this),this._input.LA(1)){case T.Function:a=new he(this,a),this._ctx=a,this.state=495,this.match(T.Function),this.state=497,this._errHandler.sync(this),(o=this._input.LA(1))===T.Identifier&&(this.state=496,this.match(T.Identifier)),this.state=499,this.match(T.OpenParen),this.state=501,this._errHandler.sync(this),(o=this._input.LA(1))===T.Identifier&&(this.state=500,this.formalParameterList()),this.state=503,this.match(T.CloseParen),this.state=504,this.match(T.OpenBrace),this.state=505,this.functionBody(),this.state=506,this.match(T.CloseBrace);break;case T.New:a=new ke(this,a),this._ctx=a,this.state=508,this.match(T.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 T.Delete:a=new De(this,a),this._ctx=a,this.state=513,this.match(T.Delete),this.state=514,this.singleExpression(30);break;case T.Void:a=new Xe(this,a),this._ctx=a,this.state=515,this.match(T.Void),this.state=516,this.singleExpression(29);break;case T.Typeof:a=new je(this,a),this._ctx=a,this.state=517,this.match(T.Typeof),this.state=518,this.singleExpression(28);break;case T.PlusPlus:a=new de(this,a),this._ctx=a,this.state=519,this.match(T.PlusPlus),this.state=520,this.singleExpression(27);break;case T.MinusMinus:a=new Ae(this,a),this._ctx=a,this.state=521,this.match(T.MinusMinus),this.state=522,this.singleExpression(26);break;case T.Plus:a=new Ee(this,a),this._ctx=a,this.state=523,this.match(T.Plus),this.state=524,this.singleExpression(25);break;case T.Minus:a=new xe(this,a),this._ctx=a,this.state=525,this.match(T.Minus),this.state=526,this.singleExpression(24);break;case T.BitNot:a=new Ue(this,a),this._ctx=a,this.state=527,this.match(T.BitNot),this.state=528,this.singleExpression(23);break;case T.Not:a=new Le(this,a),this._ctx=a,this.state=529,this.match(T.Not),this.state=530,this.singleExpression(22);break;case T.This:a=new Ie(this,a),this._ctx=a,this.state=531,this.match(T.This);break;case T.Identifier:a=new Ke(this,a),this._ctx=a,this.state=532,this.match(T.Identifier);break;case T.RegularExpressionLiteral:case T.NullLiteral:case T.UndefinedLiteral:case T.BooleanLiteral:case T.IntegerLiteral:case T.DecimalLiteral:case T.HexIntegerLiteral:case T.OctalIntegerLiteral:case T.StringLiteral:a=new Ge(this,a),this._ctx=a,this.state=533,this.literal();break;case T.OpenBracket:a=new He(this,a),this._ctx=a,this.state=534,this.arrayLiteral();break;case T.OpenBrace:a=new fe(this,a),this._ctx=a,this.state=535,this.objectLiteral();break;case T.OpenParen:a=new $e(this,a),this._ctx=a,this.state=536,this.match(T.OpenParen),this.state=537,this.expressionSequence(),this.state=538,this.match(T.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 Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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<<T.Multiply|1<<T.Divide|1<<T.Modulus))?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume()),this.state=544,this.singleExpression(22);break;case 2:if(a=new Fe(this,new Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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))!==T.Plus&&o!==T.Minus?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume()),this.state=547,this.singleExpression(21);break;case 3:if(a=new ve(this,new Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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<<T.RightShiftArithmetic|1<<T.LeftShiftArithmetic|1<<T.RightShiftLogical))?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume()),this.state=550,this.singleExpression(20);break;case 4:if(a=new Me(this,new Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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<<T.LessThan|1<<T.MoreThan|1<<T.LessThanEquals|1<<T.GreaterThanEquals))?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume()),this.state=553,this.singleExpression(19);break;case 5:if(a=new Be(this,new Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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(T.Instanceof),this.state=556,this.singleExpression(18);break;case 6:if(a=new Se(this,new Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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(T.In),this.state=559,this.singleExpression(17);break;case 7:if(a=new Re(this,new Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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<<T.Equals-31|1<<T.NotEquals-31|1<<T.IdentityEquals-31|1<<T.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 Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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(T.BitAnd),this.state=565,this.singleExpression(15);break;case 9:if(a=new Ce(this,new Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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(T.BitXOr),this.state=568,this.singleExpression(14);break;case 10:if(a=new Ze(this,new Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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(T.BitOr),this.state=571,this.singleExpression(13);break;case 11:if(a=new ye(this,new Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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(T.And),this.state=574,this.singleExpression(12);break;case 12:if(a=new be(this,new Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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(T.Or),this.state=577,this.singleExpression(11);break;case 13:if(a=new ce(this,new Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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(T.QuestionMark),this.state=580,this.singleExpression(0),this.state=581,this.match(T.Colon),this.state=582,this.singleExpression(10);break;case 14:if(a=new Ve(this,new Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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(T.OpenBracket),this.state=586,this.expressionSequence(),this.state=587,this.match(T.CloseBracket);break;case 15:if(a=new we(this,new Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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(T.Dot),this.state=591,this.identifierName();break;case 16:if(a=new Pe(this,new Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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 qe(this,new Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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(T.LineTerminator))throw new r.error.FailedPredicateException(this,"!this.here(ECMAScriptParser.LineTerminator)");this.state=596,this.match(T.PlusPlus);break;case 18:if(a=new _e(this,new Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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(T.LineTerminator))throw new r.error.FailedPredicateException(this,"!this.here(ECMAScriptParser.LineTerminator)");this.state=599,this.match(T.MinusMinus);break;case 19:if(a=new Oe(this,new Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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(T.Assign),this.state=602,this.expressionSequence();break;case 20:if(a=new We(this,new Te(this,t,n)),this.pushNewRecursionContext(a,l,T.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},Qe.prototype=Object.create(r.ParserRuleContext.prototype),Qe.prototype.constructor=Qe,Qe.prototype.MultiplyAssign=function(){return this.getToken(T.MultiplyAssign,0)},Qe.prototype.DivideAssign=function(){return this.getToken(T.DivideAssign,0)},Qe.prototype.ModulusAssign=function(){return this.getToken(T.ModulusAssign,0)},Qe.prototype.PlusAssign=function(){return this.getToken(T.PlusAssign,0)},Qe.prototype.MinusAssign=function(){return this.getToken(T.MinusAssign,0)},Qe.prototype.LeftShiftArithmeticAssign=function(){return this.getToken(T.LeftShiftArithmeticAssign,0)},Qe.prototype.RightShiftArithmeticAssign=function(){return this.getToken(T.RightShiftArithmeticAssign,0)},Qe.prototype.RightShiftLogicalAssign=function(){return this.getToken(T.RightShiftLogicalAssign,0)},Qe.prototype.BitAndAssign=function(){return this.getToken(T.BitAndAssign,0)},Qe.prototype.BitXorAssign=function(){return this.getToken(T.BitXorAssign,0)},Qe.prototype.BitOrAssign=function(){return this.getToken(T.BitOrAssign,0)},Qe.prototype.enterRule=function(e){e instanceof a&&e.enterAssignmentOperator(this)},Qe.prototype.exitRule=function(e){e instanceof a&&e.exitAssignmentOperator(this)},Qe.prototype.accept=function(e){return e instanceof l?e.visitAssignmentOperator(this):e.visitChildren(this)},T.AssignmentOperatorContext=Qe,T.prototype.assignmentOperator=function(){var e=new Qe(this,this._ctx,this.state);this.enterRule(e,90,T.RULE_assignmentOperator);var t=0;try{this.enterOuterAlt(e,1),this.state=612,(t=this._input.LA(1))-40&-32||!(1<<t-40&(1<<T.MultiplyAssign-40|1<<T.DivideAssign-40|1<<T.ModulusAssign-40|1<<T.PlusAssign-40|1<<T.MinusAssign-40|1<<T.LeftShiftArithmeticAssign-40|1<<T.RightShiftArithmeticAssign-40|1<<T.RightShiftLogicalAssign-40|1<<T.BitAndAssign-40|1<<T.BitXorAssign-40|1<<T.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)},Je.prototype=Object.create(ze.prototype),Je.prototype.constructor=Je,T.NumericLiteralWrapperContext=Je,Je.prototype.numericLiteral=function(){return this.getTypedRuleContext(lt,0)},Je.prototype.enterRule=function(e){e instanceof a&&e.enterNumericLiteralWrapper(this)},Je.prototype.exitRule=function(e){e instanceof a&&e.exitNumericLiteralWrapper(this)},Je.prototype.accept=function(e){return e instanceof l?e.visitNumericLiteralWrapper(this):e.visitChildren(this)},et.prototype=Object.create(ze.prototype),et.prototype.constructor=et,T.UndefinedLiteralContext=et,et.prototype.UndefinedLiteral=function(){return this.getToken(T.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 l?e.visitUndefinedLiteral(this):e.visitChildren(this)},tt.prototype=Object.create(ze.prototype),tt.prototype.constructor=tt,T.StringLiteralContext=tt,tt.prototype.StringLiteral=function(){return this.getToken(T.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 l?e.visitStringLiteral(this):e.visitChildren(this)},nt.prototype=Object.create(ze.prototype),nt.prototype.constructor=nt,T.RegularExpressionLiteralContext=nt,nt.prototype.RegularExpressionLiteral=function(){return this.getToken(T.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 l?e.visitRegularExpressionLiteral(this):e.visitChildren(this)},rt.prototype=Object.create(ze.prototype),rt.prototype.constructor=rt,T.BooleanLiteralContext=rt,rt.prototype.BooleanLiteral=function(){return this.getToken(T.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 l?e.visitBooleanLiteral(this):e.visitChildren(this)},at.prototype=Object.create(ze.prototype),at.prototype.constructor=at,T.NullLiteralContext=at,at.prototype.NullLiteral=function(){return this.getToken(T.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 l?e.visitNullLiteral(this):e.visitChildren(this)},T.LiteralContext=ze,T.prototype.literal=function(){var e=new ze(this,this._ctx,this.state);this.enterRule(e,92,T.RULE_literal);try{switch(this.state=620,this._errHandler.sync(this),this._input.LA(1)){case T.NullLiteral:e=new at(this,e),this.enterOuterAlt(e,1),this.state=614,this.match(T.NullLiteral);break;case T.UndefinedLiteral:e=new et(this,e),this.enterOuterAlt(e,2),this.state=615,this.match(T.UndefinedLiteral);break;case T.BooleanLiteral:e=new rt(this,e),this.enterOuterAlt(e,3),this.state=616,this.match(T.BooleanLiteral);break;case T.StringLiteral:e=new tt(this,e),this.enterOuterAlt(e,4),this.state=617,this.match(T.StringLiteral);break;case T.RegularExpressionLiteral:e=new nt(this,e),this.enterOuterAlt(e,5),this.state=618,this.match(T.RegularExpressionLiteral);break;case T.IntegerLiteral:case T.DecimalLiteral:case T.HexIntegerLiteral:case T.OctalIntegerLiteral:e=new Je(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},lt.prototype=Object.create(r.ParserRuleContext.prototype),lt.prototype.constructor=lt,lt.prototype.copyFrom=function(e){r.ParserRuleContext.prototype.copyFrom.call(this,e)},ot.prototype=Object.create(lt.prototype),ot.prototype.constructor=ot,T.HexIntegerLiteralContext=ot,ot.prototype.HexIntegerLiteral=function(){return this.getToken(T.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 l?e.visitHexIntegerLiteral(this):e.visitChildren(this)},st.prototype=Object.create(lt.prototype),st.prototype.constructor=st,T.OctalIntegerLiteralContext=st,st.prototype.OctalIntegerLiteral=function(){return this.getToken(T.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 l?e.visitOctalIntegerLiteral(this):e.visitChildren(this)},it.prototype=Object.create(lt.prototype),it.prototype.constructor=it,T.DecimalLiteralContext=it,it.prototype.DecimalLiteral=function(){return this.getToken(T.DecimalLiteral,0)},it.prototype.enterRule=function(e){e instanceof a&&e.enterDecimalLiteral(this)},it.prototype.exitRule=function(e){e instanceof a&&e.exitDecimalLiteral(this)},it.prototype.accept=function(e){return e instanceof l?e.visitDecimalLiteral(this):e.visitChildren(this)},pt.prototype=Object.create(lt.prototype),pt.prototype.constructor=pt,T.IntegerLiteralContext=pt,pt.prototype.IntegerLiteral=function(){return this.getToken(T.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 l?e.visitIntegerLiteral(this):e.visitChildren(this)},T.NumericLiteralContext=lt,T.prototype.numericLiteral=function(){var e=new lt(this,this._ctx,this.state);this.enterRule(e,94,T.RULE_numericLiteral);try{switch(this.state=626,this._errHandler.sync(this),this._input.LA(1)){case T.IntegerLiteral:e=new pt(this,e),this.enterOuterAlt(e,1),this.state=622,this.match(T.IntegerLiteral);break;case T.DecimalLiteral:e=new it(this,e),this.enterOuterAlt(e,2),this.state=623,this.match(T.DecimalLiteral);break;case T.HexIntegerLiteral:e=new ot(this,e),this.enterOuterAlt(e,3),this.state=624,this.match(T.HexIntegerLiteral);break;case T.OctalIntegerLiteral:e=new st(this,e),this.enterOuterAlt(e,4),this.state=625,this.match(T.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},mt.prototype=Object.create(r.ParserRuleContext.prototype),mt.prototype.constructor=mt,mt.prototype.Identifier=function(){return this.getToken(T.Identifier,0)},mt.prototype.reservedWord=function(){return this.getTypedRuleContext(ut,0)},mt.prototype.enterRule=function(e){e instanceof a&&e.enterIdentifierName(this)},mt.prototype.exitRule=function(e){e instanceof a&&e.exitIdentifierName(this)},mt.prototype.accept=function(e){return e instanceof l?e.visitIdentifierName(this):e.visitChildren(this)},T.IdentifierNameContext=mt,T.prototype.identifierName=function(){var e=new mt(this,this._ctx,this.state);this.enterRule(e,96,T.RULE_identifierName);try{switch(this.state=630,this._errHandler.sync(this),this._input.LA(1)){case T.Identifier:this.enterOuterAlt(e,1),this.state=628,this.match(T.Identifier);break;case T.NullLiteral:case T.BooleanLiteral:case T.Break:case T.Do:case T.Instanceof:case T.Typeof:case T.Case:case T.Else:case T.New:case T.Var:case T.Catch:case T.Finally:case T.Return:case T.Void:case T.Continue:case T.For:case T.Switch:case T.While:case T.Debugger:case T.Function:case T.This:case T.With:case T.Default:case T.If:case T.Throw:case T.Delete:case T.In:case T.Try:case T.Class:case T.Enum:case T.Extends:case T.Super:case T.Const:case T.Export:case T.Import:case T.Implements:case T.Let:case T.Private:case T.Public:case T.Interface:case T.Package:case T.Protected:case T.Static:case T.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},ut.prototype=Object.create(r.ParserRuleContext.prototype),ut.prototype.constructor=ut,ut.prototype.keyword=function(){return this.getTypedRuleContext(gt,0)},ut.prototype.futureReservedWord=function(){return this.getTypedRuleContext(Tt,0)},ut.prototype.NullLiteral=function(){return this.getToken(T.NullLiteral,0)},ut.prototype.BooleanLiteral=function(){return this.getToken(T.BooleanLiteral,0)},ut.prototype.enterRule=function(e){e instanceof a&&e.enterReservedWord(this)},ut.prototype.exitRule=function(e){e instanceof a&&e.exitReservedWord(this)},ut.prototype.accept=function(e){return e instanceof l?e.visitReservedWord(this):e.visitChildren(this)},T.ReservedWordContext=ut,T.prototype.reservedWord=function(){var e=new ut(this,this._ctx,this.state);this.enterRule(e,98,T.RULE_reservedWord);var t=0;try{switch(this.state=635,this._errHandler.sync(this),this._input.LA(1)){case T.Break:case T.Do:case T.Instanceof:case T.Typeof:case T.Case:case T.Else:case T.New:case T.Var:case T.Catch:case T.Finally:case T.Return:case T.Void:case T.Continue:case T.For:case T.Switch:case T.While:case T.Debugger:case T.Function:case T.This:case T.With:case T.Default:case T.If:case T.Throw:case T.Delete:case T.In:case T.Try:this.enterOuterAlt(e,1),this.state=632,this.keyword();break;case T.Class:case T.Enum:case T.Extends:case T.Super:case T.Const:case T.Export:case T.Import:case T.Implements:case T.Let:case T.Private:case T.Public:case T.Interface:case T.Package:case T.Protected:case T.Static:case T.Yield:this.enterOuterAlt(e,2),this.state=633,this.futureReservedWord();break;case T.NullLiteral:case T.BooleanLiteral:this.enterOuterAlt(e,3),this.state=634,(t=this._input.LA(1))!==T.NullLiteral&&t!==T.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},gt.prototype=Object.create(r.ParserRuleContext.prototype),gt.prototype.constructor=gt,gt.prototype.Break=function(){return this.getToken(T.Break,0)},gt.prototype.Do=function(){return this.getToken(T.Do,0)},gt.prototype.Instanceof=function(){return this.getToken(T.Instanceof,0)},gt.prototype.Typeof=function(){return this.getToken(T.Typeof,0)},gt.prototype.Case=function(){return this.getToken(T.Case,0)},gt.prototype.Else=function(){return this.getToken(T.Else,0)},gt.prototype.New=function(){return this.getToken(T.New,0)},gt.prototype.Var=function(){return this.getToken(T.Var,0)},gt.prototype.Catch=function(){return this.getToken(T.Catch,0)},gt.prototype.Finally=function(){return this.getToken(T.Finally,0)},gt.prototype.Return=function(){return this.getToken(T.Return,0)},gt.prototype.Void=function(){return this.getToken(T.Void,0)},gt.prototype.Continue=function(){return this.getToken(T.Continue,0)},gt.prototype.For=function(){return this.getToken(T.For,0)},gt.prototype.Switch=function(){return this.getToken(T.Switch,0)},gt.prototype.While=function(){return this.getToken(T.While,0)},gt.prototype.Debugger=function(){return this.getToken(T.Debugger,0)},gt.prototype.Function=function(){return this.getToken(T.Function,0)},gt.prototype.This=function(){return this.getToken(T.This,0)},gt.prototype.With=function(){return this.getToken(T.With,0)},gt.prototype.Default=function(){return this.getToken(T.Default,0)},gt.prototype.If=function(){return this.getToken(T.If,0)},gt.prototype.Throw=function(){return this.getToken(T.Throw,0)},gt.prototype.Delete=function(){return this.getToken(T.Delete,0)},gt.prototype.In=function(){return this.getToken(T.In,0)},gt.prototype.Try=function(){return this.getToken(T.Try,0)},gt.prototype.enterRule=function(e){e instanceof a&&e.enterKeyword(this)},gt.prototype.exitRule=function(e){e instanceof a&&e.exitKeyword(this)},gt.prototype.accept=function(e){return e instanceof l?e.visitKeyword(this):e.visitChildren(this)},T.KeywordContext=gt,T.prototype.keyword=function(){var e=new gt(this,this._ctx,this.state);this.enterRule(e,100,T.RULE_keyword);var t=0;try{this.enterOuterAlt(e,1),this.state=637,(t=this._input.LA(1))-58&-32||!(1<<t-58&(1<<T.Break-58|1<<T.Do-58|1<<T.Instanceof-58|1<<T.Typeof-58|1<<T.Case-58|1<<T.Else-58|1<<T.New-58|1<<T.Var-58|1<<T.Catch-58|1<<T.Finally-58|1<<T.Return-58|1<<T.Void-58|1<<T.Continue-58|1<<T.For-58|1<<T.Switch-58|1<<T.While-58|1<<T.Debugger-58|1<<T.Function-58|1<<T.This-58|1<<T.With-58|1<<T.Default-58|1<<T.If-58|1<<T.Throw-58|1<<T.Delete-58|1<<T.In-58|1<<T.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},Tt.prototype=Object.create(r.ParserRuleContext.prototype),Tt.prototype.constructor=Tt,Tt.prototype.Class=function(){return this.getToken(T.Class,0)},Tt.prototype.Enum=function(){return this.getToken(T.Enum,0)},Tt.prototype.Extends=function(){return this.getToken(T.Extends,0)},Tt.prototype.Super=function(){return this.getToken(T.Super,0)},Tt.prototype.Const=function(){return this.getToken(T.Const,0)},Tt.prototype.Export=function(){return this.getToken(T.Export,0)},Tt.prototype.Import=function(){return this.getToken(T.Import,0)},Tt.prototype.Implements=function(){return this.getToken(T.Implements,0)},Tt.prototype.Let=function(){return this.getToken(T.Let,0)},Tt.prototype.Private=function(){return this.getToken(T.Private,0)},Tt.prototype.Public=function(){return this.getToken(T.Public,0)},Tt.prototype.Interface=function(){return this.getToken(T.Interface,0)},Tt.prototype.Package=function(){return this.getToken(T.Package,0)},Tt.prototype.Protected=function(){return this.getToken(T.Protected,0)},Tt.prototype.Static=function(){return this.getToken(T.Static,0)},Tt.prototype.Yield=function(){return this.getToken(T.Yield,0)},Tt.prototype.enterRule=function(e){e instanceof a&&e.enterFutureReservedWord(this)},Tt.prototype.exitRule=function(e){e instanceof a&&e.exitFutureReservedWord(this)},Tt.prototype.accept=function(e){return e instanceof l?e.visitFutureReservedWord(this):e.visitChildren(this)},T.FutureReservedWordContext=Tt,T.prototype.futureReservedWord=function(){var e=new Tt(this,this._ctx,this.state);this.enterRule(e,102,T.RULE_futureReservedWord);var t=0;try{this.enterOuterAlt(e,1),this.state=639,(t=this._input.LA(1))-84&-32||!(1<<t-84&(1<<T.Class-84|1<<T.Enum-84|1<<T.Extends-84|1<<T.Super-84|1<<T.Const-84|1<<T.Export-84|1<<T.Import-84|1<<T.Implements-84|1<<T.Let-84|1<<T.Private-84|1<<T.Public-84|1<<T.Interface-84|1<<T.Package-84|1<<T.Protected-84|1<<T.Static-84|1<<T.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},ct.prototype=Object.create(r.ParserRuleContext.prototype),ct.prototype.constructor=ct,ct.prototype.Identifier=function(){return this.getToken(T.Identifier,0)},ct.prototype.propertyName=function(){return this.getTypedRuleContext(ie,0)},ct.prototype.enterRule=function(e){e instanceof a&&e.enterGetter(this)},ct.prototype.exitRule=function(e){e instanceof a&&e.exitGetter(this)},ct.prototype.accept=function(e){return e instanceof l?e.visitGetter(this):e.visitChildren(this)},T.GetterContext=ct,T.prototype.getter=function(){var e=new ct(this,this._ctx,this.state);this.enterRule(e,104,T.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(T.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},yt.prototype=Object.create(r.ParserRuleContext.prototype),yt.prototype.constructor=yt,yt.prototype.Identifier=function(){return this.getToken(T.Identifier,0)},yt.prototype.propertyName=function(){return this.getTypedRuleContext(ie,0)},yt.prototype.enterRule=function(e){e instanceof a&&e.enterSetter(this)},yt.prototype.exitRule=function(e){e instanceof a&&e.exitSetter(this)},yt.prototype.accept=function(e){return e instanceof l?e.visitSetter(this):e.visitChildren(this)},T.SetterContext=yt,T.prototype.setter=function(){var e=new yt(this,this._ctx,this.state);this.enterRule(e,106,T.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(T.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},ht.prototype=Object.create(r.ParserRuleContext.prototype),ht.prototype.constructor=ht,ht.prototype.SemiColon=function(){return this.getToken(T.SemiColon,0)},ht.prototype.EOF=function(){return this.getToken(T.EOF,0)},ht.prototype.enterRule=function(e){e instanceof a&&e.enterEos(this)},ht.prototype.exitRule=function(e){e instanceof a&&e.exitEos(this)},ht.prototype.accept=function(e){return e instanceof l?e.visitEos(this):e.visitChildren(this)},T.EosContext=ht,T.prototype.eos=function(){var e=new ht(this,this._ctx,this.state);this.enterRule(e,108,T.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(T.SemiColon);break;case 2:this.enterOuterAlt(e,2),this.state=650,this.match(T.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!=T.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(T.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 l?e.visitEof(this):e.visitChildren(this)},T.EofContext=dt,T.prototype.eof=function(){var e=new dt(this,this._ctx,this.state);this.enterRule(e,110,T.RULE_eof);try{this.enterOuterAlt(e,1),this.state=655,this.match(T.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.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}},T.prototype.continueStatement_sempred=function(e,t){if(0===t)return!this.here(T.LineTerminator);throw"No predicate with index:"+t},T.prototype.breakStatement_sempred=function(e,t){if(1===t)return!this.here(T.LineTerminator);throw"No predicate with index:"+t},T.prototype.returnStatement_sempred=function(e,t){if(2===t)return!this.here(T.LineTerminator);throw"No predicate with index:"+t},T.prototype.throwStatement_sempred=function(e,t){if(3===t)return!this.here(T.LineTerminator);throw"No predicate with index:"+t},T.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(T.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}},T.prototype.getter_sempred=function(e,t){if(26===t)return this._input.LT(1).text.startsWith("get");throw"No predicate with index:"+t},T.prototype.setter_sempred=function(e,t){if(27===t)return this._input.LT(1).text.startsWith("set");throw"No predicate with index:"+t},T.prototype.eos_sempred=function(e,t){switch(t){case 28:return this.lineTerminatorAhead();case 29:return this._input.LT(1).type==T.CloseBrace;default:throw"No predicate with index:"+t}},t.ECMAScriptParser=T},13626:(e,t,n)=>{n.d(t,{xb:()=>T.xb});var r=n(33670),a=n(95815),l=n(30942);function o(e,t){return e.type===t}n(29250),n(52034),n(86864),n(55341),n(34992),n(73426),n(91686),n(38220),n(63530),n(95468),n(58579),n(11825),n(63447),n(67458),n(98555),n(6993);let s=function(e){return e.RestoringStart="atlas-service/atlas-signin/StartRestoring",e.RestoringFailed="atlas-service/atlas-signin/RestoringFailed",e.RestoringSuccess="atlas-service/atlas-signin/RestoringSuccess",e.AttemptStart="atlas-service/atlas-signin/AttemptStart",e.AttemptEnd="atlas-service/atlas-signin/AttemptEnd",e.Start="atlas-service/atlas-signin/AtlasSignInStart",e.Success="atlas-service/atlas-signin/AtlasSignInSuccess",e.Error="atlas-service/atlas-signin/AtlasSignInError",e.Cancel="atlas-service/atlas-signin/AtlasSignInCancel",e.TokenRefreshFailed="atlas-service/atlas-signin/TokenRefreshFailed",e.SignedOut="atlas-service/atlas-signin/SignedOut",e}({});const i={state:"initial",userInfo:null,error:null,isModalOpen:!1,currentAttemptId:null};new Map;const p=(e={...i},t)=>o(t,s.RestoringStart)?{...e,userInfo:null,state:"restoring"}:o(t,s.RestoringSuccess)?"restoring"!==e.state?e:{...e,state:"success",userInfo:t.userInfo,error:null}:o(t,s.RestoringFailed)?"restoring"!==e.state?e:{...e,state:"unauthenticated",userInfo:null}:o(t,s.AttemptStart)?{...e,currentAttemptId:t.id}:o(t,s.AttemptEnd)?{...e,currentAttemptId:null}:o(t,s.Start)?{...e,state:"in-progress",userInfo:null}:o(t,s.Success)?{...e,state:"success",userInfo:t.userInfo,error:null,isModalOpen:!1}:o(t,s.Error)?{...e,state:"error",userInfo:null,error:t.error,isModalOpen:!1}:o(t,s.Cancel)?{...i,state:"canceled"}:o(t,s.TokenRefreshFailed)?"success"!==e.state?e:{...i,state:"error"}:o(t,s.SignedOut)?{...i}:e;var m=n(50207);let u;var g=n(71901),T=n(38686);n(52612),(0,r.nk)({name:"AtlasAuth",component:()=>null,activate:function(e,t,{on:n,cleanup:r}){u=function({atlasAuthService:e}){return(0,a.y$)(p,(0,a.Tw)(l.A.withExtraArgument({atlasAuthService:e})))}(t);return m.ipcRenderer&&(n(m.ipcRenderer,"atlas-service-token-refresh-failed",(()=>u.dispatch(((e,t,{atlasAuthService:n})=>{e({type:s.TokenRefreshFailed}),n.emit("token-refresh-failed")})))),n(m.ipcRenderer,"atlas-service-signed-out",(()=>u.dispatch(((e,t,{atlasAuthService:n})=>{e({type:s.SignedOut}),n.emit("signed-out")}))))),u.dispatch((async(e,t,{atlasAuthService:n})=>{if("initial"===t().state){e({type:s.RestoringStart});try{if(await n.isAuthenticated()){const t=await n.getUserInfo();e({type:s.RestoringSuccess,userInfo:t})}else e({type:s.RestoringFailed})}catch{e({type:s.RestoringFailed})}}})),{store:u,deactivate:r}}},{atlasAuthService:g.L1})},17644: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# 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: !!js/function &EqualitySyntaxTemplate >\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: !!js/function &InSyntaxTemplate >\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: !!js/function &AndSyntaxTemplate >\n (args) => {\n return args.join(\' && \');\n }\n OrSyntaxTemplate: !!js/function &OrSyntaxTemplate >\n (args) => {\n return args.join(\' || \');\n }\n NotSyntaxTemplate: !!js/function &NotSyntaxTemplate >\n (arg) => {\n return `!${arg}`;\n }\n UnarySyntaxTemplate: &UnarySyntaxTemplate null\n BinarySyntaxTemplate: !!js/function &BinarySyntaxTemplate >\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: !!js/function &NewSyntaxTemplate >\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: !!js/function &StringTypeTemplate >\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: !!js/function &RegexTypeTemplate >\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: !!js/function &BoolTypeTemplate >\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: !!js/function &OctalTypeTemplate >\n (literal) => {\n literal = literal.replace(/[oO]+/g, \'0\')\n return parseInt(literal, 8).toString()\n }\n NumericTypeTemplate: &NumericTypeTemplate null\n ArrayTypeTemplate: !!js/function &ArrayTypeTemplate >\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: !!js/function &ArrayTypeArgsTemplate >\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: !!js/function &NullTypeTemplate >\n () => {\n return \'BsonNull.Value\';\n }\n UndefinedTypeTemplate: !!js/function &UndefinedTypeTemplate >\n () => {\n return \'BsonUndefined.Value\';\n }\n ObjectTypeTemplate: !!js/function &ObjectTypeTemplate >\n (literal) => {\n if (literal === \'\') {\n return `new BsonDocument()`;\n }\n return literal;\n }\n ObjectTypeArgsTemplate: !!js/function &ObjectTypeArgsTemplate >\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: !!js/function &CodeCodeTemplate >\n (lhs) => {\n return `${lhs}.Code`;\n }\n CodeCodeArgsTemplate: &CodeCodeArgsTemplate null\n CodeScopeTemplate: !!js/function &CodeScopeTemplate >\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: !!js/function &ObjectIdToStringTemplate >\n (lhs) => {\n return `${lhs}.ToString()`;\n }\n ObjectIdToStringArgsTemplate: !!js/function &ObjectIdToStringArgsTemplate >\n () => {\n return \'\';\n }\n ObjectIdEqualsTemplate: !!js/function &ObjectIdEqualsTemplate >\n (lhs) => {\n return `${lhs}.Equals`;\n }\n ObjectIdEqualsArgsTemplate: !!js/function &ObjectIdEqualsArgsTemplate >\n (lhs, arg) => {\n if (arg.indexOf(\'new\') === 0) {\n arg = arg.replace(/new /g, \'\')\n }\n return `(new ${arg})`;\n }\n\n ObjectIdGetTimestampTemplate: !!js/function &ObjectIdGetTimestampTemplate >\n (lhs) => {\n return `${lhs}.Timestamp`;\n }\n ObjectIdGetTimestampArgsTemplate:\n !!js/function &ObjectIdGetTimestampArgsTemplate >\n (lhs) => {\n return \'\';\n }\n BinaryValueTemplate: !!js/function &BinaryValueTemplate >\n (lhs) => {\n return `${lhs}.ToString`;\n }\n BinaryValueArgsTemplate: &BinaryValueArgsTemplate null\n BinaryLengthTemplate: !!js/function &BinaryLengthTemplate >\n () => {\n return \'\';\n }\n BinaryLengthArgsTemplate: !!js/function &BinaryLengthArgsTemplate >\n (lhs) => {\n return `${lhs}.Bytes.Length`;\n }\n BinaryToStringTemplate: !!js/function &BinaryToStringTemplate >\n (lhs) => {\n return `${lhs}.ToString`;\n }\n BinaryToStringArgsTemplate: &BinaryToStringArgsTemplate null\n BinarySubtypeTemplate: !!js/function &BinarySubtypeTemplate >\n (lhs) => {\n return `${lhs}.SubType`;\n }\n BinarySubtypeArgsTemplate: !!js/function &BinarySubtypeArgsTemplate >\n () => {\n return \'\';\n }\n DBRefGetDBTemplate: !!js/function &DBRefGetDBTemplate >\n (lhs) => {\n return `${lhs}.DatabaseName`;\n }\n DBRefGetDBArgsTemplate: !!js/function &DBRefGetDBArgsTemplate >\n () => {\n return \'\';\n }\n DBRefGetCollectionTemplate: !!js/function &DBRefGetCollectionTemplate >\n (lhs) => {\n return `${lhs}.CollectionName`;\n }\n DBRefGetCollectionArgsTemplate:\n !!js/function &DBRefGetCollectionArgsTemplate >\n () => {\n return \'\';\n }\n DBRefGetIdTemplate: !!js/function &DBRefGetIdTemplate >\n (lhs) => {\n return `${lhs}.Id`;\n }\n DBRefGetIdArgsTemplate: !!js/function &DBRefGetIdArgsTemplate >\n () => {\n return \'\';\n }\n LongEqualsTemplate: !!js/function &LongEqualsTemplate >\n (lhs) => {\n return `${lhs} == `;\n }\n LongEqualsArgsTemplate: !!js/function &LongEqualsArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n LongToIntTemplate: !!js/function &LongToIntTemplate >\n (lhs) => {\n return `(int) ${lhs}`;\n }\n LongToIntArgsTemplate: !!js/function &LongToIntArgsTemplate >\n () => {\n return \'\';\n }\n LongToStringTemplate: !!js/function &LongToStringTemplate >\n (lhs) => {\n return lhs;\n }\n LongToStringArgsTemplate: &LongToStringArgsTemplate null\n LongToNumberTemplate: !!js/function &LongToNumberTemplate >\n (lhs) => {\n return `(double) ${lhs}`;\n }\n LongToNumberArgsTemplate: !!js/function &LongToNumberArgsTemplate >\n () => {\n return \'\';\n }\n LongAddTemplate: !!js/function &LongAddTemplate >\n (lhs) => {\n return `${lhs} +`;\n }\n LongAddArgsTemplate: !!js/function &LongAddArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongSubtractTemplate: !!js/function &LongSubtractTemplate >\n (lhs) => {\n return `${lhs} -`;\n }\n LongSubtractArgsTemplate: !!js/function &LongSubtractArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongMultiplyTemplate: !!js/function &LongMultiplyTemplate >\n (lhs) => {\n return `${lhs} *`;\n }\n LongMultiplyArgsTemplate: !!js/function &LongMultiplyArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongDivTemplate: !!js/function &LongDivTemplate >\n (lhs) => {\n return `${lhs} /`;\n }\n LongDivArgsTemplate: !!js/function &LongDivArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongModuloTemplate: !!js/function &LongModuloTemplate >\n (lhs) => {\n return `${lhs} %`;\n }\n LongModuloArgsTemplate: !!js/function &LongModuloArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongAndTemplate: !!js/function &LongAndTemplate >\n (lhs) => {\n return `${lhs} &`;\n }\n LongAndArgsTemplate: !!js/function &LongAndArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongOrTemplate: !!js/function &LongOrTemplate >\n (lhs) => {\n return `${lhs} |`;\n }\n LongOrArgsTemplate: !!js/function &LongOrArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongXorTemplate: !!js/function &LongXorTemplate >\n (lhs) => {\n return `${lhs} ^`;\n }\n LongXorArgsTemplate: !!js/function &LongXorArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongShiftLeftTemplate: !!js/function &LongShiftLeftTemplate >\n (lhs) => {\n return `${lhs} <<`;\n }\n LongShiftLeftArgsTemplate: !!js/function &LongShiftLeftArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongShiftRightTemplate: !!js/function &LongShiftRightTemplate >\n (lhs) => {\n return `${lhs} >>`;\n }\n LongShiftRightArgsTemplate: !!js/function &LongShiftRightArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongCompareTemplate: !!js/function &LongCompareTemplate >\n (lhs) => {\n return `${lhs} - `;\n }\n LongCompareArgsTemplate: !!js/function &LongCompareArgsTemplate >\n (lhs, arg) => {\n return arg;\n }\n LongIsOddTemplate: !!js/function &LongIsOddTemplate >\n (lhs) => {\n return `${lhs}`;\n }\n LongIsOddArgsTemplate: !!js/function &LongIsOddArgsTemplate >\n () => {\n return \' % 2 == 1\';\n }\n LongIsZeroTemplate: !!js/function &LongIsZeroTemplate >\n (lhs) => {\n return `${lhs} == 0`;\n }\n LongIsZeroArgsTemplate: !!js/function &LongIsZeroArgsTemplate >\n () => {\n return \'\';\n }\n LongIsNegativeTemplate: !!js/function &LongIsNegativeTemplate >\n (lhs) => {\n return `${lhs} < 0`;\n }\n LongIsNegativeArgsTemplate: !!js/function &LongIsNegativeArgsTemplate >\n () => {\n return \'\';\n }\n LongNegateTemplate: !!js/function &LongNegateTemplate >\n () => {\n return \'-\';\n }\n LongNegateArgsTemplate: !!js/function &LongNegateArgsTemplate >\n (lhs) => {\n return `${lhs}`;\n }\n LongNotTemplate: !!js/function &LongNotTemplate >\n () => {\n return \'~\';\n }\n LongNotArgsTemplate: !!js/function &LongNotArgsTemplate >\n (lhs) => {\n return `${lhs}`;\n }\n LongNotEqualsTemplate: !!js/function &LongNotEqualsTemplate >\n (lhs) => {\n return `${lhs} !=`;\n }\n LongNotEqualsArgsTemplate: !!js/function &LongNotEqualsArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanTemplate: !!js/function &LongGreaterThanTemplate >\n (lhs) => {\n return `${lhs} >`;\n }\n LongGreaterThanArgsTemplate: !!js/function &LongGreaterThanArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanOrEqualTemplate:\n !!js/function &LongGreaterThanOrEqualTemplate >\n (lhs) => {\n return `${lhs} >=`;\n }\n LongGreaterThanOrEqualArgsTemplate:\n !!js/function &LongGreaterThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanTemplate: !!js/function &LongLessThanTemplate >\n (lhs) => {\n return `${lhs} <`;\n }\n LongLessThanArgsTemplate: !!js/function &LongLessThanArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanOrEqualTemplate: !!js/function &LongLessThanOrEqualTemplate >\n (lhs) => {\n return `${lhs} <=`;\n }\n LongLessThanOrEqualArgsTemplate:\n !!js/function &LongLessThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongFloatApproxTemplate: !!js/function &LongFloatApproxTemplate >\n (lhs) => {\n return `(float) ${lhs}`;\n }\n LongTopTemplate: !!js/function &LongTopTemplate >\n (lhs) => {\n return `${lhs} >> 32`;\n }\n LongBottomTemplate: !!js/function &LongBottomTemplate >\n (lhs) => {\n return `${lhs} & 0x0000ffff`;\n }\n TimestampToStringTemplate: !!js/function &TimestampToStringTemplate >\n (lhs) => {\n return `${lhs}.ToString`;\n }\n TimestampToStringArgsTemplate: &TimestampToStringArgsTemplate null\n TimestampEqualsTemplate: !!js/function &TimestampEqualsTemplate >\n (lhs) => {\n return `${lhs}.Equals`;\n }\n TimestampEqualsArgsTemplate: &TimestampEqualsArgsTemplate null\n TimestampGetLowBitsTemplate: !!js/function &TimestampGetLowBitsTemplate >\n (lhs) => {\n return `${lhs}.ToUniversalTime`;\n }\n TimestampGetLowBitsArgsTemplate: &TimestampGetLowBitsArgsTemplate null\n TimestampGetHighBitsTemplate: !!js/function &TimestampGetHighBitsTemplate >\n (lhs) => {\n return `${lhs}.Increment`;\n }\n TimestampGetHighBitsArgsTemplate:\n !!js/function &TimestampGetHighBitsArgsTemplate >\n (lhs) => {\n return \'\';\n }\n TimestampTTemplate: !!js/function &TimestampTTemplate >\n (lhs) => {\n return `${lhs}.ToUniversalTime()`;\n }\n TimestampITemplate: !!js/function &TimestampITemplate >\n (lhs) => {\n return `${lhs}.Increment`;\n }\n TimestampAsDateTemplate: !!js/function &TimestampAsDateTemplate >\n (lhs) => {\n return `new DateTime(1970, 1, 1).AddSeconds(${lhs}.Timestamp)`;\n }\n TimestampAsDateArgsTemplate: !!js/function &TimestampAsDateArgsTemplate >\n () => {\n return \'\';\n }\n TimestampCompareTemplate: !!js/function &TimestampCompareTemplate >\n (lhs) => {\n return `${lhs}.CompareTo`;\n }\n TimestampCompareArgsTemplate: &TimestampCompareArgsTemplate null\n TimestampNotEqualsTemplate: !!js/function &TimestampNotEqualsTemplate >\n (lhs) => {\n return `${lhs} != `;\n }\n TimestampNotEqualsArgsTemplate:\n !!js/function &TimestampNotEqualsArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampGreaterThanTemplate: !!js/function &TimestampGreaterThanTemplate >\n (lhs) => {\n return `${lhs} > `;\n }\n TimestampGreaterThanArgsTemplate:\n !!js/function &TimestampGreaterThanArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampGreaterThanOrEqualTemplate:\n !!js/function &TimestampGreaterThanOrEqualTemplate >\n (lhs) => {\n return `${lhs} >= `;\n }\n TimestampGreaterThanOrEqualArgsTemplate:\n !!js/function &TimestampGreaterThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampLessThanTemplate: !!js/function &TimestampLessThanTemplate >\n (lhs) => {\n return `${lhs} < `;\n }\n TimestampLessThanArgsTemplate: !!js/function &TimestampLessThanArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampLessThanOrEqualTemplate:\n !!js/function &TimestampLessThanOrEqualTemplate >\n (lhs) => {\n return `${lhs} <= `;\n }\n TimestampLessThanOrEqualArgsTemplate:\n !!js/function &TimestampLessThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n SymbolValueOfTemplate: !!js/function &SymbolValueOfTemplate >\n (lhs) => {\n return `${lhs}`;\n }\n SymbolValueOfArgsTemplate: !!js/function &SymbolValueOfArgsTemplate >\n () => {\n return \'\';\n }\n SymbolInspectTemplate: !!js/function &SymbolInspectTemplate >\n (lhs) => {\n return `${lhs}`;\n }\n SymbolInspectArgsTemplate: !!js/function &SymbolInspectArgsTemplate >\n () => {\n return \'\';\n }\n SymbolToStringTemplate: !!js/function &SymbolToStringTemplate >\n (lhs) => {\n return `${lhs}`;\n }\n SymbolToStringArgsTemplate: !!js/function &SymbolToStringArgsTemplate >\n () => {\n return \'\';\n }\n # Symbol Templates\n CodeSymbolTemplate:\n !!js/function &CodeSymbolTemplate > # Also has process method\n () => {\n return \'BsonJavaScript\';\n }\n CodeSymbolArgsTemplate: !!js/function &CodeSymbolArgsTemplate >\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: !!js/function &ObjectIdSymbolTemplate >\n () => {\n return \'ObjectId\';\n }\n ObjectIdSymbolArgsTemplate: !!js/function &ObjectIdSymbolArgsTemplate >\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: !!js/function &BinarySymbolTemplate >\n () => {\n return \'BsonBinaryData\';\n }\n BinarySymbolArgsTemplate: !!js/function &BinarySymbolArgsTemplate >\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:\n !!js/function &BinarySymbolSubtypeDefaultTemplate >\n () => {\n return \'BsonBinarySubType.Binary\';\n }\n BinarySymbolSubtypeFunctionTemplate:\n !!js/function &BinarySymbolSubtypeFunctionTemplate >\n () => {\n return \'BsonBinarySubType.Function\';\n }\n BinarySymbolSubtypeByteArrayTemplate:\n !!js/function &BinarySymbolSubtypeByteArrayTemplate >\n () => {\n return \'BsonBinarySubType.OldBinary\';\n }\n BinarySymbolSubtypeUuidOldTemplate:\n !!js/function &BinarySymbolSubtypeUuidOldTemplate >\n () => {\n return \'BsonBinarySubType.UuidLegacy\';\n }\n BinarySymbolSubtypeUuidTemplate:\n !!js/function &BinarySymbolSubtypeUuidTemplate >\n () => {\n return \'BsonBinarySubType.UuidStandard\';\n }\n BinarySymbolSubtypeMd5Template:\n !!js/function &BinarySymbolSubtypeMd5Template >\n () => {\n return \'BsonBinarySubType.MD5\';\n }\n BinarySymbolSubtypeUserDefinedTemplate:\n !!js/function &BinarySymbolSubtypeUserDefinedTemplate >\n () => {\n return \'BsonBinarySubType.UserDefined\';\n }\n DBRefSymbolTemplate: !!js/function &DBRefSymbolTemplate >\n () => {\n return \'MongoDBRef\';\n }\n DBRefSymbolArgsTemplate: &DBRefSymbolArgsTemplate null\n DoubleSymbolTemplate: !!js/function &DoubleSymbolTemplate >\n () => {\n return \'\';\n }\n DoubleSymbolArgsTemplate: !!js/function &DoubleSymbolArgsTemplate >\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: !!js/function &Int32SymbolTemplate >\n () => {\n return \'\';\n }\n Int32SymbolArgsTemplate: !!js/function &Int32SymbolArgsTemplate >\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: !!js/function &LongSymbolTemplate >\n () => {\n return \'\';\n }\n LongSymbolArgsTemplate: !!js/function &LongSymbolArgsTemplate >\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: !!js/function &LongSymbolMaxTemplate >\n () => {\n return \'Int64.MaxValue\';\n }\n LongSymbolMaxArgsTemplate: &LongSymbolMaxArgsTemplate null\n LongSymbolMinTemplate: !!js/function &LongSymbolMinTemplate >\n () => {\n return \'Int64.MinValue\';\n }\n LongSymbolMinArgsTemplate: &LongSymbolMinArgsTemplate null\n LongSymbolZeroTemplate: !!js/function &LongSymbolZeroTemplate >\n (lhs) => {\n return \'0L\';\n }\n LongSymbolZeroArgsTemplate: &LongSymbolZeroArgsTemplate null\n LongSymbolOneTemplate: !!js/function &LongSymbolOneTemplate >\n (lhs) => {\n return \'1L\';\n }\n LongSymbolOneArgsTemplate: &LongSymbolOneArgsTemplate null\n LongSymbolNegOneTemplate: !!js/function &LongSymbolNegOneTemplate >\n (lhs) => {\n return \'-1L\';\n }\n LongSymbolNegOneArgsTemplate: &LongSymbolNegOneArgsTemplate null\n LongSymbolFromBitsTemplate:\n !!js/function &LongSymbolFromBitsTemplate > # Also has process method\n () => {\n return \'\';\n }\n LongSymbolFromBitsArgsTemplate: &LongSymbolFromBitsArgsTemplate null\n LongSymbolFromIntTemplate: !!js/function &LongSymbolFromIntTemplate >\n () => {\n return \'\';\n }\n LongSymbolFromIntArgsTemplate: !!js/function &LongSymbolFromIntArgsTemplate >\n (lhs, arg) => {\n return `${arg}L`;\n }\n LongSymbolFromNumberTemplate: &LongSymbolFromNumberTemplate null\n LongSymbolFromNumberArgsTemplate: &LongSymbolFromNumberArgsTemplate null\n LongSymbolFromStringTemplate: !!js/function &LongSymbolFromStringTemplate >\n () => {\n return \'Convert.ToInt64\';\n }\n LongSymbolFromStringArgsTemplate:\n !!js/function &LongSymbolFromStringArgsTemplate >\n (lhs, arg1, arg2) => {\n if (arg2) {\n return `(${arg1}, ${arg2})`\n }\n return `(${arg1}, 10)`\n }\n MinKeySymbolTemplate: !!js/function &MinKeySymbolTemplate >\n () => {\n return \'BsonMinKey\';\n }\n MinKeySymbolArgsTemplate: !!js/function &MinKeySymbolArgsTemplate >\n () => {\n return \'.Value\';\n }\n MaxKeySymbolTemplate: !!js/function &MaxKeySymbolTemplate >\n () => {\n return \'BsonMaxKey\';\n }\n MaxKeySymbolArgsTemplate: !!js/function &MaxKeySymbolArgsTemplate >\n () => {\n return \'.Value\';\n }\n TimestampSymbolTemplate: !!js/function &TimestampSymbolTemplate >\n () => {\n return \'BsonTimestamp\';\n }\n TimestampSymbolArgsTemplate: !!js/function &TimestampSymbolArgsTemplate >\n (lhs, arg1, arg2) => {\n if (typeof arg1 === \'undefined\') {\n return \'(0, 0)\'\n }\n return `(${arg1}, ${arg2})`;\n }\n SymbolSymbolTemplate: !!js/function &SymbolSymbolTemplate >\n () => {\n return \'\';\n }\n SymbolSymbolArgsTemplate: !!js/function &SymbolSymbolArgsTemplate >\n (_, arg) => {\n return arg; // no parens because generates as a string\n }\n BSONRegExpSymbolTemplate: !!js/function &BSONRegExpSymbolTemplate >\n () => {\n return \'BsonRegularExpression\';\n }\n BSONRegExpSymbolArgsTemplate: !!js/function &BSONRegExpSymbolArgsTemplate >\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: !!js/function &Decimal128SymbolTemplate >\n () => {\n return \'Decimal128\';\n }\n Decimal128SymbolArgsTemplate: !!js/function &Decimal128SymbolArgsTemplate >\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:\n !!js/function &Decimal128SymbolFromStringTemplate >\n (lhs) => {\n return `${lhs}.Parse`;\n }\n Decimal128SymbolFromStringArgsTemplate:\n !!js/function &Decimal128SymbolFromStringArgsTemplate >\n (lhs, arg) => {\n return `(${arg})`;\n }\n Decimal128ToStringTemplate: !!js/function &Decimal128ToStringTemplate >\n (lhs) => {\n return `${lhs}.ToString`;\n }\n Decimal128ToStringArgsTemplate: &Decimal128ToStringArgsTemplate null\n # BSON Util Templates\n ObjectIdCreateFromHexStringTemplate:\n !!js/function &ObjectIdCreateFromHexStringTemplate >\n (lhs) => {\n return `new ${lhs}`;\n }\n ObjectIdCreateFromHexStringArgsTemplate: &ObjectIdCreateFromHexStringArgsTemplate null\n ObjectIdCreateFromTimeTemplate:\n !!js/function &ObjectIdCreateFromTimeTemplate >\n () => {\n return `new ObjectId.GenerateNewId`;\n }\n ObjectIdCreateFromTimeArgsTemplate:\n !!js/function &ObjectIdCreateFromTimeArgsTemplate >\n (lhs, arg, isNumber) => {\n if (isNumber) {\n return `(Convert.ToInt32(${arg}))`;\n }\n return `(${arg})`;\n }\n ObjectIdIsValidTemplate: !!js/function &ObjectIdIsValidTemplate >\n (lhs) => {\n return `new ${lhs}`;\n }\n ObjectIdIsValidArgsTemplate: &ObjectIdIsValidArgsTemplate null\n # JS Symbol Templates\n NumberSymbolTemplate: !!js/function &NumberSymbolTemplate >\n () => {\n return \'\';\n }\n NumberSymbolArgsTemplate: !!js/function &NumberSymbolArgsTemplate >\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: !!js/function &DateSymbolTemplate >\n () => {\n return \'DateTime\';\n }\n DateSymbolArgsTemplate: !!js/function &DateSymbolArgsTemplate >\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: !!js/function &DateSymbolNowTemplate >\n () => {\n return \'DateTime.Now\';\n }\n DateSymbolNowArgsTemplate: !!js/function &DateSymbolNowArgsTemplate >\n () => {\n return \'\';\n }\n RegExpSymbolTemplate:\n !!js/function &RegExpSymbolTemplate > # Also has process method\n () => {\n return \'Regex\';\n }\n RegExpSymbolArgsTemplate: &RegExpSymbolArgsTemplate null\n ImportTemplate: !!js/function &ImportTemplate >\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: !!js/function &8ImportTemplate >\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: !!js/function &200ImportTemplate >\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'},18765: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# 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: !!js/function &DriverTemplate >\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: !!js/function &EqualitySyntaxTemplate >\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: !!js/function &InSyntaxTemplate >\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: !!js/function &AndSyntaxTemplate >\n (args) => args.join(' && ')\n OrSyntaxTemplate: !!js/function &OrSyntaxTemplate >\n (args) => args.join(' || ')\n NotSyntaxTemplate: !!js/function &NotSyntaxTemplate >\n (arg) => `!${arg}`\n UnarySyntaxTemplate: !!js/function &UnarySyntaxTemplate >\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: !!js/function &BinarySyntaxTemplate >\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: !!js/function &StringTypeTemplate >\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: !!js/function &RegexTypeTemplate >\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: !!js/function &BoolTypeTemplate >\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: !!js/function &ArrayTypeTemplate >\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: !!js/function &ArrayTypeArgsTemplate >\n (arg, depth, last) => {\n depth++;\n const indent = '\\n' + ' '.repeat(depth);\n return `${indent}${arg},`;\n }\n NullTypeTemplate: !!js/function &NullTypeTemplate >\n () => 'primitive.Null{}'\n UndefinedTypeTemplate: !!js/function &UndefinedTypeTemplate >\n () => 'primitive.Undefined{}'\n ObjectTypeTemplate: !!js/function &ObjectTypeTemplate >\n (literal) => `bson.D{${literal}}`\n ObjectTypeArgsTemplate: !!js/function &ObjectTypeArgsTemplate >\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: !!js/function &CodeSymbolTemplate >\n () => 'primitive.CodeWithScope'\n CodeSymbolArgsTemplate: !!js/function &CodeSymbolArgsTemplate >\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: !!js/function &ObjectIdSymbolTemplate >\n () => ''\n ObjectIdSymbolArgsTemplate: !!js/function &ObjectIdSymbolArgsTemplate >\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: !!js/function &DoubleSymbolTemplate >\n () => ''\n DoubleSymbolArgsTemplate: !!js/function &DoubleSymbolArgsTemplate >\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: !!js/function &Int32SymbolTemplate >\n () => ''\n Int32SymbolArgsTemplate: !!js/function &Int32SymbolArgsTemplate >\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: !!js/function &LongSymbolTemplate >\n () => ''\n LongSymbolArgsTemplate: !!js/function &LongSymbolArgsTemplate >\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: !!js/function &RegExpSymbolTemplate >\n () => 'regex'\n RegExpSymbolArgsTemplate: &RegExpSymbolArgsTemplate null # Args: lhs, pattern, flags\n SymbolSymbolTemplate: !!js/function &SymbolSymbolTemplate >\n () => 'primitive.Symbol'\n SymbolSymbolArgsTemplate: &SymbolSymbolArgsTemplate null\n BSONRegExpSymbolTemplate: !!js/function &BSONRegExpSymbolTemplate >\n () => 'primitive.Regex'\n BSONRegExpSymbolArgsTemplate: !!js/function &BSONRegExpSymbolArgsTemplate >\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: !!js/function &Decimal128SymbolTemplate >\n () => ''\n Decimal128SymbolArgsTemplate: !!js/function &Decimal128SymbolArgsTemplate >\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: !!js/function &MinKeySymbolTemplate >\n () => 'primitive.MinKey'\n MinKeySymbolArgsTemplate: !!js/function &MinKeySymbolArgsTemplate >\n () => '{}'\n MaxKeySymbolTemplate: !!js/function &MaxKeySymbolTemplate >\n () => 'primitive.MaxKey'\n MaxKeySymbolArgsTemplate: !!js/function &MaxKeySymbolArgsTemplate >\n () => '{}'\n TimestampSymbolTemplate: !!js/function &TimestampSymbolTemplate >\n () => 'primitive.Timestamp'\n TimestampSymbolArgsTemplate: !!js/function &TimestampSymbolArgsTemplate >\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: !!js/function &NumberSymbolTemplate >\n () => ''\n NumberSymbolArgsTemplate: !!js/function &NumberSymbolArgsTemplate >\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: !!js/function &DateSymbolTemplate >\n () => 'time.Date'\n DateSymbolArgsTemplate: !!js/function &DateSymbolArgsTemplate >\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: !!js/function &CodeCodeTemplate >\n (lhs) => `${lhs}.Code`\n CodeCodeArgsTemplate: &CodeCodeArgsTemplate null\n CodeScopeTemplate: !!js/function &CodeScopeTemplate >\n (lhs) => lhs\n CodeScopeArgsTemplate: &CodeScopeArgsTemplate null\n ObjectIdToStringTemplate: !!js/function &ObjectIdToStringTemplate >\n (lhs) => `${lhs}.String()`\n ObjectIdToStringArgsTemplate: !!js/function &ObjectIdToStringArgsTemplate >\n () => ''\n ObjectIdEqualsTemplate: !!js/function &ObjectIdEqualsTemplate >\n () => ''\n ObjectIdEqualsArgsTemplate: !!js/function &ObjectIdEqualsArgsTemplate >\n (arg1, arg2) => `${arg1} == ${arg2}`\n ObjectIdGetTimestampTemplate: !!js/function &ObjectIdGetTimestampTemplate >\n (lhs) => `${lhs}.Timestamp()`\n ObjectIdGetTimestampArgsTemplate:\n !!js/function &ObjectIdGetTimestampArgsTemplate >\n () => ''\n ObjectIdIsValidTemplate: !!js/function &ObjectIdIsValidTemplate >\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: !!js/function &LongEqualsTemplate >\n (lhs) => `${lhs} == `\n LongEqualsArgsTemplate: !!js/function &LongEqualsArgsTemplate >\n (_, arg) => arg\n LongToStringTemplate: !!js/function &LongToStringTemplate >\n (lhs) => `strconv.Itoa(${lhs})`\n LongToStringArgsTemplate: !!js/function &LongToStringArgsTemplate >\n () => ''\n LongToIntTemplate: !!js/function &LongToIntTemplate >\n (lhs) => `int(${lhs})`\n LongToIntArgsTemplate: !!js/function &LongToIntArgsTemplate >\n () => ''\n LongValueOfTemplate: &LongValueOfTemplate null\n LongValueOfArgsTemplate: &LongValueOfArgsTemplate null\n LongToNumberTemplate: !!js/function &LongToNumberTemplate >\n (lhs) => `float64(${lhs})`\n LongToNumberArgsTemplate: !!js/function &LongToNumberArgsTemplate >\n (arg) => ''\n LongAddTemplate: !!js/function &LongAddTemplate >\n (lhs) => `${lhs} + `\n LongAddArgsTemplate: !!js/function &LongAddArgsTemplate >\n (_, args) => args\n LongSubtractTemplate: !!js/function &LongSubtractTemplate >\n (lhs) => `${lhs} - `\n LongSubtractArgsTemplate: !!js/function &LongSubtractArgsTemplate >\n (_, arg) => arg\n LongMultiplyTemplate: !!js/function &LongMultiplyTemplate >\n (lhs) => `${lhs} * `\n LongMultiplyArgsTemplate: !!js/function &LongMultiplyArgsTemplate >\n (_, arg) => arg\n LongDivTemplate: !!js/function &LongDivTemplate >\n (lhs) => `${lhs} / `\n LongDivArgsTemplate: !!js/function &LongDivArgsTemplate >\n (_, arg) => arg\n LongModuloTemplate: !!js/function &LongModuloTemplate >\n (lhs) => `${lhs} % `\n LongModuloArgsTemplate: !!js/function &LongModuloArgsTemplate >\n (_, arg) => arg\n LongAndTemplate: !!js/function &LongAndTemplate >\n (lhs) => `${lhs} & `\n LongAndArgsTemplate: !!js/function &LongAndArgsTemplate >\n (_, arg) => arg\n LongOrTemplate: !!js/function &LongOrTemplate >\n (lhs) => `${lhs} | `\n LongOrArgsTemplate: !!js/function &LongOrArgsTemplate >\n (_, arg) => arg\n LongXorTemplate: !!js/function &LongXorTemplate >\n (lhs) => `${lhs} ^ `\n LongXorArgsTemplate: !!js/function &LongXorArgsTemplate >\n (_, arg) => arg\n LongShiftLeftTemplate: !!js/function &LongShiftLeftTemplate >\n (lhs) => `${lhs} << `\n LongShiftLeftArgsTemplate: !!js/function &LongShiftLeftArgsTemplate >\n (_, rhs) => rhs\n LongShiftRightTemplate: !!js/function &LongShiftRightTemplate >\n (lhs) => `${lhs} >> `\n LongShiftRightArgsTemplate: !!js/function &LongShiftRightArgsTemplate >\n (_, rhs) => rhs\n LongCompareTemplate: !!js/function &LongCompareTemplate >\n (lhs) => `${lhs} - `\n LongCompareArgsTemplate: !!js/function &LongCompareArgsTemplate >\n (_, rhs) => rhs\n LongIsOddTemplate: !!js/function &LongIsOddTemplate >\n (arg) => `${arg} % 2 == 1`\n LongIsOddArgsTemplate: !!js/function &LongIsOddArgsTemplate >\n () => ''\n LongIsZeroTemplate: !!js/function &LongIsZeroTemplate >\n (arg) => `${arg} == int64(0)`\n LongIsZeroArgsTemplate: !!js/function &LongIsZeroArgsTemplate >\n () => ''\n LongIsNegativeTemplate: !!js/function &LongIsNegativeTemplate >\n (arg) => `${arg} < int64(0)`\n LongIsNegativeArgsTemplate: !!js/function &LongIsNegativeArgsTemplate >\n () => ''\n LongNegateTemplate: !!js/function &LongNegateTemplate >\n () => '-'\n LongNegateArgsTemplate: !!js/function &LongNegateArgsTemplate >\n (lhs) => lhs\n LongNotTemplate: !!js/function &LongNotTemplate >\n () => '^'\n LongNotArgsTemplate: !!js/function &LongNotArgsTemplate >\n (lhs) => lhs\n LongNotEqualsTemplate: !!js/function &LongNotEqualsTemplate >\n (lhs) => `${lhs} != `\n LongNotEqualsArgsTemplate: !!js/function &LongNotEqualsArgsTemplate >\n (_, rhs) => rhs\n LongGreaterThanTemplate: !!js/function &LongGreaterThanTemplate >\n (lhs) => `${lhs} > `\n LongGreaterThanArgsTemplate: !!js/function &LongGreaterThanArgsTemplate >\n (_, rhs) => rhs\n LongGreaterThanOrEqualTemplate:\n !!js/function &LongGreaterThanOrEqualTemplate >\n (lhs) => `${lhs} >= `\n LongGreaterThanOrEqualArgsTemplate:\n !!js/function &LongGreaterThanOrEqualArgsTemplate >\n (_, rhs) => rhs\n LongLessThanTemplate: !!js/function &LongLessThanTemplate >\n (lhs) => `${lhs} < `\n LongLessThanArgsTemplate: !!js/function &LongLessThanArgsTemplate >\n (_, rhs) => rhs\n LongLessThanOrEqualTemplate: !!js/function &LongLessThanOrEqualTemplate >\n (lhs) => `${lhs} <= `\n LongLessThanOrEqualArgsTemplate:\n !!js/function &LongLessThanOrEqualArgsTemplate >\n (_, rhs) => rhs\n LongFloatApproxTemplate: !!js/function &LongFloatApproxTemplate >\n (arg) => `float64(${arg})`\n LongTopTemplate: !!js/function &LongTopTemplate >\n (arg) => `${arg} >> 32`\n LongBottomTemplate: !!js/function &LongBottomTemplate >\n (arg) => `${arg} & 0x0000ffff`\n TimestampToStringTemplate: !!js/function &TimestampToStringTemplate >\n (lhs) => `time.Unix(${lhs}.T, 0).String`\n TimestampToStringArgsTemplate: &TimestampToStringArgsTemplate null\n () => '()'\n TimestampEqualsTemplate: !!js/function &TimestampEqualsTemplate >\n (lhs) => `${lhs}.Equal`\n TimestampEqualsArgsTemplate: !!js/function &TimestampEqualsArgsTemplate >\n (_, rhs) => `(${rhs})`\n TimestampGetLowBitsTemplate: !!js/function &TimestampGetLowBitsTemplate >\n (lhs) => `${lhs}.T`\n TimestampGetLowBitsArgsTemplate:\n !!js/function &TimestampGetLowBitsArgsTemplate >\n () => ''\n TimestampGetHighBitsTemplate: !!js/function &TimestampGetHighBitsTemplate >\n (lhs) => `${lhs}.I`\n TimestampGetHighBitsArgsTemplate:\n !!js/function &TimestampGetHighBitsArgsTemplate >\n () => ''\n TimestampTTemplate: !!js/function &TimestampTTemplate >\n (lhs) => `${lhs}.T`\n TimestampITemplate: !!js/function &TimestampITemplate >\n (lhs) => `${lhs}.I`\n TimestampAsDateTemplate: !!js/function &TimestampAsDateTemplate >\n (lhs) => `time.Unix(${lhs}.T, 0)`\n TimestampAsDateArgsTemplate: !!js/function &TimestampAsDateArgsTemplate >\n () => ''\n TimestampCompareTemplate: !!js/function &TimestampCompareTemplate >\n () => 'primitive.CompareTimestamp'\n TimestampCompareArgsTemplate: !!js/function &TimestampCompareArgsTemplate >\n (lhs, rhs) => `(${lhs}, ${rhs})`\n TimestampNotEqualsTemplate: !!js/function &TimestampNotEqualsTemplate >\n (lhs) => `!${lhs}.Equal`\n TimestampNotEqualsArgsTemplate:\n !!js/function &TimestampNotEqualsArgsTemplate >\n (_, rhs) => `(${rhs})`\n TimestampGreaterThanTemplate: !!js/function &TimestampGreaterThanTemplate >\n () => ''\n TimestampGreaterThanArgsTemplate:\n !!js/function &TimestampGreaterThanArgsTemplate >\n (lhs, rhs) => `primitive.CompareTimestamp(${lhs}, ${rhs}) == 1`\n TimestampGreaterThanOrEqualTemplate:\n !!js/function &TimestampGreaterThanOrEqualTemplate >\n () => ''\n TimestampGreaterThanOrEqualArgsTemplate:\n !!js/function &TimestampGreaterThanOrEqualArgsTemplate >\n (arg1, arg2) => `primitive.CompareTimestamp(${arg1}, ${arg2}) >= 0`\n TimestampLessThanTemplate: !!js/function &TimestampLessThanTemplate >\n (lhs) => ''\n TimestampLessThanArgsTemplate: !!js/function &TimestampLessThanArgsTemplate >\n (lhs, rhs) => `primitive.CompareTimestamp(${lhs}, ${rhs}) == -1`\n TimestampLessThanOrEqualTemplate:\n !!js/function &TimestampLessThanOrEqualTemplate >\n () => ''\n TimestampLessThanOrEqualArgsTemplate:\n !!js/function &TimestampLessThanOrEqualArgsTemplate >\n (arg1, arg2) => `primitive.CompareTimestamp(${arg1}, ${arg2}) <= 0`\n SymbolValueOfTemplate: !!js/function &SymbolValueOfTemplate >\n () => ''\n SymbolValueOfArgsTemplate: !!js/function &SymbolValueOfArgsTemplate >\n (arg) => arg\n SymbolInspectTemplate: !!js/function &SymbolInspectTemplate >\n () => ''\n SymbolInspectArgsTemplate: !!js/function &SymbolInspectArgsTemplate >\n (arg) => arg\n SymbolToStringTemplate: !!js/function &SymbolToStringTemplate >\n () => ''\n SymbolToStringArgsTemplate: !!js/function &SymbolToStringArgsTemplate >\n (lhs) => `string(${lhs})`\n Decimal128ToStringTemplate: !!js/function &Decimal128ToStringTemplate >\n (lhs) => `${lhs}.String()`\n Decimal128ToStringArgsTemplate:\n !!js/function &Decimal128ToStringArgsTemplate >\n () => ''\n # non bson-specific\n DateSymbolNowTemplate: !!js/function &DateSymbolNowTemplate >\n () => 'time.Now()'\n DateSymbolNowArgsTemplate: !!js/function &DateSymbolNowArgsTemplate >\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: !!js/function &LongSymbolMaxTemplate >\n () => 'int(^uint(0) >> 1)'\n LongSymbolMaxArgsTemplate: &LongSymbolMaxArgsTemplate null\n LongSymbolMinTemplate: !!js/function &LongSymbolMinTemplate >\n () => '-(1+int(^uint(0) >> 1))'\n LongSymbolMinArgsTemplate: &LongSymbolMinArgsTemplate null\n LongSymbolZeroTemplate: !!js/function &LongSymbolZeroTemplate >\n () => 'int64(0)'\n LongSymbolZeroArgsTemplate: &LongSymbolZeroArgsTemplate null\n LongSymbolOneTemplate: !!js/function &LongSymbolOneTemplate >\n () => 'int64(1)'\n LongSymbolOneArgsTemplate: &LongSymbolOneArgsTemplate null\n LongSymbolNegOneTemplate: !!js/function &LongSymbolNegOneTemplate >\n () => 'int64(-1)'\n LongSymbolNegOneArgsTemplate: &LongSymbolNegOneArgsTemplate null\n LongSymbolFromBitsTemplate: !!js/function &LongSymbolFromBitsTemplate >\n () => 'int64'\n LongSymbolFromBitsArgsTemplate: &LongSymbolFromBitsArgsTemplate null\n LongSymbolFromIntTemplate: !!js/function &LongSymbolFromIntTemplate >\n () => 'int64'\n LongSymbolFromIntArgsTemplate: &LongSymbolFromIntArgsTemplate null\n LongSymbolFromNumberTemplate: !!js/function &LongSymbolFromNumberTemplate >\n () => 'int64'\n LongSymbolFromNumberArgsTemplate: &LongSymbolFromNumberArgsTemplate null\n LongSymbolFromStringTemplate: !!js/function &LongSymbolFromStringTemplate >\n () => ''\n LongSymbolFromStringArgsTemplate:\n !!js/function &LongSymbolFromStringArgsTemplate >\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:\n !!js/function &Decimal128SymbolFromStringTemplate >\n () => ''\n Decimal128SymbolFromStringArgsTemplate:\n !!js/function &Decimal128SymbolFromStringArgsTemplate >\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:\n !!js/function &ObjectIdCreateFromHexStringTemplate >\n () => ''\n ObjectIdCreateFromHexStringArgsTemplate:\n !!js/function &ObjectIdCreateFromHexStringArgsTemplate >\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:\n !!js/function &ObjectIdCreateFromTimeTemplate >\n () => 'primitive.NewObjectIDFromTimestamp'\n ObjectIdCreateFromTimeArgsTemplate:\n !!js/function &ObjectIdCreateFromTimeArgsTemplate >\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 # 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: !!js/function &ImportTemplate >\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: !!js/function &DriverImportTemplate >\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: !!js/function &8ImportTemplate >\n (args) => ['go.mongodb.org/mongo-driver/bson/primitive']\n 9ImportTemplate: &9ImportTemplate null\n 10ImportTemplate: !!js/function &10ImportTemplate >\n () => ['go.mongodb.org/mongo-driver/bson']\n 11ImportTemplate: &11ImportTemplate null\n 12ImportTemplate: &12ImportTemplate null\n 100ImportTemplate: !!js/function &100ImportTemplate >\n (args) => ['go.mongodb.org/mongo-driver/bson/primitive']\n 101ImportTemplate: !!js/function &101ImportTemplate >\n (args) => ['go.mongodb.org/mongo-driver/bson/primitive', 'log']\n 102ImportTemplate: &102ImportTemplate null\n 103ImportTemplate: &103ImportTemplate null\n 104ImportTemplate: !!js/function &104ImportTemplate >\n (args) => ['log', 'strconv']\n 105ImportTemplate: !!js/function &105ImportTemplate >\n (args) => ['log', 'strconv']\n 106ImportTemplate: !!js/function &106ImportTemplate >\n (args) => ['log', 'strconv']\n 107ImportTemplate: !!js/function &107ImportTemplate >\n (args) => ['go.mongodb.org/mongo-driver/bson/primitive']\n 108ImportTemplate: !!js/function &108ImportTemplate >\n (args) => ['go.mongodb.org/mongo-driver/bson/primitive']\n 109ImportTemplate: !!js/function &109ImportTemplate >\n (args) => ['go.mongodb.org/mongo-driver/bson/primitive']\n 110ImportTemplate: !!js/function &110ImportTemplate >\n (args) => ['go.mongodb.org/mongo-driver/bson/primitive']\n 111ImportTemplate: !!js/function &111ImportTemplate >\n (args) => ['go.mongodb.org/mongo-driver/bson/primitive']\n 112ImportTemplate: !!js/function &112ImportTemplate >\n (args) => ['go.mongodb.org/mongo-driver/bson/primitive', 'log']\n 113ImportTemplate: &113ImportTemplate null\n 114ImportTemplate: &114ImportTemplate null\n 200ImportTemplate: !!js/function &200ImportTemplate >\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"},18920:(e,t,n)=>{n(59648),n(29250),n(52034),n(86864),n(55341),n(34992),n(73426),n(91686),n(38220),n(63530),n(95468),n(58579),n(11825),n(63447),n(67458);const r=n(49871),a=n(37677),l=n(9804),o=n(35613)._,s=n(81068),{BsonTranspilersInternalError:i,BsonTranspilersUnimplementedError:p}=n(65815),m=n(66151),u=m.DEFAULT_SCHEMA.extend(n(178).Q7),g=n(58077),T=n(6266),c=n(24921),y=n(25662),h=n(98156),d=n(58037),f=n(62893),S=n(33254),b=n(1694),L=n(99696),A=n(26508),I=n(74496),x=n(27827),_=n(3377),O=n(17644),j=n(96108),B=n(38248),E=n(55387),D=n(18765),R=n(4541),C=n(56971),N=(e,t)=>{const n=new r.InputStream(e),o=new a.ECMAScriptLexer(n);o.strictMode=!1;const i=new r.CommonTokenStream(o),p=new l.ECMAScriptParser(i);p.buildParseTrees=!0;const m=new s;return p.removeErrorListeners(),p.addErrorListener(m),p[t]()},v=new Map,$=(e,...t)=>v.get(e)??v.set(e,((e,t,n,r)=>{const a=new(n(t)),l=m.load(r,{schema:u});["BasicTypes","BsonTypes","NativeTypes","SymbolTypes","BsonTypes","BsonSymbols","NativeSymbols","SymbolTypes"].map((e=>{if(!(e in l))throw new i(`Invalid Symbol Table: missing ${e}`)})),Object.assign(a,{SYMBOL_TYPE:l.SymbolTypes,BsonTypes:l.BsonTypes,Symbols:Object.assign({},l.BsonSymbols,l.NativeSymbols),Types:Object.assign({},l.BasicTypes,l.BsonTypes,l.NativeTypes),Syntax:l.Syntax,Imports:l.Imports});const o=(t,n,r)=>{try{const l=e(t,a.startRule);return a.idiomatic=void 0===n?a.idiomatic:n,r||(a.clearImports(),a.clearDeclarations()),a.start(l,!r)}catch(e){if(e.code&&e.code.includes("BSONTRANSPILERS"))throw e;throw new i(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 i("Missing required metadata to generate drivers syntax");if(!("aggregation"in n)&&!("filter"in n))throw new i("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)}})(...t)).get(e);e.exports={shell:{get java(){return $("java",N,c(T(g(o))),y,x)},get python(){return $("python",N,c(T(g(o))),h,_)},get csharp(){return $("csharp",N,c(T(g(o))),d,O)},get javascript(){return $("javascript",N,c(T(g(o))),f,j)},get object(){return $("object",N,c(T(g(o))),S,B)},get ruby(){return $("ruby",N,c(T(g(o))),b,E)},get go(){return $("go",N,c(T(g(o))),L,D)},get rust(){return $("rust",N,c(T(g(o))),A,R)},get php(){return $("php",N,c(T(g(o))),I,C)}},getTree:{shell:N}}},24921:(e,t,n)=>{var r=n(67787).Buffer;const a=n(49888),l=n(62444),{BsonTranspilersRuntimeError:o,BsonTranspilersUnimplementedError:s}=n(65815);e.exports=e=>class extends e{constructor(){super()}processNumberLong(e){return this.generateNumericClass(e)}executeJavascript(e){const t={RegExp,DBRef:l.DBRef,Map:l.Map,MaxKey:l.MaxKey,MinKey:l.MinKey,ObjectId:l.ObjectId,BSONSymbol:l.BSONSymbol,Timestamp:l.Timestamp,Decimal128:l.Decimal128,Long:l.Long,Int32:l.Int32,Double:l.Double,Code:function(e,t){return new l.Code(e,t)},NumberDecimal:function(e){return void 0===e&&(e="0"),l.Decimal128.fromString(e.toString())},NumberInt:function(e){return parseInt(e,10)},NumberLong:function(e){return void 0===e&&(e=0),l.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)}}},25662:(e,t,n)=>{const{doubleQuoteStringify:r,removeQuotes:a}=n(67366),{BsonTranspilersRuntimeError:l,BsonTranspilersUnimplementedError:o}=n(65815);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 l(`$${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),i=this.getObjectChild(o);return this.isFilter(i)?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 l(`Unrecognized option to $${t}: ${a}`);this.idiomatic=r,o=this.visit(this.getValue(e)),this.idiomatic=!0})),""===o)throw new l(`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 l(`Unrecognized option to $${t}: ${a}`);s[a]=this.visit(this.getValue(e))})),n.map((e=>{if(!(e in s))throw new l(`Missing option '${e}' in $${t}`)}));let i="";return Object.keys(s).length>n.length&&(this.requiredImports[306].push(a[t]),i=`, 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(", ")}${i})`}handleMultipleSubfields(e,t,n,r,a){const o=this.assertIsNonemptyObject(e,t),s=[],i={};if(o.forEach((e=>{const t=this.getKeyStr(e);-1!==n.indexOf(t)?s.push(this.visit(this.getValue(e))):(this.idiomatic=a,i[t]=this.visit(this.getValue(e)),this.idiomatic=!0)})),s.length!==n.length)throw new l(`Required option missing from ${t}`);return`${t}(${s.concat(Object.keys(i).map((e=>r(e,i[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 l;return 1===a.length?l=a[0]:(l=`fields(${a.join(", ")})`,this.requiredImports[303].push("fields")),`project(${l})`}handlenot(e,t,n){const r=this.assertIsNonemptyObject(e,t),a=this.getValue(r[0]),l=this.getKeyStr(r[0]).substr(1);return this.requiredImports[300].push(l),`${t}(${this.handleFieldOp(a,l,n)})`}handlemod(e,t,n){const a=this.getList(e);if(2!==a.length)throw new l("$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),l={r:"",o:""};return this.getKeyValueList(n).forEach((e=>{const t=this.getKeyStr(e);"$regex"===t&&(l.r=this.visit(this.getValue(e))),"$options"===t&&(l.o=`, ${this.visit(this.getValue(e))}`)})),`${t}(${r(a)}, ${l.r}${l.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 l("$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 l("$geoWithin takes an object with only 1 field");const i=Object.keys(s)[0];switch(i){case"$geometry":return this.requiredImports[300].push("geoWithin"),`geoWithin(${o}, ${this.handlegeometry(s[i])})`;case"$box":return this.requiredImports[300].push("geoWithinBox"),`geoWithinBox(${o}, ${this.combineCoordinates(s[i],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[i])})`;case"$centerSphere":case"$center":{const e=this.assertIsNonemptyArray(s[i]);if(2!==e.length)throw new l(`${i} takes array of length 2`);const t=this.combineCoordinates(e[0],2,"",!0,(e=>this.visit(e))),n=`geoWithin${i[1].toUpperCase()}${i.substr(2)}`;return this.requiredImports[300].push(n),`${n}(${o}, ${t}, ${this.visit(e[1])})`}default:throw new l(`unrecognized option ${i} 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 l(`Missing required field ${e} in $${t}`)})),3!==Object.keys(s).length)throw new l(`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 l("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 l(`$${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 l(`$${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 l(`${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 l("$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 l(`Unrecognized option to $geometry: ${t}`);n.coordinates=this.getValue(e)}})),!n.type||!n.coordinates)throw new l("Missing option to $geometry");if(!this.getArray(n.coordinates)||0===this.getList(this.getArray(n.coordinates)).length)throw new l("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 l(`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)}}},26508:e=>{e.exports=e=>class extends e{constructor(){super()}}},27827: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# 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: !!js/function &DriverTemplate >\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: !!js/function &EqualitySyntaxTemplate >\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: !!js/function &InSyntaxTemplate >\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: !!js/function &AndSyntaxTemplate >\n (args) => {\n return args.join(' && ');\n }\n OrSyntaxTemplate: !!js/function &OrSyntaxTemplate >\n (args) => {\n return args.join(' || ');\n }\n NotSyntaxTemplate: !!js/function &NotSyntaxTemplate >\n (arg) => {\n return `!${arg}`;\n }\n UnarySyntaxTemplate: &UnarySyntaxTemplate null\n BinarySyntaxTemplate: !!js/function &BinarySyntaxTemplate >\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: !!js/function &NewSyntaxTemplate >\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: !!js/function &StringTypeTemplate >\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: !!js/function &RegexTypeTemplate >\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: !!js/function &BoolTypeTemplate >\n (literal) => {\n return literal.toLowerCase();\n }\n IntegerTypeTemplate: &IntegerTypeTemplate null\n DecimalTypeTemplate: !!js/function &DecimalTypeTemplate >\n (literal, type) => {\n if (type === '_integer' || type === '_long' || type === '_decimal') {\n return `${literal}d`;\n }\n return `(double) ${literal}`;\n }\n LongBasicTypeTemplate: !!js/function &LongBasicTypeTemplate >\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: !!js/function &OctalTypeTemplate >\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: !!js/function &ArrayTypeTemplate >\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: !!js/function &NullTypeTemplate >\n () => {\n return 'new BsonNull()';\n }\n UndefinedTypeTemplate: !!js/function &UndefinedTypeTemplate >\n () => {\n return 'new BsonUndefined()';\n }\n ObjectTypeTemplate: !!js/function &ObjectTypeTemplate >\n (literal, depth) => {\n\n if (literal === '') {\n return `new Document()`;\n }\n return literal;\n }\n ObjectTypeArgsTemplate: !!js/function &ObjectTypeArgsTemplate >\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: !!js/function &DoubleTypeTemplate >\n (literal, type) => {\n if (type === '_integer' || type === '_long' || type === '_decimal') {\n return `${literal}d`;\n }\n return `(double) ${literal}`;\n }\n DoubleTypeArgsTemplate: !!js/function &DoubleTypeArgsTemplate >\n () => {\n return '';\n }\n LongTypeTemplate: !!js/function &LongTemplate >\n () => {\n return '';\n }\n LongTypeArgsTemplate: &LongSymbolArgsTemplate null\n # BSON Object Method templates\n ObjectIdToStringTemplate: !!js/function &ObjectIdToStringTemplate >\n (lhs) => {\n return `${lhs}.toHexString()`;\n }\n ObjectIdToStringArgsTemplate: !!js/function &ObjectIdToStringArgsTemplate >\n () => {\n return '';\n }\n ObjectIdEqualsTemplate: &ObjectIdEqualsTemplate null\n ObjectIdEqualsArgsTemplate: &ObjectIdEqualsArgsTemplate null\n ObjectIdGetTimestampTemplate: !!js/function &ObjectIdGetTimestampTemplate >\n (lhs) => {\n return `${lhs}.getTimestamp()`;\n }\n ObjectIdGetTimestampArgsTemplate:\n !!js/function &ObjectIdGetTimestampArgsTemplate >\n () => {\n return '';\n }\n CodeCodeTemplate: !!js/function &CodeCodeTemplate >\n (lhs) => {\n return `${lhs}.getCode()`;\n }\n CodeCodeArgsTemplate: &CodeCodeArgsTemplate null\n CodeScopeTemplate: !!js/function &CodeScopeTemplate >\n (lhs) => {\n return `${lhs}.getScope()`;\n }\n CodeScopeArgsTemplate: &CodeScopeArgsTemplate null\n BinaryValueTemplate: !!js/function &BinaryValueTemplate >\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: !!js/function &BinarySubtypeTemplate >\n (lhs) => {\n return `${lhs}.getType()`;\n }\n BinarySubtypeArgsTemplate: !!js/function &BinarySubtypeArgsTemplate >\n () => {\n return '';\n }\n DBRefGetDBTemplate: !!js/function &DBRefGetDBTemplate >\n (lhs) => {\n return `${lhs}.getDatabaseName()`;\n }\n DBRefGetDBArgsTemplate: !!js/function &DBRefGetDBArgsTemplate >\n () => {\n return '';\n }\n DBRefGetCollectionTemplate: !!js/function &DBRefGetCollectionTemplate >\n (lhs) => {\n return `${lhs}.getCollectionName()`;\n }\n DBRefGetCollectionArgsTemplate:\n !!js/function &DBRefGetCollectionArgsTemplate >\n () => {\n return '';\n }\n DBRefGetIdTemplate: !!js/function &DBRefGetIdTemplate >\n (lhs) => {\n return `${lhs}.getId()`;\n }\n DBRefGetIdArgsTemplate: !!js/function &DBRefGetIdArgsTemplate >\n () => {\n return '';\n }\n LongEqualsTemplate: !!js/function &LongEqualsTemplate >\n (lhs) => {\n return `${lhs} ==`;\n }\n LongEqualsArgsTemplate: !!js/function &LongEqualsArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongToStringTemplate: !!js/function &LongToStringTemplate >\n (lhs) => {\n return lhs;\n }\n LongToStringArgsTemplate: &LongToStringArgsTemplate null\n LongToIntTemplate: !!js/function &LongToIntTemplate >\n (lhs) => {\n return `(int) ${lhs}`;\n }\n LongToIntArgsTemplate: !!js/function &LongToIntArgsTemplate >\n () => {\n return '';\n }\n LongToNumberTemplate: !!js/function &LongToNumberTemplate >\n (lhs) => {\n return `(double) ${lhs}`;\n }\n LongToNumberArgsTemplate: !!js/function &LongToNumberArgsTemplate >\n () => {\n return '';\n }\n LongAddTemplate: !!js/function &LongAddTemplate >\n (lhs) => {\n return `${lhs} +`;\n }\n LongAddArgsTemplate: !!js/function &LongAddArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongSubtractTemplate: !!js/function &LongSubtractTemplate >\n (arg) => {\n return `${arg} -`;\n }\n LongSubtractArgsTemplate: !!js/function &LongSubtractArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongMultiplyTemplate: !!js/function &LongMultiplyTemplate >\n (arg) => {\n return `${arg} *`;\n }\n LongMultiplyArgsTemplate: !!js/function &LongMultiplyArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongDivTemplate: !!js/function &LongDivTemplate >\n (lhs) => {\n return `${lhs} /`;\n }\n LongDivArgsTemplate: !!js/function &LongDivArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongModuloTemplate: !!js/function &LongModuloTemplate >\n (lhs) => {\n return `${lhs} %`;\n }\n LongModuloArgsTemplate: !!js/function &LongModuloArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongAndTemplate: !!js/function &LongAndTemplate >\n (lhs) => {\n return `${lhs} &`;\n }\n LongAndArgsTemplate: !!js/function &LongAndArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongOrTemplate: !!js/function &LongOrTemplate >\n (lhs) => {\n return `${lhs} |`;\n }\n LongOrArgsTemplate: !!js/function &LongOrArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongXorTemplate: !!js/function &LongXorTemplate >\n (lhs) => {\n return `${lhs} ^`;\n }\n LongXorArgsTemplate: !!js/function &LongXorArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongShiftLeftTemplate: !!js/function &LongShiftLeftTemplate >\n () => {\n return 'Long.rotateLeft';\n }\n LongShiftLeftArgsTemplate: !!js/function &LongShiftLeftArgsTemplate >\n (lhs, arg) => {\n return `(${lhs}, ${arg})`;\n }\n LongShiftRightTemplate: !!js/function &LongShiftRightTemplate >\n () => {\n return 'Long.rotateRight';\n }\n LongShiftRightArgsTemplate: !!js/function &LongShiftRightArgsTemplate >\n (lhs, arg) => {\n return `(${lhs}, ${arg})`;\n }\n LongCompareTemplate: !!js/function &LongCompareTemplate >\n (lhs) => {\n return `${lhs} -`;\n }\n LongCompareArgsTemplate: !!js/function &LongCompareArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongIsOddTemplate: !!js/function &LongIsOddTemplate >\n (lhs) => {\n return `(${lhs} % 2) == 1`;\n }\n LongIsOddArgsTemplate: !!js/function &LongIsOddArgsTemplate >\n () => {\n return '';\n }\n LongIsZeroTemplate: !!js/function &LongIsZeroTemplate >\n (lhs) => {\n return `${lhs} == 0`;\n }\n LongIsZeroArgsTemplate: !!js/function &LongIsZeroArgsTemplate >\n () => {\n return '';\n }\n LongIsNegativeTemplate: !!js/function &LongIsNegativeTemplate >\n (lhs) => {\n return `${lhs} < 0`;\n }\n LongIsNegativeArgsTemplate: !!js/function &LongIsNegativeArgsTemplate >\n () => {\n return '';\n }\n LongNegateTemplate: !!js/function &LongNegateTemplate >\n () => {\n return '-';\n }\n LongNegateArgsTemplate: !!js/function &LongNegateArgsTemplate >\n (lhs) => {\n return lhs;\n }\n LongNotTemplate: !!js/function &LongNotTemplate >\n () => {\n return '~';\n }\n LongNotArgsTemplate: !!js/function &LongNotArgsTemplate >\n (lhs) => {\n return lhs;\n }\n LongNotEqualsTemplate: !!js/function &LongNotEqualsTemplate >\n (lhs) => {\n return `${lhs} !=`;\n }\n LongNotEqualsArgsTemplate: !!js/function &LongNotEqualsArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanTemplate: !!js/function &LongGreaterThanTemplate >\n (lhs) => {\n return `${lhs} >`;\n }\n LongGreaterThanArgsTemplate: !!js/function &LongGreaterThanArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanOrEqualTemplate:\n !!js/function &LongGreaterThanOrEqualTemplate >\n (lhs) => {\n return `${lhs} >=`;\n }\n LongGreaterThanOrEqualArgsTemplate:\n !!js/function &LongGreaterThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanTemplate: !!js/function &LongLessThanTemplate >\n (lhs) => {\n return `${lhs} <`;\n }\n LongLessThanArgsTemplate: !!js/function &LongLessThanArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanOrEqualTemplate: !!js/function &LongLessThanOrEqualTemplate >\n (lhs) => {\n return `${lhs} <=`;\n }\n LongLessThanOrEqualArgsTemplate:\n !!js/function &LongLessThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongFloatApproxTemplate: !!js/function &LongFloatApproxTemplate >\n (lhs) => {\n return `(float) ${lhs}`;\n }\n LongTopTemplate: !!js/function &LongTopTemplate >\n (lhs) => {\n return `${lhs} >> 32`;\n }\n LongBottomTemplate: !!js/function &LongBottomTemplate >\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: !!js/function &TimestampGetLowBitsTemplate >\n (lhs) => {\n return `${lhs}.getTime`;\n }\n TimestampGetLowBitsArgsTemplate: &TimestampGetLowBitsArgsTemplate null\n TimestampGetHighBitsTemplate: !!js/function &TimestampGetHighBitsTemplate >\n (lhs) => {\n return `${lhs}.getInc`;\n }\n TimestampGetHighBitsArgsTemplate: &TimestampGetHighBitsArgsTemplate null\n TimestampTTemplate: !!js/function &TimestampTTemplate >\n (lhs) => {\n return `${lhs}.getTime()`;\n }\n TimestampITemplate: !!js/function &TimestampITemplate >\n (lhs) => {\n return `${lhs}.getInc()`;\n }\n TimestampAsDateTemplate: !!js/function &TimestampAsDateTemplate >\n (lhs) => {\n return `new java.util.Date(${lhs}.getTime())`;\n }\n TimestampAsDateArgsTemplate: !!js/function &TimestampAsDateArgsTemplate >\n () => {\n return '';\n }\n TimestampCompareTemplate: !!js/function &TimestampCompareTemplate >\n (lhs) => {\n return `${lhs}.compareTo`;\n }\n TimestampCompareArgsTemplate: &TimestampCompareArgsTemplate null\n TimestampNotEqualsTemplate: !!js/function &TimestampNotEqualsTemplate >\n (lhs) => {\n return `${lhs}.compareTo`;\n }\n TimestampNotEqualsArgsTemplate:\n !!js/function &TimestampNotEqualsArgsTemplate >\n (lhs, arg) => {\n return `(${arg}) != 0`;\n }\n TimestampGreaterThanTemplate: !!js/function &TimestampGreaterThanTemplate >\n (lhs) => {\n return `${lhs}.compareTo`;\n }\n TimestampGreaterThanArgsTemplate:\n !!js/function &TimestampGreaterThanArgsTemplate >\n (lhs, arg) => {\n return `(${arg}) > 0`;\n }\n TimestampGreaterThanOrEqualTemplate:\n !!js/function &TimestampGreaterThanOrEqualTemplate >\n (lhs) => {\n return `${lhs}.compareTo`;\n }\n TimestampGreaterThanOrEqualArgsTemplate:\n !!js/function &TimestampGreaterThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return `(${arg}) >= 0`;\n }\n TimestampLessThanTemplate: !!js/function &TimestampLessThanTemplate >\n (lhs) => {\n return `${lhs}.compareTo`;\n }\n TimestampLessThanArgsTemplate: !!js/function &TimestampLessThanArgsTemplate >\n (lhs, arg) => {\n return `(${arg}) < 0`;\n }\n TimestampLessThanOrEqualTemplate:\n !!js/function &TimestampLessThanOrEqualTemplate >\n (lhs) => {\n return `${lhs}.compareTo`;\n }\n TimestampLessThanOrEqualArgsTemplate:\n !!js/function &TimestampLessThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return `(${arg}) <= 0`;\n }\n SymbolValueOfTemplate: !!js/function &SymbolValueOfTemplate >\n (lhs) => {\n return `${lhs}.getSymbol`;\n }\n SymbolValueOfArgsTemplate: &SymbolValueOfArgsTemplate null\n SymbolInspectTemplate: !!js/function &SymbolInspectTemplate >\n (lhs) => {\n return `${lhs}.getSymbol`;\n }\n SymbolInspectArgsTemplate: &SymbolInspectArgsTemplate null\n SymbolToStringTemplate: !!js/function &SymbolToStringTemplate >\n (lhs) => {\n return `${lhs}.toString`;\n }\n SymbolToStringArgsTemplate: &SymbolToStringArgsTemplate null\n # Symbol Templates\n CodeSymbolTemplate:\n !!js/function &CodeSymbolTemplate > # Also has process method\n () => {\n return 'Code';\n }\n CodeSymbolArgsTemplate:\n !!js/function &CodeSymbolArgsTemplate > # 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: !!js/function &ObjectIdSymbolArgsTemplate >\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: !!js/function &BinarySymbolArgsTemplate >\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:\n !!js/function &BinarySymbolSubtypeDefaultTemplate >\n () => {\n return 'BsonBinarySubType.BINARY';\n }\n BinarySymbolSubtypeFunctionTemplate:\n !!js/function &BinarySymbolSubtypeFunctionTemplate >\n () => {\n return 'BsonBinarySubType.FUNCTION';\n }\n BinarySymbolSubtypeByteArrayTemplate:\n !!js/function &BinarySymbolSubtypeByteArrayTemplate >\n () => {\n return 'BsonBinarySubType.BINARY';\n }\n BinarySymbolSubtypeUuidOldTemplate:\n !!js/function &BinarySymbolSubtypeUuidOldTemplate >\n () => {\n return 'BsonBinarySubType.UUID_LEGACY';\n }\n BinarySymbolSubtypeUuidTemplate:\n !!js/function &BinarySymbolSubtypeUuidTemplate >\n () => {\n return 'BsonBinarySubType.UUID_STANDARD';\n }\n BinarySymbolSubtypeMd5Template:\n !!js/function &BinarySymbolSubtypeMd5Template >\n () => {\n return 'BsonBinarySubType.MD5';\n }\n BinarySymbolSubtypeUserDefinedTemplate:\n !!js/function &BinarySymbolSubtypeUserDefinedTemplate >\n () => {\n return 'BsonBinarySubType.USER_DEFINED';\n }\n DBRefSymbolTemplate: &DBRefSymbolTemplate null\n DBRefSymbolArgsTemplate: !!js/function &DBRefSymbolArgsTemplate >\n (lhs, coll, id, db) => {\n const dbstr = db === undefined ? '' : `${db}, `;\n return `(${dbstr}${coll}, ${id})`;\n }\n DoubleSymbolTemplate: !!js/function &DoubleSymbolTemplate >\n () => {\n return '';\n }\n DoubleSymbolArgsTemplate: !!js/function &DoubleSymbolArgsTemplate >\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: !!js/function &Int32SymbolTemplate >\n () => {\n return '';\n }\n Int32SymbolArgsTemplate: !!js/function &Int32SymbolArgsTemplate >\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: !!js/function &LongSymbolTemplate >\n () => {\n return '';\n }\n LongSymbolArgsTemplate: !!js/function &LongSymbolArgsTemplate >\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: !!js/function &LongSymbolMaxTemplate >\n () => {\n return 'Long.MAX_VALUE';\n }\n LongSymbolMaxArgsTemplate: &LongSymbolMaxArgsTemplate null\n LongSymbolMinTemplate: !!js/function &LongSymbolMinTemplate >\n () => {\n return 'Long.MIN_VALUE';\n }\n LongSymbolMinArgsTemplate: &LongSymbolMinArgsTemplate null\n LongSymbolZeroTemplate: !!js/function &LongSymbolZeroTemplate >\n () => {\n return '0L';\n }\n LongSymbolZeroArgsTemplate: &LongSymbolZeroArgsTemplate null\n LongSymbolOneTemplate: !!js/function &LongSymbolOneTemplate >\n () => {\n return '1L';\n }\n LongSymbolOneArgsTemplate: &LongSymbolOneArgsTemplate null\n LongSymbolNegOneTemplate: !!js/function &LongSymbolNegOneTemplate >\n () => {\n return '-1L';\n }\n LongSymbolNegOneArgsTemplate: &LongSymbolNegOneArgsTemplate null\n LongSymbolFromBitsTemplate:\n !!js/function &LongSymbolFromBitsTemplate > # Also has process method\n () => {\n return '';\n }\n LongSymbolFromBitsArgsTemplate: &LongSymbolFromBitsArgsTemplate null\n LongSymbolFromIntTemplate: !!js/function &LongSymbolFromIntTemplate >\n () => {\n return '';\n }\n LongSymbolFromIntArgsTemplate: !!js/function &LongSymbolFromIntArgsTemplate >\n (lhs, arg) => {\n return `${arg}L`;\n }\n LongSymbolFromNumberTemplate: !!js/function &LongSymbolFromNumberTemplate >\n () => {\n return '';\n }\n LongSymbolFromNumberArgsTemplate:\n !!js/function &LongSymbolFromNumberArgsTemplate >\n (lhs, arg) => {\n return `${arg}L`;\n }\n LongSymbolFromStringTemplate: !!js/function &LongSymbolFromStringTemplate >\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: !!js/function &TimestampSymbolTemplate >\n () => {\n return 'BSONTimestamp';\n }\n TimestampSymbolArgsTemplate: !!js/function &TimestampSymbolArgsTemplate >\n (lhs, arg1, arg2) => {\n return `(${arg1 === undefined ? 0 : arg1}, ${arg2 === undefined ? 0 : arg2})`;\n }\n SymbolSymbolTemplate: !!js/function &SymbolSymbolTemplate >\n () => {\n return 'Symbol';\n }\n SymbolSymbolArgsTemplate: &SymbolSymbolArgsTemplate null\n BSONRegExpSymbolTemplate: !!js/function &BSONRegExpSymbolTemplate >\n () => {\n return 'BsonRegularExpression';\n }\n BSONRegExpSymbolArgsTemplate: !!js/function &BSONRegExpSymbolArgsTemplate >\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: !!js/function &Decimal128SymbolTemplate >\n () => {\n return 'Decimal128';\n }\n Decimal128SymbolArgsTemplate: !!js/function &Decimal128SymbolArgsTemplate >\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:\n !!js/function &Decimal128SymbolFromStringTemplate >\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:\n !!js/function &ObjectIdCreateFromHexStringTemplate >\n () => {\n return 'new ObjectId';\n }\n ObjectIdCreateFromHexStringArgsTemplate:\n !!js/function &ObjectIdCreateFromHexStringArgsTemplate >\n (lhs, arg) => {\n return `(${arg})`;\n }\n ObjectIdCreateFromTimeTemplate:\n !!js/function &ObjectIdCreateFromTimeTemplate >\n () => {\n return 'new ObjectId';\n }\n ObjectIdCreateFromTimeArgsTemplate:\n !!js/function &ObjectIdCreateFromTimeArgsTemplate >\n (lhs, arg, isNumber) => {\n if (isNumber) {\n return `(new java.util.Date(${arg.replace(/L$/, '000L')}))`;\n }\n return `(${arg})`;\n }\n ObjectIdIsValidTemplate: !!js/function &ObjectIdIsValidTemplate >\n () => {\n return 'ObjectId.isValid';\n }\n ObjectIdIsValidArgsTemplate: !!js/function &ObjectIdIsValidArgsTemplate >\n (lhs, arg) => {\n return `(${arg})`;\n }\n # JS Symbol Templates\n NumberSymbolTemplate: !!js/function &NumberSymbolTemplate >\n () => {\n return '';\n }\n NumberSymbolArgsTemplate: !!js/function &NumberSymbolArgsTemplate >\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: !!js/function &DateSymbolTemplate >\n () => {\n return 'java.util.Date';\n }\n DateSymbolArgsTemplate: !!js/function &DateSymbolArgsTemplate >\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: !!js/function &DateSymbolNowTemplate >\n () => {\n return '';\n }\n DateSymbolNowArgsTemplate: !!js/function &DateSymbolNowArgsTemplate >\n () => {\n return 'new java.util.Date().getTime()';\n }\n RegExpSymbolTemplate: !!js/function &RegExpSymbolTemplate >\n () => {\n return 'Pattern';\n }\n RegExpSymbolArgsTemplate: &RegExpSymbolArgsTemplate null\n ImportTemplate: &ImportTemplate null\n DriverImportTemplate: !!js/function &DriverImportTemplate >\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: !!js/function &8ImportTemplate >\n () => {\n return 'import java.util.regex.Pattern;';\n }\n 9ImportTemplate: !!js/function &9ImportTemplate >\n () => {\n return 'import java.util.Arrays;';\n }\n 10ImportTemplate: !!js/function &10ImportTemplate >\n () => {\n return 'import org.bson.Document;';\n }\n 11ImportTemplate: !!js/function &11ImportTemplate >\n () => {\n return 'import org.bson.BsonNull;';\n }\n 12ImportTemplate: !!js/function &12ImportTemplate >\n () => {\n return 'import org.bson.BsonUndefined;';\n }\n 100ImportTemplate: !!js/function &100ImportTemplate >\n () => {\n return 'import org.bson.types.Code;';\n }\n 113ImportTemplate: !!js/function &113ImportTemplate >\n () => {\n return 'import org.bson.types.CodeWithScope;';\n }\n 101ImportTemplate: !!js/function &101ImportTemplate >\n () => {\n return 'import org.bson.types.ObjectId;';\n }\n 102ImportTemplate: !!js/function &102ImportTemplate >\n () => {\n return 'import org.bson.types.Binary;';\n }\n 103ImportTemplate: !!js/function &103ImportTemplate >\n () => {\n return 'import com.mongodb.DBRef;';\n }\n 104ImportTemplate: &104ImportTemplate null\n 105ImportTemplate: &105ImportTemplate null\n 106ImportTemplate: &106ImportTemplate null\n 107ImportTemplate: !!js/function &107ImportTemplate >\n () => {\n return 'import org.bson.types.MinKey;';\n }\n 108ImportTemplate: !!js/function &108ImportTemplate >\n () => {\n return 'import org.bson.types.MaxKey;';\n }\n 109ImportTemplate: !!js/function &109ImportTemplate >\n () => {\n return 'import org.bson.BsonRegularExpression;';\n }\n 110ImportTemplate: !!js/function &110ImportTemplate >\n () => {\n return 'import org.bson.types.BSONTimestamp;';\n }\n 111ImportTemplate: !!js/function &111ImportTemplate >\n () => {\n return 'import org.bson.types.Symbol;';\n }\n 112ImportTemplate: !!js/function &112ImportTemplate >\n () => {\n return 'import org.bson.types.Decimal128;';\n }\n 114ImportTemplate: !!js/function &114ImportTemplate >\n () => {\n return 'import org.bson.BsonBinarySubType;';\n }\n 200ImportTemplate: &200ImportTemplate null\n 201ImportTemplate: !!js/function &201ImportTemplate >\n () => {\n return 'import java.text.SimpleDateFormat;';\n }\n 300ImportTemplate: !!js/function &300ImportTemplate >\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: !!js/function &301ImportTemplate >\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: !!js/function &302ImportTemplate >\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: !!js/function &303ImportTemplate >\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: !!js/function &304ImportTemplate >\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: !!js/function &305ImportTemplate >\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: !!js/function &306ImportTemplate >\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"},33254:(e,t,n)=>{n(59648);const r=n(62444),{BsonTranspilersReferenceError:a,BsonTranspilersTypeError:l,BsonTranspilersRuntimeError:o}=n(65815),{removeQuotes:s}=n(67366);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 l(`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)}}},35613:(e,t,n)=>{var r=n(49871);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},37677:(e,t,n)=>{var r=n(49871),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>{?}@","ABƒC…D‡E‰F‹GHI‘J“","K•L—M™N›OPŸQ¡R£S¥T§","U©V«W­X¯Y±Z³[µ\\·]¹^»","_½`¿aÁbÃcÅdÇeÉfËgÍhÏ","iÑjÓkÕ×ÙÛÝ","ßáãåçé","ëíïñóõ","÷ùûýÿā","ăąćĉċč","ďđē","\f\f‪‫ZZzzQQqq",'\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(""),l=(new r.atn.ATNDeserializer).deserialize(a),o=l.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,l,o,new r.PredictionContextCache),this}s.prototype=Object.create(r.Lexer.prototype),s.prototype.constructor=s,Object.defineProperty(s.prototype,"atn",{get:function(){return l}}),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},38248: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# 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: !!js/function &EqualitySyntaxTemplate >\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: !!js/function &InSyntaxTemplate >\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: !!js/function &AndSyntaxTemplate >\n (args) => {\n return args.reduce((t, k, i) => {\n return t && k;\n });\n }\n OrSyntaxTemplate: !!js/function &OrSyntaxTemplate >\n (args) => {\n return args.reduce((t, k, i) => {\n return t || k;\n });\n }\n NotSyntaxTemplate: !!js/function &NotSyntaxTemplate >\n (arg) => {\n return !arg;\n }\n UnarySyntaxTemplate: !!js/function &UnarySyntaxTemplate >\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: !!js/function &BinarySyntaxTemplate >\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: !!js/function &ParensSyntaxTemplate >\n (arg) => {\n return arg;\n }\n EosSyntaxTemplate: !!js/function &EosSyntaxTemplate >\n () => {\n return \'a unique thing\';\n }\n EofSyntaxTemplate: !!js/function &EofSyntaxTemplate >\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: !!js/function &StringTypeTemplate >\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: !!js/function &RegexTypeTemplate >\n (pattern, flags) => {\n return new RegExp(pattern, flags);\n }\n BoolTypeTemplate: !!js/function &BoolTypeTemplate >\n (str) => {\n return str.toLowerCase() === \'true\';\n }\n IntegerTypeTemplate: !!js/function &IntegerTypeTemplate >\n (arg) => {\n return parseInt(arg, 10);\n }\n DecimalTypeTemplate: !!js/function &DecimalTypeTemplate >\n (arg) => {\n return parseFloat(arg);\n }\n LongBasicTypeTemplate: !!js/function &LongBasicTypeTemplate >\n (arg) => {\n return parseInt(arg, 10);\n }\n HexTypeTemplate: !!js/function &HexTypeTemplate >\n (arg) => {\n return parseInt(arg, 16);\n }\n OctalTypeTemplate: !!js/function &OctalTypeTemplate >\n (arg) => {\n arg = arg.replace(/[oO]/g, \'\')\n return parseInt(arg, 8);\n }\n NumericTypeTemplate: !!js/function &NumericTypeTemplate >\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: !!js/function &NullTypeTemplate >\n () => {\n return null;\n }\n UndefinedTypeTemplate: !!js/function &UndefinedTypeTemplate >\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:\n !!js/function &LongSymbolArgsTemplate > # 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: !!js/function &NumberSymbolTemplate >\n () => {\n return Number;\n }\n NumberSymbolArgsTemplate: &NumberSymbolArgsTemplate null # Args: lhs, arg, argType\n DateSymbolTemplate: &DateSymbolTemplate null # No args\n DateSymbolArgsTemplate: !!js/function &DateSymbolArgsTemplate >\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: !!js/function &ObjectIdToStringTemplate >\n (lhs, rhs) => {\n return lhs.toString();\n }\n ObjectIdToStringArgsTemplate: !!js/function &ObjectIdToStringArgsTemplate >\n (lhs) => {\n return lhs;\n }\n ObjectIdEqualsTemplate: !!js/function &ObjectIdEqualsTemplate >\n (lhs) => {\n return lhs;\n }\n ObjectIdEqualsArgsTemplate: !!js/function &ObjectIdEqualsArgsTemplate >\n (lhs, rhs) => {\n return lhs.equals(rhs);\n }\n ObjectIdGetTimestampTemplate: !!js/function &ObjectIdGetTimestampTemplate >\n (lhs, rhs) => {\n return lhs.getTimestamp();\n }\n ObjectIdGetTimestampArgsTemplate:\n !!js/function &ObjectIdGetTimestampArgsTemplate >\n (lhs) => {\n return lhs;\n }\n ObjectIdIsValidTemplate: !!js/function &ObjectIdIsValidTemplate >\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: !!js/function &DBRefGetDBTemplate >\n (lhs, rhs) => {\n return lhs.db;\n }\n DBRefGetCollectionTemplate: !!js/function &DBRefGetCollectionTemplate >\n (lhs, rhs) => {\n return lhs.collection;\n }\n DBRefGetIdTemplate: !!js/function &DBRefGetIdTemplate >\n (lhs, rhs) => {\n return lhs.oid;\n }\n DBRefGetDBArgsTemplate: !!js/function &DBRefGetDBArgsTemplate >\n (lhs, rhs) => {\n return lhs;\n }\n DBRefGetCollectionArgsTemplate:\n !!js/function &DBRefGetCollectionArgsTemplate >\n (lhs, rhs) => {\n return lhs;\n }\n DBRefGetIdArgsTemplate: !!js/function &DBRefGetIdArgsTemplate >\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: !!js/function &LongFloatApproxTemplate >\n (lhs, rhs) => {\n return lhs.toNumber();\n }\n LongTopTemplate: !!js/function &LongTopTemplate >\n (lhs, rhs) => {\n return lhs.high;\n }\n LongBottomTemplate: !!js/function &LongBottomTemplate >\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: !!js/function &TimestampGetLowBitsTemplate >\n (lhs, rhs) => {\n return lhs.getLowBits();\n }\n TimestampGetLowBitsArgsTemplate:\n !!js/function &TimestampGetLowBitsArgsTemplate >\n (lhs, rhs) => {\n return lhs;\n }\n TimestampGetHighBitsTemplate: !!js/function &TimestampGetHighBitsTemplate >\n (lhs, rhs) => {\n return lhs.getHighBits();\n }\n TimestampGetHighBitsArgsTemplate:\n !!js/function &TimestampGetHighBitsArgsTemplate >\n (lhs, rhs) => {\n return lhs;\n }\n TimestampTTemplate: !!js/function &TimestampTTemplate >\n (lhs, rhs) => {\n return lhs.getLowBits();\n }\n TimestampITemplate: !!js/function &TimestampITemplate >\n (lhs, rhs) => {\n return lhs.getHighBits();\n }\n TimestampAsDateTemplate: !!js/function &TimestampAsDateTemplate >\n (lhs, rhs) => {\n return new Date(lhs.getHighBits() * 1000);\n }\n TimestampAsDateArgsTemplate: !!js/function &TimestampAsDateArgsTemplate >\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: !!js/function &DateSymbolNowTemplate >\n () => {\n return Date.now;\n }\n DateSymbolNowArgsTemplate: &DateSymbolNowArgsTemplate null\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:\n !!js/function &ObjectIdCreateFromTimeTemplate >\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'},38686:(e,t,n)=>{n.d(t,{Rp:()=>s,_6:()=>p,nq:()=>o,xb:()=>l});var r=n(20990),a=(n(27348),n(65994).process);class l extends Error{statusCode;errorCode;detail;constructor(e,t,n,r){super(`${r}: ${n}`),this.name=e,this.statusCode=t,this.errorCode=r,this.detail=n}}function o(e){if(!e.getPreferences().networkTraffic)throw new Error("Network traffic is not allowed")}async function s(e){if(e.ok)return;const t=await e.json().catch((()=>{})),n=e.status;let r=e.statusText,a=`${e.status}`,o="NetworkError";var s;throw s=t,Boolean(s&&s.error&&s.errorCode&&s.detail)&&(o="ServerError",r=t.detail,a=t.errorCode),function(e){return Boolean(e&&e.errorCode&&e.message&&e.version&&e.status)}(t)&&(o="ServerError",r=t.message,a=t.errorCode),new l(o,n,r,a)}const i=Object.create({"atlas-local":{ccsBaseUrl:"ws://localhost:61001/ws",multiplexedWsBaseUrls:["ws://cloud-local.mongodb.com/ccs"],cloudBaseUrl:"",atlasApiBaseUrl:"http://cloud-local.mongodb.com/api/private",atlasLogin:{clientId:"0oaq1le5jlzxCuTbu357",issuer:"https://auth-qa.mongodb.com/oauth2/default"},authPortalUrl:"https://account-local.mongodb.com/account/login",assistantApiBaseUrl:"https://knowledge-dev.mongodb.com/api/v1",userDataBaseUrl:"https://cloud-local.mongodb.com/ui/userData"},"atlas-dev":{ccsBaseUrl:"",multiplexedWsBaseUrls:["wss://cloud-dev.mongodb.com/ccs"],cloudBaseUrl:"",atlasApiBaseUrl:"https://cloud-dev.mongodb.com/api/private",atlasLogin:{clientId:"0oaq1le5jlzxCuTbu357",issuer:"https://auth-qa.mongodb.com/oauth2/default"},authPortalUrl:"https://account-dev.mongodb.com/account/login",assistantApiBaseUrl:"https://knowledge-dev.mongodb.com/api/v1",userDataBaseUrl:"https://cloud-dev.mongodb.com/ui/userData"},"atlas-qa":{ccsBaseUrl:"",multiplexedWsBaseUrls:["wss://cloud-qa.mongodb.com/ccs"],cloudBaseUrl:"",atlasApiBaseUrl:"https://cloud-qa.mongodb.com/api/private",atlasLogin:{clientId:"0oaq1le5jlzxCuTbu357",issuer:"https://auth-qa.mongodb.com/oauth2/default"},authPortalUrl:"https://account-qa.mongodb.com/account/login",assistantApiBaseUrl:"https://knowledge-dev.mongodb.com/api/v1",userDataBaseUrl:"https://cloud-qa.mongodb.com/ui/userData"},"atlas-staging":{ccsBaseUrl:"",multiplexedWsBaseUrls:["wss://cloud-stage.mongodb.com/ccs"],cloudBaseUrl:"",atlasApiBaseUrl:"https://cloud-stage.mongodb.com/api/private",atlasLogin:{clientId:"0oaq1le5jlzxCuTbu357",issuer:"https://auth-qa.mongodb.com/oauth2/default"},authPortalUrl:"https://account-stage.mongodb.com/account/login",assistantApiBaseUrl:"https://knowledge-staging.mongodb.com/api/v1",userDataBaseUrl:"https://cloud-stage.mongodb.com/ui/userData"},atlas:{ccsBaseUrl:"",multiplexedWsBaseUrls:["wss://cloud.mongodb.com/ccs"],cloudBaseUrl:"",atlasApiBaseUrl:"https://cloud.mongodb.com/api/private",atlasLogin:{clientId:"0oajzdcznmE8GEyio297",issuer:"https://auth.mongodb.com/oauth2/default"},authPortalUrl:"https://account.mongodb.com/account/login",assistantApiBaseUrl:"https://knowledge.mongodb.com/api/v1",userDataBaseUrl:"https://cloud.mongodb.com/ui/userData"}});function p(e){const{atlasServiceBackendPreset:t}=e.getPreferences(),n={atlasApiBaseUrl:a.env.COMPASS_ATLAS_SERVICE_UNAUTH_BASE_URL_OVERRIDE,cloudBaseUrl:a.env.COMPASS_CLOUD_BASE_URL_OVERRIDE,atlasLogin:{clientId:a.env.COMPASS_CLIENT_ID_OVERRIDE,issuer:a.env.COMPASS_OIDC_ISSUER_OVERRIDE},authPortalUrl:a.env.COMPASS_ATLAS_AUTH_PORTAL_URL_OVERRIDE,assistantApiBaseUrl:a.env.COMPASS_ASSISTANT_BASE_URL_OVERRIDE,userDataBaseUrl:a.env.COMPASS_USER_DATA_BASE_URL_OVERRIDE};return(0,r.defaultsDeep)(n,i[t])}},52612:(e,t,n)=>{n.d(t,{n:()=>a});var r=n(8763);class a extends r.EventEmitter{on(e,t){return super.on(e,t)}once(e,t){return super.once(e,t)}off(e,t){return super.off(e,t)}removeListener(e,t){return super.removeListener(e,t)}emit(e,...t){return super.emit(e,...t)}}},55387: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# 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: !!js/function &DriverTemplate >\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: !!js/function &EqualitySyntaxTemplate >\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: !!js/function &InSyntaxTemplate >\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: !!js/function &AndSyntaxTemplate >\n (args) => {\n return args.join(' && ');\n }\n OrSyntaxTemplate: !!js/function &OrSyntaxTemplate >\n (args) => {\n return args.join(' || ');\n }\n NotSyntaxTemplate: !!js/function &NotSyntaxTemplate >\n (arg) => {\n return `!${arg}`;\n }\n UnarySyntaxTemplate: &UnarySyntaxTemplate null\n BinarySyntaxTemplate: !!js/function &BinarySyntaxTemplate >\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: !!js/function &StringTypeTemplate >\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: !!js/function &RegexTypeTemplate >\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: !!js/function &BoolTypeTemplate >\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: !!js/function &OctalTypeTemplate >\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: !!js/function &ArrayTypeTemplate >\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: !!js/function &NullTypeTemplate >\n () => {\n return 'nil';\n }\n UndefinedTypeTemplate: !!js/function &UndefinedTypeTemplate >\n () => {\n return 'nil';\n }\n ObjectTypeTemplate: !!js/function &ObjectTypeTemplate >\n (literal) => {\n if (literal === '') {\n return '{}';\n }\n return literal;\n }\n ObjectTypeArgsTemplate: !!js/function &ObjectTypeArgsTemplate >\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: !!js/function &CodeSymbolTemplate >\n () => {\n return 'BSON::Code'\n }\n CodeSymbolArgsTemplate: !!js/function &CodeSymbolArgsTemplate >\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: !!js/function &ObjectIdSymbolTemplate >\n () => {\n return 'BSON::ObjectId';\n }\n ObjectIdSymbolArgsTemplate: !!js/function &ObjectIdSymbolArgsTemplate >\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: !!js/function &DBRefSymbolTemplate >\n () => {\n return 'BSON::DBRef'\n }\n DBRefSymbolArgsTemplate: !!js/function &DBRefSymbolArgsTemplate >\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: !!js/function &DoubleSymbolTemplate >\n () => {\n return '';\n }\n DoubleSymbolArgsTemplate: !!js/function &DoubleSymbolArgsTemplate >\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: !!js/function &Int32SymbolTemplate >\n () => {\n return '';\n }\n Int32SymbolArgsTemplate: !!js/function &Int32SymbolArgsTemplate >\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: !!js/function &LongSymbolTemplate >\n () => {\n return ''\n }\n LongSymbolArgsTemplate: !!js/function &LongSymbolArgsTemplate >\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: !!js/function &RegExpSymbolTemplate >\n () => {\n return '';\n }\n RegExpSymbolArgsTemplate: &RegExpSymbolArgsTemplate null # Args: lhs, pattern, flags\n SymbolSymbolTemplate: !!js/function &SymbolSymbolTemplate >\n () => {\n return '';\n }\n SymbolSymbolArgsTemplate: !!js/function &SymbolSymbolArgsTemplate >\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: !!js/function &BSONRegExpSymbolTemplate >\n () => {\n return '';\n }\n BSONRegExpSymbolArgsTemplate: !!js/function &BSONRegExpSymbolArgsTemplate >\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: !!js/function &Decimal128SymbolTemplate >\n () => {\n return 'BSON::Decimal128';\n }\n Decimal128SymbolArgsTemplate: !!js/function &Decimal128SymbolArgsTemplate >\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: !!js/function &MinKeySymbolTemplate >\n () => {\n return 'BSON::MinKey';\n }\n MinKeySymbolArgsTemplate: !!js/function &MinKeySymbolArgsTemplate >\n () => {\n return '.new';\n }\n MaxKeySymbolTemplate: !!js/function &MaxKeySymbolTemplate >\n () => {\n return 'BSON::MaxKey';\n }\n MaxKeySymbolArgsTemplate: !!js/function &MaxKeySymbolArgsTemplate >\n () => {\n return '.new';\n }\n TimestampSymbolTemplate: !!js/function &TimestampSymbolTemplate >\n () => {\n return 'BSON::Timestamp';\n }\n TimestampSymbolArgsTemplate: !!js/function &TimestampSymbolArgsTemplate >\n (lhs, arg1, arg2) => {\n return `.new(${arg1 === undefined ? 0 : arg1}, ${arg2 === undefined ? 0 : arg2})`;\n }\n # non bson-specific\n NumberSymbolTemplate: !!js/function &NumberSymbolTemplate >\n () => {\n return '';\n }\n NumberSymbolArgsTemplate: !!js/function &NumberSymbolArgsTemplate >\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: !!js/function &DateSymbolTemplate >\n () => {\n return 'Time';\n }\n DateSymbolArgsTemplate: !!js/function &DateSymbolArgsTemplate >\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: !!js/function &DateSymbolNowTemplate >\n () => {\n return 'Time.now.utc';\n }\n DateSymbolNowArgsTemplate: !!js/function &DateSymbolNowArgsTemplate >\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: !!js/function &CodeCodeTemplate >\n (lhs) => {\n return `${lhs}.javascript`;\n }\n CodeCodeArgsTemplate: !!js/function &CodeCodeArgsTemplate >\n () => {\n return '';\n }\n CodeScopeTemplate: !!js/function &CodeScopeTemplate >\n (lhs) => {\n return `${lhs}.scope`;\n }\n CodeScopeArgsTemplate: !!js/function &CodeScopeArgsTemplate >\n () => {\n return '';\n }\n ObjectIdToStringTemplate: !!js/function &ObjectIdToStringTemplate >\n (lhs) => {\n return `${lhs}.to_s`;\n }\n ObjectIdToStringArgsTemplate: !!js/function &ObjectIdToStringArgsTemplate >\n () => {\n return '';\n }\n ObjectIdEqualsTemplate: !!js/function &ObjectIdEqualsTemplate >\n (lhs) => {\n return `${lhs} == `;\n }\n ObjectIdEqualsArgsTemplate: !!js/function &ObjectIdEqualsArgsTemplate >\n (arg) => {\n return `${arg}`;\n }\n ObjectIdGetTimestampTemplate: !!js/function &ObjectIdGetTimestampTemplate >\n (lhs) => {\n return `${lhs}.to_time`;\n }\n ObjectIdGetTimestampArgsTemplate:\n !!js/function &ObjectIdGetTimestampArgsTemplate >\n () => {\n return '';\n }\n ObjectIdIsValidTemplate: !!js/function &ObjectIdIsValidTemplate >\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: !!js/function &DBRefGetDBTemplate >\n (lhs) => {\n return `${lhs}.database`;\n }\n DBRefGetCollectionTemplate: !!js/function &DBRefGetCollectionTemplate >\n (lhs) => {\n return `${lhs}.collection`;\n }\n DBRefGetIdTemplate: !!js/function &DBRefGetIdTemplate >\n (lhs) => {\n return `${lhs}.id`;\n }\n DBRefGetDBArgsTemplate: !!js/function &DBRefGetDBArgsTemplate >\n (lhs) => {\n return '';\n }\n DBRefGetCollectionArgsTemplate:\n !!js/function &DBRefGetCollectionArgsTemplate >\n (lhs) => {\n return '';\n }\n DBRefGetIdArgsTemplate: !!js/function &DBRefGetIdArgsTemplate >\n (lhs) => {\n return '';\n }\n DBRefToStringTemplate: !!js/function &DBRefToStringTemplate >\n (lhs) => {\n return '${lhs}.to_s';\n }\n DBRefToStringArgsTemplate: !!js/function &DBRefToStringArgsTemplate >\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: !!js/function &LongEqualsTemplate >\n (lhs) => {\n return `${lhs} ==`;\n }\n LongEqualsArgsTemplate: !!js/function &LongEqualsArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongToIntTemplate: !!js/function &LongToIntTemplate >\n (lhs) => {\n return `${lhs}`;\n }\n LongToIntArgsTemplate: !!js/function &LongToIntArgsTemplate >\n () => {\n return '';\n }\n LongToStringTemplate: !!js/function &LongToStringTemplate >\n (lhs) => {\n return `${lhs}.to_s`;\n }\n LongToStringArgsTemplate: !!js/function &LongToStringArgsTemplate >\n () => {\n return '';\n }\n LongToNumberTemplate: !!js/function &LongToNumberTemplate >\n (lhs) => {\n return `${lhs}.to_f`;\n }\n LongToNumberArgsTemplate: !!js/function &LongToNumberArgsTemplate >\n () => {\n return '';\n }\n LongAddTemplate: !!js/function &LongAddTemplate >\n (lhs) => {\n return `${lhs} +`;\n }\n LongAddArgsTemplate: !!js/function &LongAddArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongSubtractTemplate: !!js/function &LongSubtractTemplate >\n (arg) => {\n return `${arg} -`;\n }\n LongSubtractArgsTemplate: !!js/function &LongSubtractArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongMultiplyTemplate: !!js/function &LongMultiplyTemplate >\n (arg) => {\n return `${arg} *`;\n }\n LongMultiplyArgsTemplate: !!js/function &LongMultiplyArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongDivTemplate: !!js/function &LongDivTemplate >\n (lhs) => {\n return `${lhs} /`;\n }\n LongDivArgsTemplate: !!js/function &LongDivArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongModuloTemplate: !!js/function &LongModuloTemplate >\n (lhs) => {\n return `${lhs} %`;\n }\n LongModuloArgsTemplate: !!js/function &LongModuloArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongAndTemplate: !!js/function &LongAndTemplate >\n (lhs) => {\n return `${lhs} &`;\n }\n LongAndArgsTemplate: !!js/function &LongAndArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongOrTemplate: !!js/function &LongOrTemplate >\n (lhs) => {\n return `${lhs} |`;\n }\n LongOrArgsTemplate: !!js/function &LongOrArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongXorTemplate: !!js/function &LongXorTemplate >\n (lhs) => {\n return `${lhs} ^`;\n }\n LongXorArgsTemplate: !!js/function &LongXorArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongShiftLeftTemplate: !!js/function &LongShiftLeftTemplate >\n (lhs) => {\n return `${lhs} <<`;\n }\n LongShiftLeftArgsTemplate: !!js/function &LongShiftLeftArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongShiftRightTemplate: !!js/function &LongShiftRightTemplate >\n (lhs) => {\n return `${lhs} >>`;\n }\n LongShiftRightArgsTemplate: !!js/function &LongShiftRightArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongCompareTemplate: !!js/function &LongCompareTemplate >\n (lhs) => {\n return `${lhs} -`;\n }\n LongCompareArgsTemplate: !!js/function &LongCompareArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongIsOddTemplate: !!js/function &LongIsOddTemplate >\n (lhs) => {\n return `(${lhs} % 2) == 1`;\n }\n LongIsOddArgsTemplate: !!js/function &LongIsOddArgsTemplate >\n () => {\n return '';\n }\n LongIsZeroTemplate: !!js/function &LongIsZeroTemplate >\n (lhs) => {\n return `${lhs} == 0`;\n }\n LongIsZeroArgsTemplate: !!js/function &LongIsZeroArgsTemplate >\n () => {\n return '';\n }\n LongIsNegativeTemplate: !!js/function &LongIsNegativeTemplate >\n (lhs) => {\n return `${lhs} < 0`;\n }\n LongIsNegativeArgsTemplate: !!js/function &LongIsNegativeArgsTemplate >\n () => {\n return '';\n }\n LongNegateTemplate: !!js/function &LongNegateTemplate >\n () => {\n return '-';\n }\n LongNegateArgsTemplate: !!js/function &LongNegateArgsTemplate >\n (lhs) => {\n return lhs;\n }\n LongNotTemplate: !!js/function &LongNotTemplate >\n () => {\n return '~';\n }\n LongNotArgsTemplate: !!js/function &LongNotArgsTemplate >\n (lhs) => {\n return lhs;\n }\n LongNotEqualsTemplate: !!js/function &LongNotEqualsTemplate >\n (lhs) => {\n return `${lhs} !=`;\n }\n LongNotEqualsArgsTemplate: !!js/function &LongNotEqualsArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanTemplate: !!js/function &LongGreaterThanTemplate >\n (lhs) => {\n return `${lhs} >`;\n }\n LongGreaterThanArgsTemplate: !!js/function &LongGreaterThanArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanOrEqualTemplate:\n !!js/function &LongGreaterThanOrEqualTemplate >\n (lhs) => {\n return `${lhs} >=`;\n }\n LongGreaterThanOrEqualArgsTemplate:\n !!js/function &LongGreaterThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanTemplate: !!js/function &LongLessThanTemplate >\n (lhs) => {\n return `${lhs} <`;\n }\n LongLessThanArgsTemplate: !!js/function &LongLessThanArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanOrEqualTemplate: !!js/function &LongLessThanOrEqualTemplate >\n (lhs) => {\n return `${lhs} <=`;\n }\n LongLessThanOrEqualArgsTemplate:\n !!js/function &LongLessThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongFloatApproxTemplate: !!js/function &LongFloatApproxTemplate >\n (lhs) => {\n return `${lhs}.to_f`;\n }\n LongTopTemplate: !!js/function &LongTopTemplate >\n (lhs) => {\n return `${lhs} >> 32`;\n }\n LongBottomTemplate: !!js/function &LongBottomTemplate >\n (lhs) => {\n return `${lhs} & 0x0000ffff`;\n }\n TimestampToStringTemplate: !!js/function &TimestampToStringTemplate >\n (lhs) => {\n return `${lhs}.to_s`;\n }\n TimestampToStringArgsTemplate: !!js/function &TimestampToStringArgsTemplate >\n () => {\n return '';\n }\n TimestampEqualsTemplate: !!js/function &TimestampEqualsTemplate >\n (lhs) => {\n return `${lhs} == `;\n }\n TimestampEqualsArgsTemplate: !!js/function &TimestampEqualsArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampGetLowBitsTemplate: !!js/function &TimestampGetLowBitsTemplate >\n (lhs) => {\n return `${lhs}.seconds`;\n }\n TimestampGetLowBitsArgsTemplate:\n !!js/function &TimestampGetLowBitsArgsTemplate >\n () => {\n return ''\n }\n TimestampGetHighBitsTemplate: !!js/function &TimestampGetHighBitsTemplate >\n (lhs) => {\n return `${lhs}.increment`;\n }\n TimestampGetHighBitsArgsTemplate:\n !!js/function &TimestampGetHighBitsArgsTemplate >\n () => {\n return ''\n }\n TimestampTTemplate: !!js/function &TimestampTTemplate >\n (lhs) => {\n return `${lhs}.seconds`;\n }\n TimestampITemplate: !!js/function &TimestampITemplate >\n (lhs) => {\n return `${lhs}.increment`;\n }\n TimestampAsDateTemplate: !!js/function &TimestampAsDateTemplate >\n (lhs) => {\n return `Time.at(${lhs}.increment).utc`;\n }\n TimestampAsDateArgsTemplate: &TimestampAsDateArgsTemplate null\n TimestampCompareTemplate: !!js/function &TimestampCompareTemplate >\n (lhs) => {\n return `${lhs} <=> `;\n }\n TimestampCompareArgsTemplate: !!js/function &TimestampCompareArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampNotEqualsTemplate: !!js/function &TimestampNotEqualsTemplate >\n (lhs) => {\n return `${lhs} != `;\n }\n TimestampNotEqualsArgsTemplate:\n !!js/function &TimestampNotEqualsArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampGreaterThanTemplate: !!js/function &TimestampGreaterThanTemplate >\n (lhs) => {\n return `${lhs} > `;\n }\n TimestampGreaterThanArgsTemplate:\n !!js/function &TimestampGreaterThanArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampGreaterThanOrEqualTemplate:\n !!js/function &TimestampGreaterThanOrEqualTemplate >\n (lhs) => {\n return `${lhs} >= `;\n }\n TimestampGreaterThanOrEqualArgsTemplate:\n !!js/function &TimestampGreaterThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampLessThanTemplate: !!js/function &TimestampLessThanTemplate >\n (lhs) => {\n return `${lhs} < `;\n }\n TimestampLessThanArgsTemplate: !!js/function &TimestampLessThanArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampLessThanOrEqualTemplate:\n !!js/function &TimestampLessThanOrEqualTemplate >\n (lhs) => {\n return `${lhs} <= `;\n }\n TimestampLessThanOrEqualArgsTemplate:\n !!js/function &TimestampLessThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n SymbolValueOfTemplate: !!js/function &SymbolValueOfTemplate >\n (lhs) => {\n return lhs;\n }\n SymbolValueOfArgsTemplate: !!js/function &SymbolValueOfArgsTemplate >\n () => {\n return '';\n }\n SymbolInspectTemplate: !!js/function &SymbolInspectTemplate >\n (lhs) => {\n return `${lhs}.inspect`;\n }\n SymbolInspectArgsTemplate: !!js/function &SymbolInspectArgsTemplate >\n () => {\n return '';\n }\n SymbolToStringTemplate: !!js/function &SymbolToStringTemplate >\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: !!js/function &SymbolToStringArgsTemplate >\n (lhs) => {\n return '';\n }\n Decimal128ToStringTemplate: !!js/function &Decimal128ToStringTemplate >\n (lhs) => {\n return `${lhs}.to_s`;\n }\n Decimal128ToStringArgsTemplate:\n !!js/function &Decimal128ToStringArgsTemplate >\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: !!js/function &LongSymbolMaxTemplate >\n () => {\n return '9223372036854775807';\n }\n LongSymbolMaxArgsTemplate: &LongSymbolMaxArgsTemplate null\n LongSymbolMinTemplate: !!js/function &LongSymbolMinTemplate >\n () => {\n return '-9223372036854775808';\n }\n LongSymbolMinArgsTemplate: &LongSymbolMinArgsTemplate null\n LongSymbolZeroTemplate: !!js/function &LongSymbolZeroTemplate >\n () => {\n return '0';\n }\n LongSymbolZeroArgsTemplate: &LongSymbolZeroArgsTemplate null\n LongSymbolOneTemplate: !!js/function &LongSymbolOneTemplate >\n () => {\n return '1';\n }\n LongSymbolOneArgsTemplate: &LongSymbolOneArgsTemplate null\n LongSymbolNegOneTemplate: !!js/function &LongSymbolNegOneTemplate >\n () => {\n return '-1';\n }\n LongSymbolNegOneArgsTemplate: &LongSymbolNegOneArgsTemplate null\n LongSymbolFromBitsTemplate: !!js/function &LongSymbolFromBitsTemplate >\n () => {\n return '';\n }\n LongSymbolFromBitsArgsTemplate: &LongSymbolFromBitsArgsTemplate null\n LongSymbolFromIntTemplate: !!js/function &LongSymbolFromIntTemplate >\n () => {\n return '';\n }\n LongSymbolFromIntArgsTemplate: !!js/function &LongSymbolFromIntArgsTemplate >\n (lhs, arg) => {\n return arg;\n }\n LongSymbolFromNumberTemplate: &LongSymbolFromNumberTemplate null\n LongSymbolFromNumberArgsTemplate: &LongSymbolFromNumberArgsTemplate null\n LongSymbolFromStringTemplate: !!js/function &LongSymbolFromStringTemplate >\n () => {\n return '';\n }\n LongSymbolFromStringArgsTemplate:\n !!js/function &LongSymbolFromStringArgsTemplate >\n (lhs, arg) => {\n return `${arg}.to_i`;\n }\n Decimal128SymbolFromStringTemplate:\n !!js/function &Decimal128SymbolFromStringTemplate >\n () => {\n return 'BSON::Decimal128';\n }\n Decimal128SymbolFromStringArgsTemplate:\n !!js/function &Decimal128SymbolFromStringArgsTemplate >\n (lhs, arg) => {\n return `.new(${arg})`;\n }\n ObjectIdCreateFromHexStringTemplate:\n !!js/function &ObjectIdCreateFromHexStringTemplate >\n () => {\n return 'BSON::ObjectId';\n }\n ObjectIdCreateFromHexStringArgsTemplate:\n !!js/function &ObjectIdCreateFromHexStringArgsTemplate >\n (lhs, arg) => {\n return `(${arg})`;\n }\n ObjectIdCreateFromTimeTemplate:\n !!js/function &ObjectIdCreateFromTimeTemplate >\n () => {\n return 'BSON::ObjectId.from_time';\n }\n ObjectIdCreateFromTimeArgsTemplate:\n !!js/function &ObjectIdCreateFromTimeArgsTemplate >\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 # 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: !!js/function &ImportTemplate >\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: !!js/function &DriverImportTemplate >\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: !!js/function &100ImportTemplate >\n () => {\n return `require 'bson'`\n }\n 101ImportTemplate: !!js/function &101ImportTemplate >\n () => {\n return `require 'bson'`\n }\n 102ImportTemplate: !!js/function &102ImportTemplate >\n () => {\n return `require 'bson'`\n }\n 103ImportTemplate: !!js/function &103ImportTemplate >\n () => {\n return `require 'bson'`\n }\n 104ImportTemplate: &104ImportTemplate null\n 105ImportTemplate: &105ImportTemplate null\n 106ImportTemplate: &106ImportTemplate null\n 107ImportTemplate: !!js/function &107ImportTemplate >\n () => {\n return `require 'bson'`\n }\n 108ImportTemplate: !!js/function &108ImportTemplate >\n () => {\n return `require 'bson'`\n }\n 109ImportTemplate: &109ImportTemplate null\n 110ImportTemplate: !!js/function &110ImportTemplate >\n () => {\n return `require 'bson'`\n }\n 111ImportTemplate: &111ImportTemplate null\n 112ImportTemplate: !!js/function &112ImportTemplate >\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"},56971: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# 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: !!js/function &DriverTemplate >\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: !!js/function &EqualitySyntaxTemplate >\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: !!js/function &InSyntaxTemplate >\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: !!js/function &AndSyntaxTemplate >\n (args) => {\n return args.join(' && ');\n }\n OrSyntaxTemplate: !!js/function &OrSyntaxTemplate >\n (args) => {\n return args.join(' || ');\n }\n NotSyntaxTemplate: !!js/function &NotSyntaxTemplate >\n (arg) => {\n return `! ${arg}`;\n }\n UnarySyntaxTemplate: !!js/function &UnarySyntaxTemplate >\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: !!js/function &BinarySyntaxTemplate >\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: !!js/function &StringTypeTemplate >\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: !!js/function &RegexTypeTemplate >\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: !!js/function &BoolTypeTemplate >\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: !!js/function &OctalTypeTemplate >\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: !!js/function &ArrayTypeTemplate >\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: !!js/function &NullTypeTemplate >\n () => {\n return 'null';\n }\n UndefinedTypeTemplate: !!js/function &UndefinedTypeTemplate >\n () => {\n return 'null';\n }\n ObjectTypeTemplate: !!js/function &ObjectTypeTemplate >\n (literal) => {\n return `${literal}`;\n }\n ObjectTypeArgsTemplate: !!js/function &ObjectTypeArgsTemplate >\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: !!js/function &CodeSymbolTemplate >\n () => {\n return 'new Javascript';\n }\n CodeSymbolArgsTemplate: !!js/function &CodeSymbolArgsTemplate >\n (lhs, code, scope) => {\n return !scope \n ? `(${this.utils.stringifyWithSingleQuotes(code)})` \n : `(${this.utils.stringifyWithSingleQuotes(code)}, ${scope})`\n ;\n }\n ObjectIdSymbolTemplate: !!js/function &ObjectIdSymbolTemplate >\n () => {\n return 'new ObjectId';\n }\n ObjectIdSymbolArgsTemplate: !!js/function &ObjectIdSymbolArgsTemplate >\n (lhs, id) => {\n return !id \n ? `()` \n : `(${this.utils.stringifyWithSingleQuotes(id)})`\n ;\n }\n BinarySymbolTemplate: !!js/function &BinarySymbolTemplate >\n () => {\n return 'new Binary';\n }\n BinarySymbolArgsTemplate: !!js/function &BinarySymbolArgsTemplate >\n (lhs, bytes, type) => {\n if (type === null) {\n type = 'Binary::TYPE_GENERIC';\n }\n return `(${this.utils.stringifyWithSingleQuotes(bytes)}, ${type})`;\n }\n BinarySymbolSubtypeDefaultTemplate:\n !!js/function &BinarySymbolSubtypeDefaultTemplate >\n () => {\n return 'Binary::TYPE_GENERIC';\n }\n BinarySymbolSubtypeFunctionTemplate:\n !!js/function &BinarySymbolSubtypeFunctionTemplate >\n () => {\n return 'Binary::TYPE_FUNCTION';\n }\n BinarySymbolSubtypeByteArrayTemplate:\n !!js/function &BinarySymbolSubtypeByteArrayTemplate >\n () => {\n return 'Binary::TYPE_OLD_BINARY';\n }\n BinarySymbolSubtypeUuidOldTemplate:\n !!js/function &BinarySymbolSubtypeUuidOldTemplate >\n () => {\n return 'Binary::TYPE_OLD_UUID';\n }\n BinarySymbolSubtypeUuidTemplate:\n !!js/function &BinarySymbolSubtypeUuidTemplate >\n () => {\n return 'Binary::TYPE_UUID';\n }\n BinarySymbolSubtypeMd5Template:\n !!js/function &BinarySymbolSubtypeMd5Template >\n () => {\n return 'Binary::TYPE_MD5';\n }\n BinarySymbolSubtypeUserDefinedTemplate:\n !!js/function &BinarySymbolSubtypeUserDefinedTemplate >\n () => {\n return 'Binary::TYPE_USER_DEFINED';\n }\n DBRefSymbolTemplate: !!js/function &DBRefSymbolTemplate >\n () => {\n return ''\n }\n DBRefSymbolArgsTemplate: !!js/function &DBRefSymbolArgsTemplate >\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: !!js/function &DoubleSymbolTemplate >\n () => {\n return '';\n }\n DoubleSymbolArgsTemplate: !!js/function &DoubleSymbolArgsTemplate >\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: !!js/function &Int32SymbolTemplate >\n () => {\n return '';\n }\n Int32SymbolArgsTemplate: !!js/function &Int32SymbolArgsTemplate >\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: !!js/function &LongSymbolTemplate >\n () => {\n return ''\n }\n LongSymbolArgsTemplate: !!js/function &LongSymbolArgsTemplate >\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: !!js/function &RegExpSymbolTemplate >\n () => {\n return 'new Regex';\n }\n RegExpSymbolArgsTemplate: &RegExpSymbolArgsTemplate null # Args: lhs, pattern, flags\n SymbolSymbolTemplate: !!js/function &SymbolSymbolTemplate >\n () => {\n return '';\n }\n SymbolSymbolArgsTemplate: !!js/function &SymbolSymbolArgsTemplate >\n (lhs, arg) => {\n return arg;\n }\n BSONRegExpSymbolTemplate: !!js/function &BSONRegExpSymbolTemplate >\n () => {\n return 'new Regex';\n }\n BSONRegExpSymbolArgsTemplate: !!js/function &BSONRegExpSymbolArgsTemplate >\n (lhs, pattern, flags) => {\n return `(${this.utils.stringifyWithDoubleQuotes(pattern)}${flags ? ', ' + this.utils.stringifyWithDoubleQuotes(flags) : ''})`;\n }\n Decimal128SymbolTemplate: !!js/function &Decimal128SymbolTemplate >\n () => {\n return 'new Decimal128';\n }\n Decimal128SymbolArgsTemplate: !!js/function &Decimal128SymbolArgsTemplate >\n (lhs, arg) => {\n arg = arg === undefined ? '0' : arg.toString();\n return `('${this.utils.removeStringQuotes(arg)}')`;\n }\n MinKeySymbolTemplate: !!js/function &MinKeySymbolTemplate >\n () => {\n return 'new MinKey';\n }\n MinKeySymbolArgsTemplate: !!js/function &MinKeySymbolArgsTemplate >\n () => {\n return `()`;\n }\n MaxKeySymbolTemplate: !!js/function &MaxKeySymbolTemplate >\n () => {\n return 'new MaxKey';\n }\n MaxKeySymbolArgsTemplate: !!js/function &MaxKeySymbolArgsTemplate >\n () => {\n return `()`;\n }\n TimestampSymbolTemplate: !!js/function &TimestampSymbolTemplate >\n () => {\n return 'new Timestamp';\n }\n TimestampSymbolArgsTemplate: !!js/function &TimestampSymbolArgsTemplate >\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: !!js/function &NumberSymbolTemplate >\n () => ''\n NumberSymbolArgsTemplate: !!js/function &NumberSymbolArgsTemplate >\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: !!js/function &DateSymbolTemplate >\n () => {\n return 'UTCDateTime';\n }\n DateSymbolArgsTemplate: !!js/function &DateSymbolArgsTemplate >\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: !!js/function &DateSymbolNowTemplate >\n () => {\n return `new UTCDateTime()`;\n }\n DateSymbolNowArgsTemplate: !!js/function &DateSymbolNowArgsTemplate >\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: !!js/function &CodeCodeTemplate >\n (lhs) => {\n return `(${lhs})->getCode()`;\n }\n CodeCodeArgsTemplate: !!js/function &CodeCodeArgsTemplate >\n () => {\n return '';\n }\n CodeScopeTemplate: !!js/function &CodeScopeTemplate >\n (lhs) => {\n return `(${lhs})->getScope()`;\n }\n CodeScopeArgsTemplate: !!js/function &CodeScopeArgsTemplate >\n () => {\n return '';\n }\n ObjectIdToStringTemplate: !!js/function &ObjectIdToStringTemplate >\n (lhs) => {\n return `(string) ${lhs}`;\n }\n ObjectIdToStringArgsTemplate: !!js/function &ObjectIdToStringArgsTemplate >\n () => {\n return '';\n }\n ObjectIdEqualsTemplate: !!js/function &ObjectIdEqualsTemplate >\n (lhs) => {\n return `${lhs} == `;\n }\n ObjectIdEqualsArgsTemplate: !!js/function &ObjectIdEqualsArgsTemplate >\n (arg) => {\n return `${arg}`;\n }\n ObjectIdGetTimestampTemplate: !!js/function &ObjectIdGetTimestampTemplate >\n (lhs) => {\n return `(${lhs})->getTimestamp()`;\n }\n ObjectIdGetTimestampArgsTemplate:\n !!js/function &ObjectIdGetTimestampArgsTemplate >\n () => {\n return '';\n }\n ObjectIdIsValidTemplate: !!js/function &ObjectIdIsValidTemplate >\n (lhs) => {\n return ``;\n }\n ObjectIdIsValidArgsTemplate: !!js/function &ObjectIdIsValidArgsTemplate >\n (lhs, arg) => {\n return `(\\\\ctype_xdigit(${this.utils.stringifyWithSingleQuotes(arg)}) && \\\\strlen(${this.utils.stringifyWithSingleQuotes(arg)}) == 24)`;\n }\n BinaryValueTemplate: !!js/function &BinaryValueTemplate >\n (lhs) => {\n return `(${lhs})->getData()`;\n }\n BinaryValueArgsTemplate: !!js/function &BinaryValueArgsTemplate >\n () => {\n return '';\n }\n BinaryLengthTemplate: !!js/function &BinaryLengthTemplate >\n (lhs) => {\n return `\\\\strlen((${lhs})->getData())`;\n }\n BinaryLengthArgsTemplate: !!js/function &BinaryLengthArgsTemplate >\n () => {\n return '';\n }\n BinaryToStringTemplate: !!js/function &BinaryToStringTemplate >\n (lhs) => {\n return `(${lhs})->getData()`;\n }\n BinaryToStringArgsTemplate: !!js/function &BinaryToStringArgsTemplate >\n () => {\n return '';\n }\n BinarySubtypeTemplate: !!js/function &BinarySubtypeTemplate >\n (lhs) => {\n return `(${lhs})->getType()`;\n }\n BinarySubtypeArgsTemplate: !!js/function &BinarySubtypeArgsTemplate >\n () => {\n return '';\n }\n DBRefGetDBTemplate: !!js/function &DBRefGetDBTemplate >\n (lhs) => {\n return `${lhs}['$db']`;\n }\n DBRefGetCollectionTemplate: !!js/function &DBRefGetCollectionTemplate >\n (lhs) => {\n return `${lhs}['$ref']`;\n }\n DBRefGetIdTemplate: !!js/function &DBRefGetIdTemplate >\n (lhs) => {\n return `${lhs}['$id']`;\n }\n DBRefGetDBArgsTemplate: !!js/function &DBRefGetDBArgsTemplate >\n (lhs) => {\n return '';\n }\n DBRefGetCollectionArgsTemplate:\n !!js/function &DBRefGetCollectionArgsTemplate >\n (lhs) => {\n return '';\n }\n DBRefGetIdArgsTemplate: !!js/function &DBRefGetIdArgsTemplate >\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: !!js/function &Int32ToStringTemplate >\n (lhs) => {\n return `(string) ${lhs}`;\n }\n Int32ToStringArgsTemplate: !!js/function &Int32ToStringArgsTemplate >\n () => {\n return '';\n }\n LongEqualsTemplate: !!js/function &LongEqualsTemplate >\n (lhs) => {\n return `${lhs} ==`;\n }\n LongEqualsArgsTemplate: !!js/function &LongEqualsArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongToStringTemplate: !!js/function &LongToStringTemplate >\n (lhs) => {\n return `(string) ${lhs}`;\n }\n LongToStringArgsTemplate: !!js/function &LongToStringArgsTemplate >\n () => {\n return '';\n }\n LongToIntTemplate: !!js/function &LongToIntTemplate >\n (lhs) => {\n return `${lhs}`;\n }\n LongToIntArgsTemplate: !!js/function &LongToIntArgsTemplate >\n () => {\n return '';\n }\n LongValueOfTemplate: &LongValueOfTemplate null\n LongValueOfArgsTemplate: &LongValueOfArgsTemplate null\n LongToNumberTemplate: !!js/function &LongToNumberTemplate >\n (lhs) => {\n return `(float) ${lhs}`;\n }\n LongToNumberArgsTemplate: !!js/function &LongToNumberArgsTemplate >\n () => {\n return '';\n }\n LongAddTemplate: !!js/function &LongAddTemplate >\n (lhs) => {\n return `${lhs} +`;\n }\n LongAddArgsTemplate: !!js/function &LongAddArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongSubtractTemplate: !!js/function &LongSubtractTemplate >\n (arg) => {\n return `${arg} -`;\n }\n LongSubtractArgsTemplate: !!js/function &LongSubtractArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongMultiplyTemplate: !!js/function &LongMultiplyTemplate >\n (arg) => {\n return `${arg} *`;\n }\n LongMultiplyArgsTemplate: !!js/function &LongMultiplyArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongDivTemplate: !!js/function &LongDivTemplate >\n (lhs) => {\n return `${lhs} /`;\n }\n LongDivArgsTemplate: !!js/function &LongDivArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongModuloTemplate: !!js/function &LongModuloTemplate >\n (lhs) => {\n return `${lhs} %`;\n }\n LongModuloArgsTemplate: !!js/function &LongModuloArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongAndTemplate: !!js/function &LongAndTemplate >\n (lhs) => {\n return `${lhs} &`;\n }\n LongAndArgsTemplate: !!js/function &LongAndArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongOrTemplate: !!js/function &LongOrTemplate >\n (lhs) => {\n return `${lhs} |`;\n }\n LongOrArgsTemplate: !!js/function &LongOrArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongXorTemplate: !!js/function &LongXorTemplate >\n (lhs) => {\n return `${lhs} ^`;\n }\n LongXorArgsTemplate: !!js/function &LongXorArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongShiftLeftTemplate: !!js/function &LongShiftLeftTemplate >\n (lhs) => {\n return `${lhs} <<`;\n }\n LongShiftLeftArgsTemplate: !!js/function &LongShiftLeftArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongShiftRightTemplate: !!js/function &LongShiftRightTemplate >\n (lhs) => {\n return `${lhs} >>`;\n }\n LongShiftRightArgsTemplate: !!js/function &LongShiftRightArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongCompareTemplate: !!js/function &LongCompareTemplate >\n (lhs) => {\n return `${lhs} <=>`;\n }\n LongCompareArgsTemplate: !!js/function &LongCompareArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongIsOddTemplate: !!js/function &LongIsOddTemplate >\n (lhs) => {\n return `(${lhs} % 2) === 1`;\n }\n LongIsOddArgsTemplate: !!js/function &LongIsOddArgsTemplate >\n () => {\n return '';\n }\n LongIsZeroTemplate: !!js/function &LongIsZeroTemplate >\n (lhs) => {\n return `${lhs} === 0`;\n }\n LongIsZeroArgsTemplate: !!js/function &LongIsZeroArgsTemplate >\n () => {\n return '';\n }\n LongIsNegativeTemplate: !!js/function &LongIsNegativeTemplate >\n (lhs) => {\n return `${lhs} < 0`;\n }\n LongIsNegativeArgsTemplate: !!js/function &LongIsNegativeArgsTemplate >\n () => {\n return '';\n }\n LongNegateTemplate: !!js/function &LongNegateTemplate >\n () => {\n return '-';\n }\n LongNegateArgsTemplate: !!js/function &LongNegateArgsTemplate >\n (lhs) => {\n return lhs;\n }\n LongNotTemplate: !!js/function &LongNotTemplate >\n () => {\n return '~';\n }\n LongNotArgsTemplate: !!js/function &LongNotArgsTemplate >\n (lhs) => {\n return lhs;\n }\n LongNotEqualsTemplate: !!js/function &LongNotEqualsTemplate >\n (lhs) => {\n return `${lhs} !=`;\n }\n LongNotEqualsArgsTemplate: !!js/function &LongNotEqualsArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanTemplate: !!js/function &LongGreaterThanTemplate >\n (lhs) => {\n return `${lhs} >`;\n }\n LongGreaterThanArgsTemplate: !!js/function &LongGreaterThanArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongGreaterThanOrEqualTemplate:\n !!js/function &LongGreaterThanOrEqualTemplate >\n (lhs) => {\n return `${lhs} >=`;\n }\n LongGreaterThanOrEqualArgsTemplate:\n !!js/function &LongGreaterThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanTemplate: !!js/function &LongLessThanTemplate >\n (lhs) => {\n return `${lhs} <`;\n }\n LongLessThanArgsTemplate: !!js/function &LongLessThanArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongLessThanOrEqualTemplate: !!js/function &LongLessThanOrEqualTemplate >\n (lhs) => {\n return `${lhs} <=`;\n }\n LongLessThanOrEqualArgsTemplate:\n !!js/function &LongLessThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return ` ${arg}`;\n }\n LongFloatApproxTemplate: !!js/function &LongFloatApproxTemplate >\n (lhs) => {\n return `(float) ${lhs}`;\n }\n LongTopTemplate: !!js/function &LongTopTemplate >\n (lhs) => {\n return `${lhs} >> 32`;\n }\n LongBottomTemplate: !!js/function &LongBottomTemplate >\n (lhs) => {\n return `${lhs} & 0x00000000ffffffff`;\n }\n TimestampToStringTemplate: !!js/function &TimestampToStringTemplate >\n (lhs) => {\n return `(string) ${lhs}`;\n }\n TimestampToStringArgsTemplate: !!js/function &TimestampToStringArgsTemplate >\n () => {\n return '';\n }\n TimestampEqualsTemplate: !!js/function &TimestampEqualsTemplate >\n (lhs) => {\n return `${lhs} == `;\n }\n TimestampEqualsArgsTemplate: !!js/function &TimestampEqualsArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampGetLowBitsTemplate: !!js/function &TimestampGetLowBitsTemplate >\n (lhs) => {\n return `(${lhs})->getTimestamp()`;\n }\n TimestampGetLowBitsArgsTemplate:\n !!js/function &TimestampGetLowBitsArgsTemplate >\n () => {\n return ''\n }\n TimestampGetHighBitsTemplate: !!js/function &TimestampGetHighBitsTemplate >\n (lhs) => {\n return `(${lhs})->getIncrement()`;\n }\n TimestampGetHighBitsArgsTemplate:\n !!js/function &TimestampGetHighBitsArgsTemplate >\n () => {\n return ''\n }\n TimestampTTemplate: !!js/function &TimestampTTemplate >\n (lhs) => {\n return `(${lhs})->getTimestamp()`;\n }\n TimestampITemplate: !!js/function &TimestampITemplate >\n (lhs) => {\n return `(${lhs})->getIncrement()`;\n }\n TimestampAsDateTemplate: !!js/function &TimestampAsDateTemplate >\n (lhs) => {\n return `new UTCDateTime((${lhs})->getTimestamp() * 1000)`;\n }\n TimestampAsDateArgsTemplate: &TimestampAsDateArgsTemplate null\n TimestampCompareTemplate: !!js/function &TimestampCompareTemplate >\n (lhs) => {\n return `${lhs} <=> `;\n }\n TimestampCompareArgsTemplate: !!js/function &TimestampCompareArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampNotEqualsTemplate: !!js/function &TimestampNotEqualsTemplate >\n (lhs) => {\n return `${lhs} != `;\n }\n TimestampNotEqualsArgsTemplate:\n !!js/function &TimestampNotEqualsArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampGreaterThanTemplate: !!js/function &TimestampGreaterThanTemplate >\n (lhs) => {\n return `${lhs} > `;\n }\n TimestampGreaterThanArgsTemplate:\n !!js/function &TimestampGreaterThanArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampGreaterThanOrEqualTemplate:\n !!js/function &TimestampGreaterThanOrEqualTemplate >\n (lhs) => {\n return `${lhs} >= `;\n }\n TimestampGreaterThanOrEqualArgsTemplate:\n !!js/function &TimestampGreaterThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampLessThanTemplate: !!js/function &TimestampLessThanTemplate >\n (lhs) => {\n return `${lhs} < `;\n }\n TimestampLessThanArgsTemplate: !!js/function &TimestampLessThanArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n TimestampLessThanOrEqualTemplate:\n !!js/function &TimestampLessThanOrEqualTemplate >\n (lhs) => {\n return `${lhs} <= `;\n }\n TimestampLessThanOrEqualArgsTemplate:\n !!js/function &TimestampLessThanOrEqualArgsTemplate >\n (lhs, arg) => {\n return `${arg}`;\n }\n SymbolValueOfTemplate: !!js/function &SymbolValueOfTemplate >\n (lhs) => {\n return lhs;\n }\n SymbolValueOfArgsTemplate: !!js/function &SymbolValueOfArgsTemplate >\n () => {\n return '';\n }\n SymbolInspectTemplate: !!js/function &SymbolInspectTemplate >\n (lhs) => {\n return lhs;\n }\n SymbolInspectArgsTemplate: !!js/function &SymbolInspectArgsTemplate >\n () => {\n return '';\n }\n SymbolToStringTemplate: !!js/function &SymbolToStringTemplate >\n (lhs) => {\n return lhs;\n }\n SymbolToStringArgsTemplate: !!js/function &SymbolToStringArgsTemplate >\n (lhs) => {\n return '';\n }\n Decimal128ToStringTemplate: !!js/function &Decimal128ToStringTemplate >\n (lhs) => {\n return `(string) ${lhs}`;\n }\n Decimal128ToStringArgsTemplate:\n !!js/function &Decimal128ToStringArgsTemplate >\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: !!js/function &LongSymbolMaxTemplate >\n () => {\n return '\\\\PHP_INT_MAX';\n }\n LongSymbolMaxArgsTemplate: &LongSymbolMaxArgsTemplate null\n LongSymbolMinTemplate: !!js/function &LongSymbolMinTemplate >\n () => {\n return '\\\\PHP_INT_MIN';\n }\n LongSymbolMinArgsTemplate: &LongSymbolMinArgsTemplate null\n LongSymbolZeroTemplate: !!js/function &LongSymbolZeroTemplate >\n () => {\n return '0';\n }\n LongSymbolZeroArgsTemplate: &LongSymbolZeroArgsTemplate null\n LongSymbolOneTemplate: !!js/function &LongSymbolOneTemplate >\n () => {\n return '1';\n }\n LongSymbolOneArgsTemplate: &LongSymbolOneArgsTemplate null\n LongSymbolNegOneTemplate: !!js/function &LongSymbolNegOneTemplate >\n () => {\n return '-1';\n }\n LongSymbolNegOneArgsTemplate: &LongSymbolNegOneArgsTemplate null\n LongSymbolFromBitsTemplate: !!js/function &LongSymbolFromBitsTemplate >\n () => {\n return '';\n }\n LongSymbolFromBitsArgsTemplate:\n !!js/function &LongSymbolFromBitsArgsTemplate >\n (lhs, arg) => {\n return `(int) ${arg}`;\n }\n LongSymbolFromIntTemplate: !!js/function &LongSymbolFromIntTemplate >\n () => {\n return '';\n }\n LongSymbolFromIntArgsTemplate: !!js/function &LongSymbolFromIntArgsTemplate >\n (lhs, arg) => {\n return arg;\n }\n LongSymbolFromNumberTemplate: !!js/function &LongSymbolFromNumberTemplate >\n () => {\n return '';\n }\n LongSymbolFromNumberArgsTemplate:\n !!js/function &LongSymbolFromNumberArgsTemplate >\n (lhs, arg) => {\n return `(int) ${arg}`;\n }\n LongSymbolFromStringTemplate: !!js/function &LongSymbolFromStringTemplate >\n () => {\n return '';\n }\n LongSymbolFromStringArgsTemplate:\n !!js/function &LongSymbolFromStringArgsTemplate >\n (lhs, arg) => {\n return `(int) ${arg}`;\n }\n Decimal128SymbolFromStringTemplate:\n !!js/function &Decimal128SymbolFromStringTemplate >\n () => {\n return 'new Decimal128';\n }\n Decimal128SymbolFromStringArgsTemplate:\n !!js/function &Decimal128SymbolFromStringArgsTemplate >\n (lhs, arg) => {\n return `(${arg})`;\n }\n ObjectIdCreateFromHexStringTemplate:\n !!js/function &ObjectIdCreateFromHexStringTemplate >\n () => {\n return 'new ObjectId';\n }\n ObjectIdCreateFromHexStringArgsTemplate:\n !!js/function &ObjectIdCreateFromHexStringArgsTemplate >\n (lhs, arg) => {\n return `(${arg})`;\n }\n ObjectIdCreateFromTimeTemplate:\n !!js/function &ObjectIdCreateFromTimeTemplate >\n () => {\n return 'new ObjectId';\n }\n ObjectIdCreateFromTimeArgsTemplate:\n !!js/function &ObjectIdCreateFromTimeArgsTemplate >\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 # 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: !!js/function &ImportTemplate >\n (args) => {\n let set = new Set(Object.values(args));\n return [...set].sort().join('\\n');\n }\n DriverImportTemplate: !!js/function &DriverImportTemplate >\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: !!js/function &8ImportTemplate >\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: !!js/function &100ImportTemplate >\n () => {\n return `use MongoDB\\\\BSON\\\\Javascript;`;\n }\n # ObjectId\n 101ImportTemplate: !!js/function &101ImportTemplate >\n () => {\n return `use MongoDB\\\\BSON\\\\ObjectId;`;\n }\n # Binary\n 102ImportTemplate: !!js/function &102ImportTemplate >\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: !!js/function &107ImportTemplate >\n () => {\n return `use MongoDB\\\\BSON\\\\MinKey;`;\n }\n # MaxKey\n 108ImportTemplate: !!js/function &108ImportTemplate >\n () => {\n return `use MongoDB\\\\BSON\\\\MaxKey;`;\n }\n # Regex\n 109ImportTemplate: !!js/function &109ImportTemplate >\n () => {\n return `use MongoDB\\\\BSON\\\\Regex;`;\n }\n # Timestamp\n 110ImportTemplate: !!js/function &110ImportTemplate >\n () => {\n return `use MongoDB\\\\BSON\\\\Timestamp;`;\n }\n 111ImportTemplate: &111ImportTemplate null\n # Decimal128\n 112ImportTemplate: !!js/function &112ImportTemplate >\n () => {\n return `use MongoDB\\\\BSON\\\\Decimal128;`;\n }\n 113ImportTemplate: &113ImportTemplate null\n 114ImportTemplate: &114ImportTemplate null\n 200ImportTemplate: !!js/function &200ImportTemplate >\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"},58037:e=>{e.exports=e=>class extends e{constructor(){super()}}},58077:(e,t,n)=>{const{BsonTranspilersAttributeError:r,BsonTranspilersArgumentError:a,BsonTranspilersInternalError:l,BsonTranspilersReferenceError:o,BsonTranspilersRuntimeError:s,BsonTranspilersTypeError:i,BsonTranspilersUnimplementedError:p}=n(65815),{removeQuotes:m}=n(67366),u=n(58861);e.exports=e=>class extends e{constructor(){super(),this.idiomatic=!0,this.clearImports(),this.state={declarations:new u}}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 l("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 l("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 l=[];if(0===t.length){if(0===e.length||-1!==e[0].indexOf(null))return l;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 l;throw new a(`Argument count mismatch: too few arguments passed to '${n}'`)}const s=this.checkNamedArgs(e[o],t[o],r),i=this.castType(...s);if(null===i){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)}l.push(i)}return l}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 i(`${a.id} is not callable`);const l=a.args,o=this.checkArguments(l,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 l=this.findTypedNode(t).type;for("string"==typeof l&&(l=this.Types[l]);null!==l&&!Object.prototype.hasOwnProperty.call(l.attr,a);){if(l.id in this.BsonTypes&&null!==this.BsonTypes[l.id].id)throw new r(`'${a}' not an attribute of ${l.id}`);l=l.type,"string"==typeof l&&(l=this.Types[l])}return null===l?(e.type=this.Types._undefined,this.returnAttributeAccess(n,a,l)):(e.type=l.attr[a],this.returnAttributeAccess(n,a,l))}generateCall(e,t,n,r,a,l,o){if(`emit${t.id}`in this)return this[`emit${t.id}`](e);const s=t.template?t.template():r,i=t.argsTemplate?t.argsTemplate.bind(this.getState())(s,...n):a,p=o?"":s;return this.Syntax.new.template?this.Syntax.new.template(`${p}${i}`,l,t.code):`${p}${i}`}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 l,o=this.checkArguments(a,this.getArguments(e),r.id,r.namedArgs);if(0===o.length)o=["0"],l=this.Types._integer;else{const t=this.getArgumentAt(e,0),n=this.findTypedNode(t);l=void 0!==n.originalType?n.originalType:n.type}return this.generateCall(e,r,[o[0],l.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 l=null;const o=r[0];if(2===r.length){l=r[1];for(let e=1;e<l.length-1;e++)if(!(l[e]in a))throw new s(`Invalid flag '${l[e]}' passed to Regexp`);l=l.replace(/[imxlsu]/g,(e=>a[e]))}return this.generateCall(e,n,[o,l],"Regex",`(${o}${l?", "+l:""})`)}generateBSONCode(e,t,n,r){if(`emit${t.id}`in this)return this[`emit${t.id}`](e);e.type=t;const l=this.getArguments(e);if(1!==l.length&&2!==l.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=m(this.getArgumentAt(e,0).getText());let i="";if(2===l.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,i=`, ${o}`,this.requiredImports[113]=!0,this.requiredImports[10]=!0}return this.generateCall(e,n,[s,o],"Code",`(${s}${i})`)}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),l=200!==this.findTypedNode(this.getArgumentAt(e,0)).type.code;return this.generateCall(e,r,[a[0],l],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()}}},58861:e=>{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:""}`,l=this.vars[n(r)];if(void 0!==l)return l}}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}`}}},62893:e=>{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)}}},65815:(e,t,n)=>{const r=n(89206),a={};Object.keys(r).forEach((e=>{const t=`BsonTranspilers${e}Error`,n=`E_BSONTRANSPILERS_${e.toUpperCase()}`,l=r[e].message;a[t]=class extends Error{constructor(e,r){const o=e||l;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},67366:e=>{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}}},71901:(e,t,n)=>{n.d(t,{nH:()=>I.n,sr:()=>_,AW:()=>B,L1:()=>O,fA:()=>E,Yc:()=>g,r0:()=>u,d2:()=>p,k4:()=>i,FU:()=>o,yV:()=>s,bv:()=>m});var r=n(25220),a=n(9606).URL,l=n(9606).URLSearchParams;function o({projectId:e,clusterName:t,metricsType:n,metricsId:r}){const l=new a(`/v2/${e}`,window.location.origin);return"flex"===n?`${l}#/flex/realtime/${t}`:`${l}#/host/${n}/${r}/realtime/panel`}function s({projectId:e}){return`${new a(`/v2/${e}`,window.location.origin)}#/settings/groupSettings`}function i({projectId:e,clusterName:t,metricsType:n,metricsId:r}){const l=new a(`/v2/${e}`,window.location.origin);return"flex"===n?`${l}#/flex/monitoring/${t}`:`${l}#/host/${n}/${r}`}function p({projectId:e,clusterName:t,metricsType:n}){const r=new a(`/v2/${e}`,window.location.origin);return"flex"===n?`${r}#/flex/detail/${t}`:`${r}#/clusters/detail/${t}`}function m({projectId:e,clusterName:t,metricsType:n,metricsId:r}){const l=new a(`/v2/${e}`,window.location.origin);return"flex"===n?`${l}#/flex/queryInsights/${t}`:`${l}#/metrics/${n}/${r}/queryInsights/shape`}function u({projectId:e,clusterName:t},n){const{database:l}=(0,r.Ay)(n??""),o=new a(`/charts/${e}`,window.location.origin);return o.searchParams.set("sourceType","cluster"),o.searchParams.set("name",t),l&&o.searchParams.set("database",l),`${o}`}function g({atlasMetadata:e,namespace:t,indexName:n,view:a}){const{projectId:o,clusterName:s}=e,i=new l,{database:p,collection:m}=(0,r.Ay)(t);p&&m&&(i.set("collectionName",m),i.set("database",p),n&&(i.set("indexName",n),a&&i.set("view",a)));const u=i.toString(),g=`/clusters/atlasSearch/${s}${u?`?${u}`:""}`;return`${window.location.origin}/v2/${o}#${g}`}var T=n(96652),c=n.n(T),y=(n(59648),n(6993)),h=n(38686);function d(e){return e=e?e.startsWith("/")?e:`/${e}`:"",encodeURI(e)}function f(e="get"){return!/^(get|head|options|trace)$/.test(e.toLowerCase())}class S{authService;preferences;logger;options;defaultConfigOverride;constructor(e,t,n,r,a){this.authService=e,this.preferences=t,this.logger=n,this.options=r,this.defaultConfigOverride=a}get config(){return this.defaultConfigOverride??(0,h._6)(this.preferences)}adminApiEndpoint(e){return`${this.config.atlasApiBaseUrl}${d(e)}`}cloudEndpoint(e){return`${this.config.cloudBaseUrl}${d(e)}`}assistantApiEndpoint(e){return`${this.config.assistantApiBaseUrl}${d(e)}`}regionalizedCloudEndpoint(e,t){return this.cloudEndpoint(t)}userDataEndpoint(e,t,n,r){const a=encodeURIComponent(e),l=encodeURIComponent(t),o=encodeURIComponent(n),s=r?encodeURIComponent(r):"";return`${this.config.userDataBaseUrl}${s?`/${a}/${l}/${o}/${s}`:`/${a}/${l}/${o}`}`}driverProxyEndpoint(e){return`${this.config.ccsBaseUrl}${d(e)}`}multiplexWebsocketEndpoint(e){const[t]=this.config.multiplexedWsBaseUrls;return`${t}${d(e)}`}async fetch(e,t){(0,h.nq)(this.preferences),(0,y.Te)(t?.signal),this.logger.log.info(this.logger.mongoLogId(1001000297),"AtlasService","Making a fetch",{url:e});try{const n={...this.options?.defaultHeaders,...f(t?.method)&&{"X-CSRF-Token":document.querySelector('meta[name="csrf-token" i]')?.getAttribute("content")??"","X-CSRF-Time":document.querySelector('meta[name="csrf-time" i]')?.getAttribute("content")??""},...t?.headers},r=await fetch(e,{...t,headers:n});return this.logger.log.info(this.logger.mongoLogId(1001000309),"AtlasService","Received API response",{url:e,status:r.status,statusText:r.statusText}),await(0,h.Rp)(r),r}catch(t){throw this.logger.log.info(this.logger.mongoLogId(1001000298),"AtlasService","Fetch errored",{url:e,err:t}),t}}async authenticatedFetch(e,t){const n=await this.authService.getAuthHeaders();return this.fetch(e,{...t,headers:{...t?.headers,...n},credentials:"include"})}async automationAgentRequest(e,t,n){const r=function(e){return"flex"===e.metricsType?{flexId:e.clusterUniqueId}:"serverless"===e.metricsType?{serverlessId:e.clusterUniqueId}:{clusterId:e.metricsId}}(e),a=this.regionalizedCloudEndpoint(e,`/explorer/v1/groups/${e.projectId}/requests/${t}`),l=await this.authenticatedFetch(a,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...r,...n})}).then((e=>{if(e.headers.get("content-type")?.toLowerCase().includes("application/json"))return e.json()}));return function(e,t){if(!Object.prototype.hasOwnProperty.call(e,"_id")||!Object.prototype.hasOwnProperty.call(e,"requestType")||e.requestType!==t)throw new Error("Got unexpected backend response for automation agent request")}(l,t),l}async automationAgentAwait(e,t,n){const r=this.regionalizedCloudEndpoint(e,`/explorer/v1/groups/${e.projectId}/requests/${n}/types/${t}/await`),a=await this.authenticatedFetch(r,{method:"GET"}).then((e=>e.json()));return function(e,t){if(!(Object.prototype.hasOwnProperty.call(e,"_id")&&Object.prototype.hasOwnProperty.call(e,"requestType")&&Object.prototype.hasOwnProperty.call(e,"response")&&e.requestType===t))throw new Error("Got unexpected backend response for automation agent request await")}(a,t),a}}var b=n(41157),L=n(19248),A=n(33670),I=n(52612);const x=(0,T.createContext)(null),_=x.Provider,O=(0,A.mb)((function(){const e=(0,T.useContext)(x);if(!e)throw new Error("No AtlasAuthService available in this context");return e}),"atlasAuthServiceLocator"),j=(0,T.createContext)(null),B=(0,A.xw)((function({options:e,children:t}){const n=(0,L.Ul)("ATLAS-SERVICE"),r=(0,b.fx)(),a=O(),l=(0,T.useMemo)((()=>new S(a,r,n,e)),[a,r,n,e]);return c().createElement(j.Provider,{value:l},t)})),E=(0,A.mb)((function(){const e=(0,T.useContext)(j);if(!e)throw new Error("No AtlasService available in this context");return e}),"atlasServiceLocator")},74496:(e,t,n)=>{const r=n(7156);e.exports=e=>class extends e{constructor(){super(),this.state.utils=new r}}},81068:(e,t,n)=>{const r=n(49871),{BsonTranspilersSyntaxError:a}=n(65815);class l extends r.error.ErrorListener{syntaxError(e,t,n,r,l,o){throw new a(l,{symbol:t,line:n,column:r,payload:o})}}e.exports=l},89206:e=>{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"}}')},96108: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# 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: !!js/function &DriverTemplate |\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: !!js/function &EqualitySyntaxTemplate >\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: !!js/function &InSyntaxTemplate >\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: !!js/function &AndSyntaxTemplate >\n (args) => {\n return args.join(\' && \');\n }\n OrSyntaxTemplate: !!js/function &OrSyntaxTemplate >\n (args) => {\n return args.join(\' || \');\n }\n NotSyntaxTemplate: !!js/function &NotSyntaxTemplate >\n (arg) => {\n return `!${arg}`;\n }\n UnarySyntaxTemplate: &UnarySyntaxTemplate null\n BinarySyntaxTemplate: !!js/function &BinarySyntaxTemplate >\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: !!js/function &NewSyntaxTemplate >\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: !!js/function &StringTypeTemplate >\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: !!js/function &RegexTypeTemplate >\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: !!js/function &BoolTypeTemplate >\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: !!js/function &ArrayTypeTemplate >\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: !!js/function &NullTypeTemplate >\n () => {\n return \'null\';\n }\n UndefinedTypeTemplate: !!js/function &UndefinedTypeTemplate >\n () => {\n return \'undefined\';\n }\n ObjectTypeTemplate: !!js/function &ObjectTypeTemplate >\n (literal) => {\n if (literal === \'\') {\n return \'{}\';\n }\n return literal;\n }\n ObjectTypeArgsTemplate: !!js/function &ObjectTypeArgsTemplate >\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: !!js/function &BinarySubtypeTemplate >\n (lhs) => {\n return `${lhs}.sub_type`;\n }\n BinarySubtypeArgsTemplate: !!js/function &BinarySubtypeArgsTemplate >\n () => {\n return \'\';\n }\n DBRefGetDBTemplate: !!js/function &DBRefGetDBTemplate >\n (lhs) => {\n return `${lhs}.db`;\n }\n DBRefGetCollectionTemplate: !!js/function &DBRefGetCollectionTemplate >\n (lhs) => {\n return `${lhs}.namespace`;\n }\n DBRefGetIdTemplate: !!js/function &DBRefGetIdTemplate >\n (lhs) => {\n return `${lhs}.oid`;\n }\n DBRefGetDBArgsTemplate: !!js/function &DBRefGetDBArgsTemplate >\n () => {\n return \'\';\n }\n DBRefGetCollectionArgsTemplate:\n !!js/function &DBRefGetCollectionArgsTemplate >\n () => {\n return \'\';\n }\n DBRefGetIdArgsTemplate: !!js/function &DBRefGetIdArgsTemplate >\n () => {\n return \'\';\n }\n LongEqualsTemplate: &LongEqualsTemplate null\n LongEqualsArgsTemplate: &LongEqualsArgsTemplate null\n LongToStringTemplate: &LongToStringTemplate null\n LongToStringArgsTemplate: &LongToStringArgsTemplate null\n LongToIntTemplate: !!js/function &LongToIntTemplate >\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: !!js/function &LongFloatApproxTemplate >\n (lhs) => {\n return `${lhs}.toNumber()`;\n }\n LongTopTemplate: !!js/function &LongTopTemplate >\n (lhs) => {\n return `${lhs}.getHighBits()`;\n }\n LongBottomTemplate: !!js/function &LongBottomTemplate >\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: !!js/function &TimestampGetLowBitsTemplate >\n (lhs) => {\n return `${lhs}.getLowBits`;\n }\n TimestampGetLowBitsArgsTemplate: &TimestampGetLowBitsArgsTemplate null\n TimestampGetHighBitsTemplate: !!js/function &TimestampGetHighBitsTemplate >\n (lhs) => {\n return `${lhs}.getHighBits`;\n }\n TimestampGetHighBitsArgsTemplate: &TimestampGetHighBitsArgsTemplate null\n TimestampTTemplate: !!js/function &TimestampTTemplate >\n (lhs) => {\n return `${lhs}.getLowBits()`;\n }\n TimestampITemplate: !!js/function &TimestampITemplate >\n (lhs) => {\n return `${lhs}.getHighBits()`;\n }\n TimestampAsDateTemplate: !!js/function &TimestampAsDateTemplate >\n (lhs) => {\n return `new Date(${lhs}.getHighBits() * 1000)`;\n }\n TimestampAsDateArgsTemplate: !!js/function &TimestampAsDateArgsTemplate >\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: !!js/function &CodeSymbolArgsTemplate >\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: !!js/function &ObjectIdSymbolArgsTemplate >\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: !!js/function &BinarySymbolTemplate >\n () => {\n return \'Binary\';\n }\n BinarySymbolArgsTemplate: !!js/function &BinarySymbolArgsTemplate >\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: !!js/function &DoubleSymbolTemplate >\n () => {\n return \'Double\';\n }\n DoubleSymbolArgsTemplate: &DoubleSymbolArgsTemplate null\n Int32SymbolTemplate: !!js/function &Int32SymbolTemplate >\n () => {\n return \'Int32\';\n }\n Int32SymbolArgsTemplate: !!js/function &Int32SymbolArgsTemplate >\n (lhs, arg) => {\n arg = arg === undefined ? 0 : arg;\n return `(${arg})`;\n }\n LongSymbolTemplate: !!js/function &LongSymbolTemplate >\n () => {\n return \'\';\n }\n LongSymbolArgsTemplate: !!js/function &LongSymbolArgsTemplate >\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: !!js/function &TimestampSymbolArgsTemplate >\n (lhs, arg1, arg2) => {\n return `(${arg1 === undefined ? 0 : arg1}, ${arg2 === undefined ? 0 : arg2})`;\n }\n SymbolSymbolTemplate: !!js/function &SymbolSymbolTemplate >\n () => {\n return \'BSONSymbol\';\n }\n SymbolSymbolArgsTemplate: &SymbolSymbolArgsTemplate null\n BSONRegExpSymbolTemplate: !!js/function &BSONRegExpSymbolTemplate >\n () => {\n return \'BSONRegExp\';\n }\n BSONRegExpSymbolArgsTemplate: !!js/function &BSONRegExpSymbolArgsTemplate >\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: !!js/function &Decimal128SymbolTemplate >\n () => {\n return \'Decimal128\';\n }\n Decimal128SymbolArgsTemplate: !!js/function &Decimal128SymbolArgsTemplate >\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:\n !!js/function &ObjectIdCreateFromTimeTemplate >\n () => {\n return `ObjectId.createFromTime`;\n }\n ObjectIdCreateFromTimeArgsTemplate:\n !!js/function &ObjectIdCreateFromTimeArgsTemplate >\n (lhs, arg, isNumber) => {\n if (!isNumber) {\n return `(${arg}.getTime() / 1000)`;\n }\n return `(${arg})`;\n }\n ObjectIdIsValidTemplate: !!js/function &ObjectIdIsValidTemplate >\n (lhs) => {\n return `${lhs}.isValid`;\n }\n ObjectIdIsValidArgsTemplate: &ObjectIdIsValidArgsTemplate null\n # JS Symbol Templates\n NumberSymbolTemplate: !!js/function &NumberSymbolTemplate >\n () => {\n return \'Number\';\n }\n NumberSymbolArgsTemplate: !!js/function &NumberSymbolArgsTemplate >\n (lhs, arg) => {\n arg = arg === undefined ? \'0\' : arg;\n return `(${arg})`;\n }\n DateSymbolTemplate: !!js/function &DateSymbolTemplate >\n () => {\n return \'Date\';\n }\n DateSymbolArgsTemplate: &DateSymbolArgsTemplate null\n DateSymbolNowTemplate: !!js/function &DateSymbolNowTemplate >\n () => {\n return \'Date.now\';\n }\n DateSymbolNowArgsTemplate: &DateSymbolNowArgsTemplate null\n RegExpSymbolTemplate: !!js/function &RegExpSymbolTemplate >\n () => {\n return \'RegExp\';\n }\n RegExpSymbolArgsTemplate: &RegExpSymbolArgsTemplate null\n ImportTemplate: !!js/function &ImportTemplate >\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: !!js/function &DriverImportTemplate >\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: !!js/function &100ImportTemplate >\n () => {\n return \'Code\';\n }\n 101ImportTemplate: !!js/function &101ImportTemplate >\n () => {\n return \'ObjectId\';\n }\n 102ImportTemplate: !!js/function &102ImportTemplate >\n () => {\n return \'Binary\';\n }\n 103ImportTemplate: !!js/function &103ImportTemplate >\n () => {\n return \'DBRef\';\n }\n 104ImportTemplate: !!js/function &104ImportTemplate >\n () => {\n return \'Double\';\n }\n 105ImportTemplate: !!js/function &105ImportTemplate >\n () => {\n return \'Int32\';\n }\n 106ImportTemplate: !!js/function &106ImportTemplate >\n () => {\n return \'Long\';\n }\n 107ImportTemplate: !!js/function &107ImportTemplate >\n () => {\n return \'MinKey\';\n }\n 108ImportTemplate: !!js/function &108ImportTemplate >\n () => {\n return \'MaxKey\';\n }\n 109ImportTemplate: !!js/function &109ImportTemplate >\n () => {\n return \'BSONRegExp\';\n }\n 110ImportTemplate: !!js/function &110ImportTemplate >\n () => {\n return \'Timestamp\';\n }\n 111ImportTemplate: !!js/function &111ImportTemplate >\n () => {\n return \'BSONSymbol\';\n }\n 112ImportTemplate: !!js/function &112ImportTemplate >\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'},98156:e=>{e.exports=e=>class extends e{constructor(){super()}}},99696:e=>{e.exports=e=>class extends e{constructor(){super()}}}};