From f9e7e5e4bb1da38c247740f3ccd63defdb8aa514 Mon Sep 17 00:00:00 2001 From: Krzysztof Budnik Date: Mon, 12 Sep 2016 10:48:08 +0200 Subject: [PATCH] 1.0.18 --- dist/formula-parser.js | 188 ++++++++++++++++++++++++--------- dist/formula-parser.js.map | 2 +- dist/formula-parser.min.js | 8 +- dist/formula-parser.min.js.map | 2 +- package.json | 2 +- 5 files changed, 145 insertions(+), 57 deletions(-) diff --git a/dist/formula-parser.js b/dist/formula-parser.js index 7e6d9da4..578c7975 100644 --- a/dist/formula-parser.js +++ b/dist/formula-parser.js @@ -4563,7 +4563,7 @@ return /******/ (function(modules) { // webpackBootstrap var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(process) {/*! * numbro.js - * version : 1.8.0 + * version : 1.9.3 * author : Företagsplatsen AB * license : MIT * http://www.foretagsplatsen.se @@ -4577,7 +4577,7 @@ return /******/ (function(modules) { // webpackBootstrap ************************************/ var numbro, - VERSION = '1.8.0', + VERSION = '1.9.3', binarySuffixes = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'], decimalSuffixes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], bytes = { @@ -4747,7 +4747,7 @@ return /******/ (function(modules) { // webpackBootstrap // figure out what kind of format we are dealing with if (escapedFormat.indexOf('$') > -1) { // currency!!!!! - output = formatCurrency(n, format, roundingFunction); + output = formatCurrency(n, cultures[currentCulture].currency.symbol, format, roundingFunction); } else if (escapedFormat.indexOf('%') > -1) { // percentage output = formatPercentage(n, format, roundingFunction); } else if (escapedFormat.indexOf(':') > -1) { // time @@ -4824,7 +4824,7 @@ return /******/ (function(modules) { // webpackBootstrap return n._value; } - function formatCurrency(n, originalFormat, roundingFunction) { + function formatCurrency(n, currencySymbol, originalFormat, roundingFunction) { var format = originalFormat, symbolIndex = format.indexOf('$'), openParenIndex = format.indexOf('('), @@ -4838,7 +4838,7 @@ return /******/ (function(modules) { // webpackBootstrap if(format.indexOf('$') === -1){ // Use defaults instead of the format provided if (cultures[currentCulture].currency.position === 'infix') { - decimalSeparator = cultures[currentCulture].currency.symbol; + decimalSeparator = currencySymbol; if (cultures[currentCulture].currency.spaceSeparated) { decimalSeparator = ' ' + decimalSeparator + ' '; } @@ -4867,10 +4867,10 @@ return /******/ (function(modules) { // webpackBootstrap case 'postfix': if (output.indexOf(')') > -1) { output = output.split(''); - output.splice(-1, 0, space + cultures[currentCulture].currency.symbol); + output.splice(-1, 0, space + currencySymbol); output = output.join(''); } else { - output = output + space + cultures[currentCulture].currency.symbol; + output = output + space + currencySymbol; } break; case 'infix': @@ -4880,10 +4880,10 @@ return /******/ (function(modules) { // webpackBootstrap output = output.split(''); spliceIndex = Math.max(openParenIndex, minusSignIndex) + 1; - output.splice(spliceIndex, 0, cultures[currentCulture].currency.symbol + space); + output.splice(spliceIndex, 0, currencySymbol + space); output = output.join(''); } else { - output = cultures[currentCulture].currency.symbol + space + output; + output = currencySymbol + space + output; } break; default: @@ -4899,18 +4899,18 @@ return /******/ (function(modules) { // webpackBootstrap // the symbol appears before the "(", "+" or "-" spliceIndex = 0; } - output.splice(spliceIndex, 0, cultures[currentCulture].currency.symbol + space); + output.splice(spliceIndex, 0, currencySymbol + space); output = output.join(''); } else { - output = cultures[currentCulture].currency.symbol + space + output; + output = currencySymbol + space + output; } } else { if (output.indexOf(')') > -1) { output = output.split(''); - output.splice(-1, 0, space + cultures[currentCulture].currency.symbol); + output.splice(-1, 0, space + currencySymbol); output = output.join(''); } else { - output = output + space + cultures[currentCulture].currency.symbol; + output = output + space + currencySymbol; } } } @@ -4918,6 +4918,10 @@ return /******/ (function(modules) { // webpackBootstrap return output; } + function formatForeignCurrency(n, foreignCurrencySymbol, originalFormat, roundingFunction) { + return formatCurrency(n, foreignCurrencySymbol, originalFormat, roundingFunction); + } + function formatPercentage(n, format, roundingFunction) { var space = '', output, @@ -5482,6 +5486,9 @@ return /******/ (function(modules) { // webpackBootstrap //trim whitespaces from either sides val = val.trim(); + //replace the initial '+' or '-' sign if present + val = val.replace(/^[+-]?/, ''); + //if val is just digits return true if ( !! val.match(/^\d+$/)) { return true; @@ -5511,7 +5518,7 @@ return /******/ (function(modules) { // webpackBootstrap } // validating currency symbol - temp = val.match(/^[^\d]+/); + temp = val.match(/^[^\d\.\,]+/); if (temp !== null) { val = val.substr(1); if (temp[0] !== _currSymbol) { @@ -5539,7 +5546,12 @@ return /******/ (function(modules) { // webpackBootstrap if (_valArray.length < 2) { return ( !! _valArray[0].match(/^\d+.*\d$/) && !_valArray[0].match(_thousandRegEx)); } else { - if (_valArray[0].length === 1) { + if (_valArray[0] === '') { + // for values without leading zero eg. .984 + return (!_valArray[0].match(_thousandRegEx) && + !!_valArray[1].match(/^\d+$/)); + + } else if (_valArray[0].length === 1) { return ( !! _valArray[0].match(/^\d+$/) && !_valArray[0].match(_thousandRegEx) && !! _valArray[1].match(/^\d+$/)); @@ -5598,7 +5610,13 @@ return /******/ (function(modules) { // webpackBootstrap function inNodejsRuntime() { return (typeof process !== 'undefined') && (process.browser === undefined) && - (process.title.indexOf('node') === 0 || process.title === 'grunt' || process.title === 'gulp') && + process.title && + ( + process.title.indexOf('node') === 0 || + process.title.indexOf('meteor-tool') > 0 || + process.title === 'grunt' || + process.title === 'gulp' + ) && ("function" !== 'undefined'); } @@ -5704,6 +5722,15 @@ return /******/ (function(modules) { // webpackBootstrap formatCurrency: function(inputString, roundingFunction) { return formatCurrency(this, + cultures[currentCulture].currency.symbol, + inputString ? inputString : defaultCurrencyFormat, + (roundingFunction !== undefined) ? roundingFunction : Math.round + ); + }, + + formatForeignCurrency: function(currencySymbol, inputString, roundingFunction) { + return formatForeignCurrency(this, + currencySymbol, inputString ? inputString : defaultCurrencyFormat, (roundingFunction !== undefined) ? roundingFunction : Math.round ); @@ -5833,7 +5860,6 @@ return /******/ (function(modules) { // webpackBootstrap /***/ function(module, exports) { // shim for using process in browser - var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it @@ -5844,22 +5870,84 @@ return /******/ (function(modules) { // webpackBootstrap var cachedSetTimeout; var cachedClearTimeout; + function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); + } + function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); + } (function () { - try { - cachedSetTimeout = setTimeout; - } catch (e) { - cachedSetTimeout = function () { - throw new Error('setTimeout is not defined'); + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; } - } - try { - cachedClearTimeout = clearTimeout; - } catch (e) { - cachedClearTimeout = function () { - throw new Error('clearTimeout is not defined'); + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; } - } } ()) + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + + } + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + + } var queue = []; var draining = false; var currentQueue; @@ -5884,7 +5972,7 @@ return /******/ (function(modules) { // webpackBootstrap if (draining) { return; } - var timeout = cachedSetTimeout(cleanUpNextTick); + var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; @@ -5901,7 +5989,7 @@ return /******/ (function(modules) { // webpackBootstrap } currentQueue = null; draining = false; - cachedClearTimeout(timeout); + runClearTimeout(timeout); } process.nextTick = function (fun) { @@ -5913,7 +6001,7 @@ return /******/ (function(modules) { // webpackBootstrap } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { - cachedSetTimeout(drainQueue, 0); + runTimeout(drainQueue); } }; @@ -14650,9 +14738,9 @@ return /******/ (function(modules) { // webpackBootstrap $Vt = [5, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30, 31, 35]; var parser = { trace: function trace() {}, yy: {}, - symbols_: { "error": 2, "expressions": 3, "expression": 4, "EOF": 5, "variableSequence": 6, "number": 7, "STRING": 8, "&": 9, "=": 10, "+": 11, "(": 12, ")": 13, "<": 14, ">": 15, "NOT": 16, "-": 17, "*": 18, "/": 19, "^": 20, "FUNCTION": 21, "expseq": 22, "cell": 23, "ABSOLUTE_CELL": 24, ":": 25, "RELATIVE_CELL": 26, "MIXED_CELL": 27, "ARRAY": 28, ";": 29, ",": 30, "VARIABLE": 31, "DECIMAL": 32, "NUMBER": 33, "%": 34, "#": 35, "!": 36, "$accept": 0, "$end": 1 }, - terminals_: { 5: "EOF", 8: "STRING", 9: "&", 10: "=", 11: "+", 12: "(", 13: ")", 14: "<", 15: ">", 16: "NOT", 17: "-", 18: "*", 19: "/", 20: "^", 21: "FUNCTION", 24: "ABSOLUTE_CELL", 25: ":", 26: "RELATIVE_CELL", 27: "MIXED_CELL", 28: "ARRAY", 29: ";", 30: ",", 31: "VARIABLE", 32: "DECIMAL", 33: "NUMBER", 34: "%", 35: "#", 36: "!" }, - productions_: [0, [3, 2], [4, 1], [4, 1], [4, 1], [4, 3], [4, 3], [4, 3], [4, 3], [4, 4], [4, 4], [4, 4], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 2], [4, 2], [4, 3], [4, 4], [4, 1], [4, 1], [4, 2], [23, 1], [23, 3], [23, 1], [23, 3], [23, 1], [23, 3], [22, 1], [22, 1], [22, 3], [22, 3], [6, 1], [6, 3], [7, 1], [7, 3], [7, 2], [2, 3], [2, 4]], + symbols_: { "error": 2, "expressions": 3, "expression": 4, "EOF": 5, "variableSequence": 6, "number": 7, "STRING": 8, "&": 9, "=": 10, "+": 11, "(": 12, ")": 13, "<": 14, ">": 15, "NOT": 16, "-": 17, "*": 18, "/": 19, "^": 20, "FUNCTION": 21, "expseq": 22, "cell": 23, "ABSOLUTE_CELL": 24, "RELATIVE_CELL": 25, "MIXED_CELL": 26, ":": 27, "ARRAY": 28, ";": 29, ",": 30, "VARIABLE": 31, "DECIMAL": 32, "NUMBER": 33, "%": 34, "#": 35, "!": 36, "$accept": 0, "$end": 1 }, + terminals_: { 5: "EOF", 8: "STRING", 9: "&", 10: "=", 11: "+", 12: "(", 13: ")", 14: "<", 15: ">", 16: "NOT", 17: "-", 18: "*", 19: "/", 20: "^", 21: "FUNCTION", 24: "ABSOLUTE_CELL", 25: "RELATIVE_CELL", 26: "MIXED_CELL", 27: ":", 28: "ARRAY", 29: ";", 30: ",", 31: "VARIABLE", 32: "DECIMAL", 33: "NUMBER", 34: "%", 35: "#", 36: "!" }, + productions_: [0, [3, 2], [4, 1], [4, 1], [4, 1], [4, 3], [4, 3], [4, 3], [4, 3], [4, 4], [4, 4], [4, 4], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 2], [4, 2], [4, 3], [4, 4], [4, 1], [4, 1], [4, 2], [23, 1], [23, 1], [23, 1], [23, 3], [23, 3], [23, 3], [23, 3], [23, 3], [23, 3], [23, 3], [23, 3], [23, 3], [22, 1], [22, 1], [22, 3], [22, 3], [6, 1], [6, 3], [7, 1], [7, 3], [7, 2], [2, 3], [2, 4]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ @@ -14780,22 +14868,22 @@ return /******/ (function(modules) { // webpackBootstrap this.$ = yy.callFunction($$[$0 - 3], $$[$0 - 1]); break; - case 26:case 28:case 30: + case 26:case 27:case 28: this.$ = yy.cellValue($$[$0]); break; - case 27:case 29:case 31: + case 29:case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37: this.$ = yy.rangeValue($$[$0 - 2], $$[$0]); break; - case 32:case 36: + case 38:case 42: this.$ = [$$[$0]]; break; - case 33: + case 39: var result = []; var arr = eval("[" + yytext + "]"); @@ -14807,41 +14895,41 @@ return /******/ (function(modules) { // webpackBootstrap this.$ = result; break; - case 34:case 35: + case 40:case 41: $$[$0 - 2].push($$[$0]); this.$ = $$[$0 - 2]; break; - case 37: + case 43: this.$ = Array.isArray($$[$0 - 2]) ? $$[$0 - 2] : [$$[$0 - 2]]; this.$.push($$[$0]); break; - case 38: + case 44: this.$ = $$[$0]; break; - case 39: + case 45: this.$ = ($$[$0 - 2] + '.' + $$[$0]) * 1; break; - case 40: + case 46: this.$ = $$[$0 - 1] * 0.01; break; - case 41:case 42: + case 47:case 48: this.$ = yy.throwError($$[$0 - 2] + $$[$0 - 1] + $$[$0]); break; } }, - table: [{ 2: 11, 3: 1, 4: 2, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 1: [3] }, { 5: [1, 18], 9: $Vb, 10: $Vc, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }, o($Vl, [2, 2], { 32: [1, 29] }), o($Vl, [2, 3], { 34: [1, 30] }), o($Vl, [2, 4]), { 2: 11, 4: 31, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 32, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 33, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 12: [1, 34] }, o($Vl, [2, 23]), o($Vl, [2, 24], { 2: 35, 31: [1, 36], 35: $Va }), o($Vm, [2, 36], { 35: $Vn }), o($Vo, [2, 38], { 32: [1, 38] }), o($Vl, [2, 26], { 25: [1, 39] }), o($Vl, [2, 28], { 25: [1, 40] }), o($Vl, [2, 30], { 25: [1, 41] }), { 31: [1, 42] }, { 1: [2, 1] }, { 2: 11, 4: 43, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 44, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 45, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 48, 6: 3, 7: 4, 8: $V0, 10: [1, 46], 11: $V1, 12: $V2, 15: [1, 47], 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 50, 6: 3, 7: 4, 8: $V0, 10: [1, 49], 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 51, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 52, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 53, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 54, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 55, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 31: [1, 56] }, o($Vo, [2, 40]), { 9: $Vb, 10: $Vc, 11: $Vd, 13: [1, 57], 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }, o($Vp, [2, 19], { 9: $Vb, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vp, [2, 20], { 9: $Vb, 18: $Vi, 19: $Vj, 20: $Vk }), { 2: 11, 4: 60, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 13: [1, 58], 17: $V3, 21: $V4, 22: 59, 23: 10, 24: $V5, 26: $V6, 27: $V7, 28: [1, 61], 31: $V8, 33: $V9, 35: $Va }, o($Vl, [2, 25]), { 35: $Vn }, { 31: [1, 62] }, { 33: [1, 63] }, { 24: [1, 64] }, { 26: [1, 65] }, { 27: [1, 66] }, { 36: [1, 67] }, o($Vl, [2, 5]), o([5, 10, 13, 29, 30], [2, 6], { 9: $Vb, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vp, [2, 7], { 9: $Vb, 18: $Vi, 19: $Vj, 20: $Vk }), { 2: 11, 4: 68, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 69, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, o($Vq, [2, 14], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), { 2: 11, 4: 70, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, o($Vq, [2, 13], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o([5, 10, 13, 16, 29, 30], [2, 12], { 9: $Vb, 11: $Vd, 14: $Ve, 15: $Vf, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vp, [2, 15], { 9: $Vb, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vr, [2, 16], { 9: $Vb, 20: $Vk }), o($Vr, [2, 17], { 9: $Vb, 20: $Vk }), o([5, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30], [2, 18], { 9: $Vb }), o($Vm, [2, 37]), o($Vl, [2, 8]), o($Vl, [2, 21]), { 13: [1, 71], 29: [1, 72], 30: [1, 73] }, o($Vs, [2, 32], { 9: $Vb, 10: $Vc, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vs, [2, 33]), { 36: [1, 74] }, o($Vo, [2, 39]), o($Vl, [2, 27]), o($Vl, [2, 29]), o($Vl, [2, 31]), o($Vt, [2, 41]), o($Vq, [2, 9], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vq, [2, 11], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vq, [2, 10], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vl, [2, 22]), { 2: 11, 4: 75, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 76, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, o($Vt, [2, 42]), o($Vs, [2, 34], { 9: $Vb, 10: $Vc, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vs, [2, 35], { 9: $Vb, 10: $Vc, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk })], + table: [{ 2: 11, 3: 1, 4: 2, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 1: [3] }, { 5: [1, 18], 9: $Vb, 10: $Vc, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }, o($Vl, [2, 2], { 32: [1, 29] }), o($Vl, [2, 3], { 34: [1, 30] }), o($Vl, [2, 4]), { 2: 11, 4: 31, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 32, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 33, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 12: [1, 34] }, o($Vl, [2, 23]), o($Vl, [2, 24], { 2: 35, 31: [1, 36], 35: $Va }), o($Vm, [2, 42], { 35: $Vn }), o($Vo, [2, 44], { 32: [1, 38] }), o($Vl, [2, 26], { 27: [1, 39] }), o($Vl, [2, 27], { 27: [1, 40] }), o($Vl, [2, 28], { 27: [1, 41] }), { 31: [1, 42] }, { 1: [2, 1] }, { 2: 11, 4: 43, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 44, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 45, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 48, 6: 3, 7: 4, 8: $V0, 10: [1, 46], 11: $V1, 12: $V2, 15: [1, 47], 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 50, 6: 3, 7: 4, 8: $V0, 10: [1, 49], 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 51, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 52, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 53, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 54, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 55, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 31: [1, 56] }, o($Vo, [2, 46]), { 9: $Vb, 10: $Vc, 11: $Vd, 13: [1, 57], 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }, o($Vp, [2, 19], { 9: $Vb, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vp, [2, 20], { 9: $Vb, 18: $Vi, 19: $Vj, 20: $Vk }), { 2: 11, 4: 60, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 13: [1, 58], 17: $V3, 21: $V4, 22: 59, 23: 10, 24: $V5, 25: $V6, 26: $V7, 28: [1, 61], 31: $V8, 33: $V9, 35: $Va }, o($Vl, [2, 25]), { 35: $Vn }, { 31: [1, 62] }, { 33: [1, 63] }, { 24: [1, 64], 25: [1, 65], 26: [1, 66] }, { 24: [1, 67], 25: [1, 68], 26: [1, 69] }, { 24: [1, 70], 25: [1, 71], 26: [1, 72] }, { 36: [1, 73] }, o($Vl, [2, 5]), o([5, 10, 13, 29, 30], [2, 6], { 9: $Vb, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vp, [2, 7], { 9: $Vb, 18: $Vi, 19: $Vj, 20: $Vk }), { 2: 11, 4: 74, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 75, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, o($Vq, [2, 14], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), { 2: 11, 4: 76, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, o($Vq, [2, 13], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o([5, 10, 13, 16, 29, 30], [2, 12], { 9: $Vb, 11: $Vd, 14: $Ve, 15: $Vf, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vp, [2, 15], { 9: $Vb, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vr, [2, 16], { 9: $Vb, 20: $Vk }), o($Vr, [2, 17], { 9: $Vb, 20: $Vk }), o([5, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30], [2, 18], { 9: $Vb }), o($Vm, [2, 43]), o($Vl, [2, 8]), o($Vl, [2, 21]), { 13: [1, 77], 29: [1, 78], 30: [1, 79] }, o($Vs, [2, 38], { 9: $Vb, 10: $Vc, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vs, [2, 39]), { 36: [1, 80] }, o($Vo, [2, 45]), o($Vl, [2, 29]), o($Vl, [2, 30]), o($Vl, [2, 31]), o($Vl, [2, 32]), o($Vl, [2, 33]), o($Vl, [2, 34]), o($Vl, [2, 35]), o($Vl, [2, 36]), o($Vl, [2, 37]), o($Vt, [2, 47]), o($Vq, [2, 9], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vq, [2, 11], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vq, [2, 10], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vl, [2, 22]), { 2: 11, 4: 81, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 82, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, o($Vt, [2, 48]), o($Vs, [2, 40], { 9: $Vb, 10: $Vc, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vs, [2, 41], { 9: $Vb, 10: $Vc, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk })], defaultActions: { 18: [2, 1] }, parseError: function parseError(str, hash) { if (hash.recoverable) { @@ -15441,13 +15529,13 @@ return /******/ (function(modules) { // webpackBootstrap return 24; break; case 5: - return 27; + return 26; break; case 6: - return 27; + return 26; break; case 7: - return 26; + return 25; break; case 8: return 21; @@ -15477,7 +15565,7 @@ return /******/ (function(modules) { // webpackBootstrap return 32; break; case 17: - return 25; + return 27; break; case 18: return 29; diff --git a/dist/formula-parser.js.map b/dist/formula-parser.js.map index a53f64dd..d5d151b2 100644 --- a/dist/formula-parser.js.map +++ b/dist/formula-parser.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap eb54c3e9410a823a0e4e","webpack:///./index.js","webpack:///./src/parser.js","webpack:///./src/supported-formulas.js","webpack:///./~/tiny-emitter/index.js","webpack:///./src/evaluate-by-operator/evaluate-by-operator.js","webpack:///./src/evaluate-by-operator/operator/add.js","webpack:///./src/helper/number.js","webpack:///./src/error.js","webpack:///./src/evaluate-by-operator/operator/ampersand.js","webpack:///./src/evaluate-by-operator/operator/divide.js","webpack:///./src/evaluate-by-operator/operator/equal.js","webpack:///./src/evaluate-by-operator/operator/formula-function.js","webpack:///./~/formulajs/index.js","webpack:///./~/formulajs/lib/compatibility.js","webpack:///./~/formulajs/lib/math-trig.js","webpack:///./~/formulajs/lib/utils.js","webpack:///./~/formulajs/lib/error.js","webpack:///./~/formulajs/lib/statistical.js","webpack:///./~/formulajs/lib/text.js","webpack:///./~/formulajs/~/numbro/numbro.js","webpack:///./~/process/browser.js","webpack:///./~/formulajs/~/numbro/languages/index.js","webpack:///./~/formulajs/~/jStat/dist/jstat.js","webpack:///./~/formulajs/lib/miscellaneous.js","webpack:///./~/formulajs/lib/information.js","webpack:///./~/formulajs/lib/engineering.js","webpack:///./~/formulajs/~/bessel/bessel.js","webpack:///./~/formulajs/lib/date-time.js","webpack:///./~/formulajs/lib/database.js","webpack:///./~/formulajs/lib/logical.js","webpack:///./~/formulajs/lib/financial.js","webpack:///./~/formulajs/lib/lookup-reference.js","webpack:///./src/evaluate-by-operator/operator/greater-than.js","webpack:///./src/evaluate-by-operator/operator/greater-than-or-equal.js","webpack:///./src/evaluate-by-operator/operator/less-than.js","webpack:///./src/evaluate-by-operator/operator/less-than-or-equal.js","webpack:///./src/evaluate-by-operator/operator/minus.js","webpack:///./src/evaluate-by-operator/operator/multiply.js","webpack:///./src/evaluate-by-operator/operator/not-equal.js","webpack:///./src/evaluate-by-operator/operator/power.js","webpack:///./src/grammar-parser/grammar-parser.js","webpack:///(webpack)/buildin/module.js","webpack:///./src/helper/string.js","webpack:///./src/helper/cell.js"],"names":["SUPPORTED_FORMULAS","ERROR","ERROR_DIV_ZERO","ERROR_NAME","ERROR_NEED_UPDATE","ERROR_NOT_AVAILABLE","ERROR_NULL","ERROR_NUM","ERROR_REF","ERROR_VALUE","Parser","error","extractLabel","toLabel","columnIndexToLabel","columnLabelToIndex","rowIndexToLabel","rowLabelToIndex","default","parser","yy","toNumber","trimEdges","invertNumber","throwError","errorName","_throwError","callVariable","variable","_callVariable","evaluateByOperator","callFunction","cellValue","value","_callCellValue","rangeValue","start","end","_callRangeValue","variables","Object","create","setVariable","expression","result","parse","ex","message","Error","name","getVariable","emit","newValue","label","row","column","_value","startLabel","endLabel","startRow","startColumn","endRow","endColumn","startCell","endCell","index","parsedError","registerOperation","availableOperators","SYMBOL","operator","params","toUpperCase","symbol","func","Array","isArray","forEach","s","isFactory","first","rest","reduce","acc","isNaN","number","indexOf","parseFloat","parseInt","errors","type","replace","toString","Infinity","exp1","exp2","formulajs","symbolParts","split","foundFormula","length","nestedFormula","Math","pow","o","k","v","l","$V0","$V1","$V2","$V3","$V4","$V5","$V6","$V7","$V8","$V9","$Va","$Vb","$Vc","$Vd","$Ve","$Vf","$Vg","$Vh","$Vi","$Vj","$Vk","$Vl","$Vm","$Vn","$Vo","$Vp","$Vq","$Vr","$Vs","$Vt","trace","symbols_","terminals_","productions_","performAction","anonymous","yytext","yyleng","yylineno","yystate","$$","_$","$0","$","n1","arr","eval","item","push","table","defaultActions","parseError","str","hash","recoverable","_parseError","msg","prototype","input","self","stack","tstack","vstack","lstack","recovering","TERROR","EOF","args","slice","call","arguments","lexer","sharedState","hasOwnProperty","setInput","yylloc","yyloc","ranges","options","getPrototypeOf","popStack","n","_token_stack","lex","token","preErrorSymbol","state","action","a","r","yyval","p","len","newState","expected","_handle_error","locateNearestErrorRecoveryRule","stack_probe","depth","error_rule_depth","errStr","showPosition","join","text","match","line","loc","first_line","last_line","first_column","last_column","range","apply","concat","_input","_more","_backtrack","done","matched","conditionStack","offset","ch","lines","unput","substr","oldLines","more","reject","backtrack_lexer","less","pastInput","past","upcomingInput","next","pre","c","test_match","indexed_rule","backup","matches","tempMatch","rules","_currentRules","i","flex","begin","condition","popState","pop","conditions","topState","abs","pushState","stateStackSize","yy_","$avoiding_name_collisions","YY_START","YYSTATE","exports","module","main","process","argv","string","margin","substring","LABEL_EXTRACT_REGEXP","test","columnAbs","rowAbs","isAbsolute","rowLabel","columnLabel","COLUMN_LABEL_BASE","COLUMN_LABEL_BASE_LENGTH","j","String","fromCharCode","floor","max"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;;ACtCA;;AACA;;;;AAYA;;;;SAUEA,kB;SACAC,K;SACAC,c;SACAC,U;SACAC,iB;SACAC,mB;SACAC,U;SACAC,S;SACAC,S;SACAC,W;SACAC,M;SACAC,K;SACAC,Y;SACAC,O;SACAC,kB;SACAC,kB;SACAC,e;SACAC,e;;;;;;;;;;;;;;;;;;;;;;uDChCMC,O;;;;AARR;;;;AACA;;;;AACA;;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AV,CAAJ,EAA+B;AAC7BE,wBAAe,IAAf;AACAvD,kBAASoD,UAAUC,YAAY,CAAZ,CAAV,6BAAT;AACD;AACF,MALD,MAKO;AACL,WAAMG,SAASH,YAAYG,MAA3B;AACA,WAAInC,QAAQ,CAAZ;AACA,WAAIoC,gBAAgBL,SAApB;;AAEA,cAAO/B,QAAQmC,MAAf,EAAuB;AACrBC,yBAAgBA,cAAcJ,YAAYhC,KAAZ,CAAd,CAAhB;AACAA;;AAEA,aAAI,CAACoC,aAAL,EAAoB;AAClBA,2BAAgB,IAAhB;AACA;AACD;AACF;AACD,WAAIA,aAAJ,EAAmB;AACjBF,wBAAe,IAAf;AACAvD,kBAASyD,yCAAT;AACD;AACF;;AAED,SAAI,CAACF,YAAL,EAAmB;AACjB,aAAMnD,wBAAN;AACD;;AAED,YAAOJ,MAAP;AACD,IArCD;AAsCD;;AAED8B,MAAKK,SAAL,GAAiB,IAAjB;AACAL,MAAKL,MAAL,GAAcA,MAAd,C;;;;;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACpBA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACtFA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mBAAkB,IAAI,cAAc,IAAI,cAAc,IAAI;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAmC;AACnC;AACA;AACA,kDAAiD,iBAAiB;AAClE;AACA;AACA;AACA,QAAO;AACP;AACA;AACA,yCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,yBAAyB;AAC1C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,MAAK;AACL;;AAEA;;AAEA,MAAK;AACL;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,kBAAkB;AACnC,0DAAyD;AACzD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAiB,sBAAsB;AACvC;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA,2BAA0B;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,yBAAyB;AAC1C;AACA;AACA,kBAAiB,YAAY;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,sBAAqB,4BAA4B;AACjD;AACA,oBAAmB,YAAY;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,YAAY;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AClnCA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAiB,mBAAmB;AACpC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;AChQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,kBAAkB;AACnC,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA,oBAAmB,cAAc;AACjC;AACA;AACA;AACA;AACA;AACA,2BAA0B;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,cAAa,SAAS;AACtB,gBAAe,SAAS;AACxB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA,uCAAsC;AACtC;AACA;AACA,MAAK;AACL,mDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAiB,oBAAoB;AACrC;AACA;AACA,cAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA,oBAAmB,kBAAkB;AACrC;AACA,8DAA6D;AAC7D,QAAO;AACP,0EAAyE;AACzE;AACA;AACA;AACA;AACA,cAAa,oBAAoB;AACjC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,QAAQ;AACzB;AACA,oBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA,gBAAe,qBAAqB;AACpC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,cAAa,kBAAkB;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,mBAAmB;AACpC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,kBAAiB,YAAY;AAC7B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,yCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,cAAa,mBAAmB;AAChC;AACA;AACA,cAAa,mBAAmB;AAChC;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;ACxwDA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP,MAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;iEC9UA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,uBAAsB,uDAAuD;AAC7E,uBAAsB,qDAAqD;AAC3E,uBAAsB;AACtB,UAAS;AACT;AACA;AACA;AACA,sBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,oBAAmB,WAAW;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;;AAEA;AACA;AACA,cAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA4C,oBAAoB;AAChE;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,+CAA8C,IAAI,EAAE,IAAI;;AAExD;AACA,+CAA8C;AAC9C;AACA,UAAS,4CAA4C;AACrD;AACA,UAAS,4CAA4C;AACrD;AACA,UAAS,OAAO;AAChB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gCAA+B,mDAAmD;AAClF;AACA;AACA,sBAAqB;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA2B,yBAAyB;AACpD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAgB;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,8BAA6B;AAC7B,wCAAuC;AACvC;AACA,6DAA4D;AAC5D;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA,8BAA6B;AAC7B,0CAAyC;AACzC;AACA,6DAA4D;AAC5D;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAmB,4BAA4B;AAC/C;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAa;AACb;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kDAAiD,EAAE;AACnD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sDAAqD,EAAE;;AAEvD;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;AACA,sBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,4BAA2B,gBAAgB;AAC3C;AACA;AACA;AACA,sBAAqB;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;;AAEA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA,cAAa;AACb;;AAEA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;;AAET;AACA;AACA,UAAS;;AAET;AACA;AACA,UAAS;;AAET;AACA;AACA,UAAS;;AAET;AACA;AACA,UAAS;;AAET;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA,UAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;;AAEA,EAAC;;;;;;;;AC/uCD;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,4BAA2B;AAC3B;AACA;AACA;AACA,6BAA4B,UAAU;;;;;;;ACtHtC,uB;;;;;;ACAA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB,oBAAoB;AACzC;AACA;;AAEA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA,IAAG;AACH;AACA;;AAEA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,sBAAsB;AACvC;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA,0CAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,QAAO;AACP,MAAK;AACL;AACA;AACA;AACA,kBAAiB,gBAAgB;AACjC;AACA;AACA;;;AAGA;AACA;AACA;AACA,4CAA2C,cAAc;AACzD;;;AAGA;AACA;AACA;AACA;AACA,oBAAmB,YAAY;AAC/B;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,kBAAiB,WAAW;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAiB,UAAU;AAC3B;AACA,gBAAe,UAAU;AACzB;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,gBAAe,YAAY;AAC3B;AACA;AACA;AACA,kBAAiB,YAAY;AAC7B;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,gBAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA,kBAAiB,YAAY;AAC7B;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAiB,UAAU;AAC3B;AACA,gBAAe,UAAU;AACzB;AACA;;AAEA;AACA;;;AAGA,qBAAoB,UAAU;;;AAG9B;AACA;AACA;AACA;AACA;AACA;;;AAGA,oBAAmB,UAAU;;;AAG7B;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA,0BAAyB,wBAAwB;;;AAGjD;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,gBAAe,YAAY;AAC3B,kBAAiB,YAAY;AAC7B;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,SAAS;AAC5B;AACA;AACA,IAAG;AACH,oBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;;;AAGA;AACA,aAAY,KAAK,MAAM,MAAM,SAAS;AACtC,eAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB,SAAS;AAC9B;AACA;AACA,MAAK;AACL,sBAAqB,SAAS;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA,EAAC;;;AAGD;AACA,mBAAkB,KAAK,QAAQ,MAAM,SAAS;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,IAAG;AACH;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,IAAG;AACH;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA,IAAG;AACH,EAAC;;;AAGD;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,IAAG;AACH,EAAC;;;AAGD;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA,sEAAqE;AACrE,IAAG;AACH,EAAC;;;AAGD;AACA;;AAEA,EAAC;AACD;;AAEA;;AAEA;AACA,wBAAuB,cAAc;;AAErC;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA,gBAAe;AACf,iBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA,gDAA+C,cAAc,EAAE;AAC/D;;;AAGA;AACA;AACA,gDAA+C,cAAc,EAAE;AAC/D;;;AAGA;AACA;AACA;AACA;AACA;AACA,kBAAiB,YAAY;AAC7B;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,kBAAiB,YAAY;AAC7B;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,YAAY;AAC7B;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAiB,YAAY;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,+BAA8B,QAAQ;AACtC;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,+BAA8B,QAAQ;AACtC;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAiB,2BAA2B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,YAAY;AAC7B;AACA,kBAAiB,SAAS;AAC1B;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,aAAa;AAC9B;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,MAAK;AACL;AACA,IAAG;AACH;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,SAAS;AAC1B;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA,eAAc,oBAAoB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH,EAAC;;;AAGD;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,eAAc,oBAAoB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH,EAAC;AACD;AACA;;;AAGA;AACA;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;;AAEA,wEAAuE;AACvE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;;AAEA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc,oBAAoB;AAClC;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH,EAAC;;AAED,EAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ,OAAO;AACf;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH,oBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH,WAAU,YAAY;AACtB;AACA;AACA;AACA;;AAEA,SAAQ,YAAY;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,SAAQ,UAAU;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO,QAAQ;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,QAAO,OAAO;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ,OAAO;AACf;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO,QAAQ;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA0C,sBAAsB,EAAE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA0B,2BAA2B,EAAE;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;;AAGA;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA,4CAA2C,+BAA+B,EAAE;AAC5E;AACA,IAAG;AACH,EAAC;;;AAGD;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA,IAAG;AACH,EAAC;;AAED,EAAC;AACD;;AAEA;AACA;AACA,kBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA,sBAAqB,iBAAiB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA,QAAO;AACP,MAAK;AACL;AACA;AACA,sBAAqB,iBAAiB;AACtC;AACA;AACA;AACA,QAAO;AACP,MAAK;AACL,IAAG;AACH,EAAC;AACD;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;;AAGD;AACA;AACA;AACA,qBAAoB,UAAU;;AAE9B;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,EAAC;;;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA,+CAA8C;AAC9C;;AAEA,6BAA4B;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA,+CAA8C;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAC;;;AAGD;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,WAAU,QAAQ;AAClB;AACA;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;;AAEA;AACA;;AAEA;AACA,QAAO;AACP;;AAEA;AACA;;AAEA,MAAK;AACL;;AAEA;;AAEA,MAAK;AACL;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,qBAAoB,OAAO;AAC3B;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,YAAW,iBAAiB;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;;AAEA;AACA;;AAEA;AACA,QAAO;AACP;;AAEA;AACA;;AAEA,MAAK;AACL;;AAEA;;AAEA,MAAK;AACL;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,qBAAoB,OAAO;AAC3B;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,YAAW,iBAAiB;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,WAAU,QAAQ;AAClB;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,QAAO;AACP;AACA,QAAO;AACP;AACA,QAAO,OAAO;AACd;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,QAAO,OAAO;AACd;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;AAED,0BAAyB,wBAAwB;;AAEjD;AACA;AACA;AACA,IAAG;;AAEH;AACA,kBAAiB,UAAU;;AAE3B;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA,EAAC;;AAED,EAAC;AACD;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA,4CAA2C,oBAAoB,EAAE;AACjE,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA,4CAA2C,oBAAoB,EAAE;AACjE,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,4CAA2C,oBAAoB,EAAE;AACjE,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY,oBAAoB;AAChC,sBAAqB,YAAY;AACjC;AACA,wBAAuB,YAAY;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,4CAA2C,oBAAoB,EAAE;AACjE,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,6CAA4C,aAAa;AACzD,IAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,YAAY;AACtB;AACA;AACA,oBAAmB,YAAY;AAC/B;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,4CAA2C,6BAA6B,EAAE;AAC1E,IAAG;;AAEH;AACA;AACA,4CAA2C,wBAAwB,EAAE;AACrE,IAAG;;AAEH;AACA;AACA,4CAA2C,wBAAwB,EAAE;AACrE,IAAG;;AAEH;AACA;AACA,4CAA2C,wBAAwB,EAAE;AACrE,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,gBAAgB;AAC1B;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,oBAAmB,cAAc;AACjC;AACA;AACA,oBAAmB,mBAAmB;AACtC;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAU,UAAU;AACpB;AACA,qBAAoB,iBAAiB;AACrC;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,WAAW;AACrB;AACA;AACA,oBAAmB,UAAU;AAC7B,kBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,UAAU;AAC7B;AACA;AACA,WAAU,WAAW;AACrB;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAkB,OAAO;AACzB;AACA;AACA,sBAAqB,OAAO;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,mBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA,sBAAqB,OAAO;AAC5B;AACA,mBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA,wBAAuB,QAAQ;AAC/B;AACA,sBAAqB,WAAW;AAChC;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,oBAAmB,OAAO;AAC1B;AACA,yBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,QAAQ;AAChC;AACA,wBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA,sBAAqB,QAAQ;AAC7B;AACA,uBAAsB,QAAQ;AAC9B,0BAAyB,SAAS;AAClC;AACA;AACA;AACA;AACA,sBAAqB,OAAO;AAC5B;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6BAA4B,cAAc;AAC1C;AACA;;AAEA;AACA;AACA;AACA,QAAO;AACP;AACA,MAAK;;AAEL;AACA,gCAA+B,aAAa;AAC5C;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6BAA4B,cAAc;AAC1C;AACA;;AAEA;AACA;AACA;AACA,QAAO;AACP;AACA,MAAK;;AAEL;AACA,gCAA+B,aAAa;AAC5C;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,UAAS;AACT;AACA,QAAO;AACP;AACA;AACA;AACA,UAAS;AACT;AACA,QAAO;AACP,MAAK;AACL;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,UAAS;AACT;AACA,QAAO;AACP,MAAK;AACL;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,OAAO;AACjB;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,OAAO;AACjB;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,OAAO;AACjB;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,WAAW;AACrB;AACA,sBAAqB,OAAO;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB,OAAO;AAC5B;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iCAAgC,OAAO,WAAW,UAAU;AAC5D;AACA;AACA,qCAAoC,OAAO,WAAW,QAAQ,YAAY;AAC1E;AACA;AACA,QAAO;AACP,2CAA0C,6BAA6B;AACvE;AACA;AACA;;AAEA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB,SAAS,+BAA+B,SAAS;AACjE;AACA,iBAAgB,SAAS,+BAA+B,SAAS;AACjE;AACA;AACA,oCAAmC,SAAS;AAC5C,oDAAmD,SAAS;AAC5D,iCAAgC,SAAS;AACzC,oCAAmC,SAAS;AAC5C,oDAAmD,SAAS;AAC5D,iCAAgC,SAAS;AACzC,UAAS;AACT,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,+BAA8B,aAAa;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,+BAA8B,KAAK,WAAW;AAC9C,+BAA8B,KAAK,WAAW;AAC9C;AACA;AACA;AACA,kCAAiC,cAAc;AAC/C;AACA;;AAEA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB,OAAO;AAC5B,oBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB,OAAO;AAC5B,oBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,OAAO;AAC1B;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,QAAQ;AAChC;AACA,kBAAiB,WAAW;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,YAAY;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,aAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,WAAW;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,QAAQ;AAClB;AACA;AACA,WAAU,WAAW;AACrB;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,OAAO;AACjB;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,WAAU,OAAO;AACjB;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,WAAW;AACrB;AACA;AACA,oBAAmB,WAAW;AAC9B;AACA;AACA;AACA,oBAAmB,WAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,WAAW;AAC1B;AACA;AACA;AACA,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,OAAO;AAC1B;AACA;AACA,oBAAmB,OAAO;AAC1B;AACA,iBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,oBAAmB,OAAO;AAC1B;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,cAAc;AACjC,kBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,OAAO;AAC1B;AACA,kBAAiB,eAAe;AAChC;AACA;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH,EAAC;;AAED,EAAC;AACD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB,oBAAoB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA,kBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,EAAC;;AAED,EAAC;AACD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sDAAqD,uBAAuB;AAC5E,+DAA8D,cAAc;AAC5E;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAmD,aAAa;AAChE,+BAA8B,cAAc;AAC5C;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAU;AACV,EAAC;;;;;;;AC1jID;AACA;AACA;;AAEA;AACA;AACA,kBAAiB,sBAAsB;AACvC;AACA;;AAEA;AACA,oBAAmB,mBAAmB;AACtC;AACA,wBAAuB,OAAO;AAC9B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;;;;;;;AChEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kBAAiB,KAAK;AACtB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACpIA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAiB,KAAK;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA,oBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA,oBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAiB,IAAI;AACrB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAiB,KAAK;AACtB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAiB,IAAI;AACrB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sBAAqB,KAAK;AAC1B;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,sBAAqB,KAAK;AAC1B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sBAAqB,KAAK;AAC1B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gBAAe,KAAK;AACpB;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,gBAAe,KAAK;AACpB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gBAAe,KAAK;AACpB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;ACzhDA;AACA,2BAA0B,iCAAiC,kBAAkB,IAAI;AACjF;AACA;AACA;AACA;AACA;AACA,iBAAgB,QAAQ;AACxB;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,gBAAe,IAAI;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,IAAI;AACjB;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/MA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,IAAG;AACH;;AAEA,IAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA,kBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA,oBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,kBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACxiBA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,kBAAiB,wBAAwB;AACzC;AACA;AACA;AACA,cAAa,sBAAsB;AACnC;AACA;AACA;AACA;;AAEA,kBAAiB,qBAAqB;AACtC,oBAAmB,wBAAwB;AAC3C;AACA;AACA,sBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAuB,qBAAqB;AAC5C,+FAA8F;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA,IAAG;AACH;;AAEA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA,IAAG;AACH;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;;;;;;AClYA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAAyB,qBAAqB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;;;;;;;AC9GA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,sBAAqB,UAAU;AAC/B;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,sBAAqB,UAAU;AAC/B;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAiB,cAAc;AAC/B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAiB,aAAa;AAC9B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;AACH;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAiB,mBAAmB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAiB,iBAAiB;AAClC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB,mBAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB,mBAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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,YAAP,CAAoBtO,SAASmO,wBAAT,GAAoC,EAAxD,IAA8D9O,MAAvE;AACAW,cAAS+C,KAAKwL,KAAL,CAAWvO,SAASmO,wBAApB,IAAgD,CAAzD;AACD;;AAED,UAAO9O,OAAO4B,WAAP,EAAP;AACD;;AAED;;;;;;AAMO,UAASvD,eAAT,CAAyBoC,KAAzB,EAAgC;AACrC,OAAIT,SAAS4C,SAASnC,KAAT,EAAgB,EAAhB,CAAb;;AAEA,OAAI+B,MAAMxC,MAAN,CAAJ,EAAmB;AACjBA,cAAS,CAAC,CAAV;AACD,IAFD,MAEO;AACLA,cAAS0D,KAAKyL,GAAL,CAASnP,SAAS,CAAlB,EAAqB,CAAC,CAAtB,CAAT;AACD;;AAED,UAAOA,MAAP;AACD;;AAED;;;;;;AAMO,UAAS5B,eAAT,CAAyBsC,GAAzB,EAA8B;AACnC,OAAIV,SAAS,EAAb;;AAEA,OAAIU,OAAO,CAAX,EAAc;AACZV,oBAAYU,MAAM,CAAlB;AACD;;AAED,UAAOV,MAAP;AACD,E","file":"formula-parser.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"formulaParser\"] = factory();\n\telse\n\t\troot[\"formulaParser\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap eb54c3e9410a823a0e4e\n **/","import {Parser, SUPPORTED_FORMULAS} from './src/parser';\nimport {\n default as error,\n ERROR,\n ERROR_DIV_ZERO,\n ERROR_NAME,\n ERROR_NEED_UPDATE,\n ERROR_NOT_AVAILABLE,\n ERROR_NULL,\n ERROR_NUM,\n ERROR_REF,\n ERROR_VALUE\n} from './src/error';\nimport {\n extractLabel,\n toLabel,\n columnIndexToLabel,\n columnLabelToIndex,\n rowIndexToLabel,\n rowLabelToIndex\n} from './src/helper/cell';\n\nexport {\n SUPPORTED_FORMULAS,\n ERROR,\n ERROR_DIV_ZERO,\n ERROR_NAME,\n ERROR_NEED_UPDATE,\n ERROR_NOT_AVAILABLE,\n ERROR_NULL,\n ERROR_NUM,\n ERROR_REF,\n ERROR_VALUE,\n Parser,\n error,\n extractLabel,\n toLabel,\n columnIndexToLabel,\n columnLabelToIndex,\n rowIndexToLabel,\n rowLabelToIndex\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","import Emitter from 'tiny-emitter';\nimport evaluateByOperator from './evaluate-by-operator/evaluate-by-operator';\nimport {Parser as GrammarParser} from './grammar-parser/grammar-parser';\nimport {trimEdges} from './helper/string';\nimport {toNumber, invertNumber} from './helper/number';\nimport {default as errorParser, ERROR, ERROR_NAME} from './error';\nimport {extractLabel, toLabel} from './helper/cell';\n\nexport {default as SUPPORTED_FORMULAS} from './supported-formulas';\n\n/**\n * @class Parser\n */\nclass Parser extends Emitter {\n constructor() {\n super();\n this.parser = new GrammarParser();\n this.parser.yy = {\n toNumber,\n trimEdges,\n invertNumber,\n throwError: (errorName) => this._throwError(errorName),\n callVariable: (variable) => this._callVariable(variable),\n evaluateByOperator,\n callFunction: evaluateByOperator,\n cellValue: (value) => this._callCellValue(value),\n rangeValue: (start, end) => this._callRangeValue(start, end),\n };\n this.variables = Object.create(null);\n\n this\n .setVariable('TRUE', true)\n .setVariable('FALSE', false)\n .setVariable('NULL', null);\n }\n\n /**\n * Parse formula expression.\n *\n * @param {String} expression to parse.\n * @return {*} Returns an object with tow properties `error` and `result`.\n */\n parse(expression) {\n let result = null;\n let error = null;\n\n try {\n result = this.parser.parse(expression);\n } catch (ex) {\n const message = errorParser(ex.message);\n\n if (message) {\n error = message;\n } else {\n error = errorParser(ERROR);\n }\n }\n\n if (result instanceof Error) {\n error = errorParser(result.message) || errorParser(ERROR);\n result = null;\n }\n\n return {\n error: error,\n result: result\n };\n }\n\n /**\n * Set predefined variable name which can be visible while parsing formula expression.\n *\n * @param {String} name Variable name.\n * @param {*} value Variable value.\n * @returns {Parser}\n */\n setVariable(name, value) {\n this.variables[name] = value;\n\n return this;\n }\n\n /**\n * Get variable name.\n *\n * @param {String} name Variable name.\n * @returns {*}\n */\n getVariable(name) {\n return this.variables[name];\n }\n\n /**\n * Retrieve variable value by its name.\n *\n * @param name Variable name.\n * @returns {*}\n * @private\n */\n _callVariable(name) {\n let value = this.getVariable(name);\n\n this.emit('callVariable', name, (newValue) => {\n if (newValue !== void 0) {\n value = newValue;\n }\n });\n\n if (value === void 0) {\n throw Error(ERROR_NAME);\n }\n\n return value;\n }\n\n /**\n * Retrieve value by its label (`B3`, `B$3`, `B$3`, `$B$3`).\n *\n * @param {String} label Coordinates.\n * @returns {*}\n * @private\n */\n _callCellValue(label) {\n const [row, column] = extractLabel(label);\n let value = void 0;\n\n this.emit('callCellValue', {label, row, column}, (_value) => {\n value = _value;\n });\n\n return value;\n }\n\n /**\n * Retrieve value by its label (`B3:A1`, `B$3:A1`, `B$3:$A1`, `$B$3:A$1`).\n *\n * @param {String} startLabel Coordinates of the first cell.\n * @param {String} endLabel Coordinates of the last cell.\n * @returns {Array} Returns an array of mixed values.\n * @private\n */\n _callRangeValue(startLabel, endLabel) {\n const [startRow, startColumn] = extractLabel(startLabel);\n const [endRow, endColumn] = extractLabel(endLabel);\n let startCell = {};\n let endCell = {};\n\n if (startRow.index <= endRow.index) {\n startCell.row = startRow;\n endCell.row = endRow;\n } else {\n startCell.row = endRow;\n endCell.row = startRow;\n }\n\n if (startColumn.index <= endColumn.index) {\n startCell.column = startColumn;\n endCell.column = endColumn;\n } else {\n startCell.column = endColumn;\n endCell.column = startColumn;\n }\n\n startCell.label = toLabel(startCell.row, startCell.column);\n endCell.label = toLabel(endCell.row, endCell.column);\n\n let value = [];\n\n this.emit('callRangeValue', startCell, endCell, (_value = []) => {\n value = _value;\n });\n\n return value;\n }\n\n /**\n * Try to throw error by its name.\n *\n * @param {String} errorName Error name.\n * @returns {String}\n * @private\n */\n _throwError(errorName) {\n const parsedError = errorParser(errorName);\n\n if (parsedError) {\n throw Error(parsedError);\n }\n\n return errorName;\n }\n}\n\nexport {Parser};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/parser.js\n **/","const SUPPORTED_FORMULAS = [\n 'ABS',\n 'ACCRINT',\n 'ACOS',\n 'ACOSH',\n 'ACOT',\n 'ACOTH',\n 'ADD',\n 'AGGREGATE',\n 'AND',\n 'ARABIC',\n 'ARGS2ARRAY',\n 'ASIN',\n 'ASINH',\n 'ATAN',\n 'ATAN2',\n 'ATANH',\n 'AVEDEV',\n 'AVERAGE',\n 'AVERAGEA',\n 'AVERAGEIF',\n 'AVERAGEIFS',\n 'BASE',\n 'BESSELI',\n 'BESSELJ',\n 'BESSELK',\n 'BESSELY',\n 'BETA.DIST',\n 'BETA.INV',\n 'BETADIST',\n 'BETAINV',\n 'BIN2DEC',\n 'BIN2HEX',\n 'BIN2OCT',\n 'BINOM.DIST',\n 'BINOM.DIST.RANGE',\n 'BINOM.INV',\n 'BINOMDIST',\n 'BITAND',\n 'BITLSHIFT',\n 'BITOR',\n 'BITRSHIFT',\n 'BITXOR',\n 'CEILING',\n 'CEILINGMATH',\n 'CEILINGPRECISE',\n 'CHAR',\n 'CHISQ.DIST',\n 'CHISQ.DIST.RT',\n 'CHISQ.INV',\n 'CHISQ.INV.RT',\n 'CHOOSE',\n 'CHOOSE',\n 'CLEAN',\n 'CODE',\n 'COLUMN',\n 'COLUMNS',\n 'COMBIN',\n 'COMBINA',\n 'COMPLEX',\n 'CONCATENATE',\n 'CONFIDENCE',\n 'CONFIDENCE.NORM',\n 'CONFIDENCE.T',\n 'CONVERT',\n 'CORREL',\n 'COS',\n 'COSH',\n 'COT',\n 'COTH',\n 'COUNT',\n 'COUNTA',\n 'COUNTBLANK',\n 'COUNTIF',\n 'COUNTIFS',\n 'COUNTIN',\n 'COUNTUNIQUE',\n 'COVARIANCE.P',\n 'COVARIANCE.S',\n 'CSC',\n 'CSCH',\n 'CUMIPMT',\n 'CUMPRINC',\n 'DATE',\n 'DATEVALUE',\n 'DAY',\n 'DAYS',\n 'DAYS360',\n 'DB',\n 'DDB',\n 'DEC2BIN',\n 'DEC2HEX',\n 'DEC2OCT',\n 'DECIMAL',\n 'DEGREES',\n 'DELTA',\n 'DEVSQ',\n 'DIVIDE',\n 'DOLLAR',\n 'DOLLARDE',\n 'DOLLARFR',\n 'E',\n 'EDATE',\n 'EFFECT',\n 'EOMONTH',\n 'EQ',\n 'ERF',\n 'ERFC',\n 'EVEN',\n 'EXACT',\n 'EXPON.DIST',\n 'EXPONDIST',\n 'F.DIST',\n 'F.DIST.RT',\n 'F.INV',\n 'F.INV.RT',\n 'FACT',\n 'FACTDOUBLE',\n 'FALSE',\n 'FDIST',\n 'FDISTRT',\n 'FIND',\n 'FINV',\n 'FINVRT',\n 'FISHER',\n 'FISHERINV',\n 'FIXED',\n 'FLATTEN',\n 'FLOOR',\n 'FORECAST',\n 'FREQUENCY',\n 'FV',\n 'FVSCHEDULE',\n 'GAMMA',\n 'GAMMA.DIST',\n 'GAMMA.INV',\n 'GAMMADIST',\n 'GAMMAINV',\n 'GAMMALN',\n 'GAMMALN.PRECISE',\n 'GAUSS',\n 'GCD',\n 'GEOMEAN',\n 'GESTEP',\n 'GROWTH',\n 'GTE',\n 'HARMEAN',\n 'HEX2BIN',\n 'HEX2DEC',\n 'HEX2OCT',\n 'HOUR',\n 'HTML2TEXT',\n 'HYPGEOM.DIST',\n 'HYPGEOMDIST',\n 'IF',\n 'IMABS',\n 'IMAGINARY',\n 'IMARGUMENT',\n 'IMCONJUGATE',\n 'IMCOS',\n 'IMCOSH',\n 'IMCOT',\n 'IMCSC',\n 'IMCSCH',\n 'IMDIV',\n 'IMEXP',\n 'IMLN',\n 'IMLOG10',\n 'IMLOG2',\n 'IMPOWER',\n 'IMPRODUCT',\n 'IMREAL',\n 'IMSEC',\n 'IMSECH',\n 'IMSIN',\n 'IMSINH',\n 'IMSQRT',\n 'IMSUB',\n 'IMSUM',\n 'IMTAN',\n 'INT',\n 'INTERCEPT',\n 'INTERVAL',\n 'IPMT',\n 'IRR',\n 'ISBINARY',\n 'ISBLANK',\n 'ISEVEN',\n 'ISLOGICAL',\n 'ISNONTEXT',\n 'ISNUMBER',\n 'ISODD',\n 'ISODD',\n 'ISOWEEKNUM',\n 'ISPMT',\n 'ISTEXT',\n 'JOIN',\n 'KURT',\n 'LARGE',\n 'LCM',\n 'LEFT',\n 'LEN',\n 'LINEST',\n 'LN',\n 'LOG',\n 'LOG10',\n 'LOGEST',\n 'LOGNORM.DIST',\n 'LOGNORM.INV',\n 'LOGNORMDIST',\n 'LOGNORMINV',\n 'LOWER',\n 'LT',\n 'LTE',\n 'MATCH',\n 'MAX',\n 'MAXA',\n 'MEDIAN',\n 'MID',\n 'MIN',\n 'MINA',\n 'MINUS',\n 'MINUTE',\n 'MIRR',\n 'MOD',\n 'MODE.MULT',\n 'MODE.SNGL',\n 'MODEMULT',\n 'MODESNGL',\n 'MONTH',\n 'MROUND',\n 'MULTINOMIAL',\n 'MULTIPLY',\n 'NE',\n 'NEGBINOM.DIST',\n 'NEGBINOMDIST',\n 'NETWORKDAYS',\n 'NOMINAL',\n 'NORM.DIST',\n 'NORM.INV',\n 'NORM.S.DIST',\n 'NORM.S.INV',\n 'NORMDIST',\n 'NORMINV',\n 'NORMSDIST',\n 'NORMSINV',\n 'NOT',\n 'NOW',\n 'NPER',\n 'NPV',\n 'NUMBERS',\n 'NUMERAL',\n 'OCT2BIN',\n 'OCT2DEC',\n 'OCT2HEX',\n 'ODD',\n 'OR',\n 'PDURATION',\n 'PEARSON',\n 'PERCENTILEEXC',\n 'PERCENTILEINC',\n 'PERCENTRANKEXC',\n 'PERCENTRANKINC',\n 'PERMUT',\n 'PERMUTATIONA',\n 'PHI',\n 'PI',\n 'PMT',\n 'POISSON.DIST',\n 'POISSONDIST',\n 'POW',\n 'POWER',\n 'PPMT',\n 'PROB',\n 'PRODUCT',\n 'PROPER',\n 'PV',\n 'QUARTILE.EXC',\n 'QUARTILE.INC',\n 'QUARTILEEXC',\n 'QUARTILEINC',\n 'QUOTIENT',\n 'RADIANS',\n 'RAND',\n 'RANDBETWEEN',\n 'RANK.AVG',\n 'RANK.EQ',\n 'RANKAVG',\n 'RANKEQ',\n 'RATE',\n 'REFERENCE',\n 'REGEXEXTRACT',\n 'REGEXMATCH',\n 'REGEXREPLACE',\n 'REPLACE',\n 'REPT',\n 'RIGHT',\n 'ROMAN',\n 'ROUND',\n 'ROUNDDOWN',\n 'ROUNDUP',\n 'ROW',\n 'ROWS',\n 'RRI',\n 'RSQ',\n 'SEARCH',\n 'SEC',\n 'SECH',\n 'SECOND',\n 'SERIESSUM',\n 'SIGN',\n 'SIN',\n 'SINH',\n 'SKEW',\n 'SKEW.P',\n 'SKEWP',\n 'SLN',\n 'SLOPE',\n 'SMALL',\n 'SPLIT',\n 'SPLIT',\n 'SQRT',\n 'SQRTPI',\n 'STANDARDIZE',\n 'STDEV.P',\n 'STDEV.S',\n 'STDEVA',\n 'STDEVP',\n 'STDEVPA',\n 'STDEVS',\n 'STEYX',\n 'SUBSTITUTE',\n 'SUBTOTAL',\n 'SUM',\n 'SUMIF',\n 'SUMIFS',\n 'SUMPRODUCT',\n 'SUMSQ',\n 'SUMX2MY2',\n 'SUMX2PY2',\n 'SUMXMY2',\n 'SWITCH',\n 'SYD',\n 'T',\n 'T.DIST',\n 'T.DIST.2T',\n 'T.DIST.RT',\n 'T.INV',\n 'T.INV.2T',\n 'TAN',\n 'TANH',\n 'TBILLEQ',\n 'TBILLPRICE',\n 'TBILLYIELD',\n 'TDIST',\n 'TDIST2T',\n 'TDISTRT',\n 'TEXT',\n 'TIME',\n 'TIMEVALUE',\n 'TINV',\n 'TINV2T',\n 'TODAY',\n 'TRANSPOSE',\n 'TREND',\n 'TRIM',\n 'TRIMMEAN',\n 'TRUE',\n 'TRUNC',\n 'UNICHAR',\n 'UNICODE',\n 'UNIQUE',\n 'UPPER',\n 'VALUE',\n 'VAR.P',\n 'VAR.S',\n 'VARA',\n 'VARP',\n 'VARPA',\n 'VARS',\n 'WEEKDAY',\n 'WEEKNUM',\n 'WEIBULL.DIST',\n 'WEIBULLDIST',\n 'WORKDAY',\n 'XIRR',\n 'XNPV',\n 'XOR',\n 'YEAR',\n 'YEARFRAC',\n];\n\nexport {SUPPORTED_FORMULAS as default};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/supported-formulas.js\n **/","function E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n };\n\n listener._ = callback\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nmodule.exports = E;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/tiny-emitter/index.js\n ** module id = 3\n ** module chunks = 0\n **/","import {default as add} from './operator/add';\nimport {default as ampersand} from './operator/ampersand';\nimport {default as divide} from './operator/divide';\nimport {default as equal} from './operator/equal';\nimport {default as formulaFunction} from './operator/formula-function';\nimport {default as greaterThan} from './operator/greater-than';\nimport {default as greaterThanOrEqual} from './operator/greater-than-or-equal';\nimport {default as lessThan} from './operator/less-than';\nimport {default as lessThanOrEqual} from './operator/less-than-or-equal';\nimport {default as minus} from './operator/minus';\nimport {default as multiply} from './operator/multiply';\nimport {default as notEqual} from './operator/not-equal';\nimport {default as power} from './operator/power';\nimport {ERROR_NAME} from './../error';\n\nconst availableOperators = Object.create(null);\n\nregisterOperation(add.SYMBOL, add);\nregisterOperation(ampersand.SYMBOL, ampersand);\nregisterOperation(divide.SYMBOL, divide);\nregisterOperation(equal.SYMBOL, equal);\nregisterOperation(power.SYMBOL, power);\nregisterOperation(formulaFunction.SYMBOL, formulaFunction);\nregisterOperation(greaterThan.SYMBOL, greaterThan);\nregisterOperation(greaterThanOrEqual.SYMBOL, greaterThanOrEqual);\nregisterOperation(lessThan.SYMBOL, lessThan);\nregisterOperation(lessThanOrEqual.SYMBOL, lessThanOrEqual);\nregisterOperation(multiply.SYMBOL, multiply);\nregisterOperation(notEqual.SYMBOL, notEqual);\nregisterOperation(minus.SYMBOL, minus);\n\n/**\n * Evaluate values by operator id.git\n *\n * @param {String} operator Operator id.\n * @param {Array} [params=[]] Arguments to evaluate.\n * @returns {*}\n */\nexport default function evaluateByOperator(operator, params = []) {\n operator = operator.toUpperCase();\n\n if (!availableOperators[operator]) {\n throw Error(ERROR_NAME);\n }\n\n return availableOperators[operator](...params);\n}\n\n/**\n * Register operator.\n *\n * @param {String|Array} symbol Symbol to register.\n * @param {Function} func Logic to register for this symbol.\n */\nexport function registerOperation(symbol, func) {\n if (!Array.isArray(symbol)) {\n symbol = [symbol.toUpperCase()];\n }\n symbol.forEach((s) => {\n if (func.isFactory) {\n availableOperators[s] = func(s);\n } else {\n availableOperators[s] = func;\n }\n });\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/evaluate-by-operator.js\n **/","import {toNumber} from './../../helper/number';\nimport {ERROR_VALUE} from './../../error';\n\nexport const SYMBOL = '+';\n\nexport default function func(first, ...rest) {\n const result = rest.reduce((acc, value) => acc + toNumber(value), toNumber(first));\n\n if (isNaN(result)) {\n throw Error(ERROR_VALUE);\n }\n\n return result;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/add.js\n **/","/**\n * Convert value into number.\n *\n * @param {String|Number} number\n * @returns {*}\n */\nexport function toNumber(number) {\n let result;\n\n if (typeof number === 'number') {\n result = number;\n\n } else if (typeof number === 'string') {\n result = number.indexOf('.') > -1 ? parseFloat(number) : parseInt(number, 10);\n }\n\n return result;\n}\n\n/**\n * Invert provided number.\n *\n * @param {Number} number\n * @returns {Number} Returns inverted number.\n */\nexport function invertNumber(number) {\n return -1 * toNumber(number);\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/helper/number.js\n **/","export const ERROR = 'ERROR';\nexport const ERROR_DIV_ZERO = 'DIV/0';\nexport const ERROR_NAME = 'NAME';\nexport const ERROR_NEED_UPDATE = 'NEED_UPDATE';\nexport const ERROR_NOT_AVAILABLE = 'N/A';\nexport const ERROR_NULL = 'NULL';\nexport const ERROR_NUM = 'NUM';\nexport const ERROR_REF = 'REF';\nexport const ERROR_VALUE = 'VALUE';\n\nconst errors = {\n [ERROR]: '#ERROR!',\n [ERROR_DIV_ZERO]: '#DIV/0!',\n [ERROR_NAME]: '#NAME?',\n [ERROR_NEED_UPDATE]: '#NEED_UPDATE!',\n [ERROR_NOT_AVAILABLE]: '#N/A',\n [ERROR_NULL]: '#NULL!',\n [ERROR_NUM]: '#NUM!',\n [ERROR_REF]: '#REF!',\n [ERROR_VALUE]: '#VALUE!',\n};\n\n/**\n * Return error type based on provided error id.\n *\n * @param {String} type Error type.\n * @returns {String|null} Returns error id.\n */\nexport default function error(type) {\n let error;\n\n type = (type + '').replace(/#|!|\\?/g, '');\n\n if (errors[type]) {\n error = errors[type];\n }\n\n return error ? error : null;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/error.js\n **/","export const SYMBOL = '&';\n\nexport default function func(...params) {\n return params.reduce((acc, value) => acc + value.toString(), '');\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/ampersand.js\n **/","import {toNumber} from './../../helper/number';\nimport {ERROR_DIV_ZERO, ERROR_VALUE} from './../../error';\n\nexport const SYMBOL = '/';\n\nexport default function func(first, ...rest) {\n const result = rest.reduce((acc, value) => acc / toNumber(value), toNumber(first));\n\n if (result === Infinity) {\n throw Error(ERROR_DIV_ZERO);\n }\n if (isNaN(result)) {\n throw Error(ERROR_VALUE);\n }\n\n return result;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/divide.js\n **/","export const SYMBOL = '=';\n\nexport default function func(exp1, exp2) {\n return exp1 === exp2;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/equal.js\n **/","import SUPPORTED_FORMULAS from './../../supported-formulas';\nimport {ERROR_NAME} from './../../error';\nimport * as formulajs from 'formulajs';\n\nexport const SYMBOL = SUPPORTED_FORMULAS;\n\nexport default function func(symbol) {\n return function(...params) {\n symbol = symbol.toUpperCase();\n\n const symbolParts = symbol.split('.');\n let foundFormula = false;\n let result;\n\n if (symbolParts.length === 1) {\n if (formulajs[symbolParts[0]]) {\n foundFormula = true;\n result = formulajs[symbolParts[0]](...params);\n }\n } else {\n const length = symbolParts.length;\n let index = 0;\n let nestedFormula = formulajs;\n\n while (index < length) {\n nestedFormula = nestedFormula[symbolParts[index]];\n index++;\n\n if (!nestedFormula) {\n nestedFormula = null;\n break;\n }\n }\n if (nestedFormula) {\n foundFormula = true;\n result = nestedFormula(...params);\n }\n }\n\n if (!foundFormula) {\n throw Error(ERROR_NAME);\n }\n\n return result;\n };\n};\n\nfunc.isFactory = true;\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/formula-function.js\n **/","var categories = [\n require('./lib/compatibility'),\n require('./lib/database'),\n require('./lib/engineering'),\n require('./lib/logical'),\n require('./lib/math-trig'),\n require('./lib/text'),\n require('./lib/date-time'),\n require('./lib/financial'),\n require('./lib/information'),\n require('./lib/lookup-reference'),\n require('./lib/statistical'),\n require('./lib/miscellaneous')\n];\n\nfor (var c in categories) {\n var category = categories[c];\n for (var f in category) {\n exports[f] = exports[f] || category[f];\n }\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/index.js\n ** module id = 12\n ** module chunks = 0\n **/","var mathTrig = require('./math-trig');\nvar statistical = require('./statistical');\nvar engineering = require('./engineering');\nvar dateTime = require('./date-time');\n\nfunction set(fn, root) {\n if (root) {\n for (var i in root) {\n fn[i] = root[i];\n }\n }\n\n return fn;\n}\n\nexports.BETADIST = statistical.BETA.DIST;\nexports.BETAINV = statistical.BETA.INV;\nexports.BINOMDIST = statistical.BINOM.DIST;\nexports.CEILING = exports.ISOCEILING = set(mathTrig.CEILING.MATH, mathTrig.CEILING);\nexports.CEILINGMATH = mathTrig.CEILING.MATH;\nexports.CEILINGPRECISE = mathTrig.CEILING.PRECISE;\nexports.CHIDIST = statistical.CHISQ.DIST;\nexports.CHIDISTRT = statistical.CHISQ.DIST.RT;\nexports.CHIINV = statistical.CHISQ.INV;\nexports.CHIINVRT = statistical.CHISQ.INV.RT;\nexports.CHITEST = statistical.CHISQ.TEST;\nexports.CONFIDENCE = set(statistical.CONFIDENCE.NORM, statistical.CONFIDENCE);\nexports.COVAR = statistical.COVARIANCE.P;\nexports.COVARIANCEP = statistical.COVARIANCE.P;\nexports.COVARIANCES = statistical.COVARIANCE.S;\nexports.CRITBINOM = statistical.BINOM.INV;\nexports.EXPONDIST = statistical.EXPON.DIST;\nexports.ERFCPRECISE = engineering.ERFC.PRECISE;\nexports.ERFPRECISE = engineering.ERF.PRECISE;\nexports.FDIST = statistical.F.DIST;\nexports.FDISTRT = statistical.F.DIST.RT;\nexports.FINVRT = statistical.F.INV.RT;\nexports.FINV = statistical.F.INV;\nexports.FLOOR = set(mathTrig.FLOOR.MATH, mathTrig.FLOOR);\nexports.FLOORMATH = mathTrig.FLOOR.MATH;\nexports.FLOORPRECISE = mathTrig.FLOOR.PRECISE;\nexports.FTEST = statistical.F.TEST;\nexports.GAMMADIST = statistical.GAMMA.DIST;\nexports.GAMMAINV = statistical.GAMMA.INV;\nexports.GAMMALNPRECISE = statistical.GAMMALN.PRECISE;\nexports.HYPGEOMDIST = statistical.HYPGEOM.DIST;\nexports.LOGINV = statistical.LOGNORM.INV;\nexports.LOGNORMINV = statistical.LOGNORM.INV;\nexports.LOGNORMDIST = statistical.LOGNORM.DIST;\nexports.MODE = set(statistical.MODE.SNGL, statistical.MODE);\nexports.MODEMULT = statistical.MODE.MULT;\nexports.MODESNGL = statistical.MODE.SNGL;\nexports.NEGBINOMDIST = statistical.NEGBINOM.DIST;\nexports.NETWORKDAYSINTL = dateTime.NETWORKDAYS.INTL;\nexports.NORMDIST = statistical.NORM.DIST;\nexports.NORMINV = statistical.NORM.INV;\nexports.NORMSDIST = statistical.NORM.S.DIST;\nexports.NORMSINV = statistical.NORM.S.INV;\nexports.PERCENTILE = set(statistical.PERCENTILE.EXC, statistical.PERCENTILE);\nexports.PERCENTILEEXC = statistical.PERCENTILE.EXC;\nexports.PERCENTILEINC = statistical.PERCENTILE.INC;\nexports.PERCENTRANK = set(statistical.PERCENTRANK.INC, statistical.PERCENTRANK);\nexports.PERCENTRANKEXC = statistical.PERCENTRANK.EXC;\nexports.PERCENTRANKINC = statistical.PERCENTRANK.INC;\nexports.POISSON = set(statistical.POISSON.DIST, statistical.POISSON);\nexports.POISSONDIST = statistical.POISSON.DIST;\nexports.QUARTILE = set(statistical.QUARTILE.INC, statistical.QUARTILE);\nexports.QUARTILEEXC = statistical.QUARTILE.EXC;\nexports.QUARTILEINC = statistical.QUARTILE.INC;\nexports.RANK = set(statistical.RANK.EQ, statistical.RANK);\nexports.RANKAVG = statistical.RANK.AVG;\nexports.RANKEQ = statistical.RANK.EQ;\nexports.SKEWP = statistical.SKEW.P;\nexports.STDEV = set(statistical.STDEV.S, statistical.STDEV);\nexports.STDEVP = statistical.STDEV.P;\nexports.STDEVS = statistical.STDEV.S;\nexports.TDIST = statistical.T.DIST;\nexports.TDISTRT = statistical.T.DIST.RT;\nexports.TINV = statistical.T.INV;\nexports.TTEST = statistical.T.TEST;\nexports.VAR = set(statistical.VAR.S, statistical.VAR);\nexports.VARP = statistical.VAR.P;\nexports.VARS = statistical.VAR.S;\nexports.WEIBULL = set(statistical.WEIBULL.DIST, statistical.WEIBULL);\nexports.WEIBULLDIST = statistical.WEIBULL.DIST;\nexports.WORKDAYINTL = dateTime.WORKDAY.INTL;\nexports.ZTEST = statistical.Z.TEST;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/compatibility.js\n ** module id = 13\n ** module chunks = 0\n **/","var utils = require('./utils');\nvar error = require('./error');\nvar statistical = require('./statistical');\nvar information = require('./information');\n\nexports.ABS = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var result = Math.abs(number);\n\n return result;\n};\n\nexports.ACOS = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var result = Math.acos(number);\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.ACOSH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var result = Math.log(number + Math.sqrt(number * number - 1));\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.ACOT = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var result = Math.atan(1 / number);\n\n return result;\n};\n\nexports.ACOTH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var result = 0.5 * Math.log((number + 1) / (number - 1));\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\n//TODO: use options\nexports.AGGREGATE = function(function_num, options, ref1, ref2) {\n function_num = utils.parseNumber(function_num);\n options = utils.parseNumber(function_num);\n if (utils.anyIsError(function_num, options)) {\n return error.value;\n }\n switch (function_num) {\n case 1:\n return statistical.AVERAGE(ref1);\n case 2:\n return statistical.COUNT(ref1);\n case 3:\n return statistical.COUNTA(ref1);\n case 4:\n return statistical.MAX(ref1);\n case 5:\n return statistical.MIN(ref1);\n case 6:\n return exports.PRODUCT(ref1);\n case 7:\n return statistical.STDEV.S(ref1);\n case 8:\n return statistical.STDEV.P(ref1);\n case 9:\n return exports.SUM(ref1);\n case 10:\n return statistical.VAR.S(ref1);\n case 11:\n return statistical.VAR.P(ref1);\n case 12:\n return statistical.MEDIAN(ref1);\n case 13:\n return statistical.MODE.SNGL(ref1);\n case 14:\n return statistical.LARGE(ref1, ref2);\n case 15:\n return statistical.SMALL(ref1, ref2);\n case 16:\n return statistical.PERCENTILE.INC(ref1, ref2);\n case 17:\n return statistical.QUARTILE.INC(ref1, ref2);\n case 18:\n return statistical.PERCENTILE.EXC(ref1, ref2);\n case 19:\n return statistical.QUARTILE.EXC(ref1, ref2);\n }\n};\n\nexports.ARABIC = function(text) {\n // Credits: Rafa? Kukawski\n if (!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(text)) {\n return error.value;\n }\n var r = 0;\n text.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g, function(i) {\n r += {\n M: 1000,\n CM: 900,\n D: 500,\n CD: 400,\n C: 100,\n XC: 90,\n L: 50,\n XL: 40,\n X: 10,\n IX: 9,\n V: 5,\n IV: 4,\n I: 1\n }[i];\n });\n return r;\n};\n\nexports.ASIN = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var result = Math.asin(number);\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.ASINH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return Math.log(number + Math.sqrt(number * number + 1));\n};\n\nexports.ATAN = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return Math.atan(number);\n};\n\nexports.ATAN2 = function(number_x, number_y) {\n number_x = utils.parseNumber(number_x);\n number_y = utils.parseNumber(number_y);\n if (utils.anyIsError(number_x, number_y)) {\n return error.value;\n }\n return Math.atan2(number_x, number_y);\n};\n\nexports.ATANH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var result = Math.log((1 + number) / (1 - number)) / 2;\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.BASE = function(number, radix, min_length) {\n min_length = min_length || 0;\n\n number = utils.parseNumber(number);\n radix = utils.parseNumber(radix);\n min_length = utils.parseNumber(min_length);\n if (utils.anyIsError(number, radix, min_length)) {\n return error.value;\n }\n min_length = (min_length === undefined) ? 0 : min_length;\n var result = number.toString(radix);\n return new Array(Math.max(min_length + 1 - result.length, 0)).join('0') + result;\n};\n\nexports.CEILING = function(number, significance, mode) {\n significance = (significance === undefined) ? 1 : Math.abs(significance);\n mode = mode || 0;\n\n number = utils.parseNumber(number);\n significance = utils.parseNumber(significance);\n mode = utils.parseNumber(mode);\n if (utils.anyIsError(number, significance, mode)) {\n return error.value;\n }\n if (significance === 0) {\n return 0;\n }\n var precision = -Math.floor(Math.log(significance) / Math.log(10));\n if (number >= 0) {\n return exports.ROUND(Math.ceil(number / significance) * significance, precision);\n } else {\n if (mode === 0) {\n return -exports.ROUND(Math.floor(Math.abs(number) / significance) * significance, precision);\n } else {\n return -exports.ROUND(Math.ceil(Math.abs(number) / significance) * significance, precision);\n }\n }\n};\n\nexports.CEILING.MATH = exports.CEILING;\n\nexports.CEILING.PRECISE = exports.CEILING;\n\nexports.COMBIN = function(number, number_chosen) {\n number = utils.parseNumber(number);\n number_chosen = utils.parseNumber(number_chosen);\n if (utils.anyIsError(number, number_chosen)) {\n return error.value;\n }\n return exports.FACT(number) / (exports.FACT(number_chosen) * exports.FACT(number - number_chosen));\n};\n\nexports.COMBINA = function(number, number_chosen) {\n number = utils.parseNumber(number);\n number_chosen = utils.parseNumber(number_chosen);\n if (utils.anyIsError(number, number_chosen)) {\n return error.value;\n }\n return (number === 0 && number_chosen === 0) ? 1 : exports.COMBIN(number + number_chosen - 1, number - 1);\n};\n\nexports.COS = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return Math.cos(number);\n};\n\nexports.COSH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return (Math.exp(number) + Math.exp(-number)) / 2;\n};\n\nexports.COT = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return 1 / Math.tan(number);\n};\n\nexports.COTH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var e2 = Math.exp(2 * number);\n return (e2 + 1) / (e2 - 1);\n};\n\nexports.CSC = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return 1 / Math.sin(number);\n};\n\nexports.CSCH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return 2 / (Math.exp(number) - Math.exp(-number));\n};\n\nexports.DECIMAL = function(number, radix) {\n if (arguments.length < 1) {\n return error.value;\n }\n\n\n return parseInt(number, radix);\n};\n\nexports.DEGREES = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return number * 180 / Math.PI;\n};\n\nexports.EVEN = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return exports.CEILING(number, -2, -1);\n};\n\nexports.EXP = Math.exp;\n\nvar MEMOIZED_FACT = [];\nexports.FACT = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var n = Math.floor(number);\n if (n === 0 || n === 1) {\n return 1;\n } else if (MEMOIZED_FACT[n] > 0) {\n return MEMOIZED_FACT[n];\n } else {\n MEMOIZED_FACT[n] = exports.FACT(n - 1) * n;\n return MEMOIZED_FACT[n];\n }\n};\n\nexports.FACTDOUBLE = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var n = Math.floor(number);\n if (n <= 0) {\n return 1;\n } else {\n return n * exports.FACTDOUBLE(n - 2);\n }\n};\n\nexports.FLOOR = function(number, significance) {\n number = utils.parseNumber(number);\n significance = utils.parseNumber(significance);\n if (utils.anyIsError(number, significance)) {\n return error.value;\n }\n if (significance === 0) {\n return 0;\n }\n\n if (!(number > 0 && significance > 0) && !(number < 0 && significance < 0)) {\n return error.num;\n }\n\n significance = Math.abs(significance);\n var precision = -Math.floor(Math.log(significance) / Math.log(10));\n if (number >= 0) {\n return exports.ROUND(Math.floor(number / significance) * significance, precision);\n } else {\n return -exports.ROUND(Math.ceil(Math.abs(number) / significance), precision);\n }\n};\n\n//TODO: Verify\nexports.FLOOR.MATH = function(number, significance, mode) {\n significance = (significance === undefined) ? 1 : significance;\n mode = (mode === undefined) ? 0 : mode;\n\n number = utils.parseNumber(number);\n significance = utils.parseNumber(significance);\n mode = utils.parseNumber(mode);\n if (utils.anyIsError(number, significance, mode)) {\n return error.value;\n }\n if (significance === 0) {\n return 0;\n }\n\n significance = significance ? Math.abs(significance) : 1;\n var precision = -Math.floor(Math.log(significance) / Math.log(10));\n if (number >= 0) {\n return exports.ROUND(Math.floor(number / significance) * significance, precision);\n } else if (mode === 0 || mode === undefined) {\n return -exports.ROUND(Math.ceil(Math.abs(number) / significance) * significance, precision);\n }\n return -exports.ROUND(Math.floor(Math.abs(number) / significance) * significance, precision);\n};\n\n// Deprecated\nexports.FLOOR.PRECISE = exports.FLOOR.MATH;\n\n// adapted http://rosettacode.org/wiki/Greatest_common_divisor#JavaScript\nexports.GCD = function() {\n var range = utils.parseNumberArray(utils.flatten(arguments));\n if (range instanceof Error) {\n return range;\n }\n var n = range.length;\n var r0 = range[0];\n var x = r0 < 0 ? -r0 : r0;\n for (var i = 1; i < n; i++) {\n var ri = range[i];\n var y = ri < 0 ? -ri : ri;\n while (x && y) {\n if (x > y) {\n x %= y;\n } else {\n y %= x;\n }\n }\n x += y;\n }\n return x;\n};\n\n\nexports.INT = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return Math.floor(number);\n};\n\n//TODO: verify\nexports.ISO = {\n CEILING: exports.CEILING\n};\n\nexports.LCM = function() {\n // Credits: Jonas Raoni Soares Silva\n var o = utils.parseNumberArray(utils.flatten(arguments));\n if (o instanceof Error) {\n return o;\n }\n for (var i, j, n, d, r = 1;\n (n = o.pop()) !== undefined;) {\n while (n > 1) {\n if (n % 2) {\n for (i = 3, j = Math.floor(Math.sqrt(n)); i <= j && n % i; i += 2) {\n //empty\n }\n d = (i <= j) ? i : n;\n } else {\n d = 2;\n }\n for (n /= d, r *= d, i = o.length; i;\n (o[--i] % d) === 0 && (o[i] /= d) === 1 && o.splice(i, 1)) {\n //empty\n }\n }\n }\n return r;\n};\n\nexports.LN = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return Math.log(number);\n};\n\nexports.LN10 = function() {\n return Math.log(10);\n};\n\nexports.LN2 = function() {\n return Math.log(2);\n};\n\nexports.LOG10E = function() {\n return Math.LOG10E;\n};\n\nexports.LOG2E = function() {\n return Math.LOG2E;\n};\n\nexports.LOG = function(number, base) {\n number = utils.parseNumber(number);\n base = utils.parseNumber(base);\n if (utils.anyIsError(number, base)) {\n return error.value;\n }\n base = (base === undefined) ? 10 : base;\n return Math.log(number) / Math.log(base);\n};\n\nexports.LOG10 = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return Math.log(number) / Math.log(10);\n};\n\nexports.MOD = function(dividend, divisor) {\n dividend = utils.parseNumber(dividend);\n divisor = utils.parseNumber(divisor);\n if (utils.anyIsError(dividend, divisor)) {\n return error.value;\n }\n if (divisor === 0) {\n return error.div0;\n }\n var modulus = Math.abs(dividend % divisor);\n return (divisor > 0) ? modulus : -modulus;\n};\n\nexports.MROUND = function(number, multiple) {\n number = utils.parseNumber(number);\n multiple = utils.parseNumber(multiple);\n if (utils.anyIsError(number, multiple)) {\n return error.value;\n }\n if (number * multiple < 0) {\n return error.num;\n }\n\n return Math.round(number / multiple) * multiple;\n};\n\nexports.MULTINOMIAL = function() {\n var args = utils.parseNumberArray(utils.flatten(arguments));\n if (args instanceof Error) {\n return args;\n }\n var sum = 0;\n var divisor = 1;\n for (var i = 0; i < args.length; i++) {\n sum += args[i];\n divisor *= exports.FACT(args[i]);\n }\n return exports.FACT(sum) / divisor;\n};\n\nexports.ODD = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var temp = Math.ceil(Math.abs(number));\n temp = (temp & 1) ? temp : temp + 1;\n return (number > 0) ? temp : -temp;\n};\n\nexports.PI = function() {\n return Math.PI;\n};\n\nexports.E = function() {\n return Math.E;\n};\n\nexports.POWER = function(number, power) {\n number = utils.parseNumber(number);\n power = utils.parseNumber(power);\n if (utils.anyIsError(number, power)) {\n return error.value;\n }\n var result = Math.pow(number, power);\n if (isNaN(result)) {\n return error.num;\n }\n\n return result;\n};\n\nexports.PRODUCT = function() {\n var args = utils.parseNumberArray(utils.flatten(arguments));\n if (args instanceof Error) {\n return args;\n }\n var result = 1;\n for (var i = 0; i < args.length; i++) {\n result *= args[i];\n }\n return result;\n};\n\nexports.QUOTIENT = function(numerator, denominator) {\n numerator = utils.parseNumber(numerator);\n denominator = utils.parseNumber(denominator);\n if (utils.anyIsError(numerator, denominator)) {\n return error.value;\n }\n return parseInt(numerator / denominator, 10);\n};\n\nexports.RADIANS = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return number * Math.PI / 180;\n};\n\nexports.RAND = function() {\n return Math.random();\n};\n\nexports.RANDBETWEEN = function(bottom, top) {\n bottom = utils.parseNumber(bottom);\n top = utils.parseNumber(top);\n if (utils.anyIsError(bottom, top)) {\n return error.value;\n }\n // Creative Commons Attribution 3.0 License\n // Copyright (c) 2012 eqcode\n return bottom + Math.ceil((top - bottom + 1) * Math.random()) - 1;\n};\n\n// TODO\nexports.ROMAN = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n // The MIT License\n // Copyright (c) 2008 Steven Levithan\n var digits = String(number).split('');\n var key = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM', '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC', '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'];\n var roman = '';\n var i = 3;\n while (i--) {\n roman = (key[+digits.pop() + (i * 10)] || '') + roman;\n }\n return new Array(+digits.join('') + 1).join('M') + roman;\n};\n\nexports.ROUND = function(number, digits) {\n number = utils.parseNumber(number);\n digits = utils.parseNumber(digits);\n if (utils.anyIsError(number, digits)) {\n return error.value;\n }\n return Math.round(number * Math.pow(10, digits)) / Math.pow(10, digits);\n};\n\nexports.ROUNDDOWN = function(number, digits) {\n number = utils.parseNumber(number);\n digits = utils.parseNumber(digits);\n if (utils.anyIsError(number, digits)) {\n return error.value;\n }\n var sign = (number > 0) ? 1 : -1;\n return sign * (Math.floor(Math.abs(number) * Math.pow(10, digits))) / Math.pow(10, digits);\n};\n\nexports.ROUNDUP = function(number, digits) {\n number = utils.parseNumber(number);\n digits = utils.parseNumber(digits);\n if (utils.anyIsError(number, digits)) {\n return error.value;\n }\n var sign = (number > 0) ? 1 : -1;\n return sign * (Math.ceil(Math.abs(number) * Math.pow(10, digits))) / Math.pow(10, digits);\n};\n\nexports.SEC = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return 1 / Math.cos(number);\n};\n\nexports.SECH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return 2 / (Math.exp(number) + Math.exp(-number));\n};\n\nexports.SERIESSUM = function(x, n, m, coefficients) {\n x = utils.parseNumber(x);\n n = utils.parseNumber(n);\n m = utils.parseNumber(m);\n coefficients = utils.parseNumberArray(coefficients);\n if (utils.anyIsError(x, n, m, coefficients)) {\n return error.value;\n }\n var result = coefficients[0] * Math.pow(x, n);\n for (var i = 1; i < coefficients.length; i++) {\n result += coefficients[i] * Math.pow(x, n + i * m);\n }\n return result;\n};\n\nexports.SIGN = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n if (number < 0) {\n return -1;\n } else if (number === 0) {\n return 0;\n } else {\n return 1;\n }\n};\n\nexports.SIN = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return Math.sin(number);\n};\n\nexports.SINH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return (Math.exp(number) - Math.exp(-number)) / 2;\n};\n\nexports.SQRT = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n if (number < 0) {\n return error.num;\n }\n return Math.sqrt(number);\n};\n\nexports.SQRTPI = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return Math.sqrt(number * Math.PI);\n};\n\nexports.SQRT1_2 = function() {\n return 1 / Math.sqrt(2);\n};\n\nexports.SQRT2 = function() {\n return Math.sqrt(2);\n};\n\nexports.SUBTOTAL = function(function_code, ref1) {\n function_code = utils.parseNumber(function_code);\n if (function_code instanceof Error) {\n return function_code;\n }\n switch (function_code) {\n case 1:\n return statistical.AVERAGE(ref1);\n case 2:\n return statistical.COUNT(ref1);\n case 3:\n return statistical.COUNTA(ref1);\n case 4:\n return statistical.MAX(ref1);\n case 5:\n return statistical.MIN(ref1);\n case 6:\n return exports.PRODUCT(ref1);\n case 7:\n return statistical.STDEV.S(ref1);\n case 8:\n return statistical.STDEV.P(ref1);\n case 9:\n return exports.SUM(ref1);\n case 10:\n return statistical.VAR.S(ref1);\n case 11:\n return statistical.VAR.P(ref1);\n // no hidden values for us\n case 101:\n return statistical.AVERAGE(ref1);\n case 102:\n return statistical.COUNT(ref1);\n case 103:\n return statistical.COUNTA(ref1);\n case 104:\n return statistical.MAX(ref1);\n case 105:\n return statistical.MIN(ref1);\n case 106:\n return exports.PRODUCT(ref1);\n case 107:\n return statistical.STDEV.S(ref1);\n case 108:\n return statistical.STDEV.P(ref1);\n case 109:\n return exports.SUM(ref1);\n case 110:\n return statistical.VAR.S(ref1);\n case 111:\n return statistical.VAR.P(ref1);\n\n }\n};\n\nexports.ADD = function (num1, num2) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n num1 = utils.parseNumber(num1);\n num2 = utils.parseNumber(num2);\n if (utils.anyIsError(num1, num2)) {\n return error.value;\n }\n\n return num1 + num2;\n};\n\nexports.MINUS = function (num1, num2) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n num1 = utils.parseNumber(num1);\n num2 = utils.parseNumber(num2);\n if (utils.anyIsError(num1, num2)) {\n return error.value;\n }\n\n return num1 - num2;\n};\n\nexports.DIVIDE = function (dividend, divisor) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n dividend = utils.parseNumber(dividend);\n divisor = utils.parseNumber(divisor);\n if (utils.anyIsError(dividend, divisor)) {\n return error.value;\n }\n\n if (divisor === 0) {\n return error.div0;\n }\n\n return dividend / divisor;\n};\n\nexports.MULTIPLY = function (factor1, factor2) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n factor1 = utils.parseNumber(factor1);\n factor2 = utils.parseNumber(factor2);\n if (utils.anyIsError(factor1, factor2)) {\n return error.value;\n }\n\n return factor1 * factor2;\n};\n\nexports.GTE = function (num1, num2) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n num1 = utils.parseNumber(num1);\n num2 = utils.parseNumber(num2);\n if (utils.anyIsError(num1, num2)) {\n return error.error;\n }\n\n return num1 >= num2;\n};\n\nexports.LT = function (num1, num2) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n num1 = utils.parseNumber(num1);\n num2 = utils.parseNumber(num2);\n if (utils.anyIsError(num1, num2)) {\n return error.error;\n }\n\n return num1 < num2;\n};\n\n\nexports.LTE = function (num1, num2) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n num1 = utils.parseNumber(num1);\n num2 = utils.parseNumber(num2);\n if (utils.anyIsError(num1, num2)) {\n return error.error;\n }\n\n return num1 <= num2;\n};\n\nexports.EQ = function (value1, value2) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n return value1 === value2;\n};\n\nexports.NE = function (value1, value2) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n return value1 !== value2;\n};\n\nexports.POW = function (base, exponent) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n base = utils.parseNumber(base);\n exponent = utils.parseNumber(exponent);\n if (utils.anyIsError(base, exponent)) {\n return error.error;\n }\n\n return exports.POWER(base, exponent);\n};\n\nexports.SUM = function() {\n var result = 0;\n\n utils.arrayEach(utils.argsToArray(arguments), function(value) {\n if (typeof value === 'number') {\n result += value;\n\n } else if (typeof value === 'string') {\n var parsed = parseFloat(value);\n\n !isNaN(parsed) && (result += parsed);\n\n } else if (Array.isArray(value)) {\n result += exports.SUM.apply(null, value);\n }\n });\n\n return result;\n};\n\nexports.SUMIF = function(range, criteria) {\n range = utils.parseNumberArray(utils.flatten(range));\n if (range instanceof Error) {\n return range;\n }\n var result = 0;\n for (var i = 0; i < range.length; i++) {\n result += (eval(range[i] + criteria)) ? range[i] : 0; // jshint ignore:line\n }\n return result;\n};\n\nexports.SUMIFS = function() {\n var args = utils.argsToArray(arguments);\n var range = utils.parseNumberArray(utils.flatten(args.shift()));\n if (range instanceof Error) {\n return range;\n }\n var criteria = args;\n\n var n_range_elements = range.length;\n var n_criterias = criteria.length;\n\n var result = 0;\n for (var i = 0; i < n_range_elements; i++) {\n var el = range[i];\n var condition = '';\n for (var c = 0; c < n_criterias; c++) {\n condition += el + criteria[c];\n if (c !== n_criterias - 1) {\n condition += '&&';\n }\n }\n if (eval(condition)) { // jshint ignore:line\n result += el;\n }\n }\n return result;\n};\n\nexports.SUMPRODUCT = function() {\n if (!arguments || arguments.length === 0) {\n return error.value;\n }\n var arrays = arguments.length + 1;\n var result = 0;\n var product;\n var k;\n var _i;\n var _ij;\n for (var i = 0; i < arguments[0].length; i++) {\n if (!(arguments[0][i] instanceof Array)) {\n product = 1;\n for (k = 1; k < arrays; k++) {\n _i = utils.parseNumber(arguments[k - 1][i]);\n if (_i instanceof Error) {\n return _i;\n }\n product *= _i;\n }\n result += product;\n } else {\n for (var j = 0; j < arguments[0][i].length; j++) {\n product = 1;\n for (k = 1; k < arrays; k++) {\n _ij = utils.parseNumber(arguments[k - 1][i][j]);\n if (_ij instanceof Error) {\n return _ij;\n }\n product *= _ij;\n }\n result += product;\n }\n }\n }\n return result;\n};\n\nexports.SUMSQ = function() {\n var numbers = utils.parseNumberArray(utils.flatten(arguments));\n if (numbers instanceof Error) {\n return numbers;\n }\n var result = 0;\n var length = numbers.length;\n for (var i = 0; i < length; i++) {\n result += (information.ISNUMBER(numbers[i])) ? numbers[i] * numbers[i] : 0;\n }\n return result;\n};\n\nexports.SUMX2MY2 = function(array_x, array_y) {\n array_x = utils.parseNumberArray(utils.flatten(array_x));\n array_y = utils.parseNumberArray(utils.flatten(array_y));\n if (utils.anyIsError(array_x, array_y)) {\n return error.value;\n }\n var result = 0;\n for (var i = 0; i < array_x.length; i++) {\n result += array_x[i] * array_x[i] - array_y[i] * array_y[i];\n }\n return result;\n};\n\nexports.SUMX2PY2 = function(array_x, array_y) {\n array_x = utils.parseNumberArray(utils.flatten(array_x));\n array_y = utils.parseNumberArray(utils.flatten(array_y));\n if (utils.anyIsError(array_x, array_y)) {\n return error.value;\n }\n var result = 0;\n array_x = utils.parseNumberArray(utils.flatten(array_x));\n array_y = utils.parseNumberArray(utils.flatten(array_y));\n for (var i = 0; i < array_x.length; i++) {\n result += array_x[i] * array_x[i] + array_y[i] * array_y[i];\n }\n return result;\n};\n\nexports.SUMXMY2 = function(array_x, array_y) {\n array_x = utils.parseNumberArray(utils.flatten(array_x));\n array_y = utils.parseNumberArray(utils.flatten(array_y));\n if (utils.anyIsError(array_x, array_y)) {\n return error.value;\n }\n var result = 0;\n array_x = utils.flatten(array_x);\n array_y = utils.flatten(array_y);\n for (var i = 0; i < array_x.length; i++) {\n result += Math.pow(array_x[i] - array_y[i], 2);\n }\n return result;\n};\n\nexports.TAN = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return Math.tan(number);\n};\n\nexports.TANH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var e2 = Math.exp(2 * number);\n return (e2 - 1) / (e2 + 1);\n};\n\nexports.TRUNC = function(number, digits) {\n digits = (digits === undefined) ? 0 : digits;\n number = utils.parseNumber(number);\n digits = utils.parseNumber(digits);\n if (utils.anyIsError(number, digits)) {\n return error.value;\n }\n var sign = (number > 0) ? 1 : -1;\n return sign * (Math.floor(Math.abs(number) * Math.pow(10, digits))) / Math.pow(10, digits);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/math-trig.js\n ** module id = 14\n ** module chunks = 0\n **/","var error = require('./error');\n\nexports.flattenShallow = function(array) {\n if (!array || !array.reduce) {\n return array;\n }\n\n return array.reduce(function(a, b) {\n var aIsArray = Array.isArray(a);\n var bIsArray = Array.isArray(b);\n\n if (aIsArray && bIsArray ) {\n return a.concat(b);\n }\n if (aIsArray) {\n a.push(b);\n\n return a;\n }\n if (bIsArray) {\n return [a].concat(b);\n }\n\n return [a, b];\n });\n};\n\nexports.isFlat = function(array) {\n if (!array) {\n return false;\n }\n\n for (var i = 0; i < array.length; ++i) {\n if (Array.isArray(array[i])) {\n return false;\n }\n }\n\n return true;\n};\n\nexports.flatten = function() {\n var result = exports.argsToArray.apply(null, arguments);\n\n while (!exports.isFlat(result)) {\n result = exports.flattenShallow(result);\n }\n\n return result;\n};\n\nexports.argsToArray = function(args) {\n var result = [];\n\n exports.arrayEach(args, function(value) {\n result.push(value);\n });\n\n return result;\n};\n\nexports.numbers = function() {\n var possibleNumbers = this.flatten.apply(null, arguments);\n return possibleNumbers.filter(function(el) {\n return typeof el === 'number';\n });\n};\n\nexports.cleanFloat = function(number) {\n var power = 1e14;\n return Math.round(number * power) / power;\n};\n\nexports.parseBool = function(bool) {\n if (typeof bool === 'boolean') {\n return bool;\n }\n\n if (bool instanceof Error) {\n return bool;\n }\n\n if (typeof bool === 'number') {\n return bool !== 0;\n }\n\n if (typeof bool === 'string') {\n var up = bool.toUpperCase();\n if (up === 'TRUE') {\n return true;\n }\n\n if (up === 'FALSE') {\n return false;\n }\n }\n\n if (bool instanceof Date && !isNaN(bool)) {\n return true;\n }\n\n return error.value;\n};\n\nexports.parseNumber = function(string) {\n if (string === undefined || string === '') {\n return error.value;\n }\n if (!isNaN(string)) {\n return parseFloat(string);\n }\n\n return error.value;\n};\n\nexports.parseNumberArray = function(arr) {\n var len;\n\n if (!arr || (len = arr.length) === 0) {\n return error.value;\n }\n\n var parsed;\n\n while (len--) {\n parsed = exports.parseNumber(arr[len]);\n if (parsed === error.value) {\n return parsed;\n }\n arr[len] = parsed;\n }\n\n return arr;\n};\n\nexports.parseMatrix = function(matrix) {\n var n;\n\n if (!matrix || (n = matrix.length) === 0) {\n return error.value;\n }\n var pnarr;\n\n for (var i = 0; i < matrix.length; i++) {\n pnarr = exports.parseNumberArray(matrix[i]);\n matrix[i] = pnarr;\n\n if (pnarr instanceof Error) {\n return pnarr;\n }\n }\n\n return matrix;\n};\n\nvar d1900 = new Date(1900, 0, 1);\nexports.parseDate = function(date) {\n if (!isNaN(date)) {\n if (date instanceof Date) {\n return new Date(date);\n }\n var d = parseInt(date, 10);\n if (d < 0) {\n return error.num;\n }\n if (d <= 60) {\n return new Date(d1900.getTime() + (d - 1) * 86400000);\n }\n return new Date(d1900.getTime() + (d - 2) * 86400000);\n }\n if (typeof date === 'string') {\n date = new Date(date);\n if (!isNaN(date)) {\n return date;\n }\n }\n return error.value;\n};\n\nexports.parseDateArray = function(arr) {\n var len = arr.length;\n var parsed;\n while (len--) {\n parsed = this.parseDate(arr[len]);\n if (parsed === error.value) {\n return parsed;\n }\n arr[len] = parsed;\n }\n return arr;\n};\n\nexports.anyIsError = function() {\n var n = arguments.length;\n while (n--) {\n if (arguments[n] instanceof Error) {\n return true;\n }\n }\n return false;\n};\n\nexports.arrayValuesToNumbers = function(arr) {\n var n = arr.length;\n var el;\n while (n--) {\n el = arr[n];\n if (typeof el === 'number') {\n continue;\n }\n if (el === true) {\n arr[n] = 1;\n continue;\n }\n if (el === false) {\n arr[n] = 0;\n continue;\n }\n if (typeof el === 'string') {\n var number = this.parseNumber(el);\n if (number instanceof Error) {\n arr[n] = 0;\n } else {\n arr[n] = number;\n }\n }\n }\n return arr;\n};\n\nexports.rest = function(array, idx) {\n idx = idx || 1;\n if (!array || typeof array.slice !== 'function') {\n return array;\n }\n return array.slice(idx);\n};\n\nexports.initial = function(array, idx) {\n idx = idx || 1;\n if (!array || typeof array.slice !== 'function') {\n return array;\n }\n return array.slice(0, array.length - idx);\n};\n\nexports.arrayEach = function(array, iteratee) {\n var index = -1, length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n\n return array;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/utils.js\n ** module id = 15\n ** module chunks = 0\n **/","exports.nil = new Error('#NULL!');\nexports.div0 = new Error('#DIV/0!');\nexports.value = new Error('#VALUE?');\nexports.ref = new Error('#REF!');\nexports.name = new Error('#NAME?');\nexports.num = new Error('#NUM!');\nexports.na = new Error('#N/A');\nexports.error = new Error('#ERROR!');\nexports.data = new Error('#GETTING_DATA');\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/error.js\n ** module id = 16\n ** module chunks = 0\n **/","var mathTrig = require('./math-trig');\nvar text = require('./text');\nvar jStat = require('jStat').jStat;\nvar utils = require('./utils');\nvar error = require('./error');\nvar misc = require('./miscellaneous');\n\nvar SQRT2PI = 2.5066282746310002;\n\nexports.AVEDEV = function() {\n var range = utils.parseNumberArray(utils.flatten(arguments));\n if (range instanceof Error) {\n return range;\n }\n return jStat.sum(jStat(range).subtract(jStat.mean(range)).abs()[0]) / range.length;\n};\n\nexports.AVERAGE = function() {\n var range = utils.numbers(utils.flatten(arguments));\n var n = range.length;\n var sum = 0;\n var count = 0;\n var result;\n\n for (var i = 0; i < n; i++) {\n sum += range[i];\n count += 1;\n }\n result = sum / count;\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.AVERAGEA = function() {\n var range = utils.flatten(arguments);\n var n = range.length;\n var sum = 0;\n var count = 0;\n var result;\n for (var i = 0; i < n; i++) {\n var el = range[i];\n if (typeof el === 'number') {\n sum += el;\n }\n if (el === true) {\n sum++;\n }\n if (el !== null) {\n count++;\n }\n }\n result = sum / count;\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.AVERAGEIF = function(range, criteria, average_range) {\n if (arguments.length <= 1) {\n return error.na;\n }\n average_range = average_range || range;\n range = utils.flatten(range);\n average_range = utils.parseNumberArray(utils.flatten(average_range));\n if (average_range instanceof Error) {\n return average_range;\n }\n var average_count = 0;\n var result = 0;\n for (var i = 0; i < range.length; i++) {\n if (eval(range[i] + criteria)) { // jshint ignore:line\n result += average_range[i];\n average_count++;\n }\n }\n return result / average_count;\n};\n\nexports.AVERAGEIFS = function() {\n // Does not work with multi dimensional ranges yet!\n //http://office.microsoft.com/en-001/excel-help/averageifs-function-HA010047493.aspx\n var args = utils.argsToArray(arguments);\n var criteria = (args.length - 1) / 2;\n var range = utils.flatten(args[0]);\n var count = 0;\n var result = 0;\n for (var i = 0; i < range.length; i++) {\n var condition = '';\n for (var j = 0; j < criteria; j++) {\n condition += args[2 * j + 1][i] + args[2 * j + 2];\n if (j !== criteria - 1) {\n condition += '&&';\n }\n }\n if (eval(condition)) { // jshint ignore:line\n result += range[i];\n count++;\n }\n }\n\n var average = result / count;\n if (isNaN(average)) {\n return 0;\n } else {\n return average;\n }\n};\n\nexports.BETA = {};\n\nexports.BETA.DIST = function(x, alpha, beta, cumulative, A, B) {\n if (arguments.length < 4) {\n return error.value;\n }\n\n A = (A === undefined) ? 0 : A;\n B = (B === undefined) ? 1 : B;\n\n x = utils.parseNumber(x);\n alpha = utils.parseNumber(alpha);\n beta = utils.parseNumber(beta);\n A = utils.parseNumber(A);\n B = utils.parseNumber(B);\n if (utils.anyIsError(x, alpha, beta, A, B)) {\n return error.value;\n }\n\n x = (x - A) / (B - A);\n return (cumulative) ? jStat.beta.cdf(x, alpha, beta) : jStat.beta.pdf(x, alpha, beta);\n};\n\nexports.BETA.INV = function(probability, alpha, beta, A, B) {\n A = (A === undefined) ? 0 : A;\n B = (B === undefined) ? 1 : B;\n\n probability = utils.parseNumber(probability);\n alpha = utils.parseNumber(alpha);\n beta = utils.parseNumber(beta);\n A = utils.parseNumber(A);\n B = utils.parseNumber(B);\n if (utils.anyIsError(probability, alpha, beta, A, B)) {\n return error.value;\n }\n\n return jStat.beta.inv(probability, alpha, beta) * (B - A) + A;\n};\n\nexports.BINOM = {};\n\nexports.BINOM.DIST = function(successes, trials, probability, cumulative) {\n successes = utils.parseNumber(successes);\n trials = utils.parseNumber(trials);\n probability = utils.parseNumber(probability);\n cumulative = utils.parseNumber(cumulative);\n if (utils.anyIsError(successes, trials, probability, cumulative)) {\n return error.value;\n }\n return (cumulative) ? jStat.binomial.cdf(successes, trials, probability) : jStat.binomial.pdf(successes, trials, probability);\n};\n\nexports.BINOM.DIST.RANGE = function(trials, probability, successes, successes2) {\n successes2 = (successes2 === undefined) ? successes : successes2;\n\n trials = utils.parseNumber(trials);\n probability = utils.parseNumber(probability);\n successes = utils.parseNumber(successes);\n successes2 = utils.parseNumber(successes2);\n if (utils.anyIsError(trials, probability, successes, successes2)) {\n return error.value;\n }\n\n var result = 0;\n for (var i = successes; i <= successes2; i++) {\n result += mathTrig.COMBIN(trials, i) * Math.pow(probability, i) * Math.pow(1 - probability, trials - i);\n }\n return result;\n};\n\nexports.BINOM.INV = function(trials, probability, alpha) {\n trials = utils.parseNumber(trials);\n probability = utils.parseNumber(probability);\n alpha = utils.parseNumber(alpha);\n if (utils.anyIsError(trials, probability, alpha)) {\n return error.value;\n }\n\n var x = 0;\n while (x <= trials) {\n if (jStat.binomial.cdf(x, trials, probability) >= alpha) {\n return x;\n }\n x++;\n }\n};\n\nexports.CHISQ = {};\n\nexports.CHISQ.DIST = function(x, k, cumulative) {\n x = utils.parseNumber(x);\n k = utils.parseNumber(k);\n if (utils.anyIsError(x, k)) {\n return error.value;\n }\n\n return (cumulative) ? jStat.chisquare.cdf(x, k) : jStat.chisquare.pdf(x, k);\n};\n\nexports.CHISQ.DIST.RT = function(x, k) {\n if (!x | !k) {\n return error.na;\n }\n\n if (x < 1 || k > Math.pow(10, 10)) {\n return error.num;\n }\n\n if ((typeof x !== 'number') || (typeof k !== 'number')) {\n return error.value;\n }\n\n return 1 - jStat.chisquare.cdf(x, k);\n};\n\nexports.CHISQ.INV = function(probability, k) {\n probability = utils.parseNumber(probability);\n k = utils.parseNumber(k);\n if (utils.anyIsError(probability, k)) {\n return error.value;\n }\n return jStat.chisquare.inv(probability, k);\n};\n\nexports.CHISQ.INV.RT = function(p, k) {\n if (!p | !k) {\n return error.na;\n }\n\n if (p < 0 || p > 1 || k < 1 || k > Math.pow(10, 10)) {\n return error.num;\n }\n\n if ((typeof p !== 'number') || (typeof k !== 'number')) {\n return error.value;\n }\n\n return jStat.chisquare.inv(1.0 - p, k);\n};\n\nexports.CHISQ.TEST = function(observed, expected) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n if ((!(observed instanceof Array)) || (!(expected instanceof Array))) {\n return error.value;\n }\n\n if (observed.length !== expected.length) {\n return error.value;\n }\n\n if (observed[0] && expected[0] &&\n observed[0].length !== expected[0].length) {\n return error.value;\n }\n\n var row = observed.length;\n var tmp, i, j;\n\n // Convert single-dimension array into two-dimension array\n for (i = 0; i < row; i ++) {\n if (!(observed[i] instanceof Array)) {\n tmp = observed[i];\n observed[i] = [];\n observed[i].push(tmp);\n }\n if (!(expected[i] instanceof Array)) {\n tmp = expected[i];\n expected[i] = [];\n expected[i].push(tmp);\n }\n }\n\n var col = observed[0].length;\n var dof = (col === 1) ? row-1 : (row-1)*(col-1);\n var xsqr = 0;\n var Pi =Math.PI;\n\n for (i = 0; i < row; i ++) {\n for (j = 0; j < col; j ++) {\n xsqr += Math.pow((observed[i][j] - expected[i][j]), 2) / expected[i][j];\n }\n }\n\n // Get independency by X square and its degree of freedom\n function ChiSq(xsqr, dof) {\n var p = Math.exp(-0.5 * xsqr);\n if((dof%2) === 1) {\n p = p * Math.sqrt(2 * xsqr/Pi);\n }\n var k = dof;\n while(k >= 2) {\n p = p * xsqr/k;\n k = k - 2;\n }\n var t = p;\n var a = dof;\n while (t > 0.0000000001*p) {\n a = a + 2;\n t = t * xsqr/a;\n p = p + t;\n }\n return 1-p;\n }\n\n return Math.round(ChiSq(xsqr, dof) * 1000000) / 1000000;\n};\n\nexports.COLUMN = function(matrix, index) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n if (index < 0) {\n return error.num;\n }\n\n if (!(matrix instanceof Array) || (typeof index !== 'number')) {\n return error.value;\n }\n\n if (matrix.length === 0) {\n return undefined;\n }\n\n return jStat.col(matrix, index);\n};\n\nexports.COLUMNS = function(matrix) {\n if (arguments.length !== 1) {\n return error.na;\n }\n\n if (!(matrix instanceof Array)) {\n return error.value;\n }\n\n if (matrix.length === 0) {\n return 0;\n }\n\n return jStat.cols(matrix);\n};\n\nexports.CONFIDENCE = {};\n\nexports.CONFIDENCE.NORM = function(alpha, sd, n) {\n alpha = utils.parseNumber(alpha);\n sd = utils.parseNumber(sd);\n n = utils.parseNumber(n);\n if (utils.anyIsError(alpha, sd, n)) {\n return error.value;\n }\n return jStat.normalci(1, alpha, sd, n)[1] - 1;\n};\n\nexports.CONFIDENCE.T = function(alpha, sd, n) {\n alpha = utils.parseNumber(alpha);\n sd = utils.parseNumber(sd);\n n = utils.parseNumber(n);\n if (utils.anyIsError(alpha, sd, n)) {\n return error.value;\n }\n return jStat.tci(1, alpha, sd, n)[1] - 1;\n};\n\nexports.CORREL = function(array1, array2) {\n array1 = utils.parseNumberArray(utils.flatten(array1));\n array2 = utils.parseNumberArray(utils.flatten(array2));\n if (utils.anyIsError(array1, array2)) {\n return error.value;\n }\n return jStat.corrcoeff(array1, array2);\n};\n\nexports.COUNT = function() {\n return utils.numbers(utils.flatten(arguments)).length;\n};\n\nexports.COUNTA = function() {\n var range = utils.flatten(arguments);\n return range.length - exports.COUNTBLANK(range);\n};\n\nexports.COUNTIN = function (range, value) {\n var result = 0;\n\n range = utils.flatten(range);\n\n for (var i = 0; i < range.length; i++) {\n if (range[i] === value) {\n result++;\n }\n }\n return result;\n};\n\n\nexports.COUNTBLANK = function() {\n var range = utils.flatten(arguments);\n var blanks = 0;\n var element;\n for (var i = 0; i < range.length; i++) {\n element = range[i];\n if (element === null || element === '') {\n blanks++;\n }\n }\n return blanks;\n};\n\nexports.COUNTIF = function(range, criteria) {\n range = utils.flatten(range);\n if (!/[<>=!]/.test(criteria)) {\n criteria = '==\"' + criteria + '\"';\n }\n var matches = 0;\n for (var i = 0; i < range.length; i++) {\n if (typeof range[i] !== 'string') {\n if (eval(range[i] + criteria)) { // jshint ignore:line\n matches++;\n }\n } else {\n if (eval('\"' + range[i] + '\"' + criteria)) { // jshint ignore:line\n matches++;\n }\n }\n }\n return matches;\n};\n\nexports.COUNTIFS = function() {\n var args = utils.argsToArray(arguments);\n var results = new Array(utils.flatten(args[0]).length);\n for (var i = 0; i < results.length; i++) {\n results[i] = true;\n }\n for (i = 0; i < args.length; i += 2) {\n var range = utils.flatten(args[i]);\n var criteria = args[i + 1];\n if (!/[<>=!]/.test(criteria)) {\n criteria = '==\"' + criteria + '\"';\n }\n for (var j = 0; j < range.length; j++) {\n if (typeof range[j] !== 'string') {\n results[j] = results[j] && eval(range[j] + criteria); // jshint ignore:line\n } else {\n results[j] = results[j] && eval('\"' + range[j] + '\"' + criteria); // jshint ignore:line\n }\n }\n }\n var result = 0;\n for (i = 0; i < results.length; i++) {\n if (results[i]) {\n result++;\n }\n }\n return result;\n};\n\nexports.COUNTUNIQUE = function () {\n return misc.UNIQUE.apply(null, utils.flatten(arguments)).length;\n};\n\nexports.COVARIANCE = {};\n\nexports.COVARIANCE.P = function(array1, array2) {\n array1 = utils.parseNumberArray(utils.flatten(array1));\n array2 = utils.parseNumberArray(utils.flatten(array2));\n if (utils.anyIsError(array1, array2)) {\n return error.value;\n }\n var mean1 = jStat.mean(array1);\n var mean2 = jStat.mean(array2);\n var result = 0;\n var n = array1.length;\n for (var i = 0; i < n; i++) {\n result += (array1[i] - mean1) * (array2[i] - mean2);\n }\n return result / n;\n};\n\nexports.COVARIANCE.S = function(array1, array2) {\n array1 = utils.parseNumberArray(utils.flatten(array1));\n array2 = utils.parseNumberArray(utils.flatten(array2));\n if (utils.anyIsError(array1, array2)) {\n return error.value;\n }\n return jStat.covariance(array1, array2);\n};\n\nexports.DEVSQ = function() {\n var range = utils.parseNumberArray(utils.flatten(arguments));\n if (range instanceof Error) {\n return range;\n }\n var mean = jStat.mean(range);\n var result = 0;\n for (var i = 0; i < range.length; i++) {\n result += Math.pow((range[i] - mean), 2);\n }\n return result;\n};\n\nexports.EXPON = {};\n\nexports.EXPON.DIST = function(x, lambda, cumulative) {\n x = utils.parseNumber(x);\n lambda = utils.parseNumber(lambda);\n if (utils.anyIsError(x, lambda)) {\n return error.value;\n }\n return (cumulative) ? jStat.exponential.cdf(x, lambda) : jStat.exponential.pdf(x, lambda);\n};\n\nexports.F = {};\n\nexports.F.DIST = function(x, d1, d2, cumulative) {\n x = utils.parseNumber(x);\n d1 = utils.parseNumber(d1);\n d2 = utils.parseNumber(d2);\n if (utils.anyIsError(x, d1, d2)) {\n return error.value;\n }\n return (cumulative) ? jStat.centralF.cdf(x, d1, d2) : jStat.centralF.pdf(x, d1, d2);\n};\n\nexports.F.DIST.RT = function(x, d1, d2) {\n if (arguments.length !== 3) {\n return error.na;\n }\n\n if (x < 0 || d1 < 1 || d2 < 1) {\n return error.num;\n }\n\n if ((typeof x !== 'number') || (typeof d1 !== 'number') || (typeof d2 !== 'number')) {\n return error.value;\n }\n\n return 1 - jStat.centralF.cdf(x, d1, d2);\n};\n\nexports.F.INV = function(probability, d1, d2) {\n probability = utils.parseNumber(probability);\n d1 = utils.parseNumber(d1);\n d2 = utils.parseNumber(d2);\n if (utils.anyIsError(probability, d1, d2)) {\n return error.value;\n }\n if (probability <= 0.0 || probability > 1.0) {\n return error.num;\n }\n\n return jStat.centralF.inv(probability, d1, d2);\n};\n\nexports.F.INV.RT = function(p, d1, d2) {\n if (arguments.length !== 3) {\n return error.na;\n }\n\n if (p < 0 || p > 1 || d1 < 1 || d1 > Math.pow(10, 10) || d2 < 1 || d2 > Math.pow(10, 10)) {\n return error.num;\n }\n\n if ((typeof p !== 'number') || (typeof d1 !== 'number') || (typeof d2 !== 'number')) {\n return error.value;\n }\n\n return jStat.centralF.inv(1.0 - p, d1, d2);\n};\n\nexports.F.TEST = function(array1, array2) {\n if (!array1 || !array2) {\n return error.na;\n }\n\n if (!(array1 instanceof Array) || !(array2 instanceof Array)) {\n return error.na;\n }\n\n if (array1.length < 2 || array2.length < 2) {\n return error.div0;\n }\n\n var sumOfSquares = function(values, x1) {\n var sum = 0;\n for (var i = 0; i < values.length; i++) {\n sum +=Math.pow((values[i] - x1), 2);\n }\n return sum;\n };\n\n var x1 = mathTrig.SUM(array1) / array1.length;\n var x2 = mathTrig.SUM(array2) / array2.length;\n var sum1 = sumOfSquares(array1, x1) / (array1.length - 1);\n var sum2 = sumOfSquares(array2, x2) / (array2.length - 1);\n\n return sum1 / sum2;\n};\n\nexports.FISHER = function(x) {\n x = utils.parseNumber(x);\n if (x instanceof Error) {\n return x;\n }\n return Math.log((1 + x) / (1 - x)) / 2;\n};\n\nexports.FISHERINV = function(y) {\n y = utils.parseNumber(y);\n if (y instanceof Error) {\n return y;\n }\n var e2y = Math.exp(2 * y);\n return (e2y - 1) / (e2y + 1);\n};\n\nexports.FORECAST = function(x, data_y, data_x) {\n x = utils.parseNumber(x);\n data_y = utils.parseNumberArray(utils.flatten(data_y));\n data_x = utils.parseNumberArray(utils.flatten(data_x));\n if (utils.anyIsError(x, data_y, data_x)) {\n return error.value;\n }\n var xmean = jStat.mean(data_x);\n var ymean = jStat.mean(data_y);\n var n = data_x.length;\n var num = 0;\n var den = 0;\n for (var i = 0; i < n; i++) {\n num += (data_x[i] - xmean) * (data_y[i] - ymean);\n den += Math.pow(data_x[i] - xmean, 2);\n }\n var b = num / den;\n var a = ymean - b * xmean;\n return a + b * x;\n};\n\nexports.FREQUENCY = function(data, bins) {\n data = utils.parseNumberArray(utils.flatten(data));\n bins = utils.parseNumberArray(utils.flatten(bins));\n if (utils.anyIsError(data, bins)) {\n return error.value;\n }\n var n = data.length;\n var b = bins.length;\n var r = [];\n for (var i = 0; i <= b; i++) {\n r[i] = 0;\n for (var j = 0; j < n; j++) {\n if (i === 0) {\n if (data[j] <= bins[0]) {\n r[0] += 1;\n }\n } else if (i < b) {\n if (data[j] > bins[i - 1] && data[j] <= bins[i]) {\n r[i] += 1;\n }\n } else if (i === b) {\n if (data[j] > bins[b - 1]) {\n r[b] += 1;\n }\n }\n }\n }\n return r;\n};\n\n\nexports.GAMMA = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n\n if (number === 0) {\n return error.num;\n }\n\n if (parseInt(number, 10) === number && number < 0) {\n return error.num;\n }\n\n return jStat.gammafn(number);\n};\n\nexports.GAMMA.DIST = function(value, alpha, beta, cumulative) {\n if (arguments.length !== 4) {\n return error.na;\n }\n\n if (value < 0 || alpha <= 0 || beta <= 0) {\n return error.value;\n }\n\n if ((typeof value !== 'number') || (typeof alpha !== 'number') || (typeof beta !== 'number')) {\n return error.value;\n }\n\n return cumulative ? jStat.gamma.cdf(value, alpha, beta, true) : jStat.gamma.pdf(value, alpha, beta, false);\n};\n\nexports.GAMMA.INV = function(probability, alpha, beta) {\n if (arguments.length !== 3) {\n return error.na;\n }\n\n if (probability < 0 || probability > 1 || alpha <= 0 || beta <= 0) {\n return error.num;\n }\n\n if ((typeof probability !== 'number') || (typeof alpha !== 'number') || (typeof beta !== 'number')) {\n return error.value;\n }\n\n return jStat.gamma.inv(probability, alpha, beta);\n};\n\nexports.GAMMALN = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return jStat.gammaln(number);\n};\n\nexports.GAMMALN.PRECISE = function(x) {\n if (arguments.length !== 1) {\n return error.na;\n }\n\n if (x <= 0) {\n return error.num;\n }\n\n if (typeof x !== 'number') {\n return error.value;\n }\n\n return jStat.gammaln(x);\n};\n\nexports.GAUSS = function(z) {\n z = utils.parseNumber(z);\n if (z instanceof Error) {\n return z;\n }\n return jStat.normal.cdf(z, 0, 1) - 0.5;\n};\n\nexports.GEOMEAN = function() {\n var args = utils.parseNumberArray(utils.flatten(arguments));\n if (args instanceof Error) {\n return args;\n }\n return jStat.geomean(args);\n};\n\nexports.GROWTH = function(known_y, known_x, new_x, use_const) {\n // Credits: Ilmari Karonen (http://stackoverflow.com/questions/14161990/how-to-implement-growth-function-in-javascript)\n\n known_y = utils.parseNumberArray(known_y);\n if (known_y instanceof Error) {\n return known_y;\n }\n\n // Default values for optional parameters:\n var i;\n if (known_x === undefined) {\n known_x = [];\n for (i = 1; i <= known_y.length; i++) {\n known_x.push(i);\n }\n }\n if (new_x === undefined) {\n new_x = [];\n for (i = 1; i <= known_y.length; i++) {\n new_x.push(i);\n }\n }\n\n known_x = utils.parseNumberArray(known_x);\n new_x = utils.parseNumberArray(new_x);\n if (utils.anyIsError(known_x, new_x)) {\n return error.value;\n }\n\n\n if (use_const === undefined) {\n use_const = true;\n }\n\n // Calculate sums over the data:\n var n = known_y.length;\n var avg_x = 0;\n var avg_y = 0;\n var avg_xy = 0;\n var avg_xx = 0;\n for (i = 0; i < n; i++) {\n var x = known_x[i];\n var y = Math.log(known_y[i]);\n avg_x += x;\n avg_y += y;\n avg_xy += x * y;\n avg_xx += x * x;\n }\n avg_x /= n;\n avg_y /= n;\n avg_xy /= n;\n avg_xx /= n;\n\n // Compute linear regression coefficients:\n var beta;\n var alpha;\n if (use_const) {\n beta = (avg_xy - avg_x * avg_y) / (avg_xx - avg_x * avg_x);\n alpha = avg_y - beta * avg_x;\n } else {\n beta = avg_xy / avg_xx;\n alpha = 0;\n }\n\n // Compute and return result array:\n var new_y = [];\n for (i = 0; i < new_x.length; i++) {\n new_y.push(Math.exp(alpha + beta * new_x[i]));\n }\n return new_y;\n};\n\nexports.HARMEAN = function() {\n var range = utils.parseNumberArray(utils.flatten(arguments));\n if (range instanceof Error) {\n return range;\n }\n var n = range.length;\n var den = 0;\n for (var i = 0; i < n; i++) {\n den += 1 / range[i];\n }\n return n / den;\n};\n\nexports.HYPGEOM = {};\n\nexports.HYPGEOM.DIST = function(x, n, M, N, cumulative) {\n x = utils.parseNumber(x);\n n = utils.parseNumber(n);\n M = utils.parseNumber(M);\n N = utils.parseNumber(N);\n if (utils.anyIsError(x, n, M, N)) {\n return error.value;\n }\n\n function pdf(x, n, M, N) {\n return mathTrig.COMBIN(M, x) * mathTrig.COMBIN(N - M, n - x) / mathTrig.COMBIN(N, n);\n }\n\n function cdf(x, n, M, N) {\n var result = 0;\n for (var i = 0; i <= x; i++) {\n result += pdf(i, n, M, N);\n }\n return result;\n }\n\n return (cumulative) ? cdf(x, n, M, N) : pdf(x, n, M, N);\n};\n\nexports.INTERCEPT = function(known_y, known_x) {\n known_y = utils.parseNumberArray(known_y);\n known_x = utils.parseNumberArray(known_x);\n if (utils.anyIsError(known_y, known_x)) {\n return error.value;\n }\n if (known_y.length !== known_x.length) {\n return error.na;\n }\n return exports.FORECAST(0, known_y, known_x);\n};\n\nexports.KURT = function() {\n var range = utils.parseNumberArray(utils.flatten(arguments));\n if (range instanceof Error) {\n return range;\n }\n var mean = jStat.mean(range);\n var n = range.length;\n var sigma = 0;\n for (var i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 4);\n }\n sigma = sigma / Math.pow(jStat.stdev(range, true), 4);\n return ((n * (n + 1)) / ((n - 1) * (n - 2) * (n - 3))) * sigma - 3 * (n - 1) * (n - 1) / ((n - 2) * (n - 3));\n};\n\nexports.LARGE = function(range, k) {\n range = utils.parseNumberArray(utils.flatten(range));\n k = utils.parseNumber(k);\n if (utils.anyIsError(range, k)) {\n return range;\n }\n return range.sort(function(a, b) {\n return b - a;\n })[k - 1];\n};\n\nexports.LINEST = function(data_y, data_x) {\n data_y = utils.parseNumberArray(utils.flatten(data_y));\n data_x = utils.parseNumberArray(utils.flatten(data_x));\n if (utils.anyIsError(data_y, data_x)) {\n return error.value;\n }\n var ymean = jStat.mean(data_y);\n var xmean = jStat.mean(data_x);\n var n = data_x.length;\n var num = 0;\n var den = 0;\n for (var i = 0; i < n; i++) {\n num += (data_x[i] - xmean) * (data_y[i] - ymean);\n den += Math.pow(data_x[i] - xmean, 2);\n }\n var m = num / den;\n var b = ymean - m * xmean;\n return [m, b];\n};\n\n// According to Microsoft:\n// http://office.microsoft.com/en-us/starter-help/logest-function-HP010342665.aspx\n// LOGEST returns are based on the following linear model:\n// ln y = x1 ln m1 + ... + xn ln mn + ln b\nexports.LOGEST = function(data_y, data_x) {\n data_y = utils.parseNumberArray(utils.flatten(data_y));\n data_x = utils.parseNumberArray(utils.flatten(data_x));\n if (utils.anyIsError(data_y, data_x)) {\n return error.value;\n }\n for (var i = 0; i < data_y.length; i ++) {\n data_y[i] = Math.log(data_y[i]);\n }\n\n var result = exports.LINEST(data_y, data_x);\n result[0] = Math.round(Math.exp(result[0])*1000000)/1000000;\n result[1] = Math.round(Math.exp(result[1])*1000000)/1000000;\n return result;\n};\n\nexports.LOGNORM = {};\n\nexports.LOGNORM.DIST = function(x, mean, sd, cumulative) {\n x = utils.parseNumber(x);\n mean = utils.parseNumber(mean);\n sd = utils.parseNumber(sd);\n if (utils.anyIsError(x, mean, sd)) {\n return error.value;\n }\n return (cumulative) ? jStat.lognormal.cdf(x, mean, sd) : jStat.lognormal.pdf(x, mean, sd);\n};\n\nexports.LOGNORM.INV = function(probability, mean, sd) {\n probability = utils.parseNumber(probability);\n mean = utils.parseNumber(mean);\n sd = utils.parseNumber(sd);\n if (utils.anyIsError(probability, mean, sd)) {\n return error.value;\n }\n return jStat.lognormal.inv(probability, mean, sd);\n};\n\nexports.MAX = function() {\n var range = utils.numbers(utils.flatten(arguments));\n return (range.length === 0) ? 0 : Math.max.apply(Math, range);\n};\n\nexports.MAXA = function() {\n var range = utils.arrayValuesToNumbers(utils.flatten(arguments));\n return (range.length === 0) ? 0 : Math.max.apply(Math, range);\n};\n\nexports.MEDIAN = function() {\n var range = utils.arrayValuesToNumbers(utils.flatten(arguments));\n var result = jStat.median(range);\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.MIN = function() {\n var range = utils.numbers(utils.flatten(arguments));\n return (range.length === 0) ? 0 : Math.min.apply(Math, range);\n};\n\nexports.MINA = function() {\n var range = utils.arrayValuesToNumbers(utils.flatten(arguments));\n return (range.length === 0) ? 0 : Math.min.apply(Math, range);\n};\n\nexports.MODE = {};\n\nexports.MODE.MULT = function() {\n // Credits: Roönaän\n var range = utils.parseNumberArray(utils.flatten(arguments));\n if (range instanceof Error) {\n return range;\n }\n var n = range.length;\n var count = {};\n var maxItems = [];\n var max = 0;\n var currentItem;\n\n for (var i = 0; i < n; i++) {\n currentItem = range[i];\n count[currentItem] = count[currentItem] ? count[currentItem] + 1 : 1;\n if (count[currentItem] > max) {\n max = count[currentItem];\n maxItems = [];\n }\n if (count[currentItem] === max) {\n maxItems[maxItems.length] = currentItem;\n }\n }\n return maxItems;\n};\n\nexports.MODE.SNGL = function() {\n var range = utils.parseNumberArray(utils.flatten(arguments));\n if (range instanceof Error) {\n return range;\n }\n return exports.MODE.MULT(range).sort(function(a, b) {\n return a - b;\n })[0];\n};\n\nexports.NEGBINOM = {};\n\nexports.NEGBINOM.DIST = function(k, r, p, cumulative) {\n k = utils.parseNumber(k);\n r = utils.parseNumber(r);\n p = utils.parseNumber(p);\n if (utils.anyIsError(k, r, p)) {\n return error.value;\n }\n return (cumulative) ? jStat.negbin.cdf(k, r, p) : jStat.negbin.pdf(k, r, p);\n};\n\nexports.NORM = {};\n\nexports.NORM.DIST = function(x, mean, sd, cumulative) {\n x = utils.parseNumber(x);\n mean = utils.parseNumber(mean);\n sd = utils.parseNumber(sd);\n if (utils.anyIsError(x, mean, sd)) {\n return error.value;\n }\n if (sd <= 0) {\n return error.num;\n }\n\n // Return normal distribution computed by jStat [http://jstat.org]\n return (cumulative) ? jStat.normal.cdf(x, mean, sd) : jStat.normal.pdf(x, mean, sd);\n};\n\nexports.NORM.INV = function(probability, mean, sd) {\n probability = utils.parseNumber(probability);\n mean = utils.parseNumber(mean);\n sd = utils.parseNumber(sd);\n if (utils.anyIsError(probability, mean, sd)) {\n return error.value;\n }\n return jStat.normal.inv(probability, mean, sd);\n};\n\nexports.NORM.S = {};\n\nexports.NORM.S.DIST = function(z, cumulative) {\n z = utils.parseNumber(z);\n if (z instanceof Error) {\n return error.value;\n }\n return (cumulative) ? jStat.normal.cdf(z, 0, 1) : jStat.normal.pdf(z, 0, 1);\n};\n\nexports.NORM.S.INV = function(probability) {\n probability = utils.parseNumber(probability);\n if (probability instanceof Error) {\n return error.value;\n }\n return jStat.normal.inv(probability, 0, 1);\n};\n\nexports.PEARSON = function(data_x, data_y) {\n data_y = utils.parseNumberArray(utils.flatten(data_y));\n data_x = utils.parseNumberArray(utils.flatten(data_x));\n if (utils.anyIsError(data_y, data_x)) {\n return error.value;\n }\n var xmean = jStat.mean(data_x);\n var ymean = jStat.mean(data_y);\n var n = data_x.length;\n var num = 0;\n var den1 = 0;\n var den2 = 0;\n for (var i = 0; i < n; i++) {\n num += (data_x[i] - xmean) * (data_y[i] - ymean);\n den1 += Math.pow(data_x[i] - xmean, 2);\n den2 += Math.pow(data_y[i] - ymean, 2);\n }\n return num / Math.sqrt(den1 * den2);\n};\n\nexports.PERCENTILE = {};\n\nexports.PERCENTILE.EXC = function(array, k) {\n array = utils.parseNumberArray(utils.flatten(array));\n k = utils.parseNumber(k);\n if (utils.anyIsError(array, k)) {\n return error.value;\n }\n array = array.sort(function(a, b) {\n {\n return a - b;\n }\n });\n var n = array.length;\n if (k < 1 / (n + 1) || k > 1 - 1 / (n + 1)) {\n return error.num;\n }\n var l = k * (n + 1) - 1;\n var fl = Math.floor(l);\n return utils.cleanFloat((l === fl) ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]));\n};\n\nexports.PERCENTILE.INC = function(array, k) {\n array = utils.parseNumberArray(utils.flatten(array));\n k = utils.parseNumber(k);\n if (utils.anyIsError(array, k)) {\n return error.value;\n }\n array = array.sort(function(a, b) {\n return a - b;\n });\n var n = array.length;\n var l = k * (n - 1);\n var fl = Math.floor(l);\n return utils.cleanFloat((l === fl) ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]));\n};\n\nexports.PERCENTRANK = {};\n\nexports.PERCENTRANK.EXC = function(array, x, significance) {\n significance = (significance === undefined) ? 3 : significance;\n array = utils.parseNumberArray(utils.flatten(array));\n x = utils.parseNumber(x);\n significance = utils.parseNumber(significance);\n if (utils.anyIsError(array, x, significance)) {\n return error.value;\n }\n array = array.sort(function(a, b) {\n return a - b;\n });\n var uniques = misc.UNIQUE.apply(null, array);\n var n = array.length;\n var m = uniques.length;\n var power = Math.pow(10, significance);\n var result = 0;\n var match = false;\n var i = 0;\n while (!match && i < m) {\n if (x === uniques[i]) {\n result = (array.indexOf(uniques[i]) + 1) / (n + 1);\n match = true;\n } else if (x >= uniques[i] && (x < uniques[i + 1] || i === m - 1)) {\n result = (array.indexOf(uniques[i]) + 1 + (x - uniques[i]) / (uniques[i + 1] - uniques[i])) / (n + 1);\n match = true;\n }\n i++;\n }\n return Math.floor(result * power) / power;\n};\n\nexports.PERCENTRANK.INC = function(array, x, significance) {\n significance = (significance === undefined) ? 3 : significance;\n array = utils.parseNumberArray(utils.flatten(array));\n x = utils.parseNumber(x);\n significance = utils.parseNumber(significance);\n if (utils.anyIsError(array, x, significance)) {\n return error.value;\n }\n array = array.sort(function(a, b) {\n return a - b;\n });\n var uniques = misc.UNIQUE.apply(null, array);\n var n = array.length;\n var m = uniques.length;\n var power = Math.pow(10, significance);\n var result = 0;\n var match = false;\n var i = 0;\n while (!match && i < m) {\n if (x === uniques[i]) {\n result = array.indexOf(uniques[i]) / (n - 1);\n match = true;\n } else if (x >= uniques[i] && (x < uniques[i + 1] || i === m - 1)) {\n result = (array.indexOf(uniques[i]) + (x - uniques[i]) / (uniques[i + 1] - uniques[i])) / (n - 1);\n match = true;\n }\n i++;\n }\n return Math.floor(result * power) / power;\n};\n\nexports.PERMUT = function(number, number_chosen) {\n number = utils.parseNumber(number);\n number_chosen = utils.parseNumber(number_chosen);\n if (utils.anyIsError(number, number_chosen)) {\n return error.value;\n }\n return mathTrig.FACT(number) / mathTrig.FACT(number - number_chosen);\n};\n\nexports.PERMUTATIONA = function(number, number_chosen) {\n number = utils.parseNumber(number);\n number_chosen = utils.parseNumber(number_chosen);\n if (utils.anyIsError(number, number_chosen)) {\n return error.value;\n }\n return Math.pow(number, number_chosen);\n};\n\nexports.PHI = function(x) {\n x = utils.parseNumber(x);\n if (x instanceof Error) {\n return error.value;\n }\n return Math.exp(-0.5 * x * x) / SQRT2PI;\n};\n\nexports.POISSON = {};\n\nexports.POISSON.DIST = function(x, mean, cumulative) {\n x = utils.parseNumber(x);\n mean = utils.parseNumber(mean);\n if (utils.anyIsError(x, mean)) {\n return error.value;\n }\n return (cumulative) ? jStat.poisson.cdf(x, mean) : jStat.poisson.pdf(x, mean);\n};\n\nexports.PROB = function(range, probability, lower, upper) {\n if (lower === undefined) {\n return 0;\n }\n upper = (upper === undefined) ? lower : upper;\n\n range = utils.parseNumberArray(utils.flatten(range));\n probability = utils.parseNumberArray(utils.flatten(probability));\n lower = utils.parseNumber(lower);\n upper = utils.parseNumber(upper);\n if (utils.anyIsError(range, probability, lower, upper)) {\n return error.value;\n }\n\n if (lower === upper) {\n return (range.indexOf(lower) >= 0) ? probability[range.indexOf(lower)] : 0;\n }\n\n var sorted = range.sort(function(a, b) {\n return a - b;\n });\n var n = sorted.length;\n var result = 0;\n for (var i = 0; i < n; i++) {\n if (sorted[i] >= lower && sorted[i] <= upper) {\n result += probability[range.indexOf(sorted[i])];\n }\n }\n return result;\n};\n\nexports.QUARTILE = {};\n\nexports.QUARTILE.EXC = function(range, quart) {\n range = utils.parseNumberArray(utils.flatten(range));\n quart = utils.parseNumber(quart);\n if (utils.anyIsError(range, quart)) {\n return error.value;\n }\n switch (quart) {\n case 1:\n return exports.PERCENTILE.EXC(range, 0.25);\n case 2:\n return exports.PERCENTILE.EXC(range, 0.5);\n case 3:\n return exports.PERCENTILE.EXC(range, 0.75);\n default:\n return error.num;\n }\n};\n\nexports.QUARTILE.INC = function(range, quart) {\n range = utils.parseNumberArray(utils.flatten(range));\n quart = utils.parseNumber(quart);\n if (utils.anyIsError(range, quart)) {\n return error.value;\n }\n switch (quart) {\n case 1:\n return exports.PERCENTILE.INC(range, 0.25);\n case 2:\n return exports.PERCENTILE.INC(range, 0.5);\n case 3:\n return exports.PERCENTILE.INC(range, 0.75);\n default:\n return error.num;\n }\n};\n\nexports.RANK = {};\n\nexports.RANK.AVG = function(number, range, order) {\n number = utils.parseNumber(number);\n range = utils.parseNumberArray(utils.flatten(range));\n if (utils.anyIsError(number, range)) {\n return error.value;\n }\n range = utils.flatten(range);\n order = order || false;\n var sort = (order) ? function(a, b) {\n return a - b;\n } : function(a, b) {\n return b - a;\n };\n range = range.sort(sort);\n\n var length = range.length;\n var count = 0;\n for (var i = 0; i < length; i++) {\n if (range[i] === number) {\n count++;\n }\n }\n\n return (count > 1) ? (2 * range.indexOf(number) + count + 1) / 2 : range.indexOf(number) + 1;\n};\n\nexports.RANK.EQ = function(number, range, order) {\n number = utils.parseNumber(number);\n range = utils.parseNumberArray(utils.flatten(range));\n if (utils.anyIsError(number, range)) {\n return error.value;\n }\n order = order || false;\n var sort = (order) ? function(a, b) {\n return a - b;\n } : function(a, b) {\n return b - a;\n };\n range = range.sort(sort);\n return range.indexOf(number) + 1;\n};\n\nexports.ROW = function(matrix, index) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n if (index < 0) {\n return error.num;\n }\n\n if (!(matrix instanceof Array) || (typeof index !== 'number')) {\n return error.value;\n }\n\n if (matrix.length === 0) {\n return undefined;\n }\n\n return jStat.row(matrix, index);\n};\n\nexports.ROWS = function(matrix) {\n if (arguments.length !== 1) {\n return error.na;\n }\n\n if (!(matrix instanceof Array)) {\n return error.value;\n }\n\n if (matrix.length === 0) {\n return 0;\n }\n\n return jStat.rows(matrix);\n};\n\nexports.RSQ = function(data_x, data_y) { // no need to flatten here, PEARSON will take care of that\n data_x = utils.parseNumberArray(utils.flatten(data_x));\n data_y = utils.parseNumberArray(utils.flatten(data_y));\n if (utils.anyIsError(data_x, data_y)) {\n return error.value;\n }\n return Math.pow(exports.PEARSON(data_x, data_y), 2);\n};\n\nexports.SKEW = function() {\n var range = utils.parseNumberArray(utils.flatten(arguments));\n if (range instanceof Error) {\n return range;\n }\n var mean = jStat.mean(range);\n var n = range.length;\n var sigma = 0;\n for (var i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 3);\n }\n return n * sigma / ((n - 1) * (n - 2) * Math.pow(jStat.stdev(range, true), 3));\n};\n\nexports.SKEW.P = function() {\n var range = utils.parseNumberArray(utils.flatten(arguments));\n if (range instanceof Error) {\n return range;\n }\n var mean = jStat.mean(range);\n var n = range.length;\n var m2 = 0;\n var m3 = 0;\n for (var i = 0; i < n; i++) {\n m3 += Math.pow(range[i] - mean, 3);\n m2 += Math.pow(range[i] - mean, 2);\n }\n m3 = m3 / n;\n m2 = m2 / n;\n return m3 / Math.pow(m2, 3 / 2);\n};\n\nexports.SLOPE = function(data_y, data_x) {\n data_y = utils.parseNumberArray(utils.flatten(data_y));\n data_x = utils.parseNumberArray(utils.flatten(data_x));\n if (utils.anyIsError(data_y, data_x)) {\n return error.value;\n }\n var xmean = jStat.mean(data_x);\n var ymean = jStat.mean(data_y);\n var n = data_x.length;\n var num = 0;\n var den = 0;\n for (var i = 0; i < n; i++) {\n num += (data_x[i] - xmean) * (data_y[i] - ymean);\n den += Math.pow(data_x[i] - xmean, 2);\n }\n return num / den;\n};\n\nexports.SMALL = function(range, k) {\n range = utils.parseNumberArray(utils.flatten(range));\n k = utils.parseNumber(k);\n if (utils.anyIsError(range, k)) {\n return range;\n }\n return range.sort(function(a, b) {\n return a - b;\n })[k - 1];\n};\n\nexports.STANDARDIZE = function(x, mean, sd) {\n x = utils.parseNumber(x);\n mean = utils.parseNumber(mean);\n sd = utils.parseNumber(sd);\n if (utils.anyIsError(x, mean, sd)) {\n return error.value;\n }\n return (x - mean) / sd;\n};\n\nexports.STDEV = {};\n\nexports.STDEV.P = function() {\n var v = exports.VAR.P.apply(this, arguments);\n var result = Math.sqrt(v);\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.STDEV.S = function() {\n var v = exports.VAR.S.apply(this, arguments);\n var result = Math.sqrt(v);\n\n return result;\n};\n\nexports.STDEVA = function() {\n var v = exports.VARA.apply(this, arguments);\n var result = Math.sqrt(v);\n\n return result;\n};\n\nexports.STDEVPA = function() {\n var v = exports.VARPA.apply(this, arguments);\n var result = Math.sqrt(v);\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\n\nexports.STEYX = function(data_y, data_x) {\n data_y = utils.parseNumberArray(utils.flatten(data_y));\n data_x = utils.parseNumberArray(utils.flatten(data_x));\n if (utils.anyIsError(data_y, data_x)) {\n return error.value;\n }\n var xmean = jStat.mean(data_x);\n var ymean = jStat.mean(data_y);\n var n = data_x.length;\n var lft = 0;\n var num = 0;\n var den = 0;\n for (var i = 0; i < n; i++) {\n lft += Math.pow(data_y[i] - ymean, 2);\n num += (data_x[i] - xmean) * (data_y[i] - ymean);\n den += Math.pow(data_x[i] - xmean, 2);\n }\n return Math.sqrt((lft - num * num / den) / (n - 2));\n};\n\nexports.TRANSPOSE = function(matrix) {\n if (!matrix) {\n return error.na;\n }\n return jStat.transpose(matrix);\n};\n\nexports.T = text.T;\n\nexports.T.DIST = function(x, df, cumulative) {\n x = utils.parseNumber(x);\n df = utils.parseNumber(df);\n if (utils.anyIsError(x, df)) {\n return error.value;\n }\n return (cumulative) ? jStat.studentt.cdf(x, df) : jStat.studentt.pdf(x, df);\n};\n\nexports.T.DIST['2T'] = function(x, df) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n if (x < 0 || df < 1) {\n return error.num;\n }\n\n if ((typeof x !== 'number') || (typeof df !== 'number')) {\n return error.value;\n }\n\n return (1 - jStat.studentt.cdf(x , df)) * 2;\n};\n\nexports.T.DIST.RT = function(x, df) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n if (x < 0 || df < 1) {\n return error.num;\n }\n\n if ((typeof x !== 'number') || (typeof df !== 'number')) {\n return error.value;\n }\n\n return 1 - jStat.studentt.cdf(x , df);\n};\n\nexports.T.INV = function(probability, df) {\n probability = utils.parseNumber(probability);\n df = utils.parseNumber(df);\n if (utils.anyIsError(probability, df)) {\n return error.value;\n }\n return jStat.studentt.inv(probability, df);\n};\n\nexports.T.INV['2T'] = function(probability, df) {\n probability = utils.parseNumber(probability);\n df = utils.parseNumber(df);\n if (probability <= 0 || probability > 1 || df < 1) {\n return error.num;\n }\n if (utils.anyIsError(probability, df)) {\n return error.value;\n }\n return Math.abs(jStat.studentt.inv(probability/2, df));\n};\n\n// The algorithm can be found here:\n// http://www.chem.uoa.gr/applets/AppletTtest/Appl_Ttest2.html\nexports.T.TEST = function(data_x, data_y) {\n data_x = utils.parseNumberArray(utils.flatten(data_x));\n data_y = utils.parseNumberArray(utils.flatten(data_y));\n if (utils.anyIsError(data_x, data_y)) {\n return error.value;\n }\n\n var mean_x = jStat.mean(data_x);\n var mean_y = jStat.mean(data_y);\n var s_x = 0;\n var s_y = 0;\n var i;\n\n for (i = 0; i < data_x.length; i++) {\n s_x += Math.pow(data_x[i] - mean_x, 2);\n }\n for (i = 0; i < data_y.length; i++) {\n s_y += Math.pow(data_y[i] - mean_y, 2);\n }\n\n s_x = s_x / (data_x.length-1);\n s_y = s_y / (data_y.length-1);\n\n var t = Math.abs(mean_x - mean_y) / Math.sqrt(s_x/data_x.length + s_y/data_y.length);\n\n return exports.T.DIST['2T'](t, data_x.length+data_y.length-2);\n};\n\nexports.TREND = function(data_y, data_x, new_data_x) {\n data_y = utils.parseNumberArray(utils.flatten(data_y));\n data_x = utils.parseNumberArray(utils.flatten(data_x));\n new_data_x = utils.parseNumberArray(utils.flatten(new_data_x));\n if (utils.anyIsError(data_y, data_x, new_data_x)) {\n return error.value;\n }\n var linest = exports.LINEST(data_y, data_x);\n var m = linest[0];\n var b = linest[1];\n var result = [];\n\n new_data_x.forEach(function(x) {\n result.push(m * x + b);\n });\n\n return result;\n};\n\nexports.TRIMMEAN = function(range, percent) {\n range = utils.parseNumberArray(utils.flatten(range));\n percent = utils.parseNumber(percent);\n if (utils.anyIsError(range, percent)) {\n return error.value;\n }\n var trim = mathTrig.FLOOR(range.length * percent, 2) / 2;\n return jStat.mean(utils.initial(utils.rest(range.sort(function(a, b) {\n return a - b;\n }), trim), trim));\n};\n\nexports.VAR = {};\n\nexports.VAR.P = function() {\n var range = utils.numbers(utils.flatten(arguments));\n var n = range.length;\n var sigma = 0;\n var mean = exports.AVERAGE(range);\n var result;\n for (var i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 2);\n }\n result = sigma / n;\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.VAR.S = function() {\n var range = utils.numbers(utils.flatten(arguments));\n var n = range.length;\n var sigma = 0;\n var mean = exports.AVERAGE(range);\n for (var i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 2);\n }\n return sigma / (n - 1);\n};\n\nexports.VARA = function() {\n var range = utils.flatten(arguments);\n var n = range.length;\n var sigma = 0;\n var count = 0;\n var mean = exports.AVERAGEA(range);\n for (var i = 0; i < n; i++) {\n var el = range[i];\n if (typeof el === 'number') {\n sigma += Math.pow(el - mean, 2);\n } else if (el === true) {\n sigma += Math.pow(1 - mean, 2);\n } else {\n sigma += Math.pow(0 - mean, 2);\n }\n\n if (el !== null) {\n count++;\n }\n }\n return sigma / (count - 1);\n};\n\nexports.VARPA = function() {\n var range = utils.flatten(arguments);\n var n = range.length;\n var sigma = 0;\n var count = 0;\n var mean = exports.AVERAGEA(range);\n var result;\n for (var i = 0; i < n; i++) {\n var el = range[i];\n if (typeof el === 'number') {\n sigma += Math.pow(el - mean, 2);\n } else if (el === true) {\n sigma += Math.pow(1 - mean, 2);\n } else {\n sigma += Math.pow(0 - mean, 2);\n }\n\n if (el !== null) {\n count++;\n }\n }\n result = sigma / count;;\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.WEIBULL = {};\n\nexports.WEIBULL.DIST = function(x, alpha, beta, cumulative) {\n x = utils.parseNumber(x);\n alpha = utils.parseNumber(alpha);\n beta = utils.parseNumber(beta);\n if (utils.anyIsError(x, alpha, beta)) {\n return error.value;\n }\n return (cumulative) ? 1 - Math.exp(-Math.pow(x / beta, alpha)) : Math.pow(x, alpha - 1) * Math.exp(-Math.pow(x / beta, alpha)) * alpha / Math.pow(beta, alpha);\n};\n\nexports.Z = {};\n\nexports.Z.TEST = function(range, x, sd) {\n range = utils.parseNumberArray(utils.flatten(range));\n x = utils.parseNumber(x);\n if (utils.anyIsError(range, x)) {\n return error.value;\n }\n\n sd = sd || exports.STDEV.S(range);\n var n = range.length;\n return 1 - exports.NORM.S.DIST((exports.AVERAGE(range) - x) / (sd / Math.sqrt(n)), true);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/statistical.js\n ** module id = 17\n ** module chunks = 0\n **/","var utils = require('./utils');\nvar error = require('./error');\nvar numbro = require('numbro');\n\n//TODO\nexports.ASC = function() {\n throw new Error('ASC is not implemented');\n};\n\n//TODO\nexports.BAHTTEXT = function() {\n throw new Error('BAHTTEXT is not implemented');\n};\n\nexports.CHAR = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return String.fromCharCode(number);\n};\n\nexports.CLEAN = function(text) {\n text = text || '';\n var re = /[\\0-\\x1F]/g;\n return text.replace(re, \"\");\n};\n\nexports.CODE = function(text) {\n text = text || '';\n var result = text.charCodeAt(0);\n\n if (isNaN(result)) {\n result = error.na;\n }\n return result;\n};\n\nexports.CONCATENATE = function() {\n var args = utils.flatten(arguments);\n\n var trueFound = 0;\n while ((trueFound = args.indexOf(true)) > -1) {\n args[trueFound] = 'TRUE';\n }\n\n var falseFound = 0;\n while ((falseFound = args.indexOf(false)) > -1) {\n args[falseFound] = 'FALSE';\n }\n\n return args.join('');\n};\n\n//TODO\nexports.DBCS = function() {\n throw new Error('DBCS is not implemented');\n};\n\nexports.DOLLAR = function(number, decimals) {\n decimals = (decimals === undefined) ? 2 : decimals;\n\n number = utils.parseNumber(number);\n decimals = utils.parseNumber(decimals);\n if (utils.anyIsError(number, decimals)) {\n return error.value;\n }\n var format = '';\n if (decimals <= 0) {\n number = Math.round(number * Math.pow(10, decimals)) / Math.pow(10, decimals);\n format = '($0,0)';\n } else if (decimals > 0) {\n format = '($0,0.' + new Array(decimals + 1).join('0') + ')';\n }\n return numbro(number).format(format);\n};\n\nexports.EXACT = function(text1, text2) {\n if (arguments.length !== 2) {\n return error.na;\n }\n return text1 === text2;\n};\n\nexports.FIND = function(find_text, within_text, position) {\n if (arguments.length < 2) {\n return error.na;\n }\n position = (position === undefined) ? 0 : position;\n return within_text ? within_text.indexOf(find_text, position - 1) + 1 : null;\n};\n\nexports.FIXED = function(number, decimals, no_commas) {\n decimals = (decimals === undefined) ? 2 : decimals;\n no_commas = (no_commas === undefined) ? false : no_commas;\n\n number = utils.parseNumber(number);\n decimals = utils.parseNumber(decimals);\n if (utils.anyIsError(number, decimals)) {\n return error.value;\n }\n\n var format = no_commas ? '0' : '0,0';\n if (decimals <= 0) {\n number = Math.round(number * Math.pow(10, decimals)) / Math.pow(10, decimals);\n } else if (decimals > 0) {\n format += '.' + new Array(decimals + 1).join('0');\n }\n return numbro(number).format(format);\n};\n\nexports.HTML2TEXT = function (value) {\n var result = '';\n\n if (value) {\n if (value instanceof Array) {\n value.forEach(function (line) {\n if (result !== '') {\n result += '\\n';\n }\n result += (line.replace(/<(?:.|\\n)*?>/gm, ''));\n });\n } else {\n result = value.replace(/<(?:.|\\n)*?>/gm, '');\n }\n }\n\n return result;\n};\n\nexports.LEFT = function(text, number) {\n number = (number === undefined) ? 1 : number;\n number = utils.parseNumber(number);\n if (number instanceof Error || typeof text !== 'string') {\n return error.value;\n }\n return text ? text.substring(0, number) : null;\n};\n\nexports.LEN = function(text) {\n if (arguments.length === 0) {\n return error.error;\n }\n\n if (typeof text === 'string') {\n return text ? text.length : 0;\n }\n\n if (text.length) {\n return text.length;\n }\n\n return error.value;\n};\n\nexports.LOWER = function(text) {\n if (typeof text !== 'string') {\n return error.value;\n }\n return text ? text.toLowerCase() : text;\n};\n\nexports.MID = function(text, start, number) {\n start = utils.parseNumber(start);\n number = utils.parseNumber(number);\n if (utils.anyIsError(start, number) || typeof text !== 'string') {\n return number;\n }\n\n var begin = start - 1;\n var end = begin + number;\n\n return text.substring(begin, end);\n};\n\n// TODO\nexports.NUMBERVALUE = function (text, decimal_separator, group_separator) {\n decimal_separator = (typeof decimal_separator === 'undefined') ? '.' : decimal_separator;\n group_separator = (typeof group_separator === 'undefined') ? ',' : group_separator;\n return Number(text.replace(decimal_separator, '.').replace(group_separator, ''));\n};\n\n// TODO\nexports.PRONETIC = function() {\n throw new Error('PRONETIC is not implemented');\n};\n\nexports.PROPER = function(text) {\n if (text === undefined || text.length === 0) {\n return error.value;\n }\n if (text === true) {\n text = 'TRUE';\n }\n if (text === false) {\n text = 'FALSE';\n }\n if (isNaN(text) && typeof text === 'number') {\n return error.value;\n }\n if (typeof text === 'number') {\n text = '' + text;\n }\n\n return text.replace(/\\w\\S*/g, function(txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n};\n\nexports.REGEXEXTRACT = function (text, regular_expression) {\n if (arguments.length < 2) {\n return error.na;\n }\n var match = text.match(new RegExp(regular_expression));\n return match ? (match[match.length > 1 ? match.length - 1 : 0]) : null;\n};\n\nexports.REGEXMATCH = function (text, regular_expression, full) {\n if (arguments.length < 2) {\n return error.na;\n }\n var match = text.match(new RegExp(regular_expression));\n return full ? match : !!match;\n};\n\nexports.REGEXREPLACE = function (text, regular_expression, replacement) {\n if (arguments.length < 3) {\n return error.na;\n }\n return text.replace(new RegExp(regular_expression), replacement);\n};\n\nexports.REPLACE = function(text, position, length, new_text) {\n position = utils.parseNumber(position);\n length = utils.parseNumber(length);\n if (utils.anyIsError(position, length) ||\n typeof text !== 'string' ||\n typeof new_text !== 'string') {\n return error.value;\n }\n return text.substr(0, position - 1) + new_text + text.substr(position - 1 + length);\n};\n\nexports.REPT = function(text, number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return new Array(number + 1).join(text);\n};\n\nexports.RIGHT = function(text, number) {\n number = (number === undefined) ? 1 : number;\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return text ? text.substring(text.length - number) : error.na;\n};\n\nexports.SEARCH = function(find_text, within_text, position) {\n var foundAt;\n if (typeof find_text !== 'string' || typeof within_text !== 'string') {\n return error.value;\n }\n position = (position === undefined) ? 0 : position;\n foundAt = within_text.toLowerCase().indexOf(find_text.toLowerCase(), position - 1)+1;\n return (foundAt === 0)?error.value:foundAt;\n};\n\nexports.SPLIT = function (text, separator) {\n return text.split(separator);\n};\n\nexports.SUBSTITUTE = function(text, old_text, new_text, occurrence) {\n if (arguments.length < 2) {\n return error.na;\n }\n if (!text || !old_text || !new_text) {\n return text;\n } else if (occurrence === undefined) {\n return text.replace(new RegExp(old_text, 'g'), new_text);\n } else {\n var index = 0;\n var i = 0;\n while (text.indexOf(old_text, index) > 0) {\n index = text.indexOf(old_text, index + 1);\n i++;\n if (i === occurrence) {\n return text.substring(0, index) + new_text + text.substring(index + old_text.length);\n }\n }\n }\n};\n\nexports.T = function(value) {\n return (typeof value === \"string\") ? value : '';\n};\n\n// TODO incomplete implementation\nexports.TEXT = function(value, format) {\n value = utils.parseNumber(value);\n if (utils.anyIsError(value)) {\n return error.na;\n }\n\n return numbro(value).format(format);\n};\n\nexports.TRIM = function(text) {\n if (typeof text !== 'string') {\n return error.value;\n }\n return text.replace(/ +/g, ' ').trim();\n};\n\nexports.UNICHAR = exports.CHAR;\n\nexports.UNICODE = exports.CODE;\n\nexports.UPPER = function(text) {\n if (typeof text !== 'string') {\n return error.value;\n }\n return text.toUpperCase();\n};\n\nexports.VALUE = function(text) {\n if (typeof text !== 'string') {\n return error.value;\n }\n var result = numbro().unformat(text);\n\n return result === void 0 ? 0 : result;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/text.js\n ** module id = 18\n ** module chunks = 0\n **/","/*!\n * numbro.js\n * version : 1.8.0\n * author : Företagsplatsen AB\n * license : MIT\n * http://www.foretagsplatsen.se\n */\n\n(function () {\n 'use strict';\n\n /************************************\n Constants\n ************************************/\n\n var numbro,\n VERSION = '1.8.0',\n binarySuffixes = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'],\n decimalSuffixes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],\n bytes = {\n general: { scale: 1024, suffixes: decimalSuffixes, marker: 'bd' },\n binary: { scale: 1024, suffixes: binarySuffixes, marker: 'b' },\n decimal: { scale: 1000, suffixes: decimalSuffixes, marker: 'd' }\n },\n // general must be before the others because it reuses their characters!\n byteFormatOrder = [ bytes.general, bytes.binary, bytes.decimal ],\n // internal storage for culture config files\n cultures = {},\n // Todo: Remove in 2.0.0\n languages = cultures,\n currentCulture = 'en-US',\n zeroFormat = null,\n defaultFormat = '0,0',\n defaultCurrencyFormat = '0$',\n // check for nodeJS\n hasModule = (typeof module !== 'undefined' && module.exports),\n // default culture\n enUS = {\n delimiters: {\n thousands: ',',\n decimal: '.'\n },\n abbreviations: {\n thousand: 'k',\n million: 'm',\n billion: 'b',\n trillion: 't'\n },\n ordinal: function(number) {\n var b = number % 10;\n return (~~(number % 100 / 10) === 1) ? 'th' :\n (b === 1) ? 'st' :\n (b === 2) ? 'nd' :\n (b === 3) ? 'rd' : 'th';\n },\n currency: {\n symbol: '$',\n position: 'prefix'\n },\n defaults: {\n currencyFormat: ',0000 a'\n },\n formats: {\n fourDigits: '0000 a',\n fullWithTwoDecimals: '$ ,0.00',\n fullWithTwoDecimalsNoCurrency: ',0.00'\n }\n };\n\n /************************************\n Constructors\n ************************************/\n\n\n // Numbro prototype object\n function Numbro(number) {\n this._value = number;\n }\n\n function zeroes(count) {\n var i, ret = '';\n\n for (i = 0; i < count; i++) {\n ret += '0';\n }\n\n return ret;\n }\n /**\n * Implementation of toFixed() for numbers with exponents\n * This function may return negative representations for zero values e.g. \"-0.0\"\n */\n function toFixedLargeSmall(value, precision) {\n var mantissa,\n beforeDec,\n afterDec,\n exponent,\n prefix,\n endStr,\n zerosStr,\n str;\n\n str = value.toString();\n\n mantissa = str.split('e')[0];\n exponent = str.split('e')[1];\n\n beforeDec = mantissa.split('.')[0];\n afterDec = mantissa.split('.')[1] || '';\n\n if (+exponent > 0) {\n // exponent is positive - add zeros after the numbers\n str = beforeDec + afterDec + zeroes(exponent - afterDec.length);\n } else {\n // exponent is negative\n\n if (+beforeDec < 0) {\n prefix = '-0';\n } else {\n prefix = '0';\n }\n\n // tack on the decimal point if needed\n if (precision > 0) {\n prefix += '.';\n }\n\n zerosStr = zeroes((-1 * exponent) - 1);\n // substring off the end to satisfy the precision\n endStr = (zerosStr + Math.abs(beforeDec) + afterDec).substr(0, precision);\n str = prefix + endStr;\n }\n\n // only add percision 0's if the exponent is positive\n if (+exponent > 0 && precision > 0) {\n str += '.' + zeroes(precision);\n }\n\n return str;\n }\n\n /**\n * Implementation of toFixed() that treats floats more like decimals\n *\n * Fixes binary rounding issues (eg. (0.615).toFixed(2) === '0.61') that present\n * problems for accounting- and finance-related software.\n *\n * Also removes negative signs for zero-formatted numbers. e.g. -0.01 w/ precision 1 -> 0.0\n */\n function toFixed(value, precision, roundingFunction, optionals) {\n var power = Math.pow(10, precision),\n optionalsRegExp,\n output;\n\n if (value.toString().indexOf('e') > -1) {\n // toFixed returns scientific notation for numbers above 1e21 and below 1e-7\n output = toFixedLargeSmall(value, precision);\n // remove the leading negative sign if it exists and should not be present (e.g. -0.00)\n if (output.charAt(0) === '-' && +output >= 0) {\n output = output.substr(1); // chop off the '-'\n }\n }\n else {\n // Multiply up by precision, round accurately, then divide and use native toFixed():\n output = (roundingFunction(value + 'e+' + precision) / power).toFixed(precision);\n }\n\n if (optionals) {\n optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n output = output.replace(optionalsRegExp, '');\n }\n\n return output;\n }\n\n /************************************\n Formatting\n ************************************/\n\n // determine what type of formatting we need to do\n function formatNumbro(n, format, roundingFunction) {\n var output,\n escapedFormat = format.replace(/\\{[^\\{\\}]*\\}/g, '');\n\n // figure out what kind of format we are dealing with\n if (escapedFormat.indexOf('$') > -1) { // currency!!!!!\n output = formatCurrency(n, format, roundingFunction);\n } else if (escapedFormat.indexOf('%') > -1) { // percentage\n output = formatPercentage(n, format, roundingFunction);\n } else if (escapedFormat.indexOf(':') > -1) { // time\n output = formatTime(n, format);\n } else { // plain ol' numbers or bytes\n output = formatNumber(n._value, format, roundingFunction);\n }\n\n // return string\n return output;\n }\n\n // revert to number\n function unformatNumbro(n, string) {\n var stringOriginal = string,\n thousandRegExp,\n millionRegExp,\n billionRegExp,\n trillionRegExp,\n bytesMultiplier = false,\n power;\n\n if (string.indexOf(':') > -1) {\n n._value = unformatTime(string);\n } else {\n if (string === zeroFormat) {\n n._value = 0;\n } else {\n if (cultures[currentCulture].delimiters.decimal !== '.') {\n string = string.replace(/\\./g, '').replace(cultures[currentCulture].delimiters.decimal, '.');\n }\n\n // see if abbreviations are there so that we can multiply to the correct number\n thousandRegExp = new RegExp('[^a-zA-Z]' + cultures[currentCulture].abbreviations.thousand +\n '(?:\\\\)|(\\\\' + cultures[currentCulture].currency.symbol + ')?(?:\\\\))?)?$');\n millionRegExp = new RegExp('[^a-zA-Z]' + cultures[currentCulture].abbreviations.million +\n '(?:\\\\)|(\\\\' + cultures[currentCulture].currency.symbol + ')?(?:\\\\))?)?$');\n billionRegExp = new RegExp('[^a-zA-Z]' + cultures[currentCulture].abbreviations.billion +\n '(?:\\\\)|(\\\\' + cultures[currentCulture].currency.symbol + ')?(?:\\\\))?)?$');\n trillionRegExp = new RegExp('[^a-zA-Z]' + cultures[currentCulture].abbreviations.trillion +\n '(?:\\\\)|(\\\\' + cultures[currentCulture].currency.symbol + ')?(?:\\\\))?)?$');\n\n // see if bytes are there so that we can multiply to the correct number\n for (power = 1; power < binarySuffixes.length && !bytesMultiplier; ++power) {\n if (string.indexOf(binarySuffixes[power]) > -1) {\n bytesMultiplier = Math.pow(1024, power);\n } else if (string.indexOf(decimalSuffixes[power]) > -1) {\n bytesMultiplier = Math.pow(1000, power);\n }\n }\n\n var str = string.replace(/[^0-9\\.]+/g, '');\n if (str === '') {\n // An empty string is not a number.\n n._value = NaN;\n\n } else {\n // do some math to create our number\n n._value = ((bytesMultiplier) ? bytesMultiplier : 1) *\n ((stringOriginal.match(thousandRegExp)) ? Math.pow(10, 3) : 1) *\n ((stringOriginal.match(millionRegExp)) ? Math.pow(10, 6) : 1) *\n ((stringOriginal.match(billionRegExp)) ? Math.pow(10, 9) : 1) *\n ((stringOriginal.match(trillionRegExp)) ? Math.pow(10, 12) : 1) *\n ((string.indexOf('%') > -1) ? 0.01 : 1) *\n (((string.split('-').length +\n Math.min(string.split('(').length - 1, string.split(')').length - 1)) % 2) ? 1 : -1) *\n Number(str);\n\n // round if we are talking about bytes\n n._value = (bytesMultiplier) ? Math.ceil(n._value) : n._value;\n }\n }\n }\n return n._value;\n }\n\n function formatCurrency(n, originalFormat, roundingFunction) {\n var format = originalFormat,\n symbolIndex = format.indexOf('$'),\n openParenIndex = format.indexOf('('),\n plusSignIndex = format.indexOf('+'),\n minusSignIndex = format.indexOf('-'),\n space = '',\n decimalSeparator = '',\n spliceIndex,\n output;\n\n if(format.indexOf('$') === -1){\n // Use defaults instead of the format provided\n if (cultures[currentCulture].currency.position === 'infix') {\n decimalSeparator = cultures[currentCulture].currency.symbol;\n if (cultures[currentCulture].currency.spaceSeparated) {\n decimalSeparator = ' ' + decimalSeparator + ' ';\n }\n } else if (cultures[currentCulture].currency.spaceSeparated) {\n space = ' ';\n }\n } else {\n // check for space before or after currency\n if (format.indexOf(' $') > -1) {\n space = ' ';\n format = format.replace(' $', '');\n } else if (format.indexOf('$ ') > -1) {\n space = ' ';\n format = format.replace('$ ', '');\n } else {\n format = format.replace('$', '');\n }\n }\n\n // Format The Number\n output = formatNumber(n._value, format, roundingFunction, decimalSeparator);\n\n if (originalFormat.indexOf('$') === -1) {\n // Use defaults instead of the format provided\n switch (cultures[currentCulture].currency.position) {\n case 'postfix':\n if (output.indexOf(')') > -1) {\n output = output.split('');\n output.splice(-1, 0, space + cultures[currentCulture].currency.symbol);\n output = output.join('');\n } else {\n output = output + space + cultures[currentCulture].currency.symbol;\n }\n break;\n case 'infix':\n break;\n case 'prefix':\n if (output.indexOf('(') > -1 || output.indexOf('-') > -1) {\n output = output.split('');\n spliceIndex = Math.max(openParenIndex, minusSignIndex) + 1;\n\n output.splice(spliceIndex, 0, cultures[currentCulture].currency.symbol + space);\n output = output.join('');\n } else {\n output = cultures[currentCulture].currency.symbol + space + output;\n }\n break;\n default:\n throw Error('Currency position should be among [\"prefix\", \"infix\", \"postfix\"]');\n }\n } else {\n // position the symbol\n if (symbolIndex <= 1) {\n if (output.indexOf('(') > -1 || output.indexOf('+') > -1 || output.indexOf('-') > -1) {\n output = output.split('');\n spliceIndex = 1;\n if (symbolIndex < openParenIndex || symbolIndex < plusSignIndex || symbolIndex < minusSignIndex) {\n // the symbol appears before the \"(\", \"+\" or \"-\"\n spliceIndex = 0;\n }\n output.splice(spliceIndex, 0, cultures[currentCulture].currency.symbol + space);\n output = output.join('');\n } else {\n output = cultures[currentCulture].currency.symbol + space + output;\n }\n } else {\n if (output.indexOf(')') > -1) {\n output = output.split('');\n output.splice(-1, 0, space + cultures[currentCulture].currency.symbol);\n output = output.join('');\n } else {\n output = output + space + cultures[currentCulture].currency.symbol;\n }\n }\n }\n\n return output;\n }\n\n function formatPercentage(n, format, roundingFunction) {\n var space = '',\n output,\n value = n._value * 100;\n\n // check for space before %\n if (format.indexOf(' %') > -1) {\n space = ' ';\n format = format.replace(' %', '');\n } else {\n format = format.replace('%', '');\n }\n\n output = formatNumber(value, format, roundingFunction);\n\n if (output.indexOf(')') > -1) {\n output = output.split('');\n output.splice(-1, 0, space + '%');\n output = output.join('');\n } else {\n output = output + space + '%';\n }\n\n return output;\n }\n\n function formatTime(n) {\n var hours = Math.floor(n._value / 60 / 60),\n minutes = Math.floor((n._value - (hours * 60 * 60)) / 60),\n seconds = Math.round(n._value - (hours * 60 * 60) - (minutes * 60));\n return hours + ':' +\n ((minutes < 10) ? '0' + minutes : minutes) + ':' +\n ((seconds < 10) ? '0' + seconds : seconds);\n }\n\n function unformatTime(string) {\n var timeArray = string.split(':'),\n seconds = 0;\n // turn hours and minutes into seconds and add them all up\n if (timeArray.length === 3) {\n // hours\n seconds = seconds + (Number(timeArray[0]) * 60 * 60);\n // minutes\n seconds = seconds + (Number(timeArray[1]) * 60);\n // seconds\n seconds = seconds + Number(timeArray[2]);\n } else if (timeArray.length === 2) {\n // minutes\n seconds = seconds + (Number(timeArray[0]) * 60);\n // seconds\n seconds = seconds + Number(timeArray[1]);\n }\n return Number(seconds);\n }\n\n function formatByteUnits (value, suffixes, scale) {\n var suffix = suffixes[0],\n power,\n min,\n max,\n abs = Math.abs(value);\n\n if (abs >= scale) {\n for (power = 1; power < suffixes.length; ++power) {\n min = Math.pow(scale, power);\n max = Math.pow(scale, power + 1);\n\n if (abs >= min && abs < max) {\n suffix = suffixes[power];\n value = value / min;\n break;\n }\n }\n\n // values greater than or equal to [scale] YB never set the suffix\n if (suffix === suffixes[0]) {\n value = value / Math.pow(scale, suffixes.length - 1);\n suffix = suffixes[suffixes.length - 1];\n }\n }\n\n return { value: value, suffix: suffix };\n }\n\n function formatNumber (value, format, roundingFunction, sep) {\n var negP = false,\n signed = false,\n optDec = false,\n abbr = '',\n abbrK = false, // force abbreviation to thousands\n abbrM = false, // force abbreviation to millions\n abbrB = false, // force abbreviation to billions\n abbrT = false, // force abbreviation to trillions\n abbrForce = false, // force abbreviation\n bytes = '',\n byteFormat,\n units,\n ord = '',\n abs = Math.abs(value),\n totalLength,\n length,\n minimumPrecision,\n pow,\n w,\n intPrecision,\n precision,\n prefix,\n postfix,\n thousands,\n d = '',\n forcedNeg = false,\n neg = false,\n indexOpenP,\n size,\n indexMinus,\n paren = '',\n minlen,\n i;\n\n // check if number is zero and a custom zero format has been set\n if (value === 0 && zeroFormat !== null) {\n return zeroFormat;\n }\n\n if (!isFinite(value)) {\n return '' + value;\n }\n\n if (format.indexOf('{') === 0) {\n var end = format.indexOf('}');\n if (end === -1) {\n throw Error('Format should also contain a \"}\"');\n }\n prefix = format.slice(1, end);\n format = format.slice(end + 1);\n } else {\n prefix = '';\n }\n\n if (format.indexOf('}') === format.length - 1) {\n var start = format.indexOf('{');\n if (start === -1) {\n throw Error('Format should also contain a \"{\"');\n }\n postfix = format.slice(start + 1, -1);\n format = format.slice(0, start + 1);\n } else {\n postfix = '';\n }\n\n // check for min length\n var info;\n if (format.indexOf('.') === -1) {\n info = format.match(/([0-9]+).*/);\n } else {\n info = format.match(/([0-9]+)\\..*/);\n }\n minlen = info === null ? -1 : info[1].length;\n\n // see if we should use parentheses for negative number or if we should prefix with a sign\n // if both are present we default to parentheses\n if (format.indexOf('-') !== -1) {\n forcedNeg = true;\n }\n if (format.indexOf('(') > -1) {\n negP = true;\n format = format.slice(1, -1);\n } else if (format.indexOf('+') > -1) {\n signed = true;\n format = format.replace(/\\+/g, '');\n }\n\n // see if abbreviation is wanted\n if (format.indexOf('a') > -1) {\n intPrecision = format.split('.')[0].match(/[0-9]+/g) || ['0'];\n intPrecision = parseInt(intPrecision[0], 10);\n\n // check if abbreviation is specified\n abbrK = format.indexOf('aK') >= 0;\n abbrM = format.indexOf('aM') >= 0;\n abbrB = format.indexOf('aB') >= 0;\n abbrT = format.indexOf('aT') >= 0;\n abbrForce = abbrK || abbrM || abbrB || abbrT;\n\n // check for space before abbreviation\n if (format.indexOf(' a') > -1) {\n abbr = ' ';\n format = format.replace(' a', '');\n } else {\n format = format.replace('a', '');\n }\n\n totalLength = Math.floor(Math.log(abs) / Math.LN10) + 1;\n\n minimumPrecision = totalLength % 3;\n minimumPrecision = minimumPrecision === 0 ? 3 : minimumPrecision;\n\n if (intPrecision && abs !== 0) {\n\n length = Math.floor(Math.log(abs) / Math.LN10) + 1 - intPrecision;\n\n pow = 3 * ~~((Math.min(intPrecision, totalLength) - minimumPrecision) / 3);\n\n abs = abs / Math.pow(10, pow);\n\n if (format.indexOf('.') === -1 && intPrecision > 3) {\n format += '[.]';\n\n size = length === 0 ? 0 : 3 * ~~(length / 3) - length;\n size = size < 0 ? size + 3 : size;\n\n format += zeroes(size);\n }\n }\n\n if (Math.floor(Math.log(Math.abs(value)) / Math.LN10) + 1 !== intPrecision) {\n if (abs >= Math.pow(10, 12) && !abbrForce || abbrT) {\n // trillion\n abbr = abbr + cultures[currentCulture].abbreviations.trillion;\n value = value / Math.pow(10, 12);\n } else if (abs < Math.pow(10, 12) && abs >= Math.pow(10, 9) && !abbrForce || abbrB) {\n // billion\n abbr = abbr + cultures[currentCulture].abbreviations.billion;\n value = value / Math.pow(10, 9);\n } else if (abs < Math.pow(10, 9) && abs >= Math.pow(10, 6) && !abbrForce || abbrM) {\n // million\n abbr = abbr + cultures[currentCulture].abbreviations.million;\n value = value / Math.pow(10, 6);\n } else if (abs < Math.pow(10, 6) && abs >= Math.pow(10, 3) && !abbrForce || abbrK) {\n // thousand\n abbr = abbr + cultures[currentCulture].abbreviations.thousand;\n value = value / Math.pow(10, 3);\n }\n }\n }\n\n // see if we are formatting\n // binary-decimal bytes (1024 MB), binary bytes (1024 MiB), or decimal bytes (1000 MB)\n for (i = 0; i < byteFormatOrder.length; ++i) {\n byteFormat = byteFormatOrder[i];\n\n if (format.indexOf(byteFormat.marker) > -1) {\n // check for space before\n if (format.indexOf(' ' + byteFormat.marker) >-1) {\n bytes = ' ';\n }\n\n // remove the marker (with the space if it had one)\n format = format.replace(bytes + byteFormat.marker, '');\n\n units = formatByteUnits(value, byteFormat.suffixes, byteFormat.scale);\n\n value = units.value;\n bytes = bytes + units.suffix;\n\n break;\n }\n }\n\n // see if ordinal is wanted\n if (format.indexOf('o') > -1) {\n // check for space before\n if (format.indexOf(' o') > -1) {\n ord = ' ';\n format = format.replace(' o', '');\n } else {\n format = format.replace('o', '');\n }\n\n if (cultures[currentCulture].ordinal) {\n ord = ord + cultures[currentCulture].ordinal(value);\n }\n }\n\n if (format.indexOf('[.]') > -1) {\n optDec = true;\n format = format.replace('[.]', '.');\n }\n\n w = value.toString().split('.')[0];\n precision = format.split('.')[1];\n thousands = format.indexOf(',');\n\n if (precision) {\n if (precision.indexOf('*') !== -1) {\n d = toFixed(value, value.toString().split('.')[1].length, roundingFunction);\n } else {\n if (precision.indexOf('[') > -1) {\n precision = precision.replace(']', '');\n precision = precision.split('[');\n d = toFixed(value, (precision[0].length + precision[1].length), roundingFunction,\n precision[1].length);\n } else {\n d = toFixed(value, precision.length, roundingFunction);\n }\n }\n\n w = d.split('.')[0];\n\n if (d.split('.')[1].length) {\n var p = sep ? abbr + sep : cultures[currentCulture].delimiters.decimal;\n d = p + d.split('.')[1];\n } else {\n d = '';\n }\n\n if (optDec && Number(d.slice(1)) === 0) {\n d = '';\n }\n } else {\n w = toFixed(value, 0, roundingFunction);\n }\n\n // format number\n if (w.indexOf('-') > -1) {\n w = w.slice(1);\n neg = true;\n }\n\n if (w.length < minlen) {\n w = zeroes(minlen - w.length) + w;\n }\n\n if (thousands > -1) {\n w = w.toString().replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, '$1' +\n cultures[currentCulture].delimiters.thousands);\n }\n\n if (format.indexOf('.') === 0) {\n w = '';\n }\n\n indexOpenP = format.indexOf('(');\n indexMinus = format.indexOf('-');\n\n if (indexOpenP < indexMinus) {\n paren = ((negP && neg) ? '(' : '') + (((forcedNeg && neg) || (!negP && neg)) ? '-' : '');\n } else {\n paren = (((forcedNeg && neg) || (!negP && neg)) ? '-' : '') + ((negP && neg) ? '(' : '');\n }\n\n return prefix +\n paren + ((!neg && signed && value !== 0) ? '+' : '') +\n w + d +\n ((ord) ? ord : '') +\n ((abbr && !sep) ? abbr : '') +\n ((bytes) ? bytes : '') +\n ((negP && neg) ? ')' : '') +\n postfix;\n }\n\n /************************************\n Top Level Functions\n ************************************/\n\n numbro = function(input) {\n if (numbro.isNumbro(input)) {\n input = input.value();\n } else if (input === 0 || typeof input === 'undefined') {\n input = 0;\n } else if (!Number(input)) {\n input = numbro.fn.unformat(input);\n }\n\n return new Numbro(Number(input));\n };\n\n // version number\n numbro.version = VERSION;\n\n // compare numbro object\n numbro.isNumbro = function(obj) {\n return obj instanceof Numbro;\n };\n\n /**\n * This function allow the user to set a new language with a fallback if\n * the language does not exist. If no fallback language is provided,\n * it fallbacks to english.\n *\n * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n * `setCulture` should be used instead.\n */\n numbro.setLanguage = function(newLanguage, fallbackLanguage) {\n console.warn('`setLanguage` is deprecated since version 1.6.0. Use `setCulture` instead');\n var key = newLanguage,\n prefix = newLanguage.split('-')[0],\n matchingLanguage = null;\n if (!languages[key]) {\n Object.keys(languages).forEach(function(language) {\n if (!matchingLanguage && language.split('-')[0] === prefix) {\n matchingLanguage = language;\n }\n });\n key = matchingLanguage || fallbackLanguage || 'en-US';\n }\n chooseCulture(key);\n };\n\n /**\n * This function allow the user to set a new culture with a fallback if\n * the culture does not exist. If no fallback culture is provided,\n * it falls back to \"en-US\".\n */\n numbro.setCulture = function(newCulture, fallbackCulture) {\n var key = newCulture,\n suffix = newCulture.split('-')[1],\n matchingCulture = null;\n if (!cultures[key]) {\n if (suffix) {\n Object.keys(cultures).forEach(function(language) {\n if (!matchingCulture && language.split('-')[1] === suffix) {\n matchingCulture = language;\n }\n });\n }\n\n key = matchingCulture || fallbackCulture || 'en-US';\n }\n chooseCulture(key);\n };\n\n /**\n * This function will load languages and then set the global language. If\n * no arguments are passed in, it will simply return the current global\n * language key.\n *\n * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n * `culture` should be used instead.\n */\n numbro.language = function(key, values) {\n console.warn('`language` is deprecated since version 1.6.0. Use `culture` instead');\n\n if (!key) {\n return currentCulture;\n }\n\n if (key && !values) {\n if (!languages[key]) {\n throw new Error('Unknown language : ' + key);\n }\n chooseCulture(key);\n }\n\n if (values || !languages[key]) {\n setCulture(key, values);\n }\n\n return numbro;\n };\n\n /**\n * This function will load cultures and then set the global culture. If\n * no arguments are passed in, it will simply return the current global\n * culture code.\n */\n numbro.culture = function(code, values) {\n if (!code) {\n return currentCulture;\n }\n\n if (code && !values) {\n if (!cultures[code]) {\n throw new Error('Unknown culture : ' + code);\n }\n chooseCulture(code);\n }\n\n if (values || !cultures[code]) {\n setCulture(code, values);\n }\n\n return numbro;\n };\n\n /**\n * This function provides access to the loaded language data. If\n * no arguments are passed in, it will simply return the current\n * global language object.\n *\n * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n * `culture` should be used instead.\n */\n numbro.languageData = function(key) {\n console.warn('`languageData` is deprecated since version 1.6.0. Use `cultureData` instead');\n\n if (!key) {\n return languages[currentCulture];\n }\n\n if (!languages[key]) {\n throw new Error('Unknown language : ' + key);\n }\n\n return languages[key];\n };\n\n /**\n * This function provides access to the loaded culture data. If\n * no arguments are passed in, it will simply return the current\n * global culture object.\n */\n numbro.cultureData = function(code) {\n if (!code) {\n return cultures[currentCulture];\n }\n\n if (!cultures[code]) {\n throw new Error('Unknown culture : ' + code);\n }\n\n return cultures[code];\n };\n\n numbro.culture('en-US', enUS);\n\n /**\n * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n * `cultures` should be used instead.\n */\n numbro.languages = function() {\n console.warn('`languages` is deprecated since version 1.6.0. Use `cultures` instead');\n\n return languages;\n };\n\n numbro.cultures = function() {\n return cultures;\n };\n\n numbro.zeroFormat = function(format) {\n zeroFormat = typeof(format) === 'string' ? format : null;\n };\n\n numbro.defaultFormat = function(format) {\n defaultFormat = typeof(format) === 'string' ? format : '0.0';\n };\n\n numbro.defaultCurrencyFormat = function (format) {\n defaultCurrencyFormat = typeof(format) === 'string' ? format : '0$';\n };\n\n numbro.validate = function(val, culture) {\n\n var _decimalSep,\n _thousandSep,\n _currSymbol,\n _valArray,\n _abbrObj,\n _thousandRegEx,\n cultureData,\n temp;\n\n //coerce val to string\n if (typeof val !== 'string') {\n val += '';\n if (console.warn) {\n console.warn('Numbro.js: Value is not string. It has been co-erced to: ', val);\n }\n }\n\n //trim whitespaces from either sides\n val = val.trim();\n\n //if val is just digits return true\n if ( !! val.match(/^\\d+$/)) {\n return true;\n }\n\n //if val is empty return false\n if (val === '') {\n return false;\n }\n\n //get the decimal and thousands separator from numbro.cultureData\n try {\n //check if the culture is understood by numbro. if not, default it to current culture\n cultureData = numbro.cultureData(culture);\n } catch (e) {\n cultureData = numbro.cultureData(numbro.culture());\n }\n\n //setup the delimiters and currency symbol based on culture\n _currSymbol = cultureData.currency.symbol;\n _abbrObj = cultureData.abbreviations;\n _decimalSep = cultureData.delimiters.decimal;\n if (cultureData.delimiters.thousands === '.') {\n _thousandSep = '\\\\.';\n } else {\n _thousandSep = cultureData.delimiters.thousands;\n }\n\n // validating currency symbol\n temp = val.match(/^[^\\d]+/);\n if (temp !== null) {\n val = val.substr(1);\n if (temp[0] !== _currSymbol) {\n return false;\n }\n }\n\n //validating abbreviation symbol\n temp = val.match(/[^\\d]+$/);\n if (temp !== null) {\n val = val.slice(0, -1);\n if (temp[0] !== _abbrObj.thousand && temp[0] !== _abbrObj.million &&\n temp[0] !== _abbrObj.billion && temp[0] !== _abbrObj.trillion) {\n return false;\n }\n }\n\n _thousandRegEx = new RegExp(_thousandSep + '{2}');\n\n if (!val.match(/[^\\d.,]/g)) {\n _valArray = val.split(_decimalSep);\n if (_valArray.length > 2) {\n return false;\n } else {\n if (_valArray.length < 2) {\n return ( !! _valArray[0].match(/^\\d+.*\\d$/) && !_valArray[0].match(_thousandRegEx));\n } else {\n if (_valArray[0].length === 1) {\n return ( !! _valArray[0].match(/^\\d+$/) &&\n !_valArray[0].match(_thousandRegEx) &&\n !! _valArray[1].match(/^\\d+$/));\n } else {\n return ( !! _valArray[0].match(/^\\d+.*\\d$/) &&\n !_valArray[0].match(_thousandRegEx) &&\n !! _valArray[1].match(/^\\d+$/));\n }\n }\n }\n }\n\n return false;\n };\n\n /**\n * * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n * `loadCulturesInNode` should be used instead.\n */\n numbro.loadLanguagesInNode = function() {\n console.warn('`loadLanguagesInNode` is deprecated since version 1.6.0. Use `loadCulturesInNode` instead');\n\n numbro.loadCulturesInNode();\n };\n\n numbro.loadCulturesInNode = function() {\n // TODO: Rename the folder in 2.0.0\n var cultures = require('./languages');\n\n for(var langLocaleCode in cultures) {\n if(langLocaleCode) {\n numbro.culture(langLocaleCode, cultures[langLocaleCode]);\n }\n }\n };\n\n /************************************\n Helpers\n ************************************/\n\n function setCulture(code, values) {\n cultures[code] = values;\n }\n\n function chooseCulture(code) {\n currentCulture = code;\n var defaults = cultures[code].defaults;\n if (defaults && defaults.format) {\n numbro.defaultFormat(defaults.format);\n }\n if (defaults && defaults.currencyFormat) {\n numbro.defaultCurrencyFormat(defaults.currencyFormat);\n }\n }\n\n function inNodejsRuntime() {\n return (typeof process !== 'undefined') &&\n (process.browser === undefined) &&\n (process.title.indexOf('node') === 0 || process.title === 'grunt' || process.title === 'gulp') &&\n (typeof require !== 'undefined');\n }\n\n /************************************\n Floating-point helpers\n ************************************/\n\n // The floating-point helper functions and implementation\n // borrows heavily from sinful.js: http://guipn.github.io/sinful.js/\n\n /**\n * Array.prototype.reduce for browsers that don't support it\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce#Compatibility\n */\n if ('function' !== typeof Array.prototype.reduce) {\n Array.prototype.reduce = function(callback, optInitialValue) {\n\n if (null === this || 'undefined' === typeof this) {\n // At the moment all modern browsers, that support strict mode, have\n // native implementation of Array.prototype.reduce. For instance, IE8\n // does not support strict mode, so this check is actually useless.\n throw new TypeError('Array.prototype.reduce called on null or undefined');\n }\n\n if ('function' !== typeof callback) {\n throw new TypeError(callback + ' is not a function');\n }\n\n var index,\n value,\n length = this.length >>> 0,\n isValueSet = false;\n\n if (1 < arguments.length) {\n value = optInitialValue;\n isValueSet = true;\n }\n\n for (index = 0; length > index; ++index) {\n if (this.hasOwnProperty(index)) {\n if (isValueSet) {\n value = callback(value, this[index], index, this);\n } else {\n value = this[index];\n isValueSet = true;\n }\n }\n }\n\n if (!isValueSet) {\n throw new TypeError('Reduce of empty array with no initial value');\n }\n\n return value;\n };\n }\n\n\n /**\n * Computes the multiplier necessary to make x >= 1,\n * effectively eliminating miscalculations caused by\n * finite precision.\n */\n function multiplier(x) {\n var parts = x.toString().split('.');\n if (parts.length < 2) {\n return 1;\n }\n return Math.pow(10, parts[1].length);\n }\n\n /**\n * Given a variable number of arguments, returns the maximum\n * multiplier that must be used to normalize an operation involving\n * all of them.\n */\n function correctionFactor() {\n var args = Array.prototype.slice.call(arguments);\n return args.reduce(function(prev, next) {\n var mp = multiplier(prev),\n mn = multiplier(next);\n return mp > mn ? mp : mn;\n }, -Infinity);\n }\n\n /************************************\n Numbro Prototype\n ************************************/\n\n\n numbro.fn = Numbro.prototype = {\n\n clone: function() {\n return numbro(this);\n },\n\n format: function(inputString, roundingFunction) {\n return formatNumbro(this,\n inputString ? inputString : defaultFormat,\n (roundingFunction !== undefined) ? roundingFunction : Math.round\n );\n },\n\n formatCurrency: function(inputString, roundingFunction) {\n return formatCurrency(this,\n inputString ? inputString : defaultCurrencyFormat,\n (roundingFunction !== undefined) ? roundingFunction : Math.round\n );\n },\n\n unformat: function(inputString) {\n if (typeof inputString === 'number') {\n return inputString;\n } else if (typeof inputString === 'string') {\n var result = unformatNumbro(this, inputString);\n\n // Any unparseable string (represented as NaN in the result) is\n // converted into undefined.\n return isNaN(result) ? undefined : result;\n } else {\n return undefined;\n }\n },\n\n binaryByteUnits: function() {\n return formatByteUnits(this._value, bytes.binary.suffixes, bytes.binary.scale).suffix;\n },\n\n byteUnits: function() {\n return formatByteUnits(this._value, bytes.general.suffixes, bytes.general.scale).suffix;\n },\n\n decimalByteUnits: function() {\n return formatByteUnits(this._value, bytes.decimal.suffixes, bytes.decimal.scale).suffix;\n },\n\n value: function() {\n return this._value;\n },\n\n valueOf: function() {\n return this._value;\n },\n\n set: function(value) {\n this._value = Number(value);\n return this;\n },\n\n add: function(value) {\n var corrFactor = correctionFactor.call(null, this._value, value);\n\n function cback(accum, curr) {\n return accum + corrFactor * curr;\n }\n this._value = [this._value, value].reduce(cback, 0) / corrFactor;\n return this;\n },\n\n subtract: function(value) {\n var corrFactor = correctionFactor.call(null, this._value, value);\n\n function cback(accum, curr) {\n return accum - corrFactor * curr;\n }\n this._value = [value].reduce(cback, this._value * corrFactor) / corrFactor;\n return this;\n },\n\n multiply: function(value) {\n function cback(accum, curr) {\n var corrFactor = correctionFactor(accum, curr),\n result = accum * corrFactor;\n result *= curr * corrFactor;\n result /= corrFactor * corrFactor;\n return result;\n }\n this._value = [this._value, value].reduce(cback, 1);\n return this;\n },\n\n divide: function(value) {\n function cback(accum, curr) {\n var corrFactor = correctionFactor(accum, curr);\n return (accum * corrFactor) / (curr * corrFactor);\n }\n this._value = [this._value, value].reduce(cback);\n return this;\n },\n\n difference: function(value) {\n return Math.abs(numbro(this._value).subtract(value).value());\n }\n\n };\n\n /************************************\n Exposing Numbro\n ************************************/\n\n if (inNodejsRuntime()) {\n //Todo: Rename the folder in 2.0.0\n numbro.loadCulturesInNode();\n }\n\n // CommonJS module is defined\n if (hasModule) {\n module.exports = numbro;\n } else {\n /*global ender:false */\n if (typeof ender === 'undefined') {\n // here, `this` means `window` in the browser, or `global` on the server\n // add `numbro` as a global object via a string identifier,\n // for Closure Compiler 'advanced' mode\n this.numbro = numbro;\n }\n\n /*global define:false */\n if (typeof define === 'function' && define.amd) {\n define([], function() {\n return numbro;\n });\n }\n }\n\n}.call(typeof window === 'undefined' ? this : window));\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/~/numbro/numbro.js\n ** module id = 19\n ** module chunks = 0\n **/","// shim for using process in browser\n\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\n(function () {\n try {\n cachedSetTimeout = setTimeout;\n } catch (e) {\n cachedSetTimeout = function () {\n throw new Error('setTimeout is not defined');\n }\n }\n try {\n cachedClearTimeout = clearTimeout;\n } catch (e) {\n cachedClearTimeout = function () {\n throw new Error('clearTimeout is not defined');\n }\n }\n} ())\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = cachedSetTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n cachedClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n cachedSetTimeout(drainQueue, 0);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/process/browser.js\n ** module id = 20\n ** module chunks = 0\n **/","// empty (null-loader)\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/~/numbro/languages/index.js\n ** module id = 21\n ** module chunks = 0\n **/","this.j$ = this.jStat = (function(Math, undefined) {\n\n// For quick reference.\nvar concat = Array.prototype.concat;\nvar slice = Array.prototype.slice;\nvar toString = Object.prototype.toString;\n\n// Calculate correction for IEEE error\n// TODO: This calculation can be improved.\nfunction calcRdx(n, m) {\n var val = n > m ? n : m;\n return Math.pow(10,\n 17 - ~~(Math.log(((val > 0) ? val : -val)) * Math.LOG10E));\n}\n\n\nvar isArray = Array.isArray || function isArray(arg) {\n return toString.call(arg) === '[object Array]';\n};\n\n\nfunction isFunction(arg) {\n return toString.call(arg) === '[object Function]';\n}\n\n\nfunction isNumber(arg) {\n return typeof arg === 'number' && arg === arg;\n}\n\n\n// Converts the jStat matrix to vector.\nfunction toVector(arr) {\n return concat.apply([], arr);\n}\n\n\n// The one and only jStat constructor.\nfunction jStat() {\n return new jStat._init(arguments);\n}\n\n\n// TODO: Remove after all references in src files have been removed.\njStat.fn = jStat.prototype;\n\n\n// By separating the initializer from the constructor it's easier to handle\n// always returning a new instance whether \"new\" was used or not.\njStat._init = function _init(args) {\n var i;\n\n // If first argument is an array, must be vector or matrix.\n if (isArray(args[0])) {\n // Check if matrix.\n if (isArray(args[0][0])) {\n // See if a mapping function was also passed.\n if (isFunction(args[1]))\n args[0] = jStat.map(args[0], args[1]);\n // Iterate over each is faster than this.push.apply(this, args[0].\n for (var i = 0; i < args[0].length; i++)\n this[i] = args[0][i];\n this.length = args[0].length;\n\n // Otherwise must be a vector.\n } else {\n this[0] = isFunction(args[1]) ? jStat.map(args[0], args[1]) : args[0];\n this.length = 1;\n }\n\n // If first argument is number, assume creation of sequence.\n } else if (isNumber(args[0])) {\n this[0] = jStat.seq.apply(null, args);\n this.length = 1;\n\n // Handle case when jStat object is passed to jStat.\n } else if (args[0] instanceof jStat) {\n // Duplicate the object and pass it back.\n return jStat(args[0].toArray());\n\n // Unexpected argument value, return empty jStat object.\n // TODO: This is strange behavior. Shouldn't this throw or some such to let\n // the user know they had bad arguments?\n } else {\n this[0] = [];\n this.length = 1;\n }\n\n return this;\n};\njStat._init.prototype = jStat.prototype;\njStat._init.constructor = jStat;\n\n\n// Utility functions.\n// TODO: for internal use only?\njStat.utils = {\n calcRdx: calcRdx,\n isArray: isArray,\n isFunction: isFunction,\n isNumber: isNumber,\n toVector: toVector\n};\n\n\n// Easily extend the jStat object.\n// TODO: is this seriously necessary?\njStat.extend = function extend(obj) {\n var i, j;\n\n if (arguments.length === 1) {\n for (j in obj)\n jStat[j] = obj[j];\n return this;\n }\n\n for (var i = 1; i < arguments.length; i++) {\n for (j in arguments[i])\n obj[j] = arguments[i][j];\n }\n\n return obj;\n};\n\n\n// Returns the number of rows in the matrix.\njStat.rows = function rows(arr) {\n return arr.length || 1;\n};\n\n\n// Returns the number of columns in the matrix.\njStat.cols = function cols(arr) {\n return arr[0].length || 1;\n};\n\n\n// Returns the dimensions of the object { rows: i, cols: j }\njStat.dimensions = function dimensions(arr) {\n return {\n rows: jStat.rows(arr),\n cols: jStat.cols(arr)\n };\n};\n\n\n// Returns a specified row as a vector or return a sub matrix by pick some rows\njStat.row = function row(arr, index) {\n if (isArray(index)) {\n return index.map(function(i) {\n return jStat.row(arr, i);\n })\n }\n return arr[index];\n};\n\n\n// return row as array\n// rowa([[1,2],[3,4]],0) -> [1,2]\njStat.rowa = function rowa(arr, i) {\n return jStat.row(arr, i);\n};\n\n\n// Returns the specified column as a vector or return a sub matrix by pick some\n// columns\njStat.col = function col(arr, index) {\n if (isArray(index)) {\n var submat = jStat.arange(arr.length).map(function(i) {\n return new Array(index.length);\n });\n index.forEach(function(ind, i){\n jStat.arange(arr.length).forEach(function(j) {\n submat[j][i] = arr[j][ind];\n });\n });\n return submat;\n }\n var column = new Array(arr.length);\n for (var i = 0; i < arr.length; i++)\n column[i] = [arr[i][index]];\n return column;\n};\n\n\n// return column as array\n// cola([[1,2],[3,4]],0) -> [1,3]\njStat.cola = function cola(arr, i) {\n return jStat.col(arr, i).map(function(a){ return a[0] });\n};\n\n\n// Returns the diagonal of the matrix\njStat.diag = function diag(arr) {\n var nrow = jStat.rows(arr);\n var res = new Array(nrow);\n for (var row = 0; row < nrow; row++)\n res[row] = [arr[row][row]];\n return res;\n};\n\n\n// Returns the anti-diagonal of the matrix\njStat.antidiag = function antidiag(arr) {\n var nrow = jStat.rows(arr) - 1;\n var res = new Array(nrow);\n for (var i = 0; nrow >= 0; nrow--, i++)\n res[i] = [arr[i][nrow]];\n return res;\n};\n\n// Transpose a matrix or array.\njStat.transpose = function transpose(arr) {\n var obj = [];\n var objArr, rows, cols, j, i;\n\n // Make sure arr is in matrix format.\n if (!isArray(arr[0]))\n arr = [arr];\n\n rows = arr.length;\n cols = arr[0].length;\n\n for (var i = 0; i < cols; i++) {\n objArr = new Array(rows);\n for (j = 0; j < rows; j++)\n objArr[j] = arr[j][i];\n obj.push(objArr);\n }\n\n // If obj is vector, return only single array.\n return obj.length === 1 ? obj[0] : obj;\n};\n\n\n// Map a function to an array or array of arrays.\n// \"toAlter\" is an internal variable.\njStat.map = function map(arr, func, toAlter) {\n var row, nrow, ncol, res, col;\n\n if (!isArray(arr[0]))\n arr = [arr];\n\n nrow = arr.length;\n ncol = arr[0].length;\n res = toAlter ? arr : new Array(nrow);\n\n for (row = 0; row < nrow; row++) {\n // if the row doesn't exist, create it\n if (!res[row])\n res[row] = new Array(ncol);\n for (col = 0; col < ncol; col++)\n res[row][col] = func(arr[row][col], row, col);\n }\n\n return res.length === 1 ? res[0] : res;\n};\n\n\n// Cumulatively combine the elements of an array or array of arrays using a function.\njStat.cumreduce = function cumreduce(arr, func, toAlter) {\n var row, nrow, ncol, res, col;\n\n if (!isArray(arr[0]))\n arr = [arr];\n\n nrow = arr.length;\n ncol = arr[0].length;\n res = toAlter ? arr : new Array(nrow);\n\n for (row = 0; row < nrow; row++) {\n // if the row doesn't exist, create it\n if (!res[row])\n res[row] = new Array(ncol);\n if (ncol > 0)\n res[row][0] = arr[row][0];\n for (col = 1; col < ncol; col++)\n res[row][col] = func(res[row][col-1], arr[row][col]);\n }\n return res.length === 1 ? res[0] : res;\n};\n\n\n// Destructively alter an array.\njStat.alter = function alter(arr, func) {\n return jStat.map(arr, func, true);\n};\n\n\n// Generate a rows x cols matrix according to the supplied function.\njStat.create = function create(rows, cols, func) {\n var res = new Array(rows);\n var i, j;\n\n if (isFunction(cols)) {\n func = cols;\n cols = rows;\n }\n\n for (var i = 0; i < rows; i++) {\n res[i] = new Array(cols);\n for (j = 0; j < cols; j++)\n res[i][j] = func(i, j);\n }\n\n return res;\n};\n\n\nfunction retZero() { return 0; }\n\n\n// Generate a rows x cols matrix of zeros.\njStat.zeros = function zeros(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, retZero);\n};\n\n\nfunction retOne() { return 1; }\n\n\n// Generate a rows x cols matrix of ones.\njStat.ones = function ones(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, retOne);\n};\n\n\n// Generate a rows x cols matrix of uniformly random numbers.\njStat.rand = function rand(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, Math.random);\n};\n\n\nfunction retIdent(i, j) { return i === j ? 1 : 0; }\n\n\n// Generate an identity matrix of size row x cols.\njStat.identity = function identity(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, retIdent);\n};\n\n\n// Tests whether a matrix is symmetric\njStat.symmetric = function symmetric(arr) {\n var issymmetric = true;\n var size = arr.length;\n var row, col;\n\n if (arr.length !== arr[0].length)\n return false;\n\n for (row = 0; row < size; row++) {\n for (col = 0; col < size; col++)\n if (arr[col][row] !== arr[row][col])\n return false;\n }\n\n return true;\n};\n\n\n// Set all values to zero.\njStat.clear = function clear(arr) {\n return jStat.alter(arr, retZero);\n};\n\n\n// Generate sequence.\njStat.seq = function seq(min, max, length, func) {\n if (!isFunction(func))\n func = false;\n\n var arr = [];\n var hival = calcRdx(min, max);\n var step = (max * hival - min * hival) / ((length - 1) * hival);\n var current = min;\n var cnt;\n\n // Current is assigned using a technique to compensate for IEEE error.\n // TODO: Needs better implementation.\n for (cnt = 0;\n current <= max;\n cnt++, current = (min * hival + step * hival * cnt) / hival) {\n arr.push((func ? func(current, cnt) : current));\n }\n\n return arr;\n};\n\n\n// arange(5) -> [0,1,2,3,4]\n// arange(1,5) -> [1,2,3,4]\n// arange(5,1,-1) -> [5,4,3,2]\njStat.arange = function arange(start, end, step) {\n var rl = [];\n step = step || 1;\n if (end === undefined) {\n end = start;\n start = 0;\n }\n if (start === end || step === 0) {\n return [];\n }\n if (start < end && step < 0) {\n return [];\n }\n if (start > end && step > 0) {\n return [];\n }\n if (step > 0) {\n for (i = start; i < end; i += step) {\n rl.push(i);\n }\n } else {\n for (i = start; i > end; i += step) {\n rl.push(i);\n }\n }\n return rl;\n};\n\n\n// A=[[1,2,3],[4,5,6],[7,8,9]]\n// slice(A,{row:{end:2},col:{start:1}}) -> [[2,3],[5,6]]\n// slice(A,1,{start:1}) -> [5,6]\n// as numpy code A[:2,1:]\njStat.slice = (function(){\n function _slice(list, start, end, step) {\n // note it's not equal to range.map mode it's a bug\n var i;\n var rl = [];\n var length = list.length;\n if (start === undefined && end === undefined && step === undefined) {\n return jStat.copy(list);\n }\n\n start = start || 0;\n end = end || list.length;\n start = start >= 0 ? start : length + start;\n end = end >= 0 ? end : length + end;\n step = step || 1;\n if (start === end || step === 0) {\n return [];\n }\n if (start < end && step < 0) {\n return [];\n }\n if (start > end && step > 0) {\n return [];\n }\n if (step > 0) {\n for (i = start; i < end; i += step) {\n rl.push(list[i]);\n }\n } else {\n for (i = start; i > end;i += step) {\n rl.push(list[i]);\n }\n }\n return rl;\n }\n\n function slice(list, rcSlice) {\n rcSlice = rcSlice || {};\n if (isNumber(rcSlice.row)) {\n if (isNumber(rcSlice.col))\n return list[rcSlice.row][rcSlice.col];\n var row = jStat.rowa(list, rcSlice.row);\n var colSlice = rcSlice.col || {};\n return _slice(row, colSlice.start, colSlice.end, colSlice.step);\n }\n\n if (isNumber(rcSlice.col)) {\n var col = jStat.cola(list, rcSlice.col);\n var rowSlice = rcSlice.row || {};\n return _slice(col, rowSlice.start, rowSlice.end, rowSlice.step);\n }\n\n var rowSlice = rcSlice.row || {};\n var colSlice = rcSlice.col || {};\n var rows = _slice(list, rowSlice.start, rowSlice.end, rowSlice.step);\n return rows.map(function(row) {\n return _slice(row, colSlice.start, colSlice.end, colSlice.step);\n });\n }\n\n return slice;\n}());\n\n\n// A=[[1,2,3],[4,5,6],[7,8,9]]\n// sliceAssign(A,{row:{start:1},col:{start:1}},[[0,0],[0,0]])\n// A=[[1,2,3],[4,0,0],[7,0,0]]\njStat.sliceAssign = function sliceAssign(A, rcSlice, B) {\n if (isNumber(rcSlice.row)) {\n if (isNumber(rcSlice.col))\n return A[rcSlice.row][rcSlice.col] = B;\n rcSlice.col = rcSlice.col || {};\n rcSlice.col.start = rcSlice.col.start || 0;\n rcSlice.col.end = rcSlice.col.end || A[0].length;\n rcSlice.col.step = rcSlice.col.step || 1;\n var nl = jStat.arange(rcSlice.col.start,\n Math.min(A.length, rcSlice.col.end),\n rcSlice.col.step);\n var m = rcSlice.row;\n nl.forEach(function(n, i) {\n A[m][n] = B[i];\n });\n return A;\n }\n\n if (isNumber(rcSlice.col)) {\n rcSlice.row = rcSlice.row || {};\n rcSlice.row.start = rcSlice.row.start || 0;\n rcSlice.row.end = rcSlice.row.end || A.length;\n rcSlice.row.step = rcSlice.row.step || 1;\n var ml = jStat.arange(rcSlice.row.start,\n Math.min(A[0].length, rcSlice.row.end),\n rcSlice.row.step);\n var n = rcSlice.col;\n ml.forEach(function(m, j) {\n A[m][n] = B[j];\n });\n return A;\n }\n\n if (B[0].length === undefined) {\n B = [B];\n }\n rcSlice.row.start = rcSlice.row.start || 0;\n rcSlice.row.end = rcSlice.row.end || A.length;\n rcSlice.row.step = rcSlice.row.step || 1;\n rcSlice.col.start = rcSlice.col.start || 0;\n rcSlice.col.end = rcSlice.col.end || A[0].length;\n rcSlice.col.step = rcSlice.col.step || 1;\n var ml = jStat.arange(rcSlice.row.start,\n Math.min(A.length, rcSlice.row.end),\n rcSlice.row.step);\n var nl = jStat.arange(rcSlice.col.start,\n Math.min(A[0].length, rcSlice.col.end),\n rcSlice.col.step);\n ml.forEach(function(m, i) {\n nl.forEach(function(n, j) {\n A[m][n] = B[i][j];\n });\n });\n return A;\n};\n\n\n// [1,2,3] ->\n// [[1,0,0],[0,2,0],[0,0,3]]\njStat.diagonal = function diagonal(diagArray) {\n var mat = jStat.zeros(diagArray.length, diagArray.length);\n diagArray.forEach(function(t, i) {\n mat[i][i] = t;\n });\n return mat;\n};\n\n\n// return copy of A\njStat.copy = function copy(A) {\n return A.map(function(row) {\n if (isNumber(row))\n return row;\n return row.map(function(t) {\n return t;\n });\n });\n};\n\n\n// TODO: Go over this entire implementation. Seems a tragic waste of resources\n// doing all this work. Instead, and while ugly, use new Function() to generate\n// a custom function for each static method.\n\n// Quick reference.\nvar jProto = jStat.prototype;\n\n// Default length.\njProto.length = 0;\n\n// For internal use only.\n// TODO: Check if they're actually used, and if they are then rename them\n// to _*\njProto.push = Array.prototype.push;\njProto.sort = Array.prototype.sort;\njProto.splice = Array.prototype.splice;\njProto.slice = Array.prototype.slice;\n\n\n// Return a clean array.\njProto.toArray = function toArray() {\n return this.length > 1 ? slice.call(this) : slice.call(this)[0];\n};\n\n\n// Map a function to a matrix or vector.\njProto.map = function map(func, toAlter) {\n return jStat(jStat.map(this, func, toAlter));\n};\n\n\n// Cumulatively combine the elements of a matrix or vector using a function.\njProto.cumreduce = function cumreduce(func, toAlter) {\n return jStat(jStat.cumreduce(this, func, toAlter));\n};\n\n\n// Destructively alter an array.\njProto.alter = function alter(func) {\n jStat.alter(this, func);\n return this;\n};\n\n\n// Extend prototype with methods that have no argument.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function(func) {\n var self = this,\n results;\n // Check for callback.\n if (func) {\n setTimeout(function() {\n func.call(self, jProto[passfunc].call(self));\n });\n return this;\n }\n results = jStat[passfunc](this);\n return isArray(results) ? jStat(results) : results;\n };\n })(funcs[i]);\n})('transpose clear symmetric rows cols dimensions diag antidiag'.split(' '));\n\n\n// Extend prototype with methods that have one argument.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function(index, func) {\n var self = this;\n // check for callback\n if (func) {\n setTimeout(function() {\n func.call(self, jProto[passfunc].call(self, index));\n });\n return this;\n }\n return jStat(jStat[passfunc](this, index));\n };\n })(funcs[i]);\n})('row col'.split(' '));\n\n\n// Extend prototype with simple shortcut methods.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = new Function(\n 'return jStat(jStat.' + passfunc + '.apply(null, arguments));');\n })(funcs[i]);\n})('create zeros ones rand identity'.split(' '));\n\n\n// Exposing jStat.\nreturn jStat;\n\n}(Math));\n(function(jStat, Math) {\n\nvar isFunction = jStat.utils.isFunction;\n\n// Ascending functions for sort\nfunction ascNum(a, b) { return a - b; }\n\nfunction clip(arg, min, max) {\n return Math.max(min, Math.min(arg, max));\n}\n\n\n// sum of an array\njStat.sum = function sum(arr) {\n var sum = 0;\n var i = arr.length;\n while (--i >= 0)\n sum += arr[i];\n return sum;\n};\n\n\n// sum squared\njStat.sumsqrd = function sumsqrd(arr) {\n var sum = 0;\n var i = arr.length;\n while (--i >= 0)\n sum += arr[i] * arr[i];\n return sum;\n};\n\n\n// sum of squared errors of prediction (SSE)\njStat.sumsqerr = function sumsqerr(arr) {\n var mean = jStat.mean(arr);\n var sum = 0;\n var i = arr.length;\n var tmp;\n while (--i >= 0) {\n tmp = arr[i] - mean;\n sum += tmp * tmp;\n }\n return sum;\n};\n\n// sum of an array in each row\njStat.sumrow = function sumrow(arr) {\n var sum = 0;\n var i = arr.length;\n while (--i >= 0)\n sum += arr[i];\n return sum;\n};\n\n// product of an array\njStat.product = function product(arr) {\n var prod = 1;\n var i = arr.length;\n while (--i >= 0)\n prod *= arr[i];\n return prod;\n};\n\n\n// minimum value of an array\njStat.min = function min(arr) {\n var low = arr[0];\n var i = 0;\n while (++i < arr.length)\n if (arr[i] < low)\n low = arr[i];\n return low;\n};\n\n\n// maximum value of an array\njStat.max = function max(arr) {\n var high = arr[0];\n var i = 0;\n while (++i < arr.length)\n if (arr[i] > high)\n high = arr[i];\n return high;\n};\n\n\n// unique values of an array\njStat.unique = function unique(arr) {\n var hash = {}, _arr = [];\n for(var i = 0; i < arr.length; i++) {\n if (!hash[arr[i]]) {\n hash[arr[i]] = true;\n _arr.push(arr[i]);\n }\n }\n return _arr;\n};\n\n\n// mean value of an array\njStat.mean = function mean(arr) {\n return jStat.sum(arr) / arr.length;\n};\n\n\n// mean squared error (MSE)\njStat.meansqerr = function meansqerr(arr) {\n return jStat.sumsqerr(arr) / arr.length;\n};\n\n\n// geometric mean of an array\njStat.geomean = function geomean(arr) {\n return Math.pow(jStat.product(arr), 1 / arr.length);\n};\n\n\n// median of an array\njStat.median = function median(arr) {\n var arrlen = arr.length;\n var _arr = arr.slice().sort(ascNum);\n // check if array is even or odd, then return the appropriate\n return !(arrlen & 1)\n ? (_arr[(arrlen / 2) - 1 ] + _arr[(arrlen / 2)]) / 2\n : _arr[(arrlen / 2) | 0 ];\n};\n\n\n// cumulative sum of an array\njStat.cumsum = function cumsum(arr) {\n return jStat.cumreduce(arr, function (a, b) { return a + b; });\n};\n\n\n// cumulative product of an array\njStat.cumprod = function cumprod(arr) {\n return jStat.cumreduce(arr, function (a, b) { return a * b; });\n};\n\n\n// successive differences of a sequence\njStat.diff = function diff(arr) {\n var diffs = [];\n var arrLen = arr.length;\n var i;\n for (var i = 1; i < arrLen; i++)\n diffs.push(arr[i] - arr[i - 1]);\n return diffs;\n};\n\n\n// ranks of an array\njStat.rank = function (arr) {\n var arrlen = arr.length;\n var sorted = arr.slice().sort(ascNum);\n var ranks = new Array(arrlen);\n for (var i = 0; i < arrlen; i++) {\n var first = sorted.indexOf(arr[i]);\n var last = sorted.lastIndexOf(arr[i]);\n if (first === last) {\n var val = first;\n } else {\n var val = (first + last) / 2;\n }\n ranks[i] = val + 1;\n }\n return ranks;\n};\n\n\n// mode of an array\n// if there are multiple modes of an array, return all of them\n// is this the appropriate way of handling it?\njStat.mode = function mode(arr) {\n var arrLen = arr.length;\n var _arr = arr.slice().sort(ascNum);\n var count = 1;\n var maxCount = 0;\n var numMaxCount = 0;\n var mode_arr = [];\n var i;\n\n for (var i = 0; i < arrLen; i++) {\n if (_arr[i] === _arr[i + 1]) {\n count++;\n } else {\n if (count > maxCount) {\n mode_arr = [_arr[i]];\n maxCount = count;\n numMaxCount = 0;\n }\n // are there multiple max counts\n else if (count === maxCount) {\n mode_arr.push(_arr[i]);\n numMaxCount++;\n }\n // resetting count for new value in array\n count = 1;\n }\n }\n\n return numMaxCount === 0 ? mode_arr[0] : mode_arr;\n};\n\n\n// range of an array\njStat.range = function range(arr) {\n return jStat.max(arr) - jStat.min(arr);\n};\n\n// variance of an array\n// flag = true indicates sample instead of population\njStat.variance = function variance(arr, flag) {\n return jStat.sumsqerr(arr) / (arr.length - (flag ? 1 : 0));\n};\n\n// deviation of an array\njStat.deviation = function (arr) {\n var mean = jStat.mean(arr);\n var arrlen = arr.length;\n var dev = new Array(arrlen);\n for (var i = 0; i < arrlen; i++) {\n dev[i] = arr[i] - mean;\n }\n return dev;\n};\n\n// standard deviation of an array\n// flag = true indicates sample instead of population\njStat.stdev = function stdev(arr, flag) {\n return Math.sqrt(jStat.variance(arr, flag));\n};\n\n\n// mean deviation (mean absolute deviation) of an array\njStat.meandev = function meandev(arr) {\n var devSum = 0;\n var mean = jStat.mean(arr);\n var i;\n for (var i = arr.length - 1; i >= 0; i--)\n devSum += Math.abs(arr[i] - mean);\n return devSum / arr.length;\n};\n\n\n// median deviation (median absolute deviation) of an array\njStat.meddev = function meddev(arr) {\n var devSum = 0;\n var median = jStat.median(arr);\n var i;\n for (var i = arr.length - 1; i >= 0; i--)\n devSum += Math.abs(arr[i] - median);\n return devSum / arr.length;\n};\n\n\n// coefficient of variation\njStat.coeffvar = function coeffvar(arr) {\n return jStat.stdev(arr) / jStat.mean(arr);\n};\n\n\n// quartiles of an array\njStat.quartiles = function quartiles(arr) {\n var arrlen = arr.length;\n var _arr = arr.slice().sort(ascNum);\n return [\n _arr[ Math.round((arrlen) / 4) - 1 ],\n _arr[ Math.round((arrlen) / 2) - 1 ],\n _arr[ Math.round((arrlen) * 3 / 4) - 1 ]\n ];\n};\n\n\n// Arbitary quantiles of an array. Direct port of the scipy.stats\n// implementation by Pierre GF Gerard-Marchant.\njStat.quantiles = function quantiles(arr, quantilesArray, alphap, betap) {\n var sortedArray = arr.slice().sort(ascNum);\n var quantileVals = [quantilesArray.length];\n var n = arr.length;\n var i, p, m, aleph, k, gamma;\n\n if (typeof alphap === 'undefined')\n alphap = 3 / 8;\n if (typeof betap === 'undefined')\n betap = 3 / 8;\n\n for (var i = 0; i < quantilesArray.length; i++) {\n p = quantilesArray[i];\n m = alphap + p * (1 - alphap - betap);\n aleph = n * p + m;\n k = Math.floor(clip(aleph, 1, n - 1));\n gamma = clip(aleph - k, 0, 1);\n quantileVals[i] = (1 - gamma) * sortedArray[k - 1] + gamma * sortedArray[k];\n }\n\n return quantileVals;\n};\n\n// Returns the k-th percentile of values in a range, where k is in the\n// range 0..1, exclusive.\njStat.percentile = function percentile(arr, k) {\n var _arr = arr.slice().sort(ascNum);\n var realIndex = k * (_arr.length - 1);\n var index = parseInt(realIndex);\n var frac = realIndex - index;\n\n if (index + 1 < _arr.length) {\n return _arr[index] * (1 - frac) + _arr[index + 1] * frac;\n } else {\n return _arr[index];\n }\n}\n\n\n// The percentile rank of score in a given array. Returns the percentage\n// of all values in the input array that are less than (kind='strict') or\n// less or equal than (kind='weak') score. Default is weak.\njStat.percentileOfScore = function percentileOfScore(arr, score, kind) {\n var counter = 0;\n var len = arr.length;\n var strict = false;\n var value, i;\n\n if (kind === 'strict')\n strict = true;\n\n for (var i = 0; i < len; i++) {\n value = arr[i];\n if ((strict && value < score) ||\n (!strict && value <= score)) {\n counter++;\n }\n }\n\n return counter / len;\n};\n\n\n// Histogram (bin count) data\njStat.histogram = function histogram(arr, bins) {\n var first = jStat.min(arr);\n var binCnt = bins || 4;\n var binWidth = (jStat.max(arr) - first) / binCnt;\n var len = arr.length;\n var bins = [];\n var i;\n\n for (var i = 0; i < binCnt; i++)\n bins[i] = 0;\n for (var i = 0; i < len; i++)\n bins[Math.min(Math.floor(((arr[i] - first) / binWidth)), binCnt - 1)] += 1;\n\n return bins;\n};\n\n\n// covariance of two arrays\njStat.covariance = function covariance(arr1, arr2) {\n var u = jStat.mean(arr1);\n var v = jStat.mean(arr2);\n var arr1Len = arr1.length;\n var sq_dev = new Array(arr1Len);\n var i;\n\n for (var i = 0; i < arr1Len; i++)\n sq_dev[i] = (arr1[i] - u) * (arr2[i] - v);\n\n return jStat.sum(sq_dev) / (arr1Len - 1);\n};\n\n\n// (pearson's) population correlation coefficient, rho\njStat.corrcoeff = function corrcoeff(arr1, arr2) {\n return jStat.covariance(arr1, arr2) /\n jStat.stdev(arr1, 1) /\n jStat.stdev(arr2, 1);\n};\n\n // (spearman's) rank correlation coefficient, sp\njStat.spearmancoeff = function (arr1, arr2) {\n arr1 = jStat.rank(arr1);\n arr2 = jStat.rank(arr2);\n var arr1dev = jStat.deviation(arr1);\n var arr2dev = jStat.deviation(arr2);\n return jStat.sum(arr1dev.map(function (x, i) {\n return x * arr2dev[i];\n })) /\n Math.sqrt(jStat.sum(arr1dev.map(function (x) {\n return Math.pow(x, 2);\n })) * jStat.sum(arr2dev.map(function (x) {\n return Math.pow(x, 2);\n }))\n );\n}\n\n\n// statistical standardized moments (general form of skew/kurt)\njStat.stanMoment = function stanMoment(arr, n) {\n var mu = jStat.mean(arr);\n var sigma = jStat.stdev(arr);\n var len = arr.length;\n var skewSum = 0;\n\n for (var i = 0; i < len; i++)\n skewSum += Math.pow((arr[i] - mu) / sigma, n);\n\n return skewSum / arr.length;\n};\n\n// (pearson's) moment coefficient of skewness\njStat.skewness = function skewness(arr) {\n return jStat.stanMoment(arr, 3);\n};\n\n// (pearson's) (excess) kurtosis\njStat.kurtosis = function kurtosis(arr) {\n return jStat.stanMoment(arr, 4) - 3;\n};\n\n\nvar jProto = jStat.prototype;\n\n\n// Extend jProto with method for calculating cumulative sums and products.\n// This differs from the similar extension below as cumsum and cumprod should\n// not be run again in the case fullbool === true.\n// If a matrix is passed, automatically assume operation should be done on the\n// columns.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n // If a matrix is passed, automatically assume operation should be done on\n // the columns.\n jProto[passfunc] = function(fullbool, func) {\n var arr = [];\n var i = 0;\n var tmpthis = this;\n // Assignment reassignation depending on how parameters were passed in.\n if (isFunction(fullbool)) {\n func = fullbool;\n fullbool = false;\n }\n // Check if a callback was passed with the function.\n if (func) {\n setTimeout(function() {\n func.call(tmpthis, jProto[passfunc].call(tmpthis, fullbool));\n });\n return this;\n }\n // Check if matrix and run calculations.\n if (this.length > 1) {\n tmpthis = fullbool === true ? this : this.transpose();\n for (; i < tmpthis.length; i++)\n arr[i] = jStat[passfunc](tmpthis[i]);\n return arr;\n }\n // Pass fullbool if only vector, not a matrix. for variance and stdev.\n return jStat[passfunc](this[0], fullbool);\n };\n })(funcs[i]);\n})(('cumsum cumprod').split(' '));\n\n\n// Extend jProto with methods which don't require arguments and work on columns.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n // If a matrix is passed, automatically assume operation should be done on\n // the columns.\n jProto[passfunc] = function(fullbool, func) {\n var arr = [];\n var i = 0;\n var tmpthis = this;\n // Assignment reassignation depending on how parameters were passed in.\n if (isFunction(fullbool)) {\n func = fullbool;\n fullbool = false;\n }\n // Check if a callback was passed with the function.\n if (func) {\n setTimeout(function() {\n func.call(tmpthis, jProto[passfunc].call(tmpthis, fullbool));\n });\n return this;\n }\n // Check if matrix and run calculations.\n if (this.length > 1) {\n if (passfunc !== 'sumrow')\n tmpthis = fullbool === true ? this : this.transpose();\n for (; i < tmpthis.length; i++)\n arr[i] = jStat[passfunc](tmpthis[i]);\n return fullbool === true\n ? jStat[passfunc](jStat.utils.toVector(arr))\n : arr;\n }\n // Pass fullbool if only vector, not a matrix. for variance and stdev.\n return jStat[passfunc](this[0], fullbool);\n };\n })(funcs[i]);\n})(('sum sumsqrd sumsqerr sumrow product min max unique mean meansqerr ' +\n 'geomean median diff rank mode range variance deviation stdev meandev ' +\n 'meddev coeffvar quartiles histogram skewness kurtosis').split(' '));\n\n\n// Extend jProto with functions that take arguments. Operations on matrices are\n// done on columns.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function() {\n var arr = [];\n var i = 0;\n var tmpthis = this;\n var args = Array.prototype.slice.call(arguments);\n\n // If the last argument is a function, we assume it's a callback; we\n // strip the callback out and call the function again.\n if (isFunction(args[args.length - 1])) {\n var callbackFunction = args[args.length - 1];\n var argsToPass = args.slice(0, args.length - 1);\n\n setTimeout(function() {\n callbackFunction.call(tmpthis,\n jProto[passfunc].apply(tmpthis, argsToPass));\n });\n return this;\n\n // Otherwise we curry the function args and call normally.\n } else {\n var callbackFunction = undefined;\n var curriedFunction = function curriedFunction(vector) {\n return jStat[passfunc].apply(tmpthis, [vector].concat(args));\n }\n }\n\n // If this is a matrix, run column-by-column.\n if (this.length > 1) {\n tmpthis = tmpthis.transpose();\n for (; i < tmpthis.length; i++)\n arr[i] = curriedFunction(tmpthis[i]);\n return arr;\n }\n\n // Otherwise run on the vector.\n return curriedFunction(this[0]);\n };\n })(funcs[i]);\n})('quantiles percentileOfScore'.split(' '));\n\n}(this.jStat, Math));\n// Special functions //\n(function(jStat, Math) {\n\n// Log-gamma function\njStat.gammaln = function gammaln(x) {\n var j = 0;\n var cof = [\n 76.18009172947146, -86.50532032941677, 24.01409824083091,\n -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5\n ];\n var ser = 1.000000000190015;\n var xx, y, tmp;\n tmp = (y = xx = x) + 5.5;\n tmp -= (xx + 0.5) * Math.log(tmp);\n for (; j < 6; j++)\n ser += cof[j] / ++y;\n return Math.log(2.5066282746310005 * ser / xx) - tmp;\n};\n\n\n// gamma of x\njStat.gammafn = function gammafn(x) {\n var p = [-1.716185138865495, 24.76565080557592, -379.80425647094563,\n 629.3311553128184, 866.9662027904133, -31451.272968848367,\n -36144.413418691176, 66456.14382024054\n ];\n var q = [-30.8402300119739, 315.35062697960416, -1015.1563674902192,\n -3107.771671572311, 22538.118420980151, 4755.8462775278811,\n -134659.9598649693, -115132.2596755535];\n var fact = false;\n var n = 0;\n var xden = 0;\n var xnum = 0;\n var y = x;\n var i, z, yi, res, sum, ysq;\n if (y <= 0) {\n res = y % 1 + 3.6e-16;\n if (res) {\n fact = (!(y & 1) ? 1 : -1) * Math.PI / Math.sin(Math.PI * res);\n y = 1 - y;\n } else {\n return Infinity;\n }\n }\n yi = y;\n if (y < 1) {\n z = y++;\n } else {\n z = (y -= n = (y | 0) - 1) - 1;\n }\n for (var i = 0; i < 8; ++i) {\n xnum = (xnum + p[i]) * z;\n xden = xden * z + q[i];\n }\n res = xnum / xden + 1;\n if (yi < y) {\n res /= yi;\n } else if (yi > y) {\n for (var i = 0; i < n; ++i) {\n res *= y;\n y++;\n }\n }\n if (fact) {\n res = fact / res;\n }\n return res;\n};\n\n\n// lower incomplete gamma function, which is usually typeset with a\n// lower-case greek gamma as the function symbol\njStat.gammap = function gammap(a, x) {\n return jStat.lowRegGamma(a, x) * jStat.gammafn(a);\n};\n\n\n// The lower regularized incomplete gamma function, usually written P(a,x)\njStat.lowRegGamma = function lowRegGamma(a, x) {\n var aln = jStat.gammaln(a);\n var ap = a;\n var sum = 1 / a;\n var del = sum;\n var b = x + 1 - a;\n var c = 1 / 1.0e-30;\n var d = 1 / b;\n var h = d;\n var i = 1;\n // calculate maximum number of itterations required for a\n var ITMAX = -~(Math.log((a >= 1) ? a : 1 / a) * 8.5 + a * 0.4 + 17);\n var an, endval;\n\n if (x < 0 || a <= 0) {\n return NaN;\n } else if (x < a + 1) {\n for (; i <= ITMAX; i++) {\n sum += del *= x / ++ap;\n }\n return (sum * Math.exp(-x + a * Math.log(x) - (aln)));\n }\n\n for (; i <= ITMAX; i++) {\n an = -i * (i - a);\n b += 2;\n d = an * d + b;\n c = b + an / c;\n d = 1 / d;\n h *= d * c;\n }\n\n return (1 - h * Math.exp(-x + a * Math.log(x) - (aln)));\n};\n\n// natural log factorial of n\njStat.factorialln = function factorialln(n) {\n return n < 0 ? NaN : jStat.gammaln(n + 1);\n};\n\n// factorial of n\njStat.factorial = function factorial(n) {\n return n < 0 ? NaN : jStat.gammafn(n + 1);\n};\n\n// combinations of n, m\njStat.combination = function combination(n, m) {\n // make sure n or m don't exceed the upper limit of usable values\n return (n > 170 || m > 170)\n ? Math.exp(jStat.combinationln(n, m))\n : (jStat.factorial(n) / jStat.factorial(m)) / jStat.factorial(n - m);\n};\n\n\njStat.combinationln = function combinationln(n, m){\n return jStat.factorialln(n) - jStat.factorialln(m) - jStat.factorialln(n - m);\n};\n\n\n// permutations of n, m\njStat.permutation = function permutation(n, m) {\n return jStat.factorial(n) / jStat.factorial(n - m);\n};\n\n\n// beta function\njStat.betafn = function betafn(x, y) {\n // ensure arguments are positive\n if (x <= 0 || y <= 0)\n return undefined;\n // make sure x + y doesn't exceed the upper limit of usable values\n return (x + y > 170)\n ? Math.exp(jStat.betaln(x, y))\n : jStat.gammafn(x) * jStat.gammafn(y) / jStat.gammafn(x + y);\n};\n\n\n// natural logarithm of beta function\njStat.betaln = function betaln(x, y) {\n return jStat.gammaln(x) + jStat.gammaln(y) - jStat.gammaln(x + y);\n};\n\n\n// Evaluates the continued fraction for incomplete beta function by modified\n// Lentz's method.\njStat.betacf = function betacf(x, a, b) {\n var fpmin = 1e-30;\n var m = 1;\n var qab = a + b;\n var qap = a + 1;\n var qam = a - 1;\n var c = 1;\n var d = 1 - qab * x / qap;\n var m2, aa, del, h;\n\n // These q's will be used in factors that occur in the coefficients\n if (Math.abs(d) < fpmin)\n d = fpmin;\n d = 1 / d;\n h = d;\n\n for (; m <= 100; m++) {\n m2 = 2 * m;\n aa = m * (b - m) * x / ((qam + m2) * (a + m2));\n // One step (the even one) of the recurrence\n d = 1 + aa * d;\n if (Math.abs(d) < fpmin)\n d = fpmin;\n c = 1 + aa / c;\n if (Math.abs(c) < fpmin)\n c = fpmin;\n d = 1 / d;\n h *= d * c;\n aa = -(a + m) * (qab + m) * x / ((a + m2) * (qap + m2));\n // Next step of the recurrence (the odd one)\n d = 1 + aa * d;\n if (Math.abs(d) < fpmin)\n d = fpmin;\n c = 1 + aa / c;\n if (Math.abs(c) < fpmin)\n c = fpmin;\n d = 1 / d;\n del = d * c;\n h *= del;\n if (Math.abs(del - 1.0) < 3e-7)\n break;\n }\n\n return h;\n};\n\n\n// Returns the inverse of the lower regularized inomplete gamma function\njStat.gammapinv = function gammapinv(p, a) {\n var j = 0;\n var a1 = a - 1;\n var EPS = 1e-8;\n var gln = jStat.gammaln(a);\n var x, err, t, u, pp, lna1, afac;\n\n if (p >= 1)\n return Math.max(100, a + 100 * Math.sqrt(a));\n if (p <= 0)\n return 0;\n if (a > 1) {\n lna1 = Math.log(a1);\n afac = Math.exp(a1 * (lna1 - 1) - gln);\n pp = (p < 0.5) ? p : 1 - p;\n t = Math.sqrt(-2 * Math.log(pp));\n x = (2.30753 + t * 0.27061) / (1 + t * (0.99229 + t * 0.04481)) - t;\n if (p < 0.5)\n x = -x;\n x = Math.max(1e-3,\n a * Math.pow(1 - 1 / (9 * a) - x / (3 * Math.sqrt(a)), 3));\n } else {\n t = 1 - a * (0.253 + a * 0.12);\n if (p < t)\n x = Math.pow(p / t, 1 / a);\n else\n x = 1 - Math.log(1 - (p - t) / (1 - t));\n }\n\n for(; j < 12; j++) {\n if (x <= 0)\n return 0;\n err = jStat.lowRegGamma(a, x) - p;\n if (a > 1)\n t = afac * Math.exp(-(x - a1) + a1 * (Math.log(x) - lna1));\n else\n t = Math.exp(-x + a1 * Math.log(x) - gln);\n u = err / t;\n x -= (t = u / (1 - 0.5 * Math.min(1, u * ((a - 1) / x - 1))));\n if (x <= 0)\n x = 0.5 * (x + t);\n if (Math.abs(t) < EPS * x)\n break;\n }\n\n return x;\n};\n\n\n// Returns the error function erf(x)\njStat.erf = function erf(x) {\n var cof = [-1.3026537197817094, 6.4196979235649026e-1, 1.9476473204185836e-2,\n -9.561514786808631e-3, -9.46595344482036e-4, 3.66839497852761e-4,\n 4.2523324806907e-5, -2.0278578112534e-5, -1.624290004647e-6,\n 1.303655835580e-6, 1.5626441722e-8, -8.5238095915e-8,\n 6.529054439e-9, 5.059343495e-9, -9.91364156e-10,\n -2.27365122e-10, 9.6467911e-11, 2.394038e-12,\n -6.886027e-12, 8.94487e-13, 3.13092e-13,\n -1.12708e-13, 3.81e-16, 7.106e-15,\n -1.523e-15, -9.4e-17, 1.21e-16,\n -2.8e-17];\n var j = cof.length - 1;\n var isneg = false;\n var d = 0;\n var dd = 0;\n var t, ty, tmp, res;\n\n if (x < 0) {\n x = -x;\n isneg = true;\n }\n\n t = 2 / (2 + x);\n ty = 4 * t - 2;\n\n for(; j > 0; j--) {\n tmp = d;\n d = ty * d - dd + cof[j];\n dd = tmp;\n }\n\n res = t * Math.exp(-x * x + 0.5 * (cof[0] + ty * d) - dd);\n return isneg ? res - 1 : 1 - res;\n};\n\n\n// Returns the complmentary error function erfc(x)\njStat.erfc = function erfc(x) {\n return 1 - jStat.erf(x);\n};\n\n\n// Returns the inverse of the complementary error function\njStat.erfcinv = function erfcinv(p) {\n var j = 0;\n var x, err, t, pp;\n if (p >= 2)\n return -100;\n if (p <= 0)\n return 100;\n pp = (p < 1) ? p : 2 - p;\n t = Math.sqrt(-2 * Math.log(pp / 2));\n x = -0.70711 * ((2.30753 + t * 0.27061) /\n (1 + t * (0.99229 + t * 0.04481)) - t);\n for (; j < 2; j++) {\n err = jStat.erfc(x) - pp;\n x += err / (1.12837916709551257 * Math.exp(-x * x) - x * err);\n }\n return (p < 1) ? x : -x;\n};\n\n\n// Returns the inverse of the incomplete beta function\njStat.ibetainv = function ibetainv(p, a, b) {\n var EPS = 1e-8;\n var a1 = a - 1;\n var b1 = b - 1;\n var j = 0;\n var lna, lnb, pp, t, u, err, x, al, h, w, afac;\n if (p <= 0)\n return 0;\n if (p >= 1)\n return 1;\n if (a >= 1 && b >= 1) {\n pp = (p < 0.5) ? p : 1 - p;\n t = Math.sqrt(-2 * Math.log(pp));\n x = (2.30753 + t * 0.27061) / (1 + t* (0.99229 + t * 0.04481)) - t;\n if (p < 0.5)\n x = -x;\n al = (x * x - 3) / 6;\n h = 2 / (1 / (2 * a - 1) + 1 / (2 * b - 1));\n w = (x * Math.sqrt(al + h) / h) - (1 / (2 * b - 1) - 1 / (2 * a - 1)) *\n (al + 5 / 6 - 2 / (3 * h));\n x = a / (a + b * Math.exp(2 * w));\n } else {\n lna = Math.log(a / (a + b));\n lnb = Math.log(b / (a + b));\n t = Math.exp(a * lna) / a;\n u = Math.exp(b * lnb) / b;\n w = t + u;\n if (p < t / w)\n x = Math.pow(a * w * p, 1 / a);\n else\n x = 1 - Math.pow(b * w * (1 - p), 1 / b);\n }\n afac = -jStat.gammaln(a) - jStat.gammaln(b) + jStat.gammaln(a + b);\n for(; j < 10; j++) {\n if (x === 0 || x === 1)\n return x;\n err = jStat.ibeta(x, a, b) - p;\n t = Math.exp(a1 * Math.log(x) + b1 * Math.log(1 - x) + afac);\n u = err / t;\n x -= (t = u / (1 - 0.5 * Math.min(1, u * (a1 / x - b1 / (1 - x)))));\n if (x <= 0)\n x = 0.5 * (x + t);\n if (x >= 1)\n x = 0.5 * (x + t + 1);\n if (Math.abs(t) < EPS * x && j > 0)\n break;\n }\n return x;\n};\n\n\n// Returns the incomplete beta function I_x(a,b)\njStat.ibeta = function ibeta(x, a, b) {\n // Factors in front of the continued fraction.\n var bt = (x === 0 || x === 1) ? 0 :\n Math.exp(jStat.gammaln(a + b) - jStat.gammaln(a) -\n jStat.gammaln(b) + a * Math.log(x) + b *\n Math.log(1 - x));\n if (x < 0 || x > 1)\n return false;\n if (x < (a + 1) / (a + b + 2))\n // Use continued fraction directly.\n return bt * jStat.betacf(x, a, b) / a;\n // else use continued fraction after making the symmetry transformation.\n return 1 - bt * jStat.betacf(1 - x, b, a) / b;\n};\n\n\n// Returns a normal deviate (mu=0, sigma=1).\n// If n and m are specified it returns a object of normal deviates.\njStat.randn = function randn(n, m) {\n var u, v, x, y, q, mat;\n if (!m)\n m = n;\n if (n)\n return jStat.create(n, m, function() { return jStat.randn(); });\n do {\n u = Math.random();\n v = 1.7156 * (Math.random() - 0.5);\n x = u - 0.449871;\n y = Math.abs(v) + 0.386595;\n q = x * x + y * (0.19600 * y - 0.25472 * x);\n } while (q > 0.27597 && (q > 0.27846 || v * v > -4 * Math.log(u) * u * u));\n return v / u;\n};\n\n\n// Returns a gamma deviate by the method of Marsaglia and Tsang.\njStat.randg = function randg(shape, n, m) {\n var oalph = shape;\n var a1, a2, u, v, x, mat;\n if (!m)\n m = n;\n if (!shape)\n shape = 1;\n if (n) {\n mat = jStat.zeros(n,m);\n mat.alter(function() { return jStat.randg(shape); });\n return mat;\n }\n if (shape < 1)\n shape += 1;\n a1 = shape - 1 / 3;\n a2 = 1 / Math.sqrt(9 * a1);\n do {\n do {\n x = jStat.randn();\n v = 1 + a2 * x;\n } while(v <= 0);\n v = v * v * v;\n u = Math.random();\n } while(u > 1 - 0.331 * Math.pow(x, 4) &&\n Math.log(u) > 0.5 * x*x + a1 * (1 - v + Math.log(v)));\n // alpha > 1\n if (shape == oalph)\n return a1 * v;\n // alpha < 1\n do {\n u = Math.random();\n } while(u === 0);\n return Math.pow(u, 1 / oalph) * a1 * v;\n};\n\n\n// making use of static methods on the instance\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jStat.fn[passfunc] = function() {\n return jStat(\n jStat.map(this, function(value) { return jStat[passfunc](value); }));\n }\n })(funcs[i]);\n})('gammaln gammafn factorial factorialln'.split(' '));\n\n\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jStat.fn[passfunc] = function() {\n return jStat(jStat[passfunc].apply(null, arguments));\n };\n })(funcs[i]);\n})('randn'.split(' '));\n\n}(this.jStat, Math));\n(function(jStat, Math) {\n\n// generate all distribution instance methods\n(function(list) {\n for (var i = 0; i < list.length; i++) (function(func) {\n // distribution instance method\n jStat[func] = function(a, b, c) {\n if (!(this instanceof arguments.callee))\n return new arguments.callee(a, b, c);\n this._a = a;\n this._b = b;\n this._c = c;\n return this;\n };\n // distribution method to be used on a jStat instance\n jStat.fn[func] = function(a, b, c) {\n var newthis = jStat[func](a, b, c);\n newthis.data = this;\n return newthis;\n };\n // sample instance method\n jStat[func].prototype.sample = function(arr) {\n var a = this._a;\n var b = this._b;\n var c = this._c;\n if (arr)\n return jStat.alter(arr, function() {\n return jStat[func].sample(a, b, c);\n });\n else\n return jStat[func].sample(a, b, c);\n };\n // generate the pdf, cdf and inv instance methods\n (function(vals) {\n for (var i = 0; i < vals.length; i++) (function(fnfunc) {\n jStat[func].prototype[fnfunc] = function(x) {\n var a = this._a;\n var b = this._b;\n var c = this._c;\n if (!x && x !== 0)\n x = this.data;\n if (typeof x !== 'number') {\n return jStat.fn.map.call(x, function(x) {\n return jStat[func][fnfunc](x, a, b, c);\n });\n }\n return jStat[func][fnfunc](x, a, b, c);\n };\n })(vals[i]);\n })('pdf cdf inv'.split(' '));\n // generate the mean, median, mode and variance instance methods\n (function(vals) {\n for (var i = 0; i < vals.length; i++) (function(fnfunc) {\n jStat[func].prototype[fnfunc] = function() {\n return jStat[func][fnfunc](this._a, this._b, this._c);\n };\n })(vals[i]);\n })('mean median mode variance'.split(' '));\n })(list[i]);\n})((\n 'beta centralF cauchy chisquare exponential gamma invgamma kumaraswamy ' +\n 'laplace lognormal noncentralt normal pareto studentt weibull uniform ' +\n 'binomial negbin hypgeom poisson triangular'\n).split(' '));\n\n\n\n// extend beta function with static methods\njStat.extend(jStat.beta, {\n pdf: function pdf(x, alpha, beta) {\n // PDF is zero outside the support\n if (x > 1 || x < 0)\n return 0;\n // PDF is one for the uniform case\n if (alpha == 1 && beta == 1)\n return 1;\n\n if (alpha < 512 && beta < 512) {\n return (Math.pow(x, alpha - 1) * Math.pow(1 - x, beta - 1)) /\n jStat.betafn(alpha, beta);\n } else {\n return Math.exp((alpha - 1) * Math.log(x) +\n (beta - 1) * Math.log(1 - x) -\n jStat.betaln(alpha, beta));\n }\n },\n\n cdf: function cdf(x, alpha, beta) {\n return (x > 1 || x < 0) ? (x > 1) * 1 : jStat.ibeta(x, alpha, beta);\n },\n\n inv: function inv(x, alpha, beta) {\n return jStat.ibetainv(x, alpha, beta);\n },\n\n mean: function mean(alpha, beta) {\n return alpha / (alpha + beta);\n },\n\n median: function median(alpha, beta) {\n return jStat.ibetainv(0.5, alpha, beta);\n },\n\n mode: function mode(alpha, beta) {\n return (alpha - 1 ) / ( alpha + beta - 2);\n },\n\n // return a random sample\n sample: function sample(alpha, beta) {\n var u = jStat.randg(alpha);\n return u / (u + jStat.randg(beta));\n },\n\n variance: function variance(alpha, beta) {\n return (alpha * beta) / (Math.pow(alpha + beta, 2) * (alpha + beta + 1));\n }\n});\n\n// extend F function with static methods\njStat.extend(jStat.centralF, {\n // This implementation of the pdf function avoids float overflow\n // See the way that R calculates this value:\n // https://svn.r-project.org/R/trunk/src/nmath/df.c\n pdf: function pdf(x, df1, df2) {\n var p, q, f;\n\n if (x < 0)\n return 0;\n\n if (df1 <= 2) {\n if (x === 0 && df1 < 2) {\n return Infinity;\n }\n if (x === 0 && df1 === 2) {\n return 1;\n }\n return Math.sqrt((Math.pow(df1 * x, df1) * Math.pow(df2, df2)) /\n (Math.pow(df1 * x + df2, df1 + df2))) /\n (x * jStat.betafn(df1/2, df2/2));\n }\n\n p = (df1 * x) / (df2 + x * df1);\n q = df2 / (df2 + x * df1);\n f = df1 * q / 2.0;\n return f * jStat.binomial.pdf((df1 - 2) / 2, (df1 + df2 - 2) / 2, p);\n },\n\n cdf: function cdf(x, df1, df2) {\n if (x < 0)\n return 0;\n return jStat.ibeta((df1 * x) / (df1 * x + df2), df1 / 2, df2 / 2);\n },\n\n inv: function inv(x, df1, df2) {\n return df2 / (df1 * (1 / jStat.ibetainv(x, df1 / 2, df2 / 2) - 1));\n },\n\n mean: function mean(df1, df2) {\n return (df2 > 2) ? df2 / (df2 - 2) : undefined;\n },\n\n mode: function mode(df1, df2) {\n return (df1 > 2) ? (df2 * (df1 - 2)) / (df1 * (df2 + 2)) : undefined;\n },\n\n // return a random sample\n sample: function sample(df1, df2) {\n var x1 = jStat.randg(df1 / 2) * 2;\n var x2 = jStat.randg(df2 / 2) * 2;\n return (x1 / df1) / (x2 / df2);\n },\n\n variance: function variance(df1, df2) {\n if (df2 <= 4)\n return undefined;\n return 2 * df2 * df2 * (df1 + df2 - 2) /\n (df1 * (df2 - 2) * (df2 - 2) * (df2 - 4));\n }\n});\n\n\n// extend cauchy function with static methods\njStat.extend(jStat.cauchy, {\n pdf: function pdf(x, local, scale) {\n if (scale < 0) { return 0; }\n\n return (scale / (Math.pow(x - local, 2) + Math.pow(scale, 2))) / Math.PI;\n },\n\n cdf: function cdf(x, local, scale) {\n return Math.atan((x - local) / scale) / Math.PI + 0.5;\n },\n\n inv: function(p, local, scale) {\n return local + scale * Math.tan(Math.PI * (p - 0.5));\n },\n\n median: function median(local, scale) {\n return local;\n },\n\n mode: function mode(local, scale) {\n return local;\n },\n\n sample: function sample(local, scale) {\n return jStat.randn() *\n Math.sqrt(1 / (2 * jStat.randg(0.5))) * scale + local;\n }\n});\n\n\n\n// extend chisquare function with static methods\njStat.extend(jStat.chisquare, {\n pdf: function pdf(x, dof) {\n if (x < 0)\n return 0;\n return (x === 0 && dof === 2) ? 0.5 :\n Math.exp((dof / 2 - 1) * Math.log(x) - x / 2 - (dof / 2) *\n Math.log(2) - jStat.gammaln(dof / 2));\n },\n\n cdf: function cdf(x, dof) {\n if (x < 0)\n return 0;\n return jStat.lowRegGamma(dof / 2, x / 2);\n },\n\n inv: function(p, dof) {\n return 2 * jStat.gammapinv(p, 0.5 * dof);\n },\n\n mean : function(dof) {\n return dof;\n },\n\n // TODO: this is an approximation (is there a better way?)\n median: function median(dof) {\n return dof * Math.pow(1 - (2 / (9 * dof)), 3);\n },\n\n mode: function mode(dof) {\n return (dof - 2 > 0) ? dof - 2 : 0;\n },\n\n sample: function sample(dof) {\n return jStat.randg(dof / 2) * 2;\n },\n\n variance: function variance(dof) {\n return 2 * dof;\n }\n});\n\n\n\n// extend exponential function with static methods\njStat.extend(jStat.exponential, {\n pdf: function pdf(x, rate) {\n return x < 0 ? 0 : rate * Math.exp(-rate * x);\n },\n\n cdf: function cdf(x, rate) {\n return x < 0 ? 0 : 1 - Math.exp(-rate * x);\n },\n\n inv: function(p, rate) {\n return -Math.log(1 - p) / rate;\n },\n\n mean : function(rate) {\n return 1 / rate;\n },\n\n median: function (rate) {\n return (1 / rate) * Math.log(2);\n },\n\n mode: function mode(rate) {\n return 0;\n },\n\n sample: function sample(rate) {\n return -1 / rate * Math.log(Math.random());\n },\n\n variance : function(rate) {\n return Math.pow(rate, -2);\n }\n});\n\n\n\n// extend gamma function with static methods\njStat.extend(jStat.gamma, {\n pdf: function pdf(x, shape, scale) {\n if (x < 0)\n return 0;\n return (x === 0 && shape === 1) ? 1 / scale :\n Math.exp((shape - 1) * Math.log(x) - x / scale -\n jStat.gammaln(shape) - shape * Math.log(scale));\n },\n\n cdf: function cdf(x, shape, scale) {\n if (x < 0)\n return 0;\n return jStat.lowRegGamma(shape, x / scale);\n },\n\n inv: function(p, shape, scale) {\n return jStat.gammapinv(p, shape) * scale;\n },\n\n mean : function(shape, scale) {\n return shape * scale;\n },\n\n mode: function mode(shape, scale) {\n if(shape > 1) return (shape - 1) * scale;\n return undefined;\n },\n\n sample: function sample(shape, scale) {\n return jStat.randg(shape) * scale;\n },\n\n variance: function variance(shape, scale) {\n return shape * scale * scale;\n }\n});\n\n// extend inverse gamma function with static methods\njStat.extend(jStat.invgamma, {\n pdf: function pdf(x, shape, scale) {\n if (x <= 0)\n return 0;\n return Math.exp(-(shape + 1) * Math.log(x) - scale / x -\n jStat.gammaln(shape) + shape * Math.log(scale));\n },\n\n cdf: function cdf(x, shape, scale) {\n if (x <= 0)\n return 0;\n return 1 - jStat.lowRegGamma(shape, scale / x);\n },\n\n inv: function(p, shape, scale) {\n return scale / jStat.gammapinv(1 - p, shape);\n },\n\n mean : function(shape, scale) {\n return (shape > 1) ? scale / (shape - 1) : undefined;\n },\n\n mode: function mode(shape, scale) {\n return scale / (shape + 1);\n },\n\n sample: function sample(shape, scale) {\n return scale / jStat.randg(shape);\n },\n\n variance: function variance(shape, scale) {\n if (shape <= 2)\n return undefined;\n return scale * scale / ((shape - 1) * (shape - 1) * (shape - 2));\n }\n});\n\n\n// extend kumaraswamy function with static methods\njStat.extend(jStat.kumaraswamy, {\n pdf: function pdf(x, alpha, beta) {\n if (x === 0 && alpha === 1)\n return beta;\n else if (x === 1 && beta === 1)\n return alpha;\n return Math.exp(Math.log(alpha) + Math.log(beta) + (alpha - 1) *\n Math.log(x) + (beta - 1) *\n Math.log(1 - Math.pow(x, alpha)));\n },\n\n cdf: function cdf(x, alpha, beta) {\n if (x < 0)\n return 0;\n else if (x > 1)\n return 1;\n return (1 - Math.pow(1 - Math.pow(x, alpha), beta));\n },\n\n inv: function inv(p, alpha, beta) {\n return Math.pow(1 - Math.pow(1 - p, 1 / beta), 1 / alpha);\n },\n\n mean : function(alpha, beta) {\n return (beta * jStat.gammafn(1 + 1 / alpha) *\n jStat.gammafn(beta)) / (jStat.gammafn(1 + 1 / alpha + beta));\n },\n\n median: function median(alpha, beta) {\n return Math.pow(1 - Math.pow(2, -1 / beta), 1 / alpha);\n },\n\n mode: function mode(alpha, beta) {\n if (!(alpha >= 1 && beta >= 1 && (alpha !== 1 && beta !== 1)))\n return undefined;\n return Math.pow((alpha - 1) / (alpha * beta - 1), 1 / alpha);\n },\n\n variance: function variance(alpha, beta) {\n throw new Error('variance not yet implemented');\n // TODO: complete this\n }\n});\n\n\n\n// extend lognormal function with static methods\njStat.extend(jStat.lognormal, {\n pdf: function pdf(x, mu, sigma) {\n if (x <= 0)\n return 0;\n return Math.exp(-Math.log(x) - 0.5 * Math.log(2 * Math.PI) -\n Math.log(sigma) - Math.pow(Math.log(x) - mu, 2) /\n (2 * sigma * sigma));\n },\n\n cdf: function cdf(x, mu, sigma) {\n if (x < 0)\n return 0;\n return 0.5 +\n (0.5 * jStat.erf((Math.log(x) - mu) / Math.sqrt(2 * sigma * sigma)));\n },\n\n inv: function(p, mu, sigma) {\n return Math.exp(-1.41421356237309505 * sigma * jStat.erfcinv(2 * p) + mu);\n },\n\n mean: function mean(mu, sigma) {\n return Math.exp(mu + sigma * sigma / 2);\n },\n\n median: function median(mu, sigma) {\n return Math.exp(mu);\n },\n\n mode: function mode(mu, sigma) {\n return Math.exp(mu - sigma * sigma);\n },\n\n sample: function sample(mu, sigma) {\n return Math.exp(jStat.randn() * sigma + mu);\n },\n\n variance: function variance(mu, sigma) {\n return (Math.exp(sigma * sigma) - 1) * Math.exp(2 * mu + sigma * sigma);\n }\n});\n\n\n\n// extend noncentralt function with static methods\njStat.extend(jStat.noncentralt, {\n pdf: function pdf(x, dof, ncp) {\n var tol = 1e-14;\n if (Math.abs(ncp) < tol) // ncp approx 0; use student-t\n return jStat.studentt.pdf(x, dof)\n\n if (Math.abs(x) < tol) { // different formula for x == 0\n return Math.exp(jStat.gammaln((dof + 1) / 2) - ncp * ncp / 2 -\n 0.5 * Math.log(Math.PI * dof) - jStat.gammaln(dof / 2));\n }\n\n // formula for x != 0\n return dof / x *\n (jStat.noncentralt.cdf(x * Math.sqrt(1 + 2 / dof), dof+2, ncp) -\n jStat.noncentralt.cdf(x, dof, ncp));\n },\n\n cdf: function cdf(x, dof, ncp) {\n var tol = 1e-14;\n var min_iterations = 200;\n\n if (Math.abs(ncp) < tol) // ncp approx 0; use student-t\n return jStat.studentt.cdf(x, dof);\n\n // turn negative x into positive and flip result afterwards\n var flip = false;\n if (x < 0) {\n flip = true;\n ncp = -ncp;\n }\n\n var prob = jStat.normal.cdf(-ncp, 0, 1);\n var value = tol + 1;\n // use value at last two steps to determine convergence\n var lastvalue = value;\n var y = x * x / (x * x + dof);\n var j = 0;\n var p = Math.exp(-ncp * ncp / 2);\n var q = Math.exp(-ncp * ncp / 2 - 0.5 * Math.log(2) -\n jStat.gammaln(3 / 2)) * ncp;\n while (j < min_iterations || lastvalue > tol || value > tol) {\n lastvalue = value;\n if (j > 0) {\n p *= (ncp * ncp) / (2 * j);\n q *= (ncp * ncp) / (2 * (j + 1 / 2));\n }\n value = p * jStat.beta.cdf(y, j + 0.5, dof / 2) +\n q * jStat.beta.cdf(y, j+1, dof/2);\n prob += 0.5 * value;\n j++;\n }\n\n return flip ? (1 - prob) : prob;\n }\n});\n\n\n// extend normal function with static methods\njStat.extend(jStat.normal, {\n pdf: function pdf(x, mean, std) {\n return Math.exp(-0.5 * Math.log(2 * Math.PI) -\n Math.log(std) - Math.pow(x - mean, 2) / (2 * std * std));\n },\n\n cdf: function cdf(x, mean, std) {\n return 0.5 * (1 + jStat.erf((x - mean) / Math.sqrt(2 * std * std)));\n },\n\n inv: function(p, mean, std) {\n return -1.41421356237309505 * std * jStat.erfcinv(2 * p) + mean;\n },\n\n mean : function(mean, std) {\n return mean;\n },\n\n median: function median(mean, std) {\n return mean;\n },\n\n mode: function (mean, std) {\n return mean;\n },\n\n sample: function sample(mean, std) {\n return jStat.randn() * std + mean;\n },\n\n variance : function(mean, std) {\n return std * std;\n }\n});\n\n\n\n// extend pareto function with static methods\njStat.extend(jStat.pareto, {\n pdf: function pdf(x, scale, shape) {\n if (x < scale)\n return 0;\n return (shape * Math.pow(scale, shape)) / Math.pow(x, shape + 1);\n },\n\n cdf: function cdf(x, scale, shape) {\n if (x < scale)\n return 0;\n return 1 - Math.pow(scale / x, shape);\n },\n\n inv: function inv(p, scale, shape) {\n return scale / Math.pow(1 - p, 1 / shape);\n },\n\n mean: function mean(scale, shape) {\n if (shape <= 1)\n return undefined;\n return (shape * Math.pow(scale, shape)) / (shape - 1);\n },\n\n median: function median(scale, shape) {\n return scale * (shape * Math.SQRT2);\n },\n\n mode: function mode(scale, shape) {\n return scale;\n },\n\n variance : function(scale, shape) {\n if (shape <= 2)\n return undefined;\n return (scale*scale * shape) / (Math.pow(shape - 1, 2) * (shape - 2));\n }\n});\n\n\n\n// extend studentt function with static methods\njStat.extend(jStat.studentt, {\n pdf: function pdf(x, dof) {\n dof = dof > 1e100 ? 1e100 : dof;\n return (1/(Math.sqrt(dof) * jStat.betafn(0.5, dof/2))) *\n Math.pow(1 + ((x * x) / dof), -((dof + 1) / 2));\n },\n\n cdf: function cdf(x, dof) {\n var dof2 = dof / 2;\n return jStat.ibeta((x + Math.sqrt(x * x + dof)) /\n (2 * Math.sqrt(x * x + dof)), dof2, dof2);\n },\n\n inv: function(p, dof) {\n var x = jStat.ibetainv(2 * Math.min(p, 1 - p), 0.5 * dof, 0.5);\n x = Math.sqrt(dof * (1 - x) / x);\n return (p > 0.5) ? x : -x;\n },\n\n mean: function mean(dof) {\n return (dof > 1) ? 0 : undefined;\n },\n\n median: function median(dof) {\n return 0;\n },\n\n mode: function mode(dof) {\n return 0;\n },\n\n sample: function sample(dof) {\n return jStat.randn() * Math.sqrt(dof / (2 * jStat.randg(dof / 2)));\n },\n\n variance: function variance(dof) {\n return (dof > 2) ? dof / (dof - 2) : (dof > 1) ? Infinity : undefined;\n }\n});\n\n\n\n// extend weibull function with static methods\njStat.extend(jStat.weibull, {\n pdf: function pdf(x, scale, shape) {\n if (x < 0 || scale < 0 || shape < 0)\n return 0;\n return (shape / scale) * Math.pow((x / scale), (shape - 1)) *\n Math.exp(-(Math.pow((x / scale), shape)));\n },\n\n cdf: function cdf(x, scale, shape) {\n return x < 0 ? 0 : 1 - Math.exp(-Math.pow((x / scale), shape));\n },\n\n inv: function(p, scale, shape) {\n return scale * Math.pow(-Math.log(1 - p), 1 / shape);\n },\n\n mean : function(scale, shape) {\n return scale * jStat.gammafn(1 + 1 / shape);\n },\n\n median: function median(scale, shape) {\n return scale * Math.pow(Math.log(2), 1 / shape);\n },\n\n mode: function mode(scale, shape) {\n if (shape <= 1)\n return 0;\n return scale * Math.pow((shape - 1) / shape, 1 / shape);\n },\n\n sample: function sample(scale, shape) {\n return scale * Math.pow(-Math.log(Math.random()), 1 / shape);\n },\n\n variance: function variance(scale, shape) {\n return scale * scale * jStat.gammafn(1 + 2 / shape) -\n Math.pow(jStat.weibull.mean(scale, shape), 2);\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.uniform, {\n pdf: function pdf(x, a, b) {\n return (x < a || x > b) ? 0 : 1 / (b - a);\n },\n\n cdf: function cdf(x, a, b) {\n if (x < a)\n return 0;\n else if (x < b)\n return (x - a) / (b - a);\n return 1;\n },\n\n inv: function(p, a, b) {\n return a + (p * (b - a));\n },\n\n mean: function mean(a, b) {\n return 0.5 * (a + b);\n },\n\n median: function median(a, b) {\n return jStat.mean(a, b);\n },\n\n mode: function mode(a, b) {\n throw new Error('mode is not yet implemented');\n },\n\n sample: function sample(a, b) {\n return (a / 2 + b / 2) + (b / 2 - a / 2) * (2 * Math.random() - 1);\n },\n\n variance: function variance(a, b) {\n return Math.pow(b - a, 2) / 12;\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.binomial, {\n pdf: function pdf(k, n, p) {\n return (p === 0 || p === 1) ?\n ((n * p) === k ? 1 : 0) :\n jStat.combination(n, k) * Math.pow(p, k) * Math.pow(1 - p, n - k);\n },\n\n cdf: function cdf(x, n, p) {\n var binomarr = [],\n k = 0;\n if (x < 0) {\n return 0;\n }\n if (x < n) {\n for (; k <= x; k++) {\n binomarr[ k ] = jStat.binomial.pdf(k, n, p);\n }\n return jStat.sum(binomarr);\n }\n return 1;\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.negbin, {\n pdf: function pdf(k, r, p) {\n if (k !== k >>> 0)\n return false;\n if (k < 0)\n return 0;\n return jStat.combination(k + r - 1, r - 1) *\n Math.pow(1 - p, k) * Math.pow(p, r);\n },\n\n cdf: function cdf(x, r, p) {\n var sum = 0,\n k = 0;\n if (x < 0) return 0;\n for (; k <= x; k++) {\n sum += jStat.negbin.pdf(k, r, p);\n }\n return sum;\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.hypgeom, {\n pdf: function pdf(k, N, m, n) {\n // Hypergeometric PDF.\n\n // A simplification of the CDF algorithm below.\n\n // k = number of successes drawn\n // N = population size\n // m = number of successes in population\n // n = number of items drawn from population\n\n if(k !== k | 0) {\n return false;\n } else if(k < 0 || k < m - (N - n)) {\n // It's impossible to have this few successes drawn.\n return 0;\n } else if(k > n || k > m) {\n // It's impossible to have this many successes drawn.\n return 0;\n } else if (m * 2 > N) {\n // More than half the population is successes.\n\n if(n * 2 > N) {\n // More than half the population is sampled.\n\n return jStat.hypgeom.pdf(N - m - n + k, N, N - m, N - n)\n } else {\n // Half or less of the population is sampled.\n\n return jStat.hypgeom.pdf(n - k, N, N - m, n);\n }\n\n } else if(n * 2 > N) {\n // Half or less is successes.\n\n return jStat.hypgeom.pdf(m - k, N, m, N - n);\n\n } else if(m < n) {\n // We want to have the number of things sampled to be less than the\n // successes available. So swap the definitions of successful and sampled.\n return jStat.hypgeom.pdf(k, N, n, m);\n } else {\n // If we get here, half or less of the population was sampled, half or\n // less of it was successes, and we had fewer sampled things than\n // successes. Now we can do this complicated iterative algorithm in an\n // efficient way.\n\n // The basic premise of the algorithm is that we partially normalize our\n // intermediate product to keep it in a numerically good region, and then\n // finish the normalization at the end.\n\n // This variable holds the scaled probability of the current number of\n // successes.\n var scaledPDF = 1;\n\n // This keeps track of how much we have normalized.\n var samplesDone = 0;\n\n for(var i = 0; i < k; i++) {\n // For every possible number of successes up to that observed...\n\n while(scaledPDF > 1 && samplesDone < n) {\n // Intermediate result is growing too big. Apply some of the\n // normalization to shrink everything.\n\n scaledPDF *= 1 - (m / (N - samplesDone));\n\n // Say we've normalized by this sample already.\n samplesDone++;\n }\n\n // Work out the partially-normalized hypergeometric PDF for the next\n // number of successes\n scaledPDF *= (n - i) * (m - i) / ((i + 1) * (N - m - n + i + 1));\n }\n\n for(; samplesDone < n; samplesDone++) {\n // Apply all the rest of the normalization\n scaledPDF *= 1 - (m / (N - samplesDone));\n }\n\n // Bound answer sanely before returning.\n return Math.min(1, Math.max(0, scaledPDF));\n }\n },\n\n cdf: function cdf(x, N, m, n) {\n // Hypergeometric CDF.\n\n // This algorithm is due to Prof. Thomas S. Ferguson, ,\n // and comes from his hypergeometric test calculator at\n // .\n\n // x = number of successes drawn\n // N = population size\n // m = number of successes in population\n // n = number of items drawn from population\n\n if(x < 0 || x < m - (N - n)) {\n // It's impossible to have this few successes drawn or fewer.\n return 0;\n } else if(x >= n || x >= m) {\n // We will always have this many successes or fewer.\n return 1;\n } else if (m * 2 > N) {\n // More than half the population is successes.\n\n if(n * 2 > N) {\n // More than half the population is sampled.\n\n return jStat.hypgeom.cdf(N - m - n + x, N, N - m, N - n)\n } else {\n // Half or less of the population is sampled.\n\n return 1 - jStat.hypgeom.cdf(n - x - 1, N, N - m, n);\n }\n\n } else if(n * 2 > N) {\n // Half or less is successes.\n\n return 1 - jStat.hypgeom.cdf(m - x - 1, N, m, N - n);\n\n } else if(m < n) {\n // We want to have the number of things sampled to be less than the\n // successes available. So swap the definitions of successful and sampled.\n return jStat.hypgeom.cdf(x, N, n, m);\n } else {\n // If we get here, half or less of the population was sampled, half or\n // less of it was successes, and we had fewer sampled things than\n // successes. Now we can do this complicated iterative algorithm in an\n // efficient way.\n\n // The basic premise of the algorithm is that we partially normalize our\n // intermediate sum to keep it in a numerically good region, and then\n // finish the normalization at the end.\n\n // Holds the intermediate, scaled total CDF.\n var scaledCDF = 1;\n\n // This variable holds the scaled probability of the current number of\n // successes.\n var scaledPDF = 1;\n\n // This keeps track of how much we have normalized.\n var samplesDone = 0;\n\n for(var i = 0; i < x; i++) {\n // For every possible number of successes up to that observed...\n\n while(scaledCDF > 1 && samplesDone < n) {\n // Intermediate result is growing too big. Apply some of the\n // normalization to shrink everything.\n\n var factor = 1 - (m / (N - samplesDone));\n\n scaledPDF *= factor;\n scaledCDF *= factor;\n\n // Say we've normalized by this sample already.\n samplesDone++;\n }\n\n // Work out the partially-normalized hypergeometric PDF for the next\n // number of successes\n scaledPDF *= (n - i) * (m - i) / ((i + 1) * (N - m - n + i + 1));\n\n // Add to the CDF answer.\n scaledCDF += scaledPDF;\n }\n\n for(; samplesDone < n; samplesDone++) {\n // Apply all the rest of the normalization\n scaledCDF *= 1 - (m / (N - samplesDone));\n }\n\n // Bound answer sanely before returning.\n return Math.min(1, Math.max(0, scaledCDF));\n }\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.poisson, {\n pdf: function pdf(k, l) {\n if (l < 0 || (k % 1) !== 0 || k < 0) {\n return 0;\n }\n\n return Math.pow(l, k) * Math.exp(-l) / jStat.factorial(k);\n },\n\n cdf: function cdf(x, l) {\n var sumarr = [],\n k = 0;\n if (x < 0) return 0;\n for (; k <= x; k++) {\n sumarr.push(jStat.poisson.pdf(k, l));\n }\n return jStat.sum(sumarr);\n },\n\n mean : function(l) {\n return l;\n },\n\n variance : function(l) {\n return l;\n },\n\n sample: function sample(l) {\n var p = 1, k = 0, L = Math.exp(-l);\n do {\n k++;\n p *= Math.random();\n } while (p > L);\n return k - 1;\n }\n});\n\n// extend triangular function with static methods\njStat.extend(jStat.triangular, {\n pdf: function pdf(x, a, b, c) {\n if (b <= a || c < a || c > b) {\n return NaN;\n } else {\n if (x < a || x > b) {\n return 0;\n } else if (x < c) {\n return (2 * (x - a)) / ((b - a) * (c - a));\n } else if (x === c) {\n return (2 / (b - a));\n } else { // x > c\n return (2 * (b - x)) / ((b - a) * (b - c));\n }\n }\n },\n\n cdf: function cdf(x, a, b, c) {\n if (b <= a || c < a || c > b)\n return NaN;\n if (x <= a)\n return 0;\n else if (x >= b)\n return 1;\n if (x <= c)\n return Math.pow(x - a, 2) / ((b - a) * (c - a));\n else // x > c\n return 1 - Math.pow(b - x, 2) / ((b - a) * (b - c));\n },\n\n inv: function inv(p, a, b, c) {\n if (b <= a || c < a || c > b) {\n return NaN;\n } else {\n if (p <= ((c - a) / (b - a))) {\n return a + (b - a) * Math.sqrt(p * ((c - a) / (b - a)));\n } else { // p > ((c - a) / (b - a))\n return a + (b - a) * (1 - Math.sqrt((1 - p) * (1 - ((c - a) / (b - a)))));\n }\n }\n },\n\n mean: function mean(a, b, c) {\n return (a + b + c) / 3;\n },\n\n median: function median(a, b, c) {\n if (c <= (a + b) / 2) {\n return b - Math.sqrt((b - a) * (b - c)) / Math.sqrt(2);\n } else if (c > (a + b) / 2) {\n return a + Math.sqrt((b - a) * (c - a)) / Math.sqrt(2);\n }\n },\n\n mode: function mode(a, b, c) {\n return c;\n },\n\n sample: function sample(a, b, c) {\n var u = Math.random();\n if (u < ((c - a) / (b - a)))\n return a + Math.sqrt(u * (b - a) * (c - a))\n return b - Math.sqrt((1 - u) * (b - a) * (b - c));\n },\n\n variance: function variance(a, b, c) {\n return (a * a + b * b + c * c - a * b - a * c - b * c) / 18;\n }\n});\n\nfunction laplaceSign(x) { return x / Math.abs(x); }\n\njStat.extend(jStat.laplace, {\n pdf: function pdf(x, mu, b) {\n return (b <= 0) ? 0 : (Math.exp(-Math.abs(x - mu) / b)) / (2 * b);\n },\n\n cdf: function cdf(x, mu, b) {\n if (b <= 0) { return 0; }\n\n if(x < mu) {\n return 0.5 * Math.exp((x - mu) / b);\n } else {\n return 1 - 0.5 * Math.exp(- (x - mu) / b);\n }\n },\n\n mean: function(mu, b) {\n return mu;\n },\n\n median: function(mu, b) {\n return mu;\n },\n\n mode: function(mu, b) {\n return mu;\n },\n\n variance: function(mu, b) {\n return 2 * b * b;\n },\n\n sample: function sample(mu, b) {\n var u = Math.random() - 0.5;\n\n return mu - (b * laplaceSign(u) * Math.log(1 - (2 * Math.abs(u))));\n }\n});\n\n}(this.jStat, Math));\n/* Provides functions for the solution of linear system of equations, integration, extrapolation,\n * interpolation, eigenvalue problems, differential equations and PCA analysis. */\n\n(function(jStat, Math) {\n\nvar push = Array.prototype.push;\nvar isArray = jStat.utils.isArray;\n\nfunction isUsable(arg) {\n return isArray(arg) || arg instanceof jStat;\n}\n\njStat.extend({\n\n // add a vector/matrix to a vector/matrix or scalar\n add: function add(arr, arg) {\n // check if arg is a vector or scalar\n if (isUsable(arg)) {\n if (!isUsable(arg[0])) arg = [ arg ];\n return jStat.map(arr, function(value, row, col) {\n return value + arg[row][col];\n });\n }\n return jStat.map(arr, function(value) { return value + arg; });\n },\n\n // subtract a vector or scalar from the vector\n subtract: function subtract(arr, arg) {\n // check if arg is a vector or scalar\n if (isUsable(arg)) {\n if (!isUsable(arg[0])) arg = [ arg ];\n return jStat.map(arr, function(value, row, col) {\n return value - arg[row][col] || 0;\n });\n }\n return jStat.map(arr, function(value) { return value - arg; });\n },\n\n // matrix division\n divide: function divide(arr, arg) {\n if (isUsable(arg)) {\n if (!isUsable(arg[0])) arg = [ arg ];\n return jStat.multiply(arr, jStat.inv(arg));\n }\n return jStat.map(arr, function(value) { return value / arg; });\n },\n\n // matrix multiplication\n multiply: function multiply(arr, arg) {\n var row, col, nrescols, sum, nrow, ncol, res, rescols;\n // eg: arr = 2 arg = 3 -> 6 for res[0][0] statement closure\n if (arr.length === undefined && arg.length === undefined) {\n return arr * arg;\n }\n nrow = arr.length,\n ncol = arr[0].length,\n res = jStat.zeros(nrow, nrescols = (isUsable(arg)) ? arg[0].length : ncol),\n rescols = 0;\n if (isUsable(arg)) {\n for (; rescols < nrescols; rescols++) {\n for (row = 0; row < nrow; row++) {\n sum = 0;\n for (col = 0; col < ncol; col++)\n sum += arr[row][col] * arg[col][rescols];\n res[row][rescols] = sum;\n }\n }\n return (nrow === 1 && rescols === 1) ? res[0][0] : res;\n }\n return jStat.map(arr, function(value) { return value * arg; });\n },\n\n // outer([1,2,3],[4,5,6])\n // ===\n // [[1],[2],[3]] times [[4,5,6]]\n // ->\n // [[4,5,6],[8,10,12],[12,15,18]]\n outer:function outer(A, B) {\n return jStat.multiply(A.map(function(t){ return [t] }), [B]);\n },\n\n\n // Returns the dot product of two matricies\n dot: function dot(arr, arg) {\n if (!isUsable(arr[0])) arr = [ arr ];\n if (!isUsable(arg[0])) arg = [ arg ];\n // convert column to row vector\n var left = (arr[0].length === 1 && arr.length !== 1) ? jStat.transpose(arr) : arr,\n right = (arg[0].length === 1 && arg.length !== 1) ? jStat.transpose(arg) : arg,\n res = [],\n row = 0,\n nrow = left.length,\n ncol = left[0].length,\n sum, col;\n for (; row < nrow; row++) {\n res[row] = [];\n sum = 0;\n for (col = 0; col < ncol; col++)\n sum += left[row][col] * right[row][col];\n res[row] = sum;\n }\n return (res.length === 1) ? res[0] : res;\n },\n\n // raise every element by a scalar\n pow: function pow(arr, arg) {\n return jStat.map(arr, function(value) { return Math.pow(value, arg); });\n },\n\n // exponentiate every element\n exp: function exp(arr) {\n return jStat.map(arr, function(value) { return Math.exp(value); });\n },\n\n // generate the natural log of every element\n log: function exp(arr) {\n return jStat.map(arr, function(value) { return Math.log(value); });\n },\n\n // generate the absolute values of the vector\n abs: function abs(arr) {\n return jStat.map(arr, function(value) { return Math.abs(value); });\n },\n\n // computes the p-norm of the vector\n // In the case that a matrix is passed, uses the first row as the vector\n norm: function norm(arr, p) {\n var nnorm = 0,\n i = 0;\n // check the p-value of the norm, and set for most common case\n if (isNaN(p)) p = 2;\n // check if multi-dimensional array, and make vector correction\n if (isUsable(arr[0])) arr = arr[0];\n // vector norm\n for (; i < arr.length; i++) {\n nnorm += Math.pow(Math.abs(arr[i]), p);\n }\n return Math.pow(nnorm, 1 / p);\n },\n\n // computes the angle between two vectors in rads\n // In case a matrix is passed, this uses the first row as the vector\n angle: function angle(arr, arg) {\n return Math.acos(jStat.dot(arr, arg) / (jStat.norm(arr) * jStat.norm(arg)));\n },\n\n // augment one matrix by another\n // Note: this function returns a matrix, not a jStat object\n aug: function aug(a, b) {\n var newarr = [];\n for (var i = 0; i < a.length; i++) {\n newarr.push(a[i].slice());\n }\n for (var i = 0; i < newarr.length; i++) {\n push.apply(newarr[i], b[i]);\n }\n return newarr;\n },\n\n // The inv() function calculates the inverse of a matrix\n // Create the inverse by augmenting the matrix by the identity matrix of the\n // appropriate size, and then use G-J elimination on the augmented matrix.\n inv: function inv(a) {\n var rows = a.length;\n var cols = a[0].length;\n var b = jStat.identity(rows, cols);\n var c = jStat.gauss_jordan(a, b);\n var result = [];\n var i = 0;\n var j;\n\n //We need to copy the inverse portion to a new matrix to rid G-J artifacts\n for (; i < rows; i++) {\n result[i] = [];\n for (j = cols; j < c[0].length; j++)\n result[i][j - cols] = c[i][j];\n }\n return result;\n },\n\n // calculate the determinant of a matrix\n det: function det(a) {\n var alen = a.length,\n alend = alen * 2,\n vals = new Array(alend),\n rowshift = alen - 1,\n colshift = alend - 1,\n mrow = rowshift - alen + 1,\n mcol = colshift,\n i = 0,\n result = 0,\n j;\n // check for special 2x2 case\n if (alen === 2) {\n return a[0][0] * a[1][1] - a[0][1] * a[1][0];\n }\n for (; i < alend; i++) {\n vals[i] = 1;\n }\n for (var i = 0; i < alen; i++) {\n for (j = 0; j < alen; j++) {\n vals[(mrow < 0) ? mrow + alen : mrow ] *= a[i][j];\n vals[(mcol < alen) ? mcol + alen : mcol ] *= a[i][j];\n mrow++;\n mcol--;\n }\n mrow = --rowshift - alen + 1;\n mcol = --colshift;\n }\n for (var i = 0; i < alen; i++) {\n result += vals[i];\n }\n for (; i < alend; i++) {\n result -= vals[i];\n }\n return result;\n },\n\n gauss_elimination: function gauss_elimination(a, b) {\n var i = 0,\n j = 0,\n n = a.length,\n m = a[0].length,\n factor = 1,\n sum = 0,\n x = [],\n maug, pivot, temp, k;\n a = jStat.aug(a, b);\n maug = a[0].length;\n for(var i = 0; i < n; i++) {\n pivot = a[i][i];\n j = i;\n for (k = i + 1; k < m; k++) {\n if (pivot < Math.abs(a[k][i])) {\n pivot = a[k][i];\n j = k;\n }\n }\n if (j != i) {\n for(k = 0; k < maug; k++) {\n temp = a[i][k];\n a[i][k] = a[j][k];\n a[j][k] = temp;\n }\n }\n for (j = i + 1; j < n; j++) {\n factor = a[j][i] / a[i][i];\n for(k = i; k < maug; k++) {\n a[j][k] = a[j][k] - factor * a[i][k];\n }\n }\n }\n for (var i = n - 1; i >= 0; i--) {\n sum = 0;\n for (j = i + 1; j<= n - 1; j++) {\n sum = sum + x[j] * a[i][j];\n }\n x[i] =(a[i][maug - 1] - sum) / a[i][i];\n }\n return x;\n },\n\n gauss_jordan: function gauss_jordan(a, b) {\n var m = jStat.aug(a, b),\n h = m.length,\n w = m[0].length;\n // find max pivot\n for (var y = 0; y < h; y++) {\n var maxrow = y;\n for (var y2 = y+1; y2 < h; y2++) {\n if (Math.abs(m[y2][y]) > Math.abs(m[maxrow][y]))\n maxrow = y2;\n }\n var tmp = m[y];\n m[y] = m[maxrow];\n m[maxrow] = tmp\n for (var y2 = y+1; y2 < h; y2++) {\n c = m[y2][y] / m[y][y];\n for (var x = y; x < w; x++) {\n m[y2][x] -= m[y][x] * c;\n }\n }\n }\n // backsubstitute\n for (var y = h-1; y >= 0; y--) {\n c = m[y][y];\n for (var y2 = 0; y2 < y; y2++) {\n for (var x = w-1; x > y-1; x--) {\n m[y2][x] -= m[y][x] * m[y2][y] / c;\n }\n }\n m[y][y] /= c;\n for (var x = h; x < w; x++) {\n m[y][x] /= c;\n }\n }\n return m;\n },\n\n // solve equation\n // Ax=b\n // A is upper triangular matrix\n // A=[[1,2,3],[0,4,5],[0,6,7]]\n // b=[1,2,3]\n // triaUpSolve(A,b) // -> [2.666,0.1666,1.666]\n // if you use matrix style\n // A=[[1,2,3],[0,4,5],[0,6,7]]\n // b=[[1],[2],[3]]\n // will return [[2.666],[0.1666],[1.666]]\n triaUpSolve: function triaUpSolve(A, b) {\n var size = A[0].length;\n var x = jStat.zeros(1, size)[0];\n var parts;\n var matrix_mode = false;\n\n if (b[0].length != undefined) {\n b = b.map(function(i){ return i[0] });\n matrix_mode = true;\n }\n\n jStat.arange(size - 1, -1, -1).forEach(function(i) {\n parts = jStat.arange(i + 1,size).map(function(j) {\n return x[j] * A[i][j];\n });\n x[i] = (b[i] - jStat.sum(parts)) / A[i][i];\n });\n\n if (matrix_mode)\n return x.map(function(i){ return [i] });\n return x;\n },\n\n triaLowSolve: function triaLowSolve(A, b) {\n // like to triaUpSolve but A is lower triangular matrix\n var size = A[0].length;\n var x = jStat.zeros(1, size)[0];\n var parts;\n\n var matrix_mode=false;\n if (b[0].length != undefined) {\n b = b.map(function(i){ return i[0] });\n matrix_mode = true;\n }\n\n jStat.arange(size).forEach(function(i) {\n parts = jStat.arange(i).map(function(j) {\n return A[i][j] * x[j];\n });\n x[i] = (b[i] - jStat.sum(parts)) / A[i][i];\n })\n\n if (matrix_mode)\n return x.map(function(i){ return [i] });\n return x;\n },\n\n // A -> [L,U]\n // A=LU\n // L is lower triangular matrix\n // U is upper triangular matrix\n lu: function lu(A) {\n var size = A.length;\n //var L=jStat.diagonal(jStat.ones(1,size)[0]);\n var L = jStat.identity(size);\n var R = jStat.zeros(A.length, A[0].length);\n var parts;\n jStat.arange(size).forEach(function(t) {\n R[0][t] = A[0][t];\n });\n jStat.arange(1, size).forEach(function(l) {\n jStat.arange(l).forEach(function(i) {\n parts = jStat.arange(i).map(function(jj) {\n return L[l][jj] * R[jj][i];\n });\n L[l][i] = (A[l][i] - jStat.sum(parts)) / R[i][i];\n });\n jStat.arange(l, size).forEach(function(j) {\n parts = jStat.arange(l).map(function(jj) {\n return L[l][jj] * R[jj][j];\n });\n R[l][j] = A[i][j] - jStat.sum(parts);\n });\n });\n return [L, R];\n },\n\n // A -> T\n // A=TT'\n // T is lower triangular matrix\n cholesky: function cholesky(A) {\n var size = A.length;\n var T = jStat.zeros(A.length, A[0].length);\n var parts;\n jStat.arange(size).forEach(function(i) {\n parts = jStat.arange(i).map(function(t) {\n return Math.pow(T[i][t],2);\n });\n T[i][i] = Math.sqrt(A[i][i] - jStat.sum(parts));\n jStat.arange(i + 1, size).forEach(function(j) {\n parts = jStat.arange(i).map(function(t) {\n return T[i][t] * T[j][t];\n });\n T[j][i] = (A[i][j] - jStat.sum(parts)) / T[i][i];\n });\n });\n return T;\n },\n\n gauss_jacobi: function gauss_jacobi(a, b, x, r) {\n var i = 0;\n var j = 0;\n var n = a.length;\n var l = [];\n var u = [];\n var d = [];\n var xv, c, h, xk;\n for (; i < n; i++) {\n l[i] = [];\n u[i] = [];\n d[i] = [];\n for (j = 0; j < n; j++) {\n if (i > j) {\n l[i][j] = a[i][j];\n u[i][j] = d[i][j] = 0;\n } else if (i < j) {\n u[i][j] = a[i][j];\n l[i][j] = d[i][j] = 0;\n } else {\n d[i][j] = a[i][j];\n l[i][j] = u[i][j] = 0;\n }\n }\n }\n h = jStat.multiply(jStat.multiply(jStat.inv(d), jStat.add(l, u)), -1);\n c = jStat.multiply(jStat.inv(d), b);\n xv = x;\n xk = jStat.add(jStat.multiply(h, x), c);\n i = 2;\n while (Math.abs(jStat.norm(jStat.subtract(xk,xv))) > r) {\n xv = xk;\n xk = jStat.add(jStat.multiply(h, xv), c);\n i++;\n }\n return xk;\n },\n\n gauss_seidel: function gauss_seidel(a, b, x, r) {\n var i = 0;\n var n = a.length;\n var l = [];\n var u = [];\n var d = [];\n var j, xv, c, h, xk;\n for (; i < n; i++) {\n l[i] = [];\n u[i] = [];\n d[i] = [];\n for (j = 0; j < n; j++) {\n if (i > j) {\n l[i][j] = a[i][j];\n u[i][j] = d[i][j] = 0;\n } else if (i < j) {\n u[i][j] = a[i][j];\n l[i][j] = d[i][j] = 0;\n } else {\n d[i][j] = a[i][j];\n l[i][j] = u[i][j] = 0;\n }\n }\n }\n h = jStat.multiply(jStat.multiply(jStat.inv(jStat.add(d, l)), u), -1);\n c = jStat.multiply(jStat.inv(jStat.add(d, l)), b);\n xv = x;\n xk = jStat.add(jStat.multiply(h, x), c);\n i = 2;\n while (Math.abs(jStat.norm(jStat.subtract(xk, xv))) > r) {\n xv = xk;\n xk = jStat.add(jStat.multiply(h, xv), c);\n i = i + 1;\n }\n return xk;\n },\n\n SOR: function SOR(a, b, x, r, w) {\n var i = 0;\n var n = a.length;\n var l = [];\n var u = [];\n var d = [];\n var j, xv, c, h, xk;\n for (; i < n; i++) {\n l[i] = [];\n u[i] = [];\n d[i] = [];\n for (j = 0; j < n; j++) {\n if (i > j) {\n l[i][j] = a[i][j];\n u[i][j] = d[i][j] = 0;\n } else if (i < j) {\n u[i][j] = a[i][j];\n l[i][j] = d[i][j] = 0;\n } else {\n d[i][j] = a[i][j];\n l[i][j] = u[i][j] = 0;\n }\n }\n }\n h = jStat.multiply(jStat.inv(jStat.add(d, jStat.multiply(l, w))),\n jStat.subtract(jStat.multiply(d, 1 - w),\n jStat.multiply(u, w)));\n c = jStat.multiply(jStat.multiply(jStat.inv(jStat.add(d,\n jStat.multiply(l, w))), b), w);\n xv = x;\n xk = jStat.add(jStat.multiply(h, x), c);\n i = 2;\n while (Math.abs(jStat.norm(jStat.subtract(xk, xv))) > r) {\n xv = xk;\n xk = jStat.add(jStat.multiply(h, xv), c);\n i++;\n }\n return xk;\n },\n\n householder: function householder(a) {\n var m = a.length;\n var n = a[0].length;\n var i = 0;\n var w = [];\n var p = [];\n var alpha, r, k, j, factor;\n for (; i < m - 1; i++) {\n alpha = 0;\n for (j = i + 1; j < n; j++)\n alpha += (a[j][i] * a[j][i]);\n factor = (a[i + 1][i] > 0) ? -1 : 1;\n alpha = factor * Math.sqrt(alpha);\n r = Math.sqrt((((alpha * alpha) - a[i + 1][i] * alpha) / 2));\n w = jStat.zeros(m, 1);\n w[i + 1][0] = (a[i + 1][i] - alpha) / (2 * r);\n for (k = i + 2; k < m; k++) w[k][0] = a[k][i] / (2 * r);\n p = jStat.subtract(jStat.identity(m, n),\n jStat.multiply(jStat.multiply(w, jStat.transpose(w)), 2));\n a = jStat.multiply(p, jStat.multiply(a, p));\n }\n return a;\n },\n\n // A -> [Q,R]\n // Q is orthogonal matrix\n // R is upper triangular\n QR: (function() {\n // x -> Q\n // find a orthogonal matrix Q st.\n // Qx=y\n // y is [||x||,0,0,...]\n function get_Q1(x) {\n var size = x.length;\n var norm_x = jStat.norm(x,2);\n var e1 = jStat.zeros(1, size)[0];\n e1[0] = 1;\n var u = jStat.add(jStat.multiply(jStat.multiply(e1, norm_x), -1), x);\n var norm_u = jStat.norm(u, 2);\n var v = jStat.divide(u, norm_u);\n var Q = jStat.subtract(jStat.identity(size),\n jStat.multiply(jStat.outer(v, v), 2));\n return Q;\n }\n\n function qr(A) {\n var size = A[0].length;\n var QList = [];\n jStat.arange(size).forEach(function(i) {\n var x = jStat.slice(A, { row: { start: i }, col: i });\n var Q = get_Q1(x);\n var Qn = jStat.identity(A.length);\n Qn = jStat.sliceAssign(Qn, { row: { start: i }, col: { start: i }}, Q);\n A = jStat.multiply(Qn, A);\n QList.push(Qn);\n });\n var Q = QList.reduce(function(x, y){ return jStat.multiply(x,y) });\n var R = A;\n return [Q, R];\n }\n\n return qr;\n })(),\n\n lstsq: (function(A, b) {\n // solve least squard problem for Ax=b as QR decomposition way if b is\n // [[b1],[b2],[b3]] form will return [[x1],[x2],[x3]] array form solution\n // else b is [b1,b2,b3] form will return [x1,x2,x3] array form solution\n function R_I(A) {\n A = jStat.copy(A);\n var size = A.length;\n var I = jStat.identity(size);\n jStat.arange(size - 1, -1, -1).forEach(function(i) {\n jStat.sliceAssign(\n I, { row: i }, jStat.divide(jStat.slice(I, { row: i }), A[i][i]));\n jStat.sliceAssign(\n A, { row: i }, jStat.divide(jStat.slice(A, { row: i }), A[i][i]));\n jStat.arange(i).forEach(function(j) {\n var c = jStat.multiply(A[j][i], -1);\n var Aj = jStat.slice(A, { row: j });\n var cAi = jStat.multiply(jStat.slice(A, { row: i }), c);\n jStat.sliceAssign(A, { row: j }, jStat.add(Aj, cAi));\n var Ij = jStat.slice(I, { row: j });\n var cIi = jStat.multiply(jStat.slice(I, { row: i }), c);\n jStat.sliceAssign(I, { row: j }, jStat.add(Ij, cIi));\n })\n });\n return I;\n }\n\n function qr_solve(A, b){\n var array_mode = false;\n if (b[0].length === undefined) {\n // [c1,c2,c3] mode\n b = b.map(function(x){ return [x] });\n array_mode = true;\n }\n var QR = jStat.QR(A);\n var Q = QR[0];\n var R = QR[1];\n var attrs = A[0].length;\n var Q1 = jStat.slice(Q,{col:{end:attrs}});\n var R1 = jStat.slice(R,{row:{end:attrs}});\n var RI = R_I(R1);\n var x = jStat.multiply(jStat.multiply(RI, jStat.transpose(Q1)), b);\n if (array_mode)\n return x.map(function(i){ return i[0] });\n return x;\n }\n\n return qr_solve;\n })(),\n\n jacobi: function jacobi(a) {\n var condition = 1;\n var count = 0;\n var n = a.length;\n var e = jStat.identity(n, n);\n var ev = [];\n var b, i, j, p, q, maxim, theta, s;\n // condition === 1 only if tolerance is not reached\n while (condition === 1) {\n count++;\n maxim = a[0][1];\n p = 0;\n q = 1;\n for (var i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n if (i != j) {\n if (maxim < Math.abs(a[i][j])) {\n maxim = Math.abs(a[i][j]);\n p = i;\n q = j;\n }\n }\n }\n }\n if (a[p][p] === a[q][q])\n theta = (a[p][q] > 0) ? Math.PI / 4 : -Math.PI / 4;\n else\n theta = Math.atan(2 * a[p][q] / (a[p][p] - a[q][q])) / 2;\n s = jStat.identity(n, n);\n s[p][p] = Math.cos(theta);\n s[p][q] = -Math.sin(theta);\n s[q][p] = Math.sin(theta);\n s[q][q] = Math.cos(theta);\n // eigen vector matrix\n e = jStat.multiply(e, s);\n b = jStat.multiply(jStat.multiply(jStat.inv(s), a), s);\n a = b;\n condition = 0;\n for (var i = 1; i < n; i++) {\n for (j = 1; j < n; j++) {\n if (i != j && Math.abs(a[i][j]) > 0.001) {\n condition = 1;\n }\n }\n }\n }\n for (var i = 0; i < n; i++) ev.push(a[i][i]);\n //returns both the eigenvalue and eigenmatrix\n return [e, ev];\n },\n\n rungekutta: function rungekutta(f, h, p, t_j, u_j, order) {\n var k1, k2, u_j1, k3, k4;\n if (order === 2) {\n while (t_j <= p) {\n k1 = h * f(t_j, u_j);\n k2 = h * f(t_j + h, u_j + k1);\n u_j1 = u_j + (k1 + k2) / 2;\n u_j = u_j1;\n t_j = t_j + h;\n }\n }\n if (order === 4) {\n while (t_j <= p) {\n k1 = h * f(t_j, u_j);\n k2 = h * f(t_j + h / 2, u_j + k1 / 2);\n k3 = h * f(t_j + h / 2, u_j + k2 / 2);\n k4 = h * f(t_j +h, u_j + k3);\n u_j1 = u_j + (k1 + 2 * k2 + 2 * k3 + k4) / 6;\n u_j = u_j1;\n t_j = t_j + h;\n }\n }\n return u_j;\n },\n\n romberg: function romberg(f, a, b, order) {\n var i = 0;\n var h = (b - a) / 2;\n var x = [];\n var h1 = [];\n var g = [];\n var m, a1, j, k, I, d;\n while (i < order / 2) {\n I = f(a);\n for (j = a, k = 0; j <= b; j = j + h, k++) x[k] = j;\n m = x.length;\n for (j = 1; j < m - 1; j++) {\n I += (((j % 2) !== 0) ? 4 : 2) * f(x[j]);\n }\n I = (h / 3) * (I + f(b));\n g[i] = I;\n h /= 2;\n i++;\n }\n a1 = g.length;\n m = 1;\n while (a1 !== 1) {\n for (j = 0; j < a1 - 1; j++)\n h1[j] = ((Math.pow(4, m)) * g[j + 1] - g[j]) / (Math.pow(4, m) - 1);\n a1 = h1.length;\n g = h1;\n h1 = [];\n m++;\n }\n return g;\n },\n\n richardson: function richardson(X, f, x, h) {\n function pos(X, x) {\n var i = 0;\n var n = X.length;\n var p;\n for (; i < n; i++)\n if (X[i] === x) p = i;\n return p;\n }\n var n = X.length,\n h_min = Math.abs(x - X[pos(X, x) + 1]),\n i = 0,\n g = [],\n h1 = [],\n y1, y2, m, a, j;\n while (h >= h_min) {\n y1 = pos(X, x + h);\n y2 = pos(X, x);\n g[i] = (f[y1] - 2 * f[y2] + f[2 * y2 - y1]) / (h * h);\n h /= 2;\n i++;\n }\n a = g.length;\n m = 1;\n while (a != 1) {\n for (j = 0; j < a - 1; j++)\n h1[j] = ((Math.pow(4, m)) * g[j + 1] - g[j]) / (Math.pow(4, m) - 1);\n a = h1.length;\n g = h1;\n h1 = [];\n m++;\n }\n return g;\n },\n\n simpson: function simpson(f, a, b, n) {\n var h = (b - a) / n;\n var I = f(a);\n var x = [];\n var j = a;\n var k = 0;\n var i = 1;\n var m;\n for (; j <= b; j = j + h, k++)\n x[k] = j;\n m = x.length;\n for (; i < m - 1; i++) {\n I += ((i % 2 !== 0) ? 4 : 2) * f(x[i]);\n }\n return (h / 3) * (I + f(b));\n },\n\n hermite: function hermite(X, F, dF, value) {\n var n = X.length;\n var p = 0;\n var i = 0;\n var l = [];\n var dl = [];\n var A = [];\n var B = [];\n var j;\n for (; i < n; i++) {\n l[i] = 1;\n for (j = 0; j < n; j++) {\n if (i != j) l[i] *= (value - X[j]) / (X[i] - X[j]);\n }\n dl[i] = 0;\n for (j = 0; j < n; j++) {\n if (i != j) dl[i] += 1 / (X [i] - X[j]);\n }\n A[i] = (1 - 2 * (value - X[i]) * dl[i]) * (l[i] * l[i]);\n B[i] = (value - X[i]) * (l[i] * l[i]);\n p += (A[i] * F[i] + B[i] * dF[i]);\n }\n return p;\n },\n\n lagrange: function lagrange(X, F, value) {\n var p = 0;\n var i = 0;\n var j, l;\n var n = X.length;\n for (; i < n; i++) {\n l = F[i];\n for (j = 0; j < n; j++) {\n // calculating the lagrange polynomial L_i\n if (i != j) l *= (value - X[j]) / (X[i] - X[j]);\n }\n // adding the lagrange polynomials found above\n p += l;\n }\n return p;\n },\n\n cubic_spline: function cubic_spline(X, F, value) {\n var n = X.length;\n var i = 0, j;\n var A = [];\n var B = [];\n var alpha = [];\n var c = [];\n var h = [];\n var b = [];\n var d = [];\n for (; i < n - 1; i++)\n h[i] = X[i + 1] - X[i];\n alpha[0] = 0;\n for (var i = 1; i < n - 1; i++) {\n alpha[i] = (3 / h[i]) * (F[i + 1] - F[i]) -\n (3 / h[i-1]) * (F[i] - F[i-1]);\n }\n for (var i = 1; i < n - 1; i++) {\n A[i] = [];\n B[i] = [];\n A[i][i-1] = h[i-1];\n A[i][i] = 2 * (h[i - 1] + h[i]);\n A[i][i+1] = h[i];\n B[i][0] = alpha[i];\n }\n c = jStat.multiply(jStat.inv(A), B);\n for (j = 0; j < n - 1; j++) {\n b[j] = (F[j + 1] - F[j]) / h[j] - h[j] * (c[j + 1][0] + 2 * c[j][0]) / 3;\n d[j] = (c[j + 1][0] - c[j][0]) / (3 * h[j]);\n }\n for (j = 0; j < n; j++) {\n if (X[j] > value) break;\n }\n j -= 1;\n return F[j] + (value - X[j]) * b[j] + jStat.sq(value-X[j]) *\n c[j] + (value - X[j]) * jStat.sq(value - X[j]) * d[j];\n },\n\n gauss_quadrature: function gauss_quadrature() {\n throw new Error('gauss_quadrature not yet implemented');\n },\n\n PCA: function PCA(X) {\n var m = X.length;\n var n = X[0].length;\n var flag = false;\n var i = 0;\n var j, temp1;\n var u = [];\n var D = [];\n var result = [];\n var temp2 = [];\n var Y = [];\n var Bt = [];\n var B = [];\n var C = [];\n var V = [];\n var Vt = [];\n for (var i = 0; i < m; i++) {\n u[i] = jStat.sum(X[i]) / n;\n }\n for (var i = 0; i < n; i++) {\n B[i] = [];\n for(j = 0; j < m; j++) {\n B[i][j] = X[j][i] - u[j];\n }\n }\n B = jStat.transpose(B);\n for (var i = 0; i < m; i++) {\n C[i] = [];\n for (j = 0; j < m; j++) {\n C[i][j] = (jStat.dot([B[i]], [B[j]])) / (n - 1);\n }\n }\n result = jStat.jacobi(C);\n V = result[0];\n D = result[1];\n Vt = jStat.transpose(V);\n for (var i = 0; i < D.length; i++) {\n for (j = i; j < D.length; j++) {\n if(D[i] < D[j]) {\n temp1 = D[i];\n D[i] = D[j];\n D[j] = temp1;\n temp2 = Vt[i];\n Vt[i] = Vt[j];\n Vt[j] = temp2;\n }\n }\n }\n Bt = jStat.transpose(B);\n for (var i = 0; i < m; i++) {\n Y[i] = [];\n for (j = 0; j < Bt.length; j++) {\n Y[i][j] = jStat.dot([Vt[i]], [Bt[j]]);\n }\n }\n return [X, D, Vt, Y];\n }\n});\n\n// extend jStat.fn with methods that require one argument\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jStat.fn[passfunc] = function(arg, func) {\n var tmpthis = this;\n // check for callback\n if (func) {\n setTimeout(function() {\n func.call(tmpthis, jStat.fn[passfunc].call(tmpthis, arg));\n }, 15);\n return this;\n }\n if (typeof jStat[passfunc](this, arg) === 'number')\n return jStat[passfunc](this, arg);\n else\n return jStat(jStat[passfunc](this, arg));\n };\n }(funcs[i]));\n}('add divide multiply subtract dot pow exp log abs norm angle'.split(' ')));\n\n}(this.jStat, Math));\n(function(jStat, Math) {\n\nvar slice = [].slice;\nvar isNumber = jStat.utils.isNumber;\nvar isArray = jStat.utils.isArray;\n\n// flag==true denotes use of sample standard deviation\n// Z Statistics\njStat.extend({\n // 2 different parameter lists:\n // (value, mean, sd)\n // (value, array, flag)\n zscore: function zscore() {\n var args = slice.call(arguments);\n if (isNumber(args[1])) {\n return (args[0] - args[1]) / args[2];\n }\n return (args[0] - jStat.mean(args[1])) / jStat.stdev(args[1], args[2]);\n },\n\n // 3 different paramter lists:\n // (value, mean, sd, sides)\n // (zscore, sides)\n // (value, array, sides, flag)\n ztest: function ztest() {\n var args = slice.call(arguments);\n var z;\n if (isArray(args[1])) {\n // (value, array, sides, flag)\n z = jStat.zscore(args[0],args[1],args[3]);\n return (args[2] === 1) ?\n (jStat.normal.cdf(-Math.abs(z), 0, 1)) :\n (jStat.normal.cdf(-Math.abs(z), 0, 1)*2);\n } else {\n if (args.length > 2) {\n // (value, mean, sd, sides)\n z = jStat.zscore(args[0],args[1],args[2]);\n return (args[3] === 1) ?\n (jStat.normal.cdf(-Math.abs(z),0,1)) :\n (jStat.normal.cdf(-Math.abs(z),0,1)* 2);\n } else {\n // (zscore, sides)\n z = args[0];\n return (args[1] === 1) ?\n (jStat.normal.cdf(-Math.abs(z),0,1)) :\n (jStat.normal.cdf(-Math.abs(z),0,1)*2);\n }\n }\n }\n});\n\njStat.extend(jStat.fn, {\n zscore: function zscore(value, flag) {\n return (value - this.mean()) / this.stdev(flag);\n },\n\n ztest: function ztest(value, sides, flag) {\n var zscore = Math.abs(this.zscore(value, flag));\n return (sides === 1) ?\n (jStat.normal.cdf(-zscore, 0, 1)) :\n (jStat.normal.cdf(-zscore, 0, 1) * 2);\n }\n});\n\n// T Statistics\njStat.extend({\n // 2 parameter lists\n // (value, mean, sd, n)\n // (value, array)\n tscore: function tscore() {\n var args = slice.call(arguments);\n return (args.length === 4) ?\n ((args[0] - args[1]) / (args[2] / Math.sqrt(args[3]))) :\n ((args[0] - jStat.mean(args[1])) /\n (jStat.stdev(args[1], true) / Math.sqrt(args[1].length)));\n },\n\n // 3 different paramter lists:\n // (value, mean, sd, n, sides)\n // (tscore, n, sides)\n // (value, array, sides)\n ttest: function ttest() {\n var args = slice.call(arguments);\n var tscore;\n if (args.length === 5) {\n tscore = Math.abs(jStat.tscore(args[0], args[1], args[2], args[3]));\n return (args[4] === 1) ?\n (jStat.studentt.cdf(-tscore, args[3]-1)) :\n (jStat.studentt.cdf(-tscore, args[3]-1)*2);\n }\n if (isNumber(args[1])) {\n tscore = Math.abs(args[0])\n return (args[2] == 1) ?\n (jStat.studentt.cdf(-tscore, args[1]-1)) :\n (jStat.studentt.cdf(-tscore, args[1]-1) * 2);\n }\n tscore = Math.abs(jStat.tscore(args[0], args[1]))\n return (args[2] == 1) ?\n (jStat.studentt.cdf(-tscore, args[1].length-1)) :\n (jStat.studentt.cdf(-tscore, args[1].length-1) * 2);\n }\n});\n\njStat.extend(jStat.fn, {\n tscore: function tscore(value) {\n return (value - this.mean()) / (this.stdev(true) / Math.sqrt(this.cols()));\n },\n\n ttest: function ttest(value, sides) {\n return (sides === 1) ?\n (1 - jStat.studentt.cdf(Math.abs(this.tscore(value)), this.cols()-1)) :\n (jStat.studentt.cdf(-Math.abs(this.tscore(value)), this.cols()-1)*2);\n }\n});\n\n// F Statistics\njStat.extend({\n // Paramter list is as follows:\n // (array1, array2, array3, ...)\n // or it is an array of arrays\n // array of arrays conversion\n anovafscore: function anovafscore() {\n var args = slice.call(arguments),\n expVar, sample, sampMean, sampSampMean, tmpargs, unexpVar, i, j;\n if (args.length === 1) {\n tmpargs = new Array(args[0].length);\n for (var i = 0; i < args[0].length; i++) {\n tmpargs[i] = args[0][i];\n }\n args = tmpargs;\n }\n // 2 sample case\n if (args.length === 2) {\n return jStat.variance(args[0]) / jStat.variance(args[1]);\n }\n // Builds sample array\n sample = new Array();\n for (var i = 0; i < args.length; i++) {\n sample = sample.concat(args[i]);\n }\n sampMean = jStat.mean(sample);\n // Computes the explained variance\n expVar = 0;\n for (var i = 0; i < args.length; i++) {\n expVar = expVar + args[i].length * Math.pow(jStat.mean(args[i]) - sampMean, 2);\n }\n expVar /= (args.length - 1);\n // Computes unexplained variance\n unexpVar = 0;\n for (var i = 0; i < args.length; i++) {\n sampSampMean = jStat.mean(args[i]);\n for (j = 0; j < args[i].length; j++) {\n unexpVar += Math.pow(args[i][j] - sampSampMean, 2);\n }\n }\n unexpVar /= (sample.length - args.length);\n return expVar / unexpVar;\n },\n\n // 2 different paramter setups\n // (array1, array2, array3, ...)\n // (anovafscore, df1, df2)\n anovaftest: function anovaftest() {\n var args = slice.call(arguments),\n df1, df2, n, i;\n if (isNumber(args[0])) {\n return 1 - jStat.centralF.cdf(args[0], args[1], args[2]);\n }\n anovafscore = jStat.anovafscore(args);\n df1 = args.length - 1;\n n = 0;\n for (var i = 0; i < args.length; i++) {\n n = n + args[i].length;\n }\n df2 = n - df1 - 1;\n return 1 - jStat.centralF.cdf(anovafscore, df1, df2);\n },\n\n ftest: function ftest(fscore, df1, df2) {\n return 1 - jStat.centralF.cdf(fscore, df1, df2);\n }\n});\n\njStat.extend(jStat.fn, {\n anovafscore: function anovafscore() {\n return jStat.anovafscore(this.toArray());\n },\n\n anovaftes: function anovaftes() {\n var n = 0;\n var i;\n for (var i = 0; i < this.length; i++) {\n n = n + this[i].length;\n }\n return jStat.ftest(this.anovafscore(), this.length - 1, n - this.length);\n }\n});\n\n// Error Bounds\njStat.extend({\n // 2 different parameter setups\n // (value, alpha, sd, n)\n // (value, alpha, array)\n normalci: function normalci() {\n var args = slice.call(arguments),\n ans = new Array(2),\n change;\n if (args.length === 4) {\n change = Math.abs(jStat.normal.inv(args[1] / 2, 0, 1) *\n args[2] / Math.sqrt(args[3]));\n } else {\n change = Math.abs(jStat.normal.inv(args[1] / 2, 0, 1) *\n jStat.stdev(args[2]) / Math.sqrt(args[2].length));\n }\n ans[0] = args[0] - change;\n ans[1] = args[0] + change;\n return ans;\n },\n\n // 2 different parameter setups\n // (value, alpha, sd, n)\n // (value, alpha, array)\n tci: function tci() {\n var args = slice.call(arguments),\n ans = new Array(2),\n change;\n if (args.length === 4) {\n change = Math.abs(jStat.studentt.inv(args[1] / 2, args[3] - 1) *\n args[2] / Math.sqrt(args[3]));\n } else {\n change = Math.abs(jStat.studentt.inv(args[1] / 2, args[2].length - 1) *\n jStat.stdev(args[2], true) / Math.sqrt(args[2].length));\n }\n ans[0] = args[0] - change;\n ans[1] = args[0] + change;\n return ans;\n },\n\n significant: function significant(pvalue, alpha) {\n return pvalue < alpha;\n }\n});\n\njStat.extend(jStat.fn, {\n normalci: function normalci(value, alpha) {\n return jStat.normalci(value, alpha, this.toArray());\n },\n\n tci: function tci(value, alpha) {\n return jStat.tci(value, alpha, this.toArray());\n }\n});\n\n// internal method for calculating the z-score for a difference of proportions test\nfunction differenceOfProportions(p1, n1, p2, n2) {\n if (p1 > 1 || p2 > 1 || p1 <= 0 || p2 <= 0) {\n throw new Error(\"Proportions should be greater than 0 and less than 1\")\n }\n var pooled = (p1 * n1 + p2 * n2) / (n1 + n2);\n var se = Math.sqrt(pooled * (1 - pooled) * ((1/n1) + (1/n2)));\n return (p1 - p2) / se;\n}\n\n// Difference of Proportions\njStat.extend(jStat.fn, {\n oneSidedDifferenceOfProportions: function oneSidedDifferenceOfProportions(p1, n1, p2, n2) {\n var z = differenceOfProportions(p1, n1, p2, n2);\n return jStat.ztest(z, 1);\n },\n\n twoSidedDifferenceOfProportions: function twoSidedDifferenceOfProportions(p1, n1, p2, n2) {\n var z = differenceOfProportions(p1, n1, p2, n2);\n return jStat.ztest(z, 2);\n }\n});\n\n}(this.jStat, Math));\nthis.jStat.models=(function(){\n\n function sub_regress(endog, exog) {\n return ols(endog, exog);\n }\n\n function sub_regress(exog) {\n var var_count = exog[0].length;\n var modelList = jStat.arange(var_count).map(function(endog_index) {\n var exog_index =\n jStat.arange(var_count).filter(function(i){return i!==endog_index});\n return ols(jStat.col(exog, endog_index).map(function(x){ return x[0] }),\n jStat.col(exog, exog_index))\n });\n return modelList;\n }\n\n // do OLS model regress\n // exog have include const columns ,it will not generate it .In fact, exog is\n // \"design matrix\" look at\n //https://en.wikipedia.org/wiki/Design_matrix\n function ols(endog, exog) {\n var nobs = endog.length;\n var df_model = exog[0].length - 1;\n var df_resid = nobs-df_model - 1;\n var coef = jStat.lstsq(exog, endog);\n var predict =\n jStat.multiply(exog, coef.map(function(x) { return [x] }))\n .map(function(p) { return p[0] });\n var resid = jStat.subtract(endog, predict);\n var ybar = jStat.mean(endog);\n // constant cause problem\n // var SST = jStat.sum(endog.map(function(y) {\n // return Math.pow(y-ybar,2);\n // }));\n var SSE = jStat.sum(predict.map(function(f) {\n return Math.pow(f - ybar, 2);\n }));\n var SSR = jStat.sum(endog.map(function(y, i) {\n return Math.pow(y - predict[i], 2);\n }));\n var SST = SSE + SSR;\n var R2 = (SSE / SST);\n return {\n exog:exog,\n endog:endog,\n nobs:nobs,\n df_model:df_model,\n df_resid:df_resid,\n coef:coef,\n predict:predict,\n resid:resid,\n ybar:ybar,\n SST:SST,\n SSE:SSE,\n SSR:SSR,\n R2:R2\n };\n }\n\n // H0: b_I=0\n // H1: b_I!=0\n function t_test(model) {\n var subModelList = sub_regress(model.exog);\n //var sigmaHat=jStat.stdev(model.resid);\n var sigmaHat = Math.sqrt(model.SSR / (model.df_resid));\n var seBetaHat = subModelList.map(function(mod) {\n var SST = mod.SST;\n var R2 = mod.R2;\n return sigmaHat / Math.sqrt(SST * (1 - R2));\n });\n var tStatistic = model.coef.map(function(coef, i) {\n return (coef - 0) / seBetaHat[i];\n });\n var pValue = tStatistic.map(function(t) {\n var leftppf = jStat.studentt.cdf(t, model.df_resid);\n return (leftppf > 0.5 ? 1 - leftppf : leftppf) * 2;\n });\n var c = jStat.studentt.inv(0.975, model.df_resid);\n var interval95 = model.coef.map(function(coef, i) {\n var d = c * seBetaHat[i];\n return [coef - d, coef + d];\n })\n return {\n se: seBetaHat,\n t: tStatistic,\n p: pValue,\n sigmaHat: sigmaHat,\n interval95: interval95\n };\n }\n\n function F_test(model) {\n var F_statistic =\n (model.R2 / model.df_model) / ((1 - model.R2) / model.df_resid);\n var fcdf = function(x, n1, n2) {\n return jStat.beta.cdf(x / (n2 / n1 + x), n1 / 2, n2 / 2)\n }\n var pvalue = 1 - fcdf(F_statistic, model.df_model, model.df_resid);\n return { F_statistic: F_statistic, pvalue: pvalue };\n }\n\n function ols_wrap(endog, exog) {\n var model = ols(endog,exog);\n var ttest = t_test(model);\n var ftest = F_test(model);\n var adjust_R2 =\n 1 - (1 - model.rsquared) * ((model.nobs - 1) / (model.df_resid));\n model.t = ttest;\n model.f = ftest;\n model.adjust_R2 = adjust_R2;\n return model;\n }\n\n return { ols: ols_wrap };\n})();\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/~/jStat/dist/jstat.js\n ** module id = 22\n ** module chunks = 0\n **/","var utils = require('./utils');\nvar numbro = require('numbro');\nvar error = require('./error');\n\nexports.UNIQUE = function () {\n var result = [];\n for (var i = 0; i < arguments.length; ++i) {\n var hasElement = false;\n var element = arguments[i];\n\n // Check if we've already seen this element.\n for (var j = 0; j < result.length; ++j) {\n hasElement = result[j] === element;\n if (hasElement) { break; }\n }\n\n // If we did not find it, add it to the result.\n if (!hasElement) {\n result.push(element);\n }\n }\n return result;\n};\n\nexports.FLATTEN = utils.flatten;\n\nexports.ARGS2ARRAY = function () {\n return Array.prototype.slice.call(arguments, 0);\n};\n\nexports.REFERENCE = function (context, reference) {\n if (!arguments.length) {\n return error.error;\n }\n try {\n var path = reference.split('.');\n var result = context;\n for (var i = 0; i < path.length; ++i) {\n var step = path[i];\n if (step[step.length - 1] === ']') {\n var opening = step.indexOf('[');\n var index = step.substring(opening + 1, step.length - 1);\n result = result[step.substring(0, opening)][index];\n } else {\n result = result[step];\n }\n }\n return result;\n } catch (error) {}\n};\n\nexports.JOIN = function (array, separator) {\n return array.join(separator);\n};\n\nexports.NUMBERS = function () {\n var possibleNumbers = utils.flatten(arguments);\n return possibleNumbers.filter(function (el) {\n return typeof el === 'number';\n });\n};\n\nexports.NUMERAL = function (number, format) {\n return numbro(number).format(format);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/miscellaneous.js\n ** module id = 23\n ** module chunks = 0\n **/","var error = require('./error');\n\n// TODO\nexports.CELL = function() {\n throw new Error('CELL is not implemented');\n};\n\nexports.ERROR = {};\nexports.ERROR.TYPE = function(error_val) {\n switch (error_val) {\n case error.nil: return 1;\n case error.div0: return 2;\n case error.value: return 3;\n case error.ref: return 4;\n case error.name: return 5;\n case error.num: return 6;\n case error.na: return 7;\n case error.data: return 8;\n }\n return error.na;\n};\n\n// TODO\nexports.INFO = function() {\n throw new Error('INFO is not implemented');\n};\n\nexports.ISBLANK = function(value) {\n return value === null;\n};\n\nexports.ISBINARY = function (number) {\n return (/^[01]{1,10}$/).test(number);\n};\n\nexports.ISERR = function(value) {\n return ([error.value, error.ref, error.div0, error.num, error.name, error.nil]).indexOf(value) >= 0 ||\n (typeof value === 'number' && (isNaN(value) || !isFinite(value)));\n};\n\nexports.ISERROR = function(value) {\n return exports.ISERR(value) || value === error.na;\n};\n\nexports.ISEVEN = function(number) {\n return (Math.floor(Math.abs(number)) & 1) ? false : true;\n};\n\n// TODO\nexports.ISFORMULA = function() {\n throw new Error('ISFORMULA is not implemented');\n};\n\nexports.ISLOGICAL = function(value) {\n return value === true || value === false;\n};\n\nexports.ISNA = function(value) {\n return value === error.na;\n};\n\nexports.ISNONTEXT = function(value) {\n return typeof(value) !== 'string';\n};\n\nexports.ISNUMBER = function(value) {\n return typeof(value) === 'number' && !isNaN(value) && isFinite(value);\n};\n\nexports.ISODD = function(number) {\n return (Math.floor(Math.abs(number)) & 1) ? true : false;\n};\n\n// TODO\nexports.ISREF = function() {\n throw new Error('ISREF is not implemented');\n};\n\nexports.ISTEXT = function(value) {\n return typeof(value) === 'string';\n};\n\nexports.N = function(value) {\n if (this.ISNUMBER(value)) {\n return value;\n }\n if (value instanceof Date) {\n return value.getTime();\n }\n if (value === true) {\n return 1;\n }\n if (value === false) {\n return 0;\n }\n if (this.ISERROR(value)) {\n return value;\n }\n return 0;\n};\n\nexports.NA = function() {\n return error.na;\n};\n\n\n// TODO\nexports.SHEET = function() {\n throw new Error('SHEET is not implemented');\n};\n\n// TODO\nexports.SHEETS = function() {\n throw new Error('SHEETS is not implemented');\n};\n\nexports.TYPE = function(value) {\n if (this.ISNUMBER(value)) {\n return 1;\n }\n if (this.ISTEXT(value)) {\n return 2;\n }\n if (this.ISLOGICAL(value)) {\n return 4;\n }\n if (this.ISERROR(value)) {\n return 16;\n }\n if (Array.isArray(value)) {\n return 64;\n }\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/information.js\n ** module id = 24\n ** module chunks = 0\n **/","var error = require('./error');\nvar jStat = require('jStat').jStat;\nvar text = require('./text');\nvar utils = require('./utils');\nvar bessel = require('bessel');\n\nfunction isValidBinaryNumber(number) {\n return (/^[01]{1,10}$/).test(number);\n}\n\nexports.BESSELI = function(x, n) {\n x = utils.parseNumber(x);\n n = utils.parseNumber(n);\n if (utils.anyIsError(x, n)) {\n return error.value;\n }\n\n return bessel.besseli(x, n);\n};\n\nexports.BESSELJ = function(x, n) {\n x = utils.parseNumber(x);\n n = utils.parseNumber(n);\n if (utils.anyIsError(x, n)) {\n return error.value;\n }\n\n return bessel.besselj(x, n);\n};\n\nexports.BESSELK = function(x, n) {\n x = utils.parseNumber(x);\n n = utils.parseNumber(n);\n if (utils.anyIsError(x, n)) {\n return error.value;\n }\n\n return bessel.besselk(x, n);\n};\n\nexports.BESSELY = function(x, n) {\n x = utils.parseNumber(x);\n n = utils.parseNumber(n);\n if (utils.anyIsError(x, n)) {\n return error.value;\n }\n\n return bessel.bessely(x, n);\n};\n\nexports.BIN2DEC = function(number) {\n // Return error if number is not binary or contains more than 10 characters (10 digits)\n if (!isValidBinaryNumber(number)) {\n return error.num;\n }\n\n // Convert binary number to decimal\n var result = parseInt(number, 2);\n\n // Handle negative numbers\n var stringified = number.toString();\n if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n return parseInt(stringified.substring(1), 2) - 512;\n } else {\n return result;\n }\n};\n\n\nexports.BIN2HEX = function(number, places) {\n // Return error if number is not binary or contains more than 10 characters (10 digits)\n if (!isValidBinaryNumber(number)) {\n return error.num;\n }\n\n // Ignore places and return a 10-character hexadecimal number if number is negative\n var stringified = number.toString();\n if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n return (1099511627264 + parseInt(stringified.substring(1), 2)).toString(16);\n }\n\n // Convert binary number to hexadecimal\n var result = parseInt(number, 2).toString(16);\n\n // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result;\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return error.value;\n }\n\n // Return error if places is negative\n if (places < 0) {\n return error.num;\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n }\n};\n\nexports.BIN2OCT = function(number, places) {\n // Return error if number is not binary or contains more than 10 characters (10 digits)\n if (!isValidBinaryNumber(number)) {\n return error.num;\n }\n\n // Ignore places and return a 10-character octal number if number is negative\n var stringified = number.toString();\n if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n return (1073741312 + parseInt(stringified.substring(1), 2)).toString(8);\n }\n\n // Convert binary number to octal\n var result = parseInt(number, 2).toString(8);\n\n // Return octal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result;\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return error.value;\n }\n\n // Return error if places is negative\n if (places < 0) {\n return error.num;\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n }\n};\n\nexports.BITAND = function(number1, number2) {\n // Return error if either number is a non-numeric value\n number1 = utils.parseNumber(number1);\n number2 = utils.parseNumber(number2);\n if (utils.anyIsError(number1, number2)) {\n return error.value;\n }\n\n // Return error if either number is less than 0\n if (number1 < 0 || number2 < 0) {\n return error.num;\n }\n\n // Return error if either number is a non-integer\n if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n return error.num;\n }\n\n // Return error if either number is greater than (2^48)-1\n if (number1 > 281474976710655 || number2 > 281474976710655) {\n return error.num;\n }\n\n // Return bitwise AND of two numbers\n return number1 & number2;\n};\n\nexports.BITLSHIFT = function(number, shift) {\n number = utils.parseNumber(number);\n shift = utils.parseNumber(shift);\n if (utils.anyIsError(number, shift)) {\n return error.value;\n }\n\n // Return error if number is less than 0\n if (number < 0) {\n return error.num;\n }\n\n // Return error if number is a non-integer\n if (Math.floor(number) !== number) {\n return error.num;\n }\n\n // Return error if number is greater than (2^48)-1\n if (number > 281474976710655) {\n return error.num;\n }\n\n // Return error if the absolute value of shift is greater than 53\n if (Math.abs(shift) > 53) {\n return error.num;\n }\n\n // Return number shifted by shift bits to the left or to the right if shift is negative\n return (shift >= 0) ? number << shift : number >> -shift;\n};\n\nexports.BITOR = function(number1, number2) {\n number1 = utils.parseNumber(number1);\n number2 = utils.parseNumber(number2);\n if (utils.anyIsError(number1, number2)) {\n return error.value;\n }\n\n // Return error if either number is less than 0\n if (number1 < 0 || number2 < 0) {\n return error.num;\n }\n\n // Return error if either number is a non-integer\n if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n return error.num;\n }\n\n // Return error if either number is greater than (2^48)-1\n if (number1 > 281474976710655 || number2 > 281474976710655) {\n return error.num;\n }\n\n // Return bitwise OR of two numbers\n return number1 | number2;\n};\n\nexports.BITRSHIFT = function(number, shift) {\n number = utils.parseNumber(number);\n shift = utils.parseNumber(shift);\n if (utils.anyIsError(number, shift)) {\n return error.value;\n }\n\n // Return error if number is less than 0\n if (number < 0) {\n return error.num;\n }\n\n // Return error if number is a non-integer\n if (Math.floor(number) !== number) {\n return error.num;\n }\n\n // Return error if number is greater than (2^48)-1\n if (number > 281474976710655) {\n return error.num;\n }\n\n // Return error if the absolute value of shift is greater than 53\n if (Math.abs(shift) > 53) {\n return error.num;\n }\n\n // Return number shifted by shift bits to the right or to the left if shift is negative\n return (shift >= 0) ? number >> shift : number << -shift;\n};\n\nexports.BITXOR = function(number1, number2) {\n number1 = utils.parseNumber(number1);\n number2 = utils.parseNumber(number2);\n if (utils.anyIsError(number1, number2)) {\n return error.value;\n }\n\n // Return error if either number is less than 0\n if (number1 < 0 || number2 < 0) {\n return error.num;\n }\n\n // Return error if either number is a non-integer\n if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n return error.num;\n }\n\n // Return error if either number is greater than (2^48)-1\n if (number1 > 281474976710655 || number2 > 281474976710655) {\n return error.num;\n }\n\n // Return bitwise XOR of two numbers\n return number1 ^ number2;\n};\n\nexports.COMPLEX = function(real, imaginary, suffix) {\n real = utils.parseNumber(real);\n imaginary = utils.parseNumber(imaginary);\n if (utils.anyIsError(real, imaginary)) {\n return real;\n }\n\n // Set suffix\n suffix = (suffix === undefined) ? 'i' : suffix;\n\n // Return error if suffix is neither \"i\" nor \"j\"\n if (suffix !== 'i' && suffix !== 'j') {\n return error.value;\n }\n\n // Return complex number\n if (real === 0 && imaginary === 0) {\n return 0;\n } else if (real === 0) {\n return (imaginary === 1) ? suffix : imaginary.toString() + suffix;\n } else if (imaginary === 0) {\n return real.toString();\n } else {\n var sign = (imaginary > 0) ? '+' : '';\n return real.toString() + sign + ((imaginary === 1) ? suffix : imaginary.toString() + suffix);\n }\n};\n\nexports.CONVERT = function(number, from_unit, to_unit) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n\n // List of units supported by CONVERT and units defined by the International System of Units\n // [Name, Symbol, Alternate symbols, Quantity, ISU, CONVERT, Conversion ratio]\n var units = [\n [\"a.u. of action\", \"?\", null, \"action\", false, false, 1.05457168181818e-34],\n [\"a.u. of charge\", \"e\", null, \"electric_charge\", false, false, 1.60217653141414e-19],\n [\"a.u. of energy\", \"Eh\", null, \"energy\", false, false, 4.35974417757576e-18],\n [\"a.u. of length\", \"a?\", null, \"length\", false, false, 5.29177210818182e-11],\n [\"a.u. of mass\", \"m?\", null, \"mass\", false, false, 9.10938261616162e-31],\n [\"a.u. of time\", \"?/Eh\", null, \"time\", false, false, 2.41888432650516e-17],\n [\"admiralty knot\", \"admkn\", null, \"speed\", false, true, 0.514773333],\n [\"ampere\", \"A\", null, \"electric_current\", true, false, 1],\n [\"ampere per meter\", \"A/m\", null, \"magnetic_field_intensity\", true, false, 1],\n [\"ångström\", \"Å\", [\"ang\"], \"length\", false, true, 1e-10],\n [\"are\", \"ar\", null, \"area\", false, true, 100],\n [\"astronomical unit\", \"ua\", null, \"length\", false, false, 1.49597870691667e-11],\n [\"bar\", \"bar\", null, \"pressure\", false, false, 100000],\n [\"barn\", \"b\", null, \"area\", false, false, 1e-28],\n [\"becquerel\", \"Bq\", null, \"radioactivity\", true, false, 1],\n [\"bit\", \"bit\", [\"b\"], \"information\", false, true, 1],\n [\"btu\", \"BTU\", [\"btu\"], \"energy\", false, true, 1055.05585262],\n [\"byte\", \"byte\", null, \"information\", false, true, 8],\n [\"candela\", \"cd\", null, \"luminous_intensity\", true, false, 1],\n [\"candela per square metre\", \"cd/m?\", null, \"luminance\", true, false, 1],\n [\"coulomb\", \"C\", null, \"electric_charge\", true, false, 1],\n [\"cubic ångström\", \"ang3\", [\"ang^3\"], \"volume\", false, true, 1e-30],\n [\"cubic foot\", \"ft3\", [\"ft^3\"], \"volume\", false, true, 0.028316846592],\n [\"cubic inch\", \"in3\", [\"in^3\"], \"volume\", false, true, 0.000016387064],\n [\"cubic light-year\", \"ly3\", [\"ly^3\"], \"volume\", false, true, 8.46786664623715e-47],\n [\"cubic metre\", \"m?\", null, \"volume\", true, true, 1],\n [\"cubic mile\", \"mi3\", [\"mi^3\"], \"volume\", false, true, 4168181825.44058],\n [\"cubic nautical mile\", \"Nmi3\", [\"Nmi^3\"], \"volume\", false, true, 6352182208],\n [\"cubic Pica\", \"Pica3\", [\"Picapt3\", \"Pica^3\", \"Picapt^3\"], \"volume\", false, true, 7.58660370370369e-8],\n [\"cubic yard\", \"yd3\", [\"yd^3\"], \"volume\", false, true, 0.764554857984],\n [\"cup\", \"cup\", null, \"volume\", false, true, 0.0002365882365],\n [\"dalton\", \"Da\", [\"u\"], \"mass\", false, false, 1.66053886282828e-27],\n [\"day\", \"d\", [\"day\"], \"time\", false, true, 86400],\n [\"degree\", \"°\", null, \"angle\", false, false, 0.0174532925199433],\n [\"degrees Rankine\", \"Rank\", null, \"temperature\", false, true, 0.555555555555556],\n [\"dyne\", \"dyn\", [\"dy\"], \"force\", false, true, 0.00001],\n [\"electronvolt\", \"eV\", [\"ev\"], \"energy\", false, true, 1.60217656514141],\n [\"ell\", \"ell\", null, \"length\", false, true, 1.143],\n [\"erg\", \"erg\", [\"e\"], \"energy\", false, true, 1e-7],\n [\"farad\", \"F\", null, \"electric_capacitance\", true, false, 1],\n [\"fluid ounce\", \"oz\", null, \"volume\", false, true, 0.0000295735295625],\n [\"foot\", \"ft\", null, \"length\", false, true, 0.3048],\n [\"foot-pound\", \"flb\", null, \"energy\", false, true, 1.3558179483314],\n [\"gal\", \"Gal\", null, \"acceleration\", false, false, 0.01],\n [\"gallon\", \"gal\", null, \"volume\", false, true, 0.003785411784],\n [\"gauss\", \"G\", [\"ga\"], \"magnetic_flux_density\", false, true, 1],\n [\"grain\", \"grain\", null, \"mass\", false, true, 0.0000647989],\n [\"gram\", \"g\", null, \"mass\", false, true, 0.001],\n [\"gray\", \"Gy\", null, \"absorbed_dose\", true, false, 1],\n [\"gross registered ton\", \"GRT\", [\"regton\"], \"volume\", false, true, 2.8316846592],\n [\"hectare\", \"ha\", null, \"area\", false, true, 10000],\n [\"henry\", \"H\", null, \"inductance\", true, false, 1],\n [\"hertz\", \"Hz\", null, \"frequency\", true, false, 1],\n [\"horsepower\", \"HP\", [\"h\"], \"power\", false, true, 745.69987158227],\n [\"horsepower-hour\", \"HPh\", [\"hh\", \"hph\"], \"energy\", false, true, 2684519.538],\n [\"hour\", \"h\", [\"hr\"], \"time\", false, true, 3600],\n [\"imperial gallon (U.K.)\", \"uk_gal\", null, \"volume\", false, true, 0.00454609],\n [\"imperial hundredweight\", \"lcwt\", [\"uk_cwt\", \"hweight\"], \"mass\", false, true, 50.802345],\n [\"imperial quart (U.K)\", \"uk_qt\", null, \"volume\", false, true, 0.0011365225],\n [\"imperial ton\", \"brton\", [\"uk_ton\", \"LTON\"], \"mass\", false, true, 1016.046909],\n [\"inch\", \"in\", null, \"length\", false, true, 0.0254],\n [\"international acre\", \"uk_acre\", null, \"area\", false, true, 4046.8564224],\n [\"IT calorie\", \"cal\", null, \"energy\", false, true, 4.1868],\n [\"joule\", \"J\", null, \"energy\", true, true, 1],\n [\"katal\", \"kat\", null, \"catalytic_activity\", true, false, 1],\n [\"kelvin\", \"K\", [\"kel\"], \"temperature\", true, true, 1],\n [\"kilogram\", \"kg\", null, \"mass\", true, true, 1],\n [\"knot\", \"kn\", null, \"speed\", false, true, 0.514444444444444],\n [\"light-year\", \"ly\", null, \"length\", false, true, 9460730472580800],\n [\"litre\", \"L\", [\"l\", \"lt\"], \"volume\", false, true, 0.001],\n [\"lumen\", \"lm\", null, \"luminous_flux\", true, false, 1],\n [\"lux\", \"lx\", null, \"illuminance\", true, false, 1],\n [\"maxwell\", \"Mx\", null, \"magnetic_flux\", false, false, 1e-18],\n [\"measurement ton\", \"MTON\", null, \"volume\", false, true, 1.13267386368],\n [\"meter per hour\", \"m/h\", [\"m/hr\"], \"speed\", false, true, 0.00027777777777778],\n [\"meter per second\", \"m/s\", [\"m/sec\"], \"speed\", true, true, 1],\n [\"meter per second squared\", \"m?s??\", null, \"acceleration\", true, false, 1],\n [\"parsec\", \"pc\", [\"parsec\"], \"length\", false, true, 30856775814671900],\n [\"meter squared per second\", \"m?/s\", null, \"kinematic_viscosity\", true, false, 1],\n [\"metre\", \"m\", null, \"length\", true, true, 1],\n [\"miles per hour\", \"mph\", null, \"speed\", false, true, 0.44704],\n [\"millimetre of mercury\", \"mmHg\", null, \"pressure\", false, false, 133.322],\n [\"minute\", \"?\", null, \"angle\", false, false, 0.000290888208665722],\n [\"minute\", \"min\", [\"mn\"], \"time\", false, true, 60],\n [\"modern teaspoon\", \"tspm\", null, \"volume\", false, true, 0.000005],\n [\"mole\", \"mol\", null, \"amount_of_substance\", true, false, 1],\n [\"morgen\", \"Morgen\", null, \"area\", false, true, 2500],\n [\"n.u. of action\", \"?\", null, \"action\", false, false, 1.05457168181818e-34],\n [\"n.u. of mass\", \"m?\", null, \"mass\", false, false, 9.10938261616162e-31],\n [\"n.u. of speed\", \"c?\", null, \"speed\", false, false, 299792458],\n [\"n.u. of time\", \"?/(me?c??)\", null, \"time\", false, false, 1.28808866778687e-21],\n [\"nautical mile\", \"M\", [\"Nmi\"], \"length\", false, true, 1852],\n [\"newton\", \"N\", null, \"force\", true, true, 1],\n [\"œrsted\", \"Oe \", null, \"magnetic_field_intensity\", false, false, 79.5774715459477],\n [\"ohm\", \"Ω\", null, \"electric_resistance\", true, false, 1],\n [\"ounce mass\", \"ozm\", null, \"mass\", false, true, 0.028349523125],\n [\"pascal\", \"Pa\", null, \"pressure\", true, false, 1],\n [\"pascal second\", \"Pa?s\", null, \"dynamic_viscosity\", true, false, 1],\n [\"pferdestärke\", \"PS\", null, \"power\", false, true, 735.49875],\n [\"phot\", \"ph\", null, \"illuminance\", false, false, 0.0001],\n [\"pica (1/6 inch)\", \"pica\", null, \"length\", false, true, 0.00035277777777778],\n [\"pica (1/72 inch)\", \"Pica\", [\"Picapt\"], \"length\", false, true, 0.00423333333333333],\n [\"poise\", \"P\", null, \"dynamic_viscosity\", false, false, 0.1],\n [\"pond\", \"pond\", null, \"force\", false, true, 0.00980665],\n [\"pound force\", \"lbf\", null, \"force\", false, true, 4.4482216152605],\n [\"pound mass\", \"lbm\", null, \"mass\", false, true, 0.45359237],\n [\"quart\", \"qt\", null, \"volume\", false, true, 0.000946352946],\n [\"radian\", \"rad\", null, \"angle\", true, false, 1],\n [\"second\", \"?\", null, \"angle\", false, false, 0.00000484813681109536],\n [\"second\", \"s\", [\"sec\"], \"time\", true, true, 1],\n [\"short hundredweight\", \"cwt\", [\"shweight\"], \"mass\", false, true, 45.359237],\n [\"siemens\", \"S\", null, \"electrical_conductance\", true, false, 1],\n [\"sievert\", \"Sv\", null, \"equivalent_dose\", true, false, 1],\n [\"slug\", \"sg\", null, \"mass\", false, true, 14.59390294],\n [\"square ångström\", \"ang2\", [\"ang^2\"], \"area\", false, true, 1e-20],\n [\"square foot\", \"ft2\", [\"ft^2\"], \"area\", false, true, 0.09290304],\n [\"square inch\", \"in2\", [\"in^2\"], \"area\", false, true, 0.00064516],\n [\"square light-year\", \"ly2\", [\"ly^2\"], \"area\", false, true, 8.95054210748189e+31],\n [\"square meter\", \"m?\", null, \"area\", true, true, 1],\n [\"square mile\", \"mi2\", [\"mi^2\"], \"area\", false, true, 2589988.110336],\n [\"square nautical mile\", \"Nmi2\", [\"Nmi^2\"], \"area\", false, true, 3429904],\n [\"square Pica\", \"Pica2\", [\"Picapt2\", \"Pica^2\", \"Picapt^2\"], \"area\", false, true, 0.00001792111111111],\n [\"square yard\", \"yd2\", [\"yd^2\"], \"area\", false, true, 0.83612736],\n [\"statute mile\", \"mi\", null, \"length\", false, true, 1609.344],\n [\"steradian\", \"sr\", null, \"solid_angle\", true, false, 1],\n [\"stilb\", \"sb\", null, \"luminance\", false, false, 0.0001],\n [\"stokes\", \"St\", null, \"kinematic_viscosity\", false, false, 0.0001],\n [\"stone\", \"stone\", null, \"mass\", false, true, 6.35029318],\n [\"tablespoon\", \"tbs\", null, \"volume\", false, true, 0.0000147868],\n [\"teaspoon\", \"tsp\", null, \"volume\", false, true, 0.00000492892],\n [\"tesla\", \"T\", null, \"magnetic_flux_density\", true, true, 1],\n [\"thermodynamic calorie\", \"c\", null, \"energy\", false, true, 4.184],\n [\"ton\", \"ton\", null, \"mass\", false, true, 907.18474],\n [\"tonne\", \"t\", null, \"mass\", false, false, 1000],\n [\"U.K. pint\", \"uk_pt\", null, \"volume\", false, true, 0.00056826125],\n [\"U.S. bushel\", \"bushel\", null, \"volume\", false, true, 0.03523907],\n [\"U.S. oil barrel\", \"barrel\", null, \"volume\", false, true, 0.158987295],\n [\"U.S. pint\", \"pt\", [\"us_pt\"], \"volume\", false, true, 0.000473176473],\n [\"U.S. survey mile\", \"survey_mi\", null, \"length\", false, true, 1609.347219],\n [\"U.S. survey/statute acre\", \"us_acre\", null, \"area\", false, true, 4046.87261],\n [\"volt\", \"V\", null, \"voltage\", true, false, 1],\n [\"watt\", \"W\", null, \"power\", true, true, 1],\n [\"watt-hour\", \"Wh\", [\"wh\"], \"energy\", false, true, 3600],\n [\"weber\", \"Wb\", null, \"magnetic_flux\", true, false, 1],\n [\"yard\", \"yd\", null, \"length\", false, true, 0.9144],\n [\"year\", \"yr\", null, \"time\", false, true, 31557600]\n ];\n\n // Binary prefixes\n // [Name, Prefix power of 2 value, Previx value, Abbreviation, Derived from]\n var binary_prefixes = {\n Yi: [\"yobi\", 80, 1208925819614629174706176, \"Yi\", \"yotta\"],\n Zi: [\"zebi\", 70, 1180591620717411303424, \"Zi\", \"zetta\"],\n Ei: [\"exbi\", 60, 1152921504606846976, \"Ei\", \"exa\"],\n Pi: [\"pebi\", 50, 1125899906842624, \"Pi\", \"peta\"],\n Ti: [\"tebi\", 40, 1099511627776, \"Ti\", \"tera\"],\n Gi: [\"gibi\", 30, 1073741824, \"Gi\", \"giga\"],\n Mi: [\"mebi\", 20, 1048576, \"Mi\", \"mega\"],\n ki: [\"kibi\", 10, 1024, \"ki\", \"kilo\"]\n };\n\n // Unit prefixes\n // [Name, Multiplier, Abbreviation]\n var unit_prefixes = {\n Y: [\"yotta\", 1e+24, \"Y\"],\n Z: [\"zetta\", 1e+21, \"Z\"],\n E: [\"exa\", 1e+18, \"E\"],\n P: [\"peta\", 1e+15, \"P\"],\n T: [\"tera\", 1e+12, \"T\"],\n G: [\"giga\", 1e+09, \"G\"],\n M: [\"mega\", 1e+06, \"M\"],\n k: [\"kilo\", 1e+03, \"k\"],\n h: [\"hecto\", 1e+02, \"h\"],\n e: [\"dekao\", 1e+01, \"e\"],\n d: [\"deci\", 1e-01, \"d\"],\n c: [\"centi\", 1e-02, \"c\"],\n m: [\"milli\", 1e-03, \"m\"],\n u: [\"micro\", 1e-06, \"u\"],\n n: [\"nano\", 1e-09, \"n\"],\n p: [\"pico\", 1e-12, \"p\"],\n f: [\"femto\", 1e-15, \"f\"],\n a: [\"atto\", 1e-18, \"a\"],\n z: [\"zepto\", 1e-21, \"z\"],\n y: [\"yocto\", 1e-24, \"y\"]\n };\n\n // Initialize units and multipliers\n var from = null;\n var to = null;\n var base_from_unit = from_unit;\n var base_to_unit = to_unit;\n var from_multiplier = 1;\n var to_multiplier = 1;\n var alt;\n\n // Lookup from and to units\n for (var i = 0; i < units.length; i++) {\n alt = (units[i][2] === null) ? [] : units[i][2];\n if (units[i][1] === base_from_unit || alt.indexOf(base_from_unit) >= 0) {\n from = units[i];\n }\n if (units[i][1] === base_to_unit || alt.indexOf(base_to_unit) >= 0) {\n to = units[i];\n }\n }\n\n // Lookup from prefix\n if (from === null) {\n var from_binary_prefix = binary_prefixes[from_unit.substring(0, 2)];\n var from_unit_prefix = unit_prefixes[from_unit.substring(0, 1)];\n\n // Handle dekao unit prefix (only unit prefix with two characters)\n if (from_unit.substring(0, 2) === 'da') {\n from_unit_prefix = [\"dekao\", 1e+01, \"da\"];\n }\n\n // Handle binary prefixes first (so that 'Yi' is processed before 'Y')\n if (from_binary_prefix) {\n from_multiplier = from_binary_prefix[2];\n base_from_unit = from_unit.substring(2);\n } else if (from_unit_prefix) {\n from_multiplier = from_unit_prefix[1];\n base_from_unit = from_unit.substring(from_unit_prefix[2].length);\n }\n\n // Lookup from unit\n for (var j = 0; j < units.length; j++) {\n alt = (units[j][2] === null) ? [] : units[j][2];\n if (units[j][1] === base_from_unit || alt.indexOf(base_from_unit) >= 0) {\n from = units[j];\n }\n }\n }\n\n // Lookup to prefix\n if (to === null) {\n var to_binary_prefix = binary_prefixes[to_unit.substring(0, 2)];\n var to_unit_prefix = unit_prefixes[to_unit.substring(0, 1)];\n\n // Handle dekao unit prefix (only unit prefix with two characters)\n if (to_unit.substring(0, 2) === 'da') {\n to_unit_prefix = [\"dekao\", 1e+01, \"da\"];\n }\n\n // Handle binary prefixes first (so that 'Yi' is processed before 'Y')\n if (to_binary_prefix) {\n to_multiplier = to_binary_prefix[2];\n base_to_unit = to_unit.substring(2);\n } else if (to_unit_prefix) {\n to_multiplier = to_unit_prefix[1];\n base_to_unit = to_unit.substring(to_unit_prefix[2].length);\n }\n\n // Lookup to unit\n for (var k = 0; k < units.length; k++) {\n alt = (units[k][2] === null) ? [] : units[k][2];\n if (units[k][1] === base_to_unit || alt.indexOf(base_to_unit) >= 0) {\n to = units[k];\n }\n }\n }\n\n // Return error if a unit does not exist\n if (from === null || to === null) {\n return error.na;\n }\n\n // Return error if units represent different quantities\n if (from[3] !== to[3]) {\n return error.na;\n }\n\n // Return converted number\n return number * from[6] * from_multiplier / (to[6] * to_multiplier);\n};\n\nexports.DEC2BIN = function(number, places) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n\n // Return error if number is not decimal, is lower than -512, or is greater than 511\n if (!/^-?[0-9]{1,3}$/.test(number) || number < -512 || number > 511) {\n return error.num;\n }\n\n // Ignore places and return a 10-character binary number if number is negative\n if (number < 0) {\n return '1' + text.REPT('0', 9 - (512 + number).toString(2).length) + (512 + number).toString(2);\n }\n\n // Convert decimal number to binary\n var result = parseInt(number, 10).toString(2);\n\n // Return binary number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result;\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return error.value;\n }\n\n // Return error if places is negative\n if (places < 0) {\n return error.num;\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n }\n};\n\nexports.DEC2HEX = function(number, places) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n\n // Return error if number is not decimal, is lower than -549755813888, or is greater than 549755813887\n if (!/^-?[0-9]{1,12}$/.test(number) || number < -549755813888 || number > 549755813887) {\n return error.num;\n }\n\n // Ignore places and return a 10-character hexadecimal number if number is negative\n if (number < 0) {\n return (1099511627776 + number).toString(16);\n }\n\n // Convert decimal number to hexadecimal\n var result = parseInt(number, 10).toString(16);\n\n // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result;\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return error.value;\n }\n\n // Return error if places is negative\n if (places < 0) {\n return error.num;\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n }\n};\n\nexports.DEC2OCT = function(number, places) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n\n // Return error if number is not decimal, is lower than -549755813888, or is greater than 549755813887\n if (!/^-?[0-9]{1,9}$/.test(number) || number < -536870912 || number > 536870911) {\n return error.num;\n }\n\n // Ignore places and return a 10-character octal number if number is negative\n if (number < 0) {\n return (1073741824 + number).toString(8);\n }\n\n // Convert decimal number to octal\n var result = parseInt(number, 10).toString(8);\n\n // Return octal number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result;\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return error.value;\n }\n\n // Return error if places is negative\n if (places < 0) {\n return error.num;\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n }\n};\n\nexports.DELTA = function(number1, number2) {\n // Set number2 to zero if undefined\n number2 = (number2 === undefined) ? 0 : number2;\n number1 = utils.parseNumber(number1);\n number2 = utils.parseNumber(number2);\n if (utils.anyIsError(number1, number2)) {\n return error.value;\n }\n\n // Return delta\n return (number1 === number2) ? 1 : 0;\n};\n\n// TODO: why is upper_bound not used ? The excel documentation has no examples with upper_bound\nexports.ERF = function(lower_bound, upper_bound) {\n // Set number2 to zero if undefined\n upper_bound = (upper_bound === undefined) ? 0 : upper_bound;\n\n lower_bound = utils.parseNumber(lower_bound);\n upper_bound = utils.parseNumber(upper_bound);\n if (utils.anyIsError(lower_bound, upper_bound)) {\n return error.value;\n }\n\n return jStat.erf(lower_bound);\n};\n\n// TODO\nexports.ERF.PRECISE = function() {\n throw new Error('ERF.PRECISE is not implemented');\n};\n\nexports.ERFC = function(x) {\n // Return error if x is not a number\n if (isNaN(x)) {\n return error.value;\n }\n\n return jStat.erfc(x);\n};\n\n// TODO\nexports.ERFC.PRECISE = function() {\n throw new Error('ERFC.PRECISE is not implemented');\n};\n\nexports.GESTEP = function(number, step) {\n step = step || 0;\n number = utils.parseNumber(number);\n if (utils.anyIsError(step, number)) {\n return number;\n }\n\n // Return delta\n return (number >= step) ? 1 : 0;\n};\n\nexports.HEX2BIN = function(number, places) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n return error.num;\n }\n\n // Check if number is negative\n var negative = (number.length === 10 && number.substring(0, 1).toLowerCase() === 'f') ? true : false;\n\n // Convert hexadecimal number to decimal\n var decimal = (negative) ? parseInt(number, 16) - 1099511627776 : parseInt(number, 16);\n\n // Return error if number is lower than -512 or greater than 511\n if (decimal < -512 || decimal > 511) {\n return error.num;\n }\n\n // Ignore places and return a 10-character binary number if number is negative\n if (negative) {\n return '1' + text.REPT('0', 9 - (512 + decimal).toString(2).length) + (512 + decimal).toString(2);\n }\n\n // Convert decimal number to binary\n var result = decimal.toString(2);\n\n // Return binary number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result;\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return error.value;\n }\n\n // Return error if places is negative\n if (places < 0) {\n return error.num;\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n }\n};\n\nexports.HEX2DEC = function(number) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n return error.num;\n }\n\n // Convert hexadecimal number to decimal\n var decimal = parseInt(number, 16);\n\n // Return decimal number\n return (decimal >= 549755813888) ? decimal - 1099511627776 : decimal;\n};\n\nexports.HEX2OCT = function(number, places) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n return error.num;\n }\n\n // Convert hexadecimal number to decimal\n var decimal = parseInt(number, 16);\n\n // Return error if number is positive and greater than 0x1fffffff (536870911)\n if (decimal > 536870911 && decimal < 1098974756864) {\n return error.num;\n }\n\n // Ignore places and return a 10-character octal number if number is negative\n if (decimal >= 1098974756864) {\n return (decimal - 1098437885952).toString(8);\n }\n\n // Convert decimal number to octal\n var result = decimal.toString(8);\n\n // Return octal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result;\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return error.value;\n }\n\n // Return error if places is negative\n if (places < 0) {\n return error.num;\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n }\n};\n\nexports.IMABS = function(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Return absolute value of complex number\n return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));\n};\n\nexports.IMAGINARY = function(inumber) {\n if (inumber === undefined || inumber === true || inumber === false) {\n return error.value;\n }\n\n // Return 0 if inumber is equal to 0\n if (inumber === 0 || inumber === '0') {\n return 0;\n }\n\n // Handle special cases\n if (['i', 'j'].indexOf(inumber) >= 0) {\n return 1;\n }\n\n // Normalize imaginary coefficient\n inumber = inumber.replace('+i', '+1i').replace('-i', '-1i').replace('+j', '+1j').replace('-j', '-1j');\n\n // Lookup sign\n var plus = inumber.indexOf('+');\n var minus = inumber.indexOf('-');\n if (plus === 0) {\n plus = inumber.indexOf('+', 1);\n }\n\n if (minus === 0) {\n minus = inumber.indexOf('-', 1);\n }\n\n // Lookup imaginary unit\n var last = inumber.substring(inumber.length - 1, inumber.length);\n var unit = (last === 'i' || last === 'j');\n\n if (plus >= 0 || minus >= 0) {\n // Return error if imaginary unit is neither i nor j\n if (!unit) {\n return error.num;\n }\n\n // Return imaginary coefficient of complex number\n if (plus >= 0) {\n return (isNaN(inumber.substring(0, plus)) || isNaN(inumber.substring(plus + 1, inumber.length - 1))) ?\n error.num :\n Number(inumber.substring(plus + 1, inumber.length - 1));\n } else {\n return (isNaN(inumber.substring(0, minus)) || isNaN(inumber.substring(minus + 1, inumber.length - 1))) ?\n error.num :\n -Number(inumber.substring(minus + 1, inumber.length - 1));\n }\n } else {\n if (unit) {\n return (isNaN(inumber.substring(0, inumber.length - 1))) ? error.num : inumber.substring(0, inumber.length - 1);\n } else {\n return (isNaN(inumber)) ? error.num : 0;\n }\n }\n};\n\nexports.IMARGUMENT = function(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Return error if inumber is equal to zero\n if (x === 0 && y === 0) {\n return error.div0;\n }\n\n // Return PI/2 if x is equal to zero and y is positive\n if (x === 0 && y > 0) {\n return Math.PI / 2;\n }\n\n // Return -PI/2 if x is equal to zero and y is negative\n if (x === 0 && y < 0) {\n return -Math.PI / 2;\n }\n\n // Return zero if x is negative and y is equal to zero\n if (y === 0 && x > 0) {\n return 0;\n }\n\n // Return zero if x is negative and y is equal to zero\n if (y === 0 && x < 0) {\n return -Math.PI;\n }\n\n // Return argument of complex number\n if (x > 0) {\n return Math.atan(y / x);\n } else if (x < 0 && y >= 0) {\n return Math.atan(y / x) + Math.PI;\n } else {\n return Math.atan(y / x) - Math.PI;\n }\n};\n\nexports.IMCONJUGATE = function(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Return conjugate of complex number\n return (y !== 0) ? exports.COMPLEX(x, -y, unit) : inumber;\n};\n\nexports.IMCOS = function(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Return cosine of complex number\n return exports.COMPLEX(Math.cos(x) * (Math.exp(y) + Math.exp(-y)) / 2, -Math.sin(x) * (Math.exp(y) - Math.exp(-y)) / 2, unit);\n};\n\nexports.IMCOSH = function(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Return hyperbolic cosine of complex number\n return exports.COMPLEX(Math.cos(y) * (Math.exp(x) + Math.exp(-x)) / 2, Math.sin(y) * (Math.exp(x) - Math.exp(-x)) / 2, unit);\n};\n\nexports.IMCOT = function(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Return cotangent of complex number\n return exports.IMDIV(exports.IMCOS(inumber), exports.IMSIN(inumber));\n};\n\nexports.IMDIV = function(inumber1, inumber2) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var a = exports.IMREAL(inumber1);\n var b = exports.IMAGINARY(inumber1);\n var c = exports.IMREAL(inumber2);\n var d = exports.IMAGINARY(inumber2);\n\n if (utils.anyIsError(a, b, c, d)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit1 = inumber1.substring(inumber1.length - 1);\n var unit2 = inumber2.substring(inumber2.length - 1);\n var unit = 'i';\n if (unit1 === 'j') {\n unit = 'j';\n } else if (unit2 === 'j') {\n unit = 'j';\n }\n\n // Return error if inumber2 is null\n if (c === 0 && d === 0) {\n return error.num;\n }\n\n // Return exponential of complex number\n var den = c * c + d * d;\n return exports.COMPLEX((a * c + b * d) / den, (b * c - a * d) / den, unit);\n};\n\nexports.IMEXP = function(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Return exponential of complex number\n var e = Math.exp(x);\n return exports.COMPLEX(e * Math.cos(y), e * Math.sin(y), unit);\n};\n\nexports.IMLN = function(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Return exponential of complex number\n return exports.COMPLEX(Math.log(Math.sqrt(x * x + y * y)), Math.atan(y / x), unit);\n};\n\nexports.IMLOG10 = function(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Return exponential of complex number\n return exports.COMPLEX(Math.log(Math.sqrt(x * x + y * y)) / Math.log(10), Math.atan(y / x) / Math.log(10), unit);\n};\n\nexports.IMLOG2 = function(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Return exponential of complex number\n return exports.COMPLEX(Math.log(Math.sqrt(x * x + y * y)) / Math.log(2), Math.atan(y / x) / Math.log(2), unit);\n};\n\nexports.IMPOWER = function(inumber, number) {\n number = utils.parseNumber(number);\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n if (utils.anyIsError(number, x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Calculate power of modulus\n var p = Math.pow(exports.IMABS(inumber), number);\n\n // Calculate argument\n var t = exports.IMARGUMENT(inumber);\n\n // Return exponential of complex number\n return exports.COMPLEX(p * Math.cos(number * t), p * Math.sin(number * t), unit);\n};\n\nexports.IMPRODUCT = function() {\n // Initialize result\n var result = arguments[0];\n\n if (!arguments.length) {\n return error.value;\n }\n\n // Loop on all numbers\n for (var i = 1; i < arguments.length; i++) {\n // Lookup coefficients of two complex numbers\n var a = exports.IMREAL(result);\n var b = exports.IMAGINARY(result);\n var c = exports.IMREAL(arguments[i]);\n var d = exports.IMAGINARY(arguments[i]);\n\n if (utils.anyIsError(a, b, c, d)) {\n return error.value;\n }\n\n // Complute product of two complex numbers\n result = exports.COMPLEX(a * c - b * d, a * d + b * c);\n }\n\n // Return product of complex numbers\n return result;\n};\n\nexports.IMREAL = function(inumber) {\n if (inumber === undefined || inumber === true || inumber === false) {\n return error.value;\n }\n\n // Return 0 if inumber is equal to 0\n if (inumber === 0 || inumber === '0') {\n return 0;\n }\n\n // Handle special cases\n if (['i', '+i', '1i', '+1i', '-i', '-1i', 'j', '+j', '1j', '+1j', '-j', '-1j'].indexOf(inumber) >= 0) {\n return 0;\n }\n\n // Lookup sign\n var plus = inumber.indexOf('+');\n var minus = inumber.indexOf('-');\n if (plus === 0) {\n plus = inumber.indexOf('+', 1);\n }\n if (minus === 0) {\n minus = inumber.indexOf('-', 1);\n }\n\n // Lookup imaginary unit\n var last = inumber.substring(inumber.length - 1, inumber.length);\n var unit = (last === 'i' || last === 'j');\n\n if (plus >= 0 || minus >= 0) {\n // Return error if imaginary unit is neither i nor j\n if (!unit) {\n return error.num;\n }\n\n // Return real coefficient of complex number\n if (plus >= 0) {\n return (isNaN(inumber.substring(0, plus)) || isNaN(inumber.substring(plus + 1, inumber.length - 1))) ?\n error.num :\n Number(inumber.substring(0, plus));\n } else {\n return (isNaN(inumber.substring(0, minus)) || isNaN(inumber.substring(minus + 1, inumber.length - 1))) ?\n error.num :\n Number(inumber.substring(0, minus));\n }\n } else {\n if (unit) {\n return (isNaN(inumber.substring(0, inumber.length - 1))) ? error.num : 0;\n } else {\n return (isNaN(inumber)) ? error.num : inumber;\n }\n }\n};\n\nexports.IMSEC = function(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return error.value;\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Return secant of complex number\n return exports.IMDIV('1', exports.IMCOS(inumber));\n};\n\nexports.IMSECH = function(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Return hyperbolic secant of complex number\n return exports.IMDIV('1', exports.IMCOSH(inumber));\n};\n\nexports.IMSIN = function(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Return sine of complex number\n return exports.COMPLEX(Math.sin(x) * (Math.exp(y) + Math.exp(-y)) / 2, Math.cos(x) * (Math.exp(y) - Math.exp(-y)) / 2, unit);\n};\n\nexports.IMSINH = function(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Return hyperbolic sine of complex number\n return exports.COMPLEX(Math.cos(y) * (Math.exp(x) - Math.exp(-x)) / 2, Math.sin(y) * (Math.exp(x) + Math.exp(-x)) / 2, unit);\n};\n\nexports.IMSQRT = function(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Calculate power of modulus\n var s = Math.sqrt(exports.IMABS(inumber));\n\n // Calculate argument\n var t = exports.IMARGUMENT(inumber);\n\n // Return exponential of complex number\n return exports.COMPLEX(s * Math.cos(t / 2), s * Math.sin(t / 2), unit);\n};\n\nexports.IMCSC = function (inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return error.value;\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (utils.anyIsError(x, y)) {\n return error.num;\n }\n\n // Return cosecant of complex number\n return exports.IMDIV('1', exports.IMSIN(inumber));\n};\n\nexports.IMCSCH = function (inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return error.value;\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (utils.anyIsError(x, y)) {\n return error.num;\n }\n\n // Return hyperbolic cosecant of complex number\n return exports.IMDIV('1', exports.IMSINH(inumber));\n};\n\nexports.IMSUB = function(inumber1, inumber2) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var a = this.IMREAL(inumber1);\n var b = this.IMAGINARY(inumber1);\n var c = this.IMREAL(inumber2);\n var d = this.IMAGINARY(inumber2);\n\n if (utils.anyIsError(a, b, c, d)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit1 = inumber1.substring(inumber1.length - 1);\n var unit2 = inumber2.substring(inumber2.length - 1);\n var unit = 'i';\n if (unit1 === 'j') {\n unit = 'j';\n } else if (unit2 === 'j') {\n unit = 'j';\n }\n\n // Return _ of two complex numbers\n return this.COMPLEX(a - c, b - d, unit);\n};\n\nexports.IMSUM = function() {\n if (!arguments.length) {\n return error.value;\n }\n var args = utils.flatten(arguments);\n\n // Initialize result\n var result = args[0];\n\n // Loop on all numbers\n for (var i = 1; i < args.length; i++) {\n // Lookup coefficients of two complex numbers\n var a = this.IMREAL(result);\n var b = this.IMAGINARY(result);\n var c = this.IMREAL(args[i]);\n var d = this.IMAGINARY(args[i]);\n\n if (utils.anyIsError(a, b, c, d)) {\n return error.value;\n }\n\n // Complute product of two complex numbers\n result = this.COMPLEX(a + c, b + d);\n }\n\n // Return sum of complex numbers\n return result;\n};\n\nexports.IMTAN = function(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return error.value;\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Return tangent of complex number\n return this.IMDIV(this.IMSIN(inumber), this.IMCOS(inumber));\n};\n\nexports.OCT2BIN = function(number, places) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-7]{1,10}$/.test(number)) {\n return error.num;\n }\n\n // Check if number is negative\n var negative = (number.length === 10 && number.substring(0, 1) === '7') ? true : false;\n\n // Convert octal number to decimal\n var decimal = (negative) ? parseInt(number, 8) - 1073741824 : parseInt(number, 8);\n\n // Return error if number is lower than -512 or greater than 511\n if (decimal < -512 || decimal > 511) {\n return error.num;\n }\n\n // Ignore places and return a 10-character binary number if number is negative\n if (negative) {\n return '1' + text.REPT('0', 9 - (512 + decimal).toString(2).length) + (512 + decimal).toString(2);\n }\n\n // Convert decimal number to binary\n var result = decimal.toString(2);\n\n // Return binary number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result;\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return error.value;\n }\n\n // Return error if places is negative\n if (places < 0) {\n return error.num;\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n }\n};\n\nexports.OCT2DEC = function(number) {\n // Return error if number is not octal or contains more than ten characters (10 digits)\n if (!/^[0-7]{1,10}$/.test(number)) {\n return error.num;\n }\n\n // Convert octal number to decimal\n var decimal = parseInt(number, 8);\n\n // Return decimal number\n return (decimal >= 536870912) ? decimal - 1073741824 : decimal;\n};\n\nexports.OCT2HEX = function(number, places) {\n // Return error if number is not octal or contains more than ten characters (10 digits)\n if (!/^[0-7]{1,10}$/.test(number)) {\n return error.num;\n }\n\n // Convert octal number to decimal\n var decimal = parseInt(number, 8);\n\n // Ignore places and return a 10-character octal number if number is negative\n if (decimal >= 536870912) {\n return 'ff' + (decimal + 3221225472).toString(16);\n }\n\n // Convert decimal number to hexadecimal\n var result = decimal.toString(16);\n\n // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result;\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return error.value;\n }\n\n // Return error if places is negative\n if (places < 0) {\n return error.num;\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n }\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/engineering.js\n ** module id = 25\n ** module chunks = 0\n **/","var M = Math;\nfunction _horner(arr, v) { return arr.reduce(function(z,w){return v * z + w;},0); };\nfunction _bessel_iter(x, n, f0, f1, sign) {\n if(!sign) sign = -1;\n var tdx = 2 / x, f2;\n if(n === 0) return f0;\n if(n === 1) return f1;\n for(var o = 1; o != n; ++o) {\n f2 = f1 * o * tdx + sign * f0;\n f0 = f1; f1 = f2;\n }\n return f1;\n}\nfunction _bessel_wrap(bessel0, bessel1, name, nonzero, sign) {\n return function bessel(x,n) {\n if(n === 0) return bessel0(x);\n if(n === 1) return bessel1(x);\n if(n < 0) throw name + ': Order (' + n + ') must be nonnegative';\n if(nonzero == 1 && x === 0) throw name + ': Undefined when x == 0';\n if(nonzero == 2 && x <= 0) throw name + ': Undefined when x <= 0';\n var b0 = bessel0(x), b1 = bessel1(x);\n return _bessel_iter(x, n, b0, b1, sign);\n };\n}\nvar besselj = (function() {\n var b0_a1a = [57568490574.0,-13362590354.0,651619640.7,-11214424.18,77392.33017,-184.9052456].reverse();\n var b0_a2a = [57568490411.0,1029532985.0,9494680.718,59272.64853,267.8532712,1.0].reverse();\n var b0_a1b = [1.0, -0.1098628627e-2, 0.2734510407e-4, -0.2073370639e-5, 0.2093887211e-6].reverse();\n var b0_a2b = [-0.1562499995e-1, 0.1430488765e-3, -0.6911147651e-5, 0.7621095161e-6, -0.934935152e-7].reverse();\n var W = 0.636619772; // 2 / Math.PI\n\n function bessel0(x) {\n var a, a1, a2, y = x * x, xx = M.abs(x) - 0.785398164;\n if(M.abs(x) < 8) {\n a1 = _horner(b0_a1a, y);\n a2 = _horner(b0_a2a, y);\n a = a1/a2;\n }\n else {\n y = 64 / y;\n a1 = _horner(b0_a1b, y);\n a2 = _horner(b0_a2b, y);\n a = M.sqrt(W/M.abs(x))*(M.cos(xx)*a1-M.sin(xx)*a2*8/M.abs(x));\n }\n return a;\n }\n var b1_a1a = [72362614232.0,-7895059235.0,242396853.1,-2972611.439, 15704.48260, -30.16036606].reverse();\n var b1_a2a = [144725228442.0, 2300535178.0, 18583304.74, 99447.43394, 376.9991397, 1.0].reverse();\n var b1_a1b = [1.0, 0.183105e-2, -0.3516396496e-4, 0.2457520174e-5, -0.240337019e-6].reverse();\n var b1_a2b = [0.04687499995, -0.2002690873e-3, 0.8449199096e-5, -0.88228987e-6, 0.105787412e-6].reverse();\n function bessel1(x) {\n var a, a1, a2, y = x*x, xx = M.abs(x) - 2.356194491;\n if(Math.abs(x)< 8) {\n a1 = x*_horner(b1_a1a, y);\n a2 = _horner(b1_a2a, y);\n a = a1 / a2;\n } else {\n y = 64 / y;\n a1=_horner(b1_a1b, y);\n a2=_horner(b1_a2b, y);\n a=M.sqrt(W/M.abs(x))*(M.cos(xx)*a1-M.sin(xx)*a2*8/M.abs(x));\n if(x < 0) a = -a;\n }\n return a;\n }\n return function besselj(x, n) {\n n = Math.round(n);\n if(n === 0) return bessel0(M.abs(x));\n if(n === 1) return bessel1(M.abs(x));\n if(n < 0) throw 'BESSELJ: Order (' + n + ') must be nonnegative';\n if(M.abs(x) === 0) return 0;\n\n var ret, j, tox = 2 / M.abs(x), m, jsum, sum, bjp, bj, bjm;\n if(M.abs(x) > n) {\n ret = _bessel_iter(x, n, bessel0(M.abs(x)), bessel1(M.abs(x)),-1);\n } else {\n m=2*M.floor((n+M.floor(M.sqrt(40*n)))/2);\n jsum=0;\n bjp=ret=sum=0.0;\n bj=1.0;\n for (j=m;j>0;j--) {\n bjm=j*tox*bj-bjp;\n bjp=bj;\n bj=bjm;\n if (M.abs(bj) > 1E10) {\n bj *= 1E-10;\n bjp *= 1E-10;\n ret *= 1E-10;\n sum *= 1E-10;\n }\n if (jsum) sum += bj;\n jsum=!jsum;\n if (j == n) ret=bjp;\n }\n sum=2.0*sum-bj;\n ret /= sum;\n }\n return x < 0 && (n%2) ? -ret : ret;\n };\n})();\nvar bessely = (function() {\n var b0_a1a = [-2957821389.0, 7062834065.0, -512359803.6, 10879881.29, -86327.92757, 228.4622733].reverse();\n var b0_a2a = [40076544269.0, 745249964.8, 7189466.438, 47447.26470, 226.1030244, 1.0].reverse();\n var b0_a1b = [1.0, -0.1098628627e-2, 0.2734510407e-4, -0.2073370639e-5, 0.2093887211e-6].reverse();\n var b0_a2b = [-0.1562499995e-1, 0.1430488765e-3, -0.6911147651e-5, 0.7621095161e-6, -0.934945152e-7].reverse();\n\n var W = 0.636619772;\n function bessel0(x) {\n var a, a1, a2, y = x * x, xx = x - 0.785398164;\n if(x < 8) {\n a1 = _horner(b0_a1a, y);\n a2 = _horner(b0_a2a, y);\n a = a1/a2 + W * besselj(x,0) * M.log(x);\n } else {\n y = 64 / y;\n a1 = _horner(b0_a1b, y);\n a2 = _horner(b0_a2b, y);\n a = M.sqrt(W/x)*(M.sin(xx)*a1+M.cos(xx)*a2*8/x);\n }\n return a;\n }\n\n var b1_a1a = [-0.4900604943e13, 0.1275274390e13, -0.5153438139e11, 0.7349264551e9, -0.4237922726e7, 0.8511937935e4].reverse();\n var b1_a2a = [0.2499580570e14, 0.4244419664e12, 0.3733650367e10, 0.2245904002e8, 0.1020426050e6, 0.3549632885e3, 1].reverse();\n var b1_a1b = [1.0, 0.183105e-2, -0.3516396496e-4, 0.2457520174e-5, -0.240337019e-6].reverse();\n var b1_a2b = [0.04687499995, -0.2002690873e-3, 0.8449199096e-5, -0.88228987e-6, 0.105787412e-6].reverse();\n function bessel1(x) {\n var a, a1, a2, y = x*x, xx = x - 2.356194491;\n if(x < 8) {\n a1 = x*_horner(b1_a1a, y);\n a2 = _horner(b1_a2a, y);\n a = a1/a2 + W * (besselj(x,1) * M.log(x) - 1 / x);\n } else {\n y = 64 / y;\n a1=_horner(b1_a1b, y);\n a2=_horner(b1_a2b, y);\n a=M.sqrt(W/x)*(M.sin(xx)*a1+M.cos(xx)*a2*8/x);\n }\n return a;\n }\n\n return _bessel_wrap(bessel0, bessel1, 'BESSELY', 1, -1);\n})();\nvar besseli = (function() {\n var b0_a = [1.0, 3.5156229, 3.0899424, 1.2067492, 0.2659732, 0.360768e-1, 0.45813e-2].reverse();\n var b0_b = [0.39894228, 0.1328592e-1, 0.225319e-2, -0.157565e-2, 0.916281e-2, -0.2057706e-1, 0.2635537e-1, -0.1647633e-1, 0.392377e-2].reverse();\n function bessel0(x) {\n if(x <= 3.75) return _horner(b0_a, x*x/(3.75*3.75));\n return M.exp(M.abs(x))/M.sqrt(M.abs(x))*_horner(b0_b, 3.75/M.abs(x));\n }\n\n var b1_a = [0.5, 0.87890594, 0.51498869, 0.15084934, 0.2658733e-1, 0.301532e-2, 0.32411e-3].reverse();\n var b1_b = [0.39894228, -0.3988024e-1, -0.362018e-2, 0.163801e-2, -0.1031555e-1, 0.2282967e-1, -0.2895312e-1, 0.1787654e-1, -0.420059e-2].reverse();\n function bessel1(x) {\n if(x < 3.75) return x * _horner(b1_a, x*x/(3.75*3.75));\n return (x < 0 ? -1 : 1) * M.exp(M.abs(x))/M.sqrt(M.abs(x))*_horner(b1_b, 3.75/M.abs(x));\n }\n\n return function besseli(x, n) {\n n = Math.round(n);\n if(n === 0) return bessel0(x);\n if(n == 1) return bessel1(x);\n if(n < 0) throw 'BESSELI Order (' + n + ') must be nonnegative';\n if(M.abs(x) === 0) return 0;\n\n var ret, j, tox = 2 / M.abs(x), m, bip, bi, bim;\n m=2*M.round((n+M.round(M.sqrt(40*n)))/2);\n bip=ret=0.0;\n bi=1.0;\n for (j=m;j>0;j--) {\n bim=j*tox*bi + bip;\n bip=bi; bi=bim;\n if (M.abs(bi) > 1E10) {\n bi *= 1E-10;\n bip *= 1E-10;\n ret *= 1E-10;\n }\n if(j == n) ret = bip;\n }\n ret *= besseli(x, 0) / bi;\n return x < 0 && (n%2) ? -ret : ret;\n };\n\n})();\n\nvar besselk = (function() {\n var b0_a = [-0.57721566, 0.42278420, 0.23069756, 0.3488590e-1, 0.262698e-2, 0.10750e-3, 0.74e-5].reverse();\n var b0_b = [1.25331414, -0.7832358e-1, 0.2189568e-1, -0.1062446e-1, 0.587872e-2, -0.251540e-2, 0.53208e-3].reverse();\n function bessel0(x) {\n if(x <= 2) return -M.log(x/2)*besseli(x,0) + _horner(b0_a, x*x/4);\n return M.exp(-x)/M.sqrt(x)*_horner(b0_b, 2/x);\n }\n\n var b1_a = [1.0, 0.15443144, -0.67278579, -0.18156897, -0.1919402e-1, -0.110404e-2, -0.4686e-4].reverse();\n var b1_b = [1.25331414, 0.23498619, -0.3655620e-1, 0.1504268e-1, -0.780353e-2, 0.325614e-2, -0.68245e-3].reverse();\n function bessel1(x) {\n if(x <= 2) return M.log(x/2)*besseli(x,1) + (1/x)*_horner(b1_a, x*x/4);\n return M.exp(-x)/M.sqrt(x)*_horner(b1_b, 2/x);\n }\n\n return _bessel_wrap(bessel0, bessel1, 'BESSELK', 2, 1);\n})();\nif(typeof exports !== \"undefined\") {\n exports.besselj = besselj;\n exports.bessely = bessely;\n exports.besseli = besseli;\n exports.besselk = besselk;\n}\n\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/~/bessel/bessel.js\n ** module id = 26\n ** module chunks = 0\n **/","var error = require('./error');\nvar utils = require('./utils');\n\nvar d1900 = new Date(1900, 0, 1);\nvar WEEK_STARTS = [\n undefined,\n 0,\n 1,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 0\n];\nvar WEEK_TYPES = [\n [],\n [1, 2, 3, 4, 5, 6, 7],\n [7, 1, 2, 3, 4, 5, 6],\n [6, 0, 1, 2, 3, 4, 5],\n [],\n [],\n [],\n [],\n [],\n [],\n [],\n [7, 1, 2, 3, 4, 5, 6],\n [6, 7, 1, 2, 3, 4, 5],\n [5, 6, 7, 1, 2, 3, 4],\n [4, 5, 6, 7, 1, 2, 3],\n [3, 4, 5, 6, 7, 1, 2],\n [2, 3, 4, 5, 6, 7, 1],\n [1, 2, 3, 4, 5, 6, 7]\n];\nvar WEEKEND_TYPES = [\n [],\n [6, 0],\n [0, 1],\n [1, 2],\n [2, 3],\n [3, 4],\n [4, 5],\n [5, 6],\n undefined,\n undefined,\n undefined, [0, 0],\n [1, 1],\n [2, 2],\n [3, 3],\n [4, 4],\n [5, 5],\n [6, 6]\n];\n\nexports.DATE = function(year, month, day) {\n var result;\n\n year = utils.parseNumber(year);\n month = utils.parseNumber(month);\n day = utils.parseNumber(day);\n\n if (utils.anyIsError(year, month, day)) {\n result = error.value;\n\n } else if (year < 0 || month < 0 || day < 0) {\n result = error.num;\n\n } else {\n result = new Date(year, month - 1, day);\n }\n\n return result;\n};\n\nexports.DATEVALUE = function(date_text) {\n if (typeof date_text !== 'string') {\n return error.value;\n }\n var date = Date.parse(date_text);\n\n if (isNaN(date)) {\n return error.value;\n }\n if (date <= -2203891200000) {\n return (date - d1900) / 86400000 + 1;\n }\n\n return (date - d1900) / 86400000 + 2;\n};\n\nexports.DAY = function(serial_number) {\n var date = utils.parseDate(serial_number);\n if (date instanceof Error) {\n return date;\n }\n\n return date.getDate();\n};\n\nexports.DAYS = function(end_date, start_date) {\n end_date = utils.parseDate(end_date);\n start_date = utils.parseDate(start_date);\n\n if (end_date instanceof Error) {\n return end_date;\n }\n if (start_date instanceof Error) {\n return start_date;\n }\n\n return serial(end_date) - serial(start_date);\n};\n\nexports.DAYS360 = function(start_date, end_date, method) {\n method = utils.parseBool(method);\n start_date = utils.parseDate(start_date);\n end_date = utils.parseDate(end_date);\n\n if (start_date instanceof Error) {\n return start_date;\n }\n if (end_date instanceof Error) {\n return end_date;\n }\n if (method instanceof Error) {\n return method;\n }\n var sm = start_date.getMonth();\n var em = end_date.getMonth();\n var sd, ed;\n\n if (method) {\n sd = start_date.getDate() === 31 ? 30 : start_date.getDate();\n ed = end_date.getDate() === 31 ? 30 : end_date.getDate();\n } else {\n var smd = new Date(start_date.getFullYear(), sm + 1, 0).getDate();\n var emd = new Date(end_date.getFullYear(), em + 1, 0).getDate();\n sd = start_date.getDate() === smd ? 30 : start_date.getDate();\n if (end_date.getDate() === emd) {\n if (sd < 30) {\n em++;\n ed = 1;\n } else {\n ed = 30;\n }\n } else {\n ed = end_date.getDate();\n }\n }\n\n return 360 * (end_date.getFullYear() - start_date.getFullYear()) +\n 30 * (em - sm) + (ed - sd);\n};\n\nexports.EDATE = function(start_date, months) {\n start_date = utils.parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date;\n }\n if (isNaN(months)) {\n return error.value;\n }\n months = parseInt(months, 10);\n start_date.setMonth(start_date.getMonth() + months);\n\n return serial(start_date);\n};\n\nexports.EOMONTH = function(start_date, months) {\n start_date = utils.parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date;\n }\n if (isNaN(months)) {\n return error.value;\n }\n months = parseInt(months, 10);\n\n return serial(new Date(start_date.getFullYear(), start_date.getMonth() + months + 1, 0));\n};\n\nexports.HOUR = function(serial_number) {\n serial_number = utils.parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number;\n }\n\n return serial_number.getHours();\n};\n\nexports.INTERVAL = function (second) {\n if (typeof second !== 'number' && typeof second !== 'string') {\n return error.value;\n } else {\n second = parseInt(second, 10);\n }\n\n var year = Math.floor(second/946080000);\n second = second%946080000;\n var month = Math.floor(second/2592000);\n second = second%2592000;\n var day = Math.floor(second/86400);\n second = second%86400;\n\n var hour = Math.floor(second/3600);\n second = second%3600;\n var min = Math.floor(second/60);\n second = second%60;\n var sec = second;\n\n year = (year > 0) ? year + 'Y' : '';\n month = (month > 0) ? month + 'M' : '';\n day = (day > 0) ? day + 'D' : '';\n hour = (hour > 0) ? hour + 'H' : '';\n min = (min > 0) ? min + 'M' : '';\n sec = (sec > 0) ? sec + 'S' : '';\n\n return 'P' + year + month + day + 'T' + hour + min + sec;\n};\n\nexports.ISOWEEKNUM = function(date) {\n date = utils.parseDate(date);\n\n if (date instanceof Error) {\n return date;\n }\n\n date.setHours(0, 0, 0);\n date.setDate(date.getDate() + 4 - (date.getDay() || 7));\n var yearStart = new Date(date.getFullYear(), 0, 1);\n\n return Math.ceil((((date - yearStart) / 86400000) + 1) / 7);\n};\n\nexports.MINUTE = function(serial_number) {\n serial_number = utils.parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number;\n }\n\n return serial_number.getMinutes();\n};\n\nexports.MONTH = function(serial_number) {\n serial_number = utils.parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number;\n }\n\n return serial_number.getMonth() + 1;\n};\n\nexports.NETWORKDAYS = function(start_date, end_date, holidays) {\n return this.NETWORKDAYS.INTL(start_date, end_date, 1, holidays);\n};\n\nexports.NETWORKDAYS.INTL = function(start_date, end_date, weekend, holidays) {\n start_date = utils.parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date;\n }\n end_date = utils.parseDate(end_date);\n\n if (end_date instanceof Error) {\n return end_date;\n }\n if (weekend === undefined) {\n weekend = WEEKEND_TYPES[1];\n } else {\n weekend = WEEKEND_TYPES[weekend];\n }\n if (!(weekend instanceof Array)) {\n return error.value;\n }\n if (holidays === undefined) {\n holidays = [];\n } else if (!(holidays instanceof Array)) {\n holidays = [holidays];\n }\n\n for (var i = 0; i < holidays.length; i++) {\n var h = utils.parseDate(holidays[i]);\n if (h instanceof Error) {\n return h;\n }\n holidays[i] = h;\n }\n var days = (end_date - start_date) / (1000 * 60 * 60 * 24) + 1;\n var total = days;\n var day = start_date;\n for (i = 0; i < days; i++) {\n var d = (new Date().getTimezoneOffset() > 0) ? day.getUTCDay() : day.getDay();\n var dec = false;\n if (d === weekend[0] || d === weekend[1]) {\n dec = true;\n }\n for (var j = 0; j < holidays.length; j++) {\n var holiday = holidays[j];\n if (holiday.getDate() === day.getDate() &&\n holiday.getMonth() === day.getMonth() &&\n holiday.getFullYear() === day.getFullYear()) {\n dec = true;\n break;\n }\n }\n if (dec) {\n total--;\n }\n day.setDate(day.getDate() + 1);\n }\n\n return total;\n};\n\nexports.NOW = function() {\n return new Date();\n};\n\nexports.SECOND = function(serial_number) {\n serial_number = utils.parseDate(serial_number);\n if (serial_number instanceof Error) {\n return serial_number;\n }\n\n return serial_number.getSeconds();\n};\n\nexports.TIME = function(hour, minute, second) {\n hour = utils.parseNumber(hour);\n minute = utils.parseNumber(minute);\n second = utils.parseNumber(second);\n if (utils.anyIsError(hour, minute, second)) {\n return error.value;\n }\n if (hour < 0 || minute < 0 || second < 0) {\n return error.num;\n }\n\n return (3600 * hour + 60 * minute + second) / 86400;\n};\n\nexports.TIMEVALUE = function(time_text) {\n time_text = utils.parseDate(time_text);\n\n if (time_text instanceof Error) {\n return time_text;\n }\n\n return (3600 * time_text.getHours() + 60 * time_text.getMinutes() + time_text.getSeconds()) / 86400;\n};\n\nexports.TODAY = function() {\n return new Date();\n};\n\nexports.WEEKDAY = function(serial_number, return_type) {\n serial_number = utils.parseDate(serial_number);\n if (serial_number instanceof Error) {\n return serial_number;\n }\n if (return_type === undefined) {\n return_type = 1;\n }\n var day = serial_number.getDay();\n\n return WEEK_TYPES[return_type][day];\n};\n\nexports.WEEKNUM = function(serial_number, return_type) {\n serial_number = utils.parseDate(serial_number);\n if (serial_number instanceof Error) {\n return serial_number;\n }\n if (return_type === undefined) {\n return_type = 1;\n }\n if (return_type === 21) {\n return this.ISOWEEKNUM(serial_number);\n }\n var week_start = WEEK_STARTS[return_type];\n var jan = new Date(serial_number.getFullYear(), 0, 1);\n var inc = jan.getDay() < week_start ? 1 : 0;\n jan -= Math.abs(jan.getDay() - week_start) * 24 * 60 * 60 * 1000;\n\n return Math.floor(((serial_number - jan) / (1000 * 60 * 60 * 24)) / 7 + 1) + inc;\n};\n\nexports.WORKDAY = function(start_date, days, holidays) {\n return this.WORKDAY.INTL(start_date, days, 1, holidays);\n};\n\nexports.WORKDAY.INTL = function(start_date, days, weekend, holidays) {\n start_date = utils.parseDate(start_date);\n if (start_date instanceof Error) {\n return start_date;\n }\n days = utils.parseNumber(days);\n if (days instanceof Error) {\n return days;\n }\n if (days < 0) {\n return error.num;\n }\n if (weekend === undefined) {\n weekend = WEEKEND_TYPES[1];\n } else {\n weekend = WEEKEND_TYPES[weekend];\n }\n if (!(weekend instanceof Array)) {\n return error.value;\n }\n if (holidays === undefined) {\n holidays = [];\n } else if (!(holidays instanceof Array)) {\n holidays = [holidays];\n }\n for (var i = 0; i < holidays.length; i++) {\n var h = utils.parseDate(holidays[i]);\n if (h instanceof Error) {\n return h;\n }\n holidays[i] = h;\n }\n var d = 0;\n while (d < days) {\n start_date.setDate(start_date.getDate() + 1);\n var day = start_date.getDay();\n if (day === weekend[0] || day === weekend[1]) {\n continue;\n }\n for (var j = 0; j < holidays.length; j++) {\n var holiday = holidays[j];\n if (holiday.getDate() === start_date.getDate() &&\n holiday.getMonth() === start_date.getMonth() &&\n holiday.getFullYear() === start_date.getFullYear()) {\n d--;\n break;\n }\n }\n d++;\n }\n\n return start_date;\n};\n\nexports.YEAR = function(serial_number) {\n serial_number = utils.parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number;\n }\n\n return serial_number.getFullYear();\n};\n\nfunction isLeapYear(year) {\n return new Date(year, 1, 29).getMonth() === 1;\n}\n\n// TODO : Use DAYS ?\nfunction daysBetween(start_date, end_date) {\n return Math.ceil((end_date - start_date) / 1000 / 60 / 60 / 24);\n}\n\nexports.YEARFRAC = function(start_date, end_date, basis) {\n start_date = utils.parseDate(start_date);\n if (start_date instanceof Error) {\n return start_date;\n }\n end_date = utils.parseDate(end_date);\n if (end_date instanceof Error) {\n return end_date;\n }\n\n basis = basis || 0;\n var sd = start_date.getDate();\n var sm = start_date.getMonth() + 1;\n var sy = start_date.getFullYear();\n var ed = end_date.getDate();\n var em = end_date.getMonth() + 1;\n var ey = end_date.getFullYear();\n\n switch (basis) {\n case 0:\n // US (NASD) 30/360\n if (sd === 31 && ed === 31) {\n sd = 30;\n ed = 30;\n } else if (sd === 31) {\n sd = 30;\n } else if (sd === 30 && ed === 31) {\n ed = 30;\n }\n return ((ed + em * 30 + ey * 360) - (sd + sm * 30 + sy * 360)) / 360;\n case 1:\n // Actual/actual\n var feb29Between = function(date1, date2) {\n var year1 = date1.getFullYear();\n var mar1year1 = new Date(year1, 2, 1);\n if (isLeapYear(year1) && date1 < mar1year1 && date2 >= mar1year1) {\n return true;\n }\n var year2 = date2.getFullYear();\n var mar1year2 = new Date(year2, 2, 1);\n return (isLeapYear(year2) && date2 >= mar1year2 && date1 < mar1year2);\n };\n var ylength = 365;\n if (sy === ey || ((sy + 1) === ey) && ((sm > em) || ((sm === em) && (sd >= ed)))) {\n if ((sy === ey && isLeapYear(sy)) ||\n feb29Between(start_date, end_date) ||\n (em === 1 && ed === 29)) {\n ylength = 366;\n }\n return daysBetween(start_date, end_date) / ylength;\n }\n var years = (ey - sy) + 1;\n var days = (new Date(ey + 1, 0, 1) - new Date(sy, 0, 1)) / 1000 / 60 / 60 / 24;\n var average = days / years;\n return daysBetween(start_date, end_date) / average;\n case 2:\n // Actual/360\n return daysBetween(start_date, end_date) / 360;\n case 3:\n // Actual/365\n return daysBetween(start_date, end_date) / 365;\n case 4:\n // European 30/360\n return ((ed + em * 30 + ey * 360) - (sd + sm * 30 + sy * 360)) / 360;\n }\n};\n\nfunction serial(date) {\n var addOn = (date > -2203891200000) ? 2 : 1;\n\n return (date - d1900) / 86400000 + addOn;\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/date-time.js\n ** module id = 27\n ** module chunks = 0\n **/","var error = require('./error');\nvar stats = require('./statistical');\nvar maths = require('./math-trig');\nvar utils = require('./utils');\n\nfunction compact(array) {\n var result = [];\n\n utils.arrayEach(array, function(value) {\n if (value) {\n result.push(value);\n }\n });\n\n return result;\n}\n\nexports.FINDFIELD = function(database, title) {\n var index = null;\n\n utils.arrayEach(database, function(value, i) {\n if (value[0] === title) {\n index = i;\n return false;\n }\n });\n\n // Return error if the input field title is incorrect\n if (index == null) {\n return error.value;\n }\n\n return index;\n};\n\nfunction findResultIndex(database, criterias) {\n var matches = {};\n for (var i = 1; i < database[0].length; ++i) {\n matches[i] = true;\n }\n var maxCriteriaLength = criterias[0].length;\n for (i = 1; i < criterias.length; ++i) {\n if (criterias[i].length > maxCriteriaLength) {\n maxCriteriaLength = criterias[i].length;\n }\n }\n\n for (var k = 1; k < database.length; ++k) {\n for (var l = 1; l < database[k].length; ++l) {\n var currentCriteriaResult = false;\n var hasMatchingCriteria = false;\n for (var j = 0; j < criterias.length; ++j) {\n var criteria = criterias[j];\n if (criteria.length < maxCriteriaLength) {\n continue;\n }\n\n var criteriaField = criteria[0];\n if (database[k][0] !== criteriaField) {\n continue;\n }\n hasMatchingCriteria = true;\n for (var p = 1; p < criteria.length; ++p) {\n currentCriteriaResult = currentCriteriaResult || eval(database[k][l] + criteria[p]); // jshint ignore:line\n }\n }\n if (hasMatchingCriteria) {\n matches[l] = matches[l] && currentCriteriaResult;\n }\n }\n }\n\n var result = [];\n for (var n = 0; n < database[0].length; ++n) {\n if (matches[n]) {\n result.push(n - 1);\n }\n }\n\n return result;\n}\n\n// Database functions\nexports.DAVERAGE = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n var sum = 0;\n\n utils.arrayEach(resultIndexes, function(value) {\n sum += targetFields[value];\n });\n\n return resultIndexes.length === 0 ? error.div0 : sum / resultIndexes.length;\n};\n\nexports.DCOUNT = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n\n var targetValues = [];\n\n utils.arrayEach(resultIndexes, function(value) {\n targetValues.push(targetFields[value]);\n });\n\n return stats.COUNT(targetValues);\n};\n\nexports.DCOUNTA = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n\n var targetValues = [];\n\n utils.arrayEach(resultIndexes, function(value) {\n targetValues.push(targetFields[value]);\n });\n\n return stats.COUNTA(targetValues);\n};\n\nexports.DGET = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n\n // Return error if no record meets the criteria\n if (resultIndexes.length === 0) {\n return error.value;\n }\n // Returns the #NUM! error value because more than one record meets the\n // criteria\n if (resultIndexes.length > 1) {\n return error.num;\n }\n\n return targetFields[resultIndexes[0]];\n};\n\nexports.DMAX = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n\n var maxValue = targetFields[resultIndexes[0]];\n\n utils.arrayEach(resultIndexes, function(value) {\n if (maxValue < targetFields[value]) {\n maxValue = targetFields[value];\n }\n });\n\n return maxValue;\n};\n\nexports.DMIN = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n\n var minValue = targetFields[resultIndexes[0]];\n\n utils.arrayEach(resultIndexes, function(value) {\n if (minValue > targetFields[value]) {\n minValue = targetFields[value];\n }\n });\n\n return minValue;\n};\n\nexports.DPRODUCT = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n\n var targetValues = [];\n\n utils.arrayEach(resultIndexes, function(value) {\n targetValues.push(targetFields[value]);\n });\n targetValues = compact(targetValues);\n\n var result = 1;\n\n utils.arrayEach(targetValues, function(value) {\n result *= value;\n });\n\n return result;\n};\n\nexports.DSTDEV = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n var targetValues = [];\n\n utils.arrayEach(resultIndexes, function(value) {\n targetValues.push(targetFields[value]);\n });\n targetValues = compact(targetValues);\n\n return stats.STDEV.S(targetValues);\n};\n\nexports.DSTDEVP = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n\n var targetValues = [];\n\n utils.arrayEach(resultIndexes, function(value) {\n targetValues.push(targetFields[value]);\n });\n targetValues = compact(targetValues);\n\n return stats.STDEV.P(targetValues);\n};\n\nexports.DSUM = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n\n var targetValues = [];\n\n utils.arrayEach(resultIndexes, function(value) {\n targetValues.push(targetFields[value]);\n });\n\n return maths.SUM(targetValues);\n};\n\nexports.DVAR = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n var targetValues = [];\n\n utils.arrayEach(resultIndexes, function(value) {\n targetValues.push(targetFields[value]);\n });\n\n return stats.VAR.S(targetValues);\n};\n\nexports.DVARP = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n var targetValues = [];\n\n utils.arrayEach(resultIndexes, function(value) {\n targetValues.push(targetFields[value]);\n });\n\n return stats.VAR.P(targetValues);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/database.js\n ** module id = 28\n ** module chunks = 0\n **/","var error = require('./error');\nvar utils = require('./utils');\nvar information = require('./information');\n\nexports.AND = function() {\n var args = utils.flatten(arguments);\n var result = true;\n for (var i = 0; i < args.length; i++) {\n if (!args[i]) {\n result = false;\n }\n }\n return result;\n};\n\nexports.CHOOSE = function() {\n if (arguments.length < 2) {\n return error.na;\n }\n\n var index = arguments[0];\n if (index < 1 || index > 254) {\n return error.value;\n }\n\n if (arguments.length < index + 1) {\n return error.value;\n }\n\n return arguments[index];\n};\n\nexports.FALSE = function() {\n return false;\n};\n\nexports.IF = function(test, then_value, otherwise_value) {\n return test ? then_value : otherwise_value;\n};\n\nexports.IFERROR = function(value, valueIfError) {\n if (information.ISERROR(value)) {\n return valueIfError;\n }\n return value;\n};\n\nexports.IFNA = function(value, value_if_na) {\n return value === error.na ? value_if_na : value;\n};\n\nexports.NOT = function(logical) {\n return !logical;\n};\n\nexports.OR = function() {\n var args = utils.flatten(arguments);\n var result = false;\n for (var i = 0; i < args.length; i++) {\n if (args[i]) {\n result = true;\n }\n }\n return result;\n};\n\nexports.TRUE = function() {\n return true;\n};\n\nexports.XOR = function() {\n var args = utils.flatten(arguments);\n var result = 0;\n for (var i = 0; i < args.length; i++) {\n if (args[i]) {\n result++;\n }\n }\n return (Math.floor(Math.abs(result)) & 1) ? true : false;\n};\n\nexports.SWITCH = function () {\n var result;\n\n if (arguments.length > 0) {\n var targetValue = arguments[0];\n var argc = arguments.length - 1;\n var switchCount = Math.floor(argc / 2);\n var switchSatisfied = false;\n var hasDefaultClause = argc % 2 !== 0;\n var defaultClause = argc % 2 === 0 ? null : arguments[arguments.length - 1];\n\n if (switchCount) {\n for (var index = 0; index < switchCount; index++) {\n if (targetValue === arguments[index * 2 + 1]) {\n result = arguments[index * 2 + 2];\n switchSatisfied = true;\n break;\n }\n }\n }\n\n if (!switchSatisfied) {\n result = hasDefaultClause ? defaultClause : error.na;\n }\n } else {\n result = error.value;\n }\n\n return result;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/logical.js\n ** module id = 29\n ** module chunks = 0\n **/","var error = require('./error');\nvar dateTime = require('./date-time');\nvar utils = require('./utils');\n\nfunction validDate(d) {\n return d && d.getTime && !isNaN(d.getTime());\n}\n\nfunction ensureDate(d) {\n return (d instanceof Date)?d:new Date(d);\n}\n\nexports.ACCRINT = function(issue, first, settlement, rate, par, frequency, basis) {\n // Return error if either date is invalid\n issue = ensureDate(issue);\n first = ensureDate(first);\n settlement = ensureDate(settlement);\n if (!validDate(issue) || !validDate(first) || !validDate(settlement)) {\n return error.value;\n }\n\n // Return error if either rate or par are lower than or equal to zero\n if (rate <= 0 || par <= 0) {\n return error.num\n }\n\n // Return error if frequency is neither 1, 2, or 4\n if ([1, 2, 4].indexOf(frequency) === -1) {\n return error.num;\n }\n\n // Return error if basis is neither 0, 1, 2, 3, or 4\n if ([0, 1, 2, 3, 4].indexOf(basis) === -1) {\n return error.num;\n }\n\n // Return error if settlement is before or equal to issue\n if (settlement <= issue) {\n return error.num;\n }\n\n // Set default values\n par = par || 0;\n basis = basis || 0;\n\n // Compute accrued interest\n return par * rate * dateTime.YEARFRAC(issue, settlement, basis);\n};\n\n// TODO\nexports.ACCRINTM = function() {\n throw new Error('ACCRINTM is not implemented');\n};\n\n// TODO\nexports.AMORDEGRC = function() {\n throw new Error('AMORDEGRC is not implemented');\n};\n\n// TODO\nexports.AMORLINC = function() {\n throw new Error('AMORLINC is not implemented');\n};\n\n// TODO\nexports.COUPDAYBS = function() {\n throw new Error('COUPDAYBS is not implemented');\n};\n\n// TODO\nexports.COUPDAYS = function() {\n throw new Error('COUPDAYS is not implemented');\n};\n\n// TODO\nexports.COUPDAYSNC = function() {\n throw new Error('COUPDAYSNC is not implemented');\n};\n\n// TODO\nexports.COUPNCD = function() {\n throw new Error('COUPNCD is not implemented');\n};\n\n// TODO\nexports.COUPNUM = function() {\n throw new Error('COUPNUM is not implemented');\n};\n\n// TODO\nexports.COUPPCD = function() {\n throw new Error('COUPPCD is not implemented');\n};\n\nexports.CUMIPMT = function(rate, periods, value, start, end, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n // Credits: Hannes Stiebitzhofer for the translations of function and variable names\n // Requires exports.FV() and exports.PMT() from exports.js [http://stoic.com/exports/]\n\n rate = utils.parseNumber(rate);\n periods = utils.parseNumber(periods);\n value = utils.parseNumber(value);\n if (utils.anyIsError(rate, periods, value)) {\n return error.value;\n }\n\n // Return error if either rate, periods, or value are lower than or equal to zero\n if (rate <= 0 || periods <= 0 || value <= 0) {\n return error.num;\n }\n\n // Return error if start < 1, end < 1, or start > end\n if (start < 1 || end < 1 || start > end) {\n return error.num;\n }\n\n // Return error if type is neither 0 nor 1\n if (type !== 0 && type !== 1) {\n return error.num;\n }\n\n // Compute cumulative interest\n var payment = exports.PMT(rate, periods, value, 0, type);\n var interest = 0;\n\n if (start === 1) {\n if (type === 0) {\n interest = -value;\n start++;\n }\n }\n\n for (var i = start; i <= end; i++) {\n if (type === 1) {\n interest += exports.FV(rate, i - 2, payment, value, 1) - payment;\n } else {\n interest += exports.FV(rate, i - 1, payment, value, 0);\n }\n }\n interest *= rate;\n\n // Return cumulative interest\n return interest;\n};\n\nexports.CUMPRINC = function(rate, periods, value, start, end, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n // Credits: Hannes Stiebitzhofer for the translations of function and variable names\n\n rate = utils.parseNumber(rate);\n periods = utils.parseNumber(periods);\n value = utils.parseNumber(value);\n if (utils.anyIsError(rate, periods, value)) {\n return error.value;\n }\n\n // Return error if either rate, periods, or value are lower than or equal to zero\n if (rate <= 0 || periods <= 0 || value <= 0) {\n return error.num;\n }\n\n // Return error if start < 1, end < 1, or start > end\n if (start < 1 || end < 1 || start > end) {\n return error.num;\n }\n\n // Return error if type is neither 0 nor 1\n if (type !== 0 && type !== 1) {\n return error.num;\n }\n\n // Compute cumulative principal\n var payment = exports.PMT(rate, periods, value, 0, type);\n var principal = 0;\n if (start === 1) {\n if (type === 0) {\n principal = payment + value * rate;\n } else {\n principal = payment;\n }\n start++;\n }\n for (var i = start; i <= end; i++) {\n if (type > 0) {\n principal += payment - (exports.FV(rate, i - 2, payment, value, 1) - payment) * rate;\n } else {\n principal += payment - exports.FV(rate, i - 1, payment, value, 0) * rate;\n }\n }\n\n // Return cumulative principal\n return principal;\n};\n\nexports.DB = function(cost, salvage, life, period, month) {\n // Initialize month\n month = (month === undefined) ? 12 : month;\n\n cost = utils.parseNumber(cost);\n salvage = utils.parseNumber(salvage);\n life = utils.parseNumber(life);\n period = utils.parseNumber(period);\n month = utils.parseNumber(month);\n if (utils.anyIsError(cost, salvage, life, period, month)) {\n return error.value;\n }\n\n // Return error if any of the parameters is negative\n if (cost < 0 || salvage < 0 || life < 0 || period < 0) {\n return error.num;\n }\n\n // Return error if month is not an integer between 1 and 12\n if ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].indexOf(month) === -1) {\n return error.num;\n }\n\n // Return error if period is greater than life\n if (period > life) {\n return error.num;\n }\n\n // Return 0 (zero) if salvage is greater than or equal to cost\n if (salvage >= cost) {\n return 0;\n }\n\n // Rate is rounded to three decimals places\n var rate = (1 - Math.pow(salvage / cost, 1 / life)).toFixed(3);\n\n // Compute initial depreciation\n var initial = cost * rate * month / 12;\n\n // Compute total depreciation\n var total = initial;\n var current = 0;\n var ceiling = (period === life) ? life - 1 : period;\n for (var i = 2; i <= ceiling; i++) {\n current = (cost - total) * rate;\n total += current;\n }\n\n // Depreciation for the first and last periods are special cases\n if (period === 1) {\n // First period\n return initial;\n } else if (period === life) {\n // Last period\n return (cost - total) * rate;\n } else {\n return current;\n }\n};\n\nexports.DDB = function(cost, salvage, life, period, factor) {\n // Initialize factor\n factor = (factor === undefined) ? 2 : factor;\n\n cost = utils.parseNumber(cost);\n salvage = utils.parseNumber(salvage);\n life = utils.parseNumber(life);\n period = utils.parseNumber(period);\n factor = utils.parseNumber(factor);\n if (utils.anyIsError(cost, salvage, life, period, factor)) {\n return error.value;\n }\n\n // Return error if any of the parameters is negative or if factor is null\n if (cost < 0 || salvage < 0 || life < 0 || period < 0 || factor <= 0) {\n return error.num;\n }\n\n // Return error if period is greater than life\n if (period > life) {\n return error.num;\n }\n\n // Return 0 (zero) if salvage is greater than or equal to cost\n if (salvage >= cost) {\n return 0;\n }\n\n // Compute depreciation\n var total = 0;\n var current = 0;\n for (var i = 1; i <= period; i++) {\n current = Math.min((cost - total) * (factor / life), (cost - salvage - total));\n total += current;\n }\n\n // Return depreciation\n return current;\n};\n\n// TODO\nexports.DISC = function() {\n throw new Error('DISC is not implemented');\n};\n\nexports.DOLLARDE = function(dollar, fraction) {\n // Credits: algorithm inspired by Apache OpenOffice\n\n dollar = utils.parseNumber(dollar);\n fraction = utils.parseNumber(fraction);\n if (utils.anyIsError(dollar, fraction)) {\n return error.value;\n }\n\n // Return error if fraction is negative\n if (fraction < 0) {\n return error.num;\n }\n\n // Return error if fraction is greater than or equal to 0 and less than 1\n if (fraction >= 0 && fraction < 1) {\n return error.div0;\n }\n\n // Truncate fraction if it is not an integer\n fraction = parseInt(fraction, 10);\n\n // Compute integer part\n var result = parseInt(dollar, 10);\n\n // Add decimal part\n result += (dollar % 1) * Math.pow(10, Math.ceil(Math.log(fraction) / Math.LN10)) / fraction;\n\n // Round result\n var power = Math.pow(10, Math.ceil(Math.log(fraction) / Math.LN2) + 1);\n result = Math.round(result * power) / power;\n\n // Return converted dollar price\n return result;\n};\n\nexports.DOLLARFR = function(dollar, fraction) {\n // Credits: algorithm inspired by Apache OpenOffice\n\n dollar = utils.parseNumber(dollar);\n fraction = utils.parseNumber(fraction);\n if (utils.anyIsError(dollar, fraction)) {\n return error.value;\n }\n\n // Return error if fraction is negative\n if (fraction < 0) {\n return error.num;\n }\n\n // Return error if fraction is greater than or equal to 0 and less than 1\n if (fraction >= 0 && fraction < 1) {\n return error.div0;\n }\n\n // Truncate fraction if it is not an integer\n fraction = parseInt(fraction, 10);\n\n // Compute integer part\n var result = parseInt(dollar, 10);\n\n // Add decimal part\n result += (dollar % 1) * Math.pow(10, -Math.ceil(Math.log(fraction) / Math.LN10)) * fraction;\n\n // Return converted dollar price\n return result;\n};\n\n// TODO\nexports.DURATION = function() {\n throw new Error('DURATION is not implemented');\n};\n\nexports.EFFECT = function(rate, periods) {\n rate = utils.parseNumber(rate);\n periods = utils.parseNumber(periods);\n if (utils.anyIsError(rate, periods)) {\n return error.value;\n }\n\n // Return error if rate <=0 or periods < 1\n if (rate <= 0 || periods < 1) {\n return error.num;\n }\n\n // Truncate periods if it is not an integer\n periods = parseInt(periods, 10);\n\n // Return effective annual interest rate\n return Math.pow(1 + rate / periods, periods) - 1;\n};\n\nexports.FV = function(rate, periods, payment, value, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n\n value = value || 0;\n type = type || 0;\n\n rate = utils.parseNumber(rate);\n periods = utils.parseNumber(periods);\n payment = utils.parseNumber(payment);\n value = utils.parseNumber(value);\n type = utils.parseNumber(type);\n if (utils.anyIsError(rate, periods, payment, value, type)) {\n return error.value;\n }\n\n // Return future value\n var result;\n if (rate === 0) {\n result = value + payment * periods;\n } else {\n var term = Math.pow(1 + rate, periods);\n if (type === 1) {\n result = value * term + payment * (1 + rate) * (term - 1) / rate;\n } else {\n result = value * term + payment * (term - 1) / rate;\n }\n }\n return -result;\n};\n\nexports.FVSCHEDULE = function(principal, schedule) {\n principal = utils.parseNumber(principal);\n schedule = utils.parseNumberArray(utils.flatten(schedule));\n if (utils.anyIsError(principal, schedule)) {\n return error.value;\n }\n\n var n = schedule.length;\n var future = principal;\n\n // Apply all interests in schedule\n for (var i = 0; i < n; i++) {\n // Apply scheduled interest\n future *= 1 + schedule[i];\n }\n\n // Return future value\n return future;\n};\n\n// TODO\nexports.INTRATE = function() {\n throw new Error('INTRATE is not implemented');\n};\n\nexports.IPMT = function(rate, period, periods, present, future, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n\n future = future || 0;\n type = type || 0;\n\n rate = utils.parseNumber(rate);\n period = utils.parseNumber(period);\n periods = utils.parseNumber(periods);\n present = utils.parseNumber(present);\n future = utils.parseNumber(future);\n type = utils.parseNumber(type);\n if (utils.anyIsError(rate, period, periods, present, future, type)) {\n return error.value;\n }\n\n // Compute payment\n var payment = exports.PMT(rate, periods, present, future, type);\n\n // Compute interest\n var interest;\n if (period === 1) {\n if (type === 1) {\n interest = 0;\n } else {\n interest = -present;\n }\n } else {\n if (type === 1) {\n interest = exports.FV(rate, period - 2, payment, present, 1) - payment;\n } else {\n interest = exports.FV(rate, period - 1, payment, present, 0);\n }\n }\n\n // Return interest\n return interest * rate;\n};\n\nexports.IRR = function(values, guess) {\n // Credits: algorithm inspired by Apache OpenOffice\n\n guess = guess || 0;\n\n values = utils.parseNumberArray(utils.flatten(values));\n guess = utils.parseNumber(guess);\n if (utils.anyIsError(values, guess)) {\n return error.value;\n }\n\n // Calculates the resulting amount\n var irrResult = function(values, dates, rate) {\n var r = rate + 1;\n var result = values[0];\n for (var i = 1; i < values.length; i++) {\n result += values[i] / Math.pow(r, (dates[i] - dates[0]) / 365);\n }\n return result;\n };\n\n // Calculates the first derivation\n var irrResultDeriv = function(values, dates, rate) {\n var r = rate + 1;\n var result = 0;\n for (var i = 1; i < values.length; i++) {\n var frac = (dates[i] - dates[0]) / 365;\n result -= frac * values[i] / Math.pow(r, frac + 1);\n }\n return result;\n };\n\n // Initialize dates and check that values contains at least one positive value and one negative value\n var dates = [];\n var positive = false;\n var negative = false;\n for (var i = 0; i < values.length; i++) {\n dates[i] = (i === 0) ? 0 : dates[i - 1] + 365;\n if (values[i] > 0) {\n positive = true;\n }\n if (values[i] < 0) {\n negative = true;\n }\n }\n\n // Return error if values does not contain at least one positive value and one negative value\n if (!positive || !negative) {\n return error.num;\n }\n\n // Initialize guess and resultRate\n guess = (guess === undefined) ? 0.1 : guess;\n var resultRate = guess;\n\n // Set maximum epsilon for end of iteration\n var epsMax = 1e-10;\n\n // Implement Newton's method\n var newRate, epsRate, resultValue;\n var contLoop = true;\n do {\n resultValue = irrResult(values, dates, resultRate);\n newRate = resultRate - resultValue / irrResultDeriv(values, dates, resultRate);\n epsRate = Math.abs(newRate - resultRate);\n resultRate = newRate;\n contLoop = (epsRate > epsMax) && (Math.abs(resultValue) > epsMax);\n } while (contLoop);\n\n // Return internal rate of return\n return resultRate;\n};\n\nexports.ISPMT = function(rate, period, periods, value) {\n rate = utils.parseNumber(rate);\n period = utils.parseNumber(period);\n periods = utils.parseNumber(periods);\n value = utils.parseNumber(value);\n if (utils.anyIsError(rate, period, periods, value)) {\n return error.value;\n }\n\n // Return interest\n return value * rate * (period / periods - 1);\n};\n\n// TODO\nexports.MDURATION = function() {\n throw new Error('MDURATION is not implemented');\n};\n\nexports.MIRR = function(values, finance_rate, reinvest_rate) {\n values = utils.parseNumberArray(utils.flatten(values));\n finance_rate = utils.parseNumber(finance_rate);\n reinvest_rate = utils.parseNumber(reinvest_rate);\n if (utils.anyIsError(values, finance_rate, reinvest_rate)) {\n return error.value;\n }\n\n // Initialize number of values\n var n = values.length;\n\n // Lookup payments (negative values) and incomes (positive values)\n var payments = [];\n var incomes = [];\n for (var i = 0; i < n; i++) {\n if (values[i] < 0) {\n payments.push(values[i]);\n } else {\n incomes.push(values[i]);\n }\n }\n\n // Return modified internal rate of return\n var num = -exports.NPV(reinvest_rate, incomes) * Math.pow(1 + reinvest_rate, n - 1);\n var den = exports.NPV(finance_rate, payments) * (1 + finance_rate);\n return Math.pow(num / den, 1 / (n - 1)) - 1;\n};\n\nexports.NOMINAL = function(rate, periods) {\n rate = utils.parseNumber(rate);\n periods = utils.parseNumber(periods);\n if (utils.anyIsError(rate, periods)) {\n return error.value;\n }\n\n // Return error if rate <=0 or periods < 1\n if (rate <= 0 || periods < 1) {\n return error.num;\n }\n\n // Truncate periods if it is not an integer\n periods = parseInt(periods, 10);\n\n // Return nominal annual interest rate\n return (Math.pow(rate + 1, 1 / periods) - 1) * periods;\n};\n\nexports.NPER = function(rate, payment, present, future, type) {\n type = (type === undefined) ? 0 : type;\n future = (future === undefined) ? 0 : future;\n\n rate = utils.parseNumber(rate);\n payment = utils.parseNumber(payment);\n present = utils.parseNumber(present);\n future = utils.parseNumber(future);\n type = utils.parseNumber(type);\n if (utils.anyIsError(rate, payment, present, future, type)) {\n return error.value;\n }\n\n // Return number of periods\n var num = payment * (1 + rate * type) - future * rate;\n var den = (present * rate + payment * (1 + rate * type));\n return Math.log(num / den) / Math.log(1 + rate);\n};\n\nexports.NPV = function() {\n var args = utils.parseNumberArray(utils.flatten(arguments));\n if (args instanceof Error) {\n return args;\n }\n\n // Lookup rate\n var rate = args[0];\n\n // Initialize net present value\n var value = 0;\n\n // Loop on all values\n for (var j = 1; j < args.length; j++) {\n value += args[j] / Math.pow(1 + rate, j);\n }\n\n // Return net present value\n return value;\n};\n\n// TODO\nexports.ODDFPRICE = function() {\n throw new Error('ODDFPRICE is not implemented');\n};\n\n// TODO\nexports.ODDFYIELD = function() {\n throw new Error('ODDFYIELD is not implemented');\n};\n\n// TODO\nexports.ODDLPRICE = function() {\n throw new Error('ODDLPRICE is not implemented');\n};\n\n// TODO\nexports.ODDLYIELD = function() {\n throw new Error('ODDLYIELD is not implemented');\n};\n\nexports.PDURATION = function(rate, present, future) {\n rate = utils.parseNumber(rate);\n present = utils.parseNumber(present);\n future = utils.parseNumber(future);\n if (utils.anyIsError(rate, present, future)) {\n return error.value;\n }\n\n // Return error if rate <=0\n if (rate <= 0) {\n return error.num;\n }\n\n // Return number of periods\n return (Math.log(future) - Math.log(present)) / Math.log(1 + rate);\n};\n\nexports.PMT = function(rate, periods, present, future, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n\n future = future || 0;\n type = type || 0;\n\n rate = utils.parseNumber(rate);\n periods = utils.parseNumber(periods);\n present = utils.parseNumber(present);\n future = utils.parseNumber(future);\n type = utils.parseNumber(type);\n if (utils.anyIsError(rate, periods, present, future, type)) {\n return error.value;\n }\n\n // Return payment\n var result;\n if (rate === 0) {\n result = (present + future) / periods;\n } else {\n var term = Math.pow(1 + rate, periods);\n if (type === 1) {\n result = (future * rate / (term - 1) + present * rate / (1 - 1 / term)) / (1 + rate);\n } else {\n result = future * rate / (term - 1) + present * rate / (1 - 1 / term);\n }\n }\n return -result;\n};\n\nexports.PPMT = function(rate, period, periods, present, future, type) {\n future = future || 0;\n type = type || 0;\n\n rate = utils.parseNumber(rate);\n periods = utils.parseNumber(periods);\n present = utils.parseNumber(present);\n future = utils.parseNumber(future);\n type = utils.parseNumber(type);\n if (utils.anyIsError(rate, periods, present, future, type)) {\n return error.value;\n }\n\n return exports.PMT(rate, periods, present, future, type) - exports.IPMT(rate, period, periods, present, future, type);\n};\n\n// TODO\nexports.PRICE = function() {\n throw new Error('PRICE is not implemented');\n};\n\n// TODO\nexports.PRICEDISC = function() {\n throw new Error('PRICEDISC is not implemented');\n};\n\n// TODO\nexports.PRICEMAT = function() {\n throw new Error('PRICEMAT is not implemented');\n};\n\nexports.PV = function(rate, periods, payment, future, type) {\n future = future || 0;\n type = type || 0;\n\n rate = utils.parseNumber(rate);\n periods = utils.parseNumber(periods);\n payment = utils.parseNumber(payment);\n future = utils.parseNumber(future);\n type = utils.parseNumber(type);\n if (utils.anyIsError(rate, periods, payment, future, type)) {\n return error.value;\n }\n\n // Return present value\n if (rate === 0) {\n return -payment * periods - future;\n } else {\n return (((1 - Math.pow(1 + rate, periods)) / rate) * payment * (1 + rate * type) - future) / Math.pow(1 + rate, periods);\n }\n};\n\nexports.RATE = function(periods, payment, present, future, type, guess) {\n // Credits: rabugento\n\n guess = (guess === undefined) ? 0.01 : guess;\n future = (future === undefined) ? 0 : future;\n type = (type === undefined) ? 0 : type;\n\n periods = utils.parseNumber(periods);\n payment = utils.parseNumber(payment);\n present = utils.parseNumber(present);\n future = utils.parseNumber(future);\n type = utils.parseNumber(type);\n guess = utils.parseNumber(guess);\n if (utils.anyIsError(periods, payment, present, future, type, guess)) {\n return error.value;\n }\n\n // Set maximum epsilon for end of iteration\n var epsMax = 1e-10;\n\n // Set maximum number of iterations\n var iterMax = 50;\n\n // Implement Newton's method\n var y, y0, y1, x0, x1 = 0,\n f = 0,\n i = 0;\n var rate = guess;\n if (Math.abs(rate) < epsMax) {\n y = present * (1 + periods * rate) + payment * (1 + rate * type) * periods + future;\n } else {\n f = Math.exp(periods * Math.log(1 + rate));\n y = present * f + payment * (1 / rate + type) * (f - 1) + future;\n }\n y0 = present + payment * periods + future;\n y1 = present * f + payment * (1 / rate + type) * (f - 1) + future;\n i = x0 = 0;\n x1 = rate;\n while ((Math.abs(y0 - y1) > epsMax) && (i < iterMax)) {\n rate = (y1 * x0 - y0 * x1) / (y1 - y0);\n x0 = x1;\n x1 = rate;\n if (Math.abs(rate) < epsMax) {\n y = present * (1 + periods * rate) + payment * (1 + rate * type) * periods + future;\n } else {\n f = Math.exp(periods * Math.log(1 + rate));\n y = present * f + payment * (1 / rate + type) * (f - 1) + future;\n }\n y0 = y1;\n y1 = y;\n ++i;\n }\n return rate;\n};\n\n// TODO\nexports.RECEIVED = function() {\n throw new Error('RECEIVED is not implemented');\n};\n\nexports.RRI = function(periods, present, future) {\n periods = utils.parseNumber(periods);\n present = utils.parseNumber(present);\n future = utils.parseNumber(future);\n if (utils.anyIsError(periods, present, future)) {\n return error.value;\n }\n\n // Return error if periods or present is equal to 0 (zero)\n if (periods === 0 || present === 0) {\n return error.num;\n }\n\n // Return equivalent interest rate\n return Math.pow(future / present, 1 / periods) - 1;\n};\n\nexports.SLN = function(cost, salvage, life) {\n cost = utils.parseNumber(cost);\n salvage = utils.parseNumber(salvage);\n life = utils.parseNumber(life);\n if (utils.anyIsError(cost, salvage, life)) {\n return error.value;\n }\n\n // Return error if life equal to 0 (zero)\n if (life === 0) {\n return error.num;\n }\n\n // Return straight-line depreciation\n return (cost - salvage) / life;\n};\n\nexports.SYD = function(cost, salvage, life, period) {\n // Return error if any of the parameters is not a number\n cost = utils.parseNumber(cost);\n salvage = utils.parseNumber(salvage);\n life = utils.parseNumber(life);\n period = utils.parseNumber(period);\n if (utils.anyIsError(cost, salvage, life, period)) {\n return error.value;\n }\n\n // Return error if life equal to 0 (zero)\n if (life === 0) {\n return error.num;\n }\n\n // Return error if period is lower than 1 or greater than life\n if (period < 1 || period > life) {\n return error.num;\n }\n\n // Truncate period if it is not an integer\n period = parseInt(period, 10);\n\n // Return straight-line depreciation\n return ((cost - salvage) * (life - period + 1) * 2) / (life * (life + 1));\n};\n\nexports.TBILLEQ = function(settlement, maturity, discount) {\n settlement = utils.parseDate(settlement);\n maturity = utils.parseDate(maturity);\n discount = utils.parseNumber(discount);\n if (utils.anyIsError(settlement, maturity, discount)) {\n return error.value;\n }\n\n // Return error if discount is lower than or equal to zero\n if (discount <= 0) {\n return error.num;\n }\n\n // Return error if settlement is greater than maturity\n if (settlement > maturity) {\n return error.num;\n }\n\n // Return error if maturity is more than one year after settlement\n if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n return error.num;\n }\n\n // Return bond-equivalent yield\n return (365 * discount) / (360 - discount * dateTime.DAYS360(settlement, maturity, false));\n};\n\nexports.TBILLPRICE = function(settlement, maturity, discount) {\n settlement = utils.parseDate(settlement);\n maturity = utils.parseDate(maturity);\n discount = utils.parseNumber(discount);\n if (utils.anyIsError(settlement, maturity, discount)) {\n return error.value;\n }\n\n // Return error if discount is lower than or equal to zero\n if (discount <= 0) {\n return error.num;\n }\n\n // Return error if settlement is greater than maturity\n if (settlement > maturity) {\n return error.num;\n }\n\n // Return error if maturity is more than one year after settlement\n if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n return error.num;\n }\n\n // Return bond-equivalent yield\n return 100 * (1 - discount * dateTime.DAYS360(settlement, maturity, false) / 360);\n};\n\nexports.TBILLYIELD = function(settlement, maturity, price) {\n settlement = utils.parseDate(settlement);\n maturity = utils.parseDate(maturity);\n price = utils.parseNumber(price);\n if (utils.anyIsError(settlement, maturity, price)) {\n return error.value;\n }\n\n // Return error if price is lower than or equal to zero\n if (price <= 0) {\n return error.num;\n }\n\n // Return error if settlement is greater than maturity\n if (settlement > maturity) {\n return error.num;\n }\n\n // Return error if maturity is more than one year after settlement\n if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n return error.num;\n }\n\n // Return bond-equivalent yield\n return (100 - price) * 360 / (price * dateTime.DAYS360(settlement, maturity, false));\n};\n\n// TODO\nexports.VDB = function() {\n throw new Error('VDB is not implemented');\n};\n\n// TODO needs better support for date\n// exports.XIRR = function(values, dates, guess) {\n// // Credits: algorithm inspired by Apache OpenOffice\n//\n// values = utils.parseNumberArray(utils.flatten(values));\n// dates = utils.parseDateArray(utils.flatten(dates));\n// guess = utils.parseNumber(guess);\n//\n// if (utils.anyIsError(values, dates, guess)) {\n// return error.value;\n// }\n//\n// // Calculates the resulting amount\n// var irrResult = function(values, dates, rate) {\n// var r = rate + 1;\n// var result = values[0];\n// for (var i = 1; i < values.length; i++) {\n// result += values[i] / Math.pow(r, dateTime.DAYS(dates[i], dates[0]) / 365);\n// }\n// return result;\n// };\n//\n// // Calculates the first derivation\n// var irrResultDeriv = function(values, dates, rate) {\n// var r = rate + 1;\n// var result = 0;\n// for (var i = 1; i < values.length; i++) {\n// var frac = dateTime.DAYS(dates[i], dates[0]) / 365;\n// result -= frac * values[i] / Math.pow(r, frac + 1);\n// }\n// return result;\n// };\n//\n// // Check that values contains at least one positive value and one negative value\n// var positive = false;\n// var negative = false;\n// for (var i = 0; i < values.length; i++) {\n// if (values[i] > 0) {\n// positive = true;\n// }\n// if (values[i] < 0) {\n// negative = true;\n// }\n// }\n//\n// // Return error if values does not contain at least one positive value and one negative value\n// if (!positive || !negative) {\n// return error.num;\n// }\n//\n// // Initialize guess and resultRate\n// guess = guess || 0.1;\n// var resultRate = guess;\n//\n// // Set maximum epsilon for end of iteration\n// var epsMax = 1e-10;\n//\n// // Implement Newton's method\n// var newRate, epsRate, resultValue;\n// var contLoop = true;\n// do {\n// resultValue = irrResult(values, dates, resultRate);\n// newRate = resultRate - resultValue / irrResultDeriv(values, dates, resultRate);\n// epsRate = Math.abs(newRate - resultRate);\n// resultRate = newRate;\n// contLoop = (epsRate > epsMax) && (Math.abs(resultValue) > epsMax);\n// } while (contLoop);\n//\n// // Return internal rate of return\n// return resultRate;\n// };\n\nexports.XNPV = function(rate, values, dates) {\n rate = utils.parseNumber(rate);\n values = utils.parseNumberArray(utils.flatten(values));\n dates = utils.parseDateArray(utils.flatten(dates));\n if (utils.anyIsError(rate, values, dates)) {\n return error.value;\n }\n\n var result = 0;\n for (var i = 0; i < values.length; i++) {\n result += values[i] / Math.pow(1 + rate, dateTime.DAYS(dates[i], dates[0]) / 365);\n }\n return result;\n};\n\n// TODO\nexports.YIELD = function() {\n throw new Error('YIELD is not implemented');\n};\n\n// TODO\nexports.YIELDDISC = function() {\n throw new Error('YIELDDISC is not implemented');\n};\n\n// TODO\nexports.YIELDMAT = function() {\n throw new Error('YIELDMAT is not implemented');\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/financial.js\n ** module id = 30\n ** module chunks = 0\n **/","var error = require('./error');\n\nexports.MATCH = function(lookupValue, lookupArray, matchType) {\n if (!lookupValue && !lookupArray) {\n return error.na;\n }\n\n if (arguments.length === 2) {\n matchType = 1;\n }\n if (!(lookupArray instanceof Array)) {\n return error.na;\n }\n\n if (matchType !== -1 && matchType !== 0 && matchType !== 1) {\n return error.na;\n }\n var index;\n var indexValue;\n for (var idx = 0; idx < lookupArray.length; idx++) {\n if (matchType === 1) {\n if (lookupArray[idx] === lookupValue) {\n return idx + 1;\n } else if (lookupArray[idx] < lookupValue) {\n if (!indexValue) {\n index = idx + 1;\n indexValue = lookupArray[idx];\n } else if (lookupArray[idx] > indexValue) {\n index = idx + 1;\n indexValue = lookupArray[idx];\n }\n }\n } else if (matchType === 0) {\n if (typeof lookupValue === 'string') {\n lookupValue = lookupValue.replace(/\\?/g, '.');\n if (lookupArray[idx].toLowerCase().match(lookupValue.toLowerCase())) {\n return idx + 1;\n }\n } else {\n if (lookupArray[idx] === lookupValue) {\n return idx + 1;\n }\n }\n } else if (matchType === -1) {\n if (lookupArray[idx] === lookupValue) {\n return idx + 1;\n } else if (lookupArray[idx] > lookupValue) {\n if (!indexValue) {\n index = idx + 1;\n indexValue = lookupArray[idx];\n } else if (lookupArray[idx] < indexValue) {\n index = idx + 1;\n indexValue = lookupArray[idx];\n }\n }\n }\n }\n\n return index ? index : error.na;\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/lookup-reference.js\n ** module id = 31\n ** module chunks = 0\n **/","export const SYMBOL = '>';\n\nexport default function func(exp1, exp2) {\n return exp1 > exp2;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/greater-than.js\n **/","export const SYMBOL = '>=';\n\nexport default function func(exp1, exp2) {\n return exp1 >= exp2;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/greater-than-or-equal.js\n **/","export const SYMBOL = '<';\n\nexport default function func(exp1, exp2) {\n return exp1 < exp2;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/less-than.js\n **/","export const SYMBOL = '<=';\n\nexport default function func(exp1, exp2) {\n return exp1 <= exp2;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/less-than-or-equal.js\n **/","import {toNumber} from './../../helper/number';\nimport {ERROR_VALUE} from './../../error';\n\nexport const SYMBOL = '-';\n\nexport default function func(first, ...rest) {\n const result = rest.reduce((acc, value) => acc - toNumber(value), toNumber(first));\n\n if (isNaN(result)) {\n throw Error(ERROR_VALUE);\n }\n\n return result;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/minus.js\n **/","import {toNumber} from './../../helper/number';\nimport {ERROR_VALUE} from './../../error';\n\nexport const SYMBOL = '*';\n\nexport default function func(first, ...rest) {\n const result = rest.reduce((acc, value) => acc * toNumber(value), toNumber(first));\n\n if (isNaN(result)) {\n throw Error(ERROR_VALUE);\n }\n\n return result;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/multiply.js\n **/","export const SYMBOL = '<>';\n\nexport default function func(exp1, exp2) {\n return exp1 !== exp2;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/not-equal.js\n **/","import {toNumber} from './../../helper/number';\nimport {ERROR_VALUE} from './../../error';\n\nexport const SYMBOL = '^';\n\nexport default function func(exp1, exp2) {\n const result = Math.pow(toNumber(exp1), toNumber(exp2));\n\n if (isNaN(result)) {\n throw Error(ERROR_VALUE);\n }\n\n return result;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/power.js\n **/","/* parser generated by jison 0.4.17 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,5],$V1=[1,8],$V2=[1,6],$V3=[1,7],$V4=[1,9],$V5=[1,14],$V6=[1,15],$V7=[1,16],$V8=[1,12],$V9=[1,13],$Va=[1,17],$Vb=[1,19],$Vc=[1,20],$Vd=[1,21],$Ve=[1,22],$Vf=[1,23],$Vg=[1,24],$Vh=[1,25],$Vi=[1,26],$Vj=[1,27],$Vk=[1,28],$Vl=[5,9,10,11,13,14,15,16,17,18,19,20,29,30],$Vm=[5,9,10,11,13,14,15,16,17,18,19,20,29,30,32],$Vn=[1,37],$Vo=[5,9,10,11,13,14,15,16,17,18,19,20,29,30,34],$Vp=[5,10,11,13,14,15,16,17,29,30],$Vq=[5,10,13,14,15,16,29,30],$Vr=[5,10,11,13,14,15,16,17,18,19,29,30],$Vs=[13,29,30],$Vt=[5,9,10,11,13,14,15,16,17,18,19,20,29,30,31,35];\nvar parser = {trace: function trace() { },\nyy: {},\nsymbols_: {\"error\":2,\"expressions\":3,\"expression\":4,\"EOF\":5,\"variableSequence\":6,\"number\":7,\"STRING\":8,\"&\":9,\"=\":10,\"+\":11,\"(\":12,\")\":13,\"<\":14,\">\":15,\"NOT\":16,\"-\":17,\"*\":18,\"/\":19,\"^\":20,\"FUNCTION\":21,\"expseq\":22,\"cell\":23,\"ABSOLUTE_CELL\":24,\":\":25,\"RELATIVE_CELL\":26,\"MIXED_CELL\":27,\"ARRAY\":28,\";\":29,\",\":30,\"VARIABLE\":31,\"DECIMAL\":32,\"NUMBER\":33,\"%\":34,\"#\":35,\"!\":36,\"$accept\":0,\"$end\":1},\nterminals_: {5:\"EOF\",8:\"STRING\",9:\"&\",10:\"=\",11:\"+\",12:\"(\",13:\")\",14:\"<\",15:\">\",16:\"NOT\",17:\"-\",18:\"*\",19:\"/\",20:\"^\",21:\"FUNCTION\",24:\"ABSOLUTE_CELL\",25:\":\",26:\"RELATIVE_CELL\",27:\"MIXED_CELL\",28:\"ARRAY\",29:\";\",30:\",\",31:\"VARIABLE\",32:\"DECIMAL\",33:\"NUMBER\",34:\"%\",35:\"#\",36:\"!\"},\nproductions_: [0,[3,2],[4,1],[4,1],[4,1],[4,3],[4,3],[4,3],[4,3],[4,4],[4,4],[4,4],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,2],[4,2],[4,3],[4,4],[4,1],[4,1],[4,2],[23,1],[23,3],[23,1],[23,3],[23,1],[23,3],[22,1],[22,1],[22,3],[22,3],[6,1],[6,3],[7,1],[7,3],[7,2],[2,3],[2,4]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 1:\n\n return $$[$0-1];\n\nbreak;\ncase 2:\n\n this.$ = yy.callVariable($$[$0][0]);\n\nbreak;\ncase 3:\n\n this.$ = yy.toNumber($$[$0]);\n\nbreak;\ncase 4:\n\n this.$ = yy.trimEdges($$[$0]);\n\nbreak;\ncase 5:\n\n this.$ = yy.evaluateByOperator('&', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 6:\n\n this.$ = yy.evaluateByOperator('=', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 7:\n\n this.$ = yy.evaluateByOperator('+', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 8:\n\n this.$ = yy.toNumber($$[$0-1]);\n\nbreak;\ncase 9:\n\n this.$ = yy.evaluateByOperator('<=', [$$[$0-3], $$[$0]]);\n\nbreak;\ncase 10:\n\n this.$ = yy.evaluateByOperator('>=', [$$[$0-3], $$[$0]]);\n\nbreak;\ncase 11:\n\n this.$ = yy.evaluateByOperator('<>', [$$[$0-3], $$[$0]]);\n\nbreak;\ncase 12:\n\n this.$ = yy.evaluateByOperator('NOT', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 13:\n\n this.$ = yy.evaluateByOperator('>', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 14:\n\n this.$ = yy.evaluateByOperator('<', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 15:\n\n this.$ = yy.evaluateByOperator('-', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 16:\n\n this.$ = yy.evaluateByOperator('*', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 17:\n\n this.$ = yy.evaluateByOperator('/', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 18:\n\n this.$ = yy.evaluateByOperator('^', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 19:\n\n var n1 = yy.invertNumber($$[$0]);\n\n this.$ = n1;\n\n if (isNaN(this.$)) {\n this.$ = 0;\n }\n\nbreak;\ncase 20:\n\n var n1 = yy.toNumber($$[$0]);\n\n this.$ = n1;\n\n if (isNaN(this.$)) {\n this.$ = 0;\n }\n\nbreak;\ncase 21:\n\n this.$ = yy.callFunction($$[$0-2]);\n\nbreak;\ncase 22:\n\n this.$ = yy.callFunction($$[$0-3], $$[$0-1]);\n\nbreak;\ncase 26: case 28: case 30:\n\n this.$ = yy.cellValue($$[$0]);\n\nbreak;\ncase 27: case 29: case 31:\n\n this.$ = yy.rangeValue($$[$0-2], $$[$0]);\n\nbreak;\ncase 32: case 36:\n\n this.$ = [$$[$0]];\n\nbreak;\ncase 33:\n\n var result = [];\n var arr = eval(\"[\" + yytext + \"]\");\n\n arr.forEach(function(item) {\n result.push(item);\n });\n\n this.$ = result;\n\nbreak;\ncase 34: case 35:\n\n $$[$0-2].push($$[$0]);\n this.$ = $$[$0-2];\n\nbreak;\ncase 37:\n\n this.$ = (Array.isArray($$[$0-2]) ? $$[$0-2] : [$$[$0-2]]);\n this.$.push($$[$0]);\n\nbreak;\ncase 38:\n\n this.$ = $$[$0];\n\nbreak;\ncase 39:\n\n this.$ = ($$[$0-2] + '.' + $$[$0]) * 1;\n\nbreak;\ncase 40:\n\n this.$ = $$[$0-1] * 0.01;\n\nbreak;\ncase 41: case 42:\n\n this.$ = yy.throwError($$[$0-2] + $$[$0-1] + $$[$0]);\n\nbreak;\n}\n},\ntable: [{2:11,3:1,4:2,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{1:[3]},{5:[1,18],9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk},o($Vl,[2,2],{32:[1,29]}),o($Vl,[2,3],{34:[1,30]}),o($Vl,[2,4]),{2:11,4:31,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:32,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:33,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{12:[1,34]},o($Vl,[2,23]),o($Vl,[2,24],{2:35,31:[1,36],35:$Va}),o($Vm,[2,36],{35:$Vn}),o($Vo,[2,38],{32:[1,38]}),o($Vl,[2,26],{25:[1,39]}),o($Vl,[2,28],{25:[1,40]}),o($Vl,[2,30],{25:[1,41]}),{31:[1,42]},{1:[2,1]},{2:11,4:43,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:44,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:45,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:48,6:3,7:4,8:$V0,10:[1,46],11:$V1,12:$V2,15:[1,47],17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:50,6:3,7:4,8:$V0,10:[1,49],11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:51,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:52,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:53,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:54,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:55,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{31:[1,56]},o($Vo,[2,40]),{9:$Vb,10:$Vc,11:$Vd,13:[1,57],14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk},o($Vp,[2,19],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),o($Vp,[2,20],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),{2:11,4:60,6:3,7:4,8:$V0,11:$V1,12:$V2,13:[1,58],17:$V3,21:$V4,22:59,23:10,24:$V5,26:$V6,27:$V7,28:[1,61],31:$V8,33:$V9,35:$Va},o($Vl,[2,25]),{35:$Vn},{31:[1,62]},{33:[1,63]},{24:[1,64]},{26:[1,65]},{27:[1,66]},{36:[1,67]},o($Vl,[2,5]),o([5,10,13,29,30],[2,6],{9:$Vb,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vp,[2,7],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),{2:11,4:68,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:69,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},o($Vq,[2,14],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),{2:11,4:70,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},o($Vq,[2,13],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o([5,10,13,16,29,30],[2,12],{9:$Vb,11:$Vd,14:$Ve,15:$Vf,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vp,[2,15],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),o($Vr,[2,16],{9:$Vb,20:$Vk}),o($Vr,[2,17],{9:$Vb,20:$Vk}),o([5,10,11,13,14,15,16,17,18,19,20,29,30],[2,18],{9:$Vb}),o($Vm,[2,37]),o($Vl,[2,8]),o($Vl,[2,21]),{13:[1,71],29:[1,72],30:[1,73]},o($Vs,[2,32],{9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vs,[2,33]),{36:[1,74]},o($Vo,[2,39]),o($Vl,[2,27]),o($Vl,[2,29]),o($Vl,[2,31]),o($Vt,[2,41]),o($Vq,[2,9],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vq,[2,11],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vq,[2,10],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vl,[2,22]),{2:11,4:75,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:76,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},o($Vt,[2,42]),o($Vs,[2,34],{9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vs,[2,35],{9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk})],\ndefaultActions: {18:[2,1]},\nparseError: function parseError(str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n function _parseError (msg, hash) {\n this.message = msg;\n this.hash = hash;\n }\n _parseError.prototype = Error;\n\n throw new _parseError(str, hash);\n }\n},\nparse: function parse(input) {\n var self = this,\n stack = [0],\n tstack = [], // token stack\n vstack = [null], // semantic value stack\n lstack = [], // location stack\n table = this.table,\n yytext = '',\n yylineno = 0,\n yyleng = 0,\n recovering = 0,\n TERROR = 2,\n EOF = 1;\n\n var args = lstack.slice.call(arguments, 1);\n\n //this.reductionCount = this.shiftCount = 0;\n\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n // copy state\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n\n var ranges = lexer.options && lexer.options.ranges;\n\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n\n function popStack (n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n\n_token_stack:\n var lex = function () {\n var token;\n token = lexer.lex() || EOF;\n // if token isn't its numeric value, convert\n if (typeof token !== 'number') {\n token = self.symbols_[token] || token;\n }\n return token;\n }\n\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n // retreive state number from top of stack\n state = stack[stack.length - 1];\n\n // use default actions if available\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n // read action for current state and first input\n action = table[state] && table[state][symbol];\n }\n\n_handle_error:\n // handle parse error\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var error_rule_depth;\n var errStr = '';\n\n // Return the rule stack depth where the nearest error rule can be found.\n // Return FALSE when no error recovery rule was found.\n function locateNearestErrorRecoveryRule(state) {\n var stack_probe = stack.length - 1;\n var depth = 0;\n\n // try to recover from error\n for(;;) {\n // check for error recovery rule in this state\n if ((TERROR.toString()) in table[state]) {\n return depth;\n }\n if (state === 0 || stack_probe < 2) {\n return false; // No suitable error recovery rule available.\n }\n stack_probe -= 2; // popStack(1): [symbol, action]\n state = stack[stack_probe];\n ++depth;\n }\n }\n\n if (!recovering) {\n // first see if there's any chance at hitting an error recovery rule:\n error_rule_depth = locateNearestErrorRecoveryRule(state);\n\n // Report error\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push(\"'\"+this.terminals_[p]+\"'\");\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line '+(yylineno+1)+\":\\n\"+lexer.showPosition()+\"\\nExpecting \"+expected.join(', ') + \", got '\" + (this.terminals_[symbol] || symbol)+ \"'\";\n } else {\n errStr = 'Parse error on line '+(yylineno+1)+\": Unexpected \" +\n (symbol == EOF ? \"end of input\" :\n (\"'\"+(this.terminals_[symbol] || symbol)+\"'\"));\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected,\n recoverable: (error_rule_depth !== false)\n });\n } else if (preErrorSymbol !== EOF) {\n error_rule_depth = locateNearestErrorRecoveryRule(state);\n }\n\n // just recovered from another error\n if (recovering == 3) {\n if (symbol === EOF || preErrorSymbol === EOF) {\n throw new Error(errStr || 'Parsing halted while starting to recover from another error.');\n }\n\n // discard current lookahead and grab another\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n symbol = lex();\n }\n\n // try to recover from error\n if (error_rule_depth === false) {\n throw new Error(errStr || 'Parsing halted. No suitable error recovery rule available.');\n }\n popStack(error_rule_depth);\n\n preErrorSymbol = (symbol == TERROR ? null : symbol); // save the lookahead token\n symbol = TERROR; // insert generic error symbol as new lookahead\n state = stack[stack.length-1];\n action = table[state] && table[state][TERROR];\n recovering = 3; // allow 3 real symbols to be shifted before reporting a new error\n }\n\n // this shouldn't happen, unless resolve defaults are off\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: '+state+', token: '+symbol);\n }\n\n switch (action[0]) {\n case 1: // shift\n //this.shiftCount++;\n\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]); // push state\n symbol = null;\n if (!preErrorSymbol) { // normal execution/no error\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n // error just occurred, resume old lookahead f/ before error\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n\n case 2:\n // reduce\n //this.reductionCount++;\n\n len = this.productions_[action[1]][1];\n\n // perform semantic action\n yyval.$ = vstack[vstack.length-len]; // default to $$ = $1\n // default location, uses first token for firsts, last for lasts\n yyval._$ = {\n first_line: lstack[lstack.length-(len||1)].first_line,\n last_line: lstack[lstack.length-1].last_line,\n first_column: lstack[lstack.length-(len||1)].first_column,\n last_column: lstack[lstack.length-1].last_column\n };\n if (ranges) {\n yyval._$.range = [lstack[lstack.length-(len||1)].range[0], lstack[lstack.length-1].range[1]];\n }\n r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));\n\n if (typeof r !== 'undefined') {\n return r;\n }\n\n // pop off stack\n if (len) {\n stack = stack.slice(0,-1*len*2);\n vstack = vstack.slice(0, -1*len);\n lstack = lstack.slice(0, -1*len);\n }\n\n stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n // goto new state = table[STATE][NONTERMINAL]\n newState = table[stack[stack.length-2]][stack[stack.length-1]];\n stack.push(newState);\n break;\n\n case 3:\n // accept\n return true;\n }\n\n }\n\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function (match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex() {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin(condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState() {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules() {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState(n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState(condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0:/* skip whitespace */\nbreak;\ncase 1:return 8;\nbreak;\ncase 2:return 8;\nbreak;\ncase 3:return 21;\nbreak;\ncase 4:return 24;\nbreak;\ncase 5:return 27;\nbreak;\ncase 6:return 27;\nbreak;\ncase 7:return 26;\nbreak;\ncase 8:return 21;\nbreak;\ncase 9:return 31;\nbreak;\ncase 10:return 31;\nbreak;\ncase 11:return 33;\nbreak;\ncase 12:return 28;\nbreak;\ncase 13:/* skip whitespace */\nbreak;\ncase 14:return 9;\nbreak;\ncase 15:return ' ';\nbreak;\ncase 16:return 32;\nbreak;\ncase 17:return 25;\nbreak;\ncase 18:return 29;\nbreak;\ncase 19:return 30;\nbreak;\ncase 20:return 18;\nbreak;\ncase 21:return 19;\nbreak;\ncase 22:return 17;\nbreak;\ncase 23:return 11;\nbreak;\ncase 24:return 20;\nbreak;\ncase 25:return 12;\nbreak;\ncase 26:return 13;\nbreak;\ncase 27:return 15;\nbreak;\ncase 28:return 14;\nbreak;\ncase 29:return 16;\nbreak;\ncase 30:return '\"';\nbreak;\ncase 31:return \"'\";\nbreak;\ncase 32:return \"!\";\nbreak;\ncase 33:return 10;\nbreak;\ncase 34:return 34;\nbreak;\ncase 35:return 35;\nbreak;\ncase 36:return 5;\nbreak;\n}\n},\nrules: [/^(?:\\s+)/,/^(?:\"(\\\\[\"]|[^\"])*\")/,/^(?:'(\\\\[']|[^'])*')/,/^(?:[A-Za-z]{1,}[A-Za-z_0-9\\.]+(?=[(]))/,/^(?:\\$[A-Za-z]+\\$[0-9]+)/,/^(?:\\$[A-Za-z]+[0-9]+)/,/^(?:[A-Za-z]+\\$[0-9]+)/,/^(?:[A-Za-z]+[0-9]+)/,/^(?:[A-Za-z\\.]+(?=[(]))/,/^(?:[A-Za-z]{1,}[A-Za-z_0-9]+)/,/^(?:[A-Za-z_]+)/,/^(?:[0-9]+)/,/^(?:\\[(.*)?\\])/,/^(?:\\$)/,/^(?:&)/,/^(?: )/,/^(?:[.])/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:\\*)/,/^(?:\\/)/,/^(?:-)/,/^(?:\\+)/,/^(?:\\^)/,/^(?:\\()/,/^(?:\\))/,/^(?:>)/,/^(?:<)/,/^(?:NOT\\b)/,/^(?:\")/,/^(?:')/,/^(?:!)/,/^(?:=)/,/^(?:%)/,/^(?:[#])/,/^(?:$)/],\nconditions: {\"INITIAL\":{\"rules\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\n\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/grammar-parser/grammar-parser.js\n **/","module.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tmodule.children = [];\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n}\r\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** (webpack)/buildin/module.js\n ** module id = 41\n ** module chunks = 0\n **/","/**\n * Trim value by cutting character starting from the beginning and ending at the same time.\n *\n * @param {String} string String to trimming.\n * @param {Number} [margin=1] Number of character to cut.\n * @returns {String}\n */\nexport function trimEdges(string, margin = 1) {\n string = string.substring(margin, string.length - margin);\n\n return string;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/helper/string.js\n **/","const LABEL_EXTRACT_REGEXP = /^([$])?([A-Za-z]+)([$])?([0-9]+)$/;\n\n/**\n * Extract cell coordinates.\n *\n * @param {String} label Cell coordinates (eq. 'A1', '$B6', '$N$98').\n * @returns {Array} Returns an array of objects.\n */\nexport function extractLabel(label) {\n if (!LABEL_EXTRACT_REGEXP.test(label)) {\n return [];\n }\n const [, columnAbs, column, rowAbs, row] = label.match(LABEL_EXTRACT_REGEXP);\n\n return [\n {\n index: rowLabelToIndex(row),\n label: row,\n isAbsolute: rowAbs === '$',\n },\n {\n index: columnLabelToIndex(column),\n label: column,\n isAbsolute: columnAbs === '$'\n }\n ];\n}\n\n/**\n * Convert row and column indexes into cell label.\n *\n * @param {Object} row Object with `index` and `isAbsolute` properties.\n * @param {Object} column Object with `index` and `isAbsolute` properties.\n * @returns {String} Returns cell label.\n */\nexport function toLabel(row, column) {\n const rowLabel = (row.isAbsolute ? '$' : '') + rowIndexToLabel(row.index);\n const columnLabel = (column.isAbsolute ? '$' : '') + columnIndexToLabel(column.index);\n\n return columnLabel + rowLabel;\n}\n\nconst COLUMN_LABEL_BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nconst COLUMN_LABEL_BASE_LENGTH = COLUMN_LABEL_BASE.length;\n\n/**\n * Convert column label to index.\n *\n * @param {String} label Column label (eq. 'ABB', 'CNQ')\n * @returns {Number} Returns -1 if label is not recognized otherwise proper column index.\n */\nexport function columnLabelToIndex(label) {\n let result = 0;\n\n if (label) {\n for (let i = 0, j = label.length - 1; i < label.length; i += 1, j -= 1) {\n result += Math.pow(COLUMN_LABEL_BASE_LENGTH, j) * (COLUMN_LABEL_BASE.indexOf(label[i]) + 1);\n }\n }\n --result;\n\n return result;\n}\n\n/**\n * Convert column index to label.\n *\n * @param {Number} column Column index.\n * @returns {String} Returns column label (eq. 'ABB', 'CNQ').\n */\nexport function columnIndexToLabel(column) {\n let result = '';\n\n while (column >= 0) {\n result = String.fromCharCode(column % COLUMN_LABEL_BASE_LENGTH + 97) + result;\n column = Math.floor(column / COLUMN_LABEL_BASE_LENGTH) - 1;\n }\n\n return result.toUpperCase();\n}\n\n/**\n * Convert row label to index.\n *\n * @param {String} label Row label (eq. '1', '5')\n * @returns {Number} Returns -1 if label is not recognized otherwise proper row index.\n */\nexport function rowLabelToIndex(label) {\n let result = parseInt(label, 10);\n\n if (isNaN(result)) {\n result = -1;\n } else {\n result = Math.max(result - 1, -1);\n }\n\n return result;\n}\n\n/**\n * Convert row index to label.\n *\n * @param {Number} row Row index.\n * @returns {String} Returns row label (eq. '1', '7').\n */\nexport function rowIndexToLabel(row) {\n let result = '';\n\n if (row >= 0) {\n result = `${row + 1}`;\n }\n\n return result;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/helper/cell.js\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap e49db5114318446ec742","webpack:///./index.js","webpack:///./src/parser.js","webpack:///./src/supported-formulas.js","webpack:///./~/tiny-emitter/index.js","webpack:///./src/evaluate-by-operator/evaluate-by-operator.js","webpack:///./src/evaluate-by-operator/operator/add.js","webpack:///./src/helper/number.js","webpack:///./src/error.js","webpack:///./src/evaluate-by-operator/operator/ampersand.js","webpack:///./src/evaluate-by-operator/operator/divide.js","webpack:///./src/evaluate-by-operator/operator/equal.js","webpack:///./src/evaluate-by-operator/operator/formula-function.js","webpack:///./~/formulajs/index.js","webpack:///./~/formulajs/lib/compatibility.js","webpack:///./~/formulajs/lib/math-trig.js","webpack:///./~/formulajs/lib/utils.js","webpack:///./~/formulajs/lib/error.js","webpack:///./~/formulajs/lib/statistical.js","webpack:///./~/formulajs/lib/text.js","webpack:///./~/numbro/numbro.js","webpack:///./~/process/browser.js","webpack:///./~/numbro/languages/index.js","webpack:///./~/jStat/dist/jstat.js","webpack:///./~/formulajs/lib/miscellaneous.js","webpack:///./~/formulajs/lib/information.js","webpack:///./~/formulajs/lib/engineering.js","webpack:///./~/bessel/bessel.js","webpack:///./~/formulajs/lib/date-time.js","webpack:///./~/formulajs/lib/database.js","webpack:///./~/formulajs/lib/logical.js","webpack:///./~/formulajs/lib/financial.js","webpack:///./~/formulajs/lib/lookup-reference.js","webpack:///./src/evaluate-by-operator/operator/greater-than.js","webpack:///./src/evaluate-by-operator/operator/greater-than-or-equal.js","webpack:///./src/evaluate-by-operator/operator/less-than.js","webpack:///./src/evaluate-by-operator/operator/less-than-or-equal.js","webpack:///./src/evaluate-by-operator/operator/minus.js","webpack:///./src/evaluate-by-operator/operator/multiply.js","webpack:///./src/evaluate-by-operator/operator/not-equal.js","webpack:///./src/evaluate-by-operator/operator/power.js","webpack:///./src/grammar-parser/grammar-parser.js","webpack:///(webpack)/buildin/module.js","webpack:///./src/helper/string.js","webpack:///./src/helper/cell.js"],"names":["SUPPORTED_FORMULAS","ERROR","ERROR_DIV_ZERO","ERROR_NAME","ERROR_NEED_UPDATE","ERROR_NOT_AVAILABLE","ERROR_NULL","ERROR_NUM","ERROR_REF","ERROR_VALUE","Parser","error","extractLabel","toLabel","columnIndexToLabel","columnLabelToIndex","rowIndexToLabel","rowLabelToIndex","default","parser","yy","toNumber","trimEdges","invertNumber","throwError","errorName","_throwError","callVariable","variable","_callVariable","evaluateByOperator","callFunction","cellValue","value","_callCellValue","rangeValue","start","end","_callRangeValue","variables","Object","create","setVariable","expression","result","parse","ex","message","Error","name","getVariable","emit","newValue","label","row","column","_value","startLabel","endLabel","startRow","startColumn","endRow","endColumn","startCell","endCell","index","parsedError","registerOperation","availableOperators","SYMBOL","operator","params","toUpperCase","symbol","func","Array","isArray","forEach","s","isFactory","first","rest","reduce","acc","isNaN","number","indexOf","parseFloat","parseInt","errors","type","replace","toString","Infinity","exp1","exp2","formulajs","symbolParts","split","foundFormula","length","nestedFormula","Math","pow","o","k","v","l","$V0","$V1","$V2","$V3","$V4","$V5","$V6","$V7","$V8","$V9","$Va","$Vb","$Vc","$Vd","$Ve","$Vf","$Vg","$Vh","$Vi","$Vj","$Vk","$Vl","$Vm","$Vn","$Vo","$Vp","$Vq","$Vr","$Vs","$Vt","trace","symbols_","terminals_","productions_","performAction","anonymous","yytext","yyleng","yylineno","yystate","$$","_$","$0","$","n1","arr","eval","item","push","table","defaultActions","parseError","str","hash","recoverable","_parseError","msg","prototype","input","self","stack","tstack","vstack","lstack","recovering","TERROR","EOF","args","slice","call","arguments","lexer","sharedState","hasOwnProperty","setInput","yylloc","yyloc","ranges","options","getPrototypeOf","popStack","n","_token_stack","lex","token","preErrorSymbol","state","action","a","r","yyval","p","len","newState","expected","_handle_error","locateNearestErrorRecoveryRule","stack_probe","depth","error_rule_depth","errStr","showPosition","join","text","match","line","loc","first_line","last_line","first_column","last_column","range","apply","concat","_input","_more","_backtrack","done","matched","conditionStack","offset","ch","lines","unput","substr","oldLines","more","reject","backtrack_lexer","less","pastInput","past","upcomingInput","next","pre","c","test_match","indexed_rule","backup","matches","tempMatch","rules","_currentRules","i","flex","begin","condition","popState","pop","conditions","topState","abs","pushState","stateStackSize","yy_","$avoiding_name_collisions","YY_START","YYSTATE","exports","module","main","process","argv","string","margin","substring","LABEL_EXTRACT_REGEXP","test","columnAbs","rowAbs","isAbsolute","rowLabel","columnLabel","COLUMN_LABEL_BASE","COLUMN_LABEL_BASE_LENGTH","j","String","fromCharCode","floor","max"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;;ACtCA;;AACA;;;;AAYA;;;;SAUEA,kB;SACAC,K;SACAC,c;SACAC,U;SACAC,iB;SACAC,mB;SACAC,U;SACAC,S;SACAC,S;SACAC,W;SACAC,M;S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eAAe,KAAnB;AACA,SAAIvD,eAAJ;;AAEA,SAAIqD,YAAYG,MAAZ,KAAuB,CAA3B,EAA8B;AAC5B,WAAIJ,UAAUC,YAAY,CAAZ,CAAV,CAAJ,EAA+B;AAC7BE,wBAAe,IAAf;AACAvD,kBAASoD,UAAUC,YAAY,CAAZ,CAAV,6BAAT;AACD;AACF,MALD,MAKO;AACL,WAAMG,SAASH,YAAYG,MAA3B;AACA,WAAInC,QAAQ,CAAZ;AACA,WAAIoC,gBAAgBL,SAApB;;AAEA,cAAO/B,QAAQmC,MAAf,EAAuB;AACrBC,yBAAgBA,cAAcJ,YAAYhC,KAAZ,CAAd,CAAhB;AACAA;;AAEA,aAAI,CAACoC,aAAL,EAAoB;AAClBA,2BAAgB,IAAhB;AACA;AACD;AACF;AACD,WAAIA,aAAJ,EAAmB;AACjBF,wBAAe,IAAf;AACAvD,kBAASyD,yCAAT;AACD;AACF;;AAED,SAAI,CAACF,YAAL,EAAmB;AACjB,aAAMnD,wBAAN;AACD;;AAED,YAAOJ,MAAP;AACD,IArCD;AAsCD;;AAED8B,MAAKK,SAAL,GAAiB,IAAjB;AACAL,MAAKL,MAAL,GAAcA,MAAd,C;;;;;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACpBA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACtFA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mBAAkB,IAAI,cAAc,IAAI,cAAc,IAAI;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAmC;AACnC;AACA;AACA,kDAAiD,iBAAiB;AAClE;AACA;AACA;AACA,QAAO;AACP;AACA;AACA,yCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,yBAAyB;AAC1C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,MAAK;AACL;;AAEA;;AAEA,MAAK;AACL;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,kBAAkB;AACnC,0DAAyD;AACzD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAiB,sBAAsB;AACvC;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA,2BAA0B;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,yBAAyB;AAC1C;AACA;AACA,kBAAiB,YAAY;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,sBAAqB,4BAA4B;AACjD;AACA,oBAAmB,YAAY;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,YAAY;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AClnCA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAiB,mBAAmB;AACpC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;AChQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,kBAAkB;AACnC,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA,oBAAmB,cAAc;AACjC;AACA;AACA;AACA;AACA;AACA,2BAA0B;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,cAAa,SAAS;AACtB,gBAAe,SAAS;AACxB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA,uCAAsC;AACtC;AACA;AACA,MAAK;AACL,mDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAiB,oBAAoB;AACrC;AACA;AACA,cAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA,oBAAmB,kBAAkB;AACrC;AACA,8DAA6D;AAC7D,QAAO;AACP,0EAAyE;AACzE;AACA;AACA;AACA;AACA,cAAa,oBAAoB;AACjC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,QAAQ;AACzB;AACA,oBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA,gBAAe,qBAAqB;AACpC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,cAAa,kBAAkB;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,mBAAmB;AACpC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,kBAAiB,YAAY;AAC7B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,yCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,cAAa,mBAAmB;AAChC;AACA;AACA,cAAa,mBAAmB;AAChC;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;ACxwDA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP,MAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;iEC9UA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,uBAAsB,uDAAuD;AAC7E,uBAAsB,qDAAqD;AAC3E,uBAAsB;AACtB,UAAS;AACT;AACA;AACA;AACA,sBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,oBAAmB,WAAW;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;;AAEA;AACA;AACA,cAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA4C,oBAAoB;AAChE;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,+CAA8C,IAAI,EAAE,IAAI;;AAExD;AACA,+CAA8C;AAC9C;AACA,UAAS,4CAA4C;AACrD;AACA,UAAS,4CAA4C;AACrD;AACA,UAAS,OAAO;AAChB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gCAA+B,mDAAmD;AAClF;AACA;AACA,sBAAqB;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA2B,yBAAyB;AACpD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAgB;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,8BAA6B;AAC7B,wCAAuC;AACvC;AACA,6DAA4D;AAC5D;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA,8BAA6B;AAC7B,0CAAyC;AACzC;AACA,6DAA4D;AAC5D;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAmB,4BAA4B;AAC/C;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAa;AACb;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kDAAiD,EAAE;AACnD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sDAAqD,EAAE;;AAEvD;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;;AAEA,sBAAqB;AACrB;AACA;AACA;AACA,sBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,4BAA2B,gBAAgB;AAC3C;AACA;AACA;AACA,sBAAqB;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;;AAEA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA,cAAa;AACb;;AAEA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;;AAET;AACA;AACA,UAAS;;AAET;AACA;AACA,UAAS;;AAET;AACA;AACA,UAAS;;AAET;AACA;AACA,UAAS;;AAET;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA,UAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;;AAEA,EAAC;;;;;;;;AC1wCD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,MAAK;AACL;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,4BAA2B;AAC3B;AACA;AACA;AACA,6BAA4B,UAAU;;;;;;;ACnLtC,uB;;;;;;ACAA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB,oBAAoB;AACzC;AACA;;AAEA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA,IAAG;AACH;AACA;;AAEA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,sBAAsB;AACvC;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA,0CAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,QAAO;AACP,MAAK;AACL;AACA;AACA;AACA,kBAAiB,gBAAgB;AACjC;AACA;AACA;;;AAGA;AACA;AACA;AACA,4CAA2C,cAAc;AACzD;;;AAGA;AACA;AACA;AACA;AACA,oBAAmB,YAAY;AAC/B;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,kBAAiB,WAAW;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAiB,UAAU;AAC3B;AACA,gBAAe,UAAU;AACzB;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,gBAAe,YAAY;AAC3B;AACA;AACA;AACA,kBAAiB,YAAY;AAC7B;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,gBAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA,kBAAiB,YAAY;AAC7B;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAiB,UAAU;AAC3B;AACA,gBAAe,UAAU;AACzB;AACA;;AAEA;AACA;;;AAGA,qBAAoB,UAAU;;;AAG9B;AACA;AACA;AACA;AACA;AACA;;;AAGA,oBAAmB,UAAU;;;AAG7B;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA,0BAAyB,wBAAwB;;;AAGjD;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,gBAAe,YAAY;AAC3B,kBAAiB,YAAY;AAC7B;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,SAAS;AAC5B;AACA;AACA,IAAG;AACH,oBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;;;AAGA;AACA,aAAY,KAAK,MAAM,MAAM,SAAS;AACtC,eAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB,SAAS;AAC9B;AACA;AACA,MAAK;AACL,sBAAqB,SAAS;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA,EAAC;;;AAGD;AACA,mBAAkB,KAAK,QAAQ,MAAM,SAAS;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,IAAG;AACH;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,IAAG;AACH;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA,IAAG;AACH,EAAC;;;AAGD;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,IAAG;AACH,EAAC;;;AAGD;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA,sEAAqE;AACrE,IAAG;AACH,EAAC;;;AAGD;AACA;;AAEA,EAAC;AACD;;AAEA;;AAEA;AACA,wBAAuB,cAAc;;AAErC;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA,gBAAe;AACf,iBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA,gDAA+C,cAAc,EAAE;AAC/D;;;AAGA;AACA;AACA,gDAA+C,cAAc,EAAE;AAC/D;;;AAGA;AACA;AACA;AACA;AACA;AACA,kBAAiB,YAAY;AAC7B;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,kBAAiB,YAAY;AAC7B;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,YAAY;AAC7B;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAiB,YAAY;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,+BAA8B,QAAQ;AACtC;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,+BAA8B,QAAQ;AACtC;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAiB,2BAA2B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,YAAY;AAC7B;AACA,kBAAiB,SAAS;AAC1B;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,aAAa;AAC9B;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,MAAK;AACL;AACA,IAAG;AACH;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,SAAS;AAC1B;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA,eAAc,oBAAoB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH,EAAC;;;AAGD;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,eAAc,oBAAoB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH,EAAC;AACD;AACA;;;AAGA;AACA;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;;AAEA,wEAAuE;AACvE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;;AAEA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc,oBAAoB;AAClC;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH,EAAC;;AAED,EAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ,OAAO;AACf;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH,oBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH,WAAU,YAAY;AACtB;AACA;AACA;AACA;;AAEA,SAAQ,YAAY;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,SAAQ,UAAU;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO,QAAQ;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,QAAO,OAAO;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ,OAAO;AACf;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO,QAAQ;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA0C,sBAAsB,EAAE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA0B,2BAA2B,EAAE;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;;AAGA;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA,4CAA2C,+BAA+B,EAAE;AAC5E;AACA,IAAG;AACH,EAAC;;;AAGD;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA,IAAG;AACH,EAAC;;AAED,EAAC;AACD;;AAEA;AACA;AACA,kBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA,sBAAqB,iBAAiB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA,QAAO;AACP,MAAK;AACL;AACA;AACA,sBAAqB,iBAAiB;AACtC;AACA;AACA;AACA,QAAO;AACP,MAAK;AACL,IAAG;AACH,EAAC;AACD;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;;AAGD;AACA;AACA;AACA,qBAAoB,UAAU;;AAE9B;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,EAAC;;;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA,+CAA8C;AAC9C;;AAEA,6BAA4B;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA,+CAA8C;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAC;;;AAGD;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,WAAU,QAAQ;AAClB;AACA;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;;AAEA;AACA;;AAEA;AACA,QAAO;AACP;;AAEA;AACA;;AAEA,MAAK;AACL;;AAEA;;AAEA,MAAK;AACL;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,qBAAoB,OAAO;AAC3B;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,YAAW,iBAAiB;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;;AAEA;AACA;;AAEA;AACA,QAAO;AACP;;AAEA;AACA;;AAEA,MAAK;AACL;;AAEA;;AAEA,MAAK;AACL;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,qBAAoB,OAAO;AAC3B;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,YAAW,iBAAiB;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,WAAU,QAAQ;AAClB;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,QAAO;AACP;AACA,QAAO;AACP;AACA,QAAO,OAAO;AACd;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,QAAO,OAAO;AACd;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;AAED,0BAAyB,wBAAwB;;AAEjD;AACA;AACA;AACA,IAAG;;AAEH;AACA,kBAAiB,UAAU;;AAE3B;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA,EAAC;;AAED,EAAC;AACD;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA,4CAA2C,oBAAoB,EAAE;AACjE,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA,4CAA2C,oBAAoB,EAAE;AACjE,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,4CAA2C,oBAAoB,EAAE;AACjE,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY,oBAAoB;AAChC,sBAAqB,YAAY;AACjC;AACA,wBAAuB,YAAY;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,4CAA2C,oBAAoB,EAAE;AACjE,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,6CAA4C,aAAa;AACzD,IAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,YAAY;AACtB;AACA;AACA,oBAAmB,YAAY;AAC/B;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,4CAA2C,6BAA6B,EAAE;AAC1E,IAAG;;AAEH;AACA;AACA,4CAA2C,wBAAwB,EAAE;AACrE,IAAG;;AAEH;AACA;AACA,4CAA2C,wBAAwB,EAAE;AACrE,IAAG;;AAEH;AACA;AACA,4CAA2C,wBAAwB,EAAE;AACrE,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,gBAAgB;AAC1B;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,oBAAmB,cAAc;AACjC;AACA;AACA,oBAAmB,mBAAmB;AACtC;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAU,UAAU;AACpB;AACA,qBAAoB,iBAAiB;AACrC;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,WAAW;AACrB;AACA;AACA,oBAAmB,UAAU;AAC7B,kBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,UAAU;AAC7B;AACA;AACA,WAAU,WAAW;AACrB;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAkB,OAAO;AACzB;AACA;AACA,sBAAqB,OAAO;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,mBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA,sBAAqB,OAAO;AAC5B;AACA,mBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA,wBAAuB,QAAQ;AAC/B;AACA,sBAAqB,WAAW;AAChC;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,oBAAmB,OAAO;AAC1B;AACA,yBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,QAAQ;AAChC;AACA,wBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA,sBAAqB,QAAQ;AAC7B;AACA,uBAAsB,QAAQ;AAC9B,0BAAyB,SAAS;AAClC;AACA;AACA;AACA;AACA,sBAAqB,OAAO;AAC5B;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6BAA4B,cAAc;AAC1C;AACA;;AAEA;AACA;AACA;AACA,QAAO;AACP;AACA,MAAK;;AAEL;AACA,gCAA+B,aAAa;AAC5C;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6BAA4B,cAAc;AAC1C;AACA;;AAEA;AACA;AACA;AACA,QAAO;AACP;AACA,MAAK;;AAEL;AACA,gCAA+B,aAAa;AAC5C;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,UAAS;AACT;AACA,QAAO;AACP;AACA;AACA;AACA,UAAS;AACT;AACA,QAAO;AACP,MAAK;AACL;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,UAAS;AACT;AACA,QAAO;AACP,MAAK;AACL;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,OAAO;AACjB;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,OAAO;AACjB;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,OAAO;AACjB;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,WAAW;AACrB;AACA,sBAAqB,OAAO;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB,OAAO;AAC5B;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iCAAgC,OAAO,WAAW,UAAU;AAC5D;AACA;AACA,qCAAoC,OAAO,WAAW,QAAQ,YAAY;AAC1E;AACA;AACA,QAAO;AACP,2CAA0C,6BAA6B;AACvE;AACA;AACA;;AAEA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB,SAAS,+BAA+B,SAAS;AACjE;AACA,iBAAgB,SAAS,+BAA+B,SAAS;AACjE;AACA;AACA,oCAAmC,SAAS;AAC5C,oDAAmD,SAAS;AAC5D,iCAAgC,SAAS;AACzC,oCAAmC,SAAS;AAC5C,oDAAmD,SAAS;AAC5D,iCAAgC,SAAS;AACzC,UAAS;AACT,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,+BAA8B,aAAa;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,+BAA8B,KAAK,WAAW;AAC9C,+BAA8B,KAAK,WAAW;AAC9C;AACA;AACA;AACA,kCAAiC,cAAc;AAC/C;AACA;;AAEA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB,OAAO;AAC5B,oBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB,OAAO;AAC5B,oBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,OAAO;AAC1B;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,QAAQ;AAChC;AACA,kBAAiB,WAAW;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,YAAY;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,aAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,WAAW;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,QAAQ;AAClB;AACA;AACA,WAAU,WAAW;AACrB;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,OAAO;AACjB;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,WAAU,OAAO;AACjB;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,WAAW;AACrB;AACA;AACA,oBAAmB,WAAW;AAC9B;AACA;AACA;AACA,oBAAmB,WAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,WAAW;AAC1B;AACA;AACA;AACA,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,OAAO;AAC1B;AACA;AACA,oBAAmB,OAAO;AAC1B;AACA,iBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,oBAAmB,OAAO;AAC1B;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,cAAc;AACjC,kBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,OAAO;AAC1B;AACA,kBAAiB,eAAe;AAChC;AACA;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH,EAAC;;AAED,EAAC;AACD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB,oBAAoB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA,kBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,EAAC;;AAED,EAAC;AACD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sDAAqD,uBAAuB;AAC5E,+DAA8D,cAAc;AAC5E;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAmD,aAAa;AAChE,+BAA8B,cAAc;AAC5C;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAU;AACV,EAAC;;;;;;;AC1jID;AACA;AACA;;AAEA;AACA;AACA,kBAAiB,sBAAsB;AACvC;AACA;;AAEA;AACA,oBAAmB,mBAAmB;AACtC;AACA,wBAAuB,OAAO;AAC9B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;;;;;;;AChEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kBAAiB,KAAK;AACtB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACpIA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAiB,KAAK;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA,oBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA,oBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAiB,IAAI;AACrB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAiB,KAAK;AACtB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAiB,IAAI;AACrB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sBAAqB,KAAK;AAC1B;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,sBAAqB,KAAK;AAC1B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sBAAqB,KAAK;AAC1B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gBAAe,KAAK;AACpB;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,gBAAe,KAAK;AACpB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gBAAe,KAAK;AACpB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;ACzhDA;AACA,2BAA0B,iCAAiC,kBAAkB,IAAI;AACjF;AACA;AACA;AACA;AACA;AACA,iBAAgB,QAAQ;AACxB;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,gBAAe,IAAI;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa,IAAI;AACjB;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/MA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,IAAG;AACH;;AAEA,IAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA,kBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA,oBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,kBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACxiBA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,kBAAiB,wBAAwB;AACzC;AACA;AACA;AACA,cAAa,sBAAsB;AACnC;AACA;AACA;AACA;;AAEA,kBAAiB,qBAAqB;AACtC,oBAAmB,wBAAwB;AAC3C;AACA;AACA,sBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAuB,qBAAqB;AAC5C,+FAA8F;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA,IAAG;AACH;;AAEA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA,IAAG;AACH;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;;;;;;AClYA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAAyB,qBAAqB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;;;;;;;AC9GA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,sBAAqB,UAAU;AAC/B;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,sBAAqB,UAAU;AAC/B;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAiB,cAAc;AAC/B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAiB,aAAa;AAC9B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;AACH;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAiB,mBAAmB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAiB,iBAAiB;AAClC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB,mBAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB,mBAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAiB,mBAAmB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;ACjkCA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAmB,0BAA0B;AAC7C;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,G;;;;;;;;;;;mBCzDwBK,I;AAFjB,KAAML,0BAAS,GAAf;;AAEQ,UAASK,IAAT,CAAcoB,IAAd,EAAoBC,IAApB,EAA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AL,EAAQgC,KAAK,CAArE,EAAwE;AACtE/O,iBAAU0D,KAAKC,GAAL,CAASmL,wBAAT,EAAmCC,CAAnC,KAAyCF,kBAAkBnM,OAAlB,CAA0BjC,MAAMsM,CAAN,CAA1B,IAAsC,CAA/E,CAAV;AACD;AACF;AACD,KAAE/M,MAAF;;AAEA,UAAOA,MAAP;AACD;;AAED;;;;;;AAMO,UAAS9B,kBAAT,CAA4ByC,MAA5B,EAAoC;AACzC,OAAIX,SAAS,EAAb;;AAEA,UAAOW,UAAU,CAAjB,EAAoB;AAClBX,cAASgP,OAAOC,YAAP,CAAoBtO,SAASmO,wBAAT,GAAoC,EAAxD,IAA8D9O,MAAvE;AACAW,cAAS+C,KAAKwL,KAAL,CAAWvO,SAASmO,wBAApB,IAAgD,CAAzD;AACD;;AAED,UAAO9O,OAAO4B,WAAP,EAAP;AACD;;AAED;;;;;;AAMO,UAASvD,eAAT,CAAyBoC,KAAzB,EAAgC;AACrC,OAAIT,SAAS4C,SAASnC,KAAT,EAAgB,EAAhB,CAAb;;AAEA,OAAI+B,MAAMxC,MAAN,CAAJ,EAAmB;AACjBA,cAAS,CAAC,CAAV;AACD,IAFD,MAEO;AACLA,cAAS0D,KAAKyL,GAAL,CAASnP,SAAS,CAAlB,EAAqB,CAAC,CAAtB,CAAT;AACD;;AAED,UAAOA,MAAP;AACD;;AAED;;;;;;AAMO,UAAS5B,eAAT,CAAyBsC,GAAzB,EAA8B;AACnC,OAAIV,SAAS,EAAb;;AAEA,OAAIU,OAAO,CAAX,EAAc;AACZV,oBAAYU,MAAM,CAAlB;AACD;;AAED,UAAOV,MAAP;AACD,E","file":"formula-parser.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"formulaParser\"] = factory();\n\telse\n\t\troot[\"formulaParser\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap e49db5114318446ec742\n **/","import {Parser, SUPPORTED_FORMULAS} from './src/parser';\nimport {\n default as error,\n ERROR,\n ERROR_DIV_ZERO,\n ERROR_NAME,\n ERROR_NEED_UPDATE,\n ERROR_NOT_AVAILABLE,\n ERROR_NULL,\n ERROR_NUM,\n ERROR_REF,\n ERROR_VALUE\n} from './src/error';\nimport {\n extractLabel,\n toLabel,\n columnIndexToLabel,\n columnLabelToIndex,\n rowIndexToLabel,\n rowLabelToIndex\n} from './src/helper/cell';\n\nexport {\n SUPPORTED_FORMULAS,\n ERROR,\n ERROR_DIV_ZERO,\n ERROR_NAME,\n ERROR_NEED_UPDATE,\n ERROR_NOT_AVAILABLE,\n ERROR_NULL,\n ERROR_NUM,\n ERROR_REF,\n ERROR_VALUE,\n Parser,\n error,\n extractLabel,\n toLabel,\n columnIndexToLabel,\n columnLabelToIndex,\n rowIndexToLabel,\n rowLabelToIndex\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","import Emitter from 'tiny-emitter';\nimport evaluateByOperator from './evaluate-by-operator/evaluate-by-operator';\nimport {Parser as GrammarParser} from './grammar-parser/grammar-parser';\nimport {trimEdges} from './helper/string';\nimport {toNumber, invertNumber} from './helper/number';\nimport {default as errorParser, ERROR, ERROR_NAME} from './error';\nimport {extractLabel, toLabel} from './helper/cell';\n\nexport {default as SUPPORTED_FORMULAS} from './supported-formulas';\n\n/**\n * @class Parser\n */\nclass Parser extends Emitter {\n constructor() {\n super();\n this.parser = new GrammarParser();\n this.parser.yy = {\n toNumber,\n trimEdges,\n invertNumber,\n throwError: (errorName) => this._throwError(errorName),\n callVariable: (variable) => this._callVariable(variable),\n evaluateByOperator,\n callFunction: evaluateByOperator,\n cellValue: (value) => this._callCellValue(value),\n rangeValue: (start, end) => this._callRangeValue(start, end),\n };\n this.variables = Object.create(null);\n\n this\n .setVariable('TRUE', true)\n .setVariable('FALSE', false)\n .setVariable('NULL', null);\n }\n\n /**\n * Parse formula expression.\n *\n * @param {String} expression to parse.\n * @return {*} Returns an object with tow properties `error` and `result`.\n */\n parse(expression) {\n let result = null;\n let error = null;\n\n try {\n result = this.parser.parse(expression);\n } catch (ex) {\n const message = errorParser(ex.message);\n\n if (message) {\n error = message;\n } else {\n error = errorParser(ERROR);\n }\n }\n\n if (result instanceof Error) {\n error = errorParser(result.message) || errorParser(ERROR);\n result = null;\n }\n\n return {\n error: error,\n result: result\n };\n }\n\n /**\n * Set predefined variable name which can be visible while parsing formula expression.\n *\n * @param {String} name Variable name.\n * @param {*} value Variable value.\n * @returns {Parser}\n */\n setVariable(name, value) {\n this.variables[name] = value;\n\n return this;\n }\n\n /**\n * Get variable name.\n *\n * @param {String} name Variable name.\n * @returns {*}\n */\n getVariable(name) {\n return this.variables[name];\n }\n\n /**\n * Retrieve variable value by its name.\n *\n * @param name Variable name.\n * @returns {*}\n * @private\n */\n _callVariable(name) {\n let value = this.getVariable(name);\n\n this.emit('callVariable', name, (newValue) => {\n if (newValue !== void 0) {\n value = newValue;\n }\n });\n\n if (value === void 0) {\n throw Error(ERROR_NAME);\n }\n\n return value;\n }\n\n /**\n * Retrieve value by its label (`B3`, `B$3`, `B$3`, `$B$3`).\n *\n * @param {String} label Coordinates.\n * @returns {*}\n * @private\n */\n _callCellValue(label) {\n const [row, column] = extractLabel(label);\n let value = void 0;\n\n this.emit('callCellValue', {label, row, column}, (_value) => {\n value = _value;\n });\n\n return value;\n }\n\n /**\n * Retrieve value by its label (`B3:A1`, `B$3:A1`, `B$3:$A1`, `$B$3:A$1`).\n *\n * @param {String} startLabel Coordinates of the first cell.\n * @param {String} endLabel Coordinates of the last cell.\n * @returns {Array} Returns an array of mixed values.\n * @private\n */\n _callRangeValue(startLabel, endLabel) {\n const [startRow, startColumn] = extractLabel(startLabel);\n const [endRow, endColumn] = extractLabel(endLabel);\n let startCell = {};\n let endCell = {};\n\n if (startRow.index <= endRow.index) {\n startCell.row = startRow;\n endCell.row = endRow;\n } else {\n startCell.row = endRow;\n endCell.row = startRow;\n }\n\n if (startColumn.index <= endColumn.index) {\n startCell.column = startColumn;\n endCell.column = endColumn;\n } else {\n startCell.column = endColumn;\n endCell.column = startColumn;\n }\n\n startCell.label = toLabel(startCell.row, startCell.column);\n endCell.label = toLabel(endCell.row, endCell.column);\n\n let value = [];\n\n this.emit('callRangeValue', startCell, endCell, (_value = []) => {\n value = _value;\n });\n\n return value;\n }\n\n /**\n * Try to throw error by its name.\n *\n * @param {String} errorName Error name.\n * @returns {String}\n * @private\n */\n _throwError(errorName) {\n const parsedError = errorParser(errorName);\n\n if (parsedError) {\n throw Error(parsedError);\n }\n\n return errorName;\n }\n}\n\nexport {Parser};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/parser.js\n **/","const SUPPORTED_FORMULAS = [\n 'ABS',\n 'ACCRINT',\n 'ACOS',\n 'ACOSH',\n 'ACOT',\n 'ACOTH',\n 'ADD',\n 'AGGREGATE',\n 'AND',\n 'ARABIC',\n 'ARGS2ARRAY',\n 'ASIN',\n 'ASINH',\n 'ATAN',\n 'ATAN2',\n 'ATANH',\n 'AVEDEV',\n 'AVERAGE',\n 'AVERAGEA',\n 'AVERAGEIF',\n 'AVERAGEIFS',\n 'BASE',\n 'BESSELI',\n 'BESSELJ',\n 'BESSELK',\n 'BESSELY',\n 'BETA.DIST',\n 'BETA.INV',\n 'BETADIST',\n 'BETAINV',\n 'BIN2DEC',\n 'BIN2HEX',\n 'BIN2OCT',\n 'BINOM.DIST',\n 'BINOM.DIST.RANGE',\n 'BINOM.INV',\n 'BINOMDIST',\n 'BITAND',\n 'BITLSHIFT',\n 'BITOR',\n 'BITRSHIFT',\n 'BITXOR',\n 'CEILING',\n 'CEILINGMATH',\n 'CEILINGPRECISE',\n 'CHAR',\n 'CHISQ.DIST',\n 'CHISQ.DIST.RT',\n 'CHISQ.INV',\n 'CHISQ.INV.RT',\n 'CHOOSE',\n 'CHOOSE',\n 'CLEAN',\n 'CODE',\n 'COLUMN',\n 'COLUMNS',\n 'COMBIN',\n 'COMBINA',\n 'COMPLEX',\n 'CONCATENATE',\n 'CONFIDENCE',\n 'CONFIDENCE.NORM',\n 'CONFIDENCE.T',\n 'CONVERT',\n 'CORREL',\n 'COS',\n 'COSH',\n 'COT',\n 'COTH',\n 'COUNT',\n 'COUNTA',\n 'COUNTBLANK',\n 'COUNTIF',\n 'COUNTIFS',\n 'COUNTIN',\n 'COUNTUNIQUE',\n 'COVARIANCE.P',\n 'COVARIANCE.S',\n 'CSC',\n 'CSCH',\n 'CUMIPMT',\n 'CUMPRINC',\n 'DATE',\n 'DATEVALUE',\n 'DAY',\n 'DAYS',\n 'DAYS360',\n 'DB',\n 'DDB',\n 'DEC2BIN',\n 'DEC2HEX',\n 'DEC2OCT',\n 'DECIMAL',\n 'DEGREES',\n 'DELTA',\n 'DEVSQ',\n 'DIVIDE',\n 'DOLLAR',\n 'DOLLARDE',\n 'DOLLARFR',\n 'E',\n 'EDATE',\n 'EFFECT',\n 'EOMONTH',\n 'EQ',\n 'ERF',\n 'ERFC',\n 'EVEN',\n 'EXACT',\n 'EXPON.DIST',\n 'EXPONDIST',\n 'F.DIST',\n 'F.DIST.RT',\n 'F.INV',\n 'F.INV.RT',\n 'FACT',\n 'FACTDOUBLE',\n 'FALSE',\n 'FDIST',\n 'FDISTRT',\n 'FIND',\n 'FINV',\n 'FINVRT',\n 'FISHER',\n 'FISHERINV',\n 'FIXED',\n 'FLATTEN',\n 'FLOOR',\n 'FORECAST',\n 'FREQUENCY',\n 'FV',\n 'FVSCHEDULE',\n 'GAMMA',\n 'GAMMA.DIST',\n 'GAMMA.INV',\n 'GAMMADIST',\n 'GAMMAINV',\n 'GAMMALN',\n 'GAMMALN.PRECISE',\n 'GAUSS',\n 'GCD',\n 'GEOMEAN',\n 'GESTEP',\n 'GROWTH',\n 'GTE',\n 'HARMEAN',\n 'HEX2BIN',\n 'HEX2DEC',\n 'HEX2OCT',\n 'HOUR',\n 'HTML2TEXT',\n 'HYPGEOM.DIST',\n 'HYPGEOMDIST',\n 'IF',\n 'IMABS',\n 'IMAGINARY',\n 'IMARGUMENT',\n 'IMCONJUGATE',\n 'IMCOS',\n 'IMCOSH',\n 'IMCOT',\n 'IMCSC',\n 'IMCSCH',\n 'IMDIV',\n 'IMEXP',\n 'IMLN',\n 'IMLOG10',\n 'IMLOG2',\n 'IMPOWER',\n 'IMPRODUCT',\n 'IMREAL',\n 'IMSEC',\n 'IMSECH',\n 'IMSIN',\n 'IMSINH',\n 'IMSQRT',\n 'IMSUB',\n 'IMSUM',\n 'IMTAN',\n 'INT',\n 'INTERCEPT',\n 'INTERVAL',\n 'IPMT',\n 'IRR',\n 'ISBINARY',\n 'ISBLANK',\n 'ISEVEN',\n 'ISLOGICAL',\n 'ISNONTEXT',\n 'ISNUMBER',\n 'ISODD',\n 'ISODD',\n 'ISOWEEKNUM',\n 'ISPMT',\n 'ISTEXT',\n 'JOIN',\n 'KURT',\n 'LARGE',\n 'LCM',\n 'LEFT',\n 'LEN',\n 'LINEST',\n 'LN',\n 'LOG',\n 'LOG10',\n 'LOGEST',\n 'LOGNORM.DIST',\n 'LOGNORM.INV',\n 'LOGNORMDIST',\n 'LOGNORMINV',\n 'LOWER',\n 'LT',\n 'LTE',\n 'MATCH',\n 'MAX',\n 'MAXA',\n 'MEDIAN',\n 'MID',\n 'MIN',\n 'MINA',\n 'MINUS',\n 'MINUTE',\n 'MIRR',\n 'MOD',\n 'MODE.MULT',\n 'MODE.SNGL',\n 'MODEMULT',\n 'MODESNGL',\n 'MONTH',\n 'MROUND',\n 'MULTINOMIAL',\n 'MULTIPLY',\n 'NE',\n 'NEGBINOM.DIST',\n 'NEGBINOMDIST',\n 'NETWORKDAYS',\n 'NOMINAL',\n 'NORM.DIST',\n 'NORM.INV',\n 'NORM.S.DIST',\n 'NORM.S.INV',\n 'NORMDIST',\n 'NORMINV',\n 'NORMSDIST',\n 'NORMSINV',\n 'NOT',\n 'NOW',\n 'NPER',\n 'NPV',\n 'NUMBERS',\n 'NUMERAL',\n 'OCT2BIN',\n 'OCT2DEC',\n 'OCT2HEX',\n 'ODD',\n 'OR',\n 'PDURATION',\n 'PEARSON',\n 'PERCENTILEEXC',\n 'PERCENTILEINC',\n 'PERCENTRANKEXC',\n 'PERCENTRANKINC',\n 'PERMUT',\n 'PERMUTATIONA',\n 'PHI',\n 'PI',\n 'PMT',\n 'POISSON.DIST',\n 'POISSONDIST',\n 'POW',\n 'POWER',\n 'PPMT',\n 'PROB',\n 'PRODUCT',\n 'PROPER',\n 'PV',\n 'QUARTILE.EXC',\n 'QUARTILE.INC',\n 'QUARTILEEXC',\n 'QUARTILEINC',\n 'QUOTIENT',\n 'RADIANS',\n 'RAND',\n 'RANDBETWEEN',\n 'RANK.AVG',\n 'RANK.EQ',\n 'RANKAVG',\n 'RANKEQ',\n 'RATE',\n 'REFERENCE',\n 'REGEXEXTRACT',\n 'REGEXMATCH',\n 'REGEXREPLACE',\n 'REPLACE',\n 'REPT',\n 'RIGHT',\n 'ROMAN',\n 'ROUND',\n 'ROUNDDOWN',\n 'ROUNDUP',\n 'ROW',\n 'ROWS',\n 'RRI',\n 'RSQ',\n 'SEARCH',\n 'SEC',\n 'SECH',\n 'SECOND',\n 'SERIESSUM',\n 'SIGN',\n 'SIN',\n 'SINH',\n 'SKEW',\n 'SKEW.P',\n 'SKEWP',\n 'SLN',\n 'SLOPE',\n 'SMALL',\n 'SPLIT',\n 'SPLIT',\n 'SQRT',\n 'SQRTPI',\n 'STANDARDIZE',\n 'STDEV.P',\n 'STDEV.S',\n 'STDEVA',\n 'STDEVP',\n 'STDEVPA',\n 'STDEVS',\n 'STEYX',\n 'SUBSTITUTE',\n 'SUBTOTAL',\n 'SUM',\n 'SUMIF',\n 'SUMIFS',\n 'SUMPRODUCT',\n 'SUMSQ',\n 'SUMX2MY2',\n 'SUMX2PY2',\n 'SUMXMY2',\n 'SWITCH',\n 'SYD',\n 'T',\n 'T.DIST',\n 'T.DIST.2T',\n 'T.DIST.RT',\n 'T.INV',\n 'T.INV.2T',\n 'TAN',\n 'TANH',\n 'TBILLEQ',\n 'TBILLPRICE',\n 'TBILLYIELD',\n 'TDIST',\n 'TDIST2T',\n 'TDISTRT',\n 'TEXT',\n 'TIME',\n 'TIMEVALUE',\n 'TINV',\n 'TINV2T',\n 'TODAY',\n 'TRANSPOSE',\n 'TREND',\n 'TRIM',\n 'TRIMMEAN',\n 'TRUE',\n 'TRUNC',\n 'UNICHAR',\n 'UNICODE',\n 'UNIQUE',\n 'UPPER',\n 'VALUE',\n 'VAR.P',\n 'VAR.S',\n 'VARA',\n 'VARP',\n 'VARPA',\n 'VARS',\n 'WEEKDAY',\n 'WEEKNUM',\n 'WEIBULL.DIST',\n 'WEIBULLDIST',\n 'WORKDAY',\n 'XIRR',\n 'XNPV',\n 'XOR',\n 'YEAR',\n 'YEARFRAC',\n];\n\nexport {SUPPORTED_FORMULAS as default};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/supported-formulas.js\n **/","function E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n };\n\n listener._ = callback\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nmodule.exports = E;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/tiny-emitter/index.js\n ** module id = 3\n ** module chunks = 0\n **/","import {default as add} from './operator/add';\nimport {default as ampersand} from './operator/ampersand';\nimport {default as divide} from './operator/divide';\nimport {default as equal} from './operator/equal';\nimport {default as formulaFunction} from './operator/formula-function';\nimport {default as greaterThan} from './operator/greater-than';\nimport {default as greaterThanOrEqual} from './operator/greater-than-or-equal';\nimport {default as lessThan} from './operator/less-than';\nimport {default as lessThanOrEqual} from './operator/less-than-or-equal';\nimport {default as minus} from './operator/minus';\nimport {default as multiply} from './operator/multiply';\nimport {default as notEqual} from './operator/not-equal';\nimport {default as power} from './operator/power';\nimport {ERROR_NAME} from './../error';\n\nconst availableOperators = Object.create(null);\n\nregisterOperation(add.SYMBOL, add);\nregisterOperation(ampersand.SYMBOL, ampersand);\nregisterOperation(divide.SYMBOL, divide);\nregisterOperation(equal.SYMBOL, equal);\nregisterOperation(power.SYMBOL, power);\nregisterOperation(formulaFunction.SYMBOL, formulaFunction);\nregisterOperation(greaterThan.SYMBOL, greaterThan);\nregisterOperation(greaterThanOrEqual.SYMBOL, greaterThanOrEqual);\nregisterOperation(lessThan.SYMBOL, lessThan);\nregisterOperation(lessThanOrEqual.SYMBOL, lessThanOrEqual);\nregisterOperation(multiply.SYMBOL, multiply);\nregisterOperation(notEqual.SYMBOL, notEqual);\nregisterOperation(minus.SYMBOL, minus);\n\n/**\n * Evaluate values by operator id.git\n *\n * @param {String} operator Operator id.\n * @param {Array} [params=[]] Arguments to evaluate.\n * @returns {*}\n */\nexport default function evaluateByOperator(operator, params = []) {\n operator = operator.toUpperCase();\n\n if (!availableOperators[operator]) {\n throw Error(ERROR_NAME);\n }\n\n return availableOperators[operator](...params);\n}\n\n/**\n * Register operator.\n *\n * @param {String|Array} symbol Symbol to register.\n * @param {Function} func Logic to register for this symbol.\n */\nexport function registerOperation(symbol, func) {\n if (!Array.isArray(symbol)) {\n symbol = [symbol.toUpperCase()];\n }\n symbol.forEach((s) => {\n if (func.isFactory) {\n availableOperators[s] = func(s);\n } else {\n availableOperators[s] = func;\n }\n });\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/evaluate-by-operator.js\n **/","import {toNumber} from './../../helper/number';\nimport {ERROR_VALUE} from './../../error';\n\nexport const SYMBOL = '+';\n\nexport default function func(first, ...rest) {\n const result = rest.reduce((acc, value) => acc + toNumber(value), toNumber(first));\n\n if (isNaN(result)) {\n throw Error(ERROR_VALUE);\n }\n\n return result;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/add.js\n **/","/**\n * Convert value into number.\n *\n * @param {String|Number} number\n * @returns {*}\n */\nexport function toNumber(number) {\n let result;\n\n if (typeof number === 'number') {\n result = number;\n\n } else if (typeof number === 'string') {\n result = number.indexOf('.') > -1 ? parseFloat(number) : parseInt(number, 10);\n }\n\n return result;\n}\n\n/**\n * Invert provided number.\n *\n * @param {Number} number\n * @returns {Number} Returns inverted number.\n */\nexport function invertNumber(number) {\n return -1 * toNumber(number);\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/helper/number.js\n **/","export const ERROR = 'ERROR';\nexport const ERROR_DIV_ZERO = 'DIV/0';\nexport const ERROR_NAME = 'NAME';\nexport const ERROR_NEED_UPDATE = 'NEED_UPDATE';\nexport const ERROR_NOT_AVAILABLE = 'N/A';\nexport const ERROR_NULL = 'NULL';\nexport const ERROR_NUM = 'NUM';\nexport const ERROR_REF = 'REF';\nexport const ERROR_VALUE = 'VALUE';\n\nconst errors = {\n [ERROR]: '#ERROR!',\n [ERROR_DIV_ZERO]: '#DIV/0!',\n [ERROR_NAME]: '#NAME?',\n [ERROR_NEED_UPDATE]: '#NEED_UPDATE!',\n [ERROR_NOT_AVAILABLE]: '#N/A',\n [ERROR_NULL]: '#NULL!',\n [ERROR_NUM]: '#NUM!',\n [ERROR_REF]: '#REF!',\n [ERROR_VALUE]: '#VALUE!',\n};\n\n/**\n * Return error type based on provided error id.\n *\n * @param {String} type Error type.\n * @returns {String|null} Returns error id.\n */\nexport default function error(type) {\n let error;\n\n type = (type + '').replace(/#|!|\\?/g, '');\n\n if (errors[type]) {\n error = errors[type];\n }\n\n return error ? error : null;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/error.js\n **/","export const SYMBOL = '&';\n\nexport default function func(...params) {\n return params.reduce((acc, value) => acc + value.toString(), '');\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/ampersand.js\n **/","import {toNumber} from './../../helper/number';\nimport {ERROR_DIV_ZERO, ERROR_VALUE} from './../../error';\n\nexport const SYMBOL = '/';\n\nexport default function func(first, ...rest) {\n const result = rest.reduce((acc, value) => acc / toNumber(value), toNumber(first));\n\n if (result === Infinity) {\n throw Error(ERROR_DIV_ZERO);\n }\n if (isNaN(result)) {\n throw Error(ERROR_VALUE);\n }\n\n return result;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/divide.js\n **/","export const SYMBOL = '=';\n\nexport default function func(exp1, exp2) {\n return exp1 === exp2;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/equal.js\n **/","import SUPPORTED_FORMULAS from './../../supported-formulas';\nimport {ERROR_NAME} from './../../error';\nimport * as formulajs from 'formulajs';\n\nexport const SYMBOL = SUPPORTED_FORMULAS;\n\nexport default function func(symbol) {\n return function(...params) {\n symbol = symbol.toUpperCase();\n\n const symbolParts = symbol.split('.');\n let foundFormula = false;\n let result;\n\n if (symbolParts.length === 1) {\n if (formulajs[symbolParts[0]]) {\n foundFormula = true;\n result = formulajs[symbolParts[0]](...params);\n }\n } else {\n const length = symbolParts.length;\n let index = 0;\n let nestedFormula = formulajs;\n\n while (index < length) {\n nestedFormula = nestedFormula[symbolParts[index]];\n index++;\n\n if (!nestedFormula) {\n nestedFormula = null;\n break;\n }\n }\n if (nestedFormula) {\n foundFormula = true;\n result = nestedFormula(...params);\n }\n }\n\n if (!foundFormula) {\n throw Error(ERROR_NAME);\n }\n\n return result;\n };\n};\n\nfunc.isFactory = true;\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/formula-function.js\n **/","var categories = [\n require('./lib/compatibility'),\n require('./lib/database'),\n require('./lib/engineering'),\n require('./lib/logical'),\n require('./lib/math-trig'),\n require('./lib/text'),\n require('./lib/date-time'),\n require('./lib/financial'),\n require('./lib/information'),\n require('./lib/lookup-reference'),\n require('./lib/statistical'),\n require('./lib/miscellaneous')\n];\n\nfor (var c in categories) {\n var category = categories[c];\n for (var f in category) {\n exports[f] = exports[f] || category[f];\n }\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/index.js\n ** module id = 12\n ** module chunks = 0\n **/","var mathTrig = require('./math-trig');\nvar statistical = require('./statistical');\nvar engineering = require('./engineering');\nvar dateTime = require('./date-time');\n\nfunction set(fn, root) {\n if (root) {\n for (var i in root) {\n fn[i] = root[i];\n }\n }\n\n return fn;\n}\n\nexports.BETADIST = statistical.BETA.DIST;\nexports.BETAINV = statistical.BETA.INV;\nexports.BINOMDIST = statistical.BINOM.DIST;\nexports.CEILING = exports.ISOCEILING = set(mathTrig.CEILING.MATH, mathTrig.CEILING);\nexports.CEILINGMATH = mathTrig.CEILING.MATH;\nexports.CEILINGPRECISE = mathTrig.CEILING.PRECISE;\nexports.CHIDIST = statistical.CHISQ.DIST;\nexports.CHIDISTRT = statistical.CHISQ.DIST.RT;\nexports.CHIINV = statistical.CHISQ.INV;\nexports.CHIINVRT = statistical.CHISQ.INV.RT;\nexports.CHITEST = statistical.CHISQ.TEST;\nexports.CONFIDENCE = set(statistical.CONFIDENCE.NORM, statistical.CONFIDENCE);\nexports.COVAR = statistical.COVARIANCE.P;\nexports.COVARIANCEP = statistical.COVARIANCE.P;\nexports.COVARIANCES = statistical.COVARIANCE.S;\nexports.CRITBINOM = statistical.BINOM.INV;\nexports.EXPONDIST = statistical.EXPON.DIST;\nexports.ERFCPRECISE = engineering.ERFC.PRECISE;\nexports.ERFPRECISE = engineering.ERF.PRECISE;\nexports.FDIST = statistical.F.DIST;\nexports.FDISTRT = statistical.F.DIST.RT;\nexports.FINVRT = statistical.F.INV.RT;\nexports.FINV = statistical.F.INV;\nexports.FLOOR = set(mathTrig.FLOOR.MATH, mathTrig.FLOOR);\nexports.FLOORMATH = mathTrig.FLOOR.MATH;\nexports.FLOORPRECISE = mathTrig.FLOOR.PRECISE;\nexports.FTEST = statistical.F.TEST;\nexports.GAMMADIST = statistical.GAMMA.DIST;\nexports.GAMMAINV = statistical.GAMMA.INV;\nexports.GAMMALNPRECISE = statistical.GAMMALN.PRECISE;\nexports.HYPGEOMDIST = statistical.HYPGEOM.DIST;\nexports.LOGINV = statistical.LOGNORM.INV;\nexports.LOGNORMINV = statistical.LOGNORM.INV;\nexports.LOGNORMDIST = statistical.LOGNORM.DIST;\nexports.MODE = set(statistical.MODE.SNGL, statistical.MODE);\nexports.MODEMULT = statistical.MODE.MULT;\nexports.MODESNGL = statistical.MODE.SNGL;\nexports.NEGBINOMDIST = statistical.NEGBINOM.DIST;\nexports.NETWORKDAYSINTL = dateTime.NETWORKDAYS.INTL;\nexports.NORMDIST = statistical.NORM.DIST;\nexports.NORMINV = statistical.NORM.INV;\nexports.NORMSDIST = statistical.NORM.S.DIST;\nexports.NORMSINV = statistical.NORM.S.INV;\nexports.PERCENTILE = set(statistical.PERCENTILE.EXC, statistical.PERCENTILE);\nexports.PERCENTILEEXC = statistical.PERCENTILE.EXC;\nexports.PERCENTILEINC = statistical.PERCENTILE.INC;\nexports.PERCENTRANK = set(statistical.PERCENTRANK.INC, statistical.PERCENTRANK);\nexports.PERCENTRANKEXC = statistical.PERCENTRANK.EXC;\nexports.PERCENTRANKINC = statistical.PERCENTRANK.INC;\nexports.POISSON = set(statistical.POISSON.DIST, statistical.POISSON);\nexports.POISSONDIST = statistical.POISSON.DIST;\nexports.QUARTILE = set(statistical.QUARTILE.INC, statistical.QUARTILE);\nexports.QUARTILEEXC = statistical.QUARTILE.EXC;\nexports.QUARTILEINC = statistical.QUARTILE.INC;\nexports.RANK = set(statistical.RANK.EQ, statistical.RANK);\nexports.RANKAVG = statistical.RANK.AVG;\nexports.RANKEQ = statistical.RANK.EQ;\nexports.SKEWP = statistical.SKEW.P;\nexports.STDEV = set(statistical.STDEV.S, statistical.STDEV);\nexports.STDEVP = statistical.STDEV.P;\nexports.STDEVS = statistical.STDEV.S;\nexports.TDIST = statistical.T.DIST;\nexports.TDISTRT = statistical.T.DIST.RT;\nexports.TINV = statistical.T.INV;\nexports.TTEST = statistical.T.TEST;\nexports.VAR = set(statistical.VAR.S, statistical.VAR);\nexports.VARP = statistical.VAR.P;\nexports.VARS = statistical.VAR.S;\nexports.WEIBULL = set(statistical.WEIBULL.DIST, statistical.WEIBULL);\nexports.WEIBULLDIST = statistical.WEIBULL.DIST;\nexports.WORKDAYINTL = dateTime.WORKDAY.INTL;\nexports.ZTEST = statistical.Z.TEST;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/compatibility.js\n ** module id = 13\n ** module chunks = 0\n **/","var utils = require('./utils');\nvar error = require('./error');\nvar statistical = require('./statistical');\nvar information = require('./information');\n\nexports.ABS = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var result = Math.abs(number);\n\n return result;\n};\n\nexports.ACOS = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var result = Math.acos(number);\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.ACOSH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var result = Math.log(number + Math.sqrt(number * number - 1));\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.ACOT = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var result = Math.atan(1 / number);\n\n return result;\n};\n\nexports.ACOTH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var result = 0.5 * Math.log((number + 1) / (number - 1));\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\n//TODO: use options\nexports.AGGREGATE = function(function_num, options, ref1, ref2) {\n function_num = utils.parseNumber(function_num);\n options = utils.parseNumber(function_num);\n if (utils.anyIsError(function_num, options)) {\n return error.value;\n }\n switch (function_num) {\n case 1:\n return statistical.AVERAGE(ref1);\n case 2:\n return statistical.COUNT(ref1);\n case 3:\n return statistical.COUNTA(ref1);\n case 4:\n return statistical.MAX(ref1);\n case 5:\n return statistical.MIN(ref1);\n case 6:\n return exports.PRODUCT(ref1);\n case 7:\n return statistical.STDEV.S(ref1);\n case 8:\n return statistical.STDEV.P(ref1);\n case 9:\n return exports.SUM(ref1);\n case 10:\n return statistical.VAR.S(ref1);\n case 11:\n return statistical.VAR.P(ref1);\n case 12:\n return statistical.MEDIAN(ref1);\n case 13:\n return statistical.MODE.SNGL(ref1);\n case 14:\n return statistical.LARGE(ref1, ref2);\n case 15:\n return statistical.SMALL(ref1, ref2);\n case 16:\n return statistical.PERCENTILE.INC(ref1, ref2);\n case 17:\n return statistical.QUARTILE.INC(ref1, ref2);\n case 18:\n return statistical.PERCENTILE.EXC(ref1, ref2);\n case 19:\n return statistical.QUARTILE.EXC(ref1, ref2);\n }\n};\n\nexports.ARABIC = function(text) {\n // Credits: Rafa? Kukawski\n if (!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(text)) {\n return error.value;\n }\n var r = 0;\n text.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g, function(i) {\n r += {\n M: 1000,\n CM: 900,\n D: 500,\n CD: 400,\n C: 100,\n XC: 90,\n L: 50,\n XL: 40,\n X: 10,\n IX: 9,\n V: 5,\n IV: 4,\n I: 1\n }[i];\n });\n return r;\n};\n\nexports.ASIN = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var result = Math.asin(number);\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.ASINH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return Math.log(number + Math.sqrt(number * number + 1));\n};\n\nexports.ATAN = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return Math.atan(number);\n};\n\nexports.ATAN2 = function(number_x, number_y) {\n number_x = utils.parseNumber(number_x);\n number_y = utils.parseNumber(number_y);\n if (utils.anyIsError(number_x, number_y)) {\n return error.value;\n }\n return Math.atan2(number_x, number_y);\n};\n\nexports.ATANH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var result = Math.log((1 + number) / (1 - number)) / 2;\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.BASE = function(number, radix, min_length) {\n min_length = min_length || 0;\n\n number = utils.parseNumber(number);\n radix = utils.parseNumber(radix);\n min_length = utils.parseNumber(min_length);\n if (utils.anyIsError(number, radix, min_length)) {\n return error.value;\n }\n min_length = (min_length === undefined) ? 0 : min_length;\n var result = number.toString(radix);\n return new Array(Math.max(min_length + 1 - result.length, 0)).join('0') + result;\n};\n\nexports.CEILING = function(number, significance, mode) {\n significance = (significance === undefined) ? 1 : Math.abs(significance);\n mode = mode || 0;\n\n number = utils.parseNumber(number);\n significance = utils.parseNumber(significance);\n mode = utils.parseNumber(mode);\n if (utils.anyIsError(number, significance, mode)) {\n return error.value;\n }\n if (significance === 0) {\n return 0;\n }\n var precision = -Math.floor(Math.log(significance) / Math.log(10));\n if (number >= 0) {\n return exports.ROUND(Math.ceil(number / significance) * significance, precision);\n } else {\n if (mode === 0) {\n return -exports.ROUND(Math.floor(Math.abs(number) / significance) * significance, precision);\n } else {\n return -exports.ROUND(Math.ceil(Math.abs(number) / significance) * significance, precision);\n }\n }\n};\n\nexports.CEILING.MATH = exports.CEILING;\n\nexports.CEILING.PRECISE = exports.CEILING;\n\nexports.COMBIN = function(number, number_chosen) {\n number = utils.parseNumber(number);\n number_chosen = utils.parseNumber(number_chosen);\n if (utils.anyIsError(number, number_chosen)) {\n return error.value;\n }\n return exports.FACT(number) / (exports.FACT(number_chosen) * exports.FACT(number - number_chosen));\n};\n\nexports.COMBINA = function(number, number_chosen) {\n number = utils.parseNumber(number);\n number_chosen = utils.parseNumber(number_chosen);\n if (utils.anyIsError(number, number_chosen)) {\n return error.value;\n }\n return (number === 0 && number_chosen === 0) ? 1 : exports.COMBIN(number + number_chosen - 1, number - 1);\n};\n\nexports.COS = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return Math.cos(number);\n};\n\nexports.COSH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return (Math.exp(number) + Math.exp(-number)) / 2;\n};\n\nexports.COT = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return 1 / Math.tan(number);\n};\n\nexports.COTH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var e2 = Math.exp(2 * number);\n return (e2 + 1) / (e2 - 1);\n};\n\nexports.CSC = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return 1 / Math.sin(number);\n};\n\nexports.CSCH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return 2 / (Math.exp(number) - Math.exp(-number));\n};\n\nexports.DECIMAL = function(number, radix) {\n if (arguments.length < 1) {\n return error.value;\n }\n\n\n return parseInt(number, radix);\n};\n\nexports.DEGREES = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return number * 180 / Math.PI;\n};\n\nexports.EVEN = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return exports.CEILING(number, -2, -1);\n};\n\nexports.EXP = Math.exp;\n\nvar MEMOIZED_FACT = [];\nexports.FACT = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var n = Math.floor(number);\n if (n === 0 || n === 1) {\n return 1;\n } else if (MEMOIZED_FACT[n] > 0) {\n return MEMOIZED_FACT[n];\n } else {\n MEMOIZED_FACT[n] = exports.FACT(n - 1) * n;\n return MEMOIZED_FACT[n];\n }\n};\n\nexports.FACTDOUBLE = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var n = Math.floor(number);\n if (n <= 0) {\n return 1;\n } else {\n return n * exports.FACTDOUBLE(n - 2);\n }\n};\n\nexports.FLOOR = function(number, significance) {\n number = utils.parseNumber(number);\n significance = utils.parseNumber(significance);\n if (utils.anyIsError(number, significance)) {\n return error.value;\n }\n if (significance === 0) {\n return 0;\n }\n\n if (!(number > 0 && significance > 0) && !(number < 0 && significance < 0)) {\n return error.num;\n }\n\n significance = Math.abs(significance);\n var precision = -Math.floor(Math.log(significance) / Math.log(10));\n if (number >= 0) {\n return exports.ROUND(Math.floor(number / significance) * significance, precision);\n } else {\n return -exports.ROUND(Math.ceil(Math.abs(number) / significance), precision);\n }\n};\n\n//TODO: Verify\nexports.FLOOR.MATH = function(number, significance, mode) {\n significance = (significance === undefined) ? 1 : significance;\n mode = (mode === undefined) ? 0 : mode;\n\n number = utils.parseNumber(number);\n significance = utils.parseNumber(significance);\n mode = utils.parseNumber(mode);\n if (utils.anyIsError(number, significance, mode)) {\n return error.value;\n }\n if (significance === 0) {\n return 0;\n }\n\n significance = significance ? Math.abs(significance) : 1;\n var precision = -Math.floor(Math.log(significance) / Math.log(10));\n if (number >= 0) {\n return exports.ROUND(Math.floor(number / significance) * significance, precision);\n } else if (mode === 0 || mode === undefined) {\n return -exports.ROUND(Math.ceil(Math.abs(number) / significance) * significance, precision);\n }\n return -exports.ROUND(Math.floor(Math.abs(number) / significance) * significance, precision);\n};\n\n// Deprecated\nexports.FLOOR.PRECISE = exports.FLOOR.MATH;\n\n// adapted http://rosettacode.org/wiki/Greatest_common_divisor#JavaScript\nexports.GCD = function() {\n var range = utils.parseNumberArray(utils.flatten(arguments));\n if (range instanceof Error) {\n return range;\n }\n var n = range.length;\n var r0 = range[0];\n var x = r0 < 0 ? -r0 : r0;\n for (var i = 1; i < n; i++) {\n var ri = range[i];\n var y = ri < 0 ? -ri : ri;\n while (x && y) {\n if (x > y) {\n x %= y;\n } else {\n y %= x;\n }\n }\n x += y;\n }\n return x;\n};\n\n\nexports.INT = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return Math.floor(number);\n};\n\n//TODO: verify\nexports.ISO = {\n CEILING: exports.CEILING\n};\n\nexports.LCM = function() {\n // Credits: Jonas Raoni Soares Silva\n var o = utils.parseNumberArray(utils.flatten(arguments));\n if (o instanceof Error) {\n return o;\n }\n for (var i, j, n, d, r = 1;\n (n = o.pop()) !== undefined;) {\n while (n > 1) {\n if (n % 2) {\n for (i = 3, j = Math.floor(Math.sqrt(n)); i <= j && n % i; i += 2) {\n //empty\n }\n d = (i <= j) ? i : n;\n } else {\n d = 2;\n }\n for (n /= d, r *= d, i = o.length; i;\n (o[--i] % d) === 0 && (o[i] /= d) === 1 && o.splice(i, 1)) {\n //empty\n }\n }\n }\n return r;\n};\n\nexports.LN = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return Math.log(number);\n};\n\nexports.LN10 = function() {\n return Math.log(10);\n};\n\nexports.LN2 = function() {\n return Math.log(2);\n};\n\nexports.LOG10E = function() {\n return Math.LOG10E;\n};\n\nexports.LOG2E = function() {\n return Math.LOG2E;\n};\n\nexports.LOG = function(number, base) {\n number = utils.parseNumber(number);\n base = utils.parseNumber(base);\n if (utils.anyIsError(number, base)) {\n return error.value;\n }\n base = (base === undefined) ? 10 : base;\n return Math.log(number) / Math.log(base);\n};\n\nexports.LOG10 = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return Math.log(number) / Math.log(10);\n};\n\nexports.MOD = function(dividend, divisor) {\n dividend = utils.parseNumber(dividend);\n divisor = utils.parseNumber(divisor);\n if (utils.anyIsError(dividend, divisor)) {\n return error.value;\n }\n if (divisor === 0) {\n return error.div0;\n }\n var modulus = Math.abs(dividend % divisor);\n return (divisor > 0) ? modulus : -modulus;\n};\n\nexports.MROUND = function(number, multiple) {\n number = utils.parseNumber(number);\n multiple = utils.parseNumber(multiple);\n if (utils.anyIsError(number, multiple)) {\n return error.value;\n }\n if (number * multiple < 0) {\n return error.num;\n }\n\n return Math.round(number / multiple) * multiple;\n};\n\nexports.MULTINOMIAL = function() {\n var args = utils.parseNumberArray(utils.flatten(arguments));\n if (args instanceof Error) {\n return args;\n }\n var sum = 0;\n var divisor = 1;\n for (var i = 0; i < args.length; i++) {\n sum += args[i];\n divisor *= exports.FACT(args[i]);\n }\n return exports.FACT(sum) / divisor;\n};\n\nexports.ODD = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var temp = Math.ceil(Math.abs(number));\n temp = (temp & 1) ? temp : temp + 1;\n return (number > 0) ? temp : -temp;\n};\n\nexports.PI = function() {\n return Math.PI;\n};\n\nexports.E = function() {\n return Math.E;\n};\n\nexports.POWER = function(number, power) {\n number = utils.parseNumber(number);\n power = utils.parseNumber(power);\n if (utils.anyIsError(number, power)) {\n return error.value;\n }\n var result = Math.pow(number, power);\n if (isNaN(result)) {\n return error.num;\n }\n\n return result;\n};\n\nexports.PRODUCT = function() {\n var args = utils.parseNumberArray(utils.flatten(arguments));\n if (args instanceof Error) {\n return args;\n }\n var result = 1;\n for (var i = 0; i < args.length; i++) {\n result *= args[i];\n }\n return result;\n};\n\nexports.QUOTIENT = function(numerator, denominator) {\n numerator = utils.parseNumber(numerator);\n denominator = utils.parseNumber(denominator);\n if (utils.anyIsError(numerator, denominator)) {\n return error.value;\n }\n return parseInt(numerator / denominator, 10);\n};\n\nexports.RADIANS = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return number * Math.PI / 180;\n};\n\nexports.RAND = function() {\n return Math.random();\n};\n\nexports.RANDBETWEEN = function(bottom, top) {\n bottom = utils.parseNumber(bottom);\n top = utils.parseNumber(top);\n if (utils.anyIsError(bottom, top)) {\n return error.value;\n }\n // Creative Commons Attribution 3.0 License\n // Copyright (c) 2012 eqcode\n return bottom + Math.ceil((top - bottom + 1) * Math.random()) - 1;\n};\n\n// TODO\nexports.ROMAN = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n // The MIT License\n // Copyright (c) 2008 Steven Levithan\n var digits = String(number).split('');\n var key = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM', '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC', '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'];\n var roman = '';\n var i = 3;\n while (i--) {\n roman = (key[+digits.pop() + (i * 10)] || '') + roman;\n }\n return new Array(+digits.join('') + 1).join('M') + roman;\n};\n\nexports.ROUND = function(number, digits) {\n number = utils.parseNumber(number);\n digits = utils.parseNumber(digits);\n if (utils.anyIsError(number, digits)) {\n return error.value;\n }\n return Math.round(number * Math.pow(10, digits)) / Math.pow(10, digits);\n};\n\nexports.ROUNDDOWN = function(number, digits) {\n number = utils.parseNumber(number);\n digits = utils.parseNumber(digits);\n if (utils.anyIsError(number, digits)) {\n return error.value;\n }\n var sign = (number > 0) ? 1 : -1;\n return sign * (Math.floor(Math.abs(number) * Math.pow(10, digits))) / Math.pow(10, digits);\n};\n\nexports.ROUNDUP = function(number, digits) {\n number = utils.parseNumber(number);\n digits = utils.parseNumber(digits);\n if (utils.anyIsError(number, digits)) {\n return error.value;\n }\n var sign = (number > 0) ? 1 : -1;\n return sign * (Math.ceil(Math.abs(number) * Math.pow(10, digits))) / Math.pow(10, digits);\n};\n\nexports.SEC = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return 1 / Math.cos(number);\n};\n\nexports.SECH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return 2 / (Math.exp(number) + Math.exp(-number));\n};\n\nexports.SERIESSUM = function(x, n, m, coefficients) {\n x = utils.parseNumber(x);\n n = utils.parseNumber(n);\n m = utils.parseNumber(m);\n coefficients = utils.parseNumberArray(coefficients);\n if (utils.anyIsError(x, n, m, coefficients)) {\n return error.value;\n }\n var result = coefficients[0] * Math.pow(x, n);\n for (var i = 1; i < coefficients.length; i++) {\n result += coefficients[i] * Math.pow(x, n + i * m);\n }\n return result;\n};\n\nexports.SIGN = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n if (number < 0) {\n return -1;\n } else if (number === 0) {\n return 0;\n } else {\n return 1;\n }\n};\n\nexports.SIN = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return Math.sin(number);\n};\n\nexports.SINH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return (Math.exp(number) - Math.exp(-number)) / 2;\n};\n\nexports.SQRT = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n if (number < 0) {\n return error.num;\n }\n return Math.sqrt(number);\n};\n\nexports.SQRTPI = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return Math.sqrt(number * Math.PI);\n};\n\nexports.SQRT1_2 = function() {\n return 1 / Math.sqrt(2);\n};\n\nexports.SQRT2 = function() {\n return Math.sqrt(2);\n};\n\nexports.SUBTOTAL = function(function_code, ref1) {\n function_code = utils.parseNumber(function_code);\n if (function_code instanceof Error) {\n return function_code;\n }\n switch (function_code) {\n case 1:\n return statistical.AVERAGE(ref1);\n case 2:\n return statistical.COUNT(ref1);\n case 3:\n return statistical.COUNTA(ref1);\n case 4:\n return statistical.MAX(ref1);\n case 5:\n return statistical.MIN(ref1);\n case 6:\n return exports.PRODUCT(ref1);\n case 7:\n return statistical.STDEV.S(ref1);\n case 8:\n return statistical.STDEV.P(ref1);\n case 9:\n return exports.SUM(ref1);\n case 10:\n return statistical.VAR.S(ref1);\n case 11:\n return statistical.VAR.P(ref1);\n // no hidden values for us\n case 101:\n return statistical.AVERAGE(ref1);\n case 102:\n return statistical.COUNT(ref1);\n case 103:\n return statistical.COUNTA(ref1);\n case 104:\n return statistical.MAX(ref1);\n case 105:\n return statistical.MIN(ref1);\n case 106:\n return exports.PRODUCT(ref1);\n case 107:\n return statistical.STDEV.S(ref1);\n case 108:\n return statistical.STDEV.P(ref1);\n case 109:\n return exports.SUM(ref1);\n case 110:\n return statistical.VAR.S(ref1);\n case 111:\n return statistical.VAR.P(ref1);\n\n }\n};\n\nexports.ADD = function (num1, num2) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n num1 = utils.parseNumber(num1);\n num2 = utils.parseNumber(num2);\n if (utils.anyIsError(num1, num2)) {\n return error.value;\n }\n\n return num1 + num2;\n};\n\nexports.MINUS = function (num1, num2) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n num1 = utils.parseNumber(num1);\n num2 = utils.parseNumber(num2);\n if (utils.anyIsError(num1, num2)) {\n return error.value;\n }\n\n return num1 - num2;\n};\n\nexports.DIVIDE = function (dividend, divisor) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n dividend = utils.parseNumber(dividend);\n divisor = utils.parseNumber(divisor);\n if (utils.anyIsError(dividend, divisor)) {\n return error.value;\n }\n\n if (divisor === 0) {\n return error.div0;\n }\n\n return dividend / divisor;\n};\n\nexports.MULTIPLY = function (factor1, factor2) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n factor1 = utils.parseNumber(factor1);\n factor2 = utils.parseNumber(factor2);\n if (utils.anyIsError(factor1, factor2)) {\n return error.value;\n }\n\n return factor1 * factor2;\n};\n\nexports.GTE = function (num1, num2) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n num1 = utils.parseNumber(num1);\n num2 = utils.parseNumber(num2);\n if (utils.anyIsError(num1, num2)) {\n return error.error;\n }\n\n return num1 >= num2;\n};\n\nexports.LT = function (num1, num2) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n num1 = utils.parseNumber(num1);\n num2 = utils.parseNumber(num2);\n if (utils.anyIsError(num1, num2)) {\n return error.error;\n }\n\n return num1 < num2;\n};\n\n\nexports.LTE = function (num1, num2) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n num1 = utils.parseNumber(num1);\n num2 = utils.parseNumber(num2);\n if (utils.anyIsError(num1, num2)) {\n return error.error;\n }\n\n return num1 <= num2;\n};\n\nexports.EQ = function (value1, value2) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n return value1 === value2;\n};\n\nexports.NE = function (value1, value2) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n return value1 !== value2;\n};\n\nexports.POW = function (base, exponent) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n base = utils.parseNumber(base);\n exponent = utils.parseNumber(exponent);\n if (utils.anyIsError(base, exponent)) {\n return error.error;\n }\n\n return exports.POWER(base, exponent);\n};\n\nexports.SUM = function() {\n var result = 0;\n\n utils.arrayEach(utils.argsToArray(arguments), function(value) {\n if (typeof value === 'number') {\n result += value;\n\n } else if (typeof value === 'string') {\n var parsed = parseFloat(value);\n\n !isNaN(parsed) && (result += parsed);\n\n } else if (Array.isArray(value)) {\n result += exports.SUM.apply(null, value);\n }\n });\n\n return result;\n};\n\nexports.SUMIF = function(range, criteria) {\n range = utils.parseNumberArray(utils.flatten(range));\n if (range instanceof Error) {\n return range;\n }\n var result = 0;\n for (var i = 0; i < range.length; i++) {\n result += (eval(range[i] + criteria)) ? range[i] : 0; // jshint ignore:line\n }\n return result;\n};\n\nexports.SUMIFS = function() {\n var args = utils.argsToArray(arguments);\n var range = utils.parseNumberArray(utils.flatten(args.shift()));\n if (range instanceof Error) {\n return range;\n }\n var criteria = args;\n\n var n_range_elements = range.length;\n var n_criterias = criteria.length;\n\n var result = 0;\n for (var i = 0; i < n_range_elements; i++) {\n var el = range[i];\n var condition = '';\n for (var c = 0; c < n_criterias; c++) {\n condition += el + criteria[c];\n if (c !== n_criterias - 1) {\n condition += '&&';\n }\n }\n if (eval(condition)) { // jshint ignore:line\n result += el;\n }\n }\n return result;\n};\n\nexports.SUMPRODUCT = function() {\n if (!arguments || arguments.length === 0) {\n return error.value;\n }\n var arrays = arguments.length + 1;\n var result = 0;\n var product;\n var k;\n var _i;\n var _ij;\n for (var i = 0; i < arguments[0].length; i++) {\n if (!(arguments[0][i] instanceof Array)) {\n product = 1;\n for (k = 1; k < arrays; k++) {\n _i = utils.parseNumber(arguments[k - 1][i]);\n if (_i instanceof Error) {\n return _i;\n }\n product *= _i;\n }\n result += product;\n } else {\n for (var j = 0; j < arguments[0][i].length; j++) {\n product = 1;\n for (k = 1; k < arrays; k++) {\n _ij = utils.parseNumber(arguments[k - 1][i][j]);\n if (_ij instanceof Error) {\n return _ij;\n }\n product *= _ij;\n }\n result += product;\n }\n }\n }\n return result;\n};\n\nexports.SUMSQ = function() {\n var numbers = utils.parseNumberArray(utils.flatten(arguments));\n if (numbers instanceof Error) {\n return numbers;\n }\n var result = 0;\n var length = numbers.length;\n for (var i = 0; i < length; i++) {\n result += (information.ISNUMBER(numbers[i])) ? numbers[i] * numbers[i] : 0;\n }\n return result;\n};\n\nexports.SUMX2MY2 = function(array_x, array_y) {\n array_x = utils.parseNumberArray(utils.flatten(array_x));\n array_y = utils.parseNumberArray(utils.flatten(array_y));\n if (utils.anyIsError(array_x, array_y)) {\n return error.value;\n }\n var result = 0;\n for (var i = 0; i < array_x.length; i++) {\n result += array_x[i] * array_x[i] - array_y[i] * array_y[i];\n }\n return result;\n};\n\nexports.SUMX2PY2 = function(array_x, array_y) {\n array_x = utils.parseNumberArray(utils.flatten(array_x));\n array_y = utils.parseNumberArray(utils.flatten(array_y));\n if (utils.anyIsError(array_x, array_y)) {\n return error.value;\n }\n var result = 0;\n array_x = utils.parseNumberArray(utils.flatten(array_x));\n array_y = utils.parseNumberArray(utils.flatten(array_y));\n for (var i = 0; i < array_x.length; i++) {\n result += array_x[i] * array_x[i] + array_y[i] * array_y[i];\n }\n return result;\n};\n\nexports.SUMXMY2 = function(array_x, array_y) {\n array_x = utils.parseNumberArray(utils.flatten(array_x));\n array_y = utils.parseNumberArray(utils.flatten(array_y));\n if (utils.anyIsError(array_x, array_y)) {\n return error.value;\n }\n var result = 0;\n array_x = utils.flatten(array_x);\n array_y = utils.flatten(array_y);\n for (var i = 0; i < array_x.length; i++) {\n result += Math.pow(array_x[i] - array_y[i], 2);\n }\n return result;\n};\n\nexports.TAN = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return Math.tan(number);\n};\n\nexports.TANH = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n var e2 = Math.exp(2 * number);\n return (e2 - 1) / (e2 + 1);\n};\n\nexports.TRUNC = function(number, digits) {\n digits = (digits === undefined) ? 0 : digits;\n number = utils.parseNumber(number);\n digits = utils.parseNumber(digits);\n if (utils.anyIsError(number, digits)) {\n return error.value;\n }\n var sign = (number > 0) ? 1 : -1;\n return sign * (Math.floor(Math.abs(number) * Math.pow(10, digits))) / Math.pow(10, digits);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/math-trig.js\n ** module id = 14\n ** module chunks = 0\n **/","var error = require('./error');\n\nexports.flattenShallow = function(array) {\n if (!array || !array.reduce) {\n return array;\n }\n\n return array.reduce(function(a, b) {\n var aIsArray = Array.isArray(a);\n var bIsArray = Array.isArray(b);\n\n if (aIsArray && bIsArray ) {\n return a.concat(b);\n }\n if (aIsArray) {\n a.push(b);\n\n return a;\n }\n if (bIsArray) {\n return [a].concat(b);\n }\n\n return [a, b];\n });\n};\n\nexports.isFlat = function(array) {\n if (!array) {\n return false;\n }\n\n for (var i = 0; i < array.length; ++i) {\n if (Array.isArray(array[i])) {\n return false;\n }\n }\n\n return true;\n};\n\nexports.flatten = function() {\n var result = exports.argsToArray.apply(null, arguments);\n\n while (!exports.isFlat(result)) {\n result = exports.flattenShallow(result);\n }\n\n return result;\n};\n\nexports.argsToArray = function(args) {\n var result = [];\n\n exports.arrayEach(args, function(value) {\n result.push(value);\n });\n\n return result;\n};\n\nexports.numbers = function() {\n var possibleNumbers = this.flatten.apply(null, arguments);\n return possibleNumbers.filter(function(el) {\n return typeof el === 'number';\n });\n};\n\nexports.cleanFloat = function(number) {\n var power = 1e14;\n return Math.round(number * power) / power;\n};\n\nexports.parseBool = function(bool) {\n if (typeof bool === 'boolean') {\n return bool;\n }\n\n if (bool instanceof Error) {\n return bool;\n }\n\n if (typeof bool === 'number') {\n return bool !== 0;\n }\n\n if (typeof bool === 'string') {\n var up = bool.toUpperCase();\n if (up === 'TRUE') {\n return true;\n }\n\n if (up === 'FALSE') {\n return false;\n }\n }\n\n if (bool instanceof Date && !isNaN(bool)) {\n return true;\n }\n\n return error.value;\n};\n\nexports.parseNumber = function(string) {\n if (string === undefined || string === '') {\n return error.value;\n }\n if (!isNaN(string)) {\n return parseFloat(string);\n }\n\n return error.value;\n};\n\nexports.parseNumberArray = function(arr) {\n var len;\n\n if (!arr || (len = arr.length) === 0) {\n return error.value;\n }\n\n var parsed;\n\n while (len--) {\n parsed = exports.parseNumber(arr[len]);\n if (parsed === error.value) {\n return parsed;\n }\n arr[len] = parsed;\n }\n\n return arr;\n};\n\nexports.parseMatrix = function(matrix) {\n var n;\n\n if (!matrix || (n = matrix.length) === 0) {\n return error.value;\n }\n var pnarr;\n\n for (var i = 0; i < matrix.length; i++) {\n pnarr = exports.parseNumberArray(matrix[i]);\n matrix[i] = pnarr;\n\n if (pnarr instanceof Error) {\n return pnarr;\n }\n }\n\n return matrix;\n};\n\nvar d1900 = new Date(1900, 0, 1);\nexports.parseDate = function(date) {\n if (!isNaN(date)) {\n if (date instanceof Date) {\n return new Date(date);\n }\n var d = parseInt(date, 10);\n if (d < 0) {\n return error.num;\n }\n if (d <= 60) {\n return new Date(d1900.getTime() + (d - 1) * 86400000);\n }\n return new Date(d1900.getTime() + (d - 2) * 86400000);\n }\n if (typeof date === 'string') {\n date = new Date(date);\n if (!isNaN(date)) {\n return date;\n }\n }\n return error.value;\n};\n\nexports.parseDateArray = function(arr) {\n var len = arr.length;\n var parsed;\n while (len--) {\n parsed = this.parseDate(arr[len]);\n if (parsed === error.value) {\n return parsed;\n }\n arr[len] = parsed;\n }\n return arr;\n};\n\nexports.anyIsError = function() {\n var n = arguments.length;\n while (n--) {\n if (arguments[n] instanceof Error) {\n return true;\n }\n }\n return false;\n};\n\nexports.arrayValuesToNumbers = function(arr) {\n var n = arr.length;\n var el;\n while (n--) {\n el = arr[n];\n if (typeof el === 'number') {\n continue;\n }\n if (el === true) {\n arr[n] = 1;\n continue;\n }\n if (el === false) {\n arr[n] = 0;\n continue;\n }\n if (typeof el === 'string') {\n var number = this.parseNumber(el);\n if (number instanceof Error) {\n arr[n] = 0;\n } else {\n arr[n] = number;\n }\n }\n }\n return arr;\n};\n\nexports.rest = function(array, idx) {\n idx = idx || 1;\n if (!array || typeof array.slice !== 'function') {\n return array;\n }\n return array.slice(idx);\n};\n\nexports.initial = function(array, idx) {\n idx = idx || 1;\n if (!array || typeof array.slice !== 'function') {\n return array;\n }\n return array.slice(0, array.length - idx);\n};\n\nexports.arrayEach = function(array, iteratee) {\n var index = -1, length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n\n return array;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/utils.js\n ** module id = 15\n ** module chunks = 0\n **/","exports.nil = new Error('#NULL!');\nexports.div0 = new Error('#DIV/0!');\nexports.value = new Error('#VALUE?');\nexports.ref = new Error('#REF!');\nexports.name = new Error('#NAME?');\nexports.num = new Error('#NUM!');\nexports.na = new Error('#N/A');\nexports.error = new Error('#ERROR!');\nexports.data = new Error('#GETTING_DATA');\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/error.js\n ** module id = 16\n ** module chunks = 0\n **/","var mathTrig = require('./math-trig');\nvar text = require('./text');\nvar jStat = require('jStat').jStat;\nvar utils = require('./utils');\nvar error = require('./error');\nvar misc = require('./miscellaneous');\n\nvar SQRT2PI = 2.5066282746310002;\n\nexports.AVEDEV = function() {\n var range = utils.parseNumberArray(utils.flatten(arguments));\n if (range instanceof Error) {\n return range;\n }\n return jStat.sum(jStat(range).subtract(jStat.mean(range)).abs()[0]) / range.length;\n};\n\nexports.AVERAGE = function() {\n var range = utils.numbers(utils.flatten(arguments));\n var n = range.length;\n var sum = 0;\n var count = 0;\n var result;\n\n for (var i = 0; i < n; i++) {\n sum += range[i];\n count += 1;\n }\n result = sum / count;\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.AVERAGEA = function() {\n var range = utils.flatten(arguments);\n var n = range.length;\n var sum = 0;\n var count = 0;\n var result;\n for (var i = 0; i < n; i++) {\n var el = range[i];\n if (typeof el === 'number') {\n sum += el;\n }\n if (el === true) {\n sum++;\n }\n if (el !== null) {\n count++;\n }\n }\n result = sum / count;\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.AVERAGEIF = function(range, criteria, average_range) {\n if (arguments.length <= 1) {\n return error.na;\n }\n average_range = average_range || range;\n range = utils.flatten(range);\n average_range = utils.parseNumberArray(utils.flatten(average_range));\n if (average_range instanceof Error) {\n return average_range;\n }\n var average_count = 0;\n var result = 0;\n for (var i = 0; i < range.length; i++) {\n if (eval(range[i] + criteria)) { // jshint ignore:line\n result += average_range[i];\n average_count++;\n }\n }\n return result / average_count;\n};\n\nexports.AVERAGEIFS = function() {\n // Does not work with multi dimensional ranges yet!\n //http://office.microsoft.com/en-001/excel-help/averageifs-function-HA010047493.aspx\n var args = utils.argsToArray(arguments);\n var criteria = (args.length - 1) / 2;\n var range = utils.flatten(args[0]);\n var count = 0;\n var result = 0;\n for (var i = 0; i < range.length; i++) {\n var condition = '';\n for (var j = 0; j < criteria; j++) {\n condition += args[2 * j + 1][i] + args[2 * j + 2];\n if (j !== criteria - 1) {\n condition += '&&';\n }\n }\n if (eval(condition)) { // jshint ignore:line\n result += range[i];\n count++;\n }\n }\n\n var average = result / count;\n if (isNaN(average)) {\n return 0;\n } else {\n return average;\n }\n};\n\nexports.BETA = {};\n\nexports.BETA.DIST = function(x, alpha, beta, cumulative, A, B) {\n if (arguments.length < 4) {\n return error.value;\n }\n\n A = (A === undefined) ? 0 : A;\n B = (B === undefined) ? 1 : B;\n\n x = utils.parseNumber(x);\n alpha = utils.parseNumber(alpha);\n beta = utils.parseNumber(beta);\n A = utils.parseNumber(A);\n B = utils.parseNumber(B);\n if (utils.anyIsError(x, alpha, beta, A, B)) {\n return error.value;\n }\n\n x = (x - A) / (B - A);\n return (cumulative) ? jStat.beta.cdf(x, alpha, beta) : jStat.beta.pdf(x, alpha, beta);\n};\n\nexports.BETA.INV = function(probability, alpha, beta, A, B) {\n A = (A === undefined) ? 0 : A;\n B = (B === undefined) ? 1 : B;\n\n probability = utils.parseNumber(probability);\n alpha = utils.parseNumber(alpha);\n beta = utils.parseNumber(beta);\n A = utils.parseNumber(A);\n B = utils.parseNumber(B);\n if (utils.anyIsError(probability, alpha, beta, A, B)) {\n return error.value;\n }\n\n return jStat.beta.inv(probability, alpha, beta) * (B - A) + A;\n};\n\nexports.BINOM = {};\n\nexports.BINOM.DIST = function(successes, trials, probability, cumulative) {\n successes = utils.parseNumber(successes);\n trials = utils.parseNumber(trials);\n probability = utils.parseNumber(probability);\n cumulative = utils.parseNumber(cumulative);\n if (utils.anyIsError(successes, trials, probability, cumulative)) {\n return error.value;\n }\n return (cumulative) ? jStat.binomial.cdf(successes, trials, probability) : jStat.binomial.pdf(successes, trials, probability);\n};\n\nexports.BINOM.DIST.RANGE = function(trials, probability, successes, successes2) {\n successes2 = (successes2 === undefined) ? successes : successes2;\n\n trials = utils.parseNumber(trials);\n probability = utils.parseNumber(probability);\n successes = utils.parseNumber(successes);\n successes2 = utils.parseNumber(successes2);\n if (utils.anyIsError(trials, probability, successes, successes2)) {\n return error.value;\n }\n\n var result = 0;\n for (var i = successes; i <= successes2; i++) {\n result += mathTrig.COMBIN(trials, i) * Math.pow(probability, i) * Math.pow(1 - probability, trials - i);\n }\n return result;\n};\n\nexports.BINOM.INV = function(trials, probability, alpha) {\n trials = utils.parseNumber(trials);\n probability = utils.parseNumber(probability);\n alpha = utils.parseNumber(alpha);\n if (utils.anyIsError(trials, probability, alpha)) {\n return error.value;\n }\n\n var x = 0;\n while (x <= trials) {\n if (jStat.binomial.cdf(x, trials, probability) >= alpha) {\n return x;\n }\n x++;\n }\n};\n\nexports.CHISQ = {};\n\nexports.CHISQ.DIST = function(x, k, cumulative) {\n x = utils.parseNumber(x);\n k = utils.parseNumber(k);\n if (utils.anyIsError(x, k)) {\n return error.value;\n }\n\n return (cumulative) ? jStat.chisquare.cdf(x, k) : jStat.chisquare.pdf(x, k);\n};\n\nexports.CHISQ.DIST.RT = function(x, k) {\n if (!x | !k) {\n return error.na;\n }\n\n if (x < 1 || k > Math.pow(10, 10)) {\n return error.num;\n }\n\n if ((typeof x !== 'number') || (typeof k !== 'number')) {\n return error.value;\n }\n\n return 1 - jStat.chisquare.cdf(x, k);\n};\n\nexports.CHISQ.INV = function(probability, k) {\n probability = utils.parseNumber(probability);\n k = utils.parseNumber(k);\n if (utils.anyIsError(probability, k)) {\n return error.value;\n }\n return jStat.chisquare.inv(probability, k);\n};\n\nexports.CHISQ.INV.RT = function(p, k) {\n if (!p | !k) {\n return error.na;\n }\n\n if (p < 0 || p > 1 || k < 1 || k > Math.pow(10, 10)) {\n return error.num;\n }\n\n if ((typeof p !== 'number') || (typeof k !== 'number')) {\n return error.value;\n }\n\n return jStat.chisquare.inv(1.0 - p, k);\n};\n\nexports.CHISQ.TEST = function(observed, expected) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n if ((!(observed instanceof Array)) || (!(expected instanceof Array))) {\n return error.value;\n }\n\n if (observed.length !== expected.length) {\n return error.value;\n }\n\n if (observed[0] && expected[0] &&\n observed[0].length !== expected[0].length) {\n return error.value;\n }\n\n var row = observed.length;\n var tmp, i, j;\n\n // Convert single-dimension array into two-dimension array\n for (i = 0; i < row; i ++) {\n if (!(observed[i] instanceof Array)) {\n tmp = observed[i];\n observed[i] = [];\n observed[i].push(tmp);\n }\n if (!(expected[i] instanceof Array)) {\n tmp = expected[i];\n expected[i] = [];\n expected[i].push(tmp);\n }\n }\n\n var col = observed[0].length;\n var dof = (col === 1) ? row-1 : (row-1)*(col-1);\n var xsqr = 0;\n var Pi =Math.PI;\n\n for (i = 0; i < row; i ++) {\n for (j = 0; j < col; j ++) {\n xsqr += Math.pow((observed[i][j] - expected[i][j]), 2) / expected[i][j];\n }\n }\n\n // Get independency by X square and its degree of freedom\n function ChiSq(xsqr, dof) {\n var p = Math.exp(-0.5 * xsqr);\n if((dof%2) === 1) {\n p = p * Math.sqrt(2 * xsqr/Pi);\n }\n var k = dof;\n while(k >= 2) {\n p = p * xsqr/k;\n k = k - 2;\n }\n var t = p;\n var a = dof;\n while (t > 0.0000000001*p) {\n a = a + 2;\n t = t * xsqr/a;\n p = p + t;\n }\n return 1-p;\n }\n\n return Math.round(ChiSq(xsqr, dof) * 1000000) / 1000000;\n};\n\nexports.COLUMN = function(matrix, index) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n if (index < 0) {\n return error.num;\n }\n\n if (!(matrix instanceof Array) || (typeof index !== 'number')) {\n return error.value;\n }\n\n if (matrix.length === 0) {\n return undefined;\n }\n\n return jStat.col(matrix, index);\n};\n\nexports.COLUMNS = function(matrix) {\n if (arguments.length !== 1) {\n return error.na;\n }\n\n if (!(matrix instanceof Array)) {\n return error.value;\n }\n\n if (matrix.length === 0) {\n return 0;\n }\n\n return jStat.cols(matrix);\n};\n\nexports.CONFIDENCE = {};\n\nexports.CONFIDENCE.NORM = function(alpha, sd, n) {\n alpha = utils.parseNumber(alpha);\n sd = utils.parseNumber(sd);\n n = utils.parseNumber(n);\n if (utils.anyIsError(alpha, sd, n)) {\n return error.value;\n }\n return jStat.normalci(1, alpha, sd, n)[1] - 1;\n};\n\nexports.CONFIDENCE.T = function(alpha, sd, n) {\n alpha = utils.parseNumber(alpha);\n sd = utils.parseNumber(sd);\n n = utils.parseNumber(n);\n if (utils.anyIsError(alpha, sd, n)) {\n return error.value;\n }\n return jStat.tci(1, alpha, sd, n)[1] - 1;\n};\n\nexports.CORREL = function(array1, array2) {\n array1 = utils.parseNumberArray(utils.flatten(array1));\n array2 = utils.parseNumberArray(utils.flatten(array2));\n if (utils.anyIsError(array1, array2)) {\n return error.value;\n }\n return jStat.corrcoeff(array1, array2);\n};\n\nexports.COUNT = function() {\n return utils.numbers(utils.flatten(arguments)).length;\n};\n\nexports.COUNTA = function() {\n var range = utils.flatten(arguments);\n return range.length - exports.COUNTBLANK(range);\n};\n\nexports.COUNTIN = function (range, value) {\n var result = 0;\n\n range = utils.flatten(range);\n\n for (var i = 0; i < range.length; i++) {\n if (range[i] === value) {\n result++;\n }\n }\n return result;\n};\n\n\nexports.COUNTBLANK = function() {\n var range = utils.flatten(arguments);\n var blanks = 0;\n var element;\n for (var i = 0; i < range.length; i++) {\n element = range[i];\n if (element === null || element === '') {\n blanks++;\n }\n }\n return blanks;\n};\n\nexports.COUNTIF = function(range, criteria) {\n range = utils.flatten(range);\n if (!/[<>=!]/.test(criteria)) {\n criteria = '==\"' + criteria + '\"';\n }\n var matches = 0;\n for (var i = 0; i < range.length; i++) {\n if (typeof range[i] !== 'string') {\n if (eval(range[i] + criteria)) { // jshint ignore:line\n matches++;\n }\n } else {\n if (eval('\"' + range[i] + '\"' + criteria)) { // jshint ignore:line\n matches++;\n }\n }\n }\n return matches;\n};\n\nexports.COUNTIFS = function() {\n var args = utils.argsToArray(arguments);\n var results = new Array(utils.flatten(args[0]).length);\n for (var i = 0; i < results.length; i++) {\n results[i] = true;\n }\n for (i = 0; i < args.length; i += 2) {\n var range = utils.flatten(args[i]);\n var criteria = args[i + 1];\n if (!/[<>=!]/.test(criteria)) {\n criteria = '==\"' + criteria + '\"';\n }\n for (var j = 0; j < range.length; j++) {\n if (typeof range[j] !== 'string') {\n results[j] = results[j] && eval(range[j] + criteria); // jshint ignore:line\n } else {\n results[j] = results[j] && eval('\"' + range[j] + '\"' + criteria); // jshint ignore:line\n }\n }\n }\n var result = 0;\n for (i = 0; i < results.length; i++) {\n if (results[i]) {\n result++;\n }\n }\n return result;\n};\n\nexports.COUNTUNIQUE = function () {\n return misc.UNIQUE.apply(null, utils.flatten(arguments)).length;\n};\n\nexports.COVARIANCE = {};\n\nexports.COVARIANCE.P = function(array1, array2) {\n array1 = utils.parseNumberArray(utils.flatten(array1));\n array2 = utils.parseNumberArray(utils.flatten(array2));\n if (utils.anyIsError(array1, array2)) {\n return error.value;\n }\n var mean1 = jStat.mean(array1);\n var mean2 = jStat.mean(array2);\n var result = 0;\n var n = array1.length;\n for (var i = 0; i < n; i++) {\n result += (array1[i] - mean1) * (array2[i] - mean2);\n }\n return result / n;\n};\n\nexports.COVARIANCE.S = function(array1, array2) {\n array1 = utils.parseNumberArray(utils.flatten(array1));\n array2 = utils.parseNumberArray(utils.flatten(array2));\n if (utils.anyIsError(array1, array2)) {\n return error.value;\n }\n return jStat.covariance(array1, array2);\n};\n\nexports.DEVSQ = function() {\n var range = utils.parseNumberArray(utils.flatten(arguments));\n if (range instanceof Error) {\n return range;\n }\n var mean = jStat.mean(range);\n var result = 0;\n for (var i = 0; i < range.length; i++) {\n result += Math.pow((range[i] - mean), 2);\n }\n return result;\n};\n\nexports.EXPON = {};\n\nexports.EXPON.DIST = function(x, lambda, cumulative) {\n x = utils.parseNumber(x);\n lambda = utils.parseNumber(lambda);\n if (utils.anyIsError(x, lambda)) {\n return error.value;\n }\n return (cumulative) ? jStat.exponential.cdf(x, lambda) : jStat.exponential.pdf(x, lambda);\n};\n\nexports.F = {};\n\nexports.F.DIST = function(x, d1, d2, cumulative) {\n x = utils.parseNumber(x);\n d1 = utils.parseNumber(d1);\n d2 = utils.parseNumber(d2);\n if (utils.anyIsError(x, d1, d2)) {\n return error.value;\n }\n return (cumulative) ? jStat.centralF.cdf(x, d1, d2) : jStat.centralF.pdf(x, d1, d2);\n};\n\nexports.F.DIST.RT = function(x, d1, d2) {\n if (arguments.length !== 3) {\n return error.na;\n }\n\n if (x < 0 || d1 < 1 || d2 < 1) {\n return error.num;\n }\n\n if ((typeof x !== 'number') || (typeof d1 !== 'number') || (typeof d2 !== 'number')) {\n return error.value;\n }\n\n return 1 - jStat.centralF.cdf(x, d1, d2);\n};\n\nexports.F.INV = function(probability, d1, d2) {\n probability = utils.parseNumber(probability);\n d1 = utils.parseNumber(d1);\n d2 = utils.parseNumber(d2);\n if (utils.anyIsError(probability, d1, d2)) {\n return error.value;\n }\n if (probability <= 0.0 || probability > 1.0) {\n return error.num;\n }\n\n return jStat.centralF.inv(probability, d1, d2);\n};\n\nexports.F.INV.RT = function(p, d1, d2) {\n if (arguments.length !== 3) {\n return error.na;\n }\n\n if (p < 0 || p > 1 || d1 < 1 || d1 > Math.pow(10, 10) || d2 < 1 || d2 > Math.pow(10, 10)) {\n return error.num;\n }\n\n if ((typeof p !== 'number') || (typeof d1 !== 'number') || (typeof d2 !== 'number')) {\n return error.value;\n }\n\n return jStat.centralF.inv(1.0 - p, d1, d2);\n};\n\nexports.F.TEST = function(array1, array2) {\n if (!array1 || !array2) {\n return error.na;\n }\n\n if (!(array1 instanceof Array) || !(array2 instanceof Array)) {\n return error.na;\n }\n\n if (array1.length < 2 || array2.length < 2) {\n return error.div0;\n }\n\n var sumOfSquares = function(values, x1) {\n var sum = 0;\n for (var i = 0; i < values.length; i++) {\n sum +=Math.pow((values[i] - x1), 2);\n }\n return sum;\n };\n\n var x1 = mathTrig.SUM(array1) / array1.length;\n var x2 = mathTrig.SUM(array2) / array2.length;\n var sum1 = sumOfSquares(array1, x1) / (array1.length - 1);\n var sum2 = sumOfSquares(array2, x2) / (array2.length - 1);\n\n return sum1 / sum2;\n};\n\nexports.FISHER = function(x) {\n x = utils.parseNumber(x);\n if (x instanceof Error) {\n return x;\n }\n return Math.log((1 + x) / (1 - x)) / 2;\n};\n\nexports.FISHERINV = function(y) {\n y = utils.parseNumber(y);\n if (y instanceof Error) {\n return y;\n }\n var e2y = Math.exp(2 * y);\n return (e2y - 1) / (e2y + 1);\n};\n\nexports.FORECAST = function(x, data_y, data_x) {\n x = utils.parseNumber(x);\n data_y = utils.parseNumberArray(utils.flatten(data_y));\n data_x = utils.parseNumberArray(utils.flatten(data_x));\n if (utils.anyIsError(x, data_y, data_x)) {\n return error.value;\n }\n var xmean = jStat.mean(data_x);\n var ymean = jStat.mean(data_y);\n var n = data_x.length;\n var num = 0;\n var den = 0;\n for (var i = 0; i < n; i++) {\n num += (data_x[i] - xmean) * (data_y[i] - ymean);\n den += Math.pow(data_x[i] - xmean, 2);\n }\n var b = num / den;\n var a = ymean - b * xmean;\n return a + b * x;\n};\n\nexports.FREQUENCY = function(data, bins) {\n data = utils.parseNumberArray(utils.flatten(data));\n bins = utils.parseNumberArray(utils.flatten(bins));\n if (utils.anyIsError(data, bins)) {\n return error.value;\n }\n var n = data.length;\n var b = bins.length;\n var r = [];\n for (var i = 0; i <= b; i++) {\n r[i] = 0;\n for (var j = 0; j < n; j++) {\n if (i === 0) {\n if (data[j] <= bins[0]) {\n r[0] += 1;\n }\n } else if (i < b) {\n if (data[j] > bins[i - 1] && data[j] <= bins[i]) {\n r[i] += 1;\n }\n } else if (i === b) {\n if (data[j] > bins[b - 1]) {\n r[b] += 1;\n }\n }\n }\n }\n return r;\n};\n\n\nexports.GAMMA = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n\n if (number === 0) {\n return error.num;\n }\n\n if (parseInt(number, 10) === number && number < 0) {\n return error.num;\n }\n\n return jStat.gammafn(number);\n};\n\nexports.GAMMA.DIST = function(value, alpha, beta, cumulative) {\n if (arguments.length !== 4) {\n return error.na;\n }\n\n if (value < 0 || alpha <= 0 || beta <= 0) {\n return error.value;\n }\n\n if ((typeof value !== 'number') || (typeof alpha !== 'number') || (typeof beta !== 'number')) {\n return error.value;\n }\n\n return cumulative ? jStat.gamma.cdf(value, alpha, beta, true) : jStat.gamma.pdf(value, alpha, beta, false);\n};\n\nexports.GAMMA.INV = function(probability, alpha, beta) {\n if (arguments.length !== 3) {\n return error.na;\n }\n\n if (probability < 0 || probability > 1 || alpha <= 0 || beta <= 0) {\n return error.num;\n }\n\n if ((typeof probability !== 'number') || (typeof alpha !== 'number') || (typeof beta !== 'number')) {\n return error.value;\n }\n\n return jStat.gamma.inv(probability, alpha, beta);\n};\n\nexports.GAMMALN = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return jStat.gammaln(number);\n};\n\nexports.GAMMALN.PRECISE = function(x) {\n if (arguments.length !== 1) {\n return error.na;\n }\n\n if (x <= 0) {\n return error.num;\n }\n\n if (typeof x !== 'number') {\n return error.value;\n }\n\n return jStat.gammaln(x);\n};\n\nexports.GAUSS = function(z) {\n z = utils.parseNumber(z);\n if (z instanceof Error) {\n return z;\n }\n return jStat.normal.cdf(z, 0, 1) - 0.5;\n};\n\nexports.GEOMEAN = function() {\n var args = utils.parseNumberArray(utils.flatten(arguments));\n if (args instanceof Error) {\n return args;\n }\n return jStat.geomean(args);\n};\n\nexports.GROWTH = function(known_y, known_x, new_x, use_const) {\n // Credits: Ilmari Karonen (http://stackoverflow.com/questions/14161990/how-to-implement-growth-function-in-javascript)\n\n known_y = utils.parseNumberArray(known_y);\n if (known_y instanceof Error) {\n return known_y;\n }\n\n // Default values for optional parameters:\n var i;\n if (known_x === undefined) {\n known_x = [];\n for (i = 1; i <= known_y.length; i++) {\n known_x.push(i);\n }\n }\n if (new_x === undefined) {\n new_x = [];\n for (i = 1; i <= known_y.length; i++) {\n new_x.push(i);\n }\n }\n\n known_x = utils.parseNumberArray(known_x);\n new_x = utils.parseNumberArray(new_x);\n if (utils.anyIsError(known_x, new_x)) {\n return error.value;\n }\n\n\n if (use_const === undefined) {\n use_const = true;\n }\n\n // Calculate sums over the data:\n var n = known_y.length;\n var avg_x = 0;\n var avg_y = 0;\n var avg_xy = 0;\n var avg_xx = 0;\n for (i = 0; i < n; i++) {\n var x = known_x[i];\n var y = Math.log(known_y[i]);\n avg_x += x;\n avg_y += y;\n avg_xy += x * y;\n avg_xx += x * x;\n }\n avg_x /= n;\n avg_y /= n;\n avg_xy /= n;\n avg_xx /= n;\n\n // Compute linear regression coefficients:\n var beta;\n var alpha;\n if (use_const) {\n beta = (avg_xy - avg_x * avg_y) / (avg_xx - avg_x * avg_x);\n alpha = avg_y - beta * avg_x;\n } else {\n beta = avg_xy / avg_xx;\n alpha = 0;\n }\n\n // Compute and return result array:\n var new_y = [];\n for (i = 0; i < new_x.length; i++) {\n new_y.push(Math.exp(alpha + beta * new_x[i]));\n }\n return new_y;\n};\n\nexports.HARMEAN = function() {\n var range = utils.parseNumberArray(utils.flatten(arguments));\n if (range instanceof Error) {\n return range;\n }\n var n = range.length;\n var den = 0;\n for (var i = 0; i < n; i++) {\n den += 1 / range[i];\n }\n return n / den;\n};\n\nexports.HYPGEOM = {};\n\nexports.HYPGEOM.DIST = function(x, n, M, N, cumulative) {\n x = utils.parseNumber(x);\n n = utils.parseNumber(n);\n M = utils.parseNumber(M);\n N = utils.parseNumber(N);\n if (utils.anyIsError(x, n, M, N)) {\n return error.value;\n }\n\n function pdf(x, n, M, N) {\n return mathTrig.COMBIN(M, x) * mathTrig.COMBIN(N - M, n - x) / mathTrig.COMBIN(N, n);\n }\n\n function cdf(x, n, M, N) {\n var result = 0;\n for (var i = 0; i <= x; i++) {\n result += pdf(i, n, M, N);\n }\n return result;\n }\n\n return (cumulative) ? cdf(x, n, M, N) : pdf(x, n, M, N);\n};\n\nexports.INTERCEPT = function(known_y, known_x) {\n known_y = utils.parseNumberArray(known_y);\n known_x = utils.parseNumberArray(known_x);\n if (utils.anyIsError(known_y, known_x)) {\n return error.value;\n }\n if (known_y.length !== known_x.length) {\n return error.na;\n }\n return exports.FORECAST(0, known_y, known_x);\n};\n\nexports.KURT = function() {\n var range = utils.parseNumberArray(utils.flatten(arguments));\n if (range instanceof Error) {\n return range;\n }\n var mean = jStat.mean(range);\n var n = range.length;\n var sigma = 0;\n for (var i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 4);\n }\n sigma = sigma / Math.pow(jStat.stdev(range, true), 4);\n return ((n * (n + 1)) / ((n - 1) * (n - 2) * (n - 3))) * sigma - 3 * (n - 1) * (n - 1) / ((n - 2) * (n - 3));\n};\n\nexports.LARGE = function(range, k) {\n range = utils.parseNumberArray(utils.flatten(range));\n k = utils.parseNumber(k);\n if (utils.anyIsError(range, k)) {\n return range;\n }\n return range.sort(function(a, b) {\n return b - a;\n })[k - 1];\n};\n\nexports.LINEST = function(data_y, data_x) {\n data_y = utils.parseNumberArray(utils.flatten(data_y));\n data_x = utils.parseNumberArray(utils.flatten(data_x));\n if (utils.anyIsError(data_y, data_x)) {\n return error.value;\n }\n var ymean = jStat.mean(data_y);\n var xmean = jStat.mean(data_x);\n var n = data_x.length;\n var num = 0;\n var den = 0;\n for (var i = 0; i < n; i++) {\n num += (data_x[i] - xmean) * (data_y[i] - ymean);\n den += Math.pow(data_x[i] - xmean, 2);\n }\n var m = num / den;\n var b = ymean - m * xmean;\n return [m, b];\n};\n\n// According to Microsoft:\n// http://office.microsoft.com/en-us/starter-help/logest-function-HP010342665.aspx\n// LOGEST returns are based on the following linear model:\n// ln y = x1 ln m1 + ... + xn ln mn + ln b\nexports.LOGEST = function(data_y, data_x) {\n data_y = utils.parseNumberArray(utils.flatten(data_y));\n data_x = utils.parseNumberArray(utils.flatten(data_x));\n if (utils.anyIsError(data_y, data_x)) {\n return error.value;\n }\n for (var i = 0; i < data_y.length; i ++) {\n data_y[i] = Math.log(data_y[i]);\n }\n\n var result = exports.LINEST(data_y, data_x);\n result[0] = Math.round(Math.exp(result[0])*1000000)/1000000;\n result[1] = Math.round(Math.exp(result[1])*1000000)/1000000;\n return result;\n};\n\nexports.LOGNORM = {};\n\nexports.LOGNORM.DIST = function(x, mean, sd, cumulative) {\n x = utils.parseNumber(x);\n mean = utils.parseNumber(mean);\n sd = utils.parseNumber(sd);\n if (utils.anyIsError(x, mean, sd)) {\n return error.value;\n }\n return (cumulative) ? jStat.lognormal.cdf(x, mean, sd) : jStat.lognormal.pdf(x, mean, sd);\n};\n\nexports.LOGNORM.INV = function(probability, mean, sd) {\n probability = utils.parseNumber(probability);\n mean = utils.parseNumber(mean);\n sd = utils.parseNumber(sd);\n if (utils.anyIsError(probability, mean, sd)) {\n return error.value;\n }\n return jStat.lognormal.inv(probability, mean, sd);\n};\n\nexports.MAX = function() {\n var range = utils.numbers(utils.flatten(arguments));\n return (range.length === 0) ? 0 : Math.max.apply(Math, range);\n};\n\nexports.MAXA = function() {\n var range = utils.arrayValuesToNumbers(utils.flatten(arguments));\n return (range.length === 0) ? 0 : Math.max.apply(Math, range);\n};\n\nexports.MEDIAN = function() {\n var range = utils.arrayValuesToNumbers(utils.flatten(arguments));\n var result = jStat.median(range);\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.MIN = function() {\n var range = utils.numbers(utils.flatten(arguments));\n return (range.length === 0) ? 0 : Math.min.apply(Math, range);\n};\n\nexports.MINA = function() {\n var range = utils.arrayValuesToNumbers(utils.flatten(arguments));\n return (range.length === 0) ? 0 : Math.min.apply(Math, range);\n};\n\nexports.MODE = {};\n\nexports.MODE.MULT = function() {\n // Credits: Roönaän\n var range = utils.parseNumberArray(utils.flatten(arguments));\n if (range instanceof Error) {\n return range;\n }\n var n = range.length;\n var count = {};\n var maxItems = [];\n var max = 0;\n var currentItem;\n\n for (var i = 0; i < n; i++) {\n currentItem = range[i];\n count[currentItem] = count[currentItem] ? count[currentItem] + 1 : 1;\n if (count[currentItem] > max) {\n max = count[currentItem];\n maxItems = [];\n }\n if (count[currentItem] === max) {\n maxItems[maxItems.length] = currentItem;\n }\n }\n return maxItems;\n};\n\nexports.MODE.SNGL = function() {\n var range = utils.parseNumberArray(utils.flatten(arguments));\n if (range instanceof Error) {\n return range;\n }\n return exports.MODE.MULT(range).sort(function(a, b) {\n return a - b;\n })[0];\n};\n\nexports.NEGBINOM = {};\n\nexports.NEGBINOM.DIST = function(k, r, p, cumulative) {\n k = utils.parseNumber(k);\n r = utils.parseNumber(r);\n p = utils.parseNumber(p);\n if (utils.anyIsError(k, r, p)) {\n return error.value;\n }\n return (cumulative) ? jStat.negbin.cdf(k, r, p) : jStat.negbin.pdf(k, r, p);\n};\n\nexports.NORM = {};\n\nexports.NORM.DIST = function(x, mean, sd, cumulative) {\n x = utils.parseNumber(x);\n mean = utils.parseNumber(mean);\n sd = utils.parseNumber(sd);\n if (utils.anyIsError(x, mean, sd)) {\n return error.value;\n }\n if (sd <= 0) {\n return error.num;\n }\n\n // Return normal distribution computed by jStat [http://jstat.org]\n return (cumulative) ? jStat.normal.cdf(x, mean, sd) : jStat.normal.pdf(x, mean, sd);\n};\n\nexports.NORM.INV = function(probability, mean, sd) {\n probability = utils.parseNumber(probability);\n mean = utils.parseNumber(mean);\n sd = utils.parseNumber(sd);\n if (utils.anyIsError(probability, mean, sd)) {\n return error.value;\n }\n return jStat.normal.inv(probability, mean, sd);\n};\n\nexports.NORM.S = {};\n\nexports.NORM.S.DIST = function(z, cumulative) {\n z = utils.parseNumber(z);\n if (z instanceof Error) {\n return error.value;\n }\n return (cumulative) ? jStat.normal.cdf(z, 0, 1) : jStat.normal.pdf(z, 0, 1);\n};\n\nexports.NORM.S.INV = function(probability) {\n probability = utils.parseNumber(probability);\n if (probability instanceof Error) {\n return error.value;\n }\n return jStat.normal.inv(probability, 0, 1);\n};\n\nexports.PEARSON = function(data_x, data_y) {\n data_y = utils.parseNumberArray(utils.flatten(data_y));\n data_x = utils.parseNumberArray(utils.flatten(data_x));\n if (utils.anyIsError(data_y, data_x)) {\n return error.value;\n }\n var xmean = jStat.mean(data_x);\n var ymean = jStat.mean(data_y);\n var n = data_x.length;\n var num = 0;\n var den1 = 0;\n var den2 = 0;\n for (var i = 0; i < n; i++) {\n num += (data_x[i] - xmean) * (data_y[i] - ymean);\n den1 += Math.pow(data_x[i] - xmean, 2);\n den2 += Math.pow(data_y[i] - ymean, 2);\n }\n return num / Math.sqrt(den1 * den2);\n};\n\nexports.PERCENTILE = {};\n\nexports.PERCENTILE.EXC = function(array, k) {\n array = utils.parseNumberArray(utils.flatten(array));\n k = utils.parseNumber(k);\n if (utils.anyIsError(array, k)) {\n return error.value;\n }\n array = array.sort(function(a, b) {\n {\n return a - b;\n }\n });\n var n = array.length;\n if (k < 1 / (n + 1) || k > 1 - 1 / (n + 1)) {\n return error.num;\n }\n var l = k * (n + 1) - 1;\n var fl = Math.floor(l);\n return utils.cleanFloat((l === fl) ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]));\n};\n\nexports.PERCENTILE.INC = function(array, k) {\n array = utils.parseNumberArray(utils.flatten(array));\n k = utils.parseNumber(k);\n if (utils.anyIsError(array, k)) {\n return error.value;\n }\n array = array.sort(function(a, b) {\n return a - b;\n });\n var n = array.length;\n var l = k * (n - 1);\n var fl = Math.floor(l);\n return utils.cleanFloat((l === fl) ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]));\n};\n\nexports.PERCENTRANK = {};\n\nexports.PERCENTRANK.EXC = function(array, x, significance) {\n significance = (significance === undefined) ? 3 : significance;\n array = utils.parseNumberArray(utils.flatten(array));\n x = utils.parseNumber(x);\n significance = utils.parseNumber(significance);\n if (utils.anyIsError(array, x, significance)) {\n return error.value;\n }\n array = array.sort(function(a, b) {\n return a - b;\n });\n var uniques = misc.UNIQUE.apply(null, array);\n var n = array.length;\n var m = uniques.length;\n var power = Math.pow(10, significance);\n var result = 0;\n var match = false;\n var i = 0;\n while (!match && i < m) {\n if (x === uniques[i]) {\n result = (array.indexOf(uniques[i]) + 1) / (n + 1);\n match = true;\n } else if (x >= uniques[i] && (x < uniques[i + 1] || i === m - 1)) {\n result = (array.indexOf(uniques[i]) + 1 + (x - uniques[i]) / (uniques[i + 1] - uniques[i])) / (n + 1);\n match = true;\n }\n i++;\n }\n return Math.floor(result * power) / power;\n};\n\nexports.PERCENTRANK.INC = function(array, x, significance) {\n significance = (significance === undefined) ? 3 : significance;\n array = utils.parseNumberArray(utils.flatten(array));\n x = utils.parseNumber(x);\n significance = utils.parseNumber(significance);\n if (utils.anyIsError(array, x, significance)) {\n return error.value;\n }\n array = array.sort(function(a, b) {\n return a - b;\n });\n var uniques = misc.UNIQUE.apply(null, array);\n var n = array.length;\n var m = uniques.length;\n var power = Math.pow(10, significance);\n var result = 0;\n var match = false;\n var i = 0;\n while (!match && i < m) {\n if (x === uniques[i]) {\n result = array.indexOf(uniques[i]) / (n - 1);\n match = true;\n } else if (x >= uniques[i] && (x < uniques[i + 1] || i === m - 1)) {\n result = (array.indexOf(uniques[i]) + (x - uniques[i]) / (uniques[i + 1] - uniques[i])) / (n - 1);\n match = true;\n }\n i++;\n }\n return Math.floor(result * power) / power;\n};\n\nexports.PERMUT = function(number, number_chosen) {\n number = utils.parseNumber(number);\n number_chosen = utils.parseNumber(number_chosen);\n if (utils.anyIsError(number, number_chosen)) {\n return error.value;\n }\n return mathTrig.FACT(number) / mathTrig.FACT(number - number_chosen);\n};\n\nexports.PERMUTATIONA = function(number, number_chosen) {\n number = utils.parseNumber(number);\n number_chosen = utils.parseNumber(number_chosen);\n if (utils.anyIsError(number, number_chosen)) {\n return error.value;\n }\n return Math.pow(number, number_chosen);\n};\n\nexports.PHI = function(x) {\n x = utils.parseNumber(x);\n if (x instanceof Error) {\n return error.value;\n }\n return Math.exp(-0.5 * x * x) / SQRT2PI;\n};\n\nexports.POISSON = {};\n\nexports.POISSON.DIST = function(x, mean, cumulative) {\n x = utils.parseNumber(x);\n mean = utils.parseNumber(mean);\n if (utils.anyIsError(x, mean)) {\n return error.value;\n }\n return (cumulative) ? jStat.poisson.cdf(x, mean) : jStat.poisson.pdf(x, mean);\n};\n\nexports.PROB = function(range, probability, lower, upper) {\n if (lower === undefined) {\n return 0;\n }\n upper = (upper === undefined) ? lower : upper;\n\n range = utils.parseNumberArray(utils.flatten(range));\n probability = utils.parseNumberArray(utils.flatten(probability));\n lower = utils.parseNumber(lower);\n upper = utils.parseNumber(upper);\n if (utils.anyIsError(range, probability, lower, upper)) {\n return error.value;\n }\n\n if (lower === upper) {\n return (range.indexOf(lower) >= 0) ? probability[range.indexOf(lower)] : 0;\n }\n\n var sorted = range.sort(function(a, b) {\n return a - b;\n });\n var n = sorted.length;\n var result = 0;\n for (var i = 0; i < n; i++) {\n if (sorted[i] >= lower && sorted[i] <= upper) {\n result += probability[range.indexOf(sorted[i])];\n }\n }\n return result;\n};\n\nexports.QUARTILE = {};\n\nexports.QUARTILE.EXC = function(range, quart) {\n range = utils.parseNumberArray(utils.flatten(range));\n quart = utils.parseNumber(quart);\n if (utils.anyIsError(range, quart)) {\n return error.value;\n }\n switch (quart) {\n case 1:\n return exports.PERCENTILE.EXC(range, 0.25);\n case 2:\n return exports.PERCENTILE.EXC(range, 0.5);\n case 3:\n return exports.PERCENTILE.EXC(range, 0.75);\n default:\n return error.num;\n }\n};\n\nexports.QUARTILE.INC = function(range, quart) {\n range = utils.parseNumberArray(utils.flatten(range));\n quart = utils.parseNumber(quart);\n if (utils.anyIsError(range, quart)) {\n return error.value;\n }\n switch (quart) {\n case 1:\n return exports.PERCENTILE.INC(range, 0.25);\n case 2:\n return exports.PERCENTILE.INC(range, 0.5);\n case 3:\n return exports.PERCENTILE.INC(range, 0.75);\n default:\n return error.num;\n }\n};\n\nexports.RANK = {};\n\nexports.RANK.AVG = function(number, range, order) {\n number = utils.parseNumber(number);\n range = utils.parseNumberArray(utils.flatten(range));\n if (utils.anyIsError(number, range)) {\n return error.value;\n }\n range = utils.flatten(range);\n order = order || false;\n var sort = (order) ? function(a, b) {\n return a - b;\n } : function(a, b) {\n return b - a;\n };\n range = range.sort(sort);\n\n var length = range.length;\n var count = 0;\n for (var i = 0; i < length; i++) {\n if (range[i] === number) {\n count++;\n }\n }\n\n return (count > 1) ? (2 * range.indexOf(number) + count + 1) / 2 : range.indexOf(number) + 1;\n};\n\nexports.RANK.EQ = function(number, range, order) {\n number = utils.parseNumber(number);\n range = utils.parseNumberArray(utils.flatten(range));\n if (utils.anyIsError(number, range)) {\n return error.value;\n }\n order = order || false;\n var sort = (order) ? function(a, b) {\n return a - b;\n } : function(a, b) {\n return b - a;\n };\n range = range.sort(sort);\n return range.indexOf(number) + 1;\n};\n\nexports.ROW = function(matrix, index) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n if (index < 0) {\n return error.num;\n }\n\n if (!(matrix instanceof Array) || (typeof index !== 'number')) {\n return error.value;\n }\n\n if (matrix.length === 0) {\n return undefined;\n }\n\n return jStat.row(matrix, index);\n};\n\nexports.ROWS = function(matrix) {\n if (arguments.length !== 1) {\n return error.na;\n }\n\n if (!(matrix instanceof Array)) {\n return error.value;\n }\n\n if (matrix.length === 0) {\n return 0;\n }\n\n return jStat.rows(matrix);\n};\n\nexports.RSQ = function(data_x, data_y) { // no need to flatten here, PEARSON will take care of that\n data_x = utils.parseNumberArray(utils.flatten(data_x));\n data_y = utils.parseNumberArray(utils.flatten(data_y));\n if (utils.anyIsError(data_x, data_y)) {\n return error.value;\n }\n return Math.pow(exports.PEARSON(data_x, data_y), 2);\n};\n\nexports.SKEW = function() {\n var range = utils.parseNumberArray(utils.flatten(arguments));\n if (range instanceof Error) {\n return range;\n }\n var mean = jStat.mean(range);\n var n = range.length;\n var sigma = 0;\n for (var i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 3);\n }\n return n * sigma / ((n - 1) * (n - 2) * Math.pow(jStat.stdev(range, true), 3));\n};\n\nexports.SKEW.P = function() {\n var range = utils.parseNumberArray(utils.flatten(arguments));\n if (range instanceof Error) {\n return range;\n }\n var mean = jStat.mean(range);\n var n = range.length;\n var m2 = 0;\n var m3 = 0;\n for (var i = 0; i < n; i++) {\n m3 += Math.pow(range[i] - mean, 3);\n m2 += Math.pow(range[i] - mean, 2);\n }\n m3 = m3 / n;\n m2 = m2 / n;\n return m3 / Math.pow(m2, 3 / 2);\n};\n\nexports.SLOPE = function(data_y, data_x) {\n data_y = utils.parseNumberArray(utils.flatten(data_y));\n data_x = utils.parseNumberArray(utils.flatten(data_x));\n if (utils.anyIsError(data_y, data_x)) {\n return error.value;\n }\n var xmean = jStat.mean(data_x);\n var ymean = jStat.mean(data_y);\n var n = data_x.length;\n var num = 0;\n var den = 0;\n for (var i = 0; i < n; i++) {\n num += (data_x[i] - xmean) * (data_y[i] - ymean);\n den += Math.pow(data_x[i] - xmean, 2);\n }\n return num / den;\n};\n\nexports.SMALL = function(range, k) {\n range = utils.parseNumberArray(utils.flatten(range));\n k = utils.parseNumber(k);\n if (utils.anyIsError(range, k)) {\n return range;\n }\n return range.sort(function(a, b) {\n return a - b;\n })[k - 1];\n};\n\nexports.STANDARDIZE = function(x, mean, sd) {\n x = utils.parseNumber(x);\n mean = utils.parseNumber(mean);\n sd = utils.parseNumber(sd);\n if (utils.anyIsError(x, mean, sd)) {\n return error.value;\n }\n return (x - mean) / sd;\n};\n\nexports.STDEV = {};\n\nexports.STDEV.P = function() {\n var v = exports.VAR.P.apply(this, arguments);\n var result = Math.sqrt(v);\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.STDEV.S = function() {\n var v = exports.VAR.S.apply(this, arguments);\n var result = Math.sqrt(v);\n\n return result;\n};\n\nexports.STDEVA = function() {\n var v = exports.VARA.apply(this, arguments);\n var result = Math.sqrt(v);\n\n return result;\n};\n\nexports.STDEVPA = function() {\n var v = exports.VARPA.apply(this, arguments);\n var result = Math.sqrt(v);\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\n\nexports.STEYX = function(data_y, data_x) {\n data_y = utils.parseNumberArray(utils.flatten(data_y));\n data_x = utils.parseNumberArray(utils.flatten(data_x));\n if (utils.anyIsError(data_y, data_x)) {\n return error.value;\n }\n var xmean = jStat.mean(data_x);\n var ymean = jStat.mean(data_y);\n var n = data_x.length;\n var lft = 0;\n var num = 0;\n var den = 0;\n for (var i = 0; i < n; i++) {\n lft += Math.pow(data_y[i] - ymean, 2);\n num += (data_x[i] - xmean) * (data_y[i] - ymean);\n den += Math.pow(data_x[i] - xmean, 2);\n }\n return Math.sqrt((lft - num * num / den) / (n - 2));\n};\n\nexports.TRANSPOSE = function(matrix) {\n if (!matrix) {\n return error.na;\n }\n return jStat.transpose(matrix);\n};\n\nexports.T = text.T;\n\nexports.T.DIST = function(x, df, cumulative) {\n x = utils.parseNumber(x);\n df = utils.parseNumber(df);\n if (utils.anyIsError(x, df)) {\n return error.value;\n }\n return (cumulative) ? jStat.studentt.cdf(x, df) : jStat.studentt.pdf(x, df);\n};\n\nexports.T.DIST['2T'] = function(x, df) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n if (x < 0 || df < 1) {\n return error.num;\n }\n\n if ((typeof x !== 'number') || (typeof df !== 'number')) {\n return error.value;\n }\n\n return (1 - jStat.studentt.cdf(x , df)) * 2;\n};\n\nexports.T.DIST.RT = function(x, df) {\n if (arguments.length !== 2) {\n return error.na;\n }\n\n if (x < 0 || df < 1) {\n return error.num;\n }\n\n if ((typeof x !== 'number') || (typeof df !== 'number')) {\n return error.value;\n }\n\n return 1 - jStat.studentt.cdf(x , df);\n};\n\nexports.T.INV = function(probability, df) {\n probability = utils.parseNumber(probability);\n df = utils.parseNumber(df);\n if (utils.anyIsError(probability, df)) {\n return error.value;\n }\n return jStat.studentt.inv(probability, df);\n};\n\nexports.T.INV['2T'] = function(probability, df) {\n probability = utils.parseNumber(probability);\n df = utils.parseNumber(df);\n if (probability <= 0 || probability > 1 || df < 1) {\n return error.num;\n }\n if (utils.anyIsError(probability, df)) {\n return error.value;\n }\n return Math.abs(jStat.studentt.inv(probability/2, df));\n};\n\n// The algorithm can be found here:\n// http://www.chem.uoa.gr/applets/AppletTtest/Appl_Ttest2.html\nexports.T.TEST = function(data_x, data_y) {\n data_x = utils.parseNumberArray(utils.flatten(data_x));\n data_y = utils.parseNumberArray(utils.flatten(data_y));\n if (utils.anyIsError(data_x, data_y)) {\n return error.value;\n }\n\n var mean_x = jStat.mean(data_x);\n var mean_y = jStat.mean(data_y);\n var s_x = 0;\n var s_y = 0;\n var i;\n\n for (i = 0; i < data_x.length; i++) {\n s_x += Math.pow(data_x[i] - mean_x, 2);\n }\n for (i = 0; i < data_y.length; i++) {\n s_y += Math.pow(data_y[i] - mean_y, 2);\n }\n\n s_x = s_x / (data_x.length-1);\n s_y = s_y / (data_y.length-1);\n\n var t = Math.abs(mean_x - mean_y) / Math.sqrt(s_x/data_x.length + s_y/data_y.length);\n\n return exports.T.DIST['2T'](t, data_x.length+data_y.length-2);\n};\n\nexports.TREND = function(data_y, data_x, new_data_x) {\n data_y = utils.parseNumberArray(utils.flatten(data_y));\n data_x = utils.parseNumberArray(utils.flatten(data_x));\n new_data_x = utils.parseNumberArray(utils.flatten(new_data_x));\n if (utils.anyIsError(data_y, data_x, new_data_x)) {\n return error.value;\n }\n var linest = exports.LINEST(data_y, data_x);\n var m = linest[0];\n var b = linest[1];\n var result = [];\n\n new_data_x.forEach(function(x) {\n result.push(m * x + b);\n });\n\n return result;\n};\n\nexports.TRIMMEAN = function(range, percent) {\n range = utils.parseNumberArray(utils.flatten(range));\n percent = utils.parseNumber(percent);\n if (utils.anyIsError(range, percent)) {\n return error.value;\n }\n var trim = mathTrig.FLOOR(range.length * percent, 2) / 2;\n return jStat.mean(utils.initial(utils.rest(range.sort(function(a, b) {\n return a - b;\n }), trim), trim));\n};\n\nexports.VAR = {};\n\nexports.VAR.P = function() {\n var range = utils.numbers(utils.flatten(arguments));\n var n = range.length;\n var sigma = 0;\n var mean = exports.AVERAGE(range);\n var result;\n for (var i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 2);\n }\n result = sigma / n;\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.VAR.S = function() {\n var range = utils.numbers(utils.flatten(arguments));\n var n = range.length;\n var sigma = 0;\n var mean = exports.AVERAGE(range);\n for (var i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 2);\n }\n return sigma / (n - 1);\n};\n\nexports.VARA = function() {\n var range = utils.flatten(arguments);\n var n = range.length;\n var sigma = 0;\n var count = 0;\n var mean = exports.AVERAGEA(range);\n for (var i = 0; i < n; i++) {\n var el = range[i];\n if (typeof el === 'number') {\n sigma += Math.pow(el - mean, 2);\n } else if (el === true) {\n sigma += Math.pow(1 - mean, 2);\n } else {\n sigma += Math.pow(0 - mean, 2);\n }\n\n if (el !== null) {\n count++;\n }\n }\n return sigma / (count - 1);\n};\n\nexports.VARPA = function() {\n var range = utils.flatten(arguments);\n var n = range.length;\n var sigma = 0;\n var count = 0;\n var mean = exports.AVERAGEA(range);\n var result;\n for (var i = 0; i < n; i++) {\n var el = range[i];\n if (typeof el === 'number') {\n sigma += Math.pow(el - mean, 2);\n } else if (el === true) {\n sigma += Math.pow(1 - mean, 2);\n } else {\n sigma += Math.pow(0 - mean, 2);\n }\n\n if (el !== null) {\n count++;\n }\n }\n result = sigma / count;;\n\n if (isNaN(result)) {\n result = error.num;\n }\n\n return result;\n};\n\nexports.WEIBULL = {};\n\nexports.WEIBULL.DIST = function(x, alpha, beta, cumulative) {\n x = utils.parseNumber(x);\n alpha = utils.parseNumber(alpha);\n beta = utils.parseNumber(beta);\n if (utils.anyIsError(x, alpha, beta)) {\n return error.value;\n }\n return (cumulative) ? 1 - Math.exp(-Math.pow(x / beta, alpha)) : Math.pow(x, alpha - 1) * Math.exp(-Math.pow(x / beta, alpha)) * alpha / Math.pow(beta, alpha);\n};\n\nexports.Z = {};\n\nexports.Z.TEST = function(range, x, sd) {\n range = utils.parseNumberArray(utils.flatten(range));\n x = utils.parseNumber(x);\n if (utils.anyIsError(range, x)) {\n return error.value;\n }\n\n sd = sd || exports.STDEV.S(range);\n var n = range.length;\n return 1 - exports.NORM.S.DIST((exports.AVERAGE(range) - x) / (sd / Math.sqrt(n)), true);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/statistical.js\n ** module id = 17\n ** module chunks = 0\n **/","var utils = require('./utils');\nvar error = require('./error');\nvar numbro = require('numbro');\n\n//TODO\nexports.ASC = function() {\n throw new Error('ASC is not implemented');\n};\n\n//TODO\nexports.BAHTTEXT = function() {\n throw new Error('BAHTTEXT is not implemented');\n};\n\nexports.CHAR = function(number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return String.fromCharCode(number);\n};\n\nexports.CLEAN = function(text) {\n text = text || '';\n var re = /[\\0-\\x1F]/g;\n return text.replace(re, \"\");\n};\n\nexports.CODE = function(text) {\n text = text || '';\n var result = text.charCodeAt(0);\n\n if (isNaN(result)) {\n result = error.na;\n }\n return result;\n};\n\nexports.CONCATENATE = function() {\n var args = utils.flatten(arguments);\n\n var trueFound = 0;\n while ((trueFound = args.indexOf(true)) > -1) {\n args[trueFound] = 'TRUE';\n }\n\n var falseFound = 0;\n while ((falseFound = args.indexOf(false)) > -1) {\n args[falseFound] = 'FALSE';\n }\n\n return args.join('');\n};\n\n//TODO\nexports.DBCS = function() {\n throw new Error('DBCS is not implemented');\n};\n\nexports.DOLLAR = function(number, decimals) {\n decimals = (decimals === undefined) ? 2 : decimals;\n\n number = utils.parseNumber(number);\n decimals = utils.parseNumber(decimals);\n if (utils.anyIsError(number, decimals)) {\n return error.value;\n }\n var format = '';\n if (decimals <= 0) {\n number = Math.round(number * Math.pow(10, decimals)) / Math.pow(10, decimals);\n format = '($0,0)';\n } else if (decimals > 0) {\n format = '($0,0.' + new Array(decimals + 1).join('0') + ')';\n }\n return numbro(number).format(format);\n};\n\nexports.EXACT = function(text1, text2) {\n if (arguments.length !== 2) {\n return error.na;\n }\n return text1 === text2;\n};\n\nexports.FIND = function(find_text, within_text, position) {\n if (arguments.length < 2) {\n return error.na;\n }\n position = (position === undefined) ? 0 : position;\n return within_text ? within_text.indexOf(find_text, position - 1) + 1 : null;\n};\n\nexports.FIXED = function(number, decimals, no_commas) {\n decimals = (decimals === undefined) ? 2 : decimals;\n no_commas = (no_commas === undefined) ? false : no_commas;\n\n number = utils.parseNumber(number);\n decimals = utils.parseNumber(decimals);\n if (utils.anyIsError(number, decimals)) {\n return error.value;\n }\n\n var format = no_commas ? '0' : '0,0';\n if (decimals <= 0) {\n number = Math.round(number * Math.pow(10, decimals)) / Math.pow(10, decimals);\n } else if (decimals > 0) {\n format += '.' + new Array(decimals + 1).join('0');\n }\n return numbro(number).format(format);\n};\n\nexports.HTML2TEXT = function (value) {\n var result = '';\n\n if (value) {\n if (value instanceof Array) {\n value.forEach(function (line) {\n if (result !== '') {\n result += '\\n';\n }\n result += (line.replace(/<(?:.|\\n)*?>/gm, ''));\n });\n } else {\n result = value.replace(/<(?:.|\\n)*?>/gm, '');\n }\n }\n\n return result;\n};\n\nexports.LEFT = function(text, number) {\n number = (number === undefined) ? 1 : number;\n number = utils.parseNumber(number);\n if (number instanceof Error || typeof text !== 'string') {\n return error.value;\n }\n return text ? text.substring(0, number) : null;\n};\n\nexports.LEN = function(text) {\n if (arguments.length === 0) {\n return error.error;\n }\n\n if (typeof text === 'string') {\n return text ? text.length : 0;\n }\n\n if (text.length) {\n return text.length;\n }\n\n return error.value;\n};\n\nexports.LOWER = function(text) {\n if (typeof text !== 'string') {\n return error.value;\n }\n return text ? text.toLowerCase() : text;\n};\n\nexports.MID = function(text, start, number) {\n start = utils.parseNumber(start);\n number = utils.parseNumber(number);\n if (utils.anyIsError(start, number) || typeof text !== 'string') {\n return number;\n }\n\n var begin = start - 1;\n var end = begin + number;\n\n return text.substring(begin, end);\n};\n\n// TODO\nexports.NUMBERVALUE = function (text, decimal_separator, group_separator) {\n decimal_separator = (typeof decimal_separator === 'undefined') ? '.' : decimal_separator;\n group_separator = (typeof group_separator === 'undefined') ? ',' : group_separator;\n return Number(text.replace(decimal_separator, '.').replace(group_separator, ''));\n};\n\n// TODO\nexports.PRONETIC = function() {\n throw new Error('PRONETIC is not implemented');\n};\n\nexports.PROPER = function(text) {\n if (text === undefined || text.length === 0) {\n return error.value;\n }\n if (text === true) {\n text = 'TRUE';\n }\n if (text === false) {\n text = 'FALSE';\n }\n if (isNaN(text) && typeof text === 'number') {\n return error.value;\n }\n if (typeof text === 'number') {\n text = '' + text;\n }\n\n return text.replace(/\\w\\S*/g, function(txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n};\n\nexports.REGEXEXTRACT = function (text, regular_expression) {\n if (arguments.length < 2) {\n return error.na;\n }\n var match = text.match(new RegExp(regular_expression));\n return match ? (match[match.length > 1 ? match.length - 1 : 0]) : null;\n};\n\nexports.REGEXMATCH = function (text, regular_expression, full) {\n if (arguments.length < 2) {\n return error.na;\n }\n var match = text.match(new RegExp(regular_expression));\n return full ? match : !!match;\n};\n\nexports.REGEXREPLACE = function (text, regular_expression, replacement) {\n if (arguments.length < 3) {\n return error.na;\n }\n return text.replace(new RegExp(regular_expression), replacement);\n};\n\nexports.REPLACE = function(text, position, length, new_text) {\n position = utils.parseNumber(position);\n length = utils.parseNumber(length);\n if (utils.anyIsError(position, length) ||\n typeof text !== 'string' ||\n typeof new_text !== 'string') {\n return error.value;\n }\n return text.substr(0, position - 1) + new_text + text.substr(position - 1 + length);\n};\n\nexports.REPT = function(text, number) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return new Array(number + 1).join(text);\n};\n\nexports.RIGHT = function(text, number) {\n number = (number === undefined) ? 1 : number;\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n return text ? text.substring(text.length - number) : error.na;\n};\n\nexports.SEARCH = function(find_text, within_text, position) {\n var foundAt;\n if (typeof find_text !== 'string' || typeof within_text !== 'string') {\n return error.value;\n }\n position = (position === undefined) ? 0 : position;\n foundAt = within_text.toLowerCase().indexOf(find_text.toLowerCase(), position - 1)+1;\n return (foundAt === 0)?error.value:foundAt;\n};\n\nexports.SPLIT = function (text, separator) {\n return text.split(separator);\n};\n\nexports.SUBSTITUTE = function(text, old_text, new_text, occurrence) {\n if (arguments.length < 2) {\n return error.na;\n }\n if (!text || !old_text || !new_text) {\n return text;\n } else if (occurrence === undefined) {\n return text.replace(new RegExp(old_text, 'g'), new_text);\n } else {\n var index = 0;\n var i = 0;\n while (text.indexOf(old_text, index) > 0) {\n index = text.indexOf(old_text, index + 1);\n i++;\n if (i === occurrence) {\n return text.substring(0, index) + new_text + text.substring(index + old_text.length);\n }\n }\n }\n};\n\nexports.T = function(value) {\n return (typeof value === \"string\") ? value : '';\n};\n\n// TODO incomplete implementation\nexports.TEXT = function(value, format) {\n value = utils.parseNumber(value);\n if (utils.anyIsError(value)) {\n return error.na;\n }\n\n return numbro(value).format(format);\n};\n\nexports.TRIM = function(text) {\n if (typeof text !== 'string') {\n return error.value;\n }\n return text.replace(/ +/g, ' ').trim();\n};\n\nexports.UNICHAR = exports.CHAR;\n\nexports.UNICODE = exports.CODE;\n\nexports.UPPER = function(text) {\n if (typeof text !== 'string') {\n return error.value;\n }\n return text.toUpperCase();\n};\n\nexports.VALUE = function(text) {\n if (typeof text !== 'string') {\n return error.value;\n }\n var result = numbro().unformat(text);\n\n return result === void 0 ? 0 : result;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/text.js\n ** module id = 18\n ** module chunks = 0\n **/","/*!\n * numbro.js\n * version : 1.9.3\n * author : Företagsplatsen AB\n * license : MIT\n * http://www.foretagsplatsen.se\n */\n\n(function () {\n 'use strict';\n\n /************************************\n Constants\n ************************************/\n\n var numbro,\n VERSION = '1.9.3',\n binarySuffixes = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'],\n decimalSuffixes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],\n bytes = {\n general: { scale: 1024, suffixes: decimalSuffixes, marker: 'bd' },\n binary: { scale: 1024, suffixes: binarySuffixes, marker: 'b' },\n decimal: { scale: 1000, suffixes: decimalSuffixes, marker: 'd' }\n },\n // general must be before the others because it reuses their characters!\n byteFormatOrder = [ bytes.general, bytes.binary, bytes.decimal ],\n // internal storage for culture config files\n cultures = {},\n // Todo: Remove in 2.0.0\n languages = cultures,\n currentCulture = 'en-US',\n zeroFormat = null,\n defaultFormat = '0,0',\n defaultCurrencyFormat = '0$',\n // check for nodeJS\n hasModule = (typeof module !== 'undefined' && module.exports),\n // default culture\n enUS = {\n delimiters: {\n thousands: ',',\n decimal: '.'\n },\n abbreviations: {\n thousand: 'k',\n million: 'm',\n billion: 'b',\n trillion: 't'\n },\n ordinal: function(number) {\n var b = number % 10;\n return (~~(number % 100 / 10) === 1) ? 'th' :\n (b === 1) ? 'st' :\n (b === 2) ? 'nd' :\n (b === 3) ? 'rd' : 'th';\n },\n currency: {\n symbol: '$',\n position: 'prefix'\n },\n defaults: {\n currencyFormat: ',0000 a'\n },\n formats: {\n fourDigits: '0000 a',\n fullWithTwoDecimals: '$ ,0.00',\n fullWithTwoDecimalsNoCurrency: ',0.00'\n }\n };\n\n /************************************\n Constructors\n ************************************/\n\n\n // Numbro prototype object\n function Numbro(number) {\n this._value = number;\n }\n\n function zeroes(count) {\n var i, ret = '';\n\n for (i = 0; i < count; i++) {\n ret += '0';\n }\n\n return ret;\n }\n /**\n * Implementation of toFixed() for numbers with exponents\n * This function may return negative representations for zero values e.g. \"-0.0\"\n */\n function toFixedLargeSmall(value, precision) {\n var mantissa,\n beforeDec,\n afterDec,\n exponent,\n prefix,\n endStr,\n zerosStr,\n str;\n\n str = value.toString();\n\n mantissa = str.split('e')[0];\n exponent = str.split('e')[1];\n\n beforeDec = mantissa.split('.')[0];\n afterDec = mantissa.split('.')[1] || '';\n\n if (+exponent > 0) {\n // exponent is positive - add zeros after the numbers\n str = beforeDec + afterDec + zeroes(exponent - afterDec.length);\n } else {\n // exponent is negative\n\n if (+beforeDec < 0) {\n prefix = '-0';\n } else {\n prefix = '0';\n }\n\n // tack on the decimal point if needed\n if (precision > 0) {\n prefix += '.';\n }\n\n zerosStr = zeroes((-1 * exponent) - 1);\n // substring off the end to satisfy the precision\n endStr = (zerosStr + Math.abs(beforeDec) + afterDec).substr(0, precision);\n str = prefix + endStr;\n }\n\n // only add percision 0's if the exponent is positive\n if (+exponent > 0 && precision > 0) {\n str += '.' + zeroes(precision);\n }\n\n return str;\n }\n\n /**\n * Implementation of toFixed() that treats floats more like decimals\n *\n * Fixes binary rounding issues (eg. (0.615).toFixed(2) === '0.61') that present\n * problems for accounting- and finance-related software.\n *\n * Also removes negative signs for zero-formatted numbers. e.g. -0.01 w/ precision 1 -> 0.0\n */\n function toFixed(value, precision, roundingFunction, optionals) {\n var power = Math.pow(10, precision),\n optionalsRegExp,\n output;\n\n if (value.toString().indexOf('e') > -1) {\n // toFixed returns scientific notation for numbers above 1e21 and below 1e-7\n output = toFixedLargeSmall(value, precision);\n // remove the leading negative sign if it exists and should not be present (e.g. -0.00)\n if (output.charAt(0) === '-' && +output >= 0) {\n output = output.substr(1); // chop off the '-'\n }\n }\n else {\n // Multiply up by precision, round accurately, then divide and use native toFixed():\n output = (roundingFunction(value + 'e+' + precision) / power).toFixed(precision);\n }\n\n if (optionals) {\n optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n output = output.replace(optionalsRegExp, '');\n }\n\n return output;\n }\n\n /************************************\n Formatting\n ************************************/\n\n // determine what type of formatting we need to do\n function formatNumbro(n, format, roundingFunction) {\n var output,\n escapedFormat = format.replace(/\\{[^\\{\\}]*\\}/g, '');\n\n // figure out what kind of format we are dealing with\n if (escapedFormat.indexOf('$') > -1) { // currency!!!!!\n output = formatCurrency(n, cultures[currentCulture].currency.symbol, format, roundingFunction);\n } else if (escapedFormat.indexOf('%') > -1) { // percentage\n output = formatPercentage(n, format, roundingFunction);\n } else if (escapedFormat.indexOf(':') > -1) { // time\n output = formatTime(n, format);\n } else { // plain ol' numbers or bytes\n output = formatNumber(n._value, format, roundingFunction);\n }\n\n // return string\n return output;\n }\n\n // revert to number\n function unformatNumbro(n, string) {\n var stringOriginal = string,\n thousandRegExp,\n millionRegExp,\n billionRegExp,\n trillionRegExp,\n bytesMultiplier = false,\n power;\n\n if (string.indexOf(':') > -1) {\n n._value = unformatTime(string);\n } else {\n if (string === zeroFormat) {\n n._value = 0;\n } else {\n if (cultures[currentCulture].delimiters.decimal !== '.') {\n string = string.replace(/\\./g, '').replace(cultures[currentCulture].delimiters.decimal, '.');\n }\n\n // see if abbreviations are there so that we can multiply to the correct number\n thousandRegExp = new RegExp('[^a-zA-Z]' + cultures[currentCulture].abbreviations.thousand +\n '(?:\\\\)|(\\\\' + cultures[currentCulture].currency.symbol + ')?(?:\\\\))?)?$');\n millionRegExp = new RegExp('[^a-zA-Z]' + cultures[currentCulture].abbreviations.million +\n '(?:\\\\)|(\\\\' + cultures[currentCulture].currency.symbol + ')?(?:\\\\))?)?$');\n billionRegExp = new RegExp('[^a-zA-Z]' + cultures[currentCulture].abbreviations.billion +\n '(?:\\\\)|(\\\\' + cultures[currentCulture].currency.symbol + ')?(?:\\\\))?)?$');\n trillionRegExp = new RegExp('[^a-zA-Z]' + cultures[currentCulture].abbreviations.trillion +\n '(?:\\\\)|(\\\\' + cultures[currentCulture].currency.symbol + ')?(?:\\\\))?)?$');\n\n // see if bytes are there so that we can multiply to the correct number\n for (power = 1; power < binarySuffixes.length && !bytesMultiplier; ++power) {\n if (string.indexOf(binarySuffixes[power]) > -1) {\n bytesMultiplier = Math.pow(1024, power);\n } else if (string.indexOf(decimalSuffixes[power]) > -1) {\n bytesMultiplier = Math.pow(1000, power);\n }\n }\n\n var str = string.replace(/[^0-9\\.]+/g, '');\n if (str === '') {\n // An empty string is not a number.\n n._value = NaN;\n\n } else {\n // do some math to create our number\n n._value = ((bytesMultiplier) ? bytesMultiplier : 1) *\n ((stringOriginal.match(thousandRegExp)) ? Math.pow(10, 3) : 1) *\n ((stringOriginal.match(millionRegExp)) ? Math.pow(10, 6) : 1) *\n ((stringOriginal.match(billionRegExp)) ? Math.pow(10, 9) : 1) *\n ((stringOriginal.match(trillionRegExp)) ? Math.pow(10, 12) : 1) *\n ((string.indexOf('%') > -1) ? 0.01 : 1) *\n (((string.split('-').length +\n Math.min(string.split('(').length - 1, string.split(')').length - 1)) % 2) ? 1 : -1) *\n Number(str);\n\n // round if we are talking about bytes\n n._value = (bytesMultiplier) ? Math.ceil(n._value) : n._value;\n }\n }\n }\n return n._value;\n }\n\n function formatCurrency(n, currencySymbol, originalFormat, roundingFunction) {\n var format = originalFormat,\n symbolIndex = format.indexOf('$'),\n openParenIndex = format.indexOf('('),\n plusSignIndex = format.indexOf('+'),\n minusSignIndex = format.indexOf('-'),\n space = '',\n decimalSeparator = '',\n spliceIndex,\n output;\n\n if(format.indexOf('$') === -1){\n // Use defaults instead of the format provided\n if (cultures[currentCulture].currency.position === 'infix') {\n decimalSeparator = currencySymbol;\n if (cultures[currentCulture].currency.spaceSeparated) {\n decimalSeparator = ' ' + decimalSeparator + ' ';\n }\n } else if (cultures[currentCulture].currency.spaceSeparated) {\n space = ' ';\n }\n } else {\n // check for space before or after currency\n if (format.indexOf(' $') > -1) {\n space = ' ';\n format = format.replace(' $', '');\n } else if (format.indexOf('$ ') > -1) {\n space = ' ';\n format = format.replace('$ ', '');\n } else {\n format = format.replace('$', '');\n }\n }\n\n // Format The Number\n output = formatNumber(n._value, format, roundingFunction, decimalSeparator);\n\n if (originalFormat.indexOf('$') === -1) {\n // Use defaults instead of the format provided\n switch (cultures[currentCulture].currency.position) {\n case 'postfix':\n if (output.indexOf(')') > -1) {\n output = output.split('');\n output.splice(-1, 0, space + currencySymbol);\n output = output.join('');\n } else {\n output = output + space + currencySymbol;\n }\n break;\n case 'infix':\n break;\n case 'prefix':\n if (output.indexOf('(') > -1 || output.indexOf('-') > -1) {\n output = output.split('');\n spliceIndex = Math.max(openParenIndex, minusSignIndex) + 1;\n\n output.splice(spliceIndex, 0, currencySymbol + space);\n output = output.join('');\n } else {\n output = currencySymbol + space + output;\n }\n break;\n default:\n throw Error('Currency position should be among [\"prefix\", \"infix\", \"postfix\"]');\n }\n } else {\n // position the symbol\n if (symbolIndex <= 1) {\n if (output.indexOf('(') > -1 || output.indexOf('+') > -1 || output.indexOf('-') > -1) {\n output = output.split('');\n spliceIndex = 1;\n if (symbolIndex < openParenIndex || symbolIndex < plusSignIndex || symbolIndex < minusSignIndex) {\n // the symbol appears before the \"(\", \"+\" or \"-\"\n spliceIndex = 0;\n }\n output.splice(spliceIndex, 0, currencySymbol + space);\n output = output.join('');\n } else {\n output = currencySymbol + space + output;\n }\n } else {\n if (output.indexOf(')') > -1) {\n output = output.split('');\n output.splice(-1, 0, space + currencySymbol);\n output = output.join('');\n } else {\n output = output + space + currencySymbol;\n }\n }\n }\n\n return output;\n }\n\n function formatForeignCurrency(n, foreignCurrencySymbol, originalFormat, roundingFunction) {\n return formatCurrency(n, foreignCurrencySymbol, originalFormat, roundingFunction);\n }\n\n function formatPercentage(n, format, roundingFunction) {\n var space = '',\n output,\n value = n._value * 100;\n\n // check for space before %\n if (format.indexOf(' %') > -1) {\n space = ' ';\n format = format.replace(' %', '');\n } else {\n format = format.replace('%', '');\n }\n\n output = formatNumber(value, format, roundingFunction);\n\n if (output.indexOf(')') > -1) {\n output = output.split('');\n output.splice(-1, 0, space + '%');\n output = output.join('');\n } else {\n output = output + space + '%';\n }\n\n return output;\n }\n\n function formatTime(n) {\n var hours = Math.floor(n._value / 60 / 60),\n minutes = Math.floor((n._value - (hours * 60 * 60)) / 60),\n seconds = Math.round(n._value - (hours * 60 * 60) - (minutes * 60));\n return hours + ':' +\n ((minutes < 10) ? '0' + minutes : minutes) + ':' +\n ((seconds < 10) ? '0' + seconds : seconds);\n }\n\n function unformatTime(string) {\n var timeArray = string.split(':'),\n seconds = 0;\n // turn hours and minutes into seconds and add them all up\n if (timeArray.length === 3) {\n // hours\n seconds = seconds + (Number(timeArray[0]) * 60 * 60);\n // minutes\n seconds = seconds + (Number(timeArray[1]) * 60);\n // seconds\n seconds = seconds + Number(timeArray[2]);\n } else if (timeArray.length === 2) {\n // minutes\n seconds = seconds + (Number(timeArray[0]) * 60);\n // seconds\n seconds = seconds + Number(timeArray[1]);\n }\n return Number(seconds);\n }\n\n function formatByteUnits (value, suffixes, scale) {\n var suffix = suffixes[0],\n power,\n min,\n max,\n abs = Math.abs(value);\n\n if (abs >= scale) {\n for (power = 1; power < suffixes.length; ++power) {\n min = Math.pow(scale, power);\n max = Math.pow(scale, power + 1);\n\n if (abs >= min && abs < max) {\n suffix = suffixes[power];\n value = value / min;\n break;\n }\n }\n\n // values greater than or equal to [scale] YB never set the suffix\n if (suffix === suffixes[0]) {\n value = value / Math.pow(scale, suffixes.length - 1);\n suffix = suffixes[suffixes.length - 1];\n }\n }\n\n return { value: value, suffix: suffix };\n }\n\n function formatNumber (value, format, roundingFunction, sep) {\n var negP = false,\n signed = false,\n optDec = false,\n abbr = '',\n abbrK = false, // force abbreviation to thousands\n abbrM = false, // force abbreviation to millions\n abbrB = false, // force abbreviation to billions\n abbrT = false, // force abbreviation to trillions\n abbrForce = false, // force abbreviation\n bytes = '',\n byteFormat,\n units,\n ord = '',\n abs = Math.abs(value),\n totalLength,\n length,\n minimumPrecision,\n pow,\n w,\n intPrecision,\n precision,\n prefix,\n postfix,\n thousands,\n d = '',\n forcedNeg = false,\n neg = false,\n indexOpenP,\n size,\n indexMinus,\n paren = '',\n minlen,\n i;\n\n // check if number is zero and a custom zero format has been set\n if (value === 0 && zeroFormat !== null) {\n return zeroFormat;\n }\n\n if (!isFinite(value)) {\n return '' + value;\n }\n\n if (format.indexOf('{') === 0) {\n var end = format.indexOf('}');\n if (end === -1) {\n throw Error('Format should also contain a \"}\"');\n }\n prefix = format.slice(1, end);\n format = format.slice(end + 1);\n } else {\n prefix = '';\n }\n\n if (format.indexOf('}') === format.length - 1) {\n var start = format.indexOf('{');\n if (start === -1) {\n throw Error('Format should also contain a \"{\"');\n }\n postfix = format.slice(start + 1, -1);\n format = format.slice(0, start + 1);\n } else {\n postfix = '';\n }\n\n // check for min length\n var info;\n if (format.indexOf('.') === -1) {\n info = format.match(/([0-9]+).*/);\n } else {\n info = format.match(/([0-9]+)\\..*/);\n }\n minlen = info === null ? -1 : info[1].length;\n\n // see if we should use parentheses for negative number or if we should prefix with a sign\n // if both are present we default to parentheses\n if (format.indexOf('-') !== -1) {\n forcedNeg = true;\n }\n if (format.indexOf('(') > -1) {\n negP = true;\n format = format.slice(1, -1);\n } else if (format.indexOf('+') > -1) {\n signed = true;\n format = format.replace(/\\+/g, '');\n }\n\n // see if abbreviation is wanted\n if (format.indexOf('a') > -1) {\n intPrecision = format.split('.')[0].match(/[0-9]+/g) || ['0'];\n intPrecision = parseInt(intPrecision[0], 10);\n\n // check if abbreviation is specified\n abbrK = format.indexOf('aK') >= 0;\n abbrM = format.indexOf('aM') >= 0;\n abbrB = format.indexOf('aB') >= 0;\n abbrT = format.indexOf('aT') >= 0;\n abbrForce = abbrK || abbrM || abbrB || abbrT;\n\n // check for space before abbreviation\n if (format.indexOf(' a') > -1) {\n abbr = ' ';\n format = format.replace(' a', '');\n } else {\n format = format.replace('a', '');\n }\n\n totalLength = Math.floor(Math.log(abs) / Math.LN10) + 1;\n\n minimumPrecision = totalLength % 3;\n minimumPrecision = minimumPrecision === 0 ? 3 : minimumPrecision;\n\n if (intPrecision && abs !== 0) {\n\n length = Math.floor(Math.log(abs) / Math.LN10) + 1 - intPrecision;\n\n pow = 3 * ~~((Math.min(intPrecision, totalLength) - minimumPrecision) / 3);\n\n abs = abs / Math.pow(10, pow);\n\n if (format.indexOf('.') === -1 && intPrecision > 3) {\n format += '[.]';\n\n size = length === 0 ? 0 : 3 * ~~(length / 3) - length;\n size = size < 0 ? size + 3 : size;\n\n format += zeroes(size);\n }\n }\n\n if (Math.floor(Math.log(Math.abs(value)) / Math.LN10) + 1 !== intPrecision) {\n if (abs >= Math.pow(10, 12) && !abbrForce || abbrT) {\n // trillion\n abbr = abbr + cultures[currentCulture].abbreviations.trillion;\n value = value / Math.pow(10, 12);\n } else if (abs < Math.pow(10, 12) && abs >= Math.pow(10, 9) && !abbrForce || abbrB) {\n // billion\n abbr = abbr + cultures[currentCulture].abbreviations.billion;\n value = value / Math.pow(10, 9);\n } else if (abs < Math.pow(10, 9) && abs >= Math.pow(10, 6) && !abbrForce || abbrM) {\n // million\n abbr = abbr + cultures[currentCulture].abbreviations.million;\n value = value / Math.pow(10, 6);\n } else if (abs < Math.pow(10, 6) && abs >= Math.pow(10, 3) && !abbrForce || abbrK) {\n // thousand\n abbr = abbr + cultures[currentCulture].abbreviations.thousand;\n value = value / Math.pow(10, 3);\n }\n }\n }\n\n // see if we are formatting\n // binary-decimal bytes (1024 MB), binary bytes (1024 MiB), or decimal bytes (1000 MB)\n for (i = 0; i < byteFormatOrder.length; ++i) {\n byteFormat = byteFormatOrder[i];\n\n if (format.indexOf(byteFormat.marker) > -1) {\n // check for space before\n if (format.indexOf(' ' + byteFormat.marker) >-1) {\n bytes = ' ';\n }\n\n // remove the marker (with the space if it had one)\n format = format.replace(bytes + byteFormat.marker, '');\n\n units = formatByteUnits(value, byteFormat.suffixes, byteFormat.scale);\n\n value = units.value;\n bytes = bytes + units.suffix;\n\n break;\n }\n }\n\n // see if ordinal is wanted\n if (format.indexOf('o') > -1) {\n // check for space before\n if (format.indexOf(' o') > -1) {\n ord = ' ';\n format = format.replace(' o', '');\n } else {\n format = format.replace('o', '');\n }\n\n if (cultures[currentCulture].ordinal) {\n ord = ord + cultures[currentCulture].ordinal(value);\n }\n }\n\n if (format.indexOf('[.]') > -1) {\n optDec = true;\n format = format.replace('[.]', '.');\n }\n\n w = value.toString().split('.')[0];\n precision = format.split('.')[1];\n thousands = format.indexOf(',');\n\n if (precision) {\n if (precision.indexOf('*') !== -1) {\n d = toFixed(value, value.toString().split('.')[1].length, roundingFunction);\n } else {\n if (precision.indexOf('[') > -1) {\n precision = precision.replace(']', '');\n precision = precision.split('[');\n d = toFixed(value, (precision[0].length + precision[1].length), roundingFunction,\n precision[1].length);\n } else {\n d = toFixed(value, precision.length, roundingFunction);\n }\n }\n\n w = d.split('.')[0];\n\n if (d.split('.')[1].length) {\n var p = sep ? abbr + sep : cultures[currentCulture].delimiters.decimal;\n d = p + d.split('.')[1];\n } else {\n d = '';\n }\n\n if (optDec && Number(d.slice(1)) === 0) {\n d = '';\n }\n } else {\n w = toFixed(value, 0, roundingFunction);\n }\n\n // format number\n if (w.indexOf('-') > -1) {\n w = w.slice(1);\n neg = true;\n }\n\n if (w.length < minlen) {\n w = zeroes(minlen - w.length) + w;\n }\n\n if (thousands > -1) {\n w = w.toString().replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, '$1' +\n cultures[currentCulture].delimiters.thousands);\n }\n\n if (format.indexOf('.') === 0) {\n w = '';\n }\n\n indexOpenP = format.indexOf('(');\n indexMinus = format.indexOf('-');\n\n if (indexOpenP < indexMinus) {\n paren = ((negP && neg) ? '(' : '') + (((forcedNeg && neg) || (!negP && neg)) ? '-' : '');\n } else {\n paren = (((forcedNeg && neg) || (!negP && neg)) ? '-' : '') + ((negP && neg) ? '(' : '');\n }\n\n return prefix +\n paren + ((!neg && signed && value !== 0) ? '+' : '') +\n w + d +\n ((ord) ? ord : '') +\n ((abbr && !sep) ? abbr : '') +\n ((bytes) ? bytes : '') +\n ((negP && neg) ? ')' : '') +\n postfix;\n }\n\n /************************************\n Top Level Functions\n ************************************/\n\n numbro = function(input) {\n if (numbro.isNumbro(input)) {\n input = input.value();\n } else if (input === 0 || typeof input === 'undefined') {\n input = 0;\n } else if (!Number(input)) {\n input = numbro.fn.unformat(input);\n }\n\n return new Numbro(Number(input));\n };\n\n // version number\n numbro.version = VERSION;\n\n // compare numbro object\n numbro.isNumbro = function(obj) {\n return obj instanceof Numbro;\n };\n\n /**\n * This function allow the user to set a new language with a fallback if\n * the language does not exist. If no fallback language is provided,\n * it fallbacks to english.\n *\n * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n * `setCulture` should be used instead.\n */\n numbro.setLanguage = function(newLanguage, fallbackLanguage) {\n console.warn('`setLanguage` is deprecated since version 1.6.0. Use `setCulture` instead');\n var key = newLanguage,\n prefix = newLanguage.split('-')[0],\n matchingLanguage = null;\n if (!languages[key]) {\n Object.keys(languages).forEach(function(language) {\n if (!matchingLanguage && language.split('-')[0] === prefix) {\n matchingLanguage = language;\n }\n });\n key = matchingLanguage || fallbackLanguage || 'en-US';\n }\n chooseCulture(key);\n };\n\n /**\n * This function allow the user to set a new culture with a fallback if\n * the culture does not exist. If no fallback culture is provided,\n * it falls back to \"en-US\".\n */\n numbro.setCulture = function(newCulture, fallbackCulture) {\n var key = newCulture,\n suffix = newCulture.split('-')[1],\n matchingCulture = null;\n if (!cultures[key]) {\n if (suffix) {\n Object.keys(cultures).forEach(function(language) {\n if (!matchingCulture && language.split('-')[1] === suffix) {\n matchingCulture = language;\n }\n });\n }\n\n key = matchingCulture || fallbackCulture || 'en-US';\n }\n chooseCulture(key);\n };\n\n /**\n * This function will load languages and then set the global language. If\n * no arguments are passed in, it will simply return the current global\n * language key.\n *\n * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n * `culture` should be used instead.\n */\n numbro.language = function(key, values) {\n console.warn('`language` is deprecated since version 1.6.0. Use `culture` instead');\n\n if (!key) {\n return currentCulture;\n }\n\n if (key && !values) {\n if (!languages[key]) {\n throw new Error('Unknown language : ' + key);\n }\n chooseCulture(key);\n }\n\n if (values || !languages[key]) {\n setCulture(key, values);\n }\n\n return numbro;\n };\n\n /**\n * This function will load cultures and then set the global culture. If\n * no arguments are passed in, it will simply return the current global\n * culture code.\n */\n numbro.culture = function(code, values) {\n if (!code) {\n return currentCulture;\n }\n\n if (code && !values) {\n if (!cultures[code]) {\n throw new Error('Unknown culture : ' + code);\n }\n chooseCulture(code);\n }\n\n if (values || !cultures[code]) {\n setCulture(code, values);\n }\n\n return numbro;\n };\n\n /**\n * This function provides access to the loaded language data. If\n * no arguments are passed in, it will simply return the current\n * global language object.\n *\n * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n * `culture` should be used instead.\n */\n numbro.languageData = function(key) {\n console.warn('`languageData` is deprecated since version 1.6.0. Use `cultureData` instead');\n\n if (!key) {\n return languages[currentCulture];\n }\n\n if (!languages[key]) {\n throw new Error('Unknown language : ' + key);\n }\n\n return languages[key];\n };\n\n /**\n * This function provides access to the loaded culture data. If\n * no arguments are passed in, it will simply return the current\n * global culture object.\n */\n numbro.cultureData = function(code) {\n if (!code) {\n return cultures[currentCulture];\n }\n\n if (!cultures[code]) {\n throw new Error('Unknown culture : ' + code);\n }\n\n return cultures[code];\n };\n\n numbro.culture('en-US', enUS);\n\n /**\n * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n * `cultures` should be used instead.\n */\n numbro.languages = function() {\n console.warn('`languages` is deprecated since version 1.6.0. Use `cultures` instead');\n\n return languages;\n };\n\n numbro.cultures = function() {\n return cultures;\n };\n\n numbro.zeroFormat = function(format) {\n zeroFormat = typeof(format) === 'string' ? format : null;\n };\n\n numbro.defaultFormat = function(format) {\n defaultFormat = typeof(format) === 'string' ? format : '0.0';\n };\n\n numbro.defaultCurrencyFormat = function (format) {\n defaultCurrencyFormat = typeof(format) === 'string' ? format : '0$';\n };\n\n numbro.validate = function(val, culture) {\n\n var _decimalSep,\n _thousandSep,\n _currSymbol,\n _valArray,\n _abbrObj,\n _thousandRegEx,\n cultureData,\n temp;\n\n //coerce val to string\n if (typeof val !== 'string') {\n val += '';\n if (console.warn) {\n console.warn('Numbro.js: Value is not string. It has been co-erced to: ', val);\n }\n }\n\n //trim whitespaces from either sides\n val = val.trim();\n\n //replace the initial '+' or '-' sign if present\n val = val.replace(/^[+-]?/, '');\n\n //if val is just digits return true\n if ( !! val.match(/^\\d+$/)) {\n return true;\n }\n\n //if val is empty return false\n if (val === '') {\n return false;\n }\n\n //get the decimal and thousands separator from numbro.cultureData\n try {\n //check if the culture is understood by numbro. if not, default it to current culture\n cultureData = numbro.cultureData(culture);\n } catch (e) {\n cultureData = numbro.cultureData(numbro.culture());\n }\n\n //setup the delimiters and currency symbol based on culture\n _currSymbol = cultureData.currency.symbol;\n _abbrObj = cultureData.abbreviations;\n _decimalSep = cultureData.delimiters.decimal;\n if (cultureData.delimiters.thousands === '.') {\n _thousandSep = '\\\\.';\n } else {\n _thousandSep = cultureData.delimiters.thousands;\n }\n\n // validating currency symbol\n temp = val.match(/^[^\\d\\.\\,]+/);\n if (temp !== null) {\n val = val.substr(1);\n if (temp[0] !== _currSymbol) {\n return false;\n }\n }\n\n //validating abbreviation symbol\n temp = val.match(/[^\\d]+$/);\n if (temp !== null) {\n val = val.slice(0, -1);\n if (temp[0] !== _abbrObj.thousand && temp[0] !== _abbrObj.million &&\n temp[0] !== _abbrObj.billion && temp[0] !== _abbrObj.trillion) {\n return false;\n }\n }\n\n _thousandRegEx = new RegExp(_thousandSep + '{2}');\n\n if (!val.match(/[^\\d.,]/g)) {\n _valArray = val.split(_decimalSep);\n if (_valArray.length > 2) {\n return false;\n } else {\n if (_valArray.length < 2) {\n return ( !! _valArray[0].match(/^\\d+.*\\d$/) && !_valArray[0].match(_thousandRegEx));\n } else {\n if (_valArray[0] === '') {\n // for values without leading zero eg. .984\n return (!_valArray[0].match(_thousandRegEx) &&\n !!_valArray[1].match(/^\\d+$/));\n\n } else if (_valArray[0].length === 1) {\n return ( !! _valArray[0].match(/^\\d+$/) &&\n !_valArray[0].match(_thousandRegEx) &&\n !! _valArray[1].match(/^\\d+$/));\n } else {\n return ( !! _valArray[0].match(/^\\d+.*\\d$/) &&\n !_valArray[0].match(_thousandRegEx) &&\n !! _valArray[1].match(/^\\d+$/));\n }\n }\n }\n }\n\n return false;\n };\n\n /**\n * * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n * `loadCulturesInNode` should be used instead.\n */\n numbro.loadLanguagesInNode = function() {\n console.warn('`loadLanguagesInNode` is deprecated since version 1.6.0. Use `loadCulturesInNode` instead');\n\n numbro.loadCulturesInNode();\n };\n\n numbro.loadCulturesInNode = function() {\n // TODO: Rename the folder in 2.0.0\n var cultures = require('./languages');\n\n for(var langLocaleCode in cultures) {\n if(langLocaleCode) {\n numbro.culture(langLocaleCode, cultures[langLocaleCode]);\n }\n }\n };\n\n /************************************\n Helpers\n ************************************/\n\n function setCulture(code, values) {\n cultures[code] = values;\n }\n\n function chooseCulture(code) {\n currentCulture = code;\n var defaults = cultures[code].defaults;\n if (defaults && defaults.format) {\n numbro.defaultFormat(defaults.format);\n }\n if (defaults && defaults.currencyFormat) {\n numbro.defaultCurrencyFormat(defaults.currencyFormat);\n }\n }\n\n function inNodejsRuntime() {\n return (typeof process !== 'undefined') &&\n (process.browser === undefined) &&\n process.title &&\n (\n process.title.indexOf('node') === 0 ||\n process.title.indexOf('meteor-tool') > 0 ||\n process.title === 'grunt' ||\n process.title === 'gulp'\n ) &&\n (typeof require !== 'undefined');\n }\n\n /************************************\n Floating-point helpers\n ************************************/\n\n // The floating-point helper functions and implementation\n // borrows heavily from sinful.js: http://guipn.github.io/sinful.js/\n\n /**\n * Array.prototype.reduce for browsers that don't support it\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce#Compatibility\n */\n if ('function' !== typeof Array.prototype.reduce) {\n Array.prototype.reduce = function(callback, optInitialValue) {\n\n if (null === this || 'undefined' === typeof this) {\n // At the moment all modern browsers, that support strict mode, have\n // native implementation of Array.prototype.reduce. For instance, IE8\n // does not support strict mode, so this check is actually useless.\n throw new TypeError('Array.prototype.reduce called on null or undefined');\n }\n\n if ('function' !== typeof callback) {\n throw new TypeError(callback + ' is not a function');\n }\n\n var index,\n value,\n length = this.length >>> 0,\n isValueSet = false;\n\n if (1 < arguments.length) {\n value = optInitialValue;\n isValueSet = true;\n }\n\n for (index = 0; length > index; ++index) {\n if (this.hasOwnProperty(index)) {\n if (isValueSet) {\n value = callback(value, this[index], index, this);\n } else {\n value = this[index];\n isValueSet = true;\n }\n }\n }\n\n if (!isValueSet) {\n throw new TypeError('Reduce of empty array with no initial value');\n }\n\n return value;\n };\n }\n\n\n /**\n * Computes the multiplier necessary to make x >= 1,\n * effectively eliminating miscalculations caused by\n * finite precision.\n */\n function multiplier(x) {\n var parts = x.toString().split('.');\n if (parts.length < 2) {\n return 1;\n }\n return Math.pow(10, parts[1].length);\n }\n\n /**\n * Given a variable number of arguments, returns the maximum\n * multiplier that must be used to normalize an operation involving\n * all of them.\n */\n function correctionFactor() {\n var args = Array.prototype.slice.call(arguments);\n return args.reduce(function(prev, next) {\n var mp = multiplier(prev),\n mn = multiplier(next);\n return mp > mn ? mp : mn;\n }, -Infinity);\n }\n\n /************************************\n Numbro Prototype\n ************************************/\n\n\n numbro.fn = Numbro.prototype = {\n\n clone: function() {\n return numbro(this);\n },\n\n format: function(inputString, roundingFunction) {\n return formatNumbro(this,\n inputString ? inputString : defaultFormat,\n (roundingFunction !== undefined) ? roundingFunction : Math.round\n );\n },\n\n formatCurrency: function(inputString, roundingFunction) {\n return formatCurrency(this,\n cultures[currentCulture].currency.symbol,\n inputString ? inputString : defaultCurrencyFormat,\n (roundingFunction !== undefined) ? roundingFunction : Math.round\n );\n },\n\n formatForeignCurrency: function(currencySymbol, inputString, roundingFunction) {\n return formatForeignCurrency(this,\n currencySymbol,\n inputString ? inputString : defaultCurrencyFormat,\n (roundingFunction !== undefined) ? roundingFunction : Math.round\n );\n },\n\n unformat: function(inputString) {\n if (typeof inputString === 'number') {\n return inputString;\n } else if (typeof inputString === 'string') {\n var result = unformatNumbro(this, inputString);\n\n // Any unparseable string (represented as NaN in the result) is\n // converted into undefined.\n return isNaN(result) ? undefined : result;\n } else {\n return undefined;\n }\n },\n\n binaryByteUnits: function() {\n return formatByteUnits(this._value, bytes.binary.suffixes, bytes.binary.scale).suffix;\n },\n\n byteUnits: function() {\n return formatByteUnits(this._value, bytes.general.suffixes, bytes.general.scale).suffix;\n },\n\n decimalByteUnits: function() {\n return formatByteUnits(this._value, bytes.decimal.suffixes, bytes.decimal.scale).suffix;\n },\n\n value: function() {\n return this._value;\n },\n\n valueOf: function() {\n return this._value;\n },\n\n set: function(value) {\n this._value = Number(value);\n return this;\n },\n\n add: function(value) {\n var corrFactor = correctionFactor.call(null, this._value, value);\n\n function cback(accum, curr) {\n return accum + corrFactor * curr;\n }\n this._value = [this._value, value].reduce(cback, 0) / corrFactor;\n return this;\n },\n\n subtract: function(value) {\n var corrFactor = correctionFactor.call(null, this._value, value);\n\n function cback(accum, curr) {\n return accum - corrFactor * curr;\n }\n this._value = [value].reduce(cback, this._value * corrFactor) / corrFactor;\n return this;\n },\n\n multiply: function(value) {\n function cback(accum, curr) {\n var corrFactor = correctionFactor(accum, curr),\n result = accum * corrFactor;\n result *= curr * corrFactor;\n result /= corrFactor * corrFactor;\n return result;\n }\n this._value = [this._value, value].reduce(cback, 1);\n return this;\n },\n\n divide: function(value) {\n function cback(accum, curr) {\n var corrFactor = correctionFactor(accum, curr);\n return (accum * corrFactor) / (curr * corrFactor);\n }\n this._value = [this._value, value].reduce(cback);\n return this;\n },\n\n difference: function(value) {\n return Math.abs(numbro(this._value).subtract(value).value());\n }\n\n };\n\n /************************************\n Exposing Numbro\n ************************************/\n\n if (inNodejsRuntime()) {\n //Todo: Rename the folder in 2.0.0\n numbro.loadCulturesInNode();\n }\n\n // CommonJS module is defined\n if (hasModule) {\n module.exports = numbro;\n } else {\n /*global ender:false */\n if (typeof ender === 'undefined') {\n // here, `this` means `window` in the browser, or `global` on the server\n // add `numbro` as a global object via a string identifier,\n // for Closure Compiler 'advanced' mode\n this.numbro = numbro;\n }\n\n /*global define:false */\n if (typeof define === 'function' && define.amd) {\n define([], function() {\n return numbro;\n });\n }\n }\n\n}.call(typeof window === 'undefined' ? this : window));\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/numbro/numbro.js\n ** module id = 19\n ** module chunks = 0\n **/","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/process/browser.js\n ** module id = 20\n ** module chunks = 0\n **/","// empty (null-loader)\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/numbro/languages/index.js\n ** module id = 21\n ** module chunks = 0\n **/","this.j$ = this.jStat = (function(Math, undefined) {\n\n// For quick reference.\nvar concat = Array.prototype.concat;\nvar slice = Array.prototype.slice;\nvar toString = Object.prototype.toString;\n\n// Calculate correction for IEEE error\n// TODO: This calculation can be improved.\nfunction calcRdx(n, m) {\n var val = n > m ? n : m;\n return Math.pow(10,\n 17 - ~~(Math.log(((val > 0) ? val : -val)) * Math.LOG10E));\n}\n\n\nvar isArray = Array.isArray || function isArray(arg) {\n return toString.call(arg) === '[object Array]';\n};\n\n\nfunction isFunction(arg) {\n return toString.call(arg) === '[object Function]';\n}\n\n\nfunction isNumber(arg) {\n return typeof arg === 'number' && arg === arg;\n}\n\n\n// Converts the jStat matrix to vector.\nfunction toVector(arr) {\n return concat.apply([], arr);\n}\n\n\n// The one and only jStat constructor.\nfunction jStat() {\n return new jStat._init(arguments);\n}\n\n\n// TODO: Remove after all references in src files have been removed.\njStat.fn = jStat.prototype;\n\n\n// By separating the initializer from the constructor it's easier to handle\n// always returning a new instance whether \"new\" was used or not.\njStat._init = function _init(args) {\n var i;\n\n // If first argument is an array, must be vector or matrix.\n if (isArray(args[0])) {\n // Check if matrix.\n if (isArray(args[0][0])) {\n // See if a mapping function was also passed.\n if (isFunction(args[1]))\n args[0] = jStat.map(args[0], args[1]);\n // Iterate over each is faster than this.push.apply(this, args[0].\n for (var i = 0; i < args[0].length; i++)\n this[i] = args[0][i];\n this.length = args[0].length;\n\n // Otherwise must be a vector.\n } else {\n this[0] = isFunction(args[1]) ? jStat.map(args[0], args[1]) : args[0];\n this.length = 1;\n }\n\n // If first argument is number, assume creation of sequence.\n } else if (isNumber(args[0])) {\n this[0] = jStat.seq.apply(null, args);\n this.length = 1;\n\n // Handle case when jStat object is passed to jStat.\n } else if (args[0] instanceof jStat) {\n // Duplicate the object and pass it back.\n return jStat(args[0].toArray());\n\n // Unexpected argument value, return empty jStat object.\n // TODO: This is strange behavior. Shouldn't this throw or some such to let\n // the user know they had bad arguments?\n } else {\n this[0] = [];\n this.length = 1;\n }\n\n return this;\n};\njStat._init.prototype = jStat.prototype;\njStat._init.constructor = jStat;\n\n\n// Utility functions.\n// TODO: for internal use only?\njStat.utils = {\n calcRdx: calcRdx,\n isArray: isArray,\n isFunction: isFunction,\n isNumber: isNumber,\n toVector: toVector\n};\n\n\n// Easily extend the jStat object.\n// TODO: is this seriously necessary?\njStat.extend = function extend(obj) {\n var i, j;\n\n if (arguments.length === 1) {\n for (j in obj)\n jStat[j] = obj[j];\n return this;\n }\n\n for (var i = 1; i < arguments.length; i++) {\n for (j in arguments[i])\n obj[j] = arguments[i][j];\n }\n\n return obj;\n};\n\n\n// Returns the number of rows in the matrix.\njStat.rows = function rows(arr) {\n return arr.length || 1;\n};\n\n\n// Returns the number of columns in the matrix.\njStat.cols = function cols(arr) {\n return arr[0].length || 1;\n};\n\n\n// Returns the dimensions of the object { rows: i, cols: j }\njStat.dimensions = function dimensions(arr) {\n return {\n rows: jStat.rows(arr),\n cols: jStat.cols(arr)\n };\n};\n\n\n// Returns a specified row as a vector or return a sub matrix by pick some rows\njStat.row = function row(arr, index) {\n if (isArray(index)) {\n return index.map(function(i) {\n return jStat.row(arr, i);\n })\n }\n return arr[index];\n};\n\n\n// return row as array\n// rowa([[1,2],[3,4]],0) -> [1,2]\njStat.rowa = function rowa(arr, i) {\n return jStat.row(arr, i);\n};\n\n\n// Returns the specified column as a vector or return a sub matrix by pick some\n// columns\njStat.col = function col(arr, index) {\n if (isArray(index)) {\n var submat = jStat.arange(arr.length).map(function(i) {\n return new Array(index.length);\n });\n index.forEach(function(ind, i){\n jStat.arange(arr.length).forEach(function(j) {\n submat[j][i] = arr[j][ind];\n });\n });\n return submat;\n }\n var column = new Array(arr.length);\n for (var i = 0; i < arr.length; i++)\n column[i] = [arr[i][index]];\n return column;\n};\n\n\n// return column as array\n// cola([[1,2],[3,4]],0) -> [1,3]\njStat.cola = function cola(arr, i) {\n return jStat.col(arr, i).map(function(a){ return a[0] });\n};\n\n\n// Returns the diagonal of the matrix\njStat.diag = function diag(arr) {\n var nrow = jStat.rows(arr);\n var res = new Array(nrow);\n for (var row = 0; row < nrow; row++)\n res[row] = [arr[row][row]];\n return res;\n};\n\n\n// Returns the anti-diagonal of the matrix\njStat.antidiag = function antidiag(arr) {\n var nrow = jStat.rows(arr) - 1;\n var res = new Array(nrow);\n for (var i = 0; nrow >= 0; nrow--, i++)\n res[i] = [arr[i][nrow]];\n return res;\n};\n\n// Transpose a matrix or array.\njStat.transpose = function transpose(arr) {\n var obj = [];\n var objArr, rows, cols, j, i;\n\n // Make sure arr is in matrix format.\n if (!isArray(arr[0]))\n arr = [arr];\n\n rows = arr.length;\n cols = arr[0].length;\n\n for (var i = 0; i < cols; i++) {\n objArr = new Array(rows);\n for (j = 0; j < rows; j++)\n objArr[j] = arr[j][i];\n obj.push(objArr);\n }\n\n // If obj is vector, return only single array.\n return obj.length === 1 ? obj[0] : obj;\n};\n\n\n// Map a function to an array or array of arrays.\n// \"toAlter\" is an internal variable.\njStat.map = function map(arr, func, toAlter) {\n var row, nrow, ncol, res, col;\n\n if (!isArray(arr[0]))\n arr = [arr];\n\n nrow = arr.length;\n ncol = arr[0].length;\n res = toAlter ? arr : new Array(nrow);\n\n for (row = 0; row < nrow; row++) {\n // if the row doesn't exist, create it\n if (!res[row])\n res[row] = new Array(ncol);\n for (col = 0; col < ncol; col++)\n res[row][col] = func(arr[row][col], row, col);\n }\n\n return res.length === 1 ? res[0] : res;\n};\n\n\n// Cumulatively combine the elements of an array or array of arrays using a function.\njStat.cumreduce = function cumreduce(arr, func, toAlter) {\n var row, nrow, ncol, res, col;\n\n if (!isArray(arr[0]))\n arr = [arr];\n\n nrow = arr.length;\n ncol = arr[0].length;\n res = toAlter ? arr : new Array(nrow);\n\n for (row = 0; row < nrow; row++) {\n // if the row doesn't exist, create it\n if (!res[row])\n res[row] = new Array(ncol);\n if (ncol > 0)\n res[row][0] = arr[row][0];\n for (col = 1; col < ncol; col++)\n res[row][col] = func(res[row][col-1], arr[row][col]);\n }\n return res.length === 1 ? res[0] : res;\n};\n\n\n// Destructively alter an array.\njStat.alter = function alter(arr, func) {\n return jStat.map(arr, func, true);\n};\n\n\n// Generate a rows x cols matrix according to the supplied function.\njStat.create = function create(rows, cols, func) {\n var res = new Array(rows);\n var i, j;\n\n if (isFunction(cols)) {\n func = cols;\n cols = rows;\n }\n\n for (var i = 0; i < rows; i++) {\n res[i] = new Array(cols);\n for (j = 0; j < cols; j++)\n res[i][j] = func(i, j);\n }\n\n return res;\n};\n\n\nfunction retZero() { return 0; }\n\n\n// Generate a rows x cols matrix of zeros.\njStat.zeros = function zeros(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, retZero);\n};\n\n\nfunction retOne() { return 1; }\n\n\n// Generate a rows x cols matrix of ones.\njStat.ones = function ones(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, retOne);\n};\n\n\n// Generate a rows x cols matrix of uniformly random numbers.\njStat.rand = function rand(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, Math.random);\n};\n\n\nfunction retIdent(i, j) { return i === j ? 1 : 0; }\n\n\n// Generate an identity matrix of size row x cols.\njStat.identity = function identity(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, retIdent);\n};\n\n\n// Tests whether a matrix is symmetric\njStat.symmetric = function symmetric(arr) {\n var issymmetric = true;\n var size = arr.length;\n var row, col;\n\n if (arr.length !== arr[0].length)\n return false;\n\n for (row = 0; row < size; row++) {\n for (col = 0; col < size; col++)\n if (arr[col][row] !== arr[row][col])\n return false;\n }\n\n return true;\n};\n\n\n// Set all values to zero.\njStat.clear = function clear(arr) {\n return jStat.alter(arr, retZero);\n};\n\n\n// Generate sequence.\njStat.seq = function seq(min, max, length, func) {\n if (!isFunction(func))\n func = false;\n\n var arr = [];\n var hival = calcRdx(min, max);\n var step = (max * hival - min * hival) / ((length - 1) * hival);\n var current = min;\n var cnt;\n\n // Current is assigned using a technique to compensate for IEEE error.\n // TODO: Needs better implementation.\n for (cnt = 0;\n current <= max;\n cnt++, current = (min * hival + step * hival * cnt) / hival) {\n arr.push((func ? func(current, cnt) : current));\n }\n\n return arr;\n};\n\n\n// arange(5) -> [0,1,2,3,4]\n// arange(1,5) -> [1,2,3,4]\n// arange(5,1,-1) -> [5,4,3,2]\njStat.arange = function arange(start, end, step) {\n var rl = [];\n step = step || 1;\n if (end === undefined) {\n end = start;\n start = 0;\n }\n if (start === end || step === 0) {\n return [];\n }\n if (start < end && step < 0) {\n return [];\n }\n if (start > end && step > 0) {\n return [];\n }\n if (step > 0) {\n for (i = start; i < end; i += step) {\n rl.push(i);\n }\n } else {\n for (i = start; i > end; i += step) {\n rl.push(i);\n }\n }\n return rl;\n};\n\n\n// A=[[1,2,3],[4,5,6],[7,8,9]]\n// slice(A,{row:{end:2},col:{start:1}}) -> [[2,3],[5,6]]\n// slice(A,1,{start:1}) -> [5,6]\n// as numpy code A[:2,1:]\njStat.slice = (function(){\n function _slice(list, start, end, step) {\n // note it's not equal to range.map mode it's a bug\n var i;\n var rl = [];\n var length = list.length;\n if (start === undefined && end === undefined && step === undefined) {\n return jStat.copy(list);\n }\n\n start = start || 0;\n end = end || list.length;\n start = start >= 0 ? start : length + start;\n end = end >= 0 ? end : length + end;\n step = step || 1;\n if (start === end || step === 0) {\n return [];\n }\n if (start < end && step < 0) {\n return [];\n }\n if (start > end && step > 0) {\n return [];\n }\n if (step > 0) {\n for (i = start; i < end; i += step) {\n rl.push(list[i]);\n }\n } else {\n for (i = start; i > end;i += step) {\n rl.push(list[i]);\n }\n }\n return rl;\n }\n\n function slice(list, rcSlice) {\n rcSlice = rcSlice || {};\n if (isNumber(rcSlice.row)) {\n if (isNumber(rcSlice.col))\n return list[rcSlice.row][rcSlice.col];\n var row = jStat.rowa(list, rcSlice.row);\n var colSlice = rcSlice.col || {};\n return _slice(row, colSlice.start, colSlice.end, colSlice.step);\n }\n\n if (isNumber(rcSlice.col)) {\n var col = jStat.cola(list, rcSlice.col);\n var rowSlice = rcSlice.row || {};\n return _slice(col, rowSlice.start, rowSlice.end, rowSlice.step);\n }\n\n var rowSlice = rcSlice.row || {};\n var colSlice = rcSlice.col || {};\n var rows = _slice(list, rowSlice.start, rowSlice.end, rowSlice.step);\n return rows.map(function(row) {\n return _slice(row, colSlice.start, colSlice.end, colSlice.step);\n });\n }\n\n return slice;\n}());\n\n\n// A=[[1,2,3],[4,5,6],[7,8,9]]\n// sliceAssign(A,{row:{start:1},col:{start:1}},[[0,0],[0,0]])\n// A=[[1,2,3],[4,0,0],[7,0,0]]\njStat.sliceAssign = function sliceAssign(A, rcSlice, B) {\n if (isNumber(rcSlice.row)) {\n if (isNumber(rcSlice.col))\n return A[rcSlice.row][rcSlice.col] = B;\n rcSlice.col = rcSlice.col || {};\n rcSlice.col.start = rcSlice.col.start || 0;\n rcSlice.col.end = rcSlice.col.end || A[0].length;\n rcSlice.col.step = rcSlice.col.step || 1;\n var nl = jStat.arange(rcSlice.col.start,\n Math.min(A.length, rcSlice.col.end),\n rcSlice.col.step);\n var m = rcSlice.row;\n nl.forEach(function(n, i) {\n A[m][n] = B[i];\n });\n return A;\n }\n\n if (isNumber(rcSlice.col)) {\n rcSlice.row = rcSlice.row || {};\n rcSlice.row.start = rcSlice.row.start || 0;\n rcSlice.row.end = rcSlice.row.end || A.length;\n rcSlice.row.step = rcSlice.row.step || 1;\n var ml = jStat.arange(rcSlice.row.start,\n Math.min(A[0].length, rcSlice.row.end),\n rcSlice.row.step);\n var n = rcSlice.col;\n ml.forEach(function(m, j) {\n A[m][n] = B[j];\n });\n return A;\n }\n\n if (B[0].length === undefined) {\n B = [B];\n }\n rcSlice.row.start = rcSlice.row.start || 0;\n rcSlice.row.end = rcSlice.row.end || A.length;\n rcSlice.row.step = rcSlice.row.step || 1;\n rcSlice.col.start = rcSlice.col.start || 0;\n rcSlice.col.end = rcSlice.col.end || A[0].length;\n rcSlice.col.step = rcSlice.col.step || 1;\n var ml = jStat.arange(rcSlice.row.start,\n Math.min(A.length, rcSlice.row.end),\n rcSlice.row.step);\n var nl = jStat.arange(rcSlice.col.start,\n Math.min(A[0].length, rcSlice.col.end),\n rcSlice.col.step);\n ml.forEach(function(m, i) {\n nl.forEach(function(n, j) {\n A[m][n] = B[i][j];\n });\n });\n return A;\n};\n\n\n// [1,2,3] ->\n// [[1,0,0],[0,2,0],[0,0,3]]\njStat.diagonal = function diagonal(diagArray) {\n var mat = jStat.zeros(diagArray.length, diagArray.length);\n diagArray.forEach(function(t, i) {\n mat[i][i] = t;\n });\n return mat;\n};\n\n\n// return copy of A\njStat.copy = function copy(A) {\n return A.map(function(row) {\n if (isNumber(row))\n return row;\n return row.map(function(t) {\n return t;\n });\n });\n};\n\n\n// TODO: Go over this entire implementation. Seems a tragic waste of resources\n// doing all this work. Instead, and while ugly, use new Function() to generate\n// a custom function for each static method.\n\n// Quick reference.\nvar jProto = jStat.prototype;\n\n// Default length.\njProto.length = 0;\n\n// For internal use only.\n// TODO: Check if they're actually used, and if they are then rename them\n// to _*\njProto.push = Array.prototype.push;\njProto.sort = Array.prototype.sort;\njProto.splice = Array.prototype.splice;\njProto.slice = Array.prototype.slice;\n\n\n// Return a clean array.\njProto.toArray = function toArray() {\n return this.length > 1 ? slice.call(this) : slice.call(this)[0];\n};\n\n\n// Map a function to a matrix or vector.\njProto.map = function map(func, toAlter) {\n return jStat(jStat.map(this, func, toAlter));\n};\n\n\n// Cumulatively combine the elements of a matrix or vector using a function.\njProto.cumreduce = function cumreduce(func, toAlter) {\n return jStat(jStat.cumreduce(this, func, toAlter));\n};\n\n\n// Destructively alter an array.\njProto.alter = function alter(func) {\n jStat.alter(this, func);\n return this;\n};\n\n\n// Extend prototype with methods that have no argument.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function(func) {\n var self = this,\n results;\n // Check for callback.\n if (func) {\n setTimeout(function() {\n func.call(self, jProto[passfunc].call(self));\n });\n return this;\n }\n results = jStat[passfunc](this);\n return isArray(results) ? jStat(results) : results;\n };\n })(funcs[i]);\n})('transpose clear symmetric rows cols dimensions diag antidiag'.split(' '));\n\n\n// Extend prototype with methods that have one argument.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function(index, func) {\n var self = this;\n // check for callback\n if (func) {\n setTimeout(function() {\n func.call(self, jProto[passfunc].call(self, index));\n });\n return this;\n }\n return jStat(jStat[passfunc](this, index));\n };\n })(funcs[i]);\n})('row col'.split(' '));\n\n\n// Extend prototype with simple shortcut methods.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = new Function(\n 'return jStat(jStat.' + passfunc + '.apply(null, arguments));');\n })(funcs[i]);\n})('create zeros ones rand identity'.split(' '));\n\n\n// Exposing jStat.\nreturn jStat;\n\n}(Math));\n(function(jStat, Math) {\n\nvar isFunction = jStat.utils.isFunction;\n\n// Ascending functions for sort\nfunction ascNum(a, b) { return a - b; }\n\nfunction clip(arg, min, max) {\n return Math.max(min, Math.min(arg, max));\n}\n\n\n// sum of an array\njStat.sum = function sum(arr) {\n var sum = 0;\n var i = arr.length;\n while (--i >= 0)\n sum += arr[i];\n return sum;\n};\n\n\n// sum squared\njStat.sumsqrd = function sumsqrd(arr) {\n var sum = 0;\n var i = arr.length;\n while (--i >= 0)\n sum += arr[i] * arr[i];\n return sum;\n};\n\n\n// sum of squared errors of prediction (SSE)\njStat.sumsqerr = function sumsqerr(arr) {\n var mean = jStat.mean(arr);\n var sum = 0;\n var i = arr.length;\n var tmp;\n while (--i >= 0) {\n tmp = arr[i] - mean;\n sum += tmp * tmp;\n }\n return sum;\n};\n\n// sum of an array in each row\njStat.sumrow = function sumrow(arr) {\n var sum = 0;\n var i = arr.length;\n while (--i >= 0)\n sum += arr[i];\n return sum;\n};\n\n// product of an array\njStat.product = function product(arr) {\n var prod = 1;\n var i = arr.length;\n while (--i >= 0)\n prod *= arr[i];\n return prod;\n};\n\n\n// minimum value of an array\njStat.min = function min(arr) {\n var low = arr[0];\n var i = 0;\n while (++i < arr.length)\n if (arr[i] < low)\n low = arr[i];\n return low;\n};\n\n\n// maximum value of an array\njStat.max = function max(arr) {\n var high = arr[0];\n var i = 0;\n while (++i < arr.length)\n if (arr[i] > high)\n high = arr[i];\n return high;\n};\n\n\n// unique values of an array\njStat.unique = function unique(arr) {\n var hash = {}, _arr = [];\n for(var i = 0; i < arr.length; i++) {\n if (!hash[arr[i]]) {\n hash[arr[i]] = true;\n _arr.push(arr[i]);\n }\n }\n return _arr;\n};\n\n\n// mean value of an array\njStat.mean = function mean(arr) {\n return jStat.sum(arr) / arr.length;\n};\n\n\n// mean squared error (MSE)\njStat.meansqerr = function meansqerr(arr) {\n return jStat.sumsqerr(arr) / arr.length;\n};\n\n\n// geometric mean of an array\njStat.geomean = function geomean(arr) {\n return Math.pow(jStat.product(arr), 1 / arr.length);\n};\n\n\n// median of an array\njStat.median = function median(arr) {\n var arrlen = arr.length;\n var _arr = arr.slice().sort(ascNum);\n // check if array is even or odd, then return the appropriate\n return !(arrlen & 1)\n ? (_arr[(arrlen / 2) - 1 ] + _arr[(arrlen / 2)]) / 2\n : _arr[(arrlen / 2) | 0 ];\n};\n\n\n// cumulative sum of an array\njStat.cumsum = function cumsum(arr) {\n return jStat.cumreduce(arr, function (a, b) { return a + b; });\n};\n\n\n// cumulative product of an array\njStat.cumprod = function cumprod(arr) {\n return jStat.cumreduce(arr, function (a, b) { return a * b; });\n};\n\n\n// successive differences of a sequence\njStat.diff = function diff(arr) {\n var diffs = [];\n var arrLen = arr.length;\n var i;\n for (var i = 1; i < arrLen; i++)\n diffs.push(arr[i] - arr[i - 1]);\n return diffs;\n};\n\n\n// ranks of an array\njStat.rank = function (arr) {\n var arrlen = arr.length;\n var sorted = arr.slice().sort(ascNum);\n var ranks = new Array(arrlen);\n for (var i = 0; i < arrlen; i++) {\n var first = sorted.indexOf(arr[i]);\n var last = sorted.lastIndexOf(arr[i]);\n if (first === last) {\n var val = first;\n } else {\n var val = (first + last) / 2;\n }\n ranks[i] = val + 1;\n }\n return ranks;\n};\n\n\n// mode of an array\n// if there are multiple modes of an array, return all of them\n// is this the appropriate way of handling it?\njStat.mode = function mode(arr) {\n var arrLen = arr.length;\n var _arr = arr.slice().sort(ascNum);\n var count = 1;\n var maxCount = 0;\n var numMaxCount = 0;\n var mode_arr = [];\n var i;\n\n for (var i = 0; i < arrLen; i++) {\n if (_arr[i] === _arr[i + 1]) {\n count++;\n } else {\n if (count > maxCount) {\n mode_arr = [_arr[i]];\n maxCount = count;\n numMaxCount = 0;\n }\n // are there multiple max counts\n else if (count === maxCount) {\n mode_arr.push(_arr[i]);\n numMaxCount++;\n }\n // resetting count for new value in array\n count = 1;\n }\n }\n\n return numMaxCount === 0 ? mode_arr[0] : mode_arr;\n};\n\n\n// range of an array\njStat.range = function range(arr) {\n return jStat.max(arr) - jStat.min(arr);\n};\n\n// variance of an array\n// flag = true indicates sample instead of population\njStat.variance = function variance(arr, flag) {\n return jStat.sumsqerr(arr) / (arr.length - (flag ? 1 : 0));\n};\n\n// deviation of an array\njStat.deviation = function (arr) {\n var mean = jStat.mean(arr);\n var arrlen = arr.length;\n var dev = new Array(arrlen);\n for (var i = 0; i < arrlen; i++) {\n dev[i] = arr[i] - mean;\n }\n return dev;\n};\n\n// standard deviation of an array\n// flag = true indicates sample instead of population\njStat.stdev = function stdev(arr, flag) {\n return Math.sqrt(jStat.variance(arr, flag));\n};\n\n\n// mean deviation (mean absolute deviation) of an array\njStat.meandev = function meandev(arr) {\n var devSum = 0;\n var mean = jStat.mean(arr);\n var i;\n for (var i = arr.length - 1; i >= 0; i--)\n devSum += Math.abs(arr[i] - mean);\n return devSum / arr.length;\n};\n\n\n// median deviation (median absolute deviation) of an array\njStat.meddev = function meddev(arr) {\n var devSum = 0;\n var median = jStat.median(arr);\n var i;\n for (var i = arr.length - 1; i >= 0; i--)\n devSum += Math.abs(arr[i] - median);\n return devSum / arr.length;\n};\n\n\n// coefficient of variation\njStat.coeffvar = function coeffvar(arr) {\n return jStat.stdev(arr) / jStat.mean(arr);\n};\n\n\n// quartiles of an array\njStat.quartiles = function quartiles(arr) {\n var arrlen = arr.length;\n var _arr = arr.slice().sort(ascNum);\n return [\n _arr[ Math.round((arrlen) / 4) - 1 ],\n _arr[ Math.round((arrlen) / 2) - 1 ],\n _arr[ Math.round((arrlen) * 3 / 4) - 1 ]\n ];\n};\n\n\n// Arbitary quantiles of an array. Direct port of the scipy.stats\n// implementation by Pierre GF Gerard-Marchant.\njStat.quantiles = function quantiles(arr, quantilesArray, alphap, betap) {\n var sortedArray = arr.slice().sort(ascNum);\n var quantileVals = [quantilesArray.length];\n var n = arr.length;\n var i, p, m, aleph, k, gamma;\n\n if (typeof alphap === 'undefined')\n alphap = 3 / 8;\n if (typeof betap === 'undefined')\n betap = 3 / 8;\n\n for (var i = 0; i < quantilesArray.length; i++) {\n p = quantilesArray[i];\n m = alphap + p * (1 - alphap - betap);\n aleph = n * p + m;\n k = Math.floor(clip(aleph, 1, n - 1));\n gamma = clip(aleph - k, 0, 1);\n quantileVals[i] = (1 - gamma) * sortedArray[k - 1] + gamma * sortedArray[k];\n }\n\n return quantileVals;\n};\n\n// Returns the k-th percentile of values in a range, where k is in the\n// range 0..1, exclusive.\njStat.percentile = function percentile(arr, k) {\n var _arr = arr.slice().sort(ascNum);\n var realIndex = k * (_arr.length - 1);\n var index = parseInt(realIndex);\n var frac = realIndex - index;\n\n if (index + 1 < _arr.length) {\n return _arr[index] * (1 - frac) + _arr[index + 1] * frac;\n } else {\n return _arr[index];\n }\n}\n\n\n// The percentile rank of score in a given array. Returns the percentage\n// of all values in the input array that are less than (kind='strict') or\n// less or equal than (kind='weak') score. Default is weak.\njStat.percentileOfScore = function percentileOfScore(arr, score, kind) {\n var counter = 0;\n var len = arr.length;\n var strict = false;\n var value, i;\n\n if (kind === 'strict')\n strict = true;\n\n for (var i = 0; i < len; i++) {\n value = arr[i];\n if ((strict && value < score) ||\n (!strict && value <= score)) {\n counter++;\n }\n }\n\n return counter / len;\n};\n\n\n// Histogram (bin count) data\njStat.histogram = function histogram(arr, bins) {\n var first = jStat.min(arr);\n var binCnt = bins || 4;\n var binWidth = (jStat.max(arr) - first) / binCnt;\n var len = arr.length;\n var bins = [];\n var i;\n\n for (var i = 0; i < binCnt; i++)\n bins[i] = 0;\n for (var i = 0; i < len; i++)\n bins[Math.min(Math.floor(((arr[i] - first) / binWidth)), binCnt - 1)] += 1;\n\n return bins;\n};\n\n\n// covariance of two arrays\njStat.covariance = function covariance(arr1, arr2) {\n var u = jStat.mean(arr1);\n var v = jStat.mean(arr2);\n var arr1Len = arr1.length;\n var sq_dev = new Array(arr1Len);\n var i;\n\n for (var i = 0; i < arr1Len; i++)\n sq_dev[i] = (arr1[i] - u) * (arr2[i] - v);\n\n return jStat.sum(sq_dev) / (arr1Len - 1);\n};\n\n\n// (pearson's) population correlation coefficient, rho\njStat.corrcoeff = function corrcoeff(arr1, arr2) {\n return jStat.covariance(arr1, arr2) /\n jStat.stdev(arr1, 1) /\n jStat.stdev(arr2, 1);\n};\n\n // (spearman's) rank correlation coefficient, sp\njStat.spearmancoeff = function (arr1, arr2) {\n arr1 = jStat.rank(arr1);\n arr2 = jStat.rank(arr2);\n var arr1dev = jStat.deviation(arr1);\n var arr2dev = jStat.deviation(arr2);\n return jStat.sum(arr1dev.map(function (x, i) {\n return x * arr2dev[i];\n })) /\n Math.sqrt(jStat.sum(arr1dev.map(function (x) {\n return Math.pow(x, 2);\n })) * jStat.sum(arr2dev.map(function (x) {\n return Math.pow(x, 2);\n }))\n );\n}\n\n\n// statistical standardized moments (general form of skew/kurt)\njStat.stanMoment = function stanMoment(arr, n) {\n var mu = jStat.mean(arr);\n var sigma = jStat.stdev(arr);\n var len = arr.length;\n var skewSum = 0;\n\n for (var i = 0; i < len; i++)\n skewSum += Math.pow((arr[i] - mu) / sigma, n);\n\n return skewSum / arr.length;\n};\n\n// (pearson's) moment coefficient of skewness\njStat.skewness = function skewness(arr) {\n return jStat.stanMoment(arr, 3);\n};\n\n// (pearson's) (excess) kurtosis\njStat.kurtosis = function kurtosis(arr) {\n return jStat.stanMoment(arr, 4) - 3;\n};\n\n\nvar jProto = jStat.prototype;\n\n\n// Extend jProto with method for calculating cumulative sums and products.\n// This differs from the similar extension below as cumsum and cumprod should\n// not be run again in the case fullbool === true.\n// If a matrix is passed, automatically assume operation should be done on the\n// columns.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n // If a matrix is passed, automatically assume operation should be done on\n // the columns.\n jProto[passfunc] = function(fullbool, func) {\n var arr = [];\n var i = 0;\n var tmpthis = this;\n // Assignment reassignation depending on how parameters were passed in.\n if (isFunction(fullbool)) {\n func = fullbool;\n fullbool = false;\n }\n // Check if a callback was passed with the function.\n if (func) {\n setTimeout(function() {\n func.call(tmpthis, jProto[passfunc].call(tmpthis, fullbool));\n });\n return this;\n }\n // Check if matrix and run calculations.\n if (this.length > 1) {\n tmpthis = fullbool === true ? this : this.transpose();\n for (; i < tmpthis.length; i++)\n arr[i] = jStat[passfunc](tmpthis[i]);\n return arr;\n }\n // Pass fullbool if only vector, not a matrix. for variance and stdev.\n return jStat[passfunc](this[0], fullbool);\n };\n })(funcs[i]);\n})(('cumsum cumprod').split(' '));\n\n\n// Extend jProto with methods which don't require arguments and work on columns.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n // If a matrix is passed, automatically assume operation should be done on\n // the columns.\n jProto[passfunc] = function(fullbool, func) {\n var arr = [];\n var i = 0;\n var tmpthis = this;\n // Assignment reassignation depending on how parameters were passed in.\n if (isFunction(fullbool)) {\n func = fullbool;\n fullbool = false;\n }\n // Check if a callback was passed with the function.\n if (func) {\n setTimeout(function() {\n func.call(tmpthis, jProto[passfunc].call(tmpthis, fullbool));\n });\n return this;\n }\n // Check if matrix and run calculations.\n if (this.length > 1) {\n if (passfunc !== 'sumrow')\n tmpthis = fullbool === true ? this : this.transpose();\n for (; i < tmpthis.length; i++)\n arr[i] = jStat[passfunc](tmpthis[i]);\n return fullbool === true\n ? jStat[passfunc](jStat.utils.toVector(arr))\n : arr;\n }\n // Pass fullbool if only vector, not a matrix. for variance and stdev.\n return jStat[passfunc](this[0], fullbool);\n };\n })(funcs[i]);\n})(('sum sumsqrd sumsqerr sumrow product min max unique mean meansqerr ' +\n 'geomean median diff rank mode range variance deviation stdev meandev ' +\n 'meddev coeffvar quartiles histogram skewness kurtosis').split(' '));\n\n\n// Extend jProto with functions that take arguments. Operations on matrices are\n// done on columns.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function() {\n var arr = [];\n var i = 0;\n var tmpthis = this;\n var args = Array.prototype.slice.call(arguments);\n\n // If the last argument is a function, we assume it's a callback; we\n // strip the callback out and call the function again.\n if (isFunction(args[args.length - 1])) {\n var callbackFunction = args[args.length - 1];\n var argsToPass = args.slice(0, args.length - 1);\n\n setTimeout(function() {\n callbackFunction.call(tmpthis,\n jProto[passfunc].apply(tmpthis, argsToPass));\n });\n return this;\n\n // Otherwise we curry the function args and call normally.\n } else {\n var callbackFunction = undefined;\n var curriedFunction = function curriedFunction(vector) {\n return jStat[passfunc].apply(tmpthis, [vector].concat(args));\n }\n }\n\n // If this is a matrix, run column-by-column.\n if (this.length > 1) {\n tmpthis = tmpthis.transpose();\n for (; i < tmpthis.length; i++)\n arr[i] = curriedFunction(tmpthis[i]);\n return arr;\n }\n\n // Otherwise run on the vector.\n return curriedFunction(this[0]);\n };\n })(funcs[i]);\n})('quantiles percentileOfScore'.split(' '));\n\n}(this.jStat, Math));\n// Special functions //\n(function(jStat, Math) {\n\n// Log-gamma function\njStat.gammaln = function gammaln(x) {\n var j = 0;\n var cof = [\n 76.18009172947146, -86.50532032941677, 24.01409824083091,\n -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5\n ];\n var ser = 1.000000000190015;\n var xx, y, tmp;\n tmp = (y = xx = x) + 5.5;\n tmp -= (xx + 0.5) * Math.log(tmp);\n for (; j < 6; j++)\n ser += cof[j] / ++y;\n return Math.log(2.5066282746310005 * ser / xx) - tmp;\n};\n\n\n// gamma of x\njStat.gammafn = function gammafn(x) {\n var p = [-1.716185138865495, 24.76565080557592, -379.80425647094563,\n 629.3311553128184, 866.9662027904133, -31451.272968848367,\n -36144.413418691176, 66456.14382024054\n ];\n var q = [-30.8402300119739, 315.35062697960416, -1015.1563674902192,\n -3107.771671572311, 22538.118420980151, 4755.8462775278811,\n -134659.9598649693, -115132.2596755535];\n var fact = false;\n var n = 0;\n var xden = 0;\n var xnum = 0;\n var y = x;\n var i, z, yi, res, sum, ysq;\n if (y <= 0) {\n res = y % 1 + 3.6e-16;\n if (res) {\n fact = (!(y & 1) ? 1 : -1) * Math.PI / Math.sin(Math.PI * res);\n y = 1 - y;\n } else {\n return Infinity;\n }\n }\n yi = y;\n if (y < 1) {\n z = y++;\n } else {\n z = (y -= n = (y | 0) - 1) - 1;\n }\n for (var i = 0; i < 8; ++i) {\n xnum = (xnum + p[i]) * z;\n xden = xden * z + q[i];\n }\n res = xnum / xden + 1;\n if (yi < y) {\n res /= yi;\n } else if (yi > y) {\n for (var i = 0; i < n; ++i) {\n res *= y;\n y++;\n }\n }\n if (fact) {\n res = fact / res;\n }\n return res;\n};\n\n\n// lower incomplete gamma function, which is usually typeset with a\n// lower-case greek gamma as the function symbol\njStat.gammap = function gammap(a, x) {\n return jStat.lowRegGamma(a, x) * jStat.gammafn(a);\n};\n\n\n// The lower regularized incomplete gamma function, usually written P(a,x)\njStat.lowRegGamma = function lowRegGamma(a, x) {\n var aln = jStat.gammaln(a);\n var ap = a;\n var sum = 1 / a;\n var del = sum;\n var b = x + 1 - a;\n var c = 1 / 1.0e-30;\n var d = 1 / b;\n var h = d;\n var i = 1;\n // calculate maximum number of itterations required for a\n var ITMAX = -~(Math.log((a >= 1) ? a : 1 / a) * 8.5 + a * 0.4 + 17);\n var an, endval;\n\n if (x < 0 || a <= 0) {\n return NaN;\n } else if (x < a + 1) {\n for (; i <= ITMAX; i++) {\n sum += del *= x / ++ap;\n }\n return (sum * Math.exp(-x + a * Math.log(x) - (aln)));\n }\n\n for (; i <= ITMAX; i++) {\n an = -i * (i - a);\n b += 2;\n d = an * d + b;\n c = b + an / c;\n d = 1 / d;\n h *= d * c;\n }\n\n return (1 - h * Math.exp(-x + a * Math.log(x) - (aln)));\n};\n\n// natural log factorial of n\njStat.factorialln = function factorialln(n) {\n return n < 0 ? NaN : jStat.gammaln(n + 1);\n};\n\n// factorial of n\njStat.factorial = function factorial(n) {\n return n < 0 ? NaN : jStat.gammafn(n + 1);\n};\n\n// combinations of n, m\njStat.combination = function combination(n, m) {\n // make sure n or m don't exceed the upper limit of usable values\n return (n > 170 || m > 170)\n ? Math.exp(jStat.combinationln(n, m))\n : (jStat.factorial(n) / jStat.factorial(m)) / jStat.factorial(n - m);\n};\n\n\njStat.combinationln = function combinationln(n, m){\n return jStat.factorialln(n) - jStat.factorialln(m) - jStat.factorialln(n - m);\n};\n\n\n// permutations of n, m\njStat.permutation = function permutation(n, m) {\n return jStat.factorial(n) / jStat.factorial(n - m);\n};\n\n\n// beta function\njStat.betafn = function betafn(x, y) {\n // ensure arguments are positive\n if (x <= 0 || y <= 0)\n return undefined;\n // make sure x + y doesn't exceed the upper limit of usable values\n return (x + y > 170)\n ? Math.exp(jStat.betaln(x, y))\n : jStat.gammafn(x) * jStat.gammafn(y) / jStat.gammafn(x + y);\n};\n\n\n// natural logarithm of beta function\njStat.betaln = function betaln(x, y) {\n return jStat.gammaln(x) + jStat.gammaln(y) - jStat.gammaln(x + y);\n};\n\n\n// Evaluates the continued fraction for incomplete beta function by modified\n// Lentz's method.\njStat.betacf = function betacf(x, a, b) {\n var fpmin = 1e-30;\n var m = 1;\n var qab = a + b;\n var qap = a + 1;\n var qam = a - 1;\n var c = 1;\n var d = 1 - qab * x / qap;\n var m2, aa, del, h;\n\n // These q's will be used in factors that occur in the coefficients\n if (Math.abs(d) < fpmin)\n d = fpmin;\n d = 1 / d;\n h = d;\n\n for (; m <= 100; m++) {\n m2 = 2 * m;\n aa = m * (b - m) * x / ((qam + m2) * (a + m2));\n // One step (the even one) of the recurrence\n d = 1 + aa * d;\n if (Math.abs(d) < fpmin)\n d = fpmin;\n c = 1 + aa / c;\n if (Math.abs(c) < fpmin)\n c = fpmin;\n d = 1 / d;\n h *= d * c;\n aa = -(a + m) * (qab + m) * x / ((a + m2) * (qap + m2));\n // Next step of the recurrence (the odd one)\n d = 1 + aa * d;\n if (Math.abs(d) < fpmin)\n d = fpmin;\n c = 1 + aa / c;\n if (Math.abs(c) < fpmin)\n c = fpmin;\n d = 1 / d;\n del = d * c;\n h *= del;\n if (Math.abs(del - 1.0) < 3e-7)\n break;\n }\n\n return h;\n};\n\n\n// Returns the inverse of the lower regularized inomplete gamma function\njStat.gammapinv = function gammapinv(p, a) {\n var j = 0;\n var a1 = a - 1;\n var EPS = 1e-8;\n var gln = jStat.gammaln(a);\n var x, err, t, u, pp, lna1, afac;\n\n if (p >= 1)\n return Math.max(100, a + 100 * Math.sqrt(a));\n if (p <= 0)\n return 0;\n if (a > 1) {\n lna1 = Math.log(a1);\n afac = Math.exp(a1 * (lna1 - 1) - gln);\n pp = (p < 0.5) ? p : 1 - p;\n t = Math.sqrt(-2 * Math.log(pp));\n x = (2.30753 + t * 0.27061) / (1 + t * (0.99229 + t * 0.04481)) - t;\n if (p < 0.5)\n x = -x;\n x = Math.max(1e-3,\n a * Math.pow(1 - 1 / (9 * a) - x / (3 * Math.sqrt(a)), 3));\n } else {\n t = 1 - a * (0.253 + a * 0.12);\n if (p < t)\n x = Math.pow(p / t, 1 / a);\n else\n x = 1 - Math.log(1 - (p - t) / (1 - t));\n }\n\n for(; j < 12; j++) {\n if (x <= 0)\n return 0;\n err = jStat.lowRegGamma(a, x) - p;\n if (a > 1)\n t = afac * Math.exp(-(x - a1) + a1 * (Math.log(x) - lna1));\n else\n t = Math.exp(-x + a1 * Math.log(x) - gln);\n u = err / t;\n x -= (t = u / (1 - 0.5 * Math.min(1, u * ((a - 1) / x - 1))));\n if (x <= 0)\n x = 0.5 * (x + t);\n if (Math.abs(t) < EPS * x)\n break;\n }\n\n return x;\n};\n\n\n// Returns the error function erf(x)\njStat.erf = function erf(x) {\n var cof = [-1.3026537197817094, 6.4196979235649026e-1, 1.9476473204185836e-2,\n -9.561514786808631e-3, -9.46595344482036e-4, 3.66839497852761e-4,\n 4.2523324806907e-5, -2.0278578112534e-5, -1.624290004647e-6,\n 1.303655835580e-6, 1.5626441722e-8, -8.5238095915e-8,\n 6.529054439e-9, 5.059343495e-9, -9.91364156e-10,\n -2.27365122e-10, 9.6467911e-11, 2.394038e-12,\n -6.886027e-12, 8.94487e-13, 3.13092e-13,\n -1.12708e-13, 3.81e-16, 7.106e-15,\n -1.523e-15, -9.4e-17, 1.21e-16,\n -2.8e-17];\n var j = cof.length - 1;\n var isneg = false;\n var d = 0;\n var dd = 0;\n var t, ty, tmp, res;\n\n if (x < 0) {\n x = -x;\n isneg = true;\n }\n\n t = 2 / (2 + x);\n ty = 4 * t - 2;\n\n for(; j > 0; j--) {\n tmp = d;\n d = ty * d - dd + cof[j];\n dd = tmp;\n }\n\n res = t * Math.exp(-x * x + 0.5 * (cof[0] + ty * d) - dd);\n return isneg ? res - 1 : 1 - res;\n};\n\n\n// Returns the complmentary error function erfc(x)\njStat.erfc = function erfc(x) {\n return 1 - jStat.erf(x);\n};\n\n\n// Returns the inverse of the complementary error function\njStat.erfcinv = function erfcinv(p) {\n var j = 0;\n var x, err, t, pp;\n if (p >= 2)\n return -100;\n if (p <= 0)\n return 100;\n pp = (p < 1) ? p : 2 - p;\n t = Math.sqrt(-2 * Math.log(pp / 2));\n x = -0.70711 * ((2.30753 + t * 0.27061) /\n (1 + t * (0.99229 + t * 0.04481)) - t);\n for (; j < 2; j++) {\n err = jStat.erfc(x) - pp;\n x += err / (1.12837916709551257 * Math.exp(-x * x) - x * err);\n }\n return (p < 1) ? x : -x;\n};\n\n\n// Returns the inverse of the incomplete beta function\njStat.ibetainv = function ibetainv(p, a, b) {\n var EPS = 1e-8;\n var a1 = a - 1;\n var b1 = b - 1;\n var j = 0;\n var lna, lnb, pp, t, u, err, x, al, h, w, afac;\n if (p <= 0)\n return 0;\n if (p >= 1)\n return 1;\n if (a >= 1 && b >= 1) {\n pp = (p < 0.5) ? p : 1 - p;\n t = Math.sqrt(-2 * Math.log(pp));\n x = (2.30753 + t * 0.27061) / (1 + t* (0.99229 + t * 0.04481)) - t;\n if (p < 0.5)\n x = -x;\n al = (x * x - 3) / 6;\n h = 2 / (1 / (2 * a - 1) + 1 / (2 * b - 1));\n w = (x * Math.sqrt(al + h) / h) - (1 / (2 * b - 1) - 1 / (2 * a - 1)) *\n (al + 5 / 6 - 2 / (3 * h));\n x = a / (a + b * Math.exp(2 * w));\n } else {\n lna = Math.log(a / (a + b));\n lnb = Math.log(b / (a + b));\n t = Math.exp(a * lna) / a;\n u = Math.exp(b * lnb) / b;\n w = t + u;\n if (p < t / w)\n x = Math.pow(a * w * p, 1 / a);\n else\n x = 1 - Math.pow(b * w * (1 - p), 1 / b);\n }\n afac = -jStat.gammaln(a) - jStat.gammaln(b) + jStat.gammaln(a + b);\n for(; j < 10; j++) {\n if (x === 0 || x === 1)\n return x;\n err = jStat.ibeta(x, a, b) - p;\n t = Math.exp(a1 * Math.log(x) + b1 * Math.log(1 - x) + afac);\n u = err / t;\n x -= (t = u / (1 - 0.5 * Math.min(1, u * (a1 / x - b1 / (1 - x)))));\n if (x <= 0)\n x = 0.5 * (x + t);\n if (x >= 1)\n x = 0.5 * (x + t + 1);\n if (Math.abs(t) < EPS * x && j > 0)\n break;\n }\n return x;\n};\n\n\n// Returns the incomplete beta function I_x(a,b)\njStat.ibeta = function ibeta(x, a, b) {\n // Factors in front of the continued fraction.\n var bt = (x === 0 || x === 1) ? 0 :\n Math.exp(jStat.gammaln(a + b) - jStat.gammaln(a) -\n jStat.gammaln(b) + a * Math.log(x) + b *\n Math.log(1 - x));\n if (x < 0 || x > 1)\n return false;\n if (x < (a + 1) / (a + b + 2))\n // Use continued fraction directly.\n return bt * jStat.betacf(x, a, b) / a;\n // else use continued fraction after making the symmetry transformation.\n return 1 - bt * jStat.betacf(1 - x, b, a) / b;\n};\n\n\n// Returns a normal deviate (mu=0, sigma=1).\n// If n and m are specified it returns a object of normal deviates.\njStat.randn = function randn(n, m) {\n var u, v, x, y, q, mat;\n if (!m)\n m = n;\n if (n)\n return jStat.create(n, m, function() { return jStat.randn(); });\n do {\n u = Math.random();\n v = 1.7156 * (Math.random() - 0.5);\n x = u - 0.449871;\n y = Math.abs(v) + 0.386595;\n q = x * x + y * (0.19600 * y - 0.25472 * x);\n } while (q > 0.27597 && (q > 0.27846 || v * v > -4 * Math.log(u) * u * u));\n return v / u;\n};\n\n\n// Returns a gamma deviate by the method of Marsaglia and Tsang.\njStat.randg = function randg(shape, n, m) {\n var oalph = shape;\n var a1, a2, u, v, x, mat;\n if (!m)\n m = n;\n if (!shape)\n shape = 1;\n if (n) {\n mat = jStat.zeros(n,m);\n mat.alter(function() { return jStat.randg(shape); });\n return mat;\n }\n if (shape < 1)\n shape += 1;\n a1 = shape - 1 / 3;\n a2 = 1 / Math.sqrt(9 * a1);\n do {\n do {\n x = jStat.randn();\n v = 1 + a2 * x;\n } while(v <= 0);\n v = v * v * v;\n u = Math.random();\n } while(u > 1 - 0.331 * Math.pow(x, 4) &&\n Math.log(u) > 0.5 * x*x + a1 * (1 - v + Math.log(v)));\n // alpha > 1\n if (shape == oalph)\n return a1 * v;\n // alpha < 1\n do {\n u = Math.random();\n } while(u === 0);\n return Math.pow(u, 1 / oalph) * a1 * v;\n};\n\n\n// making use of static methods on the instance\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jStat.fn[passfunc] = function() {\n return jStat(\n jStat.map(this, function(value) { return jStat[passfunc](value); }));\n }\n })(funcs[i]);\n})('gammaln gammafn factorial factorialln'.split(' '));\n\n\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jStat.fn[passfunc] = function() {\n return jStat(jStat[passfunc].apply(null, arguments));\n };\n })(funcs[i]);\n})('randn'.split(' '));\n\n}(this.jStat, Math));\n(function(jStat, Math) {\n\n// generate all distribution instance methods\n(function(list) {\n for (var i = 0; i < list.length; i++) (function(func) {\n // distribution instance method\n jStat[func] = function(a, b, c) {\n if (!(this instanceof arguments.callee))\n return new arguments.callee(a, b, c);\n this._a = a;\n this._b = b;\n this._c = c;\n return this;\n };\n // distribution method to be used on a jStat instance\n jStat.fn[func] = function(a, b, c) {\n var newthis = jStat[func](a, b, c);\n newthis.data = this;\n return newthis;\n };\n // sample instance method\n jStat[func].prototype.sample = function(arr) {\n var a = this._a;\n var b = this._b;\n var c = this._c;\n if (arr)\n return jStat.alter(arr, function() {\n return jStat[func].sample(a, b, c);\n });\n else\n return jStat[func].sample(a, b, c);\n };\n // generate the pdf, cdf and inv instance methods\n (function(vals) {\n for (var i = 0; i < vals.length; i++) (function(fnfunc) {\n jStat[func].prototype[fnfunc] = function(x) {\n var a = this._a;\n var b = this._b;\n var c = this._c;\n if (!x && x !== 0)\n x = this.data;\n if (typeof x !== 'number') {\n return jStat.fn.map.call(x, function(x) {\n return jStat[func][fnfunc](x, a, b, c);\n });\n }\n return jStat[func][fnfunc](x, a, b, c);\n };\n })(vals[i]);\n })('pdf cdf inv'.split(' '));\n // generate the mean, median, mode and variance instance methods\n (function(vals) {\n for (var i = 0; i < vals.length; i++) (function(fnfunc) {\n jStat[func].prototype[fnfunc] = function() {\n return jStat[func][fnfunc](this._a, this._b, this._c);\n };\n })(vals[i]);\n })('mean median mode variance'.split(' '));\n })(list[i]);\n})((\n 'beta centralF cauchy chisquare exponential gamma invgamma kumaraswamy ' +\n 'laplace lognormal noncentralt normal pareto studentt weibull uniform ' +\n 'binomial negbin hypgeom poisson triangular'\n).split(' '));\n\n\n\n// extend beta function with static methods\njStat.extend(jStat.beta, {\n pdf: function pdf(x, alpha, beta) {\n // PDF is zero outside the support\n if (x > 1 || x < 0)\n return 0;\n // PDF is one for the uniform case\n if (alpha == 1 && beta == 1)\n return 1;\n\n if (alpha < 512 && beta < 512) {\n return (Math.pow(x, alpha - 1) * Math.pow(1 - x, beta - 1)) /\n jStat.betafn(alpha, beta);\n } else {\n return Math.exp((alpha - 1) * Math.log(x) +\n (beta - 1) * Math.log(1 - x) -\n jStat.betaln(alpha, beta));\n }\n },\n\n cdf: function cdf(x, alpha, beta) {\n return (x > 1 || x < 0) ? (x > 1) * 1 : jStat.ibeta(x, alpha, beta);\n },\n\n inv: function inv(x, alpha, beta) {\n return jStat.ibetainv(x, alpha, beta);\n },\n\n mean: function mean(alpha, beta) {\n return alpha / (alpha + beta);\n },\n\n median: function median(alpha, beta) {\n return jStat.ibetainv(0.5, alpha, beta);\n },\n\n mode: function mode(alpha, beta) {\n return (alpha - 1 ) / ( alpha + beta - 2);\n },\n\n // return a random sample\n sample: function sample(alpha, beta) {\n var u = jStat.randg(alpha);\n return u / (u + jStat.randg(beta));\n },\n\n variance: function variance(alpha, beta) {\n return (alpha * beta) / (Math.pow(alpha + beta, 2) * (alpha + beta + 1));\n }\n});\n\n// extend F function with static methods\njStat.extend(jStat.centralF, {\n // This implementation of the pdf function avoids float overflow\n // See the way that R calculates this value:\n // https://svn.r-project.org/R/trunk/src/nmath/df.c\n pdf: function pdf(x, df1, df2) {\n var p, q, f;\n\n if (x < 0)\n return 0;\n\n if (df1 <= 2) {\n if (x === 0 && df1 < 2) {\n return Infinity;\n }\n if (x === 0 && df1 === 2) {\n return 1;\n }\n return Math.sqrt((Math.pow(df1 * x, df1) * Math.pow(df2, df2)) /\n (Math.pow(df1 * x + df2, df1 + df2))) /\n (x * jStat.betafn(df1/2, df2/2));\n }\n\n p = (df1 * x) / (df2 + x * df1);\n q = df2 / (df2 + x * df1);\n f = df1 * q / 2.0;\n return f * jStat.binomial.pdf((df1 - 2) / 2, (df1 + df2 - 2) / 2, p);\n },\n\n cdf: function cdf(x, df1, df2) {\n if (x < 0)\n return 0;\n return jStat.ibeta((df1 * x) / (df1 * x + df2), df1 / 2, df2 / 2);\n },\n\n inv: function inv(x, df1, df2) {\n return df2 / (df1 * (1 / jStat.ibetainv(x, df1 / 2, df2 / 2) - 1));\n },\n\n mean: function mean(df1, df2) {\n return (df2 > 2) ? df2 / (df2 - 2) : undefined;\n },\n\n mode: function mode(df1, df2) {\n return (df1 > 2) ? (df2 * (df1 - 2)) / (df1 * (df2 + 2)) : undefined;\n },\n\n // return a random sample\n sample: function sample(df1, df2) {\n var x1 = jStat.randg(df1 / 2) * 2;\n var x2 = jStat.randg(df2 / 2) * 2;\n return (x1 / df1) / (x2 / df2);\n },\n\n variance: function variance(df1, df2) {\n if (df2 <= 4)\n return undefined;\n return 2 * df2 * df2 * (df1 + df2 - 2) /\n (df1 * (df2 - 2) * (df2 - 2) * (df2 - 4));\n }\n});\n\n\n// extend cauchy function with static methods\njStat.extend(jStat.cauchy, {\n pdf: function pdf(x, local, scale) {\n if (scale < 0) { return 0; }\n\n return (scale / (Math.pow(x - local, 2) + Math.pow(scale, 2))) / Math.PI;\n },\n\n cdf: function cdf(x, local, scale) {\n return Math.atan((x - local) / scale) / Math.PI + 0.5;\n },\n\n inv: function(p, local, scale) {\n return local + scale * Math.tan(Math.PI * (p - 0.5));\n },\n\n median: function median(local, scale) {\n return local;\n },\n\n mode: function mode(local, scale) {\n return local;\n },\n\n sample: function sample(local, scale) {\n return jStat.randn() *\n Math.sqrt(1 / (2 * jStat.randg(0.5))) * scale + local;\n }\n});\n\n\n\n// extend chisquare function with static methods\njStat.extend(jStat.chisquare, {\n pdf: function pdf(x, dof) {\n if (x < 0)\n return 0;\n return (x === 0 && dof === 2) ? 0.5 :\n Math.exp((dof / 2 - 1) * Math.log(x) - x / 2 - (dof / 2) *\n Math.log(2) - jStat.gammaln(dof / 2));\n },\n\n cdf: function cdf(x, dof) {\n if (x < 0)\n return 0;\n return jStat.lowRegGamma(dof / 2, x / 2);\n },\n\n inv: function(p, dof) {\n return 2 * jStat.gammapinv(p, 0.5 * dof);\n },\n\n mean : function(dof) {\n return dof;\n },\n\n // TODO: this is an approximation (is there a better way?)\n median: function median(dof) {\n return dof * Math.pow(1 - (2 / (9 * dof)), 3);\n },\n\n mode: function mode(dof) {\n return (dof - 2 > 0) ? dof - 2 : 0;\n },\n\n sample: function sample(dof) {\n return jStat.randg(dof / 2) * 2;\n },\n\n variance: function variance(dof) {\n return 2 * dof;\n }\n});\n\n\n\n// extend exponential function with static methods\njStat.extend(jStat.exponential, {\n pdf: function pdf(x, rate) {\n return x < 0 ? 0 : rate * Math.exp(-rate * x);\n },\n\n cdf: function cdf(x, rate) {\n return x < 0 ? 0 : 1 - Math.exp(-rate * x);\n },\n\n inv: function(p, rate) {\n return -Math.log(1 - p) / rate;\n },\n\n mean : function(rate) {\n return 1 / rate;\n },\n\n median: function (rate) {\n return (1 / rate) * Math.log(2);\n },\n\n mode: function mode(rate) {\n return 0;\n },\n\n sample: function sample(rate) {\n return -1 / rate * Math.log(Math.random());\n },\n\n variance : function(rate) {\n return Math.pow(rate, -2);\n }\n});\n\n\n\n// extend gamma function with static methods\njStat.extend(jStat.gamma, {\n pdf: function pdf(x, shape, scale) {\n if (x < 0)\n return 0;\n return (x === 0 && shape === 1) ? 1 / scale :\n Math.exp((shape - 1) * Math.log(x) - x / scale -\n jStat.gammaln(shape) - shape * Math.log(scale));\n },\n\n cdf: function cdf(x, shape, scale) {\n if (x < 0)\n return 0;\n return jStat.lowRegGamma(shape, x / scale);\n },\n\n inv: function(p, shape, scale) {\n return jStat.gammapinv(p, shape) * scale;\n },\n\n mean : function(shape, scale) {\n return shape * scale;\n },\n\n mode: function mode(shape, scale) {\n if(shape > 1) return (shape - 1) * scale;\n return undefined;\n },\n\n sample: function sample(shape, scale) {\n return jStat.randg(shape) * scale;\n },\n\n variance: function variance(shape, scale) {\n return shape * scale * scale;\n }\n});\n\n// extend inverse gamma function with static methods\njStat.extend(jStat.invgamma, {\n pdf: function pdf(x, shape, scale) {\n if (x <= 0)\n return 0;\n return Math.exp(-(shape + 1) * Math.log(x) - scale / x -\n jStat.gammaln(shape) + shape * Math.log(scale));\n },\n\n cdf: function cdf(x, shape, scale) {\n if (x <= 0)\n return 0;\n return 1 - jStat.lowRegGamma(shape, scale / x);\n },\n\n inv: function(p, shape, scale) {\n return scale / jStat.gammapinv(1 - p, shape);\n },\n\n mean : function(shape, scale) {\n return (shape > 1) ? scale / (shape - 1) : undefined;\n },\n\n mode: function mode(shape, scale) {\n return scale / (shape + 1);\n },\n\n sample: function sample(shape, scale) {\n return scale / jStat.randg(shape);\n },\n\n variance: function variance(shape, scale) {\n if (shape <= 2)\n return undefined;\n return scale * scale / ((shape - 1) * (shape - 1) * (shape - 2));\n }\n});\n\n\n// extend kumaraswamy function with static methods\njStat.extend(jStat.kumaraswamy, {\n pdf: function pdf(x, alpha, beta) {\n if (x === 0 && alpha === 1)\n return beta;\n else if (x === 1 && beta === 1)\n return alpha;\n return Math.exp(Math.log(alpha) + Math.log(beta) + (alpha - 1) *\n Math.log(x) + (beta - 1) *\n Math.log(1 - Math.pow(x, alpha)));\n },\n\n cdf: function cdf(x, alpha, beta) {\n if (x < 0)\n return 0;\n else if (x > 1)\n return 1;\n return (1 - Math.pow(1 - Math.pow(x, alpha), beta));\n },\n\n inv: function inv(p, alpha, beta) {\n return Math.pow(1 - Math.pow(1 - p, 1 / beta), 1 / alpha);\n },\n\n mean : function(alpha, beta) {\n return (beta * jStat.gammafn(1 + 1 / alpha) *\n jStat.gammafn(beta)) / (jStat.gammafn(1 + 1 / alpha + beta));\n },\n\n median: function median(alpha, beta) {\n return Math.pow(1 - Math.pow(2, -1 / beta), 1 / alpha);\n },\n\n mode: function mode(alpha, beta) {\n if (!(alpha >= 1 && beta >= 1 && (alpha !== 1 && beta !== 1)))\n return undefined;\n return Math.pow((alpha - 1) / (alpha * beta - 1), 1 / alpha);\n },\n\n variance: function variance(alpha, beta) {\n throw new Error('variance not yet implemented');\n // TODO: complete this\n }\n});\n\n\n\n// extend lognormal function with static methods\njStat.extend(jStat.lognormal, {\n pdf: function pdf(x, mu, sigma) {\n if (x <= 0)\n return 0;\n return Math.exp(-Math.log(x) - 0.5 * Math.log(2 * Math.PI) -\n Math.log(sigma) - Math.pow(Math.log(x) - mu, 2) /\n (2 * sigma * sigma));\n },\n\n cdf: function cdf(x, mu, sigma) {\n if (x < 0)\n return 0;\n return 0.5 +\n (0.5 * jStat.erf((Math.log(x) - mu) / Math.sqrt(2 * sigma * sigma)));\n },\n\n inv: function(p, mu, sigma) {\n return Math.exp(-1.41421356237309505 * sigma * jStat.erfcinv(2 * p) + mu);\n },\n\n mean: function mean(mu, sigma) {\n return Math.exp(mu + sigma * sigma / 2);\n },\n\n median: function median(mu, sigma) {\n return Math.exp(mu);\n },\n\n mode: function mode(mu, sigma) {\n return Math.exp(mu - sigma * sigma);\n },\n\n sample: function sample(mu, sigma) {\n return Math.exp(jStat.randn() * sigma + mu);\n },\n\n variance: function variance(mu, sigma) {\n return (Math.exp(sigma * sigma) - 1) * Math.exp(2 * mu + sigma * sigma);\n }\n});\n\n\n\n// extend noncentralt function with static methods\njStat.extend(jStat.noncentralt, {\n pdf: function pdf(x, dof, ncp) {\n var tol = 1e-14;\n if (Math.abs(ncp) < tol) // ncp approx 0; use student-t\n return jStat.studentt.pdf(x, dof)\n\n if (Math.abs(x) < tol) { // different formula for x == 0\n return Math.exp(jStat.gammaln((dof + 1) / 2) - ncp * ncp / 2 -\n 0.5 * Math.log(Math.PI * dof) - jStat.gammaln(dof / 2));\n }\n\n // formula for x != 0\n return dof / x *\n (jStat.noncentralt.cdf(x * Math.sqrt(1 + 2 / dof), dof+2, ncp) -\n jStat.noncentralt.cdf(x, dof, ncp));\n },\n\n cdf: function cdf(x, dof, ncp) {\n var tol = 1e-14;\n var min_iterations = 200;\n\n if (Math.abs(ncp) < tol) // ncp approx 0; use student-t\n return jStat.studentt.cdf(x, dof);\n\n // turn negative x into positive and flip result afterwards\n var flip = false;\n if (x < 0) {\n flip = true;\n ncp = -ncp;\n }\n\n var prob = jStat.normal.cdf(-ncp, 0, 1);\n var value = tol + 1;\n // use value at last two steps to determine convergence\n var lastvalue = value;\n var y = x * x / (x * x + dof);\n var j = 0;\n var p = Math.exp(-ncp * ncp / 2);\n var q = Math.exp(-ncp * ncp / 2 - 0.5 * Math.log(2) -\n jStat.gammaln(3 / 2)) * ncp;\n while (j < min_iterations || lastvalue > tol || value > tol) {\n lastvalue = value;\n if (j > 0) {\n p *= (ncp * ncp) / (2 * j);\n q *= (ncp * ncp) / (2 * (j + 1 / 2));\n }\n value = p * jStat.beta.cdf(y, j + 0.5, dof / 2) +\n q * jStat.beta.cdf(y, j+1, dof/2);\n prob += 0.5 * value;\n j++;\n }\n\n return flip ? (1 - prob) : prob;\n }\n});\n\n\n// extend normal function with static methods\njStat.extend(jStat.normal, {\n pdf: function pdf(x, mean, std) {\n return Math.exp(-0.5 * Math.log(2 * Math.PI) -\n Math.log(std) - Math.pow(x - mean, 2) / (2 * std * std));\n },\n\n cdf: function cdf(x, mean, std) {\n return 0.5 * (1 + jStat.erf((x - mean) / Math.sqrt(2 * std * std)));\n },\n\n inv: function(p, mean, std) {\n return -1.41421356237309505 * std * jStat.erfcinv(2 * p) + mean;\n },\n\n mean : function(mean, std) {\n return mean;\n },\n\n median: function median(mean, std) {\n return mean;\n },\n\n mode: function (mean, std) {\n return mean;\n },\n\n sample: function sample(mean, std) {\n return jStat.randn() * std + mean;\n },\n\n variance : function(mean, std) {\n return std * std;\n }\n});\n\n\n\n// extend pareto function with static methods\njStat.extend(jStat.pareto, {\n pdf: function pdf(x, scale, shape) {\n if (x < scale)\n return 0;\n return (shape * Math.pow(scale, shape)) / Math.pow(x, shape + 1);\n },\n\n cdf: function cdf(x, scale, shape) {\n if (x < scale)\n return 0;\n return 1 - Math.pow(scale / x, shape);\n },\n\n inv: function inv(p, scale, shape) {\n return scale / Math.pow(1 - p, 1 / shape);\n },\n\n mean: function mean(scale, shape) {\n if (shape <= 1)\n return undefined;\n return (shape * Math.pow(scale, shape)) / (shape - 1);\n },\n\n median: function median(scale, shape) {\n return scale * (shape * Math.SQRT2);\n },\n\n mode: function mode(scale, shape) {\n return scale;\n },\n\n variance : function(scale, shape) {\n if (shape <= 2)\n return undefined;\n return (scale*scale * shape) / (Math.pow(shape - 1, 2) * (shape - 2));\n }\n});\n\n\n\n// extend studentt function with static methods\njStat.extend(jStat.studentt, {\n pdf: function pdf(x, dof) {\n dof = dof > 1e100 ? 1e100 : dof;\n return (1/(Math.sqrt(dof) * jStat.betafn(0.5, dof/2))) *\n Math.pow(1 + ((x * x) / dof), -((dof + 1) / 2));\n },\n\n cdf: function cdf(x, dof) {\n var dof2 = dof / 2;\n return jStat.ibeta((x + Math.sqrt(x * x + dof)) /\n (2 * Math.sqrt(x * x + dof)), dof2, dof2);\n },\n\n inv: function(p, dof) {\n var x = jStat.ibetainv(2 * Math.min(p, 1 - p), 0.5 * dof, 0.5);\n x = Math.sqrt(dof * (1 - x) / x);\n return (p > 0.5) ? x : -x;\n },\n\n mean: function mean(dof) {\n return (dof > 1) ? 0 : undefined;\n },\n\n median: function median(dof) {\n return 0;\n },\n\n mode: function mode(dof) {\n return 0;\n },\n\n sample: function sample(dof) {\n return jStat.randn() * Math.sqrt(dof / (2 * jStat.randg(dof / 2)));\n },\n\n variance: function variance(dof) {\n return (dof > 2) ? dof / (dof - 2) : (dof > 1) ? Infinity : undefined;\n }\n});\n\n\n\n// extend weibull function with static methods\njStat.extend(jStat.weibull, {\n pdf: function pdf(x, scale, shape) {\n if (x < 0 || scale < 0 || shape < 0)\n return 0;\n return (shape / scale) * Math.pow((x / scale), (shape - 1)) *\n Math.exp(-(Math.pow((x / scale), shape)));\n },\n\n cdf: function cdf(x, scale, shape) {\n return x < 0 ? 0 : 1 - Math.exp(-Math.pow((x / scale), shape));\n },\n\n inv: function(p, scale, shape) {\n return scale * Math.pow(-Math.log(1 - p), 1 / shape);\n },\n\n mean : function(scale, shape) {\n return scale * jStat.gammafn(1 + 1 / shape);\n },\n\n median: function median(scale, shape) {\n return scale * Math.pow(Math.log(2), 1 / shape);\n },\n\n mode: function mode(scale, shape) {\n if (shape <= 1)\n return 0;\n return scale * Math.pow((shape - 1) / shape, 1 / shape);\n },\n\n sample: function sample(scale, shape) {\n return scale * Math.pow(-Math.log(Math.random()), 1 / shape);\n },\n\n variance: function variance(scale, shape) {\n return scale * scale * jStat.gammafn(1 + 2 / shape) -\n Math.pow(jStat.weibull.mean(scale, shape), 2);\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.uniform, {\n pdf: function pdf(x, a, b) {\n return (x < a || x > b) ? 0 : 1 / (b - a);\n },\n\n cdf: function cdf(x, a, b) {\n if (x < a)\n return 0;\n else if (x < b)\n return (x - a) / (b - a);\n return 1;\n },\n\n inv: function(p, a, b) {\n return a + (p * (b - a));\n },\n\n mean: function mean(a, b) {\n return 0.5 * (a + b);\n },\n\n median: function median(a, b) {\n return jStat.mean(a, b);\n },\n\n mode: function mode(a, b) {\n throw new Error('mode is not yet implemented');\n },\n\n sample: function sample(a, b) {\n return (a / 2 + b / 2) + (b / 2 - a / 2) * (2 * Math.random() - 1);\n },\n\n variance: function variance(a, b) {\n return Math.pow(b - a, 2) / 12;\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.binomial, {\n pdf: function pdf(k, n, p) {\n return (p === 0 || p === 1) ?\n ((n * p) === k ? 1 : 0) :\n jStat.combination(n, k) * Math.pow(p, k) * Math.pow(1 - p, n - k);\n },\n\n cdf: function cdf(x, n, p) {\n var binomarr = [],\n k = 0;\n if (x < 0) {\n return 0;\n }\n if (x < n) {\n for (; k <= x; k++) {\n binomarr[ k ] = jStat.binomial.pdf(k, n, p);\n }\n return jStat.sum(binomarr);\n }\n return 1;\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.negbin, {\n pdf: function pdf(k, r, p) {\n if (k !== k >>> 0)\n return false;\n if (k < 0)\n return 0;\n return jStat.combination(k + r - 1, r - 1) *\n Math.pow(1 - p, k) * Math.pow(p, r);\n },\n\n cdf: function cdf(x, r, p) {\n var sum = 0,\n k = 0;\n if (x < 0) return 0;\n for (; k <= x; k++) {\n sum += jStat.negbin.pdf(k, r, p);\n }\n return sum;\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.hypgeom, {\n pdf: function pdf(k, N, m, n) {\n // Hypergeometric PDF.\n\n // A simplification of the CDF algorithm below.\n\n // k = number of successes drawn\n // N = population size\n // m = number of successes in population\n // n = number of items drawn from population\n\n if(k !== k | 0) {\n return false;\n } else if(k < 0 || k < m - (N - n)) {\n // It's impossible to have this few successes drawn.\n return 0;\n } else if(k > n || k > m) {\n // It's impossible to have this many successes drawn.\n return 0;\n } else if (m * 2 > N) {\n // More than half the population is successes.\n\n if(n * 2 > N) {\n // More than half the population is sampled.\n\n return jStat.hypgeom.pdf(N - m - n + k, N, N - m, N - n)\n } else {\n // Half or less of the population is sampled.\n\n return jStat.hypgeom.pdf(n - k, N, N - m, n);\n }\n\n } else if(n * 2 > N) {\n // Half or less is successes.\n\n return jStat.hypgeom.pdf(m - k, N, m, N - n);\n\n } else if(m < n) {\n // We want to have the number of things sampled to be less than the\n // successes available. So swap the definitions of successful and sampled.\n return jStat.hypgeom.pdf(k, N, n, m);\n } else {\n // If we get here, half or less of the population was sampled, half or\n // less of it was successes, and we had fewer sampled things than\n // successes. Now we can do this complicated iterative algorithm in an\n // efficient way.\n\n // The basic premise of the algorithm is that we partially normalize our\n // intermediate product to keep it in a numerically good region, and then\n // finish the normalization at the end.\n\n // This variable holds the scaled probability of the current number of\n // successes.\n var scaledPDF = 1;\n\n // This keeps track of how much we have normalized.\n var samplesDone = 0;\n\n for(var i = 0; i < k; i++) {\n // For every possible number of successes up to that observed...\n\n while(scaledPDF > 1 && samplesDone < n) {\n // Intermediate result is growing too big. Apply some of the\n // normalization to shrink everything.\n\n scaledPDF *= 1 - (m / (N - samplesDone));\n\n // Say we've normalized by this sample already.\n samplesDone++;\n }\n\n // Work out the partially-normalized hypergeometric PDF for the next\n // number of successes\n scaledPDF *= (n - i) * (m - i) / ((i + 1) * (N - m - n + i + 1));\n }\n\n for(; samplesDone < n; samplesDone++) {\n // Apply all the rest of the normalization\n scaledPDF *= 1 - (m / (N - samplesDone));\n }\n\n // Bound answer sanely before returning.\n return Math.min(1, Math.max(0, scaledPDF));\n }\n },\n\n cdf: function cdf(x, N, m, n) {\n // Hypergeometric CDF.\n\n // This algorithm is due to Prof. Thomas S. Ferguson, ,\n // and comes from his hypergeometric test calculator at\n // .\n\n // x = number of successes drawn\n // N = population size\n // m = number of successes in population\n // n = number of items drawn from population\n\n if(x < 0 || x < m - (N - n)) {\n // It's impossible to have this few successes drawn or fewer.\n return 0;\n } else if(x >= n || x >= m) {\n // We will always have this many successes or fewer.\n return 1;\n } else if (m * 2 > N) {\n // More than half the population is successes.\n\n if(n * 2 > N) {\n // More than half the population is sampled.\n\n return jStat.hypgeom.cdf(N - m - n + x, N, N - m, N - n)\n } else {\n // Half or less of the population is sampled.\n\n return 1 - jStat.hypgeom.cdf(n - x - 1, N, N - m, n);\n }\n\n } else if(n * 2 > N) {\n // Half or less is successes.\n\n return 1 - jStat.hypgeom.cdf(m - x - 1, N, m, N - n);\n\n } else if(m < n) {\n // We want to have the number of things sampled to be less than the\n // successes available. So swap the definitions of successful and sampled.\n return jStat.hypgeom.cdf(x, N, n, m);\n } else {\n // If we get here, half or less of the population was sampled, half or\n // less of it was successes, and we had fewer sampled things than\n // successes. Now we can do this complicated iterative algorithm in an\n // efficient way.\n\n // The basic premise of the algorithm is that we partially normalize our\n // intermediate sum to keep it in a numerically good region, and then\n // finish the normalization at the end.\n\n // Holds the intermediate, scaled total CDF.\n var scaledCDF = 1;\n\n // This variable holds the scaled probability of the current number of\n // successes.\n var scaledPDF = 1;\n\n // This keeps track of how much we have normalized.\n var samplesDone = 0;\n\n for(var i = 0; i < x; i++) {\n // For every possible number of successes up to that observed...\n\n while(scaledCDF > 1 && samplesDone < n) {\n // Intermediate result is growing too big. Apply some of the\n // normalization to shrink everything.\n\n var factor = 1 - (m / (N - samplesDone));\n\n scaledPDF *= factor;\n scaledCDF *= factor;\n\n // Say we've normalized by this sample already.\n samplesDone++;\n }\n\n // Work out the partially-normalized hypergeometric PDF for the next\n // number of successes\n scaledPDF *= (n - i) * (m - i) / ((i + 1) * (N - m - n + i + 1));\n\n // Add to the CDF answer.\n scaledCDF += scaledPDF;\n }\n\n for(; samplesDone < n; samplesDone++) {\n // Apply all the rest of the normalization\n scaledCDF *= 1 - (m / (N - samplesDone));\n }\n\n // Bound answer sanely before returning.\n return Math.min(1, Math.max(0, scaledCDF));\n }\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.poisson, {\n pdf: function pdf(k, l) {\n if (l < 0 || (k % 1) !== 0 || k < 0) {\n return 0;\n }\n\n return Math.pow(l, k) * Math.exp(-l) / jStat.factorial(k);\n },\n\n cdf: function cdf(x, l) {\n var sumarr = [],\n k = 0;\n if (x < 0) return 0;\n for (; k <= x; k++) {\n sumarr.push(jStat.poisson.pdf(k, l));\n }\n return jStat.sum(sumarr);\n },\n\n mean : function(l) {\n return l;\n },\n\n variance : function(l) {\n return l;\n },\n\n sample: function sample(l) {\n var p = 1, k = 0, L = Math.exp(-l);\n do {\n k++;\n p *= Math.random();\n } while (p > L);\n return k - 1;\n }\n});\n\n// extend triangular function with static methods\njStat.extend(jStat.triangular, {\n pdf: function pdf(x, a, b, c) {\n if (b <= a || c < a || c > b) {\n return NaN;\n } else {\n if (x < a || x > b) {\n return 0;\n } else if (x < c) {\n return (2 * (x - a)) / ((b - a) * (c - a));\n } else if (x === c) {\n return (2 / (b - a));\n } else { // x > c\n return (2 * (b - x)) / ((b - a) * (b - c));\n }\n }\n },\n\n cdf: function cdf(x, a, b, c) {\n if (b <= a || c < a || c > b)\n return NaN;\n if (x <= a)\n return 0;\n else if (x >= b)\n return 1;\n if (x <= c)\n return Math.pow(x - a, 2) / ((b - a) * (c - a));\n else // x > c\n return 1 - Math.pow(b - x, 2) / ((b - a) * (b - c));\n },\n\n inv: function inv(p, a, b, c) {\n if (b <= a || c < a || c > b) {\n return NaN;\n } else {\n if (p <= ((c - a) / (b - a))) {\n return a + (b - a) * Math.sqrt(p * ((c - a) / (b - a)));\n } else { // p > ((c - a) / (b - a))\n return a + (b - a) * (1 - Math.sqrt((1 - p) * (1 - ((c - a) / (b - a)))));\n }\n }\n },\n\n mean: function mean(a, b, c) {\n return (a + b + c) / 3;\n },\n\n median: function median(a, b, c) {\n if (c <= (a + b) / 2) {\n return b - Math.sqrt((b - a) * (b - c)) / Math.sqrt(2);\n } else if (c > (a + b) / 2) {\n return a + Math.sqrt((b - a) * (c - a)) / Math.sqrt(2);\n }\n },\n\n mode: function mode(a, b, c) {\n return c;\n },\n\n sample: function sample(a, b, c) {\n var u = Math.random();\n if (u < ((c - a) / (b - a)))\n return a + Math.sqrt(u * (b - a) * (c - a))\n return b - Math.sqrt((1 - u) * (b - a) * (b - c));\n },\n\n variance: function variance(a, b, c) {\n return (a * a + b * b + c * c - a * b - a * c - b * c) / 18;\n }\n});\n\nfunction laplaceSign(x) { return x / Math.abs(x); }\n\njStat.extend(jStat.laplace, {\n pdf: function pdf(x, mu, b) {\n return (b <= 0) ? 0 : (Math.exp(-Math.abs(x - mu) / b)) / (2 * b);\n },\n\n cdf: function cdf(x, mu, b) {\n if (b <= 0) { return 0; }\n\n if(x < mu) {\n return 0.5 * Math.exp((x - mu) / b);\n } else {\n return 1 - 0.5 * Math.exp(- (x - mu) / b);\n }\n },\n\n mean: function(mu, b) {\n return mu;\n },\n\n median: function(mu, b) {\n return mu;\n },\n\n mode: function(mu, b) {\n return mu;\n },\n\n variance: function(mu, b) {\n return 2 * b * b;\n },\n\n sample: function sample(mu, b) {\n var u = Math.random() - 0.5;\n\n return mu - (b * laplaceSign(u) * Math.log(1 - (2 * Math.abs(u))));\n }\n});\n\n}(this.jStat, Math));\n/* Provides functions for the solution of linear system of equations, integration, extrapolation,\n * interpolation, eigenvalue problems, differential equations and PCA analysis. */\n\n(function(jStat, Math) {\n\nvar push = Array.prototype.push;\nvar isArray = jStat.utils.isArray;\n\nfunction isUsable(arg) {\n return isArray(arg) || arg instanceof jStat;\n}\n\njStat.extend({\n\n // add a vector/matrix to a vector/matrix or scalar\n add: function add(arr, arg) {\n // check if arg is a vector or scalar\n if (isUsable(arg)) {\n if (!isUsable(arg[0])) arg = [ arg ];\n return jStat.map(arr, function(value, row, col) {\n return value + arg[row][col];\n });\n }\n return jStat.map(arr, function(value) { return value + arg; });\n },\n\n // subtract a vector or scalar from the vector\n subtract: function subtract(arr, arg) {\n // check if arg is a vector or scalar\n if (isUsable(arg)) {\n if (!isUsable(arg[0])) arg = [ arg ];\n return jStat.map(arr, function(value, row, col) {\n return value - arg[row][col] || 0;\n });\n }\n return jStat.map(arr, function(value) { return value - arg; });\n },\n\n // matrix division\n divide: function divide(arr, arg) {\n if (isUsable(arg)) {\n if (!isUsable(arg[0])) arg = [ arg ];\n return jStat.multiply(arr, jStat.inv(arg));\n }\n return jStat.map(arr, function(value) { return value / arg; });\n },\n\n // matrix multiplication\n multiply: function multiply(arr, arg) {\n var row, col, nrescols, sum, nrow, ncol, res, rescols;\n // eg: arr = 2 arg = 3 -> 6 for res[0][0] statement closure\n if (arr.length === undefined && arg.length === undefined) {\n return arr * arg;\n }\n nrow = arr.length,\n ncol = arr[0].length,\n res = jStat.zeros(nrow, nrescols = (isUsable(arg)) ? arg[0].length : ncol),\n rescols = 0;\n if (isUsable(arg)) {\n for (; rescols < nrescols; rescols++) {\n for (row = 0; row < nrow; row++) {\n sum = 0;\n for (col = 0; col < ncol; col++)\n sum += arr[row][col] * arg[col][rescols];\n res[row][rescols] = sum;\n }\n }\n return (nrow === 1 && rescols === 1) ? res[0][0] : res;\n }\n return jStat.map(arr, function(value) { return value * arg; });\n },\n\n // outer([1,2,3],[4,5,6])\n // ===\n // [[1],[2],[3]] times [[4,5,6]]\n // ->\n // [[4,5,6],[8,10,12],[12,15,18]]\n outer:function outer(A, B) {\n return jStat.multiply(A.map(function(t){ return [t] }), [B]);\n },\n\n\n // Returns the dot product of two matricies\n dot: function dot(arr, arg) {\n if (!isUsable(arr[0])) arr = [ arr ];\n if (!isUsable(arg[0])) arg = [ arg ];\n // convert column to row vector\n var left = (arr[0].length === 1 && arr.length !== 1) ? jStat.transpose(arr) : arr,\n right = (arg[0].length === 1 && arg.length !== 1) ? jStat.transpose(arg) : arg,\n res = [],\n row = 0,\n nrow = left.length,\n ncol = left[0].length,\n sum, col;\n for (; row < nrow; row++) {\n res[row] = [];\n sum = 0;\n for (col = 0; col < ncol; col++)\n sum += left[row][col] * right[row][col];\n res[row] = sum;\n }\n return (res.length === 1) ? res[0] : res;\n },\n\n // raise every element by a scalar\n pow: function pow(arr, arg) {\n return jStat.map(arr, function(value) { return Math.pow(value, arg); });\n },\n\n // exponentiate every element\n exp: function exp(arr) {\n return jStat.map(arr, function(value) { return Math.exp(value); });\n },\n\n // generate the natural log of every element\n log: function exp(arr) {\n return jStat.map(arr, function(value) { return Math.log(value); });\n },\n\n // generate the absolute values of the vector\n abs: function abs(arr) {\n return jStat.map(arr, function(value) { return Math.abs(value); });\n },\n\n // computes the p-norm of the vector\n // In the case that a matrix is passed, uses the first row as the vector\n norm: function norm(arr, p) {\n var nnorm = 0,\n i = 0;\n // check the p-value of the norm, and set for most common case\n if (isNaN(p)) p = 2;\n // check if multi-dimensional array, and make vector correction\n if (isUsable(arr[0])) arr = arr[0];\n // vector norm\n for (; i < arr.length; i++) {\n nnorm += Math.pow(Math.abs(arr[i]), p);\n }\n return Math.pow(nnorm, 1 / p);\n },\n\n // computes the angle between two vectors in rads\n // In case a matrix is passed, this uses the first row as the vector\n angle: function angle(arr, arg) {\n return Math.acos(jStat.dot(arr, arg) / (jStat.norm(arr) * jStat.norm(arg)));\n },\n\n // augment one matrix by another\n // Note: this function returns a matrix, not a jStat object\n aug: function aug(a, b) {\n var newarr = [];\n for (var i = 0; i < a.length; i++) {\n newarr.push(a[i].slice());\n }\n for (var i = 0; i < newarr.length; i++) {\n push.apply(newarr[i], b[i]);\n }\n return newarr;\n },\n\n // The inv() function calculates the inverse of a matrix\n // Create the inverse by augmenting the matrix by the identity matrix of the\n // appropriate size, and then use G-J elimination on the augmented matrix.\n inv: function inv(a) {\n var rows = a.length;\n var cols = a[0].length;\n var b = jStat.identity(rows, cols);\n var c = jStat.gauss_jordan(a, b);\n var result = [];\n var i = 0;\n var j;\n\n //We need to copy the inverse portion to a new matrix to rid G-J artifacts\n for (; i < rows; i++) {\n result[i] = [];\n for (j = cols; j < c[0].length; j++)\n result[i][j - cols] = c[i][j];\n }\n return result;\n },\n\n // calculate the determinant of a matrix\n det: function det(a) {\n var alen = a.length,\n alend = alen * 2,\n vals = new Array(alend),\n rowshift = alen - 1,\n colshift = alend - 1,\n mrow = rowshift - alen + 1,\n mcol = colshift,\n i = 0,\n result = 0,\n j;\n // check for special 2x2 case\n if (alen === 2) {\n return a[0][0] * a[1][1] - a[0][1] * a[1][0];\n }\n for (; i < alend; i++) {\n vals[i] = 1;\n }\n for (var i = 0; i < alen; i++) {\n for (j = 0; j < alen; j++) {\n vals[(mrow < 0) ? mrow + alen : mrow ] *= a[i][j];\n vals[(mcol < alen) ? mcol + alen : mcol ] *= a[i][j];\n mrow++;\n mcol--;\n }\n mrow = --rowshift - alen + 1;\n mcol = --colshift;\n }\n for (var i = 0; i < alen; i++) {\n result += vals[i];\n }\n for (; i < alend; i++) {\n result -= vals[i];\n }\n return result;\n },\n\n gauss_elimination: function gauss_elimination(a, b) {\n var i = 0,\n j = 0,\n n = a.length,\n m = a[0].length,\n factor = 1,\n sum = 0,\n x = [],\n maug, pivot, temp, k;\n a = jStat.aug(a, b);\n maug = a[0].length;\n for(var i = 0; i < n; i++) {\n pivot = a[i][i];\n j = i;\n for (k = i + 1; k < m; k++) {\n if (pivot < Math.abs(a[k][i])) {\n pivot = a[k][i];\n j = k;\n }\n }\n if (j != i) {\n for(k = 0; k < maug; k++) {\n temp = a[i][k];\n a[i][k] = a[j][k];\n a[j][k] = temp;\n }\n }\n for (j = i + 1; j < n; j++) {\n factor = a[j][i] / a[i][i];\n for(k = i; k < maug; k++) {\n a[j][k] = a[j][k] - factor * a[i][k];\n }\n }\n }\n for (var i = n - 1; i >= 0; i--) {\n sum = 0;\n for (j = i + 1; j<= n - 1; j++) {\n sum = sum + x[j] * a[i][j];\n }\n x[i] =(a[i][maug - 1] - sum) / a[i][i];\n }\n return x;\n },\n\n gauss_jordan: function gauss_jordan(a, b) {\n var m = jStat.aug(a, b),\n h = m.length,\n w = m[0].length;\n // find max pivot\n for (var y = 0; y < h; y++) {\n var maxrow = y;\n for (var y2 = y+1; y2 < h; y2++) {\n if (Math.abs(m[y2][y]) > Math.abs(m[maxrow][y]))\n maxrow = y2;\n }\n var tmp = m[y];\n m[y] = m[maxrow];\n m[maxrow] = tmp\n for (var y2 = y+1; y2 < h; y2++) {\n c = m[y2][y] / m[y][y];\n for (var x = y; x < w; x++) {\n m[y2][x] -= m[y][x] * c;\n }\n }\n }\n // backsubstitute\n for (var y = h-1; y >= 0; y--) {\n c = m[y][y];\n for (var y2 = 0; y2 < y; y2++) {\n for (var x = w-1; x > y-1; x--) {\n m[y2][x] -= m[y][x] * m[y2][y] / c;\n }\n }\n m[y][y] /= c;\n for (var x = h; x < w; x++) {\n m[y][x] /= c;\n }\n }\n return m;\n },\n\n // solve equation\n // Ax=b\n // A is upper triangular matrix\n // A=[[1,2,3],[0,4,5],[0,6,7]]\n // b=[1,2,3]\n // triaUpSolve(A,b) // -> [2.666,0.1666,1.666]\n // if you use matrix style\n // A=[[1,2,3],[0,4,5],[0,6,7]]\n // b=[[1],[2],[3]]\n // will return [[2.666],[0.1666],[1.666]]\n triaUpSolve: function triaUpSolve(A, b) {\n var size = A[0].length;\n var x = jStat.zeros(1, size)[0];\n var parts;\n var matrix_mode = false;\n\n if (b[0].length != undefined) {\n b = b.map(function(i){ return i[0] });\n matrix_mode = true;\n }\n\n jStat.arange(size - 1, -1, -1).forEach(function(i) {\n parts = jStat.arange(i + 1,size).map(function(j) {\n return x[j] * A[i][j];\n });\n x[i] = (b[i] - jStat.sum(parts)) / A[i][i];\n });\n\n if (matrix_mode)\n return x.map(function(i){ return [i] });\n return x;\n },\n\n triaLowSolve: function triaLowSolve(A, b) {\n // like to triaUpSolve but A is lower triangular matrix\n var size = A[0].length;\n var x = jStat.zeros(1, size)[0];\n var parts;\n\n var matrix_mode=false;\n if (b[0].length != undefined) {\n b = b.map(function(i){ return i[0] });\n matrix_mode = true;\n }\n\n jStat.arange(size).forEach(function(i) {\n parts = jStat.arange(i).map(function(j) {\n return A[i][j] * x[j];\n });\n x[i] = (b[i] - jStat.sum(parts)) / A[i][i];\n })\n\n if (matrix_mode)\n return x.map(function(i){ return [i] });\n return x;\n },\n\n // A -> [L,U]\n // A=LU\n // L is lower triangular matrix\n // U is upper triangular matrix\n lu: function lu(A) {\n var size = A.length;\n //var L=jStat.diagonal(jStat.ones(1,size)[0]);\n var L = jStat.identity(size);\n var R = jStat.zeros(A.length, A[0].length);\n var parts;\n jStat.arange(size).forEach(function(t) {\n R[0][t] = A[0][t];\n });\n jStat.arange(1, size).forEach(function(l) {\n jStat.arange(l).forEach(function(i) {\n parts = jStat.arange(i).map(function(jj) {\n return L[l][jj] * R[jj][i];\n });\n L[l][i] = (A[l][i] - jStat.sum(parts)) / R[i][i];\n });\n jStat.arange(l, size).forEach(function(j) {\n parts = jStat.arange(l).map(function(jj) {\n return L[l][jj] * R[jj][j];\n });\n R[l][j] = A[i][j] - jStat.sum(parts);\n });\n });\n return [L, R];\n },\n\n // A -> T\n // A=TT'\n // T is lower triangular matrix\n cholesky: function cholesky(A) {\n var size = A.length;\n var T = jStat.zeros(A.length, A[0].length);\n var parts;\n jStat.arange(size).forEach(function(i) {\n parts = jStat.arange(i).map(function(t) {\n return Math.pow(T[i][t],2);\n });\n T[i][i] = Math.sqrt(A[i][i] - jStat.sum(parts));\n jStat.arange(i + 1, size).forEach(function(j) {\n parts = jStat.arange(i).map(function(t) {\n return T[i][t] * T[j][t];\n });\n T[j][i] = (A[i][j] - jStat.sum(parts)) / T[i][i];\n });\n });\n return T;\n },\n\n gauss_jacobi: function gauss_jacobi(a, b, x, r) {\n var i = 0;\n var j = 0;\n var n = a.length;\n var l = [];\n var u = [];\n var d = [];\n var xv, c, h, xk;\n for (; i < n; i++) {\n l[i] = [];\n u[i] = [];\n d[i] = [];\n for (j = 0; j < n; j++) {\n if (i > j) {\n l[i][j] = a[i][j];\n u[i][j] = d[i][j] = 0;\n } else if (i < j) {\n u[i][j] = a[i][j];\n l[i][j] = d[i][j] = 0;\n } else {\n d[i][j] = a[i][j];\n l[i][j] = u[i][j] = 0;\n }\n }\n }\n h = jStat.multiply(jStat.multiply(jStat.inv(d), jStat.add(l, u)), -1);\n c = jStat.multiply(jStat.inv(d), b);\n xv = x;\n xk = jStat.add(jStat.multiply(h, x), c);\n i = 2;\n while (Math.abs(jStat.norm(jStat.subtract(xk,xv))) > r) {\n xv = xk;\n xk = jStat.add(jStat.multiply(h, xv), c);\n i++;\n }\n return xk;\n },\n\n gauss_seidel: function gauss_seidel(a, b, x, r) {\n var i = 0;\n var n = a.length;\n var l = [];\n var u = [];\n var d = [];\n var j, xv, c, h, xk;\n for (; i < n; i++) {\n l[i] = [];\n u[i] = [];\n d[i] = [];\n for (j = 0; j < n; j++) {\n if (i > j) {\n l[i][j] = a[i][j];\n u[i][j] = d[i][j] = 0;\n } else if (i < j) {\n u[i][j] = a[i][j];\n l[i][j] = d[i][j] = 0;\n } else {\n d[i][j] = a[i][j];\n l[i][j] = u[i][j] = 0;\n }\n }\n }\n h = jStat.multiply(jStat.multiply(jStat.inv(jStat.add(d, l)), u), -1);\n c = jStat.multiply(jStat.inv(jStat.add(d, l)), b);\n xv = x;\n xk = jStat.add(jStat.multiply(h, x), c);\n i = 2;\n while (Math.abs(jStat.norm(jStat.subtract(xk, xv))) > r) {\n xv = xk;\n xk = jStat.add(jStat.multiply(h, xv), c);\n i = i + 1;\n }\n return xk;\n },\n\n SOR: function SOR(a, b, x, r, w) {\n var i = 0;\n var n = a.length;\n var l = [];\n var u = [];\n var d = [];\n var j, xv, c, h, xk;\n for (; i < n; i++) {\n l[i] = [];\n u[i] = [];\n d[i] = [];\n for (j = 0; j < n; j++) {\n if (i > j) {\n l[i][j] = a[i][j];\n u[i][j] = d[i][j] = 0;\n } else if (i < j) {\n u[i][j] = a[i][j];\n l[i][j] = d[i][j] = 0;\n } else {\n d[i][j] = a[i][j];\n l[i][j] = u[i][j] = 0;\n }\n }\n }\n h = jStat.multiply(jStat.inv(jStat.add(d, jStat.multiply(l, w))),\n jStat.subtract(jStat.multiply(d, 1 - w),\n jStat.multiply(u, w)));\n c = jStat.multiply(jStat.multiply(jStat.inv(jStat.add(d,\n jStat.multiply(l, w))), b), w);\n xv = x;\n xk = jStat.add(jStat.multiply(h, x), c);\n i = 2;\n while (Math.abs(jStat.norm(jStat.subtract(xk, xv))) > r) {\n xv = xk;\n xk = jStat.add(jStat.multiply(h, xv), c);\n i++;\n }\n return xk;\n },\n\n householder: function householder(a) {\n var m = a.length;\n var n = a[0].length;\n var i = 0;\n var w = [];\n var p = [];\n var alpha, r, k, j, factor;\n for (; i < m - 1; i++) {\n alpha = 0;\n for (j = i + 1; j < n; j++)\n alpha += (a[j][i] * a[j][i]);\n factor = (a[i + 1][i] > 0) ? -1 : 1;\n alpha = factor * Math.sqrt(alpha);\n r = Math.sqrt((((alpha * alpha) - a[i + 1][i] * alpha) / 2));\n w = jStat.zeros(m, 1);\n w[i + 1][0] = (a[i + 1][i] - alpha) / (2 * r);\n for (k = i + 2; k < m; k++) w[k][0] = a[k][i] / (2 * r);\n p = jStat.subtract(jStat.identity(m, n),\n jStat.multiply(jStat.multiply(w, jStat.transpose(w)), 2));\n a = jStat.multiply(p, jStat.multiply(a, p));\n }\n return a;\n },\n\n // A -> [Q,R]\n // Q is orthogonal matrix\n // R is upper triangular\n QR: (function() {\n // x -> Q\n // find a orthogonal matrix Q st.\n // Qx=y\n // y is [||x||,0,0,...]\n function get_Q1(x) {\n var size = x.length;\n var norm_x = jStat.norm(x,2);\n var e1 = jStat.zeros(1, size)[0];\n e1[0] = 1;\n var u = jStat.add(jStat.multiply(jStat.multiply(e1, norm_x), -1), x);\n var norm_u = jStat.norm(u, 2);\n var v = jStat.divide(u, norm_u);\n var Q = jStat.subtract(jStat.identity(size),\n jStat.multiply(jStat.outer(v, v), 2));\n return Q;\n }\n\n function qr(A) {\n var size = A[0].length;\n var QList = [];\n jStat.arange(size).forEach(function(i) {\n var x = jStat.slice(A, { row: { start: i }, col: i });\n var Q = get_Q1(x);\n var Qn = jStat.identity(A.length);\n Qn = jStat.sliceAssign(Qn, { row: { start: i }, col: { start: i }}, Q);\n A = jStat.multiply(Qn, A);\n QList.push(Qn);\n });\n var Q = QList.reduce(function(x, y){ return jStat.multiply(x,y) });\n var R = A;\n return [Q, R];\n }\n\n return qr;\n })(),\n\n lstsq: (function(A, b) {\n // solve least squard problem for Ax=b as QR decomposition way if b is\n // [[b1],[b2],[b3]] form will return [[x1],[x2],[x3]] array form solution\n // else b is [b1,b2,b3] form will return [x1,x2,x3] array form solution\n function R_I(A) {\n A = jStat.copy(A);\n var size = A.length;\n var I = jStat.identity(size);\n jStat.arange(size - 1, -1, -1).forEach(function(i) {\n jStat.sliceAssign(\n I, { row: i }, jStat.divide(jStat.slice(I, { row: i }), A[i][i]));\n jStat.sliceAssign(\n A, { row: i }, jStat.divide(jStat.slice(A, { row: i }), A[i][i]));\n jStat.arange(i).forEach(function(j) {\n var c = jStat.multiply(A[j][i], -1);\n var Aj = jStat.slice(A, { row: j });\n var cAi = jStat.multiply(jStat.slice(A, { row: i }), c);\n jStat.sliceAssign(A, { row: j }, jStat.add(Aj, cAi));\n var Ij = jStat.slice(I, { row: j });\n var cIi = jStat.multiply(jStat.slice(I, { row: i }), c);\n jStat.sliceAssign(I, { row: j }, jStat.add(Ij, cIi));\n })\n });\n return I;\n }\n\n function qr_solve(A, b){\n var array_mode = false;\n if (b[0].length === undefined) {\n // [c1,c2,c3] mode\n b = b.map(function(x){ return [x] });\n array_mode = true;\n }\n var QR = jStat.QR(A);\n var Q = QR[0];\n var R = QR[1];\n var attrs = A[0].length;\n var Q1 = jStat.slice(Q,{col:{end:attrs}});\n var R1 = jStat.slice(R,{row:{end:attrs}});\n var RI = R_I(R1);\n var x = jStat.multiply(jStat.multiply(RI, jStat.transpose(Q1)), b);\n if (array_mode)\n return x.map(function(i){ return i[0] });\n return x;\n }\n\n return qr_solve;\n })(),\n\n jacobi: function jacobi(a) {\n var condition = 1;\n var count = 0;\n var n = a.length;\n var e = jStat.identity(n, n);\n var ev = [];\n var b, i, j, p, q, maxim, theta, s;\n // condition === 1 only if tolerance is not reached\n while (condition === 1) {\n count++;\n maxim = a[0][1];\n p = 0;\n q = 1;\n for (var i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n if (i != j) {\n if (maxim < Math.abs(a[i][j])) {\n maxim = Math.abs(a[i][j]);\n p = i;\n q = j;\n }\n }\n }\n }\n if (a[p][p] === a[q][q])\n theta = (a[p][q] > 0) ? Math.PI / 4 : -Math.PI / 4;\n else\n theta = Math.atan(2 * a[p][q] / (a[p][p] - a[q][q])) / 2;\n s = jStat.identity(n, n);\n s[p][p] = Math.cos(theta);\n s[p][q] = -Math.sin(theta);\n s[q][p] = Math.sin(theta);\n s[q][q] = Math.cos(theta);\n // eigen vector matrix\n e = jStat.multiply(e, s);\n b = jStat.multiply(jStat.multiply(jStat.inv(s), a), s);\n a = b;\n condition = 0;\n for (var i = 1; i < n; i++) {\n for (j = 1; j < n; j++) {\n if (i != j && Math.abs(a[i][j]) > 0.001) {\n condition = 1;\n }\n }\n }\n }\n for (var i = 0; i < n; i++) ev.push(a[i][i]);\n //returns both the eigenvalue and eigenmatrix\n return [e, ev];\n },\n\n rungekutta: function rungekutta(f, h, p, t_j, u_j, order) {\n var k1, k2, u_j1, k3, k4;\n if (order === 2) {\n while (t_j <= p) {\n k1 = h * f(t_j, u_j);\n k2 = h * f(t_j + h, u_j + k1);\n u_j1 = u_j + (k1 + k2) / 2;\n u_j = u_j1;\n t_j = t_j + h;\n }\n }\n if (order === 4) {\n while (t_j <= p) {\n k1 = h * f(t_j, u_j);\n k2 = h * f(t_j + h / 2, u_j + k1 / 2);\n k3 = h * f(t_j + h / 2, u_j + k2 / 2);\n k4 = h * f(t_j +h, u_j + k3);\n u_j1 = u_j + (k1 + 2 * k2 + 2 * k3 + k4) / 6;\n u_j = u_j1;\n t_j = t_j + h;\n }\n }\n return u_j;\n },\n\n romberg: function romberg(f, a, b, order) {\n var i = 0;\n var h = (b - a) / 2;\n var x = [];\n var h1 = [];\n var g = [];\n var m, a1, j, k, I, d;\n while (i < order / 2) {\n I = f(a);\n for (j = a, k = 0; j <= b; j = j + h, k++) x[k] = j;\n m = x.length;\n for (j = 1; j < m - 1; j++) {\n I += (((j % 2) !== 0) ? 4 : 2) * f(x[j]);\n }\n I = (h / 3) * (I + f(b));\n g[i] = I;\n h /= 2;\n i++;\n }\n a1 = g.length;\n m = 1;\n while (a1 !== 1) {\n for (j = 0; j < a1 - 1; j++)\n h1[j] = ((Math.pow(4, m)) * g[j + 1] - g[j]) / (Math.pow(4, m) - 1);\n a1 = h1.length;\n g = h1;\n h1 = [];\n m++;\n }\n return g;\n },\n\n richardson: function richardson(X, f, x, h) {\n function pos(X, x) {\n var i = 0;\n var n = X.length;\n var p;\n for (; i < n; i++)\n if (X[i] === x) p = i;\n return p;\n }\n var n = X.length,\n h_min = Math.abs(x - X[pos(X, x) + 1]),\n i = 0,\n g = [],\n h1 = [],\n y1, y2, m, a, j;\n while (h >= h_min) {\n y1 = pos(X, x + h);\n y2 = pos(X, x);\n g[i] = (f[y1] - 2 * f[y2] + f[2 * y2 - y1]) / (h * h);\n h /= 2;\n i++;\n }\n a = g.length;\n m = 1;\n while (a != 1) {\n for (j = 0; j < a - 1; j++)\n h1[j] = ((Math.pow(4, m)) * g[j + 1] - g[j]) / (Math.pow(4, m) - 1);\n a = h1.length;\n g = h1;\n h1 = [];\n m++;\n }\n return g;\n },\n\n simpson: function simpson(f, a, b, n) {\n var h = (b - a) / n;\n var I = f(a);\n var x = [];\n var j = a;\n var k = 0;\n var i = 1;\n var m;\n for (; j <= b; j = j + h, k++)\n x[k] = j;\n m = x.length;\n for (; i < m - 1; i++) {\n I += ((i % 2 !== 0) ? 4 : 2) * f(x[i]);\n }\n return (h / 3) * (I + f(b));\n },\n\n hermite: function hermite(X, F, dF, value) {\n var n = X.length;\n var p = 0;\n var i = 0;\n var l = [];\n var dl = [];\n var A = [];\n var B = [];\n var j;\n for (; i < n; i++) {\n l[i] = 1;\n for (j = 0; j < n; j++) {\n if (i != j) l[i] *= (value - X[j]) / (X[i] - X[j]);\n }\n dl[i] = 0;\n for (j = 0; j < n; j++) {\n if (i != j) dl[i] += 1 / (X [i] - X[j]);\n }\n A[i] = (1 - 2 * (value - X[i]) * dl[i]) * (l[i] * l[i]);\n B[i] = (value - X[i]) * (l[i] * l[i]);\n p += (A[i] * F[i] + B[i] * dF[i]);\n }\n return p;\n },\n\n lagrange: function lagrange(X, F, value) {\n var p = 0;\n var i = 0;\n var j, l;\n var n = X.length;\n for (; i < n; i++) {\n l = F[i];\n for (j = 0; j < n; j++) {\n // calculating the lagrange polynomial L_i\n if (i != j) l *= (value - X[j]) / (X[i] - X[j]);\n }\n // adding the lagrange polynomials found above\n p += l;\n }\n return p;\n },\n\n cubic_spline: function cubic_spline(X, F, value) {\n var n = X.length;\n var i = 0, j;\n var A = [];\n var B = [];\n var alpha = [];\n var c = [];\n var h = [];\n var b = [];\n var d = [];\n for (; i < n - 1; i++)\n h[i] = X[i + 1] - X[i];\n alpha[0] = 0;\n for (var i = 1; i < n - 1; i++) {\n alpha[i] = (3 / h[i]) * (F[i + 1] - F[i]) -\n (3 / h[i-1]) * (F[i] - F[i-1]);\n }\n for (var i = 1; i < n - 1; i++) {\n A[i] = [];\n B[i] = [];\n A[i][i-1] = h[i-1];\n A[i][i] = 2 * (h[i - 1] + h[i]);\n A[i][i+1] = h[i];\n B[i][0] = alpha[i];\n }\n c = jStat.multiply(jStat.inv(A), B);\n for (j = 0; j < n - 1; j++) {\n b[j] = (F[j + 1] - F[j]) / h[j] - h[j] * (c[j + 1][0] + 2 * c[j][0]) / 3;\n d[j] = (c[j + 1][0] - c[j][0]) / (3 * h[j]);\n }\n for (j = 0; j < n; j++) {\n if (X[j] > value) break;\n }\n j -= 1;\n return F[j] + (value - X[j]) * b[j] + jStat.sq(value-X[j]) *\n c[j] + (value - X[j]) * jStat.sq(value - X[j]) * d[j];\n },\n\n gauss_quadrature: function gauss_quadrature() {\n throw new Error('gauss_quadrature not yet implemented');\n },\n\n PCA: function PCA(X) {\n var m = X.length;\n var n = X[0].length;\n var flag = false;\n var i = 0;\n var j, temp1;\n var u = [];\n var D = [];\n var result = [];\n var temp2 = [];\n var Y = [];\n var Bt = [];\n var B = [];\n var C = [];\n var V = [];\n var Vt = [];\n for (var i = 0; i < m; i++) {\n u[i] = jStat.sum(X[i]) / n;\n }\n for (var i = 0; i < n; i++) {\n B[i] = [];\n for(j = 0; j < m; j++) {\n B[i][j] = X[j][i] - u[j];\n }\n }\n B = jStat.transpose(B);\n for (var i = 0; i < m; i++) {\n C[i] = [];\n for (j = 0; j < m; j++) {\n C[i][j] = (jStat.dot([B[i]], [B[j]])) / (n - 1);\n }\n }\n result = jStat.jacobi(C);\n V = result[0];\n D = result[1];\n Vt = jStat.transpose(V);\n for (var i = 0; i < D.length; i++) {\n for (j = i; j < D.length; j++) {\n if(D[i] < D[j]) {\n temp1 = D[i];\n D[i] = D[j];\n D[j] = temp1;\n temp2 = Vt[i];\n Vt[i] = Vt[j];\n Vt[j] = temp2;\n }\n }\n }\n Bt = jStat.transpose(B);\n for (var i = 0; i < m; i++) {\n Y[i] = [];\n for (j = 0; j < Bt.length; j++) {\n Y[i][j] = jStat.dot([Vt[i]], [Bt[j]]);\n }\n }\n return [X, D, Vt, Y];\n }\n});\n\n// extend jStat.fn with methods that require one argument\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jStat.fn[passfunc] = function(arg, func) {\n var tmpthis = this;\n // check for callback\n if (func) {\n setTimeout(function() {\n func.call(tmpthis, jStat.fn[passfunc].call(tmpthis, arg));\n }, 15);\n return this;\n }\n if (typeof jStat[passfunc](this, arg) === 'number')\n return jStat[passfunc](this, arg);\n else\n return jStat(jStat[passfunc](this, arg));\n };\n }(funcs[i]));\n}('add divide multiply subtract dot pow exp log abs norm angle'.split(' ')));\n\n}(this.jStat, Math));\n(function(jStat, Math) {\n\nvar slice = [].slice;\nvar isNumber = jStat.utils.isNumber;\nvar isArray = jStat.utils.isArray;\n\n// flag==true denotes use of sample standard deviation\n// Z Statistics\njStat.extend({\n // 2 different parameter lists:\n // (value, mean, sd)\n // (value, array, flag)\n zscore: function zscore() {\n var args = slice.call(arguments);\n if (isNumber(args[1])) {\n return (args[0] - args[1]) / args[2];\n }\n return (args[0] - jStat.mean(args[1])) / jStat.stdev(args[1], args[2]);\n },\n\n // 3 different paramter lists:\n // (value, mean, sd, sides)\n // (zscore, sides)\n // (value, array, sides, flag)\n ztest: function ztest() {\n var args = slice.call(arguments);\n var z;\n if (isArray(args[1])) {\n // (value, array, sides, flag)\n z = jStat.zscore(args[0],args[1],args[3]);\n return (args[2] === 1) ?\n (jStat.normal.cdf(-Math.abs(z), 0, 1)) :\n (jStat.normal.cdf(-Math.abs(z), 0, 1)*2);\n } else {\n if (args.length > 2) {\n // (value, mean, sd, sides)\n z = jStat.zscore(args[0],args[1],args[2]);\n return (args[3] === 1) ?\n (jStat.normal.cdf(-Math.abs(z),0,1)) :\n (jStat.normal.cdf(-Math.abs(z),0,1)* 2);\n } else {\n // (zscore, sides)\n z = args[0];\n return (args[1] === 1) ?\n (jStat.normal.cdf(-Math.abs(z),0,1)) :\n (jStat.normal.cdf(-Math.abs(z),0,1)*2);\n }\n }\n }\n});\n\njStat.extend(jStat.fn, {\n zscore: function zscore(value, flag) {\n return (value - this.mean()) / this.stdev(flag);\n },\n\n ztest: function ztest(value, sides, flag) {\n var zscore = Math.abs(this.zscore(value, flag));\n return (sides === 1) ?\n (jStat.normal.cdf(-zscore, 0, 1)) :\n (jStat.normal.cdf(-zscore, 0, 1) * 2);\n }\n});\n\n// T Statistics\njStat.extend({\n // 2 parameter lists\n // (value, mean, sd, n)\n // (value, array)\n tscore: function tscore() {\n var args = slice.call(arguments);\n return (args.length === 4) ?\n ((args[0] - args[1]) / (args[2] / Math.sqrt(args[3]))) :\n ((args[0] - jStat.mean(args[1])) /\n (jStat.stdev(args[1], true) / Math.sqrt(args[1].length)));\n },\n\n // 3 different paramter lists:\n // (value, mean, sd, n, sides)\n // (tscore, n, sides)\n // (value, array, sides)\n ttest: function ttest() {\n var args = slice.call(arguments);\n var tscore;\n if (args.length === 5) {\n tscore = Math.abs(jStat.tscore(args[0], args[1], args[2], args[3]));\n return (args[4] === 1) ?\n (jStat.studentt.cdf(-tscore, args[3]-1)) :\n (jStat.studentt.cdf(-tscore, args[3]-1)*2);\n }\n if (isNumber(args[1])) {\n tscore = Math.abs(args[0])\n return (args[2] == 1) ?\n (jStat.studentt.cdf(-tscore, args[1]-1)) :\n (jStat.studentt.cdf(-tscore, args[1]-1) * 2);\n }\n tscore = Math.abs(jStat.tscore(args[0], args[1]))\n return (args[2] == 1) ?\n (jStat.studentt.cdf(-tscore, args[1].length-1)) :\n (jStat.studentt.cdf(-tscore, args[1].length-1) * 2);\n }\n});\n\njStat.extend(jStat.fn, {\n tscore: function tscore(value) {\n return (value - this.mean()) / (this.stdev(true) / Math.sqrt(this.cols()));\n },\n\n ttest: function ttest(value, sides) {\n return (sides === 1) ?\n (1 - jStat.studentt.cdf(Math.abs(this.tscore(value)), this.cols()-1)) :\n (jStat.studentt.cdf(-Math.abs(this.tscore(value)), this.cols()-1)*2);\n }\n});\n\n// F Statistics\njStat.extend({\n // Paramter list is as follows:\n // (array1, array2, array3, ...)\n // or it is an array of arrays\n // array of arrays conversion\n anovafscore: function anovafscore() {\n var args = slice.call(arguments),\n expVar, sample, sampMean, sampSampMean, tmpargs, unexpVar, i, j;\n if (args.length === 1) {\n tmpargs = new Array(args[0].length);\n for (var i = 0; i < args[0].length; i++) {\n tmpargs[i] = args[0][i];\n }\n args = tmpargs;\n }\n // 2 sample case\n if (args.length === 2) {\n return jStat.variance(args[0]) / jStat.variance(args[1]);\n }\n // Builds sample array\n sample = new Array();\n for (var i = 0; i < args.length; i++) {\n sample = sample.concat(args[i]);\n }\n sampMean = jStat.mean(sample);\n // Computes the explained variance\n expVar = 0;\n for (var i = 0; i < args.length; i++) {\n expVar = expVar + args[i].length * Math.pow(jStat.mean(args[i]) - sampMean, 2);\n }\n expVar /= (args.length - 1);\n // Computes unexplained variance\n unexpVar = 0;\n for (var i = 0; i < args.length; i++) {\n sampSampMean = jStat.mean(args[i]);\n for (j = 0; j < args[i].length; j++) {\n unexpVar += Math.pow(args[i][j] - sampSampMean, 2);\n }\n }\n unexpVar /= (sample.length - args.length);\n return expVar / unexpVar;\n },\n\n // 2 different paramter setups\n // (array1, array2, array3, ...)\n // (anovafscore, df1, df2)\n anovaftest: function anovaftest() {\n var args = slice.call(arguments),\n df1, df2, n, i;\n if (isNumber(args[0])) {\n return 1 - jStat.centralF.cdf(args[0], args[1], args[2]);\n }\n anovafscore = jStat.anovafscore(args);\n df1 = args.length - 1;\n n = 0;\n for (var i = 0; i < args.length; i++) {\n n = n + args[i].length;\n }\n df2 = n - df1 - 1;\n return 1 - jStat.centralF.cdf(anovafscore, df1, df2);\n },\n\n ftest: function ftest(fscore, df1, df2) {\n return 1 - jStat.centralF.cdf(fscore, df1, df2);\n }\n});\n\njStat.extend(jStat.fn, {\n anovafscore: function anovafscore() {\n return jStat.anovafscore(this.toArray());\n },\n\n anovaftes: function anovaftes() {\n var n = 0;\n var i;\n for (var i = 0; i < this.length; i++) {\n n = n + this[i].length;\n }\n return jStat.ftest(this.anovafscore(), this.length - 1, n - this.length);\n }\n});\n\n// Error Bounds\njStat.extend({\n // 2 different parameter setups\n // (value, alpha, sd, n)\n // (value, alpha, array)\n normalci: function normalci() {\n var args = slice.call(arguments),\n ans = new Array(2),\n change;\n if (args.length === 4) {\n change = Math.abs(jStat.normal.inv(args[1] / 2, 0, 1) *\n args[2] / Math.sqrt(args[3]));\n } else {\n change = Math.abs(jStat.normal.inv(args[1] / 2, 0, 1) *\n jStat.stdev(args[2]) / Math.sqrt(args[2].length));\n }\n ans[0] = args[0] - change;\n ans[1] = args[0] + change;\n return ans;\n },\n\n // 2 different parameter setups\n // (value, alpha, sd, n)\n // (value, alpha, array)\n tci: function tci() {\n var args = slice.call(arguments),\n ans = new Array(2),\n change;\n if (args.length === 4) {\n change = Math.abs(jStat.studentt.inv(args[1] / 2, args[3] - 1) *\n args[2] / Math.sqrt(args[3]));\n } else {\n change = Math.abs(jStat.studentt.inv(args[1] / 2, args[2].length - 1) *\n jStat.stdev(args[2], true) / Math.sqrt(args[2].length));\n }\n ans[0] = args[0] - change;\n ans[1] = args[0] + change;\n return ans;\n },\n\n significant: function significant(pvalue, alpha) {\n return pvalue < alpha;\n }\n});\n\njStat.extend(jStat.fn, {\n normalci: function normalci(value, alpha) {\n return jStat.normalci(value, alpha, this.toArray());\n },\n\n tci: function tci(value, alpha) {\n return jStat.tci(value, alpha, this.toArray());\n }\n});\n\n// internal method for calculating the z-score for a difference of proportions test\nfunction differenceOfProportions(p1, n1, p2, n2) {\n if (p1 > 1 || p2 > 1 || p1 <= 0 || p2 <= 0) {\n throw new Error(\"Proportions should be greater than 0 and less than 1\")\n }\n var pooled = (p1 * n1 + p2 * n2) / (n1 + n2);\n var se = Math.sqrt(pooled * (1 - pooled) * ((1/n1) + (1/n2)));\n return (p1 - p2) / se;\n}\n\n// Difference of Proportions\njStat.extend(jStat.fn, {\n oneSidedDifferenceOfProportions: function oneSidedDifferenceOfProportions(p1, n1, p2, n2) {\n var z = differenceOfProportions(p1, n1, p2, n2);\n return jStat.ztest(z, 1);\n },\n\n twoSidedDifferenceOfProportions: function twoSidedDifferenceOfProportions(p1, n1, p2, n2) {\n var z = differenceOfProportions(p1, n1, p2, n2);\n return jStat.ztest(z, 2);\n }\n});\n\n}(this.jStat, Math));\nthis.jStat.models=(function(){\n\n function sub_regress(endog, exog) {\n return ols(endog, exog);\n }\n\n function sub_regress(exog) {\n var var_count = exog[0].length;\n var modelList = jStat.arange(var_count).map(function(endog_index) {\n var exog_index =\n jStat.arange(var_count).filter(function(i){return i!==endog_index});\n return ols(jStat.col(exog, endog_index).map(function(x){ return x[0] }),\n jStat.col(exog, exog_index))\n });\n return modelList;\n }\n\n // do OLS model regress\n // exog have include const columns ,it will not generate it .In fact, exog is\n // \"design matrix\" look at\n //https://en.wikipedia.org/wiki/Design_matrix\n function ols(endog, exog) {\n var nobs = endog.length;\n var df_model = exog[0].length - 1;\n var df_resid = nobs-df_model - 1;\n var coef = jStat.lstsq(exog, endog);\n var predict =\n jStat.multiply(exog, coef.map(function(x) { return [x] }))\n .map(function(p) { return p[0] });\n var resid = jStat.subtract(endog, predict);\n var ybar = jStat.mean(endog);\n // constant cause problem\n // var SST = jStat.sum(endog.map(function(y) {\n // return Math.pow(y-ybar,2);\n // }));\n var SSE = jStat.sum(predict.map(function(f) {\n return Math.pow(f - ybar, 2);\n }));\n var SSR = jStat.sum(endog.map(function(y, i) {\n return Math.pow(y - predict[i], 2);\n }));\n var SST = SSE + SSR;\n var R2 = (SSE / SST);\n return {\n exog:exog,\n endog:endog,\n nobs:nobs,\n df_model:df_model,\n df_resid:df_resid,\n coef:coef,\n predict:predict,\n resid:resid,\n ybar:ybar,\n SST:SST,\n SSE:SSE,\n SSR:SSR,\n R2:R2\n };\n }\n\n // H0: b_I=0\n // H1: b_I!=0\n function t_test(model) {\n var subModelList = sub_regress(model.exog);\n //var sigmaHat=jStat.stdev(model.resid);\n var sigmaHat = Math.sqrt(model.SSR / (model.df_resid));\n var seBetaHat = subModelList.map(function(mod) {\n var SST = mod.SST;\n var R2 = mod.R2;\n return sigmaHat / Math.sqrt(SST * (1 - R2));\n });\n var tStatistic = model.coef.map(function(coef, i) {\n return (coef - 0) / seBetaHat[i];\n });\n var pValue = tStatistic.map(function(t) {\n var leftppf = jStat.studentt.cdf(t, model.df_resid);\n return (leftppf > 0.5 ? 1 - leftppf : leftppf) * 2;\n });\n var c = jStat.studentt.inv(0.975, model.df_resid);\n var interval95 = model.coef.map(function(coef, i) {\n var d = c * seBetaHat[i];\n return [coef - d, coef + d];\n })\n return {\n se: seBetaHat,\n t: tStatistic,\n p: pValue,\n sigmaHat: sigmaHat,\n interval95: interval95\n };\n }\n\n function F_test(model) {\n var F_statistic =\n (model.R2 / model.df_model) / ((1 - model.R2) / model.df_resid);\n var fcdf = function(x, n1, n2) {\n return jStat.beta.cdf(x / (n2 / n1 + x), n1 / 2, n2 / 2)\n }\n var pvalue = 1 - fcdf(F_statistic, model.df_model, model.df_resid);\n return { F_statistic: F_statistic, pvalue: pvalue };\n }\n\n function ols_wrap(endog, exog) {\n var model = ols(endog,exog);\n var ttest = t_test(model);\n var ftest = F_test(model);\n var adjust_R2 =\n 1 - (1 - model.rsquared) * ((model.nobs - 1) / (model.df_resid));\n model.t = ttest;\n model.f = ftest;\n model.adjust_R2 = adjust_R2;\n return model;\n }\n\n return { ols: ols_wrap };\n})();\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/jStat/dist/jstat.js\n ** module id = 22\n ** module chunks = 0\n **/","var utils = require('./utils');\nvar numbro = require('numbro');\nvar error = require('./error');\n\nexports.UNIQUE = function () {\n var result = [];\n for (var i = 0; i < arguments.length; ++i) {\n var hasElement = false;\n var element = arguments[i];\n\n // Check if we've already seen this element.\n for (var j = 0; j < result.length; ++j) {\n hasElement = result[j] === element;\n if (hasElement) { break; }\n }\n\n // If we did not find it, add it to the result.\n if (!hasElement) {\n result.push(element);\n }\n }\n return result;\n};\n\nexports.FLATTEN = utils.flatten;\n\nexports.ARGS2ARRAY = function () {\n return Array.prototype.slice.call(arguments, 0);\n};\n\nexports.REFERENCE = function (context, reference) {\n if (!arguments.length) {\n return error.error;\n }\n try {\n var path = reference.split('.');\n var result = context;\n for (var i = 0; i < path.length; ++i) {\n var step = path[i];\n if (step[step.length - 1] === ']') {\n var opening = step.indexOf('[');\n var index = step.substring(opening + 1, step.length - 1);\n result = result[step.substring(0, opening)][index];\n } else {\n result = result[step];\n }\n }\n return result;\n } catch (error) {}\n};\n\nexports.JOIN = function (array, separator) {\n return array.join(separator);\n};\n\nexports.NUMBERS = function () {\n var possibleNumbers = utils.flatten(arguments);\n return possibleNumbers.filter(function (el) {\n return typeof el === 'number';\n });\n};\n\nexports.NUMERAL = function (number, format) {\n return numbro(number).format(format);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/miscellaneous.js\n ** module id = 23\n ** module chunks = 0\n **/","var error = require('./error');\n\n// TODO\nexports.CELL = function() {\n throw new Error('CELL is not implemented');\n};\n\nexports.ERROR = {};\nexports.ERROR.TYPE = function(error_val) {\n switch (error_val) {\n case error.nil: return 1;\n case error.div0: return 2;\n case error.value: return 3;\n case error.ref: return 4;\n case error.name: return 5;\n case error.num: return 6;\n case error.na: return 7;\n case error.data: return 8;\n }\n return error.na;\n};\n\n// TODO\nexports.INFO = function() {\n throw new Error('INFO is not implemented');\n};\n\nexports.ISBLANK = function(value) {\n return value === null;\n};\n\nexports.ISBINARY = function (number) {\n return (/^[01]{1,10}$/).test(number);\n};\n\nexports.ISERR = function(value) {\n return ([error.value, error.ref, error.div0, error.num, error.name, error.nil]).indexOf(value) >= 0 ||\n (typeof value === 'number' && (isNaN(value) || !isFinite(value)));\n};\n\nexports.ISERROR = function(value) {\n return exports.ISERR(value) || value === error.na;\n};\n\nexports.ISEVEN = function(number) {\n return (Math.floor(Math.abs(number)) & 1) ? false : true;\n};\n\n// TODO\nexports.ISFORMULA = function() {\n throw new Error('ISFORMULA is not implemented');\n};\n\nexports.ISLOGICAL = function(value) {\n return value === true || value === false;\n};\n\nexports.ISNA = function(value) {\n return value === error.na;\n};\n\nexports.ISNONTEXT = function(value) {\n return typeof(value) !== 'string';\n};\n\nexports.ISNUMBER = function(value) {\n return typeof(value) === 'number' && !isNaN(value) && isFinite(value);\n};\n\nexports.ISODD = function(number) {\n return (Math.floor(Math.abs(number)) & 1) ? true : false;\n};\n\n// TODO\nexports.ISREF = function() {\n throw new Error('ISREF is not implemented');\n};\n\nexports.ISTEXT = function(value) {\n return typeof(value) === 'string';\n};\n\nexports.N = function(value) {\n if (this.ISNUMBER(value)) {\n return value;\n }\n if (value instanceof Date) {\n return value.getTime();\n }\n if (value === true) {\n return 1;\n }\n if (value === false) {\n return 0;\n }\n if (this.ISERROR(value)) {\n return value;\n }\n return 0;\n};\n\nexports.NA = function() {\n return error.na;\n};\n\n\n// TODO\nexports.SHEET = function() {\n throw new Error('SHEET is not implemented');\n};\n\n// TODO\nexports.SHEETS = function() {\n throw new Error('SHEETS is not implemented');\n};\n\nexports.TYPE = function(value) {\n if (this.ISNUMBER(value)) {\n return 1;\n }\n if (this.ISTEXT(value)) {\n return 2;\n }\n if (this.ISLOGICAL(value)) {\n return 4;\n }\n if (this.ISERROR(value)) {\n return 16;\n }\n if (Array.isArray(value)) {\n return 64;\n }\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/information.js\n ** module id = 24\n ** module chunks = 0\n **/","var error = require('./error');\nvar jStat = require('jStat').jStat;\nvar text = require('./text');\nvar utils = require('./utils');\nvar bessel = require('bessel');\n\nfunction isValidBinaryNumber(number) {\n return (/^[01]{1,10}$/).test(number);\n}\n\nexports.BESSELI = function(x, n) {\n x = utils.parseNumber(x);\n n = utils.parseNumber(n);\n if (utils.anyIsError(x, n)) {\n return error.value;\n }\n\n return bessel.besseli(x, n);\n};\n\nexports.BESSELJ = function(x, n) {\n x = utils.parseNumber(x);\n n = utils.parseNumber(n);\n if (utils.anyIsError(x, n)) {\n return error.value;\n }\n\n return bessel.besselj(x, n);\n};\n\nexports.BESSELK = function(x, n) {\n x = utils.parseNumber(x);\n n = utils.parseNumber(n);\n if (utils.anyIsError(x, n)) {\n return error.value;\n }\n\n return bessel.besselk(x, n);\n};\n\nexports.BESSELY = function(x, n) {\n x = utils.parseNumber(x);\n n = utils.parseNumber(n);\n if (utils.anyIsError(x, n)) {\n return error.value;\n }\n\n return bessel.bessely(x, n);\n};\n\nexports.BIN2DEC = function(number) {\n // Return error if number is not binary or contains more than 10 characters (10 digits)\n if (!isValidBinaryNumber(number)) {\n return error.num;\n }\n\n // Convert binary number to decimal\n var result = parseInt(number, 2);\n\n // Handle negative numbers\n var stringified = number.toString();\n if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n return parseInt(stringified.substring(1), 2) - 512;\n } else {\n return result;\n }\n};\n\n\nexports.BIN2HEX = function(number, places) {\n // Return error if number is not binary or contains more than 10 characters (10 digits)\n if (!isValidBinaryNumber(number)) {\n return error.num;\n }\n\n // Ignore places and return a 10-character hexadecimal number if number is negative\n var stringified = number.toString();\n if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n return (1099511627264 + parseInt(stringified.substring(1), 2)).toString(16);\n }\n\n // Convert binary number to hexadecimal\n var result = parseInt(number, 2).toString(16);\n\n // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result;\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return error.value;\n }\n\n // Return error if places is negative\n if (places < 0) {\n return error.num;\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n }\n};\n\nexports.BIN2OCT = function(number, places) {\n // Return error if number is not binary or contains more than 10 characters (10 digits)\n if (!isValidBinaryNumber(number)) {\n return error.num;\n }\n\n // Ignore places and return a 10-character octal number if number is negative\n var stringified = number.toString();\n if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n return (1073741312 + parseInt(stringified.substring(1), 2)).toString(8);\n }\n\n // Convert binary number to octal\n var result = parseInt(number, 2).toString(8);\n\n // Return octal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result;\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return error.value;\n }\n\n // Return error if places is negative\n if (places < 0) {\n return error.num;\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n }\n};\n\nexports.BITAND = function(number1, number2) {\n // Return error if either number is a non-numeric value\n number1 = utils.parseNumber(number1);\n number2 = utils.parseNumber(number2);\n if (utils.anyIsError(number1, number2)) {\n return error.value;\n }\n\n // Return error if either number is less than 0\n if (number1 < 0 || number2 < 0) {\n return error.num;\n }\n\n // Return error if either number is a non-integer\n if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n return error.num;\n }\n\n // Return error if either number is greater than (2^48)-1\n if (number1 > 281474976710655 || number2 > 281474976710655) {\n return error.num;\n }\n\n // Return bitwise AND of two numbers\n return number1 & number2;\n};\n\nexports.BITLSHIFT = function(number, shift) {\n number = utils.parseNumber(number);\n shift = utils.parseNumber(shift);\n if (utils.anyIsError(number, shift)) {\n return error.value;\n }\n\n // Return error if number is less than 0\n if (number < 0) {\n return error.num;\n }\n\n // Return error if number is a non-integer\n if (Math.floor(number) !== number) {\n return error.num;\n }\n\n // Return error if number is greater than (2^48)-1\n if (number > 281474976710655) {\n return error.num;\n }\n\n // Return error if the absolute value of shift is greater than 53\n if (Math.abs(shift) > 53) {\n return error.num;\n }\n\n // Return number shifted by shift bits to the left or to the right if shift is negative\n return (shift >= 0) ? number << shift : number >> -shift;\n};\n\nexports.BITOR = function(number1, number2) {\n number1 = utils.parseNumber(number1);\n number2 = utils.parseNumber(number2);\n if (utils.anyIsError(number1, number2)) {\n return error.value;\n }\n\n // Return error if either number is less than 0\n if (number1 < 0 || number2 < 0) {\n return error.num;\n }\n\n // Return error if either number is a non-integer\n if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n return error.num;\n }\n\n // Return error if either number is greater than (2^48)-1\n if (number1 > 281474976710655 || number2 > 281474976710655) {\n return error.num;\n }\n\n // Return bitwise OR of two numbers\n return number1 | number2;\n};\n\nexports.BITRSHIFT = function(number, shift) {\n number = utils.parseNumber(number);\n shift = utils.parseNumber(shift);\n if (utils.anyIsError(number, shift)) {\n return error.value;\n }\n\n // Return error if number is less than 0\n if (number < 0) {\n return error.num;\n }\n\n // Return error if number is a non-integer\n if (Math.floor(number) !== number) {\n return error.num;\n }\n\n // Return error if number is greater than (2^48)-1\n if (number > 281474976710655) {\n return error.num;\n }\n\n // Return error if the absolute value of shift is greater than 53\n if (Math.abs(shift) > 53) {\n return error.num;\n }\n\n // Return number shifted by shift bits to the right or to the left if shift is negative\n return (shift >= 0) ? number >> shift : number << -shift;\n};\n\nexports.BITXOR = function(number1, number2) {\n number1 = utils.parseNumber(number1);\n number2 = utils.parseNumber(number2);\n if (utils.anyIsError(number1, number2)) {\n return error.value;\n }\n\n // Return error if either number is less than 0\n if (number1 < 0 || number2 < 0) {\n return error.num;\n }\n\n // Return error if either number is a non-integer\n if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n return error.num;\n }\n\n // Return error if either number is greater than (2^48)-1\n if (number1 > 281474976710655 || number2 > 281474976710655) {\n return error.num;\n }\n\n // Return bitwise XOR of two numbers\n return number1 ^ number2;\n};\n\nexports.COMPLEX = function(real, imaginary, suffix) {\n real = utils.parseNumber(real);\n imaginary = utils.parseNumber(imaginary);\n if (utils.anyIsError(real, imaginary)) {\n return real;\n }\n\n // Set suffix\n suffix = (suffix === undefined) ? 'i' : suffix;\n\n // Return error if suffix is neither \"i\" nor \"j\"\n if (suffix !== 'i' && suffix !== 'j') {\n return error.value;\n }\n\n // Return complex number\n if (real === 0 && imaginary === 0) {\n return 0;\n } else if (real === 0) {\n return (imaginary === 1) ? suffix : imaginary.toString() + suffix;\n } else if (imaginary === 0) {\n return real.toString();\n } else {\n var sign = (imaginary > 0) ? '+' : '';\n return real.toString() + sign + ((imaginary === 1) ? suffix : imaginary.toString() + suffix);\n }\n};\n\nexports.CONVERT = function(number, from_unit, to_unit) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n\n // List of units supported by CONVERT and units defined by the International System of Units\n // [Name, Symbol, Alternate symbols, Quantity, ISU, CONVERT, Conversion ratio]\n var units = [\n [\"a.u. of action\", \"?\", null, \"action\", false, false, 1.05457168181818e-34],\n [\"a.u. of charge\", \"e\", null, \"electric_charge\", false, false, 1.60217653141414e-19],\n [\"a.u. of energy\", \"Eh\", null, \"energy\", false, false, 4.35974417757576e-18],\n [\"a.u. of length\", \"a?\", null, \"length\", false, false, 5.29177210818182e-11],\n [\"a.u. of mass\", \"m?\", null, \"mass\", false, false, 9.10938261616162e-31],\n [\"a.u. of time\", \"?/Eh\", null, \"time\", false, false, 2.41888432650516e-17],\n [\"admiralty knot\", \"admkn\", null, \"speed\", false, true, 0.514773333],\n [\"ampere\", \"A\", null, \"electric_current\", true, false, 1],\n [\"ampere per meter\", \"A/m\", null, \"magnetic_field_intensity\", true, false, 1],\n [\"ångström\", \"Å\", [\"ang\"], \"length\", false, true, 1e-10],\n [\"are\", \"ar\", null, \"area\", false, true, 100],\n [\"astronomical unit\", \"ua\", null, \"length\", false, false, 1.49597870691667e-11],\n [\"bar\", \"bar\", null, \"pressure\", false, false, 100000],\n [\"barn\", \"b\", null, \"area\", false, false, 1e-28],\n [\"becquerel\", \"Bq\", null, \"radioactivity\", true, false, 1],\n [\"bit\", \"bit\", [\"b\"], \"information\", false, true, 1],\n [\"btu\", \"BTU\", [\"btu\"], \"energy\", false, true, 1055.05585262],\n [\"byte\", \"byte\", null, \"information\", false, true, 8],\n [\"candela\", \"cd\", null, \"luminous_intensity\", true, false, 1],\n [\"candela per square metre\", \"cd/m?\", null, \"luminance\", true, false, 1],\n [\"coulomb\", \"C\", null, \"electric_charge\", true, false, 1],\n [\"cubic ångström\", \"ang3\", [\"ang^3\"], \"volume\", false, true, 1e-30],\n [\"cubic foot\", \"ft3\", [\"ft^3\"], \"volume\", false, true, 0.028316846592],\n [\"cubic inch\", \"in3\", [\"in^3\"], \"volume\", false, true, 0.000016387064],\n [\"cubic light-year\", \"ly3\", [\"ly^3\"], \"volume\", false, true, 8.46786664623715e-47],\n [\"cubic metre\", \"m?\", null, \"volume\", true, true, 1],\n [\"cubic mile\", \"mi3\", [\"mi^3\"], \"volume\", false, true, 4168181825.44058],\n [\"cubic nautical mile\", \"Nmi3\", [\"Nmi^3\"], \"volume\", false, true, 6352182208],\n [\"cubic Pica\", \"Pica3\", [\"Picapt3\", \"Pica^3\", \"Picapt^3\"], \"volume\", false, true, 7.58660370370369e-8],\n [\"cubic yard\", \"yd3\", [\"yd^3\"], \"volume\", false, true, 0.764554857984],\n [\"cup\", \"cup\", null, \"volume\", false, true, 0.0002365882365],\n [\"dalton\", \"Da\", [\"u\"], \"mass\", false, false, 1.66053886282828e-27],\n [\"day\", \"d\", [\"day\"], \"time\", false, true, 86400],\n [\"degree\", \"°\", null, \"angle\", false, false, 0.0174532925199433],\n [\"degrees Rankine\", \"Rank\", null, \"temperature\", false, true, 0.555555555555556],\n [\"dyne\", \"dyn\", [\"dy\"], \"force\", false, true, 0.00001],\n [\"electronvolt\", \"eV\", [\"ev\"], \"energy\", false, true, 1.60217656514141],\n [\"ell\", \"ell\", null, \"length\", false, true, 1.143],\n [\"erg\", \"erg\", [\"e\"], \"energy\", false, true, 1e-7],\n [\"farad\", \"F\", null, \"electric_capacitance\", true, false, 1],\n [\"fluid ounce\", \"oz\", null, \"volume\", false, true, 0.0000295735295625],\n [\"foot\", \"ft\", null, \"length\", false, true, 0.3048],\n [\"foot-pound\", \"flb\", null, \"energy\", false, true, 1.3558179483314],\n [\"gal\", \"Gal\", null, \"acceleration\", false, false, 0.01],\n [\"gallon\", \"gal\", null, \"volume\", false, true, 0.003785411784],\n [\"gauss\", \"G\", [\"ga\"], \"magnetic_flux_density\", false, true, 1],\n [\"grain\", \"grain\", null, \"mass\", false, true, 0.0000647989],\n [\"gram\", \"g\", null, \"mass\", false, true, 0.001],\n [\"gray\", \"Gy\", null, \"absorbed_dose\", true, false, 1],\n [\"gross registered ton\", \"GRT\", [\"regton\"], \"volume\", false, true, 2.8316846592],\n [\"hectare\", \"ha\", null, \"area\", false, true, 10000],\n [\"henry\", \"H\", null, \"inductance\", true, false, 1],\n [\"hertz\", \"Hz\", null, \"frequency\", true, false, 1],\n [\"horsepower\", \"HP\", [\"h\"], \"power\", false, true, 745.69987158227],\n [\"horsepower-hour\", \"HPh\", [\"hh\", \"hph\"], \"energy\", false, true, 2684519.538],\n [\"hour\", \"h\", [\"hr\"], \"time\", false, true, 3600],\n [\"imperial gallon (U.K.)\", \"uk_gal\", null, \"volume\", false, true, 0.00454609],\n [\"imperial hundredweight\", \"lcwt\", [\"uk_cwt\", \"hweight\"], \"mass\", false, true, 50.802345],\n [\"imperial quart (U.K)\", \"uk_qt\", null, \"volume\", false, true, 0.0011365225],\n [\"imperial ton\", \"brton\", [\"uk_ton\", \"LTON\"], \"mass\", false, true, 1016.046909],\n [\"inch\", \"in\", null, \"length\", false, true, 0.0254],\n [\"international acre\", \"uk_acre\", null, \"area\", false, true, 4046.8564224],\n [\"IT calorie\", \"cal\", null, \"energy\", false, true, 4.1868],\n [\"joule\", \"J\", null, \"energy\", true, true, 1],\n [\"katal\", \"kat\", null, \"catalytic_activity\", true, false, 1],\n [\"kelvin\", \"K\", [\"kel\"], \"temperature\", true, true, 1],\n [\"kilogram\", \"kg\", null, \"mass\", true, true, 1],\n [\"knot\", \"kn\", null, \"speed\", false, true, 0.514444444444444],\n [\"light-year\", \"ly\", null, \"length\", false, true, 9460730472580800],\n [\"litre\", \"L\", [\"l\", \"lt\"], \"volume\", false, true, 0.001],\n [\"lumen\", \"lm\", null, \"luminous_flux\", true, false, 1],\n [\"lux\", \"lx\", null, \"illuminance\", true, false, 1],\n [\"maxwell\", \"Mx\", null, \"magnetic_flux\", false, false, 1e-18],\n [\"measurement ton\", \"MTON\", null, \"volume\", false, true, 1.13267386368],\n [\"meter per hour\", \"m/h\", [\"m/hr\"], \"speed\", false, true, 0.00027777777777778],\n [\"meter per second\", \"m/s\", [\"m/sec\"], \"speed\", true, true, 1],\n [\"meter per second squared\", \"m?s??\", null, \"acceleration\", true, false, 1],\n [\"parsec\", \"pc\", [\"parsec\"], \"length\", false, true, 30856775814671900],\n [\"meter squared per second\", \"m?/s\", null, \"kinematic_viscosity\", true, false, 1],\n [\"metre\", \"m\", null, \"length\", true, true, 1],\n [\"miles per hour\", \"mph\", null, \"speed\", false, true, 0.44704],\n [\"millimetre of mercury\", \"mmHg\", null, \"pressure\", false, false, 133.322],\n [\"minute\", \"?\", null, \"angle\", false, false, 0.000290888208665722],\n [\"minute\", \"min\", [\"mn\"], \"time\", false, true, 60],\n [\"modern teaspoon\", \"tspm\", null, \"volume\", false, true, 0.000005],\n [\"mole\", \"mol\", null, \"amount_of_substance\", true, false, 1],\n [\"morgen\", \"Morgen\", null, \"area\", false, true, 2500],\n [\"n.u. of action\", \"?\", null, \"action\", false, false, 1.05457168181818e-34],\n [\"n.u. of mass\", \"m?\", null, \"mass\", false, false, 9.10938261616162e-31],\n [\"n.u. of speed\", \"c?\", null, \"speed\", false, false, 299792458],\n [\"n.u. of time\", \"?/(me?c??)\", null, \"time\", false, false, 1.28808866778687e-21],\n [\"nautical mile\", \"M\", [\"Nmi\"], \"length\", false, true, 1852],\n [\"newton\", \"N\", null, \"force\", true, true, 1],\n [\"œrsted\", \"Oe \", null, \"magnetic_field_intensity\", false, false, 79.5774715459477],\n [\"ohm\", \"Ω\", null, \"electric_resistance\", true, false, 1],\n [\"ounce mass\", \"ozm\", null, \"mass\", false, true, 0.028349523125],\n [\"pascal\", \"Pa\", null, \"pressure\", true, false, 1],\n [\"pascal second\", \"Pa?s\", null, \"dynamic_viscosity\", true, false, 1],\n [\"pferdestärke\", \"PS\", null, \"power\", false, true, 735.49875],\n [\"phot\", \"ph\", null, \"illuminance\", false, false, 0.0001],\n [\"pica (1/6 inch)\", \"pica\", null, \"length\", false, true, 0.00035277777777778],\n [\"pica (1/72 inch)\", \"Pica\", [\"Picapt\"], \"length\", false, true, 0.00423333333333333],\n [\"poise\", \"P\", null, \"dynamic_viscosity\", false, false, 0.1],\n [\"pond\", \"pond\", null, \"force\", false, true, 0.00980665],\n [\"pound force\", \"lbf\", null, \"force\", false, true, 4.4482216152605],\n [\"pound mass\", \"lbm\", null, \"mass\", false, true, 0.45359237],\n [\"quart\", \"qt\", null, \"volume\", false, true, 0.000946352946],\n [\"radian\", \"rad\", null, \"angle\", true, false, 1],\n [\"second\", \"?\", null, \"angle\", false, false, 0.00000484813681109536],\n [\"second\", \"s\", [\"sec\"], \"time\", true, true, 1],\n [\"short hundredweight\", \"cwt\", [\"shweight\"], \"mass\", false, true, 45.359237],\n [\"siemens\", \"S\", null, \"electrical_conductance\", true, false, 1],\n [\"sievert\", \"Sv\", null, \"equivalent_dose\", true, false, 1],\n [\"slug\", \"sg\", null, \"mass\", false, true, 14.59390294],\n [\"square ångström\", \"ang2\", [\"ang^2\"], \"area\", false, true, 1e-20],\n [\"square foot\", \"ft2\", [\"ft^2\"], \"area\", false, true, 0.09290304],\n [\"square inch\", \"in2\", [\"in^2\"], \"area\", false, true, 0.00064516],\n [\"square light-year\", \"ly2\", [\"ly^2\"], \"area\", false, true, 8.95054210748189e+31],\n [\"square meter\", \"m?\", null, \"area\", true, true, 1],\n [\"square mile\", \"mi2\", [\"mi^2\"], \"area\", false, true, 2589988.110336],\n [\"square nautical mile\", \"Nmi2\", [\"Nmi^2\"], \"area\", false, true, 3429904],\n [\"square Pica\", \"Pica2\", [\"Picapt2\", \"Pica^2\", \"Picapt^2\"], \"area\", false, true, 0.00001792111111111],\n [\"square yard\", \"yd2\", [\"yd^2\"], \"area\", false, true, 0.83612736],\n [\"statute mile\", \"mi\", null, \"length\", false, true, 1609.344],\n [\"steradian\", \"sr\", null, \"solid_angle\", true, false, 1],\n [\"stilb\", \"sb\", null, \"luminance\", false, false, 0.0001],\n [\"stokes\", \"St\", null, \"kinematic_viscosity\", false, false, 0.0001],\n [\"stone\", \"stone\", null, \"mass\", false, true, 6.35029318],\n [\"tablespoon\", \"tbs\", null, \"volume\", false, true, 0.0000147868],\n [\"teaspoon\", \"tsp\", null, \"volume\", false, true, 0.00000492892],\n [\"tesla\", \"T\", null, \"magnetic_flux_density\", true, true, 1],\n [\"thermodynamic calorie\", \"c\", null, \"energy\", false, true, 4.184],\n [\"ton\", \"ton\", null, \"mass\", false, true, 907.18474],\n [\"tonne\", \"t\", null, \"mass\", false, false, 1000],\n [\"U.K. pint\", \"uk_pt\", null, \"volume\", false, true, 0.00056826125],\n [\"U.S. bushel\", \"bushel\", null, \"volume\", false, true, 0.03523907],\n [\"U.S. oil barrel\", \"barrel\", null, \"volume\", false, true, 0.158987295],\n [\"U.S. pint\", \"pt\", [\"us_pt\"], \"volume\", false, true, 0.000473176473],\n [\"U.S. survey mile\", \"survey_mi\", null, \"length\", false, true, 1609.347219],\n [\"U.S. survey/statute acre\", \"us_acre\", null, \"area\", false, true, 4046.87261],\n [\"volt\", \"V\", null, \"voltage\", true, false, 1],\n [\"watt\", \"W\", null, \"power\", true, true, 1],\n [\"watt-hour\", \"Wh\", [\"wh\"], \"energy\", false, true, 3600],\n [\"weber\", \"Wb\", null, \"magnetic_flux\", true, false, 1],\n [\"yard\", \"yd\", null, \"length\", false, true, 0.9144],\n [\"year\", \"yr\", null, \"time\", false, true, 31557600]\n ];\n\n // Binary prefixes\n // [Name, Prefix power of 2 value, Previx value, Abbreviation, Derived from]\n var binary_prefixes = {\n Yi: [\"yobi\", 80, 1208925819614629174706176, \"Yi\", \"yotta\"],\n Zi: [\"zebi\", 70, 1180591620717411303424, \"Zi\", \"zetta\"],\n Ei: [\"exbi\", 60, 1152921504606846976, \"Ei\", \"exa\"],\n Pi: [\"pebi\", 50, 1125899906842624, \"Pi\", \"peta\"],\n Ti: [\"tebi\", 40, 1099511627776, \"Ti\", \"tera\"],\n Gi: [\"gibi\", 30, 1073741824, \"Gi\", \"giga\"],\n Mi: [\"mebi\", 20, 1048576, \"Mi\", \"mega\"],\n ki: [\"kibi\", 10, 1024, \"ki\", \"kilo\"]\n };\n\n // Unit prefixes\n // [Name, Multiplier, Abbreviation]\n var unit_prefixes = {\n Y: [\"yotta\", 1e+24, \"Y\"],\n Z: [\"zetta\", 1e+21, \"Z\"],\n E: [\"exa\", 1e+18, \"E\"],\n P: [\"peta\", 1e+15, \"P\"],\n T: [\"tera\", 1e+12, \"T\"],\n G: [\"giga\", 1e+09, \"G\"],\n M: [\"mega\", 1e+06, \"M\"],\n k: [\"kilo\", 1e+03, \"k\"],\n h: [\"hecto\", 1e+02, \"h\"],\n e: [\"dekao\", 1e+01, \"e\"],\n d: [\"deci\", 1e-01, \"d\"],\n c: [\"centi\", 1e-02, \"c\"],\n m: [\"milli\", 1e-03, \"m\"],\n u: [\"micro\", 1e-06, \"u\"],\n n: [\"nano\", 1e-09, \"n\"],\n p: [\"pico\", 1e-12, \"p\"],\n f: [\"femto\", 1e-15, \"f\"],\n a: [\"atto\", 1e-18, \"a\"],\n z: [\"zepto\", 1e-21, \"z\"],\n y: [\"yocto\", 1e-24, \"y\"]\n };\n\n // Initialize units and multipliers\n var from = null;\n var to = null;\n var base_from_unit = from_unit;\n var base_to_unit = to_unit;\n var from_multiplier = 1;\n var to_multiplier = 1;\n var alt;\n\n // Lookup from and to units\n for (var i = 0; i < units.length; i++) {\n alt = (units[i][2] === null) ? [] : units[i][2];\n if (units[i][1] === base_from_unit || alt.indexOf(base_from_unit) >= 0) {\n from = units[i];\n }\n if (units[i][1] === base_to_unit || alt.indexOf(base_to_unit) >= 0) {\n to = units[i];\n }\n }\n\n // Lookup from prefix\n if (from === null) {\n var from_binary_prefix = binary_prefixes[from_unit.substring(0, 2)];\n var from_unit_prefix = unit_prefixes[from_unit.substring(0, 1)];\n\n // Handle dekao unit prefix (only unit prefix with two characters)\n if (from_unit.substring(0, 2) === 'da') {\n from_unit_prefix = [\"dekao\", 1e+01, \"da\"];\n }\n\n // Handle binary prefixes first (so that 'Yi' is processed before 'Y')\n if (from_binary_prefix) {\n from_multiplier = from_binary_prefix[2];\n base_from_unit = from_unit.substring(2);\n } else if (from_unit_prefix) {\n from_multiplier = from_unit_prefix[1];\n base_from_unit = from_unit.substring(from_unit_prefix[2].length);\n }\n\n // Lookup from unit\n for (var j = 0; j < units.length; j++) {\n alt = (units[j][2] === null) ? [] : units[j][2];\n if (units[j][1] === base_from_unit || alt.indexOf(base_from_unit) >= 0) {\n from = units[j];\n }\n }\n }\n\n // Lookup to prefix\n if (to === null) {\n var to_binary_prefix = binary_prefixes[to_unit.substring(0, 2)];\n var to_unit_prefix = unit_prefixes[to_unit.substring(0, 1)];\n\n // Handle dekao unit prefix (only unit prefix with two characters)\n if (to_unit.substring(0, 2) === 'da') {\n to_unit_prefix = [\"dekao\", 1e+01, \"da\"];\n }\n\n // Handle binary prefixes first (so that 'Yi' is processed before 'Y')\n if (to_binary_prefix) {\n to_multiplier = to_binary_prefix[2];\n base_to_unit = to_unit.substring(2);\n } else if (to_unit_prefix) {\n to_multiplier = to_unit_prefix[1];\n base_to_unit = to_unit.substring(to_unit_prefix[2].length);\n }\n\n // Lookup to unit\n for (var k = 0; k < units.length; k++) {\n alt = (units[k][2] === null) ? [] : units[k][2];\n if (units[k][1] === base_to_unit || alt.indexOf(base_to_unit) >= 0) {\n to = units[k];\n }\n }\n }\n\n // Return error if a unit does not exist\n if (from === null || to === null) {\n return error.na;\n }\n\n // Return error if units represent different quantities\n if (from[3] !== to[3]) {\n return error.na;\n }\n\n // Return converted number\n return number * from[6] * from_multiplier / (to[6] * to_multiplier);\n};\n\nexports.DEC2BIN = function(number, places) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n\n // Return error if number is not decimal, is lower than -512, or is greater than 511\n if (!/^-?[0-9]{1,3}$/.test(number) || number < -512 || number > 511) {\n return error.num;\n }\n\n // Ignore places and return a 10-character binary number if number is negative\n if (number < 0) {\n return '1' + text.REPT('0', 9 - (512 + number).toString(2).length) + (512 + number).toString(2);\n }\n\n // Convert decimal number to binary\n var result = parseInt(number, 10).toString(2);\n\n // Return binary number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result;\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return error.value;\n }\n\n // Return error if places is negative\n if (places < 0) {\n return error.num;\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n }\n};\n\nexports.DEC2HEX = function(number, places) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n\n // Return error if number is not decimal, is lower than -549755813888, or is greater than 549755813887\n if (!/^-?[0-9]{1,12}$/.test(number) || number < -549755813888 || number > 549755813887) {\n return error.num;\n }\n\n // Ignore places and return a 10-character hexadecimal number if number is negative\n if (number < 0) {\n return (1099511627776 + number).toString(16);\n }\n\n // Convert decimal number to hexadecimal\n var result = parseInt(number, 10).toString(16);\n\n // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result;\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return error.value;\n }\n\n // Return error if places is negative\n if (places < 0) {\n return error.num;\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n }\n};\n\nexports.DEC2OCT = function(number, places) {\n number = utils.parseNumber(number);\n if (number instanceof Error) {\n return number;\n }\n\n // Return error if number is not decimal, is lower than -549755813888, or is greater than 549755813887\n if (!/^-?[0-9]{1,9}$/.test(number) || number < -536870912 || number > 536870911) {\n return error.num;\n }\n\n // Ignore places and return a 10-character octal number if number is negative\n if (number < 0) {\n return (1073741824 + number).toString(8);\n }\n\n // Convert decimal number to octal\n var result = parseInt(number, 10).toString(8);\n\n // Return octal number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result;\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return error.value;\n }\n\n // Return error if places is negative\n if (places < 0) {\n return error.num;\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n }\n};\n\nexports.DELTA = function(number1, number2) {\n // Set number2 to zero if undefined\n number2 = (number2 === undefined) ? 0 : number2;\n number1 = utils.parseNumber(number1);\n number2 = utils.parseNumber(number2);\n if (utils.anyIsError(number1, number2)) {\n return error.value;\n }\n\n // Return delta\n return (number1 === number2) ? 1 : 0;\n};\n\n// TODO: why is upper_bound not used ? The excel documentation has no examples with upper_bound\nexports.ERF = function(lower_bound, upper_bound) {\n // Set number2 to zero if undefined\n upper_bound = (upper_bound === undefined) ? 0 : upper_bound;\n\n lower_bound = utils.parseNumber(lower_bound);\n upper_bound = utils.parseNumber(upper_bound);\n if (utils.anyIsError(lower_bound, upper_bound)) {\n return error.value;\n }\n\n return jStat.erf(lower_bound);\n};\n\n// TODO\nexports.ERF.PRECISE = function() {\n throw new Error('ERF.PRECISE is not implemented');\n};\n\nexports.ERFC = function(x) {\n // Return error if x is not a number\n if (isNaN(x)) {\n return error.value;\n }\n\n return jStat.erfc(x);\n};\n\n// TODO\nexports.ERFC.PRECISE = function() {\n throw new Error('ERFC.PRECISE is not implemented');\n};\n\nexports.GESTEP = function(number, step) {\n step = step || 0;\n number = utils.parseNumber(number);\n if (utils.anyIsError(step, number)) {\n return number;\n }\n\n // Return delta\n return (number >= step) ? 1 : 0;\n};\n\nexports.HEX2BIN = function(number, places) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n return error.num;\n }\n\n // Check if number is negative\n var negative = (number.length === 10 && number.substring(0, 1).toLowerCase() === 'f') ? true : false;\n\n // Convert hexadecimal number to decimal\n var decimal = (negative) ? parseInt(number, 16) - 1099511627776 : parseInt(number, 16);\n\n // Return error if number is lower than -512 or greater than 511\n if (decimal < -512 || decimal > 511) {\n return error.num;\n }\n\n // Ignore places and return a 10-character binary number if number is negative\n if (negative) {\n return '1' + text.REPT('0', 9 - (512 + decimal).toString(2).length) + (512 + decimal).toString(2);\n }\n\n // Convert decimal number to binary\n var result = decimal.toString(2);\n\n // Return binary number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result;\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return error.value;\n }\n\n // Return error if places is negative\n if (places < 0) {\n return error.num;\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n }\n};\n\nexports.HEX2DEC = function(number) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n return error.num;\n }\n\n // Convert hexadecimal number to decimal\n var decimal = parseInt(number, 16);\n\n // Return decimal number\n return (decimal >= 549755813888) ? decimal - 1099511627776 : decimal;\n};\n\nexports.HEX2OCT = function(number, places) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n return error.num;\n }\n\n // Convert hexadecimal number to decimal\n var decimal = parseInt(number, 16);\n\n // Return error if number is positive and greater than 0x1fffffff (536870911)\n if (decimal > 536870911 && decimal < 1098974756864) {\n return error.num;\n }\n\n // Ignore places and return a 10-character octal number if number is negative\n if (decimal >= 1098974756864) {\n return (decimal - 1098437885952).toString(8);\n }\n\n // Convert decimal number to octal\n var result = decimal.toString(8);\n\n // Return octal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result;\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return error.value;\n }\n\n // Return error if places is negative\n if (places < 0) {\n return error.num;\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n }\n};\n\nexports.IMABS = function(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Return absolute value of complex number\n return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));\n};\n\nexports.IMAGINARY = function(inumber) {\n if (inumber === undefined || inumber === true || inumber === false) {\n return error.value;\n }\n\n // Return 0 if inumber is equal to 0\n if (inumber === 0 || inumber === '0') {\n return 0;\n }\n\n // Handle special cases\n if (['i', 'j'].indexOf(inumber) >= 0) {\n return 1;\n }\n\n // Normalize imaginary coefficient\n inumber = inumber.replace('+i', '+1i').replace('-i', '-1i').replace('+j', '+1j').replace('-j', '-1j');\n\n // Lookup sign\n var plus = inumber.indexOf('+');\n var minus = inumber.indexOf('-');\n if (plus === 0) {\n plus = inumber.indexOf('+', 1);\n }\n\n if (minus === 0) {\n minus = inumber.indexOf('-', 1);\n }\n\n // Lookup imaginary unit\n var last = inumber.substring(inumber.length - 1, inumber.length);\n var unit = (last === 'i' || last === 'j');\n\n if (plus >= 0 || minus >= 0) {\n // Return error if imaginary unit is neither i nor j\n if (!unit) {\n return error.num;\n }\n\n // Return imaginary coefficient of complex number\n if (plus >= 0) {\n return (isNaN(inumber.substring(0, plus)) || isNaN(inumber.substring(plus + 1, inumber.length - 1))) ?\n error.num :\n Number(inumber.substring(plus + 1, inumber.length - 1));\n } else {\n return (isNaN(inumber.substring(0, minus)) || isNaN(inumber.substring(minus + 1, inumber.length - 1))) ?\n error.num :\n -Number(inumber.substring(minus + 1, inumber.length - 1));\n }\n } else {\n if (unit) {\n return (isNaN(inumber.substring(0, inumber.length - 1))) ? error.num : inumber.substring(0, inumber.length - 1);\n } else {\n return (isNaN(inumber)) ? error.num : 0;\n }\n }\n};\n\nexports.IMARGUMENT = function(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Return error if inumber is equal to zero\n if (x === 0 && y === 0) {\n return error.div0;\n }\n\n // Return PI/2 if x is equal to zero and y is positive\n if (x === 0 && y > 0) {\n return Math.PI / 2;\n }\n\n // Return -PI/2 if x is equal to zero and y is negative\n if (x === 0 && y < 0) {\n return -Math.PI / 2;\n }\n\n // Return zero if x is negative and y is equal to zero\n if (y === 0 && x > 0) {\n return 0;\n }\n\n // Return zero if x is negative and y is equal to zero\n if (y === 0 && x < 0) {\n return -Math.PI;\n }\n\n // Return argument of complex number\n if (x > 0) {\n return Math.atan(y / x);\n } else if (x < 0 && y >= 0) {\n return Math.atan(y / x) + Math.PI;\n } else {\n return Math.atan(y / x) - Math.PI;\n }\n};\n\nexports.IMCONJUGATE = function(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Return conjugate of complex number\n return (y !== 0) ? exports.COMPLEX(x, -y, unit) : inumber;\n};\n\nexports.IMCOS = function(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Return cosine of complex number\n return exports.COMPLEX(Math.cos(x) * (Math.exp(y) + Math.exp(-y)) / 2, -Math.sin(x) * (Math.exp(y) - Math.exp(-y)) / 2, unit);\n};\n\nexports.IMCOSH = function(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Return hyperbolic cosine of complex number\n return exports.COMPLEX(Math.cos(y) * (Math.exp(x) + Math.exp(-x)) / 2, Math.sin(y) * (Math.exp(x) - Math.exp(-x)) / 2, unit);\n};\n\nexports.IMCOT = function(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Return cotangent of complex number\n return exports.IMDIV(exports.IMCOS(inumber), exports.IMSIN(inumber));\n};\n\nexports.IMDIV = function(inumber1, inumber2) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var a = exports.IMREAL(inumber1);\n var b = exports.IMAGINARY(inumber1);\n var c = exports.IMREAL(inumber2);\n var d = exports.IMAGINARY(inumber2);\n\n if (utils.anyIsError(a, b, c, d)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit1 = inumber1.substring(inumber1.length - 1);\n var unit2 = inumber2.substring(inumber2.length - 1);\n var unit = 'i';\n if (unit1 === 'j') {\n unit = 'j';\n } else if (unit2 === 'j') {\n unit = 'j';\n }\n\n // Return error if inumber2 is null\n if (c === 0 && d === 0) {\n return error.num;\n }\n\n // Return exponential of complex number\n var den = c * c + d * d;\n return exports.COMPLEX((a * c + b * d) / den, (b * c - a * d) / den, unit);\n};\n\nexports.IMEXP = function(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Return exponential of complex number\n var e = Math.exp(x);\n return exports.COMPLEX(e * Math.cos(y), e * Math.sin(y), unit);\n};\n\nexports.IMLN = function(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Return exponential of complex number\n return exports.COMPLEX(Math.log(Math.sqrt(x * x + y * y)), Math.atan(y / x), unit);\n};\n\nexports.IMLOG10 = function(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Return exponential of complex number\n return exports.COMPLEX(Math.log(Math.sqrt(x * x + y * y)) / Math.log(10), Math.atan(y / x) / Math.log(10), unit);\n};\n\nexports.IMLOG2 = function(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Return exponential of complex number\n return exports.COMPLEX(Math.log(Math.sqrt(x * x + y * y)) / Math.log(2), Math.atan(y / x) / Math.log(2), unit);\n};\n\nexports.IMPOWER = function(inumber, number) {\n number = utils.parseNumber(number);\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n if (utils.anyIsError(number, x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Calculate power of modulus\n var p = Math.pow(exports.IMABS(inumber), number);\n\n // Calculate argument\n var t = exports.IMARGUMENT(inumber);\n\n // Return exponential of complex number\n return exports.COMPLEX(p * Math.cos(number * t), p * Math.sin(number * t), unit);\n};\n\nexports.IMPRODUCT = function() {\n // Initialize result\n var result = arguments[0];\n\n if (!arguments.length) {\n return error.value;\n }\n\n // Loop on all numbers\n for (var i = 1; i < arguments.length; i++) {\n // Lookup coefficients of two complex numbers\n var a = exports.IMREAL(result);\n var b = exports.IMAGINARY(result);\n var c = exports.IMREAL(arguments[i]);\n var d = exports.IMAGINARY(arguments[i]);\n\n if (utils.anyIsError(a, b, c, d)) {\n return error.value;\n }\n\n // Complute product of two complex numbers\n result = exports.COMPLEX(a * c - b * d, a * d + b * c);\n }\n\n // Return product of complex numbers\n return result;\n};\n\nexports.IMREAL = function(inumber) {\n if (inumber === undefined || inumber === true || inumber === false) {\n return error.value;\n }\n\n // Return 0 if inumber is equal to 0\n if (inumber === 0 || inumber === '0') {\n return 0;\n }\n\n // Handle special cases\n if (['i', '+i', '1i', '+1i', '-i', '-1i', 'j', '+j', '1j', '+1j', '-j', '-1j'].indexOf(inumber) >= 0) {\n return 0;\n }\n\n // Lookup sign\n var plus = inumber.indexOf('+');\n var minus = inumber.indexOf('-');\n if (plus === 0) {\n plus = inumber.indexOf('+', 1);\n }\n if (minus === 0) {\n minus = inumber.indexOf('-', 1);\n }\n\n // Lookup imaginary unit\n var last = inumber.substring(inumber.length - 1, inumber.length);\n var unit = (last === 'i' || last === 'j');\n\n if (plus >= 0 || minus >= 0) {\n // Return error if imaginary unit is neither i nor j\n if (!unit) {\n return error.num;\n }\n\n // Return real coefficient of complex number\n if (plus >= 0) {\n return (isNaN(inumber.substring(0, plus)) || isNaN(inumber.substring(plus + 1, inumber.length - 1))) ?\n error.num :\n Number(inumber.substring(0, plus));\n } else {\n return (isNaN(inumber.substring(0, minus)) || isNaN(inumber.substring(minus + 1, inumber.length - 1))) ?\n error.num :\n Number(inumber.substring(0, minus));\n }\n } else {\n if (unit) {\n return (isNaN(inumber.substring(0, inumber.length - 1))) ? error.num : 0;\n } else {\n return (isNaN(inumber)) ? error.num : inumber;\n }\n }\n};\n\nexports.IMSEC = function(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return error.value;\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Return secant of complex number\n return exports.IMDIV('1', exports.IMCOS(inumber));\n};\n\nexports.IMSECH = function(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Return hyperbolic secant of complex number\n return exports.IMDIV('1', exports.IMCOSH(inumber));\n};\n\nexports.IMSIN = function(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Return sine of complex number\n return exports.COMPLEX(Math.sin(x) * (Math.exp(y) + Math.exp(-y)) / 2, Math.cos(x) * (Math.exp(y) - Math.exp(-y)) / 2, unit);\n};\n\nexports.IMSINH = function(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Return hyperbolic sine of complex number\n return exports.COMPLEX(Math.cos(y) * (Math.exp(x) - Math.exp(-x)) / 2, Math.sin(y) * (Math.exp(x) + Math.exp(-x)) / 2, unit);\n};\n\nexports.IMSQRT = function(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit = inumber.substring(inumber.length - 1);\n unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\n // Calculate power of modulus\n var s = Math.sqrt(exports.IMABS(inumber));\n\n // Calculate argument\n var t = exports.IMARGUMENT(inumber);\n\n // Return exponential of complex number\n return exports.COMPLEX(s * Math.cos(t / 2), s * Math.sin(t / 2), unit);\n};\n\nexports.IMCSC = function (inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return error.value;\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (utils.anyIsError(x, y)) {\n return error.num;\n }\n\n // Return cosecant of complex number\n return exports.IMDIV('1', exports.IMSIN(inumber));\n};\n\nexports.IMCSCH = function (inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return error.value;\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (utils.anyIsError(x, y)) {\n return error.num;\n }\n\n // Return hyperbolic cosecant of complex number\n return exports.IMDIV('1', exports.IMSINH(inumber));\n};\n\nexports.IMSUB = function(inumber1, inumber2) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var a = this.IMREAL(inumber1);\n var b = this.IMAGINARY(inumber1);\n var c = this.IMREAL(inumber2);\n var d = this.IMAGINARY(inumber2);\n\n if (utils.anyIsError(a, b, c, d)) {\n return error.value;\n }\n\n // Lookup imaginary unit\n var unit1 = inumber1.substring(inumber1.length - 1);\n var unit2 = inumber2.substring(inumber2.length - 1);\n var unit = 'i';\n if (unit1 === 'j') {\n unit = 'j';\n } else if (unit2 === 'j') {\n unit = 'j';\n }\n\n // Return _ of two complex numbers\n return this.COMPLEX(a - c, b - d, unit);\n};\n\nexports.IMSUM = function() {\n if (!arguments.length) {\n return error.value;\n }\n var args = utils.flatten(arguments);\n\n // Initialize result\n var result = args[0];\n\n // Loop on all numbers\n for (var i = 1; i < args.length; i++) {\n // Lookup coefficients of two complex numbers\n var a = this.IMREAL(result);\n var b = this.IMAGINARY(result);\n var c = this.IMREAL(args[i]);\n var d = this.IMAGINARY(args[i]);\n\n if (utils.anyIsError(a, b, c, d)) {\n return error.value;\n }\n\n // Complute product of two complex numbers\n result = this.COMPLEX(a + c, b + d);\n }\n\n // Return sum of complex numbers\n return result;\n};\n\nexports.IMTAN = function(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return error.value;\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n var x = exports.IMREAL(inumber);\n var y = exports.IMAGINARY(inumber);\n\n if (utils.anyIsError(x, y)) {\n return error.value;\n }\n\n // Return tangent of complex number\n return this.IMDIV(this.IMSIN(inumber), this.IMCOS(inumber));\n};\n\nexports.OCT2BIN = function(number, places) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-7]{1,10}$/.test(number)) {\n return error.num;\n }\n\n // Check if number is negative\n var negative = (number.length === 10 && number.substring(0, 1) === '7') ? true : false;\n\n // Convert octal number to decimal\n var decimal = (negative) ? parseInt(number, 8) - 1073741824 : parseInt(number, 8);\n\n // Return error if number is lower than -512 or greater than 511\n if (decimal < -512 || decimal > 511) {\n return error.num;\n }\n\n // Ignore places and return a 10-character binary number if number is negative\n if (negative) {\n return '1' + text.REPT('0', 9 - (512 + decimal).toString(2).length) + (512 + decimal).toString(2);\n }\n\n // Convert decimal number to binary\n var result = decimal.toString(2);\n\n // Return binary number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result;\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return error.value;\n }\n\n // Return error if places is negative\n if (places < 0) {\n return error.num;\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n }\n};\n\nexports.OCT2DEC = function(number) {\n // Return error if number is not octal or contains more than ten characters (10 digits)\n if (!/^[0-7]{1,10}$/.test(number)) {\n return error.num;\n }\n\n // Convert octal number to decimal\n var decimal = parseInt(number, 8);\n\n // Return decimal number\n return (decimal >= 536870912) ? decimal - 1073741824 : decimal;\n};\n\nexports.OCT2HEX = function(number, places) {\n // Return error if number is not octal or contains more than ten characters (10 digits)\n if (!/^[0-7]{1,10}$/.test(number)) {\n return error.num;\n }\n\n // Convert octal number to decimal\n var decimal = parseInt(number, 8);\n\n // Ignore places and return a 10-character octal number if number is negative\n if (decimal >= 536870912) {\n return 'ff' + (decimal + 3221225472).toString(16);\n }\n\n // Convert decimal number to hexadecimal\n var result = decimal.toString(16);\n\n // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result;\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return error.value;\n }\n\n // Return error if places is negative\n if (places < 0) {\n return error.num;\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n }\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/engineering.js\n ** module id = 25\n ** module chunks = 0\n **/","var M = Math;\nfunction _horner(arr, v) { return arr.reduce(function(z,w){return v * z + w;},0); };\nfunction _bessel_iter(x, n, f0, f1, sign) {\n if(!sign) sign = -1;\n var tdx = 2 / x, f2;\n if(n === 0) return f0;\n if(n === 1) return f1;\n for(var o = 1; o != n; ++o) {\n f2 = f1 * o * tdx + sign * f0;\n f0 = f1; f1 = f2;\n }\n return f1;\n}\nfunction _bessel_wrap(bessel0, bessel1, name, nonzero, sign) {\n return function bessel(x,n) {\n if(n === 0) return bessel0(x);\n if(n === 1) return bessel1(x);\n if(n < 0) throw name + ': Order (' + n + ') must be nonnegative';\n if(nonzero == 1 && x === 0) throw name + ': Undefined when x == 0';\n if(nonzero == 2 && x <= 0) throw name + ': Undefined when x <= 0';\n var b0 = bessel0(x), b1 = bessel1(x);\n return _bessel_iter(x, n, b0, b1, sign);\n };\n}\nvar besselj = (function() {\n var b0_a1a = [57568490574.0,-13362590354.0,651619640.7,-11214424.18,77392.33017,-184.9052456].reverse();\n var b0_a2a = [57568490411.0,1029532985.0,9494680.718,59272.64853,267.8532712,1.0].reverse();\n var b0_a1b = [1.0, -0.1098628627e-2, 0.2734510407e-4, -0.2073370639e-5, 0.2093887211e-6].reverse();\n var b0_a2b = [-0.1562499995e-1, 0.1430488765e-3, -0.6911147651e-5, 0.7621095161e-6, -0.934935152e-7].reverse();\n var W = 0.636619772; // 2 / Math.PI\n\n function bessel0(x) {\n var a, a1, a2, y = x * x, xx = M.abs(x) - 0.785398164;\n if(M.abs(x) < 8) {\n a1 = _horner(b0_a1a, y);\n a2 = _horner(b0_a2a, y);\n a = a1/a2;\n }\n else {\n y = 64 / y;\n a1 = _horner(b0_a1b, y);\n a2 = _horner(b0_a2b, y);\n a = M.sqrt(W/M.abs(x))*(M.cos(xx)*a1-M.sin(xx)*a2*8/M.abs(x));\n }\n return a;\n }\n var b1_a1a = [72362614232.0,-7895059235.0,242396853.1,-2972611.439, 15704.48260, -30.16036606].reverse();\n var b1_a2a = [144725228442.0, 2300535178.0, 18583304.74, 99447.43394, 376.9991397, 1.0].reverse();\n var b1_a1b = [1.0, 0.183105e-2, -0.3516396496e-4, 0.2457520174e-5, -0.240337019e-6].reverse();\n var b1_a2b = [0.04687499995, -0.2002690873e-3, 0.8449199096e-5, -0.88228987e-6, 0.105787412e-6].reverse();\n function bessel1(x) {\n var a, a1, a2, y = x*x, xx = M.abs(x) - 2.356194491;\n if(Math.abs(x)< 8) {\n a1 = x*_horner(b1_a1a, y);\n a2 = _horner(b1_a2a, y);\n a = a1 / a2;\n } else {\n y = 64 / y;\n a1=_horner(b1_a1b, y);\n a2=_horner(b1_a2b, y);\n a=M.sqrt(W/M.abs(x))*(M.cos(xx)*a1-M.sin(xx)*a2*8/M.abs(x));\n if(x < 0) a = -a;\n }\n return a;\n }\n return function besselj(x, n) {\n n = Math.round(n);\n if(n === 0) return bessel0(M.abs(x));\n if(n === 1) return bessel1(M.abs(x));\n if(n < 0) throw 'BESSELJ: Order (' + n + ') must be nonnegative';\n if(M.abs(x) === 0) return 0;\n\n var ret, j, tox = 2 / M.abs(x), m, jsum, sum, bjp, bj, bjm;\n if(M.abs(x) > n) {\n ret = _bessel_iter(x, n, bessel0(M.abs(x)), bessel1(M.abs(x)),-1);\n } else {\n m=2*M.floor((n+M.floor(M.sqrt(40*n)))/2);\n jsum=0;\n bjp=ret=sum=0.0;\n bj=1.0;\n for (j=m;j>0;j--) {\n bjm=j*tox*bj-bjp;\n bjp=bj;\n bj=bjm;\n if (M.abs(bj) > 1E10) {\n bj *= 1E-10;\n bjp *= 1E-10;\n ret *= 1E-10;\n sum *= 1E-10;\n }\n if (jsum) sum += bj;\n jsum=!jsum;\n if (j == n) ret=bjp;\n }\n sum=2.0*sum-bj;\n ret /= sum;\n }\n return x < 0 && (n%2) ? -ret : ret;\n };\n})();\nvar bessely = (function() {\n var b0_a1a = [-2957821389.0, 7062834065.0, -512359803.6, 10879881.29, -86327.92757, 228.4622733].reverse();\n var b0_a2a = [40076544269.0, 745249964.8, 7189466.438, 47447.26470, 226.1030244, 1.0].reverse();\n var b0_a1b = [1.0, -0.1098628627e-2, 0.2734510407e-4, -0.2073370639e-5, 0.2093887211e-6].reverse();\n var b0_a2b = [-0.1562499995e-1, 0.1430488765e-3, -0.6911147651e-5, 0.7621095161e-6, -0.934945152e-7].reverse();\n\n var W = 0.636619772;\n function bessel0(x) {\n var a, a1, a2, y = x * x, xx = x - 0.785398164;\n if(x < 8) {\n a1 = _horner(b0_a1a, y);\n a2 = _horner(b0_a2a, y);\n a = a1/a2 + W * besselj(x,0) * M.log(x);\n } else {\n y = 64 / y;\n a1 = _horner(b0_a1b, y);\n a2 = _horner(b0_a2b, y);\n a = M.sqrt(W/x)*(M.sin(xx)*a1+M.cos(xx)*a2*8/x);\n }\n return a;\n }\n\n var b1_a1a = [-0.4900604943e13, 0.1275274390e13, -0.5153438139e11, 0.7349264551e9, -0.4237922726e7, 0.8511937935e4].reverse();\n var b1_a2a = [0.2499580570e14, 0.4244419664e12, 0.3733650367e10, 0.2245904002e8, 0.1020426050e6, 0.3549632885e3, 1].reverse();\n var b1_a1b = [1.0, 0.183105e-2, -0.3516396496e-4, 0.2457520174e-5, -0.240337019e-6].reverse();\n var b1_a2b = [0.04687499995, -0.2002690873e-3, 0.8449199096e-5, -0.88228987e-6, 0.105787412e-6].reverse();\n function bessel1(x) {\n var a, a1, a2, y = x*x, xx = x - 2.356194491;\n if(x < 8) {\n a1 = x*_horner(b1_a1a, y);\n a2 = _horner(b1_a2a, y);\n a = a1/a2 + W * (besselj(x,1) * M.log(x) - 1 / x);\n } else {\n y = 64 / y;\n a1=_horner(b1_a1b, y);\n a2=_horner(b1_a2b, y);\n a=M.sqrt(W/x)*(M.sin(xx)*a1+M.cos(xx)*a2*8/x);\n }\n return a;\n }\n\n return _bessel_wrap(bessel0, bessel1, 'BESSELY', 1, -1);\n})();\nvar besseli = (function() {\n var b0_a = [1.0, 3.5156229, 3.0899424, 1.2067492, 0.2659732, 0.360768e-1, 0.45813e-2].reverse();\n var b0_b = [0.39894228, 0.1328592e-1, 0.225319e-2, -0.157565e-2, 0.916281e-2, -0.2057706e-1, 0.2635537e-1, -0.1647633e-1, 0.392377e-2].reverse();\n function bessel0(x) {\n if(x <= 3.75) return _horner(b0_a, x*x/(3.75*3.75));\n return M.exp(M.abs(x))/M.sqrt(M.abs(x))*_horner(b0_b, 3.75/M.abs(x));\n }\n\n var b1_a = [0.5, 0.87890594, 0.51498869, 0.15084934, 0.2658733e-1, 0.301532e-2, 0.32411e-3].reverse();\n var b1_b = [0.39894228, -0.3988024e-1, -0.362018e-2, 0.163801e-2, -0.1031555e-1, 0.2282967e-1, -0.2895312e-1, 0.1787654e-1, -0.420059e-2].reverse();\n function bessel1(x) {\n if(x < 3.75) return x * _horner(b1_a, x*x/(3.75*3.75));\n return (x < 0 ? -1 : 1) * M.exp(M.abs(x))/M.sqrt(M.abs(x))*_horner(b1_b, 3.75/M.abs(x));\n }\n\n return function besseli(x, n) {\n n = Math.round(n);\n if(n === 0) return bessel0(x);\n if(n == 1) return bessel1(x);\n if(n < 0) throw 'BESSELI Order (' + n + ') must be nonnegative';\n if(M.abs(x) === 0) return 0;\n\n var ret, j, tox = 2 / M.abs(x), m, bip, bi, bim;\n m=2*M.round((n+M.round(M.sqrt(40*n)))/2);\n bip=ret=0.0;\n bi=1.0;\n for (j=m;j>0;j--) {\n bim=j*tox*bi + bip;\n bip=bi; bi=bim;\n if (M.abs(bi) > 1E10) {\n bi *= 1E-10;\n bip *= 1E-10;\n ret *= 1E-10;\n }\n if(j == n) ret = bip;\n }\n ret *= besseli(x, 0) / bi;\n return x < 0 && (n%2) ? -ret : ret;\n };\n\n})();\n\nvar besselk = (function() {\n var b0_a = [-0.57721566, 0.42278420, 0.23069756, 0.3488590e-1, 0.262698e-2, 0.10750e-3, 0.74e-5].reverse();\n var b0_b = [1.25331414, -0.7832358e-1, 0.2189568e-1, -0.1062446e-1, 0.587872e-2, -0.251540e-2, 0.53208e-3].reverse();\n function bessel0(x) {\n if(x <= 2) return -M.log(x/2)*besseli(x,0) + _horner(b0_a, x*x/4);\n return M.exp(-x)/M.sqrt(x)*_horner(b0_b, 2/x);\n }\n\n var b1_a = [1.0, 0.15443144, -0.67278579, -0.18156897, -0.1919402e-1, -0.110404e-2, -0.4686e-4].reverse();\n var b1_b = [1.25331414, 0.23498619, -0.3655620e-1, 0.1504268e-1, -0.780353e-2, 0.325614e-2, -0.68245e-3].reverse();\n function bessel1(x) {\n if(x <= 2) return M.log(x/2)*besseli(x,1) + (1/x)*_horner(b1_a, x*x/4);\n return M.exp(-x)/M.sqrt(x)*_horner(b1_b, 2/x);\n }\n\n return _bessel_wrap(bessel0, bessel1, 'BESSELK', 2, 1);\n})();\nif(typeof exports !== \"undefined\") {\n exports.besselj = besselj;\n exports.bessely = bessely;\n exports.besseli = besseli;\n exports.besselk = besselk;\n}\n\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/bessel/bessel.js\n ** module id = 26\n ** module chunks = 0\n **/","var error = require('./error');\nvar utils = require('./utils');\n\nvar d1900 = new Date(1900, 0, 1);\nvar WEEK_STARTS = [\n undefined,\n 0,\n 1,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 0\n];\nvar WEEK_TYPES = [\n [],\n [1, 2, 3, 4, 5, 6, 7],\n [7, 1, 2, 3, 4, 5, 6],\n [6, 0, 1, 2, 3, 4, 5],\n [],\n [],\n [],\n [],\n [],\n [],\n [],\n [7, 1, 2, 3, 4, 5, 6],\n [6, 7, 1, 2, 3, 4, 5],\n [5, 6, 7, 1, 2, 3, 4],\n [4, 5, 6, 7, 1, 2, 3],\n [3, 4, 5, 6, 7, 1, 2],\n [2, 3, 4, 5, 6, 7, 1],\n [1, 2, 3, 4, 5, 6, 7]\n];\nvar WEEKEND_TYPES = [\n [],\n [6, 0],\n [0, 1],\n [1, 2],\n [2, 3],\n [3, 4],\n [4, 5],\n [5, 6],\n undefined,\n undefined,\n undefined, [0, 0],\n [1, 1],\n [2, 2],\n [3, 3],\n [4, 4],\n [5, 5],\n [6, 6]\n];\n\nexports.DATE = function(year, month, day) {\n var result;\n\n year = utils.parseNumber(year);\n month = utils.parseNumber(month);\n day = utils.parseNumber(day);\n\n if (utils.anyIsError(year, month, day)) {\n result = error.value;\n\n } else if (year < 0 || month < 0 || day < 0) {\n result = error.num;\n\n } else {\n result = new Date(year, month - 1, day);\n }\n\n return result;\n};\n\nexports.DATEVALUE = function(date_text) {\n if (typeof date_text !== 'string') {\n return error.value;\n }\n var date = Date.parse(date_text);\n\n if (isNaN(date)) {\n return error.value;\n }\n if (date <= -2203891200000) {\n return (date - d1900) / 86400000 + 1;\n }\n\n return (date - d1900) / 86400000 + 2;\n};\n\nexports.DAY = function(serial_number) {\n var date = utils.parseDate(serial_number);\n if (date instanceof Error) {\n return date;\n }\n\n return date.getDate();\n};\n\nexports.DAYS = function(end_date, start_date) {\n end_date = utils.parseDate(end_date);\n start_date = utils.parseDate(start_date);\n\n if (end_date instanceof Error) {\n return end_date;\n }\n if (start_date instanceof Error) {\n return start_date;\n }\n\n return serial(end_date) - serial(start_date);\n};\n\nexports.DAYS360 = function(start_date, end_date, method) {\n method = utils.parseBool(method);\n start_date = utils.parseDate(start_date);\n end_date = utils.parseDate(end_date);\n\n if (start_date instanceof Error) {\n return start_date;\n }\n if (end_date instanceof Error) {\n return end_date;\n }\n if (method instanceof Error) {\n return method;\n }\n var sm = start_date.getMonth();\n var em = end_date.getMonth();\n var sd, ed;\n\n if (method) {\n sd = start_date.getDate() === 31 ? 30 : start_date.getDate();\n ed = end_date.getDate() === 31 ? 30 : end_date.getDate();\n } else {\n var smd = new Date(start_date.getFullYear(), sm + 1, 0).getDate();\n var emd = new Date(end_date.getFullYear(), em + 1, 0).getDate();\n sd = start_date.getDate() === smd ? 30 : start_date.getDate();\n if (end_date.getDate() === emd) {\n if (sd < 30) {\n em++;\n ed = 1;\n } else {\n ed = 30;\n }\n } else {\n ed = end_date.getDate();\n }\n }\n\n return 360 * (end_date.getFullYear() - start_date.getFullYear()) +\n 30 * (em - sm) + (ed - sd);\n};\n\nexports.EDATE = function(start_date, months) {\n start_date = utils.parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date;\n }\n if (isNaN(months)) {\n return error.value;\n }\n months = parseInt(months, 10);\n start_date.setMonth(start_date.getMonth() + months);\n\n return serial(start_date);\n};\n\nexports.EOMONTH = function(start_date, months) {\n start_date = utils.parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date;\n }\n if (isNaN(months)) {\n return error.value;\n }\n months = parseInt(months, 10);\n\n return serial(new Date(start_date.getFullYear(), start_date.getMonth() + months + 1, 0));\n};\n\nexports.HOUR = function(serial_number) {\n serial_number = utils.parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number;\n }\n\n return serial_number.getHours();\n};\n\nexports.INTERVAL = function (second) {\n if (typeof second !== 'number' && typeof second !== 'string') {\n return error.value;\n } else {\n second = parseInt(second, 10);\n }\n\n var year = Math.floor(second/946080000);\n second = second%946080000;\n var month = Math.floor(second/2592000);\n second = second%2592000;\n var day = Math.floor(second/86400);\n second = second%86400;\n\n var hour = Math.floor(second/3600);\n second = second%3600;\n var min = Math.floor(second/60);\n second = second%60;\n var sec = second;\n\n year = (year > 0) ? year + 'Y' : '';\n month = (month > 0) ? month + 'M' : '';\n day = (day > 0) ? day + 'D' : '';\n hour = (hour > 0) ? hour + 'H' : '';\n min = (min > 0) ? min + 'M' : '';\n sec = (sec > 0) ? sec + 'S' : '';\n\n return 'P' + year + month + day + 'T' + hour + min + sec;\n};\n\nexports.ISOWEEKNUM = function(date) {\n date = utils.parseDate(date);\n\n if (date instanceof Error) {\n return date;\n }\n\n date.setHours(0, 0, 0);\n date.setDate(date.getDate() + 4 - (date.getDay() || 7));\n var yearStart = new Date(date.getFullYear(), 0, 1);\n\n return Math.ceil((((date - yearStart) / 86400000) + 1) / 7);\n};\n\nexports.MINUTE = function(serial_number) {\n serial_number = utils.parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number;\n }\n\n return serial_number.getMinutes();\n};\n\nexports.MONTH = function(serial_number) {\n serial_number = utils.parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number;\n }\n\n return serial_number.getMonth() + 1;\n};\n\nexports.NETWORKDAYS = function(start_date, end_date, holidays) {\n return this.NETWORKDAYS.INTL(start_date, end_date, 1, holidays);\n};\n\nexports.NETWORKDAYS.INTL = function(start_date, end_date, weekend, holidays) {\n start_date = utils.parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date;\n }\n end_date = utils.parseDate(end_date);\n\n if (end_date instanceof Error) {\n return end_date;\n }\n if (weekend === undefined) {\n weekend = WEEKEND_TYPES[1];\n } else {\n weekend = WEEKEND_TYPES[weekend];\n }\n if (!(weekend instanceof Array)) {\n return error.value;\n }\n if (holidays === undefined) {\n holidays = [];\n } else if (!(holidays instanceof Array)) {\n holidays = [holidays];\n }\n\n for (var i = 0; i < holidays.length; i++) {\n var h = utils.parseDate(holidays[i]);\n if (h instanceof Error) {\n return h;\n }\n holidays[i] = h;\n }\n var days = (end_date - start_date) / (1000 * 60 * 60 * 24) + 1;\n var total = days;\n var day = start_date;\n for (i = 0; i < days; i++) {\n var d = (new Date().getTimezoneOffset() > 0) ? day.getUTCDay() : day.getDay();\n var dec = false;\n if (d === weekend[0] || d === weekend[1]) {\n dec = true;\n }\n for (var j = 0; j < holidays.length; j++) {\n var holiday = holidays[j];\n if (holiday.getDate() === day.getDate() &&\n holiday.getMonth() === day.getMonth() &&\n holiday.getFullYear() === day.getFullYear()) {\n dec = true;\n break;\n }\n }\n if (dec) {\n total--;\n }\n day.setDate(day.getDate() + 1);\n }\n\n return total;\n};\n\nexports.NOW = function() {\n return new Date();\n};\n\nexports.SECOND = function(serial_number) {\n serial_number = utils.parseDate(serial_number);\n if (serial_number instanceof Error) {\n return serial_number;\n }\n\n return serial_number.getSeconds();\n};\n\nexports.TIME = function(hour, minute, second) {\n hour = utils.parseNumber(hour);\n minute = utils.parseNumber(minute);\n second = utils.parseNumber(second);\n if (utils.anyIsError(hour, minute, second)) {\n return error.value;\n }\n if (hour < 0 || minute < 0 || second < 0) {\n return error.num;\n }\n\n return (3600 * hour + 60 * minute + second) / 86400;\n};\n\nexports.TIMEVALUE = function(time_text) {\n time_text = utils.parseDate(time_text);\n\n if (time_text instanceof Error) {\n return time_text;\n }\n\n return (3600 * time_text.getHours() + 60 * time_text.getMinutes() + time_text.getSeconds()) / 86400;\n};\n\nexports.TODAY = function() {\n return new Date();\n};\n\nexports.WEEKDAY = function(serial_number, return_type) {\n serial_number = utils.parseDate(serial_number);\n if (serial_number instanceof Error) {\n return serial_number;\n }\n if (return_type === undefined) {\n return_type = 1;\n }\n var day = serial_number.getDay();\n\n return WEEK_TYPES[return_type][day];\n};\n\nexports.WEEKNUM = function(serial_number, return_type) {\n serial_number = utils.parseDate(serial_number);\n if (serial_number instanceof Error) {\n return serial_number;\n }\n if (return_type === undefined) {\n return_type = 1;\n }\n if (return_type === 21) {\n return this.ISOWEEKNUM(serial_number);\n }\n var week_start = WEEK_STARTS[return_type];\n var jan = new Date(serial_number.getFullYear(), 0, 1);\n var inc = jan.getDay() < week_start ? 1 : 0;\n jan -= Math.abs(jan.getDay() - week_start) * 24 * 60 * 60 * 1000;\n\n return Math.floor(((serial_number - jan) / (1000 * 60 * 60 * 24)) / 7 + 1) + inc;\n};\n\nexports.WORKDAY = function(start_date, days, holidays) {\n return this.WORKDAY.INTL(start_date, days, 1, holidays);\n};\n\nexports.WORKDAY.INTL = function(start_date, days, weekend, holidays) {\n start_date = utils.parseDate(start_date);\n if (start_date instanceof Error) {\n return start_date;\n }\n days = utils.parseNumber(days);\n if (days instanceof Error) {\n return days;\n }\n if (days < 0) {\n return error.num;\n }\n if (weekend === undefined) {\n weekend = WEEKEND_TYPES[1];\n } else {\n weekend = WEEKEND_TYPES[weekend];\n }\n if (!(weekend instanceof Array)) {\n return error.value;\n }\n if (holidays === undefined) {\n holidays = [];\n } else if (!(holidays instanceof Array)) {\n holidays = [holidays];\n }\n for (var i = 0; i < holidays.length; i++) {\n var h = utils.parseDate(holidays[i]);\n if (h instanceof Error) {\n return h;\n }\n holidays[i] = h;\n }\n var d = 0;\n while (d < days) {\n start_date.setDate(start_date.getDate() + 1);\n var day = start_date.getDay();\n if (day === weekend[0] || day === weekend[1]) {\n continue;\n }\n for (var j = 0; j < holidays.length; j++) {\n var holiday = holidays[j];\n if (holiday.getDate() === start_date.getDate() &&\n holiday.getMonth() === start_date.getMonth() &&\n holiday.getFullYear() === start_date.getFullYear()) {\n d--;\n break;\n }\n }\n d++;\n }\n\n return start_date;\n};\n\nexports.YEAR = function(serial_number) {\n serial_number = utils.parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number;\n }\n\n return serial_number.getFullYear();\n};\n\nfunction isLeapYear(year) {\n return new Date(year, 1, 29).getMonth() === 1;\n}\n\n// TODO : Use DAYS ?\nfunction daysBetween(start_date, end_date) {\n return Math.ceil((end_date - start_date) / 1000 / 60 / 60 / 24);\n}\n\nexports.YEARFRAC = function(start_date, end_date, basis) {\n start_date = utils.parseDate(start_date);\n if (start_date instanceof Error) {\n return start_date;\n }\n end_date = utils.parseDate(end_date);\n if (end_date instanceof Error) {\n return end_date;\n }\n\n basis = basis || 0;\n var sd = start_date.getDate();\n var sm = start_date.getMonth() + 1;\n var sy = start_date.getFullYear();\n var ed = end_date.getDate();\n var em = end_date.getMonth() + 1;\n var ey = end_date.getFullYear();\n\n switch (basis) {\n case 0:\n // US (NASD) 30/360\n if (sd === 31 && ed === 31) {\n sd = 30;\n ed = 30;\n } else if (sd === 31) {\n sd = 30;\n } else if (sd === 30 && ed === 31) {\n ed = 30;\n }\n return ((ed + em * 30 + ey * 360) - (sd + sm * 30 + sy * 360)) / 360;\n case 1:\n // Actual/actual\n var feb29Between = function(date1, date2) {\n var year1 = date1.getFullYear();\n var mar1year1 = new Date(year1, 2, 1);\n if (isLeapYear(year1) && date1 < mar1year1 && date2 >= mar1year1) {\n return true;\n }\n var year2 = date2.getFullYear();\n var mar1year2 = new Date(year2, 2, 1);\n return (isLeapYear(year2) && date2 >= mar1year2 && date1 < mar1year2);\n };\n var ylength = 365;\n if (sy === ey || ((sy + 1) === ey) && ((sm > em) || ((sm === em) && (sd >= ed)))) {\n if ((sy === ey && isLeapYear(sy)) ||\n feb29Between(start_date, end_date) ||\n (em === 1 && ed === 29)) {\n ylength = 366;\n }\n return daysBetween(start_date, end_date) / ylength;\n }\n var years = (ey - sy) + 1;\n var days = (new Date(ey + 1, 0, 1) - new Date(sy, 0, 1)) / 1000 / 60 / 60 / 24;\n var average = days / years;\n return daysBetween(start_date, end_date) / average;\n case 2:\n // Actual/360\n return daysBetween(start_date, end_date) / 360;\n case 3:\n // Actual/365\n return daysBetween(start_date, end_date) / 365;\n case 4:\n // European 30/360\n return ((ed + em * 30 + ey * 360) - (sd + sm * 30 + sy * 360)) / 360;\n }\n};\n\nfunction serial(date) {\n var addOn = (date > -2203891200000) ? 2 : 1;\n\n return (date - d1900) / 86400000 + addOn;\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/date-time.js\n ** module id = 27\n ** module chunks = 0\n **/","var error = require('./error');\nvar stats = require('./statistical');\nvar maths = require('./math-trig');\nvar utils = require('./utils');\n\nfunction compact(array) {\n var result = [];\n\n utils.arrayEach(array, function(value) {\n if (value) {\n result.push(value);\n }\n });\n\n return result;\n}\n\nexports.FINDFIELD = function(database, title) {\n var index = null;\n\n utils.arrayEach(database, function(value, i) {\n if (value[0] === title) {\n index = i;\n return false;\n }\n });\n\n // Return error if the input field title is incorrect\n if (index == null) {\n return error.value;\n }\n\n return index;\n};\n\nfunction findResultIndex(database, criterias) {\n var matches = {};\n for (var i = 1; i < database[0].length; ++i) {\n matches[i] = true;\n }\n var maxCriteriaLength = criterias[0].length;\n for (i = 1; i < criterias.length; ++i) {\n if (criterias[i].length > maxCriteriaLength) {\n maxCriteriaLength = criterias[i].length;\n }\n }\n\n for (var k = 1; k < database.length; ++k) {\n for (var l = 1; l < database[k].length; ++l) {\n var currentCriteriaResult = false;\n var hasMatchingCriteria = false;\n for (var j = 0; j < criterias.length; ++j) {\n var criteria = criterias[j];\n if (criteria.length < maxCriteriaLength) {\n continue;\n }\n\n var criteriaField = criteria[0];\n if (database[k][0] !== criteriaField) {\n continue;\n }\n hasMatchingCriteria = true;\n for (var p = 1; p < criteria.length; ++p) {\n currentCriteriaResult = currentCriteriaResult || eval(database[k][l] + criteria[p]); // jshint ignore:line\n }\n }\n if (hasMatchingCriteria) {\n matches[l] = matches[l] && currentCriteriaResult;\n }\n }\n }\n\n var result = [];\n for (var n = 0; n < database[0].length; ++n) {\n if (matches[n]) {\n result.push(n - 1);\n }\n }\n\n return result;\n}\n\n// Database functions\nexports.DAVERAGE = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n var sum = 0;\n\n utils.arrayEach(resultIndexes, function(value) {\n sum += targetFields[value];\n });\n\n return resultIndexes.length === 0 ? error.div0 : sum / resultIndexes.length;\n};\n\nexports.DCOUNT = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n\n var targetValues = [];\n\n utils.arrayEach(resultIndexes, function(value) {\n targetValues.push(targetFields[value]);\n });\n\n return stats.COUNT(targetValues);\n};\n\nexports.DCOUNTA = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n\n var targetValues = [];\n\n utils.arrayEach(resultIndexes, function(value) {\n targetValues.push(targetFields[value]);\n });\n\n return stats.COUNTA(targetValues);\n};\n\nexports.DGET = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n\n // Return error if no record meets the criteria\n if (resultIndexes.length === 0) {\n return error.value;\n }\n // Returns the #NUM! error value because more than one record meets the\n // criteria\n if (resultIndexes.length > 1) {\n return error.num;\n }\n\n return targetFields[resultIndexes[0]];\n};\n\nexports.DMAX = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n\n var maxValue = targetFields[resultIndexes[0]];\n\n utils.arrayEach(resultIndexes, function(value) {\n if (maxValue < targetFields[value]) {\n maxValue = targetFields[value];\n }\n });\n\n return maxValue;\n};\n\nexports.DMIN = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n\n var minValue = targetFields[resultIndexes[0]];\n\n utils.arrayEach(resultIndexes, function(value) {\n if (minValue > targetFields[value]) {\n minValue = targetFields[value];\n }\n });\n\n return minValue;\n};\n\nexports.DPRODUCT = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n\n var targetValues = [];\n\n utils.arrayEach(resultIndexes, function(value) {\n targetValues.push(targetFields[value]);\n });\n targetValues = compact(targetValues);\n\n var result = 1;\n\n utils.arrayEach(targetValues, function(value) {\n result *= value;\n });\n\n return result;\n};\n\nexports.DSTDEV = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n var targetValues = [];\n\n utils.arrayEach(resultIndexes, function(value) {\n targetValues.push(targetFields[value]);\n });\n targetValues = compact(targetValues);\n\n return stats.STDEV.S(targetValues);\n};\n\nexports.DSTDEVP = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n\n var targetValues = [];\n\n utils.arrayEach(resultIndexes, function(value) {\n targetValues.push(targetFields[value]);\n });\n targetValues = compact(targetValues);\n\n return stats.STDEV.P(targetValues);\n};\n\nexports.DSUM = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n\n var targetValues = [];\n\n utils.arrayEach(resultIndexes, function(value) {\n targetValues.push(targetFields[value]);\n });\n\n return maths.SUM(targetValues);\n};\n\nexports.DVAR = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n var targetValues = [];\n\n utils.arrayEach(resultIndexes, function(value) {\n targetValues.push(targetFields[value]);\n });\n\n return stats.VAR.S(targetValues);\n};\n\nexports.DVARP = function(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && (typeof field !== \"string\")) {\n return error.value;\n }\n var resultIndexes = findResultIndex(database, criteria);\n var targetFields = [];\n\n if (typeof field === \"string\") {\n var index = exports.FINDFIELD(database, field);\n targetFields = utils.rest(database[index]);\n } else {\n targetFields = utils.rest(database[field]);\n }\n var targetValues = [];\n\n utils.arrayEach(resultIndexes, function(value) {\n targetValues.push(targetFields[value]);\n });\n\n return stats.VAR.P(targetValues);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/database.js\n ** module id = 28\n ** module chunks = 0\n **/","var error = require('./error');\nvar utils = require('./utils');\nvar information = require('./information');\n\nexports.AND = function() {\n var args = utils.flatten(arguments);\n var result = true;\n for (var i = 0; i < args.length; i++) {\n if (!args[i]) {\n result = false;\n }\n }\n return result;\n};\n\nexports.CHOOSE = function() {\n if (arguments.length < 2) {\n return error.na;\n }\n\n var index = arguments[0];\n if (index < 1 || index > 254) {\n return error.value;\n }\n\n if (arguments.length < index + 1) {\n return error.value;\n }\n\n return arguments[index];\n};\n\nexports.FALSE = function() {\n return false;\n};\n\nexports.IF = function(test, then_value, otherwise_value) {\n return test ? then_value : otherwise_value;\n};\n\nexports.IFERROR = function(value, valueIfError) {\n if (information.ISERROR(value)) {\n return valueIfError;\n }\n return value;\n};\n\nexports.IFNA = function(value, value_if_na) {\n return value === error.na ? value_if_na : value;\n};\n\nexports.NOT = function(logical) {\n return !logical;\n};\n\nexports.OR = function() {\n var args = utils.flatten(arguments);\n var result = false;\n for (var i = 0; i < args.length; i++) {\n if (args[i]) {\n result = true;\n }\n }\n return result;\n};\n\nexports.TRUE = function() {\n return true;\n};\n\nexports.XOR = function() {\n var args = utils.flatten(arguments);\n var result = 0;\n for (var i = 0; i < args.length; i++) {\n if (args[i]) {\n result++;\n }\n }\n return (Math.floor(Math.abs(result)) & 1) ? true : false;\n};\n\nexports.SWITCH = function () {\n var result;\n\n if (arguments.length > 0) {\n var targetValue = arguments[0];\n var argc = arguments.length - 1;\n var switchCount = Math.floor(argc / 2);\n var switchSatisfied = false;\n var hasDefaultClause = argc % 2 !== 0;\n var defaultClause = argc % 2 === 0 ? null : arguments[arguments.length - 1];\n\n if (switchCount) {\n for (var index = 0; index < switchCount; index++) {\n if (targetValue === arguments[index * 2 + 1]) {\n result = arguments[index * 2 + 2];\n switchSatisfied = true;\n break;\n }\n }\n }\n\n if (!switchSatisfied) {\n result = hasDefaultClause ? defaultClause : error.na;\n }\n } else {\n result = error.value;\n }\n\n return result;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/logical.js\n ** module id = 29\n ** module chunks = 0\n **/","var error = require('./error');\nvar dateTime = require('./date-time');\nvar utils = require('./utils');\n\nfunction validDate(d) {\n return d && d.getTime && !isNaN(d.getTime());\n}\n\nfunction ensureDate(d) {\n return (d instanceof Date)?d:new Date(d);\n}\n\nexports.ACCRINT = function(issue, first, settlement, rate, par, frequency, basis) {\n // Return error if either date is invalid\n issue = ensureDate(issue);\n first = ensureDate(first);\n settlement = ensureDate(settlement);\n if (!validDate(issue) || !validDate(first) || !validDate(settlement)) {\n return error.value;\n }\n\n // Return error if either rate or par are lower than or equal to zero\n if (rate <= 0 || par <= 0) {\n return error.num\n }\n\n // Return error if frequency is neither 1, 2, or 4\n if ([1, 2, 4].indexOf(frequency) === -1) {\n return error.num;\n }\n\n // Return error if basis is neither 0, 1, 2, 3, or 4\n if ([0, 1, 2, 3, 4].indexOf(basis) === -1) {\n return error.num;\n }\n\n // Return error if settlement is before or equal to issue\n if (settlement <= issue) {\n return error.num;\n }\n\n // Set default values\n par = par || 0;\n basis = basis || 0;\n\n // Compute accrued interest\n return par * rate * dateTime.YEARFRAC(issue, settlement, basis);\n};\n\n// TODO\nexports.ACCRINTM = function() {\n throw new Error('ACCRINTM is not implemented');\n};\n\n// TODO\nexports.AMORDEGRC = function() {\n throw new Error('AMORDEGRC is not implemented');\n};\n\n// TODO\nexports.AMORLINC = function() {\n throw new Error('AMORLINC is not implemented');\n};\n\n// TODO\nexports.COUPDAYBS = function() {\n throw new Error('COUPDAYBS is not implemented');\n};\n\n// TODO\nexports.COUPDAYS = function() {\n throw new Error('COUPDAYS is not implemented');\n};\n\n// TODO\nexports.COUPDAYSNC = function() {\n throw new Error('COUPDAYSNC is not implemented');\n};\n\n// TODO\nexports.COUPNCD = function() {\n throw new Error('COUPNCD is not implemented');\n};\n\n// TODO\nexports.COUPNUM = function() {\n throw new Error('COUPNUM is not implemented');\n};\n\n// TODO\nexports.COUPPCD = function() {\n throw new Error('COUPPCD is not implemented');\n};\n\nexports.CUMIPMT = function(rate, periods, value, start, end, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n // Credits: Hannes Stiebitzhofer for the translations of function and variable names\n // Requires exports.FV() and exports.PMT() from exports.js [http://stoic.com/exports/]\n\n rate = utils.parseNumber(rate);\n periods = utils.parseNumber(periods);\n value = utils.parseNumber(value);\n if (utils.anyIsError(rate, periods, value)) {\n return error.value;\n }\n\n // Return error if either rate, periods, or value are lower than or equal to zero\n if (rate <= 0 || periods <= 0 || value <= 0) {\n return error.num;\n }\n\n // Return error if start < 1, end < 1, or start > end\n if (start < 1 || end < 1 || start > end) {\n return error.num;\n }\n\n // Return error if type is neither 0 nor 1\n if (type !== 0 && type !== 1) {\n return error.num;\n }\n\n // Compute cumulative interest\n var payment = exports.PMT(rate, periods, value, 0, type);\n var interest = 0;\n\n if (start === 1) {\n if (type === 0) {\n interest = -value;\n start++;\n }\n }\n\n for (var i = start; i <= end; i++) {\n if (type === 1) {\n interest += exports.FV(rate, i - 2, payment, value, 1) - payment;\n } else {\n interest += exports.FV(rate, i - 1, payment, value, 0);\n }\n }\n interest *= rate;\n\n // Return cumulative interest\n return interest;\n};\n\nexports.CUMPRINC = function(rate, periods, value, start, end, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n // Credits: Hannes Stiebitzhofer for the translations of function and variable names\n\n rate = utils.parseNumber(rate);\n periods = utils.parseNumber(periods);\n value = utils.parseNumber(value);\n if (utils.anyIsError(rate, periods, value)) {\n return error.value;\n }\n\n // Return error if either rate, periods, or value are lower than or equal to zero\n if (rate <= 0 || periods <= 0 || value <= 0) {\n return error.num;\n }\n\n // Return error if start < 1, end < 1, or start > end\n if (start < 1 || end < 1 || start > end) {\n return error.num;\n }\n\n // Return error if type is neither 0 nor 1\n if (type !== 0 && type !== 1) {\n return error.num;\n }\n\n // Compute cumulative principal\n var payment = exports.PMT(rate, periods, value, 0, type);\n var principal = 0;\n if (start === 1) {\n if (type === 0) {\n principal = payment + value * rate;\n } else {\n principal = payment;\n }\n start++;\n }\n for (var i = start; i <= end; i++) {\n if (type > 0) {\n principal += payment - (exports.FV(rate, i - 2, payment, value, 1) - payment) * rate;\n } else {\n principal += payment - exports.FV(rate, i - 1, payment, value, 0) * rate;\n }\n }\n\n // Return cumulative principal\n return principal;\n};\n\nexports.DB = function(cost, salvage, life, period, month) {\n // Initialize month\n month = (month === undefined) ? 12 : month;\n\n cost = utils.parseNumber(cost);\n salvage = utils.parseNumber(salvage);\n life = utils.parseNumber(life);\n period = utils.parseNumber(period);\n month = utils.parseNumber(month);\n if (utils.anyIsError(cost, salvage, life, period, month)) {\n return error.value;\n }\n\n // Return error if any of the parameters is negative\n if (cost < 0 || salvage < 0 || life < 0 || period < 0) {\n return error.num;\n }\n\n // Return error if month is not an integer between 1 and 12\n if ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].indexOf(month) === -1) {\n return error.num;\n }\n\n // Return error if period is greater than life\n if (period > life) {\n return error.num;\n }\n\n // Return 0 (zero) if salvage is greater than or equal to cost\n if (salvage >= cost) {\n return 0;\n }\n\n // Rate is rounded to three decimals places\n var rate = (1 - Math.pow(salvage / cost, 1 / life)).toFixed(3);\n\n // Compute initial depreciation\n var initial = cost * rate * month / 12;\n\n // Compute total depreciation\n var total = initial;\n var current = 0;\n var ceiling = (period === life) ? life - 1 : period;\n for (var i = 2; i <= ceiling; i++) {\n current = (cost - total) * rate;\n total += current;\n }\n\n // Depreciation for the first and last periods are special cases\n if (period === 1) {\n // First period\n return initial;\n } else if (period === life) {\n // Last period\n return (cost - total) * rate;\n } else {\n return current;\n }\n};\n\nexports.DDB = function(cost, salvage, life, period, factor) {\n // Initialize factor\n factor = (factor === undefined) ? 2 : factor;\n\n cost = utils.parseNumber(cost);\n salvage = utils.parseNumber(salvage);\n life = utils.parseNumber(life);\n period = utils.parseNumber(period);\n factor = utils.parseNumber(factor);\n if (utils.anyIsError(cost, salvage, life, period, factor)) {\n return error.value;\n }\n\n // Return error if any of the parameters is negative or if factor is null\n if (cost < 0 || salvage < 0 || life < 0 || period < 0 || factor <= 0) {\n return error.num;\n }\n\n // Return error if period is greater than life\n if (period > life) {\n return error.num;\n }\n\n // Return 0 (zero) if salvage is greater than or equal to cost\n if (salvage >= cost) {\n return 0;\n }\n\n // Compute depreciation\n var total = 0;\n var current = 0;\n for (var i = 1; i <= period; i++) {\n current = Math.min((cost - total) * (factor / life), (cost - salvage - total));\n total += current;\n }\n\n // Return depreciation\n return current;\n};\n\n// TODO\nexports.DISC = function() {\n throw new Error('DISC is not implemented');\n};\n\nexports.DOLLARDE = function(dollar, fraction) {\n // Credits: algorithm inspired by Apache OpenOffice\n\n dollar = utils.parseNumber(dollar);\n fraction = utils.parseNumber(fraction);\n if (utils.anyIsError(dollar, fraction)) {\n return error.value;\n }\n\n // Return error if fraction is negative\n if (fraction < 0) {\n return error.num;\n }\n\n // Return error if fraction is greater than or equal to 0 and less than 1\n if (fraction >= 0 && fraction < 1) {\n return error.div0;\n }\n\n // Truncate fraction if it is not an integer\n fraction = parseInt(fraction, 10);\n\n // Compute integer part\n var result = parseInt(dollar, 10);\n\n // Add decimal part\n result += (dollar % 1) * Math.pow(10, Math.ceil(Math.log(fraction) / Math.LN10)) / fraction;\n\n // Round result\n var power = Math.pow(10, Math.ceil(Math.log(fraction) / Math.LN2) + 1);\n result = Math.round(result * power) / power;\n\n // Return converted dollar price\n return result;\n};\n\nexports.DOLLARFR = function(dollar, fraction) {\n // Credits: algorithm inspired by Apache OpenOffice\n\n dollar = utils.parseNumber(dollar);\n fraction = utils.parseNumber(fraction);\n if (utils.anyIsError(dollar, fraction)) {\n return error.value;\n }\n\n // Return error if fraction is negative\n if (fraction < 0) {\n return error.num;\n }\n\n // Return error if fraction is greater than or equal to 0 and less than 1\n if (fraction >= 0 && fraction < 1) {\n return error.div0;\n }\n\n // Truncate fraction if it is not an integer\n fraction = parseInt(fraction, 10);\n\n // Compute integer part\n var result = parseInt(dollar, 10);\n\n // Add decimal part\n result += (dollar % 1) * Math.pow(10, -Math.ceil(Math.log(fraction) / Math.LN10)) * fraction;\n\n // Return converted dollar price\n return result;\n};\n\n// TODO\nexports.DURATION = function() {\n throw new Error('DURATION is not implemented');\n};\n\nexports.EFFECT = function(rate, periods) {\n rate = utils.parseNumber(rate);\n periods = utils.parseNumber(periods);\n if (utils.anyIsError(rate, periods)) {\n return error.value;\n }\n\n // Return error if rate <=0 or periods < 1\n if (rate <= 0 || periods < 1) {\n return error.num;\n }\n\n // Truncate periods if it is not an integer\n periods = parseInt(periods, 10);\n\n // Return effective annual interest rate\n return Math.pow(1 + rate / periods, periods) - 1;\n};\n\nexports.FV = function(rate, periods, payment, value, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n\n value = value || 0;\n type = type || 0;\n\n rate = utils.parseNumber(rate);\n periods = utils.parseNumber(periods);\n payment = utils.parseNumber(payment);\n value = utils.parseNumber(value);\n type = utils.parseNumber(type);\n if (utils.anyIsError(rate, periods, payment, value, type)) {\n return error.value;\n }\n\n // Return future value\n var result;\n if (rate === 0) {\n result = value + payment * periods;\n } else {\n var term = Math.pow(1 + rate, periods);\n if (type === 1) {\n result = value * term + payment * (1 + rate) * (term - 1) / rate;\n } else {\n result = value * term + payment * (term - 1) / rate;\n }\n }\n return -result;\n};\n\nexports.FVSCHEDULE = function(principal, schedule) {\n principal = utils.parseNumber(principal);\n schedule = utils.parseNumberArray(utils.flatten(schedule));\n if (utils.anyIsError(principal, schedule)) {\n return error.value;\n }\n\n var n = schedule.length;\n var future = principal;\n\n // Apply all interests in schedule\n for (var i = 0; i < n; i++) {\n // Apply scheduled interest\n future *= 1 + schedule[i];\n }\n\n // Return future value\n return future;\n};\n\n// TODO\nexports.INTRATE = function() {\n throw new Error('INTRATE is not implemented');\n};\n\nexports.IPMT = function(rate, period, periods, present, future, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n\n future = future || 0;\n type = type || 0;\n\n rate = utils.parseNumber(rate);\n period = utils.parseNumber(period);\n periods = utils.parseNumber(periods);\n present = utils.parseNumber(present);\n future = utils.parseNumber(future);\n type = utils.parseNumber(type);\n if (utils.anyIsError(rate, period, periods, present, future, type)) {\n return error.value;\n }\n\n // Compute payment\n var payment = exports.PMT(rate, periods, present, future, type);\n\n // Compute interest\n var interest;\n if (period === 1) {\n if (type === 1) {\n interest = 0;\n } else {\n interest = -present;\n }\n } else {\n if (type === 1) {\n interest = exports.FV(rate, period - 2, payment, present, 1) - payment;\n } else {\n interest = exports.FV(rate, period - 1, payment, present, 0);\n }\n }\n\n // Return interest\n return interest * rate;\n};\n\nexports.IRR = function(values, guess) {\n // Credits: algorithm inspired by Apache OpenOffice\n\n guess = guess || 0;\n\n values = utils.parseNumberArray(utils.flatten(values));\n guess = utils.parseNumber(guess);\n if (utils.anyIsError(values, guess)) {\n return error.value;\n }\n\n // Calculates the resulting amount\n var irrResult = function(values, dates, rate) {\n var r = rate + 1;\n var result = values[0];\n for (var i = 1; i < values.length; i++) {\n result += values[i] / Math.pow(r, (dates[i] - dates[0]) / 365);\n }\n return result;\n };\n\n // Calculates the first derivation\n var irrResultDeriv = function(values, dates, rate) {\n var r = rate + 1;\n var result = 0;\n for (var i = 1; i < values.length; i++) {\n var frac = (dates[i] - dates[0]) / 365;\n result -= frac * values[i] / Math.pow(r, frac + 1);\n }\n return result;\n };\n\n // Initialize dates and check that values contains at least one positive value and one negative value\n var dates = [];\n var positive = false;\n var negative = false;\n for (var i = 0; i < values.length; i++) {\n dates[i] = (i === 0) ? 0 : dates[i - 1] + 365;\n if (values[i] > 0) {\n positive = true;\n }\n if (values[i] < 0) {\n negative = true;\n }\n }\n\n // Return error if values does not contain at least one positive value and one negative value\n if (!positive || !negative) {\n return error.num;\n }\n\n // Initialize guess and resultRate\n guess = (guess === undefined) ? 0.1 : guess;\n var resultRate = guess;\n\n // Set maximum epsilon for end of iteration\n var epsMax = 1e-10;\n\n // Implement Newton's method\n var newRate, epsRate, resultValue;\n var contLoop = true;\n do {\n resultValue = irrResult(values, dates, resultRate);\n newRate = resultRate - resultValue / irrResultDeriv(values, dates, resultRate);\n epsRate = Math.abs(newRate - resultRate);\n resultRate = newRate;\n contLoop = (epsRate > epsMax) && (Math.abs(resultValue) > epsMax);\n } while (contLoop);\n\n // Return internal rate of return\n return resultRate;\n};\n\nexports.ISPMT = function(rate, period, periods, value) {\n rate = utils.parseNumber(rate);\n period = utils.parseNumber(period);\n periods = utils.parseNumber(periods);\n value = utils.parseNumber(value);\n if (utils.anyIsError(rate, period, periods, value)) {\n return error.value;\n }\n\n // Return interest\n return value * rate * (period / periods - 1);\n};\n\n// TODO\nexports.MDURATION = function() {\n throw new Error('MDURATION is not implemented');\n};\n\nexports.MIRR = function(values, finance_rate, reinvest_rate) {\n values = utils.parseNumberArray(utils.flatten(values));\n finance_rate = utils.parseNumber(finance_rate);\n reinvest_rate = utils.parseNumber(reinvest_rate);\n if (utils.anyIsError(values, finance_rate, reinvest_rate)) {\n return error.value;\n }\n\n // Initialize number of values\n var n = values.length;\n\n // Lookup payments (negative values) and incomes (positive values)\n var payments = [];\n var incomes = [];\n for (var i = 0; i < n; i++) {\n if (values[i] < 0) {\n payments.push(values[i]);\n } else {\n incomes.push(values[i]);\n }\n }\n\n // Return modified internal rate of return\n var num = -exports.NPV(reinvest_rate, incomes) * Math.pow(1 + reinvest_rate, n - 1);\n var den = exports.NPV(finance_rate, payments) * (1 + finance_rate);\n return Math.pow(num / den, 1 / (n - 1)) - 1;\n};\n\nexports.NOMINAL = function(rate, periods) {\n rate = utils.parseNumber(rate);\n periods = utils.parseNumber(periods);\n if (utils.anyIsError(rate, periods)) {\n return error.value;\n }\n\n // Return error if rate <=0 or periods < 1\n if (rate <= 0 || periods < 1) {\n return error.num;\n }\n\n // Truncate periods if it is not an integer\n periods = parseInt(periods, 10);\n\n // Return nominal annual interest rate\n return (Math.pow(rate + 1, 1 / periods) - 1) * periods;\n};\n\nexports.NPER = function(rate, payment, present, future, type) {\n type = (type === undefined) ? 0 : type;\n future = (future === undefined) ? 0 : future;\n\n rate = utils.parseNumber(rate);\n payment = utils.parseNumber(payment);\n present = utils.parseNumber(present);\n future = utils.parseNumber(future);\n type = utils.parseNumber(type);\n if (utils.anyIsError(rate, payment, present, future, type)) {\n return error.value;\n }\n\n // Return number of periods\n var num = payment * (1 + rate * type) - future * rate;\n var den = (present * rate + payment * (1 + rate * type));\n return Math.log(num / den) / Math.log(1 + rate);\n};\n\nexports.NPV = function() {\n var args = utils.parseNumberArray(utils.flatten(arguments));\n if (args instanceof Error) {\n return args;\n }\n\n // Lookup rate\n var rate = args[0];\n\n // Initialize net present value\n var value = 0;\n\n // Loop on all values\n for (var j = 1; j < args.length; j++) {\n value += args[j] / Math.pow(1 + rate, j);\n }\n\n // Return net present value\n return value;\n};\n\n// TODO\nexports.ODDFPRICE = function() {\n throw new Error('ODDFPRICE is not implemented');\n};\n\n// TODO\nexports.ODDFYIELD = function() {\n throw new Error('ODDFYIELD is not implemented');\n};\n\n// TODO\nexports.ODDLPRICE = function() {\n throw new Error('ODDLPRICE is not implemented');\n};\n\n// TODO\nexports.ODDLYIELD = function() {\n throw new Error('ODDLYIELD is not implemented');\n};\n\nexports.PDURATION = function(rate, present, future) {\n rate = utils.parseNumber(rate);\n present = utils.parseNumber(present);\n future = utils.parseNumber(future);\n if (utils.anyIsError(rate, present, future)) {\n return error.value;\n }\n\n // Return error if rate <=0\n if (rate <= 0) {\n return error.num;\n }\n\n // Return number of periods\n return (Math.log(future) - Math.log(present)) / Math.log(1 + rate);\n};\n\nexports.PMT = function(rate, periods, present, future, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n\n future = future || 0;\n type = type || 0;\n\n rate = utils.parseNumber(rate);\n periods = utils.parseNumber(periods);\n present = utils.parseNumber(present);\n future = utils.parseNumber(future);\n type = utils.parseNumber(type);\n if (utils.anyIsError(rate, periods, present, future, type)) {\n return error.value;\n }\n\n // Return payment\n var result;\n if (rate === 0) {\n result = (present + future) / periods;\n } else {\n var term = Math.pow(1 + rate, periods);\n if (type === 1) {\n result = (future * rate / (term - 1) + present * rate / (1 - 1 / term)) / (1 + rate);\n } else {\n result = future * rate / (term - 1) + present * rate / (1 - 1 / term);\n }\n }\n return -result;\n};\n\nexports.PPMT = function(rate, period, periods, present, future, type) {\n future = future || 0;\n type = type || 0;\n\n rate = utils.parseNumber(rate);\n periods = utils.parseNumber(periods);\n present = utils.parseNumber(present);\n future = utils.parseNumber(future);\n type = utils.parseNumber(type);\n if (utils.anyIsError(rate, periods, present, future, type)) {\n return error.value;\n }\n\n return exports.PMT(rate, periods, present, future, type) - exports.IPMT(rate, period, periods, present, future, type);\n};\n\n// TODO\nexports.PRICE = function() {\n throw new Error('PRICE is not implemented');\n};\n\n// TODO\nexports.PRICEDISC = function() {\n throw new Error('PRICEDISC is not implemented');\n};\n\n// TODO\nexports.PRICEMAT = function() {\n throw new Error('PRICEMAT is not implemented');\n};\n\nexports.PV = function(rate, periods, payment, future, type) {\n future = future || 0;\n type = type || 0;\n\n rate = utils.parseNumber(rate);\n periods = utils.parseNumber(periods);\n payment = utils.parseNumber(payment);\n future = utils.parseNumber(future);\n type = utils.parseNumber(type);\n if (utils.anyIsError(rate, periods, payment, future, type)) {\n return error.value;\n }\n\n // Return present value\n if (rate === 0) {\n return -payment * periods - future;\n } else {\n return (((1 - Math.pow(1 + rate, periods)) / rate) * payment * (1 + rate * type) - future) / Math.pow(1 + rate, periods);\n }\n};\n\nexports.RATE = function(periods, payment, present, future, type, guess) {\n // Credits: rabugento\n\n guess = (guess === undefined) ? 0.01 : guess;\n future = (future === undefined) ? 0 : future;\n type = (type === undefined) ? 0 : type;\n\n periods = utils.parseNumber(periods);\n payment = utils.parseNumber(payment);\n present = utils.parseNumber(present);\n future = utils.parseNumber(future);\n type = utils.parseNumber(type);\n guess = utils.parseNumber(guess);\n if (utils.anyIsError(periods, payment, present, future, type, guess)) {\n return error.value;\n }\n\n // Set maximum epsilon for end of iteration\n var epsMax = 1e-10;\n\n // Set maximum number of iterations\n var iterMax = 50;\n\n // Implement Newton's method\n var y, y0, y1, x0, x1 = 0,\n f = 0,\n i = 0;\n var rate = guess;\n if (Math.abs(rate) < epsMax) {\n y = present * (1 + periods * rate) + payment * (1 + rate * type) * periods + future;\n } else {\n f = Math.exp(periods * Math.log(1 + rate));\n y = present * f + payment * (1 / rate + type) * (f - 1) + future;\n }\n y0 = present + payment * periods + future;\n y1 = present * f + payment * (1 / rate + type) * (f - 1) + future;\n i = x0 = 0;\n x1 = rate;\n while ((Math.abs(y0 - y1) > epsMax) && (i < iterMax)) {\n rate = (y1 * x0 - y0 * x1) / (y1 - y0);\n x0 = x1;\n x1 = rate;\n if (Math.abs(rate) < epsMax) {\n y = present * (1 + periods * rate) + payment * (1 + rate * type) * periods + future;\n } else {\n f = Math.exp(periods * Math.log(1 + rate));\n y = present * f + payment * (1 / rate + type) * (f - 1) + future;\n }\n y0 = y1;\n y1 = y;\n ++i;\n }\n return rate;\n};\n\n// TODO\nexports.RECEIVED = function() {\n throw new Error('RECEIVED is not implemented');\n};\n\nexports.RRI = function(periods, present, future) {\n periods = utils.parseNumber(periods);\n present = utils.parseNumber(present);\n future = utils.parseNumber(future);\n if (utils.anyIsError(periods, present, future)) {\n return error.value;\n }\n\n // Return error if periods or present is equal to 0 (zero)\n if (periods === 0 || present === 0) {\n return error.num;\n }\n\n // Return equivalent interest rate\n return Math.pow(future / present, 1 / periods) - 1;\n};\n\nexports.SLN = function(cost, salvage, life) {\n cost = utils.parseNumber(cost);\n salvage = utils.parseNumber(salvage);\n life = utils.parseNumber(life);\n if (utils.anyIsError(cost, salvage, life)) {\n return error.value;\n }\n\n // Return error if life equal to 0 (zero)\n if (life === 0) {\n return error.num;\n }\n\n // Return straight-line depreciation\n return (cost - salvage) / life;\n};\n\nexports.SYD = function(cost, salvage, life, period) {\n // Return error if any of the parameters is not a number\n cost = utils.parseNumber(cost);\n salvage = utils.parseNumber(salvage);\n life = utils.parseNumber(life);\n period = utils.parseNumber(period);\n if (utils.anyIsError(cost, salvage, life, period)) {\n return error.value;\n }\n\n // Return error if life equal to 0 (zero)\n if (life === 0) {\n return error.num;\n }\n\n // Return error if period is lower than 1 or greater than life\n if (period < 1 || period > life) {\n return error.num;\n }\n\n // Truncate period if it is not an integer\n period = parseInt(period, 10);\n\n // Return straight-line depreciation\n return ((cost - salvage) * (life - period + 1) * 2) / (life * (life + 1));\n};\n\nexports.TBILLEQ = function(settlement, maturity, discount) {\n settlement = utils.parseDate(settlement);\n maturity = utils.parseDate(maturity);\n discount = utils.parseNumber(discount);\n if (utils.anyIsError(settlement, maturity, discount)) {\n return error.value;\n }\n\n // Return error if discount is lower than or equal to zero\n if (discount <= 0) {\n return error.num;\n }\n\n // Return error if settlement is greater than maturity\n if (settlement > maturity) {\n return error.num;\n }\n\n // Return error if maturity is more than one year after settlement\n if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n return error.num;\n }\n\n // Return bond-equivalent yield\n return (365 * discount) / (360 - discount * dateTime.DAYS360(settlement, maturity, false));\n};\n\nexports.TBILLPRICE = function(settlement, maturity, discount) {\n settlement = utils.parseDate(settlement);\n maturity = utils.parseDate(maturity);\n discount = utils.parseNumber(discount);\n if (utils.anyIsError(settlement, maturity, discount)) {\n return error.value;\n }\n\n // Return error if discount is lower than or equal to zero\n if (discount <= 0) {\n return error.num;\n }\n\n // Return error if settlement is greater than maturity\n if (settlement > maturity) {\n return error.num;\n }\n\n // Return error if maturity is more than one year after settlement\n if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n return error.num;\n }\n\n // Return bond-equivalent yield\n return 100 * (1 - discount * dateTime.DAYS360(settlement, maturity, false) / 360);\n};\n\nexports.TBILLYIELD = function(settlement, maturity, price) {\n settlement = utils.parseDate(settlement);\n maturity = utils.parseDate(maturity);\n price = utils.parseNumber(price);\n if (utils.anyIsError(settlement, maturity, price)) {\n return error.value;\n }\n\n // Return error if price is lower than or equal to zero\n if (price <= 0) {\n return error.num;\n }\n\n // Return error if settlement is greater than maturity\n if (settlement > maturity) {\n return error.num;\n }\n\n // Return error if maturity is more than one year after settlement\n if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n return error.num;\n }\n\n // Return bond-equivalent yield\n return (100 - price) * 360 / (price * dateTime.DAYS360(settlement, maturity, false));\n};\n\n// TODO\nexports.VDB = function() {\n throw new Error('VDB is not implemented');\n};\n\n// TODO needs better support for date\n// exports.XIRR = function(values, dates, guess) {\n// // Credits: algorithm inspired by Apache OpenOffice\n//\n// values = utils.parseNumberArray(utils.flatten(values));\n// dates = utils.parseDateArray(utils.flatten(dates));\n// guess = utils.parseNumber(guess);\n//\n// if (utils.anyIsError(values, dates, guess)) {\n// return error.value;\n// }\n//\n// // Calculates the resulting amount\n// var irrResult = function(values, dates, rate) {\n// var r = rate + 1;\n// var result = values[0];\n// for (var i = 1; i < values.length; i++) {\n// result += values[i] / Math.pow(r, dateTime.DAYS(dates[i], dates[0]) / 365);\n// }\n// return result;\n// };\n//\n// // Calculates the first derivation\n// var irrResultDeriv = function(values, dates, rate) {\n// var r = rate + 1;\n// var result = 0;\n// for (var i = 1; i < values.length; i++) {\n// var frac = dateTime.DAYS(dates[i], dates[0]) / 365;\n// result -= frac * values[i] / Math.pow(r, frac + 1);\n// }\n// return result;\n// };\n//\n// // Check that values contains at least one positive value and one negative value\n// var positive = false;\n// var negative = false;\n// for (var i = 0; i < values.length; i++) {\n// if (values[i] > 0) {\n// positive = true;\n// }\n// if (values[i] < 0) {\n// negative = true;\n// }\n// }\n//\n// // Return error if values does not contain at least one positive value and one negative value\n// if (!positive || !negative) {\n// return error.num;\n// }\n//\n// // Initialize guess and resultRate\n// guess = guess || 0.1;\n// var resultRate = guess;\n//\n// // Set maximum epsilon for end of iteration\n// var epsMax = 1e-10;\n//\n// // Implement Newton's method\n// var newRate, epsRate, resultValue;\n// var contLoop = true;\n// do {\n// resultValue = irrResult(values, dates, resultRate);\n// newRate = resultRate - resultValue / irrResultDeriv(values, dates, resultRate);\n// epsRate = Math.abs(newRate - resultRate);\n// resultRate = newRate;\n// contLoop = (epsRate > epsMax) && (Math.abs(resultValue) > epsMax);\n// } while (contLoop);\n//\n// // Return internal rate of return\n// return resultRate;\n// };\n\nexports.XNPV = function(rate, values, dates) {\n rate = utils.parseNumber(rate);\n values = utils.parseNumberArray(utils.flatten(values));\n dates = utils.parseDateArray(utils.flatten(dates));\n if (utils.anyIsError(rate, values, dates)) {\n return error.value;\n }\n\n var result = 0;\n for (var i = 0; i < values.length; i++) {\n result += values[i] / Math.pow(1 + rate, dateTime.DAYS(dates[i], dates[0]) / 365);\n }\n return result;\n};\n\n// TODO\nexports.YIELD = function() {\n throw new Error('YIELD is not implemented');\n};\n\n// TODO\nexports.YIELDDISC = function() {\n throw new Error('YIELDDISC is not implemented');\n};\n\n// TODO\nexports.YIELDMAT = function() {\n throw new Error('YIELDMAT is not implemented');\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/financial.js\n ** module id = 30\n ** module chunks = 0\n **/","var error = require('./error');\n\nexports.MATCH = function(lookupValue, lookupArray, matchType) {\n if (!lookupValue && !lookupArray) {\n return error.na;\n }\n\n if (arguments.length === 2) {\n matchType = 1;\n }\n if (!(lookupArray instanceof Array)) {\n return error.na;\n }\n\n if (matchType !== -1 && matchType !== 0 && matchType !== 1) {\n return error.na;\n }\n var index;\n var indexValue;\n for (var idx = 0; idx < lookupArray.length; idx++) {\n if (matchType === 1) {\n if (lookupArray[idx] === lookupValue) {\n return idx + 1;\n } else if (lookupArray[idx] < lookupValue) {\n if (!indexValue) {\n index = idx + 1;\n indexValue = lookupArray[idx];\n } else if (lookupArray[idx] > indexValue) {\n index = idx + 1;\n indexValue = lookupArray[idx];\n }\n }\n } else if (matchType === 0) {\n if (typeof lookupValue === 'string') {\n lookupValue = lookupValue.replace(/\\?/g, '.');\n if (lookupArray[idx].toLowerCase().match(lookupValue.toLowerCase())) {\n return idx + 1;\n }\n } else {\n if (lookupArray[idx] === lookupValue) {\n return idx + 1;\n }\n }\n } else if (matchType === -1) {\n if (lookupArray[idx] === lookupValue) {\n return idx + 1;\n } else if (lookupArray[idx] > lookupValue) {\n if (!indexValue) {\n index = idx + 1;\n indexValue = lookupArray[idx];\n } else if (lookupArray[idx] < indexValue) {\n index = idx + 1;\n indexValue = lookupArray[idx];\n }\n }\n }\n }\n\n return index ? index : error.na;\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/formulajs/lib/lookup-reference.js\n ** module id = 31\n ** module chunks = 0\n **/","export const SYMBOL = '>';\n\nexport default function func(exp1, exp2) {\n return exp1 > exp2;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/greater-than.js\n **/","export const SYMBOL = '>=';\n\nexport default function func(exp1, exp2) {\n return exp1 >= exp2;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/greater-than-or-equal.js\n **/","export const SYMBOL = '<';\n\nexport default function func(exp1, exp2) {\n return exp1 < exp2;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/less-than.js\n **/","export const SYMBOL = '<=';\n\nexport default function func(exp1, exp2) {\n return exp1 <= exp2;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/less-than-or-equal.js\n **/","import {toNumber} from './../../helper/number';\nimport {ERROR_VALUE} from './../../error';\n\nexport const SYMBOL = '-';\n\nexport default function func(first, ...rest) {\n const result = rest.reduce((acc, value) => acc - toNumber(value), toNumber(first));\n\n if (isNaN(result)) {\n throw Error(ERROR_VALUE);\n }\n\n return result;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/minus.js\n **/","import {toNumber} from './../../helper/number';\nimport {ERROR_VALUE} from './../../error';\n\nexport const SYMBOL = '*';\n\nexport default function func(first, ...rest) {\n const result = rest.reduce((acc, value) => acc * toNumber(value), toNumber(first));\n\n if (isNaN(result)) {\n throw Error(ERROR_VALUE);\n }\n\n return result;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/multiply.js\n **/","export const SYMBOL = '<>';\n\nexport default function func(exp1, exp2) {\n return exp1 !== exp2;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/not-equal.js\n **/","import {toNumber} from './../../helper/number';\nimport {ERROR_VALUE} from './../../error';\n\nexport const SYMBOL = '^';\n\nexport default function func(exp1, exp2) {\n const result = Math.pow(toNumber(exp1), toNumber(exp2));\n\n if (isNaN(result)) {\n throw Error(ERROR_VALUE);\n }\n\n return result;\n};\n\nfunc.SYMBOL = SYMBOL;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/evaluate-by-operator/operator/power.js\n **/","/* parser generated by jison 0.4.17 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,5],$V1=[1,8],$V2=[1,6],$V3=[1,7],$V4=[1,9],$V5=[1,14],$V6=[1,15],$V7=[1,16],$V8=[1,12],$V9=[1,13],$Va=[1,17],$Vb=[1,19],$Vc=[1,20],$Vd=[1,21],$Ve=[1,22],$Vf=[1,23],$Vg=[1,24],$Vh=[1,25],$Vi=[1,26],$Vj=[1,27],$Vk=[1,28],$Vl=[5,9,10,11,13,14,15,16,17,18,19,20,29,30],$Vm=[5,9,10,11,13,14,15,16,17,18,19,20,29,30,32],$Vn=[1,37],$Vo=[5,9,10,11,13,14,15,16,17,18,19,20,29,30,34],$Vp=[5,10,11,13,14,15,16,17,29,30],$Vq=[5,10,13,14,15,16,29,30],$Vr=[5,10,11,13,14,15,16,17,18,19,29,30],$Vs=[13,29,30],$Vt=[5,9,10,11,13,14,15,16,17,18,19,20,29,30,31,35];\nvar parser = {trace: function trace() { },\nyy: {},\nsymbols_: {\"error\":2,\"expressions\":3,\"expression\":4,\"EOF\":5,\"variableSequence\":6,\"number\":7,\"STRING\":8,\"&\":9,\"=\":10,\"+\":11,\"(\":12,\")\":13,\"<\":14,\">\":15,\"NOT\":16,\"-\":17,\"*\":18,\"/\":19,\"^\":20,\"FUNCTION\":21,\"expseq\":22,\"cell\":23,\"ABSOLUTE_CELL\":24,\"RELATIVE_CELL\":25,\"MIXED_CELL\":26,\":\":27,\"ARRAY\":28,\";\":29,\",\":30,\"VARIABLE\":31,\"DECIMAL\":32,\"NUMBER\":33,\"%\":34,\"#\":35,\"!\":36,\"$accept\":0,\"$end\":1},\nterminals_: {5:\"EOF\",8:\"STRING\",9:\"&\",10:\"=\",11:\"+\",12:\"(\",13:\")\",14:\"<\",15:\">\",16:\"NOT\",17:\"-\",18:\"*\",19:\"/\",20:\"^\",21:\"FUNCTION\",24:\"ABSOLUTE_CELL\",25:\"RELATIVE_CELL\",26:\"MIXED_CELL\",27:\":\",28:\"ARRAY\",29:\";\",30:\",\",31:\"VARIABLE\",32:\"DECIMAL\",33:\"NUMBER\",34:\"%\",35:\"#\",36:\"!\"},\nproductions_: [0,[3,2],[4,1],[4,1],[4,1],[4,3],[4,3],[4,3],[4,3],[4,4],[4,4],[4,4],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,2],[4,2],[4,3],[4,4],[4,1],[4,1],[4,2],[23,1],[23,1],[23,1],[23,3],[23,3],[23,3],[23,3],[23,3],[23,3],[23,3],[23,3],[23,3],[22,1],[22,1],[22,3],[22,3],[6,1],[6,3],[7,1],[7,3],[7,2],[2,3],[2,4]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 1:\n\n return $$[$0-1];\n\nbreak;\ncase 2:\n\n this.$ = yy.callVariable($$[$0][0]);\n\nbreak;\ncase 3:\n\n this.$ = yy.toNumber($$[$0]);\n\nbreak;\ncase 4:\n\n this.$ = yy.trimEdges($$[$0]);\n\nbreak;\ncase 5:\n\n this.$ = yy.evaluateByOperator('&', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 6:\n\n this.$ = yy.evaluateByOperator('=', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 7:\n\n this.$ = yy.evaluateByOperator('+', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 8:\n\n this.$ = yy.toNumber($$[$0-1]);\n\nbreak;\ncase 9:\n\n this.$ = yy.evaluateByOperator('<=', [$$[$0-3], $$[$0]]);\n\nbreak;\ncase 10:\n\n this.$ = yy.evaluateByOperator('>=', [$$[$0-3], $$[$0]]);\n\nbreak;\ncase 11:\n\n this.$ = yy.evaluateByOperator('<>', [$$[$0-3], $$[$0]]);\n\nbreak;\ncase 12:\n\n this.$ = yy.evaluateByOperator('NOT', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 13:\n\n this.$ = yy.evaluateByOperator('>', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 14:\n\n this.$ = yy.evaluateByOperator('<', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 15:\n\n this.$ = yy.evaluateByOperator('-', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 16:\n\n this.$ = yy.evaluateByOperator('*', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 17:\n\n this.$ = yy.evaluateByOperator('/', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 18:\n\n this.$ = yy.evaluateByOperator('^', [$$[$0-2], $$[$0]]);\n\nbreak;\ncase 19:\n\n var n1 = yy.invertNumber($$[$0]);\n\n this.$ = n1;\n\n if (isNaN(this.$)) {\n this.$ = 0;\n }\n\nbreak;\ncase 20:\n\n var n1 = yy.toNumber($$[$0]);\n\n this.$ = n1;\n\n if (isNaN(this.$)) {\n this.$ = 0;\n }\n\nbreak;\ncase 21:\n\n this.$ = yy.callFunction($$[$0-2]);\n\nbreak;\ncase 22:\n\n this.$ = yy.callFunction($$[$0-3], $$[$0-1]);\n\nbreak;\ncase 26: case 27: case 28:\n\n this.$ = yy.cellValue($$[$0]);\n\nbreak;\ncase 29: case 30: case 31: case 32: case 33: case 34: case 35: case 36: case 37:\n\n this.$ = yy.rangeValue($$[$0-2], $$[$0]);\n\nbreak;\ncase 38: case 42:\n\n this.$ = [$$[$0]];\n\nbreak;\ncase 39:\n\n var result = [];\n var arr = eval(\"[\" + yytext + \"]\");\n\n arr.forEach(function(item) {\n result.push(item);\n });\n\n this.$ = result;\n\nbreak;\ncase 40: case 41:\n\n $$[$0-2].push($$[$0]);\n this.$ = $$[$0-2];\n\nbreak;\ncase 43:\n\n this.$ = (Array.isArray($$[$0-2]) ? $$[$0-2] : [$$[$0-2]]);\n this.$.push($$[$0]);\n\nbreak;\ncase 44:\n\n this.$ = $$[$0];\n\nbreak;\ncase 45:\n\n this.$ = ($$[$0-2] + '.' + $$[$0]) * 1;\n\nbreak;\ncase 46:\n\n this.$ = $$[$0-1] * 0.01;\n\nbreak;\ncase 47: case 48:\n\n this.$ = yy.throwError($$[$0-2] + $$[$0-1] + $$[$0]);\n\nbreak;\n}\n},\ntable: [{2:11,3:1,4:2,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{1:[3]},{5:[1,18],9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk},o($Vl,[2,2],{32:[1,29]}),o($Vl,[2,3],{34:[1,30]}),o($Vl,[2,4]),{2:11,4:31,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:32,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:33,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{12:[1,34]},o($Vl,[2,23]),o($Vl,[2,24],{2:35,31:[1,36],35:$Va}),o($Vm,[2,42],{35:$Vn}),o($Vo,[2,44],{32:[1,38]}),o($Vl,[2,26],{27:[1,39]}),o($Vl,[2,27],{27:[1,40]}),o($Vl,[2,28],{27:[1,41]}),{31:[1,42]},{1:[2,1]},{2:11,4:43,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:44,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:45,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:48,6:3,7:4,8:$V0,10:[1,46],11:$V1,12:$V2,15:[1,47],17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:50,6:3,7:4,8:$V0,10:[1,49],11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:51,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:52,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:53,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:54,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:55,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{31:[1,56]},o($Vo,[2,46]),{9:$Vb,10:$Vc,11:$Vd,13:[1,57],14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk},o($Vp,[2,19],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),o($Vp,[2,20],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),{2:11,4:60,6:3,7:4,8:$V0,11:$V1,12:$V2,13:[1,58],17:$V3,21:$V4,22:59,23:10,24:$V5,25:$V6,26:$V7,28:[1,61],31:$V8,33:$V9,35:$Va},o($Vl,[2,25]),{35:$Vn},{31:[1,62]},{33:[1,63]},{24:[1,64],25:[1,65],26:[1,66]},{24:[1,67],25:[1,68],26:[1,69]},{24:[1,70],25:[1,71],26:[1,72]},{36:[1,73]},o($Vl,[2,5]),o([5,10,13,29,30],[2,6],{9:$Vb,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vp,[2,7],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),{2:11,4:74,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:75,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},o($Vq,[2,14],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),{2:11,4:76,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},o($Vq,[2,13],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o([5,10,13,16,29,30],[2,12],{9:$Vb,11:$Vd,14:$Ve,15:$Vf,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vp,[2,15],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),o($Vr,[2,16],{9:$Vb,20:$Vk}),o($Vr,[2,17],{9:$Vb,20:$Vk}),o([5,10,11,13,14,15,16,17,18,19,20,29,30],[2,18],{9:$Vb}),o($Vm,[2,43]),o($Vl,[2,8]),o($Vl,[2,21]),{13:[1,77],29:[1,78],30:[1,79]},o($Vs,[2,38],{9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vs,[2,39]),{36:[1,80]},o($Vo,[2,45]),o($Vl,[2,29]),o($Vl,[2,30]),o($Vl,[2,31]),o($Vl,[2,32]),o($Vl,[2,33]),o($Vl,[2,34]),o($Vl,[2,35]),o($Vl,[2,36]),o($Vl,[2,37]),o($Vt,[2,47]),o($Vq,[2,9],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vq,[2,11],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vq,[2,10],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vl,[2,22]),{2:11,4:81,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:82,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},o($Vt,[2,48]),o($Vs,[2,40],{9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vs,[2,41],{9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk})],\ndefaultActions: {18:[2,1]},\nparseError: function parseError(str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n function _parseError (msg, hash) {\n this.message = msg;\n this.hash = hash;\n }\n _parseError.prototype = Error;\n\n throw new _parseError(str, hash);\n }\n},\nparse: function parse(input) {\n var self = this,\n stack = [0],\n tstack = [], // token stack\n vstack = [null], // semantic value stack\n lstack = [], // location stack\n table = this.table,\n yytext = '',\n yylineno = 0,\n yyleng = 0,\n recovering = 0,\n TERROR = 2,\n EOF = 1;\n\n var args = lstack.slice.call(arguments, 1);\n\n //this.reductionCount = this.shiftCount = 0;\n\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n // copy state\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n\n var ranges = lexer.options && lexer.options.ranges;\n\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n\n function popStack (n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n\n_token_stack:\n var lex = function () {\n var token;\n token = lexer.lex() || EOF;\n // if token isn't its numeric value, convert\n if (typeof token !== 'number') {\n token = self.symbols_[token] || token;\n }\n return token;\n }\n\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n // retreive state number from top of stack\n state = stack[stack.length - 1];\n\n // use default actions if available\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n // read action for current state and first input\n action = table[state] && table[state][symbol];\n }\n\n_handle_error:\n // handle parse error\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var error_rule_depth;\n var errStr = '';\n\n // Return the rule stack depth where the nearest error rule can be found.\n // Return FALSE when no error recovery rule was found.\n function locateNearestErrorRecoveryRule(state) {\n var stack_probe = stack.length - 1;\n var depth = 0;\n\n // try to recover from error\n for(;;) {\n // check for error recovery rule in this state\n if ((TERROR.toString()) in table[state]) {\n return depth;\n }\n if (state === 0 || stack_probe < 2) {\n return false; // No suitable error recovery rule available.\n }\n stack_probe -= 2; // popStack(1): [symbol, action]\n state = stack[stack_probe];\n ++depth;\n }\n }\n\n if (!recovering) {\n // first see if there's any chance at hitting an error recovery rule:\n error_rule_depth = locateNearestErrorRecoveryRule(state);\n\n // Report error\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push(\"'\"+this.terminals_[p]+\"'\");\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line '+(yylineno+1)+\":\\n\"+lexer.showPosition()+\"\\nExpecting \"+expected.join(', ') + \", got '\" + (this.terminals_[symbol] || symbol)+ \"'\";\n } else {\n errStr = 'Parse error on line '+(yylineno+1)+\": Unexpected \" +\n (symbol == EOF ? \"end of input\" :\n (\"'\"+(this.terminals_[symbol] || symbol)+\"'\"));\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected,\n recoverable: (error_rule_depth !== false)\n });\n } else if (preErrorSymbol !== EOF) {\n error_rule_depth = locateNearestErrorRecoveryRule(state);\n }\n\n // just recovered from another error\n if (recovering == 3) {\n if (symbol === EOF || preErrorSymbol === EOF) {\n throw new Error(errStr || 'Parsing halted while starting to recover from another error.');\n }\n\n // discard current lookahead and grab another\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n symbol = lex();\n }\n\n // try to recover from error\n if (error_rule_depth === false) {\n throw new Error(errStr || 'Parsing halted. No suitable error recovery rule available.');\n }\n popStack(error_rule_depth);\n\n preErrorSymbol = (symbol == TERROR ? null : symbol); // save the lookahead token\n symbol = TERROR; // insert generic error symbol as new lookahead\n state = stack[stack.length-1];\n action = table[state] && table[state][TERROR];\n recovering = 3; // allow 3 real symbols to be shifted before reporting a new error\n }\n\n // this shouldn't happen, unless resolve defaults are off\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: '+state+', token: '+symbol);\n }\n\n switch (action[0]) {\n case 1: // shift\n //this.shiftCount++;\n\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]); // push state\n symbol = null;\n if (!preErrorSymbol) { // normal execution/no error\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n // error just occurred, resume old lookahead f/ before error\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n\n case 2:\n // reduce\n //this.reductionCount++;\n\n len = this.productions_[action[1]][1];\n\n // perform semantic action\n yyval.$ = vstack[vstack.length-len]; // default to $$ = $1\n // default location, uses first token for firsts, last for lasts\n yyval._$ = {\n first_line: lstack[lstack.length-(len||1)].first_line,\n last_line: lstack[lstack.length-1].last_line,\n first_column: lstack[lstack.length-(len||1)].first_column,\n last_column: lstack[lstack.length-1].last_column\n };\n if (ranges) {\n yyval._$.range = [lstack[lstack.length-(len||1)].range[0], lstack[lstack.length-1].range[1]];\n }\n r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));\n\n if (typeof r !== 'undefined') {\n return r;\n }\n\n // pop off stack\n if (len) {\n stack = stack.slice(0,-1*len*2);\n vstack = vstack.slice(0, -1*len);\n lstack = lstack.slice(0, -1*len);\n }\n\n stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n // goto new state = table[STATE][NONTERMINAL]\n newState = table[stack[stack.length-2]][stack[stack.length-1]];\n stack.push(newState);\n break;\n\n case 3:\n // accept\n return true;\n }\n\n }\n\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function (match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex() {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin(condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState() {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules() {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState(n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState(condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0:/* skip whitespace */\nbreak;\ncase 1:return 8;\nbreak;\ncase 2:return 8;\nbreak;\ncase 3:return 21;\nbreak;\ncase 4:return 24;\nbreak;\ncase 5:return 26;\nbreak;\ncase 6:return 26;\nbreak;\ncase 7:return 25;\nbreak;\ncase 8:return 21;\nbreak;\ncase 9:return 31;\nbreak;\ncase 10:return 31;\nbreak;\ncase 11:return 33;\nbreak;\ncase 12:return 28;\nbreak;\ncase 13:/* skip whitespace */\nbreak;\ncase 14:return 9;\nbreak;\ncase 15:return ' ';\nbreak;\ncase 16:return 32;\nbreak;\ncase 17:return 27;\nbreak;\ncase 18:return 29;\nbreak;\ncase 19:return 30;\nbreak;\ncase 20:return 18;\nbreak;\ncase 21:return 19;\nbreak;\ncase 22:return 17;\nbreak;\ncase 23:return 11;\nbreak;\ncase 24:return 20;\nbreak;\ncase 25:return 12;\nbreak;\ncase 26:return 13;\nbreak;\ncase 27:return 15;\nbreak;\ncase 28:return 14;\nbreak;\ncase 29:return 16;\nbreak;\ncase 30:return '\"';\nbreak;\ncase 31:return \"'\";\nbreak;\ncase 32:return \"!\";\nbreak;\ncase 33:return 10;\nbreak;\ncase 34:return 34;\nbreak;\ncase 35:return 35;\nbreak;\ncase 36:return 5;\nbreak;\n}\n},\nrules: [/^(?:\\s+)/,/^(?:\"(\\\\[\"]|[^\"])*\")/,/^(?:'(\\\\[']|[^'])*')/,/^(?:[A-Za-z]{1,}[A-Za-z_0-9\\.]+(?=[(]))/,/^(?:\\$[A-Za-z]+\\$[0-9]+)/,/^(?:\\$[A-Za-z]+[0-9]+)/,/^(?:[A-Za-z]+\\$[0-9]+)/,/^(?:[A-Za-z]+[0-9]+)/,/^(?:[A-Za-z\\.]+(?=[(]))/,/^(?:[A-Za-z]{1,}[A-Za-z_0-9]+)/,/^(?:[A-Za-z_]+)/,/^(?:[0-9]+)/,/^(?:\\[(.*)?\\])/,/^(?:\\$)/,/^(?:&)/,/^(?: )/,/^(?:[.])/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:\\*)/,/^(?:\\/)/,/^(?:-)/,/^(?:\\+)/,/^(?:\\^)/,/^(?:\\()/,/^(?:\\))/,/^(?:>)/,/^(?:<)/,/^(?:NOT\\b)/,/^(?:\")/,/^(?:')/,/^(?:!)/,/^(?:=)/,/^(?:%)/,/^(?:[#])/,/^(?:$)/],\nconditions: {\"INITIAL\":{\"rules\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\n\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/grammar-parser/grammar-parser.js\n **/","module.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tmodule.children = [];\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n}\r\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** (webpack)/buildin/module.js\n ** module id = 41\n ** module chunks = 0\n **/","/**\n * Trim value by cutting character starting from the beginning and ending at the same time.\n *\n * @param {String} string String to trimming.\n * @param {Number} [margin=1] Number of character to cut.\n * @returns {String}\n */\nexport function trimEdges(string, margin = 1) {\n string = string.substring(margin, string.length - margin);\n\n return string;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/helper/string.js\n **/","const LABEL_EXTRACT_REGEXP = /^([$])?([A-Za-z]+)([$])?([0-9]+)$/;\n\n/**\n * Extract cell coordinates.\n *\n * @param {String} label Cell coordinates (eq. 'A1', '$B6', '$N$98').\n * @returns {Array} Returns an array of objects.\n */\nexport function extractLabel(label) {\n if (!LABEL_EXTRACT_REGEXP.test(label)) {\n return [];\n }\n const [, columnAbs, column, rowAbs, row] = label.match(LABEL_EXTRACT_REGEXP);\n\n return [\n {\n index: rowLabelToIndex(row),\n label: row,\n isAbsolute: rowAbs === '$',\n },\n {\n index: columnLabelToIndex(column),\n label: column,\n isAbsolute: columnAbs === '$'\n }\n ];\n}\n\n/**\n * Convert row and column indexes into cell label.\n *\n * @param {Object} row Object with `index` and `isAbsolute` properties.\n * @param {Object} column Object with `index` and `isAbsolute` properties.\n * @returns {String} Returns cell label.\n */\nexport function toLabel(row, column) {\n const rowLabel = (row.isAbsolute ? '$' : '') + rowIndexToLabel(row.index);\n const columnLabel = (column.isAbsolute ? '$' : '') + columnIndexToLabel(column.index);\n\n return columnLabel + rowLabel;\n}\n\nconst COLUMN_LABEL_BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nconst COLUMN_LABEL_BASE_LENGTH = COLUMN_LABEL_BASE.length;\n\n/**\n * Convert column label to index.\n *\n * @param {String} label Column label (eq. 'ABB', 'CNQ')\n * @returns {Number} Returns -1 if label is not recognized otherwise proper column index.\n */\nexport function columnLabelToIndex(label) {\n let result = 0;\n\n if (label) {\n for (let i = 0, j = label.length - 1; i < label.length; i += 1, j -= 1) {\n result += Math.pow(COLUMN_LABEL_BASE_LENGTH, j) * (COLUMN_LABEL_BASE.indexOf(label[i]) + 1);\n }\n }\n --result;\n\n return result;\n}\n\n/**\n * Convert column index to label.\n *\n * @param {Number} column Column index.\n * @returns {String} Returns column label (eq. 'ABB', 'CNQ').\n */\nexport function columnIndexToLabel(column) {\n let result = '';\n\n while (column >= 0) {\n result = String.fromCharCode(column % COLUMN_LABEL_BASE_LENGTH + 97) + result;\n column = Math.floor(column / COLUMN_LABEL_BASE_LENGTH) - 1;\n }\n\n return result.toUpperCase();\n}\n\n/**\n * Convert row label to index.\n *\n * @param {String} label Row label (eq. '1', '5')\n * @returns {Number} Returns -1 if label is not recognized otherwise proper row index.\n */\nexport function rowLabelToIndex(label) {\n let result = parseInt(label, 10);\n\n if (isNaN(result)) {\n result = -1;\n } else {\n result = Math.max(result - 1, -1);\n }\n\n return result;\n}\n\n/**\n * Convert row index to label.\n *\n * @param {Number} row Row index.\n * @returns {String} Returns row label (eq. '1', '7').\n */\nexport function rowIndexToLabel(row) {\n let result = '';\n\n if (row >= 0) {\n result = `${row + 1}`;\n }\n\n return result;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/helper/cell.js\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/formula-parser.min.js b/dist/formula-parser.min.js index 5f001711..ae578911 100644 --- a/dist/formula-parser.min.js +++ b/dist/formula-parser.min.js @@ -1,7 +1,7 @@ !function(r,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.formulaParser=t():r.formulaParser=t()}(this,function(){return function(r){function t(n){if(e[n])return e[n].exports;var a=e[n]={exports:{},id:n,loaded:!1};return r[n].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var e={};return t.m=r,t.c=e,t.p="",t(0)}([function(r,t,e){"use strict";function n(r){return r&&r.__esModule?r:{default:r}}Object.defineProperty(t,"__esModule",{value:!0}),t.rowLabelToIndex=t.rowIndexToLabel=t.columnLabelToIndex=t.columnIndexToLabel=t.toLabel=t.extractLabel=t.error=t.Parser=t.ERROR_VALUE=t.ERROR_REF=t.ERROR_NUM=t.ERROR_NULL=t.ERROR_NOT_AVAILABLE=t.ERROR_NEED_UPDATE=t.ERROR_NAME=t.ERROR_DIV_ZERO=t.ERROR=t.SUPPORTED_FORMULAS=void 0;var a=e(1),u=e(7),i=n(u),o=e(43);t.SUPPORTED_FORMULAS=a.SUPPORTED_FORMULAS,t.ERROR=u.ERROR,t.ERROR_DIV_ZERO=u.ERROR_DIV_ZERO,t.ERROR_NAME=u.ERROR_NAME,t.ERROR_NEED_UPDATE=u.ERROR_NEED_UPDATE,t.ERROR_NOT_AVAILABLE=u.ERROR_NOT_AVAILABLE,t.ERROR_NULL=u.ERROR_NULL,t.ERROR_NUM=u.ERROR_NUM,t.ERROR_REF=u.ERROR_REF,t.ERROR_VALUE=u.ERROR_VALUE,t.Parser=a.Parser,t.error=i.default,t.extractLabel=o.extractLabel,t.toLabel=o.toLabel,t.columnIndexToLabel=o.columnIndexToLabel,t.columnLabelToIndex=o.columnLabelToIndex,t.rowIndexToLabel=o.rowIndexToLabel,t.rowLabelToIndex=o.rowLabelToIndex},function(r,t,e){"use strict";function n(r){return r&&r.__esModule?r:{default:r}}function a(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function u(r,t){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?r:t}function i(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(r,t):r.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Parser=t.SUPPORTED_FORMULAS=void 0;var o=function(){function r(r,t){var e=[],n=!0,a=!1,u=void 0;try{for(var i,o=r[Symbol.iterator]();!(n=(i=o.next()).done)&&(e.push(i.value),!t||e.length!==t);n=!0);}catch(r){a=!0,u=r}finally{try{!n&&o.return&&o.return()}finally{if(a)throw u}}return e}return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return r(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function r(r,t){for(var e=0;e1?t-1:0),n=1;n-1?parseFloat(r):parseInt(r,10)),t}function n(r){return-1*e(r)}Object.defineProperty(t,"__esModule",{value:!0}),t.toNumber=e,t.invertNumber=n},function(r,t){"use strict";function e(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function n(r){var t=void 0;return r=(r+"").replace(/#|!|\?/g,""),m[r]&&(t=m[r]),t?t:null}Object.defineProperty(t,"__esModule",{value:!0});var a;t.default=n;var u=t.ERROR="ERROR",i=t.ERROR_DIV_ZERO="DIV/0",o=t.ERROR_NAME="NAME",s=t.ERROR_NEED_UPDATE="NEED_UPDATE",l=t.ERROR_NOT_AVAILABLE="N/A",f=t.ERROR_NULL="NULL",c=t.ERROR_NUM="NUM",p=t.ERROR_REF="REF",h=t.ERROR_VALUE="VALUE",m=(a={},e(a,u,"#ERROR!"),e(a,i,"#DIV/0!"),e(a,o,"#NAME?"),e(a,s,"#NEED_UPDATE!"),e(a,l,"#N/A"),e(a,f,"#NULL!"),e(a,c,"#NUM!"),e(a,p,"#REF!"),e(a,h,"#VALUE!"),a)},function(r,t){"use strict";function e(){for(var r=arguments.length,t=Array(r),e=0;e1?t-1:0),n=1;n=0?exports.ROUND(Math.ceil(r/t)*t,n):0===e?-exports.ROUND(Math.floor(Math.abs(r)/t)*t,n):-exports.ROUND(Math.ceil(Math.abs(r)/t)*t,n)},exports.CEILING.MATH=exports.CEILING,exports.CEILING.PRECISE=exports.CEILING,exports.COMBIN=function(r,t){return r=utils.parseNumber(r),t=utils.parseNumber(t),utils.anyIsError(r,t)?error.value:exports.FACT(r)/(exports.FACT(t)*exports.FACT(r-t))},exports.COMBINA=function(r,t){return r=utils.parseNumber(r),t=utils.parseNumber(t),utils.anyIsError(r,t)?error.value:0===r&&0===t?1:exports.COMBIN(r+t-1,r-1)},exports.COS=function(r){return r=utils.parseNumber(r),r instanceof Error?r:Math.cos(r)},exports.COSH=function(r){return r=utils.parseNumber(r),r instanceof Error?r:(Math.exp(r)+Math.exp(-r))/2},exports.COT=function(r){return r=utils.parseNumber(r),r instanceof Error?r:1/Math.tan(r)},exports.COTH=function(r){if(r=utils.parseNumber(r),r instanceof Error)return r;var t=Math.exp(2*r);return(t+1)/(t-1)},exports.CSC=function(r){return r=utils.parseNumber(r),r instanceof Error?r:1/Math.sin(r)},exports.CSCH=function(r){return r=utils.parseNumber(r),r instanceof Error?r:2/(Math.exp(r)-Math.exp(-r))},exports.DECIMAL=function(r,t){return arguments.length<1?error.value:parseInt(r,t)},exports.DEGREES=function(r){return r=utils.parseNumber(r),r instanceof Error?r:180*r/Math.PI},exports.EVEN=function(r){return r=utils.parseNumber(r),r instanceof Error?r:exports.CEILING(r,-2,-1)},exports.EXP=Math.exp;var MEMOIZED_FACT=[];exports.FACT=function(r){if(r=utils.parseNumber(r),r instanceof Error)return r;var t=Math.floor(r);return 0===t||1===t?1:MEMOIZED_FACT[t]>0?MEMOIZED_FACT[t]:(MEMOIZED_FACT[t]=exports.FACT(t-1)*t,MEMOIZED_FACT[t])},exports.FACTDOUBLE=function(r){if(r=utils.parseNumber(r),r instanceof Error)return r;var t=Math.floor(r);return t<=0?1:t*exports.FACTDOUBLE(t-2)},exports.FLOOR=function(r,t){if(r=utils.parseNumber(r),t=utils.parseNumber(t),utils.anyIsError(r,t))return error.value;if(0===t)return 0;if(!(r>0&&t>0||r<0&&t<0))return error.num;t=Math.abs(t);var e=-Math.floor(Math.log(t)/Math.log(10));return r>=0?exports.ROUND(Math.floor(r/t)*t,e):-exports.ROUND(Math.ceil(Math.abs(r)/t),e)},exports.FLOOR.MATH=function(r,t,e){if(t=void 0===t?1:t,e=void 0===e?0:e,r=utils.parseNumber(r),t=utils.parseNumber(t),e=utils.parseNumber(e),utils.anyIsError(r,t,e))return error.value;if(0===t)return 0;t=t?Math.abs(t):1;var n=-Math.floor(Math.log(t)/Math.log(10));return r>=0?exports.ROUND(Math.floor(r/t)*t,n):0===e||void 0===e?-exports.ROUND(Math.ceil(Math.abs(r)/t)*t,n):-exports.ROUND(Math.floor(Math.abs(r)/t)*t,n)},exports.FLOOR.PRECISE=exports.FLOOR.MATH,exports.GCD=function(){var r=utils.parseNumberArray(utils.flatten(arguments));if(r instanceof Error)return r;for(var t=r.length,e=r[0],n=e<0?-e:e,a=1;ai?n%=i:i%=n;n+=i}return n},exports.INT=function(r){return r=utils.parseNumber(r),r instanceof Error?r:Math.floor(r)},exports.ISO={CEILING:exports.CEILING},exports.LCM=function(){var r=utils.parseNumberArray(utils.flatten(arguments));if(r instanceof Error)return r;for(var t,e,n,a,u=1;void 0!==(n=r.pop());)for(;n>1;){if(n%2){for(t=3,e=Math.floor(Math.sqrt(n));t<=e&&n%t;t+=2);a=t<=e?t:n}else a=2;for(n/=a,u*=a,t=r.length;t;r[--t]%a===0&&1===(r[t]/=a)&&r.splice(t,1));}return u},exports.LN=function(r){return r=utils.parseNumber(r),r instanceof Error?r:Math.log(r)},exports.LN10=function(){return Math.log(10)},exports.LN2=function(){return Math.log(2)},exports.LOG10E=function(){return Math.LOG10E},exports.LOG2E=function(){return Math.LOG2E},exports.LOG=function(r,t){return r=utils.parseNumber(r),t=utils.parseNumber(t),utils.anyIsError(r,t)?error.value:(t=void 0===t?10:t,Math.log(r)/Math.log(t))},exports.LOG10=function(r){return r=utils.parseNumber(r),r instanceof Error?r:Math.log(r)/Math.log(10)},exports.MOD=function(r,t){if(r=utils.parseNumber(r),t=utils.parseNumber(t),utils.anyIsError(r,t))return error.value;if(0===t)return error.div0;var e=Math.abs(r%t);return t>0?e:-e},exports.MROUND=function(r,t){return r=utils.parseNumber(r),t=utils.parseNumber(t),utils.anyIsError(r,t)?error.value:r*t<0?error.num:Math.round(r/t)*t},exports.MULTINOMIAL=function(){var r=utils.parseNumberArray(utils.flatten(arguments));if(r instanceof Error)return r;for(var t=0,e=1,n=0;n0?t:-t},exports.PI=function(){return Math.PI},exports.E=function(){return Math.E},exports.POWER=function(r,t){if(r=utils.parseNumber(r),t=utils.parseNumber(t),utils.anyIsError(r,t))return error.value;var e=Math.pow(r,t);return isNaN(e)?error.num:e},exports.PRODUCT=function(){var r=utils.parseNumberArray(utils.flatten(arguments));if(r instanceof Error)return r;for(var t=1,e=0;e0?1:-1;return e*Math.floor(Math.abs(r)*Math.pow(10,t))/Math.pow(10,t)},exports.ROUNDUP=function(r,t){if(r=utils.parseNumber(r),t=utils.parseNumber(t),utils.anyIsError(r,t))return error.value;var e=r>0?1:-1;return e*Math.ceil(Math.abs(r)*Math.pow(10,t))/Math.pow(10,t)},exports.SEC=function(r){return r=utils.parseNumber(r),r instanceof Error?r:1/Math.cos(r)},exports.SECH=function(r){return r=utils.parseNumber(r),r instanceof Error?r:2/(Math.exp(r)+Math.exp(-r))},exports.SERIESSUM=function(r,t,e,n){if(r=utils.parseNumber(r),t=utils.parseNumber(t),e=utils.parseNumber(e),n=utils.parseNumberArray(n),utils.anyIsError(r,t,e,n))return error.value;for(var a=n[0]*Math.pow(r,t),u=1;u=t)},exports.LT=function(r,t){return 2!==arguments.length?error.na:(r=utils.parseNumber(r),t=utils.parseNumber(t),utils.anyIsError(r,t)?error.error:r0?1:-1;return e*Math.floor(Math.abs(r)*Math.pow(10,t))/Math.pow(10,t)}},function(r,t,e){var n=e(16);t.flattenShallow=function(r){return r&&r.reduce?r.reduce(function(r,t){var e=Array.isArray(r),n=Array.isArray(t);return e&&n?r.concat(t):e?(r.push(t),r):n?[r].concat(t):[r,t]}):r},t.isFlat=function(r){if(!r)return!1;for(var t=0;t=e)return n;n++}},exports.CHISQ={},exports.CHISQ.DIST=function(r,t,e){return r=utils.parseNumber(r),t=utils.parseNumber(t),utils.anyIsError(r,t)?error.value:e?jStat.chisquare.cdf(r,t):jStat.chisquare.pdf(r,t)},exports.CHISQ.DIST.RT=function(r,t){return!r|!t?error.na:r<1||t>Math.pow(10,10)?error.num:"number"!=typeof r||"number"!=typeof t?error.value:1-jStat.chisquare.cdf(r,t)},exports.CHISQ.INV=function(r,t){return r=utils.parseNumber(r),t=utils.parseNumber(t),utils.anyIsError(r,t)?error.value:jStat.chisquare.inv(r,t)},exports.CHISQ.INV.RT=function(r,t){return!r|!t?error.na:r<0||r>1||t<1||t>Math.pow(10,10)?error.num:"number"!=typeof r||"number"!=typeof t?error.value:jStat.chisquare.inv(1-r,t)},exports.CHISQ.TEST=function(r,t){function e(r,t){var e=Math.exp(-.5*r);t%2===1&&(e*=Math.sqrt(2*r/f));for(var n=t;n>=2;)e=e*r/n,n-=2;for(var a=e,u=t;a>1e-10*e;)u+=2,a=a*r/u,e+=a;return 1-e}if(2!==arguments.length)return error.na;if(!(r instanceof Array&&t instanceof Array))return error.value;if(r.length!==t.length)return error.value;if(r[0]&&t[0]&&r[0].length!==t[0].length)return error.value;var n,a,u,i=r.length;for(a=0;a=!]/.test(criteria)||(criteria='=="'+criteria+'"');for(var matches=0,i=0;i=!]/.test(criteria)||(criteria='=="'+criteria+'"');for(var j=0;j1?error.num:jStat.centralF.inv(r,t,e)},exports.F.INV.RT=function(r,t,e){return 3!==arguments.length?error.na:r<0||r>1||t<1||t>Math.pow(10,10)||e<1||e>Math.pow(10,10)?error.num:"number"!=typeof r||"number"!=typeof t||"number"!=typeof e?error.value:jStat.centralF.inv(1-r,t,e)},exports.F.TEST=function(r,t){if(!r||!t)return error.na;if(!(r instanceof Array&&t instanceof Array))return error.na;if(r.length<2||t.length<2)return error.div0;var e=function(r,t){for(var e=0,n=0;nt[u-1]&&r[i]<=t[u]&&(a[u]+=1):u===n&&r[i]>t[n-1]&&(a[n]+=1)}return a},exports.GAMMA=function(r){return r=utils.parseNumber(r),r instanceof Error?r:0===r?error.num:parseInt(r,10)===r&&r<0?error.num:jStat.gammafn(r)},exports.GAMMA.DIST=function(r,t,e,n){return 4!==arguments.length?error.na:r<0||t<=0||e<=0?error.value:"number"!=typeof r||"number"!=typeof t||"number"!=typeof e?error.value:n?jStat.gamma.cdf(r,t,e,!0):jStat.gamma.pdf(r,t,e,!1)},exports.GAMMA.INV=function(r,t,e){return 3!==arguments.length?error.na:r<0||r>1||t<=0||e<=0?error.num:"number"!=typeof r||"number"!=typeof t||"number"!=typeof e?error.value:jStat.gamma.inv(r,t,e)},exports.GAMMALN=function(r){return r=utils.parseNumber(r),r instanceof Error?r:jStat.gammaln(r)},exports.GAMMALN.PRECISE=function(r){return 1!==arguments.length?error.na:r<=0?error.num:"number"!=typeof r?error.value:jStat.gammaln(r)},exports.GAUSS=function(r){return r=utils.parseNumber(r),r instanceof Error?r:jStat.normal.cdf(r,0,1)-.5},exports.GEOMEAN=function(){var r=utils.parseNumberArray(utils.flatten(arguments));return r instanceof Error?r:jStat.geomean(r)},exports.GROWTH=function(r,t,e,n){if(r=utils.parseNumberArray(r),r instanceof Error)return r;var a;if(void 0===t)for(t=[],a=1;a<=r.length;a++)t.push(a);if(void 0===e)for(e=[],a=1;a<=r.length;a++)e.push(a);if(t=utils.parseNumberArray(t),e=utils.parseNumberArray(e),utils.anyIsError(t,e))return error.value;void 0===n&&(n=!0);var u=r.length,i=0,o=0,s=0,l=0;for(a=0;au&&(u=n[t],a=[]),n[t]===u&&(a[a.length]=t);return a},exports.MODE.SNGL=function(){var r=utils.parseNumberArray(utils.flatten(arguments));return r instanceof Error?r:exports.MODE.MULT(r).sort(function(r,t){return r-t})[0]},exports.NEGBINOM={},exports.NEGBINOM.DIST=function(r,t,e,n){return r=utils.parseNumber(r),t=utils.parseNumber(t),e=utils.parseNumber(e),utils.anyIsError(r,t,e)?error.value:n?jStat.negbin.cdf(r,t,e):jStat.negbin.pdf(r,t,e)},exports.NORM={},exports.NORM.DIST=function(r,t,e,n){return r=utils.parseNumber(r),t=utils.parseNumber(t),e=utils.parseNumber(e),utils.anyIsError(r,t,e)?error.value:e<=0?error.num:n?jStat.normal.cdf(r,t,e):jStat.normal.pdf(r,t,e)},exports.NORM.INV=function(r,t,e){return r=utils.parseNumber(r),t=utils.parseNumber(t),e=utils.parseNumber(e),utils.anyIsError(r,t,e)?error.value:jStat.normal.inv(r,t,e)},exports.NORM.S={},exports.NORM.S.DIST=function(r,t){return r=utils.parseNumber(r),r instanceof Error?error.value:t?jStat.normal.cdf(r,0,1):jStat.normal.pdf(r,0,1)},exports.NORM.S.INV=function(r){return r=utils.parseNumber(r),r instanceof Error?error.value:jStat.normal.inv(r,0,1)},exports.PEARSON=function(r,t){if(t=utils.parseNumberArray(utils.flatten(t)),r=utils.parseNumberArray(utils.flatten(r)),utils.anyIsError(t,r))return error.value;for(var e=jStat.mean(r),n=jStat.mean(t),a=r.length,u=0,i=0,o=0,s=0;s1-1/(e+1))return error.num;var n=t*(e+1)-1,a=Math.floor(n);return utils.cleanFloat(n===a?r[n]:r[a]+(n-a)*(r[a+1]-r[a]))},exports.PERCENTILE.INC=function(r,t){if(r=utils.parseNumberArray(utils.flatten(r)),t=utils.parseNumber(t),utils.anyIsError(r,t))return error.value;r=r.sort(function(r,t){return r-t});var e=r.length,n=t*(e-1),a=Math.floor(n);return utils.cleanFloat(n===a?r[n]:r[a]+(n-a)*(r[a+1]-r[a]))},exports.PERCENTRANK={},exports.PERCENTRANK.EXC=function(r,t,e){if(e=void 0===e?3:e,r=utils.parseNumberArray(utils.flatten(r)),t=utils.parseNumber(t),e=utils.parseNumber(e),utils.anyIsError(r,t,e))return error.value;r=r.sort(function(r,t){return r-t});for(var n=misc.UNIQUE.apply(null,r),a=r.length,u=n.length,i=Math.pow(10,e),o=0,s=!1,l=0;!s&&l=n[l]&&(t=n[l]&&(t=0?t[r.indexOf(e)]:0;for(var a=r.sort(function(r,t){return r-t}),u=a.length,i=0,o=0;o=e&&a[o]<=n&&(i+=t[r.indexOf(a[o])]);return i},exports.QUARTILE={},exports.QUARTILE.EXC=function(r,t){if(r=utils.parseNumberArray(utils.flatten(r)),t=utils.parseNumber(t),utils.anyIsError(r,t))return error.value;switch(t){case 1:return exports.PERCENTILE.EXC(r,.25);case 2:return exports.PERCENTILE.EXC(r,.5);case 3:return exports.PERCENTILE.EXC(r,.75);default:return error.num}},exports.QUARTILE.INC=function(r,t){if(r=utils.parseNumberArray(utils.flatten(r)),t=utils.parseNumber(t),utils.anyIsError(r,t))return error.value;switch(t){case 1:return exports.PERCENTILE.INC(r,.25);case 2:return exports.PERCENTILE.INC(r,.5);case 3:return exports.PERCENTILE.INC(r,.75);default:return error.num}},exports.RANK={},exports.RANK.AVG=function(r,t,e){if(r=utils.parseNumber(r),t=utils.parseNumberArray(utils.flatten(t)),utils.anyIsError(r,t))return error.value;t=utils.flatten(t),e=e||!1;var n=e?function(r,t){return r-t}:function(r,t){return t-r};t=t.sort(n);for(var a=t.length,u=0,i=0;i1?(2*t.indexOf(r)+u+1)/2:t.indexOf(r)+1},exports.RANK.EQ=function(r,t,e){if(r=utils.parseNumber(r),t=utils.parseNumberArray(utils.flatten(t)),utils.anyIsError(r,t))return error.value;e=e||!1;var n=e?function(r,t){return r-t}:function(r,t){return t-r};return t=t.sort(n),t.indexOf(r)+1},exports.ROW=function(r,t){if(2!==arguments.length)return error.na;if(t<0)return error.num;if(!(r instanceof Array)||"number"!=typeof t)return error.value;if(0!==r.length)return jStat.row(r,t)},exports.ROWS=function(r){return 1!==arguments.length?error.na:r instanceof Array?0===r.length?0:jStat.rows(r):error.value},exports.RSQ=function(r,t){return r=utils.parseNumberArray(utils.flatten(r)),t=utils.parseNumberArray(utils.flatten(t)),utils.anyIsError(r,t)?error.value:Math.pow(exports.PEARSON(r,t),2)},exports.SKEW=function(){var r=utils.parseNumberArray(utils.flatten(arguments));if(r instanceof Error)return r;for(var t=jStat.mean(r),e=r.length,n=0,a=0;a1||t<1?error.num:utils.anyIsError(r,t)?error.value:Math.abs(jStat.studentt.inv(r/2,t))},exports.T.TEST=function(r,t){if(r=utils.parseNumberArray(utils.flatten(r)),t=utils.parseNumberArray(utils.flatten(t)),utils.anyIsError(r,t))return error.value;var e,n=jStat.mean(r),a=jStat.mean(t),u=0,i=0;for(e=0;e-1;)r[t]="TRUE";for(var e=0;(e=r.indexOf(!1))>-1;)r[e]="FALSE";return r.join("")},t.DBCS=function(){throw new Error("DBCS is not implemented")},t.DOLLAR=function(r,t){if(t=void 0===t?2:t,r=n.parseNumber(r),t=n.parseNumber(t),n.anyIsError(r,t))return a.value;var e="";return t<=0?(r=Math.round(r*Math.pow(10,t))/Math.pow(10,t),e="($0,0)"):t>0&&(e="($0,0."+new Array(t+1).join("0")+")"),u(r).format(e)},t.EXACT=function(r,t){return 2!==arguments.length?a.na:r===t},t.FIND=function(r,t,e){return arguments.length<2?a.na:(e=void 0===e?0:e,t?t.indexOf(r,e-1)+1:null)},t.FIXED=function(r,t,e){if(t=void 0===t?2:t,e=void 0!==e&&e,r=n.parseNumber(r),t=n.parseNumber(t),n.anyIsError(r,t))return a.value;var i=e?"0":"0,0";return t<=0?r=Math.round(r*Math.pow(10,t))/Math.pow(10,t):t>0&&(i+="."+new Array(t+1).join("0")),u(r).format(i)},t.HTML2TEXT=function(r){var t="";return r&&(r instanceof Array?r.forEach(function(r){""!==t&&(t+="\n"),t+=r.replace(/<(?:.|\n)*?>/gm,"")}):t=r.replace(/<(?:.|\n)*?>/gm,"")),t},t.LEFT=function(r,t){return t=void 0===t?1:t,t=n.parseNumber(t),t instanceof Error||"string"!=typeof r?a.value:r?r.substring(0,t):null},t.LEN=function(r){return 0===arguments.length?a.error:"string"==typeof r?r?r.length:0:r.length?r.length:a.value},t.LOWER=function(r){return"string"!=typeof r?a.value:r?r.toLowerCase():r},t.MID=function(r,t,e){if(t=n.parseNumber(t),e=n.parseNumber(e),n.anyIsError(t,e)||"string"!=typeof r)return e;var a=t-1,u=a+e;return r.substring(a,u)},t.NUMBERVALUE=function(r,t,e){return t="undefined"==typeof t?".":t,e="undefined"==typeof e?",":e,Number(r.replace(t,".").replace(e,""))},t.PRONETIC=function(){throw new Error("PRONETIC is not implemented")},t.PROPER=function(r){return void 0===r||0===r.length?a.value:(r===!0&&(r="TRUE"),r===!1&&(r="FALSE"),isNaN(r)&&"number"==typeof r?a.value:("number"==typeof r&&(r=""+r),r.replace(/\w\S*/g,function(r){return r.charAt(0).toUpperCase()+r.substr(1).toLowerCase()})))},t.REGEXEXTRACT=function(r,t){if(arguments.length<2)return a.na;var e=r.match(new RegExp(t));return e?e[e.length>1?e.length-1:0]:null},t.REGEXMATCH=function(r,t,e){if(arguments.length<2)return a.na;var n=r.match(new RegExp(t));return e?n:!!n},t.REGEXREPLACE=function(r,t,e){return arguments.length<3?a.na:r.replace(new RegExp(t),e)},t.REPLACE=function(r,t,e,u){return t=n.parseNumber(t),e=n.parseNumber(e),n.anyIsError(t,e)||"string"!=typeof r||"string"!=typeof u?a.value:r.substr(0,t-1)+u+r.substr(t-1+e)},t.REPT=function(r,t){return t=n.parseNumber(t),t instanceof Error?t:new Array(t+1).join(r)},t.RIGHT=function(r,t){return t=void 0===t?1:t,t=n.parseNumber(t),t instanceof Error?t:r?r.substring(r.length-t):a.na},t.SEARCH=function(r,t,e){var n;return"string"!=typeof r||"string"!=typeof t?a.value:(e=void 0===e?0:e,n=t.toLowerCase().indexOf(r.toLowerCase(),e-1)+1,0===n?a.value:n)},t.SPLIT=function(r,t){return r.split(t)},t.SUBSTITUTE=function(r,t,e,n){if(arguments.length<2)return a.na;if(!(r&&t&&e))return r;if(void 0===n)return r.replace(new RegExp(t,"g"),e);for(var u=0,i=0;r.indexOf(t,u)>0;)if(u=r.indexOf(t,u+1),i++,i===n)return r.substring(0,u)+e+r.substring(u+t.length)},t.T=function(r){return"string"==typeof r?r:""},t.TEXT=function(r,t){return r=n.parseNumber(r),n.anyIsError(r)?a.na:u(r).format(t)},t.TRIM=function(r){return"string"!=typeof r?a.value:r.replace(/ +/g," ").trim()},t.UNICHAR=t.CHAR,t.UNICODE=t.CODE,t.UPPER=function(r){return"string"!=typeof r?a.value:r.toUpperCase()},t.VALUE=function(r){if("string"!=typeof r)return a.value;var t=u().unformat(r);return void 0===t?0:t}},function(r,t,e){var n,a;(function(u){(function(){"use strict";function i(r){this._value=r}function o(r){var t,e="";for(t=0;t0?f=n+a+o(u-a.length):(i=+n<0?"-0":"0",t>0&&(i+="."),l=o(-1*u-1),s=(l+Math.abs(n)+a).substr(0,t),f=i+s),+u>0&&t>0&&(f+="."+o(t)),f}function l(r,t,e,n){var a,u,i=Math.pow(10,t);return r.toString().indexOf("e")>-1?(u=s(r,t),"-"===u.charAt(0)&&+u>=0&&(u=u.substr(1))):u=(e(r+"e+"+t)/i).toFixed(t),n&&(a=new RegExp("0{1,"+n+"}$"),u=u.replace(a,"")),u}function f(r,t,e){var n,a=t.replace(/\{[^\{\}]*\}/g,"");return n=a.indexOf("$")>-1?p(r,t,e):a.indexOf("%")>-1?h(r,t,e):a.indexOf(":")>-1?m(r,t):g(r._value,t,e)}function c(r,t){var e,n,a,u,i,o=t,s=!1;if(t.indexOf(":")>-1)r._value=E(t);else if(t===w)r._value=0;else{for("."!==x[$].delimiters.decimal&&(t=t.replace(/\./g,"").replace(x[$].delimiters.decimal,".")),e=new RegExp("[^a-zA-Z]"+x[$].abbreviations.thousand+"(?:\\)|(\\"+x[$].currency.symbol+")?(?:\\))?)?$"),n=new RegExp("[^a-zA-Z]"+x[$].abbreviations.million+"(?:\\)|(\\"+x[$].currency.symbol+")?(?:\\))?)?$"),a=new RegExp("[^a-zA-Z]"+x[$].abbreviations.billion+"(?:\\)|(\\"+x[$].currency.symbol+")?(?:\\))?)?$"), -u=new RegExp("[^a-zA-Z]"+x[$].abbreviations.trillion+"(?:\\)|(\\"+x[$].currency.symbol+")?(?:\\))?)?$"),i=1;i-1?s=Math.pow(1024,i):t.indexOf(S[i])>-1&&(s=Math.pow(1e3,i));var l=t.replace(/[^0-9\.]+/g,"");""===l?r._value=NaN:(r._value=(s?s:1)*(o.match(e)?Math.pow(10,3):1)*(o.match(n)?Math.pow(10,6):1)*(o.match(a)?Math.pow(10,9):1)*(o.match(u)?Math.pow(10,12):1)*(t.indexOf("%")>-1?.01:1)*((t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1)*Number(l),r._value=s?Math.ceil(r._value):r._value)}return r._value}function p(r,t,e){var n,a,u=t,i=u.indexOf("$"),o=u.indexOf("("),s=u.indexOf("+"),l=u.indexOf("-"),f="",c="";if(u.indexOf("$")===-1?"infix"===x[$].currency.position?(c=x[$].currency.symbol,x[$].currency.spaceSeparated&&(c=" "+c+" ")):x[$].currency.spaceSeparated&&(f=" "):u.indexOf(" $")>-1?(f=" ",u=u.replace(" $","")):u.indexOf("$ ")>-1?(f=" ",u=u.replace("$ ","")):u=u.replace("$",""),a=g(r._value,u,e,c),t.indexOf("$")===-1)switch(x[$].currency.position){case"postfix":a.indexOf(")")>-1?(a=a.split(""),a.splice(-1,0,f+x[$].currency.symbol),a=a.join("")):a=a+f+x[$].currency.symbol;break;case"infix":break;case"prefix":a.indexOf("(")>-1||a.indexOf("-")>-1?(a=a.split(""),n=Math.max(o,l)+1,a.splice(n,0,x[$].currency.symbol+f),a=a.join("")):a=x[$].currency.symbol+f+a;break;default:throw Error('Currency position should be among ["prefix", "infix", "postfix"]')}else i<=1?a.indexOf("(")>-1||a.indexOf("+")>-1||a.indexOf("-")>-1?(a=a.split(""),n=1,(i-1?(a=a.split(""),a.splice(-1,0,f+x[$].currency.symbol),a=a.join("")):a=a+f+x[$].currency.symbol;return a}function h(r,t,e){var n,a="",u=100*r._value;return t.indexOf(" %")>-1?(a=" ",t=t.replace(" %","")):t=t.replace("%",""),n=g(u,t,e),n.indexOf(")")>-1?(n=n.split(""),n.splice(-1,0,a+"%"),n=n.join("")):n=n+a+"%",n}function m(r){var t=Math.floor(r._value/60/60),e=Math.floor((r._value-60*t*60)/60),n=Math.round(r._value-60*t*60-60*e);return t+":"+(e<10?"0"+e:e)+":"+(n<10?"0"+n:n)}function E(r){var t=r.split(":"),e=0;return 3===t.length?(e+=60*Number(t[0])*60,e+=60*Number(t[1]),e+=Number(t[2])):2===t.length&&(e+=60*Number(t[0]),e+=Number(t[1])),Number(e)}function v(r,t,e){var n,a,u,i=t[0],o=Math.abs(r);if(o>=e){for(n=1;n=a&&o-1?(A=!0,t=t.slice(1,-1)):t.indexOf("+")>-1&&(R=!0,t=t.replace(/\+/g,"")),t.indexOf("a")>-1&&(h=t.split(".")[0].match(/[0-9]+/g)||["0"],h=parseInt(h[0],10),V=t.indexOf("aK")>=0,D=t.indexOf("aM")>=0,C=t.indexOf("aB")>=0,L=t.indexOf("aT")>=0,_=V||D||C||L,t.indexOf(" a")>-1?(O=" ",t=t.replace(" a","")):t=t.replace("a",""),i=Math.floor(Math.log(F)/Math.LN10)+1,f=i%3,f=0===f?3:f,h&&0!==F&&(s=Math.floor(Math.log(F)/Math.LN10)+1-h,c=3*~~((Math.min(h,i)-f)/3),F/=Math.pow(10,c),t.indexOf(".")===-1&&h>3&&(t+="[.]",I=0===s?0:3*~~(s/3)-s,I=I<0?I+3:I,t+=o(I))),Math.floor(Math.log(Math.abs(r))/Math.LN10)+1!==h&&(F>=Math.pow(10,12)&&!_||L?(O+=x[$].abbreviations.trillion,r/=Math.pow(10,12)):F=Math.pow(10,9)&&!_||C?(O+=x[$].abbreviations.billion,r/=Math.pow(10,9)):F=Math.pow(10,6)&&!_||D?(O+=x[$].abbreviations.million,r/=Math.pow(10,6)):(F=Math.pow(10,3)&&!_||V)&&(O+=x[$].abbreviations.thousand,r/=Math.pow(10,3)))),M=0;M-1){t.indexOf(" "+a.marker)>-1&&(P=" "),t=t.replace(P+a.marker,""),u=v(r,a.suffixes,a.scale),r=u.value,P+=u.suffix;break}if(t.indexOf("o")>-1&&(t.indexOf(" o")>-1?(U=" ",t=t.replace(" o","")):t=t.replace("o",""),x[$].ordinal&&(U+=x[$].ordinal(r))),t.indexOf("[.]")>-1&&(S=!0,t=t.replace("[.]",".")),p=r.toString().split(".")[0],m=t.split(".")[1],N=t.indexOf(","),m){if(m.indexOf("*")!==-1?j=l(r,r.toString().split(".")[1].length,e):m.indexOf("[")>-1?(m=m.replace("]",""),m=m.split("["),j=l(r,m[0].length+m[1].length,e,m[1].length)):j=l(r,m.length,e),p=j.split(".")[0],j.split(".")[1].length){var X=n?O+n:x[$].delimiters.decimal;j=X+j.split(".")[1]}else j="";S&&0===Number(j.slice(1))&&(j="")}else p=l(r,0,e);return p.indexOf("-")>-1&&(p=p.slice(1),k=!0),p.length-1&&(p=p.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+x[$].delimiters.thousands)),0===t.indexOf(".")&&(p=""),d=t.indexOf("("),b=t.indexOf("-"),G=dn?e:n},-(1/0))}var M,A="1.8.0",R=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],S=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],O={general:{scale:1024,suffixes:S,marker:"bd"},binary:{scale:1024,suffixes:R,marker:"b"},decimal:{scale:1e3,suffixes:S,marker:"d"}},T=[O.general,O.binary,O.decimal],x={},V=x,$="en-US",w=null,D="0,0",C="0$",L="undefined"!=typeof r&&r.exports,_={delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(r){var t=r%10;return 1===~~(r%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$",position:"prefix"},defaults:{currencyFormat:",0000 a"},formats:{fourDigits:"0000 a",fullWithTwoDecimals:"$ ,0.00",fullWithTwoDecimalsNoCurrency:",0.00"}};M=function(r){return M.isNumbro(r)?r=r.value():0===r||"undefined"==typeof r?r=0:Number(r)||(r=M.fn.unformat(r)),new i(Number(r))},M.version=A,M.isNumbro=function(r){return r instanceof i},M.setLanguage=function(r,t){console.warn("`setLanguage` is deprecated since version 1.6.0. Use `setCulture` instead");var e=r,n=r.split("-")[0],a=null;V[e]||(Object.keys(V).forEach(function(r){a||r.split("-")[0]!==n||(a=r)}),e=a||t||"en-US"),d(e)},M.setCulture=function(r,t){var e=r,n=r.split("-")[1],a=null;x[e]||(n&&Object.keys(x).forEach(function(r){a||r.split("-")[1]!==n||(a=r)}),e=a||t||"en-US"),d(e)},M.language=function(r,t){if(console.warn("`language` is deprecated since version 1.6.0. Use `culture` instead"),!r)return $;if(r&&!t){if(!V[r])throw new Error("Unknown language : "+r);d(r)}return!t&&V[r]||N(r,t),M},M.culture=function(r,t){if(!r)return $;if(r&&!t){if(!x[r])throw new Error("Unknown culture : "+r);d(r)}return!t&&x[r]||N(r,t),M},M.languageData=function(r){if(console.warn("`languageData` is deprecated since version 1.6.0. Use `cultureData` instead"),!r)return V[$];if(!V[r])throw new Error("Unknown language : "+r);return V[r]},M.cultureData=function(r){if(!r)return x[$];if(!x[r])throw new Error("Unknown culture : "+r);return x[r]},M.culture("en-US",_),M.languages=function(){return console.warn("`languages` is deprecated since version 1.6.0. Use `cultures` instead"),V},M.cultures=function(){return x},M.zeroFormat=function(r){w="string"==typeof r?r:null},M.defaultFormat=function(r){D="string"==typeof r?r:"0.0"},M.defaultCurrencyFormat=function(r){C="string"==typeof r?r:"0$"},M.validate=function(r,t){var e,n,a,u,i,o,s,l;if("string"!=typeof r&&(r+="",console.warn&&console.warn("Numbro.js: Value is not string. It has been co-erced to: ",r)),r=r.trim(),r.match(/^\d+$/))return!0;if(""===r)return!1;try{s=M.cultureData(t)}catch(r){s=M.cultureData(M.culture())}return a=s.currency.symbol,i=s.abbreviations,e=s.delimiters.decimal,n="."===s.delimiters.thousands?"\\.":s.delimiters.thousands,l=r.match(/^[^\d]+/),(null===l||(r=r.substr(1),l[0]===a))&&(l=r.match(/[^\d]+$/),(null===l||(r=r.slice(0,-1),l[0]===i.thousand||l[0]===i.million||l[0]===i.billion||l[0]===i.trillion))&&(o=new RegExp(n+"{2}"),!r.match(/[^\d.,]/g)&&(u=r.split(e),!(u.length>2)&&(u.length<2?!!u[0].match(/^\d+.*\d$/)&&!u[0].match(o):1===u[0].length?!!u[0].match(/^\d+$/)&&!u[0].match(o)&&!!u[1].match(/^\d+$/):!!u[0].match(/^\d+.*\d$/)&&!u[0].match(o)&&!!u[1].match(/^\d+$/)))))},M.loadLanguagesInNode=function(){console.warn("`loadLanguagesInNode` is deprecated since version 1.6.0. Use `loadCulturesInNode` instead"),M.loadCulturesInNode()},M.loadCulturesInNode=function(){var r=e(21);for(var t in r)t&&M.culture(t,r[t])},"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(r,t){if(null===this||"undefined"==typeof this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof r)throw new TypeError(r+" is not a function");var e,n,a=this.length>>>0,u=!1;for(1e;++e)this.hasOwnProperty(e)&&(u?n=r(n,this[e],e,this):(n=this[e],u=!0));if(!u)throw new TypeError("Reduce of empty array with no initial value");return n}),M.fn=i.prototype={clone:function(){return M(this)},format:function(r,t){return f(this,r?r:D,void 0!==t?t:Math.round)},formatCurrency:function(r,t){return p(this,r?r:C,void 0!==t?t:Math.round)},unformat:function(r){if("number"==typeof r)return r;if("string"==typeof r){var t=c(this,r);return isNaN(t)?void 0:t}},binaryByteUnits:function(){return v(this._value,O.binary.suffixes,O.binary.scale).suffix},byteUnits:function(){return v(this._value,O.general.suffixes,O.general.scale).suffix},decimalByteUnits:function(){return v(this._value,O.decimal.suffixes,O.decimal.scale).suffix},value:function(){return this._value},valueOf:function(){return this._value},set:function(r){return this._value=Number(r),this},add:function(r){function t(r,t){return r+e*t}var e=y.call(null,this._value,r);return this._value=[this._value,r].reduce(t,0)/e,this},subtract:function(r){function t(r,t){return r-e*t}var e=y.call(null,this._value,r);return this._value=[r].reduce(t,this._value*e)/e,this},multiply:function(r){function t(r,t){var e=y(r,t),n=r*e;return n*=t*e,n/=e*e}return this._value=[this._value,r].reduce(t,1),this},divide:function(r){function t(r,t){var e=y(r,t);return r*e/(t*e)}return this._value=[this._value,r].reduce(t),this},difference:function(r){return Math.abs(M(this._value).subtract(r).value())}},I()&&M.loadCulturesInNode(),L?r.exports=M:("undefined"==typeof ender&&(this.numbro=M),n=[],a=function(){return M}.apply(t,n),!(void 0!==a&&(r.exports=a)))}).call("undefined"==typeof window?this:window)}).call(t,e(20))},function(r,t){function e(){c&&l&&(c=!1,l.length?f=l.concat(f):p=-1,f.length&&n())}function n(){if(!c){var r=i(e);c=!0;for(var t=f.length;t;){for(l=f,f=[];++p1)for(var e=1;ee?t:e;return r.pow(10,17-~~(r.log(n>0?n:-n)*r.LOG10E))}function n(r){return"[object Function]"===h.call(r)}function a(r){return"number"==typeof r&&r===r}function u(r){return c.apply([],r)}function o(){return new o._init(arguments)}function s(){return 0}function l(){return 1}function f(r,t){return r===t?1:0}var c=Array.prototype.concat,p=Array.prototype.slice,h=Object.prototype.toString,m=Array.isArray||function(r){return"[object Array]"===h.call(r)};o.fn=o.prototype,o._init=function(r){var t;if(m(r[0]))if(m(r[0][0])){n(r[1])&&(r[0]=o.map(r[0],r[1]));for(var t=0;t=0;t--,n++)e[n]=[r[n][t]];return e},o.transpose=function(r){var t,e,n,a,u,i=[];m(r[0])||(r=[r]),e=r.length,n=r[0].length;for(var u=0;u0&&(i[n][0]=r[n][0]),o=1;oe&&n>0)return[];if(n>0)for(i=r;ie;i+=n)a.push(i);return a},o.slice=function(){function r(r,e,n,a){var u,i=[],s=r.length;if(e===t&&n===t&&a===t)return o.copy(r);if(e=e||0,n=n||r.length,e=e>=0?e:s+e,n=n>=0?n:s+n,a=a||1,e===n||0===a)return[];if(en&&a>0)return[];if(a>0)for(u=e;un;u+=a)i.push(r[u]);return i}function e(t,e){if(e=e||{},a(e.row)){if(a(e.col))return t[e.row][e.col];var n=o.rowa(t,e.row),u=e.col||{};return r(n,u.start,u.end,u.step)}if(a(e.col)){var i=o.cola(t,e.col),s=e.row||{};return r(i,s.start,s.end,s.step)}var s=e.row||{},u=e.col||{},l=r(t,s.start,s.end,s.step);return l.map(function(t){return r(t,u.start,u.end,u.step)})}return e}(),o.sliceAssign=function(e,n,u){if(a(n.row)){if(a(n.col))return e[n.row][n.col]=u;n.col=n.col||{},n.col.start=n.col.start||0,n.col.end=n.col.end||e[0].length,n.col.step=n.col.step||1;var i=o.arange(n.col.start,r.min(e.length,n.col.end),n.col.step),s=n.row;return i.forEach(function(r,t){e[s][r]=u[t]}),e}if(a(n.col)){n.row=n.row||{},n.row.start=n.row.start||0,n.row.end=n.row.end||e.length,n.row.step=n.row.step||1;var l=o.arange(n.row.start,r.min(e[0].length,n.row.end),n.row.step),f=n.col;return l.forEach(function(r,t){e[r][f]=u[t]}),e}u[0].length===t&&(u=[u]),n.row.start=n.row.start||0,n.row.end=n.row.end||e.length,n.row.step=n.row.step||1,n.col.start=n.col.start||0,n.col.end=n.col.end||e[0].length,n.col.step=n.col.step||1;var l=o.arange(n.row.start,r.min(e.length,n.row.end),n.row.step),i=o.arange(n.col.start,r.min(e[0].length,n.col.end),n.col.step);return l.forEach(function(r,t){i.forEach(function(n,a){e[r][n]=u[t][a]})}),e},o.diagonal=function(r){var t=o.zeros(r.length,r.length);return r.forEach(function(r,e){t[e][e]=r}),t},o.copy=function(r){return r.map(function(r){return a(r)?r:r.map(function(r){return r})})};var E=o.prototype;return E.length=0,E.push=Array.prototype.push,E.sort=Array.prototype.sort,E.splice=Array.prototype.splice,E.slice=Array.prototype.slice,E.toArray=function(){return this.length>1?p.call(this):p.call(this)[0]},E.map=function(r,t){return o(o.map(this,r,t))},E.cumreduce=function(r,t){return o(o.cumreduce(this,r,t))},E.alter=function(r){return o.alter(this,r),this},function(r){for(var t=0;t=0;)r+=t[e];return r},r.sumsqrd=function(r){for(var t=0,e=r.length;--e>=0;)t+=r[e]*r[e];return t},r.sumsqerr=function(t){for(var e,n=r.mean(t),a=0,u=t.length;--u>=0;)e=t[u]-n,a+=e*e;return a},r.sumrow=function(r){for(var t=0,e=r.length;--e>=0;)t+=r[e];return t},r.product=function(r){for(var t=1,e=r.length;--e>=0;)t*=r[e];return t},r.min=function(r){for(var t=r[0],e=0;++et&&(t=r[e]);return t},r.unique=function(r){for(var t={},e=[],n=0;ni?(s=[a[t]],i=u,o=0):u===i&&(s.push(a[t]),o++),u=1);return 0===o?s[0]:s},r.range=function(t){return r.max(t)-r.min(t)},r.variance=function(t,e){return r.sumsqerr(t)/(t.length-(e?1:0))},r.deviation=function(t){for(var e=r.mean(t),n=t.length,a=new Array(n),u=0;u=0;n--)a+=t.abs(e[n]-u);return a/e.length},r.meddev=function(e){for(var n,a=0,u=r.median(e),n=e.length-1;n>=0;n--)a+=t.abs(e[n]-u);return a/e.length},r.coeffvar=function(t){return r.stdev(t)/r.mean(t)},r.quartiles=function(r){var n=r.length,a=r.slice().sort(e);return[a[t.round(n/4)-1],a[t.round(n/2)-1],a[t.round(3*n/4)-1]]},r.quantiles=function(r,a,u,i){var o,s,l,f,c,p,h=r.slice().sort(e),m=[a.length],E=r.length;"undefined"==typeof u&&(u=3/8),"undefined"==typeof i&&(i=3/8);for(var o=0;o1){for(s=e===!0?this:this.transpose();o1){for("sumrow"!==t&&(s=e===!0?this:this.transpose());o1){for(i=i.transpose();np)for(var e=0;e=1?e:1/e)+.4*e+17);if(n<0||e<=0)return NaN;if(n170||n>170?t.exp(r.combinationln(e,n)):r.factorial(e)/r.factorial(n)/r.factorial(e-n)},r.combinationln=function(t,e){return r.factorialln(t)-r.factorialln(e)-r.factorialln(t-e)},r.permutation=function(t,e){return r.factorial(t)/r.factorial(t-e)},r.betafn=function(e,n){if(!(e<=0||n<=0))return e+n>170?t.exp(r.betaln(e,n)):r.gammafn(e)*r.gammafn(n)/r.gammafn(e+n)},r.betaln=function(t,e){return r.gammaln(t)+r.gammaln(e)-r.gammaln(t+e)},r.betacf=function(r,e,n){var a,u,i,o,s=1e-30,l=1,f=e+n,c=e+1,p=e-1,h=1,m=1-f*r/c;for(t.abs(m)=1)return t.max(100,n+100*t.sqrt(n));if(e<=0)return 0;for(n>1?(l=t.log(p),f=t.exp(p*(l-1)-m),s=e<.5?e:1-e,i=t.sqrt(-2*t.log(s)),a=(2.30753+.27061*i)/(1+i*(.99229+.04481*i))-i,e<.5&&(a=-a),a=t.max(.001,n*t.pow(1-1/(9*n)-a/(3*t.sqrt(n)),3))):(i=1-n*(.253+.12*n),a=e1?f*t.exp(-(a-p)+p*(t.log(a)-l)):t.exp(-a+p*t.log(a)-m),o=u/i,a-=i=o/(1-.5*t.min(1,o*((n-1)/a-1))),a<=0&&(a=.5*(a+i)),t.abs(i)0;o--)a=l,l=n*l-f+i[o],f=a;return u=e*t.exp(-r*r+.5*(i[0]+n*l)-f),s?u-1:1-u},r.erfc=function(t){return 1-r.erf(t)},r.erfcinv=function(e){var n,a,u,i,o=0;if(e>=2)return-100;if(e<=0)return 100;for(i=e<1?e:2-e,u=t.sqrt(-2*t.log(i/2)),n=-.70711*((2.30753+.27061*u)/(1+u*(.99229+.04481*u))-u);o<2;o++)a=r.erfc(n)-i,n+=a/(1.1283791670955126*t.exp(-n*n)-n*a);return e<1?n:-n},r.ibetainv=function(e,n,a){var u,i,o,s,l,f,c,p,h,m,E,v=1e-8,g=n-1,N=a-1,d=0;if(e<=0)return 0;if(e>=1)return 1;for(n>=1&&a>=1?(o=e<.5?e:1-e,s=t.sqrt(-2*t.log(o)),c=(2.30753+.27061*s)/(1+s*(.99229+.04481*s))-s,e<.5&&(c=-c),p=(c*c-3)/6,h=2/(1/(2*n-1)+1/(2*a-1)),m=c*t.sqrt(p+h)/h-(1/(2*a-1)-1/(2*n-1))*(p+5/6-2/(3*h)),c=n/(n+a*t.exp(2*m))):(u=t.log(n/(n+a)),i=t.log(a/(n+a)),s=t.exp(n*u)/n,l=t.exp(a*i)/a,m=s+l,c=e=1&&(c=.5*(c+s+1)),t.abs(s)0)break}return c},r.ibeta=function(e,n,a){var u=0===e||1===e?0:t.exp(r.gammaln(n+a)-r.gammaln(n)-r.gammaln(a)+n*t.log(e)+a*t.log(1-e));return!(e<0||e>1)&&(e<(n+1)/(n+a+2)?u*r.betacf(e,n,a)/n:1-u*r.betacf(1-e,a,n)/a)},r.randn=function(e,n){var a,u,i,o,s;if(n||(n=e),e)return r.create(e,n,function(){return r.randn()});do a=t.random(),u=1.7156*(t.random()-.5),i=a-.449871,o=t.abs(u)+.386595,s=i*i+o*(.196*o-.25472*i);while(s>.27597&&(s>.27846||u*u>-4*t.log(a)*a*a));return u/a},r.randg=function(e,n,a){var u,i,o,s,l,f,c=e;if(a||(a=n),e||(e=1),n)return f=r.zeros(n,a),f.alter(function(){return r.randg(e)}),f;e<1&&(e+=1),u=e-1/3,i=1/t.sqrt(9*u);do{do l=r.randn(),s=1+i*l;while(s<=0);s=s*s*s,o=t.random()}while(o>1-.331*t.pow(l,4)&&t.log(o)>.5*l*l+u*(1-s+t.log(s)));if(e==c)return u*s;do o=t.random();while(0===o);return t.pow(o,1/c)*u*s},function(t){for(var e=0;e1||e<0?0:1==n&&1==a?1:n<512&&a<512?t.pow(e,n-1)*t.pow(1-e,a-1)/r.betafn(n,a):t.exp((n-1)*t.log(e)+(a-1)*t.log(1-e)-r.betaln(n,a))},cdf:function(t,e,n){return t>1||t<0?1*(t>1):r.ibeta(t,e,n)},inv:function(t,e,n){return r.ibetainv(t,e,n)},mean:function(r,t){return r/(r+t)},median:function(t,e){return r.ibetainv(.5,t,e)},mode:function(r,t){return(r-1)/(r+t-2)},sample:function(t,e){var n=r.randg(t);return n/(n+r.randg(e))},variance:function(r,e){return r*e/(t.pow(r+e,2)*(r+e+1))}}),r.extend(r.centralF,{pdf:function(e,n,a){var u,i,o;return e<0?0:n<=2?0===e&&n<2?1/0:0===e&&2===n?1:t.sqrt(t.pow(n*e,n)*t.pow(a,a)/t.pow(n*e+a,n+a))/(e*r.betafn(n/2,a/2)):(u=n*e/(a+e*n),i=a/(a+e*n),o=n*i/2,o*r.binomial.pdf((n-2)/2,(n+a-2)/2,u))},cdf:function(t,e,n){return t<0?0:r.ibeta(e*t/(e*t+n),e/2,n/2)},inv:function(t,e,n){return n/(e*(1/r.ibetainv(t,e/2,n/2)-1))},mean:function(r,t){return t>2?t/(t-2):void 0},mode:function(r,t){return r>2?t*(r-2)/(r*(t+2)):void 0},sample:function(t,e){var n=2*r.randg(t/2),a=2*r.randg(e/2);return n/t/(a/e)},variance:function(r,t){if(!(t<=4))return 2*t*t*(r+t-2)/(r*(t-2)*(t-2)*(t-4))}}),r.extend(r.cauchy,{pdf:function(r,e,n){return n<0?0:n/(t.pow(r-e,2)+t.pow(n,2))/t.PI},cdf:function(r,e,n){return t.atan((r-e)/n)/t.PI+.5},inv:function(r,e,n){return e+n*t.tan(t.PI*(r-.5))},median:function(r,t){return r},mode:function(r,t){return r},sample:function(e,n){return r.randn()*t.sqrt(1/(2*r.randg(.5)))*n+e}}),r.extend(r.chisquare,{pdf:function(e,n){return e<0?0:0===e&&2===n?.5:t.exp((n/2-1)*t.log(e)-e/2-n/2*t.log(2)-r.gammaln(n/2)); -},cdf:function(t,e){return t<0?0:r.lowRegGamma(e/2,t/2)},inv:function(t,e){return 2*r.gammapinv(t,.5*e)},mean:function(r){return r},median:function(r){return r*t.pow(1-2/(9*r),3)},mode:function(r){return r-2>0?r-2:0},sample:function(t){return 2*r.randg(t/2)},variance:function(r){return 2*r}}),r.extend(r.exponential,{pdf:function(r,e){return r<0?0:e*t.exp(-e*r)},cdf:function(r,e){return r<0?0:1-t.exp(-e*r)},inv:function(r,e){return-t.log(1-r)/e},mean:function(r){return 1/r},median:function(r){return 1/r*t.log(2)},mode:function(r){return 0},sample:function(r){return-1/r*t.log(t.random())},variance:function(r){return t.pow(r,-2)}}),r.extend(r.gamma,{pdf:function(e,n,a){return e<0?0:0===e&&1===n?1/a:t.exp((n-1)*t.log(e)-e/a-r.gammaln(n)-n*t.log(a))},cdf:function(t,e,n){return t<0?0:r.lowRegGamma(e,t/n)},inv:function(t,e,n){return r.gammapinv(t,e)*n},mean:function(r,t){return r*t},mode:function(r,t){if(r>1)return(r-1)*t},sample:function(t,e){return r.randg(t)*e},variance:function(r,t){return r*t*t}}),r.extend(r.invgamma,{pdf:function(e,n,a){return e<=0?0:t.exp(-(n+1)*t.log(e)-a/e-r.gammaln(n)+n*t.log(a))},cdf:function(t,e,n){return t<=0?0:1-r.lowRegGamma(e,n/t)},inv:function(t,e,n){return n/r.gammapinv(1-t,e)},mean:function(r,t){return r>1?t/(r-1):void 0},mode:function(r,t){return t/(r+1)},sample:function(t,e){return e/r.randg(t)},variance:function(r,t){if(!(r<=2))return t*t/((r-1)*(r-1)*(r-2))}}),r.extend(r.kumaraswamy,{pdf:function(r,e,n){return 0===r&&1===e?n:1===r&&1===n?e:t.exp(t.log(e)+t.log(n)+(e-1)*t.log(r)+(n-1)*t.log(1-t.pow(r,e)))},cdf:function(r,e,n){return r<0?0:r>1?1:1-t.pow(1-t.pow(r,e),n)},inv:function(r,e,n){return t.pow(1-t.pow(1-r,1/n),1/e)},mean:function(t,e){return e*r.gammafn(1+1/t)*r.gammafn(e)/r.gammafn(1+1/t+e)},median:function(r,e){return t.pow(1-t.pow(2,-1/e),1/r)},mode:function(r,e){if(r>=1&&e>=1&&1!==r&&1!==e)return t.pow((r-1)/(r*e-1),1/r)},variance:function(r,t){throw new Error("variance not yet implemented")}}),r.extend(r.lognormal,{pdf:function(r,e,n){return r<=0?0:t.exp(-t.log(r)-.5*t.log(2*t.PI)-t.log(n)-t.pow(t.log(r)-e,2)/(2*n*n))},cdf:function(e,n,a){return e<0?0:.5+.5*r.erf((t.log(e)-n)/t.sqrt(2*a*a))},inv:function(e,n,a){return t.exp(-1.4142135623730951*a*r.erfcinv(2*e)+n)},mean:function(r,e){return t.exp(r+e*e/2)},median:function(r,e){return t.exp(r)},mode:function(r,e){return t.exp(r-e*e)},sample:function(e,n){return t.exp(r.randn()*n+e)},variance:function(r,e){return(t.exp(e*e)-1)*t.exp(2*r+e*e)}}),r.extend(r.noncentralt,{pdf:function(e,n,a){var u=1e-14;return t.abs(a)u||l>u;)f=l,p>0&&(h*=a*a/(2*p),m*=a*a/(2*(p+.5))),l=h*r.beta.cdf(c,p+.5,n/2)+m*r.beta.cdf(c,p+1,n/2),s+=.5*l,p++;return o?1-s:s}}),r.extend(r.normal,{pdf:function(r,e,n){return t.exp(-.5*t.log(2*t.PI)-t.log(n)-t.pow(r-e,2)/(2*n*n))},cdf:function(e,n,a){return.5*(1+r.erf((e-n)/t.sqrt(2*a*a)))},inv:function(t,e,n){return-1.4142135623730951*n*r.erfcinv(2*t)+e},mean:function(r,t){return r},median:function(r,t){return r},mode:function(r,t){return r},sample:function(t,e){return r.randn()*e+t},variance:function(r,t){return t*t}}),r.extend(r.pareto,{pdf:function(r,e,n){return r1e100?1e100:n,1/(t.sqrt(n)*r.betafn(.5,n/2))*t.pow(1+e*e/n,-((n+1)/2))},cdf:function(e,n){var a=n/2;return r.ibeta((e+t.sqrt(e*e+n))/(2*t.sqrt(e*e+n)),a,a)},inv:function(e,n){var a=r.ibetainv(2*t.min(e,1-e),.5*n,.5);return a=t.sqrt(n*(1-a)/a),e>.5?a:-a},mean:function(r){return r>1?0:void 0},median:function(r){return 0},mode:function(r){return 0},sample:function(e){return r.randn()*t.sqrt(e/(2*r.randg(e/2)))},variance:function(r){return r>2?r/(r-2):r>1?1/0:void 0}}),r.extend(r.weibull,{pdf:function(r,e,n){return r<0||e<0||n<0?0:n/e*t.pow(r/e,n-1)*t.exp(-t.pow(r/e,n))},cdf:function(r,e,n){return r<0?0:1-t.exp(-t.pow(r/e,n))},inv:function(r,e,n){return e*t.pow(-t.log(1-r),1/n)},mean:function(t,e){return t*r.gammafn(1+1/e)},median:function(r,e){return r*t.pow(t.log(2),1/e)},mode:function(r,e){return e<=1?0:r*t.pow((e-1)/e,1/e)},sample:function(r,e){return r*t.pow(-t.log(t.random()),1/e)},variance:function(e,n){return e*e*r.gammafn(1+2/n)-t.pow(r.weibull.mean(e,n),2)}}),r.extend(r.uniform,{pdf:function(r,t,e){return re?0:1/(e-t)},cdf:function(r,t,e){return r>>0&&(e<0?0:r.combination(e+n-1,n-1)*t.pow(1-a,e)*t.pow(a,n))},cdf:function(t,e,n){var a=0,u=0;if(t<0)return 0;for(;u<=t;u++)a+=r.negbin.pdf(u,e,n);return a}}),r.extend(r.hypgeom,{pdf:function(e,n,a,u){if(e!==e|0)return!1;if(e<0||eu||e>a)return 0;if(2*a>n)return 2*u>n?r.hypgeom.pdf(n-a-u+e,n,n-a,n-u):r.hypgeom.pdf(u-e,n,n-a,u);if(2*u>n)return r.hypgeom.pdf(a-e,n,a,n-u);if(a1&&o=u||e>=a)return 1;if(2*a>n)return 2*u>n?r.hypgeom.cdf(n-a-u+e,n,n-a,n-u):1-r.hypgeom.cdf(u-e-1,n,n-a,u);if(2*u>n)return 1-r.hypgeom.cdf(a-e-1,n,a,n-u);if(a1&&sa);return n-1}}),r.extend(r.triangular,{pdf:function(r,t,e,n){return e<=t||ne?NaN:re?0:rn?NaN:r<=e?0:r>=n?1:r<=a?t.pow(r-e,2)/((n-e)*(a-e)):1-t.pow(n-r,2)/((n-e)*(n-a))},inv:function(r,e,n,a){return n<=e||an?NaN:r<=(a-e)/(n-e)?e+(n-e)*t.sqrt(r*((a-e)/(n-e))):e+(n-e)*(1-t.sqrt((1-r)*(1-(a-e)/(n-e))))},mean:function(r,t,e){return(r+t+e)/3},median:function(r,e,n){return n<=(r+e)/2?e-t.sqrt((e-r)*(e-n))/t.sqrt(2):n>(r+e)/2?r+t.sqrt((e-r)*(n-r))/t.sqrt(2):void 0},mode:function(r,t,e){return e},sample:function(r,e,n){var a=t.random();return a<(n-r)/(e-r)?r+t.sqrt(a*(e-r)*(n-r)):e-t.sqrt((1-a)*(e-r)*(e-n))},variance:function(r,t,e){return(r*r+t*t+e*e-r*t-r*e-t*e)/18}}),r.extend(r.laplace,{pdf:function(r,e,n){return n<=0?0:t.exp(-t.abs(r-e)/n)/(2*n)},cdf:function(r,e,n){return n<=0?0:r=0;s--){for(h=0,l=s+1;l<=f-1;l++)h+=m[l]*e[s][l];m[s]=(e[s][a-1]-h)/e[s][s]}return m},gauss_jordan:function(e,n){for(var a=r.aug(e,n),u=a.length,i=a[0].length,o=0;ot.abs(a[s][o])&&(s=l);var f=a[o];a[o]=a[s],a[s]=f;for(var l=o+1;l=0;o--){c=a[o][o];for(var l=0;lo-1;p--)a[l][p]-=a[o][p]*a[l][o]/c;a[o][o]/=c;for(var p=u;pc?(h[f][c]=e[f][c],m[f][c]=E[f][c]=0):fu;)i=l,l=r.add(r.multiply(s,i),o),f++;return l},gauss_seidel:function(e,n,a,u){for(var i,o,s,l,f,c=0,p=e.length,h=[],m=[],E=[];ci?(h[c][i]=e[c][i],m[c][i]=E[c][i]=0):cu;)o=f,f=r.add(r.multiply(l,o),s),c+=1;return f},SOR:function(e,n,a,u,i){for(var o,s,l,f,c,p=0,h=e.length,m=[],E=[],v=[];po?(m[p][o]=e[p][o],E[p][o]=v[p][o]=0):pu;)s=c,c=r.add(r.multiply(f,s),l),p++;return c},householder:function(e){for(var n,a,u,i,o,s=e.length,l=e[0].length,f=0,c=[],p=[];f0?-1:1,n=o*t.sqrt(n),a=t.sqrt((n*n-e[f+1][f]*n)/2),c=r.zeros(s,1),c[f+1][0]=(e[f+1][f]-n)/(2*a),u=f+2;u0?t.PI/4:-t.PI/4:t.atan(2*e[i][o]/(e[i][i]-e[o][o]))/2,f=r.identity(h,h),f[i][i]=t.cos(l),f[i][o]=-t.sin(l),f[o][i]=t.sin(l),f[o][o]=t.cos(l),m=r.multiply(m,f),n=r.multiply(r.multiply(r.inv(f),e),f),e=n,c=0;for(var a=1;a.001&&(c=1)}for(var a=0;a=c;)i=u(r,n+a),o=u(r,n),h[p]=(e[i]-2*e[o]+e[2*o-i])/(a*a),a/=2,p++;for(l=h.length,s=1;1!=l;){for(f=0;fn);a++);return a-=1,e[a]+(n-t[a])*p[a]+r.sq(n-t[a])*f[a]+(n-t[a])*r.sq(n-t[a])*h[a]},gauss_quadrature:function(){throw new Error("gauss_quadrature not yet implemented")},PCA:function(t){for(var e,n,a=t.length,u=t[0].length,i=0,o=[],s=[],l=[],f=[],c=[],p=[],h=[],m=[],E=[],v=[],i=0;i1||n>1||r<=0||n<=0)throw new Error("Proportions should be greater than 0 and less than 1");var u=(r*e+n*a)/(e+a),i=t.sqrt(u*(1-u)*(1/e+1/a));return(r-n)/i}var n=[].slice,a=r.utils.isNumber,u=r.utils.isArray;r.extend({zscore:function(){var t=n.call(arguments);return a(t[1])?(t[0]-t[1])/t[2]:(t[0]-r.mean(t[1]))/r.stdev(t[1],t[2])},ztest:function(){var e,a=n.call(arguments);return u(a[1])?(e=r.zscore(a[0],a[1],a[3]),1===a[2]?r.normal.cdf(-t.abs(e),0,1):2*r.normal.cdf(-t.abs(e),0,1)):a.length>2?(e=r.zscore(a[0],a[1],a[2]),1===a[3]?r.normal.cdf(-t.abs(e),0,1):2*r.normal.cdf(-t.abs(e),0,1)):(e=a[0],1===a[1]?r.normal.cdf(-t.abs(e),0,1):2*r.normal.cdf(-t.abs(e),0,1))}}),r.extend(r.fn,{zscore:function(r,t){return(r-this.mean())/this.stdev(t)},ztest:function(e,n,a){var u=t.abs(this.zscore(e,a));return 1===n?r.normal.cdf(-u,0,1):2*r.normal.cdf(-u,0,1)}}),r.extend({tscore:function(){var e=n.call(arguments);return 4===e.length?(e[0]-e[1])/(e[2]/t.sqrt(e[3])):(e[0]-r.mean(e[1]))/(r.stdev(e[1],!0)/t.sqrt(e[1].length))},ttest:function(){var e,u=n.call(arguments);return 5===u.length?(e=t.abs(r.tscore(u[0],u[1],u[2],u[3])),1===u[4]?r.studentt.cdf(-e,u[3]-1):2*r.studentt.cdf(-e,u[3]-1)):a(u[1])?(e=t.abs(u[0]),1==u[2]?r.studentt.cdf(-e,u[1]-1):2*r.studentt.cdf(-e,u[1]-1)):(e=t.abs(r.tscore(u[0],u[1])),1==u[2]?r.studentt.cdf(-e,u[1].length-1):2*r.studentt.cdf(-e,u[1].length-1))}}),r.extend(r.fn,{tscore:function(r){return(r-this.mean())/(this.stdev(!0)/t.sqrt(this.cols()))},ttest:function(e,n){return 1===n?1-r.studentt.cdf(t.abs(this.tscore(e)),this.cols()-1):2*r.studentt.cdf(-t.abs(this.tscore(e)),this.cols()-1)}}),r.extend({anovafscore:function(){var e,a,u,i,o,s,l,f,c=n.call(arguments);if(1===c.length){o=new Array(c[0].length);for(var l=0;l.5?1-e:e)}),o=jStat.studentt.inv(.975,t.df_resid),s=t.coef.map(function(r,t){var e=o*a[t];return[r-e,r+e]});return{se:a,t:u,p:i,sigmaHat:n,interval95:s}}function n(r){var t=r.R2/r.df_model/((1-r.R2)/r.df_resid),e=function(r,t,e){return jStat.beta.cdf(r/(e/t+r),t/2,e/2)},n=1-e(t,r.df_model,r.df_resid);return{F_statistic:t,pvalue:n}}function a(r,a){var u=t(r,a),i=e(u),o=n(u),s=1-(1-u.rsquared)*((u.nobs-1)/u.df_resid);return u.t=i,u.f=o,u.adjust_R2=s,u}return{ols:a}}()},function(r,t,e){var n=e(15),a=e(19),u=e(16);t.UNIQUE=function(){for(var r=[],t=0;t=0||"number"==typeof r&&(isNaN(r)||!isFinite(r))},t.ISERROR=function(r){return t.ISERR(r)||r===n.na},t.ISEVEN=function(r){return!(1&Math.floor(Math.abs(r)))},t.ISFORMULA=function(){throw new Error("ISFORMULA is not implemented")},t.ISLOGICAL=function(r){return r===!0||r===!1},t.ISNA=function(r){return r===n.na},t.ISNONTEXT=function(r){return"string"!=typeof r},t.ISNUMBER=function(r){return"number"==typeof r&&!isNaN(r)&&isFinite(r)},t.ISODD=function(r){return!!(1&Math.floor(Math.abs(r)))},t.ISREF=function(){throw new Error("ISREF is not implemented")},t.ISTEXT=function(r){return"string"==typeof r},t.N=function(r){return this.ISNUMBER(r)?r:r instanceof Date?r.getTime():r===!0?1:r===!1?0:this.ISERROR(r)?r:0},t.NA=function(){return n.na},t.SHEET=function(){throw new Error("SHEET is not implemented")},t.SHEETS=function(){throw new Error("SHEETS is not implemented")},t.TYPE=function(r){return this.ISNUMBER(r)?1:this.ISTEXT(r)?2:this.ISLOGICAL(r)?4:this.ISERROR(r)?16:Array.isArray(r)?64:void 0}},function(r,t,e){function n(r){return/^[01]{1,10}$/.test(r)}var a=e(16),u=e(22).jStat,i=e(18),o=e(15),s=e(26);t.BESSELI=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:s.besseli(r,t)},t.BESSELJ=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:s.besselj(r,t)},t.BESSELK=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:s.besselk(r,t)},t.BESSELY=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:s.bessely(r,t)},t.BIN2DEC=function(r){if(!n(r))return a.num;var t=parseInt(r,2),e=r.toString();return 10===e.length&&"1"===e.substring(0,1)?parseInt(e.substring(1),2)-512:t},t.BIN2HEX=function(r,t){if(!n(r))return a.num;var e=r.toString();if(10===e.length&&"1"===e.substring(0,1))return(0xfffffffe00+parseInt(e.substring(1),2)).toString(16);var u=parseInt(r,2).toString(16);return void 0===t?u:isNaN(t)?a.value:t<0?a.num:(t=Math.floor(t),t>=u.length?i.REPT("0",t-u.length)+u:a.num)},t.BIN2OCT=function(r,t){if(!n(r))return a.num;var e=r.toString();if(10===e.length&&"1"===e.substring(0,1))return(1073741312+parseInt(e.substring(1),2)).toString(8);var u=parseInt(r,2).toString(8);return void 0===t?u:isNaN(t)?a.value:t<0?a.num:(t=Math.floor(t),t>=u.length?i.REPT("0",t-u.length)+u:a.num)},t.BITAND=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:r<0||t<0?a.num:Math.floor(r)!==r||Math.floor(t)!==t?a.num:r>0xffffffffffff||t>0xffffffffffff?a.num:r&t},t.BITLSHIFT=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:r<0?a.num:Math.floor(r)!==r?a.num:r>0xffffffffffff?a.num:Math.abs(t)>53?a.num:t>=0?r<>-t},t.BITOR=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:r<0||t<0?a.num:Math.floor(r)!==r||Math.floor(t)!==t?a.num:r>0xffffffffffff||t>0xffffffffffff?a.num:r|t},t.BITRSHIFT=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:r<0?a.num:Math.floor(r)!==r?a.num:r>0xffffffffffff?a.num:Math.abs(t)>53?a.num:t>=0?r>>t:r<<-t},t.BITXOR=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:r<0||t<0?a.num:Math.floor(r)!==r||Math.floor(t)!==t?a.num:r>0xffffffffffff||t>0xffffffffffff?a.num:r^t},t.COMPLEX=function(r,t,e){if(r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t))return r;if(e=void 0===e?"i":e,"i"!==e&&"j"!==e)return a.value;if(0===r&&0===t)return 0;if(0===r)return 1===t?e:t.toString()+e;if(0===t)return r.toString();var n=t>0?"+":"";return r.toString()+n+(1===t?e:t.toString()+e)},t.CONVERT=function(r,t,e){if(r=o.parseNumber(r),r instanceof Error)return r;for(var n,u=[["a.u. of action","?",null,"action",!1,!1,1.05457168181818e-34],["a.u. of charge","e",null,"electric_charge",!1,!1,1.60217653141414e-19],["a.u. of energy","Eh",null,"energy",!1,!1,4.35974417757576e-18],["a.u. of length","a?",null,"length",!1,!1,5.29177210818182e-11],["a.u. of mass","m?",null,"mass",!1,!1,9.10938261616162e-31],["a.u. of time","?/Eh",null,"time",!1,!1,2.41888432650516e-17],["admiralty knot","admkn",null,"speed",!1,!0,.514773333],["ampere","A",null,"electric_current",!0,!1,1],["ampere per meter","A/m",null,"magnetic_field_intensity",!0,!1,1],["ångström","Å",["ang"],"length",!1,!0,1e-10],["are","ar",null,"area",!1,!0,100],["astronomical unit","ua",null,"length",!1,!1,1.49597870691667e-11],["bar","bar",null,"pressure",!1,!1,1e5],["barn","b",null,"area",!1,!1,1e-28],["becquerel","Bq",null,"radioactivity",!0,!1,1],["bit","bit",["b"],"information",!1,!0,1],["btu","BTU",["btu"],"energy",!1,!0,1055.05585262],["byte","byte",null,"information",!1,!0,8],["candela","cd",null,"luminous_intensity",!0,!1,1],["candela per square metre","cd/m?",null,"luminance",!0,!1,1],["coulomb","C",null,"electric_charge",!0,!1,1],["cubic ångström","ang3",["ang^3"],"volume",!1,!0,1e-30],["cubic foot","ft3",["ft^3"],"volume",!1,!0,.028316846592],["cubic inch","in3",["in^3"],"volume",!1,!0,16387064e-12],["cubic light-year","ly3",["ly^3"],"volume",!1,!0,8.46786664623715e-47],["cubic metre","m?",null,"volume",!0,!0,1],["cubic mile","mi3",["mi^3"],"volume",!1,!0,4168181825.44058],["cubic nautical mile","Nmi3",["Nmi^3"],"volume",!1,!0,6352182208],["cubic Pica","Pica3",["Picapt3","Pica^3","Picapt^3"],"volume",!1,!0,7.58660370370369e-8],["cubic yard","yd3",["yd^3"],"volume",!1,!0,.764554857984],["cup","cup",null,"volume",!1,!0,.0002365882365],["dalton","Da",["u"],"mass",!1,!1,1.66053886282828e-27],["day","d",["day"],"time",!1,!0,86400],["degree","°",null,"angle",!1,!1,.0174532925199433],["degrees Rankine","Rank",null,"temperature",!1,!0,.555555555555556],["dyne","dyn",["dy"],"force",!1,!0,1e-5],["electronvolt","eV",["ev"],"energy",!1,!0,1.60217656514141],["ell","ell",null,"length",!1,!0,1.143],["erg","erg",["e"],"energy",!1,!0,1e-7],["farad","F",null,"electric_capacitance",!0,!1,1],["fluid ounce","oz",null,"volume",!1,!0,295735295625e-16],["foot","ft",null,"length",!1,!0,.3048],["foot-pound","flb",null,"energy",!1,!0,1.3558179483314],["gal","Gal",null,"acceleration",!1,!1,.01],["gallon","gal",null,"volume",!1,!0,.003785411784],["gauss","G",["ga"],"magnetic_flux_density",!1,!0,1],["grain","grain",null,"mass",!1,!0,647989e-10],["gram","g",null,"mass",!1,!0,.001],["gray","Gy",null,"absorbed_dose",!0,!1,1],["gross registered ton","GRT",["regton"],"volume",!1,!0,2.8316846592],["hectare","ha",null,"area",!1,!0,1e4],["henry","H",null,"inductance",!0,!1,1],["hertz","Hz",null,"frequency",!0,!1,1],["horsepower","HP",["h"],"power",!1,!0,745.69987158227],["horsepower-hour","HPh",["hh","hph"],"energy",!1,!0,2684519.538],["hour","h",["hr"],"time",!1,!0,3600],["imperial gallon (U.K.)","uk_gal",null,"volume",!1,!0,.00454609],["imperial hundredweight","lcwt",["uk_cwt","hweight"],"mass",!1,!0,50.802345],["imperial quart (U.K)","uk_qt",null,"volume",!1,!0,.0011365225],["imperial ton","brton",["uk_ton","LTON"],"mass",!1,!0,1016.046909],["inch","in",null,"length",!1,!0,.0254],["international acre","uk_acre",null,"area",!1,!0,4046.8564224],["IT calorie","cal",null,"energy",!1,!0,4.1868],["joule","J",null,"energy",!0,!0,1],["katal","kat",null,"catalytic_activity",!0,!1,1],["kelvin","K",["kel"],"temperature",!0,!0,1],["kilogram","kg",null,"mass",!0,!0,1],["knot","kn",null,"speed",!1,!0,.514444444444444],["light-year","ly",null,"length",!1,!0,9460730472580800],["litre","L",["l","lt"],"volume",!1,!0,.001],["lumen","lm",null,"luminous_flux",!0,!1,1],["lux","lx",null,"illuminance",!0,!1,1],["maxwell","Mx",null,"magnetic_flux",!1,!1,1e-18],["measurement ton","MTON",null,"volume",!1,!0,1.13267386368],["meter per hour","m/h",["m/hr"],"speed",!1,!0,.00027777777777778],["meter per second","m/s",["m/sec"],"speed",!0,!0,1],["meter per second squared","m?s??",null,"acceleration",!0,!1,1],["parsec","pc",["parsec"],"length",!1,!0,0x6da012f958ee1c],["meter squared per second","m?/s",null,"kinematic_viscosity",!0,!1,1],["metre","m",null,"length",!0,!0,1],["miles per hour","mph",null,"speed",!1,!0,.44704],["millimetre of mercury","mmHg",null,"pressure",!1,!1,133.322],["minute","?",null,"angle",!1,!1,.000290888208665722],["minute","min",["mn"],"time",!1,!0,60],["modern teaspoon","tspm",null,"volume",!1,!0,5e-6],["mole","mol",null,"amount_of_substance",!0,!1,1],["morgen","Morgen",null,"area",!1,!0,2500],["n.u. of action","?",null,"action",!1,!1,1.05457168181818e-34],["n.u. of mass","m?",null,"mass",!1,!1,9.10938261616162e-31],["n.u. of speed","c?",null,"speed",!1,!1,299792458],["n.u. of time","?/(me?c??)",null,"time",!1,!1,1.28808866778687e-21],["nautical mile","M",["Nmi"],"length",!1,!0,1852],["newton","N",null,"force",!0,!0,1],["œrsted","Oe ",null,"magnetic_field_intensity",!1,!1,79.5774715459477],["ohm","Ω",null,"electric_resistance",!0,!1,1],["ounce mass","ozm",null,"mass",!1,!0,.028349523125],["pascal","Pa",null,"pressure",!0,!1,1],["pascal second","Pa?s",null,"dynamic_viscosity",!0,!1,1],["pferdestärke","PS",null,"power",!1,!0,735.49875],["phot","ph",null,"illuminance",!1,!1,1e-4],["pica (1/6 inch)","pica",null,"length",!1,!0,.00035277777777778],["pica (1/72 inch)","Pica",["Picapt"],"length",!1,!0,.00423333333333333],["poise","P",null,"dynamic_viscosity",!1,!1,.1],["pond","pond",null,"force",!1,!0,.00980665],["pound force","lbf",null,"force",!1,!0,4.4482216152605],["pound mass","lbm",null,"mass",!1,!0,.45359237],["quart","qt",null,"volume",!1,!0,.000946352946],["radian","rad",null,"angle",!0,!1,1],["second","?",null,"angle",!1,!1,484813681109536e-20],["second","s",["sec"],"time",!0,!0,1],["short hundredweight","cwt",["shweight"],"mass",!1,!0,45.359237],["siemens","S",null,"electrical_conductance",!0,!1,1],["sievert","Sv",null,"equivalent_dose",!0,!1,1],["slug","sg",null,"mass",!1,!0,14.59390294],["square ångström","ang2",["ang^2"],"area",!1,!0,1e-20],["square foot","ft2",["ft^2"],"area",!1,!0,.09290304],["square inch","in2",["in^2"],"area",!1,!0,64516e-8],["square light-year","ly2",["ly^2"],"area",!1,!0,8.95054210748189e31],["square meter","m?",null,"area",!0,!0,1],["square mile","mi2",["mi^2"],"area",!1,!0,2589988.110336],["square nautical mile","Nmi2",["Nmi^2"],"area",!1,!0,3429904],["square Pica","Pica2",["Picapt2","Pica^2","Picapt^2"],"area",!1,!0,1792111111111e-17],["square yard","yd2",["yd^2"],"area",!1,!0,.83612736],["statute mile","mi",null,"length",!1,!0,1609.344],["steradian","sr",null,"solid_angle",!0,!1,1],["stilb","sb",null,"luminance",!1,!1,1e-4],["stokes","St",null,"kinematic_viscosity",!1,!1,1e-4],["stone","stone",null,"mass",!1,!0,6.35029318],["tablespoon","tbs",null,"volume",!1,!0,147868e-10],["teaspoon","tsp",null,"volume",!1,!0,492892e-11],["tesla","T",null,"magnetic_flux_density",!0,!0,1],["thermodynamic calorie","c",null,"energy",!1,!0,4.184],["ton","ton",null,"mass",!1,!0,907.18474],["tonne","t",null,"mass",!1,!1,1e3],["U.K. pint","uk_pt",null,"volume",!1,!0,.00056826125],["U.S. bushel","bushel",null,"volume",!1,!0,.03523907],["U.S. oil barrel","barrel",null,"volume",!1,!0,.158987295],["U.S. pint","pt",["us_pt"],"volume",!1,!0,.000473176473],["U.S. survey mile","survey_mi",null,"length",!1,!0,1609.347219],["U.S. survey/statute acre","us_acre",null,"area",!1,!0,4046.87261],["volt","V",null,"voltage",!0,!1,1],["watt","W",null,"power",!0,!0,1],["watt-hour","Wh",["wh"],"energy",!1,!0,3600],["weber","Wb",null,"magnetic_flux",!0,!1,1],["yard","yd",null,"length",!1,!0,.9144],["year","yr",null,"time",!1,!0,31557600]],i={ +for(var a;e--;){if(a=t.parseNumber(r[e]),a===n.value)return a;r[e]=a}return r},t.parseMatrix=function(r){var e;if(!r||0===(e=r.length))return n.value;for(var a,u=0;u=e)return n;n++}},exports.CHISQ={},exports.CHISQ.DIST=function(r,t,e){return r=utils.parseNumber(r),t=utils.parseNumber(t),utils.anyIsError(r,t)?error.value:e?jStat.chisquare.cdf(r,t):jStat.chisquare.pdf(r,t)},exports.CHISQ.DIST.RT=function(r,t){return!r|!t?error.na:r<1||t>Math.pow(10,10)?error.num:"number"!=typeof r||"number"!=typeof t?error.value:1-jStat.chisquare.cdf(r,t)},exports.CHISQ.INV=function(r,t){return r=utils.parseNumber(r),t=utils.parseNumber(t),utils.anyIsError(r,t)?error.value:jStat.chisquare.inv(r,t)},exports.CHISQ.INV.RT=function(r,t){return!r|!t?error.na:r<0||r>1||t<1||t>Math.pow(10,10)?error.num:"number"!=typeof r||"number"!=typeof t?error.value:jStat.chisquare.inv(1-r,t)},exports.CHISQ.TEST=function(r,t){function e(r,t){var e=Math.exp(-.5*r);t%2===1&&(e*=Math.sqrt(2*r/f));for(var n=t;n>=2;)e=e*r/n,n-=2;for(var a=e,u=t;a>1e-10*e;)u+=2,a=a*r/u,e+=a;return 1-e}if(2!==arguments.length)return error.na;if(!(r instanceof Array&&t instanceof Array))return error.value;if(r.length!==t.length)return error.value;if(r[0]&&t[0]&&r[0].length!==t[0].length)return error.value;var n,a,u,i=r.length;for(a=0;a=!]/.test(criteria)||(criteria='=="'+criteria+'"');for(var matches=0,i=0;i=!]/.test(criteria)||(criteria='=="'+criteria+'"');for(var j=0;j1?error.num:jStat.centralF.inv(r,t,e)},exports.F.INV.RT=function(r,t,e){return 3!==arguments.length?error.na:r<0||r>1||t<1||t>Math.pow(10,10)||e<1||e>Math.pow(10,10)?error.num:"number"!=typeof r||"number"!=typeof t||"number"!=typeof e?error.value:jStat.centralF.inv(1-r,t,e)},exports.F.TEST=function(r,t){if(!r||!t)return error.na;if(!(r instanceof Array&&t instanceof Array))return error.na;if(r.length<2||t.length<2)return error.div0;var e=function(r,t){for(var e=0,n=0;nt[u-1]&&r[i]<=t[u]&&(a[u]+=1):u===n&&r[i]>t[n-1]&&(a[n]+=1)}return a},exports.GAMMA=function(r){return r=utils.parseNumber(r),r instanceof Error?r:0===r?error.num:parseInt(r,10)===r&&r<0?error.num:jStat.gammafn(r)},exports.GAMMA.DIST=function(r,t,e,n){return 4!==arguments.length?error.na:r<0||t<=0||e<=0?error.value:"number"!=typeof r||"number"!=typeof t||"number"!=typeof e?error.value:n?jStat.gamma.cdf(r,t,e,!0):jStat.gamma.pdf(r,t,e,!1)},exports.GAMMA.INV=function(r,t,e){return 3!==arguments.length?error.na:r<0||r>1||t<=0||e<=0?error.num:"number"!=typeof r||"number"!=typeof t||"number"!=typeof e?error.value:jStat.gamma.inv(r,t,e)},exports.GAMMALN=function(r){return r=utils.parseNumber(r),r instanceof Error?r:jStat.gammaln(r)},exports.GAMMALN.PRECISE=function(r){return 1!==arguments.length?error.na:r<=0?error.num:"number"!=typeof r?error.value:jStat.gammaln(r)},exports.GAUSS=function(r){return r=utils.parseNumber(r),r instanceof Error?r:jStat.normal.cdf(r,0,1)-.5},exports.GEOMEAN=function(){var r=utils.parseNumberArray(utils.flatten(arguments));return r instanceof Error?r:jStat.geomean(r)},exports.GROWTH=function(r,t,e,n){if(r=utils.parseNumberArray(r),r instanceof Error)return r;var a;if(void 0===t)for(t=[],a=1;a<=r.length;a++)t.push(a);if(void 0===e)for(e=[],a=1;a<=r.length;a++)e.push(a);if(t=utils.parseNumberArray(t),e=utils.parseNumberArray(e),utils.anyIsError(t,e))return error.value;void 0===n&&(n=!0);var u=r.length,i=0,o=0,s=0,l=0;for(a=0;au&&(u=n[t],a=[]),n[t]===u&&(a[a.length]=t);return a},exports.MODE.SNGL=function(){var r=utils.parseNumberArray(utils.flatten(arguments));return r instanceof Error?r:exports.MODE.MULT(r).sort(function(r,t){return r-t})[0]},exports.NEGBINOM={},exports.NEGBINOM.DIST=function(r,t,e,n){return r=utils.parseNumber(r),t=utils.parseNumber(t),e=utils.parseNumber(e),utils.anyIsError(r,t,e)?error.value:n?jStat.negbin.cdf(r,t,e):jStat.negbin.pdf(r,t,e)},exports.NORM={},exports.NORM.DIST=function(r,t,e,n){return r=utils.parseNumber(r),t=utils.parseNumber(t),e=utils.parseNumber(e),utils.anyIsError(r,t,e)?error.value:e<=0?error.num:n?jStat.normal.cdf(r,t,e):jStat.normal.pdf(r,t,e)},exports.NORM.INV=function(r,t,e){return r=utils.parseNumber(r),t=utils.parseNumber(t),e=utils.parseNumber(e),utils.anyIsError(r,t,e)?error.value:jStat.normal.inv(r,t,e)},exports.NORM.S={},exports.NORM.S.DIST=function(r,t){return r=utils.parseNumber(r),r instanceof Error?error.value:t?jStat.normal.cdf(r,0,1):jStat.normal.pdf(r,0,1)},exports.NORM.S.INV=function(r){return r=utils.parseNumber(r),r instanceof Error?error.value:jStat.normal.inv(r,0,1)},exports.PEARSON=function(r,t){if(t=utils.parseNumberArray(utils.flatten(t)),r=utils.parseNumberArray(utils.flatten(r)),utils.anyIsError(t,r))return error.value;for(var e=jStat.mean(r),n=jStat.mean(t),a=r.length,u=0,i=0,o=0,s=0;s1-1/(e+1))return error.num;var n=t*(e+1)-1,a=Math.floor(n);return utils.cleanFloat(n===a?r[n]:r[a]+(n-a)*(r[a+1]-r[a]))},exports.PERCENTILE.INC=function(r,t){if(r=utils.parseNumberArray(utils.flatten(r)),t=utils.parseNumber(t),utils.anyIsError(r,t))return error.value;r=r.sort(function(r,t){return r-t});var e=r.length,n=t*(e-1),a=Math.floor(n);return utils.cleanFloat(n===a?r[n]:r[a]+(n-a)*(r[a+1]-r[a]))},exports.PERCENTRANK={},exports.PERCENTRANK.EXC=function(r,t,e){if(e=void 0===e?3:e,r=utils.parseNumberArray(utils.flatten(r)),t=utils.parseNumber(t),e=utils.parseNumber(e),utils.anyIsError(r,t,e))return error.value;r=r.sort(function(r,t){return r-t});for(var n=misc.UNIQUE.apply(null,r),a=r.length,u=n.length,i=Math.pow(10,e),o=0,s=!1,l=0;!s&&l=n[l]&&(t=n[l]&&(t=0?t[r.indexOf(e)]:0;for(var a=r.sort(function(r,t){return r-t}),u=a.length,i=0,o=0;o=e&&a[o]<=n&&(i+=t[r.indexOf(a[o])]);return i},exports.QUARTILE={},exports.QUARTILE.EXC=function(r,t){if(r=utils.parseNumberArray(utils.flatten(r)),t=utils.parseNumber(t),utils.anyIsError(r,t))return error.value;switch(t){case 1:return exports.PERCENTILE.EXC(r,.25);case 2:return exports.PERCENTILE.EXC(r,.5);case 3:return exports.PERCENTILE.EXC(r,.75);default:return error.num}},exports.QUARTILE.INC=function(r,t){if(r=utils.parseNumberArray(utils.flatten(r)),t=utils.parseNumber(t),utils.anyIsError(r,t))return error.value;switch(t){case 1:return exports.PERCENTILE.INC(r,.25);case 2:return exports.PERCENTILE.INC(r,.5);case 3:return exports.PERCENTILE.INC(r,.75);default:return error.num}},exports.RANK={},exports.RANK.AVG=function(r,t,e){if(r=utils.parseNumber(r),t=utils.parseNumberArray(utils.flatten(t)),utils.anyIsError(r,t))return error.value;t=utils.flatten(t),e=e||!1;var n=e?function(r,t){return r-t}:function(r,t){return t-r};t=t.sort(n);for(var a=t.length,u=0,i=0;i1?(2*t.indexOf(r)+u+1)/2:t.indexOf(r)+1},exports.RANK.EQ=function(r,t,e){if(r=utils.parseNumber(r),t=utils.parseNumberArray(utils.flatten(t)),utils.anyIsError(r,t))return error.value;e=e||!1;var n=e?function(r,t){return r-t}:function(r,t){return t-r};return t=t.sort(n),t.indexOf(r)+1},exports.ROW=function(r,t){if(2!==arguments.length)return error.na;if(t<0)return error.num;if(!(r instanceof Array)||"number"!=typeof t)return error.value;if(0!==r.length)return jStat.row(r,t)},exports.ROWS=function(r){return 1!==arguments.length?error.na:r instanceof Array?0===r.length?0:jStat.rows(r):error.value},exports.RSQ=function(r,t){return r=utils.parseNumberArray(utils.flatten(r)),t=utils.parseNumberArray(utils.flatten(t)),utils.anyIsError(r,t)?error.value:Math.pow(exports.PEARSON(r,t),2)},exports.SKEW=function(){var r=utils.parseNumberArray(utils.flatten(arguments));if(r instanceof Error)return r;for(var t=jStat.mean(r),e=r.length,n=0,a=0;a1||t<1?error.num:utils.anyIsError(r,t)?error.value:Math.abs(jStat.studentt.inv(r/2,t))},exports.T.TEST=function(r,t){if(r=utils.parseNumberArray(utils.flatten(r)),t=utils.parseNumberArray(utils.flatten(t)),utils.anyIsError(r,t))return error.value;var e,n=jStat.mean(r),a=jStat.mean(t),u=0,i=0;for(e=0;e-1;)r[t]="TRUE";for(var e=0;(e=r.indexOf(!1))>-1;)r[e]="FALSE";return r.join("")},t.DBCS=function(){throw new Error("DBCS is not implemented")},t.DOLLAR=function(r,t){if(t=void 0===t?2:t,r=n.parseNumber(r),t=n.parseNumber(t),n.anyIsError(r,t))return a.value;var e="";return t<=0?(r=Math.round(r*Math.pow(10,t))/Math.pow(10,t),e="($0,0)"):t>0&&(e="($0,0."+new Array(t+1).join("0")+")"),u(r).format(e)},t.EXACT=function(r,t){return 2!==arguments.length?a.na:r===t},t.FIND=function(r,t,e){return arguments.length<2?a.na:(e=void 0===e?0:e,t?t.indexOf(r,e-1)+1:null)},t.FIXED=function(r,t,e){if(t=void 0===t?2:t,e=void 0!==e&&e,r=n.parseNumber(r),t=n.parseNumber(t),n.anyIsError(r,t))return a.value;var i=e?"0":"0,0";return t<=0?r=Math.round(r*Math.pow(10,t))/Math.pow(10,t):t>0&&(i+="."+new Array(t+1).join("0")),u(r).format(i)},t.HTML2TEXT=function(r){var t="";return r&&(r instanceof Array?r.forEach(function(r){""!==t&&(t+="\n"),t+=r.replace(/<(?:.|\n)*?>/gm,"")}):t=r.replace(/<(?:.|\n)*?>/gm,"")),t},t.LEFT=function(r,t){return t=void 0===t?1:t,t=n.parseNumber(t),t instanceof Error||"string"!=typeof r?a.value:r?r.substring(0,t):null},t.LEN=function(r){return 0===arguments.length?a.error:"string"==typeof r?r?r.length:0:r.length?r.length:a.value},t.LOWER=function(r){return"string"!=typeof r?a.value:r?r.toLowerCase():r},t.MID=function(r,t,e){if(t=n.parseNumber(t),e=n.parseNumber(e),n.anyIsError(t,e)||"string"!=typeof r)return e;var a=t-1,u=a+e;return r.substring(a,u)},t.NUMBERVALUE=function(r,t,e){return t="undefined"==typeof t?".":t,e="undefined"==typeof e?",":e,Number(r.replace(t,".").replace(e,""))},t.PRONETIC=function(){throw new Error("PRONETIC is not implemented")},t.PROPER=function(r){return void 0===r||0===r.length?a.value:(r===!0&&(r="TRUE"),r===!1&&(r="FALSE"),isNaN(r)&&"number"==typeof r?a.value:("number"==typeof r&&(r=""+r),r.replace(/\w\S*/g,function(r){return r.charAt(0).toUpperCase()+r.substr(1).toLowerCase()})))},t.REGEXEXTRACT=function(r,t){if(arguments.length<2)return a.na;var e=r.match(new RegExp(t));return e?e[e.length>1?e.length-1:0]:null},t.REGEXMATCH=function(r,t,e){if(arguments.length<2)return a.na;var n=r.match(new RegExp(t));return e?n:!!n},t.REGEXREPLACE=function(r,t,e){return arguments.length<3?a.na:r.replace(new RegExp(t),e)},t.REPLACE=function(r,t,e,u){return t=n.parseNumber(t),e=n.parseNumber(e),n.anyIsError(t,e)||"string"!=typeof r||"string"!=typeof u?a.value:r.substr(0,t-1)+u+r.substr(t-1+e)},t.REPT=function(r,t){return t=n.parseNumber(t),t instanceof Error?t:new Array(t+1).join(r)},t.RIGHT=function(r,t){return t=void 0===t?1:t,t=n.parseNumber(t),t instanceof Error?t:r?r.substring(r.length-t):a.na},t.SEARCH=function(r,t,e){var n;return"string"!=typeof r||"string"!=typeof t?a.value:(e=void 0===e?0:e,n=t.toLowerCase().indexOf(r.toLowerCase(),e-1)+1,0===n?a.value:n)},t.SPLIT=function(r,t){return r.split(t)},t.SUBSTITUTE=function(r,t,e,n){if(arguments.length<2)return a.na;if(!(r&&t&&e))return r;if(void 0===n)return r.replace(new RegExp(t,"g"),e);for(var u=0,i=0;r.indexOf(t,u)>0;)if(u=r.indexOf(t,u+1),i++,i===n)return r.substring(0,u)+e+r.substring(u+t.length)},t.T=function(r){return"string"==typeof r?r:""},t.TEXT=function(r,t){return r=n.parseNumber(r),n.anyIsError(r)?a.na:u(r).format(t)},t.TRIM=function(r){return"string"!=typeof r?a.value:r.replace(/ +/g," ").trim()},t.UNICHAR=t.CHAR,t.UNICODE=t.CODE,t.UPPER=function(r){return"string"!=typeof r?a.value:r.toUpperCase()},t.VALUE=function(r){if("string"!=typeof r)return a.value;var t=u().unformat(r);return void 0===t?0:t}},function(r,t,e){var n,a;(function(u){(function(){"use strict";function i(r){this._value=r}function o(r){var t,e="";for(t=0;t0?f=n+a+o(u-a.length):(i=+n<0?"-0":"0",t>0&&(i+="."),l=o(-1*u-1),s=(l+Math.abs(n)+a).substr(0,t),f=i+s),+u>0&&t>0&&(f+="."+o(t)),f}function l(r,t,e,n){var a,u,i=Math.pow(10,t);return r.toString().indexOf("e")>-1?(u=s(r,t),"-"===u.charAt(0)&&+u>=0&&(u=u.substr(1))):u=(e(r+"e+"+t)/i).toFixed(t),n&&(a=new RegExp("0{1,"+n+"}$"),u=u.replace(a,"")),u}function f(r,t,e){var n,a=t.replace(/\{[^\{\}]*\}/g,"");return n=a.indexOf("$")>-1?p(r,V[w].currency.symbol,t,e):a.indexOf("%")>-1?m(r,t,e):a.indexOf(":")>-1?E(r,t):N(r._value,t,e)}function c(r,t){var e,n,a,u,i,o=t,s=!1;if(t.indexOf(":")>-1)r._value=v(t);else if(t===D)r._value=0;else{for("."!==V[w].delimiters.decimal&&(t=t.replace(/\./g,"").replace(V[w].delimiters.decimal,".")),e=new RegExp("[^a-zA-Z]"+V[w].abbreviations.thousand+"(?:\\)|(\\"+V[w].currency.symbol+")?(?:\\))?)?$"),n=new RegExp("[^a-zA-Z]"+V[w].abbreviations.million+"(?:\\)|(\\"+V[w].currency.symbol+")?(?:\\))?)?$"),a=new RegExp("[^a-zA-Z]"+V[w].abbreviations.billion+"(?:\\)|(\\"+V[w].currency.symbol+")?(?:\\))?)?$"), +u=new RegExp("[^a-zA-Z]"+V[w].abbreviations.trillion+"(?:\\)|(\\"+V[w].currency.symbol+")?(?:\\))?)?$"),i=1;i-1?s=Math.pow(1024,i):t.indexOf(O[i])>-1&&(s=Math.pow(1e3,i));var l=t.replace(/[^0-9\.]+/g,"");""===l?r._value=NaN:(r._value=(s?s:1)*(o.match(e)?Math.pow(10,3):1)*(o.match(n)?Math.pow(10,6):1)*(o.match(a)?Math.pow(10,9):1)*(o.match(u)?Math.pow(10,12):1)*(t.indexOf("%")>-1?.01:1)*((t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1)*Number(l),r._value=s?Math.ceil(r._value):r._value)}return r._value}function p(r,t,e,n){var a,u,i=e,o=i.indexOf("$"),s=i.indexOf("("),l=i.indexOf("+"),f=i.indexOf("-"),c="",p="";if(i.indexOf("$")===-1?"infix"===V[w].currency.position?(p=t,V[w].currency.spaceSeparated&&(p=" "+p+" ")):V[w].currency.spaceSeparated&&(c=" "):i.indexOf(" $")>-1?(c=" ",i=i.replace(" $","")):i.indexOf("$ ")>-1?(c=" ",i=i.replace("$ ","")):i=i.replace("$",""),u=N(r._value,i,n,p),e.indexOf("$")===-1)switch(V[w].currency.position){case"postfix":u.indexOf(")")>-1?(u=u.split(""),u.splice(-1,0,c+t),u=u.join("")):u=u+c+t;break;case"infix":break;case"prefix":u.indexOf("(")>-1||u.indexOf("-")>-1?(u=u.split(""),a=Math.max(s,f)+1,u.splice(a,0,t+c),u=u.join("")):u=t+c+u;break;default:throw Error('Currency position should be among ["prefix", "infix", "postfix"]')}else o<=1?u.indexOf("(")>-1||u.indexOf("+")>-1||u.indexOf("-")>-1?(u=u.split(""),a=1,(o-1?(u=u.split(""),u.splice(-1,0,c+t),u=u.join("")):u=u+c+t;return u}function h(r,t,e,n){return p(r,t,e,n)}function m(r,t,e){var n,a="",u=100*r._value;return t.indexOf(" %")>-1?(a=" ",t=t.replace(" %","")):t=t.replace("%",""),n=N(u,t,e),n.indexOf(")")>-1?(n=n.split(""),n.splice(-1,0,a+"%"),n=n.join("")):n=n+a+"%",n}function E(r){var t=Math.floor(r._value/60/60),e=Math.floor((r._value-60*t*60)/60),n=Math.round(r._value-60*t*60-60*e);return t+":"+(e<10?"0"+e:e)+":"+(n<10?"0"+n:n)}function v(r){var t=r.split(":"),e=0;return 3===t.length?(e+=60*Number(t[0])*60,e+=60*Number(t[1]),e+=Number(t[2])):2===t.length&&(e+=60*Number(t[0]),e+=Number(t[1])),Number(e)}function g(r,t,e){var n,a,u,i=t[0],o=Math.abs(r);if(o>=e){for(n=1;n=a&&o-1?(A=!0,t=t.slice(1,-1)):t.indexOf("+")>-1&&(R=!0,t=t.replace(/\+/g,"")),t.indexOf("a")>-1&&(h=t.split(".")[0].match(/[0-9]+/g)||["0"],h=parseInt(h[0],10),T=t.indexOf("aK")>=0,$=t.indexOf("aM")>=0,C=t.indexOf("aB")>=0,L=t.indexOf("aT")>=0,_=T||$||C||L,t.indexOf(" a")>-1?(O=" ",t=t.replace(" a","")):t=t.replace("a",""),i=Math.floor(Math.log(F)/Math.LN10)+1,f=i%3,f=0===f?3:f,h&&0!==F&&(s=Math.floor(Math.log(F)/Math.LN10)+1-h,c=3*~~((Math.min(h,i)-f)/3),F/=Math.pow(10,c),t.indexOf(".")===-1&&h>3&&(t+="[.]",I=0===s?0:3*~~(s/3)-s,I=I<0?I+3:I,t+=o(I))),Math.floor(Math.log(Math.abs(r))/Math.LN10)+1!==h&&(F>=Math.pow(10,12)&&!_||L?(O+=V[w].abbreviations.trillion,r/=Math.pow(10,12)):F=Math.pow(10,9)&&!_||C?(O+=V[w].abbreviations.billion,r/=Math.pow(10,9)):F=Math.pow(10,6)&&!_||$?(O+=V[w].abbreviations.million,r/=Math.pow(10,6)):(F=Math.pow(10,3)&&!_||T)&&(O+=V[w].abbreviations.thousand,r/=Math.pow(10,3)))),M=0;M-1){t.indexOf(" "+a.marker)>-1&&(P=" "),t=t.replace(P+a.marker,""),u=g(r,a.suffixes,a.scale),r=u.value,P+=u.suffix;break}if(t.indexOf("o")>-1&&(t.indexOf(" o")>-1?(U=" ",t=t.replace(" o","")):t=t.replace("o",""),V[w].ordinal&&(U+=V[w].ordinal(r))),t.indexOf("[.]")>-1&&(S=!0,t=t.replace("[.]",".")),p=r.toString().split(".")[0],m=t.split(".")[1],N=t.indexOf(","),m){if(m.indexOf("*")!==-1?j=l(r,r.toString().split(".")[1].length,e):m.indexOf("[")>-1?(m=m.replace("]",""),m=m.split("["),j=l(r,m[0].length+m[1].length,e,m[1].length)):j=l(r,m.length,e),p=j.split(".")[0],j.split(".")[1].length){var X=n?O+n:V[w].delimiters.decimal;j=X+j.split(".")[1]}else j="";S&&0===Number(j.slice(1))&&(j="")}else p=l(r,0,e);return p.indexOf("-")>-1&&(p=p.slice(1),k=!0),p.length-1&&(p=p.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+V[w].delimiters.thousands)),0===t.indexOf(".")&&(p=""),d=t.indexOf("("),b=t.indexOf("-"),G=d0||"grunt"===u.title||"gulp"===u.title)&&!0}function y(r){var t=r.toString().split(".");return t.length<2?1:Math.pow(10,t[1].length)}function M(){var r=Array.prototype.slice.call(arguments);return r.reduce(function(r,t){var e=y(r),n=y(t);return e>n?e:n},-(1/0))}var A,R="1.9.3",S=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],O=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],T={general:{scale:1024,suffixes:O,marker:"bd"},binary:{scale:1024,suffixes:S,marker:"b"},decimal:{scale:1e3,suffixes:O,marker:"d"}},x=[T.general,T.binary,T.decimal],V={},$=V,w="en-US",D=null,C="0,0",L="0$",_="undefined"!=typeof r&&r.exports,P={delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(r){var t=r%10;return 1===~~(r%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$",position:"prefix"},defaults:{currencyFormat:",0000 a"},formats:{fourDigits:"0000 a",fullWithTwoDecimals:"$ ,0.00",fullWithTwoDecimalsNoCurrency:",0.00"}};A=function(r){return A.isNumbro(r)?r=r.value():0===r||"undefined"==typeof r?r=0:Number(r)||(r=A.fn.unformat(r)),new i(Number(r))},A.version=R,A.isNumbro=function(r){return r instanceof i},A.setLanguage=function(r,t){console.warn("`setLanguage` is deprecated since version 1.6.0. Use `setCulture` instead");var e=r,n=r.split("-")[0],a=null;$[e]||(Object.keys($).forEach(function(r){a||r.split("-")[0]!==n||(a=r)}),e=a||t||"en-US"),I(e)},A.setCulture=function(r,t){var e=r,n=r.split("-")[1],a=null;V[e]||(n&&Object.keys(V).forEach(function(r){a||r.split("-")[1]!==n||(a=r)}),e=a||t||"en-US"),I(e)},A.language=function(r,t){if(console.warn("`language` is deprecated since version 1.6.0. Use `culture` instead"),!r)return w;if(r&&!t){if(!$[r])throw new Error("Unknown language : "+r);I(r)}return!t&&$[r]||d(r,t),A},A.culture=function(r,t){if(!r)return w;if(r&&!t){if(!V[r])throw new Error("Unknown culture : "+r);I(r)}return!t&&V[r]||d(r,t),A},A.languageData=function(r){if(console.warn("`languageData` is deprecated since version 1.6.0. Use `cultureData` instead"),!r)return $[w];if(!$[r])throw new Error("Unknown language : "+r);return $[r]},A.cultureData=function(r){if(!r)return V[w];if(!V[r])throw new Error("Unknown culture : "+r);return V[r]},A.culture("en-US",P),A.languages=function(){return console.warn("`languages` is deprecated since version 1.6.0. Use `cultures` instead"),$},A.cultures=function(){return V},A.zeroFormat=function(r){D="string"==typeof r?r:null},A.defaultFormat=function(r){C="string"==typeof r?r:"0.0"},A.defaultCurrencyFormat=function(r){L="string"==typeof r?r:"0$"},A.validate=function(r,t){var e,n,a,u,i,o,s,l;if("string"!=typeof r&&(r+="",console.warn&&console.warn("Numbro.js: Value is not string. It has been co-erced to: ",r)),r=r.trim(),r=r.replace(/^[+-]?/,""),r.match(/^\d+$/))return!0;if(""===r)return!1;try{s=A.cultureData(t)}catch(r){s=A.cultureData(A.culture())}return a=s.currency.symbol,i=s.abbreviations,e=s.delimiters.decimal,n="."===s.delimiters.thousands?"\\.":s.delimiters.thousands,l=r.match(/^[^\d\.\,]+/),(null===l||(r=r.substr(1),l[0]===a))&&(l=r.match(/[^\d]+$/),(null===l||(r=r.slice(0,-1),l[0]===i.thousand||l[0]===i.million||l[0]===i.billion||l[0]===i.trillion))&&(o=new RegExp(n+"{2}"),!r.match(/[^\d.,]/g)&&(u=r.split(e),!(u.length>2)&&(u.length<2?!!u[0].match(/^\d+.*\d$/)&&!u[0].match(o):""===u[0]?!u[0].match(o)&&!!u[1].match(/^\d+$/):1===u[0].length?!!u[0].match(/^\d+$/)&&!u[0].match(o)&&!!u[1].match(/^\d+$/):!!u[0].match(/^\d+.*\d$/)&&!u[0].match(o)&&!!u[1].match(/^\d+$/)))))},A.loadLanguagesInNode=function(){console.warn("`loadLanguagesInNode` is deprecated since version 1.6.0. Use `loadCulturesInNode` instead"),A.loadCulturesInNode()},A.loadCulturesInNode=function(){var r=e(21);for(var t in r)t&&A.culture(t,r[t])},"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(r,t){if(null===this||"undefined"==typeof this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof r)throw new TypeError(r+" is not a function");var e,n,a=this.length>>>0,u=!1;for(1e;++e)this.hasOwnProperty(e)&&(u?n=r(n,this[e],e,this):(n=this[e],u=!0));if(!u)throw new TypeError("Reduce of empty array with no initial value");return n}),A.fn=i.prototype={clone:function(){return A(this)},format:function(r,t){return f(this,r?r:C,void 0!==t?t:Math.round)},formatCurrency:function(r,t){return p(this,V[w].currency.symbol,r?r:L,void 0!==t?t:Math.round)},formatForeignCurrency:function(r,t,e){return h(this,r,t?t:L,void 0!==e?e:Math.round)},unformat:function(r){if("number"==typeof r)return r;if("string"==typeof r){var t=c(this,r);return isNaN(t)?void 0:t}},binaryByteUnits:function(){return g(this._value,T.binary.suffixes,T.binary.scale).suffix},byteUnits:function(){return g(this._value,T.general.suffixes,T.general.scale).suffix},decimalByteUnits:function(){return g(this._value,T.decimal.suffixes,T.decimal.scale).suffix},value:function(){return this._value},valueOf:function(){return this._value},set:function(r){return this._value=Number(r),this},add:function(r){function t(r,t){return r+e*t}var e=M.call(null,this._value,r);return this._value=[this._value,r].reduce(t,0)/e,this},subtract:function(r){function t(r,t){return r-e*t}var e=M.call(null,this._value,r);return this._value=[r].reduce(t,this._value*e)/e,this},multiply:function(r){function t(r,t){var e=M(r,t),n=r*e;return n*=t*e,n/=e*e}return this._value=[this._value,r].reduce(t,1),this},divide:function(r){function t(r,t){var e=M(r,t);return r*e/(t*e)}return this._value=[this._value,r].reduce(t),this},difference:function(r){return Math.abs(A(this._value).subtract(r).value())}},b()&&A.loadCulturesInNode(),_?r.exports=A:("undefined"==typeof ender&&(this.numbro=A),n=[],a=function(){return A}.apply(t,n),!(void 0!==a&&(r.exports=a)))}).call("undefined"==typeof window?this:window)}).call(t,e(20))},function(r,t){function e(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function a(r){if(f===setTimeout)return setTimeout(r,0);if((f===e||!f)&&setTimeout)return f=setTimeout,setTimeout(r,0);try{return f(r,0)}catch(t){try{return f.call(null,r,0)}catch(t){return f.call(this,r,0)}}}function u(r){if(c===clearTimeout)return clearTimeout(r);if((c===n||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(r);try{return c(r)}catch(t){try{return c.call(null,r)}catch(t){return c.call(this,r)}}}function i(){E&&h&&(E=!1,h.length?m=h.concat(m):v=-1,m.length&&o())}function o(){if(!E){var r=a(i);E=!0;for(var t=m.length;t;){for(h=m,m=[];++v1)for(var e=1;ee?t:e;return r.pow(10,17-~~(r.log(n>0?n:-n)*r.LOG10E))}function n(r){return"[object Function]"===h.call(r)}function a(r){return"number"==typeof r&&r===r}function u(r){return c.apply([],r)}function o(){return new o._init(arguments)}function s(){return 0}function l(){return 1}function f(r,t){return r===t?1:0}var c=Array.prototype.concat,p=Array.prototype.slice,h=Object.prototype.toString,m=Array.isArray||function(r){return"[object Array]"===h.call(r)};o.fn=o.prototype,o._init=function(r){var t;if(m(r[0]))if(m(r[0][0])){n(r[1])&&(r[0]=o.map(r[0],r[1]));for(var t=0;t=0;t--,n++)e[n]=[r[n][t]];return e},o.transpose=function(r){var t,e,n,a,u,i=[];m(r[0])||(r=[r]),e=r.length,n=r[0].length;for(var u=0;u0&&(i[n][0]=r[n][0]),o=1;oe&&n>0)return[];if(n>0)for(i=r;ie;i+=n)a.push(i);return a},o.slice=function(){function r(r,e,n,a){var u,i=[],s=r.length;if(e===t&&n===t&&a===t)return o.copy(r);if(e=e||0,n=n||r.length,e=e>=0?e:s+e,n=n>=0?n:s+n,a=a||1,e===n||0===a)return[];if(en&&a>0)return[];if(a>0)for(u=e;un;u+=a)i.push(r[u]);return i}function e(t,e){if(e=e||{},a(e.row)){if(a(e.col))return t[e.row][e.col];var n=o.rowa(t,e.row),u=e.col||{};return r(n,u.start,u.end,u.step)}if(a(e.col)){var i=o.cola(t,e.col),s=e.row||{};return r(i,s.start,s.end,s.step)}var s=e.row||{},u=e.col||{},l=r(t,s.start,s.end,s.step);return l.map(function(t){return r(t,u.start,u.end,u.step)})}return e}(),o.sliceAssign=function(e,n,u){if(a(n.row)){if(a(n.col))return e[n.row][n.col]=u;n.col=n.col||{},n.col.start=n.col.start||0,n.col.end=n.col.end||e[0].length,n.col.step=n.col.step||1;var i=o.arange(n.col.start,r.min(e.length,n.col.end),n.col.step),s=n.row;return i.forEach(function(r,t){e[s][r]=u[t]}),e}if(a(n.col)){n.row=n.row||{},n.row.start=n.row.start||0,n.row.end=n.row.end||e.length,n.row.step=n.row.step||1;var l=o.arange(n.row.start,r.min(e[0].length,n.row.end),n.row.step),f=n.col;return l.forEach(function(r,t){e[r][f]=u[t]}),e}u[0].length===t&&(u=[u]),n.row.start=n.row.start||0,n.row.end=n.row.end||e.length,n.row.step=n.row.step||1,n.col.start=n.col.start||0,n.col.end=n.col.end||e[0].length,n.col.step=n.col.step||1;var l=o.arange(n.row.start,r.min(e.length,n.row.end),n.row.step),i=o.arange(n.col.start,r.min(e[0].length,n.col.end),n.col.step);return l.forEach(function(r,t){i.forEach(function(n,a){e[r][n]=u[t][a]})}),e},o.diagonal=function(r){var t=o.zeros(r.length,r.length);return r.forEach(function(r,e){t[e][e]=r}),t},o.copy=function(r){return r.map(function(r){return a(r)?r:r.map(function(r){return r})})};var E=o.prototype;return E.length=0,E.push=Array.prototype.push,E.sort=Array.prototype.sort,E.splice=Array.prototype.splice,E.slice=Array.prototype.slice,E.toArray=function(){return this.length>1?p.call(this):p.call(this)[0]},E.map=function(r,t){return o(o.map(this,r,t))},E.cumreduce=function(r,t){return o(o.cumreduce(this,r,t))},E.alter=function(r){return o.alter(this,r),this},function(r){for(var t=0;t=0;)r+=t[e];return r},r.sumsqrd=function(r){for(var t=0,e=r.length;--e>=0;)t+=r[e]*r[e];return t},r.sumsqerr=function(t){for(var e,n=r.mean(t),a=0,u=t.length;--u>=0;)e=t[u]-n,a+=e*e;return a},r.sumrow=function(r){for(var t=0,e=r.length;--e>=0;)t+=r[e];return t},r.product=function(r){for(var t=1,e=r.length;--e>=0;)t*=r[e];return t},r.min=function(r){for(var t=r[0],e=0;++et&&(t=r[e]);return t},r.unique=function(r){for(var t={},e=[],n=0;ni?(s=[a[t]],i=u,o=0):u===i&&(s.push(a[t]),o++),u=1);return 0===o?s[0]:s},r.range=function(t){return r.max(t)-r.min(t)},r.variance=function(t,e){return r.sumsqerr(t)/(t.length-(e?1:0))},r.deviation=function(t){for(var e=r.mean(t),n=t.length,a=new Array(n),u=0;u=0;n--)a+=t.abs(e[n]-u);return a/e.length},r.meddev=function(e){for(var n,a=0,u=r.median(e),n=e.length-1;n>=0;n--)a+=t.abs(e[n]-u);return a/e.length},r.coeffvar=function(t){return r.stdev(t)/r.mean(t)},r.quartiles=function(r){var n=r.length,a=r.slice().sort(e);return[a[t.round(n/4)-1],a[t.round(n/2)-1],a[t.round(3*n/4)-1]]},r.quantiles=function(r,a,u,i){var o,s,l,f,c,p,h=r.slice().sort(e),m=[a.length],E=r.length;"undefined"==typeof u&&(u=3/8),"undefined"==typeof i&&(i=3/8);for(var o=0;o1){for(s=e===!0?this:this.transpose();o1){for("sumrow"!==t&&(s=e===!0?this:this.transpose());o1){for(i=i.transpose();np)for(var e=0;e=1?e:1/e)+.4*e+17);if(n<0||e<=0)return NaN;if(n170||n>170?t.exp(r.combinationln(e,n)):r.factorial(e)/r.factorial(n)/r.factorial(e-n)},r.combinationln=function(t,e){return r.factorialln(t)-r.factorialln(e)-r.factorialln(t-e)},r.permutation=function(t,e){return r.factorial(t)/r.factorial(t-e)},r.betafn=function(e,n){if(!(e<=0||n<=0))return e+n>170?t.exp(r.betaln(e,n)):r.gammafn(e)*r.gammafn(n)/r.gammafn(e+n)},r.betaln=function(t,e){return r.gammaln(t)+r.gammaln(e)-r.gammaln(t+e)},r.betacf=function(r,e,n){var a,u,i,o,s=1e-30,l=1,f=e+n,c=e+1,p=e-1,h=1,m=1-f*r/c;for(t.abs(m)=1)return t.max(100,n+100*t.sqrt(n));if(e<=0)return 0;for(n>1?(l=t.log(p),f=t.exp(p*(l-1)-m),s=e<.5?e:1-e,i=t.sqrt(-2*t.log(s)),a=(2.30753+.27061*i)/(1+i*(.99229+.04481*i))-i,e<.5&&(a=-a),a=t.max(.001,n*t.pow(1-1/(9*n)-a/(3*t.sqrt(n)),3))):(i=1-n*(.253+.12*n),a=e1?f*t.exp(-(a-p)+p*(t.log(a)-l)):t.exp(-a+p*t.log(a)-m),o=u/i,a-=i=o/(1-.5*t.min(1,o*((n-1)/a-1))),a<=0&&(a=.5*(a+i)),t.abs(i)0;o--)a=l,l=n*l-f+i[o],f=a;return u=e*t.exp(-r*r+.5*(i[0]+n*l)-f),s?u-1:1-u},r.erfc=function(t){return 1-r.erf(t)},r.erfcinv=function(e){var n,a,u,i,o=0;if(e>=2)return-100;if(e<=0)return 100;for(i=e<1?e:2-e,u=t.sqrt(-2*t.log(i/2)),n=-.70711*((2.30753+.27061*u)/(1+u*(.99229+.04481*u))-u);o<2;o++)a=r.erfc(n)-i,n+=a/(1.1283791670955126*t.exp(-n*n)-n*a);return e<1?n:-n},r.ibetainv=function(e,n,a){var u,i,o,s,l,f,c,p,h,m,E,v=1e-8,g=n-1,N=a-1,d=0;if(e<=0)return 0;if(e>=1)return 1;for(n>=1&&a>=1?(o=e<.5?e:1-e,s=t.sqrt(-2*t.log(o)),c=(2.30753+.27061*s)/(1+s*(.99229+.04481*s))-s,e<.5&&(c=-c),p=(c*c-3)/6,h=2/(1/(2*n-1)+1/(2*a-1)),m=c*t.sqrt(p+h)/h-(1/(2*a-1)-1/(2*n-1))*(p+5/6-2/(3*h)),c=n/(n+a*t.exp(2*m))):(u=t.log(n/(n+a)),i=t.log(a/(n+a)),s=t.exp(n*u)/n,l=t.exp(a*i)/a,m=s+l,c=e=1&&(c=.5*(c+s+1)),t.abs(s)0)break}return c},r.ibeta=function(e,n,a){var u=0===e||1===e?0:t.exp(r.gammaln(n+a)-r.gammaln(n)-r.gammaln(a)+n*t.log(e)+a*t.log(1-e));return!(e<0||e>1)&&(e<(n+1)/(n+a+2)?u*r.betacf(e,n,a)/n:1-u*r.betacf(1-e,a,n)/a)},r.randn=function(e,n){var a,u,i,o,s;if(n||(n=e),e)return r.create(e,n,function(){return r.randn()});do a=t.random(),u=1.7156*(t.random()-.5),i=a-.449871,o=t.abs(u)+.386595,s=i*i+o*(.196*o-.25472*i);while(s>.27597&&(s>.27846||u*u>-4*t.log(a)*a*a));return u/a},r.randg=function(e,n,a){var u,i,o,s,l,f,c=e;if(a||(a=n),e||(e=1),n)return f=r.zeros(n,a),f.alter(function(){return r.randg(e)}),f;e<1&&(e+=1),u=e-1/3,i=1/t.sqrt(9*u);do{do l=r.randn(),s=1+i*l;while(s<=0);s=s*s*s,o=t.random()}while(o>1-.331*t.pow(l,4)&&t.log(o)>.5*l*l+u*(1-s+t.log(s)));if(e==c)return u*s;do o=t.random();while(0===o);return t.pow(o,1/c)*u*s},function(t){for(var e=0;e1||e<0?0:1==n&&1==a?1:n<512&&a<512?t.pow(e,n-1)*t.pow(1-e,a-1)/r.betafn(n,a):t.exp((n-1)*t.log(e)+(a-1)*t.log(1-e)-r.betaln(n,a))},cdf:function(t,e,n){return t>1||t<0?1*(t>1):r.ibeta(t,e,n)},inv:function(t,e,n){return r.ibetainv(t,e,n)},mean:function(r,t){return r/(r+t)},median:function(t,e){return r.ibetainv(.5,t,e)},mode:function(r,t){return(r-1)/(r+t-2)},sample:function(t,e){var n=r.randg(t);return n/(n+r.randg(e))},variance:function(r,e){return r*e/(t.pow(r+e,2)*(r+e+1))}}),r.extend(r.centralF,{pdf:function(e,n,a){var u,i,o;return e<0?0:n<=2?0===e&&n<2?1/0:0===e&&2===n?1:t.sqrt(t.pow(n*e,n)*t.pow(a,a)/t.pow(n*e+a,n+a))/(e*r.betafn(n/2,a/2)):(u=n*e/(a+e*n),i=a/(a+e*n),o=n*i/2,o*r.binomial.pdf((n-2)/2,(n+a-2)/2,u))},cdf:function(t,e,n){return t<0?0:r.ibeta(e*t/(e*t+n),e/2,n/2)},inv:function(t,e,n){return n/(e*(1/r.ibetainv(t,e/2,n/2)-1))},mean:function(r,t){return t>2?t/(t-2):void 0; +},mode:function(r,t){return r>2?t*(r-2)/(r*(t+2)):void 0},sample:function(t,e){var n=2*r.randg(t/2),a=2*r.randg(e/2);return n/t/(a/e)},variance:function(r,t){if(!(t<=4))return 2*t*t*(r+t-2)/(r*(t-2)*(t-2)*(t-4))}}),r.extend(r.cauchy,{pdf:function(r,e,n){return n<0?0:n/(t.pow(r-e,2)+t.pow(n,2))/t.PI},cdf:function(r,e,n){return t.atan((r-e)/n)/t.PI+.5},inv:function(r,e,n){return e+n*t.tan(t.PI*(r-.5))},median:function(r,t){return r},mode:function(r,t){return r},sample:function(e,n){return r.randn()*t.sqrt(1/(2*r.randg(.5)))*n+e}}),r.extend(r.chisquare,{pdf:function(e,n){return e<0?0:0===e&&2===n?.5:t.exp((n/2-1)*t.log(e)-e/2-n/2*t.log(2)-r.gammaln(n/2))},cdf:function(t,e){return t<0?0:r.lowRegGamma(e/2,t/2)},inv:function(t,e){return 2*r.gammapinv(t,.5*e)},mean:function(r){return r},median:function(r){return r*t.pow(1-2/(9*r),3)},mode:function(r){return r-2>0?r-2:0},sample:function(t){return 2*r.randg(t/2)},variance:function(r){return 2*r}}),r.extend(r.exponential,{pdf:function(r,e){return r<0?0:e*t.exp(-e*r)},cdf:function(r,e){return r<0?0:1-t.exp(-e*r)},inv:function(r,e){return-t.log(1-r)/e},mean:function(r){return 1/r},median:function(r){return 1/r*t.log(2)},mode:function(r){return 0},sample:function(r){return-1/r*t.log(t.random())},variance:function(r){return t.pow(r,-2)}}),r.extend(r.gamma,{pdf:function(e,n,a){return e<0?0:0===e&&1===n?1/a:t.exp((n-1)*t.log(e)-e/a-r.gammaln(n)-n*t.log(a))},cdf:function(t,e,n){return t<0?0:r.lowRegGamma(e,t/n)},inv:function(t,e,n){return r.gammapinv(t,e)*n},mean:function(r,t){return r*t},mode:function(r,t){if(r>1)return(r-1)*t},sample:function(t,e){return r.randg(t)*e},variance:function(r,t){return r*t*t}}),r.extend(r.invgamma,{pdf:function(e,n,a){return e<=0?0:t.exp(-(n+1)*t.log(e)-a/e-r.gammaln(n)+n*t.log(a))},cdf:function(t,e,n){return t<=0?0:1-r.lowRegGamma(e,n/t)},inv:function(t,e,n){return n/r.gammapinv(1-t,e)},mean:function(r,t){return r>1?t/(r-1):void 0},mode:function(r,t){return t/(r+1)},sample:function(t,e){return e/r.randg(t)},variance:function(r,t){if(!(r<=2))return t*t/((r-1)*(r-1)*(r-2))}}),r.extend(r.kumaraswamy,{pdf:function(r,e,n){return 0===r&&1===e?n:1===r&&1===n?e:t.exp(t.log(e)+t.log(n)+(e-1)*t.log(r)+(n-1)*t.log(1-t.pow(r,e)))},cdf:function(r,e,n){return r<0?0:r>1?1:1-t.pow(1-t.pow(r,e),n)},inv:function(r,e,n){return t.pow(1-t.pow(1-r,1/n),1/e)},mean:function(t,e){return e*r.gammafn(1+1/t)*r.gammafn(e)/r.gammafn(1+1/t+e)},median:function(r,e){return t.pow(1-t.pow(2,-1/e),1/r)},mode:function(r,e){if(r>=1&&e>=1&&1!==r&&1!==e)return t.pow((r-1)/(r*e-1),1/r)},variance:function(r,t){throw new Error("variance not yet implemented")}}),r.extend(r.lognormal,{pdf:function(r,e,n){return r<=0?0:t.exp(-t.log(r)-.5*t.log(2*t.PI)-t.log(n)-t.pow(t.log(r)-e,2)/(2*n*n))},cdf:function(e,n,a){return e<0?0:.5+.5*r.erf((t.log(e)-n)/t.sqrt(2*a*a))},inv:function(e,n,a){return t.exp(-1.4142135623730951*a*r.erfcinv(2*e)+n)},mean:function(r,e){return t.exp(r+e*e/2)},median:function(r,e){return t.exp(r)},mode:function(r,e){return t.exp(r-e*e)},sample:function(e,n){return t.exp(r.randn()*n+e)},variance:function(r,e){return(t.exp(e*e)-1)*t.exp(2*r+e*e)}}),r.extend(r.noncentralt,{pdf:function(e,n,a){var u=1e-14;return t.abs(a)u||l>u;)f=l,p>0&&(h*=a*a/(2*p),m*=a*a/(2*(p+.5))),l=h*r.beta.cdf(c,p+.5,n/2)+m*r.beta.cdf(c,p+1,n/2),s+=.5*l,p++;return o?1-s:s}}),r.extend(r.normal,{pdf:function(r,e,n){return t.exp(-.5*t.log(2*t.PI)-t.log(n)-t.pow(r-e,2)/(2*n*n))},cdf:function(e,n,a){return.5*(1+r.erf((e-n)/t.sqrt(2*a*a)))},inv:function(t,e,n){return-1.4142135623730951*n*r.erfcinv(2*t)+e},mean:function(r,t){return r},median:function(r,t){return r},mode:function(r,t){return r},sample:function(t,e){return r.randn()*e+t},variance:function(r,t){return t*t}}),r.extend(r.pareto,{pdf:function(r,e,n){return r1e100?1e100:n,1/(t.sqrt(n)*r.betafn(.5,n/2))*t.pow(1+e*e/n,-((n+1)/2))},cdf:function(e,n){var a=n/2;return r.ibeta((e+t.sqrt(e*e+n))/(2*t.sqrt(e*e+n)),a,a)},inv:function(e,n){var a=r.ibetainv(2*t.min(e,1-e),.5*n,.5);return a=t.sqrt(n*(1-a)/a),e>.5?a:-a},mean:function(r){return r>1?0:void 0},median:function(r){return 0},mode:function(r){return 0},sample:function(e){return r.randn()*t.sqrt(e/(2*r.randg(e/2)))},variance:function(r){return r>2?r/(r-2):r>1?1/0:void 0}}),r.extend(r.weibull,{pdf:function(r,e,n){return r<0||e<0||n<0?0:n/e*t.pow(r/e,n-1)*t.exp(-t.pow(r/e,n))},cdf:function(r,e,n){return r<0?0:1-t.exp(-t.pow(r/e,n))},inv:function(r,e,n){return e*t.pow(-t.log(1-r),1/n)},mean:function(t,e){return t*r.gammafn(1+1/e)},median:function(r,e){return r*t.pow(t.log(2),1/e)},mode:function(r,e){return e<=1?0:r*t.pow((e-1)/e,1/e)},sample:function(r,e){return r*t.pow(-t.log(t.random()),1/e)},variance:function(e,n){return e*e*r.gammafn(1+2/n)-t.pow(r.weibull.mean(e,n),2)}}),r.extend(r.uniform,{pdf:function(r,t,e){return re?0:1/(e-t)},cdf:function(r,t,e){return r>>0&&(e<0?0:r.combination(e+n-1,n-1)*t.pow(1-a,e)*t.pow(a,n))},cdf:function(t,e,n){var a=0,u=0;if(t<0)return 0;for(;u<=t;u++)a+=r.negbin.pdf(u,e,n);return a}}),r.extend(r.hypgeom,{pdf:function(e,n,a,u){if(e!==e|0)return!1;if(e<0||eu||e>a)return 0;if(2*a>n)return 2*u>n?r.hypgeom.pdf(n-a-u+e,n,n-a,n-u):r.hypgeom.pdf(u-e,n,n-a,u);if(2*u>n)return r.hypgeom.pdf(a-e,n,a,n-u);if(a1&&o=u||e>=a)return 1;if(2*a>n)return 2*u>n?r.hypgeom.cdf(n-a-u+e,n,n-a,n-u):1-r.hypgeom.cdf(u-e-1,n,n-a,u);if(2*u>n)return 1-r.hypgeom.cdf(a-e-1,n,a,n-u);if(a1&&sa);return n-1}}),r.extend(r.triangular,{pdf:function(r,t,e,n){return e<=t||ne?NaN:re?0:rn?NaN:r<=e?0:r>=n?1:r<=a?t.pow(r-e,2)/((n-e)*(a-e)):1-t.pow(n-r,2)/((n-e)*(n-a))},inv:function(r,e,n,a){return n<=e||an?NaN:r<=(a-e)/(n-e)?e+(n-e)*t.sqrt(r*((a-e)/(n-e))):e+(n-e)*(1-t.sqrt((1-r)*(1-(a-e)/(n-e))))},mean:function(r,t,e){return(r+t+e)/3},median:function(r,e,n){return n<=(r+e)/2?e-t.sqrt((e-r)*(e-n))/t.sqrt(2):n>(r+e)/2?r+t.sqrt((e-r)*(n-r))/t.sqrt(2):void 0},mode:function(r,t,e){return e},sample:function(r,e,n){var a=t.random();return a<(n-r)/(e-r)?r+t.sqrt(a*(e-r)*(n-r)):e-t.sqrt((1-a)*(e-r)*(e-n))},variance:function(r,t,e){return(r*r+t*t+e*e-r*t-r*e-t*e)/18}}),r.extend(r.laplace,{pdf:function(r,e,n){return n<=0?0:t.exp(-t.abs(r-e)/n)/(2*n)},cdf:function(r,e,n){return n<=0?0:r=0;s--){for(h=0,l=s+1;l<=f-1;l++)h+=m[l]*e[s][l];m[s]=(e[s][a-1]-h)/e[s][s]}return m},gauss_jordan:function(e,n){for(var a=r.aug(e,n),u=a.length,i=a[0].length,o=0;ot.abs(a[s][o])&&(s=l);var f=a[o];a[o]=a[s],a[s]=f;for(var l=o+1;l=0;o--){c=a[o][o];for(var l=0;lo-1;p--)a[l][p]-=a[o][p]*a[l][o]/c;a[o][o]/=c;for(var p=u;pc?(h[f][c]=e[f][c],m[f][c]=E[f][c]=0):fu;)i=l,l=r.add(r.multiply(s,i),o),f++;return l},gauss_seidel:function(e,n,a,u){for(var i,o,s,l,f,c=0,p=e.length,h=[],m=[],E=[];ci?(h[c][i]=e[c][i],m[c][i]=E[c][i]=0):cu;)o=f,f=r.add(r.multiply(l,o),s),c+=1;return f},SOR:function(e,n,a,u,i){for(var o,s,l,f,c,p=0,h=e.length,m=[],E=[],v=[];po?(m[p][o]=e[p][o],E[p][o]=v[p][o]=0):pu;)s=c,c=r.add(r.multiply(f,s),l),p++;return c},householder:function(e){for(var n,a,u,i,o,s=e.length,l=e[0].length,f=0,c=[],p=[];f0?-1:1,n=o*t.sqrt(n),a=t.sqrt((n*n-e[f+1][f]*n)/2),c=r.zeros(s,1),c[f+1][0]=(e[f+1][f]-n)/(2*a),u=f+2;u0?t.PI/4:-t.PI/4:t.atan(2*e[i][o]/(e[i][i]-e[o][o]))/2,f=r.identity(h,h),f[i][i]=t.cos(l),f[i][o]=-t.sin(l),f[o][i]=t.sin(l),f[o][o]=t.cos(l),m=r.multiply(m,f),n=r.multiply(r.multiply(r.inv(f),e),f),e=n,c=0;for(var a=1;a.001&&(c=1)}for(var a=0;a=c;)i=u(r,n+a),o=u(r,n),h[p]=(e[i]-2*e[o]+e[2*o-i])/(a*a),a/=2,p++;for(l=h.length,s=1;1!=l;){for(f=0;fn);a++);return a-=1,e[a]+(n-t[a])*p[a]+r.sq(n-t[a])*f[a]+(n-t[a])*r.sq(n-t[a])*h[a]},gauss_quadrature:function(){throw new Error("gauss_quadrature not yet implemented")},PCA:function(t){for(var e,n,a=t.length,u=t[0].length,i=0,o=[],s=[],l=[],f=[],c=[],p=[],h=[],m=[],E=[],v=[],i=0;i1||n>1||r<=0||n<=0)throw new Error("Proportions should be greater than 0 and less than 1");var u=(r*e+n*a)/(e+a),i=t.sqrt(u*(1-u)*(1/e+1/a));return(r-n)/i}var n=[].slice,a=r.utils.isNumber,u=r.utils.isArray;r.extend({zscore:function(){var t=n.call(arguments);return a(t[1])?(t[0]-t[1])/t[2]:(t[0]-r.mean(t[1]))/r.stdev(t[1],t[2])},ztest:function(){var e,a=n.call(arguments);return u(a[1])?(e=r.zscore(a[0],a[1],a[3]),1===a[2]?r.normal.cdf(-t.abs(e),0,1):2*r.normal.cdf(-t.abs(e),0,1)):a.length>2?(e=r.zscore(a[0],a[1],a[2]),1===a[3]?r.normal.cdf(-t.abs(e),0,1):2*r.normal.cdf(-t.abs(e),0,1)):(e=a[0],1===a[1]?r.normal.cdf(-t.abs(e),0,1):2*r.normal.cdf(-t.abs(e),0,1))}}),r.extend(r.fn,{zscore:function(r,t){return(r-this.mean())/this.stdev(t)},ztest:function(e,n,a){var u=t.abs(this.zscore(e,a));return 1===n?r.normal.cdf(-u,0,1):2*r.normal.cdf(-u,0,1)}}),r.extend({tscore:function(){var e=n.call(arguments);return 4===e.length?(e[0]-e[1])/(e[2]/t.sqrt(e[3])):(e[0]-r.mean(e[1]))/(r.stdev(e[1],!0)/t.sqrt(e[1].length))},ttest:function(){var e,u=n.call(arguments);return 5===u.length?(e=t.abs(r.tscore(u[0],u[1],u[2],u[3])),1===u[4]?r.studentt.cdf(-e,u[3]-1):2*r.studentt.cdf(-e,u[3]-1)):a(u[1])?(e=t.abs(u[0]),1==u[2]?r.studentt.cdf(-e,u[1]-1):2*r.studentt.cdf(-e,u[1]-1)):(e=t.abs(r.tscore(u[0],u[1])),1==u[2]?r.studentt.cdf(-e,u[1].length-1):2*r.studentt.cdf(-e,u[1].length-1))}}),r.extend(r.fn,{tscore:function(r){return(r-this.mean())/(this.stdev(!0)/t.sqrt(this.cols()))},ttest:function(e,n){return 1===n?1-r.studentt.cdf(t.abs(this.tscore(e)),this.cols()-1):2*r.studentt.cdf(-t.abs(this.tscore(e)),this.cols()-1)}}),r.extend({anovafscore:function(){var e,a,u,i,o,s,l,f,c=n.call(arguments);if(1===c.length){o=new Array(c[0].length);for(var l=0;l.5?1-e:e)}),o=jStat.studentt.inv(.975,t.df_resid),s=t.coef.map(function(r,t){var e=o*a[t];return[r-e,r+e]});return{se:a,t:u,p:i,sigmaHat:n,interval95:s}}function n(r){var t=r.R2/r.df_model/((1-r.R2)/r.df_resid),e=function(r,t,e){return jStat.beta.cdf(r/(e/t+r),t/2,e/2)},n=1-e(t,r.df_model,r.df_resid);return{F_statistic:t,pvalue:n}}function a(r,a){var u=t(r,a),i=e(u),o=n(u),s=1-(1-u.rsquared)*((u.nobs-1)/u.df_resid);return u.t=i,u.f=o,u.adjust_R2=s,u}return{ols:a}}()},function(r,t,e){var n=e(15),a=e(19),u=e(16);t.UNIQUE=function(){for(var r=[],t=0;t=0||"number"==typeof r&&(isNaN(r)||!isFinite(r))},t.ISERROR=function(r){return t.ISERR(r)||r===n.na},t.ISEVEN=function(r){return!(1&Math.floor(Math.abs(r)))},t.ISFORMULA=function(){throw new Error("ISFORMULA is not implemented")},t.ISLOGICAL=function(r){return r===!0||r===!1},t.ISNA=function(r){return r===n.na},t.ISNONTEXT=function(r){return"string"!=typeof r},t.ISNUMBER=function(r){return"number"==typeof r&&!isNaN(r)&&isFinite(r)},t.ISODD=function(r){return!!(1&Math.floor(Math.abs(r)))},t.ISREF=function(){throw new Error("ISREF is not implemented")},t.ISTEXT=function(r){return"string"==typeof r},t.N=function(r){return this.ISNUMBER(r)?r:r instanceof Date?r.getTime():r===!0?1:r===!1?0:this.ISERROR(r)?r:0},t.NA=function(){return n.na},t.SHEET=function(){throw new Error("SHEET is not implemented")},t.SHEETS=function(){throw new Error("SHEETS is not implemented")},t.TYPE=function(r){return this.ISNUMBER(r)?1:this.ISTEXT(r)?2:this.ISLOGICAL(r)?4:this.ISERROR(r)?16:Array.isArray(r)?64:void 0}},function(r,t,e){function n(r){return/^[01]{1,10}$/.test(r)}var a=e(16),u=e(22).jStat,i=e(18),o=e(15),s=e(26);t.BESSELI=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:s.besseli(r,t)},t.BESSELJ=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:s.besselj(r,t)},t.BESSELK=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:s.besselk(r,t)},t.BESSELY=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:s.bessely(r,t)},t.BIN2DEC=function(r){if(!n(r))return a.num;var t=parseInt(r,2),e=r.toString();return 10===e.length&&"1"===e.substring(0,1)?parseInt(e.substring(1),2)-512:t},t.BIN2HEX=function(r,t){if(!n(r))return a.num;var e=r.toString();if(10===e.length&&"1"===e.substring(0,1))return(0xfffffffe00+parseInt(e.substring(1),2)).toString(16);var u=parseInt(r,2).toString(16);return void 0===t?u:isNaN(t)?a.value:t<0?a.num:(t=Math.floor(t),t>=u.length?i.REPT("0",t-u.length)+u:a.num)},t.BIN2OCT=function(r,t){if(!n(r))return a.num;var e=r.toString();if(10===e.length&&"1"===e.substring(0,1))return(1073741312+parseInt(e.substring(1),2)).toString(8);var u=parseInt(r,2).toString(8);return void 0===t?u:isNaN(t)?a.value:t<0?a.num:(t=Math.floor(t),t>=u.length?i.REPT("0",t-u.length)+u:a.num)},t.BITAND=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:r<0||t<0?a.num:Math.floor(r)!==r||Math.floor(t)!==t?a.num:r>0xffffffffffff||t>0xffffffffffff?a.num:r&t},t.BITLSHIFT=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:r<0?a.num:Math.floor(r)!==r?a.num:r>0xffffffffffff?a.num:Math.abs(t)>53?a.num:t>=0?r<>-t},t.BITOR=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:r<0||t<0?a.num:Math.floor(r)!==r||Math.floor(t)!==t?a.num:r>0xffffffffffff||t>0xffffffffffff?a.num:r|t},t.BITRSHIFT=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:r<0?a.num:Math.floor(r)!==r?a.num:r>0xffffffffffff?a.num:Math.abs(t)>53?a.num:t>=0?r>>t:r<<-t},t.BITXOR=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:r<0||t<0?a.num:Math.floor(r)!==r||Math.floor(t)!==t?a.num:r>0xffffffffffff||t>0xffffffffffff?a.num:r^t},t.COMPLEX=function(r,t,e){if(r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t))return r;if(e=void 0===e?"i":e,"i"!==e&&"j"!==e)return a.value;if(0===r&&0===t)return 0;if(0===r)return 1===t?e:t.toString()+e;if(0===t)return r.toString();var n=t>0?"+":"";return r.toString()+n+(1===t?e:t.toString()+e)},t.CONVERT=function(r,t,e){if(r=o.parseNumber(r),r instanceof Error)return r;for(var n,u=[["a.u. of action","?",null,"action",!1,!1,1.05457168181818e-34],["a.u. of charge","e",null,"electric_charge",!1,!1,1.60217653141414e-19],["a.u. of energy","Eh",null,"energy",!1,!1,4.35974417757576e-18],["a.u. of length","a?",null,"length",!1,!1,5.29177210818182e-11],["a.u. of mass","m?",null,"mass",!1,!1,9.10938261616162e-31],["a.u. of time","?/Eh",null,"time",!1,!1,2.41888432650516e-17],["admiralty knot","admkn",null,"speed",!1,!0,.514773333],["ampere","A",null,"electric_current",!0,!1,1],["ampere per meter","A/m",null,"magnetic_field_intensity",!0,!1,1],["ångström","Å",["ang"],"length",!1,!0,1e-10],["are","ar",null,"area",!1,!0,100],["astronomical unit","ua",null,"length",!1,!1,1.49597870691667e-11],["bar","bar",null,"pressure",!1,!1,1e5],["barn","b",null,"area",!1,!1,1e-28],["becquerel","Bq",null,"radioactivity",!0,!1,1],["bit","bit",["b"],"information",!1,!0,1],["btu","BTU",["btu"],"energy",!1,!0,1055.05585262],["byte","byte",null,"information",!1,!0,8],["candela","cd",null,"luminous_intensity",!0,!1,1],["candela per square metre","cd/m?",null,"luminance",!0,!1,1],["coulomb","C",null,"electric_charge",!0,!1,1],["cubic ångström","ang3",["ang^3"],"volume",!1,!0,1e-30],["cubic foot","ft3",["ft^3"],"volume",!1,!0,.028316846592],["cubic inch","in3",["in^3"],"volume",!1,!0,16387064e-12],["cubic light-year","ly3",["ly^3"],"volume",!1,!0,8.46786664623715e-47],["cubic metre","m?",null,"volume",!0,!0,1],["cubic mile","mi3",["mi^3"],"volume",!1,!0,4168181825.44058],["cubic nautical mile","Nmi3",["Nmi^3"],"volume",!1,!0,6352182208],["cubic Pica","Pica3",["Picapt3","Pica^3","Picapt^3"],"volume",!1,!0,7.58660370370369e-8],["cubic yard","yd3",["yd^3"],"volume",!1,!0,.764554857984],["cup","cup",null,"volume",!1,!0,.0002365882365],["dalton","Da",["u"],"mass",!1,!1,1.66053886282828e-27],["day","d",["day"],"time",!1,!0,86400],["degree","°",null,"angle",!1,!1,.0174532925199433],["degrees Rankine","Rank",null,"temperature",!1,!0,.555555555555556],["dyne","dyn",["dy"],"force",!1,!0,1e-5],["electronvolt","eV",["ev"],"energy",!1,!0,1.60217656514141],["ell","ell",null,"length",!1,!0,1.143],["erg","erg",["e"],"energy",!1,!0,1e-7],["farad","F",null,"electric_capacitance",!0,!1,1],["fluid ounce","oz",null,"volume",!1,!0,295735295625e-16],["foot","ft",null,"length",!1,!0,.3048],["foot-pound","flb",null,"energy",!1,!0,1.3558179483314],["gal","Gal",null,"acceleration",!1,!1,.01],["gallon","gal",null,"volume",!1,!0,.003785411784],["gauss","G",["ga"],"magnetic_flux_density",!1,!0,1],["grain","grain",null,"mass",!1,!0,647989e-10],["gram","g",null,"mass",!1,!0,.001],["gray","Gy",null,"absorbed_dose",!0,!1,1],["gross registered ton","GRT",["regton"],"volume",!1,!0,2.8316846592],["hectare","ha",null,"area",!1,!0,1e4],["henry","H",null,"inductance",!0,!1,1],["hertz","Hz",null,"frequency",!0,!1,1],["horsepower","HP",["h"],"power",!1,!0,745.69987158227],["horsepower-hour","HPh",["hh","hph"],"energy",!1,!0,2684519.538],["hour","h",["hr"],"time",!1,!0,3600],["imperial gallon (U.K.)","uk_gal",null,"volume",!1,!0,.00454609],["imperial hundredweight","lcwt",["uk_cwt","hweight"],"mass",!1,!0,50.802345],["imperial quart (U.K)","uk_qt",null,"volume",!1,!0,.0011365225],["imperial ton","brton",["uk_ton","LTON"],"mass",!1,!0,1016.046909],["inch","in",null,"length",!1,!0,.0254],["international acre","uk_acre",null,"area",!1,!0,4046.8564224],["IT calorie","cal",null,"energy",!1,!0,4.1868],["joule","J",null,"energy",!0,!0,1],["katal","kat",null,"catalytic_activity",!0,!1,1],["kelvin","K",["kel"],"temperature",!0,!0,1],["kilogram","kg",null,"mass",!0,!0,1],["knot","kn",null,"speed",!1,!0,.514444444444444],["light-year","ly",null,"length",!1,!0,9460730472580800],["litre","L",["l","lt"],"volume",!1,!0,.001],["lumen","lm",null,"luminous_flux",!0,!1,1],["lux","lx",null,"illuminance",!0,!1,1],["maxwell","Mx",null,"magnetic_flux",!1,!1,1e-18],["measurement ton","MTON",null,"volume",!1,!0,1.13267386368],["meter per hour","m/h",["m/hr"],"speed",!1,!0,.00027777777777778],["meter per second","m/s",["m/sec"],"speed",!0,!0,1],["meter per second squared","m?s??",null,"acceleration",!0,!1,1],["parsec","pc",["parsec"],"length",!1,!0,0x6da012f958ee1c],["meter squared per second","m?/s",null,"kinematic_viscosity",!0,!1,1],["metre","m",null,"length",!0,!0,1],["miles per hour","mph",null,"speed",!1,!0,.44704],["millimetre of mercury","mmHg",null,"pressure",!1,!1,133.322],["minute","?",null,"angle",!1,!1,.000290888208665722],["minute","min",["mn"],"time",!1,!0,60],["modern teaspoon","tspm",null,"volume",!1,!0,5e-6],["mole","mol",null,"amount_of_substance",!0,!1,1],["morgen","Morgen",null,"area",!1,!0,2500],["n.u. of action","?",null,"action",!1,!1,1.05457168181818e-34],["n.u. of mass","m?",null,"mass",!1,!1,9.10938261616162e-31],["n.u. of speed","c?",null,"speed",!1,!1,299792458],["n.u. of time","?/(me?c??)",null,"time",!1,!1,1.28808866778687e-21],["nautical mile","M",["Nmi"],"length",!1,!0,1852],["newton","N",null,"force",!0,!0,1],["œrsted","Oe ",null,"magnetic_field_intensity",!1,!1,79.5774715459477],["ohm","Ω",null,"electric_resistance",!0,!1,1],["ounce mass","ozm",null,"mass",!1,!0,.028349523125],["pascal","Pa",null,"pressure",!0,!1,1],["pascal second","Pa?s",null,"dynamic_viscosity",!0,!1,1],["pferdestärke","PS",null,"power",!1,!0,735.49875],["phot","ph",null,"illuminance",!1,!1,1e-4],["pica (1/6 inch)","pica",null,"length",!1,!0,.00035277777777778],["pica (1/72 inch)","Pica",["Picapt"],"length",!1,!0,.00423333333333333],["poise","P",null,"dynamic_viscosity",!1,!1,.1],["pond","pond",null,"force",!1,!0,.00980665],["pound force","lbf",null,"force",!1,!0,4.4482216152605],["pound mass","lbm",null,"mass",!1,!0,.45359237],["quart","qt",null,"volume",!1,!0,.000946352946],["radian","rad",null,"angle",!0,!1,1],["second","?",null,"angle",!1,!1,484813681109536e-20],["second","s",["sec"],"time",!0,!0,1],["short hundredweight","cwt",["shweight"],"mass",!1,!0,45.359237],["siemens","S",null,"electrical_conductance",!0,!1,1],["sievert","Sv",null,"equivalent_dose",!0,!1,1],["slug","sg",null,"mass",!1,!0,14.59390294],["square ångström","ang2",["ang^2"],"area",!1,!0,1e-20],["square foot","ft2",["ft^2"],"area",!1,!0,.09290304],["square inch","in2",["in^2"],"area",!1,!0,64516e-8],["square light-year","ly2",["ly^2"],"area",!1,!0,8.95054210748189e31],["square meter","m?",null,"area",!0,!0,1],["square mile","mi2",["mi^2"],"area",!1,!0,2589988.110336],["square nautical mile","Nmi2",["Nmi^2"],"area",!1,!0,3429904],["square Pica","Pica2",["Picapt2","Pica^2","Picapt^2"],"area",!1,!0,1792111111111e-17],["square yard","yd2",["yd^2"],"area",!1,!0,.83612736],["statute mile","mi",null,"length",!1,!0,1609.344],["steradian","sr",null,"solid_angle",!0,!1,1],["stilb","sb",null,"luminance",!1,!1,1e-4],["stokes","St",null,"kinematic_viscosity",!1,!1,1e-4],["stone","stone",null,"mass",!1,!0,6.35029318],["tablespoon","tbs",null,"volume",!1,!0,147868e-10],["teaspoon","tsp",null,"volume",!1,!0,492892e-11],["tesla","T",null,"magnetic_flux_density",!0,!0,1],["thermodynamic calorie","c",null,"energy",!1,!0,4.184],["ton","ton",null,"mass",!1,!0,907.18474],["tonne","t",null,"mass",!1,!1,1e3],["U.K. pint","uk_pt",null,"volume",!1,!0,.00056826125],["U.S. bushel","bushel",null,"volume",!1,!0,.03523907],["U.S. oil barrel","barrel",null,"volume",!1,!0,.158987295],["U.S. pint","pt",["us_pt"],"volume",!1,!0,.000473176473],["U.S. survey mile","survey_mi",null,"length",!1,!0,1609.347219],["U.S. survey/statute acre","us_acre",null,"area",!1,!0,4046.87261],["volt","V",null,"voltage",!0,!1,1],["watt","W",null,"power",!0,!0,1],["watt-hour","Wh",["wh"],"energy",!1,!0,3600],["weber","Wb",null,"magnetic_flux",!0,!1,1],["yard","yd",null,"length",!1,!0,.9144],["year","yr",null,"time",!1,!0,31557600]],i={ Yi:["yobi",80,1.2089258196146292e24,"Yi","yotta"],Zi:["zebi",70,0x400000000000000000,"Zi","zetta"],Ei:["exbi",60,0x1000000000000000,"Ei","exa"],Pi:["pebi",50,0x4000000000000,"Pi","peta"],Ti:["tebi",40,1099511627776,"Ti","tera"],Gi:["gibi",30,1073741824,"Gi","giga"],Mi:["mebi",20,1048576,"Mi","mega"],ki:["kibi",10,1024,"ki","kilo"]},s={Y:["yotta",1e24,"Y"],Z:["zetta",1e21,"Z"],E:["exa",1e18,"E"],P:["peta",1e15,"P"],T:["tera",1e12,"T"],G:["giga",1e9,"G"],M:["mega",1e6,"M"],k:["kilo",1e3,"k"],h:["hecto",100,"h"],e:["dekao",10,"e"],d:["deci",.1,"d"],c:["centi",.01,"c"],m:["milli",.001,"m"],u:["micro",1e-6,"u"],n:["nano",1e-9,"n"],p:["pico",1e-12,"p"],f:["femto",1e-15,"f"],a:["atto",1e-18,"a"],z:["zepto",1e-21,"z"],y:["yocto",1e-24,"y"]},l=null,f=null,c=t,p=e,h=1,m=1,E=0;E=0)&&(l=u[E]),(u[E][1]===p||n.indexOf(p)>=0)&&(f=u[E]);if(null===l){var v=i[t.substring(0,2)],g=s[t.substring(0,1)];"da"===t.substring(0,2)&&(g=["dekao",10,"da"]),v?(h=v[2],c=t.substring(2)):g&&(h=g[1],c=t.substring(g[2].length));for(var N=0;N=0)&&(l=u[N])}if(null===f){var d=i[e.substring(0,2)],I=s[e.substring(0,1)];"da"===e.substring(0,2)&&(I=["dekao",10,"da"]),d?(m=d[2],p=e.substring(2)):I&&(m=I[1],p=e.substring(I[2].length));for(var b=0;b=0)&&(f=u[b])}return null===l||null===f?a.na:l[3]!==f[3]?a.na:r*l[6]*h/(f[6]*m)},t.DEC2BIN=function(r,t){if(r=o.parseNumber(r),r instanceof Error)return r;if(!/^-?[0-9]{1,3}$/.test(r)||r<-512||r>511)return a.num;if(r<0)return"1"+i.REPT("0",9-(512+r).toString(2).length)+(512+r).toString(2);var e=parseInt(r,10).toString(2);return"undefined"==typeof t?e:isNaN(t)?a.value:t<0?a.num:(t=Math.floor(t),t>=e.length?i.REPT("0",t-e.length)+e:a.num)},t.DEC2HEX=function(r,t){if(r=o.parseNumber(r),r instanceof Error)return r;if(!/^-?[0-9]{1,12}$/.test(r)||r<-549755813888||r>549755813887)return a.num;if(r<0)return(1099511627776+r).toString(16);var e=parseInt(r,10).toString(16);return"undefined"==typeof t?e:isNaN(t)?a.value:t<0?a.num:(t=Math.floor(t),t>=e.length?i.REPT("0",t-e.length)+e:a.num)},t.DEC2OCT=function(r,t){if(r=o.parseNumber(r),r instanceof Error)return r;if(!/^-?[0-9]{1,9}$/.test(r)||r<-536870912||r>536870911)return a.num;if(r<0)return(1073741824+r).toString(8);var e=parseInt(r,10).toString(8);return"undefined"==typeof t?e:isNaN(t)?a.value:t<0?a.num:(t=Math.floor(t),t>=e.length?i.REPT("0",t-e.length)+e:a.num)},t.DELTA=function(r,t){return t=void 0===t?0:t,r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:r===t?1:0},t.ERF=function(r,t){return t=void 0===t?0:t,r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?a.value:u.erf(r)},t.ERF.PRECISE=function(){throw new Error("ERF.PRECISE is not implemented")},t.ERFC=function(r){return isNaN(r)?a.value:u.erfc(r)},t.ERFC.PRECISE=function(){throw new Error("ERFC.PRECISE is not implemented")},t.GESTEP=function(r,t){return t=t||0,r=o.parseNumber(r),o.anyIsError(t,r)?r:r>=t?1:0},t.HEX2BIN=function(r,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(r))return a.num;var e=10===r.length&&"f"===r.substring(0,1).toLowerCase(),n=e?parseInt(r,16)-1099511627776:parseInt(r,16);if(n<-512||n>511)return a.num;if(e)return"1"+i.REPT("0",9-(512+n).toString(2).length)+(512+n).toString(2);var u=n.toString(2);return void 0===t?u:isNaN(t)?a.value:t<0?a.num:(t=Math.floor(t),t>=u.length?i.REPT("0",t-u.length)+u:a.num)},t.HEX2DEC=function(r){if(!/^[0-9A-Fa-f]{1,10}$/.test(r))return a.num;var t=parseInt(r,16);return t>=549755813888?t-1099511627776:t},t.HEX2OCT=function(r,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(r))return a.num;var e=parseInt(r,16);if(e>536870911&&e<0xffe0000000)return a.num;if(e>=0xffe0000000)return(e-0xffc0000000).toString(8);var n=e.toString(8);return void 0===t?n:isNaN(t)?a.value:t<0?a.num:(t=Math.floor(t),t>=n.length?i.REPT("0",t-n.length)+n:a.num)},t.IMABS=function(r){var e=t.IMREAL(r),n=t.IMAGINARY(r);return o.anyIsError(e,n)?a.value:Math.sqrt(Math.pow(e,2)+Math.pow(n,2))},t.IMAGINARY=function(r){if(void 0===r||r===!0||r===!1)return a.value;if(0===r||"0"===r)return 0;if(["i","j"].indexOf(r)>=0)return 1;r=r.replace("+i","+1i").replace("-i","-1i").replace("+j","+1j").replace("-j","-1j");var t=r.indexOf("+"),e=r.indexOf("-");0===t&&(t=r.indexOf("+",1)),0===e&&(e=r.indexOf("-",1));var n=r.substring(r.length-1,r.length),u="i"===n||"j"===n;return t>=0||e>=0?u?t>=0?isNaN(r.substring(0,t))||isNaN(r.substring(t+1,r.length-1))?a.num:Number(r.substring(t+1,r.length-1)):isNaN(r.substring(0,e))||isNaN(r.substring(e+1,r.length-1))?a.num:-Number(r.substring(e+1,r.length-1)):a.num:u?isNaN(r.substring(0,r.length-1))?a.num:r.substring(0,r.length-1):isNaN(r)?a.num:0},t.IMARGUMENT=function(r){var e=t.IMREAL(r),n=t.IMAGINARY(r);return o.anyIsError(e,n)?a.value:0===e&&0===n?a.div0:0===e&&n>0?Math.PI/2:0===e&&n<0?-Math.PI/2:0===n&&e>0?0:0===n&&e<0?-Math.PI:e>0?Math.atan(n/e):e<0&&n>=0?Math.atan(n/e)+Math.PI:Math.atan(n/e)-Math.PI},t.IMCONJUGATE=function(r){var e=t.IMREAL(r),n=t.IMAGINARY(r);if(o.anyIsError(e,n))return a.value;var u=r.substring(r.length-1);return u="i"===u||"j"===u?u:"i",0!==n?t.COMPLEX(e,-n,u):r},t.IMCOS=function(r){var e=t.IMREAL(r),n=t.IMAGINARY(r);if(o.anyIsError(e,n))return a.value;var u=r.substring(r.length-1);return u="i"===u||"j"===u?u:"i",t.COMPLEX(Math.cos(e)*(Math.exp(n)+Math.exp(-n))/2,-Math.sin(e)*(Math.exp(n)-Math.exp(-n))/2,u)},t.IMCOSH=function(r){var e=t.IMREAL(r),n=t.IMAGINARY(r);if(o.anyIsError(e,n))return a.value;var u=r.substring(r.length-1);return u="i"===u||"j"===u?u:"i",t.COMPLEX(Math.cos(n)*(Math.exp(e)+Math.exp(-e))/2,Math.sin(n)*(Math.exp(e)-Math.exp(-e))/2,u)},t.IMCOT=function(r){var e=t.IMREAL(r),n=t.IMAGINARY(r);return o.anyIsError(e,n)?a.value:t.IMDIV(t.IMCOS(r),t.IMSIN(r))},t.IMDIV=function(r,e){var n=t.IMREAL(r),u=t.IMAGINARY(r),i=t.IMREAL(e),s=t.IMAGINARY(e);if(o.anyIsError(n,u,i,s))return a.value;var l=r.substring(r.length-1),f=e.substring(e.length-1),c="i";if("j"===l?c="j":"j"===f&&(c="j"),0===i&&0===s)return a.num;var p=i*i+s*s;return t.COMPLEX((n*i+u*s)/p,(u*i-n*s)/p,c)},t.IMEXP=function(r){var e=t.IMREAL(r),n=t.IMAGINARY(r);if(o.anyIsError(e,n))return a.value;var u=r.substring(r.length-1);u="i"===u||"j"===u?u:"i";var i=Math.exp(e);return t.COMPLEX(i*Math.cos(n),i*Math.sin(n),u)},t.IMLN=function(r){var e=t.IMREAL(r),n=t.IMAGINARY(r);if(o.anyIsError(e,n))return a.value;var u=r.substring(r.length-1);return u="i"===u||"j"===u?u:"i",t.COMPLEX(Math.log(Math.sqrt(e*e+n*n)),Math.atan(n/e),u)},t.IMLOG10=function(r){var e=t.IMREAL(r),n=t.IMAGINARY(r);if(o.anyIsError(e,n))return a.value;var u=r.substring(r.length-1);return u="i"===u||"j"===u?u:"i",t.COMPLEX(Math.log(Math.sqrt(e*e+n*n))/Math.log(10),Math.atan(n/e)/Math.log(10),u)},t.IMLOG2=function(r){var e=t.IMREAL(r),n=t.IMAGINARY(r);if(o.anyIsError(e,n))return a.value;var u=r.substring(r.length-1);return u="i"===u||"j"===u?u:"i",t.COMPLEX(Math.log(Math.sqrt(e*e+n*n))/Math.log(2),Math.atan(n/e)/Math.log(2),u)},t.IMPOWER=function(r,e){e=o.parseNumber(e);var n=t.IMREAL(r),u=t.IMAGINARY(r);if(o.anyIsError(e,n,u))return a.value;var i=r.substring(r.length-1);i="i"===i||"j"===i?i:"i";var s=Math.pow(t.IMABS(r),e),l=t.IMARGUMENT(r);return t.COMPLEX(s*Math.cos(e*l),s*Math.sin(e*l),i)},t.IMPRODUCT=function(){var r=arguments[0];if(!arguments.length)return a.value;for(var e=1;e=0)return 0;var t=r.indexOf("+"),e=r.indexOf("-");0===t&&(t=r.indexOf("+",1)),0===e&&(e=r.indexOf("-",1));var n=r.substring(r.length-1,r.length),u="i"===n||"j"===n;return t>=0||e>=0?u?t>=0?isNaN(r.substring(0,t))||isNaN(r.substring(t+1,r.length-1))?a.num:Number(r.substring(0,t)):isNaN(r.substring(0,e))||isNaN(r.substring(e+1,r.length-1))?a.num:Number(r.substring(0,e)):a.num:u?isNaN(r.substring(0,r.length-1))?a.num:0:isNaN(r)?a.num:r},t.IMSEC=function(r){if(r===!0||r===!1)return a.value;var e=t.IMREAL(r),n=t.IMAGINARY(r);return o.anyIsError(e,n)?a.value:t.IMDIV("1",t.IMCOS(r))},t.IMSECH=function(r){var e=t.IMREAL(r),n=t.IMAGINARY(r);return o.anyIsError(e,n)?a.value:t.IMDIV("1",t.IMCOSH(r))},t.IMSIN=function(r){var e=t.IMREAL(r),n=t.IMAGINARY(r);if(o.anyIsError(e,n))return a.value;var u=r.substring(r.length-1);return u="i"===u||"j"===u?u:"i",t.COMPLEX(Math.sin(e)*(Math.exp(n)+Math.exp(-n))/2,Math.cos(e)*(Math.exp(n)-Math.exp(-n))/2,u)},t.IMSINH=function(r){var e=t.IMREAL(r),n=t.IMAGINARY(r);if(o.anyIsError(e,n))return a.value;var u=r.substring(r.length-1);return u="i"===u||"j"===u?u:"i",t.COMPLEX(Math.cos(n)*(Math.exp(e)-Math.exp(-e))/2,Math.sin(n)*(Math.exp(e)+Math.exp(-e))/2,u)},t.IMSQRT=function(r){var e=t.IMREAL(r),n=t.IMAGINARY(r);if(o.anyIsError(e,n))return a.value;var u=r.substring(r.length-1);u="i"===u||"j"===u?u:"i";var i=Math.sqrt(t.IMABS(r)),s=t.IMARGUMENT(r);return t.COMPLEX(i*Math.cos(s/2),i*Math.sin(s/2),u)},t.IMCSC=function(r){if(r===!0||r===!1)return a.value;var e=t.IMREAL(r),n=t.IMAGINARY(r);return o.anyIsError(e,n)?a.num:t.IMDIV("1",t.IMSIN(r))},t.IMCSCH=function(r){if(r===!0||r===!1)return a.value;var e=t.IMREAL(r),n=t.IMAGINARY(r);return o.anyIsError(e,n)?a.num:t.IMDIV("1",t.IMSINH(r))},t.IMSUB=function(r,t){var e=this.IMREAL(r),n=this.IMAGINARY(r),u=this.IMREAL(t),i=this.IMAGINARY(t);if(o.anyIsError(e,n,u,i))return a.value;var s=r.substring(r.length-1),l=t.substring(t.length-1),f="i";return"j"===s?f="j":"j"===l&&(f="j"),this.COMPLEX(e-u,n-i,f)},t.IMSUM=function(){if(!arguments.length)return a.value;for(var r=o.flatten(arguments),t=r[0],e=1;e511)return a.num;if(e)return"1"+i.REPT("0",9-(512+n).toString(2).length)+(512+n).toString(2);var u=n.toString(2);return"undefined"==typeof t?u:isNaN(t)?a.value:t<0?a.num:(t=Math.floor(t),t>=u.length?i.REPT("0",t-u.length)+u:a.num)},t.OCT2DEC=function(r){if(!/^[0-7]{1,10}$/.test(r))return a.num;var t=parseInt(r,8);return t>=536870912?t-1073741824:t},t.OCT2HEX=function(r,t){if(!/^[0-7]{1,10}$/.test(r))return a.num;var e=parseInt(r,8);if(e>=536870912)return"ff"+(e+3221225472).toString(16);var n=e.toString(16);return void 0===t?n:isNaN(t)?a.value:t<0?a.num:(t=Math.floor(t),t>=n.length?i.REPT("0",t-n.length)+n:a.num)}},function(r,t,e){function n(r,t){return r.reduce(function(r,e){return t*r+e},0)}function a(r,t,e,n,a){a||(a=-1);var u,i=2/r;if(0===t)return e;if(1===t)return n;for(var o=1;o!=t;++o)u=n*o*i+a*e,e=n,n=u;return n}function u(r,t,e,n,u){return function(i,o){if(0===o)return r(i);if(1===o)return t(i);if(o<0)throw e+": Order ("+o+") must be nonnegative";if(1==n&&0===i)throw e+": Undefined when x == 0";if(2==n&&i<=0)throw e+": Undefined when x <= 0";var s=r(i),l=t(i);return a(i,o,s,l,u)}}var i=Math,o=function(){function r(r){var t,a,f,c=r*r,p=i.abs(r)-.785398164;return i.abs(r)<8?(a=n(e,c),f=n(u,c),t=a/f):(c=64/c,a=n(o,c),f=n(s,c),t=i.sqrt(l/i.abs(r))*(i.cos(p)*a-i.sin(p)*f*8/i.abs(r))),t}function t(r){var t,e,a,u=r*r,o=i.abs(r)-2.356194491;return Math.abs(r)<8?(e=r*n(f,u),a=n(c,u),t=e/a):(u=64/u,e=n(p,u),a=n(h,u),t=i.sqrt(l/i.abs(r))*(i.cos(o)*e-i.sin(o)*a*8/i.abs(r)),r<0&&(t=-t)),t}var e=[57568490574,-13362590354,651619640.7,-11214424.18,77392.33017,-184.9052456].reverse(),u=[57568490411,1029532985,9494680.718,59272.64853,267.8532712,1].reverse(),o=[1,-.001098628627,2734510407e-14,-2073370639e-15,2.093887211e-7].reverse(),s=[-.01562499995,.0001430488765,-6911147651e-15,7.621095161e-7,-9.34935152e-8].reverse(),l=.636619772,f=[72362614232,-7895059235,242396853.1,-2972611.439,15704.4826,-30.16036606].reverse(),c=[144725228442,2300535178,18583304.74,99447.43394,376.9991397,1].reverse(),p=[1,.00183105,-3516396496e-14,2457520174e-15,-2.40337019e-7].reverse(),h=[.04687499995,-.0002002690873,8449199096e-15,-8.8228987e-7,1.05787412e-7].reverse();return function(e,n){if(n=Math.round(n),0===n)return r(i.abs(e));if(1===n)return t(i.abs(e));if(n<0)throw"BESSELJ: Order ("+n+") must be nonnegative";if(0===i.abs(e))return 0;var u,o,s,l,f,c,p,h,m=2/i.abs(e);if(i.abs(e)>n)u=a(e,n,r(i.abs(e)),t(i.abs(e)),-1);else{for(s=2*i.floor((n+i.floor(i.sqrt(40*n)))/2),l=0,c=u=f=0,p=1,o=s;o>0;o--)h=o*m*p-c,c=p,p=h,i.abs(p)>1e10&&(p*=1e-10,c*=1e-10,u*=1e-10,f*=1e-10),l&&(f+=p),l=!l,o==n&&(u=c);f=2*f-p,u/=f}return e<0&&n%2?-u:u}}(),s=function(){function r(r){var t,u,c,p=r*r,h=r-.785398164;return r<8?(u=n(e,p),c=n(a,p),t=u/c+f*o(r,0)*i.log(r)):(p=64/p,u=n(s,p),c=n(l,p),t=i.sqrt(f/r)*(i.sin(h)*u+i.cos(h)*c*8/r)),t}function t(r){var t,e,a,u=r*r,s=r-2.356194491;return r<8?(e=r*n(c,u),a=n(p,u),t=e/a+f*(o(r,1)*i.log(r)-1/r)):(u=64/u,e=n(h,u),a=n(m,u),t=i.sqrt(f/r)*(i.sin(s)*e+i.cos(s)*a*8/r)),t}var e=[-2957821389,7062834065,-512359803.6,10879881.29,-86327.92757,228.4622733].reverse(),a=[40076544269,745249964.8,7189466.438,47447.2647,226.1030244,1].reverse(),s=[1,-.001098628627,2734510407e-14,-2073370639e-15,2.093887211e-7].reverse(),l=[-.01562499995,.0001430488765,-6911147651e-15,7.621095161e-7,-9.34945152e-8].reverse(),f=.636619772,c=[-4900604943e3,127527439e4,-51534381390,734926455.1,-4237922.726,8511.937935].reverse(),p=[249958057e5,424441966400,3733650367,22459040.02,102042.605,354.9632885,1].reverse(),h=[1,.00183105,-3516396496e-14,2457520174e-15,-2.40337019e-7].reverse(),m=[.04687499995,-.0002002690873,8449199096e-15,-8.8228987e-7,1.05787412e-7].reverse();return u(r,t,"BESSELY",1,-1)}(),l=function(){function r(r){return r<=3.75?n(e,r*r/14.0625):i.exp(i.abs(r))/i.sqrt(i.abs(r))*n(a,3.75/i.abs(r))}function t(r){return r<3.75?r*n(u,r*r/14.0625):(r<0?-1:1)*i.exp(i.abs(r))/i.sqrt(i.abs(r))*n(o,3.75/i.abs(r))}var e=[1,3.5156229,3.0899424,1.2067492,.2659732,.0360768,.0045813].reverse(),a=[.39894228,.01328592,.00225319,-.00157565,.00916281,-.02057706,.02635537,-.01647633,.00392377].reverse(),u=[.5,.87890594,.51498869,.15084934,.02658733,.00301532,32411e-8].reverse(),o=[.39894228,-.03988024,-.00362018,.00163801,-.01031555,.02282967,-.02895312,.01787654,-.00420059].reverse();return function e(n,a){if(a=Math.round(a),0===a)return r(n);if(1==a)return t(n);if(a<0)throw"BESSELI Order ("+a+") must be nonnegative";if(0===i.abs(n))return 0;var u,o,s,l,f,c,p=2/i.abs(n);for(s=2*i.round((a+i.round(i.sqrt(40*a)))/2),l=u=0,f=1,o=s;o>0;o--)c=o*p*f+l,l=f,f=c,i.abs(f)>1e10&&(f*=1e-10,l*=1e-10,u*=1e-10),o==a&&(u=l);return u*=e(n,0)/f,n<0&&a%2?-u:u}}(),f=function(){function r(r){return r<=2?-i.log(r/2)*l(r,0)+n(e,r*r/4):i.exp(-r)/i.sqrt(r)*n(a,2/r)}function t(r){return r<=2?i.log(r/2)*l(r,1)+1/r*n(o,r*r/4):i.exp(-r)/i.sqrt(r)*n(s,2/r)}var e=[-.57721566,.4227842,.23069756,.0348859,.00262698,1075e-7,74e-7].reverse(),a=[1.25331414,-.07832358,.02189568,-.01062446,.00587872,-.0025154,53208e-8].reverse(),o=[1,.15443144,-.67278579,-.18156897,-.01919402,-.00110404,-4686e-8].reverse(),s=[1.25331414,.23498619,-.0365562,.01504268,-.00780353,.00325614,-68245e-8].reverse();return u(r,t,"BESSELK",2,1)}();t.besselj=o,t.bessely=s,t.besseli=l,t.besselk=f},function(r,t,e){function n(r){return 1===new Date(r,1,29).getMonth()}function a(r,t){return Math.ceil((t-r)/1e3/60/60/24)}function u(r){var t=r>-22038912e5?2:1;return(r-s)/864e5+t}var i=e(16),o=e(15),s=new Date(1900,0,1),l=[void 0,0,1,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,1,2,3,4,5,6,0],f=[[],[1,2,3,4,5,6,7],[7,1,2,3,4,5,6],[6,0,1,2,3,4,5],[],[],[],[],[],[],[],[7,1,2,3,4,5,6],[6,7,1,2,3,4,5],[5,6,7,1,2,3,4],[4,5,6,7,1,2,3],[3,4,5,6,7,1,2],[2,3,4,5,6,7,1],[1,2,3,4,5,6,7]],c=[[],[6,0],[0,1],[1,2],[2,3],[3,4],[4,5],[5,6],void 0,void 0,void 0,[0,0],[1,1],[2,2],[3,3],[4,4],[5,5],[6,6]];t.DATE=function(r,t,e){var n;return r=o.parseNumber(r),t=o.parseNumber(t),e=o.parseNumber(e),n=o.anyIsError(r,t,e)?i.value:r<0||t<0||e<0?i.num:new Date(r,t-1,e)},t.DATEVALUE=function(r){if("string"!=typeof r)return i.value;var t=Date.parse(r);return isNaN(t)?i.value:t<=-22038912e5?(t-s)/864e5+1:(t-s)/864e5+2},t.DAY=function(r){var t=o.parseDate(r);return t instanceof Error?t:t.getDate()},t.DAYS=function(r,t){return r=o.parseDate(r),t=o.parseDate(t),r instanceof Error?r:t instanceof Error?t:u(r)-u(t)},t.DAYS360=function(r,t,e){if(e=o.parseBool(e),r=o.parseDate(r),t=o.parseDate(t),r instanceof Error)return r;if(t instanceof Error)return t;if(e instanceof Error)return e;var n,a,u=r.getMonth(),i=t.getMonth();if(e)n=31===r.getDate()?30:r.getDate(),a=31===t.getDate()?30:t.getDate();else{var s=new Date(r.getFullYear(),u+1,0).getDate(),l=new Date(t.getFullYear(),i+1,0).getDate();n=r.getDate()===s?30:r.getDate(),t.getDate()===l?n<30?(i++,a=1):a=30:a=t.getDate()}return 360*(t.getFullYear()-r.getFullYear())+30*(i-u)+(a-n)},t.EDATE=function(r,t){return r=o.parseDate(r),r instanceof Error?r:isNaN(t)?i.value:(t=parseInt(t,10),r.setMonth(r.getMonth()+t),u(r))},t.EOMONTH=function(r,t){return r=o.parseDate(r),r instanceof Error?r:isNaN(t)?i.value:(t=parseInt(t,10),u(new Date(r.getFullYear(),r.getMonth()+t+1,0)))},t.HOUR=function(r){return r=o.parseDate(r),r instanceof Error?r:r.getHours()},t.INTERVAL=function(r){if("number"!=typeof r&&"string"!=typeof r)return i.value;r=parseInt(r,10);var t=Math.floor(r/94608e4);r%=94608e4;var e=Math.floor(r/2592e3);r%=2592e3;var n=Math.floor(r/86400);r%=86400;var a=Math.floor(r/3600);r%=3600;var u=Math.floor(r/60);r%=60;var o=r;return t=t>0?t+"Y":"",e=e>0?e+"M":"",n=n>0?n+"D":"",a=a>0?a+"H":"",u=u>0?u+"M":"",o=o>0?o+"S":"","P"+t+e+n+"T"+a+u+o},t.ISOWEEKNUM=function(r){if(r=o.parseDate(r),r instanceof Error)return r;r.setHours(0,0,0),r.setDate(r.getDate()+4-(r.getDay()||7));var t=new Date(r.getFullYear(),0,1);return Math.ceil(((r-t)/864e5+1)/7)},t.MINUTE=function(r){return r=o.parseDate(r),r instanceof Error?r:r.getMinutes()},t.MONTH=function(r){return r=o.parseDate(r),r instanceof Error?r:r.getMonth()+1},t.NETWORKDAYS=function(r,t,e){return this.NETWORKDAYS.INTL(r,t,1,e)},t.NETWORKDAYS.INTL=function(r,t,e,n){if(r=o.parseDate(r),r instanceof Error)return r;if(t=o.parseDate(t),t instanceof Error)return t;if(e=void 0===e?c[1]:c[e],!(e instanceof Array))return i.value;void 0===n?n=[]:n instanceof Array||(n=[n]);for(var a=0;a0?f.getUTCDay():f.getDay(),h=!1;p!==e[0]&&p!==e[1]||(h=!0);for(var m=0;m=a)return!0;var u=t.getFullYear(),i=new Date(u,2,1);return n(u)&&t>=i&&rf||i===f&&u>=l))return(s===c&&n(s)||p(r,t)||1===f&&29===l)&&(h=366),a(r,t)/h;var m=c-s+1,E=(new Date(c+1,0,1)-new Date(s,0,1))/1e3/60/60/24,v=E/m;return a(r,t)/v;case 2:return a(r,t)/360;case 3:return a(r,t)/365;case 4:return(l+30*f+360*c-(u+30*i+360*s))/360}}},function(module,exports,__webpack_require__){function compact(r){var t=[];return utils.arrayEach(r,function(r){r&&t.push(r)}),t}function findResultIndex(database,criterias){for(var matches={},i=1;imaxCriteriaLength&&(maxCriteriaLength=criterias[i].length);for(var k=1;k1?error.num:a[n[0]]},exports.DMAX=function(r,t,e){if(isNaN(t)&&"string"!=typeof t)return error.value;var n=findResultIndex(r,e),a=[];if("string"==typeof t){var u=exports.FINDFIELD(r,t);a=utils.rest(r[u])}else a=utils.rest(r[t]);var i=a[n[0]];return utils.arrayEach(n,function(r){ia[r]&&(i=a[r])}),i},exports.DPRODUCT=function(r,t,e){if(isNaN(t)&&"string"!=typeof t)return error.value;var n=findResultIndex(r,e),a=[];if("string"==typeof t){var u=exports.FINDFIELD(r,t);a=utils.rest(r[u])}else a=utils.rest(r[t]);var i=[];utils.arrayEach(n,function(r){i.push(a[r])}),i=compact(i);var o=1;return utils.arrayEach(i,function(r){o*=r}),o},exports.DSTDEV=function(r,t,e){if(isNaN(t)&&"string"!=typeof t)return error.value;var n=findResultIndex(r,e),a=[];if("string"==typeof t){var u=exports.FINDFIELD(r,t);a=utils.rest(r[u])}else a=utils.rest(r[t]);var i=[];return utils.arrayEach(n,function(r){i.push(a[r])}),i=compact(i),stats.STDEV.S(i)},exports.DSTDEVP=function(r,t,e){if(isNaN(t)&&"string"!=typeof t)return error.value;var n=findResultIndex(r,e),a=[];if("string"==typeof t){var u=exports.FINDFIELD(r,t);a=utils.rest(r[u])}else a=utils.rest(r[t]);var i=[];return utils.arrayEach(n,function(r){i.push(a[r])}),i=compact(i),stats.STDEV.P(i)},exports.DSUM=function(r,t,e){if(isNaN(t)&&"string"!=typeof t)return error.value;var n=findResultIndex(r,e),a=[];if("string"==typeof t){var u=exports.FINDFIELD(r,t);a=utils.rest(r[u])}else a=utils.rest(r[t]);var i=[];return utils.arrayEach(n,function(r){i.push(a[r])}),maths.SUM(i)},exports.DVAR=function(r,t,e){if(isNaN(t)&&"string"!=typeof t)return error.value;var n=findResultIndex(r,e),a=[];if("string"==typeof t){var u=exports.FINDFIELD(r,t);a=utils.rest(r[u])}else a=utils.rest(r[t]);var i=[];return utils.arrayEach(n,function(r){i.push(a[r])}),stats.VAR.S(i)},exports.DVARP=function(r,t,e){if(isNaN(t)&&"string"!=typeof t)return error.value;var n=findResultIndex(r,e),a=[];if("string"==typeof t){var u=exports.FINDFIELD(r,t);a=utils.rest(r[u])}else a=utils.rest(r[t]);var i=[];return utils.arrayEach(n,function(r){i.push(a[r])}),stats.VAR.P(i)}},function(r,t,e){var n=e(16),a=e(15),u=e(24);t.AND=function(){for(var r=a.flatten(arguments),t=!0,e=0;e254?n.value:arguments.length0){var t=arguments[0],e=arguments.length-1,a=Math.floor(e/2),u=!1,i=e%2!==0,o=e%2===0?null:arguments[arguments.length-1];if(a)for(var s=0;si)return u.num;if(0!==s&&1!==s)return u.num;var l=t.PMT(r,e,n,0,s),f=0;1===a&&0===s&&(f=-n,a++);for(var c=a;c<=i;c++)f+=1===s?t.FV(r,c-2,l,n,1)-l:t.FV(r,c-1,l,n,0);return f*=r},t.CUMPRINC=function(r,e,n,a,i,s){if(r=o.parseNumber(r),e=o.parseNumber(e),n=o.parseNumber(n),o.anyIsError(r,e,n))return u.value;if(r<=0||e<=0||n<=0)return u.num;if(a<1||i<1||a>i)return u.num;if(0!==s&&1!==s)return u.num;var l=t.PMT(r,e,n,0,s),f=0;1===a&&(f=0===s?l+n*r:l,a++);for(var c=a;c<=i;c++)f+=s>0?l-(t.FV(r,c-2,l,n,1)-l)*r:l-t.FV(r,c-1,l,n,0)*r;return f},t.DB=function(r,t,e,n,a){if(a=void 0===a?12:a,r=o.parseNumber(r),t=o.parseNumber(t),e=o.parseNumber(e),n=o.parseNumber(n),a=o.parseNumber(a),o.anyIsError(r,t,e,n,a))return u.value;if(r<0||t<0||e<0||n<0)return u.num;if([1,2,3,4,5,6,7,8,9,10,11,12].indexOf(a)===-1)return u.num;if(n>e)return u.num;if(t>=r)return 0;for(var i=(1-Math.pow(t/r,1/e)).toFixed(3),s=r*i*a/12,l=s,f=0,c=n===e?e-1:n,p=2;p<=c;p++)f=(r-l)*i,l+=f;return 1===n?s:n===e?(r-l)*i:f},t.DDB=function(r,t,e,n,a){if(a=void 0===a?2:a,r=o.parseNumber(r),t=o.parseNumber(t),e=o.parseNumber(e),n=o.parseNumber(n),a=o.parseNumber(a),o.anyIsError(r,t,e,n,a))return u.value;if(r<0||t<0||e<0||n<0||a<=0)return u.num;if(n>e)return u.num;if(t>=r)return 0;for(var i=0,s=0,l=1;l<=n;l++)s=Math.min((r-i)*(a/e),r-t-i),i+=s;return s},t.DISC=function(){throw new Error("DISC is not implemented")},t.DOLLARDE=function(r,t){if(r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t))return u.value;if(t<0)return u.num;if(t>=0&&t<1)return u.div0;t=parseInt(t,10);var e=parseInt(r,10);e+=r%1*Math.pow(10,Math.ceil(Math.log(t)/Math.LN10))/t;var n=Math.pow(10,Math.ceil(Math.log(t)/Math.LN2)+1);return e=Math.round(e*n)/n},t.DOLLARFR=function(r,t){if(r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t))return u.value;if(t<0)return u.num;if(t>=0&&t<1)return u.div0;t=parseInt(t,10);var e=parseInt(r,10);return e+=r%1*Math.pow(10,-Math.ceil(Math.log(t)/Math.LN10))*t},t.DURATION=function(){throw new Error("DURATION is not implemented")},t.EFFECT=function(r,t){return r=o.parseNumber(r),t=o.parseNumber(t),o.anyIsError(r,t)?u.value:r<=0||t<1?u.num:(t=parseInt(t,10),Math.pow(1+r/t,t)-1)},t.FV=function(r,t,e,n,a){if(n=n||0,a=a||0,r=o.parseNumber(r),t=o.parseNumber(t),e=o.parseNumber(e),n=o.parseNumber(n),a=o.parseNumber(a),o.anyIsError(r,t,e,n,a))return u.value;var i;if(0===r)i=n+e*t;else{var s=Math.pow(1+r,t);i=1===a?n*s+e*(1+r)*(s-1)/r:n*s+e*(s-1)/r}return-i},t.FVSCHEDULE=function(r,t){if(r=o.parseNumber(r),t=o.parseNumberArray(o.flatten(t)),o.anyIsError(r,t))return u.value;for(var e=t.length,n=r,a=0;a0&&(i=!0),r[l]<0&&(s=!0);if(!i||!s)return u.num;t=void 0===t?.1:t;var f,c,p,h=t,m=1e-10,E=!0;do p=e(r,a,h),f=h-p/n(r,a,h),c=Math.abs(f-h),h=f,E=c>m&&Math.abs(p)>m;while(E);return h},t.ISPMT=function(r,t,e,n){return r=o.parseNumber(r), -t=o.parseNumber(t),e=o.parseNumber(e),n=o.parseNumber(n),o.anyIsError(r,t,e,n)?u.value:n*r*(t/e-1)},t.MDURATION=function(){throw new Error("MDURATION is not implemented")},t.MIRR=function(r,e,n){if(r=o.parseNumberArray(o.flatten(r)),e=o.parseNumber(e),n=o.parseNumber(n),o.anyIsError(r,e,n))return u.value;for(var a=r.length,i=[],s=[],l=0;lp&&ve?u.num:(n=parseInt(n,10),(r-t)*(e-n+1)*2/(e*(e+1)))},t.TBILLEQ=function(r,t,e){return r=o.parseDate(r),t=o.parseDate(t),e=o.parseNumber(e),o.anyIsError(r,t,e)?u.value:e<=0?u.num:r>t?u.num:t-r>31536e6?u.num:365*e/(360-e*i.DAYS360(r,t,!1))},t.TBILLPRICE=function(r,t,e){return r=o.parseDate(r),t=o.parseDate(t),e=o.parseNumber(e),o.anyIsError(r,t,e)?u.value:e<=0?u.num:r>t?u.num:t-r>31536e6?u.num:100*(1-e*i.DAYS360(r,t,!1)/360)},t.TBILLYIELD=function(r,t,e){return r=o.parseDate(r),t=o.parseDate(t),e=o.parseNumber(e),o.anyIsError(r,t,e)?u.value:e<=0?u.num:r>t?u.num:t-r>31536e6?u.num:360*(100-e)/(e*i.DAYS360(r,t,!1))},t.VDB=function(){throw new Error("VDB is not implemented")},t.XNPV=function(r,t,e){if(r=o.parseNumber(r),t=o.parseNumberArray(o.flatten(t)),e=o.parseDateArray(o.flatten(e)),o.anyIsError(r,t,e))return u.value;for(var n=0,a=0;au&&(a=i+1,u=t[i]):(a=i+1,u=t[i]))}else if(0===e){if("string"==typeof r){if(r=r.replace(/\?/g,"."),t[i].toLowerCase().match(r.toLowerCase()))return i+1}else if(t[i]===r)return i+1}else if(e===-1){if(t[i]===r)return i+1;t[i]>r&&(u?t[i]t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;var n=t.SYMBOL=">";e.SYMBOL=n},function(r,t){"use strict";function e(r,t){return r>=t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;var n=t.SYMBOL=">=";e.SYMBOL=n},function(r,t){"use strict";function e(r,t){return r1?t-1:0),n=1;n1?t-1:0),n=1;n";e.SYMBOL=n},function(r,t,e){"use strict";function n(r,t){var e=Math.pow((0,a.toNumber)(r),(0,a.toNumber)(t));if(isNaN(e))throw Error(u.ERROR_VALUE);return e}Object.defineProperty(t,"__esModule",{value:!0}),t.SYMBOL=void 0,t.default=n;var a=e(6),u=e(7),i=t.SYMBOL="^";n.SYMBOL=i},function(module,exports,__webpack_require__){(function(module,process){"use strict";var parser=function(){function Parser(){this.yy={}}var o=function(r,t,e,n){for(e=e||{},n=r.length;n--;e[r[n]]=t);return e},$V0=[1,5],$V1=[1,8],$V2=[1,6],$V3=[1,7],$V4=[1,9],$V5=[1,14],$V6=[1,15],$V7=[1,16],$V8=[1,12],$V9=[1,13],$Va=[1,17],$Vb=[1,19],$Vc=[1,20],$Vd=[1,21],$Ve=[1,22],$Vf=[1,23],$Vg=[1,24],$Vh=[1,25],$Vi=[1,26],$Vj=[1,27],$Vk=[1,28],$Vl=[5,9,10,11,13,14,15,16,17,18,19,20,29,30],$Vm=[5,9,10,11,13,14,15,16,17,18,19,20,29,30,32],$Vn=[1,37],$Vo=[5,9,10,11,13,14,15,16,17,18,19,20,29,30,34],$Vp=[5,10,11,13,14,15,16,17,29,30],$Vq=[5,10,13,14,15,16,29,30],$Vr=[5,10,11,13,14,15,16,17,18,19,29,30],$Vs=[13,29,30],$Vt=[5,9,10,11,13,14,15,16,17,18,19,20,29,30,31,35],parser={trace:function(){},yy:{},symbols_:{error:2,expressions:3,expression:4,EOF:5,variableSequence:6,number:7,STRING:8,"&":9,"=":10,"+":11,"(":12,")":13,"<":14,">":15,NOT:16,"-":17,"*":18,"/":19,"^":20,FUNCTION:21,expseq:22,cell:23,ABSOLUTE_CELL:24,":":25,RELATIVE_CELL:26,MIXED_CELL:27,ARRAY:28,";":29,",":30,VARIABLE:31,DECIMAL:32,NUMBER:33,"%":34,"#":35,"!":36,$accept:0,$end:1},terminals_:{5:"EOF",8:"STRING",9:"&",10:"=",11:"+",12:"(",13:")",14:"<",15:">",16:"NOT",17:"-",18:"*",19:"/",20:"^",21:"FUNCTION",24:"ABSOLUTE_CELL",25:":",26:"RELATIVE_CELL",27:"MIXED_CELL",28:"ARRAY",29:";",30:",",31:"VARIABLE",32:"DECIMAL",33:"NUMBER",34:"%",35:"#",36:"!"},productions_:[0,[3,2],[4,1],[4,1],[4,1],[4,3],[4,3],[4,3],[4,3],[4,4],[4,4],[4,4],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,2],[4,2],[4,3],[4,4],[4,1],[4,1],[4,2],[23,1],[23,3],[23,1],[23,3],[23,1],[23,3],[22,1],[22,1],[22,3],[22,3],[6,1],[6,3],[7,1],[7,3],[7,2],[2,3],[2,4]],performAction:function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 1:return $$[$0-1];case 2:this.$=yy.callVariable($$[$0][0]);break;case 3:this.$=yy.toNumber($$[$0]);break;case 4:this.$=yy.trimEdges($$[$0]);break;case 5:this.$=yy.evaluateByOperator("&",[$$[$0-2],$$[$0]]);break;case 6:this.$=yy.evaluateByOperator("=",[$$[$0-2],$$[$0]]);break;case 7:this.$=yy.evaluateByOperator("+",[$$[$0-2],$$[$0]]);break;case 8:this.$=yy.toNumber($$[$0-1]);break;case 9:this.$=yy.evaluateByOperator("<=",[$$[$0-3],$$[$0]]);break;case 10:this.$=yy.evaluateByOperator(">=",[$$[$0-3],$$[$0]]);break;case 11:this.$=yy.evaluateByOperator("<>",[$$[$0-3],$$[$0]]);break;case 12:this.$=yy.evaluateByOperator("NOT",[$$[$0-2],$$[$0]]);break;case 13:this.$=yy.evaluateByOperator(">",[$$[$0-2],$$[$0]]);break;case 14:this.$=yy.evaluateByOperator("<",[$$[$0-2],$$[$0]]);break;case 15:this.$=yy.evaluateByOperator("-",[$$[$0-2],$$[$0]]);break;case 16:this.$=yy.evaluateByOperator("*",[$$[$0-2],$$[$0]]);break;case 17:this.$=yy.evaluateByOperator("/",[$$[$0-2],$$[$0]]);break;case 18:this.$=yy.evaluateByOperator("^",[$$[$0-2],$$[$0]]);break;case 19:var n1=yy.invertNumber($$[$0]);this.$=n1,isNaN(this.$)&&(this.$=0);break;case 20:var n1=yy.toNumber($$[$0]);this.$=n1,isNaN(this.$)&&(this.$=0);break;case 21:this.$=yy.callFunction($$[$0-2]);break;case 22:this.$=yy.callFunction($$[$0-3],$$[$0-1]);break;case 26:case 28:case 30:this.$=yy.cellValue($$[$0]);break;case 27:case 29:case 31:this.$=yy.rangeValue($$[$0-2],$$[$0]);break;case 32:case 36:this.$=[$$[$0]];break;case 33:var result=[],arr=eval("["+yytext+"]");arr.forEach(function(r){result.push(r)}),this.$=result;break;case 34:case 35:$$[$0-2].push($$[$0]),this.$=$$[$0-2];break;case 37:this.$=Array.isArray($$[$0-2])?$$[$0-2]:[$$[$0-2]],this.$.push($$[$0]);break;case 38:this.$=$$[$0];break;case 39:this.$=1*($$[$0-2]+"."+$$[$0]);break;case 40:this.$=.01*$$[$0-1];break;case 41:case 42:this.$=yy.throwError($$[$0-2]+$$[$0-1]+$$[$0])}},table:[{2:11,3:1,4:2,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{1:[3]},{5:[1,18],9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk},o($Vl,[2,2],{32:[1,29]}),o($Vl,[2,3],{34:[1,30]}),o($Vl,[2,4]),{2:11,4:31,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:32,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:33,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{12:[1,34]},o($Vl,[2,23]),o($Vl,[2,24],{2:35,31:[1,36],35:$Va}),o($Vm,[2,36],{35:$Vn}),o($Vo,[2,38],{32:[1,38]}),o($Vl,[2,26],{25:[1,39]}),o($Vl,[2,28],{25:[1,40]}),o($Vl,[2,30],{25:[1,41]}),{31:[1,42]},{1:[2,1]},{2:11,4:43,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:44,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:45,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:48,6:3,7:4,8:$V0,10:[1,46],11:$V1,12:$V2,15:[1,47],17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:50,6:3,7:4,8:$V0,10:[1,49],11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:51,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:52,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:53,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:54,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:55,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{31:[1,56]},o($Vo,[2,40]),{9:$Vb,10:$Vc,11:$Vd,13:[1,57],14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk},o($Vp,[2,19],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),o($Vp,[2,20],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),{2:11,4:60,6:3,7:4,8:$V0,11:$V1,12:$V2,13:[1,58],17:$V3,21:$V4,22:59,23:10,24:$V5,26:$V6,27:$V7,28:[1,61],31:$V8,33:$V9,35:$Va},o($Vl,[2,25]),{35:$Vn},{31:[1,62]},{33:[1,63]},{24:[1,64]},{26:[1,65]},{27:[1,66]},{36:[1,67]},o($Vl,[2,5]),o([5,10,13,29,30],[2,6],{9:$Vb,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vp,[2,7],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),{2:11,4:68,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:69,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},o($Vq,[2,14],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),{2:11,4:70,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},o($Vq,[2,13],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o([5,10,13,16,29,30],[2,12],{9:$Vb,11:$Vd,14:$Ve,15:$Vf,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vp,[2,15],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),o($Vr,[2,16],{9:$Vb,20:$Vk}),o($Vr,[2,17],{9:$Vb,20:$Vk}),o([5,10,11,13,14,15,16,17,18,19,20,29,30],[2,18],{9:$Vb}),o($Vm,[2,37]),o($Vl,[2,8]),o($Vl,[2,21]),{13:[1,71],29:[1,72],30:[1,73]},o($Vs,[2,32],{9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vs,[2,33]),{36:[1,74]},o($Vo,[2,39]),o($Vl,[2,27]),o($Vl,[2,29]),o($Vl,[2,31]),o($Vt,[2,41]),o($Vq,[2,9],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vq,[2,11],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vq,[2,10],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vl,[2,22]),{2:11,4:75,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:76,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,26:$V6,27:$V7,31:$V8,33:$V9,35:$Va},o($Vt,[2,42]),o($Vs,[2,34],{9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vs,[2,35],{9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk})],defaultActions:{18:[2,1]},parseError:function(r,t){if(!t.recoverable){var e=function(r,t){this.message=r,this.hash=t};throw e.prototype=Error,new e(r,t)}this.trace(r)},parse:function(r){function t(r){n.length=n.length-2*r,a.length=a.length-r,u.length=u.length-r}var e=this,n=[0],a=[null],u=[],i=this.table,o="",s=0,l=0,f=0,c=2,p=1,h=u.slice.call(arguments,1),m=Object.create(this.lexer),E={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(E.yy[v]=this.yy[v]);m.setInput(r,E.yy),E.yy.lexer=m,E.yy.parser=this,"undefined"==typeof m.yylloc&&(m.yylloc={});var g=m.yylloc;u.push(g);var N=m.options&&m.options.ranges;"function"==typeof E.yy.parseError?this.parseError=E.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var d,I,b,y,M,A,R,S,O,T=function(){var r;return r=m.lex()||p,"number"!=typeof r&&(r=e.symbols_[r]||r),r},x={};;){if(b=n[n.length-1],this.defaultActions[b]?y=this.defaultActions[b]:(null!==d&&"undefined"!=typeof d||(d=T()),y=i[b]&&i[b][d]),"undefined"==typeof y||!y.length||!y[0]){var V,$=function(r){for(var t=n.length-1,e=0;;){if(c.toString()in i[r])return e;if(0===r||t<2)return!1;t-=2,r=n[t],++e}},w="";if(f)I!==p&&(V=$(b));else{V=$(b),O=[];for(A in i[b])this.terminals_[A]&&A>c&&O.push("'"+this.terminals_[A]+"'");w=m.showPosition?"Parse error on line "+(s+1)+":\n"+m.showPosition()+"\nExpecting "+O.join(", ")+", got '"+(this.terminals_[d]||d)+"'":"Parse error on line "+(s+1)+": Unexpected "+(d==p?"end of input":"'"+(this.terminals_[d]||d)+"'"),this.parseError(w,{text:m.match,token:this.terminals_[d]||d,line:m.yylineno,loc:g,expected:O,recoverable:V!==!1})}if(3==f){if(d===p||I===p)throw new Error(w||"Parsing halted while starting to recover from another error.");l=m.yyleng,o=m.yytext,s=m.yylineno,g=m.yylloc,d=T()}if(V===!1)throw new Error(w||"Parsing halted. No suitable error recovery rule available.");t(V),I=d==c?null:d,d=c,b=n[n.length-1],y=i[b]&&i[b][c],f=3}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+d);switch(y[0]){case 1:n.push(d),a.push(m.yytext),u.push(m.yylloc),n.push(y[1]),d=null,I?(d=I,I=null):(l=m.yyleng,o=m.yytext,s=m.yylineno,g=m.yylloc,f>0&&f--);break;case 2:if(R=this.productions_[y[1]][1],x.$=a[a.length-R],x._$={first_line:u[u.length-(R||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(R||1)].first_column,last_column:u[u.length-1].last_column},N&&(x._$.range=[u[u.length-(R||1)].range[0],u[u.length-1].range[1]]),M=this.performAction.apply(x,[o,l,s,E.yy,y[1],a,u].concat(h)),"undefined"!=typeof M)return M;R&&(n=n.slice(0,-1*R*2),a=a.slice(0,-1*R),u=u.slice(0,-1*R)),n.push(this.productions_[y[1]][0]),a.push(x.$),u.push(x._$),S=i[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}},lexer=function(){var r={EOF:1,parseError:function(r,t){if(!this.yy.parser)throw new Error(r);this.yy.parser.parseError(r,t)},setInput:function(r,t){return this.yy=t||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var t=r.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},unput:function(r){var t=r.length,e=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),e.length-1&&(this.yylineno-=e.length-1);var a=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:e?(e.length===n.length?this.yylloc.first_column:0)+n[n.length-e.length].length-e[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(r){this.unput(this.match.slice(r))},pastInput:function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var r=this.pastInput(),t=new Array(r.length+1).join("-");return r+this.upcomingInput()+"\n"+t+"^"},test_match:function(r,t){var e,n,a;if(this.options.backtrack_lexer&&(a={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(a.yylloc.range=this.yylloc.range.slice(0))),n=r[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],e=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var u in a)this[u]=a[u];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,t,e,n;this._more||(this.yytext="",this.match="");for(var a=this._currentRules(),u=0;ut[0].length)){if(t=e,n=u,this.options.backtrack_lexer){if(r=this.test_match(e,a[u]),r!==!1)return r;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(r=this.test_match(t,a[n]),r!==!1&&r):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var r=this.next();return r?r:this.lex()},begin:function(r){this.conditionStack.push(r)},popState:function(){var r=this.conditionStack.length-1;return r>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(r){return r=this.conditionStack.length-1-Math.abs(r||0),r>=0?this.conditionStack[r]:"INITIAL"},pushState:function(r){this.begin(r)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(r,t,e,n){switch(e){case 0:break;case 1:return 8;case 2:return 8;case 3:return 21;case 4:return 24;case 5:return 27;case 6:return 27;case 7:return 26;case 8:return 21;case 9:return 31;case 10:return 31;case 11:return 33;case 12:return 28;case 13:break;case 14:return 9;case 15:return" ";case 16:return 32;case 17:return 25;case 18:return 29;case 19:return 30;case 20:return 18;case 21:return 19;case 22:return 17;case 23:return 11;case 24:return 20;case 25:return 12;case 26:return 13;case 27:return 15;case 28:return 14;case 29:return 16;case 30:return'"';case 31:return"'";case 32:return"!";case 33:return 10;case 34:return 34;case 35:return 35;case 36:return 5}},rules:[/^(?:\s+)/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:[A-Za-z]{1,}[A-Za-z_0-9\.]+(?=[(]))/,/^(?:\$[A-Za-z]+\$[0-9]+)/,/^(?:\$[A-Za-z]+[0-9]+)/,/^(?:[A-Za-z]+\$[0-9]+)/,/^(?:[A-Za-z]+[0-9]+)/,/^(?:[A-Za-z\.]+(?=[(]))/,/^(?:[A-Za-z]{1,}[A-Za-z_0-9]+)/,/^(?:[A-Za-z_]+)/,/^(?:[0-9]+)/,/^(?:\[(.*)?\])/,/^(?:\$)/,/^(?:&)/,/^(?: )/,/^(?:[.])/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\/)/,/^(?:-)/,/^(?:\+)/,/^(?:\^)/,/^(?:\()/,/^(?:\))/,/^(?:>)/,/^(?:<)/,/^(?:NOT\b)/,/^(?:")/,/^(?:')/,/^(?:!)/,/^(?:=)/,/^(?:%)/,/^(?:[#])/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],inclusive:!0}}};return r}();return parser.lexer=lexer,Parser.prototype=parser,parser.Parser=Parser,new Parser}();exports.parser=parser,exports.Parser=parser.Parser,exports.parse=function(){return parser.parse.apply(parser,arguments)},"undefined"!=typeof module&&__webpack_require__.c[0]===module&&exports.main(process.argv.slice(1))}).call(exports,__webpack_require__(41)(module),__webpack_require__(20))},function(r,t){r.exports=function(r){return r.webpackPolyfill||(r.deprecate=function(){},r.paths=[],r.children=[],r.webpackPolyfill=1),r}},function(r,t){"use strict";function e(r){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];return r=r.substring(t,r.length-t)}Object.defineProperty(t,"__esModule",{value:!0}),t.trimEdges=e},function(r,t){"use strict";function e(r){if(!l.test(r))return[];var t=r.match(l),e=s(t,5),n=e[1],u=e[2],o=e[3],f=e[4];return[{index:i(f),label:f,isAbsolute:"$"===o},{index:a(u),label:u,isAbsolute:"$"===n}]}function n(r,t){var e=(r.isAbsolute?"$":"")+o(r.index),n=(t.isAbsolute?"$":"")+u(t.index);return n+e}function a(r){var t=0;if(r)for(var e=0,n=r.length-1;e=0;)t=String.fromCharCode(r%c+97)+t,r=Math.floor(r/c)-1;return t.toUpperCase()}function i(r){var t=parseInt(r,10);return t=isNaN(t)?-1:Math.max(t-1,-1)}function o(r){var t="";return r>=0&&(t=""+(r+1)),t}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function r(r,t){var e=[],n=!0,a=!1,u=void 0;try{for(var i,o=r[Symbol.iterator]();!(n=(i=o.next()).done)&&(e.push(i.value),!t||e.length!==t);n=!0);}catch(r){a=!0,u=r}finally{try{!n&&o.return&&o.return()}finally{if(a)throw u}}return e}return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return r(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.extractLabel=e,t.toLabel=n,t.columnLabelToIndex=a,t.columnIndexToLabel=u,t.rowLabelToIndex=i,t.rowIndexToLabel=o;var l=/^([$])?([A-Za-z]+)([$])?([0-9]+)$/,f="ABCDEFGHIJKLMNOPQRSTUVWXYZ",c=f.length}])}); +t=o.parseNumber(t),e=o.parseNumber(e),n=o.parseNumber(n),o.anyIsError(r,t,e,n)?u.value:n*r*(t/e-1)},t.MDURATION=function(){throw new Error("MDURATION is not implemented")},t.MIRR=function(r,e,n){if(r=o.parseNumberArray(o.flatten(r)),e=o.parseNumber(e),n=o.parseNumber(n),o.anyIsError(r,e,n))return u.value;for(var a=r.length,i=[],s=[],l=0;lp&&ve?u.num:(n=parseInt(n,10),(r-t)*(e-n+1)*2/(e*(e+1)))},t.TBILLEQ=function(r,t,e){return r=o.parseDate(r),t=o.parseDate(t),e=o.parseNumber(e),o.anyIsError(r,t,e)?u.value:e<=0?u.num:r>t?u.num:t-r>31536e6?u.num:365*e/(360-e*i.DAYS360(r,t,!1))},t.TBILLPRICE=function(r,t,e){return r=o.parseDate(r),t=o.parseDate(t),e=o.parseNumber(e),o.anyIsError(r,t,e)?u.value:e<=0?u.num:r>t?u.num:t-r>31536e6?u.num:100*(1-e*i.DAYS360(r,t,!1)/360)},t.TBILLYIELD=function(r,t,e){return r=o.parseDate(r),t=o.parseDate(t),e=o.parseNumber(e),o.anyIsError(r,t,e)?u.value:e<=0?u.num:r>t?u.num:t-r>31536e6?u.num:360*(100-e)/(e*i.DAYS360(r,t,!1))},t.VDB=function(){throw new Error("VDB is not implemented")},t.XNPV=function(r,t,e){if(r=o.parseNumber(r),t=o.parseNumberArray(o.flatten(t)),e=o.parseDateArray(o.flatten(e)),o.anyIsError(r,t,e))return u.value;for(var n=0,a=0;au&&(a=i+1,u=t[i]):(a=i+1,u=t[i]))}else if(0===e){if("string"==typeof r){if(r=r.replace(/\?/g,"."),t[i].toLowerCase().match(r.toLowerCase()))return i+1}else if(t[i]===r)return i+1}else if(e===-1){if(t[i]===r)return i+1;t[i]>r&&(u?t[i]t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;var n=t.SYMBOL=">";e.SYMBOL=n},function(r,t){"use strict";function e(r,t){return r>=t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;var n=t.SYMBOL=">=";e.SYMBOL=n},function(r,t){"use strict";function e(r,t){return r1?t-1:0),n=1;n1?t-1:0),n=1;n";e.SYMBOL=n},function(r,t,e){"use strict";function n(r,t){var e=Math.pow((0,a.toNumber)(r),(0,a.toNumber)(t));if(isNaN(e))throw Error(u.ERROR_VALUE);return e}Object.defineProperty(t,"__esModule",{value:!0}),t.SYMBOL=void 0,t.default=n;var a=e(6),u=e(7),i=t.SYMBOL="^";n.SYMBOL=i},function(module,exports,__webpack_require__){(function(module,process){"use strict";var parser=function(){function Parser(){this.yy={}}var o=function(r,t,e,n){for(e=e||{},n=r.length;n--;e[r[n]]=t);return e},$V0=[1,5],$V1=[1,8],$V2=[1,6],$V3=[1,7],$V4=[1,9],$V5=[1,14],$V6=[1,15],$V7=[1,16],$V8=[1,12],$V9=[1,13],$Va=[1,17],$Vb=[1,19],$Vc=[1,20],$Vd=[1,21],$Ve=[1,22],$Vf=[1,23],$Vg=[1,24],$Vh=[1,25],$Vi=[1,26],$Vj=[1,27],$Vk=[1,28],$Vl=[5,9,10,11,13,14,15,16,17,18,19,20,29,30],$Vm=[5,9,10,11,13,14,15,16,17,18,19,20,29,30,32],$Vn=[1,37],$Vo=[5,9,10,11,13,14,15,16,17,18,19,20,29,30,34],$Vp=[5,10,11,13,14,15,16,17,29,30],$Vq=[5,10,13,14,15,16,29,30],$Vr=[5,10,11,13,14,15,16,17,18,19,29,30],$Vs=[13,29,30],$Vt=[5,9,10,11,13,14,15,16,17,18,19,20,29,30,31,35],parser={trace:function(){},yy:{},symbols_:{error:2,expressions:3,expression:4,EOF:5,variableSequence:6,number:7,STRING:8,"&":9,"=":10,"+":11,"(":12,")":13,"<":14,">":15,NOT:16,"-":17,"*":18,"/":19,"^":20,FUNCTION:21,expseq:22,cell:23,ABSOLUTE_CELL:24,RELATIVE_CELL:25,MIXED_CELL:26,":":27,ARRAY:28,";":29,",":30,VARIABLE:31,DECIMAL:32,NUMBER:33,"%":34,"#":35,"!":36,$accept:0,$end:1},terminals_:{5:"EOF",8:"STRING",9:"&",10:"=",11:"+",12:"(",13:")",14:"<",15:">",16:"NOT",17:"-",18:"*",19:"/",20:"^",21:"FUNCTION",24:"ABSOLUTE_CELL",25:"RELATIVE_CELL",26:"MIXED_CELL",27:":",28:"ARRAY",29:";",30:",",31:"VARIABLE",32:"DECIMAL",33:"NUMBER",34:"%",35:"#",36:"!"},productions_:[0,[3,2],[4,1],[4,1],[4,1],[4,3],[4,3],[4,3],[4,3],[4,4],[4,4],[4,4],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,2],[4,2],[4,3],[4,4],[4,1],[4,1],[4,2],[23,1],[23,1],[23,1],[23,3],[23,3],[23,3],[23,3],[23,3],[23,3],[23,3],[23,3],[23,3],[22,1],[22,1],[22,3],[22,3],[6,1],[6,3],[7,1],[7,3],[7,2],[2,3],[2,4]],performAction:function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 1:return $$[$0-1];case 2:this.$=yy.callVariable($$[$0][0]);break;case 3:this.$=yy.toNumber($$[$0]);break;case 4:this.$=yy.trimEdges($$[$0]);break;case 5:this.$=yy.evaluateByOperator("&",[$$[$0-2],$$[$0]]);break;case 6:this.$=yy.evaluateByOperator("=",[$$[$0-2],$$[$0]]);break;case 7:this.$=yy.evaluateByOperator("+",[$$[$0-2],$$[$0]]);break;case 8:this.$=yy.toNumber($$[$0-1]);break;case 9:this.$=yy.evaluateByOperator("<=",[$$[$0-3],$$[$0]]);break;case 10:this.$=yy.evaluateByOperator(">=",[$$[$0-3],$$[$0]]);break;case 11:this.$=yy.evaluateByOperator("<>",[$$[$0-3],$$[$0]]);break;case 12:this.$=yy.evaluateByOperator("NOT",[$$[$0-2],$$[$0]]);break;case 13:this.$=yy.evaluateByOperator(">",[$$[$0-2],$$[$0]]);break;case 14:this.$=yy.evaluateByOperator("<",[$$[$0-2],$$[$0]]);break;case 15:this.$=yy.evaluateByOperator("-",[$$[$0-2],$$[$0]]);break;case 16:this.$=yy.evaluateByOperator("*",[$$[$0-2],$$[$0]]);break;case 17:this.$=yy.evaluateByOperator("/",[$$[$0-2],$$[$0]]);break;case 18:this.$=yy.evaluateByOperator("^",[$$[$0-2],$$[$0]]);break;case 19:var n1=yy.invertNumber($$[$0]);this.$=n1,isNaN(this.$)&&(this.$=0);break;case 20:var n1=yy.toNumber($$[$0]);this.$=n1,isNaN(this.$)&&(this.$=0);break;case 21:this.$=yy.callFunction($$[$0-2]);break;case 22:this.$=yy.callFunction($$[$0-3],$$[$0-1]);break;case 26:case 27:case 28:this.$=yy.cellValue($$[$0]);break;case 29:case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:this.$=yy.rangeValue($$[$0-2],$$[$0]);break;case 38:case 42:this.$=[$$[$0]];break;case 39:var result=[],arr=eval("["+yytext+"]");arr.forEach(function(r){result.push(r)}),this.$=result;break;case 40:case 41:$$[$0-2].push($$[$0]),this.$=$$[$0-2];break;case 43:this.$=Array.isArray($$[$0-2])?$$[$0-2]:[$$[$0-2]],this.$.push($$[$0]);break;case 44:this.$=$$[$0];break;case 45:this.$=1*($$[$0-2]+"."+$$[$0]);break;case 46:this.$=.01*$$[$0-1];break;case 47:case 48:this.$=yy.throwError($$[$0-2]+$$[$0-1]+$$[$0])}},table:[{2:11,3:1,4:2,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{1:[3]},{5:[1,18],9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk},o($Vl,[2,2],{32:[1,29]}),o($Vl,[2,3],{34:[1,30]}),o($Vl,[2,4]),{2:11,4:31,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:32,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:33,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{12:[1,34]},o($Vl,[2,23]),o($Vl,[2,24],{2:35,31:[1,36],35:$Va}),o($Vm,[2,42],{35:$Vn}),o($Vo,[2,44],{32:[1,38]}),o($Vl,[2,26],{27:[1,39]}),o($Vl,[2,27],{27:[1,40]}),o($Vl,[2,28],{27:[1,41]}),{31:[1,42]},{1:[2,1]},{2:11,4:43,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:44,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:45,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:48,6:3,7:4,8:$V0,10:[1,46],11:$V1,12:$V2,15:[1,47],17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:50,6:3,7:4,8:$V0,10:[1,49],11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:51,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:52,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:53,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:54,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:55,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{31:[1,56]},o($Vo,[2,46]),{9:$Vb,10:$Vc,11:$Vd,13:[1,57],14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk},o($Vp,[2,19],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),o($Vp,[2,20],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),{2:11,4:60,6:3,7:4,8:$V0,11:$V1,12:$V2,13:[1,58],17:$V3,21:$V4,22:59,23:10,24:$V5,25:$V6,26:$V7,28:[1,61],31:$V8,33:$V9,35:$Va},o($Vl,[2,25]),{35:$Vn},{31:[1,62]},{33:[1,63]},{24:[1,64],25:[1,65],26:[1,66]},{24:[1,67],25:[1,68],26:[1,69]},{24:[1,70],25:[1,71],26:[1,72]},{36:[1,73]},o($Vl,[2,5]),o([5,10,13,29,30],[2,6],{9:$Vb,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vp,[2,7],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),{2:11,4:74,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:75,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},o($Vq,[2,14],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),{2:11,4:76,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},o($Vq,[2,13],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o([5,10,13,16,29,30],[2,12],{9:$Vb,11:$Vd,14:$Ve,15:$Vf,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vp,[2,15],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),o($Vr,[2,16],{9:$Vb,20:$Vk}),o($Vr,[2,17],{9:$Vb,20:$Vk}),o([5,10,11,13,14,15,16,17,18,19,20,29,30],[2,18],{9:$Vb}),o($Vm,[2,43]),o($Vl,[2,8]),o($Vl,[2,21]),{13:[1,77],29:[1,78],30:[1,79]},o($Vs,[2,38],{9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vs,[2,39]),{36:[1,80]},o($Vo,[2,45]),o($Vl,[2,29]),o($Vl,[2,30]),o($Vl,[2,31]),o($Vl,[2,32]),o($Vl,[2,33]),o($Vl,[2,34]),o($Vl,[2,35]),o($Vl,[2,36]),o($Vl,[2,37]),o($Vt,[2,47]),o($Vq,[2,9],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vq,[2,11],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vq,[2,10],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vl,[2,22]),{2:11,4:81,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:82,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},o($Vt,[2,48]),o($Vs,[2,40],{9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vs,[2,41],{9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk})],defaultActions:{18:[2,1]},parseError:function(r,t){if(!t.recoverable){var e=function(r,t){this.message=r,this.hash=t};throw e.prototype=Error,new e(r,t)}this.trace(r)},parse:function(r){function t(r){n.length=n.length-2*r,a.length=a.length-r,u.length=u.length-r}var e=this,n=[0],a=[null],u=[],i=this.table,o="",s=0,l=0,f=0,c=2,p=1,h=u.slice.call(arguments,1),m=Object.create(this.lexer),E={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(E.yy[v]=this.yy[v]);m.setInput(r,E.yy),E.yy.lexer=m,E.yy.parser=this,"undefined"==typeof m.yylloc&&(m.yylloc={});var g=m.yylloc;u.push(g);var N=m.options&&m.options.ranges;"function"==typeof E.yy.parseError?this.parseError=E.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var d,I,b,y,M,A,R,S,O,T=function(){var r;return r=m.lex()||p,"number"!=typeof r&&(r=e.symbols_[r]||r),r},x={};;){if(b=n[n.length-1],this.defaultActions[b]?y=this.defaultActions[b]:(null!==d&&"undefined"!=typeof d||(d=T()),y=i[b]&&i[b][d]),"undefined"==typeof y||!y.length||!y[0]){var V,$=function(r){for(var t=n.length-1,e=0;;){if(c.toString()in i[r])return e;if(0===r||t<2)return!1;t-=2,r=n[t],++e}},w="";if(f)I!==p&&(V=$(b));else{V=$(b),O=[];for(A in i[b])this.terminals_[A]&&A>c&&O.push("'"+this.terminals_[A]+"'");w=m.showPosition?"Parse error on line "+(s+1)+":\n"+m.showPosition()+"\nExpecting "+O.join(", ")+", got '"+(this.terminals_[d]||d)+"'":"Parse error on line "+(s+1)+": Unexpected "+(d==p?"end of input":"'"+(this.terminals_[d]||d)+"'"),this.parseError(w,{text:m.match,token:this.terminals_[d]||d,line:m.yylineno,loc:g,expected:O,recoverable:V!==!1})}if(3==f){if(d===p||I===p)throw new Error(w||"Parsing halted while starting to recover from another error.");l=m.yyleng,o=m.yytext,s=m.yylineno,g=m.yylloc,d=T()}if(V===!1)throw new Error(w||"Parsing halted. No suitable error recovery rule available.");t(V),I=d==c?null:d,d=c,b=n[n.length-1],y=i[b]&&i[b][c],f=3}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+d);switch(y[0]){case 1:n.push(d),a.push(m.yytext),u.push(m.yylloc),n.push(y[1]),d=null,I?(d=I,I=null):(l=m.yyleng,o=m.yytext,s=m.yylineno,g=m.yylloc,f>0&&f--);break;case 2:if(R=this.productions_[y[1]][1],x.$=a[a.length-R],x._$={first_line:u[u.length-(R||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(R||1)].first_column,last_column:u[u.length-1].last_column},N&&(x._$.range=[u[u.length-(R||1)].range[0],u[u.length-1].range[1]]),M=this.performAction.apply(x,[o,l,s,E.yy,y[1],a,u].concat(h)),"undefined"!=typeof M)return M;R&&(n=n.slice(0,-1*R*2),a=a.slice(0,-1*R),u=u.slice(0,-1*R)),n.push(this.productions_[y[1]][0]),a.push(x.$),u.push(x._$),S=i[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}},lexer=function(){var r={EOF:1,parseError:function(r,t){if(!this.yy.parser)throw new Error(r);this.yy.parser.parseError(r,t)},setInput:function(r,t){return this.yy=t||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var t=r.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},unput:function(r){var t=r.length,e=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),e.length-1&&(this.yylineno-=e.length-1);var a=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:e?(e.length===n.length?this.yylloc.first_column:0)+n[n.length-e.length].length-e[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(r){this.unput(this.match.slice(r))},pastInput:function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var r=this.pastInput(),t=new Array(r.length+1).join("-");return r+this.upcomingInput()+"\n"+t+"^"},test_match:function(r,t){var e,n,a;if(this.options.backtrack_lexer&&(a={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(a.yylloc.range=this.yylloc.range.slice(0))),n=r[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],e=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var u in a)this[u]=a[u];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,t,e,n;this._more||(this.yytext="",this.match="");for(var a=this._currentRules(),u=0;ut[0].length)){if(t=e,n=u,this.options.backtrack_lexer){if(r=this.test_match(e,a[u]),r!==!1)return r;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(r=this.test_match(t,a[n]),r!==!1&&r):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var r=this.next();return r?r:this.lex()},begin:function(r){this.conditionStack.push(r)},popState:function(){var r=this.conditionStack.length-1;return r>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(r){return r=this.conditionStack.length-1-Math.abs(r||0),r>=0?this.conditionStack[r]:"INITIAL"},pushState:function(r){this.begin(r)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(r,t,e,n){switch(e){case 0:break;case 1:return 8;case 2:return 8;case 3:return 21;case 4:return 24;case 5:return 26;case 6:return 26;case 7:return 25;case 8:return 21;case 9:return 31;case 10:return 31;case 11:return 33;case 12:return 28;case 13:break;case 14:return 9;case 15:return" ";case 16:return 32;case 17:return 27;case 18:return 29;case 19:return 30;case 20:return 18;case 21:return 19;case 22:return 17;case 23:return 11;case 24:return 20;case 25:return 12;case 26:return 13;case 27:return 15;case 28:return 14;case 29:return 16;case 30:return'"';case 31:return"'";case 32:return"!";case 33:return 10;case 34:return 34;case 35:return 35;case 36:return 5}},rules:[/^(?:\s+)/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:[A-Za-z]{1,}[A-Za-z_0-9\.]+(?=[(]))/,/^(?:\$[A-Za-z]+\$[0-9]+)/,/^(?:\$[A-Za-z]+[0-9]+)/,/^(?:[A-Za-z]+\$[0-9]+)/,/^(?:[A-Za-z]+[0-9]+)/,/^(?:[A-Za-z\.]+(?=[(]))/,/^(?:[A-Za-z]{1,}[A-Za-z_0-9]+)/,/^(?:[A-Za-z_]+)/,/^(?:[0-9]+)/,/^(?:\[(.*)?\])/,/^(?:\$)/,/^(?:&)/,/^(?: )/,/^(?:[.])/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\/)/,/^(?:-)/,/^(?:\+)/,/^(?:\^)/,/^(?:\()/,/^(?:\))/,/^(?:>)/,/^(?:<)/,/^(?:NOT\b)/,/^(?:")/,/^(?:')/,/^(?:!)/,/^(?:=)/,/^(?:%)/,/^(?:[#])/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],inclusive:!0}}};return r}();return parser.lexer=lexer,Parser.prototype=parser,parser.Parser=Parser,new Parser}();exports.parser=parser,exports.Parser=parser.Parser,exports.parse=function(){return parser.parse.apply(parser,arguments)},"undefined"!=typeof module&&__webpack_require__.c[0]===module&&exports.main(process.argv.slice(1))}).call(exports,__webpack_require__(41)(module),__webpack_require__(20))},function(r,t){r.exports=function(r){return r.webpackPolyfill||(r.deprecate=function(){},r.paths=[],r.children=[],r.webpackPolyfill=1),r}},function(r,t){"use strict";function e(r){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];return r=r.substring(t,r.length-t)}Object.defineProperty(t,"__esModule",{value:!0}),t.trimEdges=e},function(r,t){"use strict";function e(r){if(!l.test(r))return[];var t=r.match(l),e=s(t,5),n=e[1],u=e[2],o=e[3],f=e[4];return[{index:i(f),label:f,isAbsolute:"$"===o},{index:a(u),label:u,isAbsolute:"$"===n}]}function n(r,t){var e=(r.isAbsolute?"$":"")+o(r.index),n=(t.isAbsolute?"$":"")+u(t.index);return n+e}function a(r){var t=0;if(r)for(var e=0,n=r.length-1;e=0;)t=String.fromCharCode(r%c+97)+t,r=Math.floor(r/c)-1;return t.toUpperCase()}function i(r){var t=parseInt(r,10);return t=isNaN(t)?-1:Math.max(t-1,-1)}function o(r){var t="";return r>=0&&(t=""+(r+1)),t}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function r(r,t){var e=[],n=!0,a=!1,u=void 0;try{for(var i,o=r[Symbol.iterator]();!(n=(i=o.next()).done)&&(e.push(i.value),!t||e.length!==t);n=!0);}catch(r){a=!0,u=r}finally{try{!n&&o.return&&o.return()}finally{if(a)throw u}}return e}return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return r(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.extractLabel=e,t.toLabel=n,t.columnLabelToIndex=a,t.columnIndexToLabel=u,t.rowLabelToIndex=i,t.rowIndexToLabel=o;var l=/^([$])?([A-Za-z]+)([$])?([0-9]+)$/,f="ABCDEFGHIJKLMNOPQRSTUVWXYZ",c=f.length}])}); //# sourceMappingURL=formula-parser.min.js.map diff --git a/dist/formula-parser.min.js.map b/dist/formula-parser.min.js.map index 58a876a8..e9ad48ee 100644 --- a/dist/formula-parser.min.js.map +++ b/dist/formula-parser.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["formula-parser.min.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","_interopRequireDefault","obj","__esModule","default","Object","defineProperty","value","rowLabelToIndex","rowIndexToLabel","columnLabelToIndex","columnIndexToLabel","toLabel","extractLabel","error","Parser","ERROR_VALUE","ERROR_REF","ERROR_NUM","ERROR_NULL","ERROR_NOT_AVAILABLE","ERROR_NEED_UPDATE","ERROR_NAME","ERROR_DIV_ZERO","ERROR","SUPPORTED_FORMULAS","undefined","_parser","_error","_error2","_cell","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","prototype","create","constructor","enumerable","writable","configurable","setPrototypeOf","__proto__","_slicedToArray","sliceIterator","arr","i","_arr","_n","_d","_e","_s","_i","Symbol","iterator","next","done","push","length","err","Array","isArray","_createClass","defineProperties","target","props","descriptor","key","protoProps","staticProps","_supportedFormulas","get","_tinyEmitter","_tinyEmitter2","_evaluateByOperator","_evaluateByOperator2","_grammarParser","_string","_number","_Emitter","_this","getPrototypeOf","parser","yy","toNumber","trimEdges","invertNumber","throwError","errorName","_throwError","callVariable","variable","_callVariable","evaluateByOperator","callFunction","cellValue","_callCellValue","rangeValue","start","end","_callRangeValue","variables","setVariable","expression","result","parse","ex","message","Error","name","getVariable","emit","newValue","label","_extractLabel","_extractLabel2","row","column","_value","startLabel","endLabel","_extractLabel3","_extractLabel4","startRow","startColumn","_extractLabel5","_extractLabel6","endRow","endColumn","startCell","endCell","index","arguments","parsedError","E","on","callback","ctx","e","fn","once","listener","off","apply","_","data","slice","evtArr","len","evts","liveEvents","_toConsumableArray","arr2","from","operator","params","toUpperCase","availableOperators","registerOperation","symbol","func","forEach","s","isFactory","_add","_add2","_ampersand","_ampersand2","_divide","_divide2","_equal","_equal2","_formulaFunction","_formulaFunction2","_greaterThan","_greaterThan2","_greaterThanOrEqual","_greaterThanOrEqual2","_lessThan","_lessThan2","_lessThanOrEqual","_lessThanOrEqual2","_minus","_minus2","_multiply","_multiply2","_notEqual","_notEqual2","_power","_power2","SYMBOL","first","_len","rest","_key","reduce","acc","isNaN","number","indexOf","parseFloat","parseInt","_defineProperty","type","replace","errors","_errors","toString","Infinity","exp1","exp2","_interopRequireWildcard","newObj","hasOwnProperty","symbolParts","split","foundFormula","formulajs","nestedFormula","_supportedFormulas2","_formulajs","categories","category","f","set","mathTrig","statistical","engineering","dateTime","BETADIST","BETA","DIST","BETAINV","INV","BINOMDIST","BINOM","CEILING","ISOCEILING","MATH","CEILINGMATH","CEILINGPRECISE","PRECISE","CHIDIST","CHISQ","CHIDISTRT","RT","CHIINV","CHIINVRT","CHITEST","TEST","CONFIDENCE","NORM","COVAR","COVARIANCE","P","COVARIANCEP","COVARIANCES","S","CRITBINOM","EXPONDIST","EXPON","ERFCPRECISE","ERFC","ERFPRECISE","ERF","FDIST","F","FDISTRT","FINVRT","FINV","FLOOR","FLOORMATH","FLOORPRECISE","FTEST","GAMMADIST","GAMMA","GAMMAINV","GAMMALNPRECISE","GAMMALN","HYPGEOMDIST","HYPGEOM","LOGINV","LOGNORM","LOGNORMINV","LOGNORMDIST","MODE","SNGL","MODEMULT","MULT","MODESNGL","NEGBINOMDIST","NEGBINOM","NETWORKDAYSINTL","NETWORKDAYS","INTL","NORMDIST","NORMINV","NORMSDIST","NORMSINV","PERCENTILE","EXC","PERCENTILEEXC","PERCENTILEINC","INC","PERCENTRANK","PERCENTRANKEXC","PERCENTRANKINC","POISSON","POISSONDIST","QUARTILE","QUARTILEEXC","QUARTILEINC","RANK","EQ","RANKAVG","AVG","RANKEQ","SKEWP","SKEW","STDEV","STDEVP","STDEVS","TDIST","T","TDISTRT","TINV","TTEST","VAR","VARP","VARS","WEIBULL","WEIBULLDIST","WORKDAYINTL","WORKDAY","ZTEST","Z","utils","information","ABS","parseNumber","Math","abs","ACOS","acos","num","ACOSH","log","sqrt","ACOT","atan","ACOTH","AGGREGATE","function_num","options","ref1","ref2","anyIsError","AVERAGE","COUNT","COUNTA","MAX","MIN","PRODUCT","SUM","MEDIAN","LARGE","SMALL","ARABIC","text","test","r","M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I","ASIN","asin","ASINH","ATAN","ATAN2","number_x","number_y","atan2","ATANH","BASE","radix","min_length","max","join","significance","mode","precision","floor","ROUND","ceil","COMBIN","number_chosen","FACT","COMBINA","COS","cos","COSH","exp","COT","tan","COTH","e2","CSC","sin","CSCH","DECIMAL","DEGREES","PI","EVEN","EXP","MEMOIZED_FACT","n","FACTDOUBLE","GCD","range","parseNumberArray","flatten","r0","x","ri","y","INT","ISO","LCM","o","j","d","pop","splice","LN","LN10","LN2","LOG10E","LOG2E","LOG","base","LOG10","MOD","dividend","divisor","div0","modulus","MROUND","multiple","round","MULTINOMIAL","args","sum","ODD","temp","POWER","power","pow","QUOTIENT","numerator","denominator","RADIANS","RAND","random","RANDBETWEEN","bottom","top","ROMAN","digits","String","roman","ROUNDDOWN","sign","ROUNDUP","SEC","SECH","SERIESSUM","coefficients","SIGN","SIN","SINH","SQRT","SQRTPI","SQRT1_2","SQRT2","SUBTOTAL","function_code","ADD","num1","num2","na","MINUS","DIVIDE","MULTIPLY","factor1","factor2","GTE","LT","LTE","value1","value2","NE","POW","exponent","arrayEach","argsToArray","parsed","SUMIF","criteria","eval","SUMIFS","shift","n_range_elements","n_criterias","el","condition","SUMPRODUCT","product","k","_ij","arrays","SUMSQ","numbers","ISNUMBER","SUMX2MY2","array_x","array_y","SUMX2PY2","SUMXMY2","TAN","TANH","TRUNC","flattenShallow","array","a","b","aIsArray","bIsArray","concat","isFlat","possibleNumbers","filter","cleanFloat","parseBool","bool","up","Date","string","parseMatrix","matrix","pnarr","d1900","parseDate","date","getTime","parseDateArray","arrayValuesToNumbers","idx","initial","iteratee","nil","ref","jStat","misc","SQRT2PI","AVEDEV","subtract","mean","count","AVERAGEA","AVERAGEIF","average_range","average_count","AVERAGEIFS","average","alpha","beta","cumulative","A","B","cdf","pdf","probability","inv","successes","trials","binomial","RANGE","successes2","chisquare","observed","expected","ChiSq","xsqr","dof","Pi","t","tmp","col","COLUMN","COLUMNS","cols","sd","normalci","tci","CORREL","array1","array2","corrcoeff","COUNTBLANK","COUNTIN","element","blanks","COUNTIF","matches","COUNTIFS","results","COUNTUNIQUE","UNIQUE","mean1","mean2","covariance","DEVSQ","lambda","exponential","d1","d2","centralF","sumOfSquares","values","x1","x2","sum1","sum2","FISHER","FISHERINV","e2y","FORECAST","data_y","data_x","xmean","ymean","den","FREQUENCY","bins","gammafn","gamma","gammaln","GAUSS","z","normal","GEOMEAN","geomean","GROWTH","known_y","known_x","new_x","use_const","avg_x","avg_y","avg_xy","avg_xx","new_y","HARMEAN","N","INTERCEPT","KURT","sigma","stdev","sort","LINEST","LOGEST","lognormal","MAXA","median","min","MINA","currentItem","maxItems","negbin","PEARSON","den1","den2","l","fl","uniques","match","PERMUT","PERMUTATIONA","PHI","poisson","PROB","lower","upper","sorted","quart","order","ROW","ROWS","rows","RSQ","m2","m3","SLOPE","STANDARDIZE","v","STDEVA","VARA","STDEVPA","VARPA","STEYX","lft","TRANSPOSE","transpose","df","studentt","mean_x","mean_y","s_x","s_y","TREND","new_data_x","linest","TRIMMEAN","percent","trim","numbro","ASC","BAHTTEXT","CHAR","fromCharCode","CLEAN","re","CODE","charCodeAt","CONCATENATE","trueFound","falseFound","DBCS","DOLLAR","decimals","format","EXACT","text1","text2","FIND","find_text","within_text","position","FIXED","no_commas","HTML2TEXT","line","LEFT","substring","LEN","LOWER","toLowerCase","MID","begin","NUMBERVALUE","decimal_separator","group_separator","Number","PRONETIC","PROPER","txt","charAt","substr","REGEXEXTRACT","regular_expression","RegExp","REGEXMATCH","full","REGEXREPLACE","replacement","REPLACE","new_text","REPT","RIGHT","SEARCH","foundAt","SPLIT","separator","SUBSTITUTE","old_text","occurrence","TEXT","TRIM","UNICHAR","UNICODE","UPPER","VALUE","unformat","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","process","Numbro","zeroes","ret","toFixedLargeSmall","mantissa","beforeDec","afterDec","prefix","endStr","zerosStr","str","toFixed","roundingFunction","optionals","optionalsRegExp","output","formatNumbro","escapedFormat","formatCurrency","formatPercentage","formatTime","formatNumber","unformatNumbro","thousandRegExp","millionRegExp","billionRegExp","trillionRegExp","stringOriginal","bytesMultiplier","unformatTime","zeroFormat","cultures","currentCulture","delimiters","decimal","abbreviations","thousand","currency","million","billion","trillion","binarySuffixes","decimalSuffixes","NaN","originalFormat","spliceIndex","symbolIndex","openParenIndex","plusSignIndex","minusSignIndex","space","decimalSeparator","spaceSeparated","hours","minutes","seconds","timeArray","formatByteUnits","suffixes","scale","suffix","sep","byteFormat","units","totalLength","minimumPrecision","w","intPrecision","postfix","thousands","indexOpenP","size","indexMinus","minlen","negP","signed","optDec","abbr","abbrK","abbrM","abbrB","abbrT","abbrForce","bytes","ord","forcedNeg","neg","paren","isFinite","info","byteFormatOrder","marker","ordinal","setCulture","code","chooseCulture","defaults","defaultFormat","currencyFormat","defaultCurrencyFormat","inNodejsRuntime","browser","title","multiplier","parts","correctionFactor","prev","mp","mn","VERSION","general","binary","languages","hasModule","enUS","formats","fourDigits","fullWithTwoDecimals","fullWithTwoDecimalsNoCurrency","input","isNumbro","version","setLanguage","newLanguage","fallbackLanguage","console","warn","matchingLanguage","keys","language","newCulture","fallbackCulture","matchingCulture","culture","languageData","cultureData","validate","val","_decimalSep","_thousandSep","_currSymbol","_valArray","_abbrObj","_thousandRegEx","loadLanguagesInNode","loadCulturesInNode","langLocaleCode","optInitialValue","isValueSet","clone","inputString","binaryByteUnits","byteUnits","decimalByteUnits","valueOf","add","cback","accum","curr","corrFactor","multiply","divide","difference","ender","window","cleanUpNextTick","draining","currentQueue","queue","queueIndex","drainQueue","timeout","cachedSetTimeout","run","cachedClearTimeout","Item","fun","noop","setTimeout","clearTimeout","nextTick","env","argv","versions","addListener","removeListener","removeAllListeners","binding","cwd","chdir","dir","umask","j$","calcRdx","isFunction","arg","isNumber","toVector","_init","retZero","retOne","retIdent","map","seq","toArray","extend","dimensions","rowa","submat","arange","ind","cola","diag","nrow","res","antidiag","objArr","toAlter","ncol","cumreduce","alter","zeros","ones","rand","identity","symmetric","clear","cnt","hival","step","current","rl","_slice","list","copy","rcSlice","colSlice","rowSlice","sliceAssign","nl","ml","diagonal","diagArray","mat","jProto","funcs","passfunc","Function","ascNum","clip","sumsqrd","sumsqerr","sumrow","prod","low","high","unique","hash","meansqerr","arrlen","cumsum","cumprod","diff","diffs","arrLen","rank","ranks","last","lastIndexOf","maxCount","numMaxCount","mode_arr","variance","flag","deviation","dev","meandev","devSum","meddev","coeffvar","quartiles","quantiles","quantilesArray","alphap","betap","aleph","sortedArray","quantileVals","percentile","realIndex","frac","percentileOfScore","score","kind","counter","strict","histogram","binCnt","binWidth","arr1","u","arr1Len","sq_dev","spearmancoeff","arr1dev","arr2dev","stanMoment","mu","skewSum","skewness","kurtosis","fullbool","tmpthis","callbackFunction","argsToPass","curriedFunction","vector","xx","cof","ser","yi","q","fact","xden","xnum","gammap","lowRegGamma","an","aln","ap","del","h","ITMAX","factorialln","factorial","combination","combinationln","permutation","betafn","betaln","betacf","aa","fpmin","qab","qap","qam","gammapinv","pp","lna1","afac","a1","EPS","gln","erf","ty","isneg","dd","erfc","erfcinv","ibetainv","lna","lnb","al","b1","ibeta","bt","randn","randg","shape","a2","oalph","laplaceSign","callee","_a","_b","_c","newthis","sample","vals","fnfunc","df1","df2","cauchy","local","rate","invgamma","kumaraswamy","noncentralt","ncp","tol","min_iterations","flip","prob","lastvalue","std","pareto","dof2","weibull","uniform","binomarr","hypgeom","scaledPDF","samplesDone","scaledCDF","factor","sumarr","triangular","laplace","isUsable","nrescols","rescols","outer","dot","left","right","norm","nnorm","angle","aug","newarr","gauss_jordan","det","alen","alend","rowshift","colshift","mrow","mcol","gauss_elimination","maug","pivot","maxrow","y2","triaUpSolve","matrix_mode","triaLowSolve","lu","R","jj","cholesky","gauss_jacobi","xv","xk","gauss_seidel","SOR","householder","QR","get_Q1","norm_x","e1","norm_u","Q","qr","QList","Qn","lstsq","R_I","Aj","cAi","Ij","cIi","qr_solve","array_mode","attrs","Q1","R1","RI","jacobi","maxim","theta","ev","rungekutta","t_j","u_j","k1","k2","u_j1","k3","k4","romberg","h1","g","richardson","pos","y1","h_min","simpson","hermite","dF","dl","lagrange","cubic_spline","sq","gauss_quadrature","PCA","temp1","temp2","Y","Bt","Vt","differenceOfProportions","p1","n1","p2","n2","pooled","se","zscore","ztest","sides","tscore","ttest","anovafscore","expVar","sampMean","sampSampMean","tmpargs","unexpVar","anovaftest","ftest","fscore","anovaftes","change","ans","significant","pvalue","oneSidedDifferenceOfProportions","twoSidedDifferenceOfProportions","models","sub_regress","endog","exog","ols","var_count","modelList","endog_index","exog_index","nobs","df_model","df_resid","coef","predict","resid","ybar","SSE","SSR","SST","R2","t_test","model","subModelList","sigmaHat","seBetaHat","mod","tStatistic","pValue","leftppf","interval95","F_test","F_statistic","fcdf","ols_wrap","adjust_R2","rsquared","hasElement","FLATTEN","ARGS2ARRAY","REFERENCE","context","reference","path","opening","JOIN","NUMBERS","NUMERAL","CELL","TYPE","error_val","INFO","ISBLANK","ISBINARY","ISERR","ISERROR","ISEVEN","ISFORMULA","ISLOGICAL","ISNA","ISNONTEXT","ISODD","ISREF","ISTEXT","NA","SHEET","SHEETS","isValidBinaryNumber","bessel","BESSELI","besseli","BESSELJ","besselj","BESSELK","besselk","BESSELY","bessely","BIN2DEC","stringified","BIN2HEX","places","BIN2OCT","BITAND","number1","number2","BITLSHIFT","BITOR","BITRSHIFT","BITXOR","COMPLEX","real","imaginary","CONVERT","from_unit","to_unit","alt","binary_prefixes","Yi","Zi","Ei","Ti","Gi","Mi","ki","unit_prefixes","G","to","base_from_unit","base_to_unit","from_multiplier","to_multiplier","from_binary_prefix","from_unit_prefix","to_binary_prefix","to_unit_prefix","DEC2BIN","DEC2HEX","DEC2OCT","DELTA","lower_bound","upper_bound","GESTEP","HEX2BIN","negative","HEX2DEC","HEX2OCT","IMABS","inumber","IMREAL","IMAGINARY","plus","minus","unit","IMARGUMENT","IMCONJUGATE","IMCOS","IMCOSH","IMCOT","IMDIV","IMSIN","inumber1","inumber2","unit1","unit2","IMEXP","IMLN","IMLOG10","IMLOG2","IMPOWER","IMPRODUCT","IMSEC","IMSECH","IMSINH","IMSQRT","IMCSC","IMCSCH","IMSUB","IMSUM","IMTAN","OCT2BIN","OCT2DEC","OCT2HEX","_horner","_bessel_iter","f0","f1","f2","tdx","_bessel_wrap","bessel0","bessel1","nonzero","b0","b0_a1a","b0_a2a","b0_a1b","b0_a2b","W","b1_a1a","b1_a2a","b1_a1b","b1_a2b","reverse","jsum","bjp","bj","bjm","tox","b0_a","b0_b","b1_a","b1_b","bip","bi","bim","isLeapYear","year","getMonth","daysBetween","start_date","end_date","serial","addOn","WEEK_STARTS","WEEK_TYPES","WEEKEND_TYPES","DATE","month","day","DATEVALUE","date_text","DAY","serial_number","getDate","DAYS","DAYS360","method","ed","sm","em","smd","getFullYear","emd","EDATE","months","setMonth","EOMONTH","HOUR","getHours","INTERVAL","second","hour","sec","ISOWEEKNUM","setHours","setDate","getDay","yearStart","MINUTE","getMinutes","MONTH","holidays","weekend","days","total","getTimezoneOffset","getUTCDay","dec","holiday","NOW","SECOND","getSeconds","TIME","minute","TIMEVALUE","time_text","TODAY","WEEKDAY","return_type","WEEKNUM","week_start","jan","inc","YEAR","YEARFRAC","basis","sy","ey","feb29Between","date1","date2","year1","mar1year1","year2","mar1year2","ylength","years","compact","findResultIndex","database","criterias","maxCriteriaLength","currentCriteriaResult","hasMatchingCriteria","criteriaField","stats","maths","FINDFIELD","DAVERAGE","field","resultIndexes","targetFields","DCOUNT","targetValues","DCOUNTA","DGET","DMAX","maxValue","DMIN","minValue","DPRODUCT","DSTDEV","DSTDEVP","DSUM","DVAR","DVARP","AND","CHOOSE","FALSE","IF","then_value","otherwise_value","IFERROR","valueIfError","IFNA","value_if_na","NOT","logical","OR","TRUE","XOR","SWITCH","targetValue","argc","switchCount","switchSatisfied","hasDefaultClause","defaultClause","validDate","ensureDate","ACCRINT","issue","settlement","par","frequency","ACCRINTM","AMORDEGRC","AMORLINC","COUPDAYBS","COUPDAYS","COUPDAYSNC","COUPNCD","COUPNUM","COUPPCD","CUMIPMT","periods","payment","PMT","interest","FV","CUMPRINC","principal","DB","cost","salvage","life","period","ceiling","DDB","DISC","DOLLARDE","dollar","fraction","DOLLARFR","DURATION","EFFECT","term","FVSCHEDULE","schedule","future","INTRATE","IPMT","present","IRR","guess","irrResult","dates","irrResultDeriv","positive","newRate","epsRate","resultValue","resultRate","epsMax","contLoop","ISPMT","MDURATION","MIRR","finance_rate","reinvest_rate","payments","incomes","NPV","NOMINAL","NPER","ODDFPRICE","ODDFYIELD","ODDLPRICE","ODDLYIELD","PDURATION","PPMT","PRICE","PRICEDISC","PRICEMAT","PV","RATE","y0","x0","iterMax","RECEIVED","RRI","SLN","SYD","TBILLEQ","maturity","discount","TBILLPRICE","TBILLYIELD","price","VDB","XNPV","YIELD","YIELDDISC","YIELDMAT","MATCH","lookupValue","lookupArray","matchType","indexValue","_o","$V0","$V1","$V2","$V3","$V4","$V5","$V6","$V7","$V8","$V9","$Va","$Vb","$Vc","$Vd","$Ve","$Vf","$Vg","$Vh","$Vi","$Vj","$Vk","$Vl","$Vm","$Vn","$Vo","$Vp","$Vq","$Vr","$Vs","$Vt","trace","symbols_","expressions","EOF","variableSequence","STRING","&","=","+","(",")","<",">","-","*","/","^","FUNCTION","expseq","cell","ABSOLUTE_CELL",":","RELATIVE_CELL","MIXED_CELL","ARRAY",";",",","VARIABLE","NUMBER","%","#","!","$accept","$end","terminals_","5","8","9","10","11","12","13","14","15","16","17","18","19","20","21","24","25","26","27","28","29","30","31","32","33","34","35","36","productions_","performAction","anonymous","yytext","yyleng","yylineno","yystate","$$","_$","$0","$","item","table","2","3","4","6","7","23","1","22","defaultActions","parseError","recoverable","_parseError","msg","popStack","stack","vstack","lstack","recovering","TERROR","lexer","sharedState","setInput","yylloc","yyloc","ranges","preErrorSymbol","state","action","newState","lex","token","yyval","error_rule_depth","locateNearestErrorRecoveryRule","stack_probe","depth","errStr","showPosition","loc","first_line","last_line","first_column","last_column","_input","_more","_backtrack","matched","conditionStack","offset","ch","lines","unput","oldLines","more","reject","backtrack_lexer","less","pastInput","past","upcomingInput","pre","test_match","indexed_rule","backup","tempMatch","rules","_currentRules","flex","popState","conditions","topState","pushState","stateStackSize","yy_","$avoiding_name_collisions","YY_START","INITIAL","inclusive","main","webpackPolyfill","deprecate","paths","children","margin","LABEL_EXTRACT_REGEXP","_label$match","_label$match2","columnAbs","rowAbs","isAbsolute","rowLabel","columnLabel","COLUMN_LABEL_BASE_LENGTH","COLUMN_LABEL_BASE"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,gBAAZC,UAA0C,gBAAXC,QACxCA,OAAOD,QAAUD,IACQ,kBAAXG,SAAyBA,OAAOC,IAC9CD,UAAWH,GACe,gBAAZC,SACdA,QAAuB,cAAID,IAE3BD,EAAoB,cAAIC,KACvBK,KAAM,WACT,MAAgB,UAAUC,GAKhB,QAASC,GAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,MAAOC,GAAiBD,G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AY,IAAIQ,OAAOC,WAAYvD,QAAO8C,GAAQ,MAAOD,GAAcC,EAAKC,EAAa,MAAM,IAAIlB,WAAU,2DAEtlBhD,GAAQ2B,aAAeA,EACvB3B,EAAQ0B,QAAUA,EAClB1B,EAAQwB,mBAAqBA,EAC7BxB,EAAQyB,mBAAqBA,EAC7BzB,EAAQsB,gBAAkBA,EAC1BtB,EAAQuB,gBAAkBA,CAC1B,IAAI85D,GAAuB,oCAgDvBS,EAAoB,6BACpBD,EAA2BC,EAAkBh3D","file":"formula-parser.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"formulaParser\"] = factory();\n\telse\n\t\troot[\"formulaParser\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.rowLabelToIndex = exports.rowIndexToLabel = exports.columnLabelToIndex = exports.columnIndexToLabel = exports.toLabel = exports.extractLabel = exports.error = exports.Parser = exports.ERROR_VALUE = exports.ERROR_REF = exports.ERROR_NUM = exports.ERROR_NULL = exports.ERROR_NOT_AVAILABLE = exports.ERROR_NEED_UPDATE = exports.ERROR_NAME = exports.ERROR_DIV_ZERO = exports.ERROR = exports.SUPPORTED_FORMULAS = undefined;\n\t\n\tvar _parser = __webpack_require__(1);\n\t\n\tvar _error = __webpack_require__(7);\n\t\n\tvar _error2 = _interopRequireDefault(_error);\n\t\n\tvar _cell = __webpack_require__(43);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\texports.SUPPORTED_FORMULAS = _parser.SUPPORTED_FORMULAS;\n\texports.ERROR = _error.ERROR;\n\texports.ERROR_DIV_ZERO = _error.ERROR_DIV_ZERO;\n\texports.ERROR_NAME = _error.ERROR_NAME;\n\texports.ERROR_NEED_UPDATE = _error.ERROR_NEED_UPDATE;\n\texports.ERROR_NOT_AVAILABLE = _error.ERROR_NOT_AVAILABLE;\n\texports.ERROR_NULL = _error.ERROR_NULL;\n\texports.ERROR_NUM = _error.ERROR_NUM;\n\texports.ERROR_REF = _error.ERROR_REF;\n\texports.ERROR_VALUE = _error.ERROR_VALUE;\n\texports.Parser = _parser.Parser;\n\texports.error = _error2.default;\n\texports.extractLabel = _cell.extractLabel;\n\texports.toLabel = _cell.toLabel;\n\texports.columnIndexToLabel = _cell.columnIndexToLabel;\n\texports.columnLabelToIndex = _cell.columnLabelToIndex;\n\texports.rowIndexToLabel = _cell.rowIndexToLabel;\n\texports.rowLabelToIndex = _cell.rowLabelToIndex;\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.Parser = exports.SUPPORTED_FORMULAS = undefined;\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _supportedFormulas = __webpack_require__(2);\n\t\n\tObject.defineProperty(exports, 'SUPPORTED_FORMULAS', {\n\t enumerable: true,\n\t get: function get() {\n\t return _interopRequireDefault(_supportedFormulas).default;\n\t }\n\t});\n\t\n\tvar _tinyEmitter = __webpack_require__(3);\n\t\n\tvar _tinyEmitter2 = _interopRequireDefault(_tinyEmitter);\n\t\n\tvar _evaluateByOperator = __webpack_require__(4);\n\t\n\tvar _evaluateByOperator2 = _interopRequireDefault(_evaluateByOperator);\n\t\n\tvar _grammarParser = __webpack_require__(40);\n\t\n\tvar _string = __webpack_require__(42);\n\t\n\tvar _number = __webpack_require__(6);\n\t\n\tvar _error = __webpack_require__(7);\n\t\n\tvar _error2 = _interopRequireDefault(_error);\n\t\n\tvar _cell = __webpack_require__(43);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\t/**\n\t * @class Parser\n\t */\n\tvar Parser = function (_Emitter) {\n\t _inherits(Parser, _Emitter);\n\t\n\t function Parser() {\n\t _classCallCheck(this, Parser);\n\t\n\t var _this = _possibleConstructorReturn(this, (Parser.__proto__ || Object.getPrototypeOf(Parser)).call(this));\n\t\n\t _this.parser = new _grammarParser.Parser();\n\t _this.parser.yy = {\n\t toNumber: _number.toNumber,\n\t trimEdges: _string.trimEdges,\n\t invertNumber: _number.invertNumber,\n\t throwError: function throwError(errorName) {\n\t return _this._throwError(errorName);\n\t },\n\t callVariable: function callVariable(variable) {\n\t return _this._callVariable(variable);\n\t },\n\t evaluateByOperator: _evaluateByOperator2.default,\n\t callFunction: _evaluateByOperator2.default,\n\t cellValue: function cellValue(value) {\n\t return _this._callCellValue(value);\n\t },\n\t rangeValue: function rangeValue(start, end) {\n\t return _this._callRangeValue(start, end);\n\t }\n\t };\n\t _this.variables = Object.create(null);\n\t\n\t _this.setVariable('TRUE', true).setVariable('FALSE', false).setVariable('NULL', null);\n\t return _this;\n\t }\n\t\n\t /**\n\t * Parse formula expression.\n\t *\n\t * @param {String} expression to parse.\n\t * @return {*} Returns an object with tow properties `error` and `result`.\n\t */\n\t\n\t\n\t _createClass(Parser, [{\n\t key: 'parse',\n\t value: function parse(expression) {\n\t var result = null;\n\t var error = null;\n\t\n\t try {\n\t result = this.parser.parse(expression);\n\t } catch (ex) {\n\t var message = (0, _error2.default)(ex.message);\n\t\n\t if (message) {\n\t error = message;\n\t } else {\n\t error = (0, _error2.default)(_error.ERROR);\n\t }\n\t }\n\t\n\t if (result instanceof Error) {\n\t error = (0, _error2.default)(result.message) || (0, _error2.default)(_error.ERROR);\n\t result = null;\n\t }\n\t\n\t return {\n\t error: error,\n\t result: result\n\t };\n\t }\n\t\n\t /**\n\t * Set predefined variable name which can be visible while parsing formula expression.\n\t *\n\t * @param {String} name Variable name.\n\t * @param {*} value Variable value.\n\t * @returns {Parser}\n\t */\n\t\n\t }, {\n\t key: 'setVariable',\n\t value: function setVariable(name, value) {\n\t this.variables[name] = value;\n\t\n\t return this;\n\t }\n\t\n\t /**\n\t * Get variable name.\n\t *\n\t * @param {String} name Variable name.\n\t * @returns {*}\n\t */\n\t\n\t }, {\n\t key: 'getVariable',\n\t value: function getVariable(name) {\n\t return this.variables[name];\n\t }\n\t\n\t /**\n\t * Retrieve variable value by its name.\n\t *\n\t * @param name Variable name.\n\t * @returns {*}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_callVariable',\n\t value: function _callVariable(name) {\n\t var value = this.getVariable(name);\n\t\n\t this.emit('callVariable', name, function (newValue) {\n\t if (newValue !== void 0) {\n\t value = newValue;\n\t }\n\t });\n\t\n\t if (value === void 0) {\n\t throw Error(_error.ERROR_NAME);\n\t }\n\t\n\t return value;\n\t }\n\t\n\t /**\n\t * Retrieve value by its label (`B3`, `B$3`, `B$3`, `$B$3`).\n\t *\n\t * @param {String} label Coordinates.\n\t * @returns {*}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_callCellValue',\n\t value: function _callCellValue(label) {\n\t var _extractLabel = (0, _cell.extractLabel)(label);\n\t\n\t var _extractLabel2 = _slicedToArray(_extractLabel, 2);\n\t\n\t var row = _extractLabel2[0];\n\t var column = _extractLabel2[1];\n\t\n\t var value = void 0;\n\t\n\t this.emit('callCellValue', { label: label, row: row, column: column }, function (_value) {\n\t value = _value;\n\t });\n\t\n\t return value;\n\t }\n\t\n\t /**\n\t * Retrieve value by its label (`B3:A1`, `B$3:A1`, `B$3:$A1`, `$B$3:A$1`).\n\t *\n\t * @param {String} startLabel Coordinates of the first cell.\n\t * @param {String} endLabel Coordinates of the last cell.\n\t * @returns {Array} Returns an array of mixed values.\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_callRangeValue',\n\t value: function _callRangeValue(startLabel, endLabel) {\n\t var _extractLabel3 = (0, _cell.extractLabel)(startLabel);\n\t\n\t var _extractLabel4 = _slicedToArray(_extractLabel3, 2);\n\t\n\t var startRow = _extractLabel4[0];\n\t var startColumn = _extractLabel4[1];\n\t\n\t var _extractLabel5 = (0, _cell.extractLabel)(endLabel);\n\t\n\t var _extractLabel6 = _slicedToArray(_extractLabel5, 2);\n\t\n\t var endRow = _extractLabel6[0];\n\t var endColumn = _extractLabel6[1];\n\t\n\t var startCell = {};\n\t var endCell = {};\n\t\n\t if (startRow.index <= endRow.index) {\n\t startCell.row = startRow;\n\t endCell.row = endRow;\n\t } else {\n\t startCell.row = endRow;\n\t endCell.row = startRow;\n\t }\n\t\n\t if (startColumn.index <= endColumn.index) {\n\t startCell.column = startColumn;\n\t endCell.column = endColumn;\n\t } else {\n\t startCell.column = endColumn;\n\t endCell.column = startColumn;\n\t }\n\t\n\t startCell.label = (0, _cell.toLabel)(startCell.row, startCell.column);\n\t endCell.label = (0, _cell.toLabel)(endCell.row, endCell.column);\n\t\n\t var value = [];\n\t\n\t this.emit('callRangeValue', startCell, endCell, function () {\n\t var _value = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];\n\t\n\t value = _value;\n\t });\n\t\n\t return value;\n\t }\n\t\n\t /**\n\t * Try to throw error by its name.\n\t *\n\t * @param {String} errorName Error name.\n\t * @returns {String}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_throwError',\n\t value: function _throwError(errorName) {\n\t var parsedError = (0, _error2.default)(errorName);\n\t\n\t if (parsedError) {\n\t throw Error(parsedError);\n\t }\n\t\n\t return errorName;\n\t }\n\t }]);\n\t\n\t return Parser;\n\t}(_tinyEmitter2.default);\n\t\n\texports.Parser = Parser;\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar SUPPORTED_FORMULAS = ['ABS', 'ACCRINT', 'ACOS', 'ACOSH', 'ACOT', 'ACOTH', 'ADD', 'AGGREGATE', 'AND', 'ARABIC', 'ARGS2ARRAY', 'ASIN', 'ASINH', 'ATAN', 'ATAN2', 'ATANH', 'AVEDEV', 'AVERAGE', 'AVERAGEA', 'AVERAGEIF', 'AVERAGEIFS', 'BASE', 'BESSELI', 'BESSELJ', 'BESSELK', 'BESSELY', 'BETA.DIST', 'BETA.INV', 'BETADIST', 'BETAINV', 'BIN2DEC', 'BIN2HEX', 'BIN2OCT', 'BINOM.DIST', 'BINOM.DIST.RANGE', 'BINOM.INV', 'BINOMDIST', 'BITAND', 'BITLSHIFT', 'BITOR', 'BITRSHIFT', 'BITXOR', 'CEILING', 'CEILINGMATH', 'CEILINGPRECISE', 'CHAR', 'CHISQ.DIST', 'CHISQ.DIST.RT', 'CHISQ.INV', 'CHISQ.INV.RT', 'CHOOSE', 'CHOOSE', 'CLEAN', 'CODE', 'COLUMN', 'COLUMNS', 'COMBIN', 'COMBINA', 'COMPLEX', 'CONCATENATE', 'CONFIDENCE', 'CONFIDENCE.NORM', 'CONFIDENCE.T', 'CONVERT', 'CORREL', 'COS', 'COSH', 'COT', 'COTH', 'COUNT', 'COUNTA', 'COUNTBLANK', 'COUNTIF', 'COUNTIFS', 'COUNTIN', 'COUNTUNIQUE', 'COVARIANCE.P', 'COVARIANCE.S', 'CSC', 'CSCH', 'CUMIPMT', 'CUMPRINC', 'DATE', 'DATEVALUE', 'DAY', 'DAYS', 'DAYS360', 'DB', 'DDB', 'DEC2BIN', 'DEC2HEX', 'DEC2OCT', 'DECIMAL', 'DEGREES', 'DELTA', 'DEVSQ', 'DIVIDE', 'DOLLAR', 'DOLLARDE', 'DOLLARFR', 'E', 'EDATE', 'EFFECT', 'EOMONTH', 'EQ', 'ERF', 'ERFC', 'EVEN', 'EXACT', 'EXPON.DIST', 'EXPONDIST', 'F.DIST', 'F.DIST.RT', 'F.INV', 'F.INV.RT', 'FACT', 'FACTDOUBLE', 'FALSE', 'FDIST', 'FDISTRT', 'FIND', 'FINV', 'FINVRT', 'FISHER', 'FISHERINV', 'FIXED', 'FLATTEN', 'FLOOR', 'FORECAST', 'FREQUENCY', 'FV', 'FVSCHEDULE', 'GAMMA', 'GAMMA.DIST', 'GAMMA.INV', 'GAMMADIST', 'GAMMAINV', 'GAMMALN', 'GAMMALN.PRECISE', 'GAUSS', 'GCD', 'GEOMEAN', 'GESTEP', 'GROWTH', 'GTE', 'HARMEAN', 'HEX2BIN', 'HEX2DEC', 'HEX2OCT', 'HOUR', 'HTML2TEXT', 'HYPGEOM.DIST', 'HYPGEOMDIST', 'IF', 'IMABS', 'IMAGINARY', 'IMARGUMENT', 'IMCONJUGATE', 'IMCOS', 'IMCOSH', 'IMCOT', 'IMCSC', 'IMCSCH', 'IMDIV', 'IMEXP', 'IMLN', 'IMLOG10', 'IMLOG2', 'IMPOWER', 'IMPRODUCT', 'IMREAL', 'IMSEC', 'IMSECH', 'IMSIN', 'IMSINH', 'IMSQRT', 'IMSUB', 'IMSUM', 'IMTAN', 'INT', 'INTERCEPT', 'INTERVAL', 'IPMT', 'IRR', 'ISBINARY', 'ISBLANK', 'ISEVEN', 'ISLOGICAL', 'ISNONTEXT', 'ISNUMBER', 'ISODD', 'ISODD', 'ISOWEEKNUM', 'ISPMT', 'ISTEXT', 'JOIN', 'KURT', 'LARGE', 'LCM', 'LEFT', 'LEN', 'LINEST', 'LN', 'LOG', 'LOG10', 'LOGEST', 'LOGNORM.DIST', 'LOGNORM.INV', 'LOGNORMDIST', 'LOGNORMINV', 'LOWER', 'LT', 'LTE', 'MATCH', 'MAX', 'MAXA', 'MEDIAN', 'MID', 'MIN', 'MINA', 'MINUS', 'MINUTE', 'MIRR', 'MOD', 'MODE.MULT', 'MODE.SNGL', 'MODEMULT', 'MODESNGL', 'MONTH', 'MROUND', 'MULTINOMIAL', 'MULTIPLY', 'NE', 'NEGBINOM.DIST', 'NEGBINOMDIST', 'NETWORKDAYS', 'NOMINAL', 'NORM.DIST', 'NORM.INV', 'NORM.S.DIST', 'NORM.S.INV', 'NORMDIST', 'NORMINV', 'NORMSDIST', 'NORMSINV', 'NOT', 'NOW', 'NPER', 'NPV', 'NUMBERS', 'NUMERAL', 'OCT2BIN', 'OCT2DEC', 'OCT2HEX', 'ODD', 'OR', 'PDURATION', 'PEARSON', 'PERCENTILEEXC', 'PERCENTILEINC', 'PERCENTRANKEXC', 'PERCENTRANKINC', 'PERMUT', 'PERMUTATIONA', 'PHI', 'PI', 'PMT', 'POISSON.DIST', 'POISSONDIST', 'POW', 'POWER', 'PPMT', 'PROB', 'PRODUCT', 'PROPER', 'PV', 'QUARTILE.EXC', 'QUARTILE.INC', 'QUARTILEEXC', 'QUARTILEINC', 'QUOTIENT', 'RADIANS', 'RAND', 'RANDBETWEEN', 'RANK.AVG', 'RANK.EQ', 'RANKAVG', 'RANKEQ', 'RATE', 'REFERENCE', 'REGEXEXTRACT', 'REGEXMATCH', 'REGEXREPLACE', 'REPLACE', 'REPT', 'RIGHT', 'ROMAN', 'ROUND', 'ROUNDDOWN', 'ROUNDUP', 'ROW', 'ROWS', 'RRI', 'RSQ', 'SEARCH', 'SEC', 'SECH', 'SECOND', 'SERIESSUM', 'SIGN', 'SIN', 'SINH', 'SKEW', 'SKEW.P', 'SKEWP', 'SLN', 'SLOPE', 'SMALL', 'SPLIT', 'SPLIT', 'SQRT', 'SQRTPI', 'STANDARDIZE', 'STDEV.P', 'STDEV.S', 'STDEVA', 'STDEVP', 'STDEVPA', 'STDEVS', 'STEYX', 'SUBSTITUTE', 'SUBTOTAL', 'SUM', 'SUMIF', 'SUMIFS', 'SUMPRODUCT', 'SUMSQ', 'SUMX2MY2', 'SUMX2PY2', 'SUMXMY2', 'SWITCH', 'SYD', 'T', 'T.DIST', 'T.DIST.2T', 'T.DIST.RT', 'T.INV', 'T.INV.2T', 'TAN', 'TANH', 'TBILLEQ', 'TBILLPRICE', 'TBILLYIELD', 'TDIST', 'TDIST2T', 'TDISTRT', 'TEXT', 'TIME', 'TIMEVALUE', 'TINV', 'TINV2T', 'TODAY', 'TRANSPOSE', 'TREND', 'TRIM', 'TRIMMEAN', 'TRUE', 'TRUNC', 'UNICHAR', 'UNICODE', 'UNIQUE', 'UPPER', 'VALUE', 'VAR.P', 'VAR.S', 'VARA', 'VARP', 'VARPA', 'VARS', 'WEEKDAY', 'WEEKNUM', 'WEIBULL.DIST', 'WEIBULLDIST', 'WORKDAY', 'XIRR', 'XNPV', 'XOR', 'YEAR', 'YEARFRAC'];\n\t\n\texports.default = SUPPORTED_FORMULAS;\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tfunction E () {\n\t // Keep this empty so it's easier to inherit from\n\t // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n\t}\n\t\n\tE.prototype = {\n\t on: function (name, callback, ctx) {\n\t var e = this.e || (this.e = {});\n\t\n\t (e[name] || (e[name] = [])).push({\n\t fn: callback,\n\t ctx: ctx\n\t });\n\t\n\t return this;\n\t },\n\t\n\t once: function (name, callback, ctx) {\n\t var self = this;\n\t function listener () {\n\t self.off(name, listener);\n\t callback.apply(ctx, arguments);\n\t };\n\t\n\t listener._ = callback\n\t return this.on(name, listener, ctx);\n\t },\n\t\n\t emit: function (name) {\n\t var data = [].slice.call(arguments, 1);\n\t var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n\t var i = 0;\n\t var len = evtArr.length;\n\t\n\t for (i; i < len; i++) {\n\t evtArr[i].fn.apply(evtArr[i].ctx, data);\n\t }\n\t\n\t return this;\n\t },\n\t\n\t off: function (name, callback) {\n\t var e = this.e || (this.e = {});\n\t var evts = e[name];\n\t var liveEvents = [];\n\t\n\t if (evts && callback) {\n\t for (var i = 0, len = evts.length; i < len; i++) {\n\t if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n\t liveEvents.push(evts[i]);\n\t }\n\t }\n\t\n\t // Remove event from queue to prevent memory leak\n\t // Suggested by https://github.com/lazd\n\t // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\t\n\t (liveEvents.length)\n\t ? e[name] = liveEvents\n\t : delete e[name];\n\t\n\t return this;\n\t }\n\t};\n\t\n\tmodule.exports = E;\n\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = evaluateByOperator;\n\texports.registerOperation = registerOperation;\n\t\n\tvar _add = __webpack_require__(5);\n\t\n\tvar _add2 = _interopRequireDefault(_add);\n\t\n\tvar _ampersand = __webpack_require__(8);\n\t\n\tvar _ampersand2 = _interopRequireDefault(_ampersand);\n\t\n\tvar _divide = __webpack_require__(9);\n\t\n\tvar _divide2 = _interopRequireDefault(_divide);\n\t\n\tvar _equal = __webpack_require__(10);\n\t\n\tvar _equal2 = _interopRequireDefault(_equal);\n\t\n\tvar _formulaFunction = __webpack_require__(11);\n\t\n\tvar _formulaFunction2 = _interopRequireDefault(_formulaFunction);\n\t\n\tvar _greaterThan = __webpack_require__(32);\n\t\n\tvar _greaterThan2 = _interopRequireDefault(_greaterThan);\n\t\n\tvar _greaterThanOrEqual = __webpack_require__(33);\n\t\n\tvar _greaterThanOrEqual2 = _interopRequireDefault(_greaterThanOrEqual);\n\t\n\tvar _lessThan = __webpack_require__(34);\n\t\n\tvar _lessThan2 = _interopRequireDefault(_lessThan);\n\t\n\tvar _lessThanOrEqual = __webpack_require__(35);\n\t\n\tvar _lessThanOrEqual2 = _interopRequireDefault(_lessThanOrEqual);\n\t\n\tvar _minus = __webpack_require__(36);\n\t\n\tvar _minus2 = _interopRequireDefault(_minus);\n\t\n\tvar _multiply = __webpack_require__(37);\n\t\n\tvar _multiply2 = _interopRequireDefault(_multiply);\n\t\n\tvar _notEqual = __webpack_require__(38);\n\t\n\tvar _notEqual2 = _interopRequireDefault(_notEqual);\n\t\n\tvar _power = __webpack_require__(39);\n\t\n\tvar _power2 = _interopRequireDefault(_power);\n\t\n\tvar _error = __webpack_require__(7);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\t\n\tvar availableOperators = Object.create(null);\n\t\n\tregisterOperation(_add2.default.SYMBOL, _add2.default);\n\tregisterOperation(_ampersand2.default.SYMBOL, _ampersand2.default);\n\tregisterOperation(_divide2.default.SYMBOL, _divide2.default);\n\tregisterOperation(_equal2.default.SYMBOL, _equal2.default);\n\tregisterOperation(_power2.default.SYMBOL, _power2.default);\n\tregisterOperation(_formulaFunction2.default.SYMBOL, _formulaFunction2.default);\n\tregisterOperation(_greaterThan2.default.SYMBOL, _greaterThan2.default);\n\tregisterOperation(_greaterThanOrEqual2.default.SYMBOL, _greaterThanOrEqual2.default);\n\tregisterOperation(_lessThan2.default.SYMBOL, _lessThan2.default);\n\tregisterOperation(_lessThanOrEqual2.default.SYMBOL, _lessThanOrEqual2.default);\n\tregisterOperation(_multiply2.default.SYMBOL, _multiply2.default);\n\tregisterOperation(_notEqual2.default.SYMBOL, _notEqual2.default);\n\tregisterOperation(_minus2.default.SYMBOL, _minus2.default);\n\t\n\t/**\n\t * Evaluate values by operator id.git\n\t *\n\t * @param {String} operator Operator id.\n\t * @param {Array} [params=[]] Arguments to evaluate.\n\t * @returns {*}\n\t */\n\tfunction evaluateByOperator(operator) {\n\t var params = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];\n\t\n\t operator = operator.toUpperCase();\n\t\n\t if (!availableOperators[operator]) {\n\t throw Error(_error.ERROR_NAME);\n\t }\n\t\n\t return availableOperators[operator].apply(availableOperators, _toConsumableArray(params));\n\t}\n\t\n\t/**\n\t * Register operator.\n\t *\n\t * @param {String|Array} symbol Symbol to register.\n\t * @param {Function} func Logic to register for this symbol.\n\t */\n\tfunction registerOperation(symbol, func) {\n\t if (!Array.isArray(symbol)) {\n\t symbol = [symbol.toUpperCase()];\n\t }\n\t symbol.forEach(function (s) {\n\t if (func.isFactory) {\n\t availableOperators[s] = func(s);\n\t } else {\n\t availableOperators[s] = func;\n\t }\n\t });\n\t}\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.SYMBOL = undefined;\n\texports.default = func;\n\t\n\tvar _number = __webpack_require__(6);\n\t\n\tvar _error = __webpack_require__(7);\n\t\n\tvar SYMBOL = exports.SYMBOL = '+';\n\t\n\tfunction func(first) {\n\t for (var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t rest[_key - 1] = arguments[_key];\n\t }\n\t\n\t var result = rest.reduce(function (acc, value) {\n\t return acc + (0, _number.toNumber)(value);\n\t }, (0, _number.toNumber)(first));\n\t\n\t if (isNaN(result)) {\n\t throw Error(_error.ERROR_VALUE);\n\t }\n\t\n\t return result;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.toNumber = toNumber;\n\texports.invertNumber = invertNumber;\n\t/**\n\t * Convert value into number.\n\t *\n\t * @param {String|Number} number\n\t * @returns {*}\n\t */\n\tfunction toNumber(number) {\n\t var result = void 0;\n\t\n\t if (typeof number === 'number') {\n\t result = number;\n\t } else if (typeof number === 'string') {\n\t result = number.indexOf('.') > -1 ? parseFloat(number) : parseInt(number, 10);\n\t }\n\t\n\t return result;\n\t}\n\t\n\t/**\n\t * Invert provided number.\n\t *\n\t * @param {Number} number\n\t * @returns {Number} Returns inverted number.\n\t */\n\tfunction invertNumber(number) {\n\t return -1 * toNumber(number);\n\t}\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _errors;\n\t\n\texports.default = error;\n\t\n\tfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\t\n\tvar ERROR = exports.ERROR = 'ERROR';\n\tvar ERROR_DIV_ZERO = exports.ERROR_DIV_ZERO = 'DIV/0';\n\tvar ERROR_NAME = exports.ERROR_NAME = 'NAME';\n\tvar ERROR_NEED_UPDATE = exports.ERROR_NEED_UPDATE = 'NEED_UPDATE';\n\tvar ERROR_NOT_AVAILABLE = exports.ERROR_NOT_AVAILABLE = 'N/A';\n\tvar ERROR_NULL = exports.ERROR_NULL = 'NULL';\n\tvar ERROR_NUM = exports.ERROR_NUM = 'NUM';\n\tvar ERROR_REF = exports.ERROR_REF = 'REF';\n\tvar ERROR_VALUE = exports.ERROR_VALUE = 'VALUE';\n\t\n\tvar errors = (_errors = {}, _defineProperty(_errors, ERROR, '#ERROR!'), _defineProperty(_errors, ERROR_DIV_ZERO, '#DIV/0!'), _defineProperty(_errors, ERROR_NAME, '#NAME?'), _defineProperty(_errors, ERROR_NEED_UPDATE, '#NEED_UPDATE!'), _defineProperty(_errors, ERROR_NOT_AVAILABLE, '#N/A'), _defineProperty(_errors, ERROR_NULL, '#NULL!'), _defineProperty(_errors, ERROR_NUM, '#NUM!'), _defineProperty(_errors, ERROR_REF, '#REF!'), _defineProperty(_errors, ERROR_VALUE, '#VALUE!'), _errors);\n\t\n\t/**\n\t * Return error type based on provided error id.\n\t *\n\t * @param {String} type Error type.\n\t * @returns {String|null} Returns error id.\n\t */\n\tfunction error(type) {\n\t var error = void 0;\n\t\n\t type = (type + '').replace(/#|!|\\?/g, '');\n\t\n\t if (errors[type]) {\n\t error = errors[type];\n\t }\n\t\n\t return error ? error : null;\n\t}\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = func;\n\tvar SYMBOL = exports.SYMBOL = '&';\n\t\n\tfunction func() {\n\t for (var _len = arguments.length, params = Array(_len), _key = 0; _key < _len; _key++) {\n\t params[_key] = arguments[_key];\n\t }\n\t\n\t return params.reduce(function (acc, value) {\n\t return acc + value.toString();\n\t }, '');\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.SYMBOL = undefined;\n\texports.default = func;\n\t\n\tvar _number = __webpack_require__(6);\n\t\n\tvar _error = __webpack_require__(7);\n\t\n\tvar SYMBOL = exports.SYMBOL = '/';\n\t\n\tfunction func(first) {\n\t for (var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t rest[_key - 1] = arguments[_key];\n\t }\n\t\n\t var result = rest.reduce(function (acc, value) {\n\t return acc / (0, _number.toNumber)(value);\n\t }, (0, _number.toNumber)(first));\n\t\n\t if (result === Infinity) {\n\t throw Error(_error.ERROR_DIV_ZERO);\n\t }\n\t if (isNaN(result)) {\n\t throw Error(_error.ERROR_VALUE);\n\t }\n\t\n\t return result;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 10 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = func;\n\tvar SYMBOL = exports.SYMBOL = '=';\n\t\n\tfunction func(exp1, exp2) {\n\t return exp1 === exp2;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.SYMBOL = undefined;\n\texports.default = func;\n\t\n\tvar _supportedFormulas = __webpack_require__(2);\n\t\n\tvar _supportedFormulas2 = _interopRequireDefault(_supportedFormulas);\n\t\n\tvar _error = __webpack_require__(7);\n\t\n\tvar _formulajs = __webpack_require__(12);\n\t\n\tvar formulajs = _interopRequireWildcard(_formulajs);\n\t\n\tfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar SYMBOL = exports.SYMBOL = _supportedFormulas2.default;\n\t\n\tfunction func(symbol) {\n\t return function () {\n\t symbol = symbol.toUpperCase();\n\t\n\t var symbolParts = symbol.split('.');\n\t var foundFormula = false;\n\t var result = void 0;\n\t\n\t if (symbolParts.length === 1) {\n\t if (formulajs[symbolParts[0]]) {\n\t foundFormula = true;\n\t result = formulajs[symbolParts[0]].apply(formulajs, arguments);\n\t }\n\t } else {\n\t var length = symbolParts.length;\n\t var index = 0;\n\t var nestedFormula = formulajs;\n\t\n\t while (index < length) {\n\t nestedFormula = nestedFormula[symbolParts[index]];\n\t index++;\n\t\n\t if (!nestedFormula) {\n\t nestedFormula = null;\n\t break;\n\t }\n\t }\n\t if (nestedFormula) {\n\t foundFormula = true;\n\t result = nestedFormula.apply(undefined, arguments);\n\t }\n\t }\n\t\n\t if (!foundFormula) {\n\t throw Error(_error.ERROR_NAME);\n\t }\n\t\n\t return result;\n\t };\n\t};\n\t\n\tfunc.isFactory = true;\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 12 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar categories = [\n\t __webpack_require__(13),\n\t __webpack_require__(28),\n\t __webpack_require__(25),\n\t __webpack_require__(29),\n\t __webpack_require__(14),\n\t __webpack_require__(18),\n\t __webpack_require__(27),\n\t __webpack_require__(30),\n\t __webpack_require__(24),\n\t __webpack_require__(31),\n\t __webpack_require__(17),\n\t __webpack_require__(23)\n\t];\n\t\n\tfor (var c in categories) {\n\t var category = categories[c];\n\t for (var f in category) {\n\t exports[f] = exports[f] || category[f];\n\t }\n\t}\n\n\n/***/ },\n/* 13 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar mathTrig = __webpack_require__(14);\n\tvar statistical = __webpack_require__(17);\n\tvar engineering = __webpack_require__(25);\n\tvar dateTime = __webpack_require__(27);\n\t\n\tfunction set(fn, root) {\n\t if (root) {\n\t for (var i in root) {\n\t fn[i] = root[i];\n\t }\n\t }\n\t\n\t return fn;\n\t}\n\t\n\texports.BETADIST = statistical.BETA.DIST;\n\texports.BETAINV = statistical.BETA.INV;\n\texports.BINOMDIST = statistical.BINOM.DIST;\n\texports.CEILING = exports.ISOCEILING = set(mathTrig.CEILING.MATH, mathTrig.CEILING);\n\texports.CEILINGMATH = mathTrig.CEILING.MATH;\n\texports.CEILINGPRECISE = mathTrig.CEILING.PRECISE;\n\texports.CHIDIST = statistical.CHISQ.DIST;\n\texports.CHIDISTRT = statistical.CHISQ.DIST.RT;\n\texports.CHIINV = statistical.CHISQ.INV;\n\texports.CHIINVRT = statistical.CHISQ.INV.RT;\n\texports.CHITEST = statistical.CHISQ.TEST;\n\texports.CONFIDENCE = set(statistical.CONFIDENCE.NORM, statistical.CONFIDENCE);\n\texports.COVAR = statistical.COVARIANCE.P;\n\texports.COVARIANCEP = statistical.COVARIANCE.P;\n\texports.COVARIANCES = statistical.COVARIANCE.S;\n\texports.CRITBINOM = statistical.BINOM.INV;\n\texports.EXPONDIST = statistical.EXPON.DIST;\n\texports.ERFCPRECISE = engineering.ERFC.PRECISE;\n\texports.ERFPRECISE = engineering.ERF.PRECISE;\n\texports.FDIST = statistical.F.DIST;\n\texports.FDISTRT = statistical.F.DIST.RT;\n\texports.FINVRT = statistical.F.INV.RT;\n\texports.FINV = statistical.F.INV;\n\texports.FLOOR = set(mathTrig.FLOOR.MATH, mathTrig.FLOOR);\n\texports.FLOORMATH = mathTrig.FLOOR.MATH;\n\texports.FLOORPRECISE = mathTrig.FLOOR.PRECISE;\n\texports.FTEST = statistical.F.TEST;\n\texports.GAMMADIST = statistical.GAMMA.DIST;\n\texports.GAMMAINV = statistical.GAMMA.INV;\n\texports.GAMMALNPRECISE = statistical.GAMMALN.PRECISE;\n\texports.HYPGEOMDIST = statistical.HYPGEOM.DIST;\n\texports.LOGINV = statistical.LOGNORM.INV;\n\texports.LOGNORMINV = statistical.LOGNORM.INV;\n\texports.LOGNORMDIST = statistical.LOGNORM.DIST;\n\texports.MODE = set(statistical.MODE.SNGL, statistical.MODE);\n\texports.MODEMULT = statistical.MODE.MULT;\n\texports.MODESNGL = statistical.MODE.SNGL;\n\texports.NEGBINOMDIST = statistical.NEGBINOM.DIST;\n\texports.NETWORKDAYSINTL = dateTime.NETWORKDAYS.INTL;\n\texports.NORMDIST = statistical.NORM.DIST;\n\texports.NORMINV = statistical.NORM.INV;\n\texports.NORMSDIST = statistical.NORM.S.DIST;\n\texports.NORMSINV = statistical.NORM.S.INV;\n\texports.PERCENTILE = set(statistical.PERCENTILE.EXC, statistical.PERCENTILE);\n\texports.PERCENTILEEXC = statistical.PERCENTILE.EXC;\n\texports.PERCENTILEINC = statistical.PERCENTILE.INC;\n\texports.PERCENTRANK = set(statistical.PERCENTRANK.INC, statistical.PERCENTRANK);\n\texports.PERCENTRANKEXC = statistical.PERCENTRANK.EXC;\n\texports.PERCENTRANKINC = statistical.PERCENTRANK.INC;\n\texports.POISSON = set(statistical.POISSON.DIST, statistical.POISSON);\n\texports.POISSONDIST = statistical.POISSON.DIST;\n\texports.QUARTILE = set(statistical.QUARTILE.INC, statistical.QUARTILE);\n\texports.QUARTILEEXC = statistical.QUARTILE.EXC;\n\texports.QUARTILEINC = statistical.QUARTILE.INC;\n\texports.RANK = set(statistical.RANK.EQ, statistical.RANK);\n\texports.RANKAVG = statistical.RANK.AVG;\n\texports.RANKEQ = statistical.RANK.EQ;\n\texports.SKEWP = statistical.SKEW.P;\n\texports.STDEV = set(statistical.STDEV.S, statistical.STDEV);\n\texports.STDEVP = statistical.STDEV.P;\n\texports.STDEVS = statistical.STDEV.S;\n\texports.TDIST = statistical.T.DIST;\n\texports.TDISTRT = statistical.T.DIST.RT;\n\texports.TINV = statistical.T.INV;\n\texports.TTEST = statistical.T.TEST;\n\texports.VAR = set(statistical.VAR.S, statistical.VAR);\n\texports.VARP = statistical.VAR.P;\n\texports.VARS = statistical.VAR.S;\n\texports.WEIBULL = set(statistical.WEIBULL.DIST, statistical.WEIBULL);\n\texports.WEIBULLDIST = statistical.WEIBULL.DIST;\n\texports.WORKDAYINTL = dateTime.WORKDAY.INTL;\n\texports.ZTEST = statistical.Z.TEST;\n\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar utils = __webpack_require__(15);\n\tvar error = __webpack_require__(16);\n\tvar statistical = __webpack_require__(17);\n\tvar information = __webpack_require__(24);\n\t\n\texports.ABS = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var result = Math.abs(number);\n\t\n\t return result;\n\t};\n\t\n\texports.ACOS = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var result = Math.acos(number);\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.ACOSH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var result = Math.log(number + Math.sqrt(number * number - 1));\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.ACOT = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var result = Math.atan(1 / number);\n\t\n\t return result;\n\t};\n\t\n\texports.ACOTH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var result = 0.5 * Math.log((number + 1) / (number - 1));\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\t//TODO: use options\n\texports.AGGREGATE = function(function_num, options, ref1, ref2) {\n\t function_num = utils.parseNumber(function_num);\n\t options = utils.parseNumber(function_num);\n\t if (utils.anyIsError(function_num, options)) {\n\t return error.value;\n\t }\n\t switch (function_num) {\n\t case 1:\n\t return statistical.AVERAGE(ref1);\n\t case 2:\n\t return statistical.COUNT(ref1);\n\t case 3:\n\t return statistical.COUNTA(ref1);\n\t case 4:\n\t return statistical.MAX(ref1);\n\t case 5:\n\t return statistical.MIN(ref1);\n\t case 6:\n\t return exports.PRODUCT(ref1);\n\t case 7:\n\t return statistical.STDEV.S(ref1);\n\t case 8:\n\t return statistical.STDEV.P(ref1);\n\t case 9:\n\t return exports.SUM(ref1);\n\t case 10:\n\t return statistical.VAR.S(ref1);\n\t case 11:\n\t return statistical.VAR.P(ref1);\n\t case 12:\n\t return statistical.MEDIAN(ref1);\n\t case 13:\n\t return statistical.MODE.SNGL(ref1);\n\t case 14:\n\t return statistical.LARGE(ref1, ref2);\n\t case 15:\n\t return statistical.SMALL(ref1, ref2);\n\t case 16:\n\t return statistical.PERCENTILE.INC(ref1, ref2);\n\t case 17:\n\t return statistical.QUARTILE.INC(ref1, ref2);\n\t case 18:\n\t return statistical.PERCENTILE.EXC(ref1, ref2);\n\t case 19:\n\t return statistical.QUARTILE.EXC(ref1, ref2);\n\t }\n\t};\n\t\n\texports.ARABIC = function(text) {\n\t // Credits: Rafa? Kukawski\n\t if (!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(text)) {\n\t return error.value;\n\t }\n\t var r = 0;\n\t text.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g, function(i) {\n\t r += {\n\t M: 1000,\n\t CM: 900,\n\t D: 500,\n\t CD: 400,\n\t C: 100,\n\t XC: 90,\n\t L: 50,\n\t XL: 40,\n\t X: 10,\n\t IX: 9,\n\t V: 5,\n\t IV: 4,\n\t I: 1\n\t }[i];\n\t });\n\t return r;\n\t};\n\t\n\texports.ASIN = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var result = Math.asin(number);\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.ASINH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return Math.log(number + Math.sqrt(number * number + 1));\n\t};\n\t\n\texports.ATAN = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return Math.atan(number);\n\t};\n\t\n\texports.ATAN2 = function(number_x, number_y) {\n\t number_x = utils.parseNumber(number_x);\n\t number_y = utils.parseNumber(number_y);\n\t if (utils.anyIsError(number_x, number_y)) {\n\t return error.value;\n\t }\n\t return Math.atan2(number_x, number_y);\n\t};\n\t\n\texports.ATANH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var result = Math.log((1 + number) / (1 - number)) / 2;\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.BASE = function(number, radix, min_length) {\n\t min_length = min_length || 0;\n\t\n\t number = utils.parseNumber(number);\n\t radix = utils.parseNumber(radix);\n\t min_length = utils.parseNumber(min_length);\n\t if (utils.anyIsError(number, radix, min_length)) {\n\t return error.value;\n\t }\n\t min_length = (min_length === undefined) ? 0 : min_length;\n\t var result = number.toString(radix);\n\t return new Array(Math.max(min_length + 1 - result.length, 0)).join('0') + result;\n\t};\n\t\n\texports.CEILING = function(number, significance, mode) {\n\t significance = (significance === undefined) ? 1 : Math.abs(significance);\n\t mode = mode || 0;\n\t\n\t number = utils.parseNumber(number);\n\t significance = utils.parseNumber(significance);\n\t mode = utils.parseNumber(mode);\n\t if (utils.anyIsError(number, significance, mode)) {\n\t return error.value;\n\t }\n\t if (significance === 0) {\n\t return 0;\n\t }\n\t var precision = -Math.floor(Math.log(significance) / Math.log(10));\n\t if (number >= 0) {\n\t return exports.ROUND(Math.ceil(number / significance) * significance, precision);\n\t } else {\n\t if (mode === 0) {\n\t return -exports.ROUND(Math.floor(Math.abs(number) / significance) * significance, precision);\n\t } else {\n\t return -exports.ROUND(Math.ceil(Math.abs(number) / significance) * significance, precision);\n\t }\n\t }\n\t};\n\t\n\texports.CEILING.MATH = exports.CEILING;\n\t\n\texports.CEILING.PRECISE = exports.CEILING;\n\t\n\texports.COMBIN = function(number, number_chosen) {\n\t number = utils.parseNumber(number);\n\t number_chosen = utils.parseNumber(number_chosen);\n\t if (utils.anyIsError(number, number_chosen)) {\n\t return error.value;\n\t }\n\t return exports.FACT(number) / (exports.FACT(number_chosen) * exports.FACT(number - number_chosen));\n\t};\n\t\n\texports.COMBINA = function(number, number_chosen) {\n\t number = utils.parseNumber(number);\n\t number_chosen = utils.parseNumber(number_chosen);\n\t if (utils.anyIsError(number, number_chosen)) {\n\t return error.value;\n\t }\n\t return (number === 0 && number_chosen === 0) ? 1 : exports.COMBIN(number + number_chosen - 1, number - 1);\n\t};\n\t\n\texports.COS = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return Math.cos(number);\n\t};\n\t\n\texports.COSH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return (Math.exp(number) + Math.exp(-number)) / 2;\n\t};\n\t\n\texports.COT = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return 1 / Math.tan(number);\n\t};\n\t\n\texports.COTH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var e2 = Math.exp(2 * number);\n\t return (e2 + 1) / (e2 - 1);\n\t};\n\t\n\texports.CSC = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return 1 / Math.sin(number);\n\t};\n\t\n\texports.CSCH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return 2 / (Math.exp(number) - Math.exp(-number));\n\t};\n\t\n\texports.DECIMAL = function(number, radix) {\n\t if (arguments.length < 1) {\n\t return error.value;\n\t }\n\t\n\t\n\t return parseInt(number, radix);\n\t};\n\t\n\texports.DEGREES = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return number * 180 / Math.PI;\n\t};\n\t\n\texports.EVEN = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return exports.CEILING(number, -2, -1);\n\t};\n\t\n\texports.EXP = Math.exp;\n\t\n\tvar MEMOIZED_FACT = [];\n\texports.FACT = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var n = Math.floor(number);\n\t if (n === 0 || n === 1) {\n\t return 1;\n\t } else if (MEMOIZED_FACT[n] > 0) {\n\t return MEMOIZED_FACT[n];\n\t } else {\n\t MEMOIZED_FACT[n] = exports.FACT(n - 1) * n;\n\t return MEMOIZED_FACT[n];\n\t }\n\t};\n\t\n\texports.FACTDOUBLE = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var n = Math.floor(number);\n\t if (n <= 0) {\n\t return 1;\n\t } else {\n\t return n * exports.FACTDOUBLE(n - 2);\n\t }\n\t};\n\t\n\texports.FLOOR = function(number, significance) {\n\t number = utils.parseNumber(number);\n\t significance = utils.parseNumber(significance);\n\t if (utils.anyIsError(number, significance)) {\n\t return error.value;\n\t }\n\t if (significance === 0) {\n\t return 0;\n\t }\n\t\n\t if (!(number > 0 && significance > 0) && !(number < 0 && significance < 0)) {\n\t return error.num;\n\t }\n\t\n\t significance = Math.abs(significance);\n\t var precision = -Math.floor(Math.log(significance) / Math.log(10));\n\t if (number >= 0) {\n\t return exports.ROUND(Math.floor(number / significance) * significance, precision);\n\t } else {\n\t return -exports.ROUND(Math.ceil(Math.abs(number) / significance), precision);\n\t }\n\t};\n\t\n\t//TODO: Verify\n\texports.FLOOR.MATH = function(number, significance, mode) {\n\t significance = (significance === undefined) ? 1 : significance;\n\t mode = (mode === undefined) ? 0 : mode;\n\t\n\t number = utils.parseNumber(number);\n\t significance = utils.parseNumber(significance);\n\t mode = utils.parseNumber(mode);\n\t if (utils.anyIsError(number, significance, mode)) {\n\t return error.value;\n\t }\n\t if (significance === 0) {\n\t return 0;\n\t }\n\t\n\t significance = significance ? Math.abs(significance) : 1;\n\t var precision = -Math.floor(Math.log(significance) / Math.log(10));\n\t if (number >= 0) {\n\t return exports.ROUND(Math.floor(number / significance) * significance, precision);\n\t } else if (mode === 0 || mode === undefined) {\n\t return -exports.ROUND(Math.ceil(Math.abs(number) / significance) * significance, precision);\n\t }\n\t return -exports.ROUND(Math.floor(Math.abs(number) / significance) * significance, precision);\n\t};\n\t\n\t// Deprecated\n\texports.FLOOR.PRECISE = exports.FLOOR.MATH;\n\t\n\t// adapted http://rosettacode.org/wiki/Greatest_common_divisor#JavaScript\n\texports.GCD = function() {\n\t var range = utils.parseNumberArray(utils.flatten(arguments));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t var n = range.length;\n\t var r0 = range[0];\n\t var x = r0 < 0 ? -r0 : r0;\n\t for (var i = 1; i < n; i++) {\n\t var ri = range[i];\n\t var y = ri < 0 ? -ri : ri;\n\t while (x && y) {\n\t if (x > y) {\n\t x %= y;\n\t } else {\n\t y %= x;\n\t }\n\t }\n\t x += y;\n\t }\n\t return x;\n\t};\n\t\n\t\n\texports.INT = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return Math.floor(number);\n\t};\n\t\n\t//TODO: verify\n\texports.ISO = {\n\t CEILING: exports.CEILING\n\t};\n\t\n\texports.LCM = function() {\n\t // Credits: Jonas Raoni Soares Silva\n\t var o = utils.parseNumberArray(utils.flatten(arguments));\n\t if (o instanceof Error) {\n\t return o;\n\t }\n\t for (var i, j, n, d, r = 1;\n\t (n = o.pop()) !== undefined;) {\n\t while (n > 1) {\n\t if (n % 2) {\n\t for (i = 3, j = Math.floor(Math.sqrt(n)); i <= j && n % i; i += 2) {\n\t //empty\n\t }\n\t d = (i <= j) ? i : n;\n\t } else {\n\t d = 2;\n\t }\n\t for (n /= d, r *= d, i = o.length; i;\n\t (o[--i] % d) === 0 && (o[i] /= d) === 1 && o.splice(i, 1)) {\n\t //empty\n\t }\n\t }\n\t }\n\t return r;\n\t};\n\t\n\texports.LN = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return Math.log(number);\n\t};\n\t\n\texports.LN10 = function() {\n\t return Math.log(10);\n\t};\n\t\n\texports.LN2 = function() {\n\t return Math.log(2);\n\t};\n\t\n\texports.LOG10E = function() {\n\t return Math.LOG10E;\n\t};\n\t\n\texports.LOG2E = function() {\n\t return Math.LOG2E;\n\t};\n\t\n\texports.LOG = function(number, base) {\n\t number = utils.parseNumber(number);\n\t base = utils.parseNumber(base);\n\t if (utils.anyIsError(number, base)) {\n\t return error.value;\n\t }\n\t base = (base === undefined) ? 10 : base;\n\t return Math.log(number) / Math.log(base);\n\t};\n\t\n\texports.LOG10 = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return Math.log(number) / Math.log(10);\n\t};\n\t\n\texports.MOD = function(dividend, divisor) {\n\t dividend = utils.parseNumber(dividend);\n\t divisor = utils.parseNumber(divisor);\n\t if (utils.anyIsError(dividend, divisor)) {\n\t return error.value;\n\t }\n\t if (divisor === 0) {\n\t return error.div0;\n\t }\n\t var modulus = Math.abs(dividend % divisor);\n\t return (divisor > 0) ? modulus : -modulus;\n\t};\n\t\n\texports.MROUND = function(number, multiple) {\n\t number = utils.parseNumber(number);\n\t multiple = utils.parseNumber(multiple);\n\t if (utils.anyIsError(number, multiple)) {\n\t return error.value;\n\t }\n\t if (number * multiple < 0) {\n\t return error.num;\n\t }\n\t\n\t return Math.round(number / multiple) * multiple;\n\t};\n\t\n\texports.MULTINOMIAL = function() {\n\t var args = utils.parseNumberArray(utils.flatten(arguments));\n\t if (args instanceof Error) {\n\t return args;\n\t }\n\t var sum = 0;\n\t var divisor = 1;\n\t for (var i = 0; i < args.length; i++) {\n\t sum += args[i];\n\t divisor *= exports.FACT(args[i]);\n\t }\n\t return exports.FACT(sum) / divisor;\n\t};\n\t\n\texports.ODD = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var temp = Math.ceil(Math.abs(number));\n\t temp = (temp & 1) ? temp : temp + 1;\n\t return (number > 0) ? temp : -temp;\n\t};\n\t\n\texports.PI = function() {\n\t return Math.PI;\n\t};\n\t\n\texports.E = function() {\n\t return Math.E;\n\t};\n\t\n\texports.POWER = function(number, power) {\n\t number = utils.parseNumber(number);\n\t power = utils.parseNumber(power);\n\t if (utils.anyIsError(number, power)) {\n\t return error.value;\n\t }\n\t var result = Math.pow(number, power);\n\t if (isNaN(result)) {\n\t return error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.PRODUCT = function() {\n\t var args = utils.parseNumberArray(utils.flatten(arguments));\n\t if (args instanceof Error) {\n\t return args;\n\t }\n\t var result = 1;\n\t for (var i = 0; i < args.length; i++) {\n\t result *= args[i];\n\t }\n\t return result;\n\t};\n\t\n\texports.QUOTIENT = function(numerator, denominator) {\n\t numerator = utils.parseNumber(numerator);\n\t denominator = utils.parseNumber(denominator);\n\t if (utils.anyIsError(numerator, denominator)) {\n\t return error.value;\n\t }\n\t return parseInt(numerator / denominator, 10);\n\t};\n\t\n\texports.RADIANS = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return number * Math.PI / 180;\n\t};\n\t\n\texports.RAND = function() {\n\t return Math.random();\n\t};\n\t\n\texports.RANDBETWEEN = function(bottom, top) {\n\t bottom = utils.parseNumber(bottom);\n\t top = utils.parseNumber(top);\n\t if (utils.anyIsError(bottom, top)) {\n\t return error.value;\n\t }\n\t // Creative Commons Attribution 3.0 License\n\t // Copyright (c) 2012 eqcode\n\t return bottom + Math.ceil((top - bottom + 1) * Math.random()) - 1;\n\t};\n\t\n\t// TODO\n\texports.ROMAN = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t // The MIT License\n\t // Copyright (c) 2008 Steven Levithan\n\t var digits = String(number).split('');\n\t var key = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM', '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC', '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'];\n\t var roman = '';\n\t var i = 3;\n\t while (i--) {\n\t roman = (key[+digits.pop() + (i * 10)] || '') + roman;\n\t }\n\t return new Array(+digits.join('') + 1).join('M') + roman;\n\t};\n\t\n\texports.ROUND = function(number, digits) {\n\t number = utils.parseNumber(number);\n\t digits = utils.parseNumber(digits);\n\t if (utils.anyIsError(number, digits)) {\n\t return error.value;\n\t }\n\t return Math.round(number * Math.pow(10, digits)) / Math.pow(10, digits);\n\t};\n\t\n\texports.ROUNDDOWN = function(number, digits) {\n\t number = utils.parseNumber(number);\n\t digits = utils.parseNumber(digits);\n\t if (utils.anyIsError(number, digits)) {\n\t return error.value;\n\t }\n\t var sign = (number > 0) ? 1 : -1;\n\t return sign * (Math.floor(Math.abs(number) * Math.pow(10, digits))) / Math.pow(10, digits);\n\t};\n\t\n\texports.ROUNDUP = function(number, digits) {\n\t number = utils.parseNumber(number);\n\t digits = utils.parseNumber(digits);\n\t if (utils.anyIsError(number, digits)) {\n\t return error.value;\n\t }\n\t var sign = (number > 0) ? 1 : -1;\n\t return sign * (Math.ceil(Math.abs(number) * Math.pow(10, digits))) / Math.pow(10, digits);\n\t};\n\t\n\texports.SEC = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return 1 / Math.cos(number);\n\t};\n\t\n\texports.SECH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return 2 / (Math.exp(number) + Math.exp(-number));\n\t};\n\t\n\texports.SERIESSUM = function(x, n, m, coefficients) {\n\t x = utils.parseNumber(x);\n\t n = utils.parseNumber(n);\n\t m = utils.parseNumber(m);\n\t coefficients = utils.parseNumberArray(coefficients);\n\t if (utils.anyIsError(x, n, m, coefficients)) {\n\t return error.value;\n\t }\n\t var result = coefficients[0] * Math.pow(x, n);\n\t for (var i = 1; i < coefficients.length; i++) {\n\t result += coefficients[i] * Math.pow(x, n + i * m);\n\t }\n\t return result;\n\t};\n\t\n\texports.SIGN = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t if (number < 0) {\n\t return -1;\n\t } else if (number === 0) {\n\t return 0;\n\t } else {\n\t return 1;\n\t }\n\t};\n\t\n\texports.SIN = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return Math.sin(number);\n\t};\n\t\n\texports.SINH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return (Math.exp(number) - Math.exp(-number)) / 2;\n\t};\n\t\n\texports.SQRT = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t if (number < 0) {\n\t return error.num;\n\t }\n\t return Math.sqrt(number);\n\t};\n\t\n\texports.SQRTPI = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return Math.sqrt(number * Math.PI);\n\t};\n\t\n\texports.SQRT1_2 = function() {\n\t return 1 / Math.sqrt(2);\n\t};\n\t\n\texports.SQRT2 = function() {\n\t return Math.sqrt(2);\n\t};\n\t\n\texports.SUBTOTAL = function(function_code, ref1) {\n\t function_code = utils.parseNumber(function_code);\n\t if (function_code instanceof Error) {\n\t return function_code;\n\t }\n\t switch (function_code) {\n\t case 1:\n\t return statistical.AVERAGE(ref1);\n\t case 2:\n\t return statistical.COUNT(ref1);\n\t case 3:\n\t return statistical.COUNTA(ref1);\n\t case 4:\n\t return statistical.MAX(ref1);\n\t case 5:\n\t return statistical.MIN(ref1);\n\t case 6:\n\t return exports.PRODUCT(ref1);\n\t case 7:\n\t return statistical.STDEV.S(ref1);\n\t case 8:\n\t return statistical.STDEV.P(ref1);\n\t case 9:\n\t return exports.SUM(ref1);\n\t case 10:\n\t return statistical.VAR.S(ref1);\n\t case 11:\n\t return statistical.VAR.P(ref1);\n\t // no hidden values for us\n\t case 101:\n\t return statistical.AVERAGE(ref1);\n\t case 102:\n\t return statistical.COUNT(ref1);\n\t case 103:\n\t return statistical.COUNTA(ref1);\n\t case 104:\n\t return statistical.MAX(ref1);\n\t case 105:\n\t return statistical.MIN(ref1);\n\t case 106:\n\t return exports.PRODUCT(ref1);\n\t case 107:\n\t return statistical.STDEV.S(ref1);\n\t case 108:\n\t return statistical.STDEV.P(ref1);\n\t case 109:\n\t return exports.SUM(ref1);\n\t case 110:\n\t return statistical.VAR.S(ref1);\n\t case 111:\n\t return statistical.VAR.P(ref1);\n\t\n\t }\n\t};\n\t\n\texports.ADD = function (num1, num2) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t num1 = utils.parseNumber(num1);\n\t num2 = utils.parseNumber(num2);\n\t if (utils.anyIsError(num1, num2)) {\n\t return error.value;\n\t }\n\t\n\t return num1 + num2;\n\t};\n\t\n\texports.MINUS = function (num1, num2) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t num1 = utils.parseNumber(num1);\n\t num2 = utils.parseNumber(num2);\n\t if (utils.anyIsError(num1, num2)) {\n\t return error.value;\n\t }\n\t\n\t return num1 - num2;\n\t};\n\t\n\texports.DIVIDE = function (dividend, divisor) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t dividend = utils.parseNumber(dividend);\n\t divisor = utils.parseNumber(divisor);\n\t if (utils.anyIsError(dividend, divisor)) {\n\t return error.value;\n\t }\n\t\n\t if (divisor === 0) {\n\t return error.div0;\n\t }\n\t\n\t return dividend / divisor;\n\t};\n\t\n\texports.MULTIPLY = function (factor1, factor2) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t factor1 = utils.parseNumber(factor1);\n\t factor2 = utils.parseNumber(factor2);\n\t if (utils.anyIsError(factor1, factor2)) {\n\t return error.value;\n\t }\n\t\n\t return factor1 * factor2;\n\t};\n\t\n\texports.GTE = function (num1, num2) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t num1 = utils.parseNumber(num1);\n\t num2 = utils.parseNumber(num2);\n\t if (utils.anyIsError(num1, num2)) {\n\t return error.error;\n\t }\n\t\n\t return num1 >= num2;\n\t};\n\t\n\texports.LT = function (num1, num2) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t num1 = utils.parseNumber(num1);\n\t num2 = utils.parseNumber(num2);\n\t if (utils.anyIsError(num1, num2)) {\n\t return error.error;\n\t }\n\t\n\t return num1 < num2;\n\t};\n\t\n\t\n\texports.LTE = function (num1, num2) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t num1 = utils.parseNumber(num1);\n\t num2 = utils.parseNumber(num2);\n\t if (utils.anyIsError(num1, num2)) {\n\t return error.error;\n\t }\n\t\n\t return num1 <= num2;\n\t};\n\t\n\texports.EQ = function (value1, value2) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t return value1 === value2;\n\t};\n\t\n\texports.NE = function (value1, value2) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t return value1 !== value2;\n\t};\n\t\n\texports.POW = function (base, exponent) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t base = utils.parseNumber(base);\n\t exponent = utils.parseNumber(exponent);\n\t if (utils.anyIsError(base, exponent)) {\n\t return error.error;\n\t }\n\t\n\t return exports.POWER(base, exponent);\n\t};\n\t\n\texports.SUM = function() {\n\t var result = 0;\n\t\n\t utils.arrayEach(utils.argsToArray(arguments), function(value) {\n\t if (typeof value === 'number') {\n\t result += value;\n\t\n\t } else if (typeof value === 'string') {\n\t var parsed = parseFloat(value);\n\t\n\t !isNaN(parsed) && (result += parsed);\n\t\n\t } else if (Array.isArray(value)) {\n\t result += exports.SUM.apply(null, value);\n\t }\n\t });\n\t\n\t return result;\n\t};\n\t\n\texports.SUMIF = function(range, criteria) {\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t var result = 0;\n\t for (var i = 0; i < range.length; i++) {\n\t result += (eval(range[i] + criteria)) ? range[i] : 0; // jshint ignore:line\n\t }\n\t return result;\n\t};\n\t\n\texports.SUMIFS = function() {\n\t var args = utils.argsToArray(arguments);\n\t var range = utils.parseNumberArray(utils.flatten(args.shift()));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t var criteria = args;\n\t\n\t var n_range_elements = range.length;\n\t var n_criterias = criteria.length;\n\t\n\t var result = 0;\n\t for (var i = 0; i < n_range_elements; i++) {\n\t var el = range[i];\n\t var condition = '';\n\t for (var c = 0; c < n_criterias; c++) {\n\t condition += el + criteria[c];\n\t if (c !== n_criterias - 1) {\n\t condition += '&&';\n\t }\n\t }\n\t if (eval(condition)) { // jshint ignore:line\n\t result += el;\n\t }\n\t }\n\t return result;\n\t};\n\t\n\texports.SUMPRODUCT = function() {\n\t if (!arguments || arguments.length === 0) {\n\t return error.value;\n\t }\n\t var arrays = arguments.length + 1;\n\t var result = 0;\n\t var product;\n\t var k;\n\t var _i;\n\t var _ij;\n\t for (var i = 0; i < arguments[0].length; i++) {\n\t if (!(arguments[0][i] instanceof Array)) {\n\t product = 1;\n\t for (k = 1; k < arrays; k++) {\n\t _i = utils.parseNumber(arguments[k - 1][i]);\n\t if (_i instanceof Error) {\n\t return _i;\n\t }\n\t product *= _i;\n\t }\n\t result += product;\n\t } else {\n\t for (var j = 0; j < arguments[0][i].length; j++) {\n\t product = 1;\n\t for (k = 1; k < arrays; k++) {\n\t _ij = utils.parseNumber(arguments[k - 1][i][j]);\n\t if (_ij instanceof Error) {\n\t return _ij;\n\t }\n\t product *= _ij;\n\t }\n\t result += product;\n\t }\n\t }\n\t }\n\t return result;\n\t};\n\t\n\texports.SUMSQ = function() {\n\t var numbers = utils.parseNumberArray(utils.flatten(arguments));\n\t if (numbers instanceof Error) {\n\t return numbers;\n\t }\n\t var result = 0;\n\t var length = numbers.length;\n\t for (var i = 0; i < length; i++) {\n\t result += (information.ISNUMBER(numbers[i])) ? numbers[i] * numbers[i] : 0;\n\t }\n\t return result;\n\t};\n\t\n\texports.SUMX2MY2 = function(array_x, array_y) {\n\t array_x = utils.parseNumberArray(utils.flatten(array_x));\n\t array_y = utils.parseNumberArray(utils.flatten(array_y));\n\t if (utils.anyIsError(array_x, array_y)) {\n\t return error.value;\n\t }\n\t var result = 0;\n\t for (var i = 0; i < array_x.length; i++) {\n\t result += array_x[i] * array_x[i] - array_y[i] * array_y[i];\n\t }\n\t return result;\n\t};\n\t\n\texports.SUMX2PY2 = function(array_x, array_y) {\n\t array_x = utils.parseNumberArray(utils.flatten(array_x));\n\t array_y = utils.parseNumberArray(utils.flatten(array_y));\n\t if (utils.anyIsError(array_x, array_y)) {\n\t return error.value;\n\t }\n\t var result = 0;\n\t array_x = utils.parseNumberArray(utils.flatten(array_x));\n\t array_y = utils.parseNumberArray(utils.flatten(array_y));\n\t for (var i = 0; i < array_x.length; i++) {\n\t result += array_x[i] * array_x[i] + array_y[i] * array_y[i];\n\t }\n\t return result;\n\t};\n\t\n\texports.SUMXMY2 = function(array_x, array_y) {\n\t array_x = utils.parseNumberArray(utils.flatten(array_x));\n\t array_y = utils.parseNumberArray(utils.flatten(array_y));\n\t if (utils.anyIsError(array_x, array_y)) {\n\t return error.value;\n\t }\n\t var result = 0;\n\t array_x = utils.flatten(array_x);\n\t array_y = utils.flatten(array_y);\n\t for (var i = 0; i < array_x.length; i++) {\n\t result += Math.pow(array_x[i] - array_y[i], 2);\n\t }\n\t return result;\n\t};\n\t\n\texports.TAN = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return Math.tan(number);\n\t};\n\t\n\texports.TANH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var e2 = Math.exp(2 * number);\n\t return (e2 - 1) / (e2 + 1);\n\t};\n\t\n\texports.TRUNC = function(number, digits) {\n\t digits = (digits === undefined) ? 0 : digits;\n\t number = utils.parseNumber(number);\n\t digits = utils.parseNumber(digits);\n\t if (utils.anyIsError(number, digits)) {\n\t return error.value;\n\t }\n\t var sign = (number > 0) ? 1 : -1;\n\t return sign * (Math.floor(Math.abs(number) * Math.pow(10, digits))) / Math.pow(10, digits);\n\t};\n\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar error = __webpack_require__(16);\n\t\n\texports.flattenShallow = function(array) {\n\t if (!array || !array.reduce) {\n\t return array;\n\t }\n\t\n\t return array.reduce(function(a, b) {\n\t var aIsArray = Array.isArray(a);\n\t var bIsArray = Array.isArray(b);\n\t\n\t if (aIsArray && bIsArray ) {\n\t return a.concat(b);\n\t }\n\t if (aIsArray) {\n\t a.push(b);\n\t\n\t return a;\n\t }\n\t if (bIsArray) {\n\t return [a].concat(b);\n\t }\n\t\n\t return [a, b];\n\t });\n\t};\n\t\n\texports.isFlat = function(array) {\n\t if (!array) {\n\t return false;\n\t }\n\t\n\t for (var i = 0; i < array.length; ++i) {\n\t if (Array.isArray(array[i])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t};\n\t\n\texports.flatten = function() {\n\t var result = exports.argsToArray.apply(null, arguments);\n\t\n\t while (!exports.isFlat(result)) {\n\t result = exports.flattenShallow(result);\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.argsToArray = function(args) {\n\t var result = [];\n\t\n\t exports.arrayEach(args, function(value) {\n\t result.push(value);\n\t });\n\t\n\t return result;\n\t};\n\t\n\texports.numbers = function() {\n\t var possibleNumbers = this.flatten.apply(null, arguments);\n\t return possibleNumbers.filter(function(el) {\n\t return typeof el === 'number';\n\t });\n\t};\n\t\n\texports.cleanFloat = function(number) {\n\t var power = 1e14;\n\t return Math.round(number * power) / power;\n\t};\n\t\n\texports.parseBool = function(bool) {\n\t if (typeof bool === 'boolean') {\n\t return bool;\n\t }\n\t\n\t if (bool instanceof Error) {\n\t return bool;\n\t }\n\t\n\t if (typeof bool === 'number') {\n\t return bool !== 0;\n\t }\n\t\n\t if (typeof bool === 'string') {\n\t var up = bool.toUpperCase();\n\t if (up === 'TRUE') {\n\t return true;\n\t }\n\t\n\t if (up === 'FALSE') {\n\t return false;\n\t }\n\t }\n\t\n\t if (bool instanceof Date && !isNaN(bool)) {\n\t return true;\n\t }\n\t\n\t return error.value;\n\t};\n\t\n\texports.parseNumber = function(string) {\n\t if (string === undefined || string === '') {\n\t return error.value;\n\t }\n\t if (!isNaN(string)) {\n\t return parseFloat(string);\n\t }\n\t\n\t return error.value;\n\t};\n\t\n\texports.parseNumberArray = function(arr) {\n\t var len;\n\t\n\t if (!arr || (len = arr.length) === 0) {\n\t return error.value;\n\t }\n\t\n\t var parsed;\n\t\n\t while (len--) {\n\t parsed = exports.parseNumber(arr[len]);\n\t if (parsed === error.value) {\n\t return parsed;\n\t }\n\t arr[len] = parsed;\n\t }\n\t\n\t return arr;\n\t};\n\t\n\texports.parseMatrix = function(matrix) {\n\t var n;\n\t\n\t if (!matrix || (n = matrix.length) === 0) {\n\t return error.value;\n\t }\n\t var pnarr;\n\t\n\t for (var i = 0; i < matrix.length; i++) {\n\t pnarr = exports.parseNumberArray(matrix[i]);\n\t matrix[i] = pnarr;\n\t\n\t if (pnarr instanceof Error) {\n\t return pnarr;\n\t }\n\t }\n\t\n\t return matrix;\n\t};\n\t\n\tvar d1900 = new Date(1900, 0, 1);\n\texports.parseDate = function(date) {\n\t if (!isNaN(date)) {\n\t if (date instanceof Date) {\n\t return new Date(date);\n\t }\n\t var d = parseInt(date, 10);\n\t if (d < 0) {\n\t return error.num;\n\t }\n\t if (d <= 60) {\n\t return new Date(d1900.getTime() + (d - 1) * 86400000);\n\t }\n\t return new Date(d1900.getTime() + (d - 2) * 86400000);\n\t }\n\t if (typeof date === 'string') {\n\t date = new Date(date);\n\t if (!isNaN(date)) {\n\t return date;\n\t }\n\t }\n\t return error.value;\n\t};\n\t\n\texports.parseDateArray = function(arr) {\n\t var len = arr.length;\n\t var parsed;\n\t while (len--) {\n\t parsed = this.parseDate(arr[len]);\n\t if (parsed === error.value) {\n\t return parsed;\n\t }\n\t arr[len] = parsed;\n\t }\n\t return arr;\n\t};\n\t\n\texports.anyIsError = function() {\n\t var n = arguments.length;\n\t while (n--) {\n\t if (arguments[n] instanceof Error) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t};\n\t\n\texports.arrayValuesToNumbers = function(arr) {\n\t var n = arr.length;\n\t var el;\n\t while (n--) {\n\t el = arr[n];\n\t if (typeof el === 'number') {\n\t continue;\n\t }\n\t if (el === true) {\n\t arr[n] = 1;\n\t continue;\n\t }\n\t if (el === false) {\n\t arr[n] = 0;\n\t continue;\n\t }\n\t if (typeof el === 'string') {\n\t var number = this.parseNumber(el);\n\t if (number instanceof Error) {\n\t arr[n] = 0;\n\t } else {\n\t arr[n] = number;\n\t }\n\t }\n\t }\n\t return arr;\n\t};\n\t\n\texports.rest = function(array, idx) {\n\t idx = idx || 1;\n\t if (!array || typeof array.slice !== 'function') {\n\t return array;\n\t }\n\t return array.slice(idx);\n\t};\n\t\n\texports.initial = function(array, idx) {\n\t idx = idx || 1;\n\t if (!array || typeof array.slice !== 'function') {\n\t return array;\n\t }\n\t return array.slice(0, array.length - idx);\n\t};\n\t\n\texports.arrayEach = function(array, iteratee) {\n\t var index = -1, length = array.length;\n\t\n\t while (++index < length) {\n\t if (iteratee(array[index], index, array) === false) {\n\t break;\n\t }\n\t }\n\t\n\t return array;\n\t};\n\n\n/***/ },\n/* 16 */\n/***/ function(module, exports) {\n\n\texports.nil = new Error('#NULL!');\n\texports.div0 = new Error('#DIV/0!');\n\texports.value = new Error('#VALUE?');\n\texports.ref = new Error('#REF!');\n\texports.name = new Error('#NAME?');\n\texports.num = new Error('#NUM!');\n\texports.na = new Error('#N/A');\n\texports.error = new Error('#ERROR!');\n\texports.data = new Error('#GETTING_DATA');\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar mathTrig = __webpack_require__(14);\n\tvar text = __webpack_require__(18);\n\tvar jStat = __webpack_require__(22).jStat;\n\tvar utils = __webpack_require__(15);\n\tvar error = __webpack_require__(16);\n\tvar misc = __webpack_require__(23);\n\t\n\tvar SQRT2PI = 2.5066282746310002;\n\t\n\texports.AVEDEV = function() {\n\t var range = utils.parseNumberArray(utils.flatten(arguments));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t return jStat.sum(jStat(range).subtract(jStat.mean(range)).abs()[0]) / range.length;\n\t};\n\t\n\texports.AVERAGE = function() {\n\t var range = utils.numbers(utils.flatten(arguments));\n\t var n = range.length;\n\t var sum = 0;\n\t var count = 0;\n\t var result;\n\t\n\t for (var i = 0; i < n; i++) {\n\t sum += range[i];\n\t count += 1;\n\t }\n\t result = sum / count;\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.AVERAGEA = function() {\n\t var range = utils.flatten(arguments);\n\t var n = range.length;\n\t var sum = 0;\n\t var count = 0;\n\t var result;\n\t for (var i = 0; i < n; i++) {\n\t var el = range[i];\n\t if (typeof el === 'number') {\n\t sum += el;\n\t }\n\t if (el === true) {\n\t sum++;\n\t }\n\t if (el !== null) {\n\t count++;\n\t }\n\t }\n\t result = sum / count;\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.AVERAGEIF = function(range, criteria, average_range) {\n\t if (arguments.length <= 1) {\n\t return error.na;\n\t }\n\t average_range = average_range || range;\n\t range = utils.flatten(range);\n\t average_range = utils.parseNumberArray(utils.flatten(average_range));\n\t if (average_range instanceof Error) {\n\t return average_range;\n\t }\n\t var average_count = 0;\n\t var result = 0;\n\t for (var i = 0; i < range.length; i++) {\n\t if (eval(range[i] + criteria)) { // jshint ignore:line\n\t result += average_range[i];\n\t average_count++;\n\t }\n\t }\n\t return result / average_count;\n\t};\n\t\n\texports.AVERAGEIFS = function() {\n\t // Does not work with multi dimensional ranges yet!\n\t //http://office.microsoft.com/en-001/excel-help/averageifs-function-HA010047493.aspx\n\t var args = utils.argsToArray(arguments);\n\t var criteria = (args.length - 1) / 2;\n\t var range = utils.flatten(args[0]);\n\t var count = 0;\n\t var result = 0;\n\t for (var i = 0; i < range.length; i++) {\n\t var condition = '';\n\t for (var j = 0; j < criteria; j++) {\n\t condition += args[2 * j + 1][i] + args[2 * j + 2];\n\t if (j !== criteria - 1) {\n\t condition += '&&';\n\t }\n\t }\n\t if (eval(condition)) { // jshint ignore:line\n\t result += range[i];\n\t count++;\n\t }\n\t }\n\t\n\t var average = result / count;\n\t if (isNaN(average)) {\n\t return 0;\n\t } else {\n\t return average;\n\t }\n\t};\n\t\n\texports.BETA = {};\n\t\n\texports.BETA.DIST = function(x, alpha, beta, cumulative, A, B) {\n\t if (arguments.length < 4) {\n\t return error.value;\n\t }\n\t\n\t A = (A === undefined) ? 0 : A;\n\t B = (B === undefined) ? 1 : B;\n\t\n\t x = utils.parseNumber(x);\n\t alpha = utils.parseNumber(alpha);\n\t beta = utils.parseNumber(beta);\n\t A = utils.parseNumber(A);\n\t B = utils.parseNumber(B);\n\t if (utils.anyIsError(x, alpha, beta, A, B)) {\n\t return error.value;\n\t }\n\t\n\t x = (x - A) / (B - A);\n\t return (cumulative) ? jStat.beta.cdf(x, alpha, beta) : jStat.beta.pdf(x, alpha, beta);\n\t};\n\t\n\texports.BETA.INV = function(probability, alpha, beta, A, B) {\n\t A = (A === undefined) ? 0 : A;\n\t B = (B === undefined) ? 1 : B;\n\t\n\t probability = utils.parseNumber(probability);\n\t alpha = utils.parseNumber(alpha);\n\t beta = utils.parseNumber(beta);\n\t A = utils.parseNumber(A);\n\t B = utils.parseNumber(B);\n\t if (utils.anyIsError(probability, alpha, beta, A, B)) {\n\t return error.value;\n\t }\n\t\n\t return jStat.beta.inv(probability, alpha, beta) * (B - A) + A;\n\t};\n\t\n\texports.BINOM = {};\n\t\n\texports.BINOM.DIST = function(successes, trials, probability, cumulative) {\n\t successes = utils.parseNumber(successes);\n\t trials = utils.parseNumber(trials);\n\t probability = utils.parseNumber(probability);\n\t cumulative = utils.parseNumber(cumulative);\n\t if (utils.anyIsError(successes, trials, probability, cumulative)) {\n\t return error.value;\n\t }\n\t return (cumulative) ? jStat.binomial.cdf(successes, trials, probability) : jStat.binomial.pdf(successes, trials, probability);\n\t};\n\t\n\texports.BINOM.DIST.RANGE = function(trials, probability, successes, successes2) {\n\t successes2 = (successes2 === undefined) ? successes : successes2;\n\t\n\t trials = utils.parseNumber(trials);\n\t probability = utils.parseNumber(probability);\n\t successes = utils.parseNumber(successes);\n\t successes2 = utils.parseNumber(successes2);\n\t if (utils.anyIsError(trials, probability, successes, successes2)) {\n\t return error.value;\n\t }\n\t\n\t var result = 0;\n\t for (var i = successes; i <= successes2; i++) {\n\t result += mathTrig.COMBIN(trials, i) * Math.pow(probability, i) * Math.pow(1 - probability, trials - i);\n\t }\n\t return result;\n\t};\n\t\n\texports.BINOM.INV = function(trials, probability, alpha) {\n\t trials = utils.parseNumber(trials);\n\t probability = utils.parseNumber(probability);\n\t alpha = utils.parseNumber(alpha);\n\t if (utils.anyIsError(trials, probability, alpha)) {\n\t return error.value;\n\t }\n\t\n\t var x = 0;\n\t while (x <= trials) {\n\t if (jStat.binomial.cdf(x, trials, probability) >= alpha) {\n\t return x;\n\t }\n\t x++;\n\t }\n\t};\n\t\n\texports.CHISQ = {};\n\t\n\texports.CHISQ.DIST = function(x, k, cumulative) {\n\t x = utils.parseNumber(x);\n\t k = utils.parseNumber(k);\n\t if (utils.anyIsError(x, k)) {\n\t return error.value;\n\t }\n\t\n\t return (cumulative) ? jStat.chisquare.cdf(x, k) : jStat.chisquare.pdf(x, k);\n\t};\n\t\n\texports.CHISQ.DIST.RT = function(x, k) {\n\t if (!x | !k) {\n\t return error.na;\n\t }\n\t\n\t if (x < 1 || k > Math.pow(10, 10)) {\n\t return error.num;\n\t }\n\t\n\t if ((typeof x !== 'number') || (typeof k !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t return 1 - jStat.chisquare.cdf(x, k);\n\t};\n\t\n\texports.CHISQ.INV = function(probability, k) {\n\t probability = utils.parseNumber(probability);\n\t k = utils.parseNumber(k);\n\t if (utils.anyIsError(probability, k)) {\n\t return error.value;\n\t }\n\t return jStat.chisquare.inv(probability, k);\n\t};\n\t\n\texports.CHISQ.INV.RT = function(p, k) {\n\t if (!p | !k) {\n\t return error.na;\n\t }\n\t\n\t if (p < 0 || p > 1 || k < 1 || k > Math.pow(10, 10)) {\n\t return error.num;\n\t }\n\t\n\t if ((typeof p !== 'number') || (typeof k !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t return jStat.chisquare.inv(1.0 - p, k);\n\t};\n\t\n\texports.CHISQ.TEST = function(observed, expected) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t if ((!(observed instanceof Array)) || (!(expected instanceof Array))) {\n\t return error.value;\n\t }\n\t\n\t if (observed.length !== expected.length) {\n\t return error.value;\n\t }\n\t\n\t if (observed[0] && expected[0] &&\n\t observed[0].length !== expected[0].length) {\n\t return error.value;\n\t }\n\t\n\t var row = observed.length;\n\t var tmp, i, j;\n\t\n\t // Convert single-dimension array into two-dimension array\n\t for (i = 0; i < row; i ++) {\n\t if (!(observed[i] instanceof Array)) {\n\t tmp = observed[i];\n\t observed[i] = [];\n\t observed[i].push(tmp);\n\t }\n\t if (!(expected[i] instanceof Array)) {\n\t tmp = expected[i];\n\t expected[i] = [];\n\t expected[i].push(tmp);\n\t }\n\t }\n\t\n\t var col = observed[0].length;\n\t var dof = (col === 1) ? row-1 : (row-1)*(col-1);\n\t var xsqr = 0;\n\t var Pi =Math.PI;\n\t\n\t for (i = 0; i < row; i ++) {\n\t for (j = 0; j < col; j ++) {\n\t xsqr += Math.pow((observed[i][j] - expected[i][j]), 2) / expected[i][j];\n\t }\n\t }\n\t\n\t // Get independency by X square and its degree of freedom\n\t function ChiSq(xsqr, dof) {\n\t var p = Math.exp(-0.5 * xsqr);\n\t if((dof%2) === 1) {\n\t p = p * Math.sqrt(2 * xsqr/Pi);\n\t }\n\t var k = dof;\n\t while(k >= 2) {\n\t p = p * xsqr/k;\n\t k = k - 2;\n\t }\n\t var t = p;\n\t var a = dof;\n\t while (t > 0.0000000001*p) {\n\t a = a + 2;\n\t t = t * xsqr/a;\n\t p = p + t;\n\t }\n\t return 1-p;\n\t }\n\t\n\t return Math.round(ChiSq(xsqr, dof) * 1000000) / 1000000;\n\t};\n\t\n\texports.COLUMN = function(matrix, index) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t if (index < 0) {\n\t return error.num;\n\t }\n\t\n\t if (!(matrix instanceof Array) || (typeof index !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t if (matrix.length === 0) {\n\t return undefined;\n\t }\n\t\n\t return jStat.col(matrix, index);\n\t};\n\t\n\texports.COLUMNS = function(matrix) {\n\t if (arguments.length !== 1) {\n\t return error.na;\n\t }\n\t\n\t if (!(matrix instanceof Array)) {\n\t return error.value;\n\t }\n\t\n\t if (matrix.length === 0) {\n\t return 0;\n\t }\n\t\n\t return jStat.cols(matrix);\n\t};\n\t\n\texports.CONFIDENCE = {};\n\t\n\texports.CONFIDENCE.NORM = function(alpha, sd, n) {\n\t alpha = utils.parseNumber(alpha);\n\t sd = utils.parseNumber(sd);\n\t n = utils.parseNumber(n);\n\t if (utils.anyIsError(alpha, sd, n)) {\n\t return error.value;\n\t }\n\t return jStat.normalci(1, alpha, sd, n)[1] - 1;\n\t};\n\t\n\texports.CONFIDENCE.T = function(alpha, sd, n) {\n\t alpha = utils.parseNumber(alpha);\n\t sd = utils.parseNumber(sd);\n\t n = utils.parseNumber(n);\n\t if (utils.anyIsError(alpha, sd, n)) {\n\t return error.value;\n\t }\n\t return jStat.tci(1, alpha, sd, n)[1] - 1;\n\t};\n\t\n\texports.CORREL = function(array1, array2) {\n\t array1 = utils.parseNumberArray(utils.flatten(array1));\n\t array2 = utils.parseNumberArray(utils.flatten(array2));\n\t if (utils.anyIsError(array1, array2)) {\n\t return error.value;\n\t }\n\t return jStat.corrcoeff(array1, array2);\n\t};\n\t\n\texports.COUNT = function() {\n\t return utils.numbers(utils.flatten(arguments)).length;\n\t};\n\t\n\texports.COUNTA = function() {\n\t var range = utils.flatten(arguments);\n\t return range.length - exports.COUNTBLANK(range);\n\t};\n\t\n\texports.COUNTIN = function (range, value) {\n\t var result = 0;\n\t\n\t range = utils.flatten(range);\n\t\n\t for (var i = 0; i < range.length; i++) {\n\t if (range[i] === value) {\n\t result++;\n\t }\n\t }\n\t return result;\n\t};\n\t\n\t\n\texports.COUNTBLANK = function() {\n\t var range = utils.flatten(arguments);\n\t var blanks = 0;\n\t var element;\n\t for (var i = 0; i < range.length; i++) {\n\t element = range[i];\n\t if (element === null || element === '') {\n\t blanks++;\n\t }\n\t }\n\t return blanks;\n\t};\n\t\n\texports.COUNTIF = function(range, criteria) {\n\t range = utils.flatten(range);\n\t if (!/[<>=!]/.test(criteria)) {\n\t criteria = '==\"' + criteria + '\"';\n\t }\n\t var matches = 0;\n\t for (var i = 0; i < range.length; i++) {\n\t if (typeof range[i] !== 'string') {\n\t if (eval(range[i] + criteria)) { // jshint ignore:line\n\t matches++;\n\t }\n\t } else {\n\t if (eval('\"' + range[i] + '\"' + criteria)) { // jshint ignore:line\n\t matches++;\n\t }\n\t }\n\t }\n\t return matches;\n\t};\n\t\n\texports.COUNTIFS = function() {\n\t var args = utils.argsToArray(arguments);\n\t var results = new Array(utils.flatten(args[0]).length);\n\t for (var i = 0; i < results.length; i++) {\n\t results[i] = true;\n\t }\n\t for (i = 0; i < args.length; i += 2) {\n\t var range = utils.flatten(args[i]);\n\t var criteria = args[i + 1];\n\t if (!/[<>=!]/.test(criteria)) {\n\t criteria = '==\"' + criteria + '\"';\n\t }\n\t for (var j = 0; j < range.length; j++) {\n\t if (typeof range[j] !== 'string') {\n\t results[j] = results[j] && eval(range[j] + criteria); // jshint ignore:line\n\t } else {\n\t results[j] = results[j] && eval('\"' + range[j] + '\"' + criteria); // jshint ignore:line\n\t }\n\t }\n\t }\n\t var result = 0;\n\t for (i = 0; i < results.length; i++) {\n\t if (results[i]) {\n\t result++;\n\t }\n\t }\n\t return result;\n\t};\n\t\n\texports.COUNTUNIQUE = function () {\n\t return misc.UNIQUE.apply(null, utils.flatten(arguments)).length;\n\t};\n\t\n\texports.COVARIANCE = {};\n\t\n\texports.COVARIANCE.P = function(array1, array2) {\n\t array1 = utils.parseNumberArray(utils.flatten(array1));\n\t array2 = utils.parseNumberArray(utils.flatten(array2));\n\t if (utils.anyIsError(array1, array2)) {\n\t return error.value;\n\t }\n\t var mean1 = jStat.mean(array1);\n\t var mean2 = jStat.mean(array2);\n\t var result = 0;\n\t var n = array1.length;\n\t for (var i = 0; i < n; i++) {\n\t result += (array1[i] - mean1) * (array2[i] - mean2);\n\t }\n\t return result / n;\n\t};\n\t\n\texports.COVARIANCE.S = function(array1, array2) {\n\t array1 = utils.parseNumberArray(utils.flatten(array1));\n\t array2 = utils.parseNumberArray(utils.flatten(array2));\n\t if (utils.anyIsError(array1, array2)) {\n\t return error.value;\n\t }\n\t return jStat.covariance(array1, array2);\n\t};\n\t\n\texports.DEVSQ = function() {\n\t var range = utils.parseNumberArray(utils.flatten(arguments));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t var mean = jStat.mean(range);\n\t var result = 0;\n\t for (var i = 0; i < range.length; i++) {\n\t result += Math.pow((range[i] - mean), 2);\n\t }\n\t return result;\n\t};\n\t\n\texports.EXPON = {};\n\t\n\texports.EXPON.DIST = function(x, lambda, cumulative) {\n\t x = utils.parseNumber(x);\n\t lambda = utils.parseNumber(lambda);\n\t if (utils.anyIsError(x, lambda)) {\n\t return error.value;\n\t }\n\t return (cumulative) ? jStat.exponential.cdf(x, lambda) : jStat.exponential.pdf(x, lambda);\n\t};\n\t\n\texports.F = {};\n\t\n\texports.F.DIST = function(x, d1, d2, cumulative) {\n\t x = utils.parseNumber(x);\n\t d1 = utils.parseNumber(d1);\n\t d2 = utils.parseNumber(d2);\n\t if (utils.anyIsError(x, d1, d2)) {\n\t return error.value;\n\t }\n\t return (cumulative) ? jStat.centralF.cdf(x, d1, d2) : jStat.centralF.pdf(x, d1, d2);\n\t};\n\t\n\texports.F.DIST.RT = function(x, d1, d2) {\n\t if (arguments.length !== 3) {\n\t return error.na;\n\t }\n\t\n\t if (x < 0 || d1 < 1 || d2 < 1) {\n\t return error.num;\n\t }\n\t\n\t if ((typeof x !== 'number') || (typeof d1 !== 'number') || (typeof d2 !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t return 1 - jStat.centralF.cdf(x, d1, d2);\n\t};\n\t\n\texports.F.INV = function(probability, d1, d2) {\n\t probability = utils.parseNumber(probability);\n\t d1 = utils.parseNumber(d1);\n\t d2 = utils.parseNumber(d2);\n\t if (utils.anyIsError(probability, d1, d2)) {\n\t return error.value;\n\t }\n\t if (probability <= 0.0 || probability > 1.0) {\n\t return error.num;\n\t }\n\t\n\t return jStat.centralF.inv(probability, d1, d2);\n\t};\n\t\n\texports.F.INV.RT = function(p, d1, d2) {\n\t if (arguments.length !== 3) {\n\t return error.na;\n\t }\n\t\n\t if (p < 0 || p > 1 || d1 < 1 || d1 > Math.pow(10, 10) || d2 < 1 || d2 > Math.pow(10, 10)) {\n\t return error.num;\n\t }\n\t\n\t if ((typeof p !== 'number') || (typeof d1 !== 'number') || (typeof d2 !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t return jStat.centralF.inv(1.0 - p, d1, d2);\n\t};\n\t\n\texports.F.TEST = function(array1, array2) {\n\t if (!array1 || !array2) {\n\t return error.na;\n\t }\n\t\n\t if (!(array1 instanceof Array) || !(array2 instanceof Array)) {\n\t return error.na;\n\t }\n\t\n\t if (array1.length < 2 || array2.length < 2) {\n\t return error.div0;\n\t }\n\t\n\t var sumOfSquares = function(values, x1) {\n\t var sum = 0;\n\t for (var i = 0; i < values.length; i++) {\n\t sum +=Math.pow((values[i] - x1), 2);\n\t }\n\t return sum;\n\t };\n\t\n\t var x1 = mathTrig.SUM(array1) / array1.length;\n\t var x2 = mathTrig.SUM(array2) / array2.length;\n\t var sum1 = sumOfSquares(array1, x1) / (array1.length - 1);\n\t var sum2 = sumOfSquares(array2, x2) / (array2.length - 1);\n\t\n\t return sum1 / sum2;\n\t};\n\t\n\texports.FISHER = function(x) {\n\t x = utils.parseNumber(x);\n\t if (x instanceof Error) {\n\t return x;\n\t }\n\t return Math.log((1 + x) / (1 - x)) / 2;\n\t};\n\t\n\texports.FISHERINV = function(y) {\n\t y = utils.parseNumber(y);\n\t if (y instanceof Error) {\n\t return y;\n\t }\n\t var e2y = Math.exp(2 * y);\n\t return (e2y - 1) / (e2y + 1);\n\t};\n\t\n\texports.FORECAST = function(x, data_y, data_x) {\n\t x = utils.parseNumber(x);\n\t data_y = utils.parseNumberArray(utils.flatten(data_y));\n\t data_x = utils.parseNumberArray(utils.flatten(data_x));\n\t if (utils.anyIsError(x, data_y, data_x)) {\n\t return error.value;\n\t }\n\t var xmean = jStat.mean(data_x);\n\t var ymean = jStat.mean(data_y);\n\t var n = data_x.length;\n\t var num = 0;\n\t var den = 0;\n\t for (var i = 0; i < n; i++) {\n\t num += (data_x[i] - xmean) * (data_y[i] - ymean);\n\t den += Math.pow(data_x[i] - xmean, 2);\n\t }\n\t var b = num / den;\n\t var a = ymean - b * xmean;\n\t return a + b * x;\n\t};\n\t\n\texports.FREQUENCY = function(data, bins) {\n\t data = utils.parseNumberArray(utils.flatten(data));\n\t bins = utils.parseNumberArray(utils.flatten(bins));\n\t if (utils.anyIsError(data, bins)) {\n\t return error.value;\n\t }\n\t var n = data.length;\n\t var b = bins.length;\n\t var r = [];\n\t for (var i = 0; i <= b; i++) {\n\t r[i] = 0;\n\t for (var j = 0; j < n; j++) {\n\t if (i === 0) {\n\t if (data[j] <= bins[0]) {\n\t r[0] += 1;\n\t }\n\t } else if (i < b) {\n\t if (data[j] > bins[i - 1] && data[j] <= bins[i]) {\n\t r[i] += 1;\n\t }\n\t } else if (i === b) {\n\t if (data[j] > bins[b - 1]) {\n\t r[b] += 1;\n\t }\n\t }\n\t }\n\t }\n\t return r;\n\t};\n\t\n\t\n\texports.GAMMA = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t\n\t if (number === 0) {\n\t return error.num;\n\t }\n\t\n\t if (parseInt(number, 10) === number && number < 0) {\n\t return error.num;\n\t }\n\t\n\t return jStat.gammafn(number);\n\t};\n\t\n\texports.GAMMA.DIST = function(value, alpha, beta, cumulative) {\n\t if (arguments.length !== 4) {\n\t return error.na;\n\t }\n\t\n\t if (value < 0 || alpha <= 0 || beta <= 0) {\n\t return error.value;\n\t }\n\t\n\t if ((typeof value !== 'number') || (typeof alpha !== 'number') || (typeof beta !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t return cumulative ? jStat.gamma.cdf(value, alpha, beta, true) : jStat.gamma.pdf(value, alpha, beta, false);\n\t};\n\t\n\texports.GAMMA.INV = function(probability, alpha, beta) {\n\t if (arguments.length !== 3) {\n\t return error.na;\n\t }\n\t\n\t if (probability < 0 || probability > 1 || alpha <= 0 || beta <= 0) {\n\t return error.num;\n\t }\n\t\n\t if ((typeof probability !== 'number') || (typeof alpha !== 'number') || (typeof beta !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t return jStat.gamma.inv(probability, alpha, beta);\n\t};\n\t\n\texports.GAMMALN = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return jStat.gammaln(number);\n\t};\n\t\n\texports.GAMMALN.PRECISE = function(x) {\n\t if (arguments.length !== 1) {\n\t return error.na;\n\t }\n\t\n\t if (x <= 0) {\n\t return error.num;\n\t }\n\t\n\t if (typeof x !== 'number') {\n\t return error.value;\n\t }\n\t\n\t return jStat.gammaln(x);\n\t};\n\t\n\texports.GAUSS = function(z) {\n\t z = utils.parseNumber(z);\n\t if (z instanceof Error) {\n\t return z;\n\t }\n\t return jStat.normal.cdf(z, 0, 1) - 0.5;\n\t};\n\t\n\texports.GEOMEAN = function() {\n\t var args = utils.parseNumberArray(utils.flatten(arguments));\n\t if (args instanceof Error) {\n\t return args;\n\t }\n\t return jStat.geomean(args);\n\t};\n\t\n\texports.GROWTH = function(known_y, known_x, new_x, use_const) {\n\t // Credits: Ilmari Karonen (http://stackoverflow.com/questions/14161990/how-to-implement-growth-function-in-javascript)\n\t\n\t known_y = utils.parseNumberArray(known_y);\n\t if (known_y instanceof Error) {\n\t return known_y;\n\t }\n\t\n\t // Default values for optional parameters:\n\t var i;\n\t if (known_x === undefined) {\n\t known_x = [];\n\t for (i = 1; i <= known_y.length; i++) {\n\t known_x.push(i);\n\t }\n\t }\n\t if (new_x === undefined) {\n\t new_x = [];\n\t for (i = 1; i <= known_y.length; i++) {\n\t new_x.push(i);\n\t }\n\t }\n\t\n\t known_x = utils.parseNumberArray(known_x);\n\t new_x = utils.parseNumberArray(new_x);\n\t if (utils.anyIsError(known_x, new_x)) {\n\t return error.value;\n\t }\n\t\n\t\n\t if (use_const === undefined) {\n\t use_const = true;\n\t }\n\t\n\t // Calculate sums over the data:\n\t var n = known_y.length;\n\t var avg_x = 0;\n\t var avg_y = 0;\n\t var avg_xy = 0;\n\t var avg_xx = 0;\n\t for (i = 0; i < n; i++) {\n\t var x = known_x[i];\n\t var y = Math.log(known_y[i]);\n\t avg_x += x;\n\t avg_y += y;\n\t avg_xy += x * y;\n\t avg_xx += x * x;\n\t }\n\t avg_x /= n;\n\t avg_y /= n;\n\t avg_xy /= n;\n\t avg_xx /= n;\n\t\n\t // Compute linear regression coefficients:\n\t var beta;\n\t var alpha;\n\t if (use_const) {\n\t beta = (avg_xy - avg_x * avg_y) / (avg_xx - avg_x * avg_x);\n\t alpha = avg_y - beta * avg_x;\n\t } else {\n\t beta = avg_xy / avg_xx;\n\t alpha = 0;\n\t }\n\t\n\t // Compute and return result array:\n\t var new_y = [];\n\t for (i = 0; i < new_x.length; i++) {\n\t new_y.push(Math.exp(alpha + beta * new_x[i]));\n\t }\n\t return new_y;\n\t};\n\t\n\texports.HARMEAN = function() {\n\t var range = utils.parseNumberArray(utils.flatten(arguments));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t var n = range.length;\n\t var den = 0;\n\t for (var i = 0; i < n; i++) {\n\t den += 1 / range[i];\n\t }\n\t return n / den;\n\t};\n\t\n\texports.HYPGEOM = {};\n\t\n\texports.HYPGEOM.DIST = function(x, n, M, N, cumulative) {\n\t x = utils.parseNumber(x);\n\t n = utils.parseNumber(n);\n\t M = utils.parseNumber(M);\n\t N = utils.parseNumber(N);\n\t if (utils.anyIsError(x, n, M, N)) {\n\t return error.value;\n\t }\n\t\n\t function pdf(x, n, M, N) {\n\t return mathTrig.COMBIN(M, x) * mathTrig.COMBIN(N - M, n - x) / mathTrig.COMBIN(N, n);\n\t }\n\t\n\t function cdf(x, n, M, N) {\n\t var result = 0;\n\t for (var i = 0; i <= x; i++) {\n\t result += pdf(i, n, M, N);\n\t }\n\t return result;\n\t }\n\t\n\t return (cumulative) ? cdf(x, n, M, N) : pdf(x, n, M, N);\n\t};\n\t\n\texports.INTERCEPT = function(known_y, known_x) {\n\t known_y = utils.parseNumberArray(known_y);\n\t known_x = utils.parseNumberArray(known_x);\n\t if (utils.anyIsError(known_y, known_x)) {\n\t return error.value;\n\t }\n\t if (known_y.length !== known_x.length) {\n\t return error.na;\n\t }\n\t return exports.FORECAST(0, known_y, known_x);\n\t};\n\t\n\texports.KURT = function() {\n\t var range = utils.parseNumberArray(utils.flatten(arguments));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t var mean = jStat.mean(range);\n\t var n = range.length;\n\t var sigma = 0;\n\t for (var i = 0; i < n; i++) {\n\t sigma += Math.pow(range[i] - mean, 4);\n\t }\n\t sigma = sigma / Math.pow(jStat.stdev(range, true), 4);\n\t return ((n * (n + 1)) / ((n - 1) * (n - 2) * (n - 3))) * sigma - 3 * (n - 1) * (n - 1) / ((n - 2) * (n - 3));\n\t};\n\t\n\texports.LARGE = function(range, k) {\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t k = utils.parseNumber(k);\n\t if (utils.anyIsError(range, k)) {\n\t return range;\n\t }\n\t return range.sort(function(a, b) {\n\t return b - a;\n\t })[k - 1];\n\t};\n\t\n\texports.LINEST = function(data_y, data_x) {\n\t data_y = utils.parseNumberArray(utils.flatten(data_y));\n\t data_x = utils.parseNumberArray(utils.flatten(data_x));\n\t if (utils.anyIsError(data_y, data_x)) {\n\t return error.value;\n\t }\n\t var ymean = jStat.mean(data_y);\n\t var xmean = jStat.mean(data_x);\n\t var n = data_x.length;\n\t var num = 0;\n\t var den = 0;\n\t for (var i = 0; i < n; i++) {\n\t num += (data_x[i] - xmean) * (data_y[i] - ymean);\n\t den += Math.pow(data_x[i] - xmean, 2);\n\t }\n\t var m = num / den;\n\t var b = ymean - m * xmean;\n\t return [m, b];\n\t};\n\t\n\t// According to Microsoft:\n\t// http://office.microsoft.com/en-us/starter-help/logest-function-HP010342665.aspx\n\t// LOGEST returns are based on the following linear model:\n\t// ln y = x1 ln m1 + ... + xn ln mn + ln b\n\texports.LOGEST = function(data_y, data_x) {\n\t data_y = utils.parseNumberArray(utils.flatten(data_y));\n\t data_x = utils.parseNumberArray(utils.flatten(data_x));\n\t if (utils.anyIsError(data_y, data_x)) {\n\t return error.value;\n\t }\n\t for (var i = 0; i < data_y.length; i ++) {\n\t data_y[i] = Math.log(data_y[i]);\n\t }\n\t\n\t var result = exports.LINEST(data_y, data_x);\n\t result[0] = Math.round(Math.exp(result[0])*1000000)/1000000;\n\t result[1] = Math.round(Math.exp(result[1])*1000000)/1000000;\n\t return result;\n\t};\n\t\n\texports.LOGNORM = {};\n\t\n\texports.LOGNORM.DIST = function(x, mean, sd, cumulative) {\n\t x = utils.parseNumber(x);\n\t mean = utils.parseNumber(mean);\n\t sd = utils.parseNumber(sd);\n\t if (utils.anyIsError(x, mean, sd)) {\n\t return error.value;\n\t }\n\t return (cumulative) ? jStat.lognormal.cdf(x, mean, sd) : jStat.lognormal.pdf(x, mean, sd);\n\t};\n\t\n\texports.LOGNORM.INV = function(probability, mean, sd) {\n\t probability = utils.parseNumber(probability);\n\t mean = utils.parseNumber(mean);\n\t sd = utils.parseNumber(sd);\n\t if (utils.anyIsError(probability, mean, sd)) {\n\t return error.value;\n\t }\n\t return jStat.lognormal.inv(probability, mean, sd);\n\t};\n\t\n\texports.MAX = function() {\n\t var range = utils.numbers(utils.flatten(arguments));\n\t return (range.length === 0) ? 0 : Math.max.apply(Math, range);\n\t};\n\t\n\texports.MAXA = function() {\n\t var range = utils.arrayValuesToNumbers(utils.flatten(arguments));\n\t return (range.length === 0) ? 0 : Math.max.apply(Math, range);\n\t};\n\t\n\texports.MEDIAN = function() {\n\t var range = utils.arrayValuesToNumbers(utils.flatten(arguments));\n\t var result = jStat.median(range);\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.MIN = function() {\n\t var range = utils.numbers(utils.flatten(arguments));\n\t return (range.length === 0) ? 0 : Math.min.apply(Math, range);\n\t};\n\t\n\texports.MINA = function() {\n\t var range = utils.arrayValuesToNumbers(utils.flatten(arguments));\n\t return (range.length === 0) ? 0 : Math.min.apply(Math, range);\n\t};\n\t\n\texports.MODE = {};\n\t\n\texports.MODE.MULT = function() {\n\t // Credits: Roönaän\n\t var range = utils.parseNumberArray(utils.flatten(arguments));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t var n = range.length;\n\t var count = {};\n\t var maxItems = [];\n\t var max = 0;\n\t var currentItem;\n\t\n\t for (var i = 0; i < n; i++) {\n\t currentItem = range[i];\n\t count[currentItem] = count[currentItem] ? count[currentItem] + 1 : 1;\n\t if (count[currentItem] > max) {\n\t max = count[currentItem];\n\t maxItems = [];\n\t }\n\t if (count[currentItem] === max) {\n\t maxItems[maxItems.length] = currentItem;\n\t }\n\t }\n\t return maxItems;\n\t};\n\t\n\texports.MODE.SNGL = function() {\n\t var range = utils.parseNumberArray(utils.flatten(arguments));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t return exports.MODE.MULT(range).sort(function(a, b) {\n\t return a - b;\n\t })[0];\n\t};\n\t\n\texports.NEGBINOM = {};\n\t\n\texports.NEGBINOM.DIST = function(k, r, p, cumulative) {\n\t k = utils.parseNumber(k);\n\t r = utils.parseNumber(r);\n\t p = utils.parseNumber(p);\n\t if (utils.anyIsError(k, r, p)) {\n\t return error.value;\n\t }\n\t return (cumulative) ? jStat.negbin.cdf(k, r, p) : jStat.negbin.pdf(k, r, p);\n\t};\n\t\n\texports.NORM = {};\n\t\n\texports.NORM.DIST = function(x, mean, sd, cumulative) {\n\t x = utils.parseNumber(x);\n\t mean = utils.parseNumber(mean);\n\t sd = utils.parseNumber(sd);\n\t if (utils.anyIsError(x, mean, sd)) {\n\t return error.value;\n\t }\n\t if (sd <= 0) {\n\t return error.num;\n\t }\n\t\n\t // Return normal distribution computed by jStat [http://jstat.org]\n\t return (cumulative) ? jStat.normal.cdf(x, mean, sd) : jStat.normal.pdf(x, mean, sd);\n\t};\n\t\n\texports.NORM.INV = function(probability, mean, sd) {\n\t probability = utils.parseNumber(probability);\n\t mean = utils.parseNumber(mean);\n\t sd = utils.parseNumber(sd);\n\t if (utils.anyIsError(probability, mean, sd)) {\n\t return error.value;\n\t }\n\t return jStat.normal.inv(probability, mean, sd);\n\t};\n\t\n\texports.NORM.S = {};\n\t\n\texports.NORM.S.DIST = function(z, cumulative) {\n\t z = utils.parseNumber(z);\n\t if (z instanceof Error) {\n\t return error.value;\n\t }\n\t return (cumulative) ? jStat.normal.cdf(z, 0, 1) : jStat.normal.pdf(z, 0, 1);\n\t};\n\t\n\texports.NORM.S.INV = function(probability) {\n\t probability = utils.parseNumber(probability);\n\t if (probability instanceof Error) {\n\t return error.value;\n\t }\n\t return jStat.normal.inv(probability, 0, 1);\n\t};\n\t\n\texports.PEARSON = function(data_x, data_y) {\n\t data_y = utils.parseNumberArray(utils.flatten(data_y));\n\t data_x = utils.parseNumberArray(utils.flatten(data_x));\n\t if (utils.anyIsError(data_y, data_x)) {\n\t return error.value;\n\t }\n\t var xmean = jStat.mean(data_x);\n\t var ymean = jStat.mean(data_y);\n\t var n = data_x.length;\n\t var num = 0;\n\t var den1 = 0;\n\t var den2 = 0;\n\t for (var i = 0; i < n; i++) {\n\t num += (data_x[i] - xmean) * (data_y[i] - ymean);\n\t den1 += Math.pow(data_x[i] - xmean, 2);\n\t den2 += Math.pow(data_y[i] - ymean, 2);\n\t }\n\t return num / Math.sqrt(den1 * den2);\n\t};\n\t\n\texports.PERCENTILE = {};\n\t\n\texports.PERCENTILE.EXC = function(array, k) {\n\t array = utils.parseNumberArray(utils.flatten(array));\n\t k = utils.parseNumber(k);\n\t if (utils.anyIsError(array, k)) {\n\t return error.value;\n\t }\n\t array = array.sort(function(a, b) {\n\t {\n\t return a - b;\n\t }\n\t });\n\t var n = array.length;\n\t if (k < 1 / (n + 1) || k > 1 - 1 / (n + 1)) {\n\t return error.num;\n\t }\n\t var l = k * (n + 1) - 1;\n\t var fl = Math.floor(l);\n\t return utils.cleanFloat((l === fl) ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]));\n\t};\n\t\n\texports.PERCENTILE.INC = function(array, k) {\n\t array = utils.parseNumberArray(utils.flatten(array));\n\t k = utils.parseNumber(k);\n\t if (utils.anyIsError(array, k)) {\n\t return error.value;\n\t }\n\t array = array.sort(function(a, b) {\n\t return a - b;\n\t });\n\t var n = array.length;\n\t var l = k * (n - 1);\n\t var fl = Math.floor(l);\n\t return utils.cleanFloat((l === fl) ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]));\n\t};\n\t\n\texports.PERCENTRANK = {};\n\t\n\texports.PERCENTRANK.EXC = function(array, x, significance) {\n\t significance = (significance === undefined) ? 3 : significance;\n\t array = utils.parseNumberArray(utils.flatten(array));\n\t x = utils.parseNumber(x);\n\t significance = utils.parseNumber(significance);\n\t if (utils.anyIsError(array, x, significance)) {\n\t return error.value;\n\t }\n\t array = array.sort(function(a, b) {\n\t return a - b;\n\t });\n\t var uniques = misc.UNIQUE.apply(null, array);\n\t var n = array.length;\n\t var m = uniques.length;\n\t var power = Math.pow(10, significance);\n\t var result = 0;\n\t var match = false;\n\t var i = 0;\n\t while (!match && i < m) {\n\t if (x === uniques[i]) {\n\t result = (array.indexOf(uniques[i]) + 1) / (n + 1);\n\t match = true;\n\t } else if (x >= uniques[i] && (x < uniques[i + 1] || i === m - 1)) {\n\t result = (array.indexOf(uniques[i]) + 1 + (x - uniques[i]) / (uniques[i + 1] - uniques[i])) / (n + 1);\n\t match = true;\n\t }\n\t i++;\n\t }\n\t return Math.floor(result * power) / power;\n\t};\n\t\n\texports.PERCENTRANK.INC = function(array, x, significance) {\n\t significance = (significance === undefined) ? 3 : significance;\n\t array = utils.parseNumberArray(utils.flatten(array));\n\t x = utils.parseNumber(x);\n\t significance = utils.parseNumber(significance);\n\t if (utils.anyIsError(array, x, significance)) {\n\t return error.value;\n\t }\n\t array = array.sort(function(a, b) {\n\t return a - b;\n\t });\n\t var uniques = misc.UNIQUE.apply(null, array);\n\t var n = array.length;\n\t var m = uniques.length;\n\t var power = Math.pow(10, significance);\n\t var result = 0;\n\t var match = false;\n\t var i = 0;\n\t while (!match && i < m) {\n\t if (x === uniques[i]) {\n\t result = array.indexOf(uniques[i]) / (n - 1);\n\t match = true;\n\t } else if (x >= uniques[i] && (x < uniques[i + 1] || i === m - 1)) {\n\t result = (array.indexOf(uniques[i]) + (x - uniques[i]) / (uniques[i + 1] - uniques[i])) / (n - 1);\n\t match = true;\n\t }\n\t i++;\n\t }\n\t return Math.floor(result * power) / power;\n\t};\n\t\n\texports.PERMUT = function(number, number_chosen) {\n\t number = utils.parseNumber(number);\n\t number_chosen = utils.parseNumber(number_chosen);\n\t if (utils.anyIsError(number, number_chosen)) {\n\t return error.value;\n\t }\n\t return mathTrig.FACT(number) / mathTrig.FACT(number - number_chosen);\n\t};\n\t\n\texports.PERMUTATIONA = function(number, number_chosen) {\n\t number = utils.parseNumber(number);\n\t number_chosen = utils.parseNumber(number_chosen);\n\t if (utils.anyIsError(number, number_chosen)) {\n\t return error.value;\n\t }\n\t return Math.pow(number, number_chosen);\n\t};\n\t\n\texports.PHI = function(x) {\n\t x = utils.parseNumber(x);\n\t if (x instanceof Error) {\n\t return error.value;\n\t }\n\t return Math.exp(-0.5 * x * x) / SQRT2PI;\n\t};\n\t\n\texports.POISSON = {};\n\t\n\texports.POISSON.DIST = function(x, mean, cumulative) {\n\t x = utils.parseNumber(x);\n\t mean = utils.parseNumber(mean);\n\t if (utils.anyIsError(x, mean)) {\n\t return error.value;\n\t }\n\t return (cumulative) ? jStat.poisson.cdf(x, mean) : jStat.poisson.pdf(x, mean);\n\t};\n\t\n\texports.PROB = function(range, probability, lower, upper) {\n\t if (lower === undefined) {\n\t return 0;\n\t }\n\t upper = (upper === undefined) ? lower : upper;\n\t\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t probability = utils.parseNumberArray(utils.flatten(probability));\n\t lower = utils.parseNumber(lower);\n\t upper = utils.parseNumber(upper);\n\t if (utils.anyIsError(range, probability, lower, upper)) {\n\t return error.value;\n\t }\n\t\n\t if (lower === upper) {\n\t return (range.indexOf(lower) >= 0) ? probability[range.indexOf(lower)] : 0;\n\t }\n\t\n\t var sorted = range.sort(function(a, b) {\n\t return a - b;\n\t });\n\t var n = sorted.length;\n\t var result = 0;\n\t for (var i = 0; i < n; i++) {\n\t if (sorted[i] >= lower && sorted[i] <= upper) {\n\t result += probability[range.indexOf(sorted[i])];\n\t }\n\t }\n\t return result;\n\t};\n\t\n\texports.QUARTILE = {};\n\t\n\texports.QUARTILE.EXC = function(range, quart) {\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t quart = utils.parseNumber(quart);\n\t if (utils.anyIsError(range, quart)) {\n\t return error.value;\n\t }\n\t switch (quart) {\n\t case 1:\n\t return exports.PERCENTILE.EXC(range, 0.25);\n\t case 2:\n\t return exports.PERCENTILE.EXC(range, 0.5);\n\t case 3:\n\t return exports.PERCENTILE.EXC(range, 0.75);\n\t default:\n\t return error.num;\n\t }\n\t};\n\t\n\texports.QUARTILE.INC = function(range, quart) {\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t quart = utils.parseNumber(quart);\n\t if (utils.anyIsError(range, quart)) {\n\t return error.value;\n\t }\n\t switch (quart) {\n\t case 1:\n\t return exports.PERCENTILE.INC(range, 0.25);\n\t case 2:\n\t return exports.PERCENTILE.INC(range, 0.5);\n\t case 3:\n\t return exports.PERCENTILE.INC(range, 0.75);\n\t default:\n\t return error.num;\n\t }\n\t};\n\t\n\texports.RANK = {};\n\t\n\texports.RANK.AVG = function(number, range, order) {\n\t number = utils.parseNumber(number);\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t if (utils.anyIsError(number, range)) {\n\t return error.value;\n\t }\n\t range = utils.flatten(range);\n\t order = order || false;\n\t var sort = (order) ? function(a, b) {\n\t return a - b;\n\t } : function(a, b) {\n\t return b - a;\n\t };\n\t range = range.sort(sort);\n\t\n\t var length = range.length;\n\t var count = 0;\n\t for (var i = 0; i < length; i++) {\n\t if (range[i] === number) {\n\t count++;\n\t }\n\t }\n\t\n\t return (count > 1) ? (2 * range.indexOf(number) + count + 1) / 2 : range.indexOf(number) + 1;\n\t};\n\t\n\texports.RANK.EQ = function(number, range, order) {\n\t number = utils.parseNumber(number);\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t if (utils.anyIsError(number, range)) {\n\t return error.value;\n\t }\n\t order = order || false;\n\t var sort = (order) ? function(a, b) {\n\t return a - b;\n\t } : function(a, b) {\n\t return b - a;\n\t };\n\t range = range.sort(sort);\n\t return range.indexOf(number) + 1;\n\t};\n\t\n\texports.ROW = function(matrix, index) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t if (index < 0) {\n\t return error.num;\n\t }\n\t\n\t if (!(matrix instanceof Array) || (typeof index !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t if (matrix.length === 0) {\n\t return undefined;\n\t }\n\t\n\t return jStat.row(matrix, index);\n\t};\n\t\n\texports.ROWS = function(matrix) {\n\t if (arguments.length !== 1) {\n\t return error.na;\n\t }\n\t\n\t if (!(matrix instanceof Array)) {\n\t return error.value;\n\t }\n\t\n\t if (matrix.length === 0) {\n\t return 0;\n\t }\n\t\n\t return jStat.rows(matrix);\n\t};\n\t\n\texports.RSQ = function(data_x, data_y) { // no need to flatten here, PEARSON will take care of that\n\t data_x = utils.parseNumberArray(utils.flatten(data_x));\n\t data_y = utils.parseNumberArray(utils.flatten(data_y));\n\t if (utils.anyIsError(data_x, data_y)) {\n\t return error.value;\n\t }\n\t return Math.pow(exports.PEARSON(data_x, data_y), 2);\n\t};\n\t\n\texports.SKEW = function() {\n\t var range = utils.parseNumberArray(utils.flatten(arguments));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t var mean = jStat.mean(range);\n\t var n = range.length;\n\t var sigma = 0;\n\t for (var i = 0; i < n; i++) {\n\t sigma += Math.pow(range[i] - mean, 3);\n\t }\n\t return n * sigma / ((n - 1) * (n - 2) * Math.pow(jStat.stdev(range, true), 3));\n\t};\n\t\n\texports.SKEW.P = function() {\n\t var range = utils.parseNumberArray(utils.flatten(arguments));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t var mean = jStat.mean(range);\n\t var n = range.length;\n\t var m2 = 0;\n\t var m3 = 0;\n\t for (var i = 0; i < n; i++) {\n\t m3 += Math.pow(range[i] - mean, 3);\n\t m2 += Math.pow(range[i] - mean, 2);\n\t }\n\t m3 = m3 / n;\n\t m2 = m2 / n;\n\t return m3 / Math.pow(m2, 3 / 2);\n\t};\n\t\n\texports.SLOPE = function(data_y, data_x) {\n\t data_y = utils.parseNumberArray(utils.flatten(data_y));\n\t data_x = utils.parseNumberArray(utils.flatten(data_x));\n\t if (utils.anyIsError(data_y, data_x)) {\n\t return error.value;\n\t }\n\t var xmean = jStat.mean(data_x);\n\t var ymean = jStat.mean(data_y);\n\t var n = data_x.length;\n\t var num = 0;\n\t var den = 0;\n\t for (var i = 0; i < n; i++) {\n\t num += (data_x[i] - xmean) * (data_y[i] - ymean);\n\t den += Math.pow(data_x[i] - xmean, 2);\n\t }\n\t return num / den;\n\t};\n\t\n\texports.SMALL = function(range, k) {\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t k = utils.parseNumber(k);\n\t if (utils.anyIsError(range, k)) {\n\t return range;\n\t }\n\t return range.sort(function(a, b) {\n\t return a - b;\n\t })[k - 1];\n\t};\n\t\n\texports.STANDARDIZE = function(x, mean, sd) {\n\t x = utils.parseNumber(x);\n\t mean = utils.parseNumber(mean);\n\t sd = utils.parseNumber(sd);\n\t if (utils.anyIsError(x, mean, sd)) {\n\t return error.value;\n\t }\n\t return (x - mean) / sd;\n\t};\n\t\n\texports.STDEV = {};\n\t\n\texports.STDEV.P = function() {\n\t var v = exports.VAR.P.apply(this, arguments);\n\t var result = Math.sqrt(v);\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.STDEV.S = function() {\n\t var v = exports.VAR.S.apply(this, arguments);\n\t var result = Math.sqrt(v);\n\t\n\t return result;\n\t};\n\t\n\texports.STDEVA = function() {\n\t var v = exports.VARA.apply(this, arguments);\n\t var result = Math.sqrt(v);\n\t\n\t return result;\n\t};\n\t\n\texports.STDEVPA = function() {\n\t var v = exports.VARPA.apply(this, arguments);\n\t var result = Math.sqrt(v);\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\t\n\texports.STEYX = function(data_y, data_x) {\n\t data_y = utils.parseNumberArray(utils.flatten(data_y));\n\t data_x = utils.parseNumberArray(utils.flatten(data_x));\n\t if (utils.anyIsError(data_y, data_x)) {\n\t return error.value;\n\t }\n\t var xmean = jStat.mean(data_x);\n\t var ymean = jStat.mean(data_y);\n\t var n = data_x.length;\n\t var lft = 0;\n\t var num = 0;\n\t var den = 0;\n\t for (var i = 0; i < n; i++) {\n\t lft += Math.pow(data_y[i] - ymean, 2);\n\t num += (data_x[i] - xmean) * (data_y[i] - ymean);\n\t den += Math.pow(data_x[i] - xmean, 2);\n\t }\n\t return Math.sqrt((lft - num * num / den) / (n - 2));\n\t};\n\t\n\texports.TRANSPOSE = function(matrix) {\n\t if (!matrix) {\n\t return error.na;\n\t }\n\t return jStat.transpose(matrix);\n\t};\n\t\n\texports.T = text.T;\n\t\n\texports.T.DIST = function(x, df, cumulative) {\n\t x = utils.parseNumber(x);\n\t df = utils.parseNumber(df);\n\t if (utils.anyIsError(x, df)) {\n\t return error.value;\n\t }\n\t return (cumulative) ? jStat.studentt.cdf(x, df) : jStat.studentt.pdf(x, df);\n\t};\n\t\n\texports.T.DIST['2T'] = function(x, df) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t if (x < 0 || df < 1) {\n\t return error.num;\n\t }\n\t\n\t if ((typeof x !== 'number') || (typeof df !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t return (1 - jStat.studentt.cdf(x , df)) * 2;\n\t};\n\t\n\texports.T.DIST.RT = function(x, df) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t if (x < 0 || df < 1) {\n\t return error.num;\n\t }\n\t\n\t if ((typeof x !== 'number') || (typeof df !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t return 1 - jStat.studentt.cdf(x , df);\n\t};\n\t\n\texports.T.INV = function(probability, df) {\n\t probability = utils.parseNumber(probability);\n\t df = utils.parseNumber(df);\n\t if (utils.anyIsError(probability, df)) {\n\t return error.value;\n\t }\n\t return jStat.studentt.inv(probability, df);\n\t};\n\t\n\texports.T.INV['2T'] = function(probability, df) {\n\t probability = utils.parseNumber(probability);\n\t df = utils.parseNumber(df);\n\t if (probability <= 0 || probability > 1 || df < 1) {\n\t return error.num;\n\t }\n\t if (utils.anyIsError(probability, df)) {\n\t return error.value;\n\t }\n\t return Math.abs(jStat.studentt.inv(probability/2, df));\n\t};\n\t\n\t// The algorithm can be found here:\n\t// http://www.chem.uoa.gr/applets/AppletTtest/Appl_Ttest2.html\n\texports.T.TEST = function(data_x, data_y) {\n\t data_x = utils.parseNumberArray(utils.flatten(data_x));\n\t data_y = utils.parseNumberArray(utils.flatten(data_y));\n\t if (utils.anyIsError(data_x, data_y)) {\n\t return error.value;\n\t }\n\t\n\t var mean_x = jStat.mean(data_x);\n\t var mean_y = jStat.mean(data_y);\n\t var s_x = 0;\n\t var s_y = 0;\n\t var i;\n\t\n\t for (i = 0; i < data_x.length; i++) {\n\t s_x += Math.pow(data_x[i] - mean_x, 2);\n\t }\n\t for (i = 0; i < data_y.length; i++) {\n\t s_y += Math.pow(data_y[i] - mean_y, 2);\n\t }\n\t\n\t s_x = s_x / (data_x.length-1);\n\t s_y = s_y / (data_y.length-1);\n\t\n\t var t = Math.abs(mean_x - mean_y) / Math.sqrt(s_x/data_x.length + s_y/data_y.length);\n\t\n\t return exports.T.DIST['2T'](t, data_x.length+data_y.length-2);\n\t};\n\t\n\texports.TREND = function(data_y, data_x, new_data_x) {\n\t data_y = utils.parseNumberArray(utils.flatten(data_y));\n\t data_x = utils.parseNumberArray(utils.flatten(data_x));\n\t new_data_x = utils.parseNumberArray(utils.flatten(new_data_x));\n\t if (utils.anyIsError(data_y, data_x, new_data_x)) {\n\t return error.value;\n\t }\n\t var linest = exports.LINEST(data_y, data_x);\n\t var m = linest[0];\n\t var b = linest[1];\n\t var result = [];\n\t\n\t new_data_x.forEach(function(x) {\n\t result.push(m * x + b);\n\t });\n\t\n\t return result;\n\t};\n\t\n\texports.TRIMMEAN = function(range, percent) {\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t percent = utils.parseNumber(percent);\n\t if (utils.anyIsError(range, percent)) {\n\t return error.value;\n\t }\n\t var trim = mathTrig.FLOOR(range.length * percent, 2) / 2;\n\t return jStat.mean(utils.initial(utils.rest(range.sort(function(a, b) {\n\t return a - b;\n\t }), trim), trim));\n\t};\n\t\n\texports.VAR = {};\n\t\n\texports.VAR.P = function() {\n\t var range = utils.numbers(utils.flatten(arguments));\n\t var n = range.length;\n\t var sigma = 0;\n\t var mean = exports.AVERAGE(range);\n\t var result;\n\t for (var i = 0; i < n; i++) {\n\t sigma += Math.pow(range[i] - mean, 2);\n\t }\n\t result = sigma / n;\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.VAR.S = function() {\n\t var range = utils.numbers(utils.flatten(arguments));\n\t var n = range.length;\n\t var sigma = 0;\n\t var mean = exports.AVERAGE(range);\n\t for (var i = 0; i < n; i++) {\n\t sigma += Math.pow(range[i] - mean, 2);\n\t }\n\t return sigma / (n - 1);\n\t};\n\t\n\texports.VARA = function() {\n\t var range = utils.flatten(arguments);\n\t var n = range.length;\n\t var sigma = 0;\n\t var count = 0;\n\t var mean = exports.AVERAGEA(range);\n\t for (var i = 0; i < n; i++) {\n\t var el = range[i];\n\t if (typeof el === 'number') {\n\t sigma += Math.pow(el - mean, 2);\n\t } else if (el === true) {\n\t sigma += Math.pow(1 - mean, 2);\n\t } else {\n\t sigma += Math.pow(0 - mean, 2);\n\t }\n\t\n\t if (el !== null) {\n\t count++;\n\t }\n\t }\n\t return sigma / (count - 1);\n\t};\n\t\n\texports.VARPA = function() {\n\t var range = utils.flatten(arguments);\n\t var n = range.length;\n\t var sigma = 0;\n\t var count = 0;\n\t var mean = exports.AVERAGEA(range);\n\t var result;\n\t for (var i = 0; i < n; i++) {\n\t var el = range[i];\n\t if (typeof el === 'number') {\n\t sigma += Math.pow(el - mean, 2);\n\t } else if (el === true) {\n\t sigma += Math.pow(1 - mean, 2);\n\t } else {\n\t sigma += Math.pow(0 - mean, 2);\n\t }\n\t\n\t if (el !== null) {\n\t count++;\n\t }\n\t }\n\t result = sigma / count;;\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.WEIBULL = {};\n\t\n\texports.WEIBULL.DIST = function(x, alpha, beta, cumulative) {\n\t x = utils.parseNumber(x);\n\t alpha = utils.parseNumber(alpha);\n\t beta = utils.parseNumber(beta);\n\t if (utils.anyIsError(x, alpha, beta)) {\n\t return error.value;\n\t }\n\t return (cumulative) ? 1 - Math.exp(-Math.pow(x / beta, alpha)) : Math.pow(x, alpha - 1) * Math.exp(-Math.pow(x / beta, alpha)) * alpha / Math.pow(beta, alpha);\n\t};\n\t\n\texports.Z = {};\n\t\n\texports.Z.TEST = function(range, x, sd) {\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t x = utils.parseNumber(x);\n\t if (utils.anyIsError(range, x)) {\n\t return error.value;\n\t }\n\t\n\t sd = sd || exports.STDEV.S(range);\n\t var n = range.length;\n\t return 1 - exports.NORM.S.DIST((exports.AVERAGE(range) - x) / (sd / Math.sqrt(n)), true);\n\t};\n\n\n/***/ },\n/* 18 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar utils = __webpack_require__(15);\n\tvar error = __webpack_require__(16);\n\tvar numbro = __webpack_require__(19);\n\t\n\t//TODO\n\texports.ASC = function() {\n\t throw new Error('ASC is not implemented');\n\t};\n\t\n\t//TODO\n\texports.BAHTTEXT = function() {\n\t throw new Error('BAHTTEXT is not implemented');\n\t};\n\t\n\texports.CHAR = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return String.fromCharCode(number);\n\t};\n\t\n\texports.CLEAN = function(text) {\n\t text = text || '';\n\t var re = /[\\0-\\x1F]/g;\n\t return text.replace(re, \"\");\n\t};\n\t\n\texports.CODE = function(text) {\n\t text = text || '';\n\t var result = text.charCodeAt(0);\n\t\n\t if (isNaN(result)) {\n\t result = error.na;\n\t }\n\t return result;\n\t};\n\t\n\texports.CONCATENATE = function() {\n\t var args = utils.flatten(arguments);\n\t\n\t var trueFound = 0;\n\t while ((trueFound = args.indexOf(true)) > -1) {\n\t args[trueFound] = 'TRUE';\n\t }\n\t\n\t var falseFound = 0;\n\t while ((falseFound = args.indexOf(false)) > -1) {\n\t args[falseFound] = 'FALSE';\n\t }\n\t\n\t return args.join('');\n\t};\n\t\n\t//TODO\n\texports.DBCS = function() {\n\t throw new Error('DBCS is not implemented');\n\t};\n\t\n\texports.DOLLAR = function(number, decimals) {\n\t decimals = (decimals === undefined) ? 2 : decimals;\n\t\n\t number = utils.parseNumber(number);\n\t decimals = utils.parseNumber(decimals);\n\t if (utils.anyIsError(number, decimals)) {\n\t return error.value;\n\t }\n\t var format = '';\n\t if (decimals <= 0) {\n\t number = Math.round(number * Math.pow(10, decimals)) / Math.pow(10, decimals);\n\t format = '($0,0)';\n\t } else if (decimals > 0) {\n\t format = '($0,0.' + new Array(decimals + 1).join('0') + ')';\n\t }\n\t return numbro(number).format(format);\n\t};\n\t\n\texports.EXACT = function(text1, text2) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t return text1 === text2;\n\t};\n\t\n\texports.FIND = function(find_text, within_text, position) {\n\t if (arguments.length < 2) {\n\t return error.na;\n\t }\n\t position = (position === undefined) ? 0 : position;\n\t return within_text ? within_text.indexOf(find_text, position - 1) + 1 : null;\n\t};\n\t\n\texports.FIXED = function(number, decimals, no_commas) {\n\t decimals = (decimals === undefined) ? 2 : decimals;\n\t no_commas = (no_commas === undefined) ? false : no_commas;\n\t\n\t number = utils.parseNumber(number);\n\t decimals = utils.parseNumber(decimals);\n\t if (utils.anyIsError(number, decimals)) {\n\t return error.value;\n\t }\n\t\n\t var format = no_commas ? '0' : '0,0';\n\t if (decimals <= 0) {\n\t number = Math.round(number * Math.pow(10, decimals)) / Math.pow(10, decimals);\n\t } else if (decimals > 0) {\n\t format += '.' + new Array(decimals + 1).join('0');\n\t }\n\t return numbro(number).format(format);\n\t};\n\t\n\texports.HTML2TEXT = function (value) {\n\t var result = '';\n\t\n\t if (value) {\n\t if (value instanceof Array) {\n\t value.forEach(function (line) {\n\t if (result !== '') {\n\t result += '\\n';\n\t }\n\t result += (line.replace(/<(?:.|\\n)*?>/gm, ''));\n\t });\n\t } else {\n\t result = value.replace(/<(?:.|\\n)*?>/gm, '');\n\t }\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.LEFT = function(text, number) {\n\t number = (number === undefined) ? 1 : number;\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error || typeof text !== 'string') {\n\t return error.value;\n\t }\n\t return text ? text.substring(0, number) : null;\n\t};\n\t\n\texports.LEN = function(text) {\n\t if (arguments.length === 0) {\n\t return error.error;\n\t }\n\t\n\t if (typeof text === 'string') {\n\t return text ? text.length : 0;\n\t }\n\t\n\t if (text.length) {\n\t return text.length;\n\t }\n\t\n\t return error.value;\n\t};\n\t\n\texports.LOWER = function(text) {\n\t if (typeof text !== 'string') {\n\t return error.value;\n\t }\n\t return text ? text.toLowerCase() : text;\n\t};\n\t\n\texports.MID = function(text, start, number) {\n\t start = utils.parseNumber(start);\n\t number = utils.parseNumber(number);\n\t if (utils.anyIsError(start, number) || typeof text !== 'string') {\n\t return number;\n\t }\n\t\n\t var begin = start - 1;\n\t var end = begin + number;\n\t\n\t return text.substring(begin, end);\n\t};\n\t\n\t// TODO\n\texports.NUMBERVALUE = function (text, decimal_separator, group_separator) {\n\t decimal_separator = (typeof decimal_separator === 'undefined') ? '.' : decimal_separator;\n\t group_separator = (typeof group_separator === 'undefined') ? ',' : group_separator;\n\t return Number(text.replace(decimal_separator, '.').replace(group_separator, ''));\n\t};\n\t\n\t// TODO\n\texports.PRONETIC = function() {\n\t throw new Error('PRONETIC is not implemented');\n\t};\n\t\n\texports.PROPER = function(text) {\n\t if (text === undefined || text.length === 0) {\n\t return error.value;\n\t }\n\t if (text === true) {\n\t text = 'TRUE';\n\t }\n\t if (text === false) {\n\t text = 'FALSE';\n\t }\n\t if (isNaN(text) && typeof text === 'number') {\n\t return error.value;\n\t }\n\t if (typeof text === 'number') {\n\t text = '' + text;\n\t }\n\t\n\t return text.replace(/\\w\\S*/g, function(txt) {\n\t return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n\t });\n\t};\n\t\n\texports.REGEXEXTRACT = function (text, regular_expression) {\n\t if (arguments.length < 2) {\n\t return error.na;\n\t }\n\t var match = text.match(new RegExp(regular_expression));\n\t return match ? (match[match.length > 1 ? match.length - 1 : 0]) : null;\n\t};\n\t\n\texports.REGEXMATCH = function (text, regular_expression, full) {\n\t if (arguments.length < 2) {\n\t return error.na;\n\t }\n\t var match = text.match(new RegExp(regular_expression));\n\t return full ? match : !!match;\n\t};\n\t\n\texports.REGEXREPLACE = function (text, regular_expression, replacement) {\n\t if (arguments.length < 3) {\n\t return error.na;\n\t }\n\t return text.replace(new RegExp(regular_expression), replacement);\n\t};\n\t\n\texports.REPLACE = function(text, position, length, new_text) {\n\t position = utils.parseNumber(position);\n\t length = utils.parseNumber(length);\n\t if (utils.anyIsError(position, length) ||\n\t typeof text !== 'string' ||\n\t typeof new_text !== 'string') {\n\t return error.value;\n\t }\n\t return text.substr(0, position - 1) + new_text + text.substr(position - 1 + length);\n\t};\n\t\n\texports.REPT = function(text, number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return new Array(number + 1).join(text);\n\t};\n\t\n\texports.RIGHT = function(text, number) {\n\t number = (number === undefined) ? 1 : number;\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return text ? text.substring(text.length - number) : error.na;\n\t};\n\t\n\texports.SEARCH = function(find_text, within_text, position) {\n\t var foundAt;\n\t if (typeof find_text !== 'string' || typeof within_text !== 'string') {\n\t return error.value;\n\t }\n\t position = (position === undefined) ? 0 : position;\n\t foundAt = within_text.toLowerCase().indexOf(find_text.toLowerCase(), position - 1)+1;\n\t return (foundAt === 0)?error.value:foundAt;\n\t};\n\t\n\texports.SPLIT = function (text, separator) {\n\t return text.split(separator);\n\t};\n\t\n\texports.SUBSTITUTE = function(text, old_text, new_text, occurrence) {\n\t if (arguments.length < 2) {\n\t return error.na;\n\t }\n\t if (!text || !old_text || !new_text) {\n\t return text;\n\t } else if (occurrence === undefined) {\n\t return text.replace(new RegExp(old_text, 'g'), new_text);\n\t } else {\n\t var index = 0;\n\t var i = 0;\n\t while (text.indexOf(old_text, index) > 0) {\n\t index = text.indexOf(old_text, index + 1);\n\t i++;\n\t if (i === occurrence) {\n\t return text.substring(0, index) + new_text + text.substring(index + old_text.length);\n\t }\n\t }\n\t }\n\t};\n\t\n\texports.T = function(value) {\n\t return (typeof value === \"string\") ? value : '';\n\t};\n\t\n\t// TODO incomplete implementation\n\texports.TEXT = function(value, format) {\n\t value = utils.parseNumber(value);\n\t if (utils.anyIsError(value)) {\n\t return error.na;\n\t }\n\t\n\t return numbro(value).format(format);\n\t};\n\t\n\texports.TRIM = function(text) {\n\t if (typeof text !== 'string') {\n\t return error.value;\n\t }\n\t return text.replace(/ +/g, ' ').trim();\n\t};\n\t\n\texports.UNICHAR = exports.CHAR;\n\t\n\texports.UNICODE = exports.CODE;\n\t\n\texports.UPPER = function(text) {\n\t if (typeof text !== 'string') {\n\t return error.value;\n\t }\n\t return text.toUpperCase();\n\t};\n\t\n\texports.VALUE = function(text) {\n\t if (typeof text !== 'string') {\n\t return error.value;\n\t }\n\t var result = numbro().unformat(text);\n\t\n\t return result === void 0 ? 0 : result;\n\t};\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(process) {/*!\n\t * numbro.js\n\t * version : 1.8.0\n\t * author : Företagsplatsen AB\n\t * license : MIT\n\t * http://www.foretagsplatsen.se\n\t */\n\t\n\t(function () {\n\t 'use strict';\n\t\n\t /************************************\n\t Constants\n\t ************************************/\n\t\n\t var numbro,\n\t VERSION = '1.8.0',\n\t binarySuffixes = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'],\n\t decimalSuffixes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],\n\t bytes = {\n\t general: { scale: 1024, suffixes: decimalSuffixes, marker: 'bd' },\n\t binary: { scale: 1024, suffixes: binarySuffixes, marker: 'b' },\n\t decimal: { scale: 1000, suffixes: decimalSuffixes, marker: 'd' }\n\t },\n\t // general must be before the others because it reuses their characters!\n\t byteFormatOrder = [ bytes.general, bytes.binary, bytes.decimal ],\n\t // internal storage for culture config files\n\t cultures = {},\n\t // Todo: Remove in 2.0.0\n\t languages = cultures,\n\t currentCulture = 'en-US',\n\t zeroFormat = null,\n\t defaultFormat = '0,0',\n\t defaultCurrencyFormat = '0$',\n\t // check for nodeJS\n\t hasModule = (typeof module !== 'undefined' && module.exports),\n\t // default culture\n\t enUS = {\n\t delimiters: {\n\t thousands: ',',\n\t decimal: '.'\n\t },\n\t abbreviations: {\n\t thousand: 'k',\n\t million: 'm',\n\t billion: 'b',\n\t trillion: 't'\n\t },\n\t ordinal: function(number) {\n\t var b = number % 10;\n\t return (~~(number % 100 / 10) === 1) ? 'th' :\n\t (b === 1) ? 'st' :\n\t (b === 2) ? 'nd' :\n\t (b === 3) ? 'rd' : 'th';\n\t },\n\t currency: {\n\t symbol: '$',\n\t position: 'prefix'\n\t },\n\t defaults: {\n\t currencyFormat: ',0000 a'\n\t },\n\t formats: {\n\t fourDigits: '0000 a',\n\t fullWithTwoDecimals: '$ ,0.00',\n\t fullWithTwoDecimalsNoCurrency: ',0.00'\n\t }\n\t };\n\t\n\t /************************************\n\t Constructors\n\t ************************************/\n\t\n\t\n\t // Numbro prototype object\n\t function Numbro(number) {\n\t this._value = number;\n\t }\n\t\n\t function zeroes(count) {\n\t var i, ret = '';\n\t\n\t for (i = 0; i < count; i++) {\n\t ret += '0';\n\t }\n\t\n\t return ret;\n\t }\n\t /**\n\t * Implementation of toFixed() for numbers with exponents\n\t * This function may return negative representations for zero values e.g. \"-0.0\"\n\t */\n\t function toFixedLargeSmall(value, precision) {\n\t var mantissa,\n\t beforeDec,\n\t afterDec,\n\t exponent,\n\t prefix,\n\t endStr,\n\t zerosStr,\n\t str;\n\t\n\t str = value.toString();\n\t\n\t mantissa = str.split('e')[0];\n\t exponent = str.split('e')[1];\n\t\n\t beforeDec = mantissa.split('.')[0];\n\t afterDec = mantissa.split('.')[1] || '';\n\t\n\t if (+exponent > 0) {\n\t // exponent is positive - add zeros after the numbers\n\t str = beforeDec + afterDec + zeroes(exponent - afterDec.length);\n\t } else {\n\t // exponent is negative\n\t\n\t if (+beforeDec < 0) {\n\t prefix = '-0';\n\t } else {\n\t prefix = '0';\n\t }\n\t\n\t // tack on the decimal point if needed\n\t if (precision > 0) {\n\t prefix += '.';\n\t }\n\t\n\t zerosStr = zeroes((-1 * exponent) - 1);\n\t // substring off the end to satisfy the precision\n\t endStr = (zerosStr + Math.abs(beforeDec) + afterDec).substr(0, precision);\n\t str = prefix + endStr;\n\t }\n\t\n\t // only add percision 0's if the exponent is positive\n\t if (+exponent > 0 && precision > 0) {\n\t str += '.' + zeroes(precision);\n\t }\n\t\n\t return str;\n\t }\n\t\n\t /**\n\t * Implementation of toFixed() that treats floats more like decimals\n\t *\n\t * Fixes binary rounding issues (eg. (0.615).toFixed(2) === '0.61') that present\n\t * problems for accounting- and finance-related software.\n\t *\n\t * Also removes negative signs for zero-formatted numbers. e.g. -0.01 w/ precision 1 -> 0.0\n\t */\n\t function toFixed(value, precision, roundingFunction, optionals) {\n\t var power = Math.pow(10, precision),\n\t optionalsRegExp,\n\t output;\n\t\n\t if (value.toString().indexOf('e') > -1) {\n\t // toFixed returns scientific notation for numbers above 1e21 and below 1e-7\n\t output = toFixedLargeSmall(value, precision);\n\t // remove the leading negative sign if it exists and should not be present (e.g. -0.00)\n\t if (output.charAt(0) === '-' && +output >= 0) {\n\t output = output.substr(1); // chop off the '-'\n\t }\n\t }\n\t else {\n\t // Multiply up by precision, round accurately, then divide and use native toFixed():\n\t output = (roundingFunction(value + 'e+' + precision) / power).toFixed(precision);\n\t }\n\t\n\t if (optionals) {\n\t optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n\t output = output.replace(optionalsRegExp, '');\n\t }\n\t\n\t return output;\n\t }\n\t\n\t /************************************\n\t Formatting\n\t ************************************/\n\t\n\t // determine what type of formatting we need to do\n\t function formatNumbro(n, format, roundingFunction) {\n\t var output,\n\t escapedFormat = format.replace(/\\{[^\\{\\}]*\\}/g, '');\n\t\n\t // figure out what kind of format we are dealing with\n\t if (escapedFormat.indexOf('$') > -1) { // currency!!!!!\n\t output = formatCurrency(n, format, roundingFunction);\n\t } else if (escapedFormat.indexOf('%') > -1) { // percentage\n\t output = formatPercentage(n, format, roundingFunction);\n\t } else if (escapedFormat.indexOf(':') > -1) { // time\n\t output = formatTime(n, format);\n\t } else { // plain ol' numbers or bytes\n\t output = formatNumber(n._value, format, roundingFunction);\n\t }\n\t\n\t // return string\n\t return output;\n\t }\n\t\n\t // revert to number\n\t function unformatNumbro(n, string) {\n\t var stringOriginal = string,\n\t thousandRegExp,\n\t millionRegExp,\n\t billionRegExp,\n\t trillionRegExp,\n\t bytesMultiplier = false,\n\t power;\n\t\n\t if (string.indexOf(':') > -1) {\n\t n._value = unformatTime(string);\n\t } else {\n\t if (string === zeroFormat) {\n\t n._value = 0;\n\t } else {\n\t if (cultures[currentCulture].delimiters.decimal !== '.') {\n\t string = string.replace(/\\./g, '').replace(cultures[currentCulture].delimiters.decimal, '.');\n\t }\n\t\n\t // see if abbreviations are there so that we can multiply to the correct number\n\t thousandRegExp = new RegExp('[^a-zA-Z]' + cultures[currentCulture].abbreviations.thousand +\n\t '(?:\\\\)|(\\\\' + cultures[currentCulture].currency.symbol + ')?(?:\\\\))?)?$');\n\t millionRegExp = new RegExp('[^a-zA-Z]' + cultures[currentCulture].abbreviations.million +\n\t '(?:\\\\)|(\\\\' + cultures[currentCulture].currency.symbol + ')?(?:\\\\))?)?$');\n\t billionRegExp = new RegExp('[^a-zA-Z]' + cultures[currentCulture].abbreviations.billion +\n\t '(?:\\\\)|(\\\\' + cultures[currentCulture].currency.symbol + ')?(?:\\\\))?)?$');\n\t trillionRegExp = new RegExp('[^a-zA-Z]' + cultures[currentCulture].abbreviations.trillion +\n\t '(?:\\\\)|(\\\\' + cultures[currentCulture].currency.symbol + ')?(?:\\\\))?)?$');\n\t\n\t // see if bytes are there so that we can multiply to the correct number\n\t for (power = 1; power < binarySuffixes.length && !bytesMultiplier; ++power) {\n\t if (string.indexOf(binarySuffixes[power]) > -1) {\n\t bytesMultiplier = Math.pow(1024, power);\n\t } else if (string.indexOf(decimalSuffixes[power]) > -1) {\n\t bytesMultiplier = Math.pow(1000, power);\n\t }\n\t }\n\t\n\t var str = string.replace(/[^0-9\\.]+/g, '');\n\t if (str === '') {\n\t // An empty string is not a number.\n\t n._value = NaN;\n\t\n\t } else {\n\t // do some math to create our number\n\t n._value = ((bytesMultiplier) ? bytesMultiplier : 1) *\n\t ((stringOriginal.match(thousandRegExp)) ? Math.pow(10, 3) : 1) *\n\t ((stringOriginal.match(millionRegExp)) ? Math.pow(10, 6) : 1) *\n\t ((stringOriginal.match(billionRegExp)) ? Math.pow(10, 9) : 1) *\n\t ((stringOriginal.match(trillionRegExp)) ? Math.pow(10, 12) : 1) *\n\t ((string.indexOf('%') > -1) ? 0.01 : 1) *\n\t (((string.split('-').length +\n\t Math.min(string.split('(').length - 1, string.split(')').length - 1)) % 2) ? 1 : -1) *\n\t Number(str);\n\t\n\t // round if we are talking about bytes\n\t n._value = (bytesMultiplier) ? Math.ceil(n._value) : n._value;\n\t }\n\t }\n\t }\n\t return n._value;\n\t }\n\t\n\t function formatCurrency(n, originalFormat, roundingFunction) {\n\t var format = originalFormat,\n\t symbolIndex = format.indexOf('$'),\n\t openParenIndex = format.indexOf('('),\n\t plusSignIndex = format.indexOf('+'),\n\t minusSignIndex = format.indexOf('-'),\n\t space = '',\n\t decimalSeparator = '',\n\t spliceIndex,\n\t output;\n\t\n\t if(format.indexOf('$') === -1){\n\t // Use defaults instead of the format provided\n\t if (cultures[currentCulture].currency.position === 'infix') {\n\t decimalSeparator = cultures[currentCulture].currency.symbol;\n\t if (cultures[currentCulture].currency.spaceSeparated) {\n\t decimalSeparator = ' ' + decimalSeparator + ' ';\n\t }\n\t } else if (cultures[currentCulture].currency.spaceSeparated) {\n\t space = ' ';\n\t }\n\t } else {\n\t // check for space before or after currency\n\t if (format.indexOf(' $') > -1) {\n\t space = ' ';\n\t format = format.replace(' $', '');\n\t } else if (format.indexOf('$ ') > -1) {\n\t space = ' ';\n\t format = format.replace('$ ', '');\n\t } else {\n\t format = format.replace('$', '');\n\t }\n\t }\n\t\n\t // Format The Number\n\t output = formatNumber(n._value, format, roundingFunction, decimalSeparator);\n\t\n\t if (originalFormat.indexOf('$') === -1) {\n\t // Use defaults instead of the format provided\n\t switch (cultures[currentCulture].currency.position) {\n\t case 'postfix':\n\t if (output.indexOf(')') > -1) {\n\t output = output.split('');\n\t output.splice(-1, 0, space + cultures[currentCulture].currency.symbol);\n\t output = output.join('');\n\t } else {\n\t output = output + space + cultures[currentCulture].currency.symbol;\n\t }\n\t break;\n\t case 'infix':\n\t break;\n\t case 'prefix':\n\t if (output.indexOf('(') > -1 || output.indexOf('-') > -1) {\n\t output = output.split('');\n\t spliceIndex = Math.max(openParenIndex, minusSignIndex) + 1;\n\t\n\t output.splice(spliceIndex, 0, cultures[currentCulture].currency.symbol + space);\n\t output = output.join('');\n\t } else {\n\t output = cultures[currentCulture].currency.symbol + space + output;\n\t }\n\t break;\n\t default:\n\t throw Error('Currency position should be among [\"prefix\", \"infix\", \"postfix\"]');\n\t }\n\t } else {\n\t // position the symbol\n\t if (symbolIndex <= 1) {\n\t if (output.indexOf('(') > -1 || output.indexOf('+') > -1 || output.indexOf('-') > -1) {\n\t output = output.split('');\n\t spliceIndex = 1;\n\t if (symbolIndex < openParenIndex || symbolIndex < plusSignIndex || symbolIndex < minusSignIndex) {\n\t // the symbol appears before the \"(\", \"+\" or \"-\"\n\t spliceIndex = 0;\n\t }\n\t output.splice(spliceIndex, 0, cultures[currentCulture].currency.symbol + space);\n\t output = output.join('');\n\t } else {\n\t output = cultures[currentCulture].currency.symbol + space + output;\n\t }\n\t } else {\n\t if (output.indexOf(')') > -1) {\n\t output = output.split('');\n\t output.splice(-1, 0, space + cultures[currentCulture].currency.symbol);\n\t output = output.join('');\n\t } else {\n\t output = output + space + cultures[currentCulture].currency.symbol;\n\t }\n\t }\n\t }\n\t\n\t return output;\n\t }\n\t\n\t function formatPercentage(n, format, roundingFunction) {\n\t var space = '',\n\t output,\n\t value = n._value * 100;\n\t\n\t // check for space before %\n\t if (format.indexOf(' %') > -1) {\n\t space = ' ';\n\t format = format.replace(' %', '');\n\t } else {\n\t format = format.replace('%', '');\n\t }\n\t\n\t output = formatNumber(value, format, roundingFunction);\n\t\n\t if (output.indexOf(')') > -1) {\n\t output = output.split('');\n\t output.splice(-1, 0, space + '%');\n\t output = output.join('');\n\t } else {\n\t output = output + space + '%';\n\t }\n\t\n\t return output;\n\t }\n\t\n\t function formatTime(n) {\n\t var hours = Math.floor(n._value / 60 / 60),\n\t minutes = Math.floor((n._value - (hours * 60 * 60)) / 60),\n\t seconds = Math.round(n._value - (hours * 60 * 60) - (minutes * 60));\n\t return hours + ':' +\n\t ((minutes < 10) ? '0' + minutes : minutes) + ':' +\n\t ((seconds < 10) ? '0' + seconds : seconds);\n\t }\n\t\n\t function unformatTime(string) {\n\t var timeArray = string.split(':'),\n\t seconds = 0;\n\t // turn hours and minutes into seconds and add them all up\n\t if (timeArray.length === 3) {\n\t // hours\n\t seconds = seconds + (Number(timeArray[0]) * 60 * 60);\n\t // minutes\n\t seconds = seconds + (Number(timeArray[1]) * 60);\n\t // seconds\n\t seconds = seconds + Number(timeArray[2]);\n\t } else if (timeArray.length === 2) {\n\t // minutes\n\t seconds = seconds + (Number(timeArray[0]) * 60);\n\t // seconds\n\t seconds = seconds + Number(timeArray[1]);\n\t }\n\t return Number(seconds);\n\t }\n\t\n\t function formatByteUnits (value, suffixes, scale) {\n\t var suffix = suffixes[0],\n\t power,\n\t min,\n\t max,\n\t abs = Math.abs(value);\n\t\n\t if (abs >= scale) {\n\t for (power = 1; power < suffixes.length; ++power) {\n\t min = Math.pow(scale, power);\n\t max = Math.pow(scale, power + 1);\n\t\n\t if (abs >= min && abs < max) {\n\t suffix = suffixes[power];\n\t value = value / min;\n\t break;\n\t }\n\t }\n\t\n\t // values greater than or equal to [scale] YB never set the suffix\n\t if (suffix === suffixes[0]) {\n\t value = value / Math.pow(scale, suffixes.length - 1);\n\t suffix = suffixes[suffixes.length - 1];\n\t }\n\t }\n\t\n\t return { value: value, suffix: suffix };\n\t }\n\t\n\t function formatNumber (value, format, roundingFunction, sep) {\n\t var negP = false,\n\t signed = false,\n\t optDec = false,\n\t abbr = '',\n\t abbrK = false, // force abbreviation to thousands\n\t abbrM = false, // force abbreviation to millions\n\t abbrB = false, // force abbreviation to billions\n\t abbrT = false, // force abbreviation to trillions\n\t abbrForce = false, // force abbreviation\n\t bytes = '',\n\t byteFormat,\n\t units,\n\t ord = '',\n\t abs = Math.abs(value),\n\t totalLength,\n\t length,\n\t minimumPrecision,\n\t pow,\n\t w,\n\t intPrecision,\n\t precision,\n\t prefix,\n\t postfix,\n\t thousands,\n\t d = '',\n\t forcedNeg = false,\n\t neg = false,\n\t indexOpenP,\n\t size,\n\t indexMinus,\n\t paren = '',\n\t minlen,\n\t i;\n\t\n\t // check if number is zero and a custom zero format has been set\n\t if (value === 0 && zeroFormat !== null) {\n\t return zeroFormat;\n\t }\n\t\n\t if (!isFinite(value)) {\n\t return '' + value;\n\t }\n\t\n\t if (format.indexOf('{') === 0) {\n\t var end = format.indexOf('}');\n\t if (end === -1) {\n\t throw Error('Format should also contain a \"}\"');\n\t }\n\t prefix = format.slice(1, end);\n\t format = format.slice(end + 1);\n\t } else {\n\t prefix = '';\n\t }\n\t\n\t if (format.indexOf('}') === format.length - 1) {\n\t var start = format.indexOf('{');\n\t if (start === -1) {\n\t throw Error('Format should also contain a \"{\"');\n\t }\n\t postfix = format.slice(start + 1, -1);\n\t format = format.slice(0, start + 1);\n\t } else {\n\t postfix = '';\n\t }\n\t\n\t // check for min length\n\t var info;\n\t if (format.indexOf('.') === -1) {\n\t info = format.match(/([0-9]+).*/);\n\t } else {\n\t info = format.match(/([0-9]+)\\..*/);\n\t }\n\t minlen = info === null ? -1 : info[1].length;\n\t\n\t // see if we should use parentheses for negative number or if we should prefix with a sign\n\t // if both are present we default to parentheses\n\t if (format.indexOf('-') !== -1) {\n\t forcedNeg = true;\n\t }\n\t if (format.indexOf('(') > -1) {\n\t negP = true;\n\t format = format.slice(1, -1);\n\t } else if (format.indexOf('+') > -1) {\n\t signed = true;\n\t format = format.replace(/\\+/g, '');\n\t }\n\t\n\t // see if abbreviation is wanted\n\t if (format.indexOf('a') > -1) {\n\t intPrecision = format.split('.')[0].match(/[0-9]+/g) || ['0'];\n\t intPrecision = parseInt(intPrecision[0], 10);\n\t\n\t // check if abbreviation is specified\n\t abbrK = format.indexOf('aK') >= 0;\n\t abbrM = format.indexOf('aM') >= 0;\n\t abbrB = format.indexOf('aB') >= 0;\n\t abbrT = format.indexOf('aT') >= 0;\n\t abbrForce = abbrK || abbrM || abbrB || abbrT;\n\t\n\t // check for space before abbreviation\n\t if (format.indexOf(' a') > -1) {\n\t abbr = ' ';\n\t format = format.replace(' a', '');\n\t } else {\n\t format = format.replace('a', '');\n\t }\n\t\n\t totalLength = Math.floor(Math.log(abs) / Math.LN10) + 1;\n\t\n\t minimumPrecision = totalLength % 3;\n\t minimumPrecision = minimumPrecision === 0 ? 3 : minimumPrecision;\n\t\n\t if (intPrecision && abs !== 0) {\n\t\n\t length = Math.floor(Math.log(abs) / Math.LN10) + 1 - intPrecision;\n\t\n\t pow = 3 * ~~((Math.min(intPrecision, totalLength) - minimumPrecision) / 3);\n\t\n\t abs = abs / Math.pow(10, pow);\n\t\n\t if (format.indexOf('.') === -1 && intPrecision > 3) {\n\t format += '[.]';\n\t\n\t size = length === 0 ? 0 : 3 * ~~(length / 3) - length;\n\t size = size < 0 ? size + 3 : size;\n\t\n\t format += zeroes(size);\n\t }\n\t }\n\t\n\t if (Math.floor(Math.log(Math.abs(value)) / Math.LN10) + 1 !== intPrecision) {\n\t if (abs >= Math.pow(10, 12) && !abbrForce || abbrT) {\n\t // trillion\n\t abbr = abbr + cultures[currentCulture].abbreviations.trillion;\n\t value = value / Math.pow(10, 12);\n\t } else if (abs < Math.pow(10, 12) && abs >= Math.pow(10, 9) && !abbrForce || abbrB) {\n\t // billion\n\t abbr = abbr + cultures[currentCulture].abbreviations.billion;\n\t value = value / Math.pow(10, 9);\n\t } else if (abs < Math.pow(10, 9) && abs >= Math.pow(10, 6) && !abbrForce || abbrM) {\n\t // million\n\t abbr = abbr + cultures[currentCulture].abbreviations.million;\n\t value = value / Math.pow(10, 6);\n\t } else if (abs < Math.pow(10, 6) && abs >= Math.pow(10, 3) && !abbrForce || abbrK) {\n\t // thousand\n\t abbr = abbr + cultures[currentCulture].abbreviations.thousand;\n\t value = value / Math.pow(10, 3);\n\t }\n\t }\n\t }\n\t\n\t // see if we are formatting\n\t // binary-decimal bytes (1024 MB), binary bytes (1024 MiB), or decimal bytes (1000 MB)\n\t for (i = 0; i < byteFormatOrder.length; ++i) {\n\t byteFormat = byteFormatOrder[i];\n\t\n\t if (format.indexOf(byteFormat.marker) > -1) {\n\t // check for space before\n\t if (format.indexOf(' ' + byteFormat.marker) >-1) {\n\t bytes = ' ';\n\t }\n\t\n\t // remove the marker (with the space if it had one)\n\t format = format.replace(bytes + byteFormat.marker, '');\n\t\n\t units = formatByteUnits(value, byteFormat.suffixes, byteFormat.scale);\n\t\n\t value = units.value;\n\t bytes = bytes + units.suffix;\n\t\n\t break;\n\t }\n\t }\n\t\n\t // see if ordinal is wanted\n\t if (format.indexOf('o') > -1) {\n\t // check for space before\n\t if (format.indexOf(' o') > -1) {\n\t ord = ' ';\n\t format = format.replace(' o', '');\n\t } else {\n\t format = format.replace('o', '');\n\t }\n\t\n\t if (cultures[currentCulture].ordinal) {\n\t ord = ord + cultures[currentCulture].ordinal(value);\n\t }\n\t }\n\t\n\t if (format.indexOf('[.]') > -1) {\n\t optDec = true;\n\t format = format.replace('[.]', '.');\n\t }\n\t\n\t w = value.toString().split('.')[0];\n\t precision = format.split('.')[1];\n\t thousands = format.indexOf(',');\n\t\n\t if (precision) {\n\t if (precision.indexOf('*') !== -1) {\n\t d = toFixed(value, value.toString().split('.')[1].length, roundingFunction);\n\t } else {\n\t if (precision.indexOf('[') > -1) {\n\t precision = precision.replace(']', '');\n\t precision = precision.split('[');\n\t d = toFixed(value, (precision[0].length + precision[1].length), roundingFunction,\n\t precision[1].length);\n\t } else {\n\t d = toFixed(value, precision.length, roundingFunction);\n\t }\n\t }\n\t\n\t w = d.split('.')[0];\n\t\n\t if (d.split('.')[1].length) {\n\t var p = sep ? abbr + sep : cultures[currentCulture].delimiters.decimal;\n\t d = p + d.split('.')[1];\n\t } else {\n\t d = '';\n\t }\n\t\n\t if (optDec && Number(d.slice(1)) === 0) {\n\t d = '';\n\t }\n\t } else {\n\t w = toFixed(value, 0, roundingFunction);\n\t }\n\t\n\t // format number\n\t if (w.indexOf('-') > -1) {\n\t w = w.slice(1);\n\t neg = true;\n\t }\n\t\n\t if (w.length < minlen) {\n\t w = zeroes(minlen - w.length) + w;\n\t }\n\t\n\t if (thousands > -1) {\n\t w = w.toString().replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, '$1' +\n\t cultures[currentCulture].delimiters.thousands);\n\t }\n\t\n\t if (format.indexOf('.') === 0) {\n\t w = '';\n\t }\n\t\n\t indexOpenP = format.indexOf('(');\n\t indexMinus = format.indexOf('-');\n\t\n\t if (indexOpenP < indexMinus) {\n\t paren = ((negP && neg) ? '(' : '') + (((forcedNeg && neg) || (!negP && neg)) ? '-' : '');\n\t } else {\n\t paren = (((forcedNeg && neg) || (!negP && neg)) ? '-' : '') + ((negP && neg) ? '(' : '');\n\t }\n\t\n\t return prefix +\n\t paren + ((!neg && signed && value !== 0) ? '+' : '') +\n\t w + d +\n\t ((ord) ? ord : '') +\n\t ((abbr && !sep) ? abbr : '') +\n\t ((bytes) ? bytes : '') +\n\t ((negP && neg) ? ')' : '') +\n\t postfix;\n\t }\n\t\n\t /************************************\n\t Top Level Functions\n\t ************************************/\n\t\n\t numbro = function(input) {\n\t if (numbro.isNumbro(input)) {\n\t input = input.value();\n\t } else if (input === 0 || typeof input === 'undefined') {\n\t input = 0;\n\t } else if (!Number(input)) {\n\t input = numbro.fn.unformat(input);\n\t }\n\t\n\t return new Numbro(Number(input));\n\t };\n\t\n\t // version number\n\t numbro.version = VERSION;\n\t\n\t // compare numbro object\n\t numbro.isNumbro = function(obj) {\n\t return obj instanceof Numbro;\n\t };\n\t\n\t /**\n\t * This function allow the user to set a new language with a fallback if\n\t * the language does not exist. If no fallback language is provided,\n\t * it fallbacks to english.\n\t *\n\t * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n\t * `setCulture` should be used instead.\n\t */\n\t numbro.setLanguage = function(newLanguage, fallbackLanguage) {\n\t console.warn('`setLanguage` is deprecated since version 1.6.0. Use `setCulture` instead');\n\t var key = newLanguage,\n\t prefix = newLanguage.split('-')[0],\n\t matchingLanguage = null;\n\t if (!languages[key]) {\n\t Object.keys(languages).forEach(function(language) {\n\t if (!matchingLanguage && language.split('-')[0] === prefix) {\n\t matchingLanguage = language;\n\t }\n\t });\n\t key = matchingLanguage || fallbackLanguage || 'en-US';\n\t }\n\t chooseCulture(key);\n\t };\n\t\n\t /**\n\t * This function allow the user to set a new culture with a fallback if\n\t * the culture does not exist. If no fallback culture is provided,\n\t * it falls back to \"en-US\".\n\t */\n\t numbro.setCulture = function(newCulture, fallbackCulture) {\n\t var key = newCulture,\n\t suffix = newCulture.split('-')[1],\n\t matchingCulture = null;\n\t if (!cultures[key]) {\n\t if (suffix) {\n\t Object.keys(cultures).forEach(function(language) {\n\t if (!matchingCulture && language.split('-')[1] === suffix) {\n\t matchingCulture = language;\n\t }\n\t });\n\t }\n\t\n\t key = matchingCulture || fallbackCulture || 'en-US';\n\t }\n\t chooseCulture(key);\n\t };\n\t\n\t /**\n\t * This function will load languages and then set the global language. If\n\t * no arguments are passed in, it will simply return the current global\n\t * language key.\n\t *\n\t * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n\t * `culture` should be used instead.\n\t */\n\t numbro.language = function(key, values) {\n\t console.warn('`language` is deprecated since version 1.6.0. Use `culture` instead');\n\t\n\t if (!key) {\n\t return currentCulture;\n\t }\n\t\n\t if (key && !values) {\n\t if (!languages[key]) {\n\t throw new Error('Unknown language : ' + key);\n\t }\n\t chooseCulture(key);\n\t }\n\t\n\t if (values || !languages[key]) {\n\t setCulture(key, values);\n\t }\n\t\n\t return numbro;\n\t };\n\t\n\t /**\n\t * This function will load cultures and then set the global culture. If\n\t * no arguments are passed in, it will simply return the current global\n\t * culture code.\n\t */\n\t numbro.culture = function(code, values) {\n\t if (!code) {\n\t return currentCulture;\n\t }\n\t\n\t if (code && !values) {\n\t if (!cultures[code]) {\n\t throw new Error('Unknown culture : ' + code);\n\t }\n\t chooseCulture(code);\n\t }\n\t\n\t if (values || !cultures[code]) {\n\t setCulture(code, values);\n\t }\n\t\n\t return numbro;\n\t };\n\t\n\t /**\n\t * This function provides access to the loaded language data. If\n\t * no arguments are passed in, it will simply return the current\n\t * global language object.\n\t *\n\t * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n\t * `culture` should be used instead.\n\t */\n\t numbro.languageData = function(key) {\n\t console.warn('`languageData` is deprecated since version 1.6.0. Use `cultureData` instead');\n\t\n\t if (!key) {\n\t return languages[currentCulture];\n\t }\n\t\n\t if (!languages[key]) {\n\t throw new Error('Unknown language : ' + key);\n\t }\n\t\n\t return languages[key];\n\t };\n\t\n\t /**\n\t * This function provides access to the loaded culture data. If\n\t * no arguments are passed in, it will simply return the current\n\t * global culture object.\n\t */\n\t numbro.cultureData = function(code) {\n\t if (!code) {\n\t return cultures[currentCulture];\n\t }\n\t\n\t if (!cultures[code]) {\n\t throw new Error('Unknown culture : ' + code);\n\t }\n\t\n\t return cultures[code];\n\t };\n\t\n\t numbro.culture('en-US', enUS);\n\t\n\t /**\n\t * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n\t * `cultures` should be used instead.\n\t */\n\t numbro.languages = function() {\n\t console.warn('`languages` is deprecated since version 1.6.0. Use `cultures` instead');\n\t\n\t return languages;\n\t };\n\t\n\t numbro.cultures = function() {\n\t return cultures;\n\t };\n\t\n\t numbro.zeroFormat = function(format) {\n\t zeroFormat = typeof(format) === 'string' ? format : null;\n\t };\n\t\n\t numbro.defaultFormat = function(format) {\n\t defaultFormat = typeof(format) === 'string' ? format : '0.0';\n\t };\n\t\n\t numbro.defaultCurrencyFormat = function (format) {\n\t defaultCurrencyFormat = typeof(format) === 'string' ? format : '0$';\n\t };\n\t\n\t numbro.validate = function(val, culture) {\n\t\n\t var _decimalSep,\n\t _thousandSep,\n\t _currSymbol,\n\t _valArray,\n\t _abbrObj,\n\t _thousandRegEx,\n\t cultureData,\n\t temp;\n\t\n\t //coerce val to string\n\t if (typeof val !== 'string') {\n\t val += '';\n\t if (console.warn) {\n\t console.warn('Numbro.js: Value is not string. It has been co-erced to: ', val);\n\t }\n\t }\n\t\n\t //trim whitespaces from either sides\n\t val = val.trim();\n\t\n\t //if val is just digits return true\n\t if ( !! val.match(/^\\d+$/)) {\n\t return true;\n\t }\n\t\n\t //if val is empty return false\n\t if (val === '') {\n\t return false;\n\t }\n\t\n\t //get the decimal and thousands separator from numbro.cultureData\n\t try {\n\t //check if the culture is understood by numbro. if not, default it to current culture\n\t cultureData = numbro.cultureData(culture);\n\t } catch (e) {\n\t cultureData = numbro.cultureData(numbro.culture());\n\t }\n\t\n\t //setup the delimiters and currency symbol based on culture\n\t _currSymbol = cultureData.currency.symbol;\n\t _abbrObj = cultureData.abbreviations;\n\t _decimalSep = cultureData.delimiters.decimal;\n\t if (cultureData.delimiters.thousands === '.') {\n\t _thousandSep = '\\\\.';\n\t } else {\n\t _thousandSep = cultureData.delimiters.thousands;\n\t }\n\t\n\t // validating currency symbol\n\t temp = val.match(/^[^\\d]+/);\n\t if (temp !== null) {\n\t val = val.substr(1);\n\t if (temp[0] !== _currSymbol) {\n\t return false;\n\t }\n\t }\n\t\n\t //validating abbreviation symbol\n\t temp = val.match(/[^\\d]+$/);\n\t if (temp !== null) {\n\t val = val.slice(0, -1);\n\t if (temp[0] !== _abbrObj.thousand && temp[0] !== _abbrObj.million &&\n\t temp[0] !== _abbrObj.billion && temp[0] !== _abbrObj.trillion) {\n\t return false;\n\t }\n\t }\n\t\n\t _thousandRegEx = new RegExp(_thousandSep + '{2}');\n\t\n\t if (!val.match(/[^\\d.,]/g)) {\n\t _valArray = val.split(_decimalSep);\n\t if (_valArray.length > 2) {\n\t return false;\n\t } else {\n\t if (_valArray.length < 2) {\n\t return ( !! _valArray[0].match(/^\\d+.*\\d$/) && !_valArray[0].match(_thousandRegEx));\n\t } else {\n\t if (_valArray[0].length === 1) {\n\t return ( !! _valArray[0].match(/^\\d+$/) &&\n\t !_valArray[0].match(_thousandRegEx) &&\n\t !! _valArray[1].match(/^\\d+$/));\n\t } else {\n\t return ( !! _valArray[0].match(/^\\d+.*\\d$/) &&\n\t !_valArray[0].match(_thousandRegEx) &&\n\t !! _valArray[1].match(/^\\d+$/));\n\t }\n\t }\n\t }\n\t }\n\t\n\t return false;\n\t };\n\t\n\t /**\n\t * * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n\t * `loadCulturesInNode` should be used instead.\n\t */\n\t numbro.loadLanguagesInNode = function() {\n\t console.warn('`loadLanguagesInNode` is deprecated since version 1.6.0. Use `loadCulturesInNode` instead');\n\t\n\t numbro.loadCulturesInNode();\n\t };\n\t\n\t numbro.loadCulturesInNode = function() {\n\t // TODO: Rename the folder in 2.0.0\n\t var cultures = __webpack_require__(21);\n\t\n\t for(var langLocaleCode in cultures) {\n\t if(langLocaleCode) {\n\t numbro.culture(langLocaleCode, cultures[langLocaleCode]);\n\t }\n\t }\n\t };\n\t\n\t /************************************\n\t Helpers\n\t ************************************/\n\t\n\t function setCulture(code, values) {\n\t cultures[code] = values;\n\t }\n\t\n\t function chooseCulture(code) {\n\t currentCulture = code;\n\t var defaults = cultures[code].defaults;\n\t if (defaults && defaults.format) {\n\t numbro.defaultFormat(defaults.format);\n\t }\n\t if (defaults && defaults.currencyFormat) {\n\t numbro.defaultCurrencyFormat(defaults.currencyFormat);\n\t }\n\t }\n\t\n\t function inNodejsRuntime() {\n\t return (typeof process !== 'undefined') &&\n\t (process.browser === undefined) &&\n\t (process.title.indexOf('node') === 0 || process.title === 'grunt' || process.title === 'gulp') &&\n\t (\"function\" !== 'undefined');\n\t }\n\t\n\t /************************************\n\t Floating-point helpers\n\t ************************************/\n\t\n\t // The floating-point helper functions and implementation\n\t // borrows heavily from sinful.js: http://guipn.github.io/sinful.js/\n\t\n\t /**\n\t * Array.prototype.reduce for browsers that don't support it\n\t * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce#Compatibility\n\t */\n\t if ('function' !== typeof Array.prototype.reduce) {\n\t Array.prototype.reduce = function(callback, optInitialValue) {\n\t\n\t if (null === this || 'undefined' === typeof this) {\n\t // At the moment all modern browsers, that support strict mode, have\n\t // native implementation of Array.prototype.reduce. For instance, IE8\n\t // does not support strict mode, so this check is actually useless.\n\t throw new TypeError('Array.prototype.reduce called on null or undefined');\n\t }\n\t\n\t if ('function' !== typeof callback) {\n\t throw new TypeError(callback + ' is not a function');\n\t }\n\t\n\t var index,\n\t value,\n\t length = this.length >>> 0,\n\t isValueSet = false;\n\t\n\t if (1 < arguments.length) {\n\t value = optInitialValue;\n\t isValueSet = true;\n\t }\n\t\n\t for (index = 0; length > index; ++index) {\n\t if (this.hasOwnProperty(index)) {\n\t if (isValueSet) {\n\t value = callback(value, this[index], index, this);\n\t } else {\n\t value = this[index];\n\t isValueSet = true;\n\t }\n\t }\n\t }\n\t\n\t if (!isValueSet) {\n\t throw new TypeError('Reduce of empty array with no initial value');\n\t }\n\t\n\t return value;\n\t };\n\t }\n\t\n\t\n\t /**\n\t * Computes the multiplier necessary to make x >= 1,\n\t * effectively eliminating miscalculations caused by\n\t * finite precision.\n\t */\n\t function multiplier(x) {\n\t var parts = x.toString().split('.');\n\t if (parts.length < 2) {\n\t return 1;\n\t }\n\t return Math.pow(10, parts[1].length);\n\t }\n\t\n\t /**\n\t * Given a variable number of arguments, returns the maximum\n\t * multiplier that must be used to normalize an operation involving\n\t * all of them.\n\t */\n\t function correctionFactor() {\n\t var args = Array.prototype.slice.call(arguments);\n\t return args.reduce(function(prev, next) {\n\t var mp = multiplier(prev),\n\t mn = multiplier(next);\n\t return mp > mn ? mp : mn;\n\t }, -Infinity);\n\t }\n\t\n\t /************************************\n\t Numbro Prototype\n\t ************************************/\n\t\n\t\n\t numbro.fn = Numbro.prototype = {\n\t\n\t clone: function() {\n\t return numbro(this);\n\t },\n\t\n\t format: function(inputString, roundingFunction) {\n\t return formatNumbro(this,\n\t inputString ? inputString : defaultFormat,\n\t (roundingFunction !== undefined) ? roundingFunction : Math.round\n\t );\n\t },\n\t\n\t formatCurrency: function(inputString, roundingFunction) {\n\t return formatCurrency(this,\n\t inputString ? inputString : defaultCurrencyFormat,\n\t (roundingFunction !== undefined) ? roundingFunction : Math.round\n\t );\n\t },\n\t\n\t unformat: function(inputString) {\n\t if (typeof inputString === 'number') {\n\t return inputString;\n\t } else if (typeof inputString === 'string') {\n\t var result = unformatNumbro(this, inputString);\n\t\n\t // Any unparseable string (represented as NaN in the result) is\n\t // converted into undefined.\n\t return isNaN(result) ? undefined : result;\n\t } else {\n\t return undefined;\n\t }\n\t },\n\t\n\t binaryByteUnits: function() {\n\t return formatByteUnits(this._value, bytes.binary.suffixes, bytes.binary.scale).suffix;\n\t },\n\t\n\t byteUnits: function() {\n\t return formatByteUnits(this._value, bytes.general.suffixes, bytes.general.scale).suffix;\n\t },\n\t\n\t decimalByteUnits: function() {\n\t return formatByteUnits(this._value, bytes.decimal.suffixes, bytes.decimal.scale).suffix;\n\t },\n\t\n\t value: function() {\n\t return this._value;\n\t },\n\t\n\t valueOf: function() {\n\t return this._value;\n\t },\n\t\n\t set: function(value) {\n\t this._value = Number(value);\n\t return this;\n\t },\n\t\n\t add: function(value) {\n\t var corrFactor = correctionFactor.call(null, this._value, value);\n\t\n\t function cback(accum, curr) {\n\t return accum + corrFactor * curr;\n\t }\n\t this._value = [this._value, value].reduce(cback, 0) / corrFactor;\n\t return this;\n\t },\n\t\n\t subtract: function(value) {\n\t var corrFactor = correctionFactor.call(null, this._value, value);\n\t\n\t function cback(accum, curr) {\n\t return accum - corrFactor * curr;\n\t }\n\t this._value = [value].reduce(cback, this._value * corrFactor) / corrFactor;\n\t return this;\n\t },\n\t\n\t multiply: function(value) {\n\t function cback(accum, curr) {\n\t var corrFactor = correctionFactor(accum, curr),\n\t result = accum * corrFactor;\n\t result *= curr * corrFactor;\n\t result /= corrFactor * corrFactor;\n\t return result;\n\t }\n\t this._value = [this._value, value].reduce(cback, 1);\n\t return this;\n\t },\n\t\n\t divide: function(value) {\n\t function cback(accum, curr) {\n\t var corrFactor = correctionFactor(accum, curr);\n\t return (accum * corrFactor) / (curr * corrFactor);\n\t }\n\t this._value = [this._value, value].reduce(cback);\n\t return this;\n\t },\n\t\n\t difference: function(value) {\n\t return Math.abs(numbro(this._value).subtract(value).value());\n\t }\n\t\n\t };\n\t\n\t /************************************\n\t Exposing Numbro\n\t ************************************/\n\t\n\t if (inNodejsRuntime()) {\n\t //Todo: Rename the folder in 2.0.0\n\t numbro.loadCulturesInNode();\n\t }\n\t\n\t // CommonJS module is defined\n\t if (hasModule) {\n\t module.exports = numbro;\n\t } else {\n\t /*global ender:false */\n\t if (typeof ender === 'undefined') {\n\t // here, `this` means `window` in the browser, or `global` on the server\n\t // add `numbro` as a global object via a string identifier,\n\t // for Closure Compiler 'advanced' mode\n\t this.numbro = numbro;\n\t }\n\t\n\t /*global define:false */\n\t if (true) {\n\t !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t return numbro;\n\t }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t }\n\t }\n\t\n\t}.call(typeof window === 'undefined' ? this : window));\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))\n\n/***/ },\n/* 20 */\n/***/ function(module, exports) {\n\n\t// shim for using process in browser\n\t\n\tvar process = module.exports = {};\n\t\n\t// cached from whatever global is present so that test runners that stub it\n\t// don't break things. But we need to wrap it in a try catch in case it is\n\t// wrapped in strict mode code which doesn't define any globals. It's inside a\n\t// function because try/catches deoptimize in certain engines.\n\t\n\tvar cachedSetTimeout;\n\tvar cachedClearTimeout;\n\t\n\t(function () {\n\t try {\n\t cachedSetTimeout = setTimeout;\n\t } catch (e) {\n\t cachedSetTimeout = function () {\n\t throw new Error('setTimeout is not defined');\n\t }\n\t }\n\t try {\n\t cachedClearTimeout = clearTimeout;\n\t } catch (e) {\n\t cachedClearTimeout = function () {\n\t throw new Error('clearTimeout is not defined');\n\t }\n\t }\n\t} ())\n\tvar queue = [];\n\tvar draining = false;\n\tvar currentQueue;\n\tvar queueIndex = -1;\n\t\n\tfunction cleanUpNextTick() {\n\t if (!draining || !currentQueue) {\n\t return;\n\t }\n\t draining = false;\n\t if (currentQueue.length) {\n\t queue = currentQueue.concat(queue);\n\t } else {\n\t queueIndex = -1;\n\t }\n\t if (queue.length) {\n\t drainQueue();\n\t }\n\t}\n\t\n\tfunction drainQueue() {\n\t if (draining) {\n\t return;\n\t }\n\t var timeout = cachedSetTimeout(cleanUpNextTick);\n\t draining = true;\n\t\n\t var len = queue.length;\n\t while(len) {\n\t currentQueue = queue;\n\t queue = [];\n\t while (++queueIndex < len) {\n\t if (currentQueue) {\n\t currentQueue[queueIndex].run();\n\t }\n\t }\n\t queueIndex = -1;\n\t len = queue.length;\n\t }\n\t currentQueue = null;\n\t draining = false;\n\t cachedClearTimeout(timeout);\n\t}\n\t\n\tprocess.nextTick = function (fun) {\n\t var args = new Array(arguments.length - 1);\n\t if (arguments.length > 1) {\n\t for (var i = 1; i < arguments.length; i++) {\n\t args[i - 1] = arguments[i];\n\t }\n\t }\n\t queue.push(new Item(fun, args));\n\t if (queue.length === 1 && !draining) {\n\t cachedSetTimeout(drainQueue, 0);\n\t }\n\t};\n\t\n\t// v8 likes predictible objects\n\tfunction Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}\n\tItem.prototype.run = function () {\n\t this.fun.apply(null, this.array);\n\t};\n\tprocess.title = 'browser';\n\tprocess.browser = true;\n\tprocess.env = {};\n\tprocess.argv = [];\n\tprocess.version = ''; // empty string to avoid regexp issues\n\tprocess.versions = {};\n\t\n\tfunction noop() {}\n\t\n\tprocess.on = noop;\n\tprocess.addListener = noop;\n\tprocess.once = noop;\n\tprocess.off = noop;\n\tprocess.removeListener = noop;\n\tprocess.removeAllListeners = noop;\n\tprocess.emit = noop;\n\t\n\tprocess.binding = function (name) {\n\t throw new Error('process.binding is not supported');\n\t};\n\t\n\tprocess.cwd = function () { return '/' };\n\tprocess.chdir = function (dir) {\n\t throw new Error('process.chdir is not supported');\n\t};\n\tprocess.umask = function() { return 0; };\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t// empty (null-loader)\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\tthis.j$ = this.jStat = (function(Math, undefined) {\n\t\n\t// For quick reference.\n\tvar concat = Array.prototype.concat;\n\tvar slice = Array.prototype.slice;\n\tvar toString = Object.prototype.toString;\n\t\n\t// Calculate correction for IEEE error\n\t// TODO: This calculation can be improved.\n\tfunction calcRdx(n, m) {\n\t var val = n > m ? n : m;\n\t return Math.pow(10,\n\t 17 - ~~(Math.log(((val > 0) ? val : -val)) * Math.LOG10E));\n\t}\n\t\n\t\n\tvar isArray = Array.isArray || function isArray(arg) {\n\t return toString.call(arg) === '[object Array]';\n\t};\n\t\n\t\n\tfunction isFunction(arg) {\n\t return toString.call(arg) === '[object Function]';\n\t}\n\t\n\t\n\tfunction isNumber(arg) {\n\t return typeof arg === 'number' && arg === arg;\n\t}\n\t\n\t\n\t// Converts the jStat matrix to vector.\n\tfunction toVector(arr) {\n\t return concat.apply([], arr);\n\t}\n\t\n\t\n\t// The one and only jStat constructor.\n\tfunction jStat() {\n\t return new jStat._init(arguments);\n\t}\n\t\n\t\n\t// TODO: Remove after all references in src files have been removed.\n\tjStat.fn = jStat.prototype;\n\t\n\t\n\t// By separating the initializer from the constructor it's easier to handle\n\t// always returning a new instance whether \"new\" was used or not.\n\tjStat._init = function _init(args) {\n\t var i;\n\t\n\t // If first argument is an array, must be vector or matrix.\n\t if (isArray(args[0])) {\n\t // Check if matrix.\n\t if (isArray(args[0][0])) {\n\t // See if a mapping function was also passed.\n\t if (isFunction(args[1]))\n\t args[0] = jStat.map(args[0], args[1]);\n\t // Iterate over each is faster than this.push.apply(this, args[0].\n\t for (var i = 0; i < args[0].length; i++)\n\t this[i] = args[0][i];\n\t this.length = args[0].length;\n\t\n\t // Otherwise must be a vector.\n\t } else {\n\t this[0] = isFunction(args[1]) ? jStat.map(args[0], args[1]) : args[0];\n\t this.length = 1;\n\t }\n\t\n\t // If first argument is number, assume creation of sequence.\n\t } else if (isNumber(args[0])) {\n\t this[0] = jStat.seq.apply(null, args);\n\t this.length = 1;\n\t\n\t // Handle case when jStat object is passed to jStat.\n\t } else if (args[0] instanceof jStat) {\n\t // Duplicate the object and pass it back.\n\t return jStat(args[0].toArray());\n\t\n\t // Unexpected argument value, return empty jStat object.\n\t // TODO: This is strange behavior. Shouldn't this throw or some such to let\n\t // the user know they had bad arguments?\n\t } else {\n\t this[0] = [];\n\t this.length = 1;\n\t }\n\t\n\t return this;\n\t};\n\tjStat._init.prototype = jStat.prototype;\n\tjStat._init.constructor = jStat;\n\t\n\t\n\t// Utility functions.\n\t// TODO: for internal use only?\n\tjStat.utils = {\n\t calcRdx: calcRdx,\n\t isArray: isArray,\n\t isFunction: isFunction,\n\t isNumber: isNumber,\n\t toVector: toVector\n\t};\n\t\n\t\n\t// Easily extend the jStat object.\n\t// TODO: is this seriously necessary?\n\tjStat.extend = function extend(obj) {\n\t var i, j;\n\t\n\t if (arguments.length === 1) {\n\t for (j in obj)\n\t jStat[j] = obj[j];\n\t return this;\n\t }\n\t\n\t for (var i = 1; i < arguments.length; i++) {\n\t for (j in arguments[i])\n\t obj[j] = arguments[i][j];\n\t }\n\t\n\t return obj;\n\t};\n\t\n\t\n\t// Returns the number of rows in the matrix.\n\tjStat.rows = function rows(arr) {\n\t return arr.length || 1;\n\t};\n\t\n\t\n\t// Returns the number of columns in the matrix.\n\tjStat.cols = function cols(arr) {\n\t return arr[0].length || 1;\n\t};\n\t\n\t\n\t// Returns the dimensions of the object { rows: i, cols: j }\n\tjStat.dimensions = function dimensions(arr) {\n\t return {\n\t rows: jStat.rows(arr),\n\t cols: jStat.cols(arr)\n\t };\n\t};\n\t\n\t\n\t// Returns a specified row as a vector or return a sub matrix by pick some rows\n\tjStat.row = function row(arr, index) {\n\t if (isArray(index)) {\n\t return index.map(function(i) {\n\t return jStat.row(arr, i);\n\t })\n\t }\n\t return arr[index];\n\t};\n\t\n\t\n\t// return row as array\n\t// rowa([[1,2],[3,4]],0) -> [1,2]\n\tjStat.rowa = function rowa(arr, i) {\n\t return jStat.row(arr, i);\n\t};\n\t\n\t\n\t// Returns the specified column as a vector or return a sub matrix by pick some\n\t// columns\n\tjStat.col = function col(arr, index) {\n\t if (isArray(index)) {\n\t var submat = jStat.arange(arr.length).map(function(i) {\n\t return new Array(index.length);\n\t });\n\t index.forEach(function(ind, i){\n\t jStat.arange(arr.length).forEach(function(j) {\n\t submat[j][i] = arr[j][ind];\n\t });\n\t });\n\t return submat;\n\t }\n\t var column = new Array(arr.length);\n\t for (var i = 0; i < arr.length; i++)\n\t column[i] = [arr[i][index]];\n\t return column;\n\t};\n\t\n\t\n\t// return column as array\n\t// cola([[1,2],[3,4]],0) -> [1,3]\n\tjStat.cola = function cola(arr, i) {\n\t return jStat.col(arr, i).map(function(a){ return a[0] });\n\t};\n\t\n\t\n\t// Returns the diagonal of the matrix\n\tjStat.diag = function diag(arr) {\n\t var nrow = jStat.rows(arr);\n\t var res = new Array(nrow);\n\t for (var row = 0; row < nrow; row++)\n\t res[row] = [arr[row][row]];\n\t return res;\n\t};\n\t\n\t\n\t// Returns the anti-diagonal of the matrix\n\tjStat.antidiag = function antidiag(arr) {\n\t var nrow = jStat.rows(arr) - 1;\n\t var res = new Array(nrow);\n\t for (var i = 0; nrow >= 0; nrow--, i++)\n\t res[i] = [arr[i][nrow]];\n\t return res;\n\t};\n\t\n\t// Transpose a matrix or array.\n\tjStat.transpose = function transpose(arr) {\n\t var obj = [];\n\t var objArr, rows, cols, j, i;\n\t\n\t // Make sure arr is in matrix format.\n\t if (!isArray(arr[0]))\n\t arr = [arr];\n\t\n\t rows = arr.length;\n\t cols = arr[0].length;\n\t\n\t for (var i = 0; i < cols; i++) {\n\t objArr = new Array(rows);\n\t for (j = 0; j < rows; j++)\n\t objArr[j] = arr[j][i];\n\t obj.push(objArr);\n\t }\n\t\n\t // If obj is vector, return only single array.\n\t return obj.length === 1 ? obj[0] : obj;\n\t};\n\t\n\t\n\t// Map a function to an array or array of arrays.\n\t// \"toAlter\" is an internal variable.\n\tjStat.map = function map(arr, func, toAlter) {\n\t var row, nrow, ncol, res, col;\n\t\n\t if (!isArray(arr[0]))\n\t arr = [arr];\n\t\n\t nrow = arr.length;\n\t ncol = arr[0].length;\n\t res = toAlter ? arr : new Array(nrow);\n\t\n\t for (row = 0; row < nrow; row++) {\n\t // if the row doesn't exist, create it\n\t if (!res[row])\n\t res[row] = new Array(ncol);\n\t for (col = 0; col < ncol; col++)\n\t res[row][col] = func(arr[row][col], row, col);\n\t }\n\t\n\t return res.length === 1 ? res[0] : res;\n\t};\n\t\n\t\n\t// Cumulatively combine the elements of an array or array of arrays using a function.\n\tjStat.cumreduce = function cumreduce(arr, func, toAlter) {\n\t var row, nrow, ncol, res, col;\n\t\n\t if (!isArray(arr[0]))\n\t arr = [arr];\n\t\n\t nrow = arr.length;\n\t ncol = arr[0].length;\n\t res = toAlter ? arr : new Array(nrow);\n\t\n\t for (row = 0; row < nrow; row++) {\n\t // if the row doesn't exist, create it\n\t if (!res[row])\n\t res[row] = new Array(ncol);\n\t if (ncol > 0)\n\t res[row][0] = arr[row][0];\n\t for (col = 1; col < ncol; col++)\n\t res[row][col] = func(res[row][col-1], arr[row][col]);\n\t }\n\t return res.length === 1 ? res[0] : res;\n\t};\n\t\n\t\n\t// Destructively alter an array.\n\tjStat.alter = function alter(arr, func) {\n\t return jStat.map(arr, func, true);\n\t};\n\t\n\t\n\t// Generate a rows x cols matrix according to the supplied function.\n\tjStat.create = function create(rows, cols, func) {\n\t var res = new Array(rows);\n\t var i, j;\n\t\n\t if (isFunction(cols)) {\n\t func = cols;\n\t cols = rows;\n\t }\n\t\n\t for (var i = 0; i < rows; i++) {\n\t res[i] = new Array(cols);\n\t for (j = 0; j < cols; j++)\n\t res[i][j] = func(i, j);\n\t }\n\t\n\t return res;\n\t};\n\t\n\t\n\tfunction retZero() { return 0; }\n\t\n\t\n\t// Generate a rows x cols matrix of zeros.\n\tjStat.zeros = function zeros(rows, cols) {\n\t if (!isNumber(cols))\n\t cols = rows;\n\t return jStat.create(rows, cols, retZero);\n\t};\n\t\n\t\n\tfunction retOne() { return 1; }\n\t\n\t\n\t// Generate a rows x cols matrix of ones.\n\tjStat.ones = function ones(rows, cols) {\n\t if (!isNumber(cols))\n\t cols = rows;\n\t return jStat.create(rows, cols, retOne);\n\t};\n\t\n\t\n\t// Generate a rows x cols matrix of uniformly random numbers.\n\tjStat.rand = function rand(rows, cols) {\n\t if (!isNumber(cols))\n\t cols = rows;\n\t return jStat.create(rows, cols, Math.random);\n\t};\n\t\n\t\n\tfunction retIdent(i, j) { return i === j ? 1 : 0; }\n\t\n\t\n\t// Generate an identity matrix of size row x cols.\n\tjStat.identity = function identity(rows, cols) {\n\t if (!isNumber(cols))\n\t cols = rows;\n\t return jStat.create(rows, cols, retIdent);\n\t};\n\t\n\t\n\t// Tests whether a matrix is symmetric\n\tjStat.symmetric = function symmetric(arr) {\n\t var issymmetric = true;\n\t var size = arr.length;\n\t var row, col;\n\t\n\t if (arr.length !== arr[0].length)\n\t return false;\n\t\n\t for (row = 0; row < size; row++) {\n\t for (col = 0; col < size; col++)\n\t if (arr[col][row] !== arr[row][col])\n\t return false;\n\t }\n\t\n\t return true;\n\t};\n\t\n\t\n\t// Set all values to zero.\n\tjStat.clear = function clear(arr) {\n\t return jStat.alter(arr, retZero);\n\t};\n\t\n\t\n\t// Generate sequence.\n\tjStat.seq = function seq(min, max, length, func) {\n\t if (!isFunction(func))\n\t func = false;\n\t\n\t var arr = [];\n\t var hival = calcRdx(min, max);\n\t var step = (max * hival - min * hival) / ((length - 1) * hival);\n\t var current = min;\n\t var cnt;\n\t\n\t // Current is assigned using a technique to compensate for IEEE error.\n\t // TODO: Needs better implementation.\n\t for (cnt = 0;\n\t current <= max;\n\t cnt++, current = (min * hival + step * hival * cnt) / hival) {\n\t arr.push((func ? func(current, cnt) : current));\n\t }\n\t\n\t return arr;\n\t};\n\t\n\t\n\t// arange(5) -> [0,1,2,3,4]\n\t// arange(1,5) -> [1,2,3,4]\n\t// arange(5,1,-1) -> [5,4,3,2]\n\tjStat.arange = function arange(start, end, step) {\n\t var rl = [];\n\t step = step || 1;\n\t if (end === undefined) {\n\t end = start;\n\t start = 0;\n\t }\n\t if (start === end || step === 0) {\n\t return [];\n\t }\n\t if (start < end && step < 0) {\n\t return [];\n\t }\n\t if (start > end && step > 0) {\n\t return [];\n\t }\n\t if (step > 0) {\n\t for (i = start; i < end; i += step) {\n\t rl.push(i);\n\t }\n\t } else {\n\t for (i = start; i > end; i += step) {\n\t rl.push(i);\n\t }\n\t }\n\t return rl;\n\t};\n\t\n\t\n\t// A=[[1,2,3],[4,5,6],[7,8,9]]\n\t// slice(A,{row:{end:2},col:{start:1}}) -> [[2,3],[5,6]]\n\t// slice(A,1,{start:1}) -> [5,6]\n\t// as numpy code A[:2,1:]\n\tjStat.slice = (function(){\n\t function _slice(list, start, end, step) {\n\t // note it's not equal to range.map mode it's a bug\n\t var i;\n\t var rl = [];\n\t var length = list.length;\n\t if (start === undefined && end === undefined && step === undefined) {\n\t return jStat.copy(list);\n\t }\n\t\n\t start = start || 0;\n\t end = end || list.length;\n\t start = start >= 0 ? start : length + start;\n\t end = end >= 0 ? end : length + end;\n\t step = step || 1;\n\t if (start === end || step === 0) {\n\t return [];\n\t }\n\t if (start < end && step < 0) {\n\t return [];\n\t }\n\t if (start > end && step > 0) {\n\t return [];\n\t }\n\t if (step > 0) {\n\t for (i = start; i < end; i += step) {\n\t rl.push(list[i]);\n\t }\n\t } else {\n\t for (i = start; i > end;i += step) {\n\t rl.push(list[i]);\n\t }\n\t }\n\t return rl;\n\t }\n\t\n\t function slice(list, rcSlice) {\n\t rcSlice = rcSlice || {};\n\t if (isNumber(rcSlice.row)) {\n\t if (isNumber(rcSlice.col))\n\t return list[rcSlice.row][rcSlice.col];\n\t var row = jStat.rowa(list, rcSlice.row);\n\t var colSlice = rcSlice.col || {};\n\t return _slice(row, colSlice.start, colSlice.end, colSlice.step);\n\t }\n\t\n\t if (isNumber(rcSlice.col)) {\n\t var col = jStat.cola(list, rcSlice.col);\n\t var rowSlice = rcSlice.row || {};\n\t return _slice(col, rowSlice.start, rowSlice.end, rowSlice.step);\n\t }\n\t\n\t var rowSlice = rcSlice.row || {};\n\t var colSlice = rcSlice.col || {};\n\t var rows = _slice(list, rowSlice.start, rowSlice.end, rowSlice.step);\n\t return rows.map(function(row) {\n\t return _slice(row, colSlice.start, colSlice.end, colSlice.step);\n\t });\n\t }\n\t\n\t return slice;\n\t}());\n\t\n\t\n\t// A=[[1,2,3],[4,5,6],[7,8,9]]\n\t// sliceAssign(A,{row:{start:1},col:{start:1}},[[0,0],[0,0]])\n\t// A=[[1,2,3],[4,0,0],[7,0,0]]\n\tjStat.sliceAssign = function sliceAssign(A, rcSlice, B) {\n\t if (isNumber(rcSlice.row)) {\n\t if (isNumber(rcSlice.col))\n\t return A[rcSlice.row][rcSlice.col] = B;\n\t rcSlice.col = rcSlice.col || {};\n\t rcSlice.col.start = rcSlice.col.start || 0;\n\t rcSlice.col.end = rcSlice.col.end || A[0].length;\n\t rcSlice.col.step = rcSlice.col.step || 1;\n\t var nl = jStat.arange(rcSlice.col.start,\n\t Math.min(A.length, rcSlice.col.end),\n\t rcSlice.col.step);\n\t var m = rcSlice.row;\n\t nl.forEach(function(n, i) {\n\t A[m][n] = B[i];\n\t });\n\t return A;\n\t }\n\t\n\t if (isNumber(rcSlice.col)) {\n\t rcSlice.row = rcSlice.row || {};\n\t rcSlice.row.start = rcSlice.row.start || 0;\n\t rcSlice.row.end = rcSlice.row.end || A.length;\n\t rcSlice.row.step = rcSlice.row.step || 1;\n\t var ml = jStat.arange(rcSlice.row.start,\n\t Math.min(A[0].length, rcSlice.row.end),\n\t rcSlice.row.step);\n\t var n = rcSlice.col;\n\t ml.forEach(function(m, j) {\n\t A[m][n] = B[j];\n\t });\n\t return A;\n\t }\n\t\n\t if (B[0].length === undefined) {\n\t B = [B];\n\t }\n\t rcSlice.row.start = rcSlice.row.start || 0;\n\t rcSlice.row.end = rcSlice.row.end || A.length;\n\t rcSlice.row.step = rcSlice.row.step || 1;\n\t rcSlice.col.start = rcSlice.col.start || 0;\n\t rcSlice.col.end = rcSlice.col.end || A[0].length;\n\t rcSlice.col.step = rcSlice.col.step || 1;\n\t var ml = jStat.arange(rcSlice.row.start,\n\t Math.min(A.length, rcSlice.row.end),\n\t rcSlice.row.step);\n\t var nl = jStat.arange(rcSlice.col.start,\n\t Math.min(A[0].length, rcSlice.col.end),\n\t rcSlice.col.step);\n\t ml.forEach(function(m, i) {\n\t nl.forEach(function(n, j) {\n\t A[m][n] = B[i][j];\n\t });\n\t });\n\t return A;\n\t};\n\t\n\t\n\t// [1,2,3] ->\n\t// [[1,0,0],[0,2,0],[0,0,3]]\n\tjStat.diagonal = function diagonal(diagArray) {\n\t var mat = jStat.zeros(diagArray.length, diagArray.length);\n\t diagArray.forEach(function(t, i) {\n\t mat[i][i] = t;\n\t });\n\t return mat;\n\t};\n\t\n\t\n\t// return copy of A\n\tjStat.copy = function copy(A) {\n\t return A.map(function(row) {\n\t if (isNumber(row))\n\t return row;\n\t return row.map(function(t) {\n\t return t;\n\t });\n\t });\n\t};\n\t\n\t\n\t// TODO: Go over this entire implementation. Seems a tragic waste of resources\n\t// doing all this work. Instead, and while ugly, use new Function() to generate\n\t// a custom function for each static method.\n\t\n\t// Quick reference.\n\tvar jProto = jStat.prototype;\n\t\n\t// Default length.\n\tjProto.length = 0;\n\t\n\t// For internal use only.\n\t// TODO: Check if they're actually used, and if they are then rename them\n\t// to _*\n\tjProto.push = Array.prototype.push;\n\tjProto.sort = Array.prototype.sort;\n\tjProto.splice = Array.prototype.splice;\n\tjProto.slice = Array.prototype.slice;\n\t\n\t\n\t// Return a clean array.\n\tjProto.toArray = function toArray() {\n\t return this.length > 1 ? slice.call(this) : slice.call(this)[0];\n\t};\n\t\n\t\n\t// Map a function to a matrix or vector.\n\tjProto.map = function map(func, toAlter) {\n\t return jStat(jStat.map(this, func, toAlter));\n\t};\n\t\n\t\n\t// Cumulatively combine the elements of a matrix or vector using a function.\n\tjProto.cumreduce = function cumreduce(func, toAlter) {\n\t return jStat(jStat.cumreduce(this, func, toAlter));\n\t};\n\t\n\t\n\t// Destructively alter an array.\n\tjProto.alter = function alter(func) {\n\t jStat.alter(this, func);\n\t return this;\n\t};\n\t\n\t\n\t// Extend prototype with methods that have no argument.\n\t(function(funcs) {\n\t for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n\t jProto[passfunc] = function(func) {\n\t var self = this,\n\t results;\n\t // Check for callback.\n\t if (func) {\n\t setTimeout(function() {\n\t func.call(self, jProto[passfunc].call(self));\n\t });\n\t return this;\n\t }\n\t results = jStat[passfunc](this);\n\t return isArray(results) ? jStat(results) : results;\n\t };\n\t })(funcs[i]);\n\t})('transpose clear symmetric rows cols dimensions diag antidiag'.split(' '));\n\t\n\t\n\t// Extend prototype with methods that have one argument.\n\t(function(funcs) {\n\t for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n\t jProto[passfunc] = function(index, func) {\n\t var self = this;\n\t // check for callback\n\t if (func) {\n\t setTimeout(function() {\n\t func.call(self, jProto[passfunc].call(self, index));\n\t });\n\t return this;\n\t }\n\t return jStat(jStat[passfunc](this, index));\n\t };\n\t })(funcs[i]);\n\t})('row col'.split(' '));\n\t\n\t\n\t// Extend prototype with simple shortcut methods.\n\t(function(funcs) {\n\t for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n\t jProto[passfunc] = new Function(\n\t 'return jStat(jStat.' + passfunc + '.apply(null, arguments));');\n\t })(funcs[i]);\n\t})('create zeros ones rand identity'.split(' '));\n\t\n\t\n\t// Exposing jStat.\n\treturn jStat;\n\t\n\t}(Math));\n\t(function(jStat, Math) {\n\t\n\tvar isFunction = jStat.utils.isFunction;\n\t\n\t// Ascending functions for sort\n\tfunction ascNum(a, b) { return a - b; }\n\t\n\tfunction clip(arg, min, max) {\n\t return Math.max(min, Math.min(arg, max));\n\t}\n\t\n\t\n\t// sum of an array\n\tjStat.sum = function sum(arr) {\n\t var sum = 0;\n\t var i = arr.length;\n\t while (--i >= 0)\n\t sum += arr[i];\n\t return sum;\n\t};\n\t\n\t\n\t// sum squared\n\tjStat.sumsqrd = function sumsqrd(arr) {\n\t var sum = 0;\n\t var i = arr.length;\n\t while (--i >= 0)\n\t sum += arr[i] * arr[i];\n\t return sum;\n\t};\n\t\n\t\n\t// sum of squared errors of prediction (SSE)\n\tjStat.sumsqerr = function sumsqerr(arr) {\n\t var mean = jStat.mean(arr);\n\t var sum = 0;\n\t var i = arr.length;\n\t var tmp;\n\t while (--i >= 0) {\n\t tmp = arr[i] - mean;\n\t sum += tmp * tmp;\n\t }\n\t return sum;\n\t};\n\t\n\t// sum of an array in each row\n\tjStat.sumrow = function sumrow(arr) {\n\t var sum = 0;\n\t var i = arr.length;\n\t while (--i >= 0)\n\t sum += arr[i];\n\t return sum;\n\t};\n\t\n\t// product of an array\n\tjStat.product = function product(arr) {\n\t var prod = 1;\n\t var i = arr.length;\n\t while (--i >= 0)\n\t prod *= arr[i];\n\t return prod;\n\t};\n\t\n\t\n\t// minimum value of an array\n\tjStat.min = function min(arr) {\n\t var low = arr[0];\n\t var i = 0;\n\t while (++i < arr.length)\n\t if (arr[i] < low)\n\t low = arr[i];\n\t return low;\n\t};\n\t\n\t\n\t// maximum value of an array\n\tjStat.max = function max(arr) {\n\t var high = arr[0];\n\t var i = 0;\n\t while (++i < arr.length)\n\t if (arr[i] > high)\n\t high = arr[i];\n\t return high;\n\t};\n\t\n\t\n\t// unique values of an array\n\tjStat.unique = function unique(arr) {\n\t var hash = {}, _arr = [];\n\t for(var i = 0; i < arr.length; i++) {\n\t if (!hash[arr[i]]) {\n\t hash[arr[i]] = true;\n\t _arr.push(arr[i]);\n\t }\n\t }\n\t return _arr;\n\t};\n\t\n\t\n\t// mean value of an array\n\tjStat.mean = function mean(arr) {\n\t return jStat.sum(arr) / arr.length;\n\t};\n\t\n\t\n\t// mean squared error (MSE)\n\tjStat.meansqerr = function meansqerr(arr) {\n\t return jStat.sumsqerr(arr) / arr.length;\n\t};\n\t\n\t\n\t// geometric mean of an array\n\tjStat.geomean = function geomean(arr) {\n\t return Math.pow(jStat.product(arr), 1 / arr.length);\n\t};\n\t\n\t\n\t// median of an array\n\tjStat.median = function median(arr) {\n\t var arrlen = arr.length;\n\t var _arr = arr.slice().sort(ascNum);\n\t // check if array is even or odd, then return the appropriate\n\t return !(arrlen & 1)\n\t ? (_arr[(arrlen / 2) - 1 ] + _arr[(arrlen / 2)]) / 2\n\t : _arr[(arrlen / 2) | 0 ];\n\t};\n\t\n\t\n\t// cumulative sum of an array\n\tjStat.cumsum = function cumsum(arr) {\n\t return jStat.cumreduce(arr, function (a, b) { return a + b; });\n\t};\n\t\n\t\n\t// cumulative product of an array\n\tjStat.cumprod = function cumprod(arr) {\n\t return jStat.cumreduce(arr, function (a, b) { return a * b; });\n\t};\n\t\n\t\n\t// successive differences of a sequence\n\tjStat.diff = function diff(arr) {\n\t var diffs = [];\n\t var arrLen = arr.length;\n\t var i;\n\t for (var i = 1; i < arrLen; i++)\n\t diffs.push(arr[i] - arr[i - 1]);\n\t return diffs;\n\t};\n\t\n\t\n\t// ranks of an array\n\tjStat.rank = function (arr) {\n\t var arrlen = arr.length;\n\t var sorted = arr.slice().sort(ascNum);\n\t var ranks = new Array(arrlen);\n\t for (var i = 0; i < arrlen; i++) {\n\t var first = sorted.indexOf(arr[i]);\n\t var last = sorted.lastIndexOf(arr[i]);\n\t if (first === last) {\n\t var val = first;\n\t } else {\n\t var val = (first + last) / 2;\n\t }\n\t ranks[i] = val + 1;\n\t }\n\t return ranks;\n\t};\n\t\n\t\n\t// mode of an array\n\t// if there are multiple modes of an array, return all of them\n\t// is this the appropriate way of handling it?\n\tjStat.mode = function mode(arr) {\n\t var arrLen = arr.length;\n\t var _arr = arr.slice().sort(ascNum);\n\t var count = 1;\n\t var maxCount = 0;\n\t var numMaxCount = 0;\n\t var mode_arr = [];\n\t var i;\n\t\n\t for (var i = 0; i < arrLen; i++) {\n\t if (_arr[i] === _arr[i + 1]) {\n\t count++;\n\t } else {\n\t if (count > maxCount) {\n\t mode_arr = [_arr[i]];\n\t maxCount = count;\n\t numMaxCount = 0;\n\t }\n\t // are there multiple max counts\n\t else if (count === maxCount) {\n\t mode_arr.push(_arr[i]);\n\t numMaxCount++;\n\t }\n\t // resetting count for new value in array\n\t count = 1;\n\t }\n\t }\n\t\n\t return numMaxCount === 0 ? mode_arr[0] : mode_arr;\n\t};\n\t\n\t\n\t// range of an array\n\tjStat.range = function range(arr) {\n\t return jStat.max(arr) - jStat.min(arr);\n\t};\n\t\n\t// variance of an array\n\t// flag = true indicates sample instead of population\n\tjStat.variance = function variance(arr, flag) {\n\t return jStat.sumsqerr(arr) / (arr.length - (flag ? 1 : 0));\n\t};\n\t\n\t// deviation of an array\n\tjStat.deviation = function (arr) {\n\t var mean = jStat.mean(arr);\n\t var arrlen = arr.length;\n\t var dev = new Array(arrlen);\n\t for (var i = 0; i < arrlen; i++) {\n\t dev[i] = arr[i] - mean;\n\t }\n\t return dev;\n\t};\n\t\n\t// standard deviation of an array\n\t// flag = true indicates sample instead of population\n\tjStat.stdev = function stdev(arr, flag) {\n\t return Math.sqrt(jStat.variance(arr, flag));\n\t};\n\t\n\t\n\t// mean deviation (mean absolute deviation) of an array\n\tjStat.meandev = function meandev(arr) {\n\t var devSum = 0;\n\t var mean = jStat.mean(arr);\n\t var i;\n\t for (var i = arr.length - 1; i >= 0; i--)\n\t devSum += Math.abs(arr[i] - mean);\n\t return devSum / arr.length;\n\t};\n\t\n\t\n\t// median deviation (median absolute deviation) of an array\n\tjStat.meddev = function meddev(arr) {\n\t var devSum = 0;\n\t var median = jStat.median(arr);\n\t var i;\n\t for (var i = arr.length - 1; i >= 0; i--)\n\t devSum += Math.abs(arr[i] - median);\n\t return devSum / arr.length;\n\t};\n\t\n\t\n\t// coefficient of variation\n\tjStat.coeffvar = function coeffvar(arr) {\n\t return jStat.stdev(arr) / jStat.mean(arr);\n\t};\n\t\n\t\n\t// quartiles of an array\n\tjStat.quartiles = function quartiles(arr) {\n\t var arrlen = arr.length;\n\t var _arr = arr.slice().sort(ascNum);\n\t return [\n\t _arr[ Math.round((arrlen) / 4) - 1 ],\n\t _arr[ Math.round((arrlen) / 2) - 1 ],\n\t _arr[ Math.round((arrlen) * 3 / 4) - 1 ]\n\t ];\n\t};\n\t\n\t\n\t// Arbitary quantiles of an array. Direct port of the scipy.stats\n\t// implementation by Pierre GF Gerard-Marchant.\n\tjStat.quantiles = function quantiles(arr, quantilesArray, alphap, betap) {\n\t var sortedArray = arr.slice().sort(ascNum);\n\t var quantileVals = [quantilesArray.length];\n\t var n = arr.length;\n\t var i, p, m, aleph, k, gamma;\n\t\n\t if (typeof alphap === 'undefined')\n\t alphap = 3 / 8;\n\t if (typeof betap === 'undefined')\n\t betap = 3 / 8;\n\t\n\t for (var i = 0; i < quantilesArray.length; i++) {\n\t p = quantilesArray[i];\n\t m = alphap + p * (1 - alphap - betap);\n\t aleph = n * p + m;\n\t k = Math.floor(clip(aleph, 1, n - 1));\n\t gamma = clip(aleph - k, 0, 1);\n\t quantileVals[i] = (1 - gamma) * sortedArray[k - 1] + gamma * sortedArray[k];\n\t }\n\t\n\t return quantileVals;\n\t};\n\t\n\t// Returns the k-th percentile of values in a range, where k is in the\n\t// range 0..1, exclusive.\n\tjStat.percentile = function percentile(arr, k) {\n\t var _arr = arr.slice().sort(ascNum);\n\t var realIndex = k * (_arr.length - 1);\n\t var index = parseInt(realIndex);\n\t var frac = realIndex - index;\n\t\n\t if (index + 1 < _arr.length) {\n\t return _arr[index] * (1 - frac) + _arr[index + 1] * frac;\n\t } else {\n\t return _arr[index];\n\t }\n\t}\n\t\n\t\n\t// The percentile rank of score in a given array. Returns the percentage\n\t// of all values in the input array that are less than (kind='strict') or\n\t// less or equal than (kind='weak') score. Default is weak.\n\tjStat.percentileOfScore = function percentileOfScore(arr, score, kind) {\n\t var counter = 0;\n\t var len = arr.length;\n\t var strict = false;\n\t var value, i;\n\t\n\t if (kind === 'strict')\n\t strict = true;\n\t\n\t for (var i = 0; i < len; i++) {\n\t value = arr[i];\n\t if ((strict && value < score) ||\n\t (!strict && value <= score)) {\n\t counter++;\n\t }\n\t }\n\t\n\t return counter / len;\n\t};\n\t\n\t\n\t// Histogram (bin count) data\n\tjStat.histogram = function histogram(arr, bins) {\n\t var first = jStat.min(arr);\n\t var binCnt = bins || 4;\n\t var binWidth = (jStat.max(arr) - first) / binCnt;\n\t var len = arr.length;\n\t var bins = [];\n\t var i;\n\t\n\t for (var i = 0; i < binCnt; i++)\n\t bins[i] = 0;\n\t for (var i = 0; i < len; i++)\n\t bins[Math.min(Math.floor(((arr[i] - first) / binWidth)), binCnt - 1)] += 1;\n\t\n\t return bins;\n\t};\n\t\n\t\n\t// covariance of two arrays\n\tjStat.covariance = function covariance(arr1, arr2) {\n\t var u = jStat.mean(arr1);\n\t var v = jStat.mean(arr2);\n\t var arr1Len = arr1.length;\n\t var sq_dev = new Array(arr1Len);\n\t var i;\n\t\n\t for (var i = 0; i < arr1Len; i++)\n\t sq_dev[i] = (arr1[i] - u) * (arr2[i] - v);\n\t\n\t return jStat.sum(sq_dev) / (arr1Len - 1);\n\t};\n\t\n\t\n\t// (pearson's) population correlation coefficient, rho\n\tjStat.corrcoeff = function corrcoeff(arr1, arr2) {\n\t return jStat.covariance(arr1, arr2) /\n\t jStat.stdev(arr1, 1) /\n\t jStat.stdev(arr2, 1);\n\t};\n\t\n\t // (spearman's) rank correlation coefficient, sp\n\tjStat.spearmancoeff = function (arr1, arr2) {\n\t arr1 = jStat.rank(arr1);\n\t arr2 = jStat.rank(arr2);\n\t var arr1dev = jStat.deviation(arr1);\n\t var arr2dev = jStat.deviation(arr2);\n\t return jStat.sum(arr1dev.map(function (x, i) {\n\t return x * arr2dev[i];\n\t })) /\n\t Math.sqrt(jStat.sum(arr1dev.map(function (x) {\n\t return Math.pow(x, 2);\n\t })) * jStat.sum(arr2dev.map(function (x) {\n\t return Math.pow(x, 2);\n\t }))\n\t );\n\t}\n\t\n\t\n\t// statistical standardized moments (general form of skew/kurt)\n\tjStat.stanMoment = function stanMoment(arr, n) {\n\t var mu = jStat.mean(arr);\n\t var sigma = jStat.stdev(arr);\n\t var len = arr.length;\n\t var skewSum = 0;\n\t\n\t for (var i = 0; i < len; i++)\n\t skewSum += Math.pow((arr[i] - mu) / sigma, n);\n\t\n\t return skewSum / arr.length;\n\t};\n\t\n\t// (pearson's) moment coefficient of skewness\n\tjStat.skewness = function skewness(arr) {\n\t return jStat.stanMoment(arr, 3);\n\t};\n\t\n\t// (pearson's) (excess) kurtosis\n\tjStat.kurtosis = function kurtosis(arr) {\n\t return jStat.stanMoment(arr, 4) - 3;\n\t};\n\t\n\t\n\tvar jProto = jStat.prototype;\n\t\n\t\n\t// Extend jProto with method for calculating cumulative sums and products.\n\t// This differs from the similar extension below as cumsum and cumprod should\n\t// not be run again in the case fullbool === true.\n\t// If a matrix is passed, automatically assume operation should be done on the\n\t// columns.\n\t(function(funcs) {\n\t for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n\t // If a matrix is passed, automatically assume operation should be done on\n\t // the columns.\n\t jProto[passfunc] = function(fullbool, func) {\n\t var arr = [];\n\t var i = 0;\n\t var tmpthis = this;\n\t // Assignment reassignation depending on how parameters were passed in.\n\t if (isFunction(fullbool)) {\n\t func = fullbool;\n\t fullbool = false;\n\t }\n\t // Check if a callback was passed with the function.\n\t if (func) {\n\t setTimeout(function() {\n\t func.call(tmpthis, jProto[passfunc].call(tmpthis, fullbool));\n\t });\n\t return this;\n\t }\n\t // Check if matrix and run calculations.\n\t if (this.length > 1) {\n\t tmpthis = fullbool === true ? this : this.transpose();\n\t for (; i < tmpthis.length; i++)\n\t arr[i] = jStat[passfunc](tmpthis[i]);\n\t return arr;\n\t }\n\t // Pass fullbool if only vector, not a matrix. for variance and stdev.\n\t return jStat[passfunc](this[0], fullbool);\n\t };\n\t })(funcs[i]);\n\t})(('cumsum cumprod').split(' '));\n\t\n\t\n\t// Extend jProto with methods which don't require arguments and work on columns.\n\t(function(funcs) {\n\t for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n\t // If a matrix is passed, automatically assume operation should be done on\n\t // the columns.\n\t jProto[passfunc] = function(fullbool, func) {\n\t var arr = [];\n\t var i = 0;\n\t var tmpthis = this;\n\t // Assignment reassignation depending on how parameters were passed in.\n\t if (isFunction(fullbool)) {\n\t func = fullbool;\n\t fullbool = false;\n\t }\n\t // Check if a callback was passed with the function.\n\t if (func) {\n\t setTimeout(function() {\n\t func.call(tmpthis, jProto[passfunc].call(tmpthis, fullbool));\n\t });\n\t return this;\n\t }\n\t // Check if matrix and run calculations.\n\t if (this.length > 1) {\n\t if (passfunc !== 'sumrow')\n\t tmpthis = fullbool === true ? this : this.transpose();\n\t for (; i < tmpthis.length; i++)\n\t arr[i] = jStat[passfunc](tmpthis[i]);\n\t return fullbool === true\n\t ? jStat[passfunc](jStat.utils.toVector(arr))\n\t : arr;\n\t }\n\t // Pass fullbool if only vector, not a matrix. for variance and stdev.\n\t return jStat[passfunc](this[0], fullbool);\n\t };\n\t })(funcs[i]);\n\t})(('sum sumsqrd sumsqerr sumrow product min max unique mean meansqerr ' +\n\t 'geomean median diff rank mode range variance deviation stdev meandev ' +\n\t 'meddev coeffvar quartiles histogram skewness kurtosis').split(' '));\n\t\n\t\n\t// Extend jProto with functions that take arguments. Operations on matrices are\n\t// done on columns.\n\t(function(funcs) {\n\t for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n\t jProto[passfunc] = function() {\n\t var arr = [];\n\t var i = 0;\n\t var tmpthis = this;\n\t var args = Array.prototype.slice.call(arguments);\n\t\n\t // If the last argument is a function, we assume it's a callback; we\n\t // strip the callback out and call the function again.\n\t if (isFunction(args[args.length - 1])) {\n\t var callbackFunction = args[args.length - 1];\n\t var argsToPass = args.slice(0, args.length - 1);\n\t\n\t setTimeout(function() {\n\t callbackFunction.call(tmpthis,\n\t jProto[passfunc].apply(tmpthis, argsToPass));\n\t });\n\t return this;\n\t\n\t // Otherwise we curry the function args and call normally.\n\t } else {\n\t var callbackFunction = undefined;\n\t var curriedFunction = function curriedFunction(vector) {\n\t return jStat[passfunc].apply(tmpthis, [vector].concat(args));\n\t }\n\t }\n\t\n\t // If this is a matrix, run column-by-column.\n\t if (this.length > 1) {\n\t tmpthis = tmpthis.transpose();\n\t for (; i < tmpthis.length; i++)\n\t arr[i] = curriedFunction(tmpthis[i]);\n\t return arr;\n\t }\n\t\n\t // Otherwise run on the vector.\n\t return curriedFunction(this[0]);\n\t };\n\t })(funcs[i]);\n\t})('quantiles percentileOfScore'.split(' '));\n\t\n\t}(this.jStat, Math));\n\t// Special functions //\n\t(function(jStat, Math) {\n\t\n\t// Log-gamma function\n\tjStat.gammaln = function gammaln(x) {\n\t var j = 0;\n\t var cof = [\n\t 76.18009172947146, -86.50532032941677, 24.01409824083091,\n\t -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5\n\t ];\n\t var ser = 1.000000000190015;\n\t var xx, y, tmp;\n\t tmp = (y = xx = x) + 5.5;\n\t tmp -= (xx + 0.5) * Math.log(tmp);\n\t for (; j < 6; j++)\n\t ser += cof[j] / ++y;\n\t return Math.log(2.5066282746310005 * ser / xx) - tmp;\n\t};\n\t\n\t\n\t// gamma of x\n\tjStat.gammafn = function gammafn(x) {\n\t var p = [-1.716185138865495, 24.76565080557592, -379.80425647094563,\n\t 629.3311553128184, 866.9662027904133, -31451.272968848367,\n\t -36144.413418691176, 66456.14382024054\n\t ];\n\t var q = [-30.8402300119739, 315.35062697960416, -1015.1563674902192,\n\t -3107.771671572311, 22538.118420980151, 4755.8462775278811,\n\t -134659.9598649693, -115132.2596755535];\n\t var fact = false;\n\t var n = 0;\n\t var xden = 0;\n\t var xnum = 0;\n\t var y = x;\n\t var i, z, yi, res, sum, ysq;\n\t if (y <= 0) {\n\t res = y % 1 + 3.6e-16;\n\t if (res) {\n\t fact = (!(y & 1) ? 1 : -1) * Math.PI / Math.sin(Math.PI * res);\n\t y = 1 - y;\n\t } else {\n\t return Infinity;\n\t }\n\t }\n\t yi = y;\n\t if (y < 1) {\n\t z = y++;\n\t } else {\n\t z = (y -= n = (y | 0) - 1) - 1;\n\t }\n\t for (var i = 0; i < 8; ++i) {\n\t xnum = (xnum + p[i]) * z;\n\t xden = xden * z + q[i];\n\t }\n\t res = xnum / xden + 1;\n\t if (yi < y) {\n\t res /= yi;\n\t } else if (yi > y) {\n\t for (var i = 0; i < n; ++i) {\n\t res *= y;\n\t y++;\n\t }\n\t }\n\t if (fact) {\n\t res = fact / res;\n\t }\n\t return res;\n\t};\n\t\n\t\n\t// lower incomplete gamma function, which is usually typeset with a\n\t// lower-case greek gamma as the function symbol\n\tjStat.gammap = function gammap(a, x) {\n\t return jStat.lowRegGamma(a, x) * jStat.gammafn(a);\n\t};\n\t\n\t\n\t// The lower regularized incomplete gamma function, usually written P(a,x)\n\tjStat.lowRegGamma = function lowRegGamma(a, x) {\n\t var aln = jStat.gammaln(a);\n\t var ap = a;\n\t var sum = 1 / a;\n\t var del = sum;\n\t var b = x + 1 - a;\n\t var c = 1 / 1.0e-30;\n\t var d = 1 / b;\n\t var h = d;\n\t var i = 1;\n\t // calculate maximum number of itterations required for a\n\t var ITMAX = -~(Math.log((a >= 1) ? a : 1 / a) * 8.5 + a * 0.4 + 17);\n\t var an, endval;\n\t\n\t if (x < 0 || a <= 0) {\n\t return NaN;\n\t } else if (x < a + 1) {\n\t for (; i <= ITMAX; i++) {\n\t sum += del *= x / ++ap;\n\t }\n\t return (sum * Math.exp(-x + a * Math.log(x) - (aln)));\n\t }\n\t\n\t for (; i <= ITMAX; i++) {\n\t an = -i * (i - a);\n\t b += 2;\n\t d = an * d + b;\n\t c = b + an / c;\n\t d = 1 / d;\n\t h *= d * c;\n\t }\n\t\n\t return (1 - h * Math.exp(-x + a * Math.log(x) - (aln)));\n\t};\n\t\n\t// natural log factorial of n\n\tjStat.factorialln = function factorialln(n) {\n\t return n < 0 ? NaN : jStat.gammaln(n + 1);\n\t};\n\t\n\t// factorial of n\n\tjStat.factorial = function factorial(n) {\n\t return n < 0 ? NaN : jStat.gammafn(n + 1);\n\t};\n\t\n\t// combinations of n, m\n\tjStat.combination = function combination(n, m) {\n\t // make sure n or m don't exceed the upper limit of usable values\n\t return (n > 170 || m > 170)\n\t ? Math.exp(jStat.combinationln(n, m))\n\t : (jStat.factorial(n) / jStat.factorial(m)) / jStat.factorial(n - m);\n\t};\n\t\n\t\n\tjStat.combinationln = function combinationln(n, m){\n\t return jStat.factorialln(n) - jStat.factorialln(m) - jStat.factorialln(n - m);\n\t};\n\t\n\t\n\t// permutations of n, m\n\tjStat.permutation = function permutation(n, m) {\n\t return jStat.factorial(n) / jStat.factorial(n - m);\n\t};\n\t\n\t\n\t// beta function\n\tjStat.betafn = function betafn(x, y) {\n\t // ensure arguments are positive\n\t if (x <= 0 || y <= 0)\n\t return undefined;\n\t // make sure x + y doesn't exceed the upper limit of usable values\n\t return (x + y > 170)\n\t ? Math.exp(jStat.betaln(x, y))\n\t : jStat.gammafn(x) * jStat.gammafn(y) / jStat.gammafn(x + y);\n\t};\n\t\n\t\n\t// natural logarithm of beta function\n\tjStat.betaln = function betaln(x, y) {\n\t return jStat.gammaln(x) + jStat.gammaln(y) - jStat.gammaln(x + y);\n\t};\n\t\n\t\n\t// Evaluates the continued fraction for incomplete beta function by modified\n\t// Lentz's method.\n\tjStat.betacf = function betacf(x, a, b) {\n\t var fpmin = 1e-30;\n\t var m = 1;\n\t var qab = a + b;\n\t var qap = a + 1;\n\t var qam = a - 1;\n\t var c = 1;\n\t var d = 1 - qab * x / qap;\n\t var m2, aa, del, h;\n\t\n\t // These q's will be used in factors that occur in the coefficients\n\t if (Math.abs(d) < fpmin)\n\t d = fpmin;\n\t d = 1 / d;\n\t h = d;\n\t\n\t for (; m <= 100; m++) {\n\t m2 = 2 * m;\n\t aa = m * (b - m) * x / ((qam + m2) * (a + m2));\n\t // One step (the even one) of the recurrence\n\t d = 1 + aa * d;\n\t if (Math.abs(d) < fpmin)\n\t d = fpmin;\n\t c = 1 + aa / c;\n\t if (Math.abs(c) < fpmin)\n\t c = fpmin;\n\t d = 1 / d;\n\t h *= d * c;\n\t aa = -(a + m) * (qab + m) * x / ((a + m2) * (qap + m2));\n\t // Next step of the recurrence (the odd one)\n\t d = 1 + aa * d;\n\t if (Math.abs(d) < fpmin)\n\t d = fpmin;\n\t c = 1 + aa / c;\n\t if (Math.abs(c) < fpmin)\n\t c = fpmin;\n\t d = 1 / d;\n\t del = d * c;\n\t h *= del;\n\t if (Math.abs(del - 1.0) < 3e-7)\n\t break;\n\t }\n\t\n\t return h;\n\t};\n\t\n\t\n\t// Returns the inverse of the lower regularized inomplete gamma function\n\tjStat.gammapinv = function gammapinv(p, a) {\n\t var j = 0;\n\t var a1 = a - 1;\n\t var EPS = 1e-8;\n\t var gln = jStat.gammaln(a);\n\t var x, err, t, u, pp, lna1, afac;\n\t\n\t if (p >= 1)\n\t return Math.max(100, a + 100 * Math.sqrt(a));\n\t if (p <= 0)\n\t return 0;\n\t if (a > 1) {\n\t lna1 = Math.log(a1);\n\t afac = Math.exp(a1 * (lna1 - 1) - gln);\n\t pp = (p < 0.5) ? p : 1 - p;\n\t t = Math.sqrt(-2 * Math.log(pp));\n\t x = (2.30753 + t * 0.27061) / (1 + t * (0.99229 + t * 0.04481)) - t;\n\t if (p < 0.5)\n\t x = -x;\n\t x = Math.max(1e-3,\n\t a * Math.pow(1 - 1 / (9 * a) - x / (3 * Math.sqrt(a)), 3));\n\t } else {\n\t t = 1 - a * (0.253 + a * 0.12);\n\t if (p < t)\n\t x = Math.pow(p / t, 1 / a);\n\t else\n\t x = 1 - Math.log(1 - (p - t) / (1 - t));\n\t }\n\t\n\t for(; j < 12; j++) {\n\t if (x <= 0)\n\t return 0;\n\t err = jStat.lowRegGamma(a, x) - p;\n\t if (a > 1)\n\t t = afac * Math.exp(-(x - a1) + a1 * (Math.log(x) - lna1));\n\t else\n\t t = Math.exp(-x + a1 * Math.log(x) - gln);\n\t u = err / t;\n\t x -= (t = u / (1 - 0.5 * Math.min(1, u * ((a - 1) / x - 1))));\n\t if (x <= 0)\n\t x = 0.5 * (x + t);\n\t if (Math.abs(t) < EPS * x)\n\t break;\n\t }\n\t\n\t return x;\n\t};\n\t\n\t\n\t// Returns the error function erf(x)\n\tjStat.erf = function erf(x) {\n\t var cof = [-1.3026537197817094, 6.4196979235649026e-1, 1.9476473204185836e-2,\n\t -9.561514786808631e-3, -9.46595344482036e-4, 3.66839497852761e-4,\n\t 4.2523324806907e-5, -2.0278578112534e-5, -1.624290004647e-6,\n\t 1.303655835580e-6, 1.5626441722e-8, -8.5238095915e-8,\n\t 6.529054439e-9, 5.059343495e-9, -9.91364156e-10,\n\t -2.27365122e-10, 9.6467911e-11, 2.394038e-12,\n\t -6.886027e-12, 8.94487e-13, 3.13092e-13,\n\t -1.12708e-13, 3.81e-16, 7.106e-15,\n\t -1.523e-15, -9.4e-17, 1.21e-16,\n\t -2.8e-17];\n\t var j = cof.length - 1;\n\t var isneg = false;\n\t var d = 0;\n\t var dd = 0;\n\t var t, ty, tmp, res;\n\t\n\t if (x < 0) {\n\t x = -x;\n\t isneg = true;\n\t }\n\t\n\t t = 2 / (2 + x);\n\t ty = 4 * t - 2;\n\t\n\t for(; j > 0; j--) {\n\t tmp = d;\n\t d = ty * d - dd + cof[j];\n\t dd = tmp;\n\t }\n\t\n\t res = t * Math.exp(-x * x + 0.5 * (cof[0] + ty * d) - dd);\n\t return isneg ? res - 1 : 1 - res;\n\t};\n\t\n\t\n\t// Returns the complmentary error function erfc(x)\n\tjStat.erfc = function erfc(x) {\n\t return 1 - jStat.erf(x);\n\t};\n\t\n\t\n\t// Returns the inverse of the complementary error function\n\tjStat.erfcinv = function erfcinv(p) {\n\t var j = 0;\n\t var x, err, t, pp;\n\t if (p >= 2)\n\t return -100;\n\t if (p <= 0)\n\t return 100;\n\t pp = (p < 1) ? p : 2 - p;\n\t t = Math.sqrt(-2 * Math.log(pp / 2));\n\t x = -0.70711 * ((2.30753 + t * 0.27061) /\n\t (1 + t * (0.99229 + t * 0.04481)) - t);\n\t for (; j < 2; j++) {\n\t err = jStat.erfc(x) - pp;\n\t x += err / (1.12837916709551257 * Math.exp(-x * x) - x * err);\n\t }\n\t return (p < 1) ? x : -x;\n\t};\n\t\n\t\n\t// Returns the inverse of the incomplete beta function\n\tjStat.ibetainv = function ibetainv(p, a, b) {\n\t var EPS = 1e-8;\n\t var a1 = a - 1;\n\t var b1 = b - 1;\n\t var j = 0;\n\t var lna, lnb, pp, t, u, err, x, al, h, w, afac;\n\t if (p <= 0)\n\t return 0;\n\t if (p >= 1)\n\t return 1;\n\t if (a >= 1 && b >= 1) {\n\t pp = (p < 0.5) ? p : 1 - p;\n\t t = Math.sqrt(-2 * Math.log(pp));\n\t x = (2.30753 + t * 0.27061) / (1 + t* (0.99229 + t * 0.04481)) - t;\n\t if (p < 0.5)\n\t x = -x;\n\t al = (x * x - 3) / 6;\n\t h = 2 / (1 / (2 * a - 1) + 1 / (2 * b - 1));\n\t w = (x * Math.sqrt(al + h) / h) - (1 / (2 * b - 1) - 1 / (2 * a - 1)) *\n\t (al + 5 / 6 - 2 / (3 * h));\n\t x = a / (a + b * Math.exp(2 * w));\n\t } else {\n\t lna = Math.log(a / (a + b));\n\t lnb = Math.log(b / (a + b));\n\t t = Math.exp(a * lna) / a;\n\t u = Math.exp(b * lnb) / b;\n\t w = t + u;\n\t if (p < t / w)\n\t x = Math.pow(a * w * p, 1 / a);\n\t else\n\t x = 1 - Math.pow(b * w * (1 - p), 1 / b);\n\t }\n\t afac = -jStat.gammaln(a) - jStat.gammaln(b) + jStat.gammaln(a + b);\n\t for(; j < 10; j++) {\n\t if (x === 0 || x === 1)\n\t return x;\n\t err = jStat.ibeta(x, a, b) - p;\n\t t = Math.exp(a1 * Math.log(x) + b1 * Math.log(1 - x) + afac);\n\t u = err / t;\n\t x -= (t = u / (1 - 0.5 * Math.min(1, u * (a1 / x - b1 / (1 - x)))));\n\t if (x <= 0)\n\t x = 0.5 * (x + t);\n\t if (x >= 1)\n\t x = 0.5 * (x + t + 1);\n\t if (Math.abs(t) < EPS * x && j > 0)\n\t break;\n\t }\n\t return x;\n\t};\n\t\n\t\n\t// Returns the incomplete beta function I_x(a,b)\n\tjStat.ibeta = function ibeta(x, a, b) {\n\t // Factors in front of the continued fraction.\n\t var bt = (x === 0 || x === 1) ? 0 :\n\t Math.exp(jStat.gammaln(a + b) - jStat.gammaln(a) -\n\t jStat.gammaln(b) + a * Math.log(x) + b *\n\t Math.log(1 - x));\n\t if (x < 0 || x > 1)\n\t return false;\n\t if (x < (a + 1) / (a + b + 2))\n\t // Use continued fraction directly.\n\t return bt * jStat.betacf(x, a, b) / a;\n\t // else use continued fraction after making the symmetry transformation.\n\t return 1 - bt * jStat.betacf(1 - x, b, a) / b;\n\t};\n\t\n\t\n\t// Returns a normal deviate (mu=0, sigma=1).\n\t// If n and m are specified it returns a object of normal deviates.\n\tjStat.randn = function randn(n, m) {\n\t var u, v, x, y, q, mat;\n\t if (!m)\n\t m = n;\n\t if (n)\n\t return jStat.create(n, m, function() { return jStat.randn(); });\n\t do {\n\t u = Math.random();\n\t v = 1.7156 * (Math.random() - 0.5);\n\t x = u - 0.449871;\n\t y = Math.abs(v) + 0.386595;\n\t q = x * x + y * (0.19600 * y - 0.25472 * x);\n\t } while (q > 0.27597 && (q > 0.27846 || v * v > -4 * Math.log(u) * u * u));\n\t return v / u;\n\t};\n\t\n\t\n\t// Returns a gamma deviate by the method of Marsaglia and Tsang.\n\tjStat.randg = function randg(shape, n, m) {\n\t var oalph = shape;\n\t var a1, a2, u, v, x, mat;\n\t if (!m)\n\t m = n;\n\t if (!shape)\n\t shape = 1;\n\t if (n) {\n\t mat = jStat.zeros(n,m);\n\t mat.alter(function() { return jStat.randg(shape); });\n\t return mat;\n\t }\n\t if (shape < 1)\n\t shape += 1;\n\t a1 = shape - 1 / 3;\n\t a2 = 1 / Math.sqrt(9 * a1);\n\t do {\n\t do {\n\t x = jStat.randn();\n\t v = 1 + a2 * x;\n\t } while(v <= 0);\n\t v = v * v * v;\n\t u = Math.random();\n\t } while(u > 1 - 0.331 * Math.pow(x, 4) &&\n\t Math.log(u) > 0.5 * x*x + a1 * (1 - v + Math.log(v)));\n\t // alpha > 1\n\t if (shape == oalph)\n\t return a1 * v;\n\t // alpha < 1\n\t do {\n\t u = Math.random();\n\t } while(u === 0);\n\t return Math.pow(u, 1 / oalph) * a1 * v;\n\t};\n\t\n\t\n\t// making use of static methods on the instance\n\t(function(funcs) {\n\t for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n\t jStat.fn[passfunc] = function() {\n\t return jStat(\n\t jStat.map(this, function(value) { return jStat[passfunc](value); }));\n\t }\n\t })(funcs[i]);\n\t})('gammaln gammafn factorial factorialln'.split(' '));\n\t\n\t\n\t(function(funcs) {\n\t for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n\t jStat.fn[passfunc] = function() {\n\t return jStat(jStat[passfunc].apply(null, arguments));\n\t };\n\t })(funcs[i]);\n\t})('randn'.split(' '));\n\t\n\t}(this.jStat, Math));\n\t(function(jStat, Math) {\n\t\n\t// generate all distribution instance methods\n\t(function(list) {\n\t for (var i = 0; i < list.length; i++) (function(func) {\n\t // distribution instance method\n\t jStat[func] = function(a, b, c) {\n\t if (!(this instanceof arguments.callee))\n\t return new arguments.callee(a, b, c);\n\t this._a = a;\n\t this._b = b;\n\t this._c = c;\n\t return this;\n\t };\n\t // distribution method to be used on a jStat instance\n\t jStat.fn[func] = function(a, b, c) {\n\t var newthis = jStat[func](a, b, c);\n\t newthis.data = this;\n\t return newthis;\n\t };\n\t // sample instance method\n\t jStat[func].prototype.sample = function(arr) {\n\t var a = this._a;\n\t var b = this._b;\n\t var c = this._c;\n\t if (arr)\n\t return jStat.alter(arr, function() {\n\t return jStat[func].sample(a, b, c);\n\t });\n\t else\n\t return jStat[func].sample(a, b, c);\n\t };\n\t // generate the pdf, cdf and inv instance methods\n\t (function(vals) {\n\t for (var i = 0; i < vals.length; i++) (function(fnfunc) {\n\t jStat[func].prototype[fnfunc] = function(x) {\n\t var a = this._a;\n\t var b = this._b;\n\t var c = this._c;\n\t if (!x && x !== 0)\n\t x = this.data;\n\t if (typeof x !== 'number') {\n\t return jStat.fn.map.call(x, function(x) {\n\t return jStat[func][fnfunc](x, a, b, c);\n\t });\n\t }\n\t return jStat[func][fnfunc](x, a, b, c);\n\t };\n\t })(vals[i]);\n\t })('pdf cdf inv'.split(' '));\n\t // generate the mean, median, mode and variance instance methods\n\t (function(vals) {\n\t for (var i = 0; i < vals.length; i++) (function(fnfunc) {\n\t jStat[func].prototype[fnfunc] = function() {\n\t return jStat[func][fnfunc](this._a, this._b, this._c);\n\t };\n\t })(vals[i]);\n\t })('mean median mode variance'.split(' '));\n\t })(list[i]);\n\t})((\n\t 'beta centralF cauchy chisquare exponential gamma invgamma kumaraswamy ' +\n\t 'laplace lognormal noncentralt normal pareto studentt weibull uniform ' +\n\t 'binomial negbin hypgeom poisson triangular'\n\t).split(' '));\n\t\n\t\n\t\n\t// extend beta function with static methods\n\tjStat.extend(jStat.beta, {\n\t pdf: function pdf(x, alpha, beta) {\n\t // PDF is zero outside the support\n\t if (x > 1 || x < 0)\n\t return 0;\n\t // PDF is one for the uniform case\n\t if (alpha == 1 && beta == 1)\n\t return 1;\n\t\n\t if (alpha < 512 && beta < 512) {\n\t return (Math.pow(x, alpha - 1) * Math.pow(1 - x, beta - 1)) /\n\t jStat.betafn(alpha, beta);\n\t } else {\n\t return Math.exp((alpha - 1) * Math.log(x) +\n\t (beta - 1) * Math.log(1 - x) -\n\t jStat.betaln(alpha, beta));\n\t }\n\t },\n\t\n\t cdf: function cdf(x, alpha, beta) {\n\t return (x > 1 || x < 0) ? (x > 1) * 1 : jStat.ibeta(x, alpha, beta);\n\t },\n\t\n\t inv: function inv(x, alpha, beta) {\n\t return jStat.ibetainv(x, alpha, beta);\n\t },\n\t\n\t mean: function mean(alpha, beta) {\n\t return alpha / (alpha + beta);\n\t },\n\t\n\t median: function median(alpha, beta) {\n\t return jStat.ibetainv(0.5, alpha, beta);\n\t },\n\t\n\t mode: function mode(alpha, beta) {\n\t return (alpha - 1 ) / ( alpha + beta - 2);\n\t },\n\t\n\t // return a random sample\n\t sample: function sample(alpha, beta) {\n\t var u = jStat.randg(alpha);\n\t return u / (u + jStat.randg(beta));\n\t },\n\t\n\t variance: function variance(alpha, beta) {\n\t return (alpha * beta) / (Math.pow(alpha + beta, 2) * (alpha + beta + 1));\n\t }\n\t});\n\t\n\t// extend F function with static methods\n\tjStat.extend(jStat.centralF, {\n\t // This implementation of the pdf function avoids float overflow\n\t // See the way that R calculates this value:\n\t // https://svn.r-project.org/R/trunk/src/nmath/df.c\n\t pdf: function pdf(x, df1, df2) {\n\t var p, q, f;\n\t\n\t if (x < 0)\n\t return 0;\n\t\n\t if (df1 <= 2) {\n\t if (x === 0 && df1 < 2) {\n\t return Infinity;\n\t }\n\t if (x === 0 && df1 === 2) {\n\t return 1;\n\t }\n\t return Math.sqrt((Math.pow(df1 * x, df1) * Math.pow(df2, df2)) /\n\t (Math.pow(df1 * x + df2, df1 + df2))) /\n\t (x * jStat.betafn(df1/2, df2/2));\n\t }\n\t\n\t p = (df1 * x) / (df2 + x * df1);\n\t q = df2 / (df2 + x * df1);\n\t f = df1 * q / 2.0;\n\t return f * jStat.binomial.pdf((df1 - 2) / 2, (df1 + df2 - 2) / 2, p);\n\t },\n\t\n\t cdf: function cdf(x, df1, df2) {\n\t if (x < 0)\n\t return 0;\n\t return jStat.ibeta((df1 * x) / (df1 * x + df2), df1 / 2, df2 / 2);\n\t },\n\t\n\t inv: function inv(x, df1, df2) {\n\t return df2 / (df1 * (1 / jStat.ibetainv(x, df1 / 2, df2 / 2) - 1));\n\t },\n\t\n\t mean: function mean(df1, df2) {\n\t return (df2 > 2) ? df2 / (df2 - 2) : undefined;\n\t },\n\t\n\t mode: function mode(df1, df2) {\n\t return (df1 > 2) ? (df2 * (df1 - 2)) / (df1 * (df2 + 2)) : undefined;\n\t },\n\t\n\t // return a random sample\n\t sample: function sample(df1, df2) {\n\t var x1 = jStat.randg(df1 / 2) * 2;\n\t var x2 = jStat.randg(df2 / 2) * 2;\n\t return (x1 / df1) / (x2 / df2);\n\t },\n\t\n\t variance: function variance(df1, df2) {\n\t if (df2 <= 4)\n\t return undefined;\n\t return 2 * df2 * df2 * (df1 + df2 - 2) /\n\t (df1 * (df2 - 2) * (df2 - 2) * (df2 - 4));\n\t }\n\t});\n\t\n\t\n\t// extend cauchy function with static methods\n\tjStat.extend(jStat.cauchy, {\n\t pdf: function pdf(x, local, scale) {\n\t if (scale < 0) { return 0; }\n\t\n\t return (scale / (Math.pow(x - local, 2) + Math.pow(scale, 2))) / Math.PI;\n\t },\n\t\n\t cdf: function cdf(x, local, scale) {\n\t return Math.atan((x - local) / scale) / Math.PI + 0.5;\n\t },\n\t\n\t inv: function(p, local, scale) {\n\t return local + scale * Math.tan(Math.PI * (p - 0.5));\n\t },\n\t\n\t median: function median(local, scale) {\n\t return local;\n\t },\n\t\n\t mode: function mode(local, scale) {\n\t return local;\n\t },\n\t\n\t sample: function sample(local, scale) {\n\t return jStat.randn() *\n\t Math.sqrt(1 / (2 * jStat.randg(0.5))) * scale + local;\n\t }\n\t});\n\t\n\t\n\t\n\t// extend chisquare function with static methods\n\tjStat.extend(jStat.chisquare, {\n\t pdf: function pdf(x, dof) {\n\t if (x < 0)\n\t return 0;\n\t return (x === 0 && dof === 2) ? 0.5 :\n\t Math.exp((dof / 2 - 1) * Math.log(x) - x / 2 - (dof / 2) *\n\t Math.log(2) - jStat.gammaln(dof / 2));\n\t },\n\t\n\t cdf: function cdf(x, dof) {\n\t if (x < 0)\n\t return 0;\n\t return jStat.lowRegGamma(dof / 2, x / 2);\n\t },\n\t\n\t inv: function(p, dof) {\n\t return 2 * jStat.gammapinv(p, 0.5 * dof);\n\t },\n\t\n\t mean : function(dof) {\n\t return dof;\n\t },\n\t\n\t // TODO: this is an approximation (is there a better way?)\n\t median: function median(dof) {\n\t return dof * Math.pow(1 - (2 / (9 * dof)), 3);\n\t },\n\t\n\t mode: function mode(dof) {\n\t return (dof - 2 > 0) ? dof - 2 : 0;\n\t },\n\t\n\t sample: function sample(dof) {\n\t return jStat.randg(dof / 2) * 2;\n\t },\n\t\n\t variance: function variance(dof) {\n\t return 2 * dof;\n\t }\n\t});\n\t\n\t\n\t\n\t// extend exponential function with static methods\n\tjStat.extend(jStat.exponential, {\n\t pdf: function pdf(x, rate) {\n\t return x < 0 ? 0 : rate * Math.exp(-rate * x);\n\t },\n\t\n\t cdf: function cdf(x, rate) {\n\t return x < 0 ? 0 : 1 - Math.exp(-rate * x);\n\t },\n\t\n\t inv: function(p, rate) {\n\t return -Math.log(1 - p) / rate;\n\t },\n\t\n\t mean : function(rate) {\n\t return 1 / rate;\n\t },\n\t\n\t median: function (rate) {\n\t return (1 / rate) * Math.log(2);\n\t },\n\t\n\t mode: function mode(rate) {\n\t return 0;\n\t },\n\t\n\t sample: function sample(rate) {\n\t return -1 / rate * Math.log(Math.random());\n\t },\n\t\n\t variance : function(rate) {\n\t return Math.pow(rate, -2);\n\t }\n\t});\n\t\n\t\n\t\n\t// extend gamma function with static methods\n\tjStat.extend(jStat.gamma, {\n\t pdf: function pdf(x, shape, scale) {\n\t if (x < 0)\n\t return 0;\n\t return (x === 0 && shape === 1) ? 1 / scale :\n\t Math.exp((shape - 1) * Math.log(x) - x / scale -\n\t jStat.gammaln(shape) - shape * Math.log(scale));\n\t },\n\t\n\t cdf: function cdf(x, shape, scale) {\n\t if (x < 0)\n\t return 0;\n\t return jStat.lowRegGamma(shape, x / scale);\n\t },\n\t\n\t inv: function(p, shape, scale) {\n\t return jStat.gammapinv(p, shape) * scale;\n\t },\n\t\n\t mean : function(shape, scale) {\n\t return shape * scale;\n\t },\n\t\n\t mode: function mode(shape, scale) {\n\t if(shape > 1) return (shape - 1) * scale;\n\t return undefined;\n\t },\n\t\n\t sample: function sample(shape, scale) {\n\t return jStat.randg(shape) * scale;\n\t },\n\t\n\t variance: function variance(shape, scale) {\n\t return shape * scale * scale;\n\t }\n\t});\n\t\n\t// extend inverse gamma function with static methods\n\tjStat.extend(jStat.invgamma, {\n\t pdf: function pdf(x, shape, scale) {\n\t if (x <= 0)\n\t return 0;\n\t return Math.exp(-(shape + 1) * Math.log(x) - scale / x -\n\t jStat.gammaln(shape) + shape * Math.log(scale));\n\t },\n\t\n\t cdf: function cdf(x, shape, scale) {\n\t if (x <= 0)\n\t return 0;\n\t return 1 - jStat.lowRegGamma(shape, scale / x);\n\t },\n\t\n\t inv: function(p, shape, scale) {\n\t return scale / jStat.gammapinv(1 - p, shape);\n\t },\n\t\n\t mean : function(shape, scale) {\n\t return (shape > 1) ? scale / (shape - 1) : undefined;\n\t },\n\t\n\t mode: function mode(shape, scale) {\n\t return scale / (shape + 1);\n\t },\n\t\n\t sample: function sample(shape, scale) {\n\t return scale / jStat.randg(shape);\n\t },\n\t\n\t variance: function variance(shape, scale) {\n\t if (shape <= 2)\n\t return undefined;\n\t return scale * scale / ((shape - 1) * (shape - 1) * (shape - 2));\n\t }\n\t});\n\t\n\t\n\t// extend kumaraswamy function with static methods\n\tjStat.extend(jStat.kumaraswamy, {\n\t pdf: function pdf(x, alpha, beta) {\n\t if (x === 0 && alpha === 1)\n\t return beta;\n\t else if (x === 1 && beta === 1)\n\t return alpha;\n\t return Math.exp(Math.log(alpha) + Math.log(beta) + (alpha - 1) *\n\t Math.log(x) + (beta - 1) *\n\t Math.log(1 - Math.pow(x, alpha)));\n\t },\n\t\n\t cdf: function cdf(x, alpha, beta) {\n\t if (x < 0)\n\t return 0;\n\t else if (x > 1)\n\t return 1;\n\t return (1 - Math.pow(1 - Math.pow(x, alpha), beta));\n\t },\n\t\n\t inv: function inv(p, alpha, beta) {\n\t return Math.pow(1 - Math.pow(1 - p, 1 / beta), 1 / alpha);\n\t },\n\t\n\t mean : function(alpha, beta) {\n\t return (beta * jStat.gammafn(1 + 1 / alpha) *\n\t jStat.gammafn(beta)) / (jStat.gammafn(1 + 1 / alpha + beta));\n\t },\n\t\n\t median: function median(alpha, beta) {\n\t return Math.pow(1 - Math.pow(2, -1 / beta), 1 / alpha);\n\t },\n\t\n\t mode: function mode(alpha, beta) {\n\t if (!(alpha >= 1 && beta >= 1 && (alpha !== 1 && beta !== 1)))\n\t return undefined;\n\t return Math.pow((alpha - 1) / (alpha * beta - 1), 1 / alpha);\n\t },\n\t\n\t variance: function variance(alpha, beta) {\n\t throw new Error('variance not yet implemented');\n\t // TODO: complete this\n\t }\n\t});\n\t\n\t\n\t\n\t// extend lognormal function with static methods\n\tjStat.extend(jStat.lognormal, {\n\t pdf: function pdf(x, mu, sigma) {\n\t if (x <= 0)\n\t return 0;\n\t return Math.exp(-Math.log(x) - 0.5 * Math.log(2 * Math.PI) -\n\t Math.log(sigma) - Math.pow(Math.log(x) - mu, 2) /\n\t (2 * sigma * sigma));\n\t },\n\t\n\t cdf: function cdf(x, mu, sigma) {\n\t if (x < 0)\n\t return 0;\n\t return 0.5 +\n\t (0.5 * jStat.erf((Math.log(x) - mu) / Math.sqrt(2 * sigma * sigma)));\n\t },\n\t\n\t inv: function(p, mu, sigma) {\n\t return Math.exp(-1.41421356237309505 * sigma * jStat.erfcinv(2 * p) + mu);\n\t },\n\t\n\t mean: function mean(mu, sigma) {\n\t return Math.exp(mu + sigma * sigma / 2);\n\t },\n\t\n\t median: function median(mu, sigma) {\n\t return Math.exp(mu);\n\t },\n\t\n\t mode: function mode(mu, sigma) {\n\t return Math.exp(mu - sigma * sigma);\n\t },\n\t\n\t sample: function sample(mu, sigma) {\n\t return Math.exp(jStat.randn() * sigma + mu);\n\t },\n\t\n\t variance: function variance(mu, sigma) {\n\t return (Math.exp(sigma * sigma) - 1) * Math.exp(2 * mu + sigma * sigma);\n\t }\n\t});\n\t\n\t\n\t\n\t// extend noncentralt function with static methods\n\tjStat.extend(jStat.noncentralt, {\n\t pdf: function pdf(x, dof, ncp) {\n\t var tol = 1e-14;\n\t if (Math.abs(ncp) < tol) // ncp approx 0; use student-t\n\t return jStat.studentt.pdf(x, dof)\n\t\n\t if (Math.abs(x) < tol) { // different formula for x == 0\n\t return Math.exp(jStat.gammaln((dof + 1) / 2) - ncp * ncp / 2 -\n\t 0.5 * Math.log(Math.PI * dof) - jStat.gammaln(dof / 2));\n\t }\n\t\n\t // formula for x != 0\n\t return dof / x *\n\t (jStat.noncentralt.cdf(x * Math.sqrt(1 + 2 / dof), dof+2, ncp) -\n\t jStat.noncentralt.cdf(x, dof, ncp));\n\t },\n\t\n\t cdf: function cdf(x, dof, ncp) {\n\t var tol = 1e-14;\n\t var min_iterations = 200;\n\t\n\t if (Math.abs(ncp) < tol) // ncp approx 0; use student-t\n\t return jStat.studentt.cdf(x, dof);\n\t\n\t // turn negative x into positive and flip result afterwards\n\t var flip = false;\n\t if (x < 0) {\n\t flip = true;\n\t ncp = -ncp;\n\t }\n\t\n\t var prob = jStat.normal.cdf(-ncp, 0, 1);\n\t var value = tol + 1;\n\t // use value at last two steps to determine convergence\n\t var lastvalue = value;\n\t var y = x * x / (x * x + dof);\n\t var j = 0;\n\t var p = Math.exp(-ncp * ncp / 2);\n\t var q = Math.exp(-ncp * ncp / 2 - 0.5 * Math.log(2) -\n\t jStat.gammaln(3 / 2)) * ncp;\n\t while (j < min_iterations || lastvalue > tol || value > tol) {\n\t lastvalue = value;\n\t if (j > 0) {\n\t p *= (ncp * ncp) / (2 * j);\n\t q *= (ncp * ncp) / (2 * (j + 1 / 2));\n\t }\n\t value = p * jStat.beta.cdf(y, j + 0.5, dof / 2) +\n\t q * jStat.beta.cdf(y, j+1, dof/2);\n\t prob += 0.5 * value;\n\t j++;\n\t }\n\t\n\t return flip ? (1 - prob) : prob;\n\t }\n\t});\n\t\n\t\n\t// extend normal function with static methods\n\tjStat.extend(jStat.normal, {\n\t pdf: function pdf(x, mean, std) {\n\t return Math.exp(-0.5 * Math.log(2 * Math.PI) -\n\t Math.log(std) - Math.pow(x - mean, 2) / (2 * std * std));\n\t },\n\t\n\t cdf: function cdf(x, mean, std) {\n\t return 0.5 * (1 + jStat.erf((x - mean) / Math.sqrt(2 * std * std)));\n\t },\n\t\n\t inv: function(p, mean, std) {\n\t return -1.41421356237309505 * std * jStat.erfcinv(2 * p) + mean;\n\t },\n\t\n\t mean : function(mean, std) {\n\t return mean;\n\t },\n\t\n\t median: function median(mean, std) {\n\t return mean;\n\t },\n\t\n\t mode: function (mean, std) {\n\t return mean;\n\t },\n\t\n\t sample: function sample(mean, std) {\n\t return jStat.randn() * std + mean;\n\t },\n\t\n\t variance : function(mean, std) {\n\t return std * std;\n\t }\n\t});\n\t\n\t\n\t\n\t// extend pareto function with static methods\n\tjStat.extend(jStat.pareto, {\n\t pdf: function pdf(x, scale, shape) {\n\t if (x < scale)\n\t return 0;\n\t return (shape * Math.pow(scale, shape)) / Math.pow(x, shape + 1);\n\t },\n\t\n\t cdf: function cdf(x, scale, shape) {\n\t if (x < scale)\n\t return 0;\n\t return 1 - Math.pow(scale / x, shape);\n\t },\n\t\n\t inv: function inv(p, scale, shape) {\n\t return scale / Math.pow(1 - p, 1 / shape);\n\t },\n\t\n\t mean: function mean(scale, shape) {\n\t if (shape <= 1)\n\t return undefined;\n\t return (shape * Math.pow(scale, shape)) / (shape - 1);\n\t },\n\t\n\t median: function median(scale, shape) {\n\t return scale * (shape * Math.SQRT2);\n\t },\n\t\n\t mode: function mode(scale, shape) {\n\t return scale;\n\t },\n\t\n\t variance : function(scale, shape) {\n\t if (shape <= 2)\n\t return undefined;\n\t return (scale*scale * shape) / (Math.pow(shape - 1, 2) * (shape - 2));\n\t }\n\t});\n\t\n\t\n\t\n\t// extend studentt function with static methods\n\tjStat.extend(jStat.studentt, {\n\t pdf: function pdf(x, dof) {\n\t dof = dof > 1e100 ? 1e100 : dof;\n\t return (1/(Math.sqrt(dof) * jStat.betafn(0.5, dof/2))) *\n\t Math.pow(1 + ((x * x) / dof), -((dof + 1) / 2));\n\t },\n\t\n\t cdf: function cdf(x, dof) {\n\t var dof2 = dof / 2;\n\t return jStat.ibeta((x + Math.sqrt(x * x + dof)) /\n\t (2 * Math.sqrt(x * x + dof)), dof2, dof2);\n\t },\n\t\n\t inv: function(p, dof) {\n\t var x = jStat.ibetainv(2 * Math.min(p, 1 - p), 0.5 * dof, 0.5);\n\t x = Math.sqrt(dof * (1 - x) / x);\n\t return (p > 0.5) ? x : -x;\n\t },\n\t\n\t mean: function mean(dof) {\n\t return (dof > 1) ? 0 : undefined;\n\t },\n\t\n\t median: function median(dof) {\n\t return 0;\n\t },\n\t\n\t mode: function mode(dof) {\n\t return 0;\n\t },\n\t\n\t sample: function sample(dof) {\n\t return jStat.randn() * Math.sqrt(dof / (2 * jStat.randg(dof / 2)));\n\t },\n\t\n\t variance: function variance(dof) {\n\t return (dof > 2) ? dof / (dof - 2) : (dof > 1) ? Infinity : undefined;\n\t }\n\t});\n\t\n\t\n\t\n\t// extend weibull function with static methods\n\tjStat.extend(jStat.weibull, {\n\t pdf: function pdf(x, scale, shape) {\n\t if (x < 0 || scale < 0 || shape < 0)\n\t return 0;\n\t return (shape / scale) * Math.pow((x / scale), (shape - 1)) *\n\t Math.exp(-(Math.pow((x / scale), shape)));\n\t },\n\t\n\t cdf: function cdf(x, scale, shape) {\n\t return x < 0 ? 0 : 1 - Math.exp(-Math.pow((x / scale), shape));\n\t },\n\t\n\t inv: function(p, scale, shape) {\n\t return scale * Math.pow(-Math.log(1 - p), 1 / shape);\n\t },\n\t\n\t mean : function(scale, shape) {\n\t return scale * jStat.gammafn(1 + 1 / shape);\n\t },\n\t\n\t median: function median(scale, shape) {\n\t return scale * Math.pow(Math.log(2), 1 / shape);\n\t },\n\t\n\t mode: function mode(scale, shape) {\n\t if (shape <= 1)\n\t return 0;\n\t return scale * Math.pow((shape - 1) / shape, 1 / shape);\n\t },\n\t\n\t sample: function sample(scale, shape) {\n\t return scale * Math.pow(-Math.log(Math.random()), 1 / shape);\n\t },\n\t\n\t variance: function variance(scale, shape) {\n\t return scale * scale * jStat.gammafn(1 + 2 / shape) -\n\t Math.pow(jStat.weibull.mean(scale, shape), 2);\n\t }\n\t});\n\t\n\t\n\t\n\t// extend uniform function with static methods\n\tjStat.extend(jStat.uniform, {\n\t pdf: function pdf(x, a, b) {\n\t return (x < a || x > b) ? 0 : 1 / (b - a);\n\t },\n\t\n\t cdf: function cdf(x, a, b) {\n\t if (x < a)\n\t return 0;\n\t else if (x < b)\n\t return (x - a) / (b - a);\n\t return 1;\n\t },\n\t\n\t inv: function(p, a, b) {\n\t return a + (p * (b - a));\n\t },\n\t\n\t mean: function mean(a, b) {\n\t return 0.5 * (a + b);\n\t },\n\t\n\t median: function median(a, b) {\n\t return jStat.mean(a, b);\n\t },\n\t\n\t mode: function mode(a, b) {\n\t throw new Error('mode is not yet implemented');\n\t },\n\t\n\t sample: function sample(a, b) {\n\t return (a / 2 + b / 2) + (b / 2 - a / 2) * (2 * Math.random() - 1);\n\t },\n\t\n\t variance: function variance(a, b) {\n\t return Math.pow(b - a, 2) / 12;\n\t }\n\t});\n\t\n\t\n\t\n\t// extend uniform function with static methods\n\tjStat.extend(jStat.binomial, {\n\t pdf: function pdf(k, n, p) {\n\t return (p === 0 || p === 1) ?\n\t ((n * p) === k ? 1 : 0) :\n\t jStat.combination(n, k) * Math.pow(p, k) * Math.pow(1 - p, n - k);\n\t },\n\t\n\t cdf: function cdf(x, n, p) {\n\t var binomarr = [],\n\t k = 0;\n\t if (x < 0) {\n\t return 0;\n\t }\n\t if (x < n) {\n\t for (; k <= x; k++) {\n\t binomarr[ k ] = jStat.binomial.pdf(k, n, p);\n\t }\n\t return jStat.sum(binomarr);\n\t }\n\t return 1;\n\t }\n\t});\n\t\n\t\n\t\n\t// extend uniform function with static methods\n\tjStat.extend(jStat.negbin, {\n\t pdf: function pdf(k, r, p) {\n\t if (k !== k >>> 0)\n\t return false;\n\t if (k < 0)\n\t return 0;\n\t return jStat.combination(k + r - 1, r - 1) *\n\t Math.pow(1 - p, k) * Math.pow(p, r);\n\t },\n\t\n\t cdf: function cdf(x, r, p) {\n\t var sum = 0,\n\t k = 0;\n\t if (x < 0) return 0;\n\t for (; k <= x; k++) {\n\t sum += jStat.negbin.pdf(k, r, p);\n\t }\n\t return sum;\n\t }\n\t});\n\t\n\t\n\t\n\t// extend uniform function with static methods\n\tjStat.extend(jStat.hypgeom, {\n\t pdf: function pdf(k, N, m, n) {\n\t // Hypergeometric PDF.\n\t\n\t // A simplification of the CDF algorithm below.\n\t\n\t // k = number of successes drawn\n\t // N = population size\n\t // m = number of successes in population\n\t // n = number of items drawn from population\n\t\n\t if(k !== k | 0) {\n\t return false;\n\t } else if(k < 0 || k < m - (N - n)) {\n\t // It's impossible to have this few successes drawn.\n\t return 0;\n\t } else if(k > n || k > m) {\n\t // It's impossible to have this many successes drawn.\n\t return 0;\n\t } else if (m * 2 > N) {\n\t // More than half the population is successes.\n\t\n\t if(n * 2 > N) {\n\t // More than half the population is sampled.\n\t\n\t return jStat.hypgeom.pdf(N - m - n + k, N, N - m, N - n)\n\t } else {\n\t // Half or less of the population is sampled.\n\t\n\t return jStat.hypgeom.pdf(n - k, N, N - m, n);\n\t }\n\t\n\t } else if(n * 2 > N) {\n\t // Half or less is successes.\n\t\n\t return jStat.hypgeom.pdf(m - k, N, m, N - n);\n\t\n\t } else if(m < n) {\n\t // We want to have the number of things sampled to be less than the\n\t // successes available. So swap the definitions of successful and sampled.\n\t return jStat.hypgeom.pdf(k, N, n, m);\n\t } else {\n\t // If we get here, half or less of the population was sampled, half or\n\t // less of it was successes, and we had fewer sampled things than\n\t // successes. Now we can do this complicated iterative algorithm in an\n\t // efficient way.\n\t\n\t // The basic premise of the algorithm is that we partially normalize our\n\t // intermediate product to keep it in a numerically good region, and then\n\t // finish the normalization at the end.\n\t\n\t // This variable holds the scaled probability of the current number of\n\t // successes.\n\t var scaledPDF = 1;\n\t\n\t // This keeps track of how much we have normalized.\n\t var samplesDone = 0;\n\t\n\t for(var i = 0; i < k; i++) {\n\t // For every possible number of successes up to that observed...\n\t\n\t while(scaledPDF > 1 && samplesDone < n) {\n\t // Intermediate result is growing too big. Apply some of the\n\t // normalization to shrink everything.\n\t\n\t scaledPDF *= 1 - (m / (N - samplesDone));\n\t\n\t // Say we've normalized by this sample already.\n\t samplesDone++;\n\t }\n\t\n\t // Work out the partially-normalized hypergeometric PDF for the next\n\t // number of successes\n\t scaledPDF *= (n - i) * (m - i) / ((i + 1) * (N - m - n + i + 1));\n\t }\n\t\n\t for(; samplesDone < n; samplesDone++) {\n\t // Apply all the rest of the normalization\n\t scaledPDF *= 1 - (m / (N - samplesDone));\n\t }\n\t\n\t // Bound answer sanely before returning.\n\t return Math.min(1, Math.max(0, scaledPDF));\n\t }\n\t },\n\t\n\t cdf: function cdf(x, N, m, n) {\n\t // Hypergeometric CDF.\n\t\n\t // This algorithm is due to Prof. Thomas S. Ferguson, ,\n\t // and comes from his hypergeometric test calculator at\n\t // .\n\t\n\t // x = number of successes drawn\n\t // N = population size\n\t // m = number of successes in population\n\t // n = number of items drawn from population\n\t\n\t if(x < 0 || x < m - (N - n)) {\n\t // It's impossible to have this few successes drawn or fewer.\n\t return 0;\n\t } else if(x >= n || x >= m) {\n\t // We will always have this many successes or fewer.\n\t return 1;\n\t } else if (m * 2 > N) {\n\t // More than half the population is successes.\n\t\n\t if(n * 2 > N) {\n\t // More than half the population is sampled.\n\t\n\t return jStat.hypgeom.cdf(N - m - n + x, N, N - m, N - n)\n\t } else {\n\t // Half or less of the population is sampled.\n\t\n\t return 1 - jStat.hypgeom.cdf(n - x - 1, N, N - m, n);\n\t }\n\t\n\t } else if(n * 2 > N) {\n\t // Half or less is successes.\n\t\n\t return 1 - jStat.hypgeom.cdf(m - x - 1, N, m, N - n);\n\t\n\t } else if(m < n) {\n\t // We want to have the number of things sampled to be less than the\n\t // successes available. So swap the definitions of successful and sampled.\n\t return jStat.hypgeom.cdf(x, N, n, m);\n\t } else {\n\t // If we get here, half or less of the population was sampled, half or\n\t // less of it was successes, and we had fewer sampled things than\n\t // successes. Now we can do this complicated iterative algorithm in an\n\t // efficient way.\n\t\n\t // The basic premise of the algorithm is that we partially normalize our\n\t // intermediate sum to keep it in a numerically good region, and then\n\t // finish the normalization at the end.\n\t\n\t // Holds the intermediate, scaled total CDF.\n\t var scaledCDF = 1;\n\t\n\t // This variable holds the scaled probability of the current number of\n\t // successes.\n\t var scaledPDF = 1;\n\t\n\t // This keeps track of how much we have normalized.\n\t var samplesDone = 0;\n\t\n\t for(var i = 0; i < x; i++) {\n\t // For every possible number of successes up to that observed...\n\t\n\t while(scaledCDF > 1 && samplesDone < n) {\n\t // Intermediate result is growing too big. Apply some of the\n\t // normalization to shrink everything.\n\t\n\t var factor = 1 - (m / (N - samplesDone));\n\t\n\t scaledPDF *= factor;\n\t scaledCDF *= factor;\n\t\n\t // Say we've normalized by this sample already.\n\t samplesDone++;\n\t }\n\t\n\t // Work out the partially-normalized hypergeometric PDF for the next\n\t // number of successes\n\t scaledPDF *= (n - i) * (m - i) / ((i + 1) * (N - m - n + i + 1));\n\t\n\t // Add to the CDF answer.\n\t scaledCDF += scaledPDF;\n\t }\n\t\n\t for(; samplesDone < n; samplesDone++) {\n\t // Apply all the rest of the normalization\n\t scaledCDF *= 1 - (m / (N - samplesDone));\n\t }\n\t\n\t // Bound answer sanely before returning.\n\t return Math.min(1, Math.max(0, scaledCDF));\n\t }\n\t }\n\t});\n\t\n\t\n\t\n\t// extend uniform function with static methods\n\tjStat.extend(jStat.poisson, {\n\t pdf: function pdf(k, l) {\n\t if (l < 0 || (k % 1) !== 0 || k < 0) {\n\t return 0;\n\t }\n\t\n\t return Math.pow(l, k) * Math.exp(-l) / jStat.factorial(k);\n\t },\n\t\n\t cdf: function cdf(x, l) {\n\t var sumarr = [],\n\t k = 0;\n\t if (x < 0) return 0;\n\t for (; k <= x; k++) {\n\t sumarr.push(jStat.poisson.pdf(k, l));\n\t }\n\t return jStat.sum(sumarr);\n\t },\n\t\n\t mean : function(l) {\n\t return l;\n\t },\n\t\n\t variance : function(l) {\n\t return l;\n\t },\n\t\n\t sample: function sample(l) {\n\t var p = 1, k = 0, L = Math.exp(-l);\n\t do {\n\t k++;\n\t p *= Math.random();\n\t } while (p > L);\n\t return k - 1;\n\t }\n\t});\n\t\n\t// extend triangular function with static methods\n\tjStat.extend(jStat.triangular, {\n\t pdf: function pdf(x, a, b, c) {\n\t if (b <= a || c < a || c > b) {\n\t return NaN;\n\t } else {\n\t if (x < a || x > b) {\n\t return 0;\n\t } else if (x < c) {\n\t return (2 * (x - a)) / ((b - a) * (c - a));\n\t } else if (x === c) {\n\t return (2 / (b - a));\n\t } else { // x > c\n\t return (2 * (b - x)) / ((b - a) * (b - c));\n\t }\n\t }\n\t },\n\t\n\t cdf: function cdf(x, a, b, c) {\n\t if (b <= a || c < a || c > b)\n\t return NaN;\n\t if (x <= a)\n\t return 0;\n\t else if (x >= b)\n\t return 1;\n\t if (x <= c)\n\t return Math.pow(x - a, 2) / ((b - a) * (c - a));\n\t else // x > c\n\t return 1 - Math.pow(b - x, 2) / ((b - a) * (b - c));\n\t },\n\t\n\t inv: function inv(p, a, b, c) {\n\t if (b <= a || c < a || c > b) {\n\t return NaN;\n\t } else {\n\t if (p <= ((c - a) / (b - a))) {\n\t return a + (b - a) * Math.sqrt(p * ((c - a) / (b - a)));\n\t } else { // p > ((c - a) / (b - a))\n\t return a + (b - a) * (1 - Math.sqrt((1 - p) * (1 - ((c - a) / (b - a)))));\n\t }\n\t }\n\t },\n\t\n\t mean: function mean(a, b, c) {\n\t return (a + b + c) / 3;\n\t },\n\t\n\t median: function median(a, b, c) {\n\t if (c <= (a + b) / 2) {\n\t return b - Math.sqrt((b - a) * (b - c)) / Math.sqrt(2);\n\t } else if (c > (a + b) / 2) {\n\t return a + Math.sqrt((b - a) * (c - a)) / Math.sqrt(2);\n\t }\n\t },\n\t\n\t mode: function mode(a, b, c) {\n\t return c;\n\t },\n\t\n\t sample: function sample(a, b, c) {\n\t var u = Math.random();\n\t if (u < ((c - a) / (b - a)))\n\t return a + Math.sqrt(u * (b - a) * (c - a))\n\t return b - Math.sqrt((1 - u) * (b - a) * (b - c));\n\t },\n\t\n\t variance: function variance(a, b, c) {\n\t return (a * a + b * b + c * c - a * b - a * c - b * c) / 18;\n\t }\n\t});\n\t\n\tfunction laplaceSign(x) { return x / Math.abs(x); }\n\t\n\tjStat.extend(jStat.laplace, {\n\t pdf: function pdf(x, mu, b) {\n\t return (b <= 0) ? 0 : (Math.exp(-Math.abs(x - mu) / b)) / (2 * b);\n\t },\n\t\n\t cdf: function cdf(x, mu, b) {\n\t if (b <= 0) { return 0; }\n\t\n\t if(x < mu) {\n\t return 0.5 * Math.exp((x - mu) / b);\n\t } else {\n\t return 1 - 0.5 * Math.exp(- (x - mu) / b);\n\t }\n\t },\n\t\n\t mean: function(mu, b) {\n\t return mu;\n\t },\n\t\n\t median: function(mu, b) {\n\t return mu;\n\t },\n\t\n\t mode: function(mu, b) {\n\t return mu;\n\t },\n\t\n\t variance: function(mu, b) {\n\t return 2 * b * b;\n\t },\n\t\n\t sample: function sample(mu, b) {\n\t var u = Math.random() - 0.5;\n\t\n\t return mu - (b * laplaceSign(u) * Math.log(1 - (2 * Math.abs(u))));\n\t }\n\t});\n\t\n\t}(this.jStat, Math));\n\t/* Provides functions for the solution of linear system of equations, integration, extrapolation,\n\t * interpolation, eigenvalue problems, differential equations and PCA analysis. */\n\t\n\t(function(jStat, Math) {\n\t\n\tvar push = Array.prototype.push;\n\tvar isArray = jStat.utils.isArray;\n\t\n\tfunction isUsable(arg) {\n\t return isArray(arg) || arg instanceof jStat;\n\t}\n\t\n\tjStat.extend({\n\t\n\t // add a vector/matrix to a vector/matrix or scalar\n\t add: function add(arr, arg) {\n\t // check if arg is a vector or scalar\n\t if (isUsable(arg)) {\n\t if (!isUsable(arg[0])) arg = [ arg ];\n\t return jStat.map(arr, function(value, row, col) {\n\t return value + arg[row][col];\n\t });\n\t }\n\t return jStat.map(arr, function(value) { return value + arg; });\n\t },\n\t\n\t // subtract a vector or scalar from the vector\n\t subtract: function subtract(arr, arg) {\n\t // check if arg is a vector or scalar\n\t if (isUsable(arg)) {\n\t if (!isUsable(arg[0])) arg = [ arg ];\n\t return jStat.map(arr, function(value, row, col) {\n\t return value - arg[row][col] || 0;\n\t });\n\t }\n\t return jStat.map(arr, function(value) { return value - arg; });\n\t },\n\t\n\t // matrix division\n\t divide: function divide(arr, arg) {\n\t if (isUsable(arg)) {\n\t if (!isUsable(arg[0])) arg = [ arg ];\n\t return jStat.multiply(arr, jStat.inv(arg));\n\t }\n\t return jStat.map(arr, function(value) { return value / arg; });\n\t },\n\t\n\t // matrix multiplication\n\t multiply: function multiply(arr, arg) {\n\t var row, col, nrescols, sum, nrow, ncol, res, rescols;\n\t // eg: arr = 2 arg = 3 -> 6 for res[0][0] statement closure\n\t if (arr.length === undefined && arg.length === undefined) {\n\t return arr * arg;\n\t }\n\t nrow = arr.length,\n\t ncol = arr[0].length,\n\t res = jStat.zeros(nrow, nrescols = (isUsable(arg)) ? arg[0].length : ncol),\n\t rescols = 0;\n\t if (isUsable(arg)) {\n\t for (; rescols < nrescols; rescols++) {\n\t for (row = 0; row < nrow; row++) {\n\t sum = 0;\n\t for (col = 0; col < ncol; col++)\n\t sum += arr[row][col] * arg[col][rescols];\n\t res[row][rescols] = sum;\n\t }\n\t }\n\t return (nrow === 1 && rescols === 1) ? res[0][0] : res;\n\t }\n\t return jStat.map(arr, function(value) { return value * arg; });\n\t },\n\t\n\t // outer([1,2,3],[4,5,6])\n\t // ===\n\t // [[1],[2],[3]] times [[4,5,6]]\n\t // ->\n\t // [[4,5,6],[8,10,12],[12,15,18]]\n\t outer:function outer(A, B) {\n\t return jStat.multiply(A.map(function(t){ return [t] }), [B]);\n\t },\n\t\n\t\n\t // Returns the dot product of two matricies\n\t dot: function dot(arr, arg) {\n\t if (!isUsable(arr[0])) arr = [ arr ];\n\t if (!isUsable(arg[0])) arg = [ arg ];\n\t // convert column to row vector\n\t var left = (arr[0].length === 1 && arr.length !== 1) ? jStat.transpose(arr) : arr,\n\t right = (arg[0].length === 1 && arg.length !== 1) ? jStat.transpose(arg) : arg,\n\t res = [],\n\t row = 0,\n\t nrow = left.length,\n\t ncol = left[0].length,\n\t sum, col;\n\t for (; row < nrow; row++) {\n\t res[row] = [];\n\t sum = 0;\n\t for (col = 0; col < ncol; col++)\n\t sum += left[row][col] * right[row][col];\n\t res[row] = sum;\n\t }\n\t return (res.length === 1) ? res[0] : res;\n\t },\n\t\n\t // raise every element by a scalar\n\t pow: function pow(arr, arg) {\n\t return jStat.map(arr, function(value) { return Math.pow(value, arg); });\n\t },\n\t\n\t // exponentiate every element\n\t exp: function exp(arr) {\n\t return jStat.map(arr, function(value) { return Math.exp(value); });\n\t },\n\t\n\t // generate the natural log of every element\n\t log: function exp(arr) {\n\t return jStat.map(arr, function(value) { return Math.log(value); });\n\t },\n\t\n\t // generate the absolute values of the vector\n\t abs: function abs(arr) {\n\t return jStat.map(arr, function(value) { return Math.abs(value); });\n\t },\n\t\n\t // computes the p-norm of the vector\n\t // In the case that a matrix is passed, uses the first row as the vector\n\t norm: function norm(arr, p) {\n\t var nnorm = 0,\n\t i = 0;\n\t // check the p-value of the norm, and set for most common case\n\t if (isNaN(p)) p = 2;\n\t // check if multi-dimensional array, and make vector correction\n\t if (isUsable(arr[0])) arr = arr[0];\n\t // vector norm\n\t for (; i < arr.length; i++) {\n\t nnorm += Math.pow(Math.abs(arr[i]), p);\n\t }\n\t return Math.pow(nnorm, 1 / p);\n\t },\n\t\n\t // computes the angle between two vectors in rads\n\t // In case a matrix is passed, this uses the first row as the vector\n\t angle: function angle(arr, arg) {\n\t return Math.acos(jStat.dot(arr, arg) / (jStat.norm(arr) * jStat.norm(arg)));\n\t },\n\t\n\t // augment one matrix by another\n\t // Note: this function returns a matrix, not a jStat object\n\t aug: function aug(a, b) {\n\t var newarr = [];\n\t for (var i = 0; i < a.length; i++) {\n\t newarr.push(a[i].slice());\n\t }\n\t for (var i = 0; i < newarr.length; i++) {\n\t push.apply(newarr[i], b[i]);\n\t }\n\t return newarr;\n\t },\n\t\n\t // The inv() function calculates the inverse of a matrix\n\t // Create the inverse by augmenting the matrix by the identity matrix of the\n\t // appropriate size, and then use G-J elimination on the augmented matrix.\n\t inv: function inv(a) {\n\t var rows = a.length;\n\t var cols = a[0].length;\n\t var b = jStat.identity(rows, cols);\n\t var c = jStat.gauss_jordan(a, b);\n\t var result = [];\n\t var i = 0;\n\t var j;\n\t\n\t //We need to copy the inverse portion to a new matrix to rid G-J artifacts\n\t for (; i < rows; i++) {\n\t result[i] = [];\n\t for (j = cols; j < c[0].length; j++)\n\t result[i][j - cols] = c[i][j];\n\t }\n\t return result;\n\t },\n\t\n\t // calculate the determinant of a matrix\n\t det: function det(a) {\n\t var alen = a.length,\n\t alend = alen * 2,\n\t vals = new Array(alend),\n\t rowshift = alen - 1,\n\t colshift = alend - 1,\n\t mrow = rowshift - alen + 1,\n\t mcol = colshift,\n\t i = 0,\n\t result = 0,\n\t j;\n\t // check for special 2x2 case\n\t if (alen === 2) {\n\t return a[0][0] * a[1][1] - a[0][1] * a[1][0];\n\t }\n\t for (; i < alend; i++) {\n\t vals[i] = 1;\n\t }\n\t for (var i = 0; i < alen; i++) {\n\t for (j = 0; j < alen; j++) {\n\t vals[(mrow < 0) ? mrow + alen : mrow ] *= a[i][j];\n\t vals[(mcol < alen) ? mcol + alen : mcol ] *= a[i][j];\n\t mrow++;\n\t mcol--;\n\t }\n\t mrow = --rowshift - alen + 1;\n\t mcol = --colshift;\n\t }\n\t for (var i = 0; i < alen; i++) {\n\t result += vals[i];\n\t }\n\t for (; i < alend; i++) {\n\t result -= vals[i];\n\t }\n\t return result;\n\t },\n\t\n\t gauss_elimination: function gauss_elimination(a, b) {\n\t var i = 0,\n\t j = 0,\n\t n = a.length,\n\t m = a[0].length,\n\t factor = 1,\n\t sum = 0,\n\t x = [],\n\t maug, pivot, temp, k;\n\t a = jStat.aug(a, b);\n\t maug = a[0].length;\n\t for(var i = 0; i < n; i++) {\n\t pivot = a[i][i];\n\t j = i;\n\t for (k = i + 1; k < m; k++) {\n\t if (pivot < Math.abs(a[k][i])) {\n\t pivot = a[k][i];\n\t j = k;\n\t }\n\t }\n\t if (j != i) {\n\t for(k = 0; k < maug; k++) {\n\t temp = a[i][k];\n\t a[i][k] = a[j][k];\n\t a[j][k] = temp;\n\t }\n\t }\n\t for (j = i + 1; j < n; j++) {\n\t factor = a[j][i] / a[i][i];\n\t for(k = i; k < maug; k++) {\n\t a[j][k] = a[j][k] - factor * a[i][k];\n\t }\n\t }\n\t }\n\t for (var i = n - 1; i >= 0; i--) {\n\t sum = 0;\n\t for (j = i + 1; j<= n - 1; j++) {\n\t sum = sum + x[j] * a[i][j];\n\t }\n\t x[i] =(a[i][maug - 1] - sum) / a[i][i];\n\t }\n\t return x;\n\t },\n\t\n\t gauss_jordan: function gauss_jordan(a, b) {\n\t var m = jStat.aug(a, b),\n\t h = m.length,\n\t w = m[0].length;\n\t // find max pivot\n\t for (var y = 0; y < h; y++) {\n\t var maxrow = y;\n\t for (var y2 = y+1; y2 < h; y2++) {\n\t if (Math.abs(m[y2][y]) > Math.abs(m[maxrow][y]))\n\t maxrow = y2;\n\t }\n\t var tmp = m[y];\n\t m[y] = m[maxrow];\n\t m[maxrow] = tmp\n\t for (var y2 = y+1; y2 < h; y2++) {\n\t c = m[y2][y] / m[y][y];\n\t for (var x = y; x < w; x++) {\n\t m[y2][x] -= m[y][x] * c;\n\t }\n\t }\n\t }\n\t // backsubstitute\n\t for (var y = h-1; y >= 0; y--) {\n\t c = m[y][y];\n\t for (var y2 = 0; y2 < y; y2++) {\n\t for (var x = w-1; x > y-1; x--) {\n\t m[y2][x] -= m[y][x] * m[y2][y] / c;\n\t }\n\t }\n\t m[y][y] /= c;\n\t for (var x = h; x < w; x++) {\n\t m[y][x] /= c;\n\t }\n\t }\n\t return m;\n\t },\n\t\n\t // solve equation\n\t // Ax=b\n\t // A is upper triangular matrix\n\t // A=[[1,2,3],[0,4,5],[0,6,7]]\n\t // b=[1,2,3]\n\t // triaUpSolve(A,b) // -> [2.666,0.1666,1.666]\n\t // if you use matrix style\n\t // A=[[1,2,3],[0,4,5],[0,6,7]]\n\t // b=[[1],[2],[3]]\n\t // will return [[2.666],[0.1666],[1.666]]\n\t triaUpSolve: function triaUpSolve(A, b) {\n\t var size = A[0].length;\n\t var x = jStat.zeros(1, size)[0];\n\t var parts;\n\t var matrix_mode = false;\n\t\n\t if (b[0].length != undefined) {\n\t b = b.map(function(i){ return i[0] });\n\t matrix_mode = true;\n\t }\n\t\n\t jStat.arange(size - 1, -1, -1).forEach(function(i) {\n\t parts = jStat.arange(i + 1,size).map(function(j) {\n\t return x[j] * A[i][j];\n\t });\n\t x[i] = (b[i] - jStat.sum(parts)) / A[i][i];\n\t });\n\t\n\t if (matrix_mode)\n\t return x.map(function(i){ return [i] });\n\t return x;\n\t },\n\t\n\t triaLowSolve: function triaLowSolve(A, b) {\n\t // like to triaUpSolve but A is lower triangular matrix\n\t var size = A[0].length;\n\t var x = jStat.zeros(1, size)[0];\n\t var parts;\n\t\n\t var matrix_mode=false;\n\t if (b[0].length != undefined) {\n\t b = b.map(function(i){ return i[0] });\n\t matrix_mode = true;\n\t }\n\t\n\t jStat.arange(size).forEach(function(i) {\n\t parts = jStat.arange(i).map(function(j) {\n\t return A[i][j] * x[j];\n\t });\n\t x[i] = (b[i] - jStat.sum(parts)) / A[i][i];\n\t })\n\t\n\t if (matrix_mode)\n\t return x.map(function(i){ return [i] });\n\t return x;\n\t },\n\t\n\t // A -> [L,U]\n\t // A=LU\n\t // L is lower triangular matrix\n\t // U is upper triangular matrix\n\t lu: function lu(A) {\n\t var size = A.length;\n\t //var L=jStat.diagonal(jStat.ones(1,size)[0]);\n\t var L = jStat.identity(size);\n\t var R = jStat.zeros(A.length, A[0].length);\n\t var parts;\n\t jStat.arange(size).forEach(function(t) {\n\t R[0][t] = A[0][t];\n\t });\n\t jStat.arange(1, size).forEach(function(l) {\n\t jStat.arange(l).forEach(function(i) {\n\t parts = jStat.arange(i).map(function(jj) {\n\t return L[l][jj] * R[jj][i];\n\t });\n\t L[l][i] = (A[l][i] - jStat.sum(parts)) / R[i][i];\n\t });\n\t jStat.arange(l, size).forEach(function(j) {\n\t parts = jStat.arange(l).map(function(jj) {\n\t return L[l][jj] * R[jj][j];\n\t });\n\t R[l][j] = A[i][j] - jStat.sum(parts);\n\t });\n\t });\n\t return [L, R];\n\t },\n\t\n\t // A -> T\n\t // A=TT'\n\t // T is lower triangular matrix\n\t cholesky: function cholesky(A) {\n\t var size = A.length;\n\t var T = jStat.zeros(A.length, A[0].length);\n\t var parts;\n\t jStat.arange(size).forEach(function(i) {\n\t parts = jStat.arange(i).map(function(t) {\n\t return Math.pow(T[i][t],2);\n\t });\n\t T[i][i] = Math.sqrt(A[i][i] - jStat.sum(parts));\n\t jStat.arange(i + 1, size).forEach(function(j) {\n\t parts = jStat.arange(i).map(function(t) {\n\t return T[i][t] * T[j][t];\n\t });\n\t T[j][i] = (A[i][j] - jStat.sum(parts)) / T[i][i];\n\t });\n\t });\n\t return T;\n\t },\n\t\n\t gauss_jacobi: function gauss_jacobi(a, b, x, r) {\n\t var i = 0;\n\t var j = 0;\n\t var n = a.length;\n\t var l = [];\n\t var u = [];\n\t var d = [];\n\t var xv, c, h, xk;\n\t for (; i < n; i++) {\n\t l[i] = [];\n\t u[i] = [];\n\t d[i] = [];\n\t for (j = 0; j < n; j++) {\n\t if (i > j) {\n\t l[i][j] = a[i][j];\n\t u[i][j] = d[i][j] = 0;\n\t } else if (i < j) {\n\t u[i][j] = a[i][j];\n\t l[i][j] = d[i][j] = 0;\n\t } else {\n\t d[i][j] = a[i][j];\n\t l[i][j] = u[i][j] = 0;\n\t }\n\t }\n\t }\n\t h = jStat.multiply(jStat.multiply(jStat.inv(d), jStat.add(l, u)), -1);\n\t c = jStat.multiply(jStat.inv(d), b);\n\t xv = x;\n\t xk = jStat.add(jStat.multiply(h, x), c);\n\t i = 2;\n\t while (Math.abs(jStat.norm(jStat.subtract(xk,xv))) > r) {\n\t xv = xk;\n\t xk = jStat.add(jStat.multiply(h, xv), c);\n\t i++;\n\t }\n\t return xk;\n\t },\n\t\n\t gauss_seidel: function gauss_seidel(a, b, x, r) {\n\t var i = 0;\n\t var n = a.length;\n\t var l = [];\n\t var u = [];\n\t var d = [];\n\t var j, xv, c, h, xk;\n\t for (; i < n; i++) {\n\t l[i] = [];\n\t u[i] = [];\n\t d[i] = [];\n\t for (j = 0; j < n; j++) {\n\t if (i > j) {\n\t l[i][j] = a[i][j];\n\t u[i][j] = d[i][j] = 0;\n\t } else if (i < j) {\n\t u[i][j] = a[i][j];\n\t l[i][j] = d[i][j] = 0;\n\t } else {\n\t d[i][j] = a[i][j];\n\t l[i][j] = u[i][j] = 0;\n\t }\n\t }\n\t }\n\t h = jStat.multiply(jStat.multiply(jStat.inv(jStat.add(d, l)), u), -1);\n\t c = jStat.multiply(jStat.inv(jStat.add(d, l)), b);\n\t xv = x;\n\t xk = jStat.add(jStat.multiply(h, x), c);\n\t i = 2;\n\t while (Math.abs(jStat.norm(jStat.subtract(xk, xv))) > r) {\n\t xv = xk;\n\t xk = jStat.add(jStat.multiply(h, xv), c);\n\t i = i + 1;\n\t }\n\t return xk;\n\t },\n\t\n\t SOR: function SOR(a, b, x, r, w) {\n\t var i = 0;\n\t var n = a.length;\n\t var l = [];\n\t var u = [];\n\t var d = [];\n\t var j, xv, c, h, xk;\n\t for (; i < n; i++) {\n\t l[i] = [];\n\t u[i] = [];\n\t d[i] = [];\n\t for (j = 0; j < n; j++) {\n\t if (i > j) {\n\t l[i][j] = a[i][j];\n\t u[i][j] = d[i][j] = 0;\n\t } else if (i < j) {\n\t u[i][j] = a[i][j];\n\t l[i][j] = d[i][j] = 0;\n\t } else {\n\t d[i][j] = a[i][j];\n\t l[i][j] = u[i][j] = 0;\n\t }\n\t }\n\t }\n\t h = jStat.multiply(jStat.inv(jStat.add(d, jStat.multiply(l, w))),\n\t jStat.subtract(jStat.multiply(d, 1 - w),\n\t jStat.multiply(u, w)));\n\t c = jStat.multiply(jStat.multiply(jStat.inv(jStat.add(d,\n\t jStat.multiply(l, w))), b), w);\n\t xv = x;\n\t xk = jStat.add(jStat.multiply(h, x), c);\n\t i = 2;\n\t while (Math.abs(jStat.norm(jStat.subtract(xk, xv))) > r) {\n\t xv = xk;\n\t xk = jStat.add(jStat.multiply(h, xv), c);\n\t i++;\n\t }\n\t return xk;\n\t },\n\t\n\t householder: function householder(a) {\n\t var m = a.length;\n\t var n = a[0].length;\n\t var i = 0;\n\t var w = [];\n\t var p = [];\n\t var alpha, r, k, j, factor;\n\t for (; i < m - 1; i++) {\n\t alpha = 0;\n\t for (j = i + 1; j < n; j++)\n\t alpha += (a[j][i] * a[j][i]);\n\t factor = (a[i + 1][i] > 0) ? -1 : 1;\n\t alpha = factor * Math.sqrt(alpha);\n\t r = Math.sqrt((((alpha * alpha) - a[i + 1][i] * alpha) / 2));\n\t w = jStat.zeros(m, 1);\n\t w[i + 1][0] = (a[i + 1][i] - alpha) / (2 * r);\n\t for (k = i + 2; k < m; k++) w[k][0] = a[k][i] / (2 * r);\n\t p = jStat.subtract(jStat.identity(m, n),\n\t jStat.multiply(jStat.multiply(w, jStat.transpose(w)), 2));\n\t a = jStat.multiply(p, jStat.multiply(a, p));\n\t }\n\t return a;\n\t },\n\t\n\t // A -> [Q,R]\n\t // Q is orthogonal matrix\n\t // R is upper triangular\n\t QR: (function() {\n\t // x -> Q\n\t // find a orthogonal matrix Q st.\n\t // Qx=y\n\t // y is [||x||,0,0,...]\n\t function get_Q1(x) {\n\t var size = x.length;\n\t var norm_x = jStat.norm(x,2);\n\t var e1 = jStat.zeros(1, size)[0];\n\t e1[0] = 1;\n\t var u = jStat.add(jStat.multiply(jStat.multiply(e1, norm_x), -1), x);\n\t var norm_u = jStat.norm(u, 2);\n\t var v = jStat.divide(u, norm_u);\n\t var Q = jStat.subtract(jStat.identity(size),\n\t jStat.multiply(jStat.outer(v, v), 2));\n\t return Q;\n\t }\n\t\n\t function qr(A) {\n\t var size = A[0].length;\n\t var QList = [];\n\t jStat.arange(size).forEach(function(i) {\n\t var x = jStat.slice(A, { row: { start: i }, col: i });\n\t var Q = get_Q1(x);\n\t var Qn = jStat.identity(A.length);\n\t Qn = jStat.sliceAssign(Qn, { row: { start: i }, col: { start: i }}, Q);\n\t A = jStat.multiply(Qn, A);\n\t QList.push(Qn);\n\t });\n\t var Q = QList.reduce(function(x, y){ return jStat.multiply(x,y) });\n\t var R = A;\n\t return [Q, R];\n\t }\n\t\n\t return qr;\n\t })(),\n\t\n\t lstsq: (function(A, b) {\n\t // solve least squard problem for Ax=b as QR decomposition way if b is\n\t // [[b1],[b2],[b3]] form will return [[x1],[x2],[x3]] array form solution\n\t // else b is [b1,b2,b3] form will return [x1,x2,x3] array form solution\n\t function R_I(A) {\n\t A = jStat.copy(A);\n\t var size = A.length;\n\t var I = jStat.identity(size);\n\t jStat.arange(size - 1, -1, -1).forEach(function(i) {\n\t jStat.sliceAssign(\n\t I, { row: i }, jStat.divide(jStat.slice(I, { row: i }), A[i][i]));\n\t jStat.sliceAssign(\n\t A, { row: i }, jStat.divide(jStat.slice(A, { row: i }), A[i][i]));\n\t jStat.arange(i).forEach(function(j) {\n\t var c = jStat.multiply(A[j][i], -1);\n\t var Aj = jStat.slice(A, { row: j });\n\t var cAi = jStat.multiply(jStat.slice(A, { row: i }), c);\n\t jStat.sliceAssign(A, { row: j }, jStat.add(Aj, cAi));\n\t var Ij = jStat.slice(I, { row: j });\n\t var cIi = jStat.multiply(jStat.slice(I, { row: i }), c);\n\t jStat.sliceAssign(I, { row: j }, jStat.add(Ij, cIi));\n\t })\n\t });\n\t return I;\n\t }\n\t\n\t function qr_solve(A, b){\n\t var array_mode = false;\n\t if (b[0].length === undefined) {\n\t // [c1,c2,c3] mode\n\t b = b.map(function(x){ return [x] });\n\t array_mode = true;\n\t }\n\t var QR = jStat.QR(A);\n\t var Q = QR[0];\n\t var R = QR[1];\n\t var attrs = A[0].length;\n\t var Q1 = jStat.slice(Q,{col:{end:attrs}});\n\t var R1 = jStat.slice(R,{row:{end:attrs}});\n\t var RI = R_I(R1);\n\t var x = jStat.multiply(jStat.multiply(RI, jStat.transpose(Q1)), b);\n\t if (array_mode)\n\t return x.map(function(i){ return i[0] });\n\t return x;\n\t }\n\t\n\t return qr_solve;\n\t })(),\n\t\n\t jacobi: function jacobi(a) {\n\t var condition = 1;\n\t var count = 0;\n\t var n = a.length;\n\t var e = jStat.identity(n, n);\n\t var ev = [];\n\t var b, i, j, p, q, maxim, theta, s;\n\t // condition === 1 only if tolerance is not reached\n\t while (condition === 1) {\n\t count++;\n\t maxim = a[0][1];\n\t p = 0;\n\t q = 1;\n\t for (var i = 0; i < n; i++) {\n\t for (j = 0; j < n; j++) {\n\t if (i != j) {\n\t if (maxim < Math.abs(a[i][j])) {\n\t maxim = Math.abs(a[i][j]);\n\t p = i;\n\t q = j;\n\t }\n\t }\n\t }\n\t }\n\t if (a[p][p] === a[q][q])\n\t theta = (a[p][q] > 0) ? Math.PI / 4 : -Math.PI / 4;\n\t else\n\t theta = Math.atan(2 * a[p][q] / (a[p][p] - a[q][q])) / 2;\n\t s = jStat.identity(n, n);\n\t s[p][p] = Math.cos(theta);\n\t s[p][q] = -Math.sin(theta);\n\t s[q][p] = Math.sin(theta);\n\t s[q][q] = Math.cos(theta);\n\t // eigen vector matrix\n\t e = jStat.multiply(e, s);\n\t b = jStat.multiply(jStat.multiply(jStat.inv(s), a), s);\n\t a = b;\n\t condition = 0;\n\t for (var i = 1; i < n; i++) {\n\t for (j = 1; j < n; j++) {\n\t if (i != j && Math.abs(a[i][j]) > 0.001) {\n\t condition = 1;\n\t }\n\t }\n\t }\n\t }\n\t for (var i = 0; i < n; i++) ev.push(a[i][i]);\n\t //returns both the eigenvalue and eigenmatrix\n\t return [e, ev];\n\t },\n\t\n\t rungekutta: function rungekutta(f, h, p, t_j, u_j, order) {\n\t var k1, k2, u_j1, k3, k4;\n\t if (order === 2) {\n\t while (t_j <= p) {\n\t k1 = h * f(t_j, u_j);\n\t k2 = h * f(t_j + h, u_j + k1);\n\t u_j1 = u_j + (k1 + k2) / 2;\n\t u_j = u_j1;\n\t t_j = t_j + h;\n\t }\n\t }\n\t if (order === 4) {\n\t while (t_j <= p) {\n\t k1 = h * f(t_j, u_j);\n\t k2 = h * f(t_j + h / 2, u_j + k1 / 2);\n\t k3 = h * f(t_j + h / 2, u_j + k2 / 2);\n\t k4 = h * f(t_j +h, u_j + k3);\n\t u_j1 = u_j + (k1 + 2 * k2 + 2 * k3 + k4) / 6;\n\t u_j = u_j1;\n\t t_j = t_j + h;\n\t }\n\t }\n\t return u_j;\n\t },\n\t\n\t romberg: function romberg(f, a, b, order) {\n\t var i = 0;\n\t var h = (b - a) / 2;\n\t var x = [];\n\t var h1 = [];\n\t var g = [];\n\t var m, a1, j, k, I, d;\n\t while (i < order / 2) {\n\t I = f(a);\n\t for (j = a, k = 0; j <= b; j = j + h, k++) x[k] = j;\n\t m = x.length;\n\t for (j = 1; j < m - 1; j++) {\n\t I += (((j % 2) !== 0) ? 4 : 2) * f(x[j]);\n\t }\n\t I = (h / 3) * (I + f(b));\n\t g[i] = I;\n\t h /= 2;\n\t i++;\n\t }\n\t a1 = g.length;\n\t m = 1;\n\t while (a1 !== 1) {\n\t for (j = 0; j < a1 - 1; j++)\n\t h1[j] = ((Math.pow(4, m)) * g[j + 1] - g[j]) / (Math.pow(4, m) - 1);\n\t a1 = h1.length;\n\t g = h1;\n\t h1 = [];\n\t m++;\n\t }\n\t return g;\n\t },\n\t\n\t richardson: function richardson(X, f, x, h) {\n\t function pos(X, x) {\n\t var i = 0;\n\t var n = X.length;\n\t var p;\n\t for (; i < n; i++)\n\t if (X[i] === x) p = i;\n\t return p;\n\t }\n\t var n = X.length,\n\t h_min = Math.abs(x - X[pos(X, x) + 1]),\n\t i = 0,\n\t g = [],\n\t h1 = [],\n\t y1, y2, m, a, j;\n\t while (h >= h_min) {\n\t y1 = pos(X, x + h);\n\t y2 = pos(X, x);\n\t g[i] = (f[y1] - 2 * f[y2] + f[2 * y2 - y1]) / (h * h);\n\t h /= 2;\n\t i++;\n\t }\n\t a = g.length;\n\t m = 1;\n\t while (a != 1) {\n\t for (j = 0; j < a - 1; j++)\n\t h1[j] = ((Math.pow(4, m)) * g[j + 1] - g[j]) / (Math.pow(4, m) - 1);\n\t a = h1.length;\n\t g = h1;\n\t h1 = [];\n\t m++;\n\t }\n\t return g;\n\t },\n\t\n\t simpson: function simpson(f, a, b, n) {\n\t var h = (b - a) / n;\n\t var I = f(a);\n\t var x = [];\n\t var j = a;\n\t var k = 0;\n\t var i = 1;\n\t var m;\n\t for (; j <= b; j = j + h, k++)\n\t x[k] = j;\n\t m = x.length;\n\t for (; i < m - 1; i++) {\n\t I += ((i % 2 !== 0) ? 4 : 2) * f(x[i]);\n\t }\n\t return (h / 3) * (I + f(b));\n\t },\n\t\n\t hermite: function hermite(X, F, dF, value) {\n\t var n = X.length;\n\t var p = 0;\n\t var i = 0;\n\t var l = [];\n\t var dl = [];\n\t var A = [];\n\t var B = [];\n\t var j;\n\t for (; i < n; i++) {\n\t l[i] = 1;\n\t for (j = 0; j < n; j++) {\n\t if (i != j) l[i] *= (value - X[j]) / (X[i] - X[j]);\n\t }\n\t dl[i] = 0;\n\t for (j = 0; j < n; j++) {\n\t if (i != j) dl[i] += 1 / (X [i] - X[j]);\n\t }\n\t A[i] = (1 - 2 * (value - X[i]) * dl[i]) * (l[i] * l[i]);\n\t B[i] = (value - X[i]) * (l[i] * l[i]);\n\t p += (A[i] * F[i] + B[i] * dF[i]);\n\t }\n\t return p;\n\t },\n\t\n\t lagrange: function lagrange(X, F, value) {\n\t var p = 0;\n\t var i = 0;\n\t var j, l;\n\t var n = X.length;\n\t for (; i < n; i++) {\n\t l = F[i];\n\t for (j = 0; j < n; j++) {\n\t // calculating the lagrange polynomial L_i\n\t if (i != j) l *= (value - X[j]) / (X[i] - X[j]);\n\t }\n\t // adding the lagrange polynomials found above\n\t p += l;\n\t }\n\t return p;\n\t },\n\t\n\t cubic_spline: function cubic_spline(X, F, value) {\n\t var n = X.length;\n\t var i = 0, j;\n\t var A = [];\n\t var B = [];\n\t var alpha = [];\n\t var c = [];\n\t var h = [];\n\t var b = [];\n\t var d = [];\n\t for (; i < n - 1; i++)\n\t h[i] = X[i + 1] - X[i];\n\t alpha[0] = 0;\n\t for (var i = 1; i < n - 1; i++) {\n\t alpha[i] = (3 / h[i]) * (F[i + 1] - F[i]) -\n\t (3 / h[i-1]) * (F[i] - F[i-1]);\n\t }\n\t for (var i = 1; i < n - 1; i++) {\n\t A[i] = [];\n\t B[i] = [];\n\t A[i][i-1] = h[i-1];\n\t A[i][i] = 2 * (h[i - 1] + h[i]);\n\t A[i][i+1] = h[i];\n\t B[i][0] = alpha[i];\n\t }\n\t c = jStat.multiply(jStat.inv(A), B);\n\t for (j = 0; j < n - 1; j++) {\n\t b[j] = (F[j + 1] - F[j]) / h[j] - h[j] * (c[j + 1][0] + 2 * c[j][0]) / 3;\n\t d[j] = (c[j + 1][0] - c[j][0]) / (3 * h[j]);\n\t }\n\t for (j = 0; j < n; j++) {\n\t if (X[j] > value) break;\n\t }\n\t j -= 1;\n\t return F[j] + (value - X[j]) * b[j] + jStat.sq(value-X[j]) *\n\t c[j] + (value - X[j]) * jStat.sq(value - X[j]) * d[j];\n\t },\n\t\n\t gauss_quadrature: function gauss_quadrature() {\n\t throw new Error('gauss_quadrature not yet implemented');\n\t },\n\t\n\t PCA: function PCA(X) {\n\t var m = X.length;\n\t var n = X[0].length;\n\t var flag = false;\n\t var i = 0;\n\t var j, temp1;\n\t var u = [];\n\t var D = [];\n\t var result = [];\n\t var temp2 = [];\n\t var Y = [];\n\t var Bt = [];\n\t var B = [];\n\t var C = [];\n\t var V = [];\n\t var Vt = [];\n\t for (var i = 0; i < m; i++) {\n\t u[i] = jStat.sum(X[i]) / n;\n\t }\n\t for (var i = 0; i < n; i++) {\n\t B[i] = [];\n\t for(j = 0; j < m; j++) {\n\t B[i][j] = X[j][i] - u[j];\n\t }\n\t }\n\t B = jStat.transpose(B);\n\t for (var i = 0; i < m; i++) {\n\t C[i] = [];\n\t for (j = 0; j < m; j++) {\n\t C[i][j] = (jStat.dot([B[i]], [B[j]])) / (n - 1);\n\t }\n\t }\n\t result = jStat.jacobi(C);\n\t V = result[0];\n\t D = result[1];\n\t Vt = jStat.transpose(V);\n\t for (var i = 0; i < D.length; i++) {\n\t for (j = i; j < D.length; j++) {\n\t if(D[i] < D[j]) {\n\t temp1 = D[i];\n\t D[i] = D[j];\n\t D[j] = temp1;\n\t temp2 = Vt[i];\n\t Vt[i] = Vt[j];\n\t Vt[j] = temp2;\n\t }\n\t }\n\t }\n\t Bt = jStat.transpose(B);\n\t for (var i = 0; i < m; i++) {\n\t Y[i] = [];\n\t for (j = 0; j < Bt.length; j++) {\n\t Y[i][j] = jStat.dot([Vt[i]], [Bt[j]]);\n\t }\n\t }\n\t return [X, D, Vt, Y];\n\t }\n\t});\n\t\n\t// extend jStat.fn with methods that require one argument\n\t(function(funcs) {\n\t for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n\t jStat.fn[passfunc] = function(arg, func) {\n\t var tmpthis = this;\n\t // check for callback\n\t if (func) {\n\t setTimeout(function() {\n\t func.call(tmpthis, jStat.fn[passfunc].call(tmpthis, arg));\n\t }, 15);\n\t return this;\n\t }\n\t if (typeof jStat[passfunc](this, arg) === 'number')\n\t return jStat[passfunc](this, arg);\n\t else\n\t return jStat(jStat[passfunc](this, arg));\n\t };\n\t }(funcs[i]));\n\t}('add divide multiply subtract dot pow exp log abs norm angle'.split(' ')));\n\t\n\t}(this.jStat, Math));\n\t(function(jStat, Math) {\n\t\n\tvar slice = [].slice;\n\tvar isNumber = jStat.utils.isNumber;\n\tvar isArray = jStat.utils.isArray;\n\t\n\t// flag==true denotes use of sample standard deviation\n\t// Z Statistics\n\tjStat.extend({\n\t // 2 different parameter lists:\n\t // (value, mean, sd)\n\t // (value, array, flag)\n\t zscore: function zscore() {\n\t var args = slice.call(arguments);\n\t if (isNumber(args[1])) {\n\t return (args[0] - args[1]) / args[2];\n\t }\n\t return (args[0] - jStat.mean(args[1])) / jStat.stdev(args[1], args[2]);\n\t },\n\t\n\t // 3 different paramter lists:\n\t // (value, mean, sd, sides)\n\t // (zscore, sides)\n\t // (value, array, sides, flag)\n\t ztest: function ztest() {\n\t var args = slice.call(arguments);\n\t var z;\n\t if (isArray(args[1])) {\n\t // (value, array, sides, flag)\n\t z = jStat.zscore(args[0],args[1],args[3]);\n\t return (args[2] === 1) ?\n\t (jStat.normal.cdf(-Math.abs(z), 0, 1)) :\n\t (jStat.normal.cdf(-Math.abs(z), 0, 1)*2);\n\t } else {\n\t if (args.length > 2) {\n\t // (value, mean, sd, sides)\n\t z = jStat.zscore(args[0],args[1],args[2]);\n\t return (args[3] === 1) ?\n\t (jStat.normal.cdf(-Math.abs(z),0,1)) :\n\t (jStat.normal.cdf(-Math.abs(z),0,1)* 2);\n\t } else {\n\t // (zscore, sides)\n\t z = args[0];\n\t return (args[1] === 1) ?\n\t (jStat.normal.cdf(-Math.abs(z),0,1)) :\n\t (jStat.normal.cdf(-Math.abs(z),0,1)*2);\n\t }\n\t }\n\t }\n\t});\n\t\n\tjStat.extend(jStat.fn, {\n\t zscore: function zscore(value, flag) {\n\t return (value - this.mean()) / this.stdev(flag);\n\t },\n\t\n\t ztest: function ztest(value, sides, flag) {\n\t var zscore = Math.abs(this.zscore(value, flag));\n\t return (sides === 1) ?\n\t (jStat.normal.cdf(-zscore, 0, 1)) :\n\t (jStat.normal.cdf(-zscore, 0, 1) * 2);\n\t }\n\t});\n\t\n\t// T Statistics\n\tjStat.extend({\n\t // 2 parameter lists\n\t // (value, mean, sd, n)\n\t // (value, array)\n\t tscore: function tscore() {\n\t var args = slice.call(arguments);\n\t return (args.length === 4) ?\n\t ((args[0] - args[1]) / (args[2] / Math.sqrt(args[3]))) :\n\t ((args[0] - jStat.mean(args[1])) /\n\t (jStat.stdev(args[1], true) / Math.sqrt(args[1].length)));\n\t },\n\t\n\t // 3 different paramter lists:\n\t // (value, mean, sd, n, sides)\n\t // (tscore, n, sides)\n\t // (value, array, sides)\n\t ttest: function ttest() {\n\t var args = slice.call(arguments);\n\t var tscore;\n\t if (args.length === 5) {\n\t tscore = Math.abs(jStat.tscore(args[0], args[1], args[2], args[3]));\n\t return (args[4] === 1) ?\n\t (jStat.studentt.cdf(-tscore, args[3]-1)) :\n\t (jStat.studentt.cdf(-tscore, args[3]-1)*2);\n\t }\n\t if (isNumber(args[1])) {\n\t tscore = Math.abs(args[0])\n\t return (args[2] == 1) ?\n\t (jStat.studentt.cdf(-tscore, args[1]-1)) :\n\t (jStat.studentt.cdf(-tscore, args[1]-1) * 2);\n\t }\n\t tscore = Math.abs(jStat.tscore(args[0], args[1]))\n\t return (args[2] == 1) ?\n\t (jStat.studentt.cdf(-tscore, args[1].length-1)) :\n\t (jStat.studentt.cdf(-tscore, args[1].length-1) * 2);\n\t }\n\t});\n\t\n\tjStat.extend(jStat.fn, {\n\t tscore: function tscore(value) {\n\t return (value - this.mean()) / (this.stdev(true) / Math.sqrt(this.cols()));\n\t },\n\t\n\t ttest: function ttest(value, sides) {\n\t return (sides === 1) ?\n\t (1 - jStat.studentt.cdf(Math.abs(this.tscore(value)), this.cols()-1)) :\n\t (jStat.studentt.cdf(-Math.abs(this.tscore(value)), this.cols()-1)*2);\n\t }\n\t});\n\t\n\t// F Statistics\n\tjStat.extend({\n\t // Paramter list is as follows:\n\t // (array1, array2, array3, ...)\n\t // or it is an array of arrays\n\t // array of arrays conversion\n\t anovafscore: function anovafscore() {\n\t var args = slice.call(arguments),\n\t expVar, sample, sampMean, sampSampMean, tmpargs, unexpVar, i, j;\n\t if (args.length === 1) {\n\t tmpargs = new Array(args[0].length);\n\t for (var i = 0; i < args[0].length; i++) {\n\t tmpargs[i] = args[0][i];\n\t }\n\t args = tmpargs;\n\t }\n\t // 2 sample case\n\t if (args.length === 2) {\n\t return jStat.variance(args[0]) / jStat.variance(args[1]);\n\t }\n\t // Builds sample array\n\t sample = new Array();\n\t for (var i = 0; i < args.length; i++) {\n\t sample = sample.concat(args[i]);\n\t }\n\t sampMean = jStat.mean(sample);\n\t // Computes the explained variance\n\t expVar = 0;\n\t for (var i = 0; i < args.length; i++) {\n\t expVar = expVar + args[i].length * Math.pow(jStat.mean(args[i]) - sampMean, 2);\n\t }\n\t expVar /= (args.length - 1);\n\t // Computes unexplained variance\n\t unexpVar = 0;\n\t for (var i = 0; i < args.length; i++) {\n\t sampSampMean = jStat.mean(args[i]);\n\t for (j = 0; j < args[i].length; j++) {\n\t unexpVar += Math.pow(args[i][j] - sampSampMean, 2);\n\t }\n\t }\n\t unexpVar /= (sample.length - args.length);\n\t return expVar / unexpVar;\n\t },\n\t\n\t // 2 different paramter setups\n\t // (array1, array2, array3, ...)\n\t // (anovafscore, df1, df2)\n\t anovaftest: function anovaftest() {\n\t var args = slice.call(arguments),\n\t df1, df2, n, i;\n\t if (isNumber(args[0])) {\n\t return 1 - jStat.centralF.cdf(args[0], args[1], args[2]);\n\t }\n\t anovafscore = jStat.anovafscore(args);\n\t df1 = args.length - 1;\n\t n = 0;\n\t for (var i = 0; i < args.length; i++) {\n\t n = n + args[i].length;\n\t }\n\t df2 = n - df1 - 1;\n\t return 1 - jStat.centralF.cdf(anovafscore, df1, df2);\n\t },\n\t\n\t ftest: function ftest(fscore, df1, df2) {\n\t return 1 - jStat.centralF.cdf(fscore, df1, df2);\n\t }\n\t});\n\t\n\tjStat.extend(jStat.fn, {\n\t anovafscore: function anovafscore() {\n\t return jStat.anovafscore(this.toArray());\n\t },\n\t\n\t anovaftes: function anovaftes() {\n\t var n = 0;\n\t var i;\n\t for (var i = 0; i < this.length; i++) {\n\t n = n + this[i].length;\n\t }\n\t return jStat.ftest(this.anovafscore(), this.length - 1, n - this.length);\n\t }\n\t});\n\t\n\t// Error Bounds\n\tjStat.extend({\n\t // 2 different parameter setups\n\t // (value, alpha, sd, n)\n\t // (value, alpha, array)\n\t normalci: function normalci() {\n\t var args = slice.call(arguments),\n\t ans = new Array(2),\n\t change;\n\t if (args.length === 4) {\n\t change = Math.abs(jStat.normal.inv(args[1] / 2, 0, 1) *\n\t args[2] / Math.sqrt(args[3]));\n\t } else {\n\t change = Math.abs(jStat.normal.inv(args[1] / 2, 0, 1) *\n\t jStat.stdev(args[2]) / Math.sqrt(args[2].length));\n\t }\n\t ans[0] = args[0] - change;\n\t ans[1] = args[0] + change;\n\t return ans;\n\t },\n\t\n\t // 2 different parameter setups\n\t // (value, alpha, sd, n)\n\t // (value, alpha, array)\n\t tci: function tci() {\n\t var args = slice.call(arguments),\n\t ans = new Array(2),\n\t change;\n\t if (args.length === 4) {\n\t change = Math.abs(jStat.studentt.inv(args[1] / 2, args[3] - 1) *\n\t args[2] / Math.sqrt(args[3]));\n\t } else {\n\t change = Math.abs(jStat.studentt.inv(args[1] / 2, args[2].length - 1) *\n\t jStat.stdev(args[2], true) / Math.sqrt(args[2].length));\n\t }\n\t ans[0] = args[0] - change;\n\t ans[1] = args[0] + change;\n\t return ans;\n\t },\n\t\n\t significant: function significant(pvalue, alpha) {\n\t return pvalue < alpha;\n\t }\n\t});\n\t\n\tjStat.extend(jStat.fn, {\n\t normalci: function normalci(value, alpha) {\n\t return jStat.normalci(value, alpha, this.toArray());\n\t },\n\t\n\t tci: function tci(value, alpha) {\n\t return jStat.tci(value, alpha, this.toArray());\n\t }\n\t});\n\t\n\t// internal method for calculating the z-score for a difference of proportions test\n\tfunction differenceOfProportions(p1, n1, p2, n2) {\n\t if (p1 > 1 || p2 > 1 || p1 <= 0 || p2 <= 0) {\n\t throw new Error(\"Proportions should be greater than 0 and less than 1\")\n\t }\n\t var pooled = (p1 * n1 + p2 * n2) / (n1 + n2);\n\t var se = Math.sqrt(pooled * (1 - pooled) * ((1/n1) + (1/n2)));\n\t return (p1 - p2) / se;\n\t}\n\t\n\t// Difference of Proportions\n\tjStat.extend(jStat.fn, {\n\t oneSidedDifferenceOfProportions: function oneSidedDifferenceOfProportions(p1, n1, p2, n2) {\n\t var z = differenceOfProportions(p1, n1, p2, n2);\n\t return jStat.ztest(z, 1);\n\t },\n\t\n\t twoSidedDifferenceOfProportions: function twoSidedDifferenceOfProportions(p1, n1, p2, n2) {\n\t var z = differenceOfProportions(p1, n1, p2, n2);\n\t return jStat.ztest(z, 2);\n\t }\n\t});\n\t\n\t}(this.jStat, Math));\n\tthis.jStat.models=(function(){\n\t\n\t function sub_regress(endog, exog) {\n\t return ols(endog, exog);\n\t }\n\t\n\t function sub_regress(exog) {\n\t var var_count = exog[0].length;\n\t var modelList = jStat.arange(var_count).map(function(endog_index) {\n\t var exog_index =\n\t jStat.arange(var_count).filter(function(i){return i!==endog_index});\n\t return ols(jStat.col(exog, endog_index).map(function(x){ return x[0] }),\n\t jStat.col(exog, exog_index))\n\t });\n\t return modelList;\n\t }\n\t\n\t // do OLS model regress\n\t // exog have include const columns ,it will not generate it .In fact, exog is\n\t // \"design matrix\" look at\n\t //https://en.wikipedia.org/wiki/Design_matrix\n\t function ols(endog, exog) {\n\t var nobs = endog.length;\n\t var df_model = exog[0].length - 1;\n\t var df_resid = nobs-df_model - 1;\n\t var coef = jStat.lstsq(exog, endog);\n\t var predict =\n\t jStat.multiply(exog, coef.map(function(x) { return [x] }))\n\t .map(function(p) { return p[0] });\n\t var resid = jStat.subtract(endog, predict);\n\t var ybar = jStat.mean(endog);\n\t // constant cause problem\n\t // var SST = jStat.sum(endog.map(function(y) {\n\t // return Math.pow(y-ybar,2);\n\t // }));\n\t var SSE = jStat.sum(predict.map(function(f) {\n\t return Math.pow(f - ybar, 2);\n\t }));\n\t var SSR = jStat.sum(endog.map(function(y, i) {\n\t return Math.pow(y - predict[i], 2);\n\t }));\n\t var SST = SSE + SSR;\n\t var R2 = (SSE / SST);\n\t return {\n\t exog:exog,\n\t endog:endog,\n\t nobs:nobs,\n\t df_model:df_model,\n\t df_resid:df_resid,\n\t coef:coef,\n\t predict:predict,\n\t resid:resid,\n\t ybar:ybar,\n\t SST:SST,\n\t SSE:SSE,\n\t SSR:SSR,\n\t R2:R2\n\t };\n\t }\n\t\n\t // H0: b_I=0\n\t // H1: b_I!=0\n\t function t_test(model) {\n\t var subModelList = sub_regress(model.exog);\n\t //var sigmaHat=jStat.stdev(model.resid);\n\t var sigmaHat = Math.sqrt(model.SSR / (model.df_resid));\n\t var seBetaHat = subModelList.map(function(mod) {\n\t var SST = mod.SST;\n\t var R2 = mod.R2;\n\t return sigmaHat / Math.sqrt(SST * (1 - R2));\n\t });\n\t var tStatistic = model.coef.map(function(coef, i) {\n\t return (coef - 0) / seBetaHat[i];\n\t });\n\t var pValue = tStatistic.map(function(t) {\n\t var leftppf = jStat.studentt.cdf(t, model.df_resid);\n\t return (leftppf > 0.5 ? 1 - leftppf : leftppf) * 2;\n\t });\n\t var c = jStat.studentt.inv(0.975, model.df_resid);\n\t var interval95 = model.coef.map(function(coef, i) {\n\t var d = c * seBetaHat[i];\n\t return [coef - d, coef + d];\n\t })\n\t return {\n\t se: seBetaHat,\n\t t: tStatistic,\n\t p: pValue,\n\t sigmaHat: sigmaHat,\n\t interval95: interval95\n\t };\n\t }\n\t\n\t function F_test(model) {\n\t var F_statistic =\n\t (model.R2 / model.df_model) / ((1 - model.R2) / model.df_resid);\n\t var fcdf = function(x, n1, n2) {\n\t return jStat.beta.cdf(x / (n2 / n1 + x), n1 / 2, n2 / 2)\n\t }\n\t var pvalue = 1 - fcdf(F_statistic, model.df_model, model.df_resid);\n\t return { F_statistic: F_statistic, pvalue: pvalue };\n\t }\n\t\n\t function ols_wrap(endog, exog) {\n\t var model = ols(endog,exog);\n\t var ttest = t_test(model);\n\t var ftest = F_test(model);\n\t var adjust_R2 =\n\t 1 - (1 - model.rsquared) * ((model.nobs - 1) / (model.df_resid));\n\t model.t = ttest;\n\t model.f = ftest;\n\t model.adjust_R2 = adjust_R2;\n\t return model;\n\t }\n\t\n\t return { ols: ols_wrap };\n\t})();\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar utils = __webpack_require__(15);\n\tvar numbro = __webpack_require__(19);\n\tvar error = __webpack_require__(16);\n\t\n\texports.UNIQUE = function () {\n\t var result = [];\n\t for (var i = 0; i < arguments.length; ++i) {\n\t var hasElement = false;\n\t var element = arguments[i];\n\t\n\t // Check if we've already seen this element.\n\t for (var j = 0; j < result.length; ++j) {\n\t hasElement = result[j] === element;\n\t if (hasElement) { break; }\n\t }\n\t\n\t // If we did not find it, add it to the result.\n\t if (!hasElement) {\n\t result.push(element);\n\t }\n\t }\n\t return result;\n\t};\n\t\n\texports.FLATTEN = utils.flatten;\n\t\n\texports.ARGS2ARRAY = function () {\n\t return Array.prototype.slice.call(arguments, 0);\n\t};\n\t\n\texports.REFERENCE = function (context, reference) {\n\t if (!arguments.length) {\n\t return error.error;\n\t }\n\t try {\n\t var path = reference.split('.');\n\t var result = context;\n\t for (var i = 0; i < path.length; ++i) {\n\t var step = path[i];\n\t if (step[step.length - 1] === ']') {\n\t var opening = step.indexOf('[');\n\t var index = step.substring(opening + 1, step.length - 1);\n\t result = result[step.substring(0, opening)][index];\n\t } else {\n\t result = result[step];\n\t }\n\t }\n\t return result;\n\t } catch (error) {}\n\t};\n\t\n\texports.JOIN = function (array, separator) {\n\t return array.join(separator);\n\t};\n\t\n\texports.NUMBERS = function () {\n\t var possibleNumbers = utils.flatten(arguments);\n\t return possibleNumbers.filter(function (el) {\n\t return typeof el === 'number';\n\t });\n\t};\n\t\n\texports.NUMERAL = function (number, format) {\n\t return numbro(number).format(format);\n\t};\n\n\n/***/ },\n/* 24 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar error = __webpack_require__(16);\n\t\n\t// TODO\n\texports.CELL = function() {\n\t throw new Error('CELL is not implemented');\n\t};\n\t\n\texports.ERROR = {};\n\texports.ERROR.TYPE = function(error_val) {\n\t switch (error_val) {\n\t case error.nil: return 1;\n\t case error.div0: return 2;\n\t case error.value: return 3;\n\t case error.ref: return 4;\n\t case error.name: return 5;\n\t case error.num: return 6;\n\t case error.na: return 7;\n\t case error.data: return 8;\n\t }\n\t return error.na;\n\t};\n\t\n\t// TODO\n\texports.INFO = function() {\n\t throw new Error('INFO is not implemented');\n\t};\n\t\n\texports.ISBLANK = function(value) {\n\t return value === null;\n\t};\n\t\n\texports.ISBINARY = function (number) {\n\t return (/^[01]{1,10}$/).test(number);\n\t};\n\t\n\texports.ISERR = function(value) {\n\t return ([error.value, error.ref, error.div0, error.num, error.name, error.nil]).indexOf(value) >= 0 ||\n\t (typeof value === 'number' && (isNaN(value) || !isFinite(value)));\n\t};\n\t\n\texports.ISERROR = function(value) {\n\t return exports.ISERR(value) || value === error.na;\n\t};\n\t\n\texports.ISEVEN = function(number) {\n\t return (Math.floor(Math.abs(number)) & 1) ? false : true;\n\t};\n\t\n\t// TODO\n\texports.ISFORMULA = function() {\n\t throw new Error('ISFORMULA is not implemented');\n\t};\n\t\n\texports.ISLOGICAL = function(value) {\n\t return value === true || value === false;\n\t};\n\t\n\texports.ISNA = function(value) {\n\t return value === error.na;\n\t};\n\t\n\texports.ISNONTEXT = function(value) {\n\t return typeof(value) !== 'string';\n\t};\n\t\n\texports.ISNUMBER = function(value) {\n\t return typeof(value) === 'number' && !isNaN(value) && isFinite(value);\n\t};\n\t\n\texports.ISODD = function(number) {\n\t return (Math.floor(Math.abs(number)) & 1) ? true : false;\n\t};\n\t\n\t// TODO\n\texports.ISREF = function() {\n\t throw new Error('ISREF is not implemented');\n\t};\n\t\n\texports.ISTEXT = function(value) {\n\t return typeof(value) === 'string';\n\t};\n\t\n\texports.N = function(value) {\n\t if (this.ISNUMBER(value)) {\n\t return value;\n\t }\n\t if (value instanceof Date) {\n\t return value.getTime();\n\t }\n\t if (value === true) {\n\t return 1;\n\t }\n\t if (value === false) {\n\t return 0;\n\t }\n\t if (this.ISERROR(value)) {\n\t return value;\n\t }\n\t return 0;\n\t};\n\t\n\texports.NA = function() {\n\t return error.na;\n\t};\n\t\n\t\n\t// TODO\n\texports.SHEET = function() {\n\t throw new Error('SHEET is not implemented');\n\t};\n\t\n\t// TODO\n\texports.SHEETS = function() {\n\t throw new Error('SHEETS is not implemented');\n\t};\n\t\n\texports.TYPE = function(value) {\n\t if (this.ISNUMBER(value)) {\n\t return 1;\n\t }\n\t if (this.ISTEXT(value)) {\n\t return 2;\n\t }\n\t if (this.ISLOGICAL(value)) {\n\t return 4;\n\t }\n\t if (this.ISERROR(value)) {\n\t return 16;\n\t }\n\t if (Array.isArray(value)) {\n\t return 64;\n\t }\n\t};\n\n\n/***/ },\n/* 25 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar error = __webpack_require__(16);\n\tvar jStat = __webpack_require__(22).jStat;\n\tvar text = __webpack_require__(18);\n\tvar utils = __webpack_require__(15);\n\tvar bessel = __webpack_require__(26);\n\t\n\tfunction isValidBinaryNumber(number) {\n\t return (/^[01]{1,10}$/).test(number);\n\t}\n\t\n\texports.BESSELI = function(x, n) {\n\t x = utils.parseNumber(x);\n\t n = utils.parseNumber(n);\n\t if (utils.anyIsError(x, n)) {\n\t return error.value;\n\t }\n\t\n\t return bessel.besseli(x, n);\n\t};\n\t\n\texports.BESSELJ = function(x, n) {\n\t x = utils.parseNumber(x);\n\t n = utils.parseNumber(n);\n\t if (utils.anyIsError(x, n)) {\n\t return error.value;\n\t }\n\t\n\t return bessel.besselj(x, n);\n\t};\n\t\n\texports.BESSELK = function(x, n) {\n\t x = utils.parseNumber(x);\n\t n = utils.parseNumber(n);\n\t if (utils.anyIsError(x, n)) {\n\t return error.value;\n\t }\n\t\n\t return bessel.besselk(x, n);\n\t};\n\t\n\texports.BESSELY = function(x, n) {\n\t x = utils.parseNumber(x);\n\t n = utils.parseNumber(n);\n\t if (utils.anyIsError(x, n)) {\n\t return error.value;\n\t }\n\t\n\t return bessel.bessely(x, n);\n\t};\n\t\n\texports.BIN2DEC = function(number) {\n\t // Return error if number is not binary or contains more than 10 characters (10 digits)\n\t if (!isValidBinaryNumber(number)) {\n\t return error.num;\n\t }\n\t\n\t // Convert binary number to decimal\n\t var result = parseInt(number, 2);\n\t\n\t // Handle negative numbers\n\t var stringified = number.toString();\n\t if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n\t return parseInt(stringified.substring(1), 2) - 512;\n\t } else {\n\t return result;\n\t }\n\t};\n\t\n\t\n\texports.BIN2HEX = function(number, places) {\n\t // Return error if number is not binary or contains more than 10 characters (10 digits)\n\t if (!isValidBinaryNumber(number)) {\n\t return error.num;\n\t }\n\t\n\t // Ignore places and return a 10-character hexadecimal number if number is negative\n\t var stringified = number.toString();\n\t if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n\t return (1099511627264 + parseInt(stringified.substring(1), 2)).toString(16);\n\t }\n\t\n\t // Convert binary number to hexadecimal\n\t var result = parseInt(number, 2).toString(16);\n\t\n\t // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n\t if (places === undefined) {\n\t return result;\n\t } else {\n\t // Return error if places is nonnumeric\n\t if (isNaN(places)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if places is negative\n\t if (places < 0) {\n\t return error.num;\n\t }\n\t\n\t // Truncate places in case it is not an integer\n\t places = Math.floor(places);\n\t\n\t // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n\t return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n\t }\n\t};\n\t\n\texports.BIN2OCT = function(number, places) {\n\t // Return error if number is not binary or contains more than 10 characters (10 digits)\n\t if (!isValidBinaryNumber(number)) {\n\t return error.num;\n\t }\n\t\n\t // Ignore places and return a 10-character octal number if number is negative\n\t var stringified = number.toString();\n\t if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n\t return (1073741312 + parseInt(stringified.substring(1), 2)).toString(8);\n\t }\n\t\n\t // Convert binary number to octal\n\t var result = parseInt(number, 2).toString(8);\n\t\n\t // Return octal number using the minimum number of characters necessary if places is undefined\n\t if (places === undefined) {\n\t return result;\n\t } else {\n\t // Return error if places is nonnumeric\n\t if (isNaN(places)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if places is negative\n\t if (places < 0) {\n\t return error.num;\n\t }\n\t\n\t // Truncate places in case it is not an integer\n\t places = Math.floor(places);\n\t\n\t // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n\t return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n\t }\n\t};\n\t\n\texports.BITAND = function(number1, number2) {\n\t // Return error if either number is a non-numeric value\n\t number1 = utils.parseNumber(number1);\n\t number2 = utils.parseNumber(number2);\n\t if (utils.anyIsError(number1, number2)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if either number is less than 0\n\t if (number1 < 0 || number2 < 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if either number is a non-integer\n\t if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n\t return error.num;\n\t }\n\t\n\t // Return error if either number is greater than (2^48)-1\n\t if (number1 > 281474976710655 || number2 > 281474976710655) {\n\t return error.num;\n\t }\n\t\n\t // Return bitwise AND of two numbers\n\t return number1 & number2;\n\t};\n\t\n\texports.BITLSHIFT = function(number, shift) {\n\t number = utils.parseNumber(number);\n\t shift = utils.parseNumber(shift);\n\t if (utils.anyIsError(number, shift)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if number is less than 0\n\t if (number < 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if number is a non-integer\n\t if (Math.floor(number) !== number) {\n\t return error.num;\n\t }\n\t\n\t // Return error if number is greater than (2^48)-1\n\t if (number > 281474976710655) {\n\t return error.num;\n\t }\n\t\n\t // Return error if the absolute value of shift is greater than 53\n\t if (Math.abs(shift) > 53) {\n\t return error.num;\n\t }\n\t\n\t // Return number shifted by shift bits to the left or to the right if shift is negative\n\t return (shift >= 0) ? number << shift : number >> -shift;\n\t};\n\t\n\texports.BITOR = function(number1, number2) {\n\t number1 = utils.parseNumber(number1);\n\t number2 = utils.parseNumber(number2);\n\t if (utils.anyIsError(number1, number2)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if either number is less than 0\n\t if (number1 < 0 || number2 < 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if either number is a non-integer\n\t if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n\t return error.num;\n\t }\n\t\n\t // Return error if either number is greater than (2^48)-1\n\t if (number1 > 281474976710655 || number2 > 281474976710655) {\n\t return error.num;\n\t }\n\t\n\t // Return bitwise OR of two numbers\n\t return number1 | number2;\n\t};\n\t\n\texports.BITRSHIFT = function(number, shift) {\n\t number = utils.parseNumber(number);\n\t shift = utils.parseNumber(shift);\n\t if (utils.anyIsError(number, shift)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if number is less than 0\n\t if (number < 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if number is a non-integer\n\t if (Math.floor(number) !== number) {\n\t return error.num;\n\t }\n\t\n\t // Return error if number is greater than (2^48)-1\n\t if (number > 281474976710655) {\n\t return error.num;\n\t }\n\t\n\t // Return error if the absolute value of shift is greater than 53\n\t if (Math.abs(shift) > 53) {\n\t return error.num;\n\t }\n\t\n\t // Return number shifted by shift bits to the right or to the left if shift is negative\n\t return (shift >= 0) ? number >> shift : number << -shift;\n\t};\n\t\n\texports.BITXOR = function(number1, number2) {\n\t number1 = utils.parseNumber(number1);\n\t number2 = utils.parseNumber(number2);\n\t if (utils.anyIsError(number1, number2)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if either number is less than 0\n\t if (number1 < 0 || number2 < 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if either number is a non-integer\n\t if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n\t return error.num;\n\t }\n\t\n\t // Return error if either number is greater than (2^48)-1\n\t if (number1 > 281474976710655 || number2 > 281474976710655) {\n\t return error.num;\n\t }\n\t\n\t // Return bitwise XOR of two numbers\n\t return number1 ^ number2;\n\t};\n\t\n\texports.COMPLEX = function(real, imaginary, suffix) {\n\t real = utils.parseNumber(real);\n\t imaginary = utils.parseNumber(imaginary);\n\t if (utils.anyIsError(real, imaginary)) {\n\t return real;\n\t }\n\t\n\t // Set suffix\n\t suffix = (suffix === undefined) ? 'i' : suffix;\n\t\n\t // Return error if suffix is neither \"i\" nor \"j\"\n\t if (suffix !== 'i' && suffix !== 'j') {\n\t return error.value;\n\t }\n\t\n\t // Return complex number\n\t if (real === 0 && imaginary === 0) {\n\t return 0;\n\t } else if (real === 0) {\n\t return (imaginary === 1) ? suffix : imaginary.toString() + suffix;\n\t } else if (imaginary === 0) {\n\t return real.toString();\n\t } else {\n\t var sign = (imaginary > 0) ? '+' : '';\n\t return real.toString() + sign + ((imaginary === 1) ? suffix : imaginary.toString() + suffix);\n\t }\n\t};\n\t\n\texports.CONVERT = function(number, from_unit, to_unit) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t\n\t // List of units supported by CONVERT and units defined by the International System of Units\n\t // [Name, Symbol, Alternate symbols, Quantity, ISU, CONVERT, Conversion ratio]\n\t var units = [\n\t [\"a.u. of action\", \"?\", null, \"action\", false, false, 1.05457168181818e-34],\n\t [\"a.u. of charge\", \"e\", null, \"electric_charge\", false, false, 1.60217653141414e-19],\n\t [\"a.u. of energy\", \"Eh\", null, \"energy\", false, false, 4.35974417757576e-18],\n\t [\"a.u. of length\", \"a?\", null, \"length\", false, false, 5.29177210818182e-11],\n\t [\"a.u. of mass\", \"m?\", null, \"mass\", false, false, 9.10938261616162e-31],\n\t [\"a.u. of time\", \"?/Eh\", null, \"time\", false, false, 2.41888432650516e-17],\n\t [\"admiralty knot\", \"admkn\", null, \"speed\", false, true, 0.514773333],\n\t [\"ampere\", \"A\", null, \"electric_current\", true, false, 1],\n\t [\"ampere per meter\", \"A/m\", null, \"magnetic_field_intensity\", true, false, 1],\n\t [\"ångström\", \"Å\", [\"ang\"], \"length\", false, true, 1e-10],\n\t [\"are\", \"ar\", null, \"area\", false, true, 100],\n\t [\"astronomical unit\", \"ua\", null, \"length\", false, false, 1.49597870691667e-11],\n\t [\"bar\", \"bar\", null, \"pressure\", false, false, 100000],\n\t [\"barn\", \"b\", null, \"area\", false, false, 1e-28],\n\t [\"becquerel\", \"Bq\", null, \"radioactivity\", true, false, 1],\n\t [\"bit\", \"bit\", [\"b\"], \"information\", false, true, 1],\n\t [\"btu\", \"BTU\", [\"btu\"], \"energy\", false, true, 1055.05585262],\n\t [\"byte\", \"byte\", null, \"information\", false, true, 8],\n\t [\"candela\", \"cd\", null, \"luminous_intensity\", true, false, 1],\n\t [\"candela per square metre\", \"cd/m?\", null, \"luminance\", true, false, 1],\n\t [\"coulomb\", \"C\", null, \"electric_charge\", true, false, 1],\n\t [\"cubic ångström\", \"ang3\", [\"ang^3\"], \"volume\", false, true, 1e-30],\n\t [\"cubic foot\", \"ft3\", [\"ft^3\"], \"volume\", false, true, 0.028316846592],\n\t [\"cubic inch\", \"in3\", [\"in^3\"], \"volume\", false, true, 0.000016387064],\n\t [\"cubic light-year\", \"ly3\", [\"ly^3\"], \"volume\", false, true, 8.46786664623715e-47],\n\t [\"cubic metre\", \"m?\", null, \"volume\", true, true, 1],\n\t [\"cubic mile\", \"mi3\", [\"mi^3\"], \"volume\", false, true, 4168181825.44058],\n\t [\"cubic nautical mile\", \"Nmi3\", [\"Nmi^3\"], \"volume\", false, true, 6352182208],\n\t [\"cubic Pica\", \"Pica3\", [\"Picapt3\", \"Pica^3\", \"Picapt^3\"], \"volume\", false, true, 7.58660370370369e-8],\n\t [\"cubic yard\", \"yd3\", [\"yd^3\"], \"volume\", false, true, 0.764554857984],\n\t [\"cup\", \"cup\", null, \"volume\", false, true, 0.0002365882365],\n\t [\"dalton\", \"Da\", [\"u\"], \"mass\", false, false, 1.66053886282828e-27],\n\t [\"day\", \"d\", [\"day\"], \"time\", false, true, 86400],\n\t [\"degree\", \"°\", null, \"angle\", false, false, 0.0174532925199433],\n\t [\"degrees Rankine\", \"Rank\", null, \"temperature\", false, true, 0.555555555555556],\n\t [\"dyne\", \"dyn\", [\"dy\"], \"force\", false, true, 0.00001],\n\t [\"electronvolt\", \"eV\", [\"ev\"], \"energy\", false, true, 1.60217656514141],\n\t [\"ell\", \"ell\", null, \"length\", false, true, 1.143],\n\t [\"erg\", \"erg\", [\"e\"], \"energy\", false, true, 1e-7],\n\t [\"farad\", \"F\", null, \"electric_capacitance\", true, false, 1],\n\t [\"fluid ounce\", \"oz\", null, \"volume\", false, true, 0.0000295735295625],\n\t [\"foot\", \"ft\", null, \"length\", false, true, 0.3048],\n\t [\"foot-pound\", \"flb\", null, \"energy\", false, true, 1.3558179483314],\n\t [\"gal\", \"Gal\", null, \"acceleration\", false, false, 0.01],\n\t [\"gallon\", \"gal\", null, \"volume\", false, true, 0.003785411784],\n\t [\"gauss\", \"G\", [\"ga\"], \"magnetic_flux_density\", false, true, 1],\n\t [\"grain\", \"grain\", null, \"mass\", false, true, 0.0000647989],\n\t [\"gram\", \"g\", null, \"mass\", false, true, 0.001],\n\t [\"gray\", \"Gy\", null, \"absorbed_dose\", true, false, 1],\n\t [\"gross registered ton\", \"GRT\", [\"regton\"], \"volume\", false, true, 2.8316846592],\n\t [\"hectare\", \"ha\", null, \"area\", false, true, 10000],\n\t [\"henry\", \"H\", null, \"inductance\", true, false, 1],\n\t [\"hertz\", \"Hz\", null, \"frequency\", true, false, 1],\n\t [\"horsepower\", \"HP\", [\"h\"], \"power\", false, true, 745.69987158227],\n\t [\"horsepower-hour\", \"HPh\", [\"hh\", \"hph\"], \"energy\", false, true, 2684519.538],\n\t [\"hour\", \"h\", [\"hr\"], \"time\", false, true, 3600],\n\t [\"imperial gallon (U.K.)\", \"uk_gal\", null, \"volume\", false, true, 0.00454609],\n\t [\"imperial hundredweight\", \"lcwt\", [\"uk_cwt\", \"hweight\"], \"mass\", false, true, 50.802345],\n\t [\"imperial quart (U.K)\", \"uk_qt\", null, \"volume\", false, true, 0.0011365225],\n\t [\"imperial ton\", \"brton\", [\"uk_ton\", \"LTON\"], \"mass\", false, true, 1016.046909],\n\t [\"inch\", \"in\", null, \"length\", false, true, 0.0254],\n\t [\"international acre\", \"uk_acre\", null, \"area\", false, true, 4046.8564224],\n\t [\"IT calorie\", \"cal\", null, \"energy\", false, true, 4.1868],\n\t [\"joule\", \"J\", null, \"energy\", true, true, 1],\n\t [\"katal\", \"kat\", null, \"catalytic_activity\", true, false, 1],\n\t [\"kelvin\", \"K\", [\"kel\"], \"temperature\", true, true, 1],\n\t [\"kilogram\", \"kg\", null, \"mass\", true, true, 1],\n\t [\"knot\", \"kn\", null, \"speed\", false, true, 0.514444444444444],\n\t [\"light-year\", \"ly\", null, \"length\", false, true, 9460730472580800],\n\t [\"litre\", \"L\", [\"l\", \"lt\"], \"volume\", false, true, 0.001],\n\t [\"lumen\", \"lm\", null, \"luminous_flux\", true, false, 1],\n\t [\"lux\", \"lx\", null, \"illuminance\", true, false, 1],\n\t [\"maxwell\", \"Mx\", null, \"magnetic_flux\", false, false, 1e-18],\n\t [\"measurement ton\", \"MTON\", null, \"volume\", false, true, 1.13267386368],\n\t [\"meter per hour\", \"m/h\", [\"m/hr\"], \"speed\", false, true, 0.00027777777777778],\n\t [\"meter per second\", \"m/s\", [\"m/sec\"], \"speed\", true, true, 1],\n\t [\"meter per second squared\", \"m?s??\", null, \"acceleration\", true, false, 1],\n\t [\"parsec\", \"pc\", [\"parsec\"], \"length\", false, true, 30856775814671900],\n\t [\"meter squared per second\", \"m?/s\", null, \"kinematic_viscosity\", true, false, 1],\n\t [\"metre\", \"m\", null, \"length\", true, true, 1],\n\t [\"miles per hour\", \"mph\", null, \"speed\", false, true, 0.44704],\n\t [\"millimetre of mercury\", \"mmHg\", null, \"pressure\", false, false, 133.322],\n\t [\"minute\", \"?\", null, \"angle\", false, false, 0.000290888208665722],\n\t [\"minute\", \"min\", [\"mn\"], \"time\", false, true, 60],\n\t [\"modern teaspoon\", \"tspm\", null, \"volume\", false, true, 0.000005],\n\t [\"mole\", \"mol\", null, \"amount_of_substance\", true, false, 1],\n\t [\"morgen\", \"Morgen\", null, \"area\", false, true, 2500],\n\t [\"n.u. of action\", \"?\", null, \"action\", false, false, 1.05457168181818e-34],\n\t [\"n.u. of mass\", \"m?\", null, \"mass\", false, false, 9.10938261616162e-31],\n\t [\"n.u. of speed\", \"c?\", null, \"speed\", false, false, 299792458],\n\t [\"n.u. of time\", \"?/(me?c??)\", null, \"time\", false, false, 1.28808866778687e-21],\n\t [\"nautical mile\", \"M\", [\"Nmi\"], \"length\", false, true, 1852],\n\t [\"newton\", \"N\", null, \"force\", true, true, 1],\n\t [\"œrsted\", \"Oe \", null, \"magnetic_field_intensity\", false, false, 79.5774715459477],\n\t [\"ohm\", \"Ω\", null, \"electric_resistance\", true, false, 1],\n\t [\"ounce mass\", \"ozm\", null, \"mass\", false, true, 0.028349523125],\n\t [\"pascal\", \"Pa\", null, \"pressure\", true, false, 1],\n\t [\"pascal second\", \"Pa?s\", null, \"dynamic_viscosity\", true, false, 1],\n\t [\"pferdestärke\", \"PS\", null, \"power\", false, true, 735.49875],\n\t [\"phot\", \"ph\", null, \"illuminance\", false, false, 0.0001],\n\t [\"pica (1/6 inch)\", \"pica\", null, \"length\", false, true, 0.00035277777777778],\n\t [\"pica (1/72 inch)\", \"Pica\", [\"Picapt\"], \"length\", false, true, 0.00423333333333333],\n\t [\"poise\", \"P\", null, \"dynamic_viscosity\", false, false, 0.1],\n\t [\"pond\", \"pond\", null, \"force\", false, true, 0.00980665],\n\t [\"pound force\", \"lbf\", null, \"force\", false, true, 4.4482216152605],\n\t [\"pound mass\", \"lbm\", null, \"mass\", false, true, 0.45359237],\n\t [\"quart\", \"qt\", null, \"volume\", false, true, 0.000946352946],\n\t [\"radian\", \"rad\", null, \"angle\", true, false, 1],\n\t [\"second\", \"?\", null, \"angle\", false, false, 0.00000484813681109536],\n\t [\"second\", \"s\", [\"sec\"], \"time\", true, true, 1],\n\t [\"short hundredweight\", \"cwt\", [\"shweight\"], \"mass\", false, true, 45.359237],\n\t [\"siemens\", \"S\", null, \"electrical_conductance\", true, false, 1],\n\t [\"sievert\", \"Sv\", null, \"equivalent_dose\", true, false, 1],\n\t [\"slug\", \"sg\", null, \"mass\", false, true, 14.59390294],\n\t [\"square ångström\", \"ang2\", [\"ang^2\"], \"area\", false, true, 1e-20],\n\t [\"square foot\", \"ft2\", [\"ft^2\"], \"area\", false, true, 0.09290304],\n\t [\"square inch\", \"in2\", [\"in^2\"], \"area\", false, true, 0.00064516],\n\t [\"square light-year\", \"ly2\", [\"ly^2\"], \"area\", false, true, 8.95054210748189e+31],\n\t [\"square meter\", \"m?\", null, \"area\", true, true, 1],\n\t [\"square mile\", \"mi2\", [\"mi^2\"], \"area\", false, true, 2589988.110336],\n\t [\"square nautical mile\", \"Nmi2\", [\"Nmi^2\"], \"area\", false, true, 3429904],\n\t [\"square Pica\", \"Pica2\", [\"Picapt2\", \"Pica^2\", \"Picapt^2\"], \"area\", false, true, 0.00001792111111111],\n\t [\"square yard\", \"yd2\", [\"yd^2\"], \"area\", false, true, 0.83612736],\n\t [\"statute mile\", \"mi\", null, \"length\", false, true, 1609.344],\n\t [\"steradian\", \"sr\", null, \"solid_angle\", true, false, 1],\n\t [\"stilb\", \"sb\", null, \"luminance\", false, false, 0.0001],\n\t [\"stokes\", \"St\", null, \"kinematic_viscosity\", false, false, 0.0001],\n\t [\"stone\", \"stone\", null, \"mass\", false, true, 6.35029318],\n\t [\"tablespoon\", \"tbs\", null, \"volume\", false, true, 0.0000147868],\n\t [\"teaspoon\", \"tsp\", null, \"volume\", false, true, 0.00000492892],\n\t [\"tesla\", \"T\", null, \"magnetic_flux_density\", true, true, 1],\n\t [\"thermodynamic calorie\", \"c\", null, \"energy\", false, true, 4.184],\n\t [\"ton\", \"ton\", null, \"mass\", false, true, 907.18474],\n\t [\"tonne\", \"t\", null, \"mass\", false, false, 1000],\n\t [\"U.K. pint\", \"uk_pt\", null, \"volume\", false, true, 0.00056826125],\n\t [\"U.S. bushel\", \"bushel\", null, \"volume\", false, true, 0.03523907],\n\t [\"U.S. oil barrel\", \"barrel\", null, \"volume\", false, true, 0.158987295],\n\t [\"U.S. pint\", \"pt\", [\"us_pt\"], \"volume\", false, true, 0.000473176473],\n\t [\"U.S. survey mile\", \"survey_mi\", null, \"length\", false, true, 1609.347219],\n\t [\"U.S. survey/statute acre\", \"us_acre\", null, \"area\", false, true, 4046.87261],\n\t [\"volt\", \"V\", null, \"voltage\", true, false, 1],\n\t [\"watt\", \"W\", null, \"power\", true, true, 1],\n\t [\"watt-hour\", \"Wh\", [\"wh\"], \"energy\", false, true, 3600],\n\t [\"weber\", \"Wb\", null, \"magnetic_flux\", true, false, 1],\n\t [\"yard\", \"yd\", null, \"length\", false, true, 0.9144],\n\t [\"year\", \"yr\", null, \"time\", false, true, 31557600]\n\t ];\n\t\n\t // Binary prefixes\n\t // [Name, Prefix power of 2 value, Previx value, Abbreviation, Derived from]\n\t var binary_prefixes = {\n\t Yi: [\"yobi\", 80, 1208925819614629174706176, \"Yi\", \"yotta\"],\n\t Zi: [\"zebi\", 70, 1180591620717411303424, \"Zi\", \"zetta\"],\n\t Ei: [\"exbi\", 60, 1152921504606846976, \"Ei\", \"exa\"],\n\t Pi: [\"pebi\", 50, 1125899906842624, \"Pi\", \"peta\"],\n\t Ti: [\"tebi\", 40, 1099511627776, \"Ti\", \"tera\"],\n\t Gi: [\"gibi\", 30, 1073741824, \"Gi\", \"giga\"],\n\t Mi: [\"mebi\", 20, 1048576, \"Mi\", \"mega\"],\n\t ki: [\"kibi\", 10, 1024, \"ki\", \"kilo\"]\n\t };\n\t\n\t // Unit prefixes\n\t // [Name, Multiplier, Abbreviation]\n\t var unit_prefixes = {\n\t Y: [\"yotta\", 1e+24, \"Y\"],\n\t Z: [\"zetta\", 1e+21, \"Z\"],\n\t E: [\"exa\", 1e+18, \"E\"],\n\t P: [\"peta\", 1e+15, \"P\"],\n\t T: [\"tera\", 1e+12, \"T\"],\n\t G: [\"giga\", 1e+09, \"G\"],\n\t M: [\"mega\", 1e+06, \"M\"],\n\t k: [\"kilo\", 1e+03, \"k\"],\n\t h: [\"hecto\", 1e+02, \"h\"],\n\t e: [\"dekao\", 1e+01, \"e\"],\n\t d: [\"deci\", 1e-01, \"d\"],\n\t c: [\"centi\", 1e-02, \"c\"],\n\t m: [\"milli\", 1e-03, \"m\"],\n\t u: [\"micro\", 1e-06, \"u\"],\n\t n: [\"nano\", 1e-09, \"n\"],\n\t p: [\"pico\", 1e-12, \"p\"],\n\t f: [\"femto\", 1e-15, \"f\"],\n\t a: [\"atto\", 1e-18, \"a\"],\n\t z: [\"zepto\", 1e-21, \"z\"],\n\t y: [\"yocto\", 1e-24, \"y\"]\n\t };\n\t\n\t // Initialize units and multipliers\n\t var from = null;\n\t var to = null;\n\t var base_from_unit = from_unit;\n\t var base_to_unit = to_unit;\n\t var from_multiplier = 1;\n\t var to_multiplier = 1;\n\t var alt;\n\t\n\t // Lookup from and to units\n\t for (var i = 0; i < units.length; i++) {\n\t alt = (units[i][2] === null) ? [] : units[i][2];\n\t if (units[i][1] === base_from_unit || alt.indexOf(base_from_unit) >= 0) {\n\t from = units[i];\n\t }\n\t if (units[i][1] === base_to_unit || alt.indexOf(base_to_unit) >= 0) {\n\t to = units[i];\n\t }\n\t }\n\t\n\t // Lookup from prefix\n\t if (from === null) {\n\t var from_binary_prefix = binary_prefixes[from_unit.substring(0, 2)];\n\t var from_unit_prefix = unit_prefixes[from_unit.substring(0, 1)];\n\t\n\t // Handle dekao unit prefix (only unit prefix with two characters)\n\t if (from_unit.substring(0, 2) === 'da') {\n\t from_unit_prefix = [\"dekao\", 1e+01, \"da\"];\n\t }\n\t\n\t // Handle binary prefixes first (so that 'Yi' is processed before 'Y')\n\t if (from_binary_prefix) {\n\t from_multiplier = from_binary_prefix[2];\n\t base_from_unit = from_unit.substring(2);\n\t } else if (from_unit_prefix) {\n\t from_multiplier = from_unit_prefix[1];\n\t base_from_unit = from_unit.substring(from_unit_prefix[2].length);\n\t }\n\t\n\t // Lookup from unit\n\t for (var j = 0; j < units.length; j++) {\n\t alt = (units[j][2] === null) ? [] : units[j][2];\n\t if (units[j][1] === base_from_unit || alt.indexOf(base_from_unit) >= 0) {\n\t from = units[j];\n\t }\n\t }\n\t }\n\t\n\t // Lookup to prefix\n\t if (to === null) {\n\t var to_binary_prefix = binary_prefixes[to_unit.substring(0, 2)];\n\t var to_unit_prefix = unit_prefixes[to_unit.substring(0, 1)];\n\t\n\t // Handle dekao unit prefix (only unit prefix with two characters)\n\t if (to_unit.substring(0, 2) === 'da') {\n\t to_unit_prefix = [\"dekao\", 1e+01, \"da\"];\n\t }\n\t\n\t // Handle binary prefixes first (so that 'Yi' is processed before 'Y')\n\t if (to_binary_prefix) {\n\t to_multiplier = to_binary_prefix[2];\n\t base_to_unit = to_unit.substring(2);\n\t } else if (to_unit_prefix) {\n\t to_multiplier = to_unit_prefix[1];\n\t base_to_unit = to_unit.substring(to_unit_prefix[2].length);\n\t }\n\t\n\t // Lookup to unit\n\t for (var k = 0; k < units.length; k++) {\n\t alt = (units[k][2] === null) ? [] : units[k][2];\n\t if (units[k][1] === base_to_unit || alt.indexOf(base_to_unit) >= 0) {\n\t to = units[k];\n\t }\n\t }\n\t }\n\t\n\t // Return error if a unit does not exist\n\t if (from === null || to === null) {\n\t return error.na;\n\t }\n\t\n\t // Return error if units represent different quantities\n\t if (from[3] !== to[3]) {\n\t return error.na;\n\t }\n\t\n\t // Return converted number\n\t return number * from[6] * from_multiplier / (to[6] * to_multiplier);\n\t};\n\t\n\texports.DEC2BIN = function(number, places) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t\n\t // Return error if number is not decimal, is lower than -512, or is greater than 511\n\t if (!/^-?[0-9]{1,3}$/.test(number) || number < -512 || number > 511) {\n\t return error.num;\n\t }\n\t\n\t // Ignore places and return a 10-character binary number if number is negative\n\t if (number < 0) {\n\t return '1' + text.REPT('0', 9 - (512 + number).toString(2).length) + (512 + number).toString(2);\n\t }\n\t\n\t // Convert decimal number to binary\n\t var result = parseInt(number, 10).toString(2);\n\t\n\t // Return binary number using the minimum number of characters necessary if places is undefined\n\t if (typeof places === 'undefined') {\n\t return result;\n\t } else {\n\t // Return error if places is nonnumeric\n\t if (isNaN(places)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if places is negative\n\t if (places < 0) {\n\t return error.num;\n\t }\n\t\n\t // Truncate places in case it is not an integer\n\t places = Math.floor(places);\n\t\n\t // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n\t return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n\t }\n\t};\n\t\n\texports.DEC2HEX = function(number, places) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t\n\t // Return error if number is not decimal, is lower than -549755813888, or is greater than 549755813887\n\t if (!/^-?[0-9]{1,12}$/.test(number) || number < -549755813888 || number > 549755813887) {\n\t return error.num;\n\t }\n\t\n\t // Ignore places and return a 10-character hexadecimal number if number is negative\n\t if (number < 0) {\n\t return (1099511627776 + number).toString(16);\n\t }\n\t\n\t // Convert decimal number to hexadecimal\n\t var result = parseInt(number, 10).toString(16);\n\t\n\t // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n\t if (typeof places === 'undefined') {\n\t return result;\n\t } else {\n\t // Return error if places is nonnumeric\n\t if (isNaN(places)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if places is negative\n\t if (places < 0) {\n\t return error.num;\n\t }\n\t\n\t // Truncate places in case it is not an integer\n\t places = Math.floor(places);\n\t\n\t // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n\t return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n\t }\n\t};\n\t\n\texports.DEC2OCT = function(number, places) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t\n\t // Return error if number is not decimal, is lower than -549755813888, or is greater than 549755813887\n\t if (!/^-?[0-9]{1,9}$/.test(number) || number < -536870912 || number > 536870911) {\n\t return error.num;\n\t }\n\t\n\t // Ignore places and return a 10-character octal number if number is negative\n\t if (number < 0) {\n\t return (1073741824 + number).toString(8);\n\t }\n\t\n\t // Convert decimal number to octal\n\t var result = parseInt(number, 10).toString(8);\n\t\n\t // Return octal number using the minimum number of characters necessary if places is undefined\n\t if (typeof places === 'undefined') {\n\t return result;\n\t } else {\n\t // Return error if places is nonnumeric\n\t if (isNaN(places)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if places is negative\n\t if (places < 0) {\n\t return error.num;\n\t }\n\t\n\t // Truncate places in case it is not an integer\n\t places = Math.floor(places);\n\t\n\t // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n\t return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n\t }\n\t};\n\t\n\texports.DELTA = function(number1, number2) {\n\t // Set number2 to zero if undefined\n\t number2 = (number2 === undefined) ? 0 : number2;\n\t number1 = utils.parseNumber(number1);\n\t number2 = utils.parseNumber(number2);\n\t if (utils.anyIsError(number1, number2)) {\n\t return error.value;\n\t }\n\t\n\t // Return delta\n\t return (number1 === number2) ? 1 : 0;\n\t};\n\t\n\t// TODO: why is upper_bound not used ? The excel documentation has no examples with upper_bound\n\texports.ERF = function(lower_bound, upper_bound) {\n\t // Set number2 to zero if undefined\n\t upper_bound = (upper_bound === undefined) ? 0 : upper_bound;\n\t\n\t lower_bound = utils.parseNumber(lower_bound);\n\t upper_bound = utils.parseNumber(upper_bound);\n\t if (utils.anyIsError(lower_bound, upper_bound)) {\n\t return error.value;\n\t }\n\t\n\t return jStat.erf(lower_bound);\n\t};\n\t\n\t// TODO\n\texports.ERF.PRECISE = function() {\n\t throw new Error('ERF.PRECISE is not implemented');\n\t};\n\t\n\texports.ERFC = function(x) {\n\t // Return error if x is not a number\n\t if (isNaN(x)) {\n\t return error.value;\n\t }\n\t\n\t return jStat.erfc(x);\n\t};\n\t\n\t// TODO\n\texports.ERFC.PRECISE = function() {\n\t throw new Error('ERFC.PRECISE is not implemented');\n\t};\n\t\n\texports.GESTEP = function(number, step) {\n\t step = step || 0;\n\t number = utils.parseNumber(number);\n\t if (utils.anyIsError(step, number)) {\n\t return number;\n\t }\n\t\n\t // Return delta\n\t return (number >= step) ? 1 : 0;\n\t};\n\t\n\texports.HEX2BIN = function(number, places) {\n\t // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n\t if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n\t return error.num;\n\t }\n\t\n\t // Check if number is negative\n\t var negative = (number.length === 10 && number.substring(0, 1).toLowerCase() === 'f') ? true : false;\n\t\n\t // Convert hexadecimal number to decimal\n\t var decimal = (negative) ? parseInt(number, 16) - 1099511627776 : parseInt(number, 16);\n\t\n\t // Return error if number is lower than -512 or greater than 511\n\t if (decimal < -512 || decimal > 511) {\n\t return error.num;\n\t }\n\t\n\t // Ignore places and return a 10-character binary number if number is negative\n\t if (negative) {\n\t return '1' + text.REPT('0', 9 - (512 + decimal).toString(2).length) + (512 + decimal).toString(2);\n\t }\n\t\n\t // Convert decimal number to binary\n\t var result = decimal.toString(2);\n\t\n\t // Return binary number using the minimum number of characters necessary if places is undefined\n\t if (places === undefined) {\n\t return result;\n\t } else {\n\t // Return error if places is nonnumeric\n\t if (isNaN(places)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if places is negative\n\t if (places < 0) {\n\t return error.num;\n\t }\n\t\n\t // Truncate places in case it is not an integer\n\t places = Math.floor(places);\n\t\n\t // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n\t return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n\t }\n\t};\n\t\n\texports.HEX2DEC = function(number) {\n\t // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n\t if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n\t return error.num;\n\t }\n\t\n\t // Convert hexadecimal number to decimal\n\t var decimal = parseInt(number, 16);\n\t\n\t // Return decimal number\n\t return (decimal >= 549755813888) ? decimal - 1099511627776 : decimal;\n\t};\n\t\n\texports.HEX2OCT = function(number, places) {\n\t // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n\t if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n\t return error.num;\n\t }\n\t\n\t // Convert hexadecimal number to decimal\n\t var decimal = parseInt(number, 16);\n\t\n\t // Return error if number is positive and greater than 0x1fffffff (536870911)\n\t if (decimal > 536870911 && decimal < 1098974756864) {\n\t return error.num;\n\t }\n\t\n\t // Ignore places and return a 10-character octal number if number is negative\n\t if (decimal >= 1098974756864) {\n\t return (decimal - 1098437885952).toString(8);\n\t }\n\t\n\t // Convert decimal number to octal\n\t var result = decimal.toString(8);\n\t\n\t // Return octal number using the minimum number of characters necessary if places is undefined\n\t if (places === undefined) {\n\t return result;\n\t } else {\n\t // Return error if places is nonnumeric\n\t if (isNaN(places)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if places is negative\n\t if (places < 0) {\n\t return error.num;\n\t }\n\t\n\t // Truncate places in case it is not an integer\n\t places = Math.floor(places);\n\t\n\t // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n\t return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n\t }\n\t};\n\t\n\texports.IMABS = function(inumber) {\n\t // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t // Return error if either coefficient is not a number\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Return absolute value of complex number\n\t return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));\n\t};\n\t\n\texports.IMAGINARY = function(inumber) {\n\t if (inumber === undefined || inumber === true || inumber === false) {\n\t return error.value;\n\t }\n\t\n\t // Return 0 if inumber is equal to 0\n\t if (inumber === 0 || inumber === '0') {\n\t return 0;\n\t }\n\t\n\t // Handle special cases\n\t if (['i', 'j'].indexOf(inumber) >= 0) {\n\t return 1;\n\t }\n\t\n\t // Normalize imaginary coefficient\n\t inumber = inumber.replace('+i', '+1i').replace('-i', '-1i').replace('+j', '+1j').replace('-j', '-1j');\n\t\n\t // Lookup sign\n\t var plus = inumber.indexOf('+');\n\t var minus = inumber.indexOf('-');\n\t if (plus === 0) {\n\t plus = inumber.indexOf('+', 1);\n\t }\n\t\n\t if (minus === 0) {\n\t minus = inumber.indexOf('-', 1);\n\t }\n\t\n\t // Lookup imaginary unit\n\t var last = inumber.substring(inumber.length - 1, inumber.length);\n\t var unit = (last === 'i' || last === 'j');\n\t\n\t if (plus >= 0 || minus >= 0) {\n\t // Return error if imaginary unit is neither i nor j\n\t if (!unit) {\n\t return error.num;\n\t }\n\t\n\t // Return imaginary coefficient of complex number\n\t if (plus >= 0) {\n\t return (isNaN(inumber.substring(0, plus)) || isNaN(inumber.substring(plus + 1, inumber.length - 1))) ?\n\t error.num :\n\t Number(inumber.substring(plus + 1, inumber.length - 1));\n\t } else {\n\t return (isNaN(inumber.substring(0, minus)) || isNaN(inumber.substring(minus + 1, inumber.length - 1))) ?\n\t error.num :\n\t -Number(inumber.substring(minus + 1, inumber.length - 1));\n\t }\n\t } else {\n\t if (unit) {\n\t return (isNaN(inumber.substring(0, inumber.length - 1))) ? error.num : inumber.substring(0, inumber.length - 1);\n\t } else {\n\t return (isNaN(inumber)) ? error.num : 0;\n\t }\n\t }\n\t};\n\t\n\texports.IMARGUMENT = function(inumber) {\n\t // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t // Return error if either coefficient is not a number\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if inumber is equal to zero\n\t if (x === 0 && y === 0) {\n\t return error.div0;\n\t }\n\t\n\t // Return PI/2 if x is equal to zero and y is positive\n\t if (x === 0 && y > 0) {\n\t return Math.PI / 2;\n\t }\n\t\n\t // Return -PI/2 if x is equal to zero and y is negative\n\t if (x === 0 && y < 0) {\n\t return -Math.PI / 2;\n\t }\n\t\n\t // Return zero if x is negative and y is equal to zero\n\t if (y === 0 && x > 0) {\n\t return 0;\n\t }\n\t\n\t // Return zero if x is negative and y is equal to zero\n\t if (y === 0 && x < 0) {\n\t return -Math.PI;\n\t }\n\t\n\t // Return argument of complex number\n\t if (x > 0) {\n\t return Math.atan(y / x);\n\t } else if (x < 0 && y >= 0) {\n\t return Math.atan(y / x) + Math.PI;\n\t } else {\n\t return Math.atan(y / x) - Math.PI;\n\t }\n\t};\n\t\n\texports.IMCONJUGATE = function(inumber) {\n\t // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Return conjugate of complex number\n\t return (y !== 0) ? exports.COMPLEX(x, -y, unit) : inumber;\n\t};\n\t\n\texports.IMCOS = function(inumber) {\n\t // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Return cosine of complex number\n\t return exports.COMPLEX(Math.cos(x) * (Math.exp(y) + Math.exp(-y)) / 2, -Math.sin(x) * (Math.exp(y) - Math.exp(-y)) / 2, unit);\n\t};\n\t\n\texports.IMCOSH = function(inumber) {\n\t // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Return hyperbolic cosine of complex number\n\t return exports.COMPLEX(Math.cos(y) * (Math.exp(x) + Math.exp(-x)) / 2, Math.sin(y) * (Math.exp(x) - Math.exp(-x)) / 2, unit);\n\t};\n\t\n\texports.IMCOT = function(inumber) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Return cotangent of complex number\n\t return exports.IMDIV(exports.IMCOS(inumber), exports.IMSIN(inumber));\n\t};\n\t\n\texports.IMDIV = function(inumber1, inumber2) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var a = exports.IMREAL(inumber1);\n\t var b = exports.IMAGINARY(inumber1);\n\t var c = exports.IMREAL(inumber2);\n\t var d = exports.IMAGINARY(inumber2);\n\t\n\t if (utils.anyIsError(a, b, c, d)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit1 = inumber1.substring(inumber1.length - 1);\n\t var unit2 = inumber2.substring(inumber2.length - 1);\n\t var unit = 'i';\n\t if (unit1 === 'j') {\n\t unit = 'j';\n\t } else if (unit2 === 'j') {\n\t unit = 'j';\n\t }\n\t\n\t // Return error if inumber2 is null\n\t if (c === 0 && d === 0) {\n\t return error.num;\n\t }\n\t\n\t // Return exponential of complex number\n\t var den = c * c + d * d;\n\t return exports.COMPLEX((a * c + b * d) / den, (b * c - a * d) / den, unit);\n\t};\n\t\n\texports.IMEXP = function(inumber) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Return exponential of complex number\n\t var e = Math.exp(x);\n\t return exports.COMPLEX(e * Math.cos(y), e * Math.sin(y), unit);\n\t};\n\t\n\texports.IMLN = function(inumber) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Return exponential of complex number\n\t return exports.COMPLEX(Math.log(Math.sqrt(x * x + y * y)), Math.atan(y / x), unit);\n\t};\n\t\n\texports.IMLOG10 = function(inumber) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Return exponential of complex number\n\t return exports.COMPLEX(Math.log(Math.sqrt(x * x + y * y)) / Math.log(10), Math.atan(y / x) / Math.log(10), unit);\n\t};\n\t\n\texports.IMLOG2 = function(inumber) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Return exponential of complex number\n\t return exports.COMPLEX(Math.log(Math.sqrt(x * x + y * y)) / Math.log(2), Math.atan(y / x) / Math.log(2), unit);\n\t};\n\t\n\texports.IMPOWER = function(inumber, number) {\n\t number = utils.parseNumber(number);\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t if (utils.anyIsError(number, x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Calculate power of modulus\n\t var p = Math.pow(exports.IMABS(inumber), number);\n\t\n\t // Calculate argument\n\t var t = exports.IMARGUMENT(inumber);\n\t\n\t // Return exponential of complex number\n\t return exports.COMPLEX(p * Math.cos(number * t), p * Math.sin(number * t), unit);\n\t};\n\t\n\texports.IMPRODUCT = function() {\n\t // Initialize result\n\t var result = arguments[0];\n\t\n\t if (!arguments.length) {\n\t return error.value;\n\t }\n\t\n\t // Loop on all numbers\n\t for (var i = 1; i < arguments.length; i++) {\n\t // Lookup coefficients of two complex numbers\n\t var a = exports.IMREAL(result);\n\t var b = exports.IMAGINARY(result);\n\t var c = exports.IMREAL(arguments[i]);\n\t var d = exports.IMAGINARY(arguments[i]);\n\t\n\t if (utils.anyIsError(a, b, c, d)) {\n\t return error.value;\n\t }\n\t\n\t // Complute product of two complex numbers\n\t result = exports.COMPLEX(a * c - b * d, a * d + b * c);\n\t }\n\t\n\t // Return product of complex numbers\n\t return result;\n\t};\n\t\n\texports.IMREAL = function(inumber) {\n\t if (inumber === undefined || inumber === true || inumber === false) {\n\t return error.value;\n\t }\n\t\n\t // Return 0 if inumber is equal to 0\n\t if (inumber === 0 || inumber === '0') {\n\t return 0;\n\t }\n\t\n\t // Handle special cases\n\t if (['i', '+i', '1i', '+1i', '-i', '-1i', 'j', '+j', '1j', '+1j', '-j', '-1j'].indexOf(inumber) >= 0) {\n\t return 0;\n\t }\n\t\n\t // Lookup sign\n\t var plus = inumber.indexOf('+');\n\t var minus = inumber.indexOf('-');\n\t if (plus === 0) {\n\t plus = inumber.indexOf('+', 1);\n\t }\n\t if (minus === 0) {\n\t minus = inumber.indexOf('-', 1);\n\t }\n\t\n\t // Lookup imaginary unit\n\t var last = inumber.substring(inumber.length - 1, inumber.length);\n\t var unit = (last === 'i' || last === 'j');\n\t\n\t if (plus >= 0 || minus >= 0) {\n\t // Return error if imaginary unit is neither i nor j\n\t if (!unit) {\n\t return error.num;\n\t }\n\t\n\t // Return real coefficient of complex number\n\t if (plus >= 0) {\n\t return (isNaN(inumber.substring(0, plus)) || isNaN(inumber.substring(plus + 1, inumber.length - 1))) ?\n\t error.num :\n\t Number(inumber.substring(0, plus));\n\t } else {\n\t return (isNaN(inumber.substring(0, minus)) || isNaN(inumber.substring(minus + 1, inumber.length - 1))) ?\n\t error.num :\n\t Number(inumber.substring(0, minus));\n\t }\n\t } else {\n\t if (unit) {\n\t return (isNaN(inumber.substring(0, inumber.length - 1))) ? error.num : 0;\n\t } else {\n\t return (isNaN(inumber)) ? error.num : inumber;\n\t }\n\t }\n\t};\n\t\n\texports.IMSEC = function(inumber) {\n\t // Return error if inumber is a logical value\n\t if (inumber === true || inumber === false) {\n\t return error.value;\n\t }\n\t\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Return secant of complex number\n\t return exports.IMDIV('1', exports.IMCOS(inumber));\n\t};\n\t\n\texports.IMSECH = function(inumber) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Return hyperbolic secant of complex number\n\t return exports.IMDIV('1', exports.IMCOSH(inumber));\n\t};\n\t\n\texports.IMSIN = function(inumber) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Return sine of complex number\n\t return exports.COMPLEX(Math.sin(x) * (Math.exp(y) + Math.exp(-y)) / 2, Math.cos(x) * (Math.exp(y) - Math.exp(-y)) / 2, unit);\n\t};\n\t\n\texports.IMSINH = function(inumber) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Return hyperbolic sine of complex number\n\t return exports.COMPLEX(Math.cos(y) * (Math.exp(x) - Math.exp(-x)) / 2, Math.sin(y) * (Math.exp(x) + Math.exp(-x)) / 2, unit);\n\t};\n\t\n\texports.IMSQRT = function(inumber) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Calculate power of modulus\n\t var s = Math.sqrt(exports.IMABS(inumber));\n\t\n\t // Calculate argument\n\t var t = exports.IMARGUMENT(inumber);\n\t\n\t // Return exponential of complex number\n\t return exports.COMPLEX(s * Math.cos(t / 2), s * Math.sin(t / 2), unit);\n\t};\n\t\n\texports.IMCSC = function (inumber) {\n\t // Return error if inumber is a logical value\n\t if (inumber === true || inumber === false) {\n\t return error.value;\n\t }\n\t\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t // Return error if either coefficient is not a number\n\t if (utils.anyIsError(x, y)) {\n\t return error.num;\n\t }\n\t\n\t // Return cosecant of complex number\n\t return exports.IMDIV('1', exports.IMSIN(inumber));\n\t};\n\t\n\texports.IMCSCH = function (inumber) {\n\t // Return error if inumber is a logical value\n\t if (inumber === true || inumber === false) {\n\t return error.value;\n\t }\n\t\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t // Return error if either coefficient is not a number\n\t if (utils.anyIsError(x, y)) {\n\t return error.num;\n\t }\n\t\n\t // Return hyperbolic cosecant of complex number\n\t return exports.IMDIV('1', exports.IMSINH(inumber));\n\t};\n\t\n\texports.IMSUB = function(inumber1, inumber2) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var a = this.IMREAL(inumber1);\n\t var b = this.IMAGINARY(inumber1);\n\t var c = this.IMREAL(inumber2);\n\t var d = this.IMAGINARY(inumber2);\n\t\n\t if (utils.anyIsError(a, b, c, d)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit1 = inumber1.substring(inumber1.length - 1);\n\t var unit2 = inumber2.substring(inumber2.length - 1);\n\t var unit = 'i';\n\t if (unit1 === 'j') {\n\t unit = 'j';\n\t } else if (unit2 === 'j') {\n\t unit = 'j';\n\t }\n\t\n\t // Return _ of two complex numbers\n\t return this.COMPLEX(a - c, b - d, unit);\n\t};\n\t\n\texports.IMSUM = function() {\n\t if (!arguments.length) {\n\t return error.value;\n\t }\n\t var args = utils.flatten(arguments);\n\t\n\t // Initialize result\n\t var result = args[0];\n\t\n\t // Loop on all numbers\n\t for (var i = 1; i < args.length; i++) {\n\t // Lookup coefficients of two complex numbers\n\t var a = this.IMREAL(result);\n\t var b = this.IMAGINARY(result);\n\t var c = this.IMREAL(args[i]);\n\t var d = this.IMAGINARY(args[i]);\n\t\n\t if (utils.anyIsError(a, b, c, d)) {\n\t return error.value;\n\t }\n\t\n\t // Complute product of two complex numbers\n\t result = this.COMPLEX(a + c, b + d);\n\t }\n\t\n\t // Return sum of complex numbers\n\t return result;\n\t};\n\t\n\texports.IMTAN = function(inumber) {\n\t // Return error if inumber is a logical value\n\t if (inumber === true || inumber === false) {\n\t return error.value;\n\t }\n\t\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Return tangent of complex number\n\t return this.IMDIV(this.IMSIN(inumber), this.IMCOS(inumber));\n\t};\n\t\n\texports.OCT2BIN = function(number, places) {\n\t // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n\t if (!/^[0-7]{1,10}$/.test(number)) {\n\t return error.num;\n\t }\n\t\n\t // Check if number is negative\n\t var negative = (number.length === 10 && number.substring(0, 1) === '7') ? true : false;\n\t\n\t // Convert octal number to decimal\n\t var decimal = (negative) ? parseInt(number, 8) - 1073741824 : parseInt(number, 8);\n\t\n\t // Return error if number is lower than -512 or greater than 511\n\t if (decimal < -512 || decimal > 511) {\n\t return error.num;\n\t }\n\t\n\t // Ignore places and return a 10-character binary number if number is negative\n\t if (negative) {\n\t return '1' + text.REPT('0', 9 - (512 + decimal).toString(2).length) + (512 + decimal).toString(2);\n\t }\n\t\n\t // Convert decimal number to binary\n\t var result = decimal.toString(2);\n\t\n\t // Return binary number using the minimum number of characters necessary if places is undefined\n\t if (typeof places === 'undefined') {\n\t return result;\n\t } else {\n\t // Return error if places is nonnumeric\n\t if (isNaN(places)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if places is negative\n\t if (places < 0) {\n\t return error.num;\n\t }\n\t\n\t // Truncate places in case it is not an integer\n\t places = Math.floor(places);\n\t\n\t // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n\t return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n\t }\n\t};\n\t\n\texports.OCT2DEC = function(number) {\n\t // Return error if number is not octal or contains more than ten characters (10 digits)\n\t if (!/^[0-7]{1,10}$/.test(number)) {\n\t return error.num;\n\t }\n\t\n\t // Convert octal number to decimal\n\t var decimal = parseInt(number, 8);\n\t\n\t // Return decimal number\n\t return (decimal >= 536870912) ? decimal - 1073741824 : decimal;\n\t};\n\t\n\texports.OCT2HEX = function(number, places) {\n\t // Return error if number is not octal or contains more than ten characters (10 digits)\n\t if (!/^[0-7]{1,10}$/.test(number)) {\n\t return error.num;\n\t }\n\t\n\t // Convert octal number to decimal\n\t var decimal = parseInt(number, 8);\n\t\n\t // Ignore places and return a 10-character octal number if number is negative\n\t if (decimal >= 536870912) {\n\t return 'ff' + (decimal + 3221225472).toString(16);\n\t }\n\t\n\t // Convert decimal number to hexadecimal\n\t var result = decimal.toString(16);\n\t\n\t // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n\t if (places === undefined) {\n\t return result;\n\t } else {\n\t // Return error if places is nonnumeric\n\t if (isNaN(places)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if places is negative\n\t if (places < 0) {\n\t return error.num;\n\t }\n\t\n\t // Truncate places in case it is not an integer\n\t places = Math.floor(places);\n\t\n\t // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n\t return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n\t }\n\t};\n\n\n/***/ },\n/* 26 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar M = Math;\n\tfunction _horner(arr, v) { return arr.reduce(function(z,w){return v * z + w;},0); };\n\tfunction _bessel_iter(x, n, f0, f1, sign) {\n\t if(!sign) sign = -1;\n\t var tdx = 2 / x, f2;\n\t if(n === 0) return f0;\n\t if(n === 1) return f1;\n\t for(var o = 1; o != n; ++o) {\n\t f2 = f1 * o * tdx + sign * f0;\n\t f0 = f1; f1 = f2;\n\t }\n\t return f1;\n\t}\n\tfunction _bessel_wrap(bessel0, bessel1, name, nonzero, sign) {\n\t return function bessel(x,n) {\n\t if(n === 0) return bessel0(x);\n\t if(n === 1) return bessel1(x);\n\t if(n < 0) throw name + ': Order (' + n + ') must be nonnegative';\n\t if(nonzero == 1 && x === 0) throw name + ': Undefined when x == 0';\n\t if(nonzero == 2 && x <= 0) throw name + ': Undefined when x <= 0';\n\t var b0 = bessel0(x), b1 = bessel1(x);\n\t return _bessel_iter(x, n, b0, b1, sign);\n\t };\n\t}\n\tvar besselj = (function() {\n\t var b0_a1a = [57568490574.0,-13362590354.0,651619640.7,-11214424.18,77392.33017,-184.9052456].reverse();\n\t var b0_a2a = [57568490411.0,1029532985.0,9494680.718,59272.64853,267.8532712,1.0].reverse();\n\t var b0_a1b = [1.0, -0.1098628627e-2, 0.2734510407e-4, -0.2073370639e-5, 0.2093887211e-6].reverse();\n\t var b0_a2b = [-0.1562499995e-1, 0.1430488765e-3, -0.6911147651e-5, 0.7621095161e-6, -0.934935152e-7].reverse();\n\t var W = 0.636619772; // 2 / Math.PI\n\t\n\t function bessel0(x) {\n\t var a, a1, a2, y = x * x, xx = M.abs(x) - 0.785398164;\n\t if(M.abs(x) < 8) {\n\t a1 = _horner(b0_a1a, y);\n\t a2 = _horner(b0_a2a, y);\n\t a = a1/a2;\n\t }\n\t else {\n\t y = 64 / y;\n\t a1 = _horner(b0_a1b, y);\n\t a2 = _horner(b0_a2b, y);\n\t a = M.sqrt(W/M.abs(x))*(M.cos(xx)*a1-M.sin(xx)*a2*8/M.abs(x));\n\t }\n\t return a;\n\t }\n\t var b1_a1a = [72362614232.0,-7895059235.0,242396853.1,-2972611.439, 15704.48260, -30.16036606].reverse();\n\t var b1_a2a = [144725228442.0, 2300535178.0, 18583304.74, 99447.43394, 376.9991397, 1.0].reverse();\n\t var b1_a1b = [1.0, 0.183105e-2, -0.3516396496e-4, 0.2457520174e-5, -0.240337019e-6].reverse();\n\t var b1_a2b = [0.04687499995, -0.2002690873e-3, 0.8449199096e-5, -0.88228987e-6, 0.105787412e-6].reverse();\n\t function bessel1(x) {\n\t var a, a1, a2, y = x*x, xx = M.abs(x) - 2.356194491;\n\t if(Math.abs(x)< 8) {\n\t a1 = x*_horner(b1_a1a, y);\n\t a2 = _horner(b1_a2a, y);\n\t a = a1 / a2;\n\t } else {\n\t y = 64 / y;\n\t a1=_horner(b1_a1b, y);\n\t a2=_horner(b1_a2b, y);\n\t a=M.sqrt(W/M.abs(x))*(M.cos(xx)*a1-M.sin(xx)*a2*8/M.abs(x));\n\t if(x < 0) a = -a;\n\t }\n\t return a;\n\t }\n\t return function besselj(x, n) {\n\t n = Math.round(n);\n\t if(n === 0) return bessel0(M.abs(x));\n\t if(n === 1) return bessel1(M.abs(x));\n\t if(n < 0) throw 'BESSELJ: Order (' + n + ') must be nonnegative';\n\t if(M.abs(x) === 0) return 0;\n\t\n\t var ret, j, tox = 2 / M.abs(x), m, jsum, sum, bjp, bj, bjm;\n\t if(M.abs(x) > n) {\n\t ret = _bessel_iter(x, n, bessel0(M.abs(x)), bessel1(M.abs(x)),-1);\n\t } else {\n\t m=2*M.floor((n+M.floor(M.sqrt(40*n)))/2);\n\t jsum=0;\n\t bjp=ret=sum=0.0;\n\t bj=1.0;\n\t for (j=m;j>0;j--) {\n\t bjm=j*tox*bj-bjp;\n\t bjp=bj;\n\t bj=bjm;\n\t if (M.abs(bj) > 1E10) {\n\t bj *= 1E-10;\n\t bjp *= 1E-10;\n\t ret *= 1E-10;\n\t sum *= 1E-10;\n\t }\n\t if (jsum) sum += bj;\n\t jsum=!jsum;\n\t if (j == n) ret=bjp;\n\t }\n\t sum=2.0*sum-bj;\n\t ret /= sum;\n\t }\n\t return x < 0 && (n%2) ? -ret : ret;\n\t };\n\t})();\n\tvar bessely = (function() {\n\t var b0_a1a = [-2957821389.0, 7062834065.0, -512359803.6, 10879881.29, -86327.92757, 228.4622733].reverse();\n\t var b0_a2a = [40076544269.0, 745249964.8, 7189466.438, 47447.26470, 226.1030244, 1.0].reverse();\n\t var b0_a1b = [1.0, -0.1098628627e-2, 0.2734510407e-4, -0.2073370639e-5, 0.2093887211e-6].reverse();\n\t var b0_a2b = [-0.1562499995e-1, 0.1430488765e-3, -0.6911147651e-5, 0.7621095161e-6, -0.934945152e-7].reverse();\n\t\n\t var W = 0.636619772;\n\t function bessel0(x) {\n\t var a, a1, a2, y = x * x, xx = x - 0.785398164;\n\t if(x < 8) {\n\t a1 = _horner(b0_a1a, y);\n\t a2 = _horner(b0_a2a, y);\n\t a = a1/a2 + W * besselj(x,0) * M.log(x);\n\t } else {\n\t y = 64 / y;\n\t a1 = _horner(b0_a1b, y);\n\t a2 = _horner(b0_a2b, y);\n\t a = M.sqrt(W/x)*(M.sin(xx)*a1+M.cos(xx)*a2*8/x);\n\t }\n\t return a;\n\t }\n\t\n\t var b1_a1a = [-0.4900604943e13, 0.1275274390e13, -0.5153438139e11, 0.7349264551e9, -0.4237922726e7, 0.8511937935e4].reverse();\n\t var b1_a2a = [0.2499580570e14, 0.4244419664e12, 0.3733650367e10, 0.2245904002e8, 0.1020426050e6, 0.3549632885e3, 1].reverse();\n\t var b1_a1b = [1.0, 0.183105e-2, -0.3516396496e-4, 0.2457520174e-5, -0.240337019e-6].reverse();\n\t var b1_a2b = [0.04687499995, -0.2002690873e-3, 0.8449199096e-5, -0.88228987e-6, 0.105787412e-6].reverse();\n\t function bessel1(x) {\n\t var a, a1, a2, y = x*x, xx = x - 2.356194491;\n\t if(x < 8) {\n\t a1 = x*_horner(b1_a1a, y);\n\t a2 = _horner(b1_a2a, y);\n\t a = a1/a2 + W * (besselj(x,1) * M.log(x) - 1 / x);\n\t } else {\n\t y = 64 / y;\n\t a1=_horner(b1_a1b, y);\n\t a2=_horner(b1_a2b, y);\n\t a=M.sqrt(W/x)*(M.sin(xx)*a1+M.cos(xx)*a2*8/x);\n\t }\n\t return a;\n\t }\n\t\n\t return _bessel_wrap(bessel0, bessel1, 'BESSELY', 1, -1);\n\t})();\n\tvar besseli = (function() {\n\t var b0_a = [1.0, 3.5156229, 3.0899424, 1.2067492, 0.2659732, 0.360768e-1, 0.45813e-2].reverse();\n\t var b0_b = [0.39894228, 0.1328592e-1, 0.225319e-2, -0.157565e-2, 0.916281e-2, -0.2057706e-1, 0.2635537e-1, -0.1647633e-1, 0.392377e-2].reverse();\n\t function bessel0(x) {\n\t if(x <= 3.75) return _horner(b0_a, x*x/(3.75*3.75));\n\t return M.exp(M.abs(x))/M.sqrt(M.abs(x))*_horner(b0_b, 3.75/M.abs(x));\n\t }\n\t\n\t var b1_a = [0.5, 0.87890594, 0.51498869, 0.15084934, 0.2658733e-1, 0.301532e-2, 0.32411e-3].reverse();\n\t var b1_b = [0.39894228, -0.3988024e-1, -0.362018e-2, 0.163801e-2, -0.1031555e-1, 0.2282967e-1, -0.2895312e-1, 0.1787654e-1, -0.420059e-2].reverse();\n\t function bessel1(x) {\n\t if(x < 3.75) return x * _horner(b1_a, x*x/(3.75*3.75));\n\t return (x < 0 ? -1 : 1) * M.exp(M.abs(x))/M.sqrt(M.abs(x))*_horner(b1_b, 3.75/M.abs(x));\n\t }\n\t\n\t return function besseli(x, n) {\n\t n = Math.round(n);\n\t if(n === 0) return bessel0(x);\n\t if(n == 1) return bessel1(x);\n\t if(n < 0) throw 'BESSELI Order (' + n + ') must be nonnegative';\n\t if(M.abs(x) === 0) return 0;\n\t\n\t var ret, j, tox = 2 / M.abs(x), m, bip, bi, bim;\n\t m=2*M.round((n+M.round(M.sqrt(40*n)))/2);\n\t bip=ret=0.0;\n\t bi=1.0;\n\t for (j=m;j>0;j--) {\n\t bim=j*tox*bi + bip;\n\t bip=bi; bi=bim;\n\t if (M.abs(bi) > 1E10) {\n\t bi *= 1E-10;\n\t bip *= 1E-10;\n\t ret *= 1E-10;\n\t }\n\t if(j == n) ret = bip;\n\t }\n\t ret *= besseli(x, 0) / bi;\n\t return x < 0 && (n%2) ? -ret : ret;\n\t };\n\t\n\t})();\n\t\n\tvar besselk = (function() {\n\t var b0_a = [-0.57721566, 0.42278420, 0.23069756, 0.3488590e-1, 0.262698e-2, 0.10750e-3, 0.74e-5].reverse();\n\t var b0_b = [1.25331414, -0.7832358e-1, 0.2189568e-1, -0.1062446e-1, 0.587872e-2, -0.251540e-2, 0.53208e-3].reverse();\n\t function bessel0(x) {\n\t if(x <= 2) return -M.log(x/2)*besseli(x,0) + _horner(b0_a, x*x/4);\n\t return M.exp(-x)/M.sqrt(x)*_horner(b0_b, 2/x);\n\t }\n\t\n\t var b1_a = [1.0, 0.15443144, -0.67278579, -0.18156897, -0.1919402e-1, -0.110404e-2, -0.4686e-4].reverse();\n\t var b1_b = [1.25331414, 0.23498619, -0.3655620e-1, 0.1504268e-1, -0.780353e-2, 0.325614e-2, -0.68245e-3].reverse();\n\t function bessel1(x) {\n\t if(x <= 2) return M.log(x/2)*besseli(x,1) + (1/x)*_horner(b1_a, x*x/4);\n\t return M.exp(-x)/M.sqrt(x)*_horner(b1_b, 2/x);\n\t }\n\t\n\t return _bessel_wrap(bessel0, bessel1, 'BESSELK', 2, 1);\n\t})();\n\tif(true) {\n\t exports.besselj = besselj;\n\t exports.bessely = bessely;\n\t exports.besseli = besseli;\n\t exports.besselk = besselk;\n\t}\n\t\n\n\n/***/ },\n/* 27 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar error = __webpack_require__(16);\n\tvar utils = __webpack_require__(15);\n\t\n\tvar d1900 = new Date(1900, 0, 1);\n\tvar WEEK_STARTS = [\n\t undefined,\n\t 0,\n\t 1,\n\t undefined,\n\t undefined,\n\t undefined,\n\t undefined,\n\t undefined,\n\t undefined,\n\t undefined,\n\t undefined,\n\t undefined,\n\t 1,\n\t 2,\n\t 3,\n\t 4,\n\t 5,\n\t 6,\n\t 0\n\t];\n\tvar WEEK_TYPES = [\n\t [],\n\t [1, 2, 3, 4, 5, 6, 7],\n\t [7, 1, 2, 3, 4, 5, 6],\n\t [6, 0, 1, 2, 3, 4, 5],\n\t [],\n\t [],\n\t [],\n\t [],\n\t [],\n\t [],\n\t [],\n\t [7, 1, 2, 3, 4, 5, 6],\n\t [6, 7, 1, 2, 3, 4, 5],\n\t [5, 6, 7, 1, 2, 3, 4],\n\t [4, 5, 6, 7, 1, 2, 3],\n\t [3, 4, 5, 6, 7, 1, 2],\n\t [2, 3, 4, 5, 6, 7, 1],\n\t [1, 2, 3, 4, 5, 6, 7]\n\t];\n\tvar WEEKEND_TYPES = [\n\t [],\n\t [6, 0],\n\t [0, 1],\n\t [1, 2],\n\t [2, 3],\n\t [3, 4],\n\t [4, 5],\n\t [5, 6],\n\t undefined,\n\t undefined,\n\t undefined, [0, 0],\n\t [1, 1],\n\t [2, 2],\n\t [3, 3],\n\t [4, 4],\n\t [5, 5],\n\t [6, 6]\n\t];\n\t\n\texports.DATE = function(year, month, day) {\n\t var result;\n\t\n\t year = utils.parseNumber(year);\n\t month = utils.parseNumber(month);\n\t day = utils.parseNumber(day);\n\t\n\t if (utils.anyIsError(year, month, day)) {\n\t result = error.value;\n\t\n\t } else if (year < 0 || month < 0 || day < 0) {\n\t result = error.num;\n\t\n\t } else {\n\t result = new Date(year, month - 1, day);\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.DATEVALUE = function(date_text) {\n\t if (typeof date_text !== 'string') {\n\t return error.value;\n\t }\n\t var date = Date.parse(date_text);\n\t\n\t if (isNaN(date)) {\n\t return error.value;\n\t }\n\t if (date <= -2203891200000) {\n\t return (date - d1900) / 86400000 + 1;\n\t }\n\t\n\t return (date - d1900) / 86400000 + 2;\n\t};\n\t\n\texports.DAY = function(serial_number) {\n\t var date = utils.parseDate(serial_number);\n\t if (date instanceof Error) {\n\t return date;\n\t }\n\t\n\t return date.getDate();\n\t};\n\t\n\texports.DAYS = function(end_date, start_date) {\n\t end_date = utils.parseDate(end_date);\n\t start_date = utils.parseDate(start_date);\n\t\n\t if (end_date instanceof Error) {\n\t return end_date;\n\t }\n\t if (start_date instanceof Error) {\n\t return start_date;\n\t }\n\t\n\t return serial(end_date) - serial(start_date);\n\t};\n\t\n\texports.DAYS360 = function(start_date, end_date, method) {\n\t method = utils.parseBool(method);\n\t start_date = utils.parseDate(start_date);\n\t end_date = utils.parseDate(end_date);\n\t\n\t if (start_date instanceof Error) {\n\t return start_date;\n\t }\n\t if (end_date instanceof Error) {\n\t return end_date;\n\t }\n\t if (method instanceof Error) {\n\t return method;\n\t }\n\t var sm = start_date.getMonth();\n\t var em = end_date.getMonth();\n\t var sd, ed;\n\t\n\t if (method) {\n\t sd = start_date.getDate() === 31 ? 30 : start_date.getDate();\n\t ed = end_date.getDate() === 31 ? 30 : end_date.getDate();\n\t } else {\n\t var smd = new Date(start_date.getFullYear(), sm + 1, 0).getDate();\n\t var emd = new Date(end_date.getFullYear(), em + 1, 0).getDate();\n\t sd = start_date.getDate() === smd ? 30 : start_date.getDate();\n\t if (end_date.getDate() === emd) {\n\t if (sd < 30) {\n\t em++;\n\t ed = 1;\n\t } else {\n\t ed = 30;\n\t }\n\t } else {\n\t ed = end_date.getDate();\n\t }\n\t }\n\t\n\t return 360 * (end_date.getFullYear() - start_date.getFullYear()) +\n\t 30 * (em - sm) + (ed - sd);\n\t};\n\t\n\texports.EDATE = function(start_date, months) {\n\t start_date = utils.parseDate(start_date);\n\t\n\t if (start_date instanceof Error) {\n\t return start_date;\n\t }\n\t if (isNaN(months)) {\n\t return error.value;\n\t }\n\t months = parseInt(months, 10);\n\t start_date.setMonth(start_date.getMonth() + months);\n\t\n\t return serial(start_date);\n\t};\n\t\n\texports.EOMONTH = function(start_date, months) {\n\t start_date = utils.parseDate(start_date);\n\t\n\t if (start_date instanceof Error) {\n\t return start_date;\n\t }\n\t if (isNaN(months)) {\n\t return error.value;\n\t }\n\t months = parseInt(months, 10);\n\t\n\t return serial(new Date(start_date.getFullYear(), start_date.getMonth() + months + 1, 0));\n\t};\n\t\n\texports.HOUR = function(serial_number) {\n\t serial_number = utils.parseDate(serial_number);\n\t\n\t if (serial_number instanceof Error) {\n\t return serial_number;\n\t }\n\t\n\t return serial_number.getHours();\n\t};\n\t\n\texports.INTERVAL = function (second) {\n\t if (typeof second !== 'number' && typeof second !== 'string') {\n\t return error.value;\n\t } else {\n\t second = parseInt(second, 10);\n\t }\n\t\n\t var year = Math.floor(second/946080000);\n\t second = second%946080000;\n\t var month = Math.floor(second/2592000);\n\t second = second%2592000;\n\t var day = Math.floor(second/86400);\n\t second = second%86400;\n\t\n\t var hour = Math.floor(second/3600);\n\t second = second%3600;\n\t var min = Math.floor(second/60);\n\t second = second%60;\n\t var sec = second;\n\t\n\t year = (year > 0) ? year + 'Y' : '';\n\t month = (month > 0) ? month + 'M' : '';\n\t day = (day > 0) ? day + 'D' : '';\n\t hour = (hour > 0) ? hour + 'H' : '';\n\t min = (min > 0) ? min + 'M' : '';\n\t sec = (sec > 0) ? sec + 'S' : '';\n\t\n\t return 'P' + year + month + day + 'T' + hour + min + sec;\n\t};\n\t\n\texports.ISOWEEKNUM = function(date) {\n\t date = utils.parseDate(date);\n\t\n\t if (date instanceof Error) {\n\t return date;\n\t }\n\t\n\t date.setHours(0, 0, 0);\n\t date.setDate(date.getDate() + 4 - (date.getDay() || 7));\n\t var yearStart = new Date(date.getFullYear(), 0, 1);\n\t\n\t return Math.ceil((((date - yearStart) / 86400000) + 1) / 7);\n\t};\n\t\n\texports.MINUTE = function(serial_number) {\n\t serial_number = utils.parseDate(serial_number);\n\t\n\t if (serial_number instanceof Error) {\n\t return serial_number;\n\t }\n\t\n\t return serial_number.getMinutes();\n\t};\n\t\n\texports.MONTH = function(serial_number) {\n\t serial_number = utils.parseDate(serial_number);\n\t\n\t if (serial_number instanceof Error) {\n\t return serial_number;\n\t }\n\t\n\t return serial_number.getMonth() + 1;\n\t};\n\t\n\texports.NETWORKDAYS = function(start_date, end_date, holidays) {\n\t return this.NETWORKDAYS.INTL(start_date, end_date, 1, holidays);\n\t};\n\t\n\texports.NETWORKDAYS.INTL = function(start_date, end_date, weekend, holidays) {\n\t start_date = utils.parseDate(start_date);\n\t\n\t if (start_date instanceof Error) {\n\t return start_date;\n\t }\n\t end_date = utils.parseDate(end_date);\n\t\n\t if (end_date instanceof Error) {\n\t return end_date;\n\t }\n\t if (weekend === undefined) {\n\t weekend = WEEKEND_TYPES[1];\n\t } else {\n\t weekend = WEEKEND_TYPES[weekend];\n\t }\n\t if (!(weekend instanceof Array)) {\n\t return error.value;\n\t }\n\t if (holidays === undefined) {\n\t holidays = [];\n\t } else if (!(holidays instanceof Array)) {\n\t holidays = [holidays];\n\t }\n\t\n\t for (var i = 0; i < holidays.length; i++) {\n\t var h = utils.parseDate(holidays[i]);\n\t if (h instanceof Error) {\n\t return h;\n\t }\n\t holidays[i] = h;\n\t }\n\t var days = (end_date - start_date) / (1000 * 60 * 60 * 24) + 1;\n\t var total = days;\n\t var day = start_date;\n\t for (i = 0; i < days; i++) {\n\t var d = (new Date().getTimezoneOffset() > 0) ? day.getUTCDay() : day.getDay();\n\t var dec = false;\n\t if (d === weekend[0] || d === weekend[1]) {\n\t dec = true;\n\t }\n\t for (var j = 0; j < holidays.length; j++) {\n\t var holiday = holidays[j];\n\t if (holiday.getDate() === day.getDate() &&\n\t holiday.getMonth() === day.getMonth() &&\n\t holiday.getFullYear() === day.getFullYear()) {\n\t dec = true;\n\t break;\n\t }\n\t }\n\t if (dec) {\n\t total--;\n\t }\n\t day.setDate(day.getDate() + 1);\n\t }\n\t\n\t return total;\n\t};\n\t\n\texports.NOW = function() {\n\t return new Date();\n\t};\n\t\n\texports.SECOND = function(serial_number) {\n\t serial_number = utils.parseDate(serial_number);\n\t if (serial_number instanceof Error) {\n\t return serial_number;\n\t }\n\t\n\t return serial_number.getSeconds();\n\t};\n\t\n\texports.TIME = function(hour, minute, second) {\n\t hour = utils.parseNumber(hour);\n\t minute = utils.parseNumber(minute);\n\t second = utils.parseNumber(second);\n\t if (utils.anyIsError(hour, minute, second)) {\n\t return error.value;\n\t }\n\t if (hour < 0 || minute < 0 || second < 0) {\n\t return error.num;\n\t }\n\t\n\t return (3600 * hour + 60 * minute + second) / 86400;\n\t};\n\t\n\texports.TIMEVALUE = function(time_text) {\n\t time_text = utils.parseDate(time_text);\n\t\n\t if (time_text instanceof Error) {\n\t return time_text;\n\t }\n\t\n\t return (3600 * time_text.getHours() + 60 * time_text.getMinutes() + time_text.getSeconds()) / 86400;\n\t};\n\t\n\texports.TODAY = function() {\n\t return new Date();\n\t};\n\t\n\texports.WEEKDAY = function(serial_number, return_type) {\n\t serial_number = utils.parseDate(serial_number);\n\t if (serial_number instanceof Error) {\n\t return serial_number;\n\t }\n\t if (return_type === undefined) {\n\t return_type = 1;\n\t }\n\t var day = serial_number.getDay();\n\t\n\t return WEEK_TYPES[return_type][day];\n\t};\n\t\n\texports.WEEKNUM = function(serial_number, return_type) {\n\t serial_number = utils.parseDate(serial_number);\n\t if (serial_number instanceof Error) {\n\t return serial_number;\n\t }\n\t if (return_type === undefined) {\n\t return_type = 1;\n\t }\n\t if (return_type === 21) {\n\t return this.ISOWEEKNUM(serial_number);\n\t }\n\t var week_start = WEEK_STARTS[return_type];\n\t var jan = new Date(serial_number.getFullYear(), 0, 1);\n\t var inc = jan.getDay() < week_start ? 1 : 0;\n\t jan -= Math.abs(jan.getDay() - week_start) * 24 * 60 * 60 * 1000;\n\t\n\t return Math.floor(((serial_number - jan) / (1000 * 60 * 60 * 24)) / 7 + 1) + inc;\n\t};\n\t\n\texports.WORKDAY = function(start_date, days, holidays) {\n\t return this.WORKDAY.INTL(start_date, days, 1, holidays);\n\t};\n\t\n\texports.WORKDAY.INTL = function(start_date, days, weekend, holidays) {\n\t start_date = utils.parseDate(start_date);\n\t if (start_date instanceof Error) {\n\t return start_date;\n\t }\n\t days = utils.parseNumber(days);\n\t if (days instanceof Error) {\n\t return days;\n\t }\n\t if (days < 0) {\n\t return error.num;\n\t }\n\t if (weekend === undefined) {\n\t weekend = WEEKEND_TYPES[1];\n\t } else {\n\t weekend = WEEKEND_TYPES[weekend];\n\t }\n\t if (!(weekend instanceof Array)) {\n\t return error.value;\n\t }\n\t if (holidays === undefined) {\n\t holidays = [];\n\t } else if (!(holidays instanceof Array)) {\n\t holidays = [holidays];\n\t }\n\t for (var i = 0; i < holidays.length; i++) {\n\t var h = utils.parseDate(holidays[i]);\n\t if (h instanceof Error) {\n\t return h;\n\t }\n\t holidays[i] = h;\n\t }\n\t var d = 0;\n\t while (d < days) {\n\t start_date.setDate(start_date.getDate() + 1);\n\t var day = start_date.getDay();\n\t if (day === weekend[0] || day === weekend[1]) {\n\t continue;\n\t }\n\t for (var j = 0; j < holidays.length; j++) {\n\t var holiday = holidays[j];\n\t if (holiday.getDate() === start_date.getDate() &&\n\t holiday.getMonth() === start_date.getMonth() &&\n\t holiday.getFullYear() === start_date.getFullYear()) {\n\t d--;\n\t break;\n\t }\n\t }\n\t d++;\n\t }\n\t\n\t return start_date;\n\t};\n\t\n\texports.YEAR = function(serial_number) {\n\t serial_number = utils.parseDate(serial_number);\n\t\n\t if (serial_number instanceof Error) {\n\t return serial_number;\n\t }\n\t\n\t return serial_number.getFullYear();\n\t};\n\t\n\tfunction isLeapYear(year) {\n\t return new Date(year, 1, 29).getMonth() === 1;\n\t}\n\t\n\t// TODO : Use DAYS ?\n\tfunction daysBetween(start_date, end_date) {\n\t return Math.ceil((end_date - start_date) / 1000 / 60 / 60 / 24);\n\t}\n\t\n\texports.YEARFRAC = function(start_date, end_date, basis) {\n\t start_date = utils.parseDate(start_date);\n\t if (start_date instanceof Error) {\n\t return start_date;\n\t }\n\t end_date = utils.parseDate(end_date);\n\t if (end_date instanceof Error) {\n\t return end_date;\n\t }\n\t\n\t basis = basis || 0;\n\t var sd = start_date.getDate();\n\t var sm = start_date.getMonth() + 1;\n\t var sy = start_date.getFullYear();\n\t var ed = end_date.getDate();\n\t var em = end_date.getMonth() + 1;\n\t var ey = end_date.getFullYear();\n\t\n\t switch (basis) {\n\t case 0:\n\t // US (NASD) 30/360\n\t if (sd === 31 && ed === 31) {\n\t sd = 30;\n\t ed = 30;\n\t } else if (sd === 31) {\n\t sd = 30;\n\t } else if (sd === 30 && ed === 31) {\n\t ed = 30;\n\t }\n\t return ((ed + em * 30 + ey * 360) - (sd + sm * 30 + sy * 360)) / 360;\n\t case 1:\n\t // Actual/actual\n\t var feb29Between = function(date1, date2) {\n\t var year1 = date1.getFullYear();\n\t var mar1year1 = new Date(year1, 2, 1);\n\t if (isLeapYear(year1) && date1 < mar1year1 && date2 >= mar1year1) {\n\t return true;\n\t }\n\t var year2 = date2.getFullYear();\n\t var mar1year2 = new Date(year2, 2, 1);\n\t return (isLeapYear(year2) && date2 >= mar1year2 && date1 < mar1year2);\n\t };\n\t var ylength = 365;\n\t if (sy === ey || ((sy + 1) === ey) && ((sm > em) || ((sm === em) && (sd >= ed)))) {\n\t if ((sy === ey && isLeapYear(sy)) ||\n\t feb29Between(start_date, end_date) ||\n\t (em === 1 && ed === 29)) {\n\t ylength = 366;\n\t }\n\t return daysBetween(start_date, end_date) / ylength;\n\t }\n\t var years = (ey - sy) + 1;\n\t var days = (new Date(ey + 1, 0, 1) - new Date(sy, 0, 1)) / 1000 / 60 / 60 / 24;\n\t var average = days / years;\n\t return daysBetween(start_date, end_date) / average;\n\t case 2:\n\t // Actual/360\n\t return daysBetween(start_date, end_date) / 360;\n\t case 3:\n\t // Actual/365\n\t return daysBetween(start_date, end_date) / 365;\n\t case 4:\n\t // European 30/360\n\t return ((ed + em * 30 + ey * 360) - (sd + sm * 30 + sy * 360)) / 360;\n\t }\n\t};\n\t\n\tfunction serial(date) {\n\t var addOn = (date > -2203891200000) ? 2 : 1;\n\t\n\t return (date - d1900) / 86400000 + addOn;\n\t}\n\n\n/***/ },\n/* 28 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar error = __webpack_require__(16);\n\tvar stats = __webpack_require__(17);\n\tvar maths = __webpack_require__(14);\n\tvar utils = __webpack_require__(15);\n\t\n\tfunction compact(array) {\n\t var result = [];\n\t\n\t utils.arrayEach(array, function(value) {\n\t if (value) {\n\t result.push(value);\n\t }\n\t });\n\t\n\t return result;\n\t}\n\t\n\texports.FINDFIELD = function(database, title) {\n\t var index = null;\n\t\n\t utils.arrayEach(database, function(value, i) {\n\t if (value[0] === title) {\n\t index = i;\n\t return false;\n\t }\n\t });\n\t\n\t // Return error if the input field title is incorrect\n\t if (index == null) {\n\t return error.value;\n\t }\n\t\n\t return index;\n\t};\n\t\n\tfunction findResultIndex(database, criterias) {\n\t var matches = {};\n\t for (var i = 1; i < database[0].length; ++i) {\n\t matches[i] = true;\n\t }\n\t var maxCriteriaLength = criterias[0].length;\n\t for (i = 1; i < criterias.length; ++i) {\n\t if (criterias[i].length > maxCriteriaLength) {\n\t maxCriteriaLength = criterias[i].length;\n\t }\n\t }\n\t\n\t for (var k = 1; k < database.length; ++k) {\n\t for (var l = 1; l < database[k].length; ++l) {\n\t var currentCriteriaResult = false;\n\t var hasMatchingCriteria = false;\n\t for (var j = 0; j < criterias.length; ++j) {\n\t var criteria = criterias[j];\n\t if (criteria.length < maxCriteriaLength) {\n\t continue;\n\t }\n\t\n\t var criteriaField = criteria[0];\n\t if (database[k][0] !== criteriaField) {\n\t continue;\n\t }\n\t hasMatchingCriteria = true;\n\t for (var p = 1; p < criteria.length; ++p) {\n\t currentCriteriaResult = currentCriteriaResult || eval(database[k][l] + criteria[p]); // jshint ignore:line\n\t }\n\t }\n\t if (hasMatchingCriteria) {\n\t matches[l] = matches[l] && currentCriteriaResult;\n\t }\n\t }\n\t }\n\t\n\t var result = [];\n\t for (var n = 0; n < database[0].length; ++n) {\n\t if (matches[n]) {\n\t result.push(n - 1);\n\t }\n\t }\n\t\n\t return result;\n\t}\n\t\n\t// Database functions\n\texports.DAVERAGE = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t var sum = 0;\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t sum += targetFields[value];\n\t });\n\t\n\t return resultIndexes.length === 0 ? error.div0 : sum / resultIndexes.length;\n\t};\n\t\n\texports.DCOUNT = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t\n\t var targetValues = [];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t targetValues.push(targetFields[value]);\n\t });\n\t\n\t return stats.COUNT(targetValues);\n\t};\n\t\n\texports.DCOUNTA = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t\n\t var targetValues = [];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t targetValues.push(targetFields[value]);\n\t });\n\t\n\t return stats.COUNTA(targetValues);\n\t};\n\t\n\texports.DGET = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t\n\t // Return error if no record meets the criteria\n\t if (resultIndexes.length === 0) {\n\t return error.value;\n\t }\n\t // Returns the #NUM! error value because more than one record meets the\n\t // criteria\n\t if (resultIndexes.length > 1) {\n\t return error.num;\n\t }\n\t\n\t return targetFields[resultIndexes[0]];\n\t};\n\t\n\texports.DMAX = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t\n\t var maxValue = targetFields[resultIndexes[0]];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t if (maxValue < targetFields[value]) {\n\t maxValue = targetFields[value];\n\t }\n\t });\n\t\n\t return maxValue;\n\t};\n\t\n\texports.DMIN = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t\n\t var minValue = targetFields[resultIndexes[0]];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t if (minValue > targetFields[value]) {\n\t minValue = targetFields[value];\n\t }\n\t });\n\t\n\t return minValue;\n\t};\n\t\n\texports.DPRODUCT = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t\n\t var targetValues = [];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t targetValues.push(targetFields[value]);\n\t });\n\t targetValues = compact(targetValues);\n\t\n\t var result = 1;\n\t\n\t utils.arrayEach(targetValues, function(value) {\n\t result *= value;\n\t });\n\t\n\t return result;\n\t};\n\t\n\texports.DSTDEV = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t var targetValues = [];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t targetValues.push(targetFields[value]);\n\t });\n\t targetValues = compact(targetValues);\n\t\n\t return stats.STDEV.S(targetValues);\n\t};\n\t\n\texports.DSTDEVP = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t\n\t var targetValues = [];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t targetValues.push(targetFields[value]);\n\t });\n\t targetValues = compact(targetValues);\n\t\n\t return stats.STDEV.P(targetValues);\n\t};\n\t\n\texports.DSUM = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t\n\t var targetValues = [];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t targetValues.push(targetFields[value]);\n\t });\n\t\n\t return maths.SUM(targetValues);\n\t};\n\t\n\texports.DVAR = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t var targetValues = [];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t targetValues.push(targetFields[value]);\n\t });\n\t\n\t return stats.VAR.S(targetValues);\n\t};\n\t\n\texports.DVARP = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t var targetValues = [];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t targetValues.push(targetFields[value]);\n\t });\n\t\n\t return stats.VAR.P(targetValues);\n\t};\n\n\n/***/ },\n/* 29 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar error = __webpack_require__(16);\n\tvar utils = __webpack_require__(15);\n\tvar information = __webpack_require__(24);\n\t\n\texports.AND = function() {\n\t var args = utils.flatten(arguments);\n\t var result = true;\n\t for (var i = 0; i < args.length; i++) {\n\t if (!args[i]) {\n\t result = false;\n\t }\n\t }\n\t return result;\n\t};\n\t\n\texports.CHOOSE = function() {\n\t if (arguments.length < 2) {\n\t return error.na;\n\t }\n\t\n\t var index = arguments[0];\n\t if (index < 1 || index > 254) {\n\t return error.value;\n\t }\n\t\n\t if (arguments.length < index + 1) {\n\t return error.value;\n\t }\n\t\n\t return arguments[index];\n\t};\n\t\n\texports.FALSE = function() {\n\t return false;\n\t};\n\t\n\texports.IF = function(test, then_value, otherwise_value) {\n\t return test ? then_value : otherwise_value;\n\t};\n\t\n\texports.IFERROR = function(value, valueIfError) {\n\t if (information.ISERROR(value)) {\n\t return valueIfError;\n\t }\n\t return value;\n\t};\n\t\n\texports.IFNA = function(value, value_if_na) {\n\t return value === error.na ? value_if_na : value;\n\t};\n\t\n\texports.NOT = function(logical) {\n\t return !logical;\n\t};\n\t\n\texports.OR = function() {\n\t var args = utils.flatten(arguments);\n\t var result = false;\n\t for (var i = 0; i < args.length; i++) {\n\t if (args[i]) {\n\t result = true;\n\t }\n\t }\n\t return result;\n\t};\n\t\n\texports.TRUE = function() {\n\t return true;\n\t};\n\t\n\texports.XOR = function() {\n\t var args = utils.flatten(arguments);\n\t var result = 0;\n\t for (var i = 0; i < args.length; i++) {\n\t if (args[i]) {\n\t result++;\n\t }\n\t }\n\t return (Math.floor(Math.abs(result)) & 1) ? true : false;\n\t};\n\t\n\texports.SWITCH = function () {\n\t var result;\n\t\n\t if (arguments.length > 0) {\n\t var targetValue = arguments[0];\n\t var argc = arguments.length - 1;\n\t var switchCount = Math.floor(argc / 2);\n\t var switchSatisfied = false;\n\t var hasDefaultClause = argc % 2 !== 0;\n\t var defaultClause = argc % 2 === 0 ? null : arguments[arguments.length - 1];\n\t\n\t if (switchCount) {\n\t for (var index = 0; index < switchCount; index++) {\n\t if (targetValue === arguments[index * 2 + 1]) {\n\t result = arguments[index * 2 + 2];\n\t switchSatisfied = true;\n\t break;\n\t }\n\t }\n\t }\n\t\n\t if (!switchSatisfied) {\n\t result = hasDefaultClause ? defaultClause : error.na;\n\t }\n\t } else {\n\t result = error.value;\n\t }\n\t\n\t return result;\n\t};\n\n\n/***/ },\n/* 30 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar error = __webpack_require__(16);\n\tvar dateTime = __webpack_require__(27);\n\tvar utils = __webpack_require__(15);\n\t\n\tfunction validDate(d) {\n\t return d && d.getTime && !isNaN(d.getTime());\n\t}\n\t\n\tfunction ensureDate(d) {\n\t return (d instanceof Date)?d:new Date(d);\n\t}\n\t\n\texports.ACCRINT = function(issue, first, settlement, rate, par, frequency, basis) {\n\t // Return error if either date is invalid\n\t issue = ensureDate(issue);\n\t first = ensureDate(first);\n\t settlement = ensureDate(settlement);\n\t if (!validDate(issue) || !validDate(first) || !validDate(settlement)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if either rate or par are lower than or equal to zero\n\t if (rate <= 0 || par <= 0) {\n\t return error.num\n\t }\n\t\n\t // Return error if frequency is neither 1, 2, or 4\n\t if ([1, 2, 4].indexOf(frequency) === -1) {\n\t return error.num;\n\t }\n\t\n\t // Return error if basis is neither 0, 1, 2, 3, or 4\n\t if ([0, 1, 2, 3, 4].indexOf(basis) === -1) {\n\t return error.num;\n\t }\n\t\n\t // Return error if settlement is before or equal to issue\n\t if (settlement <= issue) {\n\t return error.num;\n\t }\n\t\n\t // Set default values\n\t par = par || 0;\n\t basis = basis || 0;\n\t\n\t // Compute accrued interest\n\t return par * rate * dateTime.YEARFRAC(issue, settlement, basis);\n\t};\n\t\n\t// TODO\n\texports.ACCRINTM = function() {\n\t throw new Error('ACCRINTM is not implemented');\n\t};\n\t\n\t// TODO\n\texports.AMORDEGRC = function() {\n\t throw new Error('AMORDEGRC is not implemented');\n\t};\n\t\n\t// TODO\n\texports.AMORLINC = function() {\n\t throw new Error('AMORLINC is not implemented');\n\t};\n\t\n\t// TODO\n\texports.COUPDAYBS = function() {\n\t throw new Error('COUPDAYBS is not implemented');\n\t};\n\t\n\t// TODO\n\texports.COUPDAYS = function() {\n\t throw new Error('COUPDAYS is not implemented');\n\t};\n\t\n\t// TODO\n\texports.COUPDAYSNC = function() {\n\t throw new Error('COUPDAYSNC is not implemented');\n\t};\n\t\n\t// TODO\n\texports.COUPNCD = function() {\n\t throw new Error('COUPNCD is not implemented');\n\t};\n\t\n\t// TODO\n\texports.COUPNUM = function() {\n\t throw new Error('COUPNUM is not implemented');\n\t};\n\t\n\t// TODO\n\texports.COUPPCD = function() {\n\t throw new Error('COUPPCD is not implemented');\n\t};\n\t\n\texports.CUMIPMT = function(rate, periods, value, start, end, type) {\n\t // Credits: algorithm inspired by Apache OpenOffice\n\t // Credits: Hannes Stiebitzhofer for the translations of function and variable names\n\t // Requires exports.FV() and exports.PMT() from exports.js [http://stoic.com/exports/]\n\t\n\t rate = utils.parseNumber(rate);\n\t periods = utils.parseNumber(periods);\n\t value = utils.parseNumber(value);\n\t if (utils.anyIsError(rate, periods, value)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if either rate, periods, or value are lower than or equal to zero\n\t if (rate <= 0 || periods <= 0 || value <= 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if start < 1, end < 1, or start > end\n\t if (start < 1 || end < 1 || start > end) {\n\t return error.num;\n\t }\n\t\n\t // Return error if type is neither 0 nor 1\n\t if (type !== 0 && type !== 1) {\n\t return error.num;\n\t }\n\t\n\t // Compute cumulative interest\n\t var payment = exports.PMT(rate, periods, value, 0, type);\n\t var interest = 0;\n\t\n\t if (start === 1) {\n\t if (type === 0) {\n\t interest = -value;\n\t start++;\n\t }\n\t }\n\t\n\t for (var i = start; i <= end; i++) {\n\t if (type === 1) {\n\t interest += exports.FV(rate, i - 2, payment, value, 1) - payment;\n\t } else {\n\t interest += exports.FV(rate, i - 1, payment, value, 0);\n\t }\n\t }\n\t interest *= rate;\n\t\n\t // Return cumulative interest\n\t return interest;\n\t};\n\t\n\texports.CUMPRINC = function(rate, periods, value, start, end, type) {\n\t // Credits: algorithm inspired by Apache OpenOffice\n\t // Credits: Hannes Stiebitzhofer for the translations of function and variable names\n\t\n\t rate = utils.parseNumber(rate);\n\t periods = utils.parseNumber(periods);\n\t value = utils.parseNumber(value);\n\t if (utils.anyIsError(rate, periods, value)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if either rate, periods, or value are lower than or equal to zero\n\t if (rate <= 0 || periods <= 0 || value <= 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if start < 1, end < 1, or start > end\n\t if (start < 1 || end < 1 || start > end) {\n\t return error.num;\n\t }\n\t\n\t // Return error if type is neither 0 nor 1\n\t if (type !== 0 && type !== 1) {\n\t return error.num;\n\t }\n\t\n\t // Compute cumulative principal\n\t var payment = exports.PMT(rate, periods, value, 0, type);\n\t var principal = 0;\n\t if (start === 1) {\n\t if (type === 0) {\n\t principal = payment + value * rate;\n\t } else {\n\t principal = payment;\n\t }\n\t start++;\n\t }\n\t for (var i = start; i <= end; i++) {\n\t if (type > 0) {\n\t principal += payment - (exports.FV(rate, i - 2, payment, value, 1) - payment) * rate;\n\t } else {\n\t principal += payment - exports.FV(rate, i - 1, payment, value, 0) * rate;\n\t }\n\t }\n\t\n\t // Return cumulative principal\n\t return principal;\n\t};\n\t\n\texports.DB = function(cost, salvage, life, period, month) {\n\t // Initialize month\n\t month = (month === undefined) ? 12 : month;\n\t\n\t cost = utils.parseNumber(cost);\n\t salvage = utils.parseNumber(salvage);\n\t life = utils.parseNumber(life);\n\t period = utils.parseNumber(period);\n\t month = utils.parseNumber(month);\n\t if (utils.anyIsError(cost, salvage, life, period, month)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if any of the parameters is negative\n\t if (cost < 0 || salvage < 0 || life < 0 || period < 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if month is not an integer between 1 and 12\n\t if ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].indexOf(month) === -1) {\n\t return error.num;\n\t }\n\t\n\t // Return error if period is greater than life\n\t if (period > life) {\n\t return error.num;\n\t }\n\t\n\t // Return 0 (zero) if salvage is greater than or equal to cost\n\t if (salvage >= cost) {\n\t return 0;\n\t }\n\t\n\t // Rate is rounded to three decimals places\n\t var rate = (1 - Math.pow(salvage / cost, 1 / life)).toFixed(3);\n\t\n\t // Compute initial depreciation\n\t var initial = cost * rate * month / 12;\n\t\n\t // Compute total depreciation\n\t var total = initial;\n\t var current = 0;\n\t var ceiling = (period === life) ? life - 1 : period;\n\t for (var i = 2; i <= ceiling; i++) {\n\t current = (cost - total) * rate;\n\t total += current;\n\t }\n\t\n\t // Depreciation for the first and last periods are special cases\n\t if (period === 1) {\n\t // First period\n\t return initial;\n\t } else if (period === life) {\n\t // Last period\n\t return (cost - total) * rate;\n\t } else {\n\t return current;\n\t }\n\t};\n\t\n\texports.DDB = function(cost, salvage, life, period, factor) {\n\t // Initialize factor\n\t factor = (factor === undefined) ? 2 : factor;\n\t\n\t cost = utils.parseNumber(cost);\n\t salvage = utils.parseNumber(salvage);\n\t life = utils.parseNumber(life);\n\t period = utils.parseNumber(period);\n\t factor = utils.parseNumber(factor);\n\t if (utils.anyIsError(cost, salvage, life, period, factor)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if any of the parameters is negative or if factor is null\n\t if (cost < 0 || salvage < 0 || life < 0 || period < 0 || factor <= 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if period is greater than life\n\t if (period > life) {\n\t return error.num;\n\t }\n\t\n\t // Return 0 (zero) if salvage is greater than or equal to cost\n\t if (salvage >= cost) {\n\t return 0;\n\t }\n\t\n\t // Compute depreciation\n\t var total = 0;\n\t var current = 0;\n\t for (var i = 1; i <= period; i++) {\n\t current = Math.min((cost - total) * (factor / life), (cost - salvage - total));\n\t total += current;\n\t }\n\t\n\t // Return depreciation\n\t return current;\n\t};\n\t\n\t// TODO\n\texports.DISC = function() {\n\t throw new Error('DISC is not implemented');\n\t};\n\t\n\texports.DOLLARDE = function(dollar, fraction) {\n\t // Credits: algorithm inspired by Apache OpenOffice\n\t\n\t dollar = utils.parseNumber(dollar);\n\t fraction = utils.parseNumber(fraction);\n\t if (utils.anyIsError(dollar, fraction)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if fraction is negative\n\t if (fraction < 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if fraction is greater than or equal to 0 and less than 1\n\t if (fraction >= 0 && fraction < 1) {\n\t return error.div0;\n\t }\n\t\n\t // Truncate fraction if it is not an integer\n\t fraction = parseInt(fraction, 10);\n\t\n\t // Compute integer part\n\t var result = parseInt(dollar, 10);\n\t\n\t // Add decimal part\n\t result += (dollar % 1) * Math.pow(10, Math.ceil(Math.log(fraction) / Math.LN10)) / fraction;\n\t\n\t // Round result\n\t var power = Math.pow(10, Math.ceil(Math.log(fraction) / Math.LN2) + 1);\n\t result = Math.round(result * power) / power;\n\t\n\t // Return converted dollar price\n\t return result;\n\t};\n\t\n\texports.DOLLARFR = function(dollar, fraction) {\n\t // Credits: algorithm inspired by Apache OpenOffice\n\t\n\t dollar = utils.parseNumber(dollar);\n\t fraction = utils.parseNumber(fraction);\n\t if (utils.anyIsError(dollar, fraction)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if fraction is negative\n\t if (fraction < 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if fraction is greater than or equal to 0 and less than 1\n\t if (fraction >= 0 && fraction < 1) {\n\t return error.div0;\n\t }\n\t\n\t // Truncate fraction if it is not an integer\n\t fraction = parseInt(fraction, 10);\n\t\n\t // Compute integer part\n\t var result = parseInt(dollar, 10);\n\t\n\t // Add decimal part\n\t result += (dollar % 1) * Math.pow(10, -Math.ceil(Math.log(fraction) / Math.LN10)) * fraction;\n\t\n\t // Return converted dollar price\n\t return result;\n\t};\n\t\n\t// TODO\n\texports.DURATION = function() {\n\t throw new Error('DURATION is not implemented');\n\t};\n\t\n\texports.EFFECT = function(rate, periods) {\n\t rate = utils.parseNumber(rate);\n\t periods = utils.parseNumber(periods);\n\t if (utils.anyIsError(rate, periods)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if rate <=0 or periods < 1\n\t if (rate <= 0 || periods < 1) {\n\t return error.num;\n\t }\n\t\n\t // Truncate periods if it is not an integer\n\t periods = parseInt(periods, 10);\n\t\n\t // Return effective annual interest rate\n\t return Math.pow(1 + rate / periods, periods) - 1;\n\t};\n\t\n\texports.FV = function(rate, periods, payment, value, type) {\n\t // Credits: algorithm inspired by Apache OpenOffice\n\t\n\t value = value || 0;\n\t type = type || 0;\n\t\n\t rate = utils.parseNumber(rate);\n\t periods = utils.parseNumber(periods);\n\t payment = utils.parseNumber(payment);\n\t value = utils.parseNumber(value);\n\t type = utils.parseNumber(type);\n\t if (utils.anyIsError(rate, periods, payment, value, type)) {\n\t return error.value;\n\t }\n\t\n\t // Return future value\n\t var result;\n\t if (rate === 0) {\n\t result = value + payment * periods;\n\t } else {\n\t var term = Math.pow(1 + rate, periods);\n\t if (type === 1) {\n\t result = value * term + payment * (1 + rate) * (term - 1) / rate;\n\t } else {\n\t result = value * term + payment * (term - 1) / rate;\n\t }\n\t }\n\t return -result;\n\t};\n\t\n\texports.FVSCHEDULE = function(principal, schedule) {\n\t principal = utils.parseNumber(principal);\n\t schedule = utils.parseNumberArray(utils.flatten(schedule));\n\t if (utils.anyIsError(principal, schedule)) {\n\t return error.value;\n\t }\n\t\n\t var n = schedule.length;\n\t var future = principal;\n\t\n\t // Apply all interests in schedule\n\t for (var i = 0; i < n; i++) {\n\t // Apply scheduled interest\n\t future *= 1 + schedule[i];\n\t }\n\t\n\t // Return future value\n\t return future;\n\t};\n\t\n\t// TODO\n\texports.INTRATE = function() {\n\t throw new Error('INTRATE is not implemented');\n\t};\n\t\n\texports.IPMT = function(rate, period, periods, present, future, type) {\n\t // Credits: algorithm inspired by Apache OpenOffice\n\t\n\t future = future || 0;\n\t type = type || 0;\n\t\n\t rate = utils.parseNumber(rate);\n\t period = utils.parseNumber(period);\n\t periods = utils.parseNumber(periods);\n\t present = utils.parseNumber(present);\n\t future = utils.parseNumber(future);\n\t type = utils.parseNumber(type);\n\t if (utils.anyIsError(rate, period, periods, present, future, type)) {\n\t return error.value;\n\t }\n\t\n\t // Compute payment\n\t var payment = exports.PMT(rate, periods, present, future, type);\n\t\n\t // Compute interest\n\t var interest;\n\t if (period === 1) {\n\t if (type === 1) {\n\t interest = 0;\n\t } else {\n\t interest = -present;\n\t }\n\t } else {\n\t if (type === 1) {\n\t interest = exports.FV(rate, period - 2, payment, present, 1) - payment;\n\t } else {\n\t interest = exports.FV(rate, period - 1, payment, present, 0);\n\t }\n\t }\n\t\n\t // Return interest\n\t return interest * rate;\n\t};\n\t\n\texports.IRR = function(values, guess) {\n\t // Credits: algorithm inspired by Apache OpenOffice\n\t\n\t guess = guess || 0;\n\t\n\t values = utils.parseNumberArray(utils.flatten(values));\n\t guess = utils.parseNumber(guess);\n\t if (utils.anyIsError(values, guess)) {\n\t return error.value;\n\t }\n\t\n\t // Calculates the resulting amount\n\t var irrResult = function(values, dates, rate) {\n\t var r = rate + 1;\n\t var result = values[0];\n\t for (var i = 1; i < values.length; i++) {\n\t result += values[i] / Math.pow(r, (dates[i] - dates[0]) / 365);\n\t }\n\t return result;\n\t };\n\t\n\t // Calculates the first derivation\n\t var irrResultDeriv = function(values, dates, rate) {\n\t var r = rate + 1;\n\t var result = 0;\n\t for (var i = 1; i < values.length; i++) {\n\t var frac = (dates[i] - dates[0]) / 365;\n\t result -= frac * values[i] / Math.pow(r, frac + 1);\n\t }\n\t return result;\n\t };\n\t\n\t // Initialize dates and check that values contains at least one positive value and one negative value\n\t var dates = [];\n\t var positive = false;\n\t var negative = false;\n\t for (var i = 0; i < values.length; i++) {\n\t dates[i] = (i === 0) ? 0 : dates[i - 1] + 365;\n\t if (values[i] > 0) {\n\t positive = true;\n\t }\n\t if (values[i] < 0) {\n\t negative = true;\n\t }\n\t }\n\t\n\t // Return error if values does not contain at least one positive value and one negative value\n\t if (!positive || !negative) {\n\t return error.num;\n\t }\n\t\n\t // Initialize guess and resultRate\n\t guess = (guess === undefined) ? 0.1 : guess;\n\t var resultRate = guess;\n\t\n\t // Set maximum epsilon for end of iteration\n\t var epsMax = 1e-10;\n\t\n\t // Implement Newton's method\n\t var newRate, epsRate, resultValue;\n\t var contLoop = true;\n\t do {\n\t resultValue = irrResult(values, dates, resultRate);\n\t newRate = resultRate - resultValue / irrResultDeriv(values, dates, resultRate);\n\t epsRate = Math.abs(newRate - resultRate);\n\t resultRate = newRate;\n\t contLoop = (epsRate > epsMax) && (Math.abs(resultValue) > epsMax);\n\t } while (contLoop);\n\t\n\t // Return internal rate of return\n\t return resultRate;\n\t};\n\t\n\texports.ISPMT = function(rate, period, periods, value) {\n\t rate = utils.parseNumber(rate);\n\t period = utils.parseNumber(period);\n\t periods = utils.parseNumber(periods);\n\t value = utils.parseNumber(value);\n\t if (utils.anyIsError(rate, period, periods, value)) {\n\t return error.value;\n\t }\n\t\n\t // Return interest\n\t return value * rate * (period / periods - 1);\n\t};\n\t\n\t// TODO\n\texports.MDURATION = function() {\n\t throw new Error('MDURATION is not implemented');\n\t};\n\t\n\texports.MIRR = function(values, finance_rate, reinvest_rate) {\n\t values = utils.parseNumberArray(utils.flatten(values));\n\t finance_rate = utils.parseNumber(finance_rate);\n\t reinvest_rate = utils.parseNumber(reinvest_rate);\n\t if (utils.anyIsError(values, finance_rate, reinvest_rate)) {\n\t return error.value;\n\t }\n\t\n\t // Initialize number of values\n\t var n = values.length;\n\t\n\t // Lookup payments (negative values) and incomes (positive values)\n\t var payments = [];\n\t var incomes = [];\n\t for (var i = 0; i < n; i++) {\n\t if (values[i] < 0) {\n\t payments.push(values[i]);\n\t } else {\n\t incomes.push(values[i]);\n\t }\n\t }\n\t\n\t // Return modified internal rate of return\n\t var num = -exports.NPV(reinvest_rate, incomes) * Math.pow(1 + reinvest_rate, n - 1);\n\t var den = exports.NPV(finance_rate, payments) * (1 + finance_rate);\n\t return Math.pow(num / den, 1 / (n - 1)) - 1;\n\t};\n\t\n\texports.NOMINAL = function(rate, periods) {\n\t rate = utils.parseNumber(rate);\n\t periods = utils.parseNumber(periods);\n\t if (utils.anyIsError(rate, periods)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if rate <=0 or periods < 1\n\t if (rate <= 0 || periods < 1) {\n\t return error.num;\n\t }\n\t\n\t // Truncate periods if it is not an integer\n\t periods = parseInt(periods, 10);\n\t\n\t // Return nominal annual interest rate\n\t return (Math.pow(rate + 1, 1 / periods) - 1) * periods;\n\t};\n\t\n\texports.NPER = function(rate, payment, present, future, type) {\n\t type = (type === undefined) ? 0 : type;\n\t future = (future === undefined) ? 0 : future;\n\t\n\t rate = utils.parseNumber(rate);\n\t payment = utils.parseNumber(payment);\n\t present = utils.parseNumber(present);\n\t future = utils.parseNumber(future);\n\t type = utils.parseNumber(type);\n\t if (utils.anyIsError(rate, payment, present, future, type)) {\n\t return error.value;\n\t }\n\t\n\t // Return number of periods\n\t var num = payment * (1 + rate * type) - future * rate;\n\t var den = (present * rate + payment * (1 + rate * type));\n\t return Math.log(num / den) / Math.log(1 + rate);\n\t};\n\t\n\texports.NPV = function() {\n\t var args = utils.parseNumberArray(utils.flatten(arguments));\n\t if (args instanceof Error) {\n\t return args;\n\t }\n\t\n\t // Lookup rate\n\t var rate = args[0];\n\t\n\t // Initialize net present value\n\t var value = 0;\n\t\n\t // Loop on all values\n\t for (var j = 1; j < args.length; j++) {\n\t value += args[j] / Math.pow(1 + rate, j);\n\t }\n\t\n\t // Return net present value\n\t return value;\n\t};\n\t\n\t// TODO\n\texports.ODDFPRICE = function() {\n\t throw new Error('ODDFPRICE is not implemented');\n\t};\n\t\n\t// TODO\n\texports.ODDFYIELD = function() {\n\t throw new Error('ODDFYIELD is not implemented');\n\t};\n\t\n\t// TODO\n\texports.ODDLPRICE = function() {\n\t throw new Error('ODDLPRICE is not implemented');\n\t};\n\t\n\t// TODO\n\texports.ODDLYIELD = function() {\n\t throw new Error('ODDLYIELD is not implemented');\n\t};\n\t\n\texports.PDURATION = function(rate, present, future) {\n\t rate = utils.parseNumber(rate);\n\t present = utils.parseNumber(present);\n\t future = utils.parseNumber(future);\n\t if (utils.anyIsError(rate, present, future)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if rate <=0\n\t if (rate <= 0) {\n\t return error.num;\n\t }\n\t\n\t // Return number of periods\n\t return (Math.log(future) - Math.log(present)) / Math.log(1 + rate);\n\t};\n\t\n\texports.PMT = function(rate, periods, present, future, type) {\n\t // Credits: algorithm inspired by Apache OpenOffice\n\t\n\t future = future || 0;\n\t type = type || 0;\n\t\n\t rate = utils.parseNumber(rate);\n\t periods = utils.parseNumber(periods);\n\t present = utils.parseNumber(present);\n\t future = utils.parseNumber(future);\n\t type = utils.parseNumber(type);\n\t if (utils.anyIsError(rate, periods, present, future, type)) {\n\t return error.value;\n\t }\n\t\n\t // Return payment\n\t var result;\n\t if (rate === 0) {\n\t result = (present + future) / periods;\n\t } else {\n\t var term = Math.pow(1 + rate, periods);\n\t if (type === 1) {\n\t result = (future * rate / (term - 1) + present * rate / (1 - 1 / term)) / (1 + rate);\n\t } else {\n\t result = future * rate / (term - 1) + present * rate / (1 - 1 / term);\n\t }\n\t }\n\t return -result;\n\t};\n\t\n\texports.PPMT = function(rate, period, periods, present, future, type) {\n\t future = future || 0;\n\t type = type || 0;\n\t\n\t rate = utils.parseNumber(rate);\n\t periods = utils.parseNumber(periods);\n\t present = utils.parseNumber(present);\n\t future = utils.parseNumber(future);\n\t type = utils.parseNumber(type);\n\t if (utils.anyIsError(rate, periods, present, future, type)) {\n\t return error.value;\n\t }\n\t\n\t return exports.PMT(rate, periods, present, future, type) - exports.IPMT(rate, period, periods, present, future, type);\n\t};\n\t\n\t// TODO\n\texports.PRICE = function() {\n\t throw new Error('PRICE is not implemented');\n\t};\n\t\n\t// TODO\n\texports.PRICEDISC = function() {\n\t throw new Error('PRICEDISC is not implemented');\n\t};\n\t\n\t// TODO\n\texports.PRICEMAT = function() {\n\t throw new Error('PRICEMAT is not implemented');\n\t};\n\t\n\texports.PV = function(rate, periods, payment, future, type) {\n\t future = future || 0;\n\t type = type || 0;\n\t\n\t rate = utils.parseNumber(rate);\n\t periods = utils.parseNumber(periods);\n\t payment = utils.parseNumber(payment);\n\t future = utils.parseNumber(future);\n\t type = utils.parseNumber(type);\n\t if (utils.anyIsError(rate, periods, payment, future, type)) {\n\t return error.value;\n\t }\n\t\n\t // Return present value\n\t if (rate === 0) {\n\t return -payment * periods - future;\n\t } else {\n\t return (((1 - Math.pow(1 + rate, periods)) / rate) * payment * (1 + rate * type) - future) / Math.pow(1 + rate, periods);\n\t }\n\t};\n\t\n\texports.RATE = function(periods, payment, present, future, type, guess) {\n\t // Credits: rabugento\n\t\n\t guess = (guess === undefined) ? 0.01 : guess;\n\t future = (future === undefined) ? 0 : future;\n\t type = (type === undefined) ? 0 : type;\n\t\n\t periods = utils.parseNumber(periods);\n\t payment = utils.parseNumber(payment);\n\t present = utils.parseNumber(present);\n\t future = utils.parseNumber(future);\n\t type = utils.parseNumber(type);\n\t guess = utils.parseNumber(guess);\n\t if (utils.anyIsError(periods, payment, present, future, type, guess)) {\n\t return error.value;\n\t }\n\t\n\t // Set maximum epsilon for end of iteration\n\t var epsMax = 1e-10;\n\t\n\t // Set maximum number of iterations\n\t var iterMax = 50;\n\t\n\t // Implement Newton's method\n\t var y, y0, y1, x0, x1 = 0,\n\t f = 0,\n\t i = 0;\n\t var rate = guess;\n\t if (Math.abs(rate) < epsMax) {\n\t y = present * (1 + periods * rate) + payment * (1 + rate * type) * periods + future;\n\t } else {\n\t f = Math.exp(periods * Math.log(1 + rate));\n\t y = present * f + payment * (1 / rate + type) * (f - 1) + future;\n\t }\n\t y0 = present + payment * periods + future;\n\t y1 = present * f + payment * (1 / rate + type) * (f - 1) + future;\n\t i = x0 = 0;\n\t x1 = rate;\n\t while ((Math.abs(y0 - y1) > epsMax) && (i < iterMax)) {\n\t rate = (y1 * x0 - y0 * x1) / (y1 - y0);\n\t x0 = x1;\n\t x1 = rate;\n\t if (Math.abs(rate) < epsMax) {\n\t y = present * (1 + periods * rate) + payment * (1 + rate * type) * periods + future;\n\t } else {\n\t f = Math.exp(periods * Math.log(1 + rate));\n\t y = present * f + payment * (1 / rate + type) * (f - 1) + future;\n\t }\n\t y0 = y1;\n\t y1 = y;\n\t ++i;\n\t }\n\t return rate;\n\t};\n\t\n\t// TODO\n\texports.RECEIVED = function() {\n\t throw new Error('RECEIVED is not implemented');\n\t};\n\t\n\texports.RRI = function(periods, present, future) {\n\t periods = utils.parseNumber(periods);\n\t present = utils.parseNumber(present);\n\t future = utils.parseNumber(future);\n\t if (utils.anyIsError(periods, present, future)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if periods or present is equal to 0 (zero)\n\t if (periods === 0 || present === 0) {\n\t return error.num;\n\t }\n\t\n\t // Return equivalent interest rate\n\t return Math.pow(future / present, 1 / periods) - 1;\n\t};\n\t\n\texports.SLN = function(cost, salvage, life) {\n\t cost = utils.parseNumber(cost);\n\t salvage = utils.parseNumber(salvage);\n\t life = utils.parseNumber(life);\n\t if (utils.anyIsError(cost, salvage, life)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if life equal to 0 (zero)\n\t if (life === 0) {\n\t return error.num;\n\t }\n\t\n\t // Return straight-line depreciation\n\t return (cost - salvage) / life;\n\t};\n\t\n\texports.SYD = function(cost, salvage, life, period) {\n\t // Return error if any of the parameters is not a number\n\t cost = utils.parseNumber(cost);\n\t salvage = utils.parseNumber(salvage);\n\t life = utils.parseNumber(life);\n\t period = utils.parseNumber(period);\n\t if (utils.anyIsError(cost, salvage, life, period)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if life equal to 0 (zero)\n\t if (life === 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if period is lower than 1 or greater than life\n\t if (period < 1 || period > life) {\n\t return error.num;\n\t }\n\t\n\t // Truncate period if it is not an integer\n\t period = parseInt(period, 10);\n\t\n\t // Return straight-line depreciation\n\t return ((cost - salvage) * (life - period + 1) * 2) / (life * (life + 1));\n\t};\n\t\n\texports.TBILLEQ = function(settlement, maturity, discount) {\n\t settlement = utils.parseDate(settlement);\n\t maturity = utils.parseDate(maturity);\n\t discount = utils.parseNumber(discount);\n\t if (utils.anyIsError(settlement, maturity, discount)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if discount is lower than or equal to zero\n\t if (discount <= 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if settlement is greater than maturity\n\t if (settlement > maturity) {\n\t return error.num;\n\t }\n\t\n\t // Return error if maturity is more than one year after settlement\n\t if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n\t return error.num;\n\t }\n\t\n\t // Return bond-equivalent yield\n\t return (365 * discount) / (360 - discount * dateTime.DAYS360(settlement, maturity, false));\n\t};\n\t\n\texports.TBILLPRICE = function(settlement, maturity, discount) {\n\t settlement = utils.parseDate(settlement);\n\t maturity = utils.parseDate(maturity);\n\t discount = utils.parseNumber(discount);\n\t if (utils.anyIsError(settlement, maturity, discount)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if discount is lower than or equal to zero\n\t if (discount <= 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if settlement is greater than maturity\n\t if (settlement > maturity) {\n\t return error.num;\n\t }\n\t\n\t // Return error if maturity is more than one year after settlement\n\t if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n\t return error.num;\n\t }\n\t\n\t // Return bond-equivalent yield\n\t return 100 * (1 - discount * dateTime.DAYS360(settlement, maturity, false) / 360);\n\t};\n\t\n\texports.TBILLYIELD = function(settlement, maturity, price) {\n\t settlement = utils.parseDate(settlement);\n\t maturity = utils.parseDate(maturity);\n\t price = utils.parseNumber(price);\n\t if (utils.anyIsError(settlement, maturity, price)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if price is lower than or equal to zero\n\t if (price <= 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if settlement is greater than maturity\n\t if (settlement > maturity) {\n\t return error.num;\n\t }\n\t\n\t // Return error if maturity is more than one year after settlement\n\t if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n\t return error.num;\n\t }\n\t\n\t // Return bond-equivalent yield\n\t return (100 - price) * 360 / (price * dateTime.DAYS360(settlement, maturity, false));\n\t};\n\t\n\t// TODO\n\texports.VDB = function() {\n\t throw new Error('VDB is not implemented');\n\t};\n\t\n\t// TODO needs better support for date\n\t// exports.XIRR = function(values, dates, guess) {\n\t// // Credits: algorithm inspired by Apache OpenOffice\n\t//\n\t// values = utils.parseNumberArray(utils.flatten(values));\n\t// dates = utils.parseDateArray(utils.flatten(dates));\n\t// guess = utils.parseNumber(guess);\n\t//\n\t// if (utils.anyIsError(values, dates, guess)) {\n\t// return error.value;\n\t// }\n\t//\n\t// // Calculates the resulting amount\n\t// var irrResult = function(values, dates, rate) {\n\t// var r = rate + 1;\n\t// var result = values[0];\n\t// for (var i = 1; i < values.length; i++) {\n\t// result += values[i] / Math.pow(r, dateTime.DAYS(dates[i], dates[0]) / 365);\n\t// }\n\t// return result;\n\t// };\n\t//\n\t// // Calculates the first derivation\n\t// var irrResultDeriv = function(values, dates, rate) {\n\t// var r = rate + 1;\n\t// var result = 0;\n\t// for (var i = 1; i < values.length; i++) {\n\t// var frac = dateTime.DAYS(dates[i], dates[0]) / 365;\n\t// result -= frac * values[i] / Math.pow(r, frac + 1);\n\t// }\n\t// return result;\n\t// };\n\t//\n\t// // Check that values contains at least one positive value and one negative value\n\t// var positive = false;\n\t// var negative = false;\n\t// for (var i = 0; i < values.length; i++) {\n\t// if (values[i] > 0) {\n\t// positive = true;\n\t// }\n\t// if (values[i] < 0) {\n\t// negative = true;\n\t// }\n\t// }\n\t//\n\t// // Return error if values does not contain at least one positive value and one negative value\n\t// if (!positive || !negative) {\n\t// return error.num;\n\t// }\n\t//\n\t// // Initialize guess and resultRate\n\t// guess = guess || 0.1;\n\t// var resultRate = guess;\n\t//\n\t// // Set maximum epsilon for end of iteration\n\t// var epsMax = 1e-10;\n\t//\n\t// // Implement Newton's method\n\t// var newRate, epsRate, resultValue;\n\t// var contLoop = true;\n\t// do {\n\t// resultValue = irrResult(values, dates, resultRate);\n\t// newRate = resultRate - resultValue / irrResultDeriv(values, dates, resultRate);\n\t// epsRate = Math.abs(newRate - resultRate);\n\t// resultRate = newRate;\n\t// contLoop = (epsRate > epsMax) && (Math.abs(resultValue) > epsMax);\n\t// } while (contLoop);\n\t//\n\t// // Return internal rate of return\n\t// return resultRate;\n\t// };\n\t\n\texports.XNPV = function(rate, values, dates) {\n\t rate = utils.parseNumber(rate);\n\t values = utils.parseNumberArray(utils.flatten(values));\n\t dates = utils.parseDateArray(utils.flatten(dates));\n\t if (utils.anyIsError(rate, values, dates)) {\n\t return error.value;\n\t }\n\t\n\t var result = 0;\n\t for (var i = 0; i < values.length; i++) {\n\t result += values[i] / Math.pow(1 + rate, dateTime.DAYS(dates[i], dates[0]) / 365);\n\t }\n\t return result;\n\t};\n\t\n\t// TODO\n\texports.YIELD = function() {\n\t throw new Error('YIELD is not implemented');\n\t};\n\t\n\t// TODO\n\texports.YIELDDISC = function() {\n\t throw new Error('YIELDDISC is not implemented');\n\t};\n\t\n\t// TODO\n\texports.YIELDMAT = function() {\n\t throw new Error('YIELDMAT is not implemented');\n\t};\n\n\n/***/ },\n/* 31 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar error = __webpack_require__(16);\n\t\n\texports.MATCH = function(lookupValue, lookupArray, matchType) {\n\t if (!lookupValue && !lookupArray) {\n\t return error.na;\n\t }\n\t\n\t if (arguments.length === 2) {\n\t matchType = 1;\n\t }\n\t if (!(lookupArray instanceof Array)) {\n\t return error.na;\n\t }\n\t\n\t if (matchType !== -1 && matchType !== 0 && matchType !== 1) {\n\t return error.na;\n\t }\n\t var index;\n\t var indexValue;\n\t for (var idx = 0; idx < lookupArray.length; idx++) {\n\t if (matchType === 1) {\n\t if (lookupArray[idx] === lookupValue) {\n\t return idx + 1;\n\t } else if (lookupArray[idx] < lookupValue) {\n\t if (!indexValue) {\n\t index = idx + 1;\n\t indexValue = lookupArray[idx];\n\t } else if (lookupArray[idx] > indexValue) {\n\t index = idx + 1;\n\t indexValue = lookupArray[idx];\n\t }\n\t }\n\t } else if (matchType === 0) {\n\t if (typeof lookupValue === 'string') {\n\t lookupValue = lookupValue.replace(/\\?/g, '.');\n\t if (lookupArray[idx].toLowerCase().match(lookupValue.toLowerCase())) {\n\t return idx + 1;\n\t }\n\t } else {\n\t if (lookupArray[idx] === lookupValue) {\n\t return idx + 1;\n\t }\n\t }\n\t } else if (matchType === -1) {\n\t if (lookupArray[idx] === lookupValue) {\n\t return idx + 1;\n\t } else if (lookupArray[idx] > lookupValue) {\n\t if (!indexValue) {\n\t index = idx + 1;\n\t indexValue = lookupArray[idx];\n\t } else if (lookupArray[idx] < indexValue) {\n\t index = idx + 1;\n\t indexValue = lookupArray[idx];\n\t }\n\t }\n\t }\n\t }\n\t\n\t return index ? index : error.na;\n\t};\n\n/***/ },\n/* 32 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = func;\n\tvar SYMBOL = exports.SYMBOL = '>';\n\t\n\tfunction func(exp1, exp2) {\n\t return exp1 > exp2;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 33 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = func;\n\tvar SYMBOL = exports.SYMBOL = '>=';\n\t\n\tfunction func(exp1, exp2) {\n\t return exp1 >= exp2;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 34 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = func;\n\tvar SYMBOL = exports.SYMBOL = '<';\n\t\n\tfunction func(exp1, exp2) {\n\t return exp1 < exp2;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 35 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = func;\n\tvar SYMBOL = exports.SYMBOL = '<=';\n\t\n\tfunction func(exp1, exp2) {\n\t return exp1 <= exp2;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 36 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.SYMBOL = undefined;\n\texports.default = func;\n\t\n\tvar _number = __webpack_require__(6);\n\t\n\tvar _error = __webpack_require__(7);\n\t\n\tvar SYMBOL = exports.SYMBOL = '-';\n\t\n\tfunction func(first) {\n\t for (var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t rest[_key - 1] = arguments[_key];\n\t }\n\t\n\t var result = rest.reduce(function (acc, value) {\n\t return acc - (0, _number.toNumber)(value);\n\t }, (0, _number.toNumber)(first));\n\t\n\t if (isNaN(result)) {\n\t throw Error(_error.ERROR_VALUE);\n\t }\n\t\n\t return result;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 37 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.SYMBOL = undefined;\n\texports.default = func;\n\t\n\tvar _number = __webpack_require__(6);\n\t\n\tvar _error = __webpack_require__(7);\n\t\n\tvar SYMBOL = exports.SYMBOL = '*';\n\t\n\tfunction func(first) {\n\t for (var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t rest[_key - 1] = arguments[_key];\n\t }\n\t\n\t var result = rest.reduce(function (acc, value) {\n\t return acc * (0, _number.toNumber)(value);\n\t }, (0, _number.toNumber)(first));\n\t\n\t if (isNaN(result)) {\n\t throw Error(_error.ERROR_VALUE);\n\t }\n\t\n\t return result;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 38 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = func;\n\tvar SYMBOL = exports.SYMBOL = '<>';\n\t\n\tfunction func(exp1, exp2) {\n\t return exp1 !== exp2;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 39 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.SYMBOL = undefined;\n\texports.default = func;\n\t\n\tvar _number = __webpack_require__(6);\n\t\n\tvar _error = __webpack_require__(7);\n\t\n\tvar SYMBOL = exports.SYMBOL = '^';\n\t\n\tfunction func(exp1, exp2) {\n\t var result = Math.pow((0, _number.toNumber)(exp1), (0, _number.toNumber)(exp2));\n\t\n\t if (isNaN(result)) {\n\t throw Error(_error.ERROR_VALUE);\n\t }\n\t\n\t return result;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 40 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(module, process) {\"use strict\";\n\t\n\t/* parser generated by jison 0.4.17 */\n\t/*\n\t Returns a Parser object of the following structure:\n\t\n\t Parser: {\n\t yy: {}\n\t }\n\t\n\t Parser.prototype: {\n\t yy: {},\n\t trace: function(),\n\t symbols_: {associative list: name ==> number},\n\t terminals_: {associative list: number ==> name},\n\t productions_: [...],\n\t performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n\t table: [...],\n\t defaultActions: {...},\n\t parseError: function(str, hash),\n\t parse: function(input),\n\t\n\t lexer: {\n\t EOF: 1,\n\t parseError: function(str, hash),\n\t setInput: function(input),\n\t input: function(),\n\t unput: function(str),\n\t more: function(),\n\t less: function(n),\n\t pastInput: function(),\n\t upcomingInput: function(),\n\t showPosition: function(),\n\t test_match: function(regex_match_array, rule_index),\n\t next: function(),\n\t lex: function(),\n\t begin: function(condition),\n\t popState: function(),\n\t _currentRules: function(),\n\t topState: function(),\n\t pushState: function(condition),\n\t\n\t options: {\n\t ranges: boolean (optional: true ==> token location info will include a .range[] member)\n\t flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n\t backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n\t },\n\t\n\t performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n\t rules: [...],\n\t conditions: {associative list: name ==> set},\n\t }\n\t }\n\t\n\t\n\t token location info (@$, _$, etc.): {\n\t first_line: n,\n\t last_line: n,\n\t first_column: n,\n\t last_column: n,\n\t range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n\t }\n\t\n\t\n\t the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n\t text: (matched text)\n\t token: (the produced terminal token, if any)\n\t line: (yylineno)\n\t }\n\t while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n\t loc: (yylloc)\n\t expected: (string describing the set of expected tokens)\n\t recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n\t }\n\t*/\n\tvar parser = function () {\n\t var o = function o(k, v, _o, l) {\n\t for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;\n\t },\n\t $V0 = [1, 5],\n\t $V1 = [1, 8],\n\t $V2 = [1, 6],\n\t $V3 = [1, 7],\n\t $V4 = [1, 9],\n\t $V5 = [1, 14],\n\t $V6 = [1, 15],\n\t $V7 = [1, 16],\n\t $V8 = [1, 12],\n\t $V9 = [1, 13],\n\t $Va = [1, 17],\n\t $Vb = [1, 19],\n\t $Vc = [1, 20],\n\t $Vd = [1, 21],\n\t $Ve = [1, 22],\n\t $Vf = [1, 23],\n\t $Vg = [1, 24],\n\t $Vh = [1, 25],\n\t $Vi = [1, 26],\n\t $Vj = [1, 27],\n\t $Vk = [1, 28],\n\t $Vl = [5, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30],\n\t $Vm = [5, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30, 32],\n\t $Vn = [1, 37],\n\t $Vo = [5, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30, 34],\n\t $Vp = [5, 10, 11, 13, 14, 15, 16, 17, 29, 30],\n\t $Vq = [5, 10, 13, 14, 15, 16, 29, 30],\n\t $Vr = [5, 10, 11, 13, 14, 15, 16, 17, 18, 19, 29, 30],\n\t $Vs = [13, 29, 30],\n\t $Vt = [5, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30, 31, 35];\n\t var parser = { trace: function trace() {},\n\t yy: {},\n\t symbols_: { \"error\": 2, \"expressions\": 3, \"expression\": 4, \"EOF\": 5, \"variableSequence\": 6, \"number\": 7, \"STRING\": 8, \"&\": 9, \"=\": 10, \"+\": 11, \"(\": 12, \")\": 13, \"<\": 14, \">\": 15, \"NOT\": 16, \"-\": 17, \"*\": 18, \"/\": 19, \"^\": 20, \"FUNCTION\": 21, \"expseq\": 22, \"cell\": 23, \"ABSOLUTE_CELL\": 24, \":\": 25, \"RELATIVE_CELL\": 26, \"MIXED_CELL\": 27, \"ARRAY\": 28, \";\": 29, \",\": 30, \"VARIABLE\": 31, \"DECIMAL\": 32, \"NUMBER\": 33, \"%\": 34, \"#\": 35, \"!\": 36, \"$accept\": 0, \"$end\": 1 },\n\t terminals_: { 5: \"EOF\", 8: \"STRING\", 9: \"&\", 10: \"=\", 11: \"+\", 12: \"(\", 13: \")\", 14: \"<\", 15: \">\", 16: \"NOT\", 17: \"-\", 18: \"*\", 19: \"/\", 20: \"^\", 21: \"FUNCTION\", 24: \"ABSOLUTE_CELL\", 25: \":\", 26: \"RELATIVE_CELL\", 27: \"MIXED_CELL\", 28: \"ARRAY\", 29: \";\", 30: \",\", 31: \"VARIABLE\", 32: \"DECIMAL\", 33: \"NUMBER\", 34: \"%\", 35: \"#\", 36: \"!\" },\n\t productions_: [0, [3, 2], [4, 1], [4, 1], [4, 1], [4, 3], [4, 3], [4, 3], [4, 3], [4, 4], [4, 4], [4, 4], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 2], [4, 2], [4, 3], [4, 4], [4, 1], [4, 1], [4, 2], [23, 1], [23, 3], [23, 1], [23, 3], [23, 1], [23, 3], [22, 1], [22, 1], [22, 3], [22, 3], [6, 1], [6, 3], [7, 1], [7, 3], [7, 2], [2, 3], [2, 4]],\n\t performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n\t /* this == yyval */\n\t\n\t var $0 = $$.length - 1;\n\t switch (yystate) {\n\t case 1:\n\t\n\t return $$[$0 - 1];\n\t\n\t break;\n\t case 2:\n\t\n\t this.$ = yy.callVariable($$[$0][0]);\n\t\n\t break;\n\t case 3:\n\t\n\t this.$ = yy.toNumber($$[$0]);\n\t\n\t break;\n\t case 4:\n\t\n\t this.$ = yy.trimEdges($$[$0]);\n\t\n\t break;\n\t case 5:\n\t\n\t this.$ = yy.evaluateByOperator('&', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 6:\n\t\n\t this.$ = yy.evaluateByOperator('=', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 7:\n\t\n\t this.$ = yy.evaluateByOperator('+', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 8:\n\t\n\t this.$ = yy.toNumber($$[$0 - 1]);\n\t\n\t break;\n\t case 9:\n\t\n\t this.$ = yy.evaluateByOperator('<=', [$$[$0 - 3], $$[$0]]);\n\t\n\t break;\n\t case 10:\n\t\n\t this.$ = yy.evaluateByOperator('>=', [$$[$0 - 3], $$[$0]]);\n\t\n\t break;\n\t case 11:\n\t\n\t this.$ = yy.evaluateByOperator('<>', [$$[$0 - 3], $$[$0]]);\n\t\n\t break;\n\t case 12:\n\t\n\t this.$ = yy.evaluateByOperator('NOT', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 13:\n\t\n\t this.$ = yy.evaluateByOperator('>', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 14:\n\t\n\t this.$ = yy.evaluateByOperator('<', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 15:\n\t\n\t this.$ = yy.evaluateByOperator('-', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 16:\n\t\n\t this.$ = yy.evaluateByOperator('*', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 17:\n\t\n\t this.$ = yy.evaluateByOperator('/', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 18:\n\t\n\t this.$ = yy.evaluateByOperator('^', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 19:\n\t\n\t var n1 = yy.invertNumber($$[$0]);\n\t\n\t this.$ = n1;\n\t\n\t if (isNaN(this.$)) {\n\t this.$ = 0;\n\t }\n\t\n\t break;\n\t case 20:\n\t\n\t var n1 = yy.toNumber($$[$0]);\n\t\n\t this.$ = n1;\n\t\n\t if (isNaN(this.$)) {\n\t this.$ = 0;\n\t }\n\t\n\t break;\n\t case 21:\n\t\n\t this.$ = yy.callFunction($$[$0 - 2]);\n\t\n\t break;\n\t case 22:\n\t\n\t this.$ = yy.callFunction($$[$0 - 3], $$[$0 - 1]);\n\t\n\t break;\n\t case 26:case 28:case 30:\n\t\n\t this.$ = yy.cellValue($$[$0]);\n\t\n\t break;\n\t case 27:case 29:case 31:\n\t\n\t this.$ = yy.rangeValue($$[$0 - 2], $$[$0]);\n\t\n\t break;\n\t case 32:case 36:\n\t\n\t this.$ = [$$[$0]];\n\t\n\t break;\n\t case 33:\n\t\n\t var result = [];\n\t var arr = eval(\"[\" + yytext + \"]\");\n\t\n\t arr.forEach(function (item) {\n\t result.push(item);\n\t });\n\t\n\t this.$ = result;\n\t\n\t break;\n\t case 34:case 35:\n\t\n\t $$[$0 - 2].push($$[$0]);\n\t this.$ = $$[$0 - 2];\n\t\n\t break;\n\t case 37:\n\t\n\t this.$ = Array.isArray($$[$0 - 2]) ? $$[$0 - 2] : [$$[$0 - 2]];\n\t this.$.push($$[$0]);\n\t\n\t break;\n\t case 38:\n\t\n\t this.$ = $$[$0];\n\t\n\t break;\n\t case 39:\n\t\n\t this.$ = ($$[$0 - 2] + '.' + $$[$0]) * 1;\n\t\n\t break;\n\t case 40:\n\t\n\t this.$ = $$[$0 - 1] * 0.01;\n\t\n\t break;\n\t case 41:case 42:\n\t\n\t this.$ = yy.throwError($$[$0 - 2] + $$[$0 - 1] + $$[$0]);\n\t\n\t break;\n\t }\n\t },\n\t table: [{ 2: 11, 3: 1, 4: 2, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 1: [3] }, { 5: [1, 18], 9: $Vb, 10: $Vc, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }, o($Vl, [2, 2], { 32: [1, 29] }), o($Vl, [2, 3], { 34: [1, 30] }), o($Vl, [2, 4]), { 2: 11, 4: 31, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 32, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 33, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 12: [1, 34] }, o($Vl, [2, 23]), o($Vl, [2, 24], { 2: 35, 31: [1, 36], 35: $Va }), o($Vm, [2, 36], { 35: $Vn }), o($Vo, [2, 38], { 32: [1, 38] }), o($Vl, [2, 26], { 25: [1, 39] }), o($Vl, [2, 28], { 25: [1, 40] }), o($Vl, [2, 30], { 25: [1, 41] }), { 31: [1, 42] }, { 1: [2, 1] }, { 2: 11, 4: 43, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 44, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 45, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 48, 6: 3, 7: 4, 8: $V0, 10: [1, 46], 11: $V1, 12: $V2, 15: [1, 47], 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 50, 6: 3, 7: 4, 8: $V0, 10: [1, 49], 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 51, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 52, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 53, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 54, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 55, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 31: [1, 56] }, o($Vo, [2, 40]), { 9: $Vb, 10: $Vc, 11: $Vd, 13: [1, 57], 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }, o($Vp, [2, 19], { 9: $Vb, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vp, [2, 20], { 9: $Vb, 18: $Vi, 19: $Vj, 20: $Vk }), { 2: 11, 4: 60, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 13: [1, 58], 17: $V3, 21: $V4, 22: 59, 23: 10, 24: $V5, 26: $V6, 27: $V7, 28: [1, 61], 31: $V8, 33: $V9, 35: $Va }, o($Vl, [2, 25]), { 35: $Vn }, { 31: [1, 62] }, { 33: [1, 63] }, { 24: [1, 64] }, { 26: [1, 65] }, { 27: [1, 66] }, { 36: [1, 67] }, o($Vl, [2, 5]), o([5, 10, 13, 29, 30], [2, 6], { 9: $Vb, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vp, [2, 7], { 9: $Vb, 18: $Vi, 19: $Vj, 20: $Vk }), { 2: 11, 4: 68, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 69, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, o($Vq, [2, 14], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), { 2: 11, 4: 70, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, o($Vq, [2, 13], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o([5, 10, 13, 16, 29, 30], [2, 12], { 9: $Vb, 11: $Vd, 14: $Ve, 15: $Vf, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vp, [2, 15], { 9: $Vb, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vr, [2, 16], { 9: $Vb, 20: $Vk }), o($Vr, [2, 17], { 9: $Vb, 20: $Vk }), o([5, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30], [2, 18], { 9: $Vb }), o($Vm, [2, 37]), o($Vl, [2, 8]), o($Vl, [2, 21]), { 13: [1, 71], 29: [1, 72], 30: [1, 73] }, o($Vs, [2, 32], { 9: $Vb, 10: $Vc, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vs, [2, 33]), { 36: [1, 74] }, o($Vo, [2, 39]), o($Vl, [2, 27]), o($Vl, [2, 29]), o($Vl, [2, 31]), o($Vt, [2, 41]), o($Vq, [2, 9], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vq, [2, 11], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vq, [2, 10], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vl, [2, 22]), { 2: 11, 4: 75, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 76, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 26: $V6, 27: $V7, 31: $V8, 33: $V9, 35: $Va }, o($Vt, [2, 42]), o($Vs, [2, 34], { 9: $Vb, 10: $Vc, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vs, [2, 35], { 9: $Vb, 10: $Vc, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk })],\n\t defaultActions: { 18: [2, 1] },\n\t parseError: function parseError(str, hash) {\n\t if (hash.recoverable) {\n\t this.trace(str);\n\t } else {\n\t var _parseError = function _parseError(msg, hash) {\n\t this.message = msg;\n\t this.hash = hash;\n\t };\n\t\n\t _parseError.prototype = Error;\n\t\n\t throw new _parseError(str, hash);\n\t }\n\t },\n\t parse: function parse(input) {\n\t var self = this,\n\t stack = [0],\n\t tstack = [],\n\t // token stack\n\t vstack = [null],\n\t // semantic value stack\n\t lstack = [],\n\t // location stack\n\t table = this.table,\n\t yytext = '',\n\t yylineno = 0,\n\t yyleng = 0,\n\t recovering = 0,\n\t TERROR = 2,\n\t EOF = 1;\n\t\n\t var args = lstack.slice.call(arguments, 1);\n\t\n\t //this.reductionCount = this.shiftCount = 0;\n\t\n\t var lexer = Object.create(this.lexer);\n\t var sharedState = { yy: {} };\n\t // copy state\n\t for (var k in this.yy) {\n\t if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n\t sharedState.yy[k] = this.yy[k];\n\t }\n\t }\n\t\n\t lexer.setInput(input, sharedState.yy);\n\t sharedState.yy.lexer = lexer;\n\t sharedState.yy.parser = this;\n\t if (typeof lexer.yylloc == 'undefined') {\n\t lexer.yylloc = {};\n\t }\n\t var yyloc = lexer.yylloc;\n\t lstack.push(yyloc);\n\t\n\t var ranges = lexer.options && lexer.options.ranges;\n\t\n\t if (typeof sharedState.yy.parseError === 'function') {\n\t this.parseError = sharedState.yy.parseError;\n\t } else {\n\t this.parseError = Object.getPrototypeOf(this).parseError;\n\t }\n\t\n\t function popStack(n) {\n\t stack.length = stack.length - 2 * n;\n\t vstack.length = vstack.length - n;\n\t lstack.length = lstack.length - n;\n\t }\n\t\n\t _token_stack: var lex = function lex() {\n\t var token;\n\t token = lexer.lex() || EOF;\n\t // if token isn't its numeric value, convert\n\t if (typeof token !== 'number') {\n\t token = self.symbols_[token] || token;\n\t }\n\t return token;\n\t };\n\t\n\t var symbol,\n\t preErrorSymbol,\n\t state,\n\t action,\n\t a,\n\t r,\n\t yyval = {},\n\t p,\n\t len,\n\t newState,\n\t expected;\n\t while (true) {\n\t // retreive state number from top of stack\n\t state = stack[stack.length - 1];\n\t\n\t // use default actions if available\n\t if (this.defaultActions[state]) {\n\t action = this.defaultActions[state];\n\t } else {\n\t if (symbol === null || typeof symbol == 'undefined') {\n\t symbol = lex();\n\t }\n\t // read action for current state and first input\n\t action = table[state] && table[state][symbol];\n\t }\n\t\n\t _handle_error:\n\t // handle parse error\n\t if (typeof action === 'undefined' || !action.length || !action[0]) {\n\t\n\t // Return the rule stack depth where the nearest error rule can be found.\n\t // Return FALSE when no error recovery rule was found.\n\t var locateNearestErrorRecoveryRule = function locateNearestErrorRecoveryRule(state) {\n\t var stack_probe = stack.length - 1;\n\t var depth = 0;\n\t\n\t // try to recover from error\n\t for (;;) {\n\t // check for error recovery rule in this state\n\t if (TERROR.toString() in table[state]) {\n\t return depth;\n\t }\n\t if (state === 0 || stack_probe < 2) {\n\t return false; // No suitable error recovery rule available.\n\t }\n\t stack_probe -= 2; // popStack(1): [symbol, action]\n\t state = stack[stack_probe];\n\t ++depth;\n\t }\n\t };\n\t\n\t var error_rule_depth;\n\t var errStr = '';\n\t\n\t if (!recovering) {\n\t // first see if there's any chance at hitting an error recovery rule:\n\t error_rule_depth = locateNearestErrorRecoveryRule(state);\n\t\n\t // Report error\n\t expected = [];\n\t for (p in table[state]) {\n\t if (this.terminals_[p] && p > TERROR) {\n\t expected.push(\"'\" + this.terminals_[p] + \"'\");\n\t }\n\t }\n\t if (lexer.showPosition) {\n\t errStr = 'Parse error on line ' + (yylineno + 1) + \":\\n\" + lexer.showPosition() + \"\\nExpecting \" + expected.join(', ') + \", got '\" + (this.terminals_[symbol] || symbol) + \"'\";\n\t } else {\n\t errStr = 'Parse error on line ' + (yylineno + 1) + \": Unexpected \" + (symbol == EOF ? \"end of input\" : \"'\" + (this.terminals_[symbol] || symbol) + \"'\");\n\t }\n\t this.parseError(errStr, {\n\t text: lexer.match,\n\t token: this.terminals_[symbol] || symbol,\n\t line: lexer.yylineno,\n\t loc: yyloc,\n\t expected: expected,\n\t recoverable: error_rule_depth !== false\n\t });\n\t } else if (preErrorSymbol !== EOF) {\n\t error_rule_depth = locateNearestErrorRecoveryRule(state);\n\t }\n\t\n\t // just recovered from another error\n\t if (recovering == 3) {\n\t if (symbol === EOF || preErrorSymbol === EOF) {\n\t throw new Error(errStr || 'Parsing halted while starting to recover from another error.');\n\t }\n\t\n\t // discard current lookahead and grab another\n\t yyleng = lexer.yyleng;\n\t yytext = lexer.yytext;\n\t yylineno = lexer.yylineno;\n\t yyloc = lexer.yylloc;\n\t symbol = lex();\n\t }\n\t\n\t // try to recover from error\n\t if (error_rule_depth === false) {\n\t throw new Error(errStr || 'Parsing halted. No suitable error recovery rule available.');\n\t }\n\t popStack(error_rule_depth);\n\t\n\t preErrorSymbol = symbol == TERROR ? null : symbol; // save the lookahead token\n\t symbol = TERROR; // insert generic error symbol as new lookahead\n\t state = stack[stack.length - 1];\n\t action = table[state] && table[state][TERROR];\n\t recovering = 3; // allow 3 real symbols to be shifted before reporting a new error\n\t }\n\t\n\t // this shouldn't happen, unless resolve defaults are off\n\t if (action[0] instanceof Array && action.length > 1) {\n\t throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n\t }\n\t\n\t switch (action[0]) {\n\t case 1:\n\t // shift\n\t //this.shiftCount++;\n\t\n\t stack.push(symbol);\n\t vstack.push(lexer.yytext);\n\t lstack.push(lexer.yylloc);\n\t stack.push(action[1]); // push state\n\t symbol = null;\n\t if (!preErrorSymbol) {\n\t // normal execution/no error\n\t yyleng = lexer.yyleng;\n\t yytext = lexer.yytext;\n\t yylineno = lexer.yylineno;\n\t yyloc = lexer.yylloc;\n\t if (recovering > 0) {\n\t recovering--;\n\t }\n\t } else {\n\t // error just occurred, resume old lookahead f/ before error\n\t symbol = preErrorSymbol;\n\t preErrorSymbol = null;\n\t }\n\t break;\n\t\n\t case 2:\n\t // reduce\n\t //this.reductionCount++;\n\t\n\t len = this.productions_[action[1]][1];\n\t\n\t // perform semantic action\n\t yyval.$ = vstack[vstack.length - len]; // default to $$ = $1\n\t // default location, uses first token for firsts, last for lasts\n\t yyval._$ = {\n\t first_line: lstack[lstack.length - (len || 1)].first_line,\n\t last_line: lstack[lstack.length - 1].last_line,\n\t first_column: lstack[lstack.length - (len || 1)].first_column,\n\t last_column: lstack[lstack.length - 1].last_column\n\t };\n\t if (ranges) {\n\t yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];\n\t }\n\t r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));\n\t\n\t if (typeof r !== 'undefined') {\n\t return r;\n\t }\n\t\n\t // pop off stack\n\t if (len) {\n\t stack = stack.slice(0, -1 * len * 2);\n\t vstack = vstack.slice(0, -1 * len);\n\t lstack = lstack.slice(0, -1 * len);\n\t }\n\t\n\t stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)\n\t vstack.push(yyval.$);\n\t lstack.push(yyval._$);\n\t // goto new state = table[STATE][NONTERMINAL]\n\t newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n\t stack.push(newState);\n\t break;\n\t\n\t case 3:\n\t // accept\n\t return true;\n\t }\n\t }\n\t\n\t return true;\n\t } };\n\t\n\t /* generated by jison-lex 0.3.4 */\n\t var lexer = function () {\n\t var lexer = {\n\t\n\t EOF: 1,\n\t\n\t parseError: function parseError(str, hash) {\n\t if (this.yy.parser) {\n\t this.yy.parser.parseError(str, hash);\n\t } else {\n\t throw new Error(str);\n\t }\n\t },\n\t\n\t // resets the lexer, sets new input\n\t setInput: function setInput(input, yy) {\n\t this.yy = yy || this.yy || {};\n\t this._input = input;\n\t this._more = this._backtrack = this.done = false;\n\t this.yylineno = this.yyleng = 0;\n\t this.yytext = this.matched = this.match = '';\n\t this.conditionStack = ['INITIAL'];\n\t this.yylloc = {\n\t first_line: 1,\n\t first_column: 0,\n\t last_line: 1,\n\t last_column: 0\n\t };\n\t if (this.options.ranges) {\n\t this.yylloc.range = [0, 0];\n\t }\n\t this.offset = 0;\n\t return this;\n\t },\n\t\n\t // consumes and returns one char from the input\n\t input: function input() {\n\t var ch = this._input[0];\n\t this.yytext += ch;\n\t this.yyleng++;\n\t this.offset++;\n\t this.match += ch;\n\t this.matched += ch;\n\t var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n\t if (lines) {\n\t this.yylineno++;\n\t this.yylloc.last_line++;\n\t } else {\n\t this.yylloc.last_column++;\n\t }\n\t if (this.options.ranges) {\n\t this.yylloc.range[1]++;\n\t }\n\t\n\t this._input = this._input.slice(1);\n\t return ch;\n\t },\n\t\n\t // unshifts one char (or a string) into the input\n\t unput: function unput(ch) {\n\t var len = ch.length;\n\t var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\t\n\t this._input = ch + this._input;\n\t this.yytext = this.yytext.substr(0, this.yytext.length - len);\n\t //this.yyleng -= len;\n\t this.offset -= len;\n\t var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n\t this.match = this.match.substr(0, this.match.length - 1);\n\t this.matched = this.matched.substr(0, this.matched.length - 1);\n\t\n\t if (lines.length - 1) {\n\t this.yylineno -= lines.length - 1;\n\t }\n\t var r = this.yylloc.range;\n\t\n\t this.yylloc = {\n\t first_line: this.yylloc.first_line,\n\t last_line: this.yylineno + 1,\n\t first_column: this.yylloc.first_column,\n\t last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len\n\t };\n\t\n\t if (this.options.ranges) {\n\t this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n\t }\n\t this.yyleng = this.yytext.length;\n\t return this;\n\t },\n\t\n\t // When called from action, caches matched text and appends it on next action\n\t more: function more() {\n\t this._more = true;\n\t return this;\n\t },\n\t\n\t // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\n\t reject: function reject() {\n\t if (this.options.backtrack_lexer) {\n\t this._backtrack = true;\n\t } else {\n\t return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n\t text: \"\",\n\t token: null,\n\t line: this.yylineno\n\t });\n\t }\n\t return this;\n\t },\n\t\n\t // retain first n characters of the match\n\t less: function less(n) {\n\t this.unput(this.match.slice(n));\n\t },\n\t\n\t // displays already matched input, i.e. for error messages\n\t pastInput: function pastInput() {\n\t var past = this.matched.substr(0, this.matched.length - this.match.length);\n\t return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\\n/g, \"\");\n\t },\n\t\n\t // displays upcoming input, i.e. for error messages\n\t upcomingInput: function upcomingInput() {\n\t var next = this.match;\n\t if (next.length < 20) {\n\t next += this._input.substr(0, 20 - next.length);\n\t }\n\t return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n\t },\n\t\n\t // displays the character position where the lexing error occurred, i.e. for error messages\n\t showPosition: function showPosition() {\n\t var pre = this.pastInput();\n\t var c = new Array(pre.length + 1).join(\"-\");\n\t return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n\t },\n\t\n\t // test the lexed token: return FALSE when not a match, otherwise return token\n\t test_match: function test_match(match, indexed_rule) {\n\t var token, lines, backup;\n\t\n\t if (this.options.backtrack_lexer) {\n\t // save context\n\t backup = {\n\t yylineno: this.yylineno,\n\t yylloc: {\n\t first_line: this.yylloc.first_line,\n\t last_line: this.last_line,\n\t first_column: this.yylloc.first_column,\n\t last_column: this.yylloc.last_column\n\t },\n\t yytext: this.yytext,\n\t match: this.match,\n\t matches: this.matches,\n\t matched: this.matched,\n\t yyleng: this.yyleng,\n\t offset: this.offset,\n\t _more: this._more,\n\t _input: this._input,\n\t yy: this.yy,\n\t conditionStack: this.conditionStack.slice(0),\n\t done: this.done\n\t };\n\t if (this.options.ranges) {\n\t backup.yylloc.range = this.yylloc.range.slice(0);\n\t }\n\t }\n\t\n\t lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n\t if (lines) {\n\t this.yylineno += lines.length;\n\t }\n\t this.yylloc = {\n\t first_line: this.yylloc.last_line,\n\t last_line: this.yylineno + 1,\n\t first_column: this.yylloc.last_column,\n\t last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length : this.yylloc.last_column + match[0].length\n\t };\n\t this.yytext += match[0];\n\t this.match += match[0];\n\t this.matches = match;\n\t this.yyleng = this.yytext.length;\n\t if (this.options.ranges) {\n\t this.yylloc.range = [this.offset, this.offset += this.yyleng];\n\t }\n\t this._more = false;\n\t this._backtrack = false;\n\t this._input = this._input.slice(match[0].length);\n\t this.matched += match[0];\n\t token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n\t if (this.done && this._input) {\n\t this.done = false;\n\t }\n\t if (token) {\n\t return token;\n\t } else if (this._backtrack) {\n\t // recover context\n\t for (var k in backup) {\n\t this[k] = backup[k];\n\t }\n\t return false; // rule action called reject() implying the next rule should be tested instead.\n\t }\n\t return false;\n\t },\n\t\n\t // return next match in input\n\t next: function next() {\n\t if (this.done) {\n\t return this.EOF;\n\t }\n\t if (!this._input) {\n\t this.done = true;\n\t }\n\t\n\t var token, match, tempMatch, index;\n\t if (!this._more) {\n\t this.yytext = '';\n\t this.match = '';\n\t }\n\t var rules = this._currentRules();\n\t for (var i = 0; i < rules.length; i++) {\n\t tempMatch = this._input.match(this.rules[rules[i]]);\n\t if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n\t match = tempMatch;\n\t index = i;\n\t if (this.options.backtrack_lexer) {\n\t token = this.test_match(tempMatch, rules[i]);\n\t if (token !== false) {\n\t return token;\n\t } else if (this._backtrack) {\n\t match = false;\n\t continue; // rule action called reject() implying a rule MISmatch.\n\t } else {\n\t // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n\t return false;\n\t }\n\t } else if (!this.options.flex) {\n\t break;\n\t }\n\t }\n\t }\n\t if (match) {\n\t token = this.test_match(match, rules[index]);\n\t if (token !== false) {\n\t return token;\n\t }\n\t // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n\t return false;\n\t }\n\t if (this._input === \"\") {\n\t return this.EOF;\n\t } else {\n\t return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n\t text: \"\",\n\t token: null,\n\t line: this.yylineno\n\t });\n\t }\n\t },\n\t\n\t // return next match that has a token\n\t lex: function lex() {\n\t var r = this.next();\n\t if (r) {\n\t return r;\n\t } else {\n\t return this.lex();\n\t }\n\t },\n\t\n\t // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\n\t begin: function begin(condition) {\n\t this.conditionStack.push(condition);\n\t },\n\t\n\t // pop the previously active lexer condition state off the condition stack\n\t popState: function popState() {\n\t var n = this.conditionStack.length - 1;\n\t if (n > 0) {\n\t return this.conditionStack.pop();\n\t } else {\n\t return this.conditionStack[0];\n\t }\n\t },\n\t\n\t // produce the lexer rule set which is active for the currently active lexer condition state\n\t _currentRules: function _currentRules() {\n\t if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n\t return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n\t } else {\n\t return this.conditions[\"INITIAL\"].rules;\n\t }\n\t },\n\t\n\t // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\n\t topState: function topState(n) {\n\t n = this.conditionStack.length - 1 - Math.abs(n || 0);\n\t if (n >= 0) {\n\t return this.conditionStack[n];\n\t } else {\n\t return \"INITIAL\";\n\t }\n\t },\n\t\n\t // alias for begin(condition)\n\t pushState: function pushState(condition) {\n\t this.begin(condition);\n\t },\n\t\n\t // return the number of states currently on the stack\n\t stateStackSize: function stateStackSize() {\n\t return this.conditionStack.length;\n\t },\n\t options: {},\n\t performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {\n\t var YYSTATE = YY_START;\n\t switch ($avoiding_name_collisions) {\n\t case 0:\n\t /* skip whitespace */\n\t break;\n\t case 1:\n\t return 8;\n\t break;\n\t case 2:\n\t return 8;\n\t break;\n\t case 3:\n\t return 21;\n\t break;\n\t case 4:\n\t return 24;\n\t break;\n\t case 5:\n\t return 27;\n\t break;\n\t case 6:\n\t return 27;\n\t break;\n\t case 7:\n\t return 26;\n\t break;\n\t case 8:\n\t return 21;\n\t break;\n\t case 9:\n\t return 31;\n\t break;\n\t case 10:\n\t return 31;\n\t break;\n\t case 11:\n\t return 33;\n\t break;\n\t case 12:\n\t return 28;\n\t break;\n\t case 13:\n\t /* skip whitespace */\n\t break;\n\t case 14:\n\t return 9;\n\t break;\n\t case 15:\n\t return ' ';\n\t break;\n\t case 16:\n\t return 32;\n\t break;\n\t case 17:\n\t return 25;\n\t break;\n\t case 18:\n\t return 29;\n\t break;\n\t case 19:\n\t return 30;\n\t break;\n\t case 20:\n\t return 18;\n\t break;\n\t case 21:\n\t return 19;\n\t break;\n\t case 22:\n\t return 17;\n\t break;\n\t case 23:\n\t return 11;\n\t break;\n\t case 24:\n\t return 20;\n\t break;\n\t case 25:\n\t return 12;\n\t break;\n\t case 26:\n\t return 13;\n\t break;\n\t case 27:\n\t return 15;\n\t break;\n\t case 28:\n\t return 14;\n\t break;\n\t case 29:\n\t return 16;\n\t break;\n\t case 30:\n\t return '\"';\n\t break;\n\t case 31:\n\t return \"'\";\n\t break;\n\t case 32:\n\t return \"!\";\n\t break;\n\t case 33:\n\t return 10;\n\t break;\n\t case 34:\n\t return 34;\n\t break;\n\t case 35:\n\t return 35;\n\t break;\n\t case 36:\n\t return 5;\n\t break;\n\t }\n\t },\n\t rules: [/^(?:\\s+)/, /^(?:\"(\\\\[\"]|[^\"])*\")/, /^(?:'(\\\\[']|[^'])*')/, /^(?:[A-Za-z]{1,}[A-Za-z_0-9\\.]+(?=[(]))/, /^(?:\\$[A-Za-z]+\\$[0-9]+)/, /^(?:\\$[A-Za-z]+[0-9]+)/, /^(?:[A-Za-z]+\\$[0-9]+)/, /^(?:[A-Za-z]+[0-9]+)/, /^(?:[A-Za-z\\.]+(?=[(]))/, /^(?:[A-Za-z]{1,}[A-Za-z_0-9]+)/, /^(?:[A-Za-z_]+)/, /^(?:[0-9]+)/, /^(?:\\[(.*)?\\])/, /^(?:\\$)/, /^(?:&)/, /^(?: )/, /^(?:[.])/, /^(?::)/, /^(?:;)/, /^(?:,)/, /^(?:\\*)/, /^(?:\\/)/, /^(?:-)/, /^(?:\\+)/, /^(?:\\^)/, /^(?:\\()/, /^(?:\\))/, /^(?:>)/, /^(?:<)/, /^(?:NOT\\b)/, /^(?:\")/, /^(?:')/, /^(?:!)/, /^(?:=)/, /^(?:%)/, /^(?:[#])/, /^(?:$)/],\n\t conditions: { \"INITIAL\": { \"rules\": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36], \"inclusive\": true } }\n\t };\n\t return lexer;\n\t }();\n\t parser.lexer = lexer;\n\t function Parser() {\n\t this.yy = {};\n\t }\n\t Parser.prototype = parser;parser.Parser = Parser;\n\t return new Parser();\n\t}();\n\t\n\tif (true) {\n\t exports.parser = parser;\n\t exports.Parser = parser.Parser;\n\t exports.parse = function () {\n\t return parser.parse.apply(parser, arguments);\n\t };\n\t\n\t if (typeof module !== 'undefined' && __webpack_require__.c[0] === module) {\n\t exports.main(process.argv.slice(1));\n\t }\n\t}\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(41)(module), __webpack_require__(20)))\n\n/***/ },\n/* 41 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ },\n/* 42 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.trimEdges = trimEdges;\n\t/**\n\t * Trim value by cutting character starting from the beginning and ending at the same time.\n\t *\n\t * @param {String} string String to trimming.\n\t * @param {Number} [margin=1] Number of character to cut.\n\t * @returns {String}\n\t */\n\tfunction trimEdges(string) {\n\t var margin = arguments.length <= 1 || arguments[1] === undefined ? 1 : arguments[1];\n\t\n\t string = string.substring(margin, string.length - margin);\n\t\n\t return string;\n\t}\n\n/***/ },\n/* 43 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\texports.extractLabel = extractLabel;\n\texports.toLabel = toLabel;\n\texports.columnLabelToIndex = columnLabelToIndex;\n\texports.columnIndexToLabel = columnIndexToLabel;\n\texports.rowLabelToIndex = rowLabelToIndex;\n\texports.rowIndexToLabel = rowIndexToLabel;\n\tvar LABEL_EXTRACT_REGEXP = /^([$])?([A-Za-z]+)([$])?([0-9]+)$/;\n\t\n\t/**\n\t * Extract cell coordinates.\n\t *\n\t * @param {String} label Cell coordinates (eq. 'A1', '$B6', '$N$98').\n\t * @returns {Array} Returns an array of objects.\n\t */\n\tfunction extractLabel(label) {\n\t if (!LABEL_EXTRACT_REGEXP.test(label)) {\n\t return [];\n\t }\n\t\n\t var _label$match = label.match(LABEL_EXTRACT_REGEXP);\n\t\n\t var _label$match2 = _slicedToArray(_label$match, 5);\n\t\n\t var columnAbs = _label$match2[1];\n\t var column = _label$match2[2];\n\t var rowAbs = _label$match2[3];\n\t var row = _label$match2[4];\n\t\n\t\n\t return [{\n\t index: rowLabelToIndex(row),\n\t label: row,\n\t isAbsolute: rowAbs === '$'\n\t }, {\n\t index: columnLabelToIndex(column),\n\t label: column,\n\t isAbsolute: columnAbs === '$'\n\t }];\n\t}\n\t\n\t/**\n\t * Convert row and column indexes into cell label.\n\t *\n\t * @param {Object} row Object with `index` and `isAbsolute` properties.\n\t * @param {Object} column Object with `index` and `isAbsolute` properties.\n\t * @returns {String} Returns cell label.\n\t */\n\tfunction toLabel(row, column) {\n\t var rowLabel = (row.isAbsolute ? '$' : '') + rowIndexToLabel(row.index);\n\t var columnLabel = (column.isAbsolute ? '$' : '') + columnIndexToLabel(column.index);\n\t\n\t return columnLabel + rowLabel;\n\t}\n\t\n\tvar COLUMN_LABEL_BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\tvar COLUMN_LABEL_BASE_LENGTH = COLUMN_LABEL_BASE.length;\n\t\n\t/**\n\t * Convert column label to index.\n\t *\n\t * @param {String} label Column label (eq. 'ABB', 'CNQ')\n\t * @returns {Number} Returns -1 if label is not recognized otherwise proper column index.\n\t */\n\tfunction columnLabelToIndex(label) {\n\t var result = 0;\n\t\n\t if (label) {\n\t for (var i = 0, j = label.length - 1; i < label.length; i += 1, j -= 1) {\n\t result += Math.pow(COLUMN_LABEL_BASE_LENGTH, j) * (COLUMN_LABEL_BASE.indexOf(label[i]) + 1);\n\t }\n\t }\n\t --result;\n\t\n\t return result;\n\t}\n\t\n\t/**\n\t * Convert column index to label.\n\t *\n\t * @param {Number} column Column index.\n\t * @returns {String} Returns column label (eq. 'ABB', 'CNQ').\n\t */\n\tfunction columnIndexToLabel(column) {\n\t var result = '';\n\t\n\t while (column >= 0) {\n\t result = String.fromCharCode(column % COLUMN_LABEL_BASE_LENGTH + 97) + result;\n\t column = Math.floor(column / COLUMN_LABEL_BASE_LENGTH) - 1;\n\t }\n\t\n\t return result.toUpperCase();\n\t}\n\t\n\t/**\n\t * Convert row label to index.\n\t *\n\t * @param {String} label Row label (eq. '1', '5')\n\t * @returns {Number} Returns -1 if label is not recognized otherwise proper row index.\n\t */\n\tfunction rowLabelToIndex(label) {\n\t var result = parseInt(label, 10);\n\t\n\t if (isNaN(result)) {\n\t result = -1;\n\t } else {\n\t result = Math.max(result - 1, -1);\n\t }\n\t\n\t return result;\n\t}\n\t\n\t/**\n\t * Convert row index to label.\n\t *\n\t * @param {Number} row Row index.\n\t * @returns {String} Returns row label (eq. '1', '7').\n\t */\n\tfunction rowIndexToLabel(row) {\n\t var result = '';\n\t\n\t if (row >= 0) {\n\t result = '' + (row + 1);\n\t }\n\t\n\t return result;\n\t}\n\n/***/ }\n/******/ ])\n});\n;\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["formula-parser.min.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","_interopRequireDefault","obj","__esModule","default","Object","defineProperty","value","rowLabelToIndex","rowIndexToLabel","columnLabelToIndex","columnIndexToLabel","toLabel","extractLabel","error","Parser","ERROR_VALUE","ERROR_REF","ERROR_NUM","ERROR_NULL","ERROR_NOT_AVAILABLE","ERROR_NEED_UPDATE","ERROR_NAME","ERROR_DIV_ZERO","ERROR","SUPPORTED_FORMULAS","undefined","_parser","_error","_error2","_cell","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","prototype","create","constructor","enumerable","writable","configurable","setPrototypeOf","__proto__","_slicedToArray","sliceIterator","arr","i","_arr","_n","_d","_e","_s","_i","Symbol","iterator","next","done","push","length","err","Array","isArray","_createClass","defineProperties","target","props","descriptor","key","protoProps","staticProps","_supportedFormulas","get","_tinyEmitter","_tinyEmitter2","_evaluateByOperator","_evaluateByOperator2","_grammarParser","_string","_number","_Emitter","_this","getPrototypeOf","parser","yy","toNumber","trimEdges","invertNumber","throwError","errorName","_throwError","callVariable","variable","_callVariable","evaluateByOperator","callFunction","cellValue","_callCellValue","rangeValue","start","end","_callRangeValue","variables","setVariable","expression","result","parse","ex","message","Error","name","getVariable","emit","newValue","label","_extractLabel","_extractLabel2","row","column","_value","startLabel","endLabel","_extractLabel3","_extractLabel4","startRow","startColumn","_extractLabel5","_extractLabel6","endRow","endColumn","startCell","endCell","index","arguments","parsedError","E","on","callback","ctx","e","fn","once","listener","off","apply","_","data","slice","evtArr","len","evts","liveEvents","_toConsumableArray","arr2","from","operator","params","toUpperCase","availableOperators","registerOperation","symbol","func","forEach","s","isFactory","_add","_add2","_ampersand","_ampersand2","_divide","_divide2","_equal","_equal2","_formulaFunction","_formulaFunction2","_greaterThan","_greaterThan2","_greaterThanOrEqual","_greaterThanOrEqual2","_lessThan","_lessThan2","_lessThanOrEqual","_lessThanOrEqual2","_minus","_minus2","_multiply","_multiply2","_notEqual","_notEqual2","_power","_power2","SYMBOL","first","_len","rest","_key","reduce","acc","isNaN","number","indexOf","parseFloat","parseInt","_defineProperty","type","replace","errors","_errors","toString","Infinity","exp1","exp2","_interopRequireWildcard","newObj","hasOwnProperty","symbolParts","split","foundFormula","formulajs","nestedFormula","_supportedFormulas2","_formulajs","categories","category","f","set","mathTrig","statistical","engineering","dateTime","BETADIST","BETA","DIST","BETAINV","INV","BINOMDIST","BINOM","CEILING","ISOCEILING","MATH","CEILINGMATH","CEILINGPRECISE","PRECISE","CHIDIST","CHISQ","CHIDISTRT","RT","CHIINV","CHIINVRT","CHITEST","TEST","CONFIDENCE","NORM","COVAR","COVARIANCE","P","COVARIANCEP","COVARIANCES","S","CRITBINOM","EXPONDIST","EXPON","ERFCPRECISE","ERFC","ERFPRECISE","ERF","FDIST","F","FDISTRT","FINVRT","FINV","FLOOR","FLOORMATH","FLOORPRECISE","FTEST","GAMMADIST","GAMMA","GAMMAINV","GAMMALNPRECISE","GAMMALN","HYPGEOMDIST","HYPGEOM","LOGINV","LOGNORM","LOGNORMINV","LOGNORMDIST","MODE","SNGL","MODEMULT","MULT","MODESNGL","NEGBINOMDIST","NEGBINOM","NETWORKDAYSINTL","NETWORKDAYS","INTL","NORMDIST","NORMINV","NORMSDIST","NORMSINV","PERCENTILE","EXC","PERCENTILEEXC","PERCENTILEINC","INC","PERCENTRANK","PERCENTRANKEXC","PERCENTRANKINC","POISSON","POISSONDIST","QUARTILE","QUARTILEEXC","QUARTILEINC","RANK","EQ","RANKAVG","AVG","RANKEQ","SKEWP","SKEW","STDEV","STDEVP","STDEVS","TDIST","T","TDISTRT","TINV","TTEST","VAR","VARP","VARS","WEIBULL","WEIBULLDIST","WORKDAYINTL","WORKDAY","ZTEST","Z","utils","information","ABS","parseNumber","Math","abs","ACOS","acos","num","ACOSH","log","sqrt","ACOT","atan","ACOTH","AGGREGATE","function_num","options","ref1","ref2","anyIsError","AVERAGE","COUNT","COUNTA","MAX","MIN","PRODUCT","SUM","MEDIAN","LARGE","SMALL","ARABIC","text","test","r","M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I","ASIN","asin","ASINH","ATAN","ATAN2","number_x","number_y","atan2","ATANH","BASE","radix","min_length","max","join","significance","mode","precision","floor","ROUND","ceil","COMBIN","number_chosen","FACT","COMBINA","COS","cos","COSH","exp","COT","tan","COTH","e2","CSC","sin","CSCH","DECIMAL","DEGREES","PI","EVEN","EXP","MEMOIZED_FACT","n","FACTDOUBLE","GCD","range","parseNumberArray","flatten","r0","x","ri","y","INT","ISO","LCM","o","j","d","pop","splice","LN","LN10","LN2","LOG10E","LOG2E","LOG","base","LOG10","MOD","dividend","divisor","div0","modulus","MROUND","multiple","round","MULTINOMIAL","args","sum","ODD","temp","POWER","power","pow","QUOTIENT","numerator","denominator","RADIANS","RAND","random","RANDBETWEEN","bottom","top","ROMAN","digits","String","roman","ROUNDDOWN","sign","ROUNDUP","SEC","SECH","SERIESSUM","coefficients","SIGN","SIN","SINH","SQRT","SQRTPI","SQRT1_2","SQRT2","SUBTOTAL","function_code","ADD","num1","num2","na","MINUS","DIVIDE","MULTIPLY","factor1","factor2","GTE","LT","LTE","value1","value2","NE","POW","exponent","arrayEach","argsToArray","parsed","SUMIF","criteria","eval","SUMIFS","shift","n_range_elements","n_criterias","el","condition","SUMPRODUCT","product","k","_ij","arrays","SUMSQ","numbers","ISNUMBER","SUMX2MY2","array_x","array_y","SUMX2PY2","SUMXMY2","TAN","TANH","TRUNC","flattenShallow","array","a","b","aIsArray","bIsArray","concat","isFlat","possibleNumbers","filter","cleanFloat","parseBool","bool","up","Date","string","parseMatrix","matrix","pnarr","d1900","parseDate","date","getTime","parseDateArray","arrayValuesToNumbers","idx","initial","iteratee","nil","ref","jStat","misc","SQRT2PI","AVEDEV","subtract","mean","count","AVERAGEA","AVERAGEIF","average_range","average_count","AVERAGEIFS","average","alpha","beta","cumulative","A","B","cdf","pdf","probability","inv","successes","trials","binomial","RANGE","successes2","chisquare","observed","expected","ChiSq","xsqr","dof","Pi","t","tmp","col","COLUMN","COLUMNS","cols","sd","normalci","tci","CORREL","array1","array2","corrcoeff","COUNTBLANK","COUNTIN","element","blanks","COUNTIF","matches","COUNTIFS","results","COUNTUNIQUE","UNIQUE","mean1","mean2","covariance","DEVSQ","lambda","exponential","d1","d2","centralF","sumOfSquares","values","x1","x2","sum1","sum2","FISHER","FISHERINV","e2y","FORECAST","data_y","data_x","xmean","ymean","den","FREQUENCY","bins","gammafn","gamma","gammaln","GAUSS","z","normal","GEOMEAN","geomean","GROWTH","known_y","known_x","new_x","use_const","avg_x","avg_y","avg_xy","avg_xx","new_y","HARMEAN","N","INTERCEPT","KURT","sigma","stdev","sort","LINEST","LOGEST","lognormal","MAXA","median","min","MINA","currentItem","maxItems","negbin","PEARSON","den1","den2","l","fl","uniques","match","PERMUT","PERMUTATIONA","PHI","poisson","PROB","lower","upper","sorted","quart","order","ROW","ROWS","rows","RSQ","m2","m3","SLOPE","STANDARDIZE","v","STDEVA","VARA","STDEVPA","VARPA","STEYX","lft","TRANSPOSE","transpose","df","studentt","mean_x","mean_y","s_x","s_y","TREND","new_data_x","linest","TRIMMEAN","percent","trim","numbro","ASC","BAHTTEXT","CHAR","fromCharCode","CLEAN","re","CODE","charCodeAt","CONCATENATE","trueFound","falseFound","DBCS","DOLLAR","decimals","format","EXACT","text1","text2","FIND","find_text","within_text","position","FIXED","no_commas","HTML2TEXT","line","LEFT","substring","LEN","LOWER","toLowerCase","MID","begin","NUMBERVALUE","decimal_separator","group_separator","Number","PRONETIC","PROPER","txt","charAt","substr","REGEXEXTRACT","regular_expression","RegExp","REGEXMATCH","full","REGEXREPLACE","replacement","REPLACE","new_text","REPT","RIGHT","SEARCH","foundAt","SPLIT","separator","SUBSTITUTE","old_text","occurrence","TEXT","TRIM","UNICHAR","UNICODE","UPPER","VALUE","unformat","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","process","Numbro","zeroes","ret","toFixedLargeSmall","mantissa","beforeDec","afterDec","prefix","endStr","zerosStr","str","toFixed","roundingFunction","optionals","optionalsRegExp","output","formatNumbro","escapedFormat","formatCurrency","cultures","currentCulture","currency","formatPercentage","formatTime","formatNumber","unformatNumbro","thousandRegExp","millionRegExp","billionRegExp","trillionRegExp","stringOriginal","bytesMultiplier","unformatTime","zeroFormat","delimiters","decimal","abbreviations","thousand","million","billion","trillion","binarySuffixes","decimalSuffixes","NaN","currencySymbol","originalFormat","spliceIndex","symbolIndex","openParenIndex","plusSignIndex","minusSignIndex","space","decimalSeparator","spaceSeparated","formatForeignCurrency","foreignCurrencySymbol","hours","minutes","seconds","timeArray","formatByteUnits","suffixes","scale","suffix","sep","byteFormat","units","totalLength","minimumPrecision","w","intPrecision","postfix","thousands","indexOpenP","size","indexMinus","minlen","negP","signed","optDec","abbr","abbrK","abbrM","abbrB","abbrT","abbrForce","bytes","ord","forcedNeg","neg","paren","isFinite","info","byteFormatOrder","marker","ordinal","setCulture","code","chooseCulture","defaults","defaultFormat","currencyFormat","defaultCurrencyFormat","inNodejsRuntime","browser","title","multiplier","parts","correctionFactor","prev","mp","mn","VERSION","general","binary","languages","hasModule","enUS","formats","fourDigits","fullWithTwoDecimals","fullWithTwoDecimalsNoCurrency","input","isNumbro","version","setLanguage","newLanguage","fallbackLanguage","console","warn","matchingLanguage","keys","language","newCulture","fallbackCulture","matchingCulture","culture","languageData","cultureData","validate","val","_decimalSep","_thousandSep","_currSymbol","_valArray","_abbrObj","_thousandRegEx","loadLanguagesInNode","loadCulturesInNode","langLocaleCode","optInitialValue","isValueSet","clone","inputString","binaryByteUnits","byteUnits","decimalByteUnits","valueOf","add","cback","accum","curr","corrFactor","multiply","divide","difference","ender","window","defaultSetTimout","defaultClearTimeout","runTimeout","fun","cachedSetTimeout","setTimeout","runClearTimeout","cachedClearTimeout","clearTimeout","cleanUpNextTick","draining","currentQueue","queue","queueIndex","drainQueue","timeout","run","Item","noop","nextTick","env","argv","versions","addListener","removeListener","removeAllListeners","binding","cwd","chdir","dir","umask","j$","calcRdx","isFunction","arg","isNumber","toVector","_init","retZero","retOne","retIdent","map","seq","toArray","extend","dimensions","rowa","submat","arange","ind","cola","diag","nrow","res","antidiag","objArr","toAlter","ncol","cumreduce","alter","zeros","ones","rand","identity","symmetric","clear","cnt","hival","step","current","rl","_slice","list","copy","rcSlice","colSlice","rowSlice","sliceAssign","nl","ml","diagonal","diagArray","mat","jProto","funcs","passfunc","Function","ascNum","clip","sumsqrd","sumsqerr","sumrow","prod","low","high","unique","hash","meansqerr","arrlen","cumsum","cumprod","diff","diffs","arrLen","rank","ranks","last","lastIndexOf","maxCount","numMaxCount","mode_arr","variance","flag","deviation","dev","meandev","devSum","meddev","coeffvar","quartiles","quantiles","quantilesArray","alphap","betap","aleph","sortedArray","quantileVals","percentile","realIndex","frac","percentileOfScore","score","kind","counter","strict","histogram","binCnt","binWidth","arr1","u","arr1Len","sq_dev","spearmancoeff","arr1dev","arr2dev","stanMoment","mu","skewSum","skewness","kurtosis","fullbool","tmpthis","callbackFunction","argsToPass","curriedFunction","vector","xx","cof","ser","yi","q","fact","xden","xnum","gammap","lowRegGamma","an","aln","ap","del","h","ITMAX","factorialln","factorial","combination","combinationln","permutation","betafn","betaln","betacf","aa","fpmin","qab","qap","qam","gammapinv","pp","lna1","afac","a1","EPS","gln","erf","ty","isneg","dd","erfc","erfcinv","ibetainv","lna","lnb","al","b1","ibeta","bt","randn","randg","shape","a2","oalph","laplaceSign","callee","_a","_b","_c","newthis","sample","vals","fnfunc","df1","df2","cauchy","local","rate","invgamma","kumaraswamy","noncentralt","ncp","tol","min_iterations","flip","prob","lastvalue","std","pareto","dof2","weibull","uniform","binomarr","hypgeom","scaledPDF","samplesDone","scaledCDF","factor","sumarr","triangular","laplace","isUsable","nrescols","rescols","outer","dot","left","right","norm","nnorm","angle","aug","newarr","gauss_jordan","det","alen","alend","rowshift","colshift","mrow","mcol","gauss_elimination","maug","pivot","maxrow","y2","triaUpSolve","matrix_mode","triaLowSolve","lu","R","jj","cholesky","gauss_jacobi","xv","xk","gauss_seidel","SOR","householder","QR","get_Q1","norm_x","e1","norm_u","Q","qr","QList","Qn","lstsq","R_I","Aj","cAi","Ij","cIi","qr_solve","array_mode","attrs","Q1","R1","RI","jacobi","maxim","theta","ev","rungekutta","t_j","u_j","k1","k2","u_j1","k3","k4","romberg","h1","g","richardson","pos","y1","h_min","simpson","hermite","dF","dl","lagrange","cubic_spline","sq","gauss_quadrature","PCA","temp1","temp2","Y","Bt","Vt","differenceOfProportions","p1","n1","p2","n2","pooled","se","zscore","ztest","sides","tscore","ttest","anovafscore","expVar","sampMean","sampSampMean","tmpargs","unexpVar","anovaftest","ftest","fscore","anovaftes","change","ans","significant","pvalue","oneSidedDifferenceOfProportions","twoSidedDifferenceOfProportions","models","sub_regress","endog","exog","ols","var_count","modelList","endog_index","exog_index","nobs","df_model","df_resid","coef","predict","resid","ybar","SSE","SSR","SST","R2","t_test","model","subModelList","sigmaHat","seBetaHat","mod","tStatistic","pValue","leftppf","interval95","F_test","F_statistic","fcdf","ols_wrap","adjust_R2","rsquared","hasElement","FLATTEN","ARGS2ARRAY","REFERENCE","context","reference","path","opening","JOIN","NUMBERS","NUMERAL","CELL","TYPE","error_val","INFO","ISBLANK","ISBINARY","ISERR","ISERROR","ISEVEN","ISFORMULA","ISLOGICAL","ISNA","ISNONTEXT","ISODD","ISREF","ISTEXT","NA","SHEET","SHEETS","isValidBinaryNumber","bessel","BESSELI","besseli","BESSELJ","besselj","BESSELK","besselk","BESSELY","bessely","BIN2DEC","stringified","BIN2HEX","places","BIN2OCT","BITAND","number1","number2","BITLSHIFT","BITOR","BITRSHIFT","BITXOR","COMPLEX","real","imaginary","CONVERT","from_unit","to_unit","alt","binary_prefixes","Yi","Zi","Ei","Ti","Gi","Mi","ki","unit_prefixes","G","to","base_from_unit","base_to_unit","from_multiplier","to_multiplier","from_binary_prefix","from_unit_prefix","to_binary_prefix","to_unit_prefix","DEC2BIN","DEC2HEX","DEC2OCT","DELTA","lower_bound","upper_bound","GESTEP","HEX2BIN","negative","HEX2DEC","HEX2OCT","IMABS","inumber","IMREAL","IMAGINARY","plus","minus","unit","IMARGUMENT","IMCONJUGATE","IMCOS","IMCOSH","IMCOT","IMDIV","IMSIN","inumber1","inumber2","unit1","unit2","IMEXP","IMLN","IMLOG10","IMLOG2","IMPOWER","IMPRODUCT","IMSEC","IMSECH","IMSINH","IMSQRT","IMCSC","IMCSCH","IMSUB","IMSUM","IMTAN","OCT2BIN","OCT2DEC","OCT2HEX","_horner","_bessel_iter","f0","f1","f2","tdx","_bessel_wrap","bessel0","bessel1","nonzero","b0","b0_a1a","b0_a2a","b0_a1b","b0_a2b","W","b1_a1a","b1_a2a","b1_a1b","b1_a2b","reverse","jsum","bjp","bj","bjm","tox","b0_a","b0_b","b1_a","b1_b","bip","bi","bim","isLeapYear","year","getMonth","daysBetween","start_date","end_date","serial","addOn","WEEK_STARTS","WEEK_TYPES","WEEKEND_TYPES","DATE","month","day","DATEVALUE","date_text","DAY","serial_number","getDate","DAYS","DAYS360","method","ed","sm","em","smd","getFullYear","emd","EDATE","months","setMonth","EOMONTH","HOUR","getHours","INTERVAL","second","hour","sec","ISOWEEKNUM","setHours","setDate","getDay","yearStart","MINUTE","getMinutes","MONTH","holidays","weekend","days","total","getTimezoneOffset","getUTCDay","dec","holiday","NOW","SECOND","getSeconds","TIME","minute","TIMEVALUE","time_text","TODAY","WEEKDAY","return_type","WEEKNUM","week_start","jan","inc","YEAR","YEARFRAC","basis","sy","ey","feb29Between","date1","date2","year1","mar1year1","year2","mar1year2","ylength","years","compact","findResultIndex","database","criterias","maxCriteriaLength","currentCriteriaResult","hasMatchingCriteria","criteriaField","stats","maths","FINDFIELD","DAVERAGE","field","resultIndexes","targetFields","DCOUNT","targetValues","DCOUNTA","DGET","DMAX","maxValue","DMIN","minValue","DPRODUCT","DSTDEV","DSTDEVP","DSUM","DVAR","DVARP","AND","CHOOSE","FALSE","IF","then_value","otherwise_value","IFERROR","valueIfError","IFNA","value_if_na","NOT","logical","OR","TRUE","XOR","SWITCH","targetValue","argc","switchCount","switchSatisfied","hasDefaultClause","defaultClause","validDate","ensureDate","ACCRINT","issue","settlement","par","frequency","ACCRINTM","AMORDEGRC","AMORLINC","COUPDAYBS","COUPDAYS","COUPDAYSNC","COUPNCD","COUPNUM","COUPPCD","CUMIPMT","periods","payment","PMT","interest","FV","CUMPRINC","principal","DB","cost","salvage","life","period","ceiling","DDB","DISC","DOLLARDE","dollar","fraction","DOLLARFR","DURATION","EFFECT","term","FVSCHEDULE","schedule","future","INTRATE","IPMT","present","IRR","guess","irrResult","dates","irrResultDeriv","positive","newRate","epsRate","resultValue","resultRate","epsMax","contLoop","ISPMT","MDURATION","MIRR","finance_rate","reinvest_rate","payments","incomes","NPV","NOMINAL","NPER","ODDFPRICE","ODDFYIELD","ODDLPRICE","ODDLYIELD","PDURATION","PPMT","PRICE","PRICEDISC","PRICEMAT","PV","RATE","y0","x0","iterMax","RECEIVED","RRI","SLN","SYD","TBILLEQ","maturity","discount","TBILLPRICE","TBILLYIELD","price","VDB","XNPV","YIELD","YIELDDISC","YIELDMAT","MATCH","lookupValue","lookupArray","matchType","indexValue","_o","$V0","$V1","$V2","$V3","$V4","$V5","$V6","$V7","$V8","$V9","$Va","$Vb","$Vc","$Vd","$Ve","$Vf","$Vg","$Vh","$Vi","$Vj","$Vk","$Vl","$Vm","$Vn","$Vo","$Vp","$Vq","$Vr","$Vs","$Vt","trace","symbols_","expressions","EOF","variableSequence","STRING","&","=","+","(",")","<",">","-","*","/","^","FUNCTION","expseq","cell","ABSOLUTE_CELL","RELATIVE_CELL","MIXED_CELL",":","ARRAY",";",",","VARIABLE","NUMBER","%","#","!","$accept","$end","terminals_","5","8","9","10","11","12","13","14","15","16","17","18","19","20","21","24","25","26","27","28","29","30","31","32","33","34","35","36","productions_","performAction","anonymous","yytext","yyleng","yylineno","yystate","$$","_$","$0","$","item","table","2","3","4","6","7","23","1","22","defaultActions","parseError","recoverable","_parseError","msg","popStack","stack","vstack","lstack","recovering","TERROR","lexer","sharedState","setInput","yylloc","yyloc","ranges","preErrorSymbol","state","action","newState","lex","token","yyval","error_rule_depth","locateNearestErrorRecoveryRule","stack_probe","depth","errStr","showPosition","loc","first_line","last_line","first_column","last_column","_input","_more","_backtrack","matched","conditionStack","offset","ch","lines","unput","oldLines","more","reject","backtrack_lexer","less","pastInput","past","upcomingInput","pre","test_match","indexed_rule","backup","tempMatch","rules","_currentRules","flex","popState","conditions","topState","pushState","stateStackSize","yy_","$avoiding_name_collisions","YY_START","INITIAL","inclusive","main","webpackPolyfill","deprecate","paths","children","margin","LABEL_EXTRACT_REGEXP","_label$match","_label$match2","columnAbs","rowAbs","isAbsolute","rowLabel","columnLabel","COLUMN_LABEL_BASE_LENGTH","COLUMN_LABEL_BASE"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,gBAAZC,UAA0C,gBAAXC,QACxCA,OAAOD,QAAUD,IACQ,kBAAXG,SAAyBA,OAAOC,IAC9CD,UAAWH,GACe,gBAAZC,SACdA,QAAuB,cAAID,IAE3BD,EAAoB,cAAIC,KACvBK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3DE,GAAK,IAAoE,MAAOW,GAAOV,GAAK,EAAMC,EAAKS,EAAO,QAAU,KAAWX,GAAMI,EAAW,QAAGA,EAAW,SAAO,QAAU,GAAIH,EAAI,KAAMC,IAAQ,MAAOH,GAAQ,MAAO,UAAUF,EAAKC,GAAK,GAAIc,MAAMC,QAAQhB,GAAQ,MAAOA,EAAY,IAAIQ,OAAOC,WAAYvD,QAAO8C,GAAQ,MAAOD,GAAcC,EAAKC,EAAa,MAAM,IAAIlB,WAAU,2DAEtlBhD,GAAQ2B,aAAeA,EACvB3B,EAAQ0B,QAAUA,EAClB1B,EAAQwB,mBAAqBA,EAC7BxB,EAAQyB,mBAAqBA,EAC7BzB,EAAQsB,gBAAkBA,EAC1BtB,EAAQuB,gBAAkBA,CAC1B,IAAIq6D,GAAuB,oCAgDvBS,EAAoB,6BACpBD,EAA2BC,EAAkBv3D","file":"formula-parser.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"formulaParser\"] = factory();\n\telse\n\t\troot[\"formulaParser\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.rowLabelToIndex = exports.rowIndexToLabel = exports.columnLabelToIndex = exports.columnIndexToLabel = exports.toLabel = exports.extractLabel = exports.error = exports.Parser = exports.ERROR_VALUE = exports.ERROR_REF = exports.ERROR_NUM = exports.ERROR_NULL = exports.ERROR_NOT_AVAILABLE = exports.ERROR_NEED_UPDATE = exports.ERROR_NAME = exports.ERROR_DIV_ZERO = exports.ERROR = exports.SUPPORTED_FORMULAS = undefined;\n\t\n\tvar _parser = __webpack_require__(1);\n\t\n\tvar _error = __webpack_require__(7);\n\t\n\tvar _error2 = _interopRequireDefault(_error);\n\t\n\tvar _cell = __webpack_require__(43);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\texports.SUPPORTED_FORMULAS = _parser.SUPPORTED_FORMULAS;\n\texports.ERROR = _error.ERROR;\n\texports.ERROR_DIV_ZERO = _error.ERROR_DIV_ZERO;\n\texports.ERROR_NAME = _error.ERROR_NAME;\n\texports.ERROR_NEED_UPDATE = _error.ERROR_NEED_UPDATE;\n\texports.ERROR_NOT_AVAILABLE = _error.ERROR_NOT_AVAILABLE;\n\texports.ERROR_NULL = _error.ERROR_NULL;\n\texports.ERROR_NUM = _error.ERROR_NUM;\n\texports.ERROR_REF = _error.ERROR_REF;\n\texports.ERROR_VALUE = _error.ERROR_VALUE;\n\texports.Parser = _parser.Parser;\n\texports.error = _error2.default;\n\texports.extractLabel = _cell.extractLabel;\n\texports.toLabel = _cell.toLabel;\n\texports.columnIndexToLabel = _cell.columnIndexToLabel;\n\texports.columnLabelToIndex = _cell.columnLabelToIndex;\n\texports.rowIndexToLabel = _cell.rowIndexToLabel;\n\texports.rowLabelToIndex = _cell.rowLabelToIndex;\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.Parser = exports.SUPPORTED_FORMULAS = undefined;\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _supportedFormulas = __webpack_require__(2);\n\t\n\tObject.defineProperty(exports, 'SUPPORTED_FORMULAS', {\n\t enumerable: true,\n\t get: function get() {\n\t return _interopRequireDefault(_supportedFormulas).default;\n\t }\n\t});\n\t\n\tvar _tinyEmitter = __webpack_require__(3);\n\t\n\tvar _tinyEmitter2 = _interopRequireDefault(_tinyEmitter);\n\t\n\tvar _evaluateByOperator = __webpack_require__(4);\n\t\n\tvar _evaluateByOperator2 = _interopRequireDefault(_evaluateByOperator);\n\t\n\tvar _grammarParser = __webpack_require__(40);\n\t\n\tvar _string = __webpack_require__(42);\n\t\n\tvar _number = __webpack_require__(6);\n\t\n\tvar _error = __webpack_require__(7);\n\t\n\tvar _error2 = _interopRequireDefault(_error);\n\t\n\tvar _cell = __webpack_require__(43);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\t/**\n\t * @class Parser\n\t */\n\tvar Parser = function (_Emitter) {\n\t _inherits(Parser, _Emitter);\n\t\n\t function Parser() {\n\t _classCallCheck(this, Parser);\n\t\n\t var _this = _possibleConstructorReturn(this, (Parser.__proto__ || Object.getPrototypeOf(Parser)).call(this));\n\t\n\t _this.parser = new _grammarParser.Parser();\n\t _this.parser.yy = {\n\t toNumber: _number.toNumber,\n\t trimEdges: _string.trimEdges,\n\t invertNumber: _number.invertNumber,\n\t throwError: function throwError(errorName) {\n\t return _this._throwError(errorName);\n\t },\n\t callVariable: function callVariable(variable) {\n\t return _this._callVariable(variable);\n\t },\n\t evaluateByOperator: _evaluateByOperator2.default,\n\t callFunction: _evaluateByOperator2.default,\n\t cellValue: function cellValue(value) {\n\t return _this._callCellValue(value);\n\t },\n\t rangeValue: function rangeValue(start, end) {\n\t return _this._callRangeValue(start, end);\n\t }\n\t };\n\t _this.variables = Object.create(null);\n\t\n\t _this.setVariable('TRUE', true).setVariable('FALSE', false).setVariable('NULL', null);\n\t return _this;\n\t }\n\t\n\t /**\n\t * Parse formula expression.\n\t *\n\t * @param {String} expression to parse.\n\t * @return {*} Returns an object with tow properties `error` and `result`.\n\t */\n\t\n\t\n\t _createClass(Parser, [{\n\t key: 'parse',\n\t value: function parse(expression) {\n\t var result = null;\n\t var error = null;\n\t\n\t try {\n\t result = this.parser.parse(expression);\n\t } catch (ex) {\n\t var message = (0, _error2.default)(ex.message);\n\t\n\t if (message) {\n\t error = message;\n\t } else {\n\t error = (0, _error2.default)(_error.ERROR);\n\t }\n\t }\n\t\n\t if (result instanceof Error) {\n\t error = (0, _error2.default)(result.message) || (0, _error2.default)(_error.ERROR);\n\t result = null;\n\t }\n\t\n\t return {\n\t error: error,\n\t result: result\n\t };\n\t }\n\t\n\t /**\n\t * Set predefined variable name which can be visible while parsing formula expression.\n\t *\n\t * @param {String} name Variable name.\n\t * @param {*} value Variable value.\n\t * @returns {Parser}\n\t */\n\t\n\t }, {\n\t key: 'setVariable',\n\t value: function setVariable(name, value) {\n\t this.variables[name] = value;\n\t\n\t return this;\n\t }\n\t\n\t /**\n\t * Get variable name.\n\t *\n\t * @param {String} name Variable name.\n\t * @returns {*}\n\t */\n\t\n\t }, {\n\t key: 'getVariable',\n\t value: function getVariable(name) {\n\t return this.variables[name];\n\t }\n\t\n\t /**\n\t * Retrieve variable value by its name.\n\t *\n\t * @param name Variable name.\n\t * @returns {*}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_callVariable',\n\t value: function _callVariable(name) {\n\t var value = this.getVariable(name);\n\t\n\t this.emit('callVariable', name, function (newValue) {\n\t if (newValue !== void 0) {\n\t value = newValue;\n\t }\n\t });\n\t\n\t if (value === void 0) {\n\t throw Error(_error.ERROR_NAME);\n\t }\n\t\n\t return value;\n\t }\n\t\n\t /**\n\t * Retrieve value by its label (`B3`, `B$3`, `B$3`, `$B$3`).\n\t *\n\t * @param {String} label Coordinates.\n\t * @returns {*}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_callCellValue',\n\t value: function _callCellValue(label) {\n\t var _extractLabel = (0, _cell.extractLabel)(label);\n\t\n\t var _extractLabel2 = _slicedToArray(_extractLabel, 2);\n\t\n\t var row = _extractLabel2[0];\n\t var column = _extractLabel2[1];\n\t\n\t var value = void 0;\n\t\n\t this.emit('callCellValue', { label: label, row: row, column: column }, function (_value) {\n\t value = _value;\n\t });\n\t\n\t return value;\n\t }\n\t\n\t /**\n\t * Retrieve value by its label (`B3:A1`, `B$3:A1`, `B$3:$A1`, `$B$3:A$1`).\n\t *\n\t * @param {String} startLabel Coordinates of the first cell.\n\t * @param {String} endLabel Coordinates of the last cell.\n\t * @returns {Array} Returns an array of mixed values.\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_callRangeValue',\n\t value: function _callRangeValue(startLabel, endLabel) {\n\t var _extractLabel3 = (0, _cell.extractLabel)(startLabel);\n\t\n\t var _extractLabel4 = _slicedToArray(_extractLabel3, 2);\n\t\n\t var startRow = _extractLabel4[0];\n\t var startColumn = _extractLabel4[1];\n\t\n\t var _extractLabel5 = (0, _cell.extractLabel)(endLabel);\n\t\n\t var _extractLabel6 = _slicedToArray(_extractLabel5, 2);\n\t\n\t var endRow = _extractLabel6[0];\n\t var endColumn = _extractLabel6[1];\n\t\n\t var startCell = {};\n\t var endCell = {};\n\t\n\t if (startRow.index <= endRow.index) {\n\t startCell.row = startRow;\n\t endCell.row = endRow;\n\t } else {\n\t startCell.row = endRow;\n\t endCell.row = startRow;\n\t }\n\t\n\t if (startColumn.index <= endColumn.index) {\n\t startCell.column = startColumn;\n\t endCell.column = endColumn;\n\t } else {\n\t startCell.column = endColumn;\n\t endCell.column = startColumn;\n\t }\n\t\n\t startCell.label = (0, _cell.toLabel)(startCell.row, startCell.column);\n\t endCell.label = (0, _cell.toLabel)(endCell.row, endCell.column);\n\t\n\t var value = [];\n\t\n\t this.emit('callRangeValue', startCell, endCell, function () {\n\t var _value = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];\n\t\n\t value = _value;\n\t });\n\t\n\t return value;\n\t }\n\t\n\t /**\n\t * Try to throw error by its name.\n\t *\n\t * @param {String} errorName Error name.\n\t * @returns {String}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_throwError',\n\t value: function _throwError(errorName) {\n\t var parsedError = (0, _error2.default)(errorName);\n\t\n\t if (parsedError) {\n\t throw Error(parsedError);\n\t }\n\t\n\t return errorName;\n\t }\n\t }]);\n\t\n\t return Parser;\n\t}(_tinyEmitter2.default);\n\t\n\texports.Parser = Parser;\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar SUPPORTED_FORMULAS = ['ABS', 'ACCRINT', 'ACOS', 'ACOSH', 'ACOT', 'ACOTH', 'ADD', 'AGGREGATE', 'AND', 'ARABIC', 'ARGS2ARRAY', 'ASIN', 'ASINH', 'ATAN', 'ATAN2', 'ATANH', 'AVEDEV', 'AVERAGE', 'AVERAGEA', 'AVERAGEIF', 'AVERAGEIFS', 'BASE', 'BESSELI', 'BESSELJ', 'BESSELK', 'BESSELY', 'BETA.DIST', 'BETA.INV', 'BETADIST', 'BETAINV', 'BIN2DEC', 'BIN2HEX', 'BIN2OCT', 'BINOM.DIST', 'BINOM.DIST.RANGE', 'BINOM.INV', 'BINOMDIST', 'BITAND', 'BITLSHIFT', 'BITOR', 'BITRSHIFT', 'BITXOR', 'CEILING', 'CEILINGMATH', 'CEILINGPRECISE', 'CHAR', 'CHISQ.DIST', 'CHISQ.DIST.RT', 'CHISQ.INV', 'CHISQ.INV.RT', 'CHOOSE', 'CHOOSE', 'CLEAN', 'CODE', 'COLUMN', 'COLUMNS', 'COMBIN', 'COMBINA', 'COMPLEX', 'CONCATENATE', 'CONFIDENCE', 'CONFIDENCE.NORM', 'CONFIDENCE.T', 'CONVERT', 'CORREL', 'COS', 'COSH', 'COT', 'COTH', 'COUNT', 'COUNTA', 'COUNTBLANK', 'COUNTIF', 'COUNTIFS', 'COUNTIN', 'COUNTUNIQUE', 'COVARIANCE.P', 'COVARIANCE.S', 'CSC', 'CSCH', 'CUMIPMT', 'CUMPRINC', 'DATE', 'DATEVALUE', 'DAY', 'DAYS', 'DAYS360', 'DB', 'DDB', 'DEC2BIN', 'DEC2HEX', 'DEC2OCT', 'DECIMAL', 'DEGREES', 'DELTA', 'DEVSQ', 'DIVIDE', 'DOLLAR', 'DOLLARDE', 'DOLLARFR', 'E', 'EDATE', 'EFFECT', 'EOMONTH', 'EQ', 'ERF', 'ERFC', 'EVEN', 'EXACT', 'EXPON.DIST', 'EXPONDIST', 'F.DIST', 'F.DIST.RT', 'F.INV', 'F.INV.RT', 'FACT', 'FACTDOUBLE', 'FALSE', 'FDIST', 'FDISTRT', 'FIND', 'FINV', 'FINVRT', 'FISHER', 'FISHERINV', 'FIXED', 'FLATTEN', 'FLOOR', 'FORECAST', 'FREQUENCY', 'FV', 'FVSCHEDULE', 'GAMMA', 'GAMMA.DIST', 'GAMMA.INV', 'GAMMADIST', 'GAMMAINV', 'GAMMALN', 'GAMMALN.PRECISE', 'GAUSS', 'GCD', 'GEOMEAN', 'GESTEP', 'GROWTH', 'GTE', 'HARMEAN', 'HEX2BIN', 'HEX2DEC', 'HEX2OCT', 'HOUR', 'HTML2TEXT', 'HYPGEOM.DIST', 'HYPGEOMDIST', 'IF', 'IMABS', 'IMAGINARY', 'IMARGUMENT', 'IMCONJUGATE', 'IMCOS', 'IMCOSH', 'IMCOT', 'IMCSC', 'IMCSCH', 'IMDIV', 'IMEXP', 'IMLN', 'IMLOG10', 'IMLOG2', 'IMPOWER', 'IMPRODUCT', 'IMREAL', 'IMSEC', 'IMSECH', 'IMSIN', 'IMSINH', 'IMSQRT', 'IMSUB', 'IMSUM', 'IMTAN', 'INT', 'INTERCEPT', 'INTERVAL', 'IPMT', 'IRR', 'ISBINARY', 'ISBLANK', 'ISEVEN', 'ISLOGICAL', 'ISNONTEXT', 'ISNUMBER', 'ISODD', 'ISODD', 'ISOWEEKNUM', 'ISPMT', 'ISTEXT', 'JOIN', 'KURT', 'LARGE', 'LCM', 'LEFT', 'LEN', 'LINEST', 'LN', 'LOG', 'LOG10', 'LOGEST', 'LOGNORM.DIST', 'LOGNORM.INV', 'LOGNORMDIST', 'LOGNORMINV', 'LOWER', 'LT', 'LTE', 'MATCH', 'MAX', 'MAXA', 'MEDIAN', 'MID', 'MIN', 'MINA', 'MINUS', 'MINUTE', 'MIRR', 'MOD', 'MODE.MULT', 'MODE.SNGL', 'MODEMULT', 'MODESNGL', 'MONTH', 'MROUND', 'MULTINOMIAL', 'MULTIPLY', 'NE', 'NEGBINOM.DIST', 'NEGBINOMDIST', 'NETWORKDAYS', 'NOMINAL', 'NORM.DIST', 'NORM.INV', 'NORM.S.DIST', 'NORM.S.INV', 'NORMDIST', 'NORMINV', 'NORMSDIST', 'NORMSINV', 'NOT', 'NOW', 'NPER', 'NPV', 'NUMBERS', 'NUMERAL', 'OCT2BIN', 'OCT2DEC', 'OCT2HEX', 'ODD', 'OR', 'PDURATION', 'PEARSON', 'PERCENTILEEXC', 'PERCENTILEINC', 'PERCENTRANKEXC', 'PERCENTRANKINC', 'PERMUT', 'PERMUTATIONA', 'PHI', 'PI', 'PMT', 'POISSON.DIST', 'POISSONDIST', 'POW', 'POWER', 'PPMT', 'PROB', 'PRODUCT', 'PROPER', 'PV', 'QUARTILE.EXC', 'QUARTILE.INC', 'QUARTILEEXC', 'QUARTILEINC', 'QUOTIENT', 'RADIANS', 'RAND', 'RANDBETWEEN', 'RANK.AVG', 'RANK.EQ', 'RANKAVG', 'RANKEQ', 'RATE', 'REFERENCE', 'REGEXEXTRACT', 'REGEXMATCH', 'REGEXREPLACE', 'REPLACE', 'REPT', 'RIGHT', 'ROMAN', 'ROUND', 'ROUNDDOWN', 'ROUNDUP', 'ROW', 'ROWS', 'RRI', 'RSQ', 'SEARCH', 'SEC', 'SECH', 'SECOND', 'SERIESSUM', 'SIGN', 'SIN', 'SINH', 'SKEW', 'SKEW.P', 'SKEWP', 'SLN', 'SLOPE', 'SMALL', 'SPLIT', 'SPLIT', 'SQRT', 'SQRTPI', 'STANDARDIZE', 'STDEV.P', 'STDEV.S', 'STDEVA', 'STDEVP', 'STDEVPA', 'STDEVS', 'STEYX', 'SUBSTITUTE', 'SUBTOTAL', 'SUM', 'SUMIF', 'SUMIFS', 'SUMPRODUCT', 'SUMSQ', 'SUMX2MY2', 'SUMX2PY2', 'SUMXMY2', 'SWITCH', 'SYD', 'T', 'T.DIST', 'T.DIST.2T', 'T.DIST.RT', 'T.INV', 'T.INV.2T', 'TAN', 'TANH', 'TBILLEQ', 'TBILLPRICE', 'TBILLYIELD', 'TDIST', 'TDIST2T', 'TDISTRT', 'TEXT', 'TIME', 'TIMEVALUE', 'TINV', 'TINV2T', 'TODAY', 'TRANSPOSE', 'TREND', 'TRIM', 'TRIMMEAN', 'TRUE', 'TRUNC', 'UNICHAR', 'UNICODE', 'UNIQUE', 'UPPER', 'VALUE', 'VAR.P', 'VAR.S', 'VARA', 'VARP', 'VARPA', 'VARS', 'WEEKDAY', 'WEEKNUM', 'WEIBULL.DIST', 'WEIBULLDIST', 'WORKDAY', 'XIRR', 'XNPV', 'XOR', 'YEAR', 'YEARFRAC'];\n\t\n\texports.default = SUPPORTED_FORMULAS;\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tfunction E () {\n\t // Keep this empty so it's easier to inherit from\n\t // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n\t}\n\t\n\tE.prototype = {\n\t on: function (name, callback, ctx) {\n\t var e = this.e || (this.e = {});\n\t\n\t (e[name] || (e[name] = [])).push({\n\t fn: callback,\n\t ctx: ctx\n\t });\n\t\n\t return this;\n\t },\n\t\n\t once: function (name, callback, ctx) {\n\t var self = this;\n\t function listener () {\n\t self.off(name, listener);\n\t callback.apply(ctx, arguments);\n\t };\n\t\n\t listener._ = callback\n\t return this.on(name, listener, ctx);\n\t },\n\t\n\t emit: function (name) {\n\t var data = [].slice.call(arguments, 1);\n\t var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n\t var i = 0;\n\t var len = evtArr.length;\n\t\n\t for (i; i < len; i++) {\n\t evtArr[i].fn.apply(evtArr[i].ctx, data);\n\t }\n\t\n\t return this;\n\t },\n\t\n\t off: function (name, callback) {\n\t var e = this.e || (this.e = {});\n\t var evts = e[name];\n\t var liveEvents = [];\n\t\n\t if (evts && callback) {\n\t for (var i = 0, len = evts.length; i < len; i++) {\n\t if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n\t liveEvents.push(evts[i]);\n\t }\n\t }\n\t\n\t // Remove event from queue to prevent memory leak\n\t // Suggested by https://github.com/lazd\n\t // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\t\n\t (liveEvents.length)\n\t ? e[name] = liveEvents\n\t : delete e[name];\n\t\n\t return this;\n\t }\n\t};\n\t\n\tmodule.exports = E;\n\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = evaluateByOperator;\n\texports.registerOperation = registerOperation;\n\t\n\tvar _add = __webpack_require__(5);\n\t\n\tvar _add2 = _interopRequireDefault(_add);\n\t\n\tvar _ampersand = __webpack_require__(8);\n\t\n\tvar _ampersand2 = _interopRequireDefault(_ampersand);\n\t\n\tvar _divide = __webpack_require__(9);\n\t\n\tvar _divide2 = _interopRequireDefault(_divide);\n\t\n\tvar _equal = __webpack_require__(10);\n\t\n\tvar _equal2 = _interopRequireDefault(_equal);\n\t\n\tvar _formulaFunction = __webpack_require__(11);\n\t\n\tvar _formulaFunction2 = _interopRequireDefault(_formulaFunction);\n\t\n\tvar _greaterThan = __webpack_require__(32);\n\t\n\tvar _greaterThan2 = _interopRequireDefault(_greaterThan);\n\t\n\tvar _greaterThanOrEqual = __webpack_require__(33);\n\t\n\tvar _greaterThanOrEqual2 = _interopRequireDefault(_greaterThanOrEqual);\n\t\n\tvar _lessThan = __webpack_require__(34);\n\t\n\tvar _lessThan2 = _interopRequireDefault(_lessThan);\n\t\n\tvar _lessThanOrEqual = __webpack_require__(35);\n\t\n\tvar _lessThanOrEqual2 = _interopRequireDefault(_lessThanOrEqual);\n\t\n\tvar _minus = __webpack_require__(36);\n\t\n\tvar _minus2 = _interopRequireDefault(_minus);\n\t\n\tvar _multiply = __webpack_require__(37);\n\t\n\tvar _multiply2 = _interopRequireDefault(_multiply);\n\t\n\tvar _notEqual = __webpack_require__(38);\n\t\n\tvar _notEqual2 = _interopRequireDefault(_notEqual);\n\t\n\tvar _power = __webpack_require__(39);\n\t\n\tvar _power2 = _interopRequireDefault(_power);\n\t\n\tvar _error = __webpack_require__(7);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\t\n\tvar availableOperators = Object.create(null);\n\t\n\tregisterOperation(_add2.default.SYMBOL, _add2.default);\n\tregisterOperation(_ampersand2.default.SYMBOL, _ampersand2.default);\n\tregisterOperation(_divide2.default.SYMBOL, _divide2.default);\n\tregisterOperation(_equal2.default.SYMBOL, _equal2.default);\n\tregisterOperation(_power2.default.SYMBOL, _power2.default);\n\tregisterOperation(_formulaFunction2.default.SYMBOL, _formulaFunction2.default);\n\tregisterOperation(_greaterThan2.default.SYMBOL, _greaterThan2.default);\n\tregisterOperation(_greaterThanOrEqual2.default.SYMBOL, _greaterThanOrEqual2.default);\n\tregisterOperation(_lessThan2.default.SYMBOL, _lessThan2.default);\n\tregisterOperation(_lessThanOrEqual2.default.SYMBOL, _lessThanOrEqual2.default);\n\tregisterOperation(_multiply2.default.SYMBOL, _multiply2.default);\n\tregisterOperation(_notEqual2.default.SYMBOL, _notEqual2.default);\n\tregisterOperation(_minus2.default.SYMBOL, _minus2.default);\n\t\n\t/**\n\t * Evaluate values by operator id.git\n\t *\n\t * @param {String} operator Operator id.\n\t * @param {Array} [params=[]] Arguments to evaluate.\n\t * @returns {*}\n\t */\n\tfunction evaluateByOperator(operator) {\n\t var params = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];\n\t\n\t operator = operator.toUpperCase();\n\t\n\t if (!availableOperators[operator]) {\n\t throw Error(_error.ERROR_NAME);\n\t }\n\t\n\t return availableOperators[operator].apply(availableOperators, _toConsumableArray(params));\n\t}\n\t\n\t/**\n\t * Register operator.\n\t *\n\t * @param {String|Array} symbol Symbol to register.\n\t * @param {Function} func Logic to register for this symbol.\n\t */\n\tfunction registerOperation(symbol, func) {\n\t if (!Array.isArray(symbol)) {\n\t symbol = [symbol.toUpperCase()];\n\t }\n\t symbol.forEach(function (s) {\n\t if (func.isFactory) {\n\t availableOperators[s] = func(s);\n\t } else {\n\t availableOperators[s] = func;\n\t }\n\t });\n\t}\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.SYMBOL = undefined;\n\texports.default = func;\n\t\n\tvar _number = __webpack_require__(6);\n\t\n\tvar _error = __webpack_require__(7);\n\t\n\tvar SYMBOL = exports.SYMBOL = '+';\n\t\n\tfunction func(first) {\n\t for (var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t rest[_key - 1] = arguments[_key];\n\t }\n\t\n\t var result = rest.reduce(function (acc, value) {\n\t return acc + (0, _number.toNumber)(value);\n\t }, (0, _number.toNumber)(first));\n\t\n\t if (isNaN(result)) {\n\t throw Error(_error.ERROR_VALUE);\n\t }\n\t\n\t return result;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.toNumber = toNumber;\n\texports.invertNumber = invertNumber;\n\t/**\n\t * Convert value into number.\n\t *\n\t * @param {String|Number} number\n\t * @returns {*}\n\t */\n\tfunction toNumber(number) {\n\t var result = void 0;\n\t\n\t if (typeof number === 'number') {\n\t result = number;\n\t } else if (typeof number === 'string') {\n\t result = number.indexOf('.') > -1 ? parseFloat(number) : parseInt(number, 10);\n\t }\n\t\n\t return result;\n\t}\n\t\n\t/**\n\t * Invert provided number.\n\t *\n\t * @param {Number} number\n\t * @returns {Number} Returns inverted number.\n\t */\n\tfunction invertNumber(number) {\n\t return -1 * toNumber(number);\n\t}\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _errors;\n\t\n\texports.default = error;\n\t\n\tfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\t\n\tvar ERROR = exports.ERROR = 'ERROR';\n\tvar ERROR_DIV_ZERO = exports.ERROR_DIV_ZERO = 'DIV/0';\n\tvar ERROR_NAME = exports.ERROR_NAME = 'NAME';\n\tvar ERROR_NEED_UPDATE = exports.ERROR_NEED_UPDATE = 'NEED_UPDATE';\n\tvar ERROR_NOT_AVAILABLE = exports.ERROR_NOT_AVAILABLE = 'N/A';\n\tvar ERROR_NULL = exports.ERROR_NULL = 'NULL';\n\tvar ERROR_NUM = exports.ERROR_NUM = 'NUM';\n\tvar ERROR_REF = exports.ERROR_REF = 'REF';\n\tvar ERROR_VALUE = exports.ERROR_VALUE = 'VALUE';\n\t\n\tvar errors = (_errors = {}, _defineProperty(_errors, ERROR, '#ERROR!'), _defineProperty(_errors, ERROR_DIV_ZERO, '#DIV/0!'), _defineProperty(_errors, ERROR_NAME, '#NAME?'), _defineProperty(_errors, ERROR_NEED_UPDATE, '#NEED_UPDATE!'), _defineProperty(_errors, ERROR_NOT_AVAILABLE, '#N/A'), _defineProperty(_errors, ERROR_NULL, '#NULL!'), _defineProperty(_errors, ERROR_NUM, '#NUM!'), _defineProperty(_errors, ERROR_REF, '#REF!'), _defineProperty(_errors, ERROR_VALUE, '#VALUE!'), _errors);\n\t\n\t/**\n\t * Return error type based on provided error id.\n\t *\n\t * @param {String} type Error type.\n\t * @returns {String|null} Returns error id.\n\t */\n\tfunction error(type) {\n\t var error = void 0;\n\t\n\t type = (type + '').replace(/#|!|\\?/g, '');\n\t\n\t if (errors[type]) {\n\t error = errors[type];\n\t }\n\t\n\t return error ? error : null;\n\t}\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = func;\n\tvar SYMBOL = exports.SYMBOL = '&';\n\t\n\tfunction func() {\n\t for (var _len = arguments.length, params = Array(_len), _key = 0; _key < _len; _key++) {\n\t params[_key] = arguments[_key];\n\t }\n\t\n\t return params.reduce(function (acc, value) {\n\t return acc + value.toString();\n\t }, '');\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.SYMBOL = undefined;\n\texports.default = func;\n\t\n\tvar _number = __webpack_require__(6);\n\t\n\tvar _error = __webpack_require__(7);\n\t\n\tvar SYMBOL = exports.SYMBOL = '/';\n\t\n\tfunction func(first) {\n\t for (var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t rest[_key - 1] = arguments[_key];\n\t }\n\t\n\t var result = rest.reduce(function (acc, value) {\n\t return acc / (0, _number.toNumber)(value);\n\t }, (0, _number.toNumber)(first));\n\t\n\t if (result === Infinity) {\n\t throw Error(_error.ERROR_DIV_ZERO);\n\t }\n\t if (isNaN(result)) {\n\t throw Error(_error.ERROR_VALUE);\n\t }\n\t\n\t return result;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 10 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = func;\n\tvar SYMBOL = exports.SYMBOL = '=';\n\t\n\tfunction func(exp1, exp2) {\n\t return exp1 === exp2;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.SYMBOL = undefined;\n\texports.default = func;\n\t\n\tvar _supportedFormulas = __webpack_require__(2);\n\t\n\tvar _supportedFormulas2 = _interopRequireDefault(_supportedFormulas);\n\t\n\tvar _error = __webpack_require__(7);\n\t\n\tvar _formulajs = __webpack_require__(12);\n\t\n\tvar formulajs = _interopRequireWildcard(_formulajs);\n\t\n\tfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar SYMBOL = exports.SYMBOL = _supportedFormulas2.default;\n\t\n\tfunction func(symbol) {\n\t return function () {\n\t symbol = symbol.toUpperCase();\n\t\n\t var symbolParts = symbol.split('.');\n\t var foundFormula = false;\n\t var result = void 0;\n\t\n\t if (symbolParts.length === 1) {\n\t if (formulajs[symbolParts[0]]) {\n\t foundFormula = true;\n\t result = formulajs[symbolParts[0]].apply(formulajs, arguments);\n\t }\n\t } else {\n\t var length = symbolParts.length;\n\t var index = 0;\n\t var nestedFormula = formulajs;\n\t\n\t while (index < length) {\n\t nestedFormula = nestedFormula[symbolParts[index]];\n\t index++;\n\t\n\t if (!nestedFormula) {\n\t nestedFormula = null;\n\t break;\n\t }\n\t }\n\t if (nestedFormula) {\n\t foundFormula = true;\n\t result = nestedFormula.apply(undefined, arguments);\n\t }\n\t }\n\t\n\t if (!foundFormula) {\n\t throw Error(_error.ERROR_NAME);\n\t }\n\t\n\t return result;\n\t };\n\t};\n\t\n\tfunc.isFactory = true;\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 12 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar categories = [\n\t __webpack_require__(13),\n\t __webpack_require__(28),\n\t __webpack_require__(25),\n\t __webpack_require__(29),\n\t __webpack_require__(14),\n\t __webpack_require__(18),\n\t __webpack_require__(27),\n\t __webpack_require__(30),\n\t __webpack_require__(24),\n\t __webpack_require__(31),\n\t __webpack_require__(17),\n\t __webpack_require__(23)\n\t];\n\t\n\tfor (var c in categories) {\n\t var category = categories[c];\n\t for (var f in category) {\n\t exports[f] = exports[f] || category[f];\n\t }\n\t}\n\n\n/***/ },\n/* 13 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar mathTrig = __webpack_require__(14);\n\tvar statistical = __webpack_require__(17);\n\tvar engineering = __webpack_require__(25);\n\tvar dateTime = __webpack_require__(27);\n\t\n\tfunction set(fn, root) {\n\t if (root) {\n\t for (var i in root) {\n\t fn[i] = root[i];\n\t }\n\t }\n\t\n\t return fn;\n\t}\n\t\n\texports.BETADIST = statistical.BETA.DIST;\n\texports.BETAINV = statistical.BETA.INV;\n\texports.BINOMDIST = statistical.BINOM.DIST;\n\texports.CEILING = exports.ISOCEILING = set(mathTrig.CEILING.MATH, mathTrig.CEILING);\n\texports.CEILINGMATH = mathTrig.CEILING.MATH;\n\texports.CEILINGPRECISE = mathTrig.CEILING.PRECISE;\n\texports.CHIDIST = statistical.CHISQ.DIST;\n\texports.CHIDISTRT = statistical.CHISQ.DIST.RT;\n\texports.CHIINV = statistical.CHISQ.INV;\n\texports.CHIINVRT = statistical.CHISQ.INV.RT;\n\texports.CHITEST = statistical.CHISQ.TEST;\n\texports.CONFIDENCE = set(statistical.CONFIDENCE.NORM, statistical.CONFIDENCE);\n\texports.COVAR = statistical.COVARIANCE.P;\n\texports.COVARIANCEP = statistical.COVARIANCE.P;\n\texports.COVARIANCES = statistical.COVARIANCE.S;\n\texports.CRITBINOM = statistical.BINOM.INV;\n\texports.EXPONDIST = statistical.EXPON.DIST;\n\texports.ERFCPRECISE = engineering.ERFC.PRECISE;\n\texports.ERFPRECISE = engineering.ERF.PRECISE;\n\texports.FDIST = statistical.F.DIST;\n\texports.FDISTRT = statistical.F.DIST.RT;\n\texports.FINVRT = statistical.F.INV.RT;\n\texports.FINV = statistical.F.INV;\n\texports.FLOOR = set(mathTrig.FLOOR.MATH, mathTrig.FLOOR);\n\texports.FLOORMATH = mathTrig.FLOOR.MATH;\n\texports.FLOORPRECISE = mathTrig.FLOOR.PRECISE;\n\texports.FTEST = statistical.F.TEST;\n\texports.GAMMADIST = statistical.GAMMA.DIST;\n\texports.GAMMAINV = statistical.GAMMA.INV;\n\texports.GAMMALNPRECISE = statistical.GAMMALN.PRECISE;\n\texports.HYPGEOMDIST = statistical.HYPGEOM.DIST;\n\texports.LOGINV = statistical.LOGNORM.INV;\n\texports.LOGNORMINV = statistical.LOGNORM.INV;\n\texports.LOGNORMDIST = statistical.LOGNORM.DIST;\n\texports.MODE = set(statistical.MODE.SNGL, statistical.MODE);\n\texports.MODEMULT = statistical.MODE.MULT;\n\texports.MODESNGL = statistical.MODE.SNGL;\n\texports.NEGBINOMDIST = statistical.NEGBINOM.DIST;\n\texports.NETWORKDAYSINTL = dateTime.NETWORKDAYS.INTL;\n\texports.NORMDIST = statistical.NORM.DIST;\n\texports.NORMINV = statistical.NORM.INV;\n\texports.NORMSDIST = statistical.NORM.S.DIST;\n\texports.NORMSINV = statistical.NORM.S.INV;\n\texports.PERCENTILE = set(statistical.PERCENTILE.EXC, statistical.PERCENTILE);\n\texports.PERCENTILEEXC = statistical.PERCENTILE.EXC;\n\texports.PERCENTILEINC = statistical.PERCENTILE.INC;\n\texports.PERCENTRANK = set(statistical.PERCENTRANK.INC, statistical.PERCENTRANK);\n\texports.PERCENTRANKEXC = statistical.PERCENTRANK.EXC;\n\texports.PERCENTRANKINC = statistical.PERCENTRANK.INC;\n\texports.POISSON = set(statistical.POISSON.DIST, statistical.POISSON);\n\texports.POISSONDIST = statistical.POISSON.DIST;\n\texports.QUARTILE = set(statistical.QUARTILE.INC, statistical.QUARTILE);\n\texports.QUARTILEEXC = statistical.QUARTILE.EXC;\n\texports.QUARTILEINC = statistical.QUARTILE.INC;\n\texports.RANK = set(statistical.RANK.EQ, statistical.RANK);\n\texports.RANKAVG = statistical.RANK.AVG;\n\texports.RANKEQ = statistical.RANK.EQ;\n\texports.SKEWP = statistical.SKEW.P;\n\texports.STDEV = set(statistical.STDEV.S, statistical.STDEV);\n\texports.STDEVP = statistical.STDEV.P;\n\texports.STDEVS = statistical.STDEV.S;\n\texports.TDIST = statistical.T.DIST;\n\texports.TDISTRT = statistical.T.DIST.RT;\n\texports.TINV = statistical.T.INV;\n\texports.TTEST = statistical.T.TEST;\n\texports.VAR = set(statistical.VAR.S, statistical.VAR);\n\texports.VARP = statistical.VAR.P;\n\texports.VARS = statistical.VAR.S;\n\texports.WEIBULL = set(statistical.WEIBULL.DIST, statistical.WEIBULL);\n\texports.WEIBULLDIST = statistical.WEIBULL.DIST;\n\texports.WORKDAYINTL = dateTime.WORKDAY.INTL;\n\texports.ZTEST = statistical.Z.TEST;\n\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar utils = __webpack_require__(15);\n\tvar error = __webpack_require__(16);\n\tvar statistical = __webpack_require__(17);\n\tvar information = __webpack_require__(24);\n\t\n\texports.ABS = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var result = Math.abs(number);\n\t\n\t return result;\n\t};\n\t\n\texports.ACOS = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var result = Math.acos(number);\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.ACOSH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var result = Math.log(number + Math.sqrt(number * number - 1));\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.ACOT = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var result = Math.atan(1 / number);\n\t\n\t return result;\n\t};\n\t\n\texports.ACOTH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var result = 0.5 * Math.log((number + 1) / (number - 1));\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\t//TODO: use options\n\texports.AGGREGATE = function(function_num, options, ref1, ref2) {\n\t function_num = utils.parseNumber(function_num);\n\t options = utils.parseNumber(function_num);\n\t if (utils.anyIsError(function_num, options)) {\n\t return error.value;\n\t }\n\t switch (function_num) {\n\t case 1:\n\t return statistical.AVERAGE(ref1);\n\t case 2:\n\t return statistical.COUNT(ref1);\n\t case 3:\n\t return statistical.COUNTA(ref1);\n\t case 4:\n\t return statistical.MAX(ref1);\n\t case 5:\n\t return statistical.MIN(ref1);\n\t case 6:\n\t return exports.PRODUCT(ref1);\n\t case 7:\n\t return statistical.STDEV.S(ref1);\n\t case 8:\n\t return statistical.STDEV.P(ref1);\n\t case 9:\n\t return exports.SUM(ref1);\n\t case 10:\n\t return statistical.VAR.S(ref1);\n\t case 11:\n\t return statistical.VAR.P(ref1);\n\t case 12:\n\t return statistical.MEDIAN(ref1);\n\t case 13:\n\t return statistical.MODE.SNGL(ref1);\n\t case 14:\n\t return statistical.LARGE(ref1, ref2);\n\t case 15:\n\t return statistical.SMALL(ref1, ref2);\n\t case 16:\n\t return statistical.PERCENTILE.INC(ref1, ref2);\n\t case 17:\n\t return statistical.QUARTILE.INC(ref1, ref2);\n\t case 18:\n\t return statistical.PERCENTILE.EXC(ref1, ref2);\n\t case 19:\n\t return statistical.QUARTILE.EXC(ref1, ref2);\n\t }\n\t};\n\t\n\texports.ARABIC = function(text) {\n\t // Credits: Rafa? Kukawski\n\t if (!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(text)) {\n\t return error.value;\n\t }\n\t var r = 0;\n\t text.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g, function(i) {\n\t r += {\n\t M: 1000,\n\t CM: 900,\n\t D: 500,\n\t CD: 400,\n\t C: 100,\n\t XC: 90,\n\t L: 50,\n\t XL: 40,\n\t X: 10,\n\t IX: 9,\n\t V: 5,\n\t IV: 4,\n\t I: 1\n\t }[i];\n\t });\n\t return r;\n\t};\n\t\n\texports.ASIN = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var result = Math.asin(number);\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.ASINH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return Math.log(number + Math.sqrt(number * number + 1));\n\t};\n\t\n\texports.ATAN = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return Math.atan(number);\n\t};\n\t\n\texports.ATAN2 = function(number_x, number_y) {\n\t number_x = utils.parseNumber(number_x);\n\t number_y = utils.parseNumber(number_y);\n\t if (utils.anyIsError(number_x, number_y)) {\n\t return error.value;\n\t }\n\t return Math.atan2(number_x, number_y);\n\t};\n\t\n\texports.ATANH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var result = Math.log((1 + number) / (1 - number)) / 2;\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.BASE = function(number, radix, min_length) {\n\t min_length = min_length || 0;\n\t\n\t number = utils.parseNumber(number);\n\t radix = utils.parseNumber(radix);\n\t min_length = utils.parseNumber(min_length);\n\t if (utils.anyIsError(number, radix, min_length)) {\n\t return error.value;\n\t }\n\t min_length = (min_length === undefined) ? 0 : min_length;\n\t var result = number.toString(radix);\n\t return new Array(Math.max(min_length + 1 - result.length, 0)).join('0') + result;\n\t};\n\t\n\texports.CEILING = function(number, significance, mode) {\n\t significance = (significance === undefined) ? 1 : Math.abs(significance);\n\t mode = mode || 0;\n\t\n\t number = utils.parseNumber(number);\n\t significance = utils.parseNumber(significance);\n\t mode = utils.parseNumber(mode);\n\t if (utils.anyIsError(number, significance, mode)) {\n\t return error.value;\n\t }\n\t if (significance === 0) {\n\t return 0;\n\t }\n\t var precision = -Math.floor(Math.log(significance) / Math.log(10));\n\t if (number >= 0) {\n\t return exports.ROUND(Math.ceil(number / significance) * significance, precision);\n\t } else {\n\t if (mode === 0) {\n\t return -exports.ROUND(Math.floor(Math.abs(number) / significance) * significance, precision);\n\t } else {\n\t return -exports.ROUND(Math.ceil(Math.abs(number) / significance) * significance, precision);\n\t }\n\t }\n\t};\n\t\n\texports.CEILING.MATH = exports.CEILING;\n\t\n\texports.CEILING.PRECISE = exports.CEILING;\n\t\n\texports.COMBIN = function(number, number_chosen) {\n\t number = utils.parseNumber(number);\n\t number_chosen = utils.parseNumber(number_chosen);\n\t if (utils.anyIsError(number, number_chosen)) {\n\t return error.value;\n\t }\n\t return exports.FACT(number) / (exports.FACT(number_chosen) * exports.FACT(number - number_chosen));\n\t};\n\t\n\texports.COMBINA = function(number, number_chosen) {\n\t number = utils.parseNumber(number);\n\t number_chosen = utils.parseNumber(number_chosen);\n\t if (utils.anyIsError(number, number_chosen)) {\n\t return error.value;\n\t }\n\t return (number === 0 && number_chosen === 0) ? 1 : exports.COMBIN(number + number_chosen - 1, number - 1);\n\t};\n\t\n\texports.COS = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return Math.cos(number);\n\t};\n\t\n\texports.COSH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return (Math.exp(number) + Math.exp(-number)) / 2;\n\t};\n\t\n\texports.COT = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return 1 / Math.tan(number);\n\t};\n\t\n\texports.COTH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var e2 = Math.exp(2 * number);\n\t return (e2 + 1) / (e2 - 1);\n\t};\n\t\n\texports.CSC = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return 1 / Math.sin(number);\n\t};\n\t\n\texports.CSCH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return 2 / (Math.exp(number) - Math.exp(-number));\n\t};\n\t\n\texports.DECIMAL = function(number, radix) {\n\t if (arguments.length < 1) {\n\t return error.value;\n\t }\n\t\n\t\n\t return parseInt(number, radix);\n\t};\n\t\n\texports.DEGREES = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return number * 180 / Math.PI;\n\t};\n\t\n\texports.EVEN = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return exports.CEILING(number, -2, -1);\n\t};\n\t\n\texports.EXP = Math.exp;\n\t\n\tvar MEMOIZED_FACT = [];\n\texports.FACT = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var n = Math.floor(number);\n\t if (n === 0 || n === 1) {\n\t return 1;\n\t } else if (MEMOIZED_FACT[n] > 0) {\n\t return MEMOIZED_FACT[n];\n\t } else {\n\t MEMOIZED_FACT[n] = exports.FACT(n - 1) * n;\n\t return MEMOIZED_FACT[n];\n\t }\n\t};\n\t\n\texports.FACTDOUBLE = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var n = Math.floor(number);\n\t if (n <= 0) {\n\t return 1;\n\t } else {\n\t return n * exports.FACTDOUBLE(n - 2);\n\t }\n\t};\n\t\n\texports.FLOOR = function(number, significance) {\n\t number = utils.parseNumber(number);\n\t significance = utils.parseNumber(significance);\n\t if (utils.anyIsError(number, significance)) {\n\t return error.value;\n\t }\n\t if (significance === 0) {\n\t return 0;\n\t }\n\t\n\t if (!(number > 0 && significance > 0) && !(number < 0 && significance < 0)) {\n\t return error.num;\n\t }\n\t\n\t significance = Math.abs(significance);\n\t var precision = -Math.floor(Math.log(significance) / Math.log(10));\n\t if (number >= 0) {\n\t return exports.ROUND(Math.floor(number / significance) * significance, precision);\n\t } else {\n\t return -exports.ROUND(Math.ceil(Math.abs(number) / significance), precision);\n\t }\n\t};\n\t\n\t//TODO: Verify\n\texports.FLOOR.MATH = function(number, significance, mode) {\n\t significance = (significance === undefined) ? 1 : significance;\n\t mode = (mode === undefined) ? 0 : mode;\n\t\n\t number = utils.parseNumber(number);\n\t significance = utils.parseNumber(significance);\n\t mode = utils.parseNumber(mode);\n\t if (utils.anyIsError(number, significance, mode)) {\n\t return error.value;\n\t }\n\t if (significance === 0) {\n\t return 0;\n\t }\n\t\n\t significance = significance ? Math.abs(significance) : 1;\n\t var precision = -Math.floor(Math.log(significance) / Math.log(10));\n\t if (number >= 0) {\n\t return exports.ROUND(Math.floor(number / significance) * significance, precision);\n\t } else if (mode === 0 || mode === undefined) {\n\t return -exports.ROUND(Math.ceil(Math.abs(number) / significance) * significance, precision);\n\t }\n\t return -exports.ROUND(Math.floor(Math.abs(number) / significance) * significance, precision);\n\t};\n\t\n\t// Deprecated\n\texports.FLOOR.PRECISE = exports.FLOOR.MATH;\n\t\n\t// adapted http://rosettacode.org/wiki/Greatest_common_divisor#JavaScript\n\texports.GCD = function() {\n\t var range = utils.parseNumberArray(utils.flatten(arguments));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t var n = range.length;\n\t var r0 = range[0];\n\t var x = r0 < 0 ? -r0 : r0;\n\t for (var i = 1; i < n; i++) {\n\t var ri = range[i];\n\t var y = ri < 0 ? -ri : ri;\n\t while (x && y) {\n\t if (x > y) {\n\t x %= y;\n\t } else {\n\t y %= x;\n\t }\n\t }\n\t x += y;\n\t }\n\t return x;\n\t};\n\t\n\t\n\texports.INT = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return Math.floor(number);\n\t};\n\t\n\t//TODO: verify\n\texports.ISO = {\n\t CEILING: exports.CEILING\n\t};\n\t\n\texports.LCM = function() {\n\t // Credits: Jonas Raoni Soares Silva\n\t var o = utils.parseNumberArray(utils.flatten(arguments));\n\t if (o instanceof Error) {\n\t return o;\n\t }\n\t for (var i, j, n, d, r = 1;\n\t (n = o.pop()) !== undefined;) {\n\t while (n > 1) {\n\t if (n % 2) {\n\t for (i = 3, j = Math.floor(Math.sqrt(n)); i <= j && n % i; i += 2) {\n\t //empty\n\t }\n\t d = (i <= j) ? i : n;\n\t } else {\n\t d = 2;\n\t }\n\t for (n /= d, r *= d, i = o.length; i;\n\t (o[--i] % d) === 0 && (o[i] /= d) === 1 && o.splice(i, 1)) {\n\t //empty\n\t }\n\t }\n\t }\n\t return r;\n\t};\n\t\n\texports.LN = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return Math.log(number);\n\t};\n\t\n\texports.LN10 = function() {\n\t return Math.log(10);\n\t};\n\t\n\texports.LN2 = function() {\n\t return Math.log(2);\n\t};\n\t\n\texports.LOG10E = function() {\n\t return Math.LOG10E;\n\t};\n\t\n\texports.LOG2E = function() {\n\t return Math.LOG2E;\n\t};\n\t\n\texports.LOG = function(number, base) {\n\t number = utils.parseNumber(number);\n\t base = utils.parseNumber(base);\n\t if (utils.anyIsError(number, base)) {\n\t return error.value;\n\t }\n\t base = (base === undefined) ? 10 : base;\n\t return Math.log(number) / Math.log(base);\n\t};\n\t\n\texports.LOG10 = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return Math.log(number) / Math.log(10);\n\t};\n\t\n\texports.MOD = function(dividend, divisor) {\n\t dividend = utils.parseNumber(dividend);\n\t divisor = utils.parseNumber(divisor);\n\t if (utils.anyIsError(dividend, divisor)) {\n\t return error.value;\n\t }\n\t if (divisor === 0) {\n\t return error.div0;\n\t }\n\t var modulus = Math.abs(dividend % divisor);\n\t return (divisor > 0) ? modulus : -modulus;\n\t};\n\t\n\texports.MROUND = function(number, multiple) {\n\t number = utils.parseNumber(number);\n\t multiple = utils.parseNumber(multiple);\n\t if (utils.anyIsError(number, multiple)) {\n\t return error.value;\n\t }\n\t if (number * multiple < 0) {\n\t return error.num;\n\t }\n\t\n\t return Math.round(number / multiple) * multiple;\n\t};\n\t\n\texports.MULTINOMIAL = function() {\n\t var args = utils.parseNumberArray(utils.flatten(arguments));\n\t if (args instanceof Error) {\n\t return args;\n\t }\n\t var sum = 0;\n\t var divisor = 1;\n\t for (var i = 0; i < args.length; i++) {\n\t sum += args[i];\n\t divisor *= exports.FACT(args[i]);\n\t }\n\t return exports.FACT(sum) / divisor;\n\t};\n\t\n\texports.ODD = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var temp = Math.ceil(Math.abs(number));\n\t temp = (temp & 1) ? temp : temp + 1;\n\t return (number > 0) ? temp : -temp;\n\t};\n\t\n\texports.PI = function() {\n\t return Math.PI;\n\t};\n\t\n\texports.E = function() {\n\t return Math.E;\n\t};\n\t\n\texports.POWER = function(number, power) {\n\t number = utils.parseNumber(number);\n\t power = utils.parseNumber(power);\n\t if (utils.anyIsError(number, power)) {\n\t return error.value;\n\t }\n\t var result = Math.pow(number, power);\n\t if (isNaN(result)) {\n\t return error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.PRODUCT = function() {\n\t var args = utils.parseNumberArray(utils.flatten(arguments));\n\t if (args instanceof Error) {\n\t return args;\n\t }\n\t var result = 1;\n\t for (var i = 0; i < args.length; i++) {\n\t result *= args[i];\n\t }\n\t return result;\n\t};\n\t\n\texports.QUOTIENT = function(numerator, denominator) {\n\t numerator = utils.parseNumber(numerator);\n\t denominator = utils.parseNumber(denominator);\n\t if (utils.anyIsError(numerator, denominator)) {\n\t return error.value;\n\t }\n\t return parseInt(numerator / denominator, 10);\n\t};\n\t\n\texports.RADIANS = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return number * Math.PI / 180;\n\t};\n\t\n\texports.RAND = function() {\n\t return Math.random();\n\t};\n\t\n\texports.RANDBETWEEN = function(bottom, top) {\n\t bottom = utils.parseNumber(bottom);\n\t top = utils.parseNumber(top);\n\t if (utils.anyIsError(bottom, top)) {\n\t return error.value;\n\t }\n\t // Creative Commons Attribution 3.0 License\n\t // Copyright (c) 2012 eqcode\n\t return bottom + Math.ceil((top - bottom + 1) * Math.random()) - 1;\n\t};\n\t\n\t// TODO\n\texports.ROMAN = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t // The MIT License\n\t // Copyright (c) 2008 Steven Levithan\n\t var digits = String(number).split('');\n\t var key = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM', '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC', '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'];\n\t var roman = '';\n\t var i = 3;\n\t while (i--) {\n\t roman = (key[+digits.pop() + (i * 10)] || '') + roman;\n\t }\n\t return new Array(+digits.join('') + 1).join('M') + roman;\n\t};\n\t\n\texports.ROUND = function(number, digits) {\n\t number = utils.parseNumber(number);\n\t digits = utils.parseNumber(digits);\n\t if (utils.anyIsError(number, digits)) {\n\t return error.value;\n\t }\n\t return Math.round(number * Math.pow(10, digits)) / Math.pow(10, digits);\n\t};\n\t\n\texports.ROUNDDOWN = function(number, digits) {\n\t number = utils.parseNumber(number);\n\t digits = utils.parseNumber(digits);\n\t if (utils.anyIsError(number, digits)) {\n\t return error.value;\n\t }\n\t var sign = (number > 0) ? 1 : -1;\n\t return sign * (Math.floor(Math.abs(number) * Math.pow(10, digits))) / Math.pow(10, digits);\n\t};\n\t\n\texports.ROUNDUP = function(number, digits) {\n\t number = utils.parseNumber(number);\n\t digits = utils.parseNumber(digits);\n\t if (utils.anyIsError(number, digits)) {\n\t return error.value;\n\t }\n\t var sign = (number > 0) ? 1 : -1;\n\t return sign * (Math.ceil(Math.abs(number) * Math.pow(10, digits))) / Math.pow(10, digits);\n\t};\n\t\n\texports.SEC = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return 1 / Math.cos(number);\n\t};\n\t\n\texports.SECH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return 2 / (Math.exp(number) + Math.exp(-number));\n\t};\n\t\n\texports.SERIESSUM = function(x, n, m, coefficients) {\n\t x = utils.parseNumber(x);\n\t n = utils.parseNumber(n);\n\t m = utils.parseNumber(m);\n\t coefficients = utils.parseNumberArray(coefficients);\n\t if (utils.anyIsError(x, n, m, coefficients)) {\n\t return error.value;\n\t }\n\t var result = coefficients[0] * Math.pow(x, n);\n\t for (var i = 1; i < coefficients.length; i++) {\n\t result += coefficients[i] * Math.pow(x, n + i * m);\n\t }\n\t return result;\n\t};\n\t\n\texports.SIGN = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t if (number < 0) {\n\t return -1;\n\t } else if (number === 0) {\n\t return 0;\n\t } else {\n\t return 1;\n\t }\n\t};\n\t\n\texports.SIN = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return Math.sin(number);\n\t};\n\t\n\texports.SINH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return (Math.exp(number) - Math.exp(-number)) / 2;\n\t};\n\t\n\texports.SQRT = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t if (number < 0) {\n\t return error.num;\n\t }\n\t return Math.sqrt(number);\n\t};\n\t\n\texports.SQRTPI = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return Math.sqrt(number * Math.PI);\n\t};\n\t\n\texports.SQRT1_2 = function() {\n\t return 1 / Math.sqrt(2);\n\t};\n\t\n\texports.SQRT2 = function() {\n\t return Math.sqrt(2);\n\t};\n\t\n\texports.SUBTOTAL = function(function_code, ref1) {\n\t function_code = utils.parseNumber(function_code);\n\t if (function_code instanceof Error) {\n\t return function_code;\n\t }\n\t switch (function_code) {\n\t case 1:\n\t return statistical.AVERAGE(ref1);\n\t case 2:\n\t return statistical.COUNT(ref1);\n\t case 3:\n\t return statistical.COUNTA(ref1);\n\t case 4:\n\t return statistical.MAX(ref1);\n\t case 5:\n\t return statistical.MIN(ref1);\n\t case 6:\n\t return exports.PRODUCT(ref1);\n\t case 7:\n\t return statistical.STDEV.S(ref1);\n\t case 8:\n\t return statistical.STDEV.P(ref1);\n\t case 9:\n\t return exports.SUM(ref1);\n\t case 10:\n\t return statistical.VAR.S(ref1);\n\t case 11:\n\t return statistical.VAR.P(ref1);\n\t // no hidden values for us\n\t case 101:\n\t return statistical.AVERAGE(ref1);\n\t case 102:\n\t return statistical.COUNT(ref1);\n\t case 103:\n\t return statistical.COUNTA(ref1);\n\t case 104:\n\t return statistical.MAX(ref1);\n\t case 105:\n\t return statistical.MIN(ref1);\n\t case 106:\n\t return exports.PRODUCT(ref1);\n\t case 107:\n\t return statistical.STDEV.S(ref1);\n\t case 108:\n\t return statistical.STDEV.P(ref1);\n\t case 109:\n\t return exports.SUM(ref1);\n\t case 110:\n\t return statistical.VAR.S(ref1);\n\t case 111:\n\t return statistical.VAR.P(ref1);\n\t\n\t }\n\t};\n\t\n\texports.ADD = function (num1, num2) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t num1 = utils.parseNumber(num1);\n\t num2 = utils.parseNumber(num2);\n\t if (utils.anyIsError(num1, num2)) {\n\t return error.value;\n\t }\n\t\n\t return num1 + num2;\n\t};\n\t\n\texports.MINUS = function (num1, num2) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t num1 = utils.parseNumber(num1);\n\t num2 = utils.parseNumber(num2);\n\t if (utils.anyIsError(num1, num2)) {\n\t return error.value;\n\t }\n\t\n\t return num1 - num2;\n\t};\n\t\n\texports.DIVIDE = function (dividend, divisor) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t dividend = utils.parseNumber(dividend);\n\t divisor = utils.parseNumber(divisor);\n\t if (utils.anyIsError(dividend, divisor)) {\n\t return error.value;\n\t }\n\t\n\t if (divisor === 0) {\n\t return error.div0;\n\t }\n\t\n\t return dividend / divisor;\n\t};\n\t\n\texports.MULTIPLY = function (factor1, factor2) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t factor1 = utils.parseNumber(factor1);\n\t factor2 = utils.parseNumber(factor2);\n\t if (utils.anyIsError(factor1, factor2)) {\n\t return error.value;\n\t }\n\t\n\t return factor1 * factor2;\n\t};\n\t\n\texports.GTE = function (num1, num2) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t num1 = utils.parseNumber(num1);\n\t num2 = utils.parseNumber(num2);\n\t if (utils.anyIsError(num1, num2)) {\n\t return error.error;\n\t }\n\t\n\t return num1 >= num2;\n\t};\n\t\n\texports.LT = function (num1, num2) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t num1 = utils.parseNumber(num1);\n\t num2 = utils.parseNumber(num2);\n\t if (utils.anyIsError(num1, num2)) {\n\t return error.error;\n\t }\n\t\n\t return num1 < num2;\n\t};\n\t\n\t\n\texports.LTE = function (num1, num2) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t num1 = utils.parseNumber(num1);\n\t num2 = utils.parseNumber(num2);\n\t if (utils.anyIsError(num1, num2)) {\n\t return error.error;\n\t }\n\t\n\t return num1 <= num2;\n\t};\n\t\n\texports.EQ = function (value1, value2) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t return value1 === value2;\n\t};\n\t\n\texports.NE = function (value1, value2) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t return value1 !== value2;\n\t};\n\t\n\texports.POW = function (base, exponent) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t base = utils.parseNumber(base);\n\t exponent = utils.parseNumber(exponent);\n\t if (utils.anyIsError(base, exponent)) {\n\t return error.error;\n\t }\n\t\n\t return exports.POWER(base, exponent);\n\t};\n\t\n\texports.SUM = function() {\n\t var result = 0;\n\t\n\t utils.arrayEach(utils.argsToArray(arguments), function(value) {\n\t if (typeof value === 'number') {\n\t result += value;\n\t\n\t } else if (typeof value === 'string') {\n\t var parsed = parseFloat(value);\n\t\n\t !isNaN(parsed) && (result += parsed);\n\t\n\t } else if (Array.isArray(value)) {\n\t result += exports.SUM.apply(null, value);\n\t }\n\t });\n\t\n\t return result;\n\t};\n\t\n\texports.SUMIF = function(range, criteria) {\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t var result = 0;\n\t for (var i = 0; i < range.length; i++) {\n\t result += (eval(range[i] + criteria)) ? range[i] : 0; // jshint ignore:line\n\t }\n\t return result;\n\t};\n\t\n\texports.SUMIFS = function() {\n\t var args = utils.argsToArray(arguments);\n\t var range = utils.parseNumberArray(utils.flatten(args.shift()));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t var criteria = args;\n\t\n\t var n_range_elements = range.length;\n\t var n_criterias = criteria.length;\n\t\n\t var result = 0;\n\t for (var i = 0; i < n_range_elements; i++) {\n\t var el = range[i];\n\t var condition = '';\n\t for (var c = 0; c < n_criterias; c++) {\n\t condition += el + criteria[c];\n\t if (c !== n_criterias - 1) {\n\t condition += '&&';\n\t }\n\t }\n\t if (eval(condition)) { // jshint ignore:line\n\t result += el;\n\t }\n\t }\n\t return result;\n\t};\n\t\n\texports.SUMPRODUCT = function() {\n\t if (!arguments || arguments.length === 0) {\n\t return error.value;\n\t }\n\t var arrays = arguments.length + 1;\n\t var result = 0;\n\t var product;\n\t var k;\n\t var _i;\n\t var _ij;\n\t for (var i = 0; i < arguments[0].length; i++) {\n\t if (!(arguments[0][i] instanceof Array)) {\n\t product = 1;\n\t for (k = 1; k < arrays; k++) {\n\t _i = utils.parseNumber(arguments[k - 1][i]);\n\t if (_i instanceof Error) {\n\t return _i;\n\t }\n\t product *= _i;\n\t }\n\t result += product;\n\t } else {\n\t for (var j = 0; j < arguments[0][i].length; j++) {\n\t product = 1;\n\t for (k = 1; k < arrays; k++) {\n\t _ij = utils.parseNumber(arguments[k - 1][i][j]);\n\t if (_ij instanceof Error) {\n\t return _ij;\n\t }\n\t product *= _ij;\n\t }\n\t result += product;\n\t }\n\t }\n\t }\n\t return result;\n\t};\n\t\n\texports.SUMSQ = function() {\n\t var numbers = utils.parseNumberArray(utils.flatten(arguments));\n\t if (numbers instanceof Error) {\n\t return numbers;\n\t }\n\t var result = 0;\n\t var length = numbers.length;\n\t for (var i = 0; i < length; i++) {\n\t result += (information.ISNUMBER(numbers[i])) ? numbers[i] * numbers[i] : 0;\n\t }\n\t return result;\n\t};\n\t\n\texports.SUMX2MY2 = function(array_x, array_y) {\n\t array_x = utils.parseNumberArray(utils.flatten(array_x));\n\t array_y = utils.parseNumberArray(utils.flatten(array_y));\n\t if (utils.anyIsError(array_x, array_y)) {\n\t return error.value;\n\t }\n\t var result = 0;\n\t for (var i = 0; i < array_x.length; i++) {\n\t result += array_x[i] * array_x[i] - array_y[i] * array_y[i];\n\t }\n\t return result;\n\t};\n\t\n\texports.SUMX2PY2 = function(array_x, array_y) {\n\t array_x = utils.parseNumberArray(utils.flatten(array_x));\n\t array_y = utils.parseNumberArray(utils.flatten(array_y));\n\t if (utils.anyIsError(array_x, array_y)) {\n\t return error.value;\n\t }\n\t var result = 0;\n\t array_x = utils.parseNumberArray(utils.flatten(array_x));\n\t array_y = utils.parseNumberArray(utils.flatten(array_y));\n\t for (var i = 0; i < array_x.length; i++) {\n\t result += array_x[i] * array_x[i] + array_y[i] * array_y[i];\n\t }\n\t return result;\n\t};\n\t\n\texports.SUMXMY2 = function(array_x, array_y) {\n\t array_x = utils.parseNumberArray(utils.flatten(array_x));\n\t array_y = utils.parseNumberArray(utils.flatten(array_y));\n\t if (utils.anyIsError(array_x, array_y)) {\n\t return error.value;\n\t }\n\t var result = 0;\n\t array_x = utils.flatten(array_x);\n\t array_y = utils.flatten(array_y);\n\t for (var i = 0; i < array_x.length; i++) {\n\t result += Math.pow(array_x[i] - array_y[i], 2);\n\t }\n\t return result;\n\t};\n\t\n\texports.TAN = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return Math.tan(number);\n\t};\n\t\n\texports.TANH = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t var e2 = Math.exp(2 * number);\n\t return (e2 - 1) / (e2 + 1);\n\t};\n\t\n\texports.TRUNC = function(number, digits) {\n\t digits = (digits === undefined) ? 0 : digits;\n\t number = utils.parseNumber(number);\n\t digits = utils.parseNumber(digits);\n\t if (utils.anyIsError(number, digits)) {\n\t return error.value;\n\t }\n\t var sign = (number > 0) ? 1 : -1;\n\t return sign * (Math.floor(Math.abs(number) * Math.pow(10, digits))) / Math.pow(10, digits);\n\t};\n\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar error = __webpack_require__(16);\n\t\n\texports.flattenShallow = function(array) {\n\t if (!array || !array.reduce) {\n\t return array;\n\t }\n\t\n\t return array.reduce(function(a, b) {\n\t var aIsArray = Array.isArray(a);\n\t var bIsArray = Array.isArray(b);\n\t\n\t if (aIsArray && bIsArray ) {\n\t return a.concat(b);\n\t }\n\t if (aIsArray) {\n\t a.push(b);\n\t\n\t return a;\n\t }\n\t if (bIsArray) {\n\t return [a].concat(b);\n\t }\n\t\n\t return [a, b];\n\t });\n\t};\n\t\n\texports.isFlat = function(array) {\n\t if (!array) {\n\t return false;\n\t }\n\t\n\t for (var i = 0; i < array.length; ++i) {\n\t if (Array.isArray(array[i])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t};\n\t\n\texports.flatten = function() {\n\t var result = exports.argsToArray.apply(null, arguments);\n\t\n\t while (!exports.isFlat(result)) {\n\t result = exports.flattenShallow(result);\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.argsToArray = function(args) {\n\t var result = [];\n\t\n\t exports.arrayEach(args, function(value) {\n\t result.push(value);\n\t });\n\t\n\t return result;\n\t};\n\t\n\texports.numbers = function() {\n\t var possibleNumbers = this.flatten.apply(null, arguments);\n\t return possibleNumbers.filter(function(el) {\n\t return typeof el === 'number';\n\t });\n\t};\n\t\n\texports.cleanFloat = function(number) {\n\t var power = 1e14;\n\t return Math.round(number * power) / power;\n\t};\n\t\n\texports.parseBool = function(bool) {\n\t if (typeof bool === 'boolean') {\n\t return bool;\n\t }\n\t\n\t if (bool instanceof Error) {\n\t return bool;\n\t }\n\t\n\t if (typeof bool === 'number') {\n\t return bool !== 0;\n\t }\n\t\n\t if (typeof bool === 'string') {\n\t var up = bool.toUpperCase();\n\t if (up === 'TRUE') {\n\t return true;\n\t }\n\t\n\t if (up === 'FALSE') {\n\t return false;\n\t }\n\t }\n\t\n\t if (bool instanceof Date && !isNaN(bool)) {\n\t return true;\n\t }\n\t\n\t return error.value;\n\t};\n\t\n\texports.parseNumber = function(string) {\n\t if (string === undefined || string === '') {\n\t return error.value;\n\t }\n\t if (!isNaN(string)) {\n\t return parseFloat(string);\n\t }\n\t\n\t return error.value;\n\t};\n\t\n\texports.parseNumberArray = function(arr) {\n\t var len;\n\t\n\t if (!arr || (len = arr.length) === 0) {\n\t return error.value;\n\t }\n\t\n\t var parsed;\n\t\n\t while (len--) {\n\t parsed = exports.parseNumber(arr[len]);\n\t if (parsed === error.value) {\n\t return parsed;\n\t }\n\t arr[len] = parsed;\n\t }\n\t\n\t return arr;\n\t};\n\t\n\texports.parseMatrix = function(matrix) {\n\t var n;\n\t\n\t if (!matrix || (n = matrix.length) === 0) {\n\t return error.value;\n\t }\n\t var pnarr;\n\t\n\t for (var i = 0; i < matrix.length; i++) {\n\t pnarr = exports.parseNumberArray(matrix[i]);\n\t matrix[i] = pnarr;\n\t\n\t if (pnarr instanceof Error) {\n\t return pnarr;\n\t }\n\t }\n\t\n\t return matrix;\n\t};\n\t\n\tvar d1900 = new Date(1900, 0, 1);\n\texports.parseDate = function(date) {\n\t if (!isNaN(date)) {\n\t if (date instanceof Date) {\n\t return new Date(date);\n\t }\n\t var d = parseInt(date, 10);\n\t if (d < 0) {\n\t return error.num;\n\t }\n\t if (d <= 60) {\n\t return new Date(d1900.getTime() + (d - 1) * 86400000);\n\t }\n\t return new Date(d1900.getTime() + (d - 2) * 86400000);\n\t }\n\t if (typeof date === 'string') {\n\t date = new Date(date);\n\t if (!isNaN(date)) {\n\t return date;\n\t }\n\t }\n\t return error.value;\n\t};\n\t\n\texports.parseDateArray = function(arr) {\n\t var len = arr.length;\n\t var parsed;\n\t while (len--) {\n\t parsed = this.parseDate(arr[len]);\n\t if (parsed === error.value) {\n\t return parsed;\n\t }\n\t arr[len] = parsed;\n\t }\n\t return arr;\n\t};\n\t\n\texports.anyIsError = function() {\n\t var n = arguments.length;\n\t while (n--) {\n\t if (arguments[n] instanceof Error) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t};\n\t\n\texports.arrayValuesToNumbers = function(arr) {\n\t var n = arr.length;\n\t var el;\n\t while (n--) {\n\t el = arr[n];\n\t if (typeof el === 'number') {\n\t continue;\n\t }\n\t if (el === true) {\n\t arr[n] = 1;\n\t continue;\n\t }\n\t if (el === false) {\n\t arr[n] = 0;\n\t continue;\n\t }\n\t if (typeof el === 'string') {\n\t var number = this.parseNumber(el);\n\t if (number instanceof Error) {\n\t arr[n] = 0;\n\t } else {\n\t arr[n] = number;\n\t }\n\t }\n\t }\n\t return arr;\n\t};\n\t\n\texports.rest = function(array, idx) {\n\t idx = idx || 1;\n\t if (!array || typeof array.slice !== 'function') {\n\t return array;\n\t }\n\t return array.slice(idx);\n\t};\n\t\n\texports.initial = function(array, idx) {\n\t idx = idx || 1;\n\t if (!array || typeof array.slice !== 'function') {\n\t return array;\n\t }\n\t return array.slice(0, array.length - idx);\n\t};\n\t\n\texports.arrayEach = function(array, iteratee) {\n\t var index = -1, length = array.length;\n\t\n\t while (++index < length) {\n\t if (iteratee(array[index], index, array) === false) {\n\t break;\n\t }\n\t }\n\t\n\t return array;\n\t};\n\n\n/***/ },\n/* 16 */\n/***/ function(module, exports) {\n\n\texports.nil = new Error('#NULL!');\n\texports.div0 = new Error('#DIV/0!');\n\texports.value = new Error('#VALUE?');\n\texports.ref = new Error('#REF!');\n\texports.name = new Error('#NAME?');\n\texports.num = new Error('#NUM!');\n\texports.na = new Error('#N/A');\n\texports.error = new Error('#ERROR!');\n\texports.data = new Error('#GETTING_DATA');\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar mathTrig = __webpack_require__(14);\n\tvar text = __webpack_require__(18);\n\tvar jStat = __webpack_require__(22).jStat;\n\tvar utils = __webpack_require__(15);\n\tvar error = __webpack_require__(16);\n\tvar misc = __webpack_require__(23);\n\t\n\tvar SQRT2PI = 2.5066282746310002;\n\t\n\texports.AVEDEV = function() {\n\t var range = utils.parseNumberArray(utils.flatten(arguments));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t return jStat.sum(jStat(range).subtract(jStat.mean(range)).abs()[0]) / range.length;\n\t};\n\t\n\texports.AVERAGE = function() {\n\t var range = utils.numbers(utils.flatten(arguments));\n\t var n = range.length;\n\t var sum = 0;\n\t var count = 0;\n\t var result;\n\t\n\t for (var i = 0; i < n; i++) {\n\t sum += range[i];\n\t count += 1;\n\t }\n\t result = sum / count;\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.AVERAGEA = function() {\n\t var range = utils.flatten(arguments);\n\t var n = range.length;\n\t var sum = 0;\n\t var count = 0;\n\t var result;\n\t for (var i = 0; i < n; i++) {\n\t var el = range[i];\n\t if (typeof el === 'number') {\n\t sum += el;\n\t }\n\t if (el === true) {\n\t sum++;\n\t }\n\t if (el !== null) {\n\t count++;\n\t }\n\t }\n\t result = sum / count;\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.AVERAGEIF = function(range, criteria, average_range) {\n\t if (arguments.length <= 1) {\n\t return error.na;\n\t }\n\t average_range = average_range || range;\n\t range = utils.flatten(range);\n\t average_range = utils.parseNumberArray(utils.flatten(average_range));\n\t if (average_range instanceof Error) {\n\t return average_range;\n\t }\n\t var average_count = 0;\n\t var result = 0;\n\t for (var i = 0; i < range.length; i++) {\n\t if (eval(range[i] + criteria)) { // jshint ignore:line\n\t result += average_range[i];\n\t average_count++;\n\t }\n\t }\n\t return result / average_count;\n\t};\n\t\n\texports.AVERAGEIFS = function() {\n\t // Does not work with multi dimensional ranges yet!\n\t //http://office.microsoft.com/en-001/excel-help/averageifs-function-HA010047493.aspx\n\t var args = utils.argsToArray(arguments);\n\t var criteria = (args.length - 1) / 2;\n\t var range = utils.flatten(args[0]);\n\t var count = 0;\n\t var result = 0;\n\t for (var i = 0; i < range.length; i++) {\n\t var condition = '';\n\t for (var j = 0; j < criteria; j++) {\n\t condition += args[2 * j + 1][i] + args[2 * j + 2];\n\t if (j !== criteria - 1) {\n\t condition += '&&';\n\t }\n\t }\n\t if (eval(condition)) { // jshint ignore:line\n\t result += range[i];\n\t count++;\n\t }\n\t }\n\t\n\t var average = result / count;\n\t if (isNaN(average)) {\n\t return 0;\n\t } else {\n\t return average;\n\t }\n\t};\n\t\n\texports.BETA = {};\n\t\n\texports.BETA.DIST = function(x, alpha, beta, cumulative, A, B) {\n\t if (arguments.length < 4) {\n\t return error.value;\n\t }\n\t\n\t A = (A === undefined) ? 0 : A;\n\t B = (B === undefined) ? 1 : B;\n\t\n\t x = utils.parseNumber(x);\n\t alpha = utils.parseNumber(alpha);\n\t beta = utils.parseNumber(beta);\n\t A = utils.parseNumber(A);\n\t B = utils.parseNumber(B);\n\t if (utils.anyIsError(x, alpha, beta, A, B)) {\n\t return error.value;\n\t }\n\t\n\t x = (x - A) / (B - A);\n\t return (cumulative) ? jStat.beta.cdf(x, alpha, beta) : jStat.beta.pdf(x, alpha, beta);\n\t};\n\t\n\texports.BETA.INV = function(probability, alpha, beta, A, B) {\n\t A = (A === undefined) ? 0 : A;\n\t B = (B === undefined) ? 1 : B;\n\t\n\t probability = utils.parseNumber(probability);\n\t alpha = utils.parseNumber(alpha);\n\t beta = utils.parseNumber(beta);\n\t A = utils.parseNumber(A);\n\t B = utils.parseNumber(B);\n\t if (utils.anyIsError(probability, alpha, beta, A, B)) {\n\t return error.value;\n\t }\n\t\n\t return jStat.beta.inv(probability, alpha, beta) * (B - A) + A;\n\t};\n\t\n\texports.BINOM = {};\n\t\n\texports.BINOM.DIST = function(successes, trials, probability, cumulative) {\n\t successes = utils.parseNumber(successes);\n\t trials = utils.parseNumber(trials);\n\t probability = utils.parseNumber(probability);\n\t cumulative = utils.parseNumber(cumulative);\n\t if (utils.anyIsError(successes, trials, probability, cumulative)) {\n\t return error.value;\n\t }\n\t return (cumulative) ? jStat.binomial.cdf(successes, trials, probability) : jStat.binomial.pdf(successes, trials, probability);\n\t};\n\t\n\texports.BINOM.DIST.RANGE = function(trials, probability, successes, successes2) {\n\t successes2 = (successes2 === undefined) ? successes : successes2;\n\t\n\t trials = utils.parseNumber(trials);\n\t probability = utils.parseNumber(probability);\n\t successes = utils.parseNumber(successes);\n\t successes2 = utils.parseNumber(successes2);\n\t if (utils.anyIsError(trials, probability, successes, successes2)) {\n\t return error.value;\n\t }\n\t\n\t var result = 0;\n\t for (var i = successes; i <= successes2; i++) {\n\t result += mathTrig.COMBIN(trials, i) * Math.pow(probability, i) * Math.pow(1 - probability, trials - i);\n\t }\n\t return result;\n\t};\n\t\n\texports.BINOM.INV = function(trials, probability, alpha) {\n\t trials = utils.parseNumber(trials);\n\t probability = utils.parseNumber(probability);\n\t alpha = utils.parseNumber(alpha);\n\t if (utils.anyIsError(trials, probability, alpha)) {\n\t return error.value;\n\t }\n\t\n\t var x = 0;\n\t while (x <= trials) {\n\t if (jStat.binomial.cdf(x, trials, probability) >= alpha) {\n\t return x;\n\t }\n\t x++;\n\t }\n\t};\n\t\n\texports.CHISQ = {};\n\t\n\texports.CHISQ.DIST = function(x, k, cumulative) {\n\t x = utils.parseNumber(x);\n\t k = utils.parseNumber(k);\n\t if (utils.anyIsError(x, k)) {\n\t return error.value;\n\t }\n\t\n\t return (cumulative) ? jStat.chisquare.cdf(x, k) : jStat.chisquare.pdf(x, k);\n\t};\n\t\n\texports.CHISQ.DIST.RT = function(x, k) {\n\t if (!x | !k) {\n\t return error.na;\n\t }\n\t\n\t if (x < 1 || k > Math.pow(10, 10)) {\n\t return error.num;\n\t }\n\t\n\t if ((typeof x !== 'number') || (typeof k !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t return 1 - jStat.chisquare.cdf(x, k);\n\t};\n\t\n\texports.CHISQ.INV = function(probability, k) {\n\t probability = utils.parseNumber(probability);\n\t k = utils.parseNumber(k);\n\t if (utils.anyIsError(probability, k)) {\n\t return error.value;\n\t }\n\t return jStat.chisquare.inv(probability, k);\n\t};\n\t\n\texports.CHISQ.INV.RT = function(p, k) {\n\t if (!p | !k) {\n\t return error.na;\n\t }\n\t\n\t if (p < 0 || p > 1 || k < 1 || k > Math.pow(10, 10)) {\n\t return error.num;\n\t }\n\t\n\t if ((typeof p !== 'number') || (typeof k !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t return jStat.chisquare.inv(1.0 - p, k);\n\t};\n\t\n\texports.CHISQ.TEST = function(observed, expected) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t if ((!(observed instanceof Array)) || (!(expected instanceof Array))) {\n\t return error.value;\n\t }\n\t\n\t if (observed.length !== expected.length) {\n\t return error.value;\n\t }\n\t\n\t if (observed[0] && expected[0] &&\n\t observed[0].length !== expected[0].length) {\n\t return error.value;\n\t }\n\t\n\t var row = observed.length;\n\t var tmp, i, j;\n\t\n\t // Convert single-dimension array into two-dimension array\n\t for (i = 0; i < row; i ++) {\n\t if (!(observed[i] instanceof Array)) {\n\t tmp = observed[i];\n\t observed[i] = [];\n\t observed[i].push(tmp);\n\t }\n\t if (!(expected[i] instanceof Array)) {\n\t tmp = expected[i];\n\t expected[i] = [];\n\t expected[i].push(tmp);\n\t }\n\t }\n\t\n\t var col = observed[0].length;\n\t var dof = (col === 1) ? row-1 : (row-1)*(col-1);\n\t var xsqr = 0;\n\t var Pi =Math.PI;\n\t\n\t for (i = 0; i < row; i ++) {\n\t for (j = 0; j < col; j ++) {\n\t xsqr += Math.pow((observed[i][j] - expected[i][j]), 2) / expected[i][j];\n\t }\n\t }\n\t\n\t // Get independency by X square and its degree of freedom\n\t function ChiSq(xsqr, dof) {\n\t var p = Math.exp(-0.5 * xsqr);\n\t if((dof%2) === 1) {\n\t p = p * Math.sqrt(2 * xsqr/Pi);\n\t }\n\t var k = dof;\n\t while(k >= 2) {\n\t p = p * xsqr/k;\n\t k = k - 2;\n\t }\n\t var t = p;\n\t var a = dof;\n\t while (t > 0.0000000001*p) {\n\t a = a + 2;\n\t t = t * xsqr/a;\n\t p = p + t;\n\t }\n\t return 1-p;\n\t }\n\t\n\t return Math.round(ChiSq(xsqr, dof) * 1000000) / 1000000;\n\t};\n\t\n\texports.COLUMN = function(matrix, index) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t if (index < 0) {\n\t return error.num;\n\t }\n\t\n\t if (!(matrix instanceof Array) || (typeof index !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t if (matrix.length === 0) {\n\t return undefined;\n\t }\n\t\n\t return jStat.col(matrix, index);\n\t};\n\t\n\texports.COLUMNS = function(matrix) {\n\t if (arguments.length !== 1) {\n\t return error.na;\n\t }\n\t\n\t if (!(matrix instanceof Array)) {\n\t return error.value;\n\t }\n\t\n\t if (matrix.length === 0) {\n\t return 0;\n\t }\n\t\n\t return jStat.cols(matrix);\n\t};\n\t\n\texports.CONFIDENCE = {};\n\t\n\texports.CONFIDENCE.NORM = function(alpha, sd, n) {\n\t alpha = utils.parseNumber(alpha);\n\t sd = utils.parseNumber(sd);\n\t n = utils.parseNumber(n);\n\t if (utils.anyIsError(alpha, sd, n)) {\n\t return error.value;\n\t }\n\t return jStat.normalci(1, alpha, sd, n)[1] - 1;\n\t};\n\t\n\texports.CONFIDENCE.T = function(alpha, sd, n) {\n\t alpha = utils.parseNumber(alpha);\n\t sd = utils.parseNumber(sd);\n\t n = utils.parseNumber(n);\n\t if (utils.anyIsError(alpha, sd, n)) {\n\t return error.value;\n\t }\n\t return jStat.tci(1, alpha, sd, n)[1] - 1;\n\t};\n\t\n\texports.CORREL = function(array1, array2) {\n\t array1 = utils.parseNumberArray(utils.flatten(array1));\n\t array2 = utils.parseNumberArray(utils.flatten(array2));\n\t if (utils.anyIsError(array1, array2)) {\n\t return error.value;\n\t }\n\t return jStat.corrcoeff(array1, array2);\n\t};\n\t\n\texports.COUNT = function() {\n\t return utils.numbers(utils.flatten(arguments)).length;\n\t};\n\t\n\texports.COUNTA = function() {\n\t var range = utils.flatten(arguments);\n\t return range.length - exports.COUNTBLANK(range);\n\t};\n\t\n\texports.COUNTIN = function (range, value) {\n\t var result = 0;\n\t\n\t range = utils.flatten(range);\n\t\n\t for (var i = 0; i < range.length; i++) {\n\t if (range[i] === value) {\n\t result++;\n\t }\n\t }\n\t return result;\n\t};\n\t\n\t\n\texports.COUNTBLANK = function() {\n\t var range = utils.flatten(arguments);\n\t var blanks = 0;\n\t var element;\n\t for (var i = 0; i < range.length; i++) {\n\t element = range[i];\n\t if (element === null || element === '') {\n\t blanks++;\n\t }\n\t }\n\t return blanks;\n\t};\n\t\n\texports.COUNTIF = function(range, criteria) {\n\t range = utils.flatten(range);\n\t if (!/[<>=!]/.test(criteria)) {\n\t criteria = '==\"' + criteria + '\"';\n\t }\n\t var matches = 0;\n\t for (var i = 0; i < range.length; i++) {\n\t if (typeof range[i] !== 'string') {\n\t if (eval(range[i] + criteria)) { // jshint ignore:line\n\t matches++;\n\t }\n\t } else {\n\t if (eval('\"' + range[i] + '\"' + criteria)) { // jshint ignore:line\n\t matches++;\n\t }\n\t }\n\t }\n\t return matches;\n\t};\n\t\n\texports.COUNTIFS = function() {\n\t var args = utils.argsToArray(arguments);\n\t var results = new Array(utils.flatten(args[0]).length);\n\t for (var i = 0; i < results.length; i++) {\n\t results[i] = true;\n\t }\n\t for (i = 0; i < args.length; i += 2) {\n\t var range = utils.flatten(args[i]);\n\t var criteria = args[i + 1];\n\t if (!/[<>=!]/.test(criteria)) {\n\t criteria = '==\"' + criteria + '\"';\n\t }\n\t for (var j = 0; j < range.length; j++) {\n\t if (typeof range[j] !== 'string') {\n\t results[j] = results[j] && eval(range[j] + criteria); // jshint ignore:line\n\t } else {\n\t results[j] = results[j] && eval('\"' + range[j] + '\"' + criteria); // jshint ignore:line\n\t }\n\t }\n\t }\n\t var result = 0;\n\t for (i = 0; i < results.length; i++) {\n\t if (results[i]) {\n\t result++;\n\t }\n\t }\n\t return result;\n\t};\n\t\n\texports.COUNTUNIQUE = function () {\n\t return misc.UNIQUE.apply(null, utils.flatten(arguments)).length;\n\t};\n\t\n\texports.COVARIANCE = {};\n\t\n\texports.COVARIANCE.P = function(array1, array2) {\n\t array1 = utils.parseNumberArray(utils.flatten(array1));\n\t array2 = utils.parseNumberArray(utils.flatten(array2));\n\t if (utils.anyIsError(array1, array2)) {\n\t return error.value;\n\t }\n\t var mean1 = jStat.mean(array1);\n\t var mean2 = jStat.mean(array2);\n\t var result = 0;\n\t var n = array1.length;\n\t for (var i = 0; i < n; i++) {\n\t result += (array1[i] - mean1) * (array2[i] - mean2);\n\t }\n\t return result / n;\n\t};\n\t\n\texports.COVARIANCE.S = function(array1, array2) {\n\t array1 = utils.parseNumberArray(utils.flatten(array1));\n\t array2 = utils.parseNumberArray(utils.flatten(array2));\n\t if (utils.anyIsError(array1, array2)) {\n\t return error.value;\n\t }\n\t return jStat.covariance(array1, array2);\n\t};\n\t\n\texports.DEVSQ = function() {\n\t var range = utils.parseNumberArray(utils.flatten(arguments));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t var mean = jStat.mean(range);\n\t var result = 0;\n\t for (var i = 0; i < range.length; i++) {\n\t result += Math.pow((range[i] - mean), 2);\n\t }\n\t return result;\n\t};\n\t\n\texports.EXPON = {};\n\t\n\texports.EXPON.DIST = function(x, lambda, cumulative) {\n\t x = utils.parseNumber(x);\n\t lambda = utils.parseNumber(lambda);\n\t if (utils.anyIsError(x, lambda)) {\n\t return error.value;\n\t }\n\t return (cumulative) ? jStat.exponential.cdf(x, lambda) : jStat.exponential.pdf(x, lambda);\n\t};\n\t\n\texports.F = {};\n\t\n\texports.F.DIST = function(x, d1, d2, cumulative) {\n\t x = utils.parseNumber(x);\n\t d1 = utils.parseNumber(d1);\n\t d2 = utils.parseNumber(d2);\n\t if (utils.anyIsError(x, d1, d2)) {\n\t return error.value;\n\t }\n\t return (cumulative) ? jStat.centralF.cdf(x, d1, d2) : jStat.centralF.pdf(x, d1, d2);\n\t};\n\t\n\texports.F.DIST.RT = function(x, d1, d2) {\n\t if (arguments.length !== 3) {\n\t return error.na;\n\t }\n\t\n\t if (x < 0 || d1 < 1 || d2 < 1) {\n\t return error.num;\n\t }\n\t\n\t if ((typeof x !== 'number') || (typeof d1 !== 'number') || (typeof d2 !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t return 1 - jStat.centralF.cdf(x, d1, d2);\n\t};\n\t\n\texports.F.INV = function(probability, d1, d2) {\n\t probability = utils.parseNumber(probability);\n\t d1 = utils.parseNumber(d1);\n\t d2 = utils.parseNumber(d2);\n\t if (utils.anyIsError(probability, d1, d2)) {\n\t return error.value;\n\t }\n\t if (probability <= 0.0 || probability > 1.0) {\n\t return error.num;\n\t }\n\t\n\t return jStat.centralF.inv(probability, d1, d2);\n\t};\n\t\n\texports.F.INV.RT = function(p, d1, d2) {\n\t if (arguments.length !== 3) {\n\t return error.na;\n\t }\n\t\n\t if (p < 0 || p > 1 || d1 < 1 || d1 > Math.pow(10, 10) || d2 < 1 || d2 > Math.pow(10, 10)) {\n\t return error.num;\n\t }\n\t\n\t if ((typeof p !== 'number') || (typeof d1 !== 'number') || (typeof d2 !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t return jStat.centralF.inv(1.0 - p, d1, d2);\n\t};\n\t\n\texports.F.TEST = function(array1, array2) {\n\t if (!array1 || !array2) {\n\t return error.na;\n\t }\n\t\n\t if (!(array1 instanceof Array) || !(array2 instanceof Array)) {\n\t return error.na;\n\t }\n\t\n\t if (array1.length < 2 || array2.length < 2) {\n\t return error.div0;\n\t }\n\t\n\t var sumOfSquares = function(values, x1) {\n\t var sum = 0;\n\t for (var i = 0; i < values.length; i++) {\n\t sum +=Math.pow((values[i] - x1), 2);\n\t }\n\t return sum;\n\t };\n\t\n\t var x1 = mathTrig.SUM(array1) / array1.length;\n\t var x2 = mathTrig.SUM(array2) / array2.length;\n\t var sum1 = sumOfSquares(array1, x1) / (array1.length - 1);\n\t var sum2 = sumOfSquares(array2, x2) / (array2.length - 1);\n\t\n\t return sum1 / sum2;\n\t};\n\t\n\texports.FISHER = function(x) {\n\t x = utils.parseNumber(x);\n\t if (x instanceof Error) {\n\t return x;\n\t }\n\t return Math.log((1 + x) / (1 - x)) / 2;\n\t};\n\t\n\texports.FISHERINV = function(y) {\n\t y = utils.parseNumber(y);\n\t if (y instanceof Error) {\n\t return y;\n\t }\n\t var e2y = Math.exp(2 * y);\n\t return (e2y - 1) / (e2y + 1);\n\t};\n\t\n\texports.FORECAST = function(x, data_y, data_x) {\n\t x = utils.parseNumber(x);\n\t data_y = utils.parseNumberArray(utils.flatten(data_y));\n\t data_x = utils.parseNumberArray(utils.flatten(data_x));\n\t if (utils.anyIsError(x, data_y, data_x)) {\n\t return error.value;\n\t }\n\t var xmean = jStat.mean(data_x);\n\t var ymean = jStat.mean(data_y);\n\t var n = data_x.length;\n\t var num = 0;\n\t var den = 0;\n\t for (var i = 0; i < n; i++) {\n\t num += (data_x[i] - xmean) * (data_y[i] - ymean);\n\t den += Math.pow(data_x[i] - xmean, 2);\n\t }\n\t var b = num / den;\n\t var a = ymean - b * xmean;\n\t return a + b * x;\n\t};\n\t\n\texports.FREQUENCY = function(data, bins) {\n\t data = utils.parseNumberArray(utils.flatten(data));\n\t bins = utils.parseNumberArray(utils.flatten(bins));\n\t if (utils.anyIsError(data, bins)) {\n\t return error.value;\n\t }\n\t var n = data.length;\n\t var b = bins.length;\n\t var r = [];\n\t for (var i = 0; i <= b; i++) {\n\t r[i] = 0;\n\t for (var j = 0; j < n; j++) {\n\t if (i === 0) {\n\t if (data[j] <= bins[0]) {\n\t r[0] += 1;\n\t }\n\t } else if (i < b) {\n\t if (data[j] > bins[i - 1] && data[j] <= bins[i]) {\n\t r[i] += 1;\n\t }\n\t } else if (i === b) {\n\t if (data[j] > bins[b - 1]) {\n\t r[b] += 1;\n\t }\n\t }\n\t }\n\t }\n\t return r;\n\t};\n\t\n\t\n\texports.GAMMA = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t\n\t if (number === 0) {\n\t return error.num;\n\t }\n\t\n\t if (parseInt(number, 10) === number && number < 0) {\n\t return error.num;\n\t }\n\t\n\t return jStat.gammafn(number);\n\t};\n\t\n\texports.GAMMA.DIST = function(value, alpha, beta, cumulative) {\n\t if (arguments.length !== 4) {\n\t return error.na;\n\t }\n\t\n\t if (value < 0 || alpha <= 0 || beta <= 0) {\n\t return error.value;\n\t }\n\t\n\t if ((typeof value !== 'number') || (typeof alpha !== 'number') || (typeof beta !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t return cumulative ? jStat.gamma.cdf(value, alpha, beta, true) : jStat.gamma.pdf(value, alpha, beta, false);\n\t};\n\t\n\texports.GAMMA.INV = function(probability, alpha, beta) {\n\t if (arguments.length !== 3) {\n\t return error.na;\n\t }\n\t\n\t if (probability < 0 || probability > 1 || alpha <= 0 || beta <= 0) {\n\t return error.num;\n\t }\n\t\n\t if ((typeof probability !== 'number') || (typeof alpha !== 'number') || (typeof beta !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t return jStat.gamma.inv(probability, alpha, beta);\n\t};\n\t\n\texports.GAMMALN = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return jStat.gammaln(number);\n\t};\n\t\n\texports.GAMMALN.PRECISE = function(x) {\n\t if (arguments.length !== 1) {\n\t return error.na;\n\t }\n\t\n\t if (x <= 0) {\n\t return error.num;\n\t }\n\t\n\t if (typeof x !== 'number') {\n\t return error.value;\n\t }\n\t\n\t return jStat.gammaln(x);\n\t};\n\t\n\texports.GAUSS = function(z) {\n\t z = utils.parseNumber(z);\n\t if (z instanceof Error) {\n\t return z;\n\t }\n\t return jStat.normal.cdf(z, 0, 1) - 0.5;\n\t};\n\t\n\texports.GEOMEAN = function() {\n\t var args = utils.parseNumberArray(utils.flatten(arguments));\n\t if (args instanceof Error) {\n\t return args;\n\t }\n\t return jStat.geomean(args);\n\t};\n\t\n\texports.GROWTH = function(known_y, known_x, new_x, use_const) {\n\t // Credits: Ilmari Karonen (http://stackoverflow.com/questions/14161990/how-to-implement-growth-function-in-javascript)\n\t\n\t known_y = utils.parseNumberArray(known_y);\n\t if (known_y instanceof Error) {\n\t return known_y;\n\t }\n\t\n\t // Default values for optional parameters:\n\t var i;\n\t if (known_x === undefined) {\n\t known_x = [];\n\t for (i = 1; i <= known_y.length; i++) {\n\t known_x.push(i);\n\t }\n\t }\n\t if (new_x === undefined) {\n\t new_x = [];\n\t for (i = 1; i <= known_y.length; i++) {\n\t new_x.push(i);\n\t }\n\t }\n\t\n\t known_x = utils.parseNumberArray(known_x);\n\t new_x = utils.parseNumberArray(new_x);\n\t if (utils.anyIsError(known_x, new_x)) {\n\t return error.value;\n\t }\n\t\n\t\n\t if (use_const === undefined) {\n\t use_const = true;\n\t }\n\t\n\t // Calculate sums over the data:\n\t var n = known_y.length;\n\t var avg_x = 0;\n\t var avg_y = 0;\n\t var avg_xy = 0;\n\t var avg_xx = 0;\n\t for (i = 0; i < n; i++) {\n\t var x = known_x[i];\n\t var y = Math.log(known_y[i]);\n\t avg_x += x;\n\t avg_y += y;\n\t avg_xy += x * y;\n\t avg_xx += x * x;\n\t }\n\t avg_x /= n;\n\t avg_y /= n;\n\t avg_xy /= n;\n\t avg_xx /= n;\n\t\n\t // Compute linear regression coefficients:\n\t var beta;\n\t var alpha;\n\t if (use_const) {\n\t beta = (avg_xy - avg_x * avg_y) / (avg_xx - avg_x * avg_x);\n\t alpha = avg_y - beta * avg_x;\n\t } else {\n\t beta = avg_xy / avg_xx;\n\t alpha = 0;\n\t }\n\t\n\t // Compute and return result array:\n\t var new_y = [];\n\t for (i = 0; i < new_x.length; i++) {\n\t new_y.push(Math.exp(alpha + beta * new_x[i]));\n\t }\n\t return new_y;\n\t};\n\t\n\texports.HARMEAN = function() {\n\t var range = utils.parseNumberArray(utils.flatten(arguments));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t var n = range.length;\n\t var den = 0;\n\t for (var i = 0; i < n; i++) {\n\t den += 1 / range[i];\n\t }\n\t return n / den;\n\t};\n\t\n\texports.HYPGEOM = {};\n\t\n\texports.HYPGEOM.DIST = function(x, n, M, N, cumulative) {\n\t x = utils.parseNumber(x);\n\t n = utils.parseNumber(n);\n\t M = utils.parseNumber(M);\n\t N = utils.parseNumber(N);\n\t if (utils.anyIsError(x, n, M, N)) {\n\t return error.value;\n\t }\n\t\n\t function pdf(x, n, M, N) {\n\t return mathTrig.COMBIN(M, x) * mathTrig.COMBIN(N - M, n - x) / mathTrig.COMBIN(N, n);\n\t }\n\t\n\t function cdf(x, n, M, N) {\n\t var result = 0;\n\t for (var i = 0; i <= x; i++) {\n\t result += pdf(i, n, M, N);\n\t }\n\t return result;\n\t }\n\t\n\t return (cumulative) ? cdf(x, n, M, N) : pdf(x, n, M, N);\n\t};\n\t\n\texports.INTERCEPT = function(known_y, known_x) {\n\t known_y = utils.parseNumberArray(known_y);\n\t known_x = utils.parseNumberArray(known_x);\n\t if (utils.anyIsError(known_y, known_x)) {\n\t return error.value;\n\t }\n\t if (known_y.length !== known_x.length) {\n\t return error.na;\n\t }\n\t return exports.FORECAST(0, known_y, known_x);\n\t};\n\t\n\texports.KURT = function() {\n\t var range = utils.parseNumberArray(utils.flatten(arguments));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t var mean = jStat.mean(range);\n\t var n = range.length;\n\t var sigma = 0;\n\t for (var i = 0; i < n; i++) {\n\t sigma += Math.pow(range[i] - mean, 4);\n\t }\n\t sigma = sigma / Math.pow(jStat.stdev(range, true), 4);\n\t return ((n * (n + 1)) / ((n - 1) * (n - 2) * (n - 3))) * sigma - 3 * (n - 1) * (n - 1) / ((n - 2) * (n - 3));\n\t};\n\t\n\texports.LARGE = function(range, k) {\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t k = utils.parseNumber(k);\n\t if (utils.anyIsError(range, k)) {\n\t return range;\n\t }\n\t return range.sort(function(a, b) {\n\t return b - a;\n\t })[k - 1];\n\t};\n\t\n\texports.LINEST = function(data_y, data_x) {\n\t data_y = utils.parseNumberArray(utils.flatten(data_y));\n\t data_x = utils.parseNumberArray(utils.flatten(data_x));\n\t if (utils.anyIsError(data_y, data_x)) {\n\t return error.value;\n\t }\n\t var ymean = jStat.mean(data_y);\n\t var xmean = jStat.mean(data_x);\n\t var n = data_x.length;\n\t var num = 0;\n\t var den = 0;\n\t for (var i = 0; i < n; i++) {\n\t num += (data_x[i] - xmean) * (data_y[i] - ymean);\n\t den += Math.pow(data_x[i] - xmean, 2);\n\t }\n\t var m = num / den;\n\t var b = ymean - m * xmean;\n\t return [m, b];\n\t};\n\t\n\t// According to Microsoft:\n\t// http://office.microsoft.com/en-us/starter-help/logest-function-HP010342665.aspx\n\t// LOGEST returns are based on the following linear model:\n\t// ln y = x1 ln m1 + ... + xn ln mn + ln b\n\texports.LOGEST = function(data_y, data_x) {\n\t data_y = utils.parseNumberArray(utils.flatten(data_y));\n\t data_x = utils.parseNumberArray(utils.flatten(data_x));\n\t if (utils.anyIsError(data_y, data_x)) {\n\t return error.value;\n\t }\n\t for (var i = 0; i < data_y.length; i ++) {\n\t data_y[i] = Math.log(data_y[i]);\n\t }\n\t\n\t var result = exports.LINEST(data_y, data_x);\n\t result[0] = Math.round(Math.exp(result[0])*1000000)/1000000;\n\t result[1] = Math.round(Math.exp(result[1])*1000000)/1000000;\n\t return result;\n\t};\n\t\n\texports.LOGNORM = {};\n\t\n\texports.LOGNORM.DIST = function(x, mean, sd, cumulative) {\n\t x = utils.parseNumber(x);\n\t mean = utils.parseNumber(mean);\n\t sd = utils.parseNumber(sd);\n\t if (utils.anyIsError(x, mean, sd)) {\n\t return error.value;\n\t }\n\t return (cumulative) ? jStat.lognormal.cdf(x, mean, sd) : jStat.lognormal.pdf(x, mean, sd);\n\t};\n\t\n\texports.LOGNORM.INV = function(probability, mean, sd) {\n\t probability = utils.parseNumber(probability);\n\t mean = utils.parseNumber(mean);\n\t sd = utils.parseNumber(sd);\n\t if (utils.anyIsError(probability, mean, sd)) {\n\t return error.value;\n\t }\n\t return jStat.lognormal.inv(probability, mean, sd);\n\t};\n\t\n\texports.MAX = function() {\n\t var range = utils.numbers(utils.flatten(arguments));\n\t return (range.length === 0) ? 0 : Math.max.apply(Math, range);\n\t};\n\t\n\texports.MAXA = function() {\n\t var range = utils.arrayValuesToNumbers(utils.flatten(arguments));\n\t return (range.length === 0) ? 0 : Math.max.apply(Math, range);\n\t};\n\t\n\texports.MEDIAN = function() {\n\t var range = utils.arrayValuesToNumbers(utils.flatten(arguments));\n\t var result = jStat.median(range);\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.MIN = function() {\n\t var range = utils.numbers(utils.flatten(arguments));\n\t return (range.length === 0) ? 0 : Math.min.apply(Math, range);\n\t};\n\t\n\texports.MINA = function() {\n\t var range = utils.arrayValuesToNumbers(utils.flatten(arguments));\n\t return (range.length === 0) ? 0 : Math.min.apply(Math, range);\n\t};\n\t\n\texports.MODE = {};\n\t\n\texports.MODE.MULT = function() {\n\t // Credits: Roönaän\n\t var range = utils.parseNumberArray(utils.flatten(arguments));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t var n = range.length;\n\t var count = {};\n\t var maxItems = [];\n\t var max = 0;\n\t var currentItem;\n\t\n\t for (var i = 0; i < n; i++) {\n\t currentItem = range[i];\n\t count[currentItem] = count[currentItem] ? count[currentItem] + 1 : 1;\n\t if (count[currentItem] > max) {\n\t max = count[currentItem];\n\t maxItems = [];\n\t }\n\t if (count[currentItem] === max) {\n\t maxItems[maxItems.length] = currentItem;\n\t }\n\t }\n\t return maxItems;\n\t};\n\t\n\texports.MODE.SNGL = function() {\n\t var range = utils.parseNumberArray(utils.flatten(arguments));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t return exports.MODE.MULT(range).sort(function(a, b) {\n\t return a - b;\n\t })[0];\n\t};\n\t\n\texports.NEGBINOM = {};\n\t\n\texports.NEGBINOM.DIST = function(k, r, p, cumulative) {\n\t k = utils.parseNumber(k);\n\t r = utils.parseNumber(r);\n\t p = utils.parseNumber(p);\n\t if (utils.anyIsError(k, r, p)) {\n\t return error.value;\n\t }\n\t return (cumulative) ? jStat.negbin.cdf(k, r, p) : jStat.negbin.pdf(k, r, p);\n\t};\n\t\n\texports.NORM = {};\n\t\n\texports.NORM.DIST = function(x, mean, sd, cumulative) {\n\t x = utils.parseNumber(x);\n\t mean = utils.parseNumber(mean);\n\t sd = utils.parseNumber(sd);\n\t if (utils.anyIsError(x, mean, sd)) {\n\t return error.value;\n\t }\n\t if (sd <= 0) {\n\t return error.num;\n\t }\n\t\n\t // Return normal distribution computed by jStat [http://jstat.org]\n\t return (cumulative) ? jStat.normal.cdf(x, mean, sd) : jStat.normal.pdf(x, mean, sd);\n\t};\n\t\n\texports.NORM.INV = function(probability, mean, sd) {\n\t probability = utils.parseNumber(probability);\n\t mean = utils.parseNumber(mean);\n\t sd = utils.parseNumber(sd);\n\t if (utils.anyIsError(probability, mean, sd)) {\n\t return error.value;\n\t }\n\t return jStat.normal.inv(probability, mean, sd);\n\t};\n\t\n\texports.NORM.S = {};\n\t\n\texports.NORM.S.DIST = function(z, cumulative) {\n\t z = utils.parseNumber(z);\n\t if (z instanceof Error) {\n\t return error.value;\n\t }\n\t return (cumulative) ? jStat.normal.cdf(z, 0, 1) : jStat.normal.pdf(z, 0, 1);\n\t};\n\t\n\texports.NORM.S.INV = function(probability) {\n\t probability = utils.parseNumber(probability);\n\t if (probability instanceof Error) {\n\t return error.value;\n\t }\n\t return jStat.normal.inv(probability, 0, 1);\n\t};\n\t\n\texports.PEARSON = function(data_x, data_y) {\n\t data_y = utils.parseNumberArray(utils.flatten(data_y));\n\t data_x = utils.parseNumberArray(utils.flatten(data_x));\n\t if (utils.anyIsError(data_y, data_x)) {\n\t return error.value;\n\t }\n\t var xmean = jStat.mean(data_x);\n\t var ymean = jStat.mean(data_y);\n\t var n = data_x.length;\n\t var num = 0;\n\t var den1 = 0;\n\t var den2 = 0;\n\t for (var i = 0; i < n; i++) {\n\t num += (data_x[i] - xmean) * (data_y[i] - ymean);\n\t den1 += Math.pow(data_x[i] - xmean, 2);\n\t den2 += Math.pow(data_y[i] - ymean, 2);\n\t }\n\t return num / Math.sqrt(den1 * den2);\n\t};\n\t\n\texports.PERCENTILE = {};\n\t\n\texports.PERCENTILE.EXC = function(array, k) {\n\t array = utils.parseNumberArray(utils.flatten(array));\n\t k = utils.parseNumber(k);\n\t if (utils.anyIsError(array, k)) {\n\t return error.value;\n\t }\n\t array = array.sort(function(a, b) {\n\t {\n\t return a - b;\n\t }\n\t });\n\t var n = array.length;\n\t if (k < 1 / (n + 1) || k > 1 - 1 / (n + 1)) {\n\t return error.num;\n\t }\n\t var l = k * (n + 1) - 1;\n\t var fl = Math.floor(l);\n\t return utils.cleanFloat((l === fl) ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]));\n\t};\n\t\n\texports.PERCENTILE.INC = function(array, k) {\n\t array = utils.parseNumberArray(utils.flatten(array));\n\t k = utils.parseNumber(k);\n\t if (utils.anyIsError(array, k)) {\n\t return error.value;\n\t }\n\t array = array.sort(function(a, b) {\n\t return a - b;\n\t });\n\t var n = array.length;\n\t var l = k * (n - 1);\n\t var fl = Math.floor(l);\n\t return utils.cleanFloat((l === fl) ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]));\n\t};\n\t\n\texports.PERCENTRANK = {};\n\t\n\texports.PERCENTRANK.EXC = function(array, x, significance) {\n\t significance = (significance === undefined) ? 3 : significance;\n\t array = utils.parseNumberArray(utils.flatten(array));\n\t x = utils.parseNumber(x);\n\t significance = utils.parseNumber(significance);\n\t if (utils.anyIsError(array, x, significance)) {\n\t return error.value;\n\t }\n\t array = array.sort(function(a, b) {\n\t return a - b;\n\t });\n\t var uniques = misc.UNIQUE.apply(null, array);\n\t var n = array.length;\n\t var m = uniques.length;\n\t var power = Math.pow(10, significance);\n\t var result = 0;\n\t var match = false;\n\t var i = 0;\n\t while (!match && i < m) {\n\t if (x === uniques[i]) {\n\t result = (array.indexOf(uniques[i]) + 1) / (n + 1);\n\t match = true;\n\t } else if (x >= uniques[i] && (x < uniques[i + 1] || i === m - 1)) {\n\t result = (array.indexOf(uniques[i]) + 1 + (x - uniques[i]) / (uniques[i + 1] - uniques[i])) / (n + 1);\n\t match = true;\n\t }\n\t i++;\n\t }\n\t return Math.floor(result * power) / power;\n\t};\n\t\n\texports.PERCENTRANK.INC = function(array, x, significance) {\n\t significance = (significance === undefined) ? 3 : significance;\n\t array = utils.parseNumberArray(utils.flatten(array));\n\t x = utils.parseNumber(x);\n\t significance = utils.parseNumber(significance);\n\t if (utils.anyIsError(array, x, significance)) {\n\t return error.value;\n\t }\n\t array = array.sort(function(a, b) {\n\t return a - b;\n\t });\n\t var uniques = misc.UNIQUE.apply(null, array);\n\t var n = array.length;\n\t var m = uniques.length;\n\t var power = Math.pow(10, significance);\n\t var result = 0;\n\t var match = false;\n\t var i = 0;\n\t while (!match && i < m) {\n\t if (x === uniques[i]) {\n\t result = array.indexOf(uniques[i]) / (n - 1);\n\t match = true;\n\t } else if (x >= uniques[i] && (x < uniques[i + 1] || i === m - 1)) {\n\t result = (array.indexOf(uniques[i]) + (x - uniques[i]) / (uniques[i + 1] - uniques[i])) / (n - 1);\n\t match = true;\n\t }\n\t i++;\n\t }\n\t return Math.floor(result * power) / power;\n\t};\n\t\n\texports.PERMUT = function(number, number_chosen) {\n\t number = utils.parseNumber(number);\n\t number_chosen = utils.parseNumber(number_chosen);\n\t if (utils.anyIsError(number, number_chosen)) {\n\t return error.value;\n\t }\n\t return mathTrig.FACT(number) / mathTrig.FACT(number - number_chosen);\n\t};\n\t\n\texports.PERMUTATIONA = function(number, number_chosen) {\n\t number = utils.parseNumber(number);\n\t number_chosen = utils.parseNumber(number_chosen);\n\t if (utils.anyIsError(number, number_chosen)) {\n\t return error.value;\n\t }\n\t return Math.pow(number, number_chosen);\n\t};\n\t\n\texports.PHI = function(x) {\n\t x = utils.parseNumber(x);\n\t if (x instanceof Error) {\n\t return error.value;\n\t }\n\t return Math.exp(-0.5 * x * x) / SQRT2PI;\n\t};\n\t\n\texports.POISSON = {};\n\t\n\texports.POISSON.DIST = function(x, mean, cumulative) {\n\t x = utils.parseNumber(x);\n\t mean = utils.parseNumber(mean);\n\t if (utils.anyIsError(x, mean)) {\n\t return error.value;\n\t }\n\t return (cumulative) ? jStat.poisson.cdf(x, mean) : jStat.poisson.pdf(x, mean);\n\t};\n\t\n\texports.PROB = function(range, probability, lower, upper) {\n\t if (lower === undefined) {\n\t return 0;\n\t }\n\t upper = (upper === undefined) ? lower : upper;\n\t\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t probability = utils.parseNumberArray(utils.flatten(probability));\n\t lower = utils.parseNumber(lower);\n\t upper = utils.parseNumber(upper);\n\t if (utils.anyIsError(range, probability, lower, upper)) {\n\t return error.value;\n\t }\n\t\n\t if (lower === upper) {\n\t return (range.indexOf(lower) >= 0) ? probability[range.indexOf(lower)] : 0;\n\t }\n\t\n\t var sorted = range.sort(function(a, b) {\n\t return a - b;\n\t });\n\t var n = sorted.length;\n\t var result = 0;\n\t for (var i = 0; i < n; i++) {\n\t if (sorted[i] >= lower && sorted[i] <= upper) {\n\t result += probability[range.indexOf(sorted[i])];\n\t }\n\t }\n\t return result;\n\t};\n\t\n\texports.QUARTILE = {};\n\t\n\texports.QUARTILE.EXC = function(range, quart) {\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t quart = utils.parseNumber(quart);\n\t if (utils.anyIsError(range, quart)) {\n\t return error.value;\n\t }\n\t switch (quart) {\n\t case 1:\n\t return exports.PERCENTILE.EXC(range, 0.25);\n\t case 2:\n\t return exports.PERCENTILE.EXC(range, 0.5);\n\t case 3:\n\t return exports.PERCENTILE.EXC(range, 0.75);\n\t default:\n\t return error.num;\n\t }\n\t};\n\t\n\texports.QUARTILE.INC = function(range, quart) {\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t quart = utils.parseNumber(quart);\n\t if (utils.anyIsError(range, quart)) {\n\t return error.value;\n\t }\n\t switch (quart) {\n\t case 1:\n\t return exports.PERCENTILE.INC(range, 0.25);\n\t case 2:\n\t return exports.PERCENTILE.INC(range, 0.5);\n\t case 3:\n\t return exports.PERCENTILE.INC(range, 0.75);\n\t default:\n\t return error.num;\n\t }\n\t};\n\t\n\texports.RANK = {};\n\t\n\texports.RANK.AVG = function(number, range, order) {\n\t number = utils.parseNumber(number);\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t if (utils.anyIsError(number, range)) {\n\t return error.value;\n\t }\n\t range = utils.flatten(range);\n\t order = order || false;\n\t var sort = (order) ? function(a, b) {\n\t return a - b;\n\t } : function(a, b) {\n\t return b - a;\n\t };\n\t range = range.sort(sort);\n\t\n\t var length = range.length;\n\t var count = 0;\n\t for (var i = 0; i < length; i++) {\n\t if (range[i] === number) {\n\t count++;\n\t }\n\t }\n\t\n\t return (count > 1) ? (2 * range.indexOf(number) + count + 1) / 2 : range.indexOf(number) + 1;\n\t};\n\t\n\texports.RANK.EQ = function(number, range, order) {\n\t number = utils.parseNumber(number);\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t if (utils.anyIsError(number, range)) {\n\t return error.value;\n\t }\n\t order = order || false;\n\t var sort = (order) ? function(a, b) {\n\t return a - b;\n\t } : function(a, b) {\n\t return b - a;\n\t };\n\t range = range.sort(sort);\n\t return range.indexOf(number) + 1;\n\t};\n\t\n\texports.ROW = function(matrix, index) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t if (index < 0) {\n\t return error.num;\n\t }\n\t\n\t if (!(matrix instanceof Array) || (typeof index !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t if (matrix.length === 0) {\n\t return undefined;\n\t }\n\t\n\t return jStat.row(matrix, index);\n\t};\n\t\n\texports.ROWS = function(matrix) {\n\t if (arguments.length !== 1) {\n\t return error.na;\n\t }\n\t\n\t if (!(matrix instanceof Array)) {\n\t return error.value;\n\t }\n\t\n\t if (matrix.length === 0) {\n\t return 0;\n\t }\n\t\n\t return jStat.rows(matrix);\n\t};\n\t\n\texports.RSQ = function(data_x, data_y) { // no need to flatten here, PEARSON will take care of that\n\t data_x = utils.parseNumberArray(utils.flatten(data_x));\n\t data_y = utils.parseNumberArray(utils.flatten(data_y));\n\t if (utils.anyIsError(data_x, data_y)) {\n\t return error.value;\n\t }\n\t return Math.pow(exports.PEARSON(data_x, data_y), 2);\n\t};\n\t\n\texports.SKEW = function() {\n\t var range = utils.parseNumberArray(utils.flatten(arguments));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t var mean = jStat.mean(range);\n\t var n = range.length;\n\t var sigma = 0;\n\t for (var i = 0; i < n; i++) {\n\t sigma += Math.pow(range[i] - mean, 3);\n\t }\n\t return n * sigma / ((n - 1) * (n - 2) * Math.pow(jStat.stdev(range, true), 3));\n\t};\n\t\n\texports.SKEW.P = function() {\n\t var range = utils.parseNumberArray(utils.flatten(arguments));\n\t if (range instanceof Error) {\n\t return range;\n\t }\n\t var mean = jStat.mean(range);\n\t var n = range.length;\n\t var m2 = 0;\n\t var m3 = 0;\n\t for (var i = 0; i < n; i++) {\n\t m3 += Math.pow(range[i] - mean, 3);\n\t m2 += Math.pow(range[i] - mean, 2);\n\t }\n\t m3 = m3 / n;\n\t m2 = m2 / n;\n\t return m3 / Math.pow(m2, 3 / 2);\n\t};\n\t\n\texports.SLOPE = function(data_y, data_x) {\n\t data_y = utils.parseNumberArray(utils.flatten(data_y));\n\t data_x = utils.parseNumberArray(utils.flatten(data_x));\n\t if (utils.anyIsError(data_y, data_x)) {\n\t return error.value;\n\t }\n\t var xmean = jStat.mean(data_x);\n\t var ymean = jStat.mean(data_y);\n\t var n = data_x.length;\n\t var num = 0;\n\t var den = 0;\n\t for (var i = 0; i < n; i++) {\n\t num += (data_x[i] - xmean) * (data_y[i] - ymean);\n\t den += Math.pow(data_x[i] - xmean, 2);\n\t }\n\t return num / den;\n\t};\n\t\n\texports.SMALL = function(range, k) {\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t k = utils.parseNumber(k);\n\t if (utils.anyIsError(range, k)) {\n\t return range;\n\t }\n\t return range.sort(function(a, b) {\n\t return a - b;\n\t })[k - 1];\n\t};\n\t\n\texports.STANDARDIZE = function(x, mean, sd) {\n\t x = utils.parseNumber(x);\n\t mean = utils.parseNumber(mean);\n\t sd = utils.parseNumber(sd);\n\t if (utils.anyIsError(x, mean, sd)) {\n\t return error.value;\n\t }\n\t return (x - mean) / sd;\n\t};\n\t\n\texports.STDEV = {};\n\t\n\texports.STDEV.P = function() {\n\t var v = exports.VAR.P.apply(this, arguments);\n\t var result = Math.sqrt(v);\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.STDEV.S = function() {\n\t var v = exports.VAR.S.apply(this, arguments);\n\t var result = Math.sqrt(v);\n\t\n\t return result;\n\t};\n\t\n\texports.STDEVA = function() {\n\t var v = exports.VARA.apply(this, arguments);\n\t var result = Math.sqrt(v);\n\t\n\t return result;\n\t};\n\t\n\texports.STDEVPA = function() {\n\t var v = exports.VARPA.apply(this, arguments);\n\t var result = Math.sqrt(v);\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\t\n\texports.STEYX = function(data_y, data_x) {\n\t data_y = utils.parseNumberArray(utils.flatten(data_y));\n\t data_x = utils.parseNumberArray(utils.flatten(data_x));\n\t if (utils.anyIsError(data_y, data_x)) {\n\t return error.value;\n\t }\n\t var xmean = jStat.mean(data_x);\n\t var ymean = jStat.mean(data_y);\n\t var n = data_x.length;\n\t var lft = 0;\n\t var num = 0;\n\t var den = 0;\n\t for (var i = 0; i < n; i++) {\n\t lft += Math.pow(data_y[i] - ymean, 2);\n\t num += (data_x[i] - xmean) * (data_y[i] - ymean);\n\t den += Math.pow(data_x[i] - xmean, 2);\n\t }\n\t return Math.sqrt((lft - num * num / den) / (n - 2));\n\t};\n\t\n\texports.TRANSPOSE = function(matrix) {\n\t if (!matrix) {\n\t return error.na;\n\t }\n\t return jStat.transpose(matrix);\n\t};\n\t\n\texports.T = text.T;\n\t\n\texports.T.DIST = function(x, df, cumulative) {\n\t x = utils.parseNumber(x);\n\t df = utils.parseNumber(df);\n\t if (utils.anyIsError(x, df)) {\n\t return error.value;\n\t }\n\t return (cumulative) ? jStat.studentt.cdf(x, df) : jStat.studentt.pdf(x, df);\n\t};\n\t\n\texports.T.DIST['2T'] = function(x, df) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t if (x < 0 || df < 1) {\n\t return error.num;\n\t }\n\t\n\t if ((typeof x !== 'number') || (typeof df !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t return (1 - jStat.studentt.cdf(x , df)) * 2;\n\t};\n\t\n\texports.T.DIST.RT = function(x, df) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t\n\t if (x < 0 || df < 1) {\n\t return error.num;\n\t }\n\t\n\t if ((typeof x !== 'number') || (typeof df !== 'number')) {\n\t return error.value;\n\t }\n\t\n\t return 1 - jStat.studentt.cdf(x , df);\n\t};\n\t\n\texports.T.INV = function(probability, df) {\n\t probability = utils.parseNumber(probability);\n\t df = utils.parseNumber(df);\n\t if (utils.anyIsError(probability, df)) {\n\t return error.value;\n\t }\n\t return jStat.studentt.inv(probability, df);\n\t};\n\t\n\texports.T.INV['2T'] = function(probability, df) {\n\t probability = utils.parseNumber(probability);\n\t df = utils.parseNumber(df);\n\t if (probability <= 0 || probability > 1 || df < 1) {\n\t return error.num;\n\t }\n\t if (utils.anyIsError(probability, df)) {\n\t return error.value;\n\t }\n\t return Math.abs(jStat.studentt.inv(probability/2, df));\n\t};\n\t\n\t// The algorithm can be found here:\n\t// http://www.chem.uoa.gr/applets/AppletTtest/Appl_Ttest2.html\n\texports.T.TEST = function(data_x, data_y) {\n\t data_x = utils.parseNumberArray(utils.flatten(data_x));\n\t data_y = utils.parseNumberArray(utils.flatten(data_y));\n\t if (utils.anyIsError(data_x, data_y)) {\n\t return error.value;\n\t }\n\t\n\t var mean_x = jStat.mean(data_x);\n\t var mean_y = jStat.mean(data_y);\n\t var s_x = 0;\n\t var s_y = 0;\n\t var i;\n\t\n\t for (i = 0; i < data_x.length; i++) {\n\t s_x += Math.pow(data_x[i] - mean_x, 2);\n\t }\n\t for (i = 0; i < data_y.length; i++) {\n\t s_y += Math.pow(data_y[i] - mean_y, 2);\n\t }\n\t\n\t s_x = s_x / (data_x.length-1);\n\t s_y = s_y / (data_y.length-1);\n\t\n\t var t = Math.abs(mean_x - mean_y) / Math.sqrt(s_x/data_x.length + s_y/data_y.length);\n\t\n\t return exports.T.DIST['2T'](t, data_x.length+data_y.length-2);\n\t};\n\t\n\texports.TREND = function(data_y, data_x, new_data_x) {\n\t data_y = utils.parseNumberArray(utils.flatten(data_y));\n\t data_x = utils.parseNumberArray(utils.flatten(data_x));\n\t new_data_x = utils.parseNumberArray(utils.flatten(new_data_x));\n\t if (utils.anyIsError(data_y, data_x, new_data_x)) {\n\t return error.value;\n\t }\n\t var linest = exports.LINEST(data_y, data_x);\n\t var m = linest[0];\n\t var b = linest[1];\n\t var result = [];\n\t\n\t new_data_x.forEach(function(x) {\n\t result.push(m * x + b);\n\t });\n\t\n\t return result;\n\t};\n\t\n\texports.TRIMMEAN = function(range, percent) {\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t percent = utils.parseNumber(percent);\n\t if (utils.anyIsError(range, percent)) {\n\t return error.value;\n\t }\n\t var trim = mathTrig.FLOOR(range.length * percent, 2) / 2;\n\t return jStat.mean(utils.initial(utils.rest(range.sort(function(a, b) {\n\t return a - b;\n\t }), trim), trim));\n\t};\n\t\n\texports.VAR = {};\n\t\n\texports.VAR.P = function() {\n\t var range = utils.numbers(utils.flatten(arguments));\n\t var n = range.length;\n\t var sigma = 0;\n\t var mean = exports.AVERAGE(range);\n\t var result;\n\t for (var i = 0; i < n; i++) {\n\t sigma += Math.pow(range[i] - mean, 2);\n\t }\n\t result = sigma / n;\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.VAR.S = function() {\n\t var range = utils.numbers(utils.flatten(arguments));\n\t var n = range.length;\n\t var sigma = 0;\n\t var mean = exports.AVERAGE(range);\n\t for (var i = 0; i < n; i++) {\n\t sigma += Math.pow(range[i] - mean, 2);\n\t }\n\t return sigma / (n - 1);\n\t};\n\t\n\texports.VARA = function() {\n\t var range = utils.flatten(arguments);\n\t var n = range.length;\n\t var sigma = 0;\n\t var count = 0;\n\t var mean = exports.AVERAGEA(range);\n\t for (var i = 0; i < n; i++) {\n\t var el = range[i];\n\t if (typeof el === 'number') {\n\t sigma += Math.pow(el - mean, 2);\n\t } else if (el === true) {\n\t sigma += Math.pow(1 - mean, 2);\n\t } else {\n\t sigma += Math.pow(0 - mean, 2);\n\t }\n\t\n\t if (el !== null) {\n\t count++;\n\t }\n\t }\n\t return sigma / (count - 1);\n\t};\n\t\n\texports.VARPA = function() {\n\t var range = utils.flatten(arguments);\n\t var n = range.length;\n\t var sigma = 0;\n\t var count = 0;\n\t var mean = exports.AVERAGEA(range);\n\t var result;\n\t for (var i = 0; i < n; i++) {\n\t var el = range[i];\n\t if (typeof el === 'number') {\n\t sigma += Math.pow(el - mean, 2);\n\t } else if (el === true) {\n\t sigma += Math.pow(1 - mean, 2);\n\t } else {\n\t sigma += Math.pow(0 - mean, 2);\n\t }\n\t\n\t if (el !== null) {\n\t count++;\n\t }\n\t }\n\t result = sigma / count;;\n\t\n\t if (isNaN(result)) {\n\t result = error.num;\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.WEIBULL = {};\n\t\n\texports.WEIBULL.DIST = function(x, alpha, beta, cumulative) {\n\t x = utils.parseNumber(x);\n\t alpha = utils.parseNumber(alpha);\n\t beta = utils.parseNumber(beta);\n\t if (utils.anyIsError(x, alpha, beta)) {\n\t return error.value;\n\t }\n\t return (cumulative) ? 1 - Math.exp(-Math.pow(x / beta, alpha)) : Math.pow(x, alpha - 1) * Math.exp(-Math.pow(x / beta, alpha)) * alpha / Math.pow(beta, alpha);\n\t};\n\t\n\texports.Z = {};\n\t\n\texports.Z.TEST = function(range, x, sd) {\n\t range = utils.parseNumberArray(utils.flatten(range));\n\t x = utils.parseNumber(x);\n\t if (utils.anyIsError(range, x)) {\n\t return error.value;\n\t }\n\t\n\t sd = sd || exports.STDEV.S(range);\n\t var n = range.length;\n\t return 1 - exports.NORM.S.DIST((exports.AVERAGE(range) - x) / (sd / Math.sqrt(n)), true);\n\t};\n\n\n/***/ },\n/* 18 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar utils = __webpack_require__(15);\n\tvar error = __webpack_require__(16);\n\tvar numbro = __webpack_require__(19);\n\t\n\t//TODO\n\texports.ASC = function() {\n\t throw new Error('ASC is not implemented');\n\t};\n\t\n\t//TODO\n\texports.BAHTTEXT = function() {\n\t throw new Error('BAHTTEXT is not implemented');\n\t};\n\t\n\texports.CHAR = function(number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return String.fromCharCode(number);\n\t};\n\t\n\texports.CLEAN = function(text) {\n\t text = text || '';\n\t var re = /[\\0-\\x1F]/g;\n\t return text.replace(re, \"\");\n\t};\n\t\n\texports.CODE = function(text) {\n\t text = text || '';\n\t var result = text.charCodeAt(0);\n\t\n\t if (isNaN(result)) {\n\t result = error.na;\n\t }\n\t return result;\n\t};\n\t\n\texports.CONCATENATE = function() {\n\t var args = utils.flatten(arguments);\n\t\n\t var trueFound = 0;\n\t while ((trueFound = args.indexOf(true)) > -1) {\n\t args[trueFound] = 'TRUE';\n\t }\n\t\n\t var falseFound = 0;\n\t while ((falseFound = args.indexOf(false)) > -1) {\n\t args[falseFound] = 'FALSE';\n\t }\n\t\n\t return args.join('');\n\t};\n\t\n\t//TODO\n\texports.DBCS = function() {\n\t throw new Error('DBCS is not implemented');\n\t};\n\t\n\texports.DOLLAR = function(number, decimals) {\n\t decimals = (decimals === undefined) ? 2 : decimals;\n\t\n\t number = utils.parseNumber(number);\n\t decimals = utils.parseNumber(decimals);\n\t if (utils.anyIsError(number, decimals)) {\n\t return error.value;\n\t }\n\t var format = '';\n\t if (decimals <= 0) {\n\t number = Math.round(number * Math.pow(10, decimals)) / Math.pow(10, decimals);\n\t format = '($0,0)';\n\t } else if (decimals > 0) {\n\t format = '($0,0.' + new Array(decimals + 1).join('0') + ')';\n\t }\n\t return numbro(number).format(format);\n\t};\n\t\n\texports.EXACT = function(text1, text2) {\n\t if (arguments.length !== 2) {\n\t return error.na;\n\t }\n\t return text1 === text2;\n\t};\n\t\n\texports.FIND = function(find_text, within_text, position) {\n\t if (arguments.length < 2) {\n\t return error.na;\n\t }\n\t position = (position === undefined) ? 0 : position;\n\t return within_text ? within_text.indexOf(find_text, position - 1) + 1 : null;\n\t};\n\t\n\texports.FIXED = function(number, decimals, no_commas) {\n\t decimals = (decimals === undefined) ? 2 : decimals;\n\t no_commas = (no_commas === undefined) ? false : no_commas;\n\t\n\t number = utils.parseNumber(number);\n\t decimals = utils.parseNumber(decimals);\n\t if (utils.anyIsError(number, decimals)) {\n\t return error.value;\n\t }\n\t\n\t var format = no_commas ? '0' : '0,0';\n\t if (decimals <= 0) {\n\t number = Math.round(number * Math.pow(10, decimals)) / Math.pow(10, decimals);\n\t } else if (decimals > 0) {\n\t format += '.' + new Array(decimals + 1).join('0');\n\t }\n\t return numbro(number).format(format);\n\t};\n\t\n\texports.HTML2TEXT = function (value) {\n\t var result = '';\n\t\n\t if (value) {\n\t if (value instanceof Array) {\n\t value.forEach(function (line) {\n\t if (result !== '') {\n\t result += '\\n';\n\t }\n\t result += (line.replace(/<(?:.|\\n)*?>/gm, ''));\n\t });\n\t } else {\n\t result = value.replace(/<(?:.|\\n)*?>/gm, '');\n\t }\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.LEFT = function(text, number) {\n\t number = (number === undefined) ? 1 : number;\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error || typeof text !== 'string') {\n\t return error.value;\n\t }\n\t return text ? text.substring(0, number) : null;\n\t};\n\t\n\texports.LEN = function(text) {\n\t if (arguments.length === 0) {\n\t return error.error;\n\t }\n\t\n\t if (typeof text === 'string') {\n\t return text ? text.length : 0;\n\t }\n\t\n\t if (text.length) {\n\t return text.length;\n\t }\n\t\n\t return error.value;\n\t};\n\t\n\texports.LOWER = function(text) {\n\t if (typeof text !== 'string') {\n\t return error.value;\n\t }\n\t return text ? text.toLowerCase() : text;\n\t};\n\t\n\texports.MID = function(text, start, number) {\n\t start = utils.parseNumber(start);\n\t number = utils.parseNumber(number);\n\t if (utils.anyIsError(start, number) || typeof text !== 'string') {\n\t return number;\n\t }\n\t\n\t var begin = start - 1;\n\t var end = begin + number;\n\t\n\t return text.substring(begin, end);\n\t};\n\t\n\t// TODO\n\texports.NUMBERVALUE = function (text, decimal_separator, group_separator) {\n\t decimal_separator = (typeof decimal_separator === 'undefined') ? '.' : decimal_separator;\n\t group_separator = (typeof group_separator === 'undefined') ? ',' : group_separator;\n\t return Number(text.replace(decimal_separator, '.').replace(group_separator, ''));\n\t};\n\t\n\t// TODO\n\texports.PRONETIC = function() {\n\t throw new Error('PRONETIC is not implemented');\n\t};\n\t\n\texports.PROPER = function(text) {\n\t if (text === undefined || text.length === 0) {\n\t return error.value;\n\t }\n\t if (text === true) {\n\t text = 'TRUE';\n\t }\n\t if (text === false) {\n\t text = 'FALSE';\n\t }\n\t if (isNaN(text) && typeof text === 'number') {\n\t return error.value;\n\t }\n\t if (typeof text === 'number') {\n\t text = '' + text;\n\t }\n\t\n\t return text.replace(/\\w\\S*/g, function(txt) {\n\t return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n\t });\n\t};\n\t\n\texports.REGEXEXTRACT = function (text, regular_expression) {\n\t if (arguments.length < 2) {\n\t return error.na;\n\t }\n\t var match = text.match(new RegExp(regular_expression));\n\t return match ? (match[match.length > 1 ? match.length - 1 : 0]) : null;\n\t};\n\t\n\texports.REGEXMATCH = function (text, regular_expression, full) {\n\t if (arguments.length < 2) {\n\t return error.na;\n\t }\n\t var match = text.match(new RegExp(regular_expression));\n\t return full ? match : !!match;\n\t};\n\t\n\texports.REGEXREPLACE = function (text, regular_expression, replacement) {\n\t if (arguments.length < 3) {\n\t return error.na;\n\t }\n\t return text.replace(new RegExp(regular_expression), replacement);\n\t};\n\t\n\texports.REPLACE = function(text, position, length, new_text) {\n\t position = utils.parseNumber(position);\n\t length = utils.parseNumber(length);\n\t if (utils.anyIsError(position, length) ||\n\t typeof text !== 'string' ||\n\t typeof new_text !== 'string') {\n\t return error.value;\n\t }\n\t return text.substr(0, position - 1) + new_text + text.substr(position - 1 + length);\n\t};\n\t\n\texports.REPT = function(text, number) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return new Array(number + 1).join(text);\n\t};\n\t\n\texports.RIGHT = function(text, number) {\n\t number = (number === undefined) ? 1 : number;\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t return text ? text.substring(text.length - number) : error.na;\n\t};\n\t\n\texports.SEARCH = function(find_text, within_text, position) {\n\t var foundAt;\n\t if (typeof find_text !== 'string' || typeof within_text !== 'string') {\n\t return error.value;\n\t }\n\t position = (position === undefined) ? 0 : position;\n\t foundAt = within_text.toLowerCase().indexOf(find_text.toLowerCase(), position - 1)+1;\n\t return (foundAt === 0)?error.value:foundAt;\n\t};\n\t\n\texports.SPLIT = function (text, separator) {\n\t return text.split(separator);\n\t};\n\t\n\texports.SUBSTITUTE = function(text, old_text, new_text, occurrence) {\n\t if (arguments.length < 2) {\n\t return error.na;\n\t }\n\t if (!text || !old_text || !new_text) {\n\t return text;\n\t } else if (occurrence === undefined) {\n\t return text.replace(new RegExp(old_text, 'g'), new_text);\n\t } else {\n\t var index = 0;\n\t var i = 0;\n\t while (text.indexOf(old_text, index) > 0) {\n\t index = text.indexOf(old_text, index + 1);\n\t i++;\n\t if (i === occurrence) {\n\t return text.substring(0, index) + new_text + text.substring(index + old_text.length);\n\t }\n\t }\n\t }\n\t};\n\t\n\texports.T = function(value) {\n\t return (typeof value === \"string\") ? value : '';\n\t};\n\t\n\t// TODO incomplete implementation\n\texports.TEXT = function(value, format) {\n\t value = utils.parseNumber(value);\n\t if (utils.anyIsError(value)) {\n\t return error.na;\n\t }\n\t\n\t return numbro(value).format(format);\n\t};\n\t\n\texports.TRIM = function(text) {\n\t if (typeof text !== 'string') {\n\t return error.value;\n\t }\n\t return text.replace(/ +/g, ' ').trim();\n\t};\n\t\n\texports.UNICHAR = exports.CHAR;\n\t\n\texports.UNICODE = exports.CODE;\n\t\n\texports.UPPER = function(text) {\n\t if (typeof text !== 'string') {\n\t return error.value;\n\t }\n\t return text.toUpperCase();\n\t};\n\t\n\texports.VALUE = function(text) {\n\t if (typeof text !== 'string') {\n\t return error.value;\n\t }\n\t var result = numbro().unformat(text);\n\t\n\t return result === void 0 ? 0 : result;\n\t};\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(process) {/*!\n\t * numbro.js\n\t * version : 1.9.3\n\t * author : Företagsplatsen AB\n\t * license : MIT\n\t * http://www.foretagsplatsen.se\n\t */\n\t\n\t(function () {\n\t 'use strict';\n\t\n\t /************************************\n\t Constants\n\t ************************************/\n\t\n\t var numbro,\n\t VERSION = '1.9.3',\n\t binarySuffixes = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'],\n\t decimalSuffixes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],\n\t bytes = {\n\t general: { scale: 1024, suffixes: decimalSuffixes, marker: 'bd' },\n\t binary: { scale: 1024, suffixes: binarySuffixes, marker: 'b' },\n\t decimal: { scale: 1000, suffixes: decimalSuffixes, marker: 'd' }\n\t },\n\t // general must be before the others because it reuses their characters!\n\t byteFormatOrder = [ bytes.general, bytes.binary, bytes.decimal ],\n\t // internal storage for culture config files\n\t cultures = {},\n\t // Todo: Remove in 2.0.0\n\t languages = cultures,\n\t currentCulture = 'en-US',\n\t zeroFormat = null,\n\t defaultFormat = '0,0',\n\t defaultCurrencyFormat = '0$',\n\t // check for nodeJS\n\t hasModule = (typeof module !== 'undefined' && module.exports),\n\t // default culture\n\t enUS = {\n\t delimiters: {\n\t thousands: ',',\n\t decimal: '.'\n\t },\n\t abbreviations: {\n\t thousand: 'k',\n\t million: 'm',\n\t billion: 'b',\n\t trillion: 't'\n\t },\n\t ordinal: function(number) {\n\t var b = number % 10;\n\t return (~~(number % 100 / 10) === 1) ? 'th' :\n\t (b === 1) ? 'st' :\n\t (b === 2) ? 'nd' :\n\t (b === 3) ? 'rd' : 'th';\n\t },\n\t currency: {\n\t symbol: '$',\n\t position: 'prefix'\n\t },\n\t defaults: {\n\t currencyFormat: ',0000 a'\n\t },\n\t formats: {\n\t fourDigits: '0000 a',\n\t fullWithTwoDecimals: '$ ,0.00',\n\t fullWithTwoDecimalsNoCurrency: ',0.00'\n\t }\n\t };\n\t\n\t /************************************\n\t Constructors\n\t ************************************/\n\t\n\t\n\t // Numbro prototype object\n\t function Numbro(number) {\n\t this._value = number;\n\t }\n\t\n\t function zeroes(count) {\n\t var i, ret = '';\n\t\n\t for (i = 0; i < count; i++) {\n\t ret += '0';\n\t }\n\t\n\t return ret;\n\t }\n\t /**\n\t * Implementation of toFixed() for numbers with exponents\n\t * This function may return negative representations for zero values e.g. \"-0.0\"\n\t */\n\t function toFixedLargeSmall(value, precision) {\n\t var mantissa,\n\t beforeDec,\n\t afterDec,\n\t exponent,\n\t prefix,\n\t endStr,\n\t zerosStr,\n\t str;\n\t\n\t str = value.toString();\n\t\n\t mantissa = str.split('e')[0];\n\t exponent = str.split('e')[1];\n\t\n\t beforeDec = mantissa.split('.')[0];\n\t afterDec = mantissa.split('.')[1] || '';\n\t\n\t if (+exponent > 0) {\n\t // exponent is positive - add zeros after the numbers\n\t str = beforeDec + afterDec + zeroes(exponent - afterDec.length);\n\t } else {\n\t // exponent is negative\n\t\n\t if (+beforeDec < 0) {\n\t prefix = '-0';\n\t } else {\n\t prefix = '0';\n\t }\n\t\n\t // tack on the decimal point if needed\n\t if (precision > 0) {\n\t prefix += '.';\n\t }\n\t\n\t zerosStr = zeroes((-1 * exponent) - 1);\n\t // substring off the end to satisfy the precision\n\t endStr = (zerosStr + Math.abs(beforeDec) + afterDec).substr(0, precision);\n\t str = prefix + endStr;\n\t }\n\t\n\t // only add percision 0's if the exponent is positive\n\t if (+exponent > 0 && precision > 0) {\n\t str += '.' + zeroes(precision);\n\t }\n\t\n\t return str;\n\t }\n\t\n\t /**\n\t * Implementation of toFixed() that treats floats more like decimals\n\t *\n\t * Fixes binary rounding issues (eg. (0.615).toFixed(2) === '0.61') that present\n\t * problems for accounting- and finance-related software.\n\t *\n\t * Also removes negative signs for zero-formatted numbers. e.g. -0.01 w/ precision 1 -> 0.0\n\t */\n\t function toFixed(value, precision, roundingFunction, optionals) {\n\t var power = Math.pow(10, precision),\n\t optionalsRegExp,\n\t output;\n\t\n\t if (value.toString().indexOf('e') > -1) {\n\t // toFixed returns scientific notation for numbers above 1e21 and below 1e-7\n\t output = toFixedLargeSmall(value, precision);\n\t // remove the leading negative sign if it exists and should not be present (e.g. -0.00)\n\t if (output.charAt(0) === '-' && +output >= 0) {\n\t output = output.substr(1); // chop off the '-'\n\t }\n\t }\n\t else {\n\t // Multiply up by precision, round accurately, then divide and use native toFixed():\n\t output = (roundingFunction(value + 'e+' + precision) / power).toFixed(precision);\n\t }\n\t\n\t if (optionals) {\n\t optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n\t output = output.replace(optionalsRegExp, '');\n\t }\n\t\n\t return output;\n\t }\n\t\n\t /************************************\n\t Formatting\n\t ************************************/\n\t\n\t // determine what type of formatting we need to do\n\t function formatNumbro(n, format, roundingFunction) {\n\t var output,\n\t escapedFormat = format.replace(/\\{[^\\{\\}]*\\}/g, '');\n\t\n\t // figure out what kind of format we are dealing with\n\t if (escapedFormat.indexOf('$') > -1) { // currency!!!!!\n\t output = formatCurrency(n, cultures[currentCulture].currency.symbol, format, roundingFunction);\n\t } else if (escapedFormat.indexOf('%') > -1) { // percentage\n\t output = formatPercentage(n, format, roundingFunction);\n\t } else if (escapedFormat.indexOf(':') > -1) { // time\n\t output = formatTime(n, format);\n\t } else { // plain ol' numbers or bytes\n\t output = formatNumber(n._value, format, roundingFunction);\n\t }\n\t\n\t // return string\n\t return output;\n\t }\n\t\n\t // revert to number\n\t function unformatNumbro(n, string) {\n\t var stringOriginal = string,\n\t thousandRegExp,\n\t millionRegExp,\n\t billionRegExp,\n\t trillionRegExp,\n\t bytesMultiplier = false,\n\t power;\n\t\n\t if (string.indexOf(':') > -1) {\n\t n._value = unformatTime(string);\n\t } else {\n\t if (string === zeroFormat) {\n\t n._value = 0;\n\t } else {\n\t if (cultures[currentCulture].delimiters.decimal !== '.') {\n\t string = string.replace(/\\./g, '').replace(cultures[currentCulture].delimiters.decimal, '.');\n\t }\n\t\n\t // see if abbreviations are there so that we can multiply to the correct number\n\t thousandRegExp = new RegExp('[^a-zA-Z]' + cultures[currentCulture].abbreviations.thousand +\n\t '(?:\\\\)|(\\\\' + cultures[currentCulture].currency.symbol + ')?(?:\\\\))?)?$');\n\t millionRegExp = new RegExp('[^a-zA-Z]' + cultures[currentCulture].abbreviations.million +\n\t '(?:\\\\)|(\\\\' + cultures[currentCulture].currency.symbol + ')?(?:\\\\))?)?$');\n\t billionRegExp = new RegExp('[^a-zA-Z]' + cultures[currentCulture].abbreviations.billion +\n\t '(?:\\\\)|(\\\\' + cultures[currentCulture].currency.symbol + ')?(?:\\\\))?)?$');\n\t trillionRegExp = new RegExp('[^a-zA-Z]' + cultures[currentCulture].abbreviations.trillion +\n\t '(?:\\\\)|(\\\\' + cultures[currentCulture].currency.symbol + ')?(?:\\\\))?)?$');\n\t\n\t // see if bytes are there so that we can multiply to the correct number\n\t for (power = 1; power < binarySuffixes.length && !bytesMultiplier; ++power) {\n\t if (string.indexOf(binarySuffixes[power]) > -1) {\n\t bytesMultiplier = Math.pow(1024, power);\n\t } else if (string.indexOf(decimalSuffixes[power]) > -1) {\n\t bytesMultiplier = Math.pow(1000, power);\n\t }\n\t }\n\t\n\t var str = string.replace(/[^0-9\\.]+/g, '');\n\t if (str === '') {\n\t // An empty string is not a number.\n\t n._value = NaN;\n\t\n\t } else {\n\t // do some math to create our number\n\t n._value = ((bytesMultiplier) ? bytesMultiplier : 1) *\n\t ((stringOriginal.match(thousandRegExp)) ? Math.pow(10, 3) : 1) *\n\t ((stringOriginal.match(millionRegExp)) ? Math.pow(10, 6) : 1) *\n\t ((stringOriginal.match(billionRegExp)) ? Math.pow(10, 9) : 1) *\n\t ((stringOriginal.match(trillionRegExp)) ? Math.pow(10, 12) : 1) *\n\t ((string.indexOf('%') > -1) ? 0.01 : 1) *\n\t (((string.split('-').length +\n\t Math.min(string.split('(').length - 1, string.split(')').length - 1)) % 2) ? 1 : -1) *\n\t Number(str);\n\t\n\t // round if we are talking about bytes\n\t n._value = (bytesMultiplier) ? Math.ceil(n._value) : n._value;\n\t }\n\t }\n\t }\n\t return n._value;\n\t }\n\t\n\t function formatCurrency(n, currencySymbol, originalFormat, roundingFunction) {\n\t var format = originalFormat,\n\t symbolIndex = format.indexOf('$'),\n\t openParenIndex = format.indexOf('('),\n\t plusSignIndex = format.indexOf('+'),\n\t minusSignIndex = format.indexOf('-'),\n\t space = '',\n\t decimalSeparator = '',\n\t spliceIndex,\n\t output;\n\t\n\t if(format.indexOf('$') === -1){\n\t // Use defaults instead of the format provided\n\t if (cultures[currentCulture].currency.position === 'infix') {\n\t decimalSeparator = currencySymbol;\n\t if (cultures[currentCulture].currency.spaceSeparated) {\n\t decimalSeparator = ' ' + decimalSeparator + ' ';\n\t }\n\t } else if (cultures[currentCulture].currency.spaceSeparated) {\n\t space = ' ';\n\t }\n\t } else {\n\t // check for space before or after currency\n\t if (format.indexOf(' $') > -1) {\n\t space = ' ';\n\t format = format.replace(' $', '');\n\t } else if (format.indexOf('$ ') > -1) {\n\t space = ' ';\n\t format = format.replace('$ ', '');\n\t } else {\n\t format = format.replace('$', '');\n\t }\n\t }\n\t\n\t // Format The Number\n\t output = formatNumber(n._value, format, roundingFunction, decimalSeparator);\n\t\n\t if (originalFormat.indexOf('$') === -1) {\n\t // Use defaults instead of the format provided\n\t switch (cultures[currentCulture].currency.position) {\n\t case 'postfix':\n\t if (output.indexOf(')') > -1) {\n\t output = output.split('');\n\t output.splice(-1, 0, space + currencySymbol);\n\t output = output.join('');\n\t } else {\n\t output = output + space + currencySymbol;\n\t }\n\t break;\n\t case 'infix':\n\t break;\n\t case 'prefix':\n\t if (output.indexOf('(') > -1 || output.indexOf('-') > -1) {\n\t output = output.split('');\n\t spliceIndex = Math.max(openParenIndex, minusSignIndex) + 1;\n\t\n\t output.splice(spliceIndex, 0, currencySymbol + space);\n\t output = output.join('');\n\t } else {\n\t output = currencySymbol + space + output;\n\t }\n\t break;\n\t default:\n\t throw Error('Currency position should be among [\"prefix\", \"infix\", \"postfix\"]');\n\t }\n\t } else {\n\t // position the symbol\n\t if (symbolIndex <= 1) {\n\t if (output.indexOf('(') > -1 || output.indexOf('+') > -1 || output.indexOf('-') > -1) {\n\t output = output.split('');\n\t spliceIndex = 1;\n\t if (symbolIndex < openParenIndex || symbolIndex < plusSignIndex || symbolIndex < minusSignIndex) {\n\t // the symbol appears before the \"(\", \"+\" or \"-\"\n\t spliceIndex = 0;\n\t }\n\t output.splice(spliceIndex, 0, currencySymbol + space);\n\t output = output.join('');\n\t } else {\n\t output = currencySymbol + space + output;\n\t }\n\t } else {\n\t if (output.indexOf(')') > -1) {\n\t output = output.split('');\n\t output.splice(-1, 0, space + currencySymbol);\n\t output = output.join('');\n\t } else {\n\t output = output + space + currencySymbol;\n\t }\n\t }\n\t }\n\t\n\t return output;\n\t }\n\t\n\t function formatForeignCurrency(n, foreignCurrencySymbol, originalFormat, roundingFunction) {\n\t return formatCurrency(n, foreignCurrencySymbol, originalFormat, roundingFunction);\n\t }\n\t\n\t function formatPercentage(n, format, roundingFunction) {\n\t var space = '',\n\t output,\n\t value = n._value * 100;\n\t\n\t // check for space before %\n\t if (format.indexOf(' %') > -1) {\n\t space = ' ';\n\t format = format.replace(' %', '');\n\t } else {\n\t format = format.replace('%', '');\n\t }\n\t\n\t output = formatNumber(value, format, roundingFunction);\n\t\n\t if (output.indexOf(')') > -1) {\n\t output = output.split('');\n\t output.splice(-1, 0, space + '%');\n\t output = output.join('');\n\t } else {\n\t output = output + space + '%';\n\t }\n\t\n\t return output;\n\t }\n\t\n\t function formatTime(n) {\n\t var hours = Math.floor(n._value / 60 / 60),\n\t minutes = Math.floor((n._value - (hours * 60 * 60)) / 60),\n\t seconds = Math.round(n._value - (hours * 60 * 60) - (minutes * 60));\n\t return hours + ':' +\n\t ((minutes < 10) ? '0' + minutes : minutes) + ':' +\n\t ((seconds < 10) ? '0' + seconds : seconds);\n\t }\n\t\n\t function unformatTime(string) {\n\t var timeArray = string.split(':'),\n\t seconds = 0;\n\t // turn hours and minutes into seconds and add them all up\n\t if (timeArray.length === 3) {\n\t // hours\n\t seconds = seconds + (Number(timeArray[0]) * 60 * 60);\n\t // minutes\n\t seconds = seconds + (Number(timeArray[1]) * 60);\n\t // seconds\n\t seconds = seconds + Number(timeArray[2]);\n\t } else if (timeArray.length === 2) {\n\t // minutes\n\t seconds = seconds + (Number(timeArray[0]) * 60);\n\t // seconds\n\t seconds = seconds + Number(timeArray[1]);\n\t }\n\t return Number(seconds);\n\t }\n\t\n\t function formatByteUnits (value, suffixes, scale) {\n\t var suffix = suffixes[0],\n\t power,\n\t min,\n\t max,\n\t abs = Math.abs(value);\n\t\n\t if (abs >= scale) {\n\t for (power = 1; power < suffixes.length; ++power) {\n\t min = Math.pow(scale, power);\n\t max = Math.pow(scale, power + 1);\n\t\n\t if (abs >= min && abs < max) {\n\t suffix = suffixes[power];\n\t value = value / min;\n\t break;\n\t }\n\t }\n\t\n\t // values greater than or equal to [scale] YB never set the suffix\n\t if (suffix === suffixes[0]) {\n\t value = value / Math.pow(scale, suffixes.length - 1);\n\t suffix = suffixes[suffixes.length - 1];\n\t }\n\t }\n\t\n\t return { value: value, suffix: suffix };\n\t }\n\t\n\t function formatNumber (value, format, roundingFunction, sep) {\n\t var negP = false,\n\t signed = false,\n\t optDec = false,\n\t abbr = '',\n\t abbrK = false, // force abbreviation to thousands\n\t abbrM = false, // force abbreviation to millions\n\t abbrB = false, // force abbreviation to billions\n\t abbrT = false, // force abbreviation to trillions\n\t abbrForce = false, // force abbreviation\n\t bytes = '',\n\t byteFormat,\n\t units,\n\t ord = '',\n\t abs = Math.abs(value),\n\t totalLength,\n\t length,\n\t minimumPrecision,\n\t pow,\n\t w,\n\t intPrecision,\n\t precision,\n\t prefix,\n\t postfix,\n\t thousands,\n\t d = '',\n\t forcedNeg = false,\n\t neg = false,\n\t indexOpenP,\n\t size,\n\t indexMinus,\n\t paren = '',\n\t minlen,\n\t i;\n\t\n\t // check if number is zero and a custom zero format has been set\n\t if (value === 0 && zeroFormat !== null) {\n\t return zeroFormat;\n\t }\n\t\n\t if (!isFinite(value)) {\n\t return '' + value;\n\t }\n\t\n\t if (format.indexOf('{') === 0) {\n\t var end = format.indexOf('}');\n\t if (end === -1) {\n\t throw Error('Format should also contain a \"}\"');\n\t }\n\t prefix = format.slice(1, end);\n\t format = format.slice(end + 1);\n\t } else {\n\t prefix = '';\n\t }\n\t\n\t if (format.indexOf('}') === format.length - 1) {\n\t var start = format.indexOf('{');\n\t if (start === -1) {\n\t throw Error('Format should also contain a \"{\"');\n\t }\n\t postfix = format.slice(start + 1, -1);\n\t format = format.slice(0, start + 1);\n\t } else {\n\t postfix = '';\n\t }\n\t\n\t // check for min length\n\t var info;\n\t if (format.indexOf('.') === -1) {\n\t info = format.match(/([0-9]+).*/);\n\t } else {\n\t info = format.match(/([0-9]+)\\..*/);\n\t }\n\t minlen = info === null ? -1 : info[1].length;\n\t\n\t // see if we should use parentheses for negative number or if we should prefix with a sign\n\t // if both are present we default to parentheses\n\t if (format.indexOf('-') !== -1) {\n\t forcedNeg = true;\n\t }\n\t if (format.indexOf('(') > -1) {\n\t negP = true;\n\t format = format.slice(1, -1);\n\t } else if (format.indexOf('+') > -1) {\n\t signed = true;\n\t format = format.replace(/\\+/g, '');\n\t }\n\t\n\t // see if abbreviation is wanted\n\t if (format.indexOf('a') > -1) {\n\t intPrecision = format.split('.')[0].match(/[0-9]+/g) || ['0'];\n\t intPrecision = parseInt(intPrecision[0], 10);\n\t\n\t // check if abbreviation is specified\n\t abbrK = format.indexOf('aK') >= 0;\n\t abbrM = format.indexOf('aM') >= 0;\n\t abbrB = format.indexOf('aB') >= 0;\n\t abbrT = format.indexOf('aT') >= 0;\n\t abbrForce = abbrK || abbrM || abbrB || abbrT;\n\t\n\t // check for space before abbreviation\n\t if (format.indexOf(' a') > -1) {\n\t abbr = ' ';\n\t format = format.replace(' a', '');\n\t } else {\n\t format = format.replace('a', '');\n\t }\n\t\n\t totalLength = Math.floor(Math.log(abs) / Math.LN10) + 1;\n\t\n\t minimumPrecision = totalLength % 3;\n\t minimumPrecision = minimumPrecision === 0 ? 3 : minimumPrecision;\n\t\n\t if (intPrecision && abs !== 0) {\n\t\n\t length = Math.floor(Math.log(abs) / Math.LN10) + 1 - intPrecision;\n\t\n\t pow = 3 * ~~((Math.min(intPrecision, totalLength) - minimumPrecision) / 3);\n\t\n\t abs = abs / Math.pow(10, pow);\n\t\n\t if (format.indexOf('.') === -1 && intPrecision > 3) {\n\t format += '[.]';\n\t\n\t size = length === 0 ? 0 : 3 * ~~(length / 3) - length;\n\t size = size < 0 ? size + 3 : size;\n\t\n\t format += zeroes(size);\n\t }\n\t }\n\t\n\t if (Math.floor(Math.log(Math.abs(value)) / Math.LN10) + 1 !== intPrecision) {\n\t if (abs >= Math.pow(10, 12) && !abbrForce || abbrT) {\n\t // trillion\n\t abbr = abbr + cultures[currentCulture].abbreviations.trillion;\n\t value = value / Math.pow(10, 12);\n\t } else if (abs < Math.pow(10, 12) && abs >= Math.pow(10, 9) && !abbrForce || abbrB) {\n\t // billion\n\t abbr = abbr + cultures[currentCulture].abbreviations.billion;\n\t value = value / Math.pow(10, 9);\n\t } else if (abs < Math.pow(10, 9) && abs >= Math.pow(10, 6) && !abbrForce || abbrM) {\n\t // million\n\t abbr = abbr + cultures[currentCulture].abbreviations.million;\n\t value = value / Math.pow(10, 6);\n\t } else if (abs < Math.pow(10, 6) && abs >= Math.pow(10, 3) && !abbrForce || abbrK) {\n\t // thousand\n\t abbr = abbr + cultures[currentCulture].abbreviations.thousand;\n\t value = value / Math.pow(10, 3);\n\t }\n\t }\n\t }\n\t\n\t // see if we are formatting\n\t // binary-decimal bytes (1024 MB), binary bytes (1024 MiB), or decimal bytes (1000 MB)\n\t for (i = 0; i < byteFormatOrder.length; ++i) {\n\t byteFormat = byteFormatOrder[i];\n\t\n\t if (format.indexOf(byteFormat.marker) > -1) {\n\t // check for space before\n\t if (format.indexOf(' ' + byteFormat.marker) >-1) {\n\t bytes = ' ';\n\t }\n\t\n\t // remove the marker (with the space if it had one)\n\t format = format.replace(bytes + byteFormat.marker, '');\n\t\n\t units = formatByteUnits(value, byteFormat.suffixes, byteFormat.scale);\n\t\n\t value = units.value;\n\t bytes = bytes + units.suffix;\n\t\n\t break;\n\t }\n\t }\n\t\n\t // see if ordinal is wanted\n\t if (format.indexOf('o') > -1) {\n\t // check for space before\n\t if (format.indexOf(' o') > -1) {\n\t ord = ' ';\n\t format = format.replace(' o', '');\n\t } else {\n\t format = format.replace('o', '');\n\t }\n\t\n\t if (cultures[currentCulture].ordinal) {\n\t ord = ord + cultures[currentCulture].ordinal(value);\n\t }\n\t }\n\t\n\t if (format.indexOf('[.]') > -1) {\n\t optDec = true;\n\t format = format.replace('[.]', '.');\n\t }\n\t\n\t w = value.toString().split('.')[0];\n\t precision = format.split('.')[1];\n\t thousands = format.indexOf(',');\n\t\n\t if (precision) {\n\t if (precision.indexOf('*') !== -1) {\n\t d = toFixed(value, value.toString().split('.')[1].length, roundingFunction);\n\t } else {\n\t if (precision.indexOf('[') > -1) {\n\t precision = precision.replace(']', '');\n\t precision = precision.split('[');\n\t d = toFixed(value, (precision[0].length + precision[1].length), roundingFunction,\n\t precision[1].length);\n\t } else {\n\t d = toFixed(value, precision.length, roundingFunction);\n\t }\n\t }\n\t\n\t w = d.split('.')[0];\n\t\n\t if (d.split('.')[1].length) {\n\t var p = sep ? abbr + sep : cultures[currentCulture].delimiters.decimal;\n\t d = p + d.split('.')[1];\n\t } else {\n\t d = '';\n\t }\n\t\n\t if (optDec && Number(d.slice(1)) === 0) {\n\t d = '';\n\t }\n\t } else {\n\t w = toFixed(value, 0, roundingFunction);\n\t }\n\t\n\t // format number\n\t if (w.indexOf('-') > -1) {\n\t w = w.slice(1);\n\t neg = true;\n\t }\n\t\n\t if (w.length < minlen) {\n\t w = zeroes(minlen - w.length) + w;\n\t }\n\t\n\t if (thousands > -1) {\n\t w = w.toString().replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, '$1' +\n\t cultures[currentCulture].delimiters.thousands);\n\t }\n\t\n\t if (format.indexOf('.') === 0) {\n\t w = '';\n\t }\n\t\n\t indexOpenP = format.indexOf('(');\n\t indexMinus = format.indexOf('-');\n\t\n\t if (indexOpenP < indexMinus) {\n\t paren = ((negP && neg) ? '(' : '') + (((forcedNeg && neg) || (!negP && neg)) ? '-' : '');\n\t } else {\n\t paren = (((forcedNeg && neg) || (!negP && neg)) ? '-' : '') + ((negP && neg) ? '(' : '');\n\t }\n\t\n\t return prefix +\n\t paren + ((!neg && signed && value !== 0) ? '+' : '') +\n\t w + d +\n\t ((ord) ? ord : '') +\n\t ((abbr && !sep) ? abbr : '') +\n\t ((bytes) ? bytes : '') +\n\t ((negP && neg) ? ')' : '') +\n\t postfix;\n\t }\n\t\n\t /************************************\n\t Top Level Functions\n\t ************************************/\n\t\n\t numbro = function(input) {\n\t if (numbro.isNumbro(input)) {\n\t input = input.value();\n\t } else if (input === 0 || typeof input === 'undefined') {\n\t input = 0;\n\t } else if (!Number(input)) {\n\t input = numbro.fn.unformat(input);\n\t }\n\t\n\t return new Numbro(Number(input));\n\t };\n\t\n\t // version number\n\t numbro.version = VERSION;\n\t\n\t // compare numbro object\n\t numbro.isNumbro = function(obj) {\n\t return obj instanceof Numbro;\n\t };\n\t\n\t /**\n\t * This function allow the user to set a new language with a fallback if\n\t * the language does not exist. If no fallback language is provided,\n\t * it fallbacks to english.\n\t *\n\t * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n\t * `setCulture` should be used instead.\n\t */\n\t numbro.setLanguage = function(newLanguage, fallbackLanguage) {\n\t console.warn('`setLanguage` is deprecated since version 1.6.0. Use `setCulture` instead');\n\t var key = newLanguage,\n\t prefix = newLanguage.split('-')[0],\n\t matchingLanguage = null;\n\t if (!languages[key]) {\n\t Object.keys(languages).forEach(function(language) {\n\t if (!matchingLanguage && language.split('-')[0] === prefix) {\n\t matchingLanguage = language;\n\t }\n\t });\n\t key = matchingLanguage || fallbackLanguage || 'en-US';\n\t }\n\t chooseCulture(key);\n\t };\n\t\n\t /**\n\t * This function allow the user to set a new culture with a fallback if\n\t * the culture does not exist. If no fallback culture is provided,\n\t * it falls back to \"en-US\".\n\t */\n\t numbro.setCulture = function(newCulture, fallbackCulture) {\n\t var key = newCulture,\n\t suffix = newCulture.split('-')[1],\n\t matchingCulture = null;\n\t if (!cultures[key]) {\n\t if (suffix) {\n\t Object.keys(cultures).forEach(function(language) {\n\t if (!matchingCulture && language.split('-')[1] === suffix) {\n\t matchingCulture = language;\n\t }\n\t });\n\t }\n\t\n\t key = matchingCulture || fallbackCulture || 'en-US';\n\t }\n\t chooseCulture(key);\n\t };\n\t\n\t /**\n\t * This function will load languages and then set the global language. If\n\t * no arguments are passed in, it will simply return the current global\n\t * language key.\n\t *\n\t * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n\t * `culture` should be used instead.\n\t */\n\t numbro.language = function(key, values) {\n\t console.warn('`language` is deprecated since version 1.6.0. Use `culture` instead');\n\t\n\t if (!key) {\n\t return currentCulture;\n\t }\n\t\n\t if (key && !values) {\n\t if (!languages[key]) {\n\t throw new Error('Unknown language : ' + key);\n\t }\n\t chooseCulture(key);\n\t }\n\t\n\t if (values || !languages[key]) {\n\t setCulture(key, values);\n\t }\n\t\n\t return numbro;\n\t };\n\t\n\t /**\n\t * This function will load cultures and then set the global culture. If\n\t * no arguments are passed in, it will simply return the current global\n\t * culture code.\n\t */\n\t numbro.culture = function(code, values) {\n\t if (!code) {\n\t return currentCulture;\n\t }\n\t\n\t if (code && !values) {\n\t if (!cultures[code]) {\n\t throw new Error('Unknown culture : ' + code);\n\t }\n\t chooseCulture(code);\n\t }\n\t\n\t if (values || !cultures[code]) {\n\t setCulture(code, values);\n\t }\n\t\n\t return numbro;\n\t };\n\t\n\t /**\n\t * This function provides access to the loaded language data. If\n\t * no arguments are passed in, it will simply return the current\n\t * global language object.\n\t *\n\t * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n\t * `culture` should be used instead.\n\t */\n\t numbro.languageData = function(key) {\n\t console.warn('`languageData` is deprecated since version 1.6.0. Use `cultureData` instead');\n\t\n\t if (!key) {\n\t return languages[currentCulture];\n\t }\n\t\n\t if (!languages[key]) {\n\t throw new Error('Unknown language : ' + key);\n\t }\n\t\n\t return languages[key];\n\t };\n\t\n\t /**\n\t * This function provides access to the loaded culture data. If\n\t * no arguments are passed in, it will simply return the current\n\t * global culture object.\n\t */\n\t numbro.cultureData = function(code) {\n\t if (!code) {\n\t return cultures[currentCulture];\n\t }\n\t\n\t if (!cultures[code]) {\n\t throw new Error('Unknown culture : ' + code);\n\t }\n\t\n\t return cultures[code];\n\t };\n\t\n\t numbro.culture('en-US', enUS);\n\t\n\t /**\n\t * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n\t * `cultures` should be used instead.\n\t */\n\t numbro.languages = function() {\n\t console.warn('`languages` is deprecated since version 1.6.0. Use `cultures` instead');\n\t\n\t return languages;\n\t };\n\t\n\t numbro.cultures = function() {\n\t return cultures;\n\t };\n\t\n\t numbro.zeroFormat = function(format) {\n\t zeroFormat = typeof(format) === 'string' ? format : null;\n\t };\n\t\n\t numbro.defaultFormat = function(format) {\n\t defaultFormat = typeof(format) === 'string' ? format : '0.0';\n\t };\n\t\n\t numbro.defaultCurrencyFormat = function (format) {\n\t defaultCurrencyFormat = typeof(format) === 'string' ? format : '0$';\n\t };\n\t\n\t numbro.validate = function(val, culture) {\n\t\n\t var _decimalSep,\n\t _thousandSep,\n\t _currSymbol,\n\t _valArray,\n\t _abbrObj,\n\t _thousandRegEx,\n\t cultureData,\n\t temp;\n\t\n\t //coerce val to string\n\t if (typeof val !== 'string') {\n\t val += '';\n\t if (console.warn) {\n\t console.warn('Numbro.js: Value is not string. It has been co-erced to: ', val);\n\t }\n\t }\n\t\n\t //trim whitespaces from either sides\n\t val = val.trim();\n\t\n\t //replace the initial '+' or '-' sign if present\n\t val = val.replace(/^[+-]?/, '');\n\t\n\t //if val is just digits return true\n\t if ( !! val.match(/^\\d+$/)) {\n\t return true;\n\t }\n\t\n\t //if val is empty return false\n\t if (val === '') {\n\t return false;\n\t }\n\t\n\t //get the decimal and thousands separator from numbro.cultureData\n\t try {\n\t //check if the culture is understood by numbro. if not, default it to current culture\n\t cultureData = numbro.cultureData(culture);\n\t } catch (e) {\n\t cultureData = numbro.cultureData(numbro.culture());\n\t }\n\t\n\t //setup the delimiters and currency symbol based on culture\n\t _currSymbol = cultureData.currency.symbol;\n\t _abbrObj = cultureData.abbreviations;\n\t _decimalSep = cultureData.delimiters.decimal;\n\t if (cultureData.delimiters.thousands === '.') {\n\t _thousandSep = '\\\\.';\n\t } else {\n\t _thousandSep = cultureData.delimiters.thousands;\n\t }\n\t\n\t // validating currency symbol\n\t temp = val.match(/^[^\\d\\.\\,]+/);\n\t if (temp !== null) {\n\t val = val.substr(1);\n\t if (temp[0] !== _currSymbol) {\n\t return false;\n\t }\n\t }\n\t\n\t //validating abbreviation symbol\n\t temp = val.match(/[^\\d]+$/);\n\t if (temp !== null) {\n\t val = val.slice(0, -1);\n\t if (temp[0] !== _abbrObj.thousand && temp[0] !== _abbrObj.million &&\n\t temp[0] !== _abbrObj.billion && temp[0] !== _abbrObj.trillion) {\n\t return false;\n\t }\n\t }\n\t\n\t _thousandRegEx = new RegExp(_thousandSep + '{2}');\n\t\n\t if (!val.match(/[^\\d.,]/g)) {\n\t _valArray = val.split(_decimalSep);\n\t if (_valArray.length > 2) {\n\t return false;\n\t } else {\n\t if (_valArray.length < 2) {\n\t return ( !! _valArray[0].match(/^\\d+.*\\d$/) && !_valArray[0].match(_thousandRegEx));\n\t } else {\n\t if (_valArray[0] === '') {\n\t // for values without leading zero eg. .984\n\t return (!_valArray[0].match(_thousandRegEx) &&\n\t !!_valArray[1].match(/^\\d+$/));\n\t\n\t } else if (_valArray[0].length === 1) {\n\t return ( !! _valArray[0].match(/^\\d+$/) &&\n\t !_valArray[0].match(_thousandRegEx) &&\n\t !! _valArray[1].match(/^\\d+$/));\n\t } else {\n\t return ( !! _valArray[0].match(/^\\d+.*\\d$/) &&\n\t !_valArray[0].match(_thousandRegEx) &&\n\t !! _valArray[1].match(/^\\d+$/));\n\t }\n\t }\n\t }\n\t }\n\t\n\t return false;\n\t };\n\t\n\t /**\n\t * * @deprecated Since in version 1.6.0. It will be deleted in version 2.0\n\t * `loadCulturesInNode` should be used instead.\n\t */\n\t numbro.loadLanguagesInNode = function() {\n\t console.warn('`loadLanguagesInNode` is deprecated since version 1.6.0. Use `loadCulturesInNode` instead');\n\t\n\t numbro.loadCulturesInNode();\n\t };\n\t\n\t numbro.loadCulturesInNode = function() {\n\t // TODO: Rename the folder in 2.0.0\n\t var cultures = __webpack_require__(21);\n\t\n\t for(var langLocaleCode in cultures) {\n\t if(langLocaleCode) {\n\t numbro.culture(langLocaleCode, cultures[langLocaleCode]);\n\t }\n\t }\n\t };\n\t\n\t /************************************\n\t Helpers\n\t ************************************/\n\t\n\t function setCulture(code, values) {\n\t cultures[code] = values;\n\t }\n\t\n\t function chooseCulture(code) {\n\t currentCulture = code;\n\t var defaults = cultures[code].defaults;\n\t if (defaults && defaults.format) {\n\t numbro.defaultFormat(defaults.format);\n\t }\n\t if (defaults && defaults.currencyFormat) {\n\t numbro.defaultCurrencyFormat(defaults.currencyFormat);\n\t }\n\t }\n\t\n\t function inNodejsRuntime() {\n\t return (typeof process !== 'undefined') &&\n\t (process.browser === undefined) &&\n\t process.title &&\n\t (\n\t process.title.indexOf('node') === 0 ||\n\t process.title.indexOf('meteor-tool') > 0 ||\n\t process.title === 'grunt' ||\n\t process.title === 'gulp'\n\t ) &&\n\t (\"function\" !== 'undefined');\n\t }\n\t\n\t /************************************\n\t Floating-point helpers\n\t ************************************/\n\t\n\t // The floating-point helper functions and implementation\n\t // borrows heavily from sinful.js: http://guipn.github.io/sinful.js/\n\t\n\t /**\n\t * Array.prototype.reduce for browsers that don't support it\n\t * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce#Compatibility\n\t */\n\t if ('function' !== typeof Array.prototype.reduce) {\n\t Array.prototype.reduce = function(callback, optInitialValue) {\n\t\n\t if (null === this || 'undefined' === typeof this) {\n\t // At the moment all modern browsers, that support strict mode, have\n\t // native implementation of Array.prototype.reduce. For instance, IE8\n\t // does not support strict mode, so this check is actually useless.\n\t throw new TypeError('Array.prototype.reduce called on null or undefined');\n\t }\n\t\n\t if ('function' !== typeof callback) {\n\t throw new TypeError(callback + ' is not a function');\n\t }\n\t\n\t var index,\n\t value,\n\t length = this.length >>> 0,\n\t isValueSet = false;\n\t\n\t if (1 < arguments.length) {\n\t value = optInitialValue;\n\t isValueSet = true;\n\t }\n\t\n\t for (index = 0; length > index; ++index) {\n\t if (this.hasOwnProperty(index)) {\n\t if (isValueSet) {\n\t value = callback(value, this[index], index, this);\n\t } else {\n\t value = this[index];\n\t isValueSet = true;\n\t }\n\t }\n\t }\n\t\n\t if (!isValueSet) {\n\t throw new TypeError('Reduce of empty array with no initial value');\n\t }\n\t\n\t return value;\n\t };\n\t }\n\t\n\t\n\t /**\n\t * Computes the multiplier necessary to make x >= 1,\n\t * effectively eliminating miscalculations caused by\n\t * finite precision.\n\t */\n\t function multiplier(x) {\n\t var parts = x.toString().split('.');\n\t if (parts.length < 2) {\n\t return 1;\n\t }\n\t return Math.pow(10, parts[1].length);\n\t }\n\t\n\t /**\n\t * Given a variable number of arguments, returns the maximum\n\t * multiplier that must be used to normalize an operation involving\n\t * all of them.\n\t */\n\t function correctionFactor() {\n\t var args = Array.prototype.slice.call(arguments);\n\t return args.reduce(function(prev, next) {\n\t var mp = multiplier(prev),\n\t mn = multiplier(next);\n\t return mp > mn ? mp : mn;\n\t }, -Infinity);\n\t }\n\t\n\t /************************************\n\t Numbro Prototype\n\t ************************************/\n\t\n\t\n\t numbro.fn = Numbro.prototype = {\n\t\n\t clone: function() {\n\t return numbro(this);\n\t },\n\t\n\t format: function(inputString, roundingFunction) {\n\t return formatNumbro(this,\n\t inputString ? inputString : defaultFormat,\n\t (roundingFunction !== undefined) ? roundingFunction : Math.round\n\t );\n\t },\n\t\n\t formatCurrency: function(inputString, roundingFunction) {\n\t return formatCurrency(this,\n\t cultures[currentCulture].currency.symbol,\n\t inputString ? inputString : defaultCurrencyFormat,\n\t (roundingFunction !== undefined) ? roundingFunction : Math.round\n\t );\n\t },\n\t\n\t formatForeignCurrency: function(currencySymbol, inputString, roundingFunction) {\n\t return formatForeignCurrency(this,\n\t currencySymbol,\n\t inputString ? inputString : defaultCurrencyFormat,\n\t (roundingFunction !== undefined) ? roundingFunction : Math.round\n\t );\n\t },\n\t\n\t unformat: function(inputString) {\n\t if (typeof inputString === 'number') {\n\t return inputString;\n\t } else if (typeof inputString === 'string') {\n\t var result = unformatNumbro(this, inputString);\n\t\n\t // Any unparseable string (represented as NaN in the result) is\n\t // converted into undefined.\n\t return isNaN(result) ? undefined : result;\n\t } else {\n\t return undefined;\n\t }\n\t },\n\t\n\t binaryByteUnits: function() {\n\t return formatByteUnits(this._value, bytes.binary.suffixes, bytes.binary.scale).suffix;\n\t },\n\t\n\t byteUnits: function() {\n\t return formatByteUnits(this._value, bytes.general.suffixes, bytes.general.scale).suffix;\n\t },\n\t\n\t decimalByteUnits: function() {\n\t return formatByteUnits(this._value, bytes.decimal.suffixes, bytes.decimal.scale).suffix;\n\t },\n\t\n\t value: function() {\n\t return this._value;\n\t },\n\t\n\t valueOf: function() {\n\t return this._value;\n\t },\n\t\n\t set: function(value) {\n\t this._value = Number(value);\n\t return this;\n\t },\n\t\n\t add: function(value) {\n\t var corrFactor = correctionFactor.call(null, this._value, value);\n\t\n\t function cback(accum, curr) {\n\t return accum + corrFactor * curr;\n\t }\n\t this._value = [this._value, value].reduce(cback, 0) / corrFactor;\n\t return this;\n\t },\n\t\n\t subtract: function(value) {\n\t var corrFactor = correctionFactor.call(null, this._value, value);\n\t\n\t function cback(accum, curr) {\n\t return accum - corrFactor * curr;\n\t }\n\t this._value = [value].reduce(cback, this._value * corrFactor) / corrFactor;\n\t return this;\n\t },\n\t\n\t multiply: function(value) {\n\t function cback(accum, curr) {\n\t var corrFactor = correctionFactor(accum, curr),\n\t result = accum * corrFactor;\n\t result *= curr * corrFactor;\n\t result /= corrFactor * corrFactor;\n\t return result;\n\t }\n\t this._value = [this._value, value].reduce(cback, 1);\n\t return this;\n\t },\n\t\n\t divide: function(value) {\n\t function cback(accum, curr) {\n\t var corrFactor = correctionFactor(accum, curr);\n\t return (accum * corrFactor) / (curr * corrFactor);\n\t }\n\t this._value = [this._value, value].reduce(cback);\n\t return this;\n\t },\n\t\n\t difference: function(value) {\n\t return Math.abs(numbro(this._value).subtract(value).value());\n\t }\n\t\n\t };\n\t\n\t /************************************\n\t Exposing Numbro\n\t ************************************/\n\t\n\t if (inNodejsRuntime()) {\n\t //Todo: Rename the folder in 2.0.0\n\t numbro.loadCulturesInNode();\n\t }\n\t\n\t // CommonJS module is defined\n\t if (hasModule) {\n\t module.exports = numbro;\n\t } else {\n\t /*global ender:false */\n\t if (typeof ender === 'undefined') {\n\t // here, `this` means `window` in the browser, or `global` on the server\n\t // add `numbro` as a global object via a string identifier,\n\t // for Closure Compiler 'advanced' mode\n\t this.numbro = numbro;\n\t }\n\t\n\t /*global define:false */\n\t if (true) {\n\t !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t return numbro;\n\t }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t }\n\t }\n\t\n\t}.call(typeof window === 'undefined' ? this : window));\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))\n\n/***/ },\n/* 20 */\n/***/ function(module, exports) {\n\n\t// shim for using process in browser\n\tvar process = module.exports = {};\n\t\n\t// cached from whatever global is present so that test runners that stub it\n\t// don't break things. But we need to wrap it in a try catch in case it is\n\t// wrapped in strict mode code which doesn't define any globals. It's inside a\n\t// function because try/catches deoptimize in certain engines.\n\t\n\tvar cachedSetTimeout;\n\tvar cachedClearTimeout;\n\t\n\tfunction defaultSetTimout() {\n\t throw new Error('setTimeout has not been defined');\n\t}\n\tfunction defaultClearTimeout () {\n\t throw new Error('clearTimeout has not been defined');\n\t}\n\t(function () {\n\t try {\n\t if (typeof setTimeout === 'function') {\n\t cachedSetTimeout = setTimeout;\n\t } else {\n\t cachedSetTimeout = defaultSetTimout;\n\t }\n\t } catch (e) {\n\t cachedSetTimeout = defaultSetTimout;\n\t }\n\t try {\n\t if (typeof clearTimeout === 'function') {\n\t cachedClearTimeout = clearTimeout;\n\t } else {\n\t cachedClearTimeout = defaultClearTimeout;\n\t }\n\t } catch (e) {\n\t cachedClearTimeout = defaultClearTimeout;\n\t }\n\t} ())\n\tfunction runTimeout(fun) {\n\t if (cachedSetTimeout === setTimeout) {\n\t //normal enviroments in sane situations\n\t return setTimeout(fun, 0);\n\t }\n\t // if setTimeout wasn't available but was latter defined\n\t if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n\t cachedSetTimeout = setTimeout;\n\t return setTimeout(fun, 0);\n\t }\n\t try {\n\t // when when somebody has screwed with setTimeout but no I.E. maddness\n\t return cachedSetTimeout(fun, 0);\n\t } catch(e){\n\t try {\n\t // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n\t return cachedSetTimeout.call(null, fun, 0);\n\t } catch(e){\n\t // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n\t return cachedSetTimeout.call(this, fun, 0);\n\t }\n\t }\n\t\n\t\n\t}\n\tfunction runClearTimeout(marker) {\n\t if (cachedClearTimeout === clearTimeout) {\n\t //normal enviroments in sane situations\n\t return clearTimeout(marker);\n\t }\n\t // if clearTimeout wasn't available but was latter defined\n\t if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n\t cachedClearTimeout = clearTimeout;\n\t return clearTimeout(marker);\n\t }\n\t try {\n\t // when when somebody has screwed with setTimeout but no I.E. maddness\n\t return cachedClearTimeout(marker);\n\t } catch (e){\n\t try {\n\t // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n\t return cachedClearTimeout.call(null, marker);\n\t } catch (e){\n\t // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n\t // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n\t return cachedClearTimeout.call(this, marker);\n\t }\n\t }\n\t\n\t\n\t\n\t}\n\tvar queue = [];\n\tvar draining = false;\n\tvar currentQueue;\n\tvar queueIndex = -1;\n\t\n\tfunction cleanUpNextTick() {\n\t if (!draining || !currentQueue) {\n\t return;\n\t }\n\t draining = false;\n\t if (currentQueue.length) {\n\t queue = currentQueue.concat(queue);\n\t } else {\n\t queueIndex = -1;\n\t }\n\t if (queue.length) {\n\t drainQueue();\n\t }\n\t}\n\t\n\tfunction drainQueue() {\n\t if (draining) {\n\t return;\n\t }\n\t var timeout = runTimeout(cleanUpNextTick);\n\t draining = true;\n\t\n\t var len = queue.length;\n\t while(len) {\n\t currentQueue = queue;\n\t queue = [];\n\t while (++queueIndex < len) {\n\t if (currentQueue) {\n\t currentQueue[queueIndex].run();\n\t }\n\t }\n\t queueIndex = -1;\n\t len = queue.length;\n\t }\n\t currentQueue = null;\n\t draining = false;\n\t runClearTimeout(timeout);\n\t}\n\t\n\tprocess.nextTick = function (fun) {\n\t var args = new Array(arguments.length - 1);\n\t if (arguments.length > 1) {\n\t for (var i = 1; i < arguments.length; i++) {\n\t args[i - 1] = arguments[i];\n\t }\n\t }\n\t queue.push(new Item(fun, args));\n\t if (queue.length === 1 && !draining) {\n\t runTimeout(drainQueue);\n\t }\n\t};\n\t\n\t// v8 likes predictible objects\n\tfunction Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}\n\tItem.prototype.run = function () {\n\t this.fun.apply(null, this.array);\n\t};\n\tprocess.title = 'browser';\n\tprocess.browser = true;\n\tprocess.env = {};\n\tprocess.argv = [];\n\tprocess.version = ''; // empty string to avoid regexp issues\n\tprocess.versions = {};\n\t\n\tfunction noop() {}\n\t\n\tprocess.on = noop;\n\tprocess.addListener = noop;\n\tprocess.once = noop;\n\tprocess.off = noop;\n\tprocess.removeListener = noop;\n\tprocess.removeAllListeners = noop;\n\tprocess.emit = noop;\n\t\n\tprocess.binding = function (name) {\n\t throw new Error('process.binding is not supported');\n\t};\n\t\n\tprocess.cwd = function () { return '/' };\n\tprocess.chdir = function (dir) {\n\t throw new Error('process.chdir is not supported');\n\t};\n\tprocess.umask = function() { return 0; };\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t// empty (null-loader)\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\tthis.j$ = this.jStat = (function(Math, undefined) {\n\t\n\t// For quick reference.\n\tvar concat = Array.prototype.concat;\n\tvar slice = Array.prototype.slice;\n\tvar toString = Object.prototype.toString;\n\t\n\t// Calculate correction for IEEE error\n\t// TODO: This calculation can be improved.\n\tfunction calcRdx(n, m) {\n\t var val = n > m ? n : m;\n\t return Math.pow(10,\n\t 17 - ~~(Math.log(((val > 0) ? val : -val)) * Math.LOG10E));\n\t}\n\t\n\t\n\tvar isArray = Array.isArray || function isArray(arg) {\n\t return toString.call(arg) === '[object Array]';\n\t};\n\t\n\t\n\tfunction isFunction(arg) {\n\t return toString.call(arg) === '[object Function]';\n\t}\n\t\n\t\n\tfunction isNumber(arg) {\n\t return typeof arg === 'number' && arg === arg;\n\t}\n\t\n\t\n\t// Converts the jStat matrix to vector.\n\tfunction toVector(arr) {\n\t return concat.apply([], arr);\n\t}\n\t\n\t\n\t// The one and only jStat constructor.\n\tfunction jStat() {\n\t return new jStat._init(arguments);\n\t}\n\t\n\t\n\t// TODO: Remove after all references in src files have been removed.\n\tjStat.fn = jStat.prototype;\n\t\n\t\n\t// By separating the initializer from the constructor it's easier to handle\n\t// always returning a new instance whether \"new\" was used or not.\n\tjStat._init = function _init(args) {\n\t var i;\n\t\n\t // If first argument is an array, must be vector or matrix.\n\t if (isArray(args[0])) {\n\t // Check if matrix.\n\t if (isArray(args[0][0])) {\n\t // See if a mapping function was also passed.\n\t if (isFunction(args[1]))\n\t args[0] = jStat.map(args[0], args[1]);\n\t // Iterate over each is faster than this.push.apply(this, args[0].\n\t for (var i = 0; i < args[0].length; i++)\n\t this[i] = args[0][i];\n\t this.length = args[0].length;\n\t\n\t // Otherwise must be a vector.\n\t } else {\n\t this[0] = isFunction(args[1]) ? jStat.map(args[0], args[1]) : args[0];\n\t this.length = 1;\n\t }\n\t\n\t // If first argument is number, assume creation of sequence.\n\t } else if (isNumber(args[0])) {\n\t this[0] = jStat.seq.apply(null, args);\n\t this.length = 1;\n\t\n\t // Handle case when jStat object is passed to jStat.\n\t } else if (args[0] instanceof jStat) {\n\t // Duplicate the object and pass it back.\n\t return jStat(args[0].toArray());\n\t\n\t // Unexpected argument value, return empty jStat object.\n\t // TODO: This is strange behavior. Shouldn't this throw or some such to let\n\t // the user know they had bad arguments?\n\t } else {\n\t this[0] = [];\n\t this.length = 1;\n\t }\n\t\n\t return this;\n\t};\n\tjStat._init.prototype = jStat.prototype;\n\tjStat._init.constructor = jStat;\n\t\n\t\n\t// Utility functions.\n\t// TODO: for internal use only?\n\tjStat.utils = {\n\t calcRdx: calcRdx,\n\t isArray: isArray,\n\t isFunction: isFunction,\n\t isNumber: isNumber,\n\t toVector: toVector\n\t};\n\t\n\t\n\t// Easily extend the jStat object.\n\t// TODO: is this seriously necessary?\n\tjStat.extend = function extend(obj) {\n\t var i, j;\n\t\n\t if (arguments.length === 1) {\n\t for (j in obj)\n\t jStat[j] = obj[j];\n\t return this;\n\t }\n\t\n\t for (var i = 1; i < arguments.length; i++) {\n\t for (j in arguments[i])\n\t obj[j] = arguments[i][j];\n\t }\n\t\n\t return obj;\n\t};\n\t\n\t\n\t// Returns the number of rows in the matrix.\n\tjStat.rows = function rows(arr) {\n\t return arr.length || 1;\n\t};\n\t\n\t\n\t// Returns the number of columns in the matrix.\n\tjStat.cols = function cols(arr) {\n\t return arr[0].length || 1;\n\t};\n\t\n\t\n\t// Returns the dimensions of the object { rows: i, cols: j }\n\tjStat.dimensions = function dimensions(arr) {\n\t return {\n\t rows: jStat.rows(arr),\n\t cols: jStat.cols(arr)\n\t };\n\t};\n\t\n\t\n\t// Returns a specified row as a vector or return a sub matrix by pick some rows\n\tjStat.row = function row(arr, index) {\n\t if (isArray(index)) {\n\t return index.map(function(i) {\n\t return jStat.row(arr, i);\n\t })\n\t }\n\t return arr[index];\n\t};\n\t\n\t\n\t// return row as array\n\t// rowa([[1,2],[3,4]],0) -> [1,2]\n\tjStat.rowa = function rowa(arr, i) {\n\t return jStat.row(arr, i);\n\t};\n\t\n\t\n\t// Returns the specified column as a vector or return a sub matrix by pick some\n\t// columns\n\tjStat.col = function col(arr, index) {\n\t if (isArray(index)) {\n\t var submat = jStat.arange(arr.length).map(function(i) {\n\t return new Array(index.length);\n\t });\n\t index.forEach(function(ind, i){\n\t jStat.arange(arr.length).forEach(function(j) {\n\t submat[j][i] = arr[j][ind];\n\t });\n\t });\n\t return submat;\n\t }\n\t var column = new Array(arr.length);\n\t for (var i = 0; i < arr.length; i++)\n\t column[i] = [arr[i][index]];\n\t return column;\n\t};\n\t\n\t\n\t// return column as array\n\t// cola([[1,2],[3,4]],0) -> [1,3]\n\tjStat.cola = function cola(arr, i) {\n\t return jStat.col(arr, i).map(function(a){ return a[0] });\n\t};\n\t\n\t\n\t// Returns the diagonal of the matrix\n\tjStat.diag = function diag(arr) {\n\t var nrow = jStat.rows(arr);\n\t var res = new Array(nrow);\n\t for (var row = 0; row < nrow; row++)\n\t res[row] = [arr[row][row]];\n\t return res;\n\t};\n\t\n\t\n\t// Returns the anti-diagonal of the matrix\n\tjStat.antidiag = function antidiag(arr) {\n\t var nrow = jStat.rows(arr) - 1;\n\t var res = new Array(nrow);\n\t for (var i = 0; nrow >= 0; nrow--, i++)\n\t res[i] = [arr[i][nrow]];\n\t return res;\n\t};\n\t\n\t// Transpose a matrix or array.\n\tjStat.transpose = function transpose(arr) {\n\t var obj = [];\n\t var objArr, rows, cols, j, i;\n\t\n\t // Make sure arr is in matrix format.\n\t if (!isArray(arr[0]))\n\t arr = [arr];\n\t\n\t rows = arr.length;\n\t cols = arr[0].length;\n\t\n\t for (var i = 0; i < cols; i++) {\n\t objArr = new Array(rows);\n\t for (j = 0; j < rows; j++)\n\t objArr[j] = arr[j][i];\n\t obj.push(objArr);\n\t }\n\t\n\t // If obj is vector, return only single array.\n\t return obj.length === 1 ? obj[0] : obj;\n\t};\n\t\n\t\n\t// Map a function to an array or array of arrays.\n\t// \"toAlter\" is an internal variable.\n\tjStat.map = function map(arr, func, toAlter) {\n\t var row, nrow, ncol, res, col;\n\t\n\t if (!isArray(arr[0]))\n\t arr = [arr];\n\t\n\t nrow = arr.length;\n\t ncol = arr[0].length;\n\t res = toAlter ? arr : new Array(nrow);\n\t\n\t for (row = 0; row < nrow; row++) {\n\t // if the row doesn't exist, create it\n\t if (!res[row])\n\t res[row] = new Array(ncol);\n\t for (col = 0; col < ncol; col++)\n\t res[row][col] = func(arr[row][col], row, col);\n\t }\n\t\n\t return res.length === 1 ? res[0] : res;\n\t};\n\t\n\t\n\t// Cumulatively combine the elements of an array or array of arrays using a function.\n\tjStat.cumreduce = function cumreduce(arr, func, toAlter) {\n\t var row, nrow, ncol, res, col;\n\t\n\t if (!isArray(arr[0]))\n\t arr = [arr];\n\t\n\t nrow = arr.length;\n\t ncol = arr[0].length;\n\t res = toAlter ? arr : new Array(nrow);\n\t\n\t for (row = 0; row < nrow; row++) {\n\t // if the row doesn't exist, create it\n\t if (!res[row])\n\t res[row] = new Array(ncol);\n\t if (ncol > 0)\n\t res[row][0] = arr[row][0];\n\t for (col = 1; col < ncol; col++)\n\t res[row][col] = func(res[row][col-1], arr[row][col]);\n\t }\n\t return res.length === 1 ? res[0] : res;\n\t};\n\t\n\t\n\t// Destructively alter an array.\n\tjStat.alter = function alter(arr, func) {\n\t return jStat.map(arr, func, true);\n\t};\n\t\n\t\n\t// Generate a rows x cols matrix according to the supplied function.\n\tjStat.create = function create(rows, cols, func) {\n\t var res = new Array(rows);\n\t var i, j;\n\t\n\t if (isFunction(cols)) {\n\t func = cols;\n\t cols = rows;\n\t }\n\t\n\t for (var i = 0; i < rows; i++) {\n\t res[i] = new Array(cols);\n\t for (j = 0; j < cols; j++)\n\t res[i][j] = func(i, j);\n\t }\n\t\n\t return res;\n\t};\n\t\n\t\n\tfunction retZero() { return 0; }\n\t\n\t\n\t// Generate a rows x cols matrix of zeros.\n\tjStat.zeros = function zeros(rows, cols) {\n\t if (!isNumber(cols))\n\t cols = rows;\n\t return jStat.create(rows, cols, retZero);\n\t};\n\t\n\t\n\tfunction retOne() { return 1; }\n\t\n\t\n\t// Generate a rows x cols matrix of ones.\n\tjStat.ones = function ones(rows, cols) {\n\t if (!isNumber(cols))\n\t cols = rows;\n\t return jStat.create(rows, cols, retOne);\n\t};\n\t\n\t\n\t// Generate a rows x cols matrix of uniformly random numbers.\n\tjStat.rand = function rand(rows, cols) {\n\t if (!isNumber(cols))\n\t cols = rows;\n\t return jStat.create(rows, cols, Math.random);\n\t};\n\t\n\t\n\tfunction retIdent(i, j) { return i === j ? 1 : 0; }\n\t\n\t\n\t// Generate an identity matrix of size row x cols.\n\tjStat.identity = function identity(rows, cols) {\n\t if (!isNumber(cols))\n\t cols = rows;\n\t return jStat.create(rows, cols, retIdent);\n\t};\n\t\n\t\n\t// Tests whether a matrix is symmetric\n\tjStat.symmetric = function symmetric(arr) {\n\t var issymmetric = true;\n\t var size = arr.length;\n\t var row, col;\n\t\n\t if (arr.length !== arr[0].length)\n\t return false;\n\t\n\t for (row = 0; row < size; row++) {\n\t for (col = 0; col < size; col++)\n\t if (arr[col][row] !== arr[row][col])\n\t return false;\n\t }\n\t\n\t return true;\n\t};\n\t\n\t\n\t// Set all values to zero.\n\tjStat.clear = function clear(arr) {\n\t return jStat.alter(arr, retZero);\n\t};\n\t\n\t\n\t// Generate sequence.\n\tjStat.seq = function seq(min, max, length, func) {\n\t if (!isFunction(func))\n\t func = false;\n\t\n\t var arr = [];\n\t var hival = calcRdx(min, max);\n\t var step = (max * hival - min * hival) / ((length - 1) * hival);\n\t var current = min;\n\t var cnt;\n\t\n\t // Current is assigned using a technique to compensate for IEEE error.\n\t // TODO: Needs better implementation.\n\t for (cnt = 0;\n\t current <= max;\n\t cnt++, current = (min * hival + step * hival * cnt) / hival) {\n\t arr.push((func ? func(current, cnt) : current));\n\t }\n\t\n\t return arr;\n\t};\n\t\n\t\n\t// arange(5) -> [0,1,2,3,4]\n\t// arange(1,5) -> [1,2,3,4]\n\t// arange(5,1,-1) -> [5,4,3,2]\n\tjStat.arange = function arange(start, end, step) {\n\t var rl = [];\n\t step = step || 1;\n\t if (end === undefined) {\n\t end = start;\n\t start = 0;\n\t }\n\t if (start === end || step === 0) {\n\t return [];\n\t }\n\t if (start < end && step < 0) {\n\t return [];\n\t }\n\t if (start > end && step > 0) {\n\t return [];\n\t }\n\t if (step > 0) {\n\t for (i = start; i < end; i += step) {\n\t rl.push(i);\n\t }\n\t } else {\n\t for (i = start; i > end; i += step) {\n\t rl.push(i);\n\t }\n\t }\n\t return rl;\n\t};\n\t\n\t\n\t// A=[[1,2,3],[4,5,6],[7,8,9]]\n\t// slice(A,{row:{end:2},col:{start:1}}) -> [[2,3],[5,6]]\n\t// slice(A,1,{start:1}) -> [5,6]\n\t// as numpy code A[:2,1:]\n\tjStat.slice = (function(){\n\t function _slice(list, start, end, step) {\n\t // note it's not equal to range.map mode it's a bug\n\t var i;\n\t var rl = [];\n\t var length = list.length;\n\t if (start === undefined && end === undefined && step === undefined) {\n\t return jStat.copy(list);\n\t }\n\t\n\t start = start || 0;\n\t end = end || list.length;\n\t start = start >= 0 ? start : length + start;\n\t end = end >= 0 ? end : length + end;\n\t step = step || 1;\n\t if (start === end || step === 0) {\n\t return [];\n\t }\n\t if (start < end && step < 0) {\n\t return [];\n\t }\n\t if (start > end && step > 0) {\n\t return [];\n\t }\n\t if (step > 0) {\n\t for (i = start; i < end; i += step) {\n\t rl.push(list[i]);\n\t }\n\t } else {\n\t for (i = start; i > end;i += step) {\n\t rl.push(list[i]);\n\t }\n\t }\n\t return rl;\n\t }\n\t\n\t function slice(list, rcSlice) {\n\t rcSlice = rcSlice || {};\n\t if (isNumber(rcSlice.row)) {\n\t if (isNumber(rcSlice.col))\n\t return list[rcSlice.row][rcSlice.col];\n\t var row = jStat.rowa(list, rcSlice.row);\n\t var colSlice = rcSlice.col || {};\n\t return _slice(row, colSlice.start, colSlice.end, colSlice.step);\n\t }\n\t\n\t if (isNumber(rcSlice.col)) {\n\t var col = jStat.cola(list, rcSlice.col);\n\t var rowSlice = rcSlice.row || {};\n\t return _slice(col, rowSlice.start, rowSlice.end, rowSlice.step);\n\t }\n\t\n\t var rowSlice = rcSlice.row || {};\n\t var colSlice = rcSlice.col || {};\n\t var rows = _slice(list, rowSlice.start, rowSlice.end, rowSlice.step);\n\t return rows.map(function(row) {\n\t return _slice(row, colSlice.start, colSlice.end, colSlice.step);\n\t });\n\t }\n\t\n\t return slice;\n\t}());\n\t\n\t\n\t// A=[[1,2,3],[4,5,6],[7,8,9]]\n\t// sliceAssign(A,{row:{start:1},col:{start:1}},[[0,0],[0,0]])\n\t// A=[[1,2,3],[4,0,0],[7,0,0]]\n\tjStat.sliceAssign = function sliceAssign(A, rcSlice, B) {\n\t if (isNumber(rcSlice.row)) {\n\t if (isNumber(rcSlice.col))\n\t return A[rcSlice.row][rcSlice.col] = B;\n\t rcSlice.col = rcSlice.col || {};\n\t rcSlice.col.start = rcSlice.col.start || 0;\n\t rcSlice.col.end = rcSlice.col.end || A[0].length;\n\t rcSlice.col.step = rcSlice.col.step || 1;\n\t var nl = jStat.arange(rcSlice.col.start,\n\t Math.min(A.length, rcSlice.col.end),\n\t rcSlice.col.step);\n\t var m = rcSlice.row;\n\t nl.forEach(function(n, i) {\n\t A[m][n] = B[i];\n\t });\n\t return A;\n\t }\n\t\n\t if (isNumber(rcSlice.col)) {\n\t rcSlice.row = rcSlice.row || {};\n\t rcSlice.row.start = rcSlice.row.start || 0;\n\t rcSlice.row.end = rcSlice.row.end || A.length;\n\t rcSlice.row.step = rcSlice.row.step || 1;\n\t var ml = jStat.arange(rcSlice.row.start,\n\t Math.min(A[0].length, rcSlice.row.end),\n\t rcSlice.row.step);\n\t var n = rcSlice.col;\n\t ml.forEach(function(m, j) {\n\t A[m][n] = B[j];\n\t });\n\t return A;\n\t }\n\t\n\t if (B[0].length === undefined) {\n\t B = [B];\n\t }\n\t rcSlice.row.start = rcSlice.row.start || 0;\n\t rcSlice.row.end = rcSlice.row.end || A.length;\n\t rcSlice.row.step = rcSlice.row.step || 1;\n\t rcSlice.col.start = rcSlice.col.start || 0;\n\t rcSlice.col.end = rcSlice.col.end || A[0].length;\n\t rcSlice.col.step = rcSlice.col.step || 1;\n\t var ml = jStat.arange(rcSlice.row.start,\n\t Math.min(A.length, rcSlice.row.end),\n\t rcSlice.row.step);\n\t var nl = jStat.arange(rcSlice.col.start,\n\t Math.min(A[0].length, rcSlice.col.end),\n\t rcSlice.col.step);\n\t ml.forEach(function(m, i) {\n\t nl.forEach(function(n, j) {\n\t A[m][n] = B[i][j];\n\t });\n\t });\n\t return A;\n\t};\n\t\n\t\n\t// [1,2,3] ->\n\t// [[1,0,0],[0,2,0],[0,0,3]]\n\tjStat.diagonal = function diagonal(diagArray) {\n\t var mat = jStat.zeros(diagArray.length, diagArray.length);\n\t diagArray.forEach(function(t, i) {\n\t mat[i][i] = t;\n\t });\n\t return mat;\n\t};\n\t\n\t\n\t// return copy of A\n\tjStat.copy = function copy(A) {\n\t return A.map(function(row) {\n\t if (isNumber(row))\n\t return row;\n\t return row.map(function(t) {\n\t return t;\n\t });\n\t });\n\t};\n\t\n\t\n\t// TODO: Go over this entire implementation. Seems a tragic waste of resources\n\t// doing all this work. Instead, and while ugly, use new Function() to generate\n\t// a custom function for each static method.\n\t\n\t// Quick reference.\n\tvar jProto = jStat.prototype;\n\t\n\t// Default length.\n\tjProto.length = 0;\n\t\n\t// For internal use only.\n\t// TODO: Check if they're actually used, and if they are then rename them\n\t// to _*\n\tjProto.push = Array.prototype.push;\n\tjProto.sort = Array.prototype.sort;\n\tjProto.splice = Array.prototype.splice;\n\tjProto.slice = Array.prototype.slice;\n\t\n\t\n\t// Return a clean array.\n\tjProto.toArray = function toArray() {\n\t return this.length > 1 ? slice.call(this) : slice.call(this)[0];\n\t};\n\t\n\t\n\t// Map a function to a matrix or vector.\n\tjProto.map = function map(func, toAlter) {\n\t return jStat(jStat.map(this, func, toAlter));\n\t};\n\t\n\t\n\t// Cumulatively combine the elements of a matrix or vector using a function.\n\tjProto.cumreduce = function cumreduce(func, toAlter) {\n\t return jStat(jStat.cumreduce(this, func, toAlter));\n\t};\n\t\n\t\n\t// Destructively alter an array.\n\tjProto.alter = function alter(func) {\n\t jStat.alter(this, func);\n\t return this;\n\t};\n\t\n\t\n\t// Extend prototype with methods that have no argument.\n\t(function(funcs) {\n\t for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n\t jProto[passfunc] = function(func) {\n\t var self = this,\n\t results;\n\t // Check for callback.\n\t if (func) {\n\t setTimeout(function() {\n\t func.call(self, jProto[passfunc].call(self));\n\t });\n\t return this;\n\t }\n\t results = jStat[passfunc](this);\n\t return isArray(results) ? jStat(results) : results;\n\t };\n\t })(funcs[i]);\n\t})('transpose clear symmetric rows cols dimensions diag antidiag'.split(' '));\n\t\n\t\n\t// Extend prototype with methods that have one argument.\n\t(function(funcs) {\n\t for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n\t jProto[passfunc] = function(index, func) {\n\t var self = this;\n\t // check for callback\n\t if (func) {\n\t setTimeout(function() {\n\t func.call(self, jProto[passfunc].call(self, index));\n\t });\n\t return this;\n\t }\n\t return jStat(jStat[passfunc](this, index));\n\t };\n\t })(funcs[i]);\n\t})('row col'.split(' '));\n\t\n\t\n\t// Extend prototype with simple shortcut methods.\n\t(function(funcs) {\n\t for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n\t jProto[passfunc] = new Function(\n\t 'return jStat(jStat.' + passfunc + '.apply(null, arguments));');\n\t })(funcs[i]);\n\t})('create zeros ones rand identity'.split(' '));\n\t\n\t\n\t// Exposing jStat.\n\treturn jStat;\n\t\n\t}(Math));\n\t(function(jStat, Math) {\n\t\n\tvar isFunction = jStat.utils.isFunction;\n\t\n\t// Ascending functions for sort\n\tfunction ascNum(a, b) { return a - b; }\n\t\n\tfunction clip(arg, min, max) {\n\t return Math.max(min, Math.min(arg, max));\n\t}\n\t\n\t\n\t// sum of an array\n\tjStat.sum = function sum(arr) {\n\t var sum = 0;\n\t var i = arr.length;\n\t while (--i >= 0)\n\t sum += arr[i];\n\t return sum;\n\t};\n\t\n\t\n\t// sum squared\n\tjStat.sumsqrd = function sumsqrd(arr) {\n\t var sum = 0;\n\t var i = arr.length;\n\t while (--i >= 0)\n\t sum += arr[i] * arr[i];\n\t return sum;\n\t};\n\t\n\t\n\t// sum of squared errors of prediction (SSE)\n\tjStat.sumsqerr = function sumsqerr(arr) {\n\t var mean = jStat.mean(arr);\n\t var sum = 0;\n\t var i = arr.length;\n\t var tmp;\n\t while (--i >= 0) {\n\t tmp = arr[i] - mean;\n\t sum += tmp * tmp;\n\t }\n\t return sum;\n\t};\n\t\n\t// sum of an array in each row\n\tjStat.sumrow = function sumrow(arr) {\n\t var sum = 0;\n\t var i = arr.length;\n\t while (--i >= 0)\n\t sum += arr[i];\n\t return sum;\n\t};\n\t\n\t// product of an array\n\tjStat.product = function product(arr) {\n\t var prod = 1;\n\t var i = arr.length;\n\t while (--i >= 0)\n\t prod *= arr[i];\n\t return prod;\n\t};\n\t\n\t\n\t// minimum value of an array\n\tjStat.min = function min(arr) {\n\t var low = arr[0];\n\t var i = 0;\n\t while (++i < arr.length)\n\t if (arr[i] < low)\n\t low = arr[i];\n\t return low;\n\t};\n\t\n\t\n\t// maximum value of an array\n\tjStat.max = function max(arr) {\n\t var high = arr[0];\n\t var i = 0;\n\t while (++i < arr.length)\n\t if (arr[i] > high)\n\t high = arr[i];\n\t return high;\n\t};\n\t\n\t\n\t// unique values of an array\n\tjStat.unique = function unique(arr) {\n\t var hash = {}, _arr = [];\n\t for(var i = 0; i < arr.length; i++) {\n\t if (!hash[arr[i]]) {\n\t hash[arr[i]] = true;\n\t _arr.push(arr[i]);\n\t }\n\t }\n\t return _arr;\n\t};\n\t\n\t\n\t// mean value of an array\n\tjStat.mean = function mean(arr) {\n\t return jStat.sum(arr) / arr.length;\n\t};\n\t\n\t\n\t// mean squared error (MSE)\n\tjStat.meansqerr = function meansqerr(arr) {\n\t return jStat.sumsqerr(arr) / arr.length;\n\t};\n\t\n\t\n\t// geometric mean of an array\n\tjStat.geomean = function geomean(arr) {\n\t return Math.pow(jStat.product(arr), 1 / arr.length);\n\t};\n\t\n\t\n\t// median of an array\n\tjStat.median = function median(arr) {\n\t var arrlen = arr.length;\n\t var _arr = arr.slice().sort(ascNum);\n\t // check if array is even or odd, then return the appropriate\n\t return !(arrlen & 1)\n\t ? (_arr[(arrlen / 2) - 1 ] + _arr[(arrlen / 2)]) / 2\n\t : _arr[(arrlen / 2) | 0 ];\n\t};\n\t\n\t\n\t// cumulative sum of an array\n\tjStat.cumsum = function cumsum(arr) {\n\t return jStat.cumreduce(arr, function (a, b) { return a + b; });\n\t};\n\t\n\t\n\t// cumulative product of an array\n\tjStat.cumprod = function cumprod(arr) {\n\t return jStat.cumreduce(arr, function (a, b) { return a * b; });\n\t};\n\t\n\t\n\t// successive differences of a sequence\n\tjStat.diff = function diff(arr) {\n\t var diffs = [];\n\t var arrLen = arr.length;\n\t var i;\n\t for (var i = 1; i < arrLen; i++)\n\t diffs.push(arr[i] - arr[i - 1]);\n\t return diffs;\n\t};\n\t\n\t\n\t// ranks of an array\n\tjStat.rank = function (arr) {\n\t var arrlen = arr.length;\n\t var sorted = arr.slice().sort(ascNum);\n\t var ranks = new Array(arrlen);\n\t for (var i = 0; i < arrlen; i++) {\n\t var first = sorted.indexOf(arr[i]);\n\t var last = sorted.lastIndexOf(arr[i]);\n\t if (first === last) {\n\t var val = first;\n\t } else {\n\t var val = (first + last) / 2;\n\t }\n\t ranks[i] = val + 1;\n\t }\n\t return ranks;\n\t};\n\t\n\t\n\t// mode of an array\n\t// if there are multiple modes of an array, return all of them\n\t// is this the appropriate way of handling it?\n\tjStat.mode = function mode(arr) {\n\t var arrLen = arr.length;\n\t var _arr = arr.slice().sort(ascNum);\n\t var count = 1;\n\t var maxCount = 0;\n\t var numMaxCount = 0;\n\t var mode_arr = [];\n\t var i;\n\t\n\t for (var i = 0; i < arrLen; i++) {\n\t if (_arr[i] === _arr[i + 1]) {\n\t count++;\n\t } else {\n\t if (count > maxCount) {\n\t mode_arr = [_arr[i]];\n\t maxCount = count;\n\t numMaxCount = 0;\n\t }\n\t // are there multiple max counts\n\t else if (count === maxCount) {\n\t mode_arr.push(_arr[i]);\n\t numMaxCount++;\n\t }\n\t // resetting count for new value in array\n\t count = 1;\n\t }\n\t }\n\t\n\t return numMaxCount === 0 ? mode_arr[0] : mode_arr;\n\t};\n\t\n\t\n\t// range of an array\n\tjStat.range = function range(arr) {\n\t return jStat.max(arr) - jStat.min(arr);\n\t};\n\t\n\t// variance of an array\n\t// flag = true indicates sample instead of population\n\tjStat.variance = function variance(arr, flag) {\n\t return jStat.sumsqerr(arr) / (arr.length - (flag ? 1 : 0));\n\t};\n\t\n\t// deviation of an array\n\tjStat.deviation = function (arr) {\n\t var mean = jStat.mean(arr);\n\t var arrlen = arr.length;\n\t var dev = new Array(arrlen);\n\t for (var i = 0; i < arrlen; i++) {\n\t dev[i] = arr[i] - mean;\n\t }\n\t return dev;\n\t};\n\t\n\t// standard deviation of an array\n\t// flag = true indicates sample instead of population\n\tjStat.stdev = function stdev(arr, flag) {\n\t return Math.sqrt(jStat.variance(arr, flag));\n\t};\n\t\n\t\n\t// mean deviation (mean absolute deviation) of an array\n\tjStat.meandev = function meandev(arr) {\n\t var devSum = 0;\n\t var mean = jStat.mean(arr);\n\t var i;\n\t for (var i = arr.length - 1; i >= 0; i--)\n\t devSum += Math.abs(arr[i] - mean);\n\t return devSum / arr.length;\n\t};\n\t\n\t\n\t// median deviation (median absolute deviation) of an array\n\tjStat.meddev = function meddev(arr) {\n\t var devSum = 0;\n\t var median = jStat.median(arr);\n\t var i;\n\t for (var i = arr.length - 1; i >= 0; i--)\n\t devSum += Math.abs(arr[i] - median);\n\t return devSum / arr.length;\n\t};\n\t\n\t\n\t// coefficient of variation\n\tjStat.coeffvar = function coeffvar(arr) {\n\t return jStat.stdev(arr) / jStat.mean(arr);\n\t};\n\t\n\t\n\t// quartiles of an array\n\tjStat.quartiles = function quartiles(arr) {\n\t var arrlen = arr.length;\n\t var _arr = arr.slice().sort(ascNum);\n\t return [\n\t _arr[ Math.round((arrlen) / 4) - 1 ],\n\t _arr[ Math.round((arrlen) / 2) - 1 ],\n\t _arr[ Math.round((arrlen) * 3 / 4) - 1 ]\n\t ];\n\t};\n\t\n\t\n\t// Arbitary quantiles of an array. Direct port of the scipy.stats\n\t// implementation by Pierre GF Gerard-Marchant.\n\tjStat.quantiles = function quantiles(arr, quantilesArray, alphap, betap) {\n\t var sortedArray = arr.slice().sort(ascNum);\n\t var quantileVals = [quantilesArray.length];\n\t var n = arr.length;\n\t var i, p, m, aleph, k, gamma;\n\t\n\t if (typeof alphap === 'undefined')\n\t alphap = 3 / 8;\n\t if (typeof betap === 'undefined')\n\t betap = 3 / 8;\n\t\n\t for (var i = 0; i < quantilesArray.length; i++) {\n\t p = quantilesArray[i];\n\t m = alphap + p * (1 - alphap - betap);\n\t aleph = n * p + m;\n\t k = Math.floor(clip(aleph, 1, n - 1));\n\t gamma = clip(aleph - k, 0, 1);\n\t quantileVals[i] = (1 - gamma) * sortedArray[k - 1] + gamma * sortedArray[k];\n\t }\n\t\n\t return quantileVals;\n\t};\n\t\n\t// Returns the k-th percentile of values in a range, where k is in the\n\t// range 0..1, exclusive.\n\tjStat.percentile = function percentile(arr, k) {\n\t var _arr = arr.slice().sort(ascNum);\n\t var realIndex = k * (_arr.length - 1);\n\t var index = parseInt(realIndex);\n\t var frac = realIndex - index;\n\t\n\t if (index + 1 < _arr.length) {\n\t return _arr[index] * (1 - frac) + _arr[index + 1] * frac;\n\t } else {\n\t return _arr[index];\n\t }\n\t}\n\t\n\t\n\t// The percentile rank of score in a given array. Returns the percentage\n\t// of all values in the input array that are less than (kind='strict') or\n\t// less or equal than (kind='weak') score. Default is weak.\n\tjStat.percentileOfScore = function percentileOfScore(arr, score, kind) {\n\t var counter = 0;\n\t var len = arr.length;\n\t var strict = false;\n\t var value, i;\n\t\n\t if (kind === 'strict')\n\t strict = true;\n\t\n\t for (var i = 0; i < len; i++) {\n\t value = arr[i];\n\t if ((strict && value < score) ||\n\t (!strict && value <= score)) {\n\t counter++;\n\t }\n\t }\n\t\n\t return counter / len;\n\t};\n\t\n\t\n\t// Histogram (bin count) data\n\tjStat.histogram = function histogram(arr, bins) {\n\t var first = jStat.min(arr);\n\t var binCnt = bins || 4;\n\t var binWidth = (jStat.max(arr) - first) / binCnt;\n\t var len = arr.length;\n\t var bins = [];\n\t var i;\n\t\n\t for (var i = 0; i < binCnt; i++)\n\t bins[i] = 0;\n\t for (var i = 0; i < len; i++)\n\t bins[Math.min(Math.floor(((arr[i] - first) / binWidth)), binCnt - 1)] += 1;\n\t\n\t return bins;\n\t};\n\t\n\t\n\t// covariance of two arrays\n\tjStat.covariance = function covariance(arr1, arr2) {\n\t var u = jStat.mean(arr1);\n\t var v = jStat.mean(arr2);\n\t var arr1Len = arr1.length;\n\t var sq_dev = new Array(arr1Len);\n\t var i;\n\t\n\t for (var i = 0; i < arr1Len; i++)\n\t sq_dev[i] = (arr1[i] - u) * (arr2[i] - v);\n\t\n\t return jStat.sum(sq_dev) / (arr1Len - 1);\n\t};\n\t\n\t\n\t// (pearson's) population correlation coefficient, rho\n\tjStat.corrcoeff = function corrcoeff(arr1, arr2) {\n\t return jStat.covariance(arr1, arr2) /\n\t jStat.stdev(arr1, 1) /\n\t jStat.stdev(arr2, 1);\n\t};\n\t\n\t // (spearman's) rank correlation coefficient, sp\n\tjStat.spearmancoeff = function (arr1, arr2) {\n\t arr1 = jStat.rank(arr1);\n\t arr2 = jStat.rank(arr2);\n\t var arr1dev = jStat.deviation(arr1);\n\t var arr2dev = jStat.deviation(arr2);\n\t return jStat.sum(arr1dev.map(function (x, i) {\n\t return x * arr2dev[i];\n\t })) /\n\t Math.sqrt(jStat.sum(arr1dev.map(function (x) {\n\t return Math.pow(x, 2);\n\t })) * jStat.sum(arr2dev.map(function (x) {\n\t return Math.pow(x, 2);\n\t }))\n\t );\n\t}\n\t\n\t\n\t// statistical standardized moments (general form of skew/kurt)\n\tjStat.stanMoment = function stanMoment(arr, n) {\n\t var mu = jStat.mean(arr);\n\t var sigma = jStat.stdev(arr);\n\t var len = arr.length;\n\t var skewSum = 0;\n\t\n\t for (var i = 0; i < len; i++)\n\t skewSum += Math.pow((arr[i] - mu) / sigma, n);\n\t\n\t return skewSum / arr.length;\n\t};\n\t\n\t// (pearson's) moment coefficient of skewness\n\tjStat.skewness = function skewness(arr) {\n\t return jStat.stanMoment(arr, 3);\n\t};\n\t\n\t// (pearson's) (excess) kurtosis\n\tjStat.kurtosis = function kurtosis(arr) {\n\t return jStat.stanMoment(arr, 4) - 3;\n\t};\n\t\n\t\n\tvar jProto = jStat.prototype;\n\t\n\t\n\t// Extend jProto with method for calculating cumulative sums and products.\n\t// This differs from the similar extension below as cumsum and cumprod should\n\t// not be run again in the case fullbool === true.\n\t// If a matrix is passed, automatically assume operation should be done on the\n\t// columns.\n\t(function(funcs) {\n\t for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n\t // If a matrix is passed, automatically assume operation should be done on\n\t // the columns.\n\t jProto[passfunc] = function(fullbool, func) {\n\t var arr = [];\n\t var i = 0;\n\t var tmpthis = this;\n\t // Assignment reassignation depending on how parameters were passed in.\n\t if (isFunction(fullbool)) {\n\t func = fullbool;\n\t fullbool = false;\n\t }\n\t // Check if a callback was passed with the function.\n\t if (func) {\n\t setTimeout(function() {\n\t func.call(tmpthis, jProto[passfunc].call(tmpthis, fullbool));\n\t });\n\t return this;\n\t }\n\t // Check if matrix and run calculations.\n\t if (this.length > 1) {\n\t tmpthis = fullbool === true ? this : this.transpose();\n\t for (; i < tmpthis.length; i++)\n\t arr[i] = jStat[passfunc](tmpthis[i]);\n\t return arr;\n\t }\n\t // Pass fullbool if only vector, not a matrix. for variance and stdev.\n\t return jStat[passfunc](this[0], fullbool);\n\t };\n\t })(funcs[i]);\n\t})(('cumsum cumprod').split(' '));\n\t\n\t\n\t// Extend jProto with methods which don't require arguments and work on columns.\n\t(function(funcs) {\n\t for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n\t // If a matrix is passed, automatically assume operation should be done on\n\t // the columns.\n\t jProto[passfunc] = function(fullbool, func) {\n\t var arr = [];\n\t var i = 0;\n\t var tmpthis = this;\n\t // Assignment reassignation depending on how parameters were passed in.\n\t if (isFunction(fullbool)) {\n\t func = fullbool;\n\t fullbool = false;\n\t }\n\t // Check if a callback was passed with the function.\n\t if (func) {\n\t setTimeout(function() {\n\t func.call(tmpthis, jProto[passfunc].call(tmpthis, fullbool));\n\t });\n\t return this;\n\t }\n\t // Check if matrix and run calculations.\n\t if (this.length > 1) {\n\t if (passfunc !== 'sumrow')\n\t tmpthis = fullbool === true ? this : this.transpose();\n\t for (; i < tmpthis.length; i++)\n\t arr[i] = jStat[passfunc](tmpthis[i]);\n\t return fullbool === true\n\t ? jStat[passfunc](jStat.utils.toVector(arr))\n\t : arr;\n\t }\n\t // Pass fullbool if only vector, not a matrix. for variance and stdev.\n\t return jStat[passfunc](this[0], fullbool);\n\t };\n\t })(funcs[i]);\n\t})(('sum sumsqrd sumsqerr sumrow product min max unique mean meansqerr ' +\n\t 'geomean median diff rank mode range variance deviation stdev meandev ' +\n\t 'meddev coeffvar quartiles histogram skewness kurtosis').split(' '));\n\t\n\t\n\t// Extend jProto with functions that take arguments. Operations on matrices are\n\t// done on columns.\n\t(function(funcs) {\n\t for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n\t jProto[passfunc] = function() {\n\t var arr = [];\n\t var i = 0;\n\t var tmpthis = this;\n\t var args = Array.prototype.slice.call(arguments);\n\t\n\t // If the last argument is a function, we assume it's a callback; we\n\t // strip the callback out and call the function again.\n\t if (isFunction(args[args.length - 1])) {\n\t var callbackFunction = args[args.length - 1];\n\t var argsToPass = args.slice(0, args.length - 1);\n\t\n\t setTimeout(function() {\n\t callbackFunction.call(tmpthis,\n\t jProto[passfunc].apply(tmpthis, argsToPass));\n\t });\n\t return this;\n\t\n\t // Otherwise we curry the function args and call normally.\n\t } else {\n\t var callbackFunction = undefined;\n\t var curriedFunction = function curriedFunction(vector) {\n\t return jStat[passfunc].apply(tmpthis, [vector].concat(args));\n\t }\n\t }\n\t\n\t // If this is a matrix, run column-by-column.\n\t if (this.length > 1) {\n\t tmpthis = tmpthis.transpose();\n\t for (; i < tmpthis.length; i++)\n\t arr[i] = curriedFunction(tmpthis[i]);\n\t return arr;\n\t }\n\t\n\t // Otherwise run on the vector.\n\t return curriedFunction(this[0]);\n\t };\n\t })(funcs[i]);\n\t})('quantiles percentileOfScore'.split(' '));\n\t\n\t}(this.jStat, Math));\n\t// Special functions //\n\t(function(jStat, Math) {\n\t\n\t// Log-gamma function\n\tjStat.gammaln = function gammaln(x) {\n\t var j = 0;\n\t var cof = [\n\t 76.18009172947146, -86.50532032941677, 24.01409824083091,\n\t -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5\n\t ];\n\t var ser = 1.000000000190015;\n\t var xx, y, tmp;\n\t tmp = (y = xx = x) + 5.5;\n\t tmp -= (xx + 0.5) * Math.log(tmp);\n\t for (; j < 6; j++)\n\t ser += cof[j] / ++y;\n\t return Math.log(2.5066282746310005 * ser / xx) - tmp;\n\t};\n\t\n\t\n\t// gamma of x\n\tjStat.gammafn = function gammafn(x) {\n\t var p = [-1.716185138865495, 24.76565080557592, -379.80425647094563,\n\t 629.3311553128184, 866.9662027904133, -31451.272968848367,\n\t -36144.413418691176, 66456.14382024054\n\t ];\n\t var q = [-30.8402300119739, 315.35062697960416, -1015.1563674902192,\n\t -3107.771671572311, 22538.118420980151, 4755.8462775278811,\n\t -134659.9598649693, -115132.2596755535];\n\t var fact = false;\n\t var n = 0;\n\t var xden = 0;\n\t var xnum = 0;\n\t var y = x;\n\t var i, z, yi, res, sum, ysq;\n\t if (y <= 0) {\n\t res = y % 1 + 3.6e-16;\n\t if (res) {\n\t fact = (!(y & 1) ? 1 : -1) * Math.PI / Math.sin(Math.PI * res);\n\t y = 1 - y;\n\t } else {\n\t return Infinity;\n\t }\n\t }\n\t yi = y;\n\t if (y < 1) {\n\t z = y++;\n\t } else {\n\t z = (y -= n = (y | 0) - 1) - 1;\n\t }\n\t for (var i = 0; i < 8; ++i) {\n\t xnum = (xnum + p[i]) * z;\n\t xden = xden * z + q[i];\n\t }\n\t res = xnum / xden + 1;\n\t if (yi < y) {\n\t res /= yi;\n\t } else if (yi > y) {\n\t for (var i = 0; i < n; ++i) {\n\t res *= y;\n\t y++;\n\t }\n\t }\n\t if (fact) {\n\t res = fact / res;\n\t }\n\t return res;\n\t};\n\t\n\t\n\t// lower incomplete gamma function, which is usually typeset with a\n\t// lower-case greek gamma as the function symbol\n\tjStat.gammap = function gammap(a, x) {\n\t return jStat.lowRegGamma(a, x) * jStat.gammafn(a);\n\t};\n\t\n\t\n\t// The lower regularized incomplete gamma function, usually written P(a,x)\n\tjStat.lowRegGamma = function lowRegGamma(a, x) {\n\t var aln = jStat.gammaln(a);\n\t var ap = a;\n\t var sum = 1 / a;\n\t var del = sum;\n\t var b = x + 1 - a;\n\t var c = 1 / 1.0e-30;\n\t var d = 1 / b;\n\t var h = d;\n\t var i = 1;\n\t // calculate maximum number of itterations required for a\n\t var ITMAX = -~(Math.log((a >= 1) ? a : 1 / a) * 8.5 + a * 0.4 + 17);\n\t var an, endval;\n\t\n\t if (x < 0 || a <= 0) {\n\t return NaN;\n\t } else if (x < a + 1) {\n\t for (; i <= ITMAX; i++) {\n\t sum += del *= x / ++ap;\n\t }\n\t return (sum * Math.exp(-x + a * Math.log(x) - (aln)));\n\t }\n\t\n\t for (; i <= ITMAX; i++) {\n\t an = -i * (i - a);\n\t b += 2;\n\t d = an * d + b;\n\t c = b + an / c;\n\t d = 1 / d;\n\t h *= d * c;\n\t }\n\t\n\t return (1 - h * Math.exp(-x + a * Math.log(x) - (aln)));\n\t};\n\t\n\t// natural log factorial of n\n\tjStat.factorialln = function factorialln(n) {\n\t return n < 0 ? NaN : jStat.gammaln(n + 1);\n\t};\n\t\n\t// factorial of n\n\tjStat.factorial = function factorial(n) {\n\t return n < 0 ? NaN : jStat.gammafn(n + 1);\n\t};\n\t\n\t// combinations of n, m\n\tjStat.combination = function combination(n, m) {\n\t // make sure n or m don't exceed the upper limit of usable values\n\t return (n > 170 || m > 170)\n\t ? Math.exp(jStat.combinationln(n, m))\n\t : (jStat.factorial(n) / jStat.factorial(m)) / jStat.factorial(n - m);\n\t};\n\t\n\t\n\tjStat.combinationln = function combinationln(n, m){\n\t return jStat.factorialln(n) - jStat.factorialln(m) - jStat.factorialln(n - m);\n\t};\n\t\n\t\n\t// permutations of n, m\n\tjStat.permutation = function permutation(n, m) {\n\t return jStat.factorial(n) / jStat.factorial(n - m);\n\t};\n\t\n\t\n\t// beta function\n\tjStat.betafn = function betafn(x, y) {\n\t // ensure arguments are positive\n\t if (x <= 0 || y <= 0)\n\t return undefined;\n\t // make sure x + y doesn't exceed the upper limit of usable values\n\t return (x + y > 170)\n\t ? Math.exp(jStat.betaln(x, y))\n\t : jStat.gammafn(x) * jStat.gammafn(y) / jStat.gammafn(x + y);\n\t};\n\t\n\t\n\t// natural logarithm of beta function\n\tjStat.betaln = function betaln(x, y) {\n\t return jStat.gammaln(x) + jStat.gammaln(y) - jStat.gammaln(x + y);\n\t};\n\t\n\t\n\t// Evaluates the continued fraction for incomplete beta function by modified\n\t// Lentz's method.\n\tjStat.betacf = function betacf(x, a, b) {\n\t var fpmin = 1e-30;\n\t var m = 1;\n\t var qab = a + b;\n\t var qap = a + 1;\n\t var qam = a - 1;\n\t var c = 1;\n\t var d = 1 - qab * x / qap;\n\t var m2, aa, del, h;\n\t\n\t // These q's will be used in factors that occur in the coefficients\n\t if (Math.abs(d) < fpmin)\n\t d = fpmin;\n\t d = 1 / d;\n\t h = d;\n\t\n\t for (; m <= 100; m++) {\n\t m2 = 2 * m;\n\t aa = m * (b - m) * x / ((qam + m2) * (a + m2));\n\t // One step (the even one) of the recurrence\n\t d = 1 + aa * d;\n\t if (Math.abs(d) < fpmin)\n\t d = fpmin;\n\t c = 1 + aa / c;\n\t if (Math.abs(c) < fpmin)\n\t c = fpmin;\n\t d = 1 / d;\n\t h *= d * c;\n\t aa = -(a + m) * (qab + m) * x / ((a + m2) * (qap + m2));\n\t // Next step of the recurrence (the odd one)\n\t d = 1 + aa * d;\n\t if (Math.abs(d) < fpmin)\n\t d = fpmin;\n\t c = 1 + aa / c;\n\t if (Math.abs(c) < fpmin)\n\t c = fpmin;\n\t d = 1 / d;\n\t del = d * c;\n\t h *= del;\n\t if (Math.abs(del - 1.0) < 3e-7)\n\t break;\n\t }\n\t\n\t return h;\n\t};\n\t\n\t\n\t// Returns the inverse of the lower regularized inomplete gamma function\n\tjStat.gammapinv = function gammapinv(p, a) {\n\t var j = 0;\n\t var a1 = a - 1;\n\t var EPS = 1e-8;\n\t var gln = jStat.gammaln(a);\n\t var x, err, t, u, pp, lna1, afac;\n\t\n\t if (p >= 1)\n\t return Math.max(100, a + 100 * Math.sqrt(a));\n\t if (p <= 0)\n\t return 0;\n\t if (a > 1) {\n\t lna1 = Math.log(a1);\n\t afac = Math.exp(a1 * (lna1 - 1) - gln);\n\t pp = (p < 0.5) ? p : 1 - p;\n\t t = Math.sqrt(-2 * Math.log(pp));\n\t x = (2.30753 + t * 0.27061) / (1 + t * (0.99229 + t * 0.04481)) - t;\n\t if (p < 0.5)\n\t x = -x;\n\t x = Math.max(1e-3,\n\t a * Math.pow(1 - 1 / (9 * a) - x / (3 * Math.sqrt(a)), 3));\n\t } else {\n\t t = 1 - a * (0.253 + a * 0.12);\n\t if (p < t)\n\t x = Math.pow(p / t, 1 / a);\n\t else\n\t x = 1 - Math.log(1 - (p - t) / (1 - t));\n\t }\n\t\n\t for(; j < 12; j++) {\n\t if (x <= 0)\n\t return 0;\n\t err = jStat.lowRegGamma(a, x) - p;\n\t if (a > 1)\n\t t = afac * Math.exp(-(x - a1) + a1 * (Math.log(x) - lna1));\n\t else\n\t t = Math.exp(-x + a1 * Math.log(x) - gln);\n\t u = err / t;\n\t x -= (t = u / (1 - 0.5 * Math.min(1, u * ((a - 1) / x - 1))));\n\t if (x <= 0)\n\t x = 0.5 * (x + t);\n\t if (Math.abs(t) < EPS * x)\n\t break;\n\t }\n\t\n\t return x;\n\t};\n\t\n\t\n\t// Returns the error function erf(x)\n\tjStat.erf = function erf(x) {\n\t var cof = [-1.3026537197817094, 6.4196979235649026e-1, 1.9476473204185836e-2,\n\t -9.561514786808631e-3, -9.46595344482036e-4, 3.66839497852761e-4,\n\t 4.2523324806907e-5, -2.0278578112534e-5, -1.624290004647e-6,\n\t 1.303655835580e-6, 1.5626441722e-8, -8.5238095915e-8,\n\t 6.529054439e-9, 5.059343495e-9, -9.91364156e-10,\n\t -2.27365122e-10, 9.6467911e-11, 2.394038e-12,\n\t -6.886027e-12, 8.94487e-13, 3.13092e-13,\n\t -1.12708e-13, 3.81e-16, 7.106e-15,\n\t -1.523e-15, -9.4e-17, 1.21e-16,\n\t -2.8e-17];\n\t var j = cof.length - 1;\n\t var isneg = false;\n\t var d = 0;\n\t var dd = 0;\n\t var t, ty, tmp, res;\n\t\n\t if (x < 0) {\n\t x = -x;\n\t isneg = true;\n\t }\n\t\n\t t = 2 / (2 + x);\n\t ty = 4 * t - 2;\n\t\n\t for(; j > 0; j--) {\n\t tmp = d;\n\t d = ty * d - dd + cof[j];\n\t dd = tmp;\n\t }\n\t\n\t res = t * Math.exp(-x * x + 0.5 * (cof[0] + ty * d) - dd);\n\t return isneg ? res - 1 : 1 - res;\n\t};\n\t\n\t\n\t// Returns the complmentary error function erfc(x)\n\tjStat.erfc = function erfc(x) {\n\t return 1 - jStat.erf(x);\n\t};\n\t\n\t\n\t// Returns the inverse of the complementary error function\n\tjStat.erfcinv = function erfcinv(p) {\n\t var j = 0;\n\t var x, err, t, pp;\n\t if (p >= 2)\n\t return -100;\n\t if (p <= 0)\n\t return 100;\n\t pp = (p < 1) ? p : 2 - p;\n\t t = Math.sqrt(-2 * Math.log(pp / 2));\n\t x = -0.70711 * ((2.30753 + t * 0.27061) /\n\t (1 + t * (0.99229 + t * 0.04481)) - t);\n\t for (; j < 2; j++) {\n\t err = jStat.erfc(x) - pp;\n\t x += err / (1.12837916709551257 * Math.exp(-x * x) - x * err);\n\t }\n\t return (p < 1) ? x : -x;\n\t};\n\t\n\t\n\t// Returns the inverse of the incomplete beta function\n\tjStat.ibetainv = function ibetainv(p, a, b) {\n\t var EPS = 1e-8;\n\t var a1 = a - 1;\n\t var b1 = b - 1;\n\t var j = 0;\n\t var lna, lnb, pp, t, u, err, x, al, h, w, afac;\n\t if (p <= 0)\n\t return 0;\n\t if (p >= 1)\n\t return 1;\n\t if (a >= 1 && b >= 1) {\n\t pp = (p < 0.5) ? p : 1 - p;\n\t t = Math.sqrt(-2 * Math.log(pp));\n\t x = (2.30753 + t * 0.27061) / (1 + t* (0.99229 + t * 0.04481)) - t;\n\t if (p < 0.5)\n\t x = -x;\n\t al = (x * x - 3) / 6;\n\t h = 2 / (1 / (2 * a - 1) + 1 / (2 * b - 1));\n\t w = (x * Math.sqrt(al + h) / h) - (1 / (2 * b - 1) - 1 / (2 * a - 1)) *\n\t (al + 5 / 6 - 2 / (3 * h));\n\t x = a / (a + b * Math.exp(2 * w));\n\t } else {\n\t lna = Math.log(a / (a + b));\n\t lnb = Math.log(b / (a + b));\n\t t = Math.exp(a * lna) / a;\n\t u = Math.exp(b * lnb) / b;\n\t w = t + u;\n\t if (p < t / w)\n\t x = Math.pow(a * w * p, 1 / a);\n\t else\n\t x = 1 - Math.pow(b * w * (1 - p), 1 / b);\n\t }\n\t afac = -jStat.gammaln(a) - jStat.gammaln(b) + jStat.gammaln(a + b);\n\t for(; j < 10; j++) {\n\t if (x === 0 || x === 1)\n\t return x;\n\t err = jStat.ibeta(x, a, b) - p;\n\t t = Math.exp(a1 * Math.log(x) + b1 * Math.log(1 - x) + afac);\n\t u = err / t;\n\t x -= (t = u / (1 - 0.5 * Math.min(1, u * (a1 / x - b1 / (1 - x)))));\n\t if (x <= 0)\n\t x = 0.5 * (x + t);\n\t if (x >= 1)\n\t x = 0.5 * (x + t + 1);\n\t if (Math.abs(t) < EPS * x && j > 0)\n\t break;\n\t }\n\t return x;\n\t};\n\t\n\t\n\t// Returns the incomplete beta function I_x(a,b)\n\tjStat.ibeta = function ibeta(x, a, b) {\n\t // Factors in front of the continued fraction.\n\t var bt = (x === 0 || x === 1) ? 0 :\n\t Math.exp(jStat.gammaln(a + b) - jStat.gammaln(a) -\n\t jStat.gammaln(b) + a * Math.log(x) + b *\n\t Math.log(1 - x));\n\t if (x < 0 || x > 1)\n\t return false;\n\t if (x < (a + 1) / (a + b + 2))\n\t // Use continued fraction directly.\n\t return bt * jStat.betacf(x, a, b) / a;\n\t // else use continued fraction after making the symmetry transformation.\n\t return 1 - bt * jStat.betacf(1 - x, b, a) / b;\n\t};\n\t\n\t\n\t// Returns a normal deviate (mu=0, sigma=1).\n\t// If n and m are specified it returns a object of normal deviates.\n\tjStat.randn = function randn(n, m) {\n\t var u, v, x, y, q, mat;\n\t if (!m)\n\t m = n;\n\t if (n)\n\t return jStat.create(n, m, function() { return jStat.randn(); });\n\t do {\n\t u = Math.random();\n\t v = 1.7156 * (Math.random() - 0.5);\n\t x = u - 0.449871;\n\t y = Math.abs(v) + 0.386595;\n\t q = x * x + y * (0.19600 * y - 0.25472 * x);\n\t } while (q > 0.27597 && (q > 0.27846 || v * v > -4 * Math.log(u) * u * u));\n\t return v / u;\n\t};\n\t\n\t\n\t// Returns a gamma deviate by the method of Marsaglia and Tsang.\n\tjStat.randg = function randg(shape, n, m) {\n\t var oalph = shape;\n\t var a1, a2, u, v, x, mat;\n\t if (!m)\n\t m = n;\n\t if (!shape)\n\t shape = 1;\n\t if (n) {\n\t mat = jStat.zeros(n,m);\n\t mat.alter(function() { return jStat.randg(shape); });\n\t return mat;\n\t }\n\t if (shape < 1)\n\t shape += 1;\n\t a1 = shape - 1 / 3;\n\t a2 = 1 / Math.sqrt(9 * a1);\n\t do {\n\t do {\n\t x = jStat.randn();\n\t v = 1 + a2 * x;\n\t } while(v <= 0);\n\t v = v * v * v;\n\t u = Math.random();\n\t } while(u > 1 - 0.331 * Math.pow(x, 4) &&\n\t Math.log(u) > 0.5 * x*x + a1 * (1 - v + Math.log(v)));\n\t // alpha > 1\n\t if (shape == oalph)\n\t return a1 * v;\n\t // alpha < 1\n\t do {\n\t u = Math.random();\n\t } while(u === 0);\n\t return Math.pow(u, 1 / oalph) * a1 * v;\n\t};\n\t\n\t\n\t// making use of static methods on the instance\n\t(function(funcs) {\n\t for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n\t jStat.fn[passfunc] = function() {\n\t return jStat(\n\t jStat.map(this, function(value) { return jStat[passfunc](value); }));\n\t }\n\t })(funcs[i]);\n\t})('gammaln gammafn factorial factorialln'.split(' '));\n\t\n\t\n\t(function(funcs) {\n\t for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n\t jStat.fn[passfunc] = function() {\n\t return jStat(jStat[passfunc].apply(null, arguments));\n\t };\n\t })(funcs[i]);\n\t})('randn'.split(' '));\n\t\n\t}(this.jStat, Math));\n\t(function(jStat, Math) {\n\t\n\t// generate all distribution instance methods\n\t(function(list) {\n\t for (var i = 0; i < list.length; i++) (function(func) {\n\t // distribution instance method\n\t jStat[func] = function(a, b, c) {\n\t if (!(this instanceof arguments.callee))\n\t return new arguments.callee(a, b, c);\n\t this._a = a;\n\t this._b = b;\n\t this._c = c;\n\t return this;\n\t };\n\t // distribution method to be used on a jStat instance\n\t jStat.fn[func] = function(a, b, c) {\n\t var newthis = jStat[func](a, b, c);\n\t newthis.data = this;\n\t return newthis;\n\t };\n\t // sample instance method\n\t jStat[func].prototype.sample = function(arr) {\n\t var a = this._a;\n\t var b = this._b;\n\t var c = this._c;\n\t if (arr)\n\t return jStat.alter(arr, function() {\n\t return jStat[func].sample(a, b, c);\n\t });\n\t else\n\t return jStat[func].sample(a, b, c);\n\t };\n\t // generate the pdf, cdf and inv instance methods\n\t (function(vals) {\n\t for (var i = 0; i < vals.length; i++) (function(fnfunc) {\n\t jStat[func].prototype[fnfunc] = function(x) {\n\t var a = this._a;\n\t var b = this._b;\n\t var c = this._c;\n\t if (!x && x !== 0)\n\t x = this.data;\n\t if (typeof x !== 'number') {\n\t return jStat.fn.map.call(x, function(x) {\n\t return jStat[func][fnfunc](x, a, b, c);\n\t });\n\t }\n\t return jStat[func][fnfunc](x, a, b, c);\n\t };\n\t })(vals[i]);\n\t })('pdf cdf inv'.split(' '));\n\t // generate the mean, median, mode and variance instance methods\n\t (function(vals) {\n\t for (var i = 0; i < vals.length; i++) (function(fnfunc) {\n\t jStat[func].prototype[fnfunc] = function() {\n\t return jStat[func][fnfunc](this._a, this._b, this._c);\n\t };\n\t })(vals[i]);\n\t })('mean median mode variance'.split(' '));\n\t })(list[i]);\n\t})((\n\t 'beta centralF cauchy chisquare exponential gamma invgamma kumaraswamy ' +\n\t 'laplace lognormal noncentralt normal pareto studentt weibull uniform ' +\n\t 'binomial negbin hypgeom poisson triangular'\n\t).split(' '));\n\t\n\t\n\t\n\t// extend beta function with static methods\n\tjStat.extend(jStat.beta, {\n\t pdf: function pdf(x, alpha, beta) {\n\t // PDF is zero outside the support\n\t if (x > 1 || x < 0)\n\t return 0;\n\t // PDF is one for the uniform case\n\t if (alpha == 1 && beta == 1)\n\t return 1;\n\t\n\t if (alpha < 512 && beta < 512) {\n\t return (Math.pow(x, alpha - 1) * Math.pow(1 - x, beta - 1)) /\n\t jStat.betafn(alpha, beta);\n\t } else {\n\t return Math.exp((alpha - 1) * Math.log(x) +\n\t (beta - 1) * Math.log(1 - x) -\n\t jStat.betaln(alpha, beta));\n\t }\n\t },\n\t\n\t cdf: function cdf(x, alpha, beta) {\n\t return (x > 1 || x < 0) ? (x > 1) * 1 : jStat.ibeta(x, alpha, beta);\n\t },\n\t\n\t inv: function inv(x, alpha, beta) {\n\t return jStat.ibetainv(x, alpha, beta);\n\t },\n\t\n\t mean: function mean(alpha, beta) {\n\t return alpha / (alpha + beta);\n\t },\n\t\n\t median: function median(alpha, beta) {\n\t return jStat.ibetainv(0.5, alpha, beta);\n\t },\n\t\n\t mode: function mode(alpha, beta) {\n\t return (alpha - 1 ) / ( alpha + beta - 2);\n\t },\n\t\n\t // return a random sample\n\t sample: function sample(alpha, beta) {\n\t var u = jStat.randg(alpha);\n\t return u / (u + jStat.randg(beta));\n\t },\n\t\n\t variance: function variance(alpha, beta) {\n\t return (alpha * beta) / (Math.pow(alpha + beta, 2) * (alpha + beta + 1));\n\t }\n\t});\n\t\n\t// extend F function with static methods\n\tjStat.extend(jStat.centralF, {\n\t // This implementation of the pdf function avoids float overflow\n\t // See the way that R calculates this value:\n\t // https://svn.r-project.org/R/trunk/src/nmath/df.c\n\t pdf: function pdf(x, df1, df2) {\n\t var p, q, f;\n\t\n\t if (x < 0)\n\t return 0;\n\t\n\t if (df1 <= 2) {\n\t if (x === 0 && df1 < 2) {\n\t return Infinity;\n\t }\n\t if (x === 0 && df1 === 2) {\n\t return 1;\n\t }\n\t return Math.sqrt((Math.pow(df1 * x, df1) * Math.pow(df2, df2)) /\n\t (Math.pow(df1 * x + df2, df1 + df2))) /\n\t (x * jStat.betafn(df1/2, df2/2));\n\t }\n\t\n\t p = (df1 * x) / (df2 + x * df1);\n\t q = df2 / (df2 + x * df1);\n\t f = df1 * q / 2.0;\n\t return f * jStat.binomial.pdf((df1 - 2) / 2, (df1 + df2 - 2) / 2, p);\n\t },\n\t\n\t cdf: function cdf(x, df1, df2) {\n\t if (x < 0)\n\t return 0;\n\t return jStat.ibeta((df1 * x) / (df1 * x + df2), df1 / 2, df2 / 2);\n\t },\n\t\n\t inv: function inv(x, df1, df2) {\n\t return df2 / (df1 * (1 / jStat.ibetainv(x, df1 / 2, df2 / 2) - 1));\n\t },\n\t\n\t mean: function mean(df1, df2) {\n\t return (df2 > 2) ? df2 / (df2 - 2) : undefined;\n\t },\n\t\n\t mode: function mode(df1, df2) {\n\t return (df1 > 2) ? (df2 * (df1 - 2)) / (df1 * (df2 + 2)) : undefined;\n\t },\n\t\n\t // return a random sample\n\t sample: function sample(df1, df2) {\n\t var x1 = jStat.randg(df1 / 2) * 2;\n\t var x2 = jStat.randg(df2 / 2) * 2;\n\t return (x1 / df1) / (x2 / df2);\n\t },\n\t\n\t variance: function variance(df1, df2) {\n\t if (df2 <= 4)\n\t return undefined;\n\t return 2 * df2 * df2 * (df1 + df2 - 2) /\n\t (df1 * (df2 - 2) * (df2 - 2) * (df2 - 4));\n\t }\n\t});\n\t\n\t\n\t// extend cauchy function with static methods\n\tjStat.extend(jStat.cauchy, {\n\t pdf: function pdf(x, local, scale) {\n\t if (scale < 0) { return 0; }\n\t\n\t return (scale / (Math.pow(x - local, 2) + Math.pow(scale, 2))) / Math.PI;\n\t },\n\t\n\t cdf: function cdf(x, local, scale) {\n\t return Math.atan((x - local) / scale) / Math.PI + 0.5;\n\t },\n\t\n\t inv: function(p, local, scale) {\n\t return local + scale * Math.tan(Math.PI * (p - 0.5));\n\t },\n\t\n\t median: function median(local, scale) {\n\t return local;\n\t },\n\t\n\t mode: function mode(local, scale) {\n\t return local;\n\t },\n\t\n\t sample: function sample(local, scale) {\n\t return jStat.randn() *\n\t Math.sqrt(1 / (2 * jStat.randg(0.5))) * scale + local;\n\t }\n\t});\n\t\n\t\n\t\n\t// extend chisquare function with static methods\n\tjStat.extend(jStat.chisquare, {\n\t pdf: function pdf(x, dof) {\n\t if (x < 0)\n\t return 0;\n\t return (x === 0 && dof === 2) ? 0.5 :\n\t Math.exp((dof / 2 - 1) * Math.log(x) - x / 2 - (dof / 2) *\n\t Math.log(2) - jStat.gammaln(dof / 2));\n\t },\n\t\n\t cdf: function cdf(x, dof) {\n\t if (x < 0)\n\t return 0;\n\t return jStat.lowRegGamma(dof / 2, x / 2);\n\t },\n\t\n\t inv: function(p, dof) {\n\t return 2 * jStat.gammapinv(p, 0.5 * dof);\n\t },\n\t\n\t mean : function(dof) {\n\t return dof;\n\t },\n\t\n\t // TODO: this is an approximation (is there a better way?)\n\t median: function median(dof) {\n\t return dof * Math.pow(1 - (2 / (9 * dof)), 3);\n\t },\n\t\n\t mode: function mode(dof) {\n\t return (dof - 2 > 0) ? dof - 2 : 0;\n\t },\n\t\n\t sample: function sample(dof) {\n\t return jStat.randg(dof / 2) * 2;\n\t },\n\t\n\t variance: function variance(dof) {\n\t return 2 * dof;\n\t }\n\t});\n\t\n\t\n\t\n\t// extend exponential function with static methods\n\tjStat.extend(jStat.exponential, {\n\t pdf: function pdf(x, rate) {\n\t return x < 0 ? 0 : rate * Math.exp(-rate * x);\n\t },\n\t\n\t cdf: function cdf(x, rate) {\n\t return x < 0 ? 0 : 1 - Math.exp(-rate * x);\n\t },\n\t\n\t inv: function(p, rate) {\n\t return -Math.log(1 - p) / rate;\n\t },\n\t\n\t mean : function(rate) {\n\t return 1 / rate;\n\t },\n\t\n\t median: function (rate) {\n\t return (1 / rate) * Math.log(2);\n\t },\n\t\n\t mode: function mode(rate) {\n\t return 0;\n\t },\n\t\n\t sample: function sample(rate) {\n\t return -1 / rate * Math.log(Math.random());\n\t },\n\t\n\t variance : function(rate) {\n\t return Math.pow(rate, -2);\n\t }\n\t});\n\t\n\t\n\t\n\t// extend gamma function with static methods\n\tjStat.extend(jStat.gamma, {\n\t pdf: function pdf(x, shape, scale) {\n\t if (x < 0)\n\t return 0;\n\t return (x === 0 && shape === 1) ? 1 / scale :\n\t Math.exp((shape - 1) * Math.log(x) - x / scale -\n\t jStat.gammaln(shape) - shape * Math.log(scale));\n\t },\n\t\n\t cdf: function cdf(x, shape, scale) {\n\t if (x < 0)\n\t return 0;\n\t return jStat.lowRegGamma(shape, x / scale);\n\t },\n\t\n\t inv: function(p, shape, scale) {\n\t return jStat.gammapinv(p, shape) * scale;\n\t },\n\t\n\t mean : function(shape, scale) {\n\t return shape * scale;\n\t },\n\t\n\t mode: function mode(shape, scale) {\n\t if(shape > 1) return (shape - 1) * scale;\n\t return undefined;\n\t },\n\t\n\t sample: function sample(shape, scale) {\n\t return jStat.randg(shape) * scale;\n\t },\n\t\n\t variance: function variance(shape, scale) {\n\t return shape * scale * scale;\n\t }\n\t});\n\t\n\t// extend inverse gamma function with static methods\n\tjStat.extend(jStat.invgamma, {\n\t pdf: function pdf(x, shape, scale) {\n\t if (x <= 0)\n\t return 0;\n\t return Math.exp(-(shape + 1) * Math.log(x) - scale / x -\n\t jStat.gammaln(shape) + shape * Math.log(scale));\n\t },\n\t\n\t cdf: function cdf(x, shape, scale) {\n\t if (x <= 0)\n\t return 0;\n\t return 1 - jStat.lowRegGamma(shape, scale / x);\n\t },\n\t\n\t inv: function(p, shape, scale) {\n\t return scale / jStat.gammapinv(1 - p, shape);\n\t },\n\t\n\t mean : function(shape, scale) {\n\t return (shape > 1) ? scale / (shape - 1) : undefined;\n\t },\n\t\n\t mode: function mode(shape, scale) {\n\t return scale / (shape + 1);\n\t },\n\t\n\t sample: function sample(shape, scale) {\n\t return scale / jStat.randg(shape);\n\t },\n\t\n\t variance: function variance(shape, scale) {\n\t if (shape <= 2)\n\t return undefined;\n\t return scale * scale / ((shape - 1) * (shape - 1) * (shape - 2));\n\t }\n\t});\n\t\n\t\n\t// extend kumaraswamy function with static methods\n\tjStat.extend(jStat.kumaraswamy, {\n\t pdf: function pdf(x, alpha, beta) {\n\t if (x === 0 && alpha === 1)\n\t return beta;\n\t else if (x === 1 && beta === 1)\n\t return alpha;\n\t return Math.exp(Math.log(alpha) + Math.log(beta) + (alpha - 1) *\n\t Math.log(x) + (beta - 1) *\n\t Math.log(1 - Math.pow(x, alpha)));\n\t },\n\t\n\t cdf: function cdf(x, alpha, beta) {\n\t if (x < 0)\n\t return 0;\n\t else if (x > 1)\n\t return 1;\n\t return (1 - Math.pow(1 - Math.pow(x, alpha), beta));\n\t },\n\t\n\t inv: function inv(p, alpha, beta) {\n\t return Math.pow(1 - Math.pow(1 - p, 1 / beta), 1 / alpha);\n\t },\n\t\n\t mean : function(alpha, beta) {\n\t return (beta * jStat.gammafn(1 + 1 / alpha) *\n\t jStat.gammafn(beta)) / (jStat.gammafn(1 + 1 / alpha + beta));\n\t },\n\t\n\t median: function median(alpha, beta) {\n\t return Math.pow(1 - Math.pow(2, -1 / beta), 1 / alpha);\n\t },\n\t\n\t mode: function mode(alpha, beta) {\n\t if (!(alpha >= 1 && beta >= 1 && (alpha !== 1 && beta !== 1)))\n\t return undefined;\n\t return Math.pow((alpha - 1) / (alpha * beta - 1), 1 / alpha);\n\t },\n\t\n\t variance: function variance(alpha, beta) {\n\t throw new Error('variance not yet implemented');\n\t // TODO: complete this\n\t }\n\t});\n\t\n\t\n\t\n\t// extend lognormal function with static methods\n\tjStat.extend(jStat.lognormal, {\n\t pdf: function pdf(x, mu, sigma) {\n\t if (x <= 0)\n\t return 0;\n\t return Math.exp(-Math.log(x) - 0.5 * Math.log(2 * Math.PI) -\n\t Math.log(sigma) - Math.pow(Math.log(x) - mu, 2) /\n\t (2 * sigma * sigma));\n\t },\n\t\n\t cdf: function cdf(x, mu, sigma) {\n\t if (x < 0)\n\t return 0;\n\t return 0.5 +\n\t (0.5 * jStat.erf((Math.log(x) - mu) / Math.sqrt(2 * sigma * sigma)));\n\t },\n\t\n\t inv: function(p, mu, sigma) {\n\t return Math.exp(-1.41421356237309505 * sigma * jStat.erfcinv(2 * p) + mu);\n\t },\n\t\n\t mean: function mean(mu, sigma) {\n\t return Math.exp(mu + sigma * sigma / 2);\n\t },\n\t\n\t median: function median(mu, sigma) {\n\t return Math.exp(mu);\n\t },\n\t\n\t mode: function mode(mu, sigma) {\n\t return Math.exp(mu - sigma * sigma);\n\t },\n\t\n\t sample: function sample(mu, sigma) {\n\t return Math.exp(jStat.randn() * sigma + mu);\n\t },\n\t\n\t variance: function variance(mu, sigma) {\n\t return (Math.exp(sigma * sigma) - 1) * Math.exp(2 * mu + sigma * sigma);\n\t }\n\t});\n\t\n\t\n\t\n\t// extend noncentralt function with static methods\n\tjStat.extend(jStat.noncentralt, {\n\t pdf: function pdf(x, dof, ncp) {\n\t var tol = 1e-14;\n\t if (Math.abs(ncp) < tol) // ncp approx 0; use student-t\n\t return jStat.studentt.pdf(x, dof)\n\t\n\t if (Math.abs(x) < tol) { // different formula for x == 0\n\t return Math.exp(jStat.gammaln((dof + 1) / 2) - ncp * ncp / 2 -\n\t 0.5 * Math.log(Math.PI * dof) - jStat.gammaln(dof / 2));\n\t }\n\t\n\t // formula for x != 0\n\t return dof / x *\n\t (jStat.noncentralt.cdf(x * Math.sqrt(1 + 2 / dof), dof+2, ncp) -\n\t jStat.noncentralt.cdf(x, dof, ncp));\n\t },\n\t\n\t cdf: function cdf(x, dof, ncp) {\n\t var tol = 1e-14;\n\t var min_iterations = 200;\n\t\n\t if (Math.abs(ncp) < tol) // ncp approx 0; use student-t\n\t return jStat.studentt.cdf(x, dof);\n\t\n\t // turn negative x into positive and flip result afterwards\n\t var flip = false;\n\t if (x < 0) {\n\t flip = true;\n\t ncp = -ncp;\n\t }\n\t\n\t var prob = jStat.normal.cdf(-ncp, 0, 1);\n\t var value = tol + 1;\n\t // use value at last two steps to determine convergence\n\t var lastvalue = value;\n\t var y = x * x / (x * x + dof);\n\t var j = 0;\n\t var p = Math.exp(-ncp * ncp / 2);\n\t var q = Math.exp(-ncp * ncp / 2 - 0.5 * Math.log(2) -\n\t jStat.gammaln(3 / 2)) * ncp;\n\t while (j < min_iterations || lastvalue > tol || value > tol) {\n\t lastvalue = value;\n\t if (j > 0) {\n\t p *= (ncp * ncp) / (2 * j);\n\t q *= (ncp * ncp) / (2 * (j + 1 / 2));\n\t }\n\t value = p * jStat.beta.cdf(y, j + 0.5, dof / 2) +\n\t q * jStat.beta.cdf(y, j+1, dof/2);\n\t prob += 0.5 * value;\n\t j++;\n\t }\n\t\n\t return flip ? (1 - prob) : prob;\n\t }\n\t});\n\t\n\t\n\t// extend normal function with static methods\n\tjStat.extend(jStat.normal, {\n\t pdf: function pdf(x, mean, std) {\n\t return Math.exp(-0.5 * Math.log(2 * Math.PI) -\n\t Math.log(std) - Math.pow(x - mean, 2) / (2 * std * std));\n\t },\n\t\n\t cdf: function cdf(x, mean, std) {\n\t return 0.5 * (1 + jStat.erf((x - mean) / Math.sqrt(2 * std * std)));\n\t },\n\t\n\t inv: function(p, mean, std) {\n\t return -1.41421356237309505 * std * jStat.erfcinv(2 * p) + mean;\n\t },\n\t\n\t mean : function(mean, std) {\n\t return mean;\n\t },\n\t\n\t median: function median(mean, std) {\n\t return mean;\n\t },\n\t\n\t mode: function (mean, std) {\n\t return mean;\n\t },\n\t\n\t sample: function sample(mean, std) {\n\t return jStat.randn() * std + mean;\n\t },\n\t\n\t variance : function(mean, std) {\n\t return std * std;\n\t }\n\t});\n\t\n\t\n\t\n\t// extend pareto function with static methods\n\tjStat.extend(jStat.pareto, {\n\t pdf: function pdf(x, scale, shape) {\n\t if (x < scale)\n\t return 0;\n\t return (shape * Math.pow(scale, shape)) / Math.pow(x, shape + 1);\n\t },\n\t\n\t cdf: function cdf(x, scale, shape) {\n\t if (x < scale)\n\t return 0;\n\t return 1 - Math.pow(scale / x, shape);\n\t },\n\t\n\t inv: function inv(p, scale, shape) {\n\t return scale / Math.pow(1 - p, 1 / shape);\n\t },\n\t\n\t mean: function mean(scale, shape) {\n\t if (shape <= 1)\n\t return undefined;\n\t return (shape * Math.pow(scale, shape)) / (shape - 1);\n\t },\n\t\n\t median: function median(scale, shape) {\n\t return scale * (shape * Math.SQRT2);\n\t },\n\t\n\t mode: function mode(scale, shape) {\n\t return scale;\n\t },\n\t\n\t variance : function(scale, shape) {\n\t if (shape <= 2)\n\t return undefined;\n\t return (scale*scale * shape) / (Math.pow(shape - 1, 2) * (shape - 2));\n\t }\n\t});\n\t\n\t\n\t\n\t// extend studentt function with static methods\n\tjStat.extend(jStat.studentt, {\n\t pdf: function pdf(x, dof) {\n\t dof = dof > 1e100 ? 1e100 : dof;\n\t return (1/(Math.sqrt(dof) * jStat.betafn(0.5, dof/2))) *\n\t Math.pow(1 + ((x * x) / dof), -((dof + 1) / 2));\n\t },\n\t\n\t cdf: function cdf(x, dof) {\n\t var dof2 = dof / 2;\n\t return jStat.ibeta((x + Math.sqrt(x * x + dof)) /\n\t (2 * Math.sqrt(x * x + dof)), dof2, dof2);\n\t },\n\t\n\t inv: function(p, dof) {\n\t var x = jStat.ibetainv(2 * Math.min(p, 1 - p), 0.5 * dof, 0.5);\n\t x = Math.sqrt(dof * (1 - x) / x);\n\t return (p > 0.5) ? x : -x;\n\t },\n\t\n\t mean: function mean(dof) {\n\t return (dof > 1) ? 0 : undefined;\n\t },\n\t\n\t median: function median(dof) {\n\t return 0;\n\t },\n\t\n\t mode: function mode(dof) {\n\t return 0;\n\t },\n\t\n\t sample: function sample(dof) {\n\t return jStat.randn() * Math.sqrt(dof / (2 * jStat.randg(dof / 2)));\n\t },\n\t\n\t variance: function variance(dof) {\n\t return (dof > 2) ? dof / (dof - 2) : (dof > 1) ? Infinity : undefined;\n\t }\n\t});\n\t\n\t\n\t\n\t// extend weibull function with static methods\n\tjStat.extend(jStat.weibull, {\n\t pdf: function pdf(x, scale, shape) {\n\t if (x < 0 || scale < 0 || shape < 0)\n\t return 0;\n\t return (shape / scale) * Math.pow((x / scale), (shape - 1)) *\n\t Math.exp(-(Math.pow((x / scale), shape)));\n\t },\n\t\n\t cdf: function cdf(x, scale, shape) {\n\t return x < 0 ? 0 : 1 - Math.exp(-Math.pow((x / scale), shape));\n\t },\n\t\n\t inv: function(p, scale, shape) {\n\t return scale * Math.pow(-Math.log(1 - p), 1 / shape);\n\t },\n\t\n\t mean : function(scale, shape) {\n\t return scale * jStat.gammafn(1 + 1 / shape);\n\t },\n\t\n\t median: function median(scale, shape) {\n\t return scale * Math.pow(Math.log(2), 1 / shape);\n\t },\n\t\n\t mode: function mode(scale, shape) {\n\t if (shape <= 1)\n\t return 0;\n\t return scale * Math.pow((shape - 1) / shape, 1 / shape);\n\t },\n\t\n\t sample: function sample(scale, shape) {\n\t return scale * Math.pow(-Math.log(Math.random()), 1 / shape);\n\t },\n\t\n\t variance: function variance(scale, shape) {\n\t return scale * scale * jStat.gammafn(1 + 2 / shape) -\n\t Math.pow(jStat.weibull.mean(scale, shape), 2);\n\t }\n\t});\n\t\n\t\n\t\n\t// extend uniform function with static methods\n\tjStat.extend(jStat.uniform, {\n\t pdf: function pdf(x, a, b) {\n\t return (x < a || x > b) ? 0 : 1 / (b - a);\n\t },\n\t\n\t cdf: function cdf(x, a, b) {\n\t if (x < a)\n\t return 0;\n\t else if (x < b)\n\t return (x - a) / (b - a);\n\t return 1;\n\t },\n\t\n\t inv: function(p, a, b) {\n\t return a + (p * (b - a));\n\t },\n\t\n\t mean: function mean(a, b) {\n\t return 0.5 * (a + b);\n\t },\n\t\n\t median: function median(a, b) {\n\t return jStat.mean(a, b);\n\t },\n\t\n\t mode: function mode(a, b) {\n\t throw new Error('mode is not yet implemented');\n\t },\n\t\n\t sample: function sample(a, b) {\n\t return (a / 2 + b / 2) + (b / 2 - a / 2) * (2 * Math.random() - 1);\n\t },\n\t\n\t variance: function variance(a, b) {\n\t return Math.pow(b - a, 2) / 12;\n\t }\n\t});\n\t\n\t\n\t\n\t// extend uniform function with static methods\n\tjStat.extend(jStat.binomial, {\n\t pdf: function pdf(k, n, p) {\n\t return (p === 0 || p === 1) ?\n\t ((n * p) === k ? 1 : 0) :\n\t jStat.combination(n, k) * Math.pow(p, k) * Math.pow(1 - p, n - k);\n\t },\n\t\n\t cdf: function cdf(x, n, p) {\n\t var binomarr = [],\n\t k = 0;\n\t if (x < 0) {\n\t return 0;\n\t }\n\t if (x < n) {\n\t for (; k <= x; k++) {\n\t binomarr[ k ] = jStat.binomial.pdf(k, n, p);\n\t }\n\t return jStat.sum(binomarr);\n\t }\n\t return 1;\n\t }\n\t});\n\t\n\t\n\t\n\t// extend uniform function with static methods\n\tjStat.extend(jStat.negbin, {\n\t pdf: function pdf(k, r, p) {\n\t if (k !== k >>> 0)\n\t return false;\n\t if (k < 0)\n\t return 0;\n\t return jStat.combination(k + r - 1, r - 1) *\n\t Math.pow(1 - p, k) * Math.pow(p, r);\n\t },\n\t\n\t cdf: function cdf(x, r, p) {\n\t var sum = 0,\n\t k = 0;\n\t if (x < 0) return 0;\n\t for (; k <= x; k++) {\n\t sum += jStat.negbin.pdf(k, r, p);\n\t }\n\t return sum;\n\t }\n\t});\n\t\n\t\n\t\n\t// extend uniform function with static methods\n\tjStat.extend(jStat.hypgeom, {\n\t pdf: function pdf(k, N, m, n) {\n\t // Hypergeometric PDF.\n\t\n\t // A simplification of the CDF algorithm below.\n\t\n\t // k = number of successes drawn\n\t // N = population size\n\t // m = number of successes in population\n\t // n = number of items drawn from population\n\t\n\t if(k !== k | 0) {\n\t return false;\n\t } else if(k < 0 || k < m - (N - n)) {\n\t // It's impossible to have this few successes drawn.\n\t return 0;\n\t } else if(k > n || k > m) {\n\t // It's impossible to have this many successes drawn.\n\t return 0;\n\t } else if (m * 2 > N) {\n\t // More than half the population is successes.\n\t\n\t if(n * 2 > N) {\n\t // More than half the population is sampled.\n\t\n\t return jStat.hypgeom.pdf(N - m - n + k, N, N - m, N - n)\n\t } else {\n\t // Half or less of the population is sampled.\n\t\n\t return jStat.hypgeom.pdf(n - k, N, N - m, n);\n\t }\n\t\n\t } else if(n * 2 > N) {\n\t // Half or less is successes.\n\t\n\t return jStat.hypgeom.pdf(m - k, N, m, N - n);\n\t\n\t } else if(m < n) {\n\t // We want to have the number of things sampled to be less than the\n\t // successes available. So swap the definitions of successful and sampled.\n\t return jStat.hypgeom.pdf(k, N, n, m);\n\t } else {\n\t // If we get here, half or less of the population was sampled, half or\n\t // less of it was successes, and we had fewer sampled things than\n\t // successes. Now we can do this complicated iterative algorithm in an\n\t // efficient way.\n\t\n\t // The basic premise of the algorithm is that we partially normalize our\n\t // intermediate product to keep it in a numerically good region, and then\n\t // finish the normalization at the end.\n\t\n\t // This variable holds the scaled probability of the current number of\n\t // successes.\n\t var scaledPDF = 1;\n\t\n\t // This keeps track of how much we have normalized.\n\t var samplesDone = 0;\n\t\n\t for(var i = 0; i < k; i++) {\n\t // For every possible number of successes up to that observed...\n\t\n\t while(scaledPDF > 1 && samplesDone < n) {\n\t // Intermediate result is growing too big. Apply some of the\n\t // normalization to shrink everything.\n\t\n\t scaledPDF *= 1 - (m / (N - samplesDone));\n\t\n\t // Say we've normalized by this sample already.\n\t samplesDone++;\n\t }\n\t\n\t // Work out the partially-normalized hypergeometric PDF for the next\n\t // number of successes\n\t scaledPDF *= (n - i) * (m - i) / ((i + 1) * (N - m - n + i + 1));\n\t }\n\t\n\t for(; samplesDone < n; samplesDone++) {\n\t // Apply all the rest of the normalization\n\t scaledPDF *= 1 - (m / (N - samplesDone));\n\t }\n\t\n\t // Bound answer sanely before returning.\n\t return Math.min(1, Math.max(0, scaledPDF));\n\t }\n\t },\n\t\n\t cdf: function cdf(x, N, m, n) {\n\t // Hypergeometric CDF.\n\t\n\t // This algorithm is due to Prof. Thomas S. Ferguson, ,\n\t // and comes from his hypergeometric test calculator at\n\t // .\n\t\n\t // x = number of successes drawn\n\t // N = population size\n\t // m = number of successes in population\n\t // n = number of items drawn from population\n\t\n\t if(x < 0 || x < m - (N - n)) {\n\t // It's impossible to have this few successes drawn or fewer.\n\t return 0;\n\t } else if(x >= n || x >= m) {\n\t // We will always have this many successes or fewer.\n\t return 1;\n\t } else if (m * 2 > N) {\n\t // More than half the population is successes.\n\t\n\t if(n * 2 > N) {\n\t // More than half the population is sampled.\n\t\n\t return jStat.hypgeom.cdf(N - m - n + x, N, N - m, N - n)\n\t } else {\n\t // Half or less of the population is sampled.\n\t\n\t return 1 - jStat.hypgeom.cdf(n - x - 1, N, N - m, n);\n\t }\n\t\n\t } else if(n * 2 > N) {\n\t // Half or less is successes.\n\t\n\t return 1 - jStat.hypgeom.cdf(m - x - 1, N, m, N - n);\n\t\n\t } else if(m < n) {\n\t // We want to have the number of things sampled to be less than the\n\t // successes available. So swap the definitions of successful and sampled.\n\t return jStat.hypgeom.cdf(x, N, n, m);\n\t } else {\n\t // If we get here, half or less of the population was sampled, half or\n\t // less of it was successes, and we had fewer sampled things than\n\t // successes. Now we can do this complicated iterative algorithm in an\n\t // efficient way.\n\t\n\t // The basic premise of the algorithm is that we partially normalize our\n\t // intermediate sum to keep it in a numerically good region, and then\n\t // finish the normalization at the end.\n\t\n\t // Holds the intermediate, scaled total CDF.\n\t var scaledCDF = 1;\n\t\n\t // This variable holds the scaled probability of the current number of\n\t // successes.\n\t var scaledPDF = 1;\n\t\n\t // This keeps track of how much we have normalized.\n\t var samplesDone = 0;\n\t\n\t for(var i = 0; i < x; i++) {\n\t // For every possible number of successes up to that observed...\n\t\n\t while(scaledCDF > 1 && samplesDone < n) {\n\t // Intermediate result is growing too big. Apply some of the\n\t // normalization to shrink everything.\n\t\n\t var factor = 1 - (m / (N - samplesDone));\n\t\n\t scaledPDF *= factor;\n\t scaledCDF *= factor;\n\t\n\t // Say we've normalized by this sample already.\n\t samplesDone++;\n\t }\n\t\n\t // Work out the partially-normalized hypergeometric PDF for the next\n\t // number of successes\n\t scaledPDF *= (n - i) * (m - i) / ((i + 1) * (N - m - n + i + 1));\n\t\n\t // Add to the CDF answer.\n\t scaledCDF += scaledPDF;\n\t }\n\t\n\t for(; samplesDone < n; samplesDone++) {\n\t // Apply all the rest of the normalization\n\t scaledCDF *= 1 - (m / (N - samplesDone));\n\t }\n\t\n\t // Bound answer sanely before returning.\n\t return Math.min(1, Math.max(0, scaledCDF));\n\t }\n\t }\n\t});\n\t\n\t\n\t\n\t// extend uniform function with static methods\n\tjStat.extend(jStat.poisson, {\n\t pdf: function pdf(k, l) {\n\t if (l < 0 || (k % 1) !== 0 || k < 0) {\n\t return 0;\n\t }\n\t\n\t return Math.pow(l, k) * Math.exp(-l) / jStat.factorial(k);\n\t },\n\t\n\t cdf: function cdf(x, l) {\n\t var sumarr = [],\n\t k = 0;\n\t if (x < 0) return 0;\n\t for (; k <= x; k++) {\n\t sumarr.push(jStat.poisson.pdf(k, l));\n\t }\n\t return jStat.sum(sumarr);\n\t },\n\t\n\t mean : function(l) {\n\t return l;\n\t },\n\t\n\t variance : function(l) {\n\t return l;\n\t },\n\t\n\t sample: function sample(l) {\n\t var p = 1, k = 0, L = Math.exp(-l);\n\t do {\n\t k++;\n\t p *= Math.random();\n\t } while (p > L);\n\t return k - 1;\n\t }\n\t});\n\t\n\t// extend triangular function with static methods\n\tjStat.extend(jStat.triangular, {\n\t pdf: function pdf(x, a, b, c) {\n\t if (b <= a || c < a || c > b) {\n\t return NaN;\n\t } else {\n\t if (x < a || x > b) {\n\t return 0;\n\t } else if (x < c) {\n\t return (2 * (x - a)) / ((b - a) * (c - a));\n\t } else if (x === c) {\n\t return (2 / (b - a));\n\t } else { // x > c\n\t return (2 * (b - x)) / ((b - a) * (b - c));\n\t }\n\t }\n\t },\n\t\n\t cdf: function cdf(x, a, b, c) {\n\t if (b <= a || c < a || c > b)\n\t return NaN;\n\t if (x <= a)\n\t return 0;\n\t else if (x >= b)\n\t return 1;\n\t if (x <= c)\n\t return Math.pow(x - a, 2) / ((b - a) * (c - a));\n\t else // x > c\n\t return 1 - Math.pow(b - x, 2) / ((b - a) * (b - c));\n\t },\n\t\n\t inv: function inv(p, a, b, c) {\n\t if (b <= a || c < a || c > b) {\n\t return NaN;\n\t } else {\n\t if (p <= ((c - a) / (b - a))) {\n\t return a + (b - a) * Math.sqrt(p * ((c - a) / (b - a)));\n\t } else { // p > ((c - a) / (b - a))\n\t return a + (b - a) * (1 - Math.sqrt((1 - p) * (1 - ((c - a) / (b - a)))));\n\t }\n\t }\n\t },\n\t\n\t mean: function mean(a, b, c) {\n\t return (a + b + c) / 3;\n\t },\n\t\n\t median: function median(a, b, c) {\n\t if (c <= (a + b) / 2) {\n\t return b - Math.sqrt((b - a) * (b - c)) / Math.sqrt(2);\n\t } else if (c > (a + b) / 2) {\n\t return a + Math.sqrt((b - a) * (c - a)) / Math.sqrt(2);\n\t }\n\t },\n\t\n\t mode: function mode(a, b, c) {\n\t return c;\n\t },\n\t\n\t sample: function sample(a, b, c) {\n\t var u = Math.random();\n\t if (u < ((c - a) / (b - a)))\n\t return a + Math.sqrt(u * (b - a) * (c - a))\n\t return b - Math.sqrt((1 - u) * (b - a) * (b - c));\n\t },\n\t\n\t variance: function variance(a, b, c) {\n\t return (a * a + b * b + c * c - a * b - a * c - b * c) / 18;\n\t }\n\t});\n\t\n\tfunction laplaceSign(x) { return x / Math.abs(x); }\n\t\n\tjStat.extend(jStat.laplace, {\n\t pdf: function pdf(x, mu, b) {\n\t return (b <= 0) ? 0 : (Math.exp(-Math.abs(x - mu) / b)) / (2 * b);\n\t },\n\t\n\t cdf: function cdf(x, mu, b) {\n\t if (b <= 0) { return 0; }\n\t\n\t if(x < mu) {\n\t return 0.5 * Math.exp((x - mu) / b);\n\t } else {\n\t return 1 - 0.5 * Math.exp(- (x - mu) / b);\n\t }\n\t },\n\t\n\t mean: function(mu, b) {\n\t return mu;\n\t },\n\t\n\t median: function(mu, b) {\n\t return mu;\n\t },\n\t\n\t mode: function(mu, b) {\n\t return mu;\n\t },\n\t\n\t variance: function(mu, b) {\n\t return 2 * b * b;\n\t },\n\t\n\t sample: function sample(mu, b) {\n\t var u = Math.random() - 0.5;\n\t\n\t return mu - (b * laplaceSign(u) * Math.log(1 - (2 * Math.abs(u))));\n\t }\n\t});\n\t\n\t}(this.jStat, Math));\n\t/* Provides functions for the solution of linear system of equations, integration, extrapolation,\n\t * interpolation, eigenvalue problems, differential equations and PCA analysis. */\n\t\n\t(function(jStat, Math) {\n\t\n\tvar push = Array.prototype.push;\n\tvar isArray = jStat.utils.isArray;\n\t\n\tfunction isUsable(arg) {\n\t return isArray(arg) || arg instanceof jStat;\n\t}\n\t\n\tjStat.extend({\n\t\n\t // add a vector/matrix to a vector/matrix or scalar\n\t add: function add(arr, arg) {\n\t // check if arg is a vector or scalar\n\t if (isUsable(arg)) {\n\t if (!isUsable(arg[0])) arg = [ arg ];\n\t return jStat.map(arr, function(value, row, col) {\n\t return value + arg[row][col];\n\t });\n\t }\n\t return jStat.map(arr, function(value) { return value + arg; });\n\t },\n\t\n\t // subtract a vector or scalar from the vector\n\t subtract: function subtract(arr, arg) {\n\t // check if arg is a vector or scalar\n\t if (isUsable(arg)) {\n\t if (!isUsable(arg[0])) arg = [ arg ];\n\t return jStat.map(arr, function(value, row, col) {\n\t return value - arg[row][col] || 0;\n\t });\n\t }\n\t return jStat.map(arr, function(value) { return value - arg; });\n\t },\n\t\n\t // matrix division\n\t divide: function divide(arr, arg) {\n\t if (isUsable(arg)) {\n\t if (!isUsable(arg[0])) arg = [ arg ];\n\t return jStat.multiply(arr, jStat.inv(arg));\n\t }\n\t return jStat.map(arr, function(value) { return value / arg; });\n\t },\n\t\n\t // matrix multiplication\n\t multiply: function multiply(arr, arg) {\n\t var row, col, nrescols, sum, nrow, ncol, res, rescols;\n\t // eg: arr = 2 arg = 3 -> 6 for res[0][0] statement closure\n\t if (arr.length === undefined && arg.length === undefined) {\n\t return arr * arg;\n\t }\n\t nrow = arr.length,\n\t ncol = arr[0].length,\n\t res = jStat.zeros(nrow, nrescols = (isUsable(arg)) ? arg[0].length : ncol),\n\t rescols = 0;\n\t if (isUsable(arg)) {\n\t for (; rescols < nrescols; rescols++) {\n\t for (row = 0; row < nrow; row++) {\n\t sum = 0;\n\t for (col = 0; col < ncol; col++)\n\t sum += arr[row][col] * arg[col][rescols];\n\t res[row][rescols] = sum;\n\t }\n\t }\n\t return (nrow === 1 && rescols === 1) ? res[0][0] : res;\n\t }\n\t return jStat.map(arr, function(value) { return value * arg; });\n\t },\n\t\n\t // outer([1,2,3],[4,5,6])\n\t // ===\n\t // [[1],[2],[3]] times [[4,5,6]]\n\t // ->\n\t // [[4,5,6],[8,10,12],[12,15,18]]\n\t outer:function outer(A, B) {\n\t return jStat.multiply(A.map(function(t){ return [t] }), [B]);\n\t },\n\t\n\t\n\t // Returns the dot product of two matricies\n\t dot: function dot(arr, arg) {\n\t if (!isUsable(arr[0])) arr = [ arr ];\n\t if (!isUsable(arg[0])) arg = [ arg ];\n\t // convert column to row vector\n\t var left = (arr[0].length === 1 && arr.length !== 1) ? jStat.transpose(arr) : arr,\n\t right = (arg[0].length === 1 && arg.length !== 1) ? jStat.transpose(arg) : arg,\n\t res = [],\n\t row = 0,\n\t nrow = left.length,\n\t ncol = left[0].length,\n\t sum, col;\n\t for (; row < nrow; row++) {\n\t res[row] = [];\n\t sum = 0;\n\t for (col = 0; col < ncol; col++)\n\t sum += left[row][col] * right[row][col];\n\t res[row] = sum;\n\t }\n\t return (res.length === 1) ? res[0] : res;\n\t },\n\t\n\t // raise every element by a scalar\n\t pow: function pow(arr, arg) {\n\t return jStat.map(arr, function(value) { return Math.pow(value, arg); });\n\t },\n\t\n\t // exponentiate every element\n\t exp: function exp(arr) {\n\t return jStat.map(arr, function(value) { return Math.exp(value); });\n\t },\n\t\n\t // generate the natural log of every element\n\t log: function exp(arr) {\n\t return jStat.map(arr, function(value) { return Math.log(value); });\n\t },\n\t\n\t // generate the absolute values of the vector\n\t abs: function abs(arr) {\n\t return jStat.map(arr, function(value) { return Math.abs(value); });\n\t },\n\t\n\t // computes the p-norm of the vector\n\t // In the case that a matrix is passed, uses the first row as the vector\n\t norm: function norm(arr, p) {\n\t var nnorm = 0,\n\t i = 0;\n\t // check the p-value of the norm, and set for most common case\n\t if (isNaN(p)) p = 2;\n\t // check if multi-dimensional array, and make vector correction\n\t if (isUsable(arr[0])) arr = arr[0];\n\t // vector norm\n\t for (; i < arr.length; i++) {\n\t nnorm += Math.pow(Math.abs(arr[i]), p);\n\t }\n\t return Math.pow(nnorm, 1 / p);\n\t },\n\t\n\t // computes the angle between two vectors in rads\n\t // In case a matrix is passed, this uses the first row as the vector\n\t angle: function angle(arr, arg) {\n\t return Math.acos(jStat.dot(arr, arg) / (jStat.norm(arr) * jStat.norm(arg)));\n\t },\n\t\n\t // augment one matrix by another\n\t // Note: this function returns a matrix, not a jStat object\n\t aug: function aug(a, b) {\n\t var newarr = [];\n\t for (var i = 0; i < a.length; i++) {\n\t newarr.push(a[i].slice());\n\t }\n\t for (var i = 0; i < newarr.length; i++) {\n\t push.apply(newarr[i], b[i]);\n\t }\n\t return newarr;\n\t },\n\t\n\t // The inv() function calculates the inverse of a matrix\n\t // Create the inverse by augmenting the matrix by the identity matrix of the\n\t // appropriate size, and then use G-J elimination on the augmented matrix.\n\t inv: function inv(a) {\n\t var rows = a.length;\n\t var cols = a[0].length;\n\t var b = jStat.identity(rows, cols);\n\t var c = jStat.gauss_jordan(a, b);\n\t var result = [];\n\t var i = 0;\n\t var j;\n\t\n\t //We need to copy the inverse portion to a new matrix to rid G-J artifacts\n\t for (; i < rows; i++) {\n\t result[i] = [];\n\t for (j = cols; j < c[0].length; j++)\n\t result[i][j - cols] = c[i][j];\n\t }\n\t return result;\n\t },\n\t\n\t // calculate the determinant of a matrix\n\t det: function det(a) {\n\t var alen = a.length,\n\t alend = alen * 2,\n\t vals = new Array(alend),\n\t rowshift = alen - 1,\n\t colshift = alend - 1,\n\t mrow = rowshift - alen + 1,\n\t mcol = colshift,\n\t i = 0,\n\t result = 0,\n\t j;\n\t // check for special 2x2 case\n\t if (alen === 2) {\n\t return a[0][0] * a[1][1] - a[0][1] * a[1][0];\n\t }\n\t for (; i < alend; i++) {\n\t vals[i] = 1;\n\t }\n\t for (var i = 0; i < alen; i++) {\n\t for (j = 0; j < alen; j++) {\n\t vals[(mrow < 0) ? mrow + alen : mrow ] *= a[i][j];\n\t vals[(mcol < alen) ? mcol + alen : mcol ] *= a[i][j];\n\t mrow++;\n\t mcol--;\n\t }\n\t mrow = --rowshift - alen + 1;\n\t mcol = --colshift;\n\t }\n\t for (var i = 0; i < alen; i++) {\n\t result += vals[i];\n\t }\n\t for (; i < alend; i++) {\n\t result -= vals[i];\n\t }\n\t return result;\n\t },\n\t\n\t gauss_elimination: function gauss_elimination(a, b) {\n\t var i = 0,\n\t j = 0,\n\t n = a.length,\n\t m = a[0].length,\n\t factor = 1,\n\t sum = 0,\n\t x = [],\n\t maug, pivot, temp, k;\n\t a = jStat.aug(a, b);\n\t maug = a[0].length;\n\t for(var i = 0; i < n; i++) {\n\t pivot = a[i][i];\n\t j = i;\n\t for (k = i + 1; k < m; k++) {\n\t if (pivot < Math.abs(a[k][i])) {\n\t pivot = a[k][i];\n\t j = k;\n\t }\n\t }\n\t if (j != i) {\n\t for(k = 0; k < maug; k++) {\n\t temp = a[i][k];\n\t a[i][k] = a[j][k];\n\t a[j][k] = temp;\n\t }\n\t }\n\t for (j = i + 1; j < n; j++) {\n\t factor = a[j][i] / a[i][i];\n\t for(k = i; k < maug; k++) {\n\t a[j][k] = a[j][k] - factor * a[i][k];\n\t }\n\t }\n\t }\n\t for (var i = n - 1; i >= 0; i--) {\n\t sum = 0;\n\t for (j = i + 1; j<= n - 1; j++) {\n\t sum = sum + x[j] * a[i][j];\n\t }\n\t x[i] =(a[i][maug - 1] - sum) / a[i][i];\n\t }\n\t return x;\n\t },\n\t\n\t gauss_jordan: function gauss_jordan(a, b) {\n\t var m = jStat.aug(a, b),\n\t h = m.length,\n\t w = m[0].length;\n\t // find max pivot\n\t for (var y = 0; y < h; y++) {\n\t var maxrow = y;\n\t for (var y2 = y+1; y2 < h; y2++) {\n\t if (Math.abs(m[y2][y]) > Math.abs(m[maxrow][y]))\n\t maxrow = y2;\n\t }\n\t var tmp = m[y];\n\t m[y] = m[maxrow];\n\t m[maxrow] = tmp\n\t for (var y2 = y+1; y2 < h; y2++) {\n\t c = m[y2][y] / m[y][y];\n\t for (var x = y; x < w; x++) {\n\t m[y2][x] -= m[y][x] * c;\n\t }\n\t }\n\t }\n\t // backsubstitute\n\t for (var y = h-1; y >= 0; y--) {\n\t c = m[y][y];\n\t for (var y2 = 0; y2 < y; y2++) {\n\t for (var x = w-1; x > y-1; x--) {\n\t m[y2][x] -= m[y][x] * m[y2][y] / c;\n\t }\n\t }\n\t m[y][y] /= c;\n\t for (var x = h; x < w; x++) {\n\t m[y][x] /= c;\n\t }\n\t }\n\t return m;\n\t },\n\t\n\t // solve equation\n\t // Ax=b\n\t // A is upper triangular matrix\n\t // A=[[1,2,3],[0,4,5],[0,6,7]]\n\t // b=[1,2,3]\n\t // triaUpSolve(A,b) // -> [2.666,0.1666,1.666]\n\t // if you use matrix style\n\t // A=[[1,2,3],[0,4,5],[0,6,7]]\n\t // b=[[1],[2],[3]]\n\t // will return [[2.666],[0.1666],[1.666]]\n\t triaUpSolve: function triaUpSolve(A, b) {\n\t var size = A[0].length;\n\t var x = jStat.zeros(1, size)[0];\n\t var parts;\n\t var matrix_mode = false;\n\t\n\t if (b[0].length != undefined) {\n\t b = b.map(function(i){ return i[0] });\n\t matrix_mode = true;\n\t }\n\t\n\t jStat.arange(size - 1, -1, -1).forEach(function(i) {\n\t parts = jStat.arange(i + 1,size).map(function(j) {\n\t return x[j] * A[i][j];\n\t });\n\t x[i] = (b[i] - jStat.sum(parts)) / A[i][i];\n\t });\n\t\n\t if (matrix_mode)\n\t return x.map(function(i){ return [i] });\n\t return x;\n\t },\n\t\n\t triaLowSolve: function triaLowSolve(A, b) {\n\t // like to triaUpSolve but A is lower triangular matrix\n\t var size = A[0].length;\n\t var x = jStat.zeros(1, size)[0];\n\t var parts;\n\t\n\t var matrix_mode=false;\n\t if (b[0].length != undefined) {\n\t b = b.map(function(i){ return i[0] });\n\t matrix_mode = true;\n\t }\n\t\n\t jStat.arange(size).forEach(function(i) {\n\t parts = jStat.arange(i).map(function(j) {\n\t return A[i][j] * x[j];\n\t });\n\t x[i] = (b[i] - jStat.sum(parts)) / A[i][i];\n\t })\n\t\n\t if (matrix_mode)\n\t return x.map(function(i){ return [i] });\n\t return x;\n\t },\n\t\n\t // A -> [L,U]\n\t // A=LU\n\t // L is lower triangular matrix\n\t // U is upper triangular matrix\n\t lu: function lu(A) {\n\t var size = A.length;\n\t //var L=jStat.diagonal(jStat.ones(1,size)[0]);\n\t var L = jStat.identity(size);\n\t var R = jStat.zeros(A.length, A[0].length);\n\t var parts;\n\t jStat.arange(size).forEach(function(t) {\n\t R[0][t] = A[0][t];\n\t });\n\t jStat.arange(1, size).forEach(function(l) {\n\t jStat.arange(l).forEach(function(i) {\n\t parts = jStat.arange(i).map(function(jj) {\n\t return L[l][jj] * R[jj][i];\n\t });\n\t L[l][i] = (A[l][i] - jStat.sum(parts)) / R[i][i];\n\t });\n\t jStat.arange(l, size).forEach(function(j) {\n\t parts = jStat.arange(l).map(function(jj) {\n\t return L[l][jj] * R[jj][j];\n\t });\n\t R[l][j] = A[i][j] - jStat.sum(parts);\n\t });\n\t });\n\t return [L, R];\n\t },\n\t\n\t // A -> T\n\t // A=TT'\n\t // T is lower triangular matrix\n\t cholesky: function cholesky(A) {\n\t var size = A.length;\n\t var T = jStat.zeros(A.length, A[0].length);\n\t var parts;\n\t jStat.arange(size).forEach(function(i) {\n\t parts = jStat.arange(i).map(function(t) {\n\t return Math.pow(T[i][t],2);\n\t });\n\t T[i][i] = Math.sqrt(A[i][i] - jStat.sum(parts));\n\t jStat.arange(i + 1, size).forEach(function(j) {\n\t parts = jStat.arange(i).map(function(t) {\n\t return T[i][t] * T[j][t];\n\t });\n\t T[j][i] = (A[i][j] - jStat.sum(parts)) / T[i][i];\n\t });\n\t });\n\t return T;\n\t },\n\t\n\t gauss_jacobi: function gauss_jacobi(a, b, x, r) {\n\t var i = 0;\n\t var j = 0;\n\t var n = a.length;\n\t var l = [];\n\t var u = [];\n\t var d = [];\n\t var xv, c, h, xk;\n\t for (; i < n; i++) {\n\t l[i] = [];\n\t u[i] = [];\n\t d[i] = [];\n\t for (j = 0; j < n; j++) {\n\t if (i > j) {\n\t l[i][j] = a[i][j];\n\t u[i][j] = d[i][j] = 0;\n\t } else if (i < j) {\n\t u[i][j] = a[i][j];\n\t l[i][j] = d[i][j] = 0;\n\t } else {\n\t d[i][j] = a[i][j];\n\t l[i][j] = u[i][j] = 0;\n\t }\n\t }\n\t }\n\t h = jStat.multiply(jStat.multiply(jStat.inv(d), jStat.add(l, u)), -1);\n\t c = jStat.multiply(jStat.inv(d), b);\n\t xv = x;\n\t xk = jStat.add(jStat.multiply(h, x), c);\n\t i = 2;\n\t while (Math.abs(jStat.norm(jStat.subtract(xk,xv))) > r) {\n\t xv = xk;\n\t xk = jStat.add(jStat.multiply(h, xv), c);\n\t i++;\n\t }\n\t return xk;\n\t },\n\t\n\t gauss_seidel: function gauss_seidel(a, b, x, r) {\n\t var i = 0;\n\t var n = a.length;\n\t var l = [];\n\t var u = [];\n\t var d = [];\n\t var j, xv, c, h, xk;\n\t for (; i < n; i++) {\n\t l[i] = [];\n\t u[i] = [];\n\t d[i] = [];\n\t for (j = 0; j < n; j++) {\n\t if (i > j) {\n\t l[i][j] = a[i][j];\n\t u[i][j] = d[i][j] = 0;\n\t } else if (i < j) {\n\t u[i][j] = a[i][j];\n\t l[i][j] = d[i][j] = 0;\n\t } else {\n\t d[i][j] = a[i][j];\n\t l[i][j] = u[i][j] = 0;\n\t }\n\t }\n\t }\n\t h = jStat.multiply(jStat.multiply(jStat.inv(jStat.add(d, l)), u), -1);\n\t c = jStat.multiply(jStat.inv(jStat.add(d, l)), b);\n\t xv = x;\n\t xk = jStat.add(jStat.multiply(h, x), c);\n\t i = 2;\n\t while (Math.abs(jStat.norm(jStat.subtract(xk, xv))) > r) {\n\t xv = xk;\n\t xk = jStat.add(jStat.multiply(h, xv), c);\n\t i = i + 1;\n\t }\n\t return xk;\n\t },\n\t\n\t SOR: function SOR(a, b, x, r, w) {\n\t var i = 0;\n\t var n = a.length;\n\t var l = [];\n\t var u = [];\n\t var d = [];\n\t var j, xv, c, h, xk;\n\t for (; i < n; i++) {\n\t l[i] = [];\n\t u[i] = [];\n\t d[i] = [];\n\t for (j = 0; j < n; j++) {\n\t if (i > j) {\n\t l[i][j] = a[i][j];\n\t u[i][j] = d[i][j] = 0;\n\t } else if (i < j) {\n\t u[i][j] = a[i][j];\n\t l[i][j] = d[i][j] = 0;\n\t } else {\n\t d[i][j] = a[i][j];\n\t l[i][j] = u[i][j] = 0;\n\t }\n\t }\n\t }\n\t h = jStat.multiply(jStat.inv(jStat.add(d, jStat.multiply(l, w))),\n\t jStat.subtract(jStat.multiply(d, 1 - w),\n\t jStat.multiply(u, w)));\n\t c = jStat.multiply(jStat.multiply(jStat.inv(jStat.add(d,\n\t jStat.multiply(l, w))), b), w);\n\t xv = x;\n\t xk = jStat.add(jStat.multiply(h, x), c);\n\t i = 2;\n\t while (Math.abs(jStat.norm(jStat.subtract(xk, xv))) > r) {\n\t xv = xk;\n\t xk = jStat.add(jStat.multiply(h, xv), c);\n\t i++;\n\t }\n\t return xk;\n\t },\n\t\n\t householder: function householder(a) {\n\t var m = a.length;\n\t var n = a[0].length;\n\t var i = 0;\n\t var w = [];\n\t var p = [];\n\t var alpha, r, k, j, factor;\n\t for (; i < m - 1; i++) {\n\t alpha = 0;\n\t for (j = i + 1; j < n; j++)\n\t alpha += (a[j][i] * a[j][i]);\n\t factor = (a[i + 1][i] > 0) ? -1 : 1;\n\t alpha = factor * Math.sqrt(alpha);\n\t r = Math.sqrt((((alpha * alpha) - a[i + 1][i] * alpha) / 2));\n\t w = jStat.zeros(m, 1);\n\t w[i + 1][0] = (a[i + 1][i] - alpha) / (2 * r);\n\t for (k = i + 2; k < m; k++) w[k][0] = a[k][i] / (2 * r);\n\t p = jStat.subtract(jStat.identity(m, n),\n\t jStat.multiply(jStat.multiply(w, jStat.transpose(w)), 2));\n\t a = jStat.multiply(p, jStat.multiply(a, p));\n\t }\n\t return a;\n\t },\n\t\n\t // A -> [Q,R]\n\t // Q is orthogonal matrix\n\t // R is upper triangular\n\t QR: (function() {\n\t // x -> Q\n\t // find a orthogonal matrix Q st.\n\t // Qx=y\n\t // y is [||x||,0,0,...]\n\t function get_Q1(x) {\n\t var size = x.length;\n\t var norm_x = jStat.norm(x,2);\n\t var e1 = jStat.zeros(1, size)[0];\n\t e1[0] = 1;\n\t var u = jStat.add(jStat.multiply(jStat.multiply(e1, norm_x), -1), x);\n\t var norm_u = jStat.norm(u, 2);\n\t var v = jStat.divide(u, norm_u);\n\t var Q = jStat.subtract(jStat.identity(size),\n\t jStat.multiply(jStat.outer(v, v), 2));\n\t return Q;\n\t }\n\t\n\t function qr(A) {\n\t var size = A[0].length;\n\t var QList = [];\n\t jStat.arange(size).forEach(function(i) {\n\t var x = jStat.slice(A, { row: { start: i }, col: i });\n\t var Q = get_Q1(x);\n\t var Qn = jStat.identity(A.length);\n\t Qn = jStat.sliceAssign(Qn, { row: { start: i }, col: { start: i }}, Q);\n\t A = jStat.multiply(Qn, A);\n\t QList.push(Qn);\n\t });\n\t var Q = QList.reduce(function(x, y){ return jStat.multiply(x,y) });\n\t var R = A;\n\t return [Q, R];\n\t }\n\t\n\t return qr;\n\t })(),\n\t\n\t lstsq: (function(A, b) {\n\t // solve least squard problem for Ax=b as QR decomposition way if b is\n\t // [[b1],[b2],[b3]] form will return [[x1],[x2],[x3]] array form solution\n\t // else b is [b1,b2,b3] form will return [x1,x2,x3] array form solution\n\t function R_I(A) {\n\t A = jStat.copy(A);\n\t var size = A.length;\n\t var I = jStat.identity(size);\n\t jStat.arange(size - 1, -1, -1).forEach(function(i) {\n\t jStat.sliceAssign(\n\t I, { row: i }, jStat.divide(jStat.slice(I, { row: i }), A[i][i]));\n\t jStat.sliceAssign(\n\t A, { row: i }, jStat.divide(jStat.slice(A, { row: i }), A[i][i]));\n\t jStat.arange(i).forEach(function(j) {\n\t var c = jStat.multiply(A[j][i], -1);\n\t var Aj = jStat.slice(A, { row: j });\n\t var cAi = jStat.multiply(jStat.slice(A, { row: i }), c);\n\t jStat.sliceAssign(A, { row: j }, jStat.add(Aj, cAi));\n\t var Ij = jStat.slice(I, { row: j });\n\t var cIi = jStat.multiply(jStat.slice(I, { row: i }), c);\n\t jStat.sliceAssign(I, { row: j }, jStat.add(Ij, cIi));\n\t })\n\t });\n\t return I;\n\t }\n\t\n\t function qr_solve(A, b){\n\t var array_mode = false;\n\t if (b[0].length === undefined) {\n\t // [c1,c2,c3] mode\n\t b = b.map(function(x){ return [x] });\n\t array_mode = true;\n\t }\n\t var QR = jStat.QR(A);\n\t var Q = QR[0];\n\t var R = QR[1];\n\t var attrs = A[0].length;\n\t var Q1 = jStat.slice(Q,{col:{end:attrs}});\n\t var R1 = jStat.slice(R,{row:{end:attrs}});\n\t var RI = R_I(R1);\n\t var x = jStat.multiply(jStat.multiply(RI, jStat.transpose(Q1)), b);\n\t if (array_mode)\n\t return x.map(function(i){ return i[0] });\n\t return x;\n\t }\n\t\n\t return qr_solve;\n\t })(),\n\t\n\t jacobi: function jacobi(a) {\n\t var condition = 1;\n\t var count = 0;\n\t var n = a.length;\n\t var e = jStat.identity(n, n);\n\t var ev = [];\n\t var b, i, j, p, q, maxim, theta, s;\n\t // condition === 1 only if tolerance is not reached\n\t while (condition === 1) {\n\t count++;\n\t maxim = a[0][1];\n\t p = 0;\n\t q = 1;\n\t for (var i = 0; i < n; i++) {\n\t for (j = 0; j < n; j++) {\n\t if (i != j) {\n\t if (maxim < Math.abs(a[i][j])) {\n\t maxim = Math.abs(a[i][j]);\n\t p = i;\n\t q = j;\n\t }\n\t }\n\t }\n\t }\n\t if (a[p][p] === a[q][q])\n\t theta = (a[p][q] > 0) ? Math.PI / 4 : -Math.PI / 4;\n\t else\n\t theta = Math.atan(2 * a[p][q] / (a[p][p] - a[q][q])) / 2;\n\t s = jStat.identity(n, n);\n\t s[p][p] = Math.cos(theta);\n\t s[p][q] = -Math.sin(theta);\n\t s[q][p] = Math.sin(theta);\n\t s[q][q] = Math.cos(theta);\n\t // eigen vector matrix\n\t e = jStat.multiply(e, s);\n\t b = jStat.multiply(jStat.multiply(jStat.inv(s), a), s);\n\t a = b;\n\t condition = 0;\n\t for (var i = 1; i < n; i++) {\n\t for (j = 1; j < n; j++) {\n\t if (i != j && Math.abs(a[i][j]) > 0.001) {\n\t condition = 1;\n\t }\n\t }\n\t }\n\t }\n\t for (var i = 0; i < n; i++) ev.push(a[i][i]);\n\t //returns both the eigenvalue and eigenmatrix\n\t return [e, ev];\n\t },\n\t\n\t rungekutta: function rungekutta(f, h, p, t_j, u_j, order) {\n\t var k1, k2, u_j1, k3, k4;\n\t if (order === 2) {\n\t while (t_j <= p) {\n\t k1 = h * f(t_j, u_j);\n\t k2 = h * f(t_j + h, u_j + k1);\n\t u_j1 = u_j + (k1 + k2) / 2;\n\t u_j = u_j1;\n\t t_j = t_j + h;\n\t }\n\t }\n\t if (order === 4) {\n\t while (t_j <= p) {\n\t k1 = h * f(t_j, u_j);\n\t k2 = h * f(t_j + h / 2, u_j + k1 / 2);\n\t k3 = h * f(t_j + h / 2, u_j + k2 / 2);\n\t k4 = h * f(t_j +h, u_j + k3);\n\t u_j1 = u_j + (k1 + 2 * k2 + 2 * k3 + k4) / 6;\n\t u_j = u_j1;\n\t t_j = t_j + h;\n\t }\n\t }\n\t return u_j;\n\t },\n\t\n\t romberg: function romberg(f, a, b, order) {\n\t var i = 0;\n\t var h = (b - a) / 2;\n\t var x = [];\n\t var h1 = [];\n\t var g = [];\n\t var m, a1, j, k, I, d;\n\t while (i < order / 2) {\n\t I = f(a);\n\t for (j = a, k = 0; j <= b; j = j + h, k++) x[k] = j;\n\t m = x.length;\n\t for (j = 1; j < m - 1; j++) {\n\t I += (((j % 2) !== 0) ? 4 : 2) * f(x[j]);\n\t }\n\t I = (h / 3) * (I + f(b));\n\t g[i] = I;\n\t h /= 2;\n\t i++;\n\t }\n\t a1 = g.length;\n\t m = 1;\n\t while (a1 !== 1) {\n\t for (j = 0; j < a1 - 1; j++)\n\t h1[j] = ((Math.pow(4, m)) * g[j + 1] - g[j]) / (Math.pow(4, m) - 1);\n\t a1 = h1.length;\n\t g = h1;\n\t h1 = [];\n\t m++;\n\t }\n\t return g;\n\t },\n\t\n\t richardson: function richardson(X, f, x, h) {\n\t function pos(X, x) {\n\t var i = 0;\n\t var n = X.length;\n\t var p;\n\t for (; i < n; i++)\n\t if (X[i] === x) p = i;\n\t return p;\n\t }\n\t var n = X.length,\n\t h_min = Math.abs(x - X[pos(X, x) + 1]),\n\t i = 0,\n\t g = [],\n\t h1 = [],\n\t y1, y2, m, a, j;\n\t while (h >= h_min) {\n\t y1 = pos(X, x + h);\n\t y2 = pos(X, x);\n\t g[i] = (f[y1] - 2 * f[y2] + f[2 * y2 - y1]) / (h * h);\n\t h /= 2;\n\t i++;\n\t }\n\t a = g.length;\n\t m = 1;\n\t while (a != 1) {\n\t for (j = 0; j < a - 1; j++)\n\t h1[j] = ((Math.pow(4, m)) * g[j + 1] - g[j]) / (Math.pow(4, m) - 1);\n\t a = h1.length;\n\t g = h1;\n\t h1 = [];\n\t m++;\n\t }\n\t return g;\n\t },\n\t\n\t simpson: function simpson(f, a, b, n) {\n\t var h = (b - a) / n;\n\t var I = f(a);\n\t var x = [];\n\t var j = a;\n\t var k = 0;\n\t var i = 1;\n\t var m;\n\t for (; j <= b; j = j + h, k++)\n\t x[k] = j;\n\t m = x.length;\n\t for (; i < m - 1; i++) {\n\t I += ((i % 2 !== 0) ? 4 : 2) * f(x[i]);\n\t }\n\t return (h / 3) * (I + f(b));\n\t },\n\t\n\t hermite: function hermite(X, F, dF, value) {\n\t var n = X.length;\n\t var p = 0;\n\t var i = 0;\n\t var l = [];\n\t var dl = [];\n\t var A = [];\n\t var B = [];\n\t var j;\n\t for (; i < n; i++) {\n\t l[i] = 1;\n\t for (j = 0; j < n; j++) {\n\t if (i != j) l[i] *= (value - X[j]) / (X[i] - X[j]);\n\t }\n\t dl[i] = 0;\n\t for (j = 0; j < n; j++) {\n\t if (i != j) dl[i] += 1 / (X [i] - X[j]);\n\t }\n\t A[i] = (1 - 2 * (value - X[i]) * dl[i]) * (l[i] * l[i]);\n\t B[i] = (value - X[i]) * (l[i] * l[i]);\n\t p += (A[i] * F[i] + B[i] * dF[i]);\n\t }\n\t return p;\n\t },\n\t\n\t lagrange: function lagrange(X, F, value) {\n\t var p = 0;\n\t var i = 0;\n\t var j, l;\n\t var n = X.length;\n\t for (; i < n; i++) {\n\t l = F[i];\n\t for (j = 0; j < n; j++) {\n\t // calculating the lagrange polynomial L_i\n\t if (i != j) l *= (value - X[j]) / (X[i] - X[j]);\n\t }\n\t // adding the lagrange polynomials found above\n\t p += l;\n\t }\n\t return p;\n\t },\n\t\n\t cubic_spline: function cubic_spline(X, F, value) {\n\t var n = X.length;\n\t var i = 0, j;\n\t var A = [];\n\t var B = [];\n\t var alpha = [];\n\t var c = [];\n\t var h = [];\n\t var b = [];\n\t var d = [];\n\t for (; i < n - 1; i++)\n\t h[i] = X[i + 1] - X[i];\n\t alpha[0] = 0;\n\t for (var i = 1; i < n - 1; i++) {\n\t alpha[i] = (3 / h[i]) * (F[i + 1] - F[i]) -\n\t (3 / h[i-1]) * (F[i] - F[i-1]);\n\t }\n\t for (var i = 1; i < n - 1; i++) {\n\t A[i] = [];\n\t B[i] = [];\n\t A[i][i-1] = h[i-1];\n\t A[i][i] = 2 * (h[i - 1] + h[i]);\n\t A[i][i+1] = h[i];\n\t B[i][0] = alpha[i];\n\t }\n\t c = jStat.multiply(jStat.inv(A), B);\n\t for (j = 0; j < n - 1; j++) {\n\t b[j] = (F[j + 1] - F[j]) / h[j] - h[j] * (c[j + 1][0] + 2 * c[j][0]) / 3;\n\t d[j] = (c[j + 1][0] - c[j][0]) / (3 * h[j]);\n\t }\n\t for (j = 0; j < n; j++) {\n\t if (X[j] > value) break;\n\t }\n\t j -= 1;\n\t return F[j] + (value - X[j]) * b[j] + jStat.sq(value-X[j]) *\n\t c[j] + (value - X[j]) * jStat.sq(value - X[j]) * d[j];\n\t },\n\t\n\t gauss_quadrature: function gauss_quadrature() {\n\t throw new Error('gauss_quadrature not yet implemented');\n\t },\n\t\n\t PCA: function PCA(X) {\n\t var m = X.length;\n\t var n = X[0].length;\n\t var flag = false;\n\t var i = 0;\n\t var j, temp1;\n\t var u = [];\n\t var D = [];\n\t var result = [];\n\t var temp2 = [];\n\t var Y = [];\n\t var Bt = [];\n\t var B = [];\n\t var C = [];\n\t var V = [];\n\t var Vt = [];\n\t for (var i = 0; i < m; i++) {\n\t u[i] = jStat.sum(X[i]) / n;\n\t }\n\t for (var i = 0; i < n; i++) {\n\t B[i] = [];\n\t for(j = 0; j < m; j++) {\n\t B[i][j] = X[j][i] - u[j];\n\t }\n\t }\n\t B = jStat.transpose(B);\n\t for (var i = 0; i < m; i++) {\n\t C[i] = [];\n\t for (j = 0; j < m; j++) {\n\t C[i][j] = (jStat.dot([B[i]], [B[j]])) / (n - 1);\n\t }\n\t }\n\t result = jStat.jacobi(C);\n\t V = result[0];\n\t D = result[1];\n\t Vt = jStat.transpose(V);\n\t for (var i = 0; i < D.length; i++) {\n\t for (j = i; j < D.length; j++) {\n\t if(D[i] < D[j]) {\n\t temp1 = D[i];\n\t D[i] = D[j];\n\t D[j] = temp1;\n\t temp2 = Vt[i];\n\t Vt[i] = Vt[j];\n\t Vt[j] = temp2;\n\t }\n\t }\n\t }\n\t Bt = jStat.transpose(B);\n\t for (var i = 0; i < m; i++) {\n\t Y[i] = [];\n\t for (j = 0; j < Bt.length; j++) {\n\t Y[i][j] = jStat.dot([Vt[i]], [Bt[j]]);\n\t }\n\t }\n\t return [X, D, Vt, Y];\n\t }\n\t});\n\t\n\t// extend jStat.fn with methods that require one argument\n\t(function(funcs) {\n\t for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n\t jStat.fn[passfunc] = function(arg, func) {\n\t var tmpthis = this;\n\t // check for callback\n\t if (func) {\n\t setTimeout(function() {\n\t func.call(tmpthis, jStat.fn[passfunc].call(tmpthis, arg));\n\t }, 15);\n\t return this;\n\t }\n\t if (typeof jStat[passfunc](this, arg) === 'number')\n\t return jStat[passfunc](this, arg);\n\t else\n\t return jStat(jStat[passfunc](this, arg));\n\t };\n\t }(funcs[i]));\n\t}('add divide multiply subtract dot pow exp log abs norm angle'.split(' ')));\n\t\n\t}(this.jStat, Math));\n\t(function(jStat, Math) {\n\t\n\tvar slice = [].slice;\n\tvar isNumber = jStat.utils.isNumber;\n\tvar isArray = jStat.utils.isArray;\n\t\n\t// flag==true denotes use of sample standard deviation\n\t// Z Statistics\n\tjStat.extend({\n\t // 2 different parameter lists:\n\t // (value, mean, sd)\n\t // (value, array, flag)\n\t zscore: function zscore() {\n\t var args = slice.call(arguments);\n\t if (isNumber(args[1])) {\n\t return (args[0] - args[1]) / args[2];\n\t }\n\t return (args[0] - jStat.mean(args[1])) / jStat.stdev(args[1], args[2]);\n\t },\n\t\n\t // 3 different paramter lists:\n\t // (value, mean, sd, sides)\n\t // (zscore, sides)\n\t // (value, array, sides, flag)\n\t ztest: function ztest() {\n\t var args = slice.call(arguments);\n\t var z;\n\t if (isArray(args[1])) {\n\t // (value, array, sides, flag)\n\t z = jStat.zscore(args[0],args[1],args[3]);\n\t return (args[2] === 1) ?\n\t (jStat.normal.cdf(-Math.abs(z), 0, 1)) :\n\t (jStat.normal.cdf(-Math.abs(z), 0, 1)*2);\n\t } else {\n\t if (args.length > 2) {\n\t // (value, mean, sd, sides)\n\t z = jStat.zscore(args[0],args[1],args[2]);\n\t return (args[3] === 1) ?\n\t (jStat.normal.cdf(-Math.abs(z),0,1)) :\n\t (jStat.normal.cdf(-Math.abs(z),0,1)* 2);\n\t } else {\n\t // (zscore, sides)\n\t z = args[0];\n\t return (args[1] === 1) ?\n\t (jStat.normal.cdf(-Math.abs(z),0,1)) :\n\t (jStat.normal.cdf(-Math.abs(z),0,1)*2);\n\t }\n\t }\n\t }\n\t});\n\t\n\tjStat.extend(jStat.fn, {\n\t zscore: function zscore(value, flag) {\n\t return (value - this.mean()) / this.stdev(flag);\n\t },\n\t\n\t ztest: function ztest(value, sides, flag) {\n\t var zscore = Math.abs(this.zscore(value, flag));\n\t return (sides === 1) ?\n\t (jStat.normal.cdf(-zscore, 0, 1)) :\n\t (jStat.normal.cdf(-zscore, 0, 1) * 2);\n\t }\n\t});\n\t\n\t// T Statistics\n\tjStat.extend({\n\t // 2 parameter lists\n\t // (value, mean, sd, n)\n\t // (value, array)\n\t tscore: function tscore() {\n\t var args = slice.call(arguments);\n\t return (args.length === 4) ?\n\t ((args[0] - args[1]) / (args[2] / Math.sqrt(args[3]))) :\n\t ((args[0] - jStat.mean(args[1])) /\n\t (jStat.stdev(args[1], true) / Math.sqrt(args[1].length)));\n\t },\n\t\n\t // 3 different paramter lists:\n\t // (value, mean, sd, n, sides)\n\t // (tscore, n, sides)\n\t // (value, array, sides)\n\t ttest: function ttest() {\n\t var args = slice.call(arguments);\n\t var tscore;\n\t if (args.length === 5) {\n\t tscore = Math.abs(jStat.tscore(args[0], args[1], args[2], args[3]));\n\t return (args[4] === 1) ?\n\t (jStat.studentt.cdf(-tscore, args[3]-1)) :\n\t (jStat.studentt.cdf(-tscore, args[3]-1)*2);\n\t }\n\t if (isNumber(args[1])) {\n\t tscore = Math.abs(args[0])\n\t return (args[2] == 1) ?\n\t (jStat.studentt.cdf(-tscore, args[1]-1)) :\n\t (jStat.studentt.cdf(-tscore, args[1]-1) * 2);\n\t }\n\t tscore = Math.abs(jStat.tscore(args[0], args[1]))\n\t return (args[2] == 1) ?\n\t (jStat.studentt.cdf(-tscore, args[1].length-1)) :\n\t (jStat.studentt.cdf(-tscore, args[1].length-1) * 2);\n\t }\n\t});\n\t\n\tjStat.extend(jStat.fn, {\n\t tscore: function tscore(value) {\n\t return (value - this.mean()) / (this.stdev(true) / Math.sqrt(this.cols()));\n\t },\n\t\n\t ttest: function ttest(value, sides) {\n\t return (sides === 1) ?\n\t (1 - jStat.studentt.cdf(Math.abs(this.tscore(value)), this.cols()-1)) :\n\t (jStat.studentt.cdf(-Math.abs(this.tscore(value)), this.cols()-1)*2);\n\t }\n\t});\n\t\n\t// F Statistics\n\tjStat.extend({\n\t // Paramter list is as follows:\n\t // (array1, array2, array3, ...)\n\t // or it is an array of arrays\n\t // array of arrays conversion\n\t anovafscore: function anovafscore() {\n\t var args = slice.call(arguments),\n\t expVar, sample, sampMean, sampSampMean, tmpargs, unexpVar, i, j;\n\t if (args.length === 1) {\n\t tmpargs = new Array(args[0].length);\n\t for (var i = 0; i < args[0].length; i++) {\n\t tmpargs[i] = args[0][i];\n\t }\n\t args = tmpargs;\n\t }\n\t // 2 sample case\n\t if (args.length === 2) {\n\t return jStat.variance(args[0]) / jStat.variance(args[1]);\n\t }\n\t // Builds sample array\n\t sample = new Array();\n\t for (var i = 0; i < args.length; i++) {\n\t sample = sample.concat(args[i]);\n\t }\n\t sampMean = jStat.mean(sample);\n\t // Computes the explained variance\n\t expVar = 0;\n\t for (var i = 0; i < args.length; i++) {\n\t expVar = expVar + args[i].length * Math.pow(jStat.mean(args[i]) - sampMean, 2);\n\t }\n\t expVar /= (args.length - 1);\n\t // Computes unexplained variance\n\t unexpVar = 0;\n\t for (var i = 0; i < args.length; i++) {\n\t sampSampMean = jStat.mean(args[i]);\n\t for (j = 0; j < args[i].length; j++) {\n\t unexpVar += Math.pow(args[i][j] - sampSampMean, 2);\n\t }\n\t }\n\t unexpVar /= (sample.length - args.length);\n\t return expVar / unexpVar;\n\t },\n\t\n\t // 2 different paramter setups\n\t // (array1, array2, array3, ...)\n\t // (anovafscore, df1, df2)\n\t anovaftest: function anovaftest() {\n\t var args = slice.call(arguments),\n\t df1, df2, n, i;\n\t if (isNumber(args[0])) {\n\t return 1 - jStat.centralF.cdf(args[0], args[1], args[2]);\n\t }\n\t anovafscore = jStat.anovafscore(args);\n\t df1 = args.length - 1;\n\t n = 0;\n\t for (var i = 0; i < args.length; i++) {\n\t n = n + args[i].length;\n\t }\n\t df2 = n - df1 - 1;\n\t return 1 - jStat.centralF.cdf(anovafscore, df1, df2);\n\t },\n\t\n\t ftest: function ftest(fscore, df1, df2) {\n\t return 1 - jStat.centralF.cdf(fscore, df1, df2);\n\t }\n\t});\n\t\n\tjStat.extend(jStat.fn, {\n\t anovafscore: function anovafscore() {\n\t return jStat.anovafscore(this.toArray());\n\t },\n\t\n\t anovaftes: function anovaftes() {\n\t var n = 0;\n\t var i;\n\t for (var i = 0; i < this.length; i++) {\n\t n = n + this[i].length;\n\t }\n\t return jStat.ftest(this.anovafscore(), this.length - 1, n - this.length);\n\t }\n\t});\n\t\n\t// Error Bounds\n\tjStat.extend({\n\t // 2 different parameter setups\n\t // (value, alpha, sd, n)\n\t // (value, alpha, array)\n\t normalci: function normalci() {\n\t var args = slice.call(arguments),\n\t ans = new Array(2),\n\t change;\n\t if (args.length === 4) {\n\t change = Math.abs(jStat.normal.inv(args[1] / 2, 0, 1) *\n\t args[2] / Math.sqrt(args[3]));\n\t } else {\n\t change = Math.abs(jStat.normal.inv(args[1] / 2, 0, 1) *\n\t jStat.stdev(args[2]) / Math.sqrt(args[2].length));\n\t }\n\t ans[0] = args[0] - change;\n\t ans[1] = args[0] + change;\n\t return ans;\n\t },\n\t\n\t // 2 different parameter setups\n\t // (value, alpha, sd, n)\n\t // (value, alpha, array)\n\t tci: function tci() {\n\t var args = slice.call(arguments),\n\t ans = new Array(2),\n\t change;\n\t if (args.length === 4) {\n\t change = Math.abs(jStat.studentt.inv(args[1] / 2, args[3] - 1) *\n\t args[2] / Math.sqrt(args[3]));\n\t } else {\n\t change = Math.abs(jStat.studentt.inv(args[1] / 2, args[2].length - 1) *\n\t jStat.stdev(args[2], true) / Math.sqrt(args[2].length));\n\t }\n\t ans[0] = args[0] - change;\n\t ans[1] = args[0] + change;\n\t return ans;\n\t },\n\t\n\t significant: function significant(pvalue, alpha) {\n\t return pvalue < alpha;\n\t }\n\t});\n\t\n\tjStat.extend(jStat.fn, {\n\t normalci: function normalci(value, alpha) {\n\t return jStat.normalci(value, alpha, this.toArray());\n\t },\n\t\n\t tci: function tci(value, alpha) {\n\t return jStat.tci(value, alpha, this.toArray());\n\t }\n\t});\n\t\n\t// internal method for calculating the z-score for a difference of proportions test\n\tfunction differenceOfProportions(p1, n1, p2, n2) {\n\t if (p1 > 1 || p2 > 1 || p1 <= 0 || p2 <= 0) {\n\t throw new Error(\"Proportions should be greater than 0 and less than 1\")\n\t }\n\t var pooled = (p1 * n1 + p2 * n2) / (n1 + n2);\n\t var se = Math.sqrt(pooled * (1 - pooled) * ((1/n1) + (1/n2)));\n\t return (p1 - p2) / se;\n\t}\n\t\n\t// Difference of Proportions\n\tjStat.extend(jStat.fn, {\n\t oneSidedDifferenceOfProportions: function oneSidedDifferenceOfProportions(p1, n1, p2, n2) {\n\t var z = differenceOfProportions(p1, n1, p2, n2);\n\t return jStat.ztest(z, 1);\n\t },\n\t\n\t twoSidedDifferenceOfProportions: function twoSidedDifferenceOfProportions(p1, n1, p2, n2) {\n\t var z = differenceOfProportions(p1, n1, p2, n2);\n\t return jStat.ztest(z, 2);\n\t }\n\t});\n\t\n\t}(this.jStat, Math));\n\tthis.jStat.models=(function(){\n\t\n\t function sub_regress(endog, exog) {\n\t return ols(endog, exog);\n\t }\n\t\n\t function sub_regress(exog) {\n\t var var_count = exog[0].length;\n\t var modelList = jStat.arange(var_count).map(function(endog_index) {\n\t var exog_index =\n\t jStat.arange(var_count).filter(function(i){return i!==endog_index});\n\t return ols(jStat.col(exog, endog_index).map(function(x){ return x[0] }),\n\t jStat.col(exog, exog_index))\n\t });\n\t return modelList;\n\t }\n\t\n\t // do OLS model regress\n\t // exog have include const columns ,it will not generate it .In fact, exog is\n\t // \"design matrix\" look at\n\t //https://en.wikipedia.org/wiki/Design_matrix\n\t function ols(endog, exog) {\n\t var nobs = endog.length;\n\t var df_model = exog[0].length - 1;\n\t var df_resid = nobs-df_model - 1;\n\t var coef = jStat.lstsq(exog, endog);\n\t var predict =\n\t jStat.multiply(exog, coef.map(function(x) { return [x] }))\n\t .map(function(p) { return p[0] });\n\t var resid = jStat.subtract(endog, predict);\n\t var ybar = jStat.mean(endog);\n\t // constant cause problem\n\t // var SST = jStat.sum(endog.map(function(y) {\n\t // return Math.pow(y-ybar,2);\n\t // }));\n\t var SSE = jStat.sum(predict.map(function(f) {\n\t return Math.pow(f - ybar, 2);\n\t }));\n\t var SSR = jStat.sum(endog.map(function(y, i) {\n\t return Math.pow(y - predict[i], 2);\n\t }));\n\t var SST = SSE + SSR;\n\t var R2 = (SSE / SST);\n\t return {\n\t exog:exog,\n\t endog:endog,\n\t nobs:nobs,\n\t df_model:df_model,\n\t df_resid:df_resid,\n\t coef:coef,\n\t predict:predict,\n\t resid:resid,\n\t ybar:ybar,\n\t SST:SST,\n\t SSE:SSE,\n\t SSR:SSR,\n\t R2:R2\n\t };\n\t }\n\t\n\t // H0: b_I=0\n\t // H1: b_I!=0\n\t function t_test(model) {\n\t var subModelList = sub_regress(model.exog);\n\t //var sigmaHat=jStat.stdev(model.resid);\n\t var sigmaHat = Math.sqrt(model.SSR / (model.df_resid));\n\t var seBetaHat = subModelList.map(function(mod) {\n\t var SST = mod.SST;\n\t var R2 = mod.R2;\n\t return sigmaHat / Math.sqrt(SST * (1 - R2));\n\t });\n\t var tStatistic = model.coef.map(function(coef, i) {\n\t return (coef - 0) / seBetaHat[i];\n\t });\n\t var pValue = tStatistic.map(function(t) {\n\t var leftppf = jStat.studentt.cdf(t, model.df_resid);\n\t return (leftppf > 0.5 ? 1 - leftppf : leftppf) * 2;\n\t });\n\t var c = jStat.studentt.inv(0.975, model.df_resid);\n\t var interval95 = model.coef.map(function(coef, i) {\n\t var d = c * seBetaHat[i];\n\t return [coef - d, coef + d];\n\t })\n\t return {\n\t se: seBetaHat,\n\t t: tStatistic,\n\t p: pValue,\n\t sigmaHat: sigmaHat,\n\t interval95: interval95\n\t };\n\t }\n\t\n\t function F_test(model) {\n\t var F_statistic =\n\t (model.R2 / model.df_model) / ((1 - model.R2) / model.df_resid);\n\t var fcdf = function(x, n1, n2) {\n\t return jStat.beta.cdf(x / (n2 / n1 + x), n1 / 2, n2 / 2)\n\t }\n\t var pvalue = 1 - fcdf(F_statistic, model.df_model, model.df_resid);\n\t return { F_statistic: F_statistic, pvalue: pvalue };\n\t }\n\t\n\t function ols_wrap(endog, exog) {\n\t var model = ols(endog,exog);\n\t var ttest = t_test(model);\n\t var ftest = F_test(model);\n\t var adjust_R2 =\n\t 1 - (1 - model.rsquared) * ((model.nobs - 1) / (model.df_resid));\n\t model.t = ttest;\n\t model.f = ftest;\n\t model.adjust_R2 = adjust_R2;\n\t return model;\n\t }\n\t\n\t return { ols: ols_wrap };\n\t})();\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar utils = __webpack_require__(15);\n\tvar numbro = __webpack_require__(19);\n\tvar error = __webpack_require__(16);\n\t\n\texports.UNIQUE = function () {\n\t var result = [];\n\t for (var i = 0; i < arguments.length; ++i) {\n\t var hasElement = false;\n\t var element = arguments[i];\n\t\n\t // Check if we've already seen this element.\n\t for (var j = 0; j < result.length; ++j) {\n\t hasElement = result[j] === element;\n\t if (hasElement) { break; }\n\t }\n\t\n\t // If we did not find it, add it to the result.\n\t if (!hasElement) {\n\t result.push(element);\n\t }\n\t }\n\t return result;\n\t};\n\t\n\texports.FLATTEN = utils.flatten;\n\t\n\texports.ARGS2ARRAY = function () {\n\t return Array.prototype.slice.call(arguments, 0);\n\t};\n\t\n\texports.REFERENCE = function (context, reference) {\n\t if (!arguments.length) {\n\t return error.error;\n\t }\n\t try {\n\t var path = reference.split('.');\n\t var result = context;\n\t for (var i = 0; i < path.length; ++i) {\n\t var step = path[i];\n\t if (step[step.length - 1] === ']') {\n\t var opening = step.indexOf('[');\n\t var index = step.substring(opening + 1, step.length - 1);\n\t result = result[step.substring(0, opening)][index];\n\t } else {\n\t result = result[step];\n\t }\n\t }\n\t return result;\n\t } catch (error) {}\n\t};\n\t\n\texports.JOIN = function (array, separator) {\n\t return array.join(separator);\n\t};\n\t\n\texports.NUMBERS = function () {\n\t var possibleNumbers = utils.flatten(arguments);\n\t return possibleNumbers.filter(function (el) {\n\t return typeof el === 'number';\n\t });\n\t};\n\t\n\texports.NUMERAL = function (number, format) {\n\t return numbro(number).format(format);\n\t};\n\n\n/***/ },\n/* 24 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar error = __webpack_require__(16);\n\t\n\t// TODO\n\texports.CELL = function() {\n\t throw new Error('CELL is not implemented');\n\t};\n\t\n\texports.ERROR = {};\n\texports.ERROR.TYPE = function(error_val) {\n\t switch (error_val) {\n\t case error.nil: return 1;\n\t case error.div0: return 2;\n\t case error.value: return 3;\n\t case error.ref: return 4;\n\t case error.name: return 5;\n\t case error.num: return 6;\n\t case error.na: return 7;\n\t case error.data: return 8;\n\t }\n\t return error.na;\n\t};\n\t\n\t// TODO\n\texports.INFO = function() {\n\t throw new Error('INFO is not implemented');\n\t};\n\t\n\texports.ISBLANK = function(value) {\n\t return value === null;\n\t};\n\t\n\texports.ISBINARY = function (number) {\n\t return (/^[01]{1,10}$/).test(number);\n\t};\n\t\n\texports.ISERR = function(value) {\n\t return ([error.value, error.ref, error.div0, error.num, error.name, error.nil]).indexOf(value) >= 0 ||\n\t (typeof value === 'number' && (isNaN(value) || !isFinite(value)));\n\t};\n\t\n\texports.ISERROR = function(value) {\n\t return exports.ISERR(value) || value === error.na;\n\t};\n\t\n\texports.ISEVEN = function(number) {\n\t return (Math.floor(Math.abs(number)) & 1) ? false : true;\n\t};\n\t\n\t// TODO\n\texports.ISFORMULA = function() {\n\t throw new Error('ISFORMULA is not implemented');\n\t};\n\t\n\texports.ISLOGICAL = function(value) {\n\t return value === true || value === false;\n\t};\n\t\n\texports.ISNA = function(value) {\n\t return value === error.na;\n\t};\n\t\n\texports.ISNONTEXT = function(value) {\n\t return typeof(value) !== 'string';\n\t};\n\t\n\texports.ISNUMBER = function(value) {\n\t return typeof(value) === 'number' && !isNaN(value) && isFinite(value);\n\t};\n\t\n\texports.ISODD = function(number) {\n\t return (Math.floor(Math.abs(number)) & 1) ? true : false;\n\t};\n\t\n\t// TODO\n\texports.ISREF = function() {\n\t throw new Error('ISREF is not implemented');\n\t};\n\t\n\texports.ISTEXT = function(value) {\n\t return typeof(value) === 'string';\n\t};\n\t\n\texports.N = function(value) {\n\t if (this.ISNUMBER(value)) {\n\t return value;\n\t }\n\t if (value instanceof Date) {\n\t return value.getTime();\n\t }\n\t if (value === true) {\n\t return 1;\n\t }\n\t if (value === false) {\n\t return 0;\n\t }\n\t if (this.ISERROR(value)) {\n\t return value;\n\t }\n\t return 0;\n\t};\n\t\n\texports.NA = function() {\n\t return error.na;\n\t};\n\t\n\t\n\t// TODO\n\texports.SHEET = function() {\n\t throw new Error('SHEET is not implemented');\n\t};\n\t\n\t// TODO\n\texports.SHEETS = function() {\n\t throw new Error('SHEETS is not implemented');\n\t};\n\t\n\texports.TYPE = function(value) {\n\t if (this.ISNUMBER(value)) {\n\t return 1;\n\t }\n\t if (this.ISTEXT(value)) {\n\t return 2;\n\t }\n\t if (this.ISLOGICAL(value)) {\n\t return 4;\n\t }\n\t if (this.ISERROR(value)) {\n\t return 16;\n\t }\n\t if (Array.isArray(value)) {\n\t return 64;\n\t }\n\t};\n\n\n/***/ },\n/* 25 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar error = __webpack_require__(16);\n\tvar jStat = __webpack_require__(22).jStat;\n\tvar text = __webpack_require__(18);\n\tvar utils = __webpack_require__(15);\n\tvar bessel = __webpack_require__(26);\n\t\n\tfunction isValidBinaryNumber(number) {\n\t return (/^[01]{1,10}$/).test(number);\n\t}\n\t\n\texports.BESSELI = function(x, n) {\n\t x = utils.parseNumber(x);\n\t n = utils.parseNumber(n);\n\t if (utils.anyIsError(x, n)) {\n\t return error.value;\n\t }\n\t\n\t return bessel.besseli(x, n);\n\t};\n\t\n\texports.BESSELJ = function(x, n) {\n\t x = utils.parseNumber(x);\n\t n = utils.parseNumber(n);\n\t if (utils.anyIsError(x, n)) {\n\t return error.value;\n\t }\n\t\n\t return bessel.besselj(x, n);\n\t};\n\t\n\texports.BESSELK = function(x, n) {\n\t x = utils.parseNumber(x);\n\t n = utils.parseNumber(n);\n\t if (utils.anyIsError(x, n)) {\n\t return error.value;\n\t }\n\t\n\t return bessel.besselk(x, n);\n\t};\n\t\n\texports.BESSELY = function(x, n) {\n\t x = utils.parseNumber(x);\n\t n = utils.parseNumber(n);\n\t if (utils.anyIsError(x, n)) {\n\t return error.value;\n\t }\n\t\n\t return bessel.bessely(x, n);\n\t};\n\t\n\texports.BIN2DEC = function(number) {\n\t // Return error if number is not binary or contains more than 10 characters (10 digits)\n\t if (!isValidBinaryNumber(number)) {\n\t return error.num;\n\t }\n\t\n\t // Convert binary number to decimal\n\t var result = parseInt(number, 2);\n\t\n\t // Handle negative numbers\n\t var stringified = number.toString();\n\t if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n\t return parseInt(stringified.substring(1), 2) - 512;\n\t } else {\n\t return result;\n\t }\n\t};\n\t\n\t\n\texports.BIN2HEX = function(number, places) {\n\t // Return error if number is not binary or contains more than 10 characters (10 digits)\n\t if (!isValidBinaryNumber(number)) {\n\t return error.num;\n\t }\n\t\n\t // Ignore places and return a 10-character hexadecimal number if number is negative\n\t var stringified = number.toString();\n\t if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n\t return (1099511627264 + parseInt(stringified.substring(1), 2)).toString(16);\n\t }\n\t\n\t // Convert binary number to hexadecimal\n\t var result = parseInt(number, 2).toString(16);\n\t\n\t // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n\t if (places === undefined) {\n\t return result;\n\t } else {\n\t // Return error if places is nonnumeric\n\t if (isNaN(places)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if places is negative\n\t if (places < 0) {\n\t return error.num;\n\t }\n\t\n\t // Truncate places in case it is not an integer\n\t places = Math.floor(places);\n\t\n\t // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n\t return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n\t }\n\t};\n\t\n\texports.BIN2OCT = function(number, places) {\n\t // Return error if number is not binary or contains more than 10 characters (10 digits)\n\t if (!isValidBinaryNumber(number)) {\n\t return error.num;\n\t }\n\t\n\t // Ignore places and return a 10-character octal number if number is negative\n\t var stringified = number.toString();\n\t if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n\t return (1073741312 + parseInt(stringified.substring(1), 2)).toString(8);\n\t }\n\t\n\t // Convert binary number to octal\n\t var result = parseInt(number, 2).toString(8);\n\t\n\t // Return octal number using the minimum number of characters necessary if places is undefined\n\t if (places === undefined) {\n\t return result;\n\t } else {\n\t // Return error if places is nonnumeric\n\t if (isNaN(places)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if places is negative\n\t if (places < 0) {\n\t return error.num;\n\t }\n\t\n\t // Truncate places in case it is not an integer\n\t places = Math.floor(places);\n\t\n\t // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n\t return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n\t }\n\t};\n\t\n\texports.BITAND = function(number1, number2) {\n\t // Return error if either number is a non-numeric value\n\t number1 = utils.parseNumber(number1);\n\t number2 = utils.parseNumber(number2);\n\t if (utils.anyIsError(number1, number2)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if either number is less than 0\n\t if (number1 < 0 || number2 < 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if either number is a non-integer\n\t if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n\t return error.num;\n\t }\n\t\n\t // Return error if either number is greater than (2^48)-1\n\t if (number1 > 281474976710655 || number2 > 281474976710655) {\n\t return error.num;\n\t }\n\t\n\t // Return bitwise AND of two numbers\n\t return number1 & number2;\n\t};\n\t\n\texports.BITLSHIFT = function(number, shift) {\n\t number = utils.parseNumber(number);\n\t shift = utils.parseNumber(shift);\n\t if (utils.anyIsError(number, shift)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if number is less than 0\n\t if (number < 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if number is a non-integer\n\t if (Math.floor(number) !== number) {\n\t return error.num;\n\t }\n\t\n\t // Return error if number is greater than (2^48)-1\n\t if (number > 281474976710655) {\n\t return error.num;\n\t }\n\t\n\t // Return error if the absolute value of shift is greater than 53\n\t if (Math.abs(shift) > 53) {\n\t return error.num;\n\t }\n\t\n\t // Return number shifted by shift bits to the left or to the right if shift is negative\n\t return (shift >= 0) ? number << shift : number >> -shift;\n\t};\n\t\n\texports.BITOR = function(number1, number2) {\n\t number1 = utils.parseNumber(number1);\n\t number2 = utils.parseNumber(number2);\n\t if (utils.anyIsError(number1, number2)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if either number is less than 0\n\t if (number1 < 0 || number2 < 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if either number is a non-integer\n\t if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n\t return error.num;\n\t }\n\t\n\t // Return error if either number is greater than (2^48)-1\n\t if (number1 > 281474976710655 || number2 > 281474976710655) {\n\t return error.num;\n\t }\n\t\n\t // Return bitwise OR of two numbers\n\t return number1 | number2;\n\t};\n\t\n\texports.BITRSHIFT = function(number, shift) {\n\t number = utils.parseNumber(number);\n\t shift = utils.parseNumber(shift);\n\t if (utils.anyIsError(number, shift)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if number is less than 0\n\t if (number < 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if number is a non-integer\n\t if (Math.floor(number) !== number) {\n\t return error.num;\n\t }\n\t\n\t // Return error if number is greater than (2^48)-1\n\t if (number > 281474976710655) {\n\t return error.num;\n\t }\n\t\n\t // Return error if the absolute value of shift is greater than 53\n\t if (Math.abs(shift) > 53) {\n\t return error.num;\n\t }\n\t\n\t // Return number shifted by shift bits to the right or to the left if shift is negative\n\t return (shift >= 0) ? number >> shift : number << -shift;\n\t};\n\t\n\texports.BITXOR = function(number1, number2) {\n\t number1 = utils.parseNumber(number1);\n\t number2 = utils.parseNumber(number2);\n\t if (utils.anyIsError(number1, number2)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if either number is less than 0\n\t if (number1 < 0 || number2 < 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if either number is a non-integer\n\t if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n\t return error.num;\n\t }\n\t\n\t // Return error if either number is greater than (2^48)-1\n\t if (number1 > 281474976710655 || number2 > 281474976710655) {\n\t return error.num;\n\t }\n\t\n\t // Return bitwise XOR of two numbers\n\t return number1 ^ number2;\n\t};\n\t\n\texports.COMPLEX = function(real, imaginary, suffix) {\n\t real = utils.parseNumber(real);\n\t imaginary = utils.parseNumber(imaginary);\n\t if (utils.anyIsError(real, imaginary)) {\n\t return real;\n\t }\n\t\n\t // Set suffix\n\t suffix = (suffix === undefined) ? 'i' : suffix;\n\t\n\t // Return error if suffix is neither \"i\" nor \"j\"\n\t if (suffix !== 'i' && suffix !== 'j') {\n\t return error.value;\n\t }\n\t\n\t // Return complex number\n\t if (real === 0 && imaginary === 0) {\n\t return 0;\n\t } else if (real === 0) {\n\t return (imaginary === 1) ? suffix : imaginary.toString() + suffix;\n\t } else if (imaginary === 0) {\n\t return real.toString();\n\t } else {\n\t var sign = (imaginary > 0) ? '+' : '';\n\t return real.toString() + sign + ((imaginary === 1) ? suffix : imaginary.toString() + suffix);\n\t }\n\t};\n\t\n\texports.CONVERT = function(number, from_unit, to_unit) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t\n\t // List of units supported by CONVERT and units defined by the International System of Units\n\t // [Name, Symbol, Alternate symbols, Quantity, ISU, CONVERT, Conversion ratio]\n\t var units = [\n\t [\"a.u. of action\", \"?\", null, \"action\", false, false, 1.05457168181818e-34],\n\t [\"a.u. of charge\", \"e\", null, \"electric_charge\", false, false, 1.60217653141414e-19],\n\t [\"a.u. of energy\", \"Eh\", null, \"energy\", false, false, 4.35974417757576e-18],\n\t [\"a.u. of length\", \"a?\", null, \"length\", false, false, 5.29177210818182e-11],\n\t [\"a.u. of mass\", \"m?\", null, \"mass\", false, false, 9.10938261616162e-31],\n\t [\"a.u. of time\", \"?/Eh\", null, \"time\", false, false, 2.41888432650516e-17],\n\t [\"admiralty knot\", \"admkn\", null, \"speed\", false, true, 0.514773333],\n\t [\"ampere\", \"A\", null, \"electric_current\", true, false, 1],\n\t [\"ampere per meter\", \"A/m\", null, \"magnetic_field_intensity\", true, false, 1],\n\t [\"ångström\", \"Å\", [\"ang\"], \"length\", false, true, 1e-10],\n\t [\"are\", \"ar\", null, \"area\", false, true, 100],\n\t [\"astronomical unit\", \"ua\", null, \"length\", false, false, 1.49597870691667e-11],\n\t [\"bar\", \"bar\", null, \"pressure\", false, false, 100000],\n\t [\"barn\", \"b\", null, \"area\", false, false, 1e-28],\n\t [\"becquerel\", \"Bq\", null, \"radioactivity\", true, false, 1],\n\t [\"bit\", \"bit\", [\"b\"], \"information\", false, true, 1],\n\t [\"btu\", \"BTU\", [\"btu\"], \"energy\", false, true, 1055.05585262],\n\t [\"byte\", \"byte\", null, \"information\", false, true, 8],\n\t [\"candela\", \"cd\", null, \"luminous_intensity\", true, false, 1],\n\t [\"candela per square metre\", \"cd/m?\", null, \"luminance\", true, false, 1],\n\t [\"coulomb\", \"C\", null, \"electric_charge\", true, false, 1],\n\t [\"cubic ångström\", \"ang3\", [\"ang^3\"], \"volume\", false, true, 1e-30],\n\t [\"cubic foot\", \"ft3\", [\"ft^3\"], \"volume\", false, true, 0.028316846592],\n\t [\"cubic inch\", \"in3\", [\"in^3\"], \"volume\", false, true, 0.000016387064],\n\t [\"cubic light-year\", \"ly3\", [\"ly^3\"], \"volume\", false, true, 8.46786664623715e-47],\n\t [\"cubic metre\", \"m?\", null, \"volume\", true, true, 1],\n\t [\"cubic mile\", \"mi3\", [\"mi^3\"], \"volume\", false, true, 4168181825.44058],\n\t [\"cubic nautical mile\", \"Nmi3\", [\"Nmi^3\"], \"volume\", false, true, 6352182208],\n\t [\"cubic Pica\", \"Pica3\", [\"Picapt3\", \"Pica^3\", \"Picapt^3\"], \"volume\", false, true, 7.58660370370369e-8],\n\t [\"cubic yard\", \"yd3\", [\"yd^3\"], \"volume\", false, true, 0.764554857984],\n\t [\"cup\", \"cup\", null, \"volume\", false, true, 0.0002365882365],\n\t [\"dalton\", \"Da\", [\"u\"], \"mass\", false, false, 1.66053886282828e-27],\n\t [\"day\", \"d\", [\"day\"], \"time\", false, true, 86400],\n\t [\"degree\", \"°\", null, \"angle\", false, false, 0.0174532925199433],\n\t [\"degrees Rankine\", \"Rank\", null, \"temperature\", false, true, 0.555555555555556],\n\t [\"dyne\", \"dyn\", [\"dy\"], \"force\", false, true, 0.00001],\n\t [\"electronvolt\", \"eV\", [\"ev\"], \"energy\", false, true, 1.60217656514141],\n\t [\"ell\", \"ell\", null, \"length\", false, true, 1.143],\n\t [\"erg\", \"erg\", [\"e\"], \"energy\", false, true, 1e-7],\n\t [\"farad\", \"F\", null, \"electric_capacitance\", true, false, 1],\n\t [\"fluid ounce\", \"oz\", null, \"volume\", false, true, 0.0000295735295625],\n\t [\"foot\", \"ft\", null, \"length\", false, true, 0.3048],\n\t [\"foot-pound\", \"flb\", null, \"energy\", false, true, 1.3558179483314],\n\t [\"gal\", \"Gal\", null, \"acceleration\", false, false, 0.01],\n\t [\"gallon\", \"gal\", null, \"volume\", false, true, 0.003785411784],\n\t [\"gauss\", \"G\", [\"ga\"], \"magnetic_flux_density\", false, true, 1],\n\t [\"grain\", \"grain\", null, \"mass\", false, true, 0.0000647989],\n\t [\"gram\", \"g\", null, \"mass\", false, true, 0.001],\n\t [\"gray\", \"Gy\", null, \"absorbed_dose\", true, false, 1],\n\t [\"gross registered ton\", \"GRT\", [\"regton\"], \"volume\", false, true, 2.8316846592],\n\t [\"hectare\", \"ha\", null, \"area\", false, true, 10000],\n\t [\"henry\", \"H\", null, \"inductance\", true, false, 1],\n\t [\"hertz\", \"Hz\", null, \"frequency\", true, false, 1],\n\t [\"horsepower\", \"HP\", [\"h\"], \"power\", false, true, 745.69987158227],\n\t [\"horsepower-hour\", \"HPh\", [\"hh\", \"hph\"], \"energy\", false, true, 2684519.538],\n\t [\"hour\", \"h\", [\"hr\"], \"time\", false, true, 3600],\n\t [\"imperial gallon (U.K.)\", \"uk_gal\", null, \"volume\", false, true, 0.00454609],\n\t [\"imperial hundredweight\", \"lcwt\", [\"uk_cwt\", \"hweight\"], \"mass\", false, true, 50.802345],\n\t [\"imperial quart (U.K)\", \"uk_qt\", null, \"volume\", false, true, 0.0011365225],\n\t [\"imperial ton\", \"brton\", [\"uk_ton\", \"LTON\"], \"mass\", false, true, 1016.046909],\n\t [\"inch\", \"in\", null, \"length\", false, true, 0.0254],\n\t [\"international acre\", \"uk_acre\", null, \"area\", false, true, 4046.8564224],\n\t [\"IT calorie\", \"cal\", null, \"energy\", false, true, 4.1868],\n\t [\"joule\", \"J\", null, \"energy\", true, true, 1],\n\t [\"katal\", \"kat\", null, \"catalytic_activity\", true, false, 1],\n\t [\"kelvin\", \"K\", [\"kel\"], \"temperature\", true, true, 1],\n\t [\"kilogram\", \"kg\", null, \"mass\", true, true, 1],\n\t [\"knot\", \"kn\", null, \"speed\", false, true, 0.514444444444444],\n\t [\"light-year\", \"ly\", null, \"length\", false, true, 9460730472580800],\n\t [\"litre\", \"L\", [\"l\", \"lt\"], \"volume\", false, true, 0.001],\n\t [\"lumen\", \"lm\", null, \"luminous_flux\", true, false, 1],\n\t [\"lux\", \"lx\", null, \"illuminance\", true, false, 1],\n\t [\"maxwell\", \"Mx\", null, \"magnetic_flux\", false, false, 1e-18],\n\t [\"measurement ton\", \"MTON\", null, \"volume\", false, true, 1.13267386368],\n\t [\"meter per hour\", \"m/h\", [\"m/hr\"], \"speed\", false, true, 0.00027777777777778],\n\t [\"meter per second\", \"m/s\", [\"m/sec\"], \"speed\", true, true, 1],\n\t [\"meter per second squared\", \"m?s??\", null, \"acceleration\", true, false, 1],\n\t [\"parsec\", \"pc\", [\"parsec\"], \"length\", false, true, 30856775814671900],\n\t [\"meter squared per second\", \"m?/s\", null, \"kinematic_viscosity\", true, false, 1],\n\t [\"metre\", \"m\", null, \"length\", true, true, 1],\n\t [\"miles per hour\", \"mph\", null, \"speed\", false, true, 0.44704],\n\t [\"millimetre of mercury\", \"mmHg\", null, \"pressure\", false, false, 133.322],\n\t [\"minute\", \"?\", null, \"angle\", false, false, 0.000290888208665722],\n\t [\"minute\", \"min\", [\"mn\"], \"time\", false, true, 60],\n\t [\"modern teaspoon\", \"tspm\", null, \"volume\", false, true, 0.000005],\n\t [\"mole\", \"mol\", null, \"amount_of_substance\", true, false, 1],\n\t [\"morgen\", \"Morgen\", null, \"area\", false, true, 2500],\n\t [\"n.u. of action\", \"?\", null, \"action\", false, false, 1.05457168181818e-34],\n\t [\"n.u. of mass\", \"m?\", null, \"mass\", false, false, 9.10938261616162e-31],\n\t [\"n.u. of speed\", \"c?\", null, \"speed\", false, false, 299792458],\n\t [\"n.u. of time\", \"?/(me?c??)\", null, \"time\", false, false, 1.28808866778687e-21],\n\t [\"nautical mile\", \"M\", [\"Nmi\"], \"length\", false, true, 1852],\n\t [\"newton\", \"N\", null, \"force\", true, true, 1],\n\t [\"œrsted\", \"Oe \", null, \"magnetic_field_intensity\", false, false, 79.5774715459477],\n\t [\"ohm\", \"Ω\", null, \"electric_resistance\", true, false, 1],\n\t [\"ounce mass\", \"ozm\", null, \"mass\", false, true, 0.028349523125],\n\t [\"pascal\", \"Pa\", null, \"pressure\", true, false, 1],\n\t [\"pascal second\", \"Pa?s\", null, \"dynamic_viscosity\", true, false, 1],\n\t [\"pferdestärke\", \"PS\", null, \"power\", false, true, 735.49875],\n\t [\"phot\", \"ph\", null, \"illuminance\", false, false, 0.0001],\n\t [\"pica (1/6 inch)\", \"pica\", null, \"length\", false, true, 0.00035277777777778],\n\t [\"pica (1/72 inch)\", \"Pica\", [\"Picapt\"], \"length\", false, true, 0.00423333333333333],\n\t [\"poise\", \"P\", null, \"dynamic_viscosity\", false, false, 0.1],\n\t [\"pond\", \"pond\", null, \"force\", false, true, 0.00980665],\n\t [\"pound force\", \"lbf\", null, \"force\", false, true, 4.4482216152605],\n\t [\"pound mass\", \"lbm\", null, \"mass\", false, true, 0.45359237],\n\t [\"quart\", \"qt\", null, \"volume\", false, true, 0.000946352946],\n\t [\"radian\", \"rad\", null, \"angle\", true, false, 1],\n\t [\"second\", \"?\", null, \"angle\", false, false, 0.00000484813681109536],\n\t [\"second\", \"s\", [\"sec\"], \"time\", true, true, 1],\n\t [\"short hundredweight\", \"cwt\", [\"shweight\"], \"mass\", false, true, 45.359237],\n\t [\"siemens\", \"S\", null, \"electrical_conductance\", true, false, 1],\n\t [\"sievert\", \"Sv\", null, \"equivalent_dose\", true, false, 1],\n\t [\"slug\", \"sg\", null, \"mass\", false, true, 14.59390294],\n\t [\"square ångström\", \"ang2\", [\"ang^2\"], \"area\", false, true, 1e-20],\n\t [\"square foot\", \"ft2\", [\"ft^2\"], \"area\", false, true, 0.09290304],\n\t [\"square inch\", \"in2\", [\"in^2\"], \"area\", false, true, 0.00064516],\n\t [\"square light-year\", \"ly2\", [\"ly^2\"], \"area\", false, true, 8.95054210748189e+31],\n\t [\"square meter\", \"m?\", null, \"area\", true, true, 1],\n\t [\"square mile\", \"mi2\", [\"mi^2\"], \"area\", false, true, 2589988.110336],\n\t [\"square nautical mile\", \"Nmi2\", [\"Nmi^2\"], \"area\", false, true, 3429904],\n\t [\"square Pica\", \"Pica2\", [\"Picapt2\", \"Pica^2\", \"Picapt^2\"], \"area\", false, true, 0.00001792111111111],\n\t [\"square yard\", \"yd2\", [\"yd^2\"], \"area\", false, true, 0.83612736],\n\t [\"statute mile\", \"mi\", null, \"length\", false, true, 1609.344],\n\t [\"steradian\", \"sr\", null, \"solid_angle\", true, false, 1],\n\t [\"stilb\", \"sb\", null, \"luminance\", false, false, 0.0001],\n\t [\"stokes\", \"St\", null, \"kinematic_viscosity\", false, false, 0.0001],\n\t [\"stone\", \"stone\", null, \"mass\", false, true, 6.35029318],\n\t [\"tablespoon\", \"tbs\", null, \"volume\", false, true, 0.0000147868],\n\t [\"teaspoon\", \"tsp\", null, \"volume\", false, true, 0.00000492892],\n\t [\"tesla\", \"T\", null, \"magnetic_flux_density\", true, true, 1],\n\t [\"thermodynamic calorie\", \"c\", null, \"energy\", false, true, 4.184],\n\t [\"ton\", \"ton\", null, \"mass\", false, true, 907.18474],\n\t [\"tonne\", \"t\", null, \"mass\", false, false, 1000],\n\t [\"U.K. pint\", \"uk_pt\", null, \"volume\", false, true, 0.00056826125],\n\t [\"U.S. bushel\", \"bushel\", null, \"volume\", false, true, 0.03523907],\n\t [\"U.S. oil barrel\", \"barrel\", null, \"volume\", false, true, 0.158987295],\n\t [\"U.S. pint\", \"pt\", [\"us_pt\"], \"volume\", false, true, 0.000473176473],\n\t [\"U.S. survey mile\", \"survey_mi\", null, \"length\", false, true, 1609.347219],\n\t [\"U.S. survey/statute acre\", \"us_acre\", null, \"area\", false, true, 4046.87261],\n\t [\"volt\", \"V\", null, \"voltage\", true, false, 1],\n\t [\"watt\", \"W\", null, \"power\", true, true, 1],\n\t [\"watt-hour\", \"Wh\", [\"wh\"], \"energy\", false, true, 3600],\n\t [\"weber\", \"Wb\", null, \"magnetic_flux\", true, false, 1],\n\t [\"yard\", \"yd\", null, \"length\", false, true, 0.9144],\n\t [\"year\", \"yr\", null, \"time\", false, true, 31557600]\n\t ];\n\t\n\t // Binary prefixes\n\t // [Name, Prefix power of 2 value, Previx value, Abbreviation, Derived from]\n\t var binary_prefixes = {\n\t Yi: [\"yobi\", 80, 1208925819614629174706176, \"Yi\", \"yotta\"],\n\t Zi: [\"zebi\", 70, 1180591620717411303424, \"Zi\", \"zetta\"],\n\t Ei: [\"exbi\", 60, 1152921504606846976, \"Ei\", \"exa\"],\n\t Pi: [\"pebi\", 50, 1125899906842624, \"Pi\", \"peta\"],\n\t Ti: [\"tebi\", 40, 1099511627776, \"Ti\", \"tera\"],\n\t Gi: [\"gibi\", 30, 1073741824, \"Gi\", \"giga\"],\n\t Mi: [\"mebi\", 20, 1048576, \"Mi\", \"mega\"],\n\t ki: [\"kibi\", 10, 1024, \"ki\", \"kilo\"]\n\t };\n\t\n\t // Unit prefixes\n\t // [Name, Multiplier, Abbreviation]\n\t var unit_prefixes = {\n\t Y: [\"yotta\", 1e+24, \"Y\"],\n\t Z: [\"zetta\", 1e+21, \"Z\"],\n\t E: [\"exa\", 1e+18, \"E\"],\n\t P: [\"peta\", 1e+15, \"P\"],\n\t T: [\"tera\", 1e+12, \"T\"],\n\t G: [\"giga\", 1e+09, \"G\"],\n\t M: [\"mega\", 1e+06, \"M\"],\n\t k: [\"kilo\", 1e+03, \"k\"],\n\t h: [\"hecto\", 1e+02, \"h\"],\n\t e: [\"dekao\", 1e+01, \"e\"],\n\t d: [\"deci\", 1e-01, \"d\"],\n\t c: [\"centi\", 1e-02, \"c\"],\n\t m: [\"milli\", 1e-03, \"m\"],\n\t u: [\"micro\", 1e-06, \"u\"],\n\t n: [\"nano\", 1e-09, \"n\"],\n\t p: [\"pico\", 1e-12, \"p\"],\n\t f: [\"femto\", 1e-15, \"f\"],\n\t a: [\"atto\", 1e-18, \"a\"],\n\t z: [\"zepto\", 1e-21, \"z\"],\n\t y: [\"yocto\", 1e-24, \"y\"]\n\t };\n\t\n\t // Initialize units and multipliers\n\t var from = null;\n\t var to = null;\n\t var base_from_unit = from_unit;\n\t var base_to_unit = to_unit;\n\t var from_multiplier = 1;\n\t var to_multiplier = 1;\n\t var alt;\n\t\n\t // Lookup from and to units\n\t for (var i = 0; i < units.length; i++) {\n\t alt = (units[i][2] === null) ? [] : units[i][2];\n\t if (units[i][1] === base_from_unit || alt.indexOf(base_from_unit) >= 0) {\n\t from = units[i];\n\t }\n\t if (units[i][1] === base_to_unit || alt.indexOf(base_to_unit) >= 0) {\n\t to = units[i];\n\t }\n\t }\n\t\n\t // Lookup from prefix\n\t if (from === null) {\n\t var from_binary_prefix = binary_prefixes[from_unit.substring(0, 2)];\n\t var from_unit_prefix = unit_prefixes[from_unit.substring(0, 1)];\n\t\n\t // Handle dekao unit prefix (only unit prefix with two characters)\n\t if (from_unit.substring(0, 2) === 'da') {\n\t from_unit_prefix = [\"dekao\", 1e+01, \"da\"];\n\t }\n\t\n\t // Handle binary prefixes first (so that 'Yi' is processed before 'Y')\n\t if (from_binary_prefix) {\n\t from_multiplier = from_binary_prefix[2];\n\t base_from_unit = from_unit.substring(2);\n\t } else if (from_unit_prefix) {\n\t from_multiplier = from_unit_prefix[1];\n\t base_from_unit = from_unit.substring(from_unit_prefix[2].length);\n\t }\n\t\n\t // Lookup from unit\n\t for (var j = 0; j < units.length; j++) {\n\t alt = (units[j][2] === null) ? [] : units[j][2];\n\t if (units[j][1] === base_from_unit || alt.indexOf(base_from_unit) >= 0) {\n\t from = units[j];\n\t }\n\t }\n\t }\n\t\n\t // Lookup to prefix\n\t if (to === null) {\n\t var to_binary_prefix = binary_prefixes[to_unit.substring(0, 2)];\n\t var to_unit_prefix = unit_prefixes[to_unit.substring(0, 1)];\n\t\n\t // Handle dekao unit prefix (only unit prefix with two characters)\n\t if (to_unit.substring(0, 2) === 'da') {\n\t to_unit_prefix = [\"dekao\", 1e+01, \"da\"];\n\t }\n\t\n\t // Handle binary prefixes first (so that 'Yi' is processed before 'Y')\n\t if (to_binary_prefix) {\n\t to_multiplier = to_binary_prefix[2];\n\t base_to_unit = to_unit.substring(2);\n\t } else if (to_unit_prefix) {\n\t to_multiplier = to_unit_prefix[1];\n\t base_to_unit = to_unit.substring(to_unit_prefix[2].length);\n\t }\n\t\n\t // Lookup to unit\n\t for (var k = 0; k < units.length; k++) {\n\t alt = (units[k][2] === null) ? [] : units[k][2];\n\t if (units[k][1] === base_to_unit || alt.indexOf(base_to_unit) >= 0) {\n\t to = units[k];\n\t }\n\t }\n\t }\n\t\n\t // Return error if a unit does not exist\n\t if (from === null || to === null) {\n\t return error.na;\n\t }\n\t\n\t // Return error if units represent different quantities\n\t if (from[3] !== to[3]) {\n\t return error.na;\n\t }\n\t\n\t // Return converted number\n\t return number * from[6] * from_multiplier / (to[6] * to_multiplier);\n\t};\n\t\n\texports.DEC2BIN = function(number, places) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t\n\t // Return error if number is not decimal, is lower than -512, or is greater than 511\n\t if (!/^-?[0-9]{1,3}$/.test(number) || number < -512 || number > 511) {\n\t return error.num;\n\t }\n\t\n\t // Ignore places and return a 10-character binary number if number is negative\n\t if (number < 0) {\n\t return '1' + text.REPT('0', 9 - (512 + number).toString(2).length) + (512 + number).toString(2);\n\t }\n\t\n\t // Convert decimal number to binary\n\t var result = parseInt(number, 10).toString(2);\n\t\n\t // Return binary number using the minimum number of characters necessary if places is undefined\n\t if (typeof places === 'undefined') {\n\t return result;\n\t } else {\n\t // Return error if places is nonnumeric\n\t if (isNaN(places)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if places is negative\n\t if (places < 0) {\n\t return error.num;\n\t }\n\t\n\t // Truncate places in case it is not an integer\n\t places = Math.floor(places);\n\t\n\t // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n\t return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n\t }\n\t};\n\t\n\texports.DEC2HEX = function(number, places) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t\n\t // Return error if number is not decimal, is lower than -549755813888, or is greater than 549755813887\n\t if (!/^-?[0-9]{1,12}$/.test(number) || number < -549755813888 || number > 549755813887) {\n\t return error.num;\n\t }\n\t\n\t // Ignore places and return a 10-character hexadecimal number if number is negative\n\t if (number < 0) {\n\t return (1099511627776 + number).toString(16);\n\t }\n\t\n\t // Convert decimal number to hexadecimal\n\t var result = parseInt(number, 10).toString(16);\n\t\n\t // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n\t if (typeof places === 'undefined') {\n\t return result;\n\t } else {\n\t // Return error if places is nonnumeric\n\t if (isNaN(places)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if places is negative\n\t if (places < 0) {\n\t return error.num;\n\t }\n\t\n\t // Truncate places in case it is not an integer\n\t places = Math.floor(places);\n\t\n\t // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n\t return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n\t }\n\t};\n\t\n\texports.DEC2OCT = function(number, places) {\n\t number = utils.parseNumber(number);\n\t if (number instanceof Error) {\n\t return number;\n\t }\n\t\n\t // Return error if number is not decimal, is lower than -549755813888, or is greater than 549755813887\n\t if (!/^-?[0-9]{1,9}$/.test(number) || number < -536870912 || number > 536870911) {\n\t return error.num;\n\t }\n\t\n\t // Ignore places and return a 10-character octal number if number is negative\n\t if (number < 0) {\n\t return (1073741824 + number).toString(8);\n\t }\n\t\n\t // Convert decimal number to octal\n\t var result = parseInt(number, 10).toString(8);\n\t\n\t // Return octal number using the minimum number of characters necessary if places is undefined\n\t if (typeof places === 'undefined') {\n\t return result;\n\t } else {\n\t // Return error if places is nonnumeric\n\t if (isNaN(places)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if places is negative\n\t if (places < 0) {\n\t return error.num;\n\t }\n\t\n\t // Truncate places in case it is not an integer\n\t places = Math.floor(places);\n\t\n\t // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n\t return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n\t }\n\t};\n\t\n\texports.DELTA = function(number1, number2) {\n\t // Set number2 to zero if undefined\n\t number2 = (number2 === undefined) ? 0 : number2;\n\t number1 = utils.parseNumber(number1);\n\t number2 = utils.parseNumber(number2);\n\t if (utils.anyIsError(number1, number2)) {\n\t return error.value;\n\t }\n\t\n\t // Return delta\n\t return (number1 === number2) ? 1 : 0;\n\t};\n\t\n\t// TODO: why is upper_bound not used ? The excel documentation has no examples with upper_bound\n\texports.ERF = function(lower_bound, upper_bound) {\n\t // Set number2 to zero if undefined\n\t upper_bound = (upper_bound === undefined) ? 0 : upper_bound;\n\t\n\t lower_bound = utils.parseNumber(lower_bound);\n\t upper_bound = utils.parseNumber(upper_bound);\n\t if (utils.anyIsError(lower_bound, upper_bound)) {\n\t return error.value;\n\t }\n\t\n\t return jStat.erf(lower_bound);\n\t};\n\t\n\t// TODO\n\texports.ERF.PRECISE = function() {\n\t throw new Error('ERF.PRECISE is not implemented');\n\t};\n\t\n\texports.ERFC = function(x) {\n\t // Return error if x is not a number\n\t if (isNaN(x)) {\n\t return error.value;\n\t }\n\t\n\t return jStat.erfc(x);\n\t};\n\t\n\t// TODO\n\texports.ERFC.PRECISE = function() {\n\t throw new Error('ERFC.PRECISE is not implemented');\n\t};\n\t\n\texports.GESTEP = function(number, step) {\n\t step = step || 0;\n\t number = utils.parseNumber(number);\n\t if (utils.anyIsError(step, number)) {\n\t return number;\n\t }\n\t\n\t // Return delta\n\t return (number >= step) ? 1 : 0;\n\t};\n\t\n\texports.HEX2BIN = function(number, places) {\n\t // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n\t if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n\t return error.num;\n\t }\n\t\n\t // Check if number is negative\n\t var negative = (number.length === 10 && number.substring(0, 1).toLowerCase() === 'f') ? true : false;\n\t\n\t // Convert hexadecimal number to decimal\n\t var decimal = (negative) ? parseInt(number, 16) - 1099511627776 : parseInt(number, 16);\n\t\n\t // Return error if number is lower than -512 or greater than 511\n\t if (decimal < -512 || decimal > 511) {\n\t return error.num;\n\t }\n\t\n\t // Ignore places and return a 10-character binary number if number is negative\n\t if (negative) {\n\t return '1' + text.REPT('0', 9 - (512 + decimal).toString(2).length) + (512 + decimal).toString(2);\n\t }\n\t\n\t // Convert decimal number to binary\n\t var result = decimal.toString(2);\n\t\n\t // Return binary number using the minimum number of characters necessary if places is undefined\n\t if (places === undefined) {\n\t return result;\n\t } else {\n\t // Return error if places is nonnumeric\n\t if (isNaN(places)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if places is negative\n\t if (places < 0) {\n\t return error.num;\n\t }\n\t\n\t // Truncate places in case it is not an integer\n\t places = Math.floor(places);\n\t\n\t // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n\t return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n\t }\n\t};\n\t\n\texports.HEX2DEC = function(number) {\n\t // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n\t if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n\t return error.num;\n\t }\n\t\n\t // Convert hexadecimal number to decimal\n\t var decimal = parseInt(number, 16);\n\t\n\t // Return decimal number\n\t return (decimal >= 549755813888) ? decimal - 1099511627776 : decimal;\n\t};\n\t\n\texports.HEX2OCT = function(number, places) {\n\t // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n\t if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n\t return error.num;\n\t }\n\t\n\t // Convert hexadecimal number to decimal\n\t var decimal = parseInt(number, 16);\n\t\n\t // Return error if number is positive and greater than 0x1fffffff (536870911)\n\t if (decimal > 536870911 && decimal < 1098974756864) {\n\t return error.num;\n\t }\n\t\n\t // Ignore places and return a 10-character octal number if number is negative\n\t if (decimal >= 1098974756864) {\n\t return (decimal - 1098437885952).toString(8);\n\t }\n\t\n\t // Convert decimal number to octal\n\t var result = decimal.toString(8);\n\t\n\t // Return octal number using the minimum number of characters necessary if places is undefined\n\t if (places === undefined) {\n\t return result;\n\t } else {\n\t // Return error if places is nonnumeric\n\t if (isNaN(places)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if places is negative\n\t if (places < 0) {\n\t return error.num;\n\t }\n\t\n\t // Truncate places in case it is not an integer\n\t places = Math.floor(places);\n\t\n\t // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n\t return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n\t }\n\t};\n\t\n\texports.IMABS = function(inumber) {\n\t // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t // Return error if either coefficient is not a number\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Return absolute value of complex number\n\t return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));\n\t};\n\t\n\texports.IMAGINARY = function(inumber) {\n\t if (inumber === undefined || inumber === true || inumber === false) {\n\t return error.value;\n\t }\n\t\n\t // Return 0 if inumber is equal to 0\n\t if (inumber === 0 || inumber === '0') {\n\t return 0;\n\t }\n\t\n\t // Handle special cases\n\t if (['i', 'j'].indexOf(inumber) >= 0) {\n\t return 1;\n\t }\n\t\n\t // Normalize imaginary coefficient\n\t inumber = inumber.replace('+i', '+1i').replace('-i', '-1i').replace('+j', '+1j').replace('-j', '-1j');\n\t\n\t // Lookup sign\n\t var plus = inumber.indexOf('+');\n\t var minus = inumber.indexOf('-');\n\t if (plus === 0) {\n\t plus = inumber.indexOf('+', 1);\n\t }\n\t\n\t if (minus === 0) {\n\t minus = inumber.indexOf('-', 1);\n\t }\n\t\n\t // Lookup imaginary unit\n\t var last = inumber.substring(inumber.length - 1, inumber.length);\n\t var unit = (last === 'i' || last === 'j');\n\t\n\t if (plus >= 0 || minus >= 0) {\n\t // Return error if imaginary unit is neither i nor j\n\t if (!unit) {\n\t return error.num;\n\t }\n\t\n\t // Return imaginary coefficient of complex number\n\t if (plus >= 0) {\n\t return (isNaN(inumber.substring(0, plus)) || isNaN(inumber.substring(plus + 1, inumber.length - 1))) ?\n\t error.num :\n\t Number(inumber.substring(plus + 1, inumber.length - 1));\n\t } else {\n\t return (isNaN(inumber.substring(0, minus)) || isNaN(inumber.substring(minus + 1, inumber.length - 1))) ?\n\t error.num :\n\t -Number(inumber.substring(minus + 1, inumber.length - 1));\n\t }\n\t } else {\n\t if (unit) {\n\t return (isNaN(inumber.substring(0, inumber.length - 1))) ? error.num : inumber.substring(0, inumber.length - 1);\n\t } else {\n\t return (isNaN(inumber)) ? error.num : 0;\n\t }\n\t }\n\t};\n\t\n\texports.IMARGUMENT = function(inumber) {\n\t // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t // Return error if either coefficient is not a number\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if inumber is equal to zero\n\t if (x === 0 && y === 0) {\n\t return error.div0;\n\t }\n\t\n\t // Return PI/2 if x is equal to zero and y is positive\n\t if (x === 0 && y > 0) {\n\t return Math.PI / 2;\n\t }\n\t\n\t // Return -PI/2 if x is equal to zero and y is negative\n\t if (x === 0 && y < 0) {\n\t return -Math.PI / 2;\n\t }\n\t\n\t // Return zero if x is negative and y is equal to zero\n\t if (y === 0 && x > 0) {\n\t return 0;\n\t }\n\t\n\t // Return zero if x is negative and y is equal to zero\n\t if (y === 0 && x < 0) {\n\t return -Math.PI;\n\t }\n\t\n\t // Return argument of complex number\n\t if (x > 0) {\n\t return Math.atan(y / x);\n\t } else if (x < 0 && y >= 0) {\n\t return Math.atan(y / x) + Math.PI;\n\t } else {\n\t return Math.atan(y / x) - Math.PI;\n\t }\n\t};\n\t\n\texports.IMCONJUGATE = function(inumber) {\n\t // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Return conjugate of complex number\n\t return (y !== 0) ? exports.COMPLEX(x, -y, unit) : inumber;\n\t};\n\t\n\texports.IMCOS = function(inumber) {\n\t // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Return cosine of complex number\n\t return exports.COMPLEX(Math.cos(x) * (Math.exp(y) + Math.exp(-y)) / 2, -Math.sin(x) * (Math.exp(y) - Math.exp(-y)) / 2, unit);\n\t};\n\t\n\texports.IMCOSH = function(inumber) {\n\t // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Return hyperbolic cosine of complex number\n\t return exports.COMPLEX(Math.cos(y) * (Math.exp(x) + Math.exp(-x)) / 2, Math.sin(y) * (Math.exp(x) - Math.exp(-x)) / 2, unit);\n\t};\n\t\n\texports.IMCOT = function(inumber) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Return cotangent of complex number\n\t return exports.IMDIV(exports.IMCOS(inumber), exports.IMSIN(inumber));\n\t};\n\t\n\texports.IMDIV = function(inumber1, inumber2) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var a = exports.IMREAL(inumber1);\n\t var b = exports.IMAGINARY(inumber1);\n\t var c = exports.IMREAL(inumber2);\n\t var d = exports.IMAGINARY(inumber2);\n\t\n\t if (utils.anyIsError(a, b, c, d)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit1 = inumber1.substring(inumber1.length - 1);\n\t var unit2 = inumber2.substring(inumber2.length - 1);\n\t var unit = 'i';\n\t if (unit1 === 'j') {\n\t unit = 'j';\n\t } else if (unit2 === 'j') {\n\t unit = 'j';\n\t }\n\t\n\t // Return error if inumber2 is null\n\t if (c === 0 && d === 0) {\n\t return error.num;\n\t }\n\t\n\t // Return exponential of complex number\n\t var den = c * c + d * d;\n\t return exports.COMPLEX((a * c + b * d) / den, (b * c - a * d) / den, unit);\n\t};\n\t\n\texports.IMEXP = function(inumber) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Return exponential of complex number\n\t var e = Math.exp(x);\n\t return exports.COMPLEX(e * Math.cos(y), e * Math.sin(y), unit);\n\t};\n\t\n\texports.IMLN = function(inumber) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Return exponential of complex number\n\t return exports.COMPLEX(Math.log(Math.sqrt(x * x + y * y)), Math.atan(y / x), unit);\n\t};\n\t\n\texports.IMLOG10 = function(inumber) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Return exponential of complex number\n\t return exports.COMPLEX(Math.log(Math.sqrt(x * x + y * y)) / Math.log(10), Math.atan(y / x) / Math.log(10), unit);\n\t};\n\t\n\texports.IMLOG2 = function(inumber) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Return exponential of complex number\n\t return exports.COMPLEX(Math.log(Math.sqrt(x * x + y * y)) / Math.log(2), Math.atan(y / x) / Math.log(2), unit);\n\t};\n\t\n\texports.IMPOWER = function(inumber, number) {\n\t number = utils.parseNumber(number);\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t if (utils.anyIsError(number, x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Calculate power of modulus\n\t var p = Math.pow(exports.IMABS(inumber), number);\n\t\n\t // Calculate argument\n\t var t = exports.IMARGUMENT(inumber);\n\t\n\t // Return exponential of complex number\n\t return exports.COMPLEX(p * Math.cos(number * t), p * Math.sin(number * t), unit);\n\t};\n\t\n\texports.IMPRODUCT = function() {\n\t // Initialize result\n\t var result = arguments[0];\n\t\n\t if (!arguments.length) {\n\t return error.value;\n\t }\n\t\n\t // Loop on all numbers\n\t for (var i = 1; i < arguments.length; i++) {\n\t // Lookup coefficients of two complex numbers\n\t var a = exports.IMREAL(result);\n\t var b = exports.IMAGINARY(result);\n\t var c = exports.IMREAL(arguments[i]);\n\t var d = exports.IMAGINARY(arguments[i]);\n\t\n\t if (utils.anyIsError(a, b, c, d)) {\n\t return error.value;\n\t }\n\t\n\t // Complute product of two complex numbers\n\t result = exports.COMPLEX(a * c - b * d, a * d + b * c);\n\t }\n\t\n\t // Return product of complex numbers\n\t return result;\n\t};\n\t\n\texports.IMREAL = function(inumber) {\n\t if (inumber === undefined || inumber === true || inumber === false) {\n\t return error.value;\n\t }\n\t\n\t // Return 0 if inumber is equal to 0\n\t if (inumber === 0 || inumber === '0') {\n\t return 0;\n\t }\n\t\n\t // Handle special cases\n\t if (['i', '+i', '1i', '+1i', '-i', '-1i', 'j', '+j', '1j', '+1j', '-j', '-1j'].indexOf(inumber) >= 0) {\n\t return 0;\n\t }\n\t\n\t // Lookup sign\n\t var plus = inumber.indexOf('+');\n\t var minus = inumber.indexOf('-');\n\t if (plus === 0) {\n\t plus = inumber.indexOf('+', 1);\n\t }\n\t if (minus === 0) {\n\t minus = inumber.indexOf('-', 1);\n\t }\n\t\n\t // Lookup imaginary unit\n\t var last = inumber.substring(inumber.length - 1, inumber.length);\n\t var unit = (last === 'i' || last === 'j');\n\t\n\t if (plus >= 0 || minus >= 0) {\n\t // Return error if imaginary unit is neither i nor j\n\t if (!unit) {\n\t return error.num;\n\t }\n\t\n\t // Return real coefficient of complex number\n\t if (plus >= 0) {\n\t return (isNaN(inumber.substring(0, plus)) || isNaN(inumber.substring(plus + 1, inumber.length - 1))) ?\n\t error.num :\n\t Number(inumber.substring(0, plus));\n\t } else {\n\t return (isNaN(inumber.substring(0, minus)) || isNaN(inumber.substring(minus + 1, inumber.length - 1))) ?\n\t error.num :\n\t Number(inumber.substring(0, minus));\n\t }\n\t } else {\n\t if (unit) {\n\t return (isNaN(inumber.substring(0, inumber.length - 1))) ? error.num : 0;\n\t } else {\n\t return (isNaN(inumber)) ? error.num : inumber;\n\t }\n\t }\n\t};\n\t\n\texports.IMSEC = function(inumber) {\n\t // Return error if inumber is a logical value\n\t if (inumber === true || inumber === false) {\n\t return error.value;\n\t }\n\t\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Return secant of complex number\n\t return exports.IMDIV('1', exports.IMCOS(inumber));\n\t};\n\t\n\texports.IMSECH = function(inumber) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Return hyperbolic secant of complex number\n\t return exports.IMDIV('1', exports.IMCOSH(inumber));\n\t};\n\t\n\texports.IMSIN = function(inumber) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Return sine of complex number\n\t return exports.COMPLEX(Math.sin(x) * (Math.exp(y) + Math.exp(-y)) / 2, Math.cos(x) * (Math.exp(y) - Math.exp(-y)) / 2, unit);\n\t};\n\t\n\texports.IMSINH = function(inumber) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Return hyperbolic sine of complex number\n\t return exports.COMPLEX(Math.cos(y) * (Math.exp(x) - Math.exp(-x)) / 2, Math.sin(y) * (Math.exp(x) + Math.exp(-x)) / 2, unit);\n\t};\n\t\n\texports.IMSQRT = function(inumber) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit = inumber.substring(inumber.length - 1);\n\t unit = (unit === 'i' || unit === 'j') ? unit : 'i';\n\t\n\t // Calculate power of modulus\n\t var s = Math.sqrt(exports.IMABS(inumber));\n\t\n\t // Calculate argument\n\t var t = exports.IMARGUMENT(inumber);\n\t\n\t // Return exponential of complex number\n\t return exports.COMPLEX(s * Math.cos(t / 2), s * Math.sin(t / 2), unit);\n\t};\n\t\n\texports.IMCSC = function (inumber) {\n\t // Return error if inumber is a logical value\n\t if (inumber === true || inumber === false) {\n\t return error.value;\n\t }\n\t\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t // Return error if either coefficient is not a number\n\t if (utils.anyIsError(x, y)) {\n\t return error.num;\n\t }\n\t\n\t // Return cosecant of complex number\n\t return exports.IMDIV('1', exports.IMSIN(inumber));\n\t};\n\t\n\texports.IMCSCH = function (inumber) {\n\t // Return error if inumber is a logical value\n\t if (inumber === true || inumber === false) {\n\t return error.value;\n\t }\n\t\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t // Return error if either coefficient is not a number\n\t if (utils.anyIsError(x, y)) {\n\t return error.num;\n\t }\n\t\n\t // Return hyperbolic cosecant of complex number\n\t return exports.IMDIV('1', exports.IMSINH(inumber));\n\t};\n\t\n\texports.IMSUB = function(inumber1, inumber2) {\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var a = this.IMREAL(inumber1);\n\t var b = this.IMAGINARY(inumber1);\n\t var c = this.IMREAL(inumber2);\n\t var d = this.IMAGINARY(inumber2);\n\t\n\t if (utils.anyIsError(a, b, c, d)) {\n\t return error.value;\n\t }\n\t\n\t // Lookup imaginary unit\n\t var unit1 = inumber1.substring(inumber1.length - 1);\n\t var unit2 = inumber2.substring(inumber2.length - 1);\n\t var unit = 'i';\n\t if (unit1 === 'j') {\n\t unit = 'j';\n\t } else if (unit2 === 'j') {\n\t unit = 'j';\n\t }\n\t\n\t // Return _ of two complex numbers\n\t return this.COMPLEX(a - c, b - d, unit);\n\t};\n\t\n\texports.IMSUM = function() {\n\t if (!arguments.length) {\n\t return error.value;\n\t }\n\t var args = utils.flatten(arguments);\n\t\n\t // Initialize result\n\t var result = args[0];\n\t\n\t // Loop on all numbers\n\t for (var i = 1; i < args.length; i++) {\n\t // Lookup coefficients of two complex numbers\n\t var a = this.IMREAL(result);\n\t var b = this.IMAGINARY(result);\n\t var c = this.IMREAL(args[i]);\n\t var d = this.IMAGINARY(args[i]);\n\t\n\t if (utils.anyIsError(a, b, c, d)) {\n\t return error.value;\n\t }\n\t\n\t // Complute product of two complex numbers\n\t result = this.COMPLEX(a + c, b + d);\n\t }\n\t\n\t // Return sum of complex numbers\n\t return result;\n\t};\n\t\n\texports.IMTAN = function(inumber) {\n\t // Return error if inumber is a logical value\n\t if (inumber === true || inumber === false) {\n\t return error.value;\n\t }\n\t\n\t // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n\t var x = exports.IMREAL(inumber);\n\t var y = exports.IMAGINARY(inumber);\n\t\n\t if (utils.anyIsError(x, y)) {\n\t return error.value;\n\t }\n\t\n\t // Return tangent of complex number\n\t return this.IMDIV(this.IMSIN(inumber), this.IMCOS(inumber));\n\t};\n\t\n\texports.OCT2BIN = function(number, places) {\n\t // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n\t if (!/^[0-7]{1,10}$/.test(number)) {\n\t return error.num;\n\t }\n\t\n\t // Check if number is negative\n\t var negative = (number.length === 10 && number.substring(0, 1) === '7') ? true : false;\n\t\n\t // Convert octal number to decimal\n\t var decimal = (negative) ? parseInt(number, 8) - 1073741824 : parseInt(number, 8);\n\t\n\t // Return error if number is lower than -512 or greater than 511\n\t if (decimal < -512 || decimal > 511) {\n\t return error.num;\n\t }\n\t\n\t // Ignore places and return a 10-character binary number if number is negative\n\t if (negative) {\n\t return '1' + text.REPT('0', 9 - (512 + decimal).toString(2).length) + (512 + decimal).toString(2);\n\t }\n\t\n\t // Convert decimal number to binary\n\t var result = decimal.toString(2);\n\t\n\t // Return binary number using the minimum number of characters necessary if places is undefined\n\t if (typeof places === 'undefined') {\n\t return result;\n\t } else {\n\t // Return error if places is nonnumeric\n\t if (isNaN(places)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if places is negative\n\t if (places < 0) {\n\t return error.num;\n\t }\n\t\n\t // Truncate places in case it is not an integer\n\t places = Math.floor(places);\n\t\n\t // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n\t return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n\t }\n\t};\n\t\n\texports.OCT2DEC = function(number) {\n\t // Return error if number is not octal or contains more than ten characters (10 digits)\n\t if (!/^[0-7]{1,10}$/.test(number)) {\n\t return error.num;\n\t }\n\t\n\t // Convert octal number to decimal\n\t var decimal = parseInt(number, 8);\n\t\n\t // Return decimal number\n\t return (decimal >= 536870912) ? decimal - 1073741824 : decimal;\n\t};\n\t\n\texports.OCT2HEX = function(number, places) {\n\t // Return error if number is not octal or contains more than ten characters (10 digits)\n\t if (!/^[0-7]{1,10}$/.test(number)) {\n\t return error.num;\n\t }\n\t\n\t // Convert octal number to decimal\n\t var decimal = parseInt(number, 8);\n\t\n\t // Ignore places and return a 10-character octal number if number is negative\n\t if (decimal >= 536870912) {\n\t return 'ff' + (decimal + 3221225472).toString(16);\n\t }\n\t\n\t // Convert decimal number to hexadecimal\n\t var result = decimal.toString(16);\n\t\n\t // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n\t if (places === undefined) {\n\t return result;\n\t } else {\n\t // Return error if places is nonnumeric\n\t if (isNaN(places)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if places is negative\n\t if (places < 0) {\n\t return error.num;\n\t }\n\t\n\t // Truncate places in case it is not an integer\n\t places = Math.floor(places);\n\t\n\t // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n\t return (places >= result.length) ? text.REPT('0', places - result.length) + result : error.num;\n\t }\n\t};\n\n\n/***/ },\n/* 26 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar M = Math;\n\tfunction _horner(arr, v) { return arr.reduce(function(z,w){return v * z + w;},0); };\n\tfunction _bessel_iter(x, n, f0, f1, sign) {\n\t if(!sign) sign = -1;\n\t var tdx = 2 / x, f2;\n\t if(n === 0) return f0;\n\t if(n === 1) return f1;\n\t for(var o = 1; o != n; ++o) {\n\t f2 = f1 * o * tdx + sign * f0;\n\t f0 = f1; f1 = f2;\n\t }\n\t return f1;\n\t}\n\tfunction _bessel_wrap(bessel0, bessel1, name, nonzero, sign) {\n\t return function bessel(x,n) {\n\t if(n === 0) return bessel0(x);\n\t if(n === 1) return bessel1(x);\n\t if(n < 0) throw name + ': Order (' + n + ') must be nonnegative';\n\t if(nonzero == 1 && x === 0) throw name + ': Undefined when x == 0';\n\t if(nonzero == 2 && x <= 0) throw name + ': Undefined when x <= 0';\n\t var b0 = bessel0(x), b1 = bessel1(x);\n\t return _bessel_iter(x, n, b0, b1, sign);\n\t };\n\t}\n\tvar besselj = (function() {\n\t var b0_a1a = [57568490574.0,-13362590354.0,651619640.7,-11214424.18,77392.33017,-184.9052456].reverse();\n\t var b0_a2a = [57568490411.0,1029532985.0,9494680.718,59272.64853,267.8532712,1.0].reverse();\n\t var b0_a1b = [1.0, -0.1098628627e-2, 0.2734510407e-4, -0.2073370639e-5, 0.2093887211e-6].reverse();\n\t var b0_a2b = [-0.1562499995e-1, 0.1430488765e-3, -0.6911147651e-5, 0.7621095161e-6, -0.934935152e-7].reverse();\n\t var W = 0.636619772; // 2 / Math.PI\n\t\n\t function bessel0(x) {\n\t var a, a1, a2, y = x * x, xx = M.abs(x) - 0.785398164;\n\t if(M.abs(x) < 8) {\n\t a1 = _horner(b0_a1a, y);\n\t a2 = _horner(b0_a2a, y);\n\t a = a1/a2;\n\t }\n\t else {\n\t y = 64 / y;\n\t a1 = _horner(b0_a1b, y);\n\t a2 = _horner(b0_a2b, y);\n\t a = M.sqrt(W/M.abs(x))*(M.cos(xx)*a1-M.sin(xx)*a2*8/M.abs(x));\n\t }\n\t return a;\n\t }\n\t var b1_a1a = [72362614232.0,-7895059235.0,242396853.1,-2972611.439, 15704.48260, -30.16036606].reverse();\n\t var b1_a2a = [144725228442.0, 2300535178.0, 18583304.74, 99447.43394, 376.9991397, 1.0].reverse();\n\t var b1_a1b = [1.0, 0.183105e-2, -0.3516396496e-4, 0.2457520174e-5, -0.240337019e-6].reverse();\n\t var b1_a2b = [0.04687499995, -0.2002690873e-3, 0.8449199096e-5, -0.88228987e-6, 0.105787412e-6].reverse();\n\t function bessel1(x) {\n\t var a, a1, a2, y = x*x, xx = M.abs(x) - 2.356194491;\n\t if(Math.abs(x)< 8) {\n\t a1 = x*_horner(b1_a1a, y);\n\t a2 = _horner(b1_a2a, y);\n\t a = a1 / a2;\n\t } else {\n\t y = 64 / y;\n\t a1=_horner(b1_a1b, y);\n\t a2=_horner(b1_a2b, y);\n\t a=M.sqrt(W/M.abs(x))*(M.cos(xx)*a1-M.sin(xx)*a2*8/M.abs(x));\n\t if(x < 0) a = -a;\n\t }\n\t return a;\n\t }\n\t return function besselj(x, n) {\n\t n = Math.round(n);\n\t if(n === 0) return bessel0(M.abs(x));\n\t if(n === 1) return bessel1(M.abs(x));\n\t if(n < 0) throw 'BESSELJ: Order (' + n + ') must be nonnegative';\n\t if(M.abs(x) === 0) return 0;\n\t\n\t var ret, j, tox = 2 / M.abs(x), m, jsum, sum, bjp, bj, bjm;\n\t if(M.abs(x) > n) {\n\t ret = _bessel_iter(x, n, bessel0(M.abs(x)), bessel1(M.abs(x)),-1);\n\t } else {\n\t m=2*M.floor((n+M.floor(M.sqrt(40*n)))/2);\n\t jsum=0;\n\t bjp=ret=sum=0.0;\n\t bj=1.0;\n\t for (j=m;j>0;j--) {\n\t bjm=j*tox*bj-bjp;\n\t bjp=bj;\n\t bj=bjm;\n\t if (M.abs(bj) > 1E10) {\n\t bj *= 1E-10;\n\t bjp *= 1E-10;\n\t ret *= 1E-10;\n\t sum *= 1E-10;\n\t }\n\t if (jsum) sum += bj;\n\t jsum=!jsum;\n\t if (j == n) ret=bjp;\n\t }\n\t sum=2.0*sum-bj;\n\t ret /= sum;\n\t }\n\t return x < 0 && (n%2) ? -ret : ret;\n\t };\n\t})();\n\tvar bessely = (function() {\n\t var b0_a1a = [-2957821389.0, 7062834065.0, -512359803.6, 10879881.29, -86327.92757, 228.4622733].reverse();\n\t var b0_a2a = [40076544269.0, 745249964.8, 7189466.438, 47447.26470, 226.1030244, 1.0].reverse();\n\t var b0_a1b = [1.0, -0.1098628627e-2, 0.2734510407e-4, -0.2073370639e-5, 0.2093887211e-6].reverse();\n\t var b0_a2b = [-0.1562499995e-1, 0.1430488765e-3, -0.6911147651e-5, 0.7621095161e-6, -0.934945152e-7].reverse();\n\t\n\t var W = 0.636619772;\n\t function bessel0(x) {\n\t var a, a1, a2, y = x * x, xx = x - 0.785398164;\n\t if(x < 8) {\n\t a1 = _horner(b0_a1a, y);\n\t a2 = _horner(b0_a2a, y);\n\t a = a1/a2 + W * besselj(x,0) * M.log(x);\n\t } else {\n\t y = 64 / y;\n\t a1 = _horner(b0_a1b, y);\n\t a2 = _horner(b0_a2b, y);\n\t a = M.sqrt(W/x)*(M.sin(xx)*a1+M.cos(xx)*a2*8/x);\n\t }\n\t return a;\n\t }\n\t\n\t var b1_a1a = [-0.4900604943e13, 0.1275274390e13, -0.5153438139e11, 0.7349264551e9, -0.4237922726e7, 0.8511937935e4].reverse();\n\t var b1_a2a = [0.2499580570e14, 0.4244419664e12, 0.3733650367e10, 0.2245904002e8, 0.1020426050e6, 0.3549632885e3, 1].reverse();\n\t var b1_a1b = [1.0, 0.183105e-2, -0.3516396496e-4, 0.2457520174e-5, -0.240337019e-6].reverse();\n\t var b1_a2b = [0.04687499995, -0.2002690873e-3, 0.8449199096e-5, -0.88228987e-6, 0.105787412e-6].reverse();\n\t function bessel1(x) {\n\t var a, a1, a2, y = x*x, xx = x - 2.356194491;\n\t if(x < 8) {\n\t a1 = x*_horner(b1_a1a, y);\n\t a2 = _horner(b1_a2a, y);\n\t a = a1/a2 + W * (besselj(x,1) * M.log(x) - 1 / x);\n\t } else {\n\t y = 64 / y;\n\t a1=_horner(b1_a1b, y);\n\t a2=_horner(b1_a2b, y);\n\t a=M.sqrt(W/x)*(M.sin(xx)*a1+M.cos(xx)*a2*8/x);\n\t }\n\t return a;\n\t }\n\t\n\t return _bessel_wrap(bessel0, bessel1, 'BESSELY', 1, -1);\n\t})();\n\tvar besseli = (function() {\n\t var b0_a = [1.0, 3.5156229, 3.0899424, 1.2067492, 0.2659732, 0.360768e-1, 0.45813e-2].reverse();\n\t var b0_b = [0.39894228, 0.1328592e-1, 0.225319e-2, -0.157565e-2, 0.916281e-2, -0.2057706e-1, 0.2635537e-1, -0.1647633e-1, 0.392377e-2].reverse();\n\t function bessel0(x) {\n\t if(x <= 3.75) return _horner(b0_a, x*x/(3.75*3.75));\n\t return M.exp(M.abs(x))/M.sqrt(M.abs(x))*_horner(b0_b, 3.75/M.abs(x));\n\t }\n\t\n\t var b1_a = [0.5, 0.87890594, 0.51498869, 0.15084934, 0.2658733e-1, 0.301532e-2, 0.32411e-3].reverse();\n\t var b1_b = [0.39894228, -0.3988024e-1, -0.362018e-2, 0.163801e-2, -0.1031555e-1, 0.2282967e-1, -0.2895312e-1, 0.1787654e-1, -0.420059e-2].reverse();\n\t function bessel1(x) {\n\t if(x < 3.75) return x * _horner(b1_a, x*x/(3.75*3.75));\n\t return (x < 0 ? -1 : 1) * M.exp(M.abs(x))/M.sqrt(M.abs(x))*_horner(b1_b, 3.75/M.abs(x));\n\t }\n\t\n\t return function besseli(x, n) {\n\t n = Math.round(n);\n\t if(n === 0) return bessel0(x);\n\t if(n == 1) return bessel1(x);\n\t if(n < 0) throw 'BESSELI Order (' + n + ') must be nonnegative';\n\t if(M.abs(x) === 0) return 0;\n\t\n\t var ret, j, tox = 2 / M.abs(x), m, bip, bi, bim;\n\t m=2*M.round((n+M.round(M.sqrt(40*n)))/2);\n\t bip=ret=0.0;\n\t bi=1.0;\n\t for (j=m;j>0;j--) {\n\t bim=j*tox*bi + bip;\n\t bip=bi; bi=bim;\n\t if (M.abs(bi) > 1E10) {\n\t bi *= 1E-10;\n\t bip *= 1E-10;\n\t ret *= 1E-10;\n\t }\n\t if(j == n) ret = bip;\n\t }\n\t ret *= besseli(x, 0) / bi;\n\t return x < 0 && (n%2) ? -ret : ret;\n\t };\n\t\n\t})();\n\t\n\tvar besselk = (function() {\n\t var b0_a = [-0.57721566, 0.42278420, 0.23069756, 0.3488590e-1, 0.262698e-2, 0.10750e-3, 0.74e-5].reverse();\n\t var b0_b = [1.25331414, -0.7832358e-1, 0.2189568e-1, -0.1062446e-1, 0.587872e-2, -0.251540e-2, 0.53208e-3].reverse();\n\t function bessel0(x) {\n\t if(x <= 2) return -M.log(x/2)*besseli(x,0) + _horner(b0_a, x*x/4);\n\t return M.exp(-x)/M.sqrt(x)*_horner(b0_b, 2/x);\n\t }\n\t\n\t var b1_a = [1.0, 0.15443144, -0.67278579, -0.18156897, -0.1919402e-1, -0.110404e-2, -0.4686e-4].reverse();\n\t var b1_b = [1.25331414, 0.23498619, -0.3655620e-1, 0.1504268e-1, -0.780353e-2, 0.325614e-2, -0.68245e-3].reverse();\n\t function bessel1(x) {\n\t if(x <= 2) return M.log(x/2)*besseli(x,1) + (1/x)*_horner(b1_a, x*x/4);\n\t return M.exp(-x)/M.sqrt(x)*_horner(b1_b, 2/x);\n\t }\n\t\n\t return _bessel_wrap(bessel0, bessel1, 'BESSELK', 2, 1);\n\t})();\n\tif(true) {\n\t exports.besselj = besselj;\n\t exports.bessely = bessely;\n\t exports.besseli = besseli;\n\t exports.besselk = besselk;\n\t}\n\t\n\n\n/***/ },\n/* 27 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar error = __webpack_require__(16);\n\tvar utils = __webpack_require__(15);\n\t\n\tvar d1900 = new Date(1900, 0, 1);\n\tvar WEEK_STARTS = [\n\t undefined,\n\t 0,\n\t 1,\n\t undefined,\n\t undefined,\n\t undefined,\n\t undefined,\n\t undefined,\n\t undefined,\n\t undefined,\n\t undefined,\n\t undefined,\n\t 1,\n\t 2,\n\t 3,\n\t 4,\n\t 5,\n\t 6,\n\t 0\n\t];\n\tvar WEEK_TYPES = [\n\t [],\n\t [1, 2, 3, 4, 5, 6, 7],\n\t [7, 1, 2, 3, 4, 5, 6],\n\t [6, 0, 1, 2, 3, 4, 5],\n\t [],\n\t [],\n\t [],\n\t [],\n\t [],\n\t [],\n\t [],\n\t [7, 1, 2, 3, 4, 5, 6],\n\t [6, 7, 1, 2, 3, 4, 5],\n\t [5, 6, 7, 1, 2, 3, 4],\n\t [4, 5, 6, 7, 1, 2, 3],\n\t [3, 4, 5, 6, 7, 1, 2],\n\t [2, 3, 4, 5, 6, 7, 1],\n\t [1, 2, 3, 4, 5, 6, 7]\n\t];\n\tvar WEEKEND_TYPES = [\n\t [],\n\t [6, 0],\n\t [0, 1],\n\t [1, 2],\n\t [2, 3],\n\t [3, 4],\n\t [4, 5],\n\t [5, 6],\n\t undefined,\n\t undefined,\n\t undefined, [0, 0],\n\t [1, 1],\n\t [2, 2],\n\t [3, 3],\n\t [4, 4],\n\t [5, 5],\n\t [6, 6]\n\t];\n\t\n\texports.DATE = function(year, month, day) {\n\t var result;\n\t\n\t year = utils.parseNumber(year);\n\t month = utils.parseNumber(month);\n\t day = utils.parseNumber(day);\n\t\n\t if (utils.anyIsError(year, month, day)) {\n\t result = error.value;\n\t\n\t } else if (year < 0 || month < 0 || day < 0) {\n\t result = error.num;\n\t\n\t } else {\n\t result = new Date(year, month - 1, day);\n\t }\n\t\n\t return result;\n\t};\n\t\n\texports.DATEVALUE = function(date_text) {\n\t if (typeof date_text !== 'string') {\n\t return error.value;\n\t }\n\t var date = Date.parse(date_text);\n\t\n\t if (isNaN(date)) {\n\t return error.value;\n\t }\n\t if (date <= -2203891200000) {\n\t return (date - d1900) / 86400000 + 1;\n\t }\n\t\n\t return (date - d1900) / 86400000 + 2;\n\t};\n\t\n\texports.DAY = function(serial_number) {\n\t var date = utils.parseDate(serial_number);\n\t if (date instanceof Error) {\n\t return date;\n\t }\n\t\n\t return date.getDate();\n\t};\n\t\n\texports.DAYS = function(end_date, start_date) {\n\t end_date = utils.parseDate(end_date);\n\t start_date = utils.parseDate(start_date);\n\t\n\t if (end_date instanceof Error) {\n\t return end_date;\n\t }\n\t if (start_date instanceof Error) {\n\t return start_date;\n\t }\n\t\n\t return serial(end_date) - serial(start_date);\n\t};\n\t\n\texports.DAYS360 = function(start_date, end_date, method) {\n\t method = utils.parseBool(method);\n\t start_date = utils.parseDate(start_date);\n\t end_date = utils.parseDate(end_date);\n\t\n\t if (start_date instanceof Error) {\n\t return start_date;\n\t }\n\t if (end_date instanceof Error) {\n\t return end_date;\n\t }\n\t if (method instanceof Error) {\n\t return method;\n\t }\n\t var sm = start_date.getMonth();\n\t var em = end_date.getMonth();\n\t var sd, ed;\n\t\n\t if (method) {\n\t sd = start_date.getDate() === 31 ? 30 : start_date.getDate();\n\t ed = end_date.getDate() === 31 ? 30 : end_date.getDate();\n\t } else {\n\t var smd = new Date(start_date.getFullYear(), sm + 1, 0).getDate();\n\t var emd = new Date(end_date.getFullYear(), em + 1, 0).getDate();\n\t sd = start_date.getDate() === smd ? 30 : start_date.getDate();\n\t if (end_date.getDate() === emd) {\n\t if (sd < 30) {\n\t em++;\n\t ed = 1;\n\t } else {\n\t ed = 30;\n\t }\n\t } else {\n\t ed = end_date.getDate();\n\t }\n\t }\n\t\n\t return 360 * (end_date.getFullYear() - start_date.getFullYear()) +\n\t 30 * (em - sm) + (ed - sd);\n\t};\n\t\n\texports.EDATE = function(start_date, months) {\n\t start_date = utils.parseDate(start_date);\n\t\n\t if (start_date instanceof Error) {\n\t return start_date;\n\t }\n\t if (isNaN(months)) {\n\t return error.value;\n\t }\n\t months = parseInt(months, 10);\n\t start_date.setMonth(start_date.getMonth() + months);\n\t\n\t return serial(start_date);\n\t};\n\t\n\texports.EOMONTH = function(start_date, months) {\n\t start_date = utils.parseDate(start_date);\n\t\n\t if (start_date instanceof Error) {\n\t return start_date;\n\t }\n\t if (isNaN(months)) {\n\t return error.value;\n\t }\n\t months = parseInt(months, 10);\n\t\n\t return serial(new Date(start_date.getFullYear(), start_date.getMonth() + months + 1, 0));\n\t};\n\t\n\texports.HOUR = function(serial_number) {\n\t serial_number = utils.parseDate(serial_number);\n\t\n\t if (serial_number instanceof Error) {\n\t return serial_number;\n\t }\n\t\n\t return serial_number.getHours();\n\t};\n\t\n\texports.INTERVAL = function (second) {\n\t if (typeof second !== 'number' && typeof second !== 'string') {\n\t return error.value;\n\t } else {\n\t second = parseInt(second, 10);\n\t }\n\t\n\t var year = Math.floor(second/946080000);\n\t second = second%946080000;\n\t var month = Math.floor(second/2592000);\n\t second = second%2592000;\n\t var day = Math.floor(second/86400);\n\t second = second%86400;\n\t\n\t var hour = Math.floor(second/3600);\n\t second = second%3600;\n\t var min = Math.floor(second/60);\n\t second = second%60;\n\t var sec = second;\n\t\n\t year = (year > 0) ? year + 'Y' : '';\n\t month = (month > 0) ? month + 'M' : '';\n\t day = (day > 0) ? day + 'D' : '';\n\t hour = (hour > 0) ? hour + 'H' : '';\n\t min = (min > 0) ? min + 'M' : '';\n\t sec = (sec > 0) ? sec + 'S' : '';\n\t\n\t return 'P' + year + month + day + 'T' + hour + min + sec;\n\t};\n\t\n\texports.ISOWEEKNUM = function(date) {\n\t date = utils.parseDate(date);\n\t\n\t if (date instanceof Error) {\n\t return date;\n\t }\n\t\n\t date.setHours(0, 0, 0);\n\t date.setDate(date.getDate() + 4 - (date.getDay() || 7));\n\t var yearStart = new Date(date.getFullYear(), 0, 1);\n\t\n\t return Math.ceil((((date - yearStart) / 86400000) + 1) / 7);\n\t};\n\t\n\texports.MINUTE = function(serial_number) {\n\t serial_number = utils.parseDate(serial_number);\n\t\n\t if (serial_number instanceof Error) {\n\t return serial_number;\n\t }\n\t\n\t return serial_number.getMinutes();\n\t};\n\t\n\texports.MONTH = function(serial_number) {\n\t serial_number = utils.parseDate(serial_number);\n\t\n\t if (serial_number instanceof Error) {\n\t return serial_number;\n\t }\n\t\n\t return serial_number.getMonth() + 1;\n\t};\n\t\n\texports.NETWORKDAYS = function(start_date, end_date, holidays) {\n\t return this.NETWORKDAYS.INTL(start_date, end_date, 1, holidays);\n\t};\n\t\n\texports.NETWORKDAYS.INTL = function(start_date, end_date, weekend, holidays) {\n\t start_date = utils.parseDate(start_date);\n\t\n\t if (start_date instanceof Error) {\n\t return start_date;\n\t }\n\t end_date = utils.parseDate(end_date);\n\t\n\t if (end_date instanceof Error) {\n\t return end_date;\n\t }\n\t if (weekend === undefined) {\n\t weekend = WEEKEND_TYPES[1];\n\t } else {\n\t weekend = WEEKEND_TYPES[weekend];\n\t }\n\t if (!(weekend instanceof Array)) {\n\t return error.value;\n\t }\n\t if (holidays === undefined) {\n\t holidays = [];\n\t } else if (!(holidays instanceof Array)) {\n\t holidays = [holidays];\n\t }\n\t\n\t for (var i = 0; i < holidays.length; i++) {\n\t var h = utils.parseDate(holidays[i]);\n\t if (h instanceof Error) {\n\t return h;\n\t }\n\t holidays[i] = h;\n\t }\n\t var days = (end_date - start_date) / (1000 * 60 * 60 * 24) + 1;\n\t var total = days;\n\t var day = start_date;\n\t for (i = 0; i < days; i++) {\n\t var d = (new Date().getTimezoneOffset() > 0) ? day.getUTCDay() : day.getDay();\n\t var dec = false;\n\t if (d === weekend[0] || d === weekend[1]) {\n\t dec = true;\n\t }\n\t for (var j = 0; j < holidays.length; j++) {\n\t var holiday = holidays[j];\n\t if (holiday.getDate() === day.getDate() &&\n\t holiday.getMonth() === day.getMonth() &&\n\t holiday.getFullYear() === day.getFullYear()) {\n\t dec = true;\n\t break;\n\t }\n\t }\n\t if (dec) {\n\t total--;\n\t }\n\t day.setDate(day.getDate() + 1);\n\t }\n\t\n\t return total;\n\t};\n\t\n\texports.NOW = function() {\n\t return new Date();\n\t};\n\t\n\texports.SECOND = function(serial_number) {\n\t serial_number = utils.parseDate(serial_number);\n\t if (serial_number instanceof Error) {\n\t return serial_number;\n\t }\n\t\n\t return serial_number.getSeconds();\n\t};\n\t\n\texports.TIME = function(hour, minute, second) {\n\t hour = utils.parseNumber(hour);\n\t minute = utils.parseNumber(minute);\n\t second = utils.parseNumber(second);\n\t if (utils.anyIsError(hour, minute, second)) {\n\t return error.value;\n\t }\n\t if (hour < 0 || minute < 0 || second < 0) {\n\t return error.num;\n\t }\n\t\n\t return (3600 * hour + 60 * minute + second) / 86400;\n\t};\n\t\n\texports.TIMEVALUE = function(time_text) {\n\t time_text = utils.parseDate(time_text);\n\t\n\t if (time_text instanceof Error) {\n\t return time_text;\n\t }\n\t\n\t return (3600 * time_text.getHours() + 60 * time_text.getMinutes() + time_text.getSeconds()) / 86400;\n\t};\n\t\n\texports.TODAY = function() {\n\t return new Date();\n\t};\n\t\n\texports.WEEKDAY = function(serial_number, return_type) {\n\t serial_number = utils.parseDate(serial_number);\n\t if (serial_number instanceof Error) {\n\t return serial_number;\n\t }\n\t if (return_type === undefined) {\n\t return_type = 1;\n\t }\n\t var day = serial_number.getDay();\n\t\n\t return WEEK_TYPES[return_type][day];\n\t};\n\t\n\texports.WEEKNUM = function(serial_number, return_type) {\n\t serial_number = utils.parseDate(serial_number);\n\t if (serial_number instanceof Error) {\n\t return serial_number;\n\t }\n\t if (return_type === undefined) {\n\t return_type = 1;\n\t }\n\t if (return_type === 21) {\n\t return this.ISOWEEKNUM(serial_number);\n\t }\n\t var week_start = WEEK_STARTS[return_type];\n\t var jan = new Date(serial_number.getFullYear(), 0, 1);\n\t var inc = jan.getDay() < week_start ? 1 : 0;\n\t jan -= Math.abs(jan.getDay() - week_start) * 24 * 60 * 60 * 1000;\n\t\n\t return Math.floor(((serial_number - jan) / (1000 * 60 * 60 * 24)) / 7 + 1) + inc;\n\t};\n\t\n\texports.WORKDAY = function(start_date, days, holidays) {\n\t return this.WORKDAY.INTL(start_date, days, 1, holidays);\n\t};\n\t\n\texports.WORKDAY.INTL = function(start_date, days, weekend, holidays) {\n\t start_date = utils.parseDate(start_date);\n\t if (start_date instanceof Error) {\n\t return start_date;\n\t }\n\t days = utils.parseNumber(days);\n\t if (days instanceof Error) {\n\t return days;\n\t }\n\t if (days < 0) {\n\t return error.num;\n\t }\n\t if (weekend === undefined) {\n\t weekend = WEEKEND_TYPES[1];\n\t } else {\n\t weekend = WEEKEND_TYPES[weekend];\n\t }\n\t if (!(weekend instanceof Array)) {\n\t return error.value;\n\t }\n\t if (holidays === undefined) {\n\t holidays = [];\n\t } else if (!(holidays instanceof Array)) {\n\t holidays = [holidays];\n\t }\n\t for (var i = 0; i < holidays.length; i++) {\n\t var h = utils.parseDate(holidays[i]);\n\t if (h instanceof Error) {\n\t return h;\n\t }\n\t holidays[i] = h;\n\t }\n\t var d = 0;\n\t while (d < days) {\n\t start_date.setDate(start_date.getDate() + 1);\n\t var day = start_date.getDay();\n\t if (day === weekend[0] || day === weekend[1]) {\n\t continue;\n\t }\n\t for (var j = 0; j < holidays.length; j++) {\n\t var holiday = holidays[j];\n\t if (holiday.getDate() === start_date.getDate() &&\n\t holiday.getMonth() === start_date.getMonth() &&\n\t holiday.getFullYear() === start_date.getFullYear()) {\n\t d--;\n\t break;\n\t }\n\t }\n\t d++;\n\t }\n\t\n\t return start_date;\n\t};\n\t\n\texports.YEAR = function(serial_number) {\n\t serial_number = utils.parseDate(serial_number);\n\t\n\t if (serial_number instanceof Error) {\n\t return serial_number;\n\t }\n\t\n\t return serial_number.getFullYear();\n\t};\n\t\n\tfunction isLeapYear(year) {\n\t return new Date(year, 1, 29).getMonth() === 1;\n\t}\n\t\n\t// TODO : Use DAYS ?\n\tfunction daysBetween(start_date, end_date) {\n\t return Math.ceil((end_date - start_date) / 1000 / 60 / 60 / 24);\n\t}\n\t\n\texports.YEARFRAC = function(start_date, end_date, basis) {\n\t start_date = utils.parseDate(start_date);\n\t if (start_date instanceof Error) {\n\t return start_date;\n\t }\n\t end_date = utils.parseDate(end_date);\n\t if (end_date instanceof Error) {\n\t return end_date;\n\t }\n\t\n\t basis = basis || 0;\n\t var sd = start_date.getDate();\n\t var sm = start_date.getMonth() + 1;\n\t var sy = start_date.getFullYear();\n\t var ed = end_date.getDate();\n\t var em = end_date.getMonth() + 1;\n\t var ey = end_date.getFullYear();\n\t\n\t switch (basis) {\n\t case 0:\n\t // US (NASD) 30/360\n\t if (sd === 31 && ed === 31) {\n\t sd = 30;\n\t ed = 30;\n\t } else if (sd === 31) {\n\t sd = 30;\n\t } else if (sd === 30 && ed === 31) {\n\t ed = 30;\n\t }\n\t return ((ed + em * 30 + ey * 360) - (sd + sm * 30 + sy * 360)) / 360;\n\t case 1:\n\t // Actual/actual\n\t var feb29Between = function(date1, date2) {\n\t var year1 = date1.getFullYear();\n\t var mar1year1 = new Date(year1, 2, 1);\n\t if (isLeapYear(year1) && date1 < mar1year1 && date2 >= mar1year1) {\n\t return true;\n\t }\n\t var year2 = date2.getFullYear();\n\t var mar1year2 = new Date(year2, 2, 1);\n\t return (isLeapYear(year2) && date2 >= mar1year2 && date1 < mar1year2);\n\t };\n\t var ylength = 365;\n\t if (sy === ey || ((sy + 1) === ey) && ((sm > em) || ((sm === em) && (sd >= ed)))) {\n\t if ((sy === ey && isLeapYear(sy)) ||\n\t feb29Between(start_date, end_date) ||\n\t (em === 1 && ed === 29)) {\n\t ylength = 366;\n\t }\n\t return daysBetween(start_date, end_date) / ylength;\n\t }\n\t var years = (ey - sy) + 1;\n\t var days = (new Date(ey + 1, 0, 1) - new Date(sy, 0, 1)) / 1000 / 60 / 60 / 24;\n\t var average = days / years;\n\t return daysBetween(start_date, end_date) / average;\n\t case 2:\n\t // Actual/360\n\t return daysBetween(start_date, end_date) / 360;\n\t case 3:\n\t // Actual/365\n\t return daysBetween(start_date, end_date) / 365;\n\t case 4:\n\t // European 30/360\n\t return ((ed + em * 30 + ey * 360) - (sd + sm * 30 + sy * 360)) / 360;\n\t }\n\t};\n\t\n\tfunction serial(date) {\n\t var addOn = (date > -2203891200000) ? 2 : 1;\n\t\n\t return (date - d1900) / 86400000 + addOn;\n\t}\n\n\n/***/ },\n/* 28 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar error = __webpack_require__(16);\n\tvar stats = __webpack_require__(17);\n\tvar maths = __webpack_require__(14);\n\tvar utils = __webpack_require__(15);\n\t\n\tfunction compact(array) {\n\t var result = [];\n\t\n\t utils.arrayEach(array, function(value) {\n\t if (value) {\n\t result.push(value);\n\t }\n\t });\n\t\n\t return result;\n\t}\n\t\n\texports.FINDFIELD = function(database, title) {\n\t var index = null;\n\t\n\t utils.arrayEach(database, function(value, i) {\n\t if (value[0] === title) {\n\t index = i;\n\t return false;\n\t }\n\t });\n\t\n\t // Return error if the input field title is incorrect\n\t if (index == null) {\n\t return error.value;\n\t }\n\t\n\t return index;\n\t};\n\t\n\tfunction findResultIndex(database, criterias) {\n\t var matches = {};\n\t for (var i = 1; i < database[0].length; ++i) {\n\t matches[i] = true;\n\t }\n\t var maxCriteriaLength = criterias[0].length;\n\t for (i = 1; i < criterias.length; ++i) {\n\t if (criterias[i].length > maxCriteriaLength) {\n\t maxCriteriaLength = criterias[i].length;\n\t }\n\t }\n\t\n\t for (var k = 1; k < database.length; ++k) {\n\t for (var l = 1; l < database[k].length; ++l) {\n\t var currentCriteriaResult = false;\n\t var hasMatchingCriteria = false;\n\t for (var j = 0; j < criterias.length; ++j) {\n\t var criteria = criterias[j];\n\t if (criteria.length < maxCriteriaLength) {\n\t continue;\n\t }\n\t\n\t var criteriaField = criteria[0];\n\t if (database[k][0] !== criteriaField) {\n\t continue;\n\t }\n\t hasMatchingCriteria = true;\n\t for (var p = 1; p < criteria.length; ++p) {\n\t currentCriteriaResult = currentCriteriaResult || eval(database[k][l] + criteria[p]); // jshint ignore:line\n\t }\n\t }\n\t if (hasMatchingCriteria) {\n\t matches[l] = matches[l] && currentCriteriaResult;\n\t }\n\t }\n\t }\n\t\n\t var result = [];\n\t for (var n = 0; n < database[0].length; ++n) {\n\t if (matches[n]) {\n\t result.push(n - 1);\n\t }\n\t }\n\t\n\t return result;\n\t}\n\t\n\t// Database functions\n\texports.DAVERAGE = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t var sum = 0;\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t sum += targetFields[value];\n\t });\n\t\n\t return resultIndexes.length === 0 ? error.div0 : sum / resultIndexes.length;\n\t};\n\t\n\texports.DCOUNT = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t\n\t var targetValues = [];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t targetValues.push(targetFields[value]);\n\t });\n\t\n\t return stats.COUNT(targetValues);\n\t};\n\t\n\texports.DCOUNTA = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t\n\t var targetValues = [];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t targetValues.push(targetFields[value]);\n\t });\n\t\n\t return stats.COUNTA(targetValues);\n\t};\n\t\n\texports.DGET = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t\n\t // Return error if no record meets the criteria\n\t if (resultIndexes.length === 0) {\n\t return error.value;\n\t }\n\t // Returns the #NUM! error value because more than one record meets the\n\t // criteria\n\t if (resultIndexes.length > 1) {\n\t return error.num;\n\t }\n\t\n\t return targetFields[resultIndexes[0]];\n\t};\n\t\n\texports.DMAX = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t\n\t var maxValue = targetFields[resultIndexes[0]];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t if (maxValue < targetFields[value]) {\n\t maxValue = targetFields[value];\n\t }\n\t });\n\t\n\t return maxValue;\n\t};\n\t\n\texports.DMIN = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t\n\t var minValue = targetFields[resultIndexes[0]];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t if (minValue > targetFields[value]) {\n\t minValue = targetFields[value];\n\t }\n\t });\n\t\n\t return minValue;\n\t};\n\t\n\texports.DPRODUCT = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t\n\t var targetValues = [];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t targetValues.push(targetFields[value]);\n\t });\n\t targetValues = compact(targetValues);\n\t\n\t var result = 1;\n\t\n\t utils.arrayEach(targetValues, function(value) {\n\t result *= value;\n\t });\n\t\n\t return result;\n\t};\n\t\n\texports.DSTDEV = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t var targetValues = [];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t targetValues.push(targetFields[value]);\n\t });\n\t targetValues = compact(targetValues);\n\t\n\t return stats.STDEV.S(targetValues);\n\t};\n\t\n\texports.DSTDEVP = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t\n\t var targetValues = [];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t targetValues.push(targetFields[value]);\n\t });\n\t targetValues = compact(targetValues);\n\t\n\t return stats.STDEV.P(targetValues);\n\t};\n\t\n\texports.DSUM = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t\n\t var targetValues = [];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t targetValues.push(targetFields[value]);\n\t });\n\t\n\t return maths.SUM(targetValues);\n\t};\n\t\n\texports.DVAR = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t var targetValues = [];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t targetValues.push(targetFields[value]);\n\t });\n\t\n\t return stats.VAR.S(targetValues);\n\t};\n\t\n\texports.DVARP = function(database, field, criteria) {\n\t // Return error if field is not a number and not a string\n\t if (isNaN(field) && (typeof field !== \"string\")) {\n\t return error.value;\n\t }\n\t var resultIndexes = findResultIndex(database, criteria);\n\t var targetFields = [];\n\t\n\t if (typeof field === \"string\") {\n\t var index = exports.FINDFIELD(database, field);\n\t targetFields = utils.rest(database[index]);\n\t } else {\n\t targetFields = utils.rest(database[field]);\n\t }\n\t var targetValues = [];\n\t\n\t utils.arrayEach(resultIndexes, function(value) {\n\t targetValues.push(targetFields[value]);\n\t });\n\t\n\t return stats.VAR.P(targetValues);\n\t};\n\n\n/***/ },\n/* 29 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar error = __webpack_require__(16);\n\tvar utils = __webpack_require__(15);\n\tvar information = __webpack_require__(24);\n\t\n\texports.AND = function() {\n\t var args = utils.flatten(arguments);\n\t var result = true;\n\t for (var i = 0; i < args.length; i++) {\n\t if (!args[i]) {\n\t result = false;\n\t }\n\t }\n\t return result;\n\t};\n\t\n\texports.CHOOSE = function() {\n\t if (arguments.length < 2) {\n\t return error.na;\n\t }\n\t\n\t var index = arguments[0];\n\t if (index < 1 || index > 254) {\n\t return error.value;\n\t }\n\t\n\t if (arguments.length < index + 1) {\n\t return error.value;\n\t }\n\t\n\t return arguments[index];\n\t};\n\t\n\texports.FALSE = function() {\n\t return false;\n\t};\n\t\n\texports.IF = function(test, then_value, otherwise_value) {\n\t return test ? then_value : otherwise_value;\n\t};\n\t\n\texports.IFERROR = function(value, valueIfError) {\n\t if (information.ISERROR(value)) {\n\t return valueIfError;\n\t }\n\t return value;\n\t};\n\t\n\texports.IFNA = function(value, value_if_na) {\n\t return value === error.na ? value_if_na : value;\n\t};\n\t\n\texports.NOT = function(logical) {\n\t return !logical;\n\t};\n\t\n\texports.OR = function() {\n\t var args = utils.flatten(arguments);\n\t var result = false;\n\t for (var i = 0; i < args.length; i++) {\n\t if (args[i]) {\n\t result = true;\n\t }\n\t }\n\t return result;\n\t};\n\t\n\texports.TRUE = function() {\n\t return true;\n\t};\n\t\n\texports.XOR = function() {\n\t var args = utils.flatten(arguments);\n\t var result = 0;\n\t for (var i = 0; i < args.length; i++) {\n\t if (args[i]) {\n\t result++;\n\t }\n\t }\n\t return (Math.floor(Math.abs(result)) & 1) ? true : false;\n\t};\n\t\n\texports.SWITCH = function () {\n\t var result;\n\t\n\t if (arguments.length > 0) {\n\t var targetValue = arguments[0];\n\t var argc = arguments.length - 1;\n\t var switchCount = Math.floor(argc / 2);\n\t var switchSatisfied = false;\n\t var hasDefaultClause = argc % 2 !== 0;\n\t var defaultClause = argc % 2 === 0 ? null : arguments[arguments.length - 1];\n\t\n\t if (switchCount) {\n\t for (var index = 0; index < switchCount; index++) {\n\t if (targetValue === arguments[index * 2 + 1]) {\n\t result = arguments[index * 2 + 2];\n\t switchSatisfied = true;\n\t break;\n\t }\n\t }\n\t }\n\t\n\t if (!switchSatisfied) {\n\t result = hasDefaultClause ? defaultClause : error.na;\n\t }\n\t } else {\n\t result = error.value;\n\t }\n\t\n\t return result;\n\t};\n\n\n/***/ },\n/* 30 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar error = __webpack_require__(16);\n\tvar dateTime = __webpack_require__(27);\n\tvar utils = __webpack_require__(15);\n\t\n\tfunction validDate(d) {\n\t return d && d.getTime && !isNaN(d.getTime());\n\t}\n\t\n\tfunction ensureDate(d) {\n\t return (d instanceof Date)?d:new Date(d);\n\t}\n\t\n\texports.ACCRINT = function(issue, first, settlement, rate, par, frequency, basis) {\n\t // Return error if either date is invalid\n\t issue = ensureDate(issue);\n\t first = ensureDate(first);\n\t settlement = ensureDate(settlement);\n\t if (!validDate(issue) || !validDate(first) || !validDate(settlement)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if either rate or par are lower than or equal to zero\n\t if (rate <= 0 || par <= 0) {\n\t return error.num\n\t }\n\t\n\t // Return error if frequency is neither 1, 2, or 4\n\t if ([1, 2, 4].indexOf(frequency) === -1) {\n\t return error.num;\n\t }\n\t\n\t // Return error if basis is neither 0, 1, 2, 3, or 4\n\t if ([0, 1, 2, 3, 4].indexOf(basis) === -1) {\n\t return error.num;\n\t }\n\t\n\t // Return error if settlement is before or equal to issue\n\t if (settlement <= issue) {\n\t return error.num;\n\t }\n\t\n\t // Set default values\n\t par = par || 0;\n\t basis = basis || 0;\n\t\n\t // Compute accrued interest\n\t return par * rate * dateTime.YEARFRAC(issue, settlement, basis);\n\t};\n\t\n\t// TODO\n\texports.ACCRINTM = function() {\n\t throw new Error('ACCRINTM is not implemented');\n\t};\n\t\n\t// TODO\n\texports.AMORDEGRC = function() {\n\t throw new Error('AMORDEGRC is not implemented');\n\t};\n\t\n\t// TODO\n\texports.AMORLINC = function() {\n\t throw new Error('AMORLINC is not implemented');\n\t};\n\t\n\t// TODO\n\texports.COUPDAYBS = function() {\n\t throw new Error('COUPDAYBS is not implemented');\n\t};\n\t\n\t// TODO\n\texports.COUPDAYS = function() {\n\t throw new Error('COUPDAYS is not implemented');\n\t};\n\t\n\t// TODO\n\texports.COUPDAYSNC = function() {\n\t throw new Error('COUPDAYSNC is not implemented');\n\t};\n\t\n\t// TODO\n\texports.COUPNCD = function() {\n\t throw new Error('COUPNCD is not implemented');\n\t};\n\t\n\t// TODO\n\texports.COUPNUM = function() {\n\t throw new Error('COUPNUM is not implemented');\n\t};\n\t\n\t// TODO\n\texports.COUPPCD = function() {\n\t throw new Error('COUPPCD is not implemented');\n\t};\n\t\n\texports.CUMIPMT = function(rate, periods, value, start, end, type) {\n\t // Credits: algorithm inspired by Apache OpenOffice\n\t // Credits: Hannes Stiebitzhofer for the translations of function and variable names\n\t // Requires exports.FV() and exports.PMT() from exports.js [http://stoic.com/exports/]\n\t\n\t rate = utils.parseNumber(rate);\n\t periods = utils.parseNumber(periods);\n\t value = utils.parseNumber(value);\n\t if (utils.anyIsError(rate, periods, value)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if either rate, periods, or value are lower than or equal to zero\n\t if (rate <= 0 || periods <= 0 || value <= 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if start < 1, end < 1, or start > end\n\t if (start < 1 || end < 1 || start > end) {\n\t return error.num;\n\t }\n\t\n\t // Return error if type is neither 0 nor 1\n\t if (type !== 0 && type !== 1) {\n\t return error.num;\n\t }\n\t\n\t // Compute cumulative interest\n\t var payment = exports.PMT(rate, periods, value, 0, type);\n\t var interest = 0;\n\t\n\t if (start === 1) {\n\t if (type === 0) {\n\t interest = -value;\n\t start++;\n\t }\n\t }\n\t\n\t for (var i = start; i <= end; i++) {\n\t if (type === 1) {\n\t interest += exports.FV(rate, i - 2, payment, value, 1) - payment;\n\t } else {\n\t interest += exports.FV(rate, i - 1, payment, value, 0);\n\t }\n\t }\n\t interest *= rate;\n\t\n\t // Return cumulative interest\n\t return interest;\n\t};\n\t\n\texports.CUMPRINC = function(rate, periods, value, start, end, type) {\n\t // Credits: algorithm inspired by Apache OpenOffice\n\t // Credits: Hannes Stiebitzhofer for the translations of function and variable names\n\t\n\t rate = utils.parseNumber(rate);\n\t periods = utils.parseNumber(periods);\n\t value = utils.parseNumber(value);\n\t if (utils.anyIsError(rate, periods, value)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if either rate, periods, or value are lower than or equal to zero\n\t if (rate <= 0 || periods <= 0 || value <= 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if start < 1, end < 1, or start > end\n\t if (start < 1 || end < 1 || start > end) {\n\t return error.num;\n\t }\n\t\n\t // Return error if type is neither 0 nor 1\n\t if (type !== 0 && type !== 1) {\n\t return error.num;\n\t }\n\t\n\t // Compute cumulative principal\n\t var payment = exports.PMT(rate, periods, value, 0, type);\n\t var principal = 0;\n\t if (start === 1) {\n\t if (type === 0) {\n\t principal = payment + value * rate;\n\t } else {\n\t principal = payment;\n\t }\n\t start++;\n\t }\n\t for (var i = start; i <= end; i++) {\n\t if (type > 0) {\n\t principal += payment - (exports.FV(rate, i - 2, payment, value, 1) - payment) * rate;\n\t } else {\n\t principal += payment - exports.FV(rate, i - 1, payment, value, 0) * rate;\n\t }\n\t }\n\t\n\t // Return cumulative principal\n\t return principal;\n\t};\n\t\n\texports.DB = function(cost, salvage, life, period, month) {\n\t // Initialize month\n\t month = (month === undefined) ? 12 : month;\n\t\n\t cost = utils.parseNumber(cost);\n\t salvage = utils.parseNumber(salvage);\n\t life = utils.parseNumber(life);\n\t period = utils.parseNumber(period);\n\t month = utils.parseNumber(month);\n\t if (utils.anyIsError(cost, salvage, life, period, month)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if any of the parameters is negative\n\t if (cost < 0 || salvage < 0 || life < 0 || period < 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if month is not an integer between 1 and 12\n\t if ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].indexOf(month) === -1) {\n\t return error.num;\n\t }\n\t\n\t // Return error if period is greater than life\n\t if (period > life) {\n\t return error.num;\n\t }\n\t\n\t // Return 0 (zero) if salvage is greater than or equal to cost\n\t if (salvage >= cost) {\n\t return 0;\n\t }\n\t\n\t // Rate is rounded to three decimals places\n\t var rate = (1 - Math.pow(salvage / cost, 1 / life)).toFixed(3);\n\t\n\t // Compute initial depreciation\n\t var initial = cost * rate * month / 12;\n\t\n\t // Compute total depreciation\n\t var total = initial;\n\t var current = 0;\n\t var ceiling = (period === life) ? life - 1 : period;\n\t for (var i = 2; i <= ceiling; i++) {\n\t current = (cost - total) * rate;\n\t total += current;\n\t }\n\t\n\t // Depreciation for the first and last periods are special cases\n\t if (period === 1) {\n\t // First period\n\t return initial;\n\t } else if (period === life) {\n\t // Last period\n\t return (cost - total) * rate;\n\t } else {\n\t return current;\n\t }\n\t};\n\t\n\texports.DDB = function(cost, salvage, life, period, factor) {\n\t // Initialize factor\n\t factor = (factor === undefined) ? 2 : factor;\n\t\n\t cost = utils.parseNumber(cost);\n\t salvage = utils.parseNumber(salvage);\n\t life = utils.parseNumber(life);\n\t period = utils.parseNumber(period);\n\t factor = utils.parseNumber(factor);\n\t if (utils.anyIsError(cost, salvage, life, period, factor)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if any of the parameters is negative or if factor is null\n\t if (cost < 0 || salvage < 0 || life < 0 || period < 0 || factor <= 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if period is greater than life\n\t if (period > life) {\n\t return error.num;\n\t }\n\t\n\t // Return 0 (zero) if salvage is greater than or equal to cost\n\t if (salvage >= cost) {\n\t return 0;\n\t }\n\t\n\t // Compute depreciation\n\t var total = 0;\n\t var current = 0;\n\t for (var i = 1; i <= period; i++) {\n\t current = Math.min((cost - total) * (factor / life), (cost - salvage - total));\n\t total += current;\n\t }\n\t\n\t // Return depreciation\n\t return current;\n\t};\n\t\n\t// TODO\n\texports.DISC = function() {\n\t throw new Error('DISC is not implemented');\n\t};\n\t\n\texports.DOLLARDE = function(dollar, fraction) {\n\t // Credits: algorithm inspired by Apache OpenOffice\n\t\n\t dollar = utils.parseNumber(dollar);\n\t fraction = utils.parseNumber(fraction);\n\t if (utils.anyIsError(dollar, fraction)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if fraction is negative\n\t if (fraction < 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if fraction is greater than or equal to 0 and less than 1\n\t if (fraction >= 0 && fraction < 1) {\n\t return error.div0;\n\t }\n\t\n\t // Truncate fraction if it is not an integer\n\t fraction = parseInt(fraction, 10);\n\t\n\t // Compute integer part\n\t var result = parseInt(dollar, 10);\n\t\n\t // Add decimal part\n\t result += (dollar % 1) * Math.pow(10, Math.ceil(Math.log(fraction) / Math.LN10)) / fraction;\n\t\n\t // Round result\n\t var power = Math.pow(10, Math.ceil(Math.log(fraction) / Math.LN2) + 1);\n\t result = Math.round(result * power) / power;\n\t\n\t // Return converted dollar price\n\t return result;\n\t};\n\t\n\texports.DOLLARFR = function(dollar, fraction) {\n\t // Credits: algorithm inspired by Apache OpenOffice\n\t\n\t dollar = utils.parseNumber(dollar);\n\t fraction = utils.parseNumber(fraction);\n\t if (utils.anyIsError(dollar, fraction)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if fraction is negative\n\t if (fraction < 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if fraction is greater than or equal to 0 and less than 1\n\t if (fraction >= 0 && fraction < 1) {\n\t return error.div0;\n\t }\n\t\n\t // Truncate fraction if it is not an integer\n\t fraction = parseInt(fraction, 10);\n\t\n\t // Compute integer part\n\t var result = parseInt(dollar, 10);\n\t\n\t // Add decimal part\n\t result += (dollar % 1) * Math.pow(10, -Math.ceil(Math.log(fraction) / Math.LN10)) * fraction;\n\t\n\t // Return converted dollar price\n\t return result;\n\t};\n\t\n\t// TODO\n\texports.DURATION = function() {\n\t throw new Error('DURATION is not implemented');\n\t};\n\t\n\texports.EFFECT = function(rate, periods) {\n\t rate = utils.parseNumber(rate);\n\t periods = utils.parseNumber(periods);\n\t if (utils.anyIsError(rate, periods)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if rate <=0 or periods < 1\n\t if (rate <= 0 || periods < 1) {\n\t return error.num;\n\t }\n\t\n\t // Truncate periods if it is not an integer\n\t periods = parseInt(periods, 10);\n\t\n\t // Return effective annual interest rate\n\t return Math.pow(1 + rate / periods, periods) - 1;\n\t};\n\t\n\texports.FV = function(rate, periods, payment, value, type) {\n\t // Credits: algorithm inspired by Apache OpenOffice\n\t\n\t value = value || 0;\n\t type = type || 0;\n\t\n\t rate = utils.parseNumber(rate);\n\t periods = utils.parseNumber(periods);\n\t payment = utils.parseNumber(payment);\n\t value = utils.parseNumber(value);\n\t type = utils.parseNumber(type);\n\t if (utils.anyIsError(rate, periods, payment, value, type)) {\n\t return error.value;\n\t }\n\t\n\t // Return future value\n\t var result;\n\t if (rate === 0) {\n\t result = value + payment * periods;\n\t } else {\n\t var term = Math.pow(1 + rate, periods);\n\t if (type === 1) {\n\t result = value * term + payment * (1 + rate) * (term - 1) / rate;\n\t } else {\n\t result = value * term + payment * (term - 1) / rate;\n\t }\n\t }\n\t return -result;\n\t};\n\t\n\texports.FVSCHEDULE = function(principal, schedule) {\n\t principal = utils.parseNumber(principal);\n\t schedule = utils.parseNumberArray(utils.flatten(schedule));\n\t if (utils.anyIsError(principal, schedule)) {\n\t return error.value;\n\t }\n\t\n\t var n = schedule.length;\n\t var future = principal;\n\t\n\t // Apply all interests in schedule\n\t for (var i = 0; i < n; i++) {\n\t // Apply scheduled interest\n\t future *= 1 + schedule[i];\n\t }\n\t\n\t // Return future value\n\t return future;\n\t};\n\t\n\t// TODO\n\texports.INTRATE = function() {\n\t throw new Error('INTRATE is not implemented');\n\t};\n\t\n\texports.IPMT = function(rate, period, periods, present, future, type) {\n\t // Credits: algorithm inspired by Apache OpenOffice\n\t\n\t future = future || 0;\n\t type = type || 0;\n\t\n\t rate = utils.parseNumber(rate);\n\t period = utils.parseNumber(period);\n\t periods = utils.parseNumber(periods);\n\t present = utils.parseNumber(present);\n\t future = utils.parseNumber(future);\n\t type = utils.parseNumber(type);\n\t if (utils.anyIsError(rate, period, periods, present, future, type)) {\n\t return error.value;\n\t }\n\t\n\t // Compute payment\n\t var payment = exports.PMT(rate, periods, present, future, type);\n\t\n\t // Compute interest\n\t var interest;\n\t if (period === 1) {\n\t if (type === 1) {\n\t interest = 0;\n\t } else {\n\t interest = -present;\n\t }\n\t } else {\n\t if (type === 1) {\n\t interest = exports.FV(rate, period - 2, payment, present, 1) - payment;\n\t } else {\n\t interest = exports.FV(rate, period - 1, payment, present, 0);\n\t }\n\t }\n\t\n\t // Return interest\n\t return interest * rate;\n\t};\n\t\n\texports.IRR = function(values, guess) {\n\t // Credits: algorithm inspired by Apache OpenOffice\n\t\n\t guess = guess || 0;\n\t\n\t values = utils.parseNumberArray(utils.flatten(values));\n\t guess = utils.parseNumber(guess);\n\t if (utils.anyIsError(values, guess)) {\n\t return error.value;\n\t }\n\t\n\t // Calculates the resulting amount\n\t var irrResult = function(values, dates, rate) {\n\t var r = rate + 1;\n\t var result = values[0];\n\t for (var i = 1; i < values.length; i++) {\n\t result += values[i] / Math.pow(r, (dates[i] - dates[0]) / 365);\n\t }\n\t return result;\n\t };\n\t\n\t // Calculates the first derivation\n\t var irrResultDeriv = function(values, dates, rate) {\n\t var r = rate + 1;\n\t var result = 0;\n\t for (var i = 1; i < values.length; i++) {\n\t var frac = (dates[i] - dates[0]) / 365;\n\t result -= frac * values[i] / Math.pow(r, frac + 1);\n\t }\n\t return result;\n\t };\n\t\n\t // Initialize dates and check that values contains at least one positive value and one negative value\n\t var dates = [];\n\t var positive = false;\n\t var negative = false;\n\t for (var i = 0; i < values.length; i++) {\n\t dates[i] = (i === 0) ? 0 : dates[i - 1] + 365;\n\t if (values[i] > 0) {\n\t positive = true;\n\t }\n\t if (values[i] < 0) {\n\t negative = true;\n\t }\n\t }\n\t\n\t // Return error if values does not contain at least one positive value and one negative value\n\t if (!positive || !negative) {\n\t return error.num;\n\t }\n\t\n\t // Initialize guess and resultRate\n\t guess = (guess === undefined) ? 0.1 : guess;\n\t var resultRate = guess;\n\t\n\t // Set maximum epsilon for end of iteration\n\t var epsMax = 1e-10;\n\t\n\t // Implement Newton's method\n\t var newRate, epsRate, resultValue;\n\t var contLoop = true;\n\t do {\n\t resultValue = irrResult(values, dates, resultRate);\n\t newRate = resultRate - resultValue / irrResultDeriv(values, dates, resultRate);\n\t epsRate = Math.abs(newRate - resultRate);\n\t resultRate = newRate;\n\t contLoop = (epsRate > epsMax) && (Math.abs(resultValue) > epsMax);\n\t } while (contLoop);\n\t\n\t // Return internal rate of return\n\t return resultRate;\n\t};\n\t\n\texports.ISPMT = function(rate, period, periods, value) {\n\t rate = utils.parseNumber(rate);\n\t period = utils.parseNumber(period);\n\t periods = utils.parseNumber(periods);\n\t value = utils.parseNumber(value);\n\t if (utils.anyIsError(rate, period, periods, value)) {\n\t return error.value;\n\t }\n\t\n\t // Return interest\n\t return value * rate * (period / periods - 1);\n\t};\n\t\n\t// TODO\n\texports.MDURATION = function() {\n\t throw new Error('MDURATION is not implemented');\n\t};\n\t\n\texports.MIRR = function(values, finance_rate, reinvest_rate) {\n\t values = utils.parseNumberArray(utils.flatten(values));\n\t finance_rate = utils.parseNumber(finance_rate);\n\t reinvest_rate = utils.parseNumber(reinvest_rate);\n\t if (utils.anyIsError(values, finance_rate, reinvest_rate)) {\n\t return error.value;\n\t }\n\t\n\t // Initialize number of values\n\t var n = values.length;\n\t\n\t // Lookup payments (negative values) and incomes (positive values)\n\t var payments = [];\n\t var incomes = [];\n\t for (var i = 0; i < n; i++) {\n\t if (values[i] < 0) {\n\t payments.push(values[i]);\n\t } else {\n\t incomes.push(values[i]);\n\t }\n\t }\n\t\n\t // Return modified internal rate of return\n\t var num = -exports.NPV(reinvest_rate, incomes) * Math.pow(1 + reinvest_rate, n - 1);\n\t var den = exports.NPV(finance_rate, payments) * (1 + finance_rate);\n\t return Math.pow(num / den, 1 / (n - 1)) - 1;\n\t};\n\t\n\texports.NOMINAL = function(rate, periods) {\n\t rate = utils.parseNumber(rate);\n\t periods = utils.parseNumber(periods);\n\t if (utils.anyIsError(rate, periods)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if rate <=0 or periods < 1\n\t if (rate <= 0 || periods < 1) {\n\t return error.num;\n\t }\n\t\n\t // Truncate periods if it is not an integer\n\t periods = parseInt(periods, 10);\n\t\n\t // Return nominal annual interest rate\n\t return (Math.pow(rate + 1, 1 / periods) - 1) * periods;\n\t};\n\t\n\texports.NPER = function(rate, payment, present, future, type) {\n\t type = (type === undefined) ? 0 : type;\n\t future = (future === undefined) ? 0 : future;\n\t\n\t rate = utils.parseNumber(rate);\n\t payment = utils.parseNumber(payment);\n\t present = utils.parseNumber(present);\n\t future = utils.parseNumber(future);\n\t type = utils.parseNumber(type);\n\t if (utils.anyIsError(rate, payment, present, future, type)) {\n\t return error.value;\n\t }\n\t\n\t // Return number of periods\n\t var num = payment * (1 + rate * type) - future * rate;\n\t var den = (present * rate + payment * (1 + rate * type));\n\t return Math.log(num / den) / Math.log(1 + rate);\n\t};\n\t\n\texports.NPV = function() {\n\t var args = utils.parseNumberArray(utils.flatten(arguments));\n\t if (args instanceof Error) {\n\t return args;\n\t }\n\t\n\t // Lookup rate\n\t var rate = args[0];\n\t\n\t // Initialize net present value\n\t var value = 0;\n\t\n\t // Loop on all values\n\t for (var j = 1; j < args.length; j++) {\n\t value += args[j] / Math.pow(1 + rate, j);\n\t }\n\t\n\t // Return net present value\n\t return value;\n\t};\n\t\n\t// TODO\n\texports.ODDFPRICE = function() {\n\t throw new Error('ODDFPRICE is not implemented');\n\t};\n\t\n\t// TODO\n\texports.ODDFYIELD = function() {\n\t throw new Error('ODDFYIELD is not implemented');\n\t};\n\t\n\t// TODO\n\texports.ODDLPRICE = function() {\n\t throw new Error('ODDLPRICE is not implemented');\n\t};\n\t\n\t// TODO\n\texports.ODDLYIELD = function() {\n\t throw new Error('ODDLYIELD is not implemented');\n\t};\n\t\n\texports.PDURATION = function(rate, present, future) {\n\t rate = utils.parseNumber(rate);\n\t present = utils.parseNumber(present);\n\t future = utils.parseNumber(future);\n\t if (utils.anyIsError(rate, present, future)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if rate <=0\n\t if (rate <= 0) {\n\t return error.num;\n\t }\n\t\n\t // Return number of periods\n\t return (Math.log(future) - Math.log(present)) / Math.log(1 + rate);\n\t};\n\t\n\texports.PMT = function(rate, periods, present, future, type) {\n\t // Credits: algorithm inspired by Apache OpenOffice\n\t\n\t future = future || 0;\n\t type = type || 0;\n\t\n\t rate = utils.parseNumber(rate);\n\t periods = utils.parseNumber(periods);\n\t present = utils.parseNumber(present);\n\t future = utils.parseNumber(future);\n\t type = utils.parseNumber(type);\n\t if (utils.anyIsError(rate, periods, present, future, type)) {\n\t return error.value;\n\t }\n\t\n\t // Return payment\n\t var result;\n\t if (rate === 0) {\n\t result = (present + future) / periods;\n\t } else {\n\t var term = Math.pow(1 + rate, periods);\n\t if (type === 1) {\n\t result = (future * rate / (term - 1) + present * rate / (1 - 1 / term)) / (1 + rate);\n\t } else {\n\t result = future * rate / (term - 1) + present * rate / (1 - 1 / term);\n\t }\n\t }\n\t return -result;\n\t};\n\t\n\texports.PPMT = function(rate, period, periods, present, future, type) {\n\t future = future || 0;\n\t type = type || 0;\n\t\n\t rate = utils.parseNumber(rate);\n\t periods = utils.parseNumber(periods);\n\t present = utils.parseNumber(present);\n\t future = utils.parseNumber(future);\n\t type = utils.parseNumber(type);\n\t if (utils.anyIsError(rate, periods, present, future, type)) {\n\t return error.value;\n\t }\n\t\n\t return exports.PMT(rate, periods, present, future, type) - exports.IPMT(rate, period, periods, present, future, type);\n\t};\n\t\n\t// TODO\n\texports.PRICE = function() {\n\t throw new Error('PRICE is not implemented');\n\t};\n\t\n\t// TODO\n\texports.PRICEDISC = function() {\n\t throw new Error('PRICEDISC is not implemented');\n\t};\n\t\n\t// TODO\n\texports.PRICEMAT = function() {\n\t throw new Error('PRICEMAT is not implemented');\n\t};\n\t\n\texports.PV = function(rate, periods, payment, future, type) {\n\t future = future || 0;\n\t type = type || 0;\n\t\n\t rate = utils.parseNumber(rate);\n\t periods = utils.parseNumber(periods);\n\t payment = utils.parseNumber(payment);\n\t future = utils.parseNumber(future);\n\t type = utils.parseNumber(type);\n\t if (utils.anyIsError(rate, periods, payment, future, type)) {\n\t return error.value;\n\t }\n\t\n\t // Return present value\n\t if (rate === 0) {\n\t return -payment * periods - future;\n\t } else {\n\t return (((1 - Math.pow(1 + rate, periods)) / rate) * payment * (1 + rate * type) - future) / Math.pow(1 + rate, periods);\n\t }\n\t};\n\t\n\texports.RATE = function(periods, payment, present, future, type, guess) {\n\t // Credits: rabugento\n\t\n\t guess = (guess === undefined) ? 0.01 : guess;\n\t future = (future === undefined) ? 0 : future;\n\t type = (type === undefined) ? 0 : type;\n\t\n\t periods = utils.parseNumber(periods);\n\t payment = utils.parseNumber(payment);\n\t present = utils.parseNumber(present);\n\t future = utils.parseNumber(future);\n\t type = utils.parseNumber(type);\n\t guess = utils.parseNumber(guess);\n\t if (utils.anyIsError(periods, payment, present, future, type, guess)) {\n\t return error.value;\n\t }\n\t\n\t // Set maximum epsilon for end of iteration\n\t var epsMax = 1e-10;\n\t\n\t // Set maximum number of iterations\n\t var iterMax = 50;\n\t\n\t // Implement Newton's method\n\t var y, y0, y1, x0, x1 = 0,\n\t f = 0,\n\t i = 0;\n\t var rate = guess;\n\t if (Math.abs(rate) < epsMax) {\n\t y = present * (1 + periods * rate) + payment * (1 + rate * type) * periods + future;\n\t } else {\n\t f = Math.exp(periods * Math.log(1 + rate));\n\t y = present * f + payment * (1 / rate + type) * (f - 1) + future;\n\t }\n\t y0 = present + payment * periods + future;\n\t y1 = present * f + payment * (1 / rate + type) * (f - 1) + future;\n\t i = x0 = 0;\n\t x1 = rate;\n\t while ((Math.abs(y0 - y1) > epsMax) && (i < iterMax)) {\n\t rate = (y1 * x0 - y0 * x1) / (y1 - y0);\n\t x0 = x1;\n\t x1 = rate;\n\t if (Math.abs(rate) < epsMax) {\n\t y = present * (1 + periods * rate) + payment * (1 + rate * type) * periods + future;\n\t } else {\n\t f = Math.exp(periods * Math.log(1 + rate));\n\t y = present * f + payment * (1 / rate + type) * (f - 1) + future;\n\t }\n\t y0 = y1;\n\t y1 = y;\n\t ++i;\n\t }\n\t return rate;\n\t};\n\t\n\t// TODO\n\texports.RECEIVED = function() {\n\t throw new Error('RECEIVED is not implemented');\n\t};\n\t\n\texports.RRI = function(periods, present, future) {\n\t periods = utils.parseNumber(periods);\n\t present = utils.parseNumber(present);\n\t future = utils.parseNumber(future);\n\t if (utils.anyIsError(periods, present, future)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if periods or present is equal to 0 (zero)\n\t if (periods === 0 || present === 0) {\n\t return error.num;\n\t }\n\t\n\t // Return equivalent interest rate\n\t return Math.pow(future / present, 1 / periods) - 1;\n\t};\n\t\n\texports.SLN = function(cost, salvage, life) {\n\t cost = utils.parseNumber(cost);\n\t salvage = utils.parseNumber(salvage);\n\t life = utils.parseNumber(life);\n\t if (utils.anyIsError(cost, salvage, life)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if life equal to 0 (zero)\n\t if (life === 0) {\n\t return error.num;\n\t }\n\t\n\t // Return straight-line depreciation\n\t return (cost - salvage) / life;\n\t};\n\t\n\texports.SYD = function(cost, salvage, life, period) {\n\t // Return error if any of the parameters is not a number\n\t cost = utils.parseNumber(cost);\n\t salvage = utils.parseNumber(salvage);\n\t life = utils.parseNumber(life);\n\t period = utils.parseNumber(period);\n\t if (utils.anyIsError(cost, salvage, life, period)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if life equal to 0 (zero)\n\t if (life === 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if period is lower than 1 or greater than life\n\t if (period < 1 || period > life) {\n\t return error.num;\n\t }\n\t\n\t // Truncate period if it is not an integer\n\t period = parseInt(period, 10);\n\t\n\t // Return straight-line depreciation\n\t return ((cost - salvage) * (life - period + 1) * 2) / (life * (life + 1));\n\t};\n\t\n\texports.TBILLEQ = function(settlement, maturity, discount) {\n\t settlement = utils.parseDate(settlement);\n\t maturity = utils.parseDate(maturity);\n\t discount = utils.parseNumber(discount);\n\t if (utils.anyIsError(settlement, maturity, discount)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if discount is lower than or equal to zero\n\t if (discount <= 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if settlement is greater than maturity\n\t if (settlement > maturity) {\n\t return error.num;\n\t }\n\t\n\t // Return error if maturity is more than one year after settlement\n\t if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n\t return error.num;\n\t }\n\t\n\t // Return bond-equivalent yield\n\t return (365 * discount) / (360 - discount * dateTime.DAYS360(settlement, maturity, false));\n\t};\n\t\n\texports.TBILLPRICE = function(settlement, maturity, discount) {\n\t settlement = utils.parseDate(settlement);\n\t maturity = utils.parseDate(maturity);\n\t discount = utils.parseNumber(discount);\n\t if (utils.anyIsError(settlement, maturity, discount)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if discount is lower than or equal to zero\n\t if (discount <= 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if settlement is greater than maturity\n\t if (settlement > maturity) {\n\t return error.num;\n\t }\n\t\n\t // Return error if maturity is more than one year after settlement\n\t if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n\t return error.num;\n\t }\n\t\n\t // Return bond-equivalent yield\n\t return 100 * (1 - discount * dateTime.DAYS360(settlement, maturity, false) / 360);\n\t};\n\t\n\texports.TBILLYIELD = function(settlement, maturity, price) {\n\t settlement = utils.parseDate(settlement);\n\t maturity = utils.parseDate(maturity);\n\t price = utils.parseNumber(price);\n\t if (utils.anyIsError(settlement, maturity, price)) {\n\t return error.value;\n\t }\n\t\n\t // Return error if price is lower than or equal to zero\n\t if (price <= 0) {\n\t return error.num;\n\t }\n\t\n\t // Return error if settlement is greater than maturity\n\t if (settlement > maturity) {\n\t return error.num;\n\t }\n\t\n\t // Return error if maturity is more than one year after settlement\n\t if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n\t return error.num;\n\t }\n\t\n\t // Return bond-equivalent yield\n\t return (100 - price) * 360 / (price * dateTime.DAYS360(settlement, maturity, false));\n\t};\n\t\n\t// TODO\n\texports.VDB = function() {\n\t throw new Error('VDB is not implemented');\n\t};\n\t\n\t// TODO needs better support for date\n\t// exports.XIRR = function(values, dates, guess) {\n\t// // Credits: algorithm inspired by Apache OpenOffice\n\t//\n\t// values = utils.parseNumberArray(utils.flatten(values));\n\t// dates = utils.parseDateArray(utils.flatten(dates));\n\t// guess = utils.parseNumber(guess);\n\t//\n\t// if (utils.anyIsError(values, dates, guess)) {\n\t// return error.value;\n\t// }\n\t//\n\t// // Calculates the resulting amount\n\t// var irrResult = function(values, dates, rate) {\n\t// var r = rate + 1;\n\t// var result = values[0];\n\t// for (var i = 1; i < values.length; i++) {\n\t// result += values[i] / Math.pow(r, dateTime.DAYS(dates[i], dates[0]) / 365);\n\t// }\n\t// return result;\n\t// };\n\t//\n\t// // Calculates the first derivation\n\t// var irrResultDeriv = function(values, dates, rate) {\n\t// var r = rate + 1;\n\t// var result = 0;\n\t// for (var i = 1; i < values.length; i++) {\n\t// var frac = dateTime.DAYS(dates[i], dates[0]) / 365;\n\t// result -= frac * values[i] / Math.pow(r, frac + 1);\n\t// }\n\t// return result;\n\t// };\n\t//\n\t// // Check that values contains at least one positive value and one negative value\n\t// var positive = false;\n\t// var negative = false;\n\t// for (var i = 0; i < values.length; i++) {\n\t// if (values[i] > 0) {\n\t// positive = true;\n\t// }\n\t// if (values[i] < 0) {\n\t// negative = true;\n\t// }\n\t// }\n\t//\n\t// // Return error if values does not contain at least one positive value and one negative value\n\t// if (!positive || !negative) {\n\t// return error.num;\n\t// }\n\t//\n\t// // Initialize guess and resultRate\n\t// guess = guess || 0.1;\n\t// var resultRate = guess;\n\t//\n\t// // Set maximum epsilon for end of iteration\n\t// var epsMax = 1e-10;\n\t//\n\t// // Implement Newton's method\n\t// var newRate, epsRate, resultValue;\n\t// var contLoop = true;\n\t// do {\n\t// resultValue = irrResult(values, dates, resultRate);\n\t// newRate = resultRate - resultValue / irrResultDeriv(values, dates, resultRate);\n\t// epsRate = Math.abs(newRate - resultRate);\n\t// resultRate = newRate;\n\t// contLoop = (epsRate > epsMax) && (Math.abs(resultValue) > epsMax);\n\t// } while (contLoop);\n\t//\n\t// // Return internal rate of return\n\t// return resultRate;\n\t// };\n\t\n\texports.XNPV = function(rate, values, dates) {\n\t rate = utils.parseNumber(rate);\n\t values = utils.parseNumberArray(utils.flatten(values));\n\t dates = utils.parseDateArray(utils.flatten(dates));\n\t if (utils.anyIsError(rate, values, dates)) {\n\t return error.value;\n\t }\n\t\n\t var result = 0;\n\t for (var i = 0; i < values.length; i++) {\n\t result += values[i] / Math.pow(1 + rate, dateTime.DAYS(dates[i], dates[0]) / 365);\n\t }\n\t return result;\n\t};\n\t\n\t// TODO\n\texports.YIELD = function() {\n\t throw new Error('YIELD is not implemented');\n\t};\n\t\n\t// TODO\n\texports.YIELDDISC = function() {\n\t throw new Error('YIELDDISC is not implemented');\n\t};\n\t\n\t// TODO\n\texports.YIELDMAT = function() {\n\t throw new Error('YIELDMAT is not implemented');\n\t};\n\n\n/***/ },\n/* 31 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar error = __webpack_require__(16);\n\t\n\texports.MATCH = function(lookupValue, lookupArray, matchType) {\n\t if (!lookupValue && !lookupArray) {\n\t return error.na;\n\t }\n\t\n\t if (arguments.length === 2) {\n\t matchType = 1;\n\t }\n\t if (!(lookupArray instanceof Array)) {\n\t return error.na;\n\t }\n\t\n\t if (matchType !== -1 && matchType !== 0 && matchType !== 1) {\n\t return error.na;\n\t }\n\t var index;\n\t var indexValue;\n\t for (var idx = 0; idx < lookupArray.length; idx++) {\n\t if (matchType === 1) {\n\t if (lookupArray[idx] === lookupValue) {\n\t return idx + 1;\n\t } else if (lookupArray[idx] < lookupValue) {\n\t if (!indexValue) {\n\t index = idx + 1;\n\t indexValue = lookupArray[idx];\n\t } else if (lookupArray[idx] > indexValue) {\n\t index = idx + 1;\n\t indexValue = lookupArray[idx];\n\t }\n\t }\n\t } else if (matchType === 0) {\n\t if (typeof lookupValue === 'string') {\n\t lookupValue = lookupValue.replace(/\\?/g, '.');\n\t if (lookupArray[idx].toLowerCase().match(lookupValue.toLowerCase())) {\n\t return idx + 1;\n\t }\n\t } else {\n\t if (lookupArray[idx] === lookupValue) {\n\t return idx + 1;\n\t }\n\t }\n\t } else if (matchType === -1) {\n\t if (lookupArray[idx] === lookupValue) {\n\t return idx + 1;\n\t } else if (lookupArray[idx] > lookupValue) {\n\t if (!indexValue) {\n\t index = idx + 1;\n\t indexValue = lookupArray[idx];\n\t } else if (lookupArray[idx] < indexValue) {\n\t index = idx + 1;\n\t indexValue = lookupArray[idx];\n\t }\n\t }\n\t }\n\t }\n\t\n\t return index ? index : error.na;\n\t};\n\n/***/ },\n/* 32 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = func;\n\tvar SYMBOL = exports.SYMBOL = '>';\n\t\n\tfunction func(exp1, exp2) {\n\t return exp1 > exp2;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 33 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = func;\n\tvar SYMBOL = exports.SYMBOL = '>=';\n\t\n\tfunction func(exp1, exp2) {\n\t return exp1 >= exp2;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 34 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = func;\n\tvar SYMBOL = exports.SYMBOL = '<';\n\t\n\tfunction func(exp1, exp2) {\n\t return exp1 < exp2;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 35 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = func;\n\tvar SYMBOL = exports.SYMBOL = '<=';\n\t\n\tfunction func(exp1, exp2) {\n\t return exp1 <= exp2;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 36 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.SYMBOL = undefined;\n\texports.default = func;\n\t\n\tvar _number = __webpack_require__(6);\n\t\n\tvar _error = __webpack_require__(7);\n\t\n\tvar SYMBOL = exports.SYMBOL = '-';\n\t\n\tfunction func(first) {\n\t for (var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t rest[_key - 1] = arguments[_key];\n\t }\n\t\n\t var result = rest.reduce(function (acc, value) {\n\t return acc - (0, _number.toNumber)(value);\n\t }, (0, _number.toNumber)(first));\n\t\n\t if (isNaN(result)) {\n\t throw Error(_error.ERROR_VALUE);\n\t }\n\t\n\t return result;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 37 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.SYMBOL = undefined;\n\texports.default = func;\n\t\n\tvar _number = __webpack_require__(6);\n\t\n\tvar _error = __webpack_require__(7);\n\t\n\tvar SYMBOL = exports.SYMBOL = '*';\n\t\n\tfunction func(first) {\n\t for (var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t rest[_key - 1] = arguments[_key];\n\t }\n\t\n\t var result = rest.reduce(function (acc, value) {\n\t return acc * (0, _number.toNumber)(value);\n\t }, (0, _number.toNumber)(first));\n\t\n\t if (isNaN(result)) {\n\t throw Error(_error.ERROR_VALUE);\n\t }\n\t\n\t return result;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 38 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = func;\n\tvar SYMBOL = exports.SYMBOL = '<>';\n\t\n\tfunction func(exp1, exp2) {\n\t return exp1 !== exp2;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 39 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.SYMBOL = undefined;\n\texports.default = func;\n\t\n\tvar _number = __webpack_require__(6);\n\t\n\tvar _error = __webpack_require__(7);\n\t\n\tvar SYMBOL = exports.SYMBOL = '^';\n\t\n\tfunction func(exp1, exp2) {\n\t var result = Math.pow((0, _number.toNumber)(exp1), (0, _number.toNumber)(exp2));\n\t\n\t if (isNaN(result)) {\n\t throw Error(_error.ERROR_VALUE);\n\t }\n\t\n\t return result;\n\t};\n\t\n\tfunc.SYMBOL = SYMBOL;\n\n/***/ },\n/* 40 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(module, process) {\"use strict\";\n\t\n\t/* parser generated by jison 0.4.17 */\n\t/*\n\t Returns a Parser object of the following structure:\n\t\n\t Parser: {\n\t yy: {}\n\t }\n\t\n\t Parser.prototype: {\n\t yy: {},\n\t trace: function(),\n\t symbols_: {associative list: name ==> number},\n\t terminals_: {associative list: number ==> name},\n\t productions_: [...],\n\t performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n\t table: [...],\n\t defaultActions: {...},\n\t parseError: function(str, hash),\n\t parse: function(input),\n\t\n\t lexer: {\n\t EOF: 1,\n\t parseError: function(str, hash),\n\t setInput: function(input),\n\t input: function(),\n\t unput: function(str),\n\t more: function(),\n\t less: function(n),\n\t pastInput: function(),\n\t upcomingInput: function(),\n\t showPosition: function(),\n\t test_match: function(regex_match_array, rule_index),\n\t next: function(),\n\t lex: function(),\n\t begin: function(condition),\n\t popState: function(),\n\t _currentRules: function(),\n\t topState: function(),\n\t pushState: function(condition),\n\t\n\t options: {\n\t ranges: boolean (optional: true ==> token location info will include a .range[] member)\n\t flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n\t backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n\t },\n\t\n\t performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n\t rules: [...],\n\t conditions: {associative list: name ==> set},\n\t }\n\t }\n\t\n\t\n\t token location info (@$, _$, etc.): {\n\t first_line: n,\n\t last_line: n,\n\t first_column: n,\n\t last_column: n,\n\t range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n\t }\n\t\n\t\n\t the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n\t text: (matched text)\n\t token: (the produced terminal token, if any)\n\t line: (yylineno)\n\t }\n\t while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n\t loc: (yylloc)\n\t expected: (string describing the set of expected tokens)\n\t recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n\t }\n\t*/\n\tvar parser = function () {\n\t var o = function o(k, v, _o, l) {\n\t for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;\n\t },\n\t $V0 = [1, 5],\n\t $V1 = [1, 8],\n\t $V2 = [1, 6],\n\t $V3 = [1, 7],\n\t $V4 = [1, 9],\n\t $V5 = [1, 14],\n\t $V6 = [1, 15],\n\t $V7 = [1, 16],\n\t $V8 = [1, 12],\n\t $V9 = [1, 13],\n\t $Va = [1, 17],\n\t $Vb = [1, 19],\n\t $Vc = [1, 20],\n\t $Vd = [1, 21],\n\t $Ve = [1, 22],\n\t $Vf = [1, 23],\n\t $Vg = [1, 24],\n\t $Vh = [1, 25],\n\t $Vi = [1, 26],\n\t $Vj = [1, 27],\n\t $Vk = [1, 28],\n\t $Vl = [5, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30],\n\t $Vm = [5, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30, 32],\n\t $Vn = [1, 37],\n\t $Vo = [5, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30, 34],\n\t $Vp = [5, 10, 11, 13, 14, 15, 16, 17, 29, 30],\n\t $Vq = [5, 10, 13, 14, 15, 16, 29, 30],\n\t $Vr = [5, 10, 11, 13, 14, 15, 16, 17, 18, 19, 29, 30],\n\t $Vs = [13, 29, 30],\n\t $Vt = [5, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30, 31, 35];\n\t var parser = { trace: function trace() {},\n\t yy: {},\n\t symbols_: { \"error\": 2, \"expressions\": 3, \"expression\": 4, \"EOF\": 5, \"variableSequence\": 6, \"number\": 7, \"STRING\": 8, \"&\": 9, \"=\": 10, \"+\": 11, \"(\": 12, \")\": 13, \"<\": 14, \">\": 15, \"NOT\": 16, \"-\": 17, \"*\": 18, \"/\": 19, \"^\": 20, \"FUNCTION\": 21, \"expseq\": 22, \"cell\": 23, \"ABSOLUTE_CELL\": 24, \"RELATIVE_CELL\": 25, \"MIXED_CELL\": 26, \":\": 27, \"ARRAY\": 28, \";\": 29, \",\": 30, \"VARIABLE\": 31, \"DECIMAL\": 32, \"NUMBER\": 33, \"%\": 34, \"#\": 35, \"!\": 36, \"$accept\": 0, \"$end\": 1 },\n\t terminals_: { 5: \"EOF\", 8: \"STRING\", 9: \"&\", 10: \"=\", 11: \"+\", 12: \"(\", 13: \")\", 14: \"<\", 15: \">\", 16: \"NOT\", 17: \"-\", 18: \"*\", 19: \"/\", 20: \"^\", 21: \"FUNCTION\", 24: \"ABSOLUTE_CELL\", 25: \"RELATIVE_CELL\", 26: \"MIXED_CELL\", 27: \":\", 28: \"ARRAY\", 29: \";\", 30: \",\", 31: \"VARIABLE\", 32: \"DECIMAL\", 33: \"NUMBER\", 34: \"%\", 35: \"#\", 36: \"!\" },\n\t productions_: [0, [3, 2], [4, 1], [4, 1], [4, 1], [4, 3], [4, 3], [4, 3], [4, 3], [4, 4], [4, 4], [4, 4], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 2], [4, 2], [4, 3], [4, 4], [4, 1], [4, 1], [4, 2], [23, 1], [23, 1], [23, 1], [23, 3], [23, 3], [23, 3], [23, 3], [23, 3], [23, 3], [23, 3], [23, 3], [23, 3], [22, 1], [22, 1], [22, 3], [22, 3], [6, 1], [6, 3], [7, 1], [7, 3], [7, 2], [2, 3], [2, 4]],\n\t performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n\t /* this == yyval */\n\t\n\t var $0 = $$.length - 1;\n\t switch (yystate) {\n\t case 1:\n\t\n\t return $$[$0 - 1];\n\t\n\t break;\n\t case 2:\n\t\n\t this.$ = yy.callVariable($$[$0][0]);\n\t\n\t break;\n\t case 3:\n\t\n\t this.$ = yy.toNumber($$[$0]);\n\t\n\t break;\n\t case 4:\n\t\n\t this.$ = yy.trimEdges($$[$0]);\n\t\n\t break;\n\t case 5:\n\t\n\t this.$ = yy.evaluateByOperator('&', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 6:\n\t\n\t this.$ = yy.evaluateByOperator('=', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 7:\n\t\n\t this.$ = yy.evaluateByOperator('+', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 8:\n\t\n\t this.$ = yy.toNumber($$[$0 - 1]);\n\t\n\t break;\n\t case 9:\n\t\n\t this.$ = yy.evaluateByOperator('<=', [$$[$0 - 3], $$[$0]]);\n\t\n\t break;\n\t case 10:\n\t\n\t this.$ = yy.evaluateByOperator('>=', [$$[$0 - 3], $$[$0]]);\n\t\n\t break;\n\t case 11:\n\t\n\t this.$ = yy.evaluateByOperator('<>', [$$[$0 - 3], $$[$0]]);\n\t\n\t break;\n\t case 12:\n\t\n\t this.$ = yy.evaluateByOperator('NOT', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 13:\n\t\n\t this.$ = yy.evaluateByOperator('>', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 14:\n\t\n\t this.$ = yy.evaluateByOperator('<', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 15:\n\t\n\t this.$ = yy.evaluateByOperator('-', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 16:\n\t\n\t this.$ = yy.evaluateByOperator('*', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 17:\n\t\n\t this.$ = yy.evaluateByOperator('/', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 18:\n\t\n\t this.$ = yy.evaluateByOperator('^', [$$[$0 - 2], $$[$0]]);\n\t\n\t break;\n\t case 19:\n\t\n\t var n1 = yy.invertNumber($$[$0]);\n\t\n\t this.$ = n1;\n\t\n\t if (isNaN(this.$)) {\n\t this.$ = 0;\n\t }\n\t\n\t break;\n\t case 20:\n\t\n\t var n1 = yy.toNumber($$[$0]);\n\t\n\t this.$ = n1;\n\t\n\t if (isNaN(this.$)) {\n\t this.$ = 0;\n\t }\n\t\n\t break;\n\t case 21:\n\t\n\t this.$ = yy.callFunction($$[$0 - 2]);\n\t\n\t break;\n\t case 22:\n\t\n\t this.$ = yy.callFunction($$[$0 - 3], $$[$0 - 1]);\n\t\n\t break;\n\t case 26:case 27:case 28:\n\t\n\t this.$ = yy.cellValue($$[$0]);\n\t\n\t break;\n\t case 29:case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:\n\t\n\t this.$ = yy.rangeValue($$[$0 - 2], $$[$0]);\n\t\n\t break;\n\t case 38:case 42:\n\t\n\t this.$ = [$$[$0]];\n\t\n\t break;\n\t case 39:\n\t\n\t var result = [];\n\t var arr = eval(\"[\" + yytext + \"]\");\n\t\n\t arr.forEach(function (item) {\n\t result.push(item);\n\t });\n\t\n\t this.$ = result;\n\t\n\t break;\n\t case 40:case 41:\n\t\n\t $$[$0 - 2].push($$[$0]);\n\t this.$ = $$[$0 - 2];\n\t\n\t break;\n\t case 43:\n\t\n\t this.$ = Array.isArray($$[$0 - 2]) ? $$[$0 - 2] : [$$[$0 - 2]];\n\t this.$.push($$[$0]);\n\t\n\t break;\n\t case 44:\n\t\n\t this.$ = $$[$0];\n\t\n\t break;\n\t case 45:\n\t\n\t this.$ = ($$[$0 - 2] + '.' + $$[$0]) * 1;\n\t\n\t break;\n\t case 46:\n\t\n\t this.$ = $$[$0 - 1] * 0.01;\n\t\n\t break;\n\t case 47:case 48:\n\t\n\t this.$ = yy.throwError($$[$0 - 2] + $$[$0 - 1] + $$[$0]);\n\t\n\t break;\n\t }\n\t },\n\t table: [{ 2: 11, 3: 1, 4: 2, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 1: [3] }, { 5: [1, 18], 9: $Vb, 10: $Vc, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }, o($Vl, [2, 2], { 32: [1, 29] }), o($Vl, [2, 3], { 34: [1, 30] }), o($Vl, [2, 4]), { 2: 11, 4: 31, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 32, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 33, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 12: [1, 34] }, o($Vl, [2, 23]), o($Vl, [2, 24], { 2: 35, 31: [1, 36], 35: $Va }), o($Vm, [2, 42], { 35: $Vn }), o($Vo, [2, 44], { 32: [1, 38] }), o($Vl, [2, 26], { 27: [1, 39] }), o($Vl, [2, 27], { 27: [1, 40] }), o($Vl, [2, 28], { 27: [1, 41] }), { 31: [1, 42] }, { 1: [2, 1] }, { 2: 11, 4: 43, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 44, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 45, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 48, 6: 3, 7: 4, 8: $V0, 10: [1, 46], 11: $V1, 12: $V2, 15: [1, 47], 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 50, 6: 3, 7: 4, 8: $V0, 10: [1, 49], 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 51, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 52, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 53, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 54, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 55, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 31: [1, 56] }, o($Vo, [2, 46]), { 9: $Vb, 10: $Vc, 11: $Vd, 13: [1, 57], 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }, o($Vp, [2, 19], { 9: $Vb, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vp, [2, 20], { 9: $Vb, 18: $Vi, 19: $Vj, 20: $Vk }), { 2: 11, 4: 60, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 13: [1, 58], 17: $V3, 21: $V4, 22: 59, 23: 10, 24: $V5, 25: $V6, 26: $V7, 28: [1, 61], 31: $V8, 33: $V9, 35: $Va }, o($Vl, [2, 25]), { 35: $Vn }, { 31: [1, 62] }, { 33: [1, 63] }, { 24: [1, 64], 25: [1, 65], 26: [1, 66] }, { 24: [1, 67], 25: [1, 68], 26: [1, 69] }, { 24: [1, 70], 25: [1, 71], 26: [1, 72] }, { 36: [1, 73] }, o($Vl, [2, 5]), o([5, 10, 13, 29, 30], [2, 6], { 9: $Vb, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vp, [2, 7], { 9: $Vb, 18: $Vi, 19: $Vj, 20: $Vk }), { 2: 11, 4: 74, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 75, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, o($Vq, [2, 14], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), { 2: 11, 4: 76, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, o($Vq, [2, 13], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o([5, 10, 13, 16, 29, 30], [2, 12], { 9: $Vb, 11: $Vd, 14: $Ve, 15: $Vf, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vp, [2, 15], { 9: $Vb, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vr, [2, 16], { 9: $Vb, 20: $Vk }), o($Vr, [2, 17], { 9: $Vb, 20: $Vk }), o([5, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30], [2, 18], { 9: $Vb }), o($Vm, [2, 43]), o($Vl, [2, 8]), o($Vl, [2, 21]), { 13: [1, 77], 29: [1, 78], 30: [1, 79] }, o($Vs, [2, 38], { 9: $Vb, 10: $Vc, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vs, [2, 39]), { 36: [1, 80] }, o($Vo, [2, 45]), o($Vl, [2, 29]), o($Vl, [2, 30]), o($Vl, [2, 31]), o($Vl, [2, 32]), o($Vl, [2, 33]), o($Vl, [2, 34]), o($Vl, [2, 35]), o($Vl, [2, 36]), o($Vl, [2, 37]), o($Vt, [2, 47]), o($Vq, [2, 9], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vq, [2, 11], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vq, [2, 10], { 9: $Vb, 11: $Vd, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vl, [2, 22]), { 2: 11, 4: 81, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, { 2: 11, 4: 82, 6: 3, 7: 4, 8: $V0, 11: $V1, 12: $V2, 17: $V3, 21: $V4, 23: 10, 24: $V5, 25: $V6, 26: $V7, 31: $V8, 33: $V9, 35: $Va }, o($Vt, [2, 48]), o($Vs, [2, 40], { 9: $Vb, 10: $Vc, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk }), o($Vs, [2, 41], { 9: $Vb, 10: $Vc, 11: $Vd, 14: $Ve, 15: $Vf, 16: $Vg, 17: $Vh, 18: $Vi, 19: $Vj, 20: $Vk })],\n\t defaultActions: { 18: [2, 1] },\n\t parseError: function parseError(str, hash) {\n\t if (hash.recoverable) {\n\t this.trace(str);\n\t } else {\n\t var _parseError = function _parseError(msg, hash) {\n\t this.message = msg;\n\t this.hash = hash;\n\t };\n\t\n\t _parseError.prototype = Error;\n\t\n\t throw new _parseError(str, hash);\n\t }\n\t },\n\t parse: function parse(input) {\n\t var self = this,\n\t stack = [0],\n\t tstack = [],\n\t // token stack\n\t vstack = [null],\n\t // semantic value stack\n\t lstack = [],\n\t // location stack\n\t table = this.table,\n\t yytext = '',\n\t yylineno = 0,\n\t yyleng = 0,\n\t recovering = 0,\n\t TERROR = 2,\n\t EOF = 1;\n\t\n\t var args = lstack.slice.call(arguments, 1);\n\t\n\t //this.reductionCount = this.shiftCount = 0;\n\t\n\t var lexer = Object.create(this.lexer);\n\t var sharedState = { yy: {} };\n\t // copy state\n\t for (var k in this.yy) {\n\t if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n\t sharedState.yy[k] = this.yy[k];\n\t }\n\t }\n\t\n\t lexer.setInput(input, sharedState.yy);\n\t sharedState.yy.lexer = lexer;\n\t sharedState.yy.parser = this;\n\t if (typeof lexer.yylloc == 'undefined') {\n\t lexer.yylloc = {};\n\t }\n\t var yyloc = lexer.yylloc;\n\t lstack.push(yyloc);\n\t\n\t var ranges = lexer.options && lexer.options.ranges;\n\t\n\t if (typeof sharedState.yy.parseError === 'function') {\n\t this.parseError = sharedState.yy.parseError;\n\t } else {\n\t this.parseError = Object.getPrototypeOf(this).parseError;\n\t }\n\t\n\t function popStack(n) {\n\t stack.length = stack.length - 2 * n;\n\t vstack.length = vstack.length - n;\n\t lstack.length = lstack.length - n;\n\t }\n\t\n\t _token_stack: var lex = function lex() {\n\t var token;\n\t token = lexer.lex() || EOF;\n\t // if token isn't its numeric value, convert\n\t if (typeof token !== 'number') {\n\t token = self.symbols_[token] || token;\n\t }\n\t return token;\n\t };\n\t\n\t var symbol,\n\t preErrorSymbol,\n\t state,\n\t action,\n\t a,\n\t r,\n\t yyval = {},\n\t p,\n\t len,\n\t newState,\n\t expected;\n\t while (true) {\n\t // retreive state number from top of stack\n\t state = stack[stack.length - 1];\n\t\n\t // use default actions if available\n\t if (this.defaultActions[state]) {\n\t action = this.defaultActions[state];\n\t } else {\n\t if (symbol === null || typeof symbol == 'undefined') {\n\t symbol = lex();\n\t }\n\t // read action for current state and first input\n\t action = table[state] && table[state][symbol];\n\t }\n\t\n\t _handle_error:\n\t // handle parse error\n\t if (typeof action === 'undefined' || !action.length || !action[0]) {\n\t\n\t // Return the rule stack depth where the nearest error rule can be found.\n\t // Return FALSE when no error recovery rule was found.\n\t var locateNearestErrorRecoveryRule = function locateNearestErrorRecoveryRule(state) {\n\t var stack_probe = stack.length - 1;\n\t var depth = 0;\n\t\n\t // try to recover from error\n\t for (;;) {\n\t // check for error recovery rule in this state\n\t if (TERROR.toString() in table[state]) {\n\t return depth;\n\t }\n\t if (state === 0 || stack_probe < 2) {\n\t return false; // No suitable error recovery rule available.\n\t }\n\t stack_probe -= 2; // popStack(1): [symbol, action]\n\t state = stack[stack_probe];\n\t ++depth;\n\t }\n\t };\n\t\n\t var error_rule_depth;\n\t var errStr = '';\n\t\n\t if (!recovering) {\n\t // first see if there's any chance at hitting an error recovery rule:\n\t error_rule_depth = locateNearestErrorRecoveryRule(state);\n\t\n\t // Report error\n\t expected = [];\n\t for (p in table[state]) {\n\t if (this.terminals_[p] && p > TERROR) {\n\t expected.push(\"'\" + this.terminals_[p] + \"'\");\n\t }\n\t }\n\t if (lexer.showPosition) {\n\t errStr = 'Parse error on line ' + (yylineno + 1) + \":\\n\" + lexer.showPosition() + \"\\nExpecting \" + expected.join(', ') + \", got '\" + (this.terminals_[symbol] || symbol) + \"'\";\n\t } else {\n\t errStr = 'Parse error on line ' + (yylineno + 1) + \": Unexpected \" + (symbol == EOF ? \"end of input\" : \"'\" + (this.terminals_[symbol] || symbol) + \"'\");\n\t }\n\t this.parseError(errStr, {\n\t text: lexer.match,\n\t token: this.terminals_[symbol] || symbol,\n\t line: lexer.yylineno,\n\t loc: yyloc,\n\t expected: expected,\n\t recoverable: error_rule_depth !== false\n\t });\n\t } else if (preErrorSymbol !== EOF) {\n\t error_rule_depth = locateNearestErrorRecoveryRule(state);\n\t }\n\t\n\t // just recovered from another error\n\t if (recovering == 3) {\n\t if (symbol === EOF || preErrorSymbol === EOF) {\n\t throw new Error(errStr || 'Parsing halted while starting to recover from another error.');\n\t }\n\t\n\t // discard current lookahead and grab another\n\t yyleng = lexer.yyleng;\n\t yytext = lexer.yytext;\n\t yylineno = lexer.yylineno;\n\t yyloc = lexer.yylloc;\n\t symbol = lex();\n\t }\n\t\n\t // try to recover from error\n\t if (error_rule_depth === false) {\n\t throw new Error(errStr || 'Parsing halted. No suitable error recovery rule available.');\n\t }\n\t popStack(error_rule_depth);\n\t\n\t preErrorSymbol = symbol == TERROR ? null : symbol; // save the lookahead token\n\t symbol = TERROR; // insert generic error symbol as new lookahead\n\t state = stack[stack.length - 1];\n\t action = table[state] && table[state][TERROR];\n\t recovering = 3; // allow 3 real symbols to be shifted before reporting a new error\n\t }\n\t\n\t // this shouldn't happen, unless resolve defaults are off\n\t if (action[0] instanceof Array && action.length > 1) {\n\t throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n\t }\n\t\n\t switch (action[0]) {\n\t case 1:\n\t // shift\n\t //this.shiftCount++;\n\t\n\t stack.push(symbol);\n\t vstack.push(lexer.yytext);\n\t lstack.push(lexer.yylloc);\n\t stack.push(action[1]); // push state\n\t symbol = null;\n\t if (!preErrorSymbol) {\n\t // normal execution/no error\n\t yyleng = lexer.yyleng;\n\t yytext = lexer.yytext;\n\t yylineno = lexer.yylineno;\n\t yyloc = lexer.yylloc;\n\t if (recovering > 0) {\n\t recovering--;\n\t }\n\t } else {\n\t // error just occurred, resume old lookahead f/ before error\n\t symbol = preErrorSymbol;\n\t preErrorSymbol = null;\n\t }\n\t break;\n\t\n\t case 2:\n\t // reduce\n\t //this.reductionCount++;\n\t\n\t len = this.productions_[action[1]][1];\n\t\n\t // perform semantic action\n\t yyval.$ = vstack[vstack.length - len]; // default to $$ = $1\n\t // default location, uses first token for firsts, last for lasts\n\t yyval._$ = {\n\t first_line: lstack[lstack.length - (len || 1)].first_line,\n\t last_line: lstack[lstack.length - 1].last_line,\n\t first_column: lstack[lstack.length - (len || 1)].first_column,\n\t last_column: lstack[lstack.length - 1].last_column\n\t };\n\t if (ranges) {\n\t yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];\n\t }\n\t r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));\n\t\n\t if (typeof r !== 'undefined') {\n\t return r;\n\t }\n\t\n\t // pop off stack\n\t if (len) {\n\t stack = stack.slice(0, -1 * len * 2);\n\t vstack = vstack.slice(0, -1 * len);\n\t lstack = lstack.slice(0, -1 * len);\n\t }\n\t\n\t stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)\n\t vstack.push(yyval.$);\n\t lstack.push(yyval._$);\n\t // goto new state = table[STATE][NONTERMINAL]\n\t newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n\t stack.push(newState);\n\t break;\n\t\n\t case 3:\n\t // accept\n\t return true;\n\t }\n\t }\n\t\n\t return true;\n\t } };\n\t\n\t /* generated by jison-lex 0.3.4 */\n\t var lexer = function () {\n\t var lexer = {\n\t\n\t EOF: 1,\n\t\n\t parseError: function parseError(str, hash) {\n\t if (this.yy.parser) {\n\t this.yy.parser.parseError(str, hash);\n\t } else {\n\t throw new Error(str);\n\t }\n\t },\n\t\n\t // resets the lexer, sets new input\n\t setInput: function setInput(input, yy) {\n\t this.yy = yy || this.yy || {};\n\t this._input = input;\n\t this._more = this._backtrack = this.done = false;\n\t this.yylineno = this.yyleng = 0;\n\t this.yytext = this.matched = this.match = '';\n\t this.conditionStack = ['INITIAL'];\n\t this.yylloc = {\n\t first_line: 1,\n\t first_column: 0,\n\t last_line: 1,\n\t last_column: 0\n\t };\n\t if (this.options.ranges) {\n\t this.yylloc.range = [0, 0];\n\t }\n\t this.offset = 0;\n\t return this;\n\t },\n\t\n\t // consumes and returns one char from the input\n\t input: function input() {\n\t var ch = this._input[0];\n\t this.yytext += ch;\n\t this.yyleng++;\n\t this.offset++;\n\t this.match += ch;\n\t this.matched += ch;\n\t var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n\t if (lines) {\n\t this.yylineno++;\n\t this.yylloc.last_line++;\n\t } else {\n\t this.yylloc.last_column++;\n\t }\n\t if (this.options.ranges) {\n\t this.yylloc.range[1]++;\n\t }\n\t\n\t this._input = this._input.slice(1);\n\t return ch;\n\t },\n\t\n\t // unshifts one char (or a string) into the input\n\t unput: function unput(ch) {\n\t var len = ch.length;\n\t var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\t\n\t this._input = ch + this._input;\n\t this.yytext = this.yytext.substr(0, this.yytext.length - len);\n\t //this.yyleng -= len;\n\t this.offset -= len;\n\t var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n\t this.match = this.match.substr(0, this.match.length - 1);\n\t this.matched = this.matched.substr(0, this.matched.length - 1);\n\t\n\t if (lines.length - 1) {\n\t this.yylineno -= lines.length - 1;\n\t }\n\t var r = this.yylloc.range;\n\t\n\t this.yylloc = {\n\t first_line: this.yylloc.first_line,\n\t last_line: this.yylineno + 1,\n\t first_column: this.yylloc.first_column,\n\t last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len\n\t };\n\t\n\t if (this.options.ranges) {\n\t this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n\t }\n\t this.yyleng = this.yytext.length;\n\t return this;\n\t },\n\t\n\t // When called from action, caches matched text and appends it on next action\n\t more: function more() {\n\t this._more = true;\n\t return this;\n\t },\n\t\n\t // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\n\t reject: function reject() {\n\t if (this.options.backtrack_lexer) {\n\t this._backtrack = true;\n\t } else {\n\t return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n\t text: \"\",\n\t token: null,\n\t line: this.yylineno\n\t });\n\t }\n\t return this;\n\t },\n\t\n\t // retain first n characters of the match\n\t less: function less(n) {\n\t this.unput(this.match.slice(n));\n\t },\n\t\n\t // displays already matched input, i.e. for error messages\n\t pastInput: function pastInput() {\n\t var past = this.matched.substr(0, this.matched.length - this.match.length);\n\t return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\\n/g, \"\");\n\t },\n\t\n\t // displays upcoming input, i.e. for error messages\n\t upcomingInput: function upcomingInput() {\n\t var next = this.match;\n\t if (next.length < 20) {\n\t next += this._input.substr(0, 20 - next.length);\n\t }\n\t return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n\t },\n\t\n\t // displays the character position where the lexing error occurred, i.e. for error messages\n\t showPosition: function showPosition() {\n\t var pre = this.pastInput();\n\t var c = new Array(pre.length + 1).join(\"-\");\n\t return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n\t },\n\t\n\t // test the lexed token: return FALSE when not a match, otherwise return token\n\t test_match: function test_match(match, indexed_rule) {\n\t var token, lines, backup;\n\t\n\t if (this.options.backtrack_lexer) {\n\t // save context\n\t backup = {\n\t yylineno: this.yylineno,\n\t yylloc: {\n\t first_line: this.yylloc.first_line,\n\t last_line: this.last_line,\n\t first_column: this.yylloc.first_column,\n\t last_column: this.yylloc.last_column\n\t },\n\t yytext: this.yytext,\n\t match: this.match,\n\t matches: this.matches,\n\t matched: this.matched,\n\t yyleng: this.yyleng,\n\t offset: this.offset,\n\t _more: this._more,\n\t _input: this._input,\n\t yy: this.yy,\n\t conditionStack: this.conditionStack.slice(0),\n\t done: this.done\n\t };\n\t if (this.options.ranges) {\n\t backup.yylloc.range = this.yylloc.range.slice(0);\n\t }\n\t }\n\t\n\t lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n\t if (lines) {\n\t this.yylineno += lines.length;\n\t }\n\t this.yylloc = {\n\t first_line: this.yylloc.last_line,\n\t last_line: this.yylineno + 1,\n\t first_column: this.yylloc.last_column,\n\t last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length : this.yylloc.last_column + match[0].length\n\t };\n\t this.yytext += match[0];\n\t this.match += match[0];\n\t this.matches = match;\n\t this.yyleng = this.yytext.length;\n\t if (this.options.ranges) {\n\t this.yylloc.range = [this.offset, this.offset += this.yyleng];\n\t }\n\t this._more = false;\n\t this._backtrack = false;\n\t this._input = this._input.slice(match[0].length);\n\t this.matched += match[0];\n\t token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n\t if (this.done && this._input) {\n\t this.done = false;\n\t }\n\t if (token) {\n\t return token;\n\t } else if (this._backtrack) {\n\t // recover context\n\t for (var k in backup) {\n\t this[k] = backup[k];\n\t }\n\t return false; // rule action called reject() implying the next rule should be tested instead.\n\t }\n\t return false;\n\t },\n\t\n\t // return next match in input\n\t next: function next() {\n\t if (this.done) {\n\t return this.EOF;\n\t }\n\t if (!this._input) {\n\t this.done = true;\n\t }\n\t\n\t var token, match, tempMatch, index;\n\t if (!this._more) {\n\t this.yytext = '';\n\t this.match = '';\n\t }\n\t var rules = this._currentRules();\n\t for (var i = 0; i < rules.length; i++) {\n\t tempMatch = this._input.match(this.rules[rules[i]]);\n\t if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n\t match = tempMatch;\n\t index = i;\n\t if (this.options.backtrack_lexer) {\n\t token = this.test_match(tempMatch, rules[i]);\n\t if (token !== false) {\n\t return token;\n\t } else if (this._backtrack) {\n\t match = false;\n\t continue; // rule action called reject() implying a rule MISmatch.\n\t } else {\n\t // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n\t return false;\n\t }\n\t } else if (!this.options.flex) {\n\t break;\n\t }\n\t }\n\t }\n\t if (match) {\n\t token = this.test_match(match, rules[index]);\n\t if (token !== false) {\n\t return token;\n\t }\n\t // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n\t return false;\n\t }\n\t if (this._input === \"\") {\n\t return this.EOF;\n\t } else {\n\t return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n\t text: \"\",\n\t token: null,\n\t line: this.yylineno\n\t });\n\t }\n\t },\n\t\n\t // return next match that has a token\n\t lex: function lex() {\n\t var r = this.next();\n\t if (r) {\n\t return r;\n\t } else {\n\t return this.lex();\n\t }\n\t },\n\t\n\t // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\n\t begin: function begin(condition) {\n\t this.conditionStack.push(condition);\n\t },\n\t\n\t // pop the previously active lexer condition state off the condition stack\n\t popState: function popState() {\n\t var n = this.conditionStack.length - 1;\n\t if (n > 0) {\n\t return this.conditionStack.pop();\n\t } else {\n\t return this.conditionStack[0];\n\t }\n\t },\n\t\n\t // produce the lexer rule set which is active for the currently active lexer condition state\n\t _currentRules: function _currentRules() {\n\t if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n\t return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n\t } else {\n\t return this.conditions[\"INITIAL\"].rules;\n\t }\n\t },\n\t\n\t // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\n\t topState: function topState(n) {\n\t n = this.conditionStack.length - 1 - Math.abs(n || 0);\n\t if (n >= 0) {\n\t return this.conditionStack[n];\n\t } else {\n\t return \"INITIAL\";\n\t }\n\t },\n\t\n\t // alias for begin(condition)\n\t pushState: function pushState(condition) {\n\t this.begin(condition);\n\t },\n\t\n\t // return the number of states currently on the stack\n\t stateStackSize: function stateStackSize() {\n\t return this.conditionStack.length;\n\t },\n\t options: {},\n\t performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {\n\t var YYSTATE = YY_START;\n\t switch ($avoiding_name_collisions) {\n\t case 0:\n\t /* skip whitespace */\n\t break;\n\t case 1:\n\t return 8;\n\t break;\n\t case 2:\n\t return 8;\n\t break;\n\t case 3:\n\t return 21;\n\t break;\n\t case 4:\n\t return 24;\n\t break;\n\t case 5:\n\t return 26;\n\t break;\n\t case 6:\n\t return 26;\n\t break;\n\t case 7:\n\t return 25;\n\t break;\n\t case 8:\n\t return 21;\n\t break;\n\t case 9:\n\t return 31;\n\t break;\n\t case 10:\n\t return 31;\n\t break;\n\t case 11:\n\t return 33;\n\t break;\n\t case 12:\n\t return 28;\n\t break;\n\t case 13:\n\t /* skip whitespace */\n\t break;\n\t case 14:\n\t return 9;\n\t break;\n\t case 15:\n\t return ' ';\n\t break;\n\t case 16:\n\t return 32;\n\t break;\n\t case 17:\n\t return 27;\n\t break;\n\t case 18:\n\t return 29;\n\t break;\n\t case 19:\n\t return 30;\n\t break;\n\t case 20:\n\t return 18;\n\t break;\n\t case 21:\n\t return 19;\n\t break;\n\t case 22:\n\t return 17;\n\t break;\n\t case 23:\n\t return 11;\n\t break;\n\t case 24:\n\t return 20;\n\t break;\n\t case 25:\n\t return 12;\n\t break;\n\t case 26:\n\t return 13;\n\t break;\n\t case 27:\n\t return 15;\n\t break;\n\t case 28:\n\t return 14;\n\t break;\n\t case 29:\n\t return 16;\n\t break;\n\t case 30:\n\t return '\"';\n\t break;\n\t case 31:\n\t return \"'\";\n\t break;\n\t case 32:\n\t return \"!\";\n\t break;\n\t case 33:\n\t return 10;\n\t break;\n\t case 34:\n\t return 34;\n\t break;\n\t case 35:\n\t return 35;\n\t break;\n\t case 36:\n\t return 5;\n\t break;\n\t }\n\t },\n\t rules: [/^(?:\\s+)/, /^(?:\"(\\\\[\"]|[^\"])*\")/, /^(?:'(\\\\[']|[^'])*')/, /^(?:[A-Za-z]{1,}[A-Za-z_0-9\\.]+(?=[(]))/, /^(?:\\$[A-Za-z]+\\$[0-9]+)/, /^(?:\\$[A-Za-z]+[0-9]+)/, /^(?:[A-Za-z]+\\$[0-9]+)/, /^(?:[A-Za-z]+[0-9]+)/, /^(?:[A-Za-z\\.]+(?=[(]))/, /^(?:[A-Za-z]{1,}[A-Za-z_0-9]+)/, /^(?:[A-Za-z_]+)/, /^(?:[0-9]+)/, /^(?:\\[(.*)?\\])/, /^(?:\\$)/, /^(?:&)/, /^(?: )/, /^(?:[.])/, /^(?::)/, /^(?:;)/, /^(?:,)/, /^(?:\\*)/, /^(?:\\/)/, /^(?:-)/, /^(?:\\+)/, /^(?:\\^)/, /^(?:\\()/, /^(?:\\))/, /^(?:>)/, /^(?:<)/, /^(?:NOT\\b)/, /^(?:\")/, /^(?:')/, /^(?:!)/, /^(?:=)/, /^(?:%)/, /^(?:[#])/, /^(?:$)/],\n\t conditions: { \"INITIAL\": { \"rules\": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36], \"inclusive\": true } }\n\t };\n\t return lexer;\n\t }();\n\t parser.lexer = lexer;\n\t function Parser() {\n\t this.yy = {};\n\t }\n\t Parser.prototype = parser;parser.Parser = Parser;\n\t return new Parser();\n\t}();\n\t\n\tif (true) {\n\t exports.parser = parser;\n\t exports.Parser = parser.Parser;\n\t exports.parse = function () {\n\t return parser.parse.apply(parser, arguments);\n\t };\n\t\n\t if (typeof module !== 'undefined' && __webpack_require__.c[0] === module) {\n\t exports.main(process.argv.slice(1));\n\t }\n\t}\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(41)(module), __webpack_require__(20)))\n\n/***/ },\n/* 41 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ },\n/* 42 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.trimEdges = trimEdges;\n\t/**\n\t * Trim value by cutting character starting from the beginning and ending at the same time.\n\t *\n\t * @param {String} string String to trimming.\n\t * @param {Number} [margin=1] Number of character to cut.\n\t * @returns {String}\n\t */\n\tfunction trimEdges(string) {\n\t var margin = arguments.length <= 1 || arguments[1] === undefined ? 1 : arguments[1];\n\t\n\t string = string.substring(margin, string.length - margin);\n\t\n\t return string;\n\t}\n\n/***/ },\n/* 43 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\texports.extractLabel = extractLabel;\n\texports.toLabel = toLabel;\n\texports.columnLabelToIndex = columnLabelToIndex;\n\texports.columnIndexToLabel = columnIndexToLabel;\n\texports.rowLabelToIndex = rowLabelToIndex;\n\texports.rowIndexToLabel = rowIndexToLabel;\n\tvar LABEL_EXTRACT_REGEXP = /^([$])?([A-Za-z]+)([$])?([0-9]+)$/;\n\t\n\t/**\n\t * Extract cell coordinates.\n\t *\n\t * @param {String} label Cell coordinates (eq. 'A1', '$B6', '$N$98').\n\t * @returns {Array} Returns an array of objects.\n\t */\n\tfunction extractLabel(label) {\n\t if (!LABEL_EXTRACT_REGEXP.test(label)) {\n\t return [];\n\t }\n\t\n\t var _label$match = label.match(LABEL_EXTRACT_REGEXP);\n\t\n\t var _label$match2 = _slicedToArray(_label$match, 5);\n\t\n\t var columnAbs = _label$match2[1];\n\t var column = _label$match2[2];\n\t var rowAbs = _label$match2[3];\n\t var row = _label$match2[4];\n\t\n\t\n\t return [{\n\t index: rowLabelToIndex(row),\n\t label: row,\n\t isAbsolute: rowAbs === '$'\n\t }, {\n\t index: columnLabelToIndex(column),\n\t label: column,\n\t isAbsolute: columnAbs === '$'\n\t }];\n\t}\n\t\n\t/**\n\t * Convert row and column indexes into cell label.\n\t *\n\t * @param {Object} row Object with `index` and `isAbsolute` properties.\n\t * @param {Object} column Object with `index` and `isAbsolute` properties.\n\t * @returns {String} Returns cell label.\n\t */\n\tfunction toLabel(row, column) {\n\t var rowLabel = (row.isAbsolute ? '$' : '') + rowIndexToLabel(row.index);\n\t var columnLabel = (column.isAbsolute ? '$' : '') + columnIndexToLabel(column.index);\n\t\n\t return columnLabel + rowLabel;\n\t}\n\t\n\tvar COLUMN_LABEL_BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\tvar COLUMN_LABEL_BASE_LENGTH = COLUMN_LABEL_BASE.length;\n\t\n\t/**\n\t * Convert column label to index.\n\t *\n\t * @param {String} label Column label (eq. 'ABB', 'CNQ')\n\t * @returns {Number} Returns -1 if label is not recognized otherwise proper column index.\n\t */\n\tfunction columnLabelToIndex(label) {\n\t var result = 0;\n\t\n\t if (label) {\n\t for (var i = 0, j = label.length - 1; i < label.length; i += 1, j -= 1) {\n\t result += Math.pow(COLUMN_LABEL_BASE_LENGTH, j) * (COLUMN_LABEL_BASE.indexOf(label[i]) + 1);\n\t }\n\t }\n\t --result;\n\t\n\t return result;\n\t}\n\t\n\t/**\n\t * Convert column index to label.\n\t *\n\t * @param {Number} column Column index.\n\t * @returns {String} Returns column label (eq. 'ABB', 'CNQ').\n\t */\n\tfunction columnIndexToLabel(column) {\n\t var result = '';\n\t\n\t while (column >= 0) {\n\t result = String.fromCharCode(column % COLUMN_LABEL_BASE_LENGTH + 97) + result;\n\t column = Math.floor(column / COLUMN_LABEL_BASE_LENGTH) - 1;\n\t }\n\t\n\t return result.toUpperCase();\n\t}\n\t\n\t/**\n\t * Convert row label to index.\n\t *\n\t * @param {String} label Row label (eq. '1', '5')\n\t * @returns {Number} Returns -1 if label is not recognized otherwise proper row index.\n\t */\n\tfunction rowLabelToIndex(label) {\n\t var result = parseInt(label, 10);\n\t\n\t if (isNaN(result)) {\n\t result = -1;\n\t } else {\n\t result = Math.max(result - 1, -1);\n\t }\n\t\n\t return result;\n\t}\n\t\n\t/**\n\t * Convert row index to label.\n\t *\n\t * @param {Number} row Row index.\n\t * @returns {String} Returns row label (eq. '1', '7').\n\t */\n\tfunction rowIndexToLabel(row) {\n\t var result = '';\n\t\n\t if (row >= 0) {\n\t result = '' + (row + 1);\n\t }\n\t\n\t return result;\n\t}\n\n/***/ }\n/******/ ])\n});\n;\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/package.json b/package.json index 27b9823e..e21c0f53 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hot-formula-parser", - "version": "1.0.17", + "version": "1.0.18", "description": "Formula parser", "main": "dist/formula-parser.js", "scripts": {