@zwave-js/config 15.15.3 → 15.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/Logic.d.ts +1 -1
- package/build/cjs/Logic.js +6 -7
- package/build/cjs/Logic.js.map +2 -2
- package/build/cjs/LogicParser.d.ts +66 -84
- package/build/cjs/LogicParser.js +410 -1337
- package/build/cjs/LogicParser.js.map +3 -3
- package/build/cjs/_version.d.ts +1 -1
- package/build/cjs/_version.js +1 -1
- package/build/cjs/_version.js.map +1 -1
- package/build/cjs/devices/DeviceConfig.d.ts +3 -3
- package/build/cjs/devices/DeviceConfig.js.map +2 -2
- package/build/cjs/devices/ParamInformation.d.ts +2 -0
- package/build/cjs/devices/ParamInformation.js +15 -1
- package/build/cjs/devices/ParamInformation.js.map +2 -2
- package/build/esm/Logic.d.ts +1 -1
- package/build/esm/Logic.d.ts.map +1 -1
- package/build/esm/Logic.js +6 -8
- package/build/esm/Logic.js.map +1 -1
- package/build/esm/LogicParser.d.ts +66 -84
- package/build/esm/LogicParser.d.ts.map +1 -1
- package/build/esm/LogicParser.js +432 -2335
- package/build/esm/LogicParser.js.map +1 -1
- package/build/esm/_version.d.ts +1 -1
- package/build/esm/_version.js +1 -1
- package/build/esm/devices/DeviceConfig.d.ts +3 -3
- package/build/esm/devices/DeviceConfig.d.ts.map +1 -1
- package/build/esm/devices/DeviceConfig.js.map +1 -1
- package/build/esm/devices/ParamInformation.d.ts +2 -0
- package/build/esm/devices/ParamInformation.d.ts.map +1 -1
- package/build/esm/devices/ParamInformation.js +16 -0
- package/build/esm/devices/ParamInformation.js.map +1 -1
- package/config/devices/0x003b/be468zp.json +1 -1
- package/config/devices/0x003b/be469.json +2 -3
- package/config/devices/0x003b/be469zp.json +2 -3
- package/config/devices/0x0063/55258_zw4002.json +34 -1
- package/config/devices/0x0090/918.json +97 -0
- package/config/devices/0x0090/hc620.json +4 -0
- package/config/devices/0x027a/zse11.json +134 -0
- package/config/devices/templates/master_template.json +1 -1
- package/config/eslint.config.mjs +24 -19
- package/package.json +8 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/LogicParser.ts"],
|
|
4
|
-
"sourcesContent": ["// THIS FILE WAS AUTO GENERATED\n/* eslint-disable */\n// @ts-nocheck\n\n/* eslint-disable */\n\nconst peggyParser: { parse: any; SyntaxError: any; DefaultTracer?: any } = // Generated by Peggy 3.0.2.\n\t//\n\t// https://peggyjs.org/\n\t// @ts-ignore\n\t(function() {\n\t\t// @ts-ignore\n\t\t\"use strict\";\n\n\t\t// @ts-ignore\n\t\tfunction peg$subclass(child, parent) {\n\t\t\t// @ts-ignore\n\t\t\tfunction C() {\n\t\t\t\tthis.constructor = child;\n\t\t\t}\n\t\t\t// @ts-ignore\n\t\t\tC.prototype = parent.prototype;\n\t\t\t// @ts-ignore\n\t\t\tchild.prototype = new C();\n\t\t}\n\n\t\t// @ts-ignore\n\t\tfunction peg$SyntaxError(message, expected, found, location) {\n\t\t\t// @ts-ignore\n\t\t\tvar self = Error.call(this, message);\n\t\t\t// istanbul ignore next Check is a necessary evil to support older environments\n\t\t\t// @ts-ignore\n\t\t\tif (Object.setPrototypeOf) {\n\t\t\t\t// @ts-ignore\n\t\t\t\tObject.setPrototypeOf(self, peg$SyntaxError.prototype);\n\t\t\t}\n\t\t\t// @ts-ignore\n\t\t\tself.expected = expected;\n\t\t\t// @ts-ignore\n\t\t\tself.found = found;\n\t\t\t// @ts-ignore\n\t\t\tself.location = location;\n\t\t\t// @ts-ignore\n\t\t\tself.name = \"SyntaxError\";\n\t\t\t// @ts-ignore\n\t\t\treturn self;\n\t\t}\n\n\t\t// @ts-ignore\n\t\tpeg$subclass(peg$SyntaxError, Error);\n\n\t\t// @ts-ignore\n\t\tfunction peg$padEnd(str, targetLength, padString) {\n\t\t\t// @ts-ignore\n\t\t\tpadString = padString || \" \";\n\t\t\t// @ts-ignore\n\t\t\tif (str.length > targetLength) return str;\n\t\t\t// @ts-ignore\n\t\t\ttargetLength -= str.length;\n\t\t\t// @ts-ignore\n\t\t\tpadString += padString.repeat(targetLength);\n\t\t\t// @ts-ignore\n\t\t\treturn str + padString.slice(0, targetLength);\n\t\t}\n\n\t\t// @ts-ignore\n\t\tpeg$SyntaxError.prototype.format = function(sources) {\n\t\t\t// @ts-ignore\n\t\t\tvar str = \"Error: \" + this.message;\n\t\t\t// @ts-ignore\n\t\t\tif (this.location) {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar src = null;\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar k;\n\t\t\t\t// @ts-ignore\n\t\t\t\tfor (k = 0; k < sources.length; k++) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (sources[k].source === this.location.source) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tsrc = sources[k].text.split(/\\r\\n|\\n|\\r/g);\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar s = this.location.start;\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar offset_s =\n\t\t\t\t\t(this.location.source\n\t\t\t\t\t\t\t&& (typeof this.location.source.offset\n\t\t\t\t\t\t\t\t=== \"function\"))\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t? this.location.source.offset(s)\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t: s;\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar loc = this.location.source\n\t\t\t\t\t+ \":\"\n\t\t\t\t\t+ offset_s.line\n\t\t\t\t\t+ \":\"\n\t\t\t\t\t+ offset_s.column;\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (src) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tvar e = this.location.end;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tvar filler = peg$padEnd(\n\t\t\t\t\t\t\"\",\n\t\t\t\t\t\toffset_s.line.toString().length,\n\t\t\t\t\t\t\" \",\n\t\t\t\t\t);\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tvar line = src[s.line - 1];\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tvar last = s.line === e.line ? e.column : line.length + 1;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tvar hatLen = (last - s.column) || 1;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tstr += \"\\n --> \" + loc + \"\\n\" // @ts-ignore\n\t\t\t\t\t+ filler + \" |\\n\" // @ts-ignore\n\t\t\t\t\t+ offset_s.line + \" | \" + line + \"\\n\" // @ts-ignore\n\t\t\t\t\t+ filler + \" | \" + peg$padEnd(\"\", s.column - 1, \" \") // @ts-ignore\n\t\t\t\t\t+ peg$padEnd(\"\", hatLen, \"^\");\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tstr += \"\\n at \" + loc;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// @ts-ignore\n\t\t\treturn str;\n\t\t};\n\n\t\t// @ts-ignore\n\t\tpeg$SyntaxError.buildMessage = function(expected, found) {\n\t\t\t// @ts-ignore\n\t\t\tvar DESCRIBE_EXPECTATION_FNS = {\n\t\t\t\t// @ts-ignore\n\t\t\t\tliteral: function(expectation) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\treturn \"\\\"\" + literalEscape(expectation.text) + \"\\\"\";\n\t\t\t\t},\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tclass: function(expectation) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tvar escapedParts = expectation.parts.map(function(part) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\treturn Array.isArray(part)\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t? classEscape(part[0]) + \"-\" + classEscape(part[1])\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t: classEscape(part);\n\t\t\t\t\t});\n\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\treturn \"[\"\n\t\t\t\t\t\t+ (expectation.inverted ? \"^\" : \"\")\n\t\t\t\t\t\t+ escapedParts.join(\"\")\n\t\t\t\t\t\t+ \"]\";\n\t\t\t\t},\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tany: function() {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\treturn \"any character\";\n\t\t\t\t},\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tend: function() {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\treturn \"end of input\";\n\t\t\t\t},\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tother: function(expectation) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\treturn expectation.description;\n\t\t\t\t},\n\t\t\t};\n\n\t\t\t// @ts-ignore\n\t\t\tfunction hex(ch) {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn ch.charCodeAt(0).toString(16).toUpperCase();\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction literalEscape(s) {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn s\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t.replace(/\\\\/g, \"\\\\\\\\\")\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t.replace(/\"/g, \"\\\\\\\"\")\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t.replace(/\\0/g, \"\\\\0\")\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t.replace(/\\t/g, \"\\\\t\")\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t.replace(/\\n/g, \"\\\\n\")\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t.replace(/\\r/g, \"\\\\r\")\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t.replace(/[\\x00-\\x0F]/g, function(ch) {\n\t\t\t\t\t\treturn \"\\\\x0\" + hex(ch);\n\t\t\t\t\t})\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t.replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) {\n\t\t\t\t\t\treturn \"\\\\x\" + hex(ch);\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction classEscape(s) {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn s\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t.replace(/\\\\/g, \"\\\\\\\\\")\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t.replace(/\\]/g, \"\\\\]\")\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t.replace(/\\^/g, \"\\\\^\")\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t.replace(/-/g, \"\\\\-\")\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t.replace(/\\0/g, \"\\\\0\")\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t.replace(/\\t/g, \"\\\\t\")\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t.replace(/\\n/g, \"\\\\n\")\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t.replace(/\\r/g, \"\\\\r\")\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t.replace(/[\\x00-\\x0F]/g, function(ch) {\n\t\t\t\t\t\treturn \"\\\\x0\" + hex(ch);\n\t\t\t\t\t})\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t.replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) {\n\t\t\t\t\t\treturn \"\\\\x\" + hex(ch);\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction describeExpectation(expectation) {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction describeExpected(expected) {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar descriptions = expected.map(describeExpectation);\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar i, j;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tdescriptions.sort();\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (descriptions.length > 0) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tfor (i = 1, j = 1; i < descriptions.length; i++) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (descriptions[i - 1] !== descriptions[i]) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tdescriptions[j] = descriptions[i];\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tdescriptions.length = j;\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tswitch (descriptions.length) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\treturn descriptions[0];\n\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\treturn descriptions[0] + \" or \" + descriptions[1];\n\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\treturn descriptions.slice(0, -1).join(\", \")\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t+ \", or \"\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t+ descriptions[descriptions.length - 1];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction describeFound(found) {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn found\n\t\t\t\t\t? \"\\\"\" + literalEscape(found) + \"\\\"\"\n\t\t\t\t\t: \"end of input\";\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\treturn \"Expected \"\n\t\t\t\t+ describeExpected(expected)\n\t\t\t\t+ \" but \"\n\t\t\t\t+ describeFound(found)\n\t\t\t\t+ \" found.\";\n\t\t};\n\n\t\t// @ts-ignore\n\t\tfunction peg$parse(input, options) {\n\t\t\t// @ts-ignore\n\t\t\toptions = options !== undefined ? options : {};\n\n\t\t\t// @ts-ignore\n\t\t\tvar peg$FAILED = {};\n\t\t\t// @ts-ignore\n\t\t\tvar peg$source = options.grammarSource;\n\n\t\t\t// @ts-ignore\n\t\t\tvar peg$startRuleFunctions = { start: peg$parsestart };\n\t\t\t// @ts-ignore\n\t\t\tvar peg$startRuleFunction = peg$parsestart;\n\n\t\t\t// @ts-ignore\n\t\t\tvar peg$c0 = \"(\";\n\t\t\tvar peg$c1 = \")\";\n\t\t\tvar peg$c2 = \"||\";\n\t\t\tvar peg$c3 = \"&&\";\n\t\t\tvar peg$c4 = \">=\";\n\t\t\tvar peg$c5 = \">\";\n\t\t\tvar peg$c6 = \"<=\";\n\t\t\tvar peg$c7 = \"<\";\n\t\t\tvar peg$c8 = \"===\";\n\t\t\tvar peg$c9 = \"-\";\n\t\t\tvar peg$c10 = \"0x\";\n\t\t\tvar peg$c11 = \".\";\n\t\t\tvar peg$c12 = \"\\\"\";\n\t\t\tvar peg$c13 = \"'\";\n\n\t\t\tvar peg$r0 = /^[a-zA-Z]/;\n\t\t\tvar peg$r1 = /^[a-zA-Z0-9]/;\n\t\t\tvar peg$r2 = /^[0-9]/;\n\t\t\tvar peg$r3 = /^[0-9a-f]/i;\n\t\t\tvar peg$r4 = /^[^\"]/;\n\t\t\tvar peg$r5 = /^[^']/;\n\t\t\tvar peg$r6 = /^[ \\t\\n\\r]/;\n\n\t\t\tvar peg$e0 = peg$otherExpectation(\"grouped expression\");\n\t\t\tvar peg$e1 = peg$literalExpectation(\"(\", false);\n\t\t\tvar peg$e2 = peg$literalExpectation(\")\", false);\n\t\t\tvar peg$e3 = peg$otherExpectation(\"logical OR\");\n\t\t\tvar peg$e4 = peg$literalExpectation(\"||\", false);\n\t\t\tvar peg$e5 = peg$otherExpectation(\"logical AND\");\n\t\t\tvar peg$e6 = peg$literalExpectation(\"&&\", false);\n\t\t\tvar peg$e7 = peg$otherExpectation(\"numeric comparison\");\n\t\t\tvar peg$e8 = peg$literalExpectation(\">=\", false);\n\t\t\tvar peg$e9 = peg$literalExpectation(\">\", false);\n\t\t\tvar peg$e10 = peg$literalExpectation(\"<=\", false);\n\t\t\tvar peg$e11 = peg$literalExpectation(\"<\", false);\n\t\t\tvar peg$e12 = peg$literalExpectation(\"===\", false);\n\t\t\tvar peg$e13 = peg$otherExpectation(\"version comparison\");\n\t\t\tvar peg$e14 = peg$otherExpectation(\"variable\");\n\t\t\tvar peg$e15 = peg$classExpectation(\n\t\t\t\t[[\"a\", \"z\"], [\"A\", \"Z\"]],\n\t\t\t\tfalse,\n\t\t\t\tfalse,\n\t\t\t);\n\t\t\tvar peg$e16 = peg$classExpectation(\n\t\t\t\t[[\"a\", \"z\"], [\"A\", \"Z\"], [\"0\", \"9\"]],\n\t\t\t\tfalse,\n\t\t\t\tfalse,\n\t\t\t);\n\t\t\tvar peg$e17 = peg$otherExpectation(\"number\");\n\t\t\tvar peg$e18 = peg$literalExpectation(\"-\", false);\n\t\t\tvar peg$e19 = peg$classExpectation([[\"0\", \"9\"]], false, false);\n\t\t\tvar peg$e20 = peg$otherExpectation(\"hex number\");\n\t\t\tvar peg$e21 = peg$literalExpectation(\"0x\", false);\n\t\t\tvar peg$e22 = peg$classExpectation(\n\t\t\t\t[[\"0\", \"9\"], [\"a\", \"f\"]],\n\t\t\t\tfalse,\n\t\t\t\ttrue,\n\t\t\t);\n\t\t\tvar peg$e23 = peg$otherExpectation(\"version string\");\n\t\t\tvar peg$e24 = peg$literalExpectation(\".\", false);\n\t\t\tvar peg$e25 = peg$otherExpectation(\"string\");\n\t\t\tvar peg$e26 = peg$literalExpectation(\"\\\"\", false);\n\t\t\tvar peg$e27 = peg$classExpectation([\"\\\"\"], true, false);\n\t\t\tvar peg$e28 = peg$literalExpectation(\"'\", false);\n\t\t\tvar peg$e29 = peg$classExpectation([\"'\"], true, false);\n\t\t\tvar peg$e30 = peg$otherExpectation(\"whitespace\");\n\t\t\tvar peg$e31 = peg$classExpectation(\n\t\t\t\t[\" \", \"\\t\", \"\\n\", \"\\r\"],\n\t\t\t\tfalse,\n\t\t\t\tfalse,\n\t\t\t);\n\t\t\t// @ts-ignore\n\n\t\t\tvar peg$f0 = function(group) { // @ts-ignore\n\t\t\t\treturn group;\n\t\t\t}; // @ts-ignore\n\n\t\t\tvar peg$f1 = function(head, tails) {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn { or: [head, ...tails] };\n\t\t\t}; // @ts-ignore\n\n\t\t\tvar peg$f2 = function(tail) { // @ts-ignore\n\t\t\t\treturn tail;\n\t\t\t}; // @ts-ignore\n\n\t\t\tvar peg$f3 = function(head, tails) {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn { and: [head, ...tails] };\n\t\t\t}; // @ts-ignore\n\n\t\t\tvar peg$f4 = function(tail) { // @ts-ignore\n\t\t\t\treturn tail;\n\t\t\t}; // @ts-ignore\n\n\t\t\tvar peg$f5 = function(head, expr, tail) {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn { [expr]: [head, tail] };\n\t\t\t}; // @ts-ignore\n\n\t\t\tvar peg$f6 = function(head, expr, tail) {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn { [\"ver \" + expr]: [head, tail] };\n\t\t\t}; // @ts-ignore\n\n\t\t\tvar peg$f7 = function(variable) { // @ts-ignore\n\t\t\t\treturn { var: variable[1].join(\"\") };\n\t\t\t}; // @ts-ignore\n\n\t\t\tvar peg$f8 = function() { // @ts-ignore\n\t\t\t\treturn parseInt(text(), 10);\n\t\t\t}; // @ts-ignore\n\n\t\t\tvar peg$f9 = function() { // @ts-ignore\n\t\t\t\treturn parseInt(text(), 16);\n\t\t\t}; // @ts-ignore\n\n\t\t\tvar peg$f10 = function(version) { // @ts-ignore\n\t\t\t\treturn text();\n\t\t\t}; // @ts-ignore\n\n\t\t\tvar peg$f11 = function() { // @ts-ignore\n\t\t\t\treturn text();\n\t\t\t}; // @ts-ignore\n\n\t\t\tvar peg$f12 = function() { // @ts-ignore\n\t\t\t\treturn text();\n\t\t\t};\n\t\t\t// @ts-ignore\n\t\t\tvar peg$currPos = 0;\n\t\t\t// @ts-ignore\n\t\t\tvar peg$savedPos = 0;\n\t\t\t// @ts-ignore\n\t\t\tvar peg$posDetailsCache = [{ line: 1, column: 1 }];\n\t\t\t// @ts-ignore\n\t\t\tvar peg$maxFailPos = 0;\n\t\t\t// @ts-ignore\n\t\t\tvar peg$maxFailExpected = [];\n\t\t\t// @ts-ignore\n\t\t\tvar peg$silentFails = 0;\n\n\t\t\t// @ts-ignore\n\t\t\tvar peg$result;\n\n\t\t\t// @ts-ignore\n\t\t\tif (\"startRule\" in options) {\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (!(options.startRule in peg$startRuleFunctions)) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\"Can't start parsing from rule \\\"\"\n\t\t\t\t\t\t\t+ options.startRule\n\t\t\t\t\t\t\t+ \"\\\".\",\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$startRuleFunction =\n\t\t\t\t\tpeg$startRuleFunctions[options.startRule];\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction text() {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn input.substring(peg$savedPos, peg$currPos);\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction offset() {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn peg$savedPos;\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction range() {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tsource: peg$source,\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tstart: peg$savedPos,\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tend: peg$currPos,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction location() {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn peg$computeLocation(peg$savedPos, peg$currPos);\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction expected(description, location) {\n\t\t\t\t// @ts-ignore\n\t\t\t\tlocation = location !== undefined\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t? location\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t: peg$computeLocation(peg$savedPos, peg$currPos);\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tthrow peg$buildStructuredError(\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t[peg$otherExpectation(description)],\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tinput.substring(peg$savedPos, peg$currPos),\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tlocation,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction error(message, location) {\n\t\t\t\t// @ts-ignore\n\t\t\t\tlocation = location !== undefined\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t? location\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t: peg$computeLocation(peg$savedPos, peg$currPos);\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tthrow peg$buildSimpleError(message, location);\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction peg$literalExpectation(text, ignoreCase) {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn { type: \"literal\", text: text, ignoreCase: ignoreCase };\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction peg$classExpectation(parts, inverted, ignoreCase) {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"class\",\n\t\t\t\t\tparts: parts,\n\t\t\t\t\tinverted: inverted,\n\t\t\t\t\tignoreCase: ignoreCase,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction peg$anyExpectation() {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn { type: \"any\" };\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction peg$endExpectation() {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn { type: \"end\" };\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction peg$otherExpectation(description) {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn { type: \"other\", description: description };\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction peg$computePosDetails(pos) {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar details = peg$posDetailsCache[pos];\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar p;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (details) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\treturn details;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tp = pos - 1;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\twhile (!peg$posDetailsCache[p]) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tp--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tdetails = peg$posDetailsCache[p];\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tdetails = {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tline: details.line,\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tcolumn: details.column,\n\t\t\t\t\t};\n\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\twhile (p < pos) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (input.charCodeAt(p) === 10) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tdetails.line++;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tdetails.column = 1;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tdetails.column++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tp++;\n\t\t\t\t\t}\n\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$posDetailsCache[pos] = details;\n\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\treturn details;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction peg$computeLocation(startPos, endPos, offset) {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar startPosDetails = peg$computePosDetails(startPos);\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar endPosDetails = peg$computePosDetails(endPos);\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar res = {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tsource: peg$source,\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tstart: {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\toffset: startPos,\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tline: startPosDetails.line,\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tcolumn: startPosDetails.column,\n\t\t\t\t\t},\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tend: {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\toffset: endPos,\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tline: endPosDetails.line,\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tcolumn: endPosDetails.column,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (\n\t\t\t\t\toffset\n\t\t\t\t\t&& peg$source\n\t\t\t\t\t&& (typeof peg$source.offset === \"function\")\n\t\t\t\t) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tres.start = peg$source.offset(res.start);\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tres.end = peg$source.offset(res.end);\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn res;\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction peg$fail(expected) {\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (peg$currPos < peg$maxFailPos) return;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (peg$currPos > peg$maxFailPos) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$maxFailPos = peg$currPos;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$maxFailExpected = [];\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$maxFailExpected.push(expected);\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction peg$buildSimpleError(message, location) {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn new peg$SyntaxError(message, null, null, location);\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction peg$buildStructuredError(expected, found, location) {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn new peg$SyntaxError(\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$SyntaxError.buildMessage(expected, found),\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\texpected,\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tfound,\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tlocation,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction // @ts-ignore\n\t\t\tpeg$parsestart() {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar s0;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\ts0 = peg$parsegroup();\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s0 === peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$parseor();\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s0 === peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts0 = peg$parseand();\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (s0 === peg$FAILED) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts0 = peg$parsecomparison();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn s0;\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction // @ts-ignore\n\t\t\tpeg$parsegroup() {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar s0, s1, s2, s3, s4, s5, s6;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails++;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts0 = peg$currPos;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts1 = peg$parse_();\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (input.charCodeAt(peg$currPos) === 40) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts2 = peg$c0;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts2 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e1);\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s2 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts3 = peg$parse_();\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts4 = peg$parseor();\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s4 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts5 = peg$parse_();\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (input.charCodeAt(peg$currPos) === 41) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts6 = peg$c1;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts6 = peg$FAILED;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (s6 !== peg$FAILED) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tpeg$savedPos = s0;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts0 = peg$f0(s4);\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails--;\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s0 === peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts1 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e0);\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn s0;\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction // @ts-ignore\n\t\t\tpeg$parseor() {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar s0, s1, s2, s3, s4;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails++;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts0 = peg$currPos;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts1 = peg$parse_();\n\t\t\t\t// @ts-ignore\n\t\t\t\ts2 = peg$parseand();\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s2 === peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts2 = peg$parsecomparison();\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s2 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts3 = [];\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts4 = peg$parseor_tails();\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s4 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\twhile (s4 !== peg$FAILED) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts3.push(s4);\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts4 = peg$parseor_tails();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts3 = peg$FAILED;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s3 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$savedPos = s0;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts0 = peg$f1(s2, s3);\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails--;\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s0 === peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts1 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e3);\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn s0;\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction // @ts-ignore\n\t\t\tpeg$parseor_tails() {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar s0, s1, s2, s3, s4;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\ts0 = peg$currPos;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts1 = peg$parse_();\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (input.substr(peg$currPos, 2) === peg$c2) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts2 = peg$c2;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos += 2;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts2 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e4);\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s2 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts3 = peg$parse_();\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts4 = peg$parseand();\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s4 === peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts4 = peg$parsecomparison();\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s4 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$savedPos = s0;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts0 = peg$f2(s4);\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn s0;\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction // @ts-ignore\n\t\t\tpeg$parseand() {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar s0, s1, s2, s3, s4;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails++;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts0 = peg$currPos;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts1 = peg$parse_();\n\t\t\t\t// @ts-ignore\n\t\t\t\ts2 = peg$parsegroup();\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s2 === peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts2 = peg$parsecomparison();\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s2 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts3 = [];\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts4 = peg$parseand_tails();\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s4 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\twhile (s4 !== peg$FAILED) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts3.push(s4);\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts4 = peg$parseand_tails();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts3 = peg$FAILED;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s3 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$savedPos = s0;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts0 = peg$f3(s2, s3);\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails--;\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s0 === peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts1 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e5);\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn s0;\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction // @ts-ignore\n\t\t\tpeg$parseand_tails() {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar s0, s1, s2, s3, s4;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\ts0 = peg$currPos;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts1 = peg$parse_();\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (input.substr(peg$currPos, 2) === peg$c3) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts2 = peg$c3;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos += 2;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts2 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e6);\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s2 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts3 = peg$parse_();\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts4 = peg$parsegroup();\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s4 === peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts4 = peg$parsecomparison();\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s4 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$savedPos = s0;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts0 = peg$f4(s4);\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn s0;\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction // @ts-ignore\n\t\t\tpeg$parsecomparison() {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar s0;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\ts0 = peg$parsever_comparison();\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s0 === peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$parseint_comparison();\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn s0;\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction // @ts-ignore\n\t\t\tpeg$parseint_comparison() {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar s0, s1, s2, s3, s4, s5, s6, s7;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails++;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts0 = peg$currPos;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts1 = peg$parse_();\n\t\t\t\t// @ts-ignore\n\t\t\t\ts2 = peg$parseterm();\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s2 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts3 = peg$parse_();\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (input.substr(peg$currPos, 2) === peg$c4) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts4 = peg$c4;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos += 2;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts4 = peg$FAILED;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e8);\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s4 === peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (input.charCodeAt(peg$currPos) === 62) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts4 = peg$c5;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts4 = peg$FAILED;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e9);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (s4 === peg$FAILED) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (input.substr(peg$currPos, 2) === peg$c6) {\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\ts4 = peg$c6;\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tpeg$currPos += 2;\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\ts4 = peg$FAILED;\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e10);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (s4 === peg$FAILED) {\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tif (input.charCodeAt(peg$currPos) === 60) {\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\ts4 = peg$c7;\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\ts4 = peg$FAILED;\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\tif (peg$silentFails === 0) {\n\t\t\t\t\t\t\t\t\t\tpeg$fail(peg$e11);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tif (s4 === peg$FAILED) {\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\tinput.substr(peg$currPos, 3) === peg$c8\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\t\ts4 = peg$c8;\n\t\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\t\tpeg$currPos += 3;\n\t\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\t\ts4 = peg$FAILED;\n\t\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\t\tif (peg$silentFails === 0) {\n\t\t\t\t\t\t\t\t\t\t\tpeg$fail(peg$e12);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s4 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts5 = peg$parse_();\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts6 = peg$parseterm();\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (s6 !== peg$FAILED) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts7 = peg$parse_();\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tpeg$savedPos = s0;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts0 = peg$f5(s2, s4, s6);\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails--;\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s0 === peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts1 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e7);\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn s0;\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction // @ts-ignore\n\t\t\tpeg$parsever_comparison() {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar s0, s1, s2, s3, s4, s5, s6, s7;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails++;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts0 = peg$currPos;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts1 = peg$parse_();\n\t\t\t\t// @ts-ignore\n\t\t\t\ts2 = peg$parseterm();\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s2 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts3 = peg$parse_();\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (input.substr(peg$currPos, 2) === peg$c4) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts4 = peg$c4;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos += 2;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts4 = peg$FAILED;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e8);\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s4 === peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (input.charCodeAt(peg$currPos) === 62) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts4 = peg$c5;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts4 = peg$FAILED;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e9);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (s4 === peg$FAILED) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (input.substr(peg$currPos, 2) === peg$c6) {\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\ts4 = peg$c6;\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tpeg$currPos += 2;\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\ts4 = peg$FAILED;\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e10);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (s4 === peg$FAILED) {\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tif (input.charCodeAt(peg$currPos) === 60) {\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\ts4 = peg$c7;\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\ts4 = peg$FAILED;\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\tif (peg$silentFails === 0) {\n\t\t\t\t\t\t\t\t\t\tpeg$fail(peg$e11);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tif (s4 === peg$FAILED) {\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\tinput.substr(peg$currPos, 3) === peg$c8\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\t\ts4 = peg$c8;\n\t\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\t\tpeg$currPos += 3;\n\t\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\t\ts4 = peg$FAILED;\n\t\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\t\tif (peg$silentFails === 0) {\n\t\t\t\t\t\t\t\t\t\t\tpeg$fail(peg$e12);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s4 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts5 = peg$parse_();\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts6 = peg$parseversion();\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (s6 !== peg$FAILED) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts7 = peg$parse_();\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tpeg$savedPos = s0;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts0 = peg$f6(s2, s4, s6);\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails--;\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s0 === peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts1 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e13);\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn s0;\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction // @ts-ignore\n\t\t\tpeg$parseterm() {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar s0;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\ts0 = peg$parseconst();\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s0 === peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$parsestring();\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s0 === peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts0 = peg$parsehex();\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (s0 === peg$FAILED) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts0 = peg$parseinteger();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn s0;\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction // @ts-ignore\n\t\t\tpeg$parseconst() {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar s0, s1, s2, s3, s4, s5;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails++;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts0 = peg$currPos;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts1 = peg$parse_();\n\t\t\t\t// @ts-ignore\n\t\t\t\ts2 = peg$currPos;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts3 = peg$currPos;\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails++;\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (peg$r0.test(input.charAt(peg$currPos))) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts4 = input.charAt(peg$currPos);\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts4 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e15);\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails--;\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s4 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos = s3;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts3 = undefined;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts3 = peg$FAILED;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s3 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts4 = [];\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$r1.test(input.charAt(peg$currPos))) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts5 = input.charAt(peg$currPos);\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts5 = peg$FAILED;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e16);\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s5 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\twhile (s5 !== peg$FAILED) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts4.push(s5);\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (peg$r1.test(input.charAt(peg$currPos))) {\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\ts5 = input.charAt(peg$currPos);\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\ts5 = peg$FAILED;\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e16);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts4 = peg$FAILED;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s4 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts3 = [s3, s4];\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts2 = s3;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos = s2;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts2 = peg$FAILED;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos = s2;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts2 = peg$FAILED;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s2 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$savedPos = s0;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$f7(s2);\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails--;\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s0 === peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts1 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e14);\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn s0;\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction // @ts-ignore\n\t\t\tpeg$parseinteger() {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar s0, s1, s2, s3, s4, s5;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails++;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts0 = peg$currPos;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts1 = peg$parse_();\n\t\t\t\t// @ts-ignore\n\t\t\t\ts2 = peg$currPos;\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (input.charCodeAt(peg$currPos) === 45) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts3 = peg$c9;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts3 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e18);\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s3 === peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts3 = null;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\ts4 = [];\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (peg$r2.test(input.charAt(peg$currPos))) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts5 = input.charAt(peg$currPos);\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts5 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e19);\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s5 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\twhile (s5 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts4.push(s5);\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (peg$r2.test(input.charAt(peg$currPos))) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts5 = input.charAt(peg$currPos);\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts5 = peg$FAILED;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e19);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts4 = peg$FAILED;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s4 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts3 = [s3, s4];\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts2 = s3;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos = s2;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts2 = peg$FAILED;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s2 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$savedPos = s0;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$f8();\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails--;\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s0 === peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts1 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e17);\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn s0;\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction // @ts-ignore\n\t\t\tpeg$parsehex() {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar s0, s1, s2, s3, s4, s5;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails++;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts0 = peg$currPos;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts1 = peg$parse_();\n\t\t\t\t// @ts-ignore\n\t\t\t\ts2 = peg$currPos;\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (input.substr(peg$currPos, 2) === peg$c10) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts3 = peg$c10;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos += 2;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts3 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e21);\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s3 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts4 = [];\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$r3.test(input.charAt(peg$currPos))) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts5 = input.charAt(peg$currPos);\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts5 = peg$FAILED;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e22);\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s5 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\twhile (s5 !== peg$FAILED) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts4.push(s5);\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (peg$r3.test(input.charAt(peg$currPos))) {\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\ts5 = input.charAt(peg$currPos);\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\ts5 = peg$FAILED;\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e22);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts4 = peg$FAILED;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s4 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts3 = [s3, s4];\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts2 = s3;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos = s2;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts2 = peg$FAILED;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos = s2;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts2 = peg$FAILED;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s2 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$savedPos = s0;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$f9();\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails--;\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s0 === peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts1 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e20);\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn s0;\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction // @ts-ignore\n\t\t\tpeg$parseversion() {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails++;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts0 = peg$currPos;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts1 = peg$parse_();\n\t\t\t\t// @ts-ignore\n\t\t\t\ts2 = peg$currPos;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts3 = [];\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (peg$r2.test(input.charAt(peg$currPos))) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts4 = input.charAt(peg$currPos);\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts4 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e19);\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s4 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\twhile (s4 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts3.push(s4);\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (peg$r2.test(input.charAt(peg$currPos))) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts4 = input.charAt(peg$currPos);\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts4 = peg$FAILED;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e19);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts3 = peg$FAILED;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s3 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (input.charCodeAt(peg$currPos) === 46) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts4 = peg$c11;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts4 = peg$FAILED;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e24);\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s4 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts5 = [];\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (peg$r2.test(input.charAt(peg$currPos))) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts6 = input.charAt(peg$currPos);\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts6 = peg$FAILED;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e19);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (s6 !== peg$FAILED) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\twhile (s6 !== peg$FAILED) {\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\ts5.push(s6);\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tif (peg$r2.test(input.charAt(peg$currPos))) {\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\ts6 = input.charAt(peg$currPos);\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\ts6 = peg$FAILED;\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\tif (peg$silentFails === 0) {\n\t\t\t\t\t\t\t\t\t\tpeg$fail(peg$e19);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts5 = peg$FAILED;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (s5 !== peg$FAILED) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts6 = peg$currPos;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (input.charCodeAt(peg$currPos) === 46) {\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\ts7 = peg$c11;\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\ts7 = peg$FAILED;\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e24);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (s7 !== peg$FAILED) {\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\ts8 = [];\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tif (peg$r2.test(input.charAt(peg$currPos))) {\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\ts9 = input.charAt(peg$currPos);\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\ts9 = peg$FAILED;\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\tif (peg$silentFails === 0) {\n\t\t\t\t\t\t\t\t\t\tpeg$fail(peg$e19);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tif (s9 !== peg$FAILED) {\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\twhile (s9 !== peg$FAILED) {\n\t\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\t\ts8.push(s9);\n\t\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tpeg$r2.test(\n\t\t\t\t\t\t\t\t\t\t\t\tinput.charAt(peg$currPos),\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\t\t\ts9 = input.charAt(peg$currPos);\n\t\t\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\t\t\ts9 = peg$FAILED;\n\t\t\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\t\t\tif (peg$silentFails === 0) {\n\t\t\t\t\t\t\t\t\t\t\t\tpeg$fail(peg$e19);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\ts8 = peg$FAILED;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tif (s8 !== peg$FAILED) {\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\ts7 = [s7, s8];\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\ts6 = s7;\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\tpeg$currPos = s6;\n\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\ts6 = peg$FAILED;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tpeg$currPos = s6;\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\ts6 = peg$FAILED;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (s6 === peg$FAILED) {\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\ts6 = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts3 = [s3, s4, s5, s6];\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts2 = s3;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tpeg$currPos = s2;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts2 = peg$FAILED;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos = s2;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts2 = peg$FAILED;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos = s2;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts2 = peg$FAILED;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s2 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$savedPos = s0;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$f10(s2);\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails--;\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s0 === peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts1 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e23);\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn s0;\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction // @ts-ignore\n\t\t\tpeg$parsestring() {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar s0, s1, s2, s3, s4, s5;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails++;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts0 = peg$currPos;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts1 = peg$parse_();\n\t\t\t\t// @ts-ignore\n\t\t\t\ts2 = peg$currPos;\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (input.charCodeAt(peg$currPos) === 34) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts3 = peg$c12;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts3 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e26);\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s3 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts4 = [];\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$r4.test(input.charAt(peg$currPos))) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts5 = input.charAt(peg$currPos);\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts5 = peg$FAILED;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e27);\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\twhile (s5 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts4.push(s5);\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (peg$r4.test(input.charAt(peg$currPos))) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts5 = input.charAt(peg$currPos);\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts5 = peg$FAILED;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e27);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (input.charCodeAt(peg$currPos) === 34) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts5 = peg$c12;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts5 = peg$FAILED;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e26);\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s5 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts3 = [s3, s4, s5];\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts2 = s3;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos = s2;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts2 = peg$FAILED;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos = s2;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts2 = peg$FAILED;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s2 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$savedPos = s0;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$f11();\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s0 === peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0 = peg$currPos;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts1 = peg$parse_();\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts2 = peg$currPos;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (input.charCodeAt(peg$currPos) === 39) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts3 = peg$c13;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts3 = peg$FAILED;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e28);\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s3 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts4 = [];\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (peg$r5.test(input.charAt(peg$currPos))) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts5 = input.charAt(peg$currPos);\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts5 = peg$FAILED;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e29);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\twhile (s5 !== peg$FAILED) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts4.push(s5);\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (peg$r5.test(input.charAt(peg$currPos))) {\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\ts5 = input.charAt(peg$currPos);\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\ts5 = peg$FAILED;\n\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e29);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (input.charCodeAt(peg$currPos) === 39) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts5 = peg$c13;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts5 = peg$FAILED;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e28);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (s5 !== peg$FAILED) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts3 = [s3, s4, s5];\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts2 = s3;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tpeg$currPos = s2;\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\ts2 = peg$FAILED;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos = s2;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts2 = peg$FAILED;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (s2 !== peg$FAILED) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$savedPos = s0;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts0 = peg$f12();\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos = s0;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts0 = peg$FAILED;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails--;\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (s0 === peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts1 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e25);\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn s0;\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tfunction // @ts-ignore\n\t\t\tpeg$parse_() {\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar s0, s1;\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails++;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts0 = [];\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (peg$r6.test(input.charAt(peg$currPos))) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts1 = input.charAt(peg$currPos);\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts1 = peg$FAILED;\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e31);\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\twhile (s1 !== peg$FAILED) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\ts0.push(s1);\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (peg$r6.test(input.charAt(peg$currPos))) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts1 = input.charAt(peg$currPos);\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tpeg$currPos++;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\ts1 = peg$FAILED;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e31);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// @ts-ignore\n\t\t\t\tpeg$silentFails--;\n\t\t\t\t// @ts-ignore\n\t\t\t\ts1 = peg$FAILED;\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (peg$silentFails === 0) peg$fail(peg$e30);\n\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn s0;\n\t\t\t}\n\n\t\t\t// @ts-ignore\n\t\t\tpeg$result = peg$startRuleFunction();\n\n\t\t\t// @ts-ignore\n\t\t\tif (peg$result !== peg$FAILED && peg$currPos === input.length) {\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn peg$result;\n\t\t\t\t// @ts-ignore\n\t\t\t} else {\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (peg$result !== peg$FAILED && peg$currPos < input.length) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$fail(peg$endExpectation());\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tthrow peg$buildStructuredError(\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$maxFailExpected,\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$maxFailPos < input.length\n\t\t\t\t\t\t? input.charAt(peg$maxFailPos)\n\t\t\t\t\t\t: null,\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tpeg$maxFailPos < input.length\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t? peg$computeLocation(\n\t\t\t\t\t\t\tpeg$maxFailPos,\n\t\t\t\t\t\t\tpeg$maxFailPos + 1,\n\t\t\t\t\t\t)\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t: peg$computeLocation(peg$maxFailPos, peg$maxFailPos),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// @ts-ignore\n\t\treturn {\n\t\t\tSyntaxError: peg$SyntaxError,\n\t\t\tparse: peg$parse,\n\t\t};\n\t})();\n\nexport interface FilePosition {\n\toffset: number;\n\tline: number;\n\tcolumn: number;\n}\n\nexport interface FileRange {\n\tstart: FilePosition;\n\tend: FilePosition;\n\tsource: string;\n}\n\nexport interface LiteralExpectation {\n\ttype: \"literal\";\n\ttext: string;\n\tignoreCase: boolean;\n}\n\nexport interface ClassParts extends Array<string | ClassParts> {}\n\nexport interface ClassExpectation {\n\ttype: \"class\";\n\tparts: ClassParts;\n\tinverted: boolean;\n\tignoreCase: boolean;\n}\n\nexport interface AnyExpectation {\n\ttype: \"any\";\n}\n\nexport interface EndExpectation {\n\ttype: \"end\";\n}\n\nexport interface OtherExpectation {\n\ttype: \"other\";\n\tdescription: string;\n}\n\nexport type Expectation =\n\t| LiteralExpectation\n\t| ClassExpectation\n\t| AnyExpectation\n\t| EndExpectation\n\t| OtherExpectation;\n\ndeclare class _PeggySyntaxError extends Error {\n\tpublic static buildMessage(\n\t\texpected: Expectation[],\n\t\tfound: string | null,\n\t): string;\n\tpublic message: string;\n\tpublic expected: Expectation[];\n\tpublic found: string | null;\n\tpublic location: FileRange;\n\tpublic name: string;\n\tconstructor(\n\t\tmessage: string,\n\t\texpected: Expectation[],\n\t\tfound: string | null,\n\t\tlocation: FileRange,\n\t);\n\tformat(sources: {\n\t\tsource?: any;\n\t\ttext: string;\n\t}[]): string;\n}\n\nexport interface TraceEvent {\n\ttype: string;\n\trule: string;\n\tresult?: any;\n\tlocation: FileRange;\n}\n\ndeclare class _DefaultTracer {\n\tprivate indentLevel: number;\n\tpublic trace(event: TraceEvent): void;\n}\n\npeggyParser.SyntaxError.prototype.name = \"PeggySyntaxError\";\n\nexport interface ParseOptions {\n\tfilename?: string;\n\tstartRule?: \"start\";\n\ttracer?: any;\n\t[key: string]: any;\n}\nexport type ParseFunction = <Options extends ParseOptions>(\n\tinput: string,\n\toptions?: Options,\n) => Options extends { startRule: infer StartRule }\n\t? StartRule extends \"start\" ? Start : Start\n\t: Start;\nexport const parse: ParseFunction = peggyParser.parse;\n\nexport const PeggySyntaxError = peggyParser\n\t.SyntaxError as typeof _PeggySyntaxError;\n\nexport type PeggySyntaxError = _PeggySyntaxError;\n\n// These types were autogenerated by ts-pegjs\nexport type Start = Group | Or | And | Comparison;\nexport type Group = Or;\nexport type Or = { or: [And | Comparison, ...OrTails[]] };\nexport type OrTails = And | Comparison;\nexport type And = { and: [Group | Comparison, ...AndTails[]] };\nexport type AndTails = Group | Comparison;\nexport type Comparison = VerComparison | IntComparison;\nexport type IntComparison = { [x: string]: [Term, Term] };\nexport type VerComparison = { [x: string]: [Term, Version] };\nexport type Term = Const | String_1 | Hex | Integer;\nexport type Const = { var: string };\nexport type Integer = number;\nexport type Hex = number;\nexport type Version = string;\nexport type String_1 = string;\nexport type _ = string[];\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAMA,MAAM;;;;;GAIJ,WAAA;AAEA;AAGA,aAAS,aAAa,OAAO,QAAM;AAElC,eAAS,IAAC;AACT,aAAK,cAAc;MACpB;AAFS;AAIT,QAAE,YAAY,OAAO;AAErB,YAAM,YAAY,IAAI,EAAC;IACxB;AATS;AAYT,aAAS,gBAAgB,SAAS,UAAU,OAAO,UA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;AAE7B;UAED,OAAO;AAEN,iBAAK;AAEL,gBAAI,oBAAoB;AAAG,uBAAS,OAAO;UAC5C;QACD;AAEA;AAEA,aAAK;AAEL,YAAI,oBAAoB;AAAG,mBAAS,OAAO;AAG3C,eAAO;MACR;AAhDA;AAmDA,mBAAa,sBAAqB;AAGlC,UAAI,eAAe,cAAc,gBAAgB,MAAM,QAAQ;AAE9D,eAAO;MAER,OAAO;AAEN,YAAI,eAAe,cAAc,cAAc,MAAM,QAAQ;AAE5D,mBAAS,mBAAkB,CAAE;QAC9B;AAGA,cAAM;;UAEL;;UAEA,iBAAiB,MAAM,SACpB,MAAM,OAAO,cAAc,IAC3B;;UAEH,iBAAiB,MAAM,SAEpB,oBACD,gBACA,iBAAiB,CAAC,IAGjB,oBAAoB,gBAAgB,cAAc;QAAC;MAExD;IACD;AAvhES;AA0hET,WAAO;MACN,aAAa;MACb,OAAO;;EAET,GAAE;;AAmFH,YAAY,YAAY,UAAU,OAAO;AAclC,MAAM,QAAuB,YAAY;AAEzC,MAAM,mBAAmB,YAC9B;",
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["// A parser to convert logical JavaScript-like expressions into JSON Logic\n\nimport { getEnumMemberName } from \"@zwave-js/shared\";\nimport { assertNever } from \"alcalzone-shared/helpers\";\nimport type { RulesLogic } from \"json-logic-js\";\n\nexport enum SyntaxKind {\n\tGroup,\n\tOr,\n\tAnd,\n\tComparison,\n\tIdentifier,\n\tNumberLiteral,\n\tVersion,\n}\n\nexport enum Operator {\n\tEqual,\n\tNotEqual,\n\tLessThan,\n\tLessThanOrEqual,\n\tGreaterThan,\n\tGreaterThanOrEqual,\n}\n\nexport type Expression =\n\t| Or\n\t| And\n\t| Comparison;\n\ntype Or = {\n\tkind: SyntaxKind.Or;\n\toperands: Expression[];\n};\n\ntype And = {\n\tkind: SyntaxKind.And;\n\toperands: Expression[];\n};\n\ntype Comparison = {\n\tkind: SyntaxKind.Comparison;\n\tleft: Identifier;\n\toperator: Operator;\n\tright:\n\t\t| NumberLiteral\n\t\t| Version;\n};\n\ntype Identifier = {\n\tkind: SyntaxKind.Identifier;\n\tname: string;\n};\n\ntype NumberLiteral = {\n\tkind: SyntaxKind.NumberLiteral;\n\tvalue: number;\n};\n\ntype Version = {\n\tkind: SyntaxKind.Version;\n\tvalue: string;\n};\n\nexport enum TokenKind {\n\tIdentifier,\n\tNumberLiteral,\n\tDot, // \".\"\n\tLeftParen, // \"(\"\n\tRightParen, // \")\"\n\tBarBar, // \"||\"\n\tAmpAmp, // \"&&\"\n\tEqualsEquals, // \"==\"\n\tEqualsEqualsEquals, // \"===\"\n\tExclamationEquals, // \"!=\"\n\tExclamationEqualsEquals, // \"!==\"\n\tLessThan, // \"<\"\n\tLessThanEquals, // \"<=\"\n\tGreaterThan, // \">\"\n\tGreaterThanEquals, // \">=\"\n}\n\nexport type Token = {\n\tstart: number;\n\tkind: TokenKind;\n\tvalue?: string;\n};\n\n/**\n * Splits a string into tokens to be consumed by the Parser.\n */\nexport function* tokenize(input: string): Generator<Token> {\n\tfor (let i = 0; i < input.length; i++) {\n\t\tswitch (input[i]) {\n\t\t\tcase \".\": {\n\t\t\t\tyield { kind: TokenKind.Dot, start: i };\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"(\": {\n\t\t\t\tyield { kind: TokenKind.LeftParen, start: i };\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \")\": {\n\t\t\t\tyield { kind: TokenKind.RightParen, start: i };\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"|\": {\n\t\t\t\tif (input[i + 1] === \"|\") {\n\t\t\t\t\tyield { kind: TokenKind.BarBar, start: i };\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"&\": {\n\t\t\t\tif (input[i + 1] === \"&\") {\n\t\t\t\t\tyield { kind: TokenKind.AmpAmp, start: i };\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"=\": {\n\t\t\t\tif (input[i + 1] === \"=\") {\n\t\t\t\t\tif (input[i + 2] === \"=\") {\n\t\t\t\t\t\tyield { kind: TokenKind.EqualsEqualsEquals, start: i };\n\t\t\t\t\t\ti += 2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tyield { kind: TokenKind.EqualsEquals, start: i };\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"!\": {\n\t\t\t\tif (input[i + 1] === \"=\") {\n\t\t\t\t\tif (input[i + 2] === \"=\") {\n\t\t\t\t\t\tyield {\n\t\t\t\t\t\t\tkind: TokenKind.ExclamationEqualsEquals,\n\t\t\t\t\t\t\tstart: i,\n\t\t\t\t\t\t};\n\t\t\t\t\t\ti += 2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tyield { kind: TokenKind.ExclamationEquals, start: i };\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"<\": {\n\t\t\t\tif (input[i + 1] === \"=\") {\n\t\t\t\t\tyield { kind: TokenKind.LessThanEquals, start: i };\n\t\t\t\t\ti++;\n\t\t\t\t} else {\n\t\t\t\t\tyield { kind: TokenKind.LessThan, start: i };\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \">\": {\n\t\t\t\tif (input[i + 1] === \"=\") {\n\t\t\t\t\tyield { kind: TokenKind.GreaterThanEquals, start: i };\n\t\t\t\t\ti++;\n\t\t\t\t} else {\n\t\t\t\t\tyield { kind: TokenKind.GreaterThan, start: i };\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tif (/\\s/.test(input[i])) {\n\t\t\t\t\t// Skip whitespace\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Parse hexadecimal numbers\n\t\t\t\tif (input[i] === \"0\" && input[i + 1] === \"x\") {\n\t\t\t\t\tconst start = i;\n\t\t\t\t\tlet hex = \"0x\";\n\t\t\t\t\ti += 2;\n\t\t\t\t\twhile (i < input.length && /[0-9a-fA-F]/.test(input[i])) {\n\t\t\t\t\t\thex += input[i];\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\tyield {\n\t\t\t\t\t\tkind: TokenKind.NumberLiteral,\n\t\t\t\t\t\tvalue: hex,\n\t\t\t\t\t\tstart,\n\t\t\t\t\t};\n\t\t\t\t\ti--; // Account for the outer loop increment\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Parse decimal numbers\n\t\t\t\tif (/\\d/.test(input[i])) {\n\t\t\t\t\tconst start = i;\n\t\t\t\t\tlet num = \"\";\n\t\t\t\t\twhile (i < input.length && /\\d/.test(input[i])) {\n\t\t\t\t\t\tnum += input[i];\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\tyield {\n\t\t\t\t\t\tkind: TokenKind.NumberLiteral,\n\t\t\t\t\t\tvalue: num,\n\t\t\t\t\t\tstart,\n\t\t\t\t\t};\n\t\t\t\t\ti--; // Account for the outer loop increment\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Parse identifiers\n\t\t\t\tif (/[a-zA-Z_$]/.test(input[i])) {\n\t\t\t\t\tconst start = i;\n\t\t\t\t\tlet id = \"\";\n\t\t\t\t\twhile (i < input.length && /[a-zA-Z0-9_$]/.test(input[i])) {\n\t\t\t\t\t\tid += input[i];\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\tyield { kind: TokenKind.Identifier, value: id, start };\n\t\t\t\t\ti--; // Account for the outer loop increment\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Unexpected character '${input[i]}' at index ${i}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\ninterface ParserState {\n\tinput: string;\n\treadonly tokens: readonly Token[];\n\tpos: number;\n}\n\nexport function parse(input: string): Expression | undefined {\n\tconst tokens = Array.from(tokenize(input));\n\tconst state: ParserState = { input, tokens, pos: 0 };\n\tconst ret = parseExpression(state);\n\n\t// If there are remaining tokens, the parse failed\n\tif (state.pos < tokens.length) {\n\t\tconst token = tokens[state.pos];\n\t\tthrow new Error(\n\t\t\t`Unexpected token ${\n\t\t\t\tgetEnumMemberName(TokenKind, token.kind)\n\t\t\t} at position ` + token.start,\n\t\t);\n\t}\n\n\treturn ret;\n}\n\nfunction parseExpression(s: ParserState): Expression | undefined {\n\treturn parseOr(s) || parseAnd(s) || parseComparison(s) || parseGroup(s);\n}\n\nfunction parseAnd(s: ParserState): And | undefined {\n\t// <comparison|group> && <comparison|group> && ...\n\tlet startPos = s.pos;\n\tconst first = parseComparison(s) || parseGroup(s);\n\tif (!first) {\n\t\ts.pos = startPos;\n\t\treturn;\n\t}\n\t// Expect a \"&&\" operator\n\tif (s.tokens[s.pos]?.kind !== TokenKind.AmpAmp) {\n\t\ts.pos = startPos;\n\t\treturn;\n\t}\n\ts.pos++; // consume \"&&\"\n\tconst second = parseComparison(s) || parseGroup(s);\n\tif (!second) {\n\t\ts.pos = startPos;\n\t\treturn;\n\t}\n\n\t// Parsing succeeded so far, update the parser start position,\n\t// so we don't rewind too much on failure\n\tstartPos = s.pos;\n\n\t// Now optionally parse further sequences of \"&&\" <comparison|group>\n\tconst operands: Expression[] = [first, second];\n\twhile (s.tokens[s.pos]?.kind === TokenKind.AmpAmp) {\n\t\ts.pos++; // consume \"&&\"\n\t\tconst next = parseComparison(s) || parseGroup(s);\n\t\tif (!next) {\n\t\t\ts.pos = startPos;\n\t\t\tbreak;\n\t\t}\n\t\toperands.push(next);\n\t\t// update the parser start position,\n\t\t// so we don't rewind too much on failure\n\t\tstartPos = s.pos;\n\t}\n\n\treturn {\n\t\tkind: SyntaxKind.And,\n\t\toperands,\n\t};\n}\n\nfunction parseOr(s: ParserState): Or | undefined {\n\t// <and|comparison|group> || <and|comparison|group> || ...\n\tlet startPos = s.pos;\n\tconst first = parseAnd(s) || parseComparison(s) || parseGroup(s);\n\tif (!first) {\n\t\ts.pos = startPos;\n\t\treturn;\n\t}\n\t// Expect a \"||\" operator\n\tif (s.tokens[s.pos]?.kind !== TokenKind.BarBar) {\n\t\ts.pos = startPos;\n\t\treturn;\n\t}\n\ts.pos++; // consume \"||\"\n\tconst second = parseAnd(s) || parseComparison(s) || parseGroup(s);\n\tif (!second) {\n\t\ts.pos = startPos;\n\t\treturn;\n\t}\n\n\t// Parsing succeeded so far, update the parser start position,\n\t// so we don't rewind too much on failure\n\tstartPos = s.pos;\n\n\t// Now optionally parse further sequences of \"||\" <and|comparison|group>\n\tconst operands: Expression[] = [first, second];\n\twhile (s.tokens[s.pos]?.kind === TokenKind.BarBar) {\n\t\ts.pos++; // consume \"||\"\n\t\tconst next = parseAnd(s) || parseComparison(s) || parseGroup(s);\n\t\tif (!next) {\n\t\t\ts.pos = startPos;\n\t\t\tbreak;\n\t\t}\n\t\toperands.push(next);\n\t\t// update the parser start position,\n\t\t// so we don't rewind too much on failure\n\t\tstartPos = s.pos;\n\t}\n\n\treturn {\n\t\tkind: SyntaxKind.Or,\n\t\toperands,\n\t};\n}\n\nfunction parseGroup(s: ParserState): Expression | undefined {\n\t// A group is technically only needed for operator precedence of OR expressions,\n\t// but we parse any expression within parentheses for simplicity\n\t// \"(\" <expression> \")\"\n\tconst startPos = s.pos;\n\tif (s.tokens[s.pos]?.kind !== TokenKind.LeftParen) {\n\t\treturn;\n\t}\n\ts.pos++; // consume \"(\"\n\n\tconst expression = parseExpression(s);\n\tif (!expression) {\n\t\ts.pos = startPos;\n\t\treturn;\n\t}\n\n\tif (s.tokens[s.pos]?.kind !== TokenKind.RightParen) {\n\t\ts.pos = startPos;\n\t\treturn;\n\t}\n\ts.pos++; // consume \")\"\n\treturn expression;\n}\n\nfunction parseComparison(s: ParserState): Comparison | undefined {\n\t// <identifier> <operator> <identifier|version|number>\n\tconst startPos = s.pos;\n\tconst left = parseIdentifier(s);\n\tif (!left) {\n\t\ts.pos = startPos;\n\t\treturn;\n\t}\n\tconst operator = parseOperator(s);\n\tif (operator == undefined) {\n\t\ts.pos = startPos;\n\t\treturn;\n\t}\n\tconst right = parseVersion(s)\n\t\t|| parseNumberLiteral(s)\n\t\t|| parseIdentifier(s);\n\tif (!right) {\n\t\ts.pos = startPos;\n\t\treturn;\n\t} else if (right.kind === SyntaxKind.Identifier) {\n\t\t// For comparisons, the right side must not be an identifier\n\t\tthrow new Error(\n\t\t\t`Right-hand side of comparisons must be a version or number literal`,\n\t\t);\n\t}\n\treturn {\n\t\tkind: SyntaxKind.Comparison,\n\t\tleft,\n\t\toperator,\n\t\tright,\n\t};\n}\n\nfunction parseIdentifier(s: ParserState): Identifier | undefined {\n\tconst token = s.tokens[s.pos];\n\tif (token?.kind === TokenKind.Identifier) {\n\t\ts.pos++;\n\t\treturn { kind: SyntaxKind.Identifier, name: token.value! };\n\t}\n}\n\nfunction parseOperator(s: ParserState): Operator | null {\n\tconst token = s.tokens[s.pos];\n\tif (!token) return null;\n\n\tswitch (token.kind) {\n\t\tcase TokenKind.EqualsEquals:\n\t\tcase TokenKind.EqualsEqualsEquals:\n\t\t\ts.pos++;\n\t\t\treturn Operator.Equal;\n\t\tcase TokenKind.ExclamationEquals:\n\t\tcase TokenKind.ExclamationEqualsEquals:\n\t\t\ts.pos++;\n\t\t\treturn Operator.NotEqual;\n\t\tcase TokenKind.LessThan:\n\t\t\ts.pos++;\n\t\t\treturn Operator.LessThan;\n\t\tcase TokenKind.LessThanEquals:\n\t\t\ts.pos++;\n\t\t\treturn Operator.LessThanOrEqual;\n\t\tcase TokenKind.GreaterThan:\n\t\t\ts.pos++;\n\t\t\treturn Operator.GreaterThan;\n\t\tcase TokenKind.GreaterThanEquals:\n\t\t\ts.pos++;\n\t\t\treturn Operator.GreaterThanOrEqual;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\nfunction parseVersion(s: ParserState): Version | undefined {\n\t// <number> \".\" <number> [\".\" <number>]\n\tlet pos = s.pos;\n\t// Parse a sequence of 2-3 number literals separated by dots\n\tif (s.tokens[pos]?.kind !== TokenKind.NumberLiteral) {\n\t\treturn;\n\t}\n\tlet version = s.tokens[pos].value!;\n\tpos++;\n\tif (s.tokens[pos]?.kind !== TokenKind.Dot) {\n\t\treturn;\n\t}\n\tversion += \".\";\n\tpos++;\n\tif (s.tokens[pos]?.kind !== TokenKind.NumberLiteral) {\n\t\treturn;\n\t}\n\tversion += s.tokens[pos].value!;\n\tpos++;\n\t// Optionally parse a third number\n\tif (s.tokens[pos]?.kind === TokenKind.Dot) {\n\t\tversion += \".\";\n\t\tpos++;\n\t\tif (s.tokens[pos]?.kind !== TokenKind.NumberLiteral) {\n\t\t\treturn;\n\t\t}\n\t\tversion += s.tokens[pos].value!;\n\t\tpos++;\n\t}\n\t// Update the parser state position\n\ts.pos = pos;\n\treturn { kind: SyntaxKind.Version, value: version };\n}\n\nfunction parseNumberLiteral(s: ParserState): NumberLiteral | undefined {\n\tif (s.tokens[s.pos]?.kind === TokenKind.NumberLiteral) {\n\t\tconst token = s.tokens[s.pos];\n\t\ts.pos++;\n\t\treturn {\n\t\t\tkind: SyntaxKind.NumberLiteral,\n\t\t\tvalue: parseInt(token.value!),\n\t\t};\n\t}\n}\n\nexport function toRulesLogic(expr: Expression): RulesLogic {\n\tif (expr.kind === SyntaxKind.Or) {\n\t\treturn {\n\t\t\tor: expr.operands.map(toRulesLogic),\n\t\t};\n\t} else if (expr.kind === SyntaxKind.And) {\n\t\treturn {\n\t\t\tand: expr.operands.map(toRulesLogic),\n\t\t};\n\t} else if (expr.kind === SyntaxKind.Comparison) {\n\t\tif (expr.right.kind === SyntaxKind.Version) {\n\t\t\tconst opMap = {\n\t\t\t\t[Operator.Equal]: \"ver ===\",\n\t\t\t\t[Operator.NotEqual]: \"ver !==\",\n\t\t\t\t[Operator.LessThan]: \"ver <\",\n\t\t\t\t[Operator.LessThanOrEqual]: \"ver <=\",\n\t\t\t\t[Operator.GreaterThan]: \"ver >\",\n\t\t\t\t[Operator.GreaterThanOrEqual]: \"ver >=\",\n\t\t\t} as const;\n\t\t\t// @ts-expect-error The generated types for the version comparisons are not compatible with the RulesLogic type\n\t\t\treturn {\n\t\t\t\t[opMap[expr.operator]]: [\n\t\t\t\t\t{ var: expr.left.name },\n\t\t\t\t\texpr.right.value,\n\t\t\t\t],\n\t\t\t};\n\t\t} else {\n\t\t\tconst opMap = {\n\t\t\t\t[Operator.Equal]: \"===\",\n\t\t\t\t[Operator.NotEqual]: \"!==\",\n\t\t\t\t[Operator.LessThan]: \"<\",\n\t\t\t\t[Operator.LessThanOrEqual]: \"<=\",\n\t\t\t\t[Operator.GreaterThan]: \">\",\n\t\t\t\t[Operator.GreaterThanOrEqual]: \">=\",\n\t\t\t};\n\t\t\t// @ts-expect-error The generated types for the version comparisons are not compatible with the RulesLogic type\n\t\t\treturn {\n\t\t\t\t[opMap[expr.operator]]: [\n\t\t\t\t\t{ var: expr.left.name },\n\t\t\t\t\texpr.right.value,\n\t\t\t\t] as const,\n\t\t\t};\n\t\t}\n\t} else {\n\t\tassertNever(expr);\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;AAEA,oBAAkC;AAClC,qBAA4B;AAG5B,IAAY;CAAZ,SAAYA,aAAU;AACrB,EAAAA,YAAAA,YAAA,OAAA,IAAA,CAAA,IAAA;AACA,EAAAA,YAAAA,YAAA,IAAA,IAAA,CAAA,IAAA;AACA,EAAAA,YAAAA,YAAA,KAAA,IAAA,CAAA,IAAA;AACA,EAAAA,YAAAA,YAAA,YAAA,IAAA,CAAA,IAAA;AACA,EAAAA,YAAAA,YAAA,YAAA,IAAA,CAAA,IAAA;AACA,EAAAA,YAAAA,YAAA,eAAA,IAAA,CAAA,IAAA;AACA,EAAAA,YAAAA,YAAA,SAAA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QACxB,CAAC,SAAS,kBAAkB,GAAG;;AAGhC,aAAO;QACN,CAAC,MAAM,KAAK,QAAQ,CAAC,GAAG;UACvB,EAAE,KAAK,KAAK,KAAK,KAAI;UACrB,KAAK,MAAM;;;IAGd;EACD,OAAO;AACN,oCAAY,IAAI;EACjB;AACD;AA9CgB;",
|
|
6
|
+
"names": ["SyntaxKind", "Operator", "TokenKind"]
|
|
7
7
|
}
|
package/build/cjs/_version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "15.
|
|
1
|
+
export declare const PACKAGE_VERSION = "15.16.0";
|
|
2
2
|
//# sourceMappingURL=_version.d.ts.map
|
package/build/cjs/_version.js
CHANGED
|
@@ -21,7 +21,7 @@ __export(version_exports, {
|
|
|
21
21
|
PACKAGE_VERSION: () => PACKAGE_VERSION
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(version_exports);
|
|
24
|
-
const PACKAGE_VERSION = "15.
|
|
24
|
+
const PACKAGE_VERSION = "15.16.0";
|
|
25
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
26
|
0 && (module.exports = {
|
|
27
27
|
PACKAGE_VERSION
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/_version.ts"],
|
|
4
|
-
"sourcesContent": ["// This file is auto-generated by the codegen maintenance script\nexport const PACKAGE_VERSION = \"15.
|
|
4
|
+
"sourcesContent": ["// This file is auto-generated by the codegen maintenance script\nexport const PACKAGE_VERSION = \"15.16.0\";\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;;;;;AACO,MAAM,kBAAkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type JSONObject } from "@zwave-js/shared";
|
|
1
|
+
import { type BytesView, type JSONObject } from "@zwave-js/shared";
|
|
2
2
|
import type { ReadFile, ReadFileSystemInfo } from "@zwave-js/shared/bindings";
|
|
3
3
|
import { type AssociationConfig, ConditionalAssociationConfig } from "./AssociationConfig.js";
|
|
4
4
|
import { type CompatConfig, ConditionalCompatConfig } from "./CompatConfig.js";
|
|
@@ -117,8 +117,8 @@ export declare class DeviceConfig {
|
|
|
117
117
|
/**
|
|
118
118
|
* Returns a hash code that can be used to check whether a device config has changed enough to require a re-interview.
|
|
119
119
|
*/
|
|
120
|
-
getHash(version?: 0 | 1 | 2): Promise<
|
|
120
|
+
getHash(version?: 0 | 1 | 2): Promise<BytesView>;
|
|
121
121
|
static get maxHashVersion(): 2;
|
|
122
|
-
static areHashesEqual(hash:
|
|
122
|
+
static areHashesEqual(hash: BytesView, other: BytesView): boolean;
|
|
123
123
|
}
|
|
124
124
|
//# sourceMappingURL=DeviceConfig.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/devices/DeviceConfig.ts"],
|
|
4
|
-
"sourcesContent": ["import { configDir } from \"#config_dir\";\nimport {\n\tZWaveError,\n\tZWaveErrorCodes,\n\tdeflateSync,\n\tdigest,\n} from \"@zwave-js/core\";\nimport {\n\tBytes,\n\ttype JSONObject,\n\tcloneDeep,\n\tenumFilesRecursive,\n\tformatId,\n\tgetenv,\n\tnum2hex,\n\tpadVersion,\n\tpathExists,\n\tpick,\n\treadTextFile,\n\tstringify,\n\twriteTextFile,\n} from \"@zwave-js/shared\";\nimport type {\n\tReadFile,\n\tReadFileSystemInfo,\n\tWriteFile,\n} from \"@zwave-js/shared/bindings\";\nimport { isArray, isObject } from \"alcalzone-shared/typeguards\";\nimport JSON5 from \"json5\";\nimport path from \"pathe\";\nimport semverGt from \"semver/functions/gt.js\";\nimport { clearTemplateCache, readJsonWithTemplate } from \"../JsonTemplate.js\";\nimport type { ConfigLogger } from \"../Logger.js\";\nimport { hexKeyRegex4Digits, throwInvalidConfig } from \"../utils_safe.js\";\nimport {\n\ttype AssociationConfig,\n\tConditionalAssociationConfig,\n} from \"./AssociationConfig.js\";\nimport { type CompatConfig, ConditionalCompatConfig } from \"./CompatConfig.js\";\nimport { evaluateDeep, validateCondition } from \"./ConditionalItem.js\";\nimport {\n\ttype ConditionalPrimitive,\n\tparseConditionalPrimitive,\n} from \"./ConditionalPrimitive.js\";\nimport {\n\tConditionalDeviceMetadata,\n\ttype DeviceMetadata,\n} from \"./DeviceMetadata.js\";\nimport {\n\tConditionalEndpointConfig,\n\ttype EndpointConfig,\n} from \"./EndpointConfig.js\";\nimport {\n\ttype ConditionalParamInfoMap,\n\ttype ParamInfoMap,\n\ttype ParamInformation,\n\tparseConditionalParamInformationMap,\n} from \"./ParamInformation.js\";\nimport { ConditionalSceneConfig, type SceneConfig } from \"./SceneConfig.js\";\nimport type { DeviceID, FirmwareVersionRange } from \"./shared.js\";\n\nexport interface DeviceConfigIndexEntry {\n\tmanufacturerId: string;\n\tproductType: string;\n\tproductId: string;\n\tfirmwareVersion: FirmwareVersionRange;\n\tpreferred?: true;\n\trootDir?: string;\n\tfilename: string;\n}\n\nexport interface FulltextDeviceConfigIndexEntry {\n\tmanufacturerId: string;\n\tmanufacturer: string;\n\tlabel: string;\n\tdescription: string;\n\tproductType: string;\n\tproductId: string;\n\tfirmwareVersion: FirmwareVersionRange;\n\tpreferred?: true;\n\trootDir?: string;\n\tfilename: string;\n}\n\nexport const embeddedDevicesDir = path.join(configDir, \"devices\");\nconst fulltextIndexPath = path.join(embeddedDevicesDir, \"fulltext_index.json\");\n\nexport function getDevicesPaths(configDir: string): {\n\tdevicesDir: string;\n\tindexPath: string;\n} {\n\tconst devicesDir = path.join(configDir, \"devices\");\n\tconst indexPath = path.join(devicesDir, \"index.json\");\n\treturn { devicesDir, indexPath };\n}\n\nexport type DeviceConfigIndex = DeviceConfigIndexEntry[];\nexport type FulltextDeviceConfigIndex = FulltextDeviceConfigIndexEntry[];\n\nasync function hasChangedDeviceFiles(\n\tfs: ReadFileSystemInfo,\n\tdevicesRoot: string,\n\tdir: string,\n\tlastChange: Date,\n): Promise<boolean> {\n\t// Check if there are any files BUT index.json that were changed\n\t// or directories that were modified\n\tconst filesAndDirs = await fs.readDir(dir);\n\tfor (const f of filesAndDirs) {\n\t\tconst fullPath = path.join(dir, f);\n\n\t\tconst stat = await fs.stat(fullPath);\n\t\tif (\n\t\t\t(dir !== devicesRoot || f !== \"index.json\")\n\t\t\t&& (stat.isFile() || stat.isDirectory())\n\t\t\t&& stat.mtime > lastChange\n\t\t) {\n\t\t\treturn true;\n\t\t} else if (stat.isDirectory()) {\n\t\t\t// we need to go deeper!\n\t\t\tif (\n\t\t\t\tawait hasChangedDeviceFiles(\n\t\t\t\t\tfs,\n\t\t\t\t\tdevicesRoot,\n\t\t\t\t\tfullPath,\n\t\t\t\t\tlastChange,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Read all device config files from a given directory and return them as index entries.\n * Does not update the index itself.\n */\nasync function generateIndex<T extends Record<string, unknown>>(\n\tfs: ReadFileSystemInfo & ReadFile,\n\tdevicesDir: string,\n\tisEmbedded: boolean,\n\textractIndexEntries: (config: DeviceConfig) => T[],\n\tlogger?: ConfigLogger,\n): Promise<(T & { filename: string; rootDir?: string })[]> {\n\tconst index: (T & { filename: string; rootDir?: string })[] = [];\n\n\tclearTemplateCache();\n\tconst configFiles = await enumFilesRecursive(\n\t\tfs,\n\t\tdevicesDir,\n\t\t(file) =>\n\t\t\tfile.endsWith(\".json\")\n\t\t\t&& !file.endsWith(\"index.json\")\n\t\t\t&& !file.includes(\"/templates/\")\n\t\t\t&& !file.includes(\"\\\\templates\\\\\"),\n\t);\n\n\t// Add the embedded devices dir as a fallback if necessary\n\tconst fallbackDirs = devicesDir !== embeddedDevicesDir\n\t\t? [embeddedDevicesDir]\n\t\t: undefined;\n\n\tfor (const file of configFiles) {\n\t\tconst relativePath = path\n\t\t\t.relative(devicesDir, file)\n\t\t\t.replaceAll(\"\\\\\", \"/\");\n\t\t// Try parsing the file\n\t\ttry {\n\t\t\tconst config = await DeviceConfig.from(\n\t\t\t\tfs,\n\t\t\t\tfile,\n\t\t\t\tisEmbedded,\n\t\t\t\t{\n\t\t\t\t\trootDir: devicesDir,\n\t\t\t\t\tfallbackDirs,\n\t\t\t\t\trelative: true,\n\t\t\t\t},\n\t\t\t);\n\t\t\t// Add the file to the index\n\t\t\tindex.push(\n\t\t\t\t...extractIndexEntries(config).map((entry) => {\n\t\t\t\t\tconst ret: T & { filename: string; rootDir?: string } = {\n\t\t\t\t\t\t...entry,\n\t\t\t\t\t\tfilename: relativePath,\n\t\t\t\t\t};\n\t\t\t\t\t// Only add the root dir to the index if necessary\n\t\t\t\t\tif (devicesDir !== embeddedDevicesDir) {\n\t\t\t\t\t\tret.rootDir = devicesDir;\n\t\t\t\t\t}\n\t\t\t\t\treturn ret;\n\t\t\t\t}),\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tconst message = `Error parsing config file ${relativePath}: ${\n\t\t\t\t(e as Error).message\n\t\t\t}`;\n\t\t\t// Crash hard during tests, just print an error when in production systems.\n\t\t\t// A user could have changed a config file\n\t\t\tif (process.env.NODE_ENV === \"test\" || !!getenv(\"CI\")) {\n\t\t\t\tthrow new ZWaveError(message, ZWaveErrorCodes.Config_Invalid);\n\t\t\t} else {\n\t\t\t\tlogger?.print(message, \"error\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn index;\n}\n\nasync function loadDeviceIndexShared<T extends Record<string, unknown>>(\n\tfs: ReadFileSystemInfo & ReadFile & WriteFile,\n\tdevicesDir: string,\n\tindexPath: string,\n\textractIndexEntries: (config: DeviceConfig) => T[],\n\tlogger?: ConfigLogger,\n): Promise<(T & { filename: string })[]> {\n\t// The index file needs to be regenerated if it does not exist\n\tlet needsUpdate = !(await pathExists(fs, indexPath));\n\tlet index: (T & { filename: string })[] | undefined;\n\tlet mtimeIndex: Date | undefined;\n\t// ...or if cannot be parsed\n\tif (!needsUpdate) {\n\t\ttry {\n\t\t\tconst fileContents = await readTextFile(fs, indexPath, \"utf8\");\n\t\t\tindex = JSON5.parse(fileContents);\n\t\t\tmtimeIndex = (await fs.stat(indexPath)).mtime;\n\t\t} catch {\n\t\t\tlogger?.print(\n\t\t\t\t\"Error while parsing index file - regenerating...\",\n\t\t\t\t\"warn\",\n\t\t\t);\n\t\t\tneedsUpdate = true;\n\t\t} finally {\n\t\t\tif (!index) {\n\t\t\t\tlogger?.print(\n\t\t\t\t\t\"Index file was malformed - regenerating...\",\n\t\t\t\t\t\"warn\",\n\t\t\t\t);\n\t\t\t\tneedsUpdate = true;\n\t\t\t}\n\t\t}\n\t}\n\n\t// ...or if there were any changes in the file system\n\tif (!needsUpdate) {\n\t\tneedsUpdate = await hasChangedDeviceFiles(\n\t\t\tfs,\n\t\t\tdevicesDir,\n\t\t\tdevicesDir,\n\t\t\tmtimeIndex!,\n\t\t);\n\t\tif (needsUpdate) {\n\t\t\tlogger?.print(\n\t\t\t\t\"Device configuration files on disk changed - regenerating index...\",\n\t\t\t\t\"verbose\",\n\t\t\t);\n\t\t}\n\t}\n\n\tif (needsUpdate) {\n\t\t// Read all files from disk and generate an index\n\t\tindex = await generateIndex(\n\t\t\tfs,\n\t\t\tdevicesDir,\n\t\t\ttrue,\n\t\t\textractIndexEntries,\n\t\t\tlogger,\n\t\t);\n\t\t// Save the index to disk\n\t\ttry {\n\t\t\tawait writeTextFile(\n\t\t\t\tfs,\n\t\t\t\tpath.join(indexPath),\n\t\t\t\t`// This file is auto-generated. DO NOT edit it by hand if you don't know what you're doing!\"\n${stringify(index, \"\\t\")}\n`,\n\t\t\t\t\"utf8\",\n\t\t\t);\n\t\t\tlogger?.print(\"Device index regenerated\", \"verbose\");\n\t\t} catch (e) {\n\t\t\tlogger?.print(\n\t\t\t\t`Writing the device index to disk failed: ${\n\t\t\t\t\t(e as Error).message\n\t\t\t\t}`,\n\t\t\t\t\"error\",\n\t\t\t);\n\t\t}\n\t}\n\n\treturn index!;\n}\n\n/**\n * @internal\n * Loads the index file to quickly access the device configs.\n * Transparently handles updating the index if necessary\n */\nexport async function generatePriorityDeviceIndex(\n\tfs: ReadFileSystemInfo & ReadFile,\n\tdeviceConfigPriorityDir: string,\n\tlogger?: ConfigLogger,\n): Promise<DeviceConfigIndex> {\n\treturn (\n\t\tawait generateIndex(\n\t\t\tfs,\n\t\t\tdeviceConfigPriorityDir,\n\t\t\tfalse,\n\t\t\t(config) =>\n\t\t\t\tconfig.devices.map((dev) => ({\n\t\t\t\t\tmanufacturerId: formatId(\n\t\t\t\t\t\tconfig.manufacturerId.toString(16),\n\t\t\t\t\t),\n\t\t\t\t\tmanufacturer: config.manufacturer,\n\t\t\t\t\tlabel: config.label,\n\t\t\t\t\tproductType: formatId(dev.productType),\n\t\t\t\t\tproductId: formatId(dev.productId),\n\t\t\t\t\tfirmwareVersion: config.firmwareVersion,\n\t\t\t\t\t...(config.preferred ? { preferred: true as const } : {}),\n\t\t\t\t\trootDir: deviceConfigPriorityDir,\n\t\t\t\t})),\n\t\t\tlogger,\n\t\t)\n\t).map(({ filename, ...entry }) => ({\n\t\t...entry,\n\t\t// The generated index makes the filenames relative to the given directory\n\t\t// but we need them to be absolute\n\t\tfilename: path.join(deviceConfigPriorityDir, filename),\n\t}));\n}\n\n/**\n * @internal\n * Loads the index file to quickly access the device configs.\n * Transparently handles updating the index if necessary\n */\nexport async function loadDeviceIndexInternal(\n\tfs: ReadFileSystemInfo & ReadFile & WriteFile,\n\tlogger?: ConfigLogger,\n\texternalConfigDir?: string,\n): Promise<DeviceConfigIndex> {\n\tconst { devicesDir, indexPath } = getDevicesPaths(\n\t\texternalConfigDir || configDir,\n\t);\n\n\treturn loadDeviceIndexShared(\n\t\tfs,\n\t\tdevicesDir,\n\t\tindexPath,\n\t\t(config) =>\n\t\t\tconfig.devices.map((dev) => ({\n\t\t\t\tmanufacturerId: formatId(config.manufacturerId.toString(16)),\n\t\t\t\tmanufacturer: config.manufacturer,\n\t\t\t\tlabel: config.label,\n\t\t\t\tproductType: formatId(dev.productType),\n\t\t\t\tproductId: formatId(dev.productId),\n\t\t\t\tfirmwareVersion: config.firmwareVersion,\n\t\t\t\t...(config.preferred ? { preferred: true as const } : {}),\n\t\t\t})),\n\t\tlogger,\n\t);\n}\n\n/**\n * @internal\n * Loads the full text index file to quickly search the device configs.\n * Transparently handles updating the index if necessary\n */\nexport async function loadFulltextDeviceIndexInternal(\n\tfs: ReadFileSystemInfo & ReadFile & WriteFile,\n\tlogger?: ConfigLogger,\n): Promise<FulltextDeviceConfigIndex> {\n\t// This method is not meant to operate with the external device index!\n\treturn loadDeviceIndexShared(\n\t\tfs,\n\t\tembeddedDevicesDir,\n\t\tfulltextIndexPath,\n\t\t(config) =>\n\t\t\tconfig.devices.map((dev) => ({\n\t\t\t\tmanufacturerId: formatId(config.manufacturerId.toString(16)),\n\t\t\t\tmanufacturer: config.manufacturer,\n\t\t\t\tlabel: config.label,\n\t\t\t\tdescription: config.description,\n\t\t\t\tproductType: formatId(dev.productType),\n\t\t\t\tproductId: formatId(dev.productId),\n\t\t\t\tfirmwareVersion: config.firmwareVersion,\n\t\t\t\t...(config.preferred ? { preferred: true as const } : {}),\n\t\t\t\trootDir: embeddedDevicesDir,\n\t\t\t})),\n\t\tlogger,\n\t);\n}\n\nfunction isHexKeyWith4Digits(val: any): val is string {\n\treturn typeof val === \"string\" && hexKeyRegex4Digits.test(val);\n}\n\nconst firmwareVersionRegex = /^\\d{1,3}\\.\\d{1,3}(\\.\\d{1,3})?$/;\nfunction isFirmwareVersion(val: any): val is string {\n\treturn (\n\t\ttypeof val === \"string\"\n\t\t&& firmwareVersionRegex.test(val)\n\t\t&& val\n\t\t\t.split(\".\")\n\t\t\t.map((str) => parseInt(str, 10))\n\t\t\t.every((num) => num >= 0 && num <= 255)\n\t);\n}\n\nconst deflateDict = Bytes.from(\n\t// Substrings appearing in the device config files in descending order of frequency\n\t// except for very short ones like 0, 1, ...\n\t// WARNING: THIS MUST NOT BE CHANGED! Doing so breaks decompressing stored hashes.\n\t[\n\t\t`\"parameterNumber\":`,\n\t\t`255`,\n\t\t`\"value\":`,\n\t\t`\"defaultValue\":`,\n\t\t`\"valueSize\":`,\n\t\t`\"maxValue\":`,\n\t\t`\"minValue\":`,\n\t\t`\"options\":`,\n\t\t`true`,\n\t\t`false`,\n\t\t`\"allowManualEntry\":`,\n\t\t`\"maxNodes\":`,\n\t\t`100`,\n\t\t`\"unsigned\":`,\n\t\t`\"paramInformation\":`,\n\t\t`\"isLifeline\":`,\n\t\t`\"seconds\"`,\n\t\t`99`,\n\t\t`127`,\n\t\t`\"%\"`,\n\t\t`65535`,\n\t\t`32767`,\n\t\t`\"minutes\"`,\n\t\t`\"endpoints\":`,\n\t\t`\"hours\"`,\n\t\t`\"multiChannel\":`,\n\t]\n\t\t.join(\"\"),\n\t\"utf8\",\n);\n\n/** This class represents a device config entry whose conditional settings have not been evaluated yet */\nexport class ConditionalDeviceConfig {\n\tpublic static async from(\n\t\tfs: ReadFileSystemInfo & ReadFile,\n\t\tfilename: string,\n\t\tisEmbedded: boolean,\n\t\toptions: {\n\t\t\trootDir: string;\n\t\t\tfallbackDirs?: string[];\n\t\t\trelative?: boolean;\n\t\t},\n\t): Promise<ConditionalDeviceConfig> {\n\t\tconst { relative, rootDir } = options;\n\n\t\tconst relativePath = relative\n\t\t\t? path.relative(rootDir, filename).replaceAll(\"\\\\\", \"/\")\n\t\t\t: filename;\n\t\tconst json = await readJsonWithTemplate(\n\t\t\tfs,\n\t\t\tfilename,\n\t\t\t[\n\t\t\t\toptions.rootDir,\n\t\t\t\t...(options.fallbackDirs ?? []),\n\t\t\t],\n\t\t);\n\t\treturn new ConditionalDeviceConfig(relativePath, isEmbedded, json);\n\t}\n\n\tpublic constructor(\n\t\tfilename: string,\n\t\tisEmbedded: boolean,\n\t\tdefinition: JSONObject,\n\t) {\n\t\tthis.filename = filename;\n\t\tthis.isEmbedded = isEmbedded;\n\n\t\tif (!isHexKeyWith4Digits(definition.manufacturerId)) {\n\t\t\tthrowInvalidConfig(\n\t\t\t\t`device`,\n\t\t\t\t`packages/config/config/devices/${filename}:\nmanufacturer id must be a lowercase hexadecimal number with 4 digits`,\n\t\t\t);\n\t\t}\n\t\tthis.manufacturerId = parseInt(definition.manufacturerId, 16);\n\n\t\tfor (const prop of [\"manufacturer\", \"label\", \"description\"] as const) {\n\t\t\tthis[prop] = parseConditionalPrimitive(\n\t\t\t\tfilename,\n\t\t\t\t\"string\",\n\t\t\t\tprop,\n\t\t\t\tdefinition[prop],\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\t!isArray(definition.devices)\n\t\t\t|| !(definition.devices as any[]).every(\n\t\t\t\t(dev: unknown) =>\n\t\t\t\t\tisObject(dev)\n\t\t\t\t\t&& isHexKeyWith4Digits(dev.productType)\n\t\t\t\t\t&& isHexKeyWith4Digits(dev.productId),\n\t\t\t)\n\t\t) {\n\t\t\tthrowInvalidConfig(\n\t\t\t\t`device`,\n\t\t\t\t`packages/config/config/devices/${filename}:\ndevices is malformed (not an object or type/id that is not a lowercase 4-digit hex key)`,\n\t\t\t);\n\t\t}\n\t\tthis.devices = (definition.devices as any[]).map(\n\t\t\t({ productType, productId }) => ({\n\t\t\t\tproductType: parseInt(productType, 16),\n\t\t\t\tproductId: parseInt(productId, 16),\n\t\t\t}),\n\t\t);\n\n\t\tif (\n\t\t\t!isObject(definition.firmwareVersion)\n\t\t\t|| !isFirmwareVersion(definition.firmwareVersion.min)\n\t\t\t|| !isFirmwareVersion(definition.firmwareVersion.max)\n\t\t) {\n\t\t\tthrowInvalidConfig(\n\t\t\t\t`device`,\n\t\t\t\t`packages/config/config/devices/${filename}:\nfirmwareVersion is malformed or invalid. Must be x.y or x.y.z where x, y, and z are integers between 0 and 255`,\n\t\t\t);\n\t\t} else {\n\t\t\tconst { min, max } = definition.firmwareVersion;\n\t\t\tif (semverGt(padVersion(min), padVersion(max))) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nfirmwareVersion.min ${min} must not be greater than firmwareVersion.max ${max}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.firmwareVersion = { min, max };\n\t\t}\n\n\t\tif (\n\t\t\tdefinition.preferred != undefined\n\t\t\t&& definition.preferred !== true\n\t\t) {\n\t\t\tthrowInvalidConfig(\n\t\t\t\t`device`,\n\t\t\t\t`packages/config/config/devices/${filename}:\npreferred must be true or omitted`,\n\t\t\t);\n\t\t}\n\t\tthis.preferred = !!definition.preferred;\n\n\t\tif (definition.endpoints != undefined) {\n\t\t\tconst endpoints = new Map<number, ConditionalEndpointConfig>();\n\t\t\tif (!isObject(definition.endpoints)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nendpoints is not an object`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tfor (const [key, ep] of Object.entries(definition.endpoints)) {\n\t\t\t\tif (!/^\\d+$/.test(key)) {\n\t\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t\t`device`,\n\t\t\t\t\t\t`packages/config/config/devices/${filename}:\nfound non-numeric endpoint index \"${key}\" in endpoints`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst epIndex = parseInt(key, 10);\n\t\t\t\tendpoints.set(\n\t\t\t\t\tepIndex,\n\t\t\t\t\tnew ConditionalEndpointConfig(this, epIndex, ep as any),\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.endpoints = endpoints;\n\t\t}\n\n\t\tif (definition.associations != undefined) {\n\t\t\tconst associations = new Map<\n\t\t\t\tnumber,\n\t\t\t\tConditionalAssociationConfig\n\t\t\t>();\n\t\t\tif (!isObject(definition.associations)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nassociations is not an object`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tfor (\n\t\t\t\tconst [key, assocDefinition] of Object.entries(\n\t\t\t\t\tdefinition.associations,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tif (!/^[1-9][0-9]*$/.test(key)) {\n\t\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t\t`device`,\n\t\t\t\t\t\t`packages/config/config/devices/${filename}:\nfound non-numeric group id \"${key}\" in associations`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst keyNum = parseInt(key, 10);\n\t\t\t\tassociations.set(\n\t\t\t\t\tkeyNum,\n\t\t\t\t\tnew ConditionalAssociationConfig(\n\t\t\t\t\t\tfilename,\n\t\t\t\t\t\tkeyNum,\n\t\t\t\t\t\tassocDefinition as any,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.associations = associations;\n\t\t}\n\n\t\tif (definition.paramInformation != undefined) {\n\t\t\tthis.paramInformation = parseConditionalParamInformationMap(\n\t\t\t\tdefinition,\n\t\t\t\tthis,\n\t\t\t);\n\t\t}\n\n\t\tif (definition.proprietary != undefined) {\n\t\t\tif (!isObject(definition.proprietary)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nproprietary is not an object`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.proprietary = definition.proprietary;\n\t\t}\n\n\t\tif (definition.compat != undefined) {\n\t\t\tif (\n\t\t\t\tisArray(definition.compat)\n\t\t\t\t&& definition.compat.every((item: any) => isObject(item))\n\t\t\t) {\n\t\t\t\t// Make sure all conditions are valid\n\t\t\t\tfor (const entry of definition.compat) {\n\t\t\t\t\tvalidateCondition(\n\t\t\t\t\t\tfilename,\n\t\t\t\t\t\tentry,\n\t\t\t\t\t\t`At least one entry of compat contains an`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tthis.compat = definition.compat.map(\n\t\t\t\t\t(item: any) => new ConditionalCompatConfig(filename, item),\n\t\t\t\t);\n\t\t\t} else if (isObject(definition.compat)) {\n\t\t\t\tthis.compat = new ConditionalCompatConfig(\n\t\t\t\t\tfilename,\n\t\t\t\t\tdefinition.compat,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\ncompat must be an object or any array of conditional objects`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (definition.metadata != undefined) {\n\t\t\tif (!isObject(definition.metadata)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nmetadata is not an object`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.metadata = new ConditionalDeviceMetadata(\n\t\t\t\tfilename,\n\t\t\t\tdefinition.metadata,\n\t\t\t);\n\t\t}\n\n\t\tif (definition.scenes != undefined) {\n\t\t\tconst scenes = new Map<\n\t\t\t\tnumber,\n\t\t\t\tConditionalSceneConfig\n\t\t\t>();\n\t\t\tif (!isObject(definition.scenes)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nscenes is not an object`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tfor (\n\t\t\t\tconst [key, sceneDefinition] of Object.entries(\n\t\t\t\t\tdefinition.scenes,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tif (!/^[1-9][0-9]*$/.test(key)) {\n\t\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t\t`device`,\n\t\t\t\t\t\t`packages/config/config/devices/${filename}:\ninvalid scene id \"${key}\" in scenes - must be a positive integer (1-255)`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst keyNum = parseInt(key, 10);\n\t\t\t\tif (keyNum < 1 || keyNum > 255) {\n\t\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t\t`device`,\n\t\t\t\t\t\t`packages/config/config/devices/${filename}:\nscene number ${keyNum} must be between 1 and 255`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tscenes.set(\n\t\t\t\t\tkeyNum,\n\t\t\t\t\tnew ConditionalSceneConfig(\n\t\t\t\t\t\tfilename,\n\t\t\t\t\t\tkeyNum,\n\t\t\t\t\t\tsceneDefinition as any,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.scenes = scenes;\n\t\t}\n\t}\n\n\tpublic readonly filename: string;\n\n\tpublic readonly manufacturer!: ConditionalPrimitive<string>;\n\tpublic readonly manufacturerId: number;\n\tpublic readonly label!: ConditionalPrimitive<string>;\n\tpublic readonly description!: ConditionalPrimitive<string>;\n\tpublic readonly devices: readonly {\n\t\tproductType: number;\n\t\tproductId: number;\n\t}[];\n\tpublic readonly firmwareVersion: FirmwareVersionRange;\n\t/** Mark this configuration as preferred over other config files with an overlapping firmware range */\n\tpublic readonly preferred: boolean;\n\tpublic readonly endpoints?: ReadonlyMap<number, ConditionalEndpointConfig>;\n\tpublic readonly associations?: ReadonlyMap<\n\t\tnumber,\n\t\tConditionalAssociationConfig\n\t>;\n\tpublic readonly scenes?: ReadonlyMap<number, ConditionalSceneConfig>;\n\tpublic readonly paramInformation?: ConditionalParamInfoMap;\n\t/**\n\t * Contains manufacturer-specific support information for the\n\t * ManufacturerProprietary CC\n\t */\n\tpublic readonly proprietary?: Record<string, unknown>;\n\t/** Contains compatibility options */\n\tpublic readonly compat?:\n\t\t| ConditionalCompatConfig\n\t\t| ConditionalCompatConfig[];\n\t/** Contains instructions and other metadata for the device */\n\tpublic readonly metadata?: ConditionalDeviceMetadata;\n\n\t/** Whether this is an embedded configuration or not */\n\tpublic readonly isEmbedded: boolean;\n\n\tpublic evaluate(deviceId?: DeviceID): DeviceConfig {\n\t\treturn new DeviceConfig(\n\t\t\tthis.filename,\n\t\t\tthis.isEmbedded,\n\t\t\tevaluateDeep(this.manufacturer, deviceId),\n\t\t\tthis.manufacturerId,\n\t\t\tevaluateDeep(this.label, deviceId),\n\t\t\tevaluateDeep(this.description, deviceId),\n\t\t\tthis.devices,\n\t\t\tthis.firmwareVersion,\n\t\t\tthis.preferred,\n\t\t\tevaluateDeep(this.endpoints, deviceId),\n\t\t\tevaluateDeep(this.associations, deviceId),\n\t\t\tevaluateDeep(this.scenes, deviceId),\n\t\t\tevaluateDeep(this.paramInformation, deviceId),\n\t\t\tthis.proprietary,\n\t\t\tevaluateDeep(this.compat, deviceId),\n\t\t\tevaluateDeep(this.metadata, deviceId),\n\t\t);\n\t}\n}\n\nexport class DeviceConfig {\n\tpublic static async from(\n\t\tfs: ReadFileSystemInfo & ReadFile,\n\t\tfilename: string,\n\t\tisEmbedded: boolean,\n\t\toptions: {\n\t\t\trootDir: string;\n\t\t\tfallbackDirs?: string[];\n\t\t\trelative?: boolean;\n\t\t\tdeviceId?: DeviceID;\n\t\t},\n\t): Promise<DeviceConfig> {\n\t\tconst ret = await ConditionalDeviceConfig.from(\n\t\t\tfs,\n\t\t\tfilename,\n\t\t\tisEmbedded,\n\t\t\toptions,\n\t\t);\n\t\treturn ret.evaluate(options.deviceId);\n\t}\n\n\tpublic constructor(\n\t\tfilename: string,\n\t\tisEmbedded: boolean,\n\t\tmanufacturer: string,\n\t\tmanufacturerId: number,\n\t\tlabel: string,\n\t\tdescription: string,\n\t\tdevices: readonly {\n\t\t\tproductType: number;\n\t\t\tproductId: number;\n\t\t}[],\n\t\tfirmwareVersion: FirmwareVersionRange,\n\t\tpreferred: boolean,\n\t\tendpoints?: ReadonlyMap<number, EndpointConfig>,\n\t\tassociations?: ReadonlyMap<number, AssociationConfig>,\n\t\tscenes?: ReadonlyMap<number, SceneConfig>,\n\t\tparamInformation?: ParamInfoMap,\n\t\tproprietary?: Record<string, unknown>,\n\t\tcompat?: CompatConfig,\n\t\tmetadata?: DeviceMetadata,\n\t) {\n\t\tthis.filename = filename;\n\t\tthis.isEmbedded = isEmbedded;\n\t\tthis.manufacturer = manufacturer;\n\t\tthis.manufacturerId = manufacturerId;\n\t\tthis.label = label;\n\t\tthis.description = description;\n\t\tthis.devices = devices;\n\t\tthis.firmwareVersion = firmwareVersion;\n\t\tthis.preferred = preferred;\n\t\tthis.endpoints = endpoints;\n\t\tthis.associations = associations;\n\t\tthis.scenes = scenes;\n\t\tthis.paramInformation = paramInformation;\n\t\tthis.proprietary = proprietary;\n\t\tthis.compat = compat;\n\t\tthis.metadata = metadata;\n\t}\n\n\tpublic readonly filename: string;\n\t/** Whether this is an embedded configuration or not */\n\tpublic readonly isEmbedded: boolean;\n\tpublic readonly manufacturer: string;\n\tpublic readonly manufacturerId: number;\n\tpublic readonly label: string;\n\tpublic readonly description: string;\n\tpublic readonly devices: readonly {\n\t\tproductType: number;\n\t\tproductId: number;\n\t}[];\n\tpublic readonly firmwareVersion: FirmwareVersionRange;\n\t/** Mark this configuration as preferred over other config files with an overlapping firmware range */\n\tpublic readonly preferred: boolean;\n\tpublic readonly endpoints?: ReadonlyMap<number, EndpointConfig>;\n\tpublic readonly associations?: ReadonlyMap<number, AssociationConfig>;\n\tpublic readonly scenes?: ReadonlyMap<number, SceneConfig>;\n\tpublic readonly paramInformation?: ParamInfoMap;\n\t/**\n\t * Contains manufacturer-specific support information for the\n\t * ManufacturerProprietary CC\n\t */\n\tpublic readonly proprietary?: Record<string, unknown>;\n\t/** Contains compatibility options */\n\tpublic readonly compat?: CompatConfig;\n\t/** Contains instructions and other metadata for the device */\n\tpublic readonly metadata?: DeviceMetadata;\n\n\t/** Returns the association config for a given endpoint */\n\tpublic getAssociationConfigForEndpoint(\n\t\tendpointIndex: number,\n\t\tgroup: number,\n\t): AssociationConfig | undefined {\n\t\tif (endpointIndex === 0) {\n\t\t\t// The root endpoint's associations may be configured separately or as part of \"endpoints\"\n\t\t\treturn (\n\t\t\t\tthis.associations?.get(group)\n\t\t\t\t\t?? this.endpoints?.get(0)?.associations?.get(group)\n\t\t\t);\n\t\t} else {\n\t\t\t// The other endpoints can only have a configuration as part of \"endpoints\"\n\t\t\treturn this.endpoints?.get(endpointIndex)?.associations?.get(group);\n\t\t}\n\t}\n\n\tprivate getHashable(version: 0 | 1 | 2): Record<string, any> {\n\t\t// We only need to compare the information that is persisted elsewhere:\n\t\t// - config parameters\n\t\t// - functional association settings\n\t\t// - CC-related compat flags\n\n\t\tlet hashable: Record<string, any> = {\n\t\t\t// endpoints: {\n\t\t\t// \tassociations: {},\n\t\t\t// \tparamInformation: []\n\t\t\t// },\n\t\t\t// proprietary: {},\n\t\t\t// compat: {},\n\t\t};\n\n\t\tconst sortObject = (obj: Record<string, any>) => {\n\t\t\tconst ret: Record<string, any> = {};\n\t\t\tfor (const key of Object.keys(obj).sort()) {\n\t\t\t\tret[key] = obj[key];\n\t\t\t}\n\t\t\treturn ret;\n\t\t};\n\n\t\tconst cloneAssociationConfig = (a: AssociationConfig) => {\n\t\t\treturn sortObject(\n\t\t\t\tpick(a, [\"maxNodes\", \"multiChannel\", \"isLifeline\"]),\n\t\t\t);\n\t\t};\n\t\tconst cloneAssociationMap = (\n\t\t\ttarget: Record<string, any>,\n\t\t\tmap: ReadonlyMap<number, AssociationConfig> | undefined,\n\t\t) => {\n\t\t\tif (!map || !map.size) return;\n\t\t\ttarget.associations = {};\n\t\t\tfor (const [key, value] of map) {\n\t\t\t\ttarget.associations[key] = cloneAssociationConfig(value);\n\t\t\t}\n\t\t\ttarget.associations = sortObject(target.associations);\n\t\t};\n\n\t\tconst cloneParamInformationMap = (\n\t\t\ttarget: Record<string, any>,\n\t\t\tmap: ParamInfoMap | undefined,\n\t\t) => {\n\t\t\tif (!map || !map.size) return;\n\t\t\tconst getParamKey = (param: ParamInformation) =>\n\t\t\t\t`${param.parameterNumber}${\n\t\t\t\t\tparam.valueBitMask ? `[${num2hex(param.valueBitMask)}]` : \"\"\n\t\t\t\t}`;\n\t\t\ttarget.paramInformation = [...map.values()]\n\t\t\t\t.sort((a, b) => getParamKey(a).localeCompare(getParamKey(b)))\n\t\t\t\t.map((p) => cloneDeep(p));\n\t\t};\n\n\t\t// Clone associations and param information on the root (ep 0) and endpoints\n\t\t{\n\t\t\tlet ep0: Record<string, any> = {};\n\t\t\tcloneAssociationMap(ep0, this.associations);\n\t\t\tcloneParamInformationMap(ep0, this.paramInformation);\n\t\t\tep0 = sortObject(ep0);\n\n\t\t\tif (Object.keys(ep0).length > 0) {\n\t\t\t\thashable.endpoints ??= {};\n\t\t\t\thashable.endpoints[0] = ep0;\n\t\t\t}\n\t\t}\n\n\t\tif (this.endpoints) {\n\t\t\tfor (const [index, endpoint] of this.endpoints) {\n\t\t\t\tlet ep: Record<string, any> = {};\n\n\t\t\t\tcloneAssociationMap(ep, endpoint.associations);\n\t\t\t\tcloneParamInformationMap(ep, endpoint.paramInformation);\n\n\t\t\t\tep = sortObject(ep);\n\n\t\t\t\tif (Object.keys(ep).length > 0) {\n\t\t\t\t\thashable.endpoints ??= {};\n\t\t\t\t\thashable.endpoints[index] = ep;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Clone proprietary config\n\t\tif (this.proprietary && Object.keys(this.proprietary).length > 0) {\n\t\t\thashable.proprietary = sortObject({ ...this.proprietary });\n\t\t}\n\n\t\t// Clone relevant compat flags\n\t\tif (this.compat) {\n\t\t\tlet c: Record<string, any> = {};\n\n\t\t\t// Copy some simple flags over\n\t\t\tfor (\n\t\t\t\tconst prop of [\n\t\t\t\t\t\"forceSceneControllerGroupCount\",\n\t\t\t\t\t\"mapRootReportsToEndpoint\",\n\t\t\t\t\t\"mapBasicSet\",\n\t\t\t\t\t\"preserveRootApplicationCCValueIDs\",\n\t\t\t\t\t\"preserveEndpoints\",\n\t\t\t\t\t\"removeEndpoints\",\n\t\t\t\t\t\"treatMultilevelSwitchSetAsEvent\",\n\t\t\t\t] as const\n\t\t\t) {\n\t\t\t\tif (this.compat[prop] != undefined) {\n\t\t\t\t\tc[prop] = this.compat[prop];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Copy other, more complex flags\n\t\t\tif (this.compat.overrideQueries) {\n\t\t\t\tc.overrideQueries = Object.fromEntries(\n\t\t\t\t\tthis.compat.overrideQueries[\"overrides\"],\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.compat.addCCs) {\n\t\t\t\tc.addCCs = Object.fromEntries(\n\t\t\t\t\t[...this.compat.addCCs].map(([ccId, def]) => [\n\t\t\t\t\t\tccId,\n\t\t\t\t\t\tObject.fromEntries(def.endpoints),\n\t\t\t\t\t]),\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.compat.removeCCs) {\n\t\t\t\tc.removeCCs = Object.fromEntries(this.compat.removeCCs);\n\t\t\t}\n\t\t\tif (this.compat.treatSetAsReport) {\n\t\t\t\tc.treatSetAsReport = [...this.compat.treatSetAsReport].sort();\n\t\t\t}\n\n\t\t\tc = sortObject(c);\n\t\t\tif (Object.keys(c).length > 0) {\n\t\t\t\thashable.compat = c;\n\t\t\t}\n\t\t}\n\n\t\tif (version > 1) {\n\t\t\t// From version 2 and on, we ignore labels and descriptions, and load them dynamically\n\t\t\tfor (\n\t\t\t\tconst ep of Object.values<Record<string, any>>(\n\t\t\t\t\thashable.endpoints ?? {},\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tfor (const param of ep.paramInformation ?? []) {\n\t\t\t\t\tdelete param.label;\n\t\t\t\t\tdelete param.description;\n\t\t\t\t\tfor (const opt of param.options ?? []) {\n\t\t\t\t\t\tdelete opt.label;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\thashable = sortObject(hashable);\n\t\treturn hashable;\n\t}\n\n\t/**\n\t * Returns a hash code that can be used to check whether a device config has changed enough to require a re-interview.\n\t */\n\tpublic async getHash(\n\t\tversion: 0 | 1 | 2 = DeviceConfig.maxHashVersion,\n\t): Promise<Uint8Array> {\n\t\t// Figure out what to hash\n\t\tconst hashable = this.getHashable(version);\n\n\t\t// And create a \"hash\" from it. Older versions used a non-cryptographic hash,\n\t\t// newer versions compress a subset of the config file.\n\t\tlet hash: Uint8Array;\n\t\tif (version === 0) {\n\t\t\tconst buffer = Bytes.from(JSON.stringify(hashable), \"utf8\");\n\t\t\treturn await digest(\"md5\", buffer);\n\t\t} else if (version === 1) {\n\t\t\tconst buffer = Bytes.from(JSON.stringify(hashable), \"utf8\");\n\t\t\treturn await digest(\"sha-256\", buffer);\n\t\t} else {\n\t\t\thash = deflateSync(\n\t\t\t\tBytes.from(JSON.stringify(hashable), \"utf8\"),\n\t\t\t\t// Try to make the hash as small as possible\n\t\t\t\t{ level: 9, dictionary: deflateDict },\n\t\t\t);\n\t\t}\n\n\t\t// Version the hash from v2 onwards, so we can change the format in the future\n\t\tconst prefixBytes = Bytes.from(`$v${version}$`, \"utf8\");\n\t\treturn Bytes.concat([prefixBytes, hash]);\n\t}\n\n\tpublic static get maxHashVersion(): 2 {\n\t\treturn 2;\n\t}\n\n\tpublic static areHashesEqual(hash: Uint8Array, other: Uint8Array): boolean {\n\t\tconst parsedHash = parseHash(hash);\n\t\tconst parsedOther = parseHash(other);\n\t\t// If one of the hashes could not be parsed, they are not equal\n\t\tif (!parsedHash || !parsedOther) return false;\n\n\t\t// For legacy hashes, we only compare the hash data. We already make sure during\n\t\t// parsing of the cache files that we only need to compare hashes of the same version,\n\t\t// so simply comparing the contents is sufficient.\n\t\tif (parsedHash.version < 2 && parsedOther.version < 2) {\n\t\t\treturn Bytes.view(parsedHash.hashData).equals(parsedOther.hashData);\n\t\t}\n\t\t// We take care during loading to downlevel the current config hash to legacy versions if needed.\n\t\t// If we end up with just one legacy hash here, something went wrong. Just bail in that case.\n\t\tif (parsedHash.version < 2 || parsedOther.version < 2) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// This is a versioned hash. If both versions are equal, it's simple - just compare the hash data\n\t\tif (parsedHash.version === parsedOther.version) {\n\t\t\treturn Bytes.view(parsedHash.hashData).equals(parsedOther.hashData);\n\t\t}\n\n\t\t// For different versions, we have to do some case by case checks. For example, a newer hash version\n\t\t// might remove or add data into the hashable, so we cannot simply convert between versions easily.\n\t\t// Implement when that is actually needed.\n\t\treturn false;\n\t}\n}\n\nfunction parseHash(hash: Uint8Array): {\n\tversion: number;\n\thashData: Uint8Array;\n} | undefined {\n\tconst hashString = Bytes.view(hash).toString(\"utf8\");\n\tconst versionMatch = hashString.match(/^\\$v(\\d+)\\$/);\n\tif (versionMatch) {\n\t\t// This is a versioned hash\n\t\tconst version = parseInt(versionMatch[1], 10);\n\t\tconst hashData = hash.subarray(\n\t\t\t// The prefix is ASCII, so this is safe to do even in the context of UTF-8\n\t\t\tversionMatch[0].length,\n\t\t);\n\t\treturn {\n\t\t\tversion,\n\t\t\thashData,\n\t\t};\n\t}\n\n\t// This is probably an unversioned legacy hash\n\tswitch (hash.length) {\n\t\tcase 16: // MD5\n\t\t\treturn {\n\t\t\t\tversion: 0,\n\t\t\t\thashData: hash,\n\t\t\t};\n\t\tcase 32: // SHA-256\n\t\t\treturn {\n\t\t\t\tversion: 1,\n\t\t\t\thashData: hash,\n\t\t\t};\n\t\tdefault:\n\t\t\t// This is not a valid hash\n\t\t\treturn undefined;\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;AAAA,wBAA0B;AAC1B,kBAKO;AACP,oBAcO;AAMP,wBAAkC;AAClC,mBAAkB;AAClB,mBAAiB;AACjB,gBAAqB;AACrB,0BAAyD;AAEzD,wBAAuD;AACvD,+BAGO;AACP,0BAA2D;AAC3D,6BAAgD;AAChD,kCAGO;AACP,4BAGO;AACP,4BAGO;AACP,8BAKO;AACP,yBAAyD;AA0BlD,MAAM,qBAAqB,aAAAA,QAAK,KAAK,6BAAW,SAAS;AAChE,MAAM,oBAAoB,aAAAA,QAAK,KAAK,oBAAoB,qBAAqB;AAEvE,SAAU,gBAAgBC,YAAiB;AAIhD,QAAM,aAAa,aAAAD,QAAK,KAAKC,YAAW,SAAS;AACjD,QAAM,YAAY,aAAAD,QAAK,KAAK,YAAY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ACT,UAAU;;IAEZ,KAAK;AACJ,aAAO;QACN,SAAS;QACT,UAAU;;IAEZ;AAEC,aAAO;EACT;AACD;AAnCS;",
|
|
4
|
+
"sourcesContent": ["import { configDir } from \"#config_dir\";\nimport {\n\tZWaveError,\n\tZWaveErrorCodes,\n\tdeflateSync,\n\tdigest,\n} from \"@zwave-js/core\";\nimport {\n\tBytes,\n\ttype BytesView,\n\ttype JSONObject,\n\tcloneDeep,\n\tenumFilesRecursive,\n\tformatId,\n\tgetenv,\n\tnum2hex,\n\tpadVersion,\n\tpathExists,\n\tpick,\n\treadTextFile,\n\tstringify,\n\twriteTextFile,\n} from \"@zwave-js/shared\";\nimport type {\n\tReadFile,\n\tReadFileSystemInfo,\n\tWriteFile,\n} from \"@zwave-js/shared/bindings\";\nimport { isArray, isObject } from \"alcalzone-shared/typeguards\";\nimport JSON5 from \"json5\";\nimport path from \"pathe\";\nimport semverGt from \"semver/functions/gt.js\";\nimport { clearTemplateCache, readJsonWithTemplate } from \"../JsonTemplate.js\";\nimport type { ConfigLogger } from \"../Logger.js\";\nimport { hexKeyRegex4Digits, throwInvalidConfig } from \"../utils_safe.js\";\nimport {\n\ttype AssociationConfig,\n\tConditionalAssociationConfig,\n} from \"./AssociationConfig.js\";\nimport { type CompatConfig, ConditionalCompatConfig } from \"./CompatConfig.js\";\nimport { evaluateDeep, validateCondition } from \"./ConditionalItem.js\";\nimport {\n\ttype ConditionalPrimitive,\n\tparseConditionalPrimitive,\n} from \"./ConditionalPrimitive.js\";\nimport {\n\tConditionalDeviceMetadata,\n\ttype DeviceMetadata,\n} from \"./DeviceMetadata.js\";\nimport {\n\tConditionalEndpointConfig,\n\ttype EndpointConfig,\n} from \"./EndpointConfig.js\";\nimport {\n\ttype ConditionalParamInfoMap,\n\ttype ParamInfoMap,\n\ttype ParamInformation,\n\tparseConditionalParamInformationMap,\n} from \"./ParamInformation.js\";\nimport { ConditionalSceneConfig, type SceneConfig } from \"./SceneConfig.js\";\nimport type { DeviceID, FirmwareVersionRange } from \"./shared.js\";\n\nexport interface DeviceConfigIndexEntry {\n\tmanufacturerId: string;\n\tproductType: string;\n\tproductId: string;\n\tfirmwareVersion: FirmwareVersionRange;\n\tpreferred?: true;\n\trootDir?: string;\n\tfilename: string;\n}\n\nexport interface FulltextDeviceConfigIndexEntry {\n\tmanufacturerId: string;\n\tmanufacturer: string;\n\tlabel: string;\n\tdescription: string;\n\tproductType: string;\n\tproductId: string;\n\tfirmwareVersion: FirmwareVersionRange;\n\tpreferred?: true;\n\trootDir?: string;\n\tfilename: string;\n}\n\nexport const embeddedDevicesDir = path.join(configDir, \"devices\");\nconst fulltextIndexPath = path.join(embeddedDevicesDir, \"fulltext_index.json\");\n\nexport function getDevicesPaths(configDir: string): {\n\tdevicesDir: string;\n\tindexPath: string;\n} {\n\tconst devicesDir = path.join(configDir, \"devices\");\n\tconst indexPath = path.join(devicesDir, \"index.json\");\n\treturn { devicesDir, indexPath };\n}\n\nexport type DeviceConfigIndex = DeviceConfigIndexEntry[];\nexport type FulltextDeviceConfigIndex = FulltextDeviceConfigIndexEntry[];\n\nasync function hasChangedDeviceFiles(\n\tfs: ReadFileSystemInfo,\n\tdevicesRoot: string,\n\tdir: string,\n\tlastChange: Date,\n): Promise<boolean> {\n\t// Check if there are any files BUT index.json that were changed\n\t// or directories that were modified\n\tconst filesAndDirs = await fs.readDir(dir);\n\tfor (const f of filesAndDirs) {\n\t\tconst fullPath = path.join(dir, f);\n\n\t\tconst stat = await fs.stat(fullPath);\n\t\tif (\n\t\t\t(dir !== devicesRoot || f !== \"index.json\")\n\t\t\t&& (stat.isFile() || stat.isDirectory())\n\t\t\t&& stat.mtime > lastChange\n\t\t) {\n\t\t\treturn true;\n\t\t} else if (stat.isDirectory()) {\n\t\t\t// we need to go deeper!\n\t\t\tif (\n\t\t\t\tawait hasChangedDeviceFiles(\n\t\t\t\t\tfs,\n\t\t\t\t\tdevicesRoot,\n\t\t\t\t\tfullPath,\n\t\t\t\t\tlastChange,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Read all device config files from a given directory and return them as index entries.\n * Does not update the index itself.\n */\nasync function generateIndex<T extends Record<string, unknown>>(\n\tfs: ReadFileSystemInfo & ReadFile,\n\tdevicesDir: string,\n\tisEmbedded: boolean,\n\textractIndexEntries: (config: DeviceConfig) => T[],\n\tlogger?: ConfigLogger,\n): Promise<(T & { filename: string; rootDir?: string })[]> {\n\tconst index: (T & { filename: string; rootDir?: string })[] = [];\n\n\tclearTemplateCache();\n\tconst configFiles = await enumFilesRecursive(\n\t\tfs,\n\t\tdevicesDir,\n\t\t(file) =>\n\t\t\tfile.endsWith(\".json\")\n\t\t\t&& !file.endsWith(\"index.json\")\n\t\t\t&& !file.includes(\"/templates/\")\n\t\t\t&& !file.includes(\"\\\\templates\\\\\"),\n\t);\n\n\t// Add the embedded devices dir as a fallback if necessary\n\tconst fallbackDirs = devicesDir !== embeddedDevicesDir\n\t\t? [embeddedDevicesDir]\n\t\t: undefined;\n\n\tfor (const file of configFiles) {\n\t\tconst relativePath = path\n\t\t\t.relative(devicesDir, file)\n\t\t\t.replaceAll(\"\\\\\", \"/\");\n\t\t// Try parsing the file\n\t\ttry {\n\t\t\tconst config = await DeviceConfig.from(\n\t\t\t\tfs,\n\t\t\t\tfile,\n\t\t\t\tisEmbedded,\n\t\t\t\t{\n\t\t\t\t\trootDir: devicesDir,\n\t\t\t\t\tfallbackDirs,\n\t\t\t\t\trelative: true,\n\t\t\t\t},\n\t\t\t);\n\t\t\t// Add the file to the index\n\t\t\tindex.push(\n\t\t\t\t...extractIndexEntries(config).map((entry) => {\n\t\t\t\t\tconst ret: T & { filename: string; rootDir?: string } = {\n\t\t\t\t\t\t...entry,\n\t\t\t\t\t\tfilename: relativePath,\n\t\t\t\t\t};\n\t\t\t\t\t// Only add the root dir to the index if necessary\n\t\t\t\t\tif (devicesDir !== embeddedDevicesDir) {\n\t\t\t\t\t\tret.rootDir = devicesDir;\n\t\t\t\t\t}\n\t\t\t\t\treturn ret;\n\t\t\t\t}),\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tconst message = `Error parsing config file ${relativePath}: ${\n\t\t\t\t(e as Error).message\n\t\t\t}`;\n\t\t\t// Crash hard during tests, just print an error when in production systems.\n\t\t\t// A user could have changed a config file\n\t\t\tif (process.env.NODE_ENV === \"test\" || !!getenv(\"CI\")) {\n\t\t\t\tthrow new ZWaveError(message, ZWaveErrorCodes.Config_Invalid);\n\t\t\t} else {\n\t\t\t\tlogger?.print(message, \"error\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn index;\n}\n\nasync function loadDeviceIndexShared<T extends Record<string, unknown>>(\n\tfs: ReadFileSystemInfo & ReadFile & WriteFile,\n\tdevicesDir: string,\n\tindexPath: string,\n\textractIndexEntries: (config: DeviceConfig) => T[],\n\tlogger?: ConfigLogger,\n): Promise<(T & { filename: string })[]> {\n\t// The index file needs to be regenerated if it does not exist\n\tlet needsUpdate = !(await pathExists(fs, indexPath));\n\tlet index: (T & { filename: string })[] | undefined;\n\tlet mtimeIndex: Date | undefined;\n\t// ...or if cannot be parsed\n\tif (!needsUpdate) {\n\t\ttry {\n\t\t\tconst fileContents = await readTextFile(fs, indexPath, \"utf8\");\n\t\t\tindex = JSON5.parse(fileContents);\n\t\t\tmtimeIndex = (await fs.stat(indexPath)).mtime;\n\t\t} catch {\n\t\t\tlogger?.print(\n\t\t\t\t\"Error while parsing index file - regenerating...\",\n\t\t\t\t\"warn\",\n\t\t\t);\n\t\t\tneedsUpdate = true;\n\t\t} finally {\n\t\t\tif (!index) {\n\t\t\t\tlogger?.print(\n\t\t\t\t\t\"Index file was malformed - regenerating...\",\n\t\t\t\t\t\"warn\",\n\t\t\t\t);\n\t\t\t\tneedsUpdate = true;\n\t\t\t}\n\t\t}\n\t}\n\n\t// ...or if there were any changes in the file system\n\tif (!needsUpdate) {\n\t\tneedsUpdate = await hasChangedDeviceFiles(\n\t\t\tfs,\n\t\t\tdevicesDir,\n\t\t\tdevicesDir,\n\t\t\tmtimeIndex!,\n\t\t);\n\t\tif (needsUpdate) {\n\t\t\tlogger?.print(\n\t\t\t\t\"Device configuration files on disk changed - regenerating index...\",\n\t\t\t\t\"verbose\",\n\t\t\t);\n\t\t}\n\t}\n\n\tif (needsUpdate) {\n\t\t// Read all files from disk and generate an index\n\t\tindex = await generateIndex(\n\t\t\tfs,\n\t\t\tdevicesDir,\n\t\t\ttrue,\n\t\t\textractIndexEntries,\n\t\t\tlogger,\n\t\t);\n\t\t// Save the index to disk\n\t\ttry {\n\t\t\tawait writeTextFile(\n\t\t\t\tfs,\n\t\t\t\tpath.join(indexPath),\n\t\t\t\t`// This file is auto-generated. DO NOT edit it by hand if you don't know what you're doing!\"\n${stringify(index, \"\\t\")}\n`,\n\t\t\t\t\"utf8\",\n\t\t\t);\n\t\t\tlogger?.print(\"Device index regenerated\", \"verbose\");\n\t\t} catch (e) {\n\t\t\tlogger?.print(\n\t\t\t\t`Writing the device index to disk failed: ${\n\t\t\t\t\t(e as Error).message\n\t\t\t\t}`,\n\t\t\t\t\"error\",\n\t\t\t);\n\t\t}\n\t}\n\n\treturn index!;\n}\n\n/**\n * @internal\n * Loads the index file to quickly access the device configs.\n * Transparently handles updating the index if necessary\n */\nexport async function generatePriorityDeviceIndex(\n\tfs: ReadFileSystemInfo & ReadFile,\n\tdeviceConfigPriorityDir: string,\n\tlogger?: ConfigLogger,\n): Promise<DeviceConfigIndex> {\n\treturn (\n\t\tawait generateIndex(\n\t\t\tfs,\n\t\t\tdeviceConfigPriorityDir,\n\t\t\tfalse,\n\t\t\t(config) =>\n\t\t\t\tconfig.devices.map((dev) => ({\n\t\t\t\t\tmanufacturerId: formatId(\n\t\t\t\t\t\tconfig.manufacturerId.toString(16),\n\t\t\t\t\t),\n\t\t\t\t\tmanufacturer: config.manufacturer,\n\t\t\t\t\tlabel: config.label,\n\t\t\t\t\tproductType: formatId(dev.productType),\n\t\t\t\t\tproductId: formatId(dev.productId),\n\t\t\t\t\tfirmwareVersion: config.firmwareVersion,\n\t\t\t\t\t...(config.preferred ? { preferred: true as const } : {}),\n\t\t\t\t\trootDir: deviceConfigPriorityDir,\n\t\t\t\t})),\n\t\t\tlogger,\n\t\t)\n\t).map(({ filename, ...entry }) => ({\n\t\t...entry,\n\t\t// The generated index makes the filenames relative to the given directory\n\t\t// but we need them to be absolute\n\t\tfilename: path.join(deviceConfigPriorityDir, filename),\n\t}));\n}\n\n/**\n * @internal\n * Loads the index file to quickly access the device configs.\n * Transparently handles updating the index if necessary\n */\nexport async function loadDeviceIndexInternal(\n\tfs: ReadFileSystemInfo & ReadFile & WriteFile,\n\tlogger?: ConfigLogger,\n\texternalConfigDir?: string,\n): Promise<DeviceConfigIndex> {\n\tconst { devicesDir, indexPath } = getDevicesPaths(\n\t\texternalConfigDir || configDir,\n\t);\n\n\treturn loadDeviceIndexShared(\n\t\tfs,\n\t\tdevicesDir,\n\t\tindexPath,\n\t\t(config) =>\n\t\t\tconfig.devices.map((dev) => ({\n\t\t\t\tmanufacturerId: formatId(config.manufacturerId.toString(16)),\n\t\t\t\tmanufacturer: config.manufacturer,\n\t\t\t\tlabel: config.label,\n\t\t\t\tproductType: formatId(dev.productType),\n\t\t\t\tproductId: formatId(dev.productId),\n\t\t\t\tfirmwareVersion: config.firmwareVersion,\n\t\t\t\t...(config.preferred ? { preferred: true as const } : {}),\n\t\t\t})),\n\t\tlogger,\n\t);\n}\n\n/**\n * @internal\n * Loads the full text index file to quickly search the device configs.\n * Transparently handles updating the index if necessary\n */\nexport async function loadFulltextDeviceIndexInternal(\n\tfs: ReadFileSystemInfo & ReadFile & WriteFile,\n\tlogger?: ConfigLogger,\n): Promise<FulltextDeviceConfigIndex> {\n\t// This method is not meant to operate with the external device index!\n\treturn loadDeviceIndexShared(\n\t\tfs,\n\t\tembeddedDevicesDir,\n\t\tfulltextIndexPath,\n\t\t(config) =>\n\t\t\tconfig.devices.map((dev) => ({\n\t\t\t\tmanufacturerId: formatId(config.manufacturerId.toString(16)),\n\t\t\t\tmanufacturer: config.manufacturer,\n\t\t\t\tlabel: config.label,\n\t\t\t\tdescription: config.description,\n\t\t\t\tproductType: formatId(dev.productType),\n\t\t\t\tproductId: formatId(dev.productId),\n\t\t\t\tfirmwareVersion: config.firmwareVersion,\n\t\t\t\t...(config.preferred ? { preferred: true as const } : {}),\n\t\t\t\trootDir: embeddedDevicesDir,\n\t\t\t})),\n\t\tlogger,\n\t);\n}\n\nfunction isHexKeyWith4Digits(val: any): val is string {\n\treturn typeof val === \"string\" && hexKeyRegex4Digits.test(val);\n}\n\nconst firmwareVersionRegex = /^\\d{1,3}\\.\\d{1,3}(\\.\\d{1,3})?$/;\nfunction isFirmwareVersion(val: any): val is string {\n\treturn (\n\t\ttypeof val === \"string\"\n\t\t&& firmwareVersionRegex.test(val)\n\t\t&& val\n\t\t\t.split(\".\")\n\t\t\t.map((str) => parseInt(str, 10))\n\t\t\t.every((num) => num >= 0 && num <= 255)\n\t);\n}\n\nconst deflateDict = Bytes.from(\n\t// Substrings appearing in the device config files in descending order of frequency\n\t// except for very short ones like 0, 1, ...\n\t// WARNING: THIS MUST NOT BE CHANGED! Doing so breaks decompressing stored hashes.\n\t[\n\t\t`\"parameterNumber\":`,\n\t\t`255`,\n\t\t`\"value\":`,\n\t\t`\"defaultValue\":`,\n\t\t`\"valueSize\":`,\n\t\t`\"maxValue\":`,\n\t\t`\"minValue\":`,\n\t\t`\"options\":`,\n\t\t`true`,\n\t\t`false`,\n\t\t`\"allowManualEntry\":`,\n\t\t`\"maxNodes\":`,\n\t\t`100`,\n\t\t`\"unsigned\":`,\n\t\t`\"paramInformation\":`,\n\t\t`\"isLifeline\":`,\n\t\t`\"seconds\"`,\n\t\t`99`,\n\t\t`127`,\n\t\t`\"%\"`,\n\t\t`65535`,\n\t\t`32767`,\n\t\t`\"minutes\"`,\n\t\t`\"endpoints\":`,\n\t\t`\"hours\"`,\n\t\t`\"multiChannel\":`,\n\t]\n\t\t.join(\"\"),\n\t\"utf8\",\n);\n\n/** This class represents a device config entry whose conditional settings have not been evaluated yet */\nexport class ConditionalDeviceConfig {\n\tpublic static async from(\n\t\tfs: ReadFileSystemInfo & ReadFile,\n\t\tfilename: string,\n\t\tisEmbedded: boolean,\n\t\toptions: {\n\t\t\trootDir: string;\n\t\t\tfallbackDirs?: string[];\n\t\t\trelative?: boolean;\n\t\t},\n\t): Promise<ConditionalDeviceConfig> {\n\t\tconst { relative, rootDir } = options;\n\n\t\tconst relativePath = relative\n\t\t\t? path.relative(rootDir, filename).replaceAll(\"\\\\\", \"/\")\n\t\t\t: filename;\n\t\tconst json = await readJsonWithTemplate(\n\t\t\tfs,\n\t\t\tfilename,\n\t\t\t[\n\t\t\t\toptions.rootDir,\n\t\t\t\t...(options.fallbackDirs ?? []),\n\t\t\t],\n\t\t);\n\t\treturn new ConditionalDeviceConfig(relativePath, isEmbedded, json);\n\t}\n\n\tpublic constructor(\n\t\tfilename: string,\n\t\tisEmbedded: boolean,\n\t\tdefinition: JSONObject,\n\t) {\n\t\tthis.filename = filename;\n\t\tthis.isEmbedded = isEmbedded;\n\n\t\tif (!isHexKeyWith4Digits(definition.manufacturerId)) {\n\t\t\tthrowInvalidConfig(\n\t\t\t\t`device`,\n\t\t\t\t`packages/config/config/devices/${filename}:\nmanufacturer id must be a lowercase hexadecimal number with 4 digits`,\n\t\t\t);\n\t\t}\n\t\tthis.manufacturerId = parseInt(definition.manufacturerId, 16);\n\n\t\tfor (const prop of [\"manufacturer\", \"label\", \"description\"] as const) {\n\t\t\tthis[prop] = parseConditionalPrimitive(\n\t\t\t\tfilename,\n\t\t\t\t\"string\",\n\t\t\t\tprop,\n\t\t\t\tdefinition[prop],\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\t!isArray(definition.devices)\n\t\t\t|| !(definition.devices as any[]).every(\n\t\t\t\t(dev: unknown) =>\n\t\t\t\t\tisObject(dev)\n\t\t\t\t\t&& isHexKeyWith4Digits(dev.productType)\n\t\t\t\t\t&& isHexKeyWith4Digits(dev.productId),\n\t\t\t)\n\t\t) {\n\t\t\tthrowInvalidConfig(\n\t\t\t\t`device`,\n\t\t\t\t`packages/config/config/devices/${filename}:\ndevices is malformed (not an object or type/id that is not a lowercase 4-digit hex key)`,\n\t\t\t);\n\t\t}\n\t\tthis.devices = (definition.devices as any[]).map(\n\t\t\t({ productType, productId }) => ({\n\t\t\t\tproductType: parseInt(productType, 16),\n\t\t\t\tproductId: parseInt(productId, 16),\n\t\t\t}),\n\t\t);\n\n\t\tif (\n\t\t\t!isObject(definition.firmwareVersion)\n\t\t\t|| !isFirmwareVersion(definition.firmwareVersion.min)\n\t\t\t|| !isFirmwareVersion(definition.firmwareVersion.max)\n\t\t) {\n\t\t\tthrowInvalidConfig(\n\t\t\t\t`device`,\n\t\t\t\t`packages/config/config/devices/${filename}:\nfirmwareVersion is malformed or invalid. Must be x.y or x.y.z where x, y, and z are integers between 0 and 255`,\n\t\t\t);\n\t\t} else {\n\t\t\tconst { min, max } = definition.firmwareVersion;\n\t\t\tif (semverGt(padVersion(min), padVersion(max))) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nfirmwareVersion.min ${min} must not be greater than firmwareVersion.max ${max}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.firmwareVersion = { min, max };\n\t\t}\n\n\t\tif (\n\t\t\tdefinition.preferred != undefined\n\t\t\t&& definition.preferred !== true\n\t\t) {\n\t\t\tthrowInvalidConfig(\n\t\t\t\t`device`,\n\t\t\t\t`packages/config/config/devices/${filename}:\npreferred must be true or omitted`,\n\t\t\t);\n\t\t}\n\t\tthis.preferred = !!definition.preferred;\n\n\t\tif (definition.endpoints != undefined) {\n\t\t\tconst endpoints = new Map<number, ConditionalEndpointConfig>();\n\t\t\tif (!isObject(definition.endpoints)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nendpoints is not an object`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tfor (const [key, ep] of Object.entries(definition.endpoints)) {\n\t\t\t\tif (!/^\\d+$/.test(key)) {\n\t\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t\t`device`,\n\t\t\t\t\t\t`packages/config/config/devices/${filename}:\nfound non-numeric endpoint index \"${key}\" in endpoints`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst epIndex = parseInt(key, 10);\n\t\t\t\tendpoints.set(\n\t\t\t\t\tepIndex,\n\t\t\t\t\tnew ConditionalEndpointConfig(this, epIndex, ep as any),\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.endpoints = endpoints;\n\t\t}\n\n\t\tif (definition.associations != undefined) {\n\t\t\tconst associations = new Map<\n\t\t\t\tnumber,\n\t\t\t\tConditionalAssociationConfig\n\t\t\t>();\n\t\t\tif (!isObject(definition.associations)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nassociations is not an object`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tfor (\n\t\t\t\tconst [key, assocDefinition] of Object.entries(\n\t\t\t\t\tdefinition.associations,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tif (!/^[1-9][0-9]*$/.test(key)) {\n\t\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t\t`device`,\n\t\t\t\t\t\t`packages/config/config/devices/${filename}:\nfound non-numeric group id \"${key}\" in associations`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst keyNum = parseInt(key, 10);\n\t\t\t\tassociations.set(\n\t\t\t\t\tkeyNum,\n\t\t\t\t\tnew ConditionalAssociationConfig(\n\t\t\t\t\t\tfilename,\n\t\t\t\t\t\tkeyNum,\n\t\t\t\t\t\tassocDefinition as any,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.associations = associations;\n\t\t}\n\n\t\tif (definition.paramInformation != undefined) {\n\t\t\tthis.paramInformation = parseConditionalParamInformationMap(\n\t\t\t\tdefinition,\n\t\t\t\tthis,\n\t\t\t);\n\t\t}\n\n\t\tif (definition.proprietary != undefined) {\n\t\t\tif (!isObject(definition.proprietary)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nproprietary is not an object`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.proprietary = definition.proprietary;\n\t\t}\n\n\t\tif (definition.compat != undefined) {\n\t\t\tif (\n\t\t\t\tisArray(definition.compat)\n\t\t\t\t&& definition.compat.every((item: any) => isObject(item))\n\t\t\t) {\n\t\t\t\t// Make sure all conditions are valid\n\t\t\t\tfor (const entry of definition.compat) {\n\t\t\t\t\tvalidateCondition(\n\t\t\t\t\t\tfilename,\n\t\t\t\t\t\tentry,\n\t\t\t\t\t\t`At least one entry of compat contains an`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tthis.compat = definition.compat.map(\n\t\t\t\t\t(item: any) => new ConditionalCompatConfig(filename, item),\n\t\t\t\t);\n\t\t\t} else if (isObject(definition.compat)) {\n\t\t\t\tthis.compat = new ConditionalCompatConfig(\n\t\t\t\t\tfilename,\n\t\t\t\t\tdefinition.compat,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\ncompat must be an object or any array of conditional objects`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (definition.metadata != undefined) {\n\t\t\tif (!isObject(definition.metadata)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nmetadata is not an object`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.metadata = new ConditionalDeviceMetadata(\n\t\t\t\tfilename,\n\t\t\t\tdefinition.metadata,\n\t\t\t);\n\t\t}\n\n\t\tif (definition.scenes != undefined) {\n\t\t\tconst scenes = new Map<\n\t\t\t\tnumber,\n\t\t\t\tConditionalSceneConfig\n\t\t\t>();\n\t\t\tif (!isObject(definition.scenes)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nscenes is not an object`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tfor (\n\t\t\t\tconst [key, sceneDefinition] of Object.entries(\n\t\t\t\t\tdefinition.scenes,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tif (!/^[1-9][0-9]*$/.test(key)) {\n\t\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t\t`device`,\n\t\t\t\t\t\t`packages/config/config/devices/${filename}:\ninvalid scene id \"${key}\" in scenes - must be a positive integer (1-255)`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst keyNum = parseInt(key, 10);\n\t\t\t\tif (keyNum < 1 || keyNum > 255) {\n\t\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t\t`device`,\n\t\t\t\t\t\t`packages/config/config/devices/${filename}:\nscene number ${keyNum} must be between 1 and 255`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tscenes.set(\n\t\t\t\t\tkeyNum,\n\t\t\t\t\tnew ConditionalSceneConfig(\n\t\t\t\t\t\tfilename,\n\t\t\t\t\t\tkeyNum,\n\t\t\t\t\t\tsceneDefinition as any,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.scenes = scenes;\n\t\t}\n\t}\n\n\tpublic readonly filename: string;\n\n\tpublic readonly manufacturer!: ConditionalPrimitive<string>;\n\tpublic readonly manufacturerId: number;\n\tpublic readonly label!: ConditionalPrimitive<string>;\n\tpublic readonly description!: ConditionalPrimitive<string>;\n\tpublic readonly devices: readonly {\n\t\tproductType: number;\n\t\tproductId: number;\n\t}[];\n\tpublic readonly firmwareVersion: FirmwareVersionRange;\n\t/** Mark this configuration as preferred over other config files with an overlapping firmware range */\n\tpublic readonly preferred: boolean;\n\tpublic readonly endpoints?: ReadonlyMap<number, ConditionalEndpointConfig>;\n\tpublic readonly associations?: ReadonlyMap<\n\t\tnumber,\n\t\tConditionalAssociationConfig\n\t>;\n\tpublic readonly scenes?: ReadonlyMap<number, ConditionalSceneConfig>;\n\tpublic readonly paramInformation?: ConditionalParamInfoMap;\n\t/**\n\t * Contains manufacturer-specific support information for the\n\t * ManufacturerProprietary CC\n\t */\n\tpublic readonly proprietary?: Record<string, unknown>;\n\t/** Contains compatibility options */\n\tpublic readonly compat?:\n\t\t| ConditionalCompatConfig\n\t\t| ConditionalCompatConfig[];\n\t/** Contains instructions and other metadata for the device */\n\tpublic readonly metadata?: ConditionalDeviceMetadata;\n\n\t/** Whether this is an embedded configuration or not */\n\tpublic readonly isEmbedded: boolean;\n\n\tpublic evaluate(deviceId?: DeviceID): DeviceConfig {\n\t\treturn new DeviceConfig(\n\t\t\tthis.filename,\n\t\t\tthis.isEmbedded,\n\t\t\tevaluateDeep(this.manufacturer, deviceId),\n\t\t\tthis.manufacturerId,\n\t\t\tevaluateDeep(this.label, deviceId),\n\t\t\tevaluateDeep(this.description, deviceId),\n\t\t\tthis.devices,\n\t\t\tthis.firmwareVersion,\n\t\t\tthis.preferred,\n\t\t\tevaluateDeep(this.endpoints, deviceId),\n\t\t\tevaluateDeep(this.associations, deviceId),\n\t\t\tevaluateDeep(this.scenes, deviceId),\n\t\t\tevaluateDeep(this.paramInformation, deviceId),\n\t\t\tthis.proprietary,\n\t\t\tevaluateDeep(this.compat, deviceId),\n\t\t\tevaluateDeep(this.metadata, deviceId),\n\t\t);\n\t}\n}\n\nexport class DeviceConfig {\n\tpublic static async from(\n\t\tfs: ReadFileSystemInfo & ReadFile,\n\t\tfilename: string,\n\t\tisEmbedded: boolean,\n\t\toptions: {\n\t\t\trootDir: string;\n\t\t\tfallbackDirs?: string[];\n\t\t\trelative?: boolean;\n\t\t\tdeviceId?: DeviceID;\n\t\t},\n\t): Promise<DeviceConfig> {\n\t\tconst ret = await ConditionalDeviceConfig.from(\n\t\t\tfs,\n\t\t\tfilename,\n\t\t\tisEmbedded,\n\t\t\toptions,\n\t\t);\n\t\treturn ret.evaluate(options.deviceId);\n\t}\n\n\tpublic constructor(\n\t\tfilename: string,\n\t\tisEmbedded: boolean,\n\t\tmanufacturer: string,\n\t\tmanufacturerId: number,\n\t\tlabel: string,\n\t\tdescription: string,\n\t\tdevices: readonly {\n\t\t\tproductType: number;\n\t\t\tproductId: number;\n\t\t}[],\n\t\tfirmwareVersion: FirmwareVersionRange,\n\t\tpreferred: boolean,\n\t\tendpoints?: ReadonlyMap<number, EndpointConfig>,\n\t\tassociations?: ReadonlyMap<number, AssociationConfig>,\n\t\tscenes?: ReadonlyMap<number, SceneConfig>,\n\t\tparamInformation?: ParamInfoMap,\n\t\tproprietary?: Record<string, unknown>,\n\t\tcompat?: CompatConfig,\n\t\tmetadata?: DeviceMetadata,\n\t) {\n\t\tthis.filename = filename;\n\t\tthis.isEmbedded = isEmbedded;\n\t\tthis.manufacturer = manufacturer;\n\t\tthis.manufacturerId = manufacturerId;\n\t\tthis.label = label;\n\t\tthis.description = description;\n\t\tthis.devices = devices;\n\t\tthis.firmwareVersion = firmwareVersion;\n\t\tthis.preferred = preferred;\n\t\tthis.endpoints = endpoints;\n\t\tthis.associations = associations;\n\t\tthis.scenes = scenes;\n\t\tthis.paramInformation = paramInformation;\n\t\tthis.proprietary = proprietary;\n\t\tthis.compat = compat;\n\t\tthis.metadata = metadata;\n\t}\n\n\tpublic readonly filename: string;\n\t/** Whether this is an embedded configuration or not */\n\tpublic readonly isEmbedded: boolean;\n\tpublic readonly manufacturer: string;\n\tpublic readonly manufacturerId: number;\n\tpublic readonly label: string;\n\tpublic readonly description: string;\n\tpublic readonly devices: readonly {\n\t\tproductType: number;\n\t\tproductId: number;\n\t}[];\n\tpublic readonly firmwareVersion: FirmwareVersionRange;\n\t/** Mark this configuration as preferred over other config files with an overlapping firmware range */\n\tpublic readonly preferred: boolean;\n\tpublic readonly endpoints?: ReadonlyMap<number, EndpointConfig>;\n\tpublic readonly associations?: ReadonlyMap<number, AssociationConfig>;\n\tpublic readonly scenes?: ReadonlyMap<number, SceneConfig>;\n\tpublic readonly paramInformation?: ParamInfoMap;\n\t/**\n\t * Contains manufacturer-specific support information for the\n\t * ManufacturerProprietary CC\n\t */\n\tpublic readonly proprietary?: Record<string, unknown>;\n\t/** Contains compatibility options */\n\tpublic readonly compat?: CompatConfig;\n\t/** Contains instructions and other metadata for the device */\n\tpublic readonly metadata?: DeviceMetadata;\n\n\t/** Returns the association config for a given endpoint */\n\tpublic getAssociationConfigForEndpoint(\n\t\tendpointIndex: number,\n\t\tgroup: number,\n\t): AssociationConfig | undefined {\n\t\tif (endpointIndex === 0) {\n\t\t\t// The root endpoint's associations may be configured separately or as part of \"endpoints\"\n\t\t\treturn (\n\t\t\t\tthis.associations?.get(group)\n\t\t\t\t\t?? this.endpoints?.get(0)?.associations?.get(group)\n\t\t\t);\n\t\t} else {\n\t\t\t// The other endpoints can only have a configuration as part of \"endpoints\"\n\t\t\treturn this.endpoints?.get(endpointIndex)?.associations?.get(group);\n\t\t}\n\t}\n\n\tprivate getHashable(version: 0 | 1 | 2): Record<string, any> {\n\t\t// We only need to compare the information that is persisted elsewhere:\n\t\t// - config parameters\n\t\t// - functional association settings\n\t\t// - CC-related compat flags\n\n\t\tlet hashable: Record<string, any> = {\n\t\t\t// endpoints: {\n\t\t\t// \tassociations: {},\n\t\t\t// \tparamInformation: []\n\t\t\t// },\n\t\t\t// proprietary: {},\n\t\t\t// compat: {},\n\t\t};\n\n\t\tconst sortObject = (obj: Record<string, any>) => {\n\t\t\tconst ret: Record<string, any> = {};\n\t\t\tfor (const key of Object.keys(obj).sort()) {\n\t\t\t\tret[key] = obj[key];\n\t\t\t}\n\t\t\treturn ret;\n\t\t};\n\n\t\tconst cloneAssociationConfig = (a: AssociationConfig) => {\n\t\t\treturn sortObject(\n\t\t\t\tpick(a, [\"maxNodes\", \"multiChannel\", \"isLifeline\"]),\n\t\t\t);\n\t\t};\n\t\tconst cloneAssociationMap = (\n\t\t\ttarget: Record<string, any>,\n\t\t\tmap: ReadonlyMap<number, AssociationConfig> | undefined,\n\t\t) => {\n\t\t\tif (!map || !map.size) return;\n\t\t\ttarget.associations = {};\n\t\t\tfor (const [key, value] of map) {\n\t\t\t\ttarget.associations[key] = cloneAssociationConfig(value);\n\t\t\t}\n\t\t\ttarget.associations = sortObject(target.associations);\n\t\t};\n\n\t\tconst cloneParamInformationMap = (\n\t\t\ttarget: Record<string, any>,\n\t\t\tmap: ParamInfoMap | undefined,\n\t\t) => {\n\t\t\tif (!map || !map.size) return;\n\t\t\tconst getParamKey = (param: ParamInformation) =>\n\t\t\t\t`${param.parameterNumber}${\n\t\t\t\t\tparam.valueBitMask ? `[${num2hex(param.valueBitMask)}]` : \"\"\n\t\t\t\t}`;\n\t\t\ttarget.paramInformation = [...map.values()]\n\t\t\t\t.sort((a, b) => getParamKey(a).localeCompare(getParamKey(b)))\n\t\t\t\t.map((p) => cloneDeep(p));\n\t\t};\n\n\t\t// Clone associations and param information on the root (ep 0) and endpoints\n\t\t{\n\t\t\tlet ep0: Record<string, any> = {};\n\t\t\tcloneAssociationMap(ep0, this.associations);\n\t\t\tcloneParamInformationMap(ep0, this.paramInformation);\n\t\t\tep0 = sortObject(ep0);\n\n\t\t\tif (Object.keys(ep0).length > 0) {\n\t\t\t\thashable.endpoints ??= {};\n\t\t\t\thashable.endpoints[0] = ep0;\n\t\t\t}\n\t\t}\n\n\t\tif (this.endpoints) {\n\t\t\tfor (const [index, endpoint] of this.endpoints) {\n\t\t\t\tlet ep: Record<string, any> = {};\n\n\t\t\t\tcloneAssociationMap(ep, endpoint.associations);\n\t\t\t\tcloneParamInformationMap(ep, endpoint.paramInformation);\n\n\t\t\t\tep = sortObject(ep);\n\n\t\t\t\tif (Object.keys(ep).length > 0) {\n\t\t\t\t\thashable.endpoints ??= {};\n\t\t\t\t\thashable.endpoints[index] = ep;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Clone proprietary config\n\t\tif (this.proprietary && Object.keys(this.proprietary).length > 0) {\n\t\t\thashable.proprietary = sortObject({ ...this.proprietary });\n\t\t}\n\n\t\t// Clone relevant compat flags\n\t\tif (this.compat) {\n\t\t\tlet c: Record<string, any> = {};\n\n\t\t\t// Copy some simple flags over\n\t\t\tfor (\n\t\t\t\tconst prop of [\n\t\t\t\t\t\"forceSceneControllerGroupCount\",\n\t\t\t\t\t\"mapRootReportsToEndpoint\",\n\t\t\t\t\t\"mapBasicSet\",\n\t\t\t\t\t\"preserveRootApplicationCCValueIDs\",\n\t\t\t\t\t\"preserveEndpoints\",\n\t\t\t\t\t\"removeEndpoints\",\n\t\t\t\t\t\"treatMultilevelSwitchSetAsEvent\",\n\t\t\t\t] as const\n\t\t\t) {\n\t\t\t\tif (this.compat[prop] != undefined) {\n\t\t\t\t\tc[prop] = this.compat[prop];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Copy other, more complex flags\n\t\t\tif (this.compat.overrideQueries) {\n\t\t\t\tc.overrideQueries = Object.fromEntries(\n\t\t\t\t\tthis.compat.overrideQueries[\"overrides\"],\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.compat.addCCs) {\n\t\t\t\tc.addCCs = Object.fromEntries(\n\t\t\t\t\t[...this.compat.addCCs].map(([ccId, def]) => [\n\t\t\t\t\t\tccId,\n\t\t\t\t\t\tObject.fromEntries(def.endpoints),\n\t\t\t\t\t]),\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.compat.removeCCs) {\n\t\t\t\tc.removeCCs = Object.fromEntries(this.compat.removeCCs);\n\t\t\t}\n\t\t\tif (this.compat.treatSetAsReport) {\n\t\t\t\tc.treatSetAsReport = [...this.compat.treatSetAsReport].sort();\n\t\t\t}\n\n\t\t\tc = sortObject(c);\n\t\t\tif (Object.keys(c).length > 0) {\n\t\t\t\thashable.compat = c;\n\t\t\t}\n\t\t}\n\n\t\tif (version > 1) {\n\t\t\t// From version 2 and on, we ignore labels and descriptions, and load them dynamically\n\t\t\tfor (\n\t\t\t\tconst ep of Object.values<Record<string, any>>(\n\t\t\t\t\thashable.endpoints ?? {},\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tfor (const param of ep.paramInformation ?? []) {\n\t\t\t\t\tdelete param.label;\n\t\t\t\t\tdelete param.description;\n\t\t\t\t\tfor (const opt of param.options ?? []) {\n\t\t\t\t\t\tdelete opt.label;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\thashable = sortObject(hashable);\n\t\treturn hashable;\n\t}\n\n\t/**\n\t * Returns a hash code that can be used to check whether a device config has changed enough to require a re-interview.\n\t */\n\tpublic async getHash(\n\t\tversion: 0 | 1 | 2 = DeviceConfig.maxHashVersion,\n\t): Promise<BytesView> {\n\t\t// Figure out what to hash\n\t\tconst hashable = this.getHashable(version);\n\n\t\t// And create a \"hash\" from it. Older versions used a non-cryptographic hash,\n\t\t// newer versions compress a subset of the config file.\n\t\tlet hash: BytesView;\n\t\tif (version === 0) {\n\t\t\tconst buffer = Bytes.from(JSON.stringify(hashable), \"utf8\");\n\t\t\treturn await digest(\"md5\", buffer);\n\t\t} else if (version === 1) {\n\t\t\tconst buffer = Bytes.from(JSON.stringify(hashable), \"utf8\");\n\t\t\treturn await digest(\"sha-256\", buffer);\n\t\t} else {\n\t\t\thash = deflateSync(\n\t\t\t\tBytes.from(JSON.stringify(hashable), \"utf8\"),\n\t\t\t\t// Try to make the hash as small as possible\n\t\t\t\t{ level: 9, dictionary: deflateDict },\n\t\t\t);\n\t\t}\n\n\t\t// Version the hash from v2 onwards, so we can change the format in the future\n\t\tconst prefixBytes = Bytes.from(`$v${version}$`, \"utf8\");\n\t\treturn Bytes.concat([prefixBytes, hash]);\n\t}\n\n\tpublic static get maxHashVersion(): 2 {\n\t\treturn 2;\n\t}\n\n\tpublic static areHashesEqual(hash: BytesView, other: BytesView): boolean {\n\t\tconst parsedHash = parseHash(hash);\n\t\tconst parsedOther = parseHash(other);\n\t\t// If one of the hashes could not be parsed, they are not equal\n\t\tif (!parsedHash || !parsedOther) return false;\n\n\t\t// For legacy hashes, we only compare the hash data. We already make sure during\n\t\t// parsing of the cache files that we only need to compare hashes of the same version,\n\t\t// so simply comparing the contents is sufficient.\n\t\tif (parsedHash.version < 2 && parsedOther.version < 2) {\n\t\t\treturn Bytes.view(parsedHash.hashData).equals(parsedOther.hashData);\n\t\t}\n\t\t// We take care during loading to downlevel the current config hash to legacy versions if needed.\n\t\t// If we end up with just one legacy hash here, something went wrong. Just bail in that case.\n\t\tif (parsedHash.version < 2 || parsedOther.version < 2) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// This is a versioned hash. If both versions are equal, it's simple - just compare the hash data\n\t\tif (parsedHash.version === parsedOther.version) {\n\t\t\treturn Bytes.view(parsedHash.hashData).equals(parsedOther.hashData);\n\t\t}\n\n\t\t// For different versions, we have to do some case by case checks. For example, a newer hash version\n\t\t// might remove or add data into the hashable, so we cannot simply convert between versions easily.\n\t\t// Implement when that is actually needed.\n\t\treturn false;\n\t}\n}\n\nfunction parseHash(hash: BytesView): {\n\tversion: number;\n\thashData: BytesView;\n} | undefined {\n\tconst hashString = Bytes.view(hash).toString(\"utf8\");\n\tconst versionMatch = hashString.match(/^\\$v(\\d+)\\$/);\n\tif (versionMatch) {\n\t\t// This is a versioned hash\n\t\tconst version = parseInt(versionMatch[1], 10);\n\t\tconst hashData = hash.subarray(\n\t\t\t// The prefix is ASCII, so this is safe to do even in the context of UTF-8\n\t\t\tversionMatch[0].length,\n\t\t);\n\t\treturn {\n\t\t\tversion,\n\t\t\thashData,\n\t\t};\n\t}\n\n\t// This is probably an unversioned legacy hash\n\tswitch (hash.length) {\n\t\tcase 16: // MD5\n\t\t\treturn {\n\t\t\t\tversion: 0,\n\t\t\t\thashData: hash,\n\t\t\t};\n\t\tcase 32: // SHA-256\n\t\t\treturn {\n\t\t\t\tversion: 1,\n\t\t\t\thashData: hash,\n\t\t\t};\n\t\tdefault:\n\t\t\t// This is not a valid hash\n\t\t\treturn undefined;\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;AAAA,wBAA0B;AAC1B,kBAKO;AACP,oBAeO;AAMP,wBAAkC;AAClC,mBAAkB;AAClB,mBAAiB;AACjB,gBAAqB;AACrB,0BAAyD;AAEzD,wBAAuD;AACvD,+BAGO;AACP,0BAA2D;AAC3D,6BAAgD;AAChD,kCAGO;AACP,4BAGO;AACP,4BAGO;AACP,8BAKO;AACP,yBAAyD;AA0BlD,MAAM,qBAAqB,aAAAA,QAAK,KAAK,6BAAW,SAAS;AAChE,MAAM,oBAAoB,aAAAA,QAAK,KAAK,oBAAoB,qBAAqB;AAEvE,SAAU,gBAAgBC,YAAiB;AAIhD,QAAM,aAAa,aAAAD,QAAK,KAAKC,YAAW,SAAS;AACjD,QAAM,YAAY,aAAAD,QAAK,KAAK,YAAY,YAAY;AACpD,SAAO,EAAE,YAAY,UAAS;AAC/B;AAPgB;AAYhB,eAAe,sBACd,IACA,aACA,KACA,YAAgB;AAIhB,QAAM,eAAe,MAAM,GAAG,QAAQ,GAAG;AACzC,aAAW,KAAK,cAAc;AAC7B,UAAM,WAAW,aAAAA,QAAK,KAAK,KAAK,CAAC;AAEjC,UAAM,OAAO,MAAM,GAAG,KAAK,QAAQ;AACnC,SACE,QAAQ,eAAe,MAAM,kBAC1B,KAAK,OAAM,KAAM,KAAK,YAAW,MAClC,KAAK,QAAQ,YACf;AACD,aAAO;IACR,WAAW,KAAK,YAAW,GAAI;AAE9B,UACC,MAAM,sBACL,IACA,aACA,UACA,UAAU,GAEV;AACD,eAAO;MACR;IACD;EACD;AACA,SAAO;AACR;AAlCe;AAwCf,eAAe,cACd,IACA,YACA,YACA,qBACA,QAAqB;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,UAAU,KAAK;AAEnC,QAAI,CAAC,cAAc,CAAC;AAAa,aAAO;AAKxC,QAAI,WAAW,UAAU,KAAK,YAAY,UAAU,GAAG;AACtD,aAAO,oBAAM,KAAK,WAAW,QAAQ,EAAE,OAAO,YAAY,QAAQ;IACnE;AAGA,QAAI,WAAW,UAAU,KAAK,YAAY,UAAU,GAAG;AACtD,aAAO;IACR;AAGA,QAAI,WAAW,YAAY,YAAY,SAAS;AAC/C,aAAO,oBAAM,KAAK,WAAW,QAAQ,EAAE,OAAO,YAAY,QAAQ;IACnE;AAKA,WAAO;EACR;;AAGD,SAAS,UAAU,MAAe;AAIjC,QAAM,aAAa,oBAAM,KAAK,IAAI,EAAE,SAAS,MAAM;AACnD,QAAM,eAAe,WAAW,MAAM,aAAa;AACnD,MAAI,cAAc;AAEjB,UAAM,UAAU,SAAS,aAAa,CAAC,GAAG,EAAE;AAC5C,UAAM,WAAW,KAAK;;MAErB,aAAa,CAAC,EAAE;IAAM;AAEvB,WAAO;MACN;MACA;;EAEF;AAGA,UAAQ,KAAK,QAAQ;IACpB,KAAK;AACJ,aAAO;QACN,SAAS;QACT,UAAU;;IAEZ,KAAK;AACJ,aAAO;QACN,SAAS;QACT,UAAU;;IAEZ;AAEC,aAAO;EACT;AACD;AAnCS;",
|
|
6
6
|
"names": ["path", "configDir", "JSON5", "semverGt"]
|
|
7
7
|
}
|
|
@@ -14,10 +14,12 @@ export declare class ConditionalParamInformation implements ConditionalItem<Para
|
|
|
14
14
|
readonly maxValue?: number;
|
|
15
15
|
readonly unsigned?: boolean;
|
|
16
16
|
readonly defaultValue: number;
|
|
17
|
+
readonly recommendedValue?: number;
|
|
17
18
|
readonly unit?: string;
|
|
18
19
|
readonly readOnly?: true;
|
|
19
20
|
readonly writeOnly?: true;
|
|
20
21
|
readonly allowManualEntry: boolean;
|
|
22
|
+
readonly destructive?: boolean;
|
|
21
23
|
readonly options: readonly ConditionalConfigOption[];
|
|
22
24
|
readonly condition?: string;
|
|
23
25
|
evaluateCondition(deviceId?: DeviceID): ParamInformation | undefined;
|