a-calc 3.0.0-beta.20251208 → 3.0.0-beta.2025120803
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a-calc.versions.js +1 -1
- package/browser/index.js +1 -1
- package/cjs/index.js +1 -1
- package/es/index.js +1 -1
- package/package.json +1 -1
package/a-calc.versions.js
CHANGED
|
@@ -48,7 +48,7 @@ try{
|
|
|
48
48
|
'2.2.9', '2.2.10', '2.2.11',
|
|
49
49
|
'2.2.12', '2.2.13-dev.20241119', '2.2.13-dev.2024111902',
|
|
50
50
|
'2.2.13', '2.2.14-dev.20241204', '2.2.14-dev.2024120401',
|
|
51
|
-
'2.2.14', '2.2.15',
|
|
51
|
+
'2.2.14', '2.2.15', '3.0.0-beta.20251208', '3.0.0-beta.2025120802'
|
|
52
52
|
]; a_calc_versions;
|
|
53
53
|
}
|
|
54
54
|
finally
|
package/browser/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var a_calc=function(exports){"use strict";function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,u=[],s=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return u}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function c(e,t,r,i){var a=t&&t.prototype instanceof f?t:f,o=Object.create(a.prototype),u=new N(i||[]);return n(o,"_invoke",{value:w(e,r,u)}),o}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var _={};function f(){}function p(){}function h(){}var v={};s(v,a,(function(){return this}));var m=Object.getPrototypeOf,d=m&&m(m(A([])));d&&d!==t&&r.call(d,a)&&(v=d);var g=h.prototype=f.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function i(n,a,o,u){var s=l(e[n],e,a);if("throw"!==s.type){var c=s.arg,_=c.value;return _&&"object"==typeof _&&r.call(_,"__await")?t.resolve(_.__await).then((function(e){i("next",e,o,u)}),(function(e){i("throw",e,o,u)})):t.resolve(_).then((function(e){c.value=e,o(c)}),(function(e){return i("throw",e,o,u)}))}u(s.arg)}var a;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function w(e,t,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return O()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var u=x(o,r);if(u){if(u===_)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(e,t,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===_)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function x(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var i=l(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,_;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,_):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,_)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function A(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=h,n(g,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:p,configurable:!0}),p.displayName=s(h,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,s(e,u,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(y.prototype),s(y.prototype,o,(function(){return this})),e.AsyncIterator=y,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new y(c(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},b(g),s(g,u,"Generator"),s(g,a,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=A,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return o.type="throw",o.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,_):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),_},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),_}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),_}},e}function _typeof(e){return _typeof="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},_typeof(e)}function asyncGeneratorStep(e,t,r,n,i,a,o){try{var u=e[a](o),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,i)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function o(e){asyncGeneratorStep(a,n,i,o,u,"next",e)}function u(e){asyncGeneratorStep(a,n,i,o,u,"throw",e)}o(void 0)}))}}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:String(t)}var version="3.0.0-beta.20251208";function decimal_round(e,t,r,n,i){var a=e,o=t,u=t.length,s={"~-":function(){var e="<"===r?n-1:n;o=t.slice(0,e)},"~+":function(){var e="<"===r?n-1:n;if(!(u<=e||0===u)){var i=t.slice(0,e);0==+t.slice(e,u)?o=i:(i=(+"9".concat(i)+1).toString().slice(1)).length>e?(o=i.slice(1,i.length),a=(+a+1).toString()):o=i}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;o=t.slice(0,e);var i=+t[e];Number.isNaN(i)||i>=5&&(o=(+"9".concat(o)+1).toString().slice(1)).length>e&&(o=o.slice(1,o.length),a=(+a+1).toString())}},"~6":function(){if(0!==u){var i,s="<"===r?n-1:n,c=+t[s],l=t.slice(+s+1,t.length);l=""===l?0:parseInt(l),i=0===s?+e[e.length-1]:+t[s-1],o=t.slice(0,s),(c>=6||5===c&&l>0||5===c&&i%2!=0)&&(o=(+"9".concat(o)+1).toString().slice(1)).length>s&&(o=o.slice(1,o.length),a=(+a+1).toString())}}};return"<="===r?u<=n?o=t.replace(/0*$/,""):(s[i]&&s[i](),o=o.replace(/0+$/,"")):"<"===r?u<n?o=t.replace(/0*$/,""):(s[i]&&s[i](),o=o.replace(/0+$/,"")):"="===r?u<n?o=t+"0".repeat(n-u):u>n&&s[i]&&s[i]():">="===r?u<n&&(o=t+"0".repeat(n-u)):">"===r&&u<=n&&(o=t+"0".repeat(n-u+1)),{int_part:a,dec_part:o}}var number_char="0123456789",var_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",number_first_char="0123456789-+",var_members_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$[].'\"",var_first_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",pure_number_var_first_char="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",empty_char=" \n\r\t",number_char_set=new Set(number_char),var_char_set=new Set(var_char),var_members_char_set=new Set(var_members_char),var_first_char_set=new Set(var_first_char);new Set(number_first_char);var pure_number_var_first_char_set=new Set(pure_number_var_first_char),empty_char_set=new Set(empty_char),state_initial="initial",state_number="number",state_scientific="scientific",state_operator="operator",state_bracket="bracket",state_var="var",state_symbol="symbol",state_percent="percent",state_round="round",state_plus="plus",state_comma="comma",state_fraction="fraction",state_to_number="to-number",state_to_number_string="to-number-string",state_fallback_var="fallback_var",state_integer_padding="integer_padding",state_volume="volume",state_unit_after="unit_after",state_unit_before="unit_before",state_unit_middle="unit_middle",operator_set=new Set(["+","-","*","/","%","**","//"]),isArray=Array.isArray,freeGlobal="object"==("undefined"==typeof global?"undefined":_typeof(global))&&global&&global.Object===Object&&global,freeSelf="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),_Symbol=root.Symbol,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty,nativeObjectToString$1=objectProto$4.toString,symToStringTag$1=_Symbol?_Symbol.toStringTag:void 0;function getRawTag(e){var t=hasOwnProperty$3.call(e,symToStringTag$1),r=e[symToStringTag$1];try{e[symToStringTag$1]=void 0;var n=!0}catch(e){}var i=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),i}var objectProto$3=Object.prototype,nativeObjectToString=objectProto$3.toString;function objectToString(e){return nativeObjectToString.call(e)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol?_Symbol.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}function isObjectLike(e){return null!=e&&"object"==_typeof(e)}var symbolTag="[object Symbol]";function isSymbol(e){return"symbol"==_typeof(e)||isObjectLike(e)&&baseGetTag(e)==symbolTag}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray(e))return!1;var r=_typeof(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}function isObject(e){var t=_typeof(e);return null!=e&&("object"==t||"function"==t)}var asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}var coreJsData=root["__core-js_shared__"],maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$2=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$2=objectProto$2.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$2).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}function getValue(e,t){return null==e?void 0:e[t]}function getNative(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var nativeCreate=getNative(Object,"create");function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HASH_UNDEFINED$1="__lodash_hash_undefined__",objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function hashGet(e){var t=this.__data__;if(nativeCreate){var r=t[e];return r===HASH_UNDEFINED$1?void 0:r}return hasOwnProperty$1.call(t,e)?t[e]:void 0}var objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function hashHas(e){var t=this.__data__;return nativeCreate?void 0!==t[e]:hasOwnProperty.call(t,e)}var HASH_UNDEFINED="__lodash_hash_undefined__";function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate&&void 0===t?HASH_UNDEFINED:t,this}function Hash(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function listCacheClear(){this.__data__=[],this.size=0}function eq(e,t){return e===t||e!=e&&t!=t}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?void 0:t[r][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var Map=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function isKeyable(e){var t=_typeof(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function getMapData(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function MapCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var FUNC_ERROR_TEXT="Expected a function";function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function r(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(memoize.Cache||MapCache),r}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize(e,(function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e})),r=t.cache;return t}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,(function(e,r,n,i){t.push(n?i.replace(reEscapeChar,"$1"):r||e)})),t}));function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var symbolProto=_Symbol?_Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(isArray(e))return arrayMap(e,baseToString)+"";if(isSymbol(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function toString(e){return null==e?"":baseToString(e)}function castPath(e,t){return isArray(e)?e:isKey(e,t)?[e]:stringToPath(toString(e))}function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function baseGet(e,t){for(var r=0,n=(t=castPath(t,e)).length;null!=e&&r<n;)e=e[toKey(t[r++])];return r&&r==n?e:void 0}function get(e,t,r){var n=null==e?void 0:baseGet(e,t);return void 0===n?r:n}var REG_UNIT_NUM_SCIENTIFIC=/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,REG_UNIT_NUM_NORMAL=/^([+-]?[\d.]+)(.*)$/;function split_unit_num(e){var t,r,n=(e="string"!=typeof e?e.toString():e).match(REG_UNIT_NUM_SCIENTIFIC)||e.match(REG_UNIT_NUM_NORMAL);if(n){r=n[1];var i=n[2];""!==i.trim()&&(t=i)}return{num:r,unit:t}}function find_value(e,t,r){var n,i,a,o;return Array.isArray(e)?e.length>1?null!==(n=null!==(i=get(e[0],t))&&void 0!==i?i:get(e.at(-1),t))&&void 0!==n?n:r:1===e.length&&null!==(a=get(e[0],t))&&void 0!==a?a:r:null!==(o=get(e,t,r))&&void 0!==o?o:r}function parse_mantissa(e,t,r,n){var i=e.split("."),a=i[0],o=1===i.length?"":i[1],u=decimal_round(a,o,t,+r,n);return a=u.int_part,""===(o=u.dec_part)?a:"".concat(a,".").concat(o)}function integer_thousands(e){for(var t=e.length,r="";t>0;)r=e.substring(t-3,t)+(""!==r?",":"")+r,t-=3;return r}function parse_thousands(e){var t=e.split("."),r=t[0];return"-"===r[0]?t[0]="-"+integer_thousands(r.slice(1)):t[0]=integer_thousands(r),t.join(".")}function promise_queue(e){return _promise_queue.apply(this,arguments)}function _promise_queue(){return _promise_queue=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n,i,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 2:if(!(n<t.length)){e.next=16;break}return e.prev=3,e.next=6,Promise.race([t[n],new Promise((function(e,t){setTimeout((function(){return t(new Error("promise queue timeout err"))}),r)}))]);case 6:i=e.sent,e.next=12;break;case 9:return e.prev=9,e.t0=e.catch(3),e.abrupt("continue",13);case 12:return e.abrupt("return",i);case 13:n++,e.next=2;break;case 16:return e.abrupt("return",Promise.reject("错误的 promise queue 调用"));case 17:case"end":return e.stop()}}),e,null,[[3,9]])}))),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r<t.length)){e.next=16;break}return e.prev=2,e.next=5,fetch(t[r]);case 5:if(!e.sent.ok){e.next=8;break}return e.abrupt("return",t[r]);case 8:e.next=13;break;case 10:return e.prev=10,e.t0=e.catch(2),e.abrupt("continue",13);case 13:r++,e.next=1;break;case 16:return e.abrupt("return",null);case 17:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function get_real_value(e,t){if(Array.isArray(e)){for(var r,n=0,i=e.length;n<i;n++){var a;if(void 0!==(r=null!==(a=get(e[n],t))&&void 0!==a?a:void 0))break}if(void 0===r)throw new Error("填充变量".concat(t,"失败"));return r}var o;return null!==(o=get(e,t))&&void 0!==o?o:void 0}function isEmptyForFallback(e,t,r){return r&&"function"==typeof r._empty_check?r._empty_check(e,t):r&&Array.isArray(r._empty_values)?r._empty_values.some((function(t){return!(!Number.isNaN(t)||!Number.isNaN(e))||e===t})):null==e}function get_fallback_value(e,t,r){for(var n=0;n<t.length;n++){var i=t[n].trim(),a=void 0;try{if(Array.isArray(e))for(var o=0;o<e.length;o++){var u=get(e[o],i);if(void 0!==u){a=u;break}}else a=get(e,i)}catch(e){continue}if(!isEmptyForFallback(a,i,r))return{value:a,path:i}}throw new Error("多路取值失败,所有路径均为空值: ".concat(t.join(" | ")))}function get_next_nonempty_char(e,t,r){var n;for(t++;t<r;){if(n=e[t],!empty_char_set.has(n))return n;t++}}function splitExprAndFmt(e){for(var t=0,r=0;r<e.length;r++){var n=e[r];if("("===n)t++;else if(")"===n)t--;else if("|"===n&&0===t)return{expr:e.slice(0,r),fmt:e.slice(r+1).trim()}}return{expr:e,fmt:""}}function parse_args(e,t){var r="",n={origin_expr:e,origin_fill_data:t,expr:"",fmt_expr:"",options:void 0,fill_data:void 0,_unit:void 0,_mode:void 0,_fmt:void 0,_empty_values:void 0,_empty_check:void 0,_volume_units:void 0,_volume_step:void 0,_presets:void 0,_unit_input:void 0,_unit_output:void 0,_unit_position:void 0,_unit_transform:void 0};if(null!=t&&(n.options=t,Array.isArray(t)?n.fill_data=t:Array.isArray(t._fill_data)?n.fill_data=[t].concat(_toConsumableArray(t._fill_data)):void 0===t._fill_data?n.fill_data=[t]:n.fill_data=[t,t._fill_data]),n._mode=find_value(t,"_mode","normal"),n._unit=find_value(t,"_unit",!1),n._fmt=find_value(t,"_fmt"),n._empty_values=find_value(t,"_empty_values"),n._empty_check=find_value(t,"_empty_check"),n._volume_units=find_value(t,"_volume_units"),n._volume_step=find_value(t,"_volume_step"),n._presets=find_value(t,"_presets"),n._unit_input=find_value(t,"_unit_input"),n._unit_output=find_value(t,"_unit_output"),n._unit_position=find_value(t,"_unit_position"),n._unit_transform=find_value(t,"_unit_transform"),"string"==typeof e){if(r=e,""===e.trim()||e.includes("NaN"))throw new Error("非法的表达式:".concat(e))}else{if("number"!=typeof e)throw new Error("错误的第一个参数类型: ".concat(e," 类型为:").concat(_typeof(e)));if(isNaN(e))throw new Error("传入了一个非法数字NaN");r=e.toString()}var i=splitExprAndFmt(r),a=i.expr,o=i.fmt;return n.expr=a,n.fmt_expr=o,n}function detectFallbackVar$1(e,t){if("("!==e[t])return null;for(var r=0,n=!1,i=[],a="",o=t;o<e.length;){var u=e[o];if("("===u){if(0===r){r++,o++;continue}r++,a+=u}else if(")"===u){if(0===--r)return n?(i.push(a.trim()),{paths:i,endIndex:o}):null;a+=u}else"|"===u&&1===r?(n=!0,i.push(a.trim()),a=""):a+=u;o++}return null}function push_token$3(e,t){if(t.curr_state===state_number||t.curr_state===state_scientific){var r=t.expr.slice(t.prev_index,t.cur_index);if(t._unit){var n,i=split_unit_num(r),a=i.num,o=i.unit;if(void 0===o)e.push({type:state_number,value:a,real_value:a,has_unit:!1});else t.has_unit=!0,null!==(n=t.unit_str)&&void 0!==n||(t.unit_str=o),e.push({type:state_number,value:a,real_value:a,has_unit:!0,unit:o})}else e.push({type:state_number,value:r,real_value:r,has_unit:!1})}else if(t.curr_state===state_var){t.has_var=!0;var u=t.expr.slice(t.prev_index,t.cur_index),s=get_real_value(t.fill_data,u);if(t._unit){var c,l=split_unit_num(s),_=l.num,f=l.unit;if(void 0===f)e.push({type:"var",value:u,real_value:_,has_unit:!1});else t.has_unit=!0,null!==(c=t.unit_str)&&void 0!==c||(t.unit_str=f),e.push({type:"var",value:u,real_value:_,has_unit:!0,unit:f})}else e.push({type:"var",value:u,real_value:s,has_unit:!1})}else e.push({type:t.curr_state,value:t.expr.slice(t.prev_index,t.cur_index)});t.curr_state=state_initial,t.prev_index=t.cur_index}function tokenizer(e,t,r,n){for(var i,a={has_var:!1,has_unit:!1,unit_str:void 0,fill_data:t,cur_index:0,prev_index:0,curr_state:state_initial,expr:e,_unit:r},o=e.length,u=[];a.cur_index<o;)switch(i=e[a.cur_index],a.curr_state){case state_initial:if(number_char_set.has(i))a.curr_state=state_number,a.cur_index++;else if(" "===i)a.cur_index++,a.prev_index=a.cur_index;else if("+-".includes(i)){var s=u.at(-1);0===a.cur_index||"operator"===(null==s?void 0:s.type)||"("===(null==s?void 0:s.value)?(a.curr_state=state_number,a.cur_index++):(a.cur_index++,u.push({type:state_operator,value:e.slice(a.prev_index,a.cur_index)}),a.prev_index=a.cur_index)}else if("*/%".includes(i))a.curr_state=state_operator,a.cur_index++;else if(var_char_set.has(i))a.curr_state=state_var,a.cur_index++;else if("("===i){var c=detectFallbackVar$1(e,a.cur_index);if(c){a.has_var=!0;var l=get_fallback_value(t,c.paths,n),_=l.value,f=l.path;if(r){var p,h=split_unit_num(_),v=h.num,m=h.unit;if(void 0!==m)a.has_unit=!0,null!==(p=a.unit_str)&&void 0!==p||(a.unit_str=m),u.push({type:state_fallback_var,value:c.paths,real_value:v,matched_path:f,has_unit:!0,unit:m});else u.push({type:state_fallback_var,value:c.paths,real_value:v,matched_path:f,has_unit:!1})}else u.push({type:state_fallback_var,value:c.paths,real_value:_,matched_path:f,has_unit:!1});a.cur_index=c.endIndex+1,a.prev_index=a.cur_index}else u.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index}else")"===i?(u.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index):(a.cur_index++,a.prev_index=a.cur_index);break;case state_number:if(number_char_set.has(i))a.cur_index++;else if("."===i){if(a.cur_index===a.prev_index||e.slice(a.prev_index,a.cur_index).includes("."))throw new Error("非法的小数部分".concat(e.slice(a.prev_index,a.cur_index)));a.cur_index++}else"e"===i?(a.curr_state=state_scientific,a.cur_index++):r?"*/+-() ".indexOf(i)>-1||"%"===i&&number_char_set.has(e[a.cur_index-1])&&pure_number_var_first_char_set.has(get_next_nonempty_char(e,a.cur_index,o))?push_token$3(u,a):a.cur_index++:push_token$3(u,a);break;case state_operator:var d=e[a.cur_index-1];"*"===i&&"*"===d?(a.cur_index++,u.push({type:state_operator,value:"**"}),a.prev_index=a.cur_index):"/"===i&&"/"===d?(a.cur_index++,u.push({type:state_operator,value:"//"}),a.prev_index=a.cur_index):(u.push({type:state_operator,value:d}),a.prev_index=a.cur_index),a.curr_state=state_initial;break;case state_var:var_members_char_set.has(i)?a.cur_index++:push_token$3(u,a);break;case state_scientific:if(number_char_set.has(i))a.cur_index++;else if("+-".includes(i)){var g=a.prev_index;"+-".includes(e[g])&&(g+=1);var b=e.slice(g,a.cur_index),y=b.at(-1);b.includes(i)||"e"!==y?push_token$3(u,a):a.cur_index++}else r&&-1==="*/+-() ".indexOf(i)?a.cur_index++:push_token$3(u,a);break;default:throw new Error("字符扫描状态错误")}return a.prev_index<a.cur_index&&push_token$3(u,a),u.has_var=a.has_var,u.has_unit=a.has_unit,u.unit=a.unit_str,u}var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(e){var t,r,n,i,a,o,u,s,c,l,_=N.prototype={constructor:N,toString:null,valueOf:null},f=new N(1),p=20,h=4,v=-7,m=21,d=-1e7,g=1e7,b=!1,y=1,w=0,x={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},S="0123456789abcdefghijklmnopqrstuvwxyz",E=!0;function N(e,t){var i,a,o,u,s,c,l,_,f=this;if(!(f instanceof N))return new N(e,t);if(null==t){if(e&&!0===e._isBigNumber)return f.s=e.s,void(!e.c||e.e>g?f.c=f.e=null:e.e<d?f.c=[f.e=0]:(f.e=e.e,f.c=e.c.slice()));if((c="number"==typeof e)&&0*e==0){if(f.s=1/e<0?(e=-e,-1):1,e===~~e){for(u=0,s=e;s>=10;s/=10,u++);return void(u>g?f.c=f.e=null:(f.e=u,f.c=[e]))}_=String(e)}else{if(!isNumeric.test(_=String(e)))return n(f,_,c);f.s=45==_.charCodeAt(0)?(_=_.slice(1),-1):1}(u=_.indexOf("."))>-1&&(_=_.replace(".","")),(s=_.search(/e/i))>0?(u<0&&(u=s),u+=+_.slice(s+1),_=_.substring(0,s)):u<0&&(u=_.length)}else{if(intCheck(t,2,S.length,"Base"),10==t&&E)return B(f=new N(e),p+f.e+1,h);if(_=String(e),c="number"==typeof e){if(0*e!=0)return n(f,_,c,t);if(f.s=1/e<0?(_=_.slice(1),-1):1,N.DEBUG&&_.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+e)}else f.s=45===_.charCodeAt(0)?(_=_.slice(1),-1):1;for(i=S.slice(0,t),u=s=0,l=_.length;s<l;s++)if(i.indexOf(a=_.charAt(s))<0){if("."==a){if(s>u){u=l;continue}}else if(!o&&(_==_.toUpperCase()&&(_=_.toLowerCase())||_==_.toLowerCase()&&(_=_.toUpperCase()))){o=!0,s=-1,u=0;continue}return n(f,String(e),c,t)}c=!1,(u=(_=r(_,t,10,f.s)).indexOf("."))>-1?_=_.replace(".",""):u=_.length}for(s=0;48===_.charCodeAt(s);s++);for(l=_.length;48===_.charCodeAt(--l););if(_=_.slice(s,++l)){if(l-=s,c&&N.DEBUG&&l>15&&(e>MAX_SAFE_INTEGER||e!==mathfloor(e)))throw Error(tooManyDigits+f.s*e);if((u=u-s-1)>g)f.c=f.e=null;else if(u<d)f.c=[f.e=0];else{if(f.e=u,f.c=[],s=(u+1)%LOG_BASE,u<0&&(s+=LOG_BASE),s<l){for(s&&f.c.push(+_.slice(0,s)),l-=LOG_BASE;s<l;)f.c.push(+_.slice(s,s+=LOG_BASE));s=LOG_BASE-(_=_.slice(s)).length}else s-=l;for(;s--;_+="0");f.c.push(+_)}}else f.c=[f.e=0]}function A(e,t,r,n){var i,a,o,u,s;if(null==r?r=h:intCheck(r,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,null==t)s=coeffToString(e.c),s=1==n||2==n&&(o<=v||o>=m)?toExponential(s,o):toFixedPoint(s,o,"0");else if(a=(e=B(new N(e),t,r)).e,u=(s=coeffToString(e.c)).length,1==n||2==n&&(t<=a||a<=v)){for(;u<t;s+="0",u++);s=toExponential(s,a)}else if(t-=o,s=toFixedPoint(s,a,"0"),a+1>u){if(--t>0)for(s+=".";t--;s+="0");}else if((t+=a-u)>0)for(a+1==u&&(s+=".");t--;s+="0");return e.s<0&&i?"-"+s:s}function O(e,t){for(var r,n=1,i=new N(e[0]);n<e.length;n++){if(!(r=new N(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function k(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*LOG_BASE-1)>g?e.c=e.e=null:r<d?e.c=[e.e=0]:(e.e=r,e.c=t),e}function B(e,t,r,n){var i,a,o,u,s,c,l,_=e.c,f=POWS_TEN;if(_){e:{for(i=1,u=_[0];u>=10;u/=10,i++);if((a=t-i)<0)a+=LOG_BASE,o=t,l=(s=_[c=0])/f[i-o-1]%10|0;else if((c=mathceil((a+1)/LOG_BASE))>=_.length){if(!n)break e;for(;_.length<=c;_.push(0));s=l=0,i=1,o=(a%=LOG_BASE)-LOG_BASE+1}else{for(s=u=_[c],i=1;u>=10;u/=10,i++);l=(o=(a%=LOG_BASE)-LOG_BASE+i)<0?0:s/f[i-o-1]%10|0}if(n=n||t<0||null!=_[c+1]||(o<0?s:s%f[i-o-1]),n=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(a>0?o>0?s/f[i-o]:0:_[c-1])%10&1||r==(e.s<0?8:7)),t<1||!_[0])return _.length=0,n?(t-=e.e+1,_[0]=f[(LOG_BASE-t%LOG_BASE)%LOG_BASE],e.e=-t||0):_[0]=e.e=0,e;if(0==a?(_.length=c,u=1,c--):(_.length=c+1,u=f[LOG_BASE-a],_[c]=o>0?mathfloor(s/f[i-o]%f[o])*u:0),n)for(;;){if(0==c){for(a=1,o=_[0];o>=10;o/=10,a++);for(o=_[0]+=u,u=1;o>=10;o/=10,u++);a!=u&&(e.e++,_[0]==BASE&&(_[0]=1));break}if(_[c]+=u,_[c]!=BASE)break;_[c--]=0,u=1}for(a=_.length;0===_[--a];_.pop());}e.e>g?e.c=e.e=null:e.e<d&&(e.c=[e.e=0])}return e}function T(e){var t,r=e.e;return null===r?e.toString():(t=coeffToString(e.c),t=r<=v||r>=m?toExponential(t,r):toFixedPoint(t,r,"0"),e.s<0?"-"+t:t)}return N.clone=clone,N.ROUND_UP=0,N.ROUND_DOWN=1,N.ROUND_CEIL=2,N.ROUND_FLOOR=3,N.ROUND_HALF_UP=4,N.ROUND_HALF_DOWN=5,N.ROUND_HALF_EVEN=6,N.ROUND_HALF_CEIL=7,N.ROUND_HALF_FLOOR=8,N.EUCLID=9,N.config=N.set=function(e){var t,r;if(null!=e){if("object"!=_typeof(e))throw Error(bignumberError+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(intCheck(r=e[t],0,MAX,t),p=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(intCheck(r=e[t],0,8,t),h=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(intCheck(r[0],-MAX,0,t),intCheck(r[1],0,MAX,t),v=r[0],m=r[1]):(intCheck(r,-MAX,MAX,t),v=-(m=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)intCheck(r[0],-MAX,-1,t),intCheck(r[1],1,MAX,t),d=r[0],g=r[1];else{if(intCheck(r,-MAX,MAX,t),!r)throw Error(bignumberError+t+" cannot be zero: "+r);d=-(g=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(bignumberError+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw b=!r,Error(bignumberError+"crypto unavailable");b=r}else b=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(intCheck(r=e[t],0,9,t),y=r),e.hasOwnProperty(t="POW_PRECISION")&&(intCheck(r=e[t],0,MAX,t),w=r),e.hasOwnProperty(t="FORMAT")){if("object"!=_typeof(r=e[t]))throw Error(bignumberError+t+" not an object: "+r);x=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(bignumberError+t+" invalid: "+r);E="0123456789"==r.slice(0,10),S=r}}return{DECIMAL_PLACES:p,ROUNDING_MODE:h,EXPONENTIAL_AT:[v,m],RANGE:[d,g],CRYPTO:b,MODULO_MODE:y,POW_PRECISION:w,FORMAT:x,ALPHABET:S}},N.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!N.DEBUG)return!0;var t,r,n=e.c,i=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&i>=-MAX&&i<=MAX&&i===mathfloor(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%LOG_BASE)<1&&(t+=LOG_BASE),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=BASE||r!==mathfloor(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===a||1===a||-1===a))return!0;throw Error(bignumberError+"Invalid BigNumber: "+e)},N.maximum=N.max=function(){return O(arguments,_.lt)},N.minimum=N.min=function(){return O(arguments,_.gt)},N.random=(i=9007199254740992,a=Math.random()*i&2097151?function(){return mathfloor(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,u=0,s=[],c=new N(f);if(null==e?e=p:intCheck(e,0,MAX),i=mathceil(e/LOG_BASE),b)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));u<i;)(o=131072*t[u]+(t[u+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[u]=r[0],t[u+1]=r[1]):(s.push(o%1e14),u+=2);u=i/2}else{if(!crypto.randomBytes)throw b=!1,Error(bignumberError+"crypto unavailable");for(t=crypto.randomBytes(i*=7);u<i;)(o=281474976710656*(31&t[u])+1099511627776*t[u+1]+4294967296*t[u+2]+16777216*t[u+3]+(t[u+4]<<16)+(t[u+5]<<8)+t[u+6])>=9e15?crypto.randomBytes(7).copy(t,u):(s.push(o%1e14),u+=7);u=i/7}if(!b)for(;u<i;)(o=a())<9e15&&(s[u++]=o%1e14);for(i=s[--u],e%=LOG_BASE,i&&e&&(o=POWS_TEN[LOG_BASE-e],s[u]=mathfloor(i/o)*o);0===s[u];s.pop(),u--);if(u<0)s=[n=0];else{for(n=-1;0===s[0];s.splice(0,1),n-=LOG_BASE);for(u=1,o=s[0];o>=10;o/=10,u++);u<LOG_BASE&&(n-=LOG_BASE-u)}return c.e=n,c.c=s,c}),N.sum=function(){for(var e=1,t=arguments,r=new N(t[0]);e<t.length;)r=r.plus(t[e++]);return r},r=function(){var e="0123456789";function r(e,t,r,n){for(var i,a,o=[0],u=0,s=e.length;u<s;){for(a=o.length;a--;o[a]*=t);for(o[0]+=n.indexOf(e.charAt(u++)),i=0;i<o.length;i++)o[i]>r-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/r|0,o[i]%=r)}return o.reverse()}return function(n,i,a,o,u){var s,c,l,_,f,v,m,d,g=n.indexOf("."),b=p,y=h;for(g>=0&&(_=w,w=0,n=n.replace(".",""),v=(d=new N(i)).pow(n.length-g),w=_,d.c=r(toFixedPoint(coeffToString(v.c),v.e,"0"),10,a,e),d.e=d.c.length),l=_=(m=r(n,i,a,u?(s=S,e):(s=e,S))).length;0==m[--_];m.pop());if(!m[0])return s.charAt(0);if(g<0?--l:(v.c=m,v.e=l,v.s=o,m=(v=t(v,d,b,y,a)).c,f=v.r,l=v.e),g=m[c=l+b+1],_=a/2,f=f||c<0||null!=m[c+1],f=y<4?(null!=g||f)&&(0==y||y==(v.s<0?3:2)):g>_||g==_&&(4==y||f||6==y&&1&m[c-1]||y==(v.s<0?8:7)),c<1||!m[0])n=f?toFixedPoint(s.charAt(1),-b,s.charAt(0)):s.charAt(0);else{if(m.length=c,f)for(--a;++m[--c]>a;)m[c]=0,c||(++l,m=[1].concat(m));for(_=m.length;!m[--_];);for(g=0,n="";g<=_;n+=s.charAt(m[g++]));n=toFixedPoint(n,l,s.charAt(0))}return n}}(),t=function(){function e(e,t,r){var n,i,a,o,u=0,s=e.length,c=t%SQRT_BASE,l=t/SQRT_BASE|0;for(e=e.slice();s--;)u=((i=c*(a=e[s]%SQRT_BASE)+(n=l*a+(o=e[s]/SQRT_BASE|0)*c)%SQRT_BASE*SQRT_BASE+u)/r|0)+(n/SQRT_BASE|0)+l*o,e[s]=i%r;return u&&(e=[u].concat(e)),e}function t(e,t,r,n){var i,a;if(r!=n)a=r>n?1:-1;else for(i=a=0;i<r;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,a,o,u){var s,c,l,_,f,p,h,v,m,d,g,b,y,w,x,S,E,A=n.s==i.s?1:-1,O=n.c,k=i.c;if(!(O&&O[0]&&k&&k[0]))return new N(n.s&&i.s&&(O?!k||O[0]!=k[0]:k)?O&&0==O[0]||!k?0*A:A/0:NaN);for(m=(v=new N(A)).c=[],A=a+(c=n.e-i.e)+1,u||(u=BASE,c=bitFloor(n.e/LOG_BASE)-bitFloor(i.e/LOG_BASE),A=A/LOG_BASE|0),l=0;k[l]==(O[l]||0);l++);if(k[l]>(O[l]||0)&&c--,A<0)m.push(1),_=!0;else{for(w=O.length,S=k.length,l=0,A+=2,(f=mathfloor(u/(k[0]+1)))>1&&(k=e(k,f,u),O=e(O,f,u),S=k.length,w=O.length),y=S,g=(d=O.slice(0,S)).length;g<S;d[g++]=0);E=k.slice(),E=[0].concat(E),x=k[0],k[1]>=u/2&&x++;do{if(f=0,(s=t(k,d,S,g))<0){if(b=d[0],S!=g&&(b=b*u+(d[1]||0)),(f=mathfloor(b/x))>1)for(f>=u&&(f=u-1),h=(p=e(k,f,u)).length,g=d.length;1==t(p,d,h,g);)f--,r(p,S<h?E:k,h,u),h=p.length,s=1;else 0==f&&(s=f=1),h=(p=k.slice()).length;if(h<g&&(p=[0].concat(p)),r(d,p,g,u),g=d.length,-1==s)for(;t(k,d,S,g)<1;)f++,r(d,S<g?E:k,g,u),g=d.length}else 0===s&&(f++,d=[0]);m[l++]=f,d[0]?d[g++]=O[y]||0:(d=[O[y]],g=1)}while((y++<w||null!=d[0])&&A--);_=null!=d[0],m[0]||m.splice(0,1)}if(u==BASE){for(l=1,A=m[0];A>=10;A/=10,l++);B(v,a+(v.e=l+c*LOG_BASE-1)+1,o,_)}else v.e=c,v.r=+_;return v}}(),o=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,s=/^\.([^.]+)$/,c=/^-?(Infinity|NaN)$/,l=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(e,t,r,n){var i,a=r?t:t.replace(l,"");if(c.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(o,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,a=a.replace(u,"$1").replace(s,"0.$1")),t!=a))return new N(a,i);if(N.DEBUG)throw Error(bignumberError+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},_.absoluteValue=_.abs=function(){var e=new N(this);return e.s<0&&(e.s=1),e},_.comparedTo=function(e,t){return compare(this,new N(e,t))},_.decimalPlaces=_.dp=function(e,t){var r,n,i,a=this;if(null!=e)return intCheck(e,0,MAX),null==t?t=h:intCheck(t,0,8),B(new N(a),e+a.e+1,t);if(!(r=a.c))return null;if(n=((i=r.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},_.dividedBy=_.div=function(e,r){return t(this,new N(e,r),p,h)},_.dividedToIntegerBy=_.idiv=function(e,r){return t(this,new N(e,r),0,1)},_.exponentiatedBy=_.pow=function(e,t){var r,n,i,a,o,u,s,c,l=this;if((e=new N(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+T(e));if(null!=t&&(t=new N(t)),o=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return c=new N(Math.pow(+T(l),o?e.s*(2-isOdd(e)):+T(e))),t?c.mod(t):c;if(u=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new N(NaN);(n=!u&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||o&&l.c[1]>=24e7:l.c[0]<8e13||o&&l.c[0]<=9999975e7)))return a=l.s<0&&isOdd(e)?-0:0,l.e>-1&&(a=1/a),new N(u?1/a:a);w&&(a=mathceil(w/LOG_BASE+2))}for(o?(r=new N(.5),u&&(e.s=1),s=isOdd(e)):s=(i=Math.abs(+T(e)))%2,c=new N(f);;){if(s){if(!(c=c.times(l)).c)break;a?c.c.length>a&&(c.c.length=a):n&&(c=c.mod(t))}if(i){if(0===(i=mathfloor(i/2)))break;s=i%2}else if(B(e=e.times(r),e.e+1,1),e.e>14)s=isOdd(e);else{if(0===(i=+T(e)))break;s=i%2}l=l.times(l),a?l.c&&l.c.length>a&&(l.c.length=a):n&&(l=l.mod(t))}return n?c:(u&&(c=f.div(c)),t?c.mod(t):a?B(c,w,h,undefined):c)},_.integerValue=function(e){var t=new N(this);return null==e?e=h:intCheck(e,0,8),B(t,t.e+1,e)},_.isEqualTo=_.eq=function(e,t){return 0===compare(this,new N(e,t))},_.isFinite=function(){return!!this.c},_.isGreaterThan=_.gt=function(e,t){return compare(this,new N(e,t))>0},_.isGreaterThanOrEqualTo=_.gte=function(e,t){return 1===(t=compare(this,new N(e,t)))||0===t},_.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},_.isLessThan=_.lt=function(e,t){return compare(this,new N(e,t))<0},_.isLessThanOrEqualTo=_.lte=function(e,t){return-1===(t=compare(this,new N(e,t)))||0===t},_.isNaN=function(){return!this.s},_.isNegative=function(){return this.s<0},_.isPositive=function(){return this.s>0},_.isZero=function(){return!!this.c&&0==this.c[0]},_.minus=function(e,t){var r,n,i,a,o=this,u=o.s;if(t=(e=new N(e,t)).s,!u||!t)return new N(NaN);if(u!=t)return e.s=-t,o.plus(e);var s=o.e/LOG_BASE,c=e.e/LOG_BASE,l=o.c,_=e.c;if(!s||!c){if(!l||!_)return l?(e.s=-t,e):new N(_?o:NaN);if(!l[0]||!_[0])return _[0]?(e.s=-t,e):new N(l[0]?o:3==h?-0:0)}if(s=bitFloor(s),c=bitFloor(c),l=l.slice(),u=s-c){for((a=u<0)?(u=-u,i=l):(c=s,i=_),i.reverse(),t=u;t--;i.push(0));i.reverse()}else for(n=(a=(u=l.length)<(t=_.length))?u:t,u=t=0;t<n;t++)if(l[t]!=_[t]){a=l[t]<_[t];break}if(a&&(i=l,l=_,_=i,e.s=-e.s),(t=(n=_.length)-(r=l.length))>0)for(;t--;l[r++]=0);for(t=BASE-1;n>u;){if(l[--n]<_[n]){for(r=n;r&&!l[--r];l[r]=t);--l[r],l[n]+=BASE}l[n]-=_[n]}for(;0==l[0];l.splice(0,1),--c);return l[0]?k(e,l,c):(e.s=3==h?-1:1,e.c=[e.e=0],e)},_.modulo=_.mod=function(e,r){var n,i,a=this;return e=new N(e,r),!a.c||!e.s||e.c&&!e.c[0]?new N(NaN):!e.c||a.c&&!a.c[0]?new N(a):(9==y?(i=e.s,e.s=1,n=t(a,e,0,3),e.s=i,n.s*=i):n=t(a,e,0,y),(e=a.minus(n.times(e))).c[0]||1!=y||(e.s=a.s),e)},_.multipliedBy=_.times=function(e,t){var r,n,i,a,o,u,s,c,l,_,f,p,h,v,m,d=this,g=d.c,b=(e=new N(e,t)).c;if(!(g&&b&&g[0]&&b[0]))return!d.s||!e.s||g&&!g[0]&&!b||b&&!b[0]&&!g?e.c=e.e=e.s=null:(e.s*=d.s,g&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=bitFloor(d.e/LOG_BASE)+bitFloor(e.e/LOG_BASE),e.s*=d.s,(s=g.length)<(_=b.length)&&(h=g,g=b,b=h,i=s,s=_,_=i),i=s+_,h=[];i--;h.push(0));for(v=BASE,m=SQRT_BASE,i=_;--i>=0;){for(r=0,f=b[i]%m,p=b[i]/m|0,a=i+(o=s);a>i;)r=((c=f*(c=g[--o]%m)+(u=p*c+(l=g[o]/m|0)*f)%m*m+h[a]+r)/v|0)+(u/m|0)+p*l,h[a--]=c%v;h[a]=r}return r?++n:h.splice(0,1),k(e,h,n)},_.negated=function(){var e=new N(this);return e.s=-e.s||null,e},_.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new N(e,t)).s,!i||!t)return new N(NaN);if(i!=t)return e.s=-t,n.minus(e);var a=n.e/LOG_BASE,o=e.e/LOG_BASE,u=n.c,s=e.c;if(!a||!o){if(!u||!s)return new N(i/0);if(!u[0]||!s[0])return s[0]?e:new N(u[0]?n:0*i)}if(a=bitFloor(a),o=bitFloor(o),u=u.slice(),i=a-o){for(i>0?(o=a,r=s):(i=-i,r=u),r.reverse();i--;r.push(0));r.reverse()}for((i=u.length)-(t=s.length)<0&&(r=s,s=u,u=r,t=i),i=0;t;)i=(u[--t]=u[t]+s[t]+i)/BASE|0,u[t]=BASE===u[t]?0:u[t]%BASE;return i&&(u=[i].concat(u),++o),k(e,u,o)},_.precision=_.sd=function(e,t){var r,n,i,a=this;if(null!=e&&e!==!!e)return intCheck(e,1,MAX),null==t?t=h:intCheck(t,0,8),B(new N(a),e,t);if(!(r=a.c))return null;if(n=(i=r.length-1)*LOG_BASE+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&a.e+1>n&&(n=a.e+1),n},_.shiftedBy=function(e){return intCheck(e,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER),this.times("1e"+e)},_.squareRoot=_.sqrt=function(){var e,r,n,i,a,o=this,u=o.c,s=o.s,c=o.e,l=p+4,_=new N("0.5");if(1!==s||!u||!u[0])return new N(!s||s<0&&(!u||u[0])?NaN:u?o:1/0);if(0==(s=Math.sqrt(+T(o)))||s==1/0?(((r=coeffToString(u)).length+c)%2==0&&(r+="0"),s=Math.sqrt(+r),c=bitFloor((c+1)/2)-(c<0||c%2),n=new N(r=s==1/0?"5e"+c:(r=s.toExponential()).slice(0,r.indexOf("e")+1)+c)):n=new N(s+""),n.c[0])for((s=(c=n.e)+l)<3&&(s=0);;)if(a=n,n=_.times(a.plus(t(o,a,l,1))),coeffToString(a.c).slice(0,s)===(r=coeffToString(n.c)).slice(0,s)){if(n.e<c&&--s,"9999"!=(r=r.slice(s-3,s+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(B(n,n.e+p+2,1),e=!n.times(n).eq(o));break}if(!i&&(B(a,a.e+p+2,0),a.times(a).eq(o))){n=a;break}l+=4,s+=4,i=1}return B(n,n.e+p+1,h,e)},_.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),A(this,e,t,1)},_.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),A(this,e,t)},_.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==_typeof(t)?(r=t,t=null):e&&"object"==_typeof(e)?(r=e,e=t=null):r=x;else if("object"!=_typeof(r))throw Error(bignumberError+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var a,o=n.split("."),u=+r.groupSize,s=+r.secondaryGroupSize,c=r.groupSeparator||"",l=o[0],_=o[1],f=i.s<0,p=f?l.slice(1):l,h=p.length;if(s&&(a=u,u=s,s=a,h-=a),u>0&&h>0){for(a=h%u||u,l=p.substr(0,a);a<h;a+=u)l+=c+p.substr(a,u);s>0&&(l+=c+p.slice(a)),f&&(l="-"+l)}n=_?l+(r.decimalSeparator||"")+((s=+r.fractionGroupSize)?_.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):_):l}return(r.prefix||"")+n+(r.suffix||"")},_.toFraction=function(e){var r,n,i,a,o,u,s,c,l,_,p,v,m=this,d=m.c;if(null!=e&&(!(s=new N(e)).isInteger()&&(s.c||1!==s.s)||s.lt(f)))throw Error(bignumberError+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+T(s));if(!d)return new N(m);for(r=new N(f),l=n=new N(f),i=c=new N(f),v=coeffToString(d),o=r.e=v.length-m.e-1,r.c[0]=POWS_TEN[(u=o%LOG_BASE)<0?LOG_BASE+u:u],e=!e||s.comparedTo(r)>0?o>0?r:l:s,u=g,g=1/0,s=new N(v),c.c[0]=0;_=t(s,r,0,1),1!=(a=n.plus(_.times(i))).comparedTo(e);)n=i,i=a,l=c.plus(_.times(a=l)),c=a,r=s.minus(_.times(a=r)),s=a;return a=t(e.minus(n),i,0,1),c=c.plus(a.times(l)),n=n.plus(a.times(i)),c.s=l.s=m.s,p=t(l,i,o*=2,h).minus(m).abs().comparedTo(t(c,n,o,h).minus(m).abs())<1?[l,i]:[c,n],g=u,p},_.toNumber=function(){return+T(this)},_.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),A(this,e,t,2)},_.toString=function(e){var t,n=this,i=n.s,a=n.e;return null===a?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=a<=v||a>=m?toExponential(coeffToString(n.c),a):toFixedPoint(coeffToString(n.c),a,"0"):10===e&&E?t=toFixedPoint(coeffToString((n=B(new N(n),p+a+1,h)).c),n.e,"0"):(intCheck(e,2,S.length,"Base"),t=r(toFixedPoint(coeffToString(n.c),a,"0"),10,e,i,!0)),i<0&&n.c[0]&&(t="-"+t)),t},_.valueOf=_.toJSON=function(){return T(this)},_._isBigNumber=!0,_[Symbol.toStringTag]="BigNumber",_[Symbol.for("nodejs.util.inspect.custom")]=_.valueOf,null!=e&&N.set(e),N}function bitFloor(e){var t=0|e;return e>0||e===t?t:t-1}function coeffToString(e){for(var t,r,n=1,i=e.length,a=e[0]+"";n<i;){for(t=e[n++]+"",r=LOG_BASE-t.length;r--;t="0"+t);a+=t}for(i=a.length;48===a.charCodeAt(--i););return a.slice(0,i+1||1)}function compare(e,t){var r,n,i=e.c,a=t.c,o=e.s,u=t.s,s=e.e,c=t.e;if(!o||!u)return null;if(r=i&&!i[0],n=a&&!a[0],r||n)return r?n?0:-u:o;if(o!=u)return o;if(r=o<0,n=s==c,!i||!a)return n?0:!i^r?1:-1;if(!n)return s>c^r?1:-1;for(u=(s=i.length)<(c=a.length)?s:c,o=0;o<u;o++)if(i[o]!=a[o])return i[o]>a[o]^r?1:-1;return s==c?0:s>c^r?1:-1}function intCheck(e,t,r,n){if(e<t||e>r||e!==mathfloor(e))throw Error(bignumberError+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function isOdd(e){var t=e.c.length-1;return bitFloor(e.e/LOG_BASE)==t&&e.c[t]%2!=0}function toExponential(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function toFixedPoint(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var BigNumber=clone(),DEFAULT_VOLUME_UNITS=["","K","M","B","T"],BUILTIN_PRESETS={default:{units:["","K","M","B","T"],step:1e3},cn:{units:["","千","百万","十亿","万亿"],step:1e3},wan:{units:["","万","亿","万亿"],step:1e4},storage:{units:["B","KB","MB","GB","TB"],step:1024}};function transform_unit_value(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t._unit_transform;if(!r)return e;var n=new BigNumber(e);if("number"==typeof r)return n.times(r).toFixed();if("function"==typeof r)return String(r(Number(e),t._unit_input,t._unit_output));if("object"===_typeof(r)){if(r.fn&&"function"==typeof r.fn)return String(r.fn(Number(e),t._unit_input,t._unit_output));if(void 0!==r.ratio)return n.times(r.ratio).toFixed();if(void 0!==r.step)return n.div(r.step).toFixed()}return e}function hasUnitSyntax(e){return!!e&&e.some((function(e){return"unit_after"===e.type||"unit_before"===e.type||"unit_middle"===e.type}))}function apply_unit(e,t,r,n){if(!t)return e;var i=e.startsWith("-"),a=e.startsWith("+"),o="",u=e;switch((i||a)&&(o=e[0],u=e.slice(1)),r){case"after":default:return o+u+t;case"before":return t+o+u;case"middle":return o?o+t+u:t+u}}function format_volume(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r._volume_preset,i=r._volume_units||DEFAULT_VOLUME_UNITS,a=r._volume_step||1e3;if(n){var o=(r._presets||{})[n]||BUILTIN_PRESETS[n];o&&(Array.isArray(o)?(i=o,a=1e3):(i=o.units||i,a=void 0!==o.step?o.step:a))}var u=e.startsWith("-"),s=e.startsWith("+"),c="",l=e;(u||s)&&(c=e[0],l=e.slice(1));for(var _=new BigNumber(l),f=0,p=Array.isArray(a);f<i.length-1;){var h=p?a[f]||a[a.length-1]:a;if(!_.gte(h))break;_=_.div(h),f++}var v=_.toFixed(t,BigNumber.ROUND_DOWN);return v.includes(".")&&(v=v.replace(/\.?0+$/,"")),c+v+i[f]}function pad_integer(e,t){if(t<=0)return e;var r=e.startsWith("-"),n=e.startsWith("+"),i="",a=e;(r||n)&&(i=e[0],a=e.slice(1));var o=a.split("."),u=o[0],s=o[1];u.length<t&&(u="0".repeat(t-u.length)+u);var c=i+u;return void 0!==s&&(c+="."+s),c}function format(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n="";if("undefined"===(n=BigNumber.isBigNumber(e)?e.toFixed():"string"==typeof e?e:e.toString())||"NaN"===n)return[void 0,{}];r._unit_transform&&r._unit_position&&!hasUnitSyntax(t)&&(n=transform_unit_value(n,r));var i={mantissa:null,mantissa_type:null,mantissa_min:null,mantissa_max:null,thousands:!1,sign:!1,round:"~-",scientific:!1,fraction:!1,percent:!1,to_number:!1,to_number_string:!1,integer_padding:null,volume:!1,volume_preset:null,unit_format:null,unit_value:null},a=[],o=[];t.forEach((function(e,t){"symbol"===e.type?a.push({value:e.value,index:t}):"number"!==e.type&&"var"!==e.type||o.push({value:"var"===e.type?e.real_value:e.value,index:t})}));var u=a.find((function(e){return">="===e.value||">"===e.value})),s=a.find((function(e){return"<="===e.value||"<"===e.value}));if(u&&s)for(var c=function(){var e=a[l],t=o.find((function(t){return t.index>e.index}));t&&(">="===e.value||">"===e.value?i.mantissa_min=+t.value:"<="!==e.value&&"<"!==e.value||(i.mantissa_max=+t.value))},l=0;l<a.length;l++)c();if(t.forEach((function(e){var t=e.type;if("symbol"===t){if(![">=","<=","=","<",">"].includes(e.value))throw new Error("错误的格式化参数:",e.value);u&&s||(i.mantissa_type=e.value)}else if("to-number"===t)i.to_number=!0;else if("to-number-string"===t)i.to_number_string=!0;else if("comma"===t)i.thousands=!0;else if("number"===t)u&&s||(i.mantissa=e.value);else if("var"===t)u&&s||(i.mantissa=e.real_value);else if("plus"===t)i.sign=!0;else if("round"===t)i.round=e.value;else if("fraction"===t)i.fraction=!0;else if("scientific"===t)i.scientific=!0;else if("percent"===t)i.percent=!0;else if("integer_padding"===t)i.integer_padding=void 0!==e.real_value?+e.real_value:+e.value;else if("volume"===t)i.volume=!0,e.preset&&(i.volume_preset=e.preset);else if("unit_after"===t)i.unit_format="after",i.unit_value=e.unit;else if("unit_before"===t)i.unit_format="before",i.unit_value=e.unit;else{if("unit_middle"!==t)throw new Error("错误的fmt Token");i.unit_format="middle",i.unit_value=e.unit}})),i.to_number){var _=parse_mantissa(n,i.mantissa_type,i.mantissa,i.round);return i.integer_padding&&(_=pad_integer(_,i.integer_padding)),[+_,i]}if(i.scientific){var f=BigNumber(n).toExponential();return[i.sign&&!f.startsWith("-")?"+"+f:f,i]}if(i.fraction){var p=BigNumber(n).toFraction().map((function(e){return e.toFixed()})).join("/");return[i.sign&&!p.startsWith("-")?"+"+p:p,i]}if(i.volume){var h=format_volume(n,null!==i.mantissa?+i.mantissa:2,_objectSpread2(_objectSpread2({},r),{},{_volume_preset:i.volume_preset}));return[i.sign&&!h.startsWith("-")?"+"+h:h,i]}if(i.percent&&(n=BigNumber(n).times(100).toFixed()),null!==i.mantissa_min&&null!==i.mantissa_max){var v=n.includes(".")?n.split(".")[1].length:0;v<i.mantissa_min?n=parse_mantissa(n,">=",i.mantissa_min,i.round):v>i.mantissa_max?n=parse_mantissa(n,"<=",i.mantissa_max,i.round):n.includes(".")&&(n=n.replace(/0*$/,"").replace(/\.$/,""))}else null===i.mantissa?n.includes(".")&&(n=n.replace(/0*$/,"")):n=parse_mantissa(n,i.mantissa_type,i.mantissa,i.round);if(i.integer_padding&&(n=pad_integer(n,i.integer_padding)),i.thousands&&(n=parse_thousands(n)),i.sign&&(i.to_number=!1,n.startsWith("-")||(n="+"+n)),i.percent&&(n+="%"),i.unit_format){var m=i.unit_format;n=apply_unit(n,i.unit_value||r._unit_output||"",m,i.sign)}else r._unit_output&&r._unit_position&&(n=apply_unit(n,r._unit_output,r._unit_position,i.sign));return[n,i]}function close_important_push(){}function open_important_push(){}function open_debug(){}function close_debug(){}function calc_wrap(e,t){var r={_error:"-"};return["string","number"].includes(_typeof(e))?void 0===t?/[a-zA-Z$_]/.test(e.toString())?function(t){return Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc(e,t)}:calc(e):(Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc(e,t)):(Array.isArray(e)?e.unshift(r):e=_objectSpread2(_objectSpread2({},r),e),function(t){return calc(t,e)})}function check_version(){return _check_version.apply(this,arguments)}function _check_version(){return _check_version=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var res,code,versions,last_version,larr,varr,script,url;return _regeneratorRuntime().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if("undefined"==typeof process||"node"!==process.release.name){_context.next=19;break}if(!(parseInt(process.versions.node)>=17)){_context.next=17;break}return _context.next=4,promise_queue([fetch("https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js"),fetch("https://unpkg.com/a-calc@latest/a-calc.versions.js")]);case 4:return res=_context.sent,_context.next=7,res.text();case 7:code=_context.sent,versions=eval(code),last_version=versions.at(-1),larr=last_version.match(/(\d+)\.(\d+)\.(\d+)/),larr.shift(),larr=larr.map((function(e){return parseInt(e)})),varr=version.match(/(\d+)\.(\d+)\.(\d+)/),varr.shift(),varr=varr.map((function(e){return parseInt(e)})),(larr[0]>varr[0]||larr[0]===varr[0]&&larr[1]>varr[1]||larr[0]===varr[0]&&larr[1]===varr[1]&&larr[2]>varr[2])&&console.warn("a-calc has a new version:",last_version);case 17:_context.next=25;break;case 19:return script=document.createElement("script"),script.onload=function(){var e=a_calc_versions;if(Array.isArray(e)){var t=e.at(-1),r=t.match(/(\d+)\.(\d+)\.(\d+)/);r.shift(),r=r.map((function(e){return parseInt(e)}));var n=version.match(/(\d+)\.(\d+)\.(\d+)/);n.shift(),n=n.map((function(e){return parseInt(e)})),(r[0]>n[0]||r[0]===n[0]&&r[1]>n[1]||r[0]===n[0]&&r[1]===n[1]&&r[2]>n[2])&&console.log("%c↑↑↑ a-calc has a new version: %s ↑↑↑","color: #67C23A;",t)}},_context.next=23,test_urls(["https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js","https://unpkg.com/a-calc@latest/a-calc.versions.js"]);case 23:url=_context.sent,url?(script.src=url,document.body.appendChild(script)):script=null;case 25:case"end":return _context.stop()}}),_callee)}))),_check_version.apply(this,arguments)}var operator=new Set(["+","-","*","/","%","**","//"]);function detectFallbackVar(e,t){if("("!==e[t])return null;for(var r=0,n=!1,i=[],a="",o=t;o<e.length;){var u=e[o];if("("===u){if(0===r){r++,o++;continue}r++,a+=u}else if(")"===u){if(0===--r)return n?(i.push(a.trim()),{paths:i,endIndex:o}):null;a+=u}else"|"===u&&1===r?(n=!0,i.push(a.trim()),a=""):a+=u;o++}return null}function push_token$2(e,t,r){if(Number.isNaN(Number(t)))if("-"===t||"+"===t)0===e.length||"operator"===e.at(-1).type||"("===e.at(-1).value?e.push({type:"number",value:t,real_value:t,has_unit:!1}):e.push({type:"operator",value:t});else if(operator.has(t))e.push({type:"operator",value:t});else if(r._unit&&/^[+-]?\d/.test(t)){var n,i=split_unit_num(t),a=i.num,o=i.unit;if(void 0===o)e.push({type:"number",value:a,real_value:a,has_unit:!1});else r.has_unit=!0,null!==(n=r.unit_str)&&void 0!==n||(r.unit_str=o),e.push({type:"number",value:a,real_value:a,has_unit:!0,unit:o})}else if(var_first_char_set.has(t[0])){r.has_var=!0;var u=get_real_value(r.fill_data,t);if(r._unit){var s,c=split_unit_num(u),l=c.num,_=c.unit;if(void 0===_)e.push({type:"var",value:t,real_value:l,has_unit:!1});else r.has_unit=!0,null!==(s=r.unit_str)&&void 0!==s||(r.unit_str=_),e.push({type:"var",value:t,real_value:l,has_unit:!0,unit:_})}else e.push({type:"var",value:t,real_value:u,has_unit:!1})}else{if(!/^[+-]?\d/.test(t))throw new Error("无法识别的标识符:".concat(t));var f=t.indexOf("e");-1!==f&&/^\d+$/.test(t.slice(f+1))&&e.push({type:"number",value:t,real_value:t,has_unit:!1})}else e.push({type:"number",value:t,real_value:t,has_unit:!1})}function tokenizer_space(e,t,r,n){for(var i,a=0,o=0,u=e.length,s=[],c={has_var:!1,has_unit:!1,unit_str:void 0,_unit:r,fill_data:t};o<u;){if(" "===(i=e[o]))o>a&&push_token$2(s,e.slice(a,o),c),a=o+1;else if("("===i){var l=detectFallbackVar(e,o);if(l){o>a&&push_token$2(s,e.slice(a,o),c),c.has_var=!0;var _=get_fallback_value(t,l.paths,n),f=_.value,p=_.path;if(r){var h,v=split_unit_num(f),m=v.num,d=v.unit;if(void 0!==d)c.has_unit=!0,null!==(h=c.unit_str)&&void 0!==h||(c.unit_str=d),s.push({type:state_fallback_var,value:l.paths,real_value:m,matched_path:p,has_unit:!0,unit:d});else s.push({type:state_fallback_var,value:l.paths,real_value:m,matched_path:p,has_unit:!1})}else s.push({type:state_fallback_var,value:l.paths,real_value:f,matched_path:p,has_unit:!1});a=o=l.endIndex+1;continue}s.push({type:state_bracket,value:"("}),a=o+1}else")"===i&&(o>a&&push_token$2(s,e.slice(a,o),c),s.push({type:state_bracket,value:")"}),a=o+1);o++}return o>a&&push_token$2(s,e.slice(a,o),c),s.has_var=c.has_var,s.has_unit=c.has_unit,s.unit=c.unit_str,s}function compute(e,t,r){if(void 0===e||void 0===t)throw new Error("无效的操作数对:v1:".concat(e,", v2:").concat(t));switch(r){case"+":return new BigNumber(e).plus(t);case"-":return new BigNumber(e).minus(t);case"*":return new BigNumber(e).times(t);case"/":return new BigNumber(e).div(t);case"%":return new BigNumber(e).mod(t);case"**":return new BigNumber(e).pow(t);case"//":return new BigNumber(e).idiv(t)}}var operator_map$1={"+":0,"-":0,"*":1,"/":1,"%":1,"//":1,"**":2};function eval_tokens(e){if(1===e.length){var t=e[0];if("number"===t.type||"var"===t.type||"fallback_var"===t.type)return t.real_value;throw new Error("错误的表达式:".concat(t.value))}for(var r,n,i=[],a=[],o=0,u=e.length;o<u;o++)if("number"!==(r=e[o]).type&&"var"!==r.type&&"fallback_var"!==r.type)if("operator"!==r.type)if("("!==r.value){if(")"===r.value)for(var s=void 0;s=i.pop();){if("("===s){var c=a.at(-2);if("-"===c){var l=a.pop();a.pop(),a.push(BigNumber.isBigNumber(l)?l.negated():new BigNumber(l).negated())}else if("+"===c){var _=a.pop();a.pop(),a.push(_)}break}var f=a.pop(),p=a.pop();a.push(compute(p,f,s))}}else i.push("(");else{var h=i.at(-1);if("("===h){i.push(r.value);continue}var v=operator_map$1[r.value];if(!i.length){i.push(r.value);continue}if(v<operator_map$1[h])for(var m=void 0;m=i.pop();){if("("===m){i.push("(");break}var d=a.pop(),g=a.pop();a.push(compute(g,d,m))}else if(v===operator_map$1[h]){if("**"===r.value){i.push(r.value);continue}for(var b=void 0;b=i.pop();){if("("===b){i.push("(");break}if(operator_map$1[b]<v){i.push(b);break}var y=a.pop(),w=a.pop();a.push(compute(w,y,b))}}i.push(r.value)}else a.push(r.real_value);for(;n=i.pop();){var x=a.pop(),S=a.pop();a.push(compute(S,x,n))}if(1!==a.length)throw new Error("可能出现了错误的计算式");return e.has_var||(e.calc_result=a[0]),a[0]}function push_token$1(e,t,r,n,i){t===state_var||t===state_integer_padding&&var_char.includes(r[0])?(i.has_var=!0,e.push({type:t,value:r,real_value:get_real_value(i.fill_data,r)})):e.push({type:t,value:r}),n.prev=n.curr,i.state=state_initial}function fmt_tokenizer(e,t){for(var r,n={prev:0,curr:0},i=e.length,a={state:state_initial,fill_data:t,has_var:!1},o=[];n.curr<i;)switch(r=e[n.curr],a.state){case state_initial:if(" "===r)n.curr++,n.prev=n.curr;else if("<>=".includes(r))a.state=state_symbol,n.curr++;else if(","===r)n.curr++,push_token$1(o,state_comma,",",n,a);else if(var_char.includes(r))a.state=state_var,n.curr++;else if(number_char.includes(r))a.state=state_number,n.curr++;else if("+"===r)n.curr++,push_token$1(o,state_plus,"+",n,a);else if("~"===r)n.curr++,a.state=state_round;else if("%"===r)n.curr++,push_token$1(o,state_percent,"%",n,a);else if("/"===r)n.curr++,push_token$1(o,state_fraction,"/",n,a);else if("!"===r)if(a.state=state_initial,n.curr++,"n"===e[n.curr])n.curr++,push_token$1(o,state_to_number,"!n",n,a);else if("u"===e[n.curr]){n.curr++;var u=e[n.curr];if("a"===u||"b"===u||"m"===u){if(n.curr++,":"!==e[n.curr])throw new Error("!u".concat(u," 语法需要指定单位,格式: !u").concat(u,":单位"));n.curr++;for(var s=n.curr;n.curr<i&&" "!==e[n.curr];)n.curr++;var c=e.slice(s,n.curr),l={a:state_unit_after,b:state_unit_before,m:state_unit_middle};o.push({type:l[u],value:"!u".concat(u),unit:c}),n.prev=n.curr,a.state=state_initial}else push_token$1(o,state_to_number_string,"!u",n,a)}else if("e"===e[n.curr])n.curr++,push_token$1(o,state_scientific,"!e",n,a);else{if("v"!==e[n.curr])throw new Error("无法识别的!模式字符:".concat(e[n.curr]));n.curr++;var _=null;if(":"===e[n.curr]){n.curr++;for(var f=n.curr;n.curr<i&&/[a-zA-Z0-9_]/.test(e[n.curr]);)n.curr++;_=e.slice(f,n.curr)}o.push({type:state_volume,value:"!v",preset:_}),n.prev=n.curr,a.state=state_initial}else"#"===r?(n.curr++,n.prev=n.curr,"="===e[n.curr]&&(n.curr++,n.prev=n.curr),a.state=state_integer_padding):(n.curr++,n.prev=n.curr);break;case state_symbol:"="===r&&n.curr++,push_token$1(o,state_symbol,e.slice(n.prev,n.curr),n,a);break;case state_number:number_char.includes(r)?n.curr++:push_token$1(o,state_number,e.slice(n.prev,n.curr),n,a);break;case state_var:var_members_char.includes(r)?n.curr++:push_token$1(o,state_var,e.slice(n.prev,n.curr),n,a);break;case state_round:if(!("56+-".includes(r)&&n.curr-n.prev<2))throw new Error("错误的舍入语法:".concat(e.slice(n.prev,n.curr+1)));n.curr++,push_token$1(o,state_round,e.slice(n.prev,n.curr),n,a);break;case state_integer_padding:if(number_char.includes(r))n.curr++;else if(var_members_char.includes(r))n.curr++;else{var p=e.slice(n.prev,n.curr);var_char.includes(p[0])?(a.has_var=!0,o.push({type:state_integer_padding,value:p,real_value:get_real_value(a.fill_data,p)})):push_token$1(o,state_integer_padding,p,n,a),n.prev=n.curr,a.state=state_initial}break;default:throw new Error("错误的fmt分词器状态")}return n.prev<n.curr&&push_token$1(o,a.state,e.slice(n.prev,n.curr),n,a),o.has_var=a.has_var,o}var symbol_set=new Set(["<",">","=",">=","<="]),rand_set=new Set(["~+","~-","~5","~6"]);function push_token(e,t,r){if(","===t)e.push({type:state_comma,value:","});else if(symbol_set.has(t))e.push({type:state_symbol,value:t});else if(Number.isNaN(Number(t)))if(var_first_char.includes(t[0]))r.has_var=!0,e.push({type:state_var,value:t,real_value:get_real_value(r.fill_data,t)});else if("%"===t)e.push({type:state_percent,value:t});else if("/"===t)e.push({type:state_fraction,value:t});else if("+"===t)e.push({type:state_plus,value:t});else if(rand_set.has(t))e.push({type:state_round,value:t});else if("!n"===t)e.push({type:state_to_number,value:t});else if("!u"===t)e.push({type:state_to_number_string,value:t});else if(t.startsWith("!ua:")||t.startsWith("!ub:")||t.startsWith("!um:")){var n=t[2],i=t.slice(4),a={a:state_unit_after,b:state_unit_before,m:state_unit_middle};e.push({type:a[n],value:"!u".concat(n),unit:i})}else if("!e"===t)e.push({type:state_scientific,value:t});else if("!v"===t||t.startsWith("!v:")){var o=null;t.startsWith("!v:")&&(o=t.slice(3)),e.push({type:state_volume,value:"!v",preset:o})}else{if(!t.startsWith("#"))throw new Error("无法识别的格式化字符: ".concat(t));var u=t.slice(1);u.startsWith("=")&&(u=u.slice(1)),var_first_char.includes(u[0])?(r.has_var=!0,e.push({type:state_integer_padding,value:u,real_value:get_real_value(r.fill_data,u)})):e.push({type:state_integer_padding,value:u})}else e.push({type:state_number,value:t})}function fmt_tokenizer_space(e,t){for(var r,n=0,i=e.length,a={fill_data:t,has_var:!1},o=0,u=[];n<i;)" "===(r=e[n])?(n>o&&push_token(u,e.slice(o,n),a),o=n+1):"<>=".includes(r)&&("="===e[n+1]?(u.push({type:state_symbol,value:r+"="}),o=1+ ++n):(u.push({type:state_symbol,value:r}),o=n+1)),n++;return o<n&&push_token(u,e.slice(o,n),a),u.has_var=a.has_var,u}function compute_lite(e,t,r){switch(r){case"+":return(BigNumber.isBigNumber(e)?e:new BigNumber(e)).plus(t);case"-":return(BigNumber.isBigNumber(e)?e:new BigNumber(e)).minus(t);case"*":return(BigNumber.isBigNumber(e)?e:new BigNumber(e)).times(t);case"/":return(BigNumber.isBigNumber(e)?e:new BigNumber(e)).div(t);case"%":return(BigNumber.isBigNumber(e)?e:new BigNumber(e)).mod(t);case"**":return(BigNumber.isBigNumber(e)?e:new BigNumber(e)).pow(t);case"//":return(BigNumber.isBigNumber(e)?e:new BigNumber(e)).idiv(t)}}var operator_map={"+":0,"-":0,"*":1,"/":1,"%":1,"//":1,"**":2};function eval_tokens_lite(e,t){for(var r,n,i=[],a=[],o=0,u=e.length;o<u;o++){var s=(r=e[o])[0];if(var_first_char.includes(s))a.push(get_real_value(t,r));else if(operator_set.has(r)){var c=i.at(-1);if("("===c){i.push(r);continue}var l=operator_map[r];if(!i.length){i.push(r);continue}var _=operator_map[c];if(l<_)for(var f=i.at(-1);f&&"("!==f;){i.pop();var p=a.pop(),h=a.pop();a.push(compute_lite(h,p,f)),f=i.at(-1)}else if(l===_){if("**"===r){i.push(r);continue}for(var v=i.at(-1);v&&!(operator_map[v]<l||"("===v);){i.pop();var m=a.pop(),d=a.pop();a.push(compute_lite(d,m,v)),v=i.at(-1)}}i.push(r)}else if(number_first_char.includes(s))a.push(r);else if("("!==r){if(")"===r)for(var g=void 0;(g=i.pop())&&"("!==g;){var b=a.pop(),y=a.pop();a.push(compute_lite(y,b,g))}}else i.push("(")}for(;n=i.pop();){var w=a.pop(),x=a.pop();a.push(compute_lite(x,w,n))}if(1!==a.length)throw new Error("可能出现了错误的计算式");return a[0]}function calc_lite(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"-";try{var i;if("number"==typeof e)i=e.toString();else{if(""===e)throw new Error("非法的空计算式");var a=e.split(" ");if(1===a.length){if(i=a[0],var_first_char.includes(i[0])&&(i=get_real_value(r,i)),isNaN(Number(i)))throw new Error("错误的计算式:".concat(e))}else i=eval_tokens_lite(a,r).toFixed()}if("string"==typeof t&&""!==t){var o=fmt_tokenizer(t,r);if(void 0!==o)i=_slicedToArray(format(i,o),1)[0]}if("NaN"===i||"Infinity"===i)throw new Error("计算环节出错");return i}catch(e){return n}}function calc_mini(e,t,r){switch(t){case"+":return BigNumber(e).plus(r).toFixed();case"-":return BigNumber(e).minus(r).toFixed();case"*":return BigNumber(e).times(r).toFixed();case"/":return BigNumber(e).div(r).toFixed();case"%":return BigNumber(e).mod(r).toFixed();case"**":return BigNumber(e).pow(r).toFixed();case"//":return BigNumber(e).idiv(r).toFixed()}}function calc_sum(e,t){var r={_error:"-"},n=e.split("|"),i=n[0];if(0===t.length)return calc(e,r);for(var a=0,o=0;o<t.length;o++){var u=calc(i,_objectSpread2(_objectSpread2({},r),t[o]));if((a=calc("sum + temp",_objectSpread2({sum:a,temp:u},r)))===r._error)return r._error}return fmt(a,{_fmt:2===n.length?n[1]:void 0})}function calc_core(e,t){var r=find_value(t,"_error");try{var n,i,a,o,u,s=parse_args(e,t),c=s._unit,l=s._mode,_={_empty_values:s._empty_values,_empty_check:s._empty_check},f="space"===l||"space-all"===l?tokenizer_space(s.expr,s.fill_data,c,_):tokenizer(s.expr,s.fill_data,c,_),p=eval_tokens(f),h=BigNumber.isBigNumber(p)?p:new BigNumber(p);if("space-all"===l?(o=""===s.fmt_expr||void 0===s.fmt_expr?void 0:fmt_tokenizer_space(s.fmt_expr,s.fill_data),u=""===s._fmt||void 0===s._fmt?void 0:fmt_tokenizer_space(s._fmt,s.fill_data)):(o=""===s.fmt_expr||void 0===s.fmt_expr?void 0:fmt_tokenizer(s.fmt_expr,s.fill_data),u=""===s._fmt||void 0===s._fmt?void 0:fmt_tokenizer(s._fmt,s.fill_data)),void 0===o?void 0!==u&&(o=u):void 0!==u&&(o=[].concat(_toConsumableArray(u),_toConsumableArray(o))),void 0===o)h=h.toFixed();else{var v=_slicedToArray(format(h,o,{_volume_units:s._volume_units,_volume_step:s._volume_step,_presets:s._presets,_unit_input:s._unit_input,_unit_output:s._unit_output,_unit_position:s._unit_position,_unit_transform:s._unit_transform}),2);h=v[0],a=v[1]}if("Infinity"===h||"NaN"===h||void 0===h)throw new Error("计算错误可能是非法的计算式");return!f.has_unit||null!==(n=a)&&void 0!==n&&n.to_number||null!==(i=a)&&void 0!==i&&i.to_number_string||(h+=f.unit),h}catch(e){if(void 0===r)throw e;return r}}function calc(e,t){if(null==t)return calc_core(e,{_error:"-"});if(Array.isArray(t)){if(!t.some((function(e){return e&&void 0!==e._error})))return calc_core(e,[].concat(_toConsumableArray(t),[{_error:"-"}]))}else if("object"===_typeof(t)&&void 0===t._error)return calc_core(e,_objectSpread2(_objectSpread2({},t),{},{_error:"-"}));return calc_core(e,t)}var fmt_core=calc_core,fmt=calc;function check_update(){check_version().catch((function(){}))}function print_version(){console.log("%ca-calc:%c ".concat(version," %c=> %curl:%c https://www.npmjs.com/package/a-calc"),"color: #fff;background: #67C23A;padding: 2px 5px;border-radius:4px;font-size: 14px;","color: #67C23A;font-size:14px;","color: #67C23A;font-size:14px;","background: #67C23A;font-size:14px; padding: 2px 5px; border-radius: 4px; color: #fff;","font-size:14px;")}var calc_util={check_update:check_update,print_version:print_version,open_debug:open_debug,close_debug:close_debug,close_important_push:close_important_push,open_important_push:open_important_push};function plus(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).plus(t).toNumber():new BigNumber(e).plus(t).toFixed()}function sub(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).minus(t).toNumber():new BigNumber(e).minus(t).toFixed()}function mul(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).times(t).toNumber():new BigNumber(e).times(t).toFixed()}function div(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).div(t).toNumber():new BigNumber(e).div(t).toFixed()}function mod(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).mod(t).toNumber():new BigNumber(e).mod(t).toFixed()}function pow(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).pow(t).toNumber():new BigNumber(e).pow(t).toFixed()}function idiv(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).idiv(t).toNumber():new BigNumber(e).idiv(t).toFixed()}return exports.calc=calc,exports.calc_core=calc_core,exports.calc_lite=calc_lite,exports.calc_mini=calc_mini,exports.calc_sum=calc_sum,exports.calc_util=calc_util,exports.calc_wrap=calc_wrap,exports.div=div,exports.fmt=fmt,exports.fmt_core=fmt_core,exports.idiv=idiv,exports.mod=mod,exports.mul=mul,exports.parse_thousands=parse_thousands,exports.plus=plus,exports.pow=pow,exports.sub=sub,exports.version=version,exports}({});
|
|
1
|
+
var a_calc=function(exports){"use strict";function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,u=[],s=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return u}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function c(e,t,r,i){var a=t&&t.prototype instanceof f?t:f,o=Object.create(a.prototype),u=new A(i||[]);return n(o,"_invoke",{value:w(e,r,u)}),o}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var _={};function f(){}function p(){}function h(){}var v={};s(v,a,(function(){return this}));var m=Object.getPrototypeOf,d=m&&m(m(N([])));d&&d!==t&&r.call(d,a)&&(v=d);var g=h.prototype=f.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function i(n,a,o,u){var s=l(e[n],e,a);if("throw"!==s.type){var c=s.arg,_=c.value;return _&&"object"==typeof _&&r.call(_,"__await")?t.resolve(_.__await).then((function(e){i("next",e,o,u)}),(function(e){i("throw",e,o,u)})):t.resolve(_).then((function(e){c.value=e,o(c)}),(function(e){return i("throw",e,o,u)}))}u(s.arg)}var a;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function w(e,t,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return O()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var u=x(o,r);if(u){if(u===_)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(e,t,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===_)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function x(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var i=l(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,_;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,_):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,_)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function N(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=h,n(g,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:p,configurable:!0}),p.displayName=s(h,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,s(e,u,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(y.prototype),s(y.prototype,o,(function(){return this})),e.AsyncIterator=y,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new y(c(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},b(g),s(g,u,"Generator"),s(g,a,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=N,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return o.type="throw",o.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,_):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),_},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),_}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:N(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),_}},e}function _typeof(e){return _typeof="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},_typeof(e)}function asyncGeneratorStep(e,t,r,n,i,a,o){try{var u=e[a](o),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,i)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function o(e){asyncGeneratorStep(a,n,i,o,u,"next",e)}function u(e){asyncGeneratorStep(a,n,i,o,u,"throw",e)}o(void 0)}))}}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:String(t)}var version="3.0.0-beta.2025120803";function decimal_round(e,t,r,n,i){var a=e,o=t,u=t.length,s={"~-":function(){var e="<"===r?n-1:n;o=t.slice(0,e)},"~+":function(){var e="<"===r?n-1:n;if(!(u<=e||0===u)){var i=t.slice(0,e);0==+t.slice(e,u)?o=i:(i=(+"9".concat(i)+1).toString().slice(1)).length>e?(o=i.slice(1,i.length),a=(+a+1).toString()):o=i}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;o=t.slice(0,e);var i=+t[e];Number.isNaN(i)||i>=5&&(o=(+"9".concat(o)+1).toString().slice(1)).length>e&&(o=o.slice(1,o.length),a=(+a+1).toString())}},"~6":function(){if(0!==u){var i,s="<"===r?n-1:n,c=+t[s],l=t.slice(+s+1,t.length);l=""===l?0:parseInt(l),i=0===s?+e[e.length-1]:+t[s-1],o=t.slice(0,s),(c>=6||5===c&&l>0||5===c&&i%2!=0)&&(o=(+"9".concat(o)+1).toString().slice(1)).length>s&&(o=o.slice(1,o.length),a=(+a+1).toString())}}};return"<="===r?u<=n?o=t.replace(/0*$/,""):(s[i]&&s[i](),o=o.replace(/0+$/,"")):"<"===r?u<n?o=t.replace(/0*$/,""):(s[i]&&s[i](),o=o.replace(/0+$/,"")):"="===r?u<n?o=t+"0".repeat(n-u):u>n&&s[i]&&s[i]():">="===r?u<n&&(o=t+"0".repeat(n-u)):">"===r&&u<=n&&(o=t+"0".repeat(n-u+1)),{int_part:a,dec_part:o}}var number_char="0123456789",var_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",number_first_char="0123456789-+",var_members_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$[].'\"",var_first_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",pure_number_var_first_char="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",empty_char=" \n\r\t",number_char_set=new Set(number_char),var_char_set=new Set(var_char),var_members_char_set=new Set(var_members_char),var_first_char_set=new Set(var_first_char);new Set(number_first_char);var pure_number_var_first_char_set=new Set(pure_number_var_first_char),empty_char_set=new Set(empty_char),state_initial="initial",state_number="number",state_scientific="scientific",state_operator="operator",state_bracket="bracket",state_var="var",state_symbol="symbol",state_percent="percent",state_round="round",state_plus="plus",state_comma="comma",state_fraction="fraction",state_to_number="to-number",state_to_number_string="to-number-string",state_fallback_var="fallback_var",state_integer_padding="integer_padding",state_volume="volume",state_unit_after="unit_after",state_unit_before="unit_before",state_unit_middle="unit_middle",operator_set=new Set(["+","-","*","/","%","**","//"]),isArray=Array.isArray,freeGlobal="object"==("undefined"==typeof global?"undefined":_typeof(global))&&global&&global.Object===Object&&global,freeSelf="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),_Symbol=root.Symbol,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty,nativeObjectToString$1=objectProto$4.toString,symToStringTag$1=_Symbol?_Symbol.toStringTag:void 0;function getRawTag(e){var t=hasOwnProperty$3.call(e,symToStringTag$1),r=e[symToStringTag$1];try{e[symToStringTag$1]=void 0;var n=!0}catch(e){}var i=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),i}var objectProto$3=Object.prototype,nativeObjectToString=objectProto$3.toString;function objectToString(e){return nativeObjectToString.call(e)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol?_Symbol.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}function isObjectLike(e){return null!=e&&"object"==_typeof(e)}var symbolTag="[object Symbol]";function isSymbol(e){return"symbol"==_typeof(e)||isObjectLike(e)&&baseGetTag(e)==symbolTag}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray(e))return!1;var r=_typeof(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}function isObject(e){var t=_typeof(e);return null!=e&&("object"==t||"function"==t)}var asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}var coreJsData=root["__core-js_shared__"],maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$2=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$2=objectProto$2.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$2).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}function getValue(e,t){return null==e?void 0:e[t]}function getNative(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var nativeCreate=getNative(Object,"create");function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HASH_UNDEFINED$1="__lodash_hash_undefined__",objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function hashGet(e){var t=this.__data__;if(nativeCreate){var r=t[e];return r===HASH_UNDEFINED$1?void 0:r}return hasOwnProperty$1.call(t,e)?t[e]:void 0}var objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function hashHas(e){var t=this.__data__;return nativeCreate?void 0!==t[e]:hasOwnProperty.call(t,e)}var HASH_UNDEFINED="__lodash_hash_undefined__";function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate&&void 0===t?HASH_UNDEFINED:t,this}function Hash(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function listCacheClear(){this.__data__=[],this.size=0}function eq(e,t){return e===t||e!=e&&t!=t}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?void 0:t[r][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var Map=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function isKeyable(e){var t=_typeof(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function getMapData(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function MapCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var FUNC_ERROR_TEXT="Expected a function";function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function r(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(memoize.Cache||MapCache),r}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize(e,(function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e})),r=t.cache;return t}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,(function(e,r,n,i){t.push(n?i.replace(reEscapeChar,"$1"):r||e)})),t}));function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var symbolProto=_Symbol?_Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(isArray(e))return arrayMap(e,baseToString)+"";if(isSymbol(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function toString(e){return null==e?"":baseToString(e)}function castPath(e,t){return isArray(e)?e:isKey(e,t)?[e]:stringToPath(toString(e))}function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function baseGet(e,t){for(var r=0,n=(t=castPath(t,e)).length;null!=e&&r<n;)e=e[toKey(t[r++])];return r&&r==n?e:void 0}function get(e,t,r){var n=null==e?void 0:baseGet(e,t);return void 0===n?r:n}var REG_UNIT_NUM_SCIENTIFIC=/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,REG_UNIT_NUM_NORMAL=/^([+-]?[\d.]+)(.*)$/;function split_unit_num(e){var t,r,n=(e="string"!=typeof e?e.toString():e).match(REG_UNIT_NUM_SCIENTIFIC)||e.match(REG_UNIT_NUM_NORMAL);if(n){r=n[1];var i=n[2];""!==i.trim()&&(t=i)}return{num:r,unit:t}}function find_value(e,t,r){var n,i,a,o;return Array.isArray(e)?e.length>1?null!==(n=null!==(i=get(e[0],t))&&void 0!==i?i:get(e.at(-1),t))&&void 0!==n?n:r:1===e.length&&null!==(a=get(e[0],t))&&void 0!==a?a:r:null!==(o=get(e,t,r))&&void 0!==o?o:r}function parse_mantissa(e,t,r,n){var i=e.split("."),a=i[0],o=1===i.length?"":i[1],u=decimal_round(a,o,t,+r,n);return a=u.int_part,""===(o=u.dec_part)?a:"".concat(a,".").concat(o)}function integer_thousands(e){for(var t=e.length,r="";t>0;)r=e.substring(t-3,t)+(""!==r?",":"")+r,t-=3;return r}function parse_thousands(e){var t=e.split("."),r=t[0];return"-"===r[0]?t[0]="-"+integer_thousands(r.slice(1)):t[0]=integer_thousands(r),t.join(".")}function promise_queue(e){return _promise_queue.apply(this,arguments)}function _promise_queue(){return _promise_queue=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n,i,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 2:if(!(n<t.length)){e.next=16;break}return e.prev=3,e.next=6,Promise.race([t[n],new Promise((function(e,t){setTimeout((function(){return t(new Error("promise queue timeout err"))}),r)}))]);case 6:i=e.sent,e.next=12;break;case 9:return e.prev=9,e.t0=e.catch(3),e.abrupt("continue",13);case 12:return e.abrupt("return",i);case 13:n++,e.next=2;break;case 16:return e.abrupt("return",Promise.reject("错误的 promise queue 调用"));case 17:case"end":return e.stop()}}),e,null,[[3,9]])}))),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r<t.length)){e.next=16;break}return e.prev=2,e.next=5,fetch(t[r]);case 5:if(!e.sent.ok){e.next=8;break}return e.abrupt("return",t[r]);case 8:e.next=13;break;case 10:return e.prev=10,e.t0=e.catch(2),e.abrupt("continue",13);case 13:r++,e.next=1;break;case 16:return e.abrupt("return",null);case 17:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function get_real_value(e,t){if(Array.isArray(e)){for(var r,n=0,i=e.length;n<i;n++){var a;if(void 0!==(r=null!==(a=get(e[n],t))&&void 0!==a?a:void 0))break}if(void 0===r)throw new Error("填充变量".concat(t,"失败"));return r}var o;return null!==(o=get(e,t))&&void 0!==o?o:void 0}function isEmptyForFallback(e,t,r){return r&&"function"==typeof r._empty_check?r._empty_check(e,t):r&&Array.isArray(r._empty_values)?r._empty_values.some((function(t){return!(!Number.isNaN(t)||!Number.isNaN(e))||e===t})):null==e}function get_fallback_value(e,t,r){for(var n=0;n<t.length;n++){var i=t[n].trim(),a=void 0;try{if(Array.isArray(e))for(var o=0;o<e.length;o++){var u=get(e[o],i);if(void 0!==u){a=u;break}}else a=get(e,i)}catch(e){continue}if(!isEmptyForFallback(a,i,r))return{value:a,path:i}}throw new Error("多路取值失败,所有路径均为空值: ".concat(t.join(" | ")))}function get_next_nonempty_char(e,t,r){var n;for(t++;t<r;){if(n=e[t],!empty_char_set.has(n))return n;t++}}function splitExprAndFmt(e){for(var t=0,r=0;r<e.length;r++){var n=e[r];if("("===n)t++;else if(")"===n)t--;else if("|"===n&&0===t)return{expr:e.slice(0,r),fmt:e.slice(r+1).trim()}}return{expr:e,fmt:""}}function parse_args(e,t){var r="",n={origin_expr:e,origin_fill_data:t,expr:"",fmt_expr:"",options:void 0,fill_data:void 0,_unit:void 0,_mode:void 0,_fmt:void 0,_empty_values:void 0,_empty_check:void 0,_volume_units:void 0,_volume_step:void 0,_presets:void 0,_unit_out:void 0,_unit_from:void 0,_unit_default_out:void 0,_unit_position:void 0};if(null!=t&&(n.options=t,Array.isArray(t)?n.fill_data=t:Array.isArray(t._fill_data)?n.fill_data=[t].concat(_toConsumableArray(t._fill_data)):void 0===t._fill_data?n.fill_data=[t]:n.fill_data=[t,t._fill_data]),n._mode=find_value(t,"_mode","normal"),n._unit=find_value(t,"_unit",!1),n._fmt=find_value(t,"_fmt"),n._empty_values=find_value(t,"_empty_values"),n._empty_check=find_value(t,"_empty_check"),n._volume_units=find_value(t,"_volume_units"),n._volume_step=find_value(t,"_volume_step"),n._presets=find_value(t,"_presets"),n._unit_out=find_value(t,"_unit_out"),n._unit_from=find_value(t,"_unit_from"),n._unit_default_out=find_value(t,"_unit_default_out"),n._unit_position=find_value(t,"_unit_position"),"string"==typeof e){if(r=e,""===e.trim()||e.includes("NaN"))throw new Error("非法的表达式:".concat(e))}else{if("number"!=typeof e)throw new Error("错误的第一个参数类型: ".concat(e," 类型为:").concat(_typeof(e)));if(isNaN(e))throw new Error("传入了一个非法数字NaN");r=e.toString()}var i=splitExprAndFmt(r),a=i.expr,o=i.fmt;return n.expr=a,n.fmt_expr=o,n}function detectFallbackVar$1(e,t){if("("!==e[t])return null;for(var r=0,n=!1,i=[],a="",o=t;o<e.length;){var u=e[o];if("("===u){if(0===r){r++,o++;continue}r++,a+=u}else if(")"===u){if(0===--r)return n?(i.push(a.trim()),{paths:i,endIndex:o}):null;a+=u}else"|"===u&&1===r?(n=!0,i.push(a.trim()),a=""):a+=u;o++}return null}function push_token$3(e,t){if(t.curr_state===state_number||t.curr_state===state_scientific){var r=t.expr.slice(t.prev_index,t.cur_index);if(t._unit){var n,i=split_unit_num(r),a=i.num,o=i.unit;if(void 0===o)e.push({type:state_number,value:a,real_value:a,has_unit:!1});else t.has_unit=!0,null!==(n=t.unit_str)&&void 0!==n||(t.unit_str=o),e.push({type:state_number,value:a,real_value:a,has_unit:!0,unit:o})}else e.push({type:state_number,value:r,real_value:r,has_unit:!1})}else if(t.curr_state===state_var){t.has_var=!0;var u=t.expr.slice(t.prev_index,t.cur_index),s=get_real_value(t.fill_data,u);if(t._unit){var c,l=split_unit_num(s),_=l.num,f=l.unit;if(void 0===f)e.push({type:"var",value:u,real_value:_,has_unit:!1});else t.has_unit=!0,null!==(c=t.unit_str)&&void 0!==c||(t.unit_str=f),e.push({type:"var",value:u,real_value:_,has_unit:!0,unit:f})}else e.push({type:"var",value:u,real_value:s,has_unit:!1})}else e.push({type:t.curr_state,value:t.expr.slice(t.prev_index,t.cur_index)});t.curr_state=state_initial,t.prev_index=t.cur_index}function tokenizer(e,t,r,n){for(var i,a={has_var:!1,has_unit:!1,unit_str:void 0,fill_data:t,cur_index:0,prev_index:0,curr_state:state_initial,expr:e,_unit:r},o=e.length,u=[];a.cur_index<o;)switch(i=e[a.cur_index],a.curr_state){case state_initial:if(number_char_set.has(i))a.curr_state=state_number,a.cur_index++;else if(" "===i)a.cur_index++,a.prev_index=a.cur_index;else if("+-".includes(i)){var s=u.at(-1);0===a.cur_index||"operator"===(null==s?void 0:s.type)||"("===(null==s?void 0:s.value)?(a.curr_state=state_number,a.cur_index++):(a.cur_index++,u.push({type:state_operator,value:e.slice(a.prev_index,a.cur_index)}),a.prev_index=a.cur_index)}else if("*/%".includes(i))a.curr_state=state_operator,a.cur_index++;else if(var_char_set.has(i))a.curr_state=state_var,a.cur_index++;else if("("===i){var c=detectFallbackVar$1(e,a.cur_index);if(c){a.has_var=!0;var l=get_fallback_value(t,c.paths,n),_=l.value,f=l.path;if(r){var p,h=split_unit_num(_),v=h.num,m=h.unit;if(void 0!==m)a.has_unit=!0,null!==(p=a.unit_str)&&void 0!==p||(a.unit_str=m),u.push({type:state_fallback_var,value:c.paths,real_value:v,matched_path:f,has_unit:!0,unit:m});else u.push({type:state_fallback_var,value:c.paths,real_value:v,matched_path:f,has_unit:!1})}else u.push({type:state_fallback_var,value:c.paths,real_value:_,matched_path:f,has_unit:!1});a.cur_index=c.endIndex+1,a.prev_index=a.cur_index}else u.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index}else")"===i?(u.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index):(a.cur_index++,a.prev_index=a.cur_index);break;case state_number:if(number_char_set.has(i))a.cur_index++;else if("."===i){if(a.cur_index===a.prev_index||e.slice(a.prev_index,a.cur_index).includes("."))throw new Error("非法的小数部分".concat(e.slice(a.prev_index,a.cur_index)));a.cur_index++}else"e"===i?(a.curr_state=state_scientific,a.cur_index++):r?"*/+-() ".indexOf(i)>-1||"%"===i&&number_char_set.has(e[a.cur_index-1])&&pure_number_var_first_char_set.has(get_next_nonempty_char(e,a.cur_index,o))?push_token$3(u,a):a.cur_index++:push_token$3(u,a);break;case state_operator:var d=e[a.cur_index-1];"*"===i&&"*"===d?(a.cur_index++,u.push({type:state_operator,value:"**"}),a.prev_index=a.cur_index):"/"===i&&"/"===d?(a.cur_index++,u.push({type:state_operator,value:"//"}),a.prev_index=a.cur_index):(u.push({type:state_operator,value:d}),a.prev_index=a.cur_index),a.curr_state=state_initial;break;case state_var:var_members_char_set.has(i)?a.cur_index++:push_token$3(u,a);break;case state_scientific:if(number_char_set.has(i))a.cur_index++;else if("+-".includes(i)){var g=a.prev_index;"+-".includes(e[g])&&(g+=1);var b=e.slice(g,a.cur_index),y=b.at(-1);b.includes(i)||"e"!==y?push_token$3(u,a):a.cur_index++}else r&&-1==="*/+-() ".indexOf(i)?a.cur_index++:push_token$3(u,a);break;default:throw new Error("字符扫描状态错误")}return a.prev_index<a.cur_index&&push_token$3(u,a),u.has_var=a.has_var,u.has_unit=a.has_unit,u.unit=a.unit_str,u}var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(e){var t,r,n,i,a,o,u,s,c,l,_=A.prototype={constructor:A,toString:null,valueOf:null},f=new A(1),p=20,h=4,v=-7,m=21,d=-1e7,g=1e7,b=!1,y=1,w=0,x={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},S="0123456789abcdefghijklmnopqrstuvwxyz",E=!0;function A(e,t){var i,a,o,u,s,c,l,_,f=this;if(!(f instanceof A))return new A(e,t);if(null==t){if(e&&!0===e._isBigNumber)return f.s=e.s,void(!e.c||e.e>g?f.c=f.e=null:e.e<d?f.c=[f.e=0]:(f.e=e.e,f.c=e.c.slice()));if((c="number"==typeof e)&&0*e==0){if(f.s=1/e<0?(e=-e,-1):1,e===~~e){for(u=0,s=e;s>=10;s/=10,u++);return void(u>g?f.c=f.e=null:(f.e=u,f.c=[e]))}_=String(e)}else{if(!isNumeric.test(_=String(e)))return n(f,_,c);f.s=45==_.charCodeAt(0)?(_=_.slice(1),-1):1}(u=_.indexOf("."))>-1&&(_=_.replace(".","")),(s=_.search(/e/i))>0?(u<0&&(u=s),u+=+_.slice(s+1),_=_.substring(0,s)):u<0&&(u=_.length)}else{if(intCheck(t,2,S.length,"Base"),10==t&&E)return T(f=new A(e),p+f.e+1,h);if(_=String(e),c="number"==typeof e){if(0*e!=0)return n(f,_,c,t);if(f.s=1/e<0?(_=_.slice(1),-1):1,A.DEBUG&&_.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+e)}else f.s=45===_.charCodeAt(0)?(_=_.slice(1),-1):1;for(i=S.slice(0,t),u=s=0,l=_.length;s<l;s++)if(i.indexOf(a=_.charAt(s))<0){if("."==a){if(s>u){u=l;continue}}else if(!o&&(_==_.toUpperCase()&&(_=_.toLowerCase())||_==_.toLowerCase()&&(_=_.toUpperCase()))){o=!0,s=-1,u=0;continue}return n(f,String(e),c,t)}c=!1,(u=(_=r(_,t,10,f.s)).indexOf("."))>-1?_=_.replace(".",""):u=_.length}for(s=0;48===_.charCodeAt(s);s++);for(l=_.length;48===_.charCodeAt(--l););if(_=_.slice(s,++l)){if(l-=s,c&&A.DEBUG&&l>15&&(e>MAX_SAFE_INTEGER||e!==mathfloor(e)))throw Error(tooManyDigits+f.s*e);if((u=u-s-1)>g)f.c=f.e=null;else if(u<d)f.c=[f.e=0];else{if(f.e=u,f.c=[],s=(u+1)%LOG_BASE,u<0&&(s+=LOG_BASE),s<l){for(s&&f.c.push(+_.slice(0,s)),l-=LOG_BASE;s<l;)f.c.push(+_.slice(s,s+=LOG_BASE));s=LOG_BASE-(_=_.slice(s)).length}else s-=l;for(;s--;_+="0");f.c.push(+_)}}else f.c=[f.e=0]}function N(e,t,r,n){var i,a,o,u,s;if(null==r?r=h:intCheck(r,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,null==t)s=coeffToString(e.c),s=1==n||2==n&&(o<=v||o>=m)?toExponential(s,o):toFixedPoint(s,o,"0");else if(a=(e=T(new A(e),t,r)).e,u=(s=coeffToString(e.c)).length,1==n||2==n&&(t<=a||a<=v)){for(;u<t;s+="0",u++);s=toExponential(s,a)}else if(t-=o,s=toFixedPoint(s,a,"0"),a+1>u){if(--t>0)for(s+=".";t--;s+="0");}else if((t+=a-u)>0)for(a+1==u&&(s+=".");t--;s+="0");return e.s<0&&i?"-"+s:s}function O(e,t){for(var r,n=1,i=new A(e[0]);n<e.length;n++){if(!(r=new A(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function k(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*LOG_BASE-1)>g?e.c=e.e=null:r<d?e.c=[e.e=0]:(e.e=r,e.c=t),e}function T(e,t,r,n){var i,a,o,u,s,c,l,_=e.c,f=POWS_TEN;if(_){e:{for(i=1,u=_[0];u>=10;u/=10,i++);if((a=t-i)<0)a+=LOG_BASE,o=t,l=(s=_[c=0])/f[i-o-1]%10|0;else if((c=mathceil((a+1)/LOG_BASE))>=_.length){if(!n)break e;for(;_.length<=c;_.push(0));s=l=0,i=1,o=(a%=LOG_BASE)-LOG_BASE+1}else{for(s=u=_[c],i=1;u>=10;u/=10,i++);l=(o=(a%=LOG_BASE)-LOG_BASE+i)<0?0:s/f[i-o-1]%10|0}if(n=n||t<0||null!=_[c+1]||(o<0?s:s%f[i-o-1]),n=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(a>0?o>0?s/f[i-o]:0:_[c-1])%10&1||r==(e.s<0?8:7)),t<1||!_[0])return _.length=0,n?(t-=e.e+1,_[0]=f[(LOG_BASE-t%LOG_BASE)%LOG_BASE],e.e=-t||0):_[0]=e.e=0,e;if(0==a?(_.length=c,u=1,c--):(_.length=c+1,u=f[LOG_BASE-a],_[c]=o>0?mathfloor(s/f[i-o]%f[o])*u:0),n)for(;;){if(0==c){for(a=1,o=_[0];o>=10;o/=10,a++);for(o=_[0]+=u,u=1;o>=10;o/=10,u++);a!=u&&(e.e++,_[0]==BASE&&(_[0]=1));break}if(_[c]+=u,_[c]!=BASE)break;_[c--]=0,u=1}for(a=_.length;0===_[--a];_.pop());}e.e>g?e.c=e.e=null:e.e<d&&(e.c=[e.e=0])}return e}function B(e){var t,r=e.e;return null===r?e.toString():(t=coeffToString(e.c),t=r<=v||r>=m?toExponential(t,r):toFixedPoint(t,r,"0"),e.s<0?"-"+t:t)}return A.clone=clone,A.ROUND_UP=0,A.ROUND_DOWN=1,A.ROUND_CEIL=2,A.ROUND_FLOOR=3,A.ROUND_HALF_UP=4,A.ROUND_HALF_DOWN=5,A.ROUND_HALF_EVEN=6,A.ROUND_HALF_CEIL=7,A.ROUND_HALF_FLOOR=8,A.EUCLID=9,A.config=A.set=function(e){var t,r;if(null!=e){if("object"!=_typeof(e))throw Error(bignumberError+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(intCheck(r=e[t],0,MAX,t),p=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(intCheck(r=e[t],0,8,t),h=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(intCheck(r[0],-MAX,0,t),intCheck(r[1],0,MAX,t),v=r[0],m=r[1]):(intCheck(r,-MAX,MAX,t),v=-(m=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)intCheck(r[0],-MAX,-1,t),intCheck(r[1],1,MAX,t),d=r[0],g=r[1];else{if(intCheck(r,-MAX,MAX,t),!r)throw Error(bignumberError+t+" cannot be zero: "+r);d=-(g=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(bignumberError+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw b=!r,Error(bignumberError+"crypto unavailable");b=r}else b=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(intCheck(r=e[t],0,9,t),y=r),e.hasOwnProperty(t="POW_PRECISION")&&(intCheck(r=e[t],0,MAX,t),w=r),e.hasOwnProperty(t="FORMAT")){if("object"!=_typeof(r=e[t]))throw Error(bignumberError+t+" not an object: "+r);x=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(bignumberError+t+" invalid: "+r);E="0123456789"==r.slice(0,10),S=r}}return{DECIMAL_PLACES:p,ROUNDING_MODE:h,EXPONENTIAL_AT:[v,m],RANGE:[d,g],CRYPTO:b,MODULO_MODE:y,POW_PRECISION:w,FORMAT:x,ALPHABET:S}},A.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!A.DEBUG)return!0;var t,r,n=e.c,i=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&i>=-MAX&&i<=MAX&&i===mathfloor(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%LOG_BASE)<1&&(t+=LOG_BASE),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=BASE||r!==mathfloor(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===a||1===a||-1===a))return!0;throw Error(bignumberError+"Invalid BigNumber: "+e)},A.maximum=A.max=function(){return O(arguments,_.lt)},A.minimum=A.min=function(){return O(arguments,_.gt)},A.random=(i=9007199254740992,a=Math.random()*i&2097151?function(){return mathfloor(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,u=0,s=[],c=new A(f);if(null==e?e=p:intCheck(e,0,MAX),i=mathceil(e/LOG_BASE),b)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));u<i;)(o=131072*t[u]+(t[u+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[u]=r[0],t[u+1]=r[1]):(s.push(o%1e14),u+=2);u=i/2}else{if(!crypto.randomBytes)throw b=!1,Error(bignumberError+"crypto unavailable");for(t=crypto.randomBytes(i*=7);u<i;)(o=281474976710656*(31&t[u])+1099511627776*t[u+1]+4294967296*t[u+2]+16777216*t[u+3]+(t[u+4]<<16)+(t[u+5]<<8)+t[u+6])>=9e15?crypto.randomBytes(7).copy(t,u):(s.push(o%1e14),u+=7);u=i/7}if(!b)for(;u<i;)(o=a())<9e15&&(s[u++]=o%1e14);for(i=s[--u],e%=LOG_BASE,i&&e&&(o=POWS_TEN[LOG_BASE-e],s[u]=mathfloor(i/o)*o);0===s[u];s.pop(),u--);if(u<0)s=[n=0];else{for(n=-1;0===s[0];s.splice(0,1),n-=LOG_BASE);for(u=1,o=s[0];o>=10;o/=10,u++);u<LOG_BASE&&(n-=LOG_BASE-u)}return c.e=n,c.c=s,c}),A.sum=function(){for(var e=1,t=arguments,r=new A(t[0]);e<t.length;)r=r.plus(t[e++]);return r},r=function(){var e="0123456789";function r(e,t,r,n){for(var i,a,o=[0],u=0,s=e.length;u<s;){for(a=o.length;a--;o[a]*=t);for(o[0]+=n.indexOf(e.charAt(u++)),i=0;i<o.length;i++)o[i]>r-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/r|0,o[i]%=r)}return o.reverse()}return function(n,i,a,o,u){var s,c,l,_,f,v,m,d,g=n.indexOf("."),b=p,y=h;for(g>=0&&(_=w,w=0,n=n.replace(".",""),v=(d=new A(i)).pow(n.length-g),w=_,d.c=r(toFixedPoint(coeffToString(v.c),v.e,"0"),10,a,e),d.e=d.c.length),l=_=(m=r(n,i,a,u?(s=S,e):(s=e,S))).length;0==m[--_];m.pop());if(!m[0])return s.charAt(0);if(g<0?--l:(v.c=m,v.e=l,v.s=o,m=(v=t(v,d,b,y,a)).c,f=v.r,l=v.e),g=m[c=l+b+1],_=a/2,f=f||c<0||null!=m[c+1],f=y<4?(null!=g||f)&&(0==y||y==(v.s<0?3:2)):g>_||g==_&&(4==y||f||6==y&&1&m[c-1]||y==(v.s<0?8:7)),c<1||!m[0])n=f?toFixedPoint(s.charAt(1),-b,s.charAt(0)):s.charAt(0);else{if(m.length=c,f)for(--a;++m[--c]>a;)m[c]=0,c||(++l,m=[1].concat(m));for(_=m.length;!m[--_];);for(g=0,n="";g<=_;n+=s.charAt(m[g++]));n=toFixedPoint(n,l,s.charAt(0))}return n}}(),t=function(){function e(e,t,r){var n,i,a,o,u=0,s=e.length,c=t%SQRT_BASE,l=t/SQRT_BASE|0;for(e=e.slice();s--;)u=((i=c*(a=e[s]%SQRT_BASE)+(n=l*a+(o=e[s]/SQRT_BASE|0)*c)%SQRT_BASE*SQRT_BASE+u)/r|0)+(n/SQRT_BASE|0)+l*o,e[s]=i%r;return u&&(e=[u].concat(e)),e}function t(e,t,r,n){var i,a;if(r!=n)a=r>n?1:-1;else for(i=a=0;i<r;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,a,o,u){var s,c,l,_,f,p,h,v,m,d,g,b,y,w,x,S,E,N=n.s==i.s?1:-1,O=n.c,k=i.c;if(!(O&&O[0]&&k&&k[0]))return new A(n.s&&i.s&&(O?!k||O[0]!=k[0]:k)?O&&0==O[0]||!k?0*N:N/0:NaN);for(m=(v=new A(N)).c=[],N=a+(c=n.e-i.e)+1,u||(u=BASE,c=bitFloor(n.e/LOG_BASE)-bitFloor(i.e/LOG_BASE),N=N/LOG_BASE|0),l=0;k[l]==(O[l]||0);l++);if(k[l]>(O[l]||0)&&c--,N<0)m.push(1),_=!0;else{for(w=O.length,S=k.length,l=0,N+=2,(f=mathfloor(u/(k[0]+1)))>1&&(k=e(k,f,u),O=e(O,f,u),S=k.length,w=O.length),y=S,g=(d=O.slice(0,S)).length;g<S;d[g++]=0);E=k.slice(),E=[0].concat(E),x=k[0],k[1]>=u/2&&x++;do{if(f=0,(s=t(k,d,S,g))<0){if(b=d[0],S!=g&&(b=b*u+(d[1]||0)),(f=mathfloor(b/x))>1)for(f>=u&&(f=u-1),h=(p=e(k,f,u)).length,g=d.length;1==t(p,d,h,g);)f--,r(p,S<h?E:k,h,u),h=p.length,s=1;else 0==f&&(s=f=1),h=(p=k.slice()).length;if(h<g&&(p=[0].concat(p)),r(d,p,g,u),g=d.length,-1==s)for(;t(k,d,S,g)<1;)f++,r(d,S<g?E:k,g,u),g=d.length}else 0===s&&(f++,d=[0]);m[l++]=f,d[0]?d[g++]=O[y]||0:(d=[O[y]],g=1)}while((y++<w||null!=d[0])&&N--);_=null!=d[0],m[0]||m.splice(0,1)}if(u==BASE){for(l=1,N=m[0];N>=10;N/=10,l++);T(v,a+(v.e=l+c*LOG_BASE-1)+1,o,_)}else v.e=c,v.r=+_;return v}}(),o=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,s=/^\.([^.]+)$/,c=/^-?(Infinity|NaN)$/,l=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(e,t,r,n){var i,a=r?t:t.replace(l,"");if(c.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(o,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,a=a.replace(u,"$1").replace(s,"0.$1")),t!=a))return new A(a,i);if(A.DEBUG)throw Error(bignumberError+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},_.absoluteValue=_.abs=function(){var e=new A(this);return e.s<0&&(e.s=1),e},_.comparedTo=function(e,t){return compare(this,new A(e,t))},_.decimalPlaces=_.dp=function(e,t){var r,n,i,a=this;if(null!=e)return intCheck(e,0,MAX),null==t?t=h:intCheck(t,0,8),T(new A(a),e+a.e+1,t);if(!(r=a.c))return null;if(n=((i=r.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},_.dividedBy=_.div=function(e,r){return t(this,new A(e,r),p,h)},_.dividedToIntegerBy=_.idiv=function(e,r){return t(this,new A(e,r),0,1)},_.exponentiatedBy=_.pow=function(e,t){var r,n,i,a,o,u,s,c,l=this;if((e=new A(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+B(e));if(null!=t&&(t=new A(t)),o=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return c=new A(Math.pow(+B(l),o?e.s*(2-isOdd(e)):+B(e))),t?c.mod(t):c;if(u=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new A(NaN);(n=!u&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||o&&l.c[1]>=24e7:l.c[0]<8e13||o&&l.c[0]<=9999975e7)))return a=l.s<0&&isOdd(e)?-0:0,l.e>-1&&(a=1/a),new A(u?1/a:a);w&&(a=mathceil(w/LOG_BASE+2))}for(o?(r=new A(.5),u&&(e.s=1),s=isOdd(e)):s=(i=Math.abs(+B(e)))%2,c=new A(f);;){if(s){if(!(c=c.times(l)).c)break;a?c.c.length>a&&(c.c.length=a):n&&(c=c.mod(t))}if(i){if(0===(i=mathfloor(i/2)))break;s=i%2}else if(T(e=e.times(r),e.e+1,1),e.e>14)s=isOdd(e);else{if(0===(i=+B(e)))break;s=i%2}l=l.times(l),a?l.c&&l.c.length>a&&(l.c.length=a):n&&(l=l.mod(t))}return n?c:(u&&(c=f.div(c)),t?c.mod(t):a?T(c,w,h,undefined):c)},_.integerValue=function(e){var t=new A(this);return null==e?e=h:intCheck(e,0,8),T(t,t.e+1,e)},_.isEqualTo=_.eq=function(e,t){return 0===compare(this,new A(e,t))},_.isFinite=function(){return!!this.c},_.isGreaterThan=_.gt=function(e,t){return compare(this,new A(e,t))>0},_.isGreaterThanOrEqualTo=_.gte=function(e,t){return 1===(t=compare(this,new A(e,t)))||0===t},_.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},_.isLessThan=_.lt=function(e,t){return compare(this,new A(e,t))<0},_.isLessThanOrEqualTo=_.lte=function(e,t){return-1===(t=compare(this,new A(e,t)))||0===t},_.isNaN=function(){return!this.s},_.isNegative=function(){return this.s<0},_.isPositive=function(){return this.s>0},_.isZero=function(){return!!this.c&&0==this.c[0]},_.minus=function(e,t){var r,n,i,a,o=this,u=o.s;if(t=(e=new A(e,t)).s,!u||!t)return new A(NaN);if(u!=t)return e.s=-t,o.plus(e);var s=o.e/LOG_BASE,c=e.e/LOG_BASE,l=o.c,_=e.c;if(!s||!c){if(!l||!_)return l?(e.s=-t,e):new A(_?o:NaN);if(!l[0]||!_[0])return _[0]?(e.s=-t,e):new A(l[0]?o:3==h?-0:0)}if(s=bitFloor(s),c=bitFloor(c),l=l.slice(),u=s-c){for((a=u<0)?(u=-u,i=l):(c=s,i=_),i.reverse(),t=u;t--;i.push(0));i.reverse()}else for(n=(a=(u=l.length)<(t=_.length))?u:t,u=t=0;t<n;t++)if(l[t]!=_[t]){a=l[t]<_[t];break}if(a&&(i=l,l=_,_=i,e.s=-e.s),(t=(n=_.length)-(r=l.length))>0)for(;t--;l[r++]=0);for(t=BASE-1;n>u;){if(l[--n]<_[n]){for(r=n;r&&!l[--r];l[r]=t);--l[r],l[n]+=BASE}l[n]-=_[n]}for(;0==l[0];l.splice(0,1),--c);return l[0]?k(e,l,c):(e.s=3==h?-1:1,e.c=[e.e=0],e)},_.modulo=_.mod=function(e,r){var n,i,a=this;return e=new A(e,r),!a.c||!e.s||e.c&&!e.c[0]?new A(NaN):!e.c||a.c&&!a.c[0]?new A(a):(9==y?(i=e.s,e.s=1,n=t(a,e,0,3),e.s=i,n.s*=i):n=t(a,e,0,y),(e=a.minus(n.times(e))).c[0]||1!=y||(e.s=a.s),e)},_.multipliedBy=_.times=function(e,t){var r,n,i,a,o,u,s,c,l,_,f,p,h,v,m,d=this,g=d.c,b=(e=new A(e,t)).c;if(!(g&&b&&g[0]&&b[0]))return!d.s||!e.s||g&&!g[0]&&!b||b&&!b[0]&&!g?e.c=e.e=e.s=null:(e.s*=d.s,g&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=bitFloor(d.e/LOG_BASE)+bitFloor(e.e/LOG_BASE),e.s*=d.s,(s=g.length)<(_=b.length)&&(h=g,g=b,b=h,i=s,s=_,_=i),i=s+_,h=[];i--;h.push(0));for(v=BASE,m=SQRT_BASE,i=_;--i>=0;){for(r=0,f=b[i]%m,p=b[i]/m|0,a=i+(o=s);a>i;)r=((c=f*(c=g[--o]%m)+(u=p*c+(l=g[o]/m|0)*f)%m*m+h[a]+r)/v|0)+(u/m|0)+p*l,h[a--]=c%v;h[a]=r}return r?++n:h.splice(0,1),k(e,h,n)},_.negated=function(){var e=new A(this);return e.s=-e.s||null,e},_.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new A(e,t)).s,!i||!t)return new A(NaN);if(i!=t)return e.s=-t,n.minus(e);var a=n.e/LOG_BASE,o=e.e/LOG_BASE,u=n.c,s=e.c;if(!a||!o){if(!u||!s)return new A(i/0);if(!u[0]||!s[0])return s[0]?e:new A(u[0]?n:0*i)}if(a=bitFloor(a),o=bitFloor(o),u=u.slice(),i=a-o){for(i>0?(o=a,r=s):(i=-i,r=u),r.reverse();i--;r.push(0));r.reverse()}for((i=u.length)-(t=s.length)<0&&(r=s,s=u,u=r,t=i),i=0;t;)i=(u[--t]=u[t]+s[t]+i)/BASE|0,u[t]=BASE===u[t]?0:u[t]%BASE;return i&&(u=[i].concat(u),++o),k(e,u,o)},_.precision=_.sd=function(e,t){var r,n,i,a=this;if(null!=e&&e!==!!e)return intCheck(e,1,MAX),null==t?t=h:intCheck(t,0,8),T(new A(a),e,t);if(!(r=a.c))return null;if(n=(i=r.length-1)*LOG_BASE+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&a.e+1>n&&(n=a.e+1),n},_.shiftedBy=function(e){return intCheck(e,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER),this.times("1e"+e)},_.squareRoot=_.sqrt=function(){var e,r,n,i,a,o=this,u=o.c,s=o.s,c=o.e,l=p+4,_=new A("0.5");if(1!==s||!u||!u[0])return new A(!s||s<0&&(!u||u[0])?NaN:u?o:1/0);if(0==(s=Math.sqrt(+B(o)))||s==1/0?(((r=coeffToString(u)).length+c)%2==0&&(r+="0"),s=Math.sqrt(+r),c=bitFloor((c+1)/2)-(c<0||c%2),n=new A(r=s==1/0?"5e"+c:(r=s.toExponential()).slice(0,r.indexOf("e")+1)+c)):n=new A(s+""),n.c[0])for((s=(c=n.e)+l)<3&&(s=0);;)if(a=n,n=_.times(a.plus(t(o,a,l,1))),coeffToString(a.c).slice(0,s)===(r=coeffToString(n.c)).slice(0,s)){if(n.e<c&&--s,"9999"!=(r=r.slice(s-3,s+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(T(n,n.e+p+2,1),e=!n.times(n).eq(o));break}if(!i&&(T(a,a.e+p+2,0),a.times(a).eq(o))){n=a;break}l+=4,s+=4,i=1}return T(n,n.e+p+1,h,e)},_.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),N(this,e,t,1)},_.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),N(this,e,t)},_.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==_typeof(t)?(r=t,t=null):e&&"object"==_typeof(e)?(r=e,e=t=null):r=x;else if("object"!=_typeof(r))throw Error(bignumberError+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var a,o=n.split("."),u=+r.groupSize,s=+r.secondaryGroupSize,c=r.groupSeparator||"",l=o[0],_=o[1],f=i.s<0,p=f?l.slice(1):l,h=p.length;if(s&&(a=u,u=s,s=a,h-=a),u>0&&h>0){for(a=h%u||u,l=p.substr(0,a);a<h;a+=u)l+=c+p.substr(a,u);s>0&&(l+=c+p.slice(a)),f&&(l="-"+l)}n=_?l+(r.decimalSeparator||"")+((s=+r.fractionGroupSize)?_.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):_):l}return(r.prefix||"")+n+(r.suffix||"")},_.toFraction=function(e){var r,n,i,a,o,u,s,c,l,_,p,v,m=this,d=m.c;if(null!=e&&(!(s=new A(e)).isInteger()&&(s.c||1!==s.s)||s.lt(f)))throw Error(bignumberError+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+B(s));if(!d)return new A(m);for(r=new A(f),l=n=new A(f),i=c=new A(f),v=coeffToString(d),o=r.e=v.length-m.e-1,r.c[0]=POWS_TEN[(u=o%LOG_BASE)<0?LOG_BASE+u:u],e=!e||s.comparedTo(r)>0?o>0?r:l:s,u=g,g=1/0,s=new A(v),c.c[0]=0;_=t(s,r,0,1),1!=(a=n.plus(_.times(i))).comparedTo(e);)n=i,i=a,l=c.plus(_.times(a=l)),c=a,r=s.minus(_.times(a=r)),s=a;return a=t(e.minus(n),i,0,1),c=c.plus(a.times(l)),n=n.plus(a.times(i)),c.s=l.s=m.s,p=t(l,i,o*=2,h).minus(m).abs().comparedTo(t(c,n,o,h).minus(m).abs())<1?[l,i]:[c,n],g=u,p},_.toNumber=function(){return+B(this)},_.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),N(this,e,t,2)},_.toString=function(e){var t,n=this,i=n.s,a=n.e;return null===a?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=a<=v||a>=m?toExponential(coeffToString(n.c),a):toFixedPoint(coeffToString(n.c),a,"0"):10===e&&E?t=toFixedPoint(coeffToString((n=T(new A(n),p+a+1,h)).c),n.e,"0"):(intCheck(e,2,S.length,"Base"),t=r(toFixedPoint(coeffToString(n.c),a,"0"),10,e,i,!0)),i<0&&n.c[0]&&(t="-"+t)),t},_.valueOf=_.toJSON=function(){return B(this)},_._isBigNumber=!0,_[Symbol.toStringTag]="BigNumber",_[Symbol.for("nodejs.util.inspect.custom")]=_.valueOf,null!=e&&A.set(e),A}function bitFloor(e){var t=0|e;return e>0||e===t?t:t-1}function coeffToString(e){for(var t,r,n=1,i=e.length,a=e[0]+"";n<i;){for(t=e[n++]+"",r=LOG_BASE-t.length;r--;t="0"+t);a+=t}for(i=a.length;48===a.charCodeAt(--i););return a.slice(0,i+1||1)}function compare(e,t){var r,n,i=e.c,a=t.c,o=e.s,u=t.s,s=e.e,c=t.e;if(!o||!u)return null;if(r=i&&!i[0],n=a&&!a[0],r||n)return r?n?0:-u:o;if(o!=u)return o;if(r=o<0,n=s==c,!i||!a)return n?0:!i^r?1:-1;if(!n)return s>c^r?1:-1;for(u=(s=i.length)<(c=a.length)?s:c,o=0;o<u;o++)if(i[o]!=a[o])return i[o]>a[o]^r?1:-1;return s==c?0:s>c^r?1:-1}function intCheck(e,t,r,n){if(e<t||e>r||e!==mathfloor(e))throw Error(bignumberError+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function isOdd(e){var t=e.c.length-1;return bitFloor(e.e/LOG_BASE)==t&&e.c[t]%2!=0}function toExponential(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function toFixedPoint(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var BigNumber=clone(),DEFAULT_VOLUME_UNITS=["","K","M","B","T"],BUILTIN_PRESETS={default:{units:["","K","M","B","T"],step:1e3},cn:{units:["","千","百万","十亿","万亿"],step:1e3},wan:{units:["","万","亿","万亿"],step:1e4},storage:{units:["B","KB","MB","GB","TB"],step:1024}};function convert_unit_from_to_out(e){if(!e)return null;var t={};for(var r in e){var n=e[r];for(var i in n)t[i]||(t[i]={}),t[i][r]=n[i]}return t}function get_unit_mapping(e){return e._unit_out?e._unit_out:e._unit_from?convert_unit_from_to_out(e._unit_from):null}function find_conversion_rule(e,t,r,n){if(!r||!e)return null;var i=r[e];if(!i)return null;if(t){var a=i[t];return void 0!==a?{rule:a,inputUnit:t}:null}if(n){var o,u=_createForOfIteratorHelper(Array.isArray(n)?n:[n]);try{for(u.s();!(o=u.n()).done;){var s=o.value;if(void 0!==i[s])return{rule:i[s],inputUnit:s}}}catch(e){u.e(e)}finally{u.f()}}var c=Object.keys(i);return 1===c.length?{rule:i[c[0]],inputUnit:c[0]}:null}function apply_conversion_rule(e,t,r,n){if(null==t)return e;var i=new BigNumber(e);if("number"==typeof t)return i.times(t).toFixed();if("function"==typeof t)return String(t(Number(e),r,n));if("object"===_typeof(t)){if(t.fn&&"function"==typeof t.fn)return String(t.fn(Number(e),r,n));if(void 0!==t.ratio)return i.times(t.ratio).toFixed();if(void 0!==t.div)return i.div(t.div).toFixed()}return e}function getUnitInfoFromTokens(e){if(!e)return null;var t,r=_createForOfIteratorHelper(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;if("unit_after"===n.type||"unit_before"===n.type||"unit_middle"===n.type)return{outputUnit:n.unit,inputUnit:n.input_unit,position:"unit_after"===n.type?"after":"unit_before"===n.type?"before":"middle",showUnit:!0};if("to-number-string"===n.type&&n.output_unit)return{outputUnit:n.output_unit,inputUnit:n.input_unit,position:null,showUnit:!1}}}catch(e){r.e(e)}finally{r.f()}return null}function apply_unit(e,t,r,n){if(!t)return e;var i=e.startsWith("-"),a=e.startsWith("+"),o="",u=e;switch((i||a)&&(o=e[0],u=e.slice(1)),r){case"after":default:return o+u+t;case"before":return t+o+u;case"middle":return o?o+t+u:t+u}}function format_volume(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r._volume_preset,i=r._volume_units||DEFAULT_VOLUME_UNITS,a=r._volume_step||1e3;if(n){var o=(r._presets||{})[n]||BUILTIN_PRESETS[n];o&&(Array.isArray(o)?(i=o,a=1e3):(i=o.units||i,a=void 0!==o.step?o.step:a))}var u=e.startsWith("-"),s=e.startsWith("+"),c="",l=e;(u||s)&&(c=e[0],l=e.slice(1));for(var _=new BigNumber(l),f=0,p=Array.isArray(a);f<i.length-1;){var h=p?a[f]||a[a.length-1]:a;if(!_.gte(h))break;_=_.div(h),f++}var v=_.toFixed(t,BigNumber.ROUND_DOWN);return v.includes(".")&&(v=v.replace(/\.?0+$/,"")),c+v+i[f]}function pad_integer(e,t){if(t<=0)return e;var r=e.startsWith("-"),n=e.startsWith("+"),i="",a=e;(r||n)&&(i=e[0],a=e.slice(1));var o=a.split("."),u=o[0],s=o[1];u.length<t&&(u="0".repeat(t-u.length)+u);var c=i+u;return void 0!==s&&(c+="."+s),c}function format(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n="";if("undefined"===(n=BigNumber.isBigNumber(e)?e.toFixed():"string"==typeof e?e:e.toString())||"NaN"===n)return[void 0,{}];var i=get_unit_mapping(r),a=getUnitInfoFromTokens(t),o=null,u=null,s=!1;if(a){var c=a.outputUnit,l=a.inputUnit,_=a.position,f=a.showUnit;if(i&&c){var p=find_conversion_rule(c,l,i,r._unit_default_out);p&&(n=apply_conversion_rule(n,p.rule,p.inputUnit,c))}f&&(o=c,u=_,s=!0)}else if(i&&r._unit_default_out&&r._unit_position){var h,v=_createForOfIteratorHelper(Array.isArray(r._unit_default_out)?r._unit_default_out:[r._unit_default_out]);try{for(v.s();!(h=v.n()).done;){var m=h.value,d=find_conversion_rule(m,null,i,r._unit_default_out);if(d){n=apply_conversion_rule(n,d.rule,d.inputUnit,m),o=m,u=r._unit_position,s=!0;break}}}catch(e){v.e(e)}finally{v.f()}}var g={mantissa:null,mantissa_type:null,mantissa_min:null,mantissa_max:null,thousands:!1,sign:!1,round:"~-",scientific:!1,fraction:!1,percent:!1,to_number:!1,to_number_string:!1,integer_padding:null,volume:!1,volume_preset:null,unit_format:null,unit_value:null,unit_input:null},b=[],y=[];t.forEach((function(e,t){"symbol"===e.type?b.push({value:e.value,index:t}):"number"!==e.type&&"var"!==e.type||y.push({value:"var"===e.type?e.real_value:e.value,index:t})}));var w=b.find((function(e){return">="===e.value||">"===e.value})),x=b.find((function(e){return"<="===e.value||"<"===e.value}));if(w&&x)for(var S=function(){var e=b[E],t=y.find((function(t){return t.index>e.index}));t&&(">="===e.value||">"===e.value?g.mantissa_min=+t.value:"<="!==e.value&&"<"!==e.value||(g.mantissa_max=+t.value))},E=0;E<b.length;E++)S();if(t.forEach((function(e){var t=e.type;if("symbol"===t){if(![">=","<=","=","<",">"].includes(e.value))throw new Error("错误的格式化参数:",e.value);w&&x||(g.mantissa_type=e.value)}else if("to-number"===t)g.to_number=!0;else if("to-number-string"===t)g.to_number_string=!0;else if("comma"===t)g.thousands=!0;else if("number"===t)w&&x||(g.mantissa=e.value);else if("var"===t)w&&x||(g.mantissa=e.real_value);else if("plus"===t)g.sign=!0;else if("round"===t)g.round=e.value;else if("fraction"===t)g.fraction=!0;else if("scientific"===t)g.scientific=!0;else if("percent"===t)g.percent=!0;else if("integer_padding"===t)g.integer_padding=void 0!==e.real_value?+e.real_value:+e.value;else if("volume"===t)g.volume=!0,e.preset&&(g.volume_preset=e.preset);else if("unit_after"===t)g.unit_format="after",g.unit_value=e.unit,g.unit_input=e.input_unit;else if("unit_before"===t)g.unit_format="before",g.unit_value=e.unit,g.unit_input=e.input_unit;else{if("unit_middle"!==t)throw new Error("错误的fmt Token");g.unit_format="middle",g.unit_value=e.unit,g.unit_input=e.input_unit}})),g.to_number){var A=parse_mantissa(n,g.mantissa_type,g.mantissa,g.round);return g.integer_padding&&(A=pad_integer(A,g.integer_padding)),[+A,g]}if(g.scientific){var N=BigNumber(n).toExponential();return[g.sign&&!N.startsWith("-")?"+"+N:N,g]}if(g.fraction){var O=BigNumber(n).toFraction().map((function(e){return e.toFixed()})).join("/");return[g.sign&&!O.startsWith("-")?"+"+O:O,g]}if(g.volume){var k=format_volume(n,null!==g.mantissa?+g.mantissa:2,_objectSpread2(_objectSpread2({},r),{},{_volume_preset:g.volume_preset}));return[g.sign&&!k.startsWith("-")?"+"+k:k,g]}if(g.percent&&(n=BigNumber(n).times(100).toFixed()),null!==g.mantissa_min&&null!==g.mantissa_max){var T=n.includes(".")?n.split(".")[1].length:0;T<g.mantissa_min?n=parse_mantissa(n,">=",g.mantissa_min,g.round):T>g.mantissa_max?n=parse_mantissa(n,"<=",g.mantissa_max,g.round):n.includes(".")&&(n=n.replace(/0*$/,"").replace(/\.$/,""))}else null===g.mantissa?n.includes(".")&&(n=n.replace(/0*$/,"")):n=parse_mantissa(n,g.mantissa_type,g.mantissa,g.round);return g.integer_padding&&(n=pad_integer(n,g.integer_padding)),g.thousands&&(n=parse_thousands(n)),g.sign&&(g.to_number=!1,n.startsWith("-")||(n="+"+n)),g.percent&&(n+="%"),s&&o&&u&&(n=apply_unit(n,o,u,g.sign)),[n,g]}function close_important_push(){}function open_important_push(){}function open_debug(){}function close_debug(){}function calc_wrap(e,t){var r={_error:"-"};return["string","number"].includes(_typeof(e))?void 0===t?/[a-zA-Z$_]/.test(e.toString())?function(t){return Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc(e,t)}:calc(e):(Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc(e,t)):(Array.isArray(e)?e.unshift(r):e=_objectSpread2(_objectSpread2({},r),e),function(t){return calc(t,e)})}function check_version(){return _check_version.apply(this,arguments)}function _check_version(){return _check_version=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var res,code,versions,last_version,larr,varr,script,url;return _regeneratorRuntime().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if("undefined"==typeof process||"node"!==process.release.name){_context.next=19;break}if(!(parseInt(process.versions.node)>=17)){_context.next=17;break}return _context.next=4,promise_queue([fetch("https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js"),fetch("https://unpkg.com/a-calc@latest/a-calc.versions.js")]);case 4:return res=_context.sent,_context.next=7,res.text();case 7:code=_context.sent,versions=eval(code),last_version=versions.at(-1),larr=last_version.match(/(\d+)\.(\d+)\.(\d+)/),larr.shift(),larr=larr.map((function(e){return parseInt(e)})),varr=version.match(/(\d+)\.(\d+)\.(\d+)/),varr.shift(),varr=varr.map((function(e){return parseInt(e)})),(larr[0]>varr[0]||larr[0]===varr[0]&&larr[1]>varr[1]||larr[0]===varr[0]&&larr[1]===varr[1]&&larr[2]>varr[2])&&console.warn("a-calc has a new version:",last_version);case 17:_context.next=25;break;case 19:return script=document.createElement("script"),script.onload=function(){var e=a_calc_versions;if(Array.isArray(e)){var t=e.at(-1),r=t.match(/(\d+)\.(\d+)\.(\d+)/);r.shift(),r=r.map((function(e){return parseInt(e)}));var n=version.match(/(\d+)\.(\d+)\.(\d+)/);n.shift(),n=n.map((function(e){return parseInt(e)})),(r[0]>n[0]||r[0]===n[0]&&r[1]>n[1]||r[0]===n[0]&&r[1]===n[1]&&r[2]>n[2])&&console.log("%c↑↑↑ a-calc has a new version: %s ↑↑↑","color: #67C23A;",t)}},_context.next=23,test_urls(["https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js","https://unpkg.com/a-calc@latest/a-calc.versions.js"]);case 23:url=_context.sent,url?(script.src=url,document.body.appendChild(script)):script=null;case 25:case"end":return _context.stop()}}),_callee)}))),_check_version.apply(this,arguments)}var operator=new Set(["+","-","*","/","%","**","//"]);function detectFallbackVar(e,t){if("("!==e[t])return null;for(var r=0,n=!1,i=[],a="",o=t;o<e.length;){var u=e[o];if("("===u){if(0===r){r++,o++;continue}r++,a+=u}else if(")"===u){if(0===--r)return n?(i.push(a.trim()),{paths:i,endIndex:o}):null;a+=u}else"|"===u&&1===r?(n=!0,i.push(a.trim()),a=""):a+=u;o++}return null}function push_token$2(e,t,r){if(Number.isNaN(Number(t)))if("-"===t||"+"===t)0===e.length||"operator"===e.at(-1).type||"("===e.at(-1).value?e.push({type:"number",value:t,real_value:t,has_unit:!1}):e.push({type:"operator",value:t});else if(operator.has(t))e.push({type:"operator",value:t});else if(r._unit&&/^[+-]?\d/.test(t)){var n,i=split_unit_num(t),a=i.num,o=i.unit;if(void 0===o)e.push({type:"number",value:a,real_value:a,has_unit:!1});else r.has_unit=!0,null!==(n=r.unit_str)&&void 0!==n||(r.unit_str=o),e.push({type:"number",value:a,real_value:a,has_unit:!0,unit:o})}else if(var_first_char_set.has(t[0])){r.has_var=!0;var u=get_real_value(r.fill_data,t);if(r._unit){var s,c=split_unit_num(u),l=c.num,_=c.unit;if(void 0===_)e.push({type:"var",value:t,real_value:l,has_unit:!1});else r.has_unit=!0,null!==(s=r.unit_str)&&void 0!==s||(r.unit_str=_),e.push({type:"var",value:t,real_value:l,has_unit:!0,unit:_})}else e.push({type:"var",value:t,real_value:u,has_unit:!1})}else{if(!/^[+-]?\d/.test(t))throw new Error("无法识别的标识符:".concat(t));var f=t.indexOf("e");-1!==f&&/^\d+$/.test(t.slice(f+1))&&e.push({type:"number",value:t,real_value:t,has_unit:!1})}else e.push({type:"number",value:t,real_value:t,has_unit:!1})}function tokenizer_space(e,t,r,n){for(var i,a=0,o=0,u=e.length,s=[],c={has_var:!1,has_unit:!1,unit_str:void 0,_unit:r,fill_data:t};o<u;){if(" "===(i=e[o]))o>a&&push_token$2(s,e.slice(a,o),c),a=o+1;else if("("===i){var l=detectFallbackVar(e,o);if(l){o>a&&push_token$2(s,e.slice(a,o),c),c.has_var=!0;var _=get_fallback_value(t,l.paths,n),f=_.value,p=_.path;if(r){var h,v=split_unit_num(f),m=v.num,d=v.unit;if(void 0!==d)c.has_unit=!0,null!==(h=c.unit_str)&&void 0!==h||(c.unit_str=d),s.push({type:state_fallback_var,value:l.paths,real_value:m,matched_path:p,has_unit:!0,unit:d});else s.push({type:state_fallback_var,value:l.paths,real_value:m,matched_path:p,has_unit:!1})}else s.push({type:state_fallback_var,value:l.paths,real_value:f,matched_path:p,has_unit:!1});a=o=l.endIndex+1;continue}s.push({type:state_bracket,value:"("}),a=o+1}else")"===i&&(o>a&&push_token$2(s,e.slice(a,o),c),s.push({type:state_bracket,value:")"}),a=o+1);o++}return o>a&&push_token$2(s,e.slice(a,o),c),s.has_var=c.has_var,s.has_unit=c.has_unit,s.unit=c.unit_str,s}function compute(e,t,r){if(void 0===e||void 0===t)throw new Error("无效的操作数对:v1:".concat(e,", v2:").concat(t));switch(r){case"+":return new BigNumber(e).plus(t);case"-":return new BigNumber(e).minus(t);case"*":return new BigNumber(e).times(t);case"/":return new BigNumber(e).div(t);case"%":return new BigNumber(e).mod(t);case"**":return new BigNumber(e).pow(t);case"//":return new BigNumber(e).idiv(t)}}var operator_map$1={"+":0,"-":0,"*":1,"/":1,"%":1,"//":1,"**":2};function eval_tokens(e){if(1===e.length){var t=e[0];if("number"===t.type||"var"===t.type||"fallback_var"===t.type)return t.real_value;throw new Error("错误的表达式:".concat(t.value))}for(var r,n,i=[],a=[],o=0,u=e.length;o<u;o++)if("number"!==(r=e[o]).type&&"var"!==r.type&&"fallback_var"!==r.type)if("operator"!==r.type)if("("!==r.value){if(")"===r.value)for(var s=void 0;s=i.pop();){if("("===s){var c=a.at(-2);if("-"===c){var l=a.pop();a.pop(),a.push(BigNumber.isBigNumber(l)?l.negated():new BigNumber(l).negated())}else if("+"===c){var _=a.pop();a.pop(),a.push(_)}break}var f=a.pop(),p=a.pop();a.push(compute(p,f,s))}}else i.push("(");else{var h=i.at(-1);if("("===h){i.push(r.value);continue}var v=operator_map$1[r.value];if(!i.length){i.push(r.value);continue}if(v<operator_map$1[h])for(var m=void 0;m=i.pop();){if("("===m){i.push("(");break}var d=a.pop(),g=a.pop();a.push(compute(g,d,m))}else if(v===operator_map$1[h]){if("**"===r.value){i.push(r.value);continue}for(var b=void 0;b=i.pop();){if("("===b){i.push("(");break}if(operator_map$1[b]<v){i.push(b);break}var y=a.pop(),w=a.pop();a.push(compute(w,y,b))}}i.push(r.value)}else a.push(r.real_value);for(;n=i.pop();){var x=a.pop(),S=a.pop();a.push(compute(S,x,n))}if(1!==a.length)throw new Error("可能出现了错误的计算式");return e.has_var||(e.calc_result=a[0]),a[0]}function push_token$1(e,t,r,n,i){t===state_var||t===state_integer_padding&&var_char.includes(r[0])?(i.has_var=!0,e.push({type:t,value:r,real_value:get_real_value(i.fill_data,r)})):e.push({type:t,value:r}),n.prev=n.curr,i.state=state_initial}function fmt_tokenizer(e,t){for(var r,n={prev:0,curr:0},i=e.length,a={state:state_initial,fill_data:t,has_var:!1},o=[];n.curr<i;)switch(r=e[n.curr],a.state){case state_initial:if(" "===r)n.curr++,n.prev=n.curr;else if("<>=".includes(r))a.state=state_symbol,n.curr++;else if(","===r)n.curr++,push_token$1(o,state_comma,",",n,a);else if(var_char.includes(r))a.state=state_var,n.curr++;else if(number_char.includes(r))a.state=state_number,n.curr++;else if("+"===r)n.curr++,push_token$1(o,state_plus,"+",n,a);else if("~"===r)n.curr++,a.state=state_round;else if("%"===r)n.curr++,push_token$1(o,state_percent,"%",n,a);else if("/"===r)n.curr++,push_token$1(o,state_fraction,"/",n,a);else if("!"===r)if(a.state=state_initial,n.curr++,"n"===e[n.curr])n.curr++,push_token$1(o,state_to_number,"!n",n,a);else if("u"===e[n.curr]){n.curr++;var u=e[n.curr];if("a"===u||"b"===u||"m"===u){if(n.curr++,":"!==e[n.curr])throw new Error("!u".concat(u," 语法需要指定单位,格式: !u").concat(u,":单位"));n.curr++;for(var s=n.curr;n.curr<i&&" "!==e[n.curr];)n.curr++;var c=e.slice(s,n.curr).split(":"),l=c[0],_=c[1]||null,f={a:state_unit_after,b:state_unit_before,m:state_unit_middle};o.push({type:f[u],value:"!u".concat(u),unit:l,input_unit:_}),n.prev=n.curr,a.state=state_initial}else if(":"===e[n.curr]){n.curr++;for(var p=n.curr;n.curr<i&&" "!==e[n.curr];)n.curr++;var h=e.slice(p,n.curr).split(":"),v=h[0],m=h[1]||null;o.push({type:state_to_number_string,value:"!u",output_unit:v,input_unit:m}),n.prev=n.curr,a.state=state_initial}else push_token$1(o,state_to_number_string,"!u",n,a)}else if("e"===e[n.curr])n.curr++,push_token$1(o,state_scientific,"!e",n,a);else{if("v"!==e[n.curr])throw new Error("无法识别的!模式字符:".concat(e[n.curr]));n.curr++;var d=null;if(":"===e[n.curr]){n.curr++;for(var g=n.curr;n.curr<i&&/[a-zA-Z0-9_]/.test(e[n.curr]);)n.curr++;d=e.slice(g,n.curr)}o.push({type:state_volume,value:"!v",preset:d}),n.prev=n.curr,a.state=state_initial}else"#"===r?(n.curr++,n.prev=n.curr,"="===e[n.curr]&&(n.curr++,n.prev=n.curr),a.state=state_integer_padding):(n.curr++,n.prev=n.curr);break;case state_symbol:"="===r&&n.curr++,push_token$1(o,state_symbol,e.slice(n.prev,n.curr),n,a);break;case state_number:number_char.includes(r)?n.curr++:push_token$1(o,state_number,e.slice(n.prev,n.curr),n,a);break;case state_var:var_members_char.includes(r)?n.curr++:push_token$1(o,state_var,e.slice(n.prev,n.curr),n,a);break;case state_round:if(!("56+-".includes(r)&&n.curr-n.prev<2))throw new Error("错误的舍入语法:".concat(e.slice(n.prev,n.curr+1)));n.curr++,push_token$1(o,state_round,e.slice(n.prev,n.curr),n,a);break;case state_integer_padding:if(number_char.includes(r))n.curr++;else if(var_members_char.includes(r))n.curr++;else{var b=e.slice(n.prev,n.curr);var_char.includes(b[0])?(a.has_var=!0,o.push({type:state_integer_padding,value:b,real_value:get_real_value(a.fill_data,b)})):push_token$1(o,state_integer_padding,b,n,a),n.prev=n.curr,a.state=state_initial}break;default:throw new Error("错误的fmt分词器状态")}return n.prev<n.curr&&push_token$1(o,a.state,e.slice(n.prev,n.curr),n,a),o.has_var=a.has_var,o}var symbol_set=new Set(["<",">","=",">=","<="]),rand_set=new Set(["~+","~-","~5","~6"]);function push_token(e,t,r){if(","===t)e.push({type:state_comma,value:","});else if(symbol_set.has(t))e.push({type:state_symbol,value:t});else if(Number.isNaN(Number(t)))if(var_first_char.includes(t[0]))r.has_var=!0,e.push({type:state_var,value:t,real_value:get_real_value(r.fill_data,t)});else if("%"===t)e.push({type:state_percent,value:t});else if("/"===t)e.push({type:state_fraction,value:t});else if("+"===t)e.push({type:state_plus,value:t});else if(rand_set.has(t))e.push({type:state_round,value:t});else if("!n"===t)e.push({type:state_to_number,value:t});else if("!u"===t)e.push({type:state_to_number_string,value:t});else if(t.startsWith("!u:")){var n=t.slice(3).split(":"),i=n[0],a=n[1]||null;e.push({type:state_to_number_string,value:"!u",output_unit:i,input_unit:a})}else if(t.startsWith("!ua:")||t.startsWith("!ub:")||t.startsWith("!um:")){var o=t[2],u=t.slice(4).split(":"),s=u[0],c=u[1]||null,l={a:state_unit_after,b:state_unit_before,m:state_unit_middle};e.push({type:l[o],value:"!u".concat(o),unit:s,input_unit:c})}else if("!e"===t)e.push({type:state_scientific,value:t});else if("!v"===t||t.startsWith("!v:")){var _=null;t.startsWith("!v:")&&(_=t.slice(3)),e.push({type:state_volume,value:"!v",preset:_})}else{if(!t.startsWith("#"))throw new Error("无法识别的格式化字符: ".concat(t));var f=t.slice(1);f.startsWith("=")&&(f=f.slice(1)),var_first_char.includes(f[0])?(r.has_var=!0,e.push({type:state_integer_padding,value:f,real_value:get_real_value(r.fill_data,f)})):e.push({type:state_integer_padding,value:f})}else e.push({type:state_number,value:t})}function fmt_tokenizer_space(e,t){for(var r,n=0,i=e.length,a={fill_data:t,has_var:!1},o=0,u=[];n<i;)" "===(r=e[n])?(n>o&&push_token(u,e.slice(o,n),a),o=n+1):"<>=".includes(r)&&("="===e[n+1]?(u.push({type:state_symbol,value:r+"="}),o=1+ ++n):(u.push({type:state_symbol,value:r}),o=n+1)),n++;return o<n&&push_token(u,e.slice(o,n),a),u.has_var=a.has_var,u}function compute_lite(e,t,r){switch(r){case"+":return(BigNumber.isBigNumber(e)?e:new BigNumber(e)).plus(t);case"-":return(BigNumber.isBigNumber(e)?e:new BigNumber(e)).minus(t);case"*":return(BigNumber.isBigNumber(e)?e:new BigNumber(e)).times(t);case"/":return(BigNumber.isBigNumber(e)?e:new BigNumber(e)).div(t);case"%":return(BigNumber.isBigNumber(e)?e:new BigNumber(e)).mod(t);case"**":return(BigNumber.isBigNumber(e)?e:new BigNumber(e)).pow(t);case"//":return(BigNumber.isBigNumber(e)?e:new BigNumber(e)).idiv(t)}}var operator_map={"+":0,"-":0,"*":1,"/":1,"%":1,"//":1,"**":2};function eval_tokens_lite(e,t){for(var r,n,i=[],a=[],o=0,u=e.length;o<u;o++){var s=(r=e[o])[0];if(var_first_char.includes(s))a.push(get_real_value(t,r));else if(operator_set.has(r)){var c=i.at(-1);if("("===c){i.push(r);continue}var l=operator_map[r];if(!i.length){i.push(r);continue}var _=operator_map[c];if(l<_)for(var f=i.at(-1);f&&"("!==f;){i.pop();var p=a.pop(),h=a.pop();a.push(compute_lite(h,p,f)),f=i.at(-1)}else if(l===_){if("**"===r){i.push(r);continue}for(var v=i.at(-1);v&&!(operator_map[v]<l||"("===v);){i.pop();var m=a.pop(),d=a.pop();a.push(compute_lite(d,m,v)),v=i.at(-1)}}i.push(r)}else if(number_first_char.includes(s))a.push(r);else if("("!==r){if(")"===r)for(var g=void 0;(g=i.pop())&&"("!==g;){var b=a.pop(),y=a.pop();a.push(compute_lite(y,b,g))}}else i.push("(")}for(;n=i.pop();){var w=a.pop(),x=a.pop();a.push(compute_lite(x,w,n))}if(1!==a.length)throw new Error("可能出现了错误的计算式");return a[0]}function calc_lite(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"-";try{var i;if("number"==typeof e)i=e.toString();else{if(""===e)throw new Error("非法的空计算式");var a=e.split(" ");if(1===a.length){if(i=a[0],var_first_char.includes(i[0])&&(i=get_real_value(r,i)),isNaN(Number(i)))throw new Error("错误的计算式:".concat(e))}else i=eval_tokens_lite(a,r).toFixed()}if("string"==typeof t&&""!==t){var o=fmt_tokenizer(t,r);if(void 0!==o)i=_slicedToArray(format(i,o),1)[0]}if("NaN"===i||"Infinity"===i)throw new Error("计算环节出错");return i}catch(e){return n}}function calc_mini(e,t,r){switch(t){case"+":return BigNumber(e).plus(r).toFixed();case"-":return BigNumber(e).minus(r).toFixed();case"*":return BigNumber(e).times(r).toFixed();case"/":return BigNumber(e).div(r).toFixed();case"%":return BigNumber(e).mod(r).toFixed();case"**":return BigNumber(e).pow(r).toFixed();case"//":return BigNumber(e).idiv(r).toFixed()}}function calc_sum(e,t){var r={_error:"-"},n=e.split("|"),i=n[0];if(0===t.length)return calc(e,r);for(var a=0,o=0;o<t.length;o++){var u=calc(i,_objectSpread2(_objectSpread2({},r),t[o]));if((a=calc("sum + temp",_objectSpread2({sum:a,temp:u},r)))===r._error)return r._error}return fmt(a,{_fmt:2===n.length?n[1]:void 0})}function calc_core(e,t){var r=find_value(t,"_error");try{var n,i,a,o,u,s=parse_args(e,t),c=s._unit,l=s._mode,_={_empty_values:s._empty_values,_empty_check:s._empty_check},f="space"===l||"space-all"===l?tokenizer_space(s.expr,s.fill_data,c,_):tokenizer(s.expr,s.fill_data,c,_),p=eval_tokens(f),h=BigNumber.isBigNumber(p)?p:new BigNumber(p);if("space-all"===l?(o=""===s.fmt_expr||void 0===s.fmt_expr?void 0:fmt_tokenizer_space(s.fmt_expr,s.fill_data),u=""===s._fmt||void 0===s._fmt?void 0:fmt_tokenizer_space(s._fmt,s.fill_data)):(o=""===s.fmt_expr||void 0===s.fmt_expr?void 0:fmt_tokenizer(s.fmt_expr,s.fill_data),u=""===s._fmt||void 0===s._fmt?void 0:fmt_tokenizer(s._fmt,s.fill_data)),void 0===o?void 0!==u&&(o=u):void 0!==u&&(o=[].concat(_toConsumableArray(u),_toConsumableArray(o))),void 0===o)h=h.toFixed();else{var v=_slicedToArray(format(h,o,{_volume_units:s._volume_units,_volume_step:s._volume_step,_presets:s._presets,_unit_out:s._unit_out,_unit_from:s._unit_from,_unit_default_out:s._unit_default_out,_unit_position:s._unit_position}),2);h=v[0],a=v[1]}if("Infinity"===h||"NaN"===h||void 0===h)throw new Error("计算错误可能是非法的计算式");return!f.has_unit||null!==(n=a)&&void 0!==n&&n.to_number||null!==(i=a)&&void 0!==i&&i.to_number_string||(h+=f.unit),h}catch(e){if(void 0===r)throw e;return r}}function calc(e,t){if(null==t)return calc_core(e,{_error:"-"});if(Array.isArray(t)){if(!t.some((function(e){return e&&void 0!==e._error})))return calc_core(e,[].concat(_toConsumableArray(t),[{_error:"-"}]))}else if("object"===_typeof(t)&&void 0===t._error)return calc_core(e,_objectSpread2(_objectSpread2({},t),{},{_error:"-"}));return calc_core(e,t)}var fmt_core=calc_core,fmt=calc;function check_update(){check_version().catch((function(){}))}function print_version(){console.log("%ca-calc:%c ".concat(version," %c=> %curl:%c https://www.npmjs.com/package/a-calc"),"color: #fff;background: #67C23A;padding: 2px 5px;border-radius:4px;font-size: 14px;","color: #67C23A;font-size:14px;","color: #67C23A;font-size:14px;","background: #67C23A;font-size:14px; padding: 2px 5px; border-radius: 4px; color: #fff;","font-size:14px;")}var calc_util={check_update:check_update,print_version:print_version,open_debug:open_debug,close_debug:close_debug,close_important_push:close_important_push,open_important_push:open_important_push};function plus(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).plus(t).toNumber():new BigNumber(e).plus(t).toFixed()}function sub(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).minus(t).toNumber():new BigNumber(e).minus(t).toFixed()}function mul(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).times(t).toNumber():new BigNumber(e).times(t).toFixed()}function div(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).div(t).toNumber():new BigNumber(e).div(t).toFixed()}function mod(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).mod(t).toNumber():new BigNumber(e).mod(t).toFixed()}function pow(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).pow(t).toNumber():new BigNumber(e).pow(t).toFixed()}function idiv(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).idiv(t).toNumber():new BigNumber(e).idiv(t).toFixed()}return exports.calc=calc,exports.calc_core=calc_core,exports.calc_lite=calc_lite,exports.calc_mini=calc_mini,exports.calc_sum=calc_sum,exports.calc_util=calc_util,exports.calc_wrap=calc_wrap,exports.div=div,exports.fmt=fmt,exports.fmt_core=fmt_core,exports.idiv=idiv,exports.mod=mod,exports.mul=mul,exports.parse_thousands=parse_thousands,exports.plus=plus,exports.pow=pow,exports.sub=sub,exports.version=version,exports}({});
|