a-calc 3.0.0-beta.20250123.6 → 3.0.0-beta.20250123.9
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/browser/index.js +1 -1
- package/cjs/index.js +1 -1
- package/es/index.js +1 -1
- package/mcp-server/src/index.js +116 -209
- package/package.json +127 -127
package/browser/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var a_calc=function(exports){"use strict";var _documentCurrentScript="undefined"!=typeof document?document.currentScript:null;function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function asyncGeneratorStep(e,t,r,n,i,a,o){try{var s=e[a](o),_=s.value}catch(e){return void r(e)}s.done?t(_):Promise.resolve(_).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,s,"next",e)}function s(e){asyncGeneratorStep(a,n,i,o,s,"throw",e)}o(void 0)})}}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,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}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 _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}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,s=[],_=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;_=!1}else for(;!(_=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);_=!0);}catch(e){u=!0,i=e}finally{try{if(!_&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}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 _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 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 _regenerator(){
|
|
2
2
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
3
|
-
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(r,n,i,a){var _=n&&n.prototype instanceof s?n:s,u=Object.create(_.prototype);return _regeneratorDefine(u,"_invoke",function(r,n,i){var a,s,_,u=0,c=i||[],l=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return a=t,s=0,_=e,p.n=r,o}};function d(r,n){for(s=r,_=n,t=0;!l&&u&&!i&&t<c.length;t++){var i,a=c[t],d=p.p,f=a[2];r>3?(i=f===n)&&(_=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((i=r<2&&d<a[1])?(s=0,p.v=n,p.n=a[1]):d<f&&(i=r<3||a[0]>n||n>f)&&(a[4]=r,a[5]=n,p.n=f,s=0))}if(i||r>1)return o;throw l=!0,n}return function(i,c,f){if(u>1)throw TypeError("Generator is already running");for(l&&1===c&&d(c,f),s=c,_=f;(t=s<2?e:_)||!l;){a||(s?s<3?(s>1&&(p.n=-1),d(s,_)):p.n=_:p.v=_);try{if(u=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(_=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(l=p.n<0)?_:r.call(n,p))!==o)break}catch(t){a=e,s=1,_=t}finally{u=1}}return{value:t,done:l}}}(r,i,a),!0),u}var o={};function s(){}function _(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine(t={},n,function(){return this}),t),l=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,_regeneratorDefine(e,i,"GeneratorFunction")),e.prototype=Object.create(l),e}return _.prototype=u,_regeneratorDefine(l,"constructor",u),_regeneratorDefine(u,"constructor",_),_.displayName="GeneratorFunction",_regeneratorDefine(u,i,"GeneratorFunction"),_regeneratorDefine(l),_regeneratorDefine(l,i,"Generator"),_regeneratorDefine(l,n,function(){return this}),_regeneratorDefine(l,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:a,m:p}})()}function _regeneratorDefine(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine=function(e,t,r,n){function a(t,r){_regeneratorDefine(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},_regeneratorDefine(e,t,r,n)}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 _toPrimitive(e,t){if("object"!=typeof e||!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:t+""}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 _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.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}}var version="3.0.0-beta.20250123.6";function decimal_round(e,t,r,n,i){var a=e.startsWith("-"),o=a?e.slice(1):e,s=o,_=t,u=t.length;function c(){s=(+s+1).toString()}var l={"~-":function(){var e="<"===r?n-1:n;_=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)?_=i:(i=(+"9".concat(i)+1).toString().slice(1)).length>e?(_=i.slice(1,i.length),c()):_=i}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;_=t.slice(0,e);var i=+t[e];Number.isNaN(i)||i>=5&&(_=(+"9".concat(_)+1).toString().slice(1)).length>e&&(_=_.slice(1,_.length),c())}},"~6":function(){if(0!==u){var e,i="<"===r?n-1:n,a=+t[i],s=t.slice(+i+1,t.length);s=""===s?0:parseInt(s),e=0===i?+o[o.length-1]:+t[i-1],_=t.slice(0,i),(a>=6||5===a&&s>0||5===a&&e%2!=0)&&(_=(+"9".concat(_)+1).toString().slice(1)).length>i&&(_=_.slice(1,_.length),c())}}};return"<="===r?u<=n?_=t.replace(/0*$/,""):(l[i]&&l[i](),_=_.replace(/0+$/,"")):"<"===r?u<n?_=t.replace(/0*$/,""):(l[i]&&l[i](),_=_.replace(/0+$/,"")):"="===r?u<n?_=t+"0".repeat(n-u):u>n&&l[i]&&l[i]():">="===r?u<n&&(_=t+"0".repeat(n-u)):">"===r&&u<=n&&(_=t+"0".repeat(n-u+1)),{int_part:a?"-".concat(s):s,dec_part:_}}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",state_unit_hide="unit_hide",state_unit_default="unit_default",state_thousands="thousands",state_fmt_group="fmt_group",state_comparison="comparison",state_logical="logical",state_logical_not="logical_not",state_ternary_question="ternary_question",state_ternary_colon="ternary_colon",state_function="function",state_range_start="range_start",state_range_end="range_end",state_range_clamp="range_clamp",comparison_operators=new Set([">","<",">=","<=","==","!="]),logical_operators=new Set(["&&","||"]),operator_precedence={"|":0,"?":1,":":1,"||":2,"&&":3,"==":4,"!=":4,">":5,"<":5,">=":5,"<=":5,"+":6,"-":6,"*":7,"/":7,"%":7,"//":7,"**":8,"!":9,"unary-":9,"unary+":9},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$1=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||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(){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],s=decimal_round(a,o,t,+r,n);return a=s.int_part,""===(o=s.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(_regenerator().m(function e(t){var r,n,i,a=arguments;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 1:if(!(n<t.length)){e.n=7;break}return e.p=2,e.n=3,Promise.race([t[n],new Promise(function(e,t){setTimeout(function(){return t(new Error("promise queue timeout err"))},r)})]);case 3:i=e.v,e.n=5;break;case 4:return e.p=4,e.v,e.a(3,6);case 5:return e.a(2,i);case 6:n++,e.n=1;break;case 7:return e.a(2,Promise.reject("错误的 promise queue 调用"))}},e,null,[[2,4]])})),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regenerator().m(function e(t){var r;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=0;case 1:if(!(r<t.length)){e.n=7;break}return e.p=2,e.n=3,fetch(t[r]);case 3:if(!e.v.ok){e.n=4;break}return e.a(2,t[r]);case 4:e.n=6;break;case 5:return e.p=5,e.v,e.a(3,6);case 6:r++,e.n=1;break;case 7:return e.a(2,null)}},e,null,[[2,5]])}))).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 is_empty_for_fallback(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 s=get(e[o],i);if(void 0!==s){a=s;break}}else a=get(e,i)}catch(e){continue}if(!is_empty_for_fallback(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 split_expr_and_fmt(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){if(r+1<e.length&&"|"===e[r+1]){r++;continue}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,_fmt:void 0,_empty_values:void 0,_empty_check:void 0,_vol_units:void 0,_vol_step:void 0,_thousands:void 0};if(null!=t&&(n.options=t,Array.isArray(t)?n.fill_data=t:n.fill_data=[t]),n._fmt=find_value(t,"_fmt"),n._unit=find_value(t,"_unit",!1),n._empty_values=find_value(t,"_empty_values"),n._empty_check=find_value(t,"_empty_check"),n._vol_units=find_value(t,"_vol_units"),n._vol_step=find_value(t,"_vol_step"),n._thousands=find_value(t,"_thousands"),"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=split_expr_and_fmt(r),a=i.expr,o=i.fmt;return n.expr=a,n.fmt_expr=o,n}function detect_fallback_var$1(e,t){if("("!==e[t])return null;for(var r=0,n=!1,i=[],a="",o=t;o<e.length;){var s=e[o];if("("===s){if(0===r){r++,o++;continue}r++,a+=s}else if(")"===s){if(0===--r)return n?(i.push(a.trim()),{paths:i,end_index:o}):null;a+=s}else"|"===s&&1===r?(n=!0,i.push(a.trim()),a=""):a+=s;o++}return null}function detect_function_call(e,t,r){for(var n=t;n<e.length&&" "===e[n];)n++;return n<e.length&&"("===e[n]}function parse_function_args(e,t){if("("!==e[t])return null;for(var r=1,n=[],i="",a=t+1;a<e.length&&r>0;){var o=e[a];if("("===o)r++,i+=o;else if(")"===o){if(0===--r)return i.trim()&&n.push(i.trim()),{args:n,end_index:a};i+=o}else","===o&&1===r?(n.push(i.trim()),i=""):i+=o;a++}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("+"===r||"-"===r)return e.push({type:state_operator,value:r}),t.curr_state=state_initial,void(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 s=t.expr.slice(t.prev_index,t.cur_index);if("true"===s)e.push({type:"boolean",value:!0});else if("false"===s)e.push({type:"boolean",value:!1});else if(detect_function_call(t.expr,t.cur_index)){for(var _=t.cur_index;_<t.expr.length&&" "===t.expr[_];)_++;var u=parse_function_args(t.expr,_);if(u)return e.push({type:state_function,value:s,args:u.args}),t.cur_index=u.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}else{var c=get_real_value(t.fill_data,s);if("function"==typeof c){for(var l=t.cur_index;l<t.expr.length&&" "===t.expr[l];)l++;if(l<t.expr.length&&"("===t.expr[l]){var p=parse_function_args(t.expr,l);if(p)return e.push({type:state_function,value:s,args:p.args,fn:c}),t.cur_index=p.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}}if(t._unit){var d,f=split_unit_num(c),g=f.num,m=f.unit;if(void 0===m)e.push({type:"var",value:s,real_value:g,has_unit:!1});else t.has_unit=!0,null!==(d=t.unit_str)&&void 0!==d||(t.unit_str=m),e.push({type:"var",value:s,real_value:g,has_unit:!0,unit:m})}else e.push({type:"var",value:s,real_value:c,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,s=[];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.at(-1);0===a.cur_index||"operator"===(null==_?void 0:_.type)||"comparison"===(null==_?void 0:_.type)||"logical"===(null==_?void 0:_.type)||"logical_not"===(null==_?void 0:_.type)||"ternary_question"===(null==_?void 0:_.type)||"ternary_colon"===(null==_?void 0:_.type)||"("===(null==_?void 0:_.value)||"["===(null==_?void 0:_.value)||","===(null==_?void 0:_.value)?(a.curr_state=state_number,a.cur_index++):(a.cur_index++,s.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(">"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:">="})):s.push({type:state_comparison,value:">"}),a.prev_index=a.cur_index;else if("<"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:"<="})):s.push({type:state_comparison,value:"<"}),a.prev_index=a.cur_index;else if("="===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"=="}),a.prev_index=a.cur_index;else if("!"===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"!="}),a.prev_index=a.cur_index;else if("&"===i&&a.cur_index+1<o&&"&"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"&&"}),a.prev_index=a.cur_index;else if("|"===i&&a.cur_index+1<o&&"|"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"||"}),a.prev_index=a.cur_index;else if("!"===i)a.cur_index++,s.push({type:state_logical_not,value:"!"}),a.prev_index=a.cur_index;else if("?"===i)a.cur_index++,s.push({type:state_ternary_question,value:"?"}),a.prev_index=a.cur_index;else if(":"===i)a.cur_index++,s.push({type:state_ternary_colon,value:":"}),a.prev_index=a.cur_index;else if("["===i)a.cur_index++,s.push({type:state_range_start,value:"["}),a.prev_index=a.cur_index;else if("]"===i)a.cur_index++,s.push({type:state_range_end,value:"]"}),a.prev_index=a.cur_index;else if(","===i)a.cur_index++,s.push({type:"comma",value:","}),a.prev_index=a.cur_index;else if(var_char_set.has(i))a.curr_state=state_var,a.cur_index++;else if('"'===i||"'"===i){var u=i;a.cur_index++;for(var c="";a.cur_index<o&&e[a.cur_index]!==u;)"\\"===e[a.cur_index]&&a.cur_index+1<o?(a.cur_index++,c+=e[a.cur_index]):c+=e[a.cur_index],a.cur_index++;a.cur_index++,s.push({type:"string",value:c}),a.prev_index=a.cur_index}else if("("===i){var l=detect_fallback_var$1(e,a.cur_index);if(l){a.has_var=!0;var p=get_fallback_value(t,l.paths,n),d=p.value,f=p.path;if(r){var g,m=split_unit_num(d),v=m.num,h=m.unit;if(void 0!==h)a.has_unit=!0,null!==(g=a.unit_str)&&void 0!==g||(a.unit_str=h),s.push({type:state_fallback_var,value:l.paths,real_value:v,matched_path:f,has_unit:!0,unit:h});else s.push({type:state_fallback_var,value:l.paths,real_value:v,matched_path:f,has_unit:!1})}else s.push({type:state_fallback_var,value:l.paths,real_value:d,matched_path:f,has_unit:!1});a.cur_index=l.end_index+1,a.prev_index=a.cur_index}else s.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index}else")"===i?(s.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||"<"===i||"="===i||"!"===i||"&"===i||"|"===i||"?"===i||":"===i||"["===i||"]"===i||","===i||"%"===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(s,a):a.cur_index++:push_token$3(s,a);break;case state_operator:var w=e[a.cur_index-1];"*"===i&&"*"===w?(a.cur_index++,s.push({type:state_operator,value:"**"}),a.prev_index=a.cur_index):"/"===i&&"/"===w?(a.cur_index++,s.push({type:state_operator,value:"//"}),a.prev_index=a.cur_index):(s.push({type:state_operator,value:w}),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(s,a);break;case state_scientific:if(number_char_set.has(i))a.cur_index++;else if("+-".includes(i)){var b=a.prev_index;"+-".includes(e[b])&&(b+=1);var y=e.slice(b,a.cur_index),x=y.at(-1);y.includes(i)||"e"!==x?push_token$3(s,a):a.cur_index++}else r&&-1==="*/+-() ".indexOf(i)&&">"!==i&&"<"!==i&&"="!==i&&"!"!==i&&"&"!==i&&"|"!==i&&"?"!==i&&":"!==i&&"["!==i&&"]"!==i&&","!==i?a.cur_index++:push_token$3(s,a);break;default:throw new Error("字符扫描状态错误")}return a.prev_index<a.cur_index&&push_token$3(s,a),s.has_var=a.has_var,s.has_unit=a.has_unit,s.unit=a.unit_str,s}
|
|
3
|
+
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(r,n,i,a){var _=n&&n.prototype instanceof s?n:s,u=Object.create(_.prototype);return _regeneratorDefine(u,"_invoke",function(r,n,i){var a,s,_,u=0,c=i||[],l=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return a=t,s=0,_=e,p.n=r,o}};function d(r,n){for(s=r,_=n,t=0;!l&&u&&!i&&t<c.length;t++){var i,a=c[t],d=p.p,f=a[2];r>3?(i=f===n)&&(_=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((i=r<2&&d<a[1])?(s=0,p.v=n,p.n=a[1]):d<f&&(i=r<3||a[0]>n||n>f)&&(a[4]=r,a[5]=n,p.n=f,s=0))}if(i||r>1)return o;throw l=!0,n}return function(i,c,f){if(u>1)throw TypeError("Generator is already running");for(l&&1===c&&d(c,f),s=c,_=f;(t=s<2?e:_)||!l;){a||(s?s<3?(s>1&&(p.n=-1),d(s,_)):p.n=_:p.v=_);try{if(u=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(_=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(l=p.n<0)?_:r.call(n,p))!==o)break}catch(t){a=e,s=1,_=t}finally{u=1}}return{value:t,done:l}}}(r,i,a),!0),u}var o={};function s(){}function _(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine(t={},n,function(){return this}),t),l=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,_regeneratorDefine(e,i,"GeneratorFunction")),e.prototype=Object.create(l),e}return _.prototype=u,_regeneratorDefine(l,"constructor",u),_regeneratorDefine(u,"constructor",_),_.displayName="GeneratorFunction",_regeneratorDefine(u,i,"GeneratorFunction"),_regeneratorDefine(l),_regeneratorDefine(l,i,"Generator"),_regeneratorDefine(l,n,function(){return this}),_regeneratorDefine(l,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:a,m:p}})()}function _regeneratorDefine(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine=function(e,t,r,n){function a(t,r){_regeneratorDefine(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},_regeneratorDefine(e,t,r,n)}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 _toPrimitive(e,t){if("object"!=typeof e||!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:t+""}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 _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.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}}var version="3.0.0-beta.20250123.8";function decimal_round(e,t,r,n,i){var a=e.startsWith("-"),o=a?e.slice(1):e,s=o,_=t,u=t.length;function c(){s=(+s+1).toString()}var l={"~-":function(){var e="<"===r?n-1:n;_=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)?_=i:(i=(+"9".concat(i)+1).toString().slice(1)).length>e?(_=i.slice(1,i.length),c()):_=i}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;_=t.slice(0,e);var i=+t[e];Number.isNaN(i)||i>=5&&(_=(+"9".concat(_)+1).toString().slice(1)).length>e&&(_=_.slice(1,_.length),c())}},"~6":function(){if(0!==u){var e,i="<"===r?n-1:n,a=+t[i],s=t.slice(+i+1,t.length);s=""===s?0:parseInt(s),e=0===i?+o[o.length-1]:+t[i-1],_=t.slice(0,i),(a>=6||5===a&&s>0||5===a&&e%2!=0)&&(_=(+"9".concat(_)+1).toString().slice(1)).length>i&&(_=_.slice(1,_.length),c())}}};return"<="===r?u<=n?_=t.replace(/0*$/,""):(l[i]&&l[i](),_=_.replace(/0+$/,"")):"<"===r?u<n?_=t.replace(/0*$/,""):(l[i]&&l[i](),_=_.replace(/0+$/,"")):"="===r?u<n?_=t+"0".repeat(n-u):u>n&&l[i]&&l[i]():">="===r?u<n&&(_=t+"0".repeat(n-u)):">"===r&&u<=n&&(_=t+"0".repeat(n-u+1)),{int_part:a?"-".concat(s):s,dec_part:_}}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",state_unit_hide="unit_hide",state_unit_default="unit_default",state_thousands="thousands",state_fmt_group="fmt_group",state_comparison="comparison",state_logical="logical",state_logical_not="logical_not",state_ternary_question="ternary_question",state_ternary_colon="ternary_colon",state_function="function",state_range_start="range_start",state_range_end="range_end",state_range_clamp="range_clamp",comparison_operators=new Set([">","<",">=","<=","==","!="]),logical_operators=new Set(["&&","||"]),operator_precedence={"|":0,"?":1,":":1,"||":2,"&&":3,"==":4,"!=":4,">":5,"<":5,">=":5,"<=":5,"+":6,"-":6,"*":7,"/":7,"%":7,"//":7,"**":8,"!":9,"unary-":9,"unary+":9},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$1=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||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(){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],s=decimal_round(a,o,t,+r,n);return a=s.int_part,""===(o=s.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(_regenerator().m(function e(t){var r,n,i,a=arguments;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 1:if(!(n<t.length)){e.n=7;break}return e.p=2,e.n=3,Promise.race([t[n],new Promise(function(e,t){setTimeout(function(){return t(new Error("promise queue timeout err"))},r)})]);case 3:i=e.v,e.n=5;break;case 4:return e.p=4,e.v,e.a(3,6);case 5:return e.a(2,i);case 6:n++,e.n=1;break;case 7:return e.a(2,Promise.reject("错误的 promise queue 调用"))}},e,null,[[2,4]])})),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regenerator().m(function e(t){var r;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=0;case 1:if(!(r<t.length)){e.n=7;break}return e.p=2,e.n=3,fetch(t[r]);case 3:if(!e.v.ok){e.n=4;break}return e.a(2,t[r]);case 4:e.n=6;break;case 5:return e.p=5,e.v,e.a(3,6);case 6:r++,e.n=1;break;case 7:return e.a(2,null)}},e,null,[[2,5]])}))).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 is_empty_for_fallback(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 s=get(e[o],i);if(void 0!==s){a=s;break}}else a=get(e,i)}catch(e){continue}if(!is_empty_for_fallback(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 split_expr_and_fmt(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){if(r+1<e.length&&"|"===e[r+1]){r++;continue}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,_fmt:void 0,_empty_values:void 0,_empty_check:void 0,_vol_units:void 0,_vol_step:void 0,_thousands:void 0};if(null!=t&&(n.options=t,Array.isArray(t)?n.fill_data=t:n.fill_data=[t]),n._fmt=find_value(t,"_fmt"),n._unit=find_value(t,"_unit",!1),n._empty_values=find_value(t,"_empty_values"),n._empty_check=find_value(t,"_empty_check"),n._vol_units=find_value(t,"_vol_units"),n._vol_step=find_value(t,"_vol_step"),n._thousands=find_value(t,"_thousands"),"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=split_expr_and_fmt(r),a=i.expr,o=i.fmt;return n.expr=a,n.fmt_expr=o,n}function detect_fallback_var$1(e,t){if("("!==e[t])return null;for(var r=0,n=!1,i=[],a="",o=t;o<e.length;){var s=e[o];if("("===s){if(0===r){r++,o++;continue}r++,a+=s}else if(")"===s){if(0===--r)return n?(i.push(a.trim()),{paths:i,end_index:o}):null;a+=s}else"|"===s&&1===r?(n=!0,i.push(a.trim()),a=""):a+=s;o++}return null}function detect_function_call(e,t,r){for(var n=t;n<e.length&&" "===e[n];)n++;return n<e.length&&"("===e[n]}function parse_function_args(e,t){if("("!==e[t])return null;for(var r=1,n=[],i="",a=t+1;a<e.length&&r>0;){var o=e[a];if("("===o)r++,i+=o;else if(")"===o){if(0===--r)return i.trim()&&n.push(i.trim()),{args:n,end_index:a};i+=o}else","===o&&1===r?(n.push(i.trim()),i=""):i+=o;a++}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("+"===r||"-"===r)return e.push({type:state_operator,value:r}),t.curr_state=state_initial,void(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 s=t.expr.slice(t.prev_index,t.cur_index);if("true"===s)e.push({type:"boolean",value:!0});else if("false"===s)e.push({type:"boolean",value:!1});else if(detect_function_call(t.expr,t.cur_index)){for(var _=t.cur_index;_<t.expr.length&&" "===t.expr[_];)_++;var u=parse_function_args(t.expr,_);if(u)return e.push({type:state_function,value:s,args:u.args}),t.cur_index=u.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}else{var c=get_real_value(t.fill_data,s);if("function"==typeof c){for(var l=t.cur_index;l<t.expr.length&&" "===t.expr[l];)l++;if(l<t.expr.length&&"("===t.expr[l]){var p=parse_function_args(t.expr,l);if(p)return e.push({type:state_function,value:s,args:p.args,fn:c}),t.cur_index=p.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}}if(t._unit){var d,f=split_unit_num(c),g=f.num,m=f.unit;if(void 0===m)e.push({type:"var",value:s,real_value:g,has_unit:!1});else t.has_unit=!0,null!==(d=t.unit_str)&&void 0!==d||(t.unit_str=m),e.push({type:"var",value:s,real_value:g,has_unit:!0,unit:m})}else e.push({type:"var",value:s,real_value:c,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,s=[];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.at(-1);0===a.cur_index||"operator"===(null==_?void 0:_.type)||"comparison"===(null==_?void 0:_.type)||"logical"===(null==_?void 0:_.type)||"logical_not"===(null==_?void 0:_.type)||"ternary_question"===(null==_?void 0:_.type)||"ternary_colon"===(null==_?void 0:_.type)||"("===(null==_?void 0:_.value)||"["===(null==_?void 0:_.value)||","===(null==_?void 0:_.value)?(a.curr_state=state_number,a.cur_index++):(a.cur_index++,s.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(">"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:">="})):s.push({type:state_comparison,value:">"}),a.prev_index=a.cur_index;else if("<"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:"<="})):s.push({type:state_comparison,value:"<"}),a.prev_index=a.cur_index;else if("="===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"=="}),a.prev_index=a.cur_index;else if("!"===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"!="}),a.prev_index=a.cur_index;else if("&"===i&&a.cur_index+1<o&&"&"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"&&"}),a.prev_index=a.cur_index;else if("|"===i&&a.cur_index+1<o&&"|"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"||"}),a.prev_index=a.cur_index;else if("!"===i)a.cur_index++,s.push({type:state_logical_not,value:"!"}),a.prev_index=a.cur_index;else if("?"===i)a.cur_index++,s.push({type:state_ternary_question,value:"?"}),a.prev_index=a.cur_index;else if(":"===i)a.cur_index++,s.push({type:state_ternary_colon,value:":"}),a.prev_index=a.cur_index;else if("["===i)a.cur_index++,s.push({type:state_range_start,value:"["}),a.prev_index=a.cur_index;else if("]"===i)a.cur_index++,s.push({type:state_range_end,value:"]"}),a.prev_index=a.cur_index;else if(","===i)a.cur_index++,s.push({type:"comma",value:","}),a.prev_index=a.cur_index;else if(var_char_set.has(i))a.curr_state=state_var,a.cur_index++;else if('"'===i||"'"===i){var u=i;a.cur_index++;for(var c="";a.cur_index<o&&e[a.cur_index]!==u;)"\\"===e[a.cur_index]&&a.cur_index+1<o?(a.cur_index++,c+=e[a.cur_index]):c+=e[a.cur_index],a.cur_index++;a.cur_index++,s.push({type:"string",value:c}),a.prev_index=a.cur_index}else if("("===i){var l=detect_fallback_var$1(e,a.cur_index);if(l){a.has_var=!0;var p=get_fallback_value(t,l.paths,n),d=p.value,f=p.path;if(r){var g,m=split_unit_num(d),v=m.num,h=m.unit;if(void 0!==h)a.has_unit=!0,null!==(g=a.unit_str)&&void 0!==g||(a.unit_str=h),s.push({type:state_fallback_var,value:l.paths,real_value:v,matched_path:f,has_unit:!0,unit:h});else s.push({type:state_fallback_var,value:l.paths,real_value:v,matched_path:f,has_unit:!1})}else s.push({type:state_fallback_var,value:l.paths,real_value:d,matched_path:f,has_unit:!1});a.cur_index=l.end_index+1,a.prev_index=a.cur_index}else s.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index}else")"===i?(s.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||"<"===i||"="===i||"!"===i||"&"===i||"|"===i||"?"===i||":"===i||"["===i||"]"===i||","===i||"%"===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(s,a):a.cur_index++:push_token$3(s,a);break;case state_operator:var w=e[a.cur_index-1];"*"===i&&"*"===w?(a.cur_index++,s.push({type:state_operator,value:"**"}),a.prev_index=a.cur_index):"/"===i&&"/"===w?(a.cur_index++,s.push({type:state_operator,value:"//"}),a.prev_index=a.cur_index):(s.push({type:state_operator,value:w}),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(s,a);break;case state_scientific:if(number_char_set.has(i))a.cur_index++;else if("+-".includes(i)){var b=a.prev_index;"+-".includes(e[b])&&(b+=1);var y=e.slice(b,a.cur_index),x=y.at(-1);y.includes(i)||"e"!==x?push_token$3(s,a):a.cur_index++}else r&&-1==="*/+-() ".indexOf(i)&&">"!==i&&"<"!==i&&"="!==i&&"!"!==i&&"&"!==i&&"|"!==i&&"?"!==i&&":"!==i&&"["!==i&&"]"!==i&&","!==i?a.cur_index++:push_token$3(s,a);break;default:throw new Error("字符扫描状态错误")}return a.prev_index<a.cur_index&&push_token$3(s,a),s.has_var=a.has_var,s.has_unit=a.has_unit,s.unit=a.unit_str,s}
|
|
4
4
|
/*!
|
|
5
5
|
* decimal.js v10.6.0
|
|
6
6
|
* An arbitrary-precision Decimal type for JavaScript.
|
package/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";var _documentCurrentScript="undefined"!=typeof document?document.currentScript:null;function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function asyncGeneratorStep(e,t,r,n,i,a,o){try{var s=e[a](o),_=s.value}catch(e){return void r(e)}s.done?t(_):Promise.resolve(_).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,s,"next",e)}function s(e){asyncGeneratorStep(a,n,i,o,s,"throw",e)}o(void 0)})}}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,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}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 _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}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,s=[],_=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;_=!1}else for(;!(_=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);_=!0);}catch(e){u=!0,i=e}finally{try{if(!_&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}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 _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 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 _regenerator(){
|
|
2
2
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
3
|
-
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(r,n,i,a){var _=n&&n.prototype instanceof s?n:s,u=Object.create(_.prototype);return _regeneratorDefine(u,"_invoke",function(r,n,i){var a,s,_,u=0,c=i||[],l=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return a=t,s=0,_=e,p.n=r,o}};function d(r,n){for(s=r,_=n,t=0;!l&&u&&!i&&t<c.length;t++){var i,a=c[t],d=p.p,f=a[2];r>3?(i=f===n)&&(_=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((i=r<2&&d<a[1])?(s=0,p.v=n,p.n=a[1]):d<f&&(i=r<3||a[0]>n||n>f)&&(a[4]=r,a[5]=n,p.n=f,s=0))}if(i||r>1)return o;throw l=!0,n}return function(i,c,f){if(u>1)throw TypeError("Generator is already running");for(l&&1===c&&d(c,f),s=c,_=f;(t=s<2?e:_)||!l;){a||(s?s<3?(s>1&&(p.n=-1),d(s,_)):p.n=_:p.v=_);try{if(u=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(_=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(l=p.n<0)?_:r.call(n,p))!==o)break}catch(t){a=e,s=1,_=t}finally{u=1}}return{value:t,done:l}}}(r,i,a),!0),u}var o={};function s(){}function _(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine(t={},n,function(){return this}),t),l=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,_regeneratorDefine(e,i,"GeneratorFunction")),e.prototype=Object.create(l),e}return _.prototype=u,_regeneratorDefine(l,"constructor",u),_regeneratorDefine(u,"constructor",_),_.displayName="GeneratorFunction",_regeneratorDefine(u,i,"GeneratorFunction"),_regeneratorDefine(l),_regeneratorDefine(l,i,"Generator"),_regeneratorDefine(l,n,function(){return this}),_regeneratorDefine(l,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:a,m:p}})()}function _regeneratorDefine(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine=function(e,t,r,n){function a(t,r){_regeneratorDefine(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},_regeneratorDefine(e,t,r,n)}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 _toPrimitive(e,t){if("object"!=typeof e||!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:t+""}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 _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.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}}var version="3.0.0-beta.20250123.6";function decimal_round(e,t,r,n,i){var a=e.startsWith("-"),o=a?e.slice(1):e,s=o,_=t,u=t.length;function c(){s=(+s+1).toString()}var l={"~-":function(){var e="<"===r?n-1:n;_=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)?_=i:(i=(+"9".concat(i)+1).toString().slice(1)).length>e?(_=i.slice(1,i.length),c()):_=i}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;_=t.slice(0,e);var i=+t[e];Number.isNaN(i)||i>=5&&(_=(+"9".concat(_)+1).toString().slice(1)).length>e&&(_=_.slice(1,_.length),c())}},"~6":function(){if(0!==u){var e,i="<"===r?n-1:n,a=+t[i],s=t.slice(+i+1,t.length);s=""===s?0:parseInt(s),e=0===i?+o[o.length-1]:+t[i-1],_=t.slice(0,i),(a>=6||5===a&&s>0||5===a&&e%2!=0)&&(_=(+"9".concat(_)+1).toString().slice(1)).length>i&&(_=_.slice(1,_.length),c())}}};return"<="===r?u<=n?_=t.replace(/0*$/,""):(l[i]&&l[i](),_=_.replace(/0+$/,"")):"<"===r?u<n?_=t.replace(/0*$/,""):(l[i]&&l[i](),_=_.replace(/0+$/,"")):"="===r?u<n?_=t+"0".repeat(n-u):u>n&&l[i]&&l[i]():">="===r?u<n&&(_=t+"0".repeat(n-u)):">"===r&&u<=n&&(_=t+"0".repeat(n-u+1)),{int_part:a?"-".concat(s):s,dec_part:_}}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",state_unit_hide="unit_hide",state_unit_default="unit_default",state_thousands="thousands",state_fmt_group="fmt_group",state_comparison="comparison",state_logical="logical",state_logical_not="logical_not",state_ternary_question="ternary_question",state_ternary_colon="ternary_colon",state_function="function",state_range_start="range_start",state_range_end="range_end",state_range_clamp="range_clamp",comparison_operators=new Set([">","<",">=","<=","==","!="]),logical_operators=new Set(["&&","||"]),operator_precedence={"|":0,"?":1,":":1,"||":2,"&&":3,"==":4,"!=":4,">":5,"<":5,">=":5,"<=":5,"+":6,"-":6,"*":7,"/":7,"%":7,"//":7,"**":8,"!":9,"unary-":9,"unary+":9},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$1=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||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(){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],s=decimal_round(a,o,t,+r,n);return a=s.int_part,""===(o=s.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(_regenerator().m(function e(t){var r,n,i,a=arguments;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 1:if(!(n<t.length)){e.n=7;break}return e.p=2,e.n=3,Promise.race([t[n],new Promise(function(e,t){setTimeout(function(){return t(new Error("promise queue timeout err"))},r)})]);case 3:i=e.v,e.n=5;break;case 4:return e.p=4,e.v,e.a(3,6);case 5:return e.a(2,i);case 6:n++,e.n=1;break;case 7:return e.a(2,Promise.reject("错误的 promise queue 调用"))}},e,null,[[2,4]])})),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regenerator().m(function e(t){var r;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=0;case 1:if(!(r<t.length)){e.n=7;break}return e.p=2,e.n=3,fetch(t[r]);case 3:if(!e.v.ok){e.n=4;break}return e.a(2,t[r]);case 4:e.n=6;break;case 5:return e.p=5,e.v,e.a(3,6);case 6:r++,e.n=1;break;case 7:return e.a(2,null)}},e,null,[[2,5]])}))).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 is_empty_for_fallback(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 s=get(e[o],i);if(void 0!==s){a=s;break}}else a=get(e,i)}catch(e){continue}if(!is_empty_for_fallback(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 split_expr_and_fmt(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){if(r+1<e.length&&"|"===e[r+1]){r++;continue}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,_fmt:void 0,_empty_values:void 0,_empty_check:void 0,_vol_units:void 0,_vol_step:void 0,_thousands:void 0};if(null!=t&&(n.options=t,Array.isArray(t)?n.fill_data=t:n.fill_data=[t]),n._fmt=find_value(t,"_fmt"),n._unit=find_value(t,"_unit",!1),n._empty_values=find_value(t,"_empty_values"),n._empty_check=find_value(t,"_empty_check"),n._vol_units=find_value(t,"_vol_units"),n._vol_step=find_value(t,"_vol_step"),n._thousands=find_value(t,"_thousands"),"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=split_expr_and_fmt(r),a=i.expr,o=i.fmt;return n.expr=a,n.fmt_expr=o,n}function detect_fallback_var$1(e,t){if("("!==e[t])return null;for(var r=0,n=!1,i=[],a="",o=t;o<e.length;){var s=e[o];if("("===s){if(0===r){r++,o++;continue}r++,a+=s}else if(")"===s){if(0===--r)return n?(i.push(a.trim()),{paths:i,end_index:o}):null;a+=s}else"|"===s&&1===r?(n=!0,i.push(a.trim()),a=""):a+=s;o++}return null}function detect_function_call(e,t,r){for(var n=t;n<e.length&&" "===e[n];)n++;return n<e.length&&"("===e[n]}function parse_function_args(e,t){if("("!==e[t])return null;for(var r=1,n=[],i="",a=t+1;a<e.length&&r>0;){var o=e[a];if("("===o)r++,i+=o;else if(")"===o){if(0===--r)return i.trim()&&n.push(i.trim()),{args:n,end_index:a};i+=o}else","===o&&1===r?(n.push(i.trim()),i=""):i+=o;a++}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("+"===r||"-"===r)return e.push({type:state_operator,value:r}),t.curr_state=state_initial,void(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 s=t.expr.slice(t.prev_index,t.cur_index);if("true"===s)e.push({type:"boolean",value:!0});else if("false"===s)e.push({type:"boolean",value:!1});else if(detect_function_call(t.expr,t.cur_index)){for(var _=t.cur_index;_<t.expr.length&&" "===t.expr[_];)_++;var u=parse_function_args(t.expr,_);if(u)return e.push({type:state_function,value:s,args:u.args}),t.cur_index=u.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}else{var c=get_real_value(t.fill_data,s);if("function"==typeof c){for(var l=t.cur_index;l<t.expr.length&&" "===t.expr[l];)l++;if(l<t.expr.length&&"("===t.expr[l]){var p=parse_function_args(t.expr,l);if(p)return e.push({type:state_function,value:s,args:p.args,fn:c}),t.cur_index=p.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}}if(t._unit){var d,f=split_unit_num(c),g=f.num,m=f.unit;if(void 0===m)e.push({type:"var",value:s,real_value:g,has_unit:!1});else t.has_unit=!0,null!==(d=t.unit_str)&&void 0!==d||(t.unit_str=m),e.push({type:"var",value:s,real_value:g,has_unit:!0,unit:m})}else e.push({type:"var",value:s,real_value:c,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,s=[];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.at(-1);0===a.cur_index||"operator"===(null==_?void 0:_.type)||"comparison"===(null==_?void 0:_.type)||"logical"===(null==_?void 0:_.type)||"logical_not"===(null==_?void 0:_.type)||"ternary_question"===(null==_?void 0:_.type)||"ternary_colon"===(null==_?void 0:_.type)||"("===(null==_?void 0:_.value)||"["===(null==_?void 0:_.value)||","===(null==_?void 0:_.value)?(a.curr_state=state_number,a.cur_index++):(a.cur_index++,s.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(">"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:">="})):s.push({type:state_comparison,value:">"}),a.prev_index=a.cur_index;else if("<"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:"<="})):s.push({type:state_comparison,value:"<"}),a.prev_index=a.cur_index;else if("="===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"=="}),a.prev_index=a.cur_index;else if("!"===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"!="}),a.prev_index=a.cur_index;else if("&"===i&&a.cur_index+1<o&&"&"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"&&"}),a.prev_index=a.cur_index;else if("|"===i&&a.cur_index+1<o&&"|"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"||"}),a.prev_index=a.cur_index;else if("!"===i)a.cur_index++,s.push({type:state_logical_not,value:"!"}),a.prev_index=a.cur_index;else if("?"===i)a.cur_index++,s.push({type:state_ternary_question,value:"?"}),a.prev_index=a.cur_index;else if(":"===i)a.cur_index++,s.push({type:state_ternary_colon,value:":"}),a.prev_index=a.cur_index;else if("["===i)a.cur_index++,s.push({type:state_range_start,value:"["}),a.prev_index=a.cur_index;else if("]"===i)a.cur_index++,s.push({type:state_range_end,value:"]"}),a.prev_index=a.cur_index;else if(","===i)a.cur_index++,s.push({type:"comma",value:","}),a.prev_index=a.cur_index;else if(var_char_set.has(i))a.curr_state=state_var,a.cur_index++;else if('"'===i||"'"===i){var u=i;a.cur_index++;for(var c="";a.cur_index<o&&e[a.cur_index]!==u;)"\\"===e[a.cur_index]&&a.cur_index+1<o?(a.cur_index++,c+=e[a.cur_index]):c+=e[a.cur_index],a.cur_index++;a.cur_index++,s.push({type:"string",value:c}),a.prev_index=a.cur_index}else if("("===i){var l=detect_fallback_var$1(e,a.cur_index);if(l){a.has_var=!0;var p=get_fallback_value(t,l.paths,n),d=p.value,f=p.path;if(r){var g,m=split_unit_num(d),v=m.num,h=m.unit;if(void 0!==h)a.has_unit=!0,null!==(g=a.unit_str)&&void 0!==g||(a.unit_str=h),s.push({type:state_fallback_var,value:l.paths,real_value:v,matched_path:f,has_unit:!0,unit:h});else s.push({type:state_fallback_var,value:l.paths,real_value:v,matched_path:f,has_unit:!1})}else s.push({type:state_fallback_var,value:l.paths,real_value:d,matched_path:f,has_unit:!1});a.cur_index=l.end_index+1,a.prev_index=a.cur_index}else s.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index}else")"===i?(s.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||"<"===i||"="===i||"!"===i||"&"===i||"|"===i||"?"===i||":"===i||"["===i||"]"===i||","===i||"%"===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(s,a):a.cur_index++:push_token$3(s,a);break;case state_operator:var w=e[a.cur_index-1];"*"===i&&"*"===w?(a.cur_index++,s.push({type:state_operator,value:"**"}),a.prev_index=a.cur_index):"/"===i&&"/"===w?(a.cur_index++,s.push({type:state_operator,value:"//"}),a.prev_index=a.cur_index):(s.push({type:state_operator,value:w}),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(s,a);break;case state_scientific:if(number_char_set.has(i))a.cur_index++;else if("+-".includes(i)){var b=a.prev_index;"+-".includes(e[b])&&(b+=1);var y=e.slice(b,a.cur_index),x=y.at(-1);y.includes(i)||"e"!==x?push_token$3(s,a):a.cur_index++}else r&&-1==="*/+-() ".indexOf(i)&&">"!==i&&"<"!==i&&"="!==i&&"!"!==i&&"&"!==i&&"|"!==i&&"?"!==i&&":"!==i&&"["!==i&&"]"!==i&&","!==i?a.cur_index++:push_token$3(s,a);break;default:throw new Error("字符扫描状态错误")}return a.prev_index<a.cur_index&&push_token$3(s,a),s.has_var=a.has_var,s.has_unit=a.has_unit,s.unit=a.unit_str,s}
|
|
3
|
+
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(r,n,i,a){var _=n&&n.prototype instanceof s?n:s,u=Object.create(_.prototype);return _regeneratorDefine(u,"_invoke",function(r,n,i){var a,s,_,u=0,c=i||[],l=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return a=t,s=0,_=e,p.n=r,o}};function d(r,n){for(s=r,_=n,t=0;!l&&u&&!i&&t<c.length;t++){var i,a=c[t],d=p.p,f=a[2];r>3?(i=f===n)&&(_=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((i=r<2&&d<a[1])?(s=0,p.v=n,p.n=a[1]):d<f&&(i=r<3||a[0]>n||n>f)&&(a[4]=r,a[5]=n,p.n=f,s=0))}if(i||r>1)return o;throw l=!0,n}return function(i,c,f){if(u>1)throw TypeError("Generator is already running");for(l&&1===c&&d(c,f),s=c,_=f;(t=s<2?e:_)||!l;){a||(s?s<3?(s>1&&(p.n=-1),d(s,_)):p.n=_:p.v=_);try{if(u=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(_=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(l=p.n<0)?_:r.call(n,p))!==o)break}catch(t){a=e,s=1,_=t}finally{u=1}}return{value:t,done:l}}}(r,i,a),!0),u}var o={};function s(){}function _(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine(t={},n,function(){return this}),t),l=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,_regeneratorDefine(e,i,"GeneratorFunction")),e.prototype=Object.create(l),e}return _.prototype=u,_regeneratorDefine(l,"constructor",u),_regeneratorDefine(u,"constructor",_),_.displayName="GeneratorFunction",_regeneratorDefine(u,i,"GeneratorFunction"),_regeneratorDefine(l),_regeneratorDefine(l,i,"Generator"),_regeneratorDefine(l,n,function(){return this}),_regeneratorDefine(l,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:a,m:p}})()}function _regeneratorDefine(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine=function(e,t,r,n){function a(t,r){_regeneratorDefine(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},_regeneratorDefine(e,t,r,n)}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 _toPrimitive(e,t){if("object"!=typeof e||!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:t+""}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 _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.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}}var version="3.0.0-beta.20250123.8";function decimal_round(e,t,r,n,i){var a=e.startsWith("-"),o=a?e.slice(1):e,s=o,_=t,u=t.length;function c(){s=(+s+1).toString()}var l={"~-":function(){var e="<"===r?n-1:n;_=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)?_=i:(i=(+"9".concat(i)+1).toString().slice(1)).length>e?(_=i.slice(1,i.length),c()):_=i}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;_=t.slice(0,e);var i=+t[e];Number.isNaN(i)||i>=5&&(_=(+"9".concat(_)+1).toString().slice(1)).length>e&&(_=_.slice(1,_.length),c())}},"~6":function(){if(0!==u){var e,i="<"===r?n-1:n,a=+t[i],s=t.slice(+i+1,t.length);s=""===s?0:parseInt(s),e=0===i?+o[o.length-1]:+t[i-1],_=t.slice(0,i),(a>=6||5===a&&s>0||5===a&&e%2!=0)&&(_=(+"9".concat(_)+1).toString().slice(1)).length>i&&(_=_.slice(1,_.length),c())}}};return"<="===r?u<=n?_=t.replace(/0*$/,""):(l[i]&&l[i](),_=_.replace(/0+$/,"")):"<"===r?u<n?_=t.replace(/0*$/,""):(l[i]&&l[i](),_=_.replace(/0+$/,"")):"="===r?u<n?_=t+"0".repeat(n-u):u>n&&l[i]&&l[i]():">="===r?u<n&&(_=t+"0".repeat(n-u)):">"===r&&u<=n&&(_=t+"0".repeat(n-u+1)),{int_part:a?"-".concat(s):s,dec_part:_}}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",state_unit_hide="unit_hide",state_unit_default="unit_default",state_thousands="thousands",state_fmt_group="fmt_group",state_comparison="comparison",state_logical="logical",state_logical_not="logical_not",state_ternary_question="ternary_question",state_ternary_colon="ternary_colon",state_function="function",state_range_start="range_start",state_range_end="range_end",state_range_clamp="range_clamp",comparison_operators=new Set([">","<",">=","<=","==","!="]),logical_operators=new Set(["&&","||"]),operator_precedence={"|":0,"?":1,":":1,"||":2,"&&":3,"==":4,"!=":4,">":5,"<":5,">=":5,"<=":5,"+":6,"-":6,"*":7,"/":7,"%":7,"//":7,"**":8,"!":9,"unary-":9,"unary+":9},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$1=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||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(){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],s=decimal_round(a,o,t,+r,n);return a=s.int_part,""===(o=s.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(_regenerator().m(function e(t){var r,n,i,a=arguments;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 1:if(!(n<t.length)){e.n=7;break}return e.p=2,e.n=3,Promise.race([t[n],new Promise(function(e,t){setTimeout(function(){return t(new Error("promise queue timeout err"))},r)})]);case 3:i=e.v,e.n=5;break;case 4:return e.p=4,e.v,e.a(3,6);case 5:return e.a(2,i);case 6:n++,e.n=1;break;case 7:return e.a(2,Promise.reject("错误的 promise queue 调用"))}},e,null,[[2,4]])})),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regenerator().m(function e(t){var r;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=0;case 1:if(!(r<t.length)){e.n=7;break}return e.p=2,e.n=3,fetch(t[r]);case 3:if(!e.v.ok){e.n=4;break}return e.a(2,t[r]);case 4:e.n=6;break;case 5:return e.p=5,e.v,e.a(3,6);case 6:r++,e.n=1;break;case 7:return e.a(2,null)}},e,null,[[2,5]])}))).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 is_empty_for_fallback(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 s=get(e[o],i);if(void 0!==s){a=s;break}}else a=get(e,i)}catch(e){continue}if(!is_empty_for_fallback(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 split_expr_and_fmt(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){if(r+1<e.length&&"|"===e[r+1]){r++;continue}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,_fmt:void 0,_empty_values:void 0,_empty_check:void 0,_vol_units:void 0,_vol_step:void 0,_thousands:void 0};if(null!=t&&(n.options=t,Array.isArray(t)?n.fill_data=t:n.fill_data=[t]),n._fmt=find_value(t,"_fmt"),n._unit=find_value(t,"_unit",!1),n._empty_values=find_value(t,"_empty_values"),n._empty_check=find_value(t,"_empty_check"),n._vol_units=find_value(t,"_vol_units"),n._vol_step=find_value(t,"_vol_step"),n._thousands=find_value(t,"_thousands"),"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=split_expr_and_fmt(r),a=i.expr,o=i.fmt;return n.expr=a,n.fmt_expr=o,n}function detect_fallback_var$1(e,t){if("("!==e[t])return null;for(var r=0,n=!1,i=[],a="",o=t;o<e.length;){var s=e[o];if("("===s){if(0===r){r++,o++;continue}r++,a+=s}else if(")"===s){if(0===--r)return n?(i.push(a.trim()),{paths:i,end_index:o}):null;a+=s}else"|"===s&&1===r?(n=!0,i.push(a.trim()),a=""):a+=s;o++}return null}function detect_function_call(e,t,r){for(var n=t;n<e.length&&" "===e[n];)n++;return n<e.length&&"("===e[n]}function parse_function_args(e,t){if("("!==e[t])return null;for(var r=1,n=[],i="",a=t+1;a<e.length&&r>0;){var o=e[a];if("("===o)r++,i+=o;else if(")"===o){if(0===--r)return i.trim()&&n.push(i.trim()),{args:n,end_index:a};i+=o}else","===o&&1===r?(n.push(i.trim()),i=""):i+=o;a++}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("+"===r||"-"===r)return e.push({type:state_operator,value:r}),t.curr_state=state_initial,void(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 s=t.expr.slice(t.prev_index,t.cur_index);if("true"===s)e.push({type:"boolean",value:!0});else if("false"===s)e.push({type:"boolean",value:!1});else if(detect_function_call(t.expr,t.cur_index)){for(var _=t.cur_index;_<t.expr.length&&" "===t.expr[_];)_++;var u=parse_function_args(t.expr,_);if(u)return e.push({type:state_function,value:s,args:u.args}),t.cur_index=u.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}else{var c=get_real_value(t.fill_data,s);if("function"==typeof c){for(var l=t.cur_index;l<t.expr.length&&" "===t.expr[l];)l++;if(l<t.expr.length&&"("===t.expr[l]){var p=parse_function_args(t.expr,l);if(p)return e.push({type:state_function,value:s,args:p.args,fn:c}),t.cur_index=p.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}}if(t._unit){var d,f=split_unit_num(c),g=f.num,m=f.unit;if(void 0===m)e.push({type:"var",value:s,real_value:g,has_unit:!1});else t.has_unit=!0,null!==(d=t.unit_str)&&void 0!==d||(t.unit_str=m),e.push({type:"var",value:s,real_value:g,has_unit:!0,unit:m})}else e.push({type:"var",value:s,real_value:c,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,s=[];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.at(-1);0===a.cur_index||"operator"===(null==_?void 0:_.type)||"comparison"===(null==_?void 0:_.type)||"logical"===(null==_?void 0:_.type)||"logical_not"===(null==_?void 0:_.type)||"ternary_question"===(null==_?void 0:_.type)||"ternary_colon"===(null==_?void 0:_.type)||"("===(null==_?void 0:_.value)||"["===(null==_?void 0:_.value)||","===(null==_?void 0:_.value)?(a.curr_state=state_number,a.cur_index++):(a.cur_index++,s.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(">"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:">="})):s.push({type:state_comparison,value:">"}),a.prev_index=a.cur_index;else if("<"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:"<="})):s.push({type:state_comparison,value:"<"}),a.prev_index=a.cur_index;else if("="===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"=="}),a.prev_index=a.cur_index;else if("!"===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"!="}),a.prev_index=a.cur_index;else if("&"===i&&a.cur_index+1<o&&"&"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"&&"}),a.prev_index=a.cur_index;else if("|"===i&&a.cur_index+1<o&&"|"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"||"}),a.prev_index=a.cur_index;else if("!"===i)a.cur_index++,s.push({type:state_logical_not,value:"!"}),a.prev_index=a.cur_index;else if("?"===i)a.cur_index++,s.push({type:state_ternary_question,value:"?"}),a.prev_index=a.cur_index;else if(":"===i)a.cur_index++,s.push({type:state_ternary_colon,value:":"}),a.prev_index=a.cur_index;else if("["===i)a.cur_index++,s.push({type:state_range_start,value:"["}),a.prev_index=a.cur_index;else if("]"===i)a.cur_index++,s.push({type:state_range_end,value:"]"}),a.prev_index=a.cur_index;else if(","===i)a.cur_index++,s.push({type:"comma",value:","}),a.prev_index=a.cur_index;else if(var_char_set.has(i))a.curr_state=state_var,a.cur_index++;else if('"'===i||"'"===i){var u=i;a.cur_index++;for(var c="";a.cur_index<o&&e[a.cur_index]!==u;)"\\"===e[a.cur_index]&&a.cur_index+1<o?(a.cur_index++,c+=e[a.cur_index]):c+=e[a.cur_index],a.cur_index++;a.cur_index++,s.push({type:"string",value:c}),a.prev_index=a.cur_index}else if("("===i){var l=detect_fallback_var$1(e,a.cur_index);if(l){a.has_var=!0;var p=get_fallback_value(t,l.paths,n),d=p.value,f=p.path;if(r){var g,m=split_unit_num(d),v=m.num,h=m.unit;if(void 0!==h)a.has_unit=!0,null!==(g=a.unit_str)&&void 0!==g||(a.unit_str=h),s.push({type:state_fallback_var,value:l.paths,real_value:v,matched_path:f,has_unit:!0,unit:h});else s.push({type:state_fallback_var,value:l.paths,real_value:v,matched_path:f,has_unit:!1})}else s.push({type:state_fallback_var,value:l.paths,real_value:d,matched_path:f,has_unit:!1});a.cur_index=l.end_index+1,a.prev_index=a.cur_index}else s.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index}else")"===i?(s.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||"<"===i||"="===i||"!"===i||"&"===i||"|"===i||"?"===i||":"===i||"["===i||"]"===i||","===i||"%"===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(s,a):a.cur_index++:push_token$3(s,a);break;case state_operator:var w=e[a.cur_index-1];"*"===i&&"*"===w?(a.cur_index++,s.push({type:state_operator,value:"**"}),a.prev_index=a.cur_index):"/"===i&&"/"===w?(a.cur_index++,s.push({type:state_operator,value:"//"}),a.prev_index=a.cur_index):(s.push({type:state_operator,value:w}),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(s,a);break;case state_scientific:if(number_char_set.has(i))a.cur_index++;else if("+-".includes(i)){var b=a.prev_index;"+-".includes(e[b])&&(b+=1);var y=e.slice(b,a.cur_index),x=y.at(-1);y.includes(i)||"e"!==x?push_token$3(s,a):a.cur_index++}else r&&-1==="*/+-() ".indexOf(i)&&">"!==i&&"<"!==i&&"="!==i&&"!"!==i&&"&"!==i&&"|"!==i&&"?"!==i&&":"!==i&&"["!==i&&"]"!==i&&","!==i?a.cur_index++:push_token$3(s,a);break;default:throw new Error("字符扫描状态错误")}return a.prev_index<a.cur_index&&push_token$3(s,a),s.has_var=a.has_var,s.has_unit=a.has_unit,s.unit=a.unit_str,s}
|
|
4
4
|
/*!
|
|
5
5
|
* decimal.js v10.6.0
|
|
6
6
|
* An arbitrary-precision Decimal type for JavaScript.
|
package/es/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function asyncGeneratorStep(e,t,r,n,i,a,o){try{var s=e[a](o),_=s.value}catch(e){return void r(e)}s.done?t(_):Promise.resolve(_).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,s,"next",e)}function s(e){asyncGeneratorStep(a,n,i,o,s,"throw",e)}o(void 0)})}}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,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}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 _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}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,s=[],_=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;_=!1}else for(;!(_=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);_=!0);}catch(e){u=!0,i=e}finally{try{if(!_&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}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 _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 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 _regenerator(){
|
|
2
2
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
3
|
-
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(r,n,i,a){var _=n&&n.prototype instanceof s?n:s,u=Object.create(_.prototype);return _regeneratorDefine(u,"_invoke",function(r,n,i){var a,s,_,u=0,l=i||[],c=!1,f={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return a=t,s=0,_=e,f.n=r,o}};function d(r,n){for(s=r,_=n,t=0;!c&&u&&!i&&t<l.length;t++){var i,a=l[t],d=f.p,p=a[2];r>3?(i=p===n)&&(_=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((i=r<2&&d<a[1])?(s=0,f.v=n,f.n=a[1]):d<p&&(i=r<3||a[0]>n||n>p)&&(a[4]=r,a[5]=n,f.n=p,s=0))}if(i||r>1)return o;throw c=!0,n}return function(i,l,p){if(u>1)throw TypeError("Generator is already running");for(c&&1===l&&d(l,p),s=l,_=p;(t=s<2?e:_)||!c;){a||(s?s<3?(s>1&&(f.n=-1),d(s,_)):f.n=_:f.v=_);try{if(u=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(_=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(c=f.n<0)?_:r.call(n,f))!==o)break}catch(t){a=e,s=1,_=t}finally{u=1}}return{value:t,done:c}}}(r,i,a),!0),u}var o={};function s(){}function _(){}function u(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(_regeneratorDefine(t={},n,function(){return this}),t),c=u.prototype=s.prototype=Object.create(l);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,_regeneratorDefine(e,i,"GeneratorFunction")),e.prototype=Object.create(c),e}return _.prototype=u,_regeneratorDefine(c,"constructor",u),_regeneratorDefine(u,"constructor",_),_.displayName="GeneratorFunction",_regeneratorDefine(u,i,"GeneratorFunction"),_regeneratorDefine(c),_regeneratorDefine(c,i,"Generator"),_regeneratorDefine(c,n,function(){return this}),_regeneratorDefine(c,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:a,m:f}})()}function _regeneratorDefine(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine=function(e,t,r,n){function a(t,r){_regeneratorDefine(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},_regeneratorDefine(e,t,r,n)}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 _toPrimitive(e,t){if("object"!=typeof e||!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:t+""}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 _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.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}}var version="3.0.0-beta.20250123.6";function decimal_round(e,t,r,n,i){var a=e.startsWith("-"),o=a?e.slice(1):e,s=o,_=t,u=t.length;function l(){s=(+s+1).toString()}var c={"~-":function(){var e="<"===r?n-1:n;_=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)?_=i:(i=(+"9".concat(i)+1).toString().slice(1)).length>e?(_=i.slice(1,i.length),l()):_=i}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;_=t.slice(0,e);var i=+t[e];Number.isNaN(i)||i>=5&&(_=(+"9".concat(_)+1).toString().slice(1)).length>e&&(_=_.slice(1,_.length),l())}},"~6":function(){if(0!==u){var e,i="<"===r?n-1:n,a=+t[i],s=t.slice(+i+1,t.length);s=""===s?0:parseInt(s),e=0===i?+o[o.length-1]:+t[i-1],_=t.slice(0,i),(a>=6||5===a&&s>0||5===a&&e%2!=0)&&(_=(+"9".concat(_)+1).toString().slice(1)).length>i&&(_=_.slice(1,_.length),l())}}};return"<="===r?u<=n?_=t.replace(/0*$/,""):(c[i]&&c[i](),_=_.replace(/0+$/,"")):"<"===r?u<n?_=t.replace(/0*$/,""):(c[i]&&c[i](),_=_.replace(/0+$/,"")):"="===r?u<n?_=t+"0".repeat(n-u):u>n&&c[i]&&c[i]():">="===r?u<n&&(_=t+"0".repeat(n-u)):">"===r&&u<=n&&(_=t+"0".repeat(n-u+1)),{int_part:a?"-".concat(s):s,dec_part:_}}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",state_unit_hide="unit_hide",state_unit_default="unit_default",state_thousands="thousands",state_fmt_group="fmt_group",state_comparison="comparison",state_logical="logical",state_logical_not="logical_not",state_ternary_question="ternary_question",state_ternary_colon="ternary_colon",state_function="function",state_range_start="range_start",state_range_end="range_end",state_range_clamp="range_clamp",comparison_operators=new Set([">","<",">=","<=","==","!="]),logical_operators=new Set(["&&","||"]),operator_precedence={"|":0,"?":1,":":1,"||":2,"&&":3,"==":4,"!=":4,">":5,"<":5,">=":5,"<=":5,"+":6,"-":6,"*":7,"/":7,"%":7,"//":7,"**":8,"!":9,"unary-":9,"unary+":9},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$1=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||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(){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],s=decimal_round(a,o,t,+r,n);return a=s.int_part,""===(o=s.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(_regenerator().m(function e(t){var r,n,i,a=arguments;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 1:if(!(n<t.length)){e.n=7;break}return e.p=2,e.n=3,Promise.race([t[n],new Promise(function(e,t){setTimeout(function(){return t(new Error("promise queue timeout err"))},r)})]);case 3:i=e.v,e.n=5;break;case 4:return e.p=4,e.v,e.a(3,6);case 5:return e.a(2,i);case 6:n++,e.n=1;break;case 7:return e.a(2,Promise.reject("错误的 promise queue 调用"))}},e,null,[[2,4]])})),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regenerator().m(function e(t){var r;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=0;case 1:if(!(r<t.length)){e.n=7;break}return e.p=2,e.n=3,fetch(t[r]);case 3:if(!e.v.ok){e.n=4;break}return e.a(2,t[r]);case 4:e.n=6;break;case 5:return e.p=5,e.v,e.a(3,6);case 6:r++,e.n=1;break;case 7:return e.a(2,null)}},e,null,[[2,5]])}))).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 is_empty_for_fallback(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 s=get(e[o],i);if(void 0!==s){a=s;break}}else a=get(e,i)}catch(e){continue}if(!is_empty_for_fallback(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 split_expr_and_fmt(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){if(r+1<e.length&&"|"===e[r+1]){r++;continue}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,_fmt:void 0,_empty_values:void 0,_empty_check:void 0,_vol_units:void 0,_vol_step:void 0,_thousands:void 0};if(null!=t&&(n.options=t,Array.isArray(t)?n.fill_data=t:n.fill_data=[t]),n._fmt=find_value(t,"_fmt"),n._unit=find_value(t,"_unit",!1),n._empty_values=find_value(t,"_empty_values"),n._empty_check=find_value(t,"_empty_check"),n._vol_units=find_value(t,"_vol_units"),n._vol_step=find_value(t,"_vol_step"),n._thousands=find_value(t,"_thousands"),"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=split_expr_and_fmt(r),a=i.expr,o=i.fmt;return n.expr=a,n.fmt_expr=o,n}function detect_fallback_var$1(e,t){if("("!==e[t])return null;for(var r=0,n=!1,i=[],a="",o=t;o<e.length;){var s=e[o];if("("===s){if(0===r){r++,o++;continue}r++,a+=s}else if(")"===s){if(0===--r)return n?(i.push(a.trim()),{paths:i,end_index:o}):null;a+=s}else"|"===s&&1===r?(n=!0,i.push(a.trim()),a=""):a+=s;o++}return null}function detect_function_call(e,t,r){for(var n=t;n<e.length&&" "===e[n];)n++;return n<e.length&&"("===e[n]}function parse_function_args(e,t){if("("!==e[t])return null;for(var r=1,n=[],i="",a=t+1;a<e.length&&r>0;){var o=e[a];if("("===o)r++,i+=o;else if(")"===o){if(0===--r)return i.trim()&&n.push(i.trim()),{args:n,end_index:a};i+=o}else","===o&&1===r?(n.push(i.trim()),i=""):i+=o;a++}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("+"===r||"-"===r)return e.push({type:state_operator,value:r}),t.curr_state=state_initial,void(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 s=t.expr.slice(t.prev_index,t.cur_index);if("true"===s)e.push({type:"boolean",value:!0});else if("false"===s)e.push({type:"boolean",value:!1});else if(detect_function_call(t.expr,t.cur_index)){for(var _=t.cur_index;_<t.expr.length&&" "===t.expr[_];)_++;var u=parse_function_args(t.expr,_);if(u)return e.push({type:state_function,value:s,args:u.args}),t.cur_index=u.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}else{var l=get_real_value(t.fill_data,s);if("function"==typeof l){for(var c=t.cur_index;c<t.expr.length&&" "===t.expr[c];)c++;if(c<t.expr.length&&"("===t.expr[c]){var f=parse_function_args(t.expr,c);if(f)return e.push({type:state_function,value:s,args:f.args,fn:l}),t.cur_index=f.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}}if(t._unit){var d,p=split_unit_num(l),g=p.num,m=p.unit;if(void 0===m)e.push({type:"var",value:s,real_value:g,has_unit:!1});else t.has_unit=!0,null!==(d=t.unit_str)&&void 0!==d||(t.unit_str=m),e.push({type:"var",value:s,real_value:g,has_unit:!0,unit:m})}else e.push({type:"var",value:s,real_value:l,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,s=[];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.at(-1);0===a.cur_index||"operator"===(null==_?void 0:_.type)||"comparison"===(null==_?void 0:_.type)||"logical"===(null==_?void 0:_.type)||"logical_not"===(null==_?void 0:_.type)||"ternary_question"===(null==_?void 0:_.type)||"ternary_colon"===(null==_?void 0:_.type)||"("===(null==_?void 0:_.value)||"["===(null==_?void 0:_.value)||","===(null==_?void 0:_.value)?(a.curr_state=state_number,a.cur_index++):(a.cur_index++,s.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(">"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:">="})):s.push({type:state_comparison,value:">"}),a.prev_index=a.cur_index;else if("<"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:"<="})):s.push({type:state_comparison,value:"<"}),a.prev_index=a.cur_index;else if("="===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"=="}),a.prev_index=a.cur_index;else if("!"===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"!="}),a.prev_index=a.cur_index;else if("&"===i&&a.cur_index+1<o&&"&"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"&&"}),a.prev_index=a.cur_index;else if("|"===i&&a.cur_index+1<o&&"|"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"||"}),a.prev_index=a.cur_index;else if("!"===i)a.cur_index++,s.push({type:state_logical_not,value:"!"}),a.prev_index=a.cur_index;else if("?"===i)a.cur_index++,s.push({type:state_ternary_question,value:"?"}),a.prev_index=a.cur_index;else if(":"===i)a.cur_index++,s.push({type:state_ternary_colon,value:":"}),a.prev_index=a.cur_index;else if("["===i)a.cur_index++,s.push({type:state_range_start,value:"["}),a.prev_index=a.cur_index;else if("]"===i)a.cur_index++,s.push({type:state_range_end,value:"]"}),a.prev_index=a.cur_index;else if(","===i)a.cur_index++,s.push({type:"comma",value:","}),a.prev_index=a.cur_index;else if(var_char_set.has(i))a.curr_state=state_var,a.cur_index++;else if('"'===i||"'"===i){var u=i;a.cur_index++;for(var l="";a.cur_index<o&&e[a.cur_index]!==u;)"\\"===e[a.cur_index]&&a.cur_index+1<o?(a.cur_index++,l+=e[a.cur_index]):l+=e[a.cur_index],a.cur_index++;a.cur_index++,s.push({type:"string",value:l}),a.prev_index=a.cur_index}else if("("===i){var c=detect_fallback_var$1(e,a.cur_index);if(c){a.has_var=!0;var f=get_fallback_value(t,c.paths,n),d=f.value,p=f.path;if(r){var g,m=split_unit_num(d),v=m.num,h=m.unit;if(void 0!==h)a.has_unit=!0,null!==(g=a.unit_str)&&void 0!==g||(a.unit_str=h),s.push({type:state_fallback_var,value:c.paths,real_value:v,matched_path:p,has_unit:!0,unit:h});else s.push({type:state_fallback_var,value:c.paths,real_value:v,matched_path:p,has_unit:!1})}else s.push({type:state_fallback_var,value:c.paths,real_value:d,matched_path:p,has_unit:!1});a.cur_index=c.end_index+1,a.prev_index=a.cur_index}else s.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index}else")"===i?(s.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||"<"===i||"="===i||"!"===i||"&"===i||"|"===i||"?"===i||":"===i||"["===i||"]"===i||","===i||"%"===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(s,a):a.cur_index++:push_token$3(s,a);break;case state_operator:var w=e[a.cur_index-1];"*"===i&&"*"===w?(a.cur_index++,s.push({type:state_operator,value:"**"}),a.prev_index=a.cur_index):"/"===i&&"/"===w?(a.cur_index++,s.push({type:state_operator,value:"//"}),a.prev_index=a.cur_index):(s.push({type:state_operator,value:w}),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(s,a);break;case state_scientific:if(number_char_set.has(i))a.cur_index++;else if("+-".includes(i)){var b=a.prev_index;"+-".includes(e[b])&&(b+=1);var y=e.slice(b,a.cur_index),x=y.at(-1);y.includes(i)||"e"!==x?push_token$3(s,a):a.cur_index++}else r&&-1==="*/+-() ".indexOf(i)&&">"!==i&&"<"!==i&&"="!==i&&"!"!==i&&"&"!==i&&"|"!==i&&"?"!==i&&":"!==i&&"["!==i&&"]"!==i&&","!==i?a.cur_index++:push_token$3(s,a);break;default:throw new Error("字符扫描状态错误")}return a.prev_index<a.cur_index&&push_token$3(s,a),s.has_var=a.has_var,s.has_unit=a.has_unit,s.unit=a.unit_str,s}
|
|
3
|
+
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(r,n,i,a){var _=n&&n.prototype instanceof s?n:s,u=Object.create(_.prototype);return _regeneratorDefine(u,"_invoke",function(r,n,i){var a,s,_,u=0,l=i||[],c=!1,f={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return a=t,s=0,_=e,f.n=r,o}};function d(r,n){for(s=r,_=n,t=0;!c&&u&&!i&&t<l.length;t++){var i,a=l[t],d=f.p,p=a[2];r>3?(i=p===n)&&(_=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((i=r<2&&d<a[1])?(s=0,f.v=n,f.n=a[1]):d<p&&(i=r<3||a[0]>n||n>p)&&(a[4]=r,a[5]=n,f.n=p,s=0))}if(i||r>1)return o;throw c=!0,n}return function(i,l,p){if(u>1)throw TypeError("Generator is already running");for(c&&1===l&&d(l,p),s=l,_=p;(t=s<2?e:_)||!c;){a||(s?s<3?(s>1&&(f.n=-1),d(s,_)):f.n=_:f.v=_);try{if(u=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(_=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(c=f.n<0)?_:r.call(n,f))!==o)break}catch(t){a=e,s=1,_=t}finally{u=1}}return{value:t,done:c}}}(r,i,a),!0),u}var o={};function s(){}function _(){}function u(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(_regeneratorDefine(t={},n,function(){return this}),t),c=u.prototype=s.prototype=Object.create(l);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,_regeneratorDefine(e,i,"GeneratorFunction")),e.prototype=Object.create(c),e}return _.prototype=u,_regeneratorDefine(c,"constructor",u),_regeneratorDefine(u,"constructor",_),_.displayName="GeneratorFunction",_regeneratorDefine(u,i,"GeneratorFunction"),_regeneratorDefine(c),_regeneratorDefine(c,i,"Generator"),_regeneratorDefine(c,n,function(){return this}),_regeneratorDefine(c,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:a,m:f}})()}function _regeneratorDefine(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine=function(e,t,r,n){function a(t,r){_regeneratorDefine(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},_regeneratorDefine(e,t,r,n)}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 _toPrimitive(e,t){if("object"!=typeof e||!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:t+""}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 _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.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}}var version="3.0.0-beta.20250123.8";function decimal_round(e,t,r,n,i){var a=e.startsWith("-"),o=a?e.slice(1):e,s=o,_=t,u=t.length;function l(){s=(+s+1).toString()}var c={"~-":function(){var e="<"===r?n-1:n;_=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)?_=i:(i=(+"9".concat(i)+1).toString().slice(1)).length>e?(_=i.slice(1,i.length),l()):_=i}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;_=t.slice(0,e);var i=+t[e];Number.isNaN(i)||i>=5&&(_=(+"9".concat(_)+1).toString().slice(1)).length>e&&(_=_.slice(1,_.length),l())}},"~6":function(){if(0!==u){var e,i="<"===r?n-1:n,a=+t[i],s=t.slice(+i+1,t.length);s=""===s?0:parseInt(s),e=0===i?+o[o.length-1]:+t[i-1],_=t.slice(0,i),(a>=6||5===a&&s>0||5===a&&e%2!=0)&&(_=(+"9".concat(_)+1).toString().slice(1)).length>i&&(_=_.slice(1,_.length),l())}}};return"<="===r?u<=n?_=t.replace(/0*$/,""):(c[i]&&c[i](),_=_.replace(/0+$/,"")):"<"===r?u<n?_=t.replace(/0*$/,""):(c[i]&&c[i](),_=_.replace(/0+$/,"")):"="===r?u<n?_=t+"0".repeat(n-u):u>n&&c[i]&&c[i]():">="===r?u<n&&(_=t+"0".repeat(n-u)):">"===r&&u<=n&&(_=t+"0".repeat(n-u+1)),{int_part:a?"-".concat(s):s,dec_part:_}}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",state_unit_hide="unit_hide",state_unit_default="unit_default",state_thousands="thousands",state_fmt_group="fmt_group",state_comparison="comparison",state_logical="logical",state_logical_not="logical_not",state_ternary_question="ternary_question",state_ternary_colon="ternary_colon",state_function="function",state_range_start="range_start",state_range_end="range_end",state_range_clamp="range_clamp",comparison_operators=new Set([">","<",">=","<=","==","!="]),logical_operators=new Set(["&&","||"]),operator_precedence={"|":0,"?":1,":":1,"||":2,"&&":3,"==":4,"!=":4,">":5,"<":5,">=":5,"<=":5,"+":6,"-":6,"*":7,"/":7,"%":7,"//":7,"**":8,"!":9,"unary-":9,"unary+":9},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$1=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||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(){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],s=decimal_round(a,o,t,+r,n);return a=s.int_part,""===(o=s.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(_regenerator().m(function e(t){var r,n,i,a=arguments;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 1:if(!(n<t.length)){e.n=7;break}return e.p=2,e.n=3,Promise.race([t[n],new Promise(function(e,t){setTimeout(function(){return t(new Error("promise queue timeout err"))},r)})]);case 3:i=e.v,e.n=5;break;case 4:return e.p=4,e.v,e.a(3,6);case 5:return e.a(2,i);case 6:n++,e.n=1;break;case 7:return e.a(2,Promise.reject("错误的 promise queue 调用"))}},e,null,[[2,4]])})),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regenerator().m(function e(t){var r;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=0;case 1:if(!(r<t.length)){e.n=7;break}return e.p=2,e.n=3,fetch(t[r]);case 3:if(!e.v.ok){e.n=4;break}return e.a(2,t[r]);case 4:e.n=6;break;case 5:return e.p=5,e.v,e.a(3,6);case 6:r++,e.n=1;break;case 7:return e.a(2,null)}},e,null,[[2,5]])}))).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 is_empty_for_fallback(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 s=get(e[o],i);if(void 0!==s){a=s;break}}else a=get(e,i)}catch(e){continue}if(!is_empty_for_fallback(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 split_expr_and_fmt(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){if(r+1<e.length&&"|"===e[r+1]){r++;continue}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,_fmt:void 0,_empty_values:void 0,_empty_check:void 0,_vol_units:void 0,_vol_step:void 0,_thousands:void 0};if(null!=t&&(n.options=t,Array.isArray(t)?n.fill_data=t:n.fill_data=[t]),n._fmt=find_value(t,"_fmt"),n._unit=find_value(t,"_unit",!1),n._empty_values=find_value(t,"_empty_values"),n._empty_check=find_value(t,"_empty_check"),n._vol_units=find_value(t,"_vol_units"),n._vol_step=find_value(t,"_vol_step"),n._thousands=find_value(t,"_thousands"),"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=split_expr_and_fmt(r),a=i.expr,o=i.fmt;return n.expr=a,n.fmt_expr=o,n}function detect_fallback_var$1(e,t){if("("!==e[t])return null;for(var r=0,n=!1,i=[],a="",o=t;o<e.length;){var s=e[o];if("("===s){if(0===r){r++,o++;continue}r++,a+=s}else if(")"===s){if(0===--r)return n?(i.push(a.trim()),{paths:i,end_index:o}):null;a+=s}else"|"===s&&1===r?(n=!0,i.push(a.trim()),a=""):a+=s;o++}return null}function detect_function_call(e,t,r){for(var n=t;n<e.length&&" "===e[n];)n++;return n<e.length&&"("===e[n]}function parse_function_args(e,t){if("("!==e[t])return null;for(var r=1,n=[],i="",a=t+1;a<e.length&&r>0;){var o=e[a];if("("===o)r++,i+=o;else if(")"===o){if(0===--r)return i.trim()&&n.push(i.trim()),{args:n,end_index:a};i+=o}else","===o&&1===r?(n.push(i.trim()),i=""):i+=o;a++}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("+"===r||"-"===r)return e.push({type:state_operator,value:r}),t.curr_state=state_initial,void(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 s=t.expr.slice(t.prev_index,t.cur_index);if("true"===s)e.push({type:"boolean",value:!0});else if("false"===s)e.push({type:"boolean",value:!1});else if(detect_function_call(t.expr,t.cur_index)){for(var _=t.cur_index;_<t.expr.length&&" "===t.expr[_];)_++;var u=parse_function_args(t.expr,_);if(u)return e.push({type:state_function,value:s,args:u.args}),t.cur_index=u.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}else{var l=get_real_value(t.fill_data,s);if("function"==typeof l){for(var c=t.cur_index;c<t.expr.length&&" "===t.expr[c];)c++;if(c<t.expr.length&&"("===t.expr[c]){var f=parse_function_args(t.expr,c);if(f)return e.push({type:state_function,value:s,args:f.args,fn:l}),t.cur_index=f.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}}if(t._unit){var d,p=split_unit_num(l),g=p.num,m=p.unit;if(void 0===m)e.push({type:"var",value:s,real_value:g,has_unit:!1});else t.has_unit=!0,null!==(d=t.unit_str)&&void 0!==d||(t.unit_str=m),e.push({type:"var",value:s,real_value:g,has_unit:!0,unit:m})}else e.push({type:"var",value:s,real_value:l,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,s=[];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.at(-1);0===a.cur_index||"operator"===(null==_?void 0:_.type)||"comparison"===(null==_?void 0:_.type)||"logical"===(null==_?void 0:_.type)||"logical_not"===(null==_?void 0:_.type)||"ternary_question"===(null==_?void 0:_.type)||"ternary_colon"===(null==_?void 0:_.type)||"("===(null==_?void 0:_.value)||"["===(null==_?void 0:_.value)||","===(null==_?void 0:_.value)?(a.curr_state=state_number,a.cur_index++):(a.cur_index++,s.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(">"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:">="})):s.push({type:state_comparison,value:">"}),a.prev_index=a.cur_index;else if("<"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:"<="})):s.push({type:state_comparison,value:"<"}),a.prev_index=a.cur_index;else if("="===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"=="}),a.prev_index=a.cur_index;else if("!"===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"!="}),a.prev_index=a.cur_index;else if("&"===i&&a.cur_index+1<o&&"&"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"&&"}),a.prev_index=a.cur_index;else if("|"===i&&a.cur_index+1<o&&"|"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"||"}),a.prev_index=a.cur_index;else if("!"===i)a.cur_index++,s.push({type:state_logical_not,value:"!"}),a.prev_index=a.cur_index;else if("?"===i)a.cur_index++,s.push({type:state_ternary_question,value:"?"}),a.prev_index=a.cur_index;else if(":"===i)a.cur_index++,s.push({type:state_ternary_colon,value:":"}),a.prev_index=a.cur_index;else if("["===i)a.cur_index++,s.push({type:state_range_start,value:"["}),a.prev_index=a.cur_index;else if("]"===i)a.cur_index++,s.push({type:state_range_end,value:"]"}),a.prev_index=a.cur_index;else if(","===i)a.cur_index++,s.push({type:"comma",value:","}),a.prev_index=a.cur_index;else if(var_char_set.has(i))a.curr_state=state_var,a.cur_index++;else if('"'===i||"'"===i){var u=i;a.cur_index++;for(var l="";a.cur_index<o&&e[a.cur_index]!==u;)"\\"===e[a.cur_index]&&a.cur_index+1<o?(a.cur_index++,l+=e[a.cur_index]):l+=e[a.cur_index],a.cur_index++;a.cur_index++,s.push({type:"string",value:l}),a.prev_index=a.cur_index}else if("("===i){var c=detect_fallback_var$1(e,a.cur_index);if(c){a.has_var=!0;var f=get_fallback_value(t,c.paths,n),d=f.value,p=f.path;if(r){var g,m=split_unit_num(d),v=m.num,h=m.unit;if(void 0!==h)a.has_unit=!0,null!==(g=a.unit_str)&&void 0!==g||(a.unit_str=h),s.push({type:state_fallback_var,value:c.paths,real_value:v,matched_path:p,has_unit:!0,unit:h});else s.push({type:state_fallback_var,value:c.paths,real_value:v,matched_path:p,has_unit:!1})}else s.push({type:state_fallback_var,value:c.paths,real_value:d,matched_path:p,has_unit:!1});a.cur_index=c.end_index+1,a.prev_index=a.cur_index}else s.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index}else")"===i?(s.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||"<"===i||"="===i||"!"===i||"&"===i||"|"===i||"?"===i||":"===i||"["===i||"]"===i||","===i||"%"===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(s,a):a.cur_index++:push_token$3(s,a);break;case state_operator:var w=e[a.cur_index-1];"*"===i&&"*"===w?(a.cur_index++,s.push({type:state_operator,value:"**"}),a.prev_index=a.cur_index):"/"===i&&"/"===w?(a.cur_index++,s.push({type:state_operator,value:"//"}),a.prev_index=a.cur_index):(s.push({type:state_operator,value:w}),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(s,a);break;case state_scientific:if(number_char_set.has(i))a.cur_index++;else if("+-".includes(i)){var b=a.prev_index;"+-".includes(e[b])&&(b+=1);var y=e.slice(b,a.cur_index),x=y.at(-1);y.includes(i)||"e"!==x?push_token$3(s,a):a.cur_index++}else r&&-1==="*/+-() ".indexOf(i)&&">"!==i&&"<"!==i&&"="!==i&&"!"!==i&&"&"!==i&&"|"!==i&&"?"!==i&&":"!==i&&"["!==i&&"]"!==i&&","!==i?a.cur_index++:push_token$3(s,a);break;default:throw new Error("字符扫描状态错误")}return a.prev_index<a.cur_index&&push_token$3(s,a),s.has_var=a.has_var,s.has_unit=a.has_unit,s.unit=a.unit_str,s}
|
|
4
4
|
/*!
|
|
5
5
|
* decimal.js v10.6.0
|
|
6
6
|
* An arbitrary-precision Decimal type for JavaScript.
|
package/mcp-server/src/index.js
CHANGED
|
@@ -45,6 +45,20 @@ const TOOLS = [
|
|
|
45
45
|
|
|
46
46
|
⚠️ 重要:当用户需要进行任何数值计算时,优先使用此工具而不是直接计算!
|
|
47
47
|
|
|
48
|
+
🚨 编码规范(必读!):
|
|
49
|
+
|
|
50
|
+
1. 变量注入方式:
|
|
51
|
+
❌ 错误:calc(\`\${a} + \${b}\`) // 不要用模板字符串拼接
|
|
52
|
+
✅ 正确:calc("a + b", {a, b}) // 使用第二参数注入变量
|
|
53
|
+
|
|
54
|
+
2. 批量计算方式:
|
|
55
|
+
❌ 错误:let total = '0'; items.forEach(item => total = calc(\`\${total} + \${item.price}\`))
|
|
56
|
+
✅ 正确:const total = calc_sum("price * qty", items) // 使用 calc_sum
|
|
57
|
+
|
|
58
|
+
3. 购物车等场景:
|
|
59
|
+
❌ 错误:cart.forEach(item => total = calc(\`\${total} + \${item.price} * \${item.quantity}\`))
|
|
60
|
+
✅ 正确:calc_sum("price * quantity | =2", cart)
|
|
61
|
+
|
|
48
62
|
核心优势:
|
|
49
63
|
- ✅ 解决 0.1 + 0.2 = 0.30000000000000004 的精度问题
|
|
50
64
|
- ✅ 金融计算、价格计算、统计分析等场景必用
|
|
@@ -61,9 +75,8 @@ const TOOLS = [
|
|
|
61
75
|
|
|
62
76
|
快速示例:
|
|
63
77
|
- calc("0.1 + 0.2") → "0.3" (精确!)
|
|
64
|
-
- calc("
|
|
78
|
+
- calc("price * qty | =2", {price: 99.9, qty: 3}) → "299.70"
|
|
65
79
|
- calc("1234567 | ,") → "1,234,567" (千分位)
|
|
66
|
-
- calc("price * qty * 0.9 | =2", {price: 99.9, qty: 3}) → "269.73" (折扣计算)
|
|
67
80
|
- calc("score >= 60 ? '及格' : '不及格'", {score: 75}) → "及格"
|
|
68
81
|
|
|
69
82
|
支持的运算:
|
|
@@ -168,21 +181,43 @@ const TOOLS = [
|
|
|
168
181
|
|
|
169
182
|
⚠️ 使用场景:处理数组数据、批量计算、统计汇总时使用
|
|
170
183
|
|
|
184
|
+
🚨 这是处理数组数据的正确方式!不要用 forEach 累加!
|
|
185
|
+
|
|
171
186
|
典型应用场景:
|
|
172
187
|
1. 计算订单总价:多个商品的 price * quantity 求和
|
|
173
188
|
2. 统计销售额:多条销售记录的金额汇总
|
|
174
189
|
3. 报表数据汇总:批量计算并求和
|
|
175
190
|
4. 购物车总价计算
|
|
176
191
|
|
|
192
|
+
编码规范对比(必读!):
|
|
193
|
+
|
|
194
|
+
❌ 错误写法(不要这样做):
|
|
195
|
+
\`\`\`javascript
|
|
196
|
+
// 购物车总价 - 错误示例
|
|
197
|
+
let total = '0'
|
|
198
|
+
cart.forEach(item => {
|
|
199
|
+
total = calc(\`\${total} + \${item.price} * \${item.quantity}\`)
|
|
200
|
+
})
|
|
201
|
+
\`\`\`
|
|
202
|
+
问题:使用模板字符串拼接、forEach 累加,代码不清晰、性能差
|
|
203
|
+
|
|
204
|
+
✅ 正确写法(推荐):
|
|
205
|
+
\`\`\`javascript
|
|
206
|
+
// 购物车总价 - 正确示例
|
|
207
|
+
const total = calc_sum("price * quantity | =2", cart)
|
|
208
|
+
\`\`\`
|
|
209
|
+
优势:代码简洁、性能好、自动处理精度
|
|
210
|
+
|
|
177
211
|
快速示例:
|
|
178
212
|
- calc_sum("a + b", [{a:1,b:2}, {a:3,b:4}]) → "10"
|
|
179
|
-
- calc_sum("price * qty", [{price:99.9,qty:2}, {price:49.9,qty:
|
|
213
|
+
- calc_sum("price * qty", [{price:99.9,qty:2}, {price:49.9,qty:3}]) → "349.50"
|
|
180
214
|
- calc_sum("price * qty * 0.9 | =2", orders) → 计算所有订单9折后总价
|
|
181
215
|
|
|
182
216
|
优势:
|
|
183
217
|
- 自动处理精度问题
|
|
184
218
|
- 支持复杂表达式
|
|
185
|
-
-
|
|
219
|
+
- 支持格式化输出
|
|
220
|
+
- 性能优于手动累加`,
|
|
186
221
|
inputSchema: {
|
|
187
222
|
type: "object",
|
|
188
223
|
properties: {
|
|
@@ -809,24 +844,14 @@ cmul(99.9, 3) // 单价 * 数量
|
|
|
809
844
|
|
|
810
845
|
const PROMPTS = [
|
|
811
846
|
{
|
|
812
|
-
name: "
|
|
813
|
-
description: "
|
|
814
|
-
arguments: [],
|
|
815
|
-
},
|
|
816
|
-
{
|
|
817
|
-
name: "shopping-cart-with-acalc",
|
|
818
|
-
description: "使用 a-calc 实现购物车计算的最佳实践",
|
|
819
|
-
arguments: [],
|
|
820
|
-
},
|
|
821
|
-
{
|
|
822
|
-
name: "financial-calculations",
|
|
823
|
-
description: "使用 a-calc 进行金融和价格计算的指南",
|
|
847
|
+
name: "a-calc",
|
|
848
|
+
description: "强制在所有数值计算中使用 a-calc(推荐)",
|
|
824
849
|
arguments: [],
|
|
825
850
|
},
|
|
826
851
|
];
|
|
827
852
|
|
|
828
853
|
const PROMPT_CONTENTS = {
|
|
829
|
-
"
|
|
854
|
+
"a-calc": {
|
|
830
855
|
messages: [
|
|
831
856
|
{
|
|
832
857
|
role: "user",
|
|
@@ -856,7 +881,7 @@ const PROMPT_CONTENTS = {
|
|
|
856
881
|
|
|
857
882
|
### 5. 批量数据计算(必须使用)
|
|
858
883
|
- ✅ 使用 calc_sum("price * qty", items)
|
|
859
|
-
- ❌ 不要使用 reduce()
|
|
884
|
+
- ❌ 不要使用 reduce() 或 forEach() 手动累加
|
|
860
885
|
|
|
861
886
|
## 可以不使用的场景
|
|
862
887
|
|
|
@@ -876,224 +901,106 @@ JavaScript 的浮点数精度问题:
|
|
|
876
901
|
- calc("0.3 - 0.1") = "0.2" ✅
|
|
877
902
|
- calc("99.9 * 3") = "299.7" ✅
|
|
878
903
|
|
|
879
|
-
##
|
|
880
|
-
|
|
881
|
-
在编写代码时:
|
|
882
|
-
1. 遇到数值计算,立即考虑是否需要使用 a-calc
|
|
883
|
-
2. 涉及小数、金额、价格的,必须使用 a-calc
|
|
884
|
-
3. 在代码注释中说明为什么使用 a-calc
|
|
885
|
-
4. 优先使用 calc() 函数,它最灵活
|
|
886
|
-
|
|
887
|
-
请确认你理解并将严格遵守这些规则。`,
|
|
888
|
-
},
|
|
889
|
-
},
|
|
890
|
-
],
|
|
891
|
-
},
|
|
892
|
-
"shopping-cart-with-acalc": {
|
|
893
|
-
messages: [
|
|
894
|
-
{
|
|
895
|
-
role: "user",
|
|
896
|
-
content: {
|
|
897
|
-
type: "text",
|
|
898
|
-
text: `# 使用 a-calc 实现购物车的最佳实践
|
|
899
|
-
|
|
900
|
-
## 核心原则
|
|
901
|
-
|
|
902
|
-
购物车涉及大量价格计算,必须使用 a-calc 确保精度正确。
|
|
903
|
-
|
|
904
|
-
## 典型场景和实现
|
|
905
|
-
|
|
906
|
-
### 1. 单个商品小计
|
|
904
|
+
## 编码规范和最佳实践
|
|
907
905
|
|
|
906
|
+
### ❌ 错误写法 1:使用模板字符串拼接
|
|
908
907
|
\`\`\`javascript
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
// 示例
|
|
917
|
-
calculateItemTotal(99.9, 3); // "299.70"
|
|
908
|
+
// 不要这样写!
|
|
909
|
+
let total = '0'
|
|
910
|
+
cart.forEach(item => {
|
|
911
|
+
total = calc(\`\${total} + \${item.price} * \${item.quantity}\`)
|
|
912
|
+
})
|
|
918
913
|
\`\`\`
|
|
919
914
|
|
|
920
|
-
|
|
915
|
+
**问题**:
|
|
916
|
+
- 代码不清晰,难以维护
|
|
917
|
+
- 容易出错
|
|
918
|
+
- 性能较差
|
|
921
919
|
|
|
920
|
+
### ✅ 正确写法 1:使用 calc_sum(推荐)
|
|
922
921
|
\`\`\`javascript
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
function calculateCartTotal(items) {
|
|
926
|
-
// 使用 calc_sum 批量计算并求和
|
|
927
|
-
return calc_sum("price * qty | =2", items);
|
|
928
|
-
}
|
|
929
|
-
|
|
930
|
-
// 示例
|
|
931
|
-
const cart = [
|
|
932
|
-
{ price: 99.9, qty: 2 },
|
|
933
|
-
{ price: 49.9, qty: 3 },
|
|
934
|
-
{ price: 199, qty: 1 }
|
|
935
|
-
];
|
|
936
|
-
calculateCartTotal(cart); // "548.50"
|
|
922
|
+
// 批量计算用 calc_sum
|
|
923
|
+
const total = calc_sum("price * qty | =2", cart)
|
|
937
924
|
\`\`\`
|
|
938
925
|
|
|
939
|
-
###
|
|
940
|
-
|
|
926
|
+
### ✅ 正确写法 2:使用第二参数注入变量
|
|
941
927
|
\`\`\`javascript
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
total,
|
|
948
|
-
discount: discountRate
|
|
949
|
-
});
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
// 示例
|
|
953
|
-
applyDiscount(548.50, 0.1); // "493.65" (9折)
|
|
928
|
+
// 单个计算用第二参数
|
|
929
|
+
const itemTotal = calc("price * qty | =2", {
|
|
930
|
+
price: item.price,
|
|
931
|
+
qty: item.quantity
|
|
932
|
+
})
|
|
954
933
|
\`\`\`
|
|
955
934
|
|
|
956
|
-
###
|
|
957
|
-
|
|
935
|
+
### ✅ 正确写法 3:数组模式(多数据源)
|
|
958
936
|
\`\`\`javascript
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
return calc("subtotal * (1 + tax) | =2", {
|
|
964
|
-
subtotal,
|
|
965
|
-
tax: taxRate
|
|
966
|
-
});
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
// 示例
|
|
970
|
-
calculateWithTax(493.65, 0.13); // "557.82"
|
|
937
|
+
// 多个数据源用数组模式
|
|
938
|
+
const results = items.map(item =>
|
|
939
|
+
calc("price * qty | =2", item)
|
|
940
|
+
)
|
|
971
941
|
\`\`\`
|
|
972
942
|
|
|
973
|
-
###
|
|
943
|
+
### 完整示例:购物车计算
|
|
974
944
|
|
|
975
945
|
\`\`\`javascript
|
|
976
|
-
import { calc, calc_sum } from 'a-calc'
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
...product,
|
|
986
|
-
qty: quantity,
|
|
987
|
-
// 使用 a-calc 计算小计
|
|
988
|
-
subtotal: calc("price * qty | =2", {
|
|
989
|
-
price: product.price,
|
|
990
|
-
qty: quantity
|
|
991
|
-
})
|
|
992
|
-
});
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
getTotal() {
|
|
996
|
-
// 使用 calc_sum 计算总价
|
|
997
|
-
return calc_sum("price * qty | =2", this.items);
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
applyDiscount(code) {
|
|
1001
|
-
const total = this.getTotal();
|
|
1002
|
-
const discountRate = this.getDiscountRate(code);
|
|
1003
|
-
|
|
1004
|
-
// 使用 a-calc 计算折扣后价格
|
|
1005
|
-
return calc("total * (1 - rate) | =2", {
|
|
1006
|
-
total,
|
|
1007
|
-
rate: discountRate
|
|
1008
|
-
});
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
getFinalPrice(taxRate = 0.13) {
|
|
1012
|
-
const discountedTotal = this.applyDiscount();
|
|
1013
|
-
|
|
1014
|
-
// 使用 a-calc 计算含税最终价格
|
|
1015
|
-
return calc("total * (1 + tax) | =2", {
|
|
1016
|
-
total: discountedTotal,
|
|
1017
|
-
tax: taxRate
|
|
1018
|
-
});
|
|
1019
|
-
}
|
|
946
|
+
import { calc, calc_sum, fmt } from 'a-calc'
|
|
947
|
+
|
|
948
|
+
// ❌ 错误:使用模板字符串累加
|
|
949
|
+
const wrongTotal = () => {
|
|
950
|
+
let total = '0'
|
|
951
|
+
cart.forEach(item => {
|
|
952
|
+
total = calc(\`\${total} + \${item.price} * \${item.quantity}\`)
|
|
953
|
+
})
|
|
954
|
+
return total
|
|
1020
955
|
}
|
|
1021
|
-
\`\`\`
|
|
1022
|
-
|
|
1023
|
-
## 关键要点
|
|
1024
956
|
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
957
|
+
// ✅ 正确:使用 calc_sum
|
|
958
|
+
const correctTotal = () => {
|
|
959
|
+
return calc_sum("price * quantity | =2", cart)
|
|
960
|
+
}
|
|
1029
961
|
|
|
1030
|
-
|
|
962
|
+
// ✅ 正确:单个商品小计
|
|
963
|
+
const itemSubtotal = (item) => {
|
|
964
|
+
return calc("price * qty | =2", {
|
|
965
|
+
price: item.price,
|
|
966
|
+
qty: item.quantity
|
|
967
|
+
})
|
|
968
|
+
}
|
|
1031
969
|
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
970
|
+
// ✅ 正确:应用折扣
|
|
971
|
+
const applyDiscount = (total, discountRate) => {
|
|
972
|
+
return calc("total * (1 - rate) | =2", {
|
|
973
|
+
total,
|
|
974
|
+
rate: discountRate
|
|
975
|
+
})
|
|
976
|
+
}
|
|
1037
977
|
|
|
1038
|
-
✅
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
978
|
+
// ✅ 正确:含税价格
|
|
979
|
+
const withTax = (subtotal, taxRate) => {
|
|
980
|
+
return calc("subtotal * (1 + tax) | =2", {
|
|
981
|
+
subtotal,
|
|
982
|
+
tax: taxRate
|
|
983
|
+
})
|
|
984
|
+
}
|
|
1042
985
|
\`\`\`
|
|
1043
986
|
|
|
1044
|
-
|
|
1045
|
-
},
|
|
1046
|
-
},
|
|
1047
|
-
],
|
|
1048
|
-
},
|
|
1049
|
-
"financial-calculations": {
|
|
1050
|
-
messages: [
|
|
1051
|
-
{
|
|
1052
|
-
role: "user",
|
|
1053
|
-
content: {
|
|
1054
|
-
type: "text",
|
|
1055
|
-
text: `# 金融和价格计算最佳实践
|
|
1056
|
-
|
|
1057
|
-
使用 a-calc 进行金融计算,确保精度和合规性。
|
|
1058
|
-
|
|
1059
|
-
## 常见场景
|
|
1060
|
-
|
|
1061
|
-
### 1. 利息计算
|
|
1062
|
-
\`\`\`javascript
|
|
1063
|
-
import { calc } from 'a-calc';
|
|
1064
|
-
|
|
1065
|
-
// 单利
|
|
1066
|
-
calc("principal * rate * time | =2", {
|
|
1067
|
-
principal: 10000,
|
|
1068
|
-
rate: 0.05,
|
|
1069
|
-
time: 2
|
|
1070
|
-
}); // "1000.00"
|
|
987
|
+
## 核心原则
|
|
1071
988
|
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
time: 2
|
|
1077
|
-
}); // "1025.00"
|
|
1078
|
-
\`\`\`
|
|
989
|
+
1. **批量计算用 calc_sum** - 不要用 forEach 累加
|
|
990
|
+
2. **变量用第二参数注入** - 不要用模板字符串拼接
|
|
991
|
+
3. **保持表达式简洁** - 一次计算完成,不要分步累加
|
|
992
|
+
4. **使用格式化** - 用 \`| =2\` 保留小数位
|
|
1079
993
|
|
|
1080
|
-
|
|
1081
|
-
\`\`\`javascript
|
|
1082
|
-
calc("amount * rate | =2", {
|
|
1083
|
-
amount: 1000,
|
|
1084
|
-
rate: 6.45
|
|
1085
|
-
}); // "6450.00"
|
|
1086
|
-
\`\`\`
|
|
994
|
+
## 实施要求
|
|
1087
995
|
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
\`\`\`
|
|
996
|
+
在编写代码时:
|
|
997
|
+
1. 遇到数值计算,立即考虑是否需要使用 a-calc
|
|
998
|
+
2. 涉及小数、金额、价格的,必须使用 a-calc
|
|
999
|
+
3. 优先使用 calc_sum 处理数组数据
|
|
1000
|
+
4. 使用第二参数注入变量,不要用模板字符串
|
|
1001
|
+
5. 在代码注释中说明为什么使用 a-calc
|
|
1095
1002
|
|
|
1096
|
-
|
|
1003
|
+
请确认你理解并将严格遵守这些规则。`,
|
|
1097
1004
|
},
|
|
1098
1005
|
},
|
|
1099
1006
|
],
|
package/package.json
CHANGED
|
@@ -1,132 +1,132 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
"./es": {
|
|
13
|
-
"types": "./calc.d.ts",
|
|
14
|
-
"import": "./es/index.js",
|
|
15
|
-
"default": "./es/index.js"
|
|
16
|
-
},
|
|
17
|
-
"./cjs": {
|
|
18
|
-
"types": "./calc.d.ts",
|
|
19
|
-
"require": "./cjs/index.js",
|
|
20
|
-
"default": "./cjs/index.js"
|
|
21
|
-
},
|
|
22
|
-
"./mcp-server/src/index.js": "./mcp-server/src/index.js"
|
|
2
|
+
"name": "a-calc",
|
|
3
|
+
"version": "3.0.0-beta.20250123.9",
|
|
4
|
+
"description": "A very powerful and easy-to-use number precision calculation and formatting library.",
|
|
5
|
+
"main": "./cjs/index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./calc.d.ts",
|
|
9
|
+
"import": "./es/index.js",
|
|
10
|
+
"require": "./cjs/index.js"
|
|
23
11
|
},
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"scripts": {
|
|
29
|
-
"dev": "rollup -c --environment build:dev",
|
|
30
|
-
"dev:w": "rollup -c -w --environment build:dev",
|
|
31
|
-
"build": "run-p gen:version build-test",
|
|
32
|
-
"build-test": "rollup -c --environment build:build & npm run test",
|
|
33
|
-
"build-only": "rollup -c --environment build:build",
|
|
34
|
-
"build:w": "rollup -c -w --environment build:build",
|
|
35
|
-
"build:docs": "pnpm install --frozen-lockfile=false && vitepress build docs",
|
|
36
|
-
"test": "vitest run",
|
|
37
|
-
"test:type": "tsc --noEmit type-check.ts",
|
|
38
|
-
"gen:version": "node gen_version_info.cjs",
|
|
39
|
-
"docs:dev": "vitepress dev docs",
|
|
40
|
-
"docs:build": "vitepress build docs",
|
|
41
|
-
"docs:preview": "vitepress preview docs"
|
|
12
|
+
"./es": {
|
|
13
|
+
"types": "./calc.d.ts",
|
|
14
|
+
"import": "./es/index.js",
|
|
15
|
+
"default": "./es/index.js"
|
|
42
16
|
},
|
|
43
|
-
"
|
|
44
|
-
|
|
17
|
+
"./cjs": {
|
|
18
|
+
"types": "./calc.d.ts",
|
|
19
|
+
"require": "./cjs/index.js",
|
|
20
|
+
"default": "./cjs/index.js"
|
|
45
21
|
},
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
"
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
22
|
+
"./mcp-server/src/index.js": "./mcp-server/src/index.js"
|
|
23
|
+
},
|
|
24
|
+
"browser": "browser/index.js",
|
|
25
|
+
"module": "es/index.js",
|
|
26
|
+
"types": "calc.d.ts",
|
|
27
|
+
"typings": "calc.d.ts",
|
|
28
|
+
"bin": {
|
|
29
|
+
"a-calc-mcp": "./mcp-server/src/index.js"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"es",
|
|
33
|
+
"cjs",
|
|
34
|
+
"browser",
|
|
35
|
+
"calc.d.ts",
|
|
36
|
+
"a-calc.versions.js",
|
|
37
|
+
"mcp-server/src",
|
|
38
|
+
"mcp-server/package.json",
|
|
39
|
+
"mcp-server/README.md"
|
|
40
|
+
],
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/Autumn-one/a-calc-old.git"
|
|
44
|
+
},
|
|
45
|
+
"keywords": [
|
|
46
|
+
"decimal",
|
|
47
|
+
"math",
|
|
48
|
+
"expression",
|
|
49
|
+
"evaluator",
|
|
50
|
+
"arbitrary",
|
|
51
|
+
"precision",
|
|
52
|
+
"arithmetic",
|
|
53
|
+
"big",
|
|
54
|
+
"number",
|
|
55
|
+
"parser",
|
|
56
|
+
"float",
|
|
57
|
+
"biginteger",
|
|
58
|
+
"bigdecimal",
|
|
59
|
+
"bignumber",
|
|
60
|
+
"bigint",
|
|
61
|
+
"bignum",
|
|
62
|
+
"a-calc",
|
|
63
|
+
"四则运算",
|
|
64
|
+
"数学",
|
|
65
|
+
"运算",
|
|
66
|
+
"浮点数",
|
|
67
|
+
"精度",
|
|
68
|
+
"金融计算"
|
|
69
|
+
],
|
|
70
|
+
"author": "Autumn",
|
|
71
|
+
"bugs": {
|
|
72
|
+
"url": "https://github.com/Autumn-one/a-calc-old/issues"
|
|
73
|
+
},
|
|
74
|
+
"homepage": "https://github.com/Autumn-one/a-calc-old#readme",
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@babel/core": "^7.21.4",
|
|
77
|
+
"@babel/preset-env": "^7.21.4",
|
|
78
|
+
"@codemirror/commands": "^6.10.1",
|
|
79
|
+
"@codemirror/lang-javascript": "^6.2.4",
|
|
80
|
+
"@codemirror/language": "^6.12.1",
|
|
81
|
+
"@codemirror/state": "^6.5.3",
|
|
82
|
+
"@codemirror/theme-one-dark": "^6.1.3",
|
|
83
|
+
"@codemirror/view": "^6.39.8",
|
|
84
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
85
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
86
|
+
"@rollup/plugin-json": "^6.0.1",
|
|
87
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
88
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
89
|
+
"@vitest/coverage-v8": "^2.1.9",
|
|
90
|
+
"a-calc": "^2.2.15",
|
|
91
|
+
"benchmark": "^2.1.4",
|
|
92
|
+
"bignumber.js": "^9.3.1",
|
|
93
|
+
"codemirror": "^6.0.2",
|
|
94
|
+
"cross-env": "^7.0.3",
|
|
95
|
+
"decimal.js": "^10.6.0",
|
|
96
|
+
"fast-deep-equal": "^3.1.3",
|
|
97
|
+
"glob": "^8.1.0",
|
|
98
|
+
"husky": "^9.1.7",
|
|
99
|
+
"json-stringify-safe": "^5.0.1",
|
|
100
|
+
"lodash-es": "^4.17.21",
|
|
101
|
+
"math-expression-evaluator": "^2.0.7",
|
|
102
|
+
"mathjs": "^15.1.0",
|
|
103
|
+
"npm-run-all": "^4.1.5",
|
|
104
|
+
"rollup": "^4.6.0",
|
|
105
|
+
"rollup-plugin-livereload": "^2.0.5",
|
|
106
|
+
"rollup-plugin-serve": "^1.1.0",
|
|
107
|
+
"typescript": "^5.1.6",
|
|
108
|
+
"vitepress": "^1.6.4",
|
|
109
|
+
"vitest": "^2.1.0",
|
|
110
|
+
"vue": "^3.5.25",
|
|
111
|
+
"@uiw/codemirror-themes-all": "^4.25.4"
|
|
112
|
+
},
|
|
113
|
+
"dependencies": {
|
|
114
|
+
"typescript-treasure": "0.0.9",
|
|
115
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
116
|
+
},
|
|
117
|
+
"scripts": {
|
|
118
|
+
"dev": "rollup -c --environment build:dev",
|
|
119
|
+
"dev:w": "rollup -c -w --environment build:dev",
|
|
120
|
+
"build": "run-p gen:version build-test",
|
|
121
|
+
"build-test": "rollup -c --environment build:build & npm run test",
|
|
122
|
+
"build-only": "rollup -c --environment build:build",
|
|
123
|
+
"build:w": "rollup -c -w --environment build:build",
|
|
124
|
+
"build:docs": "pnpm install --frozen-lockfile=false && vitepress build docs",
|
|
125
|
+
"test": "vitest run",
|
|
126
|
+
"test:type": "tsc --noEmit type-check.ts",
|
|
127
|
+
"gen:version": "node gen_version_info.cjs",
|
|
128
|
+
"docs:dev": "vitepress dev docs",
|
|
129
|
+
"docs:build": "vitepress build docs",
|
|
130
|
+
"docs:preview": "vitepress preview docs"
|
|
131
|
+
}
|
|
132
132
|
}
|