js-gei 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js-gei.es.js +29 -29
- package/dist/js-gei.umd.js +2 -2
- package/package.json +1 -1
- package/src/Structure/InvoiceObj.ts +4 -5
- package/src/main.ts +12 -8
package/dist/js-gei.umd.js
CHANGED
|
@@ -58,7 +58,7 @@ q: `+this.q.toString():"")+`
|
|
|
58
58
|
`),n.seealso&&n.seealso.length&&(a+="See also: "+n.seealso.join(", ")+`
|
|
59
59
|
`),a},t.prototype.toJSON=function(){var n=er(this.doc);return n.mathjs="Help",n},t.fromJSON=function(n){var a={};return Object.keys(n).filter(i=>i!=="mathjs").forEach(i=>{a[i]=n[i]}),new t(a)},t.prototype.valueOf=t.prototype.toString,t},{isClass:!0}),LC="Chain",kC=["?on","math","typed"],VC=L(LC,kC,r=>{var{on:e,math:t,typed:n}=r;function a(s){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");Qu(s)?this.value=s.value:this.value=s}a.prototype.type="Chain",a.prototype.isChain=!0,a.prototype.done=function(){return this.value},a.prototype.valueOf=function(){return this.value},a.prototype.toString=function(){return lr(this.value)},a.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},a.fromJSON=function(s){return new a(s.value)};function i(s,c){typeof c=="function"&&(a.prototype[s]=l(c))}function o(s,c){_0(a.prototype,s,function(){var m=c();if(typeof m=="function")return l(m)})}function l(s){return function(){if(arguments.length===0)return new a(s(this.value));for(var c=[this.value],f=0;f<arguments.length;f++)c[f+1]=arguments[f];if(n.isTypedFunction(s)){var m=n.resolve(s,c);if(m.params.length===1)throw new Error("chain function "+s.name+" cannot match rest parameter between chain value and additional arguments.");return new a(m.implementation.apply(s,c))}return new a(s.apply(s,c))}}a.createProxy=function(s,c){if(typeof s=="string")i(s,c);else{var f=function(p){$e(s,p)&&u[p]===void 0&&o(p,()=>s[p])};for(var m in s)f(m)}};var u={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return a.createProxy(t),e&&e("import",function(s,c,f){f||o(s,c)}),a},{isClass:!0}),wp={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]},GC={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]},HC={name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]},WC={name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]},YC={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]},ZC={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]},JC={name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]},jC={name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]},XC={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]},QC={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]},KC={name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",examples:["phi"],seealso:[]},Dp={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]},eM={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]},rM={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]},tM={name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]},nM={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]},aM={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]},iM={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","bigint","complex","fraction","index","matrix","string","unit"]},oM={name:"bigint",category:"Construction",syntax:["bigint(x)"],description:"Create a bigint, an integer with an arbitrary number of digits, from a number or string.",examples:["123123123123123123 # a large number will lose digits",'bigint("123123123123123123")','bignumber(["1", "3", "5"])'],seealso:["boolean","bignumber","number","complex","fraction","index","matrix","string","unit"]},sM={name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]},uM={name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]},lM={name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]},cM={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]},fM={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix","number","range","string","unit"]},mM={name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]},vM={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","bigint","boolean","complex","fraction","index","matrix","string","unit"]},pM={name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]},dM={name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]},hM={name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]},gM={name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]},yM={name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]},bM={name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]},xM={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]},wM={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]},DM={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]},NM={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]},EM={name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]},AM={name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]},SM={name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]},CM={name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]},MM={name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]},_M={name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]},TM={name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]},FM={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]},OM={name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]},BM={name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]},RM={name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]},IM={name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]},PM={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]},$M={name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]},qM={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]},zM={name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]},UM={name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]},LM={name:"ceil",category:"Arithmetic",syntax:["ceil(x)","ceil(x, n)","ceil(unit, valuelessUnit)","ceil(unit, n, valuelessUnit)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)","ceil(3.241cm, cm)","ceil(3.241cm, 2, cm)"],seealso:["floor","fix","round"]},kM={name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]},VM={name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]},GM={name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]},HM={name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]},WM={name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]},YM={name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]},ZM={name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]},JM={name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]},jM={name:"fix",category:"Arithmetic",syntax:["fix(x)","fix(x, n)","fix(unit, valuelessUnit)","fix(unit, n, valuelessUnit)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)","fix(3.241cm, cm)","fix(3.241cm, 2, cm)"],seealso:["ceil","floor","round"]},XM={name:"floor",category:"Arithmetic",syntax:["floor(x)","floor(x, n)","floor(unit, valuelessUnit)","floor(unit, n, valuelessUnit)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)","floor(3.241cm, cm)","floor(3.241cm, 2, cm)"],seealso:["ceil","fix","round"]},QM={name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]},KM={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenuse of a list with values.",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]},e_={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]},r_={name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]},t_={name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]},n_={name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]},a_={name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a `value+1`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]},i_={name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]},o_={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]},s_={name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]},u_={name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']},l_={name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]},c_={name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]},f_={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]},m_={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]},v_={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>0, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]},p_={name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]},d_={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]},h_={name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]},g_={name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]},y_={name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]},b_={name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]},x_={name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]},w_={name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]},D_={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]},N_={name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]},E_={name:"num",category:"Fraction",syntax:["num(x)"],description:"Get the numerator of a fraction.",examples:["num(fraction(2, 3))","num(fraction(5, 8))"],seealso:["den","fraction"]},A_={name:"den",category:"Fraction",syntax:["den(x)"],description:"Get the denominator of a fraction.",examples:["den(fraction(2, 3))","den(fraction(5, 8))"],seealso:["num","fraction"]},S_={name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},C_={name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},M_={name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]},__={name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]},T_={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]},F_={name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]},O_={name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]},B_={name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]},R_={name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]},I_={name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]},P_={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers","bernoulli"]},$_={name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]},q_={name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]},z_={name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]},U_={name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]},L_={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:["parser","parse","compile"]},k_={name:"parser",category:"Expression",syntax:["parser()"],description:"Create a parser object that keeps a context of variables and their values, allowing the evaluation of expressions in that context.",examples:["myParser = parser()",'myParser.evaluate("sqrt(3^2 + 4^2)")','myParser.set("x", 3)','myParser.evaluate("y = x + 3")','myParser.evaluate(["y = x + 3", "y = y + 1"])','myParser.get("y")'],seealso:["evaluate","parse","compile"]},V_={name:"parse",category:"Expression",syntax:["parse(expr)","parse(expr, options)","parse([expr1, expr2, expr3, ...])","parse([expr1, expr2, expr3, ...], options)"],description:"Parse an expression. Returns a node tree, which can be evaluated by invoking node.evaluate() or transformed into a functional object via node.compile().",examples:['node1 = parse("sqrt(3^2 + 4^2)")',"node1.evaluate()","code1 = node1.compile()","code1.evaluate()","scope = {a: 3, b: 4}",'node2 = parse("a * b")',"node2.evaluate(scope)","code2 = node2.compile()","code2.evaluate(scope)"],seealso:["parser","evaluate","compile"]},G_={name:"compile",category:"Expression",syntax:["compile(expr) ","compile([expr1, expr2, expr3, ...])"],description:"Parse and compile an expression. Returns a an object with a function evaluate([scope]) to evaluate the compiled expression.",examples:['code1 = compile("sqrt(3^2 + 4^2)")',"code1.evaluate() ",'code2 = compile("a * b")',"code2.evaluate({a: 3, b: 4})"],seealso:["parser","parse","evaluate"]},H_={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]},W_={name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]},Y_={name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]},Z_={name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]},J_={name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]},j_={name:"nullish",category:"Logical",syntax:["x ?? y","nullish(x, y)"],description:"Nullish coalescing operator. Returns the right-hand operand when the left-hand operand is null or undefined, and otherwise returns the left-hand operand.",examples:["null ?? 42","undefined ?? 42","0 ?? 42","false ?? 42","null ?? undefined ?? 42"],seealso:["and","or","not"]},X_={name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]},Q_={name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]},K_={name:"mapSlices",category:"Matrix",syntax:["mapSlices(A, dim, callback)"],description:"Generate a matrix one dimension less than A by applying callback to each slice of A along dimension dim.",examples:["A = [[1, 2], [3, 4]]","mapSlices(A, 1, sum)","mapSlices(A, 2, prod)"],seealso:["map","forEach"]},eT={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]},rT={name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},tT={name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]},nT={name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]},aT={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},iT={name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},oT={name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},sT={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]},uT={name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]},lT={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]},cT={name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]},fT={name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]},mT={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]},vT={name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]},pT={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},dT={name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]},hT={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore–Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]},gT={name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the Kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]},yT={name:"map",category:"Matrix",syntax:["map(x, callback)","map(x, y, ..., callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.",examples:["map([1, 2, 3], square)","map([1, 2], [3, 4], f(a,b) = a + b)"],seealso:["filter","forEach"]},bT={name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]},xT={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]},wT={name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]},DT={name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]},NT={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]},ET={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]},AT={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]},ST={name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]},CT={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]},MT={name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]},_T={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]},TT={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]},FT={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]},OT={name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]},BT={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]},RT={name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]},IT={name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},PT={name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]},$T={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional Fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]},qT={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse Fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]},zT={name:"bernoulli",category:"Probability",syntax:["bernoulli(n)"],description:"The nth Bernoulli number",examples:["bernoulli(4)","bernoulli(fraction(12))"],seealso:["combinations","gamma","stirlingS2"]},UT={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]},LT={name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]},kT={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]},VT={name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]},GT={name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]},HT={name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]},WT={name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]},YT={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]},ZT={name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]},JT={name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]},jT={name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]},XT={name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]},QT={name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]},KT={name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]},eF={name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]},rF={name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]},tF={name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]},nF={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not. Comparing a value with NaN returns false.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]},aF={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]},iF={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not. Comparing a value with NaN returns false.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]},oF={name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]},sF={name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]},uF={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]},lF={name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]},cF={name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]},fF={name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]},mF={name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]},vF={name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]},pF={name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]},dF={name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]},hF={name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]},gF={name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]},yF={name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]},bF={name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]},xF={name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]},wF={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemann's Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]},DF={name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]},NF={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]},EF={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]},AF={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]},SF={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]},CF={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]},MF={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]},_F={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber.
|
|
60
60
|
|
|
61
|
-
In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]},TF={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]},FF={name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]},OF={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","variance"]},BF={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]},RF={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]},IF={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]},PF={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]},$F={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]},qF={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]},zF={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]},UF={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]},LF={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]},kF={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},VF={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]},GF={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]},HF={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]},WF={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]},YF={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]},ZF={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]},JF={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]},jF={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]},XF={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]},QF={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]},KF={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]},e3={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]},r3={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]},t3={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]},n3={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]},a3={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]},i3={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]},o3={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]},s3={name:"toBest",category:"Units",syntax:["toBest(x)","toBest(x, unitList)","toBest(x, unitList, options)"],description:"Converts to the most appropriate display unit.",examples:['toBest(unit(5000, "m"))','toBest(unit(3500000, "W"))','toBest(unit(0.000000123, "A"))','toBest(unit(10, "m"), "cm")','toBest(unit(10, "m"), "mm,km", {offset: 1.5})'],seealso:[]},u3={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]},l3={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]},c3={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]},f3={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]},m3={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]},v3={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]},p3={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero","isFinite","isBounded"]},d3={name:"isBounded",category:"Utils",syntax:["isBounded(x)"],description:"Test whether a value or its entries are bounded.",examples:["isBounded(Infinity)","isBounded(bigint(3))","isBounded([3, -Infinity, -3])"],seealso:["isFinite","isNumeric","isNaN","isNegative","isPositive"]},h3={name:"isFinite",category:"Utils",syntax:["isFinite(x)"],description:"Test whether a value is finite, elementwise on collections.",examples:["isFinite(Infinity)","isFinite(bigint(3))","isFinite([3, -Infinity, -3])"],seealso:["isBounded","isNumeric","isNaN","isNegative","isPositive"]},g3={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]},y3={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue","isFinite","isBounded"]},b3={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},x3={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},w3={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]},D3={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "bigint")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","bigint","fraction","bignumber","string","format"]},N3={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]},E3={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]},A3={name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]},S3={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]},C3={bignumber:iM,bigint:oM,boolean:sM,complex:uM,createUnit:lM,fraction:cM,index:fM,matrix:mM,number:vM,sparse:pM,splitUnit:dM,string:hM,unit:gM,e:wp,E:wp,false:GC,i:HC,Infinity:WC,LN2:ZC,LN10:YC,LOG2E:jC,LOG10E:JC,NaN:XC,null:QC,pi:Dp,PI:Dp,phi:KC,SQRT1_2:eM,SQRT2:rM,tau:tM,true:nM,version:aM,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant. Deprecated in favor of coulombConstant",examples:["coulombConstant"]},coulombConstant:{description:"Coulomb's constant",examples:["coulombConstant"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Bohr magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Bohr radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:wM,lsolve:NM,lsolveAll:EM,lup:AM,lusolve:SM,leafCount:DM,polynomialRoot:CM,resolve:TM,simplify:FM,simplifyConstant:OM,simplifyCore:BM,symbolicEqual:IM,rationalize:_M,slu:RM,usolve:PM,usolveAll:$M,qr:MM,abs:qM,add:zM,cbrt:UM,ceil:LM,cube:kM,divide:VM,dotDivide:GM,dotMultiply:HM,dotPow:WM,exp:YM,expm:ZM,expm1:JM,fix:jM,floor:XM,gcd:QM,hypot:KM,lcm:r_,log:t_,log2:i_,log1p:a_,log10:n_,mod:o_,multiply:s_,norm:u_,nthRoot:l_,nthRoots:c_,pow:f_,round:m_,sign:v_,sqrt:p_,sqrtm:d_,square:b_,subtract:x_,unaryMinus:w_,unaryPlus:D_,xgcd:N_,invmod:e_,num:E_,den:A_,bitAnd:S_,bitNot:C_,bitOr:M_,bitXor:__,leftShift:T_,rightArithShift:F_,rightLogShift:O_,bellNumbers:B_,catalan:R_,composition:I_,stirlingS2:P_,config:yM,import:bM,typed:xM,arg:$_,conj:q_,re:U_,im:z_,evaluate:L_,help:H_,parse:V_,parser:k_,compile:G_,distance:W_,intersect:Y_,and:Z_,not:J_,nullish:j_,or:X_,xor:Q_,mapSlices:K_,concat:rT,count:tT,cross:nT,column:eT,ctranspose:aT,det:iT,diag:oT,diff:sT,dot:uT,getMatrixDataType:vT,identity:pT,filter:cT,flatten:fT,forEach:mT,inv:dT,pinv:hT,eigs:lT,kron:gT,matrixFromFunction:xT,matrixFromRows:wT,matrixFromColumns:bT,map:yT,ones:DT,partitionSelect:NT,range:ET,resize:ST,reshape:AT,rotate:CT,rotationMatrix:MT,row:_T,size:TT,sort:FT,squeeze:OT,subset:BT,trace:RT,transpose:IT,zeros:PT,fft:$T,ifft:qT,sylvester:h_,schur:g_,lyap:y_,solveODE:S3,bernoulli:zT,combinations:UT,combinationsWithRep:LT,factorial:kT,gamma:VT,kldivergence:HT,lgamma:GT,multinomial:WT,permutations:YT,pickRandom:ZT,random:JT,randomInt:jT,compare:XT,compareNatural:QT,compareText:KT,deepEqual:eF,equal:rF,equalText:tF,larger:nF,largerEq:aF,smaller:iF,smallerEq:oF,unequal:sF,setCartesian:uF,setDifference:lF,setDistinct:cF,setIntersect:fF,setIsSubset:mF,setMultiplicity:vF,setPowerset:pF,setSize:dF,setSymDifference:hF,setUnion:gF,zpk2tf:yF,freqz:bF,erf:xF,zeta:wF,cumsum:FF,mad:DF,max:NF,mean:EF,median:AF,min:SF,mode:CF,prod:MF,quantileSeq:_F,std:TF,sum:OF,variance:BF,corr:RF,acos:IF,acosh:PF,acot:$F,acoth:qF,acsc:zF,acsch:UF,asec:LF,asech:kF,asin:VF,asinh:GF,atan:HF,atanh:YF,atan2:WF,cos:ZF,cosh:JF,cot:jF,coth:XF,csc:QF,csch:KF,sec:e3,sech:r3,sin:t3,sinh:n3,tan:a3,tanh:i3,to:o3,toBest:s3,clone:l3,format:c3,bin:u3,oct:N3,hex:m3,isNaN:p3,isBounded:d3,isFinite:h3,isInteger:v3,isNegative:g3,isNumeric:y3,hasNumericValue:f3,isPositive:b3,isPrime:x3,isZero:w3,print:E3,typeOf:A3,numeric:D3},Np="help",M3=["typed","mathWithTransform","Help"],_3=L(Np,M3,r=>{var{typed:e,mathWithTransform:t,Help:n}=r;return e(Np,{any:function(i){var o,l=i;if(typeof i!="string"){for(o in t)if($e(t,o)&&i===t[o]){l=o;break}}var u=pt(C3,l);if(!u){var s=typeof l=="function"?l.name:l;throw new Error('No documentation found on "'+s+'"')}return new n(u)}})}),Ep="chain",T3=["typed","Chain"],F3=L(Ep,T3,r=>{var{typed:e,Chain:t}=r;return e(Ep,{"":function(){return new t},any:function(a){return new t(a)}})}),Ap="det",O3=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],B3=L(Ap,O3,r=>{var{typed:e,matrix:t,subtractScalar:n,multiply:a,divideScalar:i,isZero:o,unaryMinus:l}=r;return e(Ap,{any:function(c){return er(c)},"Array | Matrix":function(c){var f;switch(Je(c)?f=c.size():Array.isArray(c)?(c=t(c),f=c.size()):f=[],f.length){case 0:return er(c);case 1:if(f[0]===1)return er(c.valueOf()[0]);if(f[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(f)+")");case 2:{var m=f[0],v=f[1];if(m===v)return u(c.clone().valueOf(),m);if(v===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(f)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(f)+")")}}});function u(s,c,f){if(c===1)return er(s[0][0]);if(c===2)return n(a(s[0][0],s[1][1]),a(s[1][0],s[0][1]));for(var m=!1,v=new Array(c).fill(0).map((A,N)=>N),p=0;p<c;p++){var d=v[p];if(o(s[d][p])){var y=void 0;for(y=p+1;y<c;y++)if(!o(s[v[y]][p])){d=v[y],v[y]=v[p],v[p]=d,m=!m;break}if(y===c)return s[d][p]}for(var x=s[d][p],D=p===0?1:s[v[p-1]][p-1],h=p+1;h<c;h++)for(var w=v[h],g=p+1;g<c;g++)s[w][g]=i(n(a(s[w][g],x),a(s[w][p],s[d][g])),D)}var b=s[v[c-1]][c-1];return m?l(b):b}}),Sp="inv",R3=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],I3=L(Sp,R3,r=>{var{typed:e,matrix:t,divideScalar:n,addScalar:a,multiply:i,unaryMinus:o,det:l,identity:u,abs:s}=r;return e(Sp,{"Array | Matrix":function(m){var v=Je(m)?m.size():rr(m);switch(v.length){case 1:if(v[0]===1)return Je(m)?t([n(1,m.valueOf()[0])]):[n(1,m[0])];throw new RangeError("Matrix must be square (size: "+lr(v)+")");case 2:{var p=v[0],d=v[1];if(p===d)return Je(m)?t(c(m.valueOf(),p,d),m.storage()):c(m,p,d);throw new RangeError("Matrix must be square (size: "+lr(v)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(v)+")")}},any:function(m){return n(1,m)}});function c(f,m,v){var p,d,y,x,D;if(m===1){if(x=f[0][0],x===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,x)]]}else if(m===2){var h=l(f);if(h===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(f[1][1],h),n(o(f[0][1]),h)],[n(o(f[1][0]),h),n(f[0][0],h)]]}else{var w=f.concat();for(p=0;p<m;p++)w[p]=w[p].concat();for(var g=u(m).valueOf(),b=0;b<v;b++){var A=s(w[b][b]),N=b;for(p=b+1;p<m;)s(w[p][b])>A&&(A=s(w[p][b]),N=p),p++;if(A===0)throw Error("Cannot calculate inverse, determinant is zero");p=N,p!==b&&(D=w[b],w[b]=w[p],w[p]=D,D=g[b],g[b]=g[p],g[p]=D);var E=w[b],S=g[b];for(p=0;p<m;p++){var C=w[p],M=g[p];if(p!==b){if(C[b]!==0){for(y=n(o(C[b]),E[b]),d=b;d<v;d++)C[d]=a(C[d],i(y,E[d]));for(d=0;d<v;d++)M[d]=a(M[d],i(y,S[d]))}}else{for(y=E[b],d=b;d<v;d++)C[d]=n(C[d],y);for(d=0;d<v;d++)M[d]=n(M[d],y)}}}return g}}}),Cp="pinv",P3=["typed","matrix","inv","deepEqual","equal","dotDivide","dot","ctranspose","divideScalar","multiply","add","Complex"],$3=L(Cp,P3,r=>{var{typed:e,matrix:t,inv:n,deepEqual:a,equal:i,dotDivide:o,dot:l,ctranspose:u,divideScalar:s,multiply:c,add:f,Complex:m}=r;return e(Cp,{"Array | Matrix":function(h){var w=Je(h)?h.size():rr(h);switch(w.length){case 1:return x(h)?u(h):w[0]===1?n(h):o(u(h),l(h,h));case 2:{if(x(h))return u(h);var g=w[0],b=w[1];if(g===b)try{return n(h)}catch(A){if(!(A instanceof Error&&A.message.match(/Cannot calculate inverse, determinant is zero/)))throw A}return Je(h)?t(v(h.valueOf(),g,b),h.storage()):v(h,g,b)}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(w)+")")}},any:function(h){return i(h,0)?er(h):s(1,h)}});function v(D,h,w){var{C:g,F:b}=d(D,h,w),A=c(n(c(u(g),g)),u(g)),N=c(u(b),n(c(b,u(b))));return c(N,A)}function p(D,h,w){for(var g=er(D),b=0,A=0;A<h;A++){if(w<=b)return g;for(var N=A;y(g[N][b]);)if(N++,h===N&&(N=A,b++,w===b))return g;[g[N],g[A]]=[g[A],g[N]];for(var E=g[A][b],S=0;S<w;S++)g[A][S]=o(g[A][S],E);for(var C=0;C<h;C++)if(C!==A){E=g[C][b];for(var M=0;M<w;M++)g[C][M]=f(g[C][M],c(-1,c(E,g[A][M])))}b++}return g}function d(D,h,w){var g=p(D,h,w),b=D.map((N,E)=>N.filter((S,C)=>C<h&&!y(l(g[C],g[C])))),A=g.filter((N,E)=>!y(l(g[E],g[E])));return{C:b,F:A}}function y(D){return i(f(D,m(1,1)),f(0,m(1,1)))}function x(D){return a(f(D,m(1,1)),f(c(D,0),m(1,1)))}});function q3(r){var{addScalar:e,subtract:t,flatten:n,multiply:a,multiplyScalar:i,divideScalar:o,sqrt:l,abs:u,bignumber:s,diag:c,size:f,reshape:m,inv:v,qr:p,usolve:d,usolveAll:y,equal:x,complex:D,larger:h,smaller:w,matrixFromColumns:g,dot:b}=r;function A(j,F,U,$){var le=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,me=N(j,F,U,$,le);E(j,F,U,$,le,me);var{values:Y,C:z}=S(j,F,U,$,le);if(le){var X=C(j,F,z,me,Y,U,$);return{values:Y,eigenvectors:X}}return{values:Y}}function N(j,F,U,$,le){var me=$==="BigNumber",Y=$==="Complex",z=me?s(0):0,X=me?s(1):Y?D(1):1,se=me?s(1):1,re=me?s(10):2,pe=i(re,re),ve;le&&(ve=Array(F).fill(X));for(var De=!1;!De;){De=!0;for(var Oe=0;Oe<F;Oe++){for(var Ie=z,_e=z,Le=0;Le<F;Le++)Oe!==Le&&(Ie=e(Ie,u(j[Le][Oe])),_e=e(_e,u(j[Oe][Le])));if(!x(Ie,0)&&!x(_e,0)){for(var qe=se,G=Ie,ee=o(_e,re),R=i(_e,re);w(G,ee);)G=i(G,pe),qe=i(qe,re);for(;h(G,R);)G=o(G,pe),qe=o(qe,re);var H=w(o(e(G,_e),qe),i(e(Ie,_e),.95));if(H){De=!1;for(var Q=o(1,qe),ie=0;ie<F;ie++)Oe!==ie&&(j[Oe][ie]=i(j[Oe][ie],Q),j[ie][Oe]=i(j[ie][Oe],qe));le&&(ve[Oe]=i(ve[Oe],Q))}}}}return le?c(ve):null}function E(j,F,U,$,le,me){var Y=$==="BigNumber",z=$==="Complex",X=Y?s(0):z?D(0):0;Y&&(U=s(U));for(var se=0;se<F-2;se++){for(var re=0,pe=X,ve=se+1;ve<F;ve++){var De=j[ve][se];w(u(pe),u(De))&&(pe=De,re=ve)}if(!w(u(pe),U)){if(re!==se+1){var Oe=j[re];j[re]=j[se+1],j[se+1]=Oe;for(var Ie=0;Ie<F;Ie++){var _e=j[Ie][re];j[Ie][re]=j[Ie][se+1],j[Ie][se+1]=_e}if(le){var Le=me[re];me[re]=me[se+1],me[se+1]=Le}}for(var qe=se+2;qe<F;qe++){var G=o(j[qe][se],pe);if(G!==0){for(var ee=0;ee<F;ee++)j[qe][ee]=t(j[qe][ee],i(G,j[se+1][ee]));for(var R=0;R<F;R++)j[R][se+1]=e(j[R][se+1],i(G,j[R][qe]));if(le)for(var H=0;H<F;H++)me[qe][H]=t(me[qe][H],i(G,me[se+1][H]))}}}}return me}function S(j,F,U,$,le){var me=$==="BigNumber",Y=$==="Complex",z=me?s(1):Y?D(1):1;me&&(U=s(U));for(var X=er(j),se=[],re=F,pe=[],ve=le?c(Array(F).fill(z)):void 0,De=le?c(Array(re).fill(z)):void 0,Oe=0;Oe<=100;){Oe+=1;for(var Ie=X[re-1][re-1],_e=0;_e<re;_e++)X[_e][_e]=t(X[_e][_e],Ie);var{Q:Le,R:qe}=p(X);X=a(qe,Le);for(var G=0;G<re;G++)X[G][G]=e(X[G][G],Ie);if(le&&(De=a(De,Le)),re===1||w(u(X[re-1][re-2]),U)){Oe=0,se.push(X[re-1][re-1]),le&&(pe.unshift([[1]]),I(De,F),ve=a(ve,De),re>1&&(De=c(Array(re-1).fill(z)))),re-=1,X.pop();for(var ee=0;ee<re;ee++)X[ee].pop()}else if(re===2||w(u(X[re-2][re-3]),U)){Oe=0;var R=M(X[re-2][re-2],X[re-2][re-1],X[re-1][re-2],X[re-1][re-1]);se.push(...R),le&&(pe.unshift(O(X[re-2][re-2],X[re-2][re-1],X[re-1][re-2],X[re-1][re-1],R[0],R[1],U,$)),I(De,F),ve=a(ve,De),re>2&&(De=c(Array(re-2).fill(z)))),re-=2,X.pop(),X.pop();for(var H=0;H<re;H++)X[H].pop(),X[H].pop()}if(re===0)break}if(se.sort((ue,oe)=>+t(u(ue),u(oe))),Oe>100){var Q=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+se.join(", "));throw Q.values=se,Q.vectors=[],Q}var ie=le?a(ve,k(pe,F)):void 0;return{values:se,C:ie}}function C(j,F,U,$,le,me,Y){var z=v(U),X=a(z,j,U),se=Y==="BigNumber",re=Y==="Complex",pe=se?s(0):re?D(0):0,ve=se?s(1):re?D(1):1,De=[],Oe=[];for(var Ie of le){var _e=_(De,Ie,x);_e===-1?(De.push(Ie),Oe.push(1)):Oe[_e]+=1}for(var Le=[],qe=De.length,G=Array(F).fill(pe),ee=c(Array(F).fill(ve)),R=function(){var ie=De[H],ue=t(X,a(ie,ee)),oe=y(ue,G);for(oe.shift();oe.length<Oe[H];){var we=P(ue,F,oe,me,Y);if(we===null)break;oe.push(we)}var xe=a(v($),U);oe=oe.map(Te=>a(xe,Te)),Le.push(...oe.map(Te=>({value:ie,vector:n(Te)})))},H=0;H<qe;H++)R();return Le}function M(j,F,U,$){var le=e(j,$),me=t(i(j,$),i(F,U)),Y=i(le,.5),z=i(l(t(i(le,le),i(4,me))),.5);return[e(Y,z),t(Y,z)]}function O(j,F,U,$,le,me,Y,z){var X=z==="BigNumber",se=z==="Complex",re=X?s(0):se?D(0):0,pe=X?s(1):se?D(1):1;if(w(u(U),Y))return[[pe,re],[re,pe]];if(h(u(t(le,me)),Y))return[[t(le,$),t(me,$)],[U,U]];var ve=t(j,le),De=t($,le);return w(u(F),Y)&&w(u(De),Y)?[[ve,pe],[U,re]]:[[F,re],[De,pe]]}function I(j,F){for(var U=0;U<j.length;U++)j[U].push(...Array(F-j[U].length).fill(0));for(var $=j.length;$<F;$++)j.push(Array(F).fill(0)),j[$][$]=1;return j}function k(j,F){for(var U=[],$=0;$<F;$++)U[$]=Array(F).fill(0);var le=0;for(var me of j){for(var Y=me.length,z=0;z<Y;z++)for(var X=0;X<Y;X++)U[le+z][le+X]=me[z][X];le+=Y}return U}function _(j,F,U){for(var $=0;$<j.length;$++)if(U(j[$],F))return $;return-1}function P(j,F,U,$,le){for(var me=le==="BigNumber"?s(1e3):1e3,Y,z=0;z<5;++z){Y=V(F,U,le);try{Y=d(j,Y)}catch{continue}if(h(J(Y),me))break}if(z>=5)return null;for(z=0;;){var X=d(j,Y);if(w(J(q(Y,[X])),$))break;if(++z>=10)return null;Y=ne(X)}return Y}function V(j,F,U){var $=U==="BigNumber",le=U==="Complex",me=Array(j).fill(0).map(Y=>2*Math.random()-1);return $&&(me=me.map(Y=>s(Y))),le&&(me=me.map(Y=>D(Y))),me=q(me,F),ne(me,U)}function q(j,F){var U=f(j);for(var $ of F)$=m($,U),j=t(j,a(o(b($,j),b($,$)),$));return j}function J(j){return u(l(b(j,j)))}function ne(j,F){var U=F==="BigNumber",$=F==="Complex",le=U?s(1):$?D(1):1;return a(o(le,J(j)),j)}return A}function z3(r){var{config:e,addScalar:t,subtract:n,abs:a,atan:i,cos:o,sin:l,multiplyScalar:u,inv:s,bignumber:c,multiply:f,add:m}=r;function v(E,S){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.relTol,M=arguments.length>3?arguments[3]:void 0,O=arguments.length>4?arguments[4]:void 0;if(M==="number")return p(E,C,O);if(M==="BigNumber")return d(E,C,O);throw TypeError("Unsupported data type: "+M)}function p(E,S,C){var M=E.length,O=Math.abs(S/M),I,k;if(C){k=new Array(M);for(var _=0;_<M;_++)k[_]=Array(M).fill(0),k[_][_]=1}for(var P=b(E);Math.abs(P[1])>=Math.abs(O);){var V=P[0][0],q=P[0][1];I=y(E[V][V],E[q][q],E[V][q]),E=g(E,I,V,q),C&&(k=D(k,I,V,q)),P=b(E)}for(var J=Array(M).fill(0),ne=0;ne<M;ne++)J[ne]=E[ne][ne];return N(er(J),k,C)}function d(E,S,C){var M=E.length,O=a(S/M),I,k;if(C){k=new Array(M);for(var _=0;_<M;_++)k[_]=Array(M).fill(0),k[_][_]=1}for(var P=A(E);a(P[1])>=a(O);){var V=P[0][0],q=P[0][1];I=x(E[V][V],E[q][q],E[V][q]),E=w(E,I,V,q),C&&(k=h(k,I,V,q)),P=A(E)}for(var J=Array(M).fill(0),ne=0;ne<M;ne++)J[ne]=E[ne][ne];return N(er(J),k,C)}function y(E,S,C){var M=S-E;return Math.abs(M)<=e.relTol?Math.PI/4:.5*Math.atan(2*C/(S-E))}function x(E,S,C){var M=n(S,E);return a(M)<=e.relTol?c(-1).acos().div(4):u(.5,i(f(2,C,s(M))))}function D(E,S,C,M){for(var O=E.length,I=Math.cos(S),k=Math.sin(S),_=Array(O).fill(0),P=Array(O).fill(0),V=0;V<O;V++)_[V]=I*E[V][C]-k*E[V][M],P[V]=k*E[V][C]+I*E[V][M];for(var q=0;q<O;q++)E[q][C]=_[q],E[q][M]=P[q];return E}function h(E,S,C,M){for(var O=E.length,I=o(S),k=l(S),_=Array(O).fill(c(0)),P=Array(O).fill(c(0)),V=0;V<O;V++)_[V]=n(u(I,E[V][C]),u(k,E[V][M])),P[V]=t(u(k,E[V][C]),u(I,E[V][M]));for(var q=0;q<O;q++)E[q][C]=_[q],E[q][M]=P[q];return E}function w(E,S,C,M){for(var O=E.length,I=c(o(S)),k=c(l(S)),_=u(I,I),P=u(k,k),V=Array(O).fill(c(0)),q=Array(O).fill(c(0)),J=f(c(2),I,k,E[C][M]),ne=t(n(u(_,E[C][C]),J),u(P,E[M][M])),j=m(u(P,E[C][C]),J,u(_,E[M][M])),F=0;F<O;F++)V[F]=n(u(I,E[C][F]),u(k,E[M][F])),q[F]=t(u(k,E[C][F]),u(I,E[M][F]));E[C][C]=ne,E[M][M]=j,E[C][M]=c(0),E[M][C]=c(0);for(var U=0;U<O;U++)U!==C&&U!==M&&(E[C][U]=V[U],E[U][C]=V[U],E[M][U]=q[U],E[U][M]=q[U]);return E}function g(E,S,C,M){for(var O=E.length,I=Math.cos(S),k=Math.sin(S),_=I*I,P=k*k,V=Array(O).fill(0),q=Array(O).fill(0),J=_*E[C][C]-2*I*k*E[C][M]+P*E[M][M],ne=P*E[C][C]+2*I*k*E[C][M]+_*E[M][M],j=0;j<O;j++)V[j]=I*E[C][j]-k*E[M][j],q[j]=k*E[C][j]+I*E[M][j];E[C][C]=J,E[M][M]=ne,E[C][M]=0,E[M][C]=0;for(var F=0;F<O;F++)F!==C&&F!==M&&(E[C][F]=V[F],E[F][C]=V[F],E[M][F]=q[F],E[F][M]=q[F]);return E}function b(E){for(var S=E.length,C=0,M=[0,1],O=0;O<S;O++)for(var I=O+1;I<S;I++)Math.abs(C)<Math.abs(E[O][I])&&(C=Math.abs(E[O][I]),M=[O,I]);return[M,C]}function A(E){for(var S=E.length,C=0,M=[0,1],O=0;O<S;O++)for(var I=O+1;I<S;I++)a(C)<a(E[O][I])&&(C=a(E[O][I]),M=[O,I]);return[M,C]}function N(E,S,C){var M=E.length,O=Array(M),I;if(C){I=Array(M);for(var k=0;k<M;k++)I[k]=Array(M)}for(var _=0;_<M;_++){for(var P=0,V=E[0],q=0;q<E.length;q++)a(E[q])<a(V)&&(P=q,V=E[P]);if(O[_]=E.splice(P,1)[0],C)for(var J=0;J<M;J++)I[_][J]=S[J][P],S[J].splice(P,1)}if(!C)return{values:O};var ne=I.map((j,F)=>({value:O[F],vector:j}));return{values:O,eigenvectors:ne}}return v}var U3="eigs",L3=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],k3=L(U3,L3,r=>{var{config:e,typed:t,matrix:n,addScalar:a,subtract:i,equal:o,abs:l,atan:u,cos:s,sin:c,multiplyScalar:f,divideScalar:m,inv:v,bignumber:p,multiply:d,add:y,larger:x,column:D,flatten:h,number:w,complex:g,sqrt:b,diag:A,size:N,reshape:E,qr:S,usolve:C,usolveAll:M,im:O,re:I,smaller:k,matrixFromColumns:_,dot:P}=r,V=z3({config:e,addScalar:a,subtract:i,abs:l,atan:u,cos:s,sin:c,multiplyScalar:f,inv:v,bignumber:p,multiply:d,add:y}),q=q3({addScalar:a,subtract:i,multiply:d,multiplyScalar:f,flatten:h,divideScalar:m,sqrt:b,abs:l,bignumber:p,diag:A,size:N,reshape:E,qr:S,inv:v,usolve:C,usolveAll:M,equal:o,complex:g,larger:x,smaller:k,matrixFromColumns:_,dot:P});return t("eigs",{Array:function(me){return J(n(me))},"Array, number|BigNumber":function(me,Y){return J(n(me),{precision:Y})},"Array, Object"(le,me){return J(n(le),me)},Matrix:function(me){return J(me,{matricize:!0})},"Matrix, number|BigNumber":function(me,Y){return J(me,{precision:Y,matricize:!0})},"Matrix, Object":function(me,Y){var z={matricize:!0};return zr(z,Y),J(me,z)}});function J(le){var me,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z="eigenvectors"in Y?Y.eigenvectors:!0,X=(me=Y.precision)!==null&&me!==void 0?me:e.relTol,se=ne(le,X,z);return Y.matricize&&(se.values=n(se.values),z&&(se.eigenvectors=se.eigenvectors.map(re=>{var{value:pe,vector:ve}=re;return{value:pe,vector:n(ve)}}))),z&&Object.defineProperty(se,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),se}function ne(le,me,Y){var z=le.toArray(),X=le.size();if(X.length!==2||X[0]!==X[1])throw new RangeError("Matrix must be square (size: ".concat(lr(X),")"));var se=X[0];if(F(z,se,me)&&(U(z,se),j(z,se,me))){var re=$(le,z,se);return V(z,se,me,re,Y)}var pe=$(le,z,se);return q(z,se,me,pe,Y)}function j(le,me,Y){for(var z=0;z<me;z++)for(var X=z;X<me;X++)if(x(p(l(i(le[z][X],le[X][z]))),Y))return!1;return!0}function F(le,me,Y){for(var z=0;z<me;z++)for(var X=0;X<me;X++)if(x(p(l(O(le[z][X]))),Y))return!1;return!0}function U(le,me){for(var Y=0;Y<me;Y++)for(var z=0;z<me;z++)le[Y][z]=I(le[Y][z])}function $(le,me,Y){var z=le.datatype();if(z==="number"||z==="BigNumber"||z==="Complex")return z;for(var X=!1,se=!1,re=!1,pe=0;pe<Y;pe++)for(var ve=0;ve<Y;ve++){var De=me[pe][ve];if(Ye(De)||Ka(De))X=!0;else if(or(De))se=!0;else if(ln(De))re=!0;else throw TypeError("Unsupported type in Matrix: "+Sr(De))}if(se&&re&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),re){for(var Oe=0;Oe<Y;Oe++)for(var Ie=0;Ie<Y;Ie++)me[Oe][Ie]=g(me[Oe][Ie]);return"Complex"}if(se){for(var _e=0;_e<Y;_e++)for(var Le=0;Le<Y;Le++)me[_e][Le]=p(me[_e][Le]);return"BigNumber"}if(X){for(var qe=0;qe<Y;qe++)for(var G=0;G<Y;G++)me[qe][G]=w(me[qe][G]);return"number"}else throw TypeError("Matrix contains unsupported types only.")}}),Mp="expm",V3=["typed","abs","add","identity","inv","multiply"],G3=L(Mp,V3,r=>{var{typed:e,abs:t,add:n,identity:a,inv:i,multiply:o}=r;return e(Mp,{Matrix:function(f){var m=f.size();if(m.length!==2||m[0]!==m[1])throw new RangeError("Matrix must be square (size: "+lr(m)+")");for(var v=m[0],p=1e-15,d=l(f),y=u(d,p),x=y.q,D=y.j,h=o(f,Math.pow(2,-D)),w=a(v),g=a(v),b=1,A=h,N=-1,E=1;E<=x;E++)E>1&&(A=o(A,h),N=-N),b=b*(x-E+1)/((2*x-E+1)*E),w=n(w,o(b,A)),g=n(g,o(b*N,A));for(var S=o(i(g),w),C=0;C<D;C++)S=o(S,S);return Yn(f)?f.createSparseMatrix(S):S}});function l(c){for(var f=c.size()[0],m=0,v=0;v<f;v++){for(var p=0,d=0;d<f;d++)p+=t(c.get([v,d]));m=Math.max(p,m)}return m}function u(c,f){for(var m=30,v=0;v<m;v++)for(var p=0;p<=v;p++){var d=v-p;if(s(c,p,d)<f)return{q:p,j:d}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}function s(c,f,m){for(var v=1,p=2;p<=f;p++)v*=p;for(var d=v,y=f+1;y<=2*f;y++)d*=y;var x=d*(2*f+1);return 8*Math.pow(c/Math.pow(2,m),2*f)*v*v/(d*x)}}),_p="sqrtm",H3=["typed","abs","add","multiply","map","sqrt","subtract","inv","size","max","identity"],W3=L(_p,H3,r=>{var{typed:e,abs:t,add:n,multiply:a,map:i,sqrt:o,subtract:l,inv:u,size:s,max:c,identity:f}=r,m=1e3,v=1e-6;function p(d){var y,x=0,D=d,h=f(s(d));do{var w=D;if(D=a(.5,n(w,u(h))),h=a(.5,n(h,u(w))),y=c(t(l(D,w))),y>v&&++x>m)throw new Error("computing square root of matrix: iterative method could not converge")}while(y>v);return D}return e(_p,{"Array | Matrix":function(y){var x=Je(y)?y.size():rr(y);switch(x.length){case 1:if(x[0]===1)return i(y,o);throw new RangeError("Matrix must be square (size: "+lr(x)+")");case 2:{var D=x[0],h=x[1];if(D===h)return p(y);throw new RangeError("Matrix must be square (size: "+lr(x)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+lr(x)+")")}}})}),Tp="sylvester",Y3=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],Z3=L(Tp,Y3,r=>{var{typed:e,schur:t,matrixFromColumns:n,matrix:a,multiply:i,range:o,concat:l,transpose:u,index:s,subset:c,add:f,subtract:m,identity:v,lusolve:p,abs:d,config:y}=r;return e(Tp,{"Matrix, Matrix, Matrix":x,"Array, Matrix, Matrix":function(h,w,g){return x(a(h),w,g)},"Array, Array, Matrix":function(h,w,g){return x(a(h),a(w),g)},"Array, Matrix, Array":function(h,w,g){return x(a(h),w,a(g))},"Matrix, Array, Matrix":function(h,w,g){return x(h,a(w),g)},"Matrix, Array, Array":function(h,w,g){return x(h,a(w),a(g))},"Matrix, Matrix, Array":function(h,w,g){return x(h,w,a(g))},"Array, Array, Array":function(h,w,g){return x(a(h),a(w),a(g)).toArray()}});function x(D,h,w){for(var g=h.size()[0],b=D.size()[0],A=t(D),N=A.T,E=A.U,S=t(i(-1,h)),C=S.T,M=S.U,O=i(i(u(E),w),M),I=o(0,b),k=[],_=(pe,ve)=>l(pe,ve,1),P=(pe,ve)=>l(pe,ve,0),V=0;V<g;V++)if(V<g-1&&d(c(C,s(V+1,V)))>1e-5){for(var q=P(c(O,s(I,[V])),c(O,s(I,[V+1]))),J=0;J<V;J++)q=f(q,P(i(k[J],c(C,s(J,V))),i(k[J],c(C,s(J,V+1)))));var ne=i(v(b),i(-1,c(C,s(V,V)))),j=i(v(b),i(-1,c(C,s(V+1,V)))),F=i(v(b),i(-1,c(C,s(V,V+1)))),U=i(v(b),i(-1,c(C,s(V+1,V+1)))),$=P(_(f(N,ne),j),_(F,f(N,U))),le=p($,q);k[V]=le.subset(s(o(0,b),[0])),k[V+1]=le.subset(s(o(b,2*b),[0])),V++}else{for(var me=c(O,s(I,[V])),Y=0;Y<V;Y++)me=f(me,i(k[Y],c(C,s(Y,V))));var z=c(C,s(V,V)),X=m(N,i(z,v(b)));k[V]=p(X,me)}var se=a(n(...k)),re=i(E,i(se,u(M)));return re}}),Fp="schur",J3=["typed","matrix","identity","multiply","qr","norm","subtract"],j3=L(Fp,J3,r=>{var{typed:e,matrix:t,identity:n,multiply:a,qr:i,norm:o,subtract:l}=r;return e(Fp,{Array:function(c){var f=u(t(c));return{U:f.U.valueOf(),T:f.T.valueOf()}},Matrix:function(c){return u(c)}});function u(s){var c=s.size()[0],f=s,m=n(c),v=0,p;do{p=f;var d=i(f),y=d.Q,x=d.R;if(f=a(x,y),m=a(m,y),v++>100)break}while(o(l(f,p))>1e-4);return{U:m,T:f}}}),Op="lyap",X3=["typed","matrix","sylvester","multiply","transpose"],Q3=L(Op,X3,r=>{var{typed:e,matrix:t,sylvester:n,multiply:a,transpose:i}=r;return e(Op,{"Matrix, Matrix":function(l,u){return n(l,i(l),a(-1,u))},"Array, Matrix":function(l,u){return n(t(l),i(t(l)),a(-1,u))},"Matrix, Array":function(l,u){return n(l,i(t(l)),t(a(-1,u)))},"Array, Array":function(l,u){return n(t(l),i(t(l)),t(a(-1,u))).toArray()}})}),K3="divide",eO=["typed","matrix","multiply","equalScalar","divideScalar","inv"],rO=L(K3,eO,r=>{var{typed:e,matrix:t,multiply:n,equalScalar:a,divideScalar:i,inv:o}=r,l=nt({typed:e,equalScalar:a}),u=Ut({typed:e});return e("divide",Ku({"Array | Matrix, Array | Matrix":function(c,f){return n(c,o(f))},"DenseMatrix, any":function(c,f){return u(c,f,i,!1)},"SparseMatrix, any":function(c,f){return l(c,f,i,!1)},"Array, any":function(c,f){return u(t(c),f,i,!1).valueOf()},"any, Array | Matrix":function(c,f){return n(c,o(f))}},i.signatures))}),Bp="distance",tO=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],nO=L(Bp,tO,r=>{var{typed:e,addScalar:t,subtractScalar:n,multiplyScalar:a,divideScalar:i,deepEqual:o,sqrt:l,abs:u}=r;return e(Bp,{"Array, Array, Array":function(g,b,A){if(g.length===2&&b.length===2&&A.length===2){if(!c(g))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!c(b))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!c(A))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(o(b,A))throw new TypeError("LinePoint1 should not be same with LinePoint2");var N=n(A[1],b[1]),E=n(b[0],A[0]),S=n(a(A[0],b[1]),a(b[0],A[1]));return y(g[0],g[1],N,E,S)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(g,b,A){if(Object.keys(g).length===2&&Object.keys(b).length===2&&Object.keys(A).length===2){if(!c(g))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!c(b))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!c(A))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(o(p(b),p(A)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in g&&"pointY"in g&&"lineOnePtX"in b&&"lineOnePtY"in b&&"lineTwoPtX"in A&&"lineTwoPtY"in A){var N=n(A.lineTwoPtY,b.lineOnePtY),E=n(b.lineOnePtX,A.lineTwoPtX),S=n(a(A.lineTwoPtX,b.lineOnePtY),a(b.lineOnePtX,A.lineTwoPtY));return y(g.pointX,g.pointY,N,E,S)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(g,b){if(g.length===2&&b.length===3){if(!c(g))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(b))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return y(g[0],g[1],b[0],b[1],b[2])}else if(g.length===3&&b.length===6){if(!f(g))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!v(b))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return x(g[0],g[1],g[2],b[0],b[1],b[2],b[3],b[4],b[5])}else if(g.length===b.length&&g.length>0){if(!m(g))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!m(b))throw new TypeError("All values of an array should be numbers or BigNumbers");return D(g,b)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(g,b){if(Object.keys(g).length===2&&Object.keys(b).length===3){if(!c(g))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(b))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in g&&"pointY"in g&&"xCoeffLine"in b&&"yCoeffLine"in b&&"constant"in b)return y(g.pointX,g.pointY,b.xCoeffLine,b.yCoeffLine,b.constant);throw new TypeError("Key names do not match")}else if(Object.keys(g).length===3&&Object.keys(b).length===6){if(!f(g))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!v(b))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in g&&"pointY"in g&&"x0"in b&&"y0"in b&&"z0"in b&&"a"in b&&"b"in b&&"c"in b)return x(g.pointX,g.pointY,g.pointZ,b.x0,b.y0,b.z0,b.a,b.b,b.c);throw new TypeError("Key names do not match")}else if(Object.keys(g).length===2&&Object.keys(b).length===2){if(!c(g))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!c(b))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in g&&"pointOneY"in g&&"pointTwoX"in b&&"pointTwoY"in b)return D([g.pointOneX,g.pointOneY],[b.pointTwoX,b.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(g).length===3&&Object.keys(b).length===3){if(!f(g))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!f(b))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in g&&"pointOneY"in g&&"pointOneZ"in g&&"pointTwoX"in b&&"pointTwoY"in b&&"pointTwoZ"in b)return D([g.pointOneX,g.pointOneY,g.pointOneZ],[b.pointTwoX,b.pointTwoY,b.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(g){if(!d(g))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return h(g)}});function s(w){return typeof w=="number"||or(w)}function c(w){return w.constructor!==Array&&(w=p(w)),s(w[0])&&s(w[1])}function f(w){return w.constructor!==Array&&(w=p(w)),s(w[0])&&s(w[1])&&s(w[2])}function m(w){return Array.isArray(w)||(w=p(w)),w.every(s)}function v(w){return w.constructor!==Array&&(w=p(w)),s(w[0])&&s(w[1])&&s(w[2])&&s(w[3])&&s(w[4])&&s(w[5])}function p(w){for(var g=Object.keys(w),b=[],A=0;A<g.length;A++)b.push(w[g[A]]);return b}function d(w){if(w[0].length===2&&s(w[0][0])&&s(w[0][1])){if(w.some(g=>g.length!==2||!s(g[0])||!s(g[1])))return!1}else if(w[0].length===3&&s(w[0][0])&&s(w[0][1])&&s(w[0][2])){if(w.some(g=>g.length!==3||!s(g[0])||!s(g[1])||!s(g[2])))return!1}else return!1;return!0}function y(w,g,b,A,N){var E=u(t(t(a(b,w),a(A,g)),N)),S=l(t(a(b,b),a(A,A)));return i(E,S)}function x(w,g,b,A,N,E,S,C,M){var O=[n(a(n(N,g),M),a(n(E,b),C)),n(a(n(E,b),S),a(n(A,w),M)),n(a(n(A,w),C),a(n(N,g),S))];O=l(t(t(a(O[0],O[0]),a(O[1],O[1])),a(O[2],O[2])));var I=l(t(t(a(S,S),a(C,C)),a(M,M)));return i(O,I)}function D(w,g){for(var b=w.length,A=0,N=0,E=0;E<b;E++)N=n(w[E],g[E]),A=t(a(N,N),A);return l(A)}function h(w){for(var g=[],b=[],A=[],N=0;N<w.length-1;N++)for(var E=N+1;E<w.length;E++)w[0].length===2?(b=[w[N][0],w[N][1]],A=[w[E][0],w[E][1]]):w[0].length===3&&(b=[w[N][0],w[N][1],w[N][2]],A=[w[E][0],w[E][1],w[E][2]]),g.push(D(b,A));return g}}),aO="intersect",iO=["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar","flatten","isZero","isNumeric"],oO=L(aO,iO,r=>{var{typed:e,config:t,abs:n,add:a,addScalar:i,matrix:o,multiply:l,multiplyScalar:u,divideScalar:s,subtract:c,smaller:f,equalScalar:m,flatten:v,isZero:p,isNumeric:d}=r;return e("intersect",{"Array, Array, Array":y,"Array, Array, Array, Array":x,"Matrix, Matrix, Matrix":function(C,M,O){var I=y(C.valueOf(),M.valueOf(),O.valueOf());return I===null?null:o(I)},"Matrix, Matrix, Matrix, Matrix":function(C,M,O,I){var k=x(C.valueOf(),M.valueOf(),O.valueOf(),I.valueOf());return k===null?null:o(k)}});function y(S,C,M){if(S=D(S),C=D(C),M=D(M),!w(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!w(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!g(M))throw new TypeError("Array with 4 numbers expected as third argument");return E(S[0],S[1],S[2],C[0],C[1],C[2],M[0],M[1],M[2],M[3])}function x(S,C,M,O){if(S=D(S),C=D(C),M=D(M),O=D(O),S.length===2){if(!h(S))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!h(C))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!h(M))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!h(O))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return b(S,C,M,O)}else if(S.length===3){if(!w(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!w(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!w(M))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!w(O))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return N(S[0],S[1],S[2],C[0],C[1],C[2],M[0],M[1],M[2],O[0],O[1],O[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function D(S){return S.length===1?S[0]:S.length>1&&Array.isArray(S[0])&&S.every(C=>Array.isArray(C)&&C.length===1)?v(S):S}function h(S){return S.length===2&&d(S[0])&&d(S[1])}function w(S){return S.length===3&&d(S[0])&&d(S[1])&&d(S[2])}function g(S){return S.length===4&&d(S[0])&&d(S[1])&&d(S[2])&&d(S[3])}function b(S,C,M,O){var I=S,k=M,_=c(I,C),P=c(k,O),V=c(u(_[0],P[1]),u(P[0],_[1]));if(p(V)||f(n(V),t.relTol))return null;var q=u(P[0],I[1]),J=u(P[1],I[0]),ne=u(P[0],k[1]),j=u(P[1],k[0]),F=s(i(c(c(q,J),ne),j),V);return a(l(_,F),I)}function A(S,C,M,O,I,k,_,P,V,q,J,ne){var j=u(c(S,C),c(M,O)),F=u(c(I,k),c(_,P)),U=u(c(V,q),c(J,ne));return i(i(j,F),U)}function N(S,C,M,O,I,k,_,P,V,q,J,ne){var j=A(S,_,q,_,C,P,J,P,M,V,ne,V),F=A(q,_,O,S,J,P,I,C,ne,V,k,M),U=A(S,_,O,S,C,P,I,C,M,V,k,M),$=A(q,_,q,_,J,P,J,P,ne,V,ne,V),le=A(O,S,O,S,I,C,I,C,k,M,k,M),me=c(u(j,F),u(U,$)),Y=c(u(le,$),u(F,F));if(p(Y))return null;var z=s(me,Y),X=s(i(j,u(z,F)),$),se=i(S,u(z,c(O,S))),re=i(C,u(z,c(I,C))),pe=i(M,u(z,c(k,M))),ve=i(_,u(X,c(q,_))),De=i(P,u(X,c(J,P))),Oe=i(V,u(X,c(ne,V)));return m(se,ve)&&m(re,De)&&m(pe,Oe)?[se,re,pe]:null}function E(S,C,M,O,I,k,_,P,V,q){var J=u(S,_),ne=u(O,_),j=u(C,P),F=u(I,P),U=u(M,V),$=u(k,V),le=c(c(c(q,J),j),U),me=c(c(c(i(i(ne,F),$),J),j),U),Y=s(le,me),z=i(S,u(Y,c(O,S))),X=i(C,u(Y,c(I,C))),se=i(M,u(Y,c(k,M)));return[z,X,se]}}),Rp="sum",sO=["typed","config","add","numeric"],Ip=L(Rp,sO,r=>{var{typed:e,config:t,add:n,numeric:a}=r;return e(Rp,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":o,"...":function(u){if(Sa(u))throw new TypeError("Scalar values expected in function sum");return i(u)}});function i(l){var u;return Rn(l,function(s){try{u=u===void 0?s:n(u,s)}catch(c){throw dt(c,"sum",s)}}),u===void 0&&(u=a(0,t.number)),typeof u=="string"&&(u=a(u,An(u,t))),u}function o(l,u){try{var s=Qi(l,u,n);return s}catch(c){throw dt(c,"sum")}}}),Oo="cumsum",uO=["typed","add","unaryPlus"],Pp=L(Oo,uO,r=>{var{typed:e,add:t,unaryPlus:n}=r;return e(Oo,{Array:a,Matrix:function(s){return s.create(a(s.valueOf(),s.datatype()))},"Array, number | BigNumber":o,"Matrix, number | BigNumber":function(s,c){return s.create(o(s.valueOf(),c),s.datatype())},"...":function(s){if(Sa(s))throw new TypeError("All values expected to be scalar in function cumsum");return a(s)}});function a(u){try{return i(u)}catch(s){throw dt(s,Oo)}}function i(u){if(u.length===0)return[];for(var s=[n(u[0])],c=1;c<u.length;++c)s.push(t(s[c-1],u[c]));return s}function o(u,s){var c=rr(u);if(s<0||s>=c.length)throw new Yt(s,c.length);try{return l(u,s)}catch(f){throw dt(f,Oo)}}function l(u,s){var c,f,m;if(s<=0){var v=u[0][0];if(Array.isArray(v)){for(m=Gl(u),f=[],c=0;c<m.length;c++)f[c]=l(m[c],s-1);return f}else return i(u)}else{for(f=[],c=0;c<u.length;c++)f[c]=l(u[c],s-1);return f}}}),$p="mean",lO=["typed","add","divide"],qp=L($p,lO,r=>{var{typed:e,add:t,divide:n}=r;return e($p,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":a,"...":function(l){if(Sa(l))throw new TypeError("Scalar values expected in function mean");return i(l)}});function a(o,l){try{var u=Qi(o,l,t),s=Array.isArray(o)?rr(o):o.size();return n(u,s[l])}catch(c){throw dt(c,"mean")}}function i(o){var l,u=0;if(Rn(o,function(s){try{l=l===void 0?s:t(l,s),u++}catch(c){throw dt(c,"mean",s)}}),u===0)throw new Error("Cannot calculate the mean of an empty array");return n(l,u)}}),zp="median",cO=["typed","add","divide","compare","partitionSelect"],fO=L(zp,cO,r=>{var{typed:e,add:t,divide:n,compare:a,partitionSelect:i}=r;function o(s){try{s=yr(s.valueOf());var c=s.length;if(c===0)throw new Error("Cannot calculate median of an empty array");if(c%2===0){for(var f=c/2-1,m=i(s,f+1),v=s[f],p=0;p<f;++p)a(s[p],v)>0&&(v=s[p]);return u(v,m)}else{var d=i(s,(c-1)/2);return l(d)}}catch(y){throw dt(y,"median")}}var l=e({"number | BigNumber | Complex | Unit":function(c){return c}}),u=e({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(c,f){return n(t(c,f),2)}});return e(zp,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(c,f){throw new Error("median(A, dim) is not yet supported")},"...":function(c){if(Sa(c))throw new TypeError("Scalar values expected in function median");return o(c)}})}),Up="mad",mO=["typed","abs","map","median","subtract"],vO=L(Up,mO,r=>{var{typed:e,abs:t,map:n,median:a,subtract:i}=r;return e(Up,{"Array | Matrix":o,"...":function(u){return o(u)}});function o(l){if(l=yr(l.valueOf()),l.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var u=a(l);return a(n(l,function(s){return t(i(s,u))}))}catch(s){throw s instanceof TypeError&&s.message.includes("median")?new TypeError(s.message.replace("median","mad")):dt(s,"mad")}}}),Ls="unbiased",Lp="variance",pO=["typed","add","subtract","multiply","divide","mapSlices","isNaN"],kp=L(Lp,pO,r=>{var{typed:e,add:t,subtract:n,multiply:a,divide:i,mapSlices:o,isNaN:l}=r;return e(Lp,{"Array | Matrix":function(f){return u(f,Ls)},"Array | Matrix, string":u,"Array | Matrix, number | BigNumber":function(f,m){return s(f,m,Ls)},"Array | Matrix, number | BigNumber, string":s,"...":function(f){return u(f,Ls)}});function u(c,f){var m,v=0;if(c.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Rn(c,function(y){try{m=m===void 0?y:t(m,y),v++}catch(x){throw dt(x,"variance",y)}}),v===0)throw new Error("Cannot calculate variance of an empty array");var p=i(m,v);if(m=void 0,Rn(c,function(y){var x=n(y,p);m=m===void 0?a(x,x):t(m,a(x,x))}),l(m))return m;switch(f){case"uncorrected":return i(m,v);case"biased":return i(m,v+1);case"unbiased":{var d=or(m)?m.mul(0):0;return v===1?d:i(m,v-1)}default:throw new Error('Unknown normalization "'+f+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function s(c,f,m){try{if(c.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return o(c,f,v=>u(v,m))}catch(v){throw dt(v,"variance")}}}),Vp="quantileSeq",dO=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger","mapSlices"],Gp=L(Vp,dO,r=>{var{typed:e,bignumber:t,add:n,subtract:a,divide:i,multiply:o,partitionSelect:l,compare:u,isInteger:s,smaller:c,smallerEq:f,larger:m,mapSlices:v}=r;return e(Vp,{"Array | Matrix, number | BigNumber":(D,h)=>d(D,h,!1),"Array | Matrix, number | BigNumber, number":(D,h,w)=>p(D,h,!1,w,d),"Array | Matrix, number | BigNumber, boolean":d,"Array | Matrix, number | BigNumber, boolean, number":(D,h,w,g)=>p(D,h,w,g,d),"Array | Matrix, Array | Matrix":(D,h)=>y(D,h,!1),"Array | Matrix, Array | Matrix, number":(D,h,w)=>p(D,h,!1,w,y),"Array | Matrix, Array | Matrix, boolean":y,"Array | Matrix, Array | Matrix, boolean, number":(D,h,w,g)=>p(D,h,w,g,y)});function p(D,h,w,g,b){return v(D,g,A=>b(A,h,w))}function d(D,h,w){var g,b=D.valueOf();if(c(h,0))throw new Error("N/prob must be non-negative");if(f(h,1))return Ye(h)?x(b,h,w):t(x(b,h,w));if(m(h,1)){if(!s(h))throw new Error("N must be a positive integer");if(m(h,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var A=n(h,1);g=[];for(var N=0;c(N,h);N++){var E=i(N+1,A);g.push(x(b,E,w))}return Ye(h)?g:t(g)}}function y(D,h,w){for(var g=D.valueOf(),b=h.valueOf(),A=[],N=0;N<b.length;++N)A.push(x(g,b[N],w));return A}function x(D,h,w){var g=yr(D),b=g.length;if(b===0)throw new Error("Cannot calculate quantile of an empty sequence");var A=Ye(h)?h*(b-1):h.times(b-1),N=Ye(h)?Math.floor(A):A.floor().toNumber(),E=Ye(h)?A%1:A.minus(N);if(s(A))return w?g[A]:l(g,Ye(h)?A:A.valueOf());var S,C;if(w)S=g[N],C=g[N+1];else{C=l(g,N+1),S=g[N];for(var M=0;M<N;++M)u(g[M],S)>0&&(S=g[M])}return n(o(S,a(1,E)),o(C,E))}}),Hp="std",hO=["typed","map","sqrt","variance"],Wp=L(Hp,hO,r=>{var{typed:e,map:t,sqrt:n,variance:a}=r;return e(Hp,{"Array | Matrix":i,"Array | Matrix, string":i,"Array | Matrix, number | BigNumber":i,"Array | Matrix, number | BigNumber, string":i,"...":function(l){return i(l)}});function i(o,l){if(o.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var u=a.apply(null,arguments);return Mt(u)?t(u,n):n(u)}catch(s){throw s instanceof TypeError&&s.message.includes(" variance")?new TypeError(s.message.replace(" variance"," std")):s}}}),Yp="corr",gO=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],yO=L(Yp,gO,r=>{var{typed:e,matrix:t,sqrt:n,sum:a,add:i,subtract:o,multiply:l,pow:u,divide:s}=r;return e(Yp,{"Array, Array":function(v,p){return c(v,p)},"Matrix, Matrix":function(v,p){var d=c(v.toArray(),p.toArray());return Array.isArray(d)?t(d):d}});function c(m,v){var p=[];if(Array.isArray(m[0])&&Array.isArray(v[0])){if(m.length!==v.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var d=0;d<m.length;d++){if(m[d].length!==v[d].length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");p.push(f(m[d],v[d]))}return p}else{if(m.length!==v.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");return f(m,v)}}function f(m,v){var p=m.length,d=a(m),y=a(v),x=m.reduce((b,A,N)=>i(b,l(A,v[N])),0),D=a(m.map(b=>u(b,2))),h=a(v.map(b=>u(b,2))),w=o(l(p,x),l(d,y)),g=n(l(o(l(p,D),u(d,2)),o(l(p,h),u(y,2))));return s(w,g)}}),Zp="bernoulli",bO=["typed","config","isInteger","number","?BigNumber","?Fraction"],xO=L(Zp,bO,r=>{var{typed:e,config:t,number:n,BigNumber:a,Fraction:i}=r,o=[void 0],l=[void 0],u=[void 0],s=50;return e(Zp,{number:c=>ks(c,f=>f,o,(f,m)=>f+m,(f,m)=>f*m,(f,m)=>f/m),"bigint | Fraction":c=>ks(n(c),f=>new i(f),l,(f,m)=>f.add(m),(f,m)=>f.mul(m),(f,m)=>f.div(m)),BigNumber:c=>(t.precision!==s&&(u=[void 0],s=t.precision),ks(n(c),f=>new a(f),u,(f,m)=>f.add(m),(f,m)=>f.mul(m),(f,m)=>f.div(m)))})});function ks(r,e,t,n,a,i){if(r<0||!Ue(r))throw new RangeError("Bernoulli index must be nonnegative integer");if(r===0)return e(1);if(r===1)return i(e(-1),e(2));if(r%2===1)return e(0);var o=e(1);t.length===1&&t.push([i(o,e(-3)),i(o,e(-2)),i(o,e(6))]);for(var l=r/2,u=e(0),s=e(2);t.length<=l;){for(var c=t.length,f=Math.floor((c+1)/2),m=u,v=1;v<f;++v)m=n(m,a(t[v][0],t[c-v][0]));m=a(m,s),c%2===0&&(m=n(m,a(t[f][0],t[f][0]))),m=i(m,e(-(2*c+1)));var p=i(a(t[c-1][1],e(-c*(2*c-1))),s);t.push([m,p,a(p,m)])}return t[l][2]}var Jp="combinations",wO=["typed"],DO=L(Jp,wO,r=>{var{typed:e}=r;return e(Jp,{"number, number":dc,"BigNumber, BigNumber":function(n,a){var i=n.constructor,o,l,u=n.minus(a),s=new i(1);if(!jp(n)||!jp(a))throw new TypeError("Positive integer value expected in function combinations");if(a.gt(n))throw new TypeError("k must be less than n in function combinations");if(o=s,a.lt(u))for(l=s;l.lte(u);l=l.plus(s))o=o.times(a.plus(l)).dividedBy(l);else for(l=s;l.lte(a);l=l.plus(s))o=o.times(u.plus(l)).dividedBy(l);return o}})});function jp(r){return r.isInteger()&&r.gte(0)}var Xp="combinationsWithRep",NO=["typed"],EO=L(Xp,NO,r=>{var{typed:e}=r;return e(Xp,{"number, number":function(n,a){if(!Ue(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Ue(a)||a<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(n<1)throw new TypeError("k must be less than or equal to n + k - 1");if(a<n-1){var i=dn(n,n+a-1);return i/dn(1,a)}var o=dn(a+1,n+a-1);return o/dn(1,n-1)},"BigNumber, BigNumber":function(n,a){var i=n.constructor,o,l,u=new i(1),s=n.minus(u);if(!Qp(n)||!Qp(a))throw new TypeError("Positive integer value expected in function combinationsWithRep");if(n.lt(u))throw new TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if(o=u,a.lt(s))for(l=u;l.lte(s);l=l.plus(u))o=o.times(a.plus(l)).dividedBy(l);else for(l=u;l.lte(a);l=l.plus(u))o=o.times(s.plus(l)).dividedBy(l);return o}})});function Qp(r){return r.isInteger()&&r.gte(0)}var Kp="gamma",AO=["typed","config","multiplyScalar","pow","BigNumber","Complex"],SO=L(Kp,AO,r=>{var{typed:e,config:t,multiplyScalar:n,pow:a,BigNumber:i,Complex:o}=r;function l(s){if(s.im===0)return ro(s.re);if(s.re<.5){var c=new o(1-s.re,-s.im),f=new o(Math.PI*s.re,Math.PI*s.im);return new o(Math.PI).div(f.sin()).div(l(c))}s=new o(s.re-1,s.im);for(var m=new o(_a[0],0),v=1;v<_a.length;++v){var p=new o(_a[v],0);m=m.add(p.div(s.add(v)))}var d=new o(s.re+gc+.5,s.im),y=Math.sqrt(2*Math.PI),x=d.pow(s.add(.5)),D=d.neg().exp();return m.mul(y).mul(x).mul(D)}return e(Kp,{number:ro,Complex:l,BigNumber:function(c){if(c.isInteger())return c.isNegative()||c.isZero()?new i(1/0):u(c.minus(1));if(!c.isFinite())return new i(c.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")}});function u(s){if(s<8)return new i([1,1,2,6,24,120,720,5040][s]);var c=t.precision+(Math.log(s.toNumber())|0),f=i.clone({precision:c});if(s%2===1)return s.times(u(new i(s-1)));for(var m=s,v=new f(s),p=s.toNumber();m>2;)m-=2,p+=m,v=v.times(p);return new i(v.toPrecision(i.precision))}}),ed="lgamma",CO=["Complex","typed"],MO=L(ed,CO,r=>{var{Complex:e,typed:t}=r,n=7,a=7,i=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return t(ed,{number:to,Complex:o,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function o(s){var c=6.283185307179586,f=1.1447298858494002,m=.1;if(s.isNaN())return new e(NaN,NaN);if(s.im===0)return new e(to(s.re),0);if(s.re>=n||Math.abs(s.im)>=a)return l(s);if(s.re<=m){var v=j0(c,s.im)*Math.floor(.5*s.re+.25),p=s.mul(Math.PI).sin().log(),d=o(new e(1-s.re,-s.im));return new e(f,v).sub(p).sub(d)}else return s.im>=0?u(s):u(s.conjugate()).conjugate()}function l(s){for(var c=s.sub(.5).mul(s.log()).sub(s).add(yc),f=new e(1,0).div(s),m=f.div(s),v=i[0],p=i[1],d=2*m.re,y=m.re*m.re+m.im*m.im,x=2;x<8;x++){var D=p;p=-y*v+i[x],v=d*v+D}var h=f.mul(m.mul(v).add(p));return c.add(h)}function u(s){var c=0,f=0,m=s;for(s=s.add(1);s.re<=n;){m=m.mul(s);var v=m.im<0?1:0;v!==0&&f===0&&c++,f=v,s=s.add(1)}return l(s).sub(m.log()).sub(new e(0,c*2*Math.PI*1))}}),rd="factorial",_O=["typed","gamma"],TO=L(rd,_O,r=>{var{typed:e,gamma:t}=r;return e(rd,{number:function(a){if(a<0)throw new Error("Value must be non-negative");return t(a+1)},BigNumber:function(a){if(a.isNegative())throw new Error("Value must be non-negative");return t(a.plus(1))},"Array | Matrix":e.referToSelf(n=>a=>tr(a,n))})}),td="kldivergence",FO=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],OO=L(td,FO,r=>{var{typed:e,matrix:t,divide:n,sum:a,multiply:i,map:o,dotDivide:l,log:u,isNumeric:s}=r;return e(td,{"Array, Array":function(m,v){return c(t(m),t(v))},"Matrix, Array":function(m,v){return c(m,t(v))},"Array, Matrix":function(m,v){return c(t(m),v)},"Matrix, Matrix":function(m,v){return c(m,v)}});function c(f,m){var v=m.size().length,p=f.size().length;if(v>1)throw new Error("first object must be one dimensional");if(p>1)throw new Error("second object must be one dimensional");if(v!==p)throw new Error("Length of two vectors must be equal");var d=a(f);if(d===0)throw new Error("Sum of elements in first object must be non zero");var y=a(m);if(y===0)throw new Error("Sum of elements in second object must be non zero");var x=n(f,a(f)),D=n(m,a(m)),h=a(i(x,o(l(x,D),w=>u(w))));return s(h)?h:Number.NaN}}),nd="multinomial",BO=["typed","add","divide","multiply","factorial","isInteger","isPositive"],RO=L(nd,BO,r=>{var{typed:e,add:t,divide:n,multiply:a,factorial:i,isInteger:o,isPositive:l}=r;return e(nd,{"Array | Matrix":function(s){var c=0,f=1;return Rn(s,function(m){if(!o(m)||!l(m))throw new TypeError("Positive integer value expected in function multinomial");c=t(c,m),f=a(f,i(m))}),n(i(c),f)}})}),ad="permutations",IO=["typed","factorial"],PO=L(ad,IO,r=>{var{typed:e,factorial:t}=r;return e(ad,{"number | BigNumber":t,"number, number":function(a,i){if(!Ue(a)||a<0)throw new TypeError("Positive integer value expected in function permutations");if(!Ue(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(i>a)throw new TypeError("second argument k must be less than or equal to first argument n");return dn(a-i+1,a)},"BigNumber, BigNumber":function(a,i){var o,l;if(!id(a)||!id(i))throw new TypeError("Positive integer value expected in function permutations");if(i.gt(a))throw new TypeError("second argument k must be less than or equal to first argument n");var u=a.mul(0).add(1);for(o=u,l=a.minus(i).plus(1);l.lte(a);l=l.plus(1))o=o.times(l);return o}})});function id(r){return r.isInteger()&&r.gte(0)}var Vs={exports:{}};Vs.exports,function(r){(function(e,t,n){function a(u){var s=this,c=l();s.next=function(){var f=2091639*s.s0+s.c*23283064365386963e-26;return s.s0=s.s1,s.s1=s.s2,s.s2=f-(s.c=f|0)},s.c=1,s.s0=c(" "),s.s1=c(" "),s.s2=c(" "),s.s0-=c(u),s.s0<0&&(s.s0+=1),s.s1-=c(u),s.s1<0&&(s.s1+=1),s.s2-=c(u),s.s2<0&&(s.s2+=1),c=null}function i(u,s){return s.c=u.c,s.s0=u.s0,s.s1=u.s1,s.s2=u.s2,s}function o(u,s){var c=new a(u),f=s&&s.state,m=c.next;return m.int32=function(){return c.next()*4294967296|0},m.double=function(){return m()+(m()*2097152|0)*11102230246251565e-32},m.quick=m,f&&(typeof f=="object"&&i(f,c),m.state=function(){return i(c,{})}),m}function l(){var u=4022871197,s=function(c){c=String(c);for(var f=0;f<c.length;f++){u+=c.charCodeAt(f);var m=.02519603282416938*u;u=m>>>0,m-=u,m*=u,u=m>>>0,m-=u,u+=m*4294967296}return(u>>>0)*23283064365386963e-26};return s}t&&t.exports?t.exports=o:this.alea=o})(ra,r)}(Vs);var $O=Vs.exports,Gs={exports:{}};Gs.exports,function(r){(function(e,t,n){function a(l){var u=this,s="";u.x=0,u.y=0,u.z=0,u.w=0,u.next=function(){var f=u.x^u.x<<11;return u.x=u.y,u.y=u.z,u.z=u.w,u.w^=u.w>>>19^f^f>>>8},l===(l|0)?u.x=l:s+=l;for(var c=0;c<s.length+64;c++)u.x^=s.charCodeAt(c)|0,u.next()}function i(l,u){return u.x=l.x,u.y=l.y,u.z=l.z,u.w=l.w,u}function o(l,u){var s=new a(l),c=u&&u.state,f=function(){return(s.next()>>>0)/4294967296};return f.double=function(){do var m=s.next()>>>11,v=(s.next()>>>0)/4294967296,p=(m+v)/(1<<21);while(p===0);return p},f.int32=s.next,f.quick=f,c&&(typeof c=="object"&&i(c,s),f.state=function(){return i(s,{})}),f}t&&t.exports?t.exports=o:this.xor128=o})(ra,r)}(Gs);var qO=Gs.exports,Hs={exports:{}};Hs.exports,function(r){(function(e,t,n){function a(l){var u=this,s="";u.next=function(){var f=u.x^u.x>>>2;return u.x=u.y,u.y=u.z,u.z=u.w,u.w=u.v,(u.d=u.d+362437|0)+(u.v=u.v^u.v<<4^(f^f<<1))|0},u.x=0,u.y=0,u.z=0,u.w=0,u.v=0,l===(l|0)?u.x=l:s+=l;for(var c=0;c<s.length+64;c++)u.x^=s.charCodeAt(c)|0,c==s.length&&(u.d=u.x<<10^u.x>>>4),u.next()}function i(l,u){return u.x=l.x,u.y=l.y,u.z=l.z,u.w=l.w,u.v=l.v,u.d=l.d,u}function o(l,u){var s=new a(l),c=u&&u.state,f=function(){return(s.next()>>>0)/4294967296};return f.double=function(){do var m=s.next()>>>11,v=(s.next()>>>0)/4294967296,p=(m+v)/(1<<21);while(p===0);return p},f.int32=s.next,f.quick=f,c&&(typeof c=="object"&&i(c,s),f.state=function(){return i(s,{})}),f}t&&t.exports?t.exports=o:this.xorwow=o})(ra,r)}(Hs);var zO=Hs.exports,Ws={exports:{}};Ws.exports,function(r){(function(e,t,n){function a(l){var u=this;u.next=function(){var c=u.x,f=u.i,m,v;return m=c[f],m^=m>>>7,v=m^m<<24,m=c[f+1&7],v^=m^m>>>10,m=c[f+3&7],v^=m^m>>>3,m=c[f+4&7],v^=m^m<<7,m=c[f+7&7],m=m^m<<13,v^=m^m<<9,c[f]=v,u.i=f+1&7,v};function s(c,f){var m,v=[];if(f===(f|0))v[0]=f;else for(f=""+f,m=0;m<f.length;++m)v[m&7]=v[m&7]<<15^f.charCodeAt(m)+v[m+1&7]<<13;for(;v.length<8;)v.push(0);for(m=0;m<8&&v[m]===0;++m);for(m==8?v[7]=-1:v[m],c.x=v,c.i=0,m=256;m>0;--m)c.next()}s(u,l)}function i(l,u){return u.x=l.x.slice(),u.i=l.i,u}function o(l,u){l==null&&(l=+new Date);var s=new a(l),c=u&&u.state,f=function(){return(s.next()>>>0)/4294967296};return f.double=function(){do var m=s.next()>>>11,v=(s.next()>>>0)/4294967296,p=(m+v)/(1<<21);while(p===0);return p},f.int32=s.next,f.quick=f,c&&(c.x&&i(c,s),f.state=function(){return i(s,{})}),f}t&&t.exports?t.exports=o:this.xorshift7=o})(ra,r)}(Ws);var UO=Ws.exports,Ys={exports:{}};Ys.exports,function(r){(function(e,t,n){function a(l){var u=this;u.next=function(){var c=u.w,f=u.X,m=u.i,v,p;return u.w=c=c+1640531527|0,p=f[m+34&127],v=f[m=m+1&127],p^=p<<13,v^=v<<17,p^=p>>>15,v^=v>>>12,p=f[m]=p^v,u.i=m,p+(c^c>>>16)|0};function s(c,f){var m,v,p,d,y,x=[],D=128;for(f===(f|0)?(v=f,f=null):(f=f+"\0",v=0,D=Math.max(D,f.length)),p=0,d=-32;d<D;++d)f&&(v^=f.charCodeAt((d+32)%f.length)),d===0&&(y=v),v^=v<<10,v^=v>>>15,v^=v<<4,v^=v>>>13,d>=0&&(y=y+1640531527|0,m=x[d&127]^=v+y,p=m==0?p+1:0);for(p>=128&&(x[(f&&f.length||0)&127]=-1),p=127,d=4*128;d>0;--d)v=x[p+34&127],m=x[p=p+1&127],v^=v<<13,m^=m<<17,v^=v>>>15,m^=m>>>12,x[p]=v^m;c.w=y,c.X=x,c.i=p}s(u,l)}function i(l,u){return u.i=l.i,u.w=l.w,u.X=l.X.slice(),u}function o(l,u){l==null&&(l=+new Date);var s=new a(l),c=u&&u.state,f=function(){return(s.next()>>>0)/4294967296};return f.double=function(){do var m=s.next()>>>11,v=(s.next()>>>0)/4294967296,p=(m+v)/(1<<21);while(p===0);return p},f.int32=s.next,f.quick=f,c&&(c.X&&i(c,s),f.state=function(){return i(s,{})}),f}t&&t.exports?t.exports=o:this.xor4096=o})(ra,r)}(Ys);var LO=Ys.exports,Zs={exports:{}};Zs.exports,function(r){(function(e,t,n){function a(l){var u=this,s="";u.next=function(){var f=u.b,m=u.c,v=u.d,p=u.a;return f=f<<25^f>>>7^m,m=m-v|0,v=v<<24^v>>>8^p,p=p-f|0,u.b=f=f<<20^f>>>12^m,u.c=m=m-v|0,u.d=v<<16^m>>>16^p,u.a=p-f|0},u.a=0,u.b=0,u.c=-1640531527,u.d=1367130551,l===Math.floor(l)?(u.a=l/4294967296|0,u.b=l|0):s+=l;for(var c=0;c<s.length+20;c++)u.b^=s.charCodeAt(c)|0,u.next()}function i(l,u){return u.a=l.a,u.b=l.b,u.c=l.c,u.d=l.d,u}function o(l,u){var s=new a(l),c=u&&u.state,f=function(){return(s.next()>>>0)/4294967296};return f.double=function(){do var m=s.next()>>>11,v=(s.next()>>>0)/4294967296,p=(m+v)/(1<<21);while(p===0);return p},f.int32=s.next,f.quick=f,c&&(typeof c=="object"&&i(c,s),f.state=function(){return i(s,{})}),f}t&&t.exports?t.exports=o:this.tychei=o})(ra,r)}(Zs);var kO=Zs.exports,od={exports:{}};const VO=D2(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));(function(r){(function(e,t,n){var a=256,i=6,o=52,l="random",u=n.pow(a,i),s=n.pow(2,o),c=s*2,f=a-1,m;function v(w,g,b){var A=[];g=g==!0?{entropy:!0}:g||{};var N=x(y(g.entropy?[w,h(t)]:w??D(),3),A),E=new p(A),S=function(){for(var C=E.g(i),M=u,O=0;C<s;)C=(C+O)*a,M*=a,O=E.g(1);for(;C>=c;)C/=2,M/=2,O>>>=1;return(C+O)/M};return S.int32=function(){return E.g(4)|0},S.quick=function(){return E.g(4)/4294967296},S.double=S,x(h(E.S),t),(g.pass||b||function(C,M,O,I){return I&&(I.S&&d(I,E),C.state=function(){return d(E,{})}),O?(n[l]=C,M):C})(S,N,"global"in g?g.global:this==n,g.state)}function p(w){var g,b=w.length,A=this,N=0,E=A.i=A.j=0,S=A.S=[];for(b||(w=[b++]);N<a;)S[N]=N++;for(N=0;N<a;N++)S[N]=S[E=f&E+w[N%b]+(g=S[N])],S[E]=g;(A.g=function(C){for(var M,O=0,I=A.i,k=A.j,_=A.S;C--;)M=_[I=f&I+1],O=O*a+_[f&(_[I]=_[k=f&k+M])+(_[k]=M)];return A.i=I,A.j=k,O})(a)}function d(w,g){return g.i=w.i,g.j=w.j,g.S=w.S.slice(),g}function y(w,g){var b=[],A=typeof w,N;if(g&&A=="object")for(N in w)try{b.push(y(w[N],g-1))}catch{}return b.length?b:A=="string"?w:w+"\0"}function x(w,g){for(var b=w+"",A,N=0;N<b.length;)g[f&N]=f&(A^=g[f&N]*19)+b.charCodeAt(N++);return h(g)}function D(){try{var w;return m&&(w=m.randomBytes)?w=w(a):(w=new Uint8Array(a),(e.crypto||e.msCrypto).getRandomValues(w)),h(w)}catch{var g=e.navigator,b=g&&g.plugins;return[+new Date,e,b,e.screen,h(t)]}}function h(w){return String.fromCharCode.apply(0,w)}if(x(n.random(),t),r.exports){r.exports=v;try{m=VO}catch{}}else n["seed"+l]=v})(typeof self<"u"?self:ra,[],Math)})(od);var GO=od.exports,HO=$O,WO=qO,YO=zO,ZO=UO,JO=LO,jO=kO,ta=GO;ta.alea=HO,ta.xor128=WO,ta.xorwow=YO,ta.xorshift7=ZO,ta.xor4096=JO,ta.tychei=jO;var XO=ta;const sd=Bs(XO);var QO=sd(Date.now());function Ia(r){var e;function t(a){e=a===null?QO:sd(String(a))}t(r);function n(){return e()}return n}var ud="pickRandom",KO=["typed","config","?on"],eB=L(ud,KO,r=>{var{typed:e,config:t,on:n}=r,a=Ia(t.randomSeed);return n&&n("config",function(o,l){o.randomSeed!==l.randomSeed&&(a=Ia(o.randomSeed))}),e(ud,{"Array | Matrix":function(l){return i(l,{})},"Array | Matrix, Object":function(l,u){return i(l,u)},"Array | Matrix, number":function(l,u){return i(l,{number:u})},"Array | Matrix, Array | Matrix":function(l,u){return i(l,{weights:u})},"Array | Matrix, Array | Matrix, number":function(l,u,s){return i(l,{number:s,weights:u})},"Array | Matrix, number, Array | Matrix":function(l,u,s){return i(l,{number:u,weights:s})}});function i(o,l){var{number:u,weights:s,elementWise:c=!0}=l,f=typeof u>"u";f&&(u=1);var m=Je(o)?o.create:Je(s)?s.create:null;o=o.valueOf(),s&&(s=s.valueOf()),c===!0&&(o=yr(o),s=yr(s));var v=0;if(typeof s<"u"){if(s.length!==o.length)throw new Error("Weights must have the same length as possibles");for(var p=0,d=s.length;p<d;p++){if(!Ye(s[p])||s[p]<0)throw new Error("Weights must be an array of positive numbers");v+=s[p]}}for(var y=o.length,x=[],D;x.length<u;){if(typeof s>"u")D=o[Math.floor(a()*y)];else for(var h=a()*v,w=0,g=o.length;w<g;w++)if(h-=s[w],h<0){D=o[w];break}x.push(D)}return f?x[0]:m?m(x):x}});function Js(r,e){var t=[];if(r=r.slice(0),r.length>1)for(var n=0,a=r.shift();n<a;n++)t.push(Js(r,e));else for(var i=0,o=r.shift();i<o;i++)t.push(e());return t}var ld="random",rB=["typed","config","?on"],tB=L(ld,rB,r=>{var{typed:e,config:t,on:n}=r,a=Ia(t.randomSeed);return n&&n("config",function(l,u){l.randomSeed!==u.randomSeed&&(a=Ia(l.randomSeed))}),e(ld,{"":()=>o(0,1),number:l=>o(0,l),"number, number":(l,u)=>o(l,u),"Array | Matrix":l=>i(l,0,1),"Array | Matrix, number":(l,u)=>i(l,0,u),"Array | Matrix, number, number":(l,u,s)=>i(l,u,s)});function i(l,u,s){var c=Js(l.valueOf(),()=>o(u,s));return Je(l)?l.create(c,"number"):c}function o(l,u){return l+a()*(u-l)}}),cd="randomInt",nB=["typed","config","log2","?on"],aB=L(cd,nB,r=>{var{typed:e,config:t,log2:n,on:a}=r,i=Ia(t.randomSeed);return a&&a("config",function(s,c){s.randomSeed!==c.randomSeed&&(i=Ia(s.randomSeed))}),e(cd,{"":()=>l(0,2),number:s=>l(0,s),"number, number":(s,c)=>l(s,c),bigint:s=>u(0n,s),"bigint, bigint":u,"Array | Matrix":s=>o(s,0,1),"Array | Matrix, number":(s,c)=>o(s,0,c),"Array | Matrix, number, number":(s,c,f)=>o(s,c,f)});function o(s,c,f){var m=Js(s.valueOf(),()=>l(c,f));return Je(s)?s.create(m,"number"):m}function l(s,c){return Math.floor(s+i()*(c-s))}function u(s,c){var f=2n**30n,m=c-s;if(m<=f)return s+BigInt(l(0,Number(m)));for(var v=n(m),p=m;p>=m;){p=0n;for(var d=0;d<v;++d)p=2n*p+(i()<.5?0n:1n)}return s+p}}),fd="stirlingS2",iB=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],oB=L(fd,iB,r=>{var{typed:e,addScalar:t,subtractScalar:n,multiplyScalar:a,divideScalar:i,pow:o,factorial:l,combinations:u,isNegative:s,isInteger:c,number:f,bignumber:m,larger:v}=r,p=[],d=[];return e(fd,{"number | BigNumber, number | BigNumber":function(x,D){if(!c(x)||s(x)||!c(D)||s(D))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(v(D,x))throw new TypeError("k must be less than or equal to n in function stirlingS2");var h=!(Ye(x)&&Ye(D)),w=h?d:p,g=h?m:f,b=f(x),A=f(D);if(w[b]&&w[b].length>A)return w[b][A];for(var N=0;N<=b;++N)if(w[N]||(w[N]=[g(N===0?1:0)]),N!==0)for(var E=w[N],S=w[N-1],C=E.length;C<=N&&C<=A;++C)C===N?E[C]=1:E[C]=t(a(g(C),S[C]),S[C-1]);return w[b][A]}})}),md="bellNumbers",sB=["typed","addScalar","isNegative","isInteger","stirlingS2"],uB=L(md,sB,r=>{var{typed:e,addScalar:t,isNegative:n,isInteger:a,stirlingS2:i}=r;return e(md,{"number | BigNumber":function(l){if(!a(l)||n(l))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var u=0,s=0;s<=l;s++)u=t(u,i(l,s));return u}})}),vd="catalan",lB=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],cB=L(vd,lB,r=>{var{typed:e,addScalar:t,divideScalar:n,multiplyScalar:a,combinations:i,isNegative:o,isInteger:l}=r;return e(vd,{"number | BigNumber":function(s){if(!l(s)||o(s))throw new TypeError("Non-negative integer value expected in function catalan");return n(i(a(s,2),s),t(s,1))}})}),pd="composition",fB=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],mB=L(pd,fB,r=>{var{typed:e,addScalar:t,combinations:n,isPositive:a,isNegative:i,isInteger:o,larger:l}=r;return e(pd,{"number | BigNumber, number | BigNumber":function(s,c){if(!o(s)||!a(s)||!o(c)||!a(c))throw new TypeError("Positive integer value expected in function composition");if(l(c,s))throw new TypeError("k must be less than or equal to n in function composition");return n(t(s,-1),t(c,-1))}})}),dd="leafCount",vB=["parse","typed"],pB=L(dd,vB,r=>{var{parse:e,typed:t}=r;function n(a){var i=0;return a.forEach(o=>{i+=n(o)}),i||1}return t(dd,{Node:function(i){return n(i)}})});function hd(r){return gr(r)||Ur(r)&&r.isUnary()&&gr(r.args[0])}function Bo(r){return!!(gr(r)||(En(r)||Ur(r))&&r.args.every(Bo)||fn(r)&&Bo(r.content))}function gd(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function js(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?gd(Object(t),!0).forEach(function(n){Vr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):gd(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var dB="simplifyUtil",hB=["FunctionNode","OperatorNode","SymbolNode"],Xs=L(dB,hB,r=>{var{FunctionNode:e,OperatorNode:t,SymbolNode:n}=r,a=!0,i=!1,o="defaultF",l={add:{trivial:a,total:a,commutative:a,associative:a},unaryPlus:{trivial:a,total:a,commutative:a,associative:a},subtract:{trivial:i,total:a,commutative:i,associative:i},multiply:{trivial:a,total:a,commutative:a,associative:a},divide:{trivial:i,total:a,commutative:i,associative:i},paren:{trivial:a,total:a,commutative:a,associative:i},defaultF:{trivial:i,total:a,commutative:i,associative:i}},u={divide:{total:i},log:{total:i}},s={subtract:{total:i},abs:{trivial:a},log:{total:a}};function c(h,w){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l,b=o;if(typeof h=="string"?b=h:Ur(h)?b=h.fn.toString():En(h)?b=h.name:fn(h)&&(b="paren"),$e(g,b)){var A=g[b];if($e(A,w))return A[w];if($e(l,b))return l[b][w]}if($e(g,o)){var N=g[o];return $e(N,w)?N[w]:l[o][w]}if($e(l,b)){var E=l[b];if($e(E,w))return E[w]}return l[o][w]}function f(h){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return c(h,"commutative",w)}function m(h){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return c(h,"associative",w)}function v(h,w){var g=js({},h);for(var b in w)$e(h,b)?g[b]=js(js({},w[b]),h[b]):g[b]=w[b];return g}function p(h,w){if(!h.args||h.args.length===0)return h;h.args=d(h,w);for(var g=0;g<h.args.length;g++)p(h.args[g],w)}function d(h,w){var g,b=[],A=function(E){for(var S=0;S<E.args.length;S++){var C=E.args[S];Ur(C)&&g===C.op?A(C):b.push(C)}};return m(h,w)?(g=h.op,A(h),b):h.args}function y(h,w){if(!(!h.args||h.args.length===0)){for(var g=D(h),b=h.args.length,A=0;A<b;A++)y(h.args[A],w);if(b>2&&m(h,w)){for(var N=h.args.pop();h.args.length>0;)N=g([h.args.pop(),N]);h.args=N.args}}}function x(h,w){if(!(!h.args||h.args.length===0)){for(var g=D(h),b=h.args.length,A=0;A<b;A++)x(h.args[A],w);if(b>2&&m(h,w)){for(var N=h.args.shift();h.args.length>0;)N=g([N,h.args.shift()]);h.args=N.args}}}function D(h){return Ur(h)?function(w){try{return new t(h.op,h.fn,w,h.implicit)}catch(g){return console.error(g),[]}}:function(w){return new e(new n(h.name),w)}}return{createMakeNodeFunction:D,hasProperty:c,isCommutative:f,isAssociative:m,mergeContext:v,flatten:p,allChildren:d,unflattenr:y,unflattenl:x,defaultContext:l,realContext:u,positiveContext:s}}),gB="simplify",yB=["typed","parse","equal","resolve","simplifyConstant","simplifyCore","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode","replacer"],bB=L(gB,yB,r=>{var{typed:e,parse:t,equal:n,resolve:a,simplifyConstant:i,simplifyCore:o,AccessorNode:l,ArrayNode:u,ConstantNode:s,FunctionNode:c,IndexNode:f,ObjectNode:m,OperatorNode:v,ParenthesisNode:p,SymbolNode:d,replacer:y}=r,{hasProperty:x,isCommutative:D,isAssociative:h,mergeContext:w,flatten:g,unflattenr:b,unflattenl:A,createMakeNodeFunction:N,defaultContext:E,realContext:S,positiveContext:C}=Xs({FunctionNode:c,OperatorNode:v,SymbolNode:d});e.addConversion({from:"Object",to:"Map",convert:va});var M=e("simplify",{Node:q,"Node, Map":(Y,z)=>q(Y,!1,z),"Node, Map, Object":(Y,z,X)=>q(Y,!1,z,X),"Node, Array":q,"Node, Array, Map":q,"Node, Array, Map, Object":q});e.removeConversion({from:"Object",to:"Map",convert:va}),M.defaultContext=E,M.realContext=S,M.positiveContext=C;function O(Y){return Y.transform(function(z){return fn(z)?O(z.content):z})}var I={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};M.rules=[o,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},i,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},i,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function k(Y,z){var X={};if(Y.s){var se=Y.s.split("->");if(se.length===2)X.l=se[0],X.r=se[1];else throw SyntaxError("Could not parse rule: "+Y.s)}else X.l=Y.l,X.r=Y.r;X.l=O(t(X.l)),X.r=O(t(X.r));for(var re of["imposeContext","repeat","assuming"])re in Y&&(X[re]=Y[re]);if(Y.evaluate&&(X.evaluate=t(Y.evaluate)),h(X.l,z)){var pe=!D(X.l,z),ve;pe&&(ve=V());var De=N(X.l),Oe=V();X.expanded={},X.expanded.l=De([X.l,Oe]),g(X.expanded.l,z),b(X.expanded.l,z),X.expanded.r=De([X.r,Oe]),pe&&(X.expandedNC1={},X.expandedNC1.l=De([ve,X.l]),X.expandedNC1.r=De([ve,X.r]),X.expandedNC2={},X.expandedNC2.l=De([ve,X.expanded.l]),X.expandedNC2.r=De([ve,X.expanded.r]))}return X}function _(Y,z){for(var X=[],se=0;se<Y.length;se++){var re=Y[se],pe=void 0,ve=typeof re;switch(ve){case"string":re={s:re};case"object":pe=k(re,z);break;case"function":pe=re;break;default:throw TypeError("Unsupported type of rule: "+ve)}X.push(pe)}return X}var P=0;function V(){return new d("_p"+P++)}function q(Y,z){var X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Xa(),se=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},re=se.consoleDebug;z=_(z||M.rules,se.context);var pe=a(Y,X);pe=O(pe);for(var ve={},De=pe.toString({parenthesis:"all"});!ve[De];){ve[De]=!0,P=0;var Oe=De;re&&console.log("Working on: ",De);for(var Ie=0;Ie<z.length;Ie++){var _e="";if(typeof z[Ie]=="function"?(pe=z[Ie](pe,se),re&&(_e=z[Ie].name)):(g(pe,se.context),pe=ne(pe,z[Ie],se.context),re&&(_e="".concat(z[Ie].l.toString()," -> ").concat(z[Ie].r.toString()))),re){var Le=pe.toString({parenthesis:"all"});Le!==Oe&&(console.log("Applying",_e,"produced",Le),Oe=Le)}A(pe,se.context)}De=pe.toString({parenthesis:"all"})}return pe}function J(Y,z,X){var se=Y;if(Y)for(var re=0;re<Y.length;++re){var pe=ne(Y[re],z,X);pe!==Y[re]&&(se===Y&&(se=Y.slice()),se[re]=pe)}return se}function ne(Y,z,X){if(z.assuming){for(var se in z.assuming)for(var re in z.assuming[se])if(x(se,re,X)!==z.assuming[se][re])return Y}var pe=w(z.imposeContext,X),ve=Y;if(ve instanceof v||ve instanceof c){var De=J(ve.args,z,X);De!==ve.args&&(ve=ve.clone(),ve.args=De)}else if(ve instanceof p){if(ve.content){var Oe=ne(ve.content,z,X);Oe!==ve.content&&(ve=new p(Oe))}}else if(ve instanceof u){var Ie=J(ve.items,z,X);Ie!==ve.items&&(ve=new u(Ie))}else if(ve instanceof l){var _e=ve.object;ve.object&&(_e=ne(ve.object,z,X));var Le=ve.index;ve.index&&(Le=ne(ve.index,z,X)),(_e!==ve.object||Le!==ve.index)&&(ve=new l(_e,Le))}else if(ve instanceof f){var qe=J(ve.dimensions,z,X);qe!==ve.dimensions&&(ve=new f(qe))}else if(ve instanceof m){var G=!1,ee={};for(var R in ve.properties)ee[R]=ne(ve.properties[R],z,X),ee[R]!==ve.properties[R]&&(G=!0);G&&(ve=new m(ee))}var H=z.r,Q=le(z.l,ve,pe)[0];if(!Q&&z.expanded&&(H=z.expanded.r,Q=le(z.expanded.l,ve,pe)[0]),!Q&&z.expandedNC1&&(H=z.expandedNC1.r,Q=le(z.expandedNC1.l,ve,pe)[0],Q||(H=z.expandedNC2.r,Q=le(z.expandedNC2.l,ve,pe)[0])),Q){var ie=ve.implicit;ve=H.clone(),ie&&"implicit"in H&&(ve.implicit=!0),ve=ve.transform(function(ue){return ue.isSymbolNode&&$e(Q.placeholders,ue.name)?Q.placeholders[ue.name].clone():ue})}return z.repeat&&ve!==Y&&(ve=ne(ve,z,X)),ve}function j(Y,z){var X=[],se,re,pe=N(Y);if(D(Y,z))for(var ve=0;ve<Y.args.length;ve++)re=Y.args.slice(0),re.splice(ve,1),se=re.length===1?re[0]:pe(re),X.push(pe([Y.args[ve],se]));else for(var De=1;De<Y.args.length;De++){var Oe=Y.args[0];De>1&&(Oe=pe(Y.args.slice(0,De))),re=Y.args.slice(De),se=re.length===1?re[0]:pe(re),X.push(pe([Oe,se]))}return X}function F(Y,z){var X={placeholders:{}};if(!Y.placeholders&&!z.placeholders)return X;if(Y.placeholders){if(!z.placeholders)return Y}else return z;for(var se in Y.placeholders)if($e(Y.placeholders,se)&&(X.placeholders[se]=Y.placeholders[se],$e(z.placeholders,se)&&!me(Y.placeholders[se],z.placeholders[se])))return null;for(var re in z.placeholders)$e(z.placeholders,re)&&(X.placeholders[re]=z.placeholders[re]);return X}function U(Y,z){var X=[];if(Y.length===0||z.length===0)return X;for(var se,re=0;re<Y.length;re++)for(var pe=0;pe<z.length;pe++)se=F(Y[re],z[pe]),se&&X.push(se);return X}function $(Y){if(Y.length===0)return Y;for(var z=Y.reduce(U),X=[],se={},re=0;re<z.length;re++){var pe=JSON.stringify(z[re],y);se[pe]||(se[pe]=!0,X.push(z[re]))}return X}function le(Y,z,X,se){var re=[{placeholders:{}}];if(Y instanceof v&&z instanceof v||Y instanceof c&&z instanceof c){if(Y instanceof v){if(Y.op!==z.op||Y.fn!==z.fn)return[]}else if(Y instanceof c&&Y.name!==z.name)return[];if(z.args.length===1&&Y.args.length===1||!h(z,X)&&z.args.length===Y.args.length||se){for(var pe=[],ve=0;ve<Y.args.length;ve++){var De=le(Y.args[ve],z.args[ve],X);if(De.length===0)break;pe.push(De)}if(pe.length!==Y.args.length){if(!D(z,X)||Y.args.length===1)return[];if(Y.args.length>2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var Oe=le(Y.args[0],z.args[1],X);if(Oe.length===0)return[];var Ie=le(Y.args[1],z.args[0],X);if(Ie.length===0)return[];pe=[Oe,Ie]}re=$(pe)}else if(z.args.length>=2&&Y.args.length===2){for(var _e=j(z,X),Le=[],qe=0;qe<_e.length;qe++){var G=le(Y,_e[qe],X,!0);Le=Le.concat(G)}return Le}else{if(Y.args.length>2)throw Error("Unexpected non-binary associative function: "+Y.toString());return[]}}else if(Y instanceof d){if(Y.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(I[Y.name]){if(Y.name!==z.name)return[]}else switch(Y.name[1]>="a"&&Y.name[1]<="z"?Y.name.substring(0,2):Y.name[0]){case"n":case"_p":re[0].placeholders[Y.name]=z;break;case"c":case"cl":if(gr(z))re[0].placeholders[Y.name]=z;else return[];break;case"v":if(!gr(z))re[0].placeholders[Y.name]=z;else return[];break;case"vl":if(jr(z))re[0].placeholders[Y.name]=z;else return[];break;case"cd":if(hd(z))re[0].placeholders[Y.name]=z;else return[];break;case"vd":if(!hd(z))re[0].placeholders[Y.name]=z;else return[];break;case"ce":if(Bo(z))re[0].placeholders[Y.name]=z;else return[];break;case"ve":if(!Bo(z))re[0].placeholders[Y.name]=z;else return[];break;default:throw new Error("Invalid symbol in rule: "+Y.name)}}else if(Y instanceof s){if(!n(Y.value,z.value))return[]}else return[];return re}function me(Y,z){if(Y instanceof s&&z instanceof s){if(!n(Y.value,z.value))return!1}else if(Y instanceof d&&z instanceof d){if(Y.name!==z.name)return!1}else if(Y instanceof v&&z instanceof v||Y instanceof c&&z instanceof c){if(Y instanceof v){if(Y.op!==z.op||Y.fn!==z.fn)return!1}else if(Y instanceof c&&Y.name!==z.name)return!1;if(Y.args.length!==z.args.length)return!1;for(var X=0;X<Y.args.length;X++)if(!me(Y.args[X],z.args[X]))return!1}else return!1;return!0}return M}),xB="simplifyConstant",wB=["typed","config","mathWithTransform","matrix","isBounded","?fraction","?bignumber","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode"],DB=L(xB,wB,r=>{var{typed:e,config:t,mathWithTransform:n,matrix:a,isBounded:i,fraction:o,bignumber:l,AccessorNode:u,ArrayNode:s,ConstantNode:c,FunctionNode:f,IndexNode:m,ObjectNode:v,OperatorNode:p,SymbolNode:d}=r,{isCommutative:y,isAssociative:x,allChildren:D,createMakeNodeFunction:h}=Xs({FunctionNode:f,OperatorNode:p,SymbolNode:d}),w=e("simplifyConstant",{Node:_=>N(k(_,{})),"Node, Object":function(P,V){return N(k(P,V))}});function g(_){return Ka(_)?_.valueOf():_ instanceof Array?_.map(g):Je(_)?a(g(_.valueOf())):_}function b(_,P,V){try{return n[_].apply(null,P)}catch{return P=P.map(g),S(n[_].apply(null,P),V)}}var A=e({Fraction:M,number:function(P){return P<0?C(new c(-P)):new c(P)},BigNumber:function(P){return P<0?C(new c(-P)):new c(P)},bigint:function(P){return P<0n?C(new c(-P)):new c(P)},Complex:function(P){throw new Error("Cannot convert Complex number to Node")},string:function(P){return new c(P)},Matrix:function(P){return new s(P.valueOf().map(V=>A(V)))}});function N(_){return Nr(_)?_:A(_)}function E(_,P){var V=P&&P.exactFractions!==!1;if(V&&i(_)&&o){var q=o(_),J=P&&typeof P.fractionsLimit=="number"?P.fractionsLimit:1/0;if(q.valueOf()===_&&q.n<J&&q.d<J)return q}return _}var S=e({"string, Object":function(P,V){var q=An(P,t);if(q==="BigNumber")return l===void 0&&Ts(),l(P);if(q==="bigint")return BigInt(P);if(q==="Fraction")return o===void 0&&lm(),o(P);var J=parseFloat(P);return E(J,V)},"Fraction, Object":function(P,V){return P},"BigNumber, Object":function(P,V){return P},"number, Object":function(P,V){return E(P,V)},"bigint, Object":function(P,V){return P},"Complex, Object":function(P,V){return P.im!==0?P:E(P.re,V)},"Matrix, Object":function(P,V){return a(E(P.valueOf()))},"Array, Object":function(P,V){return P.map(E)}});function C(_){return new p("-","unaryMinus",[_])}function M(_){var P=J=>t.number==="BigNumber"&&l?l(J):Number(J),V=_.s*_.n,q=V<0n?new p("-","unaryMinus",[new c(-P(V))]):new c(P(V));return _.d===1n?q:new p("/","divide",[q,new c(P(_.d))])}function O(_,P,V){if(!pa(P))return new u(N(_),N(P));if(Rt(_)||Je(_)){for(var q=Array.from(P.dimensions);q.length>0;)if(gr(q[0])&&typeof q[0].value!="string"){var J=S(q.shift().value,V);Rt(_)?_=_.items[J-1]:(_=_.valueOf()[J-1],_ instanceof Array&&(_=a(_)))}else if(q.length>1&&gr(q[1])&&typeof q[1].value!="string"){var ne=S(q[1].value,V),j=[],F=Rt(_)?_.items:_.valueOf();for(var U of F)if(Rt(U))j.push(U.items[ne-1]);else if(Je(_))j.push(U[ne-1]);else break;if(j.length===F.length)Rt(_)?_=new s(j):_=a(j),q.splice(1,1);else break}else break;return q.length===P.dimensions.length?new u(N(_),P):q.length>0?(P=new m(q),new u(N(_),P)):_}if(Oi(_)&&P.dimensions.length===1&&gr(P.dimensions[0])){var $=P.dimensions[0].value;return $ in _.properties?_.properties[$]:new c}return new u(N(_),P)}function I(_,P,V,q){var J=P.shift(),ne=P.reduce((j,F)=>{if(!Nr(F)){var U=j.pop();if(Nr(U))return[U,F];try{return j.push(b(_,[U,F],q)),j}catch{j.push(U)}}j.push(N(j.pop()));var $=j.length===1?j[0]:V(j);return[V([$,N(F)])]},[J]);return ne.length===1?ne[0]:V([ne[0],A(ne[1])])}function k(_,P){switch(_.type){case"SymbolNode":return _;case"ConstantNode":switch(typeof _.value){case"number":return S(_.value,P);case"bigint":return S(_.value,P);case"string":return _.value;default:if(!isNaN(_.value))return S(_.value,P)}return _;case"FunctionNode":if(n[_.name]&&n[_.name].rawArgs)return _;{var V=["add","multiply"];if(!V.includes(_.name)){var q=_.args.map(re=>k(re,P));if(!q.some(Nr))try{return b(_.name,q,P)}catch{}if(_.name==="size"&&q.length===1&&Rt(q[0])){for(var J=[],ne=q[0];Rt(ne);)J.push(ne.items.length),ne=ne.items[0];return a(J)}return new f(_.name,q.map(N))}}case"OperatorNode":{var j=_.fn.toString(),F,U,$=h(_);if(Ur(_)&&_.isUnary())F=[k(_.args[0],P)],Nr(F[0])?U=$(F):U=b(j,F,P);else if(x(_,P.context))if(F=D(_,P.context),F=F.map(re=>k(re,P)),y(j,P.context)){for(var le=[],me=[],Y=0;Y<F.length;Y++)Nr(F[Y])?me.push(F[Y]):le.push(F[Y]);le.length>1?(U=I(j,le,$,P),me.unshift(U),U=I(j,me,$,P)):U=I(j,F,$,P)}else U=I(j,F,$,P);else F=_.args.map(re=>k(re,P)),U=I(j,F,$,P);return U}case"ParenthesisNode":return k(_.content,P);case"AccessorNode":return O(k(_.object,P),k(_.index,P),P);case"ArrayNode":{var z=_.items.map(re=>k(re,P));return z.some(Nr)?new s(z.map(N)):a(z)}case"IndexNode":return new m(_.dimensions.map(re=>w(re,P)));case"ObjectNode":{var X={};for(var se in _.properties)X[se]=w(_.properties[se],P);return new v(X)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(_.type))}}return w}),yd="simplifyCore",NB=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],EB=L(yd,NB,r=>{var{typed:e,parse:t,equal:n,isZero:a,add:i,subtract:o,multiply:l,divide:u,pow:s,AccessorNode:c,ArrayNode:f,ConstantNode:m,FunctionNode:v,IndexNode:p,ObjectNode:d,OperatorNode:y,ParenthesisNode:x,SymbolNode:D}=r,h=new m(0),w=new m(1),g=new m(!0),b=new m(!1);function A(C){return Ur(C)&&["and","not","or"].includes(C.op)}var{hasProperty:N,isCommutative:E}=Xs({FunctionNode:v,OperatorNode:y,SymbolNode:D});function S(C){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=M?M.context:void 0;if(N(C,"trivial",O)){if(En(C)&&C.args.length===1)return S(C.args[0],M);var I=!1,k=0;if(C.forEach(le=>{++k,k===1&&(I=S(le,M))}),k===1)return I}var _=C;if(En(_)){var P=pS(_.name);if(P){if(_.args.length>2&&N(_,"associative",O))for(;_.args.length>2;){var V=_.args.pop(),q=_.args.pop();_.args.push(new y(P,_.name,[V,q]))}_=new y(P,_.name,_.args)}else return new v(S(_.fn),_.args.map(le=>S(le,M)))}if(Ur(_)&&_.isUnary()){var J=S(_.args[0],M);if(_.op==="~"&&Ur(J)&&J.isUnary()&&J.op==="~"||_.op==="not"&&Ur(J)&&J.isUnary()&&J.op==="not"&&A(J.args[0]))return J.args[0];var ne=!0;if(_.op==="-"&&Ur(J)&&(J.isBinary()&&J.fn==="subtract"&&(_=new y("-","subtract",[J.args[1],J.args[0]]),ne=!1),J.isUnary()&&J.op==="-"))return J.args[0];if(ne)return new y(_.op,_.fn,[J])}if(Ur(_)&&_.isBinary()){var j=S(_.args[0],M),F=S(_.args[1],M);if(_.op==="+"){if(gr(j)&&a(j.value))return F;if(gr(F)&&a(F.value))return j;Ur(F)&&F.isUnary()&&F.op==="-"&&(F=F.args[0],_=new y("-","subtract",[j,F]))}if(_.op==="-")return Ur(F)&&F.isUnary()&&F.op==="-"?S(new y("+","add",[j,F.args[0]]),M):gr(j)&&a(j.value)?S(new y("-","unaryMinus",[F])):gr(F)&&a(F.value)?j:new y(_.op,_.fn,[j,F]);if(_.op==="*"){if(gr(j)){if(a(j.value))return h;if(n(j.value,1))return F}if(gr(F)){if(a(F.value))return h;if(n(F.value,1))return j;if(E(_,O))return new y(_.op,_.fn,[F,j],_.implicit)}return new y(_.op,_.fn,[j,F],_.implicit)}if(_.op==="/")return gr(j)&&a(j.value)?h:gr(F)&&n(F.value,1)?j:new y(_.op,_.fn,[j,F]);if(_.op==="^"&&gr(F)){if(a(F.value))return w;if(n(F.value,1))return j}if(_.op==="and"){if(gr(j))if(j.value){if(A(F))return F;if(gr(F))return F.value?g:b}else return b;if(gr(F))if(F.value){if(A(j))return j}else return b}if(_.op==="or"){if(gr(j)){if(j.value)return g;if(A(F))return F}if(gr(F)){if(F.value)return g;if(A(j))return j}}return new y(_.op,_.fn,[j,F])}if(Ur(_))return new y(_.op,_.fn,_.args.map(le=>S(le,M)));if(Rt(_))return new f(_.items.map(le=>S(le,M)));if(cn(_))return new c(S(_.object,M),S(_.index,M));if(pa(_))return new p(_.dimensions.map(le=>S(le,M)));if(Oi(_)){var U={};for(var $ in _.properties)U[$]=S(_.properties[$],M);return new d(U)}return _}return e(yd,{Node:S,"Node,Object":S})}),AB="resolve",SB=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],CB=L(AB,SB,r=>{var{typed:e,parse:t,ConstantNode:n,FunctionNode:a,OperatorNode:i,ParenthesisNode:o}=r;function l(u,s){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!s)return u;if(jr(u)){if(c.has(u.name)){var f=Array.from(c).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(f,"}"))}var m=s.get(u.name);if(Nr(m)){var v=new Set(c);return v.add(u.name),l(m,s,v)}else return typeof m=="number"?t(String(m)):m!==void 0?new n(m):u}else if(Ur(u)){var p=u.args.map(function(y){return l(y,s,c)});return new i(u.op,u.fn,p,u.implicit)}else{if(fn(u))return new o(l(u.content,s,c));if(En(u)){var d=u.args.map(function(y){return l(y,s,c)});return new a(u.name,d)}}return u.map(y=>l(y,s,c))}return e("resolve",{Node:l,"Node, Map | null | undefined":l,"Node, Object":(u,s)=>l(u,va(s)),"Array | Matrix":e.referToSelf(u=>s=>s.map(c=>u(c))),"Array | Matrix, null | undefined":e.referToSelf(u=>s=>s.map(c=>u(c))),"Array, Object":e.referTo("Array,Map",u=>(s,c)=>u(s,va(c))),"Matrix, Object":e.referTo("Matrix,Map",u=>(s,c)=>u(s,va(c))),"Array | Matrix, Map":e.referToSelf(u=>(s,c)=>s.map(f=>u(f,c)))})}),bd="symbolicEqual",MB=["parse","simplify","typed","OperatorNode"],_B=L(bd,MB,r=>{var{parse:e,simplify:t,typed:n,OperatorNode:a}=r;function i(o,l){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=new a("-","subtract",[o,l]),c=t(s,{},u);return gr(c)&&!c.value}return n(bd,{"Node, Node":i,"Node, Node, Object":i})}),xd="derivative",TB=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],FB=L(xd,TB,r=>{var{typed:e,config:t,parse:n,simplify:a,equal:i,isZero:o,numeric:l,ConstantNode:u,FunctionNode:s,OperatorNode:c,ParenthesisNode:f,SymbolNode:m}=r;function v(w,g){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},A=new Map,N=g.name;function E(C){var M=A.get(C);if(M!==void 0)return M;var O=x(E,C,N);return A.set(C,O),O}var S=D(w,E);return b.simplify?a(S):S}function p(w){var g=n(w);if(!g.isSymbolNode)throw new TypeError("Invalid variable. "+"Cannot parse ".concat(JSON.stringify(w)," into a variable in function derivative"));return g}var d=e(xd,{"Node, SymbolNode":v,"Node, SymbolNode, Object":v,"Node, string":(w,g)=>v(w,p(g)),"Node, string, Object":(w,g,b)=>v(w,p(g),b)});d._simplify=!0,d.toTex=function(w){return y.apply(null,w.args)};var y=e("_derivTex",{"Node, SymbolNode":function(g,b){return gr(g)&&Sr(g.value)==="string"?y(n(g.value).toString(),b.toString(),1):y(g.toTex(),b.toString(),1)},"Node, ConstantNode":function(g,b){if(Sr(b.value)==="string")return y(g,n(b.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(g,b,A){return y(g.toString(),b.name,A.value)},"string, string, number":function(g,b,A){var N;return A===1?N="{d\\over d"+b+"}":N="{d^{"+A+"}\\over d"+b+"^{"+A+"}}",N+"\\left[".concat(g,"\\right]")}}),x=e("_isConst",{"function, ConstantNode, string":function(){return!0},"function, SymbolNode, string":function(g,b,A){return b.name!==A},"function, ParenthesisNode, string":function(g,b,A){return g(b.content,A)},"function, FunctionAssignmentNode, string":function(g,b,A){return b.params.includes(A)?g(b.expr,A):!0},"function, FunctionNode | OperatorNode, string":function(g,b,A){return b.args.every(N=>g(N,A))}}),D=e("_derivative",{"ConstantNode, function":function(){return h(0)},"SymbolNode, function":function(g,b){return b(g)?h(0):h(1)},"ParenthesisNode, function":function(g,b){return new f(D(g.content,b))},"FunctionAssignmentNode, function":function(g,b){return b(g)?h(0):D(g.expr,b)},"FunctionNode, function":function(g,b){if(b(g))return h(0);var A=g.args[0],N,E=!1,S=!1,C;switch(g.name){case"cbrt":E=!0,C=new c("*","multiply",[h(3),new c("^","pow",[A,new c("/","divide",[h(2),h(3)])])]);break;case"sqrt":case"nthRoot":if(g.args.length===1)E=!0,C=new c("*","multiply",[h(2),new s("sqrt",[A])]);else if(g.args.length===2)return N=new c("/","divide",[h(1),g.args[1]]),D(new c("^","pow",[A,N]),b);break;case"log10":N=h(10);case"log":if(!N&&g.args.length===1)C=A.clone(),E=!0;else if(g.args.length===1&&N||g.args.length===2&&b(g.args[1]))C=new c("*","multiply",[A.clone(),new s("log",[N||g.args[1]])]),E=!0;else if(g.args.length===2)return D(new c("/","divide",[new s("log",[A]),new s("log",[g.args[1]])]),b);break;case"pow":if(g.args.length===2)return D(new c("^","pow",[A,g.args[1]]),b);break;case"exp":C=new s("exp",[A.clone()]);break;case"sin":C=new s("cos",[A.clone()]);break;case"cos":C=new c("-","unaryMinus",[new s("sin",[A.clone()])]);break;case"tan":C=new c("^","pow",[new s("sec",[A.clone()]),h(2)]);break;case"sec":C=new c("*","multiply",[g,new s("tan",[A.clone()])]);break;case"csc":S=!0,C=new c("*","multiply",[g,new s("cot",[A.clone()])]);break;case"cot":S=!0,C=new c("^","pow",[new s("csc",[A.clone()]),h(2)]);break;case"asin":E=!0,C=new s("sqrt",[new c("-","subtract",[h(1),new c("^","pow",[A.clone(),h(2)])])]);break;case"acos":E=!0,S=!0,C=new s("sqrt",[new c("-","subtract",[h(1),new c("^","pow",[A.clone(),h(2)])])]);break;case"atan":E=!0,C=new c("+","add",[new c("^","pow",[A.clone(),h(2)]),h(1)]);break;case"asec":E=!0,C=new c("*","multiply",[new s("abs",[A.clone()]),new s("sqrt",[new c("-","subtract",[new c("^","pow",[A.clone(),h(2)]),h(1)])])]);break;case"acsc":E=!0,S=!0,C=new c("*","multiply",[new s("abs",[A.clone()]),new s("sqrt",[new c("-","subtract",[new c("^","pow",[A.clone(),h(2)]),h(1)])])]);break;case"acot":E=!0,S=!0,C=new c("+","add",[new c("^","pow",[A.clone(),h(2)]),h(1)]);break;case"sinh":C=new s("cosh",[A.clone()]);break;case"cosh":C=new s("sinh",[A.clone()]);break;case"tanh":C=new c("^","pow",[new s("sech",[A.clone()]),h(2)]);break;case"sech":S=!0,C=new c("*","multiply",[g,new s("tanh",[A.clone()])]);break;case"csch":S=!0,C=new c("*","multiply",[g,new s("coth",[A.clone()])]);break;case"coth":S=!0,C=new c("^","pow",[new s("csch",[A.clone()]),h(2)]);break;case"asinh":E=!0,C=new s("sqrt",[new c("+","add",[new c("^","pow",[A.clone(),h(2)]),h(1)])]);break;case"acosh":E=!0,C=new s("sqrt",[new c("-","subtract",[new c("^","pow",[A.clone(),h(2)]),h(1)])]);break;case"atanh":E=!0,C=new c("-","subtract",[h(1),new c("^","pow",[A.clone(),h(2)])]);break;case"asech":E=!0,S=!0,C=new c("*","multiply",[A.clone(),new s("sqrt",[new c("-","subtract",[h(1),new c("^","pow",[A.clone(),h(2)])])])]);break;case"acsch":E=!0,S=!0,C=new c("*","multiply",[new s("abs",[A.clone()]),new s("sqrt",[new c("+","add",[new c("^","pow",[A.clone(),h(2)]),h(1)])])]);break;case"acoth":E=!0,S=!0,C=new c("-","subtract",[h(1),new c("^","pow",[A.clone(),h(2)])]);break;case"abs":C=new c("/","divide",[new s(new m("abs"),[A.clone()]),A.clone()]);break;case"gamma":default:throw new Error('Cannot process function "'+g.name+'" in derivative: the function is not supported, undefined, or the number of arguments passed to it are not supported')}var M,O;E?(M="/",O="divide"):(M="*",O="multiply");var I=D(A,b);return S&&(I=new c("-","unaryMinus",[I])),new c(M,O,[I,C])},"OperatorNode, function":function(g,b){if(b(g))return h(0);if(g.op==="+")return new c(g.op,g.fn,g.args.map(function(_){return D(_,b)}));if(g.op==="-"){if(g.isUnary())return new c(g.op,g.fn,[D(g.args[0],b)]);if(g.isBinary())return new c(g.op,g.fn,[D(g.args[0],b),D(g.args[1],b)])}if(g.op==="*"){var A=g.args.filter(function(_){return b(_)});if(A.length>0){var N=g.args.filter(function(_){return!b(_)}),E=N.length===1?N[0]:new c("*","multiply",N),S=A.concat(D(E,b));return new c("*","multiply",S)}return new c("+","add",g.args.map(function(_){return new c("*","multiply",g.args.map(function(P){return P===_?D(P,b):P.clone()}))}))}if(g.op==="/"&&g.isBinary()){var C=g.args[0],M=g.args[1];return b(M)?new c("/","divide",[D(C,b),M]):b(C)?new c("*","multiply",[new c("-","unaryMinus",[C]),new c("/","divide",[D(M,b),new c("^","pow",[M.clone(),h(2)])])]):new c("/","divide",[new c("-","subtract",[new c("*","multiply",[D(C,b),M.clone()]),new c("*","multiply",[C.clone(),D(M,b)])]),new c("^","pow",[M.clone(),h(2)])])}if(g.op==="^"&&g.isBinary()){var O=g.args[0],I=g.args[1];if(b(O))return gr(O)&&(o(O.value)||i(O.value,1))?h(0):new c("*","multiply",[g,new c("*","multiply",[new s("log",[O.clone()]),D(I.clone(),b)])]);if(b(I)){if(gr(I)){if(o(I.value))return h(0);if(i(I.value,1))return D(O,b)}var k=new c("^","pow",[O.clone(),new c("-","subtract",[I,h(1)])]);return new c("*","multiply",[I.clone(),new c("*","multiply",[D(O,b),k])])}return new c("*","multiply",[new c("^","pow",[O.clone(),I.clone()]),new c("+","add",[new c("*","multiply",[D(O,b),new c("/","divide",[I.clone(),O.clone()])]),new c("*","multiply",[D(I,b),new s("log",[O.clone()])])])])}throw new Error('Cannot process operator "'+g.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function h(w,g){return new u(l(w,An(String(w),t)))}return d}),wd="rationalize",OB=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],BB=L(wd,OB,r=>{var{config:e,typed:t,equal:n,isZero:a,add:i,subtract:o,multiply:l,divide:u,pow:s,parse:c,simplifyConstant:f,simplifyCore:m,simplify:v,fraction:p,bignumber:d,mathWithTransform:y,matrix:x,AccessorNode:D,ArrayNode:h,ConstantNode:w,FunctionNode:g,IndexNode:b,ObjectNode:A,OperatorNode:N,SymbolNode:E,ParenthesisNode:S}=r;function C(_){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,q=O(),J=M(_,P,!0,q.firstRules),ne=J.variables.length,j={exactFractions:!1},F={exactFractions:!0};if(_=J.expression,ne>=1){_=I(_);var U,$,le=!0,me=!1;_=v(_,q.firstRules,{},j);for(var Y;$=le?q.distrDivRules:q.sucDivRules,_=v(_,$,{},F),le=!le,Y=_.toString(),Y!==U;)me=!0,U=Y;me&&(_=v(_,q.firstRulesAgain,{},j)),_=v(_,q.finalRules,{},j)}var z=[],X={};return _.type==="OperatorNode"&&_.isBinary()&&_.op==="/"?(ne===1&&(_.args[0]=k(_.args[0],z),_.args[1]=k(_.args[1])),V&&(X.numerator=_.args[0],X.denominator=_.args[1])):(ne===1&&(_=k(_,z)),V&&(X.numerator=_,X.denominator=null)),V?(X.coefficients=z,X.variables=J.variables,X.expression=_,X):_}return t(wd,{Node:C,"Node, boolean":(_,P)=>C(_,{},P),"Node, Object":C,"Node, Object, boolean":C});function M(_,P,V,q){var J=[],ne=v(_,q,P,{exactFractions:!1});V=!!V;var j="+-*"+(V?"/":"");U(ne);var F={};return F.expression=ne,F.variables=J,F;function U($){var le=$.type;if(le==="FunctionNode")throw new Error("There is an unsolved function call");if(le==="OperatorNode")if($.op==="^"){if($.args[1].type!=="ConstantNode"||!Ue(parseFloat($.args[1].value)))throw new Error("There is a non-integer exponent");U($.args[0])}else{if(!j.includes($.op))throw new Error("Operator "+$.op+" invalid in polynomial expression");for(var me=0;me<$.args.length;me++)U($.args[me])}else if(le==="SymbolNode"){var Y=$.name,z=J.indexOf(Y);z===-1&&J.push(Y)}else if(le==="ParenthesisNode")U($.content);else if(le!=="ConstantNode")throw new Error("type "+le+" is not allowed in polynomial expression")}}function O(){var _=[m,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},f,{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"1*n",r:"n"}],P=[{l:"(-n1)/(-n2)",r:"n1/n2"},{l:"(-n1)*(-n2)",r:"n1*n2"},{l:"n1--n2",r:"n1+n2"},{l:"n1-n2",r:"n1+(-n2)"},{l:"(n1+n2)*n3",r:"(n1*n3 + n2*n3)"},{l:"n1*(n2+n3)",r:"(n1*n2+n1*n3)"},{l:"c1*n + c2*n",r:"(c1+c2)*n"},{l:"c1*n + n",r:"(c1+1)*n"},{l:"c1*n - c2*n",r:"(c1-c2)*n"},{l:"c1*n - n",r:"(c1-1)*n"},{l:"v/c",r:"(1/c)*v"},{l:"v/-c",r:"-(1/c)*v"},{l:"-v*-c",r:"c*v"},{l:"-v*c",r:"-c*v"},{l:"v*-c",r:"-c*v"},{l:"v*c",r:"c*v"},{l:"-(-n1*n2)",r:"(n1*n2)"},{l:"-(n1*n2)",r:"(-n1*n2)"},{l:"-(-n1+n2)",r:"(n1-n2)"},{l:"-(n1+n2)",r:"(-n1-n2)"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"},{l:"-(-n1/n2)",r:"(n1/n2)"},{l:"-(n1/n2)",r:"(-n1/n2)"}],V=[{l:"(n1/n2 + n3/n4)",r:"((n1*n4 + n3*n2)/(n2*n4))"},{l:"(n1/n2 + n3)",r:"((n1 + n3*n2)/n2)"},{l:"(n1 + n2/n3)",r:"((n1*n3 + n2)/n3)"}],q=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],J={};return J.firstRules=_.concat(P,q),J.distrDivRules=V,J.sucDivRules=q,J.firstRulesAgain=_.concat(P),J.finalRules=[m,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},f,{l:"n*-n^n1",r:"-n^(n1+1)"},{l:"n*n^n1",r:"n^(n1+1)"},{l:"n^n1*-n^n2",r:"-n^(n1+n2)"},{l:"n^n1*n^n2",r:"n^(n1+n2)"},{l:"n^n1*-n",r:"-n^(n1+1)"},{l:"n^n1*n",r:"n^(n1+1)"},{l:"n^n1/-n",r:"-n^(n1-1)"},{l:"n^n1/n",r:"n^(n1-1)"},{l:"n/-n^n1",r:"-n^(1-n1)"},{l:"n/n^n1",r:"n^(1-n1)"},{l:"n^n1/-n^n2",r:"n^(n1-n2)"},{l:"n^n1/n^n2",r:"n^(n1-n2)"},{l:"n1+(-n2*n3)",r:"n1-n2*n3"},{l:"v*(-c)",r:"-c*v"},{l:"n1+-n2",r:"n1-n2"},{l:"v*c",r:"c*v"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"}],J}function I(_,P,V){var q=_.type,J=arguments.length>1;if(q==="OperatorNode"&&_.isBinary()){var ne=!1,j;if(_.op==="^"&&(_.args[0].type==="ParenthesisNode"||_.args[0].type==="OperatorNode")&&_.args[1].type==="ConstantNode"&&(j=parseFloat(_.args[1].value),ne=j>=2&&Ue(j)),ne){if(j>2){var F=_.args[0],U=new N("^","pow",[_.args[0].cloneDeep(),new w(j-1)]);_=new N("*","multiply",[F,U])}else _=new N("*","multiply",[_.args[0],_.args[0].cloneDeep()]);J&&(V==="content"?P.content=_:P.args[V]=_)}}if(q==="ParenthesisNode")I(_.content,_,"content");else if(q!=="ConstantNode"&&q!=="SymbolNode")for(var $=0;$<_.args.length;$++)I(_.args[$],_,$);if(!J)return _}function k(_,P){P===void 0&&(P=[]),P[0]=0;var V={};V.cte=1,V.oper="+",V.fire="";var q=0,J="";Y(_,null,V),q=P.length-1;for(var ne=!0,j,F=q;F>=0;F--)if(P[F]!==0){var U=new w(ne?P[F]:Math.abs(P[F])),$=P[F]<0?"-":"+";if(F>0){var le=new E(J);if(F>1){var me=new w(F);le=new N("^","pow",[le,me])}P[F]===-1&&ne?U=new N("-","unaryMinus",[le]):Math.abs(P[F])===1?U=le:U=new N("*","multiply",[U,le])}ne?j=U:$==="+"?j=new N("+","add",[j,U]):j=new N("-","subtract",[j,U]),ne=!1}if(ne)return new w(0);return j;function Y(z,X,se){var re=z.type;if(re==="FunctionNode")throw new Error("There is an unsolved function call");if(re==="OperatorNode"){if(!"+-*^".includes(z.op))throw new Error("Operator "+z.op+" invalid");if(X!==null){if((z.fn==="unaryMinus"||z.fn==="pow")&&X.fn!=="add"&&X.fn!=="subtract"&&X.fn!=="multiply")throw new Error("Invalid "+z.op+" placing");if((z.fn==="subtract"||z.fn==="add"||z.fn==="multiply")&&X.fn!=="add"&&X.fn!=="subtract")throw new Error("Invalid "+z.op+" placing");if((z.fn==="subtract"||z.fn==="add"||z.fn==="unaryMinus")&&se.noFil!==0)throw new Error("Invalid "+z.op+" placing")}(z.op==="^"||z.op==="*")&&(se.fire=z.op);for(var pe=0;pe<z.args.length;pe++)z.fn==="unaryMinus"&&(se.oper="-"),(z.op==="+"||z.fn==="subtract")&&(se.fire="",se.cte=1,se.oper=pe===0?"+":z.op),se.noFil=pe,Y(z.args[pe],z,se)}else if(re==="SymbolNode"){if(z.name!==J&&J!=="")throw new Error("There is more than one variable");if(J=z.name,X===null){P[1]=1;return}if(X.op==="^"&&se.noFil!==0)throw new Error("In power the variable should be the first parameter");if(X.op==="*"&&se.noFil!==1)throw new Error("In multiply the variable should be the second parameter");(se.fire===""||se.fire==="*")&&(q<1&&(P[1]=0),P[1]+=se.cte*(se.oper==="+"?1:-1),q=Math.max(1,q))}else if(re==="ConstantNode"){var ve=parseFloat(z.value);if(X===null){P[0]=ve;return}if(X.op==="^"){if(se.noFil!==1)throw new Error("Constant cannot be powered");if(!Ue(ve)||ve<=0)throw new Error("Non-integer exponent is not allowed");for(var De=q+1;De<ve;De++)P[De]=0;ve>q&&(P[ve]=0),P[ve]+=se.cte*(se.oper==="+"?1:-1),q=Math.max(ve,q);return}se.cte=ve,se.fire===""&&(P[0]+=se.cte*(se.oper==="+"?1:-1))}else throw new Error("Type "+re+" is not allowed")}}}),Dd="zpk2tf",RB=["typed","add","multiply","Complex","number"],IB=L(Dd,RB,r=>{var{typed:e,add:t,multiply:n,Complex:a,number:i}=r;return e(Dd,{"Array,Array,number":function(s,c,f){return o(s,c,f)},"Array,Array":function(s,c){return o(s,c,1)},"Matrix,Matrix,number":function(s,c,f){return o(s.valueOf(),c.valueOf(),f)},"Matrix,Matrix":function(s,c){return o(s.valueOf(),c.valueOf(),1)}});function o(u,s,c){u.some(D=>D.type==="BigNumber")&&(u=u.map(D=>i(D))),s.some(D=>D.type==="BigNumber")&&(s=s.map(D=>i(D)));for(var f=[a(1,0)],m=[a(1,0)],v=0;v<u.length;v++){var p=u[v];typeof p=="number"&&(p=a(p,0)),f=l(f,[a(1,0),a(-p.re,-p.im)])}for(var d=0;d<s.length;d++){var y=s[d];typeof y=="number"&&(y=a(y,0)),m=l(m,[a(1,0),a(-y.re,-y.im)])}for(var x=0;x<f.length;x++)f[x]=n(f[x],c);return[f,m]}function l(u,s){for(var c=[],f=0;f<u.length+s.length-1;f++){c[f]=a(0,0);for(var m=0;m<u.length;m++)f-m>=0&&f-m<s.length&&(c[f]=t(c[f],n(u[m],s[f-m])))}return c}}),Nd="freqz",PB=["typed","add","multiply","Complex","divide","matrix"],$B=L(Nd,PB,r=>{var{typed:e,add:t,multiply:n,Complex:a,divide:i,matrix:o}=r;return e(Nd,{"Array, Array":function(c,f){var m=u(512);return l(c,f,m)},"Array, Array, Array":function(c,f,m){return l(c,f,m)},"Array, Array, number":function(c,f,m){if(m<0)throw new Error("w must be a positive number");var v=u(m);return l(c,f,v)},"Matrix, Matrix":function(c,f){var m=u(512),{w:v,h:p}=l(c.valueOf(),f.valueOf(),m);return{w:o(v),h:o(p)}},"Matrix, Matrix, Matrix":function(c,f,m){var{h:v}=l(c.valueOf(),f.valueOf(),m.valueOf());return{h:o(v),w:o(m)}},"Matrix, Matrix, number":function(c,f,m){if(m<0)throw new Error("w must be a positive number");var v=u(m),{h:p}=l(c.valueOf(),f.valueOf(),v);return{h:o(p),w:o(v)}}});function l(s,c,f){for(var m=[],v=[],p=0;p<f.length;p++){for(var d=a(0,0),y=a(0,0),x=0;x<s.length;x++)d=t(d,n(s[x],a(Math.cos(-x*f[p]),Math.sin(-x*f[p]))));for(var D=0;D<c.length;D++)y=t(y,n(c[D],a(Math.cos(-D*f[p]),Math.sin(-D*f[p]))));m.push(d),v.push(y)}for(var h=[],w=0;w<m.length;w++)h.push(i(m[w],v[w]));return{h,w:f}}function u(s){for(var c=[],f=0;f<s;f++)c.push(f/s*Math.PI);return c}}),qB="reviver",zB=["classes"],UB=L(qB,zB,r=>{var{classes:e}=r;return function(n,a){var i=e[a&&a.mathjs];return i&&typeof i.fromJSON=="function"?i.fromJSON(a):a}}),LB="replacer",kB=[],VB=L(LB,kB,()=>function(e,t){return typeof t=="number"&&(!Number.isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:typeof t=="bigint"?{mathjs:"bigint",value:String(t)}:t}),GB="15.2.0",HB=L("true",[],()=>!0),WB=L("false",[],()=>!1),YB=L("null",[],()=>null),ZB=_t("Infinity",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?new t(1/0):1/0}),JB=_t("NaN",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?new t(NaN):NaN}),jB=_t("pi",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?Rs(t):z1}),XB=_t("tau",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?yE(t):U1}),QB=_t("e",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?hE(t):L1}),KB=_t("phi",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?gE(t):k1}),e4=_t("LN2",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?new t(2).ln():Math.LN2}),r4=_t("LN10",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?new t(10).ln():Math.LN10}),t4=_t("LOG2E",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?new t(1).div(new t(2).ln()):Math.LOG2E}),n4=_t("LOG10E",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?new t(1).div(new t(10).ln()):Math.LOG10E}),a4=_t("SQRT1_2",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?new t("0.5").sqrt():Math.SQRT1_2}),i4=_t("SQRT2",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?new t(2).sqrt():Math.SQRT2}),o4=_t("i",["Complex"],r=>{var{Complex:e}=r;return e.I}),s4=L("version",[],()=>GB);function _t(r,e,t){return L(r,e,t,{recreateOnConfigChange:!0})}var u4=nr("speedOfLight","299792458","m s^-1"),l4=nr("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),c4=nr("planckConstant","6.62607015e-34","J s"),f4=nr("reducedPlanckConstant","1.0545718176461565e-34","J s"),m4=nr("magneticConstant","1.25663706212e-6","N A^-2"),v4=nr("electricConstant","8.8541878128e-12","F m^-1"),p4=nr("vacuumImpedance","376.730313667","ohm"),d4=nr("coulomb","8.987551792261171e9","N m^2 C^-2"),h4=nr("coulombConstant","8.987551792261171e9","N m^2 C^-2"),g4=nr("elementaryCharge","1.602176634e-19","C"),y4=nr("bohrMagneton","9.2740100783e-24","J T^-1"),b4=nr("conductanceQuantum","7.748091729863649e-5","S"),x4=nr("inverseConductanceQuantum","12906.403729652257","ohm"),w4=nr("magneticFluxQuantum","2.0678338484619295e-15","Wb"),D4=nr("nuclearMagneton","5.0507837461e-27","J T^-1"),N4=nr("klitzing","25812.807459304513","ohm"),E4=nr("bohrRadius","5.29177210903e-11","m"),A4=nr("classicalElectronRadius","2.8179403262e-15","m"),S4=nr("electronMass","9.1093837015e-31","kg"),C4=nr("fermiCoupling","1.1663787e-5","GeV^-2"),M4=Ro("fineStructure",.0072973525693),_4=nr("hartreeEnergy","4.3597447222071e-18","J"),T4=nr("protonMass","1.67262192369e-27","kg"),F4=nr("deuteronMass","3.3435830926e-27","kg"),O4=nr("neutronMass","1.6749271613e-27","kg"),B4=nr("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),R4=nr("rydberg","10973731.568160","m^-1"),I4=nr("thomsonCrossSection","6.6524587321e-29","m^2"),P4=Ro("weakMixingAngle",.2229),$4=Ro("efimovFactor",22.7),q4=nr("atomicMass","1.66053906660e-27","kg"),z4=nr("avogadro","6.02214076e23","mol^-1"),U4=nr("boltzmann","1.380649e-23","J K^-1"),L4=nr("faraday","96485.33212331001","C mol^-1"),k4=nr("firstRadiation","3.7417718521927573e-16","W m^2"),V4=nr("loschmidt","2.686780111798444e25","m^-3"),G4=nr("gasConstant","8.31446261815324","J K^-1 mol^-1"),H4=nr("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),W4=nr("molarVolume","0.022413969545014137","m^3 mol^-1"),Y4=Ro("sackurTetrode",-1.16487052358),Z4=nr("secondRadiation","0.014387768775039337","m K"),J4=nr("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),j4=nr("wienDisplacement","2.897771955e-3","m K"),X4=nr("molarMass","0.99999999965e-3","kg mol^-1"),Q4=nr("molarMassC12","11.9999999958e-3","kg mol^-1"),K4=nr("gravity","9.80665","m s^-2"),eR=nr("planckLength","1.616255e-35","m"),rR=nr("planckMass","2.176435e-8","kg"),tR=nr("planckTime","5.391245e-44","s"),nR=nr("planckCharge","1.87554603778e-18","C"),aR=nr("planckTemperature","1.416785e+32","K");function nr(r,e,t){var n=["config","Unit","BigNumber"];return L(r,n,a=>{var{config:i,Unit:o,BigNumber:l}=a,u=i.number==="BigNumber"?new l(e):parseFloat(e),s=new o(u,t);return s.fixPrefix=!0,s})}function Ro(r,e){var t=["config","BigNumber"];return L(r,t,n=>{var{config:a,BigNumber:i}=n;return a.number==="BigNumber"?new i(e):e})}function Ed(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function iR(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ed(Object(t),!0).forEach(function(n){Vr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ed(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var oR="mapSlices",sR=["typed","isInteger"],uR=L(oR,sR,r=>{var{typed:e,isInteger:t}=r,n=xs({typed:e,isInteger:t});return e("mapSlices",{"...any":function(i){var o=i[1];Ye(o)?i[1]=o-1:or(o)&&(i[1]=o.minus(1));try{return n.apply(null,i)}catch(l){throw ht(l)}}})},iR({isTransformFunction:!0},xs.meta)),lR="column",cR=["typed","Index","matrix","range"],fR=L(lR,cR,r=>{var{typed:e,Index:t,matrix:n,range:a}=r,i=Jf({typed:e,Index:t,matrix:n,range:a});return e("column",{"...any":function(l){var u=l.length-1,s=l[u];Ye(s)&&(l[u]=s-1);try{return i.apply(null,l)}catch(c){throw ht(c)}}})},{isTransformFunction:!0});function Qs(r,e,t){var n=r.filter(function(u){return jr(u)&&!(u.name in e)&&!t.has(u.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+r+'"');var a=n.name,i=new Map,o=new Yu(t,i,new Set([a])),l=r.compile();return function(s){return i.set(a,s),l.evaluate(o)}}var mR="transformCallback",vR=["typed"],Ks=L(mR,vR,r=>{var{typed:e}=r;return function(n,a){return e.isTypedFunction(n)?t(n,a):Ad(n,n.length,a)};function t(n,a){var i=Object.fromEntries(Object.entries(n.signatures).map(o=>{var[l,u]=o,s=l.split(",").length;return e.isTypedFunction(u)?[l,t(u,a)]:[l,Ad(u,s,a)]}));return typeof n.name=="string"?e(n.name,i):e(i)}});function Ad(r,e,t){return e===t?r:e===t+1?function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];var o=a.slice(0,t),l=Sd(a[t]);return r(...o,l)}:e>t+1?function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];var o=a.slice(0,t),l=Sd(a[t]),u=a.slice(t+1);return r(...o,l,...u)}:r}function Sd(r){return r.map(e=>e+1)}var pR="filter",dR=["typed"],hR=L(pR,dR,r=>{var{typed:e}=r;function t(a,i,o){var l=Kf({typed:e}),u=Ks({typed:e});if(a.length===0)return l();var s=a[0];if(a.length===1)return l(s);var c=a.length-1,f=a[c];return s&&(s=n(s,o)),f&&(jr(f)||ei(f)?f=n(f,o):f=Qs(f,i,o)),l(s,u(f,c))}t.rawArgs=!0;function n(a,i){return a.compile().evaluate(i)}return t},{isTransformFunction:!0}),gR="forEach",yR=["typed"],bR=L(gR,yR,r=>{var{typed:e}=r,t=tm({typed:e}),n=Ks({typed:e});function a(o,l,u){if(o.length===0)return t();var s=o[0];if(o.length===1)return t(s);var c=o.length-1,f=o[c];return s&&(s=i(s,u)),f&&(jr(f)||ei(f)?f=i(f,u):f=Qs(f,l,u)),t(s,n(f,c))}a.rawArgs=!0;function i(o,l){return o.compile().evaluate(l)}return a},{isTransformFunction:!0}),xR="index",wR=["Index","getMatrixDataType"],DR=L(xR,wR,r=>{var{Index:e,getMatrixDataType:t}=r;return function(){for(var a=[],i=0,o=arguments.length;i<o;i++){var l=arguments[i];if(jo(l))l.start--,l.end-=l.step>0?0:2;else if(l&&l.isSet===!0)l=l.map(function(s){return s-1});else if(Ar(l)||Je(l))t(l)!=="boolean"&&(l=l.map(function(s){return s-1}));else if(Ye(l)||Qa(l))l--;else if(or(l))l=l.toNumber()-1;else if(typeof l!="string")throw new TypeError("Dimension must be an Array, Matrix, number, bigint, string, or Range");a[i]=l}var u=new e;return e.apply(u,a),u}},{isTransformFunction:!0}),NR="map",ER=["typed"],AR=L(NR,ER,r=>{var{typed:e}=r,t=om({typed:e}),n=Ks({typed:e});function a(i,o,l){if(i.length===0)return t();if(i.length===1)return t(i[0]);var u=i.length-1,s=i.slice(0,u),c=i[u];return s=s.map(m=>f(m,l)),c&&(jr(c)||ei(c)?c=f(c,l):c=Qs(c,o,l)),t(...s,n(c,u));function f(m,v){return m.compile().evaluate(v)}}return a.rawArgs=!0,a},{isTransformFunction:!0});function SR(r){return Ye(r)?r-1:or(r)?r.minus(1):r}function CR(r){return Ye(r)||or(r)}function $n(r){if(r.length===2&&Mt(r[0])){r=r.slice();var e=r[1];CR(e)&&(r[1]=SR(e))}return r}var MR="max",_R=["typed","config","numeric","larger","isNaN"],TR=L(MR,_R,r=>{var{typed:e,config:t,numeric:n,larger:a,isNaN:i}=r,o=mv({typed:e,config:t,numeric:n,larger:a,isNaN:i});return e("max",{"...any":function(u){u=$n(u);try{return o.apply(null,u)}catch(s){throw ht(s)}}})},{isTransformFunction:!0}),FR="mean",OR=["typed","add","divide"],BR=L(FR,OR,r=>{var{typed:e,add:t,divide:n}=r,a=qp({typed:e,add:t,divide:n});return e("mean",{"...any":function(o){o=$n(o);try{return a.apply(null,o)}catch(l){throw ht(l)}}})},{isTransformFunction:!0}),RR="min",IR=["typed","config","numeric","smaller","isNaN"],PR=L(RR,IR,r=>{var{typed:e,config:t,numeric:n,smaller:a,isNaN:i}=r,o=pv({typed:e,config:t,numeric:n,smaller:a,isNaN:i});return e("min",{"...any":function(u){u=$n(u);try{return o.apply(null,u)}catch(s){throw ht(s)}}})},{isTransformFunction:!0}),$R="range",qR=["typed","config","?matrix","?bignumber","equal","smaller","smallerEq","larger","largerEq","add","isZero","isPositive"],zR=L($R,qR,r=>{var{typed:e,config:t,matrix:n,bignumber:a,equal:i,smaller:o,smallerEq:l,larger:u,largerEq:s,add:c,isZero:f,isPositive:m}=r,v=fm({typed:e,config:t,matrix:n,bignumber:a,equal:i,smaller:o,smallerEq:l,larger:u,largerEq:s,add:c,isZero:f,isPositive:m});return e("range",{"...any":function(d){var y=d.length-1,x=d[y];return typeof x!="boolean"&&d.push(!0),v.apply(null,d)}})},{isTransformFunction:!0}),UR="row",LR=["typed","Index","matrix","range"],kR=L(UR,LR,r=>{var{typed:e,Index:t,matrix:n,range:a}=r,i=hm({typed:e,Index:t,matrix:n,range:a});return e("row",{"...any":function(l){var u=l.length-1,s=l[u];Ye(s)&&(l[u]=s-1);try{return i.apply(null,l)}catch(c){throw ht(c)}}})},{isTransformFunction:!0}),VR="subset",GR=["typed","matrix","zeros","add"],HR=L(VR,GR,r=>{var{typed:e,matrix:t,zeros:n,add:a}=r,i=xm({typed:e,matrix:t,zeros:n,add:a});return e("subset",{"...any":function(l){try{return i.apply(null,l)}catch(u){throw ht(u)}}})},{isTransformFunction:!0}),WR="concat",YR=["typed","matrix","isInteger"],ZR=L(WR,YR,r=>{var{typed:e,matrix:t,isInteger:n}=r,a=Yf({typed:e,matrix:t,isInteger:n});return e("concat",{"...any":function(o){var l=o.length-1,u=o[l];Ye(u)?o[l]=u-1:or(u)&&(o[l]=u.minus(1));try{return a.apply(null,o)}catch(s){throw ht(s)}}})},{isTransformFunction:!0}),Cd="diff",JR=["typed","matrix","subtract","number","bignumber"],jR=L(Cd,JR,r=>{var{typed:e,matrix:t,subtract:n,number:a,bignumber:i}=r,o=um({typed:e,matrix:t,subtract:n,number:a,bignumber:i});return e(Cd,{"...any":function(u){u=$n(u);try{return o.apply(null,u)}catch(s){throw ht(s)}}})},{isTransformFunction:!0}),XR="std",QR=["typed","map","sqrt","variance"],KR=L(XR,QR,r=>{var{typed:e,map:t,sqrt:n,variance:a}=r,i=Wp({typed:e,map:t,sqrt:n,variance:a});return e("std",{"...any":function(l){l=$n(l);try{return i.apply(null,l)}catch(u){throw ht(u)}}})},{isTransformFunction:!0}),Md="sum",e5=["typed","config","add","numeric"],r5=L(Md,e5,r=>{var{typed:e,config:t,add:n,numeric:a}=r,i=Ip({typed:e,config:t,add:n,numeric:a});return e(Md,{"...any":function(l){l=$n(l);try{return i.apply(null,l)}catch(u){throw ht(u)}}})},{isTransformFunction:!0}),t5="quantileSeq",n5=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger","mapSlices"],a5=L(t5,n5,r=>{var{typed:e,bignumber:t,add:n,subtract:a,divide:i,multiply:o,partitionSelect:l,compare:u,isInteger:s,smaller:c,smallerEq:f,larger:m,mapSlices:v}=r,p=Gp({typed:e,bignumber:t,add:n,subtract:a,divide:i,multiply:o,partitionSelect:l,compare:u,isInteger:s,smaller:c,smallerEq:f,larger:m,mapSlices:v});return e("quantileSeq",{"Array | Matrix, number | BigNumber":p,"Array | Matrix, number | BigNumber, number":(y,x,D)=>p(y,x,d(D)),"Array | Matrix, number | BigNumber, boolean":p,"Array | Matrix, number | BigNumber, boolean, number":(y,x,D,h)=>p(y,x,D,d(h)),"Array | Matrix, Array | Matrix":p,"Array | Matrix, Array | Matrix, number":(y,x,D)=>p(y,x,d(D)),"Array | Matrix, Array | Matrix, boolean":p,"Array | Matrix, Array | Matrix, boolean, number":(y,x,D,h)=>p(y,x,D,d(h))});function d(y){return $n([[],y])[1]}},{isTransformFunction:!0}),_d="cumsum",i5=["typed","add","unaryPlus"],o5=L(_d,i5,r=>{var{typed:e,add:t,unaryPlus:n}=r,a=Pp({typed:e,add:t,unaryPlus:n});return e(_d,{"...any":function(o){if(o.length===2&&Mt(o[0])){var l=o[1];Ye(l)?o[1]=l-1:or(l)&&(o[1]=l.minus(1))}try{return a.apply(null,o)}catch(u){throw ht(u)}}})},{isTransformFunction:!0}),Td="variance",s5=["typed","add","subtract","multiply","divide","mapSlices","isNaN"],u5=L(Td,s5,r=>{var{typed:e,add:t,subtract:n,multiply:a,divide:i,mapSlices:o,isNaN:l}=r,u=kp({typed:e,add:t,subtract:n,multiply:a,divide:i,mapSlices:o,isNaN:l});return e(Td,{"...any":function(c){c=$n(c);try{return u.apply(null,c)}catch(f){throw ht(f)}}})},{isTransformFunction:!0}),Fd="print",l5=["typed","matrix","zeros","add"],c5=L(Fd,l5,r=>{var{typed:e,matrix:t,zeros:n,add:a}=r,i=$m({typed:e,matrix:t,zeros:n,add:a});return e(Fd,{"string, Object | Array":function(u,s){return i(o(u),s)},"string, Object | Array, number | Object":function(u,s,c){return i(o(u),s,c)}});function o(l){return l.replace(Im,u=>{var s=u.slice(1).split("."),c=s.map(function(f){return!isNaN(f)&&f.length>0?parseInt(f)-1:f});return"$"+c.join(".")})}},{isTransformFunction:!0}),f5="and",m5=["typed","matrix","zeros","add","equalScalar","not","concat"],v5=L(f5,m5,r=>{var{typed:e,matrix:t,equalScalar:n,zeros:a,not:i,concat:o}=r,l=av({typed:e,matrix:t,equalScalar:n,zeros:a,not:i,concat:o});function u(s,c,f){var m=s[0].compile().evaluate(f);if(!Mt(m)&&!l(m,!0))return!1;var v=s[1].compile().evaluate(f);return l(m,v)}return u.rawArgs=!0,u},{isTransformFunction:!0}),p5="or",d5=["typed","matrix","equalScalar","DenseMatrix","concat"],h5=L(p5,d5,r=>{var{typed:e,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=r,o=Gf({typed:e,matrix:t,equalScalar:n,DenseMatrix:a,concat:i});function l(u,s,c){var f=u[0].compile().evaluate(c);if(!Mt(f)&&o(f,!1))return!0;var m=u[1].compile().evaluate(c);return o(f,m)}return l.rawArgs=!0,l},{isTransformFunction:!0}),g5="nullish",y5=["typed","matrix","size","flatten","deepEqual"],b5=L(g5,y5,r=>{var{typed:e,matrix:t,size:n,flatten:a,deepEqual:i}=r,o=kf({typed:e,matrix:t,size:n,flatten:a,deepEqual:i});function l(u,s,c){var f=u[0].compile().evaluate(c);if(!Mt(f)&&f!=null&&f!==void 0)return f;var m=u[1].compile().evaluate(c);return o(f,m)}return l.rawArgs=!0,l},{isTransformFunction:!0}),x5="bitAnd",w5=["typed","matrix","zeros","add","equalScalar","not","concat"],D5=L(x5,w5,r=>{var{typed:e,matrix:t,equalScalar:n,zeros:a,not:i,concat:o}=r,l=Ff({typed:e,matrix:t,equalScalar:n,zeros:a,not:i,concat:o});function u(s,c,f){var m=s[0].compile().evaluate(f);if(!Mt(m)){if(isNaN(m))return NaN;if(m===0||m===!1)return 0}var v=s[1].compile().evaluate(f);return l(m,v)}return u.rawArgs=!0,u},{isTransformFunction:!0}),N5="bitOr",E5=["typed","matrix","equalScalar","DenseMatrix","concat"],A5=L(N5,E5,r=>{var{typed:e,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=r,o=Rf({typed:e,matrix:t,equalScalar:n,DenseMatrix:a,concat:i});function l(u,s,c){var f=u[0].compile().evaluate(c);if(!Mt(f)){if(isNaN(f))return NaN;if(f===-1)return-1;if(f===!0)return 1}var m=u[1].compile().evaluate(c);return o(f,m)}return l.rawArgs=!0,l},{isTransformFunction:!0}),Od="num",S5=["typed","fraction"],C5=L(Od,S5,r=>{var{typed:e,fraction:t}=r;return e(Od,{Fraction:n=>n.s*n.n,BigNumber:n=>{var a=t(n);return a.s*a.n},"Array | Matrix":e.referToSelf(n=>a=>tr(a,n))})}),Bd="den",M5=["typed","fraction"],_5=L(Bd,M5,r=>{var{typed:e,fraction:t}=r;return e(Bd,{Fraction:n=>n.d,BigNumber:n=>t(n).d,"Array | Matrix":e.referToSelf(n=>a=>tr(a,n))})}),Me=Qy({config:ye}),Mr=n1({}),Rd=QB({BigNumber:Me,config:ye}),T5=WB({}),F5=M4({BigNumber:Me,config:ye}),qn=f1({}),Id=o4({Complex:Mr}),O5=ZB({BigNumber:Me,config:ye}),B5=r4({BigNumber:Me,config:ye}),R5=n4({BigNumber:Me,config:ye}),Io=g1({}),I5=JB({BigNumber:Me,config:ye}),P5=YB({}),$5=KB({BigNumber:Me,config:ye}),q5=p1({}),Pd=ty({}),z5=a4({BigNumber:Me,config:ye}),U5=Y4({BigNumber:Me,config:ye}),$d=XB({BigNumber:Me,config:ye}),L5=HB({}),k5=s4({}),sr=B1({Matrix:Io,config:ye}),V5=$4({BigNumber:Me,config:ye}),G5=e4({BigNumber:Me,config:ye}),eu=jB({BigNumber:Me,config:ye}),qd=VB({}),H5=i4({BigNumber:Me,config:ye}),W=Q0({BigNumber:Me,Complex:Mr,DenseMatrix:sr,Fraction:qn}),W5=P4({BigNumber:Me,config:ye}),gt=Qb({typed:W}),Y5=_E({Complex:Mr,config:ye,typed:W}),Z5=BE({BigNumber:Me,typed:W}),J5=$E({BigNumber:Me,Complex:Mr,config:ye,typed:W}),Yr=tx({typed:W}),j5=Vw({typed:W}),X5=VE({BigNumber:Me,Complex:Mr,config:ye,typed:W}),Q5=ZE({typed:W}),zd=XE({typed:W}),K5=rA({Complex:Mr,config:ye,typed:W}),eI=Nb({typed:W}),rI=Pw({typed:W}),tI=Cb({typed:W}),nI=I1({typed:W}),Po=DO({typed:W}),$o=Bb({Complex:Mr,typed:W}),na=Hw({typed:W}),ru=nA({typed:W}),aI=sA({BigNumber:Me,typed:W}),iI=fA({BigNumber:Me,typed:W}),oI=yx({typed:W}),cr=mb({config:ye,typed:W}),sI=fN({typed:W}),Ud=xx({typed:W}),uI=Dx({Complex:Mr,typed:W}),lI=Kf({typed:W}),aa=vD({typed:W}),cI=tm({typed:W}),mi=DN({typed:W}),tu=gD({typed:W}),fI=MN({format:mi,typed:W}),nu=Yw({typed:W}),vi=ib({typed:W}),gn=nb({typed:W}),ia=J1({typed:W}),mI=IN({typed:W}),vI=t4({BigNumber:Me,config:ye}),pI=MO({Complex:Mr,typed:W}),dI=tw({Complex:Mr,config:ye,typed:W}),au=aw({Complex:Mr,config:ye,typed:W}),zn=om({typed:W}),hI=yN({isNaN:gn,isNumeric:ia,typed:W}),qr=sw({typed:W}),qo=Xw({typed:W}),an=xb({typed:W}),gI=SN({format:mi,typed:W}),yI=eB({config:ye,typed:W}),bI=$m({typed:W}),xI=tB({config:ye,typed:W}),iu=Jw({typed:W}),wI=dA({BigNumber:Me,typed:W}),Ld=vw({BigNumber:Me,Fraction:qn,complex:$o,typed:W}),zo=bA({typed:W}),Zr=UD({typed:W}),Jr=db({Matrix:Io,equalScalar:cr,typed:W}),DI=Wb({typed:W}),NI=yw({typed:W}),EI=Ab({typed:W}),Lt=ax({typed:W}),AI=NA({typed:W}),SI=BN({typed:W}),ou=lb({typed:W}),CI=FE({Complex:Mr,config:ye,typed:W}),MI=zE({BigNumber:Me,typed:W}),_I=LE({BigNumber:Me,Complex:Mr,config:ye,typed:W}),Et=Tb({BigNumber:Me,typed:W}),TI=EO({typed:W}),FI=iA({typed:W}),OI=vA({BigNumber:Me,typed:W}),Uo=eS({addScalar:Yr,conj:na,multiplyScalar:qr,size:Zr,typed:W}),BI=X1({isNumeric:ia,typed:W}),RI=sb({isBounded:vi,map:zn,typed:W}),Un=Y1({config:ye,typed:W}),kt=rb({equalScalar:cr,typed:W}),Ce=qb({DenseMatrix:sr,Matrix:Io,SparseMatrix:Jr,typed:W}),II=Ub({isZero:kt,matrix:Ce,typed:W}),Dr=lw({addScalar:Yr,dot:Uo,equalScalar:cr,matrix:Ce,multiplyScalar:qr,typed:W}),PI=SD({BigNumber:Me,config:ye,matrix:Ce,typed:W}),$I=aB({config:ye,log2:au,typed:W}),qI=BD({config:ye,matrix:Ce}),zI=gA({BigNumber:Me,typed:W}),UI=wA({typed:W}),LI=AE({SparseMatrix:Jr,typed:W}),Xt=hw({Complex:Mr,config:ye,typed:W}),kI=kD({typed:W}),VI=SA({typed:W}),pi=ZD({matrix:Ce,typed:W}),kd=Dw({BigNumber:Me,config:ye,matrix:Ce,typed:W}),at=QD({BigNumber:Me,config:ye,matrix:Ce,typed:W}),GI=IE({BigNumber:Me,Complex:Mr,config:ye,typed:W}),HI=HE({Complex:Mr,config:ye,typed:W}),WI=EN({format:mi,typed:W}),YI=lA({BigNumber:Me,typed:W}),su=jD({conj:na,transpose:pi,typed:W}),Vd=lD({DenseMatrix:sr,SparseMatrix:Jr,matrix:Ce,typed:W}),yt=T2({DenseMatrix:sr,SparseMatrix:Jr,equalScalar:cr,matrix:Ce,typed:W}),oa=Pb({Fraction:qn,typed:W}),Ln=bD({BigNumber:Me,DenseMatrix:sr,SparseMatrix:Jr,config:ye,matrix:Ce,typed:W}),bt=$1({equal:yt,typed:W}),ZI=wD({matrix:Ce,multiplyScalar:qr,typed:W}),di=xs({isInteger:bt,typed:W}),uu=Gb({flatten:aa,matrix:Ce,size:Zr,typed:W}),JI=C5({fraction:oa,typed:W}),Gd=TD({isInteger:bt,matrix:Ce,typed:W}),Pa=GN({BigNumber:Me,DenseMatrix:sr,config:ye,equalScalar:cr,matrix:Ce,typed:W,zeros:at}),on=Zb({typed:W}),jI=xO({BigNumber:Me,Fraction:qn,config:ye,isInteger:bt,number:an,typed:W}),Hd=ox({BigNumber:Me,Complex:Mr,Fraction:qn,config:ye,isNegative:Un,matrix:Ce,typed:W,unaryMinus:on}),xr=Yf({isInteger:bt,matrix:Ce,typed:W}),hi=Y2({equal:yt,typed:W}),XI=Mw({concat:xr,equalScalar:cr,matrix:Ce,multiplyScalar:qr,typed:W}),Wd=mf({DenseMatrix:sr,config:ye,equalScalar:cr,matrix:Ce,round:Pa,typed:W,zeros:at}),QI=Jx({BigNumber:Me,DenseMatrix:sr,concat:xr,config:ye,equalScalar:cr,matrix:Ce,round:Pa,typed:W,zeros:at}),sa=K1({config:ye,typed:W}),xt=L2({DenseMatrix:sr,SparseMatrix:Jr,bignumber:Et,concat:xr,config:ye,matrix:Ce,typed:W}),KI=Kx({concat:xr,equalScalar:cr,matrix:Ce,typed:W}),e8=v2({DenseMatrix:sr,concat:xr,equalScalar:cr,matrix:Ce,typed:W,zeros:at}),Yd=df({DenseMatrix:sr,concat:xr,config:ye,equalScalar:cr,matrix:Ce,round:Pa,typed:W,zeros:at}),r8=fw({BigNumber:Me,concat:xr,equalScalar:cr,matrix:Ce,typed:W}),t8=kf({deepEqual:hi,flatten:aa,matrix:Ce,size:Zr,typed:W}),Vt=qN({bignumber:Et,fraction:oa,number:an}),Zd=xN({config:ye,multiplyScalar:qr,numeric:Vt,typed:W}),n8=d2({DenseMatrix:sr,concat:xr,equalScalar:cr,matrix:Ce,typed:W,zeros:at}),wt=I2({DenseMatrix:sr,SparseMatrix:Jr,bignumber:Et,concat:xr,config:ye,matrix:Ce,typed:W}),Lr=xw({DenseMatrix:sr,concat:xr,equalScalar:cr,matrix:Ce,subtractScalar:Lt,typed:W,unaryMinus:on}),a8=FN({concat:xr,matrix:Ce,typed:W}),lu=jb({config:ye,numeric:Vt,typed:W}),i8=rD({DenseMatrix:sr,SparseMatrix:Jr,concat:xr,matrix:Ce,typed:W}),dr=ZA({DenseMatrix:sr,SparseMatrix:Jr,addScalar:Yr,concat:xr,equalScalar:cr,matrix:Ce,typed:W}),o8=KE({BigNumber:Me,DenseMatrix:sr,concat:xr,equalScalar:cr,matrix:Ce,typed:W}),s8=Ff({concat:xr,equalScalar:cr,matrix:Ce,typed:W}),u8=Rf({DenseMatrix:sr,concat:xr,equalScalar:cr,matrix:Ce,typed:W}),l8=Lw({DenseMatrix:sr,SparseMatrix:Jr,concat:xr,matrix:Ce,typed:W}),cu=hx({DenseMatrix:sr,config:ye,equalScalar:cr,matrix:Ce,round:Pa,typed:W,zeros:at}),ua=x2({BigNumber:Me,DenseMatrix:sr,Fraction:qn,concat:xr,config:ye,equalScalar:cr,matrix:Ce,typed:W}),Jd=M2({concat:xr,matrix:Ce,typed:W}),c8=mB({addScalar:Yr,combinations:Po,isInteger:bt,isNegative:Un,isPositive:sa,larger:xt,typed:W}),f8=iD({prod:Zd,size:Zr,typed:W}),m8=sD({matrix:Ce,multiply:Dr,subtract:Lr,typed:W}),v8=um({matrix:Ce,number:an,subtract:Lr,typed:W}),Ir=UN({numeric:Vt,typed:W}),p8=B2({compareText:Jd,isZero:kt,typed:W}),jd=fE({larger:xt,smaller:wt}),Xd=Ax({Complex:Mr,DenseMatrix:sr,ceil:cu,equalScalar:cr,floor:Wd,matrix:Ce,typed:W,zeros:at}),d8=jA({abs:gt,addScalar:Yr,divideScalar:Ir,isPositive:sa,multiplyScalar:qr,smaller:wt,sqrt:Xt,typed:W}),Qd=iE({DenseMatrix:sr,smaller:wt}),ft=uE({ImmutableDenseMatrix:Qd,getMatrixDataType:tu}),h8=oO({abs:gt,add:dr,addScalar:Yr,config:ye,divideScalar:Ir,equalScalar:cr,flatten:aa,isNumeric:ia,isZero:kt,matrix:Ce,multiply:Dr,multiplyScalar:qr,smaller:wt,subtract:Lr,typed:W}),g8=Ew({BigNumber:Me,add:dr,config:ye,equal:yt,isInteger:bt,mod:Yd,smaller:wt,typed:W,xgcd:kd}),Lo=G2({DenseMatrix:sr,SparseMatrix:Jr,concat:xr,config:ye,matrix:Ce,typed:W}),fu=YN({Complex:Mr,config:ye,divideScalar:Ir,typeOf:ou,typed:W}),Kd=n2({DenseMatrix:sr,divideScalar:Ir,equalScalar:cr,matrix:Ce,multiplyScalar:qr,subtractScalar:Lt,typed:W}),y8=kb({flatten:aa,matrix:Ce,size:Zr,typed:W}),b8=pv({config:ye,isNaN:gn,numeric:Vt,smaller:wt,typed:W}),x8=XN({Complex:Mr,config:ye,divideScalar:Ir,typed:W}),ko=Q2({compare:ua,isNaN:gn,isNumeric:ia,typed:W}),mu=lC({addScalar:Yr,complex:$o,conj:na,divideScalar:Ir,equal:yt,identity:Ln,isZero:kt,matrix:Ce,multiplyScalar:qr,sign:Ld,sqrt:Xt,subtractScalar:Lt,typed:W,unaryMinus:on,zeros:at}),w8=g2({DenseMatrix:sr,concat:xr,equalScalar:cr,matrix:Ce,typed:W,zeros:at}),eh=BC({SparseMatrix:Jr,abs:gt,add:dr,divideScalar:Ir,larger:xt,largerEq:Lo,multiply:Dr,subtract:Lr,transpose:pi,typed:W}),rh=pE({FibonacciHeap:jd,addScalar:Yr,equalScalar:cr}),Tt=xm({add:dr,matrix:Ce,typed:W,zeros:at}),vu=Ip({add:dr,config:ye,numeric:Vt,typed:W}),D8=nS({add:dr,matrix:Ce,typed:W}),pu=i2({DenseMatrix:sr,divideScalar:Ir,equalScalar:cr,matrix:Ce,multiplyScalar:qr,subtractScalar:Lt,typed:W}),N8=IB({Complex:Mr,add:dr,multiply:Dr,number:an,typed:W}),E8=cB({addScalar:Yr,combinations:Po,divideScalar:Ir,isInteger:bt,isNegative:Un,multiplyScalar:qr,typed:W}),sn=A2({compare:ua,typed:W}),A8=Pp({add:dr,typed:W,unaryPlus:lu}),th=B3({divideScalar:Ir,isZero:kt,matrix:Ce,multiply:Dr,subtractScalar:Lt,typed:W,unaryMinus:on}),gi=r2({DenseMatrix:sr,SparseMatrix:Jr,concat:xr,divideScalar:Ir,equalScalar:cr,matrix:Ce,typed:W}),nh=iS({Index:ft,typed:W}),la=I3({abs:gt,addScalar:Yr,det:th,divideScalar:Ir,identity:Ln,matrix:Ce,multiply:Dr,typed:W,unaryMinus:on}),S8=JN({Complex:Mr,config:ye,divideScalar:Ir,log:fu,typed:W}),C8=s2({DenseMatrix:sr,divideScalar:Ir,equalScalar:cr,matrix:Ce,multiplyScalar:qr,subtractScalar:Lt,typed:W}),du=mv({config:ye,isNaN:gn,larger:xt,numeric:Vt,typed:W}),M8=Gf({DenseMatrix:sr,concat:xr,equalScalar:cr,matrix:Ce,typed:W}),_8=$3({Complex:Mr,add:dr,ctranspose:su,deepEqual:hi,divideScalar:Ir,dot:Uo,dotDivide:gi,equal:yt,inv:la,matrix:Ce,multiply:Dr,typed:W}),Qt=kN({Complex:Mr,config:ye,fraction:oa,identity:Ln,inv:la,matrix:Ce,multiply:Dr,number:an,typed:W}),T8=MA({DenseMatrix:sr,Index:ft,compareNatural:sn,size:Zr,subset:Tt,typed:W}),F8=OA({DenseMatrix:sr,Index:ft,compareNatural:sn,size:Zr,subset:Tt,typed:W}),O8=PA({Index:ft,compareNatural:sn,size:Zr,subset:Tt,typed:W}),B8=UA({Index:ft,compareNatural:sn,size:Zr,subset:Tt,typed:W}),$a=q2({DenseMatrix:sr,SparseMatrix:Jr,concat:xr,config:ye,matrix:Ce,typed:W}),R8=eE({compare:ua,compareNatural:sn,matrix:Ce,typed:W}),I8=W3({abs:gt,add:dr,identity:Ln,inv:la,map:zn,max:du,multiply:Dr,size:Zr,sqrt:Xt,subtract:Lr,typed:W}),P8=J2({DenseMatrix:sr,SparseMatrix:Jr,concat:xr,config:ye,equalScalar:cr,matrix:Ce,typed:W}),ah=l2({DenseMatrix:sr,divideScalar:Ir,equalScalar:cr,matrix:Ce,multiplyScalar:qr,subtractScalar:Lt,typed:W}),$8=av({concat:xr,equalScalar:cr,matrix:Ce,not:qo,typed:W,zeros:at}),q8=_5({fraction:oa,typed:W}),z8=nO({abs:gt,addScalar:Yr,deepEqual:hi,divideScalar:Ir,multiplyScalar:qr,sqrt:Xt,subtractScalar:Lt,typed:W}),U8=KN({DenseMatrix:sr,SparseMatrix:Jr,concat:xr,equalScalar:cr,matrix:Ce,pow:Qt,typed:W}),L8=G3({abs:gt,add:dr,identity:Ln,inv:la,multiply:Dr,typed:W}),ih=eN({addScalar:Yr,ceil:cu,conj:na,divideScalar:Ir,dotDivide:gi,exp:Ud,i:Id,log2:au,matrix:Ce,multiplyScalar:qr,pow:Qt,tau:$d,typed:W}),hu=SO({BigNumber:Me,Complex:Mr,config:ye,multiplyScalar:qr,pow:Qt,typed:W}),k8=tN({conj:na,dotDivide:gi,fft:ih,typed:W}),oh=sC({DenseMatrix:sr,Spa:rh,SparseMatrix:Jr,abs:gt,addScalar:Yr,divideScalar:Ir,equalScalar:cr,larger:xt,matrix:Ce,multiplyScalar:qr,subtractScalar:Lt,typed:W,unaryMinus:on}),qa=fm({bignumber:Et,matrix:Ce,add:dr,config:ye,equal:yt,isPositive:sa,isZero:kt,larger:xt,largerEq:Lo,smaller:wt,smallerEq:$a,typed:W}),V8=hm({Index:ft,matrix:Ce,range:qa,typed:W}),sh=TA({DenseMatrix:sr,Index:ft,compareNatural:sn,size:Zr,subset:Tt,typed:W}),G8=qA({Index:ft,compareNatural:sn,size:Zr,subset:Tt,typed:W}),uh=GA({Index:ft,concat:xr,setDifference:sh,size:Zr,subset:Tt,typed:W}),Qe=wE({BigNumber:Me,Complex:Mr,Fraction:qn,abs:gt,addScalar:Yr,config:ye,divideScalar:Ir,equal:yt,fix:Xd,format:mi,isNumeric:ia,multiplyScalar:qr,number:an,pow:Qt,round:Pa,subtractScalar:Lt}),H8=p4({BigNumber:Me,Unit:Qe,config:ye}),W8=j4({BigNumber:Me,Unit:Qe,config:ye}),Y8=q4({BigNumber:Me,Unit:Qe,config:ye}),Z8=y4({BigNumber:Me,Unit:Qe,config:ye}),J8=U4({BigNumber:Me,Unit:Qe,config:ye}),lh=Jf({Index:ft,matrix:Ce,range:qa,typed:W}),j8=b4({BigNumber:Me,Unit:Qe,config:ye}),X8=d4({BigNumber:Me,Unit:Qe,config:ye}),Q8=CE({Unit:Qe,typed:W}),K8=F4({BigNumber:Me,Unit:Qe,config:ye}),ch=k3({abs:gt,add:dr,addScalar:Yr,atan:zd,bignumber:Et,column:lh,complex:$o,config:ye,cos:ru,diag:Vd,divideScalar:Ir,dot:Uo,equal:yt,flatten:aa,im:nu,inv:la,larger:xt,matrix:Ce,matrixFromColumns:uu,multiply:Dr,multiplyScalar:qr,number:an,qr:mu,re:iu,reshape:Gd,sin:zo,size:Zr,smaller:wt,sqrt:Xt,subtract:Lr,typed:W,usolve:pu,usolveAll:ah}),eP=S4({BigNumber:Me,Unit:Qe,config:ye}),yi=TO({gamma:hu,typed:W}),rP=C4({BigNumber:Me,Unit:Qe,config:ye}),tP=G4({BigNumber:Me,Unit:Qe,config:ye}),nP=K4({BigNumber:Me,Unit:Qe,config:ye}),aP=N4({BigNumber:Me,Unit:Qe,config:ye}),iP=V4({BigNumber:Me,Unit:Qe,config:ye}),oP=m4({BigNumber:Me,Unit:Qe,config:ye}),sP=X4({BigNumber:Me,Unit:Qe,config:ye}),uP=H4({BigNumber:Me,Unit:Qe,config:ye}),lP=O4({BigNumber:Me,Unit:Qe,config:ye}),cP=D4({BigNumber:Me,Unit:Qe,config:ye}),fP=PO({factorial:yi,typed:W}),mP=c4({BigNumber:Me,Unit:Qe,config:ye}),vP=rR({BigNumber:Me,Unit:Qe,config:ye}),pP=tR({BigNumber:Me,Unit:Qe,config:ye}),dP=T4({BigNumber:Me,Unit:Qe,config:ye}),hP=B4({BigNumber:Me,Unit:Qe,config:ye}),gP=f4({BigNumber:Me,Unit:Qe,config:ye}),yP=Z4({BigNumber:Me,Unit:Qe,config:ye}),bP=kA({compareNatural:sn,typed:W}),xP=u4({BigNumber:Me,Unit:Qe,config:ye}),wP=J4({BigNumber:Me,Unit:Qe,config:ye}),DP=I4({BigNumber:Me,Unit:Qe,config:ye}),NP=z4({BigNumber:Me,Unit:Qe,config:ye}),EP=E4({BigNumber:Me,Unit:Qe,config:ye}),AP=h4({BigNumber:Me,Unit:Qe,config:ye}),it=rO({divideScalar:Ir,equalScalar:cr,inv:la,matrix:Ce,multiply:Dr,typed:W}),SP=g4({BigNumber:Me,Unit:Qe,config:ye}),CP=L4({BigNumber:Me,Unit:Qe,config:ye}),MP=$B({Complex:Mr,add:dr,divide:it,matrix:Ce,multiply:Dr,typed:W}),_P=l4({BigNumber:Me,Unit:Qe,config:ye}),TP=x4({BigNumber:Me,Unit:Qe,config:ye}),fh=IC({DenseMatrix:sr,lsolve:Kd,lup:oh,matrix:Ce,slu:eh,typed:W,usolve:pu}),FP=w4({BigNumber:Me,Unit:Qe,config:ye}),OP=Q4({BigNumber:Me,Unit:Qe,config:ye}),BP=RO({add:dr,divide:it,factorial:yi,isInteger:bt,isPositive:sa,multiply:Dr,typed:W}),RP=nR({BigNumber:Me,Unit:Qe,config:ye}),IP=aR({BigNumber:Me,Unit:Qe,config:ye}),PP=Gp({bignumber:Et,add:dr,compare:ua,divide:it,isInteger:bt,larger:xt,mapSlices:di,multiply:Dr,partitionSelect:ko,smaller:wt,smallerEq:$a,subtract:Lr,typed:W}),$P=R4({BigNumber:Me,Unit:Qe,config:ye}),mh=RA({DenseMatrix:sr,Index:ft,compareNatural:sn,size:Zr,subset:Tt,typed:W}),qP=uN({abs:gt,add:dr,bignumber:Et,divide:it,isNegative:Un,isPositive:sa,larger:xt,map:zn,matrix:Ce,max:du,multiply:Dr,smaller:wt,subtract:Lr,typed:W,unaryMinus:on}),vh=oB({bignumber:Et,addScalar:Yr,combinations:Po,divideScalar:Ir,factorial:yi,isInteger:bt,isNegative:Un,larger:xt,multiplyScalar:qr,number:an,pow:Qt,subtractScalar:Lt,typed:W}),zP=NE({Unit:Qe,typed:W}),UP=uB({addScalar:Yr,isInteger:bt,isNegative:Un,stirlingS2:vh,typed:W}),LP=v4({BigNumber:Me,Unit:Qe,config:ye}),kP=k4({BigNumber:Me,Unit:Qe,config:ye}),VP=_4({BigNumber:Me,Unit:Qe,config:ye}),GP=OO({divide:it,dotDivide:gi,isNumeric:ia,log:fu,map:zn,matrix:Ce,multiply:Dr,sum:vu,typed:W}),ph=qp({add:dr,divide:it,typed:W}),HP=W4({BigNumber:Me,Unit:Qe,config:ye}),WP=eR({BigNumber:Me,Unit:Qe,config:ye}),YP=WA({Index:ft,concat:xr,setIntersect:mh,setSymDifference:uh,size:Zr,subset:Tt,typed:W}),gu=kp({add:dr,divide:it,isNaN:gn,mapSlices:di,multiply:Dr,subtract:Lr,typed:W}),ZP=A4({BigNumber:Me,Unit:Qe,config:ye}),JP=yO({add:dr,divide:it,matrix:Ce,mean:ph,multiply:Dr,pow:Qt,sqrt:Xt,subtract:Lr,sum:vu,typed:W}),dh=fO({add:dr,compare:ua,divide:it,partitionSelect:ko,typed:W}),jP=$C({add:dr,cbrt:Hd,divide:it,equalScalar:cr,im:nu,isZero:kt,multiply:Dr,re:iu,sqrt:Xt,subtract:Lr,typeOf:ou,typed:W,unaryMinus:on}),XP=Wp({map:zn,sqrt:Xt,typed:W,variance:gu}),QP=hN({BigNumber:Me,Complex:Mr,add:dr,config:ye,divide:it,equal:yt,factorial:yi,gamma:hu,isBounded:vi,isNegative:Un,multiply:Dr,pi:eu,pow:Qt,sin:zo,smallerEq:$a,subtract:Lr,typed:W}),KP=vO({abs:gt,map:zn,median:dh,subtract:Lr,typed:W}),yu=QA({abs:gt,add:dr,conj:na,ctranspose:su,eigs:ch,equalScalar:cr,larger:xt,matrix:Ce,multiply:Dr,pow:Qt,smaller:wt,sqrt:Xt,typed:W}),hh=$D({BigNumber:Me,DenseMatrix:sr,SparseMatrix:Jr,addScalar:Yr,config:ye,cos:ru,matrix:Ce,multiplyScalar:qr,norm:yu,sin:zo,typed:W,unaryMinus:on}),e6=ID({multiply:Dr,rotationMatrix:hh,typed:W}),gh=j3({identity:Ln,matrix:Ce,multiply:Dr,norm:yu,qr:mu,subtract:Lr,typed:W}),yh=Z3({abs:gt,add:dr,concat:xr,identity:Ln,index:nh,lusolve:fh,matrix:Ce,matrixFromColumns:uu,multiply:Dr,range:qa,schur:gh,subset:Tt,subtract:Lr,transpose:pi,typed:W}),r6=Q3({matrix:Ce,multiply:Dr,sylvester:yh,transpose:pi,typed:W}),za={},bi={},bh={},mt=uS({mathWithTransform:bi}),Ua=RS({Node:mt}),yn=PS({Node:mt}),ca=qS({Node:mt}),xh=kS({Node:mt}),La=mS({Node:mt}),wh=yS({Node:mt,ResultSet:Pd}),Dh=xS({Node:mt}),Nh=US({Node:mt}),t6=UB({classes:bh}),bu=VC({math:za,typed:W}),Eh=TS({Node:mt,typed:W}),n6=F3({Chain:bu,typed:W}),kn=MS({Node:mt,isBounded:vi}),ka=OS({Node:mt,size:Zr}),Va=cS({Node:mt,subset:Tt}),Ah=hS({matrix:Ce,Node:mt,subset:Tt}),Vn=HS({Unit:Qe,Node:mt,math:za}),Gn=YS({Node:mt,SymbolNode:Vn,math:za}),Kt=JS({AccessorNode:Va,ArrayNode:La,AssignmentNode:Ah,BlockNode:wh,ConditionalNode:Dh,ConstantNode:kn,FunctionAssignmentNode:Eh,FunctionNode:Gn,IndexNode:ka,ObjectNode:Ua,OperatorNode:yn,ParenthesisNode:ca,RangeNode:Nh,RelationalNode:xh,SymbolNode:Vn,config:ye,numeric:Vt,typed:W}),Sh=CB({ConstantNode:kn,FunctionNode:Gn,OperatorNode:yn,ParenthesisNode:ca,parse:Kt,typed:W}),xu=DB({bignumber:Et,fraction:oa,AccessorNode:Va,ArrayNode:La,ConstantNode:kn,FunctionNode:Gn,IndexNode:ka,ObjectNode:Ua,OperatorNode:yn,SymbolNode:Vn,config:ye,isBounded:vi,mathWithTransform:bi,matrix:Ce,typed:W}),a6=XS({parse:Kt,typed:W}),Vo=KS({parse:Kt,typed:W}),Ch=UC({evaluate:Vo}),Mh=tC({evaluate:Vo,parse:Kt}),wu=EB({AccessorNode:Va,ArrayNode:La,ConstantNode:kn,FunctionNode:Gn,IndexNode:ka,ObjectNode:Ua,OperatorNode:yn,ParenthesisNode:ca,SymbolNode:Vn,add:dr,divide:it,equal:yt,isZero:kt,multiply:Dr,parse:Kt,pow:Qt,subtract:Lr,typed:W}),i6=_3({Help:Ch,mathWithTransform:bi,typed:W}),Go=bB({AccessorNode:Va,ArrayNode:La,ConstantNode:kn,FunctionNode:Gn,IndexNode:ka,ObjectNode:Ua,OperatorNode:yn,ParenthesisNode:ca,SymbolNode:Vn,equal:yt,parse:Kt,replacer:qd,resolve:Sh,simplifyConstant:xu,simplifyCore:wu,typed:W}),o6=_B({OperatorNode:yn,parse:Kt,simplify:Go,typed:W}),s6=FB({ConstantNode:kn,FunctionNode:Gn,OperatorNode:yn,ParenthesisNode:ca,SymbolNode:Vn,config:ye,equal:yt,isZero:kt,numeric:Vt,parse:Kt,simplify:Go,typed:W}),u6=iC({Parser:Mh,typed:W}),l6=pB({parse:Kt,typed:W}),c6=BB({bignumber:Et,fraction:oa,AccessorNode:Va,ArrayNode:La,ConstantNode:kn,FunctionNode:Gn,IndexNode:ka,ObjectNode:Ua,OperatorNode:yn,ParenthesisNode:ca,SymbolNode:Vn,add:dr,config:ye,divide:it,equal:yt,isZero:kt,mathWithTransform:bi,matrix:Ce,multiply:Dr,parse:Kt,pow:Qt,simplify:Go,simplifyConstant:xu,simplifyCore:wu,subtract:Lr,typed:W});zr(za,{e:Rd,false:T5,fineStructure:F5,i:Id,Infinity:O5,LN10:B5,LOG10E:R5,NaN:I5,null:P5,phi:$5,SQRT1_2:z5,sackurTetrode:U5,tau:$d,true:L5,E:Rd,version:k5,efimovFactor:V5,LN2:G5,pi:eu,replacer:qd,reviver:t6,SQRT2:H5,typed:W,PI:eu,weakMixingAngle:W5,abs:gt,acos:Y5,acot:Z5,acsc:J5,addScalar:Yr,arg:j5,asech:X5,asinh:Q5,atan:zd,atanh:K5,bigint:eI,bitNot:rI,boolean:tI,clone:nI,combinations:Po,complex:$o,conj:na,cos:ru,cot:aI,csc:iI,cube:oI,equalScalar:cr,erf:sI,exp:Ud,expm1:uI,filter:lI,flatten:aa,forEach:cI,format:mi,getMatrixDataType:tu,hex:fI,im:nu,isBounded:vi,isNaN:gn,isNumeric:ia,isPrime:mI,LOG2E:vI,lgamma:pI,log10:dI,log2:au,map:zn,mode:hI,multiplyScalar:qr,not:qo,number:an,oct:gI,pickRandom:yI,print:bI,random:xI,re:iu,sec:wI,sign:Ld,sin:zo,size:Zr,splitUnit:DI,square:NI,string:EI,subtractScalar:Lt,tan:AI,toBest:SI,typeOf:ou,acosh:CI,acsch:MI,asec:_I,bignumber:Et,chain:n6,combinationsWithRep:TI,cosh:FI,csch:OI,dot:Uo,hasNumericValue:BI,isFinite:RI,isNegative:Un,isZero:kt,matrix:Ce,matrixFromFunction:II,multiply:Dr,ones:PI,randomInt:$I,resize:qI,sech:zI,sinh:UI,sparse:LI,sqrt:Xt,squeeze:kI,tanh:VI,transpose:pi,xgcd:kd,zeros:at,acoth:GI,asin:HI,bin:WI,coth:YI,ctranspose:su,diag:Vd,equal:yt,fraction:oa,identity:Ln,isInteger:bt,kron:ZI,mapSlices:di,matrixFromColumns:uu,num:JI,reshape:Gd,round:Pa,unaryMinus:on,bernoulli:jI,cbrt:Hd,concat:xr,deepEqual:hi,dotMultiply:XI,floor:Wd,gcd:QI,isPositive:sa,larger:xt,lcm:KI,leftShift:e8,mod:Yd,nthRoot:r8,nullish:t8,numeric:Vt,prod:Zd,rightArithShift:n8,smaller:wt,subtract:Lr,to:a8,unaryPlus:lu,xor:i8,add:dr,atan2:o8,bitAnd:s8,bitOr:u8,bitXor:l8,ceil:cu,compare:ua,compareText:Jd,composition:c8,count:f8,cross:m8,diff:v8,divideScalar:Ir,equalText:p8,fix:Xd,hypot:d8,intersect:h8,invmod:g8,largerEq:Lo,log:fu,lsolve:Kd,matrixFromRows:y8,min:b8,nthRoots:x8,partitionSelect:ko,qr:mu,rightLogShift:w8,slu:eh,subset:Tt,sum:vu,trace:D8,usolve:pu,zpk2tf:N8,catalan:E8,compareNatural:sn,cumsum:A8,det:th,dotDivide:gi,index:nh,inv:la,log1p:S8,lsolveAll:C8,max:du,or:M8,pinv:_8,pow:Qt,setCartesian:T8,setDistinct:F8,setIsSubset:O8,setPowerset:B8,smallerEq:$a,sort:R8,sqrtm:I8,unequal:P8,usolveAll:ah,and:$8,den:q8,distance:z8,dotPow:U8,expm:L8,fft:ih,gamma:hu,ifft:k8,lup:oh,range:qa,row:V8,setDifference:sh,setMultiplicity:G8,setSymDifference:uh,vacuumImpedance:H8,wienDisplacement:W8,atomicMass:Y8,bohrMagneton:Z8,boltzmann:J8,column:lh,conductanceQuantum:j8,coulomb:X8,createUnit:Q8,deuteronMass:K8,eigs:ch,electronMass:eP,factorial:yi,fermiCoupling:rP,gasConstant:tP,gravity:nP,klitzing:aP,loschmidt:iP,magneticConstant:oP,molarMass:sP,molarPlanckConstant:uP,neutronMass:lP,nuclearMagneton:cP,permutations:fP,planckConstant:mP,planckMass:vP,planckTime:pP,protonMass:dP,quantumOfCirculation:hP,reducedPlanckConstant:gP,secondRadiation:yP,setSize:bP,speedOfLight:xP,stefanBoltzmann:wP,thomsonCrossSection:DP,avogadro:NP,bohrRadius:EP,coulombConstant:AP,divide:it,elementaryCharge:SP,faraday:CP,freqz:MP,gravitationConstant:_P,inverseConductanceQuantum:TP,lusolve:fh,magneticFluxQuantum:FP,molarMassC12:OP,multinomial:BP,planckCharge:RP,planckTemperature:IP,quantileSeq:PP,rydberg:$P,setIntersect:mh,solveODE:qP,stirlingS2:vh,unit:zP,bellNumbers:UP,electricConstant:LP,firstRadiation:kP,hartreeEnergy:VP,kldivergence:GP,mean:ph,molarVolume:HP,planckLength:WP,setUnion:YP,variance:gu,classicalElectronRadius:ZP,corr:JP,median:dh,parse:Kt,polynomialRoot:jP,resolve:Sh,simplifyConstant:xu,std:XP,zeta:QP,compile:a6,evaluate:Vo,mad:KP,simplifyCore:wu,help:i6,norm:yu,rotationMatrix:hh,simplify:Go,symbolicEqual:o6,derivative:s6,parser:u6,rotate:e6,leafCount:l6,rationalize:c6,schur:gh,sylvester:yh,lyap:r6,config:ye}),zr(bi,za,{map:AR({typed:W}),filter:hR({typed:W}),forEach:bR({typed:W}),mapSlices:uR({isInteger:bt,typed:W}),or:h5({DenseMatrix:sr,concat:xr,equalScalar:cr,matrix:Ce,typed:W}),and:v5({add:dr,concat:xr,equalScalar:cr,matrix:Ce,not:qo,typed:W,zeros:at}),cumsum:o5({add:dr,typed:W,unaryPlus:lu}),max:TR({config:ye,isNaN:gn,larger:xt,numeric:Vt,typed:W}),nullish:b5({deepEqual:hi,flatten:aa,matrix:Ce,size:Zr,typed:W}),print:c5({add:dr,matrix:Ce,typed:W,zeros:at}),bitAnd:D5({add:dr,concat:xr,equalScalar:cr,matrix:Ce,not:qo,typed:W,zeros:at}),concat:ZR({isInteger:bt,matrix:Ce,typed:W}),diff:jR({bignumber:Et,matrix:Ce,number:an,subtract:Lr,typed:W}),min:PR({config:ye,isNaN:gn,numeric:Vt,smaller:wt,typed:W}),subset:HR({add:dr,matrix:Ce,typed:W,zeros:at}),bitOr:A5({DenseMatrix:sr,concat:xr,equalScalar:cr,matrix:Ce,typed:W}),sum:r5({add:dr,config:ye,numeric:Vt,typed:W}),index:DR({Index:ft,getMatrixDataType:tu}),row:kR({Index:ft,matrix:Ce,range:qa,typed:W}),column:fR({Index:ft,matrix:Ce,range:qa,typed:W}),mean:BR({add:dr,divide:it,typed:W}),range:zR({bignumber:Et,matrix:Ce,add:dr,config:ye,equal:yt,isPositive:sa,isZero:kt,larger:xt,largerEq:Lo,smaller:wt,smallerEq:$a,typed:W}),variance:u5({add:dr,divide:it,isNaN:gn,mapSlices:di,multiply:Dr,subtract:Lr,typed:W}),quantileSeq:a5({add:dr,bignumber:Et,compare:ua,divide:it,isInteger:bt,larger:xt,mapSlices:di,multiply:Dr,partitionSelect:ko,smaller:wt,smallerEq:$a,subtract:Lr,typed:W}),std:KR({map:zn,sqrt:Xt,typed:W,variance:gu})}),zr(bh,{BigNumber:Me,Complex:Mr,Fraction:qn,Matrix:Io,Node:mt,ObjectNode:Ua,OperatorNode:yn,ParenthesisNode:ca,Range:q5,RelationalNode:xh,ResultSet:Pd,ArrayNode:La,BlockNode:wh,ConditionalNode:Dh,DenseMatrix:sr,RangeNode:Nh,Chain:bu,FunctionAssignmentNode:Eh,SparseMatrix:Jr,ConstantNode:kn,IndexNode:ka,FibonacciHeap:jd,ImmutableDenseMatrix:Qd,Index:ft,Spa:rh,AccessorNode:Va,AssignmentNode:Ah,Unit:Qe,SymbolNode:Vn,FunctionNode:Gn,Help:Ch,Parser:Mh}),bu.createProxy(za);const ot=class ot{constructor(){}static GetExpressions(e,t){let n=[];for(var a=0,i="";e.length>0;){if(!this.HasFunctionInside(e)&&e.indexOf(",")==-1){n.push(new vt(e));break}if(e.substring(a,a+1)=="("){var o=this.FindEnd(e);if(o==-1)throw"Unbalanced brackets!!!! Expression:"+e;i!=""&&(n.push(new Hn(i)),i=""),n.push(new vt(e.substring(0,o+1))),o<e.length?e=e.substring(o+1):e="";continue}if(e.startsWith("N.%")){i!=""&&(n.push(new Hn(i)),i="");var l=e.substring(3).indexOf("%")+1;n.push(new wn(e.substring(2,l+3),!0)),e=e.substring(l+3);continue}if(e.substring(0,1)=="%"){i!=""&&(n.push(new Hn(i)),i="");var l=e.substring(1).indexOf("%")+1;n.push(new wn(e.substring(0,l+1),!1)),e=e.substring(l+1);continue}if(e.substring(a,a+1)==","){i!=""&&(n.push(new vt(i)),i=""),n.push(new St(e.substring(0,1),"")),1<e.length?e=e.substring(1):e="";continue}var u=!1;if(We.operators.forEach(m=>{if(e.startsWith(m)){i!=""&&(n.push(new vt(i)),i=""),n.push(new Ei(e.substring(0,m.length))),e=e.substring(m.length),u=!0;return}}),u)continue;for(let m=0;m<We.logicaloperators.length;m++){let v=We.logicaloperators[m];if(e.startsWith(v)){i!=""&&(n.push(new vt(i)),i=""),n.push(new Yo(e.substring(0,v.length))),e=e.substring(v.length),u=!0;break}}if(u)continue;var s=!1;let f=e.toLowerCase();var c=Object.keys(ot._suportedFunctions);for(let m=0;m<c.length;m++){let v=c[m];if(f.startsWith(v)){i!=""&&(n.push(new vt(i)),i="");var o=this.FindEnd(e);if(o==-1)throw"Unbalanced brackets!!!! Expression:"+e;let d=Reflect.construct(ot._suportedFunctions[v],[e.substring(0,o+1),v]);n.push(d),o<e.length?e=e.substring(o+1):e="",s=!0;break}}s||(i+=e.substring(0,1),e=e.substring(1))}return i!=""&&(n.push(new vt(i)),i=""),n}static HasFunctionInside(e){if(e==null||e=="")return!1;var t=!1;const n=e.toLowerCase();return Object.keys(ot._suportedFunctions).forEach(a=>{if(n.indexOf(a)!=-1){t=!0;return}}),t}static StartsWithFunction(e){const t=e.toLowerCase();var n=!1;return Object.keys(ot._suportedFunctions).forEach(a=>{if(t.startsWith(a)){n=!0;return}}),n}static FindEnd(e){for(var t=0,n=0,a=0;a<e.length;a++)if(e.substring(a,a+1)=="("?n++:e.substring(a,a+1)==")"&&t++,n>0&&n==t)return a;return-1}static ConcatValues(e,t,n,a,i){if(e==null)return null;if(e.length==1)return e[0].Evaluate(t,n,a,i);let o="";for(let l=0;l<e.length;l++){let u=e[l].Evaluate(t,n,a,i);typeof u=="number"?o+=u.toString():u instanceof Date?o+=u.toISOString():o+=u}return o}static CastToTypeNet(e,t){let n=null;if(t==null)return null;switch(e.TypeNET){case"decimal":{n=parseFloat(t);break}case"int":{n=parseInt(t);break}case"bool":{this.toString().toLowerCase()=="true"||this.toString().toLowerCase()=="false"||(n=t);break}default:{n=t;break}}return n}static ParseAndFillExpression(e,t,n,a,i,o,l){if(n==null)return null;var u=ot.ParseExpressionAndReturnValue(e,n,t,a,0);if(console.log(t.FieldName+" "+e+" "+u),u!=null)if(t.Type=="decimal"||t.Type=="int")try{if(u=="0/0")return a.Record[t.FieldName]=0,0;if(u=="*(-1)")return null;const c=Vo(u);return console.log(t.FieldName+" "+e+" RET: "+u+" EVAL:"+c),c}catch{if(l)return console.log(t.FieldName+" "+e+" Err: 0"),0;var s=ot.CastToTypeNet(t,u);return console.log(t.FieldName+" "+e+" Err: "+s),s}else{var s=ot.CastToTypeNet(t,u);return console.log(t.FieldName+" "+e+" Ret: "+s),s}else return console.log(t.FieldName+" "+e+" Value: "+u),u}static ParseExpressionAndReturnValue(e,t,n,a,i){var s;if(e==null||t==null)return null;let o=null;try{o=ot.GetExpressions(e,null)}catch{debugger}if(o==null)return null;o[0]instanceof vt;var l=a.Record;if(o.length==1){var u=o[0].Evaluate(t,a,l,n);if(u==null)return null;if(u instanceof Date){if(n.TypeDDD=="Date")return We.getIsoDate(u);if(n.TypeDDD=="DateTime")return We.getIsoDateTime(u)}else if(typeof u=="number")return u.toString();return u.toString()}return(s=ot.ConcatValues(o,t,a,l,n))==null?void 0:s.toString()}static ValueExpresion(e,t,n,a){var g;if(t=="null")return null;if(!t.startsWith("%")&&!t.endsWith("%"))return t;let i="";try{i=t.substring(1,t.length-1)}catch(b){throw e!=null?e.FieldName+" "+e.ValueExpression+" Expression:"+t+b:t+b}var o=i.split("."),l=o[0];switch(l){case"V":return n.GetValues(o[1]);case"E":{const b=o[1],A=o[2];if(b.toLowerCase()=="eu_scr")return n.ExternalTables.EU_SCR[A];if(b.toLowerCase()=="session"){for(var u=n.ExternalTables.Session,s=2;s<o.length;s++)if(u[o[s]]!=null)u=u[o[s]];else return null;return u}else return""}case"S":{if(n.Settings==null||n.Settings[o[1]]==null)throw"Can't find setting for "+o[1];var c=n.Settings[o[1]];return c.Value}default:{if(o.length==2){var f=o[0],m=o[1];if(f==((g=a==null?void 0:a.Parent)==null?void 0:g.Tablename)){var v=ot.ReturnFromObject(a.Record,m);if(v.found===!0)return v.return}var p=n.FindTableLevel(f);if(p!=null){if(p.Record!=null){var d=p.Record,v=ot.ReturnFromObject(d.Record,m);if(v.found===!0)return v.return;if(v.found===!1&&m=="InvIssueDate")return null;if(v.found===!1&&m.indexOf("__")!=-1){var y=ot.ReturnFromObject(d.Record,m);if(y.found===!0)return y.return}return null}else if(p.Records!=null){var x=p.Records,D=x.Records.filter(b=>b==a);if(D.length>0){var h=D[0],w=h.Record,v=ot.ReturnFromObject(w,m);if(v.found===!0)return v.return;if(v.found===!1&&m.indexOf("__")!=-1){var y=ot.ReturnFromObject(h.Record,m);if(y.found===!0)return y.return}if(m=="ItemRetailPriceInp"||m=="ItemVatCodeSC__VCCode_EN16931")return null;throw"Can't evaluate "+t+" key:"+e.FieldName}}}}break}}return null}static ReturnFromObject(e,t){return Object.keys(e).indexOf(t)==-1?{found:!1,return:null}:e[t]==null?{found:!0,return:null}:e[t]instanceof Date?{found:!0,return:e[t]}:{found:!0,return:e[t].toString()}}};ot._suportedFunctions={"tonull(":i0,"sum(":qh,"if(":$h,"calcdate(":zh,"addleadzeros(":Ih,"starts(":Uh,"substr(":Lh,"count(":kh,"check(":Gh,"concat(":Vh,"empty(":Bu,"nonempty(":Bu,"exists(":Ou,"notexists(":Ou,"noeval(":o0,"appear(":Ph,"value(":Wh,"year(":Jh,"month(":jh,"screxists(":f0,"inlist(":Tu,"notinlist(":Tu,"indetail(":Fu,"notindetail(":Fu,"upper(":_u,"lower(":_u,"trim(":Hh,"totalminutes(":s0,"datetimeformat(":a0,"time(":u0,"clean(":Xh,"fromcodelist(":c0,"len(":l0,"registrycheck(":Zh,"extract(":Qh,"usefirst(":Yh};let He=ot;class Ft{static GetRecords(e,t){return t.GetReferenceRecords("__VatRate")}static SumByFieldNameAndVarCode(e,t,n){var a=this.GetRecords(t,n);if(a==null)return 0;for(var i=0,o=0;o<a.length;o++)i+=a[o].Record[e]??0;return i}static GetFirstRecordItem(e,t){var n=this.GetRecords(e,t);return n==null?null:n[0]}}class f6{static Execute(e,t,n,a){if(t==null)return"Invoice object is null";switch(e.FieldName){case"VatInvAllowAmount":{n.SetValueToKey(e,Ft.SumByFieldNameAndVarCode("LineInvAllowAmount",t,n),a);break}case"VatTaxableAmount":{n.SetValueToKey(e,Ft.SumByFieldNameAndVarCode("LineTotalNetAmount",t,n),a);break}case"VatTaxAmount":{n.SetValueToKey(e,Ft.SumByFieldNameAndVarCode("LineTotalVatAmount",t,n),a);break}case"VatInvChargeAmount":{n.SetValueToKey(e,Ft.SumByFieldNameAndVarCode("LineTotalVatAmount",t,n),a);break}case"VatInvAllowBaseAmount":{n.SetValueToKey(e,Ft.SumByFieldNameAndVarCode("LineBaseAmountInclAllow",t,n),a);break}case"VatInvChargeBaseAmount":{n.SetValueToKey(e,Ft.SumByFieldNameAndVarCode("LineTotalVatAmount",t,n),a);break}case"VatCatCode":{var i=Ft.GetFirstRecordItem(t,n);i!=null&&n.SetValueToKey(e,i.RecordAnalitic.ItemVatCodeSC__VCCode_EN16931,a);break}case"VatCode":{var i=Ft.GetFirstRecordItem(t,n);i!=null&&n.SetValueToKey(e,i.RecordAnalitic.ItemVatCodeSC__VatCode,a);break}case"VatRate":{var i=Ft.GetFirstRecordItem(t,n);i!=null&&n.SetValueToKey(e,i.RecordAnalitic.ItemVatCodeSC__Rate,a);break}case"VatCodeUI":{var i=Ft.GetFirstRecordItem(t,n);i!=null&&n.SetValueToKey(e,i.RecordAnalitic.ItemVatCodeSC__GroupUIVatCode,a);break}case"VatExemptReasonDesc":{var o=Ft.GetRecords(t,n);if(o!=null&&o.length>0){for(var l=new Set,u=0;u<o.length;u++){var s=o[u];if(s.Record.ItemVatCodeSC__VatCode=="E_999"){l.add(s.Record.VatExemReasonDescE_999??"");continue}l.add(s.RecordAnalitic.ItemVatCodeSC__VERDesc??"")}const c=new Set([...l].filter(f=>f!=""));c.size>0?n.SetValueToKey(e,[...c].join(", "),a):n.SetValueToKey(e,null,a)}break}case"VatExemptReasonCode":{var i=Ft.GetFirstRecordItem(t,n);i!=null&&n.SetValueToKey(e,null,a);break}case"NumOfItems":{var o=Ft.GetRecords(t,n);o!=null&&n.SetValueToKey(e,o.length,a);break}}}}class m6{static Execute(e,t,n,a){if(t==null)return"Invoice object is null";switch(e.FieldName){case"LineIdent":{var i=this.GetRecords(t),o=i.indexOf(n)+1;n.SetValueToKey(e,o,a);break}}}static GetRecords(e){var t=e.FindTableLevel("EU_Invoices_Items");if(t==null)throw Error("Can't find level EU_Invoices_Items");var n=t.Records;return(n==null?void 0:n.Records)??[]}}const bn=class bn{static IsDetailTable(e){return this._objectTablesDetail.indexOf(e)!=-1}static isMultiple(e){return e=="EU_Invoices_Items_Classes"||e=="EU_Invoices_Items_AllowsCharges"||e=="EU_Invoices_CN_IICRefs_Items"||e=="EU_Invoices_AdvanceUsage"||e=="EU_Invoices_AdvanceUsageVatCode"||e=="EU_Invoices_Items_Attributes"}static GetMultipleParent(e){return this.__multipleParent[e]?this.__multipleParent[e]:null}static GetTableForAlias(e){return this._dicAliasMap[e]??e}static GetTableFromAlias(e){for(var t=Object.keys(this._dicAliasMap),n=0;n<t.length;n++)if(this._dicAliasMap[t[n]]==e)return t[n];return e}};bn.masterEntity="EU_Invoices",bn.itemsEntity="EU_Invoices_Items",bn.vatEntity="EU_Invoices_Vats",bn.paymentInstrsEntity="EU_Invoices_PaymentInstrs",bn._objectTablesDetail=["EU_Invoices_Items","EU_Invoices_Items_Classes","EU_Invoices_Items_Attributes","EU_Invoices_Items_AllowsCharges","EU_Invoices_Errors","EU_Invoices_PaymentInstrs","EU_Invoices_Vats","EU_Invoices_VatsFisc","EU_Invoices_VatsCatCode","EU_Invoices_VatsUI","EU_Invoices_PrecedInvs","EU_Invoices_AllowsCharges","EU_Invoices_AddRefDocs","EU_Invoices_AdvanceUsage"],bn._dicAliasMap={EU_Invoices:"Invoice",EU_Invoices_CN_IICRefs:"CreditNoteRefs",EU_Invoices_Items:"Items",EU_Invoices_PaymentInstrs:"Payments",EU_Invoices_AddRefDocs:"Attachments",EU_Invoices_Items_Classes:"ItemsClasses",EU_Invoices_Items_Attributes:"ItemsAttributes",EU_Invoices_Items_Incomes:"ItemsIncomes",EU_Invoices_Items_Expenses:"ItemsExpenses",EU_Invoices_Items_AllowsCharges:"ItemsAllowsCharges"},bn.__multipleParent={EU_Invoices_Items_Classes:"EU_Invoices_Items",EU_Invoices_Items_AllowsCharges:"EU_Invoices_Items",EU_Invoices_CN_IICRefs_Items:"EU_Invoices_Items",EU_Invoices_Items_Attributes:"EU_Invoices_Items",EU_Invoices_Items_Incomes:"EU_Invoices_Items",EU_Invoices_Items_Expenses:"EU_Invoices_Items"};let Ot=bn;class Ga{constructor(e,t,n){if(this.Details=null,this.IsDefaultRecord=!1,this._LeftInstance=null,this._referenceRecords=null,this.RecordAnalitic={},this.Parent=n,e._details!=null){var a={},i=Object.keys(e._details);i.forEach(o=>{var l;a[o]=new xn(o,e._details[o],t,((l=this.Parent)==null?void 0:l.Root)??null)}),this.Details=a,delete e._details}this.Record={}}SetReferenceRecords(e,t){this._referenceRecords==null&&(this._referenceRecords=new Map),this._referenceRecords.set(e,t)}GetReferenceRecords(e){return this._referenceRecords==null?null:this._referenceRecords.get(e)??null}SetLeftInstanceReference(e){this._LeftInstance=e}GetLeftInstanceReference(){return this._LeftInstance}AddDetail(e,t){this.Details==null&&(this.Details={}),this.Details[e]=t}GetDetail(e){return this.Details==null?null:this.Details[e]}HasDetails(e){return this.Details==null?!1:this.Details[e]!=null}SetValueToKey(e,t,n){if(n!=null&&n==this.Record&&(this.RecordAnalitic[e.FieldName]=t),t==null){this.Record[e.FieldName]=null;return}if(e.FieldName!=null){if(typeof t=="string")switch(e.Type){case"int":{t=parseInt(t);break}case"decimal":{t=parseFloat(t);break}case"bool":case"boolean":{t=i=>i.trim().toLowerCase()==="true";break}}if(e.RoundTo!=null){var a=e.RoundTo;typeof t=="number"&&(t=this.roundUp(t,a))}}this.Record[e.FieldName]=t}SetValueToKeyString(e,t,n){if(n!=null&&(this.RecordAnalitic[e]=t),t==null){this.Record[e]=null;return}this.Record[e]=t}roundUp(e,t){let n=!1;e<0?n=!0:n=!1,n?e=e-10**-13:e=e+10**-13,e=Math.abs(e);let a=Math.round(e*Math.pow(10,t))/Math.pow(10,t);return n?-1*a:a}GetObject(){var e=JSON.parse(JSON.stringify(this.Record));if(this.Details!=null){let t=JSON.parse("{}");for(let n=0;n<this.Details.length;n++){let a=this.Details[n].GetObject();a!=null&&(t[this.Details[n].Tablename]=a)}e._details=t}return e}TranslateObj(e){if(this.Details!=null)for(let i=0;i<this.Details.length;i++)this.Details[i].TranslateObj(e);var t=Object.keys(this.Record),n=Object.keys(e),a=t.filter(i=>n.indexOf(i)!=-1);a.length>0&&a.forEach(i=>{var o=e[i].data[this.Record[e[i].key]];o!=null&&(this.Record[i]=e[i].data[this.Record[e[i].key]])})}MapToId(e){e.length!=0&&e.forEach(t=>{this.MapToIdItem(t)})}MapToIdItem(e){var d,y,x,D;if(e==null)return null;var t={},n=e.FieldName,a=Object.keys(this.Record),i=Object.keys((((y=(d=this.Parent)==null?void 0:d.Root)==null?void 0:y.ObjectInfo)??{})[e.TableName??""]).filter(h=>h.startsWith(n+"__")),o=a.filter(h=>h.startsWith(n+"__"));e.FieldName=="ItemVatCodeSC";for(let h=0;h<o.length;h++){var l=o[h].substring((n+"__").length);this.Record[o[h]]!=null&&(t[l]=this.Record[o[h]])}if(Object.keys(t).length==0||e.ConnTable==null)return null;var u=(D=(x=this.Parent)==null?void 0:x.Root)==null?void 0:D.CodeListCache[e.ConnTable],s=Object.keys(t);let c=u;for(let h=0;h<s.length;h++){var f=s[h];if(c=c.filter(w=>w[f]==t[f]),c.length==0)return null}if(c.length>1)throw"More than 1 record found for "+e.FieldName+" with value "+JSON.stringify(t);var m=c[0];this.Record[e.FieldName]=m[e.ByKey??"Id"];for(let h=0;h<i.length;h++){var f=i[h],v=f.substring((n+"__").length);this.Record[f]=m[v]}var p=Object.keys(m);for(let h=0;h<p.length;h++){var f=p[h];this.RecordAnalitic[e.FieldName+"__"+f]=m[f]}}EvaluateInner(e){e.length!=0&&e.forEach(t=>{var a,i,o,l,u;if(((i=(a=this.Parent)==null?void 0:a.Root)==null?void 0:i.EvalType)=="Init"){if(this.Record[t.FieldName]==null&&t.ValueExpressionInit!=null){var n=He.ParseAndFillExpression(t.ValueExpressionInit,t,((o=this==null?void 0:this.Parent)==null?void 0:o.Root)??null,this,this.Record,!0,!1);this.Record[t.FieldName]=n}}else((u=(l=this.Parent)==null?void 0:l.Root)==null?void 0:u.EvalType)=="Eval"&&this.Evaluate(t)})}Evaluate(e){var a,i,o,l;if(!(e.EvalOnlyIfEmpty===!0&&this.Record[e.FieldName]!=null)){if(e.EvaluateOnlyIF!=null){var t=He.ParseExpressionAndReturnValue(e.EvaluateOnlyIF,((a=this==null?void 0:this.Parent)==null?void 0:a.Root)??null,e,this,0);if(t==null||t.toUpperCase()!="TRUE")return}if(e.ValueExpression!=null){var n=He.ParseAndFillExpression(e.ValueExpression,e,((i=this==null?void 0:this.Parent)==null?void 0:i.Root)??null,this,this.Record,!0,!1);this.SetValueToKey(e,n,this.Record)}else this.Record[e.FieldName]==null&&this.SetValueToKey(e,null,this.Record);switch(e.GetValueFrom){case"Code":{switch(e.TableName){case"EU_Invoices_VatsUI":{f6.Execute(e,((o=this.Parent)==null?void 0:o.Root)??null,this,this.Record);break}case"EU_Invoices_Items":{m6.Execute(e,((l=this.Parent)==null?void 0:l.Root)??null,this,this.Record);break}}break}}}}ParseExpressionAndReturnValue(e,t){return this.ParseExpressionAndReturnValueNew(e,t)}ParseExpressionAndReturnValueNew(e,t){var a;if(((a=this.Parent)==null?void 0:a.Root)==null)return null;var n=He.ParseAndFillExpression(e,t,this.Parent.Root,this,this.Record,!1,!1);return n}valueToType(e){return e==null||e=="null"?null:typeof e!="string"?e:e.toLocaleLowerCase()=="true"?!0:e.toLocaleLowerCase()=="false"?!1:isNaN(parseFloat(e))?e:parseFloat(e)}ValueExpresion(e){var i,o,l;if(e==null)return null;if(!e.startsWith("%")||!e.endsWith("%"))return this.valueToType(e);let n=e.substring(1,e.length-1).split(".");var a=n[0];switch(a){case"V":return console.warn("V not supported!"),null;case"E":{const u=n[1];if(u!="EU_AOrg"){if(u!="EU_SCR"){if(u!="Session")return console.warn("Other E not supported!"),null}}break}case"S":return console.warn("S not supported!"),null;default:{if(n.length==2){const u=n[0];if(u==((i=this.Parent)==null?void 0:i.Tablename))return this.Record[n[1]];{let s=(l=(o=this.Parent)==null?void 0:o.Root)==null?void 0:l.FindTableLevel(u);if(s!=null&&s.Record!=null&&(s==null?void 0:s.Record)!=null)return this.valueToType(s==null?void 0:s.Record.Record[n[1]])}}break}}return null}getSaveObject(e){var i,o,l;const t={};if(this.Details!=null){const u={};for(let s=0;s<this.Details.length;s++){const c=this.Details[s].getSaveObject(e);c!=null&&(u[this.Details[s].Tablename]=c)}Object.keys(u).length>0&&(t._details=u)}if(((i=this.Parent)==null?void 0:i.Tablename)==null)return null;const n=e[(o=this.Parent)==null?void 0:o.Tablename],a=Object.keys(n);for(let u=0;u<a.length;u++){const s=a[u];switch(n[s].TypeDDD){case"Date":{t[s]=We.getIsoDate(this.Record[s]);break}case"DateTime":{t[s]=We.getIsoDateTime(this.Record[s]);break}default:{t[s]=this.Record[s];break}}}return this.Record.Id!=null&&(t.Id=this.Record.Id),((l=this.Parent)==null?void 0:l.Tablename)=="EU_Invoices",Object.keys(t).length>0?t:null}getFullObject(e){var o,l,u;const t={};if(this.Details!=null){const s={};var n=Object.keys(this.Details);for(let c=0;c<n.length;c++){const f=this.Details[n[c]].getFullObject(e);f!=null&&(s[this.Details[n[c]].Tablename]=f)}Object.keys(s).length>0&&(t._details=s)}if(((o=this.Parent)==null?void 0:o.Tablename)==null)return null;const a=e[(l=this.Parent)==null?void 0:l.Tablename],i=Object.keys(a);for(let s=0;s<i.length;s++){const c=i[s];switch(a[c].Type){case"Date":{t[c]=We.getIsoDate(this.Record[c]);break}case"DateTime":{t[c]=We.getIsoDateTime(this.Record[c]);break}default:{t[c]=this.Record[c];break}}}return this.Record.Id!=null&&(t.Id=this.Record.Id),((u=this.Parent)==null?void 0:u.Tablename)=="EU_Invoices"&&(t.InvTotalVatAmountCCInp=this.Record.InvTotalVatAmountCC,t.InvAmountInclVatInp=this.Record.InvAmountInclVat),Object.keys(t).length>0?t:null}GetTableForAlias(e){var o,l,u;const t={};if(this.Details!=null){const s={};var n=Object.keys(this.Details);for(let c=0;c<n.length;c++){const f=this.Details[n[c]].GetTableForAlias(e);f!=null&&(s[Ot.GetTableForAlias(this.Details[n[c]].Tablename)]=f)}Object.keys(s).length>0&&(t._details=s)}if(((o=this.Parent)==null?void 0:o.Tablename)==null)return null;const a=e[(l=this.Parent)==null?void 0:l.Tablename],i=Object.keys(a);for(let s=0;s<i.length;s++){const c=i[s],f=a[c].Type,m=a[c].Alias??c;switch(f){case"Date":{t[m]=We.getIsoDate(this.Record[c]);break}case"DateTime":{t[m]=We.getIsoDateTime(this.Record[c]);break}default:{t[m]=this.Record[c];break}}}return this.Record.Id!=null&&(t.Id=this.Record.Id),((u=this.Parent)==null?void 0:u.Tablename)=="EU_Invoices"&&(t.InvTotalVatAmountCCInp=this.Record.InvTotalVatAmountCC,t.InvAmountInclVatInp=this.Record.InvAmountInclVat),Object.keys(t).length>0?t:null}Validate(){}}class Du{constructor(e,t,n){this.Records=[],this.Parent=n,this.ObjectInfo=t,this.Records.push(new Ga(e,t,n))}MapToId(e){if(this.Records!=null)for(let t=0;t<this.Records.length;t++)this.Records[t].MapToId(e)}EvaluateInner(e){if(this.Records!=null)for(let n=0;n<this.Records.length;n++){var t=this.Records[n];try{t.EvaluateInner(e)}catch{debugger}}}TranslateObj(e){if(this.Records.length!=0)for(let t=0;t<this.Records.length;t++)this.Records[t].TranslateObj(e)}GetObject(){if(this.Records.length==0)return null;var e=[];for(let t=0;t<this.Records.length;t++)e.push(this.Records[t].GetObject());return e}getSaveObject(e){var a;if(this.Records==null)return null;var t=[];if(((a=this.Parent)==null?void 0:a.Tablename)=="EU_Invoices_Items_Classes"&&this.Records.length==1){var n=this.Records[0];if(n.Record.ItemClassCodeSchID==null&&n.Record.ItemClassCode==null)return t}for(let i=0;i<this.Records.length;i++)t.push(this.Records[i].getSaveObject(e));return t}getFullObject(e){if(this.Records==null)return null;var t=[];for(let n=0;n<this.Records.length;n++)t.push(this.Records[n].getFullObject(e));return t}GetTableForAlias(e){if(this.Records==null)return null;var t=[];for(let n=0;n<this.Records.length;n++)t.push(this.Records[n].GetTableForAlias(e));return t}Validate(){if(this.Records==null)return null;const e={};for(let i=0;i<this.Records.length;i++){let o=this.Records[i].Validate();o!=null&&(e[i.toString()]=o)}if(Object.keys(e).length==0)return null;const t=Object.keys(e);let n="",a={};for(let i=0;i<t.length;i++){let o="";const l=t[i];let u=e[l];u.missingKeys!=null&&(o="Missing mandatory keys:"+u.missingKeys),o!=null&&(n+="Errors on index "+l+": "+o,a.push([l,u.missingKeys]))}return{errorMessage:n==""?null:n,validateDetailsErrors:a}}}class _h{constructor(e,t,n){this.rootLevel=null,this.LeftObject=null,this.ExternalTables={},this.Settings=null,this._dicValues={},this.EvalType="Init",this.Mappings=null,this.CodeListCache={},this.InvoiceStructure={},this.Legislation=e,this.LeftObject=t,this.ObjectInfo=(n==null?void 0:n.OI)??{},this.CodeListCache=(n==null?void 0:n.CodeList)??{},this.InvoiceStructure=(n==null?void 0:n.InvoiceStructure)??{},this.ExternalTables=(n==null?void 0:n.External)??{},this.Settings=(n==null?void 0:n.Settings)??{},this.prepareValues()}prepareValues(){const e=new Date;this._dicValues={NOW:this.formatDateTime(e),DATE:this.formatDate(e),LEGISLATION:this.Legislation}}static isMultiple(e){return e=="EU_Invoices_Items_Classes"||e=="EU_Invoices_Items_AllowsCharges"||e=="EU_Invoices_CN_IICRefs_Items"||e=="EU_Invoices_AdvanceUsage"||e=="EU_Invoices_AdvanceUsageVatCode"}InitAfterConst(){}formatDate(e){return e.getFullYear()+"-"+this.formatToTwoNumber(e.getMonth()+1)+"-"+this.formatToTwoNumber(e.getDate())}formatDateTime(e){return e.getFullYear()+"-"+this.formatToTwoNumber(e.getMonth()+1)+"-"+this.formatToTwoNumber(e.getDate())+"T"+this.formatToTwoNumber(e.getHours())+":"+this.formatToTwoNumber(e.getMinutes())+":"+this.formatToTwoNumber(e.getSeconds())}formatToTwoNumber(e){return e<10?"0"+e:e.toString()}GetValues(e){var t=e.toUpperCase();return this._dicValues[t]!=null?this._dicValues[t]:null}FindTableLevel(e){var t=this.RecursiveFindLevel(this.rootLevel,e);return t??(console.error("Can't find level "+e),null)}RecursiveFindLevel(e,t){if(e==null&&(e=this.rootLevel),e==null)return null;if((e==null?void 0:e.Tablename)==t)return e;if(e.Record!=null&&e.Record.Details!=null){var n=Object.keys(e.Record.Details);for(let a=0;a<n.length;a++){const i=this.RecursiveFindLevel(e.Record.Details[n[a]],t);if(i!=null)return i}}return null}GetObject(){var e;return(e=this.rootLevel)==null?void 0:e.GetObject()}SumByKey(e){var t=e.split(","),n=t[0].split(".");if(n.length!=2)throw"Key isn't well formmed! "+e;var a=this.RecursiveFindLevel(this.rootLevel,n[0]);if(a==null)throw"Can't find table level "+n[0];let i=null;if(t.length==2){var o=t[1].split(".");i=o[1]}let l=0;if(a.Records!=null)for(var u=a.Records,s=0;s<u.Records.length;s++){const c=u.Records[s];if(c.Record[n[1]]!=null){if(i!=null&&!c.Record[i])continue;l+=c.Record[n[1]]}}return l}getSaveObject(){return{}}getFullObject(){var t,n;const e={};return e[((t=this.rootLevel)==null?void 0:t.Tablename)??"EU_Invoices"]=(n=this.rootLevel)==null?void 0:n.getFullObject(this.ObjectInfo),e}getAliasObject(){var t;const e={};return e[Ot.GetTableForAlias("EU_Invoices")]=(t=this.rootLevel)==null?void 0:t.GetTableForAlias(this.ObjectInfo),e}ValidateBeforeSave(){}TranslateObj(e){var t;(t=this.rootLevel)==null||t.TranslateObj(e)}prepareSchemaStruct(){var e=[],t=Object.keys(this.ObjectInfo);return t.forEach(n=>{var a=Object.keys(this.ObjectInfo[n]);a.forEach(i=>{e.push(this.ObjectInfo[n][i])})}),e}Evaluate(){this.rootLevel=new xn("EU_Invoices",this.InvoiceStructure.EU_Invoices,this.ObjectInfo,this);var e=this.prepareSchemaStruct(),t=e.filter(n=>n.ValueExpressionInit!=null);return this.InicializeEval("Init",t),this.FillInvoiceDataIntoObjStuct(this.LeftObject,e,this.ObjectInfo,!1),console.log(this.getFullObject()),t=e.filter(n=>n.EvalStep=="PRE"&&(n.ValueExpression!=null||n.GetValueFrom=="Mappings"||n.GetValueFrom=="Code")),this.InicializeEval("Eval",t),t=e.filter(n=>n.ConnField),this.MapToId(t),t=e.filter(n=>n.EvalStep=="EVAL"),this.InicializeEval("Eval",t),t=e.filter(n=>n.EvalStep=="POST"&&n.Group=="Vats"),this.vatsPrepare(t),t=e.filter(n=>n.EvalStep=="POST"&&n.Group!="Vats"),this.InicializeEval("Eval",t),!0}InicializeEval(e,t){if(this.EvalType=e,t.length==0)return!0;try{var n=t.sort((o,l)=>(o.CalcPhase??0)-(l.CalcPhase??0)),a=[],i=null;for(let o=0;o<n.length;o++){const l=n[o];if(i==null){i=l.TableName,a.push(l);continue}i!=l.TableName&&(this.InicializeEvalInner(i??"",a),a=[],i=l.TableName),a.push(l)}a.length>0&&this.InicializeEvalInner(i??"",a)}catch(o){return console.error(o),!1}return!0}FillInvoiceDataIntoObjStuct(e,t,n,a){var le,me,Y,z,X,se,re;var i=(le=this.rootLevel)==null?void 0:le.Record;if(t.length>0){const pe=a?Ot.masterEntity:"Invoice";var o=e[pe],l=o._details,u=new Map,s=this.RecursiveFindLevel(null,Ot.masterEntity),i=s==null?void 0:s.Record,c=this.groupBy(t,"TableName"),f=Object.keys(c);if(o!=null||l!=null)for(var m=0;m<f.length;m++){var v=f[m],p=c[v];if(v==Ot.masterEntity){if(o==null||i==null)continue;for(var d=0;d<p.length;d++){var y=p[d];this.setValueForObject(o,i,y,a,null)}}else if(Ot.IsDetailTable(v)){if(l==null)continue;if(Ot.isMultiple(v)){u.set(v,p);continue}var x=a?v:Ot.GetTableForAlias(v);if(l[x]==null||l[x].length==0)continue;var D=this.RecursiveFindLevel(this.rootLevel,v);if(D==null||D==null)continue;var h=[],w=l[x],g={};if((D==null?void 0:D.Records)!=null&&((me=D.Records)==null?void 0:me.Records.length)>0){var b=D.Records.Records[0];b.IsDefaultRecord=!1;for(var A=Object.keys(b.Record),N=0;N<A.length;N++){var E=A[N];g[E]=b.Record[E]}}for(var d=0;d<w.length;d++){for(var S=JSON.parse(JSON.stringify(g)),C=w[d],M=new Ga(S,n,D),O=0;O<p.length;O++){var y=p[O];this.setValueForObject(C,M,y,a,null)}M.SetLeftInstanceReference(C),h.push(M)}D.Records!=null&&(D.Records.Records=h)}}else for(var I=t.filter(Oe=>Oe.FromInputKey!=null),c=this.groupBy(I,"TableName"),m=0;m<f.length;m++){var v=f[m],p=c[v];if(v==Ot.masterEntity&&i!=null)for(var d=0;d<p.length;d++){var y=p[d];this.setValueForObject(o,i,y,a,null)}else{var x=Ot.GetTableForAlias(v),D=this.RecursiveFindLevel(null,v);if(D==null)continue;var h=[],k="",w=this.FindJArray(e,((z=(Y=p[0])==null?void 0:Y.FromInputKey)==null?void 0:z.split("."))??[],k),g={};if(((X=D.Records)==null?void 0:X.Records)==null||D.Records.Records.length===0||D.Records.Records[0].Record==null)continue;for(var _=D.Records.Records[0].Record,P=Object.keys(_),N=0;N<P.length;N++){var E=P[N];g[E]=_.Record[E]}for(var m=0;m<w.length;m++){for(var S=JSON.parse(JSON.stringify(g)),C=w[m],M=new Ga(S,n,D),O=0;O<p.length;O++){var y=p[O];this.setValueForObject(C,M,y,a,null)}M.SetLeftInstanceReference(C),h.push(M)}D.Records=new Du(h,n,D)}}if(u.size>0)return;for(const[De,Oe]of u){var V=Ot.GetMultipleParent(De);if(V==null)throw"Can't find parent for multiple table "+De;var q=this.RecursiveFindLevel(this.rootLevel,V);if(q!=null)for(var J=((se=q.Records)==null?void 0:se.Records)??[],m=0;m<(J==null?void 0:J.length);m++){var ne=J[m].GetLeftInstanceReference();if(ne==null)continue;var j=ne._details;if(j==null)continue;var F=j[De];if(F==null||F.length==0)continue;let _e=null;if(J[m].HasDetails(De)){if(_e=J[m].GetDetail(De),_e==null)continue}else _e=new xn(De,[],this.ObjectInfo,this),J[m].AddDetail(De,_e);for(var U=(re=_e.Records)==null?void 0:re.Records,$=[],m=0;m<F.Count;m++){let qe=null;U&&U.length>m?qe=U[m]:(qe=new Ga({},this.ObjectInfo,_e),$.push(qe));for(var O=0;O<Oe.length;O++){var y=Oe[O];this.setValueForObject(C,qe,y,a,null)}}}}}}FindJArray(e,t,n){if(t.length==0)return null;if(n!=""&&(n+="."),n+=t[0],e[t[0]]!=null&&Array.isArray(e[t[0]])){var a=e[t[0]],i=JSON.parse(JSON.stringify(t));return i.splice(0,1),a.length==1&&t.length>2?this.FindJArray(a[0],i,n):a}var o=JSON.parse(JSON.stringify(t));return o.splice(0,1),this.FindJArray(e[t[0]],o,n)}setValueForObject(e,t,n,a,i){if(e!=null){if(n==null){debugger;return}var o=a?n.FieldName:n.AliasExport??n.FieldName;if(e[o]!=null){var l=t.Record;t.SetValueToKey(n,e[o],l)}else if(n.FromInputKey!=null)for(var u=n.FromInputKey.split("??"),s=0;s<u.length;s++){var c=u[s];if(i!=null&&(c=c.replace(i+".","")),e.Get(c)!=null){var l=t.Record;t.SetValueToKey(n,e.Get(c),l)}}}}InicializeEvalInner(e,t){var n=this.RecursiveFindLevel(null,e);return n==null?!1:(n.Evaluate(t),!0)}MapToId(e){if(e.length==0)return!0;try{var t=e.sort((i,o)=>(i.CalcPhase??0)-(o.CalcPhase??0)),n=[],a=null;for(let i=0;i<t.length;i++){const o=t[i];if(a==null){a=o.TableName,n.push(o);continue}a!=o.TableName&&(this.MapToIdInner(a??"",n),n=[],a=o.TableName),n.push(o)}n.length>0&&this.MapToIdInner(a??"",n)}catch{return!1}return!0}MapToIdInner(e,t){var n=this.RecursiveFindLevel(null,e);return n==null?!1:(n.MapToId(t),!0)}vatsPrepare(e){var l;if(e.length!=0){var t=this.RecursiveFindLevel(null,"EU_Invoices_Items"),n=this.groupBy(e,"TableName");for(const u in n){var a=this.RecursiveFindLevel(null,u);a==null&&(a=new xn(u,[],this.ObjectInfo,this)),a.Records==null&&(a.Records=new Du([],this.ObjectInfo[u],a));var i={};(l=t==null?void 0:t.Records)==null||l.Records.forEach(c=>{var f=c.Record.VatsUIGroupKey;i[f]==null&&(i[f]=[]),i[f].push(c)});var o=[];Object.keys(i).forEach(c=>{var f={};f.__VatRate=c;var m=new Ga({},this.ObjectInfo,a);m.Record=f,m.SetReferenceRecords("__VatRate",i[c]),o.push(m)}),a.Records.Records=o;const s=n[u];a.Evaluate(s)}}}groupBy(e,t){return e.reduce((n,a)=>{const i=String(a[t]);return(n[i]||(n[i]=[])).push(a),n},{})}}class Th{static hasKey(e){return this.getFromSessionStorage(e)!=null}static getFromSessionStorage(e){return localStorage.getItem(e)}static setToSessionStorage(e,t){typeof t=="object"&&(t=JSON.stringify(t)),localStorage.setItem(e,t)}}(function(r,e){typeof At=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis<"u"?globalThis:r||self).axios=e()})(void 0,function(){function r(B){return r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},r(B)}function e(B,Z){if(!(B instanceof Z))throw new TypeError("Cannot call a class as a function")}function t(B,Z){for(var te=0;te<Z.length;te++){var ae=Z[te];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(B,ae.key,ae)}}function n(B,Z,te){return Z&&t(B.prototype,Z),te&&t(B,te),Object.defineProperty(B,"prototype",{writable:!1}),B}function a(B,Z){return function(te){if(Array.isArray(te))return te}(B)||function(te,ae){var ce=te==null?null:typeof Symbol<"u"&&te[Symbol.iterator]||te["@@iterator"];if(ce!=null){var fe,ge,Ae=[],Ee=!0,Fe=!1;try{for(ce=ce.call(te);!(Ee=(fe=ce.next()).done)&&(Ae.push(fe.value),!ae||Ae.length!==ae);Ee=!0);}catch(Re){Fe=!0,ge=Re}finally{try{Ee||ce.return==null||ce.return()}finally{if(Fe)throw ge}}return Ae}}(B,Z)||function(te,ae){if(te){if(typeof te=="string")return i(te,ae);var ce=Object.prototype.toString.call(te).slice(8,-1);if(ce==="Object"&&te.constructor&&(ce=te.constructor.name),ce==="Map"||ce==="Set")return Array.from(te);if(ce==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ce))return i(te,ae)}}(B,Z)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
61
|
+
In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]},TF={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]},FF={name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]},OF={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","variance"]},BF={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]},RF={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]},IF={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]},PF={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]},$F={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]},qF={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]},zF={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]},UF={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]},LF={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]},kF={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},VF={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]},GF={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]},HF={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]},WF={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]},YF={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]},ZF={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]},JF={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]},jF={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]},XF={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]},QF={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]},KF={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]},e3={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]},r3={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]},t3={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]},n3={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]},a3={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]},i3={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]},o3={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]},s3={name:"toBest",category:"Units",syntax:["toBest(x)","toBest(x, unitList)","toBest(x, unitList, options)"],description:"Converts to the most appropriate display unit.",examples:['toBest(unit(5000, "m"))','toBest(unit(3500000, "W"))','toBest(unit(0.000000123, "A"))','toBest(unit(10, "m"), "cm")','toBest(unit(10, "m"), "mm,km", {offset: 1.5})'],seealso:[]},u3={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]},l3={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]},c3={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]},f3={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]},m3={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]},v3={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]},p3={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero","isFinite","isBounded"]},d3={name:"isBounded",category:"Utils",syntax:["isBounded(x)"],description:"Test whether a value or its entries are bounded.",examples:["isBounded(Infinity)","isBounded(bigint(3))","isBounded([3, -Infinity, -3])"],seealso:["isFinite","isNumeric","isNaN","isNegative","isPositive"]},h3={name:"isFinite",category:"Utils",syntax:["isFinite(x)"],description:"Test whether a value is finite, elementwise on collections.",examples:["isFinite(Infinity)","isFinite(bigint(3))","isFinite([3, -Infinity, -3])"],seealso:["isBounded","isNumeric","isNaN","isNegative","isPositive"]},g3={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]},y3={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue","isFinite","isBounded"]},b3={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},x3={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},w3={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]},D3={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "bigint")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","bigint","fraction","bignumber","string","format"]},N3={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]},E3={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]},A3={name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]},S3={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]},C3={bignumber:iM,bigint:oM,boolean:sM,complex:uM,createUnit:lM,fraction:cM,index:fM,matrix:mM,number:vM,sparse:pM,splitUnit:dM,string:hM,unit:gM,e:wp,E:wp,false:GC,i:HC,Infinity:WC,LN2:ZC,LN10:YC,LOG2E:jC,LOG10E:JC,NaN:XC,null:QC,pi:Dp,PI:Dp,phi:KC,SQRT1_2:eM,SQRT2:rM,tau:tM,true:nM,version:aM,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant. Deprecated in favor of coulombConstant",examples:["coulombConstant"]},coulombConstant:{description:"Coulomb's constant",examples:["coulombConstant"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Bohr magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Bohr radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:wM,lsolve:NM,lsolveAll:EM,lup:AM,lusolve:SM,leafCount:DM,polynomialRoot:CM,resolve:TM,simplify:FM,simplifyConstant:OM,simplifyCore:BM,symbolicEqual:IM,rationalize:_M,slu:RM,usolve:PM,usolveAll:$M,qr:MM,abs:qM,add:zM,cbrt:UM,ceil:LM,cube:kM,divide:VM,dotDivide:GM,dotMultiply:HM,dotPow:WM,exp:YM,expm:ZM,expm1:JM,fix:jM,floor:XM,gcd:QM,hypot:KM,lcm:r_,log:t_,log2:i_,log1p:a_,log10:n_,mod:o_,multiply:s_,norm:u_,nthRoot:l_,nthRoots:c_,pow:f_,round:m_,sign:v_,sqrt:p_,sqrtm:d_,square:b_,subtract:x_,unaryMinus:w_,unaryPlus:D_,xgcd:N_,invmod:e_,num:E_,den:A_,bitAnd:S_,bitNot:C_,bitOr:M_,bitXor:__,leftShift:T_,rightArithShift:F_,rightLogShift:O_,bellNumbers:B_,catalan:R_,composition:I_,stirlingS2:P_,config:yM,import:bM,typed:xM,arg:$_,conj:q_,re:U_,im:z_,evaluate:L_,help:H_,parse:V_,parser:k_,compile:G_,distance:W_,intersect:Y_,and:Z_,not:J_,nullish:j_,or:X_,xor:Q_,mapSlices:K_,concat:rT,count:tT,cross:nT,column:eT,ctranspose:aT,det:iT,diag:oT,diff:sT,dot:uT,getMatrixDataType:vT,identity:pT,filter:cT,flatten:fT,forEach:mT,inv:dT,pinv:hT,eigs:lT,kron:gT,matrixFromFunction:xT,matrixFromRows:wT,matrixFromColumns:bT,map:yT,ones:DT,partitionSelect:NT,range:ET,resize:ST,reshape:AT,rotate:CT,rotationMatrix:MT,row:_T,size:TT,sort:FT,squeeze:OT,subset:BT,trace:RT,transpose:IT,zeros:PT,fft:$T,ifft:qT,sylvester:h_,schur:g_,lyap:y_,solveODE:S3,bernoulli:zT,combinations:UT,combinationsWithRep:LT,factorial:kT,gamma:VT,kldivergence:HT,lgamma:GT,multinomial:WT,permutations:YT,pickRandom:ZT,random:JT,randomInt:jT,compare:XT,compareNatural:QT,compareText:KT,deepEqual:eF,equal:rF,equalText:tF,larger:nF,largerEq:aF,smaller:iF,smallerEq:oF,unequal:sF,setCartesian:uF,setDifference:lF,setDistinct:cF,setIntersect:fF,setIsSubset:mF,setMultiplicity:vF,setPowerset:pF,setSize:dF,setSymDifference:hF,setUnion:gF,zpk2tf:yF,freqz:bF,erf:xF,zeta:wF,cumsum:FF,mad:DF,max:NF,mean:EF,median:AF,min:SF,mode:CF,prod:MF,quantileSeq:_F,std:TF,sum:OF,variance:BF,corr:RF,acos:IF,acosh:PF,acot:$F,acoth:qF,acsc:zF,acsch:UF,asec:LF,asech:kF,asin:VF,asinh:GF,atan:HF,atanh:YF,atan2:WF,cos:ZF,cosh:JF,cot:jF,coth:XF,csc:QF,csch:KF,sec:e3,sech:r3,sin:t3,sinh:n3,tan:a3,tanh:i3,to:o3,toBest:s3,clone:l3,format:c3,bin:u3,oct:N3,hex:m3,isNaN:p3,isBounded:d3,isFinite:h3,isInteger:v3,isNegative:g3,isNumeric:y3,hasNumericValue:f3,isPositive:b3,isPrime:x3,isZero:w3,print:E3,typeOf:A3,numeric:D3},Np="help",M3=["typed","mathWithTransform","Help"],_3=L(Np,M3,r=>{var{typed:e,mathWithTransform:t,Help:n}=r;return e(Np,{any:function(i){var o,l=i;if(typeof i!="string"){for(o in t)if($e(t,o)&&i===t[o]){l=o;break}}var u=pt(C3,l);if(!u){var s=typeof l=="function"?l.name:l;throw new Error('No documentation found on "'+s+'"')}return new n(u)}})}),Ep="chain",T3=["typed","Chain"],F3=L(Ep,T3,r=>{var{typed:e,Chain:t}=r;return e(Ep,{"":function(){return new t},any:function(a){return new t(a)}})}),Ap="det",O3=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],B3=L(Ap,O3,r=>{var{typed:e,matrix:t,subtractScalar:n,multiply:a,divideScalar:i,isZero:o,unaryMinus:l}=r;return e(Ap,{any:function(c){return er(c)},"Array | Matrix":function(c){var f;switch(Je(c)?f=c.size():Array.isArray(c)?(c=t(c),f=c.size()):f=[],f.length){case 0:return er(c);case 1:if(f[0]===1)return er(c.valueOf()[0]);if(f[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(f)+")");case 2:{var m=f[0],v=f[1];if(m===v)return u(c.clone().valueOf(),m);if(v===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(f)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(f)+")")}}});function u(s,c,f){if(c===1)return er(s[0][0]);if(c===2)return n(a(s[0][0],s[1][1]),a(s[1][0],s[0][1]));for(var m=!1,v=new Array(c).fill(0).map((A,N)=>N),p=0;p<c;p++){var d=v[p];if(o(s[d][p])){var y=void 0;for(y=p+1;y<c;y++)if(!o(s[v[y]][p])){d=v[y],v[y]=v[p],v[p]=d,m=!m;break}if(y===c)return s[d][p]}for(var x=s[d][p],D=p===0?1:s[v[p-1]][p-1],h=p+1;h<c;h++)for(var w=v[h],g=p+1;g<c;g++)s[w][g]=i(n(a(s[w][g],x),a(s[w][p],s[d][g])),D)}var b=s[v[c-1]][c-1];return m?l(b):b}}),Sp="inv",R3=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],I3=L(Sp,R3,r=>{var{typed:e,matrix:t,divideScalar:n,addScalar:a,multiply:i,unaryMinus:o,det:l,identity:u,abs:s}=r;return e(Sp,{"Array | Matrix":function(m){var v=Je(m)?m.size():rr(m);switch(v.length){case 1:if(v[0]===1)return Je(m)?t([n(1,m.valueOf()[0])]):[n(1,m[0])];throw new RangeError("Matrix must be square (size: "+lr(v)+")");case 2:{var p=v[0],d=v[1];if(p===d)return Je(m)?t(c(m.valueOf(),p,d),m.storage()):c(m,p,d);throw new RangeError("Matrix must be square (size: "+lr(v)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(v)+")")}},any:function(m){return n(1,m)}});function c(f,m,v){var p,d,y,x,D;if(m===1){if(x=f[0][0],x===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,x)]]}else if(m===2){var h=l(f);if(h===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(f[1][1],h),n(o(f[0][1]),h)],[n(o(f[1][0]),h),n(f[0][0],h)]]}else{var w=f.concat();for(p=0;p<m;p++)w[p]=w[p].concat();for(var g=u(m).valueOf(),b=0;b<v;b++){var A=s(w[b][b]),N=b;for(p=b+1;p<m;)s(w[p][b])>A&&(A=s(w[p][b]),N=p),p++;if(A===0)throw Error("Cannot calculate inverse, determinant is zero");p=N,p!==b&&(D=w[b],w[b]=w[p],w[p]=D,D=g[b],g[b]=g[p],g[p]=D);var E=w[b],S=g[b];for(p=0;p<m;p++){var C=w[p],M=g[p];if(p!==b){if(C[b]!==0){for(y=n(o(C[b]),E[b]),d=b;d<v;d++)C[d]=a(C[d],i(y,E[d]));for(d=0;d<v;d++)M[d]=a(M[d],i(y,S[d]))}}else{for(y=E[b],d=b;d<v;d++)C[d]=n(C[d],y);for(d=0;d<v;d++)M[d]=n(M[d],y)}}}return g}}}),Cp="pinv",P3=["typed","matrix","inv","deepEqual","equal","dotDivide","dot","ctranspose","divideScalar","multiply","add","Complex"],$3=L(Cp,P3,r=>{var{typed:e,matrix:t,inv:n,deepEqual:a,equal:i,dotDivide:o,dot:l,ctranspose:u,divideScalar:s,multiply:c,add:f,Complex:m}=r;return e(Cp,{"Array | Matrix":function(h){var w=Je(h)?h.size():rr(h);switch(w.length){case 1:return x(h)?u(h):w[0]===1?n(h):o(u(h),l(h,h));case 2:{if(x(h))return u(h);var g=w[0],b=w[1];if(g===b)try{return n(h)}catch(A){if(!(A instanceof Error&&A.message.match(/Cannot calculate inverse, determinant is zero/)))throw A}return Je(h)?t(v(h.valueOf(),g,b),h.storage()):v(h,g,b)}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(w)+")")}},any:function(h){return i(h,0)?er(h):s(1,h)}});function v(D,h,w){var{C:g,F:b}=d(D,h,w),A=c(n(c(u(g),g)),u(g)),N=c(u(b),n(c(b,u(b))));return c(N,A)}function p(D,h,w){for(var g=er(D),b=0,A=0;A<h;A++){if(w<=b)return g;for(var N=A;y(g[N][b]);)if(N++,h===N&&(N=A,b++,w===b))return g;[g[N],g[A]]=[g[A],g[N]];for(var E=g[A][b],S=0;S<w;S++)g[A][S]=o(g[A][S],E);for(var C=0;C<h;C++)if(C!==A){E=g[C][b];for(var M=0;M<w;M++)g[C][M]=f(g[C][M],c(-1,c(E,g[A][M])))}b++}return g}function d(D,h,w){var g=p(D,h,w),b=D.map((N,E)=>N.filter((S,C)=>C<h&&!y(l(g[C],g[C])))),A=g.filter((N,E)=>!y(l(g[E],g[E])));return{C:b,F:A}}function y(D){return i(f(D,m(1,1)),f(0,m(1,1)))}function x(D){return a(f(D,m(1,1)),f(c(D,0),m(1,1)))}});function q3(r){var{addScalar:e,subtract:t,flatten:n,multiply:a,multiplyScalar:i,divideScalar:o,sqrt:l,abs:u,bignumber:s,diag:c,size:f,reshape:m,inv:v,qr:p,usolve:d,usolveAll:y,equal:x,complex:D,larger:h,smaller:w,matrixFromColumns:g,dot:b}=r;function A(j,F,U,$){var le=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,me=N(j,F,U,$,le);E(j,F,U,$,le,me);var{values:Y,C:z}=S(j,F,U,$,le);if(le){var X=C(j,F,z,me,Y,U,$);return{values:Y,eigenvectors:X}}return{values:Y}}function N(j,F,U,$,le){var me=$==="BigNumber",Y=$==="Complex",z=me?s(0):0,X=me?s(1):Y?D(1):1,se=me?s(1):1,re=me?s(10):2,pe=i(re,re),ve;le&&(ve=Array(F).fill(X));for(var De=!1;!De;){De=!0;for(var Oe=0;Oe<F;Oe++){for(var Ie=z,_e=z,Le=0;Le<F;Le++)Oe!==Le&&(Ie=e(Ie,u(j[Le][Oe])),_e=e(_e,u(j[Oe][Le])));if(!x(Ie,0)&&!x(_e,0)){for(var qe=se,G=Ie,ee=o(_e,re),R=i(_e,re);w(G,ee);)G=i(G,pe),qe=i(qe,re);for(;h(G,R);)G=o(G,pe),qe=o(qe,re);var H=w(o(e(G,_e),qe),i(e(Ie,_e),.95));if(H){De=!1;for(var Q=o(1,qe),ie=0;ie<F;ie++)Oe!==ie&&(j[Oe][ie]=i(j[Oe][ie],Q),j[ie][Oe]=i(j[ie][Oe],qe));le&&(ve[Oe]=i(ve[Oe],Q))}}}}return le?c(ve):null}function E(j,F,U,$,le,me){var Y=$==="BigNumber",z=$==="Complex",X=Y?s(0):z?D(0):0;Y&&(U=s(U));for(var se=0;se<F-2;se++){for(var re=0,pe=X,ve=se+1;ve<F;ve++){var De=j[ve][se];w(u(pe),u(De))&&(pe=De,re=ve)}if(!w(u(pe),U)){if(re!==se+1){var Oe=j[re];j[re]=j[se+1],j[se+1]=Oe;for(var Ie=0;Ie<F;Ie++){var _e=j[Ie][re];j[Ie][re]=j[Ie][se+1],j[Ie][se+1]=_e}if(le){var Le=me[re];me[re]=me[se+1],me[se+1]=Le}}for(var qe=se+2;qe<F;qe++){var G=o(j[qe][se],pe);if(G!==0){for(var ee=0;ee<F;ee++)j[qe][ee]=t(j[qe][ee],i(G,j[se+1][ee]));for(var R=0;R<F;R++)j[R][se+1]=e(j[R][se+1],i(G,j[R][qe]));if(le)for(var H=0;H<F;H++)me[qe][H]=t(me[qe][H],i(G,me[se+1][H]))}}}}return me}function S(j,F,U,$,le){var me=$==="BigNumber",Y=$==="Complex",z=me?s(1):Y?D(1):1;me&&(U=s(U));for(var X=er(j),se=[],re=F,pe=[],ve=le?c(Array(F).fill(z)):void 0,De=le?c(Array(re).fill(z)):void 0,Oe=0;Oe<=100;){Oe+=1;for(var Ie=X[re-1][re-1],_e=0;_e<re;_e++)X[_e][_e]=t(X[_e][_e],Ie);var{Q:Le,R:qe}=p(X);X=a(qe,Le);for(var G=0;G<re;G++)X[G][G]=e(X[G][G],Ie);if(le&&(De=a(De,Le)),re===1||w(u(X[re-1][re-2]),U)){Oe=0,se.push(X[re-1][re-1]),le&&(pe.unshift([[1]]),I(De,F),ve=a(ve,De),re>1&&(De=c(Array(re-1).fill(z)))),re-=1,X.pop();for(var ee=0;ee<re;ee++)X[ee].pop()}else if(re===2||w(u(X[re-2][re-3]),U)){Oe=0;var R=M(X[re-2][re-2],X[re-2][re-1],X[re-1][re-2],X[re-1][re-1]);se.push(...R),le&&(pe.unshift(O(X[re-2][re-2],X[re-2][re-1],X[re-1][re-2],X[re-1][re-1],R[0],R[1],U,$)),I(De,F),ve=a(ve,De),re>2&&(De=c(Array(re-2).fill(z)))),re-=2,X.pop(),X.pop();for(var H=0;H<re;H++)X[H].pop(),X[H].pop()}if(re===0)break}if(se.sort((ue,oe)=>+t(u(ue),u(oe))),Oe>100){var Q=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+se.join(", "));throw Q.values=se,Q.vectors=[],Q}var ie=le?a(ve,k(pe,F)):void 0;return{values:se,C:ie}}function C(j,F,U,$,le,me,Y){var z=v(U),X=a(z,j,U),se=Y==="BigNumber",re=Y==="Complex",pe=se?s(0):re?D(0):0,ve=se?s(1):re?D(1):1,De=[],Oe=[];for(var Ie of le){var _e=_(De,Ie,x);_e===-1?(De.push(Ie),Oe.push(1)):Oe[_e]+=1}for(var Le=[],qe=De.length,G=Array(F).fill(pe),ee=c(Array(F).fill(ve)),R=function(){var ie=De[H],ue=t(X,a(ie,ee)),oe=y(ue,G);for(oe.shift();oe.length<Oe[H];){var we=P(ue,F,oe,me,Y);if(we===null)break;oe.push(we)}var xe=a(v($),U);oe=oe.map(Te=>a(xe,Te)),Le.push(...oe.map(Te=>({value:ie,vector:n(Te)})))},H=0;H<qe;H++)R();return Le}function M(j,F,U,$){var le=e(j,$),me=t(i(j,$),i(F,U)),Y=i(le,.5),z=i(l(t(i(le,le),i(4,me))),.5);return[e(Y,z),t(Y,z)]}function O(j,F,U,$,le,me,Y,z){var X=z==="BigNumber",se=z==="Complex",re=X?s(0):se?D(0):0,pe=X?s(1):se?D(1):1;if(w(u(U),Y))return[[pe,re],[re,pe]];if(h(u(t(le,me)),Y))return[[t(le,$),t(me,$)],[U,U]];var ve=t(j,le),De=t($,le);return w(u(F),Y)&&w(u(De),Y)?[[ve,pe],[U,re]]:[[F,re],[De,pe]]}function I(j,F){for(var U=0;U<j.length;U++)j[U].push(...Array(F-j[U].length).fill(0));for(var $=j.length;$<F;$++)j.push(Array(F).fill(0)),j[$][$]=1;return j}function k(j,F){for(var U=[],$=0;$<F;$++)U[$]=Array(F).fill(0);var le=0;for(var me of j){for(var Y=me.length,z=0;z<Y;z++)for(var X=0;X<Y;X++)U[le+z][le+X]=me[z][X];le+=Y}return U}function _(j,F,U){for(var $=0;$<j.length;$++)if(U(j[$],F))return $;return-1}function P(j,F,U,$,le){for(var me=le==="BigNumber"?s(1e3):1e3,Y,z=0;z<5;++z){Y=V(F,U,le);try{Y=d(j,Y)}catch{continue}if(h(J(Y),me))break}if(z>=5)return null;for(z=0;;){var X=d(j,Y);if(w(J(q(Y,[X])),$))break;if(++z>=10)return null;Y=ne(X)}return Y}function V(j,F,U){var $=U==="BigNumber",le=U==="Complex",me=Array(j).fill(0).map(Y=>2*Math.random()-1);return $&&(me=me.map(Y=>s(Y))),le&&(me=me.map(Y=>D(Y))),me=q(me,F),ne(me,U)}function q(j,F){var U=f(j);for(var $ of F)$=m($,U),j=t(j,a(o(b($,j),b($,$)),$));return j}function J(j){return u(l(b(j,j)))}function ne(j,F){var U=F==="BigNumber",$=F==="Complex",le=U?s(1):$?D(1):1;return a(o(le,J(j)),j)}return A}function z3(r){var{config:e,addScalar:t,subtract:n,abs:a,atan:i,cos:o,sin:l,multiplyScalar:u,inv:s,bignumber:c,multiply:f,add:m}=r;function v(E,S){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.relTol,M=arguments.length>3?arguments[3]:void 0,O=arguments.length>4?arguments[4]:void 0;if(M==="number")return p(E,C,O);if(M==="BigNumber")return d(E,C,O);throw TypeError("Unsupported data type: "+M)}function p(E,S,C){var M=E.length,O=Math.abs(S/M),I,k;if(C){k=new Array(M);for(var _=0;_<M;_++)k[_]=Array(M).fill(0),k[_][_]=1}for(var P=b(E);Math.abs(P[1])>=Math.abs(O);){var V=P[0][0],q=P[0][1];I=y(E[V][V],E[q][q],E[V][q]),E=g(E,I,V,q),C&&(k=D(k,I,V,q)),P=b(E)}for(var J=Array(M).fill(0),ne=0;ne<M;ne++)J[ne]=E[ne][ne];return N(er(J),k,C)}function d(E,S,C){var M=E.length,O=a(S/M),I,k;if(C){k=new Array(M);for(var _=0;_<M;_++)k[_]=Array(M).fill(0),k[_][_]=1}for(var P=A(E);a(P[1])>=a(O);){var V=P[0][0],q=P[0][1];I=x(E[V][V],E[q][q],E[V][q]),E=w(E,I,V,q),C&&(k=h(k,I,V,q)),P=A(E)}for(var J=Array(M).fill(0),ne=0;ne<M;ne++)J[ne]=E[ne][ne];return N(er(J),k,C)}function y(E,S,C){var M=S-E;return Math.abs(M)<=e.relTol?Math.PI/4:.5*Math.atan(2*C/(S-E))}function x(E,S,C){var M=n(S,E);return a(M)<=e.relTol?c(-1).acos().div(4):u(.5,i(f(2,C,s(M))))}function D(E,S,C,M){for(var O=E.length,I=Math.cos(S),k=Math.sin(S),_=Array(O).fill(0),P=Array(O).fill(0),V=0;V<O;V++)_[V]=I*E[V][C]-k*E[V][M],P[V]=k*E[V][C]+I*E[V][M];for(var q=0;q<O;q++)E[q][C]=_[q],E[q][M]=P[q];return E}function h(E,S,C,M){for(var O=E.length,I=o(S),k=l(S),_=Array(O).fill(c(0)),P=Array(O).fill(c(0)),V=0;V<O;V++)_[V]=n(u(I,E[V][C]),u(k,E[V][M])),P[V]=t(u(k,E[V][C]),u(I,E[V][M]));for(var q=0;q<O;q++)E[q][C]=_[q],E[q][M]=P[q];return E}function w(E,S,C,M){for(var O=E.length,I=c(o(S)),k=c(l(S)),_=u(I,I),P=u(k,k),V=Array(O).fill(c(0)),q=Array(O).fill(c(0)),J=f(c(2),I,k,E[C][M]),ne=t(n(u(_,E[C][C]),J),u(P,E[M][M])),j=m(u(P,E[C][C]),J,u(_,E[M][M])),F=0;F<O;F++)V[F]=n(u(I,E[C][F]),u(k,E[M][F])),q[F]=t(u(k,E[C][F]),u(I,E[M][F]));E[C][C]=ne,E[M][M]=j,E[C][M]=c(0),E[M][C]=c(0);for(var U=0;U<O;U++)U!==C&&U!==M&&(E[C][U]=V[U],E[U][C]=V[U],E[M][U]=q[U],E[U][M]=q[U]);return E}function g(E,S,C,M){for(var O=E.length,I=Math.cos(S),k=Math.sin(S),_=I*I,P=k*k,V=Array(O).fill(0),q=Array(O).fill(0),J=_*E[C][C]-2*I*k*E[C][M]+P*E[M][M],ne=P*E[C][C]+2*I*k*E[C][M]+_*E[M][M],j=0;j<O;j++)V[j]=I*E[C][j]-k*E[M][j],q[j]=k*E[C][j]+I*E[M][j];E[C][C]=J,E[M][M]=ne,E[C][M]=0,E[M][C]=0;for(var F=0;F<O;F++)F!==C&&F!==M&&(E[C][F]=V[F],E[F][C]=V[F],E[M][F]=q[F],E[F][M]=q[F]);return E}function b(E){for(var S=E.length,C=0,M=[0,1],O=0;O<S;O++)for(var I=O+1;I<S;I++)Math.abs(C)<Math.abs(E[O][I])&&(C=Math.abs(E[O][I]),M=[O,I]);return[M,C]}function A(E){for(var S=E.length,C=0,M=[0,1],O=0;O<S;O++)for(var I=O+1;I<S;I++)a(C)<a(E[O][I])&&(C=a(E[O][I]),M=[O,I]);return[M,C]}function N(E,S,C){var M=E.length,O=Array(M),I;if(C){I=Array(M);for(var k=0;k<M;k++)I[k]=Array(M)}for(var _=0;_<M;_++){for(var P=0,V=E[0],q=0;q<E.length;q++)a(E[q])<a(V)&&(P=q,V=E[P]);if(O[_]=E.splice(P,1)[0],C)for(var J=0;J<M;J++)I[_][J]=S[J][P],S[J].splice(P,1)}if(!C)return{values:O};var ne=I.map((j,F)=>({value:O[F],vector:j}));return{values:O,eigenvectors:ne}}return v}var U3="eigs",L3=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],k3=L(U3,L3,r=>{var{config:e,typed:t,matrix:n,addScalar:a,subtract:i,equal:o,abs:l,atan:u,cos:s,sin:c,multiplyScalar:f,divideScalar:m,inv:v,bignumber:p,multiply:d,add:y,larger:x,column:D,flatten:h,number:w,complex:g,sqrt:b,diag:A,size:N,reshape:E,qr:S,usolve:C,usolveAll:M,im:O,re:I,smaller:k,matrixFromColumns:_,dot:P}=r,V=z3({config:e,addScalar:a,subtract:i,abs:l,atan:u,cos:s,sin:c,multiplyScalar:f,inv:v,bignumber:p,multiply:d,add:y}),q=q3({addScalar:a,subtract:i,multiply:d,multiplyScalar:f,flatten:h,divideScalar:m,sqrt:b,abs:l,bignumber:p,diag:A,size:N,reshape:E,qr:S,inv:v,usolve:C,usolveAll:M,equal:o,complex:g,larger:x,smaller:k,matrixFromColumns:_,dot:P});return t("eigs",{Array:function(me){return J(n(me))},"Array, number|BigNumber":function(me,Y){return J(n(me),{precision:Y})},"Array, Object"(le,me){return J(n(le),me)},Matrix:function(me){return J(me,{matricize:!0})},"Matrix, number|BigNumber":function(me,Y){return J(me,{precision:Y,matricize:!0})},"Matrix, Object":function(me,Y){var z={matricize:!0};return zr(z,Y),J(me,z)}});function J(le){var me,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z="eigenvectors"in Y?Y.eigenvectors:!0,X=(me=Y.precision)!==null&&me!==void 0?me:e.relTol,se=ne(le,X,z);return Y.matricize&&(se.values=n(se.values),z&&(se.eigenvectors=se.eigenvectors.map(re=>{var{value:pe,vector:ve}=re;return{value:pe,vector:n(ve)}}))),z&&Object.defineProperty(se,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),se}function ne(le,me,Y){var z=le.toArray(),X=le.size();if(X.length!==2||X[0]!==X[1])throw new RangeError("Matrix must be square (size: ".concat(lr(X),")"));var se=X[0];if(F(z,se,me)&&(U(z,se),j(z,se,me))){var re=$(le,z,se);return V(z,se,me,re,Y)}var pe=$(le,z,se);return q(z,se,me,pe,Y)}function j(le,me,Y){for(var z=0;z<me;z++)for(var X=z;X<me;X++)if(x(p(l(i(le[z][X],le[X][z]))),Y))return!1;return!0}function F(le,me,Y){for(var z=0;z<me;z++)for(var X=0;X<me;X++)if(x(p(l(O(le[z][X]))),Y))return!1;return!0}function U(le,me){for(var Y=0;Y<me;Y++)for(var z=0;z<me;z++)le[Y][z]=I(le[Y][z])}function $(le,me,Y){var z=le.datatype();if(z==="number"||z==="BigNumber"||z==="Complex")return z;for(var X=!1,se=!1,re=!1,pe=0;pe<Y;pe++)for(var ve=0;ve<Y;ve++){var De=me[pe][ve];if(Ye(De)||Ka(De))X=!0;else if(or(De))se=!0;else if(ln(De))re=!0;else throw TypeError("Unsupported type in Matrix: "+Sr(De))}if(se&&re&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),re){for(var Oe=0;Oe<Y;Oe++)for(var Ie=0;Ie<Y;Ie++)me[Oe][Ie]=g(me[Oe][Ie]);return"Complex"}if(se){for(var _e=0;_e<Y;_e++)for(var Le=0;Le<Y;Le++)me[_e][Le]=p(me[_e][Le]);return"BigNumber"}if(X){for(var qe=0;qe<Y;qe++)for(var G=0;G<Y;G++)me[qe][G]=w(me[qe][G]);return"number"}else throw TypeError("Matrix contains unsupported types only.")}}),Mp="expm",V3=["typed","abs","add","identity","inv","multiply"],G3=L(Mp,V3,r=>{var{typed:e,abs:t,add:n,identity:a,inv:i,multiply:o}=r;return e(Mp,{Matrix:function(f){var m=f.size();if(m.length!==2||m[0]!==m[1])throw new RangeError("Matrix must be square (size: "+lr(m)+")");for(var v=m[0],p=1e-15,d=l(f),y=u(d,p),x=y.q,D=y.j,h=o(f,Math.pow(2,-D)),w=a(v),g=a(v),b=1,A=h,N=-1,E=1;E<=x;E++)E>1&&(A=o(A,h),N=-N),b=b*(x-E+1)/((2*x-E+1)*E),w=n(w,o(b,A)),g=n(g,o(b*N,A));for(var S=o(i(g),w),C=0;C<D;C++)S=o(S,S);return Yn(f)?f.createSparseMatrix(S):S}});function l(c){for(var f=c.size()[0],m=0,v=0;v<f;v++){for(var p=0,d=0;d<f;d++)p+=t(c.get([v,d]));m=Math.max(p,m)}return m}function u(c,f){for(var m=30,v=0;v<m;v++)for(var p=0;p<=v;p++){var d=v-p;if(s(c,p,d)<f)return{q:p,j:d}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}function s(c,f,m){for(var v=1,p=2;p<=f;p++)v*=p;for(var d=v,y=f+1;y<=2*f;y++)d*=y;var x=d*(2*f+1);return 8*Math.pow(c/Math.pow(2,m),2*f)*v*v/(d*x)}}),_p="sqrtm",H3=["typed","abs","add","multiply","map","sqrt","subtract","inv","size","max","identity"],W3=L(_p,H3,r=>{var{typed:e,abs:t,add:n,multiply:a,map:i,sqrt:o,subtract:l,inv:u,size:s,max:c,identity:f}=r,m=1e3,v=1e-6;function p(d){var y,x=0,D=d,h=f(s(d));do{var w=D;if(D=a(.5,n(w,u(h))),h=a(.5,n(h,u(w))),y=c(t(l(D,w))),y>v&&++x>m)throw new Error("computing square root of matrix: iterative method could not converge")}while(y>v);return D}return e(_p,{"Array | Matrix":function(y){var x=Je(y)?y.size():rr(y);switch(x.length){case 1:if(x[0]===1)return i(y,o);throw new RangeError("Matrix must be square (size: "+lr(x)+")");case 2:{var D=x[0],h=x[1];if(D===h)return p(y);throw new RangeError("Matrix must be square (size: "+lr(x)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+lr(x)+")")}}})}),Tp="sylvester",Y3=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],Z3=L(Tp,Y3,r=>{var{typed:e,schur:t,matrixFromColumns:n,matrix:a,multiply:i,range:o,concat:l,transpose:u,index:s,subset:c,add:f,subtract:m,identity:v,lusolve:p,abs:d,config:y}=r;return e(Tp,{"Matrix, Matrix, Matrix":x,"Array, Matrix, Matrix":function(h,w,g){return x(a(h),w,g)},"Array, Array, Matrix":function(h,w,g){return x(a(h),a(w),g)},"Array, Matrix, Array":function(h,w,g){return x(a(h),w,a(g))},"Matrix, Array, Matrix":function(h,w,g){return x(h,a(w),g)},"Matrix, Array, Array":function(h,w,g){return x(h,a(w),a(g))},"Matrix, Matrix, Array":function(h,w,g){return x(h,w,a(g))},"Array, Array, Array":function(h,w,g){return x(a(h),a(w),a(g)).toArray()}});function x(D,h,w){for(var g=h.size()[0],b=D.size()[0],A=t(D),N=A.T,E=A.U,S=t(i(-1,h)),C=S.T,M=S.U,O=i(i(u(E),w),M),I=o(0,b),k=[],_=(pe,ve)=>l(pe,ve,1),P=(pe,ve)=>l(pe,ve,0),V=0;V<g;V++)if(V<g-1&&d(c(C,s(V+1,V)))>1e-5){for(var q=P(c(O,s(I,[V])),c(O,s(I,[V+1]))),J=0;J<V;J++)q=f(q,P(i(k[J],c(C,s(J,V))),i(k[J],c(C,s(J,V+1)))));var ne=i(v(b),i(-1,c(C,s(V,V)))),j=i(v(b),i(-1,c(C,s(V+1,V)))),F=i(v(b),i(-1,c(C,s(V,V+1)))),U=i(v(b),i(-1,c(C,s(V+1,V+1)))),$=P(_(f(N,ne),j),_(F,f(N,U))),le=p($,q);k[V]=le.subset(s(o(0,b),[0])),k[V+1]=le.subset(s(o(b,2*b),[0])),V++}else{for(var me=c(O,s(I,[V])),Y=0;Y<V;Y++)me=f(me,i(k[Y],c(C,s(Y,V))));var z=c(C,s(V,V)),X=m(N,i(z,v(b)));k[V]=p(X,me)}var se=a(n(...k)),re=i(E,i(se,u(M)));return re}}),Fp="schur",J3=["typed","matrix","identity","multiply","qr","norm","subtract"],j3=L(Fp,J3,r=>{var{typed:e,matrix:t,identity:n,multiply:a,qr:i,norm:o,subtract:l}=r;return e(Fp,{Array:function(c){var f=u(t(c));return{U:f.U.valueOf(),T:f.T.valueOf()}},Matrix:function(c){return u(c)}});function u(s){var c=s.size()[0],f=s,m=n(c),v=0,p;do{p=f;var d=i(f),y=d.Q,x=d.R;if(f=a(x,y),m=a(m,y),v++>100)break}while(o(l(f,p))>1e-4);return{U:m,T:f}}}),Op="lyap",X3=["typed","matrix","sylvester","multiply","transpose"],Q3=L(Op,X3,r=>{var{typed:e,matrix:t,sylvester:n,multiply:a,transpose:i}=r;return e(Op,{"Matrix, Matrix":function(l,u){return n(l,i(l),a(-1,u))},"Array, Matrix":function(l,u){return n(t(l),i(t(l)),a(-1,u))},"Matrix, Array":function(l,u){return n(l,i(t(l)),t(a(-1,u)))},"Array, Array":function(l,u){return n(t(l),i(t(l)),t(a(-1,u))).toArray()}})}),K3="divide",eO=["typed","matrix","multiply","equalScalar","divideScalar","inv"],rO=L(K3,eO,r=>{var{typed:e,matrix:t,multiply:n,equalScalar:a,divideScalar:i,inv:o}=r,l=nt({typed:e,equalScalar:a}),u=Ut({typed:e});return e("divide",Ku({"Array | Matrix, Array | Matrix":function(c,f){return n(c,o(f))},"DenseMatrix, any":function(c,f){return u(c,f,i,!1)},"SparseMatrix, any":function(c,f){return l(c,f,i,!1)},"Array, any":function(c,f){return u(t(c),f,i,!1).valueOf()},"any, Array | Matrix":function(c,f){return n(c,o(f))}},i.signatures))}),Bp="distance",tO=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],nO=L(Bp,tO,r=>{var{typed:e,addScalar:t,subtractScalar:n,multiplyScalar:a,divideScalar:i,deepEqual:o,sqrt:l,abs:u}=r;return e(Bp,{"Array, Array, Array":function(g,b,A){if(g.length===2&&b.length===2&&A.length===2){if(!c(g))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!c(b))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!c(A))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(o(b,A))throw new TypeError("LinePoint1 should not be same with LinePoint2");var N=n(A[1],b[1]),E=n(b[0],A[0]),S=n(a(A[0],b[1]),a(b[0],A[1]));return y(g[0],g[1],N,E,S)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(g,b,A){if(Object.keys(g).length===2&&Object.keys(b).length===2&&Object.keys(A).length===2){if(!c(g))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!c(b))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!c(A))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(o(p(b),p(A)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in g&&"pointY"in g&&"lineOnePtX"in b&&"lineOnePtY"in b&&"lineTwoPtX"in A&&"lineTwoPtY"in A){var N=n(A.lineTwoPtY,b.lineOnePtY),E=n(b.lineOnePtX,A.lineTwoPtX),S=n(a(A.lineTwoPtX,b.lineOnePtY),a(b.lineOnePtX,A.lineTwoPtY));return y(g.pointX,g.pointY,N,E,S)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(g,b){if(g.length===2&&b.length===3){if(!c(g))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(b))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return y(g[0],g[1],b[0],b[1],b[2])}else if(g.length===3&&b.length===6){if(!f(g))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!v(b))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return x(g[0],g[1],g[2],b[0],b[1],b[2],b[3],b[4],b[5])}else if(g.length===b.length&&g.length>0){if(!m(g))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!m(b))throw new TypeError("All values of an array should be numbers or BigNumbers");return D(g,b)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(g,b){if(Object.keys(g).length===2&&Object.keys(b).length===3){if(!c(g))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(b))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in g&&"pointY"in g&&"xCoeffLine"in b&&"yCoeffLine"in b&&"constant"in b)return y(g.pointX,g.pointY,b.xCoeffLine,b.yCoeffLine,b.constant);throw new TypeError("Key names do not match")}else if(Object.keys(g).length===3&&Object.keys(b).length===6){if(!f(g))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!v(b))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in g&&"pointY"in g&&"x0"in b&&"y0"in b&&"z0"in b&&"a"in b&&"b"in b&&"c"in b)return x(g.pointX,g.pointY,g.pointZ,b.x0,b.y0,b.z0,b.a,b.b,b.c);throw new TypeError("Key names do not match")}else if(Object.keys(g).length===2&&Object.keys(b).length===2){if(!c(g))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!c(b))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in g&&"pointOneY"in g&&"pointTwoX"in b&&"pointTwoY"in b)return D([g.pointOneX,g.pointOneY],[b.pointTwoX,b.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(g).length===3&&Object.keys(b).length===3){if(!f(g))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!f(b))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in g&&"pointOneY"in g&&"pointOneZ"in g&&"pointTwoX"in b&&"pointTwoY"in b&&"pointTwoZ"in b)return D([g.pointOneX,g.pointOneY,g.pointOneZ],[b.pointTwoX,b.pointTwoY,b.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(g){if(!d(g))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return h(g)}});function s(w){return typeof w=="number"||or(w)}function c(w){return w.constructor!==Array&&(w=p(w)),s(w[0])&&s(w[1])}function f(w){return w.constructor!==Array&&(w=p(w)),s(w[0])&&s(w[1])&&s(w[2])}function m(w){return Array.isArray(w)||(w=p(w)),w.every(s)}function v(w){return w.constructor!==Array&&(w=p(w)),s(w[0])&&s(w[1])&&s(w[2])&&s(w[3])&&s(w[4])&&s(w[5])}function p(w){for(var g=Object.keys(w),b=[],A=0;A<g.length;A++)b.push(w[g[A]]);return b}function d(w){if(w[0].length===2&&s(w[0][0])&&s(w[0][1])){if(w.some(g=>g.length!==2||!s(g[0])||!s(g[1])))return!1}else if(w[0].length===3&&s(w[0][0])&&s(w[0][1])&&s(w[0][2])){if(w.some(g=>g.length!==3||!s(g[0])||!s(g[1])||!s(g[2])))return!1}else return!1;return!0}function y(w,g,b,A,N){var E=u(t(t(a(b,w),a(A,g)),N)),S=l(t(a(b,b),a(A,A)));return i(E,S)}function x(w,g,b,A,N,E,S,C,M){var O=[n(a(n(N,g),M),a(n(E,b),C)),n(a(n(E,b),S),a(n(A,w),M)),n(a(n(A,w),C),a(n(N,g),S))];O=l(t(t(a(O[0],O[0]),a(O[1],O[1])),a(O[2],O[2])));var I=l(t(t(a(S,S),a(C,C)),a(M,M)));return i(O,I)}function D(w,g){for(var b=w.length,A=0,N=0,E=0;E<b;E++)N=n(w[E],g[E]),A=t(a(N,N),A);return l(A)}function h(w){for(var g=[],b=[],A=[],N=0;N<w.length-1;N++)for(var E=N+1;E<w.length;E++)w[0].length===2?(b=[w[N][0],w[N][1]],A=[w[E][0],w[E][1]]):w[0].length===3&&(b=[w[N][0],w[N][1],w[N][2]],A=[w[E][0],w[E][1],w[E][2]]),g.push(D(b,A));return g}}),aO="intersect",iO=["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar","flatten","isZero","isNumeric"],oO=L(aO,iO,r=>{var{typed:e,config:t,abs:n,add:a,addScalar:i,matrix:o,multiply:l,multiplyScalar:u,divideScalar:s,subtract:c,smaller:f,equalScalar:m,flatten:v,isZero:p,isNumeric:d}=r;return e("intersect",{"Array, Array, Array":y,"Array, Array, Array, Array":x,"Matrix, Matrix, Matrix":function(C,M,O){var I=y(C.valueOf(),M.valueOf(),O.valueOf());return I===null?null:o(I)},"Matrix, Matrix, Matrix, Matrix":function(C,M,O,I){var k=x(C.valueOf(),M.valueOf(),O.valueOf(),I.valueOf());return k===null?null:o(k)}});function y(S,C,M){if(S=D(S),C=D(C),M=D(M),!w(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!w(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!g(M))throw new TypeError("Array with 4 numbers expected as third argument");return E(S[0],S[1],S[2],C[0],C[1],C[2],M[0],M[1],M[2],M[3])}function x(S,C,M,O){if(S=D(S),C=D(C),M=D(M),O=D(O),S.length===2){if(!h(S))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!h(C))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!h(M))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!h(O))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return b(S,C,M,O)}else if(S.length===3){if(!w(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!w(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!w(M))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!w(O))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return N(S[0],S[1],S[2],C[0],C[1],C[2],M[0],M[1],M[2],O[0],O[1],O[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function D(S){return S.length===1?S[0]:S.length>1&&Array.isArray(S[0])&&S.every(C=>Array.isArray(C)&&C.length===1)?v(S):S}function h(S){return S.length===2&&d(S[0])&&d(S[1])}function w(S){return S.length===3&&d(S[0])&&d(S[1])&&d(S[2])}function g(S){return S.length===4&&d(S[0])&&d(S[1])&&d(S[2])&&d(S[3])}function b(S,C,M,O){var I=S,k=M,_=c(I,C),P=c(k,O),V=c(u(_[0],P[1]),u(P[0],_[1]));if(p(V)||f(n(V),t.relTol))return null;var q=u(P[0],I[1]),J=u(P[1],I[0]),ne=u(P[0],k[1]),j=u(P[1],k[0]),F=s(i(c(c(q,J),ne),j),V);return a(l(_,F),I)}function A(S,C,M,O,I,k,_,P,V,q,J,ne){var j=u(c(S,C),c(M,O)),F=u(c(I,k),c(_,P)),U=u(c(V,q),c(J,ne));return i(i(j,F),U)}function N(S,C,M,O,I,k,_,P,V,q,J,ne){var j=A(S,_,q,_,C,P,J,P,M,V,ne,V),F=A(q,_,O,S,J,P,I,C,ne,V,k,M),U=A(S,_,O,S,C,P,I,C,M,V,k,M),$=A(q,_,q,_,J,P,J,P,ne,V,ne,V),le=A(O,S,O,S,I,C,I,C,k,M,k,M),me=c(u(j,F),u(U,$)),Y=c(u(le,$),u(F,F));if(p(Y))return null;var z=s(me,Y),X=s(i(j,u(z,F)),$),se=i(S,u(z,c(O,S))),re=i(C,u(z,c(I,C))),pe=i(M,u(z,c(k,M))),ve=i(_,u(X,c(q,_))),De=i(P,u(X,c(J,P))),Oe=i(V,u(X,c(ne,V)));return m(se,ve)&&m(re,De)&&m(pe,Oe)?[se,re,pe]:null}function E(S,C,M,O,I,k,_,P,V,q){var J=u(S,_),ne=u(O,_),j=u(C,P),F=u(I,P),U=u(M,V),$=u(k,V),le=c(c(c(q,J),j),U),me=c(c(c(i(i(ne,F),$),J),j),U),Y=s(le,me),z=i(S,u(Y,c(O,S))),X=i(C,u(Y,c(I,C))),se=i(M,u(Y,c(k,M)));return[z,X,se]}}),Rp="sum",sO=["typed","config","add","numeric"],Ip=L(Rp,sO,r=>{var{typed:e,config:t,add:n,numeric:a}=r;return e(Rp,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":o,"...":function(u){if(Sa(u))throw new TypeError("Scalar values expected in function sum");return i(u)}});function i(l){var u;return Rn(l,function(s){try{u=u===void 0?s:n(u,s)}catch(c){throw dt(c,"sum",s)}}),u===void 0&&(u=a(0,t.number)),typeof u=="string"&&(u=a(u,An(u,t))),u}function o(l,u){try{var s=Qi(l,u,n);return s}catch(c){throw dt(c,"sum")}}}),Oo="cumsum",uO=["typed","add","unaryPlus"],Pp=L(Oo,uO,r=>{var{typed:e,add:t,unaryPlus:n}=r;return e(Oo,{Array:a,Matrix:function(s){return s.create(a(s.valueOf(),s.datatype()))},"Array, number | BigNumber":o,"Matrix, number | BigNumber":function(s,c){return s.create(o(s.valueOf(),c),s.datatype())},"...":function(s){if(Sa(s))throw new TypeError("All values expected to be scalar in function cumsum");return a(s)}});function a(u){try{return i(u)}catch(s){throw dt(s,Oo)}}function i(u){if(u.length===0)return[];for(var s=[n(u[0])],c=1;c<u.length;++c)s.push(t(s[c-1],u[c]));return s}function o(u,s){var c=rr(u);if(s<0||s>=c.length)throw new Yt(s,c.length);try{return l(u,s)}catch(f){throw dt(f,Oo)}}function l(u,s){var c,f,m;if(s<=0){var v=u[0][0];if(Array.isArray(v)){for(m=Gl(u),f=[],c=0;c<m.length;c++)f[c]=l(m[c],s-1);return f}else return i(u)}else{for(f=[],c=0;c<u.length;c++)f[c]=l(u[c],s-1);return f}}}),$p="mean",lO=["typed","add","divide"],qp=L($p,lO,r=>{var{typed:e,add:t,divide:n}=r;return e($p,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":a,"...":function(l){if(Sa(l))throw new TypeError("Scalar values expected in function mean");return i(l)}});function a(o,l){try{var u=Qi(o,l,t),s=Array.isArray(o)?rr(o):o.size();return n(u,s[l])}catch(c){throw dt(c,"mean")}}function i(o){var l,u=0;if(Rn(o,function(s){try{l=l===void 0?s:t(l,s),u++}catch(c){throw dt(c,"mean",s)}}),u===0)throw new Error("Cannot calculate the mean of an empty array");return n(l,u)}}),zp="median",cO=["typed","add","divide","compare","partitionSelect"],fO=L(zp,cO,r=>{var{typed:e,add:t,divide:n,compare:a,partitionSelect:i}=r;function o(s){try{s=yr(s.valueOf());var c=s.length;if(c===0)throw new Error("Cannot calculate median of an empty array");if(c%2===0){for(var f=c/2-1,m=i(s,f+1),v=s[f],p=0;p<f;++p)a(s[p],v)>0&&(v=s[p]);return u(v,m)}else{var d=i(s,(c-1)/2);return l(d)}}catch(y){throw dt(y,"median")}}var l=e({"number | BigNumber | Complex | Unit":function(c){return c}}),u=e({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(c,f){return n(t(c,f),2)}});return e(zp,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(c,f){throw new Error("median(A, dim) is not yet supported")},"...":function(c){if(Sa(c))throw new TypeError("Scalar values expected in function median");return o(c)}})}),Up="mad",mO=["typed","abs","map","median","subtract"],vO=L(Up,mO,r=>{var{typed:e,abs:t,map:n,median:a,subtract:i}=r;return e(Up,{"Array | Matrix":o,"...":function(u){return o(u)}});function o(l){if(l=yr(l.valueOf()),l.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var u=a(l);return a(n(l,function(s){return t(i(s,u))}))}catch(s){throw s instanceof TypeError&&s.message.includes("median")?new TypeError(s.message.replace("median","mad")):dt(s,"mad")}}}),Ls="unbiased",Lp="variance",pO=["typed","add","subtract","multiply","divide","mapSlices","isNaN"],kp=L(Lp,pO,r=>{var{typed:e,add:t,subtract:n,multiply:a,divide:i,mapSlices:o,isNaN:l}=r;return e(Lp,{"Array | Matrix":function(f){return u(f,Ls)},"Array | Matrix, string":u,"Array | Matrix, number | BigNumber":function(f,m){return s(f,m,Ls)},"Array | Matrix, number | BigNumber, string":s,"...":function(f){return u(f,Ls)}});function u(c,f){var m,v=0;if(c.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Rn(c,function(y){try{m=m===void 0?y:t(m,y),v++}catch(x){throw dt(x,"variance",y)}}),v===0)throw new Error("Cannot calculate variance of an empty array");var p=i(m,v);if(m=void 0,Rn(c,function(y){var x=n(y,p);m=m===void 0?a(x,x):t(m,a(x,x))}),l(m))return m;switch(f){case"uncorrected":return i(m,v);case"biased":return i(m,v+1);case"unbiased":{var d=or(m)?m.mul(0):0;return v===1?d:i(m,v-1)}default:throw new Error('Unknown normalization "'+f+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function s(c,f,m){try{if(c.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return o(c,f,v=>u(v,m))}catch(v){throw dt(v,"variance")}}}),Vp="quantileSeq",dO=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger","mapSlices"],Gp=L(Vp,dO,r=>{var{typed:e,bignumber:t,add:n,subtract:a,divide:i,multiply:o,partitionSelect:l,compare:u,isInteger:s,smaller:c,smallerEq:f,larger:m,mapSlices:v}=r;return e(Vp,{"Array | Matrix, number | BigNumber":(D,h)=>d(D,h,!1),"Array | Matrix, number | BigNumber, number":(D,h,w)=>p(D,h,!1,w,d),"Array | Matrix, number | BigNumber, boolean":d,"Array | Matrix, number | BigNumber, boolean, number":(D,h,w,g)=>p(D,h,w,g,d),"Array | Matrix, Array | Matrix":(D,h)=>y(D,h,!1),"Array | Matrix, Array | Matrix, number":(D,h,w)=>p(D,h,!1,w,y),"Array | Matrix, Array | Matrix, boolean":y,"Array | Matrix, Array | Matrix, boolean, number":(D,h,w,g)=>p(D,h,w,g,y)});function p(D,h,w,g,b){return v(D,g,A=>b(A,h,w))}function d(D,h,w){var g,b=D.valueOf();if(c(h,0))throw new Error("N/prob must be non-negative");if(f(h,1))return Ye(h)?x(b,h,w):t(x(b,h,w));if(m(h,1)){if(!s(h))throw new Error("N must be a positive integer");if(m(h,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var A=n(h,1);g=[];for(var N=0;c(N,h);N++){var E=i(N+1,A);g.push(x(b,E,w))}return Ye(h)?g:t(g)}}function y(D,h,w){for(var g=D.valueOf(),b=h.valueOf(),A=[],N=0;N<b.length;++N)A.push(x(g,b[N],w));return A}function x(D,h,w){var g=yr(D),b=g.length;if(b===0)throw new Error("Cannot calculate quantile of an empty sequence");var A=Ye(h)?h*(b-1):h.times(b-1),N=Ye(h)?Math.floor(A):A.floor().toNumber(),E=Ye(h)?A%1:A.minus(N);if(s(A))return w?g[A]:l(g,Ye(h)?A:A.valueOf());var S,C;if(w)S=g[N],C=g[N+1];else{C=l(g,N+1),S=g[N];for(var M=0;M<N;++M)u(g[M],S)>0&&(S=g[M])}return n(o(S,a(1,E)),o(C,E))}}),Hp="std",hO=["typed","map","sqrt","variance"],Wp=L(Hp,hO,r=>{var{typed:e,map:t,sqrt:n,variance:a}=r;return e(Hp,{"Array | Matrix":i,"Array | Matrix, string":i,"Array | Matrix, number | BigNumber":i,"Array | Matrix, number | BigNumber, string":i,"...":function(l){return i(l)}});function i(o,l){if(o.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var u=a.apply(null,arguments);return Mt(u)?t(u,n):n(u)}catch(s){throw s instanceof TypeError&&s.message.includes(" variance")?new TypeError(s.message.replace(" variance"," std")):s}}}),Yp="corr",gO=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],yO=L(Yp,gO,r=>{var{typed:e,matrix:t,sqrt:n,sum:a,add:i,subtract:o,multiply:l,pow:u,divide:s}=r;return e(Yp,{"Array, Array":function(v,p){return c(v,p)},"Matrix, Matrix":function(v,p){var d=c(v.toArray(),p.toArray());return Array.isArray(d)?t(d):d}});function c(m,v){var p=[];if(Array.isArray(m[0])&&Array.isArray(v[0])){if(m.length!==v.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var d=0;d<m.length;d++){if(m[d].length!==v[d].length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");p.push(f(m[d],v[d]))}return p}else{if(m.length!==v.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");return f(m,v)}}function f(m,v){var p=m.length,d=a(m),y=a(v),x=m.reduce((b,A,N)=>i(b,l(A,v[N])),0),D=a(m.map(b=>u(b,2))),h=a(v.map(b=>u(b,2))),w=o(l(p,x),l(d,y)),g=n(l(o(l(p,D),u(d,2)),o(l(p,h),u(y,2))));return s(w,g)}}),Zp="bernoulli",bO=["typed","config","isInteger","number","?BigNumber","?Fraction"],xO=L(Zp,bO,r=>{var{typed:e,config:t,number:n,BigNumber:a,Fraction:i}=r,o=[void 0],l=[void 0],u=[void 0],s=50;return e(Zp,{number:c=>ks(c,f=>f,o,(f,m)=>f+m,(f,m)=>f*m,(f,m)=>f/m),"bigint | Fraction":c=>ks(n(c),f=>new i(f),l,(f,m)=>f.add(m),(f,m)=>f.mul(m),(f,m)=>f.div(m)),BigNumber:c=>(t.precision!==s&&(u=[void 0],s=t.precision),ks(n(c),f=>new a(f),u,(f,m)=>f.add(m),(f,m)=>f.mul(m),(f,m)=>f.div(m)))})});function ks(r,e,t,n,a,i){if(r<0||!Ue(r))throw new RangeError("Bernoulli index must be nonnegative integer");if(r===0)return e(1);if(r===1)return i(e(-1),e(2));if(r%2===1)return e(0);var o=e(1);t.length===1&&t.push([i(o,e(-3)),i(o,e(-2)),i(o,e(6))]);for(var l=r/2,u=e(0),s=e(2);t.length<=l;){for(var c=t.length,f=Math.floor((c+1)/2),m=u,v=1;v<f;++v)m=n(m,a(t[v][0],t[c-v][0]));m=a(m,s),c%2===0&&(m=n(m,a(t[f][0],t[f][0]))),m=i(m,e(-(2*c+1)));var p=i(a(t[c-1][1],e(-c*(2*c-1))),s);t.push([m,p,a(p,m)])}return t[l][2]}var Jp="combinations",wO=["typed"],DO=L(Jp,wO,r=>{var{typed:e}=r;return e(Jp,{"number, number":dc,"BigNumber, BigNumber":function(n,a){var i=n.constructor,o,l,u=n.minus(a),s=new i(1);if(!jp(n)||!jp(a))throw new TypeError("Positive integer value expected in function combinations");if(a.gt(n))throw new TypeError("k must be less than n in function combinations");if(o=s,a.lt(u))for(l=s;l.lte(u);l=l.plus(s))o=o.times(a.plus(l)).dividedBy(l);else for(l=s;l.lte(a);l=l.plus(s))o=o.times(u.plus(l)).dividedBy(l);return o}})});function jp(r){return r.isInteger()&&r.gte(0)}var Xp="combinationsWithRep",NO=["typed"],EO=L(Xp,NO,r=>{var{typed:e}=r;return e(Xp,{"number, number":function(n,a){if(!Ue(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Ue(a)||a<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(n<1)throw new TypeError("k must be less than or equal to n + k - 1");if(a<n-1){var i=dn(n,n+a-1);return i/dn(1,a)}var o=dn(a+1,n+a-1);return o/dn(1,n-1)},"BigNumber, BigNumber":function(n,a){var i=n.constructor,o,l,u=new i(1),s=n.minus(u);if(!Qp(n)||!Qp(a))throw new TypeError("Positive integer value expected in function combinationsWithRep");if(n.lt(u))throw new TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if(o=u,a.lt(s))for(l=u;l.lte(s);l=l.plus(u))o=o.times(a.plus(l)).dividedBy(l);else for(l=u;l.lte(a);l=l.plus(u))o=o.times(s.plus(l)).dividedBy(l);return o}})});function Qp(r){return r.isInteger()&&r.gte(0)}var Kp="gamma",AO=["typed","config","multiplyScalar","pow","BigNumber","Complex"],SO=L(Kp,AO,r=>{var{typed:e,config:t,multiplyScalar:n,pow:a,BigNumber:i,Complex:o}=r;function l(s){if(s.im===0)return ro(s.re);if(s.re<.5){var c=new o(1-s.re,-s.im),f=new o(Math.PI*s.re,Math.PI*s.im);return new o(Math.PI).div(f.sin()).div(l(c))}s=new o(s.re-1,s.im);for(var m=new o(_a[0],0),v=1;v<_a.length;++v){var p=new o(_a[v],0);m=m.add(p.div(s.add(v)))}var d=new o(s.re+gc+.5,s.im),y=Math.sqrt(2*Math.PI),x=d.pow(s.add(.5)),D=d.neg().exp();return m.mul(y).mul(x).mul(D)}return e(Kp,{number:ro,Complex:l,BigNumber:function(c){if(c.isInteger())return c.isNegative()||c.isZero()?new i(1/0):u(c.minus(1));if(!c.isFinite())return new i(c.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")}});function u(s){if(s<8)return new i([1,1,2,6,24,120,720,5040][s]);var c=t.precision+(Math.log(s.toNumber())|0),f=i.clone({precision:c});if(s%2===1)return s.times(u(new i(s-1)));for(var m=s,v=new f(s),p=s.toNumber();m>2;)m-=2,p+=m,v=v.times(p);return new i(v.toPrecision(i.precision))}}),ed="lgamma",CO=["Complex","typed"],MO=L(ed,CO,r=>{var{Complex:e,typed:t}=r,n=7,a=7,i=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return t(ed,{number:to,Complex:o,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function o(s){var c=6.283185307179586,f=1.1447298858494002,m=.1;if(s.isNaN())return new e(NaN,NaN);if(s.im===0)return new e(to(s.re),0);if(s.re>=n||Math.abs(s.im)>=a)return l(s);if(s.re<=m){var v=j0(c,s.im)*Math.floor(.5*s.re+.25),p=s.mul(Math.PI).sin().log(),d=o(new e(1-s.re,-s.im));return new e(f,v).sub(p).sub(d)}else return s.im>=0?u(s):u(s.conjugate()).conjugate()}function l(s){for(var c=s.sub(.5).mul(s.log()).sub(s).add(yc),f=new e(1,0).div(s),m=f.div(s),v=i[0],p=i[1],d=2*m.re,y=m.re*m.re+m.im*m.im,x=2;x<8;x++){var D=p;p=-y*v+i[x],v=d*v+D}var h=f.mul(m.mul(v).add(p));return c.add(h)}function u(s){var c=0,f=0,m=s;for(s=s.add(1);s.re<=n;){m=m.mul(s);var v=m.im<0?1:0;v!==0&&f===0&&c++,f=v,s=s.add(1)}return l(s).sub(m.log()).sub(new e(0,c*2*Math.PI*1))}}),rd="factorial",_O=["typed","gamma"],TO=L(rd,_O,r=>{var{typed:e,gamma:t}=r;return e(rd,{number:function(a){if(a<0)throw new Error("Value must be non-negative");return t(a+1)},BigNumber:function(a){if(a.isNegative())throw new Error("Value must be non-negative");return t(a.plus(1))},"Array | Matrix":e.referToSelf(n=>a=>tr(a,n))})}),td="kldivergence",FO=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],OO=L(td,FO,r=>{var{typed:e,matrix:t,divide:n,sum:a,multiply:i,map:o,dotDivide:l,log:u,isNumeric:s}=r;return e(td,{"Array, Array":function(m,v){return c(t(m),t(v))},"Matrix, Array":function(m,v){return c(m,t(v))},"Array, Matrix":function(m,v){return c(t(m),v)},"Matrix, Matrix":function(m,v){return c(m,v)}});function c(f,m){var v=m.size().length,p=f.size().length;if(v>1)throw new Error("first object must be one dimensional");if(p>1)throw new Error("second object must be one dimensional");if(v!==p)throw new Error("Length of two vectors must be equal");var d=a(f);if(d===0)throw new Error("Sum of elements in first object must be non zero");var y=a(m);if(y===0)throw new Error("Sum of elements in second object must be non zero");var x=n(f,a(f)),D=n(m,a(m)),h=a(i(x,o(l(x,D),w=>u(w))));return s(h)?h:Number.NaN}}),nd="multinomial",BO=["typed","add","divide","multiply","factorial","isInteger","isPositive"],RO=L(nd,BO,r=>{var{typed:e,add:t,divide:n,multiply:a,factorial:i,isInteger:o,isPositive:l}=r;return e(nd,{"Array | Matrix":function(s){var c=0,f=1;return Rn(s,function(m){if(!o(m)||!l(m))throw new TypeError("Positive integer value expected in function multinomial");c=t(c,m),f=a(f,i(m))}),n(i(c),f)}})}),ad="permutations",IO=["typed","factorial"],PO=L(ad,IO,r=>{var{typed:e,factorial:t}=r;return e(ad,{"number | BigNumber":t,"number, number":function(a,i){if(!Ue(a)||a<0)throw new TypeError("Positive integer value expected in function permutations");if(!Ue(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(i>a)throw new TypeError("second argument k must be less than or equal to first argument n");return dn(a-i+1,a)},"BigNumber, BigNumber":function(a,i){var o,l;if(!id(a)||!id(i))throw new TypeError("Positive integer value expected in function permutations");if(i.gt(a))throw new TypeError("second argument k must be less than or equal to first argument n");var u=a.mul(0).add(1);for(o=u,l=a.minus(i).plus(1);l.lte(a);l=l.plus(1))o=o.times(l);return o}})});function id(r){return r.isInteger()&&r.gte(0)}var Vs={exports:{}};Vs.exports,function(r){(function(e,t,n){function a(u){var s=this,c=l();s.next=function(){var f=2091639*s.s0+s.c*23283064365386963e-26;return s.s0=s.s1,s.s1=s.s2,s.s2=f-(s.c=f|0)},s.c=1,s.s0=c(" "),s.s1=c(" "),s.s2=c(" "),s.s0-=c(u),s.s0<0&&(s.s0+=1),s.s1-=c(u),s.s1<0&&(s.s1+=1),s.s2-=c(u),s.s2<0&&(s.s2+=1),c=null}function i(u,s){return s.c=u.c,s.s0=u.s0,s.s1=u.s1,s.s2=u.s2,s}function o(u,s){var c=new a(u),f=s&&s.state,m=c.next;return m.int32=function(){return c.next()*4294967296|0},m.double=function(){return m()+(m()*2097152|0)*11102230246251565e-32},m.quick=m,f&&(typeof f=="object"&&i(f,c),m.state=function(){return i(c,{})}),m}function l(){var u=4022871197,s=function(c){c=String(c);for(var f=0;f<c.length;f++){u+=c.charCodeAt(f);var m=.02519603282416938*u;u=m>>>0,m-=u,m*=u,u=m>>>0,m-=u,u+=m*4294967296}return(u>>>0)*23283064365386963e-26};return s}t&&t.exports?t.exports=o:this.alea=o})(ra,r)}(Vs);var $O=Vs.exports,Gs={exports:{}};Gs.exports,function(r){(function(e,t,n){function a(l){var u=this,s="";u.x=0,u.y=0,u.z=0,u.w=0,u.next=function(){var f=u.x^u.x<<11;return u.x=u.y,u.y=u.z,u.z=u.w,u.w^=u.w>>>19^f^f>>>8},l===(l|0)?u.x=l:s+=l;for(var c=0;c<s.length+64;c++)u.x^=s.charCodeAt(c)|0,u.next()}function i(l,u){return u.x=l.x,u.y=l.y,u.z=l.z,u.w=l.w,u}function o(l,u){var s=new a(l),c=u&&u.state,f=function(){return(s.next()>>>0)/4294967296};return f.double=function(){do var m=s.next()>>>11,v=(s.next()>>>0)/4294967296,p=(m+v)/(1<<21);while(p===0);return p},f.int32=s.next,f.quick=f,c&&(typeof c=="object"&&i(c,s),f.state=function(){return i(s,{})}),f}t&&t.exports?t.exports=o:this.xor128=o})(ra,r)}(Gs);var qO=Gs.exports,Hs={exports:{}};Hs.exports,function(r){(function(e,t,n){function a(l){var u=this,s="";u.next=function(){var f=u.x^u.x>>>2;return u.x=u.y,u.y=u.z,u.z=u.w,u.w=u.v,(u.d=u.d+362437|0)+(u.v=u.v^u.v<<4^(f^f<<1))|0},u.x=0,u.y=0,u.z=0,u.w=0,u.v=0,l===(l|0)?u.x=l:s+=l;for(var c=0;c<s.length+64;c++)u.x^=s.charCodeAt(c)|0,c==s.length&&(u.d=u.x<<10^u.x>>>4),u.next()}function i(l,u){return u.x=l.x,u.y=l.y,u.z=l.z,u.w=l.w,u.v=l.v,u.d=l.d,u}function o(l,u){var s=new a(l),c=u&&u.state,f=function(){return(s.next()>>>0)/4294967296};return f.double=function(){do var m=s.next()>>>11,v=(s.next()>>>0)/4294967296,p=(m+v)/(1<<21);while(p===0);return p},f.int32=s.next,f.quick=f,c&&(typeof c=="object"&&i(c,s),f.state=function(){return i(s,{})}),f}t&&t.exports?t.exports=o:this.xorwow=o})(ra,r)}(Hs);var zO=Hs.exports,Ws={exports:{}};Ws.exports,function(r){(function(e,t,n){function a(l){var u=this;u.next=function(){var c=u.x,f=u.i,m,v;return m=c[f],m^=m>>>7,v=m^m<<24,m=c[f+1&7],v^=m^m>>>10,m=c[f+3&7],v^=m^m>>>3,m=c[f+4&7],v^=m^m<<7,m=c[f+7&7],m=m^m<<13,v^=m^m<<9,c[f]=v,u.i=f+1&7,v};function s(c,f){var m,v=[];if(f===(f|0))v[0]=f;else for(f=""+f,m=0;m<f.length;++m)v[m&7]=v[m&7]<<15^f.charCodeAt(m)+v[m+1&7]<<13;for(;v.length<8;)v.push(0);for(m=0;m<8&&v[m]===0;++m);for(m==8?v[7]=-1:v[m],c.x=v,c.i=0,m=256;m>0;--m)c.next()}s(u,l)}function i(l,u){return u.x=l.x.slice(),u.i=l.i,u}function o(l,u){l==null&&(l=+new Date);var s=new a(l),c=u&&u.state,f=function(){return(s.next()>>>0)/4294967296};return f.double=function(){do var m=s.next()>>>11,v=(s.next()>>>0)/4294967296,p=(m+v)/(1<<21);while(p===0);return p},f.int32=s.next,f.quick=f,c&&(c.x&&i(c,s),f.state=function(){return i(s,{})}),f}t&&t.exports?t.exports=o:this.xorshift7=o})(ra,r)}(Ws);var UO=Ws.exports,Ys={exports:{}};Ys.exports,function(r){(function(e,t,n){function a(l){var u=this;u.next=function(){var c=u.w,f=u.X,m=u.i,v,p;return u.w=c=c+1640531527|0,p=f[m+34&127],v=f[m=m+1&127],p^=p<<13,v^=v<<17,p^=p>>>15,v^=v>>>12,p=f[m]=p^v,u.i=m,p+(c^c>>>16)|0};function s(c,f){var m,v,p,d,y,x=[],D=128;for(f===(f|0)?(v=f,f=null):(f=f+"\0",v=0,D=Math.max(D,f.length)),p=0,d=-32;d<D;++d)f&&(v^=f.charCodeAt((d+32)%f.length)),d===0&&(y=v),v^=v<<10,v^=v>>>15,v^=v<<4,v^=v>>>13,d>=0&&(y=y+1640531527|0,m=x[d&127]^=v+y,p=m==0?p+1:0);for(p>=128&&(x[(f&&f.length||0)&127]=-1),p=127,d=4*128;d>0;--d)v=x[p+34&127],m=x[p=p+1&127],v^=v<<13,m^=m<<17,v^=v>>>15,m^=m>>>12,x[p]=v^m;c.w=y,c.X=x,c.i=p}s(u,l)}function i(l,u){return u.i=l.i,u.w=l.w,u.X=l.X.slice(),u}function o(l,u){l==null&&(l=+new Date);var s=new a(l),c=u&&u.state,f=function(){return(s.next()>>>0)/4294967296};return f.double=function(){do var m=s.next()>>>11,v=(s.next()>>>0)/4294967296,p=(m+v)/(1<<21);while(p===0);return p},f.int32=s.next,f.quick=f,c&&(c.X&&i(c,s),f.state=function(){return i(s,{})}),f}t&&t.exports?t.exports=o:this.xor4096=o})(ra,r)}(Ys);var LO=Ys.exports,Zs={exports:{}};Zs.exports,function(r){(function(e,t,n){function a(l){var u=this,s="";u.next=function(){var f=u.b,m=u.c,v=u.d,p=u.a;return f=f<<25^f>>>7^m,m=m-v|0,v=v<<24^v>>>8^p,p=p-f|0,u.b=f=f<<20^f>>>12^m,u.c=m=m-v|0,u.d=v<<16^m>>>16^p,u.a=p-f|0},u.a=0,u.b=0,u.c=-1640531527,u.d=1367130551,l===Math.floor(l)?(u.a=l/4294967296|0,u.b=l|0):s+=l;for(var c=0;c<s.length+20;c++)u.b^=s.charCodeAt(c)|0,u.next()}function i(l,u){return u.a=l.a,u.b=l.b,u.c=l.c,u.d=l.d,u}function o(l,u){var s=new a(l),c=u&&u.state,f=function(){return(s.next()>>>0)/4294967296};return f.double=function(){do var m=s.next()>>>11,v=(s.next()>>>0)/4294967296,p=(m+v)/(1<<21);while(p===0);return p},f.int32=s.next,f.quick=f,c&&(typeof c=="object"&&i(c,s),f.state=function(){return i(s,{})}),f}t&&t.exports?t.exports=o:this.tychei=o})(ra,r)}(Zs);var kO=Zs.exports,od={exports:{}};const VO=D2(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));(function(r){(function(e,t,n){var a=256,i=6,o=52,l="random",u=n.pow(a,i),s=n.pow(2,o),c=s*2,f=a-1,m;function v(w,g,b){var A=[];g=g==!0?{entropy:!0}:g||{};var N=x(y(g.entropy?[w,h(t)]:w??D(),3),A),E=new p(A),S=function(){for(var C=E.g(i),M=u,O=0;C<s;)C=(C+O)*a,M*=a,O=E.g(1);for(;C>=c;)C/=2,M/=2,O>>>=1;return(C+O)/M};return S.int32=function(){return E.g(4)|0},S.quick=function(){return E.g(4)/4294967296},S.double=S,x(h(E.S),t),(g.pass||b||function(C,M,O,I){return I&&(I.S&&d(I,E),C.state=function(){return d(E,{})}),O?(n[l]=C,M):C})(S,N,"global"in g?g.global:this==n,g.state)}function p(w){var g,b=w.length,A=this,N=0,E=A.i=A.j=0,S=A.S=[];for(b||(w=[b++]);N<a;)S[N]=N++;for(N=0;N<a;N++)S[N]=S[E=f&E+w[N%b]+(g=S[N])],S[E]=g;(A.g=function(C){for(var M,O=0,I=A.i,k=A.j,_=A.S;C--;)M=_[I=f&I+1],O=O*a+_[f&(_[I]=_[k=f&k+M])+(_[k]=M)];return A.i=I,A.j=k,O})(a)}function d(w,g){return g.i=w.i,g.j=w.j,g.S=w.S.slice(),g}function y(w,g){var b=[],A=typeof w,N;if(g&&A=="object")for(N in w)try{b.push(y(w[N],g-1))}catch{}return b.length?b:A=="string"?w:w+"\0"}function x(w,g){for(var b=w+"",A,N=0;N<b.length;)g[f&N]=f&(A^=g[f&N]*19)+b.charCodeAt(N++);return h(g)}function D(){try{var w;return m&&(w=m.randomBytes)?w=w(a):(w=new Uint8Array(a),(e.crypto||e.msCrypto).getRandomValues(w)),h(w)}catch{var g=e.navigator,b=g&&g.plugins;return[+new Date,e,b,e.screen,h(t)]}}function h(w){return String.fromCharCode.apply(0,w)}if(x(n.random(),t),r.exports){r.exports=v;try{m=VO}catch{}}else n["seed"+l]=v})(typeof self<"u"?self:ra,[],Math)})(od);var GO=od.exports,HO=$O,WO=qO,YO=zO,ZO=UO,JO=LO,jO=kO,ta=GO;ta.alea=HO,ta.xor128=WO,ta.xorwow=YO,ta.xorshift7=ZO,ta.xor4096=JO,ta.tychei=jO;var XO=ta;const sd=Bs(XO);var QO=sd(Date.now());function Ia(r){var e;function t(a){e=a===null?QO:sd(String(a))}t(r);function n(){return e()}return n}var ud="pickRandom",KO=["typed","config","?on"],eB=L(ud,KO,r=>{var{typed:e,config:t,on:n}=r,a=Ia(t.randomSeed);return n&&n("config",function(o,l){o.randomSeed!==l.randomSeed&&(a=Ia(o.randomSeed))}),e(ud,{"Array | Matrix":function(l){return i(l,{})},"Array | Matrix, Object":function(l,u){return i(l,u)},"Array | Matrix, number":function(l,u){return i(l,{number:u})},"Array | Matrix, Array | Matrix":function(l,u){return i(l,{weights:u})},"Array | Matrix, Array | Matrix, number":function(l,u,s){return i(l,{number:s,weights:u})},"Array | Matrix, number, Array | Matrix":function(l,u,s){return i(l,{number:u,weights:s})}});function i(o,l){var{number:u,weights:s,elementWise:c=!0}=l,f=typeof u>"u";f&&(u=1);var m=Je(o)?o.create:Je(s)?s.create:null;o=o.valueOf(),s&&(s=s.valueOf()),c===!0&&(o=yr(o),s=yr(s));var v=0;if(typeof s<"u"){if(s.length!==o.length)throw new Error("Weights must have the same length as possibles");for(var p=0,d=s.length;p<d;p++){if(!Ye(s[p])||s[p]<0)throw new Error("Weights must be an array of positive numbers");v+=s[p]}}for(var y=o.length,x=[],D;x.length<u;){if(typeof s>"u")D=o[Math.floor(a()*y)];else for(var h=a()*v,w=0,g=o.length;w<g;w++)if(h-=s[w],h<0){D=o[w];break}x.push(D)}return f?x[0]:m?m(x):x}});function Js(r,e){var t=[];if(r=r.slice(0),r.length>1)for(var n=0,a=r.shift();n<a;n++)t.push(Js(r,e));else for(var i=0,o=r.shift();i<o;i++)t.push(e());return t}var ld="random",rB=["typed","config","?on"],tB=L(ld,rB,r=>{var{typed:e,config:t,on:n}=r,a=Ia(t.randomSeed);return n&&n("config",function(l,u){l.randomSeed!==u.randomSeed&&(a=Ia(l.randomSeed))}),e(ld,{"":()=>o(0,1),number:l=>o(0,l),"number, number":(l,u)=>o(l,u),"Array | Matrix":l=>i(l,0,1),"Array | Matrix, number":(l,u)=>i(l,0,u),"Array | Matrix, number, number":(l,u,s)=>i(l,u,s)});function i(l,u,s){var c=Js(l.valueOf(),()=>o(u,s));return Je(l)?l.create(c,"number"):c}function o(l,u){return l+a()*(u-l)}}),cd="randomInt",nB=["typed","config","log2","?on"],aB=L(cd,nB,r=>{var{typed:e,config:t,log2:n,on:a}=r,i=Ia(t.randomSeed);return a&&a("config",function(s,c){s.randomSeed!==c.randomSeed&&(i=Ia(s.randomSeed))}),e(cd,{"":()=>l(0,2),number:s=>l(0,s),"number, number":(s,c)=>l(s,c),bigint:s=>u(0n,s),"bigint, bigint":u,"Array | Matrix":s=>o(s,0,1),"Array | Matrix, number":(s,c)=>o(s,0,c),"Array | Matrix, number, number":(s,c,f)=>o(s,c,f)});function o(s,c,f){var m=Js(s.valueOf(),()=>l(c,f));return Je(s)?s.create(m,"number"):m}function l(s,c){return Math.floor(s+i()*(c-s))}function u(s,c){var f=2n**30n,m=c-s;if(m<=f)return s+BigInt(l(0,Number(m)));for(var v=n(m),p=m;p>=m;){p=0n;for(var d=0;d<v;++d)p=2n*p+(i()<.5?0n:1n)}return s+p}}),fd="stirlingS2",iB=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],oB=L(fd,iB,r=>{var{typed:e,addScalar:t,subtractScalar:n,multiplyScalar:a,divideScalar:i,pow:o,factorial:l,combinations:u,isNegative:s,isInteger:c,number:f,bignumber:m,larger:v}=r,p=[],d=[];return e(fd,{"number | BigNumber, number | BigNumber":function(x,D){if(!c(x)||s(x)||!c(D)||s(D))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(v(D,x))throw new TypeError("k must be less than or equal to n in function stirlingS2");var h=!(Ye(x)&&Ye(D)),w=h?d:p,g=h?m:f,b=f(x),A=f(D);if(w[b]&&w[b].length>A)return w[b][A];for(var N=0;N<=b;++N)if(w[N]||(w[N]=[g(N===0?1:0)]),N!==0)for(var E=w[N],S=w[N-1],C=E.length;C<=N&&C<=A;++C)C===N?E[C]=1:E[C]=t(a(g(C),S[C]),S[C-1]);return w[b][A]}})}),md="bellNumbers",sB=["typed","addScalar","isNegative","isInteger","stirlingS2"],uB=L(md,sB,r=>{var{typed:e,addScalar:t,isNegative:n,isInteger:a,stirlingS2:i}=r;return e(md,{"number | BigNumber":function(l){if(!a(l)||n(l))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var u=0,s=0;s<=l;s++)u=t(u,i(l,s));return u}})}),vd="catalan",lB=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],cB=L(vd,lB,r=>{var{typed:e,addScalar:t,divideScalar:n,multiplyScalar:a,combinations:i,isNegative:o,isInteger:l}=r;return e(vd,{"number | BigNumber":function(s){if(!l(s)||o(s))throw new TypeError("Non-negative integer value expected in function catalan");return n(i(a(s,2),s),t(s,1))}})}),pd="composition",fB=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],mB=L(pd,fB,r=>{var{typed:e,addScalar:t,combinations:n,isPositive:a,isNegative:i,isInteger:o,larger:l}=r;return e(pd,{"number | BigNumber, number | BigNumber":function(s,c){if(!o(s)||!a(s)||!o(c)||!a(c))throw new TypeError("Positive integer value expected in function composition");if(l(c,s))throw new TypeError("k must be less than or equal to n in function composition");return n(t(s,-1),t(c,-1))}})}),dd="leafCount",vB=["parse","typed"],pB=L(dd,vB,r=>{var{parse:e,typed:t}=r;function n(a){var i=0;return a.forEach(o=>{i+=n(o)}),i||1}return t(dd,{Node:function(i){return n(i)}})});function hd(r){return gr(r)||Ur(r)&&r.isUnary()&&gr(r.args[0])}function Bo(r){return!!(gr(r)||(En(r)||Ur(r))&&r.args.every(Bo)||fn(r)&&Bo(r.content))}function gd(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function js(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?gd(Object(t),!0).forEach(function(n){Vr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):gd(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var dB="simplifyUtil",hB=["FunctionNode","OperatorNode","SymbolNode"],Xs=L(dB,hB,r=>{var{FunctionNode:e,OperatorNode:t,SymbolNode:n}=r,a=!0,i=!1,o="defaultF",l={add:{trivial:a,total:a,commutative:a,associative:a},unaryPlus:{trivial:a,total:a,commutative:a,associative:a},subtract:{trivial:i,total:a,commutative:i,associative:i},multiply:{trivial:a,total:a,commutative:a,associative:a},divide:{trivial:i,total:a,commutative:i,associative:i},paren:{trivial:a,total:a,commutative:a,associative:i},defaultF:{trivial:i,total:a,commutative:i,associative:i}},u={divide:{total:i},log:{total:i}},s={subtract:{total:i},abs:{trivial:a},log:{total:a}};function c(h,w){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l,b=o;if(typeof h=="string"?b=h:Ur(h)?b=h.fn.toString():En(h)?b=h.name:fn(h)&&(b="paren"),$e(g,b)){var A=g[b];if($e(A,w))return A[w];if($e(l,b))return l[b][w]}if($e(g,o)){var N=g[o];return $e(N,w)?N[w]:l[o][w]}if($e(l,b)){var E=l[b];if($e(E,w))return E[w]}return l[o][w]}function f(h){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return c(h,"commutative",w)}function m(h){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return c(h,"associative",w)}function v(h,w){var g=js({},h);for(var b in w)$e(h,b)?g[b]=js(js({},w[b]),h[b]):g[b]=w[b];return g}function p(h,w){if(!h.args||h.args.length===0)return h;h.args=d(h,w);for(var g=0;g<h.args.length;g++)p(h.args[g],w)}function d(h,w){var g,b=[],A=function(E){for(var S=0;S<E.args.length;S++){var C=E.args[S];Ur(C)&&g===C.op?A(C):b.push(C)}};return m(h,w)?(g=h.op,A(h),b):h.args}function y(h,w){if(!(!h.args||h.args.length===0)){for(var g=D(h),b=h.args.length,A=0;A<b;A++)y(h.args[A],w);if(b>2&&m(h,w)){for(var N=h.args.pop();h.args.length>0;)N=g([h.args.pop(),N]);h.args=N.args}}}function x(h,w){if(!(!h.args||h.args.length===0)){for(var g=D(h),b=h.args.length,A=0;A<b;A++)x(h.args[A],w);if(b>2&&m(h,w)){for(var N=h.args.shift();h.args.length>0;)N=g([N,h.args.shift()]);h.args=N.args}}}function D(h){return Ur(h)?function(w){try{return new t(h.op,h.fn,w,h.implicit)}catch(g){return console.error(g),[]}}:function(w){return new e(new n(h.name),w)}}return{createMakeNodeFunction:D,hasProperty:c,isCommutative:f,isAssociative:m,mergeContext:v,flatten:p,allChildren:d,unflattenr:y,unflattenl:x,defaultContext:l,realContext:u,positiveContext:s}}),gB="simplify",yB=["typed","parse","equal","resolve","simplifyConstant","simplifyCore","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode","replacer"],bB=L(gB,yB,r=>{var{typed:e,parse:t,equal:n,resolve:a,simplifyConstant:i,simplifyCore:o,AccessorNode:l,ArrayNode:u,ConstantNode:s,FunctionNode:c,IndexNode:f,ObjectNode:m,OperatorNode:v,ParenthesisNode:p,SymbolNode:d,replacer:y}=r,{hasProperty:x,isCommutative:D,isAssociative:h,mergeContext:w,flatten:g,unflattenr:b,unflattenl:A,createMakeNodeFunction:N,defaultContext:E,realContext:S,positiveContext:C}=Xs({FunctionNode:c,OperatorNode:v,SymbolNode:d});e.addConversion({from:"Object",to:"Map",convert:va});var M=e("simplify",{Node:q,"Node, Map":(Y,z)=>q(Y,!1,z),"Node, Map, Object":(Y,z,X)=>q(Y,!1,z,X),"Node, Array":q,"Node, Array, Map":q,"Node, Array, Map, Object":q});e.removeConversion({from:"Object",to:"Map",convert:va}),M.defaultContext=E,M.realContext=S,M.positiveContext=C;function O(Y){return Y.transform(function(z){return fn(z)?O(z.content):z})}var I={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};M.rules=[o,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},i,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},i,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function k(Y,z){var X={};if(Y.s){var se=Y.s.split("->");if(se.length===2)X.l=se[0],X.r=se[1];else throw SyntaxError("Could not parse rule: "+Y.s)}else X.l=Y.l,X.r=Y.r;X.l=O(t(X.l)),X.r=O(t(X.r));for(var re of["imposeContext","repeat","assuming"])re in Y&&(X[re]=Y[re]);if(Y.evaluate&&(X.evaluate=t(Y.evaluate)),h(X.l,z)){var pe=!D(X.l,z),ve;pe&&(ve=V());var De=N(X.l),Oe=V();X.expanded={},X.expanded.l=De([X.l,Oe]),g(X.expanded.l,z),b(X.expanded.l,z),X.expanded.r=De([X.r,Oe]),pe&&(X.expandedNC1={},X.expandedNC1.l=De([ve,X.l]),X.expandedNC1.r=De([ve,X.r]),X.expandedNC2={},X.expandedNC2.l=De([ve,X.expanded.l]),X.expandedNC2.r=De([ve,X.expanded.r]))}return X}function _(Y,z){for(var X=[],se=0;se<Y.length;se++){var re=Y[se],pe=void 0,ve=typeof re;switch(ve){case"string":re={s:re};case"object":pe=k(re,z);break;case"function":pe=re;break;default:throw TypeError("Unsupported type of rule: "+ve)}X.push(pe)}return X}var P=0;function V(){return new d("_p"+P++)}function q(Y,z){var X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Xa(),se=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},re=se.consoleDebug;z=_(z||M.rules,se.context);var pe=a(Y,X);pe=O(pe);for(var ve={},De=pe.toString({parenthesis:"all"});!ve[De];){ve[De]=!0,P=0;var Oe=De;re&&console.log("Working on: ",De);for(var Ie=0;Ie<z.length;Ie++){var _e="";if(typeof z[Ie]=="function"?(pe=z[Ie](pe,se),re&&(_e=z[Ie].name)):(g(pe,se.context),pe=ne(pe,z[Ie],se.context),re&&(_e="".concat(z[Ie].l.toString()," -> ").concat(z[Ie].r.toString()))),re){var Le=pe.toString({parenthesis:"all"});Le!==Oe&&(console.log("Applying",_e,"produced",Le),Oe=Le)}A(pe,se.context)}De=pe.toString({parenthesis:"all"})}return pe}function J(Y,z,X){var se=Y;if(Y)for(var re=0;re<Y.length;++re){var pe=ne(Y[re],z,X);pe!==Y[re]&&(se===Y&&(se=Y.slice()),se[re]=pe)}return se}function ne(Y,z,X){if(z.assuming){for(var se in z.assuming)for(var re in z.assuming[se])if(x(se,re,X)!==z.assuming[se][re])return Y}var pe=w(z.imposeContext,X),ve=Y;if(ve instanceof v||ve instanceof c){var De=J(ve.args,z,X);De!==ve.args&&(ve=ve.clone(),ve.args=De)}else if(ve instanceof p){if(ve.content){var Oe=ne(ve.content,z,X);Oe!==ve.content&&(ve=new p(Oe))}}else if(ve instanceof u){var Ie=J(ve.items,z,X);Ie!==ve.items&&(ve=new u(Ie))}else if(ve instanceof l){var _e=ve.object;ve.object&&(_e=ne(ve.object,z,X));var Le=ve.index;ve.index&&(Le=ne(ve.index,z,X)),(_e!==ve.object||Le!==ve.index)&&(ve=new l(_e,Le))}else if(ve instanceof f){var qe=J(ve.dimensions,z,X);qe!==ve.dimensions&&(ve=new f(qe))}else if(ve instanceof m){var G=!1,ee={};for(var R in ve.properties)ee[R]=ne(ve.properties[R],z,X),ee[R]!==ve.properties[R]&&(G=!0);G&&(ve=new m(ee))}var H=z.r,Q=le(z.l,ve,pe)[0];if(!Q&&z.expanded&&(H=z.expanded.r,Q=le(z.expanded.l,ve,pe)[0]),!Q&&z.expandedNC1&&(H=z.expandedNC1.r,Q=le(z.expandedNC1.l,ve,pe)[0],Q||(H=z.expandedNC2.r,Q=le(z.expandedNC2.l,ve,pe)[0])),Q){var ie=ve.implicit;ve=H.clone(),ie&&"implicit"in H&&(ve.implicit=!0),ve=ve.transform(function(ue){return ue.isSymbolNode&&$e(Q.placeholders,ue.name)?Q.placeholders[ue.name].clone():ue})}return z.repeat&&ve!==Y&&(ve=ne(ve,z,X)),ve}function j(Y,z){var X=[],se,re,pe=N(Y);if(D(Y,z))for(var ve=0;ve<Y.args.length;ve++)re=Y.args.slice(0),re.splice(ve,1),se=re.length===1?re[0]:pe(re),X.push(pe([Y.args[ve],se]));else for(var De=1;De<Y.args.length;De++){var Oe=Y.args[0];De>1&&(Oe=pe(Y.args.slice(0,De))),re=Y.args.slice(De),se=re.length===1?re[0]:pe(re),X.push(pe([Oe,se]))}return X}function F(Y,z){var X={placeholders:{}};if(!Y.placeholders&&!z.placeholders)return X;if(Y.placeholders){if(!z.placeholders)return Y}else return z;for(var se in Y.placeholders)if($e(Y.placeholders,se)&&(X.placeholders[se]=Y.placeholders[se],$e(z.placeholders,se)&&!me(Y.placeholders[se],z.placeholders[se])))return null;for(var re in z.placeholders)$e(z.placeholders,re)&&(X.placeholders[re]=z.placeholders[re]);return X}function U(Y,z){var X=[];if(Y.length===0||z.length===0)return X;for(var se,re=0;re<Y.length;re++)for(var pe=0;pe<z.length;pe++)se=F(Y[re],z[pe]),se&&X.push(se);return X}function $(Y){if(Y.length===0)return Y;for(var z=Y.reduce(U),X=[],se={},re=0;re<z.length;re++){var pe=JSON.stringify(z[re],y);se[pe]||(se[pe]=!0,X.push(z[re]))}return X}function le(Y,z,X,se){var re=[{placeholders:{}}];if(Y instanceof v&&z instanceof v||Y instanceof c&&z instanceof c){if(Y instanceof v){if(Y.op!==z.op||Y.fn!==z.fn)return[]}else if(Y instanceof c&&Y.name!==z.name)return[];if(z.args.length===1&&Y.args.length===1||!h(z,X)&&z.args.length===Y.args.length||se){for(var pe=[],ve=0;ve<Y.args.length;ve++){var De=le(Y.args[ve],z.args[ve],X);if(De.length===0)break;pe.push(De)}if(pe.length!==Y.args.length){if(!D(z,X)||Y.args.length===1)return[];if(Y.args.length>2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var Oe=le(Y.args[0],z.args[1],X);if(Oe.length===0)return[];var Ie=le(Y.args[1],z.args[0],X);if(Ie.length===0)return[];pe=[Oe,Ie]}re=$(pe)}else if(z.args.length>=2&&Y.args.length===2){for(var _e=j(z,X),Le=[],qe=0;qe<_e.length;qe++){var G=le(Y,_e[qe],X,!0);Le=Le.concat(G)}return Le}else{if(Y.args.length>2)throw Error("Unexpected non-binary associative function: "+Y.toString());return[]}}else if(Y instanceof d){if(Y.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(I[Y.name]){if(Y.name!==z.name)return[]}else switch(Y.name[1]>="a"&&Y.name[1]<="z"?Y.name.substring(0,2):Y.name[0]){case"n":case"_p":re[0].placeholders[Y.name]=z;break;case"c":case"cl":if(gr(z))re[0].placeholders[Y.name]=z;else return[];break;case"v":if(!gr(z))re[0].placeholders[Y.name]=z;else return[];break;case"vl":if(jr(z))re[0].placeholders[Y.name]=z;else return[];break;case"cd":if(hd(z))re[0].placeholders[Y.name]=z;else return[];break;case"vd":if(!hd(z))re[0].placeholders[Y.name]=z;else return[];break;case"ce":if(Bo(z))re[0].placeholders[Y.name]=z;else return[];break;case"ve":if(!Bo(z))re[0].placeholders[Y.name]=z;else return[];break;default:throw new Error("Invalid symbol in rule: "+Y.name)}}else if(Y instanceof s){if(!n(Y.value,z.value))return[]}else return[];return re}function me(Y,z){if(Y instanceof s&&z instanceof s){if(!n(Y.value,z.value))return!1}else if(Y instanceof d&&z instanceof d){if(Y.name!==z.name)return!1}else if(Y instanceof v&&z instanceof v||Y instanceof c&&z instanceof c){if(Y instanceof v){if(Y.op!==z.op||Y.fn!==z.fn)return!1}else if(Y instanceof c&&Y.name!==z.name)return!1;if(Y.args.length!==z.args.length)return!1;for(var X=0;X<Y.args.length;X++)if(!me(Y.args[X],z.args[X]))return!1}else return!1;return!0}return M}),xB="simplifyConstant",wB=["typed","config","mathWithTransform","matrix","isBounded","?fraction","?bignumber","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode"],DB=L(xB,wB,r=>{var{typed:e,config:t,mathWithTransform:n,matrix:a,isBounded:i,fraction:o,bignumber:l,AccessorNode:u,ArrayNode:s,ConstantNode:c,FunctionNode:f,IndexNode:m,ObjectNode:v,OperatorNode:p,SymbolNode:d}=r,{isCommutative:y,isAssociative:x,allChildren:D,createMakeNodeFunction:h}=Xs({FunctionNode:f,OperatorNode:p,SymbolNode:d}),w=e("simplifyConstant",{Node:_=>N(k(_,{})),"Node, Object":function(P,V){return N(k(P,V))}});function g(_){return Ka(_)?_.valueOf():_ instanceof Array?_.map(g):Je(_)?a(g(_.valueOf())):_}function b(_,P,V){try{return n[_].apply(null,P)}catch{return P=P.map(g),S(n[_].apply(null,P),V)}}var A=e({Fraction:M,number:function(P){return P<0?C(new c(-P)):new c(P)},BigNumber:function(P){return P<0?C(new c(-P)):new c(P)},bigint:function(P){return P<0n?C(new c(-P)):new c(P)},Complex:function(P){throw new Error("Cannot convert Complex number to Node")},string:function(P){return new c(P)},Matrix:function(P){return new s(P.valueOf().map(V=>A(V)))}});function N(_){return Nr(_)?_:A(_)}function E(_,P){var V=P&&P.exactFractions!==!1;if(V&&i(_)&&o){var q=o(_),J=P&&typeof P.fractionsLimit=="number"?P.fractionsLimit:1/0;if(q.valueOf()===_&&q.n<J&&q.d<J)return q}return _}var S=e({"string, Object":function(P,V){var q=An(P,t);if(q==="BigNumber")return l===void 0&&Ts(),l(P);if(q==="bigint")return BigInt(P);if(q==="Fraction")return o===void 0&&lm(),o(P);var J=parseFloat(P);return E(J,V)},"Fraction, Object":function(P,V){return P},"BigNumber, Object":function(P,V){return P},"number, Object":function(P,V){return E(P,V)},"bigint, Object":function(P,V){return P},"Complex, Object":function(P,V){return P.im!==0?P:E(P.re,V)},"Matrix, Object":function(P,V){return a(E(P.valueOf()))},"Array, Object":function(P,V){return P.map(E)}});function C(_){return new p("-","unaryMinus",[_])}function M(_){var P=J=>t.number==="BigNumber"&&l?l(J):Number(J),V=_.s*_.n,q=V<0n?new p("-","unaryMinus",[new c(-P(V))]):new c(P(V));return _.d===1n?q:new p("/","divide",[q,new c(P(_.d))])}function O(_,P,V){if(!pa(P))return new u(N(_),N(P));if(Rt(_)||Je(_)){for(var q=Array.from(P.dimensions);q.length>0;)if(gr(q[0])&&typeof q[0].value!="string"){var J=S(q.shift().value,V);Rt(_)?_=_.items[J-1]:(_=_.valueOf()[J-1],_ instanceof Array&&(_=a(_)))}else if(q.length>1&&gr(q[1])&&typeof q[1].value!="string"){var ne=S(q[1].value,V),j=[],F=Rt(_)?_.items:_.valueOf();for(var U of F)if(Rt(U))j.push(U.items[ne-1]);else if(Je(_))j.push(U[ne-1]);else break;if(j.length===F.length)Rt(_)?_=new s(j):_=a(j),q.splice(1,1);else break}else break;return q.length===P.dimensions.length?new u(N(_),P):q.length>0?(P=new m(q),new u(N(_),P)):_}if(Oi(_)&&P.dimensions.length===1&&gr(P.dimensions[0])){var $=P.dimensions[0].value;return $ in _.properties?_.properties[$]:new c}return new u(N(_),P)}function I(_,P,V,q){var J=P.shift(),ne=P.reduce((j,F)=>{if(!Nr(F)){var U=j.pop();if(Nr(U))return[U,F];try{return j.push(b(_,[U,F],q)),j}catch{j.push(U)}}j.push(N(j.pop()));var $=j.length===1?j[0]:V(j);return[V([$,N(F)])]},[J]);return ne.length===1?ne[0]:V([ne[0],A(ne[1])])}function k(_,P){switch(_.type){case"SymbolNode":return _;case"ConstantNode":switch(typeof _.value){case"number":return S(_.value,P);case"bigint":return S(_.value,P);case"string":return _.value;default:if(!isNaN(_.value))return S(_.value,P)}return _;case"FunctionNode":if(n[_.name]&&n[_.name].rawArgs)return _;{var V=["add","multiply"];if(!V.includes(_.name)){var q=_.args.map(re=>k(re,P));if(!q.some(Nr))try{return b(_.name,q,P)}catch{}if(_.name==="size"&&q.length===1&&Rt(q[0])){for(var J=[],ne=q[0];Rt(ne);)J.push(ne.items.length),ne=ne.items[0];return a(J)}return new f(_.name,q.map(N))}}case"OperatorNode":{var j=_.fn.toString(),F,U,$=h(_);if(Ur(_)&&_.isUnary())F=[k(_.args[0],P)],Nr(F[0])?U=$(F):U=b(j,F,P);else if(x(_,P.context))if(F=D(_,P.context),F=F.map(re=>k(re,P)),y(j,P.context)){for(var le=[],me=[],Y=0;Y<F.length;Y++)Nr(F[Y])?me.push(F[Y]):le.push(F[Y]);le.length>1?(U=I(j,le,$,P),me.unshift(U),U=I(j,me,$,P)):U=I(j,F,$,P)}else U=I(j,F,$,P);else F=_.args.map(re=>k(re,P)),U=I(j,F,$,P);return U}case"ParenthesisNode":return k(_.content,P);case"AccessorNode":return O(k(_.object,P),k(_.index,P),P);case"ArrayNode":{var z=_.items.map(re=>k(re,P));return z.some(Nr)?new s(z.map(N)):a(z)}case"IndexNode":return new m(_.dimensions.map(re=>w(re,P)));case"ObjectNode":{var X={};for(var se in _.properties)X[se]=w(_.properties[se],P);return new v(X)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(_.type))}}return w}),yd="simplifyCore",NB=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],EB=L(yd,NB,r=>{var{typed:e,parse:t,equal:n,isZero:a,add:i,subtract:o,multiply:l,divide:u,pow:s,AccessorNode:c,ArrayNode:f,ConstantNode:m,FunctionNode:v,IndexNode:p,ObjectNode:d,OperatorNode:y,ParenthesisNode:x,SymbolNode:D}=r,h=new m(0),w=new m(1),g=new m(!0),b=new m(!1);function A(C){return Ur(C)&&["and","not","or"].includes(C.op)}var{hasProperty:N,isCommutative:E}=Xs({FunctionNode:v,OperatorNode:y,SymbolNode:D});function S(C){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=M?M.context:void 0;if(N(C,"trivial",O)){if(En(C)&&C.args.length===1)return S(C.args[0],M);var I=!1,k=0;if(C.forEach(le=>{++k,k===1&&(I=S(le,M))}),k===1)return I}var _=C;if(En(_)){var P=pS(_.name);if(P){if(_.args.length>2&&N(_,"associative",O))for(;_.args.length>2;){var V=_.args.pop(),q=_.args.pop();_.args.push(new y(P,_.name,[V,q]))}_=new y(P,_.name,_.args)}else return new v(S(_.fn),_.args.map(le=>S(le,M)))}if(Ur(_)&&_.isUnary()){var J=S(_.args[0],M);if(_.op==="~"&&Ur(J)&&J.isUnary()&&J.op==="~"||_.op==="not"&&Ur(J)&&J.isUnary()&&J.op==="not"&&A(J.args[0]))return J.args[0];var ne=!0;if(_.op==="-"&&Ur(J)&&(J.isBinary()&&J.fn==="subtract"&&(_=new y("-","subtract",[J.args[1],J.args[0]]),ne=!1),J.isUnary()&&J.op==="-"))return J.args[0];if(ne)return new y(_.op,_.fn,[J])}if(Ur(_)&&_.isBinary()){var j=S(_.args[0],M),F=S(_.args[1],M);if(_.op==="+"){if(gr(j)&&a(j.value))return F;if(gr(F)&&a(F.value))return j;Ur(F)&&F.isUnary()&&F.op==="-"&&(F=F.args[0],_=new y("-","subtract",[j,F]))}if(_.op==="-")return Ur(F)&&F.isUnary()&&F.op==="-"?S(new y("+","add",[j,F.args[0]]),M):gr(j)&&a(j.value)?S(new y("-","unaryMinus",[F])):gr(F)&&a(F.value)?j:new y(_.op,_.fn,[j,F]);if(_.op==="*"){if(gr(j)){if(a(j.value))return h;if(n(j.value,1))return F}if(gr(F)){if(a(F.value))return h;if(n(F.value,1))return j;if(E(_,O))return new y(_.op,_.fn,[F,j],_.implicit)}return new y(_.op,_.fn,[j,F],_.implicit)}if(_.op==="/")return gr(j)&&a(j.value)?h:gr(F)&&n(F.value,1)?j:new y(_.op,_.fn,[j,F]);if(_.op==="^"&&gr(F)){if(a(F.value))return w;if(n(F.value,1))return j}if(_.op==="and"){if(gr(j))if(j.value){if(A(F))return F;if(gr(F))return F.value?g:b}else return b;if(gr(F))if(F.value){if(A(j))return j}else return b}if(_.op==="or"){if(gr(j)){if(j.value)return g;if(A(F))return F}if(gr(F)){if(F.value)return g;if(A(j))return j}}return new y(_.op,_.fn,[j,F])}if(Ur(_))return new y(_.op,_.fn,_.args.map(le=>S(le,M)));if(Rt(_))return new f(_.items.map(le=>S(le,M)));if(cn(_))return new c(S(_.object,M),S(_.index,M));if(pa(_))return new p(_.dimensions.map(le=>S(le,M)));if(Oi(_)){var U={};for(var $ in _.properties)U[$]=S(_.properties[$],M);return new d(U)}return _}return e(yd,{Node:S,"Node,Object":S})}),AB="resolve",SB=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],CB=L(AB,SB,r=>{var{typed:e,parse:t,ConstantNode:n,FunctionNode:a,OperatorNode:i,ParenthesisNode:o}=r;function l(u,s){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!s)return u;if(jr(u)){if(c.has(u.name)){var f=Array.from(c).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(f,"}"))}var m=s.get(u.name);if(Nr(m)){var v=new Set(c);return v.add(u.name),l(m,s,v)}else return typeof m=="number"?t(String(m)):m!==void 0?new n(m):u}else if(Ur(u)){var p=u.args.map(function(y){return l(y,s,c)});return new i(u.op,u.fn,p,u.implicit)}else{if(fn(u))return new o(l(u.content,s,c));if(En(u)){var d=u.args.map(function(y){return l(y,s,c)});return new a(u.name,d)}}return u.map(y=>l(y,s,c))}return e("resolve",{Node:l,"Node, Map | null | undefined":l,"Node, Object":(u,s)=>l(u,va(s)),"Array | Matrix":e.referToSelf(u=>s=>s.map(c=>u(c))),"Array | Matrix, null | undefined":e.referToSelf(u=>s=>s.map(c=>u(c))),"Array, Object":e.referTo("Array,Map",u=>(s,c)=>u(s,va(c))),"Matrix, Object":e.referTo("Matrix,Map",u=>(s,c)=>u(s,va(c))),"Array | Matrix, Map":e.referToSelf(u=>(s,c)=>s.map(f=>u(f,c)))})}),bd="symbolicEqual",MB=["parse","simplify","typed","OperatorNode"],_B=L(bd,MB,r=>{var{parse:e,simplify:t,typed:n,OperatorNode:a}=r;function i(o,l){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=new a("-","subtract",[o,l]),c=t(s,{},u);return gr(c)&&!c.value}return n(bd,{"Node, Node":i,"Node, Node, Object":i})}),xd="derivative",TB=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],FB=L(xd,TB,r=>{var{typed:e,config:t,parse:n,simplify:a,equal:i,isZero:o,numeric:l,ConstantNode:u,FunctionNode:s,OperatorNode:c,ParenthesisNode:f,SymbolNode:m}=r;function v(w,g){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},A=new Map,N=g.name;function E(C){var M=A.get(C);if(M!==void 0)return M;var O=x(E,C,N);return A.set(C,O),O}var S=D(w,E);return b.simplify?a(S):S}function p(w){var g=n(w);if(!g.isSymbolNode)throw new TypeError("Invalid variable. "+"Cannot parse ".concat(JSON.stringify(w)," into a variable in function derivative"));return g}var d=e(xd,{"Node, SymbolNode":v,"Node, SymbolNode, Object":v,"Node, string":(w,g)=>v(w,p(g)),"Node, string, Object":(w,g,b)=>v(w,p(g),b)});d._simplify=!0,d.toTex=function(w){return y.apply(null,w.args)};var y=e("_derivTex",{"Node, SymbolNode":function(g,b){return gr(g)&&Sr(g.value)==="string"?y(n(g.value).toString(),b.toString(),1):y(g.toTex(),b.toString(),1)},"Node, ConstantNode":function(g,b){if(Sr(b.value)==="string")return y(g,n(b.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(g,b,A){return y(g.toString(),b.name,A.value)},"string, string, number":function(g,b,A){var N;return A===1?N="{d\\over d"+b+"}":N="{d^{"+A+"}\\over d"+b+"^{"+A+"}}",N+"\\left[".concat(g,"\\right]")}}),x=e("_isConst",{"function, ConstantNode, string":function(){return!0},"function, SymbolNode, string":function(g,b,A){return b.name!==A},"function, ParenthesisNode, string":function(g,b,A){return g(b.content,A)},"function, FunctionAssignmentNode, string":function(g,b,A){return b.params.includes(A)?g(b.expr,A):!0},"function, FunctionNode | OperatorNode, string":function(g,b,A){return b.args.every(N=>g(N,A))}}),D=e("_derivative",{"ConstantNode, function":function(){return h(0)},"SymbolNode, function":function(g,b){return b(g)?h(0):h(1)},"ParenthesisNode, function":function(g,b){return new f(D(g.content,b))},"FunctionAssignmentNode, function":function(g,b){return b(g)?h(0):D(g.expr,b)},"FunctionNode, function":function(g,b){if(b(g))return h(0);var A=g.args[0],N,E=!1,S=!1,C;switch(g.name){case"cbrt":E=!0,C=new c("*","multiply",[h(3),new c("^","pow",[A,new c("/","divide",[h(2),h(3)])])]);break;case"sqrt":case"nthRoot":if(g.args.length===1)E=!0,C=new c("*","multiply",[h(2),new s("sqrt",[A])]);else if(g.args.length===2)return N=new c("/","divide",[h(1),g.args[1]]),D(new c("^","pow",[A,N]),b);break;case"log10":N=h(10);case"log":if(!N&&g.args.length===1)C=A.clone(),E=!0;else if(g.args.length===1&&N||g.args.length===2&&b(g.args[1]))C=new c("*","multiply",[A.clone(),new s("log",[N||g.args[1]])]),E=!0;else if(g.args.length===2)return D(new c("/","divide",[new s("log",[A]),new s("log",[g.args[1]])]),b);break;case"pow":if(g.args.length===2)return D(new c("^","pow",[A,g.args[1]]),b);break;case"exp":C=new s("exp",[A.clone()]);break;case"sin":C=new s("cos",[A.clone()]);break;case"cos":C=new c("-","unaryMinus",[new s("sin",[A.clone()])]);break;case"tan":C=new c("^","pow",[new s("sec",[A.clone()]),h(2)]);break;case"sec":C=new c("*","multiply",[g,new s("tan",[A.clone()])]);break;case"csc":S=!0,C=new c("*","multiply",[g,new s("cot",[A.clone()])]);break;case"cot":S=!0,C=new c("^","pow",[new s("csc",[A.clone()]),h(2)]);break;case"asin":E=!0,C=new s("sqrt",[new c("-","subtract",[h(1),new c("^","pow",[A.clone(),h(2)])])]);break;case"acos":E=!0,S=!0,C=new s("sqrt",[new c("-","subtract",[h(1),new c("^","pow",[A.clone(),h(2)])])]);break;case"atan":E=!0,C=new c("+","add",[new c("^","pow",[A.clone(),h(2)]),h(1)]);break;case"asec":E=!0,C=new c("*","multiply",[new s("abs",[A.clone()]),new s("sqrt",[new c("-","subtract",[new c("^","pow",[A.clone(),h(2)]),h(1)])])]);break;case"acsc":E=!0,S=!0,C=new c("*","multiply",[new s("abs",[A.clone()]),new s("sqrt",[new c("-","subtract",[new c("^","pow",[A.clone(),h(2)]),h(1)])])]);break;case"acot":E=!0,S=!0,C=new c("+","add",[new c("^","pow",[A.clone(),h(2)]),h(1)]);break;case"sinh":C=new s("cosh",[A.clone()]);break;case"cosh":C=new s("sinh",[A.clone()]);break;case"tanh":C=new c("^","pow",[new s("sech",[A.clone()]),h(2)]);break;case"sech":S=!0,C=new c("*","multiply",[g,new s("tanh",[A.clone()])]);break;case"csch":S=!0,C=new c("*","multiply",[g,new s("coth",[A.clone()])]);break;case"coth":S=!0,C=new c("^","pow",[new s("csch",[A.clone()]),h(2)]);break;case"asinh":E=!0,C=new s("sqrt",[new c("+","add",[new c("^","pow",[A.clone(),h(2)]),h(1)])]);break;case"acosh":E=!0,C=new s("sqrt",[new c("-","subtract",[new c("^","pow",[A.clone(),h(2)]),h(1)])]);break;case"atanh":E=!0,C=new c("-","subtract",[h(1),new c("^","pow",[A.clone(),h(2)])]);break;case"asech":E=!0,S=!0,C=new c("*","multiply",[A.clone(),new s("sqrt",[new c("-","subtract",[h(1),new c("^","pow",[A.clone(),h(2)])])])]);break;case"acsch":E=!0,S=!0,C=new c("*","multiply",[new s("abs",[A.clone()]),new s("sqrt",[new c("+","add",[new c("^","pow",[A.clone(),h(2)]),h(1)])])]);break;case"acoth":E=!0,S=!0,C=new c("-","subtract",[h(1),new c("^","pow",[A.clone(),h(2)])]);break;case"abs":C=new c("/","divide",[new s(new m("abs"),[A.clone()]),A.clone()]);break;case"gamma":default:throw new Error('Cannot process function "'+g.name+'" in derivative: the function is not supported, undefined, or the number of arguments passed to it are not supported')}var M,O;E?(M="/",O="divide"):(M="*",O="multiply");var I=D(A,b);return S&&(I=new c("-","unaryMinus",[I])),new c(M,O,[I,C])},"OperatorNode, function":function(g,b){if(b(g))return h(0);if(g.op==="+")return new c(g.op,g.fn,g.args.map(function(_){return D(_,b)}));if(g.op==="-"){if(g.isUnary())return new c(g.op,g.fn,[D(g.args[0],b)]);if(g.isBinary())return new c(g.op,g.fn,[D(g.args[0],b),D(g.args[1],b)])}if(g.op==="*"){var A=g.args.filter(function(_){return b(_)});if(A.length>0){var N=g.args.filter(function(_){return!b(_)}),E=N.length===1?N[0]:new c("*","multiply",N),S=A.concat(D(E,b));return new c("*","multiply",S)}return new c("+","add",g.args.map(function(_){return new c("*","multiply",g.args.map(function(P){return P===_?D(P,b):P.clone()}))}))}if(g.op==="/"&&g.isBinary()){var C=g.args[0],M=g.args[1];return b(M)?new c("/","divide",[D(C,b),M]):b(C)?new c("*","multiply",[new c("-","unaryMinus",[C]),new c("/","divide",[D(M,b),new c("^","pow",[M.clone(),h(2)])])]):new c("/","divide",[new c("-","subtract",[new c("*","multiply",[D(C,b),M.clone()]),new c("*","multiply",[C.clone(),D(M,b)])]),new c("^","pow",[M.clone(),h(2)])])}if(g.op==="^"&&g.isBinary()){var O=g.args[0],I=g.args[1];if(b(O))return gr(O)&&(o(O.value)||i(O.value,1))?h(0):new c("*","multiply",[g,new c("*","multiply",[new s("log",[O.clone()]),D(I.clone(),b)])]);if(b(I)){if(gr(I)){if(o(I.value))return h(0);if(i(I.value,1))return D(O,b)}var k=new c("^","pow",[O.clone(),new c("-","subtract",[I,h(1)])]);return new c("*","multiply",[I.clone(),new c("*","multiply",[D(O,b),k])])}return new c("*","multiply",[new c("^","pow",[O.clone(),I.clone()]),new c("+","add",[new c("*","multiply",[D(O,b),new c("/","divide",[I.clone(),O.clone()])]),new c("*","multiply",[D(I,b),new s("log",[O.clone()])])])])}throw new Error('Cannot process operator "'+g.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function h(w,g){return new u(l(w,An(String(w),t)))}return d}),wd="rationalize",OB=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],BB=L(wd,OB,r=>{var{config:e,typed:t,equal:n,isZero:a,add:i,subtract:o,multiply:l,divide:u,pow:s,parse:c,simplifyConstant:f,simplifyCore:m,simplify:v,fraction:p,bignumber:d,mathWithTransform:y,matrix:x,AccessorNode:D,ArrayNode:h,ConstantNode:w,FunctionNode:g,IndexNode:b,ObjectNode:A,OperatorNode:N,SymbolNode:E,ParenthesisNode:S}=r;function C(_){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,q=O(),J=M(_,P,!0,q.firstRules),ne=J.variables.length,j={exactFractions:!1},F={exactFractions:!0};if(_=J.expression,ne>=1){_=I(_);var U,$,le=!0,me=!1;_=v(_,q.firstRules,{},j);for(var Y;$=le?q.distrDivRules:q.sucDivRules,_=v(_,$,{},F),le=!le,Y=_.toString(),Y!==U;)me=!0,U=Y;me&&(_=v(_,q.firstRulesAgain,{},j)),_=v(_,q.finalRules,{},j)}var z=[],X={};return _.type==="OperatorNode"&&_.isBinary()&&_.op==="/"?(ne===1&&(_.args[0]=k(_.args[0],z),_.args[1]=k(_.args[1])),V&&(X.numerator=_.args[0],X.denominator=_.args[1])):(ne===1&&(_=k(_,z)),V&&(X.numerator=_,X.denominator=null)),V?(X.coefficients=z,X.variables=J.variables,X.expression=_,X):_}return t(wd,{Node:C,"Node, boolean":(_,P)=>C(_,{},P),"Node, Object":C,"Node, Object, boolean":C});function M(_,P,V,q){var J=[],ne=v(_,q,P,{exactFractions:!1});V=!!V;var j="+-*"+(V?"/":"");U(ne);var F={};return F.expression=ne,F.variables=J,F;function U($){var le=$.type;if(le==="FunctionNode")throw new Error("There is an unsolved function call");if(le==="OperatorNode")if($.op==="^"){if($.args[1].type!=="ConstantNode"||!Ue(parseFloat($.args[1].value)))throw new Error("There is a non-integer exponent");U($.args[0])}else{if(!j.includes($.op))throw new Error("Operator "+$.op+" invalid in polynomial expression");for(var me=0;me<$.args.length;me++)U($.args[me])}else if(le==="SymbolNode"){var Y=$.name,z=J.indexOf(Y);z===-1&&J.push(Y)}else if(le==="ParenthesisNode")U($.content);else if(le!=="ConstantNode")throw new Error("type "+le+" is not allowed in polynomial expression")}}function O(){var _=[m,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},f,{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"1*n",r:"n"}],P=[{l:"(-n1)/(-n2)",r:"n1/n2"},{l:"(-n1)*(-n2)",r:"n1*n2"},{l:"n1--n2",r:"n1+n2"},{l:"n1-n2",r:"n1+(-n2)"},{l:"(n1+n2)*n3",r:"(n1*n3 + n2*n3)"},{l:"n1*(n2+n3)",r:"(n1*n2+n1*n3)"},{l:"c1*n + c2*n",r:"(c1+c2)*n"},{l:"c1*n + n",r:"(c1+1)*n"},{l:"c1*n - c2*n",r:"(c1-c2)*n"},{l:"c1*n - n",r:"(c1-1)*n"},{l:"v/c",r:"(1/c)*v"},{l:"v/-c",r:"-(1/c)*v"},{l:"-v*-c",r:"c*v"},{l:"-v*c",r:"-c*v"},{l:"v*-c",r:"-c*v"},{l:"v*c",r:"c*v"},{l:"-(-n1*n2)",r:"(n1*n2)"},{l:"-(n1*n2)",r:"(-n1*n2)"},{l:"-(-n1+n2)",r:"(n1-n2)"},{l:"-(n1+n2)",r:"(-n1-n2)"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"},{l:"-(-n1/n2)",r:"(n1/n2)"},{l:"-(n1/n2)",r:"(-n1/n2)"}],V=[{l:"(n1/n2 + n3/n4)",r:"((n1*n4 + n3*n2)/(n2*n4))"},{l:"(n1/n2 + n3)",r:"((n1 + n3*n2)/n2)"},{l:"(n1 + n2/n3)",r:"((n1*n3 + n2)/n3)"}],q=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],J={};return J.firstRules=_.concat(P,q),J.distrDivRules=V,J.sucDivRules=q,J.firstRulesAgain=_.concat(P),J.finalRules=[m,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},f,{l:"n*-n^n1",r:"-n^(n1+1)"},{l:"n*n^n1",r:"n^(n1+1)"},{l:"n^n1*-n^n2",r:"-n^(n1+n2)"},{l:"n^n1*n^n2",r:"n^(n1+n2)"},{l:"n^n1*-n",r:"-n^(n1+1)"},{l:"n^n1*n",r:"n^(n1+1)"},{l:"n^n1/-n",r:"-n^(n1-1)"},{l:"n^n1/n",r:"n^(n1-1)"},{l:"n/-n^n1",r:"-n^(1-n1)"},{l:"n/n^n1",r:"n^(1-n1)"},{l:"n^n1/-n^n2",r:"n^(n1-n2)"},{l:"n^n1/n^n2",r:"n^(n1-n2)"},{l:"n1+(-n2*n3)",r:"n1-n2*n3"},{l:"v*(-c)",r:"-c*v"},{l:"n1+-n2",r:"n1-n2"},{l:"v*c",r:"c*v"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"}],J}function I(_,P,V){var q=_.type,J=arguments.length>1;if(q==="OperatorNode"&&_.isBinary()){var ne=!1,j;if(_.op==="^"&&(_.args[0].type==="ParenthesisNode"||_.args[0].type==="OperatorNode")&&_.args[1].type==="ConstantNode"&&(j=parseFloat(_.args[1].value),ne=j>=2&&Ue(j)),ne){if(j>2){var F=_.args[0],U=new N("^","pow",[_.args[0].cloneDeep(),new w(j-1)]);_=new N("*","multiply",[F,U])}else _=new N("*","multiply",[_.args[0],_.args[0].cloneDeep()]);J&&(V==="content"?P.content=_:P.args[V]=_)}}if(q==="ParenthesisNode")I(_.content,_,"content");else if(q!=="ConstantNode"&&q!=="SymbolNode")for(var $=0;$<_.args.length;$++)I(_.args[$],_,$);if(!J)return _}function k(_,P){P===void 0&&(P=[]),P[0]=0;var V={};V.cte=1,V.oper="+",V.fire="";var q=0,J="";Y(_,null,V),q=P.length-1;for(var ne=!0,j,F=q;F>=0;F--)if(P[F]!==0){var U=new w(ne?P[F]:Math.abs(P[F])),$=P[F]<0?"-":"+";if(F>0){var le=new E(J);if(F>1){var me=new w(F);le=new N("^","pow",[le,me])}P[F]===-1&&ne?U=new N("-","unaryMinus",[le]):Math.abs(P[F])===1?U=le:U=new N("*","multiply",[U,le])}ne?j=U:$==="+"?j=new N("+","add",[j,U]):j=new N("-","subtract",[j,U]),ne=!1}if(ne)return new w(0);return j;function Y(z,X,se){var re=z.type;if(re==="FunctionNode")throw new Error("There is an unsolved function call");if(re==="OperatorNode"){if(!"+-*^".includes(z.op))throw new Error("Operator "+z.op+" invalid");if(X!==null){if((z.fn==="unaryMinus"||z.fn==="pow")&&X.fn!=="add"&&X.fn!=="subtract"&&X.fn!=="multiply")throw new Error("Invalid "+z.op+" placing");if((z.fn==="subtract"||z.fn==="add"||z.fn==="multiply")&&X.fn!=="add"&&X.fn!=="subtract")throw new Error("Invalid "+z.op+" placing");if((z.fn==="subtract"||z.fn==="add"||z.fn==="unaryMinus")&&se.noFil!==0)throw new Error("Invalid "+z.op+" placing")}(z.op==="^"||z.op==="*")&&(se.fire=z.op);for(var pe=0;pe<z.args.length;pe++)z.fn==="unaryMinus"&&(se.oper="-"),(z.op==="+"||z.fn==="subtract")&&(se.fire="",se.cte=1,se.oper=pe===0?"+":z.op),se.noFil=pe,Y(z.args[pe],z,se)}else if(re==="SymbolNode"){if(z.name!==J&&J!=="")throw new Error("There is more than one variable");if(J=z.name,X===null){P[1]=1;return}if(X.op==="^"&&se.noFil!==0)throw new Error("In power the variable should be the first parameter");if(X.op==="*"&&se.noFil!==1)throw new Error("In multiply the variable should be the second parameter");(se.fire===""||se.fire==="*")&&(q<1&&(P[1]=0),P[1]+=se.cte*(se.oper==="+"?1:-1),q=Math.max(1,q))}else if(re==="ConstantNode"){var ve=parseFloat(z.value);if(X===null){P[0]=ve;return}if(X.op==="^"){if(se.noFil!==1)throw new Error("Constant cannot be powered");if(!Ue(ve)||ve<=0)throw new Error("Non-integer exponent is not allowed");for(var De=q+1;De<ve;De++)P[De]=0;ve>q&&(P[ve]=0),P[ve]+=se.cte*(se.oper==="+"?1:-1),q=Math.max(ve,q);return}se.cte=ve,se.fire===""&&(P[0]+=se.cte*(se.oper==="+"?1:-1))}else throw new Error("Type "+re+" is not allowed")}}}),Dd="zpk2tf",RB=["typed","add","multiply","Complex","number"],IB=L(Dd,RB,r=>{var{typed:e,add:t,multiply:n,Complex:a,number:i}=r;return e(Dd,{"Array,Array,number":function(s,c,f){return o(s,c,f)},"Array,Array":function(s,c){return o(s,c,1)},"Matrix,Matrix,number":function(s,c,f){return o(s.valueOf(),c.valueOf(),f)},"Matrix,Matrix":function(s,c){return o(s.valueOf(),c.valueOf(),1)}});function o(u,s,c){u.some(D=>D.type==="BigNumber")&&(u=u.map(D=>i(D))),s.some(D=>D.type==="BigNumber")&&(s=s.map(D=>i(D)));for(var f=[a(1,0)],m=[a(1,0)],v=0;v<u.length;v++){var p=u[v];typeof p=="number"&&(p=a(p,0)),f=l(f,[a(1,0),a(-p.re,-p.im)])}for(var d=0;d<s.length;d++){var y=s[d];typeof y=="number"&&(y=a(y,0)),m=l(m,[a(1,0),a(-y.re,-y.im)])}for(var x=0;x<f.length;x++)f[x]=n(f[x],c);return[f,m]}function l(u,s){for(var c=[],f=0;f<u.length+s.length-1;f++){c[f]=a(0,0);for(var m=0;m<u.length;m++)f-m>=0&&f-m<s.length&&(c[f]=t(c[f],n(u[m],s[f-m])))}return c}}),Nd="freqz",PB=["typed","add","multiply","Complex","divide","matrix"],$B=L(Nd,PB,r=>{var{typed:e,add:t,multiply:n,Complex:a,divide:i,matrix:o}=r;return e(Nd,{"Array, Array":function(c,f){var m=u(512);return l(c,f,m)},"Array, Array, Array":function(c,f,m){return l(c,f,m)},"Array, Array, number":function(c,f,m){if(m<0)throw new Error("w must be a positive number");var v=u(m);return l(c,f,v)},"Matrix, Matrix":function(c,f){var m=u(512),{w:v,h:p}=l(c.valueOf(),f.valueOf(),m);return{w:o(v),h:o(p)}},"Matrix, Matrix, Matrix":function(c,f,m){var{h:v}=l(c.valueOf(),f.valueOf(),m.valueOf());return{h:o(v),w:o(m)}},"Matrix, Matrix, number":function(c,f,m){if(m<0)throw new Error("w must be a positive number");var v=u(m),{h:p}=l(c.valueOf(),f.valueOf(),v);return{h:o(p),w:o(v)}}});function l(s,c,f){for(var m=[],v=[],p=0;p<f.length;p++){for(var d=a(0,0),y=a(0,0),x=0;x<s.length;x++)d=t(d,n(s[x],a(Math.cos(-x*f[p]),Math.sin(-x*f[p]))));for(var D=0;D<c.length;D++)y=t(y,n(c[D],a(Math.cos(-D*f[p]),Math.sin(-D*f[p]))));m.push(d),v.push(y)}for(var h=[],w=0;w<m.length;w++)h.push(i(m[w],v[w]));return{h,w:f}}function u(s){for(var c=[],f=0;f<s;f++)c.push(f/s*Math.PI);return c}}),qB="reviver",zB=["classes"],UB=L(qB,zB,r=>{var{classes:e}=r;return function(n,a){var i=e[a&&a.mathjs];return i&&typeof i.fromJSON=="function"?i.fromJSON(a):a}}),LB="replacer",kB=[],VB=L(LB,kB,()=>function(e,t){return typeof t=="number"&&(!Number.isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:typeof t=="bigint"?{mathjs:"bigint",value:String(t)}:t}),GB="15.2.0",HB=L("true",[],()=>!0),WB=L("false",[],()=>!1),YB=L("null",[],()=>null),ZB=_t("Infinity",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?new t(1/0):1/0}),JB=_t("NaN",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?new t(NaN):NaN}),jB=_t("pi",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?Rs(t):z1}),XB=_t("tau",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?yE(t):U1}),QB=_t("e",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?hE(t):L1}),KB=_t("phi",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?gE(t):k1}),e4=_t("LN2",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?new t(2).ln():Math.LN2}),r4=_t("LN10",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?new t(10).ln():Math.LN10}),t4=_t("LOG2E",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?new t(1).div(new t(2).ln()):Math.LOG2E}),n4=_t("LOG10E",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?new t(1).div(new t(10).ln()):Math.LOG10E}),a4=_t("SQRT1_2",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?new t("0.5").sqrt():Math.SQRT1_2}),i4=_t("SQRT2",["config","?BigNumber"],r=>{var{config:e,BigNumber:t}=r;return e.number==="BigNumber"?new t(2).sqrt():Math.SQRT2}),o4=_t("i",["Complex"],r=>{var{Complex:e}=r;return e.I}),s4=L("version",[],()=>GB);function _t(r,e,t){return L(r,e,t,{recreateOnConfigChange:!0})}var u4=nr("speedOfLight","299792458","m s^-1"),l4=nr("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),c4=nr("planckConstant","6.62607015e-34","J s"),f4=nr("reducedPlanckConstant","1.0545718176461565e-34","J s"),m4=nr("magneticConstant","1.25663706212e-6","N A^-2"),v4=nr("electricConstant","8.8541878128e-12","F m^-1"),p4=nr("vacuumImpedance","376.730313667","ohm"),d4=nr("coulomb","8.987551792261171e9","N m^2 C^-2"),h4=nr("coulombConstant","8.987551792261171e9","N m^2 C^-2"),g4=nr("elementaryCharge","1.602176634e-19","C"),y4=nr("bohrMagneton","9.2740100783e-24","J T^-1"),b4=nr("conductanceQuantum","7.748091729863649e-5","S"),x4=nr("inverseConductanceQuantum","12906.403729652257","ohm"),w4=nr("magneticFluxQuantum","2.0678338484619295e-15","Wb"),D4=nr("nuclearMagneton","5.0507837461e-27","J T^-1"),N4=nr("klitzing","25812.807459304513","ohm"),E4=nr("bohrRadius","5.29177210903e-11","m"),A4=nr("classicalElectronRadius","2.8179403262e-15","m"),S4=nr("electronMass","9.1093837015e-31","kg"),C4=nr("fermiCoupling","1.1663787e-5","GeV^-2"),M4=Ro("fineStructure",.0072973525693),_4=nr("hartreeEnergy","4.3597447222071e-18","J"),T4=nr("protonMass","1.67262192369e-27","kg"),F4=nr("deuteronMass","3.3435830926e-27","kg"),O4=nr("neutronMass","1.6749271613e-27","kg"),B4=nr("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),R4=nr("rydberg","10973731.568160","m^-1"),I4=nr("thomsonCrossSection","6.6524587321e-29","m^2"),P4=Ro("weakMixingAngle",.2229),$4=Ro("efimovFactor",22.7),q4=nr("atomicMass","1.66053906660e-27","kg"),z4=nr("avogadro","6.02214076e23","mol^-1"),U4=nr("boltzmann","1.380649e-23","J K^-1"),L4=nr("faraday","96485.33212331001","C mol^-1"),k4=nr("firstRadiation","3.7417718521927573e-16","W m^2"),V4=nr("loschmidt","2.686780111798444e25","m^-3"),G4=nr("gasConstant","8.31446261815324","J K^-1 mol^-1"),H4=nr("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),W4=nr("molarVolume","0.022413969545014137","m^3 mol^-1"),Y4=Ro("sackurTetrode",-1.16487052358),Z4=nr("secondRadiation","0.014387768775039337","m K"),J4=nr("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),j4=nr("wienDisplacement","2.897771955e-3","m K"),X4=nr("molarMass","0.99999999965e-3","kg mol^-1"),Q4=nr("molarMassC12","11.9999999958e-3","kg mol^-1"),K4=nr("gravity","9.80665","m s^-2"),eR=nr("planckLength","1.616255e-35","m"),rR=nr("planckMass","2.176435e-8","kg"),tR=nr("planckTime","5.391245e-44","s"),nR=nr("planckCharge","1.87554603778e-18","C"),aR=nr("planckTemperature","1.416785e+32","K");function nr(r,e,t){var n=["config","Unit","BigNumber"];return L(r,n,a=>{var{config:i,Unit:o,BigNumber:l}=a,u=i.number==="BigNumber"?new l(e):parseFloat(e),s=new o(u,t);return s.fixPrefix=!0,s})}function Ro(r,e){var t=["config","BigNumber"];return L(r,t,n=>{var{config:a,BigNumber:i}=n;return a.number==="BigNumber"?new i(e):e})}function Ed(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function iR(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ed(Object(t),!0).forEach(function(n){Vr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ed(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var oR="mapSlices",sR=["typed","isInteger"],uR=L(oR,sR,r=>{var{typed:e,isInteger:t}=r,n=xs({typed:e,isInteger:t});return e("mapSlices",{"...any":function(i){var o=i[1];Ye(o)?i[1]=o-1:or(o)&&(i[1]=o.minus(1));try{return n.apply(null,i)}catch(l){throw ht(l)}}})},iR({isTransformFunction:!0},xs.meta)),lR="column",cR=["typed","Index","matrix","range"],fR=L(lR,cR,r=>{var{typed:e,Index:t,matrix:n,range:a}=r,i=Jf({typed:e,Index:t,matrix:n,range:a});return e("column",{"...any":function(l){var u=l.length-1,s=l[u];Ye(s)&&(l[u]=s-1);try{return i.apply(null,l)}catch(c){throw ht(c)}}})},{isTransformFunction:!0});function Qs(r,e,t){var n=r.filter(function(u){return jr(u)&&!(u.name in e)&&!t.has(u.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+r+'"');var a=n.name,i=new Map,o=new Yu(t,i,new Set([a])),l=r.compile();return function(s){return i.set(a,s),l.evaluate(o)}}var mR="transformCallback",vR=["typed"],Ks=L(mR,vR,r=>{var{typed:e}=r;return function(n,a){return e.isTypedFunction(n)?t(n,a):Ad(n,n.length,a)};function t(n,a){var i=Object.fromEntries(Object.entries(n.signatures).map(o=>{var[l,u]=o,s=l.split(",").length;return e.isTypedFunction(u)?[l,t(u,a)]:[l,Ad(u,s,a)]}));return typeof n.name=="string"?e(n.name,i):e(i)}});function Ad(r,e,t){return e===t?r:e===t+1?function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];var o=a.slice(0,t),l=Sd(a[t]);return r(...o,l)}:e>t+1?function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];var o=a.slice(0,t),l=Sd(a[t]),u=a.slice(t+1);return r(...o,l,...u)}:r}function Sd(r){return r.map(e=>e+1)}var pR="filter",dR=["typed"],hR=L(pR,dR,r=>{var{typed:e}=r;function t(a,i,o){var l=Kf({typed:e}),u=Ks({typed:e});if(a.length===0)return l();var s=a[0];if(a.length===1)return l(s);var c=a.length-1,f=a[c];return s&&(s=n(s,o)),f&&(jr(f)||ei(f)?f=n(f,o):f=Qs(f,i,o)),l(s,u(f,c))}t.rawArgs=!0;function n(a,i){return a.compile().evaluate(i)}return t},{isTransformFunction:!0}),gR="forEach",yR=["typed"],bR=L(gR,yR,r=>{var{typed:e}=r,t=tm({typed:e}),n=Ks({typed:e});function a(o,l,u){if(o.length===0)return t();var s=o[0];if(o.length===1)return t(s);var c=o.length-1,f=o[c];return s&&(s=i(s,u)),f&&(jr(f)||ei(f)?f=i(f,u):f=Qs(f,l,u)),t(s,n(f,c))}a.rawArgs=!0;function i(o,l){return o.compile().evaluate(l)}return a},{isTransformFunction:!0}),xR="index",wR=["Index","getMatrixDataType"],DR=L(xR,wR,r=>{var{Index:e,getMatrixDataType:t}=r;return function(){for(var a=[],i=0,o=arguments.length;i<o;i++){var l=arguments[i];if(jo(l))l.start--,l.end-=l.step>0?0:2;else if(l&&l.isSet===!0)l=l.map(function(s){return s-1});else if(Ar(l)||Je(l))t(l)!=="boolean"&&(l=l.map(function(s){return s-1}));else if(Ye(l)||Qa(l))l--;else if(or(l))l=l.toNumber()-1;else if(typeof l!="string")throw new TypeError("Dimension must be an Array, Matrix, number, bigint, string, or Range");a[i]=l}var u=new e;return e.apply(u,a),u}},{isTransformFunction:!0}),NR="map",ER=["typed"],AR=L(NR,ER,r=>{var{typed:e}=r,t=om({typed:e}),n=Ks({typed:e});function a(i,o,l){if(i.length===0)return t();if(i.length===1)return t(i[0]);var u=i.length-1,s=i.slice(0,u),c=i[u];return s=s.map(m=>f(m,l)),c&&(jr(c)||ei(c)?c=f(c,l):c=Qs(c,o,l)),t(...s,n(c,u));function f(m,v){return m.compile().evaluate(v)}}return a.rawArgs=!0,a},{isTransformFunction:!0});function SR(r){return Ye(r)?r-1:or(r)?r.minus(1):r}function CR(r){return Ye(r)||or(r)}function $n(r){if(r.length===2&&Mt(r[0])){r=r.slice();var e=r[1];CR(e)&&(r[1]=SR(e))}return r}var MR="max",_R=["typed","config","numeric","larger","isNaN"],TR=L(MR,_R,r=>{var{typed:e,config:t,numeric:n,larger:a,isNaN:i}=r,o=mv({typed:e,config:t,numeric:n,larger:a,isNaN:i});return e("max",{"...any":function(u){u=$n(u);try{return o.apply(null,u)}catch(s){throw ht(s)}}})},{isTransformFunction:!0}),FR="mean",OR=["typed","add","divide"],BR=L(FR,OR,r=>{var{typed:e,add:t,divide:n}=r,a=qp({typed:e,add:t,divide:n});return e("mean",{"...any":function(o){o=$n(o);try{return a.apply(null,o)}catch(l){throw ht(l)}}})},{isTransformFunction:!0}),RR="min",IR=["typed","config","numeric","smaller","isNaN"],PR=L(RR,IR,r=>{var{typed:e,config:t,numeric:n,smaller:a,isNaN:i}=r,o=pv({typed:e,config:t,numeric:n,smaller:a,isNaN:i});return e("min",{"...any":function(u){u=$n(u);try{return o.apply(null,u)}catch(s){throw ht(s)}}})},{isTransformFunction:!0}),$R="range",qR=["typed","config","?matrix","?bignumber","equal","smaller","smallerEq","larger","largerEq","add","isZero","isPositive"],zR=L($R,qR,r=>{var{typed:e,config:t,matrix:n,bignumber:a,equal:i,smaller:o,smallerEq:l,larger:u,largerEq:s,add:c,isZero:f,isPositive:m}=r,v=fm({typed:e,config:t,matrix:n,bignumber:a,equal:i,smaller:o,smallerEq:l,larger:u,largerEq:s,add:c,isZero:f,isPositive:m});return e("range",{"...any":function(d){var y=d.length-1,x=d[y];return typeof x!="boolean"&&d.push(!0),v.apply(null,d)}})},{isTransformFunction:!0}),UR="row",LR=["typed","Index","matrix","range"],kR=L(UR,LR,r=>{var{typed:e,Index:t,matrix:n,range:a}=r,i=hm({typed:e,Index:t,matrix:n,range:a});return e("row",{"...any":function(l){var u=l.length-1,s=l[u];Ye(s)&&(l[u]=s-1);try{return i.apply(null,l)}catch(c){throw ht(c)}}})},{isTransformFunction:!0}),VR="subset",GR=["typed","matrix","zeros","add"],HR=L(VR,GR,r=>{var{typed:e,matrix:t,zeros:n,add:a}=r,i=xm({typed:e,matrix:t,zeros:n,add:a});return e("subset",{"...any":function(l){try{return i.apply(null,l)}catch(u){throw ht(u)}}})},{isTransformFunction:!0}),WR="concat",YR=["typed","matrix","isInteger"],ZR=L(WR,YR,r=>{var{typed:e,matrix:t,isInteger:n}=r,a=Yf({typed:e,matrix:t,isInteger:n});return e("concat",{"...any":function(o){var l=o.length-1,u=o[l];Ye(u)?o[l]=u-1:or(u)&&(o[l]=u.minus(1));try{return a.apply(null,o)}catch(s){throw ht(s)}}})},{isTransformFunction:!0}),Cd="diff",JR=["typed","matrix","subtract","number","bignumber"],jR=L(Cd,JR,r=>{var{typed:e,matrix:t,subtract:n,number:a,bignumber:i}=r,o=um({typed:e,matrix:t,subtract:n,number:a,bignumber:i});return e(Cd,{"...any":function(u){u=$n(u);try{return o.apply(null,u)}catch(s){throw ht(s)}}})},{isTransformFunction:!0}),XR="std",QR=["typed","map","sqrt","variance"],KR=L(XR,QR,r=>{var{typed:e,map:t,sqrt:n,variance:a}=r,i=Wp({typed:e,map:t,sqrt:n,variance:a});return e("std",{"...any":function(l){l=$n(l);try{return i.apply(null,l)}catch(u){throw ht(u)}}})},{isTransformFunction:!0}),Md="sum",e5=["typed","config","add","numeric"],r5=L(Md,e5,r=>{var{typed:e,config:t,add:n,numeric:a}=r,i=Ip({typed:e,config:t,add:n,numeric:a});return e(Md,{"...any":function(l){l=$n(l);try{return i.apply(null,l)}catch(u){throw ht(u)}}})},{isTransformFunction:!0}),t5="quantileSeq",n5=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger","mapSlices"],a5=L(t5,n5,r=>{var{typed:e,bignumber:t,add:n,subtract:a,divide:i,multiply:o,partitionSelect:l,compare:u,isInteger:s,smaller:c,smallerEq:f,larger:m,mapSlices:v}=r,p=Gp({typed:e,bignumber:t,add:n,subtract:a,divide:i,multiply:o,partitionSelect:l,compare:u,isInteger:s,smaller:c,smallerEq:f,larger:m,mapSlices:v});return e("quantileSeq",{"Array | Matrix, number | BigNumber":p,"Array | Matrix, number | BigNumber, number":(y,x,D)=>p(y,x,d(D)),"Array | Matrix, number | BigNumber, boolean":p,"Array | Matrix, number | BigNumber, boolean, number":(y,x,D,h)=>p(y,x,D,d(h)),"Array | Matrix, Array | Matrix":p,"Array | Matrix, Array | Matrix, number":(y,x,D)=>p(y,x,d(D)),"Array | Matrix, Array | Matrix, boolean":p,"Array | Matrix, Array | Matrix, boolean, number":(y,x,D,h)=>p(y,x,D,d(h))});function d(y){return $n([[],y])[1]}},{isTransformFunction:!0}),_d="cumsum",i5=["typed","add","unaryPlus"],o5=L(_d,i5,r=>{var{typed:e,add:t,unaryPlus:n}=r,a=Pp({typed:e,add:t,unaryPlus:n});return e(_d,{"...any":function(o){if(o.length===2&&Mt(o[0])){var l=o[1];Ye(l)?o[1]=l-1:or(l)&&(o[1]=l.minus(1))}try{return a.apply(null,o)}catch(u){throw ht(u)}}})},{isTransformFunction:!0}),Td="variance",s5=["typed","add","subtract","multiply","divide","mapSlices","isNaN"],u5=L(Td,s5,r=>{var{typed:e,add:t,subtract:n,multiply:a,divide:i,mapSlices:o,isNaN:l}=r,u=kp({typed:e,add:t,subtract:n,multiply:a,divide:i,mapSlices:o,isNaN:l});return e(Td,{"...any":function(c){c=$n(c);try{return u.apply(null,c)}catch(f){throw ht(f)}}})},{isTransformFunction:!0}),Fd="print",l5=["typed","matrix","zeros","add"],c5=L(Fd,l5,r=>{var{typed:e,matrix:t,zeros:n,add:a}=r,i=$m({typed:e,matrix:t,zeros:n,add:a});return e(Fd,{"string, Object | Array":function(u,s){return i(o(u),s)},"string, Object | Array, number | Object":function(u,s,c){return i(o(u),s,c)}});function o(l){return l.replace(Im,u=>{var s=u.slice(1).split("."),c=s.map(function(f){return!isNaN(f)&&f.length>0?parseInt(f)-1:f});return"$"+c.join(".")})}},{isTransformFunction:!0}),f5="and",m5=["typed","matrix","zeros","add","equalScalar","not","concat"],v5=L(f5,m5,r=>{var{typed:e,matrix:t,equalScalar:n,zeros:a,not:i,concat:o}=r,l=av({typed:e,matrix:t,equalScalar:n,zeros:a,not:i,concat:o});function u(s,c,f){var m=s[0].compile().evaluate(f);if(!Mt(m)&&!l(m,!0))return!1;var v=s[1].compile().evaluate(f);return l(m,v)}return u.rawArgs=!0,u},{isTransformFunction:!0}),p5="or",d5=["typed","matrix","equalScalar","DenseMatrix","concat"],h5=L(p5,d5,r=>{var{typed:e,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=r,o=Gf({typed:e,matrix:t,equalScalar:n,DenseMatrix:a,concat:i});function l(u,s,c){var f=u[0].compile().evaluate(c);if(!Mt(f)&&o(f,!1))return!0;var m=u[1].compile().evaluate(c);return o(f,m)}return l.rawArgs=!0,l},{isTransformFunction:!0}),g5="nullish",y5=["typed","matrix","size","flatten","deepEqual"],b5=L(g5,y5,r=>{var{typed:e,matrix:t,size:n,flatten:a,deepEqual:i}=r,o=kf({typed:e,matrix:t,size:n,flatten:a,deepEqual:i});function l(u,s,c){var f=u[0].compile().evaluate(c);if(!Mt(f)&&f!=null&&f!==void 0)return f;var m=u[1].compile().evaluate(c);return o(f,m)}return l.rawArgs=!0,l},{isTransformFunction:!0}),x5="bitAnd",w5=["typed","matrix","zeros","add","equalScalar","not","concat"],D5=L(x5,w5,r=>{var{typed:e,matrix:t,equalScalar:n,zeros:a,not:i,concat:o}=r,l=Ff({typed:e,matrix:t,equalScalar:n,zeros:a,not:i,concat:o});function u(s,c,f){var m=s[0].compile().evaluate(f);if(!Mt(m)){if(isNaN(m))return NaN;if(m===0||m===!1)return 0}var v=s[1].compile().evaluate(f);return l(m,v)}return u.rawArgs=!0,u},{isTransformFunction:!0}),N5="bitOr",E5=["typed","matrix","equalScalar","DenseMatrix","concat"],A5=L(N5,E5,r=>{var{typed:e,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=r,o=Rf({typed:e,matrix:t,equalScalar:n,DenseMatrix:a,concat:i});function l(u,s,c){var f=u[0].compile().evaluate(c);if(!Mt(f)){if(isNaN(f))return NaN;if(f===-1)return-1;if(f===!0)return 1}var m=u[1].compile().evaluate(c);return o(f,m)}return l.rawArgs=!0,l},{isTransformFunction:!0}),Od="num",S5=["typed","fraction"],C5=L(Od,S5,r=>{var{typed:e,fraction:t}=r;return e(Od,{Fraction:n=>n.s*n.n,BigNumber:n=>{var a=t(n);return a.s*a.n},"Array | Matrix":e.referToSelf(n=>a=>tr(a,n))})}),Bd="den",M5=["typed","fraction"],_5=L(Bd,M5,r=>{var{typed:e,fraction:t}=r;return e(Bd,{Fraction:n=>n.d,BigNumber:n=>t(n).d,"Array | Matrix":e.referToSelf(n=>a=>tr(a,n))})}),Me=Qy({config:ye}),Mr=n1({}),Rd=QB({BigNumber:Me,config:ye}),T5=WB({}),F5=M4({BigNumber:Me,config:ye}),qn=f1({}),Id=o4({Complex:Mr}),O5=ZB({BigNumber:Me,config:ye}),B5=r4({BigNumber:Me,config:ye}),R5=n4({BigNumber:Me,config:ye}),Io=g1({}),I5=JB({BigNumber:Me,config:ye}),P5=YB({}),$5=KB({BigNumber:Me,config:ye}),q5=p1({}),Pd=ty({}),z5=a4({BigNumber:Me,config:ye}),U5=Y4({BigNumber:Me,config:ye}),$d=XB({BigNumber:Me,config:ye}),L5=HB({}),k5=s4({}),sr=B1({Matrix:Io,config:ye}),V5=$4({BigNumber:Me,config:ye}),G5=e4({BigNumber:Me,config:ye}),eu=jB({BigNumber:Me,config:ye}),qd=VB({}),H5=i4({BigNumber:Me,config:ye}),W=Q0({BigNumber:Me,Complex:Mr,DenseMatrix:sr,Fraction:qn}),W5=P4({BigNumber:Me,config:ye}),gt=Qb({typed:W}),Y5=_E({Complex:Mr,config:ye,typed:W}),Z5=BE({BigNumber:Me,typed:W}),J5=$E({BigNumber:Me,Complex:Mr,config:ye,typed:W}),Yr=tx({typed:W}),j5=Vw({typed:W}),X5=VE({BigNumber:Me,Complex:Mr,config:ye,typed:W}),Q5=ZE({typed:W}),zd=XE({typed:W}),K5=rA({Complex:Mr,config:ye,typed:W}),eI=Nb({typed:W}),rI=Pw({typed:W}),tI=Cb({typed:W}),nI=I1({typed:W}),Po=DO({typed:W}),$o=Bb({Complex:Mr,typed:W}),na=Hw({typed:W}),ru=nA({typed:W}),aI=sA({BigNumber:Me,typed:W}),iI=fA({BigNumber:Me,typed:W}),oI=yx({typed:W}),cr=mb({config:ye,typed:W}),sI=fN({typed:W}),Ud=xx({typed:W}),uI=Dx({Complex:Mr,typed:W}),lI=Kf({typed:W}),aa=vD({typed:W}),cI=tm({typed:W}),mi=DN({typed:W}),tu=gD({typed:W}),fI=MN({format:mi,typed:W}),nu=Yw({typed:W}),vi=ib({typed:W}),gn=nb({typed:W}),ia=J1({typed:W}),mI=IN({typed:W}),vI=t4({BigNumber:Me,config:ye}),pI=MO({Complex:Mr,typed:W}),dI=tw({Complex:Mr,config:ye,typed:W}),au=aw({Complex:Mr,config:ye,typed:W}),zn=om({typed:W}),hI=yN({isNaN:gn,isNumeric:ia,typed:W}),qr=sw({typed:W}),qo=Xw({typed:W}),an=xb({typed:W}),gI=SN({format:mi,typed:W}),yI=eB({config:ye,typed:W}),bI=$m({typed:W}),xI=tB({config:ye,typed:W}),iu=Jw({typed:W}),wI=dA({BigNumber:Me,typed:W}),Ld=vw({BigNumber:Me,Fraction:qn,complex:$o,typed:W}),zo=bA({typed:W}),Zr=UD({typed:W}),Jr=db({Matrix:Io,equalScalar:cr,typed:W}),DI=Wb({typed:W}),NI=yw({typed:W}),EI=Ab({typed:W}),Lt=ax({typed:W}),AI=NA({typed:W}),SI=BN({typed:W}),ou=lb({typed:W}),CI=FE({Complex:Mr,config:ye,typed:W}),MI=zE({BigNumber:Me,typed:W}),_I=LE({BigNumber:Me,Complex:Mr,config:ye,typed:W}),Et=Tb({BigNumber:Me,typed:W}),TI=EO({typed:W}),FI=iA({typed:W}),OI=vA({BigNumber:Me,typed:W}),Uo=eS({addScalar:Yr,conj:na,multiplyScalar:qr,size:Zr,typed:W}),BI=X1({isNumeric:ia,typed:W}),RI=sb({isBounded:vi,map:zn,typed:W}),Un=Y1({config:ye,typed:W}),kt=rb({equalScalar:cr,typed:W}),Ce=qb({DenseMatrix:sr,Matrix:Io,SparseMatrix:Jr,typed:W}),II=Ub({isZero:kt,matrix:Ce,typed:W}),Dr=lw({addScalar:Yr,dot:Uo,equalScalar:cr,matrix:Ce,multiplyScalar:qr,typed:W}),PI=SD({BigNumber:Me,config:ye,matrix:Ce,typed:W}),$I=aB({config:ye,log2:au,typed:W}),qI=BD({config:ye,matrix:Ce}),zI=gA({BigNumber:Me,typed:W}),UI=wA({typed:W}),LI=AE({SparseMatrix:Jr,typed:W}),Xt=hw({Complex:Mr,config:ye,typed:W}),kI=kD({typed:W}),VI=SA({typed:W}),pi=ZD({matrix:Ce,typed:W}),kd=Dw({BigNumber:Me,config:ye,matrix:Ce,typed:W}),at=QD({BigNumber:Me,config:ye,matrix:Ce,typed:W}),GI=IE({BigNumber:Me,Complex:Mr,config:ye,typed:W}),HI=HE({Complex:Mr,config:ye,typed:W}),WI=EN({format:mi,typed:W}),YI=lA({BigNumber:Me,typed:W}),su=jD({conj:na,transpose:pi,typed:W}),Vd=lD({DenseMatrix:sr,SparseMatrix:Jr,matrix:Ce,typed:W}),yt=T2({DenseMatrix:sr,SparseMatrix:Jr,equalScalar:cr,matrix:Ce,typed:W}),oa=Pb({Fraction:qn,typed:W}),Ln=bD({BigNumber:Me,DenseMatrix:sr,SparseMatrix:Jr,config:ye,matrix:Ce,typed:W}),bt=$1({equal:yt,typed:W}),ZI=wD({matrix:Ce,multiplyScalar:qr,typed:W}),di=xs({isInteger:bt,typed:W}),uu=Gb({flatten:aa,matrix:Ce,size:Zr,typed:W}),JI=C5({fraction:oa,typed:W}),Gd=TD({isInteger:bt,matrix:Ce,typed:W}),Pa=GN({BigNumber:Me,DenseMatrix:sr,config:ye,equalScalar:cr,matrix:Ce,typed:W,zeros:at}),on=Zb({typed:W}),jI=xO({BigNumber:Me,Fraction:qn,config:ye,isInteger:bt,number:an,typed:W}),Hd=ox({BigNumber:Me,Complex:Mr,Fraction:qn,config:ye,isNegative:Un,matrix:Ce,typed:W,unaryMinus:on}),xr=Yf({isInteger:bt,matrix:Ce,typed:W}),hi=Y2({equal:yt,typed:W}),XI=Mw({concat:xr,equalScalar:cr,matrix:Ce,multiplyScalar:qr,typed:W}),Wd=mf({DenseMatrix:sr,config:ye,equalScalar:cr,matrix:Ce,round:Pa,typed:W,zeros:at}),QI=Jx({BigNumber:Me,DenseMatrix:sr,concat:xr,config:ye,equalScalar:cr,matrix:Ce,round:Pa,typed:W,zeros:at}),sa=K1({config:ye,typed:W}),xt=L2({DenseMatrix:sr,SparseMatrix:Jr,bignumber:Et,concat:xr,config:ye,matrix:Ce,typed:W}),KI=Kx({concat:xr,equalScalar:cr,matrix:Ce,typed:W}),e8=v2({DenseMatrix:sr,concat:xr,equalScalar:cr,matrix:Ce,typed:W,zeros:at}),Yd=df({DenseMatrix:sr,concat:xr,config:ye,equalScalar:cr,matrix:Ce,round:Pa,typed:W,zeros:at}),r8=fw({BigNumber:Me,concat:xr,equalScalar:cr,matrix:Ce,typed:W}),t8=kf({deepEqual:hi,flatten:aa,matrix:Ce,size:Zr,typed:W}),Vt=qN({bignumber:Et,fraction:oa,number:an}),Zd=xN({config:ye,multiplyScalar:qr,numeric:Vt,typed:W}),n8=d2({DenseMatrix:sr,concat:xr,equalScalar:cr,matrix:Ce,typed:W,zeros:at}),wt=I2({DenseMatrix:sr,SparseMatrix:Jr,bignumber:Et,concat:xr,config:ye,matrix:Ce,typed:W}),Lr=xw({DenseMatrix:sr,concat:xr,equalScalar:cr,matrix:Ce,subtractScalar:Lt,typed:W,unaryMinus:on}),a8=FN({concat:xr,matrix:Ce,typed:W}),lu=jb({config:ye,numeric:Vt,typed:W}),i8=rD({DenseMatrix:sr,SparseMatrix:Jr,concat:xr,matrix:Ce,typed:W}),dr=ZA({DenseMatrix:sr,SparseMatrix:Jr,addScalar:Yr,concat:xr,equalScalar:cr,matrix:Ce,typed:W}),o8=KE({BigNumber:Me,DenseMatrix:sr,concat:xr,equalScalar:cr,matrix:Ce,typed:W}),s8=Ff({concat:xr,equalScalar:cr,matrix:Ce,typed:W}),u8=Rf({DenseMatrix:sr,concat:xr,equalScalar:cr,matrix:Ce,typed:W}),l8=Lw({DenseMatrix:sr,SparseMatrix:Jr,concat:xr,matrix:Ce,typed:W}),cu=hx({DenseMatrix:sr,config:ye,equalScalar:cr,matrix:Ce,round:Pa,typed:W,zeros:at}),ua=x2({BigNumber:Me,DenseMatrix:sr,Fraction:qn,concat:xr,config:ye,equalScalar:cr,matrix:Ce,typed:W}),Jd=M2({concat:xr,matrix:Ce,typed:W}),c8=mB({addScalar:Yr,combinations:Po,isInteger:bt,isNegative:Un,isPositive:sa,larger:xt,typed:W}),f8=iD({prod:Zd,size:Zr,typed:W}),m8=sD({matrix:Ce,multiply:Dr,subtract:Lr,typed:W}),v8=um({matrix:Ce,number:an,subtract:Lr,typed:W}),Ir=UN({numeric:Vt,typed:W}),p8=B2({compareText:Jd,isZero:kt,typed:W}),jd=fE({larger:xt,smaller:wt}),Xd=Ax({Complex:Mr,DenseMatrix:sr,ceil:cu,equalScalar:cr,floor:Wd,matrix:Ce,typed:W,zeros:at}),d8=jA({abs:gt,addScalar:Yr,divideScalar:Ir,isPositive:sa,multiplyScalar:qr,smaller:wt,sqrt:Xt,typed:W}),Qd=iE({DenseMatrix:sr,smaller:wt}),ft=uE({ImmutableDenseMatrix:Qd,getMatrixDataType:tu}),h8=oO({abs:gt,add:dr,addScalar:Yr,config:ye,divideScalar:Ir,equalScalar:cr,flatten:aa,isNumeric:ia,isZero:kt,matrix:Ce,multiply:Dr,multiplyScalar:qr,smaller:wt,subtract:Lr,typed:W}),g8=Ew({BigNumber:Me,add:dr,config:ye,equal:yt,isInteger:bt,mod:Yd,smaller:wt,typed:W,xgcd:kd}),Lo=G2({DenseMatrix:sr,SparseMatrix:Jr,concat:xr,config:ye,matrix:Ce,typed:W}),fu=YN({Complex:Mr,config:ye,divideScalar:Ir,typeOf:ou,typed:W}),Kd=n2({DenseMatrix:sr,divideScalar:Ir,equalScalar:cr,matrix:Ce,multiplyScalar:qr,subtractScalar:Lt,typed:W}),y8=kb({flatten:aa,matrix:Ce,size:Zr,typed:W}),b8=pv({config:ye,isNaN:gn,numeric:Vt,smaller:wt,typed:W}),x8=XN({Complex:Mr,config:ye,divideScalar:Ir,typed:W}),ko=Q2({compare:ua,isNaN:gn,isNumeric:ia,typed:W}),mu=lC({addScalar:Yr,complex:$o,conj:na,divideScalar:Ir,equal:yt,identity:Ln,isZero:kt,matrix:Ce,multiplyScalar:qr,sign:Ld,sqrt:Xt,subtractScalar:Lt,typed:W,unaryMinus:on,zeros:at}),w8=g2({DenseMatrix:sr,concat:xr,equalScalar:cr,matrix:Ce,typed:W,zeros:at}),eh=BC({SparseMatrix:Jr,abs:gt,add:dr,divideScalar:Ir,larger:xt,largerEq:Lo,multiply:Dr,subtract:Lr,transpose:pi,typed:W}),rh=pE({FibonacciHeap:jd,addScalar:Yr,equalScalar:cr}),Tt=xm({add:dr,matrix:Ce,typed:W,zeros:at}),vu=Ip({add:dr,config:ye,numeric:Vt,typed:W}),D8=nS({add:dr,matrix:Ce,typed:W}),pu=i2({DenseMatrix:sr,divideScalar:Ir,equalScalar:cr,matrix:Ce,multiplyScalar:qr,subtractScalar:Lt,typed:W}),N8=IB({Complex:Mr,add:dr,multiply:Dr,number:an,typed:W}),E8=cB({addScalar:Yr,combinations:Po,divideScalar:Ir,isInteger:bt,isNegative:Un,multiplyScalar:qr,typed:W}),sn=A2({compare:ua,typed:W}),A8=Pp({add:dr,typed:W,unaryPlus:lu}),th=B3({divideScalar:Ir,isZero:kt,matrix:Ce,multiply:Dr,subtractScalar:Lt,typed:W,unaryMinus:on}),gi=r2({DenseMatrix:sr,SparseMatrix:Jr,concat:xr,divideScalar:Ir,equalScalar:cr,matrix:Ce,typed:W}),nh=iS({Index:ft,typed:W}),la=I3({abs:gt,addScalar:Yr,det:th,divideScalar:Ir,identity:Ln,matrix:Ce,multiply:Dr,typed:W,unaryMinus:on}),S8=JN({Complex:Mr,config:ye,divideScalar:Ir,log:fu,typed:W}),C8=s2({DenseMatrix:sr,divideScalar:Ir,equalScalar:cr,matrix:Ce,multiplyScalar:qr,subtractScalar:Lt,typed:W}),du=mv({config:ye,isNaN:gn,larger:xt,numeric:Vt,typed:W}),M8=Gf({DenseMatrix:sr,concat:xr,equalScalar:cr,matrix:Ce,typed:W}),_8=$3({Complex:Mr,add:dr,ctranspose:su,deepEqual:hi,divideScalar:Ir,dot:Uo,dotDivide:gi,equal:yt,inv:la,matrix:Ce,multiply:Dr,typed:W}),Qt=kN({Complex:Mr,config:ye,fraction:oa,identity:Ln,inv:la,matrix:Ce,multiply:Dr,number:an,typed:W}),T8=MA({DenseMatrix:sr,Index:ft,compareNatural:sn,size:Zr,subset:Tt,typed:W}),F8=OA({DenseMatrix:sr,Index:ft,compareNatural:sn,size:Zr,subset:Tt,typed:W}),O8=PA({Index:ft,compareNatural:sn,size:Zr,subset:Tt,typed:W}),B8=UA({Index:ft,compareNatural:sn,size:Zr,subset:Tt,typed:W}),$a=q2({DenseMatrix:sr,SparseMatrix:Jr,concat:xr,config:ye,matrix:Ce,typed:W}),R8=eE({compare:ua,compareNatural:sn,matrix:Ce,typed:W}),I8=W3({abs:gt,add:dr,identity:Ln,inv:la,map:zn,max:du,multiply:Dr,size:Zr,sqrt:Xt,subtract:Lr,typed:W}),P8=J2({DenseMatrix:sr,SparseMatrix:Jr,concat:xr,config:ye,equalScalar:cr,matrix:Ce,typed:W}),ah=l2({DenseMatrix:sr,divideScalar:Ir,equalScalar:cr,matrix:Ce,multiplyScalar:qr,subtractScalar:Lt,typed:W}),$8=av({concat:xr,equalScalar:cr,matrix:Ce,not:qo,typed:W,zeros:at}),q8=_5({fraction:oa,typed:W}),z8=nO({abs:gt,addScalar:Yr,deepEqual:hi,divideScalar:Ir,multiplyScalar:qr,sqrt:Xt,subtractScalar:Lt,typed:W}),U8=KN({DenseMatrix:sr,SparseMatrix:Jr,concat:xr,equalScalar:cr,matrix:Ce,pow:Qt,typed:W}),L8=G3({abs:gt,add:dr,identity:Ln,inv:la,multiply:Dr,typed:W}),ih=eN({addScalar:Yr,ceil:cu,conj:na,divideScalar:Ir,dotDivide:gi,exp:Ud,i:Id,log2:au,matrix:Ce,multiplyScalar:qr,pow:Qt,tau:$d,typed:W}),hu=SO({BigNumber:Me,Complex:Mr,config:ye,multiplyScalar:qr,pow:Qt,typed:W}),k8=tN({conj:na,dotDivide:gi,fft:ih,typed:W}),oh=sC({DenseMatrix:sr,Spa:rh,SparseMatrix:Jr,abs:gt,addScalar:Yr,divideScalar:Ir,equalScalar:cr,larger:xt,matrix:Ce,multiplyScalar:qr,subtractScalar:Lt,typed:W,unaryMinus:on}),qa=fm({bignumber:Et,matrix:Ce,add:dr,config:ye,equal:yt,isPositive:sa,isZero:kt,larger:xt,largerEq:Lo,smaller:wt,smallerEq:$a,typed:W}),V8=hm({Index:ft,matrix:Ce,range:qa,typed:W}),sh=TA({DenseMatrix:sr,Index:ft,compareNatural:sn,size:Zr,subset:Tt,typed:W}),G8=qA({Index:ft,compareNatural:sn,size:Zr,subset:Tt,typed:W}),uh=GA({Index:ft,concat:xr,setDifference:sh,size:Zr,subset:Tt,typed:W}),Qe=wE({BigNumber:Me,Complex:Mr,Fraction:qn,abs:gt,addScalar:Yr,config:ye,divideScalar:Ir,equal:yt,fix:Xd,format:mi,isNumeric:ia,multiplyScalar:qr,number:an,pow:Qt,round:Pa,subtractScalar:Lt}),H8=p4({BigNumber:Me,Unit:Qe,config:ye}),W8=j4({BigNumber:Me,Unit:Qe,config:ye}),Y8=q4({BigNumber:Me,Unit:Qe,config:ye}),Z8=y4({BigNumber:Me,Unit:Qe,config:ye}),J8=U4({BigNumber:Me,Unit:Qe,config:ye}),lh=Jf({Index:ft,matrix:Ce,range:qa,typed:W}),j8=b4({BigNumber:Me,Unit:Qe,config:ye}),X8=d4({BigNumber:Me,Unit:Qe,config:ye}),Q8=CE({Unit:Qe,typed:W}),K8=F4({BigNumber:Me,Unit:Qe,config:ye}),ch=k3({abs:gt,add:dr,addScalar:Yr,atan:zd,bignumber:Et,column:lh,complex:$o,config:ye,cos:ru,diag:Vd,divideScalar:Ir,dot:Uo,equal:yt,flatten:aa,im:nu,inv:la,larger:xt,matrix:Ce,matrixFromColumns:uu,multiply:Dr,multiplyScalar:qr,number:an,qr:mu,re:iu,reshape:Gd,sin:zo,size:Zr,smaller:wt,sqrt:Xt,subtract:Lr,typed:W,usolve:pu,usolveAll:ah}),eP=S4({BigNumber:Me,Unit:Qe,config:ye}),yi=TO({gamma:hu,typed:W}),rP=C4({BigNumber:Me,Unit:Qe,config:ye}),tP=G4({BigNumber:Me,Unit:Qe,config:ye}),nP=K4({BigNumber:Me,Unit:Qe,config:ye}),aP=N4({BigNumber:Me,Unit:Qe,config:ye}),iP=V4({BigNumber:Me,Unit:Qe,config:ye}),oP=m4({BigNumber:Me,Unit:Qe,config:ye}),sP=X4({BigNumber:Me,Unit:Qe,config:ye}),uP=H4({BigNumber:Me,Unit:Qe,config:ye}),lP=O4({BigNumber:Me,Unit:Qe,config:ye}),cP=D4({BigNumber:Me,Unit:Qe,config:ye}),fP=PO({factorial:yi,typed:W}),mP=c4({BigNumber:Me,Unit:Qe,config:ye}),vP=rR({BigNumber:Me,Unit:Qe,config:ye}),pP=tR({BigNumber:Me,Unit:Qe,config:ye}),dP=T4({BigNumber:Me,Unit:Qe,config:ye}),hP=B4({BigNumber:Me,Unit:Qe,config:ye}),gP=f4({BigNumber:Me,Unit:Qe,config:ye}),yP=Z4({BigNumber:Me,Unit:Qe,config:ye}),bP=kA({compareNatural:sn,typed:W}),xP=u4({BigNumber:Me,Unit:Qe,config:ye}),wP=J4({BigNumber:Me,Unit:Qe,config:ye}),DP=I4({BigNumber:Me,Unit:Qe,config:ye}),NP=z4({BigNumber:Me,Unit:Qe,config:ye}),EP=E4({BigNumber:Me,Unit:Qe,config:ye}),AP=h4({BigNumber:Me,Unit:Qe,config:ye}),it=rO({divideScalar:Ir,equalScalar:cr,inv:la,matrix:Ce,multiply:Dr,typed:W}),SP=g4({BigNumber:Me,Unit:Qe,config:ye}),CP=L4({BigNumber:Me,Unit:Qe,config:ye}),MP=$B({Complex:Mr,add:dr,divide:it,matrix:Ce,multiply:Dr,typed:W}),_P=l4({BigNumber:Me,Unit:Qe,config:ye}),TP=x4({BigNumber:Me,Unit:Qe,config:ye}),fh=IC({DenseMatrix:sr,lsolve:Kd,lup:oh,matrix:Ce,slu:eh,typed:W,usolve:pu}),FP=w4({BigNumber:Me,Unit:Qe,config:ye}),OP=Q4({BigNumber:Me,Unit:Qe,config:ye}),BP=RO({add:dr,divide:it,factorial:yi,isInteger:bt,isPositive:sa,multiply:Dr,typed:W}),RP=nR({BigNumber:Me,Unit:Qe,config:ye}),IP=aR({BigNumber:Me,Unit:Qe,config:ye}),PP=Gp({bignumber:Et,add:dr,compare:ua,divide:it,isInteger:bt,larger:xt,mapSlices:di,multiply:Dr,partitionSelect:ko,smaller:wt,smallerEq:$a,subtract:Lr,typed:W}),$P=R4({BigNumber:Me,Unit:Qe,config:ye}),mh=RA({DenseMatrix:sr,Index:ft,compareNatural:sn,size:Zr,subset:Tt,typed:W}),qP=uN({abs:gt,add:dr,bignumber:Et,divide:it,isNegative:Un,isPositive:sa,larger:xt,map:zn,matrix:Ce,max:du,multiply:Dr,smaller:wt,subtract:Lr,typed:W,unaryMinus:on}),vh=oB({bignumber:Et,addScalar:Yr,combinations:Po,divideScalar:Ir,factorial:yi,isInteger:bt,isNegative:Un,larger:xt,multiplyScalar:qr,number:an,pow:Qt,subtractScalar:Lt,typed:W}),zP=NE({Unit:Qe,typed:W}),UP=uB({addScalar:Yr,isInteger:bt,isNegative:Un,stirlingS2:vh,typed:W}),LP=v4({BigNumber:Me,Unit:Qe,config:ye}),kP=k4({BigNumber:Me,Unit:Qe,config:ye}),VP=_4({BigNumber:Me,Unit:Qe,config:ye}),GP=OO({divide:it,dotDivide:gi,isNumeric:ia,log:fu,map:zn,matrix:Ce,multiply:Dr,sum:vu,typed:W}),ph=qp({add:dr,divide:it,typed:W}),HP=W4({BigNumber:Me,Unit:Qe,config:ye}),WP=eR({BigNumber:Me,Unit:Qe,config:ye}),YP=WA({Index:ft,concat:xr,setIntersect:mh,setSymDifference:uh,size:Zr,subset:Tt,typed:W}),gu=kp({add:dr,divide:it,isNaN:gn,mapSlices:di,multiply:Dr,subtract:Lr,typed:W}),ZP=A4({BigNumber:Me,Unit:Qe,config:ye}),JP=yO({add:dr,divide:it,matrix:Ce,mean:ph,multiply:Dr,pow:Qt,sqrt:Xt,subtract:Lr,sum:vu,typed:W}),dh=fO({add:dr,compare:ua,divide:it,partitionSelect:ko,typed:W}),jP=$C({add:dr,cbrt:Hd,divide:it,equalScalar:cr,im:nu,isZero:kt,multiply:Dr,re:iu,sqrt:Xt,subtract:Lr,typeOf:ou,typed:W,unaryMinus:on}),XP=Wp({map:zn,sqrt:Xt,typed:W,variance:gu}),QP=hN({BigNumber:Me,Complex:Mr,add:dr,config:ye,divide:it,equal:yt,factorial:yi,gamma:hu,isBounded:vi,isNegative:Un,multiply:Dr,pi:eu,pow:Qt,sin:zo,smallerEq:$a,subtract:Lr,typed:W}),KP=vO({abs:gt,map:zn,median:dh,subtract:Lr,typed:W}),yu=QA({abs:gt,add:dr,conj:na,ctranspose:su,eigs:ch,equalScalar:cr,larger:xt,matrix:Ce,multiply:Dr,pow:Qt,smaller:wt,sqrt:Xt,typed:W}),hh=$D({BigNumber:Me,DenseMatrix:sr,SparseMatrix:Jr,addScalar:Yr,config:ye,cos:ru,matrix:Ce,multiplyScalar:qr,norm:yu,sin:zo,typed:W,unaryMinus:on}),e6=ID({multiply:Dr,rotationMatrix:hh,typed:W}),gh=j3({identity:Ln,matrix:Ce,multiply:Dr,norm:yu,qr:mu,subtract:Lr,typed:W}),yh=Z3({abs:gt,add:dr,concat:xr,identity:Ln,index:nh,lusolve:fh,matrix:Ce,matrixFromColumns:uu,multiply:Dr,range:qa,schur:gh,subset:Tt,subtract:Lr,transpose:pi,typed:W}),r6=Q3({matrix:Ce,multiply:Dr,sylvester:yh,transpose:pi,typed:W}),za={},bi={},bh={},mt=uS({mathWithTransform:bi}),Ua=RS({Node:mt}),yn=PS({Node:mt}),ca=qS({Node:mt}),xh=kS({Node:mt}),La=mS({Node:mt}),wh=yS({Node:mt,ResultSet:Pd}),Dh=xS({Node:mt}),Nh=US({Node:mt}),t6=UB({classes:bh}),bu=VC({math:za,typed:W}),Eh=TS({Node:mt,typed:W}),n6=F3({Chain:bu,typed:W}),kn=MS({Node:mt,isBounded:vi}),ka=OS({Node:mt,size:Zr}),Va=cS({Node:mt,subset:Tt}),Ah=hS({matrix:Ce,Node:mt,subset:Tt}),Vn=HS({Unit:Qe,Node:mt,math:za}),Gn=YS({Node:mt,SymbolNode:Vn,math:za}),Kt=JS({AccessorNode:Va,ArrayNode:La,AssignmentNode:Ah,BlockNode:wh,ConditionalNode:Dh,ConstantNode:kn,FunctionAssignmentNode:Eh,FunctionNode:Gn,IndexNode:ka,ObjectNode:Ua,OperatorNode:yn,ParenthesisNode:ca,RangeNode:Nh,RelationalNode:xh,SymbolNode:Vn,config:ye,numeric:Vt,typed:W}),Sh=CB({ConstantNode:kn,FunctionNode:Gn,OperatorNode:yn,ParenthesisNode:ca,parse:Kt,typed:W}),xu=DB({bignumber:Et,fraction:oa,AccessorNode:Va,ArrayNode:La,ConstantNode:kn,FunctionNode:Gn,IndexNode:ka,ObjectNode:Ua,OperatorNode:yn,SymbolNode:Vn,config:ye,isBounded:vi,mathWithTransform:bi,matrix:Ce,typed:W}),a6=XS({parse:Kt,typed:W}),Vo=KS({parse:Kt,typed:W}),Ch=UC({evaluate:Vo}),Mh=tC({evaluate:Vo,parse:Kt}),wu=EB({AccessorNode:Va,ArrayNode:La,ConstantNode:kn,FunctionNode:Gn,IndexNode:ka,ObjectNode:Ua,OperatorNode:yn,ParenthesisNode:ca,SymbolNode:Vn,add:dr,divide:it,equal:yt,isZero:kt,multiply:Dr,parse:Kt,pow:Qt,subtract:Lr,typed:W}),i6=_3({Help:Ch,mathWithTransform:bi,typed:W}),Go=bB({AccessorNode:Va,ArrayNode:La,ConstantNode:kn,FunctionNode:Gn,IndexNode:ka,ObjectNode:Ua,OperatorNode:yn,ParenthesisNode:ca,SymbolNode:Vn,equal:yt,parse:Kt,replacer:qd,resolve:Sh,simplifyConstant:xu,simplifyCore:wu,typed:W}),o6=_B({OperatorNode:yn,parse:Kt,simplify:Go,typed:W}),s6=FB({ConstantNode:kn,FunctionNode:Gn,OperatorNode:yn,ParenthesisNode:ca,SymbolNode:Vn,config:ye,equal:yt,isZero:kt,numeric:Vt,parse:Kt,simplify:Go,typed:W}),u6=iC({Parser:Mh,typed:W}),l6=pB({parse:Kt,typed:W}),c6=BB({bignumber:Et,fraction:oa,AccessorNode:Va,ArrayNode:La,ConstantNode:kn,FunctionNode:Gn,IndexNode:ka,ObjectNode:Ua,OperatorNode:yn,ParenthesisNode:ca,SymbolNode:Vn,add:dr,config:ye,divide:it,equal:yt,isZero:kt,mathWithTransform:bi,matrix:Ce,multiply:Dr,parse:Kt,pow:Qt,simplify:Go,simplifyConstant:xu,simplifyCore:wu,subtract:Lr,typed:W});zr(za,{e:Rd,false:T5,fineStructure:F5,i:Id,Infinity:O5,LN10:B5,LOG10E:R5,NaN:I5,null:P5,phi:$5,SQRT1_2:z5,sackurTetrode:U5,tau:$d,true:L5,E:Rd,version:k5,efimovFactor:V5,LN2:G5,pi:eu,replacer:qd,reviver:t6,SQRT2:H5,typed:W,PI:eu,weakMixingAngle:W5,abs:gt,acos:Y5,acot:Z5,acsc:J5,addScalar:Yr,arg:j5,asech:X5,asinh:Q5,atan:zd,atanh:K5,bigint:eI,bitNot:rI,boolean:tI,clone:nI,combinations:Po,complex:$o,conj:na,cos:ru,cot:aI,csc:iI,cube:oI,equalScalar:cr,erf:sI,exp:Ud,expm1:uI,filter:lI,flatten:aa,forEach:cI,format:mi,getMatrixDataType:tu,hex:fI,im:nu,isBounded:vi,isNaN:gn,isNumeric:ia,isPrime:mI,LOG2E:vI,lgamma:pI,log10:dI,log2:au,map:zn,mode:hI,multiplyScalar:qr,not:qo,number:an,oct:gI,pickRandom:yI,print:bI,random:xI,re:iu,sec:wI,sign:Ld,sin:zo,size:Zr,splitUnit:DI,square:NI,string:EI,subtractScalar:Lt,tan:AI,toBest:SI,typeOf:ou,acosh:CI,acsch:MI,asec:_I,bignumber:Et,chain:n6,combinationsWithRep:TI,cosh:FI,csch:OI,dot:Uo,hasNumericValue:BI,isFinite:RI,isNegative:Un,isZero:kt,matrix:Ce,matrixFromFunction:II,multiply:Dr,ones:PI,randomInt:$I,resize:qI,sech:zI,sinh:UI,sparse:LI,sqrt:Xt,squeeze:kI,tanh:VI,transpose:pi,xgcd:kd,zeros:at,acoth:GI,asin:HI,bin:WI,coth:YI,ctranspose:su,diag:Vd,equal:yt,fraction:oa,identity:Ln,isInteger:bt,kron:ZI,mapSlices:di,matrixFromColumns:uu,num:JI,reshape:Gd,round:Pa,unaryMinus:on,bernoulli:jI,cbrt:Hd,concat:xr,deepEqual:hi,dotMultiply:XI,floor:Wd,gcd:QI,isPositive:sa,larger:xt,lcm:KI,leftShift:e8,mod:Yd,nthRoot:r8,nullish:t8,numeric:Vt,prod:Zd,rightArithShift:n8,smaller:wt,subtract:Lr,to:a8,unaryPlus:lu,xor:i8,add:dr,atan2:o8,bitAnd:s8,bitOr:u8,bitXor:l8,ceil:cu,compare:ua,compareText:Jd,composition:c8,count:f8,cross:m8,diff:v8,divideScalar:Ir,equalText:p8,fix:Xd,hypot:d8,intersect:h8,invmod:g8,largerEq:Lo,log:fu,lsolve:Kd,matrixFromRows:y8,min:b8,nthRoots:x8,partitionSelect:ko,qr:mu,rightLogShift:w8,slu:eh,subset:Tt,sum:vu,trace:D8,usolve:pu,zpk2tf:N8,catalan:E8,compareNatural:sn,cumsum:A8,det:th,dotDivide:gi,index:nh,inv:la,log1p:S8,lsolveAll:C8,max:du,or:M8,pinv:_8,pow:Qt,setCartesian:T8,setDistinct:F8,setIsSubset:O8,setPowerset:B8,smallerEq:$a,sort:R8,sqrtm:I8,unequal:P8,usolveAll:ah,and:$8,den:q8,distance:z8,dotPow:U8,expm:L8,fft:ih,gamma:hu,ifft:k8,lup:oh,range:qa,row:V8,setDifference:sh,setMultiplicity:G8,setSymDifference:uh,vacuumImpedance:H8,wienDisplacement:W8,atomicMass:Y8,bohrMagneton:Z8,boltzmann:J8,column:lh,conductanceQuantum:j8,coulomb:X8,createUnit:Q8,deuteronMass:K8,eigs:ch,electronMass:eP,factorial:yi,fermiCoupling:rP,gasConstant:tP,gravity:nP,klitzing:aP,loschmidt:iP,magneticConstant:oP,molarMass:sP,molarPlanckConstant:uP,neutronMass:lP,nuclearMagneton:cP,permutations:fP,planckConstant:mP,planckMass:vP,planckTime:pP,protonMass:dP,quantumOfCirculation:hP,reducedPlanckConstant:gP,secondRadiation:yP,setSize:bP,speedOfLight:xP,stefanBoltzmann:wP,thomsonCrossSection:DP,avogadro:NP,bohrRadius:EP,coulombConstant:AP,divide:it,elementaryCharge:SP,faraday:CP,freqz:MP,gravitationConstant:_P,inverseConductanceQuantum:TP,lusolve:fh,magneticFluxQuantum:FP,molarMassC12:OP,multinomial:BP,planckCharge:RP,planckTemperature:IP,quantileSeq:PP,rydberg:$P,setIntersect:mh,solveODE:qP,stirlingS2:vh,unit:zP,bellNumbers:UP,electricConstant:LP,firstRadiation:kP,hartreeEnergy:VP,kldivergence:GP,mean:ph,molarVolume:HP,planckLength:WP,setUnion:YP,variance:gu,classicalElectronRadius:ZP,corr:JP,median:dh,parse:Kt,polynomialRoot:jP,resolve:Sh,simplifyConstant:xu,std:XP,zeta:QP,compile:a6,evaluate:Vo,mad:KP,simplifyCore:wu,help:i6,norm:yu,rotationMatrix:hh,simplify:Go,symbolicEqual:o6,derivative:s6,parser:u6,rotate:e6,leafCount:l6,rationalize:c6,schur:gh,sylvester:yh,lyap:r6,config:ye}),zr(bi,za,{map:AR({typed:W}),filter:hR({typed:W}),forEach:bR({typed:W}),mapSlices:uR({isInteger:bt,typed:W}),or:h5({DenseMatrix:sr,concat:xr,equalScalar:cr,matrix:Ce,typed:W}),and:v5({add:dr,concat:xr,equalScalar:cr,matrix:Ce,not:qo,typed:W,zeros:at}),cumsum:o5({add:dr,typed:W,unaryPlus:lu}),max:TR({config:ye,isNaN:gn,larger:xt,numeric:Vt,typed:W}),nullish:b5({deepEqual:hi,flatten:aa,matrix:Ce,size:Zr,typed:W}),print:c5({add:dr,matrix:Ce,typed:W,zeros:at}),bitAnd:D5({add:dr,concat:xr,equalScalar:cr,matrix:Ce,not:qo,typed:W,zeros:at}),concat:ZR({isInteger:bt,matrix:Ce,typed:W}),diff:jR({bignumber:Et,matrix:Ce,number:an,subtract:Lr,typed:W}),min:PR({config:ye,isNaN:gn,numeric:Vt,smaller:wt,typed:W}),subset:HR({add:dr,matrix:Ce,typed:W,zeros:at}),bitOr:A5({DenseMatrix:sr,concat:xr,equalScalar:cr,matrix:Ce,typed:W}),sum:r5({add:dr,config:ye,numeric:Vt,typed:W}),index:DR({Index:ft,getMatrixDataType:tu}),row:kR({Index:ft,matrix:Ce,range:qa,typed:W}),column:fR({Index:ft,matrix:Ce,range:qa,typed:W}),mean:BR({add:dr,divide:it,typed:W}),range:zR({bignumber:Et,matrix:Ce,add:dr,config:ye,equal:yt,isPositive:sa,isZero:kt,larger:xt,largerEq:Lo,smaller:wt,smallerEq:$a,typed:W}),variance:u5({add:dr,divide:it,isNaN:gn,mapSlices:di,multiply:Dr,subtract:Lr,typed:W}),quantileSeq:a5({add:dr,bignumber:Et,compare:ua,divide:it,isInteger:bt,larger:xt,mapSlices:di,multiply:Dr,partitionSelect:ko,smaller:wt,smallerEq:$a,subtract:Lr,typed:W}),std:KR({map:zn,sqrt:Xt,typed:W,variance:gu})}),zr(bh,{BigNumber:Me,Complex:Mr,Fraction:qn,Matrix:Io,Node:mt,ObjectNode:Ua,OperatorNode:yn,ParenthesisNode:ca,Range:q5,RelationalNode:xh,ResultSet:Pd,ArrayNode:La,BlockNode:wh,ConditionalNode:Dh,DenseMatrix:sr,RangeNode:Nh,Chain:bu,FunctionAssignmentNode:Eh,SparseMatrix:Jr,ConstantNode:kn,IndexNode:ka,FibonacciHeap:jd,ImmutableDenseMatrix:Qd,Index:ft,Spa:rh,AccessorNode:Va,AssignmentNode:Ah,Unit:Qe,SymbolNode:Vn,FunctionNode:Gn,Help:Ch,Parser:Mh}),bu.createProxy(za);const ot=class ot{constructor(){}static GetExpressions(e,t){let n=[];for(var a=0,i="";e.length>0;){if(!this.HasFunctionInside(e)&&e.indexOf(",")==-1){n.push(new vt(e));break}if(e.substring(a,a+1)=="("){var o=this.FindEnd(e);if(o==-1)throw"Unbalanced brackets!!!! Expression:"+e;i!=""&&(n.push(new Hn(i)),i=""),n.push(new vt(e.substring(0,o+1))),o<e.length?e=e.substring(o+1):e="";continue}if(e.startsWith("N.%")){i!=""&&(n.push(new Hn(i)),i="");var l=e.substring(3).indexOf("%")+1;n.push(new wn(e.substring(2,l+3),!0)),e=e.substring(l+3);continue}if(e.substring(0,1)=="%"){i!=""&&(n.push(new Hn(i)),i="");var l=e.substring(1).indexOf("%")+1;n.push(new wn(e.substring(0,l+1),!1)),e=e.substring(l+1);continue}if(e.substring(a,a+1)==","){i!=""&&(n.push(new vt(i)),i=""),n.push(new St(e.substring(0,1),"")),1<e.length?e=e.substring(1):e="";continue}var u=!1;if(We.operators.forEach(m=>{if(e.startsWith(m)){i!=""&&(n.push(new vt(i)),i=""),n.push(new Ei(e.substring(0,m.length))),e=e.substring(m.length),u=!0;return}}),u)continue;for(let m=0;m<We.logicaloperators.length;m++){let v=We.logicaloperators[m];if(e.startsWith(v)){i!=""&&(n.push(new vt(i)),i=""),n.push(new Yo(e.substring(0,v.length))),e=e.substring(v.length),u=!0;break}}if(u)continue;var s=!1;let f=e.toLowerCase();var c=Object.keys(ot._suportedFunctions);for(let m=0;m<c.length;m++){let v=c[m];if(f.startsWith(v)){i!=""&&(n.push(new vt(i)),i="");var o=this.FindEnd(e);if(o==-1)throw"Unbalanced brackets!!!! Expression:"+e;let d=Reflect.construct(ot._suportedFunctions[v],[e.substring(0,o+1),v]);n.push(d),o<e.length?e=e.substring(o+1):e="",s=!0;break}}s||(i+=e.substring(0,1),e=e.substring(1))}return i!=""&&(n.push(new vt(i)),i=""),n}static HasFunctionInside(e){if(e==null||e=="")return!1;var t=!1;const n=e.toLowerCase();return Object.keys(ot._suportedFunctions).forEach(a=>{if(n.indexOf(a)!=-1){t=!0;return}}),t}static StartsWithFunction(e){const t=e.toLowerCase();var n=!1;return Object.keys(ot._suportedFunctions).forEach(a=>{if(t.startsWith(a)){n=!0;return}}),n}static FindEnd(e){for(var t=0,n=0,a=0;a<e.length;a++)if(e.substring(a,a+1)=="("?n++:e.substring(a,a+1)==")"&&t++,n>0&&n==t)return a;return-1}static ConcatValues(e,t,n,a,i){if(e==null)return null;if(e.length==1)return e[0].Evaluate(t,n,a,i);let o="";for(let l=0;l<e.length;l++){let u=e[l].Evaluate(t,n,a,i);typeof u=="number"?o+=u.toString():u instanceof Date?o+=u.toISOString():o+=u}return o}static CastToTypeNet(e,t){let n=null;if(t==null)return null;switch(e.TypeNET){case"decimal":{n=parseFloat(t);break}case"int":{n=parseInt(t);break}case"bool":{this.toString().toLowerCase()=="true"||this.toString().toLowerCase()=="false"||(n=t);break}default:{n=t;break}}return n}static ParseAndFillExpression(e,t,n,a,i,o,l){if(n==null)return null;var u=ot.ParseExpressionAndReturnValue(e,n,t,a,0);if(console.log(t.FieldName+" "+e+" "+u),u!=null)if(t.Type=="decimal"||t.Type=="int")try{if(u=="0/0")return a.Record[t.FieldName]=0,0;if(u=="*(-1)")return null;const c=Vo(u);return console.log(t.FieldName+" "+e+" RET: "+u+" EVAL:"+c),c}catch{if(l)return console.log(t.FieldName+" "+e+" Err: 0"),0;var s=ot.CastToTypeNet(t,u);return console.log(t.FieldName+" "+e+" Err: "+s),s}else{var s=ot.CastToTypeNet(t,u);return console.log(t.FieldName+" "+e+" Ret: "+s),s}else return console.log(t.FieldName+" "+e+" Value: "+u),u}static ParseExpressionAndReturnValue(e,t,n,a,i){var s;if(e==null||t==null)return null;let o=null;try{o=ot.GetExpressions(e,null)}catch{debugger}if(o==null)return null;o[0]instanceof vt;var l=a.Record;if(o.length==1){var u=o[0].Evaluate(t,a,l,n);if(u==null)return null;if(u instanceof Date){if(n.TypeDDD=="Date")return We.getIsoDate(u);if(n.TypeDDD=="DateTime")return We.getIsoDateTime(u)}else if(typeof u=="number")return u.toString();return u.toString()}return(s=ot.ConcatValues(o,t,a,l,n))==null?void 0:s.toString()}static ValueExpresion(e,t,n,a){var g;if(t=="null")return null;if(!t.startsWith("%")&&!t.endsWith("%"))return t;let i="";try{i=t.substring(1,t.length-1)}catch(b){throw e!=null?e.FieldName+" "+e.ValueExpression+" Expression:"+t+b:t+b}var o=i.split("."),l=o[0];switch(l){case"V":return n.GetValues(o[1]);case"E":{const b=o[1],A=o[2];if(b.toLowerCase()=="eu_scr")return n.ExternalTables.EU_SCR[A];if(b.toLowerCase()=="session"){for(var u=n.ExternalTables.Session,s=2;s<o.length;s++)if(u[o[s]]!=null)u=u[o[s]];else return null;return u}else return""}case"S":{if(n.Settings==null||n.Settings[o[1]]==null)throw"Can't find setting for "+o[1];var c=n.Settings[o[1]];return c.Value}default:{if(o.length==2){var f=o[0],m=o[1];if(f==((g=a==null?void 0:a.Parent)==null?void 0:g.Tablename)){var v=ot.ReturnFromObject(a.Record,m);if(v.found===!0)return v.return}var p=n.FindTableLevel(f);if(p!=null){if(p.Record!=null){var d=p.Record,v=ot.ReturnFromObject(d.Record,m);if(v.found===!0)return v.return;if(v.found===!1&&m=="InvIssueDate")return null;if(v.found===!1&&m.indexOf("__")!=-1){var y=ot.ReturnFromObject(d.Record,m);if(y.found===!0)return y.return}return null}else if(p.Records!=null){var x=p.Records,D=x.Records.filter(b=>b==a);if(D.length>0){var h=D[0],w=h.Record,v=ot.ReturnFromObject(w,m);if(v.found===!0)return v.return;if(v.found===!1&&m.indexOf("__")!=-1){var y=ot.ReturnFromObject(h.Record,m);if(y.found===!0)return y.return}if(m=="ItemRetailPriceInp"||m=="ItemVatCodeSC__VCCode_EN16931")return null;throw"Can't evaluate "+t+" key:"+e.FieldName}}}}break}}return null}static ReturnFromObject(e,t){return Object.keys(e).indexOf(t)==-1?{found:!1,return:null}:e[t]==null?{found:!0,return:null}:e[t]instanceof Date?{found:!0,return:e[t]}:{found:!0,return:e[t].toString()}}};ot._suportedFunctions={"tonull(":i0,"sum(":qh,"if(":$h,"calcdate(":zh,"addleadzeros(":Ih,"starts(":Uh,"substr(":Lh,"count(":kh,"check(":Gh,"concat(":Vh,"empty(":Bu,"nonempty(":Bu,"exists(":Ou,"notexists(":Ou,"noeval(":o0,"appear(":Ph,"value(":Wh,"year(":Jh,"month(":jh,"screxists(":f0,"inlist(":Tu,"notinlist(":Tu,"indetail(":Fu,"notindetail(":Fu,"upper(":_u,"lower(":_u,"trim(":Hh,"totalminutes(":s0,"datetimeformat(":a0,"time(":u0,"clean(":Xh,"fromcodelist(":c0,"len(":l0,"registrycheck(":Zh,"extract(":Qh,"usefirst(":Yh};let He=ot;class Ft{static GetRecords(e,t){return t.GetReferenceRecords("__VatRate")}static SumByFieldNameAndVarCode(e,t,n){var a=this.GetRecords(t,n);if(a==null)return 0;for(var i=0,o=0;o<a.length;o++)i+=a[o].Record[e]??0;return i}static GetFirstRecordItem(e,t){var n=this.GetRecords(e,t);return n==null?null:n[0]}}class f6{static Execute(e,t,n,a){if(t==null)return"Invoice object is null";switch(e.FieldName){case"VatInvAllowAmount":{n.SetValueToKey(e,Ft.SumByFieldNameAndVarCode("LineInvAllowAmount",t,n),a);break}case"VatTaxableAmount":{n.SetValueToKey(e,Ft.SumByFieldNameAndVarCode("LineTotalNetAmount",t,n),a);break}case"VatTaxAmount":{n.SetValueToKey(e,Ft.SumByFieldNameAndVarCode("LineTotalVatAmount",t,n),a);break}case"VatInvChargeAmount":{n.SetValueToKey(e,Ft.SumByFieldNameAndVarCode("LineTotalVatAmount",t,n),a);break}case"VatInvAllowBaseAmount":{n.SetValueToKey(e,Ft.SumByFieldNameAndVarCode("LineBaseAmountInclAllow",t,n),a);break}case"VatInvChargeBaseAmount":{n.SetValueToKey(e,Ft.SumByFieldNameAndVarCode("LineTotalVatAmount",t,n),a);break}case"VatCatCode":{var i=Ft.GetFirstRecordItem(t,n);i!=null&&n.SetValueToKey(e,i.RecordAnalitic.ItemVatCodeSC__VCCode_EN16931,a);break}case"VatCode":{var i=Ft.GetFirstRecordItem(t,n);i!=null&&n.SetValueToKey(e,i.RecordAnalitic.ItemVatCodeSC__VatCode,a);break}case"VatRate":{var i=Ft.GetFirstRecordItem(t,n);i!=null&&n.SetValueToKey(e,i.RecordAnalitic.ItemVatCodeSC__Rate,a);break}case"VatCodeUI":{var i=Ft.GetFirstRecordItem(t,n);i!=null&&n.SetValueToKey(e,i.RecordAnalitic.ItemVatCodeSC__GroupUIVatCode,a);break}case"VatExemptReasonDesc":{var o=Ft.GetRecords(t,n);if(o!=null&&o.length>0){for(var l=new Set,u=0;u<o.length;u++){var s=o[u];if(s.Record.ItemVatCodeSC__VatCode=="E_999"){l.add(s.Record.VatExemReasonDescE_999??"");continue}l.add(s.RecordAnalitic.ItemVatCodeSC__VERDesc??"")}const c=new Set([...l].filter(f=>f!=""));c.size>0?n.SetValueToKey(e,[...c].join(", "),a):n.SetValueToKey(e,null,a)}break}case"VatExemptReasonCode":{var i=Ft.GetFirstRecordItem(t,n);i!=null&&n.SetValueToKey(e,null,a);break}case"NumOfItems":{var o=Ft.GetRecords(t,n);o!=null&&n.SetValueToKey(e,o.length,a);break}}}}class m6{static Execute(e,t,n,a){if(t==null)return"Invoice object is null";switch(e.FieldName){case"LineIdent":{var i=this.GetRecords(t),o=i.indexOf(n)+1;n.SetValueToKey(e,o,a);break}}}static GetRecords(e){var t=e.FindTableLevel("EU_Invoices_Items");if(t==null)throw Error("Can't find level EU_Invoices_Items");var n=t.Records;return(n==null?void 0:n.Records)??[]}}const bn=class bn{static IsDetailTable(e){return this._objectTablesDetail.indexOf(e)!=-1}static isMultiple(e){return e=="EU_Invoices_Items_Classes"||e=="EU_Invoices_Items_AllowsCharges"||e=="EU_Invoices_CN_IICRefs_Items"||e=="EU_Invoices_AdvanceUsage"||e=="EU_Invoices_AdvanceUsageVatCode"||e=="EU_Invoices_Items_Attributes"}static GetMultipleParent(e){return this.__multipleParent[e]?this.__multipleParent[e]:null}static GetTableForAlias(e){return this._dicAliasMap[e]??e}static GetTableFromAlias(e){for(var t=Object.keys(this._dicAliasMap),n=0;n<t.length;n++)if(this._dicAliasMap[t[n]]==e)return t[n];return e}};bn.masterEntity="EU_Invoices",bn.itemsEntity="EU_Invoices_Items",bn.vatEntity="EU_Invoices_Vats",bn.paymentInstrsEntity="EU_Invoices_PaymentInstrs",bn._objectTablesDetail=["EU_Invoices_Items","EU_Invoices_Items_Classes","EU_Invoices_Items_Attributes","EU_Invoices_Items_AllowsCharges","EU_Invoices_Errors","EU_Invoices_PaymentInstrs","EU_Invoices_Vats","EU_Invoices_VatsFisc","EU_Invoices_VatsCatCode","EU_Invoices_VatsUI","EU_Invoices_PrecedInvs","EU_Invoices_AllowsCharges","EU_Invoices_AddRefDocs","EU_Invoices_AdvanceUsage"],bn._dicAliasMap={EU_Invoices:"Invoice",EU_Invoices_CN_IICRefs:"CreditNoteRefs",EU_Invoices_Items:"Items",EU_Invoices_PaymentInstrs:"Payments",EU_Invoices_AddRefDocs:"Attachments",EU_Invoices_Items_Classes:"ItemsClasses",EU_Invoices_Items_Attributes:"ItemsAttributes",EU_Invoices_Items_Incomes:"ItemsIncomes",EU_Invoices_Items_Expenses:"ItemsExpenses",EU_Invoices_Items_AllowsCharges:"ItemsAllowsCharges"},bn.__multipleParent={EU_Invoices_Items_Classes:"EU_Invoices_Items",EU_Invoices_Items_AllowsCharges:"EU_Invoices_Items",EU_Invoices_CN_IICRefs_Items:"EU_Invoices_Items",EU_Invoices_Items_Attributes:"EU_Invoices_Items",EU_Invoices_Items_Incomes:"EU_Invoices_Items",EU_Invoices_Items_Expenses:"EU_Invoices_Items"};let Ot=bn;class Ga{constructor(e,t,n){if(this.Details=null,this.IsDefaultRecord=!1,this._LeftInstance=null,this._referenceRecords=null,this.RecordAnalitic={},this.Parent=n,e._details!=null){var a={},i=Object.keys(e._details);i.forEach(o=>{var l;a[o]=new xn(o,e._details[o],t,((l=this.Parent)==null?void 0:l.Root)??null)}),this.Details=a,delete e._details}this.Record={}}SetReferenceRecords(e,t){this._referenceRecords==null&&(this._referenceRecords=new Map),this._referenceRecords.set(e,t)}GetReferenceRecords(e){return this._referenceRecords==null?null:this._referenceRecords.get(e)??null}SetLeftInstanceReference(e){this._LeftInstance=e}GetLeftInstanceReference(){return this._LeftInstance}AddDetail(e,t){this.Details==null&&(this.Details={}),this.Details[e]=t}GetDetail(e){return this.Details==null?null:this.Details[e]}HasDetails(e){return this.Details==null?!1:this.Details[e]!=null}SetValueToKey(e,t,n){if(n!=null&&n==this.Record&&(this.RecordAnalitic[e.FieldName]=t),t==null){this.Record[e.FieldName]=null;return}if(e.FieldName!=null){if(typeof t=="string")switch(e.Type){case"int":{t=parseInt(t);break}case"decimal":{t=parseFloat(t);break}case"bool":case"boolean":{t=i=>i.trim().toLowerCase()==="true";break}}if(e.RoundTo!=null){var a=e.RoundTo;typeof t=="number"&&(t=this.roundUp(t,a))}}this.Record[e.FieldName]=t}SetValueToKeyString(e,t,n){if(n!=null&&(this.RecordAnalitic[e]=t),t==null){this.Record[e]=null;return}this.Record[e]=t}roundUp(e,t){let n=!1;e<0?n=!0:n=!1,n?e=e-10**-13:e=e+10**-13,e=Math.abs(e);let a=Math.round(e*Math.pow(10,t))/Math.pow(10,t);return n?-1*a:a}GetObject(){var e=JSON.parse(JSON.stringify(this.Record));if(this.Details!=null){let t=JSON.parse("{}");for(let n=0;n<this.Details.length;n++){let a=this.Details[n].GetObject();a!=null&&(t[this.Details[n].Tablename]=a)}e._details=t}return e}TranslateObj(e){if(this.Details!=null)for(let i=0;i<this.Details.length;i++)this.Details[i].TranslateObj(e);var t=Object.keys(this.Record),n=Object.keys(e),a=t.filter(i=>n.indexOf(i)!=-1);a.length>0&&a.forEach(i=>{var o=e[i].data[this.Record[e[i].key]];o!=null&&(this.Record[i]=e[i].data[this.Record[e[i].key]])})}MapToId(e){e.length!=0&&e.forEach(t=>{this.MapToIdItem(t)})}MapToIdItem(e){var d,y,x,D;if(e==null)return null;var t={},n=e.FieldName,a=Object.keys(this.Record),i=Object.keys((((y=(d=this.Parent)==null?void 0:d.Root)==null?void 0:y.ObjectInfo)??{})[e.TableName??""]).filter(h=>h.startsWith(n+"__")),o=a.filter(h=>h.startsWith(n+"__"));e.FieldName=="ItemVatCodeSC";for(let h=0;h<o.length;h++){var l=o[h].substring((n+"__").length);this.Record[o[h]]!=null&&(t[l]=this.Record[o[h]])}if(Object.keys(t).length==0||e.ConnTable==null)return null;var u=(D=(x=this.Parent)==null?void 0:x.Root)==null?void 0:D.CodeListCache[e.ConnTable],s=Object.keys(t);let c=u;for(let h=0;h<s.length;h++){var f=s[h];if(c=c.filter(w=>w[f]==t[f]),c.length==0)return null}if(c.length>1)throw"More than 1 record found for "+e.FieldName+" with value "+JSON.stringify(t);var m=c[0];this.Record[e.FieldName]=m[e.ByKey??"Id"];for(let h=0;h<i.length;h++){var f=i[h],v=f.substring((n+"__").length);this.Record[f]=m[v]}var p=Object.keys(m);for(let h=0;h<p.length;h++){var f=p[h];this.RecordAnalitic[e.FieldName+"__"+f]=m[f]}}EvaluateInner(e){e.length!=0&&e.forEach(t=>{var a,i,o,l,u;if(((i=(a=this.Parent)==null?void 0:a.Root)==null?void 0:i.EvalType)=="Init"){if(this.Record[t.FieldName]==null&&t.ValueExpressionInit!=null){var n=He.ParseAndFillExpression(t.ValueExpressionInit,t,((o=this==null?void 0:this.Parent)==null?void 0:o.Root)??null,this,this.Record,!0,!1);this.Record[t.FieldName]=n}}else((u=(l=this.Parent)==null?void 0:l.Root)==null?void 0:u.EvalType)=="Eval"&&this.Evaluate(t)})}Evaluate(e){var a,i,o,l;if(!(e.EvalOnlyIfEmpty===!0&&this.Record[e.FieldName]!=null)){if(e.EvaluateOnlyIF!=null){var t=He.ParseExpressionAndReturnValue(e.EvaluateOnlyIF,((a=this==null?void 0:this.Parent)==null?void 0:a.Root)??null,e,this,0);if(t==null||t.toUpperCase()!="TRUE")return}if(e.ValueExpression!=null){var n=He.ParseAndFillExpression(e.ValueExpression,e,((i=this==null?void 0:this.Parent)==null?void 0:i.Root)??null,this,this.Record,!0,!1);this.SetValueToKey(e,n,this.Record)}else this.Record[e.FieldName]==null&&this.SetValueToKey(e,null,this.Record);switch(e.GetValueFrom){case"Code":{switch(e.TableName){case"EU_Invoices_VatsUI":{f6.Execute(e,((o=this.Parent)==null?void 0:o.Root)??null,this,this.Record);break}case"EU_Invoices_Items":{m6.Execute(e,((l=this.Parent)==null?void 0:l.Root)??null,this,this.Record);break}}break}}}}ParseExpressionAndReturnValue(e,t){return this.ParseExpressionAndReturnValueNew(e,t)}ParseExpressionAndReturnValueNew(e,t){var a;if(((a=this.Parent)==null?void 0:a.Root)==null)return null;var n=He.ParseAndFillExpression(e,t,this.Parent.Root,this,this.Record,!1,!1);return n}valueToType(e){return e==null||e=="null"?null:typeof e!="string"?e:e.toLocaleLowerCase()=="true"?!0:e.toLocaleLowerCase()=="false"?!1:isNaN(parseFloat(e))?e:parseFloat(e)}ValueExpresion(e){var i,o,l;if(e==null)return null;if(!e.startsWith("%")||!e.endsWith("%"))return this.valueToType(e);let n=e.substring(1,e.length-1).split(".");var a=n[0];switch(a){case"V":return console.warn("V not supported!"),null;case"E":{const u=n[1];if(u!="EU_AOrg"){if(u!="EU_SCR"){if(u!="Session")return console.warn("Other E not supported!"),null}}break}case"S":return console.warn("S not supported!"),null;default:{if(n.length==2){const u=n[0];if(u==((i=this.Parent)==null?void 0:i.Tablename))return this.Record[n[1]];{let s=(l=(o=this.Parent)==null?void 0:o.Root)==null?void 0:l.FindTableLevel(u);if(s!=null&&s.Record!=null&&(s==null?void 0:s.Record)!=null)return this.valueToType(s==null?void 0:s.Record.Record[n[1]])}}break}}return null}getSaveObject(e){var i,o,l;const t={};if(this.Details!=null){const u={};for(let s=0;s<this.Details.length;s++){const c=this.Details[s].getSaveObject(e);c!=null&&(u[this.Details[s].Tablename]=c)}Object.keys(u).length>0&&(t._details=u)}if(((i=this.Parent)==null?void 0:i.Tablename)==null)return null;const n=e[(o=this.Parent)==null?void 0:o.Tablename],a=Object.keys(n);for(let u=0;u<a.length;u++){const s=a[u];switch(n[s].TypeDDD){case"Date":{t[s]=We.getIsoDate(this.Record[s]);break}case"DateTime":{t[s]=We.getIsoDateTime(this.Record[s]);break}default:{t[s]=this.Record[s];break}}}return this.Record.Id!=null&&(t.Id=this.Record.Id),((l=this.Parent)==null?void 0:l.Tablename)=="EU_Invoices",Object.keys(t).length>0?t:null}getFullObject(e){var o,l,u;const t={};if(this.Details!=null){const s={};var n=Object.keys(this.Details);for(let c=0;c<n.length;c++){const f=this.Details[n[c]].getFullObject(e);f!=null&&(s[this.Details[n[c]].Tablename]=f)}Object.keys(s).length>0&&(t._details=s)}if(((o=this.Parent)==null?void 0:o.Tablename)==null)return null;const a=e[(l=this.Parent)==null?void 0:l.Tablename],i=Object.keys(a);for(let s=0;s<i.length;s++){const c=i[s];switch(a[c].Type){case"Date":{t[c]=We.getIsoDate(this.Record[c]);break}case"DateTime":{t[c]=We.getIsoDateTime(this.Record[c]);break}default:{t[c]=this.Record[c];break}}}return this.Record.Id!=null&&(t.Id=this.Record.Id),((u=this.Parent)==null?void 0:u.Tablename)=="EU_Invoices"&&(t.InvTotalVatAmountCCInp=this.Record.InvTotalVatAmountCC,t.InvAmountInclVatInp=this.Record.InvAmountInclVat),Object.keys(t).length>0?t:null}GetTableForAlias(e){var o,l,u;const t={};if(this.Details!=null){const s={};var n=Object.keys(this.Details);for(let c=0;c<n.length;c++){const f=this.Details[n[c]].GetTableForAlias(e);f!=null&&(s[Ot.GetTableForAlias(this.Details[n[c]].Tablename)]=f)}Object.keys(s).length>0&&(t._details=s)}if(((o=this.Parent)==null?void 0:o.Tablename)==null)return null;const a=e[(l=this.Parent)==null?void 0:l.Tablename],i=Object.keys(a);for(let s=0;s<i.length;s++){const c=i[s],f=a[c].Type,m=a[c].Alias??c;switch(f){case"Date":{t[m]=We.getIsoDate(this.Record[c]);break}case"DateTime":{t[m]=We.getIsoDateTime(this.Record[c]);break}default:{t[m]=this.Record[c];break}}}return this.Record.Id!=null&&(t.Id=this.Record.Id),((u=this.Parent)==null?void 0:u.Tablename)=="EU_Invoices"&&(t.InvTotalVatAmountCCInp=this.Record.InvTotalVatAmountCC,t.InvAmountInclVatInp=this.Record.InvAmountInclVat),Object.keys(t).length>0?t:null}Validate(){}}class Du{constructor(e,t,n){this.Records=[],this.Parent=n,this.ObjectInfo=t,this.Records.push(new Ga(e,t,n))}MapToId(e){if(this.Records!=null)for(let t=0;t<this.Records.length;t++)this.Records[t].MapToId(e)}EvaluateInner(e){if(this.Records!=null)for(let n=0;n<this.Records.length;n++){var t=this.Records[n];try{t.EvaluateInner(e)}catch{debugger}}}TranslateObj(e){if(this.Records.length!=0)for(let t=0;t<this.Records.length;t++)this.Records[t].TranslateObj(e)}GetObject(){if(this.Records.length==0)return null;var e=[];for(let t=0;t<this.Records.length;t++)e.push(this.Records[t].GetObject());return e}getSaveObject(e){var a;if(this.Records==null)return null;var t=[];if(((a=this.Parent)==null?void 0:a.Tablename)=="EU_Invoices_Items_Classes"&&this.Records.length==1){var n=this.Records[0];if(n.Record.ItemClassCodeSchID==null&&n.Record.ItemClassCode==null)return t}for(let i=0;i<this.Records.length;i++)t.push(this.Records[i].getSaveObject(e));return t}getFullObject(e){if(this.Records==null)return null;var t=[];for(let n=0;n<this.Records.length;n++)t.push(this.Records[n].getFullObject(e));return t}GetTableForAlias(e){if(this.Records==null)return null;var t=[];for(let n=0;n<this.Records.length;n++)t.push(this.Records[n].GetTableForAlias(e));return t}Validate(){if(this.Records==null)return null;const e={};for(let i=0;i<this.Records.length;i++){let o=this.Records[i].Validate();o!=null&&(e[i.toString()]=o)}if(Object.keys(e).length==0)return null;const t=Object.keys(e);let n="",a={};for(let i=0;i<t.length;i++){let o="";const l=t[i];let u=e[l];u.missingKeys!=null&&(o="Missing mandatory keys:"+u.missingKeys),o!=null&&(n+="Errors on index "+l+": "+o,a.push([l,u.missingKeys]))}return{errorMessage:n==""?null:n,validateDetailsErrors:a}}}class _h{constructor(e,t){this.rootLevel=null,this.LeftObject=null,this.ExternalTables={},this.Settings=null,this._dicValues={},this.EvalType="Init",this.Mappings=null,this.CodeListCache={},this.InvoiceStructure={},this.LeftObject=e,this.ObjectInfo=(t==null?void 0:t.OI)??{},this.CodeListCache=(t==null?void 0:t.CodeList)??{},this.InvoiceStructure=(t==null?void 0:t.InvoiceStructure)??{},this.ExternalTables=(t==null?void 0:t.External)??{},this.Settings=(t==null?void 0:t.Settings)??{},this.prepareValues()}prepareValues(){const e=new Date;this._dicValues={NOW:this.formatDateTime(e),DATE:this.formatDate(e)}}static isMultiple(e){return e=="EU_Invoices_Items_Classes"||e=="EU_Invoices_Items_AllowsCharges"||e=="EU_Invoices_CN_IICRefs_Items"||e=="EU_Invoices_AdvanceUsage"||e=="EU_Invoices_AdvanceUsageVatCode"}InitAfterConst(){}formatDate(e){return e.getFullYear()+"-"+this.formatToTwoNumber(e.getMonth()+1)+"-"+this.formatToTwoNumber(e.getDate())}formatDateTime(e){return e.getFullYear()+"-"+this.formatToTwoNumber(e.getMonth()+1)+"-"+this.formatToTwoNumber(e.getDate())+"T"+this.formatToTwoNumber(e.getHours())+":"+this.formatToTwoNumber(e.getMinutes())+":"+this.formatToTwoNumber(e.getSeconds())}formatToTwoNumber(e){return e<10?"0"+e:e.toString()}GetValues(e){var t=e.toUpperCase();return this._dicValues[t]!=null?this._dicValues[t]:null}FindTableLevel(e){var t=this.RecursiveFindLevel(this.rootLevel,e);return t??(console.error("Can't find level "+e),null)}RecursiveFindLevel(e,t){if(e==null&&(e=this.rootLevel),e==null)return null;if((e==null?void 0:e.Tablename)==t)return e;if(e.Record!=null&&e.Record.Details!=null){var n=Object.keys(e.Record.Details);for(let a=0;a<n.length;a++){const i=this.RecursiveFindLevel(e.Record.Details[n[a]],t);if(i!=null)return i}}return null}GetObject(){var e;return(e=this.rootLevel)==null?void 0:e.GetObject()}SumByKey(e){var t=e.split(","),n=t[0].split(".");if(n.length!=2)throw"Key isn't well formmed! "+e;var a=this.RecursiveFindLevel(this.rootLevel,n[0]);if(a==null)throw"Can't find table level "+n[0];let i=null;if(t.length==2){var o=t[1].split(".");i=o[1]}let l=0;if(a.Records!=null)for(var u=a.Records,s=0;s<u.Records.length;s++){const c=u.Records[s];if(c.Record[n[1]]!=null){if(i!=null&&!c.Record[i])continue;l+=c.Record[n[1]]}}return l}getSaveObject(){return{}}getFullObject(){var t,n;const e={};return e[((t=this.rootLevel)==null?void 0:t.Tablename)??"EU_Invoices"]=(n=this.rootLevel)==null?void 0:n.getFullObject(this.ObjectInfo),e}getAliasObject(){var t;const e={};return e[Ot.GetTableForAlias("EU_Invoices")]=(t=this.rootLevel)==null?void 0:t.GetTableForAlias(this.ObjectInfo),e}ValidateBeforeSave(){}TranslateObj(e){var t;(t=this.rootLevel)==null||t.TranslateObj(e)}prepareSchemaStruct(){var e=[],t=Object.keys(this.ObjectInfo);return t.forEach(n=>{var a=Object.keys(this.ObjectInfo[n]);a.forEach(i=>{e.push(this.ObjectInfo[n][i])})}),e}Evaluate(){this.rootLevel=new xn("EU_Invoices",this.InvoiceStructure.EU_Invoices,this.ObjectInfo,this);var e=this.prepareSchemaStruct(),t=e.filter(n=>n.ValueExpressionInit!=null);return this.InicializeEval("Init",t),this.FillInvoiceDataIntoObjStuct(this.LeftObject,e,this.ObjectInfo,!1),console.log(this.getFullObject()),t=e.filter(n=>n.EvalStep=="PRE"&&(n.ValueExpression!=null||n.GetValueFrom=="Mappings"||n.GetValueFrom=="Code")),this.InicializeEval("Eval",t),t=e.filter(n=>n.ConnField),this.MapToId(t),t=e.filter(n=>n.EvalStep=="EVAL"),this.InicializeEval("Eval",t),t=e.filter(n=>n.EvalStep=="POST"&&n.Group=="Vats"),this.vatsPrepare(t),t=e.filter(n=>n.EvalStep=="POST"&&n.Group!="Vats"),this.InicializeEval("Eval",t),!0}InicializeEval(e,t){if(this.EvalType=e,t.length==0)return!0;try{var n=t.sort((o,l)=>(o.CalcPhase??0)-(l.CalcPhase??0)),a=[],i=null;for(let o=0;o<n.length;o++){const l=n[o];if(i==null){i=l.TableName,a.push(l);continue}i!=l.TableName&&(this.InicializeEvalInner(i??"",a),a=[],i=l.TableName),a.push(l)}a.length>0&&this.InicializeEvalInner(i??"",a)}catch(o){return console.error(o),!1}return!0}FillInvoiceDataIntoObjStuct(e,t,n,a){var le,me,Y,z,X,se,re;var i=(le=this.rootLevel)==null?void 0:le.Record;if(t.length>0){const pe=a?Ot.masterEntity:"Invoice";var o=e[pe],l=o._details,u=new Map,s=this.RecursiveFindLevel(null,Ot.masterEntity),i=s==null?void 0:s.Record,c=this.groupBy(t,"TableName"),f=Object.keys(c);if(o!=null||l!=null)for(var m=0;m<f.length;m++){var v=f[m],p=c[v];if(v==Ot.masterEntity){if(o==null||i==null)continue;for(var d=0;d<p.length;d++){var y=p[d];this.setValueForObject(o,i,y,a,null)}}else if(Ot.IsDetailTable(v)){if(l==null)continue;if(Ot.isMultiple(v)){u.set(v,p);continue}var x=a?v:Ot.GetTableForAlias(v);if(l[x]==null||l[x].length==0)continue;var D=this.RecursiveFindLevel(this.rootLevel,v);if(D==null||D==null)continue;var h=[],w=l[x],g={};if((D==null?void 0:D.Records)!=null&&((me=D.Records)==null?void 0:me.Records.length)>0){var b=D.Records.Records[0];b.IsDefaultRecord=!1;for(var A=Object.keys(b.Record),N=0;N<A.length;N++){var E=A[N];g[E]=b.Record[E]}}for(var d=0;d<w.length;d++){for(var S=JSON.parse(JSON.stringify(g)),C=w[d],M=new Ga(S,n,D),O=0;O<p.length;O++){var y=p[O];this.setValueForObject(C,M,y,a,null)}M.SetLeftInstanceReference(C),h.push(M)}D.Records!=null&&(D.Records.Records=h)}}else for(var I=t.filter(Oe=>Oe.FromInputKey!=null),c=this.groupBy(I,"TableName"),m=0;m<f.length;m++){var v=f[m],p=c[v];if(v==Ot.masterEntity&&i!=null)for(var d=0;d<p.length;d++){var y=p[d];this.setValueForObject(o,i,y,a,null)}else{var x=Ot.GetTableForAlias(v),D=this.RecursiveFindLevel(null,v);if(D==null)continue;var h=[],k="",w=this.FindJArray(e,((z=(Y=p[0])==null?void 0:Y.FromInputKey)==null?void 0:z.split("."))??[],k),g={};if(((X=D.Records)==null?void 0:X.Records)==null||D.Records.Records.length===0||D.Records.Records[0].Record==null)continue;for(var _=D.Records.Records[0].Record,P=Object.keys(_),N=0;N<P.length;N++){var E=P[N];g[E]=_.Record[E]}for(var m=0;m<w.length;m++){for(var S=JSON.parse(JSON.stringify(g)),C=w[m],M=new Ga(S,n,D),O=0;O<p.length;O++){var y=p[O];this.setValueForObject(C,M,y,a,null)}M.SetLeftInstanceReference(C),h.push(M)}D.Records=new Du(h,n,D)}}if(u.size>0)return;for(const[De,Oe]of u){var V=Ot.GetMultipleParent(De);if(V==null)throw"Can't find parent for multiple table "+De;var q=this.RecursiveFindLevel(this.rootLevel,V);if(q!=null)for(var J=((se=q.Records)==null?void 0:se.Records)??[],m=0;m<(J==null?void 0:J.length);m++){var ne=J[m].GetLeftInstanceReference();if(ne==null)continue;var j=ne._details;if(j==null)continue;var F=j[De];if(F==null||F.length==0)continue;let _e=null;if(J[m].HasDetails(De)){if(_e=J[m].GetDetail(De),_e==null)continue}else _e=new xn(De,[],this.ObjectInfo,this),J[m].AddDetail(De,_e);for(var U=(re=_e.Records)==null?void 0:re.Records,$=[],m=0;m<F.Count;m++){let qe=null;U&&U.length>m?qe=U[m]:(qe=new Ga({},this.ObjectInfo,_e),$.push(qe));for(var O=0;O<Oe.length;O++){var y=Oe[O];this.setValueForObject(C,qe,y,a,null)}}}}}}FindJArray(e,t,n){if(t.length==0)return null;if(n!=""&&(n+="."),n+=t[0],e[t[0]]!=null&&Array.isArray(e[t[0]])){var a=e[t[0]],i=JSON.parse(JSON.stringify(t));return i.splice(0,1),a.length==1&&t.length>2?this.FindJArray(a[0],i,n):a}var o=JSON.parse(JSON.stringify(t));return o.splice(0,1),this.FindJArray(e[t[0]],o,n)}setValueForObject(e,t,n,a,i){if(e!=null){if(n==null){debugger;return}var o=a?n.FieldName:n.AliasExport??n.FieldName;if(e[o]!=null){var l=t.Record;t.SetValueToKey(n,e[o],l)}else if(n.FromInputKey!=null)for(var u=n.FromInputKey.split("??"),s=0;s<u.length;s++){var c=u[s];if(i!=null&&(c=c.replace(i+".","")),e.Get(c)!=null){var l=t.Record;t.SetValueToKey(n,e.Get(c),l)}}}}InicializeEvalInner(e,t){var n=this.RecursiveFindLevel(null,e);return n==null?!1:(n.Evaluate(t),!0)}MapToId(e){if(e.length==0)return!0;try{var t=e.sort((i,o)=>(i.CalcPhase??0)-(o.CalcPhase??0)),n=[],a=null;for(let i=0;i<t.length;i++){const o=t[i];if(a==null){a=o.TableName,n.push(o);continue}a!=o.TableName&&(this.MapToIdInner(a??"",n),n=[],a=o.TableName),n.push(o)}n.length>0&&this.MapToIdInner(a??"",n)}catch{return!1}return!0}MapToIdInner(e,t){var n=this.RecursiveFindLevel(null,e);return n==null?!1:(n.MapToId(t),!0)}vatsPrepare(e){var l;if(e.length!=0){var t=this.RecursiveFindLevel(null,"EU_Invoices_Items"),n=this.groupBy(e,"TableName");for(const u in n){var a=this.RecursiveFindLevel(null,u);a==null&&(a=new xn(u,[],this.ObjectInfo,this)),a.Records==null&&(a.Records=new Du([],this.ObjectInfo[u],a));var i={};(l=t==null?void 0:t.Records)==null||l.Records.forEach(c=>{var f=c.Record.VatsUIGroupKey;i[f]==null&&(i[f]=[]),i[f].push(c)});var o=[];Object.keys(i).forEach(c=>{var f={};f.__VatRate=c;var m=new Ga({},this.ObjectInfo,a);m.Record=f,m.SetReferenceRecords("__VatRate",i[c]),o.push(m)}),a.Records.Records=o;const s=n[u];a.Evaluate(s)}}}groupBy(e,t){return e.reduce((n,a)=>{const i=String(a[t]);return(n[i]||(n[i]=[])).push(a),n},{})}}class Th{static hasKey(e){return this.getFromSessionStorage(e)!=null}static getFromSessionStorage(e){return localStorage.getItem(e)}static setToSessionStorage(e,t){typeof t=="object"&&(t=JSON.stringify(t)),localStorage.setItem(e,t)}}(function(r,e){typeof At=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis<"u"?globalThis:r||self).axios=e()})(void 0,function(){function r(B){return r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},r(B)}function e(B,Z){if(!(B instanceof Z))throw new TypeError("Cannot call a class as a function")}function t(B,Z){for(var te=0;te<Z.length;te++){var ae=Z[te];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(B,ae.key,ae)}}function n(B,Z,te){return Z&&t(B.prototype,Z),te&&t(B,te),Object.defineProperty(B,"prototype",{writable:!1}),B}function a(B,Z){return function(te){if(Array.isArray(te))return te}(B)||function(te,ae){var ce=te==null?null:typeof Symbol<"u"&&te[Symbol.iterator]||te["@@iterator"];if(ce!=null){var fe,ge,Ae=[],Ee=!0,Fe=!1;try{for(ce=ce.call(te);!(Ee=(fe=ce.next()).done)&&(Ae.push(fe.value),!ae||Ae.length!==ae);Ee=!0);}catch(Re){Fe=!0,ge=Re}finally{try{Ee||ce.return==null||ce.return()}finally{if(Fe)throw ge}}return Ae}}(B,Z)||function(te,ae){if(te){if(typeof te=="string")return i(te,ae);var ce=Object.prototype.toString.call(te).slice(8,-1);if(ce==="Object"&&te.constructor&&(ce=te.constructor.name),ce==="Map"||ce==="Set")return Array.from(te);if(ce==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ce))return i(te,ae)}}(B,Z)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
62
62
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function i(B,Z){(Z==null||Z>B.length)&&(Z=B.length);for(var te=0,ae=new Array(Z);te<Z;te++)ae[te]=B[te];return ae}function o(B,Z){return function(){return B.apply(Z,arguments)}}var l,u=Object.prototype.toString,s=Object.getPrototypeOf,c=(l=Object.create(null),function(B){var Z=u.call(B);return l[Z]||(l[Z]=Z.slice(8,-1).toLowerCase())}),f=function(B){return B=B.toLowerCase(),function(Z){return c(Z)===B}},m=function(B){return function(Z){return r(Z)===B}},v=Array.isArray,p=m("undefined"),d=f("ArrayBuffer"),y=m("string"),x=m("function"),D=m("number"),h=function(B){return B!==null&&r(B)==="object"},w=function(B){if(c(B)!=="object")return!1;var Z=s(B);return!(Z!==null&&Z!==Object.prototype&&Object.getPrototypeOf(Z)!==null||Symbol.toStringTag in B||Symbol.iterator in B)},g=f("Date"),b=f("File"),A=f("Blob"),N=f("FileList"),E=f("URLSearchParams");function S(B,Z){var te,ae,ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},fe=ce.allOwnKeys,ge=fe!==void 0&&fe;if(B!=null)if(r(B)!=="object"&&(B=[B]),v(B))for(te=0,ae=B.length;te<ae;te++)Z.call(null,B[te],te,B);else{var Ae,Ee=ge?Object.getOwnPropertyNames(B):Object.keys(B),Fe=Ee.length;for(te=0;te<Fe;te++)Ae=Ee[te],Z.call(null,B[Ae],Ae,B)}}function C(B,Z){Z=Z.toLowerCase();for(var te,ae=Object.keys(B),ce=ae.length;ce-- >0;)if(Z===(te=ae[ce]).toLowerCase())return te;return null}var M=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,O=function(B){return!p(B)&&B!==M},I,k=(I=typeof Uint8Array<"u"&&s(Uint8Array),function(B){return I&&B instanceof I}),_=f("HTMLFormElement"),P=function(B){var Z=Object.prototype.hasOwnProperty;return function(te,ae){return Z.call(te,ae)}}(),V=f("RegExp"),q=function(B,Z){var te=Object.getOwnPropertyDescriptors(B),ae={};S(te,function(ce,fe){Z(ce,fe,B)!==!1&&(ae[fe]=ce)}),Object.defineProperties(B,ae)},J="abcdefghijklmnopqrstuvwxyz",ne="0123456789",j={DIGIT:ne,ALPHA:J,ALPHA_DIGIT:J+J.toUpperCase()+ne},F=f("AsyncFunction"),U={isArray:v,isArrayBuffer:d,isBuffer:function(B){return B!==null&&!p(B)&&B.constructor!==null&&!p(B.constructor)&&x(B.constructor.isBuffer)&&B.constructor.isBuffer(B)},isFormData:function(B){var Z;return B&&(typeof FormData=="function"&&B instanceof FormData||x(B.append)&&((Z=c(B))==="formdata"||Z==="object"&&x(B.toString)&&B.toString()==="[object FormData]"))},isArrayBufferView:function(B){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(B):B&&B.buffer&&d(B.buffer)},isString:y,isNumber:D,isBoolean:function(B){return B===!0||B===!1},isObject:h,isPlainObject:w,isUndefined:p,isDate:g,isFile:b,isBlob:A,isRegExp:V,isFunction:x,isStream:function(B){return h(B)&&x(B.pipe)},isURLSearchParams:E,isTypedArray:k,isFileList:N,forEach:S,merge:function B(){for(var Z=O(this)&&this||{},te=Z.caseless,ae={},ce=function(Ae,Ee){var Fe=te&&C(ae,Ee)||Ee;w(ae[Fe])&&w(Ae)?ae[Fe]=B(ae[Fe],Ae):w(Ae)?ae[Fe]=B({},Ae):v(Ae)?ae[Fe]=Ae.slice():ae[Fe]=Ae},fe=0,ge=arguments.length;fe<ge;fe++)arguments[fe]&&S(arguments[fe],ce);return ae},extend:function(B,Z,te){var ae=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},ce=ae.allOwnKeys;return S(Z,function(fe,ge){te&&x(fe)?B[ge]=o(fe,te):B[ge]=fe},{allOwnKeys:ce}),B},trim:function(B){return B.trim?B.trim():B.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(B){return B.charCodeAt(0)===65279&&(B=B.slice(1)),B},inherits:function(B,Z,te,ae){B.prototype=Object.create(Z.prototype,ae),B.prototype.constructor=B,Object.defineProperty(B,"super",{value:Z.prototype}),te&&Object.assign(B.prototype,te)},toFlatObject:function(B,Z,te,ae){var ce,fe,ge,Ae={};if(Z=Z||{},B==null)return Z;do{for(fe=(ce=Object.getOwnPropertyNames(B)).length;fe-- >0;)ge=ce[fe],ae&&!ae(ge,B,Z)||Ae[ge]||(Z[ge]=B[ge],Ae[ge]=!0);B=te!==!1&&s(B)}while(B&&(!te||te(B,Z))&&B!==Object.prototype);return Z},kindOf:c,kindOfTest:f,endsWith:function(B,Z,te){B=String(B),(te===void 0||te>B.length)&&(te=B.length),te-=Z.length;var ae=B.indexOf(Z,te);return ae!==-1&&ae===te},toArray:function(B){if(!B)return null;if(v(B))return B;var Z=B.length;if(!D(Z))return null;for(var te=new Array(Z);Z-- >0;)te[Z]=B[Z];return te},forEachEntry:function(B,Z){for(var te,ae=(B&&B[Symbol.iterator]).call(B);(te=ae.next())&&!te.done;){var ce=te.value;Z.call(B,ce[0],ce[1])}},matchAll:function(B,Z){for(var te,ae=[];(te=B.exec(Z))!==null;)ae.push(te);return ae},isHTMLForm:_,hasOwnProperty:P,hasOwnProp:P,reduceDescriptors:q,freezeMethods:function(B){q(B,function(Z,te){if(x(B)&&["arguments","caller","callee"].indexOf(te)!==-1)return!1;var ae=B[te];x(ae)&&(Z.enumerable=!1,"writable"in Z?Z.writable=!1:Z.set||(Z.set=function(){throw Error("Can not rewrite read-only method '"+te+"'")}))})},toObjectSet:function(B,Z){var te={},ae=function(ce){ce.forEach(function(fe){te[fe]=!0})};return v(B)?ae(B):ae(String(B).split(Z)),te},toCamelCase:function(B){return B.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(Z,te,ae){return te.toUpperCase()+ae})},noop:function(){},toFiniteNumber:function(B,Z){return B=+B,Number.isFinite(B)?B:Z},findKey:C,global:M,isContextDefined:O,ALPHABET:j,generateString:function(){for(var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:16,Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:j.ALPHA_DIGIT,te="",ae=Z.length;B--;)te+=Z[Math.random()*ae|0];return te},isSpecCompliantForm:function(B){return!!(B&&x(B.append)&&B[Symbol.toStringTag]==="FormData"&&B[Symbol.iterator])},toJSONObject:function(B){var Z=new Array(10);return function te(ae,ce){if(h(ae)){if(Z.indexOf(ae)>=0)return;if(!("toJSON"in ae)){Z[ce]=ae;var fe=v(ae)?[]:{};return S(ae,function(ge,Ae){var Ee=te(ge,ce+1);!p(Ee)&&(fe[Ae]=Ee)}),Z[ce]=void 0,fe}}return ae}(B,0)},isAsyncFn:F,isThenable:function(B){return B&&(h(B)||x(B))&&x(B.then)&&x(B.catch)}};function $(B,Z,te,ae,ce){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=B,this.name="AxiosError",Z&&(this.code=Z),te&&(this.config=te),ae&&(this.request=ae),ce&&(this.response=ce)}U.inherits($,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:U.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var le=$.prototype,me={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(function(B){me[B]={value:B}}),Object.defineProperties($,me),Object.defineProperty(le,"isAxiosError",{value:!0}),$.from=function(B,Z,te,ae,ce,fe){var ge=Object.create(le);return U.toFlatObject(B,ge,function(Ae){return Ae!==Error.prototype},function(Ae){return Ae!=="isAxiosError"}),$.call(ge,B.message,Z,te,ae,ce),ge.cause=B,ge.name=B.name,fe&&Object.assign(ge,fe),ge};function Y(B){return U.isPlainObject(B)||U.isArray(B)}function z(B){return U.endsWith(B,"[]")?B.slice(0,-2):B}function X(B,Z,te){return B?B.concat(Z).map(function(ae,ce){return ae=z(ae),!te&&ce?"["+ae+"]":ae}).join(te?".":""):Z}var se=U.toFlatObject(U,{},null,function(B){return/^is[A-Z]/.test(B)});function re(B,Z,te){if(!U.isObject(B))throw new TypeError("target must be an object");Z=Z||new FormData;var ae=(te=U.toFlatObject(te,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Ve,je){return!U.isUndefined(je[Ve])})).metaTokens,ce=te.visitor||Fe,fe=te.dots,ge=te.indexes,Ae=(te.Blob||typeof Blob<"u"&&Blob)&&U.isSpecCompliantForm(Z);if(!U.isFunction(ce))throw new TypeError("visitor must be a function");function Ee(Ve){if(Ve===null)return"";if(U.isDate(Ve))return Ve.toISOString();if(!Ae&&U.isBlob(Ve))throw new $("Blob is not supported. Use a Buffer instead.");return U.isArrayBuffer(Ve)||U.isTypedArray(Ve)?Ae&&typeof Blob=="function"?new Blob([Ve]):Buffer.from(Ve):Ve}function Fe(Ve,je,Pe){var mr=Ve;if(Ve&&!Pe&&r(Ve)==="object"){if(U.endsWith(je,"{}"))je=ae?je:je.slice(0,-2),Ve=JSON.stringify(Ve);else if(U.isArray(Ve)&&function(wr){return U.isArray(wr)&&!wr.some(Y)}(Ve)||(U.isFileList(Ve)||U.endsWith(je,"[]"))&&(mr=U.toArray(Ve)))return je=z(je),mr.forEach(function(wr,Pr){!U.isUndefined(wr)&&wr!==null&&Z.append(ge===!0?X([je],Pr,fe):ge===null?je:je+"[]",Ee(wr))}),!1}return!!Y(Ve)||(Z.append(X(Pe,je,fe),Ee(Ve)),!1)}var Re=[],pr=Object.assign(se,{defaultVisitor:Fe,convertValue:Ee,isVisitable:Y});if(!U.isObject(B))throw new TypeError("data must be an object");return function Ve(je,Pe){if(!U.isUndefined(je)){if(Re.indexOf(je)!==-1)throw Error("Circular reference detected in "+Pe.join("."));Re.push(je),U.forEach(je,function(mr,wr){(!(U.isUndefined(mr)||mr===null)&&ce.call(Z,mr,U.isString(wr)?wr.trim():wr,Pe,pr))===!0&&Ve(mr,Pe?Pe.concat(wr):[wr])}),Re.pop()}}(B),Z}function pe(B){var Z={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(B).replace(/[!'()~]|%20|%00/g,function(te){return Z[te]})}function ve(B,Z){this._pairs=[],B&&re(B,this,Z)}var De=ve.prototype;function Oe(B){return encodeURIComponent(B).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ie(B,Z,te){if(!Z)return B;var ae,ce=te&&te.encode||Oe,fe=te&&te.serialize;if(ae=fe?fe(Z,te):U.isURLSearchParams(Z)?Z.toString():new ve(Z,te).toString(ce)){var ge=B.indexOf("#");ge!==-1&&(B=B.slice(0,ge)),B+=(B.indexOf("?")===-1?"?":"&")+ae}return B}De.append=function(B,Z){this._pairs.push([B,Z])},De.toString=function(B){var Z=B?function(te){return B.call(this,te,pe)}:pe;return this._pairs.map(function(te){return Z(te[0])+"="+Z(te[1])},"").join("&")};var _e,Le=function(){function B(){e(this,B),this.handlers=[]}return n(B,[{key:"use",value:function(Z,te,ae){return this.handlers.push({fulfilled:Z,rejected:te,synchronous:!!ae&&ae.synchronous,runWhen:ae?ae.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(Z){this.handlers[Z]&&(this.handlers[Z]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(Z){U.forEach(this.handlers,function(te){te!==null&&Z(te)})}}]),B}(),qe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},G={classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ve,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},isStandardBrowserEnv:(typeof navigator>"u"||(_e=navigator.product)!=="ReactNative"&&_e!=="NativeScript"&&_e!=="NS")&&typeof window<"u"&&typeof document<"u",isStandardBrowserWebWorkerEnv:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",protocols:["http","https","file","blob","url","data"]};function ee(B){function Z(ae,ce,fe,ge){var Ae=ae[ge++],Ee=Number.isFinite(+Ae),Fe=ge>=ae.length;return Ae=!Ae&&U.isArray(fe)?fe.length:Ae,Fe?(U.hasOwnProp(fe,Ae)?fe[Ae]=[fe[Ae],ce]:fe[Ae]=ce,!Ee):(fe[Ae]&&U.isObject(fe[Ae])||(fe[Ae]=[]),Z(ae,ce,fe[Ae],ge)&&U.isArray(fe[Ae])&&(fe[Ae]=function(Re){var pr,Ve,je={},Pe=Object.keys(Re),mr=Pe.length;for(pr=0;pr<mr;pr++)je[Ve=Pe[pr]]=Re[Ve];return je}(fe[Ae])),!Ee)}if(U.isFormData(B)&&U.isFunction(B.entries)){var te={};return U.forEachEntry(B,function(ae,ce){Z(function(fe){return U.matchAll(/\w+|\[(\w*)]/g,fe).map(function(ge){return ge[0]==="[]"?"":ge[1]||ge[0]})}(ae),ce,te,0)}),te}return null}var R={"Content-Type":void 0},H={transitional:qe,adapter:["xhr","http"],transformRequest:[function(B,Z){var te,ae=Z.getContentType()||"",ce=ae.indexOf("application/json")>-1,fe=U.isObject(B);if(fe&&U.isHTMLForm(B)&&(B=new FormData(B)),U.isFormData(B))return ce&&ce?JSON.stringify(ee(B)):B;if(U.isArrayBuffer(B)||U.isBuffer(B)||U.isStream(B)||U.isFile(B)||U.isBlob(B))return B;if(U.isArrayBufferView(B))return B.buffer;if(U.isURLSearchParams(B))return Z.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),B.toString();if(fe){if(ae.indexOf("application/x-www-form-urlencoded")>-1)return function(Ae,Ee){return re(Ae,new G.classes.URLSearchParams,Object.assign({visitor:function(Fe,Re,pr,Ve){return G.isNode&&U.isBuffer(Fe)?(this.append(Re,Fe.toString("base64")),!1):Ve.defaultVisitor.apply(this,arguments)}},Ee))}(B,this.formSerializer).toString();if((te=U.isFileList(B))||ae.indexOf("multipart/form-data")>-1){var ge=this.env&&this.env.FormData;return re(te?{"files[]":B}:B,ge&&new ge,this.formSerializer)}}return fe||ce?(Z.setContentType("application/json",!1),function(Ae,Ee,Fe){if(U.isString(Ae))try{return(Ee||JSON.parse)(Ae),U.trim(Ae)}catch(Re){if(Re.name!=="SyntaxError")throw Re}return(Fe||JSON.stringify)(Ae)}(B)):B}],transformResponse:[function(B){var Z=this.transitional||H.transitional,te=Z&&Z.forcedJSONParsing,ae=this.responseType==="json";if(B&&U.isString(B)&&(te&&!this.responseType||ae)){var ce=!(Z&&Z.silentJSONParsing)&&ae;try{return JSON.parse(B)}catch(fe){if(ce)throw fe.name==="SyntaxError"?$.from(fe,$.ERR_BAD_RESPONSE,this,null,this.response):fe}}return B}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:G.classes.FormData,Blob:G.classes.Blob},validateStatus:function(B){return B>=200&&B<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};U.forEach(["delete","get","head"],function(B){H.headers[B]={}}),U.forEach(["post","put","patch"],function(B){H.headers[B]=U.merge(R)});var Q=H,ie=U.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ue=Symbol("internals");function oe(B){return B&&String(B).trim().toLowerCase()}function we(B){return B===!1||B==null?B:U.isArray(B)?B.map(we):String(B)}function xe(B,Z,te,ae,ce){return U.isFunction(ae)?ae.call(this,Z,te):(ce&&(Z=te),U.isString(Z)?U.isString(ae)?Z.indexOf(ae)!==-1:U.isRegExp(ae)?ae.test(Z):void 0:void 0)}var Te=function(B,Z){function te(ae){e(this,te),ae&&this.set(ae)}return n(te,[{key:"set",value:function(ae,ce,fe){var ge=this;function Ae(Pe,mr,wr){var Pr=oe(mr);if(!Pr)throw new Error("header name must be a non-empty string");var Br=U.findKey(ge,Pr);(!Br||ge[Br]===void 0||wr===!0||wr===void 0&&ge[Br]!==!1)&&(ge[Br||mr]=we(Pe))}var Ee,Fe,Re,pr,Ve,je=function(Pe,mr){return U.forEach(Pe,function(wr,Pr){return Ae(wr,Pr,mr)})};return U.isPlainObject(ae)||ae instanceof this.constructor?je(ae,ce):U.isString(ae)&&(ae=ae.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(ae.trim())?je((Ve={},(Ee=ae)&&Ee.split(`
|
|
63
63
|
`).forEach(function(Pe){pr=Pe.indexOf(":"),Fe=Pe.substring(0,pr).trim().toLowerCase(),Re=Pe.substring(pr+1).trim(),!Fe||Ve[Fe]&&ie[Fe]||(Fe==="set-cookie"?Ve[Fe]?Ve[Fe].push(Re):Ve[Fe]=[Re]:Ve[Fe]=Ve[Fe]?Ve[Fe]+", "+Re:Re)}),Ve),ce):ae!=null&&Ae(ce,ae,fe),this}},{key:"get",value:function(ae,ce){if(ae=oe(ae)){var fe=U.findKey(this,ae);if(fe){var ge=this[fe];if(!ce)return ge;if(ce===!0)return function(Ae){for(var Ee,Fe=Object.create(null),Re=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;Ee=Re.exec(Ae);)Fe[Ee[1]]=Ee[2];return Fe}(ge);if(U.isFunction(ce))return ce.call(this,ge,fe);if(U.isRegExp(ce))return ce.exec(ge);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(ae,ce){if(ae=oe(ae)){var fe=U.findKey(this,ae);return!(!fe||this[fe]===void 0||ce&&!xe(0,this[fe],fe,ce))}return!1}},{key:"delete",value:function(ae,ce){var fe=this,ge=!1;function Ae(Ee){if(Ee=oe(Ee)){var Fe=U.findKey(fe,Ee);!Fe||ce&&!xe(0,fe[Fe],Fe,ce)||(delete fe[Fe],ge=!0)}}return U.isArray(ae)?ae.forEach(Ae):Ae(ae),ge}},{key:"clear",value:function(ae){for(var ce=Object.keys(this),fe=ce.length,ge=!1;fe--;){var Ae=ce[fe];ae&&!xe(0,this[Ae],Ae,ae,!0)||(delete this[Ae],ge=!0)}return ge}},{key:"normalize",value:function(ae){var ce=this,fe={};return U.forEach(this,function(ge,Ae){var Ee=U.findKey(fe,Ae);if(Ee)return ce[Ee]=we(ge),void delete ce[Ae];var Fe=ae?function(Re){return Re.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,function(pr,Ve,je){return Ve.toUpperCase()+je})}(Ae):String(Ae).trim();Fe!==Ae&&delete ce[Ae],ce[Fe]=we(ge),fe[Fe]=!0}),this}},{key:"concat",value:function(){for(var ae,ce=arguments.length,fe=new Array(ce),ge=0;ge<ce;ge++)fe[ge]=arguments[ge];return(ae=this.constructor).concat.apply(ae,[this].concat(fe))}},{key:"toJSON",value:function(ae){var ce=Object.create(null);return U.forEach(this,function(fe,ge){fe!=null&&fe!==!1&&(ce[ge]=ae&&U.isArray(fe)?fe.join(", "):fe)}),ce}},{key:Symbol.iterator,value:function(){return Object.entries(this.toJSON())[Symbol.iterator]()}},{key:"toString",value:function(){return Object.entries(this.toJSON()).map(function(ae){var ce=a(ae,2);return ce[0]+": "+ce[1]}).join(`
|
|
64
|
-
`)}},{key:Symbol.toStringTag,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(ae){return ae instanceof this?ae:new this(ae)}},{key:"concat",value:function(ae){for(var ce=new this(ae),fe=arguments.length,ge=new Array(fe>1?fe-1:0),Ae=1;Ae<fe;Ae++)ge[Ae-1]=arguments[Ae];return ge.forEach(function(Ee){return ce.set(Ee)}),ce}},{key:"accessor",value:function(ae){var ce=(this[ue]=this[ue]={accessors:{}}).accessors,fe=this.prototype;function ge(Ae){var Ee=oe(Ae);ce[Ee]||(function(Fe,Re){var pr=U.toCamelCase(" "+Re);["get","set","has"].forEach(function(Ve){Object.defineProperty(Fe,Ve+pr,{value:function(je,Pe,mr){return this[Ve].call(this,Re,je,Pe,mr)},configurable:!0})})}(fe,Ae),ce[Ee]=!0)}return U.isArray(ae)?ae.forEach(ge):ge(ae),this}}]),te}();Te.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),U.freezeMethods(Te.prototype),U.freezeMethods(Te);var be=Te;function ke(B,Z){var te=this||Q,ae=Z||te,ce=be.from(ae.headers),fe=ae.data;return U.forEach(B,function(ge){fe=ge.call(te,fe,ce.normalize(),Z?Z.status:void 0)}),ce.normalize(),fe}function fr(B){return!(!B||!B.__CANCEL__)}function hr(B,Z,te){$.call(this,B??"canceled",$.ERR_CANCELED,Z,te),this.name="CanceledError"}U.inherits(hr,$,{__CANCEL__:!0});var ir=G.isStandardBrowserEnv?{write:function(B,Z,te,ae,ce,fe){var ge=[];ge.push(B+"="+encodeURIComponent(Z)),U.isNumber(te)&&ge.push("expires="+new Date(te).toGMTString()),U.isString(ae)&&ge.push("path="+ae),U.isString(ce)&&ge.push("domain="+ce),fe===!0&&ge.push("secure"),document.cookie=ge.join("; ")},read:function(B){var Z=document.cookie.match(new RegExp("(^|;\\s*)("+B+")=([^;]*)"));return Z?decodeURIComponent(Z[3]):null},remove:function(B){this.write(B,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Fr(B,Z){return B&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(Z)?function(te,ae){return ae?te.replace(/\/+$/,"")+"/"+ae.replace(/^\/+/,""):te}(B,Z):Z}var T=G.isStandardBrowserEnv?function(){var B,Z=/(msie|trident)/i.test(navigator.userAgent),te=document.createElement("a");function ae(ce){var fe=ce;return Z&&(te.setAttribute("href",fe),fe=te.href),te.setAttribute("href",fe),{href:te.href,protocol:te.protocol?te.protocol.replace(/:$/,""):"",host:te.host,search:te.search?te.search.replace(/^\?/,""):"",hash:te.hash?te.hash.replace(/^#/,""):"",hostname:te.hostname,port:te.port,pathname:te.pathname.charAt(0)==="/"?te.pathname:"/"+te.pathname}}return B=ae(window.location.href),function(ce){var fe=U.isString(ce)?ae(ce):ce;return fe.protocol===B.protocol&&fe.host===B.host}}():function(){return!0};function K(B,Z){var te=0,ae=function(ce,fe){ce=ce||10;var ge,Ae=new Array(ce),Ee=new Array(ce),Fe=0,Re=0;return fe=fe!==void 0?fe:1e3,function(pr){var Ve=Date.now(),je=Ee[Re];ge||(ge=Ve),Ae[Fe]=pr,Ee[Fe]=Ve;for(var Pe=Re,mr=0;Pe!==Fe;)mr+=Ae[Pe++],Pe%=ce;if((Fe=(Fe+1)%ce)===Re&&(Re=(Re+1)%ce),!(Ve-ge<fe)){var wr=je&&Ve-je;return wr?Math.round(1e3*mr/wr):void 0}}}(50,250);return function(ce){var fe=ce.loaded,ge=ce.lengthComputable?ce.total:void 0,Ae=fe-te,Ee=ae(Ae);te=fe;var Fe={loaded:fe,total:ge,progress:ge?fe/ge:void 0,bytes:Ae,rate:Ee||void 0,estimated:Ee&&ge&&fe<=ge?(ge-fe)/Ee:void 0,event:ce};Fe[Z?"download":"upload"]=!0,B(Fe)}}var de={http:null,xhr:typeof XMLHttpRequest<"u"&&function(B){return new Promise(function(Z,te){var ae,ce=B.data,fe=be.from(B.headers).normalize(),ge=B.responseType;function Ae(){B.cancelToken&&B.cancelToken.unsubscribe(ae),B.signal&&B.signal.removeEventListener("abort",ae)}U.isFormData(ce)&&(G.isStandardBrowserEnv||G.isStandardBrowserWebWorkerEnv?fe.setContentType(!1):fe.setContentType("multipart/form-data;",!1));var Ee=new XMLHttpRequest;if(B.auth){var Fe=B.auth.username||"",Re=B.auth.password?unescape(encodeURIComponent(B.auth.password)):"";fe.set("Authorization","Basic "+btoa(Fe+":"+Re))}var pr=Fr(B.baseURL,B.url);function Ve(){if(Ee){var wr=be.from("getAllResponseHeaders"in Ee&&Ee.getAllResponseHeaders());(function(Pr,Br,en){var Rh=en.config.validateStatus;en.status&&Rh&&!Rh(en.status)?Br(new $("Request failed with status code "+en.status,[$.ERR_BAD_REQUEST,$.ERR_BAD_RESPONSE][Math.floor(en.status/100)-4],en.config,en.request,en)):Pr(en)})(function(Pr){Z(Pr),Ae()},function(Pr){te(Pr),Ae()},{data:ge&&ge!=="text"&&ge!=="json"?Ee.response:Ee.responseText,status:Ee.status,statusText:Ee.statusText,headers:wr,config:B,request:Ee}),Ee=null}}if(Ee.open(B.method.toUpperCase(),Ie(pr,B.params,B.paramsSerializer),!0),Ee.timeout=B.timeout,"onloadend"in Ee?Ee.onloadend=Ve:Ee.onreadystatechange=function(){Ee&&Ee.readyState===4&&(Ee.status!==0||Ee.responseURL&&Ee.responseURL.indexOf("file:")===0)&&setTimeout(Ve)},Ee.onabort=function(){Ee&&(te(new $("Request aborted",$.ECONNABORTED,B,Ee)),Ee=null)},Ee.onerror=function(){te(new $("Network Error",$.ERR_NETWORK,B,Ee)),Ee=null},Ee.ontimeout=function(){var wr=B.timeout?"timeout of "+B.timeout+"ms exceeded":"timeout exceeded",Pr=B.transitional||qe;B.timeoutErrorMessage&&(wr=B.timeoutErrorMessage),te(new $(wr,Pr.clarifyTimeoutError?$.ETIMEDOUT:$.ECONNABORTED,B,Ee)),Ee=null},G.isStandardBrowserEnv){var je=(B.withCredentials||T(pr))&&B.xsrfCookieName&&ir.read(B.xsrfCookieName);je&&fe.set(B.xsrfHeaderName,je)}ce===void 0&&fe.setContentType(null),"setRequestHeader"in Ee&&U.forEach(fe.toJSON(),function(wr,Pr){Ee.setRequestHeader(Pr,wr)}),U.isUndefined(B.withCredentials)||(Ee.withCredentials=!!B.withCredentials),ge&&ge!=="json"&&(Ee.responseType=B.responseType),typeof B.onDownloadProgress=="function"&&Ee.addEventListener("progress",K(B.onDownloadProgress,!0)),typeof B.onUploadProgress=="function"&&Ee.upload&&Ee.upload.addEventListener("progress",K(B.onUploadProgress)),(B.cancelToken||B.signal)&&(ae=function(wr){Ee&&(te(!wr||wr.type?new hr(null,B,Ee):wr),Ee.abort(),Ee=null)},B.cancelToken&&B.cancelToken.subscribe(ae),B.signal&&(B.signal.aborted?ae():B.signal.addEventListener("abort",ae)));var Pe,mr=(Pe=/^([-+\w]{1,25})(:?\/\/|:)/.exec(pr))&&Pe[1]||"";mr&&G.protocols.indexOf(mr)===-1?te(new $("Unsupported protocol "+mr+":",$.ERR_BAD_REQUEST,B)):Ee.send(ce||null)})}};U.forEach(de,function(B,Z){if(B){try{Object.defineProperty(B,"name",{value:Z})}catch{}Object.defineProperty(B,"adapterName",{value:Z})}});var Se=function(B){for(var Z,te,ae=(B=U.isArray(B)?B:[B]).length,ce=0;ce<ae&&(Z=B[ce],!(te=U.isString(Z)?de[Z.toLowerCase()]:Z));ce++);if(!te)throw te===!1?new $("Adapter ".concat(Z," is not supported by the environment"),"ERR_NOT_SUPPORT"):new Error(U.hasOwnProp(de,Z)?"Adapter '".concat(Z,"' is not available in the build"):"Unknown adapter '".concat(Z,"'"));if(!U.isFunction(te))throw new TypeError("adapter is not a function");return te};function ze(B){if(B.cancelToken&&B.cancelToken.throwIfRequested(),B.signal&&B.signal.aborted)throw new hr(null,B)}function Ke(B){return ze(B),B.headers=be.from(B.headers),B.data=ke.call(B,B.transformRequest),["post","put","patch"].indexOf(B.method)!==-1&&B.headers.setContentType("application/x-www-form-urlencoded",!1),Se(B.adapter||Q.adapter)(B).then(function(Z){return ze(B),Z.data=ke.call(B,B.transformResponse,Z),Z.headers=be.from(Z.headers),Z},function(Z){return fr(Z)||(ze(B),Z&&Z.response&&(Z.response.data=ke.call(B,B.transformResponse,Z.response),Z.response.headers=be.from(Z.response.headers))),Promise.reject(Z)})}var rt=function(B){return B instanceof be?B.toJSON():B};function Bt(B,Z){Z=Z||{};var te={};function ae(Fe,Re,pr){return U.isPlainObject(Fe)&&U.isPlainObject(Re)?U.merge.call({caseless:pr},Fe,Re):U.isPlainObject(Re)?U.merge({},Re):U.isArray(Re)?Re.slice():Re}function ce(Fe,Re,pr){return U.isUndefined(Re)?U.isUndefined(Fe)?void 0:ae(void 0,Fe,pr):ae(Fe,Re,pr)}function fe(Fe,Re){if(!U.isUndefined(Re))return ae(void 0,Re)}function ge(Fe,Re){return U.isUndefined(Re)?U.isUndefined(Fe)?void 0:ae(void 0,Fe):ae(void 0,Re)}function Ae(Fe,Re,pr){return pr in Z?ae(Fe,Re):pr in B?ae(void 0,Fe):void 0}var Ee={url:fe,method:fe,data:fe,baseURL:ge,transformRequest:ge,transformResponse:ge,paramsSerializer:ge,timeout:ge,timeoutMessage:ge,withCredentials:ge,adapter:ge,responseType:ge,xsrfCookieName:ge,xsrfHeaderName:ge,onUploadProgress:ge,onDownloadProgress:ge,decompress:ge,maxContentLength:ge,maxBodyLength:ge,beforeRedirect:ge,transport:ge,httpAgent:ge,httpsAgent:ge,cancelToken:ge,socketPath:ge,responseEncoding:ge,validateStatus:Ae,headers:function(Fe,Re){return ce(rt(Fe),rt(Re),!0)}};return U.forEach(Object.keys(Object.assign({},B,Z)),function(Fe){var Re=Ee[Fe]||ce,pr=Re(B[Fe],Z[Fe],Fe);U.isUndefined(pr)&&Re!==Ae||(te[Fe]=pr)}),te}var xi="1.4.0",wi={};["object","boolean","number","function","string","symbol"].forEach(function(B,Z){wi[B]=function(te){return r(te)===B||"a"+(Z<1?"n ":" ")+B}});var Wo={};wi.transitional=function(B,Z,te){function ae(ce,fe){return"[Axios v1.4.0] Transitional option '"+ce+"'"+fe+(te?". "+te:"")}return function(ce,fe,ge){if(B===!1)throw new $(ae(fe," has been removed"+(Z?" in "+Z:"")),$.ERR_DEPRECATED);return Z&&!Wo[fe]&&(Wo[fe]=!0,console.warn(ae(fe," has been deprecated since v"+Z+" and will be removed in the near future"))),!B||B(ce,fe,ge)}};var Di={assertOptions:function(B,Z,te){if(r(B)!=="object")throw new $("options must be an object",$.ERR_BAD_OPTION_VALUE);for(var ae=Object.keys(B),ce=ae.length;ce-- >0;){var fe=ae[ce],ge=Z[fe];if(ge){var Ae=B[fe],Ee=Ae===void 0||ge(Ae,fe,B);if(Ee!==!0)throw new $("option "+fe+" must be "+Ee,$.ERR_BAD_OPTION_VALUE)}else if(te!==!0)throw new $("Unknown option "+fe,$.ERR_BAD_OPTION)}},validators:wi},un=Di.validators,Wa=function(){function B(Z){e(this,B),this.defaults=Z,this.interceptors={request:new Le,response:new Le}}return n(B,[{key:"request",value:function(Z,te){typeof Z=="string"?(te=te||{}).url=Z:te=Z||{};var ae,ce=te=Bt(this.defaults,te),fe=ce.transitional,ge=ce.paramsSerializer,Ae=ce.headers;fe!==void 0&&Di.assertOptions(fe,{silentJSONParsing:un.transitional(un.boolean),forcedJSONParsing:un.transitional(un.boolean),clarifyTimeoutError:un.transitional(un.boolean)},!1),ge!=null&&(U.isFunction(ge)?te.paramsSerializer={serialize:ge}:Di.assertOptions(ge,{encode:un.function,serialize:un.function},!0)),te.method=(te.method||this.defaults.method||"get").toLowerCase(),(ae=Ae&&U.merge(Ae.common,Ae[te.method]))&&U.forEach(["delete","get","head","post","put","patch","common"],function(Br){delete Ae[Br]}),te.headers=be.concat(ae,Ae);var Ee=[],Fe=!0;this.interceptors.request.forEach(function(Br){typeof Br.runWhen=="function"&&Br.runWhen(te)===!1||(Fe=Fe&&Br.synchronous,Ee.unshift(Br.fulfilled,Br.rejected))});var Re,pr=[];this.interceptors.response.forEach(function(Br){pr.push(Br.fulfilled,Br.rejected)});var Ve,je=0;if(!Fe){var Pe=[Ke.bind(this),void 0];for(Pe.unshift.apply(Pe,Ee),Pe.push.apply(Pe,pr),Ve=Pe.length,Re=Promise.resolve(te);je<Ve;)Re=Re.then(Pe[je++],Pe[je++]);return Re}Ve=Ee.length;var mr=te;for(je=0;je<Ve;){var wr=Ee[je++],Pr=Ee[je++];try{mr=wr(mr)}catch(Br){Pr.call(this,Br);break}}try{Re=Ke.call(this,mr)}catch(Br){return Promise.reject(Br)}for(je=0,Ve=pr.length;je<Ve;)Re=Re.then(pr[je++],pr[je++]);return Re}},{key:"getUri",value:function(Z){return Ie(Fr((Z=Bt(this.defaults,Z)).baseURL,Z.url),Z.params,Z.paramsSerializer)}}]),B}();U.forEach(["delete","get","head","options"],function(B){Wa.prototype[B]=function(Z,te){return this.request(Bt(te||{},{method:B,url:Z,data:(te||{}).data}))}}),U.forEach(["post","put","patch"],function(B){function Z(te){return function(ae,ce,fe){return this.request(Bt(fe||{},{method:B,headers:te?{"Content-Type":"multipart/form-data"}:{},url:ae,data:ce}))}}Wa.prototype[B]=Z(),Wa.prototype[B+"Form"]=Z(!0)});var Ya=Wa,Cu=function(){function B(Z){if(e(this,B),typeof Z!="function")throw new TypeError("executor must be a function.");var te;this.promise=new Promise(function(ce){te=ce});var ae=this;this.promise.then(function(ce){if(ae._listeners){for(var fe=ae._listeners.length;fe-- >0;)ae._listeners[fe](ce);ae._listeners=null}}),this.promise.then=function(ce){var fe,ge=new Promise(function(Ae){ae.subscribe(Ae),fe=Ae}).then(ce);return ge.cancel=function(){ae.unsubscribe(fe)},ge},Z(function(ce,fe,ge){ae.reason||(ae.reason=new hr(ce,fe,ge),te(ae.reason))})}return n(B,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(Z){this.reason?Z(this.reason):this._listeners?this._listeners.push(Z):this._listeners=[Z]}},{key:"unsubscribe",value:function(Z){if(this._listeners){var te=this._listeners.indexOf(Z);te!==-1&&this._listeners.splice(te,1)}}}],[{key:"source",value:function(){var Z;return{token:new B(function(te){Z=te}),cancel:Z}}}]),B}(),Ni={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ni).forEach(function(B){var Z=a(B,2),te=Z[0],ae=Z[1];Ni[ae]=te});var Mu=Ni,kr=function B(Z){var te=new Ya(Z),ae=o(Ya.prototype.request,te);return U.extend(ae,Ya.prototype,te,{allOwnKeys:!0}),U.extend(ae,te,null,{allOwnKeys:!0}),ae.create=function(ce){return B(Bt(Z,ce))},ae}(Q);return kr.Axios=Ya,kr.CanceledError=hr,kr.CancelToken=Cu,kr.isCancel=fr,kr.VERSION=xi,kr.toFormData=re,kr.AxiosError=$,kr.Cancel=kr.CanceledError,kr.all=function(B){return Promise.all(B)},kr.spread=function(B){return function(Z){return B.apply(null,Z)}},kr.isAxiosError=function(B){return U.isObject(B)&&B.isAxiosError===!0},kr.mergeConfig=Bt,kr.AxiosHeaders=be,kr.formToJSON=function(B){return ee(U.isHTMLForm(B)?new FormData(B):B)},kr.HttpStatusCode=Mu,kr.default=kr,kr});const Gr=v6();function v6(){let r=new Date,e=r.getMilliseconds()+1e3*r.getSeconds()+6e4*r.getMinutes()+36e5*r.getHours(),t=null,n=0,a=window.location.pathname.trim().replace(/(^[\/]*|[\/]*$)/g,""),i="(unavailable)";try{i=window.top.location.pathname.trim().replace(/(^[\/]*|[\/]*$)/g,"")}catch{}function o(d,y,x,D,h,w){let g=!0;t||(t=[],g=!1),t.push({id:d,ticket:y,processor:x,progressor:D,context:h,queue:w});let b=0;function A(){if(t&&t.length===0){t=null;return}b++;let N=Gr.context().onFinally(function(){b<=2?setTimeout(A,2e3):b<=4?setTimeout(A,3e3):setTimeout(A,5e3)}),E=[];for(let S=0;S<t.length;S++){let C=t[S].ticket;E.push(C)}Gr.call("$.QueryPreemptedResponses",{tickets:E}).done(function(S){if(S.error){let C=t.splice(0,E.length);for(let M=0;M<C.length;M++)C[M].processor.process(S);for(let M=0;M<C.length;M++){let O=C[M];O.context.preempted&&(O.context.preempted=null,O.context.__leave())}return!1}for(let C in S.result){let I=function(k,_,P){function V(q,J){if(q.queue.ready||(q.queue.ready=[]),q.queue.ready.push({ticket:_,handler:function(){try{q.processor.process(J)}finally{let ne=q.context.preempted.indexOf(_);q.context.preempted.splice(ne,1),q.context.preempted.length===0&&(q.context.preempted=null,q.context.__leave())}}}),q.queue.ready.length===q.queue.preempted){for(let ne=0;ne<E.length;ne++){let j=E[ne];for(let F=0;F<q.queue.ready.length;F++){let U=q.queue.ready[F];U.ticket===j&&U.handler()}}q.queue.ready=[]}}if(k.status==="error"){let q=t.splice(P,1)[0];V(q,{id:q.id,error:{code:-1,message:k.reason}})}else if(k.status==="ok"){let q=t.splice(P,1)[0];(function(ne){Gr.call("$.RetrievePreemptedResponse",{ticket:ne.ticket}).done(function(j){let F=j;F&&F.result&&F.result.code&&F.result.code>=-32700&&F.result.code<=-32e3&&(F={id:F.id,error:F.result}),V(ne,F)}).post(N)})(q)}else{let q=t[P];q.progressor&&q.progressor.progress(k)}},M=S.result[C],O=-1;for(let k=0;k<t.length;k++)if(t[k].ticket===C){O=k;break}O!==-1&&I(M,C,O)}return!1}).post(N)}g||setTimeout(A,2e3)}let l=function(){let d=[],y=null,x=700;function D(h){let w=d;if(d=[],w.length===0)return;w.preempted=0;let g;if(w.length===1)g=w[0].batch;else{g=[];for(let M=0;M<w.length;M++){let O=w[M].batch;for(let I=0;I<O.length;I++)g.push(O[I])}}let b=[];if(g.length===1)b=g[0].request;else{b.push({method:"$.BeginSynchronizedBatch",params:[]});for(let M=0;M<g.length;M++){let O=g[M].request;if(M===0&&O.method===b[0].method){b[0]=O;continue}b.push(g[M].request)}}let A=function(M,O){for(let I=0;I<w.length;I++)w[I].fail(M,O)},N=function(M,O){try{if(!M){A(!0,"Server returned an empty response. This is likely a server bug.");return}if(M.ajaxCallFailed){M.error.status==="timeout"?A(!0,"JSON-RPC call failed. Timeout."):M.error.status==="error"&&!M.error.details?A(!0,"JSON-RPC call failed. No connection to server."):A(!0,"JSON-RPC call failed. Status: '"+M.error.status+"'"+(M.error.details?", Details: "+JSON.stringify(M.error.details,null,2):""));return}let I=typeof M=="object"&&M instanceof Array?M:[M];if(I.length===0){A(!0,"Server returned an empty list of responses.");return}if(I.length===1){let k=I[0];if(typeof k.id<"u"&&k.id.indexOf&&k.id.indexOf("e2-status-")===0){I=[];for(let _=0;_<w.length;_++){let V=w[_].batch;for(let q=0;q<V.length;q++){let J=JSON.parse(JSON.stringify(k));J.id=V[q].request.id,I.push(J)}}}}for(let k=0;k<I.length;k++){let _=I[k];if(typeof _.result>"u"&&!_.error){A(!0,"Server returned invalid JSON-RPC response: "+JSON.stringify(_,null,2));return}let P=null,V=null,q=null;if(typeof _.id<"u")for(let ne=0;ne<w.length;ne++){let j=w[ne],F=j.batch;for(let U=0;U<F.length;U++){let $=F[U];if(!(!$.request.id||$.request.id!==_.id)){P=$.callbacks,V=$.progressCallbacks,q=j.context;break}}if(P)break}q||(q=Gr.context(),P=[function(ne){return window.MessagesUI?window.MessagesUI.show({message:ne,json:!0}):console.log(ne),!0}],V=[]);let J={context:q,callbacks:P,process:function(ne,j){let F=this.context.__preview(ne);if(F){if(this.callbacks)for(let U=0;U<this.callbacks.length;U++){let $=this.callbacks[U];$(ne,j)||(F=!1)}F&&(ne.error?this.context.__defaultApiFail(ne.error)||A(!1,ne.error):this.context.__defaultApiSucceed(ne.result)||h.log(ne.result))}}};if(_.error&&_.error.code===-32099&&h.autoQueryPreempted){let ne=_.error.data;q.preempted||(q.preempted=[]),q.preempted.push(ne),w.preempted++;let j={callbacks:V,progress:function(F){if(this.callbacks)for(let U=0;U<this.callbacks.length;U++){let $=this.callbacks[U];$&&$(F)}}};o(_.id,ne,J,j,q,w);continue}J.process(_,O)}}finally{for(let I=0;I<w.length;I++){let k=w[I].context;k.preempted||k.__leave()}}},E={timeout:0,responseType:"blob",withCredentials:!0},S=h.headers;S?S=JSON.parse(JSON.stringify(S)):S={},S["JsonRpc-Preempt-After"]||(S["JsonRpc-Preempt-After"]=h.jsonRpcPreemptAfter),S["JsonRpc-Path-TopLevel"]=i,S["JsonRpc-Path"]=a,E.headers=S,n++,axios.post(h.url,b,E).then(async function(M){n--;let O=M.headers["Content-Length"]??M.headers["content-length"]??M.headers["D3Pro-Uncompressed-Content-Length"]??M.headers["d3pro-uncompressed-content-length"]??0;const I=new Blob([M.data],{type:"application/json"});if(O&&h.largeResponseDownloadLimitMb&&h.largeResponseDownloadLimitMb>0&&O>h.largeResponseDownloadLimitMb*1024*1024){let P=`LargeJsonRpcResponse (${new Date().toISOString().replace("T"," ").replaceAll(":","-")}).json`;console.log("Response too large to load. It will be downloaded to file instead: "+P);const V=document.createElement("a"),q=URL.createObjectURL(I);V.href=q,V.download=P,V.click(),URL.revokeObjectURL(q),N({error:{status:"TOO_LARGE_REDIRECTED_TO_FILE",details:"Response was too large to load. It was saved to a file instead: '"+P+"'."}},M.request)}else{let P=JSON.parse(await I.text());N(P,M.request)}M.headers["D3Pro-Refresh-Top-Level"]=="True"&&(console.log("Response requires a full page refresh. Doing it."),window.top.location.reload())}).catch(function(M){console.log(M),n--,N({error:{status:M.code,details:M.message},ajaxCallFailed:!0})})}return{dispatch:function(h,w,g,b){let A=y;y=new Date,d.length===0&&(d.created=y),d.push({batch:h,context:w,fail:g});let N=b??Gr.config;if(h.length===1){let E=h[0].request.method;if(E[0]==="$"&&E.indexOf("Preempted")>-1){if(d.length>1){let S=d.pop();D(N),d=[],d.push(S)}D(N);return}}if(!N.batch){D(N);return}if(A!=null){let E=y-A;y-d.created<3e3&&(n>3||E<x)&&d.timeoutHandle&&(clearTimeout(d.timeoutHandle),d.timeoutHandle=null)}if(n===0){d.timeoutHandle=setTimeout(function(){D(N)},1);return}d.timeoutHandle=setTimeout(function(){D(N)},x+50)}}}();function u(){let d=arguments[0],y=[];const x=D=>D&&[void 0,Object].includes(D.constructor);if(arguments.length===2&&(x(arguments[1])||Array.isArray(arguments[1])))y=arguments[1];else for(let D=1;D<arguments.length;D++)y.push(arguments[D]);return{method:d,params:y}}function s(d,y){let x=[];x.push({request:d,callbacks:[],progressCallbacks:[]});let D=null,h=function(w,g){if(!(D&&w===!0&&D.__rpcFail(g))){if(y&&y.unhandledError){y.unhandledError(g);return}console.log(g)}};return{call:function(){let w=u.apply(null,arguments);return e++,w.id=e,x.push({request:w,callbacks:[],progressCallbacks:[]}),this},notify:function(){let w=u.apply(null,arguments);return x.push({request:w,callbacks:[],progressCallbacks:[]}),this},using:function(w){let g=x[x.length-1].request;return g.id=w,this},done:function(w){let g=x.length>0?x[x.length-1]:null;return typeof w=="function"&&g.callbacks.push(w),this},progress:function(w){let g=x.length>0?x[x.length-1]:null;return typeof w=="function"&&g.progressCallbacks.push(w),this},post:function(w,g){D=w,D||(D=Gr.context()),D.__enter();let b=g??Gr.config;if(!b){try{h(!0,"RpcClient was invoked without a valid config object!")}finally{D.__leave()}return}if(b.jsonp){let A=[];if(x.length===1)A=x[0].request;else for(let M=0;M<x.length;M++)A.push(x[M].request);let N=b.headers;N||(N={});let E="__jsonpCallback_"+e,S=b.url+"?callback="+E+"&jsonrpc="+JSON.stringify(A);for(let M in N)N.hasOwnProperty(M)&&(S=S+"&"+M+"="+b.headers[M]);let C=document.createElement("script");C.setAttribute("src",S),window[E]=function(M){window[E]=null,document.getElementsByTagName("body")[0].removeChild(C),C=null,handler(M)},document.getElementsByTagName("body")[0].appendChild(C),D.__leave();return}l.dispatch(x,D,h,b)}}}let c={url:"json.rpc",batch:!0,jsonRpcPreemptAfter:7,autoQueryPreempted:!0,log:function(d){console.log(d)},unhandledError:function(d){console.log(d)}},f=null,m=document.getElementsByTagName("head");if(m&&m.length){let d=m[0].getElementsByTagName("base");d&&d.length&&(f=d[0].getAttribute("href"))}function v(d){return d.map(function(y){return y.trim().replace(/(^[\/]*|[\/]*$)/g,"")}).join("/")}let p=window.top.location.pathname.trim().replace(/(^[\/]*|[\/]*$)/g,"");return!p||p===""?f&&(c.url=v([f,c.url])):f?c.url=v([f,p,c.url]):c.url=v([p,c.url]),{config:c,call:function(){let d=u.apply(null,arguments);return e++,d.id=e,s(d,this.config)},notify:function(){let d=u.apply(null,arguments);return s(d,this.config)},context:function(){let d={count:0,rpcErrorHandlers:[],apiErrorHandlers:[],apiSuccessHandlers:[],responsePreviewers:[],finallyHandlers:[]};return{onRpcError:function(y){return typeof y=="function"&&d.rpcErrorHandlers.push(y),this},onDefaultApiError:function(y){return typeof y=="function"&&d.apiErrorHandlers.push(y),this},onDefaultApiSuccess:function(y){return typeof y=="function"&&d.apiSuccessHandlers.push(y),this},onFinally:function(y){return typeof y=="function"&&d.finallyHandlers.push(y),this},onPreviewResponse:function(y){return typeof y=="function"&&d.responsePreviewers.push(y),this},__enter:function(){d.count++},__preview:function(){if(d.responsePreviewers.length===0)return!0;let y=!1;for(let x=0;x<d.responsePreviewers.length;x++)d.responsePreviewers[x].apply(null,arguments)||(y=!0);return!y},__rpcFail:function(){if(d.rpcErrorHandlers.length===0)return!1;for(let y=0;y<d.rpcErrorHandlers.length;y++)d.rpcErrorHandlers[y].apply(null,arguments);return!0},__defaultApiFail:function(){if(d.apiErrorHandlers.length===0)return!1;for(let y=0;y<d.apiErrorHandlers.length;y++)d.apiErrorHandlers[y].apply(null,arguments);return!0},__defaultApiSucceed:function(){if(d.apiSuccessHandlers.length===0)return!1;for(let y=0;y<d.apiSuccessHandlers.length;y++)d.apiSuccessHandlers[y].apply(null,arguments);return!0},__leave:function(){if(d.count--,!(d.count>0))for(let y=0;y<d.finallyHandlers.length;y++)d.finallyHandlers[y].apply(null,arguments)}}}}}const Fh=async(r,e,t)=>{Gr.config={},Gr.config.url=r+"/json.rpc",Gr.config.cors=!0;var n="GEI.GetClientLibObj",a={Legislation:e};Gr.call(n,a).done(function(i){return t!=null&&t(i),i}).post(Su())},p6=async(r,e,t)=>{Gr.config={},Gr.config.url=r+"/json.rpc",Gr.config.cors=!0;var n="EOLN.GetNewEditObj",a={};Gr.call(n,a).done(function(i){return t!=null&&t(i),i}).post(Su())},d6=async(r,e,t,n,a)=>{Gr.config={},Gr.config.url=r+"/json.rpc",Gr.config.cors=!0;var i="GEI.CreateXML",o={Legislation:e,Version:t,InputObj:Au(n)};Gr.call(i,o).done(function(l){return a!=null&&a(l),l}).post(Su())},h6=(r,e,t)=>{var n=Au(e);console.log("Tech obj:"),console.log(n);var a=new _h(r,n,t);a.Evaluate()||console.log("Errors:");const i=a.getAliasObject();console.log("Aliased obj:"),console.log(i);const o=b6(i,e);return console.log("Edit obj new:"),console.log(o),o},g6=(r,e)=>{var t=Nu("Invoice",e.Invoice);return t},Nu=(r,e)=>{if(e==null)return null;var t={};if(Array.isArray(e)){var n=[];for(let o=0;o<e.length;o++){var a=e[o]??null,i=Nu(r,a);i!=null&&n.push(i)}t=n}else t=y6(r,e);return t},y6=(r,e)=>{if(e._details!=null){var t=e._details,n=Object.keys(t),a={};for(let o=0;o<n.length;o++){const l=n[o],u=t[l]??null;var i=Nu(l,u);i!=null&&(a[l]=i)}Object.keys(a).length>0}},b6=(r,e)=>{var t=Eu("Invoice",r.Invoice,e.Invoice);return t},Eu=(r,e,t)=>{if(e==null||t==null)return null;var n={};if(Array.isArray(e)){var a=[];for(let l=0;l<e.length;l++){var i=t[l]??null,o=Eu(r,e[l],i);o!=null&&a.push(o)}n=a}else n=x6(r,e,t);return n},x6=(r,e,t)=>{var n={};if(e._details!=null){var a=e._details,i=t._details??{},o=Object.keys(a),l={};for(let f=0;f<o.length;f++){const m=o[f],v=i[m]??null,p=a[m]??null;var u=Eu(m,p,v);u!=null&&(l[m]=u)}Object.keys(l).length>0&&(n._details=l)}var s=Object.keys(e);for(let f=0;f<s.length;f++){var c=s[f];c!="_details"&&t[c]!=null&&(t[c].Value=e[c],n[c]=t[c])}return Object.keys(n).length==0?null:n},Au=r=>{var e=Oh("Invoice",r.Invoice);return e},Oh=(r,e)=>{var t=null;e!=null&&(Array.isArray(e)?(t=[],e.forEach(a=>{t.push(Bh(a))})):t=Bh(e));let n={};return n[r]=t,n},Bh=r=>{var e={},t=Object.keys(r);return t.forEach(n=>{if(n=="_details"){var a={},i=Object.keys(r[n]);i.forEach(o=>{var l=Oh(o,r[n][o]);a=Object.assign(a,l)}),e._details=a;return}e[n]=r[n].Value}),e},w6=(r,e,t)=>{var n=Th.getFromSessionStorage("ClientInfo");if(n==null){var a=o=>{o.result!=null?o.result.Status=="OK"?(D6(o.result.Result),t(o.result.Result)):console.error("Error getting client info from server: "+o.result.Reason):console.error("Error getting client info from server:"+o.error.data)};Fh(r,e,a)}else{var i=JSON.parse(n);t(i)}},D6=r=>{Th.setToSessionStorage("ClientInfo",r)},Su=()=>Gr.context().onRpcError(function(r){}).onDefaultApiError(function(r){}).onDefaultApiSuccess(function(r){});At.evaluateEdit=h6,At.fromEditToTech=Au,At.fromEditToView=g6,At.generateXMLFromServer=d6,At.getClientInfo=w6,At.getClientInfoFromServer=Fh,At.getEditNewFromServer=p6,Object.defineProperty(At,Symbol.toStringTag,{value:"Module"})});
|
|
64
|
+
`)}},{key:Symbol.toStringTag,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(ae){return ae instanceof this?ae:new this(ae)}},{key:"concat",value:function(ae){for(var ce=new this(ae),fe=arguments.length,ge=new Array(fe>1?fe-1:0),Ae=1;Ae<fe;Ae++)ge[Ae-1]=arguments[Ae];return ge.forEach(function(Ee){return ce.set(Ee)}),ce}},{key:"accessor",value:function(ae){var ce=(this[ue]=this[ue]={accessors:{}}).accessors,fe=this.prototype;function ge(Ae){var Ee=oe(Ae);ce[Ee]||(function(Fe,Re){var pr=U.toCamelCase(" "+Re);["get","set","has"].forEach(function(Ve){Object.defineProperty(Fe,Ve+pr,{value:function(je,Pe,mr){return this[Ve].call(this,Re,je,Pe,mr)},configurable:!0})})}(fe,Ae),ce[Ee]=!0)}return U.isArray(ae)?ae.forEach(ge):ge(ae),this}}]),te}();Te.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),U.freezeMethods(Te.prototype),U.freezeMethods(Te);var be=Te;function ke(B,Z){var te=this||Q,ae=Z||te,ce=be.from(ae.headers),fe=ae.data;return U.forEach(B,function(ge){fe=ge.call(te,fe,ce.normalize(),Z?Z.status:void 0)}),ce.normalize(),fe}function fr(B){return!(!B||!B.__CANCEL__)}function hr(B,Z,te){$.call(this,B??"canceled",$.ERR_CANCELED,Z,te),this.name="CanceledError"}U.inherits(hr,$,{__CANCEL__:!0});var ir=G.isStandardBrowserEnv?{write:function(B,Z,te,ae,ce,fe){var ge=[];ge.push(B+"="+encodeURIComponent(Z)),U.isNumber(te)&&ge.push("expires="+new Date(te).toGMTString()),U.isString(ae)&&ge.push("path="+ae),U.isString(ce)&&ge.push("domain="+ce),fe===!0&&ge.push("secure"),document.cookie=ge.join("; ")},read:function(B){var Z=document.cookie.match(new RegExp("(^|;\\s*)("+B+")=([^;]*)"));return Z?decodeURIComponent(Z[3]):null},remove:function(B){this.write(B,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Fr(B,Z){return B&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(Z)?function(te,ae){return ae?te.replace(/\/+$/,"")+"/"+ae.replace(/^\/+/,""):te}(B,Z):Z}var T=G.isStandardBrowserEnv?function(){var B,Z=/(msie|trident)/i.test(navigator.userAgent),te=document.createElement("a");function ae(ce){var fe=ce;return Z&&(te.setAttribute("href",fe),fe=te.href),te.setAttribute("href",fe),{href:te.href,protocol:te.protocol?te.protocol.replace(/:$/,""):"",host:te.host,search:te.search?te.search.replace(/^\?/,""):"",hash:te.hash?te.hash.replace(/^#/,""):"",hostname:te.hostname,port:te.port,pathname:te.pathname.charAt(0)==="/"?te.pathname:"/"+te.pathname}}return B=ae(window.location.href),function(ce){var fe=U.isString(ce)?ae(ce):ce;return fe.protocol===B.protocol&&fe.host===B.host}}():function(){return!0};function K(B,Z){var te=0,ae=function(ce,fe){ce=ce||10;var ge,Ae=new Array(ce),Ee=new Array(ce),Fe=0,Re=0;return fe=fe!==void 0?fe:1e3,function(pr){var Ve=Date.now(),je=Ee[Re];ge||(ge=Ve),Ae[Fe]=pr,Ee[Fe]=Ve;for(var Pe=Re,mr=0;Pe!==Fe;)mr+=Ae[Pe++],Pe%=ce;if((Fe=(Fe+1)%ce)===Re&&(Re=(Re+1)%ce),!(Ve-ge<fe)){var wr=je&&Ve-je;return wr?Math.round(1e3*mr/wr):void 0}}}(50,250);return function(ce){var fe=ce.loaded,ge=ce.lengthComputable?ce.total:void 0,Ae=fe-te,Ee=ae(Ae);te=fe;var Fe={loaded:fe,total:ge,progress:ge?fe/ge:void 0,bytes:Ae,rate:Ee||void 0,estimated:Ee&&ge&&fe<=ge?(ge-fe)/Ee:void 0,event:ce};Fe[Z?"download":"upload"]=!0,B(Fe)}}var de={http:null,xhr:typeof XMLHttpRequest<"u"&&function(B){return new Promise(function(Z,te){var ae,ce=B.data,fe=be.from(B.headers).normalize(),ge=B.responseType;function Ae(){B.cancelToken&&B.cancelToken.unsubscribe(ae),B.signal&&B.signal.removeEventListener("abort",ae)}U.isFormData(ce)&&(G.isStandardBrowserEnv||G.isStandardBrowserWebWorkerEnv?fe.setContentType(!1):fe.setContentType("multipart/form-data;",!1));var Ee=new XMLHttpRequest;if(B.auth){var Fe=B.auth.username||"",Re=B.auth.password?unescape(encodeURIComponent(B.auth.password)):"";fe.set("Authorization","Basic "+btoa(Fe+":"+Re))}var pr=Fr(B.baseURL,B.url);function Ve(){if(Ee){var wr=be.from("getAllResponseHeaders"in Ee&&Ee.getAllResponseHeaders());(function(Pr,Br,en){var Rh=en.config.validateStatus;en.status&&Rh&&!Rh(en.status)?Br(new $("Request failed with status code "+en.status,[$.ERR_BAD_REQUEST,$.ERR_BAD_RESPONSE][Math.floor(en.status/100)-4],en.config,en.request,en)):Pr(en)})(function(Pr){Z(Pr),Ae()},function(Pr){te(Pr),Ae()},{data:ge&&ge!=="text"&&ge!=="json"?Ee.response:Ee.responseText,status:Ee.status,statusText:Ee.statusText,headers:wr,config:B,request:Ee}),Ee=null}}if(Ee.open(B.method.toUpperCase(),Ie(pr,B.params,B.paramsSerializer),!0),Ee.timeout=B.timeout,"onloadend"in Ee?Ee.onloadend=Ve:Ee.onreadystatechange=function(){Ee&&Ee.readyState===4&&(Ee.status!==0||Ee.responseURL&&Ee.responseURL.indexOf("file:")===0)&&setTimeout(Ve)},Ee.onabort=function(){Ee&&(te(new $("Request aborted",$.ECONNABORTED,B,Ee)),Ee=null)},Ee.onerror=function(){te(new $("Network Error",$.ERR_NETWORK,B,Ee)),Ee=null},Ee.ontimeout=function(){var wr=B.timeout?"timeout of "+B.timeout+"ms exceeded":"timeout exceeded",Pr=B.transitional||qe;B.timeoutErrorMessage&&(wr=B.timeoutErrorMessage),te(new $(wr,Pr.clarifyTimeoutError?$.ETIMEDOUT:$.ECONNABORTED,B,Ee)),Ee=null},G.isStandardBrowserEnv){var je=(B.withCredentials||T(pr))&&B.xsrfCookieName&&ir.read(B.xsrfCookieName);je&&fe.set(B.xsrfHeaderName,je)}ce===void 0&&fe.setContentType(null),"setRequestHeader"in Ee&&U.forEach(fe.toJSON(),function(wr,Pr){Ee.setRequestHeader(Pr,wr)}),U.isUndefined(B.withCredentials)||(Ee.withCredentials=!!B.withCredentials),ge&&ge!=="json"&&(Ee.responseType=B.responseType),typeof B.onDownloadProgress=="function"&&Ee.addEventListener("progress",K(B.onDownloadProgress,!0)),typeof B.onUploadProgress=="function"&&Ee.upload&&Ee.upload.addEventListener("progress",K(B.onUploadProgress)),(B.cancelToken||B.signal)&&(ae=function(wr){Ee&&(te(!wr||wr.type?new hr(null,B,Ee):wr),Ee.abort(),Ee=null)},B.cancelToken&&B.cancelToken.subscribe(ae),B.signal&&(B.signal.aborted?ae():B.signal.addEventListener("abort",ae)));var Pe,mr=(Pe=/^([-+\w]{1,25})(:?\/\/|:)/.exec(pr))&&Pe[1]||"";mr&&G.protocols.indexOf(mr)===-1?te(new $("Unsupported protocol "+mr+":",$.ERR_BAD_REQUEST,B)):Ee.send(ce||null)})}};U.forEach(de,function(B,Z){if(B){try{Object.defineProperty(B,"name",{value:Z})}catch{}Object.defineProperty(B,"adapterName",{value:Z})}});var Se=function(B){for(var Z,te,ae=(B=U.isArray(B)?B:[B]).length,ce=0;ce<ae&&(Z=B[ce],!(te=U.isString(Z)?de[Z.toLowerCase()]:Z));ce++);if(!te)throw te===!1?new $("Adapter ".concat(Z," is not supported by the environment"),"ERR_NOT_SUPPORT"):new Error(U.hasOwnProp(de,Z)?"Adapter '".concat(Z,"' is not available in the build"):"Unknown adapter '".concat(Z,"'"));if(!U.isFunction(te))throw new TypeError("adapter is not a function");return te};function ze(B){if(B.cancelToken&&B.cancelToken.throwIfRequested(),B.signal&&B.signal.aborted)throw new hr(null,B)}function Ke(B){return ze(B),B.headers=be.from(B.headers),B.data=ke.call(B,B.transformRequest),["post","put","patch"].indexOf(B.method)!==-1&&B.headers.setContentType("application/x-www-form-urlencoded",!1),Se(B.adapter||Q.adapter)(B).then(function(Z){return ze(B),Z.data=ke.call(B,B.transformResponse,Z),Z.headers=be.from(Z.headers),Z},function(Z){return fr(Z)||(ze(B),Z&&Z.response&&(Z.response.data=ke.call(B,B.transformResponse,Z.response),Z.response.headers=be.from(Z.response.headers))),Promise.reject(Z)})}var rt=function(B){return B instanceof be?B.toJSON():B};function Bt(B,Z){Z=Z||{};var te={};function ae(Fe,Re,pr){return U.isPlainObject(Fe)&&U.isPlainObject(Re)?U.merge.call({caseless:pr},Fe,Re):U.isPlainObject(Re)?U.merge({},Re):U.isArray(Re)?Re.slice():Re}function ce(Fe,Re,pr){return U.isUndefined(Re)?U.isUndefined(Fe)?void 0:ae(void 0,Fe,pr):ae(Fe,Re,pr)}function fe(Fe,Re){if(!U.isUndefined(Re))return ae(void 0,Re)}function ge(Fe,Re){return U.isUndefined(Re)?U.isUndefined(Fe)?void 0:ae(void 0,Fe):ae(void 0,Re)}function Ae(Fe,Re,pr){return pr in Z?ae(Fe,Re):pr in B?ae(void 0,Fe):void 0}var Ee={url:fe,method:fe,data:fe,baseURL:ge,transformRequest:ge,transformResponse:ge,paramsSerializer:ge,timeout:ge,timeoutMessage:ge,withCredentials:ge,adapter:ge,responseType:ge,xsrfCookieName:ge,xsrfHeaderName:ge,onUploadProgress:ge,onDownloadProgress:ge,decompress:ge,maxContentLength:ge,maxBodyLength:ge,beforeRedirect:ge,transport:ge,httpAgent:ge,httpsAgent:ge,cancelToken:ge,socketPath:ge,responseEncoding:ge,validateStatus:Ae,headers:function(Fe,Re){return ce(rt(Fe),rt(Re),!0)}};return U.forEach(Object.keys(Object.assign({},B,Z)),function(Fe){var Re=Ee[Fe]||ce,pr=Re(B[Fe],Z[Fe],Fe);U.isUndefined(pr)&&Re!==Ae||(te[Fe]=pr)}),te}var xi="1.4.0",wi={};["object","boolean","number","function","string","symbol"].forEach(function(B,Z){wi[B]=function(te){return r(te)===B||"a"+(Z<1?"n ":" ")+B}});var Wo={};wi.transitional=function(B,Z,te){function ae(ce,fe){return"[Axios v1.4.0] Transitional option '"+ce+"'"+fe+(te?". "+te:"")}return function(ce,fe,ge){if(B===!1)throw new $(ae(fe," has been removed"+(Z?" in "+Z:"")),$.ERR_DEPRECATED);return Z&&!Wo[fe]&&(Wo[fe]=!0,console.warn(ae(fe," has been deprecated since v"+Z+" and will be removed in the near future"))),!B||B(ce,fe,ge)}};var Di={assertOptions:function(B,Z,te){if(r(B)!=="object")throw new $("options must be an object",$.ERR_BAD_OPTION_VALUE);for(var ae=Object.keys(B),ce=ae.length;ce-- >0;){var fe=ae[ce],ge=Z[fe];if(ge){var Ae=B[fe],Ee=Ae===void 0||ge(Ae,fe,B);if(Ee!==!0)throw new $("option "+fe+" must be "+Ee,$.ERR_BAD_OPTION_VALUE)}else if(te!==!0)throw new $("Unknown option "+fe,$.ERR_BAD_OPTION)}},validators:wi},un=Di.validators,Wa=function(){function B(Z){e(this,B),this.defaults=Z,this.interceptors={request:new Le,response:new Le}}return n(B,[{key:"request",value:function(Z,te){typeof Z=="string"?(te=te||{}).url=Z:te=Z||{};var ae,ce=te=Bt(this.defaults,te),fe=ce.transitional,ge=ce.paramsSerializer,Ae=ce.headers;fe!==void 0&&Di.assertOptions(fe,{silentJSONParsing:un.transitional(un.boolean),forcedJSONParsing:un.transitional(un.boolean),clarifyTimeoutError:un.transitional(un.boolean)},!1),ge!=null&&(U.isFunction(ge)?te.paramsSerializer={serialize:ge}:Di.assertOptions(ge,{encode:un.function,serialize:un.function},!0)),te.method=(te.method||this.defaults.method||"get").toLowerCase(),(ae=Ae&&U.merge(Ae.common,Ae[te.method]))&&U.forEach(["delete","get","head","post","put","patch","common"],function(Br){delete Ae[Br]}),te.headers=be.concat(ae,Ae);var Ee=[],Fe=!0;this.interceptors.request.forEach(function(Br){typeof Br.runWhen=="function"&&Br.runWhen(te)===!1||(Fe=Fe&&Br.synchronous,Ee.unshift(Br.fulfilled,Br.rejected))});var Re,pr=[];this.interceptors.response.forEach(function(Br){pr.push(Br.fulfilled,Br.rejected)});var Ve,je=0;if(!Fe){var Pe=[Ke.bind(this),void 0];for(Pe.unshift.apply(Pe,Ee),Pe.push.apply(Pe,pr),Ve=Pe.length,Re=Promise.resolve(te);je<Ve;)Re=Re.then(Pe[je++],Pe[je++]);return Re}Ve=Ee.length;var mr=te;for(je=0;je<Ve;){var wr=Ee[je++],Pr=Ee[je++];try{mr=wr(mr)}catch(Br){Pr.call(this,Br);break}}try{Re=Ke.call(this,mr)}catch(Br){return Promise.reject(Br)}for(je=0,Ve=pr.length;je<Ve;)Re=Re.then(pr[je++],pr[je++]);return Re}},{key:"getUri",value:function(Z){return Ie(Fr((Z=Bt(this.defaults,Z)).baseURL,Z.url),Z.params,Z.paramsSerializer)}}]),B}();U.forEach(["delete","get","head","options"],function(B){Wa.prototype[B]=function(Z,te){return this.request(Bt(te||{},{method:B,url:Z,data:(te||{}).data}))}}),U.forEach(["post","put","patch"],function(B){function Z(te){return function(ae,ce,fe){return this.request(Bt(fe||{},{method:B,headers:te?{"Content-Type":"multipart/form-data"}:{},url:ae,data:ce}))}}Wa.prototype[B]=Z(),Wa.prototype[B+"Form"]=Z(!0)});var Ya=Wa,Cu=function(){function B(Z){if(e(this,B),typeof Z!="function")throw new TypeError("executor must be a function.");var te;this.promise=new Promise(function(ce){te=ce});var ae=this;this.promise.then(function(ce){if(ae._listeners){for(var fe=ae._listeners.length;fe-- >0;)ae._listeners[fe](ce);ae._listeners=null}}),this.promise.then=function(ce){var fe,ge=new Promise(function(Ae){ae.subscribe(Ae),fe=Ae}).then(ce);return ge.cancel=function(){ae.unsubscribe(fe)},ge},Z(function(ce,fe,ge){ae.reason||(ae.reason=new hr(ce,fe,ge),te(ae.reason))})}return n(B,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(Z){this.reason?Z(this.reason):this._listeners?this._listeners.push(Z):this._listeners=[Z]}},{key:"unsubscribe",value:function(Z){if(this._listeners){var te=this._listeners.indexOf(Z);te!==-1&&this._listeners.splice(te,1)}}}],[{key:"source",value:function(){var Z;return{token:new B(function(te){Z=te}),cancel:Z}}}]),B}(),Ni={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ni).forEach(function(B){var Z=a(B,2),te=Z[0],ae=Z[1];Ni[ae]=te});var Mu=Ni,kr=function B(Z){var te=new Ya(Z),ae=o(Ya.prototype.request,te);return U.extend(ae,Ya.prototype,te,{allOwnKeys:!0}),U.extend(ae,te,null,{allOwnKeys:!0}),ae.create=function(ce){return B(Bt(Z,ce))},ae}(Q);return kr.Axios=Ya,kr.CanceledError=hr,kr.CancelToken=Cu,kr.isCancel=fr,kr.VERSION=xi,kr.toFormData=re,kr.AxiosError=$,kr.Cancel=kr.CanceledError,kr.all=function(B){return Promise.all(B)},kr.spread=function(B){return function(Z){return B.apply(null,Z)}},kr.isAxiosError=function(B){return U.isObject(B)&&B.isAxiosError===!0},kr.mergeConfig=Bt,kr.AxiosHeaders=be,kr.formToJSON=function(B){return ee(U.isHTMLForm(B)?new FormData(B):B)},kr.HttpStatusCode=Mu,kr.default=kr,kr});const Gr=v6();function v6(){let r=new Date,e=r.getMilliseconds()+1e3*r.getSeconds()+6e4*r.getMinutes()+36e5*r.getHours(),t=null,n=0,a=window.location.pathname.trim().replace(/(^[\/]*|[\/]*$)/g,""),i="(unavailable)";try{i=window.top.location.pathname.trim().replace(/(^[\/]*|[\/]*$)/g,"")}catch{}function o(d,y,x,D,h,w){let g=!0;t||(t=[],g=!1),t.push({id:d,ticket:y,processor:x,progressor:D,context:h,queue:w});let b=0;function A(){if(t&&t.length===0){t=null;return}b++;let N=Gr.context().onFinally(function(){b<=2?setTimeout(A,2e3):b<=4?setTimeout(A,3e3):setTimeout(A,5e3)}),E=[];for(let S=0;S<t.length;S++){let C=t[S].ticket;E.push(C)}Gr.call("$.QueryPreemptedResponses",{tickets:E}).done(function(S){if(S.error){let C=t.splice(0,E.length);for(let M=0;M<C.length;M++)C[M].processor.process(S);for(let M=0;M<C.length;M++){let O=C[M];O.context.preempted&&(O.context.preempted=null,O.context.__leave())}return!1}for(let C in S.result){let I=function(k,_,P){function V(q,J){if(q.queue.ready||(q.queue.ready=[]),q.queue.ready.push({ticket:_,handler:function(){try{q.processor.process(J)}finally{let ne=q.context.preempted.indexOf(_);q.context.preempted.splice(ne,1),q.context.preempted.length===0&&(q.context.preempted=null,q.context.__leave())}}}),q.queue.ready.length===q.queue.preempted){for(let ne=0;ne<E.length;ne++){let j=E[ne];for(let F=0;F<q.queue.ready.length;F++){let U=q.queue.ready[F];U.ticket===j&&U.handler()}}q.queue.ready=[]}}if(k.status==="error"){let q=t.splice(P,1)[0];V(q,{id:q.id,error:{code:-1,message:k.reason}})}else if(k.status==="ok"){let q=t.splice(P,1)[0];(function(ne){Gr.call("$.RetrievePreemptedResponse",{ticket:ne.ticket}).done(function(j){let F=j;F&&F.result&&F.result.code&&F.result.code>=-32700&&F.result.code<=-32e3&&(F={id:F.id,error:F.result}),V(ne,F)}).post(N)})(q)}else{let q=t[P];q.progressor&&q.progressor.progress(k)}},M=S.result[C],O=-1;for(let k=0;k<t.length;k++)if(t[k].ticket===C){O=k;break}O!==-1&&I(M,C,O)}return!1}).post(N)}g||setTimeout(A,2e3)}let l=function(){let d=[],y=null,x=700;function D(h){let w=d;if(d=[],w.length===0)return;w.preempted=0;let g;if(w.length===1)g=w[0].batch;else{g=[];for(let M=0;M<w.length;M++){let O=w[M].batch;for(let I=0;I<O.length;I++)g.push(O[I])}}let b=[];if(g.length===1)b=g[0].request;else{b.push({method:"$.BeginSynchronizedBatch",params:[]});for(let M=0;M<g.length;M++){let O=g[M].request;if(M===0&&O.method===b[0].method){b[0]=O;continue}b.push(g[M].request)}}let A=function(M,O){for(let I=0;I<w.length;I++)w[I].fail(M,O)},N=function(M,O){try{if(!M){A(!0,"Server returned an empty response. This is likely a server bug.");return}if(M.ajaxCallFailed){M.error.status==="timeout"?A(!0,"JSON-RPC call failed. Timeout."):M.error.status==="error"&&!M.error.details?A(!0,"JSON-RPC call failed. No connection to server."):A(!0,"JSON-RPC call failed. Status: '"+M.error.status+"'"+(M.error.details?", Details: "+JSON.stringify(M.error.details,null,2):""));return}let I=typeof M=="object"&&M instanceof Array?M:[M];if(I.length===0){A(!0,"Server returned an empty list of responses.");return}if(I.length===1){let k=I[0];if(typeof k.id<"u"&&k.id.indexOf&&k.id.indexOf("e2-status-")===0){I=[];for(let _=0;_<w.length;_++){let V=w[_].batch;for(let q=0;q<V.length;q++){let J=JSON.parse(JSON.stringify(k));J.id=V[q].request.id,I.push(J)}}}}for(let k=0;k<I.length;k++){let _=I[k];if(typeof _.result>"u"&&!_.error){A(!0,"Server returned invalid JSON-RPC response: "+JSON.stringify(_,null,2));return}let P=null,V=null,q=null;if(typeof _.id<"u")for(let ne=0;ne<w.length;ne++){let j=w[ne],F=j.batch;for(let U=0;U<F.length;U++){let $=F[U];if(!(!$.request.id||$.request.id!==_.id)){P=$.callbacks,V=$.progressCallbacks,q=j.context;break}}if(P)break}q||(q=Gr.context(),P=[function(ne){return window.MessagesUI?window.MessagesUI.show({message:ne,json:!0}):console.log(ne),!0}],V=[]);let J={context:q,callbacks:P,process:function(ne,j){let F=this.context.__preview(ne);if(F){if(this.callbacks)for(let U=0;U<this.callbacks.length;U++){let $=this.callbacks[U];$(ne,j)||(F=!1)}F&&(ne.error?this.context.__defaultApiFail(ne.error)||A(!1,ne.error):this.context.__defaultApiSucceed(ne.result)||h.log(ne.result))}}};if(_.error&&_.error.code===-32099&&h.autoQueryPreempted){let ne=_.error.data;q.preempted||(q.preempted=[]),q.preempted.push(ne),w.preempted++;let j={callbacks:V,progress:function(F){if(this.callbacks)for(let U=0;U<this.callbacks.length;U++){let $=this.callbacks[U];$&&$(F)}}};o(_.id,ne,J,j,q,w);continue}J.process(_,O)}}finally{for(let I=0;I<w.length;I++){let k=w[I].context;k.preempted||k.__leave()}}},E={timeout:0,responseType:"blob",withCredentials:!0},S=h.headers;S?S=JSON.parse(JSON.stringify(S)):S={},S["JsonRpc-Preempt-After"]||(S["JsonRpc-Preempt-After"]=h.jsonRpcPreemptAfter),S["JsonRpc-Path-TopLevel"]=i,S["JsonRpc-Path"]=a,E.headers=S,n++,axios.post(h.url,b,E).then(async function(M){n--;let O=M.headers["Content-Length"]??M.headers["content-length"]??M.headers["D3Pro-Uncompressed-Content-Length"]??M.headers["d3pro-uncompressed-content-length"]??0;const I=new Blob([M.data],{type:"application/json"});if(O&&h.largeResponseDownloadLimitMb&&h.largeResponseDownloadLimitMb>0&&O>h.largeResponseDownloadLimitMb*1024*1024){let P=`LargeJsonRpcResponse (${new Date().toISOString().replace("T"," ").replaceAll(":","-")}).json`;console.log("Response too large to load. It will be downloaded to file instead: "+P);const V=document.createElement("a"),q=URL.createObjectURL(I);V.href=q,V.download=P,V.click(),URL.revokeObjectURL(q),N({error:{status:"TOO_LARGE_REDIRECTED_TO_FILE",details:"Response was too large to load. It was saved to a file instead: '"+P+"'."}},M.request)}else{let P=JSON.parse(await I.text());N(P,M.request)}M.headers["D3Pro-Refresh-Top-Level"]=="True"&&(console.log("Response requires a full page refresh. Doing it."),window.top.location.reload())}).catch(function(M){console.log(M),n--,N({error:{status:M.code,details:M.message},ajaxCallFailed:!0})})}return{dispatch:function(h,w,g,b){let A=y;y=new Date,d.length===0&&(d.created=y),d.push({batch:h,context:w,fail:g});let N=b??Gr.config;if(h.length===1){let E=h[0].request.method;if(E[0]==="$"&&E.indexOf("Preempted")>-1){if(d.length>1){let S=d.pop();D(N),d=[],d.push(S)}D(N);return}}if(!N.batch){D(N);return}if(A!=null){let E=y-A;y-d.created<3e3&&(n>3||E<x)&&d.timeoutHandle&&(clearTimeout(d.timeoutHandle),d.timeoutHandle=null)}if(n===0){d.timeoutHandle=setTimeout(function(){D(N)},1);return}d.timeoutHandle=setTimeout(function(){D(N)},x+50)}}}();function u(){let d=arguments[0],y=[];const x=D=>D&&[void 0,Object].includes(D.constructor);if(arguments.length===2&&(x(arguments[1])||Array.isArray(arguments[1])))y=arguments[1];else for(let D=1;D<arguments.length;D++)y.push(arguments[D]);return{method:d,params:y}}function s(d,y){let x=[];x.push({request:d,callbacks:[],progressCallbacks:[]});let D=null,h=function(w,g){if(!(D&&w===!0&&D.__rpcFail(g))){if(y&&y.unhandledError){y.unhandledError(g);return}console.log(g)}};return{call:function(){let w=u.apply(null,arguments);return e++,w.id=e,x.push({request:w,callbacks:[],progressCallbacks:[]}),this},notify:function(){let w=u.apply(null,arguments);return x.push({request:w,callbacks:[],progressCallbacks:[]}),this},using:function(w){let g=x[x.length-1].request;return g.id=w,this},done:function(w){let g=x.length>0?x[x.length-1]:null;return typeof w=="function"&&g.callbacks.push(w),this},progress:function(w){let g=x.length>0?x[x.length-1]:null;return typeof w=="function"&&g.progressCallbacks.push(w),this},post:function(w,g){D=w,D||(D=Gr.context()),D.__enter();let b=g??Gr.config;if(!b){try{h(!0,"RpcClient was invoked without a valid config object!")}finally{D.__leave()}return}if(b.jsonp){let A=[];if(x.length===1)A=x[0].request;else for(let M=0;M<x.length;M++)A.push(x[M].request);let N=b.headers;N||(N={});let E="__jsonpCallback_"+e,S=b.url+"?callback="+E+"&jsonrpc="+JSON.stringify(A);for(let M in N)N.hasOwnProperty(M)&&(S=S+"&"+M+"="+b.headers[M]);let C=document.createElement("script");C.setAttribute("src",S),window[E]=function(M){window[E]=null,document.getElementsByTagName("body")[0].removeChild(C),C=null,handler(M)},document.getElementsByTagName("body")[0].appendChild(C),D.__leave();return}l.dispatch(x,D,h,b)}}}let c={url:"json.rpc",batch:!0,jsonRpcPreemptAfter:7,autoQueryPreempted:!0,log:function(d){console.log(d)},unhandledError:function(d){console.log(d)}},f=null,m=document.getElementsByTagName("head");if(m&&m.length){let d=m[0].getElementsByTagName("base");d&&d.length&&(f=d[0].getAttribute("href"))}function v(d){return d.map(function(y){return y.trim().replace(/(^[\/]*|[\/]*$)/g,"")}).join("/")}let p=window.top.location.pathname.trim().replace(/(^[\/]*|[\/]*$)/g,"");return!p||p===""?f&&(c.url=v([f,c.url])):f?c.url=v([f,p,c.url]):c.url=v([p,c.url]),{config:c,call:function(){let d=u.apply(null,arguments);return e++,d.id=e,s(d,this.config)},notify:function(){let d=u.apply(null,arguments);return s(d,this.config)},context:function(){let d={count:0,rpcErrorHandlers:[],apiErrorHandlers:[],apiSuccessHandlers:[],responsePreviewers:[],finallyHandlers:[]};return{onRpcError:function(y){return typeof y=="function"&&d.rpcErrorHandlers.push(y),this},onDefaultApiError:function(y){return typeof y=="function"&&d.apiErrorHandlers.push(y),this},onDefaultApiSuccess:function(y){return typeof y=="function"&&d.apiSuccessHandlers.push(y),this},onFinally:function(y){return typeof y=="function"&&d.finallyHandlers.push(y),this},onPreviewResponse:function(y){return typeof y=="function"&&d.responsePreviewers.push(y),this},__enter:function(){d.count++},__preview:function(){if(d.responsePreviewers.length===0)return!0;let y=!1;for(let x=0;x<d.responsePreviewers.length;x++)d.responsePreviewers[x].apply(null,arguments)||(y=!0);return!y},__rpcFail:function(){if(d.rpcErrorHandlers.length===0)return!1;for(let y=0;y<d.rpcErrorHandlers.length;y++)d.rpcErrorHandlers[y].apply(null,arguments);return!0},__defaultApiFail:function(){if(d.apiErrorHandlers.length===0)return!1;for(let y=0;y<d.apiErrorHandlers.length;y++)d.apiErrorHandlers[y].apply(null,arguments);return!0},__defaultApiSucceed:function(){if(d.apiSuccessHandlers.length===0)return!1;for(let y=0;y<d.apiSuccessHandlers.length;y++)d.apiSuccessHandlers[y].apply(null,arguments);return!0},__leave:function(){if(d.count--,!(d.count>0))for(let y=0;y<d.finallyHandlers.length;y++)d.finallyHandlers[y].apply(null,arguments)}}}}}const Fh=async(r,e)=>{Gr.config={},Gr.config.url=r+"/json.rpc",Gr.config.cors=!0;var t="EOL.GetClientInfoForLib",n={};Gr.call(t,n).done(function(a){return e!=null&&e(a),a}).post(Su())},p6=async(r,e)=>{Gr.config={},Gr.config.url=r+"/json.rpc",Gr.config.cors=!0;var t="EOLN.GetNewEditObj",n={};Gr.call(t,n).done(function(a){return e!=null&&e(a),a}).post(Su())},d6=async(r,e,t,n,a)=>{Gr.config={},Gr.config.url=r+"/json.rpc",Gr.config.cors=!0;var i="GEI.CreateXML",o={Legislation:e,Version:t,InputObj:Au(n)};Gr.call(i,o).done(function(l){return a!=null&&a(l),l}).post(Su())},h6=(r,e)=>{r.Invoice==null&&(r.Invoice=r);var t=Au(r);console.log("Tech obj:"),console.log(t);var n=new _h(t,e);n.Evaluate()||console.log("Errors:");const a=n.getAliasObject();console.log("Aliased obj:"),console.log(a);const i=b6(a,r);return console.log("Edit obj new:"),console.log(i),i},g6=(r,e)=>{var t=Nu("Invoice",e.Invoice);return t},Nu=(r,e)=>{if(e==null)return null;var t={};if(Array.isArray(e)){var n=[];for(let o=0;o<e.length;o++){var a=e[o]??null,i=Nu(r,a);i!=null&&n.push(i)}t=n}else t=y6(r,e);return t},y6=(r,e)=>{if(e._details!=null){var t=e._details,n=Object.keys(t),a={};for(let o=0;o<n.length;o++){const l=n[o],u=t[l]??null;var i=Nu(l,u);i!=null&&(a[l]=i)}Object.keys(a).length>0}},b6=(r,e)=>{var t=Eu("Invoice",r.Invoice,e.Invoice);return t},Eu=(r,e,t)=>{if(e==null||t==null)return null;var n={};if(Array.isArray(e)){var a=[];for(let l=0;l<e.length;l++){var i=t[l]??null,o=Eu(r,e[l],i);o!=null&&a.push(o)}n=a}else n=x6(r,e,t);return n},x6=(r,e,t)=>{var n={};if(e._details!=null){var a=e._details,i=t._details??{},o=Object.keys(a),l={};for(let f=0;f<o.length;f++){const m=o[f],v=i[m]??null,p=a[m]??null;var u=Eu(m,p,v);u!=null&&(l[m]=u)}Object.keys(l).length>0&&(n._details=l)}var s=Object.keys(e);for(let f=0;f<s.length;f++){var c=s[f];c!="_details"&&t[c]!=null&&(t[c].Value=e[c],n[c]=t[c])}return Object.keys(n).length==0?null:n},Au=r=>{var e=Oh("Invoice",r.Invoice);return e},Oh=(r,e)=>{var t=null;e!=null&&(Array.isArray(e)?(t=[],e.forEach(a=>{t.push(Bh(a))})):t=Bh(e));let n={};return n[r]=t,n},Bh=r=>{var e={},t=Object.keys(r);return t.forEach(n=>{if(n=="_details"){var a={},i=Object.keys(r[n]);i.forEach(o=>{var l=Oh(o,r[n][o]);a=Object.assign(a,l)}),e._details=a;return}e[n]=r[n].Value}),e},w6=(r,e)=>{var t=Th.getFromSessionStorage("ClientInfo");if(t==null){var n=i=>{i.result!=null?i.result.Status=="OK"?(D6(i.result.Result),e(i.result.Result)):console.error("Error getting client info from server: "+i.result.Reason):console.error("Error getting client info from server:"+i.error.data)};Fh(r,n)}else{var a=JSON.parse(t);e(a)}},D6=r=>{Th.setToSessionStorage("ClientInfo",r)},Su=()=>Gr.context().onRpcError(function(r){}).onDefaultApiError(function(r){}).onDefaultApiSuccess(function(r){});At.evaluateEdit=h6,At.fromEditToTech=Au,At.fromEditToView=g6,At.generateXMLFromServer=d6,At.getClientInfo=w6,At.getClientInfoFromServer=Fh,At.getEditNewFromServer=p6,Object.defineProperty(At,Symbol.toStringTag,{value:"Module"})});
|