a-calc 3.0.0 → 3.0.1

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.
@@ -0,0 +1,10 @@
1
+ function r(r,n){(null==n||n>r.length)&&(n=r.length);for(var t=0,e=Array(n);t<n;t++)e[t]=r[t];return e}function n(r,n,t,e,i,u,a){try{var o=r[u](a),s=o.value}catch(r){return void t(r)}o.done?n(s):Promise.resolve(s).then(e,i)}function t(r){return function(){var t=this,e=arguments;return new Promise(function(i,u){var a=r.apply(t,e);function o(r){n(a,i,u,o,s,"next",r)}function s(r){n(a,i,u,o,s,"throw",r)}o(void 0)})}}function e(r,n){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=p(r))||n){t&&(r=t);var e=0,i=function(){};return{s:i,n:function(){return e>=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(r){throw r},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 u,a=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var r=t.next();return a=r.done,r},e:function(r){o=!0,u=r},f:function(){try{a||null==t.return||t.return()}finally{if(o)throw u}}}}function i(r,n,t){return(n=function(r){var n=function(r,n){if("object"!=typeof r||!r)return r;var t=r[Symbol.toPrimitive];if(void 0!==t){var e=t.call(r,n);if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(r)}(r,"string");return"symbol"==typeof n?n:n+""}(n))in r?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,r}function u(r,n){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);n&&(e=e.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,e)}return t}function a(r){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?u(Object(t),!0).forEach(function(n){i(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):u(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function o(){
2
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
3
+ var r,n,t="function"==typeof Symbol?Symbol:{},e=t.iterator||"@@iterator",i=t.toStringTag||"@@toStringTag";function u(t,e,i,u){var o=e&&e.prototype instanceof c?e:c,l=Object.create(o.prototype);return s(l,"_invoke",function(t,e,i){var u,o,s,c=0,l=i||[],f=!1,p={p:0,n:0,v:r,a:v,f:v.bind(r,4),d:function(n,t){return u=n,o=0,s=r,p.n=t,a}};function v(t,e){for(o=t,s=e,n=0;!f&&c&&!i&&n<l.length;n++){var i,u=l[n],v=p.p,_=u[2];t>3?(i=_===e)&&(s=u[(o=u[4])?5:(o=3,3)],u[4]=u[5]=r):u[0]<=v&&((i=t<2&&v<u[1])?(o=0,p.v=e,p.n=u[1]):v<_&&(i=t<3||u[0]>e||e>_)&&(u[4]=t,u[5]=e,p.n=_,o=0))}if(i||t>1)return a;throw f=!0,e}return function(i,l,_){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&v(l,_),o=l,s=_;(n=o<2?r:s)||!f;){u||(o?o<3?(o>1&&(p.n=-1),v(o,s)):p.n=s:p.v=s);try{if(c=2,u){if(o||(i="next"),n=u[i]){if(!(n=n.call(u,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,o<2&&(o=0)}else 1===o&&(n=u.return)&&n.call(u),o<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),o=1);u=r}else if((n=(f=p.n<0)?s:t.call(e,p))!==a)break}catch(n){u=r,o=1,s=n}finally{c=1}}return{value:n,done:f}}}(t,i,u),!0),l}var a={};function c(){}function l(){}function f(){}n=Object.getPrototypeOf;var p=[][e]?n(n([][e]())):(s(n={},e,function(){return this}),n),v=f.prototype=c.prototype=Object.create(p);function _(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,f):(r.__proto__=f,s(r,i,"GeneratorFunction")),r.prototype=Object.create(v),r}return l.prototype=f,s(v,"constructor",f),s(f,"constructor",l),l.displayName="GeneratorFunction",s(f,i,"GeneratorFunction"),s(v),s(v,i,"Generator"),s(v,e,function(){return this}),s(v,"toString",function(){return"[object Generator]"}),(o=function(){return{w:u,m:_}})()}function s(r,n,t,e){var i=Object.defineProperty;try{i({},"",{})}catch(r){i=0}s=function(r,n,t,e){function u(n,t){s(r,n,function(r){return this._invoke(n,t,r)})}n?i?i(r,n,{value:t,enumerable:!e,configurable:!e,writable:!e}):r[n]=t:(u("next",0),u("throw",1),u("return",2))},s(r,n,t,e)}function c(r,n){return function(r){if(Array.isArray(r))return r}(r)||function(r,n){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,i,u,a,o=[],s=!0,c=!1;try{if(u=(t=t.call(r)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(e=u.call(t)).done)&&(o.push(e.value),o.length!==n);s=!0);}catch(r){c=!0,i=r}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw i}}return o}}(r,n)||p(r,n)||function(){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 l(n){return function(n){if(Array.isArray(n))return r(n)}(n)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(n)||p(n)||function(){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 f(r){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},f(r)}function p(n,t){if(n){if("string"==typeof n)return r(n,t);var e={}.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?r(n,t):void 0}}var v="3.0.1";var _="0123456789",d="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",h="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$[].'\"",g="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",m=new Set(_),y=new Set(d),b=new Set(h),w=new Set(g);new Set("0123456789-+");var x=new Set("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$"),S=new Set(" \n\r\t"),N="initial",E="number",A="scientific",j="operator",O="bracket",k="var",F="symbol",q="percent",M="round",W="plus",P="comma",z="fraction",I="to-number",D="to-number-string",T="fallback_var",Z="integer_padding",$="compact",U="unit_after",R="unit_before",B="unit_middle",C="unit_hide",L="unit_default",H="thousands",V="fmt_group",G="shortcut",K="comparison",J="logical",Q="function",X="range_clamp",Y=new Set([">","<",">=","<=","==","!="]),rr=new Set(["&&","||"]),nr={"|":0,"?":1,":":1,"||":2,"&&":3,"==":4,"!=":4,">":5,"<":5,">=":5,"<=":5,"+":6,"-":6,"*":7,"/":7,"%":7,"//":7,"**":8,"!":9,"unary-":9,"unary+":9},tr=Array.isArray,er="object"==("undefined"==typeof global?"undefined":f(global))&&global&&global.Object===Object&&global,ir="object"==("undefined"==typeof self?"undefined":f(self))&&self&&self.Object===Object&&self,ur=er||ir||Function("return this")(),ar=ur.Symbol,or=Object.prototype,sr=or.hasOwnProperty,cr=or.toString,lr=ar?ar.toStringTag:void 0;var fr=Object.prototype.toString;var pr=ar?ar.toStringTag:void 0;function vr(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":pr&&pr in Object(r)?function(r){var n=sr.call(r,lr),t=r[lr];try{r[lr]=void 0;var e=!0}catch(r){}var i=cr.call(r);return e&&(n?r[lr]=t:delete r[lr]),i}(r):function(r){return fr.call(r)}(r)}function _r(r){return"symbol"==f(r)||function(r){return null!=r&&"object"==f(r)}(r)&&"[object Symbol]"==vr(r)}var dr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hr=/^\w*$/;function gr(r){var n=f(r);return null!=r&&("object"==n||"function"==n)}var mr,yr=ur["__core-js_shared__"],br=(mr=/[^.]+$/.exec(yr&&yr.keys&&yr.keys.IE_PROTO||""))?"Symbol(src)_1."+mr:"";var wr=Function.prototype.toString;var xr=/^\[object .+?Constructor\]$/,Sr=Function.prototype,Nr=Object.prototype,Er=Sr.toString,Ar=Nr.hasOwnProperty,jr=RegExp("^"+Er.call(Ar).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Or(r){if(!gr(r)||(n=r,br&&br in n))return!1;var n,t=function(r){if(!gr(r))return!1;var n=vr(r);return"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n}(r)?jr:xr;return t.test(function(r){if(null!=r){try{return wr.call(r)}catch(r){}try{return r+""}catch(r){}}return""}(r))}function kr(r,n){var t=function(r,n){return null==r?void 0:r[n]}(r,n);return Or(t)?t:void 0}var Fr=kr(Object,"create");var qr=Object.prototype.hasOwnProperty;var Mr=Object.prototype.hasOwnProperty;function Wr(r){var n=-1,t=null==r?0:r.length;for(this.clear();++n<t;){var e=r[n];this.set(e[0],e[1])}}function Pr(r,n){return r===n||r!=r&&n!=n}function zr(r,n){for(var t=r.length;t--;)if(Pr(r[t][0],n))return t;return-1}Wr.prototype.clear=function(){this.__data__=Fr?Fr(null):{},this.size=0},Wr.prototype.delete=function(r){var n=this.has(r)&&delete this.__data__[r];return this.size-=n?1:0,n},Wr.prototype.get=function(r){var n=this.__data__;if(Fr){var t=n[r];return"__lodash_hash_undefined__"===t?void 0:t}return qr.call(n,r)?n[r]:void 0},Wr.prototype.has=function(r){var n=this.__data__;return Fr?void 0!==n[r]:Mr.call(n,r)},Wr.prototype.set=function(r,n){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Fr&&void 0===n?"__lodash_hash_undefined__":n,this};var Ir=Array.prototype.splice;function Dr(r){var n=-1,t=null==r?0:r.length;for(this.clear();++n<t;){var e=r[n];this.set(e[0],e[1])}}Dr.prototype.clear=function(){this.__data__=[],this.size=0},Dr.prototype.delete=function(r){var n=this.__data__,t=zr(n,r);return!(t<0)&&(t==n.length-1?n.pop():Ir.call(n,t,1),--this.size,!0)},Dr.prototype.get=function(r){var n=this.__data__,t=zr(n,r);return t<0?void 0:n[t][1]},Dr.prototype.has=function(r){return zr(this.__data__,r)>-1},Dr.prototype.set=function(r,n){var t=this.__data__,e=zr(t,r);return e<0?(++this.size,t.push([r,n])):t[e][1]=n,this};var Tr=kr(ur,"Map");function Zr(r,n){var t,e,i=r.__data__;return("string"==(e=f(t=n))||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t)?i["string"==typeof n?"string":"hash"]:i.map}function $r(r){var n=-1,t=null==r?0:r.length;for(this.clear();++n<t;){var e=r[n];this.set(e[0],e[1])}}$r.prototype.clear=function(){this.size=0,this.__data__={hash:new Wr,map:new(Tr||Dr),string:new Wr}},$r.prototype.delete=function(r){var n=Zr(this,r).delete(r);return this.size-=n?1:0,n},$r.prototype.get=function(r){return Zr(this,r).get(r)},$r.prototype.has=function(r){return Zr(this,r).has(r)},$r.prototype.set=function(r,n){var t=Zr(this,r),e=t.size;return t.set(r,n),this.size+=t.size==e?0:1,this};function Ur(r,n){if("function"!=typeof r||null!=n&&"function"!=typeof n)throw new TypeError("Expected a function");var t=function(){var e=arguments,i=n?n.apply(this,e):e[0],u=t.cache;if(u.has(i))return u.get(i);var a=r.apply(this,e);return t.cache=u.set(i,a)||u,a};return t.cache=new(Ur.Cache||$r),t}Ur.Cache=$r;var Rr,Br,Cr,Lr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Hr=/\\(\\)?/g,Vr=(Rr=function(r){var n=[];return 46===r.charCodeAt(0)&&n.push(""),r.replace(Lr,function(r,t,e,i){n.push(e?i.replace(Hr,"$1"):t||r)}),n},Br=Ur(Rr,function(r){return 500===Cr.size&&Cr.clear(),r}),Cr=Br.cache,Br);var Gr=ar?ar.prototype:void 0,Kr=Gr?Gr.toString:void 0;function Jr(r){if("string"==typeof r)return r;if(tr(r))return function(r,n){for(var t=-1,e=null==r?0:r.length,i=Array(e);++t<e;)i[t]=n(r[t],t,r);return i}(r,Jr)+"";if(_r(r))return Kr?Kr.call(r):"";var n=r+"";return"0"==n&&1/r==-1/0?"-0":n}function Qr(r,n){return tr(r)?r:function(r,n){if(tr(r))return!1;var t=f(r);return!("number"!=t&&"symbol"!=t&&"boolean"!=t&&null!=r&&!_r(r))||hr.test(r)||!dr.test(r)||null!=n&&r in Object(n)}(r,n)?[r]:Vr(function(r){return null==r?"":Jr(r)}(r))}function Xr(r){if("string"==typeof r||_r(r))return r;var n=r+"";return"0"==n&&1/r==-1/0?"-0":n}function Yr(r,n,t){var e=null==r?void 0:function(r,n){for(var t=0,e=(n=Qr(n,r)).length;null!=r&&t<e;)r=r[Xr(n[t++])];return t&&t==e?r:void 0}(r,n);return void 0===e?t:e}var rn=/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,nn=/^([+-]?[\d.]+)(.*)$/;function tn(r){if(null==r)return{num:void 0,unit:void 0};var n,t,e=(r="string"!=typeof r?r.toString():r).match(rn)||r.match(nn);if(e){t=e[1];var i=e[2];""!==i.trim()&&(n=i)}return{num:t,unit:n}}function en(r,n,t){var e,i,u,a;return Array.isArray(r)?r.length>1?null!==(e=null!==(i=Yr(r[0],n))&&void 0!==i?i:Yr(r.at(-1),n))&&void 0!==e?e:t:1===r.length&&null!==(u=Yr(r[0],n))&&void 0!==u?u:t:null!==(a=Yr(r,n,t))&&void 0!==a?a:t}function un(r,n,t,e){if(+t>1e4)throw new Error("小数位数(".concat(t,")超出安全上限 ").concat(1e4));var i=r.split("."),u=i[0],a=1===i.length?"":i[1],o=function(r,n,t,e,i){var u=r.startsWith("-"),a=u?r.slice(1):r,o=a,s=n,c=n.length;function l(){o=(BigInt(o)+1n).toString()}function f(r){return(BigInt("9".concat(r))+1n).toString().slice(1)}var p={"~-":function(){var r="<"===t?e-1:e;s=n.slice(0,r)},"~+":function(){var r="<"===t?e-1:e;if(!(c<=r||0===c)){var i=n.slice(0,r);0===+n.slice(r,c)?s=i:(i=f(i)).length>r?(s=i.slice(1,i.length),l()):s=i}},"~5":function(){if(0!==c){var r="<"===t?e-1:e;s=n.slice(0,r);var i=+n[r];Number.isNaN(i)||i>=5&&(s=f(s)).length>r&&(s=s.slice(1,s.length),l())}},"~6":function(){if(0!==c){var r,i="<"===t?e-1:e,u=+n[i],o=n.slice(+i+1,n.length);o=""===o?0:parseInt(o),r=0===i?+a[a.length-1]:+n[i-1],s=n.slice(0,i),(u>=6||5===u&&o>0||5===u&&r%2!=0)&&(s=f(s)).length>i&&(s=s.slice(1,s.length),l())}}};return"<="===t?c<=e?s=n.replace(/0*$/,""):(p[i]&&p[i](),s=s.replace(/0+$/,"")):"<"===t?c<e?s=n.replace(/0*$/,""):(p[i]&&p[i](),s=s.replace(/0+$/,"")):"="===t?c<e?s=n+"0".repeat(e-c):c>e&&p[i]&&p[i]():">="===t?c<e&&(s=n+"0".repeat(e-c)):">"===t&&c<=e&&(s=n+"0".repeat(e-c+1)),{int_part:u?"-".concat(o):o,dec_part:s}}(u,a,n,+t,e);return u=o.int_part,""===(a=o.dec_part)?u:"".concat(u,".").concat(a)}function an(r){for(var n=r.length,t="";n>0;)t=r.substring(n-3,n)+(""!==t?",":"")+t,n-=3;return t}function on(r){var n=r.split("."),t=n[0];return"-"===t[0]?n[0]="-"+an(t.slice(1)):n[0]=an(t),n.join(".")}function sn(r,n){if(Array.isArray(r)){for(var t,e=0,i=r.length;e<i;e++){var u;if(void 0!==(t=null!==(u=Yr(r[e],n))&&void 0!==u?u:void 0))break}if(void 0===t)throw new Error("填充变量".concat(n,"失败"));return t}var a;return null!==(a=Yr(r,n))&&void 0!==a?a:void 0}function cn(r,n,t){return t&&"function"==typeof t._empty_check?t._empty_check(r,n):t&&Array.isArray(t._empty_values)?t._empty_values.some(function(n){return!(!Number.isNaN(n)||!Number.isNaN(r))||r===n}):null==r}function ln(r,n,t){for(var e=0;e<n.length;e++){var i=n[e].trim(),u=void 0;try{if(Array.isArray(r))for(var a=0;a<r.length;a++){var o=Yr(r[a],i);if(void 0!==o){u=o;break}}else u=Yr(r,i)}catch(r){continue}if(!cn(u,i,t))return{value:u,path:i}}throw new Error("多路取值失败,所有路径均为空值: ".concat(n.join(" | ")))}function fn(r,n,t){var e;for(n++;n<t;){if(e=r[n],!S.has(e))return e;n++}}function pn(r,n){return r&&r.startsWith("@")?sn(n,r.slice(1)):r}function vn(r,n,t,e,i){n===k||n===Z&&d.includes(t[0])?(i.has_var=!0,r.push({type:n,value:t,real_value:sn(i.fill_data,t)})):r.push({type:n,value:t}),e.prev=e.curr,i.state=N}function _n(r,n){for(var t,i={prev:0,curr:0},u=r.length,a={state:N,fill_data:n,has_var:!1},o=[];i.curr<u;)switch(t=r[i.curr],a.state){case N:if(" "===t)i.curr++,i.prev=i.curr;else if("<>=".includes(t))a.state=F,i.curr++;else if(","===t)i.curr++,vn(o,P,",",i,a);else if(d.includes(t))a.state=k,i.curr++;else if(_.includes(t))a.state=E,i.curr++;else if("+"===t)i.curr++,vn(o,W,"+",i,a);else if("~"===t)i.curr++,a.state=M;else if("%"===t)i.curr++,vn(o,q,"%",i,a);else if("/"===t)i.curr++,vn(o,z,"/",i,a);else if("!"===t)if(a.state=N,i.curr++,"n"===r[i.curr])i.curr++,vn(o,I,"!n",i,a);else if("u"===r[i.curr]){i.curr++;var s=r[i.curr];if("a"===s||"b"===s||"m"===s){if(i.curr++,":"===r[i.curr]){i.curr++;for(var c=i.curr;i.curr<u&&" "!==r[i.curr];)i.curr++;var l=r.slice(c,i.curr).split(":"),f=pn(l[0],a.fill_data),p=l[1]?pn(l[1],a.fill_data):null;(l[0].startsWith("@")||l[1]&&l[1].startsWith("@"))&&(a.has_var=!0);var v={a:U,b:R,m:B};o.push({type:v[s],value:"!u".concat(s),unit:f,input_unit:p})}else{var g={a:U,b:R,m:B};o.push({type:g[s],value:"!u".concat(s),unit:null,input_unit:null,use_default:!0})}i.prev=i.curr,a.state=N}else if("h"===s){if(i.curr++,":"===r[i.curr]){i.curr++;for(var m=i.curr;i.curr<u&&" "!==r[i.curr];)i.curr++;var y=r.slice(m,i.curr).split(":"),b=pn(y[0],a.fill_data),w=y[1]?pn(y[1],a.fill_data):null;(y[0].startsWith("@")||y[1]&&y[1].startsWith("@"))&&(a.has_var=!0),o.push({type:C,value:"!uh",unit:b,input_unit:w})}else{var x=In("_unit_default_out");if(x){var S=Array.isArray(x)?x[0]:x;o.push({type:C,value:"!uh",unit:S,input_unit:null})}else o.push({type:D,value:"!uh"})}i.prev=i.curr,a.state=N}else if(":"===r[i.curr]){i.curr++;for(var j=i.curr;i.curr<u&&" "!==r[i.curr];)i.curr++;var O=r.slice(j,i.curr).split(":"),T=pn(O[0],a.fill_data),K=O[1]?pn(O[1],a.fill_data):null;(O[0].startsWith("@")||O[1]&&O[1].startsWith("@"))&&(a.has_var=!0),o.push({type:L,value:"!u",unit:T,input_unit:K}),i.prev=i.curr,a.state=N}else{var J=In("_unit_default_out");if(J){var Q=Array.isArray(J)?J[0]:J;o.push({type:L,value:"!u",unit:Q,input_unit:null}),i.prev=i.curr,a.state=N}else vn(o,D,"!u",i,a)}}else if("e"===r[i.curr])i.curr++,vn(o,A,"!e",i,a);else if("c"===r[i.curr]){i.curr++;var Y=null;if(":"===r[i.curr]){i.curr++;for(var rr=i.curr;i.curr<u&&/[a-zA-Z0-9_]/.test(r[i.curr]);)i.curr++;Y=r.slice(rr,i.curr)}o.push({type:$,value:"!c",preset:Y}),i.prev=i.curr,a.state=N}else if("i"===r[i.curr]){if(i.curr++,":"!==r[i.curr])throw new Error("!i 语法需要指定位数,格式: !i:n");i.curr++;var nr=i.curr;if("@"===r[i.curr]){for(i.curr++;i.curr<u&&h.includes(r[i.curr]);)i.curr++;var tr=r.slice(nr+1,i.curr),er=sn(a.fill_data,tr);a.has_var=!0,o.push({type:Z,value:tr,real_value:er})}else{for(;i.curr<u&&_.includes(r[i.curr]);)i.curr++;var ir=r.slice(nr,i.curr);o.push({type:Z,value:ir})}i.prev=i.curr,a.state=N}else if("t"===r[i.curr])if(i.curr++,":"!==r[i.curr])o.push({type:H,value:"!t",preset:"default"}),i.prev=i.curr,a.state=N;else{i.curr++;var ur=i.curr;if("@"===r[i.curr]){for(i.curr++;i.curr<u&&h.includes(r[i.curr]);)i.curr++;var ar=r.slice(ur+1,i.curr),or=sn(a.fill_data,ar);a.has_var=!0,o.push({type:H,value:"!t",preset:or,preset_var:ar})}else{for(;i.curr<u&&/[a-zA-Z0-9_]/.test(r[i.curr]);)i.curr++;var sr=r.slice(ur,i.curr);o.push({type:H,value:"!t",preset:sr})}i.prev=i.curr,a.state=N}else{if("g"!==r[i.curr])throw new Error("无法识别的!模式字符:".concat(r[i.curr]));if(i.curr++,":"!==r[i.curr])throw new Error("!g 语法需要指定分组名称,格式: !g:name");if(i.curr++,"@"===r[i.curr]){i.curr++;for(var cr=i.curr;i.curr<u&&h.includes(r[i.curr]);)i.curr++;var lr=r.slice(cr,i.curr),fr=sn(a.fill_data,lr);a.has_var=!0,o.push({type:V,value:"!g",group_name:fr,var_path:lr})}else{for(var pr=i.curr;i.curr<u&&/[a-zA-Z0-9_]/.test(r[i.curr]);)i.curr++;var vr=r.slice(pr,i.curr);o.push({type:V,value:"!g",group_name:vr})}i.prev=i.curr,a.state=N}else if("#"===t)if(i.curr++,"@"===r[i.curr]){i.curr++;for(var _r=i.curr;i.curr<u&&h.includes(r[i.curr]);)i.curr++;var dr=r.slice(_r,i.curr),hr=sn(a.fill_data,dr);a.has_var=!0,o.push({type:V,value:"#",group_name:hr,var_path:dr}),i.prev=i.curr,a.state=N}else{for(var gr=i.curr;i.curr<u&&/[a-zA-Z0-9_]/.test(r[i.curr]);)i.curr++;var mr=r.slice(gr,i.curr);mr?(o.push({type:V,value:"#",group_name:mr}),i.prev=i.curr,a.state=N):(i.prev=i.curr,a.state=N)}else if("["===t){for(i.curr++;i.curr<u&&" "===r[i.curr];)i.curr++;var yr=i.curr,br=void 0;if("@"===r[i.curr]){for(i.curr++;i.curr<u&&/[a-zA-Z0-9_$.]/.test(r[i.curr]);)i.curr++;var wr=r.slice(yr+1,i.curr);br=sn(a.fill_data,wr),a.has_var=!0}else{for("-"!==r[i.curr]&&"+"!==r[i.curr]||i.curr++;i.curr<u&&(_.includes(r[i.curr])||"."===r[i.curr]);)i.curr++;br=r.slice(yr,i.curr)}for(;i.curr<u&&" "===r[i.curr];)i.curr++;for(","===r[i.curr]&&i.curr++;i.curr<u&&" "===r[i.curr];)i.curr++;var xr=i.curr,Sr=void 0;if("@"===r[i.curr]){for(i.curr++;i.curr<u&&/[a-zA-Z0-9_$.]/.test(r[i.curr]);)i.curr++;var Nr=r.slice(xr+1,i.curr);Sr=sn(a.fill_data,Nr),a.has_var=!0}else{for("-"!==r[i.curr]&&"+"!==r[i.curr]||i.curr++;i.curr<u&&(_.includes(r[i.curr])||"."===r[i.curr]);)i.curr++;Sr=r.slice(xr,i.curr)}for(;i.curr<u&&" "===r[i.curr];)i.curr++;"]"===r[i.curr]&&i.curr++,o.push({type:X,min:""===br?null:br,max:""===Sr?null:Sr}),i.prev=i.curr,a.state=N}else":"===t?(a.state=G,i.curr++):(i.curr++,i.prev=i.curr);break;case F:"="===t&&i.curr++,vn(o,F,r.slice(i.prev,i.curr),i,a);break;case E:_.includes(t)?i.curr++:vn(o,E,r.slice(i.prev,i.curr),i,a);break;case k:h.includes(t)?i.curr++:vn(o,k,r.slice(i.prev,i.curr),i,a);break;case M:if(!("56+-".includes(t)&&i.curr-i.prev<2))throw new Error("错误的舍入语法:".concat(r.slice(i.prev,i.curr+1)));i.curr++,vn(o,M,r.slice(i.prev,i.curr),i,a);break;case Z:if(_.includes(t))i.curr++;else if(h.includes(t))i.curr++;else{var Er=r.slice(i.prev,i.curr);d.includes(Er[0])?(a.has_var=!0,o.push({type:Z,value:Er,real_value:sn(a.fill_data,Er)})):vn(o,Z,Er,i,a),i.prev=i.curr,a.state=N}break;case G:for(var Ar=i.curr,jr=new Set([",","=","+","<",">","~","!","[","/","%","-"]);i.curr<u&&" "!==r[i.curr]&&!jr.has(r[i.curr]);)i.curr++;var Or=r.slice(Ar,i.curr);if(!Or){i.prev=i.curr,a.state=N;break}var kr,Fr=In("_shortcut_prefix")||"!u",qr=_n("".concat(Fr,":").concat(Or),a.fill_data),Mr=e(qr);try{for(Mr.s();!(kr=Mr.n()).done;){var Wr=kr.value;o.push(Wr)}}catch(r){Mr.e(r)}finally{Mr.f()}qr.has_var&&(a.has_var=!0),i.prev=i.curr,a.state=N;break;default:throw new Error("错误的fmt分词器状态")}return i.prev<i.curr&&vn(o,a.state,r.slice(i.prev,i.curr),i,a),o.has_var=a.has_var,o}var dn=new Set(["<",">","=",">=","<="]),hn=new Set(["~+","~-","~5","~6"]);function gn(r,n){return r&&r.startsWith("@")?sn(n,r.slice(1)):r}function mn(r,n,t){var e=function(r,n){var t=n.scope;if(","===r)return{type:P,value:","};if(dn.has(r))return{type:F,value:r};if(!Number.isNaN(Number(r)))return{type:E,value:r};if(g.includes(r[0]))return t.has_var=!0,{type:k,value:r,real_value:sn(t.fill_data,r)};if("%"===r)return{type:q,value:r};if("/"===r)return{type:z,value:r};if("+"===r)return{type:W,value:r};if(hn.has(r))return{type:M,value:r};if("!n"===r)return{type:I,value:r};if("!u"===r)return{type:D,value:r};if("!uh"===r)return{type:D,value:r};if(r.startsWith("!uh:")){var e=r.slice(4).split(":"),i=gn(e[0],t.fill_data),u=e[1]?gn(e[1],t.fill_data):null;return(e[0].startsWith("@")||e[1]&&e[1].startsWith("@"))&&(t.has_var=!0),{type:C,value:"!uh",unit:i,input_unit:u}}if(r.startsWith("!u:")){var a=r.slice(3).split(":"),o=gn(a[0],t.fill_data),s=a[1]?gn(a[1],t.fill_data):null;return(a[0].startsWith("@")||a[1]&&a[1].startsWith("@"))&&(t.has_var=!0),{type:L,value:"!u",unit:o,input_unit:s}}if(r.startsWith("!ua:")||r.startsWith("!ub:")||r.startsWith("!um:")){var c=r[2],l=r.slice(4).split(":"),f=gn(l[0],t.fill_data),p=l[1]?gn(l[1],t.fill_data):null;return(l[0].startsWith("@")||l[1]&&l[1].startsWith("@"))&&(t.has_var=!0),{type:{a:U,b:R,m:B}[c],value:"!u".concat(c),unit:f,input_unit:p}}if("!ua"===r||"!ub"===r||"!um"===r){var v=r[2];return"b"===v?null:{type:{a:U,m:B}[v],value:"!u".concat(v),unit:null,input_unit:null,use_default:!0}}if("!e"===r)return{type:A,value:r};if("!c"===r||r.startsWith("!c:")){var _=r.startsWith("!c:")?r.slice(3):null;return{type:$,value:"!c",preset:_}}if(r.startsWith("!i:")){var d=r.slice(3);if(d.startsWith("@")){var h=d.slice(1),m=sn(t.fill_data,h);return t.has_var=!0,{type:Z,value:h,real_value:m}}return{type:Z,value:d}}if("!t"===r||r.startsWith("!t:")){if("!t"===r)return{type:H,value:"!t",preset:"default"};var y=r.slice(3);if(y.startsWith("@")){var b=y.slice(1),w=sn(t.fill_data,b);return t.has_var=!0,{type:H,value:"!t",preset:w,preset_var:b}}return{type:H,value:"!t",preset:y}}if(r.startsWith("!g:")){var x=r.slice(3);if(x.startsWith("@")){var S=x.slice(1),N=sn(t.fill_data,S);return t.has_var=!0,{type:V,value:"!g",group_name:N,var_path:S}}return{type:V,value:"!g",group_name:x}}if(r.startsWith("#")){var j=r.slice(1);if(j.startsWith("@")){var O=j.slice(1),T=sn(t.fill_data,O);return t.has_var=!0,"number"==typeof T||/^\d+$/.test(String(T))?{type:Z,value:O,real_value:T}:{type:V,value:"#",group_name:T,var_path:O}}j.startsWith("=")&&(j=j.slice(1));var G=/^\d+$/.test(j),K=g.includes(j[0]);return G||K?K?(t.has_var=!0,{type:Z,value:j,real_value:sn(t.fill_data,j)}):{type:Z,value:j}:{type:V,value:"#",group_name:j}}if(r.startsWith("[")&&r.endsWith("]")){var J=r.slice(1,-1).split(","),Q=null,Y=null;if(J[0]){var rr=J[0].trim();if(rr.startsWith("@")){var nr=rr.slice(1);Q=sn(t.fill_data,nr),t.has_var=!0}else Q=rr}if(J[1]){var tr=J[1].trim();if(tr.startsWith("@")){var er=tr.slice(1);Y=sn(t.fill_data,er),t.has_var=!0}else Y=tr}return{type:X,min:Q,max:Y}}throw new Error("无法识别的格式化字符: ".concat(r))}(n,{scope:t});e&&r.push(e)}function yn(r,n){for(var t,e=0,i=r.length,u={fill_data:n,has_var:!1},a=0,o=[];e<i;)" "===(t=r[e])?(e>a&&mn(o,r.slice(a,e),u),a=e+1):"<>=".includes(t)&&("="===r[e+1]?(o.push({type:F,value:t+"="}),a=1+ ++e):(o.push({type:F,value:t}),a=e+1)),e++;return a<e&&mn(o,r.slice(a,e),u),o.has_var=u.has_var,o}var bn={_debug_console:!0,_error:"-",_angle_unit:"deg",_builtin_functions:{},_compute_mode:"decimal",_div_precision:20,_default_round:void 0,_fmt:void 0,_fmt_parsed:void 0,_compact:{},_compact_default:void 0,_fmt_groups:{},_fmt_groups_parsed:{},_thousands:{},_thousands_default:void 0,_unit_convert_out:void 0,_unit_convert_in:void 0,_unit_default_out:void 0,_unit_default_in:void 0,_unit_position_map:void 0,_unit_default_position:void 0,_unit_thousands_map:void 0,_unit_compact_map:void 0,_shortcut_prefix:"!u",_empty_values:void 0,_empty_check:void 0};function wn(r){return Array.isArray(r)?r.map(wn):Fn(r)?Object.fromEntries(Object.entries(r).map(function(r){var n=c(r,2);return[n[0],wn(n[1])]})):r}var xn,Sn,Nn=Object.fromEntries(Object.entries(bn).map(function(r){var n=c(r,2);return[n[0],wn(n[1])]})),En={_unit_compact_map:{},_unit_thousands_map:{},_unit_position_map:{}},An=!1,jn=new Set(["decimal","bigint","wasm"]),On={};function kn(r,n){On[r]||(On[r]=[]),On[r].push(n)}function Fn(r){return null!==r&&"object"===f(r)&&!Array.isArray(r)}function qn(r,n){if(r||n){for(var t={},e=0,i=[r,n];e<i.length;e++){var u=i[e];if(u)for(var o=0,s=Object.entries(u);o<s.length;o++){var l=c(s[o],2),f=l[0],p=l[1];Fn(p)&&Fn(t[f])?t[f]=a(a({},t[f]),p):Fn(p)?t[f]=a({},p):t[f]=p}}return t}}function Mn(r,n){var t=a(a({},r),n);return Object.keys(t).length>0?t:void 0}function Wn(){var r=qn(xn,Sn),n=function(r){var n={},t={},e={};if(!r)return{thousands:n,positions:t,compacts:e};for(var i in r){var u=r[i];if("object"===f(u)&&null!==u)for(var a in u._thousands&&!n[i]&&(n[i]=u._thousands),u._position&&!t[i]&&(t[i]=u._position),u._compact&&!e[i]&&(e[i]=u._compact),u)if(!a.startsWith("_")){var o=u[a];"object"===f(o)&&null!==o&&(o._thousands&&!n[i]&&(n[i]=o._thousands),o._position&&!t[i]&&(t[i]=o._position),o._compact&&!e[i]&&(e[i]=o._compact))}}return{thousands:n,positions:t,compacts:e}}(r);Nn._unit_convert_out=r,Nn._unit_convert_in=void 0,Nn._unit_thousands_map=Mn(n.thousands,En._unit_thousands_map),Nn._unit_position_map=Mn(n.positions,En._unit_position_map),Nn._unit_compact_map=Mn(n.compacts,En._unit_compact_map)}var Pn=new Set(["_unit_convert_out","_unit_convert_in","_builtin_functions","_compact","_thousands","_unit_compact_map","_unit_thousands_map","_unit_position_map","_fmt_groups"]);function zn(r){if(r&&"object"===f(r))for(var n=function(){var n=e[t],i=r[n];if(Pn.has(n)&&!Fn(i))return console.warn('a-calc: 配置项 "'.concat(n,'" 需要普通对象,已忽略无效值')),0;if("_unit_convert_out"===n&&"object"===f(i))return xn=i,Wn(),0;if("_unit_convert_in"===n&&"object"===f(i)&&null!==i){var u=function(r){if(!r)return null;var n={};for(var t in r){var e=r[t];for(var i in e){var u=e[i];if(n[i]||(n[i]={}),"object"===f(u)&&null!==u){u._thousands&&!n[i]._thousands&&(n[i]._thousands=u._thousands),u._position&&!n[i]._position&&(n[i]._position=u._position),u._compact&&!n[i]._compact&&(n[i]._compact=u._compact);for(var a={},o=0,s=["fn","mul","div","plus","minus","add","sub"];o<s.length;o++){var c=s[o];void 0!==u[c]&&(a[c]=u[c])}Object.keys(a).length>0&&(n[i][t]=a)}else n[i][t]=u}}return n}(i);return Sn=qn(Sn,u),Wn(),0}if("_builtin_functions"===n&&"object"===f(i))An||(bn._builtin_functions=wn(i),An=!0),Object.assign(Nn._builtin_functions,i);else if("_compact"===n&&"object"===f(i))Object.assign(Nn._compact,i);else if("_thousands"===n&&"object"===f(i))Object.assign(Nn._thousands,i);else if("_unit_compact_map"===n&&"object"===f(i))Object.assign(En._unit_compact_map,i),Wn();else if("_unit_thousands_map"===n&&"object"===f(i))Object.assign(En._unit_thousands_map,i),Wn();else if("_unit_position_map"===n&&"object"===f(i))Object.assign(En._unit_position_map,i),Wn();else if("_fmt_groups"===n&&"object"===f(i)){Object.assign(Nn._fmt_groups,i);var a=Nn._fmt_groups;On._fmt_groups&&On._fmt_groups.forEach(function(r){return r(Nn._fmt_groups,a)})}else if("_fmt"===n){var o=Nn._fmt,s=i;o!==s&&(Nn._fmt=s,On._fmt&&On._fmt.forEach(function(r){return r(s,o)}))}else if("_compute_mode"===n){var c=i;if(!jn.has(c))return console.warn("Unknown compute mode: ".concat(c,", available modes: ").concat(l(jn).join(", "))),0;var p=Nn[n];p!==c&&(Nn[n]=c,On[n]&&On[n].forEach(function(r){return r(c,p)}))}else if("_shortcut_prefix"===n){var v=function(r){if("string"!=typeof r)return console.warn("_shortcut_prefix must be a string, got: ".concat(f(r))),null;if(!r.startsWith("!"))return console.warn("_shortcut_prefix must start with '!', got: ".concat(r)),null;var n=r;r.endsWith(":")&&(n=r.slice(0,-1));var t=["!u","!t","!c","!n","!e","!i","!g","!ua","!ub","!um","!uh"];return t.includes(n)?n:(console.warn("_shortcut_prefix must be one of: ".concat(t.join(", "),", got: ").concat(r)),null)}(i);if(!v)return 0;var _=Nn[n],d=v;_!==d&&(Nn[n]=d,On[n]&&On[n].forEach(function(r){return r(d,_)}))}else if(n in Nn){var h=Nn[n],g=i;h!==g&&(Nn[n]=g,On[n]&&On[n].forEach(function(r){return r(g,h)}))}},t=0,e=Object.keys(r);t<e.length;t++)n()}function In(r){return void 0===r?a({},Nn):Nn[r]}function Dn(r){if(void 0===r){xn=void 0,Sn=void 0;for(var n=0,t=Object.values(En);n<t.length;n++)for(var i=t[n],u=0,a=Object.keys(i);u<a.length;u++){delete i[a[u]]}for(var o=Object.keys(Nn),s=function(){var r=l[c],n=Nn[r];Nn[r]=wn(bn[r]),n!==Nn[r]&&On[r]&&On[r].forEach(function(t){return t(Nn[r],n)})},c=0,l=o;c<l.length;c++)s()}else{var f,p=e(Array.isArray(r)?r:[r]);try{var v=function(){var r=f.value;if(r in bn){var n=Nn[r];if("_unit_convert_out"===r)xn=void 0,Wn();else if("_unit_convert_in"===r)Sn=void 0,Wn();else if(r in En){for(var t=En[r],e=0,i=Object.keys(t);e<i.length;e++){delete t[i[e]]}Wn()}else Nn[r]=wn(bn[r]);n!==Nn[r]&&On[r]&&On[r].forEach(function(t){return t(Nn[r],n)})}};for(p.s();!(f=p.n()).done;)v()}catch(r){p.e(r)}finally{p.f()}}}if(kn("_fmt",function(r,n){if(null!=r&&""!==r){if("string"!=typeof r)return console.warn("_fmt must be a string, got: ".concat(f(r))),void(Nn._fmt_parsed=void 0);try{var t=_n(r,null);Nn._fmt_parsed=t}catch(n){console.warn('Failed to parse _fmt: "'.concat(r,'":'),n),Nn._fmt_parsed=void 0}}else Nn._fmt_parsed=void 0}),Nn._fmt)try{var Tn=_n(Nn._fmt,null);Nn._fmt_parsed=Tn}catch(r){console.warn('Failed to parse initial _fmt: "'.concat(Nn._fmt,'":'),r),Nn._fmt_parsed=void 0}function Zn(r){for(var n=0,t=null,e=!1,i=0;i<r.length;i++){var u=r[i];if(null===t)if('"'!==u&&"'"!==u){if("("===u)n++;else if(")"===u)n--;else if("|"===u&&0===n){if(i+1<r.length&&"|"===r[i+1]){i++;continue}return{expr:r.slice(0,i),fmt:r.slice(i+1).trim()}}}else t=u;else e?e=!1:"\\"===u?e=!0:u===t&&(t=null)}return{expr:r,fmt:""}}function $n(r,n){var t,e,i="",u={origin_expr:r,origin_fill_data:n,expr:"",fmt_expr:"",options:void 0,fill_data:void 0,_unit:void 0,_angle_unit:void 0,_empty_values:void 0,_empty_check:void 0,_compact_symbols:void 0,_compact_step:void 0,_thousands:void 0};if(null!=n&&(u.options=n,Array.isArray(n)?u.fill_data=n:u.fill_data=[n]),u._unit=en(n,"_unit",!1),u._angle_unit=en(n,"_angle_unit"),u._empty_values=null!==(t=en(n,"_empty_values"))&&void 0!==t?t:In("_empty_values"),u._empty_check=null!==(e=en(n,"_empty_check"))&&void 0!==e?e:In("_empty_check"),u._compact_symbols=en(n,"_compact_symbols"),u._compact_step=en(n,"_compact_step"),u._thousands=en(n,"_thousands"),"string"==typeof r){if(i=r,""===r.trim()||function(r){for(var n=null,t=!1,e=0;e<r.length;e++){var i=r[e];if(null===n)if('"'!==i&&"'"!==i){if(r.startsWith("NaN",e)){var u=r[e-1],a=r[e+3],o=function(r){return void 0!==r&&/[A-Za-z0-9_$]/.test(r)};if(!o(u)&&!o(a))return!0}}else n=i;else t?t=!1:"\\"===i?t=!0:i===n&&(n=null)}return!1}(r))throw new Error("非法的表达式:".concat(r))}else{if("number"!=typeof r)throw new Error("错误的第一个参数类型: ".concat(r," 类型为:").concat(f(r)));if(isNaN(r))throw new Error("传入了一个非法数字NaN");i=r.toString()}var a=Zn(i),o=a.expr,s=a.fmt;return u.expr=o,u.fmt_expr=s,u}function Un(r){for(var n=new Map,t=[],e=null,i=!1,u=0;u<r.length;u++){var a=r[u];if(null===e)if('"'!==a&&"'"!==a)if("("===a)t.push({start_index:u,pipe_indexes:[]});else if(")"===a){var o=t.pop();if(!o||0===o.pipe_indexes.length)continue;for(var s=[o.start_index].concat(l(o.pipe_indexes),[u]),c=[],f=0;f<s.length-1;f++)c.push(r.slice(s[f]+1,s[f+1]).trim());n.set(o.start_index,{paths:c,end_index:u})}else"|"===a&&t.length>0&&"|"!==r[u-1]&&"|"!==r[u+1]&&t[t.length-1].pipe_indexes.push(u);else e=a;else i?i=!1:"\\"===a?i=!0:a===e&&(e=null)}return n}function Rn(r,n){if("("!==r[n])return null;for(var t=1,e=[],i="",u=n+1,a=null,o=!1;u<r.length&&t>0;){var s=r[u];if(null===a)if('"'!==s&&"'"!==s){if("("===s)t++,i+=s;else if(")"===s){if(0===--t)return i.trim()&&e.push(i.trim()),{args:e,end_index:u};i+=s}else","===s&&1===t?(e.push(i.trim()),i=""):i+=s;u++}else a=s,i+=s,u++;else i+=s,o?o=!1:"\\"===s?o=!0:s===a&&(a=null),u++}return null}function Bn(r,n){if(n.curr_state===E||n.curr_state===A){var t=n.expr.slice(n.prev_index,n.cur_index);if("+"===t||"-"===t)return r.push({type:j,value:t}),n.curr_state=N,void(n.prev_index=n.cur_index);if("."===t[0]?t="0"+t:"-"!==t[0]&&"+"!==t[0]||"."!==t[1]||(t=t[0]+"0"+t.slice(1)),n._unit){var e,i=tn(t),u=i.num,a=i.unit;if(void 0===a)r.push({type:E,value:u,real_value:u,has_unit:!1});else n.has_unit=!0,null!==(e=n.unit_str)&&void 0!==e||(n.unit_str=a),r.push({type:E,value:u,real_value:u,has_unit:!0,unit:a})}else r.push({type:E,value:t,real_value:t,has_unit:!1})}else if(n.curr_state===k){n.has_var=!0;var o=n.expr.slice(n.prev_index,n.cur_index);if("true"===o)r.push({type:"boolean",value:!0});else if("false"===o)r.push({type:"boolean",value:!1});else if(function(r,n){for(var t=n;t<r.length&&" "===r[t];)t++;return t<r.length&&"("===r[t]}(n.expr,n.cur_index)){for(var s=n.cur_index;s<n.expr.length&&" "===n.expr[s];)s++;var c=Rn(n.expr,s);if(c)return r.push({type:Q,value:o,args:c.args}),n.cur_index=c.end_index+1,n.prev_index=n.cur_index,void(n.curr_state=N)}else{var l=sn(n.fill_data,o);if("function"==typeof l){for(var f=n.cur_index;f<n.expr.length&&" "===n.expr[f];)f++;if(f<n.expr.length&&"("===n.expr[f]){var p=Rn(n.expr,f);if(p)return r.push({type:Q,value:o,args:p.args,fn:l}),n.cur_index=p.end_index+1,n.prev_index=n.cur_index,void(n.curr_state=N)}}if(n._unit){var v,_=tn(l),d=_.num,h=_.unit;if(void 0===h)r.push({type:"var",value:o,real_value:d,has_unit:!1});else n.has_unit=!0,null!==(v=n.unit_str)&&void 0!==v||(n.unit_str=h),r.push({type:"var",value:o,real_value:d,has_unit:!0,unit:h})}else r.push({type:"var",value:o,real_value:l,has_unit:!1})}}else r.push({type:n.curr_state,value:n.expr.slice(n.prev_index,n.cur_index)});n.curr_state=N,n.prev_index=n.cur_index}function Cn(r,n,t,e){for(var i,u={has_var:!1,has_unit:!1,unit_str:void 0,fill_data:n,cur_index:0,prev_index:0,curr_state:N,expr:r,_unit:t},a=r.length,o=[],s=Un(r);u.cur_index<a;)switch(i=r[u.cur_index],u.curr_state){case N:if(m.has(i))u.curr_state=E,u.cur_index++;else if("."===i&&m.has(r[u.cur_index+1]))u.curr_state=E,u.cur_index++;else if(" "===i)u.cur_index++,u.prev_index=u.cur_index;else if("+-".includes(i)){var c=o.at(-1);0===u.cur_index||"operator"===(null==c?void 0:c.type)||"comparison"===(null==c?void 0:c.type)||"logical"===(null==c?void 0:c.type)||"logical_not"===(null==c?void 0:c.type)||"ternary_question"===(null==c?void 0:c.type)||"ternary_colon"===(null==c?void 0:c.type)||"("===(null==c?void 0:c.value)||"["===(null==c?void 0:c.value)||","===(null==c?void 0:c.value)?(u.curr_state=E,u.cur_index++):(u.cur_index++,o.push({type:j,value:r.slice(u.prev_index,u.cur_index)}),u.prev_index=u.cur_index)}else if("*/%".includes(i))u.curr_state=j,u.cur_index++;else if(">"===i)u.cur_index++,u.cur_index<a&&"="===r[u.cur_index]?(u.cur_index++,o.push({type:K,value:">="})):o.push({type:K,value:">"}),u.prev_index=u.cur_index;else if("<"===i)u.cur_index++,u.cur_index<a&&"="===r[u.cur_index]?(u.cur_index++,o.push({type:K,value:"<="})):o.push({type:K,value:"<"}),u.prev_index=u.cur_index;else if("="===i&&u.cur_index+1<a&&"="===r[u.cur_index+1])u.cur_index+=2,o.push({type:K,value:"=="}),u.prev_index=u.cur_index;else if("!"===i&&u.cur_index+1<a&&"="===r[u.cur_index+1])u.cur_index+=2,o.push({type:K,value:"!="}),u.prev_index=u.cur_index;else if("&"===i&&u.cur_index+1<a&&"&"===r[u.cur_index+1])u.cur_index+=2,o.push({type:J,value:"&&"}),u.prev_index=u.cur_index;else if("|"===i&&u.cur_index+1<a&&"|"===r[u.cur_index+1])u.cur_index+=2,o.push({type:J,value:"||"}),u.prev_index=u.cur_index;else if("!"===i)u.cur_index++,o.push({type:"logical_not",value:"!"}),u.prev_index=u.cur_index;else if("?"===i)u.cur_index++,o.push({type:"ternary_question",value:"?"}),u.prev_index=u.cur_index;else if(":"===i)u.cur_index++,o.push({type:"ternary_colon",value:":"}),u.prev_index=u.cur_index;else if("["===i)u.cur_index++,o.push({type:"range_start",value:"["}),u.prev_index=u.cur_index;else if("]"===i)u.cur_index++,o.push({type:"range_end",value:"]"}),u.prev_index=u.cur_index;else if(","===i)u.cur_index++,o.push({type:"comma",value:","}),u.prev_index=u.cur_index;else if(y.has(i))u.curr_state=k,u.cur_index++;else if('"'===i||"'"===i){var l=i;u.cur_index++;for(var f="";u.cur_index<a&&r[u.cur_index]!==l;)"\\"===r[u.cur_index]&&u.cur_index+1<a?(u.cur_index++,f+=r[u.cur_index]):f+=r[u.cur_index],u.cur_index++;u.cur_index++,o.push({type:"string",value:f}),u.prev_index=u.cur_index}else if("("===i){var p=s.get(u.cur_index);if(p){u.has_var=!0;var v=ln(n,p.paths,e),_=v.value,d=v.path;if(t){var h,g=tn(_),w=g.num,S=g.unit;if(void 0!==S)u.has_unit=!0,null!==(h=u.unit_str)&&void 0!==h||(u.unit_str=S),o.push({type:T,value:p.paths,real_value:w,matched_path:d,has_unit:!0,unit:S});else o.push({type:T,value:p.paths,real_value:w,matched_path:d,has_unit:!1})}else o.push({type:T,value:p.paths,real_value:_,matched_path:d,has_unit:!1});u.cur_index=p.end_index+1,u.prev_index=u.cur_index}else o.push({type:O,value:i}),u.curr_state=N,u.cur_index++,u.prev_index=u.cur_index}else")"===i?(o.push({type:O,value:i}),u.curr_state=N,u.cur_index++,u.prev_index=u.cur_index):(u.cur_index++,u.prev_index=u.cur_index);break;case E:if(m.has(i))u.cur_index++;else if("."===i){if(u.cur_index===u.prev_index||r.slice(u.prev_index,u.cur_index).includes("."))throw new Error("非法的小数部分".concat(r.slice(u.prev_index,u.cur_index)));u.cur_index++}else"e"===i?(u.curr_state=A,u.cur_index++):t?"*/+-() ".indexOf(i)>-1||">"===i||"<"===i||"="===i||"!"===i||"&"===i||"|"===i||"?"===i||":"===i||"["===i||"]"===i||","===i||"%"===i&&m.has(r[u.cur_index-1])&&x.has(fn(r,u.cur_index,a))?Bn(o,u):u.cur_index++:Bn(o,u);break;case j:var F=r[u.cur_index-1];"*"===i&&"*"===F?(u.cur_index++,o.push({type:j,value:"**"}),u.prev_index=u.cur_index):"/"===i&&"/"===F?(u.cur_index++,o.push({type:j,value:"//"}),u.prev_index=u.cur_index):(o.push({type:j,value:F}),u.prev_index=u.cur_index),u.curr_state=N;break;case k:b.has(i)?u.cur_index++:Bn(o,u);break;case A:if(m.has(i))u.cur_index++;else if("+-".includes(i)){var q=u.prev_index;"+-".includes(r[q])&&(q+=1);var M=r.slice(q,u.cur_index),W=M.at(-1);M.includes(i)||"e"!==W?Bn(o,u):u.cur_index++}else t&&-1==="*/+-() ".indexOf(i)&&">"!==i&&"<"!==i&&"="!==i&&"!"!==i&&"&"!==i&&"|"!==i&&"?"!==i&&":"!==i&&"["!==i&&"]"!==i&&","!==i?u.cur_index++:Bn(o,u);break;default:throw new Error("字符扫描状态错误")}return u.prev_index<u.cur_index&&Bn(o,u),o.has_var=u.has_var,o.has_unit=u.has_unit,o.unit=u.unit_str,o}
4
+ /*!
5
+ * decimal.js v10.6.0
6
+ * An arbitrary-precision Decimal type for JavaScript.
7
+ * https://github.com/MikeMcl/decimal.js
8
+ * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
9
+ * MIT Licence
10
+ */var Ln,Hn,Vn=9e15,Gn=1e9,Kn="0123456789abcdef",Jn="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Qn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Xn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Vn,maxE:Vn,crypto:!1},Yn=!0,rt="[DecimalError] ",nt=rt+"Invalid argument: ",tt=rt+"Precision limit exceeded",et=rt+"crypto unavailable",it="[object Decimal]",ut=Math.floor,at=Math.pow,ot=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,st=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,ct=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,lt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ft=1e7,pt=Jn.length-1,vt=Qn.length-1,_t={toStringTag:it};function dt(r){var n,t,e,i=r.length-1,u="",a=r[0];if(i>0){for(u+=a,n=1;n<i;n++)(t=7-(e=r[n]+"").length)&&(u+=At(t)),u+=e;(t=7-(e=(a=r[n])+"").length)&&(u+=At(t))}else if(0===a)return"0";for(;a%10==0;)a/=10;return u+a}function ht(r,n,t){if(r!==~~r||r<n||r>t)throw Error(nt+r)}function gt(r,n,t,e){var i,u,a,o;for(u=r[0];u>=10;u/=10)--n;return--n<0?(n+=7,i=0):(i=Math.ceil((n+1)/7),n%=7),u=at(10,7-n),o=r[i]%u|0,null==e?n<3?(0==n?o=o/100|0:1==n&&(o=o/10|0),a=t<4&&99999==o||t>3&&49999==o||5e4==o||0==o):a=(t<4&&o+1==u||t>3&&o+1==u/2)&&(r[i+1]/u/100|0)==at(10,n-2)-1||(o==u/2||0==o)&&!(r[i+1]/u/100|0):n<4?(0==n?o=o/1e3|0:1==n?o=o/100|0:2==n&&(o=o/10|0),a=(e||t<4)&&9999==o||!e&&t>3&&4999==o):a=((e||t<4)&&o+1==u||!e&&t>3&&o+1==u/2)&&(r[i+1]/u/1e3|0)==at(10,n-3)-1,a}function mt(r,n,t){for(var e,i,u=[0],a=0,o=r.length;a<o;){for(i=u.length;i--;)u[i]*=n;for(u[0]+=Kn.indexOf(r.charAt(a++)),e=0;e<u.length;e++)u[e]>t-1&&(void 0===u[e+1]&&(u[e+1]=0),u[e+1]+=u[e]/t|0,u[e]%=t)}return u.reverse()}_t.absoluteValue=_t.abs=function(){var r=new this.constructor(this);return r.s<0&&(r.s=1),bt(r)},_t.ceil=function(){return bt(new this.constructor(this),this.e+1,2)},_t.clampedTo=_t.clamp=function(r,n){var t=this,e=t.constructor;if(r=new e(r),n=new e(n),!r.s||!n.s)return new e(NaN);if(r.gt(n))throw Error(nt+n);return t.cmp(r)<0?r:t.cmp(n)>0?n:new e(t)},_t.comparedTo=_t.cmp=function(r){var n,t,e,i,u=this,a=u.d,o=(r=new u.constructor(r)).d,s=u.s,c=r.s;if(!a||!o)return s&&c?s!==c?s:a===o?0:!a^s<0?1:-1:NaN;if(!a[0]||!o[0])return a[0]?s:o[0]?-c:0;if(s!==c)return s;if(u.e!==r.e)return u.e>r.e^s<0?1:-1;for(n=0,t=(e=a.length)<(i=o.length)?e:i;n<t;++n)if(a[n]!==o[n])return a[n]>o[n]^s<0?1:-1;return e===i?0:e>i^s<0?1:-1},_t.cosine=_t.cos=function(){var r,n,t=this,e=t.constructor;return t.d?t.d[0]?(r=e.precision,n=e.rounding,e.precision=r+Math.max(t.e,t.sd())+7,e.rounding=1,t=function(r,n){var t,e,i;if(n.isZero())return n;e=n.d.length,e<32?i=(1/It(4,t=Math.ceil(e/3))).toString():(t=16,i="2.3283064365386962890625e-10");r.precision+=t,n=zt(r,1,n.times(i),new r(1));for(var u=t;u--;){var a=n.times(n);n=a.times(a).minus(a).times(8).plus(1)}return r.precision-=t,n}(e,Dt(e,t)),e.precision=r,e.rounding=n,bt(2==Hn||3==Hn?t.neg():t,r,n,!0)):new e(1):new e(NaN)},_t.cubeRoot=_t.cbrt=function(){var r,n,t,e,i,u,a,o,s,c,l=this,f=l.constructor;if(!l.isFinite()||l.isZero())return new f(l);for(Yn=!1,(u=l.s*at(l.s*l,1/3))&&Math.abs(u)!=1/0?e=new f(u.toString()):(t=dt(l.d),(u=((r=l.e)-t.length+1)%3)&&(t+=1==u||-2==u?"0":"00"),u=at(t,1/3),r=ut((r+1)/3)-(r%3==(r<0?-1:2)),(e=new f(t=u==1/0?"5e"+r:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+r)).s=l.s),a=(r=f.precision)+3;;)if(c=(s=(o=e).times(o).times(o)).plus(l),e=yt(c.plus(l).times(o),c.plus(s),a+2,1),dt(o.d).slice(0,a)===(t=dt(e.d)).slice(0,a)){if("9999"!=(t=t.slice(a-3,a+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(bt(e,r+1,1),n=!e.times(e).times(e).eq(l));break}if(!i&&(bt(o,r+1,0),o.times(o).times(o).eq(l))){e=o;break}a+=4,i=1}return Yn=!0,bt(e,r,f.rounding,n)},_t.decimalPlaces=_t.dp=function(){var r,n=this.d,t=NaN;if(n){if(t=7*((r=n.length-1)-ut(this.e/7)),r=n[r])for(;r%10==0;r/=10)t--;t<0&&(t=0)}return t},_t.dividedBy=_t.div=function(r){return yt(this,new this.constructor(r))},_t.dividedToIntegerBy=_t.divToInt=function(r){var n=this.constructor;return bt(yt(this,new n(r),0,1,1),n.precision,n.rounding)},_t.equals=_t.eq=function(r){return 0===this.cmp(r)},_t.floor=function(){return bt(new this.constructor(this),this.e+1,3)},_t.greaterThan=_t.gt=function(r){return this.cmp(r)>0},_t.greaterThanOrEqualTo=_t.gte=function(r){var n=this.cmp(r);return 1==n||0===n},_t.hyperbolicCosine=_t.cosh=function(){var r,n,t,e,i,u=this,a=u.constructor,o=new a(1);if(!u.isFinite())return new a(u.s?1/0:NaN);if(u.isZero())return o;t=a.precision,e=a.rounding,a.precision=t+Math.max(u.e,u.sd())+4,a.rounding=1,(i=u.d.length)<32?n=(1/It(4,r=Math.ceil(i/3))).toString():(r=16,n="2.3283064365386962890625e-10"),u=zt(a,1,u.times(n),new a(1),!0);for(var s,c=r,l=new a(8);c--;)s=u.times(u),u=o.minus(s.times(l.minus(s.times(l))));return bt(u,a.precision=t,a.rounding=e,!0)},_t.hyperbolicSine=_t.sinh=function(){var r,n,t,e,i=this,u=i.constructor;if(!i.isFinite()||i.isZero())return new u(i);if(n=u.precision,t=u.rounding,u.precision=n+Math.max(i.e,i.sd())+4,u.rounding=1,(e=i.d.length)<3)i=zt(u,2,i,i,!0);else{r=(r=1.4*Math.sqrt(e))>16?16:0|r,i=zt(u,2,i=i.times(1/It(5,r)),i,!0);for(var a,o=new u(5),s=new u(16),c=new u(20);r--;)a=i.times(i),i=i.times(o.plus(a.times(s.times(a).plus(c))))}return u.precision=n,u.rounding=t,bt(i,n,t,!0)},_t.hyperbolicTangent=_t.tanh=function(){var r,n,t=this,e=t.constructor;return t.isFinite()?t.isZero()?new e(t):(r=e.precision,n=e.rounding,e.precision=r+7,e.rounding=1,yt(t.sinh(),t.cosh(),e.precision=r,e.rounding=n)):new e(t.s)},_t.inverseCosine=_t.acos=function(){var r=this,n=r.constructor,t=r.abs().cmp(1),e=n.precision,i=n.rounding;return-1!==t?0===t?r.isNeg()?Nt(n,e,i):new n(0):new n(NaN):r.isZero()?Nt(n,e+4,i).times(.5):(n.precision=e+6,n.rounding=1,r=new n(1).minus(r).div(r.plus(1)).sqrt().atan(),n.precision=e,n.rounding=i,r.times(2))},_t.inverseHyperbolicCosine=_t.acosh=function(){var r,n,t=this,e=t.constructor;return t.lte(1)?new e(t.eq(1)?0:NaN):t.isFinite()?(r=e.precision,n=e.rounding,e.precision=r+Math.max(Math.abs(t.e),t.sd())+4,e.rounding=1,Yn=!1,t=t.times(t).minus(1).sqrt().plus(t),Yn=!0,e.precision=r,e.rounding=n,t.ln()):new e(t)},_t.inverseHyperbolicSine=_t.asinh=function(){var r,n,t=this,e=t.constructor;return!t.isFinite()||t.isZero()?new e(t):(r=e.precision,n=e.rounding,e.precision=r+2*Math.max(Math.abs(t.e),t.sd())+6,e.rounding=1,Yn=!1,t=t.times(t).plus(1).sqrt().plus(t),Yn=!0,e.precision=r,e.rounding=n,t.ln())},_t.inverseHyperbolicTangent=_t.atanh=function(){var r,n,t,e,i=this,u=i.constructor;return i.isFinite()?i.e>=0?new u(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(r=u.precision,n=u.rounding,e=i.sd(),Math.max(e,r)<2*-i.e-1?bt(new u(i),r,n,!0):(u.precision=t=e-i.e,i=yt(i.plus(1),new u(1).minus(i),t+r,1),u.precision=r+4,u.rounding=1,i=i.ln(),u.precision=r,u.rounding=n,i.times(.5))):new u(NaN)},_t.inverseSine=_t.asin=function(){var r,n,t,e,i=this,u=i.constructor;return i.isZero()?new u(i):(n=i.abs().cmp(1),t=u.precision,e=u.rounding,-1!==n?0===n?((r=Nt(u,t+4,e).times(.5)).s=i.s,r):new u(NaN):(u.precision=t+6,u.rounding=1,i=i.div(new u(1).minus(i.times(i)).sqrt().plus(1)).atan(),u.precision=t,u.rounding=e,i.times(2)))},_t.inverseTangent=_t.atan=function(){var r,n,t,e,i,u,a,o,s,c=this,l=c.constructor,f=l.precision,p=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&f+4<=vt)return(a=Nt(l,f+4,p).times(.25)).s=c.s,a}else{if(!c.s)return new l(NaN);if(f+4<=vt)return(a=Nt(l,f+4,p).times(.5)).s=c.s,a}for(l.precision=o=f+10,l.rounding=1,r=t=Math.min(28,o/7+2|0);r;--r)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(Yn=!1,n=Math.ceil(o/7),e=1,s=c.times(c),a=new l(c),i=c;-1!==r;)if(i=i.times(s),u=a.minus(i.div(e+=2)),i=i.times(s),void 0!==(a=u.plus(i.div(e+=2))).d[n])for(r=n;a.d[r]===u.d[r]&&r--;);return t&&(a=a.times(2<<t-1)),Yn=!0,bt(a,l.precision=f,l.rounding=p,!0)},_t.isFinite=function(){return!!this.d},_t.isInteger=_t.isInt=function(){return!!this.d&&ut(this.e/7)>this.d.length-2},_t.isNaN=function(){return!this.s},_t.isNegative=_t.isNeg=function(){return this.s<0},_t.isPositive=_t.isPos=function(){return this.s>0},_t.isZero=function(){return!!this.d&&0===this.d[0]},_t.lessThan=_t.lt=function(r){return this.cmp(r)<0},_t.lessThanOrEqualTo=_t.lte=function(r){return this.cmp(r)<1},_t.logarithm=_t.log=function(r){var n,t,e,i,u,a,o,s,c=this,l=c.constructor,f=l.precision,p=l.rounding;if(null==r)r=new l(10),n=!0;else{if(t=(r=new l(r)).d,r.s<0||!t||!t[0]||r.eq(1))return new l(NaN);n=r.eq(10)}if(t=c.d,c.s<0||!t||!t[0]||c.eq(1))return new l(t&&!t[0]?-1/0:1!=c.s?NaN:t?0:1/0);if(n)if(t.length>1)u=!0;else{for(i=t[0];i%10==0;)i/=10;u=1!==i}if(Yn=!1,a=qt(c,o=f+5),e=n?St(l,o+10):qt(r,o),gt((s=yt(a,e,o,1)).d,i=f,p))do{if(a=qt(c,o+=10),e=n?St(l,o+10):qt(r,o),s=yt(a,e,o,1),!u){+dt(s.d).slice(i+1,i+15)+1==1e14&&(s=bt(s,f+1,0));break}}while(gt(s.d,i+=10,p));return Yn=!0,bt(s,f,p)},_t.minus=_t.sub=function(r){var n,t,e,i,u,a,o,s,c,l,f,p,v=this,_=v.constructor;if(r=new _(r),!v.d||!r.d)return v.s&&r.s?v.d?r.s=-r.s:r=new _(r.d||v.s!==r.s?v:NaN):r=new _(NaN),r;if(v.s!=r.s)return r.s=-r.s,v.plus(r);if(c=v.d,p=r.d,o=_.precision,s=_.rounding,!c[0]||!p[0]){if(p[0])r.s=-r.s;else{if(!c[0])return new _(3===s?-0:0);r=new _(v)}return Yn?bt(r,o,s):r}if(t=ut(r.e/7),l=ut(v.e/7),c=c.slice(),u=l-t){for((f=u<0)?(n=c,u=-u,a=p.length):(n=p,t=l,a=c.length),u>(e=Math.max(Math.ceil(o/7),a)+2)&&(u=e,n.length=1),n.reverse(),e=u;e--;)n.push(0);n.reverse()}else{for((f=(e=c.length)<(a=p.length))&&(a=e),e=0;e<a;e++)if(c[e]!=p[e]){f=c[e]<p[e];break}u=0}for(f&&(n=c,c=p,p=n,r.s=-r.s),a=c.length,e=p.length-a;e>0;--e)c[a++]=0;for(e=p.length;e>u;){if(c[--e]<p[e]){for(i=e;i&&0===c[--i];)c[i]=ft-1;--c[i],c[e]+=ft}c[e]-=p[e]}for(;0===c[--a];)c.pop();for(;0===c[0];c.shift())--t;return c[0]?(r.d=c,r.e=xt(c,t),Yn?bt(r,o,s):r):new _(3===s?-0:0)},_t.modulo=_t.mod=function(r){var n,t=this,e=t.constructor;return r=new e(r),!t.d||!r.s||r.d&&!r.d[0]?new e(NaN):!r.d||t.d&&!t.d[0]?bt(new e(t),e.precision,e.rounding):(Yn=!1,9==e.modulo?(n=yt(t,r.abs(),0,3,1)).s*=r.s:n=yt(t,r,0,e.modulo,1),n=n.times(r),Yn=!0,t.minus(n))},_t.naturalExponential=_t.exp=function(){return Ft(this)},_t.naturalLogarithm=_t.ln=function(){return qt(this)},_t.negated=_t.neg=function(){var r=new this.constructor(this);return r.s=-r.s,bt(r)},_t.plus=_t.add=function(r){var n,t,e,i,u,a,o,s,c,l,f=this,p=f.constructor;if(r=new p(r),!f.d||!r.d)return f.s&&r.s?f.d||(r=new p(r.d||f.s===r.s?f:NaN)):r=new p(NaN),r;if(f.s!=r.s)return r.s=-r.s,f.minus(r);if(c=f.d,l=r.d,o=p.precision,s=p.rounding,!c[0]||!l[0])return l[0]||(r=new p(f)),Yn?bt(r,o,s):r;if(u=ut(f.e/7),e=ut(r.e/7),c=c.slice(),i=u-e){for(i<0?(t=c,i=-i,a=l.length):(t=l,e=u,a=c.length),i>(a=(u=Math.ceil(o/7))>a?u+1:a+1)&&(i=a,t.length=1),t.reverse();i--;)t.push(0);t.reverse()}for((a=c.length)-(i=l.length)<0&&(i=a,t=l,l=c,c=t),n=0;i;)n=(c[--i]=c[i]+l[i]+n)/ft|0,c[i]%=ft;for(n&&(c.unshift(n),++e),a=c.length;0==c[--a];)c.pop();return r.d=c,r.e=xt(c,e),Yn?bt(r,o,s):r},_t.precision=_t.sd=function(r){var n,t=this;if(void 0!==r&&r!==!!r&&1!==r&&0!==r)throw Error(nt+r);return t.d?(n=Et(t.d),r&&t.e+1>n&&(n=t.e+1)):n=NaN,n},_t.round=function(){var r=this,n=r.constructor;return bt(new n(r),r.e+1,n.rounding)},_t.sine=_t.sin=function(){var r,n,t=this,e=t.constructor;return t.isFinite()?t.isZero()?new e(t):(r=e.precision,n=e.rounding,e.precision=r+Math.max(t.e,t.sd())+7,e.rounding=1,t=function(r,n){var t,e=n.d.length;if(e<3)return n.isZero()?n:zt(r,2,n,n);t=(t=1.4*Math.sqrt(e))>16?16:0|t,n=n.times(1/It(5,t)),n=zt(r,2,n,n);for(var i,u=new r(5),a=new r(16),o=new r(20);t--;)i=n.times(n),n=n.times(u.plus(i.times(a.times(i).minus(o))));return n}(e,Dt(e,t)),e.precision=r,e.rounding=n,bt(Hn>2?t.neg():t,r,n,!0)):new e(NaN)},_t.squareRoot=_t.sqrt=function(){var r,n,t,e,i,u,a=this,o=a.d,s=a.e,c=a.s,l=a.constructor;if(1!==c||!o||!o[0])return new l(!c||c<0&&(!o||o[0])?NaN:o?a:1/0);for(Yn=!1,0==(c=Math.sqrt(+a))||c==1/0?(((n=dt(o)).length+s)%2==0&&(n+="0"),c=Math.sqrt(n),s=ut((s+1)/2)-(s<0||s%2),e=new l(n=c==1/0?"5e"+s:(n=c.toExponential()).slice(0,n.indexOf("e")+1)+s)):e=new l(c.toString()),t=(s=l.precision)+3;;)if(e=(u=e).plus(yt(a,u,t+2,1)).times(.5),dt(u.d).slice(0,t)===(n=dt(e.d)).slice(0,t)){if("9999"!=(n=n.slice(t-3,t+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(bt(e,s+1,1),r=!e.times(e).eq(a));break}if(!i&&(bt(u,s+1,0),u.times(u).eq(a))){e=u;break}t+=4,i=1}return Yn=!0,bt(e,s,l.rounding,r)},_t.tangent=_t.tan=function(){var r,n,t=this,e=t.constructor;return t.isFinite()?t.isZero()?new e(t):(r=e.precision,n=e.rounding,e.precision=r+10,e.rounding=1,(t=t.sin()).s=1,t=yt(t,new e(1).minus(t.times(t)).sqrt(),r+10,0),e.precision=r,e.rounding=n,bt(2==Hn||4==Hn?t.neg():t,r,n,!0)):new e(NaN)},_t.times=_t.mul=function(r){var n,t,e,i,u,a,o,s,c,l=this,f=l.constructor,p=l.d,v=(r=new f(r)).d;if(r.s*=l.s,!(p&&p[0]&&v&&v[0]))return new f(!r.s||p&&!p[0]&&!v||v&&!v[0]&&!p?NaN:p&&v?0*r.s:r.s/0);for(t=ut(l.e/7)+ut(r.e/7),(s=p.length)<(c=v.length)&&(u=p,p=v,v=u,a=s,s=c,c=a),u=[],e=a=s+c;e--;)u.push(0);for(e=c;--e>=0;){for(n=0,i=s+e;i>e;)o=u[i]+v[e]*p[i-e-1]+n,u[i--]=o%ft|0,n=o/ft|0;u[i]=(u[i]+n)%ft|0}for(;!u[--a];)u.pop();return n?++t:u.shift(),r.d=u,r.e=xt(u,t),Yn?bt(r,f.precision,f.rounding):r},_t.toBinary=function(r,n){return Tt(this,2,r,n)},_t.toDecimalPlaces=_t.toDP=function(r,n){var t=this,e=t.constructor;return t=new e(t),void 0===r?t:(ht(r,0,Gn),void 0===n?n=e.rounding:ht(n,0,8),bt(t,r+t.e+1,n))},_t.toExponential=function(r,n){var t,e=this,i=e.constructor;return void 0===r?t=wt(e,!0):(ht(r,0,Gn),void 0===n?n=i.rounding:ht(n,0,8),t=wt(e=bt(new i(e),r+1,n),!0,r+1)),e.isNeg()&&!e.isZero()?"-"+t:t},_t.toFixed=function(r,n){var t,e,i=this,u=i.constructor;return void 0===r?t=wt(i):(ht(r,0,Gn),void 0===n?n=u.rounding:ht(n,0,8),t=wt(e=bt(new u(i),r+i.e+1,n),!1,r+e.e+1)),i.isNeg()&&!i.isZero()?"-"+t:t},_t.toFraction=function(r){var n,t,e,i,u,a,o,s,c,l,f,p,v=this,_=v.d,d=v.constructor;if(!_)return new d(v);if(c=t=new d(1),e=s=new d(0),a=(u=(n=new d(e)).e=Et(_)-v.e-1)%7,n.d[0]=at(10,a<0?7+a:a),null==r)r=u>0?n:c;else{if(!(o=new d(r)).isInt()||o.lt(c))throw Error(nt+o);r=o.gt(n)?u>0?n:c:o}for(Yn=!1,o=new d(dt(_)),l=d.precision,d.precision=u=7*_.length*2;f=yt(o,n,0,1,1),1!=(i=t.plus(f.times(e))).cmp(r);)t=e,e=i,i=c,c=s.plus(f.times(i)),s=i,i=n,n=o.minus(f.times(i)),o=i;return i=yt(r.minus(t),e,0,1,1),s=s.plus(i.times(c)),t=t.plus(i.times(e)),s.s=c.s=v.s,p=yt(c,e,u,1).minus(v).abs().cmp(yt(s,t,u,1).minus(v).abs())<1?[c,e]:[s,t],d.precision=l,Yn=!0,p},_t.toHexadecimal=_t.toHex=function(r,n){return Tt(this,16,r,n)},_t.toNearest=function(r,n){var t=this,e=t.constructor;if(t=new e(t),null==r){if(!t.d)return t;r=new e(1),n=e.rounding}else{if(r=new e(r),void 0===n?n=e.rounding:ht(n,0,8),!t.d)return r.s?t:r;if(!r.d)return r.s&&(r.s=t.s),r}return r.d[0]?(Yn=!1,t=yt(t,r,0,n,1).times(r),Yn=!0,bt(t)):(r.s=t.s,t=r),t},_t.toNumber=function(){return+this},_t.toOctal=function(r,n){return Tt(this,8,r,n)},_t.toPower=_t.pow=function(r){var n,t,e,i,u,a,o=this,s=o.constructor,c=+(r=new s(r));if(!(o.d&&r.d&&o.d[0]&&r.d[0]))return new s(at(+o,c));if((o=new s(o)).eq(1))return o;if(e=s.precision,u=s.rounding,r.eq(1))return bt(o,e,u);if((n=ut(r.e/7))>=r.d.length-1&&(t=c<0?-c:c)<=9007199254740991)return i=jt(s,o,t,e),r.s<0?new s(1).div(i):bt(i,e,u);if((a=o.s)<0){if(n<r.d.length-1)return new s(NaN);if(1&r.d[n]||(a=1),0==o.e&&1==o.d[0]&&1==o.d.length)return o.s=a,o}return(n=0!=(t=at(+o,c))&&isFinite(t)?new s(t+"").e:ut(c*(Math.log("0."+dt(o.d))/Math.LN10+o.e+1)))>s.maxE+1||n<s.minE-1?new s(n>0?a/0:0):(Yn=!1,s.rounding=o.s=1,t=Math.min(12,(n+"").length),(i=Ft(r.times(qt(o,e+t)),e)).d&&gt((i=bt(i,e+5,1)).d,e,u)&&(n=e+10,+dt((i=bt(Ft(r.times(qt(o,n+t)),n),n+5,1)).d).slice(e+1,e+15)+1==1e14&&(i=bt(i,e+1,0))),i.s=a,Yn=!0,s.rounding=u,bt(i,e,u))},_t.toPrecision=function(r,n){var t,e=this,i=e.constructor;return void 0===r?t=wt(e,e.e<=i.toExpNeg||e.e>=i.toExpPos):(ht(r,1,Gn),void 0===n?n=i.rounding:ht(n,0,8),t=wt(e=bt(new i(e),r,n),r<=e.e||e.e<=i.toExpNeg,r)),e.isNeg()&&!e.isZero()?"-"+t:t},_t.toSignificantDigits=_t.toSD=function(r,n){var t=this.constructor;return void 0===r?(r=t.precision,n=t.rounding):(ht(r,1,Gn),void 0===n?n=t.rounding:ht(n,0,8)),bt(new t(this),r,n)},_t.toString=function(){var r=this,n=r.constructor,t=wt(r,r.e<=n.toExpNeg||r.e>=n.toExpPos);return r.isNeg()&&!r.isZero()?"-"+t:t},_t.truncated=_t.trunc=function(){return bt(new this.constructor(this),this.e+1,1)},_t.valueOf=_t.toJSON=function(){var r=this,n=r.constructor,t=wt(r,r.e<=n.toExpNeg||r.e>=n.toExpPos);return r.isNeg()?"-"+t:t};var yt=function(){function r(r,n,t){var e,i=0,u=r.length;for(r=r.slice();u--;)e=r[u]*n+i,r[u]=e%t|0,i=e/t|0;return i&&r.unshift(i),r}function n(r,n,t,e){var i,u;if(t!=e)u=t>e?1:-1;else for(i=u=0;i<t;i++)if(r[i]!=n[i]){u=r[i]>n[i]?1:-1;break}return u}function t(r,n,t,e){for(var i=0;t--;)r[t]-=i,i=r[t]<n[t]?1:0,r[t]=i*e+r[t]-n[t];for(;!r[0]&&r.length>1;)r.shift()}return function(e,i,u,a,o,s){var c,l,f,p,v,_,d,h,g,m,y,b,w,x,S,N,E,A,j,O,k=e.constructor,F=e.s==i.s?1:-1,q=e.d,M=i.d;if(!(q&&q[0]&&M&&M[0]))return new k(e.s&&i.s&&(q?!M||q[0]!=M[0]:M)?q&&0==q[0]||!M?0*F:F/0:NaN);for(s?(v=1,l=e.e-i.e):(s=ft,v=7,l=ut(e.e/v)-ut(i.e/v)),j=M.length,E=q.length,m=(g=new k(F)).d=[],f=0;M[f]==(q[f]||0);f++);if(M[f]>(q[f]||0)&&l--,null==u?(x=u=k.precision,a=k.rounding):x=o?u+(e.e-i.e)+1:u,x<0)m.push(1),_=!0;else{if(x=x/v+2|0,f=0,1==j){for(p=0,M=M[0],x++;(f<E||p)&&x--;f++)S=p*s+(q[f]||0),m[f]=S/M|0,p=S%M|0;_=p||f<E}else{for((p=s/(M[0]+1)|0)>1&&(M=r(M,p,s),q=r(q,p,s),j=M.length,E=q.length),N=j,b=(y=q.slice(0,j)).length;b<j;)y[b++]=0;(O=M.slice()).unshift(0),A=M[0],M[1]>=s/2&&++A;do{p=0,(c=n(M,y,j,b))<0?(w=y[0],j!=b&&(w=w*s+(y[1]||0)),(p=w/A|0)>1?(p>=s&&(p=s-1),1==(c=n(d=r(M,p,s),y,h=d.length,b=y.length))&&(p--,t(d,j<h?O:M,h,s))):(0==p&&(c=p=1),d=M.slice()),(h=d.length)<b&&d.unshift(0),t(y,d,b,s),-1==c&&(c=n(M,y,j,b=y.length))<1&&(p++,t(y,j<b?O:M,b,s)),b=y.length):0===c&&(p++,y=[0]),m[f++]=p,c&&y[0]?y[b++]=q[N]||0:(y=[q[N]],b=1)}while((N++<E||void 0!==y[0])&&x--);_=void 0!==y[0]}m[0]||m.shift()}if(1==v)g.e=l,Ln=_;else{for(f=1,p=m[0];p>=10;p/=10)f++;g.e=f+l*v-1,bt(g,o?u+g.e+1:u,a,_)}return g}}();function bt(r,n,t,e){var i,u,a,o,s,c,l,f,p,v=r.constructor;r:if(null!=n){if(!(f=r.d))return r;for(i=1,o=f[0];o>=10;o/=10)i++;if((u=n-i)<0)u+=7,a=n,s=(l=f[p=0])/at(10,i-a-1)%10|0;else if((p=Math.ceil((u+1)/7))>=(o=f.length)){if(!e)break r;for(;o++<=p;)f.push(0);l=s=0,i=1,a=(u%=7)-7+1}else{for(l=o=f[p],i=1;o>=10;o/=10)i++;s=(a=(u%=7)-7+i)<0?0:l/at(10,i-a-1)%10|0}if(e=e||n<0||void 0!==f[p+1]||(a<0?l:l%at(10,i-a-1)),c=t<4?(s||e)&&(0==t||t==(r.s<0?3:2)):s>5||5==s&&(4==t||e||6==t&&(u>0?a>0?l/at(10,i-a):0:f[p-1])%10&1||t==(r.s<0?8:7)),n<1||!f[0])return f.length=0,c?(n-=r.e+1,f[0]=at(10,(7-n%7)%7),r.e=-n||0):f[0]=r.e=0,r;if(0==u?(f.length=p,o=1,p--):(f.length=p+1,o=at(10,7-u),f[p]=a>0?(l/at(10,i-a)%at(10,a)|0)*o:0),c)for(;;){if(0==p){for(u=1,a=f[0];a>=10;a/=10)u++;for(a=f[0]+=o,o=1;a>=10;a/=10)o++;u!=o&&(r.e++,f[0]==ft&&(f[0]=1));break}if(f[p]+=o,f[p]!=ft)break;f[p--]=0,o=1}for(u=f.length;0===f[--u];)f.pop()}return Yn&&(r.e>v.maxE?(r.d=null,r.e=NaN):r.e<v.minE&&(r.e=0,r.d=[0])),r}function wt(r,n,t){if(!r.isFinite())return Mt(r);var e,i=r.e,u=dt(r.d),a=u.length;return n?(t&&(e=t-a)>0?u=u.charAt(0)+"."+u.slice(1)+At(e):a>1&&(u=u.charAt(0)+"."+u.slice(1)),u=u+(r.e<0?"e":"e+")+r.e):i<0?(u="0."+At(-i-1)+u,t&&(e=t-a)>0&&(u+=At(e))):i>=a?(u+=At(i+1-a),t&&(e=t-i-1)>0&&(u=u+"."+At(e))):((e=i+1)<a&&(u=u.slice(0,e)+"."+u.slice(e)),t&&(e=t-a)>0&&(i+1===a&&(u+="."),u+=At(e))),u}function xt(r,n){var t=r[0];for(n*=7;t>=10;t/=10)n++;return n}function St(r,n,t){if(n>pt)throw Yn=!0,t&&(r.precision=t),Error(tt);return bt(new r(Jn),n,1,!0)}function Nt(r,n,t){if(n>vt)throw Error(tt);return bt(new r(Qn),n,t,!0)}function Et(r){var n=r.length-1,t=7*n+1;if(n=r[n]){for(;n%10==0;n/=10)t--;for(n=r[0];n>=10;n/=10)t++}return t}function At(r){for(var n="";r--;)n+="0";return n}function jt(r,n,t,e){var i,u=new r(1),a=Math.ceil(e/7+4);for(Yn=!1;;){if(t%2&&Zt((u=u.times(n)).d,a)&&(i=!0),0===(t=ut(t/2))){t=u.d.length-1,i&&0===u.d[t]&&++u.d[t];break}Zt((n=n.times(n)).d,a)}return Yn=!0,u}function Ot(r){return 1&r.d[r.d.length-1]}function kt(r,n,t){for(var e,i,u=new r(n[0]),a=0;++a<n.length;){if(!(i=new r(n[a])).s){u=i;break}((e=u.cmp(i))===t||0===e&&u.s===t)&&(u=i)}return u}function Ft(r,n){var t,e,i,u,a,o,s,c=0,l=0,f=0,p=r.constructor,v=p.rounding,_=p.precision;if(!r.d||!r.d[0]||r.e>17)return new p(r.d?r.d[0]?r.s<0?0:1/0:1:r.s?r.s<0?0:r:NaN);for(null==n?(Yn=!1,s=_):s=n,o=new p(.03125);r.e>-2;)r=r.times(o),f+=5;for(s+=e=Math.log(at(2,f))/Math.LN10*2+5|0,t=u=a=new p(1),p.precision=s;;){if(u=bt(u.times(r),s,1),t=t.times(++l),dt((o=a.plus(yt(u,t,s,1))).d).slice(0,s)===dt(a.d).slice(0,s)){for(i=f;i--;)a=bt(a.times(a),s,1);if(null!=n)return p.precision=_,a;if(!(c<3&&gt(a.d,s-e,v,c)))return bt(a,p.precision=_,v,Yn=!0);p.precision=s+=10,t=u=o=new p(1),l=0,c++}a=o}}function qt(r,n){var t,e,i,u,a,o,s,c,l,f,p,v=1,_=r,d=_.d,h=_.constructor,g=h.rounding,m=h.precision;if(_.s<0||!d||!d[0]||!_.e&&1==d[0]&&1==d.length)return new h(d&&!d[0]?-1/0:1!=_.s?NaN:d?0:_);if(null==n?(Yn=!1,l=m):l=n,h.precision=l+=10,e=(t=dt(d)).charAt(0),!(Math.abs(u=_.e)<15e14))return c=St(h,l+2,m).times(u+""),_=qt(new h(e+"."+t.slice(1)),l-10).plus(c),h.precision=m,null==n?bt(_,m,g,Yn=!0):_;for(;e<7&&1!=e||1==e&&t.charAt(1)>3;)e=(t=dt((_=_.times(r)).d)).charAt(0),v++;for(u=_.e,e>1?(_=new h("0."+t),u++):_=new h(e+"."+t.slice(1)),f=_,s=a=_=yt(_.minus(1),_.plus(1),l,1),p=bt(_.times(_),l,1),i=3;;){if(a=bt(a.times(p),l,1),dt((c=s.plus(yt(a,new h(i),l,1))).d).slice(0,l)===dt(s.d).slice(0,l)){if(s=s.times(2),0!==u&&(s=s.plus(St(h,l+2,m).times(u+""))),s=yt(s,new h(v),l,1),null!=n)return h.precision=m,s;if(!gt(s.d,l-10,g,o))return bt(s,h.precision=m,g,Yn=!0);h.precision=l+=10,c=a=_=yt(f.minus(1),f.plus(1),l,1),p=bt(_.times(_),l,1),i=o=1}s=c,i+=2}}function Mt(r){return String(r.s*r.s/0)}function Wt(r,n){var t,e,i;for((t=n.indexOf("."))>-1&&(n=n.replace(".","")),(e=n.search(/e/i))>0?(t<0&&(t=e),t+=+n.slice(e+1),n=n.substring(0,e)):t<0&&(t=n.length),e=0;48===n.charCodeAt(e);e++);for(i=n.length;48===n.charCodeAt(i-1);--i);if(n=n.slice(e,i)){if(i-=e,r.e=t=t-e-1,r.d=[],e=(t+1)%7,t<0&&(e+=7),e<i){for(e&&r.d.push(+n.slice(0,e)),i-=7;e<i;)r.d.push(+n.slice(e,e+=7));e=7-(n=n.slice(e)).length}else e-=i;for(;e--;)n+="0";r.d.push(+n),Yn&&(r.e>r.constructor.maxE?(r.d=null,r.e=NaN):r.e<r.constructor.minE&&(r.e=0,r.d=[0]))}else r.e=0,r.d=[0];return r}function Pt(r,n){var t,e,i,u,a,o,s,c,l;if(n.indexOf("_")>-1){if(n=n.replace(/(\d)_(?=\d)/g,"$1"),lt.test(n))return Wt(r,n)}else if("Infinity"===n||"NaN"===n)return+n||(r.s=NaN),r.e=NaN,r.d=null,r;if(st.test(n))t=16,n=n.toLowerCase();else if(ot.test(n))t=2;else{if(!ct.test(n))throw Error(nt+n);t=8}for((u=n.search(/p/i))>0?(s=+n.slice(u+1),n=n.substring(2,u)):n=n.slice(2),a=(u=n.indexOf("."))>=0,e=r.constructor,a&&(u=(o=(n=n.replace(".","")).length)-u,i=jt(e,new e(t),u,2*u)),u=l=(c=mt(n,t,ft)).length-1;0===c[u];--u)c.pop();return u<0?new e(0*r.s):(r.e=xt(c,l),r.d=c,Yn=!1,a&&(r=yt(r,i,4*o)),s&&(r=r.times(Math.abs(s)<54?at(2,s):Ae.pow(2,s))),Yn=!0,r)}function zt(r,n,t,e,i){var u,a,o,s,c=r.precision,l=Math.ceil(c/7);for(Yn=!1,s=t.times(t),o=new r(e);;){if(a=yt(o.times(s),new r(n++*n++),c,1),o=i?e.plus(a):e.minus(a),e=yt(a.times(s),new r(n++*n++),c,1),void 0!==(a=o.plus(e)).d[l]){for(u=l;a.d[u]===o.d[u]&&u--;);if(-1==u)break}u=o,o=e,e=a,a=u}return Yn=!0,a.d.length=l+1,a}function It(r,n){for(var t=r;--n;)t*=r;return t}function Dt(r,n){var t,e=n.s<0,i=Nt(r,r.precision,1),u=i.times(.5);if((n=n.abs()).lte(u))return Hn=e?4:1,n;if((t=n.divToInt(i)).isZero())Hn=e?3:2;else{if((n=n.minus(t.times(i))).lte(u))return Hn=Ot(t)?e?2:3:e?4:1,n;Hn=Ot(t)?e?1:4:e?3:2}return n.minus(i).abs()}function Tt(r,n,t,e){var i,u,a,o,s,c,l,f,p,v=r.constructor,_=void 0!==t;if(_?(ht(t,1,Gn),void 0===e?e=v.rounding:ht(e,0,8)):(t=v.precision,e=v.rounding),r.isFinite()){for(_?(i=2,16==n?t=4*t-3:8==n&&(t=3*t-2)):i=n,(a=(l=wt(r)).indexOf("."))>=0&&(l=l.replace(".",""),(p=new v(1)).e=l.length-a,p.d=mt(wt(p),10,i),p.e=p.d.length),u=s=(f=mt(l,10,i)).length;0==f[--s];)f.pop();if(f[0]){if(a<0?u--:((r=new v(r)).d=f,r.e=u,f=(r=yt(r,p,t,e,0,i)).d,u=r.e,c=Ln),a=f[t],o=i/2,c=c||void 0!==f[t+1],c=e<4?(void 0!==a||c)&&(0===e||e===(r.s<0?3:2)):a>o||a===o&&(4===e||c||6===e&&1&f[t-1]||e===(r.s<0?8:7)),f.length=t,c)for(;++f[--t]>i-1;)f[t]=0,t||(++u,f.unshift(1));for(s=f.length;!f[s-1];--s);for(a=0,l="";a<s;a++)l+=Kn.charAt(f[a]);if(_){if(s>1)if(16==n||8==n){for(a=16==n?4:3,--s;s%a;s++)l+="0";for(s=(f=mt(l,i,n)).length;!f[s-1];--s);for(a=1,l="1.";a<s;a++)l+=Kn.charAt(f[a])}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>s)for(u-=s;u--;)l+="0";else u<s&&(l=l.slice(0,u)+"."+l.slice(u))}else l=_?"0p+0":"0";l=(16==n?"0x":2==n?"0b":8==n?"0o":"")+l}else l=Mt(r);return r.s<0?"-"+l:l}function Zt(r,n){if(r.length>n)return r.length=n,!0}function $t(r){return new this(r).abs()}function Ut(r){return new this(r).acos()}function Rt(r){return new this(r).acosh()}function Bt(r,n){return new this(r).plus(n)}function Ct(r){return new this(r).asin()}function Lt(r){return new this(r).asinh()}function Ht(r){return new this(r).atan()}function Vt(r){return new this(r).atanh()}function Gt(r,n){r=new this(r),n=new this(n);var t,e=this.precision,i=this.rounding,u=e+4;return r.s&&n.s?r.d||n.d?!n.d||r.isZero()?(t=n.s<0?Nt(this,e,i):new this(0)).s=r.s:!r.d||n.isZero()?(t=Nt(this,u,1).times(.5)).s=r.s:n.s<0?(this.precision=u,this.rounding=1,t=this.atan(yt(r,n,u,1)),n=Nt(this,u,1),this.precision=e,this.rounding=i,t=r.s<0?t.minus(n):t.plus(n)):t=this.atan(yt(r,n,u,1)):(t=Nt(this,u,1).times(n.s>0?.25:.75)).s=r.s:t=new this(NaN),t}function Kt(r){return new this(r).cbrt()}function Jt(r){return bt(r=new this(r),r.e+1,2)}function Qt(r,n,t){return new this(r).clamp(n,t)}function Xt(r){if(!r||"object"!==f(r))throw Error(rt+"Object expected");var n,t,e,i=!0===r.defaults,u=["precision",1,Gn,"rounding",0,8,"toExpNeg",-Vn,0,"toExpPos",0,Vn,"maxE",0,Vn,"minE",-Vn,0,"modulo",0,9];for(n=0;n<u.length;n+=3)if(t=u[n],i&&(this[t]=Xn[t]),void 0!==(e=r[t])){if(!(ut(e)===e&&e>=u[n+1]&&e<=u[n+2]))throw Error(nt+t+": "+e);this[t]=e}if(t="crypto",i&&(this[t]=Xn[t]),void 0!==(e=r[t])){if(!0!==e&&!1!==e&&0!==e&&1!==e)throw Error(nt+t+": "+e);if(e){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(et);this[t]=!0}else this[t]=!1}return this}function Yt(r){return new this(r).cos()}function re(r){return new this(r).cosh()}function ne(r,n){return new this(r).div(n)}function te(r){return new this(r).exp()}function ee(r){return bt(r=new this(r),r.e+1,3)}function ie(){var r,n,t=new this(0);for(Yn=!1,r=0;r<arguments.length;)if((n=new this(arguments[r++])).d)t.d&&(t=t.plus(n.times(n)));else{if(n.s)return Yn=!0,new this(1/0);t=n}return Yn=!0,t.sqrt()}function ue(r){return r instanceof Ae||r&&r.toStringTag===it||!1}function ae(r){return new this(r).ln()}function oe(r,n){return new this(r).log(n)}function se(r){return new this(r).log(2)}function ce(r){return new this(r).log(10)}function le(){return kt(this,arguments,-1)}function fe(){return kt(this,arguments,1)}function pe(r,n){return new this(r).mod(n)}function ve(r,n){return new this(r).mul(n)}function _e(r,n){return new this(r).pow(n)}function de(r){var n,t,e,i,u=0,a=new this(1),o=[];if(void 0===r?r=this.precision:ht(r,1,Gn),e=Math.ceil(r/7),this.crypto)if(crypto.getRandomValues)for(n=crypto.getRandomValues(new Uint32Array(e));u<e;)(i=n[u])>=429e7?n[u]=crypto.getRandomValues(new Uint32Array(1))[0]:o[u++]=i%1e7;else{if(!crypto.randomBytes)throw Error(et);for(n=crypto.randomBytes(e*=4);u<e;)(i=n[u]+(n[u+1]<<8)+(n[u+2]<<16)+((127&n[u+3])<<24))>=214e7?crypto.randomBytes(4).copy(n,u):(o.push(i%1e7),u+=4);u=e/4}else for(;u<e;)o[u++]=1e7*Math.random()|0;for(r%=7,(e=o[--u])&&r&&(i=at(10,7-r),o[u]=(e/i|0)*i);0===o[u];u--)o.pop();if(u<0)t=0,o=[0];else{for(t=-1;0===o[0];t-=7)o.shift();for(e=1,i=o[0];i>=10;i/=10)e++;e<7&&(t-=7-e)}return a.e=t,a.d=o,a}function he(r){return bt(r=new this(r),r.e+1,this.rounding)}function ge(r){return(r=new this(r)).d?r.d[0]?r.s:0*r.s:r.s||NaN}function me(r){return new this(r).sin()}function ye(r){return new this(r).sinh()}function be(r){return new this(r).sqrt()}function we(r,n){return new this(r).sub(n)}function xe(){var r=0,n=arguments,t=new this(n[r]);for(Yn=!1;t.s&&++r<n.length;)t=t.plus(n[r]);return Yn=!0,bt(t,this.precision,this.rounding)}function Se(r){return new this(r).tan()}function Ne(r){return new this(r).tanh()}function Ee(r){return bt(r=new this(r),r.e+1,1)}_t[Symbol.for("nodejs.util.inspect.custom")]=_t.toString,_t[Symbol.toStringTag]="Decimal";var Ae=_t.constructor=function r(n){var t,e,i;function u(r){var n,t,e,i=this;if(!(i instanceof u))return new u(r);if(i.constructor=u,ue(r))return i.s=r.s,void(Yn?!r.d||r.e>u.maxE?(i.e=NaN,i.d=null):r.e<u.minE?(i.e=0,i.d=[0]):(i.e=r.e,i.d=r.d.slice()):(i.e=r.e,i.d=r.d?r.d.slice():r.d));if("number"===(e=f(r))){if(0===r)return i.s=1/r<0?-1:1,i.e=0,void(i.d=[0]);if(r<0?(r=-r,i.s=-1):i.s=1,r===~~r&&r<1e7){for(n=0,t=r;t>=10;t/=10)n++;return void(Yn?n>u.maxE?(i.e=NaN,i.d=null):n<u.minE?(i.e=0,i.d=[0]):(i.e=n,i.d=[r]):(i.e=n,i.d=[r]))}return 0*r!=0?(r||(i.s=NaN),i.e=NaN,void(i.d=null)):Wt(i,r.toString())}if("string"===e)return 45===(t=r.charCodeAt(0))?(r=r.slice(1),i.s=-1):(43===t&&(r=r.slice(1)),i.s=1),lt.test(r)?Wt(i,r):Pt(i,r);if("bigint"===e)return r<0?(r=-r,i.s=-1):i.s=1,Wt(i,r.toString());throw Error(nt+r)}if(u.prototype=_t,u.ROUND_UP=0,u.ROUND_DOWN=1,u.ROUND_CEIL=2,u.ROUND_FLOOR=3,u.ROUND_HALF_UP=4,u.ROUND_HALF_DOWN=5,u.ROUND_HALF_EVEN=6,u.ROUND_HALF_CEIL=7,u.ROUND_HALF_FLOOR=8,u.EUCLID=9,u.config=u.set=Xt,u.clone=r,u.isDecimal=ue,u.abs=$t,u.acos=Ut,u.acosh=Rt,u.add=Bt,u.asin=Ct,u.asinh=Lt,u.atan=Ht,u.atanh=Vt,u.atan2=Gt,u.cbrt=Kt,u.ceil=Jt,u.clamp=Qt,u.cos=Yt,u.cosh=re,u.div=ne,u.exp=te,u.floor=ee,u.hypot=ie,u.ln=ae,u.log=oe,u.log10=ce,u.log2=se,u.max=le,u.min=fe,u.mod=pe,u.mul=ve,u.pow=_e,u.random=de,u.round=he,u.sign=ge,u.sin=me,u.sinh=ye,u.sqrt=be,u.sub=we,u.sum=xe,u.tan=Se,u.tanh=Ne,u.trunc=Ee,void 0===n&&(n={}),n&&!0!==n.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<i.length;)n.hasOwnProperty(e=i[t++])||(n[e]=this[e]);return u.config(n),u}(Xn);Jn=new Ae(Jn),Qn=new Ae(Qn);var je=new Map;function Oe(){je.clear();var r=In("_fmt_groups")||{};for(var n in r){var t=r[n];if("string"==typeof t)try{var e=_n(t,null);je.set(n,e)}catch(r){console.warn('Failed to parse format group "'.concat(n,'":'),r)}}}function ke(r,n){if(!r||0===r.length)return r;if(!r.some(function(r){return r.type===V}))return r;for(var t=[],i=r.has_var||!1,u=0;u<r.length;u++){var a,o=r[u];if(o.type===V){var s=o.group_name;if(s){var c=je.get(s);if(null!==(a=c)&&void 0!==a&&a.has_var){var f=(In("_fmt_groups")||{})[s];try{c=_n(f,n)}catch(r){console.warn('Failed to parse format group "'.concat(s,'":'),r);continue}}c?(t.push.apply(t,l(c)),c.has_var&&(i=!0)):"undefined"!=typeof console&&console.warn&&console.warn('Format group "'.concat(s,'" not found, ignoring.'))}}else t.push(o)}var p=function(r){if(!r||0===r.length)return[];var n={mantissa:["number","var"],round:["round"],thousands:["comma","thousands"],sign:["plus"],percent:["percent"],scientific:["scientific"],fraction:["fraction"],volume:["volume"],integer_padding:["integer_padding"],range_clamp:["range_clamp"],unit:["unit_after","unit_before","unit_middle","unit_hide","unit_default"]},t={};for(var i in n){var u,a=e(n[i]);try{for(a.s();!(u=a.n()).done;)t[u.value]=i}catch(r){a.e(r)}finally{a.f()}}var o=new Map,s=[],c={exact:null,min:null,max:null};function f(r,n){var t=r.length>0?[].concat(l(r),[n]):n,e=r.length>0?r[r.length-1].value:"=";if(">="===e||">"===e?(c.exact=null,c.min=t):"<="===e||"<"===e?(c.exact=null,c.max=t):(c.exact=t,c.min=null,c.max=null),c.exact)o.set("mantissa",c.exact);else{for(var i=[],u=0,a=[c.min,c.max];u<a.length;u++){var s=a[u];Array.isArray(s)?i.push.apply(i,l(s)):s&&i.push(s)}o.set("mantissa",i)}}for(var p=0;p<r.length;p++){var v=r[p],_=v.type;if("symbol"!==_)if(s.length>0&&("number"===_||"var"===_))f(s,v),s=[];else{if(s.length>0){var d,h=e(s);try{for(h.s();!(d=h.n()).done;){var g=d.value,m="symbol_".concat(o.size);o.set(m,g)}}catch(r){h.e(r)}finally{h.f()}s=[]}var y=t[_];if(y)"mantissa"===y?f([],v):o.set(y,v);else{var b="".concat(_,"_").concat(o.size);o.set(b,v)}}else s.push(v)}if(s.length>0){var w,x=e(s);try{for(x.s();!(w=x.n()).done;){var S=w.value,N="symbol_".concat(o.size);o.set(N,S)}}catch(r){x.e(r)}finally{x.f()}}var E,A=[],j=e(o.values());try{for(j.s();!(E=j.n()).done;){var O=E.value;Array.isArray(O)?A.push.apply(A,l(O)):A.push(O)}}catch(r){j.e(r)}finally{j.f()}return A}(t);return i&&(p.has_var=!0),p}kn("_fmt_groups",function(){Oe()}),Oe();var Fe=["","K","M","B","T"],qe={sep:",",point:".",grouping:[3],min_len:0,point_group:!1,fn:null},Me={en:{sep:",",point:".",grouping:[3]},eu:{sep:".",point:",",grouping:[3]},swiss:{sep:"'",point:".",grouping:[3]},space:{sep:" ",point:".",grouping:[3]},fr:{sep:" ",point:",",grouping:[3]},indian:{sep:",",point:".",grouping:[3,2]},wan:{sep:",",point:".",grouping:[4]}};function We(r){if(!r)return null;var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})._thousands||{};if(n[r])return a(a({},qe),n[r]);var t=In("_thousands")||{};return t[r]?a(a({},qe),t[r]):Me[r]?a(a({},qe),Me[r]):null}function Pe(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=a(a({},qe),n);if(t.fn&&"function"==typeof t.fn){var e=r.startsWith("-"),i=r.startsWith("+"),u="",o=r;(e||i)&&(u=r[0],o=r.slice(1));var s=o.split("."),c={int_part:s[0],dec_part:s[1]||null,sign:u,options:t._options||{}};return t.fn(r,c)}var l=r.replace(/^[+-]/,"").split(".")[0].length;if(t.min_len>0&&l<t.min_len)return"."!==t.point?r.replace(".",t.point):r;var f=r.startsWith("-"),p=r.startsWith("+"),v="",_=r;(f||p)&&(v=r[0],_=r.slice(1));var d=_.split("."),h=d[0],g=d[1];h=function(r,n,t){if(!r||0===r.length)return r;if(!Array.isArray(n)||0===n.length||n.some(function(r){return!Number.isInteger(r)||r<=0}))return r;var e=[],i=r.length,u=0;for(;i>0;){var a=n[Math.min(u,n.length-1)],o=Math.max(0,i-a);e.push(r.slice(o,i)),i=o,u++}return e.reverse().join(t)}(h,t.grouping,t.sep),g&&t.point_group&&(g=function(r,n,t){if(!r||0===r.length)return r;if(!Array.isArray(n)||0===n.length||n.some(function(r){return!Number.isInteger(r)||r<=0}))return r;var e=[],i=0,u=0;for(;i<r.length;){var a=n[Math.min(u,n.length-1)],o=Math.min(r.length,i+a);e.push(r.slice(i,o)),i=o,u++}return e.join(t)}(g,t.grouping,t.sep));var m=v+h;return void 0!==g?m+=t.point+g:t.point,m}var ze={en:{symbols:["","K","M","B","T"],step:1e3},cn:{symbols:["","千","百万","十亿","万亿"],step:1e3},wan:{symbols:["","万","亿","万亿"],step:1e4},storage:{symbols:["B","KB","MB","GB","TB"],step:1024},indian:{symbols:["","K","L","Cr"],step:[1e3,100,100]}};function Ie(r,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},e=t._compact_preset,i=t._current_unit,u=Fe,a=1e3,o=null;if(t._compact_symbols||t._compact_step)u=t._compact_symbols&&t._compact_symbols.length>0?t._compact_symbols:Fe,a=t._compact_step||1e3;else if(e){var s=(In("_compact")||{})[e]||ze[e];s&&("function"==typeof s?o=s:Array.isArray(s)?(u=s,a=1e3):(u=s.symbols||u,a=void 0!==s.step?s.step:a))}else if(i){var c=In("_unit_compact_map")||{},l=!1;if(c&&c[i]){var p=c[i],v=(In("_compact")||{})[p]||ze[p];v&&(l=!0,"function"==typeof v?o=v:Array.isArray(v)?(u=v,a=1e3):(u=v.symbols||u,a=void 0!==v.step?v.step:a))}if(!l){var _=In("_compact_default");if(_){var d=(In("_compact")||{})[_]||ze[_];d&&("function"==typeof d?o=d:Array.isArray(d)?(u=d,a=1e3):(u=d.symbols||u,a=void 0!==d.step?d.step:a))}}}else{var h=In("_compact_default");if(h){var g=(In("_compact")||{})[h]||ze[h];g&&("function"==typeof g?o=g:Array.isArray(g)?(u=g,a=1e3):(u=g.symbols||u,a=void 0!==g.step?g.step:a))}}if(o){var m=o(r,{decimals:n,options:t,current_unit:i});return"object"===f(m)&&null!==m?{sign:m.sign||"",number:m.number||"0",unit:m.unit||"",formatted:m.formatted||(m.sign||"")+(m.number||"0")+(m.unit||"")}:"string"==typeof m?{sign:"",number:m,unit:"",formatted:m}:{sign:"",number:r,unit:"",formatted:r}}var y,b=r.startsWith("-"),w=r.startsWith("+"),x="",S=r;(b||w)&&(x=r[0],S=r.slice(1));for(var N=new Ae(S),E=0,A=Array.isArray(a);E<u.length-1;){var j=A?a[E]||a[a.length-1]:a;if(!N.gte(j))break;N=N.div(j),E++}switch(t._round||"~-"){case"~5":y=Ae.ROUND_HALF_UP;break;case"~6":y=Ae.ROUND_HALF_EVEN;break;case"~+":y=Ae.ROUND_UP;break;default:y=Ae.ROUND_DOWN}var O=N.toFixed(n,y);return O.includes(".")&&(O=O.replace(/\.?0+$/,"")),{sign:x,number:O,unit:u[E],formatted:x+O+u[E]}}function De(r,n){if(n<=0)return r;if(n>1e4)throw new Error("整数补零位数(".concat(n,")超出安全上限 ").concat(1e4));var t=r.startsWith("-"),e=r.startsWith("+"),i="",u=r;(t||e)&&(i=r[0],u=r.slice(1));var a=u.split("."),o=a[0],s=a[1];o.length<n&&(o="0".repeat(n-o.length)+o);var c=i+o;return void 0!==s&&(c+="."+s),c}function Te(r,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n=ke(n,t._fill_data||t);var i="";if("undefined"===(i=Ae.isDecimal(r)?r.toFixed():"string"==typeof r?r:r.toString())||"NaN"===i)return[void 0,{}];var u=function(r){return r._unit_convert_out||null}(t),o=In("_unit_position_map")||{},s=t._recognized_unit||null,c=function(r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(!r)return null;var i,u=e(r);try{for(u.s();!(i=u.n()).done;){var a=i.value;if("unit_after"===a.type||"unit_before"===a.type||"unit_middle"===a.type){var o=a.unit;if(a.use_default&&!o&&!(o=t)){var s=In("_unit_default_out");o=Array.isArray(s)?s[0]:s}return{output_unit:o,input_unit:a.input_unit,position:"unit_after"===a.type?"after":"unit_before"===a.type?"before":"middle",show_unit:!0,keep_recognized:a.use_default}}if("unit_hide"===a.type)return{output_unit:a.unit,input_unit:a.input_unit,position:null,show_unit:!1};if("unit_default"===a.type){var c=n[a.unit]||In("_unit_default_position")||"after";return{output_unit:a.unit,input_unit:a.input_unit,position:c,show_unit:!0}}if("to-number-string"===a.type)return a.output_unit?{output_unit:a.output_unit,input_unit:a.input_unit,position:null,show_unit:!1}:{output_unit:null,input_unit:null,position:null,show_unit:!1,no_conversion:!0}}}catch(r){u.e(r)}finally{u.f()}return null}(n,t,o,s),l=null,p=null,v=!1,_=!1;if(c){var d=c.output_unit,h=c.input_unit,g=c.position,m=c.show_unit,y=c.no_conversion,b=c.keep_recognized;if(!y&&u){var w=b&&s?s:d||s||In("_unit_default_out");if(w){var x=function(r,n,t,i){if(!t||!r)return null;var u=t[r];if(!u)return null;if(n){var a=u[n];return void 0!==a?{rule:a,input_unit:n}:null}if(i){var o,s=e(Array.isArray(i)?i:[i]);try{for(s.s();!(o=s.n()).done;){var c=o.value;if(void 0!==u[c])return{rule:u[c],input_unit:c}}}catch(r){s.e(r)}finally{s.f()}}var l=Object.keys(u).filter(function(r){return!r.startsWith("_")});return 1===l.length?{rule:u[l[0]],input_unit:l[0]}:null}(w,h||s||null,u,In("_unit_default_in"));x&&(i=function(r,n,t,e){if(null==n)return r;var i=new Ae(r);return"number"==typeof n?i.times(n).toFixed():"function"==typeof n?String(n(Number(r),t,e)):"object"===f(n)?n.fn&&"function"==typeof n.fn?String(n.fn(Number(r),t,e)):(void 0!==n.mul?i=i.times(n.mul):void 0!==n.div&&(i=i.div(n.div)),void 0!==n.plus?i=i.plus(n.plus):void 0!==n.minus?i=i.minus(n.minus):void 0===n.mul&&void 0===n.div&&(void 0!==n.add?i=i.plus(n.add):void 0!==n.sub&&(i=i.minus(n.sub))),i.toFixed()):r}(i,x.rule,x.input_unit,w),l=w,_=!0)}}m?(b&&s?l=s:l||(l=d||s),p=g,v=!0,_=!0):y&&(_=!0)}else s&&(l=s,p=o[s]||In("_unit_default_position")||"after",v=!0,_=!0);var S={mantissa:null,mantissa_type:null,mantissa_min:null,mantissa_max:null,thousands:!1,thousands_preset:null,sign:!1,round:"~-",scientific:!1,fraction:!1,percent:!1,to_number:!1,to_number_string:!1,integer_padding:null,compact:!1,compact_preset:null,unit_format:null,unit_value:null,unit_input:null,range_clamp_min:null,range_clamp_max:null},N=[],E=[];n.forEach(function(r,n){"symbol"===r.type?N.push({value:r.value,index:n}):"number"!==r.type&&"var"!==r.type||E.push({value:"var"===r.type?r.real_value:r.value,index:n})});var A=N.find(function(r){return">="===r.value||">"===r.value}),j=N.find(function(r){return"<="===r.value||"<"===r.value});if(A&&j)for(var O=function(){var r=N[k],n=E.find(function(n){return n.index>r.index});n&&(">="===r.value||">"===r.value?S.mantissa_min=+n.value:"<="!==r.value&&"<"!==r.value||(S.mantissa_max=+n.value))},k=0;k<N.length;k++)O();if(n.forEach(function(r){var n=r.type;if("symbol"===n){if(![">=","<=","=","<",">"].includes(r.value))throw new Error("错误的格式化参数:",r.value);A&&j||(S.mantissa_type=r.value)}else if("to-number"===n)S.to_number=!0;else if("to-number-string"===n)S.to_number_string=!0;else if("comma"===n)S.thousands=!0;else if("number"===n)A&&j||(S.mantissa=r.value);else if("var"===n)A&&j||(S.mantissa=r.real_value);else if("plus"===n)S.sign=!0;else if("round"===n)S.round=r.value;else if("fraction"===n)S.fraction=!0;else if("scientific"===n)S.scientific=!0;else if("percent"===n)S.percent=!0;else if("integer_padding"===n)S.integer_padding=void 0!==r.real_value?+r.real_value:+r.value;else if("compact"===n)S.compact=!0,r.preset&&(S.compact_preset=r.preset);else if("unit_after"===n)S.unit_format="after",S.unit_value=r.unit,S.unit_input=r.input_unit;else if("unit_before"===n)S.unit_format="before",S.unit_value=r.unit,S.unit_input=r.input_unit;else if("unit_middle"===n)S.unit_format="middle",S.unit_value=r.unit,S.unit_input=r.input_unit;else if("unit_hide"===n)S.unit_format=null,S.unit_value=r.unit,S.unit_input=r.input_unit;else if("unit_default"===n){var t=In("_unit_default_position")||"after";S.unit_format=t,S.unit_value=r.unit,S.unit_input=r.input_unit}else if("thousands"===n)S.thousands=!0,S.thousands_preset=r.preset;else{if("range_clamp"!==n)throw new Error("错误的fmt Token");S.range_clamp_min=r.min,S.range_clamp_max=r.max}}),null!==S.range_clamp_min||null!==S.range_clamp_max){var F=new Ae(i);if(null!==S.range_clamp_min){var q=new Ae(S.range_clamp_min);F.lt(q)&&(F=q)}if(null!==S.range_clamp_max){var M=new Ae(S.range_clamp_max);F.gt(M)&&(F=M)}i=F.toFixed()}if(S.to_number){var W=un(i,S.mantissa_type,S.mantissa,S.round);return S.integer_padding&&(W=De(W,S.integer_padding)),[+W,S]}if(S.scientific){var P=new Ae(i).toExponential();return[S.sign&&!P.startsWith("-")?"+"+P:P,S]}if(S.fraction){var z=new Ae(i).toFraction(),I=z[0].toString()+"/"+z[1].toString();return[S.sign&&!I.startsWith("-")?"+"+I:I,S]}if(S.compact){var D=Ie(i,null!==S.mantissa?+S.mantissa:2,a(a({},t),{},{_compact_preset:S.compact_preset,_current_unit:l,_round:S.round})),T=D.sign,Z=D.unit;i=D.number,S._compact_formatted=!0,S._compact_sign=T,S._compact_unit_suffix=Z}if(S.percent&&(i=new Ae(i).times(100).toFixed()),null!==S.mantissa_min&&null!==S.mantissa_max){var $=i.includes(".")?i.split(".")[1].length:0;$<S.mantissa_min?i=un(i,">=",S.mantissa_min,S.round):$>S.mantissa_max?i=un(i,"<=",S.mantissa_max,S.round):i.includes(".")&&(i=i.replace(/0*$/,"").replace(/\.$/,""))}else null===S.mantissa?i.includes(".")&&(i=i.replace(/0*$/,"")):S._compact_formatted||(i=un(i,S.mantissa_type,S.mantissa,S.round));if(S.integer_padding&&(i=De(i,S.integer_padding)),S.thousands){var U=null;if(S.thousands_preset)U=We(S.thousands_preset,t);else if(l){var R=(In("_unit_thousands_map")||{})[l];R&&(U=We(R,t))}if(!U){var B=In("_thousands_default");B&&(U=We(B,t))}U?(U._options=t,i=Pe(i,U)):i=on(i)}return S._compact_formatted&&(S.sign&&!S._compact_sign&&(i="+"+i),i=S._compact_sign+i+S._compact_unit_suffix),S.sign&&!S._compact_formatted&&(S.to_number=!1,i.startsWith("-")||(i="+"+i)),S.percent&&(i+="%"),v&&l&&p&&(i=function(r,n,t){if(!n)return r;var e=r.startsWith("-"),i=r.startsWith("+"),u="",a=r;switch((e||i)&&(u=r[0],a=r.slice(1)),t){case"after":default:return u+a+n;case"before":return n+u+a;case"middle":return u?u+n+a:n+a}}(i,l,p,S.sign)),S.unit_handled=_,[i,S]}var Ze=null;function $e(r,n){var t=function(){if(!Ze)throw new Error("calc function not registered");return Ze}(),e={_error:"-"};return["string","number"].includes(f(r))?void 0===n?/[a-zA-Z$_]/.test(r.toString())?function(n){return n=Array.isArray(n)?[e].concat(l(n)):a(a({},e),n),t(r,n)}:t(r):(n=Array.isArray(n)?[e].concat(l(n)):a(a({},e),n),t(r,n)):(r=Array.isArray(r)?[e].concat(l(r)):a(a({},e),r),function(n){return t(n,r)})}function Ue(r){var n=String(r).match(/(\d+)\.(\d+)\.(\d+)/);return n?[parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10)]:null}function Re(r,n){var t=Ue(r),e=Ue(n);return!(!t||!e)&&(t[0]>e[0]||t[0]===e[0]&&t[1]>e[1]||t[0]===e[0]&&t[1]===e[1]&&t[2]>e[2])}function Be(r){return"string"!=typeof r?[]:(r.match(/["']\d+\.\d+\.\d+[^"']*["']/g)||[]).map(function(r){return r.slice(1,-1)})}function Ce(){return Le.apply(this,arguments)}function Le(){return(Le=t(o().m(function r(){var n,t,e,i,u;return o().w(function(r){for(;;)switch(r.p=r.n){case 0:n=["https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js","https://unpkg.com/a-calc@latest/a-calc.versions.js"],t=0;case 1:if(!(t<n.length)){r.n=9;break}return r.p=2,r.n=3,fetch(n[t]);case 3:if((e=r.v)&&e.ok){r.n=4;break}return r.a(3,8);case 4:return r.n=5,e.text();case 5:if(i=r.v,!((u=Be(i)).length>0)){r.n=6;break}return r.a(2,u[u.length-1]);case 6:r.n=8;break;case 7:return r.p=7,r.v,r.a(3,8);case 8:t++,r.n=1;break;case 9:return r.a(2,null)}},r,null,[[2,7]])}))).apply(this,arguments)}function He(){return(He=t(o().m(function r(){var n;return o().w(function(r){for(;;)switch(r.n){case 0:if("function"==typeof fetch){r.n=1;break}return r.a(2);case 1:return r.n=2,Ce();case 2:if(n=r.v){r.n=3;break}return r.a(2);case 3:Re(n,v)&&console.warn("a-calc has a new version:",n);case 4:return r.a(2)}},r)}))).apply(this,arguments)}var Ve=new Set(["+","-","*","/","%","**","//"]);function Ge(r,n,t){if(Number.isNaN(Number(n)))if("-"===n||"+"===n)r.push({type:"operator",value:n});else if(Ve.has(n))r.push({type:"operator",value:n});else if(t._unit&&/^[+-]?\d/.test(n)){var e,i=tn(n),u=i.num,a=i.unit;if(void 0===a)r.push({type:"number",value:u,real_value:u,has_unit:!1});else t.has_unit=!0,null!==(e=t.unit_str)&&void 0!==e||(t.unit_str=a),r.push({type:"number",value:u,real_value:u,has_unit:!0,unit:a})}else if(w.has(n[0])){t.has_var=!0;var o=sn(t.fill_data,n);if(t._unit){var s,c=tn(o),l=c.num,f=c.unit;if(void 0===f)r.push({type:"var",value:n,real_value:l,has_unit:!1});else t.has_unit=!0,null!==(s=t.unit_str)&&void 0!==s||(t.unit_str=f),r.push({type:"var",value:n,real_value:l,has_unit:!0,unit:f})}else r.push({type:"var",value:n,real_value:o,has_unit:!1})}else{if(!/^[+-]?\d/.test(n))throw new Error("无法识别的标识符:".concat(n));var p=n.indexOf("e");-1!==p&&/^\d+$/.test(n.slice(p+1))&&r.push({type:"number",value:n,real_value:n,has_unit:!1})}else r.push({type:"number",value:n,real_value:n,has_unit:!1})}function Ke(r){return r instanceof Ae?r:new Ae("boolean"==typeof r?r?1:0:r)}function Je(r){return r instanceof Ae}function Qe(r,n,t){if(void 0===r||void 0===n)throw new Error("无效的操作数对:v1:".concat(r,", v2:").concat(n));var e=Ke(r),i=Ke(n);switch(t){case">":return e.gt(i);case"<":return e.lt(i);case">=":return e.gte(i);case"<=":return e.lte(i);case"==":return e.eq(i);case"!=":return!e.eq(i);default:throw new Error("未知的比较运算符: ".concat(t))}}function Xe(r){if("boolean"==typeof r)return r;if(r instanceof Ae)return!r.isZero();if("number"==typeof r)return 0!==r;if("string"==typeof r){var n=r.trim();if(""===n)return!1;try{return!new Ae(n).isZero()}catch(r){return!0}}return Boolean(r)}function Ye(r){return!Xe(r)}var ri=[];function ni(){return ri.length>0?ri[ri.length-1]:In("_angle_unit")}function ti(r,n){ri.push(null!=r?r:In("_angle_unit"));try{return n()}finally{ri.pop()}}function ei(r){return"rad"===ni()?r:new Ae(r).times(Ae.acos(-1)).div(180)}function ii(r){return"rad"===ni()?r:new Ae(r).times(180).div(Ae.acos(-1))}var ui={0:new Ae(0),30:new Ae("0.5"),45:new Ae(2).sqrt().div(2),60:new Ae(3).sqrt().div(2),90:new Ae(1),180:new Ae(0),270:new Ae(-1),360:new Ae(0)},ai={0:new Ae(1),30:new Ae(3).sqrt().div(2),45:new Ae(2).sqrt().div(2),60:new Ae("0.5"),90:new Ae(0),180:new Ae(-1),270:new Ae(0),360:new Ae(1)},oi={0:new Ae(0),30:new Ae(3).sqrt().div(3),45:new Ae(1),60:new Ae(3).sqrt(),180:new Ae(0),360:new Ae(0)};function si(r){var n=new Ae(r).mod(360);return n.isNegative()?n.plus(360):n}var ci={sin:function(r){if("deg"===ni()){var n=si(r).toNumber();if(void 0!==ui[n])return ui[n];if(n>180){var t=ui[360-n];if(void 0!==t)return t.negated()}if(n>90&&n<=180){var e=ui[180-n];if(void 0!==e)return e}}var i=ei(r);return Ae.sin(i)},cos:function(r){if("deg"===ni()){var n=si(r).toNumber();if(void 0!==ai[n])return ai[n];if(n>180){var t=ai[360-n];if(void 0!==t)return t}if(n>90&&n<=180){var e=ai[180-n];if(void 0!==e)return e.negated()}}var i=ei(r);return Ae.cos(i)},tan:function(r){if("deg"===ni()){var n=si(r).toNumber();if(90===n||270===n)throw new Error("tan() undefined at 90° and 270°");if(void 0!==oi[n])return oi[n]}var t=ei(r);return Ae.tan(t)},asin:function(r){return ii(Ae.asin(r))},acos:function(r){return ii(Ae.acos(r))},atan:function(r){return ii(Ae.atan(r))},atan2:function(r,n){return ii(Ae.atan2(r,n))},sinh:function(r){return Ae.sinh(r)},cosh:function(r){return Ae.cosh(r)},tanh:function(r){return Ae.tanh(r)},asinh:function(r){return Ae.asinh(r)},acosh:function(r){return Ae.acosh(r)},atanh:function(r){return Ae.atanh(r)},exp:function(r){return Ae.exp(r)},log:function(r){return Ae.ln(r)},ln:function(r){return Ae.ln(r)},log10:function(r){return Ae.log10(r)},log2:function(r){return Ae.log2(r)},sqrt:function(r){return new Ae(r).sqrt()},cbrt:function(r){return new Ae(r).cbrt()},pow:function(r,n){return new Ae(r).pow(n)},floor:function(r){return new Ae(r).floor()},ceil:function(r){return new Ae(r).ceil()},round:function(r){return new Ae(r).round()},trunc:function(r){return new Ae(r).trunc()},abs:function(r){return new Ae(r).abs()},sign:function(r){var n=new Ae(r);return n.isZero()?new Ae(0):n.isPositive()?new Ae(1):new Ae(-1)},max:function(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];if(0===n.length)throw new Error("max() requires at least one argument");return n.reduce(function(r,n){var t=new Ae(n);return t.gt(r)?t:r},new Ae(n[0]))},min:function(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];if(0===n.length)throw new Error("min() requires at least one argument");return n.reduce(function(r,n){var t=new Ae(n);return t.lt(r)?t:r},new Ae(n[0]))},clamp:function(r,n,t){var e=new Ae(r),i=new Ae(n),u=new Ae(t);return e.lt(i)?i:e.gt(u)?u:e},random:function(){return new Ae(Math.random())},pi:function(){return Ae.acos(-1)},e:function(){return Ae.exp(1)},if:function(r,n,t){return Xe(r)?n:t}};zn({_builtin_functions:ci});var li=Object.prototype.hasOwnProperty;function fi(r,n){return n in Object.prototype&&!li.call(r,n)}function pi(r,n){if(n){var t,i=e(Array.isArray(n)?n:[n]);try{for(i.s();!(t=i.n()).done;){var u=t.value;if(u&&"function"==typeof u[r]&&!fi(u,r))return u[r]}}catch(r){i.e(r)}finally{i.f()}}var a=In("_builtin_functions");return a&&li.call(a,r)&&"function"==typeof a[r]?a[r]:null}function vi(r){return Y.has(r)}function _i(r){var n;return null!==(n=nr[r])&&void 0!==n?n:-1}function di(r,n,t){if(vi(t))return Qe(r,n,t);if(function(r){return rr.has(r)}(t))return function(r,n,t){var e=Xe(r);switch(t){case"&&":return!!e&&Xe(n);case"||":return!!e||Xe(n);default:throw new Error("未知的逻辑运算符: ".concat(t))}}(r,n,t);if(function(r){return["+","-","*","/","%","**","//"].includes(r)}(t))return function(r,n,t){if(void 0===r||void 0===n)throw new Error("无效的操作数对:v1:".concat(r,", v2:").concat(n));var e=Ke(r),i=Ke(n);switch(t){case"+":return e.plus(i);case"-":return e.minus(i);case"*":return e.times(i);case"/":return e.div(i);case"%":return e.mod(i);case"**":if(!e.isZero()&&!e.abs().eq(1)&&i.isFinite()&&!i.isZero()&&i.times(e.abs().log()).abs().gt(1e6))throw new Error("幂运算结果数量级过大,超出安全上限");return e.pow(i);case"//":return e.divToInt(i);default:throw new Error("未知的运算符: ".concat(t))}}(r,n,t);throw new Error("未知的运算符: ".concat(t))}function hi(r,n,t){var e=r.slice(n,t);return e.has_var=r.has_var,e.has_unit=r.has_unit,e.unit=r.unit,e._fill_data=r._fill_data,e._unit=r._unit,e._options=r._options,e}function gi(r){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.length,e=n;e<t;e++){var i=r[e];if("logical"===i.type||"ternary_question"===i.type||"ternary_colon"===i.type)return!0}return!1}function mi(r,n){for(var t=0,e=n;e<r.length;e++)if("("===r[e].value)t++;else if(")"===r[e].value&&0===--t)return e;return-1}function yi(r,n){for(var t=0,e=0;e<r.length;e++)if("("===r[e].value)t++;else if(")"===r[e].value)t--;else if(0===t&&r[e].value===n)return e;return-1}function bi(r){return"boolean"==typeof r?{type:"boolean",value:r}:"string"==typeof r?{type:"string",value:r}:{type:"number",value:String(r),real_value:r,has_unit:!1}}function wi(r){if(r.length>1&&"("===r[0].value){var n=mi(r,0);if(n===r.length-1&&gi(r,1,n))return wi(hi(r,1,n))}var t=function(r){for(var n=0,t=-1,e=0,i=0;i<r.length;i++){var u=r[i].value;if("("!==u)if(")"!==u){if(0===n)if("?"===u)-1===t?t=i:e++;else if(":"===u&&-1!==t){if(0===e)return{question_index:t,colon_index:i};e--}}else n--;else n++}return null}(r);if(t){var e=wi(hi(r,0,t.question_index));return wi(hi(r,Xe(e)?t.question_index+1:t.colon_index+1,Xe(e)?t.colon_index:r.length))}var i=yi(r,"||");if(-1!==i)return!!Xe(wi(hi(r,0,i)))||Xe(wi(hi(r,i+1,r.length)));var u=yi(r,"&&");if(-1!==u)return!!Xe(wi(hi(r,0,u)))&&Xe(wi(hi(r,u+1,r.length)));for(var a=0;a<r.length;a++)if("("===r[a].value){var o=mi(r,a);if(-1===o)break;if(gi(r,a+1,o)){var s=wi(hi(r,a+1,o)),c=hi(r,0,a);return c.push(bi(s)),c.push.apply(c,l(r.slice(o+1))),wi(c)}a=o}return function(r){if(1===r.length){var n=r[0];if("number"===n.type||"var"===n.type||"fallback_var"===n.type)return"boolean"==typeof n.real_value?n.real_value:new Ae(n.real_value);if("boolean"===n.type)return n.value;if("string"===n.type)return n.value;if("function"===n.type){var t=n.value,e=n.fn||pi(t,r._fill_data);if(!e)throw new Error("未知的函数: ".concat(t));var i=n.args.map(function(n){var t=Cn(n,r._fill_data,r._unit,r._options);return t._fill_data=r._fill_data,t._unit=r._unit,t._options=r._options,xi(t)});return e.apply(void 0,l(i))}throw new Error("错误的表达式:".concat(n.value))}var u,a=[],o=[],s={active:!1,failed:!1,lastValue:null};function c(r,n,t){return vi(t)&&s.failed?(s.failed=!1,!1):di(r,n,t)}for(var f=0,p=r.length;f<p;f++)if("number"!==(u=r[f]).type&&"var"!==u.type&&"fallback_var"!==u.type)if("boolean"!==u.type)if("string"!==u.type)if("function"!==u.type)if("logical_not"!==u.type)if("ternary_question"!==u.type&&"?"!==u.value)if("ternary_colon"!==u.type&&":"!==u.value)if("operator"!==u.type&&"comparison"!==u.type&&"logical"!==u.type)if("("!==u.value)if(")"!==u.value)"function_result"!==u.type||o.push(u.value);else for(;a.length>0;){var v=a.pop();if("("===v){if(a.length>0&&("-"===a[a.length-1]||"+"===a[a.length-1])){var _=a[a.length-1],d=a.length>1?a[a.length-2]:null;if(null===d&&1===o.length||"("===d&&1===o.length||["+","-","*","/","%","**","//","?",":"].includes(d))if("-"===_){a.pop();var h=o.pop();Je(h)?o.push(h.negated()):"number"==typeof h?o.push(-h):"boolean"==typeof h?o.push(!h):o.push(new Ae(h).negated())}else"+"===_&&a.pop()}else{var g=o[o.length-2];if("-"===g){var m=o.pop();o.pop(),Je(m)?o.push(m.negated()):"number"==typeof m?o.push(-m):"boolean"==typeof m?o.push(!m):o.push(new Ae(m).negated())}else if("+"===g){var y=o.pop();o.pop(),o.push(y)}}break}if("!"===v){var b=o.pop();o.push(Ye(b))}else if(":"===v&&a.length>0&&"?"===a[a.length-1]){var w=o.pop();a.pop();var x=o.pop(),S=o.pop();o.push(Xe(S)?x:w)}else{if("?"===v){a.push("?");break}var N=o.pop(),E=o.pop();o.push(c(E,N,v))}}else a.push("(");else{var A=u.value,j=_i(A);if(vi(A)&&s.active)for(;a.length>0;){var O=a[a.length-1];if("("===O||"?"===O)break;if(_i(O)<j)break;if(vi(O)){a.pop();var k=o.pop(),F=o.pop(),q=!s.failed&&Qe(F,k,O);s.lastValue=k,q||(s.failed=!0),o.push(k);break}a.pop();var M=o.pop(),W=o.pop();o.push(c(W,M,O))}vi(A)?s.active=!0:s.active=!1;var P=a[a.length-1];if("("===P){a.push(A);continue}if(!a.length){a.push(A);continue}if("**"===A){a.push(A);continue}for(;a.length>0&&"("!==(P=a[a.length-1])&&"?"!==P;){var z=_i(P);if(z<j)break;if(z===j&&"**"===A)break;if("!"!==P&&o.length<2)break;if(a.pop(),"!"===P){var I=o.pop();o.push(Ye(I))}else{var D=o.pop(),T=o.pop();void 0!==T||"-"!==P&&"+"!==P?o.push(c(T,D,P)):"-"===P?Je(D)?o.push(D.negated()):"number"==typeof D?o.push(-D):o.push(new Ae(D).negated()):o.push(D)}}a.push(A)}else{for(;a.length>0;){var Z=a[a.length-1];if("?"===Z)break;if("("===Z)break;if(":"===Z){if(a.length>1&&"?"===a[a.length-2]){a.pop(),a.pop();var $=o.pop(),U=o.pop(),R=o.pop();o.push(Xe(R)?U:$);continue}break}a.pop();var B=o.pop(),C=o.pop();o.push(c(C,B,Z))}a.push(":")}else{for(;a.length>0;){var L=a[a.length-1];if("("===L||"?"===L)break;if(_i(L)<=_i("?"))break;a.pop();var H=o.pop(),V=o.pop();o.push(c(V,H,L))}a.push("?")}else a.push("!");else{var G=u.value,K=u.fn||pi(G,r._fill_data);if(!K)throw new Error("未知的函数: ".concat(G));var J=u.args.map(function(n){var t=Cn(n,r._fill_data,r._unit,r._options);return t._fill_data=r._fill_data,t._unit=r._unit,t._options=r._options,xi(t)}),Q=K.apply(void 0,l(J));o.push(Q)}else o.push(u.value);else o.push(u.value);else o.push(u.real_value);for(;a.length>0;){var X=a.pop();if("!"===X){var Y=o.pop();o.push(Ye(Y))}else if(":"===X&&a.length>0&&"?"===a[a.length-1]){var rr=o.pop();a.pop();var nr=o.pop(),tr=o.pop();o.push(Xe(tr)?nr:rr)}else{if("?"===X)continue;var er=o.pop(),ir=o.pop();void 0!==ir||"-"!==X&&"+"!==X?o.push(c(ir,er,X)):"-"===X?Je(er)?o.push(er.negated()):"number"==typeof er?o.push(-er):o.push(new Ae(er).negated()):o.push(er)}}if(1!==o.length)throw new Error("可能出现了错误的计算式");r.has_var||(r.calc_result=o[0]);return o[0]}(r)}function xi(r){var n=wi(r);return r.has_var||(r.calc_result=n),n}var Si=null;function Ni(){if(!Si)throw new Error("calc function not registered for calc_sum");return Si}function Ei(r,n){if(!n)return r;var t=_n(n,null);return c(Te(new Ae(r),t,{}),1)[0]}function Ai(r){if("boolean"==typeof r)return null;try{return new Ae(r)}catch(r){return null}}function ji(r){var n=Zn(r);return{inner_expr:n.expr,fmt_str:n.fmt||void 0}}function Oi(r,n){var t=Ni(),e={_error:"-"},i=ji(r),u=i.inner_expr,o=i.fmt_str;if(0===n.length)return t(r,e);for(var s=new Ae(0),c=0;c<n.length;c++){var l=t(u,a(a({},e),n[c]));if(l===e._error)return e._error;var f=Ai(l);if(null===f)return e._error;s=s.plus(f)}return Ei(s.toFixed(),o)}function ki(r,n){var t=Ni(),e={_error:"-"},i=ji(r),u=i.inner_expr,o=i.fmt_str;if(0===n.length)return Ei("0",o);for(var s=new Ae(0),c=0;c<n.length;c++){var l=t(u,a(a({},e),n[c]));if(l===e._error)return e._error;var f=Ai(l);if(null===f)return e._error;s=s.plus(f)}return Ei(s.div(n.length).toFixed(),o)}function Fi(r,n){var t=Ni(),e={_error:"-"},i=ji(r),u=i.inner_expr,o=i.fmt_str;if(0===n.length)return Ei("0",o);for(var s=null,c=0;c<n.length;c++){var l=t(u,a(a({},e),n[c]));if(l===e._error)return e._error;var f=Ai(l);if(null===f)return e._error;(null===s||f.gt(s))&&(s=f)}return Ei(s.toFixed(),o)}function qi(r,n){var t=Ni(),e={_error:"-"},i=ji(r),u=i.inner_expr,o=i.fmt_str;if(0===n.length)return Ei("0",o);for(var s=null,c=0;c<n.length;c++){var l=t(u,a(a({},e),n[c]));if(l===e._error)return e._error;var f=Ai(l);if(null===f)return e._error;(null===s||f.lt(s))&&(s=f)}return Ei(s.toFixed(),o)}function Mi(r,n){var t=Ni(),e={_error:"-"},i=ji(r).inner_expr;if(0===n.length)return"0";for(var u=0,o=0;o<n.length;o++){var s=t(i,a(a({},e),n[o]));if(s===e._error)return e._error;if(!0!==s&&"true"!==s){if(!1!==s&&"false"!==s){var c=Ai(s);if(null===c)return e._error;c.isZero()||u++}}else u++}return String(u)}function Wi(r,n){return new Ae(r).plus(n).toFixed()}function Pi(r,n){return new Ae(r).minus(n).toFixed()}function zi(r,n){return new Ae(r).times(n).toFixed()}function Ii(r,n){var t=new Ae(n);if(t.isZero()){var e=In("_error");if(void 0!==e)return e;throw new Error("Division by zero")}return new Ae(r).div(t).toFixed()}function Di(r,n){var t=new Ae(n);if(t.isZero()){var e=In("_error");if(void 0!==e)return e;throw new Error("Modulo by zero")}return new Ae(r).mod(t).toFixed()}function Ti(r,n){return new Ae(r).pow(n).toFixed()}function Zi(r,n){var t=new Ae(n);if(t.isZero()){var e=In("_error");if(void 0!==e)return e;throw new Error("Division by zero")}return new Ae(r).divToInt(t).toFixed()}function $i(r){return new Ae(r).abs().toFixed()}function Ui(r){return new Ae(r).neg().toFixed()}function Ri(r){return new Ae(r).sqrt().toFixed()}function Bi(r){return new Ae(r).cbrt().toFixed()}function Ci(r){return new Ae(r).exp().toFixed()}function Li(r){return new Ae(r).ln().toFixed()}function Hi(r,n){return new Ae(r).log(n).toFixed()}function Vi(r){return new Ae(r).log(2).toFixed()}function Gi(r){return new Ae(r).log(10).toFixed()}function Ki(r){return new Ae(r).sin().toFixed()}function Ji(r){return new Ae(r).cos().toFixed()}function Qi(r){return new Ae(r).tan().toFixed()}function Xi(r){return new Ae(r).asin().toFixed()}function Yi(r){return new Ae(r).acos().toFixed()}function ru(r){return new Ae(r).atan().toFixed()}function nu(r){return new Ae(r).sinh().toFixed()}function tu(r){return new Ae(r).cosh().toFixed()}function eu(r){return new Ae(r).tanh().toFixed()}function iu(r){return new Ae(r).asinh().toFixed()}function uu(r){return new Ae(r).acosh().toFixed()}function au(r){return new Ae(r).atanh().toFixed()}function ou(r){return new Ae(r).floor().toFixed()}function su(r){return new Ae(r).ceil().toFixed()}function cu(r){return new Ae(r).trunc().toFixed()}function lu(r){return new Ae(r).round().toFixed()}function fu(r,n){return Ae.max(r,n).toFixed()}function pu(r,n){return Ae.min(r,n).toFixed()}function vu(r,n){return new Ae(r).cmp(n)}function _u(r,n){return new Ae(r).eq(n)}function du(r,n){return new Ae(r).lt(n)}function hu(r,n){return new Ae(r).gt(n)}function gu(r,n){return new Ae(r).lte(n)}function mu(r,n){return new Ae(r).gte(n)}var yu={add:Wi,sub:Pi,mul:zi,div:Ii,mod:Di,pow:Ti,idiv:Zi,abs:$i,neg:Ui,sqrt:Ri,cbrt:Bi,exp:Ci,ln:Li,log:Hi,log2:Vi,log10:Gi,sin:Ki,cos:Ji,tan:Qi,asin:Xi,acos:Yi,atan:ru,sinh:nu,cosh:tu,tanh:eu,asinh:iu,acosh:uu,atanh:au,floor:ou,ceil:su,trunc:cu,round:lu,max:fu,min:pu,compare:vu,eq:_u,lt:du,gt:hu,lte:gu,gte:mu},bu=Wi,wu=Pi,xu=zi,Su=Ii,Nu=Di,Eu=Ti,Au=Zi,ju=$i,Ou=Ui,ku=Ri,Fu=Bi,qu=Ci,Mu=Li,Wu=Hi,Pu=Vi,zu=Gi,Iu=Ki,Du=Ji,Tu=Qi,Zu=Xi,$u=Yi,Uu=ru,Ru=nu,Bu=tu,Cu=eu,Lu=iu,Hu=uu,Vu=au,Gu=ou,Ku=su,Ju=cu,Qu=lu,Xu=fu,Yu=pu,ra=vu,na=_u,ta=du,ea=hu,ia=gu,ua=mu,aa=1e6;function oa(r){if(!Number.isSafeInteger(r))throw new RangeError("BigInt power must be a safe integer");if(r<=0)return 1n;if(r>aa)throw new RangeError("BigInt power exceeds the safe limit ".concat(aa));return BigInt("1"+"0".repeat(r))}function sa(r){var n=String(r);if(n.includes("e")||n.includes("E"))return function(r){var n=r.toLowerCase().split("e"),t=c(n,2),e=t[0],i=t[1],u=parseInt(i,10),a=sa(e),o=a.value,s=a.scale,l=s-u;if(l<0)return{value:o*oa(-l),scale:0};return{value:o,scale:l}}(n);var t=n.startsWith("-"),e=c((t?n.slice(1):n).split("."),2),i=e[0],u=void 0===i?"0":i,a=e[1],o=void 0===a?"":a,s=o.length,l=(u+o).replace(/^0+/,"")||"0";return{value:BigInt(t?"-"+l:l),scale:s}}function ca(r,n){var t=r<0n,e=(t?-r:r).toString();if(n<=0)return(t?"-":"")+e+"0".repeat(-n);for(;e.length<=n;)e="0"+e;var i=e.slice(0,-n),u=e.slice(-n).replace(/0+$/,""),a=u?"".concat(i,".").concat(u):i;return t?"-"+a:a}function la(r,n){if(0n===r)return{value:0n,scale:0};for(;n>0&&r%10n==0n;)r/=10n,n--;return{value:r,scale:n}}function fa(r,n,t,e){return n>e?{a_val:r,b_val:t*=oa(n-e),scale:n}:e>n?{a_val:r*=oa(e-n),b_val:t,scale:e}:{a_val:r,b_val:t,scale:n}}function pa(r,n){var t="string"==typeof r?sa(r):r,e="string"==typeof n?sa(n):n;return la(t.value*e.value,t.scale+e.scale)}function va(r,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:20,e="string"==typeof r?sa(r):r,i="string"==typeof n?sa(n):n;if(0n===i.value)throw new Error("Division by zero");var u=oa(t);return la(e.value*u/i.value,e.scale-i.scale+t)}function _a(r,n){var t="string"==typeof r?sa(r):r,e="bigint"==typeof n?n:BigInt(Math.floor(Number(n)));if(e<0n)return va({value:1n,scale:0},_a(t,-e));if(0n===e)return{value:1n,scale:0};if(1n===e)return t;for(var i={value:1n,scale:0},u=t,a=e;a>0n;)a%2n==1n&&(i=pa(i,u)),(a/=2n)>0n&&(u=pa(u,u));return la(i.value,i.scale)}function da(r,n){var t="string"==typeof r?sa(r):r,e="string"==typeof n?sa(n):n,i=fa(t.value,t.scale,e.value,e.scale),u=i.a_val,a=i.b_val;return u<a?-1:u>a?1:0}function ha(r,n){return da(r,n)<0}function ga(r,n){return da(r,n)>0}function ma(r){var n="string"==typeof r?sa(r):r;if(n.scale<=0)return{value:n.value*oa(-n.scale),scale:0};var t=oa(n.scale);return{value:n.value/t,scale:0}}function ya(r,n){var t=function(r,n){var t="string"==typeof r?sa(r):r,e="string"==typeof n?sa(n):n,i=fa(t.value,t.scale,e.value,e.scale);return la(i.a_val+i.b_val,i.scale)}(r,n);return ca(t.value,t.scale)}function ba(r,n){var t=function(r,n){var t="string"==typeof r?sa(r):r,e="string"==typeof n?sa(n):n,i=fa(t.value,t.scale,e.value,e.scale);return la(i.a_val-i.b_val,i.scale)}(r,n);return ca(t.value,t.scale)}function wa(r,n){var t=pa(r,n);return ca(t.value,t.scale)}function xa(r,n){if(0n===sa(n).value){var t=In("_error");if(void 0!==t)return t;throw new Error("Division by zero")}var e=va(r,n,In("_div_precision")||20);return ca(e.value,e.scale)}function Sa(r,n){if(0n===sa(n).value){var t=In("_error");if(void 0!==t)return t;throw new Error("Modulo by zero")}var e=function(r,n){var t="string"==typeof r?sa(r):r,e="string"==typeof n?sa(n):n;if(0n===e.value)throw new Error("Modulo by zero");var i=fa(t.value,t.scale,e.value,e.scale);return la(i.a_val%i.b_val,i.scale)}(r,n);return ca(e.value,e.scale)}function Na(r,n){var t=Number(n);if(!Number.isInteger(t))return Ti(r,n);var e=_a(r,t);return ca(e.value,e.scale)}function Ea(r,n){if(0n===sa(n).value){var t=In("_error");if(void 0!==t)return t;throw new Error("Division by zero")}var e=va(r,n,In("_div_precision")||20),i=ma({value:e.value,scale:e.scale});return ca(i.value,i.scale)}function Aa(r){var n=function(r){var n="string"==typeof r?sa(r):r;return{value:n.value<0n?-n.value:n.value,scale:n.scale}}(r);return ca(n.value,n.scale)}function ja(r){var n=function(r){var n="string"==typeof r?sa(r):r;return{value:-n.value,scale:n.scale}}(r);return ca(n.value,n.scale)}function Oa(r){var n=function(r){var n="string"==typeof r?sa(r):r;if(n.scale<=0)return{value:n.value*oa(-n.scale),scale:0};var t=oa(n.scale),e=n.value/t;return n.value<0n&&n.value%t!==0n&&(e-=1n),{value:e,scale:0}}(r);return ca(n.value,n.scale)}function ka(r){var n=function(r){var n="string"==typeof r?sa(r):r;if(n.scale<=0)return{value:n.value*oa(-n.scale),scale:0};var t=oa(n.scale),e=n.value/t;return n.value>0n&&n.value%t!==0n&&(e+=1n),{value:e,scale:0}}(r);return ca(n.value,n.scale)}function Fa(r){var n=ma(r);return ca(n.value,n.scale)}function qa(r){var n=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t="string"==typeof r?sa(r):r,e=n;if(t.scale<=e){var i=e-t.scale;return{value:t.value*oa(i),scale:e}}var u=oa(t.scale-e),a=u/2n,o=t.value/u,s=t.value%u;return t.value>=0n?s>=a&&(o+=1n):-s>=a&&(o-=1n),la(o,e)}(r,0);return ca(n.value,n.scale)}function Ma(r,n){var t=function(r,n){return ga(r,n)?"string"==typeof r?sa(r):r:"string"==typeof n?sa(n):n}(r,n);return ca(t.value,t.scale)}function Wa(r,n){var t=function(r,n){return ha(r,n)?"string"==typeof r?sa(r):r:"string"==typeof n?sa(n):n}(r,n);return ca(t.value,t.scale)}function Pa(r,n){return da(r,n)}function za(r,n){return function(r,n){return 0===da(r,n)}(r,n)}function Ia(r,n){return ha(r,n)}function Da(r,n){return ga(r,n)}function Ta(r,n){return function(r,n){return da(r,n)<=0}(r,n)}function Za(r,n){return function(r,n){return da(r,n)>=0}(r,n)}var $a=ya,Ua=ba,Ra=wa,Ba=xa,Ca=Sa,La=Na,Ha=Ea,Va=Aa,Ga=ja,Ka=Oa,Ja=ka,Qa=Fa,Xa=qa,Ya=Ma,ro=Wa,no=Pa,to=za,eo=Ia,io=Da,uo=Ta,ao=Za,oo=Ri,so=Bi,co=Ci,lo=Li,fo=Hi,po=Vi,vo=Gi,_o=Ki,ho=Ji,go=Qi,mo=Xi,yo=Yi,bo=ru,wo=nu,xo=tu,So=eu,No=iu,Eo=uu,Ao=au,jo=null,Oo=!1,ko=!1,Fo=[],qo=null;function Mo(r){return Wo.apply(this,arguments)}function Wo(){return(Wo=t(o().m(function r(n){var t,e,i,u;return o().w(function(r){for(;;)switch(r.p=r.n){case 0:if(!Oo){r.n=1;break}return r.a(2,jo);case 1:if(!ko){r.n=2;break}return r.a(2,new Promise(function(r,n){Fo.push({resolve:r,reject:n})}));case 2:return ko=!0,r.p=3,r.n=4,import("./wasm_calc.js");case 4:if(t=r.v,e="undefined"!=typeof window,i="undefined"!=typeof process&&process.versions&&process.versions.node,!e){r.n=8;break}if(!n){r.n=6;break}return r.n=5,t.default(n);case 5:r.n=7;break;case 6:return r.n=7,t.default();case 7:case 9:case 16:r.n=18;break;case 8:if(!i){r.n=10;break}return r.n=9,Po(t);case 10:if("function"!=typeof globalThis.fetch){r.n=17;break}if(r.p=11,!n){r.n=13;break}return r.n=12,t.default(n);case 12:r.n=14;break;case 13:return r.n=14,t.default();case 14:r.n=16;break;case 15:return r.p=15,r.v,r.n=16,Po(t);case 17:throw new Error("Unsupported environment for WASM loading");case 18:return jo=t,Oo=!0,$o(),Fo.forEach(function(r){return r.resolve(t)}),Fo=[],r.a(2,t);case 19:throw r.p=19,u=r.v,ko=!1,Fo.forEach(function(r){return r.reject(u)}),Fo=[],console.warn("WASM module failed to load, using Decimal fallback:",u),u;case 20:return r.a(2)}},r,null,[[11,15],[3,19]])}))).apply(this,arguments)}function Po(r){return zo.apply(this,arguments)}function zo(){return(zo=t(o().m(function r(n){var t,e,i,u,a,s,c,l,f,p,v,_,d,h,g,m;return o().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.n=1,import("fs");case 1:return t=r.v,e=t.readFileSync,r.n=2,import("url");case 2:return i=r.v,u=i.fileURLToPath,r.n=3,import("path");case 3:a=r.v,s=a.dirname,c=a.join,l=u(import.meta.url),f=s(l),p=[c(f,"../../src/wasm/wasm_calc_bg.wasm"),c(f,"../src/wasm/wasm_calc_bg.wasm"),c(f,"../src/wasm/wasm_calc_bg.wasm"),c(f,"../../wasm-calc/pkg/wasm_calc_bg.wasm"),c(f,"../wasm/wasm_calc_bg.wasm")],v=null,_=null,d=0,h=p;case 4:if(!(d<h.length)){r.n=8;break}return g=h[d],r.p=5,v=e(g),r.a(3,8);case 6:r.p=6,m=r.v,_=m;case 7:d++,r.n=4;break;case 8:if(v){r.n=9;break}throw _||new Error("WASM file not found");case 9:n.initSync({module:v});case 10:return r.a(2)}},r,null,[[5,6]])}))).apply(this,arguments)}function Io(){return Oo}var Do={add:Wi,sub:Pi,mul:zi,div:Ii,mod:Di,pow:Ti,idiv:Zi,abs:$i,neg:Ui,sqrt:Ri,exp:Ci,ln:Li,log10:Gi,sin:Ki,cos:Ji,tan:Qi,floor:ou,ceil:su,trunc:cu,round:lu,max:fu,min:pu,compare:vu,eq:_u,lt:du,gt:hu,lte:gu,gte:mu,cbrt:Bi,log:Hi,log2:Vi,asin:Xi,acos:Yi,atan:ru,sinh:nu,cosh:tu,tanh:eu,asinh:iu,acosh:uu,atanh:au};var To=function(r){return ko||Oo||Mo().catch(function(){}),qo(r)};function Zo(r){return To(r)}function $o(){Do.add=function(r,n){return jo.str_plus(String(r),String(n))},Do.sub=function(r,n){return jo.str_sub(String(r),String(n))},Do.mul=function(r,n){return jo.str_mul(String(r),String(n))},Do.div=function(r,n){var t=jo.str_div(String(r),String(n));if("NaN"===t){var e=In("_error");if(void 0!==e)return e;throw new Error("Division by zero")}return t},Do.mod=function(r,n){var t=jo.str_mod(String(r),String(n));if("NaN"===t){var e=In("_error");if(void 0!==e)return e;throw new Error("Modulo by zero")}return t},Do.pow=function(r,n){var t=jo.str_powd(String(r),String(n));return"NaN"===t||"Overflow"===t?Ti(r,n):t},Do.idiv=function(r,n){var t=jo.str_div(String(r),String(n));if("NaN"===t){var e=In("_error");if(void 0!==e)return e;throw new Error("Division by zero")}return jo.str_trunc(t)},Do.abs=function(r){return jo.str_abs(String(r))},Do.neg=function(r){return jo.str_neg(String(r))},Do.sqrt=function(r){var n=jo.str_sqrt(String(r));return"NaN"===n?Ri(r):n},Do.exp=function(r){return jo.str_exp(String(r))},Do.ln=function(r){var n=jo.str_ln(String(r));return"NaN"===n?Li(r):n},Do.log10=function(r){var n=jo.str_log10(String(r));return"NaN"===n?Gi(r):n},Do.sin=function(r){return jo.str_sin(String(r))},Do.cos=function(r){return jo.str_cos(String(r))},Do.tan=function(r){return jo.str_tan(String(r))},Do.floor=function(r){return jo.str_floor(String(r))},Do.ceil=function(r){return jo.str_ceil(String(r))},Do.trunc=function(r){return jo.str_trunc(String(r))},Do.round=function(r){return jo.str_round(String(r))},Do.max=function(r,n){return jo.str_max(String(r),String(n))},Do.min=function(r,n){return jo.str_min(String(r),String(n))},Do.compare=function(r,n){return jo.str_compare(String(r),String(n))},Do.eq=function(r,n){return jo.str_eq(String(r),String(n))},Do.lt=function(r,n){return jo.str_lt(String(r),String(n))},Do.gt=function(r,n){return jo.str_gt(String(r),String(n))},Do.lte=function(r,n){return jo.str_lte(String(r),String(n))},Do.gte=function(r,n){return jo.str_gte(String(r),String(n))},To=function(r){var n=jo.eval_expr(String(r));if(n.startsWith("Error:")){var t=In("_error");if(void 0!==t)return t;throw new Error(n)}return n},Ro=function(r,n){return jo.str_plus(String(r),String(n))},Bo=function(r,n){return jo.str_sub(String(r),String(n))},Co=function(r,n){return jo.str_mul(String(r),String(n))},Lo=function(r,n){var t=jo.str_div(String(r),String(n));if("NaN"===t){var e=In("_error");if(void 0!==e)return e;throw new Error("Division by zero")}return t},Ho=function(r,n){var t=jo.str_mod(String(r),String(n));if("NaN"===t){var e=In("_error");if(void 0!==e)return e;throw new Error("Modulo by zero")}return t},Vo=function(r,n){var t=jo.str_powd(String(r),String(n));return"NaN"===t||"Overflow"===t?Ti(r,n):t},Go=function(r,n){var t=jo.str_div(String(r),String(n));if("NaN"===t){var e=In("_error");if(void 0!==e)return e;throw new Error("Division by zero")}return jo.str_trunc(t)},Ko=function(r){return jo.str_abs(String(r))},Jo=function(r){return jo.str_neg(String(r))},Qo=function(r){var n=jo.str_sqrt(String(r));return"NaN"===n?Ri(r):n},Yo=function(r){return jo.str_exp(String(r))},rs=function(r){var n=jo.str_ln(String(r));return"NaN"===n?Li(r):n},es=function(r){var n=jo.str_log10(String(r));return"NaN"===n?Gi(r):n},is=function(r){return jo.str_sin(String(r))},us=function(r){return jo.str_cos(String(r))},as=function(r){return jo.str_tan(String(r))},hs=function(r){return jo.str_floor(String(r))},gs=function(r){return jo.str_ceil(String(r))},ms=function(r){return jo.str_trunc(String(r))},ys=function(r){return jo.str_round(String(r))},bs=function(r,n){return jo.str_max(String(r),String(n))},ws=function(r,n){return jo.str_min(String(r),String(n))},xs=function(r,n){return jo.str_compare(String(r),String(n))},Ss=function(r,n){return jo.str_eq(String(r),String(n))},Ns=function(r,n){return jo.str_lt(String(r),String(n))},Es=function(r,n){return jo.str_gt(String(r),String(n))},As=function(r,n){return jo.str_lte(String(r),String(n))},js=function(r,n){return jo.str_gte(String(r),String(n))}}function Uo(){ko||Oo||Mo().catch(function(){})}var Ro=function(r,n){return Uo(),Wi(r,n)},Bo=function(r,n){return Uo(),Pi(r,n)},Co=function(r,n){return Uo(),zi(r,n)},Lo=function(r,n){return Uo(),Ii(r,n)},Ho=function(r,n){return Uo(),Di(r,n)},Vo=function(r,n){return Uo(),Ti(r,n)},Go=function(r,n){return Uo(),Zi(r,n)},Ko=function(r){return Uo(),$i(r)},Jo=function(r){return Uo(),Ui(r)},Qo=function(r){return Uo(),Ri(r)},Xo=function(r){return Uo(),Bi(r)},Yo=function(r){return Uo(),Ci(r)},rs=function(r){return Uo(),Li(r)},ns=function(r,n){return Uo(),Hi(r,n)},ts=function(r){return Uo(),Vi(r)},es=function(r){return Uo(),Gi(r)},is=function(r){return Uo(),Ki(r)},us=function(r){return Uo(),Ji(r)},as=function(r){return Uo(),Qi(r)},os=function(r){return Uo(),Xi(r)},ss=function(r){return Uo(),Yi(r)},cs=function(r){return Uo(),ru(r)},ls=function(r){return Uo(),nu(r)},fs=function(r){return Uo(),tu(r)},ps=function(r){return Uo(),eu(r)},vs=function(r){return Uo(),iu(r)},_s=function(r){return Uo(),uu(r)},ds=function(r){return Uo(),au(r)},hs=function(r){return Uo(),ou(r)},gs=function(r){return Uo(),su(r)},ms=function(r){return Uo(),cu(r)},ys=function(r){return Uo(),lu(r)},bs=function(r,n){return Uo(),fu(r,n)},ws=function(r,n){return Uo(),pu(r,n)},xs=function(r,n){return Uo(),vu(r,n)},Ss=function(r,n){return Uo(),_u(r,n)},Ns=function(r,n){return Uo(),du(r,n)},Es=function(r,n){return Uo(),hu(r,n)},As=function(r,n){return Uo(),gu(r,n)},js=function(r,n){return Uo(),mu(r,n)};var Os={decimal:yu,bigint:{add:ya,sub:ba,mul:wa,div:xa,mod:Sa,pow:Na,idiv:Ea,abs:Aa,neg:ja,floor:Oa,ceil:ka,trunc:Fa,round:qa,max:Ma,min:Wa,compare:Pa,eq:za,lt:Ia,gt:Da,lte:Ta,gte:Za,sqrt:Ri,cbrt:Bi,exp:Ci,ln:Li,log:Hi,log2:Vi,log10:Gi,sin:Ki,cos:Ji,tan:Qi,asin:Xi,acos:Yi,atan:ru,sinh:nu,cosh:tu,tanh:eu,asinh:iu,acosh:uu,atanh:au},wasm:Do},ks=a({},yu);function Fs(r){var n=In("_error");return void 0!==n&&r===n}function qs(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];var e=n.length>0&&"string"===n[n.length-1]?"string":"number",i="string"===e?n.slice(0,-1):n;if(0===i.length)return"number"===e?0:"0";for(var u=String(i[0]),a=1;a<i.length;a++)u=ks.add(u,String(i[a]));return"number"===e?Number(u):u}function Ms(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];var e=n.length>0&&"string"===n[n.length-1]?"string":"number",i="string"===e?n.slice(0,-1):n;if(0===i.length)return"number"===e?0:"0";if(1===i.length){var u=ks.neg(ks.neg(String(i[0])));return"number"===e?Number(u):u}for(var a=String(i[0]),o=1;o<i.length;o++)a=ks.sub(a,String(i[o]));return"number"===e?Number(a):a}function Ws(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];var e=n.length>0&&"string"===n[n.length-1]?"string":"number",i="string"===e?n.slice(0,-1):n;if(0===i.length)return"number"===e?1:"1";for(var u=String(i[0]),a=1;a<i.length;a++)u=ks.mul(u,String(i[a]));return"number"===e?Number(u):u}function Ps(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];var e=n.length>0&&"string"===n[n.length-1]?"string":"number",i="string"===e?n.slice(0,-1):n;if(0===i.length)return"number"===e?1:"1";if(1===i.length){var u=String(i[0]);return"number"===e?Number(u):u}for(var a=String(i[0]),o=1;o<i.length;o++)if(Fs(a=ks.div(a,String(i[o]))))return a;return"number"===e?Number(a):a}function zs(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];var e=n.length>0&&"string"===n[n.length-1]?"string":"number",i="string"===e?n.slice(0,-1):n;if(0===i.length)return"number"===e?0:"0";if(1===i.length){var u=String(i[0]);return"number"===e?Number(u):u}for(var a=String(i[0]),o=1;o<i.length;o++)if(Fs(a=ks.mod(a,String(i[o]))))return a;return"number"===e?Number(a):a}function Is(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];var e=n.length>0&&"string"===n[n.length-1]?"string":"number",i="string"===e?n.slice(0,-1):n;if(0===i.length)return"number"===e?1:"1";if(1===i.length){var u=String(i[0]);return"number"===e?Number(u):u}for(var a=String(i[i.length-1]),o=i.length-2;o>=0;o--)a=ks.pow(String(i[o]),a);return"number"===e?Number(a):a}function Ds(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];var e=n.length>0&&"string"===n[n.length-1]?"string":"number",i="string"===e?n.slice(0,-1):n;if(0===i.length)return"number"===e?0:"0";if(1===i.length){var u=String(i[0]);return"number"===e?Number(u):u}for(var a=String(i[0]),o=1;o<i.length;o++)if(Fs(a=ks.idiv(a,String(i[o]))))return a;return"number"===e?Number(a):a}function Ts(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"number",t=ks.abs(String(r));return"number"===n?Number(t):t}function Zs(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"number",t=ks.neg(String(r));return"number"===n?Number(t):t}function $s(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"number",t=ks.sqrt(String(r));return"number"===n?Number(t):t}function Us(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"number",t=ks.ln(String(r));return"number"===n?Number(t):t}function Rs(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"number",t=ks.exp(String(r));return"number"===n?Number(t):t}function Bs(r,n){if(!n)return r;var t=_n(n,null);return c(Te(new Ae(r),t,{}),1)[0]}function Cs(r){if("function"==typeof r){var n=r();return Fs(n),n}return r}function Ls(r){var n=String(r),t=Fs(r),e=function(r){return t?n:r?Bs(n,r):n};return e.add=function(){if(t)return e;for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];for(var a=0,o=i;a<o.length;a++){var s=Cs(o[a]);if(Fs(n=qs(n,s,"string")))return t=!0,e}return e},e.sub=function(){if(t)return e;for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];for(var a=0,o=i;a<o.length;a++){var s=Cs(o[a]);if(Fs(n=Ms(n,s,"string")))return t=!0,e}return e},e.mul=function(){if(t)return e;for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];for(var a=0,o=i;a<o.length;a++){var s=Cs(o[a]);if(Fs(n=Ws(n,s,"string")))return t=!0,e}return e},e.div=function(){if(t)return e;for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];for(var a=0,o=i;a<o.length;a++){var s=Cs(o[a]);if(Fs(n=Ps(n,s,"string")))return t=!0,e}return e},e.mod=function(){if(t)return e;for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];for(var a=0,o=i;a<o.length;a++){var s=Cs(o[a]);if(Fs(n=zs(n,s,"string")))return t=!0,e}return e},e.pow=function(){if(t)return e;for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];for(var a=0,o=i;a<o.length;a++){var s=Cs(o[a]);if(Fs(n=Is(n,s,"string")))return t=!0,e}return e},e.idiv=function(){if(t)return e;for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];for(var a=0,o=i;a<o.length;a++){var s=Cs(o[a]);if(Fs(n=Ds(n,s,"string")))return t=!0,e}return e},e}function Hs(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];if(0===n.length)return Ls(0);for(var e="0",i=0,u=n;i<u.length;i++){var a=Cs(u[i]);if(Fs(a))return Ls(a);if(Fs(e=qs(e,a,"string")))return Ls(e)}return Ls(e)}function Vs(r){if(void 0===r)return Ls(0);for(var n=String(Cs(r)),t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];for(var u=0,a=e;u<a.length;u++){if(Fs(n=Ms(n,Cs(a[u]),"string")))return Ls(n)}return Ls(n)}function Gs(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];if(0===n.length)return Ls(1);for(var e="1",i=0,u=n;i<u.length;i++){var a=Cs(u[i]);if(Fs(a))return Ls(a);if(Fs(e=Ws(e,a,"string")))return Ls(e)}return Ls(e)}function Ks(r){if(void 0===r)return Ls(1);for(var n=String(Cs(r)),t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];for(var u=0,a=e;u<a.length;u++){if(Fs(n=Ps(n,Cs(a[u]),"string")))return Ls(n)}return Ls(n)}function Js(r){if(void 0===r)return Ls(0);for(var n=String(Cs(r)),t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];for(var u=0,a=e;u<a.length;u++){if(Fs(n=zs(n,Cs(a[u]),"string")))return Ls(n)}return Ls(n)}function Qs(r){if(void 0===r)return Ls(1);for(var n=String(Cs(r)),t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];for(var u=0,a=e;u<a.length;u++){if(Fs(n=Is(n,Cs(a[u]),"string")))return Ls(n)}return Ls(n)}function Xs(r){if(void 0===r)return Ls(0);for(var n=String(Cs(r)),t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];for(var u=0,a=e;u<a.length;u++){if(Fs(n=Ds(n,Cs(a[u]),"string")))return Ls(n)}return Ls(n)}kn("_compute_mode",function(r){var n;Os[n=r]?(Object.assign(ks,Os[n]),"wasm"!==n||Io()||Mo().catch(function(r){console.warn("Failed to load WASM module, using Decimal fallback:",r.message)})):console.warn("Unknown compute mode: ".concat(n,", available modes: ").concat(Object.keys(Os).join(", ")))}),Ae.set({precision:50,rounding:Ae.ROUND_HALF_UP,toExpNeg:-50,toExpPos:50});var Ys=1e6;function rc(r,n,t){var e=en(r,"_fmt");if(void 0!==e){if(""===e)return;if("string"!=typeof e)throw new TypeError("_fmt must be a string");return t(e,n)}var i=In("_fmt_parsed");return i&&i.has_var?t(In("_fmt"),n):i}function nc(r,n){if(n)return n;var t=en(r,"_fmt");return void 0!==t?t:In("_fmt")}function tc(r){var n=[],t=50,e="─".repeat(t);n.push("┌".concat(e,"┐")),n.push("│ [a-calc debug]".concat(" ".repeat(35),"│")),n.push("├".concat(e,"┤"));var i="│ 表达式: ".concat(r.expression);n.push(i+" ".repeat(Math.max(0,52-i.length))+"│"),n.push("│".concat(" ".repeat(t),"│")),n.push("│ 变量:".concat(" ".repeat(45),"│"));for(var u=0,a=Object.entries(r.variables);u<a.length;u++){var o=c(a[u],2),s=o[0],l=o[1],f="│ ".concat(s," = ").concat(l);n.push(f+" ".repeat(Math.max(0,52-f.length))+"│")}if(n.push("│".concat(" ".repeat(t),"│")),n.push("│ 步骤:".concat(" ".repeat(45),"│")),r.steps.forEach(function(r,t){var e="│ ".concat(t+1,". ").concat(r.expression);n.push(e+" ".repeat(Math.max(0,52-e.length))+"│");var i="│ → ".concat(r.substituted," = ").concat(r.result);n.push(i+" ".repeat(Math.max(0,52-i.length))+"│")}),n.push("│".concat(" ".repeat(t),"│")),r.format){var p="│ 格式化: | ".concat(r.format);n.push(p+" ".repeat(Math.max(0,52-p.length))+"│"),n.push("│".concat(" ".repeat(t),"│"))}var v='│ 结果: "'.concat(r.result,'"');n.push(v+" ".repeat(Math.max(0,52-v.length))+"│"),n.push("└".concat(e,"┘")),console.log(n.join("\n"))}function ec(r,n){var t,e=In(),i=n?Array.isArray(n)?n:a(a({},e),n):e,u=null!==(t=en(i,"_error"))&&void 0!==t?t:In("_error"),o=en(i,"_debug"),s=en(i,"_on_debug"),p=null;o&&(p={expression:r,variables:{},steps:[],format:null,result:null});try{var v,_,d,h=$n(r,i),g=h._unit,m={_empty_values:h._empty_values,_empty_check:h._empty_check};if(o&&h.fill_data){var y=function(r){if(Array.isArray(r))r.forEach(function(r){return y(r)});else if(r&&"object"===f(r))for(var n=0,t=Object.entries(r);n<t.length;n++){var e=c(t[n],2),i=e[0],u=e[1];i.startsWith("_")||"function"==typeof u||(p.variables[i]=u)}};y(h.fill_data)}var b=Cn(h.expr,h.fill_data,g,m);if(b._fill_data=h.fill_data,b._unit=g,b._options=m,o){var w=b.map(function(r){return void 0!==r.real_value&&r.real_value!==r.value?r.real_value:r.value}).join(" ");p.steps.push({expression:h.expr,substituted:w,result:"..."})}var x=ti(h._angle_unit,function(){return xi(b)});if(o&&p.steps.length>0&&(p.steps[p.steps.length-1].result=String(x)),"boolean"==typeof x)return o&&(p.result=x,In("_debug_console")&&tc(p),s&&s(p)),x;if("string"==typeof x&&!Je(x)){if("Infinity"===x||"-Infinity"===x||"NaN"===x)throw new Error("计算错误可能是非法的计算式");return o&&(p.result=x,In("_debug_console")&&tc(p),s&&s(p)),x}var S,N,E,A=Je(x)?x:new Ae(x);if(Je(A)&&!A.isFinite())throw new Error("计算错误可能是非法的计算式");if(Je(A)&&Math.abs(A.e)>Ys)throw new Error("计算结果数量级过大,超出安全上限");N=""===h.fmt_expr||void 0===h.fmt_expr?void 0:_n(h.fmt_expr,h.fill_data),E=rc(n,h.fill_data,_n),void 0===N?void 0!==E&&(N=E):void 0!==E&&(N=[].concat(l(E),l(N)));var j=nc(n,h.fmt_expr);if(o&&j&&(p.format=j),void 0===N)A=A.toFixed();else{var O=c(Te(A,N,{_compact_symbols:h._compact_symbols,_compact_step:h._compact_step,_unit_convert_out:In("_unit_convert_out"),_unit_default_in:In("_unit_default_in"),_unit_default_out:In("_unit_default_out"),_unit_default_position:In("_unit_default_position"),_unit_position_map:In("_unit_position_map"),_thousands:h._thousands,_unit_thousands_map:In("_unit_thousands_map"),_fill_data:h.fill_data,_recognized_unit:b.has_unit?b.unit:null}),2);A=O[0],S=O[1]}if("Infinity"===A||"NaN"===A||void 0===A)throw new Error("计算错误可能是非法的计算式");return!b.has_unit||null!==(v=S)&&void 0!==v&&v.to_number||null!==(_=S)&&void 0!==_&&_.to_number_string||null!==(d=S)&&void 0!==d&&d.unit_handled||(A+=b.unit),o&&(p.result=A,In("_debug_console")&&tc(p),s&&s(p)),A}catch(r){if(o&&(p.result=null!=u?u:r.message,p.error=r.message,In("_debug_console")&&tc(p),s&&s(p)),void 0===u)throw r;return u}}function ic(r,n){var t,e=In(),i=n?Array.isArray(n)?n:a(a({},e),n):e,u=null!==(t=en(i,"_error"))&&void 0!==t?t:In("_error"),o=en(i,"_debug"),s=en(i,"_on_debug"),p=null;o&&(p={expression:r,variables:{},steps:[],format:null,result:null});try{var v,_,d,h=$n(r,i),g=h._unit,m={_empty_values:h._empty_values,_empty_check:h._empty_check};if(o&&h.fill_data){var y=function(r){if(Array.isArray(r))r.forEach(function(r){return y(r)});else if(r&&"object"===f(r))for(var n=0,t=Object.entries(r);n<t.length;n++){var e=c(t[n],2),i=e[0],u=e[1];i.startsWith("_")||"function"==typeof u||(p.variables[i]=u)}};y(h.fill_data)}var b=function(r,n,t,e){for(var i,u=0,a=0,o=r.length,s=[],c=Un(r),l={has_var:!1,has_unit:!1,unit_str:void 0,_unit:t,fill_data:n};a<o;){if(" "===(i=r[a]))a>u&&Ge(s,r.slice(u,a),l),u=a+1;else if("("===i){var f=c.get(a);if(f){a>u&&Ge(s,r.slice(u,a),l),l.has_var=!0;var p=ln(n,f.paths,e),v=p.value,_=p.path;if(t){var d,h=tn(v),g=h.num,m=h.unit;void 0!==m?(l.has_unit=!0,null!==(d=l.unit_str)&&void 0!==d||(l.unit_str=m),s.push({type:T,value:f.paths,real_value:g,matched_path:_,has_unit:!0,unit:m})):s.push({type:T,value:f.paths,real_value:g,matched_path:_,has_unit:!1})}else s.push({type:T,value:f.paths,real_value:v,matched_path:_,has_unit:!1});u=a=f.end_index+1;continue}s.push({type:O,value:"("}),u=a+1}else")"===i&&(a>u&&Ge(s,r.slice(u,a),l),s.push({type:O,value:")"}),u=a+1);a++}return a>u&&Ge(s,r.slice(u,a),l),s.has_var=l.has_var,s.has_unit=l.has_unit,s.unit=l.unit_str,s}(h.expr,h.fill_data,g,m);if(b._fill_data=h.fill_data,b._unit=g,b._options=m,o){var w=b.map(function(r){return void 0!==r.real_value&&r.real_value!==r.value?r.real_value:r.value}).join(" ");p.steps.push({expression:h.expr,substituted:w,result:"..."})}var x=ti(h._angle_unit,function(){return xi(b)});if(o&&p.steps.length>0&&(p.steps[p.steps.length-1].result=String(x)),"boolean"==typeof x)return o&&(p.result=x,In("_debug_console")&&tc(p),s&&s(p)),x;if("string"==typeof x&&!Je(x)){if("Infinity"===x||"-Infinity"===x||"NaN"===x)throw new Error("计算错误可能是非法的计算式");return o&&(p.result=x,In("_debug_console")&&tc(p),s&&s(p)),x}var S,N,E,A=Je(x)?x:new Ae(x);if(Je(A)&&!A.isFinite())throw new Error("计算错误可能是非法的计算式");if(Je(A)&&Math.abs(A.e)>Ys)throw new Error("计算结果数量级过大,超出安全上限");N=""===h.fmt_expr||void 0===h.fmt_expr?void 0:yn(h.fmt_expr,h.fill_data),E=rc(n,h.fill_data,yn),void 0===N?void 0!==E&&(N=E):void 0!==E&&(N=[].concat(l(E),l(N)));var j=nc(n,h.fmt_expr);if(o&&j&&(p.format=j),void 0===N)A=A.toFixed();else{var k=c(Te(A,N,{_compact_symbols:h._compact_symbols,_compact_step:h._compact_step,_unit_convert_out:In("_unit_convert_out"),_unit_default_in:In("_unit_default_in"),_unit_default_out:In("_unit_default_out"),_unit_default_position:In("_unit_default_position"),_unit_position_map:In("_unit_position_map"),_thousands:h._thousands,_unit_thousands_map:In("_unit_thousands_map"),_fill_data:h.fill_data,_recognized_unit:b.has_unit?b.unit:null}),2);A=k[0],S=k[1]}if("Infinity"===A||"NaN"===A||void 0===A)throw new Error("计算错误可能是非法的计算式");return!b.has_unit||null!==(v=S)&&void 0!==v&&v.to_number||null!==(_=S)&&void 0!==_&&_.to_number_string||null!==(d=S)&&void 0!==d&&d.unit_handled||(A+=b.unit),o&&(p.result=A,In("_debug_console")&&tc(p),s&&s(p)),A}catch(r){if(o&&(p.result=null!=u?u:r.message,p.error=r.message,In("_debug_console")&&tc(p),s&&s(p)),void 0===u)throw r;return u}}function uc(r,n,t){return null!==n&&"object"===f(n)?ec(r,n):ec("string"==typeof n&&""!==n?"".concat(r," | ").concat(n):r,t)}qo=ec,Ze=ec,function(r){Si=r}(ec);var ac={check_update:function(){(function(){return He.apply(this,arguments)})().catch(function(){})},print_version:function(){console.log("%ca-calc:%c ".concat(v," %c=> %curl:%c https://www.npmjs.com/package/a-calc"),"color: #fff;background: #67C23A;padding: 2px 5px;border-radius:4px;font-size: 14px;","color: #67C23A;font-size:14px;","color: #67C23A;font-size:14px;","background: #67C23A;font-size:14px; padding: 2px 5px; border-radius: 4px; color: #fff;","font-size:14px;")},close_important_push:function(){},open_important_push:function(){}};function oc(){return ks.add.apply(ks,arguments)}function sc(){return ks.sub.apply(ks,arguments)}function cc(){return ks.mul.apply(ks,arguments)}function lc(){return ks.div.apply(ks,arguments)}function fc(){return ks.mod.apply(ks,arguments)}function pc(){return ks.pow.apply(ks,arguments)}function vc(){return ks.idiv.apply(ks,arguments)}function _c(){return ks.abs.apply(ks,arguments)}function dc(){return ks.neg.apply(ks,arguments)}function hc(){return ks.sqrt.apply(ks,arguments)}function gc(){return ks.ln.apply(ks,arguments)}function mc(){return ks.exp.apply(ks,arguments)}function yc(){return ks.sin.apply(ks,arguments)}function bc(){return ks.cos.apply(ks,arguments)}function wc(){return ks.tan.apply(ks,arguments)}function xc(){return ks.asin.apply(ks,arguments)}function Sc(){return ks.acos.apply(ks,arguments)}function Nc(){return ks.atan.apply(ks,arguments)}function Ec(){return ks.sinh.apply(ks,arguments)}function Ac(){return ks.cosh.apply(ks,arguments)}function jc(){return ks.tanh.apply(ks,arguments)}function Oc(){return ks.asinh.apply(ks,arguments)}function kc(){return ks.acosh.apply(ks,arguments)}function Fc(){return ks.atanh.apply(ks,arguments)}function qc(){return ks.floor.apply(ks,arguments)}function Mc(){return ks.ceil.apply(ks,arguments)}function Wc(){return ks.trunc.apply(ks,arguments)}function Pc(){return ks.round.apply(ks,arguments)}function zc(){return ks.max.apply(ks,arguments)}function Ic(){return ks.min.apply(ks,arguments)}function Dc(){return ks.compare.apply(ks,arguments)}function Tc(){return ks.eq.apply(ks,arguments)}function Zc(){return ks.lt.apply(ks,arguments)}function $c(){return ks.gt.apply(ks,arguments)}function Uc(){return ks.lte.apply(ks,arguments)}function Rc(){return ks.gte.apply(ks,arguments)}function Bc(){return ks.log.apply(ks,arguments)}function Cc(){return ks.log2.apply(ks,arguments)}function Lc(){return ks.log10.apply(ks,arguments)}function Hc(){return ks.cbrt.apply(ks,arguments)}export{bc as $,Xs as A,zn as B,In as C,Dn as D,qs as E,Ts as F,Zs as G,$s as H,Us as I,Rs as J,Mo as K,Io as L,Zo as M,oc as N,sc as O,cc as P,lc as Q,fc as R,pc as S,vc as T,_c as U,dc as V,hc as W,gc as X,mc as Y,yc as Z,t as _,o as a,ea as a$,wc as a0,xc as a1,Sc as a2,Nc as a3,Ec as a4,Ac as a5,jc as a6,Oc as a7,kc as a8,Fc as a9,Fu as aA,qu as aB,Mu as aC,Wu as aD,Pu as aE,zu as aF,Iu as aG,Du as aH,Tu as aI,Zu as aJ,$u as aK,Uu as aL,Ru as aM,Bu as aN,Cu as aO,Lu as aP,Hu as aQ,Vu as aR,Gu as aS,Ku as aT,Ju as aU,Qu as aV,Xu as aW,Yu as aX,ra as aY,na as aZ,ta as a_,qc as aa,Mc as ab,Wc as ac,Pc as ad,zc as ae,Ic as af,Dc as ag,Tc as ah,Zc as ai,$c as aj,Uc as ak,Rc as al,Bc as am,Cc as an,Lc as ao,Hc as ap,bu as aq,wu as ar,xu as as,Su as at,Nu as au,Eu as av,Au as aw,ju as ax,Ou as ay,ku as az,ic as b,cs as b$,ia as b0,ua as b1,$a as b2,Ua as b3,Ra as b4,Ba as b5,Ca as b6,La as b7,Ha as b8,Va as b9,no as bA,to as bB,eo as bC,io as bD,uo as bE,ao as bF,Ro as bG,Bo as bH,Co as bI,Lo as bJ,Ho as bK,Vo as bL,Go as bM,Ko as bN,Jo as bO,Qo as bP,Xo as bQ,Yo as bR,rs as bS,ns as bT,ts as bU,es as bV,is as bW,us as bX,as as bY,os as bZ,ss as b_,Ga as ba,oo as bb,so as bc,co as bd,lo as be,fo as bf,po as bg,vo as bh,_o as bi,ho as bj,go as bk,mo as bl,yo as bm,bo as bn,wo as bo,xo as bp,So as bq,No as br,Eo as bs,Ao as bt,Ka as bu,Ja as bv,Qa as bw,Xa as bx,Ya as by,ro as bz,ec as c,ls as c0,fs as c1,ps as c2,vs as c3,_s as c4,ds as c5,hs as c6,gs as c7,ms as c8,ys as c9,bs as ca,ws as cb,xs as cc,Ss as cd,Ns as ce,Es as cf,As as cg,js as ch,$e as d,ac as e,uc as f,Ps as g,zs as h,Ds as i,on as j,Oi as k,ki as l,Ws as m,Fi as n,qi as o,Is as p,Mi as q,ks as r,Ms as s,Hs as t,Vs as u,v,Gs as w,Ks as x,Js as y,Qs as z};
@@ -0,0 +1 @@
1
+ import{_ as t,a as n}from"./calc.js";var _;var e=null;function r(){return(null===e||!0===e.buffer.detached||void 0===e.buffer.detached&&e.buffer!==_.memory.buffer)&&(e=new DataView(_.memory.buffer)),e}function i(t,n){return function(t,n){c+=n,c>=s&&((p=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0})).decode(),c=n);return p.decode(a().subarray(t,t+n))}(t>>>=0,n)}var o=null;function a(){return null!==o&&0!==o.byteLength||(o=new Uint8Array(_.memory.buffer)),o}var d=new Array(128).fill(void 0);d.push(void 0,null,!0,!1);var g=d.length;function w(t,n,_){if(void 0===_){var e=f.encode(t),r=n(e.length,1)>>>0;return a().subarray(r,r+e.length).set(e),u=e.length,r}for(var i=t.length,o=n(i,1)>>>0,d=a(),g=0;g<i;g++){var w=t.charCodeAt(g);if(w>127)break;d[o+g]=w}if(g!==i){0!==g&&(t=t.slice(g)),o=_(o,i,i=g+3*t.length,1)>>>0;var b=a().subarray(o+g,o+i);o=_(o,i,g+=f.encodeInto(t,b).written,1)>>>0}return u=g,o}function b(t){var n=function(t){return d[t]}(t);return function(t){t<132||(d[t]=g,g=t)}(t),n}var p=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});p.decode();var s=2146435072,c=0;var f=new TextEncoder;"encodeInto"in f||(f.encodeInto=function(t,n){var _=f.encode(t);return n.set(_),{read:t.length,written:_.length}});var u=0;function l(t){var n,e;try{var o=_.__wbindgen_add_to_stack_pointer(-16),a=w(t,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.eval_expr(o,a,d);var g=r().getInt32(o+0,!0),b=r().getInt32(o+4,!0);return n=g,e=b,i(g,b)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(n,e,1)}}function v(t){var n,e;try{var o=_.__wbindgen_add_to_stack_pointer(-16),a=w(t,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.eval_expr_safe(o,a,d);var g=r().getInt32(o+0,!0),b=r().getInt32(o+4,!0);return n=g,e=b,i(g,b)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(n,e,1)}}function I(t){var n,e;try{var o=_.__wbindgen_add_to_stack_pointer(-16),a=w(t,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_abs(o,a,d);var g=r().getInt32(o+0,!0),p=r().getInt32(o+4,!0),s=r().getInt32(o+8,!0),c=r().getInt32(o+12,!0),f=g,l=p;if(c)throw f=0,l=0,b(s);return n=f,e=l,i(f,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(n,e,1)}}function x(t){var n,e;try{var o=_.__wbindgen_add_to_stack_pointer(-16),a=w(t,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_ceil(o,a,d);var g=r().getInt32(o+0,!0),p=r().getInt32(o+4,!0),s=r().getInt32(o+8,!0),c=r().getInt32(o+12,!0),f=g,l=p;if(c)throw f=0,l=0,b(s);return n=f,e=l,i(f,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(n,e,1)}}function y(t,n){try{var e=_.__wbindgen_add_to_stack_pointer(-16),i=w(t,_.__wbindgen_export,_.__wbindgen_export2),o=u,a=w(n,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_compare(e,i,o,a,d);var g=r().getInt32(e+0,!0),p=r().getInt32(e+4,!0);if(r().getInt32(e+8,!0))throw b(p);return g}finally{_.__wbindgen_add_to_stack_pointer(16)}}function k(t){var n,e;try{var o=_.__wbindgen_add_to_stack_pointer(-16),a=w(t,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_cos(o,a,d);var g=r().getInt32(o+0,!0),p=r().getInt32(o+4,!0),s=r().getInt32(o+8,!0),c=r().getInt32(o+12,!0),f=g,l=p;if(c)throw f=0,l=0,b(s);return n=f,e=l,i(f,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(n,e,1)}}function h(t,n){var e,o;try{var a=_.__wbindgen_add_to_stack_pointer(-16),d=w(t,_.__wbindgen_export,_.__wbindgen_export2),g=u,p=w(n,_.__wbindgen_export,_.__wbindgen_export2),s=u;_.str_div(a,d,g,p,s);var c=r().getInt32(a+0,!0),f=r().getInt32(a+4,!0),l=r().getInt32(a+8,!0),v=r().getInt32(a+12,!0),I=c,x=f;if(v)throw I=0,x=0,b(l);return e=I,o=x,i(I,x)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(e,o,1)}}function m(t,n){try{var e=_.__wbindgen_add_to_stack_pointer(-16),i=w(t,_.__wbindgen_export,_.__wbindgen_export2),o=u,a=w(n,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_eq(e,i,o,a,d);var g=r().getInt32(e+0,!0),p=r().getInt32(e+4,!0);if(r().getInt32(e+8,!0))throw b(p);return 0!==g}finally{_.__wbindgen_add_to_stack_pointer(16)}}function A(t){var n,e;try{var o=_.__wbindgen_add_to_stack_pointer(-16),a=w(t,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_exp(o,a,d);var g=r().getInt32(o+0,!0),p=r().getInt32(o+4,!0),s=r().getInt32(o+8,!0),c=r().getInt32(o+12,!0),f=g,l=p;if(c)throw f=0,l=0,b(s);return n=f,e=l,i(f,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(n,e,1)}}function W(t){var n,e;try{var o=_.__wbindgen_add_to_stack_pointer(-16),a=w(t,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_floor(o,a,d);var g=r().getInt32(o+0,!0),p=r().getInt32(o+4,!0),s=r().getInt32(o+8,!0),c=r().getInt32(o+12,!0),f=g,l=p;if(c)throw f=0,l=0,b(s);return n=f,e=l,i(f,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(n,e,1)}}function O(t){var n,e;try{var o=_.__wbindgen_add_to_stack_pointer(-16),a=w(t,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_fract(o,a,d);var g=r().getInt32(o+0,!0),p=r().getInt32(o+4,!0),s=r().getInt32(o+8,!0),c=r().getInt32(o+12,!0),f=g,l=p;if(c)throw f=0,l=0,b(s);return n=f,e=l,i(f,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(n,e,1)}}function j(t,n){try{var e=_.__wbindgen_add_to_stack_pointer(-16),i=w(t,_.__wbindgen_export,_.__wbindgen_export2),o=u,a=w(n,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_gt(e,i,o,a,d);var g=r().getInt32(e+0,!0),p=r().getInt32(e+4,!0);if(r().getInt32(e+8,!0))throw b(p);return 0!==g}finally{_.__wbindgen_add_to_stack_pointer(16)}}function R(t,n){try{var e=_.__wbindgen_add_to_stack_pointer(-16),i=w(t,_.__wbindgen_export,_.__wbindgen_export2),o=u,a=w(n,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_gte(e,i,o,a,d);var g=r().getInt32(e+0,!0),p=r().getInt32(e+4,!0);if(r().getInt32(e+8,!0))throw b(p);return 0!==g}finally{_.__wbindgen_add_to_stack_pointer(16)}}function M(t){try{var n=_.__wbindgen_add_to_stack_pointer(-16),e=w(t,_.__wbindgen_export,_.__wbindgen_export2),i=u;_.str_is_integer(n,e,i);var o=r().getInt32(n+0,!0),a=r().getInt32(n+4,!0);if(r().getInt32(n+8,!0))throw b(a);return 0!==o}finally{_.__wbindgen_add_to_stack_pointer(16)}}function S(t){try{var n=_.__wbindgen_add_to_stack_pointer(-16),e=w(t,_.__wbindgen_export,_.__wbindgen_export2),i=u;_.str_is_negative(n,e,i);var o=r().getInt32(n+0,!0),a=r().getInt32(n+4,!0);if(r().getInt32(n+8,!0))throw b(a);return 0!==o}finally{_.__wbindgen_add_to_stack_pointer(16)}}function q(t){try{var n=_.__wbindgen_add_to_stack_pointer(-16),e=w(t,_.__wbindgen_export,_.__wbindgen_export2),i=u;_.str_is_positive(n,e,i);var o=r().getInt32(n+0,!0),a=r().getInt32(n+4,!0);if(r().getInt32(n+8,!0))throw b(a);return 0!==o}finally{_.__wbindgen_add_to_stack_pointer(16)}}function L(t){try{var n=_.__wbindgen_add_to_stack_pointer(-16),e=w(t,_.__wbindgen_export,_.__wbindgen_export2),i=u;_.str_is_zero(n,e,i);var o=r().getInt32(n+0,!0),a=r().getInt32(n+4,!0);if(r().getInt32(n+8,!0))throw b(a);return 0!==o}finally{_.__wbindgen_add_to_stack_pointer(16)}}function T(t){var n,e;try{var o=_.__wbindgen_add_to_stack_pointer(-16),a=w(t,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_ln(o,a,d);var g=r().getInt32(o+0,!0),p=r().getInt32(o+4,!0),s=r().getInt32(o+8,!0),c=r().getInt32(o+12,!0),f=g,l=p;if(c)throw f=0,l=0,b(s);return n=f,e=l,i(f,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(n,e,1)}}function U(t){var n,e;try{var o=_.__wbindgen_add_to_stack_pointer(-16),a=w(t,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_log10(o,a,d);var g=r().getInt32(o+0,!0),p=r().getInt32(o+4,!0),s=r().getInt32(o+8,!0),c=r().getInt32(o+12,!0),f=g,l=p;if(c)throw f=0,l=0,b(s);return n=f,e=l,i(f,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(n,e,1)}}function z(t,n){try{var e=_.__wbindgen_add_to_stack_pointer(-16),i=w(t,_.__wbindgen_export,_.__wbindgen_export2),o=u,a=w(n,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_lt(e,i,o,a,d);var g=r().getInt32(e+0,!0),p=r().getInt32(e+4,!0);if(r().getInt32(e+8,!0))throw b(p);return 0!==g}finally{_.__wbindgen_add_to_stack_pointer(16)}}function B(t,n){try{var e=_.__wbindgen_add_to_stack_pointer(-16),i=w(t,_.__wbindgen_export,_.__wbindgen_export2),o=u,a=w(n,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_lte(e,i,o,a,d);var g=r().getInt32(e+0,!0),p=r().getInt32(e+4,!0);if(r().getInt32(e+8,!0))throw b(p);return 0!==g}finally{_.__wbindgen_add_to_stack_pointer(16)}}function D(t,n){var e,o;try{var a=_.__wbindgen_add_to_stack_pointer(-16),d=w(t,_.__wbindgen_export,_.__wbindgen_export2),g=u,p=w(n,_.__wbindgen_export,_.__wbindgen_export2),s=u;_.str_max(a,d,g,p,s);var c=r().getInt32(a+0,!0),f=r().getInt32(a+4,!0),l=r().getInt32(a+8,!0),v=r().getInt32(a+12,!0),I=c,x=f;if(v)throw I=0,x=0,b(l);return e=I,o=x,i(I,x)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(e,o,1)}}function C(t,n){var e,o;try{var a=_.__wbindgen_add_to_stack_pointer(-16),d=w(t,_.__wbindgen_export,_.__wbindgen_export2),g=u,p=w(n,_.__wbindgen_export,_.__wbindgen_export2),s=u;_.str_min(a,d,g,p,s);var c=r().getInt32(a+0,!0),f=r().getInt32(a+4,!0),l=r().getInt32(a+8,!0),v=r().getInt32(a+12,!0),I=c,x=f;if(v)throw I=0,x=0,b(l);return e=I,o=x,i(I,x)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(e,o,1)}}function E(t,n){var e,o;try{var a=_.__wbindgen_add_to_stack_pointer(-16),d=w(t,_.__wbindgen_export,_.__wbindgen_export2),g=u,p=w(n,_.__wbindgen_export,_.__wbindgen_export2),s=u;_.str_mod(a,d,g,p,s);var c=r().getInt32(a+0,!0),f=r().getInt32(a+4,!0),l=r().getInt32(a+8,!0),v=r().getInt32(a+12,!0),I=c,x=f;if(v)throw I=0,x=0,b(l);return e=I,o=x,i(I,x)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(e,o,1)}}function P(t,n){var e,o;try{var a=_.__wbindgen_add_to_stack_pointer(-16),d=w(t,_.__wbindgen_export,_.__wbindgen_export2),g=u,p=w(n,_.__wbindgen_export,_.__wbindgen_export2),s=u;_.str_mul(a,d,g,p,s);var c=r().getInt32(a+0,!0),f=r().getInt32(a+4,!0),l=r().getInt32(a+8,!0),v=r().getInt32(a+12,!0),I=c,x=f;if(v)throw I=0,x=0,b(l);return e=I,o=x,i(I,x)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(e,o,1)}}function F(t){var n,e;try{var o=_.__wbindgen_add_to_stack_pointer(-16),a=w(t,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_neg(o,a,d);var g=r().getInt32(o+0,!0),p=r().getInt32(o+4,!0),s=r().getInt32(o+8,!0),c=r().getInt32(o+12,!0),f=g,l=p;if(c)throw f=0,l=0,b(s);return n=f,e=l,i(f,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(n,e,1)}}function V(t){var n,e;try{var o=_.__wbindgen_add_to_stack_pointer(-16),a=w(t,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_normalize(o,a,d);var g=r().getInt32(o+0,!0),p=r().getInt32(o+4,!0),s=r().getInt32(o+8,!0),c=r().getInt32(o+12,!0),f=g,l=p;if(c)throw f=0,l=0,b(s);return n=f,e=l,i(f,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(n,e,1)}}function G(t,n){var e,o;try{var a=_.__wbindgen_add_to_stack_pointer(-16),d=w(t,_.__wbindgen_export,_.__wbindgen_export2),g=u,p=w(n,_.__wbindgen_export,_.__wbindgen_export2),s=u;_.str_plus(a,d,g,p,s);var c=r().getInt32(a+0,!0),f=r().getInt32(a+4,!0),l=r().getInt32(a+8,!0),v=r().getInt32(a+12,!0),I=c,x=f;if(v)throw I=0,x=0,b(l);return e=I,o=x,i(I,x)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(e,o,1)}}function H(t,n){var e,o;try{var a=_.__wbindgen_add_to_stack_pointer(-16),d=w(t,_.__wbindgen_export,_.__wbindgen_export2),g=u;_.str_pow(a,d,g,n);var p=r().getInt32(a+0,!0),s=r().getInt32(a+4,!0),c=r().getInt32(a+8,!0),f=r().getInt32(a+12,!0),l=p,v=s;if(f)throw l=0,v=0,b(c);return e=l,o=v,i(l,v)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(e,o,1)}}function J(t,n){var e,o;try{var a=_.__wbindgen_add_to_stack_pointer(-16),d=w(t,_.__wbindgen_export,_.__wbindgen_export2),g=u,p=w(n,_.__wbindgen_export,_.__wbindgen_export2),s=u;_.str_powd(a,d,g,p,s);var c=r().getInt32(a+0,!0),f=r().getInt32(a+4,!0),l=r().getInt32(a+8,!0),v=r().getInt32(a+12,!0),I=c,x=f;if(v)throw I=0,x=0,b(l);return e=I,o=x,i(I,x)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(e,o,1)}}function K(t){var n,e;try{var o=_.__wbindgen_add_to_stack_pointer(-16),a=w(t,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_round(o,a,d);var g=r().getInt32(o+0,!0),p=r().getInt32(o+4,!0),s=r().getInt32(o+8,!0),c=r().getInt32(o+12,!0),f=g,l=p;if(c)throw f=0,l=0,b(s);return n=f,e=l,i(f,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(n,e,1)}}function N(t,n){var e,o;try{var a=_.__wbindgen_add_to_stack_pointer(-16),d=w(t,_.__wbindgen_export,_.__wbindgen_export2),g=u;_.str_round_dp(a,d,g,n);var p=r().getInt32(a+0,!0),s=r().getInt32(a+4,!0),c=r().getInt32(a+8,!0),f=r().getInt32(a+12,!0),l=p,v=s;if(f)throw l=0,v=0,b(c);return e=l,o=v,i(l,v)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(e,o,1)}}function Q(t,n){var e,o;try{var a=_.__wbindgen_add_to_stack_pointer(-16),d=w(t,_.__wbindgen_export,_.__wbindgen_export2),g=u;_.str_round_dp_bankers(a,d,g,n);var p=r().getInt32(a+0,!0),s=r().getInt32(a+4,!0),c=r().getInt32(a+8,!0),f=r().getInt32(a+12,!0),l=p,v=s;if(f)throw l=0,v=0,b(c);return e=l,o=v,i(l,v)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(e,o,1)}}function X(t){try{var n=_.__wbindgen_add_to_stack_pointer(-16),e=w(t,_.__wbindgen_export,_.__wbindgen_export2),i=u;_.str_scale(n,e,i);var o=r().getInt32(n+0,!0),a=r().getInt32(n+4,!0);if(r().getInt32(n+8,!0))throw b(a);return o>>>0}finally{_.__wbindgen_add_to_stack_pointer(16)}}function Y(t){try{var n=_.__wbindgen_add_to_stack_pointer(-16),e=w(t,_.__wbindgen_export,_.__wbindgen_export2),i=u;_.str_sign(n,e,i);var o=r().getInt32(n+0,!0),a=r().getInt32(n+4,!0);if(r().getInt32(n+8,!0))throw b(a);return o}finally{_.__wbindgen_add_to_stack_pointer(16)}}function Z(t){var n,e;try{var o=_.__wbindgen_add_to_stack_pointer(-16),a=w(t,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_sin(o,a,d);var g=r().getInt32(o+0,!0),p=r().getInt32(o+4,!0),s=r().getInt32(o+8,!0),c=r().getInt32(o+12,!0),f=g,l=p;if(c)throw f=0,l=0,b(s);return n=f,e=l,i(f,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(n,e,1)}}function $(t){var n,e;try{var o=_.__wbindgen_add_to_stack_pointer(-16),a=w(t,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_sqrt(o,a,d);var g=r().getInt32(o+0,!0),p=r().getInt32(o+4,!0),s=r().getInt32(o+8,!0),c=r().getInt32(o+12,!0),f=g,l=p;if(c)throw f=0,l=0,b(s);return n=f,e=l,i(f,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(n,e,1)}}function tt(t,n){var e,o;try{var a=_.__wbindgen_add_to_stack_pointer(-16),d=w(t,_.__wbindgen_export,_.__wbindgen_export2),g=u,p=w(n,_.__wbindgen_export,_.__wbindgen_export2),s=u;_.str_sub(a,d,g,p,s);var c=r().getInt32(a+0,!0),f=r().getInt32(a+4,!0),l=r().getInt32(a+8,!0),v=r().getInt32(a+12,!0),I=c,x=f;if(v)throw I=0,x=0,b(l);return e=I,o=x,i(I,x)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(e,o,1)}}function nt(t){var n,e;try{var o=_.__wbindgen_add_to_stack_pointer(-16),a=w(t,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_tan(o,a,d);var g=r().getInt32(o+0,!0),p=r().getInt32(o+4,!0),s=r().getInt32(o+8,!0),c=r().getInt32(o+12,!0),f=g,l=p;if(c)throw f=0,l=0,b(s);return n=f,e=l,i(f,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(n,e,1)}}function _t(t){var n,e;try{var o=_.__wbindgen_add_to_stack_pointer(-16),a=w(t,_.__wbindgen_export,_.__wbindgen_export2),d=u;_.str_trunc(o,a,d);var g=r().getInt32(o+0,!0),p=r().getInt32(o+4,!0),s=r().getInt32(o+8,!0),c=r().getInt32(o+12,!0),f=g,l=p;if(c)throw f=0,l=0,b(s);return n=f,e=l,i(f,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export3(n,e,1)}}var et=new Set(["basic","cors","default"]);function rt(t,n){return it.apply(this,arguments)}function it(){return(it=t(n().m(function t(_,e){var r,i,o;return n().w(function(t){for(;;)switch(t.p=t.n){case 0:if(!("function"==typeof Response&&_ instanceof Response)){t.n=8;break}if("function"!=typeof WebAssembly.instantiateStreaming){t.n=5;break}return t.p=1,t.n=2,WebAssembly.instantiateStreaming(_,e);case 2:case 7:return t.a(2,t.v);case 3:if(t.p=3,o=t.v,!(_.ok&&et.has(_.type))||"application/wasm"===_.headers.get("Content-Type")){t.n=4;break}console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",o),t.n=5;break;case 4:throw o;case 5:return t.n=6,_.arrayBuffer();case 6:return r=t.v,t.n=7,WebAssembly.instantiate(r,e);case 8:return t.n=9,WebAssembly.instantiate(_,e);case 9:if(!((i=t.v)instanceof WebAssembly.Instance)){t.n=10;break}return t.a(2,{instance:i,module:_});case 10:return t.a(2,i);case 11:return t.a(2)}},t,null,[[1,3]])}))).apply(this,arguments)}function ot(){var t={wbg:{}};return t.wbg.__wbindgen_cast_2241b6af4c4b2941=function(t,n){return function(t){g===d.length&&d.push(d.length+1);var n=g;return g=d[n],d[n]=t,n}(i(t,n))},t}function at(t,n){return _=t.exports,gt.__wbindgen_wasm_module=n,e=null,o=null,_}function dt(t){if(void 0!==_)return _;void 0!==t&&(Object.getPrototypeOf(t)===Object.prototype?t=t.module:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));var n=ot();return t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t)),at(new WebAssembly.Instance(t,n),t)}function gt(t){return wt.apply(this,arguments)}function wt(){return(wt=t(n().m(function t(e){var r,i,o,a,d;return n().w(function(t){for(;;)switch(t.n){case 0:if(void 0===_){t.n=1;break}return t.a(2,_);case 1:return void 0!==e&&(Object.getPrototypeOf(e)===Object.prototype?e=e.module_or_path:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===e&&(e=new URL("wasm_calc_bg.wasm",import.meta.url)),r=ot(),("string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL)&&(e=fetch(e)),d=rt,t.n=2,e;case 2:return t.n=3,d(t.v,r);case 3:return i=t.v,o=i.instance,a=i.module,t.a(2,at(o,a))}},t)}))).apply(this,arguments)}export{gt as default,l as eval_expr,v as eval_expr_safe,dt as initSync,I as str_abs,x as str_ceil,y as str_compare,k as str_cos,h as str_div,m as str_eq,A as str_exp,W as str_floor,O as str_fract,j as str_gt,R as str_gte,M as str_is_integer,S as str_is_negative,q as str_is_positive,L as str_is_zero,T as str_ln,U as str_log10,z as str_lt,B as str_lte,D as str_max,C as str_min,E as str_mod,P as str_mul,F as str_neg,V as str_normalize,G as str_plus,H as str_pow,J as str_powd,K as str_round,N as str_round_dp,Q as str_round_dp_bankers,X as str_scale,Y as str_sign,Z as str_sin,$ as str_sqrt,tt as str_sub,nt as str_tan,_t as str_trunc};