squiggle/packages/squiggle-lang/dist/index.js

1368 lines
1.0 MiB
JavaScript
Raw Normal View History

2022-01-31 19:38:03 +00:00
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"Tpli":[function(require,module,exports) {
"use strict";function r(r,n,t){for(var o=new Array(t),e=0,u=n;e<t;)o[e]=r[u],e=e+1|0,u=u+1|0;return o}function n(r,n){for(;;){var t=n,o=r;if(!t)return o;n=t.tl,r=t.hd.length+o|0}}function t(r,n,t){for(;;){var o=t,e=n;if(!o)return;for(var u=o.hd,f=u.length,i=e,a=0;a<f;)r[i]=u[a],i=i+1|0,a=a+1|0;t=o.tl,n=i}}function o(r){var o=n(0,r),e=new Array(o);return t(e,0,r),e}function e(r,n,t){if(n<0||n>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"index out of bounds",Error:new Error};r[n]=t}function u(r,n){if(n<0||n>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"index out of bounds",Error:new Error};return r[n]}function f(r,n){for(var t=new Array(r),o=0;o<r;++o)t[o]=n;return t}function i(r){for(var n=new Array(r),t=0;t<r;++t)n[t]=0;return n}function a(r,n,t,o,e){if(o<=n)for(var u=0;u<e;++u)t[u+o|0]=r[u+n|0];else for(var f=e-1|0;f>=0;--f)t[f+o|0]=r[f+n|0]}function s(r){return r.slice(0)}exports.dup=s,exports.sub=r,exports.concat=o,exports.make=f,exports.make_float=i,exports.blit=a,exports.get=u,exports.set=e;
},{}],"NSLD":[function(require,module,exports) {
"use strict";var r=require("./caml_array.js");function n(e,t){for(;;){var u=t,c=e,s=c.length,a=0===s?1:s,i=a-u.length|0;if(0===i)return c.apply(null,u);if(i>=0)return function(r,e){return function(t){return n(r,e.concat([t]))}}(c,u);t=r.sub(u,a,0|-i),e=c.apply(null,r.sub(u,0,a))}}function e(r,e){var t=r.length;if(1===t)return r(e);switch(t){case 1:return r(e);case 2:return function(n){return r(e,n)};case 3:return function(n,t){return r(e,n,t)};case 4:return function(n,t,u){return r(e,n,t,u)};case 5:return function(n,t,u,c){return r(e,n,t,u,c)};case 6:return function(n,t,u,c,s){return r(e,n,t,u,c,s)};case 7:return function(n,t,u,c,s,a){return r(e,n,t,u,c,s,a)};default:return n(r,[e])}}function t(r){return 1===r.length?r:function(n){return e(r,n)}}function u(r,e,t){var u=r.length;if(2===u)return r(e,t);switch(u){case 1:return n(r(e),[t]);case 2:return r(e,t);case 3:return function(n){return r(e,t,n)};case 4:return function(n,u){return r(e,t,n,u)};case 5:return function(n,u,c){return r(e,t,n,u,c)};case 6:return function(n,u,c,s){return r(e,t,n,u,c,s)};case 7:return function(n,u,c,s,a){return r(e,t,n,u,c,s,a)};default:return n(r,[e,t])}}function c(r){return 2===r.length?r:function(n,e){return u(r,n,e)}}function s(r,e,t,u){var c=r.length;if(3===c)return r(e,t,u);switch(c){case 1:return n(r(e),[t,u]);case 2:return n(r(e,t),[u]);case 3:return r(e,t,u);case 4:return function(n){return r(e,t,u,n)};case 5:return function(n,c){return r(e,t,u,n,c)};case 6:return function(n,c,s){return r(e,t,u,n,c,s)};case 7:return function(n,c,s,a){return r(e,t,u,n,c,s,a)};default:return n(r,[e,t,u])}}function a(r){return 3===r.length?r:function(n,e,t){return s(r,n,e,t)}}function i(r,e,t,u,c){var s=r.length;if(4===s)return r(e,t,u,c);switch(s){case 1:return n(r(e),[t,u,c]);case 2:return n(r(e,t),[u,c]);case 3:return n(r(e,t,u),[c]);case 4:return r(e,t,u,c);case 5:return function(n){return r(e,t,u,c,n)};case 6:return function(n,s){return r(e,t,u,c,n,s)};case 7:return function(n,s,a){return r(e,t,u,c,n,s,a)};default:return n(r,[e,t,u,c])}}function f(r){return 4===r.length?r:function(n,e,t,u){return i(r,n,e,t,u)}}function o(r,e,t,u,c,s){var a=r.length;if(5===a)return r(e,t,u,c,s);switch(a){case 1:return n(r(e),[t,u,c,s]);case 2:return n(r(e,t),[u,c,s]);case 3:return n(r(e,t,u),[c,s]);case 4:return n(r(e,t,u,c),[s]);case 5:return r(e,t,u,c,s);case 6:return function(n){return r(e,t,u,c,s,n)};case 7:return function(n,a){return r(e,t,u,c,s,n,a)};default:return n(r,[e,t,u,c,s])}}function l(r){return 5===r.length?r:function(n,e,t,u,c){return o(r,n,e,t,u,c)}}function h(r,e,t,u,c,s,a){var i=r.length;if(6===i)return r(e,t,u,c,s,a);switch(i){case 1:return n(r(e),[t,u,c,s,a]);case 2:return n(r(e,t),[u,c,s,a]);case 3:return n(r(e,t,u),[c,s,a]);case 4:return n(r(e,t,u,c),[s,a]);case 5:return n(r(e,t,u,c,s),[a]);case 6:return r(e,t,u,c,s,a);case 7:return function(n){return r(e,t,u,c,s,a,n)};default:return n(r,[e,t,u,c,s,a])}}function _(r){return 6===r.length?r:function(n,e,t,u,c,s){return h(r,n,e,t,u,c,s)}}function p(r,e,t,u,c,s,a,i){var f=r.length;if(7===f)return r(e,t,u,c,s,a,i);switch(f){case 1:return n(r(e),[t,u,c,s,a,i]);case 2:return n(r(e,t),[u,c,s,a,i]);case 3:return n(r(e,t,u),[c,s,a,i]);case 4:return n(r(e,t,u,c),[s,a,i]);case 5:return n(r(e,t,u,c,s),[a,i]);case 6:return n(r(e,t,u,c,s,a),[i]);case 7:return r(e,t,u,c,s,a,i);default:return n(r,[e,t,u,c,s,a,i])}}function g(r){return 7===r.length?r:function(n,e,t,u,c,s,a){return p(r,n,e,t,u,c,s,a)}}function x(r,e,t,u,c,s,a,i,f){var o=r.length;if(8===o)return r(e,t,u,c,s,a,i,f);switch(o){case 1:return n(r(e),[t,u,c,s,a,i,f]);case 2:return n(r(e,t),[u,c,s,a,i,f]);case 3:return n(r(e,t,u),[c,s,a,i,f]);case 4:return n(r(e,t,u,c),[s,a,i,f]);case 5:return n(r(e,t,u,c,s),[a,i,f]);case 6:return n(r(e,t,u,c,s,a),[i,f]);case 7:return n(r(e,t,u,c,s,a,i),[f]);default:return n(r,[e,t,u,c,s,a,i,f])}}function v(r){return 8===r.length?r:function(n,e,t,u,c,s,a,i){return x(r,n,e,t,u,c,s,a,i)}}exports.app=n,exports._1=e,exports.__1=t,exports._2=u,exports.__2=c,exports._3=s,exports.__3=a,exports._4=i,exports.__4=f,exports._5=o,e
},{"./caml_array.js":"Tpli"}],"gGFE":[function(require,module,exports) {
"use strict";function n(n,t){return n<t?-1:n===t?0:1}function t(n,t){return n?t?0:1:t?-1:0}function r(n,t){return n===t?0:n<t?-1:n>t||n==n?1:t==t?-1:0}function o(n,t){return n===t?0:n<t?-1:1}function e(n,t){return n?t:n}function i(n,t){return n<t?n:t}function u(n,t){return n<t?n:t}function c(n,t){return n<t?n:t}function _(n,t){return n<t?n:t}function m(n,t){return n||t}function a(n,t){return n>t?n:t}function x(n,t){return n>t?n:t}function s(n,t){return n>t?n:t}function p(n,t){return n>t?n:t}function f(n,t){return n[1]===t[1]&&n[0]===t[0]}function l(n,t){var r=t[0],o=n[0];return o>r||!(o<r)&&n[1]>=t[1]}function g(n,t){return!f(n,t)}function b(n,t){return!l(n,t)}function q(n,t){return n[0]>t[0]||!(n[0]<t[0])&&n[1]>t[1]}function v(n,t){return!q(n,t)}function d(n,t){return l(n,t)?t:n}function h(n,t){return q(n,t)?n:t}exports.caml_int_compare=n,exports.caml_bool_compare=t,exports.caml_float_compare=r,exports.caml_string_compare=o,exports.caml_bool_min=e,exports.caml_int_min=i,exports.caml_float_min=u,exports.caml_string_min=c,exports.caml_int32_min=_,exports.caml_bool_max=m,exports.caml_int_max=a,exports.caml_float_max=x,exports.caml_string_max=s,exports.caml_int32_max=p,exports.i64_eq=f,exports.i64_neq=g,exports.i64_lt=b,exports.i64_gt=q,exports.i64_le=v,exports.i64_ge=l,exports.i64_min=d,exports.i64_max=h;
},{}],"p3B5":[function(require,module,exports) {
"use strict";var r=require("./caml.js"),n=function(r,n){for(var e in r)n(e)},e=function(r){if(Array.isArray(r)){for(var n=r.length,e=new Array(n),t=0;t<n;++t)e[t]=r[t];return void 0!==r.TAG&&(e.TAG=r.TAG),e}return Object.assign({},r)},t=function(r,n){if(Array.isArray(n)){for(e=0;e<n.length;++e)r[e]=n[e];void 0!==n.TAG&&(r.TAG=n.TAG)}else for(var e in n)r[e]=n[e]};function a(n,e){if(n===e)return 0;var t=typeof n,o=typeof e;switch(t){case"boolean":if("boolean"===o)return r.caml_bool_compare(n,e);break;case"function":if("function"===o)throw{RE_EXN_ID:"Invalid_argument",_1:"compare: functional value",Error:new Error};break;case"number":if("number"===o)return r.caml_int_compare(n,e);break;case"string":return"string"===o?r.caml_string_compare(n,e):1;case"undefined":return-1}switch(o){case"string":return-1;case"undefined":return 1;default:if("boolean"===t)return 1;if("boolean"===o)return-1;if("function"===t)return 1;if("function"===o)return-1;if("number"===t)return null===e||void 0!==e.BS_PRIVATE_NESTED_SOME_NONE?1:-1;if("number"===o)return null===n||void 0!==n.BS_PRIVATE_NESTED_SOME_NONE?-1:1;if(null===n)return void 0!==e.BS_PRIVATE_NESTED_SOME_NONE?1:-1;if(null===e)return void 0!==n.BS_PRIVATE_NESTED_SOME_NONE?-1:1;if(void 0!==n.BS_PRIVATE_NESTED_SOME_NONE)return void 0!==e.BS_PRIVATE_NESTED_SOME_NONE?u(n,e):-1;var i=0|n.TAG,f=0|e.TAG;if(248===i)return r.caml_int_compare(n[1],e[1]);if(251===i)throw{RE_EXN_ID:"Invalid_argument",_1:"equal: abstract value",Error:new Error};if(i!==f)return i<f?-1:1;var c=0|n.length,l=0|e.length;if(c===l){if(!Array.isArray(n))return n instanceof Date&&e instanceof Date?n-e:u(n,e);for(var _=0;;){var s=_;if(s===c)return 0;var v=a(n[s],e[s]);if(0!==v)return v;_=s+1|0}}else if(c<l)for(var E=0;;){var m=E;if(m===c)return-1;var d=a(n[m],e[m]);if(0!==d)return d;E=m+1|0}else for(var p=0;;){var A=p;if(A===l)return 1;var N=a(n[A],e[A]);if(0!==N)return N;p=A+1|0}}}function u(e,t){var u={contents:void 0},o={contents:void 0},i=function(r,n){var e=r[2],t=r[1];if(!t.hasOwnProperty(n)||a(r[0][n],t[n])>0){var u=e.contents;return void 0!==u&&n>=u?void 0:void(e.contents=n)}},f=[e,t,o],c=[t,e,u];n(e,function(r){return i(f,r)}),n(t,function(r){return i(c,r)});var l=u.contents,_=o.contents;return void 0!==l?void 0!==_?r.caml_string_compare(l,_):-1:void 0!==_?1:0}function o(r,e){if(r===e)return!0;var t=typeof r;if("string"===t||"number"===t||"boolean"===t||"undefined"===t||null===r)return!1;var a=typeof e;if("function"===t||"function"===a)throw{RE_EXN_ID:"Invalid_argument",_1:"equal: functional value",Error:new Error};if("number"===a||"undefined"===a||null===e)return!1;var u=0|r.TAG,i=0|e.TAG;if(248===u)return r[1]===e[1];if(251===u)throw{RE_EXN_ID:"Invalid_argument",_1:"equal: abstract value",Error:new Error};if(u!==i)return!1;var f=0|r.length;if(f!==(0|e.length))return!1;if(!Array.isArray(r)){if(r instanceof Date&&e instanceof Date)return!(r>e||r<e);var c={contents:!0};return n(r,function(r){e.hasOwnProperty(r)||(c.contents=!1)}),c.contents&&n(e,function(n){r.hasOwnProperty(n)&&o(e[n],r[n])||(c.contents=!1)}),c.contents}for(var l=0;;){var _=l;if(_===f)return!0;if(!o(r[_],e[_]))return!1;l=_+1|0}}function i(r,n){return null!==n?o(r,n):r===n}function f(r,n){return void 0!==n?o(r,n):r===n}function c(r,n){return null==n?r===n:o(r,n)}function l(r,n){return!o(r,n)}function _(r,n){return a(r,n)>=0}function s(r,n){return a(r,n)>0}function v(r,n){return a(r,n)<=0}function E(r,n){return a(r,n)<0}function m(r,n){return a(r,n)<=0?r:n}function d(r,n){return a(r,n)>=0?r:n}exports.caml_obj_dup=e,exports.update_dummy=t,exports.caml_compare=a,exports.caml_equal=o,exports.caml_equal_null=i,exports.caml_equal_undefined=f,exports.caml_equal_nullable=c,exports.caml_notequal=l,exports.caml_greaterequal=_,exports.caml_greaterthan=s,exports.caml_lessthan=E,exports.caml_lessequal=v,exports.caml_min=m,exports.caml_max=d;
},{"./caml.js":"gGFE"}],"RiV8":[function(require,module,exports) {
"use strict";var t={contents:0};function n(n){return t.contents=t.contents+1|0,n+"/"+t.contents}function e(t){return null!=t&&"string"==typeof t.RE_EXN_ID}function o(t){return t.RE_EXN_ID}exports.id=t,exports.create=n,exports.caml_is_extension=e,exports.caml_exn_slot_name=o;
},{}],"dzFO":[function(require,module,exports) {
"use strict";function o(o){return void 0!==o.BS_PRIVATE_NESTED_SOME_NONE}function E(o){return void 0===o?{BS_PRIVATE_NESTED_SOME_NONE:0}:null!==o&&void 0!==o.BS_PRIVATE_NESTED_SOME_NONE?{BS_PRIVATE_NESTED_SOME_NONE:o.BS_PRIVATE_NESTED_SOME_NONE+1|0}:o}function _(o){return null==o?void 0:E(o)}function t(o){return void 0===o?void 0:E(o)}function n(o){return null===o?void 0:E(o)}function r(o){if(null===o||void 0===o.BS_PRIVATE_NESTED_SOME_NONE)return o;var E=o.BS_PRIVATE_NESTED_SOME_NONE;return 0===E?void 0:{BS_PRIVATE_NESTED_SOME_NONE:E-1|0}}function i(o){return void 0===o?void 0:r(o)}function u(o){return void 0!==o?o.VAL:o}exports.nullable_to_opt=_,exports.undefined_to_opt=t,exports.null_to_opt=n,exports.valFromOption=r,exports.some=E,exports.isNested=o,exports.option_get=i,exports.option_unwrap=u;
},{}],"yO2E":[function(require,module,exports) {
"use strict";var e=require("./caml_option.js"),r=require("./caml_exceptions.js"),t=r.create("Caml_js_exceptions.Error");function n(e){return r.caml_is_extension(e)?e:{RE_EXN_ID:t,_1:e}}function o(r){if(r.RE_EXN_ID===t)return e.some(r._1)}exports.$$Error=t,exports.internalToOCamlException=n,exports.caml_as_js_exn=o;
},{"./caml_option.js":"dzFO","./caml_exceptions.js":"RiV8"}],"d4B1":[function(require,module,exports) {
"use strict";var r=require("./curry.js"),t=require("./caml_obj.js"),e=require("./caml_array.js"),n=require("./caml_exceptions.js"),o=require("./caml_js_exceptions.js"),a=e.make_float,i={};function f(t,n){if(0===t)return[];if(t<0)throw{RE_EXN_ID:"Invalid_argument",_1:"Array.init",Error:new Error};for(var o=e.make(t,r._1(n,0)),a=1;a<t;++a)o[a]=r._1(n,a);return o}function u(r,t,n){for(var o=e.make(r,[]),a=0;a<r;++a)o[a]=e.make(t,n);return o}function _(r){var t=r.length;return 0===t?[]:e.sub(r,0,t)}function s(r,t){var n=r.length;return 0===n?_(t):0===t.length?e.sub(r,0,n):r.concat(t)}function l(r,t,n){if(t<0||n<0||t>(r.length-n|0))throw{RE_EXN_ID:"Invalid_argument",_1:"Array.sub",Error:new Error};return e.sub(r,t,n)}function v(r,t,e,n){if(t<0||e<0||t>(r.length-e|0))throw{RE_EXN_ID:"Invalid_argument",_1:"Array.fill",Error:new Error};for(var o=t,a=t+e|0;o<a;++o)r[o]=n}function g(r,t,n,o,a){if(a<0||t<0||t>(r.length-a|0)||o<0||o>(n.length-a|0))throw{RE_EXN_ID:"Invalid_argument",_1:"Array.blit",Error:new Error};return e.blit(r,t,n,o,a)}function c(t,e){for(var n=0,o=e.length;n<o;++n)r._1(t,e[n])}function h(t,e,n){if(e.length!==n.length)throw{RE_EXN_ID:"Invalid_argument",_1:"Array.iter2: arrays must have the same length",Error:new Error};for(var o=0,a=e.length;o<a;++o)r._2(t,e[o],n[o])}function m(t,n){var o=n.length;if(0===o)return[];for(var a=e.make(o,r._1(t,n[0])),i=1;i<o;++i)a[i]=r._1(t,n[i]);return a}function p(t,n,o){var a=n.length;if(a!==o.length)throw{RE_EXN_ID:"Invalid_argument",_1:"Array.map2: arrays must have the same length",Error:new Error};if(0===a)return[];for(var i=e.make(a,r._2(t,n[0],o[0])),f=1;f<a;++f)i[f]=r._2(t,n[f],o[f]);return i}function E(t,e){for(var n=0,o=e.length;n<o;++n)r._2(t,n,e[n])}function x(t,n){var o=n.length;if(0===o)return[];for(var a=e.make(o,r._2(t,0,n[0])),i=1;i<o;++i)a[i]=r._2(t,i,n[i]);return a}function w(r){for(var t=r.length-1|0,e=0;;){var n=e,o=t;if(o<0)return n;e={hd:r[o],tl:n},t=o-1|0}}function y(r,t){for(;;){var e=r;if(!t)return e;t=t.tl,r=e+1|0}}function I(r){if(!r)return[];for(var t=e.make(y(0,r),r.hd),n=1,o=r.tl;;){var a=o,i=n;if(!a)return t;t[i]=a.hd,o=a.tl,n=i+1|0}}function d(t,e,n){for(var o=e,a=0,i=n.length;a<i;++a)o=r._2(t,o,n[a]);return o}function k(t,e,n){for(var o=n,a=e.length-1|0;a>=0;--a)o=r._2(t,e[a],o);return o}function b(t,e){for(var n=e.length,o=0;;){var a=o;if(a===n)return!1;if(r._1(t,e[a]))return!0;o=a+1|0}}function D(t,e){for(var n=e.length,o=0;;){var a=o;if(a===n)return!0;if(!r._1(t,e[a]))return!1;o=a+1|0}}function N(r,e){for(var n=e.length,o=0;;){var a=o;if(a===n)return!1;if(t.caml_equal(e[a],r))return!0;o=a+1|0}}function R(r,t){for(var e=t.length,n=0;;){var o=n;if(o===e)return!1;if(r===t[o])return!0;n=o+1|0}}var X=n.create("Array.Bottom");function A(t,n){for(var a=function(o,a){var i=1+((a+a|0)+a|0)|0,f=i;if((i+2|0)<o)return r._2(t,e.get(n,i),e.get(n,i+1|0))<0&&(f=i+1|0),r._2(t,e.get(n,f),e.get(n,i+2|0))<0&&(f=i+2|0),f;if((i+1|0)<o&&r._2(t,e.get(n,i),e.get(n,i+1|0))<0)return i+1|0;if(i<o)return i;throw{RE_EXN_ID:X,_1:a,Error:new Error}},i=function(i,f,u){try{for(var _=f;;){var s=_,l=a(i,s);if(r._2(t,e.get(n,l),u)<=0)return e.set(n,s,u);e.set(n,s,e.get(n,l)),_=l}}catch(g){var v=o.internalToOCamlException(g);if(v.RE_EXN_ID===X)return e.set(n,v._1,u);throw v}},f=function(r,t){try{for(var i=t;;){var f=i,u=a(r,f);e.set(n,f,e.get(n,u)),i=u}}catch(s){var _=o.internalToOCamlException(s);if(_.RE_EXN_ID===X)return _._1;throw _}},u=function(o,a){for(;;){var i=o,f=(i-1|0)/3|0;if(i===f)throw{RE_EXN_ID:"Assert_failure",_1:["array.ml",238,4],Error:new Error};if(r._2(t,e.get(n,f),a)>=0)return e.set(n,i,a);if(e.set(n,i,e.get(n,f)),f<=0)return e.set(n,0,a);o=f}},_=n.length,s=((_+1|0)/3|0)-1|0;s>=0;--s)i(_,s,e.get(n,s));for(var l=_-1|0;l>=2;--l){var v=e.get(n,l);e.set(n,l,e.get(n,0)),u(f(l,0),v)}if(!(_<=1)){var g=e.get(n,1);return e.set(n,1,e.get(n,0)),e.set(n,0,g)}}function j(t,n){var o=function(o,a,i,f,u,_,s){for(var l=o+a|0,v=f+u|0,c=o,h=e.get(n,o),m=f,p=e.get(i,f),E=s;;){var x=E,w=p,y=m,I=h,d=c;if(r._2(t,I,w)<=0){e.set(_,x,I);var k=d+1|0;if(k>=l)return g(i,y,_,x+1|0,v-y|0);E=x+
},{"./curry.js":"NSLD","./caml_obj.js":"p3B5","./caml_array.js":"Tpli","./caml_exceptions.js":"RiV8","./caml_js_exceptions.js":"yO2E"}],"rH1J":[function(require,module,exports) {
var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(n){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(n){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
},{}],"bJMn":[function(require,module,exports) {
var process = require("process");
var t,e=require("process"),r={buffer:"",output:function(t,r){var o=r.length-1|0;return void 0!==e&&e.stdout&&e.stdout.write?e.stdout.write(r):void("\n"===r[o]?console.log(r.slice(0,o)):console.log(r))}},o={buffer:"",output:function(t,e){var r=e.length-1|0;"\n"===e[r]?console.log(e.slice(0,r)):console.log(e)}};function u(t){if(""!==t.buffer)return t.output(t,t.buffer),void(t.buffer="")}function f(t,o,f,n){var s=0===f&&n===o.length?o:o.slice(f,n);if(void 0!==e&&e.stdout&&e.stdout.write&&t===r)return e.stdout.write(s);var l=s.lastIndexOf("\n");l<0?t.buffer=t.buffer+s:(t.buffer=t.buffer+s.slice(0,l+1|0),u(t),t.buffer=t.buffer+s.slice(l+1|0))}function n(t,e){return f(t,String.fromCharCode(e),0,1)}function s(t){return{hd:r,tl:{hd:o,tl:0}}}exports.stdin=t,exports.stdout=r,exports.stderr=o,exports.caml_ml_flush=u,exports.caml_ml_output=f,exports.caml_ml_output_char=n,exports.caml_ml_out_channels_list=s;
},{"process":"rH1J"}],"Juhd":[function(require,module,exports) {
var process = require("process");
var r=require("process");function o(o){if(void 0===r||void 0===r.env)throw{RE_EXN_ID:"Not_found",Error:new Error};var e=r.env[o];if(void 0!==e)return e;throw{RE_EXN_ID:"Not_found",Error:new Error}}var e=function(o){return void 0!==r&&"win32"===r.platform?"Win32":"Unix"};function t(o){return void 0===r||void 0===r.uptime?-1:r.uptime()}function i(r){return 127}var n=function(o){return void 0===r||void 0===r.cwd?"/":r.cwd()};function s(o){if(void 0===r)return["",[""]];var e=r.argv;return null==e?["",[""]]:[e[0],e]}function _(o){if(void 0!==r)return r.exit(o)}function c(r){throw{RE_EXN_ID:"Failure",_1:"caml_sys_is_directory not implemented",Error:new Error}}function u(r){throw{RE_EXN_ID:"Failure",_1:"caml_sys_file_exists not implemented",Error:new Error}}exports.caml_sys_getenv=o,exports.caml_sys_time=t,exports.os_type=e,exports.caml_sys_system_command=i,exports.caml_sys_getcwd=n,exports.caml_sys_get_argv=s,exports.caml_sys_exit=_,exports.caml_sys_is_directory=c,exports.caml_sys_file_exists=u;
},{"process":"rH1J"}],"gmRG":[function(require,module,exports) {
"use strict";function r(r,t,e){if(t<0||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"index out of bounds",Error:new Error};r[t]=e}function t(r,t){if(t<0||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"index out of bounds",Error:new Error};return r[t]}function e(r,t,e,n){if(!(e<=0))for(var o=t,a=e+t|0;o<a;++o)r[o]=n}function n(r){if(r<0)throw{RE_EXN_ID:"Invalid_argument",_1:"String.create",Error:new Error};for(var t=new Array(r),e=0;e<r;++e)t[e]=0;return t}function o(r,t,e,n,o){if(!(o<=0))if(r!==e){var a=r.length-t|0;if(o<=a)for(var f=0;f<o;++f)e[n+f|0]=r[t+f|0];else{for(var i=0;i<a;++i)e[n+i|0]=r[t+i|0];for(var u=a;u<o;++u)e[n+u|0]=0}}else{if(t<n){for(var l=(r.length-n|0)-1|0,s=o-1|0,_=l>s?s:l;_>=0;--_)r[n+_|0]=r[t+_|0];return}if(t<=n)return;for(var c=(r.length-t|0)-1|0,g=o-1|0,v=c>g?g:c,h=0;h<=v;++h)r[n+h|0]=r[t+h|0]}}function a(r){var t=r.length,e="",n=t;if(t<=4096&&t===r.length)return String.fromCharCode.apply(null,r);for(var o=0;n>0;){for(var a=n<1024?n:1024,f=new Array(a),i=0;i<a;++i)f[i]=r[i+o|0];e+=String.fromCharCode.apply(null,f),n=n-a|0,o=o+a|0}return e}function f(r,t,e,n,o){if(!(o<=0)){var a=r.length-t|0;if(o<=a)for(var f=0;f<o;++f)e[n+f|0]=r.charCodeAt(t+f|0);else{for(var i=0;i<a;++i)e[n+i|0]=r.charCodeAt(t+i|0);for(var u=a;u<o;++u)e[n+u|0]=0}}}function i(r){for(var t=r.length,e=new Array(t),n=0;n<t;++n)e[n]=r.charCodeAt(n);return e}function u(r,t,e,n,o){for(;;){var a=e;if(a>=n)return o;var f=r[a],i=t[a];if(f>i)return 1;if(f<i)return-1;e=a+1|0}}function l(r,t){var e=r.length,n=t.length;return e===n?u(r,t,0,e,0):e<n?u(r,t,0,e,-1):u(r,t,0,n,1)}function s(r,t){var e=r.length;if(e!==t.length)return!1;for(var n=0;;){var o=n;if(o===e)return!0;if(r[o]!==t[o])return!1;n=o+1|0}}function _(r,t){return l(r,t)>0}function c(r,t){return l(r,t)>=0}function g(r,t){return l(r,t)<0}function v(r,t){return l(r,t)<=0}exports.caml_create_bytes=n,exports.caml_fill_bytes=e,exports.get=t,exports.set=r,exports.bytes_to_string=a,exports.caml_blit_bytes=o,exports.caml_blit_string=f,exports.bytes_of_string=i,exports.caml_bytes_compare=l,exports.caml_bytes_greaterthan=_,exports.caml_bytes_greaterequal=c,exports.caml_bytes_lessthan=g,exports.caml_bytes_lessequal=v,exports.caml_bytes_equal=s;
},{}],"Phox":[function(require,module,exports) {
"use strict";var r=require("./caml.js");function t(r,t){return[t,r>>>0]}var n=[-2147483648,0],e=[2147483647,4294967295],i=[0,1],o=[0,0],u=[-1,4294967295];function f(r){return 0!=(-2147483648&r)}function a(r){return 0==(-2147483648&r)}function s(r){var t=r[1]+1|0;return[r[0]+(0===t?1:0)|0,t>>>0]}function c(r){var t=1+(-1^r[1])|0;return[(-1^r[0])+(0===t?1:0)|0,t>>>0]}function x(r,t,n){var e=r[1],i=e+t|0,o=f(e)&&(f(t)||a(i))||f(t)&&a(i)?1:0;return[r[0]+n+o|0,i>>>0]}function _(r,t){return x(r,t[1],t[0])}function l(t,n){return null!==n&&r.i64_eq(t,n)}function p(t,n){return void 0!==n&&r.i64_eq(t,n)}function v(t,n){return null!=n&&r.i64_eq(t,n)}function d(r,t,n){var e=1+(-1^t)>>>0;return x(r,e,(-1^n)+(0===e?1:0)|0)}function g(r,t){return d(r,t[1],t[0])}function h(r,t){if(0===t)return r;var n=r[1];return t>=32?[n<<(t-32|0),0]:[n>>>(32-t|0)|r[0]<<t,n<<t>>>0]}function q(r,t){if(0===t)return r;var n=r[0],e=t-32|0;return 0===e?[0,n>>>0]:e>0?[0,n>>>e]:[n>>>t,(n<<(0|-e)|r[1]>>>t)>>>0]}function m(r,t){if(0===t)return r;var n=r[0];return t<32?[n>>t,(n<<(32-t|0)|r[1]>>>t)>>>0]:[n>=0?0:-1,n>>(t-32|0)>>>0]}function M(r){return 0===r[0]&&0===r[1]}function b(r,t){for(;;){var e,i=t,u=r,f=u[0],a=0,s=0,x=0;if(0!==f)x=4;else{if(0===u[1])return o;x=4}if(4===x)if(0!==i[0])s=3;else{if(0===i[1])return o;s=3}if(3===s&&(-2147483648!==f||0!==u[1]?a=2:e=i[1]),2===a){var _=i[0],l=u[1],p=0;if(-2147483648!==_||0!==i[1]?p=3:e=l,3===p){var v=i[1];if(f<0){if(_>=0)return c(b(c(u),i));t=c(i),r=c(u);continue}if(_<0)return c(b(u,c(i)));var d=65535&f,g=l>>>16,h=65535&l,q=65535&_,m=v>>>16,M=65535&v,w=0,y=0,A=0,E=h*M;return w=(y=(y=(A=(E>>>16)+g*M)>>>16)+((A=(65535&A)+h*m)>>>16)+d*M)>>>16,w+=(y=(65535&y)+g*m)>>>16,w+=(y=(65535&y)+h*q)>>>16,[(y&=65535)|(w=w+((f>>>16)*M+d*m+g*q+h*(_>>>16))&65535)<<16,(65535&E|(65535&A)<<16)>>>0]}}return 0==(1&e)?o:n}}function w(r,t){return[r[0]^t[0],(r[1]^t[1])>>>0]}function y(r,t){return[r[0]|t[0],(r[1]|t[1])>>>0]}function A(r,t){return[r[0]&t[0],(r[1]&t[1])>>>0]}function E(r){return 4294967296*r[0]+r[1]}function N(r){return isNaN(r)||!isFinite(r)?o:r<=-0x8000000000000000?n:r+1>=0x8000000000000000?e:r<0?c(N(-r)):[r/4294967296|0,(r%4294967296|0)>>>0]}function S(r){var t=r[0],n=t>>21;return 0===n||-1===n&&!(0===r[1]&&-2097152===t)}function z(t){if(S(t))return String(E(t));if(t[0]<0)return r.i64_eq(t,n)?"-9223372036854775808":"-"+z(c(t));var e=N(Math.floor(E(t)/10)),i=e[1],o=e[0],u=d(d(t,i<<3,i>>>29|o<<3),i<<1,i>>>31|o<<1),f=u[1],a=u[0];if(0===f&&0===a)return z(e)+"0";if(a<0){var s=1+(-1^f)>>>0,_=Math.ceil(s/10),l=10*_-s;return z(d(e,0|_,0))+String(0|l)}var p=Math.floor(f/10),v=f-10*p;return z(x(e,0|p,0))+String(0|v)}function F(t,e){for(;;){var f=e,a=t,s=a[0],x=0;if(0===f[0]&&0===f[1])throw{RE_EXN_ID:"Division_by_zero",Error:new Error};if(2===2)if(-2147483648!==s)if(0!==s)x=1;else{if(0===a[1])return o;x=1}else if(0!==a[1])x=1;else{if(r.i64_eq(f,i)||r.i64_eq(f,u))return a;if(r.i64_eq(f,n))return i;var l=h(F(m(a,1),f),1),p=0;if(0!==l[0])p=3;else{if(0===l[1])return f[0]<0?i:c(i);p=3}if(3===p)return _(l,F(g(a,b(f,l)),f))}if(1===x){var v=f[0],d=0;if(-2147483648!==v)d=2;else{if(0===f[1])return o;d=2}if(2===d){if(s<0){if(v>=0)return c(F(c(a),f));e=c(f),t=c(a);continue}if(v<0)return c(F(a,c(f)));for(var q=o,w=a;r.i64_ge(w,f);){for(var y=Math.floor(E(w)/E(f)),A=1>y?1:y,S=Math.ceil(Math.log(A)/Math.LN2),z=S<=48?1:Math.pow(2,S-48),I=N(A),D=b(I,f);D[0]<0||r.i64_gt(D,w);)D=b(I=N(A-=z),f);M(I)&&(I=i),q=_(q,I),w=g(w,D)}return q}}}}function I(r,t){return g(r,b(F(r,t),t))}function D(r,t){var n=F(r,t);return[n,g(r,b(n,t))]}function j(r,t){var n=t[0],e=r[0],i=e<n?-1:e===n?0:1;if(0!==i)return i;var o=t[1],u=r[1];return u<o?-1:u===o?0:1}function k(r){return[r<0?-1:0,r>>>0]}function L(r){return 0|r[1]}function R(r){var t=r[1],n=r[0],e=function(r){return(r>>>0).toString(16)};if(0===n&&0===t)return"0";if(0===t)return e(n)+"00000000";if(0===n)return e(t);var i=e(t),o=8-i.length|0;return o<=0?e(n)+i:e(n)+("0".repeat(o)+i)}function X(r){return[2147483647&r[0],r[1]]}function B(r){return t=r[1],n=r[0],new Float64Array(new Int32Array([t,n]).buffer)[0];var t,n}func
},{"./caml.js":"gGFE"}],"Zve6":[function(require,module,exports) {
"use strict";var e=require("./caml.js"),r=require("./caml_int64.js");function a(e){return e>=65?e>=97?e>=123?-1:e-87|0:e>=91?-1:e-55|0:e>57||e<48?-1:e-48|0}function t(e){switch(e){case 0:return 8;case 1:return 16;case 2:return 10;case 3:return 2}}function i(e){var r=1,a=2,t=0;switch(e.charCodeAt(t)){case 43:t=t+1|0;break;case 44:break;case 45:r=-1,t=t+1|0}if("0"===e[t]){var i=e.charCodeAt(t+1|0);if(i>=89)if(i>=111){if(i<121)switch(i){case 111:a=0,t=t+2|0;break;case 117:t=t+2|0;break;case 112:case 113:case 114:case 115:case 116:case 118:case 119:break;case 120:a=1,t=t+2|0}}else 98===i&&(a=3,t=t+2|0);else if(66!==i){if(i>=79)switch(i){case 79:a=0,t=t+2|0;break;case 85:t=t+2|0;break;case 80:case 81:case 82:case 83:case 84:case 86:case 87:break;case 88:a=1,t=t+2|0}}else a=3,t=t+2|0}return[t,r,a]}function n(e){var r=i(e),n=r[0],s=t(r[2]),c=e.length,o=a(n<c?e.charCodeAt(n):0);if(o<0||o>=s)throw{RE_EXN_ID:"Failure",_1:"int_of_string",Error:new Error};var f=r[1]*function(r,t){for(;;){var i=t,n=r;if(i===c)return n;var o=e.charCodeAt(i);if(95!==o){var f=a(o);if(f<0||f>=s)throw{RE_EXN_ID:"Failure",_1:"int_of_string",Error:new Error};var _=s*n+f;if(_>4294967295)throw{RE_EXN_ID:"Failure",_1:"int_of_string",Error:new Error};t=i+1|0,r=_}else t=i+1|0}}(o,n+1|0),_=0|f;if(10===s&&f!==_)throw{RE_EXN_ID:"Failure",_1:"int_of_string",Error:new Error};return _}function s(n){var s,c=i(n),o=c[2],f=c[0],_=r.of_int32(t(o)),u=r.of_int32(c[1]);switch(o){case 0:s=[536870911,4294967295];break;case 1:s=[268435455,4294967295];break;case 2:s=[429496729,2576980377];break;case 3:s=r.max_int}var l=n.length,v=f<l?n.charCodeAt(f):0,g=r.of_int32(a(v));if(e.i64_lt(g,r.zero)||e.i64_ge(g,_))throw{RE_EXN_ID:"Failure",_1:"int64_of_string",Error:new Error};var d=r.mul(u,function(t,i){for(;;){var c=i,o=t;if(c===l)return o;var f=n.charCodeAt(c);if(95!==f){var u=r.of_int32(a(f));if(e.i64_lt(u,r.zero)||e.i64_ge(u,_)||e.i64_gt(o,s))throw{RE_EXN_ID:"Failure",_1:"int64_of_string",Error:new Error};i=c+1|0,t=r.add(r.mul(_,o),u)}else i=c+1|0}}(g,f+1|0)),h=r.or_(d,r.zero);if(e.i64_eq(_,[0,10])&&e.i64_neq(d,h))throw{RE_EXN_ID:"Failure",_1:"int64_of_string",Error:new Error};return h}function c(e){switch(e){case 0:return 8;case 1:return 16;case 2:return 10}}function o(e){return e>=65&&e<=90||e>=192&&e<=214||e>=216&&e<=222?e+32|0:e}function f(e){var r=e.length;if(r>31)throw{RE_EXN_ID:"Invalid_argument",_1:"format_int: format too long",Error:new Error};for(var a={justify:"+",signstyle:"-",filter:" ",alternate:!1,base:2,signedconv:!1,width:0,uppercase:!1,sign:1,prec:-1,conv:"f"},t=0;;){var i=t;if(i>=r)return a;var n=e.charCodeAt(i),s=0;if(n>=69)if(n>=88)if(n>=121)s=1;else switch(n){case 88:a.base=1,a.uppercase=!0,t=i+1|0;continue;case 101:case 102:case 103:s=5;break;case 100:case 105:s=4;break;case 111:a.base=0,t=i+1|0;continue;case 117:a.base=2,t=i+1|0;continue;case 89:case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:case 98:case 99:case 104:case 106:case 107:case 108:case 109:case 110:case 112:case 113:case 114:case 115:case 116:case 118:case 119:s=1;break;case 120:a.base=1,t=i+1|0;continue}else{if(!(n>=72)){a.signedconv=!0,a.uppercase=!0,a.conv=String.fromCharCode(o(n)),t=i+1|0;continue}s=1}else switch(n){case 35:a.alternate=!0,t=i+1|0;continue;case 32:case 43:s=2;break;case 45:a.justify="-",t=i+1|0;continue;case 46:a.prec=0;for(var c=i+1|0;function(r){return function(){var a=e.charCodeAt(r)-48|0;return a>=0&&a<=9}}(c)();)a.prec=(Math.imul(a.prec,10)+e.charCodeAt(c)|0)-48|0,c=c+1|0;t=c;continue;case 33:case 34:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 44:case 47:s=1;break;case 48:a.filter="0",t=i+1|0;continue;case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:s=3;break;default:s=1}switch(s){case 1:t=i+1|0;continue;case 2:a.signstyle=String.fromCharCode(n),t=i+1|0;continue;case 3:a.width=0;for(var f=i;function(r){return function(){var a=e.charCodeAt(r)-48|0;return a>=0&&a<=9}}(f)();)a.width=(Math.imul(a.width,10)+e.charCodeAt(f)|0)-48|0,f=f+1|0;t=f;continue;case 4:a.signedconv=!0,a.base=2,t=i+1|0;continue;case 5:a.signedconv=
},{"./caml.js":"gGFE","./caml_int64.js":"Phox"}],"GLny":[function(require,module,exports) {
"use strict";function r(r,t){if(t>=r.length||t<0)throw{RE_EXN_ID:"Invalid_argument",_1:"index out of bounds",Error:new Error};return r.charCodeAt(t)}function t(r,t){return String.fromCharCode(t).repeat(r)}exports.get=r,exports.make=t;
},{}],"FC4F":[function(require,module,exports) {
var global = arguments[3];
var e=arguments[3],r=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;if(void 0!==this)return this;throw new Error("Unable to locate global `this`")},t=function(e){var t=r();if(void 0===t[e])throw new Error(e+" not polyfilled by ReScript yet\n");return t[e]},n=function(e,t){return r()[e]=t,0};exports.getGlobalThis=r,exports.resolve=t,exports.register=n;
},{}],"z22f":[function(require,module,exports) {
"use strict";var r=require("./curry.js"),t=require("./caml_io.js"),e=require("./caml_sys.js"),n=require("./caml_bytes.js"),o=require("./caml_format.js"),_=require("./caml_string.js"),l=require("./caml_exceptions.js"),u=require("./caml_js_exceptions.js"),i=require("./caml_external_polyfill.js");function s(r){throw{RE_EXN_ID:"Failure",_1:r,Error:new Error}}function a(r){throw{RE_EXN_ID:"Invalid_argument",_1:r,Error:new Error}}var c=l.create("Pervasives.Exit");function p(r){return r>=0?r:0|-r}function f(r){return-1^r}var m=-2147483648;function x(r){return isFinite(r)?Math.abs(r)>=2.2250738585072014e-308?0:0!==r?1:2:isNaN(r)?4:3}function h(r){if(r<0||r>255)throw{RE_EXN_ID:"Invalid_argument",_1:"char_of_int",Error:new Error};return r}function v(r){return r?"true":"false"}function d(r){switch(r){case"false":return!1;case"true":return!0;default:throw{RE_EXN_ID:"Invalid_argument",_1:"bool_of_string",Error:new Error}}}function E(r){switch(r){case"false":return!1;case"true":return!0;default:return}}function g(r){try{return o.caml_int_of_string(r)}catch(e){var t=u.internalToOCamlException(e);if("Failure"===t.RE_EXN_ID)return;throw t}}function y(r){for(var t=r.length,e=0;;){var n=e;if(n>=t)return r+".";var o=_.get(r,n);if(o>=48){if(o>=58)return r;e=n+1|0}else{if(45!==o)return r;e=n+1|0}}}function b(r){return y(o.caml_format_float("%.12g",r))}function w(r){try{return o.caml_float_of_string(r)}catch(e){var t=u.internalToOCamlException(e);if("Failure"===t.RE_EXN_ID)return;throw t}}function I(r,t){return r?{hd:r.hd,tl:I(r.tl,t)}:t}var N=t.stdin,D=t.stdout,R=t.stderr;function X(r,t,e){var n=i.resolve("caml_ml_open_descriptor_out")(i.resolve("caml_sys_open")(e,r,t));return i.resolve("caml_ml_set_channel_name")(n,e),n}function j(r){return X({hd:1,tl:{hd:3,tl:{hd:4,tl:{hd:7,tl:0}}}},438,r)}function q(r){return X({hd:1,tl:{hd:3,tl:{hd:4,tl:{hd:6,tl:0}}}},438,r)}function k(r){for(var e=t.caml_ml_out_channels_list(void 0);;){var n=e;if(!n)return;try{t.caml_ml_flush(n.hd)}catch(_){var o=u.internalToOCamlException(_);if("Sys_error"!==o.RE_EXN_ID)throw o}e=n.tl}}function F(r,t){return i.resolve("caml_ml_output_bytes")(r,t,0,t.length)}function z(r,e){return t.caml_ml_output(r,e,0,e.length)}function C(r,t,e,n){if(e<0||n<0||e>(t.length-n|0))throw{RE_EXN_ID:"Invalid_argument",_1:"output",Error:new Error};return i.resolve("caml_ml_output_bytes")(r,t,e,n)}function O(r,e,n,o){if(n<0||o<0||n>(e.length-o|0))throw{RE_EXN_ID:"Invalid_argument",_1:"output_substring",Error:new Error};return t.caml_ml_output(r,e,n,o)}function S(r,t){return i.resolve("caml_output_value")(r,t,0)}function T(r){return t.caml_ml_flush(r),i.resolve("caml_ml_close_channel")(r)}function L(r){try{t.caml_ml_flush(r)}catch(e){}try{return i.resolve("caml_ml_close_channel")(r)}catch(n){return}}function M(r,t,e){var n=i.resolve("caml_ml_open_descriptor_in")(i.resolve("caml_sys_open")(e,r,t));return i.resolve("caml_ml_set_channel_name")(n,e),n}function P(r){return M({hd:0,tl:{hd:7,tl:0}},0,r)}function $(r){return M({hd:0,tl:{hd:6,tl:0}},0,r)}function A(r,t,e,n){if(e<0||n<0||e>(t.length-n|0))throw{RE_EXN_ID:"Invalid_argument",_1:"input",Error:new Error};return i.resolve("caml_ml_input")(r,t,e,n)}function B(r,t,e,n){for(;;){var o=n,_=e;if(o<=0)return;var l=i.resolve("caml_ml_input")(r,t,_,o);if(0===l)throw{RE_EXN_ID:"End_of_file",Error:new Error};n=o-l|0,e=_+l|0}}function G(r,t,e,n){if(e<0||n<0||e>(t.length-n|0))throw{RE_EXN_ID:"Invalid_argument",_1:"really_input",Error:new Error};return B(r,t,e,n)}function H(r,t){var e=n.caml_create_bytes(t);return G(r,e,0,t),n.bytes_to_string(e)}function J(r){var t=function(r,t,e){for(;;){var o=e,_=t;if(!o)return r;var l=o.hd,u=l.length;n.caml_blit_bytes(l,0,r,_-u|0,u),e=o.tl,t=_-u|0}};return n.bytes_to_string(function(e,o){for(;;){var _=o,l=e,u=i.resolve("caml_ml_input_scan_line")(r);if(0===u){if(l)return t(n.caml_create_bytes(_),_,l);throw{RE_EXN_ID:"End_of_file",Error:new Error}}if(u>0){var s=n.caml_create_bytes(u-1|0);if(i.resolve("caml_ml_input")(r,s,0,u-1|0),i.resolve("caml_ml_input_char")(r),!l)return s;var a=(_+u|0)-1|0;return t(n.caml_create_bytes(
},{"./curry.js":"NSLD","./caml_io.js":"bJMn","./caml_sys.js":"Juhd","./caml_bytes.js":"gmRG","./caml_format.js":"Zve6","./caml_string.js":"GLny","./caml_exceptions.js":"RiV8","./caml_js_exceptions.js":"yO2E","./caml_external_polyfill.js":"FC4F"}],"aYjQ":[function(require,module,exports) {
"use strict";var r=require("./curry.js"),t=require("./caml_obj.js"),n=require("./pervasives.js"),l=require("./caml_option.js");function e(r){for(var t=0,n=r;;){var l=t;if(!n)return l;n=n.tl,t=l+1|0}}function o(r,t){return{hd:r,tl:t}}function i(r){if(r)return r.hd;throw{RE_EXN_ID:"Failure",_1:"hd",Error:new Error}}function h(r){if(r)return r.tl;throw{RE_EXN_ID:"Failure",_1:"tl",Error:new Error}}function d(r,t){if(t<0)throw{RE_EXN_ID:"Invalid_argument",_1:"List.nth",Error:new Error};for(var n=r,l=t;;){var e=l,o=n;if(!o)throw{RE_EXN_ID:"Failure",_1:"nth",Error:new Error};if(0===e)return o.hd;l=e-1|0,n=o.tl}}function f(r,t){if(t<0)throw{RE_EXN_ID:"Invalid_argument",_1:"List.nth",Error:new Error};for(var n=r,e=t;;){var o=e,i=n;if(!i)return;if(0===o)return l.some(i.hd);e=o-1|0,n=i.tl}}function u(r,t){for(;;){var n=t,l=r;if(!l)return n;t={hd:l.hd,tl:n},r=l.tl}}function _(r){return u(r,0)}function a(t,n,l,e){for(;;){var o=n,i=t;if(o>=l)return i;n=o+1|0,t={hd:r._1(e,o),tl:i}}}function v(t,n,l){return t>=n?0:{hd:r._1(l,t),tl:v(t+1|0,n,l)}}function s(r,t){if(r<0)throw{RE_EXN_ID:"Invalid_argument",_1:"List.init",Error:new Error};return r>1e4?u(a(0,0,r,t),0):v(0,r,t)}function E(r){return r?n.$at(r.hd,E(r.tl)):0}function c(t,n){return n?{hd:r._1(t,n.hd),tl:c(t,n.tl)}:0}function p(t,n,l){return l?{hd:r._2(n,t,l.hd),tl:p(t+1|0,n,l.tl)}:0}function m(r,t){return p(0,r,t)}function x(t,n){for(var l=0,e=n;;){var o=e,i=l;if(!o)return i;e=o.tl,l={hd:r._1(t,o.hd),tl:i}}}function w(t,n){for(;;){var l=n;if(!l)return;r._1(t,l.hd),n=l.tl}}function I(t,n){for(var l=0,e=n;;){var o=e,i=l;if(!o)return;r._2(t,i,o.hd),e=o.tl,l=i+1|0}}function N(t,n,l){for(;;){var e=l,o=n;if(!e)return o;l=e.tl,n=r._2(t,o,e.hd)}}function g(t,n,l){return n?r._2(t,n.hd,g(t,n.tl,l)):l}function D(t,n,l){if(n){if(l)return{hd:r._2(t,n.hd,l.hd),tl:D(t,n.tl,l.tl)};throw{RE_EXN_ID:"Invalid_argument",_1:"List.map2",Error:new Error}}if(!l)return 0;throw{RE_EXN_ID:"Invalid_argument",_1:"List.map2",Error:new Error}}function R(t,n,l){for(var e=0,o=n,i=l;;){var h=i,d=o,f=e;if(d){if(h){i=h.tl,o=d.tl,e={hd:r._2(t,d.hd,h.hd),tl:f};continue}throw{RE_EXN_ID:"Invalid_argument",_1:"List.rev_map2",Error:new Error}}if(h)throw{RE_EXN_ID:"Invalid_argument",_1:"List.rev_map2",Error:new Error};return f}}function X(t,n,l){for(;;){var e=l,o=n;if(o){if(e){r._2(t,o.hd,e.hd),l=e.tl,n=o.tl;continue}throw{RE_EXN_ID:"Invalid_argument",_1:"List.iter2",Error:new Error}}if(!e)return;throw{RE_EXN_ID:"Invalid_argument",_1:"List.iter2",Error:new Error}}}function L(t,n,l,e){for(;;){var o=e,i=l,h=n;if(i){if(o){e=o.tl,l=i.tl,n=r._3(t,h,i.hd,o.hd);continue}throw{RE_EXN_ID:"Invalid_argument",_1:"List.fold_left2",Error:new Error}}if(o)throw{RE_EXN_ID:"Invalid_argument",_1:"List.fold_left2",Error:new Error};return h}}function q(t,n,l,e){if(n){if(l)return r._3(t,n.hd,l.hd,q(t,n.tl,l.tl,e));throw{RE_EXN_ID:"Invalid_argument",_1:"List.fold_right2",Error:new Error}}if(l)throw{RE_EXN_ID:"Invalid_argument",_1:"List.fold_right2",Error:new Error};return e}function b(t,n){for(;;){var l=n;if(!l)return!0;if(!r._1(t,l.hd))return!1;n=l.tl}}function j(t,n){for(;;){var l=n;if(!l)return!1;if(r._1(t,l.hd))return!0;n=l.tl}}function F(t,n,l){for(;;){var e=l,o=n;if(o){if(e){if(!r._2(t,o.hd,e.hd))return!1;l=e.tl,n=o.tl;continue}throw{RE_EXN_ID:"Invalid_argument",_1:"List.for_all2",Error:new Error}}if(!e)return!0;throw{RE_EXN_ID:"Invalid_argument",_1:"List.for_all2",Error:new Error}}}function $(t,n,l){for(;;){var e=l,o=n;if(o){if(e){if(r._2(t,o.hd,e.hd))return!0;l=e.tl,n=o.tl;continue}throw{RE_EXN_ID:"Invalid_argument",_1:"List.exists2",Error:new Error}}if(!e)return!1;throw{RE_EXN_ID:"Invalid_argument",_1:"List.exists2",Error:new Error}}}function y(r,n){for(;;){var l=n;if(!l)return!1;if(t.caml_equal(l.hd,r))return!0;n=l.tl}}function A(r,t){for(;;){var n=t;if(!n)return!1;if(n.hd===r)return!0;t=n.tl}}function k(r,n){for(;;){var l=n;if(!l)throw{RE_EXN_ID:"Not_found",Error:new Error};var e=l.hd;if(t.caml_equal(e[0],r))return e[1];n=l.tl}}function z(r,n){for(;;){var e=n;if(!e)return;var o=e.hd;if(t.caml_equal(o[0],r))return l.some(o[1]);n=e.tl}}f
},{"./curry.js":"NSLD","./caml_obj.js":"p3B5","./pervasives.js":"z22f","./caml_option.js":"dzFO"}],"eN7B":[function(require,module,exports) {
"use strict";var r=require("./curry.js");function e(r){return r}function a(e){var a=e.cmp;return{cmp:r.__2(a)}}function t(r){return{cmp:r}}function n(e){return{cmp:r.__2(e)}}function o(r){return r}function s(e){var a=e.hash,t=r.__1(a),n=e.eq;return{hash:t,eq:r.__2(n)}}function u(r,e){return{hash:r,eq:e}}function c(e,a){return{hash:r.__1(e),eq:r.__2(a)}}exports.MakeComparableU=e,exports.MakeComparable=a,exports.comparableU=t,exports.comparable=n,exports.MakeHashableU=o,exports.MakeHashable=s,exports.hashableU=u,exports.hashable=c;
},{"./curry.js":"NSLD"}],"NOig":[function(require,module,exports) {
"use strict";var r=require("./caml_option.js");function e(r){var e=typeof r;return"string"===e?{TAG:0,_0:r}:"number"===e?{TAG:1,_0:r}:"boolean"===e?!0===r?1:0:null===r?2:Array.isArray(r)?{TAG:3,_0:r}:{TAG:2,_0:r}}function n(r,e){switch(e){case 0:return"string"==typeof r;case 1:return"number"==typeof r;case 2:return null!==r&&"object"==typeof r&&!Array.isArray(r);case 3:return Array.isArray(r);case 4:return"boolean"==typeof r;case 5:return null===r}}function t(r){if("string"==typeof r)return r}function o(r){if("number"==typeof r)return r}function i(e){if("object"==typeof e&&!Array.isArray(e)&&null!==e)return r.some(e)}function u(r){if(Array.isArray(r))return r}function a(r){if("boolean"==typeof r)return r}function s(r){if(null===r)return null}var f=function(r){for(var e=[r],n=[{kind:0,i:0,parent:e}];0!==n.length;){var t=n[n.length-1];0===t.kind?(t.val=t.parent[t.i],++t.i===t.parent.length&&n.pop()):n.pop();var o=t.val;if("object"==typeof o)if(Array.isArray(o)&&0!==o.length)n.push({kind:0,i:0,parent:o,val:void 0});else for(var i in o)"RE_PRIVATE_NONE"!==i?n.push({kind:1,i:i,parent:o,val:o[i]}):0===t.kind?t.parent[t.i-1]=void 0:t.parent[t.i]=void 0}return e[0]};function p(r){return function(r){var e=JSON.stringify(r,function(r,e){return void 0===e?{RE_PRIVATE_NONE:!0}:e});if(void 0===e)throw new TypeError("output is undefined");return e}(r)}function c(r){return f(JSON.parse(r))}exports.classify=e,exports.test=n,exports.decodeString=t,exports.decodeNumber=o,exports.decodeObject=i,exports.decodeArray=u,exports.decodeBoolean=a,exports.decodeNull=s,exports.deserializeUnsafe=c,exports.serializeExn=p;
},{"./caml_option.js":"dzFO"}],"FisO":[function(require,module,exports) {
"use strict";function r(r,t){return r===t}var t=2147483647,e=-2147483648;exports.equal=r,exports.max=t,exports.min=e;
},{}],"MeLz":[function(require,module,exports) {
"use strict";var r=require("./js_int.js");function t(r){return Math.ceil(r)}function n(t){return t>r.max?r.max:t<r.min?r.min:Math.ceil(t)}function o(r){return Math.floor(r)}function e(t){return t>r.max?r.max:t<r.min?r.min:Math.floor(t)}function i(r,t){return e(Math.random()*(t-r|0))+r|0}var a=n,u=e;exports.unsafe_ceil=t,exports.ceil_int=n,exports.ceil=a,exports.unsafe_floor=o,exports.floor_int=e,exports.floor=u,exports.random_int=i;
},{"./js_int.js":"FisO"}],"yUxI":[function(require,module,exports) {
"use strict";var r=require("./caml.js"),n=require("./curry.js"),e=require("./js_math.js"),t=require("./caml_option.js");function o(r,n){if(n>=0&&n<r.length)return t.some(r[n])}function u(r,n){if(!(n>=0&&n<r.length))throw{RE_EXN_ID:"Assert_failure",_1:["belt_Array.ml",27,4],Error:new Error};return r[n]}function f(r,n,e){return n>=0&&n<r.length&&(r[n]=e,!0)}function i(r,n,e){if(!(n>=0&&n<r.length))throw{RE_EXN_ID:"Assert_failure",_1:["belt_Array.ml",33,2],Error:new Error};r[n]=e}function a(r,n,e){var t=r[n];r[n]=r[e],r[e]=t}function c(r){for(var n=r.length,t=0;t<n;++t)a(r,t,e.random_int(t,n))}function s(r){var n=r.slice(0);return c(n),n}function p(r){for(var n=r.length,e=0,t=n/2|0;e<t;++e)a(r,0+e|0,((0+n|0)-e|0)-1|0)}function l(r){for(var n=r.length,e=new Array(n),t=0;t<n;++t)e[t]=r[(n-1|0)-t|0];return e}function x(r,n){if(r<=0)return[];for(var e=new Array(r),t=0;t<r;++t)e[t]=n;return e}function v(r,n){if(r<=0)return[];for(var e=new Array(r),t=0;t<r;++t)e[t]=n(t);return e}function _(r,e){return v(r,n.__1(e))}function h(r,n){var e=v(r,n);return c(e),e}function g(r,e){return h(r,n.__1(e))}function m(r,n){var e=n-r|0;if(e<0)return[];for(var t=new Array(e+1|0),o=0;o<=e;++o)t[o]=r+o|0;return t}function y(r,n,e){var t=n-r|0;if(t<0||e<=0)return[];for(var o=1+(t/e|0)|0,u=new Array(o),f=r,i=0;i<o;++i)u[i]=f,f=f+e|0;return u}function A(r,n){for(var e=r.length,t=n.length,o=e<t?e:t,u=new Array(o),f=0;f<o;++f)u[f]=[r[f],n[f]];return u}function d(r,n,e){for(var t=r.length,o=n.length,u=t<o?t:o,f=new Array(u),i=0;i<u;++i)f[i]=e(r[i],n[i]);return f}function U(r,e,t){return d(r,e,n.__2(t))}function w(r,n){for(var e=r.length,t=n.length,o=new Array(e+t|0),u=0;u<e;++u)o[u]=r[u];for(var f=0;f<t;++f)o[e+f|0]=n[f];return o}function E(r){for(var n=r.length,e=0,t=0;t<n;++t)e=e+r[t].length|0;var o=new Array(e);e=0;for(var u=0;u<n;++u)for(var f=r[u],i=0,a=f.length;i<a;++i)o[e]=f[i],e=e+1|0;return o}function I(n,e,t){if(t<=0)return[];var o=n.length,u=e<0?r.caml_int_max(o+e|0,0):e,f=o-u|0,i=f<t?f:t;if(i<=0)return[];for(var a=new Array(i),c=0;c<i;++c)a[c]=n[u+c|0];return a}function k(n,e){for(var t=n.length,o=e<0?r.caml_int_max(t+e|0,0):e,u=t-o|0,f=new Array(u),i=0;i<u;++i)f[i]=n[o+i|0];return f}function B(n,e,t,o){if(!(t<=0)){var u=n.length,f=e<0?r.caml_int_max(u+e|0,0):e,i=u-f|0,a=i<t?i:t;if(!(a<=0))for(var c=f,s=f+a|0;c<s;++c)n[c]=o}}function W(r,n,e,t,o){if(t<=n)for(var u=0;u<o;++u)e[u+t|0]=r[u+n|0];else for(var f=o-1|0;f>=0;--f)e[f+t|0]=r[f+n|0]}function j(n,e,t,o,u){var f=n.length,i=t.length,a=e<0?r.caml_int_max(f+e|0,0):e,c=o<0?r.caml_int_max(i+o|0,0):o,s=r.caml_int_min(u,r.caml_int_min(f-a|0,i-c|0));if(c<=a)for(var p=0;p<s;++p)t[p+c|0]=n[p+a|0];else for(var l=s-1|0;l>=0;--l)t[l+c|0]=n[l+a|0]}function q(r,n){for(var e=0,t=r.length;e<t;++e)n(r[e])}function R(r,e){return q(r,n.__1(e))}function b(r,n){for(var e=r.length,t=new Array(e),o=0;o<e;++o)t[o]=n(r[o]);return t}function z(r,e){return b(r,n.__1(e))}function M(r,n){for(var e,o=r.length,u=0;void 0===e&&u<o;){var f=r[u];n(f)&&(e=t.some(f)),u=u+1|0}return e}function D(r,e){return M(r,n.__1(e))}function N(r,n){for(var e,t=r.length,o=0;void 0===e&&o<t;){n(r[o])&&(e=o),o=o+1|0}return e}function P(r,e){return N(r,n.__1(e))}function S(r,n){for(var e=r.length,t=new Array(e),o=0,u=0;u<e;++u){var f=r[u];n(f)&&(t[o]=f,o=o+1|0)}return t.length=o,t}function X(r,e){return S(r,n.__1(e))}function F(r,n){for(var e=r.length,t=new Array(e),o=0,u=0;u<e;++u){var f=r[u];n(f,u)&&(t[o]=f,o=o+1|0)}return t.length=o,t}function O(r,e){return F(r,n.__2(e))}function T(r,n){for(var e=r.length,o=new Array(e),u=0,f=0;f<e;++f){var i=n(r[f]);void 0!==i&&(o[u]=t.valFromOption(i),u=u+1|0)}return o.length=u,o}function C(r,e){return T(r,n.__1(e))}function G(r,n){for(var e=0,t=r.length;e<t;++e)n(e,r[e])}function H(r,e){return G(r,n.__2(e))}function J(r,n){for(var e=r.length,t=new Array(e),o=0;o<e;++o)t[o]=n(o,r[o]);return t}function K(r,e){return J(r,n.__2(e))}function L(r,n,e){for(var t=n,o=0,u=r.length;o<u;++o)t=e(t,r[o]);return t}function Q(r,e,t){return L(r,e,n.__2(t))}function V(r,n,e){for(var t=n,o=r.length-1|0;o>=0;--o)t=e(t,
},{"./caml.js":"gGFE","./curry.js":"NSLD","./js_math.js":"MeLz","./caml_option.js":"dzFO"}],"mJOW":[function(require,module,exports) {
"use strict";var r,t,e=require("./curry.js"),n=require("./belt_Array.js");function i(r,t,e,n,i){for(;;){var f=e,u=t;if(f>=n)return f;var a=r[f];if(!i(a,u))return f;e=f+1|0,t=a}}function f(r,t){var e=r.length;if(0===e||1===e)return e;var n=r[0],f=r[1];if(!t(n,f))return t(f,n)?0|-i(r,f,2,e,t):1;for(var u=f,a=2;;){var o=a,s=u;if(o>=e)return o;var v=r[o];if(!t(s,v))return o;a=o+1|0,u=v}}function u(r,t){return f(r,e.__2(t))}function a(r,t){var e=r.length;if(0===e)return!0;for(var n=0,i=e-1|0;;){var f=n;if(f===i)return!0;if(t(r[f],r[f+1|0])>0)return!1;n=f+1|0}}function o(r,t){return a(r,e.__2(t))}function s(r,t,e,i,f,u,a,o,s){for(var v=t+e|0,c=f+u|0,l=t,p=r[t],x=f,_=i[f],U=o;;){var b=U,y=_,S=x,h=p,g=l;if(s(h,y)<=0){a[b]=h;var d=g+1|0;if(d>=v)return n.blitUnsafe(i,S,a,b+1|0,c-S|0);U=b+1|0,p=r[d],l=d}else{a[b]=y;var B=S+1|0;if(B>=c)return n.blitUnsafe(r,g,a,b+1|0,v-g|0);U=b+1|0,_=i[B],x=B}}}function v(r,t,e,i,f,u,a,o,s){for(var v=t+e|0,c=f+u|0,l=t,p=r[t],x=f,_=i[f],U=o;;){var b=U,y=_,S=x,h=p,g=l,d=s(h,y);if(d<0){a[b]=h;var B=g+1|0,I=b+1|0;if(B<v){U=I,p=r[B],l=B;continue}return n.blitUnsafe(i,S,a,I,c-S|0),(I+c|0)-S|0}if(0!==d){a[b]=y;var j=S+1|0,q=b+1|0;if(!(j<c))return n.blitUnsafe(r,g,a,q,v-g|0),(q+v|0)-g|0;U=q,_=i[j],x=j}else{a[b]=h;var A=g+1|0,L=S+1|0,P=b+1|0;if(!(A<v&&L<c))return A===v?(n.blitUnsafe(i,L,a,P,c-L|0),(P+c|0)-L|0):(n.blitUnsafe(r,A,a,P,v-A|0),(P+v|0)-A|0);U=P,_=i[L],x=L,p=r[A],l=A}}}function c(r,t,n,i,f,u,a,o,s){return v(r,t,n,i,f,u,a,o,e.__2(s))}function l(r,t,e,n,i,f,u,a,o){for(var s=t+e|0,v=i+f|0,c=t,l=r[t],p=i,x=n[i],_=a;;){var U=_,b=p,y=l,S=c,h=o(y,x);if(h<0){var g=S+1|0;if(g>=s)return U;l=r[g],c=g}else if(0!==h){var d=b+1|0;if(d>=v)return U;x=n[d],p=d}else{u[U]=y;var B=S+1|0,I=b+1|0,j=U+1|0;if(!(B<s&&I<v))return j;_=j,x=n[I],p=I,l=r[B],c=B}}}function p(r,t,n,i,f,u,a,o,s){return l(r,t,n,i,f,u,a,o,e.__2(s))}function x(r,t,e,i,f,u,a,o,s){for(var v=t+e|0,c=f+u|0,l=t,p=r[t],x=f,_=i[f],U=o;;){var b=U,y=x,S=p,h=l,g=s(S,_);if(g<0){a[b]=S;var d=b+1|0,B=h+1|0;if(B>=v)return d;U=d,p=r[B],l=B}else if(0!==g){var I=y+1|0;if(!(I<c))return n.blitUnsafe(r,h,a,b,v-h|0),(b+v|0)-h|0;_=i[I],x=I}else{var j=h+1|0,q=y+1|0;if(!(j<v&&q<c))return j===v?b:(n.blitUnsafe(r,j,a,b,v-j|0),(b+v|0)-j|0);_=i[q],x=q,p=r[j],l=j}}}function _(r,t,n,i,f,u,a,o,s){return x(r,t,n,i,f,u,a,o,e.__2(s))}function U(r,t,e,n,i,f){for(var u=0;u<i;++u){for(var a=r[t+u|0],o=(n+u|0)-1|0;o>=n&&f(e[o],a)>0;)e[o+1|0]=e[o],o=o-1|0;e[o+1|0]=a}}function b(r,t,e,n,i,f){if(i<=5)return U(r,t,e,n,i,f);var u=i/2|0,a=i-u|0;return b(r,t+u|0,e,n+u|0,a,f),b(r,t,r,t+a|0,u,f),s(r,t+a|0,u,e,n+u|0,a,e,n,f)}function y(r,t){var e=r.length;if(e<=5)return U(r,0,r,0,e,t);var n=e/2|0,i=e-n|0,f=new Array(i);return b(r,n,f,0,i,t),b(r,0,r,i,n,t),s(r,i,n,f,0,i,r,0,t)}function S(r,t){return y(r,e.__2(t))}function h(r,t){var e=r.slice(0);return y(e,t),e}function g(r,t){return h(r,e.__2(t))}function d(r,t,e){var n=r.length;if(0===n)return-1;if(e(t,r[0])<0)return-1;if(e(t,r[n-1|0])>0)return 0|-(n+1|0);for(var i=0,f=n-1|0;;){var u=f,a=i,o=(a+u|0)/2|0,s=e(t,r[o]);if(0===s)return o;if(s<0){if(u===o)return 0===e(r[a],t)?a:0|-(u+1|0);f=o}else{if(a===o)return 0===e(r[u],t)?u:0|-(u+1|0);i=o}}}function B(r,t,n){return d(r,t,e.__2(n))}exports.Int=r,exports.$$String=t,exports.strictlySortedLengthU=f,exports.strictlySortedLength=u,exports.isSortedU=a,exports.isSorted=o,exports.stableSortInPlaceByU=y,exports.stableSortInPlaceBy=S,exports.stableSortByU=h,exports.stableSortBy=g,exports.binarySearchByU=d,exports.binarySearchBy=B,exports.unionU=v,exports.union=c,exports.intersectU=l,exports.intersect=p,exports.diffU=x,exports.diff=_;
},{"./curry.js":"NSLD","./belt_Array.js":"yUxI"}],"H9fU":[function(require,module,exports) {
"use strict";var r=require("./curry.js"),t=require("./belt_Array.js"),n=require("./caml_option.js"),e=require("./belt_SortArray.js");function o(r){if(r)return n.some(r.hd)}function u(r){if(r)return r.hd;throw{RE_EXN_ID:"Not_found",Error:new Error}}function f(r){if(r)return r.tl}function i(r){if(r)return r.tl;throw{RE_EXN_ID:"Not_found",Error:new Error}}function l(r,t){return{hd:t,tl:r}}function a(r,t){if(!(t<0))for(var e=r,o=t;;){var u=o,f=e;if(!f)return;if(0===u)return n.some(f.hd);o=u-1|0,e=f.tl}}function d(r,t){if(t<0)throw{RE_EXN_ID:"Not_found",Error:new Error};for(var n=r,e=t;;){var o=e,u=n;if(!u)throw{RE_EXN_ID:"Not_found",Error:new Error};if(0===o)return u.hd;e=o-1|0,n=u.tl}}function h(r,t,n,e){for(;;){var o=e,u=n,f=t;if(!f)return;var i=f.tl,l=f.hd,a={hd:l,tl:0};r(l)?(u.tl=a,n=a,t=i):(o.tl=a,e=a,t=i)}}function s(r,t,n){for(;;){var e=n,o=t,u=r;if(!u)return;var f=u.hd,i={hd:f[0],tl:0},l={hd:f[1],tl:0};o.tl=i,e.tl=l,n=l,t=i,r=u.tl}}function c(r,t){for(;;){var n=t,e=r;if(!e)return n;var o={hd:e.hd,tl:0};n.tl=o,t=o,r=e.tl}}function v(r,t,n){for(;;){var e=n,o=t;if(!o)return;var u=o.tl,f=o.hd;if(r(f)){var i={hd:f,tl:0};e.tl=i,n=i,t=u}else t=u}}function p(r,t,n,e){for(;;){var o=e,u=n,f=t;if(!f)return;var i=f.tl,l=f.hd;if(r(l,o)){var a={hd:l,tl:0};u.tl=a,e=o+1|0,n=a,t=i}else e=o+1|0,t=i}}function x(r,t,e){for(;;){var o=e,u=t;if(!u)return;var f=u.tl,i=r(u.hd);if(void 0===i)t=f;else{var l={hd:n.valFromOption(i),tl:0};o.tl=l,e=l,t=f}}}function _(r,t,n,e){for(;;){var o=n,u=r;if(!u)return!1;var f=u.tl,i=u.hd;if(e(i[0],t))return o.tl=f,!0;var l={hd:i,tl:0};o.tl=l,n=l,r=f}}function U(r,t,n,e,o){for(;;){var u=e,f=r;if(!f)return!1;var i=f.tl,l=f.hd;if(o(l[0],t))return u.tl={hd:[t,n],tl:i},!0;var a={hd:l,tl:0};u.tl=a,e=a,r=i}}function m(r,t,n){for(;;){var e=t,o=r;if(!o)return;var u={hd:n(o.hd),tl:0};e.tl=u,t=u,r=o.tl}}function E(r,t,n){for(;;){var e=n,o=t,u=r;if(!u)return;if(!o)return;var f={hd:[u.hd,o.hd],tl:0};e.tl=f,n=f,t=o.tl,r=u.tl}}function y(r,t,n,e){for(;;){var o=e,u=n,f=t;if(!f)return;if(!u)return;var i={hd:r(f.hd,u.hd),tl:0};o.tl=i,e=i,n=u.tl,t=f.tl}}function I(r,t,n,e){for(;;){var o=e,u=n,f=t;if(!u)return;var i={hd:r(f,u.hd),tl:0};o.tl=i,e=i,n=u.tl,t=f+1|0}}function A(r,t,n){for(;;){var e=n,o=t,u=r;if(0===u)return!0;if(!o)return!1;var f={hd:o.hd,tl:0};e.tl=f,n=f,t=o.tl,r=u-1|0}}function R(r,t,n){for(;;){var e=n,o=t,u=r;if(0===u)return o;if(!o)return;var f={hd:o.hd,tl:0};e.tl=f,n=f,t=o.tl,r=u-1|0}}function g(r,t){if(!(t<0)){if(0===t)return 0;if(r){var n={hd:r.hd,tl:0};return A(t-1|0,r.tl,n)?n:void 0}}}function k(r,t){if(!(t<0))for(var n=r,e=t;;){if(0===e)return n;if(!n)return;e=e-1|0,n=n.tl}}function w(r,t){if(!(t<0)){if(0===t)return[0,r];if(r){var n={hd:r.hd,tl:0},e=R(t-1|0,r.tl,n);return void 0!==e?[n,e]:void 0}}}function W(r,t){if(!r)return t;var n={hd:r.hd,tl:0};return c(r.tl,n).tl=t,n}function B(r,t){if(!r)return 0;var n={hd:t(r.hd),tl:0};return m(r.tl,n,t),n}function N(t,n){return B(t,r.__1(n))}function q(r,t,n){if(!r)return 0;if(!t)return 0;var e={hd:n(r.hd,t.hd),tl:0};return y(n,r.tl,t.tl,e),e}function z(t,n,e){return q(t,n,r.__2(e))}function j(r,t){if(!r)return 0;var n={hd:t(0,r.hd),tl:0};return I(t,1,r.tl,n),n}function D(t,n){return j(t,r.__2(n))}function X(r,t){if(r<=0)return 0;for(var n={hd:t(0),tl:0},e=n,o=1;o<r;){var u={hd:t(o),tl:0};e.tl=u,e=u,o=o+1|0}return n}function b(t,n){return X(t,r.__1(n))}function M(r,t){if(r<=0)return 0;for(var n={hd:t,tl:0},e=n,o=1;o<r;){var u={hd:t,tl:0};e.tl=u,e=u,o=o+1|0}return n}function F(r){for(var t=r,n=0;;){if(!t)return n;n=n+1|0,t=t.tl}}function O(r,t,n){for(;;){var e=n,o=t;if(!e)return;r[o]=e.hd,n=e.tl,t=o+1|0}}function P(r){for(var t=r.length-1|0,n=0;;){var e=n,o=t;if(o<0)return e;n={hd:r[o],tl:e},t=o-1|0}}function S(r){var t=F(r),n=new Array(t);return O(n,0,r),n}function C(r){var n=S(r);return t.shuffleInPlace(n),P(n)}function L(r,t){for(;;){var n=t,e=r;if(!e)return n;t={hd:e.hd,tl:n},r=e.tl}}function G(r){return L(r,0)}function H(r,t){for(;;){var n=t,e=r;if(!n)return void(e.tl=0);t=n.tl,r=c(n.hd,e)}}function J(r){for(;;){var t=r;if(!t)return 0;var n=t.hd;if(n){var e={
},{"./curry.js":"NSLD","./belt_Array.js":"yUxI","./caml_option.js":"dzFO","./belt_SortArray.js":"mJOW"}],"tKwj":[function(require,module,exports) {
"use strict";var r=require("./curry.js");function t(r){if(0===r.TAG)return r._0;throw{RE_EXN_ID:"Not_found",Error:new Error}}function n(r,t,n){return 0===r.TAG?n(r._0):t}function e(t,e,u){return n(t,e,r.__1(u))}function u(r,t){return 0===r.TAG?{TAG:0,_0:t(r._0)}:{TAG:1,_0:r._0}}function o(t,n){return u(t,r.__1(n))}function _(r,t){return 0===r.TAG?t(r._0):{TAG:1,_0:r._0}}function i(t,n){return _(t,r.__1(n))}function p(r,t){return 0===r.TAG?r._0:t}function f(r){return 0===r.TAG}function s(r){return 0!==r.TAG}function c(r,t,n){return 0===r.TAG?0===t.TAG&&n(r._0,t._0):0!==t.TAG}function A(t,n,e){return c(t,n,r.__2(e))}function G(r,t,n){return 0===r.TAG?0===t.TAG?n(r._0,t._0):1:0===t.TAG?-1:0}function T(t,n,e){return G(t,n,r.__2(e))}exports.getExn=t,exports.mapWithDefaultU=n,exports.mapWithDefault=e,exports.mapU=u,exports.map=o,exports.flatMapU=_,exports.flatMap=i,exports.getWithDefault=p,exports.isOk=f,exports.isError=s,exports.eqU=c,exports.eq=A,exports.cmpU=G,exports.cmp=T;
},{"./curry.js":"NSLD"}],"ApXr":[function(require,module,exports) {
"use strict";var r=require("./curry.js"),t=require("./caml_option.js"),n=require("./belt_SortArray.js");function e(r){return void 0!==r?r.h:0}function o(r){return void 0!==r?{k:r.k,v:r.v,h:r.h,l:o(r.l),r:o(r.r)}:r}function i(r,t,n,o){var i=e(r),u=e(o);return{k:t,v:n,h:i>=u?i+1|0:u+1|0,l:r,r:o}}function u(r,t){return{k:r,v:t,h:1,l:void 0,r:void 0}}function v(r,t){return void 0===t||void 0!==r&&r.h>=t.h}function f(r,t){return r.v===t?r:{k:r.k,v:t,h:r.h,l:r.l,r:r.r}}function a(r,t,n,o){var u=void 0!==r?r.h:0,v=void 0!==o?o.h:0;if(u>(v+2|0)){var f=r.l,a=r.r;return e(f)>=e(a)?i(f,r.k,r.v,i(a,t,n,o)):i(i(f,r.k,r.v,a.l),a.k,a.v,i(a.r,t,n,o))}if(v<=(u+2|0))return{k:t,v:n,h:u>=v?u+1|0:v+1|0,l:r,r:o};var c=o.l,s=o.r;return e(s)>=e(c)?i(i(r,t,n,c),o.k,o.v,s):i(i(r,t,n,c.l),c.k,c.v,i(c.r,o.k,o.v,s))}function c(r){for(;;){var t=r,n=t.l;if(void 0===n)return t.k;r=n}}function s(r){if(void 0!==r)return t.some(c(r))}function d(r){if(void 0!==r)return c(r)}function l(r){for(;;){var t=r,n=t.r;if(void 0===n)return t.k;r=n}}function p(r){if(void 0!==r)return t.some(l(r))}function x(r){if(void 0!==r)return l(r)}function k(r){for(;;){var t=r,n=t.l;if(void 0===n)return[t.k,t.v];r=n}}function h(r){if(void 0!==r)return k(r)}function m(r){if(void 0!==r)return k(r)}function _(r){for(;;){var t=r,n=t.r;if(void 0===n)return[t.k,t.v];r=n}}function y(r){if(void 0!==r)return _(r)}function A(r){if(void 0!==r)return _(r)}function U(r,t,n){var e=r.l;return void 0!==e?a(U(e,t,n),r.k,r.v,r.r):(t.contents=r.k,n.contents=r.v,r.r)}function E(r){return void 0===r}function g(r,t){for(;;){if(void 0===r)return t;t={hd:r,tl:t},r=r.l}}function w(r,t){if(void 0!==r){var n=w(r.l,t);if(void 0!==n)return n;var e=r.k,o=r.v;if(t(e,o))return[e,o];var i=w(r.r,t);return void 0!==i?i:void 0}}function S(t,n){return w(t,r.__2(n))}function M(r,t){for(;;){var n=r;if(void 0===n)return;M(n.l,t),t(n.k,n.v),r=n.r}}function K(t,n){return M(t,r.__2(n))}function q(r,t){if(void 0!==r){var n=q(r.l,t),e=t(r.v),o=q(r.r,t);return{k:r.k,v:e,h:r.h,l:n,r:o}}}function R(t,n){return q(t,r.__1(n))}function W(r,t){if(void 0!==r){var n=r.k,e=W(r.l,t),o=t(n,r.v),i=W(r.r,t);return{k:n,v:o,h:r.h,l:e,r:i}}}function b(t,n){return W(t,r.__2(n))}function j(r,t,n){for(;;){var e=t,o=r;if(void 0===o)return e;var i=o.k,u=o.v,v=o.l,f=o.r;t=n(j(v,e,n),i,u),r=f}}function F(t,n,e){return j(t,n,r.__3(e))}function I(r,t){for(;;){var n=r;if(void 0===n)return!0;if(!t(n.k,n.v))return!1;if(!I(n.l,t))return!1;r=n.r}}function L(t,n){return I(t,r.__2(n))}function N(r,t){for(;;){var n=r;if(void 0===n)return!1;if(t(n.k,n.v))return!0;if(N(n.l,t))return!0;r=n.r}}function D(t,n){return N(t,r.__2(n))}function O(r,t,n){return void 0!==r?a(O(r.l,t,n),r.k,r.v,r.r):u(t,n)}function B(r,t,n){return void 0!==r?a(r.l,r.k,r.v,B(r.r,t,n)):u(t,n)}function T(r,t,n,e){if(void 0===r)return O(e,t,n);if(void 0===e)return B(r,t,n);var o=r.k,u=r.v,v=r.h,f=r.l,c=r.r,s=e.k,d=e.v,l=e.h,p=e.l,x=e.r;return v>(l+2|0)?a(f,o,u,T(c,t,n,e)):l>(v+2|0)?a(T(r,t,n,p),s,d,x):i(r,t,n,e)}function V(r,t){if(void 0===r)return t;if(void 0===t)return r;var n={contents:t.k},e={contents:t.v},o=U(t,n,e);return T(r,n.contents,e.contents,o)}function X(r,n,e,o){return void 0!==e?T(r,n,t.valFromOption(e),o):V(r,o)}function z(r,t){if(void 0!==r){var n=r.k,e=r.v,o=z(r.l,t),i=t(n,e),u=z(r.r,t);return i?T(o,n,e,u):V(o,u)}}function J(t,n){return z(t,r.__2(n))}function C(r,n){if(void 0!==r){var e=r.k,o=r.v,i=C(r.l,n),u=n(e,o),v=C(r.r,n);return void 0!==u?T(i,e,t.valFromOption(u),v):V(i,v)}}function G(t,n){return C(t,r.__2(n))}function H(r,t){if(void 0===r)return[void 0,void 0];var n=r.k,e=r.v,o=H(r.l,t),i=o[1],u=o[0],v=t(n,e),f=H(r.r,t),a=f[1],c=f[0];return v?[T(u,n,e,c),V(i,a)]:[V(u,c),T(i,n,e,a)]}function P(t,n){return H(t,r.__2(n))}function Q(r){var t=r.l,n=r.r;return(1+(void 0!==t?Q(t):0)|0)+(void 0!==n?Q(n):0)|0}function Y(r){return void 0!==r?Q(r):0}function Z(r,t){for(;;){var n=t,e=r;if(void 0===e)return n;var o=e.k,i=e.v,u=e.l;t={hd:[o,i],tl:Z(e.r,n)},r=u}}function $(r){return Z(r,0)}function rr(r){for(;;){var t=r;if(void 0===t)return;var n=t.l,o=t.r,i=e(n)-e(o)|0;if(!(i<=
},{"./curry.js":"NSLD","./caml_option.js":"dzFO","./belt_SortArray.js":"mJOW"}],"aHaK":[function(require,module,exports) {
"use strict";var t,r,e=require("./curry.js"),n=require("./caml_option.js"),a=require("./belt_internalAVLtree.js");function o(t,r,e){var n=e(r,t.k);if(0===n){var u=t.l,i=t.r;return void 0!==u?void 0!==i?(t.r=a.removeMinAuxWithRootMutate(t,i),a.balMutate(t)):u:void 0!==i?i:u}if(n<0){var d=t.l;return void 0!==d?(t.l=o(d,r,e),a.balMutate(t)):t}var c=t.r;return void 0!==c?(t.r=o(c,r,e),a.balMutate(t)):t}function u(t,r){var e=t.data;if(void 0!==e){var n=o(e,r,t.cmp);n===e||(t.data=n)}}function i(t,r,e,n,a){for(;;){var u=e;if(u>=n)return t;var i=o(t,r[u],a);if(void 0===i)return;e=u+1|0,t=i}}function d(t,r){var e=t.data;if(void 0!==e){var n=i(e,r,0,r.length,t.cmp);n===e||(t.data=n)}}function c(t,r,e,o){if(void 0!==t){var u=o(r,t.k);if(0===u){var i=e(n.some(t.v));if(void 0!==i)return t.v=n.valFromOption(i),t;var d=t.l,p=t.r;return void 0!==d?void 0!==p?(t.r=a.removeMinAuxWithRootMutate(t,p),a.balMutate(t)):d:void 0!==p?p:d}return u<0?t.l=c(t.l,r,e,o):t.r=c(t.r,r,e,o),a.balMutate(t)}var f=e(void 0);return void 0!==f?a.singleton(r,n.valFromOption(f)):t}function p(t,r,e){var n=t.data,a=c(n,r,e,t.cmp);a===n||(t.data=a)}function f(t,r,n){return p(t,r,e.__1(n))}function m(t){return{cmp:t.cmp,data:void 0}}function s(t){t.data=void 0}function x(t){return void 0===t.data}function v(t){return a.minKey(t.data)}function U(t){return a.minKeyUndefined(t.data)}function y(t){return a.maxKey(t.data)}function l(t){return a.maxKeyUndefined(t.data)}function _(t){return a.minimum(t.data)}function h(t){return a.minUndefined(t.data)}function g(t){return a.maximum(t.data)}function M(t){return a.maxUndefined(t.data)}function A(t,r){return a.forEachU(t.data,r)}function K(t,r){return a.forEachU(t.data,e.__2(r))}function k(t,r,e){return a.reduceU(t.data,r,e)}function E(t,r,n){return k(t,r,e.__3(n))}function W(t,r){return a.everyU(t.data,r)}function b(t,r){return a.everyU(t.data,e.__2(r))}function q(t,r){return a.someU(t.data,r)}function I(t,r){return a.someU(t.data,e.__2(r))}function T(t){return a.size(t.data)}function j(t){return a.toList(t.data)}function L(t){return a.toArray(t.data)}function z(t){return a.keysToArray(t.data)}function D(t){return a.valuesToArray(t.data)}function F(t){return a.checkInvariantInternal(t.data)}function O(t,r,e){return a.cmpU(t.data,r.data,t.cmp,e)}function R(t,r,n){return O(t,r,e.__2(n))}function $(t,r,e){return a.eqU(t.data,r.data,t.cmp,e)}function S(t,r,n){return $(t,r,e.__2(n))}function V(t,r){return{cmp:t.cmp,data:a.mapU(t.data,r)}}function w(t,r){return V(t,e.__1(r))}function B(t,r){return{cmp:t.cmp,data:a.mapWithKeyU(t.data,r)}}function C(t,r){return B(t,e.__2(r))}function G(t,r){return a.get(t.data,r,t.cmp)}function H(t,r){return a.getUndefined(t.data,r,t.cmp)}function J(t,r,e){return a.getWithDefault(t.data,r,e,t.cmp)}function N(t,r){return a.getExn(t.data,r,t.cmp)}function P(t,r){return a.has(t.data,r,t.cmp)}function Q(t,r){var e=r.cmp;return{cmp:e,data:a.fromArray(t,e)}}function X(t,r,e){var n=t.data,o=a.updateMutate(n,r,e,t.cmp);o===n||(t.data=o)}function Y(t,r,e){for(var n=t,o=0,u=r.length;o<u;++o){var i=r[o];n=a.updateMutate(n,i[0],i[1],e)}return n}function Z(t,r){var e=t.data,n=Y(e,r,t.cmp);n===e||(t.data=n)}exports.Int=t,exports.$$String=r,exports.make=m,exports.clear=s,exports.isEmpty=x,exports.has=P,exports.cmpU=O,exports.cmp=R,exports.eqU=$,exports.eq=S,exports.forEachU=A,exports.forEach=K,exports.reduceU=k,exports.reduce=E,exports.everyU=W,exports.every=b,exports.someU=q,exports.some=I,exports.size=T,exports.toList=j,exports.toArray=L,exports.fromArray=Q,exports.keysToArray=z,exports.valuesToArray=D,exports.minKey=v,exports.minKeyUndefined=U,exports.maxKey=y,exports.maxKeyUndefined=l,exports.minimum=_,exports.minUndefined=h,exports.maximum=g,exports.maxUndefined=M,exports.get=G,exports.getUndefined=H,exports.getWithDefault=J,exports.getExn=N,exports.checkInvariantInternal=F,exports.remove=u,exports.removeMany=d,exports.set=X,exports.updateU=p,exports.update=f,exports.mergeMany=Z,exports.mapU=V,exports.map=w,exports.mapWithKeyU=B,exports.mapWithKey=C;
},{"./curry.js":"NSLD","./caml_option.js":"dzFO","./belt_internalAVLtree.js":"ApXr"}],"cfqr":[function(require,module,exports) {
"use strict";var r=require("rescript/lib/js/curry.js"),e=require("rescript/lib/js/caml_obj.js"),t=e.caml_equal;function n(t,n,s){return e.caml_equal(r._1(t,n),r._1(t,s))}function s(r,e){return r===e}var i={contents:0};function c(r,e){var t=void 0!==r?r:"";return i.contents=i.contents+1|0,t+String(i.contents)}exports.eq=t,exports.eqBy=n,exports.identical=s,exports.idCounter=i,exports.uniqueId=c;
},{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/caml_obj.js":"p3B5"}],"QyI5":[function(require,module,exports) {
"use strict";var r=require("rescript/lib/js/list.js"),n=require("rescript/lib/js/curry.js");function t(t){var e=t.$$return,u=t.fmap,i="object"==typeof u?u.VAL:function(r,e){return n._2(t.bind,e,function(e){return n._1(t.$$return,n._1(r,e))})},o=t.bind,f=function(r,t){return n._2(o,r,function(r){return t})},c=function(t,u){if(!u)return n._1(e,r.rev(t));var i=u.tl;return n._2(o,u.hd,function(r){return c({hd:r,tl:t},i)})},a=function(r){if(!r)return n._1(e,void 0);var t=r.tl;return n._2(o,r.hd,function(r){return a(t)})};return{bind:t.bind,$$return:e,fmap:i,$great$great$eq:o,$less$$great:function(r,t){return n._2(i,t,r)},seq:f,$great$great:f,join:function(r){return n._2(o,r,function(r){return r})},all:function(r){return c(0,r)},all_ignore:a}}function e(t){var e=t.bind,u=t.$$return,i=t.fmap,o="object"==typeof i?i.VAL:function(r,t){return n._2(e,t,function(t){return n._1(u,n._1(r,t))})},f=function(r,t){return n._2(e,r,function(r){return t})},c=function(t,i){if(!i)return n._1(u,r.rev(t));var o=i.tl;return n._2(e,i.hd,function(r){return c({hd:r,tl:t},o)})},a=function(r){if(!r)return n._1(u,void 0);var t=r.tl;return n._2(e,r.hd,function(r){return a(t)})};return{bind:e,$$return:u,fmap:o,$great$great$eq:e,$less$$great:function(r,t){return n._2(o,t,r)},seq:f,$great$great:f,join:function(r){return n._2(e,r,function(r){return r})},all:function(r){return c(0,r)},all_ignore:a}}function u(t){var e=t.bind,u=t.$$return,i=t.fmap,o="object"==typeof i?i.VAL:function(r,t){return n._2(e,t,function(t){return n._1(u,n._1(r,t))})},f=function(r,t){return n._2(e,r,function(r){return t})},c=function(t,i){if(!i)return n._1(u,r.rev(t));var o=i.tl;return n._2(e,i.hd,function(r){return c({hd:r,tl:t},o)})},a=function(r){if(!r)return n._1(u,void 0);var t=r.tl;return n._2(e,r.hd,function(r){return a(t)})};return{bind:e,$$return:u,fmap:o,$great$great$eq:e,$less$$great:function(r,t){return n._2(o,t,r)},seq:f,$great$great:f,join:function(r){return n._2(e,r,function(r){return r})},all:function(r){return c(0,r)},all_ignore:a}}function i(t){var e=t.bind,u=t.$$return,i=t.fmap,o="object"==typeof i?i.VAL:function(r,t){return n._2(e,t,function(t){return n._1(u,n._1(r,t))})},f=function(r,t){return n._2(e,r,function(r){return t})},c=function(t,i){if(!i)return n._1(u,r.rev(t));var o=i.tl;return n._2(e,i.hd,function(r){return c({hd:r,tl:t},o)})},a=function(r){if(!r)return n._1(u,void 0);var t=r.tl;return n._2(e,r.hd,function(r){return a(t)})};return{bind:e,$$return:u,fmap:o,$great$great$eq:e,$less$$great:function(r,t){return n._2(o,t,r)},seq:f,$great$great:f,join:function(r){return n._2(e,r,function(r){return r})},all:function(r){return c(0,r)},all_ignore:a}}exports.MakeGeneral=t,exports.MakeBasic=e,exports.MakeBasic2=u,exports.MakeBasic3=i;
},{"rescript/lib/js/list.js":"aYjQ","rescript/lib/js/curry.js":"NSLD"}],"JPps":[function(require,module,exports) {
"use strict";var t=require("rescript/lib/js/curry.js"),n=require("rescript/lib/js/caml_option.js");function e(t,n){return t}function o(n,e,o){return t._1(n,t._1(e,o))}function i(n,e,o){return t._1(e,t._1(n,o))}function r(t){return!1}function s(t){return!0}function c(n,e,o){return t._2(n,o,e)}function u(t){return t}var p={$less$pipe$pipe:o,$pipe$pipe$great:i};function v(t,n){return setTimeout(t,n)}function a(e,o,i){var r=void 0!==e&&e,s={contents:void 0},c=function(t){s.contents=n.some(setTimeout(t,i))};return function(e){var i=s.contents;return r?void 0!==i?(clearTimeout(n.valFromOption(i)),c(function(t){s.contents=void 0})):(t._1(o,void 0),c(function(t){s.contents=void 0})):void 0!==i?(clearTimeout(n.valFromOption(i)),c(function(n){t._1(o,void 0),s.contents=void 0})):c(function(n){t._1(o,void 0),s.contents=void 0})}}function f(e,o){var i={contents:void 0},r={contents:0};return function(s){var c=i.contents;if(void 0===c)t._1(e,void 0),i.contents=n.some(setTimeout(function(t){i.contents=void 0},o)),r.contents=Date.now();else{clearTimeout(n.valFromOption(c));var u=Date.now(),p=o-(u-r.contents|0)|0;p<=0||p>o?(t._1(e,void 0),r.contents=Date.now()):i.contents=n.some(setTimeout(function(n){t._1(e,void 0),r.contents=Date.now()},p))}}}var d=o,l=i;exports.always=e,exports.compose=o,exports.pipe=i,exports.false_=r,exports.true_=s,exports.flip=c,exports.identity=u,exports.Infix=p,exports.$less$pipe$pipe=d,exports.$pipe$pipe$great=l,exports.delay=v,exports.debounce=a,exports.throttle=f;
},{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/caml_option.js":"dzFO"}],"tIKZ":[function(require,module,exports) {
"use strict";function e(e){return{apply:e.apply,pure:e.pure,alt:e.alt,empty:e.empty,$less$star$great:e.apply,$less$pipe$great:e.alt}}exports.MakeBasic=e;
},{}],"Ddhm":[function(require,module,exports) {
"use strict";var r=require("rescript/lib/js/curry.js"),t=require("rescript/lib/js/caml_option.js"),e=require("./Monad.bs.js"),o=require("./Function.bs.js"),n=require("./Alternative.bs.js");function i(r){return t.some(r)}function s(r){}function p(r){return void 0===r}function u(r){return void 0!==r}function a(r,e){return void 0!==e?t.valFromOption(e):r}function f(r){if(0===r.TAG)return t.some(r._0)}function l(r,e){if(void 0!==e)return t.valFromOption(e);throw{RE_EXN_ID:"Failure",_1:r,Error:new Error}}function $(r,t){return void 0!==r?r:t}function v(e){try{return t.some(r._1(e,void 0))}catch(o){return}}function c(e,o){if(void 0!==e)return r._1(o,t.valFromOption(e))}var x=e.MakeBasic({bind:c,$$return:i,fmap:"DefineWithBind"}),d=x.bind,m=x.$$return,_=x.$great$great$eq,F=x.$less$$great;function g(t,e){if(void 0!==t)return r._2(d,e,function(e){return r._1(m,r._1(t,e))})}function O(r,t){return void 0!==r?r:t}function q(r){}var y=n.MakeBasic({alt:O,empty:q,apply:g,pure:i}),b=y.alt;function j(r,t){return o.flip(F,r,t)}function h(e,o){if(void 0!==o)return r._1(e,t.valFromOption(o))}function E(e,o,n){return void 0!==n?r._2(e,o,t.valFromOption(n)):o}function M(e,o){if(void 0!==o&&r._1(e,t.valFromOption(o)))return o}function B(e,o){return void 0!==o&&r._1(e,t.valFromOption(o))}function k(r){if(void 0!==r)return t.valFromOption(r)}function w(r,t){return o.flip(_,r,t)}function A(e,o,n){return void 0!==o?void 0!==n?r._2(e,t.valFromOption(o),t.valFromOption(n)):1:void 0!==n?-1:0}function D(e,o,n){return void 0!==o?void 0!==n&&r._2(e,t.valFromOption(o),t.valFromOption(n)):void 0===n}function I(r){return void 0!==r?{hd:t.valFromOption(r),tl:0}:0}function L(r){if(r)return t.some(r.hd)}var N=x.fmap,R=y.$less$pipe$great,S=y.empty,W=y.apply,G=y.pure,T=y.$less$star$great,X={$great$great$eq:_,$less$$great:F,$less$star$great:T,$pipe$question:$,$less$pipe$great:b};exports.some=i,exports.none=s,exports.isNone=p,exports.isSome=u,exports.$$default=a,exports.default=a,exports.__esModule=!0,exports.ofResult=f,exports.toExn=l,exports.firstSome=$,exports.tryWith=v,exports.bind=d,exports.$great$great$eq=_,exports.$$return=m,exports.fmap=N,exports.$less$$great=F,exports.$less$pipe$great=R,exports.empty=S,exports.alt=b,exports.apply=W,exports.pure=G,exports.Infix=X,exports.map=j,exports.iter=h,exports.fold=E,exports.filter=M,exports.exists=B,exports.flatten=k,exports.flatMap=w,exports.compare=A,exports.equal=D,exports.toList=I,exports.ofList=L;
},{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/caml_option.js":"dzFO","./Monad.bs.js":"QyI5","./Function.bs.js":"JPps","./Alternative.bs.js":"tIKZ"}],"KUwe":[function(require,module,exports) {
"use strict";var r=require("rescript/lib/js/list.js"),t=require("rescript/lib/js/curry.js"),n=require("rescript/lib/js/caml_obj.js"),e=require("rescript/lib/js/pervasives.js"),u=require("rescript/lib/js/caml_option.js"),i=require("./Util.bs.js"),o=require("./Option.bs.js"),f=require("./Function.bs.js");function s(t){var n;try{n=r.hd(t)}catch(e){return}return u.some(n)}function a(t){var n;try{n=r.tl(t)}catch(e){return}return n}function c(t,n){var e;try{e=r.nth(n,t)}catch(i){return}return u.some(e)}function l(n){return t._2(o.$less$$great,a(r.rev(n)),r.rev)}function p(t){return s(r.rev(t))}function v(n,e){return r.fold_left(function(r,e){return r||t._1(n,e)},!1,e)}function d(n,e){return r.fold_left(function(r,e){return r?t._1(n,e):r},!0,e)}function x(t,n){return r.append(n,{hd:t,tl:0})}function h(t,n){return r.append(n,t)}function _(r,t){for(var n=r,e=t,u=0;;){var i=u,o=e,f=n;if(f<=0)return i;if(!o)return i;u=x(o.hd,i),e=o.tl,n=f-1|0}}function $(t,n){return r.rev(_(t,r.rev(n)))}function g(r,n){for(var e=n,u=0;;){var i=u,o=e;if(!o)return i;var f=o.hd;if(!t._1(r,f))return i;u=x(f,i),e=o.tl}}function q(t,n){return r.rev(g(t,r.rev(n)))}function j(r,t){for(;;){var n=r;if(!t)return 0;if(n<=0)return t;t=t.tl,r=n-1|0}}function m(t,n){return _(r.length(n)-t|0,n)}function W(r,n){for(;;){var e=n;if(!e)return 0;if(!t._1(r,e.hd))return e;n=e.tl}}function y(t,n){return r.rev(W(t,r.rev(n)))}function b(n,e){for(var u=e,i=0;;){var f=i,a=u;if(!a)return f;var c=a.tl,l=a.hd;0!==r.length(f)?o.$$default(!1,t._2(o.$less$$great,s(r.rev(f)),t._1(n,l)))?u=c:(i=x(l,f),u=c):(i=x(l,f),u=c)}}function I(r){return b(n.caml_equal,r)}function L(t,n){return[_(t,n),$(r.length(n)-t|0,n)]}function O(n,e,u){var i=L(e+1|0,u),a=i[1],c=i[0];return e<0||e>=r.length(u)?u:c?c.tl?o.$$default(u,t._2(o.$less$$great,t._2(o.$great$great$eq,l(c),function(e){return t._2(o.$less$$great,t._2(o.$less$$great,s(r.rev(c)),n),function(r){return f.flip(x,e,r)})}),function(t){return r.append(t,a)})):{hd:t._1(n,c.hd),tl:a}:a}function k(t,n){for(var e=n,u=0;;){var i=u,o=e;if(!o)return i;if(r.length(o)<t)return i;u=x(_(t,o),i),e=o.tl}}function F(t){return function(n){return r.exists(t,n)}}function w(t){return function(n){return r.exists(function(r){return i.eq(t,r)},n)}}function z(n,e){return o.$$default(!1,t._2(o.$less$$great,s(r.rev(e)),function(r){return i.eq(n,r)}))}function A(t,n){var e;try{e=r.find(t,n)}catch(i){return}return u.some(e)}function B(r,n){for(var e=n,u=0;;){var i=u,o=e;if(!o)return;if(t._1(r,o.hd))return i;u=i+1|0,e=o.tl}}function R(t,n){return A(t,r.rev(n))}function E(t,n){var e=B(t,r.rev(n));if(void 0!==e)return(r.length(n)-e|0)-1|0}function U(n,e){for(var u=0,i=e,f=0;;){var a=f,c=i,l=u;if(!c)return 0===r.length(a)?{hd:0,tl:0}:a;if(!c.tl)return x({hd:c.hd,tl:0},a);if(l>r.length(c))return x(c,a);var p=L(l+1|0,c),v=p[1],d=p[0];o.$$default(!0,t._2(o.Infix.$less$star$great,t._2(o.Infix.$less$star$great,n,s(r.rev(d))),s(v)))?u=l+1|0:(f=x(d,a),i=v,u=0)}}function C(r,t){return B(function(t){return n.caml_equal(r,t)},t)}function D(t,n,e){var u=L(t,e);return r.append(x(n,u[0]),u[1])}function G(t,n,e){var u=L(t,e);return r.append(r.append(u[0],n),u[1])}function H(t,n){return r.fold_left(function(n,e){return r.length(n)>0?x(e,x(t,n)):{hd:e,tl:0}},0,n)}function J(t){return function(n){return r.fold_left(function(r,n){return 0===r.length?n:r+(t+n)},"",n)}}function K(t,n){var e=C(t,r.rev(n));if(void 0!==e)return(r.length(n)-e|0)-1|0}function M(t,n){return!r.exists(t,n)}function N(n,e){return[r.filter(n)(e),r.filter(function(r){return!t._1(n,r)})(e)]}function P(e,u,i){for(var o=0;;){var f=o,s=r.rev(f);if(s){var a=s.hd;if(n.caml_greaterthan(t._1(e,a),i))return f;o=x(t._1(e,a),f)}else o={hd:u,tl:0}}}function Q(r){return function(t,n){return P(function(t){return t+r|0},t,n)}}function S(r){return function(t,n){return P(function(t){return t+r},t,n)}}function T(n,e,u,i){return r.fold_left(function(r,u){if(!r[0])return r;var i=r[1];return t._2(n,i,u)?[!0,t._2(e,i,u)]:[!1,i]},[!0,u],i)[1]}function V(n){return r.filter(function(r){return!t._1(n,r)})}function X(r,t,n){var u=L(r,n);return
},{"rescript/lib/js/list.js":"aYjQ","rescript/lib/js/curry.js":"NSLD","rescript/lib/js/caml_obj.js":"p3B5","rescript/lib/js/pervasives.js":"z22f","rescript/lib/js/caml_option.js":"dzFO","./Util.bs.js":"cfqr","./Option.bs.js":"Ddhm","./Function.bs.js":"JPps"}],"SRS9":[function(require,module,exports) {
"use strict";var r=require("rescript/lib/js/curry.js"),e=require("rescript/lib/js/caml_option.js"),t=require("./Monad.bs.js");function n(r){return{TAG:1,_0:r}}function o(r){return 0===r.TAG}function s(r){if(0===r.TAG)return e.some(r._0)}function i(r){return 0===r.TAG?void 0:e.some(r._0)}function u(r){return 0!==r.TAG}function a(r,t){return void 0!==t?{TAG:0,_0:e.valFromOption(t)}:{TAG:1,_0:r}}function p(e,t){return 0===e.TAG?{TAG:0,_0:r._1(e._0,t)}:{TAG:1,_0:e._0}}function $(e,t,n){return 0===n.TAG?r._1(e,n._0):r._1(t,n._0)}function _(e,t,n){return 0===n.TAG?{TAG:0,_0:r._1(e,n._0)}:{TAG:1,_0:r._1(t,n._0)}}function x(e,t){return 0===e.TAG?r._1(t,e._0):{TAG:1,_0:e._0}}function f(r){return{TAG:0,_0:r}}var c=t.MakeBasic2({bind:x,$$return:f,fmap:"DefineWithBind"}),g=c.$great$great$eq,l=c.$less$$great,A={$great$great$eq:g,$less$$great:l},G=c.bind,T=c.$$return,m=c.fmap,q=c.seq,b=c.$great$great,d=c.join,j=c.all,v=c.all_ignore;exports.fail=n,exports.isOk=o,exports.getOk=s,exports.getError=i,exports.isError=u,exports.ofOption=a,exports.ap=p,exports.result=$,exports.bimap=_,exports.bind=G,exports.$$return=T,exports.fmap=m,exports.$great$great$eq=g,exports.$less$$great=l,exports.seq=q,exports.$great$great=b,exports.join=d,exports.all=j,exports.all_ignore=v,exports.Infix=A;
},{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/caml_option.js":"dzFO","./Monad.bs.js":"QyI5"}],"xX5m":[function(require,module,exports) {
"use strict";function r(r,t,n){return t in r?Object.defineProperty(r,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[t]=n,r}var t=require("rescript/lib/js/caml.js"),n=require("rescript/lib/js/list.js"),e=require("rescript/lib/js/array.js"),i=require("rescript/lib/js/curry.js"),o=require("rescript/lib/js/belt_Id.js"),u=require("rescript/lib/js/js_json.js"),a=require("rescript/lib/js/js_math.js"),f=require("rescript/lib/js/caml_obj.js"),c=require("rescript/lib/js/belt_List.js"),s=require("rescript/lib/js/belt_Array.js"),l=require("rescript/lib/js/caml_array.js"),m=require("rescript/lib/js/belt_Result.js"),p=require("rescript/lib/js/caml_format.js"),_=require("rescript/lib/js/caml_option.js"),d=require("rescript/lib/js/belt_SortArray.js"),v=require("rescript/lib/js/belt_MutableMap.js"),g=require("rescript/lib/js/caml_exceptions.js"),b=require("rationale/src/RList.bs.js"),h=require("rationale/src/Option.bs.js"),y=require("rationale/src/Result.bs.js"),x=require("rationale/src/Function.bs.js"),j=t.caml_float_compare,S=o.MakeComparable({cmp:j});function E(r){return v.fromArray(r,S)}var A=v.toArray;function q(r){return v.make(S)}function $(r,t){return v.update(t,r,function(r){return void 0!==r?r+1:1})}function k(r,t){return v.get(t,r)}function I(r,t){return v.map(t,r)}var O={Id:S,fromArray:E,toArray:A,empty:q,increment:$,get:k,fmap:I};function T(r,t){return r>t?r:t}var B={max:T},F=f.caml_equal;function M(r){return[r]}function w(r){return r}var G={isEqual:F,toA:M,id:w};function R(r,t,n){return void 0!==n?i._1(r,_.valFromOption(n)):i._1(t,void 0)}function D(r,t){return h.flatten(i._2(h.apply,r,_.some(t)))}function L(r){return void 0!==r}function N(r,t){if(void 0!==t)return i._1(r,_.valFromOption(t))}function P(r){return void 0!==r?r:""}function W(t,n){return void 0!==n?r({TAG:0,_0:_.valFromOption(n)},Symbol.for("name"),"Ok"):r({TAG:1,_0:t},Symbol.for("name"),"Error")}function C(r,t,n){return void 0!==t?void 0!==n?i._2(r,t,n)?t:n:t:void 0!==n?n:void 0}function U(r,t){return C(function(r,t){return r<t},r,t)}function J(r,t){return C(function(r,t){return r>t},r,t)}var X={dimap:R,fmap:h.fmap,bind:h.bind,$$default:h.$$default,isSome:h.isSome,isNone:h.isNone,toExn:h.toExn,some:h.some,firstSome:h.firstSome,toExt:h.toExn,flatApply:D,toBool:L,ffmap:N,toString:P,toResult:W,compare:C,min:U,max:J};function z(r,t){return i._1(t,r)}function H(r,t,n){return i._1(r,function(r){return i._1(t,function(t){return i._2(n,r,t)})})}function V(r,t,n,e){return i._1(r,function(r){return i._1(t,function(t){return i._1(n,function(n){return i._3(e,r,t,n)})})})}function K(r,t,n,e,o){return i._1(r,function(r){return i._1(t,function(t){return i._1(n,function(n){return i._1(e,function(e){return i._4(o,r,t,n,e)})})})})}var Q={apply:z,flatten2Callbacks:H,flatten3Callbacks:V,flatten4Callbacks:K};function Y(r){return r?"TRUE":"FALSE"}function Z(r){return"TRUE"===r}function rr(r){return!(void 0===r||!r)}var tr={toBool:rr},nr={toString:Y,fromString:Z,O:tr};function er(r){return r.toPrecision(2)}function ir(r){return r.toPrecision(3)}function or(r){return r.toFixed()}function ur(r){return r.toString()}var ar={with2DigitsPrecision:er,with3DigitsPrecision:ir,toFixed:or,toString:ur};function fr(r){return r+1|0}function cr(r){return r-1|0}function sr(r){return r.toString()}var lr={increment:fr,decrement:cr,toString:sr};function mr(r){return y.result(w,w,r)}function pr(r,t){return 0===t.TAG?t._0:r}function _r(t,n){return 0===t.TAG?0===n.TAG?r({TAG:0,_0:[t._0,n._0]},Symbol.for("name"),"Ok"):r({TAG:1,_0:n._0},Symbol.for("name"),"Error"):r({TAG:1,_0:t._0},Symbol.for("name"),"Error")}function dr(r){if(0===r.TAG)return _.some(r._0)}function vr(t,n,e){return i._1(t,e)?r({TAG:1,_0:n},Symbol.for("name"),"Error"):r({TAG:0,_0:e},Symbol.for("name"),"Ok")}var gr={result:y.result,id:mr,fmap:y.fmap,bind:y.bind,toExn:m.getExn,$$default:pr,merge:_r,toOption:dr,errorIfCondition:vr};function br(r,t){try{return _.some(i._1(r,t))}catch(n){return}}function hr(r){return br(p.caml_float_of_string,r)}function yr(r){return br(p.caml_int_of_string,r)}function xr(r,t){return""===t?r:t}var jr=
},{"rescript/lib/js/caml.js":"gGFE","rescript/lib/js/list.js":"aYjQ","rescript/lib/js/array.js":"d4B1","rescript/lib/js/curry.js":"NSLD","rescript/lib/js/belt_Id.js":"eN7B","rescript/lib/js/js_json.js":"NOig","rescript/lib/js/js_math.js":"MeLz","rescript/lib/js/caml_obj.js":"p3B5","rescript/lib/js/belt_List.js":"H9fU","rescript/lib/js/belt_Array.js":"yUxI","rescript/lib/js/caml_array.js":"Tpli","rescript/lib/js/belt_Result.js":"tKwj","rescript/lib/js/caml_format.js":"Zve6","rescript/lib/js/caml_option.js":"dzFO","rescript/lib/js/belt_SortArray.js":"mJOW","rescript/lib/js/belt_MutableMap.js":"aHaK","rescript/lib/js/caml_exceptions.js":"RiV8","rationale/src/RList.bs.js":"KUwe","rationale/src/Option.bs.js":"Ddhm","rationale/src/Result.bs.js":"SRS9","rationale/src/Function.bs.js":"JPps"}],"qeUV":[function(require,module,exports) {
"use strict";var r,t,e,n=require("./caml.js"),o=require("./curry.js"),i=require("./caml_option.js"),u=require("./belt_SortArray.js"),f=require("./belt_internalAVLtree.js");function v(r,t,e){if(void 0===r)return f.singleton(t,e);var n=r.k;if(t===n)return f.updateValue(r,e);var o=r.v;return t<n?f.bal(v(r.l,t,e),n,o,r.r):f.bal(r.l,n,o,v(r.r,t,e))}function a(r,t){for(;;){var e=r;if(void 0===e)return;var n=e.k;if(t===n)return i.some(e.v);r=t<n?e.l:e.r}}function s(r,t){for(;;){var e=r;if(void 0===e)return;var n=e.k;if(t===n)return e.v;r=t<n?e.l:e.r}}function l(r,t){for(;;){var e=r;if(void 0===e)throw{RE_EXN_ID:"Not_found",Error:new Error};var n=e.k;if(t===n)return e.v;r=t<n?e.l:e.r}}function c(r,t,e){for(;;){var n=r;if(void 0===n)return e;var o=n.k;if(t===o)return n.v;r=t<o?n.l:n.r}}function d(r,t){for(;;){var e=r;if(void 0===e)return!1;var n=e.k;if(t===n)return!0;r=t<n?e.l:e.r}}function p(r,t){if(void 0===r)return r;var e=r.k,n=r.l,o=r.r;if(t!==e)return t<e?f.bal(p(n,t),e,r.v,o):f.bal(n,e,r.v,p(o,t));if(void 0===n)return o;if(void 0===o)return n;var i={contents:o.k},u={contents:o.v},v=f.removeMinAuxWithRef(o,i,u);return f.bal(n,i.contents,u.contents,v)}function x(r,t){var e=t.k,n=t.v,o=t.l,u=t.r;if(r===e)return[o,i.some(n),u];if(r<e){if(void 0===o)return[void 0,void 0,t];var v=x(r,o);return[v[0],v[1],f.join(v[2],e,n,u)]}if(void 0===u)return[t,void 0,void 0];var a=x(r,u);return[f.join(o,e,n,a[0]),a[1],a[2]]}function k(r,t){return void 0!==t?x(r,t):[void 0,void 0,void 0]}function A(r,t,e){if(void 0!==r){if(r.h>=(void 0!==t?t.h:0)){var n=r.k,o=r.v,u=r.l,v=r.r,a=k(n,t);return f.concatOrJoin(A(u,a[0],e),n,e(n,i.some(o),a[1]),A(v,a[2],e))}}else if(void 0===t)return;var s=t.k,l=t.v,c=t.l,d=t.r,p=k(s,r);return f.concatOrJoin(A(p[0],c,e),s,e(s,p[1],i.some(l)),A(p[2],d,e))}function m(r,t,e){return A(r,t,o.__3(e))}function _(r,t,e){for(;;){var o=t,i=r;if(!i)return 0;if(!o)return 0;var u=o.hd,v=i.hd,a=n.caml_string_compare(v.k,u.k);if(0!==a)return a;var s=e(v.v,u.v);if(0!==s)return s;t=f.stackAllLeft(u.r,o.tl),r=f.stackAllLeft(v.r,i.tl)}}function h(r,t,e){var n=f.size(r),o=f.size(t);return n===o?_(f.stackAllLeft(r,0),f.stackAllLeft(t,0),e):n<o?-1:1}function g(r,t,e){return h(r,t,o.__2(e))}function L(r,t,e){for(;;){var n=t,o=r;if(!o)return!0;if(!n)return!0;var i=n.hd,u=o.hd;if(u.k!==i.k||!e(u.v,i.v))return!1;t=f.stackAllLeft(i.r,n.tl),r=f.stackAllLeft(u.r,o.tl)}}function b(r,t,e){return f.size(r)===f.size(t)&&L(f.stackAllLeft(r,0),f.stackAllLeft(t,0),e)}function q(r,t,e){return b(r,t,o.__2(e))}function j(r,t,e){if(void 0===r)return f.singleton(t,e);var n=r.k;if(t===n)return r.k=t,r.v=e,r;var o=r.l,i=r.r;if(t<n){var u=j(o,t,e);r.l=u}else r.r=j(i,t,e);return f.balMutate(r)}function y(r){var t=r.length;if(0!==t){var e,n=u.strictlySortedLengthU(r,function(r,t){return r[0]<t[0]});n>=0?e=f.fromSortedArrayAux(r,0,n):(n=0|-n,e=f.fromSortedArrayRevAux(r,n-1|0,n));for(var o=n;o<t;++o){var i=r[o];e=j(e,i[0],i[1])}return e}}exports.N=r,exports.A=t,exports.S=e,exports.add=v,exports.get=a,exports.getUndefined=s,exports.getExn=l,exports.getWithDefault=c,exports.has=d,exports.remove=p,exports.splitAux=x,exports.split=k,exports.mergeU=A,exports.merge=m,exports.compareAux=_,exports.cmpU=h,exports.cmp=g,exports.eqAux=L,exports.eqU=b,exports.eq=q,exports.addMutate=j,exports.fromArray=y;
},{"./caml.js":"gGFE","./curry.js":"NSLD","./caml_option.js":"dzFO","./belt_SortArray.js":"mJOW","./belt_internalAVLtree.js":"ApXr"}],"mO07":[function(require,module,exports) {
"use strict";var e,r=require("./curry.js"),t=require("./caml_option.js"),o=require("./belt_internalAVLtree.js"),n=require("./belt_internalMapString.js");function i(e,r,t){if(void 0===e)return o.singleton(r,t);var n=e.k;if(r===n)return o.updateValue(e,t);var s=e.v;return r<n?o.bal(i(e.l,r,t),n,s,e.r):o.bal(e.l,n,s,i(e.r,r,t))}function s(e,r,n){if(void 0!==e){var i=e.k;if(r===i){var a=n(t.some(e.v));if(void 0!==a)return o.updateValue(e,t.valFromOption(a));var p=e.l,x=e.r;if(void 0===p)return x;if(void 0===x)return p;var m={contents:x.k},v={contents:x.v},u=o.removeMinAuxWithRef(x,m,v);return o.bal(p,m.contents,v.contents,u)}var f=e.v,d=e.l,y=e.r;if(r<i){var U=s(d,r,n);return d===U?e:o.bal(U,i,f,y)}var c=s(y,r,n);return y===c?e:o.bal(d,i,f,c)}var l=n(void 0);return void 0!==l?o.singleton(r,t.valFromOption(l)):e}function a(e,t,o){return s(e,t,r.__1(o))}function p(e,r){var t=e.k,n=e.l,i=e.r;if(r===t){if(void 0===n)return i;if(void 0===i)return n;var s={contents:i.k},a={contents:i.v},x=o.removeMinAuxWithRef(i,s,a);return o.bal(n,s.contents,a.contents,x)}if(r<t){if(void 0===n)return e;var m=p(n,r);return m===n?e:o.bal(m,t,e.v,i)}if(void 0===i)return e;var v=p(i,r);return o.bal(n,t,e.v,v)}function x(e,r){if(void 0!==e)return p(e,r)}function m(e,r){var t=r.length;if(void 0!==e)for(var o=e,n=0;;){var i=n;if(i>=t)return o;var s=p(o,r[i]);if(void 0===s)return s;n=i+1|0,o=s}}function v(e,r){for(var t=r.length,o=e,n=0;n<t;++n){var s=r[n];o=i(o,s[0],s[1])}return o}var u=o.isEmpty,f=n.has,d=n.cmpU,y=n.cmp,U=n.eqU,c=n.eq,l=o.findFirstByU,h=o.findFirstBy,g=o.forEachU,k=o.forEach,K=o.reduceU,A=o.reduce,b=o.everyU,q=o.every,E=o.someU,W=o.some,F=o.size,M=o.toList,S=o.toArray,_=n.fromArray,j=o.keysToArray,B=o.valuesToArray,I=o.minKey,T=o.minKeyUndefined,L=o.maxKey,V=o.maxKeyUndefined,z=o.minimum,D=o.minUndefined,O=o.maximum,R=o.maxUndefined,w=n.get,C=n.getUndefined,G=n.getWithDefault,H=n.getExn,J=o.checkInvariantInternal,N=n.mergeU,P=n.merge,Q=o.keepSharedU,X=o.keepShared,Y=o.partitionSharedU,Z=o.partitionShared,$=n.split,ee=o.mapU,re=o.map,te=o.mapWithKeyU,oe=o.mapWithKey;exports.empty=e,exports.isEmpty=u,exports.has=f,exports.cmpU=d,exports.cmp=y,exports.eqU=U,exports.eq=c,exports.findFirstByU=l,exports.findFirstBy=h,exports.forEachU=g,exports.forEach=k,exports.reduceU=K,exports.reduce=A,exports.everyU=b,exports.every=q,exports.someU=E,exports.some=W,exports.size=F,exports.toList=M,exports.toArray=S,exports.fromArray=_,exports.keysToArray=j,exports.valuesToArray=B,exports.minKey=I,exports.minKeyUndefined=T,exports.maxKey=L,exports.maxKeyUndefined=V,exports.minimum=z,exports.minUndefined=D,exports.maximum=O,exports.maxUndefined=R,exports.get=w,exports.getUndefined=C,exports.getWithDefault=G,exports.getExn=H,exports.checkInvariantInternal=J,exports.remove=x,exports.removeMany=m,exports.set=i,exports.updateU=s,exports.update=a,exports.mergeU=N,exports.merge=P,exports.mergeMany=v,exports.keepU=Q,exports.keep=X,exports.partitionU=Y,exports.partition=Z,exports.split=$,exports.mapU=ee,exports.map=re,exports.mapWithKeyU=te,exports.mapWithKey=oe;
},{"./curry.js":"NSLD","./caml_option.js":"dzFO","./belt_internalAVLtree.js":"ApXr","./belt_internalMapString.js":"qeUV"}],"wWOr":[function(require,module,exports) {
"use strict";var r=require("./caml.js"),t=require("./caml_format.js"),e=require("./caml_js_exceptions.js");function n(r){return r+1|0}function o(r){return r-1|0}function i(r){return r>=0?r:0|-r}function s(r){return-1^r}function u(r){return t.caml_int32_format("%d",r)}function c(r){try{return t.caml_int32_of_string(r)}catch(o){var n=e.internalToOCamlException(o);if("Failure"===n.RE_EXN_ID)return;throw n}}var a=r.caml_int_compare;function p(r,t){return r===t}var _=0,x=1,m=-1,f=2147483647,l=-2147483648;exports.zero=_,exports.one=x,exports.minus_one=m,exports.succ=n,exports.pred=o,exports.abs=i,exports.max_int=f,exports.min_int=l,exports.lognot=s,exports.of_string_opt=c,exports.to_string=u,exports.compare=a,exports.equal=p;
},{"./caml.js":"gGFE","./caml_format.js":"Zve6","./caml_js_exceptions.js":"yO2E"}],"f266":[function(require,module,exports) {
"use strict";var r=require("./caml.js"),e=require("./caml_int64.js"),t=require("./caml_format.js"),n=require("./caml_js_exceptions.js");function o(r){return e.sub(r,e.one)}function s(t){return r.i64_ge(t,e.zero)?t:e.neg(t)}function i(r){return e.xor(r,e.neg_one)}function c(r){try{return t.caml_int64_of_string(r)}catch(o){var e=n.internalToOCamlException(o);if("Failure"===e.RE_EXN_ID)return;throw e}}var u=e.compare;function a(r,t){return 0===e.compare(r,t)}var _=e.zero,p=e.one,x=e.neg_one,m=e.succ,l=e.max_int,f=e.min_int,g=e.to_string;exports.zero=_,exports.one=p,exports.minus_one=x,exports.succ=m,exports.pred=o,exports.abs=s,exports.max_int=l,exports.min_int=f,exports.lognot=i,exports.of_string_opt=c,exports.to_string=g,exports.compare=u,exports.equal=a;
},{"./caml.js":"gGFE","./caml_int64.js":"Phox","./caml_format.js":"Zve6","./caml_js_exceptions.js":"yO2E"}],"cYhC":[function(require,module,exports) {
"use strict";var e=require("./caml_bytes.js");function r(e){if(e<0||e>255)throw{RE_EXN_ID:"Invalid_argument",_1:"Char.chr",Error:new Error};return e}function t(r){var t=0;if(r>=40){if(92===r)return"\\\\";t=r>=127?1:2}else if(r>=32){if(r>=39)return"\\'";t=2}else if(r>=14)t=1;else switch(r){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 11:case 12:t=1;break;case 13:return"\\r"}switch(t){case 1:var s=[0,0,0,0];return s[0]=92,s[1]=48+(r/100|0)|0,s[2]=48+(r/10|0)%10|0,s[3]=48+r%10|0,e.bytes_to_string(s);case 2:var c=[0];return c[0]=r,e.bytes_to_string(c)}}function s(e){return e>=65&&e<=90||e>=192&&e<=214||e>=216&&e<=222?e+32|0:e}function c(e){return e>=97&&e<=122||e>=224&&e<=246||e>=248&&e<=254?e-32|0:e}function n(e){return e>=65&&e<=90?e+32|0:e}function a(e){return e>=97&&e<=122?e-32|0:e}function u(e,r){return e-r|0}function i(e,r){return 0==(e-r|0)}exports.chr=r,exports.escaped=t,exports.lowercase=s,exports.uppercase=c,exports.lowercase_ascii=n,exports.uppercase_ascii=a,exports.compare=u,exports.equal=i;
},{"./caml_bytes.js":"gmRG"}],"JK9e":[function(require,module,exports) {
"use strict";var r=require("./caml.js"),t=require("./char.js"),e=require("./curry.js"),n=require("./caml_bytes.js"),o=require("./caml_js_exceptions.js");function i(r,t){var e=n.caml_create_bytes(r);return n.caml_fill_bytes(e,0,r,t),e}function a(r,t){for(var o=n.caml_create_bytes(r),i=0;i<r;++i)o[i]=e._1(t,i);return o}var _=[];function s(r){var t=r.length,e=n.caml_create_bytes(t);return n.caml_blit_bytes(r,0,e,0,t),e}function c(r){return n.bytes_to_string(s(r))}function u(r){return s(n.bytes_of_string(r))}function f(r,t,e){if(t<0||e<0||t>(r.length-e|0))throw{RE_EXN_ID:"Invalid_argument",_1:"String.sub / Bytes.sub",Error:new Error};var o=n.caml_create_bytes(e);return n.caml_blit_bytes(r,t,o,0,e),o}function l(r,t,e){return n.bytes_to_string(f(r,t,e))}function p(r,t){var e=r+t|0,n=t<0,o=e<0;if(r<0){if(!n)return e;if(o)return e;throw{RE_EXN_ID:"Invalid_argument",_1:"Bytes.extend",Error:new Error}}if(n)return e;if(o)throw{RE_EXN_ID:"Invalid_argument",_1:"Bytes.extend",Error:new Error};return e}function g(t,e,o){var i=p(p(t.length,e),o),a=n.caml_create_bytes(i),_=e<0?[0|-e,0]:[0,e],s=_[1],c=_[0],u=r.caml_int_min(t.length-c|0,i-s|0);return u>0&&n.caml_blit_bytes(t,c,a,s,u),a}function m(r,t,e,o){if(t<0||e<0||t>(r.length-e|0))throw{RE_EXN_ID:"Invalid_argument",_1:"String.fill / Bytes.fill",Error:new Error};return n.caml_fill_bytes(r,t,e,o)}function E(r,t,e,o,i){if(i<0||t<0||t>(r.length-i|0)||o<0||o>(e.length-i|0))throw{RE_EXN_ID:"Invalid_argument",_1:"Bytes.blit",Error:new Error};return n.caml_blit_bytes(r,t,e,o,i)}function x(r,t,e,o,i){if(i<0||t<0||t>(r.length-i|0)||o<0||o>(e.length-i|0))throw{RE_EXN_ID:"Invalid_argument",_1:"String.blit / Bytes.blit_string",Error:new Error};return n.caml_blit_string(r,t,e,o,i)}function h(r,t){for(var n=0,o=t.length;n<o;++n)e._1(r,t[n])}function b(r,t){for(var n=0,o=t.length;n<o;++n)e._2(r,n,t[n])}function v(r,t){if(r>=t)return r;throw{RE_EXN_ID:"Invalid_argument",_1:"Bytes.concat",Error:new Error}}function y(r,t,e){for(;;){var n=e,o=r;if(!n)return o;var i=n.tl,a=n.hd;if(!i)return a.length+o|0;e=i,r=v((a.length+t|0)+o|0,o)}}function w(r,t){if(!t)return _;for(var e=r.length,o=n.caml_create_bytes(y(0,e,t)),i=0,a=t;;){var s=a,c=i;if(!s)return o;var u=s.tl,f=s.hd;if(!u)return n.caml_blit_bytes(f,0,o,c,f.length),o;n.caml_blit_bytes(f,0,o,c,f.length),n.caml_blit_bytes(r,0,o,c+f.length|0,e),a=u,i=(c+f.length|0)+e|0}}function d(r,t){var e=r.length,o=t.length,i=n.caml_create_bytes(e+o|0);return n.caml_blit_bytes(r,0,i,0,e),n.caml_blit_bytes(t,0,i,e,o),i}function I(r){return r>13||r<9?32===r:11!==r}function N(r){for(var t=r.length,e=0;e<t&&I(r[e]);)e=e+1|0;for(var n=t-1|0;n>=e&&I(r[n]);)n=n-1|0;return n>=e?f(r,e,1+(n-e|0)|0):_}function D(r){for(var t=0,e=0,o=r.length;e<o;++e){var i=r[e];t=t+(i>=32?i>92||i<34?i>=127?4:1:i>91||i<35?2:1:i>=11?13!==i?4:2:i>=8?2:4)|0}if(t===r.length)return s(r);var a=n.caml_create_bytes(t);t=0;for(var _=0,c=r.length;_<c;++_){var u=r[_],f=0;if(u>=35)92!==u?u>=127?f=1:a[t]=u:f=2;else if(u>=32)u>=34?f=2:a[t]=u;else if(u>=14)f=1;else switch(u){case 8:a[t]=92,a[t=t+1|0]=98;break;case 9:a[t]=92,a[t=t+1|0]=116;break;case 10:a[t]=92,a[t=t+1|0]=110;break;case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 11:case 12:f=1;break;case 13:a[t]=92,a[t=t+1|0]=114}switch(f){case 1:a[t]=92,a[t=t+1|0]=48+(u/100|0)|0,a[t=t+1|0]=48+(u/10|0)%10|0,a[t=t+1|0]=48+u%10|0;break;case 2:a[t]=92,a[t=t+1|0]=u}t=t+1|0}return a}function R(r,t){var o=t.length;if(0===o)return t;for(var i=n.caml_create_bytes(o),a=0;a<o;++a)i[a]=e._1(r,t[a]);return i}function X(r,t){var o=t.length;if(0===o)return t;for(var i=n.caml_create_bytes(o),a=0;a<o;++a)i[a]=e._2(r,a,t[a]);return i}function B(r){return R(t.uppercase_ascii,r)}function S(r){return R(t.lowercase_ascii,r)}function q(r,t){if(0===t.length)return t;var n=s(t);return n[0]=e._1(r,t[0]),n}function j(r){return q(t.uppercase_ascii,r)}function k(r){return q(t.lowercase_ascii,r)}function z(r,t,e,n){for(;;){var o=e;if(o>=t)throw{RE_EXN_ID:"Not_found",Error:new Error};if(r[o]===n)return o;e=o+1|0}}function C(r,t){return z(r,r.length,0,t)}function O(r,t,e,n){for(;;
},{"./caml.js":"gGFE","./char.js":"cYhC","./curry.js":"NSLD","./caml_bytes.js":"gmRG","./caml_js_exceptions.js":"yO2E"}],"Vht3":[function(require,module,exports) {
"use strict";var r=require("./caml.js"),t=require("./bytes.js"),n=require("./curry.js"),e=require("./caml_bytes.js"),o=require("./caml_string.js"),i=require("./caml_js_exceptions.js");function _(r,n){return e.bytes_to_string(t.init(r,n))}function s(r,n,o){return e.bytes_to_string(t.sub(e.bytes_of_string(r),n,o))}function u(r,t){if(r>=t)return r;throw{RE_EXN_ID:"Invalid_argument",_1:"String.concat",Error:new Error}}function a(r,t,n){for(;;){var e=n,o=r;if(!e)return o;var i=e.tl,_=e.hd;if(!i)return _.length+o|0;n=i,r=u((_.length+t|0)+o|0,o)}}function f(r,t,n,o,i){for(;;){var _=i,s=t;if(!_)return r;var u=_.tl,a=_.hd;if(!u)return e.caml_blit_string(a,0,r,s,a.length),r;e.caml_blit_string(a,0,r,s,a.length),e.caml_blit_string(n,0,r,s+a.length|0,o),i=u,t=(s+a.length|0)+o|0}}function c(r,t){if(!t)return"";var n=r.length;return e.bytes_to_string(f(e.caml_create_bytes(a(0,n,t)),0,r,n,t))}function g(r,t){for(var e=0,o=t.length;e<o;++e)n._1(r,t.charCodeAt(e))}function p(r,t){for(var e=0,o=t.length;e<o;++e)n._2(r,e,t.charCodeAt(e))}function l(r,n){return e.bytes_to_string(t.map(r,e.bytes_of_string(n)))}function x(r,n){return e.bytes_to_string(t.mapi(r,e.bytes_of_string(n)))}function h(r){return r>13||r<9?32===r:11!==r}function m(r){return""===r||!h(r.charCodeAt(0))&&!h(r.charCodeAt(r.length-1|0))?r:e.bytes_to_string(t.trim(e.bytes_of_string(r)))}function d(r){return function(t){for(;;){var n=t;if(n>=r.length)return!1;var e=r.charCodeAt(n);if(e<32)return!0;if(e>92||e<34){if(e>=127)return!0;t=n+1|0}else{if(e>91||e<35)return!0;t=n+1|0}}}(0)?e.bytes_to_string(t.escaped(e.bytes_of_string(r))):r}function E(r,t,n,e){for(;;){var o=n;if(o>=t)throw{RE_EXN_ID:"Not_found",Error:new Error};if(r.charCodeAt(o)===e)return o;n=o+1|0}}function y(r,t){return E(r,r.length,0,t)}function b(r,t,n,e){for(;;){var o=n;if(o>=t)return;if(r.charCodeAt(o)===e)return o;n=o+1|0}}function v(r,t){return b(r,r.length,0,t)}function w(r,t,n){var e=r.length;if(t<0||t>e)throw{RE_EXN_ID:"Invalid_argument",_1:"String.index_from / Bytes.index_from",Error:new Error};return E(r,e,t,n)}function I(r,t,n){var e=r.length;if(t<0||t>e)throw{RE_EXN_ID:"Invalid_argument",_1:"String.index_from_opt / Bytes.index_from_opt",Error:new Error};return b(r,e,t,n)}function N(r,t,n){for(;;){var e=t;if(e<0)throw{RE_EXN_ID:"Not_found",Error:new Error};if(r.charCodeAt(e)===n)return e;t=e-1|0}}function C(r,t){return N(r,r.length-1|0,t)}function D(r,t,n){if(t<-1||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"String.rindex_from / Bytes.rindex_from",Error:new Error};return N(r,t,n)}function R(r,t,n){for(;;){var e=t;if(e<0)return;if(r.charCodeAt(e)===n)return e;t=e-1|0}}function X(r,t){return R(r,r.length-1|0,t)}function A(r,t,n){if(t<-1||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"String.rindex_from_opt / Bytes.rindex_from_opt",Error:new Error};return R(r,t,n)}function z(r,t,n){var e=r.length;if(t<0||t>e)throw{RE_EXN_ID:"Invalid_argument",_1:"String.contains_from / Bytes.contains_from",Error:new Error};try{return E(r,e,t,n),!0}catch(_){var o=i.internalToOCamlException(_);if("Not_found"===o.RE_EXN_ID)return!1;throw o}}function j(r,t){return z(r,0,t)}function q(r,t,n){if(t<0||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"String.rcontains_from / Bytes.rcontains_from",Error:new Error};try{return N(r,t,n),!0}catch(o){var e=i.internalToOCamlException(o);if("Not_found"===e.RE_EXN_ID)return!1;throw e}}function S(r){return e.bytes_to_string(t.uppercase_ascii(e.bytes_of_string(r)))}function B(r){return e.bytes_to_string(t.lowercase_ascii(e.bytes_of_string(r)))}function k(r){return e.bytes_to_string(t.capitalize_ascii(e.bytes_of_string(r)))}function O(r){return e.bytes_to_string(t.uncapitalize_ascii(e.bytes_of_string(r)))}var T=r.caml_string_compare;function F(r,t){for(var n=0,e=t.length,o=t.length-1|0;o>=0;--o)t.charCodeAt(o)===r&&(n={hd:s(t,o+1|0,(e-o|0)-1|0),tl:n},e=o);return{hd:s(t,0,e),tl:n}}function G(r){return e.bytes_to_string(t.uppercase(e.bytes_of_string(r)))}function H(r){return e.bytes_to_string(t.lowercase(e.bytes_of_string(r)))}function J(r){return e.bytes_to_string(t.capitalize(e.b
},{"./caml.js":"gGFE","./bytes.js":"JK9e","./curry.js":"NSLD","./caml_bytes.js":"gmRG","./caml_string.js":"GLny","./caml_js_exceptions.js":"yO2E"}],"VSaX":[function(require,module,exports) {
"use strict";function r(r,t,n,o,a,e){var c=((t+r|0)+o|0)+e|0;return(c<<a|c>>>(32-a|0)|0)+n|0}function t(t,n,o,a,e,c,f){return r(n&o|(-1^n)&a,t,n,e,c,f)}function n(t,n,o,a,e,c,f){return r(n&a|o&(-1^a),t,n,e,c,f)}function o(t,n,o,a,e,c,f){return r(n^o^a,t,n,e,c,f)}function a(t,n,o,a,e,c,f){return r(o^(n|-1^a),t,n,e,c,f)}function e(r,e){var c=r[0],f=r[1],u=r[2],i=r[3];c=t(c,f,u,i,e[0],7,-680876936),i=t(i,c,f,u,e[1],12,-389564586),u=t(u,i,c,f,e[2],17,606105819),f=t(f,u,i,c,e[3],22,-1044525330),c=t(c,f,u,i,e[4],7,-176418897),i=t(i,c,f,u,e[5],12,1200080426),u=t(u,i,c,f,e[6],17,-1473231341),f=t(f,u,i,c,e[7],22,-45705983),c=t(c,f,u,i,e[8],7,1770035416),i=t(i,c,f,u,e[9],12,-1958414417),u=t(u,i,c,f,e[10],17,-42063),f=t(f,u,i,c,e[11],22,-1990404162),c=t(c,f,u,i,e[12],7,1804603682),i=t(i,c,f,u,e[13],12,-40341101),u=t(u,i,c,f,e[14],17,-1502002290),c=n(c,f=t(f,u,i,c,e[15],22,1236535329),u,i,e[1],5,-165796510),i=n(i,c,f,u,e[6],9,-1069501632),u=n(u,i,c,f,e[11],14,643717713),f=n(f,u,i,c,e[0],20,-373897302),c=n(c,f,u,i,e[5],5,-701558691),i=n(i,c,f,u,e[10],9,38016083),u=n(u,i,c,f,e[15],14,-660478335),f=n(f,u,i,c,e[4],20,-405537848),c=n(c,f,u,i,e[9],5,568446438),i=n(i,c,f,u,e[14],9,-1019803690),u=n(u,i,c,f,e[3],14,-187363961),f=n(f,u,i,c,e[8],20,1163531501),c=n(c,f,u,i,e[13],5,-1444681467),i=n(i,c,f,u,e[2],9,-51403784),u=n(u,i,c,f,e[7],14,1735328473),c=o(c,f=n(f,u,i,c,e[12],20,-1926607734),u,i,e[5],4,-378558),i=o(i,c,f,u,e[8],11,-2022574463),u=o(u,i,c,f,e[11],16,1839030562),f=o(f,u,i,c,e[14],23,-35309556),c=o(c,f,u,i,e[1],4,-1530992060),i=o(i,c,f,u,e[4],11,1272893353),u=o(u,i,c,f,e[7],16,-155497632),f=o(f,u,i,c,e[10],23,-1094730640),c=o(c,f,u,i,e[13],4,681279174),i=o(i,c,f,u,e[0],11,-358537222),u=o(u,i,c,f,e[3],16,-722521979),f=o(f,u,i,c,e[6],23,76029189),c=o(c,f,u,i,e[9],4,-640364487),i=o(i,c,f,u,e[12],11,-421815835),u=o(u,i,c,f,e[15],16,530742520),c=a(c,f=o(f,u,i,c,e[2],23,-995338651),u,i,e[0],6,-198630844),i=a(i,c,f,u,e[7],10,1126891415),u=a(u,i,c,f,e[14],15,-1416354905),f=a(f,u,i,c,e[5],21,-57434055),c=a(c,f,u,i,e[12],6,1700485571),i=a(i,c,f,u,e[3],10,-1894986606),u=a(u,i,c,f,e[10],15,-1051523),f=a(f,u,i,c,e[1],21,-2054922799),c=a(c,f,u,i,e[8],6,1873313359),i=a(i,c,f,u,e[15],10,-30611744),u=a(u,i,c,f,e[6],15,-1560198380),f=a(f,u,i,c,e[13],21,1309151649),c=a(c,f,u,i,e[4],6,-145523070),i=a(i,c,f,u,e[11],10,-1120210379),u=a(u,i,c,f,e[2],15,718787259),f=a(f,u,i,c,e[9],21,-343485551),r[0]=c+r[0]|0,r[1]=f+r[1]|0,r[2]=u+r[2]|0,r[3]=i+r[3]|0}var c=[1732584193,-271733879,-1732584194,271733878],f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function u(r,t,n){var o=r.slice(t,n),a=o.length;c[0]=1732584193,c[1]=-271733879,c[2]=-1732584194,c[3]=271733878;for(var u=0;u<=15;++u)f[u]=0;for(var i=a/64|0,v=1;v<=i;++v){for(var h=0;h<=15;++h){var d=((v<<6)-64|0)+(h<<2)|0;f[h]=((o.charCodeAt(d)+(o.charCodeAt(d+1|0)<<8)|0)+(o.charCodeAt(d+2|0)<<16)|0)+(o.charCodeAt(d+3|0)<<24)|0}e(c,f)}for(var C=o.slice(i<<6),s=0;s<=15;++s)f[s]=0;for(var l=C.length-1|0,A=0;A<=l;++A)f[A/4|0]=f[A/4|0]|C.charCodeAt(A)<<(A%4<<3);var g=l+1|0;if(f[g/4|0]=f[g/4|0]|128<<(g%4<<3),g>55){e(c,f);for(var m=0;m<=15;++m)f[m]=0}return f[14]=a<<3,e(c,f),String.fromCharCode(255&c[0],c[0]>>8&255,c[0]>>16&255,c[0]>>24&255,255&c[1],c[1]>>8&255,c[1]>>16&255,c[1]>>24&255,255&c[2],c[2]>>8&255,c[2]>>16&255,c[2]>>24&255,255&c[3],c[3]>>8&255,c[3]>>16&255,c[3]>>24&255)}exports.caml_md5_string=u;
},{}],"ZLPc":[function(require,module,exports) {
"use strict";var r=require("./char.js"),e=require("./string.js"),t=require("./caml_md5.js"),n=require("./caml_bytes.js"),o=require("./pervasives.js"),_=require("./caml_string.js"),i=require("./caml_external_polyfill.js");function s(r){return t.caml_md5_string(r,0,r.length)}function u(r){return s(n.bytes_to_string(r))}function a(r,e,n){if(e<0||n<0||e>(r.length-n|0))throw{RE_EXN_ID:"Invalid_argument",_1:"Digest.substring",Error:new Error};return t.caml_md5_string(r,e,n)}function l(r,e,t){return a(n.bytes_to_string(r),e,t)}function c(r){var e,t=o.open_in_bin(r);try{e=i.resolve("caml_md5_chan")(t,-1)}catch(n){throw i.resolve("caml_ml_close_channel")(t),n}return i.resolve("caml_ml_close_channel")(t),e}var g=o.output_string;function m(r){return o.really_input_string(r,16)}function f(r){return r+(r<10?48:87)|0}function h(r){if(16!==r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"Digest.to_hex",Error:new Error};for(var e=n.caml_create_bytes(32),t=0;t<=15;++t){var o=_.get(r,t);e[t<<1]=f(o>>>4),e[1+(t<<1)|0]=f(15&o)}return n.bytes_to_string(e)}function E(e){if(32!==e.length)throw{RE_EXN_ID:"Invalid_argument",_1:"Digest.from_hex",Error:new Error};for(var t=function(r){if(r>=65){if(r>=97){if(r>=103)throw{RE_EXN_ID:"Invalid_argument",_1:"Digest.from_hex",Error:new Error};return 10+(r-97|0)|0}if(r>=71)throw{RE_EXN_ID:"Invalid_argument",_1:"Digest.from_hex",Error:new Error};return 10+(r-65|0)|0}if(r>57||r<48)throw{RE_EXN_ID:"Invalid_argument",_1:"Digest.from_hex",Error:new Error};return r-48|0},o=function(r){return(t(_.get(e,r))<<4)+t(_.get(e,r+1|0))|0},i=n.caml_create_bytes(16),s=0;s<=15;++s)n.set(i,s,r.chr(o(s<<1)));return n.bytes_to_string(i)}var p=e.compare,x=e.equal;exports.compare=p,exports.equal=x,exports.string=s,exports.bytes=u,exports.substring=a,exports.subbytes=l,exports.file=c,exports.output=g,exports.input=m,exports.to_hex=h,exports.from_hex=E;
},{"./char.js":"cYhC","./string.js":"Vht3","./caml_md5.js":"VSaX","./caml_bytes.js":"gmRG","./pervasives.js":"z22f","./caml_string.js":"GLny","./caml_external_polyfill.js":"FC4F"}],"l4ED":[function(require,module,exports) {
"use strict";var t=require("./caml.js"),r=require("./array.js"),n=require("./int32.js"),i=require("./int64.js"),e=require("./digest.js"),o=require("./caml_array.js"),u=require("./caml_int64.js"),s=require("./caml_string.js");function f(t){return[Math.floor(2147483647*Math.random())]}function a(t,n){r.blit(n.st,0,t.st,0,55),t.idx=n.idx}function _(t,r){for(var n=function(t,r){return e.string(t+String(r))},i=0===r.length?[0]:r,u=i.length,f=0;f<=54;++f)o.set(t.st,f,f);for(var a,_="x",c=0,x=54+(55>u?55:u)|0;c<=x;++c){var d=c%55,l=c%u;_=n(_,o.get(i,l)),o.set(t.st,d,1073741823&(o.get(t.st,d)^(a=_,((s.get(a,0)+(s.get(a,1)<<8)|0)+(s.get(a,2)<<16)|0)+(s.get(a,3)<<24)|0)))}t.idx=0}function c(t){var r={st:o.make(55,0),idx:0};return _(r,t),r}function x(t){return c(f(void 0))}function d(t){var r={st:o.make(55,0),idx:0};return a(r,t),r}function l(t){t.idx=(t.idx+1|0)%55;var r=o.get(t.st,t.idx),n=1073741823&(o.get(t.st,(t.idx+24|0)%55)+(r^r>>>25&31)|0);return o.set(t.st,t.idx,n),n}function g(t,r){if(r>1073741823||r<=0)throw{RE_EXN_ID:"Invalid_argument",_1:"Random.int",Error:new Error};for(;;){var n=l(t),i=n%r;if((n-i|0)<=(1+(1073741823-r|0)|0))return i}}function m(t,r){if(r<=0)throw{RE_EXN_ID:"Invalid_argument",_1:"Random.int32",Error:new Error};for(;;){var i=l(t)|(1&l(t))<<30,e=i%r;if((i-e|0)<=(1+(n.max_int-r|0)|0))return e}}function v(r,n){if(t.i64_le(n,u.zero))throw{RE_EXN_ID:"Invalid_argument",_1:"Random.int64",Error:new Error};for(;;){var e=u.of_int32(l(r)),o=u.lsl_(u.of_int32(l(r)),30),s=u.lsl_(u.of_int32(7&l(r)),60),f=u.or_(e,u.or_(o,s)),a=u.mod_(f,n);if(!t.i64_gt(u.sub(f,a),u.add(u.sub(i.max_int,n),u.one)))return a}}function p(t){return(l(t)/1073741824+l(t))/1073741824}function E(t,r){return p(t)*r}function j(t){return 0==(1&l(t))}var q={st:[987910699,495797812,364182224,414272206,318284740,990407751,383018966,270373319,840823159,24560019,536292337,512266505,189156120,730249596,143776328,51606627,140166561,366354223,1003410265,700563762,981890670,913149062,526082594,1021425055,784300257,667753350,630144451,949649812,48546892,415514493,258888527,511570777,89983870,283659902,308386020,242688715,482270760,865188196,1027664170,207196989,193777847,619708188,671350186,149669678,257044018,87658204,558145612,183450813,28133145,901332182,710253903,510646120,652377910,409934019,801085050],idx:0};function $(t){return l(q)}function b(t){return g(q,t)}function h(t){return m(q,t)}function w(t){return v(q,t)}function I(t){return p(q)*t}function R(t){return j(q)}function k(t){return _(q,t)}function y(t){return _(q,[t])}function D(t){return k(f(void 0))}function N(t){return d(q)}function X(t){return a(q,t)}var M={make:c,make_self_init:x,copy:d,bits:l,$$int:g,int32:m,int64:v,$$float:E,bool:j};exports.init=y,exports.full_init=k,exports.self_init=D,exports.bits=$,exports.$$int=b,exports.int32=h,exports.int64=w,exports.$$float=I,exports.bool=R,exports.State=M,exports.get_state=N,exports.set_state=X;
},{"./caml.js":"gGFE","./array.js":"d4B1","./int32.js":"wWOr","./int64.js":"f266","./digest.js":"ZLPc","./caml_array.js":"Tpli","./caml_int64.js":"Phox","./caml_string.js":"GLny"}],"QbOX":[function(require,module,exports) {
"use strict";var o=require("./curry.js"),r=require("./caml_option.js");function t(o,t){if(void 0!==o&&t(r.valFromOption(o)))return o}function n(r,n){return t(r,o.__1(n))}function i(o,t){if(void 0!==o)return t(r.valFromOption(o))}function e(r,t){return i(r,o.__1(t))}function u(o){if(void 0!==o)return r.valFromOption(o);throw{RE_EXN_ID:"Not_found",Error:new Error}}function p(o,t,n){return void 0!==o?n(r.valFromOption(o)):t}function f(r,t,n){return p(r,t,o.__1(n))}function v(o,t){if(void 0!==o)return r.some(t(r.valFromOption(o)))}function a(r,t){return v(r,o.__1(t))}function c(o,t){if(void 0!==o)return t(r.valFromOption(o))}function s(r,t){return c(r,o.__1(t))}function m(o,t){return void 0!==o?r.valFromOption(o):t}function x(o){return void 0!==o}function _(o){return void 0===o}function l(o,t,n){return void 0!==o?void 0!==t&&n(r.valFromOption(o),r.valFromOption(t)):void 0===t}function d(r,t,n){return l(r,t,o.__2(n))}function F(o,t,n){return void 0!==o?void 0!==t?n(r.valFromOption(o),r.valFromOption(t)):1:void 0!==t?-1:0}function O(r,t,n){return F(r,t,o.__2(n))}exports.keepU=t,exports.keep=n,exports.forEachU=i,exports.forEach=e,exports.getExn=u,exports.mapWithDefaultU=p,exports.mapWithDefault=f,exports.mapU=v,exports.map=a,exports.flatMapU=c,exports.flatMap=s,exports.getWithDefault=m,exports.isSome=x,exports.isNone=_,exports.eqU=l,exports.eq=d,exports.cmpU=F,exports.cmp=O;
},{"./curry.js":"NSLD","./caml_option.js":"dzFO"}],"Lf2V":[function(require,module,exports) {
"use strict";function t(r){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(r)}var r=require("rescript/lib/js/array.js"),n=require("rescript/lib/js/curry.js"),e=require("rescript/lib/js/caml_obj.js"),s=require("rescript/lib/js/belt_Array.js"),o=require("rescript/lib/js/caml_array.js"),u=require("rescript/lib/js/pervasives.js"),i=require("rescript/lib/js/belt_Option.js"),a=require("../utility/E.bs.js");function f(t,r,n,e,s){return n*((r-s)/(r-t))+e*((s-t)/(r-t))}var c=n._1(a.O.toExt,"Tried to perform an operation on an empty XYShape.");function p(t){return t}function l(t){return t.xs}function g(t){return t.ys}function y(t){return a.A.length(t.xs)}var x=[],v=[],m={xs:x,ys:v};function _(t){return 0===a.A.length(t.xs)}function A(t){return n._1(c,n._1(a.A.Sorted.min,t.xs))}function h(t){return n._1(c,n._1(a.A.Sorted.max,t.xs))}function d(t){return n._1(c,a.A.first(t.ys))}function b(t){return n._1(c,a.A.last(t.ys))}function S(t){return h(t)-A(t)}function X(t,r){return{xs:n._2(a.A.fmap,t,r.xs),ys:r.ys}}function j(t,r){return{xs:r.xs,ys:n._2(a.A.fmap,t,r.ys)}}function M(t){return s.zip(t.xs,t.ys)}function O(t){return{xs:t[0],ys:t[1]}}function q(t,r){return{xs:t,ys:r}}function w(t,r){return O([r.xs,a.A.accumulate(t,r.ys)])}function B(t,n){return{xs:r.concat({hd:t.xs,tl:{hd:n.xs,tl:0}}),ys:r.concat({hd:t.ys,tl:{hd:n.ys,tl:0}})}}function T(t){return O(s.unzip(t))}function Y(t,r){return n._3(a.A.Floats.range,A(t),h(t),r)}function z(t){return{xs:t.xs,ys:t.ys}}var E={toXyShape:p,xs:l,ys:g,length:y,empty:m,isEmpty:_,minX:A,maxX:h,firstY:d,lastY:b,xTotalRange:S,mapX:X,mapY:j,zip:M,fromArray:O,fromArrays:q,accumulateYs:w,concat:B,fromZippedArray:T,equallyDividedXs:Y,toJs:z};function I(t){return n._1(c,a.A.min(n._2(a.A.fmap,A,t)))}function L(t){return n._1(c,a.A.max(n._2(a.A.fmap,h,t)))}function R(t,r){return n._3(a.A.Floats.range,I(t),L(t),r)}function C(t){return n._1(a.A.Sorted.concatMany,n._2(a.A.fmap,l,t))}var F={minX:I,maxX:L,equallyDividedXs:R,allXs:C};function P(t){return t[0]}function D(t){return t[1]}function V(t){return[A(t),d(t)]}function Z(t){return[h(t),b(t)]}function G(t,r){var e=M(t);return n._2(a.A.getBy,e,r)}function U(t,r){var n=M(r),e=s.getIndexBy(n,function(r){return r[0]>t}),o=void 0!==e?0!==e?e-1|0:void 0:n.length-1|0;return i.flatMap(o,function(t){return s.get(n,t)})}var W={x:P,y:D,first:V,last:Z,getBy:G,firstAtOrBeforeXValue:U};function $(r,e){var s=n._2(a.A.Sorted.binarySearchFirstElementGreaterIndex,e.ys,r);if("object"!==t(s))return"overMax"===s?h(e):A(e);var u=s.VAL,i=(u-1|0)<0?0:u-1|0,c=e.xs,p=e.ys;return o.get(p,i)!==r?f(o.get(p,i),o.get(p,u),o.get(c,i),o.get(c,u),r):o.get(c,i)}var k={linear:$};function J(t,r){return n._2(a.O.fmap,D,U(t,r))}function H(t,r){return n._2(a.O.fmap,D,G(r,function(r){return r[0]===t}))}function K(r,e){var s=n._2(a.A.Sorted.binarySearchFirstElementGreaterIndex,e.xs,r);if("object"!==t(s))return"overMax"===s?b(e):d(e);var u=s.VAL,i=(u-1|0)<0?0:u-1|0,c=e.xs,p=e.ys;return o.get(c,i)!==r?f(o.get(c,i),o.get(c,u),o.get(p,i),o.get(p,u),r):o.get(p,i)}function N(t,r){return"Linear"===t?"UseZero"===r?function(t,r,n){if(r<0)return 0;if(r>=(a.A.length(t.xs)-1|0))return 0;var e=o.get(t.xs,r),s=(n-e)/(o.get(t.xs,r+1|0)-e);return o.get(t.ys,r)*(1-s)+o.get(t.ys,r+1|0)*s}:function(t,r,n){if(r<0)return o.get(t.ys,0);if(r>=(a.A.length(t.xs)-1|0))return o.get(t.ys,a.A.length(t.xs)-1|0);var e=o.get(t.xs,r),s=(n-e)/(o.get(t.xs,r+1|0)-e);return o.get(t.ys,r)*(1-s)+o.get(t.ys,r+1|0)*s}:"UseZero"===r?function(t,r,n){return r<0?0:r>=(a.A.length(t.xs)-1|0)?0:o.get(t.ys,r)}:function(t,r,n){return r<0?o.get(t.ys,0):r>=(a.A.length(t.xs)-1|0)?o.get(t.ys,a.A.length(t.xs)-1|0):o.get(t.ys,r)}}function Q(t,r,n){return 0}var tt={stepwiseIncremental:J,stepwiseIfAtX:H,linear:K,continuousInterpolator:N,discreteInterpolator:Q};function rt(t,r){return{xs:t,ys:s.map(t,function(t){return K(t,r)})}}function nt(t,r){return n._2(a.A.fmap,function(t){return $(t,r)},n._3
},{"rescript/lib/js/array.js":"d4B1","rescript/lib/js/curry.js":"NSLD","rescript/lib/js/caml_obj.js":"p3B5","rescript/lib/js/belt_Array.js":"yUxI","rescript/lib/js/caml_array.js":"Tpli","rescript/lib/js/pervasives.js":"z22f","rescript/lib/js/belt_Option.js":"QbOX","../utility/E.bs.js":"xX5m"}],"qr1b":[function(require,module,exports) {
"use strict";var r=require("./caml_option.js");function n(r){return null===r}function t(r){if(null!==r)return r;throw new Error("Js.Null.getExn")}function o(r,n){return null!==r?n(r):null}function e(r,n){if(null!==r)return n(r)}function u(n){return void 0!==n?r.valFromOption(n):null}var l=u;exports.test=n,exports.getExn=t,exports.bind=o,exports.iter=e,exports.fromOption=u,exports.from_opt=l;
},{"./caml_option.js":"dzFO"}],"r7Vb":[function(require,module,exports) {
"use strict";function n(n,r,e){return r in n?Object.defineProperty(n,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[r]=e,n}var r=require("rescript/lib/js/curry.js"),e=require("rescript/lib/js/js_null.js");function i(e,i){switch(0|e.TAG){case 0:return n({TAG:0,_0:r._1(i[0],e._0)},Symbol.for("name"),"Mixed");case 1:return n({TAG:1,_0:r._1(i[1],e._0)},Symbol.for("name"),"Discrete");case 2:return n({TAG:2,_0:r._1(i[2],e._0)},Symbol.for("name"),"Continuous")}}var t={fmap:i};function u(n){return e.fromOption(void 0)}var o={toJson:u};function s(n){if("number"==typeof n)return 0;switch(0|n.TAG){case 0:case 1:return n._0.excludingProbabilityMass;case 2:return n._0.excludingProbabilityMass+n._1.excludingProbabilityMass}}function c(n){return 1-s(n)}function a(n){if("number"==typeof n)return 0;switch(0|n.TAG){case 1:return 0;case 0:case 2:return n._0.excludingProbabilityMass}}function b(n){return 1/s(n)}function l(n,r){if("number"==typeof n)return r;switch(0|n.TAG){case 0:var e=n._0.excludingProbabilityMass;return r<e||r<e?void 0:(r-e)/(1-s(n));case 1:var i=n._0.excludingProbabilityMass;return r>1-i||r>1-i?void 0:r/(1-s(n));case 2:var t=n._0.excludingProbabilityMass;return r<t||r>1-n._1.excludingProbabilityMass?void 0:(r-t)/(1-s(n))}}var d={excludedProbabilityMass:s,includedProbabilityMass:c,initialProbabilityMass:a,normalizeProbabilityMass:b,yPointToSubYPoint:l};function f(n){return n.continuous}function _(n){return n.discrete}function y(n){return{continuous:n,discrete:0}}function m(n){return{continuous:0,discrete:n}}function P(n,e){return{continuous:r._1(n,e.continuous),discrete:r._1(n,e.discrete)}}function x(n,e,i){return{continuous:r._2(n,e.continuous,i.continuous),discrete:r._2(n,e.discrete,i.discrete)}}function M(n,r){return x(function(n,r){return n+r},n,r)}var p={toContinuousValue:f,toDiscreteValue:_,makeContinuous:y,makeDiscrete:m,fmap:P,combine2:x,add:M};exports.ShapeMonad=t,exports.DistributionUnit=o,exports.Domain=d,exports.MixedPoint=p;
},{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/js_null.js":"qr1b"}],"S4ET":[function(require,module,exports) {
"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(t)}function t(n,t,r){return t in n?Object.defineProperty(n,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[t]=r,n}var r=require("rescript/lib/js/curry.js"),e=require("../utility/E.bs.js");function o(n){return"Divide"===n?function(n,t){return n/t}:"Multiply"===n?function(n,t){return n*t}:"Add"===n?function(n,t){return n+t}:"Exponentiate"===n?function(n,t){return Math.pow(n,t)}:function(n,t){return n-t}}function i(n,r,e){return"Divide"===n&&0===e?t({TAG:1,_0:"Cannot divide $v1 by zero."},Symbol.for("name"),"Error"):t({TAG:0,_0:o(n)(r,e)},Symbol.for("name"),"Ok")}function u(n){return"Divide"===n?"/":"Multiply"===n?"*":"Add"===n?"+":"Exponentiate"===n?"**":"-"}function a(n,t,r){return t+" "+u(n)+" "+r}var f={toFn:o,applyFn:i,toString:u,format:a};function c(n){return"Add"===n?"+":"Exponentiate"===n?"^":"*"}function l(n,t,r){return t+" "+c(n)+" "+r}var p={toString:c,format:l};function m(t,r){if("object"!==n(t))return"Mean"===t?"mean($value)":"sample($value)";var e=t.NAME;return"Inv"===e?"inv(x="+t.VAL+","+r+")":"Pdf"===e?"pdf(x="+t.VAL+","+r+")":"cdf(x="+t.VAL+","+r+")"}var v={format:m};function y(n){return"Log"===n?function(n,t){return Math.log(n)/Math.log(t)}:"Exponentiate"===n?function(n,t){return Math.pow(n,t)}:function(n,t){return n*t}}function b(n,t,r){return"Log"===n?"verticalLog("+t+", "+r+") ":"Exponentiate"===n?"verticalExponentiate("+t+", "+r+") ":"verticalMultiply("+t+", "+r+") "}function s(n){return"Log"===n?function(n,t){}:"Exponentiate"===n?function(n,t){}:function(n,t){return n*t}}function g(n){return"Log"===n?function(n,t){}:"Exponentiate"===n?function(n,t){}:function(n,t){}}var A={toFn:y,format:b,toIntegralSumCacheFn:s,toIntegralCacheFn:g};function d(n,t,r){return"truncate("+r+", "+e.O.dimap(function(n){return n.toString()},function(n){return"-inf"},n)+", "+e.O.dimap(function(n){return n.toString()},function(n){return"inf"},t)+")"}function x(t,e){if("object"!==n(e))return"";var o=e.NAME;if("Normalize"===o)return"normalize(k"+r._1(t,e.VAL)+")";if("AlgebraicCombination"===o){var i=e.VAL;return a(i[0],r._1(t,i[1]),r._1(t,i[2]))}if("FloatFromDist"===o){var u=e.VAL;return m(u[0],r._1(t,u[1]))}if("PointwiseCombination"===o){var f=e.VAL;return l(f[0],r._1(t,f[1]),r._1(t,f[2]))}if("Truncate"===o){var c=e.VAL;return d(c[0],c[1],r._1(t,c[2]))}if("VerticalScaling"!==o)return"Render"===o?r._1(t,e.VAL):"";var p=e.VAL;return b(p[0],r._1(t,p[1]),r._1(t,p[2]))}var S={truncateToString:d,toString:x};exports.Algebraic=f,exports.Pointwise=p,exports.DistToFloat=v,exports.Scale=A,exports.T=S;
},{"rescript/lib/js/curry.js":"NSLD","../utility/E.bs.js":"xX5m"}],"eTMD":[function(require,module,exports) {
"use strict";var t=require("rescript/lib/js/curry.js");function e(e){var n=e.minX,r=e.maxX,a={get:e.integral,xToY:e.integralXtoY,yToX:e.integralYtoX,sum:e.integralEndY};return{minX:n,maxX:r,integral:e.integral,xTotalRange:function(e){return t._1(r,e)-t._1(n,e)},mapY:e.mapY,xToY:e.xToY,downsample:e.downsample,toShape:e.toShape,toDiscreteProbabilityMassFraction:e.toDiscreteProbabilityMassFraction,toContinuous:e.toContinuous,toDiscrete:e.toDiscrete,normalize:e.normalize,truncate:e.truncate,mean:e.mean,variance:e.variance,updateIntegralCache:e.updateIntegralCache,Integral:a}}function n(e,n,r){if(void 0!==n&&void 0!==r)return t._2(e,n,r)}function r(e,n,r){if(void 0!==n&&void 0!==r)return t._2(e,n,r)}var a={combineIntegralSums:n,combineIntegrals:r};exports.Dist=e,exports.Common=a;
},{"rescript/lib/js/curry.js":"NSLD"}],"YXLi":[function(require,module,exports) {
"use strict";var e=require("rescript/lib/js/curry.js"),t=require("rescript/lib/js/belt_Array.js"),r=require("rescript/lib/js/caml_array.js"),n=require("rescript/lib/js/pervasives.js"),s=require("../utility/E.bs.js"),a=require("./XYShape.bs.js"),i=require("../expressionTree/Operation.bs.js");function o(e,n){var i=void 0!==e&&e,o=a.T.length(n),g=n.ys,u=n.xs;u.unshift(r.get(u,0)),g.unshift(r.get(g,0)),u.push(r.get(u,o-1|0)),g.push(r.get(g,o-1|0));for(var f=s.A.length(u),c=new Array(f),h=new Array(f-1|0),l=new Array(f-2|0),p=0;p<f;++p)t.set(c,p,r.get(u,p)*r.get(u,p));for(var v=0,y=f-2|0;v<=y;++v)t.set(h,v,r.get(u,v)*r.get(u,v+1|0));for(var m=0,M=f-3|0;m<=M;++m)t.set(l,m,r.get(u,m)*r.get(u,m+2|0));var A=new Array(f-2|0),w=new Array(f-2|0),x=new Array(f-2|0);if(i){for(var b=1,d=f-2|0;b<=d;++b){t.set(A,b-1|0,(r.get(u,b+1|0)-r.get(u,b-1|0))*r.get(g,b)/2);var j=r.get(u,b-1|0),_=r.get(u,b),q=r.get(u,b+1|0),T=2*(j*Math.log(j/_)/(j-_)+q*Math.log(_/q)/(q-_))/(j-q),D=2*(Math.log(_/j)/(j-_)+q*Math.log(q/_)/(q-_))/(j-q)-Math.pow(T,2);t.set(w,b-1|0,T),t.set(x,b-1|0,D)}return{n:f-2|0,masses:A,means:w,variances:x}}for(var k=1,C=f-2|0;k<=C;++k)t.set(A,k-1|0,(r.get(u,k+1|0)-r.get(u,k-1|0))*r.get(g,k)/2),t.set(w,k-1|0,(r.get(u,k-1|0)+r.get(u,k)+r.get(u,k+1|0))/3),t.set(x,k-1|0,(r.get(c,k-1|0)+r.get(c,k)+r.get(c,k+1|0)-r.get(h,k-1|0)-r.get(h,k)-r.get(l,k-1|0))/18);return{n:f-2|0,masses:A,means:w,variances:x}}function g(i,g,u){a.T.length(g),a.T.length(u);for(var f=o(void 0,g),c=o("Divide"===i,u),h="Divide"===i?function(e,t){return e*t}:"Multiply"===i?function(e,t){return e*t}:"Add"===i?function(e,t){return e+t}:"Exponentiate"===i?function(e,t){return Math.pow(e,t)}:function(e,t){return e-t},l="Divide"===i?function(e,t,r,n){return e*t+e*Math.pow(n,2)+t*Math.pow(r,2)}:"Multiply"===i?function(e,t,r,n){return e*t+e*Math.pow(n,2)+t*Math.pow(r,2)}:"Add"===i?function(e,t,r,n){return e+t}:"Exponentiate"===i?function(e,t,r,n){return e*t+e*Math.pow(n,2)+t*Math.pow(r,2)}:function(e,t,r,n){return e+t},p=n.infinity,v=n.neg_infinity,y=new Array(Math.imul(f.n,c.n)),m=new Array(Math.imul(f.n,c.n)),M=new Array(Math.imul(f.n,c.n)),A=0,w=f.n;A<w;++A)for(var x=0,b=c.n;x<b;++x){var d=Math.imul(A,c.n)+x|0;t.set(y,d,r.get(f.masses,A)*r.get(c.masses,x));var j=e._2(h,r.get(f.means,A),r.get(c.means,x)),_=e._4(l,r.get(f.variances,A),r.get(c.variances,x),r.get(f.means,A),r.get(c.means,x));t.set(m,d,j),t.set(M,d,_);var q=j-2*Math.sqrt(_)*1.644854,T=j+2*Math.sqrt(_)*1.644854;q<p&&(p=q),T>v&&(v=T)}for(var D=e._3(s.A.Floats.range,p,v,300),k=t.make(300,0),C=0,E=s.A.length(y);C<E;++C)if(r.get(M,C)>0&&r.get(y,C)>0)for(var F=0,B=s.A.length(D);F<B;++F){var P=r.get(D,F)-r.get(m,C),S=r.get(y,C)*Math.exp(-Math.pow(P,2)/(2*r.get(M,C)))/Math.sqrt(6.28318552*r.get(M,C));t.set(k,F,r.get(k,F)+S)}return{xs:D,ys:k}}function u(e){var n=e.ys,a=e.xs,i=s.A.length(a);return{n:i,masses:t.makeBy(i,function(e){return r.get(n,e)}),means:t.makeBy(i,function(e){return r.get(a,e)}),variances:t.makeBy(i,function(e){return 0})}}function f(n,o,g){var u=a.T.length(o),f=a.T.length(g),c=i.Algebraic.toFn(n),h=new Array(f);if("Exponentiate"===n||"Multiply"===n||"Divide"===n)for(var l=0;l<f;++l){for(var p=new Array(u),v=0;v<u;++v)t.set(p,v,[e._2(c,r.get(o.xs,v),r.get(g.xs,l)),r.get(o.ys,v)*r.get(g.ys,l)/r.get(g.xs,l)]);t.set(h,l,p)}else for(var y=0;y<f;++y){for(var m=new Array(u),M=0;M<u;++M)t.set(m,M,[e._2(c,r.get(o.xs,M),r.get(g.xs,y)),r.get(o.ys,M)*r.get(g.ys,y)]);t.set(h,y,m)}var A=a.XtoY.continuousInterpolator("Linear","UseZero");return e._3(s.A.fold_left,function(e,t){return a.PointwiseCombination.combine(function(e,t){return e+t},A,e,t)},a.T.empty,e._2(s.A.fmap,a.T.fromZippedArray,h))}exports.toDiscretePointMassesFromTriangulars=o,exports.combineShapesContinuousContinuous=g,exports.toDiscretePointMassesFromDiscrete=u,exports.combineShapesContinuousDiscrete=f;
},{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/belt_Array.js":"yUxI","rescript/lib/js/caml_array.js":"Tpli","rescript/lib/js/pervasives.js":"z22f","../utility/E.bs.js":"xX5m","./XYShape.bs.js":"Lf2V","../expressionTree/Operation.bs.js":"S4ET"}],"CVcq":[function(require,module,exports) {
"use strict";function e(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var n=require("rescript/lib/js/curry.js"),t=require("rescript/lib/js/pervasives.js"),i=require("rescript/lib/js/caml_option.js"),r=require("../utility/E.bs.js"),a=require("./XYShape.bs.js"),o=require("./DistTypes.bs.js"),u=require("./Distributions.bs.js"),p=require("./AlgebraicShapeCombination.bs.js");function c(e){return e.xyShape}function s(e){return e.interpolation}function l(e,n,t,r){return{xyShape:r,interpolation:void 0!==e?e:"Linear",integralSumCache:void 0!==n?i.valFromOption(n):void 0,integralCache:void 0!==t?i.valFromOption(t):void 0}}function h(e,t){return{xyShape:n._1(e,t.xyShape),interpolation:t.interpolation,integralSumCache:t.integralSumCache,integralCache:t.integralCache}}function m(e){return a.T.lastY(e.xyShape)}function f(e,t){var a=i.some(t.integralCache),o=i.some(t.integralSumCache),u=t.interpolation;return n._2(r.O.fmap,function(e){return l(u,o,a,e)},n._1(e,t.xyShape))}var S={xs:[t.neg_infinity],ys:[0]},g=0,y={xyShape:S,interpolation:"Linear",integralSumCache:g,integralCache:void 0},v=a.T.empty,x=0,d=y,C={xyShape:v,interpolation:"Linear",integralSumCache:x,integralCache:d};function b(e){return l(void 0,i.some(e.integralSumCache),i.some(e.integralCache),a.$$Range.stepwiseToLinear(e.xyShape))}function _(e,n,t,r,o,p){var c=void 0!==e?e:function(e,n){},s=void 0!==t?t:"PDF",h=u.Common.combineIntegralSums(c,o.integralSumCache,p.integralSumCache),m=o.interpolation,f=p.interpolation,S="Linear"===m?"Linear"===f?[o,p]:[o,b(p)]:"Linear"===f?[b(o),p]:[o,p],g=S[0],y="PDF"===s?"UseZero":"UseOutermostPoints",v=a.XtoY.continuousInterpolator(g.interpolation,y);return l(void 0,i.some(h),void 0,a.PointwiseCombination.combine(r,v,g.xyShape,S[1].xyShape))}function T(e){if("Linear"===e.interpolation)return e;var t=i.some(e.integralSumCache),o=i.some(e.integralCache);return n._2(r.O.fmap,function(e){return l(void 0,t,o,e)},a.$$Range.stepsToContinuous(e.xyShape))}function O(e,t){return n._1(e,t.xyShape)}function Y(e,n){return{xyShape:n.xyShape,interpolation:n.interpolation,integralSumCache:e,integralCache:n.integralCache}}function X(e,n){return{xyShape:n.xyShape,interpolation:n.interpolation,integralSumCache:n.integralSumCache,integralCache:e}}function $(e,t,i,a){var o=void 0!==t?t:function(e,n){},u=void 0!==e?e:function(e,n){};return n._3(r.A.fold_left,function(e,n){return _(u,o,void 0,i,e,n)},C,a)}function j(e,t,o,u){var p=void 0!==e?e:function(e){},c=void 0!==t?t:function(e){},s=u.integralSumCache,h=u.integralCache;return l(u.interpolation,i.some(n._2(r.O.bind,s,p)),i.some(n._2(r.O.bind,h,c)),a.T.mapY(o,u.xyShape))}function L(e,t){var i=void 0!==e?e:1,a=n._2(r.O.bind,t.integralSumCache,function(e){return i*e});return X(n._2(r.O.bind,t.integralCache,function(e){return L(i,e)}),Y(a,j(void 0,void 0,function(e){return e*i},t)))}function D(e){return a.T.minX(e.xyShape)}function M(e){return a.T.maxX(e.xyShape)}function w(e){return 0}function A(n){return e({TAG:2,_0:n},Symbol.for("name"),"Continuous")}function q(e,t){var i=t.xyShape;return o.MixedPoint.makeContinuous("Linear"===t.interpolation?a.XtoY.linear(e,i):n._2(r.O.$$default,0,a.XtoY.stepwiseIncremental(e,i)))}function I(e,i,o){var u=n._2(r.O.$$default,t.neg_infinity,e),p=n._2(r.O.$$default,t.infinity,i),c=a.Zipped.filterByX(function(e){return e>=u&&e<=p},a.T.zip(o.xyShape)),s=r.O.dimap(function(e){return[[e-t.epsilon_float,0]]},function(e){return[]},e),h=r.O.dimap(function(e){return[[e+t.epsilon_float,0]]},function(e){return[]},i),m=n._1(r.A.concatMany,[s,c,h]);return l(void 0,void 0,void 0,a.T.fromZippedArray(m))}function P(e){var t=a.T.isEmpty(e.xyShape),i=e.integralCache;return t?y:void 0!==i?i:l(void 0,void 0,void 0,n._2(r.O.toExt,"This should not have happened",a.$$Range.integrateWithTriangles(e.xyShape)))}function E(e,n){var t=P(n).xyShape;return h(function(n){return a.XsConversion.proportionByProbabilityMass(e,t,n)},n)}function F(e){var t=P(e);return n._2(r.O.$$default,a.T.lastY(t.xyShape),e.integralSumCache)}function B(e,n){var t=P(
},{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/pervasives.js":"z22f","rescript/lib/js/caml_option.js":"dzFO","../utility/E.bs.js":"xX5m","./XYShape.bs.js":"Lf2V","./DistTypes.bs.js":"r7Vb","./Distributions.bs.js":"eTMD","./AlgebraicShapeCombination.bs.js":"YXLi"}],"Ms6F":[function(require,module,exports) {
"use strict";function e(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var r=require("rescript/lib/js/curry.js"),t=require("rescript/lib/js/belt_Array.js"),n=require("rescript/lib/js/caml_array.js"),i=require("rescript/lib/js/pervasives.js"),a=require("rescript/lib/js/caml_option.js"),o=require("../utility/E.bs.js"),u=require("rescript/lib/js/belt_MutableMap.js"),c=require("./XYShape.bs.js"),s=require("./DistTypes.bs.js"),p=require("../expressionTree/Operation.bs.js"),l=require("./Continuous.bs.js"),f=require("./Distributions.bs.js");function h(e,r,t){return{xyShape:t,integralSumCache:void 0!==e?a.valFromOption(e):void 0,integralCache:void 0!==r?a.valFromOption(r):void 0}}function m(e,t){return{xyShape:r._1(e,t.xyShape),integralSumCache:t.integralSumCache,integralCache:t.integralCache}}function y(e){return e.xyShape}function g(e,t){var n=a.some(t.integralCache),i=a.some(t.integralSumCache);return r._2(o.O.fmap,function(e){return h(i,n,e)},r._1(e,t.xyShape))}var S={xs:[i.neg_infinity],ys:[0]},x=0,d={xyShape:S,interpolation:"Stepwise",integralSumCache:x,integralCache:void 0},v=c.T.empty,C=0,b=d,_={xyShape:v,integralSumCache:C,integralCache:b};function T(e,t){return r._1(e,t.xyShape)}function j(e){return c.T.lastY(e.xyShape)}function Y(e,r,t,n,i){var o=void 0!==e?e:function(e,r){},u=f.Common.combineIntegralSums(o,n.integralSumCache,i.integralSumCache);return h(a.some(u),void 0,c.PointwiseCombination.combine(function(e,r){return e+r},c.XtoY.discreteInterpolator,n.xyShape,i.xyShape))}function X(e,t,n,i){var a=void 0!==t?t:function(e,r){},u=void 0!==e?e:function(e,r){};return r._3(o.A.fold_left,function(e,r){return Y(u,a,n,e,r)},_,i)}function O(e,r){return{xyShape:r.xyShape,integralSumCache:e,integralCache:r.integralCache}}function q(e,r){return{xyShape:r.xyShape,integralSumCache:r.integralSumCache,integralCache:e}}function A(e,t,i){for(var s=t.xyShape,l=i.xyShape,m=c.T.length(s),y=c.T.length(l),g=f.Common.combineIntegralSums(function(e,r){return e*r},t.integralSumCache,i.integralSumCache),S=p.Algebraic.toFn(e),x=o.FloatFloatMap.empty(void 0),d=0;d<m;++d)for(var v=0;v<y;++v){var C=r._2(S,n.get(s.xs,d),n.get(l.xs,v)),b=r._2(o.O.$$default,0,o.FloatFloatMap.get(C,x)),_=n.get(s.ys,d)*n.get(l.ys,v);u.set(x,C,b+_)}var T=c.Zipped.sortByX(o.FloatFloatMap.toArray(x)),j=c.T.fromZippedArray(T);return h(a.some(g),void 0,j)}function F(e,t,n,i){var u=void 0!==e?e:function(e){},s=void 0!==t?t:function(e){},p=i.integralSumCache,l=i.integralCache;return h(a.some(r._2(o.O.bind,p,u)),a.some(r._2(o.O.bind,l,s)),c.T.mapY(n,i.xyShape))}function $(e,t){var n=void 0!==e?e:1,i=r._2(o.O.fmap,function(e){return n*e},t.integralSumCache),a=n;return q(r._2(o.O.fmap,function(e){return l.scaleBy(a,e)},t.integralCache),O(i,F(void 0,void 0,function(e){return e*n},t)))}function M(e){var r=c.T.isEmpty(e.xyShape),t=e.integralCache;if(r)return d;if(void 0!==t)return t;var n=e.xyShape,a={xs:[c.T.minX(n)-i.epsilon_float],ys:[0]},o=c.T.accumulateYs(function(e,r){return e+r},c.T.concat(a,n));return l.make("Stepwise",void 0,void 0,o)}function D(e){return r._2(o.O.$$default,l.lastY(M(e)),e.integralSumCache)}function I(e){return c.T.minX(e.xyShape)}function w(e){return c.T.maxX(e.xyShape)}function Z(e){return 1}function B(r){return e({TAG:1,_0:r},Symbol.for("name"),"Discrete")}function P(e){}function k(e){return a.some(e)}function z(e){return O(1,$(1/D(e),e))}function E(e,r){var n=c.T.length(r.xyShape);return e<n&&e>=1&&n>1?h(void 0,void 0,c.T.fromZippedArray(c.Zipped.sortByX(t.slice(t.reverse(c.Zipped.sortByY(c.T.zip(r.xyShape))),0,e)))):r}function G(e,t,n){return h(void 0,void 0,c.T.fromZippedArray(c.Zipped.filterByX(function(n){return n>=r._2(o.O.$$default,i.neg_infinity,e)&&n<=r._2(o.O.$$default,i.infinity,t)},c.T.zip(n.xyShape))))}function V(e,t){return s.MixedPoint.makeDiscrete(r._2(o.O.$$default,0,c.XtoY.stepwiseIfAtX(e,t.xyShape)))}function H(e,r){return c.XtoY.linear(e,l.getShape(M(r)))}function J(e,r){return c.YtoX.linear(e,l.getShape(M(r)))}function K(e){var t=e.xyShape;return r._3(o.A.reducei,t.xs
},{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/belt_Array.js":"yUxI","rescript/lib/js/caml_array.js":"Tpli","rescript/lib/js/pervasives.js":"z22f","rescript/lib/js/caml_option.js":"dzFO","../utility/E.bs.js":"xX5m","rescript/lib/js/belt_MutableMap.js":"aHaK","./XYShape.bs.js":"Lf2V","./DistTypes.bs.js":"r7Vb","../expressionTree/Operation.bs.js":"S4ET","./Continuous.bs.js":"CVcq","./Distributions.bs.js":"eTMD"}],"XMuZ":[function(require,module,exports) {
"use strict";function e(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var n=require("rescript/lib/js/caml.js"),t=require("rescript/lib/js/curry.js"),r=require("rescript/lib/js/caml_option.js"),i=require("../utility/E.bs.js"),a=require("./XYShape.bs.js"),o=require("./Discrete.bs.js"),u=require("./DistTypes.bs.js"),c=require("./Continuous.bs.js"),s=require("./Distributions.bs.js");function l(e,n,t,i){return{continuous:t,discrete:i,integralSumCache:void 0!==e?r.valFromOption(e):void 0,integralCache:void 0!==n?r.valFromOption(n):void 0}}function m(e){return a.T.length(c.getShape(e.continuous))+a.T.length(o.getShape(e.discrete))|0}function d(e,n){var a=void 0!==e?e:1,u=o.scaleBy(a,n.discrete),s=c.scaleBy(a,n.continuous),m=t._2(i.O.bind,n.integralCache,function(e){return c.scaleBy(a,e)}),d=t._2(i.O.bind,n.integralSumCache,function(e){return e*a});return l(r.some(d),r.some(m),s,u)}function g(e){return e.continuous}function h(e){return e.discrete}function p(e,n){return{continuous:n.continuous,discrete:n.discrete,integralSumCache:n.integralSumCache,integralCache:e}}function _(e){return n.caml_float_min(t._1(c.T.minX,e.continuous),t._1(o.T.minX,e.discrete))}function C(e){return n.caml_float_max(t._1(c.T.maxX,e.continuous),t._1(o.T.maxX,e.discrete))}function v(n){return e({TAG:0,_0:n},Symbol.for("name"),"Mixed")}function f(e,n,i){var a=t._3(c.T.truncate,e,n,i.continuous),u=t._3(o.T.truncate,e,n,i.discrete);return l(r.some(void 0),r.some(void 0),a,u)}function b(e){var n=t._1(c.T.Integral.get,e.continuous),i=t._1(o.T.Integral.get,e.discrete),a=c.updateIntegralCache(n,e.continuous),u=o.updateIntegralCache(i,e.discrete),s=t._1(c.T.Integral.sum,a),m=t._1(o.T.Integral.sum,u),d=s+m,g=s/d,h=m/d,p=c.updateIntegralSumCache(g,c.scaleBy(g/s,a)),_=o.updateIntegralSumCache(h,o.scaleBy(h/m,u));return l(1,r.some(void 0),p,_)}function T(e,n){var r=b(n),i=t._2(c.T.xToY,e,r.continuous),a=t._2(o.T.xToY,e,r.discrete);return u.MixedPoint.add(i,a)}function S(e){var n=t._1(o.T.Integral.sum,e.discrete);return n/(n+t._1(c.T.Integral.sum,e.continuous))}function I(e,n){var r=t._1(o.T.Integral.sum,n.discrete),i=t._1(c.T.Integral.sum,n.continuous),a=r+i,u=t._2(o.T.downsample,e*(r/a)|0,n.discrete);return{continuous:t._2(c.T.downsample,e*(i/a)|0,n.continuous),discrete:u,integralSumCache:n.integralSumCache,integralCache:n.integralCache}}function y(e){var n=e.integralCache;if(void 0!==n)return n;var r=t._1(c.T.Integral.get,e.continuous),i=c.stepwiseToLinear(t._1(o.T.Integral.get,e.discrete));return c.make(void 0,void 0,void 0,a.PointwiseCombination.combine(function(e,n){return e+n},a.XtoY.continuousInterpolator("Linear","UseOutermostPoints"),c.getShape(r),c.getShape(i)))}function x(e){return c.lastY(y(e))}function O(e,n){return a.XtoY.linear(e,c.getShape(y(n)))}function Y(e,n){return a.YtoX.linear(e,c.getShape(y(n)))}function j(e,n,r,a){var u=void 0!==e?e:function(e){},s=void 0!==n?n:function(e){},l=o.T.mapY,m=o.updateIntegralCache(t._2(i.O.bind,a.discrete.integralCache,s),o.updateIntegralSumCache(t._2(i.O.bind,a.discrete.integralSumCache,u),t._4(l,void 0,void 0,r,a.discrete))),d=c.T.mapY;return{continuous:c.updateIntegralCache(t._2(i.O.bind,a.continuous.integralCache,s),c.updateIntegralSumCache(t._2(i.O.bind,a.continuous.integralSumCache,u),t._4(d,void 0,void 0,r,a.continuous))),discrete:m,integralSumCache:t._2(i.O.bind,a.integralSumCache,u),integralCache:t._2(i.O.bind,a.integralCache,s)}}function A(e){var n=e.discrete,r=e.continuous,i=t._1(o.T.mean,n),a=t._1(c.T.mean,r),u=t._1(o.T.Integral.sum,n),s=t._1(c.T.Integral.sum,r);return(i*u+a*s)/(u+s)}function X(e){var n=e.discrete,r=e.continuous,i=t._1(o.T.Integral.sum,n),u=t._1(c.T.Integral.sum,r),s=i+u,l=i/s;return 0!==l?1!==l?a.Analysis.getVarianceDangerously(e,A,function(e){var n=t._1(o.T.mean,o.shapeMap(a.Analysis.squareXYShape,e.discrete)),r=a.Analysis.getMeanOfSquaresContinuousShape(e.continuous);return(n*i+r*u)/s}):t._1(o.T.variance,n):t._1(c.T.variance,r)}var q=s.Dist({minX:_,maxX:C,mapY:j,xToY:T,toShape:v,toContinuous:g,toDiscrete:h,normalize:b,t
},{"rescript/lib/js/caml.js":"gGFE","rescript/lib/js/curry.js":"NSLD","rescript/lib/js/caml_option.js":"dzFO","../utility/E.bs.js":"xX5m","./XYShape.bs.js":"Lf2V","./Discrete.bs.js":"Ms6F","./DistTypes.bs.js":"r7Vb","./Continuous.bs.js":"CVcq","./Distributions.bs.js":"eTMD"}],"wbI6":[function(require,module,exports) {
"use strict";function e(r){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(r)}function r(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var t=require("rescript/lib/js/curry.js"),n=require("rescript/lib/js/random.js"),a=require("rescript/lib/js/belt_Array.js"),o=require("rescript/lib/js/caml_option.js"),i=require("./Mixed.bs.js"),c=require("./Discrete.bs.js"),u=require("./Continuous.bs.js"),s=require("./Distributions.bs.js");function l(e,r){switch(0|r.TAG){case 0:return t._1(e[0],r._0);case 1:return t._1(e[1],r._0);case 2:return t._1(e[2],r._0)}}function T(e,n){switch(0|n.TAG){case 0:return r({TAG:0,_0:t._1(e[0],n._0)},Symbol.for("name"),"Mixed");case 1:return r({TAG:1,_0:t._1(e[1],n._0)},Symbol.for("name"),"Discrete");case 2:return r({TAG:2,_0:t._1(e[2],n._0)},Symbol.for("name"),"Continuous")}}function _(e){return e}function m(e){return i.make(o.some(e.integralSumCache),o.some(e.integralCache),u.empty,e)}function f(e){return i.make(o.some(e.integralSumCache),o.some(e.integralCache),e,c.empty)}var b=[_,m,f];function p(e){return l(b,e)}function g(e,r,n){switch(0|r.TAG){case 0:break;case 1:var a=r._0;switch(0|n.TAG){case 0:break;case 1:return t._1(c.T.toShape,c.combineAlgebraically(e,a,n._0));case 2:return t._1(u.T.toShape,u.combineAlgebraicallyWithDiscrete(e,n._0,a))}break;case 2:var o=r._0;switch(0|n.TAG){case 0:break;case 1:return t._1(u.T.toShape,u.combineAlgebraicallyWithDiscrete(e,o,n._0));case 2:return t._1(u.T.toShape,u.combineAlgebraically(e,o,n._0))}}return t._1(i.T.toShape,i.combineAlgebraically(e,p(r),p(n)))}function y(e,t,n,a,o){var s=void 0!==e?e:function(e,r){},l=void 0!==t?t:function(e,r){};switch(0|a.TAG){case 0:break;case 1:switch(0|o.TAG){case 1:return r({TAG:1,_0:c.combinePointwise(s,l,n,a._0,o._0)},Symbol.for("name"),"Discrete")}break;case 2:switch(0|o.TAG){case 0:case 1:break;case 2:return r({TAG:2,_0:u.combinePointwise(s,l,void 0,n,a._0,o._0)},Symbol.for("name"),"Continuous")}}return r({TAG:0,_0:i.combinePointwise(s,l,n,p(a),p(o))},Symbol.for("name"),"Mixed")}function v(e){var r=[t._1(i.T.xToY,e),t._1(c.T.xToY,e),t._1(u.T.xToY,e)];return function(e){return l(r,e)}}function x(e){return e}function h(e,r){return T([t._1(i.T.downsample,e),t._1(c.T.downsample,e),t._1(u.T.downsample,e)],r)}function d(e,r,n){return T([t._2(i.T.truncate,e,r),t._2(c.T.truncate,e,r),t._2(u.T.truncate,e,r)],n)}var A=i.T.normalize,I=c.T.normalize,w=u.T.normalize,S=[A,I,w];function G(e){return T(S,e)}function C(e,r){return T([t._1(i.T.updateIntegralCache,e),t._1(c.T.updateIntegralCache,e),t._1(u.T.updateIntegralCache,e)],r)}var Y=i.T.toContinuous,D=c.T.toContinuous,X=u.T.toContinuous,j=[Y,D,X];function k(e){return l(j,e)}var M=i.T.toDiscrete,P=c.T.toDiscrete,q=u.T.toDiscrete,F=[M,P,q];function z(e){return l(F,e)}var N=i.T.toDiscreteProbabilityMassFraction,E=c.T.toDiscreteProbabilityMassFraction,L=u.T.toDiscreteProbabilityMassFraction,V=[N,E,L];function W(e){return l(V,e)}var $=i.T.minX,O=c.T.minX,R=u.T.minX,B=[$,O,R];function H(e){return l(B,e)}var J=i.T.Integral.get,K=c.T.Integral.get,Q=u.T.Integral.get,U=[J,K,Q];function Z(e){return l(U,e)}var ee=i.T.Integral.sum,re=c.T.Integral.sum,te=u.T.Integral.sum,ne=[ee,re,te];function ae(e){return l(ne,e)}function oe(e){var r=[t._1(i.T.Integral.xToY,e),t._1(c.T.Integral.xToY,e),t._1(u.T.Integral.xToY,e)];return function(e){return l(r,e)}}function ie(e){var r=[t._1(i.T.Integral.yToX,e),t._1(c.T.Integral.yToX,e),t._1(u.T.Integral.yToX,e)];return function(e){return l(r,e)}}var ce=i.T.maxX,ue=c.T.maxX,se=u.T.maxX,le=[ce,ue,se];function Te(e){return l(le,e)}function _e(e,r,n){var a=void 0!==e?e:function(e){},o=void 0!==r?r:function(e){},s=[t._3(i.T.mapY,a,o,n),t._3(c.T.mapY,a,o,n),t._3(u.T.mapY,a,o,n)];return function(e){return T(s,e)}}function me(e){switch(0|e.TAG){case 0:return t._1(i.T.mean,e._0);case 1:return t._1(c.T.mean,e._0);case 2:return t._1(u.T.mean,e._0)}}fun
},{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/random.js":"l4ED","rescript/lib/js/belt_Array.js":"yUxI","rescript/lib/js/caml_option.js":"dzFO","./Mixed.bs.js":"XMuZ","./Discrete.bs.js":"Ms6F","./Continuous.bs.js":"CVcq","./Distributions.bs.js":"eTMD"}],"A9pM":[function(require,module,exports) {
"use strict";function n(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}var t=require("rescript/lib/js/curry.js"),e=require("../utility/E.bs.js"),r=require("./Shape.bs.js"),i=require("./DistTypes.bs.js"),a=require("./Distributions.bs.js");function u(n){return t._1(r.T.Integral.get,n)}function o(n,e,i,a,u){var o=void 0!==a?a:0;return{shape:n,domain:void 0!==i?i:0,integralCache:t._1(r.T.Integral.get,n),unit:o,squiggleString:e}}function s(n,r,i,a,u,o){return{shape:t._2(e.O.$$default,o.shape,n),domain:t._2(e.O.$$default,o.domain,i),integralCache:t._2(e.O.$$default,o.integralCache,r),unit:t._2(e.O.$$default,o.unit,a),squiggleString:t._2(e.O.$$default,o.squiggleString,u)}}function c(n,e){return s(n,t._1(r.T.Integral.get,n),void 0,void 0,void 0,e)}function l(n){return i.Domain.includedProbabilityMass(n.domain)}function d(n,t){return t*i.Domain.includedProbabilityMass(n.domain)}function f(n){return n.shape}function p(n,e){return t._1(n,e.shape)}function g(n){return p(r.T.toContinuous,n)}function m(n){return p(r.T.toDiscrete,n)}function T(n){return c(t._1(r.T.normalize,f(n)),n)}function b(n,e,i){return c(t._3(r.T.truncate,n,e,f(i)),i)}function _(n,e){return i.MixedPoint.fmap(function(n){return d(e,n)},t._2(r.T.xToY,n,f(e)))}function h(n){return p(r.T.minX,n)}function v(n){return p(r.T.maxX,n)}function x(n){return p(r.T.toDiscreteProbabilityMassFraction,n)}function y(t){return c(n({TAG:2,_0:t.integralCache},Symbol.for("name"),"Continuous"),t)}function $(n,r){return s(void 0,t._2(e.O.$$default,r.integralCache,n),void 0,void 0,void 0,r)}function I(n,e){return c(t._2(r.T.downsample,n,f(e)),e)}function C(n,e,i,a){var u=void 0!==n?n:function(n){};return c(t._4(r.T.mapY,u,void 0,i,a.shape),a)}function D(n){return t._1(r.T.Integral.sum,f(n))}function j(n,e){return d(e,t._2(r.T.Integral.xToY,n,f(e)))}function q(n,e){return t._2(r.T.Integral.yToX,n,f(e))}function P(n){return t._1(r.T.mean,n.shape)}function S(n){return t._1(r.T.variance,n.shape)}var Y=a.Dist({minX:h,maxX:v,mapY:C,xToY:_,toShape:f,toContinuous:g,toDiscrete:m,normalize:T,toDiscreteProbabilityMassFraction:x,downsample:I,truncate:b,updateIntegralCache:$,integral:y,integralEndY:D,integralXtoY:j,integralYtoX:q,mean:P,variance:S});exports.shapeIntegral=u,exports.make=o,exports.update=s,exports.updateShape=c,exports.domainIncludedProbabilityMass=l,exports.domainIncludedProbabilityMassAdjustment=d,exports.toShape=f,exports.shapeFn=p,exports.T=Y;
},{"rescript/lib/js/curry.js":"NSLD","../utility/E.bs.js":"xX5m","./Shape.bs.js":"wbI6","./DistTypes.bs.js":"r7Vb","./Distributions.bs.js":"eTMD"}],"GWKE":[function(require,module,exports) {
"use strict";var r=require("./caml_option.js");function e(e,t){if(t in e)return r.some(e[t])}var t=function(r,e){delete r[e]};function n(r){for(var e=Object.keys(r),t=e.length,n=new Array(t),o=0;o<t;++o){var a=e[o];n[o]=[a,r[a]]}return n}function o(r){for(var e=Object.keys(r),t=e.length,n=new Array(t),o=0;o<t;++o)n[o]=r[e[o]];return n}function a(r){for(var e={},t=r;;){var n=t;if(!n)return e;var o=n.hd;e[o[0]]=o[1],t=n.tl}}function s(r){for(var e={},t=r.length,n=0;n<t;++n){var o=r[n];e[o[0]]=o[1]}return e}function f(r,e){for(var t={},n=Object.keys(e),o=n.length,a=0;a<o;++a){var s=n[a];t[s]=r(e[s])}return t}exports.get=e,exports.unsafeDeleteKey=t,exports.entries=n,exports.values=o,exports.fromList=a,exports.fromArray=s,exports.map=f;
},{"./caml_option.js":"dzFO"}],"kurU":[function(require,module,exports) {
"use strict";var r=require("rescript/lib/js/list.js"),t=require("rescript/lib/js/array.js"),e=require("rescript/lib/js/curry.js"),o=require("rescript/lib/js/js_dict.js"),n=require("rescript/lib/js/caml_option.js"),i=require("rescript/lib/js/caml_string.js"),E=require("rescript/lib/js/caml_exceptions.js"),a=require("rescript/lib/js/caml_js_exceptions.js");function _(r){return!!Number.isFinite(r)&&Math.floor(r)===r}var c=E.create("Json_decode.DecodeError");function l(r){return r}function f(r){if("boolean"==typeof r)return r;throw{RE_EXN_ID:c,_1:"Expected boolean, got "+JSON.stringify(r),Error:new Error}}function s(r){if("number"==typeof r)return r;throw{RE_EXN_ID:c,_1:"Expected number, got "+JSON.stringify(r),Error:new Error}}function u(r){var t=s(r);if(_(t))return t;throw{RE_EXN_ID:c,_1:"Expected integer, got "+JSON.stringify(r),Error:new Error}}function p(r){if("string"==typeof r)return r;throw{RE_EXN_ID:c,_1:"Expected string, got "+JSON.stringify(r),Error:new Error}}function h(r){var t=p(r);if(1===t.length)return i.get(t,0);throw{RE_EXN_ID:c,_1:"Expected single-character string, got "+JSON.stringify(r),Error:new Error}}function w(r){return new Date(p(r))}function y(r,t){return null===t?null:e._1(r,t)}function x(r,t){if(null===t)return r;throw{RE_EXN_ID:c,_1:"Expected null, got "+JSON.stringify(t),Error:new Error}}function g(r,t){if(Array.isArray(t)){for(var o=t.length,n=new Array(o),i=0;i<o;++i){var E;try{E=e._1(r,t[i])}catch(l){var _=a.internalToOCamlException(l);if(_.RE_EXN_ID===c)throw{RE_EXN_ID:c,_1:_._1+"\n\tin array at index "+String(i),Error:new Error};throw _}n[i]=E}return n}throw{RE_EXN_ID:c,_1:"Expected array, got "+JSON.stringify(t),Error:new Error}}function N(r,e){return t.to_list(g(r,e))}function d(r,t,o){if(!Array.isArray(o))throw{RE_EXN_ID:c,_1:"Expected array, got "+JSON.stringify(o),Error:new Error};var n=o.length;if(2!==n)throw{RE_EXN_ID:c,_1:"Expected array of length 2, got array of length "+n,Error:new Error};try{return[e._1(r,o[0]),e._1(t,o[1])]}catch(E){var i=a.internalToOCamlException(E);if(i.RE_EXN_ID===c)throw{RE_EXN_ID:c,_1:i._1+"\n\tin pair/tuple2",Error:new Error};throw i}}function D(r,t,o,n){if(!Array.isArray(n))throw{RE_EXN_ID:c,_1:"Expected array, got "+JSON.stringify(n),Error:new Error};var i=n.length;if(3!==i)throw{RE_EXN_ID:c,_1:"Expected array of length 3, got array of length "+i,Error:new Error};try{return[e._1(r,n[0]),e._1(t,n[1]),e._1(o,n[2])]}catch(_){var E=a.internalToOCamlException(_);if(E.RE_EXN_ID===c)throw{RE_EXN_ID:c,_1:E._1+"\n\tin tuple3",Error:new Error};throw E}}function I(r,t,o,n,i){if(!Array.isArray(i))throw{RE_EXN_ID:c,_1:"Expected array, got "+JSON.stringify(i),Error:new Error};var E=i.length;if(4!==E)throw{RE_EXN_ID:c,_1:"Expected array of length 4, got array of length "+E,Error:new Error};try{return[e._1(r,i[0]),e._1(t,i[1]),e._1(o,i[2]),e._1(n,i[3])]}catch(l){var _=a.internalToOCamlException(l);if(_.RE_EXN_ID===c)throw{RE_EXN_ID:c,_1:_._1+"\n\tin tuple4",Error:new Error};throw _}}function v(r,t){if("object"==typeof t&&!Array.isArray(t)&&null!==t){for(var o=Object.keys(t),n=o.length,i={},E=0;E<n;++E){var _,l=o[E];try{_=e._1(r,t[l])}catch(s){var f=a.internalToOCamlException(s);if(f.RE_EXN_ID===c)throw{RE_EXN_ID:c,_1:f._1+"\n\tin dict",Error:new Error};throw f}i[l]=_}return i}throw{RE_EXN_ID:c,_1:"Expected object, got "+JSON.stringify(t),Error:new Error}}function R(r,t,i){if("object"!=typeof i||Array.isArray(i)||null===i)throw{RE_EXN_ID:c,_1:"Expected object, got "+JSON.stringify(i),Error:new Error};var E=o.get(i,r);if(void 0===E)throw{RE_EXN_ID:c,_1:"Expected field '"+r+"'",Error:new Error};try{return e._1(t,n.valFromOption(E))}catch(l){var _=a.internalToOCamlException(l);if(_.RE_EXN_ID===c)throw{RE_EXN_ID:c,_1:_._1+"\n\tat field '"+r+"'",Error:new Error};throw _}}function X(r,t){if(r){var e=r.tl,o=r.hd;if(!e)return function(r){return R(o,t,r)};var n=X(e,t);return function(r){return R(o,n,r)}}throw{RE_EXN_ID:"Invalid_argument",_1:"Expected key_path to contain at least one element",Error:new Error}}function O(r,t){try{return n.some(e._1(r,t))}catch(i){var o=a.interna
},{"rescript/lib/js/list.js":"aYjQ","rescript/lib/js/array.js":"d4B1","rescript/lib/js/curry.js":"NSLD","rescript/lib/js/js_dict.js":"GWKE","rescript/lib/js/caml_option.js":"dzFO","rescript/lib/js/caml_string.js":"GLny","rescript/lib/js/caml_exceptions.js":"RiV8","rescript/lib/js/caml_js_exceptions.js":"yO2E"}],"XrLb":[function(require,module,exports) {
"use strict";var r=require("./caml_js_exceptions.js"),e=r.internalToOCamlException;function o(r){throw new Error(r)}function n(r){throw new EvalError(r)}function t(r){throw new RangeError(r)}function s(r){throw new ReferenceError(r)}function a(r){throw new SyntaxError(r)}function i(r){throw new TypeError(r)}function E(r){throw new URIError(r)}var w=r.$$Error;exports.$$Error=w,exports.anyToExnInternal=e,exports.raiseError=o,exports.raiseEvalError=n,exports.raiseRangeError=t,exports.raiseReferenceError=s,exports.raiseSyntaxError=a,exports.raiseTypeError=i,exports.raiseUriError=E;
},{"./caml_js_exceptions.js":"yO2E"}],"zHU1":[function(require,module,exports) {
"use strict";Number.isFinite=Number.isFinite||function(i){return"number"==typeof i&&isFinite(i)},Number.isNaN=Number.isNaN||function(i){return i!=i};
},{}],"NR2f":[function(require,module,exports) {
"use strict";module.exports=function(t){return t&&t.constructor.prototype.isBigNumber||!1};
},{}],"FcSp":[function(require,module,exports) {
"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(e)}function e(t){return(e="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?function(e){return r(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":r(e)})(t)}var t=require("./bignumber/isBigNumber");exports.clone=function r(n){var o=e(n);if("number"===o||"string"===o||"boolean"===o||null==n)return n;if("function"==typeof n.clone)return n.clone();if(Array.isArray(n))return n.map(function(e){return r(e)});if(n instanceof Date)return new Date(n.valueOf());if(t(n))return n;if(n instanceof RegExp)throw new TypeError("Cannot clone "+n);return exports.map(n,r)},exports.map=function(r,e){var t={};for(var n in r)exports.hasOwnProperty(r,n)&&(t[n]=e(r[n]));return t},exports.extend=function(r,e){for(var t in e)exports.hasOwnProperty(e,t)&&(r[t]=e[t]);return r},exports.deepExtend=function r(e,t){if(Array.isArray(t))throw new TypeError("Arrays are not supported by deepExtend");for(var n in t)if(exports.hasOwnProperty(t,n))if(t[n]&&t[n].constructor===Object)void 0===e[n]&&(e[n]={}),e[n].constructor===Object?r(e[n],t[n]):e[n]=t[n];else{if(Array.isArray(t[n]))throw new TypeError("Arrays are not supported by deepExtend");e[n]=t[n]}return e},exports.deepEqual=function(r,e){var t,n,o;if(Array.isArray(r)){if(!Array.isArray(e))return!1;if(r.length!==e.length)return!1;for(n=0,o=r.length;n<o;n++)if(!exports.deepEqual(r[n],e[n]))return!1;return!0}if(r instanceof Object){if(Array.isArray(e)||!(e instanceof Object))return!1;for(t in r)if(!exports.deepEqual(r[t],e[t]))return!1;for(t in e)if(!exports.deepEqual(r[t],e[t]))return!1;return!0}return r===e},exports.canDefineProperty=function(){try{if(Object.defineProperty)return Object.defineProperty({},"x",{get:function(){}}),!0}catch(r){}return!1},exports.lazy=function(r,e,t){if(exports.canDefineProperty()){var n,o=!0;Object.defineProperty(r,e,{get:function(){return o&&(n=t(),o=!1),n},set:function(r){n=r,o=!1},configurable:!0,enumerable:!0})}else r[e]=t()},exports.traverse=function(r,e){var t=r;if(e)for(var n=e.split("."),o=0;o<n.length;o++){var i=n[o];i in t||(t[i]={}),t=t[i]}return t},exports.hasOwnProperty=function(r,e){return r&&Object.hasOwnProperty.call(r,e)},exports.isFactory=function(r){return r&&"function"==typeof r.factory};
},{"./bignumber/isBigNumber":"NR2f"}],"Qbfe":[function(require,module,exports) {
var define;
var n;function t(n){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}!function(r,e){"function"==typeof n&&n.amd?n([],e):"object"===("undefined"==typeof exports?"undefined":t(exports))?module.exports=e():r.typed=e()}(this,function(){function n(){return!0}function r(){return!1}function e(){}return function a(){var o=[{name:"number",test:function(n){return"number"==typeof n}},{name:"string",test:function(n){return"string"==typeof n}},{name:"boolean",test:function(n){return"boolean"==typeof n}},{name:"Function",test:function(n){return"function"==typeof n}},{name:"Array",test:Array.isArray},{name:"Date",test:function(n){return n instanceof Date}},{name:"RegExp",test:function(n){return n instanceof RegExp}},{name:"Object",test:function(n){return"object"===t(n)&&n.constructor===Object}},{name:"null",test:function(n){return null===n}},{name:"undefined",test:function(n){return void 0===n}}],u={name:"any",test:n},i=[],f=[],s={types:o,conversions:f,ignore:i};function p(n){var t=N(s.types,function(t){return t.name===n});if(t)return t;if("any"===n)return u;var r=N(s.types,function(t){return t.name.toLowerCase()===n.toLowerCase()});throw new TypeError('Unknown type "'+n+'"'+(r?'. Did you mean "'+r.name+'"?':""))}function c(n){return n===u?999:s.types.indexOf(n)}function l(n){var t=N(s.types,function(t){return t.test(n)});if(t)return t.name;throw new TypeError("Value has unknown type. Value: "+n)}function m(n){return n.map(function(n){var t=n.types.map(b);return(n.restParam?"...":"")+t.join("|")}).join(",")}function g(n,t){var r=0===n.indexOf("..."),e=(r?n.length>3?n.slice(3):"any":n).split("|").map(I).filter(C).filter(k),a=function(n,t){var r={};return n.forEach(function(n){-1!==t.indexOf(n.from)||-1===t.indexOf(n.to)||r[n.from]||(r[n.from]=n)}),Object.keys(r).map(function(n){return r[n]})}(t,e),o=e.map(function(n){var t=p(n);return{name:n,typeIndex:c(t),test:t.test,conversion:null,conversionIndex:-1}}),u=a.map(function(n){var r=p(n.from);return{name:n.from,typeIndex:c(r),test:r.test,conversion:n,conversionIndex:t.indexOf(n)}});return{types:o.concat(u),restParam:r}}function y(n){var t=U(n);return!!t&&t.restParam}function h(n){return n.types.some(function(n){return null!=n.conversion})}function v(t){if(t&&0!==t.types.length){if(1===t.types.length)return p(t.types[0].name).test;if(2===t.types.length){var r=p(t.types[0].name).test,e=p(t.types[1].name).test;return function(n){return r(n)||e(n)}}var a=t.types.map(function(n){return p(n.name).test});return function(n){for(var t=0;t<a.length;t++)if(a[t](n))return!0;return!1}}return n}function d(n){var t,r,e,a;if(y(n)){var o=(t=(a=n,a.slice(0,a.length-1)).map(v)).length,u=v(U(n));return function(n){for(var r=0;r<t.length;r++)if(!t[r](n[r]))return!1;return function(n){for(var t=o;t<n.length;t++)if(!u(n[t]))return!1;return!0}(n)&&n.length>=o+1}}return 0===n.length?function(n){return 0===n.length}:1===n.length?(r=v(n[0]),function(n){return r(n[0])&&1===n.length}):2===n.length?(r=v(n[0]),e=v(n[1]),function(n){return r(n[0])&&e(n[1])&&2===n.length}):(t=n.map(v),function(n){for(var r=0;r<t.length;r++)if(!t[r](n[r]))return!1;return n.length===t.length})}function w(n,t){return t<n.params.length?n.params[t]:y(n.params)?U(n.params):null}function x(n,t,r){var e=w(n,t);return(e?r?e.types.filter(E):e.types:[]).map(b)}function b(n){return n.name}function E(n){return null===n.conversion||void 0===n.conversion}function j(n,t){var r=function(n){for(var t={},r=0;r<n.length;r++)t[n[r]]=!0;return Object.keys(t)}(q(n,function(n){return x(n,t,!1)}));return-1!==r.indexOf("any")?["any"]:r}function O(n){for(var t=999,r=0;r<n.types.length;r++)E(n.types[r])&&(t=Math.min(t,n.types[r].typeIndex));return t}function T(n){for(var t=999,r=0;r<n.types.length;r++)E(n.types[r])||(t=Math.min(t,n.types[r].conversionIndex));return t}function P(n,t){var r;return 0!=(r=n.restParam-t.restParam)?r:0!=(r=h(n)-h(t))?r:0!=(r=O(n)-O(t))?r:T(n)-T(t)}function A(n,t){var r,e,a=
},{}],"uqMu":[function(require,module,exports) {
"use strict";var e=require("./object");function n(e){for(var n=[],t=0;t<e;t++)n.push(0);return n}exports.isNumber=function(e){return"number"==typeof e},exports.isInteger=function(e){return"boolean"==typeof e||!!isFinite(e)&&e===Math.round(e)},exports.sign=Math.sign||function(e){return e>0?1:e<0?-1:0},exports.format=function(n,t){if("function"==typeof t)return t(n);if(n===1/0)return"Infinity";if(n===-1/0)return"-Infinity";if(isNaN(n))return"NaN";var r,i="auto";switch(t&&(t.notation&&(i=t.notation),exports.isNumber(t)?r=t:exports.isNumber(t.precision)&&(r=t.precision)),i){case"fixed":return exports.toFixed(n,r);case"exponential":return exports.toExponential(n,r);case"engineering":return exports.toEngineering(n,r);case"auto":if(t&&t.exponential&&(void 0!==t.exponential.lower||void 0!==t.exponential.upper)){var o=e.map(t,function(e){return e});return o.exponential=void 0,void 0!==t.exponential.lower&&(o.lowerExp=Math.round(Math.log(t.exponential.lower)/Math.LN10)),void 0!==t.exponential.upper&&(o.upperExp=Math.round(Math.log(t.exponential.upper)/Math.LN10)),console.warn("Deprecation warning: Formatting options exponential.lower and exponential.upper (minimum and maximum value) are replaced with exponential.lowerExp and exponential.upperExp (minimum and maximum exponent) since version 4.0.0. Replace "+JSON.stringify(t)+" with "+JSON.stringify(o)),exports.toPrecision(n,r,o)}return exports.toPrecision(n,r,t&&t).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],n=arguments[4];return"."!==e?e+n:n});default:throw new Error('Unknown notation "'+i+'". Choose "auto", "exponential", or "fixed".')}},exports.splitNumber=function(e){var n=String(e).toLowerCase().match(/^0*?(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!n)throw new SyntaxError("Invalid number "+e);var t=n[1],r=n[2],i=parseFloat(n[4]||"0"),o=r.indexOf(".");i+=-1!==o?o-1:r.length-1;var p=r.replace(".","").replace(/^0*/,function(e){return i-=e.length,""}).replace(/0*$/,"").split("").map(function(e){return parseInt(e)});return 0===p.length&&(p.push(0),i++),{sign:t,coefficients:p,exponent:i}},exports.toEngineering=function(e,n){if(isNaN(e)||!isFinite(e))return String(e);var t=exports.roundDigits(exports.splitNumber(e),n),r=t.exponent,i=t.coefficients,o=r%3==0?r:r<0?r-3-r%3:r-r%3;if(exports.isNumber(n))for(;n>i.length||r-o+1>i.length;)i.push(0);else for(var p=r>=0?r:Math.abs(o);i.length-1<p;)i.push(0);for(var s=Math.abs(r-o),a=1;s>0;)a++,s--;var u=i.slice(a).join(""),l=exports.isNumber(n)&&u.length||u.match(/[1-9]/)?"."+u:"",x=i.slice(0,a).join("")+l+"e"+(r>=0?"+":"")+o.toString();return t.sign+x},exports.toFixed=function(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=exports.splitNumber(e),i="number"==typeof t?exports.roundDigits(r,r.exponent+1+t):r,o=i.coefficients,p=i.exponent+1,s=p+(t||0);return o.length<s&&(o=o.concat(n(s-o.length))),p<0&&(o=n(1-p).concat(o),p=1),p<o.length&&o.splice(p,0,0===p?"0.":"."),i.sign+o.join("")},exports.toExponential=function(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=exports.splitNumber(e),i=t?exports.roundDigits(r,t):r,o=i.coefficients,p=i.exponent;o.length<t&&(o=o.concat(n(t-o.length)));var s=o.shift();return i.sign+s+(o.length>0?"."+o.join(""):"")+"e"+(p>=0?"+":"")+p},exports.toPrecision=function(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);var i=r&&void 0!==r.lowerExp?r.lowerExp:-3,o=r&&void 0!==r.upperExp?r.upperExp:5,p=exports.splitNumber(e);if(p.exponent<i||p.exponent>=o)return exports.toExponential(e,t);var s=t?exports.roundDigits(p,t):p,a=s.coefficients,u=s.exponent;a.length<t&&(a=a.concat(n(t-a.length))),a=a.concat(n(u-a.length+1+(a.length<t?t-a.length:0)));var l=u>0?u:0;return l<(a=n(-u).concat(a)).length-1&&a.splice(l+1,0,"."),s.sign+a.join("")},exports.roundDigits=function(e,n){for(var t={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=t.coefficients;n<=0;)r.unshift(0),t.exponent++,n++;if(r.length>n&&r.splice(n,r.length-n)[0]>=5){var i=n-1;for(r[i]++;10===r[i];)r.pop(),0===i&&(r.unshift(0),t.exponent++,i++),r[--i]++}return t},exports.digits=function(e){return e.toExponential().replace(/e.*$/,""
},{"./object":"FcSp"}],"gfmG":[function(require,module,exports) {
"use strict";module.exports=function(t){return t&&t.constructor.prototype.isMatrix||!1};
},{}],"ybZj":[function(require,module,exports) {
"use strict";function t(n){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(n)}function n(o){return(n="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?function(n){return t(n)}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":t(n)})(o)}var o=require("typed-function"),e=require("./../utils/number").digits,r=require("./../utils/bignumber/isBigNumber"),i=require("./../utils/collection/isMatrix"),s=function(){return s=o.create,o};exports.create=function(t){t.isNumber=function(t){return"number"==typeof t},t.isComplex=function(n){return t.Complex&&n instanceof t.Complex||!1},t.isBigNumber=r,t.isFraction=function(n){return t.Fraction&&n instanceof t.Fraction||!1},t.isUnit=function(t){return t&&t.constructor.prototype.isUnit||!1},t.isString=function(t){return"string"==typeof t},t.isArray=Array.isArray,t.isMatrix=i,t.isDenseMatrix=function(t){return t&&t.isDenseMatrix&&t.constructor.prototype.isMatrix||!1},t.isSparseMatrix=function(t){return t&&t.isSparseMatrix&&t.constructor.prototype.isMatrix||!1},t.isRange=function(t){return t&&t.constructor.prototype.isRange||!1},t.isIndex=function(t){return t&&t.constructor.prototype.isIndex||!1},t.isBoolean=function(t){return"boolean"==typeof t},t.isResultSet=function(t){return t&&t.constructor.prototype.isResultSet||!1},t.isHelp=function(t){return t&&t.constructor.prototype.isHelp||!1},t.isFunction=function(t){return"function"==typeof t},t.isDate=function(t){return t instanceof Date},t.isRegExp=function(t){return t instanceof RegExp},t.isObject=function(o){return"object"===n(o)&&o.constructor===Object&&!t.isComplex(o)&&!t.isFraction(o)},t.isNull=function(t){return null===t},t.isUndefined=function(t){return void 0===t},t.isAccessorNode=function(t){return t&&t.isAccessorNode&&t.constructor.prototype.isNode||!1},t.isArrayNode=function(t){return t&&t.isArrayNode&&t.constructor.prototype.isNode||!1},t.isAssignmentNode=function(t){return t&&t.isAssignmentNode&&t.constructor.prototype.isNode||!1},t.isBlockNode=function(t){return t&&t.isBlockNode&&t.constructor.prototype.isNode||!1},t.isConditionalNode=function(t){return t&&t.isConditionalNode&&t.constructor.prototype.isNode||!1},t.isConstantNode=function(t){return t&&t.isConstantNode&&t.constructor.prototype.isNode||!1},t.isFunctionAssignmentNode=function(t){return t&&t.isFunctionAssignmentNode&&t.constructor.prototype.isNode||!1},t.isFunctionNode=function(t){return t&&t.isFunctionNode&&t.constructor.prototype.isNode||!1},t.isIndexNode=function(t){return t&&t.isIndexNode&&t.constructor.prototype.isNode||!1},t.isNode=function(t){return t&&t.isNode&&t.constructor.prototype.isNode||!1},t.isObjectNode=function(t){return t&&t.isObjectNode&&t.constructor.prototype.isNode||!1},t.isOperatorNode=function(t){return t&&t.isOperatorNode&&t.constructor.prototype.isNode||!1},t.isParenthesisNode=function(t){return t&&t.isParenthesisNode&&t.constructor.prototype.isNode||!1},t.isRangeNode=function(t){return t&&t.isRangeNode&&t.constructor.prototype.isNode||!1},t.isSymbolNode=function(t){return t&&t.isSymbolNode&&t.constructor.prototype.isNode||!1},t.isChain=function(t){return t&&t.constructor.prototype.isChain||!1};var o=s();return o.types=[{name:"number",test:t.isNumber},{name:"Complex",test:t.isComplex},{name:"BigNumber",test:t.isBigNumber},{name:"Fraction",test:t.isFraction},{name:"Unit",test:t.isUnit},{name:"string",test:t.isString},{name:"Array",test:t.isArray},{name:"Matrix",test:t.isMatrix},{name:"DenseMatrix",test:t.isDenseMatrix},{name:"SparseMatrix",test:t.isSparseMatrix},{name:"Range",test:t.isRange},{name:"Index",test:t.isIndex},{name:"boolean",test:t.isBoolean},{name:"ResultSet",test:t.isResultSet},{name:"Help",test:t.isHelp},{name:"function",test:t.isFunction},{name:"Date",test:t.isDate},{name:"RegExp",test:t.isRegExp},{name:"null",test:t.isNull},{name:"undefined",test:t.isUndefined},{name:"OperatorNode",test:t.isOperatorNode},{
},{"typed-function":"Qbfe","./../utils/number":"uqMu","./../utils/bignumber/isBigNumber":"NR2f","./../utils/collection/isMatrix":"gfmG"}],"e2Zi":[function(require,module,exports) {
function t(){}t.prototype={on:function(t,n,e){var i=this.e||(this.e={});return(i[t]||(i[t]=[])).push({fn:n,ctx:e}),this},once:function(t,n,e){var i=this;function o(){i.off(t,o),n.apply(e,arguments)}return o._=n,this.on(t,o,e)},emit:function(t){for(var n=[].slice.call(arguments,1),e=((this.e||(this.e={}))[t]||[]).slice(),i=0,o=e.length;i<o;i++)e[i].fn.apply(e[i].ctx,n);return this},off:function(t,n){var e=this.e||(this.e={}),i=e[t],o=[];if(i&&n)for(var r=0,f=i.length;r<f;r++)i[r].fn!==n&&i[r].fn._!==n&&o.push(i[r]);return o.length?e[t]=o:delete e[t],this}},module.exports=t,module.exports.TinyEmitter=t;
},{}],"GJvY":[function(require,module,exports) {
"use strict";var n=require("tiny-emitter");exports.mixin=function(i){var e=new n;return i.on=e.on.bind(e),i.off=e.off.bind(e),i.once=e.once.bind(e),i.emit=e.emit.bind(e),i};
},{"tiny-emitter":"e2Zi"}],"h0xI":[function(require,module,exports) {
"use strict";function t(r,o,e,n){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");this.fn=r,this.count=o,this.min=e,this.max=n,this.message="Wrong number of arguments in function "+r+" ("+o+" provided, "+e+(null!=n?"-"+n:"")+" expected)",this.stack=(new Error).stack}t.prototype=new Error,t.prototype.constructor=Error,t.prototype.name="ArgumentsError",t.prototype.isArgumentsError=!0,module.exports=t;
},{}],"pvAU":[function(require,module,exports) {
"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(t)}function t(o){return(t="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)})(o)}var o=require("../../utils/object").lazy,e=require("../../utils/object").isFactory,n=require("../../utils/object").traverse,i=require("../../error/ArgumentsError");function s(r,s,a,f,u){function p(r,t,o){if(o.wrap&&"function"==typeof t&&(t=function(r){var t=function(){for(var t=[],o=0,e=arguments.length;o<e;o++){var n=arguments[o];t[o]=n&&n.valueOf()}return r.apply(u,t)};r.transform&&(t.transform=r.transform);return t}(t)),h(u[r])&&h(t))return t=o.override?f(r,t.signatures):f(u[r],t),u[r]=t,m(r,t),void u.emit("import",r,function(){return t});if(void 0===u[r]||o.override)return u[r]=t,m(r,t),void u.emit("import",r,function(){return t});if(!o.silent)throw new Error('Cannot import "'+r+'": already exists')}function m(r,t){t&&"function"==typeof t.transform?(u.expression.transform[r]=t.transform,b(r)&&(u.expression.mathWithTransform[r]=t.transform)):(delete u.expression.transform[r],b(r)&&(u.expression.mathWithTransform[r]=t))}function c(r){delete u.expression.transform[r],b(r)?u.expression.mathWithTransform[r]=u[r]:delete u.expression.mathWithTransform[r]}function y(r,t){if("string"==typeof r.name){var e=r.name,i=e in u.expression.transform,s=r.path?n(u,r.path):u,p=s.hasOwnProperty(e)?s[e]:void 0,m=function(){var o=a(r);if(o&&"function"==typeof o.transform)throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(h(p)&&h(o))return t.override||(o=f(p,o)),o;if(void 0===p||t.override)return o;if(!t.silent)throw new Error('Cannot import "'+e+'": already exists')};!1!==r.lazy?(o(s,e,m),i?c(e):("expression.transform"===r.path||x(r))&&o(u.expression.mathWithTransform,e,m)):(s[e]=m(),i?c(e):("expression.transform"===r.path||x(r))&&(u.expression.mathWithTransform[e]=m())),u.emit("import",e,m,r.path)}else a(r)}function l(t){return"function"==typeof t||"number"==typeof t||"string"==typeof t||"boolean"==typeof t||null===t||t&&r.isUnit(t)||t&&r.isComplex(t)||t&&r.isBigNumber(t)||t&&r.isFraction(t)||t&&r.isMatrix(t)||t&&Array.isArray(t)}function h(r){return"function"==typeof r&&"object"===t(r.signatures)}function b(r){return!v.hasOwnProperty(r)}function x(r){return void 0===r.path&&!v.hasOwnProperty(r.name)}var v={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function r(o,n){var s=arguments.length;if(1!==s&&2!==s)throw new i("import",s,1,2);if(n||(n={}),e(o))y(o,n);else if(Array.isArray(o))o.forEach(function(t){r(t,n)});else if("object"===t(o)){for(var a in o)if(o.hasOwnProperty(a)){var f=o[a];l(f)?p(a,f,n):e(o)?y(o,n):r(f,n)}}else if(!n.silent)throw new TypeError("Factory, Object, or Array expected")}}exports.math=!0,exports.name="import",exports.factory=s,exports.lazy=!0;
},{"../../utils/object":"FcSp","../../error/ArgumentsError":"h0xI"}],"hwiE":[function(require,module,exports) {
"use strict";var n=require("../../utils/object");function o(o,r,e,t,a){var u=["Matrix","Array"],c=["number","BigNumber","Fraction"];function f(o){if(o){var e=n.map(r,n.clone);i(o,"matrix",u),i(o,"number",c),n.deepExtend(r,o);var t=n.map(r,n.clone),f=n.map(o,n.clone);return a.emit("config",t,e,f),t}return n.map(r,n.clone)}return f.MATRIX=u,f.NUMBER=c,f}function r(n,o){return-1!==n.indexOf(o)}function e(n,o){return n.map(function(n){return n.toLowerCase()}).indexOf(o.toLowerCase())}function i(n,o,i){if(void 0!==n[o]&&!r(i,n[o])){var t=e(i,n[o]);-1!==t?(console.warn('Warning: Wrong casing for configuration option "'+o+'", should be "'+i[t]+'" instead of "'+n[o]+'".'),n[o]=i[t]):console.warn('Warning: Unknown value "'+n[o]+'" for configuration option "'+o+'". Available options: '+i.map(JSON.stringify).join(", ")+".")}}exports.name="config",exports.math=!0,exports.factory=o;
},{"../../utils/object":"FcSp"}],"MP6P":[function(require,module,exports) {
"use strict";require("./../utils/polyfills");var e=require("./../utils/object").isFactory,r=require("./typed"),t=require("./../utils/emitter"),i=require("./function/import"),o=require("./function/config");exports.create=function(n){if("function"!=typeof Object.create)throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var a=[],p=[],c=t.mixin({});c.type={},c.expression={transform:{},mathWithTransform:{}},c.typed=r.create(c.type);var s={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function u(r){if(!e(r))throw new Error("Factory object with properties `type`, `name`, and `factory` expected");var t,i=a.indexOf(r);return-1===i?(t=!0===r.math?r.factory(c.type,s,u,c.typed,c):r.factory(c.type,s,u,c.typed),a.push(r),p.push(t)):t=p[i],t}return c.import=u(i),c.config=u(o),c.expression.mathWithTransform.config=c.config,n&&c.config(n),c};
},{"./../utils/polyfills":"zHU1","./../utils/object":"FcSp","./typed":"ybZj","./../utils/emitter":"GJvY","./function/import":"pvAU","./function/config":"hwiE"}],"c8f9":[function(require,module,exports) {
var define;
var n;!function(e){"use strict";var i,t,r,s,o=9e15,u=1e9,c="0123456789abcdef",f="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",a="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",h={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-o,maxE:o,crypto:!1},l=!0,d="[DecimalError] ",p=d+"Invalid argument: ",g=d+"Precision limit exceeded",m=d+"crypto unavailable",w=Math.floor,v=Math.pow,N=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,b=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,E=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,x=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,y=1e7,M=7,q=f.length-1,O=a.length-1,D={name:"[object Decimal]"};function F(n){var e,i,t,r=n.length-1,s="",o=n[0];if(r>0){for(s+=o,e=1;e<r;e++)t=n[e]+"",(i=M-t.length)&&(s+=C(i)),s+=t;o=n[e],(i=M-(t=o+"").length)&&(s+=C(i))}else if(0===o)return"0";for(;o%10==0;)o/=10;return s+o}function A(n,e,i){if(n!==~~n||n<e||n>i)throw Error(p+n)}function S(n,e,i,t){var r,s,o,u;for(s=n[0];s>=10;s/=10)--e;return--e<0?(e+=M,r=0):(r=Math.ceil((e+1)/M),e%=M),s=v(10,M-e),u=n[r]%s|0,null==t?e<3?(0==e?u=u/100|0:1==e&&(u=u/10|0),o=i<4&&99999==u||i>3&&49999==u||5e4==u||0==u):o=(i<4&&u+1==s||i>3&&u+1==s/2)&&(n[r+1]/s/100|0)==v(10,e-2)-1||(u==s/2||0==u)&&0==(n[r+1]/s/100|0):e<4?(0==e?u=u/1e3|0:1==e?u=u/100|0:2==e&&(u=u/10|0),o=(t||i<4)&&9999==u||!t&&i>3&&4999==u):o=((t||i<4)&&u+1==s||!t&&i>3&&u+1==s/2)&&(n[r+1]/s/1e3|0)==v(10,e-3)-1,o}function Z(n,e,i){for(var t,r,s=[0],o=0,u=n.length;o<u;){for(r=s.length;r--;)s[r]*=e;for(s[0]+=c.indexOf(n.charAt(o++)),t=0;t<s.length;t++)s[t]>i-1&&(void 0===s[t+1]&&(s[t+1]=0),s[t+1]+=s[t]/i|0,s[t]%=i)}return s.reverse()}D.absoluteValue=D.abs=function(){var n=new this.constructor(this);return n.s<0&&(n.s=1),R(n)},D.ceil=function(){return R(new this.constructor(this),this.e+1,2)},D.comparedTo=D.cmp=function(n){var e,i,t,r,s=this,o=s.d,u=(n=new s.constructor(n)).d,c=s.s,f=n.s;if(!o||!u)return c&&f?c!==f?c:o===u?0:!o^c<0?1:-1:NaN;if(!o[0]||!u[0])return o[0]?c:u[0]?-f:0;if(c!==f)return c;if(s.e!==n.e)return s.e>n.e^c<0?1:-1;for(e=0,i=(t=o.length)<(r=u.length)?t:r;e<i;++e)if(o[e]!==u[e])return o[e]>u[e]^c<0?1:-1;retu
},{}],"dbYS":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.factory=t,exports.math=exports.path=exports.name=void 0;var e=r(require("decimal.js"));function r(e){return e&&e.__esModule?e:{default:e}}function t(r,t,o,i,n){var p=e.default.clone({precision:t.precision});return p.prototype.type="BigNumber",p.prototype.isBigNumber=!0,p.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},p.fromJSON=function(e){return new p(e.value)},n.on("config",function(e,r){e.precision!==r.precision&&p.config({precision:e.precision})}),p}var o="BigNumber";exports.name=o;var i="type";exports.path=i;var n=!0;exports.math=n;
},{"decimal.js":"c8f9"}],"lOYo":[function(require,module,exports) {
"use strict";module.exports=function t(n,u,e){return n&&"function"==typeof n.map?n.map(function(n){return t(n,u,e)}):u(n)};
},{}],"ejiJ":[function(require,module,exports) {
"use strict";var r=require("../../../utils/collection/deepMap");function n(n,e,t,u){var i=u("bignumber",{"":function(){return new n.BigNumber(0)},number:function(r){return new n.BigNumber(r+"")},string:function(r){return new n.BigNumber(r)},BigNumber:function(r){return r},Fraction:function(r){return new n.BigNumber(r.n).div(r.d).times(r.s)},null:function(r){return new n.BigNumber(0)},"Array | Matrix":function(n){return r(n,i)}});return i.toTex={0:"0",1:"\\left(${args[0]}\\right)"},i}exports.name="bignumber",exports.factory=n;
},{"../../../utils/collection/deepMap":"lOYo"}],"glkd":[function(require,module,exports) {
"use strict";module.exports=[require("./BigNumber"),require("./function/bignumber")];
},{"./BigNumber":"dbYS","./function/bignumber":"ejiJ"}],"ff5w":[function(require,module,exports) {
"use strict";var r=require("./../utils/collection/deepMap");function n(n,t,e,o){var u=o("bool",{"":function(){return!1},boolean:function(r){return r},number:function(r){return!!r},null:function(r){return!1},BigNumber:function(r){return!r.isZero()},string:function(r){var n=r.toLowerCase();if("true"===n)return!0;if("false"===n)return!1;var t=Number(r);if(""!==r&&!isNaN(t))return!!t;throw new Error('Cannot convert "'+r+'" to a boolean')},"Array | Matrix":function(n){return r(n,u)}});return u}exports.name="boolean",exports.factory=n;
},{"./../utils/collection/deepMap":"lOYo"}],"bm1W":[function(require,module,exports) {
"use strict";var e=require("../object");exports.format=function(n,t){if("function"==typeof t)return t(n);if(!n.isFinite())return n.isNaN()?"NaN":n.gt(0)?"Infinity":"-Infinity";var o,i="auto";switch(void 0!==t&&(t.notation&&(i=t.notation),"number"==typeof t?o=t:t.precision&&(o=t.precision)),i){case"fixed":return exports.toFixed(n,o);case"exponential":return exports.toExponential(n,o);case"engineering":return exports.toEngineering(n,o);case"auto":if(t&&t.exponential&&(void 0!==t.exponential.lower||void 0!==t.exponential.upper)){var r=e.map(t,function(e){return e});return r.exponential=void 0,void 0!==t.exponential.lower&&(r.lowerExp=Math.round(Math.log(t.exponential.lower)/Math.LN10)),void 0!==t.exponential.upper&&(r.upperExp=Math.round(Math.log(t.exponential.upper)/Math.LN10)),console.warn("Deprecation warning: Formatting options exponential.lower and exponential.upper (minimum and maximum value) are replaced with exponential.lowerExp and exponential.upperExp (minimum and maximum exponent) since version 4.0.0. Replace "+JSON.stringify(t)+" with "+JSON.stringify(r)),exports.format(n,r)}var a=t&&void 0!==t.lowerExp?t.lowerExp:-3,p=t&&void 0!==t.upperExp?t.upperExp:5;if(n.isZero())return"0";var x=n.e;return(x>=a&&x<p?n.toSignificantDigits(o).toFixed():exports.toExponential(n,o)).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],n=arguments[4];return"."!==e?e+n:n});default:throw new Error('Unknown notation "'+i+'". Choose "auto", "exponential", or "fixed".')}},exports.toEngineering=function(e,n){var t=e.e,o=t%3==0?t:t<0?t-3-t%3:t-t%3,i=e.mul(Math.pow(10,-o)),r=i.toPrecision(n);return-1!==r.indexOf("e")&&(r=i.toString()),r+"e"+(t>=0?"+":"")+o.toString()},exports.toExponential=function(e,n){return void 0!==n?e.toExponential(n-1):e.toExponential()},exports.toFixed=function(e,n){return e.toFixed(n)};
},{"../object":"FcSp"}],"PshC":[function(require,module,exports) {
"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(t)}function t(n){return(t="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)})(n)}var n=require("./number").format,e=require("./bignumber/formatter").format,o=require("./bignumber/isBigNumber");function i(r,t){if(Array.isArray(r)){for(var n="[",e=r.length,o=0;o<e;o++)0!==o&&(n+=", "),n+=i(r[o],t);return n+="]"}return exports.format(r,t)}function u(r){return r&&"object"===t(r)&&"number"==typeof r.s&&"number"==typeof r.n&&"number"==typeof r.d||!1}exports.isString=function(r){return"string"==typeof r},exports.endsWith=function(r,t){var n=r.length-t.length,e=r.length;return r.substring(n,e)===t},exports.format=function(r,f){if("number"==typeof r)return n(r,f);if(o(r))return e(r,f);if(u(r))return f&&"decimal"===f.fraction?r.toString():r.s*r.n+"/"+r.d;if(Array.isArray(r))return i(r,f);if(exports.isString(r))return'"'+r+'"';if("function"==typeof r)return r.syntax?String(r.syntax):"function";if(r&&"object"===t(r)){if("function"==typeof r.format)return r.format(f);if(r&&r.toString()!=={}.toString())return r.toString();var y=[];for(var c in r)r.hasOwnProperty(c)&&y.push('"'+c+'": '+exports.format(r[c],f));return"{"+y.join(", ")+"}"}return String(r)},exports.stringify=function(r){for(var t=String(r),n="",e=0;e<t.length;){var o=t.charAt(e);"\\"===o?(n+=o,e++,""!==(o=t.charAt(e))&&-1!=='"\\/bfnrtu'.indexOf(o)||(n+="\\"),n+=o):n+='"'===o?'\\"':o,e++}return'"'+n+'"'},exports.escape=function(r){var t=String(r);return t=t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")};
},{"./number":"uqMu","./bignumber/formatter":"bm1W","./bignumber/isBigNumber":"NR2f"}],"Dlkx":[function(require,module,exports) {
"use strict";var t=require("../../utils/string").format,e=require("../../utils/object").lazy;function n(n,r,o,i,u){function a(t){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");n.isChain(t)?this.value=t.value:this.value=t}function p(t,e){"function"==typeof e&&(a.prototype[t]=f(e))}function f(t){return function(){for(var e=[this.value],n=0;n<arguments.length;n++)e[n+1]=arguments[n];return new a(t.apply(t,e))}}return a.prototype.type="Chain",a.prototype.isChain=!0,a.prototype.done=function(){return this.value},a.prototype.valueOf=function(){return this.value},a.prototype.toString=function(){return t(this.value)},a.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},a.fromJSON=function(t){return new a(t.value)},a.createProxy=function(t,e){if("string"==typeof t)p(t,e);else for(var n in t)t.hasOwnProperty(n)&&p(n,t[n])},a.createProxy(u),u.on("import",function(t,n,r){void 0===r&&function(t,n){e(a.prototype,t,function(){var t=n();if("function"==typeof t)return f(t)})}(t,n)}),a}exports.name="Chain",exports.path="type",exports.factory=n,exports.math=!0,exports.lazy=!1;
},{"../../utils/string":"PshC","../../utils/object":"FcSp"}],"LxM2":[function(require,module,exports) {
"use strict";function n(n,t,r,e){return e("chain",{"":function(){return new n.Chain},any:function(t){return new n.Chain(t)}})}exports.name="chain",exports.factory=n;
},{}],"YdmQ":[function(require,module,exports) {
"use strict";module.exports=[require("./Chain"),require("./function/chain")];
},{"./Chain":"Dlkx","./function/chain":"LxM2"}],"LEuu":[function(require,module,exports) {
var define;
var i;!function(t){"use strict";var n=function(i){return.5*(Math.exp(i)+Math.exp(-i))},e=function(i){return.5*(Math.exp(i)-Math.exp(-i))},r=function(){throw SyntaxError("Invalid Param")};function s(i,t){var n=Math.abs(i),e=Math.abs(t);return 0===i?Math.log(e):0===t?Math.log(n):n<3e3&&e<3e3?.5*Math.log(i*i+t*t):Math.log(i/Math.cos(Math.atan2(t,i)))}var a=function(i,t){var n={re:0,im:0};if(null==i)n.re=n.im=0;else if(void 0!==t)n.re=i,n.im=t;else switch(typeof i){case"object":if("im"in i&&"re"in i)n.re=i.re,n.im=i.im;else if("abs"in i&&"arg"in i){if(!Number.isFinite(i.abs)&&Number.isFinite(i.arg))return h.INFINITY;n.re=i.abs*Math.cos(i.arg),n.im=i.abs*Math.sin(i.arg)}else if("r"in i&&"phi"in i){if(!Number.isFinite(i.r)&&Number.isFinite(i.phi))return h.INFINITY;n.re=i.r*Math.cos(i.phi),n.im=i.r*Math.sin(i.phi)}else 2===i.length?(n.re=i[0],n.im=i[1]):r();break;case"string":n.im=n.re=0;var e=i.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),s=1,a=0;null===e&&r();for(var u=0;u<e.length;u++){var o=e[u];" "===o||"\t"===o||"\n"===o||("+"===o?s++:"-"===o?a++:"i"===o||"I"===o?(s+a===0&&r()," "===e[u+1]||isNaN(e[u+1])?n.im+=parseFloat((a%2?"-":"")+"1"):(n.im+=parseFloat((a%2?"-":"")+e[u+1]),u++),s=a=0):((s+a===0||isNaN(o))&&r(),"i"===e[u+1]||"I"===e[u+1]?(n.im+=parseFloat((a%2?"-":"")+o),u++):n.re+=parseFloat((a%2?"-":"")+o),s=a=0))}s+a>0&&r();break;case"number":n.im=0,n.re=i;break;default:r()}return isNaN(n.re)||isNaN(n.im),n};function h(i,t){if(!(this instanceof h))return new h(i,t);var n=a(i,t);this.re=n.re,this.im=n.im}h.prototype={re:0,im:0,sign:function(){var i=this.abs();return new h(this.re/i,this.im/i)},add:function(i,t){var n=new h(i,t);return this.isInfinite()&&n.isInfinite()?h.NAN:this.isInfinite()||n.isInfinite()?h.INFINITY:new h(this.re+n.re,this.im+n.im)},sub:function(i,t){var n=new h(i,t);return this.isInfinite()&&n.isInfinite()?h.NAN:this.isInfinite()||n.isInfinite()?h.INFINITY:new h(this.re-n.re,this.im-n.im)},mul:function(i,t){var n=new h(i,t);return this.isInfinite()&&n.isZero()||this.isZero()&&n.isInfinite()?h.NAN:this.isInfinite()||n.isInfinite()?h.INFINITY:0===n.im&&0===this.im?new h(this.re*n.re,0):new h(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(i,t){var n=new h(i,t);if(this.isZero()&&n.isZero()||this.isInfinite()&&n.isInfinite())return h.NAN;if(this.isInfinite()||n.isZero())return h.INFINITY;if(this.isZero()||n.isInfinite())return h.ZERO;i=this.re,t=this.im;var e,r,s=n.re,a=n.im;return 0===a?new h(i/s,t/s):Math.abs(s)<Math.abs(a)?new h((i*(r=s/a)+t)/(e=s*r+a),(t*r-i)/e):new h((i+t*(r=a/s))/(e=a*r+s),(t-i*r)/e)},pow:function(i,t){var n=new h(i,t);if(i=this.re,t=this.im,n.isZero())return h.ONE;if(0===n.im){if(0===t&&i>=0)return new h(Math.pow(i,n.re),0);if(0===i)switch((n.re%4+4)%4){case 0:return new h(Math.pow(t,n.re),0);case 1:return new h(0,Math.pow(t,n.re));case 2:return new h(-Math.pow(t,n.re),0);case 3:return new h(0,-Math.pow(t,n.re))}}if(0===i&&0===t&&n.re>0&&n.im>=0)return h.ZERO;var e=Math.atan2(t,i),r=s(i,t);return i=Math.exp(n.re*r-n.im*e),t=n.im*r+n.re*e,new h(i*Math.cos(t),i*Math.sin(t))},sqrt:function(){var i,t,n=this.re,e=this.im,r=this.abs();if(n>=0){if(0===e)return new h(Math.sqrt(n),0);i=.5*Math.sqrt(2*(r+n))}else i=Math.abs(e)/Math.sqrt(2*(r-n));return t=n<=0?.5*Math.sqrt(2*(r-n)):Math.abs(e)/Math.sqrt(2*(r+n)),new h(i,e<0?-t:t)},exp:function(){var i=Math.exp(this.re);return this.im,new h(i*Math.cos(this.im),i*Math.sin(this.im))},expm1:function(){var i=this.re,t=this.im;return new h(Math.expm1(i)*Math.cos(t)+function(i){var t=Math.PI/4;if(i<-t||i>t)return Math.cos(i)-1;var n=i*i;return n*(n*(1/24+n*(-1/720+n*(1/40320+n*(-1/3628800+n*(1/4790014600+n*(-1/87178291200+n*(1/20922789888e3)))))))-.5)}(t),Math.exp(i)*Math.sin(t))},log:function(){var i=this.re,t=this.im;return new h(s(i,t),Math.atan2(t,i))},abs:function(){return i=this.re,t=this.im,n=Math.abs(i),e=Math.abs(t),n<3e3&&e<3e3?Math.sqrt(n*n+e*e):(n<e?(n=e,e=i/t):e=t/i,n*Math.sqrt(1+e*e));var i,t,n,e},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var i=this.re,t=this.im;return new h(Math.sin(i)
},{}],"dh9O":[function(require,module,exports) {
"use strict";function t(r){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(r)}function r(o){return(r="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?function(r){return t(r)}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":t(r)})(o)}var o=require("complex.js"),e=require("../../utils/number").format,n=require("../../utils/number").isNumber;function i(t,i,u,p,s){return o.prototype.type="Complex",o.prototype.isComplex=!0,o.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},o.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},o.prototype.format=function(t){var r=this.im,o=this.re,i=e(this.re,t),u=e(this.im,t),p=n(t)?t:t?t.precision:null;if(null!==p){var s=Math.pow(10,-p);Math.abs(o/r)<s&&(o=0),Math.abs(r/o)<s&&(r=0)}return 0===r?i:0===o?1===r?"i":-1===r?"-i":u+"i":r<0?-1===r?i+" - i":i+" - "+u.substring(1)+"i":1===r?i+" + i":i+" + "+u+"i"},o.fromPolar=function(e){switch(arguments.length){case 1:var i=arguments[0];if("object"===r(i))return o(i);throw new TypeError("Input has to be an object with r and phi keys.");case 2:var u=arguments[0],p=arguments[1];if(n(u)){if(t.isUnit(p)&&p.hasBase("ANGLE")&&(p=p.toNumber("rad")),n(p))return new o({r:u,phi:p});throw new TypeError("Phi is not a number nor an angle unit.")}throw new TypeError("Radius r is not a number.");default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},o.prototype.valueOf=o.prototype.toString,o.fromJSON=function(t){return new o(t)},o.EPSILON=i.epsilon,s.on("config",function(t,r){t.epsilon!==r.epsilon&&(o.EPSILON=t.epsilon)}),o.compare=function(t,r){return t.re>r.re?1:t.re<r.re?-1:t.im>r.im?1:t.im<r.im?-1:0},o}exports.name="Complex",exports.path="type",exports.factory=i,exports.math=!0;
},{"complex.js":"LEuu","../../utils/number":"uqMu"}],"gC7Z":[function(require,module,exports) {
"use strict";var e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},n={"":"\\--","—":"\\---"," ":"~","\t":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},r=function(t,n){return e({},t,n)};module.exports=function(i){for(var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=c.preserveFormatting,a=void 0!==l&&l,o=c.escapeMapFn,s=void 0===o?r:o,u=String(i),g="",h=s(e({},t),a?e({},n):{}),v=Object.keys(h),f=function(){var e=!1;v.forEach(function(t,n){e||u.length>=t.length&&u.slice(0,t.length)===t&&(g+=h[v[n]],u=u.slice(t.length,u.length),e=!0)}),e||(g+=u.slice(0,1),u=u.slice(1,u.length))};u;)f();return g};
},{}],"H1Mr":[function(require,module,exports) {
"use strict";var a=require("escape-latex");exports.symbols={Alpha:"A",alpha:"\\alpha",Beta:"B",beta:"\\beta",Gamma:"\\Gamma",gamma:"\\gamma",Delta:"\\Delta",delta:"\\delta",Epsilon:"E",epsilon:"\\epsilon",varepsilon:"\\varepsilon",Zeta:"Z",zeta:"\\zeta",Eta:"H",eta:"\\eta",Theta:"\\Theta",theta:"\\theta",vartheta:"\\vartheta",Iota:"I",iota:"\\iota",Kappa:"K",kappa:"\\kappa",varkappa:"\\varkappa",Lambda:"\\Lambda",lambda:"\\lambda",Mu:"M",mu:"\\mu",Nu:"N",nu:"\\nu",Xi:"\\Xi",xi:"\\xi",Omicron:"O",omicron:"o",Pi:"\\Pi",pi:"\\pi",varpi:"\\varpi",Rho:"P",rho:"\\rho",varrho:"\\varrho",Sigma:"\\Sigma",sigma:"\\sigma",varsigma:"\\varsigma",Tau:"T",tau:"\\tau",Upsilon:"\\Upsilon",upsilon:"\\upsilon",Phi:"\\Phi",phi:"\\phi",varphi:"\\varphi",Chi:"X",chi:"\\chi",Psi:"\\Psi",psi:"\\psi",Omega:"\\Omega",omega:"\\omega",true:"\\mathrm{True}",false:"\\mathrm{False}",i:"i",inf:"\\infty",Inf:"\\infty",infinity:"\\infty",Infinity:"\\infty",oo:"\\infty",lim:"\\lim",undefined:"\\mathbf{?}"},exports.operators={transpose:"^\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\~",not:"\\neg",multiply:"\\cdot",divide:"\\frac",dotMultiply:".\\cdot",dotDivide:".:",mod:"\\mod",add:"+",subtract:"-",to:"\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},exports.defaultTemplate="\\mathrm{${name}}\\left(${args}\\right)";var t={deg:"^\\circ"};exports.escape=function(t){return a(t,{preserveFormatting:!0})},exports.toSymbol=function(a,e){return(e=void 0!==e&&e)?t.hasOwnProperty(a)?t[a]:"\\mathrm{"+exports.escape(a)+"}":exports.symbols.hasOwnProperty(a)?exports.symbols[a]:exports.escape(a)};
},{"escape-latex":"gC7Z"}],"V5uf":[function(require,module,exports) {
"use strict";var r=require("../../../utils/collection/deepMap");function e(e,n,t,i){var o=require("../../../utils/latex"),u=i("complex",{"":function(){return e.Complex.ZERO},number:function(r){return new e.Complex(r,0)},"number, number":function(r,n){return new e.Complex(r,n)},"BigNumber, BigNumber":function(r,n){return new e.Complex(r.toNumber(),n.toNumber())},Complex:function(r){return r.clone()},string:function(r){return e.Complex(r)},null:function(r){return e.Complex(0)},Object:function(r){if("re"in r&&"im"in r)return new e.Complex(r.re,r.im);if("r"in r&&"phi"in r||"abs"in r&&"arg"in r)return new e.Complex(r);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":function(e){return r(e,u)}});return u.toTex={0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(o.symbols.i,"\\cdot\\left(${args[1]}\\right)\\right)")},u}exports.name="complex",exports.factory=e;
},{"../../../utils/collection/deepMap":"lOYo","../../../utils/latex":"H1Mr"}],"Oad0":[function(require,module,exports) {
"use strict";module.exports=[require("./Complex"),require("./function/complex")];
},{"./Complex":"dh9O","./function/complex":"V5uf"}],"TToH":[function(require,module,exports) {
var define;
var t;!function(n){"use strict";var i=2e3,s={s:1,n:0,d:1};function r(t){function n(){var n=Error.apply(this,arguments);n.name=this.name=t,this.stack=n.stack,this.message=n.message}function i(){}return i.prototype=Error.prototype,n.prototype=new i,n}var e=d.DivisionByZero=r("DivisionByZero"),h=d.InvalidParameter=r("InvalidParameter");function o(t,n){return isNaN(t=parseInt(t,10))&&a(),t*n}function a(){throw new h}var u=function(t,n){var i,r=0,h=1,u=1,f=0,d=0,c=0,N=1,l=1,w=0,p=1,v=1,M=1,b=1e7;if(null==t);else if(void 0!==n)u=(r=t)*(h=n);else switch(typeof t){case"object":"d"in t&&"n"in t?(r=t.n,h=t.d,"s"in t&&(r*=t.s)):0 in t?(r=t[0],1 in t&&(h=t[1])):a(),u=r*h;break;case"number":if(t<0&&(u=t,t=-t),t%1==0)r=t;else if(t>0){for(t>=1&&(t/=l=Math.pow(10,Math.floor(1+Math.log(t)/Math.LN10)));p<=b&&M<=b;){if(t===(i=(w+v)/(p+M))){p+M<=b?(r=w+v,h=p+M):M>p?(r=v,h=M):(r=w,h=p);break}t>i?(w+=v,p+=M):(v+=w,M+=p),p>b?(r=v,h=M):(r=w,h=p)}r*=l}else(isNaN(t)||isNaN(n))&&(h=r=NaN);break;case"string":if(null===(p=t.match(/\d+|./g))&&a(),"-"===p[w]?(u=-1,w++):"+"===p[w]&&w++,p.length===w+1?d=o(p[w++],u):"."===p[w+1]||"."===p[w]?("."!==p[w]&&(f=o(p[w++],u)),(++w+1===p.length||"("===p[w+1]&&")"===p[w+3]||"'"===p[w+1]&&"'"===p[w+3])&&(d=o(p[w],u),N=Math.pow(10,p[w].length),w++),("("===p[w]&&")"===p[w+2]||"'"===p[w]&&"'"===p[w+2])&&(c=o(p[w+1],u),l=Math.pow(10,p[w+1].length)-1,w+=3)):"/"===p[w+1]||":"===p[w+1]?(d=o(p[w],u),N=o(p[w+2],1),w+=3):"/"===p[w+3]&&" "===p[w+1]&&(f=o(p[w],u),d=o(p[w+2],u),N=o(p[w+4],1),w+=5),p.length<=w){u=r=c+(h=N*l)*f+l*d;break}default:a()}if(0===h)throw new e;s.s=u<0?-1:1,s.n=Math.abs(r),s.d=Math.abs(h)};function f(t,n){if(!t)return n;if(!n)return t;for(;;){if(!(t%=n))return n;if(!(n%=t))return t}}function d(t,n){if(!(this instanceof d))return new d(t,n);u(t,n),t=d.REDUCE?f(s.d,s.n):1,this.s=s.s,this.n=s.n/t,this.d=s.d/t}d.REDUCE=1,d.prototype={s:1,n:0,d:1,abs:function(){return new d(this.n,this.d)},neg:function(){return new d(-this.s*this.n,this.d)},add:function(t,n){return u(t,n),new d(this.s*this.n*s.d+s.s*this.d*s.n,this.d*s.d)},sub:function(t,n){return u(t,n),new d(this.s*this.n*s.d-s.s*this.d*s.n,this.d*s.d)},mul:function(t,n){return u(t,n),new d(this.s*s.s*this.n*s.n,this.d*s.d)},div:function(t,n){return u(t,n),new d(this.s*s.s*this.n*s.d,this.d*s.n)},clone:function(){return new d(this)},mod:function(t,n){return isNaN(this.n)||isNaN(this.d)?new d(NaN):void 0===t?new d(this.s*this.n%this.d,1):(u(t,n),0===s.n&&0===this.d&&d(0,0),new d(this.s*(s.d*this.n)%(s.n*this.d),s.d*this.d))},gcd:function(t,n){return u(t,n),new d(f(s.n,this.n)*f(s.d,this.d),s.d*this.d)},lcm:function(t,n){return u(t,n),0===s.n&&0===this.n?new d:new d(s.n*this.n,f(s.n,this.n)*f(s.d,this.d))},ceil:function(t){return t=Math.pow(10,t||0),isNaN(this.n)||isNaN(this.d)?new d(NaN):new d(Math.ceil(t*this.s*this.n/this.d),t)},floor:function(t){return t=Math.pow(10,t||0),isNaN(this.n)||isNaN(this.d)?new d(NaN):new d(Math.floor(t*this.s*this.n/this.d),t)},round:function(t){return t=Math.pow(10,t||0),isNaN(this.n)||isNaN(this.d)?new d(NaN):new d(Math.round(t*this.s*this.n/this.d),t)},inverse:function(){return new d(this.s*this.d,this.n)},pow:function(t){return t<0?new d(Math.pow(this.s*this.d,-t),Math.pow(this.n,-t)):new d(Math.pow(this.s*this.n,t),Math.pow(this.d,t))},equals:function(t,n){return u(t,n),this.s*this.n*s.d==s.s*s.n*this.d},compare:function(t,n){u(t,n);var i=this.s*this.n*s.d-s.s*s.n*this.d;return(0<i)-(i<0)},simplify:function(t){if(isNaN(this.n)||isNaN(this.d))return this;var n=this.abs().toContinued();function i(t){return 1===t.length?new d(t[0]):i(t.slice(1)).inverse().add(t[0])}t=t||.001;for(var s=0;s<n.length;s++){var r=i(n.slice(0,s+1));if(r.sub(this.abs()).abs().valueOf()<t)return r.mul(this.s)}return this},divisible:function(t,n){return u(t,n),!(!(s.n*this.d)||this.n*s.d%(s.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(t){var n,i="",s=this.n,r=this.d;return this.s<0&&(i+="-"),1===r?i+=s:(t&&(n=Math.floor(s/r))>0&&(i+=n,i+=" ",s%=r),i+=s,i+="/",i+=r),i},toLatex:function(t){var n,i="",s=this.n,r=this.
},{}],"ibo9":[function(require,module,exports) {
"use strict";var t=require("fraction.js");function r(r,o,n,e){return t}t.prototype.type="Fraction",t.prototype.isFraction=!0,t.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},t.fromJSON=function(r){return new t(r)},exports.name="Fraction",exports.path="type",exports.factory=r;
},{"fraction.js":"TToH"}],"CouR":[function(require,module,exports) {
"use strict";var n=require("../../../utils/collection/deepMap");function r(r,t,e,i){var o=i("fraction",{number:function(n){if(!isFinite(n)||isNaN(n))throw new Error(n+" cannot be represented as a fraction");return new r.Fraction(n)},string:function(n){return new r.Fraction(n)},"number, number":function(n,t){return new r.Fraction(n,t)},null:function(n){return new r.Fraction(0)},BigNumber:function(n){return new r.Fraction(n.toString())},Fraction:function(n){return n},Object:function(n){return new r.Fraction(n)},"Array | Matrix":function(r){return n(r,o)}});return o}exports.name="fraction",exports.factory=r;
},{"../../../utils/collection/deepMap":"lOYo"}],"sfyz":[function(require,module,exports) {
"use strict";module.exports=[require("./Fraction"),require("./function/fraction")];
},{"./Fraction":"ibo9","./function/fraction":"CouR"}],"YiAw":[function(require,module,exports) {
"use strict";function r(t,o,e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this.actual=t,this.expected=o,this.relation=e,this.message="Dimension mismatch ("+(Array.isArray(t)?"["+t.join(", ")+"]":t)+" "+(this.relation||"!=")+" "+(Array.isArray(o)?"["+o.join(", ")+"]":o)+")",this.stack=(new Error).stack}r.prototype=new RangeError,r.prototype.constructor=RangeError,r.prototype.name="DimensionError",r.prototype.isDimensionError=!0,module.exports=r;
},{}],"tfOV":[function(require,module,exports) {
"use strict";function t(e,i,s){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=i):(this.min=i,this.max=s),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}t.prototype=new RangeError,t.prototype.constructor=RangeError,t.prototype.name="IndexError",t.prototype.isIndexError=!0,module.exports=t;
},{}],"j2lF":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.size=i,exports.validate=f,exports.validateIndex=u,exports.resize=l,exports.reshape=h,exports.squeeze=p,exports.unsqueeze=A,exports.flatten=d,exports.map=v,exports.forEach=w,exports.filter=x,exports.filterRegExp=E,exports.join=m,exports.identify=z,exports.generalize=b;var r=o(require("./number")),e=o(require("./string")),t=o(require("../error/DimensionError")),n=o(require("../error/IndexError"));function o(r){return r&&r.__esModule?r:{default:r}}function i(r){for(var e=[];Array.isArray(r);)e.push(r.length),r=r[0];return e}function a(r,e,n){var o,i=r.length;if(i!==e[n])throw new t.default(i,e[n]);if(n<e.length-1){var f=n+1;for(o=0;o<i;o++){var u=r[o];if(!Array.isArray(u))throw new t.default(e.length-1,e.length,"<");a(r[o],e,f)}}else for(o=0;o<i;o++)if(Array.isArray(r[o]))throw new t.default(e.length+1,e.length,">")}function f(r,e){if(0===e.length){if(Array.isArray(r))throw new t.default(r.length,0)}else a(r,e,0)}function u(e,t){if(!r.default.isNumber(e)||!r.default.isInteger(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new n.default(e,t)}function l(t,n,o){if(!Array.isArray(t)||!Array.isArray(n))throw new TypeError("Array expected");if(0===n.length)throw new Error("Resizing to scalar is not supported");return n.forEach(function(t){if(!r.default.isNumber(t)||!r.default.isInteger(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+e.default.format(n)+")")}),s(t,n,0,void 0!==o?o:0),t}function s(r,e,t,n){var o,i,a=r.length,f=e[t],u=Math.min(a,f);if(r.length=f,t<e.length-1){var l=t+1;for(o=0;o<u;o++)i=r[o],Array.isArray(i)||(i=[i],r[o]=i),s(i,e,l,n);for(o=u;o<f;o++)i=[],r[o]=i,s(i,e,l,n)}else{for(o=0;o<u;o++)for(;Array.isArray(r[o]);)r[o]=r[o][0];for(o=u;o<f;o++)r[o]=n}}function h(r,e){var n,o=d(r);function a(r){return r.reduce(function(r,e){return r*e})}if(!Array.isArray(r)||!Array.isArray(e))throw new TypeError("Array expected");if(0===e.length)throw new t.default(0,a(i(r)),"!=");for(var f=1,u=0;u<e.length;u++)f*=e[u];if(o.length!==f)throw new t.default(a(e),a(i(r)),"!=");try{n=y(o,e)}catch(l){if(l instanceof t.default)throw new t.default(a(e),a(i(r)),"!=");throw l}return n}function y(r,e){for(var t,n=r,o=e.length-1;o>0;o--){var i=e[o];t=[];for(var a=n.length/i,f=0;f<a;f++)t.push(n.slice(f*i,(f+1)*i));n=t}return n}function p(r,e){for(var t=e||i(r);Array.isArray(r)&&1===r.length;)r=r[0],t.shift();for(var n=t.length;1===t[n-1];)n--;return n<t.length&&(r=c(r,n,0),t.length=n),r}function c(r,e,t){var n,o;if(t<e){var i=t+1;for(n=0,o=r.length;n<o;n++)r[n]=c(r[n],e,i)}else for(;Array.isArray(r);)r=r[0];return r}function A(r,e,t,n){var o=n||i(r);if(t)for(var a=0;a<t;a++)r=[r],o.unshift(1);for(r=g(r,e,0);o.length<e;)o.push(1);return r}function g(r,e,t){var n,o;if(Array.isArray(r)){var i=t+1;for(n=0,o=r.length;n<o;n++)r[n]=g(r[n],e,i)}else for(var a=t;a<e;a++)r=[r];return r}function d(r){if(!Array.isArray(r))return r;var e=[];return r.forEach(function r(t){Array.isArray(t)?t.forEach(r):e.push(t)}),e}function v(r,e){return Array.prototype.map.call(r,e)}function w(r,e){Array.prototype.forEach.call(r,e)}function x(r,e){if(1!==i(r).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(r,e)}function E(r,e){if(1!==i(r).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(r,function(r){return e.test(r)})}function m(r,e){return Array.prototype.join.call(r,e)}function z(r){if(!Array.isArray(r))throw new TypeError("Array input expected");if(0===r.length)return r;var e=[],t=0;e[0]={value:r[0],identifier:0};for(var n=1;n<r.length;n++)r[n]===r[n-1]?t++:t=0,e.push({value:r[n],identifier:t});return e}function b(r){if(!Array.isArray(r))throw new TypeError("Array input expected");if(0===r.length)return r;for(var e=[],t=0;t<r.length;t++)e.push(r[t].value);return e}
},{"./number":"uqMu","./string":"PshC","../error/DimensionError":"YiAw","../error/IndexError":"tfOV"}],"UaI8":[function(require,module,exports) {
"use strict";exports.isBoolean=function(o){return"boolean"==typeof o};
},{}],"woyg":[function(require,module,exports) {
"use strict";function t(n){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(n)}function n(o){return(n="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?function(n){return t(n)}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":t(n)})(o)}exports.memoize=function(t,o){return function e(){"object"!==n(e.cache)&&(e.cache={});for(var r=[],c=0;c<arguments.length;c++)r[c]=arguments[c];var u=o?o(r):JSON.stringify(r);return u in e.cache||(e.cache[u]=t.apply(t,r)),e.cache[u]}},exports.maxArgumentCount=function(t){return Object.keys(t.signatures||{}).reduce(function(t,n){var o=(n.match(/,/g)||[]).length+1;return Math.max(t,o)},-1)},exports.callWithRightArgumentCount=function(t,n,o){return Object.keys(t.signatures||{}).reduce(function(t,n){var o=(n.match(/,/g)||[]).length+1;return Math.max(t,o)},-1)};
},{}],"fsXI":[function(require,module,exports) {
"use strict";exports.array=require("./array"),exports.boolean=require("./boolean"),exports.function=require("./function"),exports.number=require("./number"),exports.object=require("./object"),exports.string=require("./string"),exports.emitter=require("./emitter");
},{"./array":"j2lF","./boolean":"UaI8","./function":"woyg","./number":"uqMu","./object":"FcSp","./string":"PshC","./emitter":"GJvY"}],"w7z6":[function(require,module,exports) {
"use strict";var t=require("../../utils/index"),r=t.string,o=r.isString;function n(t,r,n,e){function a(){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator")}return a.prototype.type="Matrix",a.prototype.isMatrix=!0,a.storage=function(t){if(!o(t))throw new TypeError("format must be a string value");var r=a._storage[t];if(!r)throw new SyntaxError("Unsupported matrix storage format: "+t);return r},a._storage={},a.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},a.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},a.prototype.create=function(t,r){throw new Error("Cannot invoke create on a Matrix interface")},a.prototype.subset=function(t,r,o){throw new Error("Cannot invoke subset on a Matrix interface")},a.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},a.prototype.set=function(t,r,o){throw new Error("Cannot invoke set on a Matrix interface")},a.prototype.resize=function(t,r){throw new Error("Cannot invoke resize on a Matrix interface")},a.prototype.reshape=function(t,r){throw new Error("Cannot invoke reshape on a Matrix interface")},a.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},a.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},a.prototype.map=function(t,r){throw new Error("Cannot invoke map on a Matrix interface")},a.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},a.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},a.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},a.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},a.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},a}exports.name="Matrix",exports.path="type",exports.factory=n;
},{"../../utils/index":"fsXI"}],"LZTG":[function(require,module,exports) {
"use strict";function t(o){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(o)}function o(n){return(o="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?function(o){return t(o)}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":t(o)})(n)}function n(t,n,e,r){var i=r("_typeof",{any:function(n){var e=o(n);return"object"===e?null===n?"null":Array.isArray(n)?"Array":n instanceof Date?"Date":n instanceof RegExp?"RegExp":t.isBigNumber(n)?"BigNumber":t.isComplex(n)?"Complex":t.isFraction(n)?"Fraction":t.isMatrix(n)?"Matrix":t.isUnit(n)?"Unit":t.isIndex(n)?"Index":t.isRange(n)?"Range":t.isResultSet(n)?"ResultSet":t.isNode(n)?n.type:t.isChain(n)?"Chain":t.isHelp(n)?"Help":"Object":"function"===e?"Function":e}});return i.toTex=void 0,i}exports.name="typeof",exports.factory=n;
},{}],"XmtI":[function(require,module,exports) {
"use strict";function r(r,t,e,n){var i=e(require("../../../function/utils/typeof"));return function r(t){for(var e,n=0,u=0;u<t.length;u++){var f=t[u],o=Array.isArray(f);if(0===u&&o&&(n=f.length),o&&f.length!==n)return;var a=o?r(f):i(f);if(void 0===e)e=a;else if(e!==a)return"mixed"}return e}}exports.factory=r;
},{"../../../function/utils/typeof":"LZTG"}],"bZ8L":[function(require,module,exports) {
"use strict";var t=require("../../utils/index"),e=require("../../error/DimensionError"),r=t.string,i=t.array,n=t.object,a=t.number,o=Array.isArray,s=a.isNumber,h=a.isInteger,u=r.isString,p=i.validateIndex;function f(a,f,l,d){var c=l(require("./utils/getArrayDataType")),y=l(require("./Matrix"));function _(e,r){if(!(this instanceof _))throw new SyntaxError("Constructor must be called with the new operator");if(r&&!u(r))throw new Error("Invalid datatype: "+r);if(a.isMatrix(e))"DenseMatrix"===e.type?(this._data=n.clone(e._data),this._size=n.clone(e._size),this._datatype=r||e._datatype):(this._data=e.toArray(),this._size=e.size(),this._datatype=r||e._datatype);else if(e&&o(e.data)&&o(e.size))this._data=e.data,this._size=e.size,this._datatype=r||e.datatype;else if(o(e))this._data=function t(e){for(var r=0,i=e.length;r<i;r++){var n=e[r];o(n)?e[r]=t(n):n&&!0===n.isMatrix&&(e[r]=t(n.valueOf()))}return e}(e),this._size=i.size(this._data),i.validate(this._data,this._size),this._datatype=r;else{if(e)throw new TypeError("Unsupported type of data ("+t.types.type(e)+")");this._data=[],this._size=[0],this._datatype=r}}function g(t,e,r){if(0===e.length){for(var n=t._data;o(n);)n=n[0];return n}return t._size=e.slice(0),t._data=i.resize(t._data,t._size,r),t}function w(t,e,r){for(var i=t._size.slice(0),n=!1;i.length<e.length;)i.push(0),n=!0;for(var a=0,o=e.length;a<o;a++)e[a]>i[a]&&(i[a]=e[a],n=!0);n&&g(t,i,r)}return _.prototype=new y,_.prototype.type="DenseMatrix",_.prototype.isDenseMatrix=!0,_.prototype.getDataType=function(){return c(this._data)},_.prototype.storage=function(){return"dense"},_.prototype.datatype=function(){return this._datatype},_.prototype.create=function(t,e){return new _(t,e)},_.prototype.subset=function(t,r,o){switch(arguments.length){case 1:return function(t,r){if(!a.isIndex(r))throw new TypeError("Invalid index");if(r.isScalar())return t.get(r.min());var i=r.size();if(i.length!==t._size.length)throw new e(i.length,t._size.length);for(var n=r.min(),o=r.max(),s=0,h=t._size.length;s<h;s++)p(n[s],t._size[s]),p(o[s],t._size[s]);return new _(function t(e,r,i,n){var a=n===i-1;var o=r.dimension(n);return a?o.map(function(t){return p(t,e.length),e[t]}).valueOf():o.map(function(a){p(a,e.length);var o=e[a];return t(o,r,i,n+1)}).valueOf()}(t._data,r,i.length,0),t._datatype)}(this,t);case 2:case 3:return function(t,r,o,s){if(!r||!0!==r.isIndex)throw new TypeError("Invalid index");var h,u=r.size(),f=r.isScalar();a.isMatrix(o)?(h=o.size(),o=o.valueOf()):h=i.size(o);if(f){if(0!==h.length)throw new TypeError("Scalar expected");t.set(r.min(),o,s)}else{if(u.length<t._size.length)throw new e(u.length,t._size.length,"<");if(h.length<u.length){for(var l=0,d=0;1===u[l]&&1===h[l];)l++;for(;1===u[l];)d++,l++;o=i.unsqueeze(o,u.length,d,h)}if(!n.deepEqual(u,h))throw new e(u,h,">");var c=r.max().map(function(t){return t+1});w(t,c,s);var y=u.length;!function t(e,r,i,n,a){var o=a===n-1;var s=r.dimension(a);o?s.forEach(function(t,r){p(t),e[t]=i[r[0]]}):s.forEach(function(o,s){p(o),t(e[o],r,i[s[0]],n,a+1)})}(t._data,r,o,y,0)}return t}(this,t,r,o);default:throw new SyntaxError("Wrong number of arguments")}},_.prototype.get=function(t){if(!o(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new e(t.length,this._size.length);for(var r=0;r<t.length;r++)p(t[r],this._size[r]);for(var i=this._data,n=0,a=t.length;n<a;n++){var s=t[n];p(s,i.length),i=i[s]}return i},_.prototype.set=function(t,r,i){if(!o(t))throw new TypeError("Array expected");if(t.length<this._size.length)throw new e(t.length,this._size.length,"<");var n,a,s;w(this,t.map(function(t){return t+1}),i);var h=this._data;for(n=0,a=t.length-1;n<a;n++)s=t[n],p(s,h.length),h=h[s];return s=t[t.length-1],p(s,h.length),h[s]=r,this},_.prototype.resize=function(t,e,r){if(!o(t))throw new TypeError("Array expected");return g(r?this.clone():this,t,e)},_.prototype.reshape=function(t,e){var r=e?this.clone():this;return r._data=i.reshape(r._data,t),r._size=t.slice(0),r},_.prototype.clone=function(){return new _({data:n.clone(this._data),size:n.clone(this._size),datatype:this._dat
},{"../../utils/index":"fsXI","../../error/DimensionError":"YiAw","./utils/getArrayDataType":"XmtI","./Matrix":"w7z6"}],"Uu9K":[function(require,module,exports) {
"use strict";module.exports=function(r,i,e){if(null==e)return r.eq(i);if(r.eq(i))return!0;if(r.isNaN()||i.isNaN())return!1;if(r.isFinite()&&i.isFinite()){var t=r.minus(i).abs();if(t.isZero())return!0;var s=r.constructor.max(r.abs(),i.abs());return t.lte(s.times(e))}return!1};
},{}],"QvIw":[function(require,module,exports) {
"use strict";var e=require("../../utils/number").nearlyEqual,n=require("../../utils/bignumber/nearlyEqual");function r(r,u,t,i){var a=i("equalScalar",{"boolean, boolean":function(e,n){return e===n},"number, number":function(n,r){return n===r||e(n,r,u.epsilon)},"BigNumber, BigNumber":function(e,r){return e.eq(r)||n(e,r,u.epsilon)},"Fraction, Fraction":function(e,n){return e.equals(n)},"Complex, Complex":function(e,n){return e.equals(n)},"Unit, Unit":function(e,n){if(!e.equalBase(n))throw new Error("Cannot compare units with different base");return a(e.value,n.value)}});return a}exports.factory=r;
},{"../../utils/number":"uqMu","../../utils/bignumber/nearlyEqual":"Uu9K"}],"armw":[function(require,module,exports) {
"use strict";var e=require("../../utils/index"),t=require("../../error/DimensionError"),r=e.array,i=e.object,n=e.string,s=e.number,a=Array.isArray,o=s.isNumber,h=s.isInteger,p=n.isString,_=r.validateIndex;function u(u,l,f,v){var d=f(require("./Matrix")),c=f(require("../../function/relational/equalScalar")),y=f(require("./utils/getArrayDataType"));function w(t,r){if(!(this instanceof w))throw new SyntaxError("Constructor must be called with the new operator");if(r&&!p(r))throw new Error("Invalid datatype: "+r);if(u.isMatrix(t))!function(e,t,r){"SparseMatrix"===t.type?(e._values=t._values?i.clone(t._values):void 0,e._index=i.clone(t._index),e._ptr=i.clone(t._ptr),e._size=i.clone(t._size),e._datatype=r||t._datatype):x(e,t.valueOf(),r||t._datatype)}(this,t,r);else if(t&&a(t.index)&&a(t.ptr)&&a(t.size))this._values=t.values,this._index=t.index,this._ptr=t.ptr,this._size=t.size,this._datatype=r||t.datatype;else if(a(t))x(this,t,r);else{if(t)throw new TypeError("Unsupported type of data ("+e.types.type(t)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=r}}function x(e,t,r){e._values=[],e._index=[],e._ptr=[],e._datatype=r;var i=t.length,n=0,s=c,o=0;if(p(r)&&(s=v.find(c,[r,r])||c,o=v.convert(0,r)),i>0){var h=0;do{e._ptr.push(e._index.length);for(var _=0;_<i;_++){var u=t[_];if(a(u)){if(0===h&&n<u.length&&(n=u.length),h<u.length){var l=u[h];s(l,o)||(e._values.push(l),e._index.push(_))}}else 0===h&&n<1&&(n=1),s(u,o)||(e._values.push(u),e._index.push(_))}h++}while(h<n)}e._ptr.push(e._index.length),e._size=[i,n]}function g(e,t,r,i){if(r-t==0)return r;for(var n=t;n<r;n++)if(i[n]===e)return n;return t}function z(e,t,r,i,n,s,a){n.splice(e,0,i),s.splice(e,0,t);for(var o=r+1;o<a.length;o++)a[o]++}function m(e,t,r,i){var n=i||0,s=c,a=0;p(e._datatype)&&(s=v.find(c,[e._datatype,e._datatype])||c,a=v.convert(0,e._datatype),n=v.convert(n,e._datatype));var o,h,_,u=!s(n,a),l=e._size[0],f=e._size[1];if(r>f){for(h=f;h<r;h++)if(e._ptr[h]=e._values.length,u)for(o=0;o<l;o++)e._values.push(n),e._index.push(o);e._ptr[r]=e._values.length}else r<f&&(e._ptr.splice(r+1,f-r),e._values.splice(e._ptr[r],e._values.length),e._index.splice(e._ptr[r],e._index.length));if(f=r,t>l){if(u){var d=0;for(h=0;h<f;h++){e._ptr[h]=e._ptr[h]+d,_=e._ptr[h+1]+d;var y=0;for(o=l;o<t;o++,y++)e._values.splice(_+y,0,n),e._index.splice(_+y,0,o),d++}e._ptr[f]=e._values.length}}else if(t<l){var w=0;for(h=0;h<f;h++){e._ptr[h]=e._ptr[h]-w;var x=e._ptr[h],g=e._ptr[h+1]-w;for(_=x;_<g;_++)(o=e._index[_])>t-1&&(e._values.splice(_,1),e._index.splice(_,1),w++)}e._ptr[h]=e._values.length}return e._size[0]=t,e._size[1]=r,e}function E(e,t,r,n,s){var a,o,h=n[0],p=n[1],_=[];for(a=0;a<h;a++)for(_[a]=[],o=0;o<p;o++)_[a][o]=0;for(o=0;o<p;o++)for(var u=r[o],l=r[o+1],f=u;f<l;f++)_[a=t[f]][o]=e?s?i.clone(e[f]):e[f]:1;return _}return w.prototype=new d,w.prototype.type="SparseMatrix",w.prototype.isSparseMatrix=!0,w.prototype.getDataType=function(){return y(this._values)},w.prototype.storage=function(){return"sparse"},w.prototype.datatype=function(){return this._datatype},w.prototype.create=function(e,t){return new w(e,t)},w.prototype.density=function(){var e=this._size[0],t=this._size[1];return 0!==e&&0!==t?this._index.length/(e*t):0},w.prototype.subset=function(e,n,s){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return function(e,r){if(!u.isIndex(r))throw new TypeError("Invalid index");if(r.isScalar())return e.get(r.min());var i,n,s,a,o=r.size();if(o.length!==e._size.length)throw new t(o.length,e._size.length);var h=r.min(),p=r.max();for(i=0,n=e._size.length;i<n;i++)_(h[i],e._size[i]),_(p[i],e._size[i]);var l=e._values,f=e._index,v=e._ptr,d=r.dimension(0),c=r.dimension(1),y=[],x=[];d.forEach(function(e,t){x[e]=t[0],y[e]=!0});var g=l?[]:void 0,z=[],m=[];return c.forEach(function(e){for(m.push(z.length),s=v[e],a=v[e+1];s<a;s++)i=f[s],!0===y[i]&&(z.push(x[i]),g&&g.push(l[s]))}),m.push(z.length),new w({values:g,index:z,ptr:m,size:o,datatype:e._datatype})}(this,e);case 2:case 3:return function(e,n,s,a){if(!n|
},{"../../utils/index":"fsXI","../../error/DimensionError":"YiAw","./Matrix":"w7z6","../../function/relational/equalScalar":"QvIw","./utils/getArrayDataType":"XmtI"}],"vzj5":[function(require,module,exports) {
"use strict";function r(r,t,n,i){var e=i("matrix",{"":function(){return a([])},string:function(r){return a([],r)},"string, string":function(r,t){return a([],r,t)},Array:function(r){return a(r)},Matrix:function(r){return a(r,r.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});return e.toTex={0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},e;function a(t,n,i){return new(r.Matrix.storage(n||"default"))(t,i)}}exports.name="matrix",exports.factory=r;
},{}],"ZM3O":[function(require,module,exports) {
"use strict";function n(n,r,e,t){var u=t("add",{"number, number":function(n,r){return n+r},"Complex, Complex":function(n,r){return n.add(r)},"BigNumber, BigNumber":function(n,r){return n.plus(r)},"Fraction, Fraction":function(n,r){return n.add(r)},"Unit, Unit":function(n,r){if(null===n.value||void 0===n.value)throw new Error("Parameter x contains a unit with undefined value");if(null===r.value||void 0===r.value)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(r))throw new Error("Units do not match");var e=n.clone();return e.value=u(e.value,r.value),e.fixPrefix=!1,e}});return u}exports.factory=n;
},{}],"q1c8":[function(require,module,exports) {
"use strict";var r=require("../../../error/DimensionError");function t(t,e,a,n){var i=t.DenseMatrix;return function(t,e,a,o){var s=t._data,f=t._size,h=t._datatype,p=e._values,d=e._index,m=e._ptr,u=e._size,v=e._datatype;if(f.length!==u.length)throw new r(f.length,u.length);if(f[0]!==u[0]||f[1]!==u[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+u+")");if(!p)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var x,_,g=f[0],w=f[1],c="string"==typeof h&&h===v?h:void 0,l=c?n.find(a,[c,c]):a,y=[];for(x=0;x<g;x++)y[x]=[];var M=[],D=[];for(_=0;_<w;_++){for(var z=_+1,E=m[_],q=m[_+1],A=E;A<q;A++)M[x=d[A]]=o?l(p[A],s[x][_]):l(s[x][_],p[A]),D[x]=z;for(x=0;x<g;x++)D[x]===z?y[x][_]=M[x]:y[x][_]=s[x][_]}return new i({data:y,size:[g,w],datatype:c})}}exports.name="algorithm01",exports.factory=t;
},{"../../../error/DimensionError":"YiAw"}],"m7Qa":[function(require,module,exports) {
"use strict";var r=require("../../../error/DimensionError");function e(e,t,i,n){var a=i(require("../../../function/relational/equalScalar")),o=e.SparseMatrix;return function(e,t,i){var s=e._values,l=e._index,f=e._ptr,u=e._size,h=e._datatype,v=t._values,p=t._index,d=t._ptr,c=t._size,g=t._datatype;if(u.length!==c.length)throw new r(u.length,c.length);if(u[0]!==c[0]||u[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+c+")");var _,m=u[0],x=u[1],w=a,y=0,q=i;"string"==typeof h&&h===g&&(_=h,w=n.find(a,[_,_]),y=n.convert(0,_),q=n.find(i,[_,_]));var z,M,D,E,S,A=s&&v?[]:void 0,B=[],R=[],b=new o({values:A,index:B,ptr:R,size:[m,x],datatype:_}),j=s&&v?[]:void 0,k=s&&v?[]:void 0,C=[],F=[];for(M=0;M<x;M++){R[M]=B.length;var G=M+1;for(E=f[M],S=f[M+1],D=E;D<S;D++)z=l[D],B.push(z),C[z]=G,j&&(j[z]=s[D]);for(E=d[M],S=d[M+1],D=E;D<S;D++)if(C[z=p[D]]===G){if(j){var H=q(j[z],v[D]);w(H,y)?C[z]=null:j[z]=H}}else B.push(z),F[z]=G,k&&(k[z]=v[D]);if(j&&k)for(D=R[M];D<B.length;)C[z=B[D]]===G?(A[D]=j[z],D++):F[z]===G?(A[D]=k[z],D++):B.splice(D,1)}return R[x]=B.length,b}}exports.name="algorithm04",exports.factory=e;
},{"../../../error/DimensionError":"YiAw","../../../function/relational/equalScalar":"QvIw"}],"H0xb":[function(require,module,exports) {
"use strict";function r(r,a,t,e){var n=r.DenseMatrix;return function(r,a,t,o){var i=r._values,f=r._index,s=r._ptr,v=r._size,p=r._datatype;if(!i)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var u,c=v[0],d=v[1],x=t;"string"==typeof p&&(u=p,a=e.convert(a,u),x=e.find(t,[u,u]));for(var _=[],l=new n({data:_,size:[c,d],datatype:u}),y=[],m=[],w=0;w<d;w++){for(var g=w+1,h=s[w],z=s[w+1],M=h;M<z;M++){var S=f[M];y[S]=i[M],m[S]=g}for(var C=0;C<c;C++)0===w&&(_[C]=[]),m[C]===g?_[C][w]=o?x(a,y[C]):x(y[C],a):_[C][w]=a}return l}}exports.name="algorithm10",exports.factory=r;
},{}],"NS7U":[function(require,module,exports) {
"use strict";var r=require("../../../error/DimensionError");function t(t,e,a,n){var i=t.DenseMatrix;return function(t,e,a){var o,s=t._data,f=t._size,h=t._datatype,g=e._data,l=e._size,u=e._datatype,v=[];if(f.length!==l.length)throw new r(f.length,l.length);for(var m=0;m<f.length;m++){if(f[m]!==l[m])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+l+")");v[m]=f[m]}var c=a;"string"==typeof h&&h===u&&(o=h,c=n.find(a,[o,o]));var d=v.length>0?function r(t,e,a,n,i,o){var s=[];if(e===a.length-1)for(var f=0;f<n;f++)s[f]=t(i[f],o[f]);else for(var h=0;h<n;h++)s[h]=r(t,e+1,a,a[e+1],i[h],o[h]);return s}(c,0,v,v[0],s,g):[];return new i({data:d,size:v,datatype:o})}}exports.name="algorithm13",exports.factory=t;
},{"../../../error/DimensionError":"YiAw"}],"S2eB":[function(require,module,exports) {
"use strict";var t=require("../../../utils/object").clone;function r(r,e,a,n){var i=r.DenseMatrix;return function(r,e,a,o){var s,f=r._data,u=r._size,c=r._datatype,v=a;"string"==typeof c&&(s=c,e=n.convert(e,s),v=n.find(a,[s,s]));var l=u.length>0?function t(r,e,a,n,i,o,s){var f=[];if(e===a.length-1)for(var u=0;u<n;u++)f[u]=s?r(o,i[u]):r(i[u],o);else for(var c=0;c<n;c++)f[c]=t(r,e+1,a,a[e+1],i[c],o,s);return f}(v,0,u,u[0],f,e,o):[];return new i({data:l,size:t(u),datatype:s})}}exports.name="algorithm14",exports.factory=r;
},{"../../../utils/object":"FcSp"}],"zf2Z":[function(require,module,exports) {
"use strict";var r=require("../../utils/object").extend;function t(t,e,a,n){var i=a(require("../../type/matrix/function/matrix")),u=a(require("./addScalar")),o=require("../../utils/latex.js"),s=a(require("../../type/matrix/utils/algorithm01")),x=a(require("../../type/matrix/utils/algorithm04")),y=a(require("../../type/matrix/utils/algorithm10")),c=a(require("../../type/matrix/utils/algorithm13")),f=a(require("../../type/matrix/utils/algorithm14")),l=n("add",r({"DenseMatrix, DenseMatrix":function(r,t){return c(r,t,u)},"DenseMatrix, SparseMatrix":function(r,t){return s(r,t,u,!1)},"SparseMatrix, DenseMatrix":function(r,t){return s(t,r,u,!0)},"SparseMatrix, SparseMatrix":function(r,t){return x(r,t,u)},"Array, Array":function(r,t){return l(i(r),i(t)).valueOf()},"Array, Matrix":function(r,t){return l(i(r),t)},"Matrix, Array":function(r,t){return l(r,i(t))},"DenseMatrix, any":function(r,t){return f(r,t,u,!1)},"SparseMatrix, any":function(r,t){return y(r,t,u,!1)},"any, DenseMatrix":function(r,t){return f(t,r,u,!0)},"any, SparseMatrix":function(r,t){return y(t,r,u,!0)},"Array, any":function(r,t){return f(i(r),t,u,!1).valueOf()},"any, Array":function(r,t){return f(i(t),r,u,!0).valueOf()},"any, any":u,"any, any, ...any":function(r,t,e){for(var a=l(r,t),n=0;n<e.length;n++)a=l(a,e[n]);return a}},u.signatures));return l.toTex={2:"\\left(${args[0]}".concat(o.operators.add,"${args[1]}\\right)")},l}exports.name="add",exports.factory=t;
},{"../../utils/object":"FcSp","../../type/matrix/function/matrix":"vzj5","./addScalar":"ZM3O","../../utils/latex.js":"H1Mr","../../type/matrix/utils/algorithm01":"q1c8","../../type/matrix/utils/algorithm04":"m7Qa","../../type/matrix/utils/algorithm10":"H0xb","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"e3fS":[function(require,module,exports) {
"use strict";function e(e,t,a){var i=a(require("../../function/arithmetic/add")),s=a(require("../../function/relational/equalScalar"));function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new e.FibonacciHeap}return r.prototype.type="Spa",r.prototype.isSpa=!0,r.prototype.set=function(e,t){if(this._values[e])this._values[e].value=t;else{var a=this._heap.insert(e,t);this._values[e]=a}},r.prototype.get=function(e){var t=this._values[e];return t?t.value:0},r.prototype.accumulate=function(e,t){var a=this._values[e];a?a.value=i(a.value,t):(a=this._heap.insert(e,t),this._values[e]=a)},r.prototype.forEach=function(e,t,a){var i=this._heap,r=this._values,u=[],o=i.extractMinimum();for(o&&u.push(o);o&&o.key<=t;)o.key>=e&&(s(o.value,0)||a(o.key,o.value,this)),(o=i.extractMinimum())&&u.push(o);for(var h=0;h<u.length;h++){var v=u[h];r[(o=i.insert(v.key,v.value)).key]=o}},r.prototype.swap=function(e,t){var a=this._values[e],i=this._values[t];if(!a&&i)a=this._heap.insert(e,i.value),this._heap.remove(i),this._values[e]=a,this._values[t]=void 0;else if(a&&!i)i=this._heap.insert(t,a.value),this._heap.remove(a),this._values[t]=i,this._values[e]=void 0;else if(a&&i){var s=a.value;a.value=i.value,i.value=s}},r}exports.name="Spa",exports.path="type",exports.factory=e;
},{"../../function/arithmetic/add":"zf2Z","../../function/relational/equalScalar":"QvIw"}],"oR02":[function(require,module,exports) {
"use strict";var r=require("../../../error/DimensionError");function t(t,e,a,n){var o=t.DenseMatrix;return function(t,e,a,i){var s=t._data,f=t._size,v=t._datatype,h=e._values,p=e._index,m=e._ptr,d=e._size,u=e._datatype;if(f.length!==d.length)throw new r(f.length,d.length);if(f[0]!==d[0]||f[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+d+")");if(!h)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var x,_=f[0],c=f[1],g=0,w=a;"string"==typeof v&&v===u&&(x=v,g=n.convert(0,x),w=n.find(a,[x,x]));for(var l=[],y=0;y<_;y++)l[y]=[];for(var M=[],D=[],z=0;z<c;z++){for(var E=z+1,q=m[z],A=m[z+1],B=q;B<A;B++){var C=p[B];M[C]=i?w(h[B],s[C][z]):w(s[C][z],h[B]),D[C]=E}for(var P=0;P<_;P++)D[P]===E?l[P][z]=M[P]:l[P][z]=i?w(g,s[P][z]):w(s[P][z],g)}return new o({data:l,size:[_,c],datatype:x})}}exports.name="algorithm03",exports.factory=t;
},{"../../../error/DimensionError":"YiAw"}],"u44a":[function(require,module,exports) {
"use strict";var r=require("../../../error/DimensionError");function t(t,e,a,n){var i=t.DenseMatrix;function o(r,t,e,a,n){for(var i=r._values,o=r._index,s=r._ptr,f=s[t],v=s[t+1];f<v;f++){var h=o[f];e[h]=n,a[h]=i[f]}}return function(t,e,a){var s=t._size,f=t._datatype,v=e._size,h=e._datatype;if(s.length!==v.length)throw new r(s.length,v.length);if(s[0]!==v[0]||s[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+v+")");var u,c,m,g=s[0],p=s[1],_=0,d=a;"string"==typeof f&&f===h&&(u=f,_=n.convert(0,u),d=n.find(a,[u,u]));var l=[];for(c=0;c<g;c++)l[c]=[];var x=new i({data:l,size:[g,p],datatype:u}),w=[],y=[],z=[],D=[];for(m=0;m<p;m++){var M=m+1;for(o(t,m,z,w,M),o(e,m,D,y,M),c=0;c<g;c++){var E=z[c]===M?w[c]:_,q=D[c]===M?y[c]:_;l[c][m]=d(E,q)}}return x}}exports.name="algorithm07",exports.factory=t;
},{"../../../error/DimensionError":"YiAw"}],"Pn2O":[function(require,module,exports) {
"use strict";function r(r,a,t,e){var n=r.DenseMatrix;return function(r,a,t,o){var i=r._values,f=r._index,s=r._ptr,v=r._size,p=r._datatype;if(!i)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var u,c=v[0],d=v[1],x=t;"string"==typeof p&&(u=p,a=e.convert(a,u),x=e.find(t,[u,u]));for(var _=[],l=new n({data:_,size:[c,d],datatype:u}),y=[],m=[],w=0;w<d;w++){for(var g=w+1,h=s[w],z=s[w+1],M=h;M<z;M++){var S=f[M];y[S]=i[M],m[S]=g}for(var C=0;C<c;C++)0===w&&(_[C]=[]),m[C]===g?_[C][w]=o?x(a,y[C]):x(y[C],a):_[C][w]=o?x(a,0):x(0,a)}return l}}exports.name="algorithm12",exports.factory=r;
},{}],"Q7ag":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").nearlyEqual,e=require("../../utils/bignumber/nearlyEqual");function t(t,n,i,a){var u=i(require("../../type/matrix/function/matrix")),o=i(require("../../type/matrix/utils/algorithm03")),l=i(require("../../type/matrix/utils/algorithm07")),s=i(require("../../type/matrix/utils/algorithm12")),f=i(require("../../type/matrix/utils/algorithm13")),c=i(require("../../type/matrix/utils/algorithm14")),m=require("../../utils/latex"),x=a("smaller",{"boolean, boolean":function(r,e){return r<e},"number, number":function(e,t){return e<t&&!r(e,t,n.epsilon)},"BigNumber, BigNumber":function(r,t){return r.lt(t)&&!e(r,t,n.epsilon)},"Fraction, Fraction":function(r,e){return-1===r.compare(e)},"Complex, Complex":function(r,e){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(r,e){if(!r.equalBase(e))throw new Error("Cannot compare units with different base");return x(r.value,e.value)},"SparseMatrix, SparseMatrix":function(r,e){return l(r,e,x)},"SparseMatrix, DenseMatrix":function(r,e){return o(e,r,x,!0)},"DenseMatrix, SparseMatrix":function(r,e){return o(r,e,x,!1)},"DenseMatrix, DenseMatrix":function(r,e){return f(r,e,x)},"Array, Array":function(r,e){return x(u(r),u(e)).valueOf()},"Array, Matrix":function(r,e){return x(u(r),e)},"Matrix, Array":function(r,e){return x(r,u(e))},"SparseMatrix, any":function(r,e){return s(r,e,x,!1)},"DenseMatrix, any":function(r,e){return c(r,e,x,!1)},"any, SparseMatrix":function(r,e){return s(e,r,x,!0)},"any, DenseMatrix":function(r,e){return c(e,r,x,!0)},"Array, any":function(r,e){return c(u(r),e,x,!1).valueOf()},"any, Array":function(r,e){return c(u(e),r,x,!0).valueOf()}});return x.toTex={2:"\\left(${args[0]}".concat(m.operators.smaller,"${args[1]}\\right)")},x}exports.name="smaller",exports.factory=t;
},{"../../utils/number":"uqMu","../../utils/bignumber/nearlyEqual":"Uu9K","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm07":"u44a","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB","../../utils/latex":"H1Mr"}],"SrDl":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").nearlyEqual,e=require("../../utils/bignumber/nearlyEqual");function t(t,n,i,a){var u=i(require("../../type/matrix/function/matrix")),o=i(require("../../type/matrix/utils/algorithm03")),l=i(require("../../type/matrix/utils/algorithm07")),s=i(require("../../type/matrix/utils/algorithm12")),f=i(require("../../type/matrix/utils/algorithm13")),c=i(require("../../type/matrix/utils/algorithm14")),x=require("../../utils/latex"),m=a("larger",{"boolean, boolean":function(r,e){return r>e},"number, number":function(e,t){return e>t&&!r(e,t,n.epsilon)},"BigNumber, BigNumber":function(r,t){return r.gt(t)&&!e(r,t,n.epsilon)},"Fraction, Fraction":function(r,e){return 1===r.compare(e)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(r,e){if(!r.equalBase(e))throw new Error("Cannot compare units with different base");return m(r.value,e.value)},"SparseMatrix, SparseMatrix":function(r,e){return l(r,e,m)},"SparseMatrix, DenseMatrix":function(r,e){return o(e,r,m,!0)},"DenseMatrix, SparseMatrix":function(r,e){return o(r,e,m,!1)},"DenseMatrix, DenseMatrix":function(r,e){return f(r,e,m)},"Array, Array":function(r,e){return m(u(r),u(e)).valueOf()},"Array, Matrix":function(r,e){return m(u(r),e)},"Matrix, Array":function(r,e){return m(r,u(e))},"SparseMatrix, any":function(r,e){return s(r,e,m,!1)},"DenseMatrix, any":function(r,e){return c(r,e,m,!1)},"any, SparseMatrix":function(r,e){return s(e,r,m,!0)},"any, DenseMatrix":function(r,e){return c(e,r,m,!0)},"Array, any":function(r,e){return c(u(r),e,m,!1).valueOf()},"any, Array":function(r,e){return c(u(e),r,m,!0).valueOf()}});return m.toTex={2:"\\left(${args[0]}".concat(x.operators.larger,"${args[1]}\\right)")},m}exports.name="larger",exports.factory=t;
},{"../../utils/number":"uqMu","../../utils/bignumber/nearlyEqual":"Uu9K","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm07":"u44a","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB","../../utils/latex":"H1Mr"}],"ifbV":[function(require,module,exports) {
"use strict";function t(t,i,r,e){var h=r(require("../../function/relational/smaller")),n=r(require("../../function/relational/larger")),l=1/Math.log((1+Math.sqrt(5))/2);function o(){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}function f(t,i,r){i.left.right=i.right,i.right.left=i.left,r.degree--,r.child===i&&(r.child=i.right),0===r.degree&&(r.child=null),i.left=t,i.right=t.right,t.right=i,i.right.left=i,i.parent=null,i.mark=!1}o.prototype.type="FibonacciHeap",o.prototype.isFibonacciHeap=!0,o.prototype.insert=function(t,i){var r={key:t,value:i,degree:0};if(this._minimum){var e=this._minimum;r.left=e,r.right=e.right,e.right=r,r.right.left=r,h(t,e.key)&&(this._minimum=r)}else r.left=r,r.right=r,this._minimum=r;return this._size++,r},o.prototype.size=function(){return this._size},o.prototype.clear=function(){this._minimum=null,this._size=0},o.prototype.isEmpty=function(){return 0===this._size},o.prototype.extractMinimum=function(){var t=this._minimum;if(null===t)return t;for(var i=this._minimum,r=t.degree,e=t.child;r>0;){var o=e.right;e.left.right=e.right,e.right.left=e.left,e.left=i,e.right=i.right,i.right=e,e.right.left=e,e.parent=null,e=o,r--}return t.left.right=t.right,t.right.left=t.left,i=t===t.right?null:function(t,i){var r,e=Math.floor(Math.log(i)*l)+1,o=new Array(e),f=0,u=t;if(u)for(f++,u=u.right;u!==t;)f++,u=u.right;for(;f>0;){for(var a=u.degree,m=u.right;r=o[a];){if(n(u.key,r.key)){var s=r;r=u,u=s}g(r,u),o[a]=null,a++}o[a]=u,u=m,f--}t=null;for(var c=0;c<e;c++)(r=o[c])&&(t?(r.left.right=r.right,r.right.left=r.left,r.left=t,r.right=t.right,t.right=r,r.right.left=r,h(r.key,t.key)&&(t=r)):t=r);return t}(i=t.right,this._size),this._size--,this._minimum=i,t},o.prototype.remove=function(t){this._minimum=function(t,i,r){i.key=r;var e=i.parent;e&&h(i.key,e.key)&&(f(t,i,e),function t(i,r){var e=r.parent;if(!e)return;r.mark?(f(i,r,e),t(e)):r.mark=!0}(t,e));h(i.key,t.key)&&(t=i);return t}(this._minimum,t,-1),this.extractMinimum()};var g=function(t,i){t.left.right=t.right,t.right.left=t.left,t.parent=i,i.child?(t.left=i.child,t.right=i.child.right,i.child.right=t,t.right.left=t):(i.child=t,t.right=t,t.left=t),i.degree++,t.mark=!1};return o}exports.name="FibonacciHeap",exports.path="type",exports.factory=t;
},{"../../function/relational/smaller":"Q7ag","../../function/relational/larger":"SrDl"}],"B6L6":[function(require,module,exports) {
"use strict";var t=require("../../utils/index"),e=t.string,n=t.object,a=Array.isArray,i=e.isString;function r(e,r,o){var s=o(require("./DenseMatrix")),u=o(require("../../function/relational/smaller"));function p(n,r){if(!(this instanceof p))throw new SyntaxError("Constructor must be called with the new operator");if(r&&!i(r))throw new Error("Invalid datatype: "+r);if(e.isMatrix(n)||a(n)){var o=new s(n,r);this._data=o._data,this._size=o._size,this._datatype=o._datatype,this._min=null,this._max=null}else if(n&&a(n.data)&&a(n.size))this._data=n.data,this._size=n.size,this._datatype=n.datatype,this._min=void 0!==n.min?n.min:null,this._max=void 0!==n.max?n.max:null;else{if(n)throw new TypeError("Unsupported type of data ("+t.types.type(n)+")");this._data=[],this._size=[0],this._datatype=r,this._min=null,this._max=null}}return p.prototype=new s,p.prototype.type="ImmutableDenseMatrix",p.prototype.isImmutableDenseMatrix=!0,p.prototype.subset=function(t){switch(arguments.length){case 1:var n=s.prototype.subset.call(this,t);return e.isMatrix(n)?new p({data:n._data,size:n._size,datatype:n._datatype}):n;case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},p.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},p.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},p.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},p.prototype.clone=function(){return new p({data:n.clone(this._data),size:n.clone(this._size),datatype:this._datatype})},p.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},p.fromJSON=function(t){return new p(t)},p.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},p.prototype.min=function(){if(null===this._min){var t=null;this.forEach(function(e){(null===t||u(e,t))&&(t=e)}),this._min=null!==t?t:void 0}return this._min},p.prototype.max=function(){if(null===this._max){var t=null;this.forEach(function(e){(null===t||u(t,e))&&(t=e)}),this._max=null!==t?t:void 0}return this._max},p}exports.name="ImmutableDenseMatrix",exports.path="type",exports.factory=r;
},{"../../utils/index":"fsXI","./DenseMatrix":"bZ8L","../../function/relational/smaller":"Q7ag"}],"SL3U":[function(require,module,exports) {
"use strict";var t=require("../../utils/object").clone,n=require("../../utils/number").isInteger;function i(i){function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._isScalar=!0;for(var n=0,s=arguments.length;n<s;n++){var o=arguments[n];if(i.isRange(o))this._dimensions.push(o),this._isScalar=!1;else if(Array.isArray(o)||i.isMatrix(o)){var a=r(o.valueOf());this._dimensions.push(a);var p=a.size();1===p.length&&1===p[0]||(this._isScalar=!1)}else if("number"==typeof o)this._dimensions.push(r([o]));else{if("string"!=typeof o)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");this._dimensions.push(o)}}}function r(t){for(var e=0,r=t.length;e<r;e++)if("number"!=typeof t[e]||!n(t[e]))throw new TypeError("Index parameters must be positive integer numbers");return new i.ImmutableDenseMatrix(t)}return e.prototype.type="Index",e.prototype.isIndex=!0,e.prototype.clone=function(){var n=new e;return n._dimensions=t(this._dimensions),n._isScalar=this._isScalar,n},e.create=function(t){var n=new e;return e.apply(n,t),n},e.prototype.size=function(){for(var t=[],n=0,i=this._dimensions.length;n<i;n++){var e=this._dimensions[n];t[n]="string"==typeof e?1:e.size()[0]}return t},e.prototype.max=function(){for(var t=[],n=0,i=this._dimensions.length;n<i;n++){var e=this._dimensions[n];t[n]="string"==typeof e?e:e.max()}return t},e.prototype.min=function(){for(var t=[],n=0,i=this._dimensions.length;n<i;n++){var e=this._dimensions[n];t[n]="string"==typeof e?e:e.min()}return t},e.prototype.forEach=function(t){for(var n=0,i=this._dimensions.length;n<i;n++)t(this._dimensions[n],n,this)},e.prototype.dimension=function(t){return this._dimensions[t]||null},e.prototype.isObjectProperty=function(){return 1===this._dimensions.length&&"string"==typeof this._dimensions[0]},e.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},e.prototype.isScalar=function(){return this._isScalar},e.prototype.toArray=function(){for(var t=[],n=0,i=this._dimensions.length;n<i;n++){var e=this._dimensions[n];t.push("string"==typeof e?e:e.toArray())}return t},e.prototype.valueOf=e.prototype.toArray,e.prototype.toString=function(){for(var t=[],n=0,i=this._dimensions.length;n<i;n++){var e=this._dimensions[n];"string"==typeof e?t.push(JSON.stringify(e)):t.push(e.toString())}return"["+t.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},e.fromJSON=function(t){return e.create(t.dimensions)},e}exports.name="Index",exports.path="type",exports.factory=i;
},{"../../utils/object":"FcSp","../../utils/number":"uqMu"}],"rRNx":[function(require,module,exports) {
"use strict";var t=require("../../utils/number");function r(r,e,n,s){function i(t,e,n){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");var s=null!=t,o=null!=e,a=null!=n;if(s)if(r.isBigNumber(t))t=t.toNumber();else if("number"!=typeof t)throw new TypeError("Parameter start must be a number");if(o)if(r.isBigNumber(e))e=e.toNumber();else if("number"!=typeof e)throw new TypeError("Parameter end must be a number");if(a)if(r.isBigNumber(n))n=n.toNumber();else if("number"!=typeof n)throw new TypeError("Parameter step must be a number");this.start=s?parseFloat(t):0,this.end=o?parseFloat(e):0,this.step=a?parseFloat(n):1}return i.prototype.type="Range",i.prototype.isRange=!0,i.parse=function(t){if("string"!=typeof t)return null;var r=t.split(":").map(function(t){return parseFloat(t)});if(r.some(function(t){return isNaN(t)}))return null;switch(r.length){case 2:return new i(r[0],r[1]);case 3:return new i(r[0],r[2],r[1]);default:return null}},i.prototype.clone=function(){return new i(this.start,this.end,this.step)},i.prototype.size=function(){var r=0,e=this.start,n=this.step,s=this.end-e;return t.sign(n)===t.sign(s)?r=Math.ceil(s/n):0===s&&(r=0),isNaN(r)&&(r=0),[r]},i.prototype.min=function(){var t=this.size()[0];return t>0?this.step>0?this.start:this.start+(t-1)*this.step:void 0},i.prototype.max=function(){var t=this.size()[0];return t>0?this.step>0?this.start+(t-1)*this.step:this.start:void 0},i.prototype.forEach=function(t){var r=this.start,e=this.step,n=this.end,s=0;if(e>0)for(;r<n;)t(r,[s],this),r+=e,s++;else if(e<0)for(;r>n;)t(r,[s],this),r+=e,s++},i.prototype.map=function(t){var r=[];return this.forEach(function(e,n,s){r[n[0]]=t(e,n,s)}),r},i.prototype.toArray=function(){var t=[];return this.forEach(function(r,e){t[e[0]]=r}),t},i.prototype.valueOf=function(){return this.toArray()},i.prototype.format=function(r){var e=t.format(this.start,r);return 1!==this.step&&(e+=":"+t.format(this.step,r)),e+=":"+t.format(this.end,r)},i.prototype.toString=function(){return this.format()},i.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},i.fromJSON=function(t){return new i(t.start,t.end,t.step)},i}exports.name="Range",exports.path="type",exports.factory=r;
},{"../../utils/number":"uqMu"}],"ChhM":[function(require,module,exports) {
"use strict";function r(r,n,e,t){return t("index",{"...number | string | BigNumber | Range | Array | Matrix":function(n){var e=n.map(function(n){return r.isBigNumber(n)?n.toNumber():Array.isArray(n)||r.isMatrix(n)?n.map(function(n){return r.isBigNumber(n)?n.toNumber():n}):n}),t=new r.Index;return r.Index.apply(t,e),t}})}exports.name="index",exports.factory=r;
},{}],"GmPR":[function(require,module,exports) {
"use strict";function r(r,n,t,e){var s=r.SparseMatrix,a=e("sparse",{"":function(){return new s([])},string:function(r){return new s([],r)},"Array | Matrix":function(r){return new s(r)},"Array | Matrix, string":function(r,n){return new s(r,n)}});return a.toTex={0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},a}exports.name="sparse",exports.factory=r;
},{}],"Xhzw":[function(require,module,exports) {
"use strict";module.exports=[require("./Matrix"),require("./DenseMatrix"),require("./SparseMatrix"),require("./Spa"),require("./FibonacciHeap"),require("./ImmutableDenseMatrix"),require("./MatrixIndex"),require("./Range"),require("./function/index"),require("./function/matrix"),require("./function/sparse"),require("./utils/getArrayDataType")];
},{"./Matrix":"w7z6","./DenseMatrix":"bZ8L","./SparseMatrix":"armw","./Spa":"e3fS","./FibonacciHeap":"ifbV","./ImmutableDenseMatrix":"B6L6","./MatrixIndex":"SL3U","./Range":"rRNx","./function/index":"ChhM","./function/matrix":"vzj5","./function/sparse":"GmPR","./utils/getArrayDataType":"XmtI"}],"lESm":[function(require,module,exports) {
"use strict";var r=require("./../utils/collection/deepMap");function n(n,t,e,u){var i=u("number",{"":function(){return 0},number:function(r){return r},string:function(r){if("NaN"===r)return NaN;var n=Number(r);if(isNaN(n))throw new SyntaxError('String "'+r+'" is no valid number');return n},BigNumber:function(r){return r.toNumber()},Fraction:function(r){return r.valueOf()},Unit:function(r){throw new Error("Second argument with valueless unit expected")},null:function(r){return 0},"Unit, string | Unit":function(r,n){return r.toNumber(n)},"Array | Matrix":function(n){return r(n,i)}});return i.toTex={0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},i}exports.name="number",exports.factory=n;
},{"./../utils/collection/deepMap":"lOYo"}],"aA7E":[function(require,module,exports) {
"use strict";function r(r,e,t,n){var i=t(require("../function/utils/typeof")),o={string:!0,number:!0,BigNumber:!0,Fraction:!0},u={number:t(require("./number")),BigNumber:t(require("./bignumber/function/bignumber")),Fraction:t(require("./fraction/function/fraction"))},c=function(r,e){var t=i(r);if(!(t in o))throw new TypeError("Cannot convert "+r+' of type "'+t+'"; valid input types are '+Object.keys(o).join(", "));if(!(e in u))throw new TypeError("Cannot convert "+r+' to type "'+e+'"; valid output types are '+Object.keys(u).join(", "));return e===t?r:u[e](r)};return c.toTex=function(r,e){return r.args[0].toTex()},c}exports.path="type",exports.name="_numeric",exports.factory=r;
},{"../function/utils/typeof":"LZTG","./number":"lESm","./bignumber/function/bignumber":"ejiJ","./fraction/function/fraction":"CouR"}],"hpV8":[function(require,module,exports) {
"use strict";function t(t,e,r,n){function o(t){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return o.prototype.type="ResultSet",o.prototype.isResultSet=!0,o.prototype.valueOf=function(){return this.entries},o.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},o.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},o.fromJSON=function(t){return new o(t.entries)},o}exports.name="ResultSet",exports.path="type",exports.factory=t;
},{}],"seRb":[function(require,module,exports) {
"use strict";module.exports=[require("./ResultSet")];
},{"./ResultSet":"hpV8"}],"QilD":[function(require,module,exports) {
"use strict";var r=require("./../utils/collection/deepMap"),t=require("../utils/number");function n(n,e,u,i){var o=i("string",{"":function(){return""},number:t.format,null:function(r){return"null"},boolean:function(r){return r+""},string:function(r){return r},"Array | Matrix":function(t){return r(t,o)},any:function(r){return String(r)}});return o.toTex={0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},o}exports.name="string",exports.factory=n;
},{"./../utils/collection/deepMap":"lOYo","../utils/number":"uqMu"}],"JQPe":[function(require,module,exports) {
"use strict";var e=require("../function").memoize;function n(e){return e[0].precision}exports.e=e(function(e){return new e(1).exp()},n),exports.phi=e(function(e){return new e(1).plus(new e(5).sqrt()).div(2)},n),exports.pi=e(function(e){return e.acos(-1)},n),exports.tau=e(function(e){return exports.pi(e).times(2)},n);
},{"../function":"woyg"}],"q5A1":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function n(n,e,t,u){var i=require("../../utils/latex"),o=u("unaryMinus",{number:function(r){return-r},Complex:function(r){return r.neg()},BigNumber:function(r){return r.neg()},Fraction:function(r){return r.neg()},Unit:function(r){var n=r.clone();return n.value=o(r.value),n},"Array | Matrix":function(n){return r(n,o,!0)}});return o.toTex={1:"".concat(i.operators.unaryMinus,"\\left(${args[0]}\\right)")},o}exports.name="unaryMinus",exports.factory=n;
},{"../../utils/collection/deepMap":"lOYo","../../utils/latex":"H1Mr"}],"JNXe":[function(require,module,exports) {
"use strict";var r=require("../../../error/DimensionError");function e(e,t,i,a){var n=i(require("../../../function/relational/equalScalar")),o=e.SparseMatrix;return function(e,t,i){var s=e._values,l=e._index,u=e._ptr,f=e._size,h=e._datatype,v=t._values,p=t._index,d=t._ptr,c=t._size,g=t._datatype;if(f.length!==c.length)throw new r(f.length,c.length);if(f[0]!==c[0]||f[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+c+")");var _,m=f[0],x=f[1],w=n,y=0,q=i;"string"==typeof h&&h===g&&(_=h,w=a.find(n,[_,_]),y=a.convert(0,_),q=a.find(i,[_,_]));var z,M,D,E,S=s&&v?[]:void 0,A=[],B=[],R=new o({values:S,index:A,ptr:B,size:[m,x],datatype:_}),b=S?[]:void 0,j=S?[]:void 0,k=[],C=[];for(M=0;M<x;M++){B[M]=A.length;var F=M+1;for(D=u[M],E=u[M+1];D<E;D++)z=l[D],A.push(z),k[z]=F,b&&(b[z]=s[D]);for(D=d[M],E=d[M+1];D<E;D++)k[z=p[D]]!==F&&A.push(z),C[z]=F,j&&(j[z]=v[D]);if(S)for(D=B[M];D<A.length;){var G=k[z=A[D]],H=C[z];if(G===F||H===F){var I=q(G===F?b[z]:y,H===F?j[z]:y);w(I,y)?A.splice(D,1):(S.push(I),D++)}}}return B[x]=A.length,R}}exports.name="algorithm05",exports.factory=e;
},{"../../../error/DimensionError":"YiAw","../../../function/relational/equalScalar":"QvIw"}],"m78R":[function(require,module,exports) {
"use strict";var r=require("../../error/DimensionError");function t(r,t,n,i){var u=require("../../utils/latex"),a=n(require("../../type/matrix/function/matrix")),o=n(require("./addScalar")),s=n(require("./unaryMinus")),l=n(require("../../type/matrix/utils/algorithm01")),c=n(require("../../type/matrix/utils/algorithm03")),f=n(require("../../type/matrix/utils/algorithm05")),x=n(require("../../type/matrix/utils/algorithm10")),m=n(require("../../type/matrix/utils/algorithm13")),y=n(require("../../type/matrix/utils/algorithm14")),h=i("subtract",{"number, number":function(r,t){return r-t},"Complex, Complex":function(r,t){return r.sub(t)},"BigNumber, BigNumber":function(r,t){return r.minus(t)},"Fraction, Fraction":function(r,t){return r.sub(t)},"Unit, Unit":function(r,t){if(null===r.value)throw new Error("Parameter x contains a unit with undefined value");if(null===t.value)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(t))throw new Error("Units do not match");var e=r.clone();return e.value=h(e.value,t.value),e.fixPrefix=!1,e},"SparseMatrix, SparseMatrix":function(r,t){return e(r,t),f(r,t,h)},"SparseMatrix, DenseMatrix":function(r,t){return e(r,t),c(t,r,h,!0)},"DenseMatrix, SparseMatrix":function(r,t){return e(r,t),l(r,t,h,!1)},"DenseMatrix, DenseMatrix":function(r,t){return e(r,t),m(r,t,h)},"Array, Array":function(r,t){return h(a(r),a(t)).valueOf()},"Array, Matrix":function(r,t){return h(a(r),t)},"Matrix, Array":function(r,t){return h(r,a(t))},"SparseMatrix, any":function(r,t){return x(r,s(t),o)},"DenseMatrix, any":function(r,t){return y(r,t,h)},"any, SparseMatrix":function(r,t){return x(t,r,h,!0)},"any, DenseMatrix":function(r,t){return y(t,r,h,!0)},"Array, any":function(r,t){return y(a(r),t,h,!1).valueOf()},"any, Array":function(r,t){return y(a(t),r,h,!0).valueOf()}});return h.toTex={2:"\\left(${args[0]}".concat(u.operators.subtract,"${args[1]}\\right)")},h}function e(t,e){var n=t.size(),i=e.size();if(n.length!==i.length)throw new r(n.length,i.length)}exports.name="subtract",exports.factory=t;
},{"../../error/DimensionError":"YiAw","../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5","./addScalar":"ZM3O","./unaryMinus":"q5A1","../../type/matrix/utils/algorithm01":"q1c8","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm05":"JNXe","../../type/matrix/utils/algorithm10":"H0xb","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"obRw":[function(require,module,exports) {
"use strict";function n(n,r,u,e){var t=e("multiplyScalar",{"number, number":function(n,r){return n*r},"Complex, Complex":function(n,r){return n.mul(r)},"BigNumber, BigNumber":function(n,r){return n.times(r)},"Fraction, Fraction":function(n,r){return n.mul(r)},"number | Fraction | BigNumber | Complex, Unit":function(n,r){var u=r.clone();return u.value=null===u.value?u._normalize(n):t(u.value,n),u},"Unit, number | Fraction | BigNumber | Complex":function(n,r){var u=n.clone();return u.value=null===u.value?u._normalize(r):t(u.value,r),u},"Unit, Unit":function(n,r){return n.multiply(r)}});return t}exports.factory=n;
},{}],"R3aq":[function(require,module,exports) {
"use strict";function n(n,r,e,u){var i=e(require("../../type/numeric")),t=e(require("../../function/utils/typeof")),o=u("divide",{"number, number":function(n,r){return n/r},"Complex, Complex":function(n,r){return n.div(r)},"BigNumber, BigNumber":function(n,r){return n.div(r)},"Fraction, Fraction":function(n,r){return n.div(r)},"Unit, number | Fraction | BigNumber":function(n,r){var e=n.clone(),u=i(1,t(r));return e.value=o(null===e.value?e._normalize(u):e.value,r),e},"number | Fraction | BigNumber, Unit":function(n,r){var e=r.clone();e=e.pow(-1);var u=i(1,t(n));return e.value=o(n,null===r.value?r._normalize(u):r.value),e},"Unit, Unit":function(n,r){return n.divide(r)}});return o}exports.factory=n;
},{"../../type/numeric":"aA7E","../../function/utils/typeof":"LZTG"}],"zJUT":[function(require,module,exports) {
"use strict";var r=require("../../utils/array"),e=require("../../utils/number").isInteger;function t(t,i,n,u){var a=n(require("../../type/matrix/function/matrix")),o=u("identity",{"":function(){return"Matrix"===i.matrix?a([]):[]},string:function(r){return a(r)},"number | BigNumber":function(r){return m(r,r,"Matrix"===i.matrix?"default":void 0)},"number | BigNumber, string":function(r,e){return m(r,r,e)},"number | BigNumber, number | BigNumber":function(r,e){return m(r,e,"Matrix"===i.matrix?"default":void 0)},"number | BigNumber, number | BigNumber, string":function(r,e,t){return m(r,e,t)},Array:function(r){return s(r)},"Array, string":function(r,e){return s(r,e)},Matrix:function(r){return s(r.valueOf(),r.storage())},"Matrix, string":function(r,e){return s(r.valueOf(),e)}});return o.toTex=void 0,o;function s(r,e){switch(r.length){case 0:return e?a(e):[];case 1:return m(r[0],r[0],e);case 2:return m(r[0],r[1],e);default:throw new Error("Vector containing two values expected")}}function m(i,n,u){var a=t.isBigNumber(i)||t.isBigNumber(n)?t.BigNumber:null;if(t.isBigNumber(i)&&(i=i.toNumber()),t.isBigNumber(n)&&(n=n.toNumber()),!e(i)||i<1)throw new Error("Parameters in function identity must be positive integers");if(!e(n)||n<1)throw new Error("Parameters in function identity must be positive integers");var o=a?new t.BigNumber(1):1,s=a?new a(0):0,m=[i,n];if(u)return t.Matrix.storage(u).diagonal(m,o,0,s);for(var f=r.resize([],m,s),c=i<n?i:n,g=0;g<c;g++)f[g][g]=o;return f}}exports.name="identity",exports.factory=t;
},{"../../utils/array":"j2lF","../../utils/number":"uqMu","../../type/matrix/function/matrix":"vzj5"}],"dpKK":[function(require,module,exports) {
"use strict";function r(r,a,e,t){var n=e(require("../../../function/relational/equalScalar")),o=r.SparseMatrix;return function(r,a,e,i){var p=r._values,s=r._index,u=r._ptr,f=r._size,l=r._datatype;if(!p)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var v,c=f[0],d=f[1],h=n,x=0,_=e;"string"==typeof l&&(v=l,h=t.find(n,[v,v]),x=t.convert(0,v),a=t.convert(a,v),_=t.find(e,[v,v]));for(var g=[],y=[],S=[],m=new o({values:g,index:y,ptr:S,size:[c,d],datatype:v}),w=0;w<d;w++){S[w]=y.length;for(var q=u[w],z=u[w+1],M=q;M<z;M++){var C=s[M],E=i?_(a,p[M]):_(p[M],a);h(E,x)||(y.push(C),g.push(E))}}return S[d]=y.length,m}}exports.name="algorithm11",exports.factory=r;
},{"../../../function/relational/equalScalar":"QvIw"}],"k7By":[function(require,module,exports) {
"use strict";var r=require("../../utils/object").extend,t=require("../../utils/array");function a(a,e,n,i){var o=require("../../utils/latex"),s=n(require("../../type/matrix/function/matrix")),u=n(require("./addScalar")),l=n(require("./multiplyScalar")),f=n(require("../relational/equalScalar")),d=n(require("../../type/matrix/utils/algorithm11")),p=n(require("../../type/matrix/utils/algorithm14")),y=a.DenseMatrix,v=a.SparseMatrix,c=i("multiply",r({"Array, Array":function(r,e){m(t.size(r),t.size(e));var n=c(s(r),s(e));return a.isMatrix(n)?n.valueOf():n},"Matrix, Matrix":function(r,t){var a=r.size(),e=t.size();return m(a,e),1===a.length?1===e.length?function(r,t,a){if(0===a)throw new Error("Cannot multiply two empty vectors");var e,n=r._data,o=r._datatype,s=t._data,f=t._datatype,d=u,p=l;o&&f&&o===f&&"string"==typeof o&&(e=o,d=i.find(u,[e,e]),p=i.find(l,[e,e]));for(var y=p(n[0],s[0]),v=1;v<a;v++)y=d(y,p(n[v],s[v]));return y}(r,t,a[0]):function(r,t){if("dense"!==t.storage())throw new Error("Support for SparseMatrix not implemented");return function(r,t){var a,e=r._data,n=r._size,o=r._datatype,s=t._data,f=t._size,d=t._datatype,p=n[0],v=f[1],c=u,m=l;o&&d&&o===d&&"string"==typeof o&&(a=o,c=i.find(u,[a,a]),m=i.find(l,[a,a]));for(var h=[],x=0;x<v;x++){for(var _=m(e[0],s[0][x]),g=1;g<p;g++)_=c(_,m(e[g],s[g][x]));h[x]=_}return new y({data:h,size:[v],datatype:a})}(r,t)}(r,t):1===e.length?h(r,t):x(r,t)},"Matrix, Array":function(r,t){return c(r,s(t))},"Array, Matrix":function(r,t){return c(s(r,t.storage()),t)},"SparseMatrix, any":function(r,t){return d(r,t,l,!1)},"DenseMatrix, any":function(r,t){return p(r,t,l,!1)},"any, SparseMatrix":function(r,t){return d(t,r,l,!0)},"any, DenseMatrix":function(r,t){return p(t,r,l,!0)},"Array, any":function(r,t){return p(s(r),t,l,!1).valueOf()},"any, Array":function(r,t){return p(s(t),r,l,!0).valueOf()},"any, any":l,"any, any, ...any":function(r,t,a){for(var e=c(r,t),n=0;n<a.length;n++)e=c(e,a[n]);return e}},l.signatures));function m(r,t){switch(r.length){case 1:switch(t.length){case 1:if(r[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(r[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+r[0]+") must match Matrix rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;case 2:switch(t.length){case 1:if(r[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+r[1]+") must match Vector length ("+t[0]+")");break;case 2:if(r[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+r[1]+") must match Matrix B rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+r.length+" dimensions)")}}var h=i("_multiplyMatrixVector",{"DenseMatrix, any":function(r,t){var a,e=r._data,n=r._size,o=r._datatype,s=t._data,f=t._datatype,d=n[0],p=n[1],v=u,c=l;o&&f&&o===f&&"string"==typeof o&&(a=o,v=i.find(u,[a,a]),c=i.find(l,[a,a]));for(var m=[],h=0;h<d;h++){for(var x=e[h],_=c(x[0],s[0]),g=1;g<p;g++)_=v(_,c(x[g],s[g]));m[h]=_}return new y({data:m,size:[d],datatype:a})},"SparseMatrix, any":function(r,t){var a=r._values,e=r._index,n=r._ptr,o=r._datatype;if(!a)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var s,d=t._data,p=t._datatype,y=r._size[0],c=t._size[0],m=[],h=[],x=[],_=u,g=l,M=f,w=0;o&&p&&o===p&&"string"==typeof o&&(s=o,_=i.find(u,[s,s]),g=i.find(l,[s,s]),M=i.find(f,[s,s]),w=i.convert(0,s));var z=[],D=[];x[0]=0;for(var S=0;S<c;S++){var E=d[S];if(!M(E,w))for(var q=n[S],A=n[S+1],b=q;b<A;b++){var C=e[b];D[C]?z[C]=_(z[C],g(E,a[b])):(D[C]=!0,h.push(C),z[C]=g(E,a[b]))}}for(var k=h.length,R=0;R<k;R++){var V=h[R];m[R]=z[V]}return x[1]=h.length,new v({values:m,index:h,ptr:x,size:[y,1],datatype:s})}}),x=i("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":function(r,t){var a,
},{"../../utils/object":"FcSp","../../utils/array":"j2lF","../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5","./addScalar":"ZM3O","./multiplyScalar":"obRw","../relational/equalScalar":"QvIw","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm14":"S2eB"}],"CsUv":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").isInteger,e=require("../../utils/array").size;function t(t,n,i,o){var u=require("../../utils/latex"),a=i(require("../matrix/identity")),p=i(require("./multiply")),f=i(require("../../type/matrix/function/matrix")),m=i(require("../../type/fraction/function/fraction")),s=i(require("../../type/number")),b=o("pow",{"number, number":c,"Complex, Complex":function(r,e){return r.pow(e)},"BigNumber, BigNumber":function(r,e){return e.isInteger()||r>=0||n.predictable?r.pow(e):new t.Complex(r.toNumber(),0).pow(e.toNumber(),0)},"Fraction, Fraction":function(r,e){if(1!==e.d){if(n.predictable)throw new Error("Function pow does not support non-integer exponents for fractions.");return c(r.valueOf(),e.valueOf())}return r.pow(e)},"Array, number":l,"Array, BigNumber":function(r,e){return l(r,e.toNumber())},"Matrix, number":w,"Matrix, BigNumber":function(r,e){return w(r,e.toNumber())},"Unit, number | BigNumber":function(r,e){return r.pow(e)}});function c(e,i){if(n.predictable&&!r(i)&&e<0)try{var o=m(i),u=s(o);if((i===u||Math.abs((i-u)/i)<1e-14)&&o.d%2==1)return(o.n%2==0?1:-1)*Math.pow(-e,i)}catch(a){}return e*e<1&&i===1/0||e*e>1&&i===-1/0?0:n.predictable&&(e<-1&&i===1/0||e>-1&&e<0&&i===-1/0)?NaN:r(i)||e>=0||n.predictable?Math.pow(e,i):new t.Complex(e,0).pow(i,0)}function l(t,n){if(!r(n)||n<0)throw new TypeError("For A^b, b must be a positive integer (value is "+n+")");var i=e(t);if(2!==i.length)throw new Error("For A^b, A must be 2 dimensional (A has "+i.length+" dimensions)");if(i[0]!==i[1])throw new Error("For A^b, A must be square (size is "+i[0]+"x"+i[1]+")");for(var o=a(i[0]).valueOf(),u=t;n>=1;)1==(1&n)&&(o=p(u,o)),n>>=1,u=p(u,u);return o}function w(r,e){return f(l(r.valueOf(),e))}return b.toTex={2:"\\left(${args[0]}\\right)".concat(u.operators.pow,"{${args[1]}}")},b}exports.name="pow",exports.factory=t;
},{"../../utils/number":"uqMu","../../utils/array":"j2lF","../../utils/latex":"H1Mr","../matrix/identity":"zJUT","./multiply":"k7By","../../type/matrix/function/matrix":"vzj5","../../type/fraction/function/fraction":"CouR","../../type/number":"lESm"}],"K5X1":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function t(t,n,e,a){var u=a("abs",{number:Math.abs,Complex:function(r){return r.abs()},BigNumber:function(r){return r.abs()},Fraction:function(r){return r.abs()},"Array | Matrix":function(t){return r(t,u,!0)},Unit:function(r){return r.abs()}});return u.toTex={1:"\\left|${args[0]}\\right|"},u}exports.name="abs",exports.factory=t;
},{"../../utils/collection/deepMap":"lOYo"}],"BAjv":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").isInteger,e=require("../../utils/array").resize;function t(t,n,i,u){var a=i(require("../../type/matrix/function/matrix")),o=u("zeros",{"":function(){return"Array"===n.matrix?f([]):f([],"default")},"...number | BigNumber | string":function(r){if("string"==typeof r[r.length-1]){var e=r.pop();return f(r,e)}return"Array"===n.matrix?f(r):f(r,"default")},Array:f,Matrix:function(r){var e=r.storage();return f(r.valueOf(),e)},"Array | Matrix, string":function(r,e){return f(r.valueOf(),e)}});return o.toTex=void 0,o;function f(n,i){var u=function(r){var e=!1;return r.forEach(function(r,n,i){t.isBigNumber(r)&&(e=!0,i[n]=r.toNumber())}),e}(n)?new t.BigNumber(0):0;if(function(e){e.forEach(function(e){if("number"!=typeof e||!r(e)||e<0)throw new Error("Parameters in function zeros must be positive integers")})}(n),i){var o=a(i);return n.length>0?o.resize(n,u):o}var f=[];return n.length>0?e(f,n,u):f}}exports.name="zeros",exports.factory=t;
},{"../../utils/number":"uqMu","../../utils/array":"j2lF","../../type/matrix/function/matrix":"vzj5"}],"f25u":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").isInteger,e=require("../../utils/number").toFixed,n=require("../../utils/collection/deepMap"),t="Number of decimals in function round must be an integer";function u(e,u,o,m){var a=o(require("../../type/matrix/function/matrix")),c=o(require("../relational/equalScalar")),f=o(require("../matrix/zeros")),l=o(require("../../type/matrix/utils/algorithm11")),b=o(require("../../type/matrix/utils/algorithm12")),s=o(require("../../type/matrix/utils/algorithm14")),g=m("round",{number:function(r){return i(r,0)},"number, number":function(e,n){if(!r(n))throw new TypeError(t);if(n<0||n>15)throw new Error("Number of decimals in function round must be in te range of 0-15");return i(e,n)},Complex:function(r){return r.round()},"Complex, number":function(r,e){if(e%1)throw new TypeError(t);return r.round(e)},"Complex, BigNumber":function(r,e){if(!e.isInteger())throw new TypeError(t);var n=e.toNumber();return r.round(n)},"number, BigNumber":function(r,n){if(!n.isInteger())throw new TypeError(t);return new e.BigNumber(r).toDecimalPlaces(n.toNumber())},BigNumber:function(r){return r.toDecimalPlaces(0)},"BigNumber, BigNumber":function(r,e){if(!e.isInteger())throw new TypeError(t);return r.toDecimalPlaces(e.toNumber())},Fraction:function(r){return r.round()},"Fraction, number":function(r,e){if(e%1)throw new TypeError(t);return r.round(e)},"Array | Matrix":function(r){return n(r,g,!0)},"SparseMatrix, number | BigNumber":function(r,e){return l(r,e,g,!1)},"DenseMatrix, number | BigNumber":function(r,e){return s(r,e,g,!1)},"number | Complex | BigNumber, SparseMatrix":function(r,e){return c(r,0)?f(e.size(),e.storage()):b(e,r,g,!0)},"number | Complex | BigNumber, DenseMatrix":function(r,e){return c(r,0)?f(e.size(),e.storage()):s(e,r,g,!0)},"Array, number | BigNumber":function(r,e){return s(a(r),e,g,!1).valueOf()},"number | Complex | BigNumber, Array":function(r,e){return s(a(e),r,g,!0).valueOf()}});return g.toTex={1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},g}function i(r,n){return parseFloat(e(r,n))}exports.name="round",exports.factory=u;
},{"../../utils/number":"uqMu","../../utils/collection/deepMap":"lOYo","../../type/matrix/function/matrix":"vzj5","../relational/equalScalar":"QvIw","../matrix/zeros":"BAjv","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm14":"S2eB"}],"CkRk":[function(require,module,exports) {
"use strict";var e=require("../../utils/collection/deepMap"),r=require("../../utils/number").nearlyEqual,i=require("../../utils/bignumber/nearlyEqual");function n(n,t,u,l){var c=u(require("../../function/arithmetic/round")),o=l("ceil",{number:function(e){return r(e,c(e),t.epsilon)?c(e):Math.ceil(e)},Complex:function(e){return e.ceil()},BigNumber:function(e){return i(e,c(e),t.epsilon)?c(e):e.ceil()},Fraction:function(e){return e.ceil()},"Array | Matrix":function(r){return e(r,o,!0)}});return o.toTex={1:"\\left\\lceil${args[0]}\\right\\rceil"},o}exports.name="ceil",exports.factory=n;
},{"../../utils/collection/deepMap":"lOYo","../../utils/number":"uqMu","../../utils/bignumber/nearlyEqual":"Uu9K","../../function/arithmetic/round":"f25u"}],"Wigz":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap"),o=require("../../utils/number").nearlyEqual,e=require("../../utils/bignumber/nearlyEqual");function n(n,t,u,i){var l=u(require("../../function/arithmetic/round")),f=i("floor",{number:function(r){return o(r,l(r),t.epsilon)?l(r):Math.floor(r)},Complex:function(r){return r.floor()},BigNumber:function(r){return e(r,l(r),t.epsilon)?l(r):r.floor()},Fraction:function(r){return r.floor()},"Array | Matrix":function(o){return r(o,f,!0)}});return f.toTex={1:"\\left\\lfloor${args[0]}\\right\\rfloor"},f}exports.name="floor",exports.factory=n;
},{"../../utils/collection/deepMap":"lOYo","../../utils/number":"uqMu","../../utils/bignumber/nearlyEqual":"Uu9K","../../function/arithmetic/round":"f25u"}],"Pk2X":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function e(e,t,i,n){var o=i(require("../../function/arithmetic/ceil")),u=i(require("../../function/arithmetic/floor")),c=n("fix",{number:function(r){return r>0?u(r):o(r)},Complex:function(r){return new e.Complex(r.re>0?Math.floor(r.re):Math.ceil(r.re),r.im>0?Math.floor(r.im):Math.ceil(r.im))},BigNumber:function(r){return r.isNegative()?o(r):u(r)},Fraction:function(r){return r.s<0?r.ceil():r.floor()},"Array | Matrix":function(e){return r(e,c,!0)}});return c.toTex={1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},c}exports.name="fix",exports.factory=e;
},{"../../utils/collection/deepMap":"lOYo","../../function/arithmetic/ceil":"CkRk","../../function/arithmetic/floor":"Wigz"}],"IviB":[function(require,module,exports) {
"use strict";function r(r,t,e,n){var a=e(require("../../type/matrix/function/matrix")),i=e(require("./equalScalar")),u=e(require("../../type/matrix/utils/algorithm03")),o=e(require("../../type/matrix/utils/algorithm07")),l=e(require("../../type/matrix/utils/algorithm12")),s=e(require("../../type/matrix/utils/algorithm13")),x=e(require("../../type/matrix/utils/algorithm14")),c=require("../../utils/latex"),f=n("equal",{"any, any":function(r,t){return null===r?null===t:null===t?null===r:void 0===r?void 0===t:void 0===t?void 0===r:i(r,t)},"SparseMatrix, SparseMatrix":function(r,t){return o(r,t,i)},"SparseMatrix, DenseMatrix":function(r,t){return u(t,r,i,!0)},"DenseMatrix, SparseMatrix":function(r,t){return u(r,t,i,!1)},"DenseMatrix, DenseMatrix":function(r,t){return s(r,t,i)},"Array, Array":function(r,t){return f(a(r),a(t)).valueOf()},"Array, Matrix":function(r,t){return f(a(r),t)},"Matrix, Array":function(r,t){return f(r,a(t))},"SparseMatrix, any":function(r,t){return l(r,t,i,!1)},"DenseMatrix, any":function(r,t){return x(r,t,i,!1)},"any, SparseMatrix":function(r,t){return l(t,r,i,!0)},"any, DenseMatrix":function(r,t){return x(t,r,i,!0)},"Array, any":function(r,t){return x(a(r),t,i,!1).valueOf()},"any, Array":function(r,t){return x(a(t),r,i,!0).valueOf()}});return f.toTex={2:"\\left(${args[0]}".concat(c.operators.equal,"${args[1]}\\right)")},f}exports.name="equal",exports.factory=r;
},{"../../type/matrix/function/matrix":"vzj5","./equalScalar":"QvIw","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm07":"u44a","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB","../../utils/latex":"H1Mr"}],"Rv38":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function e(e,n,t,i){var u=i("isNumeric",{"number | BigNumber | Fraction | boolean":function(){return!0},"Complex | Unit | string | null | undefined | Node":function(){return!1},"Array | Matrix":function(e){return r(e,u)}});return u}exports.name="isNumeric",exports.factory=e;
},{"../../utils/collection/deepMap":"lOYo"}],"A04Q":[function(require,module,exports) {
"use strict";var r=require("../../utils/string");function t(t,o,a,e){var n=e("format",{any:r.format,"any, Object | function | number":r.format});return n.toTex=void 0,n}exports.name="format",exports.factory=t;
},{"../../utils/string":"PshC"}],"zikE":[function(require,module,exports) {
"use strict";function e(i){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(i)}function i(n){return(i="function"==typeof Symbol&&"symbol"===e(Symbol.iterator)?function(i){return e(i)}:function(i){return i&&"function"==typeof Symbol&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":e(i)})(n)}function n(){return(n=Object.assign||function(e){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}var a=require("../../utils/string").endsWith,t=require("../../utils/object").clone,s=require("../../utils/bignumber/constants");function r(e,r,f,o,u){var l,m,c,p=f(require("../../function/arithmetic/addScalar")),v=f(require("../../function/arithmetic/subtract")),E=f(require("../../function/arithmetic/multiplyScalar")),N=f(require("../../function/arithmetic/divideScalar")),h=f(require("../../function/arithmetic/pow")),O=f(require("../../function/arithmetic/abs")),b=f(require("../../function/arithmetic/fix")),x=f(require("../../function/arithmetic/round")),d=f(require("../../function/relational/equal")),T=f(require("../../function/utils/isNumeric")),S=f(require("../../function/string/format")),R=f(require("../../function/utils/typeof")),g=f(require("../../type/number")),y=f(require("../../type/complex/Complex"));function C(i,n){if(!(this instanceof C))throw new Error("Constructor must be called with the new operator");if(null!=i&&!T(i)&&!e.isComplex(i))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(void 0!==n&&("string"!=typeof n||""===n))throw new TypeError("Second parameter in Unit constructor must be a string");if(void 0!==n){var a=C.parse(n);this.units=a.units,this.dimensions=a.dimensions}else{this.units=[{unit:q,prefix:P.NONE,power:0}],this.dimensions=[];for(var t=0;t<k.length;t++)this.dimensions[t]=0}this.value=null!=i?this._normalize(i):null,this.fixPrefix=!1,this.skipAutomaticSimplification=!0}function U(){for(;" "===c||"\t"===c;)M()}function w(e){return e>="0"&&e<="9"}function M(){m++,c=l.charAt(m)}function A(e){m=e,c=l.charAt(m)}function L(){var e,i="";if(e=m,"+"===c?M():"-"===c&&(i+=c,M()),!function(e){return e>="0"&&e<="9"||"."===e}(c))return A(e),null;if("."===c){if(i+=c,M(),!w(c))return A(e),null}else{for(;w(c);)i+=c,M();"."===c&&(i+=c,M())}for(;w(c);)i+=c,M();if("E"===c||"e"===c){var n="",a=m;if(n+=c,M(),"+"!==c&&"-"!==c||(n+=c,M()),!w(c))return A(a),i;for(i+=n;w(c);)i+=c,M()}return i}function I(){for(var e="",i=l.charCodeAt(m);i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122;)e+=c,M(),i=l.charCodeAt(m);return((i=e.charCodeAt(0))>=65&&i<=90||i>=97&&i<=122)&&e||null}function H(e){return c===e?(M(),e):null}function G(e){if(V.hasOwnProperty(e)){var i=V[e];return{unit:i,prefix:i.prefixes[""]}}for(var n in V)if(V.hasOwnProperty(n)&&a(e,n)){var t=V[n],s=e.length-n.length,r=e.substring(0,s),f=t.prefixes.hasOwnProperty(r)?t.prefixes[r]:void 0;if(void 0!==f)return{unit:t,prefix:f}}return null}function _(e){return e.equalBase(F.NONE)&&null!==e.value&&!r.predictable?e.value:e}C.prototype.type="Unit",C.prototype.isUnit=!0,C.parse=function(i,n){if(n=n||{},m=-1,c="","string"!=typeof(l=i))throw new TypeError("Invalid argument in Unit.parse, string expected");var a=new C;a.units=[];var t=1,s=!1;M(),U();var f=L(),o=null;f&&(o="BigNumber"===r.number?new e.BigNumber(f):"Fraction"===r.number?new e.Fraction(f):parseFloat(f),U(),H("*")?(t=1,s=!0):H("/")&&(t=-1,s=!0));for(var u=[],p=1;;){for(U();"("===c;)u.push(t),p*=t,t=1,M(),U();var v=void 0;if(!c)break;var E=c;if(null===(v=I()))throw new SyntaxError('Unexpected "'+E+'" in "'+l+'" at index '+m.toString());var N=G(v);if(null===N)throw new SyntaxError('Unit "'+v+'" not found.');var h=t*p;if(U(),H("^")){U();var O=L();if(null===O)throw new SyntaxError('In "'+i+'", "^" must be followed by a floating-point number');h*=O}a.units.push({unit:N.unit,prefix:N.prefix,po
},{"../../utils/string":"PshC","../../utils/object":"FcSp","../../utils/bignumber/constants":"JQPe","../../function/arithmetic/addScalar":"ZM3O","../../function/arithmetic/subtract":"m78R","../../function/arithmetic/multiplyScalar":"obRw","../../function/arithmetic/divideScalar":"R3aq","../../function/arithmetic/pow":"CsUv","../../function/arithmetic/abs":"K5X1","../../function/arithmetic/fix":"Pk2X","../../function/arithmetic/round":"f25u","../../function/relational/equal":"IviB","../../function/utils/isNumeric":"Rv38","../../function/string/format":"A04Q","../../function/utils/typeof":"LZTG","../../type/number":"lESm","../../type/complex/Complex":"dh9O"}],"plO6":[function(require,module,exports) {
"use strict";var t=require("../../../utils/collection/deepMap");function n(n,r,e,i){var u=i("unit",{Unit:function(t){return t.clone()},string:function(t){return n.Unit.isValuelessUnit(t)?new n.Unit(null,t):n.Unit.parse(t,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string":function(t,r){return new n.Unit(t,r)},"Array | Matrix":function(n){return t(n,u)}});return u.toTex={1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},u}exports.name="unit",exports.factory=n;
},{"../../../utils/collection/deepMap":"lOYo"}],"uOlB":[function(require,module,exports) {
"use strict";function t(t,n,r,e){return e("createUnit",{"Object, Object":function(n,r){return t.Unit.createUnit(n,r)},Object:function(n){return t.Unit.createUnit(n,{})},"string, Unit | string | Object, Object":function(n,r,e){var i={};return i[n]=r,t.Unit.createUnit(i,e)},"string, Unit | string | Object":function(n,r){var e={};return e[n]=r,t.Unit.createUnit(e,{})},string:function(n){var r={};return r[n]={},t.Unit.createUnit(r,{})}})}exports.name="createUnit",exports.factory=t;
},{}],"PBZa":[function(require,module,exports) {
"use strict";function t(t,n,i,r){return r("splitUnit",{"Unit, Array":function(t,n){return t.splitUnit(n)}})}exports.name="splitUnit",exports.factory=t;
},{}],"OfMK":[function(require,module,exports) {
"use strict";var n=require("../../utils/object").lazy;function t(n,t,e,u,o){function i(t){var r=n.Unit.parse(t);return r.fixPrefix=!0,r}r(o,"speedOfLight",function(){return i("299792458 m s^-1")}),r(o,"gravitationConstant",function(){return i("6.6738480e-11 m^3 kg^-1 s^-2")}),r(o,"planckConstant",function(){return i("6.626069311e-34 J s")}),r(o,"reducedPlanckConstant",function(){return i("1.05457172647e-34 J s")}),r(o,"magneticConstant",function(){return i("1.2566370614e-6 N A^-2")}),r(o,"electricConstant",function(){return i("8.854187817e-12 F m^-1")}),r(o,"vacuumImpedance",function(){return i("376.730313461 ohm")}),r(o,"coulomb",function(){return i("8.9875517873681764e9 N m^2 C^-2")}),r(o,"elementaryCharge",function(){return i("1.60217656535e-19 C")}),r(o,"bohrMagneton",function(){return i("9.2740096820e-24 J T^-1")}),r(o,"conductanceQuantum",function(){return i("7.748091734625e-5 S")}),r(o,"inverseConductanceQuantum",function(){return i("12906.403721742 ohm")}),r(o,"magneticFluxQuantum",function(){return i("2.06783375846e-15 Wb")}),r(o,"nuclearMagneton",function(){return i("5.0507835311e-27 J T^-1")}),r(o,"klitzing",function(){return i("25812.807443484 ohm")}),r(o,"bohrRadius",function(){return i("5.291772109217e-11 m")}),r(o,"classicalElectronRadius",function(){return i("2.817940326727e-15 m")}),r(o,"electronMass",function(){return i("9.1093829140e-31 kg")}),r(o,"fermiCoupling",function(){return i("1.1663645e-5 GeV^-2")}),r(o,"fineStructure",function(){return.007297352569824}),r(o,"hartreeEnergy",function(){return i("4.3597443419e-18 J")}),r(o,"protonMass",function(){return i("1.67262177774e-27 kg")}),r(o,"deuteronMass",function(){return i("3.3435830926e-27 kg")}),r(o,"neutronMass",function(){return i("1.6749271613e-27 kg")}),r(o,"quantumOfCirculation",function(){return i("3.636947552024e-4 m^2 s^-1")}),r(o,"rydberg",function(){return i("10973731.56853955 m^-1")}),r(o,"thomsonCrossSection",function(){return i("6.65245873413e-29 m^2")}),r(o,"weakMixingAngle",function(){return.222321}),r(o,"efimovFactor",function(){return 22.7}),r(o,"atomicMass",function(){return i("1.66053892173e-27 kg")}),r(o,"avogadro",function(){return i("6.0221412927e23 mol^-1")}),r(o,"boltzmann",function(){return i("1.380648813e-23 J K^-1")}),r(o,"faraday",function(){return i("96485.336521 C mol^-1")}),r(o,"firstRadiation",function(){return i("3.7417715317e-16 W m^2")}),r(o,"loschmidt",function(){return i("2.686780524e25 m^-3")}),r(o,"gasConstant",function(){return i("8.314462175 J K^-1 mol^-1")}),r(o,"molarPlanckConstant",function(){return i("3.990312717628e-10 J s mol^-1")}),r(o,"molarVolume",function(){return i("2.241396820e-10 m^3 mol^-1")}),r(o,"sackurTetrode",function(){return-1.164870823}),r(o,"secondRadiation",function(){return i("1.438777013e-2 m K")}),r(o,"stefanBoltzmann",function(){return i("5.67037321e-8 W m^-2 K^-4")}),r(o,"wienDisplacement",function(){return i("2.897772126e-3 m K")}),r(o,"molarMass",function(){return i("1e-3 kg mol^-1")}),r(o,"molarMassC12",function(){return i("1.2e-2 kg mol^-1")}),r(o,"gravity",function(){return i("9.80665 m s^-2")}),r(o,"planckLength",function(){return i("1.61619997e-35 m")}),r(o,"planckMass",function(){return i("2.1765113e-8 kg")}),r(o,"planckTime",function(){return i("5.3910632e-44 s")}),r(o,"planckCharge",function(){return i("1.87554595641e-18 C")}),r(o,"planckTemperature",function(){return i("1.41683385e+32 K")})}function r(t,r,e){n(t,r,e),n(t.expression.mathWithTransform,r,e)}exports.factory=t,exports.lazy=!1,exports.math=!0;
},{"../../utils/object":"FcSp"}],"NhzN":[function(require,module,exports) {
"use strict";module.exports=[require("./Unit"),require("./function/unit"),require("./function/createUnit"),require("./function/splitUnit"),require("./physicalConstants")];
},{"./Unit":"zikE","./function/unit":"plO6","./function/createUnit":"uOlB","./function/splitUnit":"PBZa","./physicalConstants":"OfMK"}],"And3":[function(require,module,exports) {
"use strict";module.exports=[require("./bignumber"),require("./boolean"),require("./chain"),require("./complex"),require("./fraction"),require("./matrix"),require("./number"),require("./numeric"),require("./resultset"),require("./string"),require("./unit")];
},{"./bignumber":"glkd","./boolean":"ff5w","./chain":"YdmQ","./complex":"Oad0","./fraction":"sfyz","./matrix":"Xhzw","./number":"lESm","./numeric":"aA7E","./resultset":"seRb","./string":"QilD","./unit":"NhzN"}],"gliU":[function(require,module,exports) {
"use strict";module.exports="5.10.3";
},{}],"GTWZ":[function(require,module,exports) {
"use strict";var n=require("./utils/object"),e=require("./utils/bignumber/constants");function i(n,u,o,a,N){N.on("config",function(e,r){e.number!==r.number&&i(n,u,o,a,N)}),r(N,"true",!0),r(N,"false",!1),r(N,"null",null),r(N,"uninitialized","Error: Constant uninitialized is removed since v4.0.0. Use null instead"),"BigNumber"===u.number?(r(N,"Infinity",new n.BigNumber(1/0)),r(N,"NaN",new n.BigNumber(NaN)),t(N,"pi",function(){return e.pi(n.BigNumber)}),t(N,"tau",function(){return e.tau(n.BigNumber)}),t(N,"e",function(){return e.e(n.BigNumber)}),t(N,"phi",function(){return e.phi(n.BigNumber)}),t(N,"E",function(){return N.e}),t(N,"LN2",function(){return new n.BigNumber(2).ln()}),t(N,"LN10",function(){return new n.BigNumber(10).ln()}),t(N,"LOG2E",function(){return new n.BigNumber(1).div(new n.BigNumber(2).ln())}),t(N,"LOG10E",function(){return new n.BigNumber(1).div(new n.BigNumber(10).ln())}),t(N,"PI",function(){return N.pi}),t(N,"SQRT1_2",function(){return new n.BigNumber("0.5").sqrt()}),t(N,"SQRT2",function(){return new n.BigNumber(2).sqrt()})):(r(N,"Infinity",1/0),r(N,"NaN",NaN),r(N,"pi",Math.PI),r(N,"tau",2*Math.PI),r(N,"e",Math.E),r(N,"phi",1.618033988749895),r(N,"E",N.e),r(N,"LN2",Math.LN2),r(N,"LN10",Math.LN10),r(N,"LOG2E",Math.LOG2E),r(N,"LOG10E",Math.LOG10E),r(N,"PI",N.pi),r(N,"SQRT1_2",Math.SQRT1_2),r(N,"SQRT2",Math.SQRT2)),n.Complex&&r(N,"i",n.Complex.I),r(N,"version",require("./version"))}function r(n,e,i){n[e]=i,n.expression.mathWithTransform[e]=i}function t(e,i,r){n.lazy(e,i,r),n.lazy(e.expression.mathWithTransform,i,r)}exports.factory=i,exports.lazy=!1,exports.math=!0;
},{"./utils/object":"FcSp","./utils/bignumber/constants":"JQPe","./version":"gliU"}],"PAPk":[function(require,module,exports) {
"use strict";function t(o){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(o)}function o(r){return(o="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?function(o){return t(o)}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":t(o)})(r)}var r=require("./object").hasOwnProperty;function e(t,o){if(p(t)&&c(t,o))return t[o];if("function"==typeof t[o]&&f(t,o))throw new Error('Cannot access method "'+o+'" as a property');throw new Error('No access to property "'+o+'"')}function n(t,o,r){if(p(t)&&c(t,o))return t[o]=r,r;throw new Error('No access to property "'+o+'"')}function c(t,e){return!(!t||"object"!==o(t))&&(!!r(y,e)||!(e in Object.prototype)&&!(e in Function.prototype))}function i(t,o){if(!f(t,o))throw new Error('No access to method "'+o+'"')}function f(t,o){return!(!t||"function"!=typeof t[o])&&(!(r(t,o)&&Object.getPrototypeOf&&o in Object.getPrototypeOf(t))&&(!!r(u,o)||!(o in Object.prototype)&&!(o in Function.prototype)))}function p(t){return"object"===o(t)&&t&&t.constructor===Object}var y={length:!0,name:!0},u={toString:!0,valueOf:!0,toLocaleString:!0};exports.getSafeProperty=e,exports.setSafeProperty=n,exports.isSafeProperty=c,exports.validateSafeMethod=i,exports.isSafeMethod=f,exports.isPlainObject=p;
},{"./object":"FcSp"}],"psm5":[function(require,module,exports) {
"use strict";module.exports={end:!0};
},{}],"dnbo":[function(require,module,exports) {
"use strict";function t(o){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(o)}function o(e){return(o="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?function(o){return t(o)}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":t(o)})(e)}var e=require("../keywords"),r=require("../../utils/object").deepEqual,n=require("../../utils/object").hasOwnProperty;function i(t,i,c,p,u){function a(){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator")}return a.prototype.eval=function(t){return this.compile().eval(t)},a.prototype.type="Node",a.prototype.isNode=!0,a.prototype.comment="",a.prototype.compile=function(){var t=this._compile(u.expression.mathWithTransform,{}),o={};return{eval:function(r){var i=r||{};return function(t){for(var o in t)if(n(t,o)&&o in e)throw new Error('Scope contains an illegal symbol, "'+o+'" is a reserved keyword')}(i),t(i,o,null)}}},a.prototype._compile=function(t,o){throw new Error("Method _compile should be implemented by type "+this.type)},a.prototype.forEach=function(t){throw new Error("Cannot run forEach on a Node interface")},a.prototype.map=function(t){throw new Error("Cannot run map on a Node interface")},a.prototype._ifNode=function(o){if(!t.isNode(o))throw new TypeError("Callback function must return a Node");return o},a.prototype.traverse=function(t){t(this,null,null),function t(o,e){o.forEach(function(o,r,n){e(o,r,n),t(o,e)})}(this,t)},a.prototype.transform=function(t){return function t(o,e){return o.map(function(o,r,n){return t(e(o,r,n),e)})}(t(this,null,null),t)},a.prototype.filter=function(t){var o=[];return this.traverse(function(e,r,n){t(e,r,n)&&o.push(e)}),o},a.prototype.find=function(){throw new Error("Function Node.find is deprecated. Use Node.filter instead.")},a.prototype.match=function(){throw new Error("Function Node.match is deprecated. See functions Node.filter, Node.transform, Node.traverse.")},a.prototype.clone=function(){throw new Error("Cannot clone a Node interface")},a.prototype.cloneDeep=function(){return this.map(function(t){return t.cloneDeep()})},a.prototype.equals=function(t){return!!t&&r(this,t)},a.prototype.toString=function(t){var e;if(t&&"object"===o(t))switch(o(t.handler)){case"object":case"undefined":break;case"function":e=t.handler(this,t);break;default:throw new TypeError("Object or function expected as callback")}return void 0!==e?e:this._toString(t)},a.prototype.toJSON=function(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)},a.prototype.toHTML=function(t){var e;if(t&&"object"===o(t))switch(o(t.handler)){case"object":case"undefined":break;case"function":e=t.handler(this,t);break;default:throw new TypeError("Object or function expected as callback")}return void 0!==e?e:this.toHTML(t)},a.prototype._toString=function(){throw new Error("_toString not implemented for "+this.type)},a.prototype.toTex=function(t){var e;if(t&&"object"===o(t))switch(o(t.handler)){case"object":case"undefined":break;case"function":e=t.handler(this,t);break;default:throw new TypeError("Object or function expected as callback")}return void 0!==e?e:this._toTex(t)},a.prototype._toTex=function(t){throw new Error("_toTex not implemented for "+this.type)},a.prototype.getIdentifier=function(){return this.type},a.prototype.getContent=function(){return this},a}exports.name="Node",exports.path="expression.node",exports.math=!0,exports.factory=i;
},{"../keywords":"psm5","../../utils/object":"FcSp"}],"Bjol":[function(require,module,exports) {
"use strict";var r=require("../../error/IndexError");exports.transform=function(e){return e&&e.isIndexError?new r(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0):e};
},{"../../error/IndexError":"tfOV"}],"ZWbZ":[function(require,module,exports) {
"use strict";var e=require("../../utils/object").clone,r=require("../../utils/array").validateIndex,n=require("../../utils/customs").getSafeProperty,t=require("../../utils/customs").setSafeProperty,i=require("../../error/DimensionError");function o(n,t,o,u){var f=o(require("../../type/matrix/function/matrix")),c=u("subset",{"Array, Index":function(e,r){var n=f(e).subset(r);return r.isScalar()?n:n.valueOf()},"Matrix, Index":function(e,r){return e.subset(r)},"Object, Index":s,"string, Index":function(e,t){if(!n.isIndex(t))throw new TypeError("Index expected");if(1!==t.size().length)throw new i(t.size().length,1);var o=e.length;r(t.min()[0],o),r(t.max()[0],o);var s=t.dimension(0),a="";return s.forEach(function(r){a+=e.charAt(r)}),a},"Array, Index, any":function(r,n,t){return f(e(r)).subset(n,t,void 0).valueOf()},"Array, Index, any, any":function(r,n,t,i){return f(e(r)).subset(n,t,i).valueOf()},"Matrix, Index, any":function(e,r,n){return e.clone().subset(r,n)},"Matrix, Index, any, any":function(e,r,n,t){return e.clone().subset(r,n,t)},"string, Index, string":x,"string, Index, string, string":x,"Object, Index, any":a});return c.toTex=void 0,c;function x(e,n,t,o){if(!n||!0!==n.isIndex)throw new TypeError("Index expected");if(1!==n.size().length)throw new i(n.size().length,1);if(void 0!==o){if("string"!=typeof o||1!==o.length)throw new TypeError("Single character expected as defaultValue")}else o=" ";var s=n.dimension(0);if(s.size()[0]!==t.length)throw new i(s.size()[0],t.length);var a=e.length;r(n.min()[0]),r(n.max()[0]);for(var u=[],f=0;f<a;f++)u[f]=e.charAt(f);if(s.forEach(function(e,r){u[e]=t.charAt(r[0])}),u.length>a)for(var c=a-1,x=u.length;c<x;c++)u[c]||(u[c]=o);return u.join("")}}function s(e,r){if(1!==r.size().length)throw new i(r.size(),1);var t=r.dimension(0);if("string"!=typeof t)throw new TypeError("String expected as index to retrieve an object property");return n(e,t)}function a(r,n,o){if(1!==n.size().length)throw new i(n.size(),1);var s=n.dimension(0);if("string"!=typeof s)throw new TypeError("String expected as index to retrieve an object property");var a=e(r);return t(a,s,o),a}exports.name="subset",exports.factory=o;
},{"../../utils/object":"FcSp","../../utils/array":"j2lF","../../utils/customs":"PAPk","../../error/DimensionError":"YiAw","../../type/matrix/function/matrix":"vzj5"}],"oT9r":[function(require,module,exports) {
"use strict";function t(r){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(r)}function r(o){return(r="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?function(r){return t(r)}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":t(r)})(o)}var o=require("../../transform/error.transform").transform,e=require("../../../utils/customs").getSafeProperty;function n(t,n,u,y){var f=u(require("../../../function/matrix/subset"));return function(t,n){try{if(Array.isArray(t))return f(t,n);if(t&&"function"==typeof t.subset)return t.subset(n);if("string"==typeof t)return f(t,n);if("object"===r(t)){if(!n.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return e(t,n.getObjectProperty())}throw new TypeError("Cannot apply index: unsupported type of object")}catch(u){throw o(u)}}}exports.factory=n;
},{"../../transform/error.transform":"Bjol","../../../utils/customs":"PAPk","../../../function/matrix/subset":"ZWbZ"}],"vZNf":[function(require,module,exports) {
"use strict";var t=require("../../utils/customs").getSafeProperty;function e(e,o,r,i){var n=r(require("./Node")),s=r(require("./utils/access"));function c(t,o){if(!(this instanceof c))throw new SyntaxError("Constructor must be called with the new operator");if(!e.isNode(t))throw new TypeError('Node expected for parameter "object"');if(!e.isIndexNode(o))throw new TypeError('IndexNode expected for parameter "index"');this.object=t||null,this.index=o,Object.defineProperty(this,"name",{get:function(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}function h(t){return!(e.isAccessorNode(t)||e.isArrayNode(t)||e.isConstantNode(t)||e.isFunctionNode(t)||e.isObjectNode(t)||e.isParenthesisNode(t)||e.isSymbolNode(t))}return c.prototype=new n,c.prototype.type="AccessorNode",c.prototype.isAccessorNode=!0,c.prototype._compile=function(e,o){var r=this.object._compile(e,o),i=this.index._compile(e,o);if(this.index.isObjectProperty()){var n=this.index.getObjectProperty();return function(e,o,i){return t(r(e,o,i),n)}}return function(t,e,o){var n=r(t,e,o),c=i(t,e,n);return s(n,c)}},c.prototype.forEach=function(t){t(this.object,"object",this),t(this.index,"index",this)},c.prototype.map=function(t){return new c(this._ifNode(t(this.object,"object",this)),this._ifNode(t(this.index,"index",this)))},c.prototype.clone=function(){return new c(this.object,this.index)},c.prototype._toString=function(t){var e=this.object.toString(t);return h(this.object)&&(e="("+e+")"),e+this.index.toString(t)},c.prototype.toHTML=function(t){var e=this.object.toHTML(t);return h(this.object)&&(e='<span class="math-parenthesis math-round-parenthesis">(</span>'+e+'<span class="math-parenthesis math-round-parenthesis">)</span>'),e+this.index.toHTML(t)},c.prototype._toTex=function(t){var e=this.object.toTex(t);return h(this.object)&&(e="\\left(' + object + '\\right)"),e+this.index.toTex(t)},c.prototype.toJSON=function(){return{mathjs:"AccessorNode",object:this.object,index:this.index}},c.fromJSON=function(t){return new c(t.object,t.index)},c}exports.name="AccessorNode",exports.path="expression.node",exports.factory=e;
},{"../../utils/customs":"PAPk","./Node":"dnbo","./utils/access":"oT9r"}],"onTs":[function(require,module,exports) {
"use strict";var t=require("../../utils/array").map;function r(r,e,n,i){var o=n(require("./Node"));function s(t){if(!(this instanceof s))throw new SyntaxError("Constructor must be called with the new operator");if(this.items=t||[],!Array.isArray(this.items)||!this.items.every(r.isNode))throw new TypeError("Array containing Nodes expected");var e=function(){throw new Error("Property `ArrayNode.nodes` is deprecated, use `ArrayNode.items` instead")};Object.defineProperty(this,"nodes",{get:e,set:e})}return s.prototype=new o,s.prototype.type="ArrayNode",s.prototype.isArrayNode=!0,s.prototype._compile=function(r,e){var n=t(this.items,function(t){return t._compile(r,e)});if("Array"!==r.config().matrix){var i=r.matrix;return function(r,e,o){return i(t(n,function(t){return t(r,e,o)}))}}return function(r,e,i){return t(n,function(t){return t(r,e,i)})}},s.prototype.forEach=function(t){for(var r=0;r<this.items.length;r++){t(this.items[r],"items["+r+"]",this)}},s.prototype.map=function(t){for(var r=[],e=0;e<this.items.length;e++)r[e]=this._ifNode(t(this.items[e],"items["+e+"]",this));return new s(r)},s.prototype.clone=function(){return new s(this.items.slice(0))},s.prototype._toString=function(t){return"["+this.items.map(function(r){return r.toString(t)}).join(", ")+"]"},s.prototype.toJSON=function(){return{mathjs:"ArrayNode",items:this.items}},s.fromJSON=function(t){return new s(t.items)},s.prototype.toHTML=function(t){return'<span class="math-parenthesis math-square-parenthesis">[</span>'+this.items.map(function(r){return r.toHTML(t)}).join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'},s.prototype._toTex=function(t){var r="\\begin{bmatrix}";return this.items.forEach(function(e){e.items?r+=e.items.map(function(r){return r.toTex(t)}).join("&"):r+=e.toTex(t),r+="\\\\"}),r+="\\end{bmatrix}"},s}exports.name="ArrayNode",exports.path="expression.node",exports.factory=r;
},{"../../utils/array":"j2lF","./Node":"dnbo"}],"ft5y":[function(require,module,exports) {
"use strict";function t(r){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(r)}function r(o){return(r="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?function(r){return t(r)}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":t(r)})(o)}var o=require("../../transform/error.transform").transform,e=require("../../../utils/customs").setSafeProperty;function n(t,n,u,y){var i=u(require("../../../function/matrix/subset")),f=u(require("../../../type/matrix/function/matrix"));return function(t,n,u){try{if(Array.isArray(t))return f(t).subset(n,u).valueOf();if(t&&"function"==typeof t.subset)return t.subset(n,u);if("string"==typeof t)return i(t,n,u);if("object"===r(t)){if(!n.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return e(t,n.getObjectProperty(),u),t}throw new TypeError("Cannot apply index: unsupported type of object")}catch(y){throw o(y)}}}exports.factory=n;
},{"../../transform/error.transform":"Bjol","../../../utils/customs":"PAPk","../../../function/matrix/subset":"ZWbZ","../../../type/matrix/function/matrix":"vzj5"}],"Huid":[function(require,module,exports) {
"use strict";var t=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{associativity:"left",associativeWith:[]}},{"OperatorNode:and":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{associativity:"left",associativeWith:[]},"OperatorNode:unequal":{associativity:"left",associativeWith:[]},"OperatorNode:smaller":{associativity:"left",associativeWith:[]},"OperatorNode:larger":{associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{associativity:"left",associativeWith:[]}},{"OperatorNode:to":{associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{associativity:"left",associativeWith:[]},"OperatorNode:mod":{associativity:"left",associativeWith:[]}},{"OperatorNode:unaryPlus":{associativity:"right"},"OperatorNode:unaryMinus":{associativity:"right"},"OperatorNode:bitNot":{associativity:"right"},"OperatorNode:not":{associativity:"right"}},{"OperatorNode:pow":{associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{associativity:"left"}},{"OperatorNode:transpose":{associativity:"left"}}];function i(i,e){var a=i;"keep"!==e&&(a=i.getContent());for(var o=a.getIdentifier(),r=0;r<t.length;r++)if(o in t[r])return r;return null}function e(e,a){var o=e;"keep"!==a&&(o=e.getContent());var r=o.getIdentifier(),s=i(o,a);if(null===s)return null;var v=t[s][r];if(v.hasOwnProperty("associativity")){if("left"===v.associativity)return"left";if("right"===v.associativity)return"right";throw Error("'"+r+"' has the invalid associativity '"+v.associativity+"'.")}return null}function a(e,a,o){var r="keep"!==o?e.getContent():e,s="keep"!==o?e.getContent():a,v=r.getIdentifier(),l=s.getIdentifier(),c=i(r,o);if(null===c)return null;var d=t[c][v];if(d.hasOwnProperty("associativeWith")&&d.associativeWith instanceof Array){for(var n=0;n<d.associativeWith.length;n++)if(d.associativeWith[n]===l)return!0;return!1}return null}module.exports.properties=t,module.exports.getPrecedence=i,module.exports.getAssociativity=e,module.exports.isAssociativeWith=a;
},{}],"yw4P":[function(require,module,exports) {
"use strict";var e=require("../../utils/customs").getSafeProperty,t=require("../../utils/customs").setSafeProperty;function i(i,o,n,r){var s=n(require("./Node")),a=n(require("./utils/assign")),h=n(require("./utils/access")),c=require("../operators");function u(e,t,o){if(!(this instanceof u))throw new SyntaxError("Constructor must be called with the new operator");if(this.object=e,this.index=o?t:null,this.value=o||t,!i.isSymbolNode(e)&&!i.isAccessorNode(e))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(i.isSymbolNode(e)&&"end"===e.name)throw new Error('Cannot assign to symbol "end"');if(this.index&&!i.isIndexNode(this.index))throw new TypeError('IndexNode expected as "index"');if(!i.isNode(this.value))throw new TypeError('Node expected as "value"');Object.defineProperty(this,"name",{get:function(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}function p(e,t){t||(t="keep");var i=c.getPrecedence(e,t),o=c.getPrecedence(e.value,t);return"all"===t||null!==o&&o<=i}return u.prototype=new s,u.prototype.type="AssignmentNode",u.prototype.isAssignmentNode=!0,u.prototype._compile=function(o,n){var r=this.object._compile(o,n),s=this.index?this.index._compile(o,n):null,c=this.value._compile(o,n),u=this.object.name;if(this.index){if(this.index.isObjectProperty()){var p=this.index.getObjectProperty();return function(e,i,o){var n=r(e,i,o),s=c(e,i,o);return t(n,p,s)}}if(i.isSymbolNode(this.object))return function(e,i,o){var n=r(e,i,o),h=c(e,i,o),p=s(e,i,n);return t(e,u,a(n,p,h)),h};var d=this.object.object._compile(o,n);if(this.object.index.isObjectProperty()){var l=this.object.index.getObjectProperty();return function(i,o,n){var r=d(i,o,n),h=e(r,l),u=s(i,o,h),p=c(i,o,n);return t(r,l,a(h,u,p)),p}}var x=this.object.index._compile(o,n);return function(e,t,i){var o=d(e,t,i),n=x(e,t,o),r=h(o,n),u=s(e,t,r),p=c(e,t,i);return a(o,n,a(r,u,p)),p}}if(!i.isSymbolNode(this.object))throw new TypeError("SymbolNode expected as object");return function(e,i,o){return t(e,u,c(e,i,o))}},u.prototype.forEach=function(e){e(this.object,"object",this),this.index&&e(this.index,"index",this),e(this.value,"value",this)},u.prototype.map=function(e){return new u(this._ifNode(e(this.object,"object",this)),this.index?this._ifNode(e(this.index,"index",this)):null,this._ifNode(e(this.value,"value",this)))},u.prototype.clone=function(){return new u(this.object,this.index,this.value)},u.prototype._toString=function(e){var t=this.object.toString(e),i=this.index?this.index.toString(e):"",o=this.value.toString(e);return p(this,e&&e.parenthesis)&&(o="("+o+")"),t+i+" = "+o},u.prototype.toJSON=function(){return{mathjs:"AssignmentNode",object:this.object,index:this.index,value:this.value}},u.fromJSON=function(e){return new u(e.object,e.index,e.value)},u.prototype.toHTML=function(e){var t=this.object.toHTML(e),i=this.index?this.index.toHTML(e):"",o=this.value.toHTML(e);return p(this,e&&e.parenthesis)&&(o='<span class="math-paranthesis math-round-parenthesis">(</span>'+o+'<span class="math-paranthesis math-round-parenthesis">)</span>'),t+i+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+o},u.prototype._toTex=function(e){var t=this.object.toTex(e),i=this.index?this.index.toTex(e):"",o=this.value.toTex(e);return p(this,e&&e.parenthesis)&&(o="\\left(".concat(o,"\\right)")),t+i+":="+o},u}exports.name="AssignmentNode",exports.path="expression.node",exports.factory=i;
},{"../../utils/customs":"PAPk","./Node":"dnbo","./utils/assign":"ft5y","./utils/access":"oT9r","../operators":"Huid"}],"QBkn":[function(require,module,exports) {
"use strict";var o=require("../../utils/array").forEach,e=require("../../utils/array").map;function t(t,r,n,i){var s=n(require("./Node")),p=n(require("../../type/resultset/ResultSet"));function a(o){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if(!Array.isArray(o))throw new Error("Array expected");this.blocks=o.map(function(o){var e=o&&o.node,r=!o||void 0===o.visible||o.visible;if(!t.isNode(e))throw new TypeError('Property "node" must be a Node');if("boolean"!=typeof r)throw new TypeError('Property "visible" must be a boolean');return{node:e,visible:r}})}return a.prototype=new s,a.prototype.type="BlockNode",a.prototype.isBlockNode=!0,a.prototype._compile=function(t,r){var n=e(this.blocks,function(o){return{eval:o.node._compile(t,r),visible:o.visible}});return function(e,t,r){var i=[];return o(n,function(o){var n=o.eval(e,t,r);o.visible&&i.push(n)}),new p(i)}},a.prototype.forEach=function(o){for(var e=0;e<this.blocks.length;e++)o(this.blocks[e].node,"blocks["+e+"].node",this)},a.prototype.map=function(o){for(var e=[],t=0;t<this.blocks.length;t++){var r=this.blocks[t],n=this._ifNode(o(r.node,"blocks["+t+"].node",this));e[t]={node:n,visible:r.visible}}return new a(e)},a.prototype.clone=function(){return new a(this.blocks.map(function(o){return{node:o.node,visible:o.visible}}))},a.prototype._toString=function(o){return this.blocks.map(function(e){return e.node.toString(o)+(e.visible?"":";")}).join("\n")},a.prototype.toJSON=function(){return{mathjs:"BlockNode",blocks:this.blocks}},a.fromJSON=function(o){return new a(o.blocks)},a.prototype.toHTML=function(o){return this.blocks.map(function(e){return e.node.toHTML(o)+(e.visible?"":'<span class="math-separator">;</span>')}).join('<span class="math-separator"><br /></span>')},a.prototype._toTex=function(o){return this.blocks.map(function(e){return e.node.toTex(o)+(e.visible?"":";")}).join("\\;\\;\n")},a}exports.name="BlockNode",exports.path="expression.node",exports.factory=t;
},{"../../utils/array":"j2lF","./Node":"dnbo","../../type/resultset/ResultSet":"hpV8"}],"uzAW":[function(require,module,exports) {
"use strict";var t=require("../operators");function e(e,r,o,i){var n=o(require("./Node")),s=o(require("../../function/utils/typeof"));function p(t,r,o){if(!(this instanceof p))throw new SyntaxError("Constructor must be called with the new operator");if(!e.isNode(t))throw new TypeError("Parameter condition must be a Node");if(!e.isNode(r))throw new TypeError("Parameter trueExpr must be a Node");if(!e.isNode(o))throw new TypeError("Parameter falseExpr must be a Node");this.condition=t,this.trueExpr=r,this.falseExpr=o}return p.prototype=new n,p.prototype.type="ConditionalNode",p.prototype.isConditionalNode=!0,p.prototype._compile=function(t,r){var o=this.condition._compile(t,r),i=this.trueExpr._compile(t,r),n=this.falseExpr._compile(t,r);return function(t,r,p){return function(t){if("number"==typeof t||"boolean"==typeof t||"string"==typeof t)return!!t;if(t){if(e.isBigNumber(t))return!t.isZero();if(e.isComplex(t))return!(!t.re&&!t.im);if(e.isUnit(t))return!!t.value}if(null==t)return!1;throw new TypeError('Unsupported type of condition "'+s(t)+'"')}(o(t,r,p))?i(t,r,p):n(t,r,p)}},p.prototype.forEach=function(t){t(this.condition,"condition",this),t(this.trueExpr,"trueExpr",this),t(this.falseExpr,"falseExpr",this)},p.prototype.map=function(t){return new p(this._ifNode(t(this.condition,"condition",this)),this._ifNode(t(this.trueExpr,"trueExpr",this)),this._ifNode(t(this.falseExpr,"falseExpr",this)))},p.prototype.clone=function(){return new p(this.condition,this.trueExpr,this.falseExpr)},p.prototype._toString=function(e){var r=e&&e.parenthesis?e.parenthesis:"keep",o=t.getPrecedence(this,r),i=this.condition.toString(e),n=t.getPrecedence(this.condition,r);("all"===r||"OperatorNode"===this.condition.type||null!==n&&n<=o)&&(i="("+i+")");var s=this.trueExpr.toString(e),p=t.getPrecedence(this.trueExpr,r);("all"===r||"OperatorNode"===this.trueExpr.type||null!==p&&p<=o)&&(s="("+s+")");var a=this.falseExpr.toString(e),h=t.getPrecedence(this.falseExpr,r);return("all"===r||"OperatorNode"===this.falseExpr.type||null!==h&&h<=o)&&(a="("+a+")"),i+" ? "+s+" : "+a},p.prototype.toJSON=function(){return{mathjs:"ConditionalNode",condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}},p.fromJSON=function(t){return new p(t.condition,t.trueExpr,t.falseExpr)},p.prototype.toHTML=function(e){var r=e&&e.parenthesis?e.parenthesis:"keep",o=t.getPrecedence(this,r),i=this.condition.toHTML(e),n=t.getPrecedence(this.condition,r);("all"===r||"OperatorNode"===this.condition.type||null!==n&&n<=o)&&(i='<span class="math-parenthesis math-round-parenthesis">(</span>'+i+'<span class="math-parenthesis math-round-parenthesis">)</span>');var s=this.trueExpr.toHTML(e),p=t.getPrecedence(this.trueExpr,r);("all"===r||"OperatorNode"===this.trueExpr.type||null!==p&&p<=o)&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>');var a=this.falseExpr.toHTML(e),h=t.getPrecedence(this.falseExpr,r);return("all"===r||"OperatorNode"===this.falseExpr.type||null!==h&&h<=o)&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>'),i+'<span class="math-operator math-conditional-operator">?</span>'+s+'<span class="math-operator math-conditional-operator">:</span>'+a},p.prototype._toTex=function(t){return"\\begin{cases} {"+this.trueExpr.toTex(t)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(t)+"}\\\\{"+this.falseExpr.toTex(t)+"}, &\\quad{\\text{otherwise}}\\end{cases}"},p}exports.name="ConditionalNode",exports.path="expression.node",exports.factory=e;
},{"../operators":"Huid","./Node":"dnbo","../../function/utils/typeof":"LZTG"}],"MNuy":[function(require,module,exports) {
"use strict";var t=require("../../utils/string").format,e=require("../../utils/latex").escape;function n(n,r,o,a){var s=o(require("./Node")),u=o(require("../../function/utils/typeof"));function i(t){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(2===arguments.length)throw new SyntaxError("new ConstantNode(valueStr, valueType) is not supported anymore since math v4.0.0. Use new ConstantNode(value) instead, where value is a non-stringified value.");this.value=t}return i.prototype=new s,i.prototype.type="ConstantNode",i.prototype.isConstantNode=!0,i.prototype._compile=function(t,e){var n=this.value;return function(){return n}},i.prototype.forEach=function(t){},i.prototype.map=function(t){return this.clone()},i.prototype.clone=function(){return new i(this.value)},i.prototype._toString=function(e){return t(this.value,e)},i.prototype.toHTML=function(t){var e=this._toString(t);switch(u(this.value)){case"number":case"BigNumber":case"Fraction":return'<span class="math-number">'+e+"</span>";case"string":return'<span class="math-string">'+e+"</span>";case"boolean":return'<span class="math-boolean">'+e+"</span>";case"null":return'<span class="math-null-symbol">'+e+"</span>";case"undefined":return'<span class="math-undefined">'+e+"</span>";default:return'<span class="math-symbol">'+e+"</span>"}},i.prototype.toJSON=function(){return{mathjs:"ConstantNode",value:this.value}},i.fromJSON=function(t){return new i(t.value)},i.prototype._toTex=function(t){var n=this._toString(t);switch(u(this.value)){case"string":return"\\mathtt{"+e(n)+"}";case"number":case"BigNumber":var r=n.toLowerCase().indexOf("e");return-1!==r?n.substring(0,r)+"\\cdot10^{"+n.substring(r+1)+"}":n;case"Fraction":return this.value.toLatex();default:return n}},i}exports.name="ConstantNode",exports.path="expression.node",exports.factory=n;
},{"../../utils/string":"PshC","../../utils/latex":"H1Mr","./Node":"dnbo","../../function/utils/typeof":"LZTG"}],"PrPs":[function(require,module,exports) {
"use strict";var e=require("../keywords"),t=require("../../utils/string").escape,r=require("../../utils/array").forEach,a=require("../../utils/array").join,s=require("../../utils/latex"),n=require("../operators"),i=require("../../utils/customs").setSafeProperty;function o(o,p,h,m){var u=h(require("./Node"));function c(t,r,a){if(!(this instanceof c))throw new SyntaxError("Constructor must be called with the new operator");if("string"!=typeof t)throw new TypeError('String expected for parameter "name"');if(!Array.isArray(r))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!o.isNode(a))throw new TypeError('Node expected for parameter "expr"');if(t in e)throw new Error('Illegal function name, "'+t+'" is a reserved keyword');this.name=t,this.params=r.map(function(e){return e&&e.name||e}),this.types=r.map(function(e){return e&&e.type||"any"}),this.expr=a}function f(e,t){var r=n.getPrecedence(e,t),a=n.getPrecedence(e.expr,t);return"all"===t||null!==a&&a<=r}return c.prototype=new u,c.prototype.type="FunctionAssignmentNode",c.prototype.isFunctionAssignmentNode=!0,c.prototype._compile=function(e,t){var s=Object.create(t);r(this.params,function(e){s[e]=!0});var n=this.expr._compile(e,s),o=this.name,p=this.params,h=a(this.types,","),u=o+"("+a(this.params,", ")+")";return function(e,t,r){var a={};a[h]=function(){for(var a=Object.create(t),s=0;s<p.length;s++)a[p[s]]=arguments[s];return n(e,a,r)};var s=m(o,a);return s.syntax=u,i(e,o,s),s}},c.prototype.forEach=function(e){e(this.expr,"expr",this)},c.prototype.map=function(e){var t=this._ifNode(e(this.expr,"expr",this));return new c(this.name,this.params.slice(0),t)},c.prototype.clone=function(){return new c(this.name,this.params.slice(0),this.expr)},c.prototype._toString=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=this.expr.toString(e);return f(this,t)&&(r="("+r+")"),this.name+"("+this.params.join(", ")+") = "+r},c.prototype.toJSON=function(){var e=this.types;return{mathjs:"FunctionAssignmentNode",name:this.name,params:this.params.map(function(t,r){return{name:t,type:e[r]}}),expr:this.expr}},c.fromJSON=function(e){return new c(e.name,e.params,e.expr)},c.prototype.toHTML=function(e){for(var r=e&&e.parenthesis?e.parenthesis:"keep",a=[],s=0;s<this.params.length;s++)a.push('<span class="math-symbol math-parameter">'+t(this.params[s])+"</span>");var n=this.expr.toHTML(e);return f(this,r)&&(n='<span class="math-parenthesis math-round-parenthesis">(</span>'+n+'<span class="math-parenthesis math-round-parenthesis">)</span>'),'<span class="math-function">'+t(this.name)+'</span><span class="math-parenthesis math-round-parenthesis">(</span>'+a.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-round-parenthesis">)</span><span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+n},c.prototype._toTex=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=this.expr.toTex(e);return f(this,t)&&(r="\\left(".concat(r,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(s.toSymbol).join(",")+"\\right):="+r},c}exports.name="FunctionAssignmentNode",exports.path="expression.node",exports.factory=o;
},{"../keywords":"psm5","../../utils/string":"PshC","../../utils/array":"j2lF","../../utils/latex":"H1Mr","../operators":"Huid","../../utils/customs":"PAPk","./Node":"dnbo"}],"SN5L":[function(require,module,exports) {
"use strict";var t=require("../../utils/array").map,e=require("../../utils/string").escape;function n(n,o,r,i){var s=r(require("./Node")),a=r(require("../../type/matrix/Range")),p=Array.isArray;function c(t,e){if(!(this instanceof c))throw new SyntaxError("Constructor must be called with the new operator");if(this.dimensions=t,this.dotNotation=e||!1,!p(t)||!t.every(n.isNode))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties");var o=function(){throw new Error("Property `IndexNode.object` is deprecated, use `IndexNode.fn` instead")};Object.defineProperty(this,"object",{get:o,set:o})}function u(t,e,o){return new a(n.isBigNumber(t)?t.toNumber():t,n.isBigNumber(e)?e.toNumber():e,n.isBigNumber(o)?o.toNumber():o)}return c.prototype=new s,c.prototype.type="IndexNode",c.prototype.isIndexNode=!0,c.prototype._compile=function(e,o){var r=t(this.dimensions,function(t,r){if(n.isRangeNode(t)){if(t.needsEnd()){var i=Object.create(o);i.end=!0;var s=t.start._compile(e,i),a=t.end._compile(e,i),p=t.step?t.step._compile(e,i):function(){return 1};return function(t,n,o){var i=e.size(o).valueOf(),c=Object.create(n);return c.end=i[r],u(s(t,c,o),a(t,c,o),p(t,c,o))}}var c=t.start._compile(e,o),d=t.end._compile(e,o),h=t.step?t.step._compile(e,o):function(){return 1};return function(t,e,n){return u(c(t,e,n),d(t,e,n),h(t,e,n))}}if(n.isSymbolNode(t)&&"end"===t.name){var m=Object.create(o);m.end=!0;var f=t._compile(e,m);return function(t,n,o){var i=e.size(o).valueOf(),s=Object.create(n);return s.end=i[r],f(t,s,o)}}var y=t._compile(e,o);return function(t,e,n){return y(t,e,n)}});return function(n,o,i){var s=t(r,function(t){return t(n,o,i)});return e.index.apply(e,s)}},c.prototype.forEach=function(t){for(var e=0;e<this.dimensions.length;e++)t(this.dimensions[e],"dimensions["+e+"]",this)},c.prototype.map=function(t){for(var e=[],n=0;n<this.dimensions.length;n++)e[n]=this._ifNode(t(this.dimensions[n],"dimensions["+n+"]",this));return new c(e)},c.prototype.clone=function(){return new c(this.dimensions.slice(0))},c.prototype.isObjectProperty=function(){return 1===this.dimensions.length&&n.isConstantNode(this.dimensions[0])&&"string"==typeof this.dimensions[0].value},c.prototype.getObjectProperty=function(){return this.isObjectProperty()?this.dimensions[0].value:null},c.prototype._toString=function(t){return this.dotNotation?"."+this.getObjectProperty():"["+this.dimensions.join(", ")+"]"},c.prototype.toJSON=function(){return{mathjs:"IndexNode",dimensions:this.dimensions,dotNotation:this.dotNotation}},c.fromJSON=function(t){return new c(t.dimensions,t.dotNotation)},c.prototype.toHTML=function(t){for(var n=[],o=0;o<this.dimensions.length;o++)n[o]=this.dimensions[o].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+e(this.getObjectProperty())+"</span>":'<span class="math-parenthesis math-square-parenthesis">[</span>'+n.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'},c.prototype._toTex=function(t){var e=this.dimensions.map(function(e){return e.toTex(t)});return this.dotNotation?"."+this.getObjectProperty():"_{"+e.join(",")+"}"},c}exports.name="IndexNode",exports.path="expression.node",exports.factory=n;
},{"../../utils/array":"j2lF","../../utils/string":"PshC","./Node":"dnbo","../../type/matrix/Range":"rRNx"}],"UI2T":[function(require,module,exports) {
"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(t)}function t(e){return(t="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)})(e)}var e=require("../../utils/string").stringify,o=require("../../utils/string").escape,p=require("../../utils/customs").isSafeProperty,s=require("../../utils/object").hasOwnProperty;function i(r,i,n,a){var h=n(require("./Node"));function u(e){if(!(this instanceof u))throw new SyntaxError("Constructor must be called with the new operator");if(this.properties=e||{},e&&("object"!==t(e)||!Object.keys(e).every(function(t){return r.isNode(e[t])})))throw new TypeError("Object containing Nodes expected")}return u.prototype=new h,u.prototype.type="ObjectNode",u.prototype.isObjectNode=!0,u.prototype._compile=function(r,t){var o={};for(var i in this.properties)if(s(this.properties,i)){var n=e(i),a=JSON.parse(n);if(!p(this.properties,a))throw new Error('No access to property "'+a+'"');o[a]=this.properties[i]._compile(r,t)}return function(r,t,e){var p={};for(var i in o)s(o,i)&&(p[i]=o[i](r,t,e));return p}},u.prototype.forEach=function(r){for(var t in this.properties)this.properties.hasOwnProperty(t)&&r(this.properties[t],"properties["+e(t)+"]",this)},u.prototype.map=function(r){var t={};for(var o in this.properties)this.properties.hasOwnProperty(o)&&(t[o]=this._ifNode(r(this.properties[o],"properties["+e(o)+"]",this)));return new u(t)},u.prototype.clone=function(){var r={};for(var t in this.properties)this.properties.hasOwnProperty(t)&&(r[t]=this.properties[t]);return new u(r)},u.prototype._toString=function(r){var t=[];for(var o in this.properties)this.properties.hasOwnProperty(o)&&t.push(e(o)+": "+this.properties[o].toString(r));return"{"+t.join(", ")+"}"},u.prototype.toJSON=function(){return{mathjs:"ObjectNode",properties:this.properties}},u.fromJSON=function(r){return new u(r.properties)},u.prototype.toHTML=function(r){var t=[];for(var e in this.properties)this.properties.hasOwnProperty(e)&&t.push('<span class="math-symbol math-property">'+o(e)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[e].toHTML(r));return'<span class="math-parenthesis math-curly-parenthesis">{</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-curly-parenthesis">}</span>'},u.prototype._toTex=function(r){var t=[];for(var e in this.properties)this.properties.hasOwnProperty(e)&&t.push("\\mathbf{"+e+":} & "+this.properties[e].toTex(r)+"\\\\");return"\\left\\{\\begin{array}{ll}".concat(t.join("\n"),"\\end{array}\\right\\}")},u}exports.name="ObjectNode",exports.path="expression.node",exports.factory=i;
},{"../../utils/string":"PshC","../../utils/customs":"PAPk","../../utils/object":"FcSp","./Node":"dnbo"}],"F3sc":[function(require,module,exports) {
"use strict";var t=require("../../utils/latex"),e=require("../../utils/array").map,r=require("../../utils/string").escape,i=require("../../utils/customs").isSafeMethod,n=require("../../utils/customs").getSafeProperty,a=require("../operators");function s(s,o,p,h){var c=p(require("./Node"));function l(t,e,r,i){if(!(this instanceof l))throw new SyntaxError("Constructor must be called with the new operator");if("string"!=typeof t)throw new TypeError('string expected for parameter "op"');if("string"!=typeof e)throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(r)||!r.every(s.isNode))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=!0===i,this.op=t,this.fn=e,this.args=r||[]}function f(t,e,r,i,n){var s,o=a.getPrecedence(t,e),p=a.getAssociativity(t,e);if("all"===e||i.length>2&&"OperatorNode:add"!==t.getIdentifier()&&"OperatorNode:multiply"!==t.getIdentifier())return i.map(function(t){switch(t.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});switch(i.length){case 0:s=[];break;case 1:var h=a.getPrecedence(i[0],e);if(n&&null!==h){var c,l;if("keep"===e?(c=i[0].getIdentifier(),l=t.getIdentifier()):(c=i[0].getContent().getIdentifier(),l=t.getContent().getIdentifier()),!1===a.properties[o][l].latexLeftParens){s=[!1];break}if(!1===a.properties[h][c].latexParens){s=[!1];break}}if(null===h){s=[!1];break}if(h<=o){s=[!0];break}s=[!1];break;case 2:var f,u,d=a.getPrecedence(i[0],e),g=a.isAssociativeWith(t,i[0],e);f=null!==d&&(d===o&&"right"===p&&!g||d<o);var m,y,v,N=a.getPrecedence(i[1],e),I=a.isAssociativeWith(t,i[1],e);if(u=null!==N&&(N===o&&"left"===p&&!I||N<o),n)"keep"===e?(m=t.getIdentifier(),y=t.args[0].getIdentifier(),v=t.args[1].getIdentifier()):(m=t.getContent().getIdentifier(),y=t.args[0].getContent().getIdentifier(),v=t.args[1].getContent().getIdentifier()),null!==d&&(!1===a.properties[o][m].latexLeftParens&&(f=!1),!1===a.properties[d][y].latexParens&&(f=!1)),null!==N&&(!1===a.properties[o][m].latexRightParens&&(u=!1),!1===a.properties[N][v].latexParens&&(u=!1));s=[f,u];break;default:"OperatorNode:add"!==t.getIdentifier()&&"OperatorNode:multiply"!==t.getIdentifier()||(s=i.map(function(r){var i=a.getPrecedence(r,e),n=a.isAssociativeWith(t,r,e),s=a.getAssociativity(r,e);return null!==i&&(o===i&&p===s&&!n||i<o)}))}return i.length>=2&&"OperatorNode:multiply"===t.getIdentifier()&&t.implicit&&"auto"===e&&"hide"===r&&(s=i.map(function(t,e){var r="ParenthesisNode"===t.getIdentifier();return!(!s[e]&&!r)})),s}return l.prototype=new c,l.prototype.type="OperatorNode",l.prototype.isOperatorNode=!0,l.prototype._compile=function(t,r){if("string"!=typeof this.fn||!i(t,this.fn))throw t[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var a=n(t,this.fn),s=e(this.args,function(e){return e._compile(t,r)});if(1===s.length){var o=s[0];return function(t,e,r){return a(o(t,e,r))}}if(2===s.length){var p=s[0],h=s[1];return function(t,e,r){return a(p(t,e,r),h(t,e,r))}}return function(t,r,i){return a.apply(null,e(s,function(e){return e(t,r,i)}))}},l.prototype.forEach=function(t){for(var e=0;e<this.args.length;e++)t(this.args[e],"args["+e+"]",this)},l.prototype.map=function(t){for(var e=[],r=0;r<this.args.length;r++)e[r]=this._ifNode(t(this.args[r],"args["+r+"]",this));return new l(this.op,this.fn,e,this.implicit)},l.prototype.clone=function(){return new l(this.op,this.fn,this.args.slice(0),this.implicit)},l.prototype.isUnary=function(){return 1===this.args.length},l.prototype.isBinary=function(){return 2===this.args.length},l.prototype._toString=function(t){var e=t&&t.parenthesis?t.parenthesis:"keep",r=t&&t.implicit?t.implicit:"hide",i=this.args,n=f(this,e,r,i,!1);if(1===i.length){var s=a.getAssociativity(this,e),o=i[0].toString(t);n[0]&&(o="("+o+")");var p=/[a-zA-Z]+/.test(this.op);return"right"===s?this.op+(p?" ":"")+o:"left"===s?o+(p?" ":"")+this.op:o+this.op}if(2===i.length){var h=i[0].toString(t),c=i[1].toString(t);return n[0]&&(h="("+h+")"
},{"../../utils/latex":"H1Mr","../../utils/array":"j2lF","../../utils/string":"PshC","../../utils/customs":"PAPk","../operators":"Huid","./Node":"dnbo"}],"Mj7c":[function(require,module,exports) {
"use strict";function t(t,e,n,o){var r=n(require("./Node"));function s(e){if(!(this instanceof s))throw new SyntaxError("Constructor must be called with the new operator");if(!t.isNode(e))throw new TypeError('Node expected for parameter "content"');this.content=e}return s.prototype=new r,s.prototype.type="ParenthesisNode",s.prototype.isParenthesisNode=!0,s.prototype._compile=function(t,e){return this.content._compile(t,e)},s.prototype.getContent=function(){return this.content.getContent()},s.prototype.forEach=function(t){t(this.content,"content",this)},s.prototype.map=function(t){return new s(t(this.content,"content",this))},s.prototype.clone=function(){return new s(this.content)},s.prototype._toString=function(t){return!t||t&&!t.parenthesis||t&&"keep"===t.parenthesis?"("+this.content.toString(t)+")":this.content.toString(t)},s.prototype.toJSON=function(){return{mathjs:"ParenthesisNode",content:this.content}},s.fromJSON=function(t){return new s(t.content)},s.prototype.toHTML=function(t){return!t||t&&!t.parenthesis||t&&"keep"===t.parenthesis?'<span class="math-parenthesis math-round-parenthesis">(</span>'+this.content.toHTML(t)+'<span class="math-parenthesis math-round-parenthesis">)</span>':this.content.toHTML(t)},s.prototype._toTex=function(t){return!t||t&&!t.parenthesis||t&&"keep"===t.parenthesis?"\\left(".concat(this.content.toTex(t),"\\right)"):this.content.toTex(t)},s}exports.name="ParenthesisNode",exports.path="expression.node",exports.factory=t;
},{"./Node":"dnbo"}],"RtSa":[function(require,module,exports) {
"use strict";var t=require("../../utils/latex"),n=require("../../utils/string").escape,e=require("../../utils/object").hasOwnProperty,o=require("../../utils/customs").getSafeProperty;function r(r,s,a,i,m){var p=a(require("./Node"));function u(t){return!!r.Unit&&r.Unit.isValuelessUnit(t)}function l(t){if(!(this instanceof l))throw new SyntaxError("Constructor must be called with the new operator");if("string"!=typeof t)throw new TypeError('String expected for parameter "name"');this.name=t}return l.prototype=new p,l.prototype.type="SymbolNode",l.prototype.isSymbolNode=!0,l.prototype._compile=function(t,n){var s=this.name;if(e(n,s))return function(t,n,e){return n[s]};if(s in t)return function(n,e,r){return o(s in n?n:t,s)};var a=u(s);return function(t,n,e){return s in t?o(t,s):a?new r.Unit(null,s):function(t){throw new Error("Undefined symbol "+t)}(s)}},l.prototype.forEach=function(t){},l.prototype.map=function(t){return this.clone()},l.prototype.clone=function(){return new l(this.name)},l.prototype._toString=function(t){return this.name},l.prototype.toHTML=function(t){var e=n(this.name);return"true"===e||"false"===e?'<span class="math-symbol math-boolean">'+e+"</span>":"i"===e?'<span class="math-symbol math-imaginary-symbol">'+e+"</span>":"Infinity"===e?'<span class="math-symbol math-infinity-symbol">'+e+"</span>":"NaN"===e?'<span class="math-symbol math-nan-symbol">'+e+"</span>":"null"===e?'<span class="math-symbol math-null-symbol">'+e+"</span>":"undefined"===e?'<span class="math-symbol math-undefined-symbol">'+e+"</span>":'<span class="math-symbol">'+e+"</span>"},l.prototype.toJSON=function(){return{mathjs:"SymbolNode",name:this.name}},l.fromJSON=function(t){return new l(t.name)},l.prototype._toTex=function(n){var e=!1;void 0===m[this.name]&&u(this.name)&&(e=!0);var o=t.toSymbol(this.name,e);return"\\"===o[0]?o:" "+o},l}exports.name="SymbolNode",exports.path="expression.node",exports.math=!0,exports.factory=r;
},{"../../utils/latex":"H1Mr","../../utils/string":"PshC","../../utils/object":"FcSp","../../utils/customs":"PAPk","./Node":"dnbo"}],"ZLEq":[function(require,module,exports) {
"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(r){return(e="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?function(e){return t(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":t(e)})(r)}function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}var n=require("../../utils/latex"),o=require("../../utils/string").escape,i=require("../../utils/object").hasOwnProperty,s=require("../../utils/array").map,a=require("../../utils/customs").validateSafeMethod,u=require("../../utils/customs").getSafeProperty;function f(t,f,c,p,h){var y=c(require("./Node")),l=c(require("./SymbolNode"));function d(e,r){if(!(this instanceof d))throw new SyntaxError("Constructor must be called with the new operator");if("string"==typeof e&&(e=new l(e)),!t.isNode(e))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(r)||!r.every(t.isNode))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=e,this.args=r||[],Object.defineProperty(this,"name",{get:function(){return this.fn.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}});var n=function(){throw new Error("Property `FunctionNode.object` is deprecated, use `FunctionNode.fn` instead")};Object.defineProperty(this,"object",{get:n,set:n})}d.prototype=new y,d.prototype.type="FunctionNode",d.prototype.isFunctionNode=!0,d.prototype._compile=function(e,n){if(!(this instanceof d))throw new TypeError("No valid FunctionNode");var o=s(this.args,function(t){return t._compile(e,n)});if(t.isSymbolNode(this.fn)){var i=this.fn.name,f=i in e?u(e,i):void 0;if("function"==typeof f&&!0===f.rawArgs){var c=this.args;return function(t,n,o){return(i in t?u(t,i):f)(c,e,r({},t,n))}}if(1===o.length){var p=o[0];return function(t,e,r){return(i in t?u(t,i):f)(p(t,e,r))}}if(2===o.length){var h=o[0],y=o[1];return function(t,e,r){return(i in t?u(t,i):f)(h(t,e,r),y(t,e,r))}}return function(t,e,r){return(i in t?u(t,i):f).apply(null,s(o,function(n){return n(t,e,r)}))}}if(t.isAccessorNode(this.fn)&&t.isIndexNode(this.fn.index)&&this.fn.index.isObjectProperty()){var l=this.fn.object._compile(e,n),m=this.fn.index.getObjectProperty(),g=this.args;return function(t,n,i){var u=l(t,n,i);return a(u,m),u[m]&&u[m].rawArgs?u[m](g,e,r({},t,n)):u[m].apply(u,s(o,function(e){return e(t,n,i)}))}}var b=this.fn._compile(e,n),w=this.args;return function(t,n,i){var a=b(t,n,i);return a&&a.rawArgs?a(w,e,r({},t,n)):a.apply(a,s(o,function(e){return e(t,n,i)}))}},d.prototype.forEach=function(t){t(this.fn,"fn",this);for(var e=0;e<this.args.length;e++)t(this.args[e],"args["+e+"]",this)},d.prototype.map=function(t){for(var e=this._ifNode(t(this.fn,"fn",this)),r=[],n=0;n<this.args.length;n++)r[n]=this._ifNode(t(this.args[n],"args["+n+"]",this));return new d(e,r)},d.prototype.clone=function(){return new d(this.fn,this.args.slice(0))};var m=d.prototype.toString;function g(r,n,o){for(var i,s="",a=new RegExp("\\$(?:\\{([a-z_][a-z_0-9]*)(?:\\[([0-9]+)\\])?\\}|\\$)","ig"),u=0;null!==(i=a.exec(r));)if(s+=r.substring(u,i.index),u=i.index,"$$"===i[0])s+="$",u++;else{u+=i[0].length;var f=n[i[1]];if(!f)throw new ReferenceError("Template: Property "+i[1]+" does not exist.");if(void 0===i[2])switch(e(f)){case"string":s+=f;break;case"object":if(t.isNode(f))s+=f.toTex(o);else{if(!Array.isArray(f))throw new TypeError("Template: "+i[1]+" has to be a Node, String or array of Nodes");s+=f.map(function(e,r){if(t.isNode(e))return e.toTex(o);throw new TypeError("Template: "+i[1]+"["+r+"] is not a Node.")}).join(",")}break;default:throw new TypeError("Template: "+i[1]+" has to be a Node, String or array of Nodes")}else{if(!t.isNode(f[i[2]]&&f[i[2]]))throw new TypeError("Templat
},{"../../utils/latex":"H1Mr","../../utils/string":"PshC","../../utils/object":"FcSp","../../utils/array":"j2lF","../../utils/customs":"PAPk","./Node":"dnbo","./SymbolNode":"RtSa"}],"tJPg":[function(require,module,exports) {
"use strict";var t=require("../operators");function e(e,s,r,n){var a=r(require("./Node"));function i(t,s,r){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(!e.isNode(t))throw new TypeError("Node expected");if(!e.isNode(s))throw new TypeError("Node expected");if(r&&!e.isNode(r))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=t,this.end=s,this.step=r||null}function o(e,s){var r=t.getPrecedence(e,s),n={},a=t.getPrecedence(e.start,s);if(n.start=null!==a&&a<=r||"all"===s,e.step){var i=t.getPrecedence(e.step,s);n.step=null!==i&&i<=r||"all"===s}var o=t.getPrecedence(e.end,s);return n.end=null!==o&&o<=r||"all"===s,n}return i.prototype=new a,i.prototype.type="RangeNode",i.prototype.isRangeNode=!0,i.prototype.needsEnd=function(){return this.filter(function(t){return e.isSymbolNode(t)&&"end"===t.name}).length>0},i.prototype._compile=function(t,e){var s=t.range,r=this.start._compile(t,e),n=this.end._compile(t,e);if(this.step){var a=this.step._compile(t,e);return function(t,e,i){return s(r(t,e,i),n(t,e,i),a(t,e,i))}}return function(t,e,a){return s(r(t,e,a),n(t,e,a))}},i.prototype.forEach=function(t){t(this.start,"start",this),t(this.end,"end",this),this.step&&t(this.step,"step",this)},i.prototype.map=function(t){return new i(this._ifNode(t(this.start,"start",this)),this._ifNode(t(this.end,"end",this)),this.step&&this._ifNode(t(this.step,"step",this)))},i.prototype.clone=function(){return new i(this.start,this.end,this.step&&this.step)},i.prototype._toString=function(t){var e,s=o(this,t&&t.parenthesis?t.parenthesis:"keep"),r=this.start.toString(t);if(s.start&&(r="("+r+")"),e=r,this.step){var n=this.step.toString(t);s.step&&(n="("+n+")"),e+=":"+n}var a=this.end.toString(t);return s.end&&(a="("+a+")"),e+=":"+a},i.prototype.toJSON=function(){return{mathjs:"RangeNode",start:this.start,end:this.end,step:this.step}},i.fromJSON=function(t){return new i(t.start,t.end,t.step)},i.prototype.toHTML=function(t){var e,s=o(this,t&&t.parenthesis?t.parenthesis:"keep"),r=this.start.toHTML(t);if(s.start&&(r='<span class="math-parenthesis math-round-parenthesis">(</span>'+r+'<span class="math-parenthesis math-round-parenthesis">)</span>'),e=r,this.step){var n=this.step.toHTML(t);s.step&&(n='<span class="math-parenthesis math-round-parenthesis">(</span>'+n+'<span class="math-parenthesis math-round-parenthesis">)</span>'),e+='<span class="math-operator math-range-operator">:</span>'+n}var a=this.end.toHTML(t);return s.end&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>'),e+='<span class="math-operator math-range-operator">:</span>'+a},i.prototype._toTex=function(t){var e=o(this,t&&t.parenthesis?t.parenthesis:"keep"),s=this.start.toTex(t);if(e.start&&(s="\\left(".concat(s,"\\right)")),this.step){var r=this.step.toTex(t);e.step&&(r="\\left(".concat(r,"\\right)")),s+=":"+r}var n=this.end.toTex(t);return e.end&&(n="\\left(".concat(n,"\\right)")),s+=":"+n},i}exports.name="RangeNode",exports.path="expression.node",exports.factory=e;
},{"../operators":"Huid","./Node":"dnbo"}],"E94o":[function(require,module,exports) {
"use strict";var t=require("../operators"),r=require("../../utils/latex"),e=require("../../utils/string").escape;function a(a,n,o,i){var s=o(require("./Node")),p=require("../../utils/customs").getSafeProperty;function l(t,r){if(!(this instanceof l))throw new SyntaxError("Constructor must be called with the new operator");if(!Array.isArray(t))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(r))throw new TypeError("Parameter params must be an array");if(t.length!==r.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=t,this.params=r}return l.prototype=new s,l.prototype.type="RelationalNode",l.prototype.isRelationalNode=!0,l.prototype._compile=function(t,r){var e=this,a=this.params.map(function(e){return e._compile(t,r)});return function(r,n,o){for(var i,s=a[0](r,n,o),l=0;l<e.conditionals.length;l++){if(i=s,s=a[l+1](r,n,o),!p(t,e.conditionals[l])(i,s))return!1}return!0}},l.prototype.forEach=function(t){var r=this;this.params.forEach(function(e,a){return t(e,"params["+a+"]",r)},this)},l.prototype.map=function(t){var r=this;return new l(this.conditionals.slice(),this.params.map(function(e,a){return r._ifNode(t(e,"params["+a+"]",r))},this))},l.prototype.clone=function(){return new l(this.conditionals,this.params)},l.prototype._toString=function(r){for(var e=r&&r.parenthesis?r.parenthesis:"keep",a=t.getPrecedence(this,e),n=this.params.map(function(n,o){var i=t.getPrecedence(n,e);return"all"===e||null!==i&&i<=a?"("+n.toString(r)+")":n.toString(r)}),o={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="},i=n[0],s=0;s<this.conditionals.length;s++)i+=" "+o[this.conditionals[s]]+" "+n[s+1];return i},l.prototype.toJSON=function(){return{mathjs:"RelationalNode",conditionals:this.conditionals,params:this.params}},l.fromJSON=function(t){return new l(t.conditionals,t.params)},l.prototype.toHTML=function(r){for(var a=r&&r.parenthesis?r.parenthesis:"keep",n=t.getPrecedence(this,a),o=this.params.map(function(e,o){var i=t.getPrecedence(e,a);return"all"===a||null!==i&&i<=n?'<span class="math-parenthesis math-round-parenthesis">(</span>'+e.toHTML(r)+'<span class="math-parenthesis math-round-parenthesis">)</span>':e.toHTML(r)}),i={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="},s=o[0],p=0;p<this.conditionals.length;p++)s+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+e(i[this.conditionals[p]])+"</span>"+o[p+1];return s},l.prototype._toTex=function(e){for(var a=e&&e.parenthesis?e.parenthesis:"keep",n=t.getPrecedence(this,a),o=this.params.map(function(r,o){var i=t.getPrecedence(r,a);return"all"===a||null!==i&&i<=n?"\\left("+r.toTex(e)+"\right)":r.toTex(e)}),i=o[0],s=0;s<this.conditionals.length;s++)i+=r.operators[this.conditionals[s]]+o[s+1];return i},l}exports.name="RelationalNode",exports.path="expression.node",exports.factory=a;
},{"../operators":"Huid","../../utils/latex":"H1Mr","../../utils/string":"PshC","./Node":"dnbo","../../utils/customs":"PAPk"}],"EUvE":[function(require,module,exports) {
"use strict";function e(){return(e=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e}).apply(this,arguments)}var n=require("../error/ArgumentsError"),t=require("../utils/collection/deepMap");function o(o,r,i,u){var a=i(require("../type/numeric")),f=i(require("./node/AccessorNode")),s=i(require("./node/ArrayNode")),k=i(require("./node/AssignmentNode")),c=i(require("./node/BlockNode")),d=i(require("./node/ConditionalNode")),p=i(require("./node/ConstantNode")),l=i(require("./node/FunctionAssignmentNode")),h=i(require("./node/IndexNode")),w=i(require("./node/ObjectNode")),v=i(require("./node/OperatorNode")),D=i(require("./node/ParenthesisNode")),y=i(require("./node/FunctionNode")),m=i(require("./node/RangeNode")),g=i(require("./node/RelationalNode")),x=i(require("./node/SymbolNode"));function N(e,r){if(1!==arguments.length&&2!==arguments.length)throw new n("parse",arguments.length,1,2);var i=r&&r.nodes?r.nodes:{};if("string"==typeof e)return F(e,i);if(Array.isArray(e)||e instanceof o.Matrix)return t(e,function(e){if("string"!=typeof e)throw new TypeError("String expected");return F(e,i)});throw new TypeError("String or matrix expected")}var E={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},L={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},T={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},M={true:!0,false:!1,null:null,undefined:void 0},O=["NaN","Infinity"];function b(e,n){return e.expression.substr(e.index,n)}function A(e){return b(e,1)}function C(e){e.index++}function S(e){return e.expression.charAt(e.index-1)}function I(e){return e.expression.charAt(e.index+1)}function q(e){for(e.tokenType=E.NULL,e.token="",e.comment="";N.isWhitespace(A(e),e.nestingLevel);)C(e);if("#"===A(e))for(;"\n"!==A(e)&&""!==A(e);)e.comment+=A(e),C(e);if(""!==A(e)){if("\n"===A(e)&&!e.nestingLevel)return e.tokenType=E.DELIMITER,e.token=A(e),void C(e);var n=A(e),t=b(e,2),o=b(e,3);if(3===o.length&&L[o])return e.tokenType=E.DELIMITER,e.token=o,C(e),C(e),void C(e);if(2===t.length&&L[t])return e.tokenType=E.DELIMITER,e.token=t,C(e),void C(e);if(L[n])return e.tokenType=E.DELIMITER,e.token=n,void C(e);if(N.isDigitDot(n)){if(e.tokenType=E.NUMBER,"."===A(e))e.token+=A(e),C(e),N.isDigit(A(e))||(e.tokenType=E.DELIMITER);else{for(;N.isDigit(A(e));)e.token+=A(e),C(e);N.isDecimalMark(A(e),I(e))&&(e.token+=A(e),C(e))}for(;N.isDigit(A(e));)e.token+=A(e),C(e);if("E"===A(e)||"e"===A(e))if(N.isDigit(I(e))||"-"===I(e)||"+"===I(e)){if(e.token+=A(e),C(e),"+"!==A(e)&&"-"!==A(e)||(e.token+=A(e),C(e)),!N.isDigit(A(e)))throw ie(e,'Digit expected, got "'+A(e)+'"');for(;N.isDigit(A(e));)e.token+=A(e),C(e);if(N.isDecimalMark(A(e),I(e)))throw ie(e,'Digit expected, got "'+A(e)+'"')}else if("."===I(e))throw C(e),ie(e,'Digit expected, got "'+A(e)+'"')}else{if(!N.isAlpha(A(e),S(e),I(e))){for(e.tokenType=E.UNKNOWN;""!==A(e);)e.token+=A(e),C(e);throw ie(e,'Syntax error in part "'+e.token+'"')}for(;N.isAlpha(A(e),S(e),I(e))||N.isDigit(A(e));)e.token+=A(e),C(e);T.hasOwnProperty(e.token)?e.tokenType=E.DELIMITER:e.tokenType=E.SYMBOL}}else e.tokenType=E.DELIMITER}function P(e){do{q(e)}while("\n"===e.token)}function B(e){e.nestingLevel++}function R(e){e.nestingLevel--}function F(n,t){var o={extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:E.NULL,nestingLevel:0,conditionalLevel:null};e(o,{expression:n,extraNodes:t}),q(o);var r=function(e){var n,t,o=[];""!==e.token&&"\n"!==e.token&&";"!==e.token&&((n=U(e)).comment=e.comment);for(;"\n"===e.token||";"===e.token;)0===o.length&&n&&(t=";"!==e.token,o.push({node:n,visible:t})),q(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&((n=U(e)).comment=e.comment,t=";"!==e.token,o.push({node:n,visible:t}));return o.length>0?new c(o):(n||((n=new p(void 0)).comment=e.comment),n)}(o);if(""!==o.token)throw o.tokenType===E.D
},{"../error/ArgumentsError":"h0xI","../utils/collection/deepMap":"lOYo","../type/numeric":"aA7E","./node/AccessorNode":"vZNf","./node/ArrayNode":"onTs","./node/AssignmentNode":"yw4P","./node/BlockNode":"QBkn","./node/ConditionalNode":"uzAW","./node/ConstantNode":"MNuy","./node/FunctionAssignmentNode":"PrPs","./node/IndexNode":"SN5L","./node/ObjectNode":"UI2T","./node/OperatorNode":"F3sc","./node/ParenthesisNode":"Mj7c","./node/FunctionNode":"ZLEq","./node/RangeNode":"tJPg","./node/RelationalNode":"E94o","./node/SymbolNode":"RtSa"}],"eDsC":[function(require,module,exports) {
"use strict";function r(r,t,n,e,a){var o=a.expression.node.FunctionNode,s=a.expression.node.OperatorNode,i=a.expression.node.SymbolNode,g={add:!0,multiply:!0},f={add:!0,multiply:!0};function u(t,n){if(!r.isOperatorNode(t))return!1;var e=t.fn.toString();return n&&n.hasOwnProperty(e)&&n[e].hasOwnProperty("associative")?n[e].associative:f[e]||!1}function c(t){var n,e=[];return u(t)?(n=t.op,function t(a){for(var o=0;o<a.args.length;o++){var s=a.args[o];r.isOperatorNode(s)&&n===s.op?t(s):e.push(s)}}(t),e):t.args}function p(t){return r.isOperatorNode(t)?function(r){try{return new s(t.op,t.fn,r,t.implicit)}catch(n){return console.error(n),[]}}:function(r){return new o(new i(t.name),r)}}return{createMakeNodeFunction:p,isCommutative:function(t,n){if(!r.isOperatorNode(t))return!0;var e=t.fn.toString();return n&&n.hasOwnProperty(e)&&n[e].hasOwnProperty("commutative")?n[e].commutative:g[e]||!1},isAssociative:u,flatten:function r(t){if(!t.args||0===t.args.length)return t;t.args=c(t);for(var n=0;n<t.args.length;n++)r(t.args[n])},allChildren:c,unflattenr:function r(t){if(t.args&&0!==t.args.length){for(var n=p(t),e=t.args.length,a=0;a<e;a++)r(t.args[a]);if(e>2&&u(t)){for(var o=t.args.pop();t.args.length>0;)o=n([t.args.pop(),o]);t.args=o.args}}},unflattenl:function r(t){if(t.args&&0!==t.args.length){for(var n=p(t),e=t.args.length,a=0;a<e;a++)r(t.args[a]);if(e>2&&u(t)){for(var o=t.args.shift();t.args.length>0;)o=n([o,t.args.shift()]);t.args=o.args}}}}}exports.factory=r,exports.math=!0;
},{}],"TWFw":[function(require,module,exports) {
"use strict";function e(e,n,r,t,o){var i=r(require("./util")),a=i.isCommutative,u=i.isAssociative,s=i.allChildren,c=i.createMakeNodeFunction,d=o.expression.node.ConstantNode,f=o.expression.node.OperatorNode,m=o.expression.node.FunctionNode;function l(n,r,t){try{return b(o[n].apply(null,r),t)}catch(i){return r=r.map(function(n){return e.isFraction(n)?n.valueOf():n}),b(o[n].apply(null,r),t)}}var p=t({Fraction:function(e){var n,r=e.s*e.n;n=r<0?new f("-","unaryMinus",[new d(-r)]):new d(r);if(1===e.d)return n;return new f("/","divide",[n,new d(e.d)])},number:function(e){return e<0?y(new d(-e)):new d(e)},BigNumber:function(e){return e<0?y(new d(-e)):new d(e)},Complex:function(e){throw new Error("Cannot convert Complex number to Node")}});function N(e,n){if(n&&!1!==n.exactFractions&&isFinite(e)){var r=o.fraction(e);if(r.valueOf()===e)return r}return e}var b=t({"string, Object":function(e,r){return"BigNumber"===n.number?o.bignumber(e):"Fraction"===n.number?o.fraction(e):N(parseFloat(e),r)},"Fraction, Object":function(e,n){return e},"BigNumber, Object":function(e,n){return e},"number, Object":function(e,n){return N(e,n)},"Complex, Object":function(e,n){return 0!==e.im?e:N(e.re,n)}});function y(e){return new f("-","unaryMinus",[e])}function v(n,r,t,o){return r.reduce(function(r,i){if(e.isNode(r)||e.isNode(i))e.isNode(r)?e.isNode(i)||(i=p(i)):r=p(r);else{try{return l(n,[r,i],o)}catch(a){}r=p(r),i=p(i)}return t([r,i])})}return function(n,r){var t=function n(r,t){switch(r.type){case"SymbolNode":return r;case"ConstantNode":return"number"!=typeof r.value&&isNaN(r.value)?r:b(r.value,t);case"FunctionNode":if(o[r.name]&&o[r.name].rawArgs)return r;if(-1===["add","multiply"].indexOf(r.name)){var i=r.args.map(function(e){return n(e,t)});if(!i.some(e.isNode))try{return l(r.name,i,t)}catch(x){}return i=i.map(function(n){return e.isNode(n)?n:p(n)}),new m(r.name,i)}case"OperatorNode":var d,f,N=r.fn.toString(),y=c(r);if(r.isUnary())d=[n(r.args[0],t)],f=e.isNode(d[0])?y(d):l(N,d,t);else if(u(r))if(d=(d=s(r)).map(function(e){return n(e,t)}),a(N)){for(var w=[],g=[],h=0;h<d.length;h++)e.isNode(d[h])?g.push(d[h]):w.push(d[h]);w.length>1?(f=v(N,w,y,t),g.unshift(f),f=v(N,g,y,t)):f=v(N,d,y,t)}else f=v(N,d,y,t);else d=r.args.map(function(e){return n(e,t)}),f=v(N,d,y,t);return f;case"ParenthesisNode":return n(r.content,t);case"AccessorNode":case"ArrayNode":case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"IndexNode":case"ObjectNode":case"RangeNode":case"UpdateNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(r.type))}}(n,r);return e.isNode(t)?t:p(t)}}exports.math=!0,exports.name="simplifyConstant",exports.path="algebra.simplify",exports.factory=e;
},{"./util":"eDsC"}],"geyZ":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function n(n,e,t,u){var i=u("isZero",{number:function(r){return 0===r},BigNumber:function(r){return r.isZero()},Complex:function(r){return 0===r.re&&0===r.im},Fraction:function(r){return 1===r.d&&0===r.n},Unit:function(r){return i(r.value)},"Array | Matrix":function(n){return r(n,i)}});return i}exports.name="isZero",exports.factory=n;
},{"../../utils/collection/deepMap":"lOYo"}],"IRmO":[function(require,module,exports) {
"use strict";var r=require("../../../utils/index"),t=r.object;function e(r,e,i,a){var n=i(require("../../../type/matrix/function/matrix")),u=i(require("../../arithmetic/abs")),o=i(require("../../arithmetic/addScalar")),s=i(require("../../arithmetic/divideScalar")),c=i(require("../../arithmetic/multiplyScalar")),f=i(require("../../arithmetic/subtract")),h=i(require("../../relational/larger")),p=i(require("../../relational/equalScalar")),l=i(require("../../arithmetic/unaryMinus")),v=r.SparseMatrix,m=r.DenseMatrix,g=r.Spa;function w(r){var e,i,a,n=r._size[0],l=r._size[1],v=Math.min(n,l),g=t.clone(r._data),w=[],S=[n,v],x=[],_=[v,l],d=[];for(e=0;e<n;e++)d[e]=e;for(i=0;i<l;i++){if(i>0)for(e=0;e<n;e++){var q=Math.min(e,i),z=0;for(a=0;a<q;a++)z=o(z,c(g[e][a],g[a][i]));g[e][i]=f(g[e][i],z)}var L=i,M=0,U=0;for(e=i;e<n;e++){var y=g[e][i],E=u(y);h(E,M)&&(L=e,M=E,U=y)}if(i!==L&&(d[i]=[d[L],d[L]=d[i]][0],m._swapRows(i,L,g)),i<n)for(e=i+1;e<n;e++){var R=g[e][i];p(R,0)||(g[e][i]=s(g[e][i],U))}}for(i=0;i<l;i++)for(e=0;e<n;e++)0===i&&(e<l&&(x[e]=[]),w[e]=[]),e<i?(e<l&&(x[e][i]=g[e][i]),i<n&&(w[e][i]=0)):e!==i?(e<l&&(x[e][i]=0),i<n&&(w[e][i]=g[e][i])):(e<l&&(x[e][i]=g[e][i]),i<n&&(w[e][i]=1));var b=new m({data:w,size:S}),D=new m({data:x,size:_}),O=[];for(e=0,v=d.length;e<v;e++)O[d[e]]=e;return{L:b,U:D,p:O,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}function S(r){var t,e,i,a=r._size[0],n=r._size[1],o=Math.min(a,n),f=r._values,m=r._index,w=r._ptr,S=[],x=[],_=[],d=[a,o],q=[],z=[],L=[],M=[o,n],U=[],y=[];for(t=0;t<a;t++)U[t]=t,y[t]=t;var E=function(){var r=new g;e<a&&(_.push(S.length),S.push(1),x.push(e)),L.push(q.length);var n=w[e],o=w[e+1];for(i=n;i<o;i++)t=m[i],r.set(U[t],f[i]);e>0&&r.forEach(0,e-1,function(t,e){v._forEachRow(t,S,x,_,function(i,a){i>t&&r.accumulate(i,l(c(a,e)))})});var E,R,b,D,O=e,P=r.get(e),j=u(P);r.forEach(e+1,a-1,function(r,t){var e=u(t);h(e,j)&&(O=r,j=e,P=t)}),e!==O&&(v._swapRows(e,O,d[1],S,x,_),v._swapRows(e,O,M[1],q,z,L),r.swap(e,O),R=O,b=y[E=e],D=y[R],U[b]=R,U[D]=E,y[E]=D,y[R]=b),r.forEach(0,a-1,function(r,t){r<=e?(q.push(t),z.push(r)):(t=s(t,P),p(t,0)||(S.push(t),x.push(r)))})};for(e=0;e<n;e++)E();return L.push(q.length),_.push(S.length),{L:new v({values:S,index:x,ptr:_,size:d}),U:new v({values:q,index:z,ptr:L,size:M}),p:U,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}return a("lup",{DenseMatrix:function(r){return w(r)},SparseMatrix:function(r){return S(r)},Array:function(r){var t=w(n(r));return{L:t.L.valueOf(),U:t.U.valueOf(),p:t.p}}})}exports.name="lup",exports.factory=e;
},{"../../../utils/index":"fsXI","../../../type/matrix/function/matrix":"vzj5","../../arithmetic/abs":"K5X1","../../arithmetic/addScalar":"ZM3O","../../arithmetic/divideScalar":"R3aq","../../arithmetic/multiplyScalar":"obRw","../../arithmetic/subtract":"m78R","../../relational/larger":"SrDl","../../relational/equalScalar":"QvIw","../../arithmetic/unaryMinus":"q5A1"}],"KApf":[function(require,module,exports) {
"use strict";var r=require("../../utils/index"),e=r.object,t=r.string;function i(r,i,a,n){var u=a(require("../../type/matrix/function/matrix")),o=a(require("../arithmetic/subtract")),s=a(require("../arithmetic/multiply")),c=a(require("../arithmetic/unaryMinus")),f=a(require("../algebra/decomposition/lup")),l=n("det",{any:function(r){return e.clone(r)},"Array | Matrix":function(i){var a;switch((a=r.isMatrix(i)?i.size():Array.isArray(i)?(i=u(i)).size():[]).length){case 0:return e.clone(i);case 1:if(1===a[0])return e.clone(i.valueOf()[0]);throw new RangeError("Matrix must be square (size: "+t.format(a)+")");case 2:var n=a[0],l=a[1];if(n===l)return function(r,t,i){if(1===t)return e.clone(r[0][0]);if(2===t)return o(s(r[0][0],r[1][1]),s(r[1][0],r[0][1]));for(var a=f(r),n=a.U[0][0],u=1;u<t;u++)n=s(n,a.U[u][u]);for(var l=0,m=0,x=[];;){for(;x[m];)m++;if(m>=t)break;for(var h=m,p=0;!x[a.p[h]];)x[a.p[h]]=!0,h=a.p[h],p++;p%2==0&&l++}return l%2==0?n:c(n)}(i.clone().valueOf(),n);throw new RangeError("Matrix must be square (size: "+t.format(a)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+t.format(a)+")")}}});return l.toTex={1:"\\det\\left(${args[0]}\\right)"},l}exports.name="det",exports.factory=i;
},{"../../utils/index":"fsXI","../../type/matrix/function/matrix":"vzj5","../arithmetic/subtract":"m78R","../arithmetic/multiply":"k7By","../arithmetic/unaryMinus":"q5A1","../algebra/decomposition/lup":"IRmO"}],"yHuZ":[function(require,module,exports) {
"use strict";var r=require("../../utils/index");function e(e,t,i,a){var n=i(require("../../type/matrix/function/matrix")),o=i(require("../arithmetic/divideScalar")),u=i(require("../arithmetic/addScalar")),s=i(require("../arithmetic/multiply")),f=i(require("../arithmetic/unaryMinus")),c=i(require("../matrix/det")),m=i(require("./identity")),v=i(require("../arithmetic/abs")),l=a("inv",{"Array | Matrix":function(t){var i=e.isMatrix(t)?t.size():r.array.size(t);switch(i.length){case 1:if(1===i[0])return e.isMatrix(t)?n([o(1,t.valueOf()[0])]):[o(1,t[0])];throw new RangeError("Matrix must be square (size: "+r.string.format(i)+")");case 2:var a=i[0],u=i[1];if(a===u)return e.isMatrix(t)?n(h(t.valueOf(),a,u),t.storage()):h(t,a,u);throw new RangeError("Matrix must be square (size: "+r.string.format(i)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+r.string.format(i)+")")}},any:function(r){return o(1,r)}});function h(r,e,t){var i,a,n,l,h;if(1===e){if(0===(l=r[0][0]))throw Error("Cannot calculate inverse, determinant is zero");return[[o(1,l)]]}if(2===e){var x=c(r);if(0===x)throw Error("Cannot calculate inverse, determinant is zero");return[[o(r[1][1],x),o(f(r[0][1]),x)],[o(f(r[1][0]),x),o(r[0][0],x)]]}var d=r.concat();for(i=0;i<e;i++)d[i]=d[i].concat();for(var q=m(e).valueOf(),w=0;w<t;w++){var g=v(d[w][w]),y=w;for(i=w+1;i<e;)v(d[i][w])>g&&(g=v(d[i][w]),y=i),i++;if(0===g)throw Error("Cannot calculate inverse, determinant is zero");(i=y)!==w&&(h=d[w],d[w]=d[i],d[i]=h,h=q[w],q[w]=q[i],q[i]=h);var z=d[w],M=q[w];for(i=0;i<e;i++){var E=d[i],b=q[i];if(i!==w){if(0!==E[w]){for(n=o(f(E[w]),z[w]),a=w;a<t;a++)E[a]=u(E[a],s(n,z[a]));for(a=0;a<t;a++)b[a]=u(b[a],s(n,M[a]))}}else{for(n=z[w],a=w;a<t;a++)E[a]=o(E[a],n);for(a=0;a<t;a++)b[a]=o(b[a],n)}}}return q}return l.toTex={1:"\\left(${args[0]}\\right)^{-1}"},l}exports.name="inv",exports.factory=e;
},{"../../utils/index":"fsXI","../../type/matrix/function/matrix":"vzj5","../arithmetic/divideScalar":"R3aq","../arithmetic/addScalar":"ZM3O","../arithmetic/multiply":"k7By","../arithmetic/unaryMinus":"q5A1","../matrix/det":"KApf","./identity":"zJUT","../arithmetic/abs":"K5X1"}],"lVgQ":[function(require,module,exports) {
"use strict";var r=require("../../utils/object").extend;function t(t,e,i,a){var n=i(require("./divideScalar")),u=i(require("./multiply")),o=i(require("../matrix/inv")),x=i(require("../../type/matrix/function/matrix")),s=i(require("../../type/matrix/utils/algorithm11")),y=i(require("../../type/matrix/utils/algorithm14")),c=a("divide",r({"Array | Matrix, Array | Matrix":function(r,t){return u(r,o(t))},"DenseMatrix, any":function(r,t){return y(r,t,n,!1)},"SparseMatrix, any":function(r,t){return s(r,t,n,!1)},"Array, any":function(r,t){return y(x(r),t,n,!1).valueOf()},"any, Array | Matrix":function(r,t){return u(r,o(t))}},n.signatures));return c.toTex={2:"\\frac{${args[0]}}{${args[1]}}"},c}exports.name="divide",exports.factory=t;
},{"../../utils/object":"FcSp","./divideScalar":"R3aq","./multiply":"k7By","../matrix/inv":"yHuZ","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm14":"S2eB"}],"c7UI":[function(require,module,exports) {
"use strict";function e(e,r,n,i,t){var a=n(require("../../relational/equal")),o=n(require("../../utils/isZero")),s=n(require("../../arithmetic/add")),u=n(require("../../arithmetic/subtract")),f=n(require("../../arithmetic/multiply")),p=n(require("../../arithmetic/divide")),l=n(require("../../arithmetic/pow")),d=t.expression.node.ConstantNode,v=t.expression.node.OperatorNode,N=t.expression.node.FunctionNode,w=t.expression.node.ParenthesisNode,c=new d(0),C=new d(1);return function r(n){if(e.isOperatorNode(n)&&n.isUnary()){var i=r(n.args[0]);if("+"===n.op)return i;if("-"===n.op){if(e.isOperatorNode(i)){if(i.isUnary()&&"-"===i.op)return i.args[0];if(i.isBinary()&&"subtract"===i.fn)return new v("-","subtract",[i.args[1],i.args[0]])}return new v(n.op,n.fn,[i])}}else if(e.isOperatorNode(n)&&n.isBinary()){var t=r(n.args[0]),m=r(n.args[1]);if("+"===n.op){if(e.isConstantNode(t)){if(o(t.value))return m;if(e.isConstantNode(m))return new d(s(t.value,m.value))}return e.isConstantNode(m)&&o(m.value)?t:e.isOperatorNode(m)&&m.isUnary()&&"-"===m.op?new v("-","subtract",[t,m.args[0]]):new v(n.op,n.fn,m?[t,m]:[t])}if("-"===n.op){if(e.isConstantNode(t)&&m){if(e.isConstantNode(m))return new d(u(t.value,m.value));if(o(t.value))return new v("-","unaryMinus",[m])}if("subtract"===n.fn)return e.isConstantNode(m)&&o(m.value)?t:e.isOperatorNode(m)&&m.isUnary()&&"-"===m.op?r(new v("+","add",[t,m.args[0]])):new v(n.op,n.fn,[t,m])}else{if("*"===n.op){if(e.isConstantNode(t)){if(o(t.value))return c;if(a(t.value,1))return m;if(e.isConstantNode(m))return new d(f(t.value,m.value))}if(e.isConstantNode(m)){if(o(m.value))return c;if(a(m.value,1))return t;if(e.isOperatorNode(t)&&t.isBinary()&&t.op===n.op){var g=t.args[0];if(e.isConstantNode(g)){var y=new d(f(g.value,m.value));return new v(n.op,n.fn,[y,t.args[1]],n.implicit)}}return new v(n.op,n.fn,[m,t],n.implicit)}return new v(n.op,n.fn,[t,m],n.implicit)}if("/"===n.op){if(e.isConstantNode(t)){if(o(t.value))return c;if(e.isConstantNode(m)&&(a(m.value,1)||a(m.value,2)||a(m.value,4)))return new d(p(t.value,m.value))}return new v(n.op,n.fn,[t,m])}if("^"===n.op){if(e.isConstantNode(m)){if(o(m.value))return C;if(a(m.value,1))return t;if(e.isConstantNode(t))return new d(l(t.value,m.value));if(e.isOperatorNode(t)&&t.isBinary()&&"^"===t.op){var h=t.args[1];if(e.isConstantNode(h))return new v(n.op,n.fn,[t.args[0],new d(f(h.value,m.value))])}}return new v(n.op,n.fn,[t,m])}}}else{if(e.isParenthesisNode(n)){var q=r(n.content);return e.isParenthesisNode(q)||e.isSymbolNode(q)||e.isConstantNode(q)?q:new w(q)}if(e.isFunctionNode(n)){var x=n.args.map(r).map(function(r){return e.isParenthesisNode(r)?r.content:r});return new N(r(n.fn),x)}}return n}}exports.math=!0,exports.name="simplifyCore",exports.path="algebra.simplify",exports.factory=e;
},{"../../relational/equal":"IviB","../../utils/isZero":"geyZ","../../arithmetic/add":"zf2Z","../../arithmetic/subtract":"m78R","../../arithmetic/multiply":"k7By","../../arithmetic/divide":"lVgQ","../../arithmetic/pow":"CsUv"}],"hHj3":[function(require,module,exports) {
"use strict";function e(e,r,n,o,t){var i=t.expression.node.Node,s=t.expression.node.OperatorNode,a=t.expression.node.FunctionNode,p=t.expression.node.ParenthesisNode;return function r(n,o){if(!o)return n;if(e.isSymbolNode(n)){var u=o[n.name];if(u instanceof i)return r(u,o);if("number"==typeof u)return t.parse(String(u))}else{if(e.isOperatorNode(n)){var f=n.args.map(function(e){return r(e,o)});return new s(n.op,n.fn,f,n.implicit)}if(e.isParenthesisNode(n))return new p(r(n.content,o));if(e.isFunctionNode(n)){var d=n.args.map(function(e){return r(e,o)});return new a(n.name,d)}}return n}}exports.math=!0,exports.name="resolve",exports.path="algebra.simplify",exports.factory=e;
},{}],"EVZ1":[function(require,module,exports) {
"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(e)}function e(r){return(e="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(r)}function r(n,r,t,o,i){var l=t(require("../../expression/parse")),a=t(require("../relational/equal")),s=t(require("../../expression/node/ConstantNode")),u=t(require("../../expression/node/FunctionNode")),f=t(require("../../expression/node/OperatorNode")),c=t(require("../../expression/node/ParenthesisNode")),p=t(require("../../expression/node/SymbolNode")),h=t(require("./simplify/simplifyConstant")),d=t(require("./simplify/simplifyCore")),m=t(require("./simplify/resolve")),g=t(require("./simplify/util")),y=g.isCommutative,v=g.isAssociative,b=g.flatten,x=g.unflattenr,N=g.unflattenl,O=g.createMakeNodeFunction,S=o("simplify",{string:function(n){return S(l(n),S.rules,{},{})},"string, Object":function(n,e){return S(l(n),S.rules,e,{})},"string, Object, Object":function(n,e,r){return S(l(n),S.rules,e,r)},"string, Array":function(n,e){return S(l(n),e,{},{})},"string, Array, Object":function(n,e,r){return S(l(n),e,r,{})},"string, Array, Object, Object":function(n,e,r,t){return S(l(n),e,r,t)},"Node, Object":function(n,e){return S(n,S.rules,e,{})},"Node, Object, Object":function(n,e,r){return S(n,S.rules,e,r)},Node:function(n){return S(n,S.rules,{},{})},"Node, Array":function(n,e){return S(n,e,{},{})},"Node, Array, Object":function(n,e,r){return S(n,e,r,{})},"Node, Array, Object, Object":function(n,r,t,o){r=function(n){for(var r=[],t=0;t<n.length;t++){var o=n[t],i=void 0,a=e(o);switch(a){case"string":var s=o.split("->");if(2!==s.length)throw SyntaxError("Could not parse rule: "+o);o={l:s[0],r:s[1]};case"object":if(i={l:j(l(o.l)),r:j(l(o.r))},o.context&&(i.evaluate=o.context),o.evaluate&&(i.evaluate=l(o.evaluate)),v(i.l)){var u=O(i.l),f=new p("_p"+q++);i.expanded={},i.expanded.l=u([i.l.clone(),f]),b(i.expanded.l),x(i.expanded.l),i.expanded.r=u([i.r,f])}break;case"function":i=o;break;default:throw TypeError("Unsupported type of rule: "+a)}r.push(i)}return r}(r);for(var i=m(n,t),a={},s=(i=j(i)).toString({parenthesis:"all"});!a[s];){a[s]=!0,q=0;for(var u=0;u<r.length;u++)"function"==typeof r[u]?i=r[u](i,o):(b(i),i=E(i,r[u])),N(i);s=i.toString({parenthesis:"all"})}return i}});function j(e){return e.transform(function(e,r,t){return n.isParenthesisNode(e)?e.content:e})}S.simplifyCore=d,S.resolve=m;var w={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};S.rules=[d,{l:"log(e)",r:"1"},{l:"n-n1",r:"n+-n1"},{l:"-(c*v)",r:"(-c) * v"},{l:"-v",r:"(-1) * v"},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{l:"(n ^ n1) ^ n2",r:"n ^ (n1 * n2)"},{l:"n*n",r:"n^2"},{l:"n * n^n1",r:"n^(n1+1)"},{l:"n^n1 * n^n2",r:"n^(n1+n2)"},{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},{l:"n1*n2 + n2",r:"(n1+1)*n2"},{l:"n1*n3 + n2*n3",r:"(n1+n2)*n3"},{l:"n1 + -1 * (n2 + n3)",r:"n1 + -1 * n2 + -1 * n3"},h,{l:"(-n)*n1",r:"-(n*n1)"},{l:"c+v",r:"v+c",context:{add:{commutative:!1}}},{l:"v*c",r:"c*v",context:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"n-(n1+n2)",r:"n-n1-n2"},{l:"1*n",r:"n"}];var q=0;var E=o("applyRule",{"Node, Object":function(n,e){var r=n;if(r instanceof f||r instanceof u){if(r.args)for(var t=0;t<r.args.length;t++)r.args[t]=E(r.args[t],e)}else r instanceof c&&r.content&&(r.content=E(r.content,e));var o=e.r,i=P(e.l,r)[0];if(!i&&e.expanded&&(o=e.expanded.r,i=P(e.expanded.l,r)[0]),i){var l=r.implicit;r=o.clone(),l&&"implicit"in o&&(r.implicit=!0);r=function n(e){return e.isSymbolNode&&i.placeholders.hasOwnProperty(e.name)?i.placeholders[e.name].clone():e.map(n)}(r)}return r}});function A(n,e){var r={placeholders:{}};if(!n.placeholders&&!
},{"../../expression/parse":"EUvE","../relational/equal":"IviB","../../expression/node/ConstantNode":"MNuy","../../expression/node/FunctionNode":"ZLEq","../../expression/node/OperatorNode":"F3sc","../../expression/node/ParenthesisNode":"Mj7c","../../expression/node/SymbolNode":"RtSa","./simplify/simplifyConstant":"TWFw","./simplify/simplifyCore":"c7UI","./simplify/resolve":"hHj3","./simplify/util":"eDsC"}],"VLL0":[function(require,module,exports) {
"use strict";function e(e,n,r,t){var o=r(require("../../expression/parse")),a=r(require("./simplify")),i=r(require("../relational/equal")),s=r(require("../utils/isZero")),c=r(require("../utils/typeof")),u=r(require("../../type/numeric")),l=r(require("../../expression/node/ConstantNode")),w=r(require("../../expression/node/FunctionNode")),d=r(require("../../expression/node/OperatorNode")),p=r(require("../../expression/node/ParenthesisNode")),g=r(require("../../expression/node/SymbolNode")),b=t("derivative",{"Node, SymbolNode, Object":function(e,n,r){var t={};m(t,e,n.name);var o=v(e,t);return r.simplify?a(o):o},"Node, SymbolNode":function(e,n){return b(e,n,{simplify:!0})},"string, SymbolNode":function(e,n){return b(o(e),n)},"string, SymbolNode, Object":function(e,n,r){return b(o(e),n,r)},"string, string":function(e,n){return b(o(e),o(n))},"string, string, Object":function(e,n,r){return b(o(e),o(n),r)},"Node, string":function(e,n){return b(e,o(n))},"Node, string, Object":function(e,n,r){return b(e,o(n),r)}});b._simplify=!0,b.toTex=function(e){return f.apply(null,e.args)};var f=t("_derivTex",{"Node, SymbolNode":function(n,r){return e.isConstantNode(n)&&"string"===c(n.value)?f(o(n.value).toString(),r.toString(),1):f(n.toString(),r.toString(),1)},"Node, ConstantNode":function(e,n){if("string"===c(n.value))return f(e,o(n.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(e,n,r){return f(e.toString(),n.name,r.value)},"string, string, number":function(e,n,r){return(1===r?"{d\\over d"+n+"}":"{d^{"+r+"}\\over d"+n+"^{"+r+"}}")+"\\left[".concat(e,"\\right]")}}),m=t("constTag",{"Object, ConstantNode, string":function(e,n){return e[n]=!0,!0},"Object, SymbolNode, string":function(e,n,r){return n.name!==r&&(e[n]=!0,!0)},"Object, ParenthesisNode, string":function(e,n,r){return m(e,n.content,r)},"Object, FunctionAssignmentNode, string":function(e,n,r){return-1===n.params.indexOf(r)?(e[n]=!0,!0):m(e,n.expr,r)},"Object, FunctionNode | OperatorNode, string":function(e,n,r){if(n.args.length>0){for(var t=m(e,n.args[0],r),o=1;o<n.args.length;++o)t=m(e,n.args[o],r)&&t;if(t)return e[n]=!0,!0}return!1}}),v=t("_derivative",{"ConstantNode, Object":function(e){return y(0)},"SymbolNode, Object":function(e,n){return void 0!==n[e]?y(0):y(1)},"ParenthesisNode, Object":function(e,n){return new p(v(e.content,n))},"FunctionAssignmentNode, Object":function(e,n){return void 0!==n[e]?y(0):v(e.expr,n)},"FunctionNode, Object":function(e,n){if(1!==e.args.length&&function(e){if(("log"===e.name||"nthRoot"===e.name||"pow"===e.name)&&2===e.args.length)return;for(var n=0;n<e.args.length;++n)e.args[n]=y(0);throw e.compile().eval(),new Error("Expected TypeError, but none found")}(e),void 0!==n[e])return y(0);var r,t,o,a,i=e.args[0],s=!1,c=!1;switch(e.name){case"cbrt":s=!0,t=new d("*","multiply",[y(3),new d("^","pow",[i,new d("/","divide",[y(2),y(3)])])]);break;case"sqrt":case"nthRoot":if(1===e.args.length)s=!0,t=new d("*","multiply",[y(2),new w("sqrt",[i])]);else if(2===e.args.length)return n[r=new d("/","divide",[y(1),e.args[1]])]=n[e.args[1]],v(new d("^","pow",[i,r]),n);break;case"log10":r=y(10);case"log":if(r||1!==e.args.length){if(1===e.args.length&&r||2===e.args.length&&void 0!==n[e.args[1]])t=new d("*","multiply",[i.clone(),new w("log",[r||e.args[1]])]),s=!0;else if(2===e.args.length)return v(new d("/","divide",[new w("log",[i]),new w("log",[e.args[1]])]),n)}else t=i.clone(),s=!0;break;case"pow":return n[r]=n[e.args[1]],v(new d("^","pow",[i,e.args[1]]),n);case"exp":t=new w("exp",[i.clone()]);break;case"sin":t=new w("cos",[i.clone()]);break;case"cos":t=new d("-","unaryMinus",[new w("sin",[i.clone()])]);break;case"tan":t=new d("^","pow",[new w("sec",[i.clone()]),y(2)]);break;case"sec":t=new d("*","multiply",[e,new w("tan",[i.clone()])]);break;case"csc":c=!0,t=new d("*","multiply",[e,new w("cot",[i.clone()])]);break;case"cot":c=!0,t=new d("^","pow",[new w("csc",[i.clone()]),y(2)]);break;case"asin":s=!0,t=new w("sqrt",[new d("-","subtract",[y(1),new d("^","pow",[i.clone(),y(2)])])]);brea
},{"../../expression/parse":"EUvE","./simplify":"EVZ1","../relational/equal":"IviB","../utils/isZero":"geyZ","../utils/typeof":"LZTG","../../type/numeric":"aA7E","../../expression/node/ConstantNode":"MNuy","../../expression/node/FunctionNode":"ZLEq","../../expression/node/OperatorNode":"F3sc","../../expression/node/ParenthesisNode":"Mj7c","../../expression/node/SymbolNode":"RtSa"}],"uJKc":[function(require,module,exports) {
"use strict";function r(r,t,e,a){var s=e(require("../parse"));return a("parse",{"string | Array | Matrix":s,"string | Array | Matrix, Object":s})}exports.name="parse",exports.factory=r;
},{"../parse":"EUvE"}],"wmjX":[function(require,module,exports) {
"use strict";function n(n,r,e,o){var t=e(require("./simplify")),i=e(require("./simplify/simplifyCore")),a=e(require("./simplify/simplifyConstant")),l=e(require("../../expression/function/parse")),s=require("../../utils/number"),f=e(require("../../expression/node/ConstantNode")),u=e(require("../../expression/node/OperatorNode")),c=e(require("../../expression/node/SymbolNode")),p=o("rationalize",{string:function(n){return p(l(n),{},!1)},"string, boolean":function(n,r){return p(l(n),{},r)},"string, Object":function(n,r){return p(l(n),r,!1)},"string, Object, boolean":function(n,r,e){return p(l(n),r,e)},Node:function(n){return p(n,{},!1)},"Node, boolean":function(n,r){return p(n,{},r)},"Node, Object":function(n,r){return p(n,r,!1)},"Node, Object, boolean":function(n,r,e){var o=function(){var n=[i,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},a,{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"1*n",r:"n"}],r=[{l:"(-n1)/(-n2)",r:"n1/n2"},{l:"(-n1)*(-n2)",r:"n1*n2"},{l:"n1--n2",r:"n1+n2"},{l:"n1-n2",r:"n1+(-n2)"},{l:"(n1+n2)*n3",r:"(n1*n3 + n2*n3)"},{l:"n1*(n2+n3)",r:"(n1*n2+n1*n3)"},{l:"c1*n + c2*n",r:"(c1+c2)*n"},{l:"c1*n + n",r:"(c1+1)*n"},{l:"c1*n - c2*n",r:"(c1-c2)*n"},{l:"c1*n - n",r:"(c1-1)*n"},{l:"v/c",r:"(1/c)*v"},{l:"v/-c",r:"-(1/c)*v"},{l:"-v*-c",r:"c*v"},{l:"-v*c",r:"-c*v"},{l:"v*-c",r:"-c*v"},{l:"v*c",r:"c*v"},{l:"-(-n1*n2)",r:"(n1*n2)"},{l:"-(n1*n2)",r:"(-n1*n2)"},{l:"-(-n1+n2)",r:"(n1-n2)"},{l:"-(n1+n2)",r:"(-n1-n2)"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"},{l:"-(-n1/n2)",r:"(n1/n2)"},{l:"-(n1/n2)",r:"(-n1/n2)"}],e=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],o={};return o.firstRules=n.concat(r,e),o.distrDivRules=[{l:"(n1/n2 + n3/n4)",r:"((n1*n4 + n3*n2)/(n2*n4))"},{l:"(n1/n2 + n3)",r:"((n1 + n3*n2)/n2)"},{l:"(n1 + n2/n3)",r:"((n1*n3 + n2)/n3)"}],o.sucDivRules=e,o.firstRulesAgain=n.concat(r),o.finalRules=[i,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},a,{l:"n*-n^n1",r:"-n^(n1+1)"},{l:"n*n^n1",r:"n^(n1+1)"},{l:"n^n1*-n^n2",r:"-n^(n1+n2)"},{l:"n^n1*n^n2",r:"n^(n1+n2)"},{l:"n^n1*-n",r:"-n^(n1+1)"},{l:"n^n1*n",r:"n^(n1+1)"},{l:"n^n1/-n",r:"-n^(n1-1)"},{l:"n^n1/n",r:"n^(n1-1)"},{l:"n/-n^n1",r:"-n^(1-n1)"},{l:"n/n^n1",r:"n^(1-n1)"},{l:"n^n1/-n^n2",r:"n^(n1-n2)"},{l:"n^n1/n^n2",r:"n^(n1-n2)"},{l:"n1+(-n2*n3)",r:"n1-n2*n3"},{l:"v*(-c)",r:"-c*v"},{l:"n1+-n2",r:"n1-n2"},{l:"v*c",r:"c*v"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"}],o}(),l=function(n,r,e,o){var i=[],a=t(n,o,r,{exactFractions:!1}),l="+-*"+((e=!!e)?"/":"");!function n(r){var e=r.type;if("FunctionNode"===e)throw new Error("There is an unsolved function call");if("OperatorNode"===e)if("^"===r.op){if("unaryMinus"===r.args[1].fn&&(r=r.args[0]),"ConstantNode"!==r.args[1].type||!s.isInteger(parseFloat(r.args[1].value)))throw new Error("There is a non-integer exponent");n(r.args[0])}else{if(-1===l.indexOf(r.op))throw new Error("Operator "+r.op+" invalid in polynomial expression");for(var o=0;o<r.args.length;o++)n(r.args[o])}else if("SymbolNode"===e){var t=r.name,a=i.indexOf(t);-1===a&&i.push(t)}else if("ParenthesisNode"===e)n(r.content);else if("ConstantNode"!==e)throw new Error("type "+e+" is not allowed in polynomial expression")}(a);var f={};return f.expression=a,f.variables=i,f}(n,r,!0,o.firstRules),c=l.variables.length;if(n=l.expression,c>=1){var p,d;n=function n(r,e,o){var t=r.type;var i=arguments.length>1;if("OperatorNode"===t&&r.isBinary()){var a,l=!1;if("^"===r.op&&("ParenthesisNode"!==r.args[0].type&&"OperatorNode"!==r.args[0].type||"ConstantNode"!==r.args[1].type||(a=parseFloat(r.args[1].value),l=a>=2&&s.isInteger(a))),l){if(a>2){var c=r.args[0],p=new u("^","pow",[r.args[0].cloneDeep(),new f(a-1)]);r=new u("*","multiply",[c,p])}else r=new u("*","multiply",[r.args[0],r.args[0].cloneDeep()]);i&&("content"===o?e.content=r:e.args[o]=r)}}if("ParenthesisNode"===t)n(r.content,r,"content");else if("ConstantNode"!==t&&"SymbolNode"!==t)for(var v=0;v<r.args.length;v++)n(r.args[v],r,v);if(!i)return r}(n);var w,g=!0,h=!1;for(n=t(n,o.firstRules,{},{exactFractions:!1});d=g?o.distrDivRules:o.sucDivRules,g=!g,(w=(n=t(n,d))
},{"./simplify":"EVZ1","./simplify/simplifyCore":"c7UI","./simplify/simplifyConstant":"TWFw","../../expression/function/parse":"uJKc","../../utils/number":"uqMu","../../expression/node/ConstantNode":"MNuy","../../expression/node/OperatorNode":"F3sc","../../expression/node/SymbolNode":"RtSa"}],"npE3":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").nearlyEqual,n=require("../../utils/bignumber/nearlyEqual");function e(e,t,u,i){var a=u(require("../../type/matrix/function/matrix")),o=u(require("../../type/matrix/utils/algorithm03")),l=u(require("../../type/matrix/utils/algorithm07")),s=u(require("../../type/matrix/utils/algorithm12")),f=u(require("../../type/matrix/utils/algorithm13")),c=u(require("../../type/matrix/utils/algorithm14")),x=require("../../utils/latex"),y=i("unequal",{"any, any":function(r,n){return null===r?null!==n:null===n?null!==r:void 0===r?void 0!==n:void 0===n?void 0!==r:m(r,n)},"SparseMatrix, SparseMatrix":function(r,n){return l(r,n,m)},"SparseMatrix, DenseMatrix":function(r,n){return o(n,r,m,!0)},"DenseMatrix, SparseMatrix":function(r,n){return o(r,n,m,!1)},"DenseMatrix, DenseMatrix":function(r,n){return f(r,n,m)},"Array, Array":function(r,n){return y(a(r),a(n)).valueOf()},"Array, Matrix":function(r,n){return y(a(r),n)},"Matrix, Array":function(r,n){return y(r,a(n))},"SparseMatrix, any":function(r,n){return s(r,n,m,!1)},"DenseMatrix, any":function(r,n){return c(r,n,m,!1)},"any, SparseMatrix":function(r,n){return s(n,r,m,!0)},"any, DenseMatrix":function(r,n){return c(n,r,m,!0)},"Array, any":function(r,n){return c(a(r),n,m,!1).valueOf()},"any, Array":function(r,n){return c(a(n),r,m,!0).valueOf()}}),m=i("_unequal",{"boolean, boolean":function(r,n){return r!==n},"number, number":function(n,e){return!r(n,e,t.epsilon)},"BigNumber, BigNumber":function(r,e){return!n(r,e,t.epsilon)},"Fraction, Fraction":function(r,n){return!r.equals(n)},"Complex, Complex":function(r,n){return!r.equals(n)},"Unit, Unit":function(r,n){if(!r.equalBase(n))throw new Error("Cannot compare units with different base");return y(r.value,n.value)}});return y.toTex={2:"\\left(${args[0]}".concat(x.operators.unequal,"${args[1]}\\right)")},y}exports.name="unequal",exports.factory=e;
},{"../../utils/number":"uqMu","../../utils/bignumber/nearlyEqual":"Uu9K","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm07":"u44a","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB","../../utils/latex":"H1Mr"}],"Zr7Q":[function(require,module,exports) {
"use strict";var r=require("../../utils/number"),n=require("../../utils/collection/deepMap");function e(e,t,i,u){var o=u("sign",{number:r.sign,Complex:function(r){return r.sign()},BigNumber:function(r){return new e.BigNumber(r.cmp(0))},Fraction:function(r){return new e.Fraction(r.s,1)},"Array | Matrix":function(r){return n(r,o,!0)},Unit:function(r){return o(r.value)}});return o.toTex={1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},o}exports.name="sign",exports.factory=e;
},{"../../utils/number":"uqMu","../../utils/collection/deepMap":"lOYo"}],"T6pB":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function t(t,e,n,i){var u=i("sqrt",{number:o,Complex:function(r){return r.sqrt()},BigNumber:function(r){return!r.isNegative()||e.predictable?r.sqrt():o(r.toNumber())},"Array | Matrix":function(t){return r(t,u,!0)},Unit:function(r){return r.pow(.5)}});function o(r){return isNaN(r)?NaN:r>=0||e.predictable?Math.sqrt(r):new t.Complex(r,0).sqrt()}return u.toTex={1:"\\sqrt{${args[0]}}"},u}exports.name="sqrt",exports.factory=t;
},{"../../utils/collection/deepMap":"lOYo"}],"msvi":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function t(t,n,e,u){var o=u("conj",{number:function(r){return r},BigNumber:function(r){return r},Complex:function(r){return r.conjugate()},"Array | Matrix":function(t){return r(t,o)}});return o.toTex={1:"\\left(${args[0]}\\right)^*"},o}exports.name="conj",exports.factory=t;
},{"../../utils/collection/deepMap":"lOYo"}],"fqqA":[function(require,module,exports) {
"use strict";function r(r,e,t,i){var a=t(require("../../../type/matrix/function/matrix")),n=t(require("../../matrix/zeros")),o=t(require("../../matrix/identity")),u=t(require("../../utils/isZero")),c=t(require("../../relational/unequal")),f=t(require("../../arithmetic/sign")),s=t(require("../../arithmetic/sqrt")),m=t(require("../../complex/conj")),q=t(require("../../arithmetic/unaryMinus")),l=t(require("../../arithmetic/addScalar")),h=t(require("../../arithmetic/divideScalar")),v=t(require("../../arithmetic/multiplyScalar")),d=t(require("../../arithmetic/subtract"));function x(r){var e,t,i,a=r._size[0],x=r._size[1],p=o([a],"dense"),y=p._data,S=r.clone(),w=S._data,R=n([a],"");for(i=0;i<Math.min(x,a);++i){var g=w[i][i],Q=q(f(g)),M=m(Q),_=0;for(e=i;e<a;e++)_=l(_,v(w[e][i],m(w[e][i])));var z=v(Q,s(_));if(!u(z)){var E=d(g,z);for(R[i]=1,e=i+1;e<a;e++)R[e]=h(w[e][i],E);var O=q(m(h(E,z))),b=void 0;for(t=i;t<x;t++){for(b=0,e=i;e<a;e++)b=l(b,v(m(R[e]),w[e][t]));for(b=v(b,O),e=i;e<a;e++)w[e][t]=v(d(w[e][t],v(R[e],b)),M)}for(e=0;e<a;e++){for(b=0,t=i;t<a;t++)b=l(b,v(y[e][t],R[t]));for(b=v(b,O),t=i;t<a;++t)y[e][t]=h(d(y[e][t],v(b,m(R[t]))),M)}}}for(e=0;e<a;++e)for(t=0;t<e&&t<x;++t){if(c(0,h(w[e][t],1e5)))throw new Error("math.qr(): unknown error - R is not lower triangular (element ("+e+", "+t+") = "+w[e][t]+")");w[e][t]=v(w[e][t],0)}return{Q:p,R:S,toString:function(){return"Q: "+this.Q.toString()+"\nR: "+this.R.toString()}}}return i("qr",{DenseMatrix:function(r){return x(r)},SparseMatrix:function(r){return function(r){throw new Error("qr not implemented for sparse matrices yet")}()},Array:function(r){var e=x(a(r));return{Q:e.Q.valueOf(),R:e.R.valueOf()}}})}exports.name="qr",exports.factory=r;
},{"../../../type/matrix/function/matrix":"vzj5","../../matrix/zeros":"BAjv","../../matrix/identity":"zJUT","../../utils/isZero":"geyZ","../../relational/unequal":"npE3","../../arithmetic/sign":"Zr7Q","../../arithmetic/sqrt":"T6pB","../../complex/conj":"msvi","../../arithmetic/unaryMinus":"q5A1","../../arithmetic/addScalar":"ZM3O","../../arithmetic/divideScalar":"R3aq","../../arithmetic/multiplyScalar":"obRw","../../arithmetic/subtract":"m78R"}],"da3s":[function(require,module,exports) {
"use strict";function r(){return function(r){return-r-2}}exports.name="csFlip",exports.path="algebra.sparse",exports.factory=r;
},{}],"ppxA":[function(require,module,exports) {
"use strict";function e(){return function(e,r,t){for(var s=e._values,n=e._index,a=e._ptr,p=e._size[1],o=0,c=0;c<p;c++){var i=a[c];for(a[c]=o;i<a[c+1];i++)r(n[i],c,s?s[i]:1,t)&&(n[o]=n[i],s&&(s[o]=s[i]),o++)}return a[p]=o,n.splice(o,n.length-o),s&&s.splice(o,s.length-o),o}}exports.name="csFkeep",exports.path="algebra.sparse",exports.factory=e;
},{}],"xmPn":[function(require,module,exports) {
"use strict";function r(){return function(r,t,e,s,a,n,o){var c=0;for(e[o]=r;c>=0;){var f=e[o+c],p=e[s+f];-1===p?(c--,n[t++]=f):(e[s+f]=e[a+p],e[o+ ++c]=p)}return t}}exports.name="csTdfs",exports.path="algebra.sparse",exports.factory=r;
},{}],"C2z0":[function(require,module,exports) {
"use strict";var r=require("../../utils/object").clone,e=require("../../utils/string").format;function t(t,a,n,s){var o=require("../../utils/latex"),i=n(require("../../type/matrix/function/matrix")),u=t.DenseMatrix,c=t.SparseMatrix,f=s("transpose",{Array:function(r){return f(i(r)).valueOf()},Matrix:function(t){var a,n=t.size();switch(n.length){case 1:a=t.clone();break;case 2:var s=n[0],o=n[1];if(0===o)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+e(n)+")");switch(t.storage()){case"dense":a=function(e,t,a){for(var n,s=e._data,o=[],i=0;i<a;i++){n=o[i]=[];for(var c=0;c<t;c++)n[c]=r(s[c][i])}return new u({data:o,size:[a,t],datatype:e._datatype})}(t,s,o);break;case"sparse":a=function(e,t,a){for(var n,s,o,i=e._values,u=e._index,f=e._ptr,p=i?[]:void 0,l=[],v=[],x=[],d=0;d<t;d++)x[d]=0;for(n=0,s=u.length;n<s;n++)x[u[n]]++;for(var h=0,w=0;w<t;w++)v.push(h),h+=x[w],x[w]=v[w];for(v.push(h),o=0;o<a;o++)for(var g=f[o],m=f[o+1],y=g;y<m;y++){var _=x[u[y]]++;l[_]=o,i&&(p[_]=r(i[y]))}return new c({values:p,index:l,ptr:v,size:[a,t],datatype:e._datatype})}(t,s,o)}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+e(this._size)+")")}return a},any:function(e){return r(e)}});return f.toTex={1:"\\left(${args[0]}\\right)".concat(o.operators.transpose)},f}exports.name="transpose",exports.factory=t;
},{"../../utils/object":"FcSp","../../utils/string":"PshC","../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5"}],"tamT":[function(require,module,exports) {
"use strict";function r(r,f,a){var e=a(require("./csFlip")),t=a(require("./csFkeep")),i=a(require("./csTdfs")),o=a(require("../../arithmetic/add")),n=a(require("../../arithmetic/multiply")),u=a(require("../../matrix/transpose"));function v(r,f,a,e,t){if(r<2||r+f<0){for(var i=0;i<t;i++)0!==a[e+i]&&(a[e+i]=1);r=2}return r}function s(r,f){return r!==f}return function(r,f){if(!f||r<=0||r>3)return null;var a=f._size,c=a[0],l=a[1],m=0,p=Math.max(16,10*Math.sqrt(l)),h=function(r,f,a,e,t){var i=u(f);if(1===r&&e===a)return o(f,i);if(2===r){for(var v=i._index,s=i._ptr,c=0,l=0;l<a;l++){var m=s[l];if(s[l]=c,!(s[l+1]-m>t))for(var p=s[l+1];m<p;m++)v[c++]=v[m]}return s[a]=c,f=u(i),n(i,f)}return n(i,f)}(r,f,c,l,p=Math.min(l-2,p));t(h,s,null);for(var x,q,M,d,_,g,y,F,b,k,z,A,T,j,w,B,C=h._index,D=h._ptr,E=D[l],G=[],H=[],I=l+1,J=2*(l+1),K=3*(l+1),L=4*(l+1),N=5*(l+1),O=6*(l+1),P=7*(l+1),Q=G,R=function(r,f,a,e,t,i,o,n,u,s,c,l){for(var m=0;m<r;m++)a[e+m]=f[m+1]-f[m];a[e+r]=0;for(var p=0;p<=r;p++)a[t+p]=-1,i[p]=-1,a[o+p]=-1,a[n+p]=-1,a[u+p]=1,a[s+p]=1,a[c+p]=0,a[l+p]=a[e+p];var h=v(0,0,a,s,r);return a[c+r]=-2,f[r]=-1,a[s+r]=0,h}(l,D,H,0,K,Q,J,P,I,O,L,N),S=function(r,f,a,t,i,o,n,u,v,s,c){for(var l=0,m=0;m<r;m++){var p=a[t+m];if(0===p)a[i+m]=-2,l++,f[m]=-1,a[o+m]=0;else if(p>n)a[u+m]=0,a[i+m]=-1,l++,f[m]=e(r),a[u+r]++;else{var h=a[v+p];-1!==h&&(s[h]=m),a[c+m]=a[v+p],a[v+p]=m}}return l}(l,D,H,N,L,O,p,I,K,Q,J),U=0;S<l;){for(M=-1;U<l&&-1===(M=H[K+U]);U++);-1!==H[J+M]&&(Q[H[J+M]]=-1),H[K+U]=H[J+M];var V=H[L+M],W=H[I+M];S+=W;var X=0;H[I+M]=-W;var Y=D[M],Z=0===V?Y:E,$=Z;for(d=1;d<=V+1;d++){for(d>V?(g=M,y=Y,F=H[0+M]-V):(y=D[g=C[Y++]],F=H[0+g]),_=1;_<=F;_++)(b=H[I+(x=C[y++])])<=0||(X+=b,H[I+x]=-b,C[$++]=x,-1!==H[J+x]&&(Q[H[J+x]]=Q[x]),-1!==Q[x]?H[J+Q[x]]=H[J+x]:H[K+H[N+x]]=H[J+x]);g!==M&&(D[g]=e(M),H[O+g]=0)}for(0!==V&&(E=$),H[N+M]=X,D[M]=Z,H[0+M]=$-Z,H[L+M]=-2,R=v(R,m,H,O,l),k=Z;k<$;k++)if(!((z=H[L+(x=C[k])])<=0)){var rr=R-(b=-H[I+x]);for(Y=D[x],A=D[x]+z-1;Y<=A;Y++)H[O+(g=C[Y])]>=R?H[O+g]-=b:0!==H[O+g]&&(H[O+g]=H[N+g]+rr)}for(k=Z;k<$;k++){for(T=(A=D[x=C[k]])+H[L+x]-1,j=A,w=0,B=0,Y=A;Y<=T;Y++)if(0!==H[O+(g=C[Y])]){var fr=H[O+g]-R;fr>0?(B+=fr,C[j++]=g,w+=g):(D[g]=e(M),H[O+g]=0)}H[L+x]=j-A+1;var ar=j,er=A+H[0+x];for(Y=T+1;Y<er;Y++){var tr=H[I+(q=C[Y])];tr<=0||(B+=tr,C[j++]=q,w+=q)}0===B?(D[x]=e(M),X-=b=-H[I+x],W+=b,S+=b,H[I+x]=0,H[L+x]=-1):(H[N+x]=Math.min(H[N+x],B),C[j]=C[ar],C[ar]=C[A],C[A]=M,H[0+x]=j-A+1,w=(w<0?-w:w)%l,H[J+x]=H[P+w],H[P+w]=x,Q[x]=w)}for(H[N+M]=X,R=v(R+(m=Math.max(m,X)),m,H,O,l),k=Z;k<$;k++)if(!(H[I+(x=C[k])]>=0))for(x=H[P+(w=Q[x])],H[P+w]=-1;-1!==x&&-1!==H[J+x];x=H[J+x],R++){for(F=H[0+x],z=H[L+x],Y=D[x]+1;Y<=D[x]+F-1;Y++)H[O+C[Y]]=R;var ir=x;for(q=H[J+x];-1!==q;){var or=H[0+q]===F&&H[L+q]===z;for(Y=D[q]+1;or&&Y<=D[q]+F-1;Y++)H[O+C[Y]]!==R&&(or=0);or?(D[q]=e(x),H[I+x]+=H[I+q],H[I+q]=0,H[L+q]=-1,q=H[J+q],H[J+ir]=q):(ir=q,q=H[J+q])}}for(Y=Z,k=Z;k<$;k++)(b=-H[I+(x=C[k])])<=0||(H[I+x]=b,B=H[N+x]+X-b,-1!==H[K+(B=Math.min(B,l-S-b))]&&(Q[H[K+B]]=x),H[J+x]=H[K+B],Q[x]=-1,H[K+B]=x,U=Math.min(U,B),H[N+x]=B,C[Y++]=x);H[I+M]=W,0==(H[0+M]=Y-Z)&&(D[M]=-1,H[O+M]=0),0!==V&&(E=Y)}for(x=0;x<l;x++)D[x]=e(D[x]);for(q=0;q<=l;q++)H[K+q]=-1;for(q=l;q>=0;q--)H[I+q]>0||(H[J+q]=H[K+D[q]],H[K+D[q]]=q);for(g=l;g>=0;g--)H[I+g]<=0||-1!==D[g]&&(H[J+g]=H[K+D[g]],H[K+D[g]]=g);for(M=0,x=0;x<=l;x++)-1===D[x]&&(M=i(x,M,H,K,J,G,O));return G.splice(G.length-1,1),G}}exports.name="csAmd",exports.path="algebra.sparse",exports.factory=r;
},{"./csFlip":"da3s","./csFkeep":"ppxA","./csTdfs":"xmPn","../../arithmetic/add":"zf2Z","../../arithmetic/multiply":"k7By","../../matrix/transpose":"C2z0"}],"rGf9":[function(require,module,exports) {
"use strict";function e(e){var r=e.SparseMatrix;return function(e,a,t,s){for(var n=e._values,p=e._index,u=e._ptr,i=e._size,o=e._datatype,v=i[0],l=i[1],x=s&&e._values?[]:null,_=[],c=[],f=0,d=0;d<l;d++){c[d]=f;for(var y=t?t[d]:d,m=u[y],z=u[y+1],b=m;b<z;b++){var g=a?a[p[b]]:p[b];_[f]=g,x&&(x[f]=n[b]),f++}}return c[l]=f,new r({values:x,index:_,ptr:c,size:[v,l],datatype:o})}}exports.name="csPermute",exports.path="algebra.sparse",exports.factory=e;
},{}],"vEli":[function(require,module,exports) {
"use strict";function r(){return function(r,e){if(!r)return null;var t,a,n=r._index,o=r._ptr,f=r._size,s=f[0],i=f[1],u=[],p=[],c=i;if(e)for(t=0;t<s;t++)p[c+t]=-1;for(var v=0;v<i;v++){u[v]=-1,p[0+v]=-1;for(var x=o[v],l=o[v+1],_=x;_<l;_++){var b=n[_];for(t=e?p[c+b]:b;-1!==t&&t<v;t=a)a=p[0+t],p[0+t]=v,-1===a&&(u[t]=v);e&&(p[c+b]=v)}}return u}}exports.name="csEtree",exports.path="algebra.sparse",exports.factory=r;
},{}],"ONfv":[function(require,module,exports) {
"use strict";function r(r,t,e){var s=e(require("./csTdfs"));return function(r,t){if(!r)return null;var e,o=0,n=[],a=[],f=t,u=2*t;for(e=0;e<t;e++)a[0+e]=-1;for(e=t-1;e>=0;e--)-1!==r[e]&&(a[f+e]=a[0+r[e]],a[0+r[e]]=e);for(e=0;e<t;e++)-1===r[e]&&(o=s(e,o,a,0,f,n,u));return n}}exports.name="csPost",exports.path="algebra.sparse",exports.factory=r;
},{"./csTdfs":"xmPn"}],"R1Om":[function(require,module,exports) {
"use strict";function r(){return function(r,e,t,a,f,s,n){var o,u,c,i,p=0;if(r<=e||t[a+e]<=t[f+r])return-1;if(t[f+r]=t[a+e],c=t[s+r],t[s+r]=e,-1===c)p=1,i=r;else{for(p=2,i=c;i!==t[n+i];i=t[n+i]);for(o=c;o!==i;o=u)u=t[n+o],t[n+o]=i}return{jleaf:p,q:i}}}exports.name="csLeaf",exports.path="algebra.sparse",exports.factory=r;
},{}],"OmuS":[function(require,module,exports) {
"use strict";function r(r,e,f){var o=f(require("../../matrix/transpose")),t=f(require("./csLeaf"));return function(r,e,f,a){if(!r||!e||!f)return null;var n,s,i,u,p,c,l,x=r._size,v=x[0],m=x[1],q=4*m+(a?m+v+1:0),_=[],h=m,j=2*m,b=3*m,d=4*m,g=5*m+1;for(i=0;i<q;i++)_[i]=-1;var y=[],z=o(r),C=z._index,L=z._ptr;for(i=0;i<m;i++)for(y[s=f[i]]=-1===_[b+s]?1:0;-1!==s&&-1===_[b+s];s=e[s])_[b+s]=i;if(a){for(i=0;i<m;i++)_[f[i]]=i;for(n=0;n<v;n++){for(i=m,c=L[n],l=L[n+1],p=c;p<l;p++)i=Math.min(i,_[C[p]]);_[g+n]=_[d+i],_[d+i]=n}}for(n=0;n<m;n++)_[0+n]=n;for(i=0;i<m;i++){for(-1!==e[s=f[i]]&&y[e[s]]--,u=a?_[d+i]:s;-1!==u;u=a?_[g+u]:-1)for(p=L[u];p<L[u+1];p++){n=C[p];var M=t(n,s,_,b,h,j,0);M.jleaf>=1&&y[s]++,2===M.jleaf&&y[M.q]--}-1!==e[s]&&(_[0+s]=e[s])}for(s=0;s<m;s++)-1!==e[s]&&(y[e[s]]+=y[s]);return y}}exports.name="csCounts",exports.path="algebra.sparse",exports.factory=r;
},{"../../matrix/transpose":"C2z0","./csLeaf":"R1Om"}],"VNCK":[function(require,module,exports) {
"use strict";function r(r,e,n){var t=n(require("./csAmd")),u=n(require("./csPermute")),s=n(require("./csEtree")),o=n(require("./csPost")),a=n(require("./csCounts"));return function(r,e,n){var f,i=e._ptr,p=e._size[1],c={};if(c.q=t(r,e),r&&!c.q)return null;if(n){var l=r?u(e,null,c.q,0):e;c.parent=s(l,1);var z=o(c.parent,p);if(c.cp=a(l,c.parent,z,1),l&&c.parent&&c.cp&&function(r,e){var n=r._ptr,t=r._index,u=r._size,s=u[0],o=u[1];e.pinv=[],e.leftmost=[];var a,f,i,p,c,l=e.parent,z=e.pinv,q=e.leftmost,v=[],m=s,_=s+o,x=s+2*o;for(f=0;f<o;f++)v[m+f]=-1,v[_+f]=-1,v[x+f]=0;for(a=0;a<s;a++)q[a]=-1;for(f=o-1;f>=0;f--)for(p=n[f],c=n[f+1],i=p;i<c;i++)q[t[i]]=f;for(a=s-1;a>=0;a--)z[a]=-1,-1!==(f=q[a])&&(0==v[x+f]++&&(v[_+f]=a),v[0+a]=v[m+f],v[m+f]=a);for(e.lnz=0,e.m2=s,f=0;f<o;f++)if(a=v[m+f],e.lnz++,a<0&&(a=e.m2++),z[a]=f,!(--x[f]<=0)){e.lnz+=v[x+f];var d=l[f];-1!==d&&(0===v[x+d]&&(v[_+d]=v[_+f]),v[0+v[_+f]]=v[m+d],v[m+d]=v[0+a],v[x+d]+=v[x+f])}for(a=0;a<s;a++)z[a]<0&&(z[a]=f++);return!0}(l,c))for(c.unz=0,f=0;f<p;f++)c.unz+=c.cp[f]}else c.unz=4*i[p]+p,c.lnz=c.unz;return c}}exports.name="csSqr",exports.path="algebra.sparse",exports.factory=r;
},{"./csAmd":"tamT","./csPermute":"rGf9","./csEtree":"vEli","./csPost":"ONfv","./csCounts":"OmuS"}],"d923":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").nearlyEqual,e=require("../../utils/bignumber/nearlyEqual");function t(t,n,i,a){var u=i(require("../../type/matrix/function/matrix")),o=i(require("../../type/matrix/utils/algorithm03")),l=i(require("../../type/matrix/utils/algorithm07")),s=i(require("../../type/matrix/utils/algorithm12")),f=i(require("../../type/matrix/utils/algorithm13")),c=i(require("../../type/matrix/utils/algorithm14")),x=require("../../utils/latex"),m=a("largerEq",{"boolean, boolean":function(r,e){return r>=e},"number, number":function(e,t){return e>=t||r(e,t,n.epsilon)},"BigNumber, BigNumber":function(r,t){return r.gte(t)||e(r,t,n.epsilon)},"Fraction, Fraction":function(r,e){return-1!==r.compare(e)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(r,e){if(!r.equalBase(e))throw new Error("Cannot compare units with different base");return m(r.value,e.value)},"SparseMatrix, SparseMatrix":function(r,e){return l(r,e,m)},"SparseMatrix, DenseMatrix":function(r,e){return o(e,r,m,!0)},"DenseMatrix, SparseMatrix":function(r,e){return o(r,e,m,!1)},"DenseMatrix, DenseMatrix":function(r,e){return f(r,e,m)},"Array, Array":function(r,e){return m(u(r),u(e)).valueOf()},"Array, Matrix":function(r,e){return m(u(r),e)},"Matrix, Array":function(r,e){return m(r,u(e))},"SparseMatrix, any":function(r,e){return s(r,e,m,!1)},"DenseMatrix, any":function(r,e){return c(r,e,m,!1)},"any, SparseMatrix":function(r,e){return s(e,r,m,!0)},"any, DenseMatrix":function(r,e){return c(e,r,m,!0)},"Array, any":function(r,e){return c(u(r),e,m,!1).valueOf()},"any, Array":function(r,e){return c(u(e),r,m,!0).valueOf()}});return m.toTex={2:"\\left(${args[0]}".concat(x.operators.largerEq,"${args[1]}\\right)")},m}exports.name="largerEq",exports.factory=t;
},{"../../utils/number":"uqMu","../../utils/bignumber/nearlyEqual":"Uu9K","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm07":"u44a","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB","../../utils/latex":"H1Mr"}],"HHkn":[function(require,module,exports) {
"use strict";function r(){return function(r,t){return r[t]<0}}exports.name="csMarked",exports.path="algebra.sparse",exports.factory=r;
},{}],"Lsyn":[function(require,module,exports) {
"use strict";function r(r,e,t){var s=t(require("./csFlip"));return function(r,e){r[e]=s(r[e])}}exports.name="csMark",exports.path="algebra.sparse",exports.factory=r;
},{"./csFlip":"da3s"}],"x9BP":[function(require,module,exports) {
"use strict";function r(r,e,t){var s=t(require("./csFlip"));return function(r){return r<0?s(r):r}}exports.name="csUnflip",exports.path="algebra.sparse",exports.factory=r;
},{"./csFlip":"da3s"}],"JD8V":[function(require,module,exports) {
"use strict";function r(r,e,a){var s=a(require("./csMarked")),t=a(require("./csMark")),i=a(require("./csUnflip"));return function(r,e,a,n,c){var f,o,u,p=e._index,v=e._ptr,x=e._size[1],k=0;for(n[0]=r;k>=0;){r=n[k];var q=c?c[r]:r;s(v,r)||(t(v,r),n[x+k]=q<0?0:i(v[q]));var _=1;for(o=n[x+k],u=q<0?0:i(v[q+1]);o<u;o++)if(f=p[o],!s(v,f)){n[x+k]=o,n[++k]=f,_=0;break}_&&(k--,n[--a]=r)}return a}}exports.name="csDfs",exports.path="algebra.sparse",exports.factory=r;
},{"./csMarked":"HHkn","./csMark":"Lsyn","./csUnflip":"x9BP"}],"b7WF":[function(require,module,exports) {
"use strict";function r(r,e,s){var t=s(require("./csDfs")),a=s(require("./csMarked")),c=s(require("./csMark"));return function(r,e,s,i,n){var o,u,p,f=r._ptr,x=r._size,_=e._index,q=e._ptr,v=x[1],d=v;for(u=q[s],p=q[s+1],o=u;o<p;o++){var h=_[o];a(f,h)||(d=t(h,r,d,i,n))}for(o=d;o<v;o++)c(f,i[o]);return d}}exports.name="csReach",exports.path="algebra.sparse",exports.factory=r;
},{"./csDfs":"JD8V","./csMarked":"HHkn","./csMark":"Lsyn"}],"k2Qt":[function(require,module,exports) {
"use strict";function r(r,e,t){var a=t(require("../../arithmetic/divideScalar")),i=t(require("../../arithmetic/multiply")),s=t(require("../../arithmetic/subtract")),u=t(require("./csReach"));return function(r,e,t,c,o,n,p){var v,f,l,_,h=r._values,m=r._index,x=r._ptr,d=r._size[1],q=e._values,b=e._index,y=e._ptr,S=u(r,e,t,c,n);for(v=S;v<d;v++)o[c[v]]=0;for(f=y[t],l=y[t+1],v=f;v<l;v++)o[b[v]]=q[v];for(var g=S;g<d;g++){var z=c[g],R=n?n[z]:z;if(!(R<0))for(f=x[R],l=x[R+1],o[z]=a(o[z],h[p?f:l-1]),v=p?f+1:f,_=p?l:l-1;v<_;v++){var j=m[v];o[j]=s(o[j],i(h[v],o[z]))}}return S}}exports.name="csSpsolve",exports.path="algebra.sparse",exports.factory=r;
},{"../../arithmetic/divideScalar":"R3aq","../../arithmetic/multiply":"k7By","../../arithmetic/subtract":"m78R","./csReach":"b7WF"}],"i7D2":[function(require,module,exports) {
"use strict";function r(r,e,i){var a=i(require("../../arithmetic/abs")),t=i(require("../../arithmetic/divideScalar")),l=i(require("../../arithmetic/multiply")),n=i(require("../../relational/larger")),s=i(require("../../relational/largerEq")),u=i(require("./csSpsolve")),p=r.SparseMatrix;return function(r,e,i){if(!r)return null;var c,o=r._size[1],v=100,f=100;e&&(c=e.q,v=e.lnz||v,f=e.unz||f);var h,q,g=[],x=[],m=[],z=new p({values:g,index:x,ptr:m,size:[o,o]}),d=[],S=[],b=[],w=new p({values:d,index:S,ptr:b,size:[o,o]}),y=[],L=[],E=[];for(h=0;h<o;h++)L[h]=0,y[h]=-1,m[h+1]=0;v=0,f=0;for(var M=0;M<o;M++){m[M]=v,b[M]=f;var U=c?c[M]:M,_=u(z,r,U,E,L,y,1),j=-1,k=-1;for(q=_;q<o;q++)if(y[h=E[q]]<0){var A=a(L[h]);n(A,k)&&(k=A,j=h)}else S[f]=y[h],d[f++]=L[h];if(-1===j||k<=0)return null;y[U]<0&&s(a(L[U]),l(k,i))&&(j=U);var B=L[j];for(S[f]=M,d[f++]=B,y[j]=M,x[v]=j,g[v++]=1,q=_;q<o;q++)y[h=E[q]]<0&&(x[v]=h,g[v++]=t(L[h],B)),L[h]=0}for(m[o]=v,b[o]=f,q=0;q<v;q++)x[q]=y[x[q]];return g.splice(v,g.length-v),x.splice(v,x.length-v),d.splice(f,d.length-f),S.splice(f,S.length-f),{L:z,U:w,pinv:y}}}exports.name="csLu",exports.path="algebra.sparse",exports.factory=r;
},{"../../arithmetic/abs":"K5X1","../../arithmetic/divideScalar":"R3aq","../../arithmetic/multiply":"k7By","../../relational/larger":"SrDl","../../relational/largerEq":"d923","./csSpsolve":"k2Qt"}],"g5hu":[function(require,module,exports) {
"use strict";var r=require("../../../utils/index"),t=r.number,e=t.isInteger;function n(r,t,n,i){var s=n(require("../../algebra/sparse/csSqr")),o=n(require("../../algebra/sparse/csLu"));return i("slu",{"SparseMatrix, number, number":function(r,t,n){if(!e(t)||t<0||t>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(n<0||n>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var i=s(t,r,!1),u=o(r,i,n);return{L:u.L,U:u.U,p:u.pinv,q:i.q,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\np: "+this.p.toString()+(this.q?"\nq: "+this.q.toString():"")+"\n"}}}})}exports.name="slu",exports.factory=n;
},{"../../../utils/index":"fsXI","../../algebra/sparse/csSqr":"VNCK","../../algebra/sparse/csLu":"i7D2"}],"YTfO":[function(require,module,exports) {
"use strict";var t=require("../../../../utils/index"),r=t.string,e=t.array,a=Array.isArray;function n(t){var n=t.DenseMatrix;return function(i,s,o){var m=i.size();if(2!==m.length)throw new RangeError("Matrix must be two dimensional (size: "+r.format(m)+")");var h,c,u,f=m[0];if(f!==m[1])throw new RangeError("Matrix must be square (size: "+r.format(m)+")");if(t.isMatrix(s)){var w=s.size();if(1===w.length){if(w[0]!==f)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(h=[],u=s._data,c=0;c<f;c++)h[c]=[u[c]];return new n({data:h,size:[f,1],datatype:s._datatype})}if(2===w.length){if(w[0]!==f||1!==w[1])throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if(t.isDenseMatrix(s)){if(o){for(h=[],u=s._data,c=0;c<f;c++)h[c]=[u[c][0]];return new n({data:h,size:[f,1],datatype:s._datatype})}return s}for(h=[],c=0;c<f;c++)h[c]=[0];for(var g=s._values,l=s._index,d=s._ptr,v=d[1],x=d[0];x<v;x++)h[c=l[x]][0]=g[x];return new n({data:h,size:[f,1],datatype:s._datatype})}throw new RangeError("Dimension mismatch. Matrix columns must match vector length.")}if(a(s)){var M=e.size(s);if(1===M.length){if(M[0]!==f)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(h=[],c=0;c<f;c++)h[c]=[s[c]];return new n({data:h,size:[f,1]})}if(2===M.length){if(M[0]!==f||1!==M[1])throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(h=[],c=0;c<f;c++)h[c]=[s[c][0]];return new n({data:h,size:[f,1]})}throw new RangeError("Dimension mismatch. Matrix columns must match vector length.")}}}exports.factory=n;
},{"../../../../utils/index":"fsXI"}],"LFCL":[function(require,module,exports) {
"use strict";function r(r,e,a,i){var t=a(require("../../../type/matrix/function/matrix")),n=a(require("../../arithmetic/divideScalar")),s=a(require("../../arithmetic/multiplyScalar")),u=a(require("../../arithmetic/subtract")),o=a(require("../../relational/equalScalar")),l=a(require("./utils/solveValidation")),c=r.DenseMatrix;function f(r,e){for(var a=(e=l(r,e,!0))._data,i=r._size[0],t=r._size[1],f=[],v=r._data,x=0;x<t;x++){var d=a[x][0]||0,m=void 0;if(o(d,0))m=0;else{var _=v[x][x];if(o(_,0))throw new Error("Linear system cannot be solved since matrix is singular");m=n(d,_);for(var y=x+1;y<i;y++)a[y]=[u(a[y][0]||0,s(m,v[y][x]))]}f[x]=[m]}return new c({data:f,size:[i,1]})}return i("lsolve",{"SparseMatrix, Array | Matrix":function(r,e){return function(r,e){for(var a,i,t=(e=l(r,e,!0))._data,f=r._size[0],v=r._size[1],x=r._values,d=r._index,m=r._ptr,_=[],y=0;y<v;y++){var h=t[y][0]||0;if(o(h,0))_[y]=[0];else{var p=0,q=[],w=[],z=m[y+1];for(i=m[y];i<z;i++)(a=d[i])===y?p=x[i]:a>y&&(q.push(x[i]),w.push(a));if(o(p,0))throw new Error("Linear system cannot be solved since matrix is singular");var M=n(h,p);for(i=0,z=w.length;i<z;i++)a=w[i],t[a]=[u(t[a][0]||0,s(M,q[i]))];_[y]=[M]}}return new c({data:_,size:[f,1]})}(r,e)},"DenseMatrix, Array | Matrix":function(r,e){return f(r,e)},"Array, Array | Matrix":function(r,e){return f(t(r),e).valueOf()}})}exports.name="lsolve",exports.factory=r;
},{"../../../type/matrix/function/matrix":"vzj5","../../arithmetic/divideScalar":"R3aq","../../arithmetic/multiplyScalar":"obRw","../../arithmetic/subtract":"m78R","../../relational/equalScalar":"QvIw","./utils/solveValidation":"YTfO"}],"nPqM":[function(require,module,exports) {
"use strict";function r(){return function(r,e){var t,s=e.length,n=[];if(r)for(t=0;t<s;t++)n[r[t]]=e[t];else for(t=0;t<s;t++)n[t]=e[t];return n}}exports.name="csIpvec",exports.path="algebra.sparse",exports.factory=r;
},{}],"IPbG":[function(require,module,exports) {
"use strict";function r(r,e,a,i){var t=a(require("../../../type/matrix/function/matrix")),n=a(require("../../arithmetic/divideScalar")),s=a(require("../../arithmetic/multiplyScalar")),u=a(require("../../arithmetic/subtract")),o=a(require("../../relational/equalScalar")),l=a(require("./utils/solveValidation")),c=r.DenseMatrix;function f(r,e){for(var a=(e=l(r,e,!0))._data,i=r._size[0],t=r._size[1],f=[],v=r._data,x=t-1;x>=0;x--){var d=a[x][0]||0,m=void 0;if(o(d,0))m=0;else{var _=v[x][x];if(o(_,0))throw new Error("Linear system cannot be solved since matrix is singular");m=n(d,_);for(var y=x-1;y>=0;y--)a[y]=[u(a[y][0]||0,s(m,v[y][x]))]}f[x]=[m]}return new c({data:f,size:[i,1]})}return i("usolve",{"SparseMatrix, Array | Matrix":function(r,e){return function(r,e){for(var a,i,t=(e=l(r,e,!0))._data,f=r._size[0],v=r._size[1],x=r._values,d=r._index,m=r._ptr,_=[],y=v-1;y>=0;y--){var h=t[y][0]||0;if(o(h,0))_[y]=[0];else{var p=0,q=[],w=[],z=m[y],M=m[y+1];for(i=M-1;i>=z;i--)(a=d[i])===y?p=x[i]:a<y&&(q.push(x[i]),w.push(a));if(o(p,0))throw new Error("Linear system cannot be solved since matrix is singular");var A=n(h,p);for(i=0,M=w.length;i<M;i++)a=w[i],t[a]=[u(t[a][0],s(A,q[i]))];_[y]=[A]}}return new c({data:_,size:[f,1]})}(r,e)},"DenseMatrix, Array | Matrix":function(r,e){return f(r,e)},"Array, Array | Matrix":function(r,e){return f(t(r),e).valueOf()}})}exports.name="usolve",exports.factory=r;
},{"../../../type/matrix/function/matrix":"vzj5","../../arithmetic/divideScalar":"R3aq","../../arithmetic/multiplyScalar":"obRw","../../arithmetic/subtract":"m78R","../../relational/equalScalar":"QvIw","./utils/solveValidation":"YTfO"}],"gikm":[function(require,module,exports) {
"use strict";var r=Array.isArray;function e(e,t,a,i){var n=a(require("../../../type/matrix/function/matrix")),u=a(require("../decomposition/lup")),o=a(require("../decomposition/slu")),s=a(require("../sparse/csIpvec")),l=a(require("./utils/solveValidation")),c=a(require("./usolve")),p=a(require("./lsolve")),v=i("lusolve",{"Array, Array | Matrix":function(r,e){r=n(r);var t=u(r);return f(t.L,t.U,t.p,null,e).valueOf()},"DenseMatrix, Array | Matrix":function(r,e){var t=u(r);return f(t.L,t.U,t.p,null,e)},"SparseMatrix, Array | Matrix":function(r,e){var t=u(r);return f(t.L,t.U,t.p,null,e)},"SparseMatrix, Array | Matrix, number, number":function(r,e,t,a){var i=o(r,t,a);return f(i.L,i.U,i.p,i.q,e)},"Object, Array | Matrix":function(r,e){return f(r.L,r.U,r.p,r.q,e)}}),x=function(t){if(e.isMatrix(t))return t;if(r(t))return n(t);throw new TypeError("Invalid Matrix LU decomposition")};function f(r,e,t,a,i){r=x(r),e=x(e),i=l(r,i,!1),t&&(i._data=s(t,i._data));var n=p(r,i),u=c(e,n);return a&&(u._data=s(a,u._data)),u}return v}exports.name="lusolve",exports.factory=e;
},{"../../../type/matrix/function/matrix":"vzj5","../decomposition/lup":"IRmO","../decomposition/slu":"g5hu","../sparse/csIpvec":"nPqM","./utils/solveValidation":"YTfO","./usolve":"IPbG","./lsolve":"LFCL"}],"VeYJ":[function(require,module,exports) {
"use strict";module.exports=[require("./derivative"),require("./simplify"),require("./rationalize"),require("./decomposition/qr"),require("./decomposition/lup"),require("./decomposition/slu"),require("./solver/lsolve"),require("./solver/lusolve"),require("./solver/usolve")];
},{"./derivative":"VLL0","./simplify":"EVZ1","./rationalize":"wmjX","./decomposition/qr":"fqqA","./decomposition/lup":"IRmO","./decomposition/slu":"g5hu","./solver/lsolve":"LFCL","./solver/lusolve":"gikm","./solver/usolve":"IPbG"}],"HYoC":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function e(e,t,n,i){var u=i("isNegative",{number:function(r){return r<0},BigNumber:function(r){return r.isNeg()&&!r.isZero()&&!r.isNaN()},Fraction:function(r){return r.s<0},Unit:function(r){return u(r.value)},"Array | Matrix":function(e){return r(e,u)}});return u}exports.name="isNegative",exports.factory=e;
},{"../../utils/collection/deepMap":"lOYo"}],"N7RE":[function(require,module,exports) {
"use strict";var e=require("../../utils/collection/deepMap");function r(r,u,a,n){var i=a(require("./unaryMinus")),l=a(require("../utils/isNegative")),o=a(require("../../type/matrix/function/matrix")),v=n("cbrt",{number:t,Complex:m,"Complex, boolean":m,BigNumber:function(e){return e.cbrt()},Unit:function(e){if(e.value&&r.isComplex(e.value)){var t=e.clone();return t.value=1,(t=t.pow(1/3)).value=m(e.value),t}var u,a=l(e.value);a&&(e.value=i(e.value)),u=r.isBigNumber(e.value)?new r.BigNumber(1).div(3):r.isFraction(e.value)?new r.Fraction(1,3):1/3;var n=e.pow(u);return a&&(n.value=i(n.value)),n},"Array | Matrix":function(r){return e(r,v,!0)}});function m(e,a){var n=e.arg()/3,i=e.abs(),l=new r.Complex(t(i),0).mul(new r.Complex(0,n).exp());if(a){var v=[l,new r.Complex(t(i),0).mul(new r.Complex(0,n+2*Math.PI/3).exp()),new r.Complex(t(i),0).mul(new r.Complex(0,n-2*Math.PI/3).exp())];return"Array"===u.matrix?v:o(v)}return l}return v.toTex={1:"\\sqrt[3]{${args[0]}}"},v}var t=Math.cbrt||function(e){if(0===e)return e;var r,t=e<0;return t&&(e=-e),r=isFinite(e)?(e/((r=Math.exp(Math.log(e)/3))*r)+2*r)/3:e,t?-r:r};exports.name="cbrt",exports.factory=r;
},{"../../utils/collection/deepMap":"lOYo","./unaryMinus":"q5A1","../utils/isNegative":"HYoC","../../type/matrix/function/matrix":"vzj5"}],"qFQg":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function t(t,n,e,u){var i=u("cube",{number:function(r){return r*r*r},Complex:function(r){return r.mul(r).mul(r)},BigNumber:function(r){return r.times(r).times(r)},Fraction:function(r){return r.pow(3)},"Array | Matrix":function(t){return r(t,i,!0)},Unit:function(r){return r.pow(3)}});return i.toTex={1:"\\left(${args[0]}\\right)^3"},i}exports.name="cube",exports.factory=t;
},{"../../utils/collection/deepMap":"lOYo"}],"j4Xj":[function(require,module,exports) {
"use strict";var r=require("../../../error/DimensionError");function e(e,t,a,n){var i=a(require("../../../function/relational/equalScalar")),o=e.SparseMatrix;return function(e,t,a,s){var h=e._data,p=e._size,u=e._datatype,f=t._values,l=t._index,v=t._ptr,c=t._size,d=t._datatype;if(p.length!==c.length)throw new r(p.length,c.length);if(p[0]!==c[0]||p[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+p+") must match Matrix B ("+c+")");if(!f)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var g,m=p[0],x=p[1],_=i,w=0,y=a;"string"==typeof u&&u===d&&(g=u,_=n.find(i,[g,g]),w=n.convert(0,g),y=n.find(a,[g,g]));for(var M=[],q=[],z=[],D=0;D<x;D++){z[D]=q.length;for(var E=v[D],S=v[D+1],A=E;A<S;A++){var B=l[A],C=s?y(f[A],h[B][D]):y(h[B][D],f[A]);_(C,w)||(q.push(B),M.push(C))}}return z[x]=q.length,new o({values:M,index:q,ptr:z,size:[m,x],datatype:g})}}exports.name="algorithm02",exports.factory=e;
},{"../../../error/DimensionError":"YiAw","../../../function/relational/equalScalar":"QvIw"}],"JrX5":[function(require,module,exports) {
"use strict";function r(r,t,e,i){var a=e(require("../../type/matrix/function/matrix")),n=e(require("./divideScalar")),u=require("../../utils/latex"),o=e(require("../../type/matrix/utils/algorithm02")),s=e(require("../../type/matrix/utils/algorithm03")),x=e(require("../../type/matrix/utils/algorithm07")),y=e(require("../../type/matrix/utils/algorithm11")),l=e(require("../../type/matrix/utils/algorithm12")),c=e(require("../../type/matrix/utils/algorithm13")),f=e(require("../../type/matrix/utils/algorithm14")),m=i("dotDivide",{"any, any":n,"SparseMatrix, SparseMatrix":function(r,t){return x(r,t,n,!1)},"SparseMatrix, DenseMatrix":function(r,t){return o(t,r,n,!0)},"DenseMatrix, SparseMatrix":function(r,t){return s(r,t,n,!1)},"DenseMatrix, DenseMatrix":function(r,t){return c(r,t,n)},"Array, Array":function(r,t){return m(a(r),a(t)).valueOf()},"Array, Matrix":function(r,t){return m(a(r),t)},"Matrix, Array":function(r,t){return m(r,a(t))},"SparseMatrix, any":function(r,t){return y(r,t,n,!1)},"DenseMatrix, any":function(r,t){return f(r,t,n,!1)},"any, SparseMatrix":function(r,t){return l(t,r,n,!0)},"any, DenseMatrix":function(r,t){return f(t,r,n,!0)},"Array, any":function(r,t){return f(a(r),t,n,!1).valueOf()},"any, Array":function(r,t){return f(a(t),r,n,!0).valueOf()}});return m.toTex={2:"\\left(${args[0]}".concat(u.operators.dotDivide,"${args[1]}\\right)")},m}exports.name="dotDivide",exports.factory=r;
},{"../../type/matrix/function/matrix":"vzj5","./divideScalar":"R3aq","../../utils/latex":"H1Mr","../../type/matrix/utils/algorithm02":"j4Xj","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm07":"u44a","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"PvZY":[function(require,module,exports) {
"use strict";var r=require("../../../error/DimensionError");function e(e,t,a,i){var n=a(require("../../../function/relational/equalScalar")),o=e.SparseMatrix;return function(e,t,a){var s=e._values,u=e._index,l=e._ptr,f=e._size,h=e._datatype,p=t._values,v=t._index,d=t._ptr,_=t._size,c=t._datatype;if(f.length!==_.length)throw new r(f.length,_.length);if(f[0]!==_[0]||f[1]!==_[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+_+")");var g,m=f[0],x=f[1],w=n,y=0,q=a;"string"==typeof h&&h===c&&(g=h,w=i.find(n,[g,g]),y=i.convert(0,g),q=i.find(a,[g,g]));var z,M,D,E,S,A=s&&p?[]:void 0,B=[],R=[],b=new o({values:A,index:B,ptr:R,size:[m,x],datatype:g}),j=A?[]:void 0,k=[];for(M=0;M<x;M++){R[M]=B.length;var C=M+1;if(j)for(E=d[M],S=d[M+1],D=E;D<S;D++)k[z=v[D]]=C,j[z]=p[D];for(E=l[M],S=l[M+1],D=E;D<S;D++)if(z=u[D],j){var F=k[z]===C?j[z]:y,G=q(s[D],F);w(G,y)||(B.push(z),A.push(G))}else B.push(z)}return R[x]=B.length,b}}exports.name="algorithm09",exports.factory=e;
},{"../../../error/DimensionError":"YiAw","../../../function/relational/equalScalar":"QvIw"}],"x67x":[function(require,module,exports) {
"use strict";function r(r,t,e,i){var n=e(require("../../type/matrix/function/matrix")),a=e(require("./multiplyScalar")),u=require("../../utils/latex"),o=e(require("../../type/matrix/utils/algorithm02")),l=e(require("../../type/matrix/utils/algorithm09")),s=e(require("../../type/matrix/utils/algorithm11")),x=e(require("../../type/matrix/utils/algorithm13")),y=e(require("../../type/matrix/utils/algorithm14")),c=i("dotMultiply",{"any, any":a,"SparseMatrix, SparseMatrix":function(r,t){return l(r,t,a,!1)},"SparseMatrix, DenseMatrix":function(r,t){return o(t,r,a,!0)},"DenseMatrix, SparseMatrix":function(r,t){return o(r,t,a,!1)},"DenseMatrix, DenseMatrix":function(r,t){return x(r,t,a)},"Array, Array":function(r,t){return c(n(r),n(t)).valueOf()},"Array, Matrix":function(r,t){return c(n(r),t)},"Matrix, Array":function(r,t){return c(r,n(t))},"SparseMatrix, any":function(r,t){return s(r,t,a,!1)},"DenseMatrix, any":function(r,t){return y(r,t,a,!1)},"any, SparseMatrix":function(r,t){return s(t,r,a,!0)},"any, DenseMatrix":function(r,t){return y(t,r,a,!0)},"Array, any":function(r,t){return y(n(r),t,a,!1).valueOf()},"any, Array":function(r,t){return y(n(t),r,a,!0).valueOf()}});return c.toTex={2:"\\left(${args[0]}".concat(u.operators.dotMultiply,"${args[1]}\\right)")},c}exports.name="dotMultiply",exports.factory=r;
},{"../../type/matrix/function/matrix":"vzj5","./multiplyScalar":"obRw","../../utils/latex":"H1Mr","../../type/matrix/utils/algorithm02":"j4Xj","../../type/matrix/utils/algorithm09":"PvZY","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"xz2O":[function(require,module,exports) {
"use strict";function r(r,t,e,i){var n=e(require("../../type/matrix/function/matrix")),a=e(require("./pow")),u=require("../../utils/latex"),o=e(require("../../type/matrix/utils/algorithm03")),s=e(require("../../type/matrix/utils/algorithm07")),x=e(require("../../type/matrix/utils/algorithm11")),y=e(require("../../type/matrix/utils/algorithm12")),f=e(require("../../type/matrix/utils/algorithm13")),c=e(require("../../type/matrix/utils/algorithm14")),l=i("dotPow",{"any, any":a,"SparseMatrix, SparseMatrix":function(r,t){return s(r,t,a,!1)},"SparseMatrix, DenseMatrix":function(r,t){return o(t,r,a,!0)},"DenseMatrix, SparseMatrix":function(r,t){return o(r,t,a,!1)},"DenseMatrix, DenseMatrix":function(r,t){return f(r,t,a)},"Array, Array":function(r,t){return l(n(r),n(t)).valueOf()},"Array, Matrix":function(r,t){return l(n(r),t)},"Matrix, Array":function(r,t){return l(r,n(t))},"SparseMatrix, any":function(r,t){return x(r,t,l,!1)},"DenseMatrix, any":function(r,t){return c(r,t,l,!1)},"any, SparseMatrix":function(r,t){return y(t,r,l,!0)},"any, DenseMatrix":function(r,t){return c(t,r,l,!0)},"Array, any":function(r,t){return c(n(r),t,l,!1).valueOf()},"any, Array":function(r,t){return c(n(t),r,l,!0).valueOf()}});return l.toTex={2:"\\left(${args[0]}".concat(u.operators.dotPow,"${args[1]}\\right)")},l}exports.name="dotPow",exports.factory=r;
},{"../../type/matrix/function/matrix":"vzj5","./pow":"CsUv","../../utils/latex":"H1Mr","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm07":"u44a","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"hoRG":[function(require,module,exports) {
"use strict";var e=require("../../utils/collection/deepMap");function r(r,t,n,u){var i=u("exp",{number:Math.exp,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()},"Array | Matrix":function(r){return e(r,i)}});return i.toTex={1:"\\exp\\left(${args[0]}\\right)"},i}exports.name="exp",exports.factory=r;
},{"../../utils/collection/deepMap":"lOYo"}],"aAXN":[function(require,module,exports) {
"use strict";var e=require("../../utils/collection/deepMap");function r(r,t,n,i){var o=require("../../utils/latex"),u=i("expm1",{number:Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6},Complex:function(e){var t=Math.exp(e.re);return new r.Complex(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)},"Array | Matrix":function(r){return e(r,u)}});return u.toTex="\\left(e".concat(o.operators.pow,"{${args[0]}}-1\\right)"),u}exports.name="expm1",exports.factory=r;
},{"../../utils/collection/deepMap":"lOYo","../../utils/latex":"H1Mr"}],"AWGe":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").isInteger;function e(r,e,n,i){var u=n(require("../../type/matrix/function/matrix")),a=n(require("../../type/matrix/utils/algorithm01")),m=n(require("../../type/matrix/utils/algorithm04")),o=n(require("../../type/matrix/utils/algorithm10")),s=n(require("../../type/matrix/utils/algorithm13")),c=n(require("../../type/matrix/utils/algorithm14")),f=i("gcd",{"number, number":t,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function gcd must be integer numbers");var n=new r.BigNumber(0);for(;!t.isZero();){var i=e.mod(t);e=t,t=i}return e.lt(n)?e.neg():e},"Fraction, Fraction":function(r,e){return r.gcd(e)},"SparseMatrix, SparseMatrix":function(r,e){return m(r,e,f)},"SparseMatrix, DenseMatrix":function(r,e){return a(e,r,f,!0)},"DenseMatrix, SparseMatrix":function(r,e){return a(r,e,f,!1)},"DenseMatrix, DenseMatrix":function(r,e){return s(r,e,f)},"Array, Array":function(r,e){return f(u(r),u(e)).valueOf()},"Array, Matrix":function(r,e){return f(u(r),e)},"Matrix, Array":function(r,e){return f(r,u(e))},"SparseMatrix, number | BigNumber":function(r,e){return o(r,e,f,!1)},"DenseMatrix, number | BigNumber":function(r,e){return c(r,e,f,!1)},"number | BigNumber, SparseMatrix":function(r,e){return o(e,r,f,!0)},"number | BigNumber, DenseMatrix":function(r,e){return c(e,r,f,!0)},"Array, number | BigNumber":function(r,e){return c(u(r),e,f,!1).valueOf()},"number | BigNumber, Array":function(r,e){return c(u(e),r,f,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(r,e,t){for(var n=f(r,e),i=0;i<t.length;i++)n=f(n,t[i]);return n}});return f.toTex="\\gcd\\left(${args}\\right)",f}function t(e,t){if(!r(e)||!r(t))throw new Error("Parameters in function gcd must be integer numbers");for(var n;0!==t;)n=e%t,e=t,t=n;return e<0?-e:e}exports.name="gcd",exports.factory=e;
},{"../../utils/number":"uqMu","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm01":"q1c8","../../type/matrix/utils/algorithm04":"m7Qa","../../type/matrix/utils/algorithm10":"H0xb","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"OFKG":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function n(n,t,i,e){var u=e("isPositive",{number:function(r){return r>0},BigNumber:function(r){return!r.isNeg()&&!r.isZero()&&!r.isNaN()},Fraction:function(r){return r.s>0&&r.n>0},Unit:function(r){return u(r.value)},"Array | Matrix":function(n){return r(n,u)}});return u}exports.name="isPositive",exports.factory=n;
},{"../../utils/collection/deepMap":"lOYo"}],"YQ9T":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").flatten;function e(e,t,a,i){var u=a(require("./abs")),n=a(require("./addScalar")),l=a(require("./divideScalar")),o=a(require("./multiplyScalar")),s=a(require("./sqrt")),p=a(require("../relational/smaller")),y=a(require("../utils/isPositive")),c=i("hypot",{"... number | BigNumber":function(r){for(var e=0,t=0,a=0;a<r.length;a++){var i=u(r[a]);p(t,i)?(e=o(e,o(l(t,i),l(t,i))),e=n(e,1),t=i):e=n(e,y(i)?o(l(i,t),l(i,t)):i)}return o(t,s(e))},Array:function(e){return c.apply(c,r(e))},Matrix:function(e){return c.apply(c,r(e.toArray()))}});return c.toTex="\\hypot\\left(${args}\\right)",c}exports.name="hypot",exports.factory=e;
},{"../../utils/array":"j2lF","./abs":"K5X1","./addScalar":"ZM3O","./divideScalar":"R3aq","./multiplyScalar":"obRw","./sqrt":"T6pB","../relational/smaller":"Q7ag","../utils/isPositive":"OFKG"}],"h6yp":[function(require,module,exports) {
"use strict";module.exports=function(e,s,r,u,i,o,t,f,n,p,_){var d,l,x,a,c=e._values,h=e._index,v=e._ptr,m=t._index;if(u)for(l=v[s],x=v[s+1],d=l;d<x;d++)r[a=h[d]]!==o?(r[a]=o,m.push(a),p?(u[a]=n?f(c[d],_):f(_,c[d]),i[a]=o):u[a]=c[d]):(u[a]=n?f(c[d],u[a]):f(u[a],c[d]),i[a]=o);else for(l=v[s],x=v[s+1],d=l;d<x;d++)r[a=h[d]]!==o?(r[a]=o,m.push(a)):i[a]=o};
},{}],"WzD7":[function(require,module,exports) {
"use strict";var e=require("./../../../utils/collection/scatter"),r=require("../../../error/DimensionError");function t(t,a,i,n){var l=i(require("../../../function/relational/equalScalar")),o=t.SparseMatrix;return function(t,a,i){var s=t._values,u=t._size,v=t._datatype,c=a._values,f=a._size,h=a._datatype;if(u.length!==f.length)throw new r(u.length,f.length);if(u[0]!==f[0]||u[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+f+")");var p,g=u[0],d=u[1],m=l,x=0,_=i;"string"==typeof v&&v===h&&(p=v,m=n.find(l,[p,p]),x=n.convert(0,p),_=n.find(i,[p,p]));for(var w=s&&c?[]:void 0,y=[],q=[],z=new o({values:w,index:y,ptr:q,size:[g,d],datatype:p}),M=w?[]:void 0,D=[],E=[],S=0;S<d;S++){q[S]=y.length;var A=S+1;if(e(t,S,D,M,E,A,z,_),e(a,S,D,M,E,A,z,_),M)for(var B=q[S];B<y.length;){var R=y[B];if(E[R]===A){var b=M[R];m(b,x)?y.splice(B,1):(w.push(b),B++)}else y.splice(B,1)}else for(var j=q[S];j<y.length;)E[y[j]]!==A?y.splice(j,1):j++}return q[d]=y.length,z}}exports.name="algorithm06",exports.factory=t;
},{"./../../../utils/collection/scatter":"h6yp","../../../error/DimensionError":"YiAw","../../../function/relational/equalScalar":"QvIw"}],"EueY":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").isInteger;function e(r,e,n,i){var u=n(require("../../type/matrix/function/matrix")),a=n(require("../../type/matrix/utils/algorithm02")),m=n(require("../../type/matrix/utils/algorithm06")),o=n(require("../../type/matrix/utils/algorithm11")),s=n(require("../../type/matrix/utils/algorithm13")),f=n(require("../../type/matrix/utils/algorithm14")),b=i("lcm",{"number, number":t,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(e.isZero()||t.isZero())return new r.BigNumber(0);var n=e.times(t);for(;!t.isZero();){var i=t;t=e.mod(i),e=i}return n.div(e).abs()},"Fraction, Fraction":function(r,e){return r.lcm(e)},"SparseMatrix, SparseMatrix":function(r,e){return m(r,e,b)},"SparseMatrix, DenseMatrix":function(r,e){return a(e,r,b,!0)},"DenseMatrix, SparseMatrix":function(r,e){return a(r,e,b,!1)},"DenseMatrix, DenseMatrix":function(r,e){return s(r,e,b)},"Array, Array":function(r,e){return b(u(r),u(e)).valueOf()},"Array, Matrix":function(r,e){return b(u(r),e)},"Matrix, Array":function(r,e){return b(r,u(e))},"SparseMatrix, number | BigNumber":function(r,e){return o(r,e,b,!1)},"DenseMatrix, number | BigNumber":function(r,e){return f(r,e,b,!1)},"number | BigNumber, SparseMatrix":function(r,e){return o(e,r,b,!0)},"number | BigNumber, DenseMatrix":function(r,e){return f(e,r,b,!0)},"Array, number | BigNumber":function(r,e){return f(u(r),e,b,!1).valueOf()},"number | BigNumber, Array":function(r,e){return f(u(e),r,b,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(r,e,t){for(var n=b(r,e),i=0;i<t.length;i++)n=b(n,t[i]);return n}});return b.toTex=void 0,b}function t(e,t){if(!r(e)||!r(t))throw new Error("Parameters in function lcm must be integer numbers");if(0===e||0===t)return 0;for(var n,i=e*t;0!==t;)t=e%(n=t),e=n;return Math.abs(i/e)}exports.name="lcm",exports.factory=e;
},{"../../utils/number":"uqMu","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm02":"j4Xj","../../type/matrix/utils/algorithm06":"WzD7","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"T05K":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function e(e,t,n,o){var i=n(require("./divideScalar")),l=o("log",{number:function(r){return r>=0||t.predictable?Math.log(r):new e.Complex(r,0).log()},Complex:function(r){return r.log()},BigNumber:function(r){return!r.isNegative()||t.predictable?r.ln():new e.Complex(r.toNumber(),0).log()},"Array | Matrix":function(e){return r(e,l)},"any, any":function(r,e){return i(l(r),l(e))}});return l.toTex={1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},l}exports.name="log",exports.factory=e;
},{"../../utils/collection/deepMap":"lOYo","./divideScalar":"R3aq"}],"Bbg8":[function(require,module,exports) {
"use strict";var e=require("../../utils/collection/deepMap");function t(t,o,n,i){var l=i("log10",{number:function(e){return e>=0||o.predictable?r(e):new t.Complex(e,0).log().div(Math.LN10)},Complex:function(e){return new t.Complex(e).log().div(Math.LN10)},BigNumber:function(e){return!e.isNegative()||o.predictable?e.log():new t.Complex(e.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":function(t){return e(t,l)}});return l.toTex={1:"\\log_{10}\\left(${args[0]}\\right)"},l}var r=Math.log10||function(e){return Math.log(e)/Math.LN10};exports.name="log10",exports.factory=t;
},{"../../utils/collection/deepMap":"lOYo"}],"pWAs":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function e(e,t,n,a){var i=n(require("./divideScalar")),o=n(require("./log")),l=a("log1p",{number:function(r){return r>=-1||t.predictable?Math.log1p?Math.log1p(r):Math.log(r+1):u(new e.Complex(r,0))},Complex:u,BigNumber:function(r){var n=r.plus(1);return!n.isNegative()||t.predictable?n.ln():u(new e.Complex(r.toNumber(),0))},"Array | Matrix":function(e){return r(e,l)},"any, any":function(r,e){return i(l(r),o(e))}});function u(r){var t=r.re+1;return new e.Complex(Math.log(Math.sqrt(t*t+r.im*r.im)),Math.atan2(r.im,t))}return l.toTex={1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},l}exports.name="log1p",exports.factory=e;
},{"../../utils/collection/deepMap":"lOYo","./divideScalar":"R3aq","./log":"T05K"}],"MzTq":[function(require,module,exports) {
"use strict";var t=require("../../utils/collection/deepMap");function e(e,r,o,a){var n=a("log2",{number:function(t){return t>=0||r.predictable?Math.log2?Math.log2(t):Math.log(t)/Math.LN2:l(new e.Complex(t,0))},Complex:l,BigNumber:function(t){return!t.isNegative()||r.predictable?t.log(2):l(new e.Complex(t.toNumber(),0))},"Array | Matrix":function(e){return t(e,n)}});function l(t){var r=Math.sqrt(t.re*t.re+t.im*t.im);return new e.Complex(Math.log2?Math.log2(r):Math.log(r)/Math.LN2,Math.atan2(t.im,t.re)/Math.LN2)}return n.toTex="\\log_{2}\\left(${args[0]}\\right)",n}exports.name="log2",exports.factory=e;
},{"../../utils/collection/deepMap":"lOYo"}],"sR9e":[function(require,module,exports) {
"use strict";function r(r,t,e,i){var n=e(require("../../type/matrix/function/matrix")),a=require("../../utils/latex"),u=e(require("../../type/matrix/utils/algorithm02")),o=e(require("../../type/matrix/utils/algorithm03")),s=e(require("../../type/matrix/utils/algorithm05")),f=e(require("../../type/matrix/utils/algorithm11")),m=e(require("../../type/matrix/utils/algorithm12")),x=e(require("../../type/matrix/utils/algorithm13")),c=e(require("../../type/matrix/utils/algorithm14")),l=i("mod",{"number, number":function(r,t){if(t>0)return r-t*Math.floor(r/t);if(0===t)return r;throw new Error("Cannot calculate mod for a negative divisor")},"BigNumber, BigNumber":function(r,t){return t.isZero()?r:r.mod(t)},"Fraction, Fraction":function(r,t){return r.mod(t)},"SparseMatrix, SparseMatrix":function(r,t){return s(r,t,l,!1)},"SparseMatrix, DenseMatrix":function(r,t){return u(t,r,l,!0)},"DenseMatrix, SparseMatrix":function(r,t){return o(r,t,l,!1)},"DenseMatrix, DenseMatrix":function(r,t){return x(r,t,l)},"Array, Array":function(r,t){return l(n(r),n(t)).valueOf()},"Array, Matrix":function(r,t){return l(n(r),t)},"Matrix, Array":function(r,t){return l(r,n(t))},"SparseMatrix, any":function(r,t){return f(r,t,l,!1)},"DenseMatrix, any":function(r,t){return c(r,t,l,!1)},"any, SparseMatrix":function(r,t){return m(t,r,l,!0)},"any, DenseMatrix":function(r,t){return c(t,r,l,!0)},"Array, any":function(r,t){return c(n(r),t,l,!1).valueOf()},"any, Array":function(r,t){return c(n(t),r,l,!0).valueOf()}});return l.toTex={2:"\\left(${args[0]}".concat(a.operators.mod,"${args[1]}\\right)")},l}exports.name="mod",exports.factory=r;
},{"../../type/matrix/function/matrix":"vzj5","../../utils/latex":"H1Mr","../../type/matrix/utils/algorithm02":"j4Xj","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm05":"JNXe","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"Ts3b":[function(require,module,exports) {
"use strict";function r(r,e,n,t){var i=n(require("../arithmetic/abs")),u=n(require("../arithmetic/add")),a=n(require("../arithmetic/pow")),o=n(require("../complex/conj")),f=n(require("../arithmetic/sqrt")),m=n(require("../arithmetic/multiply")),c=n(require("../relational/equalScalar")),l=n(require("../relational/larger")),s=n(require("../relational/smaller")),b=n(require("../../type/matrix/function/matrix")),p=t("norm",{number:Math.abs,Complex:function(r){return r.abs()},BigNumber:function(r){return r.abs()},boolean:function(r){return Math.abs(r)},Array:function(r){return N(b(r),2)},Matrix:function(r){return N(r,2)},"number | Complex | BigNumber | boolean, number | BigNumber | string":function(r){return p(r)},"Array, number | BigNumber | string":function(r,e){return N(b(r),e)},"Matrix, number | BigNumber | string":function(r,e){return N(r,e)}});function N(r,e){var n=r.size();if(1===n.length){if(e===Number.POSITIVE_INFINITY||"inf"===e){var t=0;return r.forEach(function(r){var e=i(r);l(e,t)&&(t=e)},!0),t}var b;if(e===Number.NEGATIVE_INFINITY||"-inf"===e)return r.forEach(function(r){var e=i(r);b&&!s(e,b)||(b=e)},!0),b||0;if("fro"===e)return N(r,2);if("number"==typeof e&&!isNaN(e)){if(!c(e,0)){var p=0;return r.forEach(function(r){p=u(a(i(r),e),p)},!0),a(p,1/e)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}if(2===n.length){if(1===e){var h=[],I=0;return r.forEach(function(r,e){var n=e[1],t=u(h[n]||0,i(r));l(t,I)&&(I=t),h[n]=t},!0),I}if(e===Number.POSITIVE_INFINITY||"inf"===e){var v=[],g=0;return r.forEach(function(r,e){var n=e[0],t=u(v[n]||0,i(r));l(t,g)&&(g=t),v[n]=t},!0),g}if("fro"===e){var E=0;return r.forEach(function(r,e){E=u(E,m(r,o(r)))}),i(f(E))}if(2===e)throw new Error("Unsupported parameter value, missing implementation of matrix singular value decomposition");throw new Error("Unsupported parameter value")}}return p.toTex={1:"\\left\\|${args[0]}\\right\\|",2:void 0},p}exports.name="norm",exports.factory=r;
},{"../arithmetic/abs":"K5X1","../arithmetic/add":"zf2Z","../arithmetic/pow":"CsUv","../complex/conj":"msvi","../arithmetic/sqrt":"T6pB","../arithmetic/multiply":"k7By","../relational/equalScalar":"QvIw","../relational/larger":"SrDl","../relational/smaller":"Q7ag","../../type/matrix/function/matrix":"vzj5"}],"g0GR":[function(require,module,exports) {
"use strict";function r(r,t,n,i){var o=n(require("../../type/matrix/function/matrix")),u=n(require("../../type/matrix/utils/algorithm01")),a=n(require("../../type/matrix/utils/algorithm02")),s=n(require("../../type/matrix/utils/algorithm06")),m=n(require("../../type/matrix/utils/algorithm11")),f=n(require("../../type/matrix/utils/algorithm13")),b=n(require("../../type/matrix/utils/algorithm14")),c="Complex number not supported in function nthRoot. Use nthRoots instead.",g=i("nthRoot",{number:function(r){return e(r,2)},"number, number":e,BigNumber:function(e){return x(e,new r.BigNumber(2))},Complex:function(r){throw new Error(c)},"Complex, number":function(r,e){throw new Error(c)},"BigNumber, BigNumber":x,"Array | Matrix":function(r){return g(r,2)},"SparseMatrix, SparseMatrix":function(r,e){if(1===e.density())return s(r,e,g);throw new Error("Root must be non-zero")},"SparseMatrix, DenseMatrix":function(r,e){return a(e,r,g,!0)},"DenseMatrix, SparseMatrix":function(r,e){if(1===e.density())return u(r,e,g,!1);throw new Error("Root must be non-zero")},"DenseMatrix, DenseMatrix":function(r,e){return f(r,e,g)},"Array, Array":function(r,e){return g(o(r),o(e)).valueOf()},"Array, Matrix":function(r,e){return g(o(r),e)},"Matrix, Array":function(r,e){return g(r,o(e))},"SparseMatrix, number | BigNumber":function(r,e){return m(r,e,g,!1)},"DenseMatrix, number | BigNumber":function(r,e){return b(r,e,g,!1)},"number | BigNumber, SparseMatrix":function(r,e){if(1===e.density())return m(e,r,g,!0);throw new Error("Root must be non-zero")},"number | BigNumber, DenseMatrix":function(r,e){return b(e,r,g,!0)},"Array, number | BigNumber":function(r,e){return g(o(r),e).valueOf()},"number | BigNumber, Array":function(r,e){return g(r,o(e)).valueOf()}});return g.toTex={2:"\\sqrt[${args[1]}]{${args[0]}}"},g;function x(e,t){var n=r.BigNumber.precision,i=r.BigNumber.clone({precision:n+2}),o=new r.BigNumber(0),u=new i(1),a=t.isNegative();if(a&&(t=t.neg()),t.isZero())throw new Error("Root must be non-zero");if(e.isNegative()&&!t.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(e.isZero())return a?new i(1/0):0;if(!e.isFinite())return a?o:e;var s=e.abs().pow(u.div(t));return s=e.isNeg()?s.neg():s,new r.BigNumber((a?u.div(s):s).toPrecision(n))}}function e(r,e){var t=e<0;if(t&&(e=-e),0===e)throw new Error("Root must be non-zero");if(r<0&&Math.abs(e)%2!=1)throw new Error("Root must be odd when a is negative.");if(0===r)return t?1/0:0;if(!isFinite(r))return t?0:r;var n=Math.pow(Math.abs(r),1/e);return n=r<0?-n:n,t?1/n:n}exports.name="nthRoot",exports.factory=r;
},{"../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm01":"q1c8","../../type/matrix/utils/algorithm02":"j4Xj","../../type/matrix/utils/algorithm06":"WzD7","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"Eyh8":[function(require,module,exports) {
"use strict";var r=require("../../type/complex/Complex"),t=require("../../core/typed"),o=r.factory("Complex",{},"",t,{on:function(r,t){}});function e(r,t,o,e){var n=e("nthRoots",{Complex:function(r){return u(r,2)},"Complex, number":u});return n.toTex={2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},n}var n=[function(r){return o(r)},function(r){return o(0,r)},function(r){return o(-r)},function(r){return o(0,-r)}];function u(r,t){if(t<0)throw new Error("Root must be greater than zero");if(0===t)throw new Error("Root must be non-zero");if(t%1!=0)throw new Error("Root must be an integer");if(0===r||0===r.abs())return[o(0)];var e,u="number"==typeof r;(u||0===r.re||0===r.im)&&(e=u?2*+(r<0):0===r.im?2*+(r.re<0):2*+(r.im<0)+1);for(var a=r.arg(),i=r.abs(),f=[],s=Math.pow(i,1/t),m=0;m<t;m++){var p=(e+4*m)/t;p!==Math.round(p)?f.push(o({r:s,phi:(a+2*Math.PI*m)/t})):f.push(n[p%4](s))}return f}exports.name="nthRoots",exports.factory=e;
},{"../../type/complex/Complex":"dh9O","../../core/typed":"ybZj"}],"YL5h":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function t(t,n,e,u){var i=u("square",{number:function(r){return r*r},Complex:function(r){return r.mul(r)},BigNumber:function(r){return r.times(r)},Fraction:function(r){return r.mul(r)},"Array | Matrix":function(t){return r(t,i,!0)},Unit:function(r){return r.pow(2)}});return i.toTex={1:"\\left(${args[0]}\\right)^2"},i}exports.name="square",exports.factory=t;
},{"../../utils/collection/deepMap":"lOYo"}],"tzUx":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function n(n,t,e,u){var i=require("../../utils/latex"),o=u("unaryPlus",{number:function(r){return r},Complex:function(r){return r},BigNumber:function(r){return r},Fraction:function(r){return r},Unit:function(r){return r.clone()},"Array | Matrix":function(n){return r(n,o,!0)},"boolean | string":function(r){return"BigNumber"===t.number?new n.BigNumber(+r):+r}});return o.toTex={1:"".concat(i.operators.unaryPlus,"\\left(${args[0]}\\right)")},o}exports.name="unaryPlus",exports.factory=n;
},{"../../utils/collection/deepMap":"lOYo","../../utils/latex":"H1Mr"}],"M0zV":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").isInteger;function e(e,n,t,i){var u=t(require("../../type/matrix/function/matrix")),o=i("xgcd",{"number, number":function(e,t){var i,o,m,s,a=0,g=1,f=1,c=0;if(!r(e)||!r(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)o=Math.floor(e/t),m=e-o*t,i=a,a=g-o*a,g=i,i=f,f=c-o*f,c=i,e=t,t=m;s=e<0?[-e,-g,-c]:[e,e?g:0,c];return"Array"===n.matrix?s:u(s)},"BigNumber, BigNumber":function(r,t){var i,o,m,s,a=new e.BigNumber(0),g=new e.BigNumber(1),f=a,c=g,b=g,x=a;if(!r.isInt()||!t.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!t.isZero();)o=r.div(t).floor(),m=r.mod(t),i=f,f=c.minus(o.times(f)),c=i,i=b,b=x.minus(o.times(b)),x=i,r=t,t=m;s=r.lt(a)?[r.neg(),c.neg(),x.neg()]:[r,r.isZero()?0:c,x];return"Array"===n.matrix?s:u(s)}});return o.toTex=void 0,o}exports.name="xgcd",exports.factory=e;
},{"../../utils/number":"uqMu","../../type/matrix/function/matrix":"vzj5"}],"bAc9":[function(require,module,exports) {
"use strict";module.exports=[require("./abs"),require("./add"),require("./addScalar"),require("./cbrt"),require("./ceil"),require("./cube"),require("./divide"),require("./dotDivide"),require("./dotMultiply"),require("./dotPow"),require("./exp"),require("./expm1"),require("./fix"),require("./floor"),require("./gcd"),require("./hypot"),require("./lcm"),require("./log"),require("./log10"),require("./log1p"),require("./log2"),require("./mod"),require("./multiply"),require("./norm"),require("./nthRoot"),require("./nthRoots"),require("./pow"),require("./round"),require("./sign"),require("./sqrt"),require("./square"),require("./subtract"),require("./unaryMinus"),require("./unaryPlus"),require("./xgcd")];
},{"./abs":"K5X1","./add":"zf2Z","./addScalar":"ZM3O","./cbrt":"N7RE","./ceil":"CkRk","./cube":"qFQg","./divide":"lVgQ","./dotDivide":"JrX5","./dotMultiply":"x67x","./dotPow":"xz2O","./exp":"hoRG","./expm1":"aAXN","./fix":"Pk2X","./floor":"Wigz","./gcd":"AWGe","./hypot":"YQ9T","./lcm":"EueY","./log":"T05K","./log10":"Bbg8","./log1p":"pWAs","./log2":"MzTq","./mod":"sR9e","./multiply":"k7By","./norm":"Ts3b","./nthRoot":"g0GR","./nthRoots":"Eyh8","./pow":"CsUv","./round":"f25u","./sign":"Zr7Q","./sqrt":"T6pB","./square":"YL5h","./subtract":"m78R","./unaryMinus":"q5A1","./unaryPlus":"tzUx","./xgcd":"M0zV"}],"LJa0":[function(require,module,exports) {
"use strict";module.exports=function(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var i=e.constructor,n=i.precision;i.config({precision:1e9});var r=e.plus(new i(1));return r.s=-r.s||null,i.config({precision:n}),r};
},{}],"aXnU":[function(require,module,exports) {
"use strict";var e=require("./bitNot");function r(e){for(var r=e.d,n=r[0]+"",t=1;t<r.length;++t){for(var l=r[t]+"",o=7-l.length;o--;)l="0"+l;n+=l}for(var i=n.length;"0"===n.charAt(i);)i--;var s=e.e,f=n.slice(0,i+1||1),a=f.length;if(s>0)if(++s>a)for(s-=a;s--;)f+="0";else s<a&&(f=f.slice(0,s)+"."+f.slice(s));for(var c=[0],g=0;g<f.length;){for(var h=c.length;h--;)c[h]*=10;c[0]+=parseInt(f.charAt(g++));for(var v=0;v<c.length;++v)c[v]>1&&(null!==c[v+1]&&void 0!==c[v+1]||(c[v+1]=0),c[v+1]+=c[v]>>1,c[v]&=1)}return c.reverse()}module.exports=function(n,t,l){var o,i,s,f,a,c=n.constructor,g=+(n.s<0),h=+(t.s<0);if(g){o=r(e(n));for(var v=0;v<o.length;++v)o[v]^=1}else o=r(n);if(h){i=r(e(t));for(var u=0;u<i.length;++u)i[u]^=1}else i=r(t);o.length<=i.length?(s=o,f=i,a=g):(s=i,f=o,a=h);var p=s.length,d=f.length,m=1^l(g,h),w=new c(1^m),A=new c(1),b=new c(2),q=c.precision;for(c.config({precision:1e9});p>0;)l(s[--p],f[--d])===m&&(w=w.plus(A)),A=A.times(b);for(;d>0;)l(a,f[--d])===m&&(w=w.plus(A)),A=A.times(b);return c.config({precision:q}),0===m&&(w.s=-w.s),w};
},{"./bitNot":"LJa0"}],"upit":[function(require,module,exports) {
"use strict";var i=require("./bitwise");module.exports=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var n=e.constructor;if(e.isNaN()||t.isNaN())return new n(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new n(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new n(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new n(0):e}return i(e,t,function(i,e){return i&e})};
},{"./bitwise":"aXnU"}],"LRIo":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").isInteger,t=require("../../utils/bignumber/bitAnd");function e(e,n,i,u){var a=require("../../utils/latex"),o=i(require("../../type/matrix/function/matrix")),s=i(require("../../type/matrix/utils/algorithm02")),x=i(require("../../type/matrix/utils/algorithm06")),f=i(require("../../type/matrix/utils/algorithm11")),c=i(require("../../type/matrix/utils/algorithm13")),m=i(require("../../type/matrix/utils/algorithm14")),y=u("bitAnd",{"number, number":function(t,e){if(!r(t)||!r(e))throw new Error("Integers expected in function bitAnd");return t&e},"BigNumber, BigNumber":t,"SparseMatrix, SparseMatrix":function(r,t){return x(r,t,y,!1)},"SparseMatrix, DenseMatrix":function(r,t){return s(t,r,y,!0)},"DenseMatrix, SparseMatrix":function(r,t){return s(r,t,y,!1)},"DenseMatrix, DenseMatrix":function(r,t){return c(r,t,y)},"Array, Array":function(r,t){return y(o(r),o(t)).valueOf()},"Array, Matrix":function(r,t){return y(o(r),t)},"Matrix, Array":function(r,t){return y(r,o(t))},"SparseMatrix, any":function(r,t){return f(r,t,y,!1)},"DenseMatrix, any":function(r,t){return m(r,t,y,!1)},"any, SparseMatrix":function(r,t){return f(t,r,y,!0)},"any, DenseMatrix":function(r,t){return m(t,r,y,!0)},"Array, any":function(r,t){return m(o(r),t,y,!1).valueOf()},"any, Array":function(r,t){return m(o(t),r,y,!0).valueOf()}});return y.toTex={2:"\\left(${args[0]}".concat(a.operators.bitAnd,"${args[1]}\\right)")},y}exports.name="bitAnd",exports.factory=e;
},{"../../utils/number":"uqMu","../../utils/bignumber/bitAnd":"upit","../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm02":"j4Xj","../../type/matrix/utils/algorithm06":"WzD7","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"Oh4X":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap"),t=require("../../utils/bignumber/bitNot"),e=require("../../utils/number").isInteger;function i(i,n,u,o){var s=require("../../utils/latex"),a=o("bitNot",{number:function(r){if(!e(r))throw new Error("Integer expected in function bitNot");return~r},BigNumber:t,"Array | Matrix":function(t){return r(t,a)}});return a.toTex={1:s.operators.bitNot+"\\left(${args[0]}\\right)"},a}exports.name="bitNot",exports.factory=i;
},{"../../utils/collection/deepMap":"lOYo","../../utils/bignumber/bitNot":"LJa0","../../utils/number":"uqMu","../../utils/latex":"H1Mr"}],"MUNI":[function(require,module,exports) {
"use strict";var i=require("./bitwise");module.exports=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var s=e.constructor;if(e.isNaN()||t.isNaN())return new s(NaN);var n=new s(-1);return e.isZero()||t.eq(n)||e.eq(t)?t:t.isZero()||e.eq(n)?e:e.isFinite()&&t.isFinite()?i(e,t,function(i,e){return i|e}):!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?n:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e};
},{"./bitwise":"aXnU"}],"kLOX":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").isInteger,t=require("../../utils/bignumber/bitOr");function e(e,i,n,u){var a=require("../../utils/latex"),o=n(require("../../type/matrix/function/matrix")),s=n(require("../../type/matrix/utils/algorithm01")),x=n(require("../../type/matrix/utils/algorithm04")),f=n(require("../../type/matrix/utils/algorithm10")),c=n(require("../../type/matrix/utils/algorithm13")),m=n(require("../../type/matrix/utils/algorithm14")),y=u("bitOr",{"number, number":function(t,e){if(!r(t)||!r(e))throw new Error("Integers expected in function bitOr");return t|e},"BigNumber, BigNumber":t,"SparseMatrix, SparseMatrix":function(r,t){return x(r,t,y)},"SparseMatrix, DenseMatrix":function(r,t){return s(t,r,y,!0)},"DenseMatrix, SparseMatrix":function(r,t){return s(r,t,y,!1)},"DenseMatrix, DenseMatrix":function(r,t){return c(r,t,y)},"Array, Array":function(r,t){return y(o(r),o(t)).valueOf()},"Array, Matrix":function(r,t){return y(o(r),t)},"Matrix, Array":function(r,t){return y(r,o(t))},"SparseMatrix, any":function(r,t){return f(r,t,y,!1)},"DenseMatrix, any":function(r,t){return m(r,t,y,!1)},"any, SparseMatrix":function(r,t){return f(t,r,y,!0)},"any, DenseMatrix":function(r,t){return m(t,r,y,!0)},"Array, any":function(r,t){return m(o(r),t,y,!1).valueOf()},"any, Array":function(r,t){return m(o(t),r,y,!0).valueOf()}});return y.toTex={2:"\\left(${args[0]}".concat(a.operators.bitOr,"${args[1]}\\right)")},y}exports.name="bitOr",exports.factory=e;
},{"../../utils/number":"uqMu","../../utils/bignumber/bitOr":"MUNI","../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm01":"q1c8","../../type/matrix/utils/algorithm04":"m7Qa","../../type/matrix/utils/algorithm10":"H0xb","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"LBOM":[function(require,module,exports) {
"use strict";var i=require("./bitwise"),e=require("./bitNot");module.exports=function(r,t){if(r.isFinite()&&!r.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var n=r.constructor;if(r.isNaN()||t.isNaN())return new n(NaN);if(r.isZero())return t;if(t.isZero())return r;if(r.eq(t))return new n(0);var s=new n(-1);return r.eq(s)?e(t):t.eq(s)?e(r):r.isFinite()&&t.isFinite()?i(r,t,function(i,e){return i^e}):r.isFinite()||t.isFinite()?new n(r.isNegative()===t.isNegative()?1/0:-1/0):s};
},{"./bitwise":"aXnU","./bitNot":"LJa0"}],"WoWZ":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").isInteger,t=require("../../utils/bignumber/bitXor");function e(e,i,n,u){var a=require("../../utils/latex"),o=n(require("../../type/matrix/function/matrix")),s=n(require("../../type/matrix/utils/algorithm03")),x=n(require("../../type/matrix/utils/algorithm07")),f=n(require("../../type/matrix/utils/algorithm12")),c=n(require("../../type/matrix/utils/algorithm13")),m=n(require("../../type/matrix/utils/algorithm14")),y=u("bitXor",{"number, number":function(t,e){if(!r(t)||!r(e))throw new Error("Integers expected in function bitXor");return t^e},"BigNumber, BigNumber":t,"SparseMatrix, SparseMatrix":function(r,t){return x(r,t,y)},"SparseMatrix, DenseMatrix":function(r,t){return s(t,r,y,!0)},"DenseMatrix, SparseMatrix":function(r,t){return s(r,t,y,!1)},"DenseMatrix, DenseMatrix":function(r,t){return c(r,t,y)},"Array, Array":function(r,t){return y(o(r),o(t)).valueOf()},"Array, Matrix":function(r,t){return y(o(r),t)},"Matrix, Array":function(r,t){return y(r,o(t))},"SparseMatrix, any":function(r,t){return f(r,t,y,!1)},"DenseMatrix, any":function(r,t){return m(r,t,y,!1)},"any, SparseMatrix":function(r,t){return f(t,r,y,!0)},"any, DenseMatrix":function(r,t){return m(t,r,y,!0)},"Array, any":function(r,t){return m(o(r),t,y,!1).valueOf()},"any, Array":function(r,t){return m(o(t),r,y,!0).valueOf()}});return y.toTex={2:"\\left(${args[0]}".concat(a.operators.bitXor,"${args[1]}\\right)")},y}exports.name="bitXor",exports.factory=e;
},{"../../utils/number":"uqMu","../../utils/bignumber/bitXor":"LBOM","../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm07":"u44a","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"Wxcu":[function(require,module,exports) {
"use strict";module.exports=function(e,i){if(e.isFinite()&&!e.isInteger()||i.isFinite()&&!i.isInteger())throw new Error("Integers expected in function leftShift");var t=e.constructor;return e.isNaN()||i.isNaN()||i.isNegative()&&!i.isZero()?new t(NaN):e.isZero()||i.isZero()?e:e.isFinite()||i.isFinite()?i.lt(55)?e.times(Math.pow(2,i.toNumber())+""):e.times(new t(2).pow(i)):new t(NaN)};
},{}],"sHbh":[function(require,module,exports) {
"use strict";var r=require("../../../error/DimensionError");function e(e,t,n,a){var i=n(require("../../../function/relational/equalScalar")),o=e.SparseMatrix;return function(e,t,n){var s=e._values,l=e._index,p=e._ptr,f=e._size,h=e._datatype,u=t._values,c=t._index,v=t._ptr,g=t._size,_=t._datatype;if(f.length!==g.length)throw new r(f.length,g.length);if(f[0]!==g[0]||f[1]!==g[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+g+")");if(!s||!u)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var m,d=f[0],x=f[1],w=i,y=0,M=n;"string"==typeof h&&h===_&&(m=h,w=a.find(i,[m,m]),y=a.convert(0,m),M=a.find(n,[m,m]));for(var q,z,E,S,D=[],A=[],B=[],C=new o({values:D,index:A,ptr:B,size:[d,x],datatype:m}),P=[],R=[],b=0;b<x;b++){B[b]=A.length;var j=b+1;for(z=p[b],E=p[b+1],q=z;q<E;q++)R[S=l[q]]=j,P[S]=s[q],A.push(S);for(z=v[b],E=v[b+1],q=z;q<E;q++)R[S=c[q]]===j&&(P[S]=M(P[S],u[q]));for(q=B[b];q<A.length;){var k=P[S=A[q]];w(k,y)?A.splice(q,1):(D.push(k),q++)}}return B[x]=A.length,C}}exports.name="algorithm08",exports.factory=e;
},{"../../../error/DimensionError":"YiAw","../../../function/relational/equalScalar":"QvIw"}],"p0FC":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").isInteger,e=require("../../utils/bignumber/leftShift");function t(t,i,u,n){var a=require("../../utils/latex"),o=u(require("../../type/matrix/function/matrix")),m=u(require("../relational/equalScalar")),s=u(require("../matrix/zeros")),f=u(require("../../type/matrix/utils/algorithm01")),l=u(require("../../type/matrix/utils/algorithm02")),x=u(require("../../type/matrix/utils/algorithm08")),c=u(require("../../type/matrix/utils/algorithm10")),g=u(require("../../type/matrix/utils/algorithm11")),b=u(require("../../type/matrix/utils/algorithm13")),p=u(require("../../type/matrix/utils/algorithm14")),y=n("leftShift",{"number, number":function(e,t){if(!r(e)||!r(t))throw new Error("Integers expected in function leftShift");return e<<t},"BigNumber, BigNumber":e,"SparseMatrix, SparseMatrix":function(r,e){return x(r,e,y,!1)},"SparseMatrix, DenseMatrix":function(r,e){return l(e,r,y,!0)},"DenseMatrix, SparseMatrix":function(r,e){return f(r,e,y,!1)},"DenseMatrix, DenseMatrix":function(r,e){return b(r,e,y)},"Array, Array":function(r,e){return y(o(r),o(e)).valueOf()},"Array, Matrix":function(r,e){return y(o(r),e)},"Matrix, Array":function(r,e){return y(r,o(e))},"SparseMatrix, number | BigNumber":function(r,e){return m(e,0)?r.clone():g(r,e,y,!1)},"DenseMatrix, number | BigNumber":function(r,e){return m(e,0)?r.clone():p(r,e,y,!1)},"number | BigNumber, SparseMatrix":function(r,e){return m(r,0)?s(e.size(),e.storage()):c(e,r,y,!0)},"number | BigNumber, DenseMatrix":function(r,e){return m(r,0)?s(e.size(),e.storage()):p(e,r,y,!0)},"Array, number | BigNumber":function(r,e){return y(o(r),e).valueOf()},"number | BigNumber, Array":function(r,e){return y(r,o(e)).valueOf()}});return y.toTex={2:"\\left(${args[0]}".concat(a.operators.leftShift,"${args[1]}\\right)")},y}exports.name="leftShift",exports.factory=t;
},{"../../utils/number":"uqMu","../../utils/bignumber/leftShift":"Wxcu","../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5","../relational/equalScalar":"QvIw","../matrix/zeros":"BAjv","../../type/matrix/utils/algorithm01":"q1c8","../../type/matrix/utils/algorithm02":"j4Xj","../../type/matrix/utils/algorithm08":"sHbh","../../type/matrix/utils/algorithm10":"H0xb","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"gyUS":[function(require,module,exports) {
"use strict";module.exports=function(i,e){if(i.isFinite()&&!i.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function rightArithShift");var t=i.constructor;return i.isNaN()||e.isNaN()||e.isNegative()&&!e.isZero()?new t(NaN):i.isZero()||e.isZero()?i:e.isFinite()?e.lt(55)?i.div(Math.pow(2,e.toNumber())+"").floor():i.div(new t(2).pow(e)).floor():i.isNegative()?new t(-1):i.isFinite()?new t(0):new t(NaN)};
},{}],"DRd9":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").isInteger,t=require("../../utils/bignumber/rightArithShift");function e(e,i,u,n){var a=require("../../utils/latex"),o=u(require("../../type/matrix/function/matrix")),m=u(require("../relational/equalScalar")),s=u(require("../matrix/zeros")),x=u(require("../../type/matrix/utils/algorithm01")),f=u(require("../../type/matrix/utils/algorithm02")),g=u(require("../../type/matrix/utils/algorithm08")),l=u(require("../../type/matrix/utils/algorithm10")),c=u(require("../../type/matrix/utils/algorithm11")),h=u(require("../../type/matrix/utils/algorithm13")),b=u(require("../../type/matrix/utils/algorithm14")),p=n("rightArithShift",{"number, number":function(t,e){if(!r(t)||!r(e))throw new Error("Integers expected in function rightArithShift");return t>>e},"BigNumber, BigNumber":t,"SparseMatrix, SparseMatrix":function(r,t){return g(r,t,p,!1)},"SparseMatrix, DenseMatrix":function(r,t){return f(t,r,p,!0)},"DenseMatrix, SparseMatrix":function(r,t){return x(r,t,p,!1)},"DenseMatrix, DenseMatrix":function(r,t){return h(r,t,p)},"Array, Array":function(r,t){return p(o(r),o(t)).valueOf()},"Array, Matrix":function(r,t){return p(o(r),t)},"Matrix, Array":function(r,t){return p(r,o(t))},"SparseMatrix, number | BigNumber":function(r,t){return m(t,0)?r.clone():c(r,t,p,!1)},"DenseMatrix, number | BigNumber":function(r,t){return m(t,0)?r.clone():b(r,t,p,!1)},"number | BigNumber, SparseMatrix":function(r,t){return m(r,0)?s(t.size(),t.storage()):l(t,r,p,!0)},"number | BigNumber, DenseMatrix":function(r,t){return m(r,0)?s(t.size(),t.storage()):b(t,r,p,!0)},"Array, number | BigNumber":function(r,t){return p(o(r),t).valueOf()},"number | BigNumber, Array":function(r,t){return p(r,o(t)).valueOf()}});return p.toTex={2:"\\left(${args[0]}".concat(a.operators.rightArithShift,"${args[1]}\\right)")},p}exports.name="rightArithShift",exports.factory=e;
},{"../../utils/number":"uqMu","../../utils/bignumber/rightArithShift":"gyUS","../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5","../relational/equalScalar":"QvIw","../matrix/zeros":"BAjv","../../type/matrix/utils/algorithm01":"q1c8","../../type/matrix/utils/algorithm02":"j4Xj","../../type/matrix/utils/algorithm08":"sHbh","../../type/matrix/utils/algorithm10":"H0xb","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"KdQk":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").isInteger;function e(e,t,i,n){var u=require("../../utils/latex"),a=i(require("../../type/matrix/function/matrix")),o=i(require("../relational/equalScalar")),s=i(require("../matrix/zeros")),m=i(require("../../type/matrix/utils/algorithm01")),x=i(require("../../type/matrix/utils/algorithm02")),g=i(require("../../type/matrix/utils/algorithm08")),f=i(require("../../type/matrix/utils/algorithm10")),l=i(require("../../type/matrix/utils/algorithm11")),c=i(require("../../type/matrix/utils/algorithm13")),p=i(require("../../type/matrix/utils/algorithm14")),h=n("rightLogShift",{"number, number":function(e,t){if(!r(e)||!r(t))throw new Error("Integers expected in function rightLogShift");return e>>>t},"SparseMatrix, SparseMatrix":function(r,e){return g(r,e,h,!1)},"SparseMatrix, DenseMatrix":function(r,e){return x(e,r,h,!0)},"DenseMatrix, SparseMatrix":function(r,e){return m(r,e,h,!1)},"DenseMatrix, DenseMatrix":function(r,e){return c(r,e,h)},"Array, Array":function(r,e){return h(a(r),a(e)).valueOf()},"Array, Matrix":function(r,e){return h(a(r),e)},"Matrix, Array":function(r,e){return h(r,a(e))},"SparseMatrix, number | BigNumber":function(r,e){return o(e,0)?r.clone():l(r,e,h,!1)},"DenseMatrix, number | BigNumber":function(r,e){return o(e,0)?r.clone():p(r,e,h,!1)},"number | BigNumber, SparseMatrix":function(r,e){return o(r,0)?s(e.size(),e.storage()):f(e,r,h,!0)},"number | BigNumber, DenseMatrix":function(r,e){return o(r,0)?s(e.size(),e.storage()):p(e,r,h,!0)},"Array, number | BigNumber":function(r,e){return h(a(r),e).valueOf()},"number | BigNumber, Array":function(r,e){return h(r,a(e)).valueOf()}});return h.toTex={2:"\\left(${args[0]}".concat(u.operators.rightLogShift,"${args[1]}\\right)")},h}exports.name="rightLogShift",exports.factory=e;
},{"../../utils/number":"uqMu","../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5","../relational/equalScalar":"QvIw","../matrix/zeros":"BAjv","../../type/matrix/utils/algorithm01":"q1c8","../../type/matrix/utils/algorithm02":"j4Xj","../../type/matrix/utils/algorithm08":"sHbh","../../type/matrix/utils/algorithm10":"H0xb","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"JhAg":[function(require,module,exports) {
"use strict";module.exports=[require("./bitAnd"),require("./bitNot"),require("./bitOr"),require("./bitXor"),require("./leftShift"),require("./rightArithShift"),require("./rightLogShift")];
},{"./bitAnd":"LRIo","./bitNot":"Oh4X","./bitOr":"kLOX","./bitXor":"WoWZ","./leftShift":"p0FC","./rightArithShift":"DRd9","./rightLogShift":"KdQk"}],"FONy":[function(require,module,exports) {
"use strict";function r(t,e){var u;return e<t?1:e===t?e:r(t,u=e+t>>1)*r(u+1,e)}module.exports=r;
},{}],"ciea":[function(require,module,exports) {
"use strict";var e=require("../../utils/collection/deepMap"),r=require("../../utils/number").isInteger;function i(i,a,u,m){var o=u(require("../arithmetic/multiply")),s=u(require("../arithmetic/pow")),h=require("./product"),c=m("gamma",{number:function(e){var i,a;if(r(e))return e<=0?isFinite(e)?1/0:NaN:e>171?1/0:h(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*c(1-e));if(e>=171.35)return 1/0;if(e>85){var u=e*e,m=u*e,o=m*e,s=o*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*u)-139/(51840*m)-571/(2488320*o)+163879/(209018880*s)+5246819/(75246796800*s*e))}--e,a=n[0];for(var g=1;g<n.length;++g)a+=n[g]/(e+g);return i=e+t+.5,Math.sqrt(2*Math.PI)*Math.pow(i,e+.5)*Math.exp(-i)*a},Complex:function(e){var r,a;if(0===e.im)return c(e.re);e=new i.Complex(e.re-1,e.im),a=new i.Complex(n[0],0);for(var u=1;u<n.length;++u){var m=e.re+u,h=m*m+e.im*e.im;0!==h?(a.re+=n[u]*m/h,a.im+=-n[u]*e.im/h):a.re=n[u]<0?-1/0:1/0}r=new i.Complex(e.re+t+.5,e.im);var g=Math.sqrt(2*Math.PI);e.re+=.5;var f=s(r,e);0===f.im?f.re*=g:0===f.re?f.im*=g:(f.re*=g,f.im*=g);var p=Math.exp(-r.re);return r.re=p*Math.cos(-r.im),r.im=p*Math.sin(-r.im),o(o(f,r),a)},BigNumber:function(e){if(e.isInteger())return e.isNegative()||e.isZero()?new i.BigNumber(1/0):function(e){if(e.isZero())return new i.BigNumber(1);var r=a.precision+(0|Math.log(e.toNumber())),t=new(i.BigNumber.clone({precision:r}))(e),n=e.toNumber()-1;for(;n>1;)t=t.times(n),n--;return new i.BigNumber(t.toPrecision(i.BigNumber.precision))}(e.minus(1));if(!e.isFinite())return new i.BigNumber(e.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")},"Array | Matrix":function(r){return e(r,c)}});return c.toTex={1:"\\Gamma\\left(${args[0]}\\right)"},c}var t=4.7421875,n=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];exports.name="gamma",exports.factory=i;
},{"../../utils/collection/deepMap":"lOYo","../../utils/number":"uqMu","../arithmetic/multiply":"k7By","../arithmetic/pow":"CsUv","./product":"FONy"}],"yidz":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function e(e,t,a,n){var i=a(require("./gamma")),o=require("../../utils/latex"),u=n("factorial",{number:function(r){if(r<0)throw new Error("Value must be non-negative");return i(r+1)},BigNumber:function(r){if(r.isNegative())throw new Error("Value must be non-negative");return i(r.plus(1))},"Array | Matrix":function(e){return r(e,u)}});return u.toTex={1:"\\left(${args[0]}\\right)".concat(o.operators.factorial)},u}exports.name="factorial",exports.factory=e;
},{"../../utils/collection/deepMap":"lOYo","./gamma":"ciea","../../utils/latex":"H1Mr"}],"n9b2":[function(require,module,exports) {
"use strict";var e=require("../../utils/number").isInteger,n=require("./product");function r(r,t,o,u){var s=u("combinations",{"number, number":function(r,i){var t;if(!e(r)||r<0)throw new TypeError("Positive integer value expected in function combinations");if(!e(i)||i<0)throw new TypeError("Positive integer value expected in function combinations");if(i>r)throw new TypeError("k must be less than or equal to n");return i<(t=r-i)?n(t+1,r)/n(1,i):n(i+1,r)/n(1,t)},"BigNumber, BigNumber":function(e,n){var t,o,u,s,a=new r.BigNumber(1);if(!i(e)||!i(n))throw new TypeError("Positive integer value expected in function combinations");if(n.gt(e))throw new TypeError("k must be less than n in function combinations");for(t=e.minus(n),n.lt(t)&&(t=n),o=a,u=a,s=e.minus(t);u.lte(s);u=u.plus(1))o=o.times(t.plus(u)).dividedBy(u);return o}});return s.toTex={2:"\\binom{${args[0]}}{${args[1]}}"},s}function i(e){return e.isInteger()&&e.gte(0)}exports.name="combinations",exports.factory=r;
},{"../../utils/number":"uqMu","./product":"FONy"}],"qG7X":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap"),e=require("../../utils/number");function n(n,t,i,u){var s=u("isInteger",{number:e.isInteger,BigNumber:function(r){return r.isInt()},Fraction:function(r){return 1===r.d&&isFinite(r.n)},"Array | Matrix":function(e){return r(e,s)}});return s}exports.name="isInteger",exports.factory=n;
},{"../../utils/collection/deepMap":"lOYo","../../utils/number":"uqMu"}],"RVLq":[function(require,module,exports) {
"use strict";function r(r,e,i,t){var n=i(require("../arithmetic/add")),u=i(require("../arithmetic/subtract")),a=i(require("../arithmetic/multiply")),o=i(require("../arithmetic/divide")),l=i(require("../arithmetic/pow")),s=i(require("../probability/factorial")),c=i(require("../probability/combinations")),m=i(require("../utils/isNegative")),g=i(require("../utils/isInteger")),b=i(require("../relational/larger")),q=t("stirlingS2",{"number | BigNumber, number | BigNumber":function(r,e){if(!g(r)||m(r)||!g(e)||m(e))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(b(e,r))throw new TypeError("k must be less than or equal to n in function stirlingS2");for(var i=s(e),t=0,q=0;q<=e;q++){var f=l(-1,u(e,q)),h=c(e,q),p=l(q,r);t=n(t,a(a(h,p),f))}return o(t,i)}});return q.toTex={2:"\\mathrm{S}\\left(${args}\\right)"},q}exports.name="stirlingS2",exports.factory=r;
},{"../arithmetic/add":"zf2Z","../arithmetic/subtract":"m78R","../arithmetic/multiply":"k7By","../arithmetic/divide":"lVgQ","../arithmetic/pow":"CsUv","../probability/factorial":"yidz","../probability/combinations":"n9b2","../utils/isNegative":"HYoC","../utils/isInteger":"qG7X","../relational/larger":"SrDl"}],"VdBl":[function(require,module,exports) {
"use strict";function e(e,r,t,i){var u=t(require("../arithmetic/add")),n=t(require("./stirlingS2")),s=t(require("../utils/isNegative")),a=t(require("../utils/isInteger")),o=i("bellNumbers",{"number | BigNumber":function(e){if(!a(e)||s(e))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var r=0,t=0;t<=e;t++)r=u(r,n(e,t));return r}});return o.toTex={1:"\\mathrm{B}_{${args[0]}}"},o}exports.name="bellNumbers",exports.factory=e;
},{"../arithmetic/add":"zf2Z","./stirlingS2":"RVLq","../utils/isNegative":"HYoC","../utils/isInteger":"qG7X"}],"FQ9r":[function(require,module,exports) {
"use strict";function e(e,i,r,o){var t=r(require("../probability/combinations")),n=r(require("../arithmetic/addScalar")),u=r(require("../utils/isPositive")),s=r(require("../utils/isInteger")),a=r(require("../relational/larger")),c=o("composition",{"number | BigNumber, number | BigNumber":function(e,i){if(!(s(e)&&u(e)&&s(i)&&u(i)))throw new TypeError("Positive integer value expected in function composition");if(a(i,e))throw new TypeError("k must be less than or equal to n in function composition");return t(n(e,-1),n(i,-1))}});return c.toTex=void 0,c}exports.name="composition",exports.factory=e;
},{"../probability/combinations":"n9b2","../arithmetic/addScalar":"ZM3O","../utils/isPositive":"OFKG","../utils/isInteger":"qG7X","../relational/larger":"SrDl"}],"UHHf":[function(require,module,exports) {
"use strict";function e(e,r,i,t){var a=i(require("../arithmetic/add")),n=i(require("../arithmetic/divide")),u=i(require("../arithmetic/multiply")),c=i(require("../probability/combinations")),o=i(require("../utils/isNegative")),m=i(require("../utils/isInteger")),s=t("catalan",{"number | BigNumber":function(e){if(!m(e)||o(e))throw new TypeError("Non-negative integer value expected in function catalan");return n(c(u(e,2),e),a(e,1))}});return s.toTex={1:"\\mathrm{C}_{${args[0]}}"},s}exports.name="catalan",exports.factory=e;
},{"../arithmetic/add":"zf2Z","../arithmetic/divide":"lVgQ","../arithmetic/multiply":"k7By","../probability/combinations":"n9b2","../utils/isNegative":"HYoC","../utils/isInteger":"qG7X"}],"otxT":[function(require,module,exports) {
"use strict";module.exports=[require("./bellNumbers"),require("./composition"),require("./stirlingS2"),require("./catalan")];
},{"./bellNumbers":"VdBl","./composition":"FQ9r","./stirlingS2":"RVLq","./catalan":"UHHf"}],"UjqL":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function t(t,e,n,a){var u=a("arg",{number:function(r){return Math.atan2(0,r)},BigNumber:function(r){return t.BigNumber.atan2(0,r)},Complex:function(r){return r.arg()},"Array | Matrix":function(t){return r(t,u)}});return u.toTex={1:"\\arg\\left(${args[0]}\\right)"},u}exports.name="arg",exports.factory=t;
},{"../../utils/collection/deepMap":"lOYo"}],"NXCa":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function e(e,t,n,i){var u=i("im",{number:function(r){return 0},BigNumber:function(r){return new e.BigNumber(0)},Complex:function(r){return r.im},"Array | Matrix":function(e){return r(e,u)}});return u.toTex={1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},u}exports.name="im",exports.factory=e;
},{"../../utils/collection/deepMap":"lOYo"}],"Vvrl":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function e(e,t,n,u){var i=u("re",{number:function(r){return r},BigNumber:function(r){return r},Complex:function(r){return r.re},"Array | Matrix":function(e){return r(e,i)}});return i.toTex={1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},i}exports.name="re",exports.factory=e;
},{"../../utils/collection/deepMap":"lOYo"}],"gHt6":[function(require,module,exports) {
"use strict";module.exports=[require("./arg"),require("./conj"),require("./im"),require("./re")];
},{"./arg":"UjqL","./conj":"msvi","./im":"NXCa","./re":"Vvrl"}],"Lso4":[function(require,module,exports) {
"use strict";function r(r,e,t,i){var n=t(require("../arithmetic/abs")),u=t(require("../arithmetic/add")),a=t(require("../arithmetic/addScalar")),o=t(require("../../type/matrix/function/matrix")),f=t(require("../arithmetic/multiply")),m=t(require("../arithmetic/multiplyScalar")),c=t(require("../arithmetic/divideScalar")),h=t(require("../arithmetic/subtract")),s=t(require("../relational/smaller")),w=t(require("../relational/equalScalar")),y=i("intersect",{"Array, Array, Array":function(r,e,t){if(!g(r))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!g(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!function(r){return 4===r.length&&l(r[0])&&l(r[1])&&l(r[2])&&l(r[3])}(t))throw new TypeError("Array with 4 numbers expected as third argument");return function(r,e,t,i,n,u,o,f,s,w){var y=m(r,o),l=m(i,o),p=m(e,f),g=m(n,f),b=m(t,s),d=m(u,s),x=c(h(h(h(w,y),p),b),h(h(h(a(a(l,g),d),y),p),b)),A=a(r,m(x,h(i,r))),v=a(e,m(x,h(n,e))),E=a(t,m(x,h(u,t)));return[A,v,E]}(r[0],r[1],r[2],e[0],e[1],e[2],t[0],t[1],t[2],t[3])},"Array, Array, Array, Array":function(r,t,i,o){if(2===r.length){if(!p(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!p(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!p(i))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!p(o))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return function(r,t,i,o){var w=r,y=i,l=h(w,t),p=h(y,o),g=h(m(l[0],p[1]),m(p[0],l[1]));if(s(n(g),e.epsilon))return null;var b=m(p[0],w[1]),d=m(p[1],w[0]),x=m(p[0],y[1]),A=m(p[1],y[0]),v=c(a(h(h(b,d),x),A),g);return u(f(l,v),w)}(r,t,i,o)}if(3===r.length){if(!g(r))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!g(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!g(i))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!g(o))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return y=r[0],l=r[1],d=r[2],x=t[0],A=t[1],v=t[2],E=i[0],T=i[1],q=i[2],B=o[0],N=o[1],M=o[2],O=b(y,E,B,E,l,T,N,T,d,q,M,q),S=b(B,E,x,y,N,T,A,l,M,q,v,d),j=b(y,E,x,y,l,T,A,l,d,q,v,d),k=b(B,E,B,E,N,T,N,T,M,q,M,q),z=b(x,y,x,y,A,l,A,l,v,d,v,d),C=c(h(m(O,S),m(j,k)),h(m(z,k),m(S,S))),D=c(a(O,m(C,S)),k),F=a(y,m(C,h(x,y))),G=a(l,m(C,h(A,l))),H=a(d,m(C,h(v,d))),I=a(E,m(D,h(B,E))),J=a(T,m(D,h(N,T))),K=a(q,m(D,h(M,q))),w(F,I)&&w(G,J)&&w(H,K)?[F,G,H]:null}throw new TypeError("Arrays with two or thee dimensional points expected");var y,l,d,x,A,v,E,T,q,B,N,M,O,S,j,k,z,C,D,F,G,H,I,J,K},"Matrix, Matrix, Matrix":function(r,e,t){return o(y(r.valueOf(),e.valueOf(),t.valueOf()))},"Matrix, Matrix, Matrix, Matrix":function(r,e,t,i){return o(y(r.valueOf(),e.valueOf(),t.valueOf(),i.valueOf()))}});function l(e){return"number"==typeof e||r.isBigNumber(e)}function p(r){return 2===r.length&&l(r[0])&&l(r[1])}function g(r){return 3===r.length&&l(r[0])&&l(r[1])&&l(r[2])}function b(r,e,t,i,n,u,o,f,c,s,w,y){var l=m(h(r,e),h(t,i)),p=m(h(n,u),h(o,f)),g=m(h(c,s),h(w,y));return a(a(l,p),g)}return y}exports.name="intersect",exports.factory=r;
},{"../arithmetic/abs":"K5X1","../arithmetic/add":"zf2Z","../arithmetic/addScalar":"ZM3O","../../type/matrix/function/matrix":"vzj5","../arithmetic/multiply":"k7By","../arithmetic/multiplyScalar":"obRw","../arithmetic/divideScalar":"R3aq","../arithmetic/subtract":"m78R","../relational/smaller":"Q7ag","../relational/equalScalar":"QvIw"}],"HQQE":[function(require,module,exports) {
"use strict";function r(r,e,n,t){var o=n(require("../arithmetic/addScalar")),i=n(require("../arithmetic/subtract")),a=n(require("../arithmetic/multiplyScalar")),s=n(require("../arithmetic/divideScalar")),u=n(require("../arithmetic/unaryMinus")),p=n(require("../arithmetic/sqrt")),h=n(require("../arithmetic/abs"));function w(e){return"number"==typeof e||r.isBigNumber(e)}function y(r){return r.constructor!==Array&&(r=m(r)),w(r[0])&&w(r[1])}function f(r){return r.constructor!==Array&&(r=m(r)),w(r[0])&&w(r[1])&&w(r[2])}function c(r){return r.constructor!==Array&&(r=m(r)),w(r[0])&&w(r[1])&&w(r[2])&&w(r[3])&&w(r[4])&&w(r[5])}function m(r){for(var e=Object.keys(r),n=[],t=0;t<e.length;t++)n.push(r[e[t]]);return n}function b(r,e,n,t,i){var u=h(o(o(a(n,r),a(t,e)),i)),w=p(o(a(n,n),a(t,t)));return s(u,w)}function l(r,e,n,t,u,h,w,y,f){var c=[i(a(i(u,e),f),a(i(h,n),y)),i(a(i(h,n),w),a(i(t,r),f)),i(a(i(t,r),y),a(i(u,e),w))];c=p(o(o(a(c[0],c[0]),a(c[1],c[1])),a(c[2],c[2])));var m=p(o(o(a(w,w),a(y,y)),a(f,f)));return s(c,m)}function g(r,e,n,t){var s=i(t,e),u=i(n,r),h=o(a(s,s),a(u,u));return p(h)}function O(r,e,n,t,s,u){var h=i(u,n),w=i(s,e),y=i(t,r),f=o(o(a(h,h),a(w,w)),a(y,y));return p(f)}return t("distance",{"Array, Array, Array":function(r,e,n){if(2===r.length&&2===e.length&&2===n.length){if(!y(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!y(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!y(n))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");var t=s(i(n[1],n[0]),i(e[1],e[0])),o=a(a(t,t),e[0]),p=u(a(t,e[0])),h=r[1];return b(r[0],r[1],o,p,h)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(r,e,n){if(2===Object.keys(r).length&&2===Object.keys(e).length&&2===Object.keys(n).length){if(!y(r))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!y(e))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!y(n))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(r.hasOwnProperty("pointX")&&r.hasOwnProperty("pointY")&&e.hasOwnProperty("lineOnePtX")&&e.hasOwnProperty("lineOnePtY")&&n.hasOwnProperty("lineTwoPtX")&&n.hasOwnProperty("lineTwoPtY")){var t=s(i(n.lineTwoPtY,n.lineTwoPtX),i(e.lineOnePtY,e.lineOnePtX)),o=a(a(t,t),e.lineOnePtX),p=u(a(t,e.lineOnePtX)),h=r.pointX;return b(r.pointX,r.pointY,o,p,h)}throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(r,e){if(2===r.length&&3===e.length){if(!y(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return b(r[0],r[1],e[0],e[1],e[2])}if(3===r.length&&6===e.length){if(!f(r))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!c(e))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return l(r[0],r[1],r[2],e[0],e[1],e[2],e[3],e[4],e[5])}if(2===r.length&&2===e.length){if(!y(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!y(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");return g(r[0],r[1],e[0],e[1])}if(3===r.length&&3===e.length){if(!f(r))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!f(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return O(r[0],r[1],r[2],e[0],e[1],e[2])}throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(r,e){if(2===Object.keys(r).length&&3===Object.keys(e).length){if(!y(r))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(e))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if(r.hasOwnProperty("pointX")&&r.hasOwnProperty("pointY")&&e.hasOwnProperty("x
},{"../arithmetic/addScalar":"ZM3O","../arithmetic/subtract":"m78R","../arithmetic/multiplyScalar":"obRw","../arithmetic/divideScalar":"R3aq","../arithmetic/unaryMinus":"q5A1","../arithmetic/sqrt":"T6pB","../arithmetic/abs":"K5X1"}],"W9Zs":[function(require,module,exports) {
"use strict";module.exports=[require("./intersect"),require("./distance")];
},{"./intersect":"Lso4","./distance":"HQQE"}],"yt75":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function t(t,e,n,u){var i=require("../../utils/latex"),o=u("not",{number:function(r){return!r},Complex:function(r){return 0===r.re&&0===r.im},BigNumber:function(r){return r.isZero()||r.isNaN()},Unit:function(r){return null===r.value||o(r.value)},"Array | Matrix":function(t){return r(t,o)}});return o.toTex={1:i.operators.not+"\\left(${args[0]}\\right)"},o}exports.name="not",exports.factory=t;
},{"../../utils/collection/deepMap":"lOYo","../../utils/latex":"H1Mr"}],"T9FX":[function(require,module,exports) {
"use strict";function r(r,t,e,n){var i=require("../../utils/latex"),a=e(require("../../type/matrix/function/matrix")),u=e(require("../matrix/zeros")),o=e(require("./not")),s=e(require("../../type/matrix/utils/algorithm02")),x=e(require("../../type/matrix/utils/algorithm06")),f=e(require("../../type/matrix/utils/algorithm11")),c=e(require("../../type/matrix/utils/algorithm13")),m=e(require("../../type/matrix/utils/algorithm14")),l=n("and",{"number, number":function(r,t){return!(!r||!t)},"Complex, Complex":function(r,t){return!(0===r.re&&0===r.im||0===t.re&&0===t.im)},"BigNumber, BigNumber":function(r,t){return!(r.isZero()||t.isZero()||r.isNaN()||t.isNaN())},"Unit, Unit":function(r,t){return l(r.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(r,t){return x(r,t,l,!1)},"SparseMatrix, DenseMatrix":function(r,t){return s(t,r,l,!0)},"DenseMatrix, SparseMatrix":function(r,t){return s(r,t,l,!1)},"DenseMatrix, DenseMatrix":function(r,t){return c(r,t,l)},"Array, Array":function(r,t){return l(a(r),a(t)).valueOf()},"Array, Matrix":function(r,t){return l(a(r),t)},"Matrix, Array":function(r,t){return l(r,a(t))},"SparseMatrix, any":function(r,t){return o(t)?u(r.size(),r.storage()):f(r,t,l,!1)},"DenseMatrix, any":function(r,t){return o(t)?u(r.size(),r.storage()):m(r,t,l,!1)},"any, SparseMatrix":function(r,t){return o(r)?u(r.size(),r.storage()):f(t,r,l,!0)},"any, DenseMatrix":function(r,t){return o(r)?u(r.size(),r.storage()):m(t,r,l,!0)},"Array, any":function(r,t){return l(a(r),t).valueOf()},"any, Array":function(r,t){return l(r,a(t)).valueOf()}});return l.toTex={2:"\\left(${args[0]}".concat(i.operators.and,"${args[1]}\\right)")},l}exports.name="and",exports.factory=r;
},{"../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5","../matrix/zeros":"BAjv","./not":"yt75","../../type/matrix/utils/algorithm02":"j4Xj","../../type/matrix/utils/algorithm06":"WzD7","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"Jm4S":[function(require,module,exports) {
"use strict";function r(r,t,e,n){var i=require("../../utils/latex"),u=e(require("../../type/matrix/function/matrix")),a=e(require("../../type/matrix/utils/algorithm03")),o=e(require("../../type/matrix/utils/algorithm05")),s=e(require("../../type/matrix/utils/algorithm12")),x=e(require("../../type/matrix/utils/algorithm13")),f=e(require("../../type/matrix/utils/algorithm14")),c=n("or",{"number, number":function(r,t){return!(!r&&!t)},"Complex, Complex":function(r,t){return 0!==r.re||0!==r.im||0!==t.re||0!==t.im},"BigNumber, BigNumber":function(r,t){return!r.isZero()&&!r.isNaN()||!t.isZero()&&!t.isNaN()},"Unit, Unit":function(r,t){return c(r.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(r,t){return o(r,t,c)},"SparseMatrix, DenseMatrix":function(r,t){return a(t,r,c,!0)},"DenseMatrix, SparseMatrix":function(r,t){return a(r,t,c,!1)},"DenseMatrix, DenseMatrix":function(r,t){return x(r,t,c)},"Array, Array":function(r,t){return c(u(r),u(t)).valueOf()},"Array, Matrix":function(r,t){return c(u(r),t)},"Matrix, Array":function(r,t){return c(r,u(t))},"SparseMatrix, any":function(r,t){return s(r,t,c,!1)},"DenseMatrix, any":function(r,t){return f(r,t,c,!1)},"any, SparseMatrix":function(r,t){return s(t,r,c,!0)},"any, DenseMatrix":function(r,t){return f(t,r,c,!0)},"Array, any":function(r,t){return f(u(r),t,c,!1).valueOf()},"any, Array":function(r,t){return f(u(t),r,c,!0).valueOf()}});return c.toTex={2:"\\left(${args[0]}".concat(i.operators.or,"${args[1]}\\right)")},c}exports.name="or",exports.factory=r;
},{"../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm05":"JNXe","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"TZVj":[function(require,module,exports) {
"use strict";function r(r,t,e,n){var i=require("../../utils/latex"),u=e(require("../../type/matrix/function/matrix")),a=e(require("../../type/matrix/utils/algorithm03")),o=e(require("../../type/matrix/utils/algorithm07")),x=e(require("../../type/matrix/utils/algorithm12")),s=e(require("../../type/matrix/utils/algorithm13")),f=e(require("../../type/matrix/utils/algorithm14")),c=n("xor",{"number, number":function(r,t){return!!r!=!!t},"Complex, Complex":function(r,t){return(0!==r.re||0!==r.im)!=(0!==t.re||0!==t.im)},"BigNumber, BigNumber":function(r,t){return(!r.isZero()&&!r.isNaN())!=(!t.isZero()&&!t.isNaN())},"Unit, Unit":function(r,t){return c(r.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(r,t){return o(r,t,c)},"SparseMatrix, DenseMatrix":function(r,t){return a(t,r,c,!0)},"DenseMatrix, SparseMatrix":function(r,t){return a(r,t,c,!1)},"DenseMatrix, DenseMatrix":function(r,t){return s(r,t,c)},"Array, Array":function(r,t){return c(u(r),u(t)).valueOf()},"Array, Matrix":function(r,t){return c(u(r),t)},"Matrix, Array":function(r,t){return c(r,u(t))},"SparseMatrix, any":function(r,t){return x(r,t,c,!1)},"DenseMatrix, any":function(r,t){return f(r,t,c,!1)},"any, SparseMatrix":function(r,t){return x(t,r,c,!0)},"any, DenseMatrix":function(r,t){return f(t,r,c,!0)},"Array, any":function(r,t){return f(u(r),t,c,!1).valueOf()},"any, Array":function(r,t){return f(u(t),r,c,!0).valueOf()}});return c.toTex={2:"\\left(${args[0]}".concat(i.operators.xor,"${args[1]}\\right)")},c}exports.name="xor",exports.factory=r;
},{"../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm07":"u44a","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"TPFf":[function(require,module,exports) {
"use strict";module.exports=[require("./and"),require("./not"),require("./or"),require("./xor")];
},{"./and":"T9FX","./not":"yt75","./or":"Jm4S","./xor":"TZVj"}],"f9k3":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").size,e=require("../../utils/collection/isMatrix"),t=require("../../error/IndexError");function n(n,u,o,a){var f=o(require("../utils/isInteger")),s=a("apply",{"Array | Matrix, number | BigNumber, function":function(n,u,o){if(!f(u))throw new TypeError("Integer number expected for dimension");var a=Array.isArray(n)?r(n):n.size();if(u<0||u>=a.length)throw new t(u,a.length);return e(n)?n.create(i(n.valueOf(),u,o)):i(n,u,o)}});return s.toTex=void 0,s}function i(r,e,t){var n,o,a;if(e<=0){if(Array.isArray(r[0])){for(a=u(r),o=[],n=0;n<a.length;n++)o[n]=i(a[n],e-1,t);return o}return t(r)}for(o=[],n=0;n<r.length;n++)o[n]=i(r[n],e-1,t);return o}function u(r){var e,t,n=r.length,i=r[0].length,u=[];for(t=0;t<i;t++){var o=[];for(e=0;e<n;e++)o.push(r[e][t]);u.push(o)}return u}exports.name="apply",exports.factory=n;
},{"../../utils/array":"j2lF","../../utils/collection/isMatrix":"gfmG","../../error/IndexError":"tfOV","../utils/isInteger":"qG7X"}],"rN68":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").nearlyEqual,e=require("../../utils/bignumber/nearlyEqual");function t(t,n,i,a){var u=i(require("../../type/matrix/function/matrix")),o=i(require("../../type/matrix/utils/algorithm03")),l=i(require("../../type/matrix/utils/algorithm07")),s=i(require("../../type/matrix/utils/algorithm12")),f=i(require("../../type/matrix/utils/algorithm13")),c=i(require("../../type/matrix/utils/algorithm14")),m=require("../../utils/latex"),x=a("smallerEq",{"boolean, boolean":function(r,e){return r<=e},"number, number":function(e,t){return e<=t||r(e,t,n.epsilon)},"BigNumber, BigNumber":function(r,t){return r.lte(t)||e(r,t,n.epsilon)},"Fraction, Fraction":function(r,e){return 1!==r.compare(e)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(r,e){if(!r.equalBase(e))throw new Error("Cannot compare units with different base");return x(r.value,e.value)},"SparseMatrix, SparseMatrix":function(r,e){return l(r,e,x)},"SparseMatrix, DenseMatrix":function(r,e){return o(e,r,x,!0)},"DenseMatrix, SparseMatrix":function(r,e){return o(r,e,x,!1)},"DenseMatrix, DenseMatrix":function(r,e){return f(r,e,x)},"Array, Array":function(r,e){return x(u(r),u(e)).valueOf()},"Array, Matrix":function(r,e){return x(u(r),e)},"Matrix, Array":function(r,e){return x(r,u(e))},"SparseMatrix, any":function(r,e){return s(r,e,x,!1)},"DenseMatrix, any":function(r,e){return c(r,e,x,!1)},"any, SparseMatrix":function(r,e){return s(e,r,x,!0)},"any, DenseMatrix":function(r,e){return c(e,r,x,!0)},"Array, any":function(r,e){return c(u(r),e,x,!1).valueOf()},"any, Array":function(r,e){return c(u(e),r,x,!0).valueOf()}});return x.toTex={2:"\\left(${args[0]}".concat(m.operators.smallerEq,"${args[1]}\\right)")},x}exports.name="smallerEq",exports.factory=t;
},{"../../utils/number":"uqMu","../../utils/bignumber/nearlyEqual":"Uu9K","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm07":"u44a","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB","../../utils/latex":"H1Mr"}],"lueR":[function(require,module,exports) {
"use strict";function r(r,e,n,u){var t=n(require("../../type/matrix/function/matrix")),i=n(require("../relational/smaller")),o=n(require("../relational/larger")),a=n(require("../relational/smallerEq")),f=n(require("../relational/largerEq")),s=new r.BigNumber(0),l=new r.BigNumber(1),m=u("range",{string:g,"string, boolean":g,"number, number":function(r,e){return b(c(r,e,1))},"number, number, number":function(r,e,n){return b(c(r,e,n))},"number, number, boolean":function(r,e,n){return b(n?p(r,e,1):c(r,e,1))},"number, number, number, boolean":function(r,e,n,u){return b(u?p(r,e,n):c(r,e,n))},"BigNumber, BigNumber":function(r,e){return b(N(r,e,l))},"BigNumber, BigNumber, BigNumber":function(r,e,n){return b(N(r,e,n))},"BigNumber, BigNumber, boolean":function(r,e,n){return b(n?B(r,e,l):N(r,e,l))},"BigNumber, BigNumber, BigNumber, boolean":function(r,e,n,u){return b(u?B(r,e,n):N(r,e,n))}});return m.toTex=void 0,m;function b(r){return"Array"===e.matrix?r:t(r)}function g(n,u){var t=function(r){var e=r.split(":").map(function(r){return Number(r)});if(e.some(function(r){return isNaN(r)}))return null;switch(e.length){case 2:return{start:e[0],end:e[1],step:1};case 3:return{start:e[0],end:e[2],step:e[1]};default:return null}}(n);if(!t)throw new SyntaxError('String "'+n+'" is no valid range');return"BigNumber"===e.number?b((u?B:N)(new r.BigNumber(t.start),new r.BigNumber(t.end),new r.BigNumber(t.step))):b((u?p:c)(t.start,t.end,t.step))}function c(r,e,n){var u=[],t=r;if(n>0)for(;i(t,e);)u.push(t),t+=n;else if(n<0)for(;o(t,e);)u.push(t),t+=n;return u}function p(r,e,n){var u=[],t=r;if(n>0)for(;a(t,e);)u.push(t),t+=n;else if(n<0)for(;f(t,e);)u.push(t),t+=n;return u}function N(r,e,n){var u=[],t=r;if(n.gt(s))for(;i(t,e);)u.push(t),t=t.plus(n);else if(n.lt(s))for(;o(t,e);)u.push(t),t=t.plus(n);return u}function B(r,e,n){var u=[],t=r;if(n.gt(s))for(;a(t,e);)u.push(t),t=t.plus(n);else if(n.lt(s))for(;f(t,e);)u.push(t),t=t.plus(n);return u}}exports.name="range",exports.factory=r;
},{"../../type/matrix/function/matrix":"vzj5","../relational/smaller":"Q7ag","../relational/larger":"SrDl","../relational/smallerEq":"rN68","../relational/largerEq":"d923"}],"g7VB":[function(require,module,exports) {
"use strict";var r=require("../../utils/object").clone,e=require("../../utils/array").validateIndex;function t(t,i,n,u){var a=n(require("../../type/matrix/MatrixIndex")),o=n(require("../../type/matrix/function/matrix")),s=n(require("./range")),x=u("column",{"Matrix, number":c,"Array, number":function(e,t){return c(o(r(e)),t).valueOf()}});return x.toTex=void 0,x;function c(r,t){if(2!==r.size().length)throw new Error("Only two dimensional matrix is supported");e(t,r.size()[1]);var i=s(0,r.size()[0]),n=new a(i,t);return r.subset(n)}}exports.name="column",exports.factory=t;
},{"../../utils/object":"FcSp","../../utils/array":"j2lF","../../type/matrix/MatrixIndex":"SL3U","../../type/matrix/function/matrix":"vzj5","./range":"lueR"}],"LXdZ":[function(require,module,exports) {
"use strict";var r=require("../../utils/object").clone,e=require("../../utils/array"),t=require("../../error/IndexError"),n=require("../../error/DimensionError");function i(i,u,a,s){var f=a(require("../../type/matrix/function/matrix")),c=a(require("../utils/isInteger")),l=s("concat",{"...Array | Matrix | number | BigNumber":function(u){var a,s,l=u.length,h=-1,g=!1,m=[];for(a=0;a<l;a++){var w=u[a];if(i.isMatrix(w)&&(g=!0),i.isNumber(w)||i.isBigNumber(w)){if(a!==l-1)throw new Error("Dimension must be specified as last argument");if(s=h,h=w.valueOf(),!c(h))throw new TypeError("Integer number expected for dimension");if(h<0||a>0&&h>s)throw new t(h,s+1)}else{var x=r(w).valueOf(),v=e.size(x);if(m[a]=x,s=h,h=v.length-1,a>0&&h!==s)throw new n(s+1,h+1)}}if(0===m.length)throw new SyntaxError("At least one matrix expected");for(var b=m.shift();m.length;)b=o(b,m.shift(),h,0);return g?f(b):b},"...string":function(r){return r.join("")}});return l.toTex=void 0,l}function o(r,e,t,i){if(i<t){if(r.length!==e.length)throw new n(r.length,e.length);for(var u=[],a=0;a<r.length;a++)u[a]=o(r[a],e[a],t,i+1);return u}return r.concat(e)}exports.name="concat",exports.factory=i;
},{"../../utils/object":"FcSp","../../utils/array":"j2lF","../../error/IndexError":"tfOV","../../error/DimensionError":"YiAw","../../type/matrix/function/matrix":"vzj5","../utils/isInteger":"qG7X"}],"GWq7":[function(require,module,exports) {
"use strict";var r=require("../../utils/array");function t(t,e,i,a){var n=i(require("../../type/matrix/function/matrix")),o=i(require("../arithmetic/subtract")),u=i(require("../arithmetic/multiply")),s=a("cross",{"Matrix, Matrix":function(r,t){return n(c(r.toArray(),t.toArray()))},"Matrix, Array":function(r,t){return n(c(r.toArray(),t))},"Array, Matrix":function(r,t){return n(c(r,t.toArray()))},"Array, Array":c});return s.toTex={2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},s;function c(t,e){var i=Math.max(r.size(t).length,r.size(e).length);t=r.squeeze(t),e=r.squeeze(e);var a=r.size(t),n=r.size(e);if(1!==a.length||1!==n.length||3!==a[0]||3!==n[0])throw new RangeError("Vectors with length 3 expected (Size A = ["+a.join(", ")+"], B = ["+n.join(", ")+"])");var s=[o(u(t[1],e[2]),u(t[2],e[1])),o(u(t[2],e[0]),u(t[0],e[2])),o(u(t[0],e[1]),u(t[1],e[0]))];return i>1?[s]:s}}exports.name="cross",exports.factory=t;
},{"../../utils/array":"j2lF","../../type/matrix/function/matrix":"vzj5","../arithmetic/subtract":"m78R","../arithmetic/multiply":"k7By"}],"pnEY":[function(require,module,exports) {
"use strict";function r(r,e,t,o){var s=t(require("./transpose")),n=t(require("../complex/conj")),a=require("../../utils/latex"),c=o("ctranspose",{any:function(r){return n(s(r))}});return c.toTex={1:"\\left(${args[0]}\\right)".concat(a.operators.ctranspose)},c}exports.name="ctranspose",exports.factory=r;
},{"./transpose":"C2z0","../complex/conj":"msvi","../../utils/latex":"H1Mr"}],"JNTV":[function(require,module,exports) {
"use strict";var r=require("../../utils/array"),n=require("../../utils/number").isInteger;function t(t,e,i,u){var a=i(require("../../type/matrix/function/matrix")),o=u("diag",{Array:function(n){return s(n,0,r.size(n),null)},"Array, number":function(n,t){return s(n,t,r.size(n),null)},"Array, BigNumber":function(n,t){return s(n,t.toNumber(),r.size(n),null)},"Array, string":function(n,t){return s(n,0,r.size(n),t)},"Array, number, string":function(n,t,e){return s(n,t,r.size(n),e)},"Array, BigNumber, string":function(n,t,e){return s(n,t.toNumber(),r.size(n),e)},Matrix:function(r){return s(r,0,r.size(),r.storage())},"Matrix, number":function(r,n){return s(r,n,r.size(),r.storage())},"Matrix, BigNumber":function(r,n){return s(r,n.toNumber(),r.size(),r.storage())},"Matrix, string":function(r,n){return s(r,0,r.size(),n)},"Matrix, number, string":function(r,n,t){return s(r,n,r.size(),t)},"Matrix, BigNumber, string":function(r,n,t){return s(r,n.toNumber(),r.size(),t)}});return o.toTex=void 0,o;function s(r,e,i,u){if(!n(e))throw new TypeError("Second parameter in function diag must be an integer");var o=e>0?e:0,s=e<0?-e:0;switch(i.length){case 1:return function(r,n,e,i,u,a){var o=[i+u,i+a],s=t.Matrix.storage(e||"dense").diagonal(o,r,n);return null!==e?s:s.valueOf()}(r,e,u,i[0],s,o);case 2:return function(r,n,e,i,u,o){if(t.isMatrix(r)){var s=r.diagonal(n);return null!==e?e!==s.storage()?a(s,e):s:s.valueOf()}for(var f=Math.min(i[0]-u,i[1]-o),c=[],g=0;g<f;g++)c[g]=r[g+u][g+o];return null!==e?a(c):c}(r,e,u,i,s,o)}throw new RangeError("Matrix for function diag must be 2 dimensional")}}exports.name="diag",exports.factory=t;
},{"../../utils/array":"j2lF","../../utils/number":"uqMu","../../type/matrix/function/matrix":"vzj5"}],"unxK":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").size;function t(t,e,a,o){var n=a(require("../arithmetic/add")),i=a(require("../arithmetic/multiply")),u=o("dot",{"Matrix, Matrix":function(r,t){return c(r.toArray(),t.toArray())},"Matrix, Array":function(r,t){return c(r.toArray(),t)},"Array, Matrix":function(r,t){return c(r,t.toArray())},"Array, Array":c});return u.toTex={2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},u;function c(t,e){var a=r(t),o=r(e),u=a[0];if(1!==a.length||1!==o.length)throw new RangeError("Vector expected");if(a[0]!==o[0])throw new RangeError("Vectors must have equal length ("+a[0]+" != "+o[0]+")");if(0===u)throw new RangeError("Cannot calculate the dot product of empty vectors");for(var c=0,f=0;f<u;f++)c=n(c,i(t[f],e[f]));return c}}exports.name="dot",exports.factory=t;
},{"../../utils/array":"j2lF","../arithmetic/add":"zf2Z","../arithmetic/multiply":"k7By"}],"pW27":[function(require,module,exports) {
"use strict";function e(e,t,r,i){return function(){throw new Error('Function "eye" is renamed to "identity" since mathjs version 5.0.0. To keep eye working, create an alias for it using "math.import({eye: math.identity}, {override: true})"')}}exports.name="eye",exports.factory=e;
},{}],"XFhy":[function(require,module,exports) {
"use strict";var r=require("../../utils/string").format;function e(e,t,a,i){var n=a(require("../arithmetic/abs")),o=a(require("../arithmetic/add")),u=a(require("./identity")),f=a(require("./inv")),s=a(require("../arithmetic/multiply")),p=e.SparseMatrix,c=i("expm",{Matrix:function(t){var a=t.size();if(2!==a.length||a[0]!==a[1])throw new RangeError("Matrix must be square (size: "+r(a)+")");for(var i=a[0],c=function(r,e){for(var t=0;t<30;t++)for(var a=0;a<=t;a++){var i=t-a;if(m(r,a,i)<e)return{q:a,j:i}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}(function(r){for(var e=r.size()[0],t=0,a=0;a<e;a++){for(var i=0,o=0;o<e;o++)i+=n(r.get([a,o]));t=Math.max(i,t)}return t}(t),1e-15),x=c.q,v=c.j,h=s(t,Math.pow(2,-v)),q=u(i),l=u(i),w=1,M=h,g=-1,d=1;d<=x;d++)d>1&&(M=s(M,h),g=-g),q=o(q,s(w=w*(x-d+1)/((2*x-d+1)*d),M)),l=o(l,s(w*g,M));for(var y=s(f(l),q),z=0;z<v;z++)y=s(y,y);return e.isSparseMatrix(t)?new p(y):y}});function m(r,e,t){for(var a=1,i=2;i<=e;i++)a*=i;for(var n=a,o=e+1;o<=2*e;o++)n*=o;var u=n*(2*e+1);return 8*Math.pow(r/Math.pow(2,t),2*e)*a*a/(n*u)}return c.toTex={1:"\\exp\\left(${args[0]}\\right)"},c}exports.name="expm",exports.factory=e;
},{"../../utils/string":"PshC","../arithmetic/abs":"K5X1","../arithmetic/add":"zf2Z","./identity":"zJUT","./inv":"yHuZ","../arithmetic/multiply":"k7By"}],"QC1r":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").filter,t=require("../../utils/array").filterRegExp,e=require("../../utils/function").maxArgumentCount;function i(r,e,i,u){var a=i(require("../../type/matrix/function/matrix")),o=u("filter",{"Array, function":n,"Matrix, function":function(r,t){return a(n(r.toArray(),t))},"Array, RegExp":t,"Matrix, RegExp":function(r,e){return a(t(r.toArray(),e))}});return o.toTex=void 0,o}function n(t,i){var n=e(i);return r(t,function(r,t,e){return 1===n?i(r):2===n?i(r,[t]):i(r,[t],e)})}exports.name="filter",exports.factory=i;
},{"../../utils/array":"j2lF","../../utils/function":"woyg","../../type/matrix/function/matrix":"vzj5"}],"KNrk":[function(require,module,exports) {
"use strict";var r=require("../../utils/object").clone,t=require("../../utils/array").flatten;function e(e,n,a,i){var u=a(require("../../type/matrix/function/matrix")),o=i("flatten",{Array:function(e){return t(r(e))},Matrix:function(e){var n=t(r(e.toArray()));return u(n)}});return o.toTex=void 0,o}exports.name="flatten",exports.factory=e;
},{"../../utils/object":"FcSp","../../utils/array":"j2lF","../../type/matrix/function/matrix":"vzj5"}],"dOnH":[function(require,module,exports) {
"use strict";var r=require("../../utils/function").maxArgumentCount,n=require("../../utils/array").forEach;function t(r,n,t,a){var u=a("forEach",{"Array, function":o,"Matrix, function":function(r,n){return r.forEach(n)}});return u.toTex=void 0,u}function o(t,o){var a=r(o);!function r(u,c){Array.isArray(u)?n(u,function(n,t){r(n,c.concat(t))}):1===a?o(u):2===a?o(u,c):o(u,c,t)}(t,[])}exports.name="forEach",exports.factory=t;
},{"../../utils/function":"woyg","../../utils/array":"j2lF"}],"g4K8":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").size;function t(t,n,e,i){var a=e(require("../../type/matrix/function/matrix")),u=e(require("../arithmetic/multiplyScalar"));return i("kron",{"Matrix, Matrix":function(r,t){return a(o(r.toArray(),t.toArray()))},"Matrix, Array":function(r,t){return a(o(r.toArray(),t))},"Array, Matrix":function(r,t){return a(o(r,t.toArray()))},"Array, Array":o});function o(t,n){if(1===r(t).length&&(t=[t]),1===r(n).length&&(n=[n]),r(t).length>2||r(n).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(t.length)+", y = "+JSON.stringify(n.length)+")");var e=[],i=[];return t.map(function(r){return n.map(function(t){return i=[],e.push(i),r.map(function(r){return t.map(function(t){return i.push(u(r,t))})})})})&&e}}exports.name="kron",exports.factory=t;
},{"../../utils/array":"j2lF","../../type/matrix/function/matrix":"vzj5","../arithmetic/multiplyScalar":"obRw"}],"dcuN":[function(require,module,exports) {
"use strict";var r=require("../../utils/function").maxArgumentCount;function n(r,n,u,a){var o=a("map",{"Array, function":t,"Matrix, function":function(r,n){return r.map(n)}});return o.toTex=void 0,o}function t(n,t){var u=r(t);return function r(a,o){return Array.isArray(a)?a.map(function(n,t){return r(n,o.concat(t))}):1===u?t(a):2===u?t(a,o):t(a,o,n)}(n,[])}exports.name="map",exports.factory=n;
},{"../../utils/function":"woyg"}],"dmcR":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").isInteger,e=require("../../utils/array").resize;function t(t,n,i,u){var a=i(require("../../type/matrix/function/matrix")),o=u("ones",{"":function(){return"Array"===n.matrix?f([]):f([],"default")},"...number | BigNumber | string":function(r){if("string"==typeof r[r.length-1]){var e=r.pop();return f(r,e)}return"Array"===n.matrix?f(r):f(r,"default")},Array:f,Matrix:function(r){var e=r.storage();return f(r.valueOf(),e)},"Array | Matrix, string":function(r,e){return f(r.valueOf(),e)}});return o.toTex=void 0,o;function f(n,i){var u=function(r){var e=!1;return r.forEach(function(r,n,i){t.isBigNumber(r)&&(e=!0,i[n]=r.toNumber())}),e}(n)?new t.BigNumber(1):1;if(function(e){e.forEach(function(e){if("number"!=typeof e||!r(e)||e<0)throw new Error("Parameters in function ones must be positive integers")})}(n),i){var o=a(i);return n.length>0?o.resize(n,u):o}var f=[];return n.length>0?e(f,n,u):f}}exports.name="ones",exports.factory=t;
},{"../../utils/number":"uqMu","../../utils/array":"j2lF","../../type/matrix/function/matrix":"vzj5"}],"AHex":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function n(n,t,e,u){return u("isNaN",{number:function(r){return Number.isNaN(r)},BigNumber:function(r){return r.isNaN()},Fraction:function(r){return!1},Complex:function(r){return r.isNaN()},Unit:function(r){return Number.isNaN(r.value)},"Array | Matrix":function(n){return r(n,Number.isNaN)}})}exports.name="isNaN",exports.factory=n;
},{"../../utils/collection/deepMap":"lOYo"}],"yGce":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").nearlyEqual,e=require("../../utils/bignumber/nearlyEqual");function n(n,t,i,u){var a=i(require("../../type/matrix/function/matrix")),o=i(require("../../type/matrix/utils/algorithm03")),c=i(require("../../type/matrix/utils/algorithm05")),f=i(require("../../type/matrix/utils/algorithm12")),l=i(require("../../type/matrix/utils/algorithm13")),m=i(require("../../type/matrix/utils/algorithm14")),s=u("compare",{"boolean, boolean":function(r,e){return r===e?0:r>e?1:-1},"number, number":function(e,n){return e===n||r(e,n,t.epsilon)?0:e>n?1:-1},"BigNumber, BigNumber":function(r,i){return r.eq(i)||e(r,i,t.epsilon)?new n.BigNumber(0):new n.BigNumber(r.cmp(i))},"Fraction, Fraction":function(r,e){return new n.Fraction(r.compare(e))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(r,e){if(!r.equalBase(e))throw new Error("Cannot compare units with different base");return s(r.value,e.value)},"SparseMatrix, SparseMatrix":function(r,e){return c(r,e,s)},"SparseMatrix, DenseMatrix":function(r,e){return o(e,r,s,!0)},"DenseMatrix, SparseMatrix":function(r,e){return o(r,e,s,!1)},"DenseMatrix, DenseMatrix":function(r,e){return l(r,e,s)},"Array, Array":function(r,e){return s(a(r),a(e)).valueOf()},"Array, Matrix":function(r,e){return s(a(r),e)},"Matrix, Array":function(r,e){return s(r,a(e))},"SparseMatrix, any":function(r,e){return f(r,e,s,!1)},"DenseMatrix, any":function(r,e){return m(r,e,s,!1)},"any, SparseMatrix":function(r,e){return f(e,r,s,!0)},"any, DenseMatrix":function(r,e){return m(e,r,s,!0)},"Array, any":function(r,e){return m(a(r),e,s,!1).valueOf()},"any, Array":function(r,e){return m(a(e),r,s,!0).valueOf()}});return s.toTex=void 0,s}exports.name="compare",exports.factory=n;
},{"../../utils/number":"uqMu","../../utils/bignumber/nearlyEqual":"Uu9K","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm05":"JNXe","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"kE3o":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").isInteger;function e(e,t,n,i){var o=n(require("../utils/isNumeric")),u=n(require("../utils/isNaN")),a=n(require("../relational/compare"));function s(r,e){return-a(r,e)}return i("partitionSelect",{"Array | Matrix, number":function(r,e){return f(r,e,a)},"Array | Matrix, number, string":function(r,e,t){if("asc"===t)return f(r,e,a);if("desc"===t)return f(r,e,s);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":f});function f(t,n,i){if(!r(n)||n<0)throw new Error("k must be a non-negative integer");if(e.isMatrix(t)){if(t.size().length>1)throw new Error("Only one dimensional matrices supported");return c(t.valueOf(),n,i)}if(Array.isArray(t))return c(t,n,i)}function c(r,e,t){if(e>=r.length)throw new Error("k out of bounds");for(var n=0;n<r.length;n++)if(o(r[n])&&u(r[n]))return r[n];for(var i=0,a=r.length-1;i<a;){for(var s=i,f=a,c=r[Math.floor(Math.random()*(a-i+1))+i];s<f;)if(t(r[s],c)>=0){var l=r[f];r[f]=r[s],r[s]=l,--f}else++s;t(r[s],c)>0&&--s,e<=s?a=s:i=s+1}return r[e]}}exports.name="partitionSelect",exports.factory=e;
},{"../../utils/number":"uqMu","../utils/isNumeric":"Rv38","../utils/isNaN":"AHex","../relational/compare":"yGce"}],"BrQj":[function(require,module,exports) {
"use strict";var r=require("../../utils/array");function e(e,t,a,i){var n=a(require("../../type/matrix/function/matrix")),o=a(require("../utils/isInteger")),s=i("reshape",{"Matrix, Array":function(e,t){return e.reshape?e.reshape(t):n(r.reshape(e.valueOf(),t))},"Array, Array":function(e,t){return t.forEach(function(r){if(!o(r))throw new TypeError("Invalid size for dimension: "+r)}),r.reshape(e,t)}});return s.toTex=void 0,s}exports.name="reshape",exports.factory=e;
},{"../../utils/array":"j2lF","../../type/matrix/function/matrix":"vzj5","../utils/isInteger":"qG7X"}],"pwUu":[function(require,module,exports) {
"use strict";var r=require("../../error/DimensionError"),e=require("../../error/ArgumentsError"),t=require("../../utils/number").isInteger,i=require("../../utils/string").format,n=require("../../utils/object").clone,u=require("../../utils/array");function s(s,o,a,f){var l=a(require("../../type/matrix/function/matrix")),g=function(a,f,g){if(2!==arguments.length&&3!==arguments.length)throw new e("resize",arguments.length,2,3);if(s.isMatrix(f)&&(f=f.valueOf()),s.isBigNumber(f[0])&&(f=f.map(function(r){return s.isBigNumber(r)?r.toNumber():r})),s.isMatrix(a))return a.resize(f,g,!0);if("string"==typeof a)return function(e,n,u){if(void 0!==u){if("string"!=typeof u||1!==u.length)throw new TypeError("Single character expected as defaultValue")}else u=" ";if(1!==n.length)throw new r(n.length,1);var s=n[0];if("number"!=typeof s||!t(s))throw new TypeError("Invalid size, must contain positive integers (size: "+i(n)+")");if(e.length>s)return e.substring(0,s);if(e.length<s){for(var o=e,a=0,f=s-e.length;a<f;a++)o+=u;return o}return e}(a,f,g);var h=!Array.isArray(a)&&"Array"!==o.matrix;if(0===f.length){for(;Array.isArray(a);)a=a[0];return n(a)}Array.isArray(a)||(a=[a]),a=n(a);var y=u.resize(a,f,g);return h?l(y):y};return g.toTex=void 0,g}exports.name="resize",exports.factory=s;
},{"../../error/DimensionError":"YiAw","../../error/ArgumentsError":"h0xI","../../utils/number":"uqMu","../../utils/string":"PshC","../../utils/object":"FcSp","../../utils/array":"j2lF","../../type/matrix/function/matrix":"vzj5"}],"eLyh":[function(require,module,exports) {
"use strict";var r=require("../../utils/object").clone,e=require("../../utils/array").validateIndex;function t(t,i,n,u){var a=n(require("../../type/matrix/MatrixIndex")),o=n(require("../../type/matrix/function/matrix")),s=n(require("./range")),x=u("row",{"Matrix, number":c,"Array, number":function(e,t){return c(o(r(e)),t).valueOf()}});return x.toTex=void 0,x;function c(r,t){if(2!==r.size().length)throw new Error("Only two dimensional matrix is supported");e(t,r.size()[0]);var i=s(0,r.size()[1]),n=new a(t,i);return r.subset(n)}}exports.name="row",exports.factory=t;
},{"../../utils/object":"FcSp","../../utils/array":"j2lF","../../type/matrix/MatrixIndex":"SL3U","../../type/matrix/function/matrix":"vzj5","./range":"lueR"}],"OqDc":[function(require,module,exports) {
"use strict";var r=require("../../utils/array");function t(t,e,i,n){var u=i(require("../../type/matrix/function/matrix")),a=n("size",{Matrix:function(r){return u(r.size())},Array:r.size,string:function(r){return"Array"===e.matrix?[r.length]:u([r.length])},"number | Complex | BigNumber | Unit | boolean | null":function(r){return"Array"===e.matrix?[]:u([])}});return a.toTex=void 0,a}exports.name="size",exports.factory=t;
},{"../../utils/array":"j2lF","../../type/matrix/function/matrix":"vzj5"}],"Z01J":[function(require,module,exports) {
module.exports=function e(a,r){"use strict";var t,i,n=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,p=/(^[ ]*|[ ]*$)/g,l=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=/^0x[0-9a-f]+$/i,s=/^0/,d=function(a){return e.insensitive&&(""+a).toLowerCase()||""+a},f=d(a).replace(p,"")||"",u=d(r).replace(p,"")||"",o=f.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=u.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=parseInt(f.match(c),16)||1!==o.length&&f.match(l)&&Date.parse(f),w=parseInt(u.match(c),16)||m&&u.match(l)&&Date.parse(u)||null;if(w){if(m<w)return-1;if(m>w)return 1}for(var $=0,N=Math.max(o.length,h.length);$<N;$++){if(t=!(o[$]||"").match(s)&&parseFloat(o[$])||o[$]||0,i=!(h[$]||"").match(s)&&parseFloat(h[$])||h[$]||0,isNaN(t)!==isNaN(i))return isNaN(t)?1:-1;if(typeof t!=typeof i&&(t+="",i+=""),t<i)return-1;if(t>i)return 1}return 0};
},{}],"ljuJ":[function(require,module,exports) {
"use strict";var r=require("javascript-natural-sort");function t(t,n,i,a){var u=i(require("../utils/typeof")),o=i(require("./compare")),f=o.signatures["boolean,boolean"],s=a("compareNatural",{"any, any":function(n,i){var a,c=u(n),m=u(i);if(!("number"!==c&&"BigNumber"!==c&&"Fraction"!==c||"number"!==m&&"BigNumber"!==m&&"Fraction"!==m))return"0"!==(a=o(n,i)).toString()?a>0?1:-1:r(c,m);if("Array"===c||"Matrix"===c||"Array"===m||"Matrix"===m)return 0!==(a=function r(e,n){if(t.isSparseMatrix(e)&&t.isSparseMatrix(n))return l(e.toJSON().values,n.toJSON().values);if(t.isSparseMatrix(e))return r(e.toArray(),n);if(t.isSparseMatrix(n))return r(e,n.toArray());if(t.isDenseMatrix(e))return r(e.toJSON().data,n);if(t.isDenseMatrix(n))return r(e,n.toJSON().data);if(!Array.isArray(e))return r([e],n);if(!Array.isArray(n))return r(e,[n]);return l(e,n)}(n,i))?a:r(c,m);if(c!==m)return r(c,m);if("Complex"===c)return e(n,i);if("Unit"===c)return n.equalBase(i)?s(n.value,i.value):l(n.formatUnits(),i.formatUnits());if("boolean"===c)return f(n,i);if("string"===c)return r(n,i);if("Object"===c)return function(t,e){var n=Object.keys(t),i=Object.keys(e);n.sort(r),i.sort(r);var a=l(n,i);if(0!==a)return a;for(var u=0;u<n.length;u++){var o=s(t[n[u]],e[i[u]]);if(0!==o)return o}return 0}(n,i);if("null"===c)return 0;if("undefined"===c)return 0;throw new TypeError('Unsupported type of value "'+c+'"')}});function l(r,t){for(var e=0,n=Math.min(r.length,t.length);e<n;e++){var i=s(r[e],t[e]);if(0!==i)return i}return r.length>t.length?1:r.length<t.length?-1:0}return s.toTex=void 0,s}function e(r,t){return r.re>t.re?1:r.re<t.re?-1:r.im>t.im?1:r.im<t.im?-1:0}exports.name="compareNatural",exports.factory=t;
},{"javascript-natural-sort":"Z01J","../utils/typeof":"LZTG","./compare":"yGce"}],"roN2":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").size;function t(t,n,e,o){var i=e(require("../../type/matrix/function/matrix")),a=e(require("../relational/compare")),u=function(r,t){return-a(r,t)},s=e(require("../relational/compareNatural")),c=o("sort",{Array:function(r){return l(r),r.sort(a)},Matrix:function(r){return x(r),i(r.toArray().sort(a),r.storage())},"Array, function":function(r,t){return l(r),r.sort(t)},"Matrix, function":function(r,t){return x(r),i(r.toArray().sort(t),r.storage())},"Array, string":function(r,t){return l(r),r.sort(f(t))},"Matrix, string":function(r,t){return x(r),i(r.toArray().sort(f(t)),r.storage())}});function f(r){if("asc"===r)return a;if("desc"===r)return u;if("natural"===r)return s;throw new Error('String "asc", "desc", or "natural" expected')}function l(t){if(1!==r(t).length)throw new Error("One dimensional array expected")}function x(r){if(1!==r.size().length)throw new Error("One dimensional matrix expected")}return c.toTex=void 0,c}exports.name="sort",exports.factory=t;
},{"../../utils/array":"j2lF","../../type/matrix/function/matrix":"vzj5","../relational/compare":"yGce","../relational/compareNatural":"ljuJ"}],"Uh7d":[function(require,module,exports) {
"use strict";var r=require("./isMatrix");module.exports=function a(e,i){r(e)&&(e=e.valueOf());for(var t=0,s=e.length;t<s;t++){var u=e[t];Array.isArray(u)?a(u,i):i(u)}};
},{"./isMatrix":"gfmG"}],"tjrJ":[function(require,module,exports) {
"use strict";var r=require("../array").size,e=require("../collection/isMatrix"),t=require("../../error/IndexError");function n(r,e,t){var u,o,a,f;if(e<=0){if(Array.isArray(r[0])){for(f=i(r),o=[],u=0;u<f.length;u++)o[u]=n(f[u],e-1,t);return o}for(a=r[0],u=1;u<r.length;u++)a=t(a,r[u]);return a}for(o=[],u=0;u<r.length;u++)o[u]=n(r[u],e-1,t);return o}function i(r){var e,t,n=r.length,i=r[0].length,u=[];for(t=0;t<i;t++){var o=[];for(e=0;e<n;e++)o.push(r[e][t]);u.push(o)}return u}module.exports=function(i,u,o){var a=Array.isArray(i)?r(i):i.size();if(u<0||u>=a.length)throw new t(u,a.length);return e(i)?i.create(n(i.valueOf(),u,o)):n(i,u,o)};
},{"../array":"j2lF","../collection/isMatrix":"gfmG","../../error/IndexError":"tfOV"}],"m4c0":[function(require,module,exports) {
"use strict";var r=require("./isMatrix");module.exports=function(e){return Array.isArray(e)||r(e)};
},{"./isMatrix":"gfmG"}],"UGDC":[function(require,module,exports) {
"use strict";var r=require("./isCollection");module.exports=function(e){for(var t=0;t<e.length;t++)if(r(e[t]))return!0;return!1};
},{"./isCollection":"m4c0"}],"lOhJ":[function(require,module,exports) {
"use strict";function e(e,t,n,r){var a=n(require("../../utils/typeof"));return function(e,t,n){var r;return-1!==String(e).indexOf("Unexpected type")?(r=arguments.length>2?" (type: "+a(n)+", value: "+JSON.stringify(n)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+r)):-1!==String(e).indexOf("complex numbers")?(r=arguments.length>2?" (type: "+a(n)+", value: "+JSON.stringify(n)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+r)):e}}exports.factory=e;
},{"../../utils/typeof":"LZTG"}],"US8O":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepForEach"),e=require("../../utils/collection/reduce"),t=require("../../utils/collection/containsCollections");function a(a,n,o,i){var u=o(require("../relational/larger")),c=o(require("./utils/improveErrorMessage")),l=i("max",{"Array | Matrix":f,"Array | Matrix, number | BigNumber":function(r,t){return e(r,t.valueOf(),s)},"...":function(r){if(t(r))throw new TypeError("Scalar values expected in function max");return f(r)}});return l.toTex="\\max\\left(${args}\\right)",l;function s(r,e){try{return u(r,e)?r:e}catch(t){throw c(t,"max",e)}}function f(e){var t;if(r(e,function(r){try{isNaN(r)&&"number"==typeof r?t=NaN:(void 0===t||u(r,t))&&(t=r)}catch(e){throw c(e,"max",r)}}),void 0===t)throw new Error("Cannot calculate max of an empty array");return t}}exports.name="max",exports.factory=a;
},{"../../utils/collection/deepForEach":"Uh7d","../../utils/collection/reduce":"tjrJ","../../utils/collection/containsCollections":"UGDC","../relational/larger":"SrDl","./utils/improveErrorMessage":"lOhJ"}],"yVQR":[function(require,module,exports) {
"use strict";var r=require("../../utils/array"),e=require("../../utils/latex"),t=require("../../utils/string");function i(i,a,s,u){var o=s(require("../arithmetic/abs")),n=s(require("../arithmetic/add")),c=s(require("../arithmetic/multiply")),m=s(require("../arithmetic/sqrt")),q=s(require("../arithmetic/subtract")),h=s(require("../matrix/inv")),x=s(require("../matrix/size")),f=s(require("../statistics/max")),l=s(require("./identity")),w=u("sqrtm",{"Array | Matrix":function(e){var a=i.isMatrix(e)?e.size():r.size(e);switch(a.length){case 1:if(1===a[0])return m(e);throw new RangeError("Matrix must be square (size: "+t.format(a)+")");case 2:if(a[0]===a[1])return d(e);throw new RangeError("Matrix must be square (size: "+t.format(a)+")")}}}),v=1e3,g=1e-6;function d(r){var e,t=0,i=r,a=l(x(r));do{var s=i;if(i=c(.5,n(s,h(a))),a=c(.5,n(a,h(s))),(e=f(o(q(i,s))))>g&&++t>v)throw new Error("computing square root of matrix: iterative method could not converge")}while(e>g);return i}return w.toTex={1:"{${args[0]}}".concat(e.operators.pow,"{\\frac{1}{2}}")},w}exports.name="sqrtm",exports.factory=i;
},{"../../utils/array":"j2lF","../../utils/latex":"H1Mr","../../utils/string":"PshC","../arithmetic/abs":"K5X1","../arithmetic/add":"zf2Z","../arithmetic/multiply":"k7By","../arithmetic/sqrt":"T6pB","../arithmetic/subtract":"m78R","../matrix/inv":"yHuZ","../matrix/size":"OqDc","../statistics/max":"US8O","./identity":"zJUT"}],"c5o7":[function(require,module,exports) {
"use strict";var r=require("../../utils/object"),e=require("../../utils/array");function t(t,u,n,i){var a=n(require("../../type/matrix/function/matrix")),o=i("squeeze",{Array:function(t){return e.squeeze(r.clone(t))},Matrix:function(r){var t=e.squeeze(r.toArray());return Array.isArray(t)?a(t):t},any:function(e){return r.clone(e)}});return o.toTex=void 0,o}exports.name="squeeze",exports.factory=t;
},{"../../utils/object":"FcSp","../../utils/array":"j2lF","../../type/matrix/function/matrix":"vzj5"}],"YmDd":[function(require,module,exports) {
"use strict";var r=require("../../utils/object").clone,e=require("../../utils/string").format;function t(t,a,i,n){var s=i(require("../../type/matrix/function/matrix")),u=i(require("../arithmetic/add")),o=n("trace",{Array:function(r){return f(s(r))},SparseMatrix:function(r){var t=r._values,a=r._index,i=r._ptr,n=r._size,s=n[0],o=n[1];if(s===o){var f=0;if(t.length>0)for(var c=0;c<o;c++)for(var m=i[c],x=i[c+1],v=m;v<x;v++){var h=a[v];if(h===c){f=u(f,t[v]);break}if(h>c)break}return f}throw new RangeError("Matrix must be square (size: "+e(n)+")")},DenseMatrix:f,any:r});function f(t){var a=t._size,i=t._data;switch(a.length){case 1:if(1===a[0])return r(i[0]);throw new RangeError("Matrix must be square (size: "+e(a)+")");case 2:var n=a[0];if(n===a[1]){for(var s=0,o=0;o<n;o++)s=u(s,i[o][o]);return s}throw new RangeError("Matrix must be square (size: "+e(a)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+e(a)+")")}}return o.toTex={1:"\\mathrm{tr}\\left(${args[0]}\\right)"},o}exports.name="trace",exports.factory=t;
},{"../../utils/object":"FcSp","../../utils/string":"PshC","../../type/matrix/function/matrix":"vzj5","../arithmetic/add":"zf2Z"}],"CPKp":[function(require,module,exports) {
"use strict";function t(t,r,e,a){var i=e(require("../../type/matrix/utils/getArrayDataType"));return a("getMatrixDataType",{Array:function(t){return i(t)},Matrix:function(t){return t.getDataType()}})}exports.name="getMatrixDataType",exports.factory=t;
},{"../../type/matrix/utils/getArrayDataType":"XmtI"}],"X3kh":[function(require,module,exports) {
"use strict";module.exports=[require("./apply"),require("./column"),require("./concat"),require("./cross"),require("./ctranspose"),require("./det"),require("./diag"),require("./dot"),require("./eye"),require("./expm"),require("./filter"),require("./flatten"),require("./forEach"),require("./identity"),require("./inv"),require("./kron"),require("./map"),require("./ones"),require("./partitionSelect"),require("./range"),require("./reshape"),require("./resize"),require("./row"),require("./size"),require("./sort"),require("./sqrtm"),require("./squeeze"),require("./subset"),require("./trace"),require("./transpose"),require("./zeros"),require("./getMatrixDataType")];
},{"./apply":"f9k3","./column":"g7VB","./concat":"LXdZ","./cross":"GWq7","./ctranspose":"pnEY","./det":"KApf","./diag":"JNTV","./dot":"unxK","./eye":"pW27","./expm":"XFhy","./filter":"QC1r","./flatten":"KNrk","./forEach":"dOnH","./identity":"zJUT","./inv":"yHuZ","./kron":"g4K8","./map":"dcuN","./ones":"dmcR","./partitionSelect":"kE3o","./range":"lueR","./reshape":"BrQj","./resize":"pwUu","./row":"eLyh","./size":"OqDc","./sort":"roN2","./sqrtm":"yVQR","./squeeze":"c5o7","./subset":"ZWbZ","./trace":"YmDd","./transpose":"C2z0","./zeros":"BAjv","./getMatrixDataType":"CPKp"}],"y9hQ":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepForEach"),e=require("../../utils/collection/reduce"),t=require("../../utils/collection/containsCollections");function i(i,u,n,c){var o=n(require("../arithmetic/addScalar")),a=n(require("./utils/improveErrorMessage")),s=c("sum",{"Array | Matrix":l,"Array | Matrix, number | BigNumber":function(r,t){try{var i=e(r,t,o);return i}catch(u){throw a(u,"sum")}},"...":function(r){if(t(r))throw new TypeError("Scalar values expected in function sum");return l(r)}});return s.toTex=void 0,s;function l(e){var t;if(r(e,function(r){try{t=void 0===t?r:o(t,r)}catch(e){throw a(e,"sum",r)}}),void 0===t)switch(u.number){case"number":return 0;case"BigNumber":return new i.BigNumber(0);case"Fraction":return new i.Fraction(0);default:return 0}return t}}exports.name="sum",exports.factory=i;
},{"../../utils/collection/deepForEach":"Uh7d","../../utils/collection/reduce":"tjrJ","../../utils/collection/containsCollections":"UGDC","../arithmetic/addScalar":"ZM3O","./utils/improveErrorMessage":"lOhJ"}],"CGIk":[function(require,module,exports) {
"use strict";function r(r,e,t,i){var n=t(require("../../type/matrix/function/matrix")),o=t(require("../arithmetic/divide")),u=t(require("../statistics/sum")),s=t(require("../arithmetic/multiply")),a=t(require("../arithmetic/dotDivide")),c=t(require("../arithmetic/log")),m=t(require("../utils/isNumeric"));function f(r,e){var t=e.size().length,i=r.size().length;if(t>1)throw new Error("first object must be one dimensional");if(i>1)throw new Error("second object must be one dimensional");if(t!==i)throw new Error("Length of two vectors must be equal");if(0===u(r))throw new Error("Sum of elements in first object must be non zero");if(0===u(e))throw new Error("Sum of elements in second object must be non zero");var n=o(r,u(r)),f=o(e,u(e)),l=u(s(n,c(a(n,f))));return m(l)?l:Number.NaN}return i("kldivergence",{"Array, Array":function(r,e){return f(n(r),n(e))},"Matrix, Array":function(r,e){return f(r,n(e))},"Array, Matrix":function(r,e){return f(n(r),e)},"Matrix, Matrix":function(r,e){return f(r,e)}})}exports.name="kldivergence",exports.factory=r;
},{"../../type/matrix/function/matrix":"vzj5","../arithmetic/divide":"lVgQ","../statistics/sum":"y9hQ","../arithmetic/multiply":"k7By","../arithmetic/dotDivide":"JrX5","../arithmetic/log":"T05K","../utils/isNumeric":"Rv38"}],"kuKA":[function(require,module,exports) {
"use strict";var i=require("../../utils/collection/deepForEach");function r(r,e,t,u){var a=t(require("../arithmetic/add")),n=t(require("../arithmetic/multiply")),o=t(require("../arithmetic/divide")),l=t(require("../probability/factorial")),c=t(require("../utils/isInteger")),m=t(require("../utils/isPositive"));return u("multinomial",{"Array | Matrix":function(r){var e=0,t=1;return i(r,function(i){if(!c(i)||!m(i))throw new TypeError("Positive integer value expected in function multinomial");e=a(e,i),t=n(t,l(i))}),o(l(e),t)}})}exports.name="multinomial",exports.factory=r;
},{"../../utils/collection/deepForEach":"Uh7d","../arithmetic/add":"zf2Z","../arithmetic/multiply":"k7By","../arithmetic/divide":"lVgQ","../probability/factorial":"yidz","../utils/isInteger":"qG7X","../utils/isPositive":"OFKG"}],"IUt2":[function(require,module,exports) {
"use strict";var e=require("../../utils/number").isInteger;function r(r,n,i,u){var o=i(require("./factorial")),s=require("./product"),a=u("permutations",{"number | BigNumber":o,"number, number":function(r,t){if(!e(r)||r<0)throw new TypeError("Positive integer value expected in function permutations");if(!e(t)||t<0)throw new TypeError("Positive integer value expected in function permutations");if(t>r)throw new TypeError("second argument k must be less than or equal to first argument n");return s(r-t+1,r)},"BigNumber, BigNumber":function(e,n){var i,u;if(!t(e)||!t(n))throw new TypeError("Positive integer value expected in function permutations");if(n.gt(e))throw new TypeError("second argument k must be less than or equal to first argument n");for(i=new r.BigNumber(1),u=e.minus(n).plus(1);u.lte(e);u=u.plus(1))i=i.times(u);return i}});return a.toTex=void 0,a}function t(e){return e.isInteger()&&e.gte(0)}exports.name="permutations",exports.factory=r;
},{"../../utils/number":"uqMu","./factorial":"yidz","./product":"FONy"}],"JPVl":[function(require,module,exports) {
var global = arguments[3];
var r=arguments[3],n=256,t=6,o=52,a=[],e=void 0===r?window:r,u=Math.pow(n,t),i=Math.pow(2,o),f=2*i,l=n-1,c=Math.random;function h(r){var t,o=r.length,a=this,e=0,u=a.i=a.j=0,i=a.S=[];for(o||(r=[o++]);e<n;)i[e]=e++;for(e=0;e<n;e++)i[e]=i[u=l&u+r[e%o]+(t=i[e])],i[u]=t;(a.g=function(r){for(var t,o=0,e=a.i,u=a.j,i=a.S;r--;)t=i[e=l&e+1],o=o*n+i[l&(i[e]=i[u=l&u+t])+(i[u]=t)];return a.i=e,a.j=u,o})(n)}function g(r,n){var t,o=[],a=(typeof r)[0];if(n&&"o"==a)for(t in r)try{o.push(g(r[t],n-1))}catch(e){}return o.length?o:"s"==a?r:r+"\0"}function d(r,n){for(var t,o=r+"",a=0;a<o.length;)n[l&a]=l&(t^=19*n[l&a])+o.charCodeAt(a++);return m(n)}function p(r){try{return e.crypto.getRandomValues(r=new Uint8Array(n)),m(r)}catch(t){return[+new Date,e,e.navigator&&e.navigator.plugins,e.screen,m(a)]}}function m(r){return String.fromCharCode.apply(0,r)}module.exports=function(r,o){if(o&&!0===o.global)return o.global=!1,Math.random=module.exports(r,o),o.global=!0,Math.random;var e=[],l=(d(g(o&&o.entropy||!1?[r,m(a)]:0 in arguments?r:p(),3),e),new h(e));return d(m(l.S),a),function(){for(var r=l.g(t),o=u,a=0;r<i;)r=(r+a)*n,o*=n,a=l.g(1);for(;r>=f;)r/=2,o/=2,a>>>=1;return(r+a)/o}},module.exports.resetGlobal=function(){Math.random=c},d(Math.random(),a);
},{}],"qBYF":[function(require,module,exports) {
"use strict";var n=require("seed-random"),r=n();function e(e,o,t,d,i){var u;function a(e){u=null===e?r:n(String(e))}return a(o.randomSeed),i.on("config",function(n,r,e){void 0!==e.randomSeed&&a(n.randomSeed)}),function(){return u()}}exports.factory=e,exports.math=!0;
},{"seed-random":"JPVl"}],"pAyZ":[function(require,module,exports) {
"use strict";var r=require("../../error/ArgumentsError"),n=require("../../utils/collection/isCollection"),e=require("../../utils/number").isNumber;function t(t,i,o,a,u){var f=o(require("../../type/matrix/function/matrix")),s=require("../../utils/array"),l=o(require("./seededRNG"));function v(i){if(!h.hasOwnProperty(i))throw new Error("Unknown distribution "+i);var o=Array.prototype.slice.call(arguments,1);return function(i){function o(r,n,i){var o=void 0===n;if(o&&(n=1),t.isMatrix(r))r=r.valueOf();else if(!Array.isArray(r))throw new TypeError("Unsupported type of value in function pickRandom");if(s.size(r).length>1)throw new Error("Only one dimensional vectors supported");var a=0;if(void 0!==i){if(i.length!==r.length)throw new Error("Weights must have the same length as possibles");for(var u=0,f=i.length;u<f;u++){if(!e(i[u])||i[u]<0)throw new Error("Weights must be an array of positive numbers");a+=i[u]}}var v=r.length;if(0===v)return[];if(n>=v)return n>1?r:r[0];for(var h,c=[];c.length<n;){if(void 0===i)h=r[Math.floor(l()*v)];else for(var m=l()*a,y=0,d=r.length;y<d;y++)if((m-=i[y])<0){h=r[y];break}-1===c.indexOf(h)&&c.push(h)}return o?c[0]:c}function u(r,n){return r+i()*(n-r)}function v(r,n){return Math.floor(r+i()*(n-r))}function h(r,n,e,t){var i=[];if((r=r.slice(0)).length>1)for(var o=0,a=r.shift();o<a;o++)i.push(h(r,n,e,t));else for(var u=0,f=r.shift();u<f;u++)i.push(t(n,e));return i}return{random:function(i,o,a){var s,l,v;if(arguments.length>3)throw new r("random",arguments.length,0,3);if(1===arguments.length?n(i)?s=i:v=i:2===arguments.length?n(i)?(s=i,v=o):(l=i,v=o):(s=i,l=o,v=a),void 0!==l&&!e(l)||void 0!==v&&!e(v))throw new TypeError("Invalid argument in function random");if(void 0===v&&(v=1),void 0===l&&(l=0),void 0!==s){var c=h(s.valueOf(),l,v,u);return t.isMatrix(s)?f(c):c}return u(l,v)},randomInt:a({"number | Array":function(r){if(n(r)){var e=r,i=h(e.valueOf(),0,1,v);return t.isMatrix(e)?f(i):i}return v(0,r)},"number | Array, number":function(r,e){if(n(r)){var i=r,o=e,a=h(i.valueOf(),0,o,v);return t.isMatrix(i)?f(a):a}return v(r,e)},"Array, number, number":function(r,n,e){var t=h(r.valueOf(),n,e,v);return r&&!0===r.isMatrix?f(t):t}}),pickRandom:a({Array:function(r){return o(r)},"Array, number | Array":function(r,n){var t,i;if(Array.isArray(n))i=n;else{if(!e(n))throw new TypeError("Invalid argument in function pickRandom");t=n}return o(r,t,i)},"Array, number | Array, Array | number":function(r,n,t){var i,a;if(Array.isArray(n)?(a=n,i=t):(a=t,i=n),!Array.isArray(a)||!e(i))throw new TypeError("Invalid argument in function pickRandom");return o(r,i,a)}})}}(h[i].apply(this,o))}var h={uniform:function(){return l},normal:function(){return function(){for(var r,n,e=-1;e<0||e>1;)r=l(),n=l(),e=1/6*Math.pow(-2*Math.log(r),.5)*Math.cos(2*Math.PI*n)+.5;return e}}};return v.toTex=void 0,v}exports.name="distribution",exports.factory=t;
},{"../../error/ArgumentsError":"h0xI","../../utils/collection/isCollection":"m4c0","../../utils/number":"uqMu","../../type/matrix/function/matrix":"vzj5","../../utils/array":"j2lF","./seededRNG":"qBYF"}],"JMJP":[function(require,module,exports) {
"use strict";function r(r,i,o,t){var e=o(require("./distribution"))("uniform").pickRandom;return e.toTex=void 0,e}exports.name="pickRandom",exports.factory=r;
},{"./distribution":"pAyZ"}],"YT9V":[function(require,module,exports) {
"use strict";function r(r,o,t,e){var i=t(require("./distribution"))("uniform").random;return i.toTex=void 0,i}exports.name="random",exports.factory=r;
},{"./distribution":"pAyZ"}],"Zogd":[function(require,module,exports) {
"use strict";function r(r,t,n,o){var e=n(require("./distribution"))("uniform").randomInt;return e.toTex=void 0,e}exports.name="randomInt",exports.factory=r;
},{"./distribution":"pAyZ"}],"xCRU":[function(require,module,exports) {
"use strict";module.exports=[require("./combinations"),require("./factorial"),require("./gamma"),require("./kldivergence"),require("./multinomial"),require("./permutations"),require("./pickRandom"),require("./random"),require("./randomInt")];
},{"./combinations":"n9b2","./factorial":"yidz","./gamma":"ciea","./kldivergence":"CGIk","./multinomial":"kuKA","./permutations":"IUt2","./pickRandom":"JMJP","./random":"YT9V","./randomInt":"Zogd"}],"eVLO":[function(require,module,exports) {
"use strict";function r(r,t,e,n){var i=e(require("../../type/matrix/function/matrix")),a=e(require("../utils/typeof")),u=e(require("../../type/matrix/utils/algorithm13")),o=e(require("../../type/matrix/utils/algorithm14")),c=n("compareText",{"any, any":x,"DenseMatrix, DenseMatrix":function(r,t){return u(r,t,x)},"Array, Array":function(r,t){return c(i(r),i(t)).valueOf()},"Array, Matrix":function(r,t){return c(i(r),t)},"Matrix, Array":function(r,t){return c(r,i(t))},"DenseMatrix, any":function(r,t){return o(r,t,x,!1)},"any, DenseMatrix":function(r,t){return o(t,r,x,!0)},"Array, any":function(r,t){return o(i(r),t,x,!1).valueOf()},"any, Array":function(r,t){return o(i(t),r,x,!0).valueOf()}});function x(t,e){if(!r.isString(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+a(t)+", index: 0)");if(!r.isString(e))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+a(e)+", index: 1)");return t===e?0:t>e?1:-1}return c.toTex=void 0,c}exports.name="compareText",exports.factory=r;
},{"../../type/matrix/function/matrix":"vzj5","../utils/typeof":"LZTG","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"qExK":[function(require,module,exports) {
"use strict";function r(r,e,a,n){var t=a(require("./equal")),u=n("deepEqual",{"any, any":function(r,e){return function r(e,a){if(Array.isArray(e)){if(Array.isArray(a)){var n=e.length;if(n!==a.length)return!1;for(var u=0;u<n;u++)if(!r(e[u],a[u]))return!1;return!0}return!1}return!Array.isArray(a)&&t(e,a)}(r.valueOf(),e.valueOf())}});return u.toTex=void 0,u}exports.name="deepEqual",exports.factory=r;
},{"./equal":"IviB"}],"c7Nt":[function(require,module,exports) {
"use strict";function e(e,r,t,u){var n=t(require("./compareText")),o=t(require("../utils/isZero")),a=u("equalText",{"any, any":function(e,r){return o(n(e,r))}});return a.toTex=void 0,a}exports.name="equalText",exports.factory=e;
},{"./compareText":"eVLO","../utils/isZero":"geyZ"}],"IR2w":[function(require,module,exports) {
"use strict";module.exports=[require("./compare"),require("./compareNatural"),require("./compareText"),require("./deepEqual"),require("./equal"),require("./equalText"),require("./larger"),require("./largerEq"),require("./smaller"),require("./smallerEq"),require("./unequal")];
},{"./compare":"yGce","./compareNatural":"ljuJ","./compareText":"eVLO","./deepEqual":"qExK","./equal":"IviB","./equalText":"c7Nt","./larger":"SrDl","./largerEq":"d923","./smaller":"Q7ag","./smallerEq":"rN68","./unequal":"npE3"}],"UZAG":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").flatten;function a(a,e,t,i){var s=t(require("../../type/matrix/MatrixIndex")),n=t(require("../../type/matrix/DenseMatrix")),y=t(require("../matrix/size")),u=t(require("../matrix/subset")),o=t(require("../relational/compareNatural"));return i("setCartesian",{"Array | Matrix, Array | Matrix":function(a,e){var t=[];if(0!==u(y(a),new s(0))&&0!==u(y(e),new s(0))){var i=r(Array.isArray(a)?a:a.toArray()).sort(o),A=r(Array.isArray(e)?e:e.toArray()).sort(o);t=[];for(var x=0;x<i.length;x++)for(var f=0;f<A.length;f++)t.push([i[x],A[f]])}return Array.isArray(a)&&Array.isArray(e)?t:new n(t)}})}exports.name="setCartesian",exports.factory=a;
},{"../../utils/array":"j2lF","../../type/matrix/MatrixIndex":"SL3U","../../type/matrix/DenseMatrix":"bZ8L","../matrix/size":"OqDc","../matrix/subset":"ZWbZ","../relational/compareNatural":"ljuJ"}],"wktc":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").flatten,e=require("../../utils/array").identify,a=require("../../utils/array").generalize;function i(i,t,n,u){var s=n(require("../../type/matrix/MatrixIndex")),y=n(require("../../type/matrix/DenseMatrix")),f=n(require("../matrix/size")),o=n(require("../matrix/subset")),l=n(require("../relational/compareNatural"));return u("setDifference",{"Array | Matrix, Array | Matrix":function(i,t){var n;if(0===o(f(i),new s(0)))n=[];else{if(0===o(f(t),new s(0)))return r(i.toArray());var u,A=e(r(Array.isArray(i)?i:i.toArray()).sort(l)),x=e(r(Array.isArray(t)?t:t.toArray()).sort(l));n=[];for(var q=0;q<A.length;q++){u=!1;for(var v=0;v<x.length;v++)if(0===l(A[q].value,x[v].value)&&A[q].identifier===x[v].identifier){u=!0;break}u||n.push(A[q])}}return Array.isArray(i)&&Array.isArray(t)?a(n):new y(a(n))}})}exports.name="setDifference",exports.factory=i;
},{"../../utils/array":"j2lF","../../type/matrix/MatrixIndex":"SL3U","../../type/matrix/DenseMatrix":"bZ8L","../matrix/size":"OqDc","../matrix/subset":"ZWbZ","../relational/compareNatural":"ljuJ"}],"mVYy":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").flatten;function e(e,t,a,i){var s=a(require("../../type/matrix/MatrixIndex")),n=a(require("../../type/matrix/DenseMatrix")),u=a(require("../matrix/size")),o=a(require("../matrix/subset")),x=a(require("../relational/compareNatural"));return i("setDistinct",{"Array | Matrix":function(e){var t;if(0===o(u(e),new s(0)))t=[];else{var a=r(Array.isArray(e)?e:e.toArray()).sort(x);(t=[]).push(a[0]);for(var i=1;i<a.length;i++)0!==x(a[i],a[i-1])&&t.push(a[i])}return Array.isArray(e)?t:new n(t)}})}exports.name="setDistinct",exports.factory=e;
},{"../../utils/array":"j2lF","../../type/matrix/MatrixIndex":"SL3U","../../type/matrix/DenseMatrix":"bZ8L","../matrix/size":"OqDc","../matrix/subset":"ZWbZ","../relational/compareNatural":"ljuJ"}],"XVUf":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").flatten,e=require("../../utils/array").identify,a=require("../../utils/array").generalize;function t(t,i,s,n){var u=s(require("../../type/matrix/MatrixIndex")),y=s(require("../../type/matrix/DenseMatrix")),l=s(require("../matrix/size")),o=s(require("../matrix/subset")),A=s(require("../relational/compareNatural"));return n("setIntersect",{"Array | Matrix, Array | Matrix":function(t,i){var s;if(0===o(l(t),new u(0))||0===o(l(i),new u(0)))s=[];else{var n=e(r(Array.isArray(t)?t:t.toArray()).sort(A)),f=e(r(Array.isArray(i)?i:i.toArray()).sort(A));s=[];for(var x=0;x<n.length;x++)for(var q=0;q<f.length;q++)if(0===A(n[x].value,f[q].value)&&n[x].identifier===f[q].identifier){s.push(n[x]);break}}return Array.isArray(t)&&Array.isArray(i)?a(s):new y(a(s))}})}exports.name="setIntersect",exports.factory=t;
},{"../../utils/array":"j2lF","../../type/matrix/MatrixIndex":"SL3U","../../type/matrix/DenseMatrix":"bZ8L","../matrix/size":"OqDc","../matrix/subset":"ZWbZ","../relational/compareNatural":"ljuJ"}],"EFhD":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").flatten,e=require("../../utils/array").identify;function t(t,a,i,u){var n=i(require("../../type/matrix/MatrixIndex")),s=i(require("../matrix/size")),f=i(require("../matrix/subset")),o=i(require("../relational/compareNatural"));return u("setIsSubset",{"Array | Matrix, Array | Matrix":function(t,a){if(0===f(s(t),new n(0)))return!0;if(0===f(s(a),new n(0)))return!1;for(var i,u=e(r(Array.isArray(t)?t:t.toArray()).sort(o)),y=e(r(Array.isArray(a)?a:a.toArray()).sort(o)),l=0;l<u.length;l++){i=!1;for(var x=0;x<y.length;x++)if(0===o(u[l].value,y[x].value)&&u[l].identifier===y[x].identifier){i=!0;break}if(!1===i)return!1}return!0}})}exports.name="setIsSubset",exports.factory=t;
},{"../../utils/array":"j2lF","../../type/matrix/MatrixIndex":"SL3U","../matrix/size":"OqDc","../matrix/subset":"ZWbZ","../relational/compareNatural":"ljuJ"}],"B2m3":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").flatten;function e(e,t,i,a){var u=i(require("../relational/compareNatural")),n=i(require("../../type/matrix/MatrixIndex")),l=i(require("../matrix/size")),o=i(require("../matrix/subset"));return a("setMultiplicity",{"number | BigNumber | Fraction | Complex, Array | Matrix":function(e,t){if(0===o(l(t),new n(0)))return 0;for(var i=r(Array.isArray(t)?t:t.toArray()),a=0,s=0;s<i.length;s++)0===u(i[s],e)&&a++;return a}})}exports.name="setMultiplicity",exports.factory=e;
},{"../../utils/array":"j2lF","../relational/compareNatural":"ljuJ","../../type/matrix/MatrixIndex":"SL3U","../matrix/size":"OqDc","../matrix/subset":"ZWbZ"}],"RB1b":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").flatten;function t(t,e,n,a){var i=n(require("../../type/matrix/MatrixIndex")),u=n(require("../matrix/size")),o=n(require("../matrix/subset")),s=n(require("../relational/compareNatural"));return a("setPowerset",{"Array | Matrix":function(t){if(0===o(u(t),new i(0)))return[];for(var e=r(Array.isArray(t)?t:t.toArray()).sort(s),n=[],a=0;a.toString(2).length<=e.length;)n.push(l(e,a.toString(2).split("").reverse())),a++;return function(r){for(var t=[],e=r.length-1;e>0;e--)for(var n=0;n<e;n++)r[n].length>r[n+1].length&&(t=r[n],r[n]=r[n+1],r[n+1]=t);return r}(n)}});function l(r,t){for(var e=[],n=0;n<t.length;n++)"1"===t[n]&&e.push(r[n]);return e}}exports.name="setPowerset",exports.factory=t;
},{"../../utils/array":"j2lF","../../type/matrix/MatrixIndex":"SL3U","../matrix/size":"OqDc","../matrix/subset":"ZWbZ","../relational/compareNatural":"ljuJ"}],"St3b":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").flatten;function t(t,a,e,n){var i=e(require("../relational/compareNatural"));return n("setSize",{"Array | Matrix":function(t){return Array.isArray(t)?r(t).length:r(t.toArray()).length},"Array | Matrix, boolean":function(t,a){if(!1===a||0===t.length)return Array.isArray(t)?r(t).length:r(t.toArray()).length;for(var e=r(Array.isArray(t)?t:t.toArray()).sort(i),n=1,o=1;o<e.length;o++)0!==i(e[o],e[o-1])&&n++;return n}})}exports.name="setSize",exports.factory=t;
},{"../../utils/array":"j2lF","../relational/compareNatural":"ljuJ"}],"XYAW":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").flatten;function e(e,t,i,a){var n=i(require("../../type/matrix/MatrixIndex")),u=i(require("../matrix/concat")),f=i(require("../matrix/size")),s=i(require("../matrix/subset")),x=i(require("../set/setDifference"));return a("setSymDifference",{"Array | Matrix, Array | Matrix":function(e,t){if(0===s(f(e),new n(0)))return r(t);if(0===s(f(t),new n(0)))return r(e);var i=r(e),a=r(t);return u(x(i,a),x(a,i))}})}exports.name="setSymDifference",exports.factory=e;
},{"../../utils/array":"j2lF","../../type/matrix/MatrixIndex":"SL3U","../matrix/concat":"LXdZ","../matrix/size":"OqDc","../matrix/subset":"ZWbZ","../set/setDifference":"wktc"}],"LJzh":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").flatten;function e(e,t,i,n){var a=i(require("../../type/matrix/MatrixIndex")),u=i(require("../matrix/concat")),s=i(require("../matrix/size")),x=i(require("../matrix/subset")),c=i(require("../set/setIntersect")),f=i(require("../set/setSymDifference"));return n("setUnion",{"Array | Matrix, Array | Matrix":function(e,t){if(0===x(s(e),new a(0)))return r(t);if(0===x(s(t),new a(0)))return r(e);var i=r(e),n=r(t);return u(f(i,n),c(i,n))}})}exports.name="setUnion",exports.factory=e;
},{"../../utils/array":"j2lF","../../type/matrix/MatrixIndex":"SL3U","../matrix/concat":"LXdZ","../matrix/size":"OqDc","../matrix/subset":"ZWbZ","../set/setIntersect":"XVUf","../set/setSymDifference":"XYAW"}],"O2mj":[function(require,module,exports) {
"use strict";module.exports=[require("./setCartesian"),require("./setDifference"),require("./setDistinct"),require("./setIntersect"),require("./setIsSubset"),require("./setMultiplicity"),require("./setPowerset"),require("./setSize"),require("./setSymDifference"),require("./setUnion")];
},{"./setCartesian":"UZAG","./setDifference":"wktc","./setDistinct":"mVYy","./setIntersect":"XVUf","./setIsSubset":"EFhD","./setMultiplicity":"B2m3","./setPowerset":"RB1b","./setSize":"St3b","./setSymDifference":"XYAW","./setUnion":"LJzh"}],"eibQ":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap"),e=require("../../utils/number").sign;function t(t,f,c,p){var s=p("erf",{number:function(r){var t=Math.abs(r);return t>=o?e(r):t<=n?e(r)*function(r){var e,t=r*r,n=u[0][4]*t,a=t;for(e=0;e<3;e+=1)n=(n+u[0][e])*t,a=(a+i[0][e])*t;return r*(n+u[0][3])/(a+i[0][3])}(t):t<=4?e(r)*(1-function(r){var e,t=u[1][8]*r,n=r;for(e=0;e<7;e+=1)t=(t+u[1][e])*r,n=(n+i[1][e])*r;var a=(t+u[1][7])/(n+i[1][7]),o=parseInt(16*r)/16,f=(r-o)*(r+o);return Math.exp(-o*o)*Math.exp(-f)*a}(t)):e(r)*(1-function(r){var e,t=1/(r*r),n=u[2][5]*t,o=t;for(e=0;e<4;e+=1)n=(n+u[2][e])*t,o=(o+i[2][e])*t;var f=t*(n+u[2][4])/(o+i[2][4]);f=(a-f)/r,t=parseInt(16*r)/16;var c=(r-t)*(r+t);return Math.exp(-t*t)*Math.exp(-c)*f}(t))},BigNumber:function(r){return new t.BigNumber(s(r.toNumber()))},"Array | Matrix":function(e){return r(e,s)}});return s.toTex={1:"erf\\left(${args[0]}\\right)"},s}var n=.46875,a=.5641895835477563,u=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,2.1531153547440383e-8],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],i=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],o=Math.pow(2,53);exports.name="erf",exports.factory=t;
},{"../../utils/collection/deepMap":"lOYo","../../utils/number":"uqMu"}],"JuUL":[function(require,module,exports) {
"use strict";module.exports=[require("./erf")];
},{"./erf":"eibQ"}],"LcS3":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").flatten,e=require("../../utils/collection/containsCollections");function t(t,i,n,a){var o=n(require("../arithmetic/addScalar")),u=n(require("../arithmetic/divideScalar")),c=n(require("../relational/compare")),m=n(require("../matrix/partitionSelect")),l=n(require("./utils/improveErrorMessage")),f=a("median",{"Array | Matrix":d,"Array | Matrix, number | BigNumber":function(r,e){throw new Error("median(A, dim) is not yet supported")},"...":function(r){if(e(r))throw new TypeError("Scalar values expected in function median");return d(r)}});function d(e){try{var t=(e=r(e.valueOf())).length;if(0===t)throw new Error("Cannot calculate median of an empty array");if(t%2==0){for(var i=t/2-1,n=m(e,i+1),a=e[i],o=0;o<i;++o)c(e[o],a)>0&&(a=e[o]);return p(a,n)}var u=m(e,(t-1)/2);return s(u)}catch(f){throw l(f,"median")}}var s=a({"number | BigNumber | Complex | Unit":function(r){return r}}),p=a({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(r,e){return u(o(r,e),2)}});return f.toTex=void 0,f}exports.name="median",exports.factory=t;
},{"../../utils/array":"j2lF","../../utils/collection/containsCollections":"UGDC","../arithmetic/addScalar":"ZM3O","../arithmetic/divideScalar":"R3aq","../relational/compare":"yGce","../matrix/partitionSelect":"kE3o","./utils/improveErrorMessage":"lOhJ"}],"Je7I":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").flatten;function e(e,a,t,i){var n=t(require("../arithmetic/abs")),o=t(require("../matrix/map")),u=t(require("../statistics/median")),s=t(require("../arithmetic/subtract")),m=t(require("./utils/improveErrorMessage")),c=i("mad",{"Array | Matrix":d,"...":function(r){return d(r)}});return c.toTex=void 0,c;function d(e){if(0===(e=r(e.valueOf())).length)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var a=u(e);return u(o(e,function(r){return n(s(r,a))}))}catch(t){throw t instanceof TypeError&&-1!==t.message.indexOf("median")?new TypeError(t.message.replace("median","mad")):m(t,"mad")}}}exports.name="mad",exports.factory=e;
},{"../../utils/array":"j2lF","../arithmetic/abs":"K5X1","../matrix/map":"dcuN","../statistics/median":"LcS3","../arithmetic/subtract":"m78R","./utils/improveErrorMessage":"lOhJ"}],"WyK1":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").size,e=require("../../utils/collection/deepForEach"),t=require("../../utils/collection/reduce"),i=require("../../utils/collection/containsCollections");function a(a,n,o,c){var u=o(require("../arithmetic/add")),l=o(require("../arithmetic/divide")),s=o(require("./utils/improveErrorMessage")),m=c("mean",{"Array | Matrix":y,"Array | Matrix, number | BigNumber":function(e,i){try{var a=t(e,i,u),n=Array.isArray(e)?r(e):e.size();return l(a,n[i])}catch(o){throw s(o,"mean")}},"...":function(r){if(i(r))throw new TypeError("Scalar values expected in function mean");return y(r)}});return m.toTex=void 0,m;function y(r){var t=0,i=0;if(e(r,function(r){try{t=u(t,r),i++}catch(e){throw s(e,"mean",r)}}),0===i)throw new Error("Cannot calculate mean of an empty array");return l(t,i)}}exports.name="mean",exports.factory=a;
},{"../../utils/array":"j2lF","../../utils/collection/deepForEach":"Uh7d","../../utils/collection/reduce":"tjrJ","../../utils/collection/containsCollections":"UGDC","../arithmetic/add":"zf2Z","../arithmetic/divide":"lVgQ","./utils/improveErrorMessage":"lOhJ"}],"VKqc":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepForEach"),e=require("../../utils/collection/reduce"),t=require("../../utils/collection/containsCollections");function n(n,i,o,a){var u=o(require("../relational/smaller")),c=o(require("./utils/improveErrorMessage")),l=a("min",{"Array | Matrix":f,"Array | Matrix, number | BigNumber":function(r,t){return e(r,t.valueOf(),s)},"...":function(r){if(t(r))throw new TypeError("Scalar values expected in function min");return f(r)}});return l.toTex="\\min\\left(${args}\\right)",l;function s(r,e){try{return u(r,e)?r:e}catch(t){throw c(t,"min",e)}}function f(e){var t;if(r(e,function(r){try{isNaN(r)&&"number"==typeof r?t=NaN:(void 0===t||u(r,t))&&(t=r)}catch(e){throw c(e,"min",r)}}),void 0===t)throw new Error("Cannot calculate min of an empty array");return t}}exports.name="min",exports.factory=n;
},{"../../utils/collection/deepForEach":"Uh7d","../../utils/collection/reduce":"tjrJ","../../utils/collection/containsCollections":"UGDC","../relational/smaller":"Q7ag","./utils/improveErrorMessage":"lOhJ"}],"DTxj":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").flatten;function a(a,e,t,n){var o=t(require("../utils/isNaN")),i=t(require("../utils/isNumeric"));return n("mode",{"Array | Matrix":u,"...":function(r){return u(r)}});function u(a){if(0===(a=r(a.valueOf())).length)throw new Error("Cannot calculate mode of an empty array");for(var e={},t=[],n=0,u=0;u<a.length;u++){var l=a[u];if(i(l)&&o(l))throw new Error("Cannot calculate mode of an array containing NaN values");l in e||(e[l]=0),e[l]++,e[l]===n?t.push(l):e[l]>n&&(n=e[l],t=[l])}return t}}exports.name="mode",exports.factory=a;
},{"../../utils/array":"j2lF","../utils/isNaN":"AHex","../utils/isNumeric":"Rv38"}],"Hc7x":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepForEach");function t(t,o,e,i){var n=e(require("../arithmetic/multiplyScalar")),a=e(require("./utils/improveErrorMessage")),u=i("prod",{"Array | Matrix":c,"Array | Matrix, number | BigNumber":function(r,t){throw new Error("prod(A, dim) is not yet supported")},"...":function(r){return c(r)}});return u.toTex=void 0,u;function c(t){var o;if(r(t,function(r){try{o=void 0===o?r:n(o,r)}catch(t){throw a(t,"prod",r)}}),void 0===o)throw new Error("Cannot calculate prod of an empty array");return o}}exports.name="prod",exports.factory=t;
},{"../../utils/collection/deepForEach":"Uh7d","../arithmetic/multiplyScalar":"obRw","./utils/improveErrorMessage":"lOhJ"}],"hl2d":[function(require,module,exports) {
"use strict";var r=require("../../utils/number").isInteger,e=require("../../utils/number").isNumber,t=require("../../utils/array").flatten,n=require("../../utils/collection/isCollection");function i(i,o,u,a){var f=u(require("../arithmetic/add")),s=u(require("../arithmetic/multiply")),l=u(require("../matrix/partitionSelect")),m=u(require("../relational/compare"));function w(r,n,i){var o=t(r),u=o.length;if(0===u)throw new Error("Cannot calculate quantile of an empty sequence");if(e(n)){var a=n*(u-1),w=a%1;if(0===w){var v=i?o[a]:l(o,a);return c(v),v}var b,g,h=Math.floor(a);if(i)b=o[h],g=o[h+1];else{g=l(o,h+1),b=o[h];for(var p=0;p<h;++p)m(o[p],b)>0&&(b=o[p])}return c(b),c(g),f(s(b,1-w),s(g,w))}var q=n.times(u-1);if(q.isInteger()){q=q.toNumber();var y=i?o[q]:l(o,q);return c(y),y}var N,E,d=q.floor(),x=q.minus(d),S=d.toNumber();if(i)N=o[S],E=o[S+1];else{E=l(o,S+1),N=o[S];for(var B=0;B<S;++B)m(o[B],N)>0&&(N=o[B])}c(N),c(E);var A=new x.constructor(1);return f(s(N,A.minus(x)),s(E,x))}var c=a({"number | BigNumber | Unit":function(r){return r}});return function(t,o,u){var a,f,s;if(arguments.length<2||arguments.length>3)throw new SyntaxError("Function quantileSeq requires two or three parameters");if(n(t)){if("boolean"==typeof(u=u||!1)){if(f=t.valueOf(),e(o)){if(o<0)throw new Error("N/prob must be non-negative");if(o<=1)return w(f,o,u);if(o>1){if(!r(o))throw new Error("N must be a positive integer");var l=o+1;a=new Array(o);for(var m=0;m<o;)a[m]=w(f,++m/l,u);return a}}if(i.isBigNumber(o)){if(o.isNegative())throw new Error("N/prob must be non-negative");if(s=new o.constructor(1),o.lte(s))return new i.BigNumber(w(f,o,u));if(o.gt(s)){if(!o.isInteger())throw new Error("N must be a positive integer");var c=o.toNumber();if(c>4294967295)throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var v=new i.BigNumber(c+1);a=new Array(c);for(var b=0;b<c;)a[b]=new i.BigNumber(w(f,new i.BigNumber(++b).div(v),u));return a}}if(Array.isArray(o)){a=new Array(o.length);for(var g=0;g<a.length;++g){var h=o[g];if(e(h)){if(h<0||h>1)throw new Error("Probability must be between 0 and 1, inclusive")}else{if(!i.isBigNumber(h))throw new TypeError("Unexpected type of argument in function quantileSeq");if(s=new h.constructor(1),h.isNegative()||h.gt(s))throw new Error("Probability must be between 0 and 1, inclusive")}a[g]=w(f,h,u)}return a}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}}exports.name="quantileSeq",exports.factory=i;
},{"../../utils/number":"uqMu","../../utils/array":"j2lF","../../utils/collection/isCollection":"m4c0","../arithmetic/add":"zf2Z","../arithmetic/multiply":"k7By","../matrix/partitionSelect":"kE3o","../relational/compare":"yGce"}],"ujYK":[function(require,module,exports) {
"use strict";var r="unbiased",e=require("../../utils/collection/deepForEach");function t(t,a,i,n){var u=i(require("../matrix/apply")),o=i(require("../arithmetic/addScalar")),c=i(require("../arithmetic/subtract")),s=i(require("../arithmetic/multiplyScalar")),m=i(require("../arithmetic/divideScalar")),h=i(require("../utils/isNaN")),l=i(require("./utils/improveErrorMessage")),d=n("variance",{"Array | Matrix":function(e){return f(e,r)},"Array | Matrix, string":f,"Array | Matrix, number | BigNumber":function(e,t){return v(e,t,r)},"Array | Matrix, number | BigNumber, string":v,"...":function(e){return f(e,r)}});return d.toTex="\\mathrm{Var}\\left(${args}\\right)",d;function f(r,a){var i=0,n=0;if(0===r.length)throw new SyntaxError("Function var requires one or more parameters (0 provided)");if(e(r,function(r){try{i=o(i,r),n++}catch(e){throw l(e,"var",r)}}),0===n)throw new Error("Cannot calculate var of an empty array");var u=m(i,n);if(i=0,e(r,function(r){var e=c(r,u);i=o(i,s(e,e))}),h(i))return i;switch(a){case"uncorrected":return m(i,n);case"biased":return m(i,n+1);case"unbiased":var d=t.isBigNumber(i)?new t.BigNumber(0):0;return 1===n?d:m(i,n-1);default:throw new Error('Unknown normalization "'+a+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function v(r,e,t){try{if(0===r.length)throw new SyntaxError("Function var requires one or more parameters (0 provided)");return u(r,e,function(r){return f(r,t)})}catch(a){throw l(a,"var")}}}exports.name="var",exports.factory=t;
},{"../../utils/collection/deepForEach":"Uh7d","../matrix/apply":"f9k3","../arithmetic/addScalar":"ZM3O","../arithmetic/subtract":"m78R","../arithmetic/multiplyScalar":"obRw","../arithmetic/divideScalar":"R3aq","../utils/isNaN":"AHex","./utils/improveErrorMessage":"lOhJ"}],"hFUZ":[function(require,module,exports) {
"use strict";function r(r,e,t,a){var i=t(require("../arithmetic/sqrt")),n=t(require("../statistics/var")),s=a("std",{"Array | Matrix":o,"Array | Matrix, string":o,"Array | Matrix, number | BigNumber":o,"Array | Matrix, number | BigNumber, string":o,"...":function(r){return o(r)}});return s.toTex=void 0,s;function o(r,e){if(0===r.length)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{return i(n.apply(null,arguments))}catch(t){throw t instanceof TypeError&&-1!==t.message.indexOf(" var")?new TypeError(t.message.replace(" var"," std")):t}}}exports.name="std",exports.factory=r;
},{"../arithmetic/sqrt":"T6pB","../statistics/var":"ujYK"}],"wF4V":[function(require,module,exports) {
"use strict";module.exports=[require("./mad"),require("./max"),require("./mean"),require("./median"),require("./min"),require("./mode"),require("./prod"),require("./quantileSeq"),require("./std"),require("./sum"),require("./var")];
},{"./mad":"Je7I","./max":"US8O","./mean":"WyK1","./median":"LcS3","./min":"VKqc","./mode":"DTxj","./prod":"Hc7x","./quantileSeq":"hl2d","./std":"hFUZ","./sum":"y9hQ","./var":"ujYK"}],"Y1aD":[function(require,module,exports) {
"use strict";var r=require("../../utils/string").isString,t=require("../../utils/string").format;function i(r,t,i,n){var s=n("print",{"string, Object | Array":e,"string, Object | Array, number | Object":e});return s.toTex=void 0,s}function e(i,e,n){return i.replace(/\$([\w.]+)/g,function(i,s){for(var o=s.split("."),u=e[o.shift()];o.length&&void 0!==u;){var a=o.shift();u=a?u[a]:u+"."}return void 0!==u?r(u)?u:t(u,n):i})}exports.name="print",exports.factory=i;
},{"../../utils/string":"PshC"}],"PVZV":[function(require,module,exports) {
"use strict";module.exports=[require("./format"),require("./print")];
},{"./format":"A04Q","./print":"Y1aD"}],"VaAN":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function e(e,t,o,n){var c=n("acos",{number:function(r){return r>=-1&&r<=1||t.predictable?Math.acos(r):new e.Complex(r,0).acos()},Complex:function(r){return r.acos()},BigNumber:function(r){return r.acos()},"Array | Matrix":function(e){return r(e,c)}});return c.toTex={1:"\\cos^{-1}\\left(${args[0]}\\right)"},c}exports.name="acos",exports.factory=e;
},{"../../utils/collection/deepMap":"lOYo"}],"ztg1":[function(require,module,exports) {
"use strict";var t=require("../../utils/collection/deepMap");function r(r,o,n,a){var c=a("acosh",{number:function(t){return t>=1||o.predictable?e(t):t<=-1?new r.Complex(Math.log(Math.sqrt(t*t-1)-t),Math.PI):new r.Complex(t,0).acosh()},Complex:function(t){return t.acosh()},BigNumber:function(t){return t.acosh()},"Array | Matrix":function(r){return t(r,c)}});return c.toTex={1:"\\cosh^{-1}\\left(${args[0]}\\right)"},c}var e=Math.acosh||function(t){return Math.log(Math.sqrt(t*t-1)+t)};exports.name="acosh",exports.factory=r;
},{"../../utils/collection/deepMap":"lOYo"}],"y5e7":[function(require,module,exports) {
"use strict";var t=require("../../utils/collection/deepMap");function r(r,e,n,a){var o=a("acot",{number:function(t){return Math.atan(1/t)},Complex:function(t){return t.acot()},BigNumber:function(t){return new r.BigNumber(1).div(t).atan()},"Array | Matrix":function(r){return t(r,o)}});return o.toTex={1:"\\cot^{-1}\\left(${args[0]}\\right)"},o}exports.name="acot",exports.factory=r;
},{"../../utils/collection/deepMap":"lOYo"}],"qhkj":[function(require,module,exports) {
"use strict";var t=require("../../utils/collection/deepMap");function r(r,e,n,o){var i=o("acoth",{number:function(t){return t>=1||t<=-1||e.predictable?isFinite(t)?(Math.log((t+1)/t)+Math.log(t/(t-1)))/2:0:new r.Complex(t,0).acoth()},Complex:function(t){return t.acoth()},BigNumber:function(t){return new r.BigNumber(1).div(t).atanh()},"Array | Matrix":function(r){return t(r,i)}});return i.toTex={1:"\\coth^{-1}\\left(${args[0]}\\right)"},i}exports.name="acoth",exports.factory=r;
},{"../../utils/collection/deepMap":"lOYo"}],"U7Zf":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function e(e,t,n,c){var i=c("acsc",{number:function(r){return r<=-1||r>=1||t.predictable?Math.asin(1/r):new e.Complex(r,0).acsc()},Complex:function(r){return r.acsc()},BigNumber:function(r){return new e.BigNumber(1).div(r).asin()},"Array | Matrix":function(e){return r(e,i)}});return i.toTex={1:"\\csc^{-1}\\left(${args[0]}\\right)"},i}exports.name="acsc",exports.factory=e;
},{"../../utils/collection/deepMap":"lOYo"}],"YhGE":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function t(t,e,n,c){var u=c("acsch",{number:function(r){return r=1/r,Math.log(r+Math.sqrt(r*r+1))},Complex:function(r){return r.acsch()},BigNumber:function(r){return new t.BigNumber(1).div(r).asinh()},"Array | Matrix":function(t){return r(t,u)}});return u.toTex={1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},u}exports.name="acsch",exports.factory=t;
},{"../../utils/collection/deepMap":"lOYo"}],"Ln1e":[function(require,module,exports) {
"use strict";var e=require("../../utils/collection/deepMap");function r(r,t,n,c){var a=c("asec",{number:function(e){return e<=-1||e>=1||t.predictable?Math.acos(1/e):new r.Complex(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new r.BigNumber(1).div(e).acos()},"Array | Matrix":function(r){return e(r,a)}});return a.toTex={1:"\\sec^{-1}\\left(${args[0]}\\right)"},a}exports.name="asec",exports.factory=r;
},{"../../utils/collection/deepMap":"lOYo"}],"hL0t":[function(require,module,exports) {
"use strict";var e=require("../../utils/collection/deepMap");function r(r,t,n,a){var c=a("asech",{number:function(e){if(e<=1&&e>=-1||t.predictable){e=1/e;var n=Math.sqrt(e*e-1);return e>0||t.predictable?Math.log(n+e):new r.Complex(Math.log(n-e),Math.PI)}return new r.Complex(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new r.BigNumber(1).div(e).acosh()},"Array | Matrix":function(r){return e(r,c)}});return c.toTex={1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},c}exports.name="asech",exports.factory=r;
},{"../../utils/collection/deepMap":"lOYo"}],"Kjxu":[function(require,module,exports) {
"use strict";var n=require("../../utils/collection/deepMap");function r(r,e,t,i){var a=i("asin",{number:function(n){return n>=-1&&n<=1||e.predictable?Math.asin(n):new r.Complex(n,0).asin()},Complex:function(n){return n.asin()},BigNumber:function(n){return n.asin()},"Array | Matrix":function(r){return n(r,a,!0)}});return a.toTex={1:"\\sin^{-1}\\left(${args[0]}\\right)"},a}exports.name="asin",exports.factory=r;
},{"../../utils/collection/deepMap":"lOYo"}],"IRsU":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function t(t,n,e,i){var a=i("asinh",{number:Math.asinh||function(r){return Math.log(Math.sqrt(r*r+1)+r)},Complex:function(r){return r.asinh()},BigNumber:function(r){return r.asinh()},"Array | Matrix":function(t){return r(t,a,!0)}});return a.toTex={1:"\\sinh^{-1}\\left(${args[0]}\\right)"},a}exports.name="asinh",exports.factory=t;
},{"../../utils/collection/deepMap":"lOYo"}],"RhXd":[function(require,module,exports) {
"use strict";var t=require("../../utils/collection/deepMap");function r(r,n,a,e){var u=e("atan",{number:function(t){return Math.atan(t)},Complex:function(t){return t.atan()},BigNumber:function(t){return t.atan()},"Array | Matrix":function(r){return t(r,u,!0)}});return u.toTex={1:"\\tan^{-1}\\left(${args[0]}\\right)"},u}exports.name="atan",exports.factory=r;
},{"../../utils/collection/deepMap":"lOYo"}],"lP3L":[function(require,module,exports) {
"use strict";function r(r,t,e,i){var n=e(require("../../type/matrix/function/matrix")),u=e(require("../../type/matrix/utils/algorithm02")),a=e(require("../../type/matrix/utils/algorithm03")),m=e(require("../../type/matrix/utils/algorithm09")),o=e(require("../../type/matrix/utils/algorithm11")),x=e(require("../../type/matrix/utils/algorithm12")),s=e(require("../../type/matrix/utils/algorithm13")),f=e(require("../../type/matrix/utils/algorithm14")),c=i("atan2",{"number, number":Math.atan2,"BigNumber, BigNumber":function(t,e){return r.BigNumber.atan2(t,e)},"SparseMatrix, SparseMatrix":function(r,t){return m(r,t,c,!1)},"SparseMatrix, DenseMatrix":function(r,t){return u(t,r,c,!0)},"DenseMatrix, SparseMatrix":function(r,t){return a(r,t,c,!1)},"DenseMatrix, DenseMatrix":function(r,t){return s(r,t,c)},"Array, Array":function(r,t){return c(n(r),n(t)).valueOf()},"Array, Matrix":function(r,t){return c(n(r),t)},"Matrix, Array":function(r,t){return c(r,n(t))},"SparseMatrix, number | BigNumber":function(r,t){return o(r,t,c,!1)},"DenseMatrix, number | BigNumber":function(r,t){return f(r,t,c,!1)},"number | BigNumber, SparseMatrix":function(r,t){return x(t,r,c,!0)},"number | BigNumber, DenseMatrix":function(r,t){return f(t,r,c,!0)},"Array, number | BigNumber":function(r,t){return f(n(r),t,c,!1).valueOf()},"number | BigNumber, Array":function(r,t){return f(n(t),r,c,!0).valueOf()}});return c.toTex={2:"\\mathrm{atan2}\\left(${args}\\right)"},c}exports.name="atan2",exports.factory=r;
},{"../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm02":"j4Xj","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm09":"PvZY","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"PRlQ":[function(require,module,exports) {
"use strict";var t=require("../../utils/collection/deepMap");function n(n,a,e,u){var o=u("atanh",{number:function(t){return t<=1&&t>=-1||a.predictable?r(t):new n.Complex(t,0).atanh()},Complex:function(t){return t.atanh()},BigNumber:function(t){return t.atanh()},"Array | Matrix":function(n){return t(n,o,!0)}});return o.toTex={1:"\\tanh^{-1}\\left(${args[0]}\\right)"},o}var r=Math.atanh||function(t){return Math.log((1+t)/(1-t))/2};exports.name="atanh",exports.factory=n;
},{"../../utils/collection/deepMap":"lOYo"}],"WIaC":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function n(n,t,e,o){var i=o("cos",{number:Math.cos,Complex:function(r){return r.cos()},BigNumber:function(r){return r.cos()},Unit:function(r){if(!r.hasBase(n.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cos is no angle");return i(r.value)},"Array | Matrix":function(n){return r(n,i)}});return i.toTex={1:"\\cos\\left(${args[0]}\\right)"},i}exports.name="cos",exports.factory=n;
},{"../../utils/collection/deepMap":"lOYo"}],"urk8":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function t(t,e,o,i){var u=i("cosh",{number:n,Complex:function(r){return r.cosh()},BigNumber:function(r){return r.cosh()},Unit:function(r){if(!r.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cosh is no angle");return u(r.value)},"Array | Matrix":function(t){return r(t,u)}});return u.toTex={1:"\\cosh\\left(${args[0]}\\right)"},u}var n=Math.cosh||function(r){return(Math.exp(r)+Math.exp(-r))/2};exports.name="cosh",exports.factory=t;
},{"../../utils/collection/deepMap":"lOYo"}],"ray7":[function(require,module,exports) {
"use strict";var t=require("../../utils/collection/deepMap");function n(n,r,e,i){var o=i("cot",{number:function(t){return 1/Math.tan(t)},Complex:function(t){return t.cot()},BigNumber:function(t){return new n.BigNumber(1).div(t.tan())},Unit:function(t){if(!t.hasBase(n.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return o(t.value)},"Array | Matrix":function(n){return t(n,o)}});return o.toTex={1:"\\cot\\left(${args[0]}\\right)"},o}exports.name="cot",exports.factory=n;
},{"../../utils/collection/deepMap":"lOYo"}],"wqSx":[function(require,module,exports) {
"use strict";var t=require("../../utils/collection/deepMap");function r(r,e,i,o){var u=o("coth",{number:n,Complex:function(t){return t.coth()},BigNumber:function(t){return new r.BigNumber(1).div(t.tanh())},Unit:function(t){if(!t.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function coth is no angle");return u(t.value)},"Array | Matrix":function(r){return t(r,u)}});return u.toTex={1:"\\coth\\left(${args[0]}\\right)"},u}function n(t){var r=Math.exp(2*t);return(r+1)/(r-1)}exports.name="coth",exports.factory=r;
},{"../../utils/collection/deepMap":"lOYo"}],"R45M":[function(require,module,exports) {
"use strict";var n=require("../../utils/collection/deepMap");function r(r,t,e,i){var c=i("csc",{number:function(n){return 1/Math.sin(n)},Complex:function(n){return n.csc()},BigNumber:function(n){return new r.BigNumber(1).div(n.sin())},Unit:function(n){if(!n.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function csc is no angle");return c(n.value)},"Array | Matrix":function(r){return n(r,c)}});return c.toTex={1:"\\csc\\left(${args[0]}\\right)"},c}exports.name="csc",exports.factory=r;
},{"../../utils/collection/deepMap":"lOYo"}],"AQW3":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap"),n=require("../../utils/number").sign;function e(n,e,i,u){var c=u("csch",{number:t,Complex:function(r){return r.csch()},BigNumber:function(r){return new n.BigNumber(1).div(r.sinh())},Unit:function(r){if(!r.hasBase(n.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function csch is no angle");return c(r.value)},"Array | Matrix":function(n){return r(n,c)}});return c.toTex={1:"\\mathrm{csch}\\left(${args[0]}\\right)"},c}function t(r){return 0===r?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(r)-Math.exp(-r)))*n(r)}exports.name="csch",exports.factory=e;
},{"../../utils/collection/deepMap":"lOYo","../../utils/number":"uqMu"}],"CaBc":[function(require,module,exports) {
"use strict";var e=require("../../utils/collection/deepMap");function r(r,n,t,i){var u=i("sec",{number:function(e){return 1/Math.cos(e)},Complex:function(e){return e.sec()},BigNumber:function(e){return new r.BigNumber(1).div(e.cos())},Unit:function(e){if(!e.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sec is no angle");return u(e.value)},"Array | Matrix":function(r){return e(r,u)}});return u.toTex={1:"\\sec\\left(${args[0]}\\right)"},u}exports.name="sec",exports.factory=r;
},{"../../utils/collection/deepMap":"lOYo"}],"twiY":[function(require,module,exports) {
"use strict";var e=require("../../utils/collection/deepMap");function r(r,t,i,u){var o=u("sech",{number:n,Complex:function(e){return e.sech()},BigNumber:function(e){return new r.BigNumber(1).div(e.cosh())},Unit:function(e){if(!e.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sech is no angle");return o(e.value)},"Array | Matrix":function(r){return e(r,o)}});return o.toTex={1:"\\mathrm{sech}\\left(${args[0]}\\right)"},o}function n(e){return 2/(Math.exp(e)+Math.exp(-e))}exports.name="sech",exports.factory=r;
},{"../../utils/collection/deepMap":"lOYo"}],"v5Tm":[function(require,module,exports) {
"use strict";var n=require("../../utils/collection/deepMap");function r(r,t,i,e){var u=e("sin",{number:Math.sin,Complex:function(n){return n.sin()},BigNumber:function(n){return n.sin()},Unit:function(n){if(!n.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sin is no angle");return u(n.value)},"Array | Matrix":function(r){return n(r,u,!0)}});return u.toTex={1:"\\sin\\left(${args[0]}\\right)"},u}exports.name="sin",exports.factory=r;
},{"../../utils/collection/deepMap":"lOYo"}],"Q1nY":[function(require,module,exports) {
"use strict";var n=require("../../utils/collection/deepMap");function r(r,e,i,u){var o=u("sinh",{number:t,Complex:function(n){return n.sinh()},BigNumber:function(n){return n.sinh()},Unit:function(n){if(!n.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sinh is no angle");return o(n.value)},"Array | Matrix":function(r){return n(r,o,!0)}});return o.toTex={1:"\\sinh\\left(${args[0]}\\right)"},o}var t=Math.sinh||function(n){return(Math.exp(n)-Math.exp(-n))/2};exports.name="sinh",exports.factory=r;
},{"../../utils/collection/deepMap":"lOYo"}],"jk9z":[function(require,module,exports) {
"use strict";var n=require("../../utils/collection/deepMap");function t(t,r,e,a){var i=a("tan",{number:Math.tan,Complex:function(n){return n.tan()},BigNumber:function(n){return n.tan()},Unit:function(n){if(!n.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function tan is no angle");return i(n.value)},"Array | Matrix":function(t){return n(t,i,!0)}});return i.toTex={1:"\\tan\\left(${args[0]}\\right)"},i}exports.name="tan",exports.factory=t;
},{"../../utils/collection/deepMap":"lOYo"}],"FXHB":[function(require,module,exports) {
"use strict";var n=require("../../utils/collection/deepMap");function t(t,e,a,i){var u=i("tanh",{number:r,Complex:function(n){return n.tanh()},BigNumber:function(n){return n.tanh()},Unit:function(n){if(!n.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function tanh is no angle");return u(n.value)},"Array | Matrix":function(t){return n(t,u,!0)}});return u.toTex={1:"\\tanh\\left(${args[0]}\\right)"},u}var r=Math.tanh||function(n){var t=Math.exp(2*n);return(t-1)/(t+1)};exports.name="tanh",exports.factory=t;
},{"../../utils/collection/deepMap":"lOYo"}],"SGcX":[function(require,module,exports) {
"use strict";module.exports=[require("./acos"),require("./acosh"),require("./acot"),require("./acoth"),require("./acsc"),require("./acsch"),require("./asec"),require("./asech"),require("./asin"),require("./asinh"),require("./atan"),require("./atan2"),require("./atanh"),require("./cos"),require("./cosh"),require("./cot"),require("./coth"),require("./csc"),require("./csch"),require("./sec"),require("./sech"),require("./sin"),require("./sinh"),require("./tan"),require("./tanh")];
},{"./acos":"VaAN","./acosh":"ztg1","./acot":"y5e7","./acoth":"qhkj","./acsc":"U7Zf","./acsch":"YhGE","./asec":"Ln1e","./asech":"hL0t","./asin":"Kjxu","./asinh":"IRsU","./atan":"RhXd","./atan2":"lP3L","./atanh":"PRlQ","./cos":"WIaC","./cosh":"urk8","./cot":"ray7","./coth":"wqSx","./csc":"R45M","./csch":"AQW3","./sec":"CaBc","./sech":"twiY","./sin":"v5Tm","./sinh":"Q1nY","./tan":"jk9z","./tanh":"FXHB"}],"aMR7":[function(require,module,exports) {
"use strict";function r(r,t,n,i){var a=require("../../utils/latex"),e=n(require("../../type/matrix/function/matrix")),u=n(require("../../type/matrix/utils/algorithm13")),o=n(require("../../type/matrix/utils/algorithm14")),f=i("to",{"Unit, Unit | string":function(r,t){return r.to(t)},"Matrix, Matrix":function(r,t){return u(r,t,f)},"Array, Array":function(r,t){return f(e(r),e(t)).valueOf()},"Array, Matrix":function(r,t){return f(e(r),t)},"Matrix, Array":function(r,t){return f(r,e(t))},"Matrix, any":function(r,t){return o(r,t,f,!1)},"any, Matrix":function(r,t){return o(t,r,f,!0)},"Array, any":function(r,t){return o(e(r),t,f,!1).valueOf()},"any, Array":function(r,t){return o(e(t),r,f,!0).valueOf()}});return f.toTex={2:"\\left(${args[0]}".concat(a.operators.to,"${args[1]}\\right)")},f}exports.name="to",exports.factory=r;
},{"../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"rv7z":[function(require,module,exports) {
"use strict";module.exports=[require("./to")];
},{"./to":"aMR7"}],"Oa1A":[function(require,module,exports) {
"use strict";var e=require("../../utils/object");function o(o,r,t,n){var c=n("clone",{any:e.clone});return c.toTex=void 0,c}exports.name="clone",exports.factory=o;
},{"../../utils/object":"FcSp"}],"mSLG":[function(require,module,exports) {
"use strict";function r(r,e,t,u){var n=t(require("./isNumeric"));return u("hasNumericValue",{string:function(r){return r.trim().length>0&&!isNaN(Number(r))},any:function(r){return n(r)}})}exports.name="hasNumericValue",exports.factory=r;
},{"./isNumeric":"Rv38"}],"on0C":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function e(e,t,i,u){var n=u("isPrime",{number:function(r){if(r<2)return!1;if(2===r)return!0;if(r%2==0)return!1;for(var e=3;e*e<=r;e+=2)if(r%e==0)return!1;return!0},BigNumber:function(r){if(r.lt(2))return!1;if(r.equals(2))return!0;if(r.mod(2).isZero())return!1;for(var t=e.BigNumber(3);t.times(t).lte(r);t=t.plus(1))if(r.mod(t).isZero())return!1;return!0},"Array | Matrix":function(e){return r(e,n)}});return n}exports.name="isPrime",exports.factory=e;
},{"../../utils/collection/deepMap":"lOYo"}],"tvom":[function(require,module,exports) {
"use strict";module.exports=[require("./clone"),require("./isInteger"),require("./isNegative"),require("./isNumeric"),require("./hasNumericValue"),require("./isPositive"),require("./isPrime"),require("./isZero"),require("./isNaN"),require("./typeof")];
},{"./clone":"Oa1A","./isInteger":"qG7X","./isNegative":"HYoC","./isNumeric":"Rv38","./hasNumericValue":"mSLG","./isPositive":"OFKG","./isPrime":"on0C","./isZero":"geyZ","./isNaN":"AHex","./typeof":"LZTG"}],"wKfj":[function(require,module,exports) {
"use strict";module.exports=[require("./algebra"),require("./arithmetic"),require("./bitwise"),require("./combinatorics"),require("./complex"),require("./geometry"),require("./logical"),require("./matrix"),require("./probability"),require("./relational"),require("./set"),require("./special"),require("./statistics"),require("./string"),require("./trigonometry"),require("./unit"),require("./utils")];
},{"./algebra":"VeYJ","./arithmetic":"bAc9","./bitwise":"JhAg","./combinatorics":"otxT","./complex":"gHt6","./geometry":"W9Zs","./logical":"TPFf","./matrix":"X3kh","./probability":"xCRU","./relational":"IR2w","./set":"O2mj","./special":"JuUL","./statistics":"wF4V","./string":"PVZV","./trigonometry":"SGcX","./unit":"rv7z","./utils":"tvom"}],"iLNC":[function(require,module,exports) {
"use strict";module.exports={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","complex","fraction","index","matrix","string","unit"]};
},{}],"t9At":[function(require,module,exports) {
"use strict";module.exports={name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]};
},{}],"JrNm":[function(require,module,exports) {
"use strict";module.exports={name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]};
},{}],"p1Y0":[function(require,module,exports) {
"use strict";module.exports={name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]};
},{}],"L0ae":[function(require,module,exports) {
"use strict";module.exports={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(num,den)"],description:"Create a fraction from a number or from a numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]};
},{}],"u7WR":[function(require,module,exports) {
"use strict";module.exports={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["[]","[1, 2, 3]","A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[0:2, 0:2] = ones(2, 2)"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]};
},{}],"ig4c":[function(require,module,exports) {
"use strict";module.exports={name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]};
},{}],"a1WX":[function(require,module,exports) {
"use strict";module.exports={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","boolean","complex","fraction","index","matrix","string","unit"]};
},{}],"wNuW":[function(require,module,exports) {
"use strict";module.exports={name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]};
},{}],"YFZz":[function(require,module,exports) {
"use strict";module.exports={name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]};
},{}],"rqOi":[function(require,module,exports) {
"use strict";module.exports={name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]};
},{}],"x7uc":[function(require,module,exports) {
"use strict";module.exports={name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]};
},{}],"MQ99":[function(require,module,exports) {
"use strict";module.exports={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]};
},{}],"T9NB":[function(require,module,exports) {
"use strict";module.exports={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]};
},{}],"aPHB":[function(require,module,exports) {
"use strict";module.exports={name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]};
},{}],"QQb5":[function(require,module,exports) {
"use strict";module.exports={name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]};
},{}],"aXGR":[function(require,module,exports) {
"use strict";module.exports={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]};
},{}],"ONCS":[function(require,module,exports) {
"use strict";module.exports={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]};
},{}],"l03h":[function(require,module,exports) {
"use strict";module.exports={name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]};
},{}],"IwW2":[function(require,module,exports) {
"use strict";module.exports={name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]};
},{}],"sLjM":[function(require,module,exports) {
"use strict";module.exports={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]};
},{}],"lowc":[function(require,module,exports) {
"use strict";module.exports={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]};
},{}],"HJY8":[function(require,module,exports) {
"use strict";module.exports={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]};
},{}],"jcFy":[function(require,module,exports) {
"use strict";module.exports={name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",examples:["phi"],seealso:[]};
},{}],"fDHA":[function(require,module,exports) {
"use strict";module.exports={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]};
},{}],"yYpy":[function(require,module,exports) {
"use strict";module.exports={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]};
},{}],"aQgJ":[function(require,module,exports) {
"use strict";module.exports={name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]};
},{}],"n6zq":[function(require,module,exports) {
"use strict";module.exports={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]};
},{}],"CPzZ":[function(require,module,exports) {
"use strict";module.exports={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]};
},{}],"HjBS":[function(require,module,exports) {
"use strict";module.exports={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.eval({x: 3})"],seealso:["simplify","parse","eval"]};
},{}],"OFzm":[function(require,module,exports) {
"use strict";module.exports={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Solves the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lup","lusolve","usolve","matrix","sparse"]};
},{}],"SsYr":[function(require,module,exports) {
"use strict";module.exports={name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]};
},{}],"F1Dh":[function(require,module,exports) {
"use strict";module.exports={name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]};
},{}],"yWjE":[function(require,module,exports) {
"use strict";module.exports={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.eval({x: 2})"],seealso:["derivative","parse","eval"]};
},{}],"xCNe":[function(require,module,exports) {
"use strict";module.exports={name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]};
},{}],"h0vC":[function(require,module,exports) {
"use strict";module.exports={name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]};
},{}],"RXlV":[function(require,module,exports) {
"use strict";module.exports={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Solves the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["lup","lusolve","lsolve","matrix","sparse"]};
},{}],"rUq2":[function(require,module,exports) {
"use strict";module.exports={name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]};
},{}],"XkjO":[function(require,module,exports) {
"use strict";module.exports={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]};
},{}],"k4Wb":[function(require,module,exports) {
"use strict";module.exports={name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]};
},{}],"aoF1":[function(require,module,exports) {
"use strict";module.exports={name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]};
},{}],"z4It":[function(require,module,exports) {
"use strict";module.exports={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]};
},{}],"ruVI":[function(require,module,exports) {
"use strict";module.exports={name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]};
},{}],"sbSk":[function(require,module,exports) {
"use strict";module.exports={name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]};
},{}],"hr3Z":[function(require,module,exports) {
"use strict";module.exports={name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]};
},{}],"p0XP":[function(require,module,exports) {
"use strict";module.exports={name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]};
},{}],"HDd7":[function(require,module,exports) {
"use strict";module.exports={name:"dotpow",category:"Operators",syntax:["x .^ y","dotpow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]};
},{}],"y0AC":[function(require,module,exports) {
"use strict";module.exports={name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]};
},{}],"iddg":[function(require,module,exports) {
"use strict";module.exports={name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]};
},{}],"pk0d":[function(require,module,exports) {
"use strict";module.exports={name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]};
},{}],"WGIH":[function(require,module,exports) {
"use strict";module.exports={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]};
},{}],"vXNc":[function(require,module,exports) {
"use strict";module.exports={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]};
},{}],"dwcd":[function(require,module,exports) {
"use strict";module.exports={name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]};
},{}],"Vx3c":[function(require,module,exports) {
"use strict";module.exports={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]};
},{}],"gaE4":[function(require,module,exports) {
"use strict";module.exports={name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]};
},{}],"vbjs":[function(require,module,exports) {
"use strict";module.exports={name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]};
},{}],"XIlx":[function(require,module,exports) {
"use strict";module.exports={name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]};
},{}],"WGSj":[function(require,module,exports) {
"use strict";module.exports={name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a `value+1`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]};
},{}],"qxOp":[function(require,module,exports) {
"use strict";module.exports={name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]};
},{}],"WNo3":[function(require,module,exports) {
"use strict";module.exports={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]};
},{}],"rG0J":[function(require,module,exports) {
"use strict";module.exports={name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]};
},{}],"av88":[function(require,module,exports) {
"use strict";module.exports={name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']};
},{}],"tPWr":[function(require,module,exports) {
"use strict";module.exports={name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]};
},{}],"Hwjx":[function(require,module,exports) {
"use strict";module.exports={name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]};
},{}],"RTne":[function(require,module,exports) {
"use strict";module.exports={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]};
},{}],"ayTa":[function(require,module,exports) {
"use strict";module.exports={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)"],seealso:["ceil","floor","fix"]};
},{}],"HnEg":[function(require,module,exports) {
"use strict";module.exports={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]};
},{}],"uX7J":[function(require,module,exports) {
"use strict";module.exports={name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]};
},{}],"MaXS":[function(require,module,exports) {
"use strict";module.exports={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[1, 2], [3, 4]])"],seealso:["sqrt","abs","square","multiply"]};
},{}],"wa24":[function(require,module,exports) {
"use strict";module.exports={name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]};
},{}],"IpJ1":[function(require,module,exports) {
"use strict";module.exports={name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]};
},{}],"zSOc":[function(require,module,exports) {
"use strict";module.exports={name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]};
},{}],"hWWr":[function(require,module,exports) {
"use strict";module.exports={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]};
},{}],"LePI":[function(require,module,exports) {
"use strict";module.exports={name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]};
},{}],"cry4":[function(require,module,exports) {
"use strict";module.exports={name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]};
},{}],"HcKC":[function(require,module,exports) {
"use strict";module.exports={name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]};
},{}],"ujKO":[function(require,module,exports) {
"use strict";module.exports={name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]};
},{}],"WecP":[function(require,module,exports) {
"use strict";module.exports={name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]};
},{}],"T9yh":[function(require,module,exports) {
"use strict";module.exports={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]};
},{}],"ZNwk":[function(require,module,exports) {
"use strict";module.exports={name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]};
},{}],"XUC6":[function(require,module,exports) {
"use strict";module.exports={name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]};
},{}],"a5Km":[function(require,module,exports) {
"use strict";module.exports={name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]};
},{}],"gEl1":[function(require,module,exports) {
"use strict";module.exports={name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]};
},{}],"oDTX":[function(require,module,exports) {
"use strict";module.exports={name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]};
},{}],"sdgX":[function(require,module,exports) {
"use strict";module.exports={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]};
},{}],"DO71":[function(require,module,exports) {
"use strict";module.exports={name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]};
},{}],"ZwB0":[function(require,module,exports) {
"use strict";module.exports={name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]};
},{}],"Shzo":[function(require,module,exports) {
"use strict";module.exports={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number, number": f(x)=x+x })',"double(2)",'double("hello")'],seealso:[]};
},{}],"DVdV":[function(require,module,exports) {
"use strict";module.exports={name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]};
},{}],"Wmy6":[function(require,module,exports) {
"use strict";module.exports={name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]};
},{}],"zwHi":[function(require,module,exports) {
"use strict";module.exports={name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]};
},{}],"QAET":[function(require,module,exports) {
"use strict";module.exports={name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]};
},{}],"bVEH":[function(require,module,exports) {
"use strict";module.exports={name:"eval",category:"Expression",syntax:["eval(expression)","eval([expr1, expr2, expr3, ...])"],description:"Evaluate an expression or an array with expressions.",examples:['eval("2 + 3")','eval("sqrt(" + 4 + ")")'],seealso:[]};
},{}],"Fax8":[function(require,module,exports) {
"use strict";module.exports={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]};
},{}],"dMW5":[function(require,module,exports) {
"use strict";module.exports={name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]};
},{}],"bVBO":[function(require,module,exports) {
"use strict";module.exports={name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]};
},{}],"AWzT":[function(require,module,exports) {
"use strict";module.exports={name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]};
},{}],"AWWa":[function(require,module,exports) {
"use strict";module.exports={name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]};
},{}],"JhOe":[function(require,module,exports) {
"use strict";module.exports={name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]};
},{}],"JMRD":[function(require,module,exports) {
"use strict";module.exports={name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]};
},{}],"aMEf":[function(require,module,exports) {
"use strict";module.exports={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row"]};
},{}],"q0hB":[function(require,module,exports) {
"use strict";module.exports={name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};
},{}],"IWZn":[function(require,module,exports) {
"use strict";module.exports={name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]};
},{}],"nnFv":[function(require,module,exports) {
"use strict";module.exports={name:"transpose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]};
},{}],"qD6G":[function(require,module,exports) {
"use strict";module.exports={name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};
},{}],"UQh1":[function(require,module,exports) {
"use strict";module.exports={name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};
},{}],"BlyW":[function(require,module,exports) {
"use strict";module.exports={name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]};
},{}],"bnMU":[function(require,module,exports) {
"use strict";module.exports={name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeof"]};
},{}],"iJ3P":[function(require,module,exports) {
"use strict";module.exports={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};
},{}],"CckY":[function(require,module,exports) {
"use strict";module.exports={name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]};
},{}],"UmBd":[function(require,module,exports) {
"use strict";module.exports={name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]};
},{}],"l4FK":[function(require,module,exports) {
"use strict";module.exports={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["forEach([1, 2, 3], function(val) { console.log(val) })"],seealso:["map","sort","filter"]};
},{}],"DDDN":[function(require,module,exports) {
"use strict";module.exports={name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]};
},{}],"DU2x":[function(require,module,exports) {
"use strict";module.exports={name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]};
},{}],"oHAh":[function(require,module,exports) {
"use strict";module.exports={name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]};
},{}],"fbw8":[function(require,module,exports) {
"use strict";module.exports={name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]};
},{}],"fQm4":[function(require,module,exports) {
"use strict";module.exports={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1)'],seealso:["sort"]};
},{}],"NLcZ":[function(require,module,exports) {
"use strict";module.exports={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]};
},{}],"tmIl":[function(require,module,exports) {
"use strict";module.exports={name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]};
},{}],"DOEY":[function(require,module,exports) {
"use strict";module.exports={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])"],seealso:["size","squeeze","resize"]};
},{}],"FNOD":[function(require,module,exports) {
"use strict";module.exports={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column"]};
},{}],"lVw7":[function(require,module,exports) {
"use strict";module.exports={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]};
},{}],"bGuK":[function(require,module,exports) {
"use strict";module.exports={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"])',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]};
},{}],"MpqE":[function(require,module,exports) {
"use strict";module.exports={name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]};
},{}],"WRJB":[function(require,module,exports) {
"use strict";module.exports={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of a matrix or string. Indexes are one-based. Both the ranges lower-bound and upper-bound are included.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]};
},{}],"nc6c":[function(require,module,exports) {
"use strict";module.exports={name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]};
},{}],"fj0p":[function(require,module,exports) {
"use strict";module.exports={name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]};
},{}],"nFaR":[function(require,module,exports) {
"use strict";module.exports={name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]};
},{}],"M4Fz":[function(require,module,exports) {
"use strict";module.exports={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["permutations","factorial"]};
},{}],"cbU5":[function(require,module,exports) {
"use strict";module.exports={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","permutations","gamma"]};
},{}],"mIdZ":[function(require,module,exports) {
"use strict";module.exports={name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]};
},{}],"W9Q9":[function(require,module,exports) {
"use strict";module.exports={name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]};
},{}],"y9uR":[function(require,module,exports) {
"use strict";module.exports={name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]};
},{}],"qGLJ":[function(require,module,exports) {
"use strict";module.exports={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","factorial"]};
},{}],"iKEH":[function(require,module,exports) {
"use strict";module.exports={name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]};
},{}],"pXBT":[function(require,module,exports) {
"use strict";module.exports={name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]};
},{}],"fj2Q":[function(require,module,exports) {
"use strict";module.exports={name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]};
},{}],"jKwP":[function(require,module,exports) {
"use strict";module.exports={name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]};
},{}],"JLzY":[function(require,module,exports) {
"use strict";module.exports={name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]};
},{}],"Bmmt":[function(require,module,exports) {
"use strict";module.exports={name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]};
},{}],"bLpw":[function(require,module,exports) {
"use strict";module.exports={name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]};
},{}],"wgSR":[function(require,module,exports) {
"use strict";module.exports={name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]};
},{}],"HVZA":[function(require,module,exports) {
"use strict";module.exports={name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]};
},{}],"TH74":[function(require,module,exports) {
"use strict";module.exports={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]};
},{}],"hahd":[function(require,module,exports) {
"use strict";module.exports={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]};
},{}],"iBZ4":[function(require,module,exports) {
"use strict";module.exports={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]};
},{}],"Ob6s":[function(require,module,exports) {
"use strict";module.exports={name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]};
},{}],"kwrJ":[function(require,module,exports) {
"use strict";module.exports={name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]};
},{}],"qllh":[function(require,module,exports) {
"use strict";module.exports={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]};
},{}],"jaWL":[function(require,module,exports) {
"use strict";module.exports={name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]};
},{}],"VDoP":[function(require,module,exports) {
"use strict";module.exports={name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]};
},{}],"kvfp":[function(require,module,exports) {
"use strict";module.exports={name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]};
},{}],"XvM6":[function(require,module,exports) {
"use strict";module.exports={name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]};
},{}],"sMXh":[function(require,module,exports) {
"use strict";module.exports={name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]};
},{}],"rmtw":[function(require,module,exports) {
"use strict";module.exports={name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]};
},{}],"AYWb":[function(require,module,exports) {
"use strict";module.exports={name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]};
},{}],"reLj":[function(require,module,exports) {
"use strict";module.exports={name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]};
},{}],"Wqu5":[function(require,module,exports) {
"use strict";module.exports={name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]};
},{}],"NbhS":[function(require,module,exports) {
"use strict";module.exports={name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]};
},{}],"EtYx":[function(require,module,exports) {
"use strict";module.exports={name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]};
},{}],"L2AM":[function(require,module,exports) {
"use strict";module.exports={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dim)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","var"]};
},{}],"qRED":[function(require,module,exports) {
"use strict";module.exports={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dim)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","var"]};
},{}],"nYR2":[function(require,module,exports) {
"use strict";module.exports={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","var","quantileSeq"]};
},{}],"xrLZ":[function(require,module,exports) {
"use strict";module.exports={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dim)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","var"]};
},{}],"yBPR":[function(require,module,exports) {
"use strict";module.exports={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","var"]};
},{}],"NCYX":[function(require,module,exports) {
"use strict";module.exports={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","var"]};
},{}],"Gbgi":[function(require,module,exports) {
"use strict";module.exports={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:"Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.",examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","var"]};
},{}],"uXlw":[function(require,module,exports) {
"use strict";module.exports={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(var(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","sum","var"]};
},{}],"qyn0":[function(require,module,exports) {
"use strict";module.exports={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","var"]};
},{}],"siyP":[function(require,module,exports) {
"use strict";module.exports={name:"var",category:"Statistics",syntax:["var(a, b, c, ...)","var(A)","var(A, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["var(2, 4, 6)","var([2, 4, 6, 8])",'var([2, 4, 6, 8], "uncorrected")','var([2, 4, 6, 8], "biased")',"var([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]};
},{}],"HPVa":[function(require,module,exports) {
"use strict";module.exports={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]};
},{}],"MvCO":[function(require,module,exports) {
"use strict";module.exports={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]};
},{}],"xXPM":[function(require,module,exports) {
"use strict";module.exports={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]};
},{}],"KpnL":[function(require,module,exports) {
"use strict";module.exports={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]};
},{}],"Gt5T":[function(require,module,exports) {
"use strict";module.exports={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]};
},{}],"XLHb":[function(require,module,exports) {
"use strict";module.exports={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]};
},{}],"uxTA":[function(require,module,exports) {
"use strict";module.exports={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]};
},{}],"eRMa":[function(require,module,exports) {
"use strict";module.exports={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]};
},{}],"M9R8":[function(require,module,exports) {
"use strict";module.exports={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]};
},{}],"qY7D":[function(require,module,exports) {
"use strict";module.exports={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]};
},{}],"s9IB":[function(require,module,exports) {
"use strict";module.exports={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]};
},{}],"fjot":[function(require,module,exports) {
"use strict";module.exports={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]};
},{}],"Z7HZ":[function(require,module,exports) {
"use strict";module.exports={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]};
},{}],"DWzk":[function(require,module,exports) {
"use strict";module.exports={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]};
},{}],"maYo":[function(require,module,exports) {
"use strict";module.exports={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]};
},{}],"wCAM":[function(require,module,exports) {
"use strict";module.exports={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]};
},{}],"AM7w":[function(require,module,exports) {
"use strict";module.exports={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]};
},{}],"cTPc":[function(require,module,exports) {
"use strict";module.exports={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]};
},{}],"uHb4":[function(require,module,exports) {
"use strict";module.exports={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]};
},{}],"hpuP":[function(require,module,exports) {
"use strict";module.exports={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]};
},{}],"WKMm":[function(require,module,exports) {
"use strict";module.exports={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]};
},{}],"gPaM":[function(require,module,exports) {
"use strict";module.exports={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]};
},{}],"G3av":[function(require,module,exports) {
"use strict";module.exports={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]};
},{}],"N6lO":[function(require,module,exports) {
"use strict";module.exports={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]};
},{}],"teZk":[function(require,module,exports) {
"use strict";module.exports={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]};
},{}],"ROe2":[function(require,module,exports) {
"use strict";module.exports={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]};
},{}],"I9FW":[function(require,module,exports) {
"use strict";module.exports={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]};
},{}],"gPkx":[function(require,module,exports) {
"use strict";module.exports={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]};
},{}],"VF4n":[function(require,module,exports) {
"use strict";module.exports={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]};
},{}],"rt70":[function(require,module,exports) {
"use strict";module.exports={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]};
},{}],"hspf":[function(require,module,exports) {
"use strict";module.exports={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]};
},{}],"Tqof":[function(require,module,exports) {
"use strict";module.exports={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]};
},{}],"RYV2":[function(require,module,exports) {
"use strict";module.exports={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]};
},{}],"pq0g":[function(require,module,exports) {
"use strict";module.exports={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]};
},{}],"mX5V":[function(require,module,exports) {
"use strict";module.exports={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]};
},{}],"MHMc":[function(require,module,exports) {
"use strict";module.exports={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]};
},{}],"v295":[function(require,module,exports) {
"use strict";module.exports={name:"typeof",category:"Utils",syntax:["typeof(x)"],description:"Get the type of a variable.",examples:["typeof(3.5)","typeof(2 - 4i)","typeof(45 deg)",'typeof("hello world")'],seealso:["getMatrixDataType"]};
},{}],"u4GE":[function(require,module,exports) {
"use strict";function e(e,i,t,r){var n={};return n.bignumber=require("./construction/bignumber"),n.boolean=require("./construction/boolean"),n.complex=require("./construction/complex"),n.createUnit=require("./construction/createUnit"),n.fraction=require("./construction/fraction"),n.index=require("./construction/index"),n.matrix=require("./construction/matrix"),n.number=require("./construction/number"),n.sparse=require("./construction/sparse"),n.splitUnit=require("./construction/splitUnit"),n.string=require("./construction/string"),n.unit=require("./construction/unit"),n.e=require("./constants/e"),n.E=require("./constants/e"),n.false=require("./constants/false"),n.i=require("./constants/i"),n[1/0]=require("./constants/Infinity"),n.LN2=require("./constants/LN2"),n.LN10=require("./constants/LN10"),n.LOG2E=require("./constants/LOG2E"),n.LOG10E=require("./constants/LOG10E"),n.NaN=require("./constants/NaN"),n.null=require("./constants/null"),n.pi=require("./constants/pi"),n.PI=require("./constants/pi"),n.phi=require("./constants/phi"),n.SQRT1_2=require("./constants/SQRT1_2"),n.SQRT2=require("./constants/SQRT2"),n.tau=require("./constants/tau"),n.true=require("./constants/true"),n.version=require("./constants/version"),n.speedOfLight={description:"Speed of light in vacuum",examples:["speedOfLight"]},n.gravitationConstant={description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},n.planckConstant={description:"Planck constant",examples:["planckConstant"]},n.reducedPlanckConstant={description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},n.magneticConstant={description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},n.electricConstant={description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},n.vacuumImpedance={description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},n.coulomb={description:"Coulomb's constant",examples:["coulomb"]},n.elementaryCharge={description:"Elementary charge",examples:["elementaryCharge"]},n.bohrMagneton={description:"Borh magneton",examples:["bohrMagneton"]},n.conductanceQuantum={description:"Conductance quantum",examples:["conductanceQuantum"]},n.inverseConductanceQuantum={description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},n.magneticFluxQuantum={description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},n.nuclearMagneton={description:"Nuclear magneton",examples:["nuclearMagneton"]},n.klitzing={description:"Von Klitzing constant",examples:["klitzing"]},n.bohrRadius={description:"Borh radius",examples:["bohrRadius"]},n.classicalElectronRadius={description:"Classical electron radius",examples:["classicalElectronRadius"]},n.electronMass={description:"Electron mass",examples:["electronMass"]},n.fermiCoupling={description:"Fermi coupling constant",examples:["fermiCoupling"]},n.fineStructure={description:"Fine-structure constant",examples:["fineStructure"]},n.hartreeEnergy={description:"Hartree energy",examples:["hartreeEnergy"]},n.protonMass={description:"Proton mass",examples:["protonMass"]},n.deuteronMass={description:"Deuteron Mass",examples:["deuteronMass"]},n.neutronMass={description:"Neutron mass",examples:["neutronMass"]},n.quantumOfCirculation={description:"Quantum of circulation",examples:["quantumOfCirculation"]},n.rydberg={description:"Rydberg constant",examples:["rydberg"]},n.thomsonCrossSection={description:"Thomson cross section",examples:["thomsonCrossSection"]},n.weakMixingAngle={description:"Weak mixing angle",examples:["weakMixingAngle"]},n.efimovFactor={description:"Efimov factor",examples:["efimovFactor"]},n.atomicMass={description:"Atomic mass constant",examples:["atomicMass"]},n.avogadro={description:"Avogadro's number",examples:["avogadro"]},n.boltzmann={description:"Boltzmann constant",examples:["boltzmann"]},n.faraday={description:"Faraday constant",examples:["faraday"]},n.firstRadiation={description:"First radiation constant",examples:["firstRadiation"]},n.loschmidt={description:"Loschmidt constant at T=273.15 K and p=101.325 kPa"
},{"./construction/bignumber":"iLNC","./construction/boolean":"t9At","./construction/complex":"JrNm","./construction/createUnit":"p1Y0","./construction/fraction":"L0ae","./construction/index":"u7WR","./construction/matrix":"ig4c","./construction/number":"a1WX","./construction/sparse":"wNuW","./construction/splitUnit":"YFZz","./construction/string":"rqOi","./construction/unit":"x7uc","./constants/e":"MQ99","./constants/false":"T9NB","./constants/i":"aPHB","./constants/Infinity":"QQb5","./constants/LN2":"aXGR","./constants/LN10":"ONCS","./constants/LOG2E":"l03h","./constants/LOG10E":"IwW2","./constants/NaN":"sLjM","./constants/null":"lowc","./constants/pi":"HJY8","./constants/phi":"jcFy","./constants/SQRT1_2":"fDHA","./constants/SQRT2":"yYpy","./constants/tau":"aQgJ","./constants/true":"n6zq","./constants/version":"CPzZ","./function/algebra/derivative":"HjBS","./function/algebra/lsolve":"OFzm","./function/algebra/lup":"SsYr","./function/algebra/lusolve":"F1Dh","./function/algebra/simplify":"yWjE","./function/algebra/rationalize":"xCNe","./function/algebra/slu":"h0vC","./function/algebra/usolve":"RXlV","./function/algebra/qr":"rUq2","./function/arithmetic/abs":"XkjO","./function/arithmetic/add":"k4Wb","./function/arithmetic/cbrt":"aoF1","./function/arithmetic/ceil":"z4It","./function/arithmetic/cube":"ruVI","./function/arithmetic/divide":"sbSk","./function/arithmetic/dotDivide":"hr3Z","./function/arithmetic/dotMultiply":"p0XP","./function/arithmetic/dotPow":"HDd7","./function/arithmetic/exp":"y0AC","./function/arithmetic/expm":"iddg","./function/arithmetic/expm1":"pk0d","./function/arithmetic/fix":"WGIH","./function/arithmetic/floor":"vXNc","./function/arithmetic/gcd":"dwcd","./function/arithmetic/hypot":"Vx3c","./function/arithmetic/lcm":"gaE4","./function/arithmetic/log":"vbjs","./function/arithmetic/log2":"XIlx","./function/arithmetic/log1p":"WGSj","./function/arithmetic/log10":"qxOp","./function/arithmetic/mod":"WNo3","./function/arithmetic/multiply":"rG0J","./function/arithmetic/norm":"av88","./function/arithmetic/nthRoot":"tPWr","./function/arithmetic/nthRoots":"Hwjx","./function/arithmetic/pow":"RTne","./function/arithmetic/round":"ayTa","./function/arithmetic/sign":"HnEg","./function/arithmetic/sqrt":"uX7J","./function/arithmetic/sqrtm":"MaXS","./function/arithmetic/square":"wa24","./function/arithmetic/subtract":"IpJ1","./function/arithmetic/unaryMinus":"zSOc","./function/arithmetic/unaryPlus":"hWWr","./function/arithmetic/xgcd":"LePI","./function/bitwise/bitAnd":"cry4","./function/bitwise/bitNot":"HcKC","./function/bitwise/bitOr":"ujKO","./function/bitwise/bitXor":"WecP","./function/bitwise/leftShift":"T9yh","./function/bitwise/rightArithShift":"ZNwk","./function/bitwise/rightLogShift":"XUC6","./function/combinatorics/bellNumbers":"a5Km","./function/combinatorics/catalan":"gEl1","./function/combinatorics/composition":"oDTX","./function/combinatorics/stirlingS2":"sdgX","./core/config":"DO71","./core/import":"ZwB0","./core/typed":"Shzo","./function/complex/arg":"DVdV","./function/complex/conj":"Wmy6","./function/complex/re":"zwHi","./function/complex/im":"QAET","./function/expression/eval":"bVEH","./function/expression/help":"Fax8","./function/geometry/distance":"dMW5","./function/geometry/intersect":"bVBO","./function/logical/and":"AWzT","./function/logical/not":"AWWa","./function/logical/or":"JhOe","./function/logical/xor":"JMRD","./function/matrix/column":"aMEf","./function/matrix/concat":"q0hB","./function/matrix/cross":"IWZn","./function/matrix/ctranspose":"nnFv","./function/matrix/det":"qD6G","./function/matrix/diag":"UQh1","./function/matrix/dot":"BlyW","./function/matrix/getMatrixDataType":"bnMU","./function/matrix/identity":"iJ3P","./function/matrix/filter":"CckY","./function/matrix/flatten":"UmBd","./function/matrix/forEach":"l4FK","./function/matrix/inv":"DDDN","./function/matrix/kron":"DU2x","./function/matrix/map":"oHAh","./function/matrix/ones":"fbw8","./function/matrix/partitionSelect":"fQm4","./function/matrix/range":"NLcZ","./function/matrix/resize":"tmIl","./function/matrix/reshape":"DOEY","./func
"use strict";var r=require("../../utils/collection/deepMap");function e(e,t,i,n){var o=i(require("../parse"));return n("compile",{string:function(r){return o(r).compile()},"Array | Matrix":function(e){return r(e,function(r){return o(r).compile()})}})}exports.name="compile",exports.factory=e;
},{"../../utils/collection/deepMap":"lOYo","../parse":"EUvE"}],"kgrW":[function(require,module,exports) {
"use strict";var r=require("../../utils/collection/deepMap");function e(e,t,n,i){var c=n(require("../parse"));return i("compile",{string:function(r){return c(r).compile().eval({})},"string, Object":function(r,e){return c(r).compile().eval(e)},"Array | Matrix":function(e){var t={};return r(e,function(r){return c(r).compile().eval(t)})},"Array | Matrix, Object":function(e,t){return r(e,function(r){return c(r).compile().eval(t)})}})}exports.name="eval",exports.factory=e;
},{"../../utils/collection/deepMap":"lOYo","../parse":"EUvE"}],"eMLC":[function(require,module,exports) {
"use strict";var r=require("../../utils/customs").getSafeProperty;function e(e,t,o,n,a){var i=o(require("../embeddedDocs"));return n("help",{any:function(t){var o,n=t;if("string"!=typeof t)for(o in a)if(a.hasOwnProperty(o)&&t===a[o]){n=o;break}var s=r(i,n);if(!s)throw new Error('No documentation found on "'+n+'"');return new e.Help(s)}})}exports.math=!0,exports.name="help",exports.factory=e;
},{"../../utils/customs":"PAPk","../embeddedDocs":"u4GE"}],"SQe8":[function(require,module,exports) {
"use strict";var e=require("../utils/object").extend,t=require("../utils/customs");function r(r,o,s,p,i){var n=s(require("./parse"));function c(){if(!(this instanceof c))throw new SyntaxError("Constructor must be called with the new operator");this.scope={}}return c.prototype.type="Parser",c.prototype.isParser=!0,c.prototype.parse=function(e){throw new Error("Parser.parse is deprecated. Use math.parse instead.")},c.prototype.compile=function(e){throw new Error("Parser.compile is deprecated. Use math.compile instead.")},c.prototype.eval=function(e){return n(e).compile().eval(this.scope)},c.prototype.get=function(e){return e in this.scope?t.getSafeProperty(this.scope,e):void 0},c.prototype.getAll=function(){return e({},this.scope)},c.prototype.set=function(e,r){return t.setSafeProperty(this.scope,e,r)},c.prototype.remove=function(e){delete this.scope[e]},c.prototype.clear=function(){for(var e in this.scope)this.scope.hasOwnProperty(e)&&delete this.scope[e]},c}exports.name="Parser",exports.path="expression",exports.factory=r,exports.math=!0;
},{"../utils/object":"FcSp","../utils/customs":"PAPk","./parse":"EUvE"}],"mLT7":[function(require,module,exports) {
"use strict";function r(r,e,t,n,s){var a=t(require("../Parser"));return n("parser",{"":function(){return new a(s)}})}exports.name="parser",exports.factory=r,exports.math=!0;
},{"../Parser":"SQe8"}],"bSaC":[function(require,module,exports) {
"use strict";module.exports=[require("./compile"),require("./eval"),require("./help"),require("./parse"),require("./parser")];
},{"./compile":"tSao","./eval":"kgrW","./help":"eMLC","./parse":"uJKc","./parser":"mLT7"}],"EsLR":[function(require,module,exports) {
"use strict";function e(e,t,o,r){return function(){throw new Error("UpdateNode is deprecated. Use AssignmentNode instead.")}}exports.name="UpdateNode",exports.path="expression.node",exports.factory=e;
},{}],"gbLV":[function(require,module,exports) {
"use strict";module.exports=[require("./AccessorNode"),require("./ArrayNode"),require("./AssignmentNode"),require("./BlockNode"),require("./ConditionalNode"),require("./ConstantNode"),require("./IndexNode"),require("./FunctionAssignmentNode"),require("./FunctionNode"),require("./Node"),require("./ObjectNode"),require("./OperatorNode"),require("./ParenthesisNode"),require("./RangeNode"),require("./RelationalNode"),require("./SymbolNode"),require("./UpdateNode")];
},{"./AccessorNode":"vZNf","./ArrayNode":"onTs","./AssignmentNode":"yw4P","./BlockNode":"QBkn","./ConditionalNode":"uzAW","./ConstantNode":"MNuy","./IndexNode":"SN5L","./FunctionAssignmentNode":"PrPs","./FunctionNode":"ZLEq","./Node":"dnbo","./ObjectNode":"UI2T","./OperatorNode":"F3sc","./ParenthesisNode":"Mj7c","./RangeNode":"tJPg","./RelationalNode":"E94o","./SymbolNode":"RtSa","./UpdateNode":"EsLR"}],"fYWL":[function(require,module,exports) {
"use strict";var r=require("./error.transform").transform;function t(t,a,e,n){var o=e(require("../../function/matrix/apply"));return n("apply",{"...any":function(a){var e=a[1];t.isNumber(e)?a[1]=e-1:t.isBigNumber(e)&&(a[1]=e.minus(1));try{return o.apply(null,a)}catch(n){throw r(n)}}})}exports.name="apply",exports.path="expression.transform",exports.factory=t;
},{"./error.transform":"Bjol","../../function/matrix/apply":"f9k3"}],"hFxa":[function(require,module,exports) {
"use strict";var r=require("./error.transform").transform;function t(t,n,e,o){var a=e(require("../../function/matrix/column"));return o("column",{"...any":function(n){var e=n.length-1,o=n[e];t.isNumber(o)&&(n[e]=o-1);try{return a.apply(null,n)}catch(u){throw r(u)}}})}exports.name="column",exports.path="expression.transform",exports.factory=t;
},{"./error.transform":"Bjol","../../function/matrix/column":"g7VB"}],"fUNc":[function(require,module,exports) {
"use strict";var r=require("./error.transform").transform;function t(t,n,e,a){var o=e(require("../../function/matrix/concat"));return a("concat",{"...any":function(n){var e=n.length-1,a=n[e];t.isNumber(a)?n[e]=a-1:t.isBigNumber(a)&&(n[e]=a.minus(1));try{return o.apply(null,n)}catch(c){throw r(c)}}})}exports.name="concat",exports.path="expression.transform",exports.factory=t;
},{"./error.transform":"Bjol","../../function/matrix/concat":"LXdZ"}],"yzMS":[function(require,module,exports) {
"use strict";function n(n,e,r,i){return function(e,r,i){var t=e.filter(function(e){return n.isSymbolNode(e)&&!(e.name in r)&&!(e.name in i)})[0];if(!t)throw new Error('No undefined variable found in inline expression "'+e+'"');var o=t.name,u=Object.create(i),a=e.compile();return function(n){return u[o]=n,a.eval(u)}}}exports.factory=n;
},{}],"Ozx7":[function(require,module,exports) {
"use strict";var r=require("../../utils/array").filter,t=require("../../utils/array").filterRegExp,e=require("../../utils/function").maxArgumentCount;function i(r,e,i,o){var u=i(require("./utils/compileInlineExpression")),a=i(require("../../type/matrix/function/matrix"));function s(t,e,i){var n,o;return t[0]&&(n=t[0].compile().eval(i)),t[1]&&(o=r.isSymbolNode(t[1])||r.isFunctionAssignmentNode(t[1])?t[1].compile().eval(i):u(t[1],e,i)),c(n,o)}s.rawArgs=!0;var c=o("filter",{"Array, function":n,"Matrix, function":function(r,t){return a(n(r.toArray(),t))},"Array, RegExp":t,"Matrix, RegExp":function(r,e){return a(t(r.toArray(),e))}});return c.toTex=void 0,s}function n(t,i){var n=e(i);return r(t,function(r,t,e){return 1===n?i(r):2===n?i(r,[t+1]):i(r,[t+1],e)})}exports.name="filter",exports.path="expression.transform",exports.factory=i;
},{"../../utils/array":"j2lF","../../utils/function":"woyg","./utils/compileInlineExpression":"yzMS","../../type/matrix/function/matrix":"vzj5"}],"YwEg":[function(require,module,exports) {
"use strict";var r=require("../../utils/function").maxArgumentCount,n=require("../../utils/array").forEach;function e(e,i,o,t){var a=o(require("./utils/compileInlineExpression"));function u(r,n,i){var o,t;return r[0]&&(o=r[0].compile().eval(i)),r[1]&&(t=e.isSymbolNode(r[1])||e.isFunctionAssignmentNode(r[1])?r[1].compile().eval(i):a(r[1],n,i)),s(o,t)}u.rawArgs=!0;var s=t("forEach",{"Array | Matrix, function":function(e,i){var o=r(i);!function r(t,a){Array.isArray(t)?n(t,function(n,e){r(n,a.concat(e+1))}):1===o?i(t):2===o?i(t,a):i(t,a,e)}(e.valueOf(),[])}});return u}exports.name="forEach",exports.path="expression.transform",exports.factory=e;
},{"../../utils/function":"woyg","../../utils/array":"j2lF","./utils/compileInlineExpression":"yzMS"}],"XTGQ":[function(require,module,exports) {
"use strict";function e(e,r,n){return function(){for(var r=[],n=0,t=arguments.length;n<t;n++){var i=arguments[n];if(e.isRange(i))i.start--,i.end-=i.step>0?0:2;else if(i&&!0===i.isSet)i=i.map(function(e){return e-1});else if(e.isArray(i)||e.isMatrix(i))i=i.map(function(e){return e-1});else if(e.isNumber(i))i--;else if(e.isBigNumber(i))i=i.toNumber()-1;else if("string"!=typeof i)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");r[n]=i}var s=new e.Index;return e.Index.apply(s,r),s}}exports.name="index",exports.path="expression.transform",exports.factory=e;
},{}],"nCs5":[function(require,module,exports) {
"use strict";var r=require("../../utils/function").maxArgumentCount,n=require("../../utils/array").map;function t(r,n,t,i){var u=t(require("./utils/compileInlineExpression")),o=t(require("../../type/matrix/function/matrix"));function a(n,t,e){var i,o;return n[0]&&(i=n[0].compile().eval(e)),n[1]&&(o=r.isSymbolNode(n[1])||r.isFunctionAssignmentNode(n[1])?n[1].compile().eval(e):u(n[1],t,e)),c(i,o)}a.rawArgs=!0;var c=i("map",{"Array, function":function(r,n){return e(r,n,r)},"Matrix, function":function(r,n){return o(e(r.valueOf(),n,r))}});return a}function e(t,e,i){var u=r(e);return function r(t,o){return Array.isArray(t)?n(t,function(n,t){return r(n,o.concat(t+1))}):1===u?e(t):2===u?e(t,o):e(t,o,i)}(t,[])}exports.name="map",exports.path="expression.transform",exports.factory=t;
},{"../../utils/function":"woyg","../../utils/array":"j2lF","./utils/compileInlineExpression":"yzMS","../../type/matrix/function/matrix":"vzj5"}],"NHP1":[function(require,module,exports) {
"use strict";var r=require("./error.transform").transform,t=require("../../utils/collection/isCollection");function e(e,i,n,s){var o=n(require("../../function/statistics/max"));return s("max",{"...any":function(i){if(2===i.length&&t(i[0])){var n=i[1];e.isNumber(n)?i[1]=n-1:e.isBigNumber(n)&&(i[1]=n.minus(1))}try{return o.apply(null,i)}catch(s){throw r(s)}}})}exports.name="max",exports.path="expression.transform",exports.factory=e;
},{"./error.transform":"Bjol","../../utils/collection/isCollection":"m4c0","../../function/statistics/max":"US8O"}],"nlKP":[function(require,module,exports) {
"use strict";var r=require("./error.transform").transform,t=require("../../utils/collection/isCollection");function e(e,n,i,s){var o=i(require("../../function/statistics/mean"));return s("mean",{"...any":function(n){if(2===n.length&&t(n[0])){var i=n[1];e.isNumber(i)?n[1]=i-1:e.isBigNumber(i)&&(n[1]=i.minus(1))}try{return o.apply(null,n)}catch(s){throw r(s)}}})}exports.name="mean",exports.path="expression.transform",exports.factory=e;
},{"./error.transform":"Bjol","../../utils/collection/isCollection":"m4c0","../../function/statistics/mean":"WyK1"}],"cpNx":[function(require,module,exports) {
"use strict";var r=require("./error.transform").transform,t=require("../../utils/collection/isCollection");function i(i,n,e,s){var o=e(require("../../function/statistics/min"));return s("min",{"...any":function(n){if(2===n.length&&t(n[0])){var e=n[1];i.isNumber(e)?n[1]=e-1:i.isBigNumber(e)&&(n[1]=e.minus(1))}try{return o.apply(null,n)}catch(s){throw r(s)}}})}exports.name="min",exports.path="expression.transform",exports.factory=i;
},{"./error.transform":"Bjol","../../utils/collection/isCollection":"m4c0","../../function/statistics/min":"VKqc"}],"NRUm":[function(require,module,exports) {
"use strict";function r(r,n,e,t){var a=e(require("../../function/matrix/range"));return t("range",{"...any":function(r){return"boolean"!=typeof r[r.length-1]&&r.push(!0),a.apply(null,r)}})}exports.name="range",exports.path="expression.transform",exports.factory=r;
},{"../../function/matrix/range":"lueR"}],"tHFG":[function(require,module,exports) {
"use strict";var r=require("./error.transform").transform,t=require("../../utils/collection/isCollection");function e(e,s,i,n){var o=i(require("../../function/statistics/std"));return n("std",{"...any":function(s){if(s.length>=2&&t(s[0])){var i=s[1];e.isNumber(i)?s[1]=i-1:e.isBigNumber(i)&&(s[1]=i.minus(1))}try{return o.apply(null,s)}catch(n){throw r(n)}}})}exports.name="std",exports.path="expression.transform",exports.factory=e;
},{"./error.transform":"Bjol","../../utils/collection/isCollection":"m4c0","../../function/statistics/std":"hFUZ"}],"fCpa":[function(require,module,exports) {
"use strict";var r=require("./error.transform").transform;function t(t,e,n,o){var a=n(require("../../function/matrix/row"));return o("row",{"...any":function(e){var n=e.length-1,o=e[n];t.isNumber(o)&&(e[n]=o-1);try{return a.apply(null,e)}catch(s){throw r(s)}}})}exports.name="row",exports.path="expression.transform",exports.factory=t;
},{"./error.transform":"Bjol","../../function/matrix/row":"eLyh"}],"XVBF":[function(require,module,exports) {
"use strict";var r=require("./error.transform").transform;function t(t,e,s,n){var o=s(require("../../function/matrix/subset"));return n("subset",{"...any":function(t){try{return o.apply(null,t)}catch(e){throw r(e)}}})}exports.name="subset",exports.path="expression.transform",exports.factory=t;
},{"./error.transform":"Bjol","../../function/matrix/subset":"ZWbZ"}],"vC3z":[function(require,module,exports) {
"use strict";var r=require("./error.transform").transform,t=require("../../utils/collection/isCollection");function e(e,s,i,n){var o=i(require("../../function/statistics/sum"));return n("sum",{"...any":function(s){if(2===s.length&&t(s[0])){var i=s[1];e.isNumber(i)?s[1]=i-1:e.isBigNumber(i)&&(s[1]=i.minus(1))}try{return o.apply(null,s)}catch(n){throw r(n)}}})}exports.name="sum",exports.path="expression.transform",exports.factory=e;
},{"./error.transform":"Bjol","../../utils/collection/isCollection":"m4c0","../../function/statistics/sum":"y9hQ"}],"d6Xr":[function(require,module,exports) {
"use strict";var r=require("./error.transform").transform,t=require("../../utils/collection/isCollection");function e(e,i,n,s){var o=n(require("../../function/statistics/var"));return s("var",{"...any":function(i){if(i.length>=2&&t(i[0])){var n=i[1];e.isNumber(n)?i[1]=n-1:e.isBigNumber(n)&&(i[1]=n.minus(1))}try{return o.apply(null,i)}catch(s){throw r(s)}}})}exports.name="var",exports.path="expression.transform",exports.factory=e;
},{"./error.transform":"Bjol","../../utils/collection/isCollection":"m4c0","../../function/statistics/var":"ujYK"}],"mXCx":[function(require,module,exports) {
"use strict";module.exports=[require("./apply.transform"),require("./column.transform"),require("./concat.transform"),require("./filter.transform"),require("./forEach.transform"),require("./index.transform"),require("./map.transform"),require("./max.transform"),require("./mean.transform"),require("./min.transform"),require("./range.transform"),require("./std.transform"),require("./row.transform"),require("./subset.transform"),require("./sum.transform"),require("./var.transform")];
},{"./apply.transform":"fYWL","./column.transform":"hFxa","./concat.transform":"fUNc","./filter.transform":"Ozx7","./forEach.transform":"YwEg","./index.transform":"XTGQ","./map.transform":"nCs5","./max.transform":"NHP1","./mean.transform":"nlKP","./min.transform":"cpNx","./range.transform":"NRUm","./std.transform":"tHFG","./row.transform":"fCpa","./subset.transform":"XVBF","./sum.transform":"vC3z","./var.transform":"d6Xr"}],"SNFv":[function(require,module,exports) {
"use strict";var t=require("../utils/object"),e=require("../utils/string");function r(r,n,o,i){var a=o(require("./function/parser"))();function s(t){if(!(this instanceof s))throw new SyntaxError("Constructor must be called with the new operator");if(!t)throw new Error('Argument "doc" missing');this.doc=t}return s.prototype.type="Help",s.prototype.isHelp=!0,s.prototype.toString=function(){var t=this.doc||{},n="\n";if(t.name&&(n+="Name: "+t.name+"\n\n"),t.category&&(n+="Category: "+t.category+"\n\n"),t.description&&(n+="Description:\n "+t.description+"\n\n"),t.syntax&&(n+="Syntax:\n "+t.syntax.join("\n ")+"\n\n"),t.examples){n+="Examples:\n";for(var o=0;o<t.examples.length;o++){var i=t.examples[o];n+=" "+i+"\n";var s=void 0;try{s=a.eval(i)}catch(p){s=p}void 0===s||r.isHelp(s)||(n+=" "+e.format(s,{precision:14})+"\n")}n+="\n"}return t.seealso&&t.seealso.length&&(n+="See also: "+t.seealso.join(", ")+"\n"),n},s.prototype.toJSON=function(){var e=t.clone(this.doc);return e.mathjs="Help",e},s.fromJSON=function(t){var e={};for(var r in t)"mathjs"!==r&&(e[r]=t[r]);return new s(e)},s.prototype.valueOf=s.prototype.toString,s}exports.name="Help",exports.path="type",exports.factory=r;
},{"../utils/object":"FcSp","../utils/string":"PshC","./function/parser":"mLT7"}],"xTTM":[function(require,module,exports) {
"use strict";module.exports=[require("./embeddedDocs"),require("./function"),require("./node"),require("./transform"),require("./Help"),require("./parse"),require("./Parser")];
},{"./embeddedDocs":"u4GE","./function":"bSaC","./node":"gbLV","./transform":"mXCx","./Help":"SNFv","./parse":"EUvE","./Parser":"SQe8"}],"aE4P":[function(require,module,exports) {
"use strict";function r(r,t,e,o,n){return function(t,e){var o=r[e&&e.mathjs]||n.expression&&n.expression.node[e&&e.mathjs];return o&&"function"==typeof o.fromJSON?o.fromJSON(e):e}}exports.name="reviver",exports.path="json",exports.factory=r,exports.math=!0;
},{}],"KEFM":[function(require,module,exports) {
"use strict";module.exports=[require("./reviver")];
},{"./reviver":"aE4P"}],"zqj8":[function(require,module,exports) {
"use strict";var r=require("./ArgumentsError"),e=require("./DimensionError"),n=require("./IndexError");module.exports=[{name:"ArgumentsError",path:"error",factory:function(){return r}},{name:"DimensionError",path:"error",factory:function(){return e}},{name:"IndexError",path:"error",factory:function(){return n}}];
},{"./ArgumentsError":"h0xI","./DimensionError":"YiAw","./IndexError":"tfOV"}],"pq5F":[function(require,module,exports) {
"use strict";module.exports=[require("./type"),require("./constants"),require("./function"),require("./expression"),require("./json"),require("./error")];
},{"./type":"And3","./constants":"GTWZ","./function":"wKfj","./expression":"xTTM","./json":"KEFM","./error":"zqj8"}],"HZcI":[function(require,module,exports) {
"use strict";var e=require("./core/core");function r(t){var c=e.create(t);return c.create=r,c.import(require("./index")),c}module.exports=r();
},{"./core/core":"MP6P","./index":"pq5F"}],"PI51":[function(require,module,exports) {
module.exports=require("./lib/main");
},{"./lib/main":"HZcI"}],"Tiv2":[function(require,module,exports) {
var r=require("mathjs");function e(e){return JSON.parse(JSON.stringify(r.parse(e)))}module.exports={parseMath:e};
},{"mathjs":"PI51"}],"SRZe":[function(require,module,exports) {
"use strict";function r(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var e=require("rescript/lib/js/curry.js"),t=require("rescript/lib/js/js_exn.js"),a=require("../utility/E.bs.js"),s=require("./MathjsWrapper.js"),i=require("rescript/lib/js/caml_js_exceptions.js");function n(r){return s.parseMath(r)}function o(n){var o;try{o=s.parseMath(n)}catch(c){var u=i.internalToOCamlException(c);return u.RE_EXN_ID===t.$$Error?r({TAG:1,_0:e._2(a.O.$$default,"MathJS Parse Error",u._1.message)},Symbol.for("name"),"Error"):r({TAG:1,_0:"MathJS Parse Error"},Symbol.for("name"),"Error")}return r({TAG:0,_0:o},Symbol.for("name"),"Ok")}exports.parseMathExt=n,exports.parseMath=o;
},{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/js_exn.js":"XrLb","../utility/E.bs.js":"xX5m","./MathjsWrapper.js":"Tiv2","rescript/lib/js/caml_js_exceptions.js":"yO2E"}],"dGOd":[function(require,module,exports) {
"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(e)}function e(r,e,n){return e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}var n=require("rescript/lib/js/curry.js"),t=require("rescript/lib/js/js_dict.js"),o=require("rescript/lib/js/belt_Array.js"),a=require("@glennsl/bs-json/src/Json_decode.bs.js"),i=require("../utility/E.bs.js"),s=require("./Mathjs.bs.js");function u(r){var o=a.field("mathjs",a.string,r);switch(o){case"ArrayNode":var s=a.field("items",function(r){return a.array(u,r)},r);return e({TAG:3,_0:n._1(i.A.O.concatSomes,s)},Symbol.for("name"),"Array");case"AssignmentNode":var m=a.field("object",u,r),l=a.field("value",u,r);return void 0!==m&&void 0!==l?e({TAG:6,_0:m,_1:l},Symbol.for("name"),"Assignment"):void 0;case"BlockNode":var f=function(r){return a.field("node",u,r)};return e({TAG:4,_0:n._1(i.A.O.concatSomes,a.field("blocks",function(r){return a.array(f,r)},r))},Symbol.for("name"),"Blocks");case"ConstantNode":return n._2(i.O.fmap,function(r){return e({TAG:1,_0:r},Symbol.for("name"),"Value")},a.optional(function(r){return a.field("value",a.$$float,r)},r));case"FunctionAssignmentNode":var c=a.field("name",a.string,r),A=a.field("params",function(r){return a.array(function(r){return a.field("name",a.string,r)},r)},r),b=a.field("expr",u,r);return n._2(i.O.fmap,function(r){return e({TAG:7,_0:{name:c,args:A,expression:r}},Symbol.for("name"),"FunctionAssignment")},b);case"FunctionNode":var _=a.field("args",function(r){return a.array(u,r)},r),d=a.optional(function(r){return a.field("fn",function(r){return a.field("name",a.string,r)},r)},r);return n._2(i.O.fmap,function(r){return e({TAG:2,_0:{name:r,args:n._1(i.A.O.concatSomes,_)}},Symbol.for("name"),"Fn")},d);case"ObjectNode":var y=a.field("properties",function(r){return a.dict(u,r)},r);return e({TAG:5,_0:t.fromArray(n._1(i.A.O.concatSomes,n._2(i.A.fmap,function(r){var e=r[0];return n._2(i.O.fmap,function(r){return[e,r]},r[1])},t.entries(y))))},Symbol.for("name"),"Object");case"OperatorNode":var T=a.field("args",function(r){return a.array(u,r)},r);return e({TAG:2,_0:{name:a.field("fn",a.string,r),args:n._1(i.A.O.concatSomes,T)}},Symbol.for("name"),"Fn");case"ParenthesisNode":return a.field("content",u,r);case"SymbolNode":return e({TAG:0,_0:a.field("name",a.string,r)},Symbol.for("name"),"Symbol");default:return void console.log("Couldn't parse mathjs node",r,o)}}var m={run:u};function l(r){return e({TAG:0,_0:{NAME:"Symbol",VAL:r}},Symbol.for("name"),"Ok")}function f(r,e){switch(e){case"B":return 1e9*r;case"K":return 1e3*r;case"M":return 1e6*r;case"T":return 1e12*r;default:return}}function c(r){switch(0|r.TAG){case 0:return e({TAG:0,_0:r._0},Symbol.for("name"),"Symbol");case 1:return e({TAG:1,_0:r._0},Symbol.for("name"),"Value");case 2:var o=r._0,a=o.name;switch(a){case"multiply":var s=o.args;if(2===s.length){var u=s[0];if(1===u.TAG){var m=s[1];if(0===m.TAG)return n._2(i.O.$$default,r,n._2(i.O.fmap,function(r){return e({TAG:1,_0:r},Symbol.for("name"),"Value")},f(u._0,m._0)))}}break;case"unaryMinus":var l=o.args;if(1===l.length){var A=l[0];if(1===A.TAG)return e({TAG:1,_0:-1*A._0},Symbol.for("name"),"Value")}}return e({TAG:2,_0:{name:a,args:n._2(i.A.fmap,c,o.args)}},Symbol.for("name"),"Fn");case 3:return e({TAG:3,_0:n._2(i.A.fmap,c,r._0)},Symbol.for("name"),"Array");case 4:return e({TAG:4,_0:n._2(i.A.fmap,c,r._0)},Symbol.for("name"),"Blocks");case 5:return e({TAG:5,_0:t.fromArray(n._2(i.A.fmap,function(r){return[r[0],c(r[1])]},t.entries(r._0)))},Symbol.for("name"),"Object");case 6:return e({TAG:6,_0:r._0,_1:c(r._1)},Symbol.for("name"),"Assignment");case 7:return e({TAG:7,_0:r._0},Symbol.for("name"),"FunctionAssignment")}}var A={transformWithSymbol:f,run:c};function b(r,o,a){if(1===r.length){var s=r[0];if(5===s.TAG){var u=s._0,m=function(r){var e=i.O.toResult("Variable was empty",t.get(u,r));return n._2(i.R.bind,e,a)},l=m("mean"),f=m("s
},{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/js_dict.js":"GWKE","rescript/lib/js/belt_Array.js":"yUxI","@glennsl/bs-json/src/Json_decode.bs.js":"kurU","../utility/E.bs.js":"xX5m","./Mathjs.bs.js":"SRZe"}],"AuT8":[function(require,module,exports) {
var define;
var n;!function(r,t){"object"==typeof exports?module.exports=t():"function"==typeof n&&n.amd?n(t):r.jStat=t()}(this,function(){var n=function(n,r){var t=Array.prototype.concat,e=Array.prototype.slice,o=Object.prototype.toString;function a(r,t){var e=r>t?r:t;return n.pow(10,17-~~(n.log(e>0?e:-e)*n.LOG10E))}var u=Array.isArray||function(n){return"[object Array]"===o.call(n)};function i(n){return"[object Function]"===o.call(n)}function f(n){return"number"==typeof n&&n-n==0}function c(){return new c._init(arguments)}function l(){return 0}function s(){return 1}function m(n,r){return n===r?1:0}c.fn=c.prototype,c._init=function(n){if(u(n[0]))if(u(n[0][0])){i(n[1])&&(n[0]=c.map(n[0],n[1]));for(var r=0;r<n[0].length;r++)this[r]=n[0][r];this.length=n[0].length}else this[0]=i(n[1])?c.map(n[0],n[1]):n[0],this.length=1;else if(f(n[0]))this[0]=c.seq.apply(null,n),this.length=1;else{if(n[0]instanceof c)return c(n[0].toArray());this[0]=[],this.length=1}return this},c._init.prototype=c.prototype,c._init.constructor=c,c.utils={calcRdx:a,isArray:u,isFunction:i,isNumber:f,toVector:function(n){return t.apply([],n)}},c._random_fn=n.random,c.setRandom=function(n){if("function"!=typeof n)throw new TypeError("fn is not a function");c._random_fn=n},c.extend=function(n){var r,t;if(1===arguments.length){for(t in n)c[t]=n[t];return this}for(r=1;r<arguments.length;r++)for(t in arguments[r])n[t]=arguments[r][t];return n},c.rows=function(n){return n.length||1},c.cols=function(n){return n[0].length||1},c.dimensions=function(n){return{rows:c.rows(n),cols:c.cols(n)}},c.row=function(n,r){return u(r)?r.map(function(r){return c.row(n,r)}):n[r]},c.rowa=function(n,r){return c.row(n,r)},c.col=function(n,r){if(u(r)){var t=c.arange(n.length).map(function(){return new Array(r.length)});return r.forEach(function(r,e){c.arange(n.length).forEach(function(o){t[o][e]=n[o][r]})}),t}for(var e=new Array(n.length),o=0;o<n.length;o++)e[o]=[n[o][r]];return e},c.cola=function(n,r){return c.col(n,r).map(function(n){return n[0]})},c.diag=function(n){for(var r=c.rows(n),t=new Array(r),e=0;e<r;e++)t[e]=[n[e][e]];return t},c.antidiag=function(n){for(var r=c.rows(n)-1,t=new Array(r),e=0;r>=0;r--,e++)t[e]=[n[e][r]];return t},c.transpose=function(n){var r,t,e,o,a,i=[];for(u(n[0])||(n=[n]),t=n.length,e=n[0].length,a=0;a<e;a++){for(r=new Array(t),o=0;o<t;o++)r[o]=n[o][a];i.push(r)}return 1===i.length?i[0]:i},c.map=function(n,r,t){var e,o,a,i,f;for(u(n[0])||(n=[n]),o=n.length,a=n[0].length,i=t?n:new Array(o),e=0;e<o;e++)for(i[e]||(i[e]=new Array(a)),f=0;f<a;f++)i[e][f]=r(n[e][f],e,f);return 1===i.length?i[0]:i},c.cumreduce=function(n,r,t){var e,o,a,i,f;for(u(n[0])||(n=[n]),o=n.length,a=n[0].length,i=t?n:new Array(o),e=0;e<o;e++)for(i[e]||(i[e]=new Array(a)),a>0&&(i[e][0]=n[e][0]),f=1;f<a;f++)i[e][f]=r(i[e][f-1],n[e][f]);return 1===i.length?i[0]:i},c.alter=function(n,r){return c.map(n,r,!0)},c.create=function(n,r,t){var e,o,a=new Array(n);for(i(r)&&(t=r,r=n),e=0;e<n;e++)for(a[e]=new Array(r),o=0;o<r;o++)a[e][o]=t(e,o);return a},c.zeros=function(n,r){return f(r)||(r=n),c.create(n,r,l)},c.ones=function(n,r){return f(r)||(r=n),c.create(n,r,s)},c.rand=function(n,r){return f(r)||(r=n),c.create(n,r,c._random_fn)},c.identity=function(n,r){return f(r)||(r=n),c.create(n,r,m)},c.symmetric=function(n){var r,t,e=n.length;if(n.length!==n[0].length)return!1;for(r=0;r<e;r++)for(t=0;t<e;t++)if(n[t][r]!==n[r][t])return!1;return!0},c.clear=function(n){return c.alter(n,l)},c.seq=function(n,r,t,e){i(e)||(e=!1);var o,u=[],f=a(n,r),c=(r*f-n*f)/((t-1)*f),l=n;for(o=0;l<=r&&o<t;l=(n*f+c*f*++o)/f)u.push(e?e(l,o):l);return u},c.arange=function(n,t,e){var o,a=[];if(e=e||1,t===r&&(t=n,n=0),n===t||0===e)return[];if(n<t&&e<0)return[];if(n>t&&e>0)return[];if(e>0)for(o=n;o<t;o+=e)a.push(o);else for(o=n;o>t;o+=e)a.push(o);return a},c.slice=function(){function n(n,t,e,o){var a,u=[],i=n.length;if(t===r&&e===r&&o===r)return c.copy(n);if(o=o||1,(t=(t=t||0)>=0?t:i+t)===(e=(e=e||n.length)>=0?e:i+e)||0===o)return[];if(t<e&&o<0)return[];if(t>e&&o>0)return[];if(o>0)for(a=t;a<e;a+=o)u.push(n[a]);else for(a=t;a>e;a+=o)u.push(n[a])
},{}],"wl7Z":[function(require,module,exports) {
"use strict";function n(r){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(r)}function r(n,r,t){return r in n?Object.defineProperty(n,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[r]=t,n}var t=require("rescript/lib/js/caml.js"),o=require("rescript/lib/js/curry.js"),e=require("jstat"),a=require("rescript/lib/js/belt_Array.js"),i=require("rescript/lib/js/pervasives.js"),u=require("../utility/E.bs.js"),l=require("../distribution/Discrete.bs.js"),m=require("../expressionTree/Operation.bs.js"),f=require("../distribution/Continuous.bs.js");function c(n){return{NAME:"Exponential",VAL:{rate:n}}}function A(n,r){return e.exponential.pdf(n,r.rate)}function s(n,r){return e.exponential.cdf(n,r.rate)}function L(n,r){return e.exponential.inv(n,r.rate)}function p(n){return e.exponential.sample(n.rate)}function V(n){return r({TAG:0,_0:e.exponential.mean(n.rate)},Symbol.for("name"),"Ok")}function d(n){return"Exponential("+n.rate+")"}var g={make:c,pdf:A,cdf:s,inv:L,sample:p,mean:V,toString:d};function h(n,r){return{NAME:"Cauchy",VAL:{local:n,scale:r}}}function v(n,r){return e.cauchy.pdf(n,r.local,r.scale)}function b(n,r){return e.cauchy.cdf(n,r.local,r.scale)}function y(n,r){return e.cauchy.inv(n,r.local,r.scale)}function N(n){return e.cauchy.sample(n.local,n.scale)}function M(n){return r({TAG:1,_0:"Cauchy distributions have no mean value."},Symbol.for("name"),"Error")}function E(n){return"Cauchy("+n.local+", "+n.scale+")"}var S={make:h,pdf:v,cdf:b,inv:y,sample:N,mean:M,toString:E};function w(n,t,o){return n<t&&t<o?r({TAG:0,_0:{NAME:"Triangular",VAL:{low:n,medium:t,high:o}}},Symbol.for("name"),"Ok"):r({TAG:1,_0:"Triangular values must be increasing order"},Symbol.for("name"),"Error")}function _(n,r){return e.triangular.pdf(n,r.low,r.high,r.medium)}function x(n,r){return e.triangular.cdf(n,r.low,r.high,r.medium)}function T(n,r){return e.triangular.inv(n,r.low,r.high,r.medium)}function k(n){return e.triangular.sample(n.low,n.high,n.medium)}function j(n){return r({TAG:0,_0:e.triangular.mean(n.low,n.high,n.medium)},Symbol.for("name"),"Ok")}function C(n){return"Triangular("+n.low+", "+n.medium+", "+n.high+")"}var F={make:w,pdf:_,cdf:x,inv:T,sample:k,mean:j,toString:C};function G(n,r){return{NAME:"Normal",VAL:{mean:n,stdev:r}}}function O(n,r){return e.normal.pdf(n,r.mean,r.stdev)}function B(n,r){return e.normal.cdf(n,r.mean,r.stdev)}function q(n,r){return{NAME:"Normal",VAL:{mean:o._1(u.A.Floats.mean,[n,r]),stdev:(r-n)/3.289708}}}function U(n,r){return e.normal.inv(n,r.mean,r.stdev)}function P(n){return e.normal.sample(n.mean,n.stdev)}function $(n){return r({TAG:0,_0:e.normal.mean(n.mean,n.stdev)},Symbol.for("name"),"Ok")}function D(n){return"Normal("+n.mean+","+n.stdev+")"}function I(n,r){return{NAME:"Normal",VAL:{mean:n.mean+r.mean,stdev:Math.sqrt(Math.pow(n.stdev,2)+Math.pow(r.stdev,2))}}}function W(n,r){return{NAME:"Normal",VAL:{mean:n.mean-r.mean,stdev:Math.sqrt(Math.pow(n.stdev,2)+Math.pow(r.stdev,2))}}}function X(n,r){return{NAME:"Normal",VAL:{mean:(n.mean*Math.pow(r.stdev,2)+r.mean*Math.pow(n.stdev,2))/(Math.pow(n.stdev,2)+Math.pow(r.stdev,2)),stdev:1/(1/Math.pow(n.stdev,2)+1/Math.pow(r.stdev,2))}}}function z(n,r,t){return"Subtract"===n?W(r,t):"Add"===n?I(r,t):void 0}var H={make:G,pdf:O,cdf:B,from90PercentCI:q,inv:U,sample:P,mean:$,toString:D,add:I,subtract:W,pointwiseProduct:X,operate:z};function J(n,r){return{NAME:"Beta",VAL:{alpha:n,beta:r}}}function K(n,r){return e.beta.pdf(n,r.alpha,r.beta)}function Q(n,r){return e.beta.cdf(n,r.alpha,r.beta)}function R(n,r){return e.beta.inv(n,r.alpha,r.beta)}function Y(n){return e.beta.sample(n.alpha,n.beta)}function Z(n){return r({TAG:0,_0:e.beta.mean(n.alpha,n.beta)},Symbol.for("name"),"Ok")}function nn(n){return"Beta("+n.alpha+","+n.beta+")"}var rn={make:J,pdf:K,cdf:Q,inv:R,sample:Y,mean:Z,toString:nn};function tn(n,r){return{NAME:"Lognormal",VAL:{mu:n,sigma:r}}}function on(n,r){return e.lognormal.pdf(n,r.mu,r.sigma)}functi
},{"rescript/lib/js/caml.js":"gGFE","rescript/lib/js/curry.js":"NSLD","jstat":"AuT8","rescript/lib/js/belt_Array.js":"yUxI","rescript/lib/js/pervasives.js":"z22f","../utility/E.bs.js":"xX5m","../distribution/Discrete.bs.js":"Ms6F","../expressionTree/Operation.bs.js":"S4ET","../distribution/Continuous.bs.js":"CVcq"}],"wUHb":[function(require,module,exports) {
"use strict";var n=module.exports;module.exports.isNumber=function(n){return"number"==typeof n},module.exports.findMin=function(n){if(0===n.length)return 1/0;for(var t=n[0],r=1;r<n.length;r++)t=Math.min(t,n[r]);return t},module.exports.findMax=function(n){if(0===n.length)return-1/0;for(var t=n[0],r=1;r<n.length;r++)t=Math.max(t,n[r]);return t},module.exports.findMinMulti=function(t){for(var r=n.findMin(t[0]),e=1;e<t.length;e++)r=Math.min(r,n.findMin(t[e]));return r},module.exports.findMaxMulti=function(t){for(var r=n.findMax(t[0]),e=1;e<t.length;e++)r=Math.max(r,n.findMax(t[e]));return r},module.exports.inside=function(n,t,r){return n<=r&&r<=t};
},{}],"fFBv":[function(require,module,exports) {
"use strict";var i=50,e=2,t=Math.log(2),n=module.exports,r=require("./helper");function u(i){return 1-Math.abs(i)}function a(i,e){for(var t={},n=0,r=-e;r<=e;r++)n+=i(r/e),t[r]=n;return t}module.exports.getUnifiedMinMax=function(i,e){return n.getUnifiedMinMaxMulti([i],e)},module.exports.getUnifiedMinMaxMulti=function(t,n){n=n||{};var u=!1,a=!1,o=r.isNumber(n.width)?n.width:e,f=r.isNumber(n.size)?n.size:i,h=r.isNumber(n.min)?n.min:(u=!0,r.findMinMulti(t)),m=r.isNumber(n.max)?n.max:(a=!0,r.findMaxMulti(t)),l=(m-h)/(f-1);return u&&(h-=2*o*l),a&&(m+=2*o*l),{min:h,max:m}},module.exports.create=function(t,o){if(o=o||{},!t||0===t.length)return[];var f=r.isNumber(o.size)?o.size:i,h=r.isNumber(o.width)?o.width:e,m=n.getUnifiedMinMax(t,{size:f,width:h,min:o.min,max:o.max}),l=m.min,s=m.max-l,x=s/(f-1);if(0===s)return[{x:l,y:1}];for(var d=[],c=0;c<f;c++)d.push({x:l+c*x,y:0});var M=a(u,h),g=M[h],v=M[h-1]-M[h-2],y=0;t.forEach(function(i){var e=function(i){return Math.floor((i-l)/x)}(i);if(!(e+h<0||e-h>=d.length)){var t=Math.max(e-h,0),n=e,u=Math.min(e+h,d.length-1),a=t-(e-h),o=e+h-u,f=M[-h-1+a]||0,m=M[-h-1+o]||0,s=g/(g-f-m);a>0&&(y+=s*(a-1)*v);var c=Math.max(0,e-h+1);r.inside(0,d.length-1,c)&&(d[c].y+=1*s*v),r.inside(0,d.length-1,n+1)&&(d[n+1].y-=2*s*v),r.inside(0,d.length-1,u+1)&&(d[u+1].y+=1*s*v)}});var p=y,b=0,w=0;return d.forEach(function(i){b+=i.y,p+=b,i.y=p,w+=p}),w>0&&d.forEach(function(i){i.y/=w}),d},module.exports.getExpectedValueFromPdf=function(i){if(i&&0!==i.length){var e=0;return i.forEach(function(i){e+=i.x*i.y}),e}},module.exports.getXWithLeftTailArea=function(i,e){if(i&&0!==i.length){for(var t=0,n=0,r=0;r<i.length&&(n=r,!((t+=i[r].y)>=e));r++);return i[n].x}},module.exports.getPerplexity=function(i){if(i&&0!==i.length){var e=0;return i.forEach(function(i){var t=Math.log(i.y);isFinite(t)&&(e+=i.y*t)}),e=-e/t,Math.pow(2,e)}};
},{"./helper":"wUHb"}],"XPlA":[function(require,module,exports) {
"use strict";exports.byteLength=u,exports.toByteArray=i,exports.fromByteArray=d;for(var r=[],t=[],e="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],t[n.charCodeAt(o)]=o;function h(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function u(r){var t=h(r),e=t[0],n=t[1];return 3*(e+n)/4-n}function c(r,t,e){return 3*(t+e)/4-e}function i(r){var n,o,a=h(r),u=a[0],i=a[1],f=new e(c(r,u,i)),A=0,d=i>0?u-4:u;for(o=0;o<d;o+=4)n=t[r.charCodeAt(o)]<<18|t[r.charCodeAt(o+1)]<<12|t[r.charCodeAt(o+2)]<<6|t[r.charCodeAt(o+3)],f[A++]=n>>16&255,f[A++]=n>>8&255,f[A++]=255&n;return 2===i&&(n=t[r.charCodeAt(o)]<<2|t[r.charCodeAt(o+1)]>>4,f[A++]=255&n),1===i&&(n=t[r.charCodeAt(o)]<<10|t[r.charCodeAt(o+1)]<<4|t[r.charCodeAt(o+2)]>>2,f[A++]=n>>8&255,f[A++]=255&n),f}function f(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function A(r,t,e){for(var n,o=[],a=t;a<e;a+=3)n=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(255&r[a+2]),o.push(f(n));return o.join("")}function d(t){for(var e,n=t.length,o=n%3,a=[],h=0,u=n-o;h<u;h+=16383)a.push(A(t,h,h+16383>u?u:h+16383));return 1===o?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63;
},{}],"EEnl":[function(require,module,exports) {
exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};
},{}],"ZCp3":[function(require,module,exports) {
var r={}.toString;module.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)};
},{}],"VjIL":[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3],r=require("base64-js"),e=require("ieee754"),n=require("isarray");function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(r){return!1}}function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=f.prototype:(null===t&&(t=new f(r)),t.length=r),t}function f(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,r,e)}function s(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?g(t,r,e,n):"string"==typeof r?l(t,r,e):y(t,r)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function a(t,r,e,n){return h(r),r<=0?u(t,r):void 0!==e?"string"==typeof n?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}function c(t,r){if(h(r),t=u(t,r<0?0:0|w(r)),!f.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function l(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(r,e),i=(t=u(t,n)).write(r,e);return i!==n&&(t=t.slice(0,i)),t}function p(t,r){var e=r.length<0?0:0|w(r.length);t=u(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function g(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r).__proto__=f.prototype:t=p(t,r),t}function y(t,r){if(f.isBuffer(r)){var e=0|w(r.length);return 0===(t=u(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||W(r.length)?u(t,0):p(t,r);if("Buffer"===r.type&&n(r.data))return p(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function w(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),f.alloc(+t)}function v(t,r){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return K(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}function E(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,r,e);case"utf8":case"utf-8":return Y(this,r,e);case"ascii":return L(this,r,e);case"latin1":case"binary":return D(this,r,e);case"base64":return S(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function R(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=f.from(r,n)),f.
},{"base64-js":"XPlA","ieee754":"EEnl","isarray":"ZCp3","buffer":"VjIL"}],"hKJs":[function(require,module,exports) {
var global = arguments[3];
var Buffer = require("buffer").Buffer;
var define;
var n,t=arguments[3],r=require("buffer").Buffer;(function(){var r,e=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",o="__lodash_hash_undefined__",f=500,a="__lodash_placeholder__",c=1,l=2,s=4,h=1,p=2,v=1,_=2,g=4,y=8,d=16,b=32,w=64,m=128,x=256,j=512,A=30,k="...",O=800,I=16,R=1,E=2,z=1/0,S=9007199254740991,L=1.7976931348623157e308,W=NaN,C=4294967295,B=C-1,U=C>>>1,T=[["ary",m],["bind",v],["bindKey",_],["curry",y],["curryRight",d],["flip",j],["partial",b],["partialRight",w],["rearg",x]],$="[object Arguments]",D="[object Array]",M="[object AsyncFunction]",F="[object Boolean]",N="[object Date]",P="[object DOMException]",q="[object Error]",Z="[object Function]",K="[object GeneratorFunction]",V="[object Map]",G="[object Number]",H="[object Null]",J="[object Object]",Y="[object Proxy]",Q="[object RegExp]",X="[object Set]",nn="[object String]",tn="[object Symbol]",rn="[object Undefined]",en="[object WeakMap]",un="[object WeakSet]",on="[object ArrayBuffer]",fn="[object DataView]",an="[object Float32Array]",cn="[object Float64Array]",ln="[object Int8Array]",sn="[object Int16Array]",hn="[object Int32Array]",pn="[object Uint8Array]",vn="[object Uint8ClampedArray]",_n="[object Uint16Array]",gn="[object Uint32Array]",yn=/\b__p \+= '';/g,dn=/\b(__p \+=) '' \+/g,bn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wn=/&(?:amp|lt|gt|quot|#39);/g,mn=/[&<>"']/g,xn=RegExp(wn.source),jn=RegExp(mn.source),An=/<%-([\s\S]+?)%>/g,kn=/<%([\s\S]+?)%>/g,On=/<%=([\s\S]+?)%>/g,In=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Rn=/^\w*$/,En=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zn=/[\\^$.*+?()[\]{}|]/g,Sn=RegExp(zn.source),Ln=/^\s+|\s+$/g,Wn=/^\s+/,Cn=/\s+$/,Bn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Un=/\{\n\/\* \[wrapped with (.+)\] \*/,Tn=/,? & /,$n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Dn=/\\(\\)?/g,Mn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Fn=/\w*$/,Nn=/^[-+]0x[0-9a-f]+$/i,Pn=/^0b[01]+$/i,qn=/^\[object .+?Constructor\]$/,Zn=/^0o[0-7]+$/i,Kn=/^(?:0|[1-9]\d*)$/,Vn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Gn=/($^)/,Hn=/['\n\r\u2028\u2029\\]/g,Jn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Yn="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Qn="[\\ud800-\\udfff]",Xn="["+Yn+"]",nt="["+Jn+"]",tt="\\d+",rt="[\\u2700-\\u27bf]",et="[a-z\\xdf-\\xf6\\xf8-\\xff]",ut="[^\\ud800-\\udfff"+Yn+tt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",it="\\ud83c[\\udffb-\\udfff]",ot="[^\\ud800-\\udfff]",ft="(?:\\ud83c[\\udde6-\\uddff]){2}",at="[\\ud800-\\udbff][\\udc00-\\udfff]",ct="[A-Z\\xc0-\\xd6\\xd8-\\xde]",lt="(?:"+et+"|"+ut+")",st="(?:"+ct+"|"+ut+")",ht="(?:"+nt+"|"+it+")"+"?",pt="[\\ufe0e\\ufe0f]?"+ht+("(?:\\u200d(?:"+[ot,ft,at].join("|")+")[\\ufe0e\\ufe0f]?"+ht+")*"),vt="(?:"+[rt,ft,at].join("|")+")"+pt,_t="(?:"+[ot+nt+"?",nt,ft,at,Qn].join("|")+")",gt=RegExp("[']","g"),yt=RegExp(nt,"g"),dt=RegExp(it+"(?="+it+")|"+_t+pt,"g"),bt=RegExp([ct+"?"+et+"+(?:['](?:d|ll|m|re|s|t|ve))?(?="+[Xn,ct,"$"].join("|")+")",st+"+(?:['](?:D|LL|M|RE|S|T|VE))?(?="+[Xn,ct+lt,"$"].join("|")+")",ct+"?"+lt+"+(?:['](?:d|ll|m|re|s|t|ve))?",ct+"+(?:['](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",tt,vt].join("|"),"g"),wt=RegExp("[\\u200d\\ud800-\\udfff"+Jn+"\\ufe0e\\ufe0f]"),mt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,xt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],jt=-1,At={};At[an]=At[cn]=At[ln]=At[sn]=At[hn]=At[pn]=At[vn]=At[_n]=At[gn]=!0,At[$]=At[D]=At[on]=At[F]=At[fn]=At[N]=At[q
},{"buffer":"VjIL"}],"iO5H":[function(require,module,exports) {
var i=require("pdfast"),e=require("lodash"),t=function(t,n,r){var u=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=e.filter(t,e.isFinite);e.isFinite(u)&&(s=e.filter(s,function(i){return i>u})),e.isFinite(o)&&(s=e.filter(s,function(i){return i<o}));var f=i.create(s,{size:n,width:r});return{xs:f.map(function(i){return i.x}),ys:f.map(function(i){return i.y})}};module.exports={samplesToContinuousPdf:t};
},{"pdfast":"fFBv","lodash":"hKJs"}],"Oh6H":[function(require,module,exports) {
"use strict";var r=require("jstat"),t=require("rescript/lib/js/caml_array.js"),e=require("../utility/E.bs.js");function n(r){return e.A.length(r)}function a(t){return r.percentile(t,.75,!0)-r.percentile(t,.25,!0)}function i(n){var i=Math.sqrt(r.variance(n)),s=Math.min(i,a(n)/1.34),u=Math.abs(t.get(n,1));return.9*(Number.isNaN(s)?Number.isNaN(i)?Number.isNaN(u)?1:u:i:s)*Math.pow(e.A.length(n),-.2)}function s(t){var n=a(t)/1.34;return 1.06*Math.min(Math.sqrt(r.variance(t)),n)*Math.pow(e.A.length(t),-.2)}exports.len=n,exports.iqr=a,exports.nrd0=i,exports.nrd=s;
},{"jstat":"AuT8","rescript/lib/js/caml_array.js":"Tpli","../utility/E.bs.js":"xX5m"}],"O6rr":[function(require,module,exports) {
"use strict";function e(e,r,i){return r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}var r=require("rescript/lib/js/curry.js"),i=require("rescript/lib/js/caml_option.js"),s=require("../utility/E.bs.js"),o=require("./Mixed.bs.js"),t=require("./XYShape.bs.js"),u=require("./Discrete.bs.js"),n=require("./Continuous.bs.js");function a(a,l){var b=r._2(s.O.$$default,n.make(void 0,0,void 0,{xs:[],ys:[]}),a),m=r._2(s.O.$$default,u.make(0,void 0,{xs:[],ys:[]}),l),d=s.A.length(t.T.xs(n.getShape(b))),c=s.A.length(t.T.xs(u.getShape(m)));return 0===d||1===d?0!==c?e({TAG:1,_0:m},Symbol.for("name"),"Discrete"):void 0:0===c?e({TAG:2,_0:b},Symbol.for("name"),"Continuous"):e({TAG:0,_0:o.make(i.some(void 0),i.some(void 0),b,m)},Symbol.for("name"),"Mixed")}exports.buildSimple=a;
},{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/caml_option.js":"dzFO","../utility/E.bs.js":"xX5m","./Mixed.bs.js":"XMuZ","./XYShape.bs.js":"Lf2V","./Discrete.bs.js":"Ms6F","./Continuous.bs.js":"CVcq"}],"wVv4":[function(require,module,exports) {
"use strict";var t=require("rescript/lib/js/caml.js"),r=require("rescript/lib/js/array.js"),e=require("rescript/lib/js/curry.js"),i=require("jstat"),n=require("rescript/lib/js/belt_Array.js"),o=require("rescript/lib/js/caml_array.js"),s=require("../utility/E.bs.js"),u=require("./KdeLibrary.js"),a=require("../distribution/XYShape.bs.js"),d=require("../distribution/Discrete.bs.js"),l=require("./Bandwidth.bs.js"),p=require("../distribution/Continuous.bs.js"),c=require("../distribution/MixedShapeBuilder.bs.js"),m={};function f(t){return{xs:t.xs,ys:t.ys}}function b(t,r,e){return u.samplesToContinuousPdf(t,r,e)}var h={jsToDist:f,samplesToContinuousPdf:b};function j(t,r,e){return f(u.samplesToContinuousPdf(t,r,e))}var v={normalSampling:j};function q(t){var r=[],e=s.FloatFloatMap.empty(void 0);return n.forEachWithIndex(t,function(i,u){var a=t.length-1|0,d=0!==i?i===a?[i-1|0]:[i-1|0,i+1|0]:[i+1|0],l=n.map(d,function(r){return o.get(t,r)});n.some(l,function(t){return t===u})?s.FloatFloatMap.increment(u,e):r.push(u)}),[r,e]}function g(t,r,i){return i/(e._2(s.O.$$default,0,e._3(s.A.Sorted.range,void 0,void 0,t))/r)}function y(t){return 0|i.max([t,1])}function S(t,r){return g(t,r,l.nrd0(t))}var _=j,P={splitContinuousAndDiscrete:q,xWidthToUnitWidth:g,formatUnitWidth:y,suggestedUnitWidth:S,kde:_},x={Types:m,JS:h,KDE:v,T:P};function F(i,n,o){r.fast_sort(t.caml_float_compare,i);var u,m=e._1(s.A.Sorted.Floats.split,i),f=m[0],b=s.A.length(i),h=d.make(void 0,void 0,a.T.fromZippedArray(s.FloatFloatMap.toArray(s.FloatFloatMap.fmap(function(t){return t/b},m[1]))));if(s.A.length(f)>5){var v=l.nrd0(f),q=S(f,n.outputXYPoints),_=e._2(s.O.$$default,v,n.kernelWidth),P=g(i,n.outputXYPoints,_),x={sampleCount:n.sampleCount,outputXYPoints:n.outputXYPoints,bandwidthXSuggested:v,bandwidthUnitSuggested:q,bandwidthXImplemented:_,bandwidthUnitImplemented:P};u=[p.make(void 0,void 0,void 0,j(f,n.outputXYPoints,y(P))),x]}else u=void 0;var F=c.buildSimple(e._2(s.O.fmap,function(t){return t[0]},u),h);return{continuousParseParams:e._2(s.O.fmap,function(t){return t[1]},u),shape:F}}function A(t,r){return F(r,t,void 0)}exports.Internals=x,exports.toShape=F,exports.fromSamples=A;
},{"rescript/lib/js/caml.js":"gGFE","rescript/lib/js/array.js":"d4B1","rescript/lib/js/curry.js":"NSLD","jstat":"AuT8","rescript/lib/js/belt_Array.js":"yUxI","rescript/lib/js/caml_array.js":"Tpli","../utility/E.bs.js":"xX5m","./KdeLibrary.js":"iO5H","../distribution/XYShape.bs.js":"Lf2V","../distribution/Discrete.bs.js":"Ms6F","./Bandwidth.bs.js":"Oh6H","../distribution/Continuous.bs.js":"CVcq","../distribution/MixedShapeBuilder.bs.js":"O6rr"}],"OH0m":[function(require,module,exports) {
"use strict";function e(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var t=require("rescript/lib/js/curry.js"),n=require("../utility/E.bs.js"),o=require("rescript/lib/js/belt_MapString.js");function u(e,r){return t._2(n.O.fmap,function(e){return e[1]},t._2(n.A.getBy,e,function(e){return e[0]===r}))}function i(e,r){return n.O.toResult(r+" expected and not found",u(e,r))}function a(e,r){return t._2(n.A.fmap,function(r){return[r,u(e,r)]},r)}var f={getByName:u,getByNameResult:i,getByNames:a};function s(e){if("object"===r(e)){var t=e.NAME;if("SymbolicDist"===t){var n=e.VAL;return"object"===r(n)&&"Float"===n.NAME?n.VAL:void 0}if("RenderedDist"===t){var o=e.VAL;switch(0|o.TAG){case 1:var u=o._0.xyShape,i=u.xs;if(1!==i.length)return;var a=i[0],f=u.ys;if(1!==f.length)return;return 1!==f[0]?void 0:a;case 0:case 2:return}}}}function d(e){var r=s(e);return void 0!==r?{NAME:"SymbolicDist",VAL:{NAME:"Float",VAL:r}}:e}function c(e){return{sampleCount:t._2(n.O.$$default,1e4,e.sampleCount),outputXYPoints:t._2(n.O.$$default,1e4,e.outputXYPoints),kernelWidth:e.kernelWidth,shapeLength:t._2(n.O.$$default,1e4,e.shapeLength)}}var l={withDefaults:c},A=o.fromArray([]);function m(e,r){return o.merge(e,r,function(e,r,t){return void 0!==t?t:void 0!==r?r:void 0})}var y=o.update,v=o.get;function b(t,n){var u=o.get(t,n);if(void 0!==u&&"object"===r(u)&&"Function"===u.NAME){var i=u.VAL;return e({TAG:0,_0:[i[0],i[1]]},Symbol.for("name"),"Ok")}return e({TAG:1,_0:"Function "+n+" not found"},Symbol.for("name"),"Error")}var p={MS:void 0,fromArray:o.fromArray,empty:A,mergeKeepSecond:m,update:y,get:v,getFunction:b};function _(e){return t._1(e.evaluateNode,e)}function S(e,r,o){var u=t._2(e.evaluateNode,e,o);return t._2(n.R.bind,u,t._1(r,e))}function g(e,r){return t._2(e.evaluateNode,e,{NAME:"Render",VAL:r})}function N(t,n){if("object"===r(n)&&"RenderedDist"===n.NAME)return e({TAG:0,_0:n},Symbol.for("name"),"Ok");var o=g(t,n);if(0!==o.TAG)return e({TAG:1,_0:o._0},Symbol.for("name"),"Error");var u=o._0;return"object"===r(u)&&"RenderedDist"===u.NAME?e({TAG:0,_0:{NAME:"RenderedDist",VAL:u.VAL}},Symbol.for("name"),"Ok"):e({TAG:1,_0:"Did not render as requested"},Symbol.for("name"),"Error")}function E(t,n){var o=N(t,n);if(0!==o.TAG)return e({TAG:1,_0:o._0},Symbol.for("name"),"Error");var u=o._0;return"object"===r(u)&&"RenderedDist"===u.NAME?e({TAG:0,_0:u.VAL},Symbol.for("name"),"Ok"):e({TAG:1,_0:"Did not render as requested"},Symbol.for("name"),"Error")}function h(e){if("object"===r(e)&&"RenderedDist"===e.NAME)return e.VAL}function L(e){switch(0|e.TAG){case 1:var r=e._0.xyShape,t=r.xs;if(1!==t.length)return;var n=t[0],o=r.ys;if(1!==o.length)return;return 1!==o[0]?void 0:{NAME:"SymbolicDist",VAL:{NAME:"Float",VAL:n}};case 0:case 2:return}}function M(e){var r=h(e);return n.O.toResult("Not valid shape",t._2(n.O.bind,r,L))}var R={render:g,ensureIsRendered:N,ensureIsRenderedAndGetShape:E,getShape:h,_toFloat:L,toFloat:M},G={Hash:f,getFloat:s,toFloatIfNeeded:d,SamplingInputs:l,Environment:p,evaluateNode:_,evaluateAndRetry:S,Render:R},T={};exports.ExpressionTree=G,exports.Program=T;
},{"rescript/lib/js/curry.js":"NSLD","../utility/E.bs.js":"xX5m","rescript/lib/js/belt_MapString.js":"mO07"}],"uF38":[function(require,module,exports) {
"use strict";function e(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n=require("rescript/lib/js/curry.js"),t=require("rescript/lib/js/belt_Array.js"),i=require("rescript/lib/js/caml_option.js"),o=require("../utility/E.bs.js"),u=require("../distribution/Shape.bs.js"),s=require("./Operation.bs.js"),m=require("../symbolic/SymbolicDist.bs.js"),a=require("../samplesRenderer/SamplesToShape.bs.js"),f=require("./ExpressionTypes.bs.js");function l(e){if("object"===r(e)&&"Function"===e.NAME)return e.VAL}function c(e){return e[0]}function p(e){return e[1]}function b(r,i,u){if(o.A.length(i)!==o.A.length(c(u)))return e({TAG:1,_0:"Wrong number of variables"},Symbol.for("name"),"Error");var s=n._1(f.ExpressionTree.Environment.fromArray,t.zip(c(u),i)),m={samplingInputs:r.samplingInputs,environment:n._2(f.ExpressionTree.Environment.mergeKeepSecond,r.environment,s),evaluateNode:r.evaluateNode};return n._2(r.evaluateNode,m,p(u))}var d={fromNode:l,argumentNames:c,internals:p,run:b};function y(e){if("object"!==r(e))return!1;var n=e.NAME;return"RenderedDist"===n||"Function"===n||"SymbolicDist"===n}function A(e){if("object"===r(e)){var n=e.NAME;return"RenderedDist"===n||"Function"===n||"SymbolicDist"===n?e:void 0}}var v={isPrimative:y,fromNode:A};function S(e){if("object"!==r(e))return!1;var n=e.NAME;return"RenderedDist"===n||"SymbolicDist"===n}function N(n){if("object"!==r(n))return e({TAG:1,_0:"Not valid type"},Symbol.for("name"),"Error");var t=n.NAME;return"SymbolicDist"===t?e({TAG:0,_0:{NAME:"SymbolicDist",VAL:n.VAL}},Symbol.for("name"),"Ok"):"RenderedDist"===t?e({TAG:0,_0:{NAME:"RenderedDist",VAL:n.VAL}},Symbol.for("name"),"Ok"):e({TAG:1,_0:"Not valid type"},Symbol.for("name"),"Error")}function _(r,t){if(S(t))return e({TAG:0,_0:t},Symbol.for("name"),"Ok");var i=n._2(f.ExpressionTree.Render.render,r,t);return 0===i.TAG?e({TAG:0,_0:i._0},Symbol.for("name"),"Ok"):e({TAG:1,_0:i._0},Symbol.for("name"),"Error")}function E(e,t,o){if("object"===r(o)){var u=o.NAME;return"SymbolicDist"===u?i.some(n._1(t,o.VAL)):"RenderedDist"===u?i.some(n._1(e,o.VAL)):void 0}}function j(e){return function(r){return E(function(r){return u.sampleNRendered(e,r)},function(r){return m.T.sampleN(e,r)},r)}}function g(e,r,i,u){var m=j(e)(i),a=j(e)(u);if(void 0!==m&&void 0!==a)return n._2(o.A.fmap,function(e){return s.Algebraic.toFn(r)(e[0],e[1])},t.zip(m,a))}function D(e,r,t,i){var u=_(e,t),s=_(e,i),m=o.R.merge(u,s);return n._2(o.R.bind,m,function(t){var i=g(e.samplingInputs.sampleCount,r,t[0],t[1]),u=e.samplingInputs,s=n._2(o.O.fmap,function(e){return a.fromSamples(u,e)},i),m=o.O.toResult("No response",n._2(o.O.bind,s,function(e){return e.shape}));return n._2(o.R.fmap,function(e){return{NAME:"Normalize",VAL:{NAME:"RenderedDist",VAL:e}}},m)})}var T={isSamplingDistribution:S,fromNode:N,renderIfIsNotSamplingDistribution:_,map:E,sampleN:j,getCombinationSamples:g,combineShapesUsingSampling:D};exports.$$Function=d,exports.Primative=v,exports.SamplingDistribution=T;
},{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/belt_Array.js":"yUxI","rescript/lib/js/caml_option.js":"dzFO","../utility/E.bs.js":"xX5m","../distribution/Shape.bs.js":"wbI6","./Operation.bs.js":"S4ET","../symbolic/SymbolicDist.bs.js":"wl7Z","../samplesRenderer/SamplesToShape.bs.js":"wVv4","./ExpressionTypes.bs.js":"OH0m"}],"N3i9":[function(require,module,exports) {
"use strict";var r=function(r,p){var l,t;t=p.length;var e=[];for(l=0;l<t-1;++l)e.push(p[l]);var n=p[t-1];for(l=0;l<n.length;++l)e.push(n[l]);return r.apply(null,e)},p=function(r,p,l){var t,e;e=l.length;var n=[];for(t=0;t<e-1;++t)n.push(l[t]);var s=l[e-1];for(t=0;t<s.length;++t)n.push(s[t]);return r[p].apply(r,n)};exports.spliceApply=r,exports.spliceObjApply=p;
},{}],"lpIF":[function(require,module,exports) {
"use strict";var r=require("rescript/lib/js/curry.js"),i=require("../utility/E.bs.js"),e=require("rescript/lib/js/caml_splice_call.js"),t=require("./Operation.bs.js"),n=require("../symbolic/SymbolicDist.bs.js");function c(a){for(;;){var o=a,u=o.NAME;if("SymbolicDist"===u)return n.T.toString(o.VAL);if("Function"===u){var l=o.VAL;return"[Function: ("+e.spliceObjApply(",","concat",[l[0]])+c(l[1])+")]"}if("FunctionCall"===u){var s=o.VAL;return"[Function call: ("+s[0]+e.spliceObjApply(",","concat",[r._2(i.A.fmap,c,s[1])])+")]"}if("AlgebraicCombination"===u){var A=o.VAL;return t.Algebraic.format(A[0],c(A[1]),c(A[2]))}if("PointwiseCombination"===u){var p=o.VAL;return t.Pointwise.format(p[0],c(p[1]),c(p[2]))}if("Symbol"===u)return"Symbol: "+o.VAL;if("RenderedDist"===u)return"[renderedShape]";if("Truncate"===u){var f=o.VAL;return t.T.truncateToString(f[0],f[1],c(f[2]))}if("Hash"===u)return"{"+e.spliceObjApply(",","concat",[r._2(i.A.fmap,function(r){return r[0]+":"+c(r[1])},o.VAL)])+"}";if("Array"===u)return"["+e.spliceObjApply(",","concat",[r._2(i.A.fmap,c,o.VAL)])+"]";if("Render"!==u)return"normalize(k"+c(o.VAL)+")";a=o.VAL}}exports.toString=c;
},{"rescript/lib/js/curry.js":"NSLD","../utility/E.bs.js":"xX5m","rescript/lib/js/caml_splice_call.js":"N3i9","./Operation.bs.js":"S4ET","../symbolic/SymbolicDist.bs.js":"wl7Z"}],"TKgk":[function(require,module,exports) {
"use strict";function r(r,e,o){return e in r?Object.defineProperty(r,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[e]=o,r}function e(r){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}var o=require("rescript/lib/js/curry.js"),n=require("rescript/lib/js/belt_Array.js"),t=require("../utility/E.bs.js"),i=require("rescript/lib/js/caml_splice_call.js"),a=require("../expressionTree/PTypes.bs.js"),u=require("../expressionTree/ExpressionTypes.bs.js"),f=require("../expressionTree/ExpressionTreeBasic.bs.js"),A=u.ExpressionTree.getFloat;function m(r){var e=r.NAME;return"Float"===e?"Float: "+r.VAL.toString():"RenderedDist"===e?"[rendered Shape]":"Hash"===e?"{"+i.spliceObjApply(",","concat",[o._2(t.A.fmap,function(r){return r[0]+":"+m(r[1])},r.VAL)])+"}":"Array"===e?"["+i.spliceObjApply(",","concat",[o._2(t.A.fmap,m,r.VAL)])+"]":"[sampling dist]"}function s(n){if("object"!==e(n))return r({TAG:1,_0:"Wrong type: "+f.toString(n)},Symbol.for("name"),"Error");var i=n.NAME;if("SymbolicDist"!==i)return"RenderedDist"===i?r({TAG:0,_0:{NAME:"RenderedDist",VAL:n.VAL}},Symbol.for("name"),"Ok"):"Hash"===i?o._2(t.R.fmap,function(r){return{NAME:"Hash",VAL:r}},o._1(t.A.R.firstErrorOrOpen,o._2(t.A.fmap,function(r){var e=r[0];return o._2(t.R.fmap,function(r){return[e,r]},s(r[1]))},n.VAL))):"Array"===i?o._2(t.R.fmap,function(r){return{NAME:"Array",VAL:r}},o._1(t.A.R.firstErrorOrOpen,o._2(t.A.fmap,s,n.VAL))):r({TAG:1,_0:"Wrong type: "+f.toString(n)},Symbol.for("name"),"Error");var a=n.VAL;return"object"===e(a)&&"Float"===a.NAME?r({TAG:0,_0:{NAME:"Float",VAL:a.VAL}},Symbol.for("name"),"Ok"):r({TAG:0,_0:{NAME:"SamplingDist",VAL:{NAME:"SymbolicDist",VAL:a}}},Symbol.for("name"),"Ok")}function p(n,i,f){if("object"===e(i)){if("Array"===i.NAME){if("object"!==e(f))return r({TAG:1,_0:"fromNodeWithTypeCoercion error, sorry."},Symbol.for("name"),"Error");if("Array"!==f.NAME)return r({TAG:1,_0:"fromNodeWithTypeCoercion error, sorry."},Symbol.for("name"),"Error");var m=i.VAL;return o._2(t.R.fmap,function(r){return{NAME:"Array",VAL:r}},o._1(t.A.R.firstErrorOrOpen,o._2(t.A.fmap,function(r){return p(n,m,r)},f.VAL)))}if("object"!==e(f))return r({TAG:1,_0:"fromNodeWithTypeCoercion error, sorry."},Symbol.for("name"),"Error");if("Hash"!==f.NAME)return r({TAG:1,_0:"fromNodeWithTypeCoercion error, sorry."},Symbol.for("name"),"Error");var y=f.VAL,c=o._2(t.A.fmap,function(r){var e=r[0];return[e,r[1],o._2(u.ExpressionTree.Hash.getByName,y,e)]},i.VAL);return o._2(t.R.fmap,function(r){return{NAME:"Hash",VAL:r}},o._1(t.A.R.firstErrorOrOpen,o._2(t.A.fmap,function(e){var i=e[2];if(void 0===i)return r({TAG:1,_0:"Hash parameter not present in hash."},Symbol.for("name"),"Error");var a=e[0];return o._2(t.R.fmap,function(r){return[a,r]},p(n,e[1],i))},c)))}if("Float"===i){var l=A(f);return void 0!==l?r({TAG:0,_0:{NAME:"Float",VAL:l}},Symbol.for("name"),"Ok"):r({TAG:1,_0:"Type Error: Expected float."},Symbol.for("name"),"Error")}if("SamplingDistribution"===i){var b=a.SamplingDistribution.renderIfIsNotSamplingDistribution(n,f);return o._2(t.R.bind,b,s)}var _=o._2(u.ExpressionTree.Render.render,n,f);return o._2(t.R.bind,_,s)}function y(o){return"object"===e(o)&&"Float"===o.NAME?r({TAG:0,_0:o.VAL},Symbol.for("name"),"Ok"):r({TAG:1,_0:"Not a float"},Symbol.for("name"),"Error")}function c(o){return"object"===e(o)&&"Array"===o.NAME?r({TAG:0,_0:o.VAL},Symbol.for("name"),"Ok"):r({TAG:1,_0:"Not an array"},Symbol.for("name"),"Error")}function l(o){return"object"===e(o)&&"Hash"===o.NAME?r({TAG:0,_0:o.VAL},Symbol.for("name"),"Ok"):r({TAG:1,_0:"Not a named item"},Symbol.for("name"),"Error")}function b(o){if("object"!==e(o))return r({TAG:1,_0:"Cannot be converted into a distribution: "+m(o)},Symbol.for("name"),"Error");var n=o.NAME;if("SamplingDist"!==n)return"Float"===n?r({TAG:0,_0:{NAME:"SymbolicDist",VAL:{NAME:"Float",VAL:o.VAL}}},Symbol.for("name"),"Ok"):"RenderedDist"===n?r({TAG:0,_0:{NAME:"RenderedDist",VAL:o.VAL}},Symbol
},{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/belt_Array.js":"yUxI","../utility/E.bs.js":"xX5m","rescript/lib/js/caml_splice_call.js":"N3i9","../expressionTree/PTypes.bs.js":"uF38","../expressionTree/ExpressionTypes.bs.js":"OH0m","../expressionTree/ExpressionTreeBasic.bs.js":"lpIF"}],"BBdU":[function(require,module,exports) {
"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(t)}function t(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}var e=require("rescript/lib/js/curry.js"),n=require("../utility/E.bs.js"),i=require("rescript/lib/js/caml_splice_call.js"),o=require("../distribution/Shape.bs.js"),a=require("../expressionTree/Operation.bs.js"),u=require("./TypeSystem.bs.js"),l=require("../symbolic/SymbolicDist.bs.js"),m=require("../expressionTree/ExpressionTypes.bs.js");function s(r){var o=i.spliceObjApply(",","concat",[e._2(n.A.fmap,u.TypedValue.toString,r)]);return console.log("Inputs were",o,r),t({TAG:1,_0:"Wrong inputs. The inputs were:"+o},Symbol.for("name"),"Error")}function A(r,e){return r<=0&&r<e?t({TAG:0,_0:{NAME:"SymbolicDist",VAL:l.Normal.from90PercentCI(r,e)}},Symbol.for("name"),"Ok"):r<e?t({TAG:0,_0:{NAME:"SymbolicDist",VAL:l.Lognormal.from90PercentCI(r,e)}},Symbol.for("name"),"Ok"):t({TAG:1,_0:"Low value must be less than high value."},Symbol.for("name"),"Error")}function f(n,i){return e._6(u.$$Function.T.make,n,["Float","Float"],"SamplingDistribution",function(n){if(2!==n.length)return s(n);var o=n[0];if("object"!==r(o))return s(n);if("Float"!==o.NAME)return s(n);var a=n[1];return"object"===r(a)&&"Float"===a.NAME?t({TAG:0,_0:{NAME:"SymbolicDist",VAL:e._2(i,o.VAL,a.VAL)}},Symbol.for("name"),"Ok"):s(n)},void 0,void 0)}function c(n,i){return e._6(u.$$Function.T.make,n,["Float"],"SamplingDistribution",function(n){if(1!==n.length)return s(n);var o=n[0];return"object"===r(o)&&"Float"===o.NAME?t({TAG:0,_0:{NAME:"SymbolicDist",VAL:e._1(i,o.VAL)}},Symbol.for("name"),"Ok"):s(n)},void 0,void 0)}function b(t,n){return e._6(u.$$Function.T.make,t,["SamplingDistribution","Float"],"SamplingDistribution",function(t){if(2!==t.length)return s(t);var i=t[0];if("object"!==r(i))return s(t);var o=i.NAME;if("SamplingDist"===o){var a=t[1];return"object"===r(a)&&"Float"===a.NAME?e._2(n,i.VAL,a.VAL):s(t)}if("RenderedDist"!==o)return s(t);var u=t[1];return"object"===r(u)&&"Float"===u.NAME?e._2(n,{NAME:"RenderedDist",VAL:i.VAL},u.VAL):s(t)},void 0,void 0)}function d(t,n){return e._6(u.$$Function.T.make,t,["RenderedDistribution","Float"],"RenderedDistribution",function(t){if(2!==t.length)return s(t);var i=t[0];if("object"!==r(i))return s(t);if("RenderedDist"!==i.NAME)return s(t);var o=t[1];return"object"===r(o)&&"Float"===o.NAME?e._2(n,i.VAL,o.VAL):s(t)},!0,void 0)}function p(t,n){return e._6(u.$$Function.T.make,t,["SamplingDistribution"],"SamplingDistribution",function(t){if(1!==t.length)return s(t);var i=t[0];if("object"!==r(i))return s(t);var o=i.NAME;return"SamplingDist"===o?e._1(n,i.VAL):"RenderedDist"===o?e._1(n,{NAME:"RenderedDist",VAL:i.VAL}):s(t)},void 0,void 0)}function _(r,i){if("RenderedDist"===i.NAME)return t({TAG:0,_0:{NAME:"SymbolicDist",VAL:{NAME:"Float",VAL:o.operate(r,i.VAL)}}},Symbol.for("name"),"Ok");var a=l.T.operate(r,i.VAL);return e._2(n.R.bind,a,function(r){return t({TAG:0,_0:{NAME:"SymbolicDist",VAL:{NAME:"Float",VAL:r}}},Symbol.for("name"),"Ok")})}function y(r,n,i){var u=a.Scale.toIntegralSumCacheFn(r),l=a.Scale.toIntegralCacheFn(r);return t({TAG:0,_0:{NAME:"RenderedDist",VAL:e._4(o.T.mapY,e._1(u,i),e._1(l,i),function(t){return a.Scale.toFn(r)(t,i)},n)}},Symbol.for("name"),"Ok")}var E=m.ExpressionTree.Hash.getByNameResult;function S(i){if(1!==i.length)return t({TAG:1,_0:"Needs items"},Symbol.for("name"),"Error");var o=i[0];if("object"!==r(o))return t({TAG:1,_0:"Needs items"},Symbol.for("name"),"Error");if("Hash"!==o.NAME)return t({TAG:1,_0:"Needs items"},Symbol.for("name"),"Error");var a=o.VAL,l=e._2(n.R.bind,e._2(n.R.bind,e._2(E,a,"dists"),u.TypedValue.toArray),function(r){return e._1(n.A.R.firstErrorOrOpen,e._2(n.A.fmap,u.TypedValue.toDist,r))}),m=e._2(n.R.bind,e._2(n.R.bind,e._2(E,a,"weights"),u.TypedValue.toArray),function(r){return e._1(n.A.R.firstErrorOrOpen,e._2(n.A.fmap,u.TypedV
},{"rescript/lib/js/curry.js":"NSLD","../utility/E.bs.js":"xX5m","rescript/lib/js/caml_splice_call.js":"N3i9","../distribution/Shape.bs.js":"wbI6","../expressionTree/Operation.bs.js":"S4ET","./TypeSystem.bs.js":"TKgk","../symbolic/SymbolicDist.bs.js":"wl7Z","../expressionTree/ExpressionTypes.bs.js":"OH0m"}],"NgRJ":[function(require,module,exports) {
"use strict";function r(r,e,n){return e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}function e(r){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}var n=require("rescript/lib/js/curry.js"),o=require("../utility/E.bs.js"),i=require("../distribution/Shape.bs.js"),t=require("./PTypes.bs.js"),u=require("../distribution/XYShape.bs.js"),a=require("../distribution/Continuous.bs.js"),s=require("../typeSystem/TypeSystem.bs.js"),A=require("../symbolic/SymbolicDist.bs.js"),f=require("./ExpressionTypes.bs.js"),c=require("../typeSystem/HardcodedFunctions.bs.js");function m(n,o,i){if("object"===e(o)&&"SymbolicDist"===o.NAME&&"object"===e(i)&&"SymbolicDist"===i.NAME){var t=A.T.tryAnalyticalSimplification(o.VAL,i.VAL,n);return"object"===e(t)?"Error"===t.NAME?r({TAG:1,_0:t.VAL},Symbol.for("name"),"Error"):r({TAG:0,_0:{NAME:"SymbolicDist",VAL:t.VAL}},Symbol.for("name"),"Ok"):r({TAG:0,_0:{NAME:"AlgebraicCombination",VAL:[n,o,i]}},Symbol.for("name"),"Ok")}return r({TAG:0,_0:{NAME:"AlgebraicCombination",VAL:[n,o,i]}},Symbol.for("name"),"Ok")}function b(r,e,t,u){return n._2(o.R.fmap,function(r){return{NAME:"RenderedDist",VAL:i.combineAlgebraically(e,r[0],r[1])}},o.R.merge(n._2(f.ExpressionTree.Render.ensureIsRenderedAndGetShape,r,t),n._2(f.ExpressionTree.Render.ensureIsRenderedAndGetShape,r,u)))}function l(r){if("object"!==e(r))return 1e3;var n=r.NAME;if("SymbolicDist"===n){var o=r.VAL;return"object"===e(o)&&"Float"===o.NAME?1:1e3}if("RenderedDist"!==n)return 1e3;var i=r.VAL;switch(0|i.TAG){case 1:return u.T.length(i._0.xyShape);case 0:case 2:return 1e3}}function d(r,e){return Math.imul(l(r),l(e))>1e4?"Sampling":"Analytical"}function y(r,e,i,u){var a=o.R.merge(t.SamplingDistribution.renderIfIsNotSamplingDistribution(r,i),t.SamplingDistribution.renderIfIsNotSamplingDistribution(r,u));return n._2(o.R.bind,a,function(n){var o=n[1],i=n[0];return"Sampling"===d(i,o)?t.SamplingDistribution.combineShapesUsingSampling(r,e,i,o):b(r,e,i,o)})}function p(i,t,u,a){var s=m(t,u,a);return n._2(o.R.bind,s,function(n){return"object"===e(n)&&"SymbolicDist"===n.NAME?r({TAG:0,_0:n},Symbol.for("name"),"Ok"):y(i,t,u,a)})}var E={tryAnalyticalSimplification:m,combinationByRendering:b,nodeScore:l,choose:d,combine:y,operationToLeaf:p};function S(o,t,u){var s=n._2(f.ExpressionTree.Render.render,o,t),A=n._2(f.ExpressionTree.Render.render,o,u);if(0!==s.TAG)return r({TAG:1,_0:s._0},Symbol.for("name"),"Error");var c=s._0;if("object"===e(c)&&"RenderedDist"===c.NAME&&0===A.TAG){var m=A._0;return"object"===e(m)&&"RenderedDist"===m.NAME?r({TAG:0,_0:{NAME:"RenderedDist",VAL:i.combinePointwise(function(r,e){return r+e},function(r,e){return a.combinePointwise(void 0,void 0,"CDF",function(r,e){return r+e},r,e)},function(r,e){return r+e},c.VAL,m.VAL)}},Symbol.for("name"),"Ok"):r({TAG:1,_0:"Pointwise combination: rendering failed."},Symbol.for("name"),"Error")}return 0===A.TAG?r({TAG:1,_0:"Pointwise combination: rendering failed."},Symbol.for("name"),"Error"):r({TAG:1,_0:A._0},Symbol.for("name"),"Error")}function _(o,t,u,a){var s=n._2(f.ExpressionTree.Render.render,t,u),A=n._2(f.ExpressionTree.Render.render,t,a);if(0!==s.TAG)return r({TAG:1,_0:s._0},Symbol.for("name"),"Error");var c=s._0;if("object"===e(c)&&"RenderedDist"===c.NAME&&0===A.TAG){var m=A._0;return"object"===e(m)&&"RenderedDist"===m.NAME?r({TAG:0,_0:{NAME:"RenderedDist",VAL:i.combinePointwise(void 0,void 0,o,c.VAL,m.VAL)}},Symbol.for("name"),"Ok"):r({TAG:1,_0:"Pointwise combination: rendering failed."},Symbol.for("name"),"Error")}return 0===A.TAG?r({TAG:1,_0:"Pointwise combination: rendering failed."},Symbol.for("name"),"Error"):r({TAG:1,_0:A._0},Symbol.for("name"),"Error")}function T(r,e,n,o){return"Add"===e?S(r,n,o):_("Exponentiate"===e?function(r,e){return Math.pow(r,e)}:function(r,e){return r*e},r,n,o)}var v={pointwiseAdd:S,pointwiseCombine:_,operationToLeaf:T};function L(r,n,o){if(void 0!==r){if(void 0!==n
},{"rescript/lib/js/curry.js":"NSLD","../utility/E.bs.js":"xX5m","../distribution/Shape.bs.js":"wbI6","./PTypes.bs.js":"uF38","../distribution/XYShape.bs.js":"Lf2V","../distribution/Continuous.bs.js":"CVcq","../typeSystem/TypeSystem.bs.js":"TKgk","../symbolic/SymbolicDist.bs.js":"wl7Z","./ExpressionTypes.bs.js":"OH0m","../typeSystem/HardcodedFunctions.bs.js":"BBdU"}],"H74a":[function(require,module,exports) {
"use strict";function e(r){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(r)}function r(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var n=require("./PTypes.bs.js"),t=require("./ExpressionTreeBasic.bs.js"),o=require("./ExpressionTreeEvaluator.bs.js");function u(e,r){return{samplingInputs:e,environment:r,evaluateNode:o.toLeaf}}function i(e,r,n){return o.toLeaf({samplingInputs:e,environment:r,evaluateNode:o.toLeaf},n)}function a(n,t,o){var u=i(n,t,o);if(0!==u.TAG)return r({TAG:1,_0:u._0},Symbol.for("name"),"Error");var a=u._0;return"object"===e(a)&&"RenderedDist"===a.NAME?r({TAG:0,_0:a.VAL},Symbol.for("name"),"Ok"):r({TAG:1,_0:"Rendering failed."},Symbol.for("name"),"Error")}function s(e,r,t,u){var i={samplingInputs:e,environment:r,evaluateNode:o.toLeaf};return n.$$Function.run(i,t,u)}var f=t.toString;exports.toString=f,exports.envs=u,exports.toLeaf=i,exports.toShape=a,exports.runFunction=s;
},{"./PTypes.bs.js":"uF38","./ExpressionTreeBasic.bs.js":"lpIF","./ExpressionTreeEvaluator.bs.js":"NgRJ"}],"uZ2e":[function(require,module,exports) {
"use strict";function e(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n=require("rescript/lib/js/array.js"),t=require("rescript/lib/js/curry.js"),o=require("rescript/lib/js/caml_option.js"),i=require("./utility/E.bs.js"),u=require("rescript/lib/js/belt_MapString.js"),s=require("./distribution/DistPlus.bs.js"),a=require("./expressionTree/MathJsParser.bs.js"),l=require("./expressionTree/ExpressionTree.bs.js"),m=require("./expressionTree/ExpressionTypes.bs.js"),p={},f={sampleCount:void 0,outputXYPoints:void 0,kernelWidth:void 0,shapeLength:void 0};function c(e,r,n,t){return{squiggleString:r,samplingInputs:void 0!==e?e:f,environment:void 0!==n?o.valFromOption(n):m.ExpressionTree.Environment.empty}}var d={SamplingInputs:p,defaultRecommendedLength:100,defaultShouldDownsample:!0,empty:f,make:c};function b(e,r,n){return{squiggleString:e.squiggleString,samplingInputs:e.samplingInputs,environment:t._3(m.ExpressionTree.Environment.update,e.environment,r,function(e){return n})}}function v(e,r){return{graph:e,shape:r}}function A(e){return{sampleCount:t._2(i.O.$$default,1e4,e.samplingInputs.sampleCount),outputXYPoints:t._2(i.O.$$default,1e4,e.samplingInputs.outputXYPoints),kernelWidth:e.samplingInputs.kernelWidth,shapeLength:t._2(i.O.$$default,1e4,e.samplingInputs.shapeLength)}}function y(e,r){return l.toLeaf(A(e),e.environment,r)}function g(e,r){var n={contents:e};return t._1(i.A.R.firstErrorOrOpen,t._1(i.A.O.concatSomes,t._2(i.A.fmap,function(e){if("Expression"===e.NAME)return t._2(i.R.fmap,function(e){return[n.contents.environment,e]},y(n.contents,e.VAL));var r=e.VAL;n.contents=b(n.contents,r[0],r[1])},r)))}function _(e){var r=a.fromString(e.squiggleString);return t._2(i.R.bind,r,function(r){return g(e,r)})}function S(e,r){return s.make(r,e.squiggleString,void 0,void 0,void 0)}var T={addVariable:b,makeOutputs:v,makeInputs:A,runNode:y,runProgram:g,inputsToLeaf:_,outputToDistPlus:S};function E(n,t){if("object"!==r(t))return e({TAG:0,_0:t},Symbol.for("name"),"Ok");var o=t.NAME;if("SymbolicDist"!==o&&"Normalize"!==o)return e({TAG:0,_0:t},Symbol.for("name"),"Ok");var i=y(n,{NAME:"Render",VAL:t});if(0!==i.TAG)return e({TAG:1,_0:i._0},Symbol.for("name"),"Error");var u=i._0;return"object"===r(u)&&"RenderedDist"===u.NAME?i:e({TAG:1,_0:"Didn't render, but intended to"},Symbol.for("name"),"Error")}function h(n,o,u){var s=E(n,u);return t._2(i.R.bind,s,function(t){if("object"===r(t)){var i=t.NAME;if("SymbolicDist"===i){var u=t.VAL;if("object"===r(u)&&"Float"===u.NAME)return e({TAG:0,_0:{NAME:"Float",VAL:u.VAL}},Symbol.for("name"),"Ok")}else{if("Function"===i)return e({TAG:0,_0:{NAME:"Function",VAL:[t.VAL,o]}},Symbol.for("name"),"Ok");if("RenderedDist"===i){var s=t.VAL,a=0;switch(0|s.TAG){case 1:var m=s._0.xyShape,p=m.xs;if(1!==p.length)a=2;else{var f=p[0],c=m.ys;if(1!==c.length)a=2;else{if(1===c[0])return e({TAG:0,_0:{NAME:"Float",VAL:f}},Symbol.for("name"),"Ok");a=2}}break;case 0:case 2:a=2}if(2===a)return e({TAG:0,_0:{NAME:"DistPlus",VAL:S(n,s)}},Symbol.for("name"),"Ok")}}}return e({TAG:1,_0:"Didn't output a rendered distribution. Format:"+l.toString(t)},Symbol.for("name"),"Error")})}function x(r,n){if(!n)return e({TAG:0,_0:0},Symbol.for("name"),"Ok");var o=t._1(r,n.hd);if(0!==o.TAG)return e({TAG:1,_0:o._0},Symbol.for("name"),"Error");var i=x(r,n.tl);return 0===i.TAG?e({TAG:0,_0:{hd:o._0,tl:i._0}},Symbol.for("name"),"Ok"):e({TAG:1,_0:i._0},Symbol.for("name"),"Error")}function j(e){var r=_(e);return t._2(i.R.bind,r,function(r){return x(function(r){return h(e,r[0],r[1])},n.to_list(r))})}function L(e,r,n){var o=l.runFunction(A(e),e.environment,n,r),u=e.environment;return t._2(i.R.bind,o,function(r){return h(e,u,r)})}function k(e){return j(c({sampleCount:1e4,outputXYPoints:1e4,kernelWidth:void 0,shapeLength:1e3},e,o.some(u.fromArray([])),void 0))}exports.
},{"rescript/lib/js/array.js":"d4B1","rescript/lib/js/curry.js":"NSLD","rescript/lib/js/caml_option.js":"dzFO","./utility/E.bs.js":"xX5m","rescript/lib/js/belt_MapString.js":"mO07","./distribution/DistPlus.bs.js":"A9pM","./expressionTree/MathJsParser.bs.js":"dGOd","./expressionTree/ExpressionTree.bs.js":"H74a","./expressionTree/ExpressionTypes.bs.js":"OH0m"}],"OXj9":[function(require,module,exports) {
var r=require("./ProgramEvaluator.bs"),a=function(a){var u=r.runAll(a);return 0===u.TAG?{tag:"Ok",value:u._0}:{tag:"Error",value:u._0}};exports.runAll=a;
},{"./ProgramEvaluator.bs":"uZ2e"}],"Focm":[function(require,module,exports) {
var r=require("../distPlus/ProgramEvaluator.gen.js");exports.runMePlease=r.runAll;
},{"../distPlus/ProgramEvaluator.gen.js":"OXj9"}]},{},["Focm"], null)