diff --git a/build/10.js b/build/10.js index 7983dd8..cac7e80 100644 --- a/build/10.js +++ b/build/10.js @@ -8,7 +8,7 @@ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pragma_form\", function() { return PragmaForm; });\n/* harmony import */ var _index_50360107_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index-50360107.js */ \"./pragma/dist/esm/index-50360107.js\");\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _typeof2(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\n\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction getDefaultExportFromCjs(x) {\n return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nfunction createCommonjsModule(fn, basedir, module) {\n return module = {\n path: basedir,\n exports: {},\n require: function require(path, base) {\n return commonjsRequire();\n }\n }, fn(module, module.exports), module.exports;\n}\n\nfunction commonjsRequire() {\n throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');\n}\n\nvar bundle = createCommonjsModule(function (module, exports) {\n (function (global, factory) {\n module.exports = factory();\n })(commonjsGlobal, function () {\n var INUMBER = 'INUMBER';\n var IOP1 = 'IOP1';\n var IOP2 = 'IOP2';\n var IOP3 = 'IOP3';\n var IVAR = 'IVAR';\n var IFUNCALL = 'IFUNCALL';\n var IEXPR = 'IEXPR';\n var IMEMBER = 'IMEMBER';\n\n function Instruction(type, value) {\n this.type = type;\n this.value = value !== undefined && value !== null ? value : 0;\n }\n\n Instruction.prototype.toString = function () {\n switch (this.type) {\n case INUMBER:\n case IOP1:\n case IOP2:\n case IOP3:\n case IVAR:\n return this.value;\n\n case IFUNCALL:\n return 'CALL ' + this.value;\n\n case IMEMBER:\n return '.' + this.value;\n\n default:\n return 'Invalid Instruction';\n }\n };\n\n function unaryInstruction(value) {\n return new Instruction(IOP1, value);\n }\n\n function binaryInstruction(value) {\n return new Instruction(IOP2, value);\n }\n\n function ternaryInstruction(value) {\n return new Instruction(IOP3, value);\n }\n\n function simplify(tokens, unaryOps, binaryOps, ternaryOps, values) {\n var nstack = [];\n var newexpression = [];\n var n1, n2, n3;\n var f;\n\n for (var i = 0; i < tokens.length; i++) {\n var item = tokens[i];\n var type = item.type;\n\n if (type === INUMBER) {\n nstack.push(item);\n } else if (type === IVAR && values.hasOwnProperty(item.value)) {\n item = new Instruction(INUMBER, values[item.value]);\n nstack.push(item);\n } else if (type === IOP2 && nstack.length > 1) {\n n2 = nstack.pop();\n n1 = nstack.pop();\n f = binaryOps[item.value];\n item = new Instruction(INUMBER, f(n1.value, n2.value));\n nstack.push(item);\n } else if (type === IOP3 && nstack.length > 2) {\n n3 = nstack.pop();\n n2 = nstack.pop();\n n1 = nstack.pop();\n\n if (item.value === '?') {\n nstack.push(n1.value ? n2.value : n3.value);\n } else {\n f = ternaryOps[item.value];\n item = new Instruction(INUMBER, f(n1.value, n2.value, n3.value));\n nstack.push(item);\n }\n } else if (type === IOP1 && nstack.length > 0) {\n n1 = nstack.pop();\n f = unaryOps[item.value];\n item = new Instruction(INUMBER, f(n1.value));\n nstack.push(item);\n } else if (type === IEXPR) {\n while (nstack.length > 0) {\n newexpression.push(nstack.shift());\n }\n\n newexpression.push(new Instruction(IEXPR, simplify(item.value, unaryOps, binaryOps, ternaryOps, values)));\n } else if (type === IMEMBER && nstack.length > 0) {\n n1 = nstack.pop();\n nstack.push(new Instruction(INUMBER, n1.value[item.value]));\n } else {\n while (nstack.length > 0) {\n newexpression.push(nstack.shift());\n }\n\n newexpression.push(item);\n }\n }\n\n while (nstack.length > 0) {\n newexpression.push(nstack.shift());\n }\n\n return newexpression;\n }\n\n function substitute(tokens, variable, expr) {\n var newexpression = [];\n\n for (var i = 0; i < tokens.length; i++) {\n var item = tokens[i];\n var type = item.type;\n\n if (type === IVAR && item.value === variable) {\n for (var j = 0; j < expr.tokens.length; j++) {\n var expritem = expr.tokens[j];\n var replitem;\n\n if (expritem.type === IOP1) {\n replitem = unaryInstruction(expritem.value);\n } else if (expritem.type === IOP2) {\n replitem = binaryInstruction(expritem.value);\n } else if (expritem.type === IOP3) {\n replitem = ternaryInstruction(expritem.value);\n } else {\n replitem = new Instruction(expritem.type, expritem.value);\n }\n\n newexpression.push(replitem);\n }\n } else if (type === IEXPR) {\n newexpression.push(new Instruction(IEXPR, substitute(item.value, variable, expr)));\n } else {\n newexpression.push(item);\n }\n }\n\n return newexpression;\n }\n\n function evaluate(tokens, expr, values) {\n var nstack = [];\n var n1, n2, n3;\n var f;\n\n for (var i = 0; i < tokens.length; i++) {\n var item = tokens[i];\n var type = item.type;\n\n if (type === INUMBER) {\n nstack.push(item.value);\n } else if (type === IOP2) {\n n2 = nstack.pop();\n n1 = nstack.pop();\n\n if (item.value === 'and') {\n nstack.push(n1 ? !!evaluate(n2, expr, values) : false);\n } else if (item.value === 'or') {\n nstack.push(n1 ? true : !!evaluate(n2, expr, values));\n } else {\n f = expr.binaryOps[item.value];\n nstack.push(f(n1, n2));\n }\n } else if (type === IOP3) {\n n3 = nstack.pop();\n n2 = nstack.pop();\n n1 = nstack.pop();\n\n if (item.value === '?') {\n nstack.push(evaluate(n1 ? n2 : n3, expr, values));\n } else {\n f = expr.ternaryOps[item.value];\n nstack.push(f(n1, n2, n3));\n }\n } else if (type === IVAR) {\n if (item.value in expr.functions) {\n nstack.push(expr.functions[item.value]);\n } else {\n var v = values[item.value];\n\n if (v !== undefined) {\n nstack.push(v);\n } else {\n throw new Error('undefined variable: ' + item.value);\n }\n }\n } else if (type === IOP1) {\n n1 = nstack.pop();\n f = expr.unaryOps[item.value];\n nstack.push(f(n1));\n } else if (type === IFUNCALL) {\n var argCount = item.value;\n var args = [];\n\n while (argCount-- > 0) {\n args.unshift(nstack.pop());\n }\n\n f = nstack.pop();\n\n if (f.apply && f.call) {\n nstack.push(f.apply(undefined, args));\n } else {\n throw new Error(f + ' is not a function');\n }\n } else if (type === IEXPR) {\n nstack.push(item.value);\n } else if (type === IMEMBER) {\n n1 = nstack.pop();\n nstack.push(n1[item.value]);\n } else {\n throw new Error('invalid Expression');\n }\n }\n\n if (nstack.length > 1) {\n throw new Error('invalid Expression (parity)');\n }\n\n return nstack[0] === -0 ? 0 : nstack[0];\n }\n\n function expressionToString(tokens, toJS) {\n var nstack = [];\n var n1, n2, n3;\n var f;\n\n for (var i = 0; i < tokens.length; i++) {\n var item = tokens[i];\n var type = item.type;\n\n if (type === INUMBER) {\n if (typeof item.value === 'number' && item.value < 0) {\n nstack.push('(' + item.value + ')');\n } else {\n nstack.push(escapeValue(item.value));\n }\n } else if (type === IOP2) {\n n2 = nstack.pop();\n n1 = nstack.pop();\n f = item.value;\n\n if (toJS) {\n if (f === '^') {\n nstack.push('Math.pow(' + n1 + ', ' + n2 + ')');\n } else if (f === 'and') {\n nstack.push('(!!' + n1 + ' && !!' + n2 + ')');\n } else if (f === 'or') {\n nstack.push('(!!' + n1 + ' || !!' + n2 + ')');\n } else if (f === '||') {\n nstack.push('(String(' + n1 + ') + String(' + n2 + '))');\n } else if (f === '==') {\n nstack.push('(' + n1 + ' === ' + n2 + ')');\n } else if (f === '!=') {\n nstack.push('(' + n1 + ' !== ' + n2 + ')');\n } else {\n nstack.push('(' + n1 + ' ' + f + ' ' + n2 + ')');\n }\n } else {\n nstack.push('(' + n1 + ' ' + f + ' ' + n2 + ')');\n }\n } else if (type === IOP3) {\n n3 = nstack.pop();\n n2 = nstack.pop();\n n1 = nstack.pop();\n f = item.value;\n\n if (f === '?') {\n nstack.push('(' + n1 + ' ? ' + n2 + ' : ' + n3 + ')');\n } else {\n throw new Error('invalid Expression');\n }\n } else if (type === IVAR) {\n nstack.push(item.value);\n } else if (type === IOP1) {\n n1 = nstack.pop();\n f = item.value;\n\n if (f === '-' || f === '+') {\n nstack.push('(' + f + n1 + ')');\n } else if (toJS) {\n if (f === 'not') {\n nstack.push('(' + '!' + n1 + ')');\n } else if (f === '!') {\n nstack.push('fac(' + n1 + ')');\n } else {\n nstack.push(f + '(' + n1 + ')');\n }\n } else if (f === '!') {\n nstack.push('(' + n1 + '!)');\n } else {\n nstack.push('(' + f + ' ' + n1 + ')');\n }\n } else if (type === IFUNCALL) {\n var argCount = item.value;\n var args = [];\n\n while (argCount-- > 0) {\n args.unshift(nstack.pop());\n }\n\n f = nstack.pop();\n nstack.push(f + '(' + args.join(', ') + ')');\n } else if (type === IMEMBER) {\n n1 = nstack.pop();\n nstack.push(n1 + '.' + item.value);\n } else if (type === IEXPR) {\n nstack.push('(' + expressionToString(item.value, toJS) + ')');\n } else {\n throw new Error('invalid Expression');\n }\n }\n\n if (nstack.length > 1) {\n throw new Error('invalid Expression (parity)');\n }\n\n return String(nstack[0]);\n }\n\n function escapeValue(v) {\n if (typeof v === 'string') {\n return JSON.stringify(v).replace(/\\u2028/g, \"\\\\u2028\").replace(/\\u2029/g, \"\\\\u2029\");\n }\n\n return v;\n }\n\n function contains(array, obj) {\n for (var i = 0; i < array.length; i++) {\n if (array[i] === obj) {\n return true;\n }\n }\n\n return false;\n }\n\n function getSymbols(tokens, symbols, options) {\n options = options || {};\n var withMembers = !!options.withMembers;\n var prevVar = null;\n\n for (var i = 0; i < tokens.length; i++) {\n var item = tokens[i];\n\n if (item.type === IVAR) {\n if (!withMembers && !contains(symbols, item.value)) {\n symbols.push(item.value);\n } else if (prevVar !== null) {\n if (!contains(symbols, prevVar)) {\n symbols.push(prevVar);\n }\n\n prevVar = item.value;\n } else {\n prevVar = item.value;\n }\n } else if (item.type === IMEMBER && withMembers && prevVar !== null) {\n prevVar += '.' + item.value;\n } else if (item.type === IEXPR) {\n getSymbols(item.value, symbols, options);\n } else if (prevVar !== null) {\n if (!contains(symbols, prevVar)) {\n symbols.push(prevVar);\n }\n\n prevVar = null;\n }\n }\n\n if (prevVar !== null && !contains(symbols, prevVar)) {\n symbols.push(prevVar);\n }\n }\n\n function Expression(tokens, parser) {\n this.tokens = tokens;\n this.parser = parser;\n this.unaryOps = parser.unaryOps;\n this.binaryOps = parser.binaryOps;\n this.ternaryOps = parser.ternaryOps;\n this.functions = parser.functions;\n }\n\n Expression.prototype.simplify = function (values) {\n values = values || {};\n return new Expression(simplify(this.tokens, this.unaryOps, this.binaryOps, this.ternaryOps, values), this.parser);\n };\n\n Expression.prototype.substitute = function (variable, expr) {\n if (!(expr instanceof Expression)) {\n expr = this.parser.parse(String(expr));\n }\n\n return new Expression(substitute(this.tokens, variable, expr), this.parser);\n };\n\n Expression.prototype.evaluate = function (values) {\n values = values || {};\n return evaluate(this.tokens, this, values);\n };\n\n Expression.prototype.toString = function () {\n return expressionToString(this.tokens, false);\n };\n\n Expression.prototype.symbols = function (options) {\n options = options || {};\n var vars = [];\n getSymbols(this.tokens, vars, options);\n return vars;\n };\n\n Expression.prototype.variables = function (options) {\n options = options || {};\n var vars = [];\n getSymbols(this.tokens, vars, options);\n var functions = this.functions;\n return vars.filter(function (name) {\n return !(name in functions);\n });\n };\n\n Expression.prototype.toJSFunction = function (param, variables) {\n var expr = this;\n var f = new Function(param, 'with(this.functions) with (this.ternaryOps) with (this.binaryOps) with (this.unaryOps) { return ' + expressionToString(this.simplify(variables).tokens, true) + '; }'); // eslint-disable-line no-new-func\n\n return function () {\n return f.apply(expr, arguments);\n };\n };\n\n var TEOF = 'TEOF';\n var TOP = 'TOP';\n var TNUMBER = 'TNUMBER';\n var TSTRING = 'TSTRING';\n var TPAREN = 'TPAREN';\n var TCOMMA = 'TCOMMA';\n var TNAME = 'TNAME';\n\n function Token(type, value, index) {\n this.type = type;\n this.value = value;\n this.index = index;\n }\n\n Token.prototype.toString = function () {\n return this.type + ': ' + this.value;\n };\n\n function TokenStream(parser, expression) {\n this.pos = 0;\n this.current = null;\n this.unaryOps = parser.unaryOps;\n this.binaryOps = parser.binaryOps;\n this.ternaryOps = parser.ternaryOps;\n this.consts = parser.consts;\n this.expression = expression;\n this.savedPosition = 0;\n this.savedCurrent = null;\n this.options = parser.options;\n }\n\n TokenStream.prototype.newToken = function (type, value, pos) {\n return new Token(type, value, pos != null ? pos : this.pos);\n };\n\n TokenStream.prototype.save = function () {\n this.savedPosition = this.pos;\n this.savedCurrent = this.current;\n };\n\n TokenStream.prototype.restore = function () {\n this.pos = this.savedPosition;\n this.current = this.savedCurrent;\n };\n\n TokenStream.prototype.next = function () {\n if (this.pos >= this.expression.length) {\n return this.newToken(TEOF, 'EOF');\n }\n\n if (this.isWhitespace() || this.isComment()) {\n return this.next();\n } else if (this.isRadixInteger() || this.isNumber() || this.isOperator() || this.isString() || this.isParen() || this.isComma() || this.isNamedOp() || this.isConst() || this.isName()) {\n return this.current;\n } else {\n this.parseError('Unknown character \"' + this.expression.charAt(this.pos) + '\"');\n }\n };\n\n TokenStream.prototype.isString = function () {\n var r = false;\n var startPos = this.pos;\n var quote = this.expression.charAt(startPos);\n\n if (quote === '\\'' || quote === '\"') {\n var index = this.expression.indexOf(quote, startPos + 1);\n\n while (index >= 0 && this.pos < this.expression.length) {\n this.pos = index + 1;\n\n if (this.expression.charAt(index - 1) !== '\\\\') {\n var rawString = this.expression.substring(startPos + 1, index);\n this.current = this.newToken(TSTRING, this.unescape(rawString), startPos);\n r = true;\n break;\n }\n\n index = this.expression.indexOf(quote, index + 1);\n }\n }\n\n return r;\n };\n\n TokenStream.prototype.isParen = function () {\n var c = this.expression.charAt(this.pos);\n\n if (c === '(' || c === ')') {\n this.current = this.newToken(TPAREN, c);\n this.pos++;\n return true;\n }\n\n return false;\n };\n\n TokenStream.prototype.isComma = function () {\n var c = this.expression.charAt(this.pos);\n\n if (c === ',') {\n this.current = this.newToken(TCOMMA, ',');\n this.pos++;\n return true;\n }\n\n return false;\n };\n\n TokenStream.prototype.isConst = function () {\n var startPos = this.pos;\n var i = startPos;\n\n for (; i < this.expression.length; i++) {\n var c = this.expression.charAt(i);\n\n if (c.toUpperCase() === c.toLowerCase()) {\n if (i === this.pos || c !== '_' && c !== '.' && (c < '0' || c > '9')) {\n break;\n }\n }\n }\n\n if (i > startPos) {\n var str = this.expression.substring(startPos, i);\n\n if (str in this.consts) {\n this.current = this.newToken(TNUMBER, this.consts[str]);\n this.pos += str.length;\n return true;\n }\n }\n\n return false;\n };\n\n TokenStream.prototype.isNamedOp = function () {\n var startPos = this.pos;\n var i = startPos;\n\n for (; i < this.expression.length; i++) {\n var c = this.expression.charAt(i);\n\n if (c.toUpperCase() === c.toLowerCase()) {\n if (i === this.pos || c !== '_' && (c < '0' || c > '9')) {\n break;\n }\n }\n }\n\n if (i > startPos) {\n var str = this.expression.substring(startPos, i);\n\n if (this.isOperatorEnabled(str) && (str in this.binaryOps || str in this.unaryOps || str in this.ternaryOps)) {\n this.current = this.newToken(TOP, str);\n this.pos += str.length;\n return true;\n }\n }\n\n return false;\n };\n\n TokenStream.prototype.isName = function () {\n var startPos = this.pos;\n var i = startPos;\n var hasLetter = false;\n\n for (; i < this.expression.length; i++) {\n var c = this.expression.charAt(i);\n\n if (c.toUpperCase() === c.toLowerCase()) {\n if (i === this.pos && (c === '$' || c === '_')) {\n if (c === '_') {\n hasLetter = true;\n }\n\n continue;\n } else if (i === this.pos || !hasLetter || c !== '_' && (c < '0' || c > '9')) {\n break;\n }\n } else {\n hasLetter = true;\n }\n }\n\n if (hasLetter) {\n var str = this.expression.substring(startPos, i);\n this.current = this.newToken(TNAME, str);\n this.pos += str.length;\n return true;\n }\n\n return false;\n };\n\n TokenStream.prototype.isWhitespace = function () {\n var r = false;\n var c = this.expression.charAt(this.pos);\n\n while (c === ' ' || c === '\\t' || c === '\\n' || c === '\\r') {\n r = true;\n this.pos++;\n\n if (this.pos >= this.expression.length) {\n break;\n }\n\n c = this.expression.charAt(this.pos);\n }\n\n return r;\n };\n\n var codePointPattern = /^[0-9a-f]{4}$/i;\n\n TokenStream.prototype.unescape = function (v) {\n var index = v.indexOf('\\\\');\n\n if (index < 0) {\n return v;\n }\n\n var buffer = v.substring(0, index);\n\n while (index >= 0) {\n var c = v.charAt(++index);\n\n switch (c) {\n case '\\'':\n buffer += '\\'';\n break;\n\n case '\"':\n buffer += '\"';\n break;\n\n case '\\\\':\n buffer += '\\\\';\n break;\n\n case '/':\n buffer += '/';\n break;\n\n case 'b':\n buffer += '\\b';\n break;\n\n case 'f':\n buffer += '\\f';\n break;\n\n case 'n':\n buffer += '\\n';\n break;\n\n case 'r':\n buffer += '\\r';\n break;\n\n case 't':\n buffer += '\\t';\n break;\n\n case 'u':\n // interpret the following 4 characters as the hex of the unicode code point\n var codePoint = v.substring(index + 1, index + 5);\n\n if (!codePointPattern.test(codePoint)) {\n this.parseError(\"Illegal escape sequence: \\\\u\" + codePoint);\n }\n\n buffer += String.fromCharCode(parseInt(codePoint, 16));\n index += 4;\n break;\n\n default:\n throw this.parseError('Illegal escape sequence: \"\\\\' + c + '\"');\n }\n\n ++index;\n var backslash = v.indexOf('\\\\', index);\n buffer += v.substring(index, backslash < 0 ? v.length : backslash);\n index = backslash;\n }\n\n return buffer;\n };\n\n TokenStream.prototype.isComment = function () {\n var c = this.expression.charAt(this.pos);\n\n if (c === '/' && this.expression.charAt(this.pos + 1) === '*') {\n this.pos = this.expression.indexOf('*/', this.pos) + 2;\n\n if (this.pos === 1) {\n this.pos = this.expression.length;\n }\n\n return true;\n }\n\n return false;\n };\n\n TokenStream.prototype.isRadixInteger = function () {\n var pos = this.pos;\n\n if (pos >= this.expression.length - 2 || this.expression.charAt(pos) !== '0') {\n return false;\n }\n\n ++pos;\n var radix;\n var validDigit;\n\n if (this.expression.charAt(pos) === 'x') {\n radix = 16;\n validDigit = /^[0-9a-f]$/i;\n ++pos;\n } else if (this.expression.charAt(pos) === 'b') {\n radix = 2;\n validDigit = /^[01]$/i;\n ++pos;\n } else {\n return false;\n }\n\n var valid = false;\n var startPos = pos;\n\n while (pos < this.expression.length) {\n var c = this.expression.charAt(pos);\n\n if (validDigit.test(c)) {\n pos++;\n valid = true;\n } else {\n break;\n }\n }\n\n if (valid) {\n this.current = this.newToken(TNUMBER, parseInt(this.expression.substring(startPos, pos), radix));\n this.pos = pos;\n }\n\n return valid;\n };\n\n TokenStream.prototype.isNumber = function () {\n var valid = false;\n var pos = this.pos;\n var startPos = pos;\n var resetPos = pos;\n var foundDot = false;\n var foundDigits = false;\n var c;\n\n while (pos < this.expression.length) {\n c = this.expression.charAt(pos);\n\n if (c >= '0' && c <= '9' || !foundDot && c === '.') {\n if (c === '.') {\n foundDot = true;\n } else {\n foundDigits = true;\n }\n\n pos++;\n valid = foundDigits;\n } else {\n break;\n }\n }\n\n if (valid) {\n resetPos = pos;\n }\n\n if (c === 'e' || c === 'E') {\n pos++;\n var acceptSign = true;\n var validExponent = false;\n\n while (pos < this.expression.length) {\n c = this.expression.charAt(pos);\n\n if (acceptSign && (c === '+' || c === '-')) {\n acceptSign = false;\n } else if (c >= '0' && c <= '9') {\n validExponent = true;\n acceptSign = false;\n } else {\n break;\n }\n\n pos++;\n }\n\n if (!validExponent) {\n pos = resetPos;\n }\n }\n\n if (valid) {\n this.current = this.newToken(TNUMBER, parseFloat(this.expression.substring(startPos, pos)));\n this.pos = pos;\n } else {\n this.pos = resetPos;\n }\n\n return valid;\n };\n\n TokenStream.prototype.isOperator = function () {\n var startPos = this.pos;\n var c = this.expression.charAt(this.pos);\n\n if (c === '+' || c === '-' || c === '*' || c === '/' || c === '%' || c === '^' || c === '?' || c === ':' || c === '.') {\n this.current = this.newToken(TOP, c);\n } else if (c === '∙' || c === '•') {\n this.current = this.newToken(TOP, '*');\n } else if (c === '>') {\n if (this.expression.charAt(this.pos + 1) === '=') {\n this.current = this.newToken(TOP, '>=');\n this.pos++;\n } else {\n this.current = this.newToken(TOP, '>');\n }\n } else if (c === '<') {\n if (this.expression.charAt(this.pos + 1) === '=') {\n this.current = this.newToken(TOP, '<=');\n this.pos++;\n } else {\n this.current = this.newToken(TOP, '<');\n }\n } else if (c === '|') {\n if (this.expression.charAt(this.pos + 1) === '|') {\n this.current = this.newToken(TOP, '||');\n this.pos++;\n } else {\n return false;\n }\n } else if (c === '=') {\n if (this.expression.charAt(this.pos + 1) === '=') {\n this.current = this.newToken(TOP, '==');\n this.pos++;\n } else {\n return false;\n }\n } else if (c === '!') {\n if (this.expression.charAt(this.pos + 1) === '=') {\n this.current = this.newToken(TOP, '!=');\n this.pos++;\n } else {\n this.current = this.newToken(TOP, c);\n }\n } else {\n return false;\n }\n\n this.pos++;\n\n if (this.isOperatorEnabled(this.current.value)) {\n return true;\n } else {\n this.pos = startPos;\n return false;\n }\n };\n\n var optionNameMap = {\n '+': 'add',\n '-': 'subtract',\n '*': 'multiply',\n '/': 'divide',\n '%': 'remainder',\n '^': 'power',\n '!': 'factorial',\n '<': 'comparison',\n '>': 'comparison',\n '<=': 'comparison',\n '>=': 'comparison',\n '==': 'comparison',\n '!=': 'comparison',\n '||': 'concatenate',\n 'and': 'logical',\n 'or': 'logical',\n 'not': 'logical',\n '?': 'conditional',\n ':': 'conditional'\n };\n\n function getOptionName(op) {\n return optionNameMap.hasOwnProperty(op) ? optionNameMap[op] : op;\n }\n\n TokenStream.prototype.isOperatorEnabled = function (op) {\n var optionName = getOptionName(op);\n var operators = this.options.operators || {}; // in is a special case for now because it's disabled by default\n\n if (optionName === 'in') {\n return !!operators['in'];\n }\n\n return !(optionName in operators) || !!operators[optionName];\n };\n\n TokenStream.prototype.getCoordinates = function () {\n var line = 0;\n var column;\n var newline = -1;\n\n do {\n line++;\n column = this.pos - newline;\n newline = this.expression.indexOf('\\n', newline + 1);\n } while (newline >= 0 && newline < this.pos);\n\n return {\n line: line,\n column: column\n };\n };\n\n TokenStream.prototype.parseError = function (msg) {\n var coords = this.getCoordinates();\n throw new Error('parse error [' + coords.line + ':' + coords.column + ']: ' + msg);\n };\n\n function ParserState(parser, tokenStream, options) {\n this.parser = parser;\n this.tokens = tokenStream;\n this.current = null;\n this.nextToken = null;\n this.next();\n this.savedCurrent = null;\n this.savedNextToken = null;\n this.allowMemberAccess = options.allowMemberAccess !== false;\n }\n\n ParserState.prototype.next = function () {\n this.current = this.nextToken;\n return this.nextToken = this.tokens.next();\n };\n\n ParserState.prototype.tokenMatches = function (token, value) {\n if (typeof value === 'undefined') {\n return true;\n } else if (Array.isArray(value)) {\n return contains(value, token.value);\n } else if (typeof value === 'function') {\n return value(token);\n } else {\n return token.value === value;\n }\n };\n\n ParserState.prototype.save = function () {\n this.savedCurrent = this.current;\n this.savedNextToken = this.nextToken;\n this.tokens.save();\n };\n\n ParserState.prototype.restore = function () {\n this.tokens.restore();\n this.current = this.savedCurrent;\n this.nextToken = this.savedNextToken;\n };\n\n ParserState.prototype.accept = function (type, value) {\n if (this.nextToken.type === type && this.tokenMatches(this.nextToken, value)) {\n this.next();\n return true;\n }\n\n return false;\n };\n\n ParserState.prototype.expect = function (type, value) {\n if (!this.accept(type, value)) {\n var coords = this.tokens.getCoordinates();\n throw new Error('parse error [' + coords.line + ':' + coords.column + ']: Expected ' + (value || type));\n }\n };\n\n ParserState.prototype.parseAtom = function (instr) {\n if (this.accept(TNAME)) {\n instr.push(new Instruction(IVAR, this.current.value));\n } else if (this.accept(TNUMBER)) {\n instr.push(new Instruction(INUMBER, this.current.value));\n } else if (this.accept(TSTRING)) {\n instr.push(new Instruction(INUMBER, this.current.value));\n } else if (this.accept(TPAREN, '(')) {\n this.parseExpression(instr);\n this.expect(TPAREN, ')');\n } else {\n throw new Error('unexpected ' + this.nextToken);\n }\n };\n\n ParserState.prototype.parseExpression = function (instr) {\n this.parseConditionalExpression(instr);\n };\n\n ParserState.prototype.parseConditionalExpression = function (instr) {\n this.parseOrExpression(instr);\n\n while (this.accept(TOP, '?')) {\n var trueBranch = [];\n var falseBranch = [];\n this.parseConditionalExpression(trueBranch);\n this.expect(TOP, ':');\n this.parseConditionalExpression(falseBranch);\n instr.push(new Instruction(IEXPR, trueBranch));\n instr.push(new Instruction(IEXPR, falseBranch));\n instr.push(ternaryInstruction('?'));\n }\n };\n\n ParserState.prototype.parseOrExpression = function (instr) {\n this.parseAndExpression(instr);\n\n while (this.accept(TOP, 'or')) {\n var falseBranch = [];\n this.parseAndExpression(falseBranch);\n instr.push(new Instruction(IEXPR, falseBranch));\n instr.push(binaryInstruction('or'));\n }\n };\n\n ParserState.prototype.parseAndExpression = function (instr) {\n this.parseComparison(instr);\n\n while (this.accept(TOP, 'and')) {\n var trueBranch = [];\n this.parseComparison(trueBranch);\n instr.push(new Instruction(IEXPR, trueBranch));\n instr.push(binaryInstruction('and'));\n }\n };\n\n var COMPARISON_OPERATORS = ['==', '!=', '<', '<=', '>=', '>', 'in'];\n\n ParserState.prototype.parseComparison = function (instr) {\n this.parseAddSub(instr);\n\n while (this.accept(TOP, COMPARISON_OPERATORS)) {\n var op = this.current;\n this.parseAddSub(instr);\n instr.push(binaryInstruction(op.value));\n }\n };\n\n var ADD_SUB_OPERATORS = ['+', '-', '||'];\n\n ParserState.prototype.parseAddSub = function (instr) {\n this.parseTerm(instr);\n\n while (this.accept(TOP, ADD_SUB_OPERATORS)) {\n var op = this.current;\n this.parseTerm(instr);\n instr.push(binaryInstruction(op.value));\n }\n };\n\n var TERM_OPERATORS = ['*', '/', '%'];\n\n ParserState.prototype.parseTerm = function (instr) {\n this.parseFactor(instr);\n\n while (this.accept(TOP, TERM_OPERATORS)) {\n var op = this.current;\n this.parseFactor(instr);\n instr.push(binaryInstruction(op.value));\n }\n };\n\n ParserState.prototype.parseFactor = function (instr) {\n var unaryOps = this.tokens.unaryOps;\n\n function isPrefixOperator(token) {\n return token.value in unaryOps;\n }\n\n this.save();\n\n if (this.accept(TOP, isPrefixOperator)) {\n if (this.current.value !== '-' && this.current.value !== '+' && this.nextToken.type === TPAREN && this.nextToken.value === '(') {\n this.restore();\n this.parseExponential(instr);\n } else {\n var op = this.current;\n this.parseFactor(instr);\n instr.push(unaryInstruction(op.value));\n }\n } else {\n this.parseExponential(instr);\n }\n };\n\n ParserState.prototype.parseExponential = function (instr) {\n this.parsePostfixExpression(instr);\n\n while (this.accept(TOP, '^')) {\n this.parseFactor(instr);\n instr.push(binaryInstruction('^'));\n }\n };\n\n ParserState.prototype.parsePostfixExpression = function (instr) {\n this.parseFunctionCall(instr);\n\n while (this.accept(TOP, '!')) {\n instr.push(unaryInstruction('!'));\n }\n };\n\n ParserState.prototype.parseFunctionCall = function (instr) {\n var unaryOps = this.tokens.unaryOps;\n\n function isPrefixOperator(token) {\n return token.value in unaryOps;\n }\n\n if (this.accept(TOP, isPrefixOperator)) {\n var op = this.current;\n this.parseAtom(instr);\n instr.push(unaryInstruction(op.value));\n } else {\n this.parseMemberExpression(instr);\n\n while (this.accept(TPAREN, '(')) {\n if (this.accept(TPAREN, ')')) {\n instr.push(new Instruction(IFUNCALL, 0));\n } else {\n var argCount = this.parseArgumentList(instr);\n instr.push(new Instruction(IFUNCALL, argCount));\n }\n }\n }\n };\n\n ParserState.prototype.parseArgumentList = function (instr) {\n var argCount = 0;\n\n while (!this.accept(TPAREN, ')')) {\n this.parseExpression(instr);\n ++argCount;\n\n while (this.accept(TCOMMA)) {\n this.parseExpression(instr);\n ++argCount;\n }\n }\n\n return argCount;\n };\n\n ParserState.prototype.parseMemberExpression = function (instr) {\n this.parseAtom(instr);\n\n while (this.accept(TOP, '.')) {\n if (!this.allowMemberAccess) {\n throw new Error('unexpected \".\", member access is not permitted');\n }\n\n this.expect(TNAME);\n instr.push(new Instruction(IMEMBER, this.current.value));\n }\n };\n\n function add(a, b) {\n return Number(a) + Number(b);\n }\n\n function sub(a, b) {\n return a - b;\n }\n\n function mul(a, b) {\n return a * b;\n }\n\n function div(a, b) {\n return a / b;\n }\n\n function mod(a, b) {\n return a % b;\n }\n\n function concat(a, b) {\n return '' + a + b;\n }\n\n function equal(a, b) {\n return a === b;\n }\n\n function notEqual(a, b) {\n return a !== b;\n }\n\n function greaterThan(a, b) {\n return a > b;\n }\n\n function lessThan(a, b) {\n return a < b;\n }\n\n function greaterThanEqual(a, b) {\n return a >= b;\n }\n\n function lessThanEqual(a, b) {\n return a <= b;\n }\n\n function andOperator(a, b) {\n return Boolean(a && b);\n }\n\n function orOperator(a, b) {\n return Boolean(a || b);\n }\n\n function inOperator(a, b) {\n return contains(b, a);\n }\n\n function sinh(a) {\n return (Math.exp(a) - Math.exp(-a)) / 2;\n }\n\n function cosh(a) {\n return (Math.exp(a) + Math.exp(-a)) / 2;\n }\n\n function tanh(a) {\n if (a === Infinity) return 1;\n if (a === -Infinity) return -1;\n return (Math.exp(a) - Math.exp(-a)) / (Math.exp(a) + Math.exp(-a));\n }\n\n function asinh(a) {\n if (a === -Infinity) return a;\n return Math.log(a + Math.sqrt(a * a + 1));\n }\n\n function acosh(a) {\n return Math.log(a + Math.sqrt(a * a - 1));\n }\n\n function atanh(a) {\n return Math.log((1 + a) / (1 - a)) / 2;\n }\n\n function log10(a) {\n return Math.log(a) * Math.LOG10E;\n }\n\n function neg(a) {\n return -a;\n }\n\n function not(a) {\n return !a;\n }\n\n function trunc(a) {\n return a < 0 ? Math.ceil(a) : Math.floor(a);\n }\n\n function random(a) {\n return Math.random() * (a || 1);\n }\n\n function factorial(a) {\n // a!\n return gamma(a + 1);\n }\n\n function isInteger(value) {\n return isFinite(value) && value === Math.round(value);\n }\n\n var GAMMA_G = 4.7421875;\n var GAMMA_P = [0.99999999999999709182, 57.156235665862923517, -59.597960355475491248, 14.136097974741747174, -0.49191381609762019978, 0.33994649984811888699e-4, 0.46523628927048575665e-4, -0.98374475304879564677e-4, 0.15808870322491248884e-3, -0.21026444172410488319e-3, 0.21743961811521264320e-3, -0.16431810653676389022e-3, 0.84418223983852743293e-4, -0.26190838401581408670e-4, 0.36899182659531622704e-5]; // Gamma function from math.js\n\n function gamma(n) {\n var t, x;\n\n if (isInteger(n)) {\n if (n <= 0) {\n return isFinite(n) ? Infinity : NaN;\n }\n\n if (n > 171) {\n return Infinity; // Will overflow\n }\n\n var value = n - 2;\n var res = n - 1;\n\n while (value > 1) {\n res *= value;\n value--;\n }\n\n if (res === 0) {\n res = 1; // 0! is per definition 1\n }\n\n return res;\n }\n\n if (n < 0.5) {\n return Math.PI / (Math.sin(Math.PI * n) * gamma(1 - n));\n }\n\n if (n >= 171.35) {\n return Infinity; // will overflow\n }\n\n if (n > 85.0) {\n // Extended Stirling Approx\n var twoN = n * n;\n var threeN = twoN * n;\n var fourN = threeN * n;\n var fiveN = fourN * n;\n return Math.sqrt(2 * Math.PI / n) * Math.pow(n / Math.E, n) * (1 + 1 / (12 * n) + 1 / (288 * twoN) - 139 / (51840 * threeN) - 571 / (2488320 * fourN) + 163879 / (209018880 * fiveN) + 5246819 / (75246796800 * fiveN * n));\n }\n\n --n;\n x = GAMMA_P[0];\n\n for (var i = 1; i < GAMMA_P.length; ++i) {\n x += GAMMA_P[i] / (n + i);\n }\n\n t = n + GAMMA_G + 0.5;\n return Math.sqrt(2 * Math.PI) * Math.pow(t, n + 0.5) * Math.exp(-t) * x;\n }\n\n function stringLength(s) {\n return String(s).length;\n }\n\n function hypot() {\n var sum = 0;\n var larg = 0;\n\n for (var i = 0; i < arguments.length; i++) {\n var arg = Math.abs(arguments[i]);\n var div;\n\n if (larg < arg) {\n div = larg / arg;\n sum = sum * div * div + 1;\n larg = arg;\n } else if (arg > 0) {\n div = arg / larg;\n sum += div * div;\n } else {\n sum += arg;\n }\n }\n\n return larg === Infinity ? Infinity : larg * Math.sqrt(sum);\n }\n\n function condition(cond, yep, nope) {\n return cond ? yep : nope;\n }\n /**\n * Decimal adjustment of a number.\n * From @escopecz.\n *\n * @param {Number} value The number.\n * @param {Integer} exp The exponent (the 10 logarithm of the adjustment base).\n * @return {Number} The adjusted value.\n */\n\n\n function roundTo(value, exp) {\n // If the exp is undefined or zero...\n if (typeof exp === 'undefined' || +exp === 0) {\n return Math.round(value);\n }\n\n value = +value;\n exp = -+exp; // If the value is not a number or the exp is not an integer...\n\n if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) {\n return NaN;\n } // Shift\n\n\n value = value.toString().split('e');\n value = Math.round(+(value[0] + 'e' + (value[1] ? +value[1] - exp : -exp))); // Shift back\n\n value = value.toString().split('e');\n return +(value[0] + 'e' + (value[1] ? +value[1] + exp : exp));\n }\n\n function Parser(options) {\n this.options = options || {};\n this.unaryOps = {\n sin: Math.sin,\n cos: Math.cos,\n tan: Math.tan,\n asin: Math.asin,\n acos: Math.acos,\n atan: Math.atan,\n sinh: Math.sinh || sinh,\n cosh: Math.cosh || cosh,\n tanh: Math.tanh || tanh,\n asinh: Math.asinh || asinh,\n acosh: Math.acosh || acosh,\n atanh: Math.atanh || atanh,\n sqrt: Math.sqrt,\n log: Math.log,\n ln: Math.log,\n lg: Math.log10 || log10,\n log10: Math.log10 || log10,\n abs: Math.abs,\n ceil: Math.ceil,\n floor: Math.floor,\n round: Math.round,\n trunc: Math.trunc || trunc,\n '-': neg,\n '+': Number,\n exp: Math.exp,\n not: not,\n length: stringLength,\n '!': factorial\n };\n this.binaryOps = {\n '+': add,\n '-': sub,\n '*': mul,\n '/': div,\n '%': mod,\n '^': Math.pow,\n '||': concat,\n '==': equal,\n '!=': notEqual,\n '>': greaterThan,\n '<': lessThan,\n '>=': greaterThanEqual,\n '<=': lessThanEqual,\n and: andOperator,\n or: orOperator,\n 'in': inOperator\n };\n this.ternaryOps = {\n '?': condition\n };\n this.functions = {\n random: random,\n fac: factorial,\n min: Math.min,\n max: Math.max,\n hypot: Math.hypot || hypot,\n pyt: Math.hypot || hypot,\n // backward compat\n pow: Math.pow,\n atan2: Math.atan2,\n 'if': condition,\n gamma: gamma,\n roundTo: roundTo\n };\n this.consts = {\n E: Math.E,\n PI: Math.PI,\n 'true': true,\n 'false': false\n };\n }\n\n Parser.prototype.parse = function (expr) {\n var instr = [];\n var parserState = new ParserState(this, new TokenStream(this, expr), {\n allowMemberAccess: this.options.allowMemberAccess\n });\n parserState.parseExpression(instr);\n parserState.expect(TEOF, 'EOF');\n return new Expression(instr, this);\n };\n\n Parser.prototype.evaluate = function (expr, variables) {\n return this.parse(expr).evaluate(variables);\n };\n\n var sharedParser = new Parser();\n\n Parser.parse = function (expr) {\n return sharedParser.parse(expr);\n };\n\n Parser.evaluate = function (expr, variables) {\n return sharedParser.parse(expr).evaluate(variables);\n };\n /*!\n Based on ndef.parser, by Raphael Graf(r@undefined.ch)\n http://www.undefined.ch/mparser/index.html\n Ported to JavaScript and modified by Matthew Crumley (email@matthewcrumley.com, http://silentmatt.com/)\n You are free to use and modify this code in anyway you find useful. Please leave this comment in the code\n to acknowledge its original source. If you feel like it, I enjoy hearing about projects that use my code,\n but don't feel like you have to let me know or ask permission.\n */\n\n\n var index = {\n Parser: Parser,\n Expression: Expression\n };\n return index;\n });\n});\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nvar _listCacheClear = listCacheClear;\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n\nfunction eq(value, other) {\n return value === other || value !== value && other !== other;\n}\n\nvar eq_1 = eq;\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n\nfunction assocIndexOf(array, key) {\n var length = array.length;\n\n while (length--) {\n if (eq_1(array[length][0], key)) {\n return length;\n }\n }\n\n return -1;\n}\n\nvar _assocIndexOf = assocIndexOf;\n/** Used for built-in method references. */\n\nvar arrayProto$1 = Array.prototype;\n/** Built-in value references. */\n\nvar splice$1 = arrayProto$1.splice;\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = _assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n\n var lastIndex = data.length - 1;\n\n if (index == lastIndex) {\n data.pop();\n } else {\n splice$1.call(data, index, 1);\n }\n\n --this.size;\n return true;\n}\n\nvar _listCacheDelete = listCacheDelete;\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = _assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nvar _listCacheGet = listCacheGet;\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n\nfunction listCacheHas(key) {\n return _assocIndexOf(this.__data__, key) > -1;\n}\n\nvar _listCacheHas = listCacheHas;\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = _assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n\n return this;\n}\n\nvar _listCacheSet = listCacheSet;\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n this.clear();\n\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n} // Add methods to `ListCache`.\n\n\nListCache.prototype.clear = _listCacheClear;\nListCache.prototype['delete'] = _listCacheDelete;\nListCache.prototype.get = _listCacheGet;\nListCache.prototype.has = _listCacheHas;\nListCache.prototype.set = _listCacheSet;\nvar _ListCache = ListCache;\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n\nfunction stackClear() {\n this.__data__ = new _ListCache();\n this.size = 0;\n}\n\nvar _stackClear = stackClear;\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n this.size = data.size;\n return result;\n}\n\nvar _stackDelete = stackDelete;\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nvar _stackGet = stackGet;\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nvar _stackHas = stackHas;\n/** Detect free variable `global` from Node.js. */\n\nvar freeGlobal = _typeof2(commonjsGlobal) == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;\nvar _freeGlobal = freeGlobal;\n/** Detect free variable `self`. */\n\nvar freeSelf = (typeof self === \"undefined\" ? \"undefined\" : _typeof2(self)) == 'object' && self && self.Object === Object && self;\n/** Used as a reference to the global object. */\n\nvar root = _freeGlobal || freeSelf || Function('return this')();\nvar _root = root;\n/** Built-in value references. */\n\nvar Symbol$1 = _root.Symbol;\nvar _Symbol = Symbol$1;\n/** Used for built-in method references. */\n\nvar objectProto$g = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty$d = objectProto$g.hasOwnProperty;\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n\nvar nativeObjectToString$1 = objectProto$g.toString;\n/** Built-in value references. */\n\nvar symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty$d.call(value, symToStringTag$1),\n tag = value[symToStringTag$1];\n\n try {\n value[symToStringTag$1] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString$1.call(value);\n\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag$1] = tag;\n } else {\n delete value[symToStringTag$1];\n }\n }\n\n return result;\n}\n\nvar _getRawTag = getRawTag;\n/** Used for built-in method references. */\n\nvar objectProto$f = Object.prototype;\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n\nvar nativeObjectToString = objectProto$f.toString;\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nvar _objectToString = objectToString;\n/** `Object#toString` result references. */\n\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n/** Built-in value references. */\n\nvar symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n\n return symToStringTag && symToStringTag in Object(value) ? _getRawTag(value) : _objectToString(value);\n}\n\nvar _baseGetTag = baseGetTag;\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n\nfunction isObject(value) {\n var type = _typeof2(value);\n\n return value != null && (type == 'object' || type == 'function');\n}\n\nvar isObject_1 = isObject;\n/** `Object#toString` result references. */\n\nvar asyncTag = '[object AsyncFunction]',\n funcTag$2 = '[object Function]',\n genTag$1 = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n\nfunction isFunction(value) {\n if (!isObject_1(value)) {\n return false;\n } // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n\n\n var tag = _baseGetTag(value);\n\n return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;\n}\n\nvar isFunction_1 = isFunction;\n/** Used to detect overreaching core-js shims. */\n\nvar coreJsData = _root['__core-js_shared__'];\nvar _coreJsData = coreJsData;\n/** Used to detect methods masquerading as native. */\n\nvar maskSrcKey = function () {\n var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');\n return uid ? 'Symbol(src)_1.' + uid : '';\n}();\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n\n\nfunction isMasked(func) {\n return !!maskSrcKey && maskSrcKey in func;\n}\n\nvar _isMasked = isMasked;\n/** Used for built-in method references. */\n\nvar funcProto$2 = Function.prototype;\n/** Used to resolve the decompiled source of functions. */\n\nvar funcToString$2 = funcProto$2.toString;\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString$2.call(func);\n } catch (e) {}\n\n try {\n return func + '';\n } catch (e) {}\n }\n\n return '';\n}\n\nvar _toSource = toSource;\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n/** Used to detect host constructors (Safari). */\n\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n/** Used for built-in method references. */\n\nvar funcProto$1 = Function.prototype,\n objectProto$e = Object.prototype;\n/** Used to resolve the decompiled source of functions. */\n\nvar funcToString$1 = funcProto$1.toString;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty$c = objectProto$e.hasOwnProperty;\n/** Used to detect if a method is native. */\n\nvar reIsNative = RegExp('^' + funcToString$1.call(hasOwnProperty$c).replace(reRegExpChar, '\\\\$&').replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$');\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n\nfunction baseIsNative(value) {\n if (!isObject_1(value) || _isMasked(value)) {\n return false;\n }\n\n var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;\n return pattern.test(_toSource(value));\n}\n\nvar _baseIsNative = baseIsNative;\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nvar _getValue = getValue;\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n\nfunction getNative(object, key) {\n var value = _getValue(object, key);\n\n return _baseIsNative(value) ? value : undefined;\n}\n\nvar _getNative = getNative;\n/* Built-in method references that are verified to be native. */\n\nvar Map = _getNative(_root, 'Map');\n\nvar _Map = Map;\n/* Built-in method references that are verified to be native. */\n\nvar nativeCreate = _getNative(Object, 'create');\n\nvar _nativeCreate = nativeCreate;\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n\nfunction hashClear() {\n this.__data__ = _nativeCreate ? _nativeCreate(null) : {};\n this.size = 0;\n}\n\nvar _hashClear = hashClear;\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nvar _hashDelete = hashDelete;\n/** Used to stand-in for `undefined` hash values. */\n\nvar HASH_UNDEFINED$2 = '__lodash_hash_undefined__';\n/** Used for built-in method references. */\n\nvar objectProto$d = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty$b = objectProto$d.hasOwnProperty;\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n\nfunction hashGet(key) {\n var data = this.__data__;\n\n if (_nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED$2 ? undefined : result;\n }\n\n return hasOwnProperty$b.call(data, key) ? data[key] : undefined;\n}\n\nvar _hashGet = hashGet;\n/** Used for built-in method references. */\n\nvar objectProto$c = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty$a = objectProto$c.hasOwnProperty;\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n\nfunction hashHas(key) {\n var data = this.__data__;\n return _nativeCreate ? data[key] !== undefined : hasOwnProperty$a.call(data, key);\n}\n\nvar _hashHas = hashHas;\n/** Used to stand-in for `undefined` hash values. */\n\nvar HASH_UNDEFINED$1 = '__lodash_hash_undefined__';\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = _nativeCreate && value === undefined ? HASH_UNDEFINED$1 : value;\n return this;\n}\n\nvar _hashSet = hashSet;\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n this.clear();\n\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n} // Add methods to `Hash`.\n\n\nHash.prototype.clear = _hashClear;\nHash.prototype['delete'] = _hashDelete;\nHash.prototype.get = _hashGet;\nHash.prototype.has = _hashHas;\nHash.prototype.set = _hashSet;\nvar _Hash = Hash;\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new _Hash(),\n 'map': new (_Map || _ListCache)(),\n 'string': new _Hash()\n };\n}\n\nvar _mapCacheClear = mapCacheClear;\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n\nfunction isKeyable(value) {\n var type = _typeof2(value);\n\n return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;\n}\n\nvar _isKeyable = isKeyable;\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n\nfunction getMapData(map, key) {\n var data = map.__data__;\n return _isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;\n}\n\nvar _getMapData = getMapData;\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n\nfunction mapCacheDelete(key) {\n var result = _getMapData(this, key)['delete'](key);\n\n this.size -= result ? 1 : 0;\n return result;\n}\n\nvar _mapCacheDelete = mapCacheDelete;\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n\nfunction mapCacheGet(key) {\n return _getMapData(this, key).get(key);\n}\n\nvar _mapCacheGet = mapCacheGet;\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n\nfunction mapCacheHas(key) {\n return _getMapData(this, key).has(key);\n}\n\nvar _mapCacheHas = mapCacheHas;\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n\nfunction mapCacheSet(key, value) {\n var data = _getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nvar _mapCacheSet = mapCacheSet;\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n this.clear();\n\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n} // Add methods to `MapCache`.\n\n\nMapCache.prototype.clear = _mapCacheClear;\nMapCache.prototype['delete'] = _mapCacheDelete;\nMapCache.prototype.get = _mapCacheGet;\nMapCache.prototype.has = _mapCacheHas;\nMapCache.prototype.set = _mapCacheSet;\nvar _MapCache = MapCache;\n/** Used as the size to enable large array optimizations. */\n\nvar LARGE_ARRAY_SIZE$1 = 200;\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n\nfunction stackSet(key, value) {\n var data = this.__data__;\n\n if (data instanceof _ListCache) {\n var pairs = data.__data__;\n\n if (!_Map || pairs.length < LARGE_ARRAY_SIZE$1 - 1) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n\n data = this.__data__ = new _MapCache(pairs);\n }\n\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nvar _stackSet = stackSet;\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n\nfunction Stack(entries) {\n var data = this.__data__ = new _ListCache(entries);\n this.size = data.size;\n} // Add methods to `Stack`.\n\n\nStack.prototype.clear = _stackClear;\nStack.prototype['delete'] = _stackDelete;\nStack.prototype.get = _stackGet;\nStack.prototype.has = _stackHas;\nStack.prototype.set = _stackSet;\nvar _Stack = Stack;\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n\n return array;\n}\n\nvar _arrayEach = arrayEach;\n\nvar defineProperty = function () {\n try {\n var func = _getNative(Object, 'defineProperty');\n\n func({}, '', {});\n return func;\n } catch (e) {}\n}();\n\nvar _defineProperty = defineProperty;\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && _defineProperty) {\n _defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nvar _baseAssignValue = baseAssignValue;\n/** Used for built-in method references. */\n\nvar objectProto$b = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty$9 = objectProto$b.hasOwnProperty;\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n\n if (!(hasOwnProperty$9.call(object, key) && eq_1(objValue, value)) || value === undefined && !(key in object)) {\n _baseAssignValue(object, key, value);\n }\n}\n\nvar _assignValue = assignValue;\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n\n if (isNew) {\n _baseAssignValue(object, key, newValue);\n } else {\n _assignValue(object, key, newValue);\n }\n }\n\n return object;\n}\n\nvar _copyObject = copyObject;\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n\n return result;\n}\n\nvar _baseTimes = baseTimes;\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n\nfunction isObjectLike(value) {\n return value != null && _typeof2(value) == 'object';\n}\n\nvar isObjectLike_1 = isObjectLike;\n/** `Object#toString` result references. */\n\nvar argsTag$3 = '[object Arguments]';\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n\nfunction baseIsArguments(value) {\n return isObjectLike_1(value) && _baseGetTag(value) == argsTag$3;\n}\n\nvar _baseIsArguments = baseIsArguments;\n/** Used for built-in method references. */\n\nvar objectProto$a = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty$8 = objectProto$a.hasOwnProperty;\n/** Built-in value references. */\n\nvar propertyIsEnumerable$1 = objectProto$a.propertyIsEnumerable;\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n\nvar isArguments = _baseIsArguments(function () {\n return arguments;\n}()) ? _baseIsArguments : function (value) {\n return isObjectLike_1(value) && hasOwnProperty$8.call(value, 'callee') && !propertyIsEnumerable$1.call(value, 'callee');\n};\nvar isArguments_1 = isArguments;\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n\nvar isArray = Array.isArray;\nvar isArray_1 = isArray;\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\n\nfunction stubFalse() {\n return false;\n}\n\nvar stubFalse_1 = stubFalse;\nvar isBuffer_1 = createCommonjsModule(function (module, exports) {\n /** Detect free variable `exports`. */\n var freeExports = exports && !exports.nodeType && exports;\n /** Detect free variable `module`. */\n\n var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;\n /** Detect the popular CommonJS extension `module.exports`. */\n\n var moduleExports = freeModule && freeModule.exports === freeExports;\n /** Built-in value references. */\n\n var Buffer = moduleExports ? _root.Buffer : undefined;\n /* Built-in method references for those with the same name as other `lodash` methods. */\n\n var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n\n var isBuffer = nativeIsBuffer || stubFalse_1;\n module.exports = isBuffer;\n});\n/** Used as references for various `Number` constants. */\n\nvar MAX_SAFE_INTEGER$1 = 9007199254740991;\n/** Used to detect unsigned integer values. */\n\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n\nfunction isIndex(value, length) {\n var type = _typeof2(value);\n\n length = length == null ? MAX_SAFE_INTEGER$1 : length;\n return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;\n}\n\nvar _isIndex = isIndex;\n/** Used as references for various `Number` constants. */\n\nvar MAX_SAFE_INTEGER = 9007199254740991;\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n\nfunction isLength(value) {\n return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nvar isLength_1 = isLength;\n/** `Object#toString` result references. */\n\nvar argsTag$2 = '[object Arguments]',\n arrayTag$2 = '[object Array]',\n boolTag$3 = '[object Boolean]',\n dateTag$3 = '[object Date]',\n errorTag$2 = '[object Error]',\n funcTag$1 = '[object Function]',\n mapTag$5 = '[object Map]',\n numberTag$3 = '[object Number]',\n objectTag$4 = '[object Object]',\n regexpTag$3 = '[object RegExp]',\n setTag$5 = '[object Set]',\n stringTag$3 = '[object String]',\n weakMapTag$2 = '[object WeakMap]';\nvar arrayBufferTag$3 = '[object ArrayBuffer]',\n dataViewTag$4 = '[object DataView]',\n float32Tag$2 = '[object Float32Array]',\n float64Tag$2 = '[object Float64Array]',\n int8Tag$2 = '[object Int8Array]',\n int16Tag$2 = '[object Int16Array]',\n int32Tag$2 = '[object Int32Array]',\n uint8Tag$2 = '[object Uint8Array]',\n uint8ClampedTag$2 = '[object Uint8ClampedArray]',\n uint16Tag$2 = '[object Uint16Array]',\n uint32Tag$2 = '[object Uint32Array]';\n/** Used to identify `toStringTag` values of typed arrays. */\n\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true;\ntypedArrayTags[argsTag$2] = typedArrayTags[arrayTag$2] = typedArrayTags[arrayBufferTag$3] = typedArrayTags[boolTag$3] = typedArrayTags[dataViewTag$4] = typedArrayTags[dateTag$3] = typedArrayTags[errorTag$2] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$5] = typedArrayTags[numberTag$3] = typedArrayTags[objectTag$4] = typedArrayTags[regexpTag$3] = typedArrayTags[setTag$5] = typedArrayTags[stringTag$3] = typedArrayTags[weakMapTag$2] = false;\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n\nfunction baseIsTypedArray(value) {\n return isObjectLike_1(value) && isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];\n}\n\nvar _baseIsTypedArray = baseIsTypedArray;\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n\nfunction baseUnary(func) {\n return function (value) {\n return func(value);\n };\n}\n\nvar _baseUnary = baseUnary;\n\nvar _nodeUtil = createCommonjsModule(function (module, exports) {\n /** Detect free variable `exports`. */\n var freeExports = exports && !exports.nodeType && exports;\n /** Detect free variable `module`. */\n\n var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;\n /** Detect the popular CommonJS extension `module.exports`. */\n\n var moduleExports = freeModule && freeModule.exports === freeExports;\n /** Detect free variable `process` from Node.js. */\n\n var freeProcess = moduleExports && _freeGlobal.process;\n /** Used to access faster Node.js helpers. */\n\n var nodeUtil = function () {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n } // Legacy `process.binding('util')` for Node.js < 10.\n\n\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }();\n\n module.exports = nodeUtil;\n});\n/* Node.js helper references. */\n\n\nvar nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n\nvar isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;\nvar isTypedArray_1 = isTypedArray;\n/** Used for built-in method references. */\n\nvar objectProto$9 = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty$7 = objectProto$9.hasOwnProperty;\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray_1(value),\n isArg = !isArr && isArguments_1(value),\n isBuff = !isArr && !isArg && isBuffer_1(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? _baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty$7.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers.\n isBuff && (key == 'offset' || key == 'parent') || // PhantomJS 2 has enumerable non-index properties on typed arrays.\n isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || // Skip index properties.\n _isIndex(key, length)))) {\n result.push(key);\n }\n }\n\n return result;\n}\n\nvar _arrayLikeKeys = arrayLikeKeys;\n/** Used for built-in method references. */\n\nvar objectProto$8 = Object.prototype;\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = typeof Ctor == 'function' && Ctor.prototype || objectProto$8;\n return value === proto;\n}\n\nvar _isPrototype = isPrototype;\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n\nfunction overArg(func, transform) {\n return function (arg) {\n return func(transform(arg));\n };\n}\n\nvar _overArg = overArg;\n/* Built-in method references for those with the same name as other `lodash` methods. */\n\nvar nativeKeys = _overArg(Object.keys, Object);\n\nvar _nativeKeys = nativeKeys;\n/** Used for built-in method references. */\n\nvar objectProto$7 = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty$6 = objectProto$7.hasOwnProperty;\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n\nfunction baseKeys(object) {\n if (!_isPrototype(object)) {\n return _nativeKeys(object);\n }\n\n var result = [];\n\n for (var key in Object(object)) {\n if (hasOwnProperty$6.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n\n return result;\n}\n\nvar _baseKeys = baseKeys;\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n\nfunction isArrayLike(value) {\n return value != null && isLength_1(value.length) && !isFunction_1(value);\n}\n\nvar isArrayLike_1 = isArrayLike;\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n\nfunction keys(object) {\n return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object);\n}\n\nvar keys_1 = keys;\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n\nfunction baseAssign(object, source) {\n return object && _copyObject(source, keys_1(source), object);\n}\n\nvar _baseAssign = baseAssign;\n/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n\nfunction nativeKeysIn(object) {\n var result = [];\n\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n\n return result;\n}\n\nvar _nativeKeysIn = nativeKeysIn;\n/** Used for built-in method references. */\n\nvar objectProto$6 = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty$5 = objectProto$6.hasOwnProperty;\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n\nfunction baseKeysIn(object) {\n if (!isObject_1(object)) {\n return _nativeKeysIn(object);\n }\n\n var isProto = _isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty$5.call(object, key)))) {\n result.push(key);\n }\n }\n\n return result;\n}\n\nvar _baseKeysIn = baseKeysIn;\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n\nfunction keysIn(object) {\n return isArrayLike_1(object) ? _arrayLikeKeys(object, true) : _baseKeysIn(object);\n}\n\nvar keysIn_1 = keysIn;\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n\nfunction baseAssignIn(object, source) {\n return object && _copyObject(source, keysIn_1(source), object);\n}\n\nvar _baseAssignIn = baseAssignIn;\n\nvar _cloneBuffer = createCommonjsModule(function (module, exports) {\n /** Detect free variable `exports`. */\n var freeExports = exports && !exports.nodeType && exports;\n /** Detect free variable `module`. */\n\n var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;\n /** Detect the popular CommonJS extension `module.exports`. */\n\n var moduleExports = freeModule && freeModule.exports === freeExports;\n /** Built-in value references. */\n\n var Buffer = moduleExports ? _root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n buffer.copy(result);\n return result;\n }\n\n module.exports = cloneBuffer;\n});\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n\n\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n array || (array = Array(length));\n\n while (++index < length) {\n array[index] = source[index];\n }\n\n return array;\n}\n\nvar _copyArray = copyArray;\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n\n return result;\n}\n\nvar _arrayFilter = arrayFilter;\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\n\nfunction stubArray() {\n return [];\n}\n\nvar stubArray_1 = stubArray;\n/** Used for built-in method references. */\n\nvar objectProto$5 = Object.prototype;\n/** Built-in value references. */\n\nvar propertyIsEnumerable = objectProto$5.propertyIsEnumerable;\n/* Built-in method references for those with the same name as other `lodash` methods. */\n\nvar nativeGetSymbols$1 = Object.getOwnPropertySymbols;\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n\nvar getSymbols = !nativeGetSymbols$1 ? stubArray_1 : function (object) {\n if (object == null) {\n return [];\n }\n\n object = Object(object);\n return _arrayFilter(nativeGetSymbols$1(object), function (symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\nvar _getSymbols = getSymbols;\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n\nfunction copySymbols(source, object) {\n return _copyObject(source, _getSymbols(source), object);\n}\n\nvar _copySymbols = copySymbols;\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n\n return array;\n}\n\nvar _arrayPush = arrayPush;\n/** Built-in value references. */\n\nvar getPrototype = _overArg(Object.getPrototypeOf, Object);\n\nvar _getPrototype = getPrototype;\n/* Built-in method references for those with the same name as other `lodash` methods. */\n\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n\nvar getSymbolsIn = !nativeGetSymbols ? stubArray_1 : function (object) {\n var result = [];\n\n while (object) {\n _arrayPush(result, _getSymbols(object));\n\n object = _getPrototype(object);\n }\n\n return result;\n};\nvar _getSymbolsIn = getSymbolsIn;\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n\nfunction copySymbolsIn(source, object) {\n return _copyObject(source, _getSymbolsIn(source), object);\n}\n\nvar _copySymbolsIn = copySymbolsIn;\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray_1(object) ? result : _arrayPush(result, symbolsFunc(object));\n}\n\nvar _baseGetAllKeys = baseGetAllKeys;\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n\nfunction getAllKeys(object) {\n return _baseGetAllKeys(object, keys_1, _getSymbols);\n}\n\nvar _getAllKeys = getAllKeys;\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n\nfunction getAllKeysIn(object) {\n return _baseGetAllKeys(object, keysIn_1, _getSymbolsIn);\n}\n\nvar _getAllKeysIn = getAllKeysIn;\n/* Built-in method references that are verified to be native. */\n\nvar DataView = _getNative(_root, 'DataView');\n\nvar _DataView = DataView;\n/* Built-in method references that are verified to be native. */\n\nvar Promise$1 = _getNative(_root, 'Promise');\n\nvar _Promise = Promise$1;\n/* Built-in method references that are verified to be native. */\n\nvar Set = _getNative(_root, 'Set');\n\nvar _Set = Set;\n/* Built-in method references that are verified to be native. */\n\nvar WeakMap = _getNative(_root, 'WeakMap');\n\nvar _WeakMap = WeakMap;\n/** `Object#toString` result references. */\n\nvar mapTag$4 = '[object Map]',\n objectTag$3 = '[object Object]',\n promiseTag = '[object Promise]',\n setTag$4 = '[object Set]',\n weakMapTag$1 = '[object WeakMap]';\nvar dataViewTag$3 = '[object DataView]';\n/** Used to detect maps, sets, and weakmaps. */\n\nvar dataViewCtorString = _toSource(_DataView),\n mapCtorString = _toSource(_Map),\n promiseCtorString = _toSource(_Promise),\n setCtorString = _toSource(_Set),\n weakMapCtorString = _toSource(_WeakMap);\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n\n\nvar getTag = _baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n\nif (_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag$3 || _Map && getTag(new _Map()) != mapTag$4 || _Promise && getTag(_Promise.resolve()) != promiseTag || _Set && getTag(new _Set()) != setTag$4 || _WeakMap && getTag(new _WeakMap()) != weakMapTag$1) {\n getTag = function getTag(value) {\n var result = _baseGetTag(value),\n Ctor = result == objectTag$3 ? value.constructor : undefined,\n ctorString = Ctor ? _toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString:\n return dataViewTag$3;\n\n case mapCtorString:\n return mapTag$4;\n\n case promiseCtorString:\n return promiseTag;\n\n case setCtorString:\n return setTag$4;\n\n case weakMapCtorString:\n return weakMapTag$1;\n }\n }\n\n return result;\n };\n}\n\nvar _getTag = getTag;\n/** Used for built-in method references. */\n\nvar objectProto$4 = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty$4 = objectProto$4.hasOwnProperty;\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length); // Add properties assigned by `RegExp#exec`.\n\n if (length && typeof array[0] == 'string' && hasOwnProperty$4.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n\n return result;\n}\n\nvar _initCloneArray = initCloneArray;\n/** Built-in value references. */\n\nvar Uint8Array = _root.Uint8Array;\nvar _Uint8Array = Uint8Array;\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new _Uint8Array(result).set(new _Uint8Array(arrayBuffer));\n return result;\n}\n\nvar _cloneArrayBuffer = cloneArrayBuffer;\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? _cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nvar _cloneDataView = cloneDataView;\n/** Used to match `RegExp` flags from their coerced string values. */\n\nvar reFlags = /\\w*$/;\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nvar _cloneRegExp = cloneRegExp;\n/** Used to convert symbols to primitives and strings. */\n\nvar symbolProto$2 = _Symbol ? _Symbol.prototype : undefined,\n symbolValueOf$1 = symbolProto$2 ? symbolProto$2.valueOf : undefined;\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n\nfunction cloneSymbol(symbol) {\n return symbolValueOf$1 ? Object(symbolValueOf$1.call(symbol)) : {};\n}\n\nvar _cloneSymbol = cloneSymbol;\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? _cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nvar _cloneTypedArray = cloneTypedArray;\n/** `Object#toString` result references. */\n\nvar boolTag$2 = '[object Boolean]',\n dateTag$2 = '[object Date]',\n mapTag$3 = '[object Map]',\n numberTag$2 = '[object Number]',\n regexpTag$2 = '[object RegExp]',\n setTag$3 = '[object Set]',\n stringTag$2 = '[object String]',\n symbolTag$3 = '[object Symbol]';\nvar arrayBufferTag$2 = '[object ArrayBuffer]',\n dataViewTag$2 = '[object DataView]',\n float32Tag$1 = '[object Float32Array]',\n float64Tag$1 = '[object Float64Array]',\n int8Tag$1 = '[object Int8Array]',\n int16Tag$1 = '[object Int16Array]',\n int32Tag$1 = '[object Int32Array]',\n uint8Tag$1 = '[object Uint8Array]',\n uint8ClampedTag$1 = '[object Uint8ClampedArray]',\n uint16Tag$1 = '[object Uint16Array]',\n uint32Tag$1 = '[object Uint32Array]';\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n\n switch (tag) {\n case arrayBufferTag$2:\n return _cloneArrayBuffer(object);\n\n case boolTag$2:\n case dateTag$2:\n return new Ctor(+object);\n\n case dataViewTag$2:\n return _cloneDataView(object, isDeep);\n\n case float32Tag$1:\n case float64Tag$1:\n case int8Tag$1:\n case int16Tag$1:\n case int32Tag$1:\n case uint8Tag$1:\n case uint8ClampedTag$1:\n case uint16Tag$1:\n case uint32Tag$1:\n return _cloneTypedArray(object, isDeep);\n\n case mapTag$3:\n return new Ctor();\n\n case numberTag$2:\n case stringTag$2:\n return new Ctor(object);\n\n case regexpTag$2:\n return _cloneRegExp(object);\n\n case setTag$3:\n return new Ctor();\n\n case symbolTag$3:\n return _cloneSymbol(object);\n }\n}\n\nvar _initCloneByTag = initCloneByTag;\n/** Built-in value references. */\n\nvar objectCreate = Object.create;\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n\nvar baseCreate = function () {\n function object() {}\n\n return function (proto) {\n if (!isObject_1(proto)) {\n return {};\n }\n\n if (objectCreate) {\n return objectCreate(proto);\n }\n\n object.prototype = proto;\n var result = new object();\n object.prototype = undefined;\n return result;\n };\n}();\n\nvar _baseCreate = baseCreate;\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n\nfunction initCloneObject(object) {\n return typeof object.constructor == 'function' && !_isPrototype(object) ? _baseCreate(_getPrototype(object)) : {};\n}\n\nvar _initCloneObject = initCloneObject;\n/** `Object#toString` result references. */\n\nvar mapTag$2 = '[object Map]';\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n\nfunction baseIsMap(value) {\n return isObjectLike_1(value) && _getTag(value) == mapTag$2;\n}\n\nvar _baseIsMap = baseIsMap;\n/* Node.js helper references. */\n\nvar nodeIsMap = _nodeUtil && _nodeUtil.isMap;\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n\nvar isMap = nodeIsMap ? _baseUnary(nodeIsMap) : _baseIsMap;\nvar isMap_1 = isMap;\n/** `Object#toString` result references. */\n\nvar setTag$2 = '[object Set]';\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n\nfunction baseIsSet(value) {\n return isObjectLike_1(value) && _getTag(value) == setTag$2;\n}\n\nvar _baseIsSet = baseIsSet;\n/* Node.js helper references. */\n\nvar nodeIsSet = _nodeUtil && _nodeUtil.isSet;\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n\nvar isSet = nodeIsSet ? _baseUnary(nodeIsSet) : _baseIsSet;\nvar isSet_1 = isSet;\n/** Used to compose bitmasks for cloning. */\n\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG$1 = 4;\n/** `Object#toString` result references. */\n\nvar argsTag$1 = '[object Arguments]',\n arrayTag$1 = '[object Array]',\n boolTag$1 = '[object Boolean]',\n dateTag$1 = '[object Date]',\n errorTag$1 = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag$1 = '[object Map]',\n numberTag$1 = '[object Number]',\n objectTag$2 = '[object Object]',\n regexpTag$1 = '[object RegExp]',\n setTag$1 = '[object Set]',\n stringTag$1 = '[object String]',\n symbolTag$2 = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\nvar arrayBufferTag$1 = '[object ArrayBuffer]',\n dataViewTag$1 = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n/** Used to identify `toStringTag` values supported by `_.clone`. */\n\nvar cloneableTags = {};\ncloneableTags[argsTag$1] = cloneableTags[arrayTag$1] = cloneableTags[arrayBufferTag$1] = cloneableTags[dataViewTag$1] = cloneableTags[boolTag$1] = cloneableTags[dateTag$1] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag$1] = cloneableTags[numberTag$1] = cloneableTags[objectTag$2] = cloneableTags[regexpTag$1] = cloneableTags[setTag$1] = cloneableTags[stringTag$1] = cloneableTags[symbolTag$2] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag$1] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG$1;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n\n if (result !== undefined) {\n return result;\n }\n\n if (!isObject_1(value)) {\n return value;\n }\n\n var isArr = isArray_1(value);\n\n if (isArr) {\n result = _initCloneArray(value);\n\n if (!isDeep) {\n return _copyArray(value, result);\n }\n } else {\n var tag = _getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer_1(value)) {\n return _cloneBuffer(value, isDeep);\n }\n\n if (tag == objectTag$2 || tag == argsTag$1 || isFunc && !object) {\n result = isFlat || isFunc ? {} : _initCloneObject(value);\n\n if (!isDeep) {\n return isFlat ? _copySymbolsIn(value, _baseAssignIn(result, value)) : _copySymbols(value, _baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n\n result = _initCloneByTag(value, tag, isDeep);\n }\n } // Check for circular references and return its corresponding clone.\n\n\n stack || (stack = new _Stack());\n var stacked = stack.get(value);\n\n if (stacked) {\n return stacked;\n }\n\n stack.set(value, result);\n\n if (isSet_1(value)) {\n value.forEach(function (subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap_1(value)) {\n value.forEach(function (subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull ? isFlat ? _getAllKeysIn : _getAllKeys : isFlat ? keysIn_1 : keys_1;\n var props = isArr ? undefined : keysFunc(value);\n\n _arrayEach(props || value, function (subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n } // Recursively populate clone (susceptible to call stack limits).\n\n\n _assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n\n return result;\n}\n\nvar _baseClone = baseClone;\n/** Used to compose bitmasks for cloning. */\n\nvar CLONE_SYMBOLS_FLAG = 4;\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n\nfunction clone(value) {\n return _baseClone(value, CLONE_SYMBOLS_FLAG);\n}\n\nvar clone_1 = clone;\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n\nfunction assignMergeValue(object, key, value) {\n if (value !== undefined && !eq_1(object[key], value) || value === undefined && !(key in object)) {\n _baseAssignValue(object, key, value);\n }\n}\n\nvar _assignMergeValue = assignMergeValue;\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n\nfunction createBaseFor(fromRight) {\n return function (object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n\n return object;\n };\n}\n\nvar _createBaseFor = createBaseFor;\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n\nvar baseFor = _createBaseFor();\n\nvar _baseFor = baseFor;\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n\nfunction isArrayLikeObject(value) {\n return isObjectLike_1(value) && isArrayLike_1(value);\n}\n\nvar isArrayLikeObject_1 = isArrayLikeObject;\n/** `Object#toString` result references. */\n\nvar objectTag$1 = '[object Object]';\n/** Used for built-in method references. */\n\nvar funcProto = Function.prototype,\n objectProto$3 = Object.prototype;\n/** Used to resolve the decompiled source of functions. */\n\nvar funcToString = funcProto.toString;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty$3 = objectProto$3.hasOwnProperty;\n/** Used to infer the `Object` constructor. */\n\nvar objectCtorString = funcToString.call(Object);\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n\nfunction isPlainObject(value) {\n if (!isObjectLike_1(value) || _baseGetTag(value) != objectTag$1) {\n return false;\n }\n\n var proto = _getPrototype(value);\n\n if (proto === null) {\n return true;\n }\n\n var Ctor = hasOwnProperty$3.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;\n}\n\nvar isPlainObject_1 = isPlainObject;\n/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nvar _safeGet = safeGet;\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n\nfunction toPlainObject(value) {\n return _copyObject(value, keysIn_1(value));\n}\n\nvar toPlainObject_1 = toPlainObject;\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = _safeGet(object, key),\n srcValue = _safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n _assignMergeValue(object, key, stacked);\n\n return;\n }\n\n var newValue = customizer ? customizer(objValue, srcValue, key + '', object, source, stack) : undefined;\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray_1(srcValue),\n isBuff = !isArr && isBuffer_1(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray_1(srcValue);\n newValue = srcValue;\n\n if (isArr || isBuff || isTyped) {\n if (isArray_1(objValue)) {\n newValue = objValue;\n } else if (isArrayLikeObject_1(objValue)) {\n newValue = _copyArray(objValue);\n } else if (isBuff) {\n isCommon = false;\n newValue = _cloneBuffer(srcValue, true);\n } else if (isTyped) {\n isCommon = false;\n newValue = _cloneTypedArray(srcValue, true);\n } else {\n newValue = [];\n }\n } else if (isPlainObject_1(srcValue) || isArguments_1(srcValue)) {\n newValue = objValue;\n\n if (isArguments_1(objValue)) {\n newValue = toPlainObject_1(objValue);\n } else if (!isObject_1(objValue) || isFunction_1(objValue)) {\n newValue = _initCloneObject(srcValue);\n }\n } else {\n isCommon = false;\n }\n }\n\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n\n _assignMergeValue(object, key, newValue);\n}\n\nvar _baseMergeDeep = baseMergeDeep;\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n\n _baseFor(source, function (srcValue, key) {\n stack || (stack = new _Stack());\n\n if (isObject_1(srcValue)) {\n _baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n } else {\n var newValue = customizer ? customizer(_safeGet(object, key), srcValue, key + '', object, source, stack) : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n\n _assignMergeValue(object, key, newValue);\n }\n }, keysIn_1);\n}\n\nvar _baseMerge = baseMerge;\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\n\nfunction identity(value) {\n return value;\n}\n\nvar identity_1 = identity;\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0:\n return func.call(thisArg);\n\n case 1:\n return func.call(thisArg, args[0]);\n\n case 2:\n return func.call(thisArg, args[0], args[1]);\n\n case 3:\n return func.call(thisArg, args[0], args[1], args[2]);\n }\n\n return func.apply(thisArg, args);\n}\n\nvar _apply = apply;\n/* Built-in method references for those with the same name as other `lodash` methods. */\n\nvar nativeMax = Math.max;\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? func.length - 1 : start, 0);\n return function () {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n\n index = -1;\n var otherArgs = Array(start + 1);\n\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n\n otherArgs[start] = transform(array);\n return _apply(func, this, otherArgs);\n };\n}\n\nvar _overRest = overRest;\n/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\n\nfunction constant(value) {\n return function () {\n return value;\n };\n}\n\nvar constant_1 = constant;\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n\nvar baseSetToString = !_defineProperty ? identity_1 : function (func, string) {\n return _defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant_1(string),\n 'writable': true\n });\n};\nvar _baseSetToString = baseSetToString;\n/** Used to detect hot functions by number of calls within a span of milliseconds. */\n\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n/* Built-in method references for those with the same name as other `lodash` methods. */\n\nvar nativeNow = Date.now;\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n return function () {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n lastCalled = stamp;\n\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n\n return func.apply(undefined, arguments);\n };\n}\n\nvar _shortOut = shortOut;\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n\nvar setToString = _shortOut(_baseSetToString);\n\nvar _setToString = setToString;\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n\nfunction baseRest(func, start) {\n return _setToString(_overRest(func, start, identity_1), func + '');\n}\n\nvar _baseRest = baseRest;\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n\nfunction isIterateeCall(value, index, object) {\n if (!isObject_1(object)) {\n return false;\n }\n\n var type = _typeof2(index);\n\n if (type == 'number' ? isArrayLike_1(object) && _isIndex(index, object.length) : type == 'string' && index in object) {\n return eq_1(object[index], value);\n }\n\n return false;\n}\n\nvar _isIterateeCall = isIterateeCall;\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n\nfunction createAssigner(assigner) {\n return _baseRest(function (object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n customizer = assigner.length > 3 && typeof customizer == 'function' ? (length--, customizer) : undefined;\n\n if (guard && _isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n\n object = Object(object);\n\n while (++index < length) {\n var source = sources[index];\n\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n\n return object;\n });\n}\n\nvar _createAssigner = createAssigner;\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n\nvar merge = _createAssigner(function (object, source, srcIndex) {\n _baseMerge(object, source, srcIndex);\n});\n\nvar merge_1 = merge;\n/**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n\nfunction customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject_1(objValue) && isObject_1(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n\n _baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n\n stack['delete'](srcValue);\n }\n\n return objValue;\n}\n\nvar _customDefaultsMerge = customDefaultsMerge;\n/**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n\nvar mergeWith = _createAssigner(function (object, source, srcIndex, customizer) {\n _baseMerge(object, source, srcIndex, customizer);\n});\n\nvar mergeWith_1 = mergeWith;\n/**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n\nvar defaultsDeep = _baseRest(function (args) {\n args.push(undefined, _customDefaultsMerge);\n return _apply(mergeWith_1, undefined, args);\n});\n\nvar defaultsDeep_1 = defaultsDeep;\n/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n\n return result;\n}\n\nvar _arrayMap = arrayMap;\n/** Used to stand-in for `undefined` hash values. */\n\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n\n return this;\n}\n\nvar _setCacheAdd = setCacheAdd;\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nvar _setCacheHas = setCacheHas;\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n this.__data__ = new _MapCache();\n\n while (++index < length) {\n this.add(values[index]);\n }\n} // Add methods to `SetCache`.\n\n\nSetCache.prototype.add = SetCache.prototype.push = _setCacheAdd;\nSetCache.prototype.has = _setCacheHas;\nvar _SetCache = SetCache;\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n\n return false;\n}\n\nvar _arraySome = arraySome;\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nvar _cacheHas = cacheHas;\n/** Used to compose bitmasks for value comparisons. */\n\nvar COMPARE_PARTIAL_FLAG$5 = 1,\n COMPARE_UNORDERED_FLAG$3 = 2;\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n } // Check that cyclic values are equal.\n\n\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n\n var index = -1,\n result = true,\n seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new _SetCache() : undefined;\n stack.set(array, other);\n stack.set(other, array); // Ignore non-index properties.\n\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);\n }\n\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n\n result = false;\n break;\n } // Recursively compare arrays (susceptible to call stack limits).\n\n\n if (seen) {\n if (!_arraySome(other, function (othValue, othIndex) {\n if (!_cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n result = false;\n break;\n }\n }\n\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nvar _equalArrays = equalArrays;\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n map.forEach(function (value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nvar _mapToArray = mapToArray;\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n set.forEach(function (value) {\n result[++index] = value;\n });\n return result;\n}\n\nvar _setToArray = setToArray;\n/** Used to compose bitmasks for value comparisons. */\n\nvar COMPARE_PARTIAL_FLAG$4 = 1,\n COMPARE_UNORDERED_FLAG$2 = 2;\n/** `Object#toString` result references. */\n\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag$1 = '[object Symbol]';\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n/** Used to convert symbols to primitives and strings. */\n\nvar symbolProto$1 = _Symbol ? _Symbol.prototype : undefined,\n symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {\n return false;\n }\n\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if (object.byteLength != other.byteLength || !equalFunc(new _Uint8Array(object), new _Uint8Array(other))) {\n return false;\n }\n\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq_1(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == other + '';\n\n case mapTag:\n var convert = _mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;\n convert || (convert = _setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n } // Assume cyclic values are equal.\n\n\n var stacked = stack.get(object);\n\n if (stacked) {\n return stacked == other;\n }\n\n bitmask |= COMPARE_UNORDERED_FLAG$2; // Recursively compare objects (susceptible to call stack limits).\n\n stack.set(object, other);\n\n var result = _equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n\n stack['delete'](object);\n return result;\n\n case symbolTag$1:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n\n }\n\n return false;\n}\n\nvar _equalByTag = equalByTag;\n/** Used to compose bitmasks for value comparisons. */\n\nvar COMPARE_PARTIAL_FLAG$3 = 1;\n/** Used for built-in method references. */\n\nvar objectProto$2 = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty$2 = objectProto$2.hasOwnProperty;\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,\n objProps = _getAllKeys(object),\n objLength = objProps.length,\n othProps = _getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n\n var index = objLength;\n\n while (index--) {\n var key = objProps[index];\n\n if (!(isPartial ? key in other : hasOwnProperty$2.call(other, key))) {\n return false;\n }\n } // Check that cyclic values are equal.\n\n\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n var skipCtor = isPartial;\n\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);\n } // Recursively compare objects (susceptible to call stack limits).\n\n\n if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {\n result = false;\n break;\n }\n\n skipCtor || (skipCtor = key == 'constructor');\n }\n\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal.\n\n if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nvar _equalObjects = equalObjects;\n/** Used to compose bitmasks for value comparisons. */\n\nvar COMPARE_PARTIAL_FLAG$2 = 1;\n/** `Object#toString` result references. */\n\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n/** Used for built-in method references. */\n\nvar objectProto$1 = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty$1 = objectProto$1.hasOwnProperty;\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray_1(object),\n othIsArr = isArray_1(other),\n objTag = objIsArr ? arrayTag : _getTag(object),\n othTag = othIsArr ? arrayTag : _getTag(other);\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer_1(object)) {\n if (!isBuffer_1(other)) {\n return false;\n }\n\n objIsArr = true;\n objIsObj = false;\n }\n\n if (isSameTag && !objIsObj) {\n stack || (stack = new _Stack());\n return objIsArr || isTypedArray_1(object) ? _equalArrays(object, other, bitmask, customizer, equalFunc, stack) : _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n\n if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {\n var objIsWrapped = objIsObj && hasOwnProperty$1.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty$1.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n stack || (stack = new _Stack());\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n\n if (!isSameTag) {\n return false;\n }\n\n stack || (stack = new _Stack());\n return _equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nvar _baseIsEqualDeep = baseIsEqualDeep;\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n\n if (value == null || other == null || !isObjectLike_1(value) && !isObjectLike_1(other)) {\n return value !== value && other !== other;\n }\n\n return _baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nvar _baseIsEqual = baseIsEqual;\n/** Used to compose bitmasks for value comparisons. */\n\nvar COMPARE_PARTIAL_FLAG$1 = 1,\n COMPARE_UNORDERED_FLAG$1 = 2;\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n\n object = Object(object);\n\n while (index--) {\n var data = matchData[index];\n\n if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {\n return false;\n }\n }\n\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new _Stack();\n\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n\n if (!(result === undefined ? _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) {\n return false;\n }\n }\n }\n\n return true;\n}\n\nvar _baseIsMatch = baseIsMatch;\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n\nfunction isStrictComparable(value) {\n return value === value && !isObject_1(value);\n}\n\nvar _isStrictComparable = isStrictComparable;\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n\nfunction getMatchData(object) {\n var result = keys_1(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n result[length] = [key, value, _isStrictComparable(value)];\n }\n\n return result;\n}\n\nvar _getMatchData = getMatchData;\n/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n\nfunction matchesStrictComparable(key, srcValue) {\n return function (object) {\n if (object == null) {\n return false;\n }\n\n return object[key] === srcValue && (srcValue !== undefined || key in Object(object));\n };\n}\n\nvar _matchesStrictComparable = matchesStrictComparable;\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n\nfunction baseMatches(source) {\n var matchData = _getMatchData(source);\n\n if (matchData.length == 1 && matchData[0][2]) {\n return _matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n\n return function (object) {\n return object === source || _baseIsMatch(object, source, matchData);\n };\n}\n\nvar _baseMatches = baseMatches;\n/** `Object#toString` result references. */\n\nvar symbolTag = '[object Symbol]';\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n\nfunction isSymbol(value) {\n return _typeof2(value) == 'symbol' || isObjectLike_1(value) && _baseGetTag(value) == symbolTag;\n}\n\nvar isSymbol_1 = isSymbol;\n/** Used to match property names within property paths. */\n\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n\nfunction isKey(value, object) {\n if (isArray_1(value)) {\n return false;\n }\n\n var type = _typeof2(value);\n\n if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol_1(value)) {\n return true;\n }\n\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);\n}\n\nvar _isKey = isKey;\n/** Error message constants. */\n\nvar FUNC_ERROR_TEXT = 'Expected a function';\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || resolver != null && typeof resolver != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n\n var memoized = function memoized() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n\n memoized.cache = new (memoize.Cache || _MapCache)();\n return memoized;\n} // Expose `MapCache`.\n\n\nmemoize.Cache = _MapCache;\nvar memoize_1 = memoize;\n/** Used as the maximum memoize cache size. */\n\nvar MAX_MEMOIZE_SIZE = 500;\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n\nfunction memoizeCapped(func) {\n var result = memoize_1(func, function (key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n\n return key;\n });\n var cache = result.cache;\n return result;\n}\n\nvar _memoizeCapped = memoizeCapped;\n/** Used to match property names within property paths. */\n\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n/** Used to match backslashes in property paths. */\n\nvar reEscapeChar = /\\\\(\\\\)?/g;\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n\nvar stringToPath = _memoizeCapped(function (string) {\n var result = [];\n\n if (string.charCodeAt(0) === 46\n /* . */\n ) {\n result.push('');\n }\n\n string.replace(rePropName, function (match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : number || match);\n });\n return result;\n});\n\nvar _stringToPath = stringToPath;\n/** Used as references for various `Number` constants. */\n\nvar INFINITY$1 = 1 / 0;\n/** Used to convert symbols to primitives and strings. */\n\nvar symbolProto = _Symbol ? _Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n\n if (isArray_1(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return _arrayMap(value, baseToString) + '';\n }\n\n if (isSymbol_1(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n\n var result = value + '';\n return result == '0' && 1 / value == -INFINITY$1 ? '-0' : result;\n}\n\nvar _baseToString = baseToString;\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n\nfunction toString(value) {\n return value == null ? '' : _baseToString(value);\n}\n\nvar toString_1 = toString;\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n\nfunction castPath(value, object) {\n if (isArray_1(value)) {\n return value;\n }\n\n return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));\n}\n\nvar _castPath = castPath;\n/** Used as references for various `Number` constants. */\n\nvar INFINITY = 1 / 0;\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol_1(value)) {\n return value;\n }\n\n var result = value + '';\n return result == '0' && 1 / value == -INFINITY ? '-0' : result;\n}\n\nvar _toKey = toKey;\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n\nfunction baseGet(object, path) {\n path = _castPath(path, object);\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[_toKey(path[index++])];\n }\n\n return index && index == length ? object : undefined;\n}\n\nvar _baseGet = baseGet;\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : _baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nvar get_1 = get;\n/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nvar _baseHasIn = baseHasIn;\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n\nfunction hasPath(object, path, hasFunc) {\n path = _castPath(path, object);\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = _toKey(path[index]);\n\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n\n object = object[key];\n }\n\n if (result || ++index != length) {\n return result;\n }\n\n length = object == null ? 0 : object.length;\n return !!length && isLength_1(length) && _isIndex(key, length) && (isArray_1(object) || isArguments_1(object));\n}\n\nvar _hasPath = hasPath;\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n\nfunction hasIn(object, path) {\n return object != null && _hasPath(object, path, _baseHasIn);\n}\n\nvar hasIn_1 = hasIn;\n/** Used to compose bitmasks for value comparisons. */\n\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n\nfunction baseMatchesProperty(path, srcValue) {\n if (_isKey(path) && _isStrictComparable(srcValue)) {\n return _matchesStrictComparable(_toKey(path), srcValue);\n }\n\n return function (object) {\n var objValue = get_1(object, path);\n return objValue === undefined && objValue === srcValue ? hasIn_1(object, path) : _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nvar _baseMatchesProperty = baseMatchesProperty;\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n\nfunction baseProperty(key) {\n return function (object) {\n return object == null ? undefined : object[key];\n };\n}\n\nvar _baseProperty = baseProperty;\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n\nfunction basePropertyDeep(path) {\n return function (object) {\n return _baseGet(object, path);\n };\n}\n\nvar _basePropertyDeep = basePropertyDeep;\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\n\nfunction property(path) {\n return _isKey(path) ? _baseProperty(_toKey(path)) : _basePropertyDeep(path);\n}\n\nvar property_1 = property;\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n\n if (value == null) {\n return identity_1;\n }\n\n if (_typeof2(value) == 'object') {\n return isArray_1(value) ? _baseMatchesProperty(value[0], value[1]) : _baseMatches(value);\n }\n\n return property_1(value);\n}\n\nvar _baseIteratee = baseIteratee;\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n\nfunction baseForOwn(object, iteratee) {\n return object && _baseFor(object, iteratee, keys_1);\n}\n\nvar _baseForOwn = baseForOwn;\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n\nfunction createBaseEach(eachFunc, fromRight) {\n return function (collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n\n if (!isArrayLike_1(collection)) {\n return eachFunc(collection, iteratee);\n }\n\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while (fromRight ? index-- : ++index < length) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n\n return collection;\n };\n}\n\nvar _createBaseEach = createBaseEach;\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n\nvar baseEach = _createBaseEach(_baseForOwn);\n\nvar _baseEach = baseEach;\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike_1(collection) ? Array(collection.length) : [];\n\n _baseEach(collection, function (value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n\n return result;\n}\n\nvar _baseMap = baseMap;\n/**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n\nfunction map(collection, iteratee) {\n var func = isArray_1(collection) ? _arrayMap : _baseMap;\n return func(collection, _baseIteratee(iteratee));\n}\n\nvar map_1 = map;\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n\n return accumulator;\n}\n\nvar _arrayReduce = arrayReduce;\n/**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n\nfunction baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function (value, index, collection) {\n accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n}\n\nvar _baseReduce = baseReduce;\n/**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n\nfunction reduce(collection, iteratee, accumulator) {\n var func = isArray_1(collection) ? _arrayReduce : _baseReduce,\n initAccum = arguments.length < 3;\n return func(collection, _baseIteratee(iteratee), accumulator, initAccum, _baseEach);\n}\n\nvar reduce_1 = reduce;\n/** Used for built-in method references. */\n\nvar objectProto = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty = objectProto.hasOwnProperty;\n/**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n\nfunction baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n}\n\nvar _baseHas = baseHas;\n/**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n\nfunction has(object, path) {\n return object != null && _hasPath(object, path, _baseHas);\n}\n\nvar has_1 = has;\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n\nfunction baseSet(object, path, value, customizer) {\n if (!isObject_1(object)) {\n return object;\n }\n\n path = _castPath(path, object);\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = _toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n\n if (newValue === undefined) {\n newValue = isObject_1(objValue) ? objValue : _isIndex(path[index + 1]) ? [] : {};\n }\n }\n\n _assignValue(nested, key, newValue);\n\n nested = nested[key];\n }\n\n return object;\n}\n\nvar _baseSet = baseSet;\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n\nfunction set(object, path, value) {\n return object == null ? object : _baseSet(object, path, value);\n}\n\nvar set_1 = set;\n/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while (fromRight ? index-- : ++index < length) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n\n return -1;\n}\n\nvar _baseFindIndex = baseFindIndex;\n/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nvar _baseIsNaN = baseIsNaN;\n/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n\n return -1;\n}\n\nvar _strictIndexOf = strictIndexOf;\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value ? _strictIndexOf(array, value, fromIndex) : _baseFindIndex(array, _baseIsNaN, fromIndex);\n}\n\nvar _baseIndexOf = baseIndexOf;\n/**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n\nfunction baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n\n return -1;\n}\n\nvar _baseIndexOfWith = baseIndexOfWith;\n/** Used for built-in method references. */\n\nvar arrayProto = Array.prototype;\n/** Built-in value references. */\n\nvar splice = arrayProto.splice;\n/**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n\nfunction basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? _baseIndexOfWith : _baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = _copyArray(values);\n }\n\n if (iteratee) {\n seen = _arrayMap(array, _baseUnary(iteratee));\n }\n\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n\n splice.call(array, fromIndex, 1);\n }\n }\n\n return array;\n}\n\nvar _basePullAll = basePullAll;\n/**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n\nfunction pullAll(array, values) {\n return array && array.length && values && values.length ? _basePullAll(array, values) : array;\n}\n\nvar pullAll_1 = pullAll;\n/**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n\nvar pull = _baseRest(pullAll_1);\n\nvar pull_1 = pull;\n/**\n * Checks `value` to determine whether a default value should be returned in\n * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,\n * or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Util\n * @param {*} value The value to check.\n * @param {*} defaultValue The default value.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * _.defaultTo(1, 10);\n * // => 1\n *\n * _.defaultTo(undefined, 10);\n * // => 10\n */\n\nfunction defaultTo(value, defaultValue) {\n return value == null || value !== value ? defaultValue : value;\n}\n\nvar defaultTo_1 = defaultTo;\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && _baseIndexOf(array, value, 0) > -1;\n}\n\nvar _arrayIncludes = arrayIncludes;\n/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n\n return false;\n}\n\nvar _arrayIncludesWith = arrayIncludesWith;\n/** Used as the size to enable large array optimizations. */\n\nvar LARGE_ARRAY_SIZE = 200;\n/**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n\nfunction baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = _arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n\n if (iteratee) {\n values = _arrayMap(values, _baseUnary(iteratee));\n }\n\n if (comparator) {\n includes = _arrayIncludesWith;\n isCommon = false;\n } else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = _cacheHas;\n isCommon = false;\n values = new _SetCache(values);\n }\n\n outer: while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n value = comparator || value !== 0 ? value : 0;\n\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n\n result.push(value);\n } else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n\n return result;\n}\n\nvar _baseDifference = baseDifference;\n/** Built-in value references. */\n\nvar spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined;\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n\nfunction isFlattenable(value) {\n return isArray_1(value) || isArguments_1(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nvar _isFlattenable = isFlattenable;\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n predicate || (predicate = _isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n _arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n\n return result;\n}\n\nvar _baseFlatten = baseFlatten;\n/**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n\nvar difference = _baseRest(function (array, values) {\n return isArrayLikeObject_1(array) ? _baseDifference(array, _baseFlatten(values, 1, isArrayLikeObject_1, true)) : [];\n});\n\nvar difference_1 = difference;\n/* Built-in method references for those with the same name as other `lodash` methods. */\n\nvar nativeMin = Math.min;\n/**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n\nfunction baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? _arrayIncludesWith : _arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n\n if (othIndex && iteratee) {\n array = _arrayMap(array, _baseUnary(iteratee));\n }\n\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || length >= 120 && array.length >= 120) ? new _SetCache(othIndex && array) : undefined;\n }\n\n array = arrays[0];\n var index = -1,\n seen = caches[0];\n\n outer: while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n value = comparator || value !== 0 ? value : 0;\n\n if (!(seen ? _cacheHas(seen, computed) : includes(result, computed, comparator))) {\n othIndex = othLength;\n\n while (--othIndex) {\n var cache = caches[othIndex];\n\n if (!(cache ? _cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator))) {\n continue outer;\n }\n }\n\n if (seen) {\n seen.push(computed);\n }\n\n result.push(value);\n }\n }\n\n return result;\n}\n\nvar _baseIntersection = baseIntersection;\n/**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n\nfunction castArrayLikeObject(value) {\n return isArrayLikeObject_1(value) ? value : [];\n}\n\nvar _castArrayLikeObject = castArrayLikeObject;\n/**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n\nvar intersection = _baseRest(function (arrays) {\n var mapped = _arrayMap(arrays, _castArrayLikeObject);\n\n return mapped.length && mapped[0] === arrays[0] ? _baseIntersection(mapped) : [];\n});\n\nvar intersection_1 = intersection;\n/** Used to match a single whitespace character. */\n\nvar reWhitespace = /\\s/;\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\n\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n\n return index;\n}\n\nvar _trimmedEndIndex = trimmedEndIndex;\n/** Used to match leading whitespace. */\n\nvar reTrimStart = /^\\s+/;\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\n\nfunction baseTrim(string) {\n return string ? string.slice(0, _trimmedEndIndex(string) + 1).replace(reTrimStart, '') : string;\n}\n\nvar _baseTrim = baseTrim;\n/** Used as references for various `Number` constants. */\n\nvar NAN$1 = 0 / 0;\n/** Used to detect bad signed hexadecimal string values. */\n\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n/** Used to detect binary string values. */\n\nvar reIsBinary = /^0b[01]+$/i;\n/** Used to detect octal string values. */\n\nvar reIsOctal = /^0o[0-7]+$/i;\n/** Built-in method references without a dependency on `root`. */\n\nvar freeParseInt = parseInt;\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n\n if (isSymbol_1(value)) {\n return NAN$1;\n }\n\n if (isObject_1(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject_1(other) ? other + '' : other;\n }\n\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n\n value = _baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN$1 : +value;\n}\n\nvar toNumber_1 = toNumber;\n/**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n\nfunction baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n\n return result;\n}\n\nvar _baseZipObject = baseZipObject;\n/**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n\nfunction zipObject(props, values) {\n return _baseZipObject(props || [], values || [], _assignValue);\n}\n\nvar zipObject_1 = zipObject;\n/**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n\nfunction baseSortBy(array, comparer) {\n var length = array.length;\n array.sort(comparer);\n\n while (length--) {\n array[length] = array[length].value;\n }\n\n return array;\n}\n\nvar _baseSortBy = baseSortBy;\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol_1(value);\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol_1(other);\n\n if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {\n return 1;\n }\n\n if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {\n return -1;\n }\n }\n\n return 0;\n}\n\nvar _compareAscending = compareAscending;\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n\nfunction compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = _compareAscending(objCriteria[index], othCriteria[index]);\n\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n } // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n\n\n return object.index - other.index;\n}\n\nvar _compareMultiple = compareMultiple;\n/**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n\nfunction baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = _arrayMap(iteratees, function (iteratee) {\n if (isArray_1(iteratee)) {\n return function (value) {\n return _baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n };\n }\n\n return iteratee;\n });\n } else {\n iteratees = [identity_1];\n }\n\n var index = -1;\n iteratees = _arrayMap(iteratees, _baseUnary(_baseIteratee));\n\n var result = _baseMap(collection, function (value, key, collection) {\n var criteria = _arrayMap(iteratees, function (iteratee) {\n return iteratee(value);\n });\n\n return {\n 'criteria': criteria,\n 'index': ++index,\n 'value': value\n };\n });\n\n return _baseSortBy(result, function (object, other) {\n return _compareMultiple(object, other, orders);\n });\n}\n\nvar _baseOrderBy = baseOrderBy;\n/**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\n\nvar sortBy = _baseRest(function (collection, iteratees) {\n if (collection == null) {\n return [];\n }\n\n var length = iteratees.length;\n\n if (length > 1 && _isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && _isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n\n return _baseOrderBy(collection, _baseFlatten(iteratees, 1), []);\n});\n\nvar sortBy_1 = sortBy;\nvar Case = createCommonjsModule(function (module) {\n /*! Case - v1.6.2 - 2020-03-24\n * Copyright (c) 2020 Nathan Bubna; Licensed MIT, GPL */\n (function () {\n var unicodes = function unicodes(s, prefix) {\n prefix = prefix || '';\n return s.replace(/(^|-)/g, \"$1\\\\u\" + prefix).replace(/,/g, \"\\\\u\" + prefix);\n },\n basicSymbols = unicodes('20-26,28-2F,3A-40,5B-60,7B-7E,A0-BF,D7,F7', '00'),\n baseLowerCase = 'a-z' + unicodes('DF-F6,F8-FF', '00'),\n baseUpperCase = 'A-Z' + unicodes('C0-D6,D8-DE', '00'),\n improperInTitle = 'A|An|And|As|At|But|By|En|For|If|In|Of|On|Or|The|To|Vs?\\\\.?|Via',\n regexps = function regexps(symbols, lowers, uppers, impropers) {\n symbols = symbols || basicSymbols;\n lowers = lowers || baseLowerCase;\n uppers = uppers || baseUpperCase;\n impropers = impropers || improperInTitle;\n return {\n capitalize: new RegExp('(^|[' + symbols + '])([' + lowers + '])', 'g'),\n pascal: new RegExp('(^|[' + symbols + '])+([' + lowers + uppers + '])', 'g'),\n fill: new RegExp('[' + symbols + ']+(.|$)', 'g'),\n sentence: new RegExp('(^\\\\s*|[\\\\?\\\\!\\\\.]+\"?\\\\s+\"?|,\\\\s+\")([' + lowers + '])', 'g'),\n improper: new RegExp('\\\\b(' + impropers + ')\\\\b', 'g'),\n relax: new RegExp('([^' + uppers + '])([' + uppers + ']*)([' + uppers + '])(?=[^' + uppers + ']|$)', 'g'),\n upper: new RegExp('^[^' + lowers + ']+$'),\n hole: /[^\\s]\\s[^\\s]/,\n apostrophe: /'/g,\n room: new RegExp('[' + symbols + ']')\n };\n },\n re = regexps(),\n _ = {\n re: re,\n unicodes: unicodes,\n regexps: regexps,\n types: [],\n up: String.prototype.toUpperCase,\n low: String.prototype.toLowerCase,\n cap: function cap(s) {\n return _.up.call(s.charAt(0)) + s.slice(1);\n },\n decap: function decap(s) {\n return _.low.call(s.charAt(0)) + s.slice(1);\n },\n deapostrophe: function deapostrophe(s) {\n return s.replace(re.apostrophe, '');\n },\n fill: function fill(s, _fill, deapostrophe) {\n if (_fill != null) {\n s = s.replace(re.fill, function (m, next) {\n return next ? _fill + next : '';\n });\n }\n\n if (deapostrophe) {\n s = _.deapostrophe(s);\n }\n\n return s;\n },\n prep: function prep(s, fill, pascal, upper) {\n s = s == null ? '' : s + ''; // force to string\n\n if (!upper && re.upper.test(s)) {\n s = _.low.call(s);\n }\n\n if (!fill && !re.hole.test(s)) {\n var holey = _.fill(s, ' ');\n\n if (re.hole.test(holey)) {\n s = holey;\n }\n }\n\n if (!pascal && !re.room.test(s)) {\n s = s.replace(re.relax, _.relax);\n }\n\n return s;\n },\n relax: function relax(m, before, acronym, caps) {\n return before + ' ' + (acronym ? acronym + ' ' : '') + caps;\n }\n },\n Case = {\n _: _,\n of: function of(s) {\n for (var i = 0, m = _.types.length; i < m; i++) {\n if (Case[_.types[i]].apply(Case, arguments) === s) {\n return _.types[i];\n }\n }\n },\n flip: function flip(s) {\n return s.replace(/\\w/g, function (l) {\n return (l == _.up.call(l) ? _.low : _.up).call(l);\n });\n },\n random: function random(s) {\n return s.replace(/\\w/g, function (l) {\n return (Math.round(Math.random()) ? _.up : _.low).call(l);\n });\n },\n type: function type(_type, fn) {\n Case[_type] = fn;\n\n _.types.push(_type);\n }\n },\n types = {\n lower: function lower(s, fill, deapostrophe) {\n return _.fill(_.low.call(_.prep(s, fill)), fill, deapostrophe);\n },\n snake: function snake(s) {\n return Case.lower(s, '_', true);\n },\n constant: function constant(s) {\n return Case.upper(s, '_', true);\n },\n camel: function camel(s) {\n return _.decap(Case.pascal(s));\n },\n kebab: function kebab(s) {\n return Case.lower(s, '-', true);\n },\n upper: function upper(s, fill, deapostrophe) {\n return _.fill(_.up.call(_.prep(s, fill, false, true)), fill, deapostrophe);\n },\n capital: function capital(s, fill, deapostrophe) {\n return _.fill(_.prep(s).replace(re.capitalize, function (m, border, letter) {\n return border + _.up.call(letter);\n }), fill, deapostrophe);\n },\n header: function header(s) {\n return Case.capital(s, '-', true);\n },\n pascal: function pascal(s) {\n return _.fill(_.prep(s, false, true).replace(re.pascal, function (m, border, letter) {\n return _.up.call(letter);\n }), '', true);\n },\n title: function title(s) {\n return Case.capital(s).replace(re.improper, function (small, p, i, s) {\n return i > 0 && i < s.lastIndexOf(' ') ? _.low.call(small) : small;\n });\n },\n sentence: function sentence(s, names, abbreviations) {\n s = Case.lower(s).replace(re.sentence, function (m, prelude, letter) {\n return prelude + _.up.call(letter);\n });\n\n if (names) {\n names.forEach(function (name) {\n s = s.replace(new RegExp('\\\\b' + Case.lower(name) + '\\\\b', \"g\"), _.cap);\n });\n }\n\n if (abbreviations) {\n abbreviations.forEach(function (abbr) {\n s = s.replace(new RegExp('(\\\\b' + Case.lower(abbr) + '\\\\. +)(\\\\w)'), function (m, abbrAndSpace, letter) {\n return abbrAndSpace + _.low.call(letter);\n });\n });\n }\n\n return s;\n }\n }; // TODO: Remove \"squish\" in a future breaking release.\n\n\n types.squish = types.pascal; // Allow import default\n\n Case[\"default\"] = Case;\n\n for (var type in types) {\n Case.type(type, types[type]);\n } // export Case (AMD, commonjs, or global)\n\n\n var define = typeof define === \"function\" ? define : function () {};\n define(module.exports ? module.exports = Case : this.Case = Case);\n }).call(commonjsGlobal);\n});\n/**\n * Converts `string`, as a whole, to upper case just like\n * [String#toUpperCase](https://mdn.io/toUpperCase).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the upper cased string.\n * @example\n *\n * _.toUpper('--foo-bar--');\n * // => '--FOO-BAR--'\n *\n * _.toUpper('fooBar');\n * // => 'FOOBAR'\n *\n * _.toUpper('__foo_bar__');\n * // => '__FOO_BAR__'\n */\n\nfunction toUpper(value) {\n return toString_1(value).toUpperCase();\n}\n\nvar toUpper_1 = toUpper;\n/**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n\nfunction baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n\n return number;\n}\n\nvar _baseClamp = baseClamp;\n/**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n\nfunction clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n\n if (upper !== undefined) {\n upper = toNumber_1(upper);\n upper = upper === upper ? upper : 0;\n }\n\n if (lower !== undefined) {\n lower = toNumber_1(lower);\n lower = lower === lower ? lower : 0;\n }\n\n return _baseClamp(toNumber_1(number), lower, upper);\n}\n\nvar clamp_1 = clamp;\n/**\n * Utility functions mixin for Riot tags.\n *\n * TODO: Extract these and just compose them here for the mixin.\n */\n\nvar util = {\n /**\n * Convert a string to title case.\n *\n * TODO: This could really be enhanced!\n *\n * @param {string} string\n * @return {string}\n */\n sentenceCase: function sentenceCase(string) {\n return Case.sentence(string);\n },\n\n /**\n * Convert a string to upper case.\n *\n * @param {string} string\n * @return {string}\n */\n upperCase: function upperCase(string) {\n return toUpper_1(string);\n },\n\n /**\n * Clamp a value.\n *\n * TODO: Seems to be redundant.\n *\n * @param {number} value\n * @param {number} min\n * @param {number} max\n * @return {string|number}\n */\n clamp: function clamp(value, min, max) {\n return clamp_1(value, min, max);\n },\n\n /**\n * Determine whether a value is numeric.\n *\n * @param {*} value\n * @return boolean\n */\n isNumeric: function isNumeric(value) {\n return (typeof value === 'number' || typeof value === 'string') && !isNaN(parseFloat(value)) && isFinite(value);\n }\n};\n/**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n\nfunction baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n\n if (current !== undefined) {\n result = result === undefined ? current : result + current;\n }\n }\n\n return result;\n}\n\nvar _baseSum = baseSum;\n/**\n * Computes the sum of the values in `array`.\n *\n * @static\n * @memberOf _\n * @since 3.4.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {number} Returns the sum.\n * @example\n *\n * _.sum([4, 2, 8, 6]);\n * // => 20\n */\n\nfunction sum$1(array) {\n return array && array.length ? _baseSum(array, identity_1) : 0;\n}\n\nvar sum_1 = sum$1;\n\nfunction sum() {\n for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {\n values[_key] = arguments[_key];\n }\n\n return sum_1(values);\n}\n/**\n * This method is like `_.sum` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the value to be summed.\n * The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the sum.\n * @example\n *\n * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];\n *\n * _.sumBy(objects, function(o) { return o.n; });\n * // => 20\n *\n * // The `_.property` iteratee shorthand.\n * _.sumBy(objects, 'n');\n * // => 20\n */\n\n\nfunction sumBy(array, iteratee) {\n return array && array.length ? _baseSum(array, _baseIteratee(iteratee)) : 0;\n}\n\nvar sumBy_1 = sumBy;\n/** Used as references for various `Number` constants. */\n\nvar NAN = 0 / 0;\n/**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n\nfunction baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n\n if (isSymbol_1(value)) {\n return NAN;\n }\n\n return +value;\n}\n\nvar _baseToNumber = baseToNumber;\n/**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n\nfunction createMathOperation(operator, defaultValue) {\n return function (value, other) {\n var result;\n\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n\n if (value !== undefined) {\n result = value;\n }\n\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n\n if (typeof value == 'string' || typeof other == 'string') {\n value = _baseToString(value);\n other = _baseToString(other);\n } else {\n value = _baseToNumber(value);\n other = _baseToNumber(other);\n }\n\n result = operator(value, other);\n }\n\n return result;\n };\n}\n\nvar _createMathOperation = createMathOperation;\n/**\n * Multiply two numbers.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Math\n * @param {number} multiplier The first number in a multiplication.\n * @param {number} multiplicand The second number in a multiplication.\n * @returns {number} Returns the product.\n * @example\n *\n * _.multiply(6, 4);\n * // => 24\n */\n\nvar multiply = _createMathOperation(function (multiplier, multiplicand) {\n return multiplier * multiplicand;\n}, 1);\n\nvar multiply_1 = multiply;\n/**\n * Build a dictionary from a list of objects.\n *\n * @param {Object[]} objects - The objects to make a dictionary from.\n * @param {string} [key='path'] - The property to key each object by.\n * @return {Object.} The dictionary of objects.\n */\n\nfunction _buildDictionary(objects) {\n var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'path';\n var dictionary = {};\n\n if (!Array.isArray(objects)) {\n return dictionary;\n }\n\n for (var i = 0; i < objects.length; i++) {\n if (!objects[i] || !objects[i][key]) {\n continue;\n }\n\n dictionary[objects[i][key]] = objects[i];\n }\n\n return dictionary;\n}\n/**\n * Build a property tree from a dictionary of fields.\n *\n * @param {FieldDictionary} dictionary\n * @returns {Field}\n */\n\n\nfunction _buildTree(dictionary) {\n // Let's make a tree out of a dictionary\n var tree = {\n path: '',\n children: []\n }; // Bail early on an empty dictionary\n\n if (!dictionary) {\n return tree;\n } // Make sure the root is available as a parent in the dictionary\n\n\n if (dictionary['']) {\n tree = dictionary[''];\n } else {\n dictionary[''] = tree;\n }\n\n var path, field, parent; // Link up properties to their parents, placing any properties without\n // parents into the children of our tree\n\n for (path in dictionary) {\n field = dictionary[path]; // Skip the root node silently\n\n if (field === tree) {\n continue;\n }\n\n if (!field || field.path == null || path !== field.path) {\n // You're weird and don't belong in our tree, bye Felicia\n // TODO: \"path\" could be valid here, set it to field.path if so\n console.warn(\"Skipped field without path\", field);\n continue;\n }\n\n if (field.parent == null) {\n // You don't have an explicitly defined parent, bye Felicia\n // TODO: Add to root?\n console.warn(\"Skipped field '\".concat(path, \"'; it has no parent\"));\n continue;\n }\n\n parent = dictionary[field.parent];\n\n if (!parent) {\n // Sorry, you're an orphan, you don't get into the tree\n // TODO: Be nice and create a parent for them?\n console.warn(\"Orphaned field '\".concat(path, \"'\"));\n continue;\n }\n\n parent.children = parent.children || [];\n\n if (!parent.children.includes(field)) {\n parent.children.push(field);\n }\n }\n\n return tree;\n}\n/**\n * Traverse a tree.\n *\n * TODO: Visitor object? Could have multiple pre/post callbacks.\n *\n * Traversal of children can be halted by returning false from the pre-order\n * operation function.\n *\n * @param {Object} node - The node to traverse.\n * @param {Function} pre - Pre-order operation.\n * @param {Function} post - Post-order operation.\n */\n\n\nfunction traverseTree(node) {\n var pre = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var post = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n if (!node) {\n return;\n }\n\n var result;\n\n if (isFunction_1(pre)) {\n result = pre(node);\n\n if (result === false) {\n return;\n }\n }\n\n var children = node.children || [];\n\n for (var i = 0; i < children.length; i++) {\n traverseTree(children[i], pre, post);\n }\n\n if (isFunction_1(post)) {\n post(node);\n }\n}\n/**\n * Split a field path into its \"parent path\" and \"key\" segments.\n *\n * @param {string} path - The field path to split.\n * @param {string} [delimiter='.'] - The path delimiter to use.\n * @return {string[]} [parentPath, key]\n */\n\n\nfunction splitPath(path) {\n var delimiter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.';\n var parentPath, key;\n var lastDelimiterIndex = path.lastIndexOf(delimiter);\n\n if (lastDelimiterIndex < 1) {\n parentPath = '';\n key = path;\n } else {\n parentPath = path.substring(0, lastDelimiterIndex);\n key = path.substring(lastDelimiterIndex + 1);\n }\n\n return [parentPath, key];\n}\n/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n\n\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : length + start;\n }\n\n end = end > length ? length : end;\n\n if (end < 0) {\n end += length;\n }\n\n length = start > end ? 0 : end - start >>> 0;\n start >>>= 0;\n var result = Array(length);\n\n while (++index < length) {\n result[index] = array[index + start];\n }\n\n return result;\n}\n\nvar _baseSlice = baseSlice;\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n\nfunction castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return !start && end >= length ? array : _baseSlice(array, start, end);\n}\n\nvar _castSlice = castSlice;\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n\nfunction charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && _baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n\n return index;\n}\n\nvar _charsEndIndex = charsEndIndex;\n/**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n\nfunction charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && _baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n\n return index;\n}\n\nvar _charsStartIndex = charsStartIndex;\n/**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n\nfunction asciiToArray(string) {\n return string.split('');\n}\n\nvar _asciiToArray = asciiToArray;\n/** Used to compose unicode character classes. */\n\nvar rsAstralRange$1 = \"\\\\ud800-\\\\udfff\",\n rsComboMarksRange$1 = \"\\\\u0300-\\\\u036f\",\n reComboHalfMarksRange$1 = \"\\\\ufe20-\\\\ufe2f\",\n rsComboSymbolsRange$1 = \"\\\\u20d0-\\\\u20ff\",\n rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1,\n rsVarRange$1 = \"\\\\ufe0e\\\\ufe0f\";\n/** Used to compose unicode capture groups. */\n\nvar rsZWJ$1 = \"\\\\u200d\";\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\n\nvar reHasUnicode = RegExp('[' + rsZWJ$1 + rsAstralRange$1 + rsComboRange$1 + rsVarRange$1 + ']');\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\nvar _hasUnicode = hasUnicode;\n/** Used to compose unicode character classes. */\n\nvar rsAstralRange = \"\\\\ud800-\\\\udfff\",\n rsComboMarksRange = \"\\\\u0300-\\\\u036f\",\n reComboHalfMarksRange = \"\\\\ufe20-\\\\ufe2f\",\n rsComboSymbolsRange = \"\\\\u20d0-\\\\u20ff\",\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = \"\\\\ufe0e\\\\ufe0f\";\n/** Used to compose unicode capture groups. */\n\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = \"\\\\ud83c[\\\\udffb-\\\\udfff]\",\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = \"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\",\n rsSurrPair = \"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\",\n rsZWJ = \"\\\\u200d\";\n/** Used to compose unicode regexes. */\n\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n/**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n\nfunction unicodeToArray(string) {\n return string.match(reUnicode) || [];\n}\n\nvar _unicodeToArray = unicodeToArray;\n/**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n\nfunction stringToArray(string) {\n return _hasUnicode(string) ? _unicodeToArray(string) : _asciiToArray(string);\n}\n\nvar _stringToArray = stringToArray;\n/**\n * Removes leading and trailing whitespace or specified characters from `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to trim.\n * @param {string} [chars=whitespace] The characters to trim.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the trimmed string.\n * @example\n *\n * _.trim(' abc ');\n * // => 'abc'\n *\n * _.trim('-_-abc-_-', '_-');\n * // => 'abc'\n *\n * _.map([' foo ', ' bar '], _.trim);\n * // => ['foo', 'bar']\n */\n\nfunction trim(string, chars, guard) {\n string = toString_1(string);\n\n if (string && (guard || chars === undefined)) {\n return _baseTrim(string);\n }\n\n if (!string || !(chars = _baseToString(chars))) {\n return string;\n }\n\n var strSymbols = _stringToArray(string),\n chrSymbols = _stringToArray(chars),\n start = _charsStartIndex(strSymbols, chrSymbols),\n end = _charsEndIndex(strSymbols, chrSymbols) + 1;\n\n return _castSlice(strSymbols, start, end).join('');\n}\n\nvar trim_1 = trim;\n/**\n * Join field path segments together.\n *\n * @param {...string} segments The path segments to join\n * @return {string} The joined path\n */\n\nfunction joinPath() {\n for (var _len2 = arguments.length, segments = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n segments[_key2] = arguments[_key2];\n }\n\n if (!segments || segments.length === 0) return ''; // Trim whitespace and dots\n\n segments = segments.map(function (segment) {\n return trim_1(segment, ' .');\n }); // Join with dots\n\n return segments.join('.');\n}\n\nvar utils = createCommonjsModule(function (module, exports) {\n (function (global, factory) {\n {\n factory(exports);\n }\n })(commonjsGlobal, function (exports) {\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n var _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n var _typeof = typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\" ? function (obj) {\n return _typeof2(obj);\n } : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n\n exports.isDate = function isDate(d) {\n return d instanceof Date;\n };\n\n exports.isEmpty = function isEmpty(o) {\n return Object.keys(o).length === 0;\n };\n\n var isObject = exports.isObject = function isObject(o) {\n return o != null && (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === 'object';\n };\n\n exports.properObject = function properObject(o) {\n return isObject(o) && !o.hasOwnProperty ? _extends({}, o) : o;\n };\n });\n});\nvar added = createCommonjsModule(function (module, exports) {\n (function (global, factory) {\n {\n factory(module, exports, utils);\n }\n })(commonjsGlobal, function (module, exports, _utils) {\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n }\n\n var _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n var addedDiff = function addedDiff(lhs, rhs) {\n if (lhs === rhs || !(0, _utils.isObject)(lhs) || !(0, _utils.isObject)(rhs)) return {};\n var l = (0, _utils.properObject)(lhs);\n var r = (0, _utils.properObject)(rhs);\n return Object.keys(r).reduce(function (acc, key) {\n if (l.hasOwnProperty(key)) {\n var difference = addedDiff(l[key], r[key]);\n if ((0, _utils.isObject)(difference) && (0, _utils.isEmpty)(difference)) return acc;\n return _extends({}, acc, _defineProperty({}, key, difference));\n }\n\n return _extends({}, acc, _defineProperty({}, key, r[key]));\n }, {});\n };\n\n exports[\"default\"] = addedDiff;\n module.exports = exports['default'];\n });\n});\nvar deleted = createCommonjsModule(function (module, exports) {\n (function (global, factory) {\n {\n factory(module, exports, utils);\n }\n })(commonjsGlobal, function (module, exports, _utils) {\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n }\n\n var _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n var deletedDiff = function deletedDiff(lhs, rhs) {\n if (lhs === rhs || !(0, _utils.isObject)(lhs) || !(0, _utils.isObject)(rhs)) return {};\n var l = (0, _utils.properObject)(lhs);\n var r = (0, _utils.properObject)(rhs);\n return Object.keys(l).reduce(function (acc, key) {\n if (r.hasOwnProperty(key)) {\n var difference = deletedDiff(l[key], r[key]);\n if ((0, _utils.isObject)(difference) && (0, _utils.isEmpty)(difference)) return acc;\n return _extends({}, acc, _defineProperty({}, key, difference));\n }\n\n return _extends({}, acc, _defineProperty({}, key, undefined));\n }, {});\n };\n\n exports[\"default\"] = deletedDiff;\n module.exports = exports['default'];\n });\n});\nvar updated = createCommonjsModule(function (module, exports) {\n (function (global, factory) {\n {\n factory(module, exports, utils);\n }\n })(commonjsGlobal, function (module, exports, _utils) {\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n }\n\n var _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n var updatedDiff = function updatedDiff(lhs, rhs) {\n if (lhs === rhs) return {};\n if (!(0, _utils.isObject)(lhs) || !(0, _utils.isObject)(rhs)) return rhs;\n var l = (0, _utils.properObject)(lhs);\n var r = (0, _utils.properObject)(rhs);\n\n if ((0, _utils.isDate)(l) || (0, _utils.isDate)(r)) {\n if (l.valueOf() == r.valueOf()) return {};\n return r;\n }\n\n return Object.keys(r).reduce(function (acc, key) {\n if (l.hasOwnProperty(key)) {\n var difference = updatedDiff(l[key], r[key]);\n if ((0, _utils.isObject)(difference) && (0, _utils.isEmpty)(difference) && !(0, _utils.isDate)(difference)) return acc;\n return _extends({}, acc, _defineProperty({}, key, difference));\n }\n\n return acc;\n }, {});\n };\n\n exports[\"default\"] = updatedDiff;\n module.exports = exports['default'];\n });\n});\nvar detailed = createCommonjsModule(function (module, exports) {\n (function (global, factory) {\n {\n factory(module, exports, added, deleted, updated);\n }\n })(commonjsGlobal, function (module, exports, _added, _deleted, _updated) {\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n var _added2 = _interopRequireDefault(_added);\n\n var _deleted2 = _interopRequireDefault(_deleted);\n\n var _updated2 = _interopRequireDefault(_updated);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n }\n\n var detailedDiff = function detailedDiff(lhs, rhs) {\n return {\n added: (0, _added2[\"default\"])(lhs, rhs),\n deleted: (0, _deleted2[\"default\"])(lhs, rhs),\n updated: (0, _updated2[\"default\"])(lhs, rhs)\n };\n };\n\n exports[\"default\"] = detailedDiff;\n module.exports = exports['default'];\n });\n});\nvar detailedDiff = /*@__PURE__*/getDefaultExportFromCjs(detailed);\n/**\n * Pragma form.\n *\n * Expands field lists a dictionary and tree. Processes field expressions from\n * state data.\n *\n * TODO: Rename to Form?\n *\n * @class FormProcessor\n */\n\nvar FormProcessor = /*#__PURE__*/function () {\n /**\n * Create a new property processor.\n *\n * @constructor\n * @param {Field[]} [fields=[]] - Initial form fields.\n * @param {Object.} [functions={}] - Functions to make available for field expressions.\n * @param {Object.} [tagOptions={}] - Default tag options keyed by tag type.\n * @param {Object.} [options={}] - Form options.\n */\n function FormProcessor() {\n var fields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var functions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var tagOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n\n _classCallCheck(this, FormProcessor);\n\n /**\n * Typecasting functions for each field type.\n *\n * TODO: Strong casting functions\n *\n * @type {Object.}\n */\n this.casts = {\n 'string': function string(f, v) {\n return v == null ? '' : '' + v;\n },\n 'number': function number(f, v) {\n return toNumber_1(util.clamp(v, get_1(f, 'options.min'), get_1(f, 'options.max')));\n },\n 'boolean': function boolean(f, v) {\n return !!v;\n }\n };\n this.options = merge_1({\n expressionCache: false,\n updateCache: false,\n valueCache: false\n }, options);\n /**\n * Default property values for each field type.\n *\n * @type {Object}\n */\n\n this.defaults = {};\n this.setDefaults({\n '*': {\n type: 'number',\n visible: true\n },\n 'virtual': {\n visible: false,\n virtual: true,\n omit: true\n },\n 'string': {\n tag: 'pragma-string',\n \"default\": ''\n },\n 'number': {\n tag: 'pragma-number',\n \"default\": 0,\n options: {\n min: -100,\n max: 100,\n step: 1\n }\n },\n 'boolean': {\n tag: 'pragma-boolean',\n \"default\": false\n },\n 'selection': {\n tag: 'pragma-select',\n options: {\n options: {}\n }\n },\n 'section': {\n tag: 'pragma-section'\n },\n 'group': {\n tag: 'pragma-group'\n },\n 'list': {\n tag: 'pragma-list'\n },\n 'list-item': {\n tag: 'pragma-list-item'\n },\n 'table': {\n tag: 'pragma-table'\n }\n });\n /**\n * Default field options for each tag type.\n *\n * @type {Object.}\n */\n\n this.tagOptions = merge_1({}, tagOptions);\n /**\n * Expression functions.\n *\n * @type {Object.}\n */\n\n this.functions = {};\n /**\n * Expression parser.\n *\n * @type {Parser}\n */\n\n this.parser = new bundle.Parser({\n operators: {\n \"in\": true\n }\n }); // Set the functions\n\n this.addFunctions(merge_1({\n concat: function concat() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n return args.join('');\n },\n keys: Object.keys,\n multiply: multiply_1,\n sum: sum,\n sumBy: sumBy_1,\n map: map_1,\n reduce: reduce_1\n }, functions));\n /**\n * The set of form fields.\n *\n * @type {Field[]}\n */\n\n this.fields = [];\n /**\n * Fields keyed by path.\n *\n * @type {FieldDictionary}\n */\n\n this.dictionary = {};\n /**\n * The root node of the field tree.\n *\n * @type {Field}\n */\n\n this.tree = {}; // Set the form fields\n\n this.setFields(fields);\n /**\n * Value cache for each field.\n *\n * @type {Object.}\n */\n\n this.valueCache = {};\n /**\n * Field expression cache keyed by path.\n *\n * @type {Object.}\n */\n\n this.expressionCache = {};\n /**\n * Field expression update dependencies keyed by path; adjacency list.\n *\n * @type {Object.}\n */\n\n this.expressionDependencies = {};\n /**\n * Map of updated fields.\n *\n * Used to prevent updating fields more than once.\n *\n * @type {Object.}\n */\n\n this.updatedFields = {};\n }\n /**\n * Check whether a field exists at the given path.\n *\n * @protected\n * @param {string} path - The path of the field to check.\n * @return {boolean}\n */\n\n\n _createClass(FormProcessor, [{\n key: \"hasField\",\n value: function hasField(path) {\n return has_1(this.dictionary, path);\n }\n /**\n * Get the field at the given path.\n *\n * @protected\n * @param {string} path - The path of the field to get.\n * @return {Field}\n */\n\n }, {\n key: \"getField\",\n value: function getField(path) {\n return this.dictionary[path];\n }\n /**\n * Get the parent field of the field at the given path.\n *\n * @protected\n * @param {Field} field\n * @return {Field|null}\n */\n\n }, {\n key: \"getFieldParent\",\n value: function getFieldParent(field) {\n if (!field) {\n return null;\n }\n\n return this.getField(field.parent);\n }\n /**\n * Get the ancestors of a field.\n *\n * @protected\n * @param {Field} field\n * @return {Field[]}\n */\n\n }, {\n key: \"getFieldAncestors\",\n value: function getFieldAncestors(field) {\n var ancestors = [];\n\n while (field.hasOwnProperty('parent') && this.hasField(field.parent)) {\n field = this.getFieldParent(field);\n ancestors.push(field);\n }\n\n return ancestors;\n }\n /**\n * Get the descendants of a field.\n *\n * @protected\n * @param {Field} field\n * @return {Field[]}\n */\n\n }, {\n key: \"getFieldDescendants\",\n value: function getFieldDescendants(field) {\n var descendants = [];\n traverseTree(field, function (descendant) {\n descendants.push(descendant);\n });\n return descendants;\n }\n /**\n * Get the current value of a field.\n *\n * @protected\n * @param {Field} field - The field to get the value of.\n * @param {*} [data={}] - Optional data to read current values from.\n * @param {*} [value] - Optional current value.\n * @return {*} The current value of the field.\n */\n\n }, {\n key: \"getFieldValue\",\n value: function getFieldValue(field) {\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n if (!field) {\n return value;\n }\n\n value = defaultTo_1(value, get_1(data, field.path)); // Merge default values if specified\n\n if (field.merge) {\n if (isPlainObject_1(field[\"default\"])) {\n return merge_1({}, field[\"default\"], field.value, value);\n } // TODO: Handle arrays\n\n } // Otherwise use the first defined value\n\n\n return defaultTo_1(value, defaultTo_1(field.value, field[\"default\"]));\n }\n /**\n * Get the default value of a field.\n *\n * @protected\n * @param {Field} field - The field to get the default value of.\n * @return {*} The default value of the field.\n */\n\n }, {\n key: \"getFieldDefaultValue\",\n value: function getFieldDefaultValue(field) {\n if (!field) {\n return null;\n }\n\n return field[\"default\"];\n }\n /**\n * Get the template field that a field should a extend.\n *\n * @param {Field} field - The field to get the template for.\n * @return {Field|null} The template field.\n */\n\n }, {\n key: \"getFieldTemplate\",\n value: function getFieldTemplate(field) {\n if (!field) {\n return null;\n }\n\n return this.getField(field[\"extends\"]);\n }\n /**\n * Get the keys of the field's children.\n *\n * @protected\n * @param {Field} field - The field to get the child keys of.\n * @return {array} The keys of the field's children.\n */\n\n }, {\n key: \"getFieldChildrenKeys\",\n value: function getFieldChildrenKeys(field) {\n var i,\n keys = [],\n children = field.children || [];\n\n for (i = 0; i < children.length; i++) {\n keys.push(children[i].pathFragment);\n }\n\n return keys;\n }\n /**\n * Get the template that a field's children should extend.\n *\n * @protected\n * @param {Field} field - The field to get the child template for.\n * @return {Field|null} The template field.\n */\n\n }, {\n key: \"getFieldChildrenTemplate\",\n value: function getFieldChildrenTemplate(field) {\n if (!field) {\n return null;\n }\n\n return this.getField(field.template);\n }\n /**\n * Get the fields dependent upon the given field's expression.\n *\n * @protected\n * @param {Field} field - The field whose expression to get dependent fields of.\n * @return {Field[]} The dependent fields of the given field's expression\n */\n\n }, {\n key: \"getFieldExpressionDependencies\",\n value: function getFieldExpressionDependencies(field) {\n var dependencies = this.expressionDependencies[field.path]; // Skip if the field has no dependencies\n\n if (!dependencies || !dependencies.length) {\n return [];\n }\n\n var fields = [];\n\n for (var i = 0; i < dependencies.length; i++) {\n var dependency = this.getField(dependencies[i]);\n\n if (!dependency) {\n continue;\n }\n\n fields.push(dependency);\n }\n\n return fields;\n }\n /**\n * Get the current value of a field.\n *\n * Falls back to default values as appropriate.\n *\n * @public\n * @param {string} path - The path to the field.\n * @return {*} The value of the field\n */\n\n }, {\n key: \"getValue\",\n value: function getValue(path) {\n return this.getFieldValue(this.getField(path));\n }\n /**\n * Cast a value based on the property it belongs to.\n *\n * @public\n * @param {Field} field\n * @param {*} value\n */\n\n }, {\n key: \"castValue\",\n value: function castValue(field, value) {\n if (!field) return value;\n if (!this.casts[field.type]) return value; // if (Array.isArray(value))\n // \treturn value.map(this.casts[field.type]);\n\n value = this.casts[field.type](field, value);\n return value;\n }\n /**\n * Derive a field's value from some data.\n *\n * @protected\n * @param {string} path - The path of the field to derive a value for.\n * @param {Object} data - The data to derive values from.\n * @return {*} The derived value.\n */\n\n }, {\n key: \"deriveValue\",\n value: function deriveValue(path, data) {\n // Return from the value cache if a value is set\n if (this.options.valueCache && this.valueCache.hasOwnProperty(path)) {\n return this.valueCache[path];\n }\n\n var field = this.getField(path);\n var value = this.getFieldValue(field, data); // Return the raw value if there's no such field\n\n if (!field) {\n return value;\n } // Cast the value\n\n\n value = this.castValue(field, value); // Evaluate the field's expression\n\n value = this.evaluateFieldExpression(field, data, value); // Fall back to defaults\n //value = defaultTo(value, defaultTo(field.default, null));\n\n value = this.getFieldValue(field, data, value); // Update the value cache\n\n this.valueCache[path] = value;\n return value;\n }\n /**\n * Build a field's expression.\n *\n * @param {Field} field - The field to build an expression for.\n * @return {Expression} The built expression.\n */\n\n }, {\n key: \"buildFieldExpression\",\n value: function buildFieldExpression(field) {\n if (field.expression == null || typeof field.expression !== 'string') {\n return null;\n } // Use the cached expression if one is available\n\n\n if (this.options.expressionCache && this.expressionCache[field.path]) {\n return this.expressionCache[field.path];\n } // Build the initial expression\n\n\n var expression;\n\n try {\n expression = this.parser.parse(field.expression);\n } catch (error) {\n console.error(\"Error parsing expression for field '\".concat(field.path, \"': \").concat(error.message), {\n expressionString: field.expression,\n expressionObject: expression\n });\n return null;\n } // Substitute contextual variables\n\n\n var substitutions = {\n $parent: field.parent\n };\n\n for (var s in substitutions) {\n try {\n // Skip null, NaN, undefined and empty strings\n if (substitutions[s] == null || substitutions[s] === '') {\n continue;\n }\n\n expression = expression.substitute(s, substitutions[s]);\n } catch (error) {\n console.error(\"Error substituting expression variable '\".concat(s, \"' for field '\").concat(field.path, \"': \\\"\").concat(error.message, \"\\\"\"), {\n expressionString: field.expression,\n expressionObject: expression,\n substitutionName: s,\n substitutionValue: substitutions[s]\n });\n return null;\n }\n }\n\n this.expressionCache[field.path] = expression;\n return expression;\n }\n /**\n * Evaluate a field's value from its expression.\n *\n * Causes the evaluation of any field dependencies as a result.\n *\n * TODO: Evaluate (and cache) expressions for other field properties to reuse! :D\n *\n * @param {Field} field - The field to compute the value of.\n * @param {Object} data - The data to derive values from.\n * @param {*} [value] - The current value of the field.\n * @return {*} The computed value of the field's expression.\n */\n\n }, {\n key: \"evaluateFieldExpression\",\n value: function evaluateFieldExpression(field, data, value) {\n var _this = this;\n\n value = this.getFieldValue(field, data, value); // Parse the expression\n\n var expression = this.buildFieldExpression(field);\n\n if (!expression) {\n return value;\n } // TODO: Extract deriving variables and building contextual functions\n // let variables = buildExpressionContext(field, data, expression, value)?\n // Contextual functions should still update the same \"variables\" reference\n // Derive values for the variables in the expression\n\n\n var variables = expression.variables({\n withMembers: true\n });\n var values = {\n $this: field,\n $value: value\n };\n\n for (var v = 0; v < variables.length; v++) {\n var variable = variables[v];\n if (has_1(values, variable)) continue;\n set_1(values, variable, this.deriveValue(variable, data));\n } // Build contextual functions\n\n\n values = merge_1(values, {\n field: function field(path) {\n variables.push(path);\n return _this.getField(path);\n },\n value: function value(path) {\n // Add the path to the list of expression variables\n variables.push(path); // Derive the value for the expression\n\n return _this.deriveValue(path, data);\n }\n }); // Evaluate the expression\n\n try {\n value = expression.evaluate(values);\n } catch (error) {\n console.error(\"Error evaluating expression for field '\".concat(field.path, \"'\"), error);\n console.error('evaluateFieldExpression', field, data, value, values);\n } //console.log('evaluateFieldExpression', field.path, expression.toString(), variables, values, value);\n //console.log('evaluateFieldExpression expression', expression);\n // Update the map of field update dependencies\n // TODO: Exclude contextual variables\n // TODO: Move this to an earlier processing step that evaluates the\n // expression with spy functions\n\n\n for (var _v = 0; _v < variables.length; _v++) {\n var _variable = variables[_v];\n this.expressionDependencies[_variable] = this.expressionDependencies[_variable] || [];\n\n if (this.expressionDependencies[_variable].indexOf(field.path) < 0) {\n this.expressionDependencies[_variable].push(field.path);\n }\n }\n\n return value;\n }\n /**\n * Prepare fields from a set of field descriptions.\n *\n * Ascertain's the parent path and path fragment (key) of each field.\n *\n * TODO: Field class, FieldDescription typedef.\n *\n * @protected\n * @param {Field[]} fields - The field description.\n * @returns {Field[]} The given fields prepared with pathFragment and parent properties.\n */\n\n }, {\n key: \"prepareFields\",\n value: function prepareFields(fields) {\n if (!fields || !fields.length) {\n return fields;\n }\n\n var i, field, pathFragment, parentPath;\n\n for (i = 0; i < fields.length; i++) {\n field = fields[i];\n if (!field.path) continue; // Ascertain a parent path and path fragment\n\n var _splitPath = splitPath(field.path);\n\n var _splitPath2 = _slicedToArray(_splitPath, 2);\n\n parentPath = _splitPath2[0];\n pathFragment = _splitPath2[1];\n field.pathFragment = defaultTo_1(field.pathFragment, pathFragment);\n field.parent = defaultTo_1(field.parent, parentPath);\n }\n\n return fields;\n }\n /**\n * Set the form's fields.\n *\n * TODO: Creates, updates and removes fields accordingly.\n *\n * @public\n * @param {Field[]} fields\n */\n\n }, {\n key: \"setFields\",\n value: function setFields(fields) {\n // Prepare the fields\n this.fields = this.prepareFields(fields); // TODO: Build dictionary from given fields, compare with current fields,\n // update things accordingly\n //this.dictionary = this.buildDictionary(this.fields);\n\n this.dictionary = this.updateDictionary(this.fields); // Compose the fields into a tree\n\n this.tree = this.buildTree(this.dictionary); // Clear all caches\n\n this.valueCache = {}; // this.expressionCache = {};\n\n this.expressionDependencies = {};\n }\n /**\n * Add a form field.\n *\n * @param {Field} field\n */\n\n }, {\n key: \"addField\",\n value: function addField(field) {\n var parent = this.getFieldParent(field);\n\n if (!parent) {\n console.warn(\"Could not set field \".concat(field.path, \" - its parent does not exist\"));\n return;\n }\n\n if (!parent.children) {\n parent.children = [];\n }\n\n if (!parent.children.includes(field)) {\n parent.children.push(field);\n }\n\n this.dictionary[field.path] = field;\n }\n /**\n * Update a property with the given value.\n *\n * @public\n * @param {Object} data - The data to update.\n * @param {string} path - The path of the field to update.\n * @param {*} value - The value to set.\n * @return {*} The updated value\n */\n\n }, {\n key: \"setValue\",\n value: function setValue(data, path, value) {\n var field = this.getField(path); // Update the value if one is given\n\n if (value !== undefined) {\n if (field) {\n field.value = value;\n }\n\n set_1(data, path, value);\n } // Update the field at this path\n\n\n this.updatePath(path, data); // Get the updated value\n\n return get_1(data, path);\n }\n /**\n * Clear the value cache.\n *\n * Optionally accepts a path to clear.\n *\n * @param {string} path\n */\n\n }, {\n key: \"clearValueCache\",\n value: function clearValueCache() {\n var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n // Just empty the entire cache if there's no path is or there's no field\n // at the given path\n if (!path || !this.getField(path)) {\n this.valueCache = {};\n return;\n }\n\n var i,\n field = this.getField(path); // Clear cached values of child fields iteratively\n\n var child,\n children = field.children,\n nextChildren = [];\n\n while (children && children.length) {\n nextChildren = [];\n\n for (i = 0; i < children.length; i++) {\n child = children[i];\n delete this.valueCache[child.path];\n\n if (child.children) {\n nextChildren = nextChildren.concat(child.children);\n }\n }\n\n children = nextChildren;\n } // Clear the cached value for this field\n\n\n delete this.valueCache[field.path]; // Clear cached values of parent fields iteratively\n\n var ancestors = this.getFieldAncestors(field);\n\n for (i = 0; i < ancestors.length; i++) {\n delete this.valueCache[ancestors[i].path];\n }\n }\n /**\n * Derive a field's label from its path.\n *\n * @protected\n * @param {Field} field The field to derive a label for\n * @return {string} The derived label\n */\n\n }, {\n key: \"deriveFieldLabel\",\n value: function deriveFieldLabel(field) {\n var path = field.path;\n var lastDotIndex = path.lastIndexOf('.');\n return util.sentenceCase(path.substring(lastDotIndex + 1));\n }\n /**\n * Set the default field properties for each field type.\n *\n * @param {Object.} fieldProperties - The default field properties, keyed by field type.\n */\n\n }, {\n key: \"setDefaults\",\n value: function setDefaults(fieldProperties) {\n this.defaults = merge_1(this.defaults, fieldProperties);\n }\n /**\n * Apply the form's default properties to the given fields.\n *\n * Fills in default values, derives default labels.\n *\n * @protected\n * @param {Field[]} fields - The fields to apply default values to.\n * @returns {Field[]}\n */\n\n }, {\n key: \"applyDefaults\",\n value: function applyDefaults(fields) {\n if (!fields || !fields.length) {\n return fields;\n }\n\n var i, field;\n\n for (i = 0; i < fields.length; i++) {\n field = fields[i]; // Derive a label\n\n if (field.label === undefined) {\n field.label = this.deriveFieldLabel(field);\n } // Apply global defaults\n\n\n field = defaultsDeep_1(field, this.defaults['*']); // Apply type-specific defaults\n\n if (this.defaults[field.type]) {\n field = defaultsDeep_1(field, this.defaults[field.type]);\n } // Apply default tag options\n\n\n if (this.tagOptions[field.tag]) {\n field.options = field.options || {};\n field.options = defaultsDeep_1(field.options, this.tagOptions[field.tag]);\n } // Disable the field implicitly if it has an expression\n\n\n if (!field.hasOwnProperty('disabled')) {\n field.disabled = !!field.expression;\n }\n }\n\n return fields;\n }\n /**\n * Add to the form's functions.\n *\n * @param {Object.} functions - Functions to add, keyed by name.\n */\n\n }, {\n key: \"addFunctions\",\n value: function addFunctions(functions) {\n // Add the functions to the form\n this.functions = merge_1(this.functions, functions); // Add the functions to the expression parser\n\n this.parser.functions = merge_1(this.parser.functions, this.functions); // Clear the expression cache\n //this.expressionCache = {};\n }\n /**\n * Diff the given data with the current form data.\n *\n * @protected\n * @param {Object} data - The data to diff with the current form data.\n * @return {Object} The detailed diff of current form data and given data.\n */\n\n }, {\n key: \"diffFormData\",\n value: function diffFormData(data) {\n //console.time('buildData(this.tree)');\n var formData = this.buildData(this.tree); //console.timeEnd('buildData(this.tree)');\n //console.log(formData);\n //console.time('detailedDiff');\n\n var diff = detailedDiff(formData, data); //console.timeEnd('detailedDiff');\n //console.log(diff);\n\n return diff;\n }\n /**\n * Update the form using the given data.\n *\n * @public\n * @param {Object} [data] - The data to update with.\n */\n\n }, {\n key: \"update\",\n value: function update(data) {\n this.updatePath('', data);\n }\n /**\n * Update the field at the given path.\n *\n * @param {string} path - The path of the field to update.\n * @param {Object} data - The data to update with.\n * @param {Object} [visited={}] - Map of fields already visited.\n */\n\n }, {\n key: \"updatePath\",\n value: function updatePath(path, data) {\n var _this2 = this;\n\n var visited = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var field = this.getField(path);\n\n if (!field || this.options.updateCache && visited[field.path]) {\n return;\n }\n\n this.clearValueCache(path); // Update the field and its children\n //console.time('updatePath() ' + path);\n\n traverseTree(field, function (field) {\n return _this2.preUpdateField(field, data);\n }, function (field) {\n // Skip fields that have already been visited\n if (_this2.options.updateCache && visited[field.path]) {\n console.warn('Skipped visited field', field.path);\n return;\n }\n\n _this2.updateField(field, data, visited);\n\n visited[field.path] = true;\n }); // Update parent fields and their dependencies\n\n var i;\n var ancestors = this.getFieldAncestors(field);\n\n for (i = 0; i < ancestors.length; i++) {\n if (this.options.updateCache && visited[ancestors[i].path]) {\n console.log('Skipped visited ancestor', field.path, ancestors[i].path, visited);\n continue;\n }\n\n this.updateField(ancestors[i], data, visited);\n visited[ancestors[i].path] = true;\n } //console.timeEnd('updatePath() ' + path);\n\n }\n /**\n * Update the given fields with the given data.\n *\n * Recursively descends into child fields and updates dependent fields,\n * including parents.\n *\n * @protected\n * @param {Field[]} fields - The fields to update.\n * @param {Object} data - The data to update with.\n */\n\n }, {\n key: \"updateFields\",\n value: function updateFields(fields, data) {\n if (!Array.isArray(fields) || !fields.length) {\n return;\n }\n\n for (var i = 0; i < fields.length; i++) {\n this.updatePath(fields[i].path, data);\n }\n }\n /**\n * Pre-order update the given field with the given data.\n *\n * @protected\n * @param {Field} field - The field to update.\n * @param {Object} data - The data to update with.\n * @returns {boolean}\n */\n\n }, {\n key: \"preUpdateField\",\n value: function preUpdateField(field, data) {\n this.updateFieldInheritance(field, data);\n return !field.omit;\n }\n /**\n * Update the given field with the given data.\n *\n * Recursively descends into child fields and updates dependent fields,\n * including parents.\n *\n * @protected\n * @param {Field} field - The field to update.\n * @param {Object} data - The data to update with.\n * @param {Object} [visited={}] - Map of fields already visited.\n */\n\n }, {\n key: \"updateField\",\n value: function updateField(field, data) {\n var visited = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var isDebugField = field.path.indexOf('abilities.str') === 0;\n\n if (isDebugField) {\n console.log('updateField()', field.path, field);\n } // Apply default values\n\n\n this.applyDefaults([field]);\n\n if (isDebugField) {\n console.log('applied defaults', field[\"default\"], field.value, get_1(data, field.path));\n } // Update the state's value\n\n\n this.updateDataValue(field, data);\n\n if (isDebugField) {\n console.log('updated data value', field.value, get_1(data, field.path));\n } // Update the field's value\n\n\n this.updateFieldValue(field, data);\n\n if (isDebugField) {\n console.log('updated field value', field.value, get_1(data, field.path));\n } // Update the fields that are dependent upon the value of this field\n\n\n this.updateFieldDependencies(field, data, visited);\n\n if (isDebugField) {\n console.log('updated field dependencies', field.path, field.value, get_1(data, field.path));\n }\n }\n /**\n * Update data from the given field.\n *\n * @protected\n * @param {Field} field - The field to update with.\n * @param {Object} data - The data to update.\n * @return {Object} The updated data.\n */\n\n }, {\n key: \"updateDataValue\",\n value: function updateDataValue(field, data) {\n if (!field || field.omit || field.virtual) {\n return data;\n }\n\n set_1(data, field.path, this.deriveValue(field.path, data));\n return data;\n }\n /**\n * Update a field using the given data.\n *\n * @protected\n * @param {Field} field - The field to update.\n * @param {Object} data - The data to update with.\n */\n\n }, {\n key: \"updateFieldValue\",\n value: function updateFieldValue(field, data) {\n if (!field) {\n return;\n } //console.log('updateFieldValue()', field.path);\n // Update the field value\n\n\n field.value = get_1(data, field.path);\n }\n /**\n * Update fields that are dependent upon the value of the given field.\n *\n * @protected\n * @param {Field} field - The field to update dependencies of.\n * @param {Object} data - The data to update from.\n * @param {Object} [visited={}] - Map of fields already visited.\n */\n\n }, {\n key: \"updateFieldDependencies\",\n value: function updateFieldDependencies(field, data) {\n var visited = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n // Update the field's expression dependencies\n var dependencies = this.getFieldExpressionDependencies(field);\n\n if (field.path.indexOf('abilities.str') === 0) {\n console.log('dependencies of', field.path, dependencies);\n }\n\n for (var i = 0; i < dependencies.length; i++) {\n this.updatePath(dependencies[i].path, data, visited);\n }\n }\n /**\n * Update the ancestors of the given field.\n *\n * @protected\n * @param {Field} field - The field to update parents of.\n * @param {Object} data - The data to update with.\n */\n\n }, {\n key: \"updateFieldAncestorValues\",\n value: function updateFieldAncestorValues(field, data) {\n var i,\n parents = this.getFieldAncestors(field);\n\n for (i = 0; i < parents.length; i++) {\n this.updateFieldValue(parents[i], data);\n }\n }\n /**\n * Update a field's inheritance.\n *\n * Ensures that inherited child fields exist.\n *\n * @param {Field} field - The field to update the inheritance of.\n * @param {Object} data - The date to update with.\n */\n\n }, {\n key: \"updateFieldInheritance\",\n value: function updateFieldInheritance(field, data) {\n // Update child template fields\n this.updateTemplateFields(field, data); // Inherit the field's template\n\n this.inheritTemplate(field, data);\n }\n /**\n * Get the keys of child fields that don't exist in the given data.\n *\n * Retrieves the new keys, existing keys and old keys of a field compared\n * to its data.\n *\n * @protected\n * @param {Field} field - The field with a template.\n * @param {Object} data - The data to diff against.\n * @return array [newPaths[], existingPaths[], oldPaths[]]\n */\n\n }, {\n key: \"diffFieldDataKeys\",\n value: function diffFieldDataKeys(field, data) {\n // Grab the data keys and child field keys\n var childData = this.getFieldValue(field, data);\n var childDataKeys = childData ? Object.keys(childData) : [];\n var childFieldKeys = this.getFieldChildrenKeys(field); // Keys in data that aren't in fields\n\n var newKeys = difference_1(childDataKeys, childFieldKeys); // Keys in data and fields\n\n var existingKeys = intersection_1(childDataKeys, childFieldKeys); // Keys in fields that aren't in data\n\n var oldKeys = difference_1(childFieldKeys, childDataKeys); // console.log('diffTemplateFieldKeys()', field.path, 'newKeys', newKeys);\n // console.log('diffTemplateFieldKeys()', field.path, 'existingKeys', existingKeys);\n // console.log('diffTemplateFieldKeys()', field.path, 'oldKeys', oldKeys);\n\n return [newKeys, existingKeys, oldKeys];\n }\n /**\n * Unravel all templates into fields for the given field and data.\n *\n * TODO: Try to merge this into inheritTemplate(), or extract a method\n * that can handle both cases, like updateFieldChildrenInheritance().\n *\n * @protected\n * @param {Field} field - The field to update template fields for.\n * @param {Object} [data] - The data used to unravel field templates.\n */\n\n }, {\n key: \"updateTemplateFields\",\n value: function updateTemplateFields(field, data) {\n if (!field) {\n return;\n }\n\n var template = this.getFieldChildrenTemplate(field);\n\n if (!template) {\n return;\n }\n\n var i,\n key,\n path,\n value,\n defaultValue,\n existingField,\n newField,\n newFields = []; // Find child fields that need to be added, updated or removed\n\n var _this$diffFieldDataKe = this.diffFieldDataKeys(field, data),\n _this$diffFieldDataKe2 = _slicedToArray(_this$diffFieldDataKe, 3),\n newKeys = _this$diffFieldDataKe2[0],\n existingKeys = _this$diffFieldDataKe2[1],\n oldKeys = _this$diffFieldDataKe2[2];\n\n var existingFieldKeys = this.getFieldChildrenKeys(field);\n var fixedKeys = field.fixed || []; // TODO: Extract to... diffFixedFieldDataKeys()...?\n // Remove fixed keys from the keys that need removing\n\n oldKeys = difference_1(oldKeys, fixedKeys); // Add the existent fixed keys to the keys that need updating\n\n existingKeys = existingKeys.concat(difference_1(intersection_1(fixedKeys, existingFieldKeys), existingKeys, newKeys)); // Add the non-existent fixed keys to the keys that need creating\n\n newKeys = newKeys.concat(difference_1(fixedKeys, existingFieldKeys, newKeys)); //console.log(field.path, newKeys, existingKeys, oldKeys, fixedKeys, existingFieldKeys);\n // Remove old fields\n\n for (i = 0; i < oldKeys.length; i++) {\n key = oldKeys[i];\n path = joinPath(field.path, key); //console.log('updateTemplateFields() oldField', field.path, path);\n\n this.removeField(this.getField(path));\n } // Update existing fields\n\n\n for (i = 0; i < existingKeys.length; i++) {\n key = existingKeys[i];\n path = joinPath(field.path, key); //console.log('updateTemplateFields() existingField', field.path, path);\n // Ensure the existing field has the correct template\n\n existingField = this.getField(path);\n existingField[\"extends\"] = template.path;\n } // Build new fields\n\n\n value = this.getFieldValue(field, data);\n defaultValue = this.getFieldDefaultValue(field);\n\n for (i = 0; i < newKeys.length; i++) {\n key = newKeys[i];\n path = joinPath(field.path, key); //console.log('updateTemplateFields() newField', path, value[key]);\n\n newField = {\n path: path,\n pathFragment: key,\n parent: field.path,\n \"extends\": template.path\n };\n\n if (value != null && value.hasOwnProperty(key)) {\n newField.value = value[key];\n }\n\n if (defaultValue != null && defaultValue.hasOwnProperty(key)) {\n newField[\"default\"] = defaultValue[key];\n }\n\n newFields.push(newField);\n } // Add the new fields to the parent field and dictionary\n\n\n if (newFields.length) {\n field.children = field.children || [];\n field.children = field.children.concat(newFields);\n }\n\n this.updateDictionary(newFields);\n }\n /**\n * Diff the keys of the first field's children with those of the second\n * field's children.\n *\n * Finds keys of the first that aren't of the second, keys that are of both,\n * and keys of the second that aren't of the first.\n *\n * @protected\n * @param {Field} firstField\n * @param {Field} secondField\n * @returns {array} [newKeys, existingKeys, oldKeys]\n */\n\n }, {\n key: \"diffFieldChildrenKeys\",\n value: function diffFieldChildrenKeys(firstField, secondField) {\n var firstFieldKeys = this.getFieldChildrenKeys(firstField);\n var secondFieldKeys = this.getFieldChildrenKeys(secondField); // Child keys of the first field that aren't of the second field\n\n var newKeys = difference_1(firstFieldKeys, secondFieldKeys); // Keys in the children of both fields\n\n var existingKeys = intersection_1(firstFieldKeys, secondFieldKeys); // Child keys of the second field that aren't of the first\n\n var oldKeys = difference_1(secondFieldKeys, firstFieldKeys);\n return [newKeys, existingKeys, oldKeys];\n }\n /**\n * Apply a field's inheritance.\n *\n * Ensures that a field inherits from its base field.\n *\n * @param {Field} field - The inheriting field.\n * @param {Object} data - The data to update with.\n * @return {Field}\n */\n\n }, {\n key: \"inheritTemplate\",\n value: function inheritTemplate(field, data) {\n if (!field) {\n return field;\n }\n\n var template = this.getFieldTemplate(field); // Skip fields without a template\n\n if (!template) {\n return field;\n } // Inherit the template\n\n\n if (field.extended !== template.path) {\n var templateClone = clone_1(template); // We don't want to inherit children, nor do we support more than a\n // single layer of inheritance\n\n delete templateClone.children;\n delete templateClone.template; // if (field.path === 'skills.list.test.ability') {\n // \tconsole.log('skills.list.test.ability', clone(field), templateClone);\n // }\n // Merge sandwich to retain original values\n\n field = merge_1(field, templateClone, clone_1(field));\n\n if (field.label == null) {\n field.label = this.deriveFieldLabel(field);\n }\n\n field.extended = template.path;\n this.prepareFields([field]);\n } //console.log('inheritTemplate()', field.path, template.path);\n // Update child field inheritance\n\n\n var key,\n path,\n value,\n defaultValue,\n existingField,\n newField,\n newFields = []; // Diff field child keys and template child keys\n\n var _this$diffFieldChildr = this.diffFieldChildrenKeys(template, field),\n _this$diffFieldChildr2 = _slicedToArray(_this$diffFieldChildr, 2),\n newKeys = _this$diffFieldChildr2[0],\n existingKeys = _this$diffFieldChildr2[1]; // Update existing template fields\n\n\n for (var i = 0; i < existingKeys.length; i++) {\n key = existingKeys[i];\n path = joinPath(field.path, key);\n existingField = this.getField(path); //console.log('inheritTemplate() existingField', path, existingField);\n\n existingField[\"extends\"] = joinPath(template.path, key);\n } // Build new template fields\n\n\n value = this.getFieldValue(field, data);\n defaultValue = this.getFieldDefaultValue(field); //console.log('inheritTemplate()', field.path, value);\n\n for (var _i2 = 0; _i2 < newKeys.length; _i2++) {\n key = newKeys[_i2];\n path = joinPath(field.path, key); //console.log('inherit newKey', path, value[key]);\n // Build the new field\n\n newField = {\n path: path,\n pathFragment: key,\n parent: field.path,\n \"extends\": joinPath(template.path, key)\n }; // Propagate values\n\n if (value != null && value.hasOwnProperty(key)) {\n newField.value = value[key];\n }\n\n if (defaultValue != null && defaultValue.hasOwnProperty(key)) {\n newField[\"default\"] = defaultValue[key];\n }\n\n newFields.push(newField);\n } // Add the new fields to the parent field and dictionary\n // TODO: Extract addFieldChildren(field, children)\n\n\n if (newFields.length) {\n field.children = field.children || [];\n field.children = field.children.concat(newFields); // We then want to sort these in the order of template's children\n // TODO: Extract sortFieldChildren(field)\n\n var templateChildKeys = this.getFieldChildrenKeys(template); // We flip the child keys into an object where the values are the\n // indices of the child keys array\n\n templateChildKeys = zipObject_1(templateChildKeys, _toConsumableArray(templateChildKeys.keys())); // This makes it easier to sort\n\n field.children = sortBy_1(field.children, function (child) {\n return templateChildKeys[child.pathFragment];\n });\n }\n\n this.updateDictionary(newFields);\n return field;\n }\n /**\n * Remove data from the given path.\n *\n * @public\n * @param {Object} data - The data to change.\n * @param {string} path - The path to remove.\n */\n\n }, {\n key: \"removeValue\",\n value: function removeValue(data, path) {\n this.removePath(path, data);\n }\n /**\n * Remove data at the given path and update parent fields.\n *\n * TODO: The naming and existence of this method doesn't quite make sense.\n * You'd expect it to remove the field(s) too, considering updatePath().\n * Refactor?\n *\n * @protected\n * @param {string} path - The path to remove.\n * @param {Object} data - The data to remove the path from.\n */\n\n }, {\n key: \"removePath\",\n value: function removePath(path, data) {\n var field = this.getField(path);\n\n if (!field) {\n return;\n } // Remove the state data\n\n\n this.removeData(field, data); // Update the parent field\n\n this.updatePath(this.getFieldParent(field).path, data);\n }\n /**\n * Remove the given fields.\n *\n * @protected\n * @param {Field[]} fields - The fields to remove.\n * @return {Field[]} The removed fields.\n */\n\n }, {\n key: \"removeFields\",\n value: function removeFields(fields) {\n if (!Array.isArray(fields) || !fields.length) {\n return [];\n }\n\n var removed = [];\n\n for (var i = 0; i < fields.length; i++) {\n removed.push(this.removeField(fields[i]));\n }\n\n return removed;\n }\n /**\n * Remove a field.\n *\n * Clears dictionary and parent references to the field.\n *\n * Doesn't remove data or update parent field values.\n *\n * @protected\n * @param {Field} field - The field to remove.\n * @return {Field} The removed field.\n */\n\n }, {\n key: \"removeField\",\n value: function removeField(field) {\n var _this3 = this;\n\n if (!field) {\n return field;\n } // Remove the field and its children from the value cache, dictionary\n // and dependency list\n\n\n this.clearValueCache(field.path);\n traverseTree(field, function (field) {\n delete _this3.dictionary[field.path];\n delete _this3.expressionDependencies[field.path];\n }); // Remove the field from its parent\n\n var parent = this.getFieldParent(field);\n pull_1(parent.children, field);\n return field;\n }\n /**\n * Remove a field's path from the given data.\n *\n * @protected\n * @param {Field} field - The field whose path to remove from data.\n * @param {Object} data - The data to remove from.\n */\n\n }, {\n key: \"removeData\",\n value: function removeData(field, data) {\n if (!field) {\n return;\n }\n\n var parent = this.getField(field.parent);\n\n if (!parent) {\n return;\n }\n\n var parentPath = parent.path;\n var parentValue = this.getFieldValue(parent, data);\n var key = field.pathFragment;\n\n if (Array.isArray(parentValue)) {\n parentValue.splice(key, 1);\n } else {\n delete parentValue[key];\n }\n\n set_1(data, parentPath, parentValue);\n }\n /**\n * Update the dictionary with the given fields.\n *\n * @param {Field[]} fields\n * @returns {FieldDictionary}\n */\n\n }, {\n key: \"updateDictionary\",\n value: function updateDictionary(fields) {\n if (!Array.isArray(fields)) {\n return this.dictionary;\n }\n\n for (var i = 0; i < fields.length; i++) {\n if (!fields[i] || !fields[i].path) {\n continue;\n }\n\n this.dictionary[fields[i].path] = fields[i];\n }\n\n return this.dictionary;\n }\n /**\n * Build a dictionary from the given fields.\n *\n * @param {Field[]} fields\n * @return {FieldDictionary}\n */\n\n }, {\n key: \"buildDictionary\",\n value: function buildDictionary(fields) {\n return _buildDictionary(fields);\n }\n /**\n * Build a tree from the given dictionary.\n *\n * @protected\n * @param {FieldDictionary} dictionary\n * @returns {Field}\n */\n\n }, {\n key: \"buildTree\",\n value: function buildTree(dictionary) {\n return _buildTree(dictionary);\n }\n /**\n * Build data from the current field state.\n *\n * @param {Field} field - The root field to traverse from.\n * @param {Object} [data={}] - The target data object.\n * @return {Object} The built data.\n */\n\n }, {\n key: \"buildData\",\n value: function buildData(field) {\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!field) {\n return data;\n }\n\n var child; // If the field has children, build the data of its children\n\n if (field.children) {\n for (var c = 0; c < field.children.length; c++) {\n child = field.children[c];\n\n if (child.omit) {\n continue;\n }\n\n this.buildData(field.children[c], data);\n }\n\n return data;\n } // Set data\n\n\n set_1(data, field.path, defaultTo_1(field.value, field[\"default\"]));\n return data;\n }\n /**\n * Build data for a field's template.\n *\n * @protected\n * @param {Field} field - The field to build child data for.\n * @param {Object} [data] - The target data object.\n * @return {Object} The built data.\n */\n\n }, {\n key: \"buildTemplateData\",\n value: function buildTemplateData(field, data) {\n var template = this.getFieldChildrenTemplate(field);\n\n if (!template) {\n return null;\n }\n\n return get_1(this.buildData(template), template.path);\n }\n /**\n * Add new a new data item for the field at the given path.\n *\n * @public\n * @param {Object} data - The data to change.\n * @param {string} path - The path of the field to add new data item to.\n * @param {string|number} [key] - Optional key to use for the new data item.\n * @param {*} [value] - Optional value to use for the new data item.\n */\n\n }, {\n key: \"addItem\",\n value: function addItem(data, path, key, value) {\n var field = this.getField(path);\n\n if (!field) {\n return;\n } // Build the new child data\n\n\n var newData = merge_1(this.buildTemplateData(field), value || {}); // Get the target for the data\n\n var target = get_1(data, path, []); // Add the new child data to the collection\n\n if (Array.isArray(target)) {\n target.push(newData);\n } else if (key != null && _typeof2(target) === 'object') {\n target[key] = newData;\n } else {\n // Bail if we're not dealing with a collection\n console.warn(\"Could not create new child data for '\".concat(path, \"';\") + \" either it wasn't an array or wasn't an object with a key provided\");\n return;\n } // Set it back\n\n\n set_1(data, path, target); // Update the form\n\n this.updatePath(path, data);\n }\n }]);\n\n return FormProcessor;\n}();\n/**\n * A dictionary of fields.\n *\n * Fields are keyed by their path.\n *\n * @typedef {Object.} FieldDictionary\n */\n\n/**\n * A field description.\n *\n * TODO: Update this to reflect the simplest approach to describing fields.\n * Could also be called FieldOptions if passed to the constructor of a\n * Field class.\n *\n * @typedef {Object} FieldDescription\n */\n\n/**\n * A field.\n *\n * TODO: Formalise as a class?\n *\n * @typedef {Object} Field\n *\n * @property {string} path - The path of the field.\n * @property {string} [parent] - The path of the field's parent, if any. Overrides the parent that would otherwise be determined from the `path`.\n * @property {string} [pathFragment] - The leaf of the field's path. TODO: Rename to key\n * @property {string} [type] - The type of the field. Determines the type of value to read and store. Defaults to `'number'`.\n * @property {string} [tag] - The tag to use for this field, if any.\n * @property {Object} [options] - The tag options. A free-form object for different tag types to interpret and utilise.\n * @property {string} [label] - The field's label. Defaults to a sentence-case translation of the field's key.\n * @property {string} [description] - The field's description.\n * @property {boolean} [omit=false] - Whether to prevent storing the field's value in data AND prevent updating any of its children. Defaults to `false`.\n * @property {boolean} [virtual=false] - Whether to prevent storing the field's value in data. Defaults to `false`.\n * @property {string|boolean} [visible=true] - Whether the field is visible. Defaults to `true`. String values are interpreted as expressions.\n * @property {string|boolean} [disabled=false] - Whether the field is disabled. Defaults to `true` if `expression` is set, otherwise defaults to `false`. String values are interpreted as expressions. TODO: Input options?\n * @property {*} [value] - The field's value.\n * @property {*} [default] - The field's default value. Defaults appropriately for the field's `type`.\n * @property {boolean} [merge] - Whether to merge the field's non-scalar value with its default value.\n * @property {string} [expression] - An expression used to compute the field's value. Implies `disabled` when set.\n * @property {string} [validator] - The field's value validation function. Defaults appropriately for the field's `type`.\n * @property {string} [extends] - The path of a field to inherit from.\n * @property {string} [extended] - The path of a field that been has inherited from.\n * @property {string} [mirror] - The path of a field to mirror. TODO: Implement\n * @property {Field[]} [children] - Child fields.\n * @property {string} [template] - Template field that all child fields should extend. Can be a `Field` or a `path` to a field.\n * @property {Object|array} [fixed] - A map or list of child keys that cannot be removed at runtime, if present.\n */\n\n\nvar PragmaForm = /*#__PURE__*/function () {\n function PragmaForm(hostRef) {\n _classCallCheck(this, PragmaForm);\n\n Object(_index_50360107_js__WEBPACK_IMPORTED_MODULE_0__[\"r\"])(this, hostRef);\n /**\n * The form.\n *\n * This is where the magic happens.\n */\n\n this.form = new FormProcessor();\n /**\n * Field elements in the host component's light DOM that need updating every\n * time the form changes.\n */\n\n this.fieldElements = [];\n /**\n * Pragma fields to maintain.\n */\n\n this.fields = [];\n /**\n * Functions to provide to form expressions.\n */\n\n this.functions = [];\n /**\n * Default properties for different field types.\n */\n\n this.defaults = {};\n /**\n * Form state data.\n */\n\n this.state = {};\n }\n /**\n * Handle input events to update form data.\n *\n * Forces an update of the form component.\n *\n * @param {InputEvent} event\n */\n\n\n _createClass(PragmaForm, [{\n key: \"onInputEvent\",\n value: function onInputEvent(event) {\n if (!event.target) {\n return;\n }\n\n var element = event.target;\n var fieldName = element.getAttribute('path') || element.getAttribute('name');\n\n if (!fieldName) {\n return;\n }\n\n var value = element.type === 'checkbox' ? element.checked : element.value; // console.log('pragma-form onInputEvent', event, fieldName, element.value, value);\n\n this.form.setValue(this.state, fieldName, value);\n Object(_index_50360107_js__WEBPACK_IMPORTED_MODULE_0__[\"f\"])(this.element);\n }\n /**\n * Handle add events.\n *\n * Adds fields to the form based on data attributes of the event's target\n * element.\n *\n * @param {MouseEvent} event\n */\n\n }, {\n key: \"onClickEvent\",\n value: function onClickEvent(event) {\n // console.log(event);\n if (!event.target) {\n return;\n }\n\n var element = event.target;\n\n if (!element.dataset) {\n return;\n } // console.log(element, element.dataset);\n\n\n var changes = 0;\n var data = element.dataset;\n\n if (data.pragmaAdd) {\n this.form.addItem(this.state, data.pragmaAdd);\n changes++;\n }\n\n if (data.pragmaRemove) {\n this.form.removeValue(this.state, data.pragmaRemove);\n changes++;\n }\n\n if (changes > 0) {\n Object(_index_50360107_js__WEBPACK_IMPORTED_MODULE_0__[\"f\"])(this.element);\n }\n }\n /**\n * Find field elements in the host component's light DOM that need updating\n * every time the form changes.\n *\n * @return {Array}\n */\n\n }, {\n key: \"findFieldElements\",\n value: function findFieldElements() {\n return Array.from(this.element.querySelectorAll(':scope pragma-fields, :scope input, :scope select, :scope textarea'));\n }\n /**\n * Get the field path of a given element.\n *\n * @param {HTMLElement} element\n * @return string\n */\n\n }, {\n key: \"getFieldElementPath\",\n value: function getFieldElementPath(element) {\n return element.getAttribute('path') || element.getAttribute('name') || '';\n }\n }, {\n key: \"getFieldElementField\",\n value: function getFieldElementField(element) {\n return this.form.getField(this.getFieldElementPath(element));\n }\n /**\n * Sync a given element with the form data.\n *\n * @param {HTMLElement} element\n */\n\n }, {\n key: \"syncElement\",\n value: function syncElement(element) {\n var field = this.getFieldElementField(element);\n\n if (!field) {\n console.debug('No field found for element', element);\n return;\n }\n\n if (element.nodeName === 'PRAGMA-FIELDS') {\n var fieldsElement = element;\n\n if (!element.parentElement.closest('pragma-fields')) {\n fieldsElement.fields = Array.isArray(field.children) ? _toConsumableArray(field.children) : [];\n }\n }\n\n if (element instanceof HTMLInputElement) {\n if (element.type === 'checkbox') {\n element.checked = !!field.value;\n } else {\n element.value = field.value;\n }\n }\n\n if (element instanceof HTMLSelectElement) {\n // TODO: Sync