' + data.receivedMsgBody + '
');\n if (!data.mobile) {\n $('#submitEmailButton').text(data.buttonText)\n .attr('data-dismiss', 'modal');\n } else {\n $('.send-email-btn').empty()\n .html(''\n + data.buttonText + ''\n );\n }\n }\n },\n error: function () {\n form.spinner().stop();\n }\n });\n return false;\n });\n },\n onlyNumbers: function () {\n $(document).on('input', '.numeric-field', function () {\n var currentString = $(this).val();\n var regExpPattern = '[0-9]*';\n if ($(this).hasClass('meal-plans-field__weight')) {\n // Allow dot + decimal (, or .)\n regExpPattern += '([\\\\.|\\\\,]?[0-9]{0,2})';\n }\n var regExp = new RegExp('^' + regExpPattern + '$');\n if (!regExp.test(currentString)) {\n $(this).val(currentString.substring(0, currentString.length - 1));\n }\n });\n },\n\n onlyLetters: function () {\n $(document).on('input', '.text-field', function () {\n if ($(this).attr('id') != 'mpDogName') {\n var currentString = $(this).val();\n // eslint-disable-next-line no-useless-escape\n var regExp = new RegExp('^[a-zA-Z\\s]*$');\n if (!regExp.test(currentString)) {\n $(this).val(currentString.substring(0, currentString.length - 1));\n }\n }\n });\n },\n\n loadBoxEdit: function () {\n $(function () {\n var $editLoader = $('input.editLoader');\n if ($editLoader.length > 0) {\n var $form = $('form.meal-plans-form');\n var target = $editLoader.data('url');\n var data = $form.serialize();\n var method = 'POST';\n handleStepAction($form, target, data, method);\n }\n });\n },\n\n dailyDoseChange: function () {\n $(document).on('click', '.daily-feeding .nuggets-quantity button', function () {\n var $this = $(this);\n\n // Check if it's possible to change the quantity on the desired way;\n var maximum = $(this).parents('.nuggets-quantity').data('maximum');\n var minimum = $(this).parents('.nuggets-quantity').data('minimum');\n var current = $(this).parents('.nuggets-quantity').data('current');\n var limitReached = ($this.data('quantity') == 'minus' && current == minimum) || ($this.data('quantity') == 'plus' && current == maximum);\n\n if (!limitReached) {\n var $form = $('.meal-plans-form');\n var data = $form.serialize();\n var selectedWeight = $('.box-config-consecutive .icon-wrapper input:checked').parent().data('weight');\n var url = $this.data('href') + '&selectedweight=' + selectedWeight;\n $.spinner().start();\n $.ajax({\n url: url,\n type: 'POST',\n data: data,\n success: function (response) {\n if (response.renderedTemplate) {\n stylePage('');\n $form.empty().html(response.renderedTemplate);\n stylePage(response.quizStep);\n clearRequired();\n createSlider();\n updateSelectorInfo();\n\n $('.meal-plans').data('step', response.quizStep);\n $('body, html').animate({\n scrollTop: 0,\n }, 400);\n } else if (response.redirectUrl) {\n window.location.href = response.redirectUrl;\n }\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n }\n });\n },\n\n boxFooterMenu: function () {\n $(document).on('click', '.protein-selector', function () {\n var $this = $(this);\n var protein = $(this).data('protein');\n if (!$this.hasClass('active')) {\n $('.protein-selector').removeClass('active');\n $this.addClass('active');\n $('.protein-content').addClass('d-none');\n $('.protein-content[data-protein=' + protein + ']').removeClass('d-none');\n }\n });\n },\n\n /**\n * A function that handles the interstitial for meal plans\n */\n initInterstitial: function () {\n var $interstitial = $('.mp-prestep-interstitial');\n var $cta = $interstitial.find('.mp-prestep-interstitial__cta');\n\n if (!$interstitial.length) {\n return;\n } else {\n // Add a class to the body so it can be tracked when an interstitial is active\n $('body').addClass('interstitial__active');\n }\n\n $cta.on('click', () => {\n // Reactivate mealplans contnt\n $('.meal-plans-content').removeClass('d-none');\n\n // Deactivate interstitial\n $('body').removeClass('interstitial__active');\n\n // Remove interstitial from DOM\n $interstitial.remove();\n\n // Autoscroll to top\n $('html, body').animate({\n scrollTop: 0,\n }, 400);\n });\n\n },\n\n preload: function () {\n handlePreload();\n },\n};\n","\"use strict\";\nexport var PipsMode;\n(function (PipsMode) {\n PipsMode[\"Range\"] = \"range\";\n PipsMode[\"Steps\"] = \"steps\";\n PipsMode[\"Positions\"] = \"positions\";\n PipsMode[\"Count\"] = \"count\";\n PipsMode[\"Values\"] = \"values\";\n})(PipsMode || (PipsMode = {}));\nexport var PipsType;\n(function (PipsType) {\n PipsType[PipsType[\"None\"] = -1] = \"None\";\n PipsType[PipsType[\"NoValue\"] = 0] = \"NoValue\";\n PipsType[PipsType[\"LargeValue\"] = 1] = \"LargeValue\";\n PipsType[PipsType[\"SmallValue\"] = 2] = \"SmallValue\";\n})(PipsType || (PipsType = {}));\n//region Helper Methods\nfunction isValidFormatter(entry) {\n return isValidPartialFormatter(entry) && typeof entry.from === \"function\";\n}\nfunction isValidPartialFormatter(entry) {\n // partial formatters only need a to function and not a from function\n return typeof entry === \"object\" && typeof entry.to === \"function\";\n}\nfunction removeElement(el) {\n el.parentElement.removeChild(el);\n}\nfunction isSet(value) {\n return value !== null && value !== undefined;\n}\n// Bindable version\nfunction preventDefault(e) {\n e.preventDefault();\n}\n// Removes duplicates from an array.\nfunction unique(array) {\n return array.filter(function (a) {\n return !this[a] ? (this[a] = true) : false;\n }, {});\n}\n// Round a value to the closest 'to'.\nfunction closest(value, to) {\n return Math.round(value / to) * to;\n}\n// Current position of an element relative to the document.\nfunction offset(elem, orientation) {\n var rect = elem.getBoundingClientRect();\n var doc = elem.ownerDocument;\n var docElem = doc.documentElement;\n var pageOffset = getPageOffset(doc);\n // getBoundingClientRect contains left scroll in Chrome on Android.\n // I haven't found a feature detection that proves this. Worst case\n // scenario on mis-match: the 'tap' feature on horizontal sliders breaks.\n if (/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)) {\n pageOffset.x = 0;\n }\n return orientation ? rect.top + pageOffset.y - docElem.clientTop : rect.left + pageOffset.x - docElem.clientLeft;\n}\n// Checks whether a value is numerical.\nfunction isNumeric(a) {\n return typeof a === \"number\" && !isNaN(a) && isFinite(a);\n}\n// Sets a class and removes it after [duration] ms.\nfunction addClassFor(element, className, duration) {\n if (duration > 0) {\n addClass(element, className);\n setTimeout(function () {\n removeClass(element, className);\n }, duration);\n }\n}\n// Limits a value to 0 - 100\nfunction limit(a) {\n return Math.max(Math.min(a, 100), 0);\n}\n// Wraps a variable as an array, if it isn't one yet.\n// Note that an input array is returned by reference!\nfunction asArray(a) {\n return Array.isArray(a) ? a : [a];\n}\n// Counts decimals\nfunction countDecimals(numStr) {\n numStr = String(numStr);\n var pieces = numStr.split(\".\");\n return pieces.length > 1 ? pieces[1].length : 0;\n}\n// http://youmightnotneedjquery.com/#add_class\nfunction addClass(el, className) {\n if (el.classList && !/\\s/.test(className)) {\n el.classList.add(className);\n }\n else {\n el.className += \" \" + className;\n }\n}\n// http://youmightnotneedjquery.com/#remove_class\nfunction removeClass(el, className) {\n if (el.classList && !/\\s/.test(className)) {\n el.classList.remove(className);\n }\n else {\n el.className = el.className.replace(new RegExp(\"(^|\\\\b)\" + className.split(\" \").join(\"|\") + \"(\\\\b|$)\", \"gi\"), \" \");\n }\n}\n// https://plainjs.com/javascript/attributes/adding-removing-and-testing-for-classes-9/\nfunction hasClass(el, className) {\n return el.classList ? el.classList.contains(className) : new RegExp(\"\\\\b\" + className + \"\\\\b\").test(el.className);\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY#Notes\nfunction getPageOffset(doc) {\n var supportPageOffset = window.pageXOffset !== undefined;\n var isCSS1Compat = (doc.compatMode || \"\") === \"CSS1Compat\";\n var x = supportPageOffset\n ? window.pageXOffset\n : isCSS1Compat\n ? doc.documentElement.scrollLeft\n : doc.body.scrollLeft;\n var y = supportPageOffset\n ? window.pageYOffset\n : isCSS1Compat\n ? doc.documentElement.scrollTop\n : doc.body.scrollTop;\n return {\n x: x,\n y: y,\n };\n}\n// we provide a function to compute constants instead\n// of accessing window.* as soon as the module needs it\n// so that we do not compute anything if not needed\nfunction getActions() {\n // Determine the events to bind. IE11 implements pointerEvents without\n // a prefix, which breaks compatibility with the IE10 implementation.\n return window.navigator.pointerEnabled\n ? {\n start: \"pointerdown\",\n move: \"pointermove\",\n end: \"pointerup\",\n }\n : window.navigator.msPointerEnabled\n ? {\n start: \"MSPointerDown\",\n move: \"MSPointerMove\",\n end: \"MSPointerUp\",\n }\n : {\n start: \"mousedown touchstart\",\n move: \"mousemove touchmove\",\n end: \"mouseup touchend\",\n };\n}\n// https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n// Issue #785\nfunction getSupportsPassive() {\n var supportsPassive = false;\n /* eslint-disable */\n try {\n var opts = Object.defineProperty({}, \"passive\", {\n get: function () {\n supportsPassive = true;\n },\n });\n // @ts-ignore\n window.addEventListener(\"test\", null, opts);\n }\n catch (e) { }\n /* eslint-enable */\n return supportsPassive;\n}\nfunction getSupportsTouchActionNone() {\n return window.CSS && CSS.supports && CSS.supports(\"touch-action\", \"none\");\n}\n//endregion\n//region Range Calculation\n// Determine the size of a sub-range in relation to a full range.\nfunction subRangeRatio(pa, pb) {\n return 100 / (pb - pa);\n}\n// (percentage) How many percent is this value of this range?\nfunction fromPercentage(range, value, startRange) {\n return (value * 100) / (range[startRange + 1] - range[startRange]);\n}\n// (percentage) Where is this value on this range?\nfunction toPercentage(range, value) {\n return fromPercentage(range, range[0] < 0 ? value + Math.abs(range[0]) : value - range[0], 0);\n}\n// (value) How much is this percentage on this range?\nfunction isPercentage(range, value) {\n return (value * (range[1] - range[0])) / 100 + range[0];\n}\nfunction getJ(value, arr) {\n var j = 1;\n while (value >= arr[j]) {\n j += 1;\n }\n return j;\n}\n// (percentage) Input a value, find where, on a scale of 0-100, it applies.\nfunction toStepping(xVal, xPct, value) {\n if (value >= xVal.slice(-1)[0]) {\n return 100;\n }\n var j = getJ(value, xVal);\n var va = xVal[j - 1];\n var vb = xVal[j];\n var pa = xPct[j - 1];\n var pb = xPct[j];\n return pa + toPercentage([va, vb], value) / subRangeRatio(pa, pb);\n}\n// (value) Input a percentage, find where it is on the specified range.\nfunction fromStepping(xVal, xPct, value) {\n // There is no range group that fits 100\n if (value >= 100) {\n return xVal.slice(-1)[0];\n }\n var j = getJ(value, xPct);\n var va = xVal[j - 1];\n var vb = xVal[j];\n var pa = xPct[j - 1];\n var pb = xPct[j];\n return isPercentage([va, vb], (value - pa) * subRangeRatio(pa, pb));\n}\n// (percentage) Get the step that applies at a certain value.\nfunction getStep(xPct, xSteps, snap, value) {\n if (value === 100) {\n return value;\n }\n var j = getJ(value, xPct);\n var a = xPct[j - 1];\n var b = xPct[j];\n // If 'snap' is set, steps are used as fixed points on the slider.\n if (snap) {\n // Find the closest position, a or b.\n if (value - a > (b - a) / 2) {\n return b;\n }\n return a;\n }\n if (!xSteps[j - 1]) {\n return value;\n }\n return xPct[j - 1] + closest(value - xPct[j - 1], xSteps[j - 1]);\n}\n//endregion\n//region Spectrum\nvar Spectrum = /** @class */ (function () {\n function Spectrum(entry, snap, singleStep) {\n this.xPct = [];\n this.xVal = [];\n this.xSteps = [];\n this.xNumSteps = [];\n this.xHighestCompleteStep = [];\n this.xSteps = [singleStep || false];\n this.xNumSteps = [false];\n this.snap = snap;\n var index;\n var ordered = [];\n // Map the object keys to an array.\n Object.keys(entry).forEach(function (index) {\n ordered.push([asArray(entry[index]), index]);\n });\n // Sort all entries by value (numeric sort).\n ordered.sort(function (a, b) {\n return a[0][0] - b[0][0];\n });\n // Convert all entries to subranges.\n for (index = 0; index < ordered.length; index++) {\n this.handleEntryPoint(ordered[index][1], ordered[index][0]);\n }\n // Store the actual step values.\n // xSteps is sorted in the same order as xPct and xVal.\n this.xNumSteps = this.xSteps.slice(0);\n // Convert all numeric steps to the percentage of the subrange they represent.\n for (index = 0; index < this.xNumSteps.length; index++) {\n this.handleStepPoint(index, this.xNumSteps[index]);\n }\n }\n Spectrum.prototype.getDistance = function (value) {\n var distances = [];\n for (var index = 0; index < this.xNumSteps.length - 1; index++) {\n distances[index] = fromPercentage(this.xVal, value, index);\n }\n return distances;\n };\n // Calculate the percentual distance over the whole scale of ranges.\n // direction: 0 = backwards / 1 = forwards\n Spectrum.prototype.getAbsoluteDistance = function (value, distances, direction) {\n var xPct_index = 0;\n // Calculate range where to start calculation\n if (value < this.xPct[this.xPct.length - 1]) {\n while (value > this.xPct[xPct_index + 1]) {\n xPct_index++;\n }\n }\n else if (value === this.xPct[this.xPct.length - 1]) {\n xPct_index = this.xPct.length - 2;\n }\n // If looking backwards and the value is exactly at a range separator then look one range further\n if (!direction && value === this.xPct[xPct_index + 1]) {\n xPct_index++;\n }\n if (distances === null) {\n distances = [];\n }\n var start_factor;\n var rest_factor = 1;\n var rest_rel_distance = distances[xPct_index];\n var range_pct = 0;\n var rel_range_distance = 0;\n var abs_distance_counter = 0;\n var range_counter = 0;\n // Calculate what part of the start range the value is\n if (direction) {\n start_factor = (value - this.xPct[xPct_index]) / (this.xPct[xPct_index + 1] - this.xPct[xPct_index]);\n }\n else {\n start_factor = (this.xPct[xPct_index + 1] - value) / (this.xPct[xPct_index + 1] - this.xPct[xPct_index]);\n }\n // Do until the complete distance across ranges is calculated\n while (rest_rel_distance > 0) {\n // Calculate the percentage of total range\n range_pct = this.xPct[xPct_index + 1 + range_counter] - this.xPct[xPct_index + range_counter];\n // Detect if the margin, padding or limit is larger then the current range and calculate\n if (distances[xPct_index + range_counter] * rest_factor + 100 - start_factor * 100 > 100) {\n // If larger then take the percentual distance of the whole range\n rel_range_distance = range_pct * start_factor;\n // Rest factor of relative percentual distance still to be calculated\n rest_factor = (rest_rel_distance - 100 * start_factor) / distances[xPct_index + range_counter];\n // Set start factor to 1 as for next range it does not apply.\n start_factor = 1;\n }\n else {\n // If smaller or equal then take the percentual distance of the calculate percentual part of that range\n rel_range_distance = ((distances[xPct_index + range_counter] * range_pct) / 100) * rest_factor;\n // No rest left as the rest fits in current range\n rest_factor = 0;\n }\n if (direction) {\n abs_distance_counter = abs_distance_counter - rel_range_distance;\n // Limit range to first range when distance becomes outside of minimum range\n if (this.xPct.length + range_counter >= 1) {\n range_counter--;\n }\n }\n else {\n abs_distance_counter = abs_distance_counter + rel_range_distance;\n // Limit range to last range when distance becomes outside of maximum range\n if (this.xPct.length - range_counter >= 1) {\n range_counter++;\n }\n }\n // Rest of relative percentual distance still to be calculated\n rest_rel_distance = distances[xPct_index + range_counter] * rest_factor;\n }\n return value + abs_distance_counter;\n };\n Spectrum.prototype.toStepping = function (value) {\n value = toStepping(this.xVal, this.xPct, value);\n return value;\n };\n Spectrum.prototype.fromStepping = function (value) {\n return fromStepping(this.xVal, this.xPct, value);\n };\n Spectrum.prototype.getStep = function (value) {\n value = getStep(this.xPct, this.xSteps, this.snap, value);\n return value;\n };\n Spectrum.prototype.getDefaultStep = function (value, isDown, size) {\n var j = getJ(value, this.xPct);\n // When at the top or stepping down, look at the previous sub-range\n if (value === 100 || (isDown && value === this.xPct[j - 1])) {\n j = Math.max(j - 1, 1);\n }\n return (this.xVal[j] - this.xVal[j - 1]) / size;\n };\n Spectrum.prototype.getNearbySteps = function (value) {\n var j = getJ(value, this.xPct);\n return {\n stepBefore: {\n startValue: this.xVal[j - 2],\n step: this.xNumSteps[j - 2],\n highestStep: this.xHighestCompleteStep[j - 2],\n },\n thisStep: {\n startValue: this.xVal[j - 1],\n step: this.xNumSteps[j - 1],\n highestStep: this.xHighestCompleteStep[j - 1],\n },\n stepAfter: {\n startValue: this.xVal[j],\n step: this.xNumSteps[j],\n highestStep: this.xHighestCompleteStep[j],\n },\n };\n };\n Spectrum.prototype.countStepDecimals = function () {\n var stepDecimals = this.xNumSteps.map(countDecimals);\n return Math.max.apply(null, stepDecimals);\n };\n Spectrum.prototype.hasNoSize = function () {\n return this.xVal[0] === this.xVal[this.xVal.length - 1];\n };\n // Outside testing\n Spectrum.prototype.convert = function (value) {\n return this.getStep(this.toStepping(value));\n };\n Spectrum.prototype.handleEntryPoint = function (index, value) {\n var percentage;\n // Covert min/max syntax to 0 and 100.\n if (index === \"min\") {\n percentage = 0;\n }\n else if (index === \"max\") {\n percentage = 100;\n }\n else {\n percentage = parseFloat(index);\n }\n // Check for correct input.\n if (!isNumeric(percentage) || !isNumeric(value[0])) {\n throw new Error(\"noUiSlider: 'range' value isn't numeric.\");\n }\n // Store values.\n this.xPct.push(percentage);\n this.xVal.push(value[0]);\n var value1 = Number(value[1]);\n // NaN will evaluate to false too, but to keep\n // logging clear, set step explicitly. Make sure\n // not to override the 'step' setting with false.\n if (!percentage) {\n if (!isNaN(value1)) {\n this.xSteps[0] = value1;\n }\n }\n else {\n this.xSteps.push(isNaN(value1) ? false : value1);\n }\n this.xHighestCompleteStep.push(0);\n };\n Spectrum.prototype.handleStepPoint = function (i, n) {\n // Ignore 'false' stepping.\n if (!n) {\n return;\n }\n // Step over zero-length ranges (#948);\n if (this.xVal[i] === this.xVal[i + 1]) {\n this.xSteps[i] = this.xHighestCompleteStep[i] = this.xVal[i];\n return;\n }\n // Factor to range ratio\n this.xSteps[i] =\n fromPercentage([this.xVal[i], this.xVal[i + 1]], n, 0) / subRangeRatio(this.xPct[i], this.xPct[i + 1]);\n var totalSteps = (this.xVal[i + 1] - this.xVal[i]) / this.xNumSteps[i];\n var highestStep = Math.ceil(Number(totalSteps.toFixed(3)) - 1);\n var step = this.xVal[i] + this.xNumSteps[i] * highestStep;\n this.xHighestCompleteStep[i] = step;\n };\n return Spectrum;\n}());\n//endregion\n//region Options\n/*\tEvery input option is tested and parsed. This will prevent\n endless validation in internal methods. These tests are\n structured with an item for every option available. An\n option can be marked as required by setting the 'r' flag.\n The testing function is provided with three arguments:\n - The provided value for the option;\n - A reference to the options object;\n - The name for the option;\n\n The testing function returns false when an error is detected,\n or true when everything is OK. It can also modify the option\n object, to make sure all values can be correctly looped elsewhere. */\n//region Defaults\nvar defaultFormatter = {\n to: function (value) {\n return value === undefined ? \"\" : value.toFixed(2);\n },\n from: Number,\n};\nvar cssClasses = {\n target: \"target\",\n base: \"base\",\n origin: \"origin\",\n handle: \"handle\",\n handleLower: \"handle-lower\",\n handleUpper: \"handle-upper\",\n touchArea: \"touch-area\",\n horizontal: \"horizontal\",\n vertical: \"vertical\",\n background: \"background\",\n connect: \"connect\",\n connects: \"connects\",\n ltr: \"ltr\",\n rtl: \"rtl\",\n textDirectionLtr: \"txt-dir-ltr\",\n textDirectionRtl: \"txt-dir-rtl\",\n draggable: \"draggable\",\n drag: \"state-drag\",\n tap: \"state-tap\",\n active: \"active\",\n tooltip: \"tooltip\",\n pips: \"pips\",\n pipsHorizontal: \"pips-horizontal\",\n pipsVertical: \"pips-vertical\",\n marker: \"marker\",\n markerHorizontal: \"marker-horizontal\",\n markerVertical: \"marker-vertical\",\n markerNormal: \"marker-normal\",\n markerLarge: \"marker-large\",\n markerSub: \"marker-sub\",\n value: \"value\",\n valueHorizontal: \"value-horizontal\",\n valueVertical: \"value-vertical\",\n valueNormal: \"value-normal\",\n valueLarge: \"value-large\",\n valueSub: \"value-sub\",\n};\n// Namespaces of internal event listeners\nvar INTERNAL_EVENT_NS = {\n tooltips: \".__tooltips\",\n aria: \".__aria\",\n};\n//endregion\nfunction testStep(parsed, entry) {\n if (!isNumeric(entry)) {\n throw new Error(\"noUiSlider: 'step' is not numeric.\");\n }\n // The step option can still be used to set stepping\n // for linear sliders. Overwritten if set in 'range'.\n parsed.singleStep = entry;\n}\nfunction testKeyboardPageMultiplier(parsed, entry) {\n if (!isNumeric(entry)) {\n throw new Error(\"noUiSlider: 'keyboardPageMultiplier' is not numeric.\");\n }\n parsed.keyboardPageMultiplier = entry;\n}\nfunction testKeyboardMultiplier(parsed, entry) {\n if (!isNumeric(entry)) {\n throw new Error(\"noUiSlider: 'keyboardMultiplier' is not numeric.\");\n }\n parsed.keyboardMultiplier = entry;\n}\nfunction testKeyboardDefaultStep(parsed, entry) {\n if (!isNumeric(entry)) {\n throw new Error(\"noUiSlider: 'keyboardDefaultStep' is not numeric.\");\n }\n parsed.keyboardDefaultStep = entry;\n}\nfunction testRange(parsed, entry) {\n // Filter incorrect input.\n if (typeof entry !== \"object\" || Array.isArray(entry)) {\n throw new Error(\"noUiSlider: 'range' is not an object.\");\n }\n // Catch missing start or end.\n if (entry.min === undefined || entry.max === undefined) {\n throw new Error(\"noUiSlider: Missing 'min' or 'max' in 'range'.\");\n }\n parsed.spectrum = new Spectrum(entry, parsed.snap || false, parsed.singleStep);\n}\nfunction testStart(parsed, entry) {\n entry = asArray(entry);\n // Validate input. Values aren't tested, as the public .val method\n // will always provide a valid location.\n if (!Array.isArray(entry) || !entry.length) {\n throw new Error(\"noUiSlider: 'start' option is incorrect.\");\n }\n // Store the number of handles.\n parsed.handles = entry.length;\n // When the slider is initialized, the .val method will\n // be called with the start options.\n parsed.start = entry;\n}\nfunction testSnap(parsed, entry) {\n if (typeof entry !== \"boolean\") {\n throw new Error(\"noUiSlider: 'snap' option must be a boolean.\");\n }\n // Enforce 100% stepping within subranges.\n parsed.snap = entry;\n}\nfunction testAnimate(parsed, entry) {\n if (typeof entry !== \"boolean\") {\n throw new Error(\"noUiSlider: 'animate' option must be a boolean.\");\n }\n // Enforce 100% stepping within subranges.\n parsed.animate = entry;\n}\nfunction testAnimationDuration(parsed, entry) {\n if (typeof entry !== \"number\") {\n throw new Error(\"noUiSlider: 'animationDuration' option must be a number.\");\n }\n parsed.animationDuration = entry;\n}\nfunction testConnect(parsed, entry) {\n var connect = [false];\n var i;\n // Map legacy options\n if (entry === \"lower\") {\n entry = [true, false];\n }\n else if (entry === \"upper\") {\n entry = [false, true];\n }\n // Handle boolean options\n if (entry === true || entry === false) {\n for (i = 1; i < parsed.handles; i++) {\n connect.push(entry);\n }\n connect.push(false);\n }\n // Reject invalid input\n else if (!Array.isArray(entry) || !entry.length || entry.length !== parsed.handles + 1) {\n throw new Error(\"noUiSlider: 'connect' option doesn't match handle count.\");\n }\n else {\n connect = entry;\n }\n parsed.connect = connect;\n}\nfunction testOrientation(parsed, entry) {\n // Set orientation to an a numerical value for easy\n // array selection.\n switch (entry) {\n case \"horizontal\":\n parsed.ort = 0;\n break;\n case \"vertical\":\n parsed.ort = 1;\n break;\n default:\n throw new Error(\"noUiSlider: 'orientation' option is invalid.\");\n }\n}\nfunction testMargin(parsed, entry) {\n if (!isNumeric(entry)) {\n throw new Error(\"noUiSlider: 'margin' option must be numeric.\");\n }\n // Issue #582\n if (entry === 0) {\n return;\n }\n parsed.margin = parsed.spectrum.getDistance(entry);\n}\nfunction testLimit(parsed, entry) {\n if (!isNumeric(entry)) {\n throw new Error(\"noUiSlider: 'limit' option must be numeric.\");\n }\n parsed.limit = parsed.spectrum.getDistance(entry);\n if (!parsed.limit || parsed.handles < 2) {\n throw new Error(\"noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.\");\n }\n}\nfunction testPadding(parsed, entry) {\n var index;\n if (!isNumeric(entry) && !Array.isArray(entry)) {\n throw new Error(\"noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers.\");\n }\n if (Array.isArray(entry) && !(entry.length === 2 || isNumeric(entry[0]) || isNumeric(entry[1]))) {\n throw new Error(\"noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers.\");\n }\n if (entry === 0) {\n return;\n }\n if (!Array.isArray(entry)) {\n entry = [entry, entry];\n }\n // 'getDistance' returns false for invalid values.\n parsed.padding = [parsed.spectrum.getDistance(entry[0]), parsed.spectrum.getDistance(entry[1])];\n for (index = 0; index < parsed.spectrum.xNumSteps.length - 1; index++) {\n // last \"range\" can't contain step size as it is purely an endpoint.\n if (parsed.padding[0][index] < 0 || parsed.padding[1][index] < 0) {\n throw new Error(\"noUiSlider: 'padding' option must be a positive number(s).\");\n }\n }\n var totalPadding = entry[0] + entry[1];\n var firstValue = parsed.spectrum.xVal[0];\n var lastValue = parsed.spectrum.xVal[parsed.spectrum.xVal.length - 1];\n if (totalPadding / (lastValue - firstValue) > 1) {\n throw new Error(\"noUiSlider: 'padding' option must not exceed 100% of the range.\");\n }\n}\nfunction testDirection(parsed, entry) {\n // Set direction as a numerical value for easy parsing.\n // Invert connection for RTL sliders, so that the proper\n // handles get the connect/background classes.\n switch (entry) {\n case \"ltr\":\n parsed.dir = 0;\n break;\n case \"rtl\":\n parsed.dir = 1;\n break;\n default:\n throw new Error(\"noUiSlider: 'direction' option was not recognized.\");\n }\n}\nfunction testBehaviour(parsed, entry) {\n // Make sure the input is a string.\n if (typeof entry !== \"string\") {\n throw new Error(\"noUiSlider: 'behaviour' must be a string containing options.\");\n }\n // Check if the string contains any keywords.\n // None are required.\n var tap = entry.indexOf(\"tap\") >= 0;\n var drag = entry.indexOf(\"drag\") >= 0;\n var fixed = entry.indexOf(\"fixed\") >= 0;\n var snap = entry.indexOf(\"snap\") >= 0;\n var hover = entry.indexOf(\"hover\") >= 0;\n var unconstrained = entry.indexOf(\"unconstrained\") >= 0;\n var invertConnects = entry.indexOf(\"invert-connects\") >= 0;\n var dragAll = entry.indexOf(\"drag-all\") >= 0;\n var smoothSteps = entry.indexOf(\"smooth-steps\") >= 0;\n if (fixed) {\n if (parsed.handles !== 2) {\n throw new Error(\"noUiSlider: 'fixed' behaviour must be used with 2 handles\");\n }\n // Use margin to enforce fixed state\n testMargin(parsed, parsed.start[1] - parsed.start[0]);\n }\n if (invertConnects && parsed.handles !== 2) {\n throw new Error(\"noUiSlider: 'invert-connects' behaviour must be used with 2 handles\");\n }\n if (unconstrained && (parsed.margin || parsed.limit)) {\n throw new Error(\"noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit\");\n }\n parsed.events = {\n tap: tap || snap,\n drag: drag,\n dragAll: dragAll,\n smoothSteps: smoothSteps,\n fixed: fixed,\n snap: snap,\n hover: hover,\n unconstrained: unconstrained,\n invertConnects: invertConnects,\n };\n}\nfunction testTooltips(parsed, entry) {\n if (entry === false) {\n return;\n }\n if (entry === true || isValidPartialFormatter(entry)) {\n parsed.tooltips = [];\n for (var i = 0; i < parsed.handles; i++) {\n parsed.tooltips.push(entry);\n }\n }\n else {\n entry = asArray(entry);\n if (entry.length !== parsed.handles) {\n throw new Error(\"noUiSlider: must pass a formatter for all handles.\");\n }\n entry.forEach(function (formatter) {\n if (typeof formatter !== \"boolean\" && !isValidPartialFormatter(formatter)) {\n throw new Error(\"noUiSlider: 'tooltips' must be passed a formatter or 'false'.\");\n }\n });\n parsed.tooltips = entry;\n }\n}\nfunction testHandleAttributes(parsed, entry) {\n if (entry.length !== parsed.handles) {\n throw new Error(\"noUiSlider: must pass a attributes for all handles.\");\n }\n parsed.handleAttributes = entry;\n}\nfunction testAriaFormat(parsed, entry) {\n if (!isValidPartialFormatter(entry)) {\n throw new Error(\"noUiSlider: 'ariaFormat' requires 'to' method.\");\n }\n parsed.ariaFormat = entry;\n}\nfunction testFormat(parsed, entry) {\n if (!isValidFormatter(entry)) {\n throw new Error(\"noUiSlider: 'format' requires 'to' and 'from' methods.\");\n }\n parsed.format = entry;\n}\nfunction testKeyboardSupport(parsed, entry) {\n if (typeof entry !== \"boolean\") {\n throw new Error(\"noUiSlider: 'keyboardSupport' option must be a boolean.\");\n }\n parsed.keyboardSupport = entry;\n}\nfunction testDocumentElement(parsed, entry) {\n // This is an advanced option. Passed values are used without validation.\n parsed.documentElement = entry;\n}\nfunction testCssPrefix(parsed, entry) {\n if (typeof entry !== \"string\" && entry !== false) {\n throw new Error(\"noUiSlider: 'cssPrefix' must be a string or `false`.\");\n }\n parsed.cssPrefix = entry;\n}\nfunction testCssClasses(parsed, entry) {\n if (typeof entry !== \"object\") {\n throw new Error(\"noUiSlider: 'cssClasses' must be an object.\");\n }\n if (typeof parsed.cssPrefix === \"string\") {\n parsed.cssClasses = {};\n Object.keys(entry).forEach(function (key) {\n parsed.cssClasses[key] = parsed.cssPrefix + entry[key];\n });\n }\n else {\n parsed.cssClasses = entry;\n }\n}\n// Test all developer settings and parse to assumption-safe values.\nfunction testOptions(options) {\n // To prove a fix for #537, freeze options here.\n // If the object is modified, an error will be thrown.\n // Object.freeze(options);\n var parsed = {\n margin: null,\n limit: null,\n padding: null,\n animate: true,\n animationDuration: 300,\n ariaFormat: defaultFormatter,\n format: defaultFormatter,\n };\n // Tests are executed in the order they are presented here.\n var tests = {\n step: { r: false, t: testStep },\n keyboardPageMultiplier: { r: false, t: testKeyboardPageMultiplier },\n keyboardMultiplier: { r: false, t: testKeyboardMultiplier },\n keyboardDefaultStep: { r: false, t: testKeyboardDefaultStep },\n start: { r: true, t: testStart },\n connect: { r: true, t: testConnect },\n direction: { r: true, t: testDirection },\n snap: { r: false, t: testSnap },\n animate: { r: false, t: testAnimate },\n animationDuration: { r: false, t: testAnimationDuration },\n range: { r: true, t: testRange },\n orientation: { r: false, t: testOrientation },\n margin: { r: false, t: testMargin },\n limit: { r: false, t: testLimit },\n padding: { r: false, t: testPadding },\n behaviour: { r: true, t: testBehaviour },\n ariaFormat: { r: false, t: testAriaFormat },\n format: { r: false, t: testFormat },\n tooltips: { r: false, t: testTooltips },\n keyboardSupport: { r: true, t: testKeyboardSupport },\n documentElement: { r: false, t: testDocumentElement },\n cssPrefix: { r: true, t: testCssPrefix },\n cssClasses: { r: true, t: testCssClasses },\n handleAttributes: { r: false, t: testHandleAttributes },\n };\n var defaults = {\n connect: false,\n direction: \"ltr\",\n behaviour: \"tap\",\n orientation: \"horizontal\",\n keyboardSupport: true,\n cssPrefix: \"noUi-\",\n cssClasses: cssClasses,\n keyboardPageMultiplier: 5,\n keyboardMultiplier: 1,\n keyboardDefaultStep: 10,\n };\n // AriaFormat defaults to regular format, if any.\n if (options.format && !options.ariaFormat) {\n options.ariaFormat = options.format;\n }\n // Run all options through a testing mechanism to ensure correct\n // input. It should be noted that options might get modified to\n // be handled properly. E.g. wrapping integers in arrays.\n Object.keys(tests).forEach(function (name) {\n // If the option isn't set, but it is required, throw an error.\n if (!isSet(options[name]) && defaults[name] === undefined) {\n if (tests[name].r) {\n throw new Error(\"noUiSlider: '\" + name + \"' is required.\");\n }\n return;\n }\n tests[name].t(parsed, !isSet(options[name]) ? defaults[name] : options[name]);\n });\n // Forward pips options\n parsed.pips = options.pips;\n // All recent browsers accept unprefixed transform.\n // We need -ms- for IE9 and -webkit- for older Android;\n // Assume use of -webkit- if unprefixed and -ms- are not supported.\n // https://caniuse.com/#feat=transforms2d\n var d = document.createElement(\"div\");\n var msPrefix = d.style.msTransform !== undefined;\n var noPrefix = d.style.transform !== undefined;\n parsed.transformRule = noPrefix ? \"transform\" : msPrefix ? \"msTransform\" : \"webkitTransform\";\n // Pips don't move, so we can place them using left/top.\n var styles = [\n [\"left\", \"top\"],\n [\"right\", \"bottom\"],\n ];\n parsed.style = styles[parsed.dir][parsed.ort];\n return parsed;\n}\n//endregion\nfunction scope(target, options, originalOptions) {\n var actions = getActions();\n var supportsTouchActionNone = getSupportsTouchActionNone();\n var supportsPassive = supportsTouchActionNone && getSupportsPassive();\n // All variables local to 'scope' are prefixed with 'scope_'\n // Slider DOM Nodes\n var scope_Target = target;\n var scope_Base;\n var scope_ConnectBase;\n var scope_Handles;\n var scope_Connects;\n var scope_Pips;\n var scope_Tooltips;\n // Slider state values\n var scope_Spectrum = options.spectrum;\n var scope_Values = [];\n var scope_Locations = [];\n var scope_HandleNumbers = [];\n var scope_ActiveHandlesCount = 0;\n var scope_Events = {};\n var scope_ConnectsInverted = false;\n // Document Nodes\n var scope_Document = target.ownerDocument;\n var scope_DocumentElement = options.documentElement || scope_Document.documentElement;\n var scope_Body = scope_Document.body;\n // For horizontal sliders in standard ltr documents,\n // make .noUi-origin overflow to the left so the document doesn't scroll.\n var scope_DirOffset = scope_Document.dir === \"rtl\" || options.ort === 1 ? 0 : 100;\n // Creates a node, adds it to target, returns the new node.\n function addNodeTo(addTarget, className) {\n var div = scope_Document.createElement(\"div\");\n if (className) {\n addClass(div, className);\n }\n addTarget.appendChild(div);\n return div;\n }\n // Append a origin to the base\n function addOrigin(base, handleNumber) {\n var origin = addNodeTo(base, options.cssClasses.origin);\n var handle = addNodeTo(origin, options.cssClasses.handle);\n addNodeTo(handle, options.cssClasses.touchArea);\n handle.setAttribute(\"data-handle\", String(handleNumber));\n if (options.keyboardSupport) {\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex\n // 0 = focusable and reachable\n handle.setAttribute(\"tabindex\", \"0\");\n handle.addEventListener(\"keydown\", function (event) {\n return eventKeydown(event, handleNumber);\n });\n }\n if (options.handleAttributes !== undefined) {\n var attributes_1 = options.handleAttributes[handleNumber];\n Object.keys(attributes_1).forEach(function (attribute) {\n handle.setAttribute(attribute, attributes_1[attribute]);\n });\n }\n handle.setAttribute(\"role\", \"slider\");\n handle.setAttribute(\"aria-orientation\", options.ort ? \"vertical\" : \"horizontal\");\n if (handleNumber === 0) {\n addClass(handle, options.cssClasses.handleLower);\n }\n else if (handleNumber === options.handles - 1) {\n addClass(handle, options.cssClasses.handleUpper);\n }\n origin.handle = handle;\n return origin;\n }\n // Insert nodes for connect elements\n function addConnect(base, add) {\n if (!add) {\n return false;\n }\n return addNodeTo(base, options.cssClasses.connect);\n }\n // Add handles to the slider base.\n function addElements(connectOptions, base) {\n scope_ConnectBase = addNodeTo(base, options.cssClasses.connects);\n scope_Handles = [];\n scope_Connects = [];\n scope_Connects.push(addConnect(scope_ConnectBase, connectOptions[0]));\n // [::::O====O====O====]\n // connectOptions = [0, 1, 1, 1]\n for (var i = 0; i < options.handles; i++) {\n // Keep a list of all added handles.\n scope_Handles.push(addOrigin(base, i));\n scope_HandleNumbers[i] = i;\n scope_Connects.push(addConnect(scope_ConnectBase, connectOptions[i + 1]));\n }\n }\n // Initialize a single slider.\n function addSlider(addTarget) {\n // Apply classes and data to the target.\n addClass(addTarget, options.cssClasses.target);\n if (options.dir === 0) {\n addClass(addTarget, options.cssClasses.ltr);\n }\n else {\n addClass(addTarget, options.cssClasses.rtl);\n }\n if (options.ort === 0) {\n addClass(addTarget, options.cssClasses.horizontal);\n }\n else {\n addClass(addTarget, options.cssClasses.vertical);\n }\n var textDirection = getComputedStyle(addTarget).direction;\n if (textDirection === \"rtl\") {\n addClass(addTarget, options.cssClasses.textDirectionRtl);\n }\n else {\n addClass(addTarget, options.cssClasses.textDirectionLtr);\n }\n return addNodeTo(addTarget, options.cssClasses.base);\n }\n function addTooltip(handle, handleNumber) {\n if (!options.tooltips || !options.tooltips[handleNumber]) {\n return false;\n }\n return addNodeTo(handle.firstChild, options.cssClasses.tooltip);\n }\n function isSliderDisabled() {\n return scope_Target.hasAttribute(\"disabled\");\n }\n // Disable the slider dragging if any handle is disabled\n function isHandleDisabled(handleNumber) {\n var handleOrigin = scope_Handles[handleNumber];\n return handleOrigin.hasAttribute(\"disabled\");\n }\n function disable(handleNumber) {\n if (handleNumber !== null && handleNumber !== undefined) {\n scope_Handles[handleNumber].setAttribute(\"disabled\", \"\");\n scope_Handles[handleNumber].handle.removeAttribute(\"tabindex\");\n }\n else {\n scope_Target.setAttribute(\"disabled\", \"\");\n scope_Handles.forEach(function (handle) {\n handle.handle.removeAttribute(\"tabindex\");\n });\n }\n }\n function enable(handleNumber) {\n if (handleNumber !== null && handleNumber !== undefined) {\n scope_Handles[handleNumber].removeAttribute(\"disabled\");\n scope_Handles[handleNumber].handle.setAttribute(\"tabindex\", \"0\");\n }\n else {\n scope_Target.removeAttribute(\"disabled\");\n scope_Handles.forEach(function (handle) {\n handle.removeAttribute(\"disabled\");\n handle.handle.setAttribute(\"tabindex\", \"0\");\n });\n }\n }\n function removeTooltips() {\n if (scope_Tooltips) {\n removeEvent(\"update\" + INTERNAL_EVENT_NS.tooltips);\n scope_Tooltips.forEach(function (tooltip) {\n if (tooltip) {\n removeElement(tooltip);\n }\n });\n scope_Tooltips = null;\n }\n }\n // The tooltips option is a shorthand for using the 'update' event.\n function tooltips() {\n removeTooltips();\n // Tooltips are added with options.tooltips in original order.\n scope_Tooltips = scope_Handles.map(addTooltip);\n bindEvent(\"update\" + INTERNAL_EVENT_NS.tooltips, function (values, handleNumber, unencoded) {\n if (!scope_Tooltips || !options.tooltips) {\n return;\n }\n if (scope_Tooltips[handleNumber] === false) {\n return;\n }\n var formattedValue = values[handleNumber];\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n scope_Tooltips[handleNumber].innerHTML = formattedValue;\n });\n }\n function aria() {\n removeEvent(\"update\" + INTERNAL_EVENT_NS.aria);\n bindEvent(\"update\" + INTERNAL_EVENT_NS.aria, function (values, handleNumber, unencoded, tap, positions) {\n // Update Aria Values for all handles, as a change in one changes min and max values for the next.\n scope_HandleNumbers.forEach(function (index) {\n var handle = scope_Handles[index];\n var min = checkHandlePosition(scope_Locations, index, 0, true, true, true);\n var max = checkHandlePosition(scope_Locations, index, 100, true, true, true);\n var now = positions[index];\n // Formatted value for display\n var text = String(options.ariaFormat.to(unencoded[index]));\n // Map to slider range values\n min = scope_Spectrum.fromStepping(min).toFixed(1);\n max = scope_Spectrum.fromStepping(max).toFixed(1);\n now = scope_Spectrum.fromStepping(now).toFixed(1);\n handle.children[0].setAttribute(\"aria-valuemin\", min);\n handle.children[0].setAttribute(\"aria-valuemax\", max);\n handle.children[0].setAttribute(\"aria-valuenow\", now);\n handle.children[0].setAttribute(\"aria-valuetext\", text);\n });\n });\n }\n function getGroup(pips) {\n // Use the range.\n if (pips.mode === PipsMode.Range || pips.mode === PipsMode.Steps) {\n return scope_Spectrum.xVal;\n }\n if (pips.mode === PipsMode.Count) {\n if (pips.values < 2) {\n throw new Error(\"noUiSlider: 'values' (>= 2) required for mode 'count'.\");\n }\n // Divide 0 - 100 in 'count' parts.\n var interval = pips.values - 1;\n var spread = 100 / interval;\n var values = [];\n // List these parts and have them handled as 'positions'.\n while (interval--) {\n values[interval] = interval * spread;\n }\n values.push(100);\n return mapToRange(values, pips.stepped);\n }\n if (pips.mode === PipsMode.Positions) {\n // Map all percentages to on-range values.\n return mapToRange(pips.values, pips.stepped);\n }\n if (pips.mode === PipsMode.Values) {\n // If the value must be stepped, it needs to be converted to a percentage first.\n if (pips.stepped) {\n return pips.values.map(function (value) {\n // Convert to percentage, apply step, return to value.\n return scope_Spectrum.fromStepping(scope_Spectrum.getStep(scope_Spectrum.toStepping(value)));\n });\n }\n // Otherwise, we can simply use the values.\n return pips.values;\n }\n return []; // pips.mode = never\n }\n function mapToRange(values, stepped) {\n return values.map(function (value) {\n return scope_Spectrum.fromStepping(stepped ? scope_Spectrum.getStep(value) : value);\n });\n }\n function generateSpread(pips) {\n function safeIncrement(value, increment) {\n // Avoid floating point variance by dropping the smallest decimal places.\n return Number((value + increment).toFixed(7));\n }\n var group = getGroup(pips);\n var indexes = {};\n var firstInRange = scope_Spectrum.xVal[0];\n var lastInRange = scope_Spectrum.xVal[scope_Spectrum.xVal.length - 1];\n var ignoreFirst = false;\n var ignoreLast = false;\n var prevPct = 0;\n // Create a copy of the group, sort it and filter away all duplicates.\n group = unique(group.slice().sort(function (a, b) {\n return a - b;\n }));\n // Make sure the range starts with the first element.\n if (group[0] !== firstInRange) {\n group.unshift(firstInRange);\n ignoreFirst = true;\n }\n // Likewise for the last one.\n if (group[group.length - 1] !== lastInRange) {\n group.push(lastInRange);\n ignoreLast = true;\n }\n group.forEach(function (current, index) {\n // Get the current step and the lower + upper positions.\n var step;\n var i;\n var q;\n var low = current;\n var high = group[index + 1];\n var newPct;\n var pctDifference;\n var pctPos;\n var type;\n var steps;\n var realSteps;\n var stepSize;\n var isSteps = pips.mode === PipsMode.Steps;\n // When using 'steps' mode, use the provided steps.\n // Otherwise, we'll step on to the next subrange.\n if (isSteps) {\n step = scope_Spectrum.xNumSteps[index];\n }\n // Default to a 'full' step.\n if (!step) {\n step = high - low;\n }\n // If high is undefined we are at the last subrange. Make sure it iterates once (#1088)\n if (high === undefined) {\n high = low;\n }\n // Make sure step isn't 0, which would cause an infinite loop (#654)\n step = Math.max(step, 0.0000001);\n // Find all steps in the subrange.\n for (i = low; i <= high; i = safeIncrement(i, step)) {\n // Get the percentage value for the current step,\n // calculate the size for the subrange.\n newPct = scope_Spectrum.toStepping(i);\n pctDifference = newPct - prevPct;\n steps = pctDifference / (pips.density || 1);\n realSteps = Math.round(steps);\n // This ratio represents the amount of percentage-space a point indicates.\n // For a density 1 the points/percentage = 1. For density 2, that percentage needs to be re-divided.\n // Round the percentage offset to an even number, then divide by two\n // to spread the offset on both sides of the range.\n stepSize = pctDifference / realSteps;\n // Divide all points evenly, adding the correct number to this subrange.\n // Run up to <= so that 100% gets a point, event if ignoreLast is set.\n for (q = 1; q <= realSteps; q += 1) {\n // The ratio between the rounded value and the actual size might be ~1% off.\n // Correct the percentage offset by the number of points\n // per subrange. density = 1 will result in 100 points on the\n // full range, 2 for 50, 4 for 25, etc.\n pctPos = prevPct + q * stepSize;\n indexes[pctPos.toFixed(5)] = [scope_Spectrum.fromStepping(pctPos), 0];\n }\n // Determine the point type.\n type = group.indexOf(i) > -1 ? PipsType.LargeValue : isSteps ? PipsType.SmallValue : PipsType.NoValue;\n // Enforce the 'ignoreFirst' option by overwriting the type for 0.\n if (!index && ignoreFirst && i !== high) {\n type = 0;\n }\n if (!(i === high && ignoreLast)) {\n // Mark the 'type' of this point. 0 = plain, 1 = real value, 2 = step value.\n indexes[newPct.toFixed(5)] = [i, type];\n }\n // Update the percentage count.\n prevPct = newPct;\n }\n });\n return indexes;\n }\n function addMarking(spread, filterFunc, formatter) {\n var _a, _b;\n var element = scope_Document.createElement(\"div\");\n var valueSizeClasses = (_a = {},\n _a[PipsType.None] = \"\",\n _a[PipsType.NoValue] = options.cssClasses.valueNormal,\n _a[PipsType.LargeValue] = options.cssClasses.valueLarge,\n _a[PipsType.SmallValue] = options.cssClasses.valueSub,\n _a);\n var markerSizeClasses = (_b = {},\n _b[PipsType.None] = \"\",\n _b[PipsType.NoValue] = options.cssClasses.markerNormal,\n _b[PipsType.LargeValue] = options.cssClasses.markerLarge,\n _b[PipsType.SmallValue] = options.cssClasses.markerSub,\n _b);\n var valueOrientationClasses = [options.cssClasses.valueHorizontal, options.cssClasses.valueVertical];\n var markerOrientationClasses = [options.cssClasses.markerHorizontal, options.cssClasses.markerVertical];\n addClass(element, options.cssClasses.pips);\n addClass(element, options.ort === 0 ? options.cssClasses.pipsHorizontal : options.cssClasses.pipsVertical);\n function getClasses(type, source) {\n var a = source === options.cssClasses.value;\n var orientationClasses = a ? valueOrientationClasses : markerOrientationClasses;\n var sizeClasses = a ? valueSizeClasses : markerSizeClasses;\n return source + \" \" + orientationClasses[options.ort] + \" \" + sizeClasses[type];\n }\n function addSpread(offset, value, type) {\n // Apply the filter function, if it is set.\n type = filterFunc ? filterFunc(value, type) : type;\n if (type === PipsType.None) {\n return;\n }\n // Add a marker for every point\n var node = addNodeTo(element, false);\n node.className = getClasses(type, options.cssClasses.marker);\n node.style[options.style] = offset + \"%\";\n // Values are only appended for points marked '1' or '2'.\n if (type > PipsType.NoValue) {\n node = addNodeTo(element, false);\n node.className = getClasses(type, options.cssClasses.value);\n node.setAttribute(\"data-value\", String(value));\n node.style[options.style] = offset + \"%\";\n node.innerHTML = String(formatter.to(value));\n }\n }\n // Append all points.\n Object.keys(spread).forEach(function (offset) {\n addSpread(offset, spread[offset][0], spread[offset][1]);\n });\n return element;\n }\n function removePips() {\n if (scope_Pips) {\n removeElement(scope_Pips);\n scope_Pips = null;\n }\n }\n function pips(pips) {\n // Fix #669\n removePips();\n var spread = generateSpread(pips);\n var filter = pips.filter;\n var format = pips.format || {\n to: function (value) {\n return String(Math.round(value));\n },\n };\n scope_Pips = scope_Target.appendChild(addMarking(spread, filter, format));\n return scope_Pips;\n }\n // Shorthand for base dimensions.\n function baseSize() {\n var rect = scope_Base.getBoundingClientRect();\n var alt = (\"offset\" + [\"Width\", \"Height\"][options.ort]);\n return options.ort === 0 ? rect.width || scope_Base[alt] : rect.height || scope_Base[alt];\n }\n // Handler for attaching events trough a proxy.\n function attachEvent(events, element, callback, data) {\n // This function can be used to 'filter' events to the slider.\n // element is a node, not a nodeList\n var method = function (event) {\n var e = fixEvent(event, data.pageOffset, data.target || element);\n // fixEvent returns false if this event has a different target\n // when handling (multi-) touch events;\n if (!e) {\n return false;\n }\n // doNotReject is passed by all end events to make sure released touches\n // are not rejected, leaving the slider \"stuck\" to the cursor;\n if (isSliderDisabled() && !data.doNotReject) {\n return false;\n }\n // Stop if an active 'tap' transition is taking place.\n if (hasClass(scope_Target, options.cssClasses.tap) && !data.doNotReject) {\n return false;\n }\n // Ignore right or middle clicks on start #454\n if (events === actions.start && e.buttons !== undefined && e.buttons > 1) {\n return false;\n }\n // Ignore right or middle clicks on start #454\n if (data.hover && e.buttons) {\n return false;\n }\n // 'supportsPassive' is only true if a browser also supports touch-action: none in CSS.\n // iOS safari does not, so it doesn't get to benefit from passive scrolling. iOS does support\n // touch-action: manipulation, but that allows panning, which breaks\n // sliders after zooming/on non-responsive pages.\n // See: https://bugs.webkit.org/show_bug.cgi?id=133112\n if (!supportsPassive) {\n e.preventDefault();\n }\n e.calcPoint = e.points[options.ort];\n // Call the event handler with the event [ and additional data ].\n callback(e, data);\n return;\n };\n var methods = [];\n // Bind a closure on the target for every event type.\n events.split(\" \").forEach(function (eventName) {\n element.addEventListener(eventName, method, supportsPassive ? { passive: true } : false);\n methods.push([eventName, method]);\n });\n return methods;\n }\n // Provide a clean event with standardized offset values.\n function fixEvent(e, pageOffset, eventTarget) {\n // Filter the event to register the type, which can be\n // touch, mouse or pointer. Offset changes need to be\n // made on an event specific basis.\n var touch = e.type.indexOf(\"touch\") === 0;\n var mouse = e.type.indexOf(\"mouse\") === 0;\n var pointer = e.type.indexOf(\"pointer\") === 0;\n var x = 0;\n var y = 0;\n // IE10 implemented pointer events with a prefix;\n if (e.type.indexOf(\"MSPointer\") === 0) {\n pointer = true;\n }\n // Erroneous events seem to be passed in occasionally on iOS/iPadOS after user finishes interacting with\n // the slider. They appear to be of type MouseEvent, yet they don't have usual properties set. Ignore\n // events that have no touches or buttons associated with them. (#1057, #1079, #1095)\n if (e.type === \"mousedown\" && !e.buttons && !e.touches) {\n return false;\n }\n // The only thing one handle should be concerned about is the touches that originated on top of it.\n if (touch) {\n // Returns true if a touch originated on the target.\n var isTouchOnTarget = function (checkTouch) {\n var target = checkTouch.target;\n return (target === eventTarget ||\n eventTarget.contains(target) ||\n (e.composed && e.composedPath().shift() === eventTarget));\n };\n // In the case of touchstart events, we need to make sure there is still no more than one\n // touch on the target so we look amongst all touches.\n if (e.type === \"touchstart\") {\n var targetTouches = Array.prototype.filter.call(e.touches, isTouchOnTarget);\n // Do not support more than one touch per handle.\n if (targetTouches.length > 1) {\n return false;\n }\n x = targetTouches[0].pageX;\n y = targetTouches[0].pageY;\n }\n else {\n // In the other cases, find on changedTouches is enough.\n var targetTouch = Array.prototype.find.call(e.changedTouches, isTouchOnTarget);\n // Cancel if the target touch has not moved.\n if (!targetTouch) {\n return false;\n }\n x = targetTouch.pageX;\n y = targetTouch.pageY;\n }\n }\n pageOffset = pageOffset || getPageOffset(scope_Document);\n if (mouse || pointer) {\n x = e.clientX + pageOffset.x;\n y = e.clientY + pageOffset.y;\n }\n e.pageOffset = pageOffset;\n e.points = [x, y];\n e.cursor = mouse || pointer; // Fix #435\n return e;\n }\n // Translate a coordinate in the document to a percentage on the slider\n function calcPointToPercentage(calcPoint) {\n var location = calcPoint - offset(scope_Base, options.ort);\n var proposal = (location * 100) / baseSize();\n // Clamp proposal between 0% and 100%\n // Out-of-bound coordinates may occur when .noUi-base pseudo-elements\n // are used (e.g. contained handles feature)\n proposal = limit(proposal);\n return options.dir ? 100 - proposal : proposal;\n }\n // Find handle closest to a certain percentage on the slider\n function getClosestHandle(clickedPosition) {\n var smallestDifference = 100;\n var handleNumber = false;\n scope_Handles.forEach(function (handle, index) {\n // Disabled handles are ignored\n if (isHandleDisabled(index)) {\n return;\n }\n var handlePosition = scope_Locations[index];\n var differenceWithThisHandle = Math.abs(handlePosition - clickedPosition);\n // Initial state\n var clickAtEdge = differenceWithThisHandle === 100 && smallestDifference === 100;\n // Difference with this handle is smaller than the previously checked handle\n var isCloser = differenceWithThisHandle < smallestDifference;\n var isCloserAfter = differenceWithThisHandle <= smallestDifference && clickedPosition > handlePosition;\n if (isCloser || isCloserAfter || clickAtEdge) {\n handleNumber = index;\n smallestDifference = differenceWithThisHandle;\n }\n });\n return handleNumber;\n }\n // Fire 'end' when a mouse or pen leaves the document.\n function documentLeave(event, data) {\n if (event.type === \"mouseout\" &&\n event.target.nodeName === \"HTML\" &&\n event.relatedTarget === null) {\n eventEnd(event, data);\n }\n }\n // Handle movement on document for handle and range drag.\n function eventMove(event, data) {\n // Fix #498\n // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n // IE9 has .buttons and .which zero on mousemove.\n // Firefox breaks the spec MDN defines.\n if (navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) {\n return eventEnd(event, data);\n }\n // Check if we are moving up or down\n var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n // Convert the movement into a percentage of the slider width/height\n var proposal = (movement * 100) / data.baseSize;\n moveHandles(movement > 0, proposal, data.locations, data.handleNumbers, data.connect);\n }\n // Unbind move events on document, call callbacks.\n function eventEnd(event, data) {\n // The handle is no longer active, so remove the class.\n if (data.handle) {\n removeClass(data.handle, options.cssClasses.active);\n scope_ActiveHandlesCount -= 1;\n }\n // Unbind the move and end events, which are added on 'start'.\n data.listeners.forEach(function (c) {\n scope_DocumentElement.removeEventListener(c[0], c[1]);\n });\n if (scope_ActiveHandlesCount === 0) {\n // Remove dragging class.\n removeClass(scope_Target, options.cssClasses.drag);\n setZindex();\n // Remove cursor styles and text-selection events bound to the body.\n if (event.cursor) {\n scope_Body.style.cursor = \"\";\n scope_Body.removeEventListener(\"selectstart\", preventDefault);\n }\n }\n if (options.events.smoothSteps) {\n data.handleNumbers.forEach(function (handleNumber) {\n setHandle(handleNumber, scope_Locations[handleNumber], true, true, false, false);\n });\n data.handleNumbers.forEach(function (handleNumber) {\n fireEvent(\"update\", handleNumber);\n });\n }\n data.handleNumbers.forEach(function (handleNumber) {\n fireEvent(\"change\", handleNumber);\n fireEvent(\"set\", handleNumber);\n fireEvent(\"end\", handleNumber);\n });\n }\n // Bind move events on document.\n function eventStart(event, data) {\n // Ignore event if any handle is disabled\n if (data.handleNumbers.some(isHandleDisabled)) {\n return;\n }\n var handle;\n if (data.handleNumbers.length === 1) {\n var handleOrigin = scope_Handles[data.handleNumbers[0]];\n handle = handleOrigin.children[0];\n scope_ActiveHandlesCount += 1;\n // Mark the handle as 'active' so it can be styled.\n addClass(handle, options.cssClasses.active);\n }\n // A drag should never propagate up to the 'tap' event.\n event.stopPropagation();\n // Record the event listeners.\n var listeners = [];\n // Attach the move and end events.\n var moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, {\n // The event target has changed so we need to propagate the original one so that we keep\n // relying on it to extract target touches.\n target: event.target,\n handle: handle,\n connect: data.connect,\n listeners: listeners,\n startCalcPoint: event.calcPoint,\n baseSize: baseSize(),\n pageOffset: event.pageOffset,\n handleNumbers: data.handleNumbers,\n buttonsProperty: event.buttons,\n locations: scope_Locations.slice(),\n });\n var endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, {\n target: event.target,\n handle: handle,\n listeners: listeners,\n doNotReject: true,\n handleNumbers: data.handleNumbers,\n });\n var outEvent = attachEvent(\"mouseout\", scope_DocumentElement, documentLeave, {\n target: event.target,\n handle: handle,\n listeners: listeners,\n doNotReject: true,\n handleNumbers: data.handleNumbers,\n });\n // We want to make sure we pushed the listeners in the listener list rather than creating\n // a new one as it has already been passed to the event handlers.\n listeners.push.apply(listeners, moveEvent.concat(endEvent, outEvent));\n // Text selection isn't an issue on touch devices,\n // so adding cursor styles can be skipped.\n if (event.cursor) {\n // Prevent the 'I' cursor and extend the range-drag cursor.\n scope_Body.style.cursor = getComputedStyle(event.target).cursor;\n // Mark the target with a dragging state.\n if (scope_Handles.length > 1) {\n addClass(scope_Target, options.cssClasses.drag);\n }\n // Prevent text selection when dragging the handles.\n // In noUiSlider <= 9.2.0, this was handled by calling preventDefault on mouse/touch start/move,\n // which is scroll blocking. The selectstart event is supported by FireFox starting from version 52,\n // meaning the only holdout is iOS Safari. This doesn't matter: text selection isn't triggered there.\n // The 'cursor' flag is false.\n // See: http://caniuse.com/#search=selectstart\n scope_Body.addEventListener(\"selectstart\", preventDefault, false);\n }\n data.handleNumbers.forEach(function (handleNumber) {\n fireEvent(\"start\", handleNumber);\n });\n }\n // Move closest handle to tapped location.\n function eventTap(event) {\n // The tap event shouldn't propagate up\n event.stopPropagation();\n var proposal = calcPointToPercentage(event.calcPoint);\n var handleNumber = getClosestHandle(proposal);\n // Tackle the case that all handles are 'disabled'.\n if (handleNumber === false) {\n return;\n }\n // Flag the slider as it is now in a transitional state.\n // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n if (!options.events.snap) {\n addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n }\n setHandle(handleNumber, proposal, true, true);\n setZindex();\n fireEvent(\"slide\", handleNumber, true);\n fireEvent(\"update\", handleNumber, true);\n if (!options.events.snap) {\n fireEvent(\"change\", handleNumber, true);\n fireEvent(\"set\", handleNumber, true);\n }\n else {\n eventStart(event, { handleNumbers: [handleNumber] });\n }\n }\n // Fires a 'hover' event for a hovered mouse/pen position.\n function eventHover(event) {\n var proposal = calcPointToPercentage(event.calcPoint);\n var to = scope_Spectrum.getStep(proposal);\n var value = scope_Spectrum.fromStepping(to);\n Object.keys(scope_Events).forEach(function (targetEvent) {\n if (\"hover\" === targetEvent.split(\".\")[0]) {\n scope_Events[targetEvent].forEach(function (callback) {\n callback.call(scope_Self, value);\n });\n }\n });\n }\n // Handles keydown on focused handles\n // Don't move the document when pressing arrow keys on focused handles\n function eventKeydown(event, handleNumber) {\n if (isSliderDisabled() || isHandleDisabled(handleNumber)) {\n return false;\n }\n var horizontalKeys = [\"Left\", \"Right\"];\n var verticalKeys = [\"Down\", \"Up\"];\n var largeStepKeys = [\"PageDown\", \"PageUp\"];\n var edgeKeys = [\"Home\", \"End\"];\n if (options.dir && !options.ort) {\n // On an right-to-left slider, the left and right keys act inverted\n horizontalKeys.reverse();\n }\n else if (options.ort && !options.dir) {\n // On a top-to-bottom slider, the up and down keys act inverted\n verticalKeys.reverse();\n largeStepKeys.reverse();\n }\n // Strip \"Arrow\" for IE compatibility. https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key\n var key = event.key.replace(\"Arrow\", \"\");\n var isLargeDown = key === largeStepKeys[0];\n var isLargeUp = key === largeStepKeys[1];\n var isDown = key === verticalKeys[0] || key === horizontalKeys[0] || isLargeDown;\n var isUp = key === verticalKeys[1] || key === horizontalKeys[1] || isLargeUp;\n var isMin = key === edgeKeys[0];\n var isMax = key === edgeKeys[1];\n if (!isDown && !isUp && !isMin && !isMax) {\n return true;\n }\n event.preventDefault();\n var to;\n if (isUp || isDown) {\n var direction = isDown ? 0 : 1;\n var steps = getNextStepsForHandle(handleNumber);\n var step = steps[direction];\n // At the edge of a slider, do nothing\n if (step === null) {\n return false;\n }\n // No step set, use the default of 10% of the sub-range\n if (step === false) {\n step = scope_Spectrum.getDefaultStep(scope_Locations[handleNumber], isDown, options.keyboardDefaultStep);\n }\n if (isLargeUp || isLargeDown) {\n step *= options.keyboardPageMultiplier;\n }\n else {\n step *= options.keyboardMultiplier;\n }\n // Step over zero-length ranges (#948);\n step = Math.max(step, 0.0000001);\n // Decrement for down steps\n step = (isDown ? -1 : 1) * step;\n to = scope_Values[handleNumber] + step;\n }\n else if (isMax) {\n // End key\n to = options.spectrum.xVal[options.spectrum.xVal.length - 1];\n }\n else {\n // Home key\n to = options.spectrum.xVal[0];\n }\n setHandle(handleNumber, scope_Spectrum.toStepping(to), true, true);\n fireEvent(\"slide\", handleNumber);\n fireEvent(\"update\", handleNumber);\n fireEvent(\"change\", handleNumber);\n fireEvent(\"set\", handleNumber);\n return false;\n }\n // Attach events to several slider parts.\n function bindSliderEvents(behaviour) {\n // Attach the standard drag event to the handles.\n if (!behaviour.fixed) {\n scope_Handles.forEach(function (handle, index) {\n // These events are only bound to the visual handle\n // element, not the 'real' origin element.\n attachEvent(actions.start, handle.children[0], eventStart, {\n handleNumbers: [index],\n });\n });\n }\n // Attach the tap event to the slider base.\n if (behaviour.tap) {\n attachEvent(actions.start, scope_Base, eventTap, {});\n }\n // Fire hover events\n if (behaviour.hover) {\n attachEvent(actions.move, scope_Base, eventHover, {\n hover: true,\n });\n }\n // Make the range draggable.\n if (behaviour.drag) {\n scope_Connects.forEach(function (connect, index) {\n if (connect === false || index === 0 || index === scope_Connects.length - 1) {\n return;\n }\n var handleBefore = scope_Handles[index - 1];\n var handleAfter = scope_Handles[index];\n var eventHolders = [connect];\n var handlesToDrag = [handleBefore, handleAfter];\n var handleNumbersToDrag = [index - 1, index];\n addClass(connect, options.cssClasses.draggable);\n // When the range is fixed, the entire range can\n // be dragged by the handles. The handle in the first\n // origin will propagate the start event upward,\n // but it needs to be bound manually on the other.\n if (behaviour.fixed) {\n eventHolders.push(handleBefore.children[0]);\n eventHolders.push(handleAfter.children[0]);\n }\n if (behaviour.dragAll) {\n handlesToDrag = scope_Handles;\n handleNumbersToDrag = scope_HandleNumbers;\n }\n eventHolders.forEach(function (eventHolder) {\n attachEvent(actions.start, eventHolder, eventStart, {\n handles: handlesToDrag,\n handleNumbers: handleNumbersToDrag,\n connect: connect,\n });\n });\n });\n }\n }\n // Attach an event to this slider, possibly including a namespace\n function bindEvent(namespacedEvent, callback) {\n scope_Events[namespacedEvent] = scope_Events[namespacedEvent] || [];\n scope_Events[namespacedEvent].push(callback);\n // If the event bound is 'update,' fire it immediately for all handles.\n if (namespacedEvent.split(\".\")[0] === \"update\") {\n scope_Handles.forEach(function (a, index) {\n fireEvent(\"update\", index);\n });\n }\n }\n function isInternalNamespace(namespace) {\n return namespace === INTERNAL_EVENT_NS.aria || namespace === INTERNAL_EVENT_NS.tooltips;\n }\n // Undo attachment of event\n function removeEvent(namespacedEvent) {\n var event = namespacedEvent && namespacedEvent.split(\".\")[0];\n var namespace = event ? namespacedEvent.substring(event.length) : namespacedEvent;\n Object.keys(scope_Events).forEach(function (bind) {\n var tEvent = bind.split(\".\")[0];\n var tNamespace = bind.substring(tEvent.length);\n if ((!event || event === tEvent) && (!namespace || namespace === tNamespace)) {\n // only delete protected internal event if intentional\n if (!isInternalNamespace(tNamespace) || namespace === tNamespace) {\n delete scope_Events[bind];\n }\n }\n });\n }\n // External event handling\n function fireEvent(eventName, handleNumber, tap) {\n Object.keys(scope_Events).forEach(function (targetEvent) {\n var eventType = targetEvent.split(\".\")[0];\n if (eventName === eventType) {\n scope_Events[targetEvent].forEach(function (callback) {\n callback.call(\n // Use the slider public API as the scope ('this')\n scope_Self, \n // Return values as array, so arg_1[arg_2] is always valid.\n scope_Values.map(options.format.to), \n // Handle index, 0 or 1\n handleNumber, \n // Un-formatted slider values\n scope_Values.slice(), \n // Event is fired by tap, true or false\n tap || false, \n // Left offset of the handle, in relation to the slider\n scope_Locations.slice(), \n // add the slider public API to an accessible parameter when this is unavailable\n scope_Self);\n });\n }\n });\n }\n // Split out the handle positioning logic so the Move event can use it, too\n function checkHandlePosition(reference, handleNumber, to, lookBackward, lookForward, getValue, smoothSteps) {\n var distance;\n // For sliders with multiple handles, limit movement to the other handle.\n // Apply the margin option by adding it to the handle positions.\n if (scope_Handles.length > 1 && !options.events.unconstrained) {\n if (lookBackward && handleNumber > 0) {\n distance = scope_Spectrum.getAbsoluteDistance(reference[handleNumber - 1], options.margin, false);\n to = Math.max(to, distance);\n }\n if (lookForward && handleNumber < scope_Handles.length - 1) {\n distance = scope_Spectrum.getAbsoluteDistance(reference[handleNumber + 1], options.margin, true);\n to = Math.min(to, distance);\n }\n }\n // The limit option has the opposite effect, limiting handles to a\n // maximum distance from another. Limit must be > 0, as otherwise\n // handles would be unmovable.\n if (scope_Handles.length > 1 && options.limit) {\n if (lookBackward && handleNumber > 0) {\n distance = scope_Spectrum.getAbsoluteDistance(reference[handleNumber - 1], options.limit, false);\n to = Math.min(to, distance);\n }\n if (lookForward && handleNumber < scope_Handles.length - 1) {\n distance = scope_Spectrum.getAbsoluteDistance(reference[handleNumber + 1], options.limit, true);\n to = Math.max(to, distance);\n }\n }\n // The padding option keeps the handles a certain distance from the\n // edges of the slider. Padding must be > 0.\n if (options.padding) {\n if (handleNumber === 0) {\n distance = scope_Spectrum.getAbsoluteDistance(0, options.padding[0], false);\n to = Math.max(to, distance);\n }\n if (handleNumber === scope_Handles.length - 1) {\n distance = scope_Spectrum.getAbsoluteDistance(100, options.padding[1], true);\n to = Math.min(to, distance);\n }\n }\n if (!smoothSteps) {\n to = scope_Spectrum.getStep(to);\n }\n // Limit percentage to the 0 - 100 range\n to = limit(to);\n // Return false if handle can't move\n if (to === reference[handleNumber] && !getValue) {\n return false;\n }\n return to;\n }\n // Uses slider orientation to create CSS rules. a = base value;\n function inRuleOrder(v, a) {\n var o = options.ort;\n return (o ? a : v) + \", \" + (o ? v : a);\n }\n // Moves handle(s) by a percentage\n // (bool, % to move, [% where handle started, ...], [index in scope_Handles, ...])\n function moveHandles(upward, proposal, locations, handleNumbers, connect) {\n var proposals = locations.slice();\n // Store first handle now, so we still have it in case handleNumbers is reversed\n var firstHandle = handleNumbers[0];\n var smoothSteps = options.events.smoothSteps;\n var b = [!upward, upward];\n var f = [upward, !upward];\n // Copy handleNumbers so we don't change the dataset\n handleNumbers = handleNumbers.slice();\n // Check to see which handle is 'leading'.\n // If that one can't move the second can't either.\n if (upward) {\n handleNumbers.reverse();\n }\n // Step 1: get the maximum percentage that any of the handles can move\n if (handleNumbers.length > 1) {\n handleNumbers.forEach(function (handleNumber, o) {\n var to = checkHandlePosition(proposals, handleNumber, proposals[handleNumber] + proposal, b[o], f[o], false, smoothSteps);\n // Stop if one of the handles can't move.\n if (to === false) {\n proposal = 0;\n }\n else {\n proposal = to - proposals[handleNumber];\n proposals[handleNumber] = to;\n }\n });\n }\n // If using one handle, check backward AND forward\n else {\n b = f = [true];\n }\n var state = false;\n // Step 2: Try to set the handles with the found percentage\n handleNumbers.forEach(function (handleNumber, o) {\n state =\n setHandle(handleNumber, locations[handleNumber] + proposal, b[o], f[o], false, smoothSteps) || state;\n });\n // Step 3: If a handle moved, fire events\n if (state) {\n handleNumbers.forEach(function (handleNumber) {\n fireEvent(\"update\", handleNumber);\n fireEvent(\"slide\", handleNumber);\n });\n // If target is a connect, then fire drag event\n if (connect != undefined) {\n fireEvent(\"drag\", firstHandle);\n }\n }\n }\n // Takes a base value and an offset. This offset is used for the connect bar size.\n // In the initial design for this feature, the origin element was 1% wide.\n // Unfortunately, a rounding bug in Chrome makes it impossible to implement this feature\n // in this manner: https://bugs.chromium.org/p/chromium/issues/detail?id=798223\n function transformDirection(a, b) {\n return options.dir ? 100 - a - b : a;\n }\n // Updates scope_Locations and scope_Values, updates visual state\n function updateHandlePosition(handleNumber, to) {\n // Update locations.\n scope_Locations[handleNumber] = to;\n // Convert the value to the slider stepping/range.\n scope_Values[handleNumber] = scope_Spectrum.fromStepping(to);\n var translation = transformDirection(to, 0) - scope_DirOffset;\n var translateRule = \"translate(\" + inRuleOrder(translation + \"%\", \"0\") + \")\";\n scope_Handles[handleNumber].style[options.transformRule] = translateRule;\n // sanity check for at least 2 handles (e.g. during setup)\n if (options.events.invertConnects && scope_Locations.length > 1) {\n // check if handles passed each other, but don't match the ConnectsInverted state\n var handlesAreInOrder = scope_Locations.every(function (position, index, locations) {\n return index === 0 || position >= locations[index - 1];\n });\n if (scope_ConnectsInverted !== !handlesAreInOrder) {\n // invert connects when handles pass each other\n invertConnects();\n // invertConnects already updates all connect elements\n return;\n }\n }\n updateConnect(handleNumber);\n updateConnect(handleNumber + 1);\n if (scope_ConnectsInverted) {\n // When connects are inverted, we also have to update adjacent connects\n updateConnect(handleNumber - 1);\n updateConnect(handleNumber + 2);\n }\n }\n // Handles before the slider middle are stacked later = higher,\n // Handles after the middle later is lower\n // [[7] [8] .......... | .......... [5] [4]\n function setZindex() {\n scope_HandleNumbers.forEach(function (handleNumber) {\n var dir = scope_Locations[handleNumber] > 50 ? -1 : 1;\n var zIndex = 3 + (scope_Handles.length + dir * handleNumber);\n scope_Handles[handleNumber].style.zIndex = String(zIndex);\n });\n }\n // Test suggested values and apply margin, step.\n // if exactInput is true, don't run checkHandlePosition, then the handle can be placed in between steps (#436)\n function setHandle(handleNumber, to, lookBackward, lookForward, exactInput, smoothSteps) {\n if (!exactInput) {\n to = checkHandlePosition(scope_Locations, handleNumber, to, lookBackward, lookForward, false, smoothSteps);\n }\n if (to === false) {\n return false;\n }\n updateHandlePosition(handleNumber, to);\n return true;\n }\n // Updates style attribute for connect nodes\n function updateConnect(index) {\n // Skip connects set to false\n if (!scope_Connects[index]) {\n return;\n }\n // Create a copy of locations, so we can sort them for the local scope logic\n var locations = scope_Locations.slice();\n if (scope_ConnectsInverted) {\n locations.sort(function (a, b) {\n return a - b;\n });\n }\n var l = 0;\n var h = 100;\n if (index !== 0) {\n l = locations[index - 1];\n }\n if (index !== scope_Connects.length - 1) {\n h = locations[index];\n }\n // We use two rules:\n // 'translate' to change the left/top offset;\n // 'scale' to change the width of the element;\n // As the element has a width of 100%, a translation of 100% is equal to 100% of the parent (.noUi-base)\n var connectWidth = h - l;\n var translateRule = \"translate(\" + inRuleOrder(transformDirection(l, connectWidth) + \"%\", \"0\") + \")\";\n var scaleRule = \"scale(\" + inRuleOrder(connectWidth / 100, \"1\") + \")\";\n scope_Connects[index].style[options.transformRule] =\n translateRule + \" \" + scaleRule;\n }\n // Parses value passed to .set method. Returns current value if not parse-able.\n function resolveToValue(to, handleNumber) {\n // Setting with null indicates an 'ignore'.\n // Inputting 'false' is invalid.\n if (to === null || to === false || to === undefined) {\n return scope_Locations[handleNumber];\n }\n // If a formatted number was passed, attempt to decode it.\n if (typeof to === \"number\") {\n to = String(to);\n }\n to = options.format.from(to);\n if (to !== false) {\n to = scope_Spectrum.toStepping(to);\n }\n // If parsing the number failed, use the current value.\n if (to === false || isNaN(to)) {\n return scope_Locations[handleNumber];\n }\n return to;\n }\n // Set the slider value.\n function valueSet(input, fireSetEvent, exactInput) {\n var values = asArray(input);\n var isInit = scope_Locations[0] === undefined;\n // Event fires by default\n fireSetEvent = fireSetEvent === undefined ? true : fireSetEvent;\n // Animation is optional.\n // Make sure the initial values were set before using animated placement.\n if (options.animate && !isInit) {\n addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n }\n // First pass, without lookAhead but with lookBackward. Values are set from left to right.\n scope_HandleNumbers.forEach(function (handleNumber) {\n setHandle(handleNumber, resolveToValue(values[handleNumber], handleNumber), true, false, exactInput);\n });\n var i = scope_HandleNumbers.length === 1 ? 0 : 1;\n // Spread handles evenly across the slider if the range has no size (min=max)\n if (isInit && scope_Spectrum.hasNoSize()) {\n exactInput = true;\n scope_Locations[0] = 0;\n if (scope_HandleNumbers.length > 1) {\n var space_1 = 100 / (scope_HandleNumbers.length - 1);\n scope_HandleNumbers.forEach(function (handleNumber) {\n scope_Locations[handleNumber] = handleNumber * space_1;\n });\n }\n }\n // Secondary passes. Now that all base values are set, apply constraints.\n // Iterate all handles to ensure constraints are applied for the entire slider (Issue #1009)\n for (; i < scope_HandleNumbers.length; ++i) {\n scope_HandleNumbers.forEach(function (handleNumber) {\n setHandle(handleNumber, scope_Locations[handleNumber], true, true, exactInput);\n });\n }\n setZindex();\n scope_HandleNumbers.forEach(function (handleNumber) {\n fireEvent(\"update\", handleNumber);\n // Fire the event only for handles that received a new value, as per #579\n if (values[handleNumber] !== null && fireSetEvent) {\n fireEvent(\"set\", handleNumber);\n }\n });\n }\n // Reset slider to initial values\n function valueReset(fireSetEvent) {\n valueSet(options.start, fireSetEvent);\n }\n // Set value for a single handle\n function valueSetHandle(handleNumber, value, fireSetEvent, exactInput) {\n // Ensure numeric input\n handleNumber = Number(handleNumber);\n if (!(handleNumber >= 0 && handleNumber < scope_HandleNumbers.length)) {\n throw new Error(\"noUiSlider: invalid handle number, got: \" + handleNumber);\n }\n // Look both backward and forward, since we don't want this handle to \"push\" other handles (#960);\n // The exactInput argument can be used to ignore slider stepping (#436)\n setHandle(handleNumber, resolveToValue(value, handleNumber), true, true, exactInput);\n fireEvent(\"update\", handleNumber);\n if (fireSetEvent) {\n fireEvent(\"set\", handleNumber);\n }\n }\n // Get the slider value.\n function valueGet(unencoded) {\n if (unencoded === void 0) { unencoded = false; }\n if (unencoded) {\n // return a copy of the raw values\n return scope_Values.length === 1 ? scope_Values[0] : scope_Values.slice(0);\n }\n var values = scope_Values.map(options.format.to);\n // If only one handle is used, return a single value.\n if (values.length === 1) {\n return values[0];\n }\n return values;\n }\n // Removes classes from the root and empties it.\n function destroy() {\n // remove protected internal listeners\n removeEvent(INTERNAL_EVENT_NS.aria);\n removeEvent(INTERNAL_EVENT_NS.tooltips);\n Object.keys(options.cssClasses).forEach(function (key) {\n removeClass(scope_Target, options.cssClasses[key]);\n });\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n delete scope_Target.noUiSlider;\n }\n function getNextStepsForHandle(handleNumber) {\n var location = scope_Locations[handleNumber];\n var nearbySteps = scope_Spectrum.getNearbySteps(location);\n var value = scope_Values[handleNumber];\n var increment = nearbySteps.thisStep.step;\n var decrement = null;\n // If snapped, directly use defined step value\n if (options.snap) {\n return [\n value - nearbySteps.stepBefore.startValue || null,\n nearbySteps.stepAfter.startValue - value || null,\n ];\n }\n // If the next value in this step moves into the next step,\n // the increment is the start of the next step - the current value\n if (increment !== false) {\n if (value + increment > nearbySteps.stepAfter.startValue) {\n increment = nearbySteps.stepAfter.startValue - value;\n }\n }\n // If the value is beyond the starting point\n if (value > nearbySteps.thisStep.startValue) {\n decrement = nearbySteps.thisStep.step;\n }\n else if (nearbySteps.stepBefore.step === false) {\n decrement = false;\n }\n // If a handle is at the start of a step, it always steps back into the previous step first\n else {\n decrement = value - nearbySteps.stepBefore.highestStep;\n }\n // Now, if at the slider edges, there is no in/decrement\n if (location === 100) {\n increment = null;\n }\n else if (location === 0) {\n decrement = null;\n }\n // As per #391, the comparison for the decrement step can have some rounding issues.\n var stepDecimals = scope_Spectrum.countStepDecimals();\n // Round per #391\n if (increment !== null && increment !== false) {\n increment = Number(increment.toFixed(stepDecimals));\n }\n if (decrement !== null && decrement !== false) {\n decrement = Number(decrement.toFixed(stepDecimals));\n }\n return [decrement, increment];\n }\n // Get the current step size for the slider.\n function getNextSteps() {\n return scope_HandleNumbers.map(getNextStepsForHandle);\n }\n // Updatable: margin, limit, padding, step, range, animate, snap\n function updateOptions(optionsToUpdate, fireSetEvent) {\n // Spectrum is created using the range, snap, direction and step options.\n // 'snap' and 'step' can be updated.\n // If 'snap' and 'step' are not passed, they should remain unchanged.\n var v = valueGet();\n var updateAble = [\n \"margin\",\n \"limit\",\n \"padding\",\n \"range\",\n \"animate\",\n \"snap\",\n \"step\",\n \"format\",\n \"pips\",\n \"tooltips\",\n \"connect\",\n ];\n // Only change options that we're actually passed to update.\n updateAble.forEach(function (name) {\n // Check for undefined. null removes the value.\n if (optionsToUpdate[name] !== undefined) {\n originalOptions[name] = optionsToUpdate[name];\n }\n });\n var newOptions = testOptions(originalOptions);\n // Load new options into the slider state\n updateAble.forEach(function (name) {\n if (optionsToUpdate[name] !== undefined) {\n options[name] = newOptions[name];\n }\n });\n scope_Spectrum = newOptions.spectrum;\n // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n options.margin = newOptions.margin;\n options.limit = newOptions.limit;\n options.padding = newOptions.padding;\n // Update pips, removes existing.\n if (options.pips) {\n pips(options.pips);\n }\n else {\n removePips();\n }\n // Update tooltips, removes existing.\n if (options.tooltips) {\n tooltips();\n }\n else {\n removeTooltips();\n }\n // Invalidate the current positioning so valueSet forces an update.\n scope_Locations = [];\n valueSet(isSet(optionsToUpdate.start) ? optionsToUpdate.start : v, fireSetEvent);\n // Update connects only if it was set\n if (optionsToUpdate.connect) {\n updateConnectOption();\n }\n }\n function updateConnectOption() {\n // IE supported way of removing children including event handlers\n while (scope_ConnectBase.firstChild) {\n scope_ConnectBase.removeChild(scope_ConnectBase.firstChild);\n }\n // Adding new connects according to the new connect options\n for (var i = 0; i <= options.handles; i++) {\n scope_Connects[i] = addConnect(scope_ConnectBase, options.connect[i]);\n updateConnect(i);\n }\n // re-adding drag events for the new connect elements\n // to ignore the other events we have to negate the 'if (!behaviour.fixed)' check\n bindSliderEvents({ drag: options.events.drag, fixed: true });\n }\n // Invert options for connect handles\n function invertConnects() {\n scope_ConnectsInverted = !scope_ConnectsInverted;\n testConnect(options, \n // inverse the connect boolean array\n options.connect.map(function (b) { return !b; }));\n updateConnectOption();\n }\n // Initialization steps\n function setupSlider() {\n // Create the base element, initialize HTML and set classes.\n // Add handles and connect elements.\n scope_Base = addSlider(scope_Target);\n addElements(options.connect, scope_Base);\n // Attach user events.\n bindSliderEvents(options.events);\n // Use the public value method to set the start values.\n valueSet(options.start);\n if (options.pips) {\n pips(options.pips);\n }\n if (options.tooltips) {\n tooltips();\n }\n aria();\n }\n setupSlider();\n var scope_Self = {\n destroy: destroy,\n steps: getNextSteps,\n on: bindEvent,\n off: removeEvent,\n get: valueGet,\n set: valueSet,\n setHandle: valueSetHandle,\n reset: valueReset,\n disable: disable,\n enable: enable,\n // Exposed for unit testing, don't use this in your application.\n __moveHandles: function (upward, proposal, handleNumbers) {\n moveHandles(upward, proposal, scope_Locations, handleNumbers);\n },\n options: originalOptions,\n updateOptions: updateOptions,\n target: scope_Target,\n removePips: removePips,\n removeTooltips: removeTooltips,\n getPositions: function () {\n return scope_Locations.slice();\n },\n getTooltips: function () {\n return scope_Tooltips;\n },\n getOrigins: function () {\n return scope_Handles;\n },\n pips: pips, // Issue #594\n };\n return scope_Self;\n}\n// Run the standard initializer\nfunction initialize(target, originalOptions) {\n if (!target || !target.nodeName) {\n throw new Error(\"noUiSlider: create requires a single element, got: \" + target);\n }\n // Throw an error if the slider was already initialized.\n if (target.noUiSlider) {\n throw new Error(\"noUiSlider: Slider was already initialized.\");\n }\n // Test the options and create the slider environment;\n var options = testOptions(originalOptions);\n var api = scope(target, options, originalOptions);\n target.noUiSlider = api;\n return api;\n}\nexport { initialize as create };\nexport { cssClasses };\nexport default {\n // Exposed for unit testing, don't use this in your application.\n __spectrum: Spectrum,\n // A reference to the default classes, allows global changes.\n // Use the cssClasses option for changes to one slider.\n cssClasses: cssClasses,\n create: initialize,\n};\n","/**\n * @license\n * Lodash' + func(text) + '
';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles
'\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %>');\n * compiled({ 'value': '