diff --git a/app/changelog.html b/app/changelog.html deleted file mode 100644 index 25bbbf4..0000000 --- a/app/changelog.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - -
console.clear()
now doesn't error and clears the inbuilt console.' + func(text) + '
'; - * }); - * - * p('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles
' - */ - function wrap(value, wrapper) { - wrapper = wrapper == null ? identity : wrapper; - return createWrapper( - wrapper, - PARTIAL_FLAG, - undefined, - [value], - [] - ); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned, - * otherwise they are assigned by reference. If `customizer` is provided it is - * invoked to produce the cloned values. If `customizer` returns `undefined` - * cloning is handled by the method instead. The `customizer` is bound to - * `thisArg` and invoked with two argument; (value [, index|key, object]). - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm). - * The enumerable properties of `arguments` objects and objects created by - * constructors other than `Object` are cloned to plain `Object` objects. An - * empty object is returned for uncloneable values such as functions, DOM nodes, - * Maps, Sets, and WeakMaps. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {Function} [customizer] The function to customize cloning values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {*} Returns the cloned value. - * @example - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * var shallow = _.clone(users); - * shallow[0] === users[0]; - * // => true - * - * var deep = _.clone(users, true); - * deep[0] === users[0]; - * // => false - * - * // using a customizer callback - * var el = _.clone(document.body, function(value) { - * if (_.isElement(value)) { - * return value.cloneNode(false); - * } - * }); - * - * el === document.body - * // => false - * el.nodeName - * // => BODY - * el.childNodes.length; - * // => 0 - */ - function clone(value, isDeep, customizer, thisArg) { - if ( - isDeep && - typeof isDeep != 'boolean' && - isIterateeCall(value, isDeep, customizer) - ) { - isDeep = false; - } else if (typeof isDeep == 'function') { - thisArg = customizer; - customizer = isDeep; - isDeep = false; - } - return typeof customizer == 'function' - ? baseClone( - value, - isDeep, - bindCallback(customizer, thisArg, 1) - ) - : baseClone(value, isDeep); - } - - /** - * Creates a deep clone of `value`. If `customizer` is provided it is invoked - * to produce the cloned values. If `customizer` returns `undefined` cloning - * is handled by the method instead. The `customizer` is bound to `thisArg` - * and invoked with two argument; (value [, index|key, object]). - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm). - * The enumerable properties of `arguments` objects and objects created by - * constructors other than `Object` are cloned to plain `Object` objects. An - * empty object is returned for uncloneable values such as functions, DOM nodes, - * Maps, Sets, and WeakMaps. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to deep clone. - * @param {Function} [customizer] The function to customize cloning values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {*} Returns the deep cloned value. - * @example - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * var deep = _.cloneDeep(users); - * deep[0] === users[0]; - * // => false - * - * // using a customizer callback - * var el = _.cloneDeep(document.body, function(value) { - * if (_.isElement(value)) { - * return value.cloneNode(true); - * } - * }); - * - * el === document.body - * // => false - * el.nodeName - * // => BODY - * el.childNodes.length; - * // => 20 - */ - function cloneDeep(value, customizer, thisArg) { - return typeof customizer == 'function' - ? baseClone(value, true, bindCallback(customizer, thisArg, 1)) - : baseClone(value, true); - } - - /** - * Checks if `value` is greater than `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`. - * @example - * - * _.gt(3, 1); - * // => true - * - * _.gt(3, 3); - * // => false - * - * _.gt(1, 3); - * // => false - */ - function gt(value, other) { - return value > other; - } - - /** - * Checks if `value` is greater than or equal to `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`. - * @example - * - * _.gte(3, 1); - * // => true - * - * _.gte(3, 3); - * // => true - * - * _.gte(1, 3); - * // => false - */ - function gte(value, other) { - return value >= other; - } - - /** - * Checks if `value` is classified as an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - return ( - isObjectLike(value) && - isArrayLike(value) && - hasOwnProperty.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee') - ); - } - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(function() { return arguments; }()); - * // => false - */ - var isArray = - nativeIsArray || - function(value) { - return ( - isObjectLike(value) && - isLength(value.length) && - objToString.call(value) == arrayTag - ); - }; - - /** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return ( - value === true || - value === false || - (isObjectLike(value) && objToString.call(value) == boolTag) - ); - } - - /** - * Checks if `value` is classified as a `Date` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false - */ - function isDate(value) { - return ( - isObjectLike(value) && objToString.call(value) == dateTag - ); - } - - /** - * Checks if `value` is a DOM element. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - * - * _.isElement(''); - * // => false - */ - function isElement(value) { - return ( - !!value && - value.nodeType === 1 && - isObjectLike(value) && - !isPlainObject(value) - ); - } - - /** - * Checks if `value` is empty. A value is considered empty unless it is an - * `arguments` object, array, string, or jQuery-like collection with a length - * greater than `0` or an object with own enumerable properties. - * - * @static - * @memberOf _ - * @category Lang - * @param {Array|Object|string} value The value to inspect. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ - function isEmpty(value) { - if (value == null) { - return true; - } - if ( - isArrayLike(value) && - (isArray(value) || - isString(value) || - isArguments(value) || - (isObjectLike(value) && isFunction(value.splice))) - ) { - return !value.length; - } - return !keys(value).length; - } - - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. If `customizer` is provided it is invoked to compare values. - * If `customizer` returns `undefined` comparisons are handled by the method - * instead. The `customizer` is bound to `thisArg` and invoked with three - * arguments: (value, other [, index|key]). - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Objects are compared by - * their own, not inherited, enumerable properties. Functions and DOM nodes - * are **not** supported. Provide a customizer function to extend support - * for comparing other values. - * - * @static - * @memberOf _ - * @alias eq - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize value comparisons. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * object == other; - * // => false - * - * _.isEqual(object, other); - * // => true - * - * // using a customizer callback - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqual(array, other, function(value, other) { - * if (_.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/)) { - * return true; - * } - * }); - * // => true - */ - function isEqual(value, other, customizer, thisArg) { - customizer = - typeof customizer == 'function' - ? bindCallback(customizer, thisArg, 3) - : undefined; - var result = customizer ? customizer(value, other) : undefined; - return result === undefined - ? baseIsEqual(value, other, customizer) - : !!result; - } - - /** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. - * @example - * - * _.isError(new Error); - * // => true - * - * _.isError(Error); - * // => false - */ - function isError(value) { - return ( - isObjectLike(value) && - typeof value.message == 'string' && - objToString.call(value) == errorTag - ); - } - - /** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on [`Number.isFinite`](http://ecma-international.org/ecma-262/6.0/#sec-number.isfinite). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(10); - * // => true - * - * _.isFinite('10'); - * // => false - * - * _.isFinite(true); - * // => false - * - * _.isFinite(Object(10)); - * // => false - * - * _.isFinite(Infinity); - * // => false - */ - function isFinite(value) { - return typeof value == 'number' && nativeIsFinite(value); - } - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in older versions of Chrome and Safari which return 'function' for regexes - // and Safari 8 equivalents which return 'object' for typed array constructors. - return isObject(value) && objToString.call(value) == funcTag; - } - - /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ - function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. If `customizer` is provided - * it is invoked to compare values. If `customizer` returns `undefined` - * comparisons are handled by the method instead. The `customizer` is bound - * to `thisArg` and invoked with three arguments: (value, other, index|key). - * - * **Note:** This method supports comparing properties of arrays, booleans, - * `Date` objects, numbers, `Object` objects, regexes, and strings. Functions - * and DOM nodes are **not** supported. Provide a customizer function to extend - * support for comparing other values. - * - * @static - * @memberOf _ - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Function} [customizer] The function to customize value comparisons. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - * - * // using a customizer callback - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatch(object, source, function(value, other) { - * return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined; - * }); - * // => true - */ - function isMatch(object, source, customizer, thisArg) { - customizer = - typeof customizer == 'function' - ? bindCallback(customizer, thisArg, 3) - : undefined; - return baseIsMatch(object, getMatchData(source), customizer); - } - - /** - * Checks if `value` is `NaN`. - * - * **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4) - * which returns `true` for `undefined` and other non-numeric values. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some host objects in IE. - return isNumber(value) && value != +value; - } - - /** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ - function isNative(value) { - if (value == null) { - return false; - } - if (isFunction(value)) { - return reIsNative.test(fnToString.call(value)); - } - return isObjectLike(value) && reIsHostCtor.test(value); - } - - /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false - */ - function isNull(value) { - return value === null; - } - - /** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified - * as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isNumber(8.4); - * // => true - * - * _.isNumber(NaN); - * // => true - * - * _.isNumber('8.4'); - * // => false - */ - function isNumber(value) { - return ( - typeof value == 'number' || - (isObjectLike(value) && objToString.call(value) == numberTag) - ); - } - - /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * **Note:** This method assumes objects created by the `Object` constructor - * have no inherited enumerable properties. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ - function isPlainObject(value) { - var Ctor; - - // Exit early for non `Object` objects. - if ( - !( - isObjectLike(value) && - objToString.call(value) == objectTag && - !isArguments(value) - ) || - (!hasOwnProperty.call(value, 'constructor') && - ( - (Ctor = value.constructor), - typeof Ctor == 'function' && !(Ctor instanceof Ctor) - )) - ) { - return false; - } - // IE < 9 iterates inherited properties before own properties. If the first - // iterated property is an object's own property then there are no inherited - // enumerable properties. - var result; - // In most environments an object's own properties are iterated before - // its inherited properties. If the last iterated property is an object's - // own property then there are no inherited enumerable properties. - baseForIn(value, function(subValue, key) { - result = key; - }); - return ( - result === undefined || hasOwnProperty.call(value, result) - ); - } - - /** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ - function isRegExp(value) { - return isObject(value) && objToString.call(value) == regexpTag; - } - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return ( - typeof value == 'string' || - (isObjectLike(value) && objToString.call(value) == stringTag) - ); - } - - /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ - function isTypedArray(value) { - return ( - isObjectLike(value) && - isLength(value.length) && - !!typedArrayTags[objToString.call(value)] - ); - } - - /** - * Checks if `value` is `undefined`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ - function isUndefined(value) { - return value === undefined; - } - - /** - * Checks if `value` is less than `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`. - * @example - * - * _.lt(1, 3); - * // => true - * - * _.lt(3, 3); - * // => false - * - * _.lt(3, 1); - * // => false - */ - function lt(value, other) { - return value < other; - } - - /** - * Checks if `value` is less than or equal to `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`. - * @example - * - * _.lte(1, 3); - * // => true - * - * _.lte(3, 3); - * // => true - * - * _.lte(3, 1); - * // => false - */ - function lte(value, other) { - return value <= other; - } - - /** - * Converts `value` to an array. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Array} Returns the converted array. - * @example - * - * (function() { - * return _.toArray(arguments).slice(1); - * }(1, 2, 3)); - * // => [2, 3] - */ - function toArray(value) { - var length = value ? getLength(value) : 0; - if (!isLength(length)) { - return values(value); - } - if (!length) { - return []; - } - return arrayCopy(value); - } - - /** - * Converts `value` to a plain object flattening inherited enumerable - * properties of `value` to own properties of the plain object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Object} Returns the converted plain object. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.assign({ 'a': 1 }, new Foo); - * // => { 'a': 1, 'b': 2 } - * - * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); - * // => { 'a': 1, 'b': 2, 'c': 3 } - */ - function toPlainObject(value) { - return baseCopy(value, keysIn(value)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Recursively merges own enumerable properties of the source object(s), that - * don't resolve to `undefined` into the destination object. Subsequent sources - * overwrite property assignments of previous sources. If `customizer` is - * provided it is invoked to produce the merged values of the destination and - * source properties. If `customizer` returns `undefined` merging is handled - * by the method instead. The `customizer` is bound to `thisArg` and invoked - * with five arguments: (objectValue, sourceValue, key, object, source). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {Object} Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - * - * // using a customizer callback - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, function(a, b) { - * if (_.isArray(a)) { - * return a.concat(b); - * } - * }); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - var merge = createAssigner(baseMerge); - - /** - * Assigns own enumerable properties of source object(s) to the destination - * object. Subsequent sources overwrite property assignments of previous sources. - * If `customizer` is provided it is invoked to produce the assigned values. - * The `customizer` is bound to `thisArg` and invoked with five arguments: - * (objectValue, sourceValue, key, object, source). - * - * **Note:** This method mutates `object` and is based on - * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign). - * - * @static - * @memberOf _ - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {Object} Returns `object`. - * @example - * - * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); - * // => { 'user': 'fred', 'age': 40 } - * - * // using a customizer callback - * var defaults = _.partialRight(_.assign, function(value, other) { - * return _.isUndefined(value) ? other : value; - * }); - * - * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); - * // => { 'user': 'barney', 'age': 36 } - */ - var assign = createAssigner(function(object, source, customizer) { - return customizer - ? assignWith(object, source, customizer) - : baseAssign(object, source); - }); - - /** - * Creates an object that inherits from the given `prototype` object. If a - * `properties` object is provided its own enumerable properties are assigned - * to the created object. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Object} Returns the new object. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * function Circle() { - * Shape.call(this); - * } - * - * Circle.prototype = _.create(Shape.prototype, { - * 'constructor': Circle - * }); - * - * var circle = new Circle; - * circle instanceof Circle; - * // => true - * - * circle instanceof Shape; - * // => true - */ - function create(prototype, properties, guard) { - var result = baseCreate(prototype); - if (guard && isIterateeCall(prototype, properties, guard)) { - properties = undefined; - } - return properties ? baseAssign(result, properties) : result; - } - - /** - * Assigns own enumerable properties of source object(s) to the destination - * object for all destination properties that resolve to `undefined`. Once a - * property is set, additional values of the same property are ignored. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); - * // => { 'user': 'barney', 'age': 36 } - */ - var defaults = createDefaults(assign, assignDefaults); - - /** - * This method is like `_.defaults` except that it recursively assigns - * default properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } }); - * // => { 'user': { 'name': 'barney', 'age': 36 } } - * - */ - var defaultsDeep = createDefaults(merge, mergeDefaults); - - /** - * This method is like `_.find` except that it returns the key of the first - * element `predicate` returns truthy for instead of the element itself. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {string|undefined} Returns the key of the matched element, else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findKey(users, function(chr) { - * return chr.age < 40; - * }); - * // => 'barney' (iteration order is not guaranteed) - * - * // using the `_.matches` callback shorthand - * _.findKey(users, { 'age': 1, 'active': true }); - * // => 'pebbles' - * - * // using the `_.matchesProperty` callback shorthand - * _.findKey(users, 'active', false); - * // => 'fred' - * - * // using the `_.property` callback shorthand - * _.findKey(users, 'active'); - * // => 'barney' - */ - var findKey = createFindKey(baseForOwn); - - /** - * This method is like `_.findKey` except that it iterates over elements of - * a collection in the opposite order. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {string|undefined} Returns the key of the matched element, else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findLastKey(users, function(chr) { - * return chr.age < 40; - * }); - * // => returns `pebbles` assuming `_.findKey` returns `barney` - * - * // using the `_.matches` callback shorthand - * _.findLastKey(users, { 'age': 36, 'active': true }); - * // => 'barney' - * - * // using the `_.matchesProperty` callback shorthand - * _.findLastKey(users, 'active', false); - * // => 'fred' - * - * // using the `_.property` callback shorthand - * _.findLastKey(users, 'active'); - * // => 'pebbles' - */ - var findLastKey = createFindKey(baseForOwnRight); - - /** - * Iterates over own and inherited enumerable properties of an object invoking - * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked - * with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forIn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'a', 'b', and 'c' (iteration order is not guaranteed) - */ - var forIn = createForIn(baseFor); - - /** - * This method is like `_.forIn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forInRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c' - */ - var forInRight = createForIn(baseForRight); - - /** - * Iterates over own enumerable properties of an object invoking `iteratee` - * for each property. The `iteratee` is bound to `thisArg` and invoked with - * three arguments: (value, key, object). Iteratee functions may exit iteration - * early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'a' and 'b' (iteration order is not guaranteed) - */ - var forOwn = createForOwn(baseForOwn); - - /** - * This method is like `_.forOwn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwnRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b' - */ - var forOwnRight = createForOwn(baseForOwnRight); - - /** - * Creates an array of function property names from all enumerable properties, - * own and inherited, of `object`. - * - * @static - * @memberOf _ - * @alias methods - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the new array of property names. - * @example - * - * _.functions(_); - * // => ['after', 'ary', 'assign', ...] - */ - function functions(object) { - return baseFunctions(object, keysIn(object)); - } - - /** - * Gets the property value at `path` of `object`. If the resolved value is - * `undefined` the `defaultValue` is used in its place. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ - function get(object, path, defaultValue) { - var result = - object == null - ? undefined - : baseGet(object, toPath(path), path + ''); - return result === undefined ? defaultValue : result; - } - - /** - * Checks if `path` is a direct property. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` is a direct property, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - */ - function has(object, path) { - if (object == null) { - return false; - } - var result = hasOwnProperty.call(object, path); - if (!result && !isKey(path)) { - path = toPath(path); - object = - path.length == 1 - ? object - : baseGet(object, baseSlice(path, 0, -1)); - if (object == null) { - return false; - } - path = last(path); - result = hasOwnProperty.call(object, path); - } - return ( - result || - (isLength(object.length) && - isIndex(path, object.length) && - (isArray(object) || isArguments(object))) - ); - } - - /** - * Creates an object composed of the inverted keys and values of `object`. - * If `object` contains duplicate values, subsequent values overwrite property - * assignments of previous values unless `multiValue` is `true`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to invert. - * @param {boolean} [multiValue] Allow multiple values per key. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invert(object); - * // => { '1': 'c', '2': 'b' } - * - * // with `multiValue` - * _.invert(object, true); - * // => { '1': ['a', 'c'], '2': ['b'] } - */ - function invert(object, multiValue, guard) { - if (guard && isIterateeCall(object, multiValue, guard)) { - multiValue = undefined; - } - var index = -1, - props = keys(object), - length = props.length, - result = {}; - - while (++index < length) { - var key = props[index], - value = object[key]; - - if (multiValue) { - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } - } else { - result[value] = key; - } - } - return result; - } - - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - var keys = !nativeKeys - ? shimKeys - : function(object) { - var Ctor = object == null ? undefined : object.constructor; - if ( - (typeof Ctor == 'function' && - Ctor.prototype === object) || - (typeof object != 'function' && isArrayLike(object)) - ) { - return shimKeys(object); - } - return isObject(object) ? nativeKeys(object) : []; - }; - - /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ - function keysIn(object) { - if (object == null) { - return []; - } - if (!isObject(object)) { - object = Object(object); - } - var length = object.length; - length = - (length && - isLength(length) && - (isArray(object) || isArguments(object)) && - length) || - 0; - - var Ctor = object.constructor, - index = -1, - isProto = - typeof Ctor == 'function' && Ctor.prototype === object, - result = Array(length), - skipIndexes = length > 0; - - while (++index < length) { - result[index] = index + ''; - } - for (var key in object) { - if ( - !(skipIndexes && isIndex(key, length)) && - !( - key == 'constructor' && - (isProto || !hasOwnProperty.call(object, key)) - ) - ) { - result.push(key); - } - } - return result; - } - - /** - * The opposite of `_.mapValues`; this method creates an object with the - * same values as `object` and keys generated by running each own enumerable - * property of `object` through `iteratee`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the new mapped object. - * @example - * - * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { - * return key + value; - * }); - * // => { 'a1': 1, 'b2': 2 } - */ - var mapKeys = createObjectMapper(true); - - /** - * Creates an object with the same keys as `object` and values generated by - * running each own enumerable property of `object` through `iteratee`. The - * iteratee function is bound to `thisArg` and invoked with three arguments: - * (value, key, object). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the new mapped object. - * @example - * - * _.mapValues({ 'a': 1, 'b': 2 }, function(n) { - * return n * 3; - * }); - * // => { 'a': 3, 'b': 6 } - * - * var users = { - * 'fred': { 'user': 'fred', 'age': 40 }, - * 'pebbles': { 'user': 'pebbles', 'age': 1 } - * }; - * - * // using the `_.property` callback shorthand - * _.mapValues(users, 'age'); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) - */ - var mapValues = createObjectMapper(); - - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {Function|...(string|string[])} [predicate] The function invoked per - * iteration or property names to omit, specified as individual property - * names or arrays of property names. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.omit(object, 'age'); - * // => { 'user': 'fred' } - * - * _.omit(object, _.isNumber); - * // => { 'user': 'fred' } - */ - var omit = restParam(function(object, props) { - if (object == null) { - return {}; - } - if (typeof props[0] != 'function') { - var props = arrayMap(baseFlatten(props), String); - return pickByArray( - object, - baseDifference(keysIn(object), props) - ); - } - var predicate = bindCallback(props[0], props[1], 3); - return pickByCallback(object, function(value, key, object) { - return !predicate(value, key, object); - }); - }); - - /** - * Creates a two dimensional array of the key-value pairs for `object`, - * e.g. `[[key1, value1], [key2, value2]]`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the new array of key-value pairs. - * @example - * - * _.pairs({ 'barney': 36, 'fred': 40 }); - * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed) - */ - function pairs(object) { - object = toObject(object); - - var index = -1, - props = keys(object), - length = props.length, - result = Array(length); - - while (++index < length) { - var key = props[index]; - result[index] = [key, object[key]]; - } - return result; - } - - /** - * Creates an object composed of the picked `object` properties. Property - * names may be specified as individual arguments or as arrays of property - * names. If `predicate` is provided it is invoked for each property of `object` - * picking the properties `predicate` returns truthy for. The predicate is - * bound to `thisArg` and invoked with three arguments: (value, key, object). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {Function|...(string|string[])} [predicate] The function invoked per - * iteration or property names to pick, specified as individual property - * names or arrays of property names. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.pick(object, 'user'); - * // => { 'user': 'fred' } - * - * _.pick(object, _.isString); - * // => { 'user': 'fred' } - */ - var pick = restParam(function(object, props) { - if (object == null) { - return {}; - } - return typeof props[0] == 'function' - ? pickByCallback(object, bindCallback(props[0], props[1], 3)) - : pickByArray(object, baseFlatten(props)); - }); - - /** - * This method is like `_.get` except that if the resolved value is a function - * it is invoked with the `this` binding of its parent object and its result - * is returned. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to resolve. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; - * - * _.result(object, 'a[0].b.c1'); - * // => 3 - * - * _.result(object, 'a[0].b.c2'); - * // => 4 - * - * _.result(object, 'a.b.c', 'default'); - * // => 'default' - * - * _.result(object, 'a.b.c', _.constant('default')); - * // => 'default' - */ - function result(object, path, defaultValue) { - var result = object == null ? undefined : object[path]; - if (result === undefined) { - if (object != null && !isKey(path, object)) { - path = toPath(path); - object = - path.length == 1 - ? object - : baseGet(object, baseSlice(path, 0, -1)); - result = object == null ? undefined : object[last(path)]; - } - result = result === undefined ? defaultValue : result; - } - return isFunction(result) ? result.call(object) : result; - } - - /** - * Sets the property value of `path` on `object`. If a portion of `path` - * does not exist it is created. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to augment. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @returns {Object} Returns `object`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.set(object, 'a[0].b.c', 4); - * console.log(object.a[0].b.c); - * // => 4 - * - * _.set(object, 'x[0].y.z', 5); - * console.log(object.x[0].y.z); - * // => 5 - */ - function set(object, path, value) { - if (object == null) { - return object; - } - var pathKey = path + ''; - path = - object[pathKey] != null || isKey(path, object) - ? [pathKey] - : toPath(path); - - var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; - - while (nested != null && ++index < length) { - var key = path[index]; - if (isObject(nested)) { - if (index == lastIndex) { - nested[key] = value; - } else if (nested[key] == null) { - nested[key] = isIndex(path[index + 1]) ? [] : {}; - } - } - nested = nested[key]; - } - return object; - } - - /** - * An alternative to `_.reduce`; this method transforms `object` to a new - * `accumulator` object which is the result of running each of its own enumerable - * properties through `iteratee`, with each invocation potentially mutating - * the `accumulator` object. The `iteratee` is bound to `thisArg` and invoked - * with four arguments: (accumulator, value, key, object). Iteratee functions - * may exit iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Array|Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The custom accumulator value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * _.transform([2, 3, 4], function(result, n) { - * result.push(n *= n); - * return n % 2 == 0; - * }); - * // => [4, 9] - * - * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) { - * result[key] = n * 3; - * }); - * // => { 'a': 3, 'b': 6 } - */ - function transform(object, iteratee, accumulator, thisArg) { - var isArr = isArray(object) || isTypedArray(object); - iteratee = getCallback(iteratee, thisArg, 4); - - if (accumulator == null) { - if (isArr || isObject(object)) { - var Ctor = object.constructor; - if (isArr) { - accumulator = isArray(object) ? new Ctor() : []; - } else { - accumulator = baseCreate( - isFunction(Ctor) ? Ctor.prototype : undefined - ); - } - } else { - accumulator = {}; - } - } - (isArr ? arrayEach : baseForOwn)(object, function( - value, - index, - object - ) { - return iteratee(accumulator, value, index, object); - }); - return accumulator; - } - - /** - * Creates an array of the own enumerable property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) - * - * _.values('hi'); - * // => ['h', 'i'] - */ - function values(object) { - return baseValues(object, keys(object)); - } - - /** - * Creates an array of the own and inherited enumerable property values - * of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.valuesIn(new Foo); - * // => [1, 2, 3] (iteration order is not guaranteed) - */ - function valuesIn(object) { - return baseValues(object, keysIn(object)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Checks if `n` is between `start` and up to but not including, `end`. If - * `end` is not specified it is set to `start` with `start` then set to `0`. - * - * @static - * @memberOf _ - * @category Number - * @param {number} n The number to check. - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `n` is in the range, else `false`. - * @example - * - * _.inRange(3, 2, 4); - * // => true - * - * _.inRange(4, 8); - * // => true - * - * _.inRange(4, 2); - * // => false - * - * _.inRange(2, 2); - * // => false - * - * _.inRange(1.2, 2); - * // => true - * - * _.inRange(5.2, 4); - * // => false - */ - function inRange(value, start, end) { - start = +start || 0; - if (end === undefined) { - end = start; - start = 0; - } else { - end = +end || 0; - } - return ( - value >= nativeMin(start, end) && - value < nativeMax(start, end) - ); - } - - /** - * Produces a random number between `min` and `max` (inclusive). If only one - * argument is provided a number between `0` and the given number is returned. - * If `floating` is `true`, or either `min` or `max` are floats, a floating-point - * number is returned instead of an integer. - * - * @static - * @memberOf _ - * @category Number - * @param {number} [min=0] The minimum possible value. - * @param {number} [max=1] The maximum possible value. - * @param {boolean} [floating] Specify returning a floating-point number. - * @returns {number} Returns the random number. - * @example - * - * _.random(0, 5); - * // => an integer between 0 and 5 - * - * _.random(5); - * // => also an integer between 0 and 5 - * - * _.random(5, true); - * // => a floating-point number between 0 and 5 - * - * _.random(1.2, 5.2); - * // => a floating-point number between 1.2 and 5.2 - */ - function random(min, max, floating) { - if (floating && isIterateeCall(min, max, floating)) { - max = floating = undefined; - } - var noMin = min == null, - noMax = max == null; - - if (floating == null) { - if (noMax && typeof min == 'boolean') { - floating = min; - min = 1; - } else if (typeof max == 'boolean') { - floating = max; - noMax = true; - } - } - if (noMin && noMax) { - max = 1; - noMax = false; - } - min = +min || 0; - if (noMax) { - max = min; - min = 0; - } else { - max = +max || 0; - } - if (floating || min % 1 || max % 1) { - var rand = nativeRandom(); - return nativeMin( - min + - rand * - (max - - min + - parseFloat('1e-' + ((rand + '').length - 1))), - max - ); - } - return baseRandom(min, max); - } - - /*------------------------------------------------------------------------*/ - - /** - * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the camel cased string. - * @example - * - * _.camelCase('Foo Bar'); - * // => 'fooBar' - * - * _.camelCase('--foo-bar'); - * // => 'fooBar' - * - * _.camelCase('__foo_bar__'); - * // => 'fooBar' - */ - var camelCase = createCompounder(function(result, word, index) { - word = word.toLowerCase(); - return ( - result + - (index ? word.charAt(0).toUpperCase() + word.slice(1) : word) - ); - }); - - /** - * Capitalizes the first character of `string`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to capitalize. - * @returns {string} Returns the capitalized string. - * @example - * - * _.capitalize('fred'); - * // => 'Fred' - */ - function capitalize(string) { - string = baseToString(string); - return ( - string && string.charAt(0).toUpperCase() + string.slice(1) - ); - } - - /** - * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) - * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to deburr. - * @returns {string} Returns the deburred string. - * @example - * - * _.deburr('déjà vu'); - * // => 'deja vu' - */ - function deburr(string) { - string = baseToString(string); - return ( - string && - string - .replace(reLatin1, deburrLetter) - .replace(reComboMark, '') - ); - } - - /** - * Checks if `string` ends with the given target string. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to search. - * @param {string} [target] The string to search for. - * @param {number} [position=string.length] The position to search from. - * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`. - * @example - * - * _.endsWith('abc', 'c'); - * // => true - * - * _.endsWith('abc', 'b'); - * // => false - * - * _.endsWith('abc', 'b', 2); - * // => true - */ - function endsWith(string, target, position) { - string = baseToString(string); - target = target + ''; - - var length = string.length; - position = - position === undefined - ? length - : nativeMin(position < 0 ? 0 : +position || 0, length); - - position -= target.length; - return ( - position >= 0 && string.indexOf(target, position) == position - ); - } - - /** - * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string` to - * their corresponding HTML entities. - * - * **Note:** No other characters are escaped. To escape additional characters - * use a third-party library like [_he_](https://mths.be/he). - * - * Though the ">" character is escaped for symmetry, characters like - * ">" and "/" don't need escaping in HTML and have no special meaning - * unless they're part of a tag or unquoted attribute value. - * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) - * (under "semi-related fun fact") for more details. - * - * Backticks are escaped because in Internet Explorer < 9, they can break out - * of attribute values or HTML comments. See [#59](https://html5sec.org/#59), - * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and - * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/) - * for more details. - * - * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping) - * to reduce XSS vectors. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' - */ - function escape(string) { - // Reset `lastIndex` because in IE < 9 `String#replace` does not. - string = baseToString(string); - return string && reHasUnescapedHtml.test(string) - ? string.replace(reUnescapedHtml, escapeHtmlChar) - : string; - } - - /** - * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?", - * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escapeRegExp('[lodash](https://lodash.com/)'); - * // => '\[lodash\]\(https:\/\/lodash\.com\/\)' - */ - function escapeRegExp(string) { - string = baseToString(string); - return string && reHasRegExpChars.test(string) - ? string.replace(reRegExpChars, escapeRegExpChar) - : string || '(?:)'; - } - - /** - * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the kebab cased string. - * @example - * - * _.kebabCase('Foo Bar'); - * // => 'foo-bar' - * - * _.kebabCase('fooBar'); - * // => 'foo-bar' - * - * _.kebabCase('__foo_bar__'); - * // => 'foo-bar' - */ - var kebabCase = createCompounder(function(result, word, index) { - return result + (index ? '-' : '') + word.toLowerCase(); - }); - - /** - * Pads `string` on the left and right sides if it's shorter than `length`. - * Padding characters are truncated if they can't be evenly divided by `length`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.pad('abc', 8); - * // => ' abc ' - * - * _.pad('abc', 8, '_-'); - * // => '_-abc_-_' - * - * _.pad('abc', 3); - * // => 'abc' - */ - function pad(string, length, chars) { - string = baseToString(string); - length = +length; - - var strLength = string.length; - if (strLength >= length || !nativeIsFinite(length)) { - return string; - } - var mid = (length - strLength) / 2, - leftLength = nativeFloor(mid), - rightLength = nativeCeil(mid); - - chars = createPadding('', rightLength, chars); - return chars.slice(0, leftLength) + string + chars; - } - - /** - * Pads `string` on the left side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padLeft('abc', 6); - * // => ' abc' - * - * _.padLeft('abc', 6, '_-'); - * // => '_-_abc' - * - * _.padLeft('abc', 3); - * // => 'abc' - */ - var padLeft = createPadDir(); - - /** - * Pads `string` on the right side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padRight('abc', 6); - * // => 'abc ' - * - * _.padRight('abc', 6, '_-'); - * // => 'abc_-_' - * - * _.padRight('abc', 3); - * // => 'abc' - */ - var padRight = createPadDir(true); - - /** - * Converts `string` to an integer of the specified radix. If `radix` is - * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal, - * in which case a `radix` of `16` is used. - * - * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E) - * of `parseInt`. - * - * @static - * @memberOf _ - * @category String - * @param {string} string The string to convert. - * @param {number} [radix] The radix to interpret `value` by. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {number} Returns the converted integer. - * @example - * - * _.parseInt('08'); - * // => 8 - * - * _.map(['6', '08', '10'], _.parseInt); - * // => [6, 8, 10] - */ - function parseInt(string, radix, guard) { - // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`. - // Chrome fails to trim leading>>0?-2147483648:0):q)|0)>=0){q=g+2|0;r=m;return q|0}k[l>>2]=k[a>>2];k[l+4>>2]=k[a+4>>2];k[l+8>>2]=k[a+8>>2];k[a>>2]=k[b>>2];k[a+4>>2]=k[b+4>>2];k[a+8>>2]=k[b+8>>2];k[b>>2]=k[l>>2];k[b+4>>2]=k[l+4>>2];k[b+8>>2]=k[l+8>>2];q=g+3|0;r=m;return q|0}function ml(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;n=0;p=r;r=r+32|0;m=p+12|0;o=p;if(!b){r=p;return}else c=b;a:while(1){switch(i[c>>0]|0){case 0:break a;case 58:{n=4;break a}default:{}}c=c+1|0}b:do if((n|0)==4)if(c){e=m+4|0;f=m+8|0;g=m+1|0;h=a+328|0;j=a+332|0;l=a+324|0;c:while(1){lE(m,b,c-b|0);d=i[m>>0]|0;b=(d&1)==0;d=b?(d&255)>>>1:k[e>>2]|0;do if(d|0){if((i[(b?g:k[f>>2]|0)+d+-1>>0]|0)!=47){x=0;sa(440,m|0,47);d=x;x=0;if(d&1)break c}b=k[h>>2]|0;if((b|0)==(k[j>>2]|0)){x=0;sa(439,l|0,m|0);d=x;x=0;if(d&1)break c;else break}x=0;sa(430,b|0,m|0);d=x;x=0;if(d&1)break c;k[h>>2]=(k[h>>2]|0)+12}while(0);b=c+1|0;c=b;d:while(1){d=i[c>>0]|0;switch(d<<24>>24){case 0:case 58:break d;default:{}}c=c+1|0}P1(m);if(!(d<<24>>24))break b}p=mb()|0;P1(m);yb(p|0)}while(0);lE(o,b,OD(b)|0);c=i[o>>0]|0;b=(c&1)==0;c=b?(c&255)>>>1:k[o+4>>2]|0;e:do if(c|0){if((i[(b?o+1|0:k[o+8>>2]|0)+c+-1>>0]|0)==47)n=22;else{x=0;sa(440,o|0,47);m=x;x=0;if(!(m&1))n=22}do if((n|0)==22){b=a+328|0;c=k[b>>2]|0;if((c|0)==(k[a+332>>2]|0)){x=0;sa(439,a+324|0,o|0);a=x;x=0;if(a&1)break;else break e}x=0;sa(430,c|0,o|0);a=x;x=0;if(!(a&1)){k[b>>2]=(k[b>>2]|0)+12;break e}}while(0);p=mb()|0;P1(o);yb(p|0)}while(0);P1(o);r=p;return}function nl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0;p=0;n=r;r=r+144|0;j=n+104|0;d=n+88|0;o=n+76|0;g=n+64|0;h=n;l=n+24|0;m=n+8|0;lE(d,37420,7);x=0;f=Ka(867,a|0,d|0)|0;a=x;x=0;if(a&1){p=mb()|0;P1(d);yb(p|0)}b=k[f>>2]|0;P1(d);if(b|0){f=Ot(b,8,448,0)|0;if(f|0){i[f+57>>0]=42;p=f;r=n;return p|0}}a=k[(k[b>>2]|0)+20>>2]|0;q=k[c+16>>2]|0;f=k[q+4>>2]|0;d=h;k[d>>2]=k[q>>2];k[d+4>>2]=f;k[j>>2]=k[h>>2];k[j+4>>2]=k[h+4>>2];Pc[a&255](g,b,j);x=0;Qa(113,o|0,g|0,34);a=x;x=0;if(a&1){q=mb()|0;P1(g);yb(q|0)}P1(g);d=c+36|0;x=0;g=Ka(856,d|0,76)|0;q=x;x=0;if(q&1)p=13;else{h=l;f=e;b=h+40|0;do{k[h>>2]=k[f>>2];h=h+4|0;f=f+4|0}while((h|0)<(b|0));x=0;sa(430,m|0,o|0);q=x;x=0;if(q&1)p=13;else{x=0;h=j;f=l;b=h+40|0;do{k[h>>2]=k[f>>2];h=h+4|0;f=f+4|0}while((h|0)<(b|0));qa(5,g|0,j|0,m|0,0,0);q=x;x=0;if(!(q&1)){x=0;f=Ka(857,d|0,g|0)|0;q=x;x=0;if(!(q&1)){P1(m);i[f+48>>0]=1;i[f+57>>0]=42;P1(o);q=f;r=n;return q|0}}f=mb()|0;P1(m)}}if((p|0)==13)f=mb()|0;P1(o);q=f;yb(q|0);return 0}function ol(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;n=0;p=r;r=r+32|0;m=p+12|0;o=p;if(!b){r=p;return}else c=b;a:while(1){switch(i[c>>0]|0){case 0:break a;case 58:{n=4;break a}default:{}}c=c+1|0}b:do if((n|0)==4)if(c){e=m+4|0;f=m+8|0;g=m+1|0;h=a+316|0;j=a+320|0;l=a+312|0;c:while(1){lE(m,b,c-b|0);d=i[m>>0]|0;b=(d&1)==0;d=b?(d&255)>>>1:k[e>>2]|0;do if(d|0){if((i[(b?g:k[f>>2]|0)+d+-1>>0]|0)!=47){x=0;sa(440,m|0,47);d=x;x=0;if(d&1)break c}b=k[h>>2]|0;if((b|0)==(k[j>>2]|0)){x=0;sa(439,l|0,m|0);d=x;x=0;if(d&1)break c;else break}x=0;sa(430,b|0,m|0);d=x;x=0;if(d&1)break c;k[h>>2]=(k[h>>2]|0)+12}while(0);b=c+1|0;c=b;d:while(1){d=i[c>>0]|0;switch(d<<24>>24){case 0:case 58:break d;default:{}}c=c+1|0}P1(m);if(!(d<<24>>24))break b}p=mb()|0;P1(m);yb(p|0)}while(0);lE(o,b,OD(b)|0);c=i[o>>0]|0;b=(c&1)==0;c=b?(c&255)>>>1:k[o+4>>2]|0;e:do if(c|0){if((i[(b?o+1|0:k[o+8>>2]|0)+c+-1>>0]|0)==47)n=22;else{x=0;sa(440,o|0,47);m=x;x=0;if(!(m&1))n=22}do if((n|0)==22){b=a+316|0;c=k[b>>2]|0;if((c|0)==(k[a+320>>2]|0)){x=0;sa(439,a+312|0,o|0);a=x;x=0;if(a&1)break;else break e}x=0;sa(430,c|0,o|0);a=x;x=0;if(!(a&1)){k[b>>2]=(k[b>>2]|0)+12;break e}}while(0);p=mb()|0;P1(o);yb(p|0)}while(0);P1(o);r=p;return}function pl(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0;if(!a){m=0;return m|0}a=k[a+64>>2]|0;if(!a){m=0;return m|0}c=k[a+68>>2]|0;h=(k[a+72>>2]|0)-c>>2;if(!h){m=0;return m|0}e=a+68|0;c=k[c>>2]|0;d=(c|0)==0;if((b|0)!=3){if(d)w3();else{f=c;g=0}a:while(1){a=k[(k[(k[f>>2]|0)+-4>>2]|0)+4>>2]|0;if((a|0)==30973|(a|0)==33080|(a|0)==33117){j=1;a=32;break}do if((a|0)==(k[135]|0)){if(co(f,b)|0){j=1;a=32;break a}}else{if((a|0)==31028)if(lx(f,b)|0){j=1;a=32;break a}else break;if((a|0)==(k[147]|0))if(pl(f,b)|0){j=1;a=32;break a}else break;if(Ot(f,568,552,0)|0)if(Ll(k[f+64>>2]|0,b)|0){j=1;a=32;break a}}while(0);g=g+1|0;if(g>>>0>=h>>>0){j=0;a=32;break}f=k[(k[e>>2]|0)+(g<<2)>>2]|0;if(!f){a=20;break}}if((a|0)==20)w3();else if((a|0)==32)return j|0}if(d)w3();else{l=c;m=0}b:while(1){a=k[(k[(k[l>>2]|0)+-4>>2]|0)+4>>2]|0;if((a|0)==30973|(a|0)==33080){j=1;a=32;break}do if((a|0)==33117){if(i[l+68>>0]|0){j=1;a=32;break b}}else{if((a|0)==(k[135]|0))if(co(l,3)|0){j=1;a=32;break b}else break;if((a|0)==31028)if(lx(l,3)|0){j=1;a=32;break b}else break;if((a|0)==(k[147]|0))if(pl(l,3)|0){j=1;a=32;break b}else break;if(Ot(l,568,552,0)|0)if(Ll(k[l+64>>2]|0,3)|0){j=1;a=32;break b}}while(0);m=m+1|0;if(m>>>0>=h>>>0){j=0;a=32;break}l=k[(k[e>>2]|0)+(m<<2)>>2]|0;if(!l){a=20;break}}if((a|0)==20)w3();else if((a|0)==32)return j|0;return 0}function ql(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0,n=0,o=0;o=r;r=r+64|0;g=o+24|0;b=o+12|0;h=o;lE(b,38223,4);x=0;l=g;m=e;n=l+40|0;do{k[l>>2]=k[m>>2];l=l+4|0;m=m+4|0}while((l|0)<(n|0));j=ta(124,b|0,a|0,d|0,g|0,f|0,c|0)|0;n=x;x=0;if(n&1){o=mb()|0;P1(b);yb(o|0)}P1(b);lE(h,38228,4);x=0;l=g;m=e;n=l+40|0;do{k[l>>2]=k[m>>2];l=l+4|0;m=m+4|0}while((l|0)<(n|0));b=wa(27,h|0,a|0,d|0,g|0,f|0)|0;n=x;x=0;if(n&1){o=mb()|0;P1(h);yb(o|0)}P1(h);x=0;b=Ka(861,j+56|0,b|0)|0;n=x;x=0;if(!(n&1)){e=b;r=o;return e|0}m=hb(4448,0)|0;n=M;n=(n|0)==(tb(4448)|0);Bb(m|0)|0;if(!n){x=0;pa(4);x=0;b=mb()|0;x=0;pa(3);n=x;x=0;if(n&1){n=Eb(0)|0;Nba(n)}else{o=b;yb(o|0)}}b=c+36|0;x=0;g=Ka(856,b|0,56)|0;c=x;x=0;if(!(c&1)){k[g+4>>2]=0;l=g+8|0;m=e;n=l+40|0;do{k[l>>2]=k[m>>2];l=l+4|0;m=m+4|0}while((l|0)<(n|0));i[g+48>>0]=0;i[g+49>>0]=0;i[g+50>>0]=0;k[g>>2]=6380;k[g+52>>2]=8;x=0;b=Ka(857,b|0,g|0)|0;e=x;x=0;if(!(e&1)){xb();e=b;r=o;return e|0}}b=mb()|0;x=0;pa(3);o=x;x=0;if(o&1){o=Eb(0)|0;Nba(o)}else{o=b;yb(o|0)}return 0}function rl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,l=0,m=0;i=r;r=r+16|0;l=i;Xd(l,b,c);k[a>>2]=0;h=a+4|0;k[h>>2]=0;k[a+8>>2]=0;j=l+4|0;e=k[j>>2]|0;g=k[l>>2]|0;f=(e-g|0)/20|0;c=g;a:do if((e|0)!=(g|0)){g=a+8|0;d=0;e=0;b=0;while(1){c=c+(b*20|0)|0;if((d|0)==(e|0)){x=0;sa(510,a|0,c|0);e=x;x=0;if(e&1)break}else{m=c;c=k[m+4>>2]|0;e=d;k[e>>2]=k[m>>2];k[e+4>>2]=c;k[h>>2]=(k[h>>2]|0)+8}b=b+1|0;c=k[l>>2]|0;if(b>>>0>=f>>>0)break a;d=k[h>>2]|0;e=k[g>>2]|0}g=mb()|0;c=k[a>>2]|0;b=c;if(c|0){d=k[h>>2]|0;if((d|0)!=(c|0))k[h>>2]=d+(~((d+-8-b|0)>>>3)<<3);uha(c)}c=k[l>>2]|0;if(!c)yb(g|0);b=k[j>>2]|0;if((b|0)!=(c|0)){do{d=b+-20|0;k[j>>2]=d;e=b+-12|0;f=k[e>>2]|0;if(!f)b=d;else{d=b+-8|0;b=k[d>>2]|0;if((b|0)==(f|0))b=f;else{do{m=b+-12|0;k[d>>2]=m;P1(m);b=k[d>>2]|0}while((b|0)!=(f|0));b=k[e>>2]|0}uha(b);b=k[j>>2]|0}}while((b|0)!=(c|0));c=k[l>>2]|0}uha(c);yb(g|0)}while(0);if(!c){r=i;return}b=k[j>>2]|0;if((b|0)!=(c|0)){do{d=b+-20|0;k[j>>2]=d;e=b+-12|0;f=k[e>>2]|0;if(!f)b=d;else{d=b+-8|0;b=k[d>>2]|0;if((b|0)==(f|0))b=f;else{do{m=b+-12|0;k[d>>2]=m;P1(m);b=k[d>>2]|0}while((b|0)!=(f|0));b=k[e>>2]|0}uha(b);b=k[j>>2]|0}}while((b|0)!=(c|0));c=k[l>>2]|0}uha(c);r=i;return}function sl(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;j=r;r=r+48|0;i=j+8|0;e=j;g=k[b+68>>2]|0;f=k[b+64>>2]|0;h=a+4|0;nB(i,IN(k[h>>2]|0)|0,1);c=k[h>>2]|0;k[e>>2]=i;d=c+28|0;b=k[d>>2]|0;if(b>>>0<(k[c+32>>2]|0)>>>0){k[b>>2]=i;k[d>>2]=(k[d>>2]|0)+4}else{x=0;sa(488,c+24|0,e|0);e=x;x=0;if(e&1){j=mb()|0;h=i+20|0;iB(h);h=i+4|0;h=k[h>>2]|0;az(i,h);yb(j|0)}}while(1){x=0;b=Ka(k[(k[g>>2]|0)+40>>2]|0,g|0,a|0)|0;e=x;x=0;if(e&1){c=10;break}x=0;b=ua(k[(k[b>>2]|0)+60>>2]|0,b|0)|0;e=x;x=0;if(e&1){c=10;break}if(!b){c=14;break}x=0;b=Ka(k[(k[f>>2]|0)+40>>2]|0,f|0,a|0)|0;e=x;x=0;if(e&1){c=10;break}if(b|0){c=13;break}}if((c|0)==10){j=mb()|0;h=i+20|0;iB(h);h=i+4|0;h=k[h>>2]|0;az(i,h);yb(j|0)}else if((c|0)==13){h=(k[h>>2]|0)+28|0;k[h>>2]=(k[h>>2]|0)+-4;h=b;a=i+20|0;iB(a);a=i+4|0;a=k[a>>2]|0;az(i,a);r=j;return h|0}else if((c|0)==14){h=(k[h>>2]|0)+28|0;k[h>>2]=(k[h>>2]|0)+-4;h=0;a=i+20|0;iB(a);a=i+4|0;a=k[a>>2]|0;az(i,a);r=j;return h|0}return 0}function tl(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0;m=r;r=r+80|0;e=m+60|0;f=m+48|0;g=m+36|0;h=m+24|0;j=m+12|0;l=m;c=Ot(b,96,752,0)|0;if(c|0){a=ng(a,c)|0;r=m;return a|0}d=a+68|0;_G(e,d);c=b+68|0;x=0;sa(430,f|0,c|0);n=x;x=0;if(n&1){n=mb()|0;P1(e);yb(n|0)}n=Ir(e,f)|0;P1(f);P1(e);if(n){_G(g,a+80|0);x=0;sa(430,h|0,b+80|0);n=x;x=0;if(n&1){n=mb()|0;P1(g);yb(n|0)}else{b=i[g>>0]|0;l=(b&1)==0;b=l?(b&255)>>>1:k[g+4>>2]|0;a=i[h>>0]|0;n=(a&1)==0;a=n?(a&255)>>>1:k[h+4>>2]|0;n=tG(l?g+1|0:k[g+8>>2]|0,n?h+1|0:k[h+8>>2]|0,a>>>0>>0?a:b)|0;P1(h);P1(g);n=(((n|0)==0?(b>>>0>>0?-2147483648:0):n)|0)<0;r=m;return n|0}}else{_G(j,d);x=0;sa(430,l|0,c|0);n=x;x=0;if(n&1){n=mb()|0;P1(j);yb(n|0)}else{b=i[j>>0]|0;h=(b&1)==0;b=h?(b&255)>>>1:k[j+4>>2]|0;a=i[l>>0]|0;n=(a&1)==0;a=n?(a&255)>>>1:k[l+4>>2]|0;n=tG(h?j+1|0:k[j+8>>2]|0,n?l+1|0:k[l+8>>2]|0,a>>>0>>0?a:b)|0;P1(l);P1(j);n=(((n|0)==0?(b>>>0>>0?-2147483648:0):n)|0)<0;r=m;return n|0}}return 0}function ul(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0;m=r;r=r+80|0;e=m+60|0;f=m+48|0;g=m+36|0;h=m+24|0;j=m+12|0;l=m;c=Ot(b,96,144,0)|0;if(c|0){a=pg(a,c)|0;r=m;return a|0}d=a+68|0;_G(e,d);c=b+68|0;x=0;sa(430,f|0,c|0);n=x;x=0;if(n&1){n=mb()|0;P1(e);yb(n|0)}n=Ir(e,f)|0;P1(f);P1(e);if(n){_G(g,a+80|0);x=0;sa(430,h|0,b+80|0);n=x;x=0;if(n&1){n=mb()|0;P1(g);yb(n|0)}else{b=i[g>>0]|0;l=(b&1)==0;b=l?(b&255)>>>1:k[g+4>>2]|0;a=i[h>>0]|0;n=(a&1)==0;a=n?(a&255)>>>1:k[h+4>>2]|0;n=tG(l?g+1|0:k[g+8>>2]|0,n?h+1|0:k[h+8>>2]|0,a>>>0>>0?a:b)|0;P1(h);P1(g);n=(((n|0)==0?(b>>>0>>0?-2147483648:0):n)|0)<0;r=m;return n|0}}else{_G(j,d);x=0;sa(430,l|0,c|0);n=x;x=0;if(n&1){n=mb()|0;P1(j);yb(n|0)}else{b=i[j>>0]|0;h=(b&1)==0;b=h?(b&255)>>>1:k[j+4>>2]|0;a=i[l>>0]|0;n=(a&1)==0;a=n?(a&255)>>>1:k[l+4>>2]|0;n=tG(h?j+1|0:k[j+8>>2]|0,n?l+1|0:k[l+8>>2]|0,a>>>0>>0?a:b)|0;P1(l);P1(j);n=(((n|0)==0?(b>>>0>>0?-2147483648:0):n)|0)<0;r=m;return n|0}}return 0}function vl(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0,m=0;m=r;r=r+48|0;f=m+36|0;g=m+24|0;h=m+12|0;l=m;c=Ot(b,64,448,0)|0;if(c|0){_G(f,a+60|0);x=0;sa(430,g|0,c+60|0);l=x;x=0;if(l&1){m=mb()|0;P1(f);yb(m|0)}e=j[f>>1]|0;a=(e&1)==0;b=(e&254)>>>1;d=a?b:k[f+4>>2]|0;l=i[g>>0]|0;c=(l&1)==0;e=(e&65535)>>>8&255;a:do if((d|0)==((c?(l&255)>>>1:k[g+4>>2]|0)|0)){c=c?g+1|0:k[g+8>>2]|0;if(!a){c=(tG(k[f+8>>2]|0,c,d)|0)==0;break}if(!d)c=1;else if(e<<24>>24==(i[c>>0]|0)){a=f+1|0;while(1){b=b+-1|0;a=a+1|0;if(!b){c=1;break a}c=c+1|0;if((i[a>>0]|0)!=(i[c>>0]|0)){c=0;break}}}else c=0}else c=0;while(0);P1(g);P1(f);h=c;l=1;l=h&l;r=m;return l|0}c=Ot(b,64,432,0)|0;if(!c){h=0;l=0;l=h&l;r=m;return l|0}_G(h,a+60|0);x=0;sa(430,l|0,c+60|0);g=x;x=0;if(g&1){m=mb()|0;P1(h);yb(m|0)}e=j[h>>1]|0;a=(e&1)==0;b=(e&254)>>>1;d=a?b:k[h+4>>2]|0;g=i[l>>0]|0;c=(g&1)==0;e=(e&65535)>>>8&255;b:do if((d|0)==((c?(g&255)>>>1:k[l+4>>2]|0)|0)){c=c?l+1|0:k[l+8>>2]|0;if(!a){c=(tG(k[h+8>>2]|0,c,d)|0)==0;break}if(!d)c=1;else if(e<<24>>24==(i[c>>0]|0)){a=h+1|0;while(1){b=b+-1|0;a=a+1|0;if(!b){c=1;break b}c=c+1|0;if((i[a>>0]|0)!=(i[c>>0]|0)){c=0;break}}}else c=0}else c=0;while(0);P1(l);P1(h);h=c;l=1;l=h&l;r=m;return l|0}function wl(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,l=0,m=0;h=0;l=r;r=r+48|0;c=l;m=l+24|0;j=l+12|0;g=a+72|0;f=(k[a+76>>2]|0)-(k[g>>2]|0)>>2;i=b+72|0;e=(k[b+76>>2]|0)-(k[i>>2]|0)>>2;Gv(m,g);x=0;sa(445,j|0,i|0);i=x;x=0;if(i&1){d=mb()|0;a=m}else{i=m+4|0;x=0;Qa(79,k[m>>2]|0,k[i>>2]|0,l+8|0);g=x;x=0;a:do if(g&1)h=8;else{g=j+4|0;x=0;Qa(79,k[j>>2]|0,k[g>>2]|0,c|0);d=x;x=0;if(d&1)h=8;else{b:do if(!f)h=5;else{d=0;b=0;c:while(1){if((b|0)==(e|0)){h=14;break}a=k[(k[m>>2]|0)+(d<<2)>>2]|0;c=k[(k[j>>2]|0)+(b<<2)>>2]|0;do if(!a)a=d+1|0;else{if(!c){a=d;b=b+1|0;break}x=0;a=Ka(855,a|0,c|0)|0;c=x;x=0;if(c&1){h=7;break c}if(a)a=d;else{d=0;break b}}while(0);d=a+1|0;if((d|0)==(f|0)){h=5;break b}else b=b+1|0}if((h|0)==7){d=mb()|0;a=j;break a}else if((h|0)==14){d=(f|0)==(e|0);break}}while(0);if((h|0)==5)d=(f|0)==(e|0);a=k[j>>2]|0;b=a;if(a|0){c=k[g>>2]|0;if((c|0)!=(a|0))k[g>>2]=c+(~((c+-4-b|0)>>>2)<<2);uha(a)}a=k[m>>2]|0;if(!a){r=l;return d|0}b=k[i>>2]|0;if((b|0)!=(a|0))k[i>>2]=b+(~((b+-4-a|0)>>>2)<<2);uha(a);r=l;return d|0}}while(0);if((h|0)==8){d=mb()|0;a=j}c=k[a>>2]|0;e=c;if(!c)a=m;else{a=j+4|0;b=k[a>>2]|0;if((b|0)!=(c|0))k[a>>2]=b+(~((b+-4-e|0)>>>2)<<2);uha(c);a=m}}c=k[a>>2]|0;if(!c)yb(d|0);a=m+4|0;b=k[a>>2]|0;if((b|0)!=(c|0))k[a>>2]=b+(~((b+-4-c|0)>>>2)<<2);uha(c);yb(d|0);return 0}function xl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0;v=r;r=r+32|0;t=v;LC(a);d=k[b+4>>2]|0;e=k[b+16>>2]|0;f=d+(e>>>10<<2)|0;if((k[b+8>>2]|0)==(d|0)){s=0;d=0}else{s=e+(k[b+20>>2]|0)|0;s=(k[d+(s>>>10<<2)>>2]|0)+((s&1023)<<2)|0;d=(k[f>>2]|0)+((e&1023)<<2)|0}q=a+16|0;w=a+20|0;p=t+16|0;u=t+20|0;a:while(1){do{o=d;if((o|0)==(s|0)){f=6;break a}e=k[o>>2]|0;i=k[q>>2]|0;b=k[w>>2]|0;d=(b|0)==0;if(!d)c3(b);x=0;Qa(80,t|0,e|0,c|0);n=x;x=0;if(n&1){f=19;break a}l=i+8|0;g=k[l>>2]|0;m=i+4|0;a=k[m>>2]|0;y=g-a>>2;j=i+16|0;h=k[j>>2]|0;n=i+20|0;e=k[n>>2]|0;if((((y|0)==0?0:(y*170|0)+-1|0)|0)==(e+h|0)){x=0;ra(336,i|0);y=x;x=0;if(y&1){a=d;f=20;break a}e=k[n>>2]|0;h=k[j>>2]|0;g=k[l>>2]|0;a=k[m>>2]|0}e=e+h|0;if((g|0)==(a|0))e=0;else e=(k[a+(((e>>>0)/170|0)<<2)>>2]|0)+(((e>>>0)%170|0)*24|0)|0;k[e>>2]=k[t>>2];k[e+4>>2]=k[t+4>>2];k[e+8>>2]=k[t+8>>2];k[e+12>>2]=k[t+12>>2];k[e+16>>2]=k[p>>2];k[e+20>>2]=k[u>>2];k[p>>2]=0;k[u>>2]=0;k[n>>2]=(k[n>>2]|0)+1;if(!d)CQ(b);d=o+4|0}while((d-(k[f>>2]|0)|0)!=4096);d=f+4|0;f=d;d=k[d>>2]|0}if((f|0)==6){r=v;return}else if((f|0)==19)e=mb()|0;else if((f|0)==20){e=mb()|0;d=k[u>>2]|0;if(!d)d=a;else{CQ(d);d=a}}if(!d)CQ(b);d=k[w>>2]|0;if(!d)yb(e|0);CQ(d);yb(e|0)}function yl(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0,m=0;m=r;r=r+48|0;f=m+36|0;g=m+24|0;h=m+12|0;l=m;c=Ot(b,64,448,0)|0;if(c|0){_G(f,a+60|0);x=0;sa(430,g|0,c+60|0);l=x;x=0;if(l&1){m=mb()|0;P1(f);yb(m|0)}e=j[f>>1]|0;a=(e&1)==0;b=(e&254)>>>1;d=a?b:k[f+4>>2]|0;l=i[g>>0]|0;c=(l&1)==0;e=(e&65535)>>>8&255;a:do if((d|0)==((c?(l&255)>>>1:k[g+4>>2]|0)|0)){c=c?g+1|0:k[g+8>>2]|0;if(!a){c=(tG(k[f+8>>2]|0,c,d)|0)==0;break}if(!d)c=1;else if(e<<24>>24==(i[c>>0]|0)){a=f+1|0;while(1){b=b+-1|0;a=a+1|0;if(!b){c=1;break a}c=c+1|0;if((i[a>>0]|0)!=(i[c>>0]|0)){c=0;break}}}else c=0}else c=0;while(0);P1(g);P1(f);h=c;l=1;l=h&l;r=m;return l|0}c=Ot(b,64,432,0)|0;if(!c){h=0;l=0;l=h&l;r=m;return l|0}_G(h,a+60|0);x=0;sa(430,l|0,c+60|0);g=x;x=0;if(g&1){m=mb()|0;P1(h);yb(m|0)}e=j[h>>1]|0;a=(e&1)==0;b=(e&254)>>>1;d=a?b:k[h+4>>2]|0;g=i[l>>0]|0;c=(g&1)==0;e=(e&65535)>>>8&255;b:do if((d|0)==((c?(g&255)>>>1:k[l+4>>2]|0)|0)){c=c?l+1|0:k[l+8>>2]|0;if(!a){c=(tG(k[h+8>>2]|0,c,d)|0)==0;break}if(!d)c=1;else if(e<<24>>24==(i[c>>0]|0)){a=h+1|0;while(1){b=b+-1|0;a=a+1|0;if(!b){c=1;break b}c=c+1|0;if((i[a>>0]|0)!=(i[c>>0]|0)){c=0;break}}}else c=0}else c=0;while(0);P1(l);P1(h);h=c;l=1;l=h&l;r=m;return l|0}function zl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,l=0;e=(c-b|0)/12|0;l=a+8|0;f=k[l>>2]|0;d=k[a>>2]|0;j=d;if(e>>>0<=((f-d|0)/12|0)>>>0){h=a+4|0;d=((k[h>>2]|0)-d|0)/12|0;g=e>>>0>d>>>0;d=b+(d*12|0)|0;f=g?d:c;if((f|0)==(b|0))e=j;else{e=j;do{if((e|0)!=(b|0))to(e,k[b>>2]|0,k[b+4>>2]|0);b=b+12|0;e=e+12|0}while((b|0)!=(f|0))}if(g){if((f|0)==(c|0))return;b=k[h>>2]|0;do{ov(b,d);b=(k[h>>2]|0)+12|0;k[h>>2]=b;d=d+12|0}while((d|0)!=(c|0));return}d=k[h>>2]|0;if((d|0)==(e|0))return;do{b=d+-12|0;k[h>>2]=b;f=k[b>>2]|0;g=f;if(!f)d=b;else{d=d+-8|0;b=k[d>>2]|0;if((b|0)!=(f|0))k[d>>2]=b+(~((b+-4-g|0)>>>2)<<2);uha(f);d=k[h>>2]|0}}while((d|0)!=(e|0));return}if(!d)d=f;else{i=a+4|0;f=k[i>>2]|0;if((f|0)!=(j|0)){while(1){d=f+-12|0;k[i>>2]=d;g=k[d>>2]|0;h=g;if(g){d=f+-8|0;f=k[d>>2]|0;if((f|0)!=(g|0))k[d>>2]=f+(~((f+-4-h|0)>>>2)<<2);uha(g);d=k[i>>2]|0}if((d|0)==(j|0))break;else f=d}d=k[a>>2]|0}uha(d);k[l>>2]=0;k[i>>2]=0;k[a>>2]=0;d=0}g=e>>>0>357913941;if(g){fH(a);d=k[l>>2]|0;f=k[a>>2]|0}else f=0;d=(d-f|0)/12|0;if(d>>>0<178956970){f=d<<1;d=f>>>0>=e>>>0;if(d|g^1)e=d?f:e;else fH(a)}else e=357913941;d=GG(e*12|0)|0;f=a+4|0;k[f>>2]=d;k[a>>2]=d;k[l>>2]=d+(e*12|0);if((b|0)==(c|0))return;do{ov(d,b);d=(k[f>>2]|0)+12|0;k[f>>2]=d;b=b+12|0}while((b|0)!=(c|0));return}function Al(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0;l=r;r=r+16|0;h=l;j=a+64|0;if(!(k[j>>2]|0)){j=0;r=l;return j|0}g=a+68|0;b=k[g>>2]|0;if(!b){l=vb(4)|0;Nea(l);Wb(l|0,4480,315)}f=a+92|0;c=k[f>>2]|0;do if(!(c&16)){if(c&8|0){c=a+80|0;d=k[c+4>>2]|0;e=h;k[e>>2]=k[c>>2];k[e+4>>2]=d;do if(!(i[a+98>>0]|0)){c=tc[k[(k[b>>2]|0)+24>>2]&511](b)|0;d=a+36|0;e=k[d>>2]|0;b=(k[a+40>>2]|0)-e|0;if((c|0)>0){b=(ia((k[a+16>>2]|0)-(k[a+12>>2]|0)|0,c)|0)+b|0;c=0;break}c=k[a+12>>2]|0;if((c|0)==(k[a+16>>2]|0))c=0;else{m=k[g>>2]|0;g=a+32|0;c=vc[k[(k[m>>2]|0)+32>>2]&31](m,h,k[g>>2]|0,e,c-(k[a+8>>2]|0)|0)|0;b=b-c+(k[d>>2]|0)-(k[g>>2]|0)|0;c=1}}else{b=(k[a+16>>2]|0)-(k[a+12>>2]|0)|0;c=0}while(0);if(mK(k[j>>2]|0,0-b|0,1)|0){m=-1;r=l;return m|0}if(c){j=k[h+4>>2]|0;m=a+72|0;k[m>>2]=k[h>>2];k[m+4>>2]=j}m=k[a+32>>2]|0;k[a+40>>2]=m;k[a+36>>2]=m;k[a+8>>2]=0;k[a+12>>2]=0;k[a+16>>2]=0;k[f>>2]=0}}else{if((k[a+24>>2]|0)!=(k[a+20>>2]|0))if((Jc[k[(k[a>>2]|0)+52>>2]&1023](a,-1)|0)==-1){m=-1;r=l;return m|0}d=a+72|0;e=a+32|0;b=a+52|0;a:while(1){a=k[g>>2]|0;c=k[e>>2]|0;c=vc[k[(k[a>>2]|0)+20>>2]&31](a,d,c,c+(k[b>>2]|0)|0,h)|0;a=k[e>>2]|0;m=(k[h>>2]|0)-a|0;if((FH(a,1,m,k[j>>2]|0)|0)!=(m|0)){b=-1;c=24;break}switch(c|0){case 1:break;case 2:{b=-1;c=24;break a}default:{c=10;break a}}}if((c|0)==10){if(!(sA(k[j>>2]|0)|0))break;else b=-1;r=l;return b|0}else if((c|0)==24){r=l;return b|0}}while(0);m=0;r=l;return m|0}function Bl(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0;h=0;t=r;r=r+48|0;p=t;q=(k[c+4>>2]|0)-(k[c>>2]|0)>>2;if(!q){c=b;r=t;return c|0}s=a+40|0;o=a+108|0;n=d;m=k[n>>2]|0;n=k[n+4>>2]|0;if((k[d>>2]|0)==11)f=0;else{f=0;do{a=(k[s>>2]|0)+36|0;d=lD(a,76)|0;g=p;j=o;l=g+40|0;do{k[g>>2]=k[j>>2];g=g+4|0;j=j+4|0}while((g|0)<(l|0));e=k[(k[c>>2]|0)+(f<<2)>>2]|0;k[d+4>>2]=0;g=d+8|0;j=p;l=g+40|0;do{k[g>>2]=k[j>>2];g=g+4|0;j=j+4|0}while((g|0)<(l|0));i[d+48>>0]=0;i[d+49>>0]=0;i[d+50>>0]=0;k[d+52>>2]=0;k[d>>2]=5308;l=d+56|0;k[l>>2]=m;k[l+4>>2]=n;k[d+64>>2]=b;k[d+68>>2]=e;k[d+72>>2]=0;b=N4(a,d)|0;if(b|0)if((k[b+56>>2]|0)!=11){i[(k[b+64>>2]|0)+48>>0]=0;i[(k[b+68>>2]|0)+48>>0]=0}f=f+1|0}while((f|0)!=(q|0));r=t;return b|0}do{a=(k[s>>2]|0)+36|0;d=lD(a,76)|0;g=p;j=o;l=g+40|0;do{k[g>>2]=k[j>>2];g=g+4|0;j=j+4|0}while((g|0)<(l|0));e=k[(k[c>>2]|0)+(f<<2)>>2]|0;k[d+4>>2]=0;g=d+8|0;j=p;l=g+40|0;do{k[g>>2]=k[j>>2];g=g+4|0;j=j+4|0}while((g|0)<(l|0));i[d+48>>0]=0;i[d+49>>0]=0;i[d+50>>0]=0;k[d+52>>2]=0;k[d>>2]=5308;l=d+56|0;k[l>>2]=m;k[l+4>>2]=n;k[d+64>>2]=b;k[d+68>>2]=e;k[d+72>>2]=0;b=N4(a,d)|0;a=(k[b+64>>2]|0)+48|0;if(!(i[a>>0]|0))h=6;else if(!(i[(k[b+68>>2]|0)+48>>0]|0))h=6;else i[b+48>>0]=1;if((h|0)==6){h=0;if((k[b+56>>2]|0)!=11){i[a>>0]=0;i[(k[b+68>>2]|0)+48>>0]=0}}f=f+1|0}while((f|0)!=(q|0));r=t;return b|0}function Cl(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0;m=0;n=r;r=r+48|0;h=n;g=a+20|0;f=a+24|0;c=k[g>>2]|0;e=(k[f>>2]|0)-c>>2;if(e|0){c=kj(b,k[c>>2]|0)|0;if((e|0)!=1){d=1;do{c=c|(kj(b,k[(k[g>>2]|0)+(d<<2)>>2]|0)|0);d=d+1|0}while((d|0)!=(e|0))}if(c){c=k[f>>2]|0;if((c|0)==(k[g>>2]|0))c=k[a+8>>2]|0;else c=c+-4|0;if(kj(b,k[c>>2]|0)|0){c=(k[a+4>>2]|0)+36|0;d=lD(c,72)|0;e=h;f=b+8|0;g=e+40|0;do{k[e>>2]=k[f>>2];e=e+4|0;f=f+4|0}while((e|0)<(g|0));k[d+4>>2]=0;e=d+8|0;f=h;g=e+40|0;do{k[e>>2]=k[f>>2];e=e+4|0;f=f+4|0}while((e|0)<(g|0));k[d+52>>2]=6;k[d+56>>2]=0;i[d+60>>0]=0;k[d>>2]=9784;k[d+64>>2]=b;i[d+68>>0]=1;b=N4(c,d)|0;r=n;return b|0}else{b=Uh(a,b)|0;r=n;return b|0}}}l=k[b+64>>2]|0;l=Jc[k[(k[l>>2]|0)+36>>2]&1023](l,a)|0;l=tc[k[(k[l>>2]|0)+72>>2]&511](l)|0;h=l+68|0;j=l+72|0;e=k[j>>2]|0;d=k[h>>2]|0;a=e-d>>2;if(a){f=l+68|0;g=b+56|0;c=0;while(1){e=k[d+(c<<2)>>2]|0;if((k[e+52>>2]|0)==1)m=12;else if(tc[k[(k[e>>2]|0)+68>>2]&511](e)|0){d=k[f>>2]|0;m=12}if((m|0)==12){m=0;e=(k[d+(c<<2)>>2]|0)+56|0;k[e>>2]=(k[g>>2]|0)+(k[e>>2]|0)}c=c+1|0;if((c|0)==(a|0))break;d=k[f>>2]|0}e=k[j>>2]|0;d=k[h>>2]|0}c=e;do if((e|0)!=(d|0)){d=k[c+-4>>2]|0;if((k[d+52>>2]|0)!=1){if(!(tc[k[(k[d>>2]|0)+68>>2]&511](d)|0))break;c=k[j>>2]|0}i[(k[c+-4>>2]|0)+60>>0]=i[b+60>>0]|0}while(0);b=l;r=n;return b|0}function Dl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0;j=r;r=r+32|0;g=j+12|0;h=j;k[a+4>>2]=0;e=a+8|0;d=e+40|0;do{k[e>>2]=k[b>>2];e=e+4|0;b=b+4|0}while((e|0)<(d|0));i[a+48>>0]=0;i[a+49>>0]=0;i[a+50>>0]=0;f=a+56|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[a+52>>2]=7;k[a>>2]=6600;f=a+68|0;x=0;Qa(74,f|0,78097,0);e=x;x=0;if(e&1){j=mb()|0;yb(j|0)}b=a+80|0;x=0;sa(430,b|0,c|0);e=x;x=0;if(e&1)b=mb()|0;else{d=a+92|0;i[d>>0]=0;e=PF(c,124,0)|0;if((e|0)==-1){r=j;return}i[d>>0]=1;x=0;qa(4,g|0,c|0,0,e|0,c|0);d=x;x=0;if(!(d&1)){if(!(i[f>>0]&1)){i[f+1>>0]=0;i[f>>0]=0}else{i[k[a+76>>2]>>0]=0;k[a+72>>2]=0}x=0;sa(443,f|0,0);d=x;x=0;if(d&1){d=Eb(0)|0;Nba(d)}k[f>>2]=k[g>>2];k[f+4>>2]=k[g+4>>2];k[f+8>>2]=k[g+8>>2];k[g>>2]=0;k[g+4>>2]=0;k[g+8>>2]=0;P1(g);x=0;qa(4,h|0,c|0,e+1|0,-1,c|0);c=x;x=0;if(!(c&1)){if(!(i[b>>0]&1)){i[b+1>>0]=0;i[b>>0]=0}else{i[k[a+88>>2]>>0]=0;k[a+84>>2]=0}x=0;sa(443,b|0,0);a=x;x=0;if(a&1){a=Eb(0)|0;Nba(a)}k[b>>2]=k[h>>2];k[b+4>>2]=k[h+4>>2];k[b+8>>2]=k[h+8>>2];k[h>>2]=0;k[h+4>>2]=0;k[h+8>>2]=0;P1(h);r=j;return}}j=mb()|0;P1(b);b=j}P1(f);j=b;yb(j|0)}function El(a){a=a|0;var b=0,c=0,d=0,e=0,f=0;b=0;f=r;r=r+16|0;c=f;d=sI(1,124)|0;if(!d){b=vm(73208,43267,40)|0;a=TN(b+(k[(k[b>>2]|0)+-12>>2]|0)|0)|0;k[c>>2]=a;x=0;a=Ka(865,c|0,74172)|0;e=x;x=0;if(e&1){f=mb()|0;J5(c);yb(f|0)}x=0;a=Ka(k[(k[a>>2]|0)+28>>2]|0,a|0,10)|0;e=x;x=0;if(e&1){f=mb()|0;J5(c);yb(f|0)}J5(c);zp(b,a)|0;ct(b)|0;e=0;r=f;return e|0}k[d+68>>2]=2;k[d+4>>2]=5;k[d+8>>2]=42986;k[d+12>>2]=43502;do if(!a){a=vb(8)|0;x=0;sa(444,a|0,43308);c=x;x=0;if(c&1){c=Eb(0)|0;lb(a|0);a=c;break}else{x=0;Qa(77,a|0,4416,310);x=0;b=10;break}}else{if(i[a>>0]|0){k[d+116>>2]=a;e=d;r=f;return e|0}a=vb(8)|0;x=0;sa(444,a|0,43353);c=x;x=0;if(c&1){c=Eb(0)|0;lb(a|0);a=c;break}else{x=0;Qa(77,a|0,4416,310);x=0;b=10;break}}while(0);if((b|0)==10)a=Eb(0)|0;Bb(a|0)|0;x=0;ua(257,d|0)|0;c=x;x=0;do if(c&1){c=Eb(0)|0;Bb(c|0)|0;x=0;ua(257,d|0)|0;c=x;x=0;if(c&1){a=mb()|0;x=0;pa(3);c=x;x=0;if(c&1){c=Eb(0)|0;Nba(c)}else e=a}else{x=0;pa(3);e=x;x=0;if(!(e&1))break;e=mb()|0}x=0;pa(3);c=x;x=0;if(c&1){e=Eb(0)|0;Nba(e)}else yb(e|0)}while(0);xb();e=d;r=f;return e|0}function Fl(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0,o=0;m=0;n=r;r=r+32|0;g=n+12|0;h=n;j=a+64|0;b=k[j>>2]|0;if(b|0){m=b;r=n;return m|0}k[j>>2]=-1640531520;_G(g,a+68|0);f=i[g>>0]|0;d=(f&1)==0;e=d?g+1|0:k[g+8>>2]|0;f=d?(f&255)>>>1:k[g+4>>2]|0;if(f>>>0>3){c=f;d=e;b=f;while(1){o=ia(l[d>>0]|l[d+1>>0]<<8|l[d+2>>0]<<16|l[d+3>>0]<<24,1540483477)|0;b=(ia(o>>>24^o,1540483477)|0)^(ia(b,1540483477)|0);c=c+-4|0;if(c>>>0<=3)break;else d=d+4|0}c=f+-4|0;d=c&-4;c=c-d|0;d=e+(d+4)|0}else{c=f;d=e;b=f}switch(c|0){case 3:{b=(l[d+2>>0]|0)<<16^b;m=7;break}case 2:{m=7;break}case 1:{m=8;break}default:{}}if((m|0)==7){b=(l[d+1>>0]|0)<<8^b;m=8}if((m|0)==8)b=ia((l[d>>0]|0)^b,1540483477)|0;o=ia(b>>>13^b,1540483477)|0;f=k[j>>2]|0;k[j>>2]=(f<<6)+-1640531527+(f>>>2)+(o>>>15^o)^f;P1(g);_G(h,a+80|0);f=i[h>>0]|0;o=(f&1)==0;e=o?h+1|0:k[h+8>>2]|0;f=o?(f&255)>>>1:k[h+4>>2]|0;if(f>>>0>3){c=f;d=e;b=f;while(1){o=ia(l[d>>0]|l[d+1>>0]<<8|l[d+2>>0]<<16|l[d+3>>0]<<24,1540483477)|0;b=(ia(o>>>24^o,1540483477)|0)^(ia(b,1540483477)|0);c=c+-4|0;if(c>>>0<=3)break;else d=d+4|0}c=f+-4|0;d=c&-4;c=c-d|0;d=e+(d+4)|0}else{c=f;d=e;b=f}switch(c|0){case 3:{b=(l[d+2>>0]|0)<<16^b;m=14;break}case 2:{m=14;break}case 1:{m=15;break}default:{}}if((m|0)==14){b=(l[d+1>>0]|0)<<8^b;m=15}if((m|0)==15)b=ia((l[d>>0]|0)^b,1540483477)|0;m=ia(b>>>13^b,1540483477)|0;o=k[j>>2]|0;k[j>>2]=(o<<6)+-1640531527+(o>>>2)+(m>>>15^m)^o;P1(h);o=k[j>>2]|0;r=n;return o|0}function Gl(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;m=0;n=r;r=r+32|0;g=n+16|0;h=n+12|0;l=n;c=n+8|0;x=0;sa(457,l|0,a|0);j=x;x=0;a:do if(j&1){c=Eb(0)|0;d=a;e=a;m=19}else{do if(i[l>>0]|0){j=TN(a+(k[(k[a>>2]|0)+-12>>2]|0)|0)|0;k[c>>2]=j;x=0;j=Ka(865,c|0,74228)|0;f=x;x=0;if(f&1){m=Eb(0)|0;J5(c);c=m}else{J5(c);d=a+(k[(k[a>>2]|0)+-12>>2]|0)|0;f=k[d+24>>2]|0;e=d+76|0;c=k[e>>2]|0;do if((c|0)==-1){c=TN(d)|0;k[g>>2]=c;x=0;c=Ka(865,g|0,74172)|0;o=x;x=0;if(!(o&1)){x=0;c=Ka(k[(k[c>>2]|0)+28>>2]|0,c|0,32)|0;o=x;x=0;if(!(o&1)){J5(g);c=c<<24>>24;k[e>>2]=c;m=10;break}}c=Eb(0)|0;J5(g)}else m=10;while(0);if((m|0)==10){o=k[(k[j>>2]|0)+24>>2]|0;k[h>>2]=f;x=0;k[g>>2]=k[h>>2];c=wa(o|0,j|0,g|0,d|0,c&255|0,b|0)|0;o=x;x=0;if(!(o&1)){if(c|0)break;o=a+(k[(k[a>>2]|0)+-12>>2]|0)|0;x=0;sa(458,o|0,k[o+16>>2]|5|0);o=x;x=0;if(!(o&1))break}c=Eb(0)|0}}bx(l);d=a;e=a;m=19;break a}while(0);bx(l)}while(0);do if((m|0)==19){Bb(c|0)|0;x=0;ra(325,d+(k[(k[e>>2]|0)+-12>>2]|0)|0);o=x;x=0;if(!(o&1)){xb();break}c=mb()|0;x=0;pa(3);o=x;x=0;if(o&1){o=Eb(0)|0;Nba(o)}else yb(c|0)}while(0);r=n;return a|0}function Hl(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;m=0;n=r;r=r+32|0;g=n+16|0;h=n+12|0;l=n;c=n+8|0;x=0;sa(457,l|0,a|0);j=x;x=0;a:do if(j&1){c=Eb(0)|0;d=a;e=a;m=19}else{do if(i[l>>0]|0){j=TN(a+(k[(k[a>>2]|0)+-12>>2]|0)|0)|0;k[c>>2]=j;x=0;j=Ka(865,c|0,74228)|0;f=x;x=0;if(f&1){m=Eb(0)|0;J5(c);c=m}else{J5(c);d=a+(k[(k[a>>2]|0)+-12>>2]|0)|0;f=k[d+24>>2]|0;e=d+76|0;c=k[e>>2]|0;do if((c|0)==-1){c=TN(d)|0;k[g>>2]=c;x=0;c=Ka(865,g|0,74172)|0;o=x;x=0;if(!(o&1)){x=0;c=Ka(k[(k[c>>2]|0)+28>>2]|0,c|0,32)|0;o=x;x=0;if(!(o&1)){J5(g);c=c<<24>>24;k[e>>2]=c;m=10;break}}c=Eb(0)|0;J5(g)}else m=10;while(0);if((m|0)==10){o=k[(k[j>>2]|0)+24>>2]|0;k[h>>2]=f;x=0;k[g>>2]=k[h>>2];c=wa(o|0,j|0,g|0,d|0,c&255|0,b|0)|0;o=x;x=0;if(!(o&1)){if(c|0)break;o=a+(k[(k[a>>2]|0)+-12>>2]|0)|0;x=0;sa(458,o|0,k[o+16>>2]|5|0);o=x;x=0;if(!(o&1))break}c=Eb(0)|0}}bx(l);d=a;e=a;m=19;break a}while(0);bx(l)}while(0);do if((m|0)==19){Bb(c|0)|0;x=0;ra(325,d+(k[(k[e>>2]|0)+-12>>2]|0)|0);o=x;x=0;if(!(o&1)){xb();break}c=mb()|0;x=0;pa(3);o=x;x=0;if(o&1){o=Eb(0)|0;Nba(o)}else yb(c|0)}while(0);r=n;return a|0}function Il(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;m=0;n=r;r=r+32|0;g=n+16|0;h=n+12|0;l=n;c=n+8|0;x=0;sa(457,l|0,a|0);j=x;x=0;a:do if(j&1){c=Eb(0)|0;d=a;e=a;m=19}else{do if(i[l>>0]|0){j=TN(a+(k[(k[a>>2]|0)+-12>>2]|0)|0)|0;k[c>>2]=j;x=0;j=Ka(865,c|0,74228)|0;f=x;x=0;if(f&1){m=Eb(0)|0;J5(c);c=m}else{J5(c);d=a+(k[(k[a>>2]|0)+-12>>2]|0)|0;f=k[d+24>>2]|0;e=d+76|0;c=k[e>>2]|0;do if((c|0)==-1){c=TN(d)|0;k[g>>2]=c;x=0;c=Ka(865,g|0,74172)|0;o=x;x=0;if(!(o&1)){x=0;c=Ka(k[(k[c>>2]|0)+28>>2]|0,c|0,32)|0;o=x;x=0;if(!(o&1)){J5(g);c=c<<24>>24;k[e>>2]=c;m=10;break}}c=Eb(0)|0;J5(g)}else m=10;while(0);if((m|0)==10){o=k[(k[j>>2]|0)+16>>2]|0;k[h>>2]=f;x=0;k[g>>2]=k[h>>2];c=wa(o|0,j|0,g|0,d|0,c&255|0,b|0)|0;o=x;x=0;if(!(o&1)){if(c|0)break;o=a+(k[(k[a>>2]|0)+-12>>2]|0)|0;x=0;sa(458,o|0,k[o+16>>2]|5|0);o=x;x=0;if(!(o&1))break}c=Eb(0)|0}}bx(l);d=a;e=a;m=19;break a}while(0);bx(l)}while(0);do if((m|0)==19){Bb(c|0)|0;x=0;ra(325,d+(k[(k[e>>2]|0)+-12>>2]|0)|0);o=x;x=0;if(!(o&1)){xb();break}c=mb()|0;x=0;pa(3);o=x;x=0;if(o&1){o=Eb(0)|0;Nba(o)}else yb(c|0)}while(0);r=n;return a|0}function Jl(a,b){a=a|0;b=+b;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;m=0;n=r;r=r+32|0;g=n+16|0;h=n+12|0;l=n;c=n+8|0;x=0;sa(457,l|0,a|0);j=x;x=0;a:do if(j&1){c=Eb(0)|0;d=a;e=a;m=19}else{do if(i[l>>0]|0){j=TN(a+(k[(k[a>>2]|0)+-12>>2]|0)|0)|0;k[c>>2]=j;x=0;j=Ka(865,c|0,74228)|0;f=x;x=0;if(f&1){m=Eb(0)|0;J5(c);c=m}else{J5(c);d=a+(k[(k[a>>2]|0)+-12>>2]|0)|0;f=k[d+24>>2]|0;e=d+76|0;c=k[e>>2]|0;do if((c|0)==-1){c=TN(d)|0;k[g>>2]=c;x=0;c=Ka(865,g|0,74172)|0;o=x;x=0;if(!(o&1)){x=0;c=Ka(k[(k[c>>2]|0)+28>>2]|0,c|0,32)|0;o=x;x=0;if(!(o&1)){J5(g);c=c<<24>>24;k[e>>2]=c;m=10;break}}c=Eb(0)|0;J5(g)}else m=10;while(0);if((m|0)==10){o=k[(k[j>>2]|0)+32>>2]|0;k[h>>2]=f;x=0;k[g>>2]=k[h>>2];c=Ta(o|0,j|0,g|0,d|0,c&255|0,+b)|0;o=x;x=0;if(!(o&1)){if(c|0)break;o=a+(k[(k[a>>2]|0)+-12>>2]|0)|0;x=0;sa(458,o|0,k[o+16>>2]|5|0);o=x;x=0;if(!(o&1))break}c=Eb(0)|0}}bx(l);d=a;e=a;m=19;break a}while(0);bx(l)}while(0);do if((m|0)==19){Bb(c|0)|0;x=0;ra(325,d+(k[(k[e>>2]|0)+-12>>2]|0)|0);o=x;x=0;if(!(o&1)){xb();break}c=mb()|0;x=0;pa(3);o=x;x=0;if(o&1){o=Eb(0)|0;Nba(o)}else yb(c|0)}while(0);r=n;return a|0}function Kl(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0;i=0;m=r;r=r+48|0;c=m;n=m+24|0;l=m+12|0;h=a+72|0;g=(k[a+76>>2]|0)-(k[h>>2]|0)>>2;j=b+72|0;f=(k[b+76>>2]|0)-(k[j>>2]|0)>>2;Hv(n,h);x=0;sa(442,l|0,j|0);j=x;x=0;if(j&1){d=mb()|0;a=n}else{j=n+4|0;x=0;Qa(78,k[n>>2]|0,k[j>>2]|0,m+8|0);h=x;x=0;a:do if(h&1)i=8;else{h=l+4|0;x=0;Qa(78,k[l>>2]|0,k[h>>2]|0,c|0);e=x;x=0;if(e&1)i=8;else{b:do if(!g)i=5;else{e=0;a=0;while(1){if((a|0)==(f|0)){i=14;break}b=k[(k[n>>2]|0)+(e<<2)>>2]|0;c=k[(k[l>>2]|0)+(a<<2)>>2]|0;d=(b|0)==0&1;if(!c)a=a+1|0;else{x=0;b=Ka(853,b|0,c|0)|0;c=x;x=0;if(c&1){i=7;break}if(!b){d=0;break b}}e=e+1+d|0;if((e|0)==(g|0)){i=5;break b}else a=a+1|0}if((i|0)==7){d=mb()|0;a=l;break a}else if((i|0)==14){d=(g|0)==(f|0);break}}while(0);if((i|0)==5)d=(g|0)==(f|0);a=k[l>>2]|0;b=a;if(a|0){c=k[h>>2]|0;if((c|0)!=(a|0))k[h>>2]=c+(~((c+-4-b|0)>>>2)<<2);uha(a)}a=k[n>>2]|0;if(!a){r=m;return d|0}b=k[j>>2]|0;if((b|0)!=(a|0))k[j>>2]=b+(~((b+-4-a|0)>>>2)<<2);uha(a);r=m;return d|0}}while(0);if((i|0)==8){d=mb()|0;a=l}c=k[a>>2]|0;e=c;if(!c)a=n;else{a=l+4|0;b=k[a>>2]|0;if((b|0)!=(c|0))k[a>>2]=b+(~((b+-4-e|0)>>>2)<<2);uha(c);a=n}}c=k[a>>2]|0;if(!c)yb(d|0);a=n+4|0;b=k[a>>2]|0;if((b|0)!=(c|0))k[a>>2]=b+(~((b+-4-c|0)>>>2)<<2);uha(c);yb(d|0);return 0}function Ll(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0;if(!a){m=0;return m|0}c=k[a+68>>2]|0;l=(k[a+72>>2]|0)-c>>2;if(!l){m=0;return m|0}g=a+68|0;c=k[c>>2]|0;d=(c|0)==0;if((b|0)!=3){if(d)w3();else{e=c;f=0}a:while(1){a=k[(k[(k[e>>2]|0)+-4>>2]|0)+4>>2]|0;if((a|0)==33080|(a|0)==30973|(a|0)==33117){h=1;a=31;break}do if((a|0)==(k[135]|0)){if(co(e,b)|0){h=1;a=31;break a}}else{if((a|0)==31028)if(lx(e,b)|0){h=1;a=31;break a}else break;if((a|0)==(k[147]|0))if(pl(e,b)|0){h=1;a=31;break a}else break;if(Ot(e,568,552,0)|0)if(Ll(k[e+64>>2]|0,b)|0){h=1;a=31;break a}}while(0);f=f+1|0;if(f>>>0>=l>>>0){h=0;a=31;break}e=k[(k[g>>2]|0)+(f<<2)>>2]|0;if(!e){a=19;break}}if((a|0)==19)w3();else if((a|0)==31)return h|0}if(d)w3();else{j=c;m=0}b:while(1){a=k[(k[(k[j>>2]|0)+-4>>2]|0)+4>>2]|0;if((a|0)==33080|(a|0)==30973){h=1;a=31;break}do if((a|0)==33117){if(i[j+68>>0]|0){h=1;a=31;break b}}else{if((a|0)==(k[135]|0))if(co(j,3)|0){h=1;a=31;break b}else break;if((a|0)==31028)if(lx(j,3)|0){h=1;a=31;break b}else break;if((a|0)==(k[147]|0))if(pl(j,3)|0){h=1;a=31;break b}else break;if(Ot(j,568,552,0)|0)if(Ll(k[j+64>>2]|0,3)|0){h=1;a=31;break b}}while(0);m=m+1|0;if(m>>>0>=l>>>0){h=0;a=31;break}j=k[(k[g>>2]|0)+(m<<2)>>2]|0;if(!j){a=19;break}}if((a|0)==19)w3();else if((a|0)==31)return h|0;return 0}function Ml(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0;u=r;r=r+48|0;t=u;h=tc[k[(k[b>>2]|0)+72>>2]&511](b)|0;c=(k[a+4>>2]|0)+36|0;d=lD(c,88)|0;b=i[h+84>>0]|0;e=t;f=h+8|0;g=e+40|0;do{k[e>>2]=k[f>>2];e=e+4|0;f=f+4|0}while((e|0)<(g|0));k[d+4>>2]=0;e=d+8|0;f=t;g=e+40|0;do{k[e>>2]=k[f>>2];e=e+4|0;f=f+4|0}while((e|0)<(g|0));k[d+52>>2]=0;k[d+56>>2]=0;i[d+60>>0]=0;k[d+68>>2]=0;k[d+72>>2]=0;k[d+76>>2]=0;k[d>>2]=9664;k[d+64>>2]=9756;i[d+84>>0]=b;i[d+85>>0]=0;i[d+86>>0]=0;i[d+87>>0]=0;q=N4(c,d)|0;b=k[h+68>>2]|0;s=(k[h+72>>2]|0)-b>>2;if(!s){r=u;return q|0}j=h+68|0;l=q+64|0;m=q+80|0;n=q+72|0;o=q+76|0;p=q+68|0;c=0;while(1){b=k[b+(c<<2)>>2]|0;if(!(tc[k[(k[b>>2]|0)+72>>2]&511](b)|0)){k[t>>2]=b;d=b;if(b|0){k[m>>2]=0;e=k[n>>2]|0;if((e|0)==(k[o>>2]|0))xw(p,t);else{k[e>>2]=d;k[n>>2]=(k[n>>2]|0)+4}rc[k[k[l>>2]>>2]&1023](l,b)}}else{b=Ml(a,b)|0;d=tc[k[(k[b>>2]|0)+72>>2]&511](b)|0;d=(k[d+72>>2]|0)-(k[d+68>>2]|0)>>2;if(d|0){h=0;do{e=(tc[k[(k[b>>2]|0)+72>>2]&511](b)|0)+68|0;e=k[(k[e>>2]|0)+(h<<2)>>2]|0;k[t>>2]=e;f=e;if(e|0){k[m>>2]=0;g=k[n>>2]|0;if((g|0)==(k[o>>2]|0))xw(p,t);else{k[g>>2]=f;k[n>>2]=(k[n>>2]|0)+4}rc[k[k[l>>2]>>2]&1023](l,e)}h=h+1|0}while((h|0)!=(d|0))}}c=c+1|0;if((c|0)==(s|0))break;b=k[j>>2]|0}r=u;return q|0}function Nl(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0;d=0;n=r;r=r+112|0;m=n+96|0;j=n+56|0;h=n+16|0;l=n;us(a,1,0)|0;c=k[a+156>>2]|0;e=k[a+160>>2]|0;f=e-c|0;if(f>>>0>4294967279){dH(m);d=5}else if(f>>>0<11){i[m>>0]=f<<1;b=m+1|0}else d=5;if((d|0)==5){g=f+16&-16;b=GG(g)|0;k[m+8>>2]=b;k[m>>2]=g|1;k[m+4>>2]=f}if((c|0)!=(e|0)){d=b;while(1){i[d>>0]=i[c>>0]|0;c=c+1|0;if((c|0)==(e|0))break;else d=d+1|0}b=b+f|0}i[b>>0]=0;b=j;e=a+108|0;f=b+40|0;do{k[b>>2]=k[e>>2];b=b+4|0;e=e+4|0}while((b|0)<(f|0));x=0;g=ua(246,a|0)|0;f=x;x=0;if(!(f&1)){c=(k[a+40>>2]|0)+36|0;x=0;d=Ka(856,c|0,80)|0;a=x;x=0;if(!(a&1)){b=h;e=j;f=b+40|0;do{k[b>>2]=k[e>>2];b=b+4|0;e=e+4|0}while((b|0)<(f|0));x=0;sa(430,l|0,m|0);j=x;x=0;if(!(j&1)){k[d+4>>2]=0;b=d+8|0;e=h;f=b+40|0;do{k[b>>2]=k[e>>2];b=b+4|0;e=e+4|0}while((b|0)<(f|0));i[d+48>>0]=0;i[d+49>>0]=0;i[d+50>>0]=0;b=d+52|0;k[b>>2]=0;k[d>>2]=8984;x=0;sa(430,d+56|0,l|0);j=x;x=0;if(!(j&1)){k[d+68>>2]=g;k[d+72>>2]=0;k[d+76>>2]=0;k[b>>2]=4;x=0;b=Ka(857,c|0,d|0)|0;j=x;x=0;if(!(j&1)){P1(l);P1(m);r=n;return b|0}}n=mb()|0;P1(l);P1(m);yb(n|0)}}}n=mb()|0;P1(m);yb(n|0);return 0}function Ol(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0;h=r;r=r+112|0;e=h;c=h+64|0;m=h+52|0;f=h+40|0;g=c;j=b+8|0;l=g+40|0;do{k[g>>2]=k[j>>2];g=g+4|0;j=j+4|0}while((g|0)<(l|0));_G(m,68968);g=e;j=c;l=g+40|0;do{k[g>>2]=k[j>>2];g=g+4|0;j=j+4|0}while((g|0)<(l|0));x=0;sa(487,a|0,m|0);l=x;x=0;if(l&1)c=mb()|0;else{k[a>>2]=8160;d=a+8|0;x=0;sa(430,d|0,m|0);l=x;x=0;do if(l&1)c=mb()|0;else{c=a+20|0;x=0;Qa(74,c|0,31243,5);l=x;x=0;if(l&1){c=mb()|0;P1(d);break}g=a+32|0;j=e;l=g+40|0;do{k[g>>2]=k[j>>2];g=g+4|0;j=j+4|0}while((g|0)<(l|0));k[a+72>>2]=0;P1(m);k[a>>2]=10792;k[a+76>>2]=b;x=0;sa(k[(k[b>>2]|0)+24>>2]|0,f|0,b|0);m=x;x=0;if(!(m&1)){if(!(i[d>>0]&1)){i[d+1>>0]=0;i[d>>0]=0}else{i[k[a+16>>2]>>0]=0;k[a+12>>2]=0}x=0;sa(443,d|0,0);m=x;x=0;if(m&1){m=Eb(0)|0;Nba(m)}k[d>>2]=k[f>>2];k[d+4>>2]=k[f+4>>2];k[d+8>>2]=k[f+8>>2];k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;P1(f);x=0;Ka(866,d|0,39826)|0;m=x;x=0;if(!(m&1)){r=h;return}}m=mb()|0;k[a>>2]=8160;P1(c);P1(d);f4(a);yb(m|0)}while(0);f4(a)}P1(m);m=c;yb(m|0)}function Pl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0.0,h=0,j=0,l=0.0,m=0.0,n=0.0,o=0,q=0,s=0,t=0,u=0,v=0;v=r;r=r+80|0;h=v+40|0;b=v+24|0;j=v+12|0;u=v;lE(b,36999,6);x=0;q=h;s=e;t=q+40|0;do{k[q>>2]=k[s>>2];q=q+4|0;s=s+4|0}while((q|0)<(t|0));o=wa(24,b|0,a|0,d|0,h|0,f|0)|0;t=x;x=0;if(t&1){v=mb()|0;P1(b);yb(v|0)}P1(b);lE(j,37075,7);x=0;q=h;s=e;t=q+40|0;do{k[q>>2]=k[s>>2];q=q+4|0;s=s+4|0}while((q|0)<(t|0));b=La(1,j|0,a|0,d|0,h|0,0.0,1.0,f|0)|0;t=x;x=0;if(t&1){v=mb()|0;P1(j);yb(v|0)}n=+p[b+56>>3];P1(j);n=+p[o+80>>3]-n;n=n<0.0?0.0:n;h=c+36|0;j=lD(h,104)|0;l=+p[o+56>>3];m=+p[o+64>>3];g=+p[o+72>>3];lE(u,78097,0);k[j+4>>2]=0;q=j+8|0;s=e;t=q+40|0;do{k[q>>2]=k[s>>2];q=q+4|0;s=s+4|0}while((q|0)<(t|0));i[j+48>>0]=0;i[j+49>>0]=0;i[j+50>>0]=0;b=j+52|0;k[b>>2]=0;k[j>>2]=5580;p[j+56>>3]=l;p[j+64>>3]=m;p[j+72>>3]=g;p[j+80>>3]=n;x=0;sa(430,j+88|0,u|0);e=x;x=0;if(!(e&1)){k[j+100>>2]=0;k[b>>2]=3;x=0;b=Ka(857,h|0,j|0)|0;e=x;x=0;if(!(e&1)){P1(u);r=v;return b|0}}v=mb()|0;P1(u);yb(v|0);return 0}function Ql(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0.0,h=0,j=0,l=0.0,m=0.0,n=0.0,o=0,q=0,s=0,t=0,u=0,v=0;v=r;r=r+80|0;h=v+40|0;b=v+24|0;j=v+12|0;u=v;lE(b,36999,6);x=0;q=h;s=e;t=q+40|0;do{k[q>>2]=k[s>>2];q=q+4|0;s=s+4|0}while((q|0)<(t|0));o=wa(24,b|0,a|0,d|0,h|0,f|0)|0;t=x;x=0;if(t&1){v=mb()|0;P1(b);yb(v|0)}P1(b);lE(j,37075,7);x=0;q=h;s=e;t=q+40|0;do{k[q>>2]=k[s>>2];q=q+4|0;s=s+4|0}while((q|0)<(t|0));b=La(1,j|0,a|0,d|0,h|0,0.0,1.0,f|0)|0;t=x;x=0;if(t&1){v=mb()|0;P1(j);yb(v|0)}n=+p[b+56>>3];P1(j);n=n+ +p[o+80>>3];n=n>1.0?1.0:n;h=c+36|0;j=lD(h,104)|0;l=+p[o+56>>3];m=+p[o+64>>3];g=+p[o+72>>3];lE(u,78097,0);k[j+4>>2]=0;q=j+8|0;s=e;t=q+40|0;do{k[q>>2]=k[s>>2];q=q+4|0;s=s+4|0}while((q|0)<(t|0));i[j+48>>0]=0;i[j+49>>0]=0;i[j+50>>0]=0;b=j+52|0;k[b>>2]=0;k[j>>2]=5580;p[j+56>>3]=l;p[j+64>>3]=m;p[j+72>>3]=g;p[j+80>>3]=n;x=0;sa(430,j+88|0,u|0);e=x;x=0;if(!(e&1)){k[j+100>>2]=0;k[b>>2]=3;x=0;b=Ka(857,h|0,j|0)|0;e=x;x=0;if(!(e&1)){P1(u);r=v;return b|0}}v=mb()|0;P1(u);yb(v|0);return 0}function Rl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0.0,h=0,i=0,j=0.0,l=0.0,m=0,n=0,o=0,q=0,s=0,t=0;t=0;o=r;r=r+80|0;m=o+40|0;q=o+24|0;s=o+12|0;n=o;lE(q,37038,4);x=0;b=m;h=e;i=b+40|0;do{k[b>>2]=k[h>>2];b=b+4|0;h=h+4|0}while((b|0)<(i|0));b=wa(23,q|0,a|0,d|0,m|0,f|0)|0;i=x;x=0;if(!(i&1)){l=+p[b+56>>3];x=0;Qa(74,s|0,37043,11);i=x;x=0;if(!(i&1)){x=0;b=m;h=e;i=b+40|0;do{k[b>>2]=k[h>>2];b=b+4|0;h=h+4|0}while((b|0)<(i|0));b=wa(23,s|0,a|0,d|0,m|0,f|0)|0;i=x;x=0;if(i&1)t=9;else{j=+p[b+56>>3];x=0;Qa(74,n|0,37055,10);i=x;x=0;if(i&1)t=9;else{x=0;b=m;h=e;i=b+40|0;do{k[b>>2]=k[h>>2];b=b+4|0;h=h+4|0}while((b|0)<(i|0));b=wa(23,n|0,a|0,d|0,m|0,f|0)|0;d=x;x=0;if(!(d&1)){g=+p[b+56>>3];x=0;b=m;h=e;i=b+40|0;do{k[b>>2]=k[h>>2];b=b+4|0;h=h+4|0}while((b|0)<(i|0));b=Aa(1,+l,+j,+g,1.0,c|0,m|0)|0;e=x;x=0;if(!(e&1)){P1(n);P1(s);P1(q);r=o;return b|0}}b=mb()|0;P1(n)}}if((t|0)==9)b=mb()|0;P1(s);t=b;P1(q);yb(t|0)}}t=mb()|0;P1(q);yb(t|0);return 0}function Sl(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,l=0,m=0;g=0;j=a+4|0;c=k[a>>2]|0;e=(((k[j>>2]|0)-c|0)/48|0)+1|0;if(e>>>0>89478485){fH(a);c=k[a>>2]|0}i=a+8|0;d=((k[i>>2]|0)-c|0)/48|0;if(d>>>0<44739242){d=d<<1;d=d>>>0 >>0?j:p)|0;if((((l|0)==0?(p>>>0 >>0?-2147483648:0):q)|0)>=0){s=m+1|0;r=o;return s|0}k[n>>2]=k[c>>2];k[n+4>>2]=k[c+4>>2];k[n+8>>2]=k[c+8>>2];k[c>>2]=k[d>>2];k[c+4>>2]=k[d+4>>2];k[c+8>>2]=k[d+8>>2];k[d>>2]=k[n>>2];k[d+4>>2]=k[n+4>>2];k[d+8>>2]=k[n+8>>2];p=i[c>>0]|0;d=(p&1)==0;p=d?(p&255)>>>1:k[f>>2]|0;q=i[b>>0]|0;s=(q&1)==0;f=b+4|0;q=s?(q&255)>>>1:k[f>>2]|0;e=b+8|0;g=b+1|0;s=tG(d?l:k[j>>2]|0,s?g:k[e>>2]|0,q>>>0 >>0?q:p)|0;if((((s|0)==0?(p>>>0 >>0?q:p)|0;if((((s|0)==0?(p>>>0 >>(o>>>0))&i|l<>>0){q=z+8|0;c=q;q=k[q>>2]|0;r=k[z+4>>2]|0;A=12}else if(s>>>0>=y>>>0){c=z+8|0;p=k[c>>2]|0;e=k[d+4>>2]|0;n=k[d+8>>2]|0;q=p;if((e|0)!=(n|0)){o=k[z+4>>2]|0;r=o;while(1){if((o|0)==(p|0)){A=12;break a}f=i[o>>0]|0;h=(f&1)==0;f=h?(f&255)>>>1:k[o+4>>2]|0;g=i[e>>0]|0;j=(g&1)==0;g=j?(g&255)>>>1:k[e+4>>2]|0;h=h?o+1|0:k[o+8>>2]|0;j=j?e+1|0:k[e+8>>2]|0;l=g>>>0>>0?-2147483648:0):s)|0)>=0){s=m+2|0;r=o;return s|0}k[n>>2]=k[b>>2];k[n+4>>2]=k[b+4>>2];k[n+8>>2]=k[b+8>>2];k[b>>2]=k[c>>2];k[b+4>>2]=k[c+4>>2];k[b+8>>2]=k[c+8>>2];k[c>>2]=k[n>>2];k[c+4>>2]=k[n+4>>2];k[c+8>>2]=k[n+8>>2];p=i[b>>0]|0;c=(p&1)==0;p=c?(p&255)>>>1:k[f>>2]|0;q=i[a>>0]|0;s=(q&1)==0;q=s?(q&255)>>>1:k[a+4>>2]|0;s=tG(c?g:k[e>>2]|0,s?a+1|0:k[a+8>>2]|0,q>>>0
>>0?-2147483648:0):s)|0)>=0){s=m+3|0;r=o;return s|0}k[n>>2]=k[a>>2];k[n+4>>2]=k[a+4>>2];k[n+8>>2]=k[a+8>>2];k[a>>2]=k[b>>2];k[a+4>>2]=k[b+4>>2];k[a+8>>2]=k[b+8>>2];k[b>>2]=k[n>>2];k[b+4>>2]=k[n+4>>2];k[b+8>>2]=k[n+8>>2];s=m+4|0;r=o;return s|0}function pj(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0;v=0;y=r;r=r+32|0;t=y;z=GG(36)|0;k[z+4>>2]=0;k[z+8>>2]=0;k[z>>2]=14520;u=z+12|0;k[u>>2]=0;k[u+4>>2]=0;k[u+8>>2]=0;k[u+12>>2]=0;k[u+16>>2]=0;k[u+20>>2]=0;w=u;e=k[b+16>>2]|0;a:do if(!e)v=20;else{f=k[e+4>>2]|0;d=k[e+16>>2]|0;g=f+(((d>>>0)/170|0)<<2)|0;if((k[e+8>>2]|0)==(f|0)){d=0;q=0}else{q=d+(k[e+20>>2]|0)|0;d=(k[g>>2]|0)+(((d>>>0)%170|0)*24|0)|0;q=(k[f+(((q>>>0)/170|0)<<2)>>2]|0)+(((q>>>0)%170|0)*24|0)|0}l=z+20|0;m=z+16|0;n=z+28|0;o=z+32|0;p=t+16|0;s=t+20|0;b:while(1){do{if((d|0)==(q|0)){v=20;break a}x=0;Qa(124,t|0,d|0,c|0);j=x;x=0;if(j&1){v=7;break b}j=k[l>>2]|0;h=k[m>>2]|0;A=j-h>>2;f=k[n>>2]|0;e=k[o>>2]|0;if((((A|0)==0?0:(A*170|0)+-1|0)|0)==(e+f|0)){x=0;ra(336,u|0);A=x;x=0;if(A&1)break b;e=k[o>>2]|0;f=k[n>>2]|0;j=k[l>>2]|0;h=k[m>>2]|0}e=e+f|0;if((j|0)==(h|0))e=0;else e=(k[h+(((e>>>0)/170|0)<<2)>>2]|0)+(((e>>>0)%170|0)*24|0)|0;k[e>>2]=k[t>>2];k[e+4>>2]=k[t+4>>2];k[e+8>>2]=k[t+8>>2];k[e+12>>2]=k[t+12>>2];k[e+16>>2]=k[p>>2];k[e+20>>2]=k[s>>2];k[p>>2]=0;k[s>>2]=0;k[o>>2]=(k[o>>2]|0)+1;d=d+24|0}while((d-(k[g>>2]|0)|0)!=4080);d=g+4|0;g=d;d=k[d>>2]|0}if((v|0)==7){d=mb()|0;break}e=mb()|0;d=k[s>>2]|0;if(!d){A=e;CQ(z);yb(A|0)}CQ(d);A=e;CQ(z);yb(A|0)}while(0);do if((v|0)==20){e=b+4|0;f=k[b+8>>2]|0;d=k[b+12>>2]|0;if(!d)d=0;else{x=0;d=Ka(890,d|0,c|0)|0;A=x;x=0;if(A&1){d=mb()|0;break}}i[a>>0]=0;k[a+4>>2]=k[e>>2];k[a+8>>2]=f;k[a+12>>2]=d;k[a+16>>2]=w;k[a+20>>2]=z;c3(z);if(!d){A=i[b>>0]|0;i[a>>0]=A;CQ(z);r=y;return}i[a>>0]=i[d+57>>0]|0;A=i[b>>0]|0;i[a>>0]=A;CQ(z);r=y;return}while(0);A=d;CQ(z);yb(A|0)}function qj(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0;l=a;i=b;j=i;g=c;n=d;h=n;if(!j){f=(e|0)!=0;if(!h){if(f){k[e>>2]=(l>>>0)%(g>>>0);k[e+4>>2]=0}n=0;e=(l>>>0)/(g>>>0)>>>0;return (M=n,e)|0}else{if(!f){n=0;e=0;return (M=n,e)|0}k[e>>2]=a|0;k[e+4>>2]=b&0;n=0;e=0;return (M=n,e)|0}}f=(h|0)==0;do if(!g){if(f){if(e|0){k[e>>2]=(j>>>0)%(g>>>0);k[e+4>>2]=0}n=0;e=(j>>>0)/(g>>>0)>>>0;return (M=n,e)|0}if(!l){if(e|0){k[e>>2]=0;k[e+4>>2]=(j>>>0)%(h>>>0)}n=0;e=(j>>>0)/(h>>>0)>>>0;return (M=n,e)|0}f=h-1|0;if(!(f&h)){if(e|0){k[e>>2]=a|0;k[e+4>>2]=f&j|b&0}n=0;e=j>>>((nI(h|0)|0)>>>0);return (M=n,e)|0}f=(ka(h|0)|0)-(ka(j|0)|0)|0;if(f>>>0<=30){b=f+1|0;h=31-f|0;g=b;a=j<