Equation.js/equation.min.js

3 lines
84 KiB
JavaScript
Raw Normal View History

2020-06-09 13:58:42 +00:00
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.Equation=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.default={PI:Math.PI,E:Math.E,RAND:Math.random},b.exports=c.default},{}],2:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=function(a){var b=a.split("1");return{left:b[0].length,right:b[1].length}};c.parseFormat=d;var e=function(a){return!isNaN(+a)};c.isNumber=e;var f=function a(b){return b.map(function(b){return e(b)?parseFloat(b):Array.isArray(b)?a(b):b})};c.parseNumbers=f;var g=function(a,b){for(var c=a,d=0;d<b;++d)c=c[c.length-1];return c};c.dive=g;var h=function a(b,c){var d=arguments.length<=2||void 0===arguments[2]?0:arguments[2];return c<2?{arr:b,index:d}:{arr:b.reduce(function(b,e,f){if(Array.isArray(e)){var g=a(e,c-1,f),h=g.arr,i=g.index,j=b.concat(h);return d=i,j}return b},[]),index:d}};c.deep=h;var i=function a(b,c,d){var e=[];if(!c.some(Array.isArray))return b[c[0]]=d,d;var f=!0,g=!1,h=void 0;try{for(var i,j=c[Symbol.iterator]();!(f=(i=j.next()).done);f=!0){var k=i.value;e.push(a(b,k,d))}}catch(l){g=!0,h=l}finally{try{!f&&j.return&&j.return()}finally{if(g)throw h}}return e};c.diveTo=i;var j=function a(b){return Array.isArray(b)&&b.some(Array.isArray)?b.reduce(function(b,c){return b.concat(a(c))},[]):b};c.flatten=j;var k=function(a){return a.toString().replace(/\W/g,"")};c.removeSymbols=k},{}],3:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b.default=a,b}function e(a){return a&&a.__esModule?a:{default:a}}function f(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}Object.defineProperty(c,"__esModule",{value:!0});var g=function(){function a(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!b||c.length!==b);d=!0);}catch(i){e=!0,f=i}finally{try{!d&&h.return&&h.return()}finally{if(e)throw f}}return c}return function(b,c){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return a(b,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();a("babel/polyfill");var h=a("./readstream"),i=e(h),j=a("./operators"),k=e(j),l=a("./constants"),m=e(l),n=a("./helpers"),o=d(n),p={solve:function(a){a=A(a);var b=u(a);return b=x(b),b=o.parseNumbers(b),b=q(b)},equation:function(a){var b=u(a),c=[];return b.forEach(function a(b){if(Array.isArray(b))return b.forEach(a);D(b)&&c.push(o.removeSymbols(b))}),function(){for(var a=arguments.length,d=Array(a),e=0;e<a;e++)d[e]=arguments[e];return b.forEach(function a(b,e,f){if(Array.isArray(b))return b.forEach(a);var g=c.indexOf(b);g>-1&&(f[e]=d[g])}),b=x(b),b=o.parseNumbers(b),b=q(b)}},registerOperator:function(a,b){k.default[a]=b},registerConstant:function(a,b){m.default[a]=b}},q=function a(b){for(var c=!0;c;){var d=b;c=!1;var e=d.some(function(a){return k.default[a]&&k.default[a].hasExpression});{if(e||!d.some(Array.isArray))return y(d);d=d.map(function(b){return Array.isArray(b)?a(b):b}),b=d,c=!0,e=void 0}}},r=Object.keys(k.default).map(function(a){return k.default[a].precedence}),s=Math.max.apply(Math,f(r)),t=Math.min.apply(Math,f(r)),u=function(a){a=a.replace(/,/g,")(");for(var b=new i.default(a),c=[],d="",e=void 0,f=void 0;b.next();)if(e=b.current(),f=c.length-1," "!==e)if(
d=g(f.postMessage,f,1)):k.addEventListener&&"function"==typeof postMessage&&!k.importScripts?(d=function(a){k.postMessage(a+"","*")},k.addEventListener("message",t,!1)):d=r in j("script")?function(a){i.appendChild(j("script"))[r]=function(){i.removeChild(this),s.call(a)}}:function(a){setTimeout(g(s,a,1),0)}),b.exports={set:m,clear:n}},{"./$.cof":18,"./$.ctx":24,"./$.dom-create":27,"./$.global":36,"./$.html":39,"./$.invoke":40}],83:[function(a,b,c){var d=a("./$.to-integer"),e=Math.max,f=Math.min;b.exports=function(a,b){return a=d(a),a<0?e(a+b,0):f(a,b)}},{"./$.to-integer":84}],84:[function(a,b,c){var d=Math.ceil,e=Math.floor;b.exports=function(a){return isNaN(a=+a)?0:(a>0?e:d)(a)}},{}],85:[function(a,b,c){var d=a("./$.iobject"),e=a("./$.defined");b.exports=function(a){return d(e(a))}},{"./$.defined":25,"./$.iobject":41}],86:[function(a,b,c){var d=a("./$.to-integer"),e=Math.min;b.exports=function(a){return a>0?e(d(a),9007199254740991):0}},{"./$.to-integer":84}],87:[function(a,b,c){var d=a("./$.defined");b.exports=function(a){return Object(d(a))}},{"./$.defined":25}],88:[function(a,b,c){var d=a("./$.is-object");b.exports=function(a,b){if(!d(a))return a;var c,e;if(b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;if("function"==typeof(c=a.valueOf)&&!d(e=c.call(a)))return e;if(!b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;throw TypeError("Can't convert object to primitive value")}},{"./$.is-object":45}],89:[function(a,b,c){var d=0,e=Math.random();b.exports=function(a){return"Symbol(".concat(void 0===a?"":a,")_",(++d+e).toString(36))}},{}],90:[function(a,b,c){var d=a("./$.shared")("wks"),e=a("./$.uid"),f=a("./$.global").Symbol;b.exports=function(a){return d[a]||(d[a]=f&&f[a]||(f||e)("Symbol."+a))}},{"./$.global":36,"./$.shared":74,"./$.uid":89}],91:[function(a,b,c){var d=a("./$.classof"),e=a("./$.wks")("iterator"),f=a("./$.iterators");b.exports=a("./$.core").getIteratorMethod=function(a){if(void 0!=a)return a[e]||a["@@iterator"]||f[d(a)]}},{"./$.classof":17,"./$.core":23,"./$.iterators":52,"./$.wks":90}],92:[function(a,b,c){"use strict";var d,e=a("./$"),f=a("./$.export"),g=a("./$.descriptors"),h=a("./$.property-desc"),i=a("./$.html"),j=a("./$.dom-create"),k=a("./$.has"),l=a("./$.cof"),m=a("./$.invoke"),n=a("./$.fails"),o=a("./$.an-object"),p=a("./$.a-function"),q=a("./$.is-object"),r=a("./$.to-object"),s=a("./$.to-iobject"),t=a("./$.to-integer"),u=a("./$.to-index"),v=a("./$.to-length"),w=a("./$.iobject"),x=a("./$.uid")("__proto__"),y=a("./$.array-methods"),z=a("./$.array-includes")(!1),A=Object.prototype,B=Array.prototype,C=B.slice,D=B.join,E=e.setDesc,F=e.getDesc,G=e.setDescs,H={};g||(d=!n(function(){return 7!=E(j("div"),"a",{get:function(){return 7}}).a}),e.setDesc=function(a,b,c){if(d)try{return E(a,b,c)}catch(e){}if("get"in c||"set"in c)throw TypeError("Accessors not supported!");return"value"in c&&(o(a)[b]=c.value),a},e.getDesc=function(a,b){if(d)try{return F(a,b)}catch(c){}if(k(a,b))return h(!A.propertyIsEnumerable.call(a,b),a[b])},e.setDescs=G=function(a,b){o(a);for(var c,d=e.getKeys(b),f=d.length,g=0;f>g;)e.setDesc(a,c=d[g++],b[c]);return a}),f(f.S+f.F*!g,"Object",{getOwnPropertyDescriptor:e.getDesc,defineProperty:e.setDesc,defineProperties:G});var I="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),J=I.concat("length","prototype"),K=I.length,L=function(){var a,b=j("iframe"),c=K,d=">";for(b.style.display="none",i.appendChild(b),b.src="javascript:",a=b.contentWindow.document,a.open(),a.write("<script>document.F=Object</script"+d),a.close(),L=a.F;c--;)delete L.prototype[I[c]];return L()},M=function(a,b){return function(c){var d,e=s(c),f=0,g=[];for(d in e)d!=x&&k(e,d)&&g.push(d);for(;b>f;)k(e,d=a[f++])&&(~z(g,d)||g.push(d));return g}},N=function(){};f(f.S,"Object",{getPrototypeOf:e.getProto=e.getProto||function(a){return a=r(a),k(a,x)?a[x]:"function"==typeof a.constructor&&a instanceof a.constructor?a.constructor.prototype:a instanceof Object?A:null},getOwnPropertyNames:e.getNames=e.getNames||M(J,J.length,!0),create:e.create=e.create||f
;var d=a("./$"),e=a("./$.global"),f=a("./$.has"),g=a("./$.descriptors"),h=a("./$.export"),i=a("./$.redefine"),j=a("./$.fails"),k=a("./$.shared"),l=a("./$.set-to-string-tag"),m=a("./$.uid"),n=a("./$.wks"),o=a("./$.keyof"),p=a("./$.get-names"),q=a("./$.enum-keys"),r=a("./$.is-array"),s=a("./$.an-object"),t=a("./$.to-iobject"),u=a("./$.property-desc"),v=d.getDesc,w=d.setDesc,x=d.create,y=p.get,z=e.Symbol,A=e.JSON,B=A&&A.stringify,C=!1,D=n("_hidden"),E=d.isEnum,F=k("symbol-registry"),G=k("symbols"),H="function"==typeof z,I=Object.prototype,J=g&&j(function(){return 7!=x(w({},"a",{get:function(){return w(this,"a",{value:7}).a}})).a})?function(a,b,c){var d=v(I,b);d&&delete I[b],w(a,b,c),d&&a!==I&&w(I,b,d)}:w,K=function(a){var b=G[a]=x(z.prototype);return b._k=a,g&&C&&J(I,a,{configurable:!0,set:function(b){f(this,D)&&f(this[D],a)&&(this[D][a]=!1),J(this,a,u(1,b))}}),b},L=function(a){return"symbol"==typeof a},M=function(a,b,c){return c&&f(G,b)?(c.enumerable?(f(a,D)&&a[D][b]&&(a[D][b]=!1),c=x(c,{enumerable:u(0,!1)})):(f(a,D)||w(a,D,u(1,{})),a[D][b]=!0),J(a,b,c)):w(a,b,c)},N=function(a,b){s(a);for(var c,d=q(b=t(b)),e=0,f=d.length;f>e;)M(a,c=d[e++],b[c]);return a},O=function(a,b){return void 0===b?x(a):N(x(a),b)},P=function(a){var b=E.call(this,a);return!(b||!f(this,a)||!f(G,a)||f(this,D)&&this[D][a])||b},Q=function(a,b){var c=v(a=t(a),b);return!c||!f(G,b)||f(a,D)&&a[D][b]||(c.enumerable=!0),c},R=function(a){for(var b,c=y(t(a)),d=[],e=0;c.length>e;)f(G,b=c[e++])||b==D||d.push(b);return d},S=function(a){for(var b,c=y(t(a)),d=[],e=0;c.length>e;)f(G,b=c[e++])&&d.push(G[b]);return d},T=function(a){if(void 0!==a&&!L(a)){for(var b,c,d=[a],e=1,f=arguments;f.length>e;)d.push(f[e++]);return b=d[1],"function"==typeof b&&(c=b),!c&&r(b)||(b=function(a,b){if(c&&(b=c.call(this,a,b)),!L(b))return b}),d[1]=b,B.apply(A,d)}},U=j(function(){var a=z();return"[null]"!=B([a])||"{}"!=B({a:a})||"{}"!=B(Object(a))});H||(z=function(){if(L(this))throw TypeError("Symbol is not a constructor");return K(m(arguments.length>0?arguments[0]:void 0))},i(z.prototype,"toString",function(){return this._k}),L=function(a){return a instanceof z},d.create=O,d.isEnum=P,d.getDesc=Q,d.setDesc=M,d.setDescs=N,d.getNames=p.get=R,d.getSymbols=S,g&&!a("./$.library")&&i(I,"propertyIsEnumerable",P,!0));var V={for:function(a){return f(F,a+="")?F[a]:F[a]=z(a)},keyFor:function(a){return o(F,a)},useSetter:function(){C=!0},useSimple:function(){C=!1}};d.each.call("hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),function(a){var b=n(a);V[a]=H?b:K(b)}),C=!0,h(h.G+h.W,{Symbol:z}),h(h.S,"Symbol",V),h(h.S+h.F*!H,"Object",{create:O,defineProperty:M,defineProperties:N,getOwnPropertyDescriptor:Q,getOwnPropertyNames:R,getOwnPropertySymbols:S}),A&&h(h.S+h.F*(!H||U),"JSON",{stringify:T}),l(z,"Symbol"),l(Math,"Math",!0),l(e.JSON,"JSON",!0)},{"./$":53,"./$.an-object":11,"./$.descriptors":26,"./$.enum-keys":28,"./$.export":29,"./$.fails":31,"./$.get-names":35,"./$.global":36,"./$.has":37,"./$.is-array":43,"./$.keyof":54,"./$.library":55,"./$.property-desc":66,"./$.redefine":68,"./$.set-to-string-tag":73,"./$.shared":74,"./$.to-iobject":85,"./$.uid":89,"./$.wks":90}],177:[function(a,b,c){"use strict";var d=a("./$"),e=a("./$.redefine"),f=a("./$.collection-weak"),g=a("./$.is-object"),h=a("./$.has"),i=f.frozenStore,j=f.WEAK,k=Object.isExtensible||g,l={},m=a("./$.collection")("WeakMap",function(a){return function(){return a(this,arguments.length>0?arguments[0]:void 0)}},{get:function(a){if(g(a)){if(!k(a))return i(this).get(a);if(h(a,j))return a[j][this._i]}},set:function(a,b){return f.def(this,a,b)}},f,!0,!0);7!=(new m).set((Object.freeze||Object)(l),7).get(l)&&d.each.call(["delete","has","get","set"],function(a){var b=m.prototype,c=b[a];e(b,a,function(b,d){if(g(b)&&!k(b)){var e=i(this)[a](b,d);return"set"==a?this:e}return c.call(this,b,d)})})},{"./$":53,"./$.collection":22,"./$.collection-weak":21,"./$.has":37,"./$.is-object":45,"./$.redefine":68}],178:[function(a,b,c){"use strict";var d=a("./$.collection-weak");a("./$.collection")("