From 3c3c7e1c620f22662a6ff5deb3a8f48f491a8062 Mon Sep 17 00:00:00 2001 From: JP Cen Date: Sat, 27 Jul 2024 13:59:22 -0400 Subject: [PATCH] 0.9.995 --- main.js | 183 +++++++++++------- manifest.json | 2 +- src/adapters/obsidian/types/obsidian.d.ts | 5 +- .../obsidian/ui/editors/FlowEditor.tsx | 15 +- src/adapters/obsidian/utils/patches.ts | 110 +++++------ src/core/i18n.ts | 4 +- .../components/Explorer/PropertiesView.tsx | 1 - .../components/MarkdownEditor/Backlinks.tsx | 2 +- .../Navigator/SpaceTree/SpaceTreeItem.tsx | 8 + .../Contexts/ContextListContainer.tsx | 10 +- .../SpaceEditor/HeaderPropertiesView.tsx | 19 +- .../Contexts/TableView/TableView.tsx | 6 - .../Menus/contexts/newSpacePropertyMenu.tsx | 1 + .../UI/Menus/navigator/spaceContextMenu.tsx | 9 + .../UI/Stickers/PathSticker/PathSticker.tsx | 2 + .../react/context/ContextEditorContext.tsx | 11 +- src/core/types/space.ts | 2 +- src/css/Editor/Flow/FlowEditor.css | 4 + src/css/Panels/FileContext.css | 6 +- src/main.ts | 21 +- styles.css | 9 +- 21 files changed, 246 insertions(+), 184 deletions(-) diff --git a/main.js b/main.js index 141ae93..f806bc4 100644 --- a/main.js +++ b/main.js @@ -32234,7 +32234,7 @@ var T = class { newView: "New View", calendarView: "Calendar View", dayView: "Day View", - closeSpace: "Close Space", + closeSpace: "Close Space in Focus", customView: "Custom View", detailsView: "Details View", catalogView: "Catalog View", @@ -32854,7 +32854,7 @@ var T = class { }, hideFrontmatter: { name: "Hide Context Properties", - desc: "Hide properties you have addeed in context from the Obsidian properties panel" + desc: "Hide properties you have added in context from the Obsidian properties panel" }, openFileContext: { name: "Auto Open Explorer", @@ -36395,7 +36395,7 @@ var fileSystemSpaceInfoFromFolder = (manager, folder, readOnly) => { }; // src/core/types/space.ts -var FMMetadataKeys = (settings) => [settings.fmKeyAlias, settings.fmKeyBanner, settings.fmKeySticker, settings.fmKeyColor, settings.fmKeyBanner, settings.fmKeyBannerOffset]; +var FMMetadataKeys = (settings) => [settings.fmKeyBanner, settings.fmKeySticker, settings.fmKeyColor, settings.fmKeyBanner, settings.fmKeyBannerOffset]; var tagsSpacePath = "spaces://$tags"; var waypointsPath = { name: i18n_default.menu.waypoints, @@ -92781,6 +92781,14 @@ var showSpaceContextMenu = (superstate, path2, e5, activePath, parentSpace, onCl if (!space2) return; const menuOptions = []; + menuOptions.push({ + name: i18n_default.menu.openFilePane, + icon: "ui//go-to-file", + onClick: (e6) => { + superstate.ui.openPath(path2.path, true); + } + }); + menuOptions.push(menuSeparator); menuOptions.push({ name: "New", type: 6 /* Submenu */, @@ -96989,6 +96997,7 @@ var NewPropertyMenuComponent = (props) => { ).filter( (f2) => !existingCols.some((g) => g.name == f2.name) && ![ ...FMMetadataKeys(props.superstate.settings), + props.superstate.settings.fmKeyAlias, "tags", ...FMSpaceKeys(props.superstate.settings) ].some((g) => g == f2.name) @@ -97795,7 +97804,7 @@ var ContextEditorProvider = (props) => { let schemas = props.superstate.contextsIndex.get(contextPath)?.schemas; if (!schemas) schemas = await props.superstate.spaceManager.tablesForSpace(contextPath); - if (schemas && !(0, import_lodash10.isEqual)(schemaTable, schemas)) { + if (schemas && !(0, import_lodash10.isEqual)(schemaTable?.rows, schemas)) { setSchemaTable(() => ({ ...defaultSchema, rows: schemas @@ -97855,6 +97864,10 @@ var ContextEditorProvider = (props) => { "contextStateUpdated", refreshMDB ); + props.superstate.eventsDispatcher.addListener( + "spaceStateUpdated", + refreshMDB + ); props.superstate.eventsDispatcher.addListener( "pathStateUpdated", refreshPath @@ -97864,6 +97877,10 @@ var ContextEditorProvider = (props) => { "contextStateUpdated", refreshMDB ); + props.superstate.eventsDispatcher.removeListener( + "spaceStateUpdated", + refreshMDB + ); props.superstate.eventsDispatcher.removeListener( "pathStateUpdated", refreshPath @@ -102125,6 +102142,7 @@ var PathStickerView = (props) => { if (!pathState) return; e5.preventDefault(); + e5.stopPropagation(); const menuOptions = []; menuOptions.push({ name: i18n_default.buttons.changeIcon, @@ -102155,6 +102173,7 @@ var PathStickerView = (props) => { return false; }; const triggerStickerMenu = (e5) => { + e5.stopPropagation(); if (pathState?.type == "space") { props.superstate.ui.openPalette( (_props) => /* @__PURE__ */ import_react33.default.createElement(StickerModal_default, { @@ -105841,11 +105860,6 @@ var TableView = (props) => { ); } }; - const toggleFlow = (path2) => { - setOpenFlows( - (f2) => f2.find((p) => p == path2) ? f2.filter((p) => p != path2) : uniq([...f2, path2]) - ); - }; const selectItem = (modifier, index3) => { if (modifier.metaKey) { props.superstate.ui.openPath( @@ -109781,7 +109795,7 @@ q: \`+this.q.toString():"")+\` \`),n.seealso&&n.seealso.length&&(a+="See also: "+n.seealso.join(", ")+\` \`),a},t.prototype.toJSON=function(){var n=ar(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});var yG="Chain",xG=["?on","math","typed"],pg=F(yG,xG,e=>{var{on:r,math:t,typed:n}=e;function a(o){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");bu(o)?this.value=o.value:this.value=o}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(o){return new a(o.value)};function i(o,u){typeof u=="function"&&(a.prototype[o]=l(u))}function s(o,u){Du(a.prototype,o,function(){var d=u();if(typeof d=="function")return l(d)})}function l(o){return function(){if(arguments.length===0)return new a(o(this.value));for(var u=[this.value],m=0;mo[y])};for(var d in o)m(d)}};var c={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return a.createProxy(t),r&&r("import",function(o,u,m){m||s(o,u)}),a},{isClass:!0});var DD={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"]};var OT={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]};var BT={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:[]};var PT={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:[]};var IT={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]};var RT={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]};var qT={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:[]};var kT={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:[]};var LT={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]};var zT={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]};var UT={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:[]};var SD={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"]};var WT={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:[]};var YT={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]};var HT={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"]};var $T={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]};var GT={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]};var VT={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","complex","fraction","index","matrix","string","unit"]};var ZT={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"]};var QT={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"]};var XT={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"]};var JT={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"]};var KT={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"]};var jT={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"]};var eF={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","boolean","complex","fraction","index","matrix","string","unit"]};var rF={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"]};var tF={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"]};var nF={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"]};var aF={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"]};var iF={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:[]};var oF={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:[]};var sF={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:[]};var uF={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"]};var fF={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"]};var cF={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"]};var lF={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"]};var mF={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"]};var pF={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"]};var dF={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"]};var hF={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"]};var vF={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"]};var gF={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"]};var yF={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"]};var xF={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"]};var bF={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"]};var wF={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"]};var DF={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"]};var SF={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"]};var NF={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"]};var AF={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]};var MF={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"]};var CF={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"]};var EF={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],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)"],seealso:["floor","fix","round"]};var TF={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"]};var FF={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"]};var _F={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"]};var OF={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"]};var BF={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"]};var PF={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"]};var IF={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"]};var RF={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"]};var qF={name:"fix",category:"Arithmetic",syntax:["fix(x)"],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)"],seealso:["ceil","floor","round"]};var kF={name:"floor",category:"Arithmetic",syntax:["floor(x)"],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)"],seealso:["ceil","fix","round"]};var LF={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"]};var zF={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]};var UF={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax \\u2263 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]};var WF={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"]};var YF={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"]};var HF={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"]};var $F={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"]};var GF={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"]};var VF={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"]};var ZF={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"]};var QF={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")']};var XF={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"]};var JF={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"]};var KF={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"]};var jF={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"]};var e_={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]};var r_={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"]};var t_={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"]};var n_={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"]};var a_={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"]};var i_={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"]};var o_={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"]};var s_={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"]};var u_={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"]};var f_={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]};var c_={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"]};var l_={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"]};var m_={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"]};var p_={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"]};var d_={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"]};var h_={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"]};var v_={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"]};var g_={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"]};var y_={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"]};var x_={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"]};var b_={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"]};var w_={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he 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"]};var D_={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"]};var S_={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"]};var N_={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"]};var A_={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"]};var M_={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:[]};var C_={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]};var E_={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:[]};var T_={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:[]};var F_={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"]};var __={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"]};var O_={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"]};var B_={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"]};var P_={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"]};var I_={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"]};var R_={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"]};var q_={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"]};var k_={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"]};var L_={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"]};var z_={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"]};var U_={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 indicant 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"]};var W_={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"]};var Y_={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"]};var H_={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"]};var $_={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"]};var G_={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"]};var V_={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"]};var Z_={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"]};var Q_={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"]};var X_={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore\\u2013Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]};var J_={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"]};var K_={name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]};var j_={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"]};var eO={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"]};var rO={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"]};var tO={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"]};var nO={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"]};var aO={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"]};var iO={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"]};var oO={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"]};var sO={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"]};var uO={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"]};var fO={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"]};var cO={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"]};var lO={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"]};var mO={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"]};var pO={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"]};var dO={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"]};var hO={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"]};var vO={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"]};var gO={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]};var yO={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]};var xO={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"]};var bO={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"]};var wO={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"]};var DO={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"]};var SO={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"]};var NO={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:[]};var AO={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"]};var MO={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"]};var CO={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"]};var EO={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"]};var TO={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"]};var FO={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"]};var _O={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"]};var OO={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"]};var BO={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"]};var PO={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"]};var IO={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"]};var RO={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.",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"]};var qO={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"]};var kO={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.",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"]};var LO={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"]};var zO={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"]};var UO={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"]};var WO={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"]};var YO={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"]};var HO={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"]};var $O={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"]};var GO={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"]};var VO={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"]};var ZO={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"]};var QO={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"]};var XO={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"]};var JO={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:[]};var KO={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:[]};var jO={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:[]};var e3={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]};var r3={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"]};var t3={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",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"]};var n3={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"]};var a3={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"]};var i3={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",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"]};var o3={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"]};var s3={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"]};var u3={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 probablity are: Number, BigNumber. -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"]};var f3={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"]};var c3={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"]};var l3={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","sum","variance"]};var m3={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"]};var p3={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"]};var d3={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"]};var h3={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"]};var v3={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"]};var g3={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent 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"]};var y3={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"]};var x3={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as \`acsch(x) = ln(1/x + sqrt(1/x^2 + 1))\`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]};var b3={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"]};var w3={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]};var D3={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"]};var S3={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"]};var N3={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"]};var A3={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"]};var M3={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"]};var C3={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"]};var E3={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]};var T3={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"]};var F3={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"]};var _3={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"]};var O3={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"]};var B3={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"]};var P3={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"]};var I3={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"]};var R3={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]};var q3={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"]};var k3={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"]};var L3={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:[]};var z3={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]};var U3={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:[]};var W3={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"]};var Y3={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"]};var H3={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]};var $3={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"]};var G3={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"]};var V3={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"]};var Z3={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"]};var Q3={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"]};var 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"]};var J3={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"]};var K3={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]};var j3={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]};var eB={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"]};var rB={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"]};var tB={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"]};var nB={bignumber:VT,boolean:ZT,complex:QT,createUnit:XT,fraction:JT,index:KT,matrix:jT,number:eF,sparse:rF,splitUnit:tF,string:nF,unit:aF,e:DD,E:DD,false:OT,i:BT,Infinity:PT,LN2:RT,LN10:IT,LOG2E:kT,LOG10E:qT,NaN:LT,null:zT,pi:SD,PI:SD,phi:UT,SQRT1_2:WT,SQRT2:YT,tau:HT,true:$T,version:GT,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",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh 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:"Borh 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:uF,lsolve:cF,lsolveAll:lF,lup:mF,lusolve:pF,leafCount:fF,polynomialRoot:dF,resolve:gF,simplify:yF,simplifyConstant:xF,simplifyCore:bF,symbolicEqual:DF,rationalize:vF,slu:wF,usolve:SF,usolveAll:NF,qr:hF,abs:AF,add:MF,cbrt:CF,ceil:EF,cube:TF,divide:FF,dotDivide:_F,dotMultiply:OF,dotPow:BF,exp:PF,expm:IF,expm1:RF,fix:qF,floor:kF,gcd:LF,hypot:zF,lcm:WF,log:YF,log2:GF,log1p:$F,log10:HF,mod:VF,multiply:ZF,norm:QF,nthRoot:XF,nthRoots:JF,pow:KF,round:jF,sign:e_,sqrt:r_,sqrtm:t_,square:o_,subtract:s_,unaryMinus:u_,unaryPlus:f_,xgcd:c_,invmod:UF,bitAnd:l_,bitNot:m_,bitOr:p_,bitXor:d_,leftShift:h_,rightArithShift:v_,rightLogShift:g_,bellNumbers:y_,catalan:x_,composition:b_,stirlingS2:w_,config:iF,import:oF,typed:sF,arg:D_,conj:S_,re:A_,im:N_,evaluate:M_,help:C_,distance:E_,intersect:T_,and:F_,not:__,or:O_,xor:B_,concat:I_,count:R_,cross:q_,column:P_,ctranspose:k_,det:L_,diag:z_,diff:U_,dot:W_,getMatrixDataType:V_,identity:Z_,filter:H_,flatten:$_,forEach:G_,inv:Q_,pinv:X_,eigs:Y_,kron:J_,matrixFromFunction:eO,matrixFromRows:rO,matrixFromColumns:j_,map:K_,ones:tO,partitionSelect:nO,range:aO,resize:oO,reshape:iO,rotate:sO,rotationMatrix:uO,row:fO,size:cO,sort:lO,squeeze:mO,subset:pO,trace:dO,transpose:hO,zeros:vO,fft:gO,ifft:yO,sylvester:n_,schur:a_,lyap:i_,solveODE:tB,combinations:xO,combinationsWithRep:bO,factorial:wO,gamma:DO,kldivergence:NO,lgamma:SO,multinomial:AO,permutations:MO,pickRandom:CO,random:EO,randomInt:TO,compare:FO,compareNatural:_O,compareText:OO,deepEqual:BO,equal:PO,equalText:IO,larger:RO,largerEq:qO,smaller:kO,smallerEq:LO,unequal:zO,setCartesian:UO,setDifference:WO,setDistinct:YO,setIntersect:HO,setIsSubset:$O,setMultiplicity:GO,setPowerset:VO,setSize:ZO,setSymDifference:QO,setUnion:XO,zpk2tf:JO,freqz:KO,erf:jO,zeta:e3,cumsum:c3,mad:r3,max:t3,mean:n3,median:a3,min:i3,mode:o3,prod:s3,quantileSeq:u3,std:f3,sum:l3,variance:m3,corr:p3,acos:d3,acosh:h3,acot:v3,acoth:g3,acsc:y3,acsch:x3,asec:b3,asech:w3,asin:D3,asinh:S3,atan:N3,atanh:M3,atan2:A3,cos:C3,cosh:E3,cot:T3,coth:F3,csc:_3,csch:O3,sec:B3,sech:P3,sin:I3,sinh:R3,tan:q3,tanh:k3,to:L3,clone:U3,format:W3,bin:z3,oct:j3,hex:H3,isNaN:G3,isInteger:$3,isNegative:V3,isNumeric:Z3,hasNumericValue:Y3,isPositive:Q3,isPrime:X3,isZero:J3,print:eB,typeOf:rB,numeric:K3};var aB="help",bG=["typed","mathWithTransform","Help"],dg=F(aB,bG,e=>{var{typed:r,mathWithTransform:t,Help:n}=e;return r(aB,{any:function(i){var s,l=i;if(typeof i!="string"){for(s in t)if(Xe(t,s)&&i===t[s]){l=s;break}}var c=wt(nB,l);if(!c){var o=typeof l=="function"?l.name:l;throw new Error('No documentation found on "'+o+'"')}return new n(c)}})});var iB="chain",wG=["typed","Chain"],hg=F(iB,wG,e=>{var{typed:r,Chain:t}=e;return r(iB,{"":function(){return new t},any:function(a){return new t(a)}})});var oB="det",DG=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],vg=F(oB,DG,e=>{var{typed:r,matrix:t,subtractScalar:n,multiply:a,divideScalar:i,isZero:s,unaryMinus:l}=e;return r(oB,{any:function(u){return ar(u)},"Array | Matrix":function(u){var m;switch(Qe(u)?m=u.size():Array.isArray(u)?(u=t(u),m=u.size()):m=[],m.length){case 0:return ar(u);case 1:if(m[0]===1)return ar(u.valueOf()[0]);if(m[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(m)+")");case 2:{var d=m[0],h=m[1];if(d===h)return c(u.clone().valueOf(),d,h);if(h===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(m)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(m)+")")}}});function c(o,u,m){if(u===1)return ar(o[0][0]);if(u===2)return n(a(o[0][0],o[1][1]),a(o[1][0],o[0][1]));for(var d=!1,h=new Array(u).fill(0).map((O,_)=>_),y=0;y{var{typed:r,matrix:t,divideScalar:n,addScalar:a,multiply:i,unaryMinus:s,det:l,identity:c,abs:o}=e;return r(sB,{"Array | Matrix":function(d){var h=Qe(d)?d.size():ur(d);switch(h.length){case 1:if(h[0]===1)return Qe(d)?t([n(1,d.valueOf()[0])]):[n(1,d[0])];throw new RangeError("Matrix must be square (size: "+lr(h)+")");case 2:{var y=h[0],v=h[1];if(y===v)return Qe(d)?t(u(d.valueOf(),y,v),d.storage()):u(d,y,v);throw new RangeError("Matrix must be square (size: "+lr(h)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(h)+")")}},any:function(d){return n(1,d)}});function u(m,d,h){var y,v,x,w,C;if(d===1){if(w=m[0][0],w===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,w)]]}else if(d===2){var b=l(m);if(b===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(m[1][1],b),n(s(m[0][1]),b)],[n(s(m[1][0]),b),n(m[0][0],b)]]}else{var N=m.concat();for(y=0;yO&&(O=o(N[y][S]),_=y),y++;if(O===0)throw Error("Cannot calculate inverse, determinant is zero");y=_,y!==S&&(C=N[S],N[S]=N[y],N[y]=C,C=M[S],M[S]=M[y],M[y]=C);var E=N[S],T=M[S];for(y=0;y{var{typed:r,matrix:t,inv:n,deepEqual:a,equal:i,dotDivide:s,dot:l,ctranspose:c,divideScalar:o,multiply:u,add:m,Complex:d}=e;return r(uB,{"Array | Matrix":function(b){var N=Qe(b)?b.size():ur(b);switch(N.length){case 1:return w(b)?c(b):N[0]===1?n(b):s(c(b),l(b,b));case 2:{if(w(b))return c(b);var M=N[0],S=N[1];if(M===S)try{return n(b)}catch(O){if(!(O instanceof Error&&O.message.match(/Cannot calculate inverse, determinant is zero/)))throw O}return Qe(b)?t(h(b.valueOf(),M,S),b.storage()):h(b,M,S)}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(N)+")")}},any:function(b){return i(b,0)?ar(b):o(1,b)}});function h(C,b,N){var{C:M,F:S}=v(C,b,N),O=u(n(u(c(M),M)),c(M)),_=u(c(S),n(u(S,c(S))));return u(_,O)}function y(C,b,N){for(var M=ar(C),S=0,O=0;O_.filter((T,R)=>R!x(l(M[E],M[E])));return{C:S,F:O}}function x(C){return i(m(C,d(1,1)),m(0,d(1,1)))}function w(C){return a(m(C,d(1,1)),m(u(C,0),d(1,1)))}});function fB(e){var{addScalar:r,subtract:t,flatten:n,multiply:a,multiplyScalar:i,divideScalar:s,sqrt:l,abs:c,bignumber:o,diag:u,size:m,reshape:d,inv:h,qr:y,usolve:v,usolveAll:x,equal:w,complex:C,larger:b,smaller:N,matrixFromColumns:M,dot:S}=e;function O(ae,$,me,Ee){var pe=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,ge=_(ae,$,me,Ee,pe);E(ae,$,me,Ee,pe,ge);var{values:Se,C:ye}=T(ae,$,me,Ee,pe);if(pe){var be=R(ae,$,ye,ge,Se,me,Ee);return{values:Se,eigenvectors:be}}return{values:Se}}function _(ae,$,me,Ee,pe){var ge=Ee==="BigNumber",Se=Ee==="Complex",ye=ge?o(0):0,be=ge?o(1):Se?C(1):1,De=ge?o(1):1,Ae=ge?o(10):2,We=i(Ae,Ae),Je;pe&&(Je=Array($).fill(be));for(var J=!1;!J;){J=!0;for(var re=0;re<$;re++){for(var xe=ye,j=ye,ne=0;ne<$;ne++)re!==ne&&(xe=r(xe,c(ae[ne][re])),j=r(j,c(ae[re][ne])));if(!w(xe,0)&&!w(j,0)){for(var ue=De,Me=xe,Ce=s(j,Ae),Le=i(j,Ae);N(Me,Ce);)Me=i(Me,We),ue=i(ue,Ae);for(;b(Me,Le);)Me=s(Me,We),ue=s(ue,Ae);var Ie=N(s(r(Me,j),ue),i(r(xe,j),.95));if(Ie){J=!1;for(var fr=s(1,ue),or=0;or<$;or++)re!==or&&(ae[re][or]=i(ae[re][or],fr),ae[or][re]=i(ae[or][re],ue));pe&&(Je[re]=i(Je[re],fr))}}}}return pe?u(Je):null}function E(ae,$,me,Ee,pe,ge){var Se=Ee==="BigNumber",ye=Ee==="Complex",be=Se?o(0):ye?C(0):0;Se&&(me=o(me));for(var De=0;De<$-2;De++){for(var Ae=0,We=be,Je=De+1;Je<$;Je++){var J=ae[Je][De];N(c(We),c(J))&&(We=J,Ae=Je)}if(!N(c(We),me)){if(Ae!==De+1){var re=ae[Ae];ae[Ae]=ae[De+1],ae[De+1]=re;for(var xe=0;xe<$;xe++){var j=ae[xe][Ae];ae[xe][Ae]=ae[xe][De+1],ae[xe][De+1]=j}if(pe){var ne=ge[Ae];ge[Ae]=ge[De+1],ge[De+1]=ne}}for(var ue=De+2;ue<$;ue++){var Me=s(ae[ue][De],We);if(Me!==0){for(var Ce=0;Ce<$;Ce++)ae[ue][Ce]=t(ae[ue][Ce],i(Me,ae[De+1][Ce]));for(var Le=0;Le<$;Le++)ae[Le][De+1]=r(ae[Le][De+1],i(Me,ae[Le][ue]));if(pe)for(var Ie=0;Ie<$;Ie++)ge[ue][Ie]=t(ge[ue][Ie],i(Me,ge[De+1][Ie]))}}}}return ge}function T(ae,$,me,Ee,pe){var ge=Ee==="BigNumber",Se=Ee==="Complex",ye=ge?o(1):Se?C(1):1;ge&&(me=o(me));for(var be=ar(ae),De=[],Ae=$,We=[],Je=pe?u(Array($).fill(ye)):void 0,J=pe?u(Array(Ae).fill(ye)):void 0,re=0;re<=100;){re+=1;for(var xe=be[Ae-1][Ae-1],j=0;j1&&(J=u(Array(Ae-1).fill(ye)))),Ae-=1,be.pop();for(var Ce=0;Ce2&&(J=u(Array(Ae-2).fill(ye)))),Ae-=2,be.pop(),be.pop();for(var Ie=0;Ie+t(c(Ke),c(Pr))),re>100){var fr=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+De.join(", "));throw fr.values=De,fr.vectors=[],fr}var or=pe?a(Je,W(We,$)):void 0;return{values:De,C:or}}function R(ae,$,me,Ee,pe,ge,Se){var ye=h(me),be=a(ye,ae,me),De=Se==="BigNumber",Ae=Se==="Complex",We=De?o(0):Ae?C(0):0,Je=De?o(1):Ae?C(1):1,J=[],re=[];for(var xe of pe){var j=k(J,xe,w);j===-1?(J.push(xe),re.push(1)):re[j]+=1}for(var ne=[],ue=J.length,Me=Array($).fill(We),Ce=u(Array($).fill(Je)),Le=function(){var or=J[Ie],Ke=t(be,a(or,Ce)),Pr=x(Ke,Me);for(Pr.shift();Pr.lengtha(ce,we)),ne.push(...Pr.map(we=>({value:or,vector:n(we)})))},Ie=0;Ie=5)return null;for(ye=0;;){var be=v(ae,Se);if(N(oe(z(Se,[be])),Ee))break;if(++ye>=10)return null;Se=le(be)}return Se}function K(ae,$,me){var Ee=me==="BigNumber",pe=me==="Complex",ge=Array(ae).fill(0).map(Se=>2*Math.random()-1);return Ee&&(ge=ge.map(Se=>o(Se))),pe&&(ge=ge.map(Se=>C(Se))),ge=z(ge,$),le(ge,me)}function z(ae,$){var me=m(ae);for(var Ee of $)Ee=d(Ee,me),ae=t(ae,a(s(S(Ee,ae),S(Ee,Ee)),Ee));return ae}function oe(ae){return c(l(S(ae,ae)))}function le(ae,$){var me=$==="BigNumber",Ee=$==="Complex",pe=me?o(1):Ee?C(1):1;return a(s(pe,oe(ae)),ae)}return O}function cB(e){var{config:r,addScalar:t,subtract:n,abs:a,atan:i,cos:s,sin:l,multiplyScalar:c,inv:o,bignumber:u,multiply:m,add:d}=e;function h(E,T){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.epsilon,L=arguments.length>3?arguments[3]:void 0,H=arguments.length>4?arguments[4]:void 0;if(L==="number")return y(E,R,H);if(L==="BigNumber")return v(E,R,H);throw TypeError("Unsupported data type: "+L)}function y(E,T,R){var L=E.length,H=Math.abs(T/L),V,W;if(R){W=new Array(L);for(var k=0;k=Math.abs(H);){var K=q[0][0],z=q[0][1];V=x(E[K][K],E[z][z],E[K][z]),E=M(E,V,K,z),R&&(W=C(W,V,K,z)),q=S(E)}for(var oe=Array(L).fill(0),le=0;le=a(H);){var K=q[0][0],z=q[0][1];V=w(E[K][K],E[z][z],E[K][z]),E=N(E,V,K,z),R&&(W=b(W,V,K,z)),q=O(E)}for(var oe=Array(L).fill(0),le=0;le({value:H[$],vector:ae}));return{values:H,eigenvectors:le}}return h}var AG="eigs",MG=["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"],xg=F(AG,MG,e=>{var{config:r,typed:t,matrix:n,addScalar:a,subtract:i,equal:s,abs:l,atan:c,cos:o,sin:u,multiplyScalar:m,divideScalar:d,inv:h,bignumber:y,multiply:v,add:x,larger:w,column:C,flatten:b,number:N,complex:M,sqrt:S,diag:O,size:_,reshape:E,qr:T,usolve:R,usolveAll:L,im:H,re:V,smaller:W,matrixFromColumns:k,dot:q}=e,K=cB({config:r,addScalar:a,subtract:i,column:C,flatten:b,equal:s,abs:l,atan:c,cos:o,sin:u,multiplyScalar:m,inv:h,bignumber:y,complex:M,multiply:v,add:x}),z=fB({config:r,addScalar:a,subtract:i,multiply:v,multiplyScalar:m,flatten:b,divideScalar:d,sqrt:S,abs:l,bignumber:y,diag:O,size:_,reshape:E,qr:T,inv:h,usolve:R,usolveAll:L,equal:s,complex:M,larger:w,smaller:W,matrixFromColumns:k,dot:q});return t("eigs",{Array:function(ge){return oe(n(ge))},"Array, number|BigNumber":function(ge,Se){return oe(n(ge),{precision:Se})},"Array, Object"(pe,ge){return oe(n(pe),ge)},Matrix:function(ge){return oe(ge,{matricize:!0})},"Matrix, number|BigNumber":function(ge,Se){return oe(ge,{precision:Se,matricize:!0})},"Matrix, Object":function(ge,Se){var ye={matricize:!0};return ht(ye,Se),oe(ge,ye)}});function oe(pe){var ge,Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ye="eigenvectors"in Se?Se.eigenvectors:!0,be=(ge=Se.precision)!==null&&ge!==void 0?ge:r.epsilon,De=le(pe,be,ye);return Se.matricize&&(De.values=n(De.values),ye&&(De.eigenvectors=De.eigenvectors.map(Ae=>{var{value:We,vector:Je}=Ae;return{value:We,vector:n(Je)}}))),ye&&Object.defineProperty(De,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),De}function le(pe,ge,Se){var ye=pe.toArray(),be=pe.size();if(be.length!==2||be[0]!==be[1])throw new RangeError("Matrix must be square (size: ".concat(lr(be),")"));var De=be[0];if($(ye,De,ge)&&(me(ye,De),ae(ye,De,ge))){var Ae=Ee(pe,ye,De);return K(ye,De,ge,Ae,Se)}var We=Ee(pe,ye,De);return z(ye,De,ge,We,Se)}function ae(pe,ge,Se){for(var ye=0;ye{var{typed:r,abs:t,add:n,identity:a,inv:i,multiply:s}=e;return r(lB,{Matrix:function(m){var d=m.size();if(d.length!==2||d[0]!==d[1])throw new RangeError("Matrix must be square (size: "+lr(d)+")");for(var h=d[0],y=1e-15,v=l(m),x=c(v,y),w=x.q,C=x.j,b=s(m,Math.pow(2,-C)),N=a(h),M=a(h),S=1,O=b,_=-1,E=1;E<=w;E++)E>1&&(O=s(O,b),_=-_),S=S*(w-E+1)/((2*w-E+1)*E),N=n(N,s(S,O)),M=n(M,s(S*_,O));for(var T=s(i(M),N),R=0;R{var{typed:r,abs:t,add:n,multiply:a,map:i,sqrt:s,subtract:l,inv:c,size:o,max:u,identity:m}=e,d=1e3,h=1e-6;function y(v){var x,w=0,C=v,b=m(o(v));do{var N=C;if(C=a(.5,n(N,c(b))),b=a(.5,n(b,c(N))),x=u(t(l(C,N))),x>h&&++w>d)throw new Error("computing square root of matrix: iterative method could not converge")}while(x>h);return C}return r(mB,{"Array | Matrix":function(x){var w=Qe(x)?x.size():ur(x);switch(w.length){case 1:if(w[0]===1)return i(x,s);throw new RangeError("Matrix must be square (size: "+lr(w)+")");case 2:{var C=w[0],b=w[1];if(C===b)return y(x);throw new RangeError("Matrix must be square (size: "+lr(w)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+lr(w)+")")}}})});var pB="sylvester",TG=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],Dg=F(pB,TG,e=>{var{typed:r,schur:t,matrixFromColumns:n,matrix:a,multiply:i,range:s,concat:l,transpose:c,index:o,subset:u,add:m,subtract:d,identity:h,lusolve:y,abs:v}=e;return r(pB,{"Matrix, Matrix, Matrix":x,"Array, Matrix, Matrix":function(C,b,N){return x(a(C),b,N)},"Array, Array, Matrix":function(C,b,N){return x(a(C),a(b),N)},"Array, Matrix, Array":function(C,b,N){return x(a(C),b,a(N))},"Matrix, Array, Matrix":function(C,b,N){return x(C,a(b),N)},"Matrix, Array, Array":function(C,b,N){return x(C,a(b),a(N))},"Matrix, Matrix, Array":function(C,b,N){return x(C,b,a(N))},"Array, Array, Array":function(C,b,N){return x(a(C),a(b),a(N)).toArray()}});function x(w,C,b){for(var N=C.size()[0],M=w.size()[0],S=t(w),O=S.T,_=S.U,E=t(i(-1,C)),T=E.T,R=E.U,L=i(i(c(_),b),R),H=s(0,M),V=[],W=(Ae,We)=>l(Ae,We,1),k=(Ae,We)=>l(Ae,We,0),q=0;q1e-5){for(var K=k(u(L,o(H,q)),u(L,o(H,q+1))),z=0;z{var{typed:r,matrix:t,identity:n,multiply:a,qr:i,norm:s,subtract:l}=e;return r(dB,{Array:function(u){var m=c(t(u));return{U:m.U.valueOf(),T:m.T.valueOf()}},Matrix:function(u){return c(u)}});function c(o){var u=o.size()[0],m=o,d=n(u),h=0,y;do{y=m;var v=i(m),x=v.Q,w=v.R;if(m=a(w,x),d=a(d,x),h++>100)break}while(s(l(m,y))>1e-4);return{U:d,T:m}}});var hB="lyap",_G=["typed","matrix","sylvester","multiply","transpose"],Ng=F(hB,_G,e=>{var{typed:r,matrix:t,sylvester:n,multiply:a,transpose:i}=e;return r(hB,{"Matrix, Matrix":function(l,c){return n(l,i(l),a(-1,c))},"Array, Matrix":function(l,c){return n(t(l),i(t(l)),a(-1,c))},"Matrix, Array":function(l,c){return n(l,i(t(l)),t(a(-1,c)))},"Array, Array":function(l,c){return n(t(l),i(t(l)),t(a(-1,c))).toArray()}})});var OG="divide",BG=["typed","matrix","multiply","equalScalar","divideScalar","inv"],Ag=F(OG,BG,e=>{var{typed:r,matrix:t,multiply:n,equalScalar:a,divideScalar:i,inv:s}=e,l=jr({typed:r,equalScalar:a}),c=kt({typed:r});return r("divide",wm({"Array | Matrix, Array | Matrix":function(u,m){return n(u,s(m))},"DenseMatrix, any":function(u,m){return c(u,m,i,!1)},"SparseMatrix, any":function(u,m){return l(u,m,i,!1)},"Array, any":function(u,m){return c(t(u),m,i,!1).valueOf()},"any, Array | Matrix":function(u,m){return n(u,s(m))}},i.signatures))});var vB="distance",PG=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],Mg=F(vB,PG,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:a,divideScalar:i,deepEqual:s,sqrt:l,abs:c}=e;return r(vB,{"Array, Array, Array":function(M,S,O){if(M.length===2&&S.length===2&&O.length===2){if(!u(M))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!u(S))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!u(O))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(s(S,O))throw new TypeError("LinePoint1 should not be same with LinePoint2");var _=n(O[1],S[1]),E=n(S[0],O[0]),T=n(a(O[0],S[1]),a(S[0],O[1]));return x(M[0],M[1],_,E,T)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(M,S,O){if(Object.keys(M).length===2&&Object.keys(S).length===2&&Object.keys(O).length===2){if(!u(M))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!u(S))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!u(O))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(s(y(S),y(O)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in M&&"pointY"in M&&"lineOnePtX"in S&&"lineOnePtY"in S&&"lineTwoPtX"in O&&"lineTwoPtY"in O){var _=n(O.lineTwoPtY,S.lineOnePtY),E=n(S.lineOnePtX,O.lineTwoPtX),T=n(a(O.lineTwoPtX,S.lineOnePtY),a(S.lineOnePtX,O.lineTwoPtY));return x(M.pointX,M.pointY,_,E,T)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(M,S){if(M.length===2&&S.length===3){if(!u(M))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!m(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return x(M[0],M[1],S[0],S[1],S[2])}else if(M.length===3&&S.length===6){if(!m(M))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!h(S))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return w(M[0],M[1],M[2],S[0],S[1],S[2],S[3],S[4],S[5])}else if(M.length===S.length&&M.length>0){if(!d(M))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!d(S))throw new TypeError("All values of an array should be numbers or BigNumbers");return C(M,S)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(M,S){if(Object.keys(M).length===2&&Object.keys(S).length===3){if(!u(M))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!m(S))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in M&&"pointY"in M&&"xCoeffLine"in S&&"yCoeffLine"in S&&"constant"in S)return x(M.pointX,M.pointY,S.xCoeffLine,S.yCoeffLine,S.constant);throw new TypeError("Key names do not match")}else if(Object.keys(M).length===3&&Object.keys(S).length===6){if(!m(M))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!h(S))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in M&&"pointY"in M&&"x0"in S&&"y0"in S&&"z0"in S&&"a"in S&&"b"in S&&"c"in S)return w(M.pointX,M.pointY,M.pointZ,S.x0,S.y0,S.z0,S.a,S.b,S.c);throw new TypeError("Key names do not match")}else if(Object.keys(M).length===2&&Object.keys(S).length===2){if(!u(M))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!u(S))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in M&&"pointOneY"in M&&"pointTwoX"in S&&"pointTwoY"in S)return C([M.pointOneX,M.pointOneY],[S.pointTwoX,S.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(M).length===3&&Object.keys(S).length===3){if(!m(M))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!m(S))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in M&&"pointOneY"in M&&"pointOneZ"in M&&"pointTwoX"in S&&"pointTwoY"in S&&"pointTwoZ"in S)return C([M.pointOneX,M.pointOneY,M.pointOneZ],[S.pointTwoX,S.pointTwoY,S.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(M){if(!v(M))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return b(M)}});function o(N){return typeof N=="number"||rr(N)}function u(N){return N.constructor!==Array&&(N=y(N)),o(N[0])&&o(N[1])}function m(N){return N.constructor!==Array&&(N=y(N)),o(N[0])&&o(N[1])&&o(N[2])}function d(N){return Array.isArray(N)||(N=y(N)),N.every(o)}function h(N){return N.constructor!==Array&&(N=y(N)),o(N[0])&&o(N[1])&&o(N[2])&&o(N[3])&&o(N[4])&&o(N[5])}function y(N){for(var M=Object.keys(N),S=[],O=0;OM.length!==2||!o(M[0])||!o(M[1])))return!1}else if(N[0].length===3&&o(N[0][0])&&o(N[0][1])&&o(N[0][2])){if(N.some(M=>M.length!==3||!o(M[0])||!o(M[1])||!o(M[2])))return!1}else return!1;return!0}function x(N,M,S,O,_){var E=c(t(t(a(S,N),a(O,M)),_)),T=l(t(a(S,S),a(O,O)));return i(E,T)}function w(N,M,S,O,_,E,T,R,L){var H=[n(a(n(_,M),L),a(n(E,S),R)),n(a(n(E,S),T),a(n(O,N),L)),n(a(n(O,N),R),a(n(_,M),T))];H=l(t(t(a(H[0],H[0]),a(H[1],H[1])),a(H[2],H[2])));var V=l(t(t(a(T,T),a(R,R)),a(L,L)));return i(H,V)}function C(N,M){for(var S=N.length,O=0,_=0,E=0;E{var{typed:r,config:t,abs:n,add:a,addScalar:i,matrix:s,multiply:l,multiplyScalar:c,divideScalar:o,subtract:u,smaller:m,equalScalar:d,flatten:h,isZero:y,isNumeric:v}=e;return r("intersect",{"Array, Array, Array":x,"Array, Array, Array, Array":w,"Matrix, Matrix, Matrix":function(R,L,H){var V=x(R.valueOf(),L.valueOf(),H.valueOf());return V===null?null:s(V)},"Matrix, Matrix, Matrix, Matrix":function(R,L,H,V){var W=w(R.valueOf(),L.valueOf(),H.valueOf(),V.valueOf());return W===null?null:s(W)}});function x(T,R,L){if(T=C(T),R=C(R),L=C(L),!N(T))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!N(R))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!M(L))throw new TypeError("Array with 4 numbers expected as third argument");return E(T[0],T[1],T[2],R[0],R[1],R[2],L[0],L[1],L[2],L[3])}function w(T,R,L,H){if(T=C(T),R=C(R),L=C(L),H=C(H),T.length===2){if(!b(T))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!b(R))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!b(L))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!b(H))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return S(T,R,L,H)}else if(T.length===3){if(!N(T))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!N(R))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!N(L))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!N(H))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return _(T[0],T[1],T[2],R[0],R[1],R[2],L[0],L[1],L[2],H[0],H[1],H[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function C(T){return T.length===1?T[0]:T.length>1&&Array.isArray(T[0])&&T.every(R=>Array.isArray(R)&&R.length===1)?h(T):T}function b(T){return T.length===2&&v(T[0])&&v(T[1])}function N(T){return T.length===3&&v(T[0])&&v(T[1])&&v(T[2])}function M(T){return T.length===4&&v(T[0])&&v(T[1])&&v(T[2])&&v(T[3])}function S(T,R,L,H){var V=T,W=L,k=u(V,R),q=u(W,H),K=u(c(k[0],q[1]),c(q[0],k[1]));if(y(K)||m(n(K),t.epsilon))return null;var z=c(q[0],V[1]),oe=c(q[1],V[0]),le=c(q[0],W[1]),ae=c(q[1],W[0]),$=o(i(u(u(z,oe),le),ae),K);return a(l(k,$),V)}function O(T,R,L,H,V,W,k,q,K,z,oe,le){var ae=c(u(T,R),u(L,H)),$=c(u(V,W),u(k,q)),me=c(u(K,z),u(oe,le));return i(i(ae,$),me)}function _(T,R,L,H,V,W,k,q,K,z,oe,le){var ae=O(T,k,z,k,R,q,oe,q,L,K,le,K),$=O(z,k,H,T,oe,q,V,R,le,K,W,L),me=O(T,k,H,T,R,q,V,R,L,K,W,L),Ee=O(z,k,z,k,oe,q,oe,q,le,K,le,K),pe=O(H,T,H,T,V,R,V,R,W,L,W,L),ge=u(c(ae,$),c(me,Ee)),Se=u(c(pe,Ee),c($,$));if(y(Se))return null;var ye=o(ge,Se),be=o(i(ae,c(ye,$)),Ee),De=i(T,c(ye,u(H,T))),Ae=i(R,c(ye,u(V,R))),We=i(L,c(ye,u(W,L))),Je=i(k,c(be,u(z,k))),J=i(q,c(be,u(oe,q))),re=i(K,c(be,u(le,K)));return d(De,Je)&&d(Ae,J)&&d(We,re)?[De,Ae,We]:null}function E(T,R,L,H,V,W,k,q,K,z){var oe=c(T,k),le=c(H,k),ae=c(R,q),$=c(V,q),me=c(L,K),Ee=c(W,K),pe=u(u(u(z,oe),ae),me),ge=u(u(u(i(i(le,$),Ee),oe),ae),me),Se=o(pe,ge),ye=i(T,c(Se,u(H,T))),be=i(R,c(Se,u(V,R))),De=i(L,c(Se,u(W,L)));return[ye,be,De]}});var gB="sum",qG=["typed","config","add","numeric"],nf=F(gB,qG,e=>{var{typed:r,config:t,add:n,numeric:a}=e;return r(gB,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":s,"...":function(c){if(Pa(c))throw new TypeError("Scalar values expected in function sum");return i(c)}});function i(l){var c;return An(l,function(o){try{c=c===void 0?o:n(c,o)}catch(u){throw Et(u,"sum",o)}}),c===void 0&&(c=a(0,t.number)),typeof c=="string"&&(c=a(c,t.number)),c}function s(l,c){try{var o=ko(l,c,n);return o}catch(u){throw Et(u,"sum")}}});var Eg="cumsum",kG=["typed","add","unaryPlus"],af=F(Eg,kG,e=>{var{typed:r,add:t,unaryPlus:n}=e;return r(Eg,{Array:a,Matrix:function(o){return o.create(a(o.valueOf()))},"Array, number | BigNumber":s,"Matrix, number | BigNumber":function(o,u){return o.create(s(o.valueOf(),u))},"...":function(o){if(Pa(o))throw new TypeError("All values expected to be scalar in function cumsum");return a(o)}});function a(c){try{return i(c)}catch(o){throw Et(o,Eg)}}function i(c){if(c.length===0)return[];for(var o=[n(c[0])],u=1;u=u.length)throw new tn(o,u.length);try{return l(c,o)}catch(m){throw Et(m,Eg)}}function l(c,o){var u,m,d;if(o<=0){var h=c[0][0];if(Array.isArray(h)){for(d=Jm(c),m=[],u=0;u{var{typed:r,add:t,divide:n}=e;return r(yB,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":a,"...":function(l){if(Pa(l))throw new TypeError("Scalar values expected in function mean");return i(l)}});function a(s,l){try{var c=ko(s,l,t),o=Array.isArray(s)?ur(s):s.size();return n(c,o[l])}catch(u){throw Et(u,"mean")}}function i(s){var l,c=0;if(An(s,function(o){try{l=l===void 0?o:t(l,o),c++}catch(u){throw Et(u,"mean",o)}}),c===0)throw new Error("Cannot calculate the mean of an empty array");return n(l,c)}});var xB="median",zG=["typed","add","divide","compare","partitionSelect"],Tg=F(xB,zG,e=>{var{typed:r,add:t,divide:n,compare:a,partitionSelect:i}=e;function s(o){try{o=gr(o.valueOf());var u=o.length;if(u===0)throw new Error("Cannot calculate median of an empty array");if(u%2===0){for(var m=u/2-1,d=i(o,m+1),h=o[m],y=0;y0&&(h=o[y]);return c(h,d)}else{var v=i(o,(u-1)/2);return l(v)}}catch(x){throw Et(x,"median")}}var l=r({"number | BigNumber | Complex | Unit":function(u){return u}}),c=r({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(u,m){return n(t(u,m),2)}});return r(xB,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(u,m){throw new Error("median(A, dim) is not yet supported")},"...":function(u){if(Pa(u))throw new TypeError("Scalar values expected in function median");return s(u)}})});var bB="mad",UG=["typed","abs","map","median","subtract"],Fg=F(bB,UG,e=>{var{typed:r,abs:t,map:n,median:a,subtract:i}=e;return r(bB,{"Array | Matrix":s,"...":function(c){return s(c)}});function s(l){if(l=gr(l.valueOf()),l.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var c=a(l);return a(n(l,function(o){return t(i(o,c))}))}catch(o){throw o instanceof TypeError&&o.message.indexOf("median")!==-1?new TypeError(o.message.replace("median","mad")):Et(o,"mad")}}});var ND="unbiased",wB="variance",WG=["typed","add","subtract","multiply","divide","apply","isNaN"],sf=F(wB,WG,e=>{var{typed:r,add:t,subtract:n,multiply:a,divide:i,apply:s,isNaN:l}=e;return r(wB,{"Array | Matrix":function(m){return c(m,ND)},"Array | Matrix, string":c,"Array | Matrix, number | BigNumber":function(m,d){return o(m,d,ND)},"Array | Matrix, number | BigNumber, string":o,"...":function(m){return c(m,ND)}});function c(u,m){var d,h=0;if(u.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(An(u,function(x){try{d=d===void 0?x:t(d,x),h++}catch(w){throw Et(w,"variance",x)}}),h===0)throw new Error("Cannot calculate variance of an empty array");var y=i(d,h);if(d=void 0,An(u,function(x){var w=n(x,y);d=d===void 0?a(w,w):t(d,a(w,w))}),l(d))return d;switch(m){case"uncorrected":return i(d,h);case"biased":return i(d,h+1);case"unbiased":{var v=rr(d)?d.mul(0):0;return h===1?v:i(d,h-1)}default:throw new Error('Unknown normalization "'+m+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function o(u,m,d){try{if(u.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return s(u,m,h=>c(h,d))}catch(h){throw Et(h,"variance")}}});var DB="quantileSeq",YG=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],uf=F(DB,YG,e=>{var{typed:r,bignumber:t,add:n,subtract:a,divide:i,multiply:s,partitionSelect:l,compare:c,isInteger:o,smaller:u,smallerEq:m,larger:d}=e,h=Lo({typed:r,isInteger:o});return r(DB,{"Array | Matrix, number | BigNumber":(C,b)=>v(C,b,!1),"Array | Matrix, number | BigNumber, number":(C,b,N)=>y(C,b,!1,N,v),"Array | Matrix, number | BigNumber, boolean":v,"Array | Matrix, number | BigNumber, boolean, number":(C,b,N,M)=>y(C,b,N,M,v),"Array | Matrix, Array | Matrix":(C,b)=>x(C,b,!1),"Array | Matrix, Array | Matrix, number":(C,b,N)=>y(C,b,!1,N,x),"Array | Matrix, Array | Matrix, boolean":x,"Array | Matrix, Array | Matrix, boolean, number":(C,b,N,M)=>y(C,b,N,M,x)});function y(C,b,N,M,S){return h(C,M,O=>S(O,b,N))}function v(C,b,N){var M,S=C.valueOf();if(u(b,0))throw new Error("N/prob must be non-negative");if(m(b,1))return sr(b)?w(S,b,N):t(w(S,b,N));if(d(b,1)){if(!o(b))throw new Error("N must be a positive integer");if(d(b,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 O=n(b,1);M=[];for(var _=0;u(_,b);_++){var E=i(_+1,O);M.push(w(S,E,N))}return sr(b)?M:t(M)}}function x(C,b,N){for(var M=C.valueOf(),S=b.valueOf(),O=[],_=0;_0&&(T=M[L])}return n(s(T,a(1,E)),s(R,E))}});var SB="std",HG=["typed","map","sqrt","variance"],ff=F(SB,HG,e=>{var{typed:r,map:t,sqrt:n,variance:a}=e;return r(SB,{"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(s,l){if(s.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var c=a.apply(null,arguments);return Nt(c)?t(c,n):n(c)}catch(o){throw o instanceof TypeError&&o.message.indexOf(" variance")!==-1?new TypeError(o.message.replace(" variance"," std")):o}}});var NB="corr",$G=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],_g=F(NB,$G,e=>{var{typed:r,matrix:t,sqrt:n,sum:a,add:i,subtract:s,multiply:l,pow:c,divide:o}=e;return r(NB,{"Array, Array":function(h,y){return u(h,y)},"Matrix, Matrix":function(h,y){var v=u(h.toArray(),y.toArray());return Array.isArray(v)?t(v):v}});function u(d,h){var y=[];if(Array.isArray(d[0])&&Array.isArray(h[0])){if(d.length!==h.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var v=0;vi(S,l(O,h[_])),0),C=a(d.map(S=>c(S,2))),b=a(h.map(S=>c(S,2))),N=s(l(y,w),l(v,x)),M=n(l(s(l(y,C),c(v,2)),s(l(y,b),c(x,2))));return o(N,M)}});var AB="combinations",GG=["typed"],Og=F(AB,GG,e=>{var{typed:r}=e;return r(AB,{"number, number":qw,"BigNumber, BigNumber":function(n,a){var i=n.constructor,s,l,c=n.minus(a),o=new i(1);if(!MB(n)||!MB(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(s=o,a.lt(c))for(l=o;l.lte(c);l=l.plus(o))s=s.times(a.plus(l)).dividedBy(l);else for(l=o;l.lte(a);l=l.plus(o))s=s.times(c.plus(l)).dividedBy(l);return s}})});function MB(e){return e.isInteger()&&e.gte(0)}var CB="combinationsWithRep",VG=["typed"],Bg=F(CB,VG,e=>{var{typed:r}=e;return r(CB,{"number, number":function(n,a){if(!Ze(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Ze(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{var{typed:r,config:t,multiplyScalar:n,pow:a,BigNumber:i,Complex:s}=e;function l(o){if(o.im===0)return Fc(o.re);if(o.re<.5){var u=new s(1-o.re,-o.im),m=new s(Math.PI*o.re,Math.PI*o.im);return new s(Math.PI).div(m.sin()).div(l(u))}o=new s(o.re-1,o.im);for(var d=new s(Fs[0],0),h=1;h2;)d-=2,y+=d,h=h.times(y);return new i(h.toPrecision(i.precision))}});var FB="lgamma",QG=["Complex","typed"],Ig=F(FB,QG,e=>{var{Complex:r,typed:t}=e,n=7,a=7,i=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return t(FB,{number:_c,Complex:s,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function s(o){var u=6.283185307179586,m=1.1447298858494002,d=.1;if(o.isNaN())return new r(NaN,NaN);if(o.im===0)return new r(_c(o.re),0);if(o.re>=n||Math.abs(o.im)>=a)return l(o);if(o.re<=d){var h=sM(u,o.im)*Math.floor(.5*o.re+.25),y=o.mul(Math.PI).sin().log(),v=s(new r(1-o.re,-o.im));return new r(m,h).sub(y).sub(v)}else return o.im>=0?c(o):c(o.conjugate()).conjugate()}function l(o){for(var u=o.sub(.5).mul(o.log()).sub(o).add(Hw),m=new r(1,0).div(o),d=m.div(o),h=i[0],y=i[1],v=2*d.re,x=d.re*d.re+d.im*d.im,w=2;w<8;w++){var C=y;y=-x*h+i[w],h=v*h+C}var b=m.mul(d.mul(h).add(y));return u.add(b)}function c(o){var u=0,m=0,d=o;for(o=o.add(1);o.re<=n;){d=d.mul(o);var h=d.im<0?1:0;h!==0&&m===0&&u++,m=h,o=o.add(1)}return l(o).sub(d.log()).sub(new r(0,u*2*Math.PI*1))}});var _B="factorial",XG=["typed","gamma"],Rg=F(_B,XG,e=>{var{typed:r,gamma:t}=e;return r(_B,{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":r.referToSelf(n=>a=>je(a,n))})});var OB="kldivergence",JG=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],qg=F(OB,JG,e=>{var{typed:r,matrix:t,divide:n,sum:a,multiply:i,map:s,dotDivide:l,log:c,isNumeric:o}=e;return r(OB,{"Array, Array":function(d,h){return u(t(d),t(h))},"Matrix, Array":function(d,h){return u(d,t(h))},"Array, Matrix":function(d,h){return u(t(d),h)},"Matrix, Matrix":function(d,h){return u(d,h)}});function u(m,d){var h=d.size().length,y=m.size().length;if(h>1)throw new Error("first object must be one dimensional");if(y>1)throw new Error("second object must be one dimensional");if(h!==y)throw new Error("Length of two vectors must be equal");var v=a(m);if(v===0)throw new Error("Sum of elements in first object must be non zero");var x=a(d);if(x===0)throw new Error("Sum of elements in second object must be non zero");var w=n(m,a(m)),C=n(d,a(d)),b=a(i(w,s(l(w,C),N=>c(N))));return o(b)?b:Number.NaN}});var BB="multinomial",KG=["typed","add","divide","multiply","factorial","isInteger","isPositive"],kg=F(BB,KG,e=>{var{typed:r,add:t,divide:n,multiply:a,factorial:i,isInteger:s,isPositive:l}=e;return r(BB,{"Array | Matrix":function(o){var u=0,m=1;return An(o,function(d){if(!s(d)||!l(d))throw new TypeError("Positive integer value expected in function multinomial");u=t(u,d),m=a(m,i(d))}),n(i(u),m)}})});var PB="permutations",jG=["typed","factorial"],Lg=F(PB,jG,e=>{var{typed:r,factorial:t}=e;return r(PB,{"number | BigNumber":t,"number, number":function(a,i){if(!Ze(a)||a<0)throw new TypeError("Positive integer value expected in function permutations");if(!Ze(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 va(a-i+1,a)},"BigNumber, BigNumber":function(a,i){var s,l;if(!IB(a)||!IB(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 c=a.mul(0).add(1);for(s=c,l=a.minus(i).plus(1);l.lte(a);l=l.plus(1))s=s.times(l);return s}})});function IB(e){return e.isInteger()&&e.gte(0)}var _D=ma(KB(),1),oV=(0,_D.default)(Date.now());function no(e){var r;function t(a){r=a===null?oV:(0,_D.default)(String(a))}t(e);function n(){return r()}return n}var jB="pickRandom",sV=["typed","config","?on"],Ug=F(jB,sV,e=>{var{typed:r,config:t,on:n}=e,a=no(t.randomSeed);return n&&n("config",function(s,l){s.randomSeed!==l.randomSeed&&(a=no(s.randomSeed))}),r(jB,{"Array | Matrix":function(l){return i(l,{})},"Array | Matrix, Object":function(l,c){return i(l,c)},"Array | Matrix, number":function(l,c){return i(l,{number:c})},"Array | Matrix, Array | Matrix":function(l,c){return i(l,{weights:c})},"Array | Matrix, Array | Matrix, number":function(l,c,o){return i(l,{number:o,weights:c})},"Array | Matrix, number, Array | Matrix":function(l,c,o){return i(l,{number:c,weights:o})}});function i(s,l){var{number:c,weights:o,elementWise:u=!0}=l,m=typeof c>"u";m&&(c=1);var d=Qe(s)?s.create:Qe(o)?o.create:null;s=s.valueOf(),o&&(o=o.valueOf()),u===!0&&(s=gr(s),o=gr(o));var h=0;if(typeof o<"u"){if(o.length!==s.length)throw new Error("Weights must have the same length as possibles");for(var y=0,v=o.length;y"u")C=s[Math.floor(a()*x)];else for(var b=a()*h,N=0,M=s.length;N1)for(var n=0,a=e.shift();n{var{typed:r,config:t,on:n}=e,a=no(t.randomSeed);return n&&n("config",function(l,c){l.randomSeed!==c.randomSeed&&(a=no(l.randomSeed))}),r(eP,{"":()=>s(0,1),number:l=>s(0,l),"number, number":(l,c)=>s(l,c),"Array | Matrix":l=>i(l,0,1),"Array | Matrix, number":(l,c)=>i(l,0,c),"Array | Matrix, number, number":(l,c,o)=>i(l,c,o)});function i(l,c,o){var u=Rc(l.valueOf(),()=>s(c,o));return Qe(l)?l.create(u):u}function s(l,c){return l+a()*(c-l)}});var rP="randomInt",fV=["typed","config","?on"],Yg=F(rP,fV,e=>{var{typed:r,config:t,on:n}=e,a=no(t.randomSeed);return n&&n("config",function(l,c){l.randomSeed!==c.randomSeed&&(a=no(l.randomSeed))}),r(rP,{"":()=>s(0,1),number:l=>s(0,l),"number, number":(l,c)=>s(l,c),"Array | Matrix":l=>i(l,0,1),"Array | Matrix, number":(l,c)=>i(l,0,c),"Array | Matrix, number, number":(l,c,o)=>i(l,c,o)});function i(l,c,o){var u=Rc(l.valueOf(),()=>s(c,o));return Qe(l)?l.create(u):u}function s(l,c){return Math.floor(l+a()*(c-l))}});var tP="stirlingS2",cV=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],Hg=F(tP,cV,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:a,divideScalar:i,pow:s,factorial:l,combinations:c,isNegative:o,isInteger:u,number:m,bignumber:d,larger:h}=e,y=[],v=[];return r(tP,{"number | BigNumber, number | BigNumber":function(w,C){if(!u(w)||o(w)||!u(C)||o(C))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(h(C,w))throw new TypeError("k must be less than or equal to n in function stirlingS2");var b=!(sr(w)&&sr(C)),N=b?v:y,M=b?d:m,S=m(w),O=m(C);if(N[S]&&N[S].length>O)return N[S][O];for(var _=0;_<=S;++_)if(N[_]||(N[_]=[M(_===0?1:0)]),_!==0)for(var E=N[_],T=N[_-1],R=E.length;R<=_&&R<=O;++R)R===_?E[R]=1:E[R]=t(a(M(R),T[R]),T[R-1]);return N[S][O]}})});var nP="bellNumbers",lV=["typed","addScalar","isNegative","isInteger","stirlingS2"],$g=F(nP,lV,e=>{var{typed:r,addScalar:t,isNegative:n,isInteger:a,stirlingS2:i}=e;return r(nP,{"number | BigNumber":function(l){if(!a(l)||n(l))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var c=0,o=0;o<=l;o++)c=t(c,i(l,o));return c}})});var aP="catalan",mV=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],Gg=F(aP,mV,e=>{var{typed:r,addScalar:t,divideScalar:n,multiplyScalar:a,combinations:i,isNegative:s,isInteger:l}=e;return r(aP,{"number | BigNumber":function(o){if(!l(o)||s(o))throw new TypeError("Non-negative integer value expected in function catalan");return n(i(a(o,2),o),t(o,1))}})});var iP="composition",pV=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],Vg=F(iP,pV,e=>{var{typed:r,addScalar:t,combinations:n,isPositive:a,isNegative:i,isInteger:s,larger:l}=e;return r(iP,{"number | BigNumber, number | BigNumber":function(o,u){if(!s(o)||!a(o)||!s(u)||!a(u))throw new TypeError("Positive integer value expected in function composition");if(l(u,o))throw new TypeError("k must be less than or equal to n in function composition");return n(t(o,-1),t(u,-1))}})});var oP="leafCount",dV=["parse","typed"],Zg=F(oP,dV,e=>{var{parse:r,typed:t}=e;function n(a){var i=0;return a.forEach(s=>{i+=n(s)}),i||1}return t(oP,{Node:function(i){return n(i)}})});function OD(e){return xr(e)||ct(e)&&e.isUnary()&&xr(e.args[0])}function qc(e){return!!(xr(e)||(yn(e)||ct(e))&&e.args.every(qc)||en(e)&&qc(e.content))}function sP(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function BD(e){for(var r=1;r{var{FunctionNode:r,OperatorNode:t,SymbolNode:n}=e,a=!0,i=!1,s="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}},c={divide:{total:i},log:{total:i}},o={subtract:{total:i},abs:{trivial:a},log:{total:a}};function u(b,N){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l,S=s;if(typeof b=="string"?S=b:ct(b)?S=b.fn.toString():yn(b)?S=b.name:en(b)&&(S="paren"),Xe(M,S)){var O=M[S];if(Xe(O,N))return O[N];if(Xe(l,S))return l[S][N]}if(Xe(M,s)){var _=M[s];return Xe(_,N)?_[N]:l[s][N]}if(Xe(l,S)){var E=l[S];if(Xe(E,N))return E[N]}return l[s][N]}function m(b){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return u(b,"commutative",N)}function d(b){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return u(b,"associative",N)}function h(b,N){var M=BD({},b);for(var S in N)Xe(b,S)?M[S]=BD(BD({},N[S]),b[S]):M[S]=N[S];return M}function y(b,N){if(!b.args||b.args.length===0)return b;b.args=v(b,N);for(var M=0;M2&&d(b,N)){for(var _=b.args.pop();b.args.length>0;)_=M([b.args.pop(),_]);b.args=_.args}}}function w(b,N){if(!(!b.args||b.args.length===0)){for(var M=C(b),S=b.args.length,O=0;O2&&d(b,N)){for(var _=b.args.shift();b.args.length>0;)_=M([_,b.args.shift()]);b.args=_.args}}}function C(b){return ct(b)?function(N){try{return new t(b.op,b.fn,N,b.implicit)}catch(M){return console.error(M),[]}}:function(N){return new r(new n(b.name),N)}}return{createMakeNodeFunction:C,hasProperty:u,isCommutative:m,isAssociative:d,mergeContext:h,flatten:y,allChildren:v,unflattenr:x,unflattenl:w,defaultContext:l,realContext:c,positiveContext:o}});var gV="simplify",yV=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],Qg=F(gV,yV,e=>{var{config:r,typed:t,parse:n,add:a,subtract:i,multiply:s,divide:l,pow:c,isZero:o,equal:u,resolve:m,simplifyConstant:d,simplifyCore:h,fraction:y,bignumber:v,mathWithTransform:x,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:N,FunctionNode:M,IndexNode:S,ObjectNode:O,OperatorNode:_,ParenthesisNode:E,SymbolNode:T}=e,{hasProperty:R,isCommutative:L,isAssociative:H,mergeContext:V,flatten:W,unflattenr:k,unflattenl:q,createMakeNodeFunction:K,defaultContext:z,realContext:oe,positiveContext:le}=cf({FunctionNode:M,OperatorNode:_,SymbolNode:T});t.addConversion({from:"Object",to:"Map",convert:ji});var ae=t("simplify",{Node:ye,"Node, Map":(j,ne)=>ye(j,!1,ne),"Node, Map, Object":(j,ne,ue)=>ye(j,!1,ne,ue),"Node, Array":ye,"Node, Array, Map":ye,"Node, Array, Map, Object":ye});t.removeConversion({from:"Object",to:"Map",convert:ji}),ae.defaultContext=z,ae.realContext=oe,ae.positiveContext=le;function $(j){return j.transform(function(ne,ue,Me){return en(ne)?$(ne.content):ne})}var me={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};ae.rules=[h,{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}}},d,{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}}},d,{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 Ee(j,ne){var ue={};if(j.s){var Me=j.s.split("->");if(Me.length===2)ue.l=Me[0],ue.r=Me[1];else throw SyntaxError("Could not parse rule: "+j.s)}else ue.l=j.l,ue.r=j.r;ue.l=$(n(ue.l)),ue.r=$(n(ue.r));for(var Ce of["imposeContext","repeat","assuming"])Ce in j&&(ue[Ce]=j[Ce]);if(j.evaluate&&(ue.evaluate=n(j.evaluate)),H(ue.l,ne)){var Le=!L(ue.l,ne),Ie;Le&&(Ie=Se());var fr=K(ue.l),or=Se();ue.expanded={},ue.expanded.l=fr([ue.l,or]),W(ue.expanded.l,ne),k(ue.expanded.l,ne),ue.expanded.r=fr([ue.r,or]),Le&&(ue.expandedNC1={},ue.expandedNC1.l=fr([Ie,ue.l]),ue.expandedNC1.r=fr([Ie,ue.r]),ue.expandedNC2={},ue.expandedNC2.l=fr([Ie,ue.expanded.l]),ue.expandedNC2.r=fr([Ie,ue.expanded.r]))}return ue}function pe(j,ne){for(var ue=[],Me=0;Me2&&arguments[2]!==void 0?arguments[2]:Bo(),Me=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Ce=Me.consoleDebug;ne=pe(ne||ae.rules,Me.context);var Le=m(j,ue);Le=$(Le);for(var Ie={},fr=Le.toString({parenthesis:"all"});!Ie[fr];){Ie[fr]=!0,ge=0;var or=fr;Ce&&console.log("Working on: ",fr);for(var Ke=0;Ke ").concat(ne[Ke].r.toString()))),Ce){var ee=Le.toString({parenthesis:"all"});ee!==or&&(console.log("Applying",Pr,"produced",ee),or=ee)}q(Le,Me.context)}fr=Le.toString({parenthesis:"all"})}return Le}function be(j,ne,ue){var Me=j;if(j)for(var Ce=0;Ce1&&(or=Le(j.args.slice(0,fr))),Ce=j.args.slice(fr),Me=Ce.length===1?Ce[0]:Le(Ce),ue.push(Le([or,Me]))}return ue}function We(j,ne){var ue={placeholders:{}};if(!j.placeholders&&!ne.placeholders)return ue;if(j.placeholders){if(!ne.placeholders)return j}else return ne;for(var Me in j.placeholders)if(Xe(j.placeholders,Me)&&(ue.placeholders[Me]=j.placeholders[Me],Xe(ne.placeholders,Me)&&!xe(j.placeholders[Me],ne.placeholders[Me])))return null;for(var Ce in ne.placeholders)Xe(ne.placeholders,Ce)&&(ue.placeholders[Ce]=ne.placeholders[Ce]);return ue}function Je(j,ne){var ue=[];if(j.length===0||ne.length===0)return ue;for(var Me,Ce=0;Ce2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var or=re(j.args[0],ne.args[1],ue);if(or.length===0)return[];var Ke=re(j.args[1],ne.args[0],ue);if(Ke.length===0)return[];Le=[or,Ke]}Ce=J(Le)}else if(ne.args.length>=2&&j.args.length===2){for(var Pr=Ae(ne,ue),ee=[],ce=0;ce2)throw Error("Unexpected non-binary associative function: "+j.toString());return[]}}else if(j instanceof T){if(j.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(me[j.name]){if(j.name!==ne.name)return[]}else switch(j.name[1]>="a"&&j.name[1]<="z"?j.name.substring(0,2):j.name[0]){case"n":case"_p":Ce[0].placeholders[j.name]=ne;break;case"c":case"cl":if(xr(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"v":if(!xr(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"vl":if(at(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"cd":if(OD(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"vd":if(!OD(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"ce":if(qc(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"ve":if(!qc(ne))Ce[0].placeholders[j.name]=ne;else return[];break;default:throw new Error("Invalid symbol in rule: "+j.name)}}else if(j instanceof N){if(!u(j.value,ne.value))return[]}else return[];return Ce}function xe(j,ne){if(j instanceof N&&ne instanceof N){if(!u(j.value,ne.value))return!1}else if(j instanceof T&&ne instanceof T){if(j.name!==ne.name)return!1}else if(j instanceof _&&ne instanceof _||j instanceof M&&ne instanceof M){if(j instanceof _){if(j.op!==ne.op||j.fn!==ne.fn)return!1}else if(j instanceof M&&j.name!==ne.name)return!1;if(j.args.length!==ne.args.length)return!1;for(var ue=0;ue{var{typed:r,config:t,mathWithTransform:n,matrix:a,fraction:i,bignumber:s,AccessorNode:l,ArrayNode:c,ConstantNode:o,FunctionNode:u,IndexNode:m,ObjectNode:d,OperatorNode:h,SymbolNode:y}=e,{isCommutative:v,isAssociative:x,allChildren:w,createMakeNodeFunction:C}=cf({FunctionNode:u,OperatorNode:h,SymbolNode:y}),b=r("simplifyConstant",{Node:W=>O(V(W,{})),"Node, Object":function(k,q){return O(V(k,q))}});function N(W){return da(W)?W.valueOf():W instanceof Array?W.map(N):Qe(W)?a(N(W.valueOf())):W}function M(W,k,q){try{return n[W].apply(null,k)}catch{return k=k.map(N),E(n[W].apply(null,k),q)}}var S=r({Fraction:R,number:function(k){return k<0?T(new o(-k)):new o(k)},BigNumber:function(k){return k<0?T(new o(-k)):new o(k)},Complex:function(k){throw new Error("Cannot convert Complex number to Node")},string:function(k){return new o(k)},Matrix:function(k){return new c(k.valueOf().map(q=>S(q)))}});function O(W){return Nr(W)?W:S(W)}function _(W,k){var q=k&&k.exactFractions!==!1;if(q&&isFinite(W)&&i){var K=i(W),z=k&&typeof k.fractionsLimit=="number"?k.fractionsLimit:1/0;if(K.valueOf()===W&&K.n0;)if(xr(K[0])&&typeof K[0].value!="string"){var z=E(K.shift().value,q);jt(W)?W=W.items[z-1]:(W=W.valueOf()[z-1],W instanceof Array&&(W=a(W)))}else if(K.length>1&&xr(K[1])&&typeof K[1].value!="string"){var oe=E(K[1].value,q),le=[],ae=jt(W)?W.items:W.valueOf();for(var $ of ae)if(jt($))le.push($.items[oe-1]);else if(Qe(W))le.push($[oe-1]);else break;if(le.length===ae.length)jt(W)?W=new c(le):W=a(le),K.splice(1,1);else break}else break;return K.length===k.dimensions.length?new l(O(W),k):K.length>0?(k=new m(K),new l(O(W),k)):W}if(Ei(W)&&k.dimensions.length===1&&xr(k.dimensions[0])){var me=k.dimensions[0].value;return me in W.properties?W.properties[me]:new o}return new l(O(W),k)}function H(W,k,q,K){var z=k.shift(),oe=k.reduce((le,ae)=>{if(!Nr(ae)){var $=le.pop();if(Nr($))return[$,ae];try{return le.push(M(W,[$,ae],K)),le}catch{le.push($)}}le.push(O(le.pop()));var me=le.length===1?le[0]:q(le);return[q([me,O(ae)])]},[z]);return oe.length===1?oe[0]:q([oe[0],S(oe[1])])}function V(W,k){switch(W.type){case"SymbolNode":return W;case"ConstantNode":switch(typeof W.value){case"number":return E(W.value,k);case"string":return W.value;default:if(!isNaN(W.value))return E(W.value,k)}return W;case"FunctionNode":if(n[W.name]&&n[W.name].rawArgs)return W;{var q=["add","multiply"];if(q.indexOf(W.name)===-1){var K=W.args.map(De=>V(De,k));if(!K.some(Nr))try{return M(W.name,K,k)}catch{}if(W.name==="size"&&K.length===1&&jt(K[0])){for(var z=[],oe=K[0];jt(oe);)z.push(oe.items.length),oe=oe.items[0];return a(z)}return new u(W.name,K.map(O))}}case"OperatorNode":{var le=W.fn.toString(),ae,$,me=C(W);if(ct(W)&&W.isUnary())ae=[V(W.args[0],k)],Nr(ae[0])?$=me(ae):$=M(le,ae,k);else if(x(W,k.context))if(ae=w(W,k.context),ae=ae.map(De=>V(De,k)),v(le,k.context)){for(var Ee=[],pe=[],ge=0;ge1?($=H(le,Ee,me,k),pe.unshift($),$=H(le,pe,me,k)):$=H(le,ae,me,k)}else $=H(le,ae,me,k);else ae=W.args.map(De=>V(De,k)),$=H(le,ae,me,k);return $}case"ParenthesisNode":return V(W.content,k);case"AccessorNode":return L(V(W.object,k),V(W.index,k),k);case"ArrayNode":{var Se=W.items.map(De=>V(De,k));return Se.some(Nr)?new c(Se.map(O)):a(Se)}case"IndexNode":return new m(W.dimensions.map(De=>b(De,k)));case"ObjectNode":{var ye={};for(var be in W.properties)ye[be]=b(W.properties[be],k);return new d(ye)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(W.type))}}return b});var uP="simplifyCore",wV=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],Jg=F(uP,wV,e=>{var{typed:r,parse:t,equal:n,isZero:a,add:i,subtract:s,multiply:l,divide:c,pow:o,AccessorNode:u,ArrayNode:m,ConstantNode:d,FunctionNode:h,IndexNode:y,ObjectNode:v,OperatorNode:x,ParenthesisNode:w,SymbolNode:C}=e,b=new d(0),N=new d(1),M=new d(!0),S=new d(!1);function O(R){return ct(R)&&["and","not","or"].includes(R.op)}var{hasProperty:_,isCommutative:E}=cf({FunctionNode:h,OperatorNode:x,SymbolNode:C});function T(R){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},H=L?L.context:void 0;if(_(R,"trivial",H)){if(yn(R)&&R.args.length===1)return T(R.args[0],L);var V=!1,W=0;if(R.forEach(pe=>{++W,W===1&&(V=T(pe,L))}),W===1)return V}var k=R;if(yn(k)){var q=iT(k.name);if(q){if(k.args.length>2&&_(k,"associative",H))for(;k.args.length>2;){var K=k.args.pop(),z=k.args.pop();k.args.push(new x(q,k.name,[K,z]))}k=new x(q,k.name,k.args)}else return new h(T(k.fn),k.args.map(pe=>T(pe,L)))}if(ct(k)&&k.isUnary()){var oe=T(k.args[0],L);if(k.op==="~"&&ct(oe)&&oe.isUnary()&&oe.op==="~"||k.op==="not"&&ct(oe)&&oe.isUnary()&&oe.op==="not"&&O(oe.args[0]))return oe.args[0];var le=!0;if(k.op==="-"&&ct(oe)&&(oe.isBinary()&&oe.fn==="subtract"&&(k=new x("-","subtract",[oe.args[1],oe.args[0]]),le=!1),oe.isUnary()&&oe.op==="-"))return oe.args[0];if(le)return new x(k.op,k.fn,[oe])}if(ct(k)&&k.isBinary()){var ae=T(k.args[0],L),$=T(k.args[1],L);if(k.op==="+"){if(xr(ae)&&a(ae.value))return $;if(xr($)&&a($.value))return ae;ct($)&&$.isUnary()&&$.op==="-"&&($=$.args[0],k=new x("-","subtract",[ae,$]))}if(k.op==="-")return ct($)&&$.isUnary()&&$.op==="-"?T(new x("+","add",[ae,$.args[0]]),L):xr(ae)&&a(ae.value)?T(new x("-","unaryMinus",[$])):xr($)&&a($.value)?ae:new x(k.op,k.fn,[ae,$]);if(k.op==="*"){if(xr(ae)){if(a(ae.value))return b;if(n(ae.value,1))return $}if(xr($)){if(a($.value))return b;if(n($.value,1))return ae;if(E(k,H))return new x(k.op,k.fn,[$,ae],k.implicit)}return new x(k.op,k.fn,[ae,$],k.implicit)}if(k.op==="/")return xr(ae)&&a(ae.value)?b:xr($)&&n($.value,1)?ae:new x(k.op,k.fn,[ae,$]);if(k.op==="^"&&xr($)){if(a($.value))return N;if(n($.value,1))return ae}if(k.op==="and"){if(xr(ae))if(ae.value){if(O($))return $;if(xr($))return $.value?M:S}else return S;if(xr($))if($.value){if(O(ae))return ae}else return S}if(k.op==="or"){if(xr(ae)){if(ae.value)return M;if(O($))return $}if(xr($)){if($.value)return M;if(O(ae))return ae}}return new x(k.op,k.fn,[ae,$])}if(ct(k))return new x(k.op,k.fn,k.args.map(pe=>T(pe,L)));if(jt(k))return new m(k.items.map(pe=>T(pe,L)));if(Ln(k))return new u(T(k.object,L),T(k.index,L));if(Jn(k))return new y(k.dimensions.map(pe=>T(pe,L)));if(Ei(k)){var me={};for(var Ee in k.properties)me[Ee]=T(k.properties[Ee],L);return new v(me)}return k}return r(uP,{Node:T,"Node,Object":T})});var DV="resolve",SV=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],Kg=F(DV,SV,e=>{var{typed:r,parse:t,ConstantNode:n,FunctionNode:a,OperatorNode:i,ParenthesisNode:s}=e;function l(c,o){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!o)return c;if(at(c)){if(u.has(c.name)){var m=Array.from(u).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(m,"}"))}var d=o.get(c.name);if(Nr(d)){var h=new Set(u);return h.add(c.name),l(d,o,h)}else return typeof d=="number"?t(String(d)):d!==void 0?new n(d):c}else if(ct(c)){var y=c.args.map(function(x){return l(x,o,u)});return new i(c.op,c.fn,y,c.implicit)}else{if(en(c))return new s(l(c.content,o,u));if(yn(c)){var v=c.args.map(function(x){return l(x,o,u)});return new a(c.name,v)}}return c.map(x=>l(x,o,u))}return r("resolve",{Node:l,"Node, Map | null | undefined":l,"Node, Object":(c,o)=>l(c,ji(o)),"Array | Matrix":r.referToSelf(c=>o=>o.map(u=>c(u))),"Array | Matrix, null | undefined":r.referToSelf(c=>o=>o.map(u=>c(u))),"Array, Object":r.referTo("Array,Map",c=>(o,u)=>c(o,ji(u))),"Matrix, Object":r.referTo("Matrix,Map",c=>(o,u)=>c(o,ji(u))),"Array | Matrix, Map":r.referToSelf(c=>(o,u)=>o.map(m=>c(m,u)))})});var fP="symbolicEqual",NV=["parse","simplify","typed","OperatorNode"],jg=F(fP,NV,e=>{var{parse:r,simplify:t,typed:n,OperatorNode:a}=e;function i(s,l){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=new a("-","subtract",[s,l]),u=t(o,{},c);return xr(u)&&!u.value}return n(fP,{"Node, Node":i,"Node, Node, Object":i})});var cP="derivative",AV=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],e0=F(cP,AV,e=>{var{typed:r,config:t,parse:n,simplify:a,equal:i,isZero:s,numeric:l,ConstantNode:c,FunctionNode:o,OperatorNode:u,ParenthesisNode:m,SymbolNode:d}=e;function h(b,N){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},S={};x(S,b,N.name);var O=w(b,S);return M.simplify?a(O):O}r.addConversion({from:"identifier",to:"SymbolNode",convert:n});var y=r(cP,{"Node, SymbolNode":h,"Node, SymbolNode, Object":h});r.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),y._simplify=!0,y.toTex=function(b){return v.apply(null,b.args)};var v=r("_derivTex",{"Node, SymbolNode":function(N,M){return xr(N)&&Tr(N.value)==="string"?v(n(N.value).toString(),M.toString(),1):v(N.toTex(),M.toString(),1)},"Node, ConstantNode":function(N,M){if(Tr(M.value)==="string")return v(N,n(M.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(N,M,S){return v(N.toString(),M.name,S.value)},"string, string, number":function(N,M,S){var O;return S===1?O="{d\\\\over d"+M+"}":O="{d^{"+S+"}\\\\over d"+M+"^{"+S+"}}",O+"\\\\left[".concat(N,"\\\\right]")}}),x=r("constTag",{"Object, ConstantNode, string":function(N,M){return N[M]=!0,!0},"Object, SymbolNode, string":function(N,M,S){return M.name!==S?(N[M]=!0,!0):!1},"Object, ParenthesisNode, string":function(N,M,S){return x(N,M.content,S)},"Object, FunctionAssignmentNode, string":function(N,M,S){return M.params.indexOf(S)===-1?(N[M]=!0,!0):x(N,M.expr,S)},"Object, FunctionNode | OperatorNode, string":function(N,M,S){if(M.args.length>0){for(var O=x(N,M.args[0],S),_=1;_0){var O=N.args.filter(function(W){return M[W]===void 0}),_=O.length===1?O[0]:new u("*","multiply",O),E=S.concat(w(_,M));return new u("*","multiply",E)}return new u("+","add",N.args.map(function(W){return new u("*","multiply",N.args.map(function(k){return k===W?w(k,M):k.clone()}))}))}if(N.op==="/"&&N.isBinary()){var T=N.args[0],R=N.args[1];return M[R]!==void 0?new u("/","divide",[w(T,M),R]):M[T]!==void 0?new u("*","multiply",[new u("-","unaryMinus",[T]),new u("/","divide",[w(R,M),new u("^","pow",[R.clone(),C(2)])])]):new u("/","divide",[new u("-","subtract",[new u("*","multiply",[w(T,M),R.clone()]),new u("*","multiply",[T.clone(),w(R,M)])]),new u("^","pow",[R.clone(),C(2)])])}if(N.op==="^"&&N.isBinary()){var L=N.args[0],H=N.args[1];if(M[L]!==void 0)return xr(L)&&(s(L.value)||i(L.value,1))?C(0):new u("*","multiply",[N,new u("*","multiply",[new o("log",[L.clone()]),w(H.clone(),M)])]);if(M[H]!==void 0){if(xr(H)){if(s(H.value))return C(0);if(i(H.value,1))return w(L,M)}var V=new u("^","pow",[L.clone(),new u("-","subtract",[H,C(1)])]);return new u("*","multiply",[H.clone(),new u("*","multiply",[w(L,M),V])])}return new u("*","multiply",[new u("^","pow",[L.clone(),H.clone()]),new u("+","add",[new u("*","multiply",[w(L,M),new u("/","divide",[H.clone(),L.clone()])]),new u("*","multiply",[w(H,M),new o("log",[L.clone()])])])])}throw new Error('Cannot process operator "'+N.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function C(b,N){return new c(l(b,N||t.number))}return y});var lP="rationalize",MV=["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"],r0=F(lP,MV,e=>{var{config:r,typed:t,equal:n,isZero:a,add:i,subtract:s,multiply:l,divide:c,pow:o,parse:u,simplifyConstant:m,simplifyCore:d,simplify:h,fraction:y,bignumber:v,mathWithTransform:x,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:N,FunctionNode:M,IndexNode:S,ObjectNode:O,OperatorNode:_,SymbolNode:E,ParenthesisNode:T}=e;function R(k){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,z=H(),oe=L(k,q,!0,z.firstRules),le=oe.variables.length,ae={exactFractions:!1},$={exactFractions:!0};if(k=oe.expression,le>=1){k=V(k);var me,Ee,pe=!0,ge=!1;k=h(k,z.firstRules,{},ae);for(var Se;Ee=pe?z.distrDivRules:z.sucDivRules,k=h(k,Ee,{},$),pe=!pe,Se=k.toString(),Se!==me;)ge=!0,me=Se;ge&&(k=h(k,z.firstRulesAgain,{},ae)),k=h(k,z.finalRules,{},ae)}var ye=[],be={};return k.type==="OperatorNode"&&k.isBinary()&&k.op==="/"?(le===1&&(k.args[0]=W(k.args[0],ye),k.args[1]=W(k.args[1])),K&&(be.numerator=k.args[0],be.denominator=k.args[1])):(le===1&&(k=W(k,ye)),K&&(be.numerator=k,be.denominator=null)),K?(be.coefficients=ye,be.variables=oe.variables,be.expression=k,be):k}return t(lP,{Node:R,"Node, boolean":(k,q)=>R(k,{},q),"Node, Object":R,"Node, Object, boolean":R});function L(k,q,K,z){var oe=[],le=h(k,z,q,{exactFractions:!1});K=!!K;var ae="+-*"+(K?"/":"");me(le);var $={};return $.expression=le,$.variables=oe,$;function me(Ee){var pe=Ee.type;if(pe==="FunctionNode")throw new Error("There is an unsolved function call");if(pe==="OperatorNode")if(Ee.op==="^"){if(Ee.args[1].type!=="ConstantNode"||!Ze(parseFloat(Ee.args[1].value)))throw new Error("There is a non-integer exponent");me(Ee.args[0])}else{if(ae.indexOf(Ee.op)===-1)throw new Error("Operator "+Ee.op+" invalid in polynomial expression");for(var ge=0;ge1;if(z==="OperatorNode"&&k.isBinary()){var le=!1,ae;if(k.op==="^"&&(k.args[0].type==="ParenthesisNode"||k.args[0].type==="OperatorNode")&&k.args[1].type==="ConstantNode"&&(ae=parseFloat(k.args[1].value),le=ae>=2&&Ze(ae)),le){if(ae>2){var $=k.args[0],me=new _("^","pow",[k.args[0].cloneDeep(),new N(ae-1)]);k=new _("*","multiply",[$,me])}else k=new _("*","multiply",[k.args[0],k.args[0].cloneDeep()]);oe&&(K==="content"?q.content=k:q.args[K]=k)}}if(z==="ParenthesisNode")V(k.content,k,"content");else if(z!=="ConstantNode"&&z!=="SymbolNode")for(var Ee=0;Ee=0;$--)if(q[$]!==0){var me=new N(le?q[$]:Math.abs(q[$])),Ee=q[$]<0?"-":"+";if($>0){var pe=new E(oe);if($>1){var ge=new N($);pe=new _("^","pow",[pe,ge])}q[$]===-1&&le?me=new _("-","unaryMinus",[pe]):Math.abs(q[$])===1?me=pe:me=new _("*","multiply",[me,pe])}le?ae=me:Ee==="+"?ae=new _("+","add",[ae,me]):ae=new _("-","subtract",[ae,me]),le=!1}if(le)return new N(0);return ae;function Se(ye,be,De){var Ae=ye.type;if(Ae==="FunctionNode")throw new Error("There is an unsolved function call");if(Ae==="OperatorNode"){if("+-*^".indexOf(ye.op)===-1)throw new Error("Operator "+ye.op+" invalid");if(be!==null){if((ye.fn==="unaryMinus"||ye.fn==="pow")&&be.fn!=="add"&&be.fn!=="subtract"&&be.fn!=="multiply")throw new Error("Invalid "+ye.op+" placing");if((ye.fn==="subtract"||ye.fn==="add"||ye.fn==="multiply")&&be.fn!=="add"&&be.fn!=="subtract")throw new Error("Invalid "+ye.op+" placing");if((ye.fn==="subtract"||ye.fn==="add"||ye.fn==="unaryMinus")&&De.noFil!==0)throw new Error("Invalid "+ye.op+" placing")}(ye.op==="^"||ye.op==="*")&&(De.fire=ye.op);for(var We=0;Wez&&(q[Je]=0),q[Je]+=De.cte*(De.oper==="+"?1:-1),z=Math.max(Je,z);return}De.cte=Je,De.fire===""&&(q[0]+=De.cte*(De.oper==="+"?1:-1))}else throw new Error("Type "+Ae+" is not allowed")}}});var mP="zpk2tf",CV=["typed","add","multiply","Complex","number"],t0=F(mP,CV,e=>{var{typed:r,add:t,multiply:n,Complex:a,number:i}=e;return r(mP,{"Array,Array,number":function(o,u,m){return s(o,u,m)},"Array,Array":function(o,u){return s(o,u,1)},"Matrix,Matrix,number":function(o,u,m){return s(o.valueOf(),u.valueOf(),m)},"Matrix,Matrix":function(o,u){return s(o.valueOf(),u.valueOf(),1)}});function s(c,o,u){c.some(C=>C.type==="BigNumber")&&(c=c.map(C=>i(C))),o.some(C=>C.type==="BigNumber")&&(o=o.map(C=>i(C)));for(var m=[a(1,0)],d=[a(1,0)],h=0;h=0&&m-d{var{typed:r,add:t,multiply:n,Complex:a,divide:i,matrix:s}=e;return r(pP,{"Array, Array":function(u,m){var d=c(512);return l(u,m,d)},"Array, Array, Array":function(u,m,d){return l(u,m,d)},"Array, Array, number":function(u,m,d){if(d<0)throw new Error("w must be a positive number");var h=c(d);return l(u,m,h)},"Matrix, Matrix":function(u,m){var d=c(512),{w:h,h:y}=l(u.valueOf(),m.valueOf(),d);return{w:s(h),h:s(y)}},"Matrix, Matrix, Matrix":function(u,m,d){var{h}=l(u.valueOf(),m.valueOf(),d.valueOf());return{h:s(h),w:s(d)}},"Matrix, Matrix, number":function(u,m,d){if(d<0)throw new Error("w must be a positive number");var h=c(d),{h:y}=l(u.valueOf(),m.valueOf(),h);return{h:s(y),w:s(h)}}});function l(o,u,m){for(var d=[],h=[],y=0;y{var{classes:r}=e;return function(n,a){var i=r[a&&a.mathjs];return i&&typeof i.fromJSON=="function"?i.fromJSON(a):a}});var _V="replacer",OV=[],i0=F(_V,OV,()=>function(r,t){return typeof t=="number"&&(!isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:t});var dP="12.4.1";var o0=F("true",[],()=>!0),s0=F("false",[],()=>!1),u0=F("null",[],()=>null),f0=ya("Infinity",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1/0):1/0}),c0=ya("NaN",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(NaN):NaN}),l0=ya("pi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?Pc(t):ZM}),m0=ya("tau",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?vE(t):QM}),p0=ya("e",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?dE(t):XM}),d0=ya("phi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?hE(t):JM}),h0=ya("LN2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).ln():Math.LN2}),v0=ya("LN10",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(10).ln():Math.LN10}),g0=ya("LOG2E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(2).ln()):Math.LOG2E}),y0=ya("LOG10E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(10).ln()):Math.LOG10E}),x0=ya("SQRT1_2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t("0.5").sqrt():Math.SQRT1_2}),b0=ya("SQRT2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).sqrt():Math.SQRT2}),w0=ya("i",["Complex"],e=>{var{Complex:r}=e;return r.I}),hP=F("PI",["pi"],e=>{var{pi:r}=e;return r}),vP=F("E",["e"],e=>{var{e:r}=e;return r}),D0=F("version",[],()=>dP);function ya(e,r,t){return F(e,r,t,{recreateOnConfigChange:!0})}var S0=Er("speedOfLight","299792458","m s^-1"),N0=Er("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),A0=Er("planckConstant","6.62607015e-34","J s"),M0=Er("reducedPlanckConstant","1.0545718176461565e-34","J s"),C0=Er("magneticConstant","1.25663706212e-6","N A^-2"),E0=Er("electricConstant","8.8541878128e-12","F m^-1"),T0=Er("vacuumImpedance","376.730313667","ohm"),F0=Er("coulomb","8.987551792261171e9","N m^2 C^-2"),_0=Er("elementaryCharge","1.602176634e-19","C"),O0=Er("bohrMagneton","9.2740100783e-24","J T^-1"),B0=Er("conductanceQuantum","7.748091729863649e-5","S"),P0=Er("inverseConductanceQuantum","12906.403729652257","ohm"),I0=Er("magneticFluxQuantum","2.0678338484619295e-15","Wb"),R0=Er("nuclearMagneton","5.0507837461e-27","J T^-1"),q0=Er("klitzing","25812.807459304513","ohm");var k0=Er("bohrRadius","5.29177210903e-11","m"),L0=Er("classicalElectronRadius","2.8179403262e-15","m"),z0=Er("electronMass","9.1093837015e-31","kg"),U0=Er("fermiCoupling","1.1663787e-5","GeV^-2"),W0=xy("fineStructure",.0072973525693),Y0=Er("hartreeEnergy","4.3597447222071e-18","J"),H0=Er("protonMass","1.67262192369e-27","kg"),$0=Er("deuteronMass","3.3435830926e-27","kg"),G0=Er("neutronMass","1.6749271613e-27","kg"),V0=Er("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),Z0=Er("rydberg","10973731.568160","m^-1"),Q0=Er("thomsonCrossSection","6.6524587321e-29","m^2"),X0=xy("weakMixingAngle",.2229),J0=xy("efimovFactor",22.7),K0=Er("atomicMass","1.66053906660e-27","kg"),j0=Er("avogadro","6.02214076e23","mol^-1"),ey=Er("boltzmann","1.380649e-23","J K^-1"),ry=Er("faraday","96485.33212331001","C mol^-1"),ty=Er("firstRadiation","3.7417718521927573e-16","W m^2"),ny=Er("loschmidt","2.686780111798444e25","m^-3"),ay=Er("gasConstant","8.31446261815324","J K^-1 mol^-1"),iy=Er("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),oy=Er("molarVolume","0.022413969545014137","m^3 mol^-1"),sy=xy("sackurTetrode",-1.16487052358),uy=Er("secondRadiation","0.014387768775039337","m K"),fy=Er("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),cy=Er("wienDisplacement","2.897771955e-3","m K"),ly=Er("molarMass","0.99999999965e-3","kg mol^-1"),my=Er("molarMassC12","11.9999999958e-3","kg mol^-1"),py=Er("gravity","9.80665","m s^-2"),dy=Er("planckLength","1.616255e-35","m"),hy=Er("planckMass","2.176435e-8","kg"),vy=Er("planckTime","5.391245e-44","s"),gy=Er("planckCharge","1.87554603778e-18","C"),yy=Er("planckTemperature","1.416785e+32","K");function Er(e,r,t){var n=["config","Unit","BigNumber"];return F(e,n,a=>{var{config:i,Unit:s,BigNumber:l}=a,c=i.number==="BigNumber"?new l(r):parseFloat(r),o=new s(c,t);return o.fixPrefix=!0,o})}function xy(e,r){var t=["config","BigNumber"];return F(e,t,n=>{var{config:a,BigNumber:i}=n;return a.number==="BigNumber"?new i(r):r})}var BV="apply",PV=["typed","isInteger"],by=F(BV,PV,e=>{var{typed:r,isInteger:t}=e,n=Lo({typed:r,isInteger:t});return r("apply",{"...any":function(i){var s=i[1];sr(s)?i[1]=s-1:rr(s)&&(i[1]=s.minus(1));try{return n.apply(null,i)}catch(l){throw mt(l)}}})},{isTransformFunction:!0});var IV="column",RV=["typed","Index","matrix","range"],wy=F(IV,RV,e=>{var{typed:r,Index:t,matrix:n,range:a}=e,i=Wu({typed:r,Index:t,matrix:n,range:a});return r("column",{"...any":function(l){var c=l.length-1,o=l[c];sr(o)&&(l[c]=o-1);try{return i.apply(null,l)}catch(u){throw mt(u)}}})},{isTransformFunction:!0});function lf(e,r,t){var n=e.filter(function(c){return at(c)&&!(c.name in r)&&!t.has(c.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var a=n.name,i=new Map,s=new Eu(t,i,new Set([a])),l=e.compile();return function(o){return i.set(a,o),l.evaluate(s)}}var qV="filter",kV=["typed"],Dy=F(qV,kV,e=>{var{typed:r}=e;function t(a,i,s){var l,c;return a[0]&&(l=a[0].compile().evaluate(s)),a[1]&&(at(a[1])||Oa(a[1])?c=a[1].compile().evaluate(s):c=lf(a[1],i,s)),n(l,c)}t.rawArgs=!0;var n=r("filter",{"Array, function":gP,"Matrix, function":function(i,s){return i.create(gP(i.toArray(),s))},"Array, RegExp":Mu,"Matrix, RegExp":function(i,s){return i.create(Mu(i.toArray(),s))}});return t},{isTransformFunction:!0});function gP(e,r){return _m(e,function(t,n,a){return Ra(r,t,[n+1],a,"filter")})}var LV="forEach",zV=["typed"],Sy=F(LV,zV,e=>{var{typed:r}=e;function t(a,i,s){var l,c;return a[0]&&(l=a[0].compile().evaluate(s)),a[1]&&(at(a[1])||Oa(a[1])?c=a[1].compile().evaluate(s):c=lf(a[1],i,s)),n(l,c)}t.rawArgs=!0;var n=r("forEach",{"Array | Matrix, function":function(i,s){var l=function c(o,u){if(Array.isArray(o))_o(o,function(m,d){c(m,u.concat(d+1))});else return Ra(s,o,u,i,"forEach")};l(i.valueOf(),[])}});return t},{isTransformFunction:!0});var UV="index",WV=["Index","getMatrixDataType"],Ny=F(UV,WV,e=>{var{Index:r,getMatrixDataType:t}=e;return function(){for(var a=[],i=0,s=arguments.length;i0?0:2;else if(l&&l.isSet===!0)l=l.map(function(o){return o-1});else if(Mr(l)||Qe(l))t(l)!=="boolean"&&(l=l.map(function(o){return o-1}));else if(sr(l))l--;else if(rr(l))l=l.toNumber()-1;else if(typeof l!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");a[i]=l}var c=new r;return r.apply(c,a),c}},{isTransformFunction:!0});var YV="map",HV=["typed"],Ay=F(YV,HV,e=>{var{typed:r}=e;function t(a,i,s){var l,c;return a[0]&&(l=a[0].compile().evaluate(s)),a[1]&&(at(a[1])||Oa(a[1])?c=a[1].compile().evaluate(s):c=lf(a[1],i,s)),n(l,c)}t.rawArgs=!0;var n=r("map",{"Array, function":function(i,s){return yP(i,s,i)},"Matrix, function":function(i,s){return i.create(yP(i.valueOf(),s,i))}});return t},{isTransformFunction:!0});function yP(e,r,t){function n(a,i){return Array.isArray(a)?Kn(a,function(s,l){return n(s,i.concat(l+1))}):Ra(r,a,i,t,"map")}return n(e,[])}function Cn(e){if(e.length===2&&Nt(e[0])){e=e.slice();var r=e[1];sr(r)?e[1]=r-1:rr(r)&&(e[1]=r.minus(1))}return e}var $V="max",GV=["typed","config","numeric","larger"],My=F($V,GV,e=>{var{typed:r,config:t,numeric:n,larger:a}=e,i=ef({typed:r,config:t,numeric:n,larger:a});return r("max",{"...any":function(l){l=Cn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var VV="mean",ZV=["typed","add","divide"],Cy=F(VV,ZV,e=>{var{typed:r,add:t,divide:n}=e,a=of({typed:r,add:t,divide:n});return r("mean",{"...any":function(s){s=Cn(s);try{return a.apply(null,s)}catch(l){throw mt(l)}}})},{isTransformFunction:!0});var QV="min",XV=["typed","config","numeric","smaller"],Ey=F(QV,XV,e=>{var{typed:r,config:t,numeric:n,smaller:a}=e,i=rf({typed:r,config:t,numeric:n,smaller:a});return r("min",{"...any":function(l){l=Cn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var JV="range",KV=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Ty=F(JV,KV,e=>{var{typed:r,config:t,matrix:n,bignumber:a,smaller:i,smallerEq:s,larger:l,largerEq:c,add:o,isPositive:u}=e,m=$u({typed:r,config:t,matrix:n,bignumber:a,smaller:i,smallerEq:s,larger:l,largerEq:c,add:o,isPositive:u});return r("range",{"...any":function(h){var y=h.length-1,v=h[y];return typeof v!="boolean"&&h.push(!0),m.apply(null,h)}})},{isTransformFunction:!0});var jV="row",eZ=["typed","Index","matrix","range"],Fy=F(jV,eZ,e=>{var{typed:r,Index:t,matrix:n,range:a}=e,i=Gu({typed:r,Index:t,matrix:n,range:a});return r("row",{"...any":function(l){var c=l.length-1,o=l[c];sr(o)&&(l[c]=o-1);try{return i.apply(null,l)}catch(u){throw mt(u)}}})},{isTransformFunction:!0});var rZ="subset",tZ=["typed","matrix","zeros","add"],_y=F(rZ,tZ,e=>{var{typed:r,matrix:t,zeros:n,add:a}=e,i=Vu({typed:r,matrix:t,zeros:n,add:a});return r("subset",{"...any":function(l){try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var nZ="concat",aZ=["typed","matrix","isInteger"],Oy=F(nZ,aZ,e=>{var{typed:r,matrix:t,isInteger:n}=e,a=Uu({typed:r,matrix:t,isInteger:n});return r("concat",{"...any":function(s){var l=s.length-1,c=s[l];sr(c)?s[l]=c-1:rr(c)&&(s[l]=c.minus(1));try{return a.apply(null,s)}catch(o){throw mt(o)}}})},{isTransformFunction:!0});var xP="diff",iZ=["typed","matrix","subtract","number","bignumber"],By=F(xP,iZ,e=>{var{typed:r,matrix:t,subtract:n,number:a,bignumber:i}=e,s=Yu({typed:r,matrix:t,subtract:n,number:a,bignumber:i});return r(xP,{"...any":function(c){c=Cn(c);try{return s.apply(null,c)}catch(o){throw mt(o)}}})},{isTransformFunction:!0});var oZ="std",sZ=["typed","map","sqrt","variance"],Py=F(oZ,sZ,e=>{var{typed:r,map:t,sqrt:n,variance:a}=e,i=ff({typed:r,map:t,sqrt:n,variance:a});return r("std",{"...any":function(l){l=Cn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var bP="sum",uZ=["typed","config","add","numeric"],Iy=F(bP,uZ,e=>{var{typed:r,config:t,add:n,numeric:a}=e,i=nf({typed:r,config:t,add:n,numeric:a});return r(bP,{"...any":function(l){l=Cn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var fZ="quantileSeq",cZ=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Ry=F(fZ,cZ,e=>{var{typed:r,bignumber:t,add:n,subtract:a,divide:i,multiply:s,partitionSelect:l,compare:c,isInteger:o,smaller:u,smallerEq:m,larger:d}=e,h=uf({typed:r,bignumber:t,add:n,subtract:a,divide:i,multiply:s,partitionSelect:l,compare:c,isInteger:o,smaller:u,smallerEq:m,larger:d});return r("quantileSeq",{"Array | Matrix, number | BigNumber":h,"Array | Matrix, number | BigNumber, number":(v,x,w)=>h(v,x,y(w)),"Array | Matrix, number | BigNumber, boolean":h,"Array | Matrix, number | BigNumber, boolean, number":(v,x,w,C)=>h(v,x,w,y(C)),"Array | Matrix, Array | Matrix":h,"Array | Matrix, Array | Matrix, number":(v,x,w)=>h(v,x,y(w)),"Array | Matrix, Array | Matrix, boolean":h,"Array | Matrix, Array | Matrix, boolean, number":(v,x,w,C)=>h(v,x,w,y(C))});function y(v){return Cn([[],v])[1]}},{isTransformFunction:!0});var wP="cumsum",lZ=["typed","add","unaryPlus"],qy=F(wP,lZ,e=>{var{typed:r,add:t,unaryPlus:n}=e,a=af({typed:r,add:t,unaryPlus:n});return r(wP,{"...any":function(s){if(s.length===2&&Nt(s[0])){var l=s[1];sr(l)?s[1]=l-1:rr(l)&&(s[1]=l.minus(1))}try{return a.apply(null,s)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var DP="variance",mZ=["typed","add","subtract","multiply","divide","apply","isNaN"],ky=F(DP,mZ,e=>{var{typed:r,add:t,subtract:n,multiply:a,divide:i,apply:s,isNaN:l}=e,c=sf({typed:r,add:t,subtract:n,multiply:a,divide:i,apply:s,isNaN:l});return r(DP,{"...any":function(u){u=Cn(u);try{return c.apply(null,u)}catch(m){throw mt(m)}}})},{isTransformFunction:!0});var SP="print",pZ=["typed","matrix","zeros","add"],Ly=F(SP,pZ,e=>{var{typed:r,matrix:t,zeros:n,add:a}=e,i=Qu({typed:r,matrix:t,zeros:n,add:a});return r(SP,{"string, Object | Array":function(c,o){return i(s(c),o)},"string, Object | Array, number | Object":function(c,o,u){return i(s(c),o,u)}});function s(l){return l.replace(qd,c=>{var o=c.slice(1).split("."),u=o.map(function(m){return!isNaN(m)&&m.length>0?parseInt(m)-1:m});return"$"+u.join(".")})}},{isTransformFunction:!0});var dZ="and",hZ=["typed","matrix","zeros","add","equalScalar","not","concat"],zy=F(dZ,hZ,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:s}=e,l=ju({typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:s});function c(o,u,m){var d=o[0].compile().evaluate(m);if(!Nt(d)&&!l(d,!0))return!1;var h=o[1].compile().evaluate(m);return l(d,h)}return c.rawArgs=!0,c},{isTransformFunction:!0});var vZ="or",gZ=["typed","matrix","equalScalar","DenseMatrix","concat"],Uy=F(vZ,gZ,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=e,s=zu({typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i});function l(c,o,u){var m=c[0].compile().evaluate(u);if(!Nt(m)&&s(m,!1))return!0;var d=c[1].compile().evaluate(u);return s(m,d)}return l.rawArgs=!0,l},{isTransformFunction:!0});var yZ="bitAnd",xZ=["typed","matrix","zeros","add","equalScalar","not","concat"],Wy=F(yZ,xZ,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:s}=e,l=ku({typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:s});function c(o,u,m){var d=o[0].compile().evaluate(m);if(!Nt(d)){if(isNaN(d))return NaN;if(d===0||d===!1)return 0}var h=o[1].compile().evaluate(m);return l(d,h)}return c.rawArgs=!0,c},{isTransformFunction:!0});var bZ="bitOr",wZ=["typed","matrix","equalScalar","DenseMatrix","concat"],Yy=F(bZ,wZ,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=e,s=Lu({typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i});function l(c,o,u){var m=c[0].compile().evaluate(u);if(!Nt(m)){if(isNaN(m))return NaN;if(m===-1)return-1;if(m===!0)return 1}var d=c[1].compile().evaluate(u);return s(m,d)}return l.rawArgs=!0,l},{isTransformFunction:!0});var Ge=Ym({config:Oe}),pt=Hm({}),ID=p0({BigNumber:Ge,config:Oe}),NP=s0({}),AP=W0({BigNumber:Ge,config:Oe}),Wo=$m({}),RD=w0({Complex:pt}),MP=f0({BigNumber:Ge,config:Oe}),CP=v0({BigNumber:Ge,config:Oe}),EP=y0({BigNumber:Ge,config:Oe}),kc=Vm({}),TP=c0({BigNumber:Ge,config:Oe}),FP=u0({}),_P=d0({BigNumber:Ge,config:Oe}),OP=Gm({}),qD=Im({}),BP=x0({BigNumber:Ge,config:Oe}),PP=sy({BigNumber:Ge,config:Oe}),kD=m0({BigNumber:Ge,config:Oe}),IP=o0({}),RP=D0({}),Fr=Qm({Matrix:kc}),qP=J0({BigNumber:Ge,config:Oe}),kP=h0({BigNumber:Ge,config:Oe}),Hy=l0({BigNumber:Ge,config:Oe}),LP=i0({}),zP=b0({BigNumber:Ge,config:Oe}),te=Pm({BigNumber:Ge,Complex:pt,DenseMatrix:Fr,Fraction:Wo}),$y=Sp({BigNumber:Ge,config:Oe,typed:te}),UP=X0({BigNumber:Ge,config:Oe}),En=Np({typed:te}),WP=_h({Complex:pt,config:Oe,typed:te}),YP=Bh({BigNumber:Ge,typed:te}),HP=Ih({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),Qt=Mp({typed:te}),$P=Kp({typed:te}),GP=kh({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),VP=zh({typed:te}),LD=Uh({typed:te}),ZP=Yh({Complex:pt,config:Oe,typed:te}),ta=dp({BigNumber:Ge,typed:te}),QP=Xp({typed:te}),XP=pp({typed:te}),JP=Xm({typed:te}),Lc=Og({typed:te}),zc=hp({Complex:pt,typed:te}),Yo=jp({typed:te}),Gy=Hh({typed:te}),KP=Gh({BigNumber:Ge,typed:te}),jP=Zh({BigNumber:Ge,typed:te}),eI=Fp({typed:te}),Ir=fp({config:Oe,typed:te}),rI=Td({typed:te}),zD=_p({typed:te}),tI=Op({Complex:pt,typed:te}),nI=sd({typed:te}),aI=fd({typed:te}),mf=Bd({typed:te}),Vy=cd({typed:te}),iI=Rd({format:mf,typed:te}),Zy=ed({typed:te}),zn=jm({typed:te}),ao=rp({typed:te}),Ho=ap({typed:te}),La=ip({typed:te}),oI=g0({BigNumber:Ge,config:Oe}),sI=Ig({Complex:pt,typed:te}),uI=Rp({Complex:pt,config:Oe,typed:te}),UD=qp({Complex:pt,config:Oe,typed:te}),$o=pd({typed:te}),Ot=kp({typed:te}),Uc=td({typed:te}),Bi=lp({typed:te}),fI=Id({format:mf,typed:te}),cI=Ug({config:Oe,typed:te}),lI=Qu({typed:te}),mI=Wg({config:Oe,typed:te}),Qy=rd({typed:te}),pI=Xh({BigNumber:Ge,typed:te}),WD=Up({BigNumber:Ge,Fraction:Wo,complex:zc,typed:te}),Wc=Kh({typed:te}),Pi=cp({Matrix:kc,equalScalar:Ir,typed:te}),dI=wp({typed:te}),hI=Yp({typed:te}),vI=mp({typed:te}),xa=Cp({typed:te}),gI=ev({typed:te}),YD=sp({typed:te}),yI=Oh({Complex:pt,config:Oe,typed:te}),xI=Rh({BigNumber:Ge,typed:te}),Xy=Lo({isInteger:zn,typed:te}),bI=qh({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),wI=Pd({format:mf,typed:te}),DI=Bg({typed:te}),SI=$h({typed:te}),NI=Qh({BigNumber:Ge,typed:te}),pf=op({typed:te}),AI=Ld({typed:te}),MI=Yg({config:Oe,typed:te}),CI=Jh({BigNumber:Ge,typed:te}),EI=jh({typed:te}),TI=Th({SparseMatrix:Pi,typed:te}),za=Wp({Complex:pt,config:Oe,typed:te}),FI=rv({typed:te}),fi=Dp({typed:te}),_I=Ph({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),OI=Vh({BigNumber:Ge,typed:te}),Ps=vp({Fraction:Wo,typed:te}),Go=tp({typed:te}),$e=gp({DenseMatrix:Fr,Matrix:kc,SparseMatrix:Pi,typed:te}),BI=yp({isZero:La,matrix:$e,typed:te}),PI=_d({isNaN:pf,isNumeric:Go,typed:te}),Ua=zd({bignumber:ta,fraction:Ps,number:Bi}),HD=Od({config:Oe,multiplyScalar:Ot,numeric:Ua,typed:te}),$D=gd({isInteger:zn,matrix:$e,typed:te}),cn=wd({matrix:$e,config:Oe,typed:te}),II=Dd({matrix:$e,typed:te}),df=Sd({matrix:$e,typed:te}),GD=$p({BigNumber:Ge,config:Oe,matrix:$e,typed:te}),ln=Ad({BigNumber:Ge,config:Oe,matrix:$e,typed:te}),RI=Lh({Complex:pt,config:Oe,typed:te}),VD=Ep({BigNumber:Ge,Complex:pt,Fraction:Wo,config:Oe,isNegative:ao,matrix:$e,typed:te,unaryMinus:fi}),Gr=Uu({isInteger:zn,matrix:$e,typed:te}),qI=ad({prod:HD,size:cn,typed:te}),Jy=Nd({conj:Yo,transpose:df,typed:te}),ZD=od({DenseMatrix:Fr,SparseMatrix:Pi,matrix:$e,typed:te}),Mt=Ud({numeric:Ua,typed:te}),hf=Zd({DenseMatrix:Fr,concat:Gr,divideScalar:Mt,equalScalar:Ir,matrix:$e,typed:te}),ba=sh({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),vf=ud({matrix:$e,typed:te}),kI=np({isNumeric:Go,typed:te}),io=ld({BigNumber:Ge,DenseMatrix:Fr,SparseMatrix:Pi,config:Oe,matrix:$e,typed:te}),LI=md({matrix:$e,multiplyScalar:Ot,typed:te}),Yc=vh({DenseMatrix:Fr,concat:Gr,config:Oe,matrix:$e,typed:te}),zI=jd({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),QD=Qd({DenseMatrix:Fr,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te}),Ky=bp({flatten:vf,matrix:$e,size:cn,typed:te}),UI=zp({BigNumber:Ge,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),WI=dd({BigNumber:Ge,config:Oe,matrix:$e,typed:te}),jy=og({addScalar:Qt,complex:zc,conj:Yo,divideScalar:Mt,equal:ba,identity:io,isZero:La,matrix:$e,multiplyScalar:Ot,sign:WD,sqrt:za,subtractScalar:xa,typed:te,unaryMinus:fi,zeros:ln}),YI=yd({config:Oe,matrix:$e}),HI=eh({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),Is=Yd({BigNumber:Ge,DenseMatrix:Fr,config:Oe,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),Tn=ch({DenseMatrix:Fr,concat:Gr,config:Oe,matrix:$e,typed:te}),Bt=Hp({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,subtractScalar:xa,typed:te,unaryMinus:fi}),$I=kd({concat:Gr,matrix:$e,typed:te}),GI=xh({DenseMatrix:Fr,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,typed:te}),ex=Xd({DenseMatrix:Fr,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te}),VI=nd({DenseMatrix:Fr,concat:Gr,matrix:$e,typed:te}),Lr=mv({DenseMatrix:Fr,SparseMatrix:Pi,addScalar:Qt,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),ZI=Wh({BigNumber:Ge,DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),QI=ku({concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),XI=Lu({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),JI=Jp({DenseMatrix:Fr,concat:Gr,matrix:$e,typed:te}),KI=Gg({addScalar:Qt,combinations:Lc,divideScalar:Mt,isInteger:zn,isNegative:ao,multiplyScalar:Ot,typed:te}),Vo=nh({BigNumber:Ge,DenseMatrix:Fr,Fraction:Wo,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,typed:te}),XD=ih({concat:Gr,matrix:$e,typed:te}),jI=af({add:Lr,typed:te,unaryPlus:$y}),rx=gh({equal:ba,typed:te}),e4=Yu({matrix:$e,number:Bi,subtract:Bt,typed:te}),r4=Mg({abs:En,addScalar:Qt,deepEqual:rx,divideScalar:Mt,multiplyScalar:Ot,sqrt:za,subtractScalar:xa,typed:te}),Hc=hv({addScalar:Qt,conj:Yo,multiplyScalar:Ot,size:cn,typed:te}),t4=uh({compareText:XD,isZero:La,typed:te}),JD=Pu({DenseMatrix:Fr,config:Oe,equalScalar:Ir,matrix:$e,round:Is,typed:te,zeros:ln}),n4=Pp({BigNumber:Ge,DenseMatrix:Fr,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,round:Is,typed:te,zeros:ln}),a4=pv({abs:En,addScalar:Qt,divideScalar:Mt,isPositive:Ho,multiplyScalar:Ot,smaller:Tn,sqrt:za,typed:te}),KD=Dh({DenseMatrix:Fr,smaller:Tn}),bn=Sh({ImmutableDenseMatrix:KD,getMatrixDataType:Vy}),Fn=dh({DenseMatrix:Fr,concat:Gr,config:Oe,matrix:$e,typed:te}),tx=Hd({Complex:pt,config:Oe,divideScalar:Mt,typed:te}),i4=Jd({DenseMatrix:Fr,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te}),o4=xp({flatten:vf,matrix:$e,size:cn,typed:te}),s4=rf({config:Oe,numeric:Ua,smaller:Tn,typed:te}),jD=Iu({DenseMatrix:Fr,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,round:Is,typed:te,zeros:ln}),it=Lp({addScalar:Qt,dot:Hc,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,typed:te}),u4=Gd({Complex:pt,config:Oe,divideScalar:Mt,typed:te}),f4=zu({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),$c=bh({compare:Vo,isNaN:pf,isNumeric:Go,typed:te}),c4=rh({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),eS=fg({SparseMatrix:Pi,abs:En,add:Lr,divideScalar:Mt,larger:Fn,largerEq:Yc,multiply:it,subtract:Bt,transpose:df,typed:te}),na=Vu({add:Lr,matrix:$e,typed:te,zeros:ln}),nx=nf({add:Lr,config:Oe,numeric:Ua,typed:te}),l4=vv({add:Lr,matrix:$e,typed:te}),rS=Kd({DenseMatrix:Fr,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te}),m4=t0({Complex:pt,add:Lr,multiply:it,number:Bi,typed:te}),ax=Tp({DenseMatrix:Fr,config:Oe,equalScalar:Ir,matrix:$e,round:Is,typed:te,zeros:ln}),ci=ah({compare:Vo,typed:te}),p4=Vg({addScalar:Qt,combinations:Lc,isInteger:zn,isNegative:ao,isPositive:Ho,larger:Fn,typed:te}),d4=id({matrix:$e,multiply:it,subtract:Bt,typed:te}),tS=vg({divideScalar:Mt,isZero:La,matrix:$e,multiply:it,subtractScalar:xa,typed:te,unaryMinus:fi}),h4=Zp({concat:Gr,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,typed:te}),nS=Nh({larger:Fn,smaller:Tn}),aS=Bp({Complex:pt,DenseMatrix:Fr,ceil:ax,equalScalar:Ir,floor:JD,matrix:$e,typed:te,zeros:ln}),iS=gv({Index:bn,typed:te}),v4=Cg({abs:En,add:Lr,addScalar:Qt,config:Oe,divideScalar:Mt,equalScalar:Ir,flatten:vf,isNumeric:Go,isZero:La,matrix:$e,multiply:it,multiplyScalar:Ot,smaller:Tn,subtract:Bt,typed:te}),g4=Gp({BigNumber:Ge,add:Lr,config:Oe,equal:ba,isInteger:zn,mod:jD,smaller:Tn,typed:te,xgcd:GD}),y4=Ip({concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),x4=$d({Complex:pt,config:Oe,divideScalar:Mt,log:tx,typed:te}),ix=ef({config:Oe,larger:Fn,numeric:Ua,typed:te}),b4=tv({DenseMatrix:Fr,Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),w4=av({DenseMatrix:Fr,Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),D4=ov({Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),S4=uv({Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),Rs=mh({DenseMatrix:Fr,concat:Gr,config:Oe,matrix:$e,typed:te}),N4=wh({compare:Vo,compareNatural:ci,matrix:$e,typed:te}),A4=ju({concat:Gr,equalScalar:Ir,matrix:$e,not:Uc,typed:te,zeros:ln}),qs=$u({bignumber:ta,matrix:$e,add:Lr,config:Oe,isPositive:Ho,larger:Fn,largerEq:Yc,smaller:Tn,smallerEq:Rs,typed:te}),M4=Gu({Index:bn,matrix:$e,range:qs,typed:te}),oS=nv({DenseMatrix:Fr,Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),C4=sv({Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),sS=cv({Index:bn,concat:Gr,setDifference:oS,size:cn,subset:na,typed:te}),uS=Ah({FibonacciHeap:nS,addScalar:Qt,equalScalar:Ir}),fS=Wu({Index:bn,matrix:$e,range:qs,typed:te}),Zo=gg({abs:En,addScalar:Qt,det:tS,divideScalar:Mt,identity:io,matrix:$e,multiply:it,typed:te,unaryMinus:fi}),cS=ig({DenseMatrix:Fr,Spa:uS,SparseMatrix:Pi,abs:En,addScalar:Qt,divideScalar:Mt,equalScalar:Ir,larger:Fn,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te,unaryMinus:fi}),E4=yg({Complex:pt,add:Lr,ctranspose:Jy,deepEqual:rx,divideScalar:Mt,dot:Hc,dotDivide:hf,equal:ba,inv:Zo,matrix:$e,multiply:it,typed:te}),wa=Wd({Complex:pt,config:Oe,fraction:Ps,identity:io,inv:Zo,matrix:$e,multiply:it,number:Bi,typed:te}),lS=iv({DenseMatrix:Fr,Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),T4=lv({Index:bn,concat:Gr,setIntersect:lS,setSymDifference:sS,size:cn,subset:na,typed:te}),F4=wg({abs:En,add:Lr,identity:io,inv:Zo,map:$o,max:ix,multiply:it,size:cn,sqrt:za,subtract:Bt,typed:te}),wr=Ch({BigNumber:Ge,Complex:pt,Fraction:Wo,abs:En,addScalar:Qt,config:Oe,divideScalar:Mt,equal:ba,fix:aS,format:mf,isNumeric:Go,multiplyScalar:Ot,number:Bi,pow:wa,round:Is,subtractScalar:xa}),_4=T0({BigNumber:Ge,Unit:wr,config:Oe}),O4=cy({BigNumber:Ge,Unit:wr,config:Oe}),B4=K0({BigNumber:Ge,Unit:wr,config:Oe}),P4=O0({BigNumber:Ge,Unit:wr,config:Oe}),I4=ey({BigNumber:Ge,Unit:wr,config:Oe}),R4=B0({BigNumber:Ge,Unit:wr,config:Oe}),q4=F0({BigNumber:Ge,Unit:wr,config:Oe}),k4=$0({BigNumber:Ge,Unit:wr,config:Oe}),L4=Vd({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,pow:wa,typed:te}),z4=E0({BigNumber:Ge,Unit:wr,config:Oe}),U4=_0({BigNumber:Ge,Unit:wr,config:Oe}),W4=bg({abs:En,add:Lr,identity:io,inv:Zo,multiply:it,typed:te}),Y4=ry({BigNumber:Ge,Unit:wr,config:Oe}),mS=Md({addScalar:Qt,ceil:ax,conj:Yo,divideScalar:Mt,dotDivide:hf,exp:zD,i:RD,log2:UD,matrix:$e,multiplyScalar:Ot,pow:wa,tau:kD,typed:te}),ox=Pg({BigNumber:Ge,Complex:pt,config:Oe,multiplyScalar:Ot,pow:wa,typed:te}),H4=N0({BigNumber:Ge,Unit:wr,config:Oe}),$4=Y0({BigNumber:Ge,Unit:wr,config:Oe}),G4=Cd({conj:Yo,dotDivide:hf,fft:mS,typed:te}),V4=q0({BigNumber:Ge,Unit:wr,config:Oe}),Z4=ny({BigNumber:Ge,Unit:wr,config:Oe}),Q4=C0({BigNumber:Ge,Unit:wr,config:Oe}),X4=ly({BigNumber:Ge,Unit:wr,config:Oe}),J4=iy({BigNumber:Ge,Unit:wr,config:Oe}),K4=G0({BigNumber:Ge,Unit:wr,config:Oe}),j4=R0({BigNumber:Ge,Unit:wr,config:Oe}),eR=gy({BigNumber:Ge,Unit:wr,config:Oe}),rR=dy({BigNumber:Ge,Unit:wr,config:Oe}),tR=yy({BigNumber:Ge,Unit:wr,config:Oe}),nR=H0({BigNumber:Ge,Unit:wr,config:Oe}),aR=V0({BigNumber:Ge,Unit:wr,config:Oe}),iR=M0({BigNumber:Ge,Unit:wr,config:Oe}),oR=Z0({BigNumber:Ge,Unit:wr,config:Oe}),sR=uy({BigNumber:Ge,Unit:wr,config:Oe}),uR=S0({BigNumber:Ge,Unit:wr,config:Oe}),fR=fy({BigNumber:Ge,Unit:wr,config:Oe}),cR=Q0({BigNumber:Ge,Unit:wr,config:Oe}),lR=j0({BigNumber:Ge,Unit:wr,config:Oe}),mR=k0({BigNumber:Ge,Unit:wr,config:Oe}),pR=Fh({Unit:wr,typed:te}),an=Ag({divideScalar:Mt,equalScalar:Ir,inv:Zo,matrix:$e,multiply:it,typed:te}),dR=z0({BigNumber:Ge,Unit:wr,config:Oe}),gf=Rg({gamma:ox,typed:te}),hR=ty({BigNumber:Ge,Unit:wr,config:Oe}),vR=py({BigNumber:Ge,Unit:wr,config:Oe}),gR=P0({BigNumber:Ge,Unit:wr,config:Oe}),pS=cg({DenseMatrix:Fr,lsolve:QD,lup:cS,matrix:$e,slu:eS,typed:te,usolve:ex}),yR=I0({BigNumber:Ge,Unit:wr,config:Oe}),xR=my({BigNumber:Ge,Unit:wr,config:Oe}),bR=kg({add:Lr,divide:an,factorial:gf,isInteger:zn,isPositive:Ho,multiply:it,typed:te}),wR=Lg({factorial:gf,typed:te}),DR=hy({BigNumber:Ge,Unit:wr,config:Oe}),SR=lg({add:Lr,cbrt:VD,divide:an,equalScalar:Ir,im:Zy,isZero:La,multiply:it,re:Qy,sqrt:za,subtract:Bt,typeOf:YD,typed:te,unaryMinus:fi}),NR=fv({compareNatural:ci,typed:te}),AR=Ed({abs:En,add:Lr,bignumber:ta,divide:an,isNegative:ao,isPositive:Ho,larger:Fn,map:$o,matrix:$e,max:ix,multiply:it,smaller:Tn,subtract:Bt,typed:te,unaryMinus:fi}),dS=Hg({bignumber:ta,addScalar:Qt,combinations:Lc,divideScalar:Mt,factorial:gf,isInteger:zn,isNegative:ao,larger:Fn,multiplyScalar:Ot,number:Bi,pow:wa,subtractScalar:xa,typed:te}),MR=Eh({Unit:wr,typed:te}),CR=$g({addScalar:Qt,isInteger:zn,isNegative:ao,stirlingS2:dS,typed:te}),hS=xg({abs:En,add:Lr,addScalar:Qt,atan:LD,bignumber:ta,column:fS,complex:zc,config:Oe,cos:Gy,diag:ZD,divideScalar:Mt,dot:Hc,equal:ba,flatten:vf,im:Zy,inv:Zo,larger:Fn,matrix:$e,matrixFromColumns:Ky,multiply:it,multiplyScalar:Ot,number:Bi,qr:jy,re:Qy,reshape:$D,sin:Wc,size:cn,smaller:Tn,sqrt:za,subtract:Bt,typed:te,usolve:ex,usolveAll:rS}),ER=U0({BigNumber:Ge,Unit:wr,config:Oe}),TR=ay({BigNumber:Ge,Unit:wr,config:Oe}),FR=qg({divide:an,dotDivide:hf,isNumeric:Go,log:tx,map:$o,matrix:$e,multiply:it,sum:nx,typed:te}),vS=of({add:Lr,divide:an,typed:te}),_R=oy({BigNumber:Ge,Unit:wr,config:Oe}),OR=A0({BigNumber:Ge,Unit:wr,config:Oe}),BR=uf({bignumber:ta,add:Lr,compare:Vo,divide:an,isInteger:zn,larger:Fn,multiply:it,partitionSelect:$c,smaller:Tn,smallerEq:Rs,subtract:Bt,typed:te}),sx=sf({add:Lr,apply:Xy,divide:an,isNaN:pf,multiply:it,subtract:Bt,typed:te}),PR=L0({BigNumber:Ge,Unit:wr,config:Oe}),gS=Tg({add:Lr,compare:Vo,divide:an,partitionSelect:$c,typed:te}),IR=_g({add:Lr,divide:an,matrix:$e,mean:vS,multiply:it,pow:wa,sqrt:za,subtract:Bt,sum:nx,typed:te}),RR=n0({Complex:pt,add:Lr,divide:an,matrix:$e,multiply:it,typed:te}),qR=Fg({abs:En,map:$o,median:gS,subtract:Bt,typed:te}),kR=ff({map:$o,sqrt:za,typed:te,variance:sx}),LR=Fd({BigNumber:Ge,Complex:pt,add:Lr,config:Oe,divide:an,equal:ba,factorial:gf,gamma:ox,isNegative:ao,multiply:it,pi:Hy,pow:wa,sin:Wc,smallerEq:Rs,subtract:Bt,typed:te}),ux=dv({abs:En,add:Lr,conj:Yo,ctranspose:Jy,eigs:hS,equalScalar:Ir,larger:Fn,matrix:$e,multiply:it,pow:wa,smaller:Tn,sqrt:za,typed:te}),yS=bd({BigNumber:Ge,DenseMatrix:Fr,SparseMatrix:Pi,addScalar:Qt,config:Oe,cos:Gy,matrix:$e,multiplyScalar:Ot,norm:ux,sin:Wc,typed:te,unaryMinus:fi}),zR=vy({BigNumber:Ge,Unit:wr,config:Oe}),xS=Sg({identity:io,matrix:$e,multiply:it,norm:ux,qr:jy,subtract:Bt,typed:te}),UR=xd({multiply:it,rotationMatrix:yS,typed:te}),bS=Dg({abs:En,add:Lr,concat:Gr,identity:io,index:iS,lusolve:pS,matrix:$e,matrixFromColumns:Ky,multiply:it,range:qs,schur:xS,subset:na,subtract:Bt,transpose:df,typed:te}),WR=Ng({matrix:$e,multiply:it,sylvester:bS,transpose:df,typed:te});var yf={},xf={},YR={},_n=xv({mathWithTransform:xf}),bf=Wv({Node:_n}),oo=Hv({Node:_n}),ks=Gv({Node:_n}),HR=Xv({Node:_n}),wf=Nv({Node:_n}),$R=Fv({Node:_n,ResultSet:qD}),GR=Ov({Node:_n}),Qo=Rv({Node:_n}),VR=Zv({Node:_n}),DZ=a0({classes:YR}),wS=pg({math:yf,typed:te}),ZR=kv({Node:_n,typed:te}),SZ=hg({Chain:wS,typed:te}),Df=zv({Node:_n,size:cn}),Sf=Dv({Node:_n,subset:na}),QR=Ev({matrix:$e,Node:_n,subset:na}),Xo=Jv({Unit:wr,Node:_n,math:yf}),Jo=jv({Node:_n,SymbolNode:Xo,math:yf}),Wa=eg({AccessorNode:Sf,ArrayNode:wf,AssignmentNode:QR,BlockNode:$R,ConditionalNode:GR,ConstantNode:Qo,FunctionAssignmentNode:ZR,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,RangeNode:VR,RelationalNode:HR,SymbolNode:Xo,config:Oe,numeric:Ua,typed:te}),XR=Kg({ConstantNode:Qo,FunctionNode:Jo,OperatorNode:oo,ParenthesisNode:ks,parse:Wa,typed:te}),DS=Xg({bignumber:ta,fraction:Ps,AccessorNode:Sf,ArrayNode:wf,ConstantNode:Qo,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,SymbolNode:Xo,config:Oe,mathWithTransform:xf,matrix:$e,typed:te}),NZ=rg({parse:Wa,typed:te}),SS=Jg({AccessorNode:Sf,ArrayNode:wf,ConstantNode:Qo,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,SymbolNode:Xo,add:Lr,divide:an,equal:ba,isZero:La,multiply:it,parse:Wa,pow:wa,subtract:Bt,typed:te}),NS=tg({parse:Wa,typed:te}),JR=mg({evaluate:NS}),KR=ng({evaluate:NS}),fx=Qg({bignumber:ta,fraction:Ps,AccessorNode:Sf,ArrayNode:wf,ConstantNode:Qo,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,SymbolNode:Xo,add:Lr,config:Oe,divide:an,equal:ba,isZero:La,mathWithTransform:xf,matrix:$e,multiply:it,parse:Wa,pow:wa,resolve:XR,simplifyConstant:DS,simplifyCore:SS,subtract:Bt,typed:te}),AZ=jg({OperatorNode:oo,parse:Wa,simplify:fx,typed:te}),MZ=Zg({parse:Wa,typed:te}),CZ=ag({Parser:KR,typed:te}),EZ=r0({bignumber:ta,fraction:Ps,AccessorNode:Sf,ArrayNode:wf,ConstantNode:Qo,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,SymbolNode:Xo,add:Lr,config:Oe,divide:an,equal:ba,isZero:La,mathWithTransform:xf,matrix:$e,multiply:it,parse:Wa,pow:wa,simplify:fx,simplifyConstant:DS,simplifyCore:SS,subtract:Bt,typed:te}),TZ=e0({ConstantNode:Qo,FunctionNode:Jo,OperatorNode:oo,ParenthesisNode:ks,SymbolNode:Xo,config:Oe,equal:ba,isZero:La,numeric:Ua,parse:Wa,simplify:fx,typed:te}),FZ=dg({Help:JR,mathWithTransform:xf,typed:te});ht(yf,{e:ID,false:NP,fineStructure:AP,i:RD,Infinity:MP,LN10:CP,LOG10E:EP,NaN:TP,null:FP,phi:_P,SQRT1_2:BP,sackurTetrode:PP,tau:kD,true:IP,E:ID,version:RP,efimovFactor:qP,LN2:kP,pi:Hy,replacer:LP,reviver:DZ,SQRT2:zP,typed:te,unaryPlus:$y,PI:Hy,weakMixingAngle:UP,abs:En,acos:WP,acot:YP,acsc:HP,addScalar:Qt,arg:$P,asech:GP,asinh:VP,atan:LD,atanh:ZP,bignumber:ta,bitNot:QP,boolean:XP,clone:JP,combinations:Lc,complex:zc,conj:Yo,cos:Gy,cot:KP,csc:jP,cube:eI,equalScalar:Ir,erf:rI,exp:zD,expm1:tI,filter:nI,forEach:aI,format:mf,getMatrixDataType:Vy,hex:iI,im:Zy,isInteger:zn,isNegative:ao,isPositive:Ho,isZero:La,LOG2E:oI,lgamma:sI,log10:uI,log2:UD,map:$o,multiplyScalar:Ot,not:Uc,number:Bi,oct:fI,pickRandom:cI,print:lI,random:mI,re:Qy,sec:pI,sign:WD,sin:Wc,splitUnit:dI,square:hI,string:vI,subtractScalar:xa,tan:gI,typeOf:YD,acosh:yI,acsch:xI,apply:Xy,asec:bI,bin:wI,chain:SZ,combinationsWithRep:DI,cosh:SI,csch:NI,isNaN:pf,isPrime:AI,randomInt:MI,sech:CI,sinh:EI,sparse:TI,sqrt:za,tanh:FI,unaryMinus:fi,acoth:_I,coth:OI,fraction:Ps,isNumeric:Go,matrix:$e,matrixFromFunction:BI,mode:PI,numeric:Ua,prod:HD,reshape:$D,size:cn,squeeze:II,transpose:df,xgcd:GD,zeros:ln,asin:RI,cbrt:VD,concat:Gr,count:qI,ctranspose:Jy,diag:ZD,divideScalar:Mt,dotDivide:hf,equal:ba,flatten:vf,hasNumericValue:kI,identity:io,kron:LI,largerEq:Yc,leftShift:zI,lsolve:QD,matrixFromColumns:Ky,nthRoot:UI,ones:WI,qr:jy,resize:YI,rightArithShift:HI,round:Is,smaller:Tn,subtract:Bt,to:$I,unequal:GI,usolve:ex,xor:VI,add:Lr,atan2:ZI,bitAnd:QI,bitOr:XI,bitXor:JI,catalan:KI,compare:Vo,compareText:XD,cumsum:jI,deepEqual:rx,diff:e4,distance:r4,dot:Hc,equalText:t4,floor:JD,gcd:n4,hypot:a4,larger:Fn,log:tx,lsolveAll:i4,matrixFromRows:o4,min:s4,mod:jD,multiply:it,nthRoots:u4,or:f4,partitionSelect:$c,rightLogShift:c4,slu:eS,subset:na,sum:nx,trace:l4,usolveAll:rS,zpk2tf:m4,ceil:ax,compareNatural:ci,composition:p4,cross:d4,det:tS,dotMultiply:h4,fix:aS,index:iS,intersect:v4,invmod:g4,lcm:y4,log1p:x4,max:ix,setCartesian:b4,setDistinct:w4,setIsSubset:D4,setPowerset:S4,smallerEq:Rs,sort:N4,and:A4,range:qs,row:M4,setDifference:oS,setMultiplicity:C4,setSymDifference:sS,column:fS,inv:Zo,lup:cS,pinv:E4,pow:wa,setIntersect:lS,setUnion:T4,sqrtm:F4,vacuumImpedance:_4,wienDisplacement:O4,atomicMass:B4,bohrMagneton:P4,boltzmann:I4,conductanceQuantum:R4,coulomb:q4,deuteronMass:k4,dotPow:L4,electricConstant:z4,elementaryCharge:U4,expm:W4,faraday:Y4,fft:mS,gamma:ox,gravitationConstant:H4,hartreeEnergy:$4,ifft:G4,klitzing:V4,loschmidt:Z4,magneticConstant:Q4,molarMass:X4,molarPlanckConstant:J4,neutronMass:K4,nuclearMagneton:j4,planckCharge:eR,planckLength:rR,planckTemperature:tR,protonMass:nR,quantumOfCirculation:aR,reducedPlanckConstant:iR,rydberg:oR,secondRadiation:sR,speedOfLight:uR,stefanBoltzmann:fR,thomsonCrossSection:cR,avogadro:lR,bohrRadius:mR,createUnit:pR,divide:an,electronMass:dR,factorial:gf,firstRadiation:hR,gravity:vR,inverseConductanceQuantum:gR,lusolve:pS,magneticFluxQuantum:yR,molarMassC12:xR,multinomial:bR,parse:Wa,permutations:wR,planckMass:DR,polynomialRoot:SR,resolve:XR,setSize:NR,simplifyConstant:DS,solveODE:AR,stirlingS2:dS,unit:MR,bellNumbers:CR,compile:NZ,eigs:hS,fermiCoupling:ER,gasConstant:TR,kldivergence:FR,mean:vS,molarVolume:_R,planckConstant:OR,quantileSeq:BR,simplifyCore:SS,variance:sx,classicalElectronRadius:PR,evaluate:NS,median:gS,simplify:fx,symbolicEqual:AZ,corr:IR,freqz:RR,leafCount:MZ,mad:qR,parser:CZ,rationalize:EZ,std:kR,zeta:LR,derivative:TZ,norm:ux,rotationMatrix:yS,help:FZ,planckTime:zR,schur:xS,rotate:UR,sylvester:bS,lyap:WR,config:Oe});ht(xf,yf,{filter:Dy({typed:te}),forEach:Sy({typed:te}),map:Ay({typed:te}),apply:by({isInteger:zn,typed:te}),or:Uy({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),and:zy({add:Lr,concat:Gr,equalScalar:Ir,matrix:$e,not:Uc,typed:te,zeros:ln}),concat:Oy({isInteger:zn,matrix:$e,typed:te}),max:My({config:Oe,larger:Fn,numeric:Ua,typed:te}),print:Ly({add:Lr,matrix:$e,typed:te,zeros:ln}),bitAnd:Wy({add:Lr,concat:Gr,equalScalar:Ir,matrix:$e,not:Uc,typed:te,zeros:ln}),diff:By({bignumber:ta,matrix:$e,number:Bi,subtract:Bt,typed:te}),min:Ey({config:Oe,numeric:Ua,smaller:Tn,typed:te}),subset:_y({add:Lr,matrix:$e,typed:te,zeros:ln}),bitOr:Yy({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),cumsum:qy({add:Lr,typed:te,unaryPlus:$y}),index:Ny({Index:bn,getMatrixDataType:Vy}),sum:Iy({add:Lr,config:Oe,numeric:Ua,typed:te}),range:Ty({bignumber:ta,matrix:$e,add:Lr,config:Oe,isPositive:Ho,larger:Fn,largerEq:Yc,smaller:Tn,smallerEq:Rs,typed:te}),row:Fy({Index:bn,matrix:$e,range:qs,typed:te}),column:wy({Index:bn,matrix:$e,range:qs,typed:te}),mean:Cy({add:Lr,divide:an,typed:te}),quantileSeq:Ry({add:Lr,bignumber:ta,compare:Vo,divide:an,isInteger:zn,larger:Fn,multiply:it,partitionSelect:$c,smaller:Tn,smallerEq:Rs,subtract:Bt,typed:te}),variance:ky({add:Lr,apply:Xy,divide:an,isNaN:pf,multiply:it,subtract:Bt,typed:te}),std:Py({map:$o,sqrt:za,typed:te,variance:sx})});ht(YR,{BigNumber:Ge,Complex:pt,Fraction:Wo,Matrix:kc,Node:_n,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,Range:OP,RelationalNode:HR,ResultSet:qD,ArrayNode:wf,BlockNode:$R,ConditionalNode:GR,ConstantNode:Qo,DenseMatrix:Fr,RangeNode:VR,Chain:wS,FunctionAssignmentNode:ZR,SparseMatrix:Pi,IndexNode:Df,ImmutableDenseMatrix:KD,Index:bn,AccessorNode:Sf,AssignmentNode:QR,FibonacciHeap:nS,Spa:uS,Unit:wr,SymbolNode:Xo,FunctionNode:Jo,Help:JR,Parser:KR});wS.createProxy(yf);var AS=PD;var n5=ma(Nm(),1);var e5=ma(jR(),1);function r5(e){var r=new e5.default;return e.on=r.on.bind(r),e.off=r.off.bind(r),e.once=r.once.bind(r),e.emit=r.emit.bind(r),e}function t5(e,r,t,n){function a(x,w){var C=arguments.length;if(C!==1&&C!==2)throw new ga("import",C,1,2);w||(w={});function b(O,_,E){if(Array.isArray(_))_.forEach(L=>b(O,L));else if(typeof _=="object")for(var T in _)Xe(_,T)&&b(O,_[T],T);else if(Ms(_)||E!==void 0){var R=Ms(_)?y(_)?_.fn+".transform":_.fn:E;if(Xe(O,R)&&O[R]!==_&&!w.silent)throw new Error('Cannot import "'+R+'" twice');O[R]=_}else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}var N={};b(N,x);for(var M in N)if(Xe(N,M)){var S=N[M];if(Ms(S))o(S,w);else if(u(S))i(M,S,w);else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}}function i(x,w,C){if(C.wrap&&typeof w=="function"&&(w=c(w)),m(w)&&(w=e(x,{[w.signature]:w})),e.isTypedFunction(t[x])&&e.isTypedFunction(w)){C.override?w=e(x,w.signatures):w=e(t[x],w),t[x]=w,delete n[x],s(x,w),t.emit("import",x,function(){return w});return}if(t[x]===void 0||C.override){t[x]=w,delete n[x],s(x,w),t.emit("import",x,function(){return w});return}if(!C.silent)throw new Error('Cannot import "'+x+'": already exists')}function s(x,w){w&&typeof w.transform=="function"?(t.expression.transform[x]=w.transform,d(x)&&(t.expression.mathWithTransform[x]=w.transform)):(delete t.expression.transform[x],d(x)&&(t.expression.mathWithTransform[x]=w))}function l(x){delete t.expression.transform[x],d(x)?t.expression.mathWithTransform[x]=t[x]:delete t.expression.mathWithTransform[x]}function c(x){var w=function(){for(var b=[],N=0,M=arguments.length;N2&&arguments[2]!==void 0?arguments[2]:x.fn;if(Jb(C,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(C));var b=y(x)?t.expression.transform:t,N=C in t.expression.transform,M=Xe(b,C)?b[C]:void 0,S=function(){var _={};x.dependencies.map(ew).forEach(T=>{if(Jb(T,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(T));T==="math"?_.math=t:T==="mathWithTransform"?_.mathWithTransform=t.expression.mathWithTransform:T==="classes"?_.classes=t:_[T]=t[T]});var E=x(_);if(E&&typeof E.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(M===void 0||w.override)return E;if(e.isTypedFunction(M)&&e.isTypedFunction(E))return e(M,E);if(w.silent)return M;throw new Error('Cannot import "'+C+'": already exists')};!x.meta||x.meta.lazy!==!1?(Du(b,C,S),M&&N?l(C):(y(x)||h(x))&&Du(t.expression.mathWithTransform,C,()=>b[C])):(b[C]=S(),M&&N?l(C):(y(x)||h(x))&&Du(t.expression.mathWithTransform,C,()=>b[C])),n[C]=x,t.emit("import",C,S)}function u(x){return typeof x=="function"||typeof x=="number"||typeof x=="string"||typeof x=="boolean"||x===null||Ht(x)||Kt(x)||rr(x)||da(x)||Qe(x)||Array.isArray(x)}function m(x){return typeof x=="function"&&typeof x.signature=="string"}function d(x){return!Xe(v,x)}function h(x){return x.fn.indexOf(".")===-1&&!Xe(v,x.fn)&&(!x.meta||!x.meta.isClass)}function y(x){return x!==void 0&&x.meta!==void 0&&x.meta.isTransformFunction===!0||!1}var v={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return a}function cx(e,r){var t=ht({},Ss,r);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var n=r5({isNumber:sr,isComplex:Kt,isBigNumber:rr,isFraction:da,isUnit:Ht,isString:St,isArray:Mr,isMatrix:Qe,isCollection:Nt,isDenseMatrix:Ji,isSparseMatrix:ha,isRange:Fo,isIndex:Mi,isBoolean:fm,isResultSet:cm,isHelp:xu,isFunction:lm,isDate:mm,isRegExp:pm,isObject:Ci,isNull:dm,isUndefined:hm,isAccessorNode:Ln,isArrayNode:jt,isAssignmentNode:vm,isBlockNode:gm,isConditionalNode:ym,isConstantNode:xr,isFunctionAssignmentNode:Oa,isFunctionNode:yn,isIndexNode:Jn,isNode:Nr,isObjectNode:Ei,isOperatorNode:ct,isParenthesisNode:en,isRangeNode:xm,isRelationalNode:bm,isSymbolNode:at,isChain:bu});n.config=ZA(t,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}};var a=[],i=[];function s(u){if(Ms(u))return u(n);var m=u[Object.keys(u)[0]];if(Ms(m))return m(n);if(!$A(u))throw console.warn("Factory object with properties \`type\`, \`name\`, and \`factory\` expected",u),new Error("Factory object with properties \`type\`, \`name\`, and \`factory\` expected");var d=a.indexOf(u),h;return d===-1?(u.math===!0?h=u.factory(n.type,t,s,n.typed,n):h=u.factory(n.type,t,s,n.typed),a.push(u),i.push(h)):h=i[d],h}var l={};function c(){for(var u=arguments.length,m=new Array(u),d=0;d{Ub(l).forEach(u=>{u&&u.meta&&u.meta.recreateOnConfigChange&&o(u,{override:!0})})}),n.create=cx.bind(null,e),n.factory=F,n.import(Ub(YA(e))),n.ArgumentsError=ga,n.DimensionError=pr,n.IndexError=tn,n}var LS=ma(um());var i5=ma(a5()),TS=class{constructor(){this.lang="en";this.all={en:{hintText:{dragDropModifierKeys:"Hold \${1} to Pin and \${2} to Copy",createListItem:"Select/Create List Item Frame",dragDropProperties:"Drag and drop properties to link them into the list",newItem:"+ New",selectNote:"Select Note...",newFrame:"New"},defaults:{spaceNote:"Current Note",spaceContext:"Current Space"},commands:{h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",columns:"Columns",tabs:"Tabs",button:"Button",label:"Label",column:"Column",idea:"New",group:"Group",paragraph:"Text",card:"Card",progress:"Progress",rating:"Rating",circularProgress:"Circular Progress",list:"Bullet List","ordered-list":"Numbered List",todo:"To-do List",quote:"Quote",internal:"Link to Note",context:"Embed Existing Context",flow:"Embed Note or Space",board:"New Board",divider:"Divider",note:"Note Block",link:"Web Link",callout:"Callout",bookmark:"Bookmark",table:"New Table",codeblock:"Code Block",toggle:"Toggle",emoji:"Emoji",image:"Image",newNote:"New Note",tag:"Tag",makeMenu:"Flow Menu",selectStyle:"Style",toggleKeyboard:"Toggle Keyboard",rows:"Rows",masonry:"Gallery"},styles:{bold:"Bold",italics:"Italics",strikethrough:"Strikethrough",code:"Code",link:"Web Link",blocklink:"Link to Note",textColor:"Text Color",highlight:"Highlight"},commandsSuggest:{noResult:"No result"},commandPalette:{enable:"Enable",disabled:"Disable",openFlow:"Open Flow Blocks in Selection",closeFlow:"Close Flow Blocks in Selection",toggleBold:"Toggle Bold",toggleItalics:"Toggle Italics",openSpaces:"Open Spaces",blink:"Blink",openFileContext:"Open Explorer",convertPathToSpace:"Convert to Space",revealFile:"Reveal File in Spaces",releaseNotes:"Release Notes",toggleBacklinks:"Toggle Backlinks",collapseAllFolders:"Collapse All Folders",addFileSpace:"Add File to Space",removeFileSpace:"Remove File from Space"},frames:{sections:{kit:"Kit",paths:"Paths"},label:{label:"Label",description:"Label"},note:{label:"Note",description:"Link to a note"},table:{label:"Table",description:"Table"},context:{label:"Context",description:"Display a context view from another space"},calendar:{label:"Calendar View"},field:{label:"Field",description:"Dynamic node that displays a value based on property type"},event:{label:"Event"},divider:{label:"Divider",description:"Divider to separate your content"},button:{label:"Button",description:"Buttons can perform actions and open links"},callout:{label:"Callout",description:"Callout to highlight important information"},toggle:{label:"Toggle",description:"Toggle to show/hide content"}},menu:{layout:"Layout",enterFlowState:"Enter Flow State",exitFlowState:"Exit Flow State",newView:"New View",calendarView:"Calendar View",dayView:"Day View",closeSpace:"Close Space",customView:"Custom View",detailsView:"Details View",catalogView:"Catalog View",galleryView:"Gallery View",deleteContext:"Delete Context",openSpace:"Open Space",revealInDefault:"Reveal in Finder",revealInExplorer:"Reveal in Explorer",setNone:"None",fileMetadataDescription:"This note only",openFilePane:"Open in a new pane",rename:"Rename",changeToFolderNote:"New Space from Note",moveFile:"Move file to...",moveFolder:"Move folder to...",duplicate:"Make a copy",edit:"Edit",delete:"Delete",getHelp:"Make.md Community",vault:"Vault",openVault:"Open Another Vault",openVaultInFolder:"Open Vault Folder",obSettings:"Obsidian Settings",commandPalette:"Command Palette",backToSpace:"Back to Spaces",collapseAllSections:"Collapse All Spaces",expandAllSections:"Expand All Spaces",collapseAllFolders:"Collapse All Folders",expandAllFolders:"Expand All Folders",spaceTitle:"Add/Remove in Space",home:"Home",waypoints:"Waypoints",none:"None",tableView:"Table View",cardView:"Card View",boardView:"Board View",listView:"List View",flowView:"Flow View",groupBy:"Group",sortBy:"Sort",filters:"Filters",newFilter:"New Filter",clearFilters:"Clear Filters",hide:"Hide",unhideFields:"Unhide All Properties",importDataview:"Import All Dataview Properties",saveAllProperties:"Save All Properties to Files",mergeProperties:"Merge Properties",removeFromSpace:"Unpin from Space",removeFromWaypoints:"Unpin from Waypoints",editCode:"Edit Code",editProperties:"Edit Properties",properties:"Properties",deleteProperty:"Delete Property",hideProperty:"Hide Property",unhideProperty:"Unhide Property",saveProperty:"Save Property",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",deleteRow:"Delete Item",collapseAll:"Collapse All",customSort:"Custom Sort",groupSpaces:"Group Spaces",fileNameSortAlphaAsc:"File Name (A to Z)",fileNameSortAlphaDesc:"File Name (Z to A)",fileNameSortNumericalAsc:"File Name (1 to 9)",fileNameSortNumericalDesc:"File Name (9 to 1)",createdTimeSortAsc:"Created Time (new to old)",createdTimeSortDesc:"Created Time (old to new)",modifiedTimeSortAsc:"Modified Time (new to old)",modifiedTimeSortDesc:"Modified Time (old to new)",sizeSortAsc:"Size (smallest to largest)",sizeSortDesc:"Size (largest to smallest)",spaces:"Spaces",tags:"Tags",manageHiddenFiles:"Manage Hidden Files",manageActions:"Manage Actions",deleteSpace:"Delete",changeColor:"Change Color",changePropertyType:"Change Type",deleteFiles:"Delete Files",createFolderSpace:"Create Space from Folder",folder:"Folder",syncToContext:"Add Property to Context",setIcon:"Set Icon",copyEmbedLink:"Copy Embed Link",moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",groupNodes:"Group Nodes",moveFrame:"Move Frame",renameFrame:"Rename Frame",deleteFrame:"Delete Frame",insertAbove:"Insert Above",insertBelow:"Insert Below"},editor:{rows:"Rows",columns:"Columns",catalog:"Catalog",gallery:"Gallery",grid:"Grid",scaleToFit:"Change to Fit",scaleToFill:"Change to Fill",fit:"Fit",strokeNone:"None",strokeSolid:"Solid",strokeDotted:"Dotted",strokeDashed:"Dashed",size:"Size",gap:"Gap",marginLeft:"Left",marginTop:"Top",marginRight:"Right",marginBottom:"Bottom",minimize:"Minimize",paddingLeft:"Left",paddingTop:"Top",paddingRight:"Right",paddingBottom:"Bottom",unlinkProperty:"Unlink Property",linkedProperty:"Linked Property",linkProperty:"Link Property",currentSpace:"Current Space",linkName:"\${1} Link",linkThumbnail:"\${1} Thumbnail",linkSticker:"\${1} Sticker",opacity:"Opacity",shadowSpread:"Spread",shadowBlur:"Blur",width:"Width",height:"Height",margin:"Margin",padding:"Padding",bold:"Bold",italic:"Italic",underline:"Underline",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Align Justify",numberOfLines:"Lines",createVerticalSection:"Create Vertical Section",createHorizontalSection:"Create Horizontal Section",themeColors:"Theme Colors",uiColors:"UI Colors",hex:"Hex"},buttons:{add:"Add",alias:"Alias",addFilter:"Add Filter",loadMore:"Load More",addCondition:"Add Condition",customize:"Customize",moreOptions:"More Options",saveProperty:"Save Property",newNote:"New Note",changeIcon:"Change Sticker",removeIcon:"Remove Sticker",addIcon:"Add Sticker",addCover:"Add Cover",addDisplay:"Display Name",changeBanner:"Change Cover",changeBannerShort:"Cover",saveChanges:"Save Changes",removeBanner:"Remove Cover",rename:"Change Name",editFrame:"Edit Frame",saveSpace:"Save Space",createSpace:"New Space",createFolder:"New Folder",createNote:"New Note",createCanvas:"New Canvas",addIntoSpace:"New Pin",addSmartSearch:"Add Live Search",addItem:"Add Item",addProperty:"Add Property",editProperty:"Edit Property",addContext:"Add Context",cancel:"Cancel",search:"Search",delete:"Delete",toggleFlow:"Toggle Flow",openFlow:"Open Flow",hideFlow:"Hide Flow",openLink:"Open Link",addToSpace:"Add to Space",addToSpaceShort:"Pin",addTag:"Add Tag",tag:"Tag",syncFields:"Sync Properties",convertTable:"Convert to Markdown",cutTable:"Cut Table",deleteTable:"Delete From Note",blink:"Blink",addFile:"Add Item",merge:"Merge",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",deleteView:"Delete View",renameTable:"Rename Table",renameTag:"Rename Tag",createTag:"Create Tag",currentFolder:"Current Folder",sync:"Sync",pasteCSS:"Paste CSS",save:"Save",run:"Run"},metadataTypes:{fileName:"File Name",contexts:"Contexts",path:"Path",folder:"Folder",sticker:"Sticker",color:"Color",created:"Created",lastModified:"Last Modified",extension:"Extension",size:"Size",tags:"Tags",inlinks:"Linked Mentions",outlinks:"Links",label:"Label",fileMetadata:"File Metadata",frontmatter:"Frontmatter"},filterTypes:{contains:"contains",notContains:"does not contain",is:"is",isNot:"is not",before:"before",after:"on or after",anyOf:"is any of",noneOf:"is none of",checked:"is checked",unchecked:"is unchecked",isEmpty:"is empty",isNotEmpty:"is not empty",isSameDate:"is same date",isSameDateAsToday:"today"},sortTypes:{alphaAsc:"A to Z",alphaDesc:"Z to A",earliest:"Earliest",latest:"Latest",checkAsc:"Checked \\u2192 Unchecked",checkDesc:"Unchecked \\u2192 Checked",itemsAsc:"Least Items",itemsDesc:"Most Items"},properties:{defaultField:"Name",audio:{label:"Audio",description:"Audio"},text:{label:"Text",description:"Text field"},number:{label:"Number",description:"Number field with optional unit"},boolean:{label:"Yes/No",description:"Yes or No toggle to indicate the status"},date:{label:"Date",description:"Select a date from a calendar"},option:{label:"Option",description:"Select one or multiple option from a list"},file:{label:"File"},link:{label:"Link",description:"Link to another note or a website"},tags:{label:"Tags",description:"Use tags to quickly organize your items"},object:{label:"Object",description:"Store any complex objects"},context:{label:"Relation",description:"Connect to another context property and create a relation"},image:{label:"Image",description:"Select any image from your system or from the internet"},color:{label:"Color",description:"Use colors to label your items or status"},space:{label:"Context",description:"Link to a context"},icon:{label:"Sticker",description:"Use stickers to uniquely label your items or status"},super:{label:"Super Property",links:"Open Link",properties:"Update Property",api:"API",obsidianCommands:"Run Command",runCommand:"Run Command",performAction:"Perform Action",whenClicked:"When Clicked"},fileProperty:{name:"Name",label:"Formula",createdTime:"Created",modifiedTime:"Last Edited",sticker:"Sticker",links:"Links",tags:"Tags",spaces:"Spaces",extension:"Extension",size:"Size",preview:"Note Preview",parentFolder:"Folder",description:"Use a formula to dynamically display a property"}},views:{navigator:"Navigator",explorer:"Explorer",space:"Space"},subViews:{spaceItems:"Items",spaceContext:"Context",spaceLists:"Lists",spaceActions:"Actions",spaceTemplates:"Templates",smartSearch:"Live Searches",filesAndFolders:"Files and Folders"},labels:{duplicateTable:"Duplicate Table",pinned:"Pinned",live:"Pinned by Live Search",moveTable:"Move Table",editFormula:"Edit Formula",editObject:"Edit Object",properties:"Properties",newAction:"Action",newTable:"List",template:"Template",createFolder:"New Folder Name",rename:"Rename",createNew:"New",default:"Default",done:"Done",changeCoverShort:"Change",reposition:"Reposition",tables:"Tables",selectDateFormat:"Select/Type Date Format",renameSection:"Edit Space",createSection:"New Folder",createNote:"New Note",contextMaker:"Context Maker",select:"Select",pinnedItems:"Pinned Items",collapse:"Collapse",expand:"Expand",all:"All",none:"None",view:"View",findStickers:"Find Sticker",mergeProperties:"Merge Properties",placeholder:"Type '\${1}' for commands",notePlaceholder:"New Note for \${1}",itemsSelected:"\${1} Selected",selectNote:"Select Note",selectIcon:"Select Icon",selectImage:"Select Image",selectSpace:"Select Space",styleSmall:"Small",styleMedium:"Medium",styleLarge:"Large",hiddenFilePattern:"Name, Suffixes and Extension",hiddenFileSpecific:"Exclude specific files and folders",textPlaceholder:"Enter Text",noFile:"is not created yet. Click to create.",navigatorSearchPlaceholder:"Search by Text or Filters",blinkPlaceholder:"Quickly Search a File, Folder, Tag... Press Tab to Edit",searchPlaceholder:"Type to search...",contextItemSelectPlaceholder:"Find Item",linkItemSelectPlaceholder:"Find or Create Note",pinNotePlaceholder:"Select a Note or Space to Pin",optionItemSelectPlaceholder:"Select Option",viewItemSelectPlaceholder:"Select View",tagItemSelectPlaceholder:"Find Tag",spaceSelectPlaceholder:"Select any Folder or Tag",propertyItemSelectPlaceholder:"Select Property",sortItemSelectPlaceholder:"Select Sort",filterItemSelectPlaceholder:"Select Filter",imageSelectPlaceholder:"Select an image or paste a URL",imageNotFoundPlaceholder:"No Images Found",syncFrontmatterProperty:"Sync Frontmatter Property",newProperty:"New Property",newPropertyShort:"New Property",propertyType:"Type",propertyDynamic:"Dyanmic",propertyValueSpace:"Space",propertyValueProperty:"Property",propertyLookup:"Edit Formula",existingFrontmatter:"Existing Property",dateFormat:"Date Format",propertyFileProp:"Property",multiple:"Multiple",filesCount:"{$1} Files",hiddenFiles:"Hidden Files",addExtension:"Add Rule",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",renameTable:"Rename Table",syncMetadata:"Sync Metadata",syncProperties:"Sync Properties",selectContext:"Select Context",metadata:"Metadata",backlinks:"Backlinks",spaces:"Spaces",contexts:"Contexts",content:"Content",deleteSpace:"Delete Space",deleteFiles:"Delete Files",outgoingLinks:"Outgoing Links",moveTo:"Move to",addTo:"Pin to",copyTo:"Copy to",reorderIn:"Reorder in",border:"Border",corners:"Corners",color:"Color",backgroundColor:"Background",cornerRadius:"Radius",onClick:"On Click",layout:"Layout",element:"Element",name:"Name",display:"Display",alignment:"Alignment",margin:"Margin",padding:"Padding",gap:"Gap",width:"Width",height:"Height",opacity:"Opacity",shadow:"Shadow",shadowBlur:"Blur",shadowSpread:"Spread",typography:"Typography",layers:"Layers",fontSize:"Size",props:"Props",styles:"Styles",events:"Events",code:"Code",selectedLayers:"\${1} Layers"},descriptions:{spaceActions:"Create actions that runs when you press a button",spaceLists:"Create lists to track data and organize them in your space",spaceItems:"Add new items to the space or pin items to the space",spaceTemplates:"Create templates to quickly add items to your space",smartSearch:"Automatically pin notes to this space based on a set of searches",hiddenFileOptions:"Exclude any files and folders by name, suffix or extension.",deleteSpace:"Deleting the space will also delete the folder and its contents.",deleteFiles:"Delete \${1} files/folders and their contents?",addContext:"Contexts lets you connect properties from your tags",spaceProperties:"Define Properties for your Space Items",syncMetadata:"Select which fields from your notes to start syncing with the context.",syncProperties:"Contexts defines and syncs the same fields across your notes depending on their folder or tag.",selectContext:"Select which folder or tag context you want to sync the fields."},flowView:{emptyDoc:"Empty Document",itemsCount:" Items",emptyFolder:"This Folder is Empty"},notice:{duplicateFile:"Folder already contains note with same name",addedToSection:"Added to Space",fileExists:"File Already Exists",folderExists:"Folder Already Exists",noPropertyName:"Property Name is Required",noPropertiesFound:"No Properties Found",duplicatePropertyName:"Duplicate Property Name",newSpaceName:"Enter a name for your space",duplicateSpaceName:"Space name already exists",cantConvertNoteToSpace:"The view is not a note",templateSaved:"Template saved to space: ",tableDeleted:"Table removed from note, you can find the table in the folder space"},settings:{layoutVertical:"Vertical",layoutHorizontal:"Horizontal",sectionSidebar:"Spaces",sectionEditor:"Maker Mode",sectionFlow:"Flow",sectionAdvanced:"Advanced",sectionDataview:"Dataview",sectionContext:"Context",sectionStickers:"Stickers",sectionNavigator:"Navigator",sectionDefault:"Default Spaces",sectionSpaceView:"Space View",sectionBlink:"Blink",sectionInlineContext:"Inline Context",sectionFlowBlock:"Flow Block",sectionFlowMenu:"Flow Menu",sectionFlowStyler:"Flow Styler",experimental:{name:"Experimental",desc:"Experimental features that are subject to change and may not be optimized for performance"},generateThumbnails:{name:"Generate Thumbnails",desc:"Create thumbnails for images to speed up performance"},minimalThemeFix:{name:"Minimal Theme Fix",description:"Apply fixes for the popular theme Minimal"},inlineStickerMenu:{name:"Inline Stickers",desc:"Add inline stickers by typing :"},openSpacesOnLaunch:{name:"Open Spaces as Default Tab",desc:"Open the Spaces tab when Obsidian launches"},defaultSpaceTemplate:{name:"Default Space Template",desc:"Select the default template for new spaces"},defaultDateFormat:{name:"Default Date Format",desc:"Set the default date format, example: yyyy-MM-dd (see https://date-fns.org/v2.30.0/docs/format)"},newNotePlaceholder:{name:"New Note Placeholder",desc:"Default name for new notes"},folderIndentationLines:{name:"Show Folder Indentation Lines",desc:"Turn on to show a line on the left of folders to indicate indentation"},folderNoteLocation:{name:"Folder Note Location Inside Folder",desc:"Turn on to have folder notes inside the folder, turn off to have it outside"},folderViewDefault:{name:"Show Folder Note by Default",desc:"Show the folder note by default when opening a folder"},internalLinkFlowEditor:{name:"Show Toggles to Open Flow Editor on Links",desc:"Turn on to toggle Flow Blocks directly in inline links"},internalLinkSticker:{name:"Show Stickers on Links",desc:"Turn on to toggle stickers shown directly by beside internal links"},syncContextToFrontmatter:{name:"Sync Context Fields to Frontmatter",desc:"Turn on to automatically save all context fields to frontmatter fields, not just existing frontmatter fields."},syncFormulaToFrontmatter:{name:"Sync Formula Fields to Frontmatter",desc:"Turn on to save calculated formula values to frontmatter fields."},inlineBacklinks:{name:"Show Inline Backlinks (Inline Context required)",desc:"Show editable backlinks at the bottom of your notes"},dataviewInlineContext:{name:"Show Dataview in Inline Context",desc:"Show dataview when inline context is enabled"},inlineContextExplorer:{name:"Inline Context",desc:"Display the context and a banner at the top of your notes"},inlineContextProperties:{name:"Inline Context Properties",desc:"Show the properties in the inline context"},inlineContextExpanded:{name:"Auto Expand Inline Context",desc:"Expand the inline context sections when opening a note"},inlineContextHorizontal:{name:"Inline Title and Sticker Layout",desc:"Layout for inline title and sticker in Inline Context"},hideFrontmatter:{name:"Hide Context Properties",desc:"Hide properties you have addeed in context from the Obsidian properties panel"},openFileContext:{name:"Auto Open Explorer",desc:"Automatically open explorer panel in the right panel"},folderNote:{name:"Enable Folder Note",desc:"Access the folder note in the folder page and hide the folder note from spaces"},folderNoteName:{name:"Folder Note Name",desc:"Name of the folder note, keep blank to use the same name as the folder"},expandFolder:{name:"Auto Expand Folder",desc:"Auto expand folders on click"},hoverPreview:{name:"Preview on Hover",desc:"Preview on Hover while holding Control/Command key"},activeFile:{name:"Reveal Active File",desc:"Automatically reveal the active file in Spaces"},contexts:{name:"Contexts",desc:"Contexts allows you to have full control over the metadata of your files"},spaces:{name:"Navigator",desc:"The navigator lets you create and organize your spaces"},spacesStickers:{name:"Stickers",desc:"Use Emojis to make it easier to find your notes"},spacesAlias:{name:"Alias",desc:"Use the alias metadata to show in Spaces"},spacesFileExplorerDual:{name:"Compatibility Mode",desc:"This will improve the compatibility of plugins while using Spaces"},spacesDeleteOption:{name:"Delete File Option",desc:"Select how you want files to be deleted"},spacesDeleteOptions:{permanant:"Delete Permanently",trash:"Move to Obsidian Trash","system-trash":"Move to System Trash"},flowState:{name:"Flow State",desc:"Toggle the flow state"},hideRibbon:{name:"App Ribbon",desc:"Show/hide the left menu aka. ribbon"},spaceView:{name:"Space View",desc:"Open the space view when you click on a space"},defaultSpaces:{name:"Default Spaces",desc:"Recommended spaces for quickly organizing your vault"},homeSpace:{name:"Home Space",desc:"An easy-to-access space where you can add/organize your other spaces"},tagSpaces:{name:"Tag Spaces",desc:"Automatically create spaces for each of your tags"},readableLineWidth:{name:"Readable Line Width",desc:"Use Readable Line Width"},sidebarTabs:{name:"Sidebar Tabs",desc:"Show/hide other sidebar tabs"},spacesPerformance:{name:"Performance Mode",desc:"Turn on performance mode for Spaces, may affect scrolling appearance. Requires Restart"},indexSVG:{name:"Use SVGs as Stickers",desc:"Use any svg file in your vault as a sticker"},inlineStyler:{name:"Flow Styler",desc:"Select text to add styling"},inlineStylerColor:{name:"Text and Highlight Colors \\u{1F9EA}",desc:"Select text color and highlight color, (this may change in the future because of the limitations with HTML and Obsidian)"},spaceRowHeight:{name:"Row Height",desc:"The height for each row in spaces (in pixels), default is 29"},contextPagination:{name:"Table View Pagination",desc:"Number of items per page in table view"},coverHeight:{name:"Cover Height",desc:"The height for the cover of the note or space, default is 200"},makeChar:{name:"Flow Menu Trigger",desc:"Character to open the Flow Menu"},mobileMakeBar:{name:"Flow Styler (Mobile)",desc:"Replaces the mobile toolbar"},editorMarkSans:{name:"Mark Sans \\u{1F9EA}",desc:"Use the editor without Markdown."},editorMakerMode:{name:"Flow (Beta)",desc:"An integrated and intuitive editor experience"},editorMakePlacholder:{name:"Flow Menu Hint Text",desc:"Show a hint text on how to open the Flow Menu Shortcut"},blink:{name:"Blink",desc:"A faster way to search and edit your notes"},editorMakeMenu:{name:"Flow Menu",desc:"Open the Flow menu to quickly add content"},editorMakeMenuTrigger:{name:"Flow Menu Shortcut",desc:"Trigger key to use flow menu"},editorFlowReplace:{name:"Flow Block",desc:"Open your internal links or toggle your embeds in the flow block."},editorFlowStyle:{name:"Flow Block Style",desc:"Select a theme for your flow block",seamless:"Seamless",classic:"Classic",minimal:"Minimal"}}}};this.lang="en";let r=i5.default.locale();["en"].includes(r)&&(this.lang=r)}get texts(){return this.all.en}},Br=new TS().texts;var FS=e=>e.lastIndexOf("/")!=-1?e.lastIndexOf(".")!=-1?MA(e.substring(e.lastIndexOf("/")+1,e.lastIndexOf("."))):e.substring(e.lastIndexOf("/")+1):e.lastIndexOf(".")!=-1?e.substring(0,e.lastIndexOf(".")):e;var kZ=ma(um());var BZ=(e,r)=>{let t=n=>n=="builtin"?"Builtin":n=="api"?"Spaces":"Action";return[...(e.actionsIndex.get(r)??[]).map(n=>({name:n.schema.name,description:"Action",value:\`\${r}/#;\${n.schema.id}\`,section:"Action"}))??[],...[...e.cli.allCommands()].map(n=>({name:n.schema.name,description:t(n.schema.type),value:n.path,section:t(n.schema.type)}))]};var o5=({field:e,value:r})=>r=="ctime"?{value:"parseDate(prop('File')['metadata']['ctime'])",type:"date"}:{value:"",type:"string"},lx=(e,r,t,n)=>{let a=bc(e);if(a)return r=="fileprop"&&a.field?o5(a):(r=="option"&&a.source?.length>0&&(a.source=="$commands"?a.options=t.cli.allCommands():a.source=="$links"?a.options=t.spaceManager.allPaths().map(i=>({name:i,value:i})):a.source=="$super"?a.options=BZ(t,n):a.source=="$properties"&&(a.options=t.contextsIndex.get(n)?.contextTable?.cols?.map(i=>({name:i.name,value:i.name}))??[])),[...s5(r).configKeys??[],"alias","default"].reduce((i,s)=>({...i,[s]:a[s]}),{}));if(!r)return{};if(!a)if(r=="context")e?.length>0?a={space:e}:a={};else if(r.startsWith("date"))e?.length>0?a={format:e}:a={};else if(r.startsWith("fileprop"))if(e?.length>0){let[i,s]=e.split(".");a=o5({field:i,value:s})}else a={};else r.startsWith("option")&&(e?.length>0?a={options:gn(e).map(s=>({name:s,value:s}))}:a={});return a??{}};var s5=(e,r)=>r==Xn?Af.find(t=>t.type=="file"):r=="tags"?Af.find(t=>t.type=="tags-multi"):r=="aliases"?Af.find(t=>t.type=="option-multi"):r=="sticker"?Af.find(t=>e=="icon"):Af.find(t=>e==t.type)||Af.find(t=>e==t.multiType),Af=[{type:"unknown",label:"",restricted:!0,icon:"ui//file-question"},{type:"any",label:"",restricted:!0,icon:"ui//wildcard",multi:!0,multiType:"any-multi"},{type:"text",label:Br.properties.text.label,metadata:!0,icon:"ui//text",primative:!0,description:Br.properties.text.description},{type:"number",label:Br.properties.number.label,metadata:!0,icon:"ui//binary",configKeys:["unit"],primative:!0,description:Br.properties.number.description},{type:"boolean",label:Br.properties.boolean.label,metadata:!0,icon:"ui//check-square",primative:!0,description:Br.properties.boolean.description},{type:"date",label:Br.properties.date.label,metadata:!0,icon:"ui//calendar",configKeys:["format"],primative:!0,description:Br.properties.date.description},{type:"option",label:Br.properties.option.label,multi:!0,multiType:"option-multi",icon:"ui//list",configKeys:["options","source"],description:Br.properties.option.description},{type:"tags-multi",label:Br.properties.tags.label,icon:"ui//tags",description:Br.properties.tags.description},{type:"file",label:Br.properties.file.label,restricted:!0,icon:"ui//mk-make-h3"},{type:"fileprop",label:Br.properties.fileProperty.label,icon:"ui//formula",configKeys:["field","value","type"],description:Br.properties.fileProperty.description},{type:"link",label:Br.properties.link.label,multi:!0,multiType:"link-multi",metadata:!0,icon:"ui//file-text",primative:!0,description:Br.properties.link.description},{type:"context",label:Br.properties.context.label,icon:"ui//mk-make-note",multi:!0,multiType:"context-multi",configKeys:["space"],description:Br.properties.context.description},{type:"object",label:Br.properties.object.label,multi:!0,multiType:"object-multi",metadata:!0,icon:"ui//list-tree",configKeys:["type","typeName"],description:Br.properties.object.description},{type:"icon",label:Br.properties.icon.label,multi:!0,multiType:"icon-multi",icon:"ui//gem",restricted:!0,primative:!0,description:Br.properties.icon.description},{type:"image",label:Br.properties.image.label,multi:!0,multiType:"image-multi",metadata:!0,icon:"ui//mk-make-image",primative:!0,description:Br.properties.image.description},{type:"color",label:Br.properties.color.label,icon:"ui//mk-make-image",restricted:!0,description:Br.properties.color.description},{type:"space",label:Br.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Br.properties.space.description},{type:"table",label:Br.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Br.properties.space.description},{type:"super",label:Br.properties.super.label,icon:"ui//zap",restricted:!0,configKeys:["dynamic","field"]},{type:"input",label:Br.properties.super.label,icon:"ui//input",restricted:!0}];var li="files",dx={id:li,name:"Items",type:"db",primary:"true"},PZ="filesView",IZ={id:PZ,name:"All",type:"view",def:JSON.stringify({db:li,icon:"ui//file-stack"})},RZ="main",qZ=e=>({id:e,name:e,type:"frame",def:"",predicate:"",primary:"true"}),E4e={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[qZ(RZ),IZ]},mx={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[dx]},u5={uniques:["name,schemaId"],cols:["name","schemaId","type","value","attrs","hidden","unique","primary"]},px={...u5,rows:[{name:Xn,schemaId:li,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""},{name:Br.properties.fileProperty.createdTime,schemaId:li,type:"fileprop",value:Xn+".ctime",hidden:"",unique:"",attrs:"",primary:"true"}]};var T4e=[{name:Br.properties.defaultField,schemaId:"",type:"text",primary:"true"}],_S={...u5,rows:[{name:Xn,schemaId:li,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""}]};var F4e={schema:dx,cols:px.rows,rows:[]},_4e={schema:dx,cols:px.rows,rows:[]},O4e={schema:dx,cols:_S.rows,rows:[]},f5=(e,r)=>e.filter(t=>r.find(n=>n.id==t.schemaId&&n.type=="db")).reduce((t,n)=>({...t,...t[n.schemaId]?{[n.schemaId]:{uniques:n.unique=="true"?[...t[n.schemaId].uniques,n.name]:t[n.schemaId].uniques,cols:[...t[n.schemaId].cols,n.name],rows:[]}}:{[n.schemaId]:{uniques:n.unique=="true"?[n.name]:[],cols:[n.name],rows:[]}}}),{});var B4e={m_schema:mx,m_fields:px,...f5(px.rows,mx.rows)},P4e={m_schema:mx,m_fields:_S,...f5(_S.rows,mx.rows)};var OS="spaces://$tags";var pRe={name:Br.menu.waypoints,readOnly:!1,path:"spaces://$waypoints",label:{name:Br.menu.waypoints,thumbnail:"",sticker:"ui//tags",color:""},type:"default"},dRe={name:Br.menu.tags,readOnly:!1,path:"spaces://$tags",label:{thumbnail:"",name:Br.menu.tags,sticker:"ui//tags",color:""},type:"default"},hRe={name:Br.menu.vault,readOnly:!1,path:"/",label:{thumbnail:"",name:Br.menu.vault,sticker:"ui//vault",color:""},type:"default"};var c5=(e,r,t,n,a,i,s)=>{if(!t)return"";let l=new Map;Object.keys(a).forEach(o=>l.set(o,a[o])),l.set("$properties",n),l.set("$paths",r),i&&l.set("$current",i);let c;try{e.evaluate("current = _current()",l),c=e.evaluate(t,l),c=Ds("",c)}catch(o){if(c="",s)throw o;console.log(i,t,o)}return c};var BS=e=>{let r=new Map;e.filter(s=>s.type=="fileprop"||s.name.startsWith("tags")).forEach(s=>{let{value:l}=lx(s.value,s.type),c=[];try{let u=Wa(l).filter(m=>m.type=="FunctionNode").filter(m=>m.fn.name=="prop"&&m.args[0].type=="ConstantNode").map(m=>m.args[0]?.value);c.push(...u)}catch{}let o=s.name;r.has(o)||r.set(o,new Set);for(let u of c){let m=u;m!==o&&r.get(o).add(m)}});let t=new Set,n=[],a=new Set,i=s=>{if(a.has(s))throw new Error("Circular dependency detected");if(!t.has(s)){a.add(s);let l=r.get(s)||new Set;for(let c of l)i(c);t.add(s),a.delete(s),n.push(s)}};for(let s of e)t.has(s.name)||i(s.name);return n},l5=(e,r,t,n,a,i)=>{if(!t)return{};let s=i??BS(n),l=r.get(t[Xn])?.metadata?.property??{},c=Object.keys(l).filter(m=>n.some(d=>d.name==m)).reduce((m,d)=>({...m,[d]:Ds(d,l[d])}),{}),o=s.map(m=>n.find(d=>d.name==m)).filter(m=>m&&(m.type=="fileprop"||m.name=="tags")),u=n.reduce((m,d)=>({...m,[d.name]:d}),{});return{...t,...c,...o.reduce((m,d)=>{let{value:h}=lx(d.value,d.type);return{...m,[d.name]:c5(e,r,h,u,{...t,...m},a)}},{})}};var m5=(e,r)=>{let t=e?gn(e):[],n=r?gn(r):[];return n.every(a=>t.some(i=>i==a))&&t.every(a=>n.some(i=>i==a))},Mf=(e,r)=>e==r,PS=(e,r)=>(e??"").length==0,IS=(e,r)=>(e??"").toLowerCase().includes((r??"").toLowerCase()),RS=(e,r)=>parseFloat(e)>parseFloat(r),qS=(e,r)=>parseInt(e){let t=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),n=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return t.valueOf()>=n.valueOf()},d5=(e,r)=>{let t=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),n=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return t.valueOf(){let t=e?gn(e):[],n=r?gn(r):[];return t.length==0?!1:n.some(a=>t.some(i=>i==a))},h5=(e,r)=>{if(!e)return!1;let t=new Date(\`\${e.toString().replace(".",":")}\`),n=new Date(\`\${r}\`);return t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()},v5=e=>{if(!e)return!1;let r=new Date(\`\${e.toString()}T00:00\`),t=new Date;return r.getMonth()===t.getMonth()&&r.getDate()===t.getDate()};var Cf={isNotEmpty:{type:["text","file","number","option","option-multi","link","link-multi","image"],fn:(e,r)=>!PS(e,""),valueType:"none"},isEmpty:{type:["text","file","number","option","option-multi","link","link-multi","image"],fn:(e,r)=>PS(e,""),valueType:"none"},include:{fn:(e,r)=>IS(e,r),type:["text","file","link","image"],valueType:"text"},notInclude:{type:["text","file","link","image"],fn:(e,r)=>!IS(e,r),valueType:"text"},is:{type:["text"],fn:(e,r)=>Mf(e,r),valueType:"text"},isNot:{type:["text"],fn:(e,r)=>!Mf(e,r),valueType:"text"},equal:{type:["number"],fn:(e,r)=>Mf(e,r),valueType:"number"},isLink:{type:["link","context"],fn:(e,r)=>Mf(e,r),valueType:"link"},isNotLink:{type:["link","context"],fn:(e,r)=>!Mf(e,r),valueType:"link"},isGreatThan:{type:["number"],fn:(e,r)=>RS(e,r),valueType:"number"},isLessThan:{type:["number"],fn:(e,r)=>qS(e,r),valueType:"number"},isLessThanOrEqual:{type:["number"],fn:(e,r)=>!RS(e,r),valueType:"number"},isGreatThanOrEqual:{type:["number"],fn:(e,r)=>!qS(e,r),valueType:"number"},dateBefore:{type:["date"],fn:(e,r)=>d5(e,r),valueType:"date"},dateAfter:{type:["date"],fn:(e,r)=>p5(e,r),valueType:"date"},isSameDate:{type:["date"],fn:(e,r)=>h5(e,r),valueType:"date"},isSameDateAsToday:{type:["date"],fn:(e,r)=>v5(e,r),valueType:"none"},isExactList:{type:["option","option-multi","link-multi","context-multi","tags-multi"],fn:(e,r)=>m5(e,r),valueType:"list"},isAnyInList:{type:["option","context","link","option-multi","link-multi","context-multi","tags-multi"],fn:(e,r)=>kS(e,r),valueType:"list"},isNoneInList:{type:["option","context","link","option-multi","link-multi","context-multi","tags-multi"],fn:(e,r)=>!kS(e,r),valueType:"list"},isTrue:{type:["boolean"],fn:(e,r)=>e=="true",valueType:"none"},isFalse:{type:["boolean"],fn:(e,r)=>e!="true",valueType:"none"}};var zZ=(e,r,t)=>r.reduce((a,i)=>{let[s,l]=a,c=i.type=="context"?g5(l,i,t):i.type=="path"?x5(l,i,t):i.type=="frontmatter"?y5(l,i,t):b5(l,i,t),o=l.filter(u=>!c.includes(u));return[[...s,...c],o]},[[],e])[0],UZ=(e,r,t)=>r.reduce((n,a)=>a.type=="context"?g5(n,a,t):a.type=="path"?x5(n,a,t):a.type=="frontmatter"?y5(n,a,t):b5(n,a,t),e),g5=(e,r,t)=>{let n=Cf[r.fn];return!n||n.valueType!="none"&&r.value.length==0?[]:e.filter(a=>{let[i,s]=r.field.split("."),l=a.metadata?.property;if(!a.spaces?.includes(i)||!l||!l[s])return!1;let c=!0;if(n){let o=r.fType=="property"?t[r.value]:r.value;c=n.fn(Ds(s,l[s]),o)}return c})},y5=(e,r,t)=>{let n=Cf[r.fn];return!n||n.valueType!="none"&&r.value.length==0?[]:e.filter(a=>{let i=a.metadata?.property;if(!i||i[r.field]===void 0)return!1;let s=!0;if(n){let l=r.fType=="property"?t[r.value]:r.value;s=n.fn(Ds(r.field,i[r.field]),l)}return s})},x5=(e,r,t)=>{let n=Cf[r.fn];return!n||n.valueType!="none"&&r.value.length==0?[]:e.filter(a=>{let i="";r.field=="outlinks"?i=ws(a.outlinks??[]):r.field=="inlinks"?i=ws(a.metadata?.inlinks??[]):r.field=="tags"&&(i=ws(a.tags??[]));let s=!0;if(n){let l=r.fType=="property"?t[r.value]:r.value;s=n.fn(i,l)}return s})},b5=(e,r,t)=>{let n=Cf[r.fn];return!n||n.valueType!="none"&&r.value.length==0?[]:e.filter(a=>{let i=!0;if(n){let s=r.fType=="property"?t[r.value]:r.value;i=n.fn(a.metadata?.[r.type]?.[r.field],s)}return i})},w5=(e,r,t)=>e.reduce((a,i)=>!a||i.filters.length==0?!1:i.type=="any"?zZ([r],i.filters,t).length>0:UZ([r],i.filters,t).length>0,!0);var D5=(e,r)=>e.hiddenExtensions.some(t=>r.endsWith(t))||r.startsWith(e.spacesFolder+"/#")||e.hiddenFiles.some(t=>t==r);var S5=(e,r,t,n,a,i)=>{let s={};if(!e)return{changed:!1,cache:null};if(!r)return{changed:!1,cache:{path:e.path,schemas:[],outlinks:[],contexts:[],paths:[],contextTable:null,spaceMap:s,dbExists:!1}};let l=Object.values(r).map(N=>N.schema),c=r[li]?.rows?.map(N=>N[Xn])??[],o=t.filter(N=>!c.includes(N)),u=[...NA(t??[],c),...o],m=BS(r[li].cols),d=[...r[li].rows.filter(N=>t.includes(N[Xn])),...o.map(N=>({[Xn]:N}))].map(N=>l5(i,a,N,r[li].cols,a.get(e.path),m)),h={...r[li],rows:d},y=h.cols?.filter(N=>N.type.startsWith("context"))??[],v=h.cols?.filter(N=>N.type.startsWith("link"))??[],x=pa(y.map(N=>N.value));y.forEach(N=>{s[N.name]={},h.rows.forEach(M=>{gn(M[N.name]).forEach(S=>s[N.name][S]=[...s[N.name][S]??[],M[Xn]])})});let w=pa(h.rows.reduce((N,M)=>pa([...N,...[...y,...v].flatMap(S=>gn(M[S.name]).map(O=>wc(O)))]),[])),C={contextTable:h,path:e.path,contexts:x,outlinks:w,paths:u,schemas:l,spaceMap:s,dbExists:n},b=!1;return LS.default.isEqual(h,r)||(b=!0),{changed:b,cache:C}},N5=(e,r,t,n)=>{let a={};for(let[i,s]of e){let l=r.enableFolderNote?t.get(i)?.space.notePath??i:i,c=e.get(l)??s;if(!s)continue;let o=s?.parent??"",u=s?.type??"",m=s?.subtype??"",d=c?.label,h=n?.get(i),{changed:y,cache:v}=zS(i,r,t,c,d,u,m,o,h);a[i]={changed:y,cache:v}}return a},zS=(e,r,t,n,a,i,s,l,c)=>{let o=(W,k,q)=>W?.length>0||W?.length>0?W:k=="space"?q=="Spaces/Home"?"ui//home":q=="/"?"ui//vault":q.startsWith("spaces://")?"ui//tags":"ui//folder":"ui//file",u={label:n?.label,path:e,name:FS(e),readOnly:n?.readOnly},m=[],d=n?.tags?.map(W=>W)??[],h=D5(r,e),y=(W,k,q=new Set)=>{let K=[];for(let z of k){let oe=W.get(z)?.contexts??[];for(let le of oe)q.has(le)||(K.push(le),q.add(le),K.push(...y(W,[xc(le)],q)))}return K};if(t.has(l))for(let W of t.get(l).contexts??[])m.push(W);m.push(...d);let v=a?.name,x=n?.property?sm(n.property[r.fmKeyAlias]):[],w=o(a?.sticker,i,e),C=a?.color??"",b=n?.resolvedLinks??[],N=!1,M,S={...u,name:v,tags:pa(m),type:i,subtype:s,parent:l,label:{name:r.spacesUseAlias&&x?.length>0?x[0]:v,sticker:w,color:C,thumbnail:a?.thumbnail??"",preview:a?.preview??""},metadata:{...n},outlinks:b},O=[],_=[],E=[];s=="tag"&&O.push(OS);for(let W of m)O.push(xc(W));let T=new Set,R=(W,k)=>{if(!T.has(W)){if(T.add(W),k.dependencies?.length>0)for(let q of k.dependencies)t.has(q)&&R(q,t.get(q));if(k.space.notePath==e&&k.path!=k.space.notePath&&(N=!0,M=k.path,h=!0),s!="tag"&&s!="default"&&k.space&&k.space.path==l){O.push(W);return}if(k.metadata?.filters?.length>0&&w5(k.metadata.filters,{...S,spaces:O},k.properties)){O.push(W),E.push(W);return}if(k.metadata?.links?.length>0&&(k.metadata?.links??[]).find(K=>K==S.path)){O.push(W),_.push(W);return}}};for(let[W,k]of t)R(W,k);let L=y(t,O);O.push(...L.map(W=>xc(W))),S.tags.push(...L),N&&(S.metadata.spacePath=M);let H=h?{...S,spaces:[],hidden:h}:{...S,spaces:pa(O),linkedSpaces:_,liveSpaces:E,hidden:h},V=!0;return c&&LS.default.isEqual(H,c)&&(V=!1),{changed:V,cache:H}};function A5(e){let{path:r,settings:t,spacesCache:n,pathMetadata:a,label:i,type:s,subtype:l,parent:c,oldMetadata:o}=e;return zS(r,t,n,a,i,s,l,c,o)}function US(e,r){let{space:t,mdb:n,paths:a,dbExists:i,pathsIndex:s}=e;return S5(t,n,a,i,s,r)}function M5(e,r){let{map:t,pathsIndex:n}=e,a=new Map;for(let[i,s]of t)a.set(i,US({...s,pathsIndex:n},r));return a}function C5(e){let{pathCache:r,settings:t,spacesCache:n,oldMetadata:a}=e;return N5(r,t,n,a)}var WZ=self,YZ={...AS,createAdd:F("add",[],()=>function(r,t){return r+t}),createEqual:F("equal",[],()=>function(r,t){return r==t}),createUnequal:F("unequal",[],()=>function(r,t){return r!=t})},HZ={matrix:"Array"},WS=cx(YZ,HZ);WS.import(Lb,{override:!0});WZ.onmessage=async e=>{let{payload:r,job:t}=e.data,n;t.type=="path"?n=A5(r):t.type=="context"?n=US(r,WS):t.type=="contexts"?n=M5(r,WS):t.type=="paths"&&(n=C5(r));try{postMessage({job:t,result:n})}catch(a){console.log(a),postMessage({job:t,result:{$error:\`Failed to index \${t.type} \${t.path}: \${a}\`}})}}; +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"]};var f3={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"]};var c3={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"]};var l3={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","sum","variance"]};var m3={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"]};var p3={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"]};var d3={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"]};var h3={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"]};var v3={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"]};var g3={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent 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"]};var y3={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"]};var x3={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as \`acsch(x) = ln(1/x + sqrt(1/x^2 + 1))\`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]};var b3={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"]};var w3={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]};var D3={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"]};var S3={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"]};var N3={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"]};var A3={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"]};var M3={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"]};var C3={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"]};var E3={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]};var T3={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"]};var F3={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"]};var _3={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"]};var O3={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"]};var B3={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"]};var P3={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"]};var I3={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"]};var R3={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]};var q3={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"]};var k3={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"]};var L3={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:[]};var z3={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]};var U3={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:[]};var W3={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"]};var Y3={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"]};var H3={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]};var $3={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"]};var G3={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"]};var V3={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"]};var Z3={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"]};var Q3={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"]};var 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"]};var J3={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"]};var K3={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]};var j3={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]};var eB={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"]};var rB={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"]};var tB={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"]};var nB={bignumber:VT,boolean:ZT,complex:QT,createUnit:XT,fraction:JT,index:KT,matrix:jT,number:eF,sparse:rF,splitUnit:tF,string:nF,unit:aF,e:DD,E:DD,false:OT,i:BT,Infinity:PT,LN2:RT,LN10:IT,LOG2E:kT,LOG10E:qT,NaN:LT,null:zT,pi:SD,PI:SD,phi:UT,SQRT1_2:WT,SQRT2:YT,tau:HT,true:$T,version:GT,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",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh 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:"Borh 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:uF,lsolve:cF,lsolveAll:lF,lup:mF,lusolve:pF,leafCount:fF,polynomialRoot:dF,resolve:gF,simplify:yF,simplifyConstant:xF,simplifyCore:bF,symbolicEqual:DF,rationalize:vF,slu:wF,usolve:SF,usolveAll:NF,qr:hF,abs:AF,add:MF,cbrt:CF,ceil:EF,cube:TF,divide:FF,dotDivide:_F,dotMultiply:OF,dotPow:BF,exp:PF,expm:IF,expm1:RF,fix:qF,floor:kF,gcd:LF,hypot:zF,lcm:WF,log:YF,log2:GF,log1p:$F,log10:HF,mod:VF,multiply:ZF,norm:QF,nthRoot:XF,nthRoots:JF,pow:KF,round:jF,sign:e_,sqrt:r_,sqrtm:t_,square:o_,subtract:s_,unaryMinus:u_,unaryPlus:f_,xgcd:c_,invmod:UF,bitAnd:l_,bitNot:m_,bitOr:p_,bitXor:d_,leftShift:h_,rightArithShift:v_,rightLogShift:g_,bellNumbers:y_,catalan:x_,composition:b_,stirlingS2:w_,config:iF,import:oF,typed:sF,arg:D_,conj:S_,re:A_,im:N_,evaluate:M_,help:C_,distance:E_,intersect:T_,and:F_,not:__,or:O_,xor:B_,concat:I_,count:R_,cross:q_,column:P_,ctranspose:k_,det:L_,diag:z_,diff:U_,dot:W_,getMatrixDataType:V_,identity:Z_,filter:H_,flatten:$_,forEach:G_,inv:Q_,pinv:X_,eigs:Y_,kron:J_,matrixFromFunction:eO,matrixFromRows:rO,matrixFromColumns:j_,map:K_,ones:tO,partitionSelect:nO,range:aO,resize:oO,reshape:iO,rotate:sO,rotationMatrix:uO,row:fO,size:cO,sort:lO,squeeze:mO,subset:pO,trace:dO,transpose:hO,zeros:vO,fft:gO,ifft:yO,sylvester:n_,schur:a_,lyap:i_,solveODE:tB,combinations:xO,combinationsWithRep:bO,factorial:wO,gamma:DO,kldivergence:NO,lgamma:SO,multinomial:AO,permutations:MO,pickRandom:CO,random:EO,randomInt:TO,compare:FO,compareNatural:_O,compareText:OO,deepEqual:BO,equal:PO,equalText:IO,larger:RO,largerEq:qO,smaller:kO,smallerEq:LO,unequal:zO,setCartesian:UO,setDifference:WO,setDistinct:YO,setIntersect:HO,setIsSubset:$O,setMultiplicity:GO,setPowerset:VO,setSize:ZO,setSymDifference:QO,setUnion:XO,zpk2tf:JO,freqz:KO,erf:jO,zeta:e3,cumsum:c3,mad:r3,max:t3,mean:n3,median:a3,min:i3,mode:o3,prod:s3,quantileSeq:u3,std:f3,sum:l3,variance:m3,corr:p3,acos:d3,acosh:h3,acot:v3,acoth:g3,acsc:y3,acsch:x3,asec:b3,asech:w3,asin:D3,asinh:S3,atan:N3,atanh:M3,atan2:A3,cos:C3,cosh:E3,cot:T3,coth:F3,csc:_3,csch:O3,sec:B3,sech:P3,sin:I3,sinh:R3,tan:q3,tanh:k3,to:L3,clone:U3,format:W3,bin:z3,oct:j3,hex:H3,isNaN:G3,isInteger:$3,isNegative:V3,isNumeric:Z3,hasNumericValue:Y3,isPositive:Q3,isPrime:X3,isZero:J3,print:eB,typeOf:rB,numeric:K3};var aB="help",bG=["typed","mathWithTransform","Help"],dg=F(aB,bG,e=>{var{typed:r,mathWithTransform:t,Help:n}=e;return r(aB,{any:function(i){var s,l=i;if(typeof i!="string"){for(s in t)if(Xe(t,s)&&i===t[s]){l=s;break}}var c=wt(nB,l);if(!c){var o=typeof l=="function"?l.name:l;throw new Error('No documentation found on "'+o+'"')}return new n(c)}})});var iB="chain",wG=["typed","Chain"],hg=F(iB,wG,e=>{var{typed:r,Chain:t}=e;return r(iB,{"":function(){return new t},any:function(a){return new t(a)}})});var oB="det",DG=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],vg=F(oB,DG,e=>{var{typed:r,matrix:t,subtractScalar:n,multiply:a,divideScalar:i,isZero:s,unaryMinus:l}=e;return r(oB,{any:function(u){return ar(u)},"Array | Matrix":function(u){var m;switch(Qe(u)?m=u.size():Array.isArray(u)?(u=t(u),m=u.size()):m=[],m.length){case 0:return ar(u);case 1:if(m[0]===1)return ar(u.valueOf()[0]);if(m[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(m)+")");case 2:{var d=m[0],h=m[1];if(d===h)return c(u.clone().valueOf(),d,h);if(h===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(m)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(m)+")")}}});function c(o,u,m){if(u===1)return ar(o[0][0]);if(u===2)return n(a(o[0][0],o[1][1]),a(o[1][0],o[0][1]));for(var d=!1,h=new Array(u).fill(0).map((O,_)=>_),y=0;y{var{typed:r,matrix:t,divideScalar:n,addScalar:a,multiply:i,unaryMinus:s,det:l,identity:c,abs:o}=e;return r(sB,{"Array | Matrix":function(d){var h=Qe(d)?d.size():ur(d);switch(h.length){case 1:if(h[0]===1)return Qe(d)?t([n(1,d.valueOf()[0])]):[n(1,d[0])];throw new RangeError("Matrix must be square (size: "+lr(h)+")");case 2:{var y=h[0],v=h[1];if(y===v)return Qe(d)?t(u(d.valueOf(),y,v),d.storage()):u(d,y,v);throw new RangeError("Matrix must be square (size: "+lr(h)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(h)+")")}},any:function(d){return n(1,d)}});function u(m,d,h){var y,v,x,w,C;if(d===1){if(w=m[0][0],w===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,w)]]}else if(d===2){var b=l(m);if(b===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(m[1][1],b),n(s(m[0][1]),b)],[n(s(m[1][0]),b),n(m[0][0],b)]]}else{var N=m.concat();for(y=0;yO&&(O=o(N[y][S]),_=y),y++;if(O===0)throw Error("Cannot calculate inverse, determinant is zero");y=_,y!==S&&(C=N[S],N[S]=N[y],N[y]=C,C=M[S],M[S]=M[y],M[y]=C);var E=N[S],T=M[S];for(y=0;y{var{typed:r,matrix:t,inv:n,deepEqual:a,equal:i,dotDivide:s,dot:l,ctranspose:c,divideScalar:o,multiply:u,add:m,Complex:d}=e;return r(uB,{"Array | Matrix":function(b){var N=Qe(b)?b.size():ur(b);switch(N.length){case 1:return w(b)?c(b):N[0]===1?n(b):s(c(b),l(b,b));case 2:{if(w(b))return c(b);var M=N[0],S=N[1];if(M===S)try{return n(b)}catch(O){if(!(O instanceof Error&&O.message.match(/Cannot calculate inverse, determinant is zero/)))throw O}return Qe(b)?t(h(b.valueOf(),M,S),b.storage()):h(b,M,S)}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(N)+")")}},any:function(b){return i(b,0)?ar(b):o(1,b)}});function h(C,b,N){var{C:M,F:S}=v(C,b,N),O=u(n(u(c(M),M)),c(M)),_=u(c(S),n(u(S,c(S))));return u(_,O)}function y(C,b,N){for(var M=ar(C),S=0,O=0;O_.filter((T,R)=>R!x(l(M[E],M[E])));return{C:S,F:O}}function x(C){return i(m(C,d(1,1)),m(0,d(1,1)))}function w(C){return a(m(C,d(1,1)),m(u(C,0),d(1,1)))}});function fB(e){var{addScalar:r,subtract:t,flatten:n,multiply:a,multiplyScalar:i,divideScalar:s,sqrt:l,abs:c,bignumber:o,diag:u,size:m,reshape:d,inv:h,qr:y,usolve:v,usolveAll:x,equal:w,complex:C,larger:b,smaller:N,matrixFromColumns:M,dot:S}=e;function O(ae,$,me,Ee){var pe=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,ge=_(ae,$,me,Ee,pe);E(ae,$,me,Ee,pe,ge);var{values:Se,C:ye}=T(ae,$,me,Ee,pe);if(pe){var be=R(ae,$,ye,ge,Se,me,Ee);return{values:Se,eigenvectors:be}}return{values:Se}}function _(ae,$,me,Ee,pe){var ge=Ee==="BigNumber",Se=Ee==="Complex",ye=ge?o(0):0,be=ge?o(1):Se?C(1):1,De=ge?o(1):1,Ae=ge?o(10):2,We=i(Ae,Ae),Je;pe&&(Je=Array($).fill(be));for(var J=!1;!J;){J=!0;for(var re=0;re<$;re++){for(var xe=ye,j=ye,ne=0;ne<$;ne++)re!==ne&&(xe=r(xe,c(ae[ne][re])),j=r(j,c(ae[re][ne])));if(!w(xe,0)&&!w(j,0)){for(var ue=De,Me=xe,Ce=s(j,Ae),Le=i(j,Ae);N(Me,Ce);)Me=i(Me,We),ue=i(ue,Ae);for(;b(Me,Le);)Me=s(Me,We),ue=s(ue,Ae);var Ie=N(s(r(Me,j),ue),i(r(xe,j),.95));if(Ie){J=!1;for(var fr=s(1,ue),or=0;or<$;or++)re!==or&&(ae[re][or]=i(ae[re][or],fr),ae[or][re]=i(ae[or][re],ue));pe&&(Je[re]=i(Je[re],fr))}}}}return pe?u(Je):null}function E(ae,$,me,Ee,pe,ge){var Se=Ee==="BigNumber",ye=Ee==="Complex",be=Se?o(0):ye?C(0):0;Se&&(me=o(me));for(var De=0;De<$-2;De++){for(var Ae=0,We=be,Je=De+1;Je<$;Je++){var J=ae[Je][De];N(c(We),c(J))&&(We=J,Ae=Je)}if(!N(c(We),me)){if(Ae!==De+1){var re=ae[Ae];ae[Ae]=ae[De+1],ae[De+1]=re;for(var xe=0;xe<$;xe++){var j=ae[xe][Ae];ae[xe][Ae]=ae[xe][De+1],ae[xe][De+1]=j}if(pe){var ne=ge[Ae];ge[Ae]=ge[De+1],ge[De+1]=ne}}for(var ue=De+2;ue<$;ue++){var Me=s(ae[ue][De],We);if(Me!==0){for(var Ce=0;Ce<$;Ce++)ae[ue][Ce]=t(ae[ue][Ce],i(Me,ae[De+1][Ce]));for(var Le=0;Le<$;Le++)ae[Le][De+1]=r(ae[Le][De+1],i(Me,ae[Le][ue]));if(pe)for(var Ie=0;Ie<$;Ie++)ge[ue][Ie]=t(ge[ue][Ie],i(Me,ge[De+1][Ie]))}}}}return ge}function T(ae,$,me,Ee,pe){var ge=Ee==="BigNumber",Se=Ee==="Complex",ye=ge?o(1):Se?C(1):1;ge&&(me=o(me));for(var be=ar(ae),De=[],Ae=$,We=[],Je=pe?u(Array($).fill(ye)):void 0,J=pe?u(Array(Ae).fill(ye)):void 0,re=0;re<=100;){re+=1;for(var xe=be[Ae-1][Ae-1],j=0;j1&&(J=u(Array(Ae-1).fill(ye)))),Ae-=1,be.pop();for(var Ce=0;Ce2&&(J=u(Array(Ae-2).fill(ye)))),Ae-=2,be.pop(),be.pop();for(var Ie=0;Ie+t(c(Ke),c(Pr))),re>100){var fr=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+De.join(", "));throw fr.values=De,fr.vectors=[],fr}var or=pe?a(Je,W(We,$)):void 0;return{values:De,C:or}}function R(ae,$,me,Ee,pe,ge,Se){var ye=h(me),be=a(ye,ae,me),De=Se==="BigNumber",Ae=Se==="Complex",We=De?o(0):Ae?C(0):0,Je=De?o(1):Ae?C(1):1,J=[],re=[];for(var xe of pe){var j=k(J,xe,w);j===-1?(J.push(xe),re.push(1)):re[j]+=1}for(var ne=[],ue=J.length,Me=Array($).fill(We),Ce=u(Array($).fill(Je)),Le=function(){var or=J[Ie],Ke=t(be,a(or,Ce)),Pr=x(Ke,Me);for(Pr.shift();Pr.lengtha(ce,we)),ne.push(...Pr.map(we=>({value:or,vector:n(we)})))},Ie=0;Ie=5)return null;for(ye=0;;){var be=v(ae,Se);if(N(oe(z(Se,[be])),Ee))break;if(++ye>=10)return null;Se=le(be)}return Se}function K(ae,$,me){var Ee=me==="BigNumber",pe=me==="Complex",ge=Array(ae).fill(0).map(Se=>2*Math.random()-1);return Ee&&(ge=ge.map(Se=>o(Se))),pe&&(ge=ge.map(Se=>C(Se))),ge=z(ge,$),le(ge,me)}function z(ae,$){var me=m(ae);for(var Ee of $)Ee=d(Ee,me),ae=t(ae,a(s(S(Ee,ae),S(Ee,Ee)),Ee));return ae}function oe(ae){return c(l(S(ae,ae)))}function le(ae,$){var me=$==="BigNumber",Ee=$==="Complex",pe=me?o(1):Ee?C(1):1;return a(s(pe,oe(ae)),ae)}return O}function cB(e){var{config:r,addScalar:t,subtract:n,abs:a,atan:i,cos:s,sin:l,multiplyScalar:c,inv:o,bignumber:u,multiply:m,add:d}=e;function h(E,T){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.epsilon,L=arguments.length>3?arguments[3]:void 0,H=arguments.length>4?arguments[4]:void 0;if(L==="number")return y(E,R,H);if(L==="BigNumber")return v(E,R,H);throw TypeError("Unsupported data type: "+L)}function y(E,T,R){var L=E.length,H=Math.abs(T/L),V,W;if(R){W=new Array(L);for(var k=0;k=Math.abs(H);){var K=q[0][0],z=q[0][1];V=x(E[K][K],E[z][z],E[K][z]),E=M(E,V,K,z),R&&(W=C(W,V,K,z)),q=S(E)}for(var oe=Array(L).fill(0),le=0;le=a(H);){var K=q[0][0],z=q[0][1];V=w(E[K][K],E[z][z],E[K][z]),E=N(E,V,K,z),R&&(W=b(W,V,K,z)),q=O(E)}for(var oe=Array(L).fill(0),le=0;le({value:H[$],vector:ae}));return{values:H,eigenvectors:le}}return h}var AG="eigs",MG=["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"],xg=F(AG,MG,e=>{var{config:r,typed:t,matrix:n,addScalar:a,subtract:i,equal:s,abs:l,atan:c,cos:o,sin:u,multiplyScalar:m,divideScalar:d,inv:h,bignumber:y,multiply:v,add:x,larger:w,column:C,flatten:b,number:N,complex:M,sqrt:S,diag:O,size:_,reshape:E,qr:T,usolve:R,usolveAll:L,im:H,re:V,smaller:W,matrixFromColumns:k,dot:q}=e,K=cB({config:r,addScalar:a,subtract:i,column:C,flatten:b,equal:s,abs:l,atan:c,cos:o,sin:u,multiplyScalar:m,inv:h,bignumber:y,complex:M,multiply:v,add:x}),z=fB({config:r,addScalar:a,subtract:i,multiply:v,multiplyScalar:m,flatten:b,divideScalar:d,sqrt:S,abs:l,bignumber:y,diag:O,size:_,reshape:E,qr:T,inv:h,usolve:R,usolveAll:L,equal:s,complex:M,larger:w,smaller:W,matrixFromColumns:k,dot:q});return t("eigs",{Array:function(ge){return oe(n(ge))},"Array, number|BigNumber":function(ge,Se){return oe(n(ge),{precision:Se})},"Array, Object"(pe,ge){return oe(n(pe),ge)},Matrix:function(ge){return oe(ge,{matricize:!0})},"Matrix, number|BigNumber":function(ge,Se){return oe(ge,{precision:Se,matricize:!0})},"Matrix, Object":function(ge,Se){var ye={matricize:!0};return ht(ye,Se),oe(ge,ye)}});function oe(pe){var ge,Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ye="eigenvectors"in Se?Se.eigenvectors:!0,be=(ge=Se.precision)!==null&&ge!==void 0?ge:r.epsilon,De=le(pe,be,ye);return Se.matricize&&(De.values=n(De.values),ye&&(De.eigenvectors=De.eigenvectors.map(Ae=>{var{value:We,vector:Je}=Ae;return{value:We,vector:n(Je)}}))),ye&&Object.defineProperty(De,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),De}function le(pe,ge,Se){var ye=pe.toArray(),be=pe.size();if(be.length!==2||be[0]!==be[1])throw new RangeError("Matrix must be square (size: ".concat(lr(be),")"));var De=be[0];if($(ye,De,ge)&&(me(ye,De),ae(ye,De,ge))){var Ae=Ee(pe,ye,De);return K(ye,De,ge,Ae,Se)}var We=Ee(pe,ye,De);return z(ye,De,ge,We,Se)}function ae(pe,ge,Se){for(var ye=0;ye{var{typed:r,abs:t,add:n,identity:a,inv:i,multiply:s}=e;return r(lB,{Matrix:function(m){var d=m.size();if(d.length!==2||d[0]!==d[1])throw new RangeError("Matrix must be square (size: "+lr(d)+")");for(var h=d[0],y=1e-15,v=l(m),x=c(v,y),w=x.q,C=x.j,b=s(m,Math.pow(2,-C)),N=a(h),M=a(h),S=1,O=b,_=-1,E=1;E<=w;E++)E>1&&(O=s(O,b),_=-_),S=S*(w-E+1)/((2*w-E+1)*E),N=n(N,s(S,O)),M=n(M,s(S*_,O));for(var T=s(i(M),N),R=0;R{var{typed:r,abs:t,add:n,multiply:a,map:i,sqrt:s,subtract:l,inv:c,size:o,max:u,identity:m}=e,d=1e3,h=1e-6;function y(v){var x,w=0,C=v,b=m(o(v));do{var N=C;if(C=a(.5,n(N,c(b))),b=a(.5,n(b,c(N))),x=u(t(l(C,N))),x>h&&++w>d)throw new Error("computing square root of matrix: iterative method could not converge")}while(x>h);return C}return r(mB,{"Array | Matrix":function(x){var w=Qe(x)?x.size():ur(x);switch(w.length){case 1:if(w[0]===1)return i(x,s);throw new RangeError("Matrix must be square (size: "+lr(w)+")");case 2:{var C=w[0],b=w[1];if(C===b)return y(x);throw new RangeError("Matrix must be square (size: "+lr(w)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+lr(w)+")")}}})});var pB="sylvester",TG=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],Dg=F(pB,TG,e=>{var{typed:r,schur:t,matrixFromColumns:n,matrix:a,multiply:i,range:s,concat:l,transpose:c,index:o,subset:u,add:m,subtract:d,identity:h,lusolve:y,abs:v}=e;return r(pB,{"Matrix, Matrix, Matrix":x,"Array, Matrix, Matrix":function(C,b,N){return x(a(C),b,N)},"Array, Array, Matrix":function(C,b,N){return x(a(C),a(b),N)},"Array, Matrix, Array":function(C,b,N){return x(a(C),b,a(N))},"Matrix, Array, Matrix":function(C,b,N){return x(C,a(b),N)},"Matrix, Array, Array":function(C,b,N){return x(C,a(b),a(N))},"Matrix, Matrix, Array":function(C,b,N){return x(C,b,a(N))},"Array, Array, Array":function(C,b,N){return x(a(C),a(b),a(N)).toArray()}});function x(w,C,b){for(var N=C.size()[0],M=w.size()[0],S=t(w),O=S.T,_=S.U,E=t(i(-1,C)),T=E.T,R=E.U,L=i(i(c(_),b),R),H=s(0,M),V=[],W=(Ae,We)=>l(Ae,We,1),k=(Ae,We)=>l(Ae,We,0),q=0;q1e-5){for(var K=k(u(L,o(H,q)),u(L,o(H,q+1))),z=0;z{var{typed:r,matrix:t,identity:n,multiply:a,qr:i,norm:s,subtract:l}=e;return r(dB,{Array:function(u){var m=c(t(u));return{U:m.U.valueOf(),T:m.T.valueOf()}},Matrix:function(u){return c(u)}});function c(o){var u=o.size()[0],m=o,d=n(u),h=0,y;do{y=m;var v=i(m),x=v.Q,w=v.R;if(m=a(w,x),d=a(d,x),h++>100)break}while(s(l(m,y))>1e-4);return{U:d,T:m}}});var hB="lyap",_G=["typed","matrix","sylvester","multiply","transpose"],Ng=F(hB,_G,e=>{var{typed:r,matrix:t,sylvester:n,multiply:a,transpose:i}=e;return r(hB,{"Matrix, Matrix":function(l,c){return n(l,i(l),a(-1,c))},"Array, Matrix":function(l,c){return n(t(l),i(t(l)),a(-1,c))},"Matrix, Array":function(l,c){return n(l,i(t(l)),t(a(-1,c)))},"Array, Array":function(l,c){return n(t(l),i(t(l)),t(a(-1,c))).toArray()}})});var OG="divide",BG=["typed","matrix","multiply","equalScalar","divideScalar","inv"],Ag=F(OG,BG,e=>{var{typed:r,matrix:t,multiply:n,equalScalar:a,divideScalar:i,inv:s}=e,l=jr({typed:r,equalScalar:a}),c=kt({typed:r});return r("divide",wm({"Array | Matrix, Array | Matrix":function(u,m){return n(u,s(m))},"DenseMatrix, any":function(u,m){return c(u,m,i,!1)},"SparseMatrix, any":function(u,m){return l(u,m,i,!1)},"Array, any":function(u,m){return c(t(u),m,i,!1).valueOf()},"any, Array | Matrix":function(u,m){return n(u,s(m))}},i.signatures))});var vB="distance",PG=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],Mg=F(vB,PG,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:a,divideScalar:i,deepEqual:s,sqrt:l,abs:c}=e;return r(vB,{"Array, Array, Array":function(M,S,O){if(M.length===2&&S.length===2&&O.length===2){if(!u(M))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!u(S))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!u(O))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(s(S,O))throw new TypeError("LinePoint1 should not be same with LinePoint2");var _=n(O[1],S[1]),E=n(S[0],O[0]),T=n(a(O[0],S[1]),a(S[0],O[1]));return x(M[0],M[1],_,E,T)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(M,S,O){if(Object.keys(M).length===2&&Object.keys(S).length===2&&Object.keys(O).length===2){if(!u(M))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!u(S))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!u(O))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(s(y(S),y(O)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in M&&"pointY"in M&&"lineOnePtX"in S&&"lineOnePtY"in S&&"lineTwoPtX"in O&&"lineTwoPtY"in O){var _=n(O.lineTwoPtY,S.lineOnePtY),E=n(S.lineOnePtX,O.lineTwoPtX),T=n(a(O.lineTwoPtX,S.lineOnePtY),a(S.lineOnePtX,O.lineTwoPtY));return x(M.pointX,M.pointY,_,E,T)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(M,S){if(M.length===2&&S.length===3){if(!u(M))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!m(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return x(M[0],M[1],S[0],S[1],S[2])}else if(M.length===3&&S.length===6){if(!m(M))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!h(S))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return w(M[0],M[1],M[2],S[0],S[1],S[2],S[3],S[4],S[5])}else if(M.length===S.length&&M.length>0){if(!d(M))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!d(S))throw new TypeError("All values of an array should be numbers or BigNumbers");return C(M,S)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(M,S){if(Object.keys(M).length===2&&Object.keys(S).length===3){if(!u(M))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!m(S))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in M&&"pointY"in M&&"xCoeffLine"in S&&"yCoeffLine"in S&&"constant"in S)return x(M.pointX,M.pointY,S.xCoeffLine,S.yCoeffLine,S.constant);throw new TypeError("Key names do not match")}else if(Object.keys(M).length===3&&Object.keys(S).length===6){if(!m(M))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!h(S))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in M&&"pointY"in M&&"x0"in S&&"y0"in S&&"z0"in S&&"a"in S&&"b"in S&&"c"in S)return w(M.pointX,M.pointY,M.pointZ,S.x0,S.y0,S.z0,S.a,S.b,S.c);throw new TypeError("Key names do not match")}else if(Object.keys(M).length===2&&Object.keys(S).length===2){if(!u(M))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!u(S))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in M&&"pointOneY"in M&&"pointTwoX"in S&&"pointTwoY"in S)return C([M.pointOneX,M.pointOneY],[S.pointTwoX,S.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(M).length===3&&Object.keys(S).length===3){if(!m(M))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!m(S))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in M&&"pointOneY"in M&&"pointOneZ"in M&&"pointTwoX"in S&&"pointTwoY"in S&&"pointTwoZ"in S)return C([M.pointOneX,M.pointOneY,M.pointOneZ],[S.pointTwoX,S.pointTwoY,S.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(M){if(!v(M))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return b(M)}});function o(N){return typeof N=="number"||rr(N)}function u(N){return N.constructor!==Array&&(N=y(N)),o(N[0])&&o(N[1])}function m(N){return N.constructor!==Array&&(N=y(N)),o(N[0])&&o(N[1])&&o(N[2])}function d(N){return Array.isArray(N)||(N=y(N)),N.every(o)}function h(N){return N.constructor!==Array&&(N=y(N)),o(N[0])&&o(N[1])&&o(N[2])&&o(N[3])&&o(N[4])&&o(N[5])}function y(N){for(var M=Object.keys(N),S=[],O=0;OM.length!==2||!o(M[0])||!o(M[1])))return!1}else if(N[0].length===3&&o(N[0][0])&&o(N[0][1])&&o(N[0][2])){if(N.some(M=>M.length!==3||!o(M[0])||!o(M[1])||!o(M[2])))return!1}else return!1;return!0}function x(N,M,S,O,_){var E=c(t(t(a(S,N),a(O,M)),_)),T=l(t(a(S,S),a(O,O)));return i(E,T)}function w(N,M,S,O,_,E,T,R,L){var H=[n(a(n(_,M),L),a(n(E,S),R)),n(a(n(E,S),T),a(n(O,N),L)),n(a(n(O,N),R),a(n(_,M),T))];H=l(t(t(a(H[0],H[0]),a(H[1],H[1])),a(H[2],H[2])));var V=l(t(t(a(T,T),a(R,R)),a(L,L)));return i(H,V)}function C(N,M){for(var S=N.length,O=0,_=0,E=0;E{var{typed:r,config:t,abs:n,add:a,addScalar:i,matrix:s,multiply:l,multiplyScalar:c,divideScalar:o,subtract:u,smaller:m,equalScalar:d,flatten:h,isZero:y,isNumeric:v}=e;return r("intersect",{"Array, Array, Array":x,"Array, Array, Array, Array":w,"Matrix, Matrix, Matrix":function(R,L,H){var V=x(R.valueOf(),L.valueOf(),H.valueOf());return V===null?null:s(V)},"Matrix, Matrix, Matrix, Matrix":function(R,L,H,V){var W=w(R.valueOf(),L.valueOf(),H.valueOf(),V.valueOf());return W===null?null:s(W)}});function x(T,R,L){if(T=C(T),R=C(R),L=C(L),!N(T))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!N(R))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!M(L))throw new TypeError("Array with 4 numbers expected as third argument");return E(T[0],T[1],T[2],R[0],R[1],R[2],L[0],L[1],L[2],L[3])}function w(T,R,L,H){if(T=C(T),R=C(R),L=C(L),H=C(H),T.length===2){if(!b(T))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!b(R))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!b(L))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!b(H))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return S(T,R,L,H)}else if(T.length===3){if(!N(T))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!N(R))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!N(L))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!N(H))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return _(T[0],T[1],T[2],R[0],R[1],R[2],L[0],L[1],L[2],H[0],H[1],H[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function C(T){return T.length===1?T[0]:T.length>1&&Array.isArray(T[0])&&T.every(R=>Array.isArray(R)&&R.length===1)?h(T):T}function b(T){return T.length===2&&v(T[0])&&v(T[1])}function N(T){return T.length===3&&v(T[0])&&v(T[1])&&v(T[2])}function M(T){return T.length===4&&v(T[0])&&v(T[1])&&v(T[2])&&v(T[3])}function S(T,R,L,H){var V=T,W=L,k=u(V,R),q=u(W,H),K=u(c(k[0],q[1]),c(q[0],k[1]));if(y(K)||m(n(K),t.epsilon))return null;var z=c(q[0],V[1]),oe=c(q[1],V[0]),le=c(q[0],W[1]),ae=c(q[1],W[0]),$=o(i(u(u(z,oe),le),ae),K);return a(l(k,$),V)}function O(T,R,L,H,V,W,k,q,K,z,oe,le){var ae=c(u(T,R),u(L,H)),$=c(u(V,W),u(k,q)),me=c(u(K,z),u(oe,le));return i(i(ae,$),me)}function _(T,R,L,H,V,W,k,q,K,z,oe,le){var ae=O(T,k,z,k,R,q,oe,q,L,K,le,K),$=O(z,k,H,T,oe,q,V,R,le,K,W,L),me=O(T,k,H,T,R,q,V,R,L,K,W,L),Ee=O(z,k,z,k,oe,q,oe,q,le,K,le,K),pe=O(H,T,H,T,V,R,V,R,W,L,W,L),ge=u(c(ae,$),c(me,Ee)),Se=u(c(pe,Ee),c($,$));if(y(Se))return null;var ye=o(ge,Se),be=o(i(ae,c(ye,$)),Ee),De=i(T,c(ye,u(H,T))),Ae=i(R,c(ye,u(V,R))),We=i(L,c(ye,u(W,L))),Je=i(k,c(be,u(z,k))),J=i(q,c(be,u(oe,q))),re=i(K,c(be,u(le,K)));return d(De,Je)&&d(Ae,J)&&d(We,re)?[De,Ae,We]:null}function E(T,R,L,H,V,W,k,q,K,z){var oe=c(T,k),le=c(H,k),ae=c(R,q),$=c(V,q),me=c(L,K),Ee=c(W,K),pe=u(u(u(z,oe),ae),me),ge=u(u(u(i(i(le,$),Ee),oe),ae),me),Se=o(pe,ge),ye=i(T,c(Se,u(H,T))),be=i(R,c(Se,u(V,R))),De=i(L,c(Se,u(W,L)));return[ye,be,De]}});var gB="sum",qG=["typed","config","add","numeric"],nf=F(gB,qG,e=>{var{typed:r,config:t,add:n,numeric:a}=e;return r(gB,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":s,"...":function(c){if(Pa(c))throw new TypeError("Scalar values expected in function sum");return i(c)}});function i(l){var c;return An(l,function(o){try{c=c===void 0?o:n(c,o)}catch(u){throw Et(u,"sum",o)}}),c===void 0&&(c=a(0,t.number)),typeof c=="string"&&(c=a(c,t.number)),c}function s(l,c){try{var o=ko(l,c,n);return o}catch(u){throw Et(u,"sum")}}});var Eg="cumsum",kG=["typed","add","unaryPlus"],af=F(Eg,kG,e=>{var{typed:r,add:t,unaryPlus:n}=e;return r(Eg,{Array:a,Matrix:function(o){return o.create(a(o.valueOf()))},"Array, number | BigNumber":s,"Matrix, number | BigNumber":function(o,u){return o.create(s(o.valueOf(),u))},"...":function(o){if(Pa(o))throw new TypeError("All values expected to be scalar in function cumsum");return a(o)}});function a(c){try{return i(c)}catch(o){throw Et(o,Eg)}}function i(c){if(c.length===0)return[];for(var o=[n(c[0])],u=1;u=u.length)throw new tn(o,u.length);try{return l(c,o)}catch(m){throw Et(m,Eg)}}function l(c,o){var u,m,d;if(o<=0){var h=c[0][0];if(Array.isArray(h)){for(d=Jm(c),m=[],u=0;u{var{typed:r,add:t,divide:n}=e;return r(yB,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":a,"...":function(l){if(Pa(l))throw new TypeError("Scalar values expected in function mean");return i(l)}});function a(s,l){try{var c=ko(s,l,t),o=Array.isArray(s)?ur(s):s.size();return n(c,o[l])}catch(u){throw Et(u,"mean")}}function i(s){var l,c=0;if(An(s,function(o){try{l=l===void 0?o:t(l,o),c++}catch(u){throw Et(u,"mean",o)}}),c===0)throw new Error("Cannot calculate the mean of an empty array");return n(l,c)}});var xB="median",zG=["typed","add","divide","compare","partitionSelect"],Tg=F(xB,zG,e=>{var{typed:r,add:t,divide:n,compare:a,partitionSelect:i}=e;function s(o){try{o=gr(o.valueOf());var u=o.length;if(u===0)throw new Error("Cannot calculate median of an empty array");if(u%2===0){for(var m=u/2-1,d=i(o,m+1),h=o[m],y=0;y0&&(h=o[y]);return c(h,d)}else{var v=i(o,(u-1)/2);return l(v)}}catch(x){throw Et(x,"median")}}var l=r({"number | BigNumber | Complex | Unit":function(u){return u}}),c=r({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(u,m){return n(t(u,m),2)}});return r(xB,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(u,m){throw new Error("median(A, dim) is not yet supported")},"...":function(u){if(Pa(u))throw new TypeError("Scalar values expected in function median");return s(u)}})});var bB="mad",UG=["typed","abs","map","median","subtract"],Fg=F(bB,UG,e=>{var{typed:r,abs:t,map:n,median:a,subtract:i}=e;return r(bB,{"Array | Matrix":s,"...":function(c){return s(c)}});function s(l){if(l=gr(l.valueOf()),l.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var c=a(l);return a(n(l,function(o){return t(i(o,c))}))}catch(o){throw o instanceof TypeError&&o.message.indexOf("median")!==-1?new TypeError(o.message.replace("median","mad")):Et(o,"mad")}}});var ND="unbiased",wB="variance",WG=["typed","add","subtract","multiply","divide","apply","isNaN"],sf=F(wB,WG,e=>{var{typed:r,add:t,subtract:n,multiply:a,divide:i,apply:s,isNaN:l}=e;return r(wB,{"Array | Matrix":function(m){return c(m,ND)},"Array | Matrix, string":c,"Array | Matrix, number | BigNumber":function(m,d){return o(m,d,ND)},"Array | Matrix, number | BigNumber, string":o,"...":function(m){return c(m,ND)}});function c(u,m){var d,h=0;if(u.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(An(u,function(x){try{d=d===void 0?x:t(d,x),h++}catch(w){throw Et(w,"variance",x)}}),h===0)throw new Error("Cannot calculate variance of an empty array");var y=i(d,h);if(d=void 0,An(u,function(x){var w=n(x,y);d=d===void 0?a(w,w):t(d,a(w,w))}),l(d))return d;switch(m){case"uncorrected":return i(d,h);case"biased":return i(d,h+1);case"unbiased":{var v=rr(d)?d.mul(0):0;return h===1?v:i(d,h-1)}default:throw new Error('Unknown normalization "'+m+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function o(u,m,d){try{if(u.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return s(u,m,h=>c(h,d))}catch(h){throw Et(h,"variance")}}});var DB="quantileSeq",YG=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],uf=F(DB,YG,e=>{var{typed:r,bignumber:t,add:n,subtract:a,divide:i,multiply:s,partitionSelect:l,compare:c,isInteger:o,smaller:u,smallerEq:m,larger:d}=e,h=Lo({typed:r,isInteger:o});return r(DB,{"Array | Matrix, number | BigNumber":(C,b)=>v(C,b,!1),"Array | Matrix, number | BigNumber, number":(C,b,N)=>y(C,b,!1,N,v),"Array | Matrix, number | BigNumber, boolean":v,"Array | Matrix, number | BigNumber, boolean, number":(C,b,N,M)=>y(C,b,N,M,v),"Array | Matrix, Array | Matrix":(C,b)=>x(C,b,!1),"Array | Matrix, Array | Matrix, number":(C,b,N)=>y(C,b,!1,N,x),"Array | Matrix, Array | Matrix, boolean":x,"Array | Matrix, Array | Matrix, boolean, number":(C,b,N,M)=>y(C,b,N,M,x)});function y(C,b,N,M,S){return h(C,M,O=>S(O,b,N))}function v(C,b,N){var M,S=C.valueOf();if(u(b,0))throw new Error("N/prob must be non-negative");if(m(b,1))return sr(b)?w(S,b,N):t(w(S,b,N));if(d(b,1)){if(!o(b))throw new Error("N must be a positive integer");if(d(b,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 O=n(b,1);M=[];for(var _=0;u(_,b);_++){var E=i(_+1,O);M.push(w(S,E,N))}return sr(b)?M:t(M)}}function x(C,b,N){for(var M=C.valueOf(),S=b.valueOf(),O=[],_=0;_0&&(T=M[L])}return n(s(T,a(1,E)),s(R,E))}});var SB="std",HG=["typed","map","sqrt","variance"],ff=F(SB,HG,e=>{var{typed:r,map:t,sqrt:n,variance:a}=e;return r(SB,{"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(s,l){if(s.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var c=a.apply(null,arguments);return Nt(c)?t(c,n):n(c)}catch(o){throw o instanceof TypeError&&o.message.indexOf(" variance")!==-1?new TypeError(o.message.replace(" variance"," std")):o}}});var NB="corr",$G=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],_g=F(NB,$G,e=>{var{typed:r,matrix:t,sqrt:n,sum:a,add:i,subtract:s,multiply:l,pow:c,divide:o}=e;return r(NB,{"Array, Array":function(h,y){return u(h,y)},"Matrix, Matrix":function(h,y){var v=u(h.toArray(),y.toArray());return Array.isArray(v)?t(v):v}});function u(d,h){var y=[];if(Array.isArray(d[0])&&Array.isArray(h[0])){if(d.length!==h.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var v=0;vi(S,l(O,h[_])),0),C=a(d.map(S=>c(S,2))),b=a(h.map(S=>c(S,2))),N=s(l(y,w),l(v,x)),M=n(l(s(l(y,C),c(v,2)),s(l(y,b),c(x,2))));return o(N,M)}});var AB="combinations",GG=["typed"],Og=F(AB,GG,e=>{var{typed:r}=e;return r(AB,{"number, number":qw,"BigNumber, BigNumber":function(n,a){var i=n.constructor,s,l,c=n.minus(a),o=new i(1);if(!MB(n)||!MB(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(s=o,a.lt(c))for(l=o;l.lte(c);l=l.plus(o))s=s.times(a.plus(l)).dividedBy(l);else for(l=o;l.lte(a);l=l.plus(o))s=s.times(c.plus(l)).dividedBy(l);return s}})});function MB(e){return e.isInteger()&&e.gte(0)}var CB="combinationsWithRep",VG=["typed"],Bg=F(CB,VG,e=>{var{typed:r}=e;return r(CB,{"number, number":function(n,a){if(!Ze(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Ze(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{var{typed:r,config:t,multiplyScalar:n,pow:a,BigNumber:i,Complex:s}=e;function l(o){if(o.im===0)return Fc(o.re);if(o.re<.5){var u=new s(1-o.re,-o.im),m=new s(Math.PI*o.re,Math.PI*o.im);return new s(Math.PI).div(m.sin()).div(l(u))}o=new s(o.re-1,o.im);for(var d=new s(Fs[0],0),h=1;h2;)d-=2,y+=d,h=h.times(y);return new i(h.toPrecision(i.precision))}});var FB="lgamma",QG=["Complex","typed"],Ig=F(FB,QG,e=>{var{Complex:r,typed:t}=e,n=7,a=7,i=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return t(FB,{number:_c,Complex:s,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function s(o){var u=6.283185307179586,m=1.1447298858494002,d=.1;if(o.isNaN())return new r(NaN,NaN);if(o.im===0)return new r(_c(o.re),0);if(o.re>=n||Math.abs(o.im)>=a)return l(o);if(o.re<=d){var h=sM(u,o.im)*Math.floor(.5*o.re+.25),y=o.mul(Math.PI).sin().log(),v=s(new r(1-o.re,-o.im));return new r(m,h).sub(y).sub(v)}else return o.im>=0?c(o):c(o.conjugate()).conjugate()}function l(o){for(var u=o.sub(.5).mul(o.log()).sub(o).add(Hw),m=new r(1,0).div(o),d=m.div(o),h=i[0],y=i[1],v=2*d.re,x=d.re*d.re+d.im*d.im,w=2;w<8;w++){var C=y;y=-x*h+i[w],h=v*h+C}var b=m.mul(d.mul(h).add(y));return u.add(b)}function c(o){var u=0,m=0,d=o;for(o=o.add(1);o.re<=n;){d=d.mul(o);var h=d.im<0?1:0;h!==0&&m===0&&u++,m=h,o=o.add(1)}return l(o).sub(d.log()).sub(new r(0,u*2*Math.PI*1))}});var _B="factorial",XG=["typed","gamma"],Rg=F(_B,XG,e=>{var{typed:r,gamma:t}=e;return r(_B,{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":r.referToSelf(n=>a=>je(a,n))})});var OB="kldivergence",JG=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],qg=F(OB,JG,e=>{var{typed:r,matrix:t,divide:n,sum:a,multiply:i,map:s,dotDivide:l,log:c,isNumeric:o}=e;return r(OB,{"Array, Array":function(d,h){return u(t(d),t(h))},"Matrix, Array":function(d,h){return u(d,t(h))},"Array, Matrix":function(d,h){return u(t(d),h)},"Matrix, Matrix":function(d,h){return u(d,h)}});function u(m,d){var h=d.size().length,y=m.size().length;if(h>1)throw new Error("first object must be one dimensional");if(y>1)throw new Error("second object must be one dimensional");if(h!==y)throw new Error("Length of two vectors must be equal");var v=a(m);if(v===0)throw new Error("Sum of elements in first object must be non zero");var x=a(d);if(x===0)throw new Error("Sum of elements in second object must be non zero");var w=n(m,a(m)),C=n(d,a(d)),b=a(i(w,s(l(w,C),N=>c(N))));return o(b)?b:Number.NaN}});var BB="multinomial",KG=["typed","add","divide","multiply","factorial","isInteger","isPositive"],kg=F(BB,KG,e=>{var{typed:r,add:t,divide:n,multiply:a,factorial:i,isInteger:s,isPositive:l}=e;return r(BB,{"Array | Matrix":function(o){var u=0,m=1;return An(o,function(d){if(!s(d)||!l(d))throw new TypeError("Positive integer value expected in function multinomial");u=t(u,d),m=a(m,i(d))}),n(i(u),m)}})});var PB="permutations",jG=["typed","factorial"],Lg=F(PB,jG,e=>{var{typed:r,factorial:t}=e;return r(PB,{"number | BigNumber":t,"number, number":function(a,i){if(!Ze(a)||a<0)throw new TypeError("Positive integer value expected in function permutations");if(!Ze(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 va(a-i+1,a)},"BigNumber, BigNumber":function(a,i){var s,l;if(!IB(a)||!IB(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 c=a.mul(0).add(1);for(s=c,l=a.minus(i).plus(1);l.lte(a);l=l.plus(1))s=s.times(l);return s}})});function IB(e){return e.isInteger()&&e.gte(0)}var _D=ma(KB(),1),oV=(0,_D.default)(Date.now());function no(e){var r;function t(a){r=a===null?oV:(0,_D.default)(String(a))}t(e);function n(){return r()}return n}var jB="pickRandom",sV=["typed","config","?on"],Ug=F(jB,sV,e=>{var{typed:r,config:t,on:n}=e,a=no(t.randomSeed);return n&&n("config",function(s,l){s.randomSeed!==l.randomSeed&&(a=no(s.randomSeed))}),r(jB,{"Array | Matrix":function(l){return i(l,{})},"Array | Matrix, Object":function(l,c){return i(l,c)},"Array | Matrix, number":function(l,c){return i(l,{number:c})},"Array | Matrix, Array | Matrix":function(l,c){return i(l,{weights:c})},"Array | Matrix, Array | Matrix, number":function(l,c,o){return i(l,{number:o,weights:c})},"Array | Matrix, number, Array | Matrix":function(l,c,o){return i(l,{number:c,weights:o})}});function i(s,l){var{number:c,weights:o,elementWise:u=!0}=l,m=typeof c>"u";m&&(c=1);var d=Qe(s)?s.create:Qe(o)?o.create:null;s=s.valueOf(),o&&(o=o.valueOf()),u===!0&&(s=gr(s),o=gr(o));var h=0;if(typeof o<"u"){if(o.length!==s.length)throw new Error("Weights must have the same length as possibles");for(var y=0,v=o.length;y"u")C=s[Math.floor(a()*x)];else for(var b=a()*h,N=0,M=s.length;N1)for(var n=0,a=e.shift();n{var{typed:r,config:t,on:n}=e,a=no(t.randomSeed);return n&&n("config",function(l,c){l.randomSeed!==c.randomSeed&&(a=no(l.randomSeed))}),r(eP,{"":()=>s(0,1),number:l=>s(0,l),"number, number":(l,c)=>s(l,c),"Array | Matrix":l=>i(l,0,1),"Array | Matrix, number":(l,c)=>i(l,0,c),"Array | Matrix, number, number":(l,c,o)=>i(l,c,o)});function i(l,c,o){var u=Rc(l.valueOf(),()=>s(c,o));return Qe(l)?l.create(u):u}function s(l,c){return l+a()*(c-l)}});var rP="randomInt",fV=["typed","config","?on"],Yg=F(rP,fV,e=>{var{typed:r,config:t,on:n}=e,a=no(t.randomSeed);return n&&n("config",function(l,c){l.randomSeed!==c.randomSeed&&(a=no(l.randomSeed))}),r(rP,{"":()=>s(0,1),number:l=>s(0,l),"number, number":(l,c)=>s(l,c),"Array | Matrix":l=>i(l,0,1),"Array | Matrix, number":(l,c)=>i(l,0,c),"Array | Matrix, number, number":(l,c,o)=>i(l,c,o)});function i(l,c,o){var u=Rc(l.valueOf(),()=>s(c,o));return Qe(l)?l.create(u):u}function s(l,c){return Math.floor(l+a()*(c-l))}});var tP="stirlingS2",cV=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],Hg=F(tP,cV,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:a,divideScalar:i,pow:s,factorial:l,combinations:c,isNegative:o,isInteger:u,number:m,bignumber:d,larger:h}=e,y=[],v=[];return r(tP,{"number | BigNumber, number | BigNumber":function(w,C){if(!u(w)||o(w)||!u(C)||o(C))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(h(C,w))throw new TypeError("k must be less than or equal to n in function stirlingS2");var b=!(sr(w)&&sr(C)),N=b?v:y,M=b?d:m,S=m(w),O=m(C);if(N[S]&&N[S].length>O)return N[S][O];for(var _=0;_<=S;++_)if(N[_]||(N[_]=[M(_===0?1:0)]),_!==0)for(var E=N[_],T=N[_-1],R=E.length;R<=_&&R<=O;++R)R===_?E[R]=1:E[R]=t(a(M(R),T[R]),T[R-1]);return N[S][O]}})});var nP="bellNumbers",lV=["typed","addScalar","isNegative","isInteger","stirlingS2"],$g=F(nP,lV,e=>{var{typed:r,addScalar:t,isNegative:n,isInteger:a,stirlingS2:i}=e;return r(nP,{"number | BigNumber":function(l){if(!a(l)||n(l))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var c=0,o=0;o<=l;o++)c=t(c,i(l,o));return c}})});var aP="catalan",mV=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],Gg=F(aP,mV,e=>{var{typed:r,addScalar:t,divideScalar:n,multiplyScalar:a,combinations:i,isNegative:s,isInteger:l}=e;return r(aP,{"number | BigNumber":function(o){if(!l(o)||s(o))throw new TypeError("Non-negative integer value expected in function catalan");return n(i(a(o,2),o),t(o,1))}})});var iP="composition",pV=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],Vg=F(iP,pV,e=>{var{typed:r,addScalar:t,combinations:n,isPositive:a,isNegative:i,isInteger:s,larger:l}=e;return r(iP,{"number | BigNumber, number | BigNumber":function(o,u){if(!s(o)||!a(o)||!s(u)||!a(u))throw new TypeError("Positive integer value expected in function composition");if(l(u,o))throw new TypeError("k must be less than or equal to n in function composition");return n(t(o,-1),t(u,-1))}})});var oP="leafCount",dV=["parse","typed"],Zg=F(oP,dV,e=>{var{parse:r,typed:t}=e;function n(a){var i=0;return a.forEach(s=>{i+=n(s)}),i||1}return t(oP,{Node:function(i){return n(i)}})});function OD(e){return xr(e)||ct(e)&&e.isUnary()&&xr(e.args[0])}function qc(e){return!!(xr(e)||(yn(e)||ct(e))&&e.args.every(qc)||en(e)&&qc(e.content))}function sP(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function BD(e){for(var r=1;r{var{FunctionNode:r,OperatorNode:t,SymbolNode:n}=e,a=!0,i=!1,s="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}},c={divide:{total:i},log:{total:i}},o={subtract:{total:i},abs:{trivial:a},log:{total:a}};function u(b,N){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l,S=s;if(typeof b=="string"?S=b:ct(b)?S=b.fn.toString():yn(b)?S=b.name:en(b)&&(S="paren"),Xe(M,S)){var O=M[S];if(Xe(O,N))return O[N];if(Xe(l,S))return l[S][N]}if(Xe(M,s)){var _=M[s];return Xe(_,N)?_[N]:l[s][N]}if(Xe(l,S)){var E=l[S];if(Xe(E,N))return E[N]}return l[s][N]}function m(b){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return u(b,"commutative",N)}function d(b){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return u(b,"associative",N)}function h(b,N){var M=BD({},b);for(var S in N)Xe(b,S)?M[S]=BD(BD({},N[S]),b[S]):M[S]=N[S];return M}function y(b,N){if(!b.args||b.args.length===0)return b;b.args=v(b,N);for(var M=0;M2&&d(b,N)){for(var _=b.args.pop();b.args.length>0;)_=M([b.args.pop(),_]);b.args=_.args}}}function w(b,N){if(!(!b.args||b.args.length===0)){for(var M=C(b),S=b.args.length,O=0;O2&&d(b,N)){for(var _=b.args.shift();b.args.length>0;)_=M([_,b.args.shift()]);b.args=_.args}}}function C(b){return ct(b)?function(N){try{return new t(b.op,b.fn,N,b.implicit)}catch(M){return console.error(M),[]}}:function(N){return new r(new n(b.name),N)}}return{createMakeNodeFunction:C,hasProperty:u,isCommutative:m,isAssociative:d,mergeContext:h,flatten:y,allChildren:v,unflattenr:x,unflattenl:w,defaultContext:l,realContext:c,positiveContext:o}});var gV="simplify",yV=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],Qg=F(gV,yV,e=>{var{config:r,typed:t,parse:n,add:a,subtract:i,multiply:s,divide:l,pow:c,isZero:o,equal:u,resolve:m,simplifyConstant:d,simplifyCore:h,fraction:y,bignumber:v,mathWithTransform:x,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:N,FunctionNode:M,IndexNode:S,ObjectNode:O,OperatorNode:_,ParenthesisNode:E,SymbolNode:T}=e,{hasProperty:R,isCommutative:L,isAssociative:H,mergeContext:V,flatten:W,unflattenr:k,unflattenl:q,createMakeNodeFunction:K,defaultContext:z,realContext:oe,positiveContext:le}=cf({FunctionNode:M,OperatorNode:_,SymbolNode:T});t.addConversion({from:"Object",to:"Map",convert:ji});var ae=t("simplify",{Node:ye,"Node, Map":(j,ne)=>ye(j,!1,ne),"Node, Map, Object":(j,ne,ue)=>ye(j,!1,ne,ue),"Node, Array":ye,"Node, Array, Map":ye,"Node, Array, Map, Object":ye});t.removeConversion({from:"Object",to:"Map",convert:ji}),ae.defaultContext=z,ae.realContext=oe,ae.positiveContext=le;function $(j){return j.transform(function(ne,ue,Me){return en(ne)?$(ne.content):ne})}var me={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};ae.rules=[h,{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}}},d,{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}}},d,{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 Ee(j,ne){var ue={};if(j.s){var Me=j.s.split("->");if(Me.length===2)ue.l=Me[0],ue.r=Me[1];else throw SyntaxError("Could not parse rule: "+j.s)}else ue.l=j.l,ue.r=j.r;ue.l=$(n(ue.l)),ue.r=$(n(ue.r));for(var Ce of["imposeContext","repeat","assuming"])Ce in j&&(ue[Ce]=j[Ce]);if(j.evaluate&&(ue.evaluate=n(j.evaluate)),H(ue.l,ne)){var Le=!L(ue.l,ne),Ie;Le&&(Ie=Se());var fr=K(ue.l),or=Se();ue.expanded={},ue.expanded.l=fr([ue.l,or]),W(ue.expanded.l,ne),k(ue.expanded.l,ne),ue.expanded.r=fr([ue.r,or]),Le&&(ue.expandedNC1={},ue.expandedNC1.l=fr([Ie,ue.l]),ue.expandedNC1.r=fr([Ie,ue.r]),ue.expandedNC2={},ue.expandedNC2.l=fr([Ie,ue.expanded.l]),ue.expandedNC2.r=fr([Ie,ue.expanded.r]))}return ue}function pe(j,ne){for(var ue=[],Me=0;Me2&&arguments[2]!==void 0?arguments[2]:Bo(),Me=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Ce=Me.consoleDebug;ne=pe(ne||ae.rules,Me.context);var Le=m(j,ue);Le=$(Le);for(var Ie={},fr=Le.toString({parenthesis:"all"});!Ie[fr];){Ie[fr]=!0,ge=0;var or=fr;Ce&&console.log("Working on: ",fr);for(var Ke=0;Ke ").concat(ne[Ke].r.toString()))),Ce){var ee=Le.toString({parenthesis:"all"});ee!==or&&(console.log("Applying",Pr,"produced",ee),or=ee)}q(Le,Me.context)}fr=Le.toString({parenthesis:"all"})}return Le}function be(j,ne,ue){var Me=j;if(j)for(var Ce=0;Ce1&&(or=Le(j.args.slice(0,fr))),Ce=j.args.slice(fr),Me=Ce.length===1?Ce[0]:Le(Ce),ue.push(Le([or,Me]))}return ue}function We(j,ne){var ue={placeholders:{}};if(!j.placeholders&&!ne.placeholders)return ue;if(j.placeholders){if(!ne.placeholders)return j}else return ne;for(var Me in j.placeholders)if(Xe(j.placeholders,Me)&&(ue.placeholders[Me]=j.placeholders[Me],Xe(ne.placeholders,Me)&&!xe(j.placeholders[Me],ne.placeholders[Me])))return null;for(var Ce in ne.placeholders)Xe(ne.placeholders,Ce)&&(ue.placeholders[Ce]=ne.placeholders[Ce]);return ue}function Je(j,ne){var ue=[];if(j.length===0||ne.length===0)return ue;for(var Me,Ce=0;Ce2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var or=re(j.args[0],ne.args[1],ue);if(or.length===0)return[];var Ke=re(j.args[1],ne.args[0],ue);if(Ke.length===0)return[];Le=[or,Ke]}Ce=J(Le)}else if(ne.args.length>=2&&j.args.length===2){for(var Pr=Ae(ne,ue),ee=[],ce=0;ce2)throw Error("Unexpected non-binary associative function: "+j.toString());return[]}}else if(j instanceof T){if(j.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(me[j.name]){if(j.name!==ne.name)return[]}else switch(j.name[1]>="a"&&j.name[1]<="z"?j.name.substring(0,2):j.name[0]){case"n":case"_p":Ce[0].placeholders[j.name]=ne;break;case"c":case"cl":if(xr(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"v":if(!xr(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"vl":if(at(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"cd":if(OD(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"vd":if(!OD(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"ce":if(qc(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"ve":if(!qc(ne))Ce[0].placeholders[j.name]=ne;else return[];break;default:throw new Error("Invalid symbol in rule: "+j.name)}}else if(j instanceof N){if(!u(j.value,ne.value))return[]}else return[];return Ce}function xe(j,ne){if(j instanceof N&&ne instanceof N){if(!u(j.value,ne.value))return!1}else if(j instanceof T&&ne instanceof T){if(j.name!==ne.name)return!1}else if(j instanceof _&&ne instanceof _||j instanceof M&&ne instanceof M){if(j instanceof _){if(j.op!==ne.op||j.fn!==ne.fn)return!1}else if(j instanceof M&&j.name!==ne.name)return!1;if(j.args.length!==ne.args.length)return!1;for(var ue=0;ue{var{typed:r,config:t,mathWithTransform:n,matrix:a,fraction:i,bignumber:s,AccessorNode:l,ArrayNode:c,ConstantNode:o,FunctionNode:u,IndexNode:m,ObjectNode:d,OperatorNode:h,SymbolNode:y}=e,{isCommutative:v,isAssociative:x,allChildren:w,createMakeNodeFunction:C}=cf({FunctionNode:u,OperatorNode:h,SymbolNode:y}),b=r("simplifyConstant",{Node:W=>O(V(W,{})),"Node, Object":function(k,q){return O(V(k,q))}});function N(W){return da(W)?W.valueOf():W instanceof Array?W.map(N):Qe(W)?a(N(W.valueOf())):W}function M(W,k,q){try{return n[W].apply(null,k)}catch{return k=k.map(N),E(n[W].apply(null,k),q)}}var S=r({Fraction:R,number:function(k){return k<0?T(new o(-k)):new o(k)},BigNumber:function(k){return k<0?T(new o(-k)):new o(k)},Complex:function(k){throw new Error("Cannot convert Complex number to Node")},string:function(k){return new o(k)},Matrix:function(k){return new c(k.valueOf().map(q=>S(q)))}});function O(W){return Nr(W)?W:S(W)}function _(W,k){var q=k&&k.exactFractions!==!1;if(q&&isFinite(W)&&i){var K=i(W),z=k&&typeof k.fractionsLimit=="number"?k.fractionsLimit:1/0;if(K.valueOf()===W&&K.n0;)if(xr(K[0])&&typeof K[0].value!="string"){var z=E(K.shift().value,q);jt(W)?W=W.items[z-1]:(W=W.valueOf()[z-1],W instanceof Array&&(W=a(W)))}else if(K.length>1&&xr(K[1])&&typeof K[1].value!="string"){var oe=E(K[1].value,q),le=[],ae=jt(W)?W.items:W.valueOf();for(var $ of ae)if(jt($))le.push($.items[oe-1]);else if(Qe(W))le.push($[oe-1]);else break;if(le.length===ae.length)jt(W)?W=new c(le):W=a(le),K.splice(1,1);else break}else break;return K.length===k.dimensions.length?new l(O(W),k):K.length>0?(k=new m(K),new l(O(W),k)):W}if(Ei(W)&&k.dimensions.length===1&&xr(k.dimensions[0])){var me=k.dimensions[0].value;return me in W.properties?W.properties[me]:new o}return new l(O(W),k)}function H(W,k,q,K){var z=k.shift(),oe=k.reduce((le,ae)=>{if(!Nr(ae)){var $=le.pop();if(Nr($))return[$,ae];try{return le.push(M(W,[$,ae],K)),le}catch{le.push($)}}le.push(O(le.pop()));var me=le.length===1?le[0]:q(le);return[q([me,O(ae)])]},[z]);return oe.length===1?oe[0]:q([oe[0],S(oe[1])])}function V(W,k){switch(W.type){case"SymbolNode":return W;case"ConstantNode":switch(typeof W.value){case"number":return E(W.value,k);case"string":return W.value;default:if(!isNaN(W.value))return E(W.value,k)}return W;case"FunctionNode":if(n[W.name]&&n[W.name].rawArgs)return W;{var q=["add","multiply"];if(q.indexOf(W.name)===-1){var K=W.args.map(De=>V(De,k));if(!K.some(Nr))try{return M(W.name,K,k)}catch{}if(W.name==="size"&&K.length===1&&jt(K[0])){for(var z=[],oe=K[0];jt(oe);)z.push(oe.items.length),oe=oe.items[0];return a(z)}return new u(W.name,K.map(O))}}case"OperatorNode":{var le=W.fn.toString(),ae,$,me=C(W);if(ct(W)&&W.isUnary())ae=[V(W.args[0],k)],Nr(ae[0])?$=me(ae):$=M(le,ae,k);else if(x(W,k.context))if(ae=w(W,k.context),ae=ae.map(De=>V(De,k)),v(le,k.context)){for(var Ee=[],pe=[],ge=0;ge1?($=H(le,Ee,me,k),pe.unshift($),$=H(le,pe,me,k)):$=H(le,ae,me,k)}else $=H(le,ae,me,k);else ae=W.args.map(De=>V(De,k)),$=H(le,ae,me,k);return $}case"ParenthesisNode":return V(W.content,k);case"AccessorNode":return L(V(W.object,k),V(W.index,k),k);case"ArrayNode":{var Se=W.items.map(De=>V(De,k));return Se.some(Nr)?new c(Se.map(O)):a(Se)}case"IndexNode":return new m(W.dimensions.map(De=>b(De,k)));case"ObjectNode":{var ye={};for(var be in W.properties)ye[be]=b(W.properties[be],k);return new d(ye)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(W.type))}}return b});var uP="simplifyCore",wV=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],Jg=F(uP,wV,e=>{var{typed:r,parse:t,equal:n,isZero:a,add:i,subtract:s,multiply:l,divide:c,pow:o,AccessorNode:u,ArrayNode:m,ConstantNode:d,FunctionNode:h,IndexNode:y,ObjectNode:v,OperatorNode:x,ParenthesisNode:w,SymbolNode:C}=e,b=new d(0),N=new d(1),M=new d(!0),S=new d(!1);function O(R){return ct(R)&&["and","not","or"].includes(R.op)}var{hasProperty:_,isCommutative:E}=cf({FunctionNode:h,OperatorNode:x,SymbolNode:C});function T(R){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},H=L?L.context:void 0;if(_(R,"trivial",H)){if(yn(R)&&R.args.length===1)return T(R.args[0],L);var V=!1,W=0;if(R.forEach(pe=>{++W,W===1&&(V=T(pe,L))}),W===1)return V}var k=R;if(yn(k)){var q=iT(k.name);if(q){if(k.args.length>2&&_(k,"associative",H))for(;k.args.length>2;){var K=k.args.pop(),z=k.args.pop();k.args.push(new x(q,k.name,[K,z]))}k=new x(q,k.name,k.args)}else return new h(T(k.fn),k.args.map(pe=>T(pe,L)))}if(ct(k)&&k.isUnary()){var oe=T(k.args[0],L);if(k.op==="~"&&ct(oe)&&oe.isUnary()&&oe.op==="~"||k.op==="not"&&ct(oe)&&oe.isUnary()&&oe.op==="not"&&O(oe.args[0]))return oe.args[0];var le=!0;if(k.op==="-"&&ct(oe)&&(oe.isBinary()&&oe.fn==="subtract"&&(k=new x("-","subtract",[oe.args[1],oe.args[0]]),le=!1),oe.isUnary()&&oe.op==="-"))return oe.args[0];if(le)return new x(k.op,k.fn,[oe])}if(ct(k)&&k.isBinary()){var ae=T(k.args[0],L),$=T(k.args[1],L);if(k.op==="+"){if(xr(ae)&&a(ae.value))return $;if(xr($)&&a($.value))return ae;ct($)&&$.isUnary()&&$.op==="-"&&($=$.args[0],k=new x("-","subtract",[ae,$]))}if(k.op==="-")return ct($)&&$.isUnary()&&$.op==="-"?T(new x("+","add",[ae,$.args[0]]),L):xr(ae)&&a(ae.value)?T(new x("-","unaryMinus",[$])):xr($)&&a($.value)?ae:new x(k.op,k.fn,[ae,$]);if(k.op==="*"){if(xr(ae)){if(a(ae.value))return b;if(n(ae.value,1))return $}if(xr($)){if(a($.value))return b;if(n($.value,1))return ae;if(E(k,H))return new x(k.op,k.fn,[$,ae],k.implicit)}return new x(k.op,k.fn,[ae,$],k.implicit)}if(k.op==="/")return xr(ae)&&a(ae.value)?b:xr($)&&n($.value,1)?ae:new x(k.op,k.fn,[ae,$]);if(k.op==="^"&&xr($)){if(a($.value))return N;if(n($.value,1))return ae}if(k.op==="and"){if(xr(ae))if(ae.value){if(O($))return $;if(xr($))return $.value?M:S}else return S;if(xr($))if($.value){if(O(ae))return ae}else return S}if(k.op==="or"){if(xr(ae)){if(ae.value)return M;if(O($))return $}if(xr($)){if($.value)return M;if(O(ae))return ae}}return new x(k.op,k.fn,[ae,$])}if(ct(k))return new x(k.op,k.fn,k.args.map(pe=>T(pe,L)));if(jt(k))return new m(k.items.map(pe=>T(pe,L)));if(Ln(k))return new u(T(k.object,L),T(k.index,L));if(Jn(k))return new y(k.dimensions.map(pe=>T(pe,L)));if(Ei(k)){var me={};for(var Ee in k.properties)me[Ee]=T(k.properties[Ee],L);return new v(me)}return k}return r(uP,{Node:T,"Node,Object":T})});var DV="resolve",SV=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],Kg=F(DV,SV,e=>{var{typed:r,parse:t,ConstantNode:n,FunctionNode:a,OperatorNode:i,ParenthesisNode:s}=e;function l(c,o){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!o)return c;if(at(c)){if(u.has(c.name)){var m=Array.from(u).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(m,"}"))}var d=o.get(c.name);if(Nr(d)){var h=new Set(u);return h.add(c.name),l(d,o,h)}else return typeof d=="number"?t(String(d)):d!==void 0?new n(d):c}else if(ct(c)){var y=c.args.map(function(x){return l(x,o,u)});return new i(c.op,c.fn,y,c.implicit)}else{if(en(c))return new s(l(c.content,o,u));if(yn(c)){var v=c.args.map(function(x){return l(x,o,u)});return new a(c.name,v)}}return c.map(x=>l(x,o,u))}return r("resolve",{Node:l,"Node, Map | null | undefined":l,"Node, Object":(c,o)=>l(c,ji(o)),"Array | Matrix":r.referToSelf(c=>o=>o.map(u=>c(u))),"Array | Matrix, null | undefined":r.referToSelf(c=>o=>o.map(u=>c(u))),"Array, Object":r.referTo("Array,Map",c=>(o,u)=>c(o,ji(u))),"Matrix, Object":r.referTo("Matrix,Map",c=>(o,u)=>c(o,ji(u))),"Array | Matrix, Map":r.referToSelf(c=>(o,u)=>o.map(m=>c(m,u)))})});var fP="symbolicEqual",NV=["parse","simplify","typed","OperatorNode"],jg=F(fP,NV,e=>{var{parse:r,simplify:t,typed:n,OperatorNode:a}=e;function i(s,l){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=new a("-","subtract",[s,l]),u=t(o,{},c);return xr(u)&&!u.value}return n(fP,{"Node, Node":i,"Node, Node, Object":i})});var cP="derivative",AV=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],e0=F(cP,AV,e=>{var{typed:r,config:t,parse:n,simplify:a,equal:i,isZero:s,numeric:l,ConstantNode:c,FunctionNode:o,OperatorNode:u,ParenthesisNode:m,SymbolNode:d}=e;function h(b,N){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},S={};x(S,b,N.name);var O=w(b,S);return M.simplify?a(O):O}r.addConversion({from:"identifier",to:"SymbolNode",convert:n});var y=r(cP,{"Node, SymbolNode":h,"Node, SymbolNode, Object":h});r.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),y._simplify=!0,y.toTex=function(b){return v.apply(null,b.args)};var v=r("_derivTex",{"Node, SymbolNode":function(N,M){return xr(N)&&Tr(N.value)==="string"?v(n(N.value).toString(),M.toString(),1):v(N.toTex(),M.toString(),1)},"Node, ConstantNode":function(N,M){if(Tr(M.value)==="string")return v(N,n(M.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(N,M,S){return v(N.toString(),M.name,S.value)},"string, string, number":function(N,M,S){var O;return S===1?O="{d\\\\over d"+M+"}":O="{d^{"+S+"}\\\\over d"+M+"^{"+S+"}}",O+"\\\\left[".concat(N,"\\\\right]")}}),x=r("constTag",{"Object, ConstantNode, string":function(N,M){return N[M]=!0,!0},"Object, SymbolNode, string":function(N,M,S){return M.name!==S?(N[M]=!0,!0):!1},"Object, ParenthesisNode, string":function(N,M,S){return x(N,M.content,S)},"Object, FunctionAssignmentNode, string":function(N,M,S){return M.params.indexOf(S)===-1?(N[M]=!0,!0):x(N,M.expr,S)},"Object, FunctionNode | OperatorNode, string":function(N,M,S){if(M.args.length>0){for(var O=x(N,M.args[0],S),_=1;_0){var O=N.args.filter(function(W){return M[W]===void 0}),_=O.length===1?O[0]:new u("*","multiply",O),E=S.concat(w(_,M));return new u("*","multiply",E)}return new u("+","add",N.args.map(function(W){return new u("*","multiply",N.args.map(function(k){return k===W?w(k,M):k.clone()}))}))}if(N.op==="/"&&N.isBinary()){var T=N.args[0],R=N.args[1];return M[R]!==void 0?new u("/","divide",[w(T,M),R]):M[T]!==void 0?new u("*","multiply",[new u("-","unaryMinus",[T]),new u("/","divide",[w(R,M),new u("^","pow",[R.clone(),C(2)])])]):new u("/","divide",[new u("-","subtract",[new u("*","multiply",[w(T,M),R.clone()]),new u("*","multiply",[T.clone(),w(R,M)])]),new u("^","pow",[R.clone(),C(2)])])}if(N.op==="^"&&N.isBinary()){var L=N.args[0],H=N.args[1];if(M[L]!==void 0)return xr(L)&&(s(L.value)||i(L.value,1))?C(0):new u("*","multiply",[N,new u("*","multiply",[new o("log",[L.clone()]),w(H.clone(),M)])]);if(M[H]!==void 0){if(xr(H)){if(s(H.value))return C(0);if(i(H.value,1))return w(L,M)}var V=new u("^","pow",[L.clone(),new u("-","subtract",[H,C(1)])]);return new u("*","multiply",[H.clone(),new u("*","multiply",[w(L,M),V])])}return new u("*","multiply",[new u("^","pow",[L.clone(),H.clone()]),new u("+","add",[new u("*","multiply",[w(L,M),new u("/","divide",[H.clone(),L.clone()])]),new u("*","multiply",[w(H,M),new o("log",[L.clone()])])])])}throw new Error('Cannot process operator "'+N.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function C(b,N){return new c(l(b,N||t.number))}return y});var lP="rationalize",MV=["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"],r0=F(lP,MV,e=>{var{config:r,typed:t,equal:n,isZero:a,add:i,subtract:s,multiply:l,divide:c,pow:o,parse:u,simplifyConstant:m,simplifyCore:d,simplify:h,fraction:y,bignumber:v,mathWithTransform:x,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:N,FunctionNode:M,IndexNode:S,ObjectNode:O,OperatorNode:_,SymbolNode:E,ParenthesisNode:T}=e;function R(k){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,z=H(),oe=L(k,q,!0,z.firstRules),le=oe.variables.length,ae={exactFractions:!1},$={exactFractions:!0};if(k=oe.expression,le>=1){k=V(k);var me,Ee,pe=!0,ge=!1;k=h(k,z.firstRules,{},ae);for(var Se;Ee=pe?z.distrDivRules:z.sucDivRules,k=h(k,Ee,{},$),pe=!pe,Se=k.toString(),Se!==me;)ge=!0,me=Se;ge&&(k=h(k,z.firstRulesAgain,{},ae)),k=h(k,z.finalRules,{},ae)}var ye=[],be={};return k.type==="OperatorNode"&&k.isBinary()&&k.op==="/"?(le===1&&(k.args[0]=W(k.args[0],ye),k.args[1]=W(k.args[1])),K&&(be.numerator=k.args[0],be.denominator=k.args[1])):(le===1&&(k=W(k,ye)),K&&(be.numerator=k,be.denominator=null)),K?(be.coefficients=ye,be.variables=oe.variables,be.expression=k,be):k}return t(lP,{Node:R,"Node, boolean":(k,q)=>R(k,{},q),"Node, Object":R,"Node, Object, boolean":R});function L(k,q,K,z){var oe=[],le=h(k,z,q,{exactFractions:!1});K=!!K;var ae="+-*"+(K?"/":"");me(le);var $={};return $.expression=le,$.variables=oe,$;function me(Ee){var pe=Ee.type;if(pe==="FunctionNode")throw new Error("There is an unsolved function call");if(pe==="OperatorNode")if(Ee.op==="^"){if(Ee.args[1].type!=="ConstantNode"||!Ze(parseFloat(Ee.args[1].value)))throw new Error("There is a non-integer exponent");me(Ee.args[0])}else{if(ae.indexOf(Ee.op)===-1)throw new Error("Operator "+Ee.op+" invalid in polynomial expression");for(var ge=0;ge1;if(z==="OperatorNode"&&k.isBinary()){var le=!1,ae;if(k.op==="^"&&(k.args[0].type==="ParenthesisNode"||k.args[0].type==="OperatorNode")&&k.args[1].type==="ConstantNode"&&(ae=parseFloat(k.args[1].value),le=ae>=2&&Ze(ae)),le){if(ae>2){var $=k.args[0],me=new _("^","pow",[k.args[0].cloneDeep(),new N(ae-1)]);k=new _("*","multiply",[$,me])}else k=new _("*","multiply",[k.args[0],k.args[0].cloneDeep()]);oe&&(K==="content"?q.content=k:q.args[K]=k)}}if(z==="ParenthesisNode")V(k.content,k,"content");else if(z!=="ConstantNode"&&z!=="SymbolNode")for(var Ee=0;Ee=0;$--)if(q[$]!==0){var me=new N(le?q[$]:Math.abs(q[$])),Ee=q[$]<0?"-":"+";if($>0){var pe=new E(oe);if($>1){var ge=new N($);pe=new _("^","pow",[pe,ge])}q[$]===-1&&le?me=new _("-","unaryMinus",[pe]):Math.abs(q[$])===1?me=pe:me=new _("*","multiply",[me,pe])}le?ae=me:Ee==="+"?ae=new _("+","add",[ae,me]):ae=new _("-","subtract",[ae,me]),le=!1}if(le)return new N(0);return ae;function Se(ye,be,De){var Ae=ye.type;if(Ae==="FunctionNode")throw new Error("There is an unsolved function call");if(Ae==="OperatorNode"){if("+-*^".indexOf(ye.op)===-1)throw new Error("Operator "+ye.op+" invalid");if(be!==null){if((ye.fn==="unaryMinus"||ye.fn==="pow")&&be.fn!=="add"&&be.fn!=="subtract"&&be.fn!=="multiply")throw new Error("Invalid "+ye.op+" placing");if((ye.fn==="subtract"||ye.fn==="add"||ye.fn==="multiply")&&be.fn!=="add"&&be.fn!=="subtract")throw new Error("Invalid "+ye.op+" placing");if((ye.fn==="subtract"||ye.fn==="add"||ye.fn==="unaryMinus")&&De.noFil!==0)throw new Error("Invalid "+ye.op+" placing")}(ye.op==="^"||ye.op==="*")&&(De.fire=ye.op);for(var We=0;Wez&&(q[Je]=0),q[Je]+=De.cte*(De.oper==="+"?1:-1),z=Math.max(Je,z);return}De.cte=Je,De.fire===""&&(q[0]+=De.cte*(De.oper==="+"?1:-1))}else throw new Error("Type "+Ae+" is not allowed")}}});var mP="zpk2tf",CV=["typed","add","multiply","Complex","number"],t0=F(mP,CV,e=>{var{typed:r,add:t,multiply:n,Complex:a,number:i}=e;return r(mP,{"Array,Array,number":function(o,u,m){return s(o,u,m)},"Array,Array":function(o,u){return s(o,u,1)},"Matrix,Matrix,number":function(o,u,m){return s(o.valueOf(),u.valueOf(),m)},"Matrix,Matrix":function(o,u){return s(o.valueOf(),u.valueOf(),1)}});function s(c,o,u){c.some(C=>C.type==="BigNumber")&&(c=c.map(C=>i(C))),o.some(C=>C.type==="BigNumber")&&(o=o.map(C=>i(C)));for(var m=[a(1,0)],d=[a(1,0)],h=0;h=0&&m-d{var{typed:r,add:t,multiply:n,Complex:a,divide:i,matrix:s}=e;return r(pP,{"Array, Array":function(u,m){var d=c(512);return l(u,m,d)},"Array, Array, Array":function(u,m,d){return l(u,m,d)},"Array, Array, number":function(u,m,d){if(d<0)throw new Error("w must be a positive number");var h=c(d);return l(u,m,h)},"Matrix, Matrix":function(u,m){var d=c(512),{w:h,h:y}=l(u.valueOf(),m.valueOf(),d);return{w:s(h),h:s(y)}},"Matrix, Matrix, Matrix":function(u,m,d){var{h}=l(u.valueOf(),m.valueOf(),d.valueOf());return{h:s(h),w:s(d)}},"Matrix, Matrix, number":function(u,m,d){if(d<0)throw new Error("w must be a positive number");var h=c(d),{h:y}=l(u.valueOf(),m.valueOf(),h);return{h:s(y),w:s(h)}}});function l(o,u,m){for(var d=[],h=[],y=0;y{var{classes:r}=e;return function(n,a){var i=r[a&&a.mathjs];return i&&typeof i.fromJSON=="function"?i.fromJSON(a):a}});var _V="replacer",OV=[],i0=F(_V,OV,()=>function(r,t){return typeof t=="number"&&(!isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:t});var dP="12.4.1";var o0=F("true",[],()=>!0),s0=F("false",[],()=>!1),u0=F("null",[],()=>null),f0=ya("Infinity",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1/0):1/0}),c0=ya("NaN",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(NaN):NaN}),l0=ya("pi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?Pc(t):ZM}),m0=ya("tau",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?vE(t):QM}),p0=ya("e",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?dE(t):XM}),d0=ya("phi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?hE(t):JM}),h0=ya("LN2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).ln():Math.LN2}),v0=ya("LN10",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(10).ln():Math.LN10}),g0=ya("LOG2E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(2).ln()):Math.LOG2E}),y0=ya("LOG10E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(10).ln()):Math.LOG10E}),x0=ya("SQRT1_2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t("0.5").sqrt():Math.SQRT1_2}),b0=ya("SQRT2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).sqrt():Math.SQRT2}),w0=ya("i",["Complex"],e=>{var{Complex:r}=e;return r.I}),hP=F("PI",["pi"],e=>{var{pi:r}=e;return r}),vP=F("E",["e"],e=>{var{e:r}=e;return r}),D0=F("version",[],()=>dP);function ya(e,r,t){return F(e,r,t,{recreateOnConfigChange:!0})}var S0=Er("speedOfLight","299792458","m s^-1"),N0=Er("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),A0=Er("planckConstant","6.62607015e-34","J s"),M0=Er("reducedPlanckConstant","1.0545718176461565e-34","J s"),C0=Er("magneticConstant","1.25663706212e-6","N A^-2"),E0=Er("electricConstant","8.8541878128e-12","F m^-1"),T0=Er("vacuumImpedance","376.730313667","ohm"),F0=Er("coulomb","8.987551792261171e9","N m^2 C^-2"),_0=Er("elementaryCharge","1.602176634e-19","C"),O0=Er("bohrMagneton","9.2740100783e-24","J T^-1"),B0=Er("conductanceQuantum","7.748091729863649e-5","S"),P0=Er("inverseConductanceQuantum","12906.403729652257","ohm"),I0=Er("magneticFluxQuantum","2.0678338484619295e-15","Wb"),R0=Er("nuclearMagneton","5.0507837461e-27","J T^-1"),q0=Er("klitzing","25812.807459304513","ohm");var k0=Er("bohrRadius","5.29177210903e-11","m"),L0=Er("classicalElectronRadius","2.8179403262e-15","m"),z0=Er("electronMass","9.1093837015e-31","kg"),U0=Er("fermiCoupling","1.1663787e-5","GeV^-2"),W0=xy("fineStructure",.0072973525693),Y0=Er("hartreeEnergy","4.3597447222071e-18","J"),H0=Er("protonMass","1.67262192369e-27","kg"),$0=Er("deuteronMass","3.3435830926e-27","kg"),G0=Er("neutronMass","1.6749271613e-27","kg"),V0=Er("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),Z0=Er("rydberg","10973731.568160","m^-1"),Q0=Er("thomsonCrossSection","6.6524587321e-29","m^2"),X0=xy("weakMixingAngle",.2229),J0=xy("efimovFactor",22.7),K0=Er("atomicMass","1.66053906660e-27","kg"),j0=Er("avogadro","6.02214076e23","mol^-1"),ey=Er("boltzmann","1.380649e-23","J K^-1"),ry=Er("faraday","96485.33212331001","C mol^-1"),ty=Er("firstRadiation","3.7417718521927573e-16","W m^2"),ny=Er("loschmidt","2.686780111798444e25","m^-3"),ay=Er("gasConstant","8.31446261815324","J K^-1 mol^-1"),iy=Er("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),oy=Er("molarVolume","0.022413969545014137","m^3 mol^-1"),sy=xy("sackurTetrode",-1.16487052358),uy=Er("secondRadiation","0.014387768775039337","m K"),fy=Er("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),cy=Er("wienDisplacement","2.897771955e-3","m K"),ly=Er("molarMass","0.99999999965e-3","kg mol^-1"),my=Er("molarMassC12","11.9999999958e-3","kg mol^-1"),py=Er("gravity","9.80665","m s^-2"),dy=Er("planckLength","1.616255e-35","m"),hy=Er("planckMass","2.176435e-8","kg"),vy=Er("planckTime","5.391245e-44","s"),gy=Er("planckCharge","1.87554603778e-18","C"),yy=Er("planckTemperature","1.416785e+32","K");function Er(e,r,t){var n=["config","Unit","BigNumber"];return F(e,n,a=>{var{config:i,Unit:s,BigNumber:l}=a,c=i.number==="BigNumber"?new l(r):parseFloat(r),o=new s(c,t);return o.fixPrefix=!0,o})}function xy(e,r){var t=["config","BigNumber"];return F(e,t,n=>{var{config:a,BigNumber:i}=n;return a.number==="BigNumber"?new i(r):r})}var BV="apply",PV=["typed","isInteger"],by=F(BV,PV,e=>{var{typed:r,isInteger:t}=e,n=Lo({typed:r,isInteger:t});return r("apply",{"...any":function(i){var s=i[1];sr(s)?i[1]=s-1:rr(s)&&(i[1]=s.minus(1));try{return n.apply(null,i)}catch(l){throw mt(l)}}})},{isTransformFunction:!0});var IV="column",RV=["typed","Index","matrix","range"],wy=F(IV,RV,e=>{var{typed:r,Index:t,matrix:n,range:a}=e,i=Wu({typed:r,Index:t,matrix:n,range:a});return r("column",{"...any":function(l){var c=l.length-1,o=l[c];sr(o)&&(l[c]=o-1);try{return i.apply(null,l)}catch(u){throw mt(u)}}})},{isTransformFunction:!0});function lf(e,r,t){var n=e.filter(function(c){return at(c)&&!(c.name in r)&&!t.has(c.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var a=n.name,i=new Map,s=new Eu(t,i,new Set([a])),l=e.compile();return function(o){return i.set(a,o),l.evaluate(s)}}var qV="filter",kV=["typed"],Dy=F(qV,kV,e=>{var{typed:r}=e;function t(a,i,s){var l,c;return a[0]&&(l=a[0].compile().evaluate(s)),a[1]&&(at(a[1])||Oa(a[1])?c=a[1].compile().evaluate(s):c=lf(a[1],i,s)),n(l,c)}t.rawArgs=!0;var n=r("filter",{"Array, function":gP,"Matrix, function":function(i,s){return i.create(gP(i.toArray(),s))},"Array, RegExp":Mu,"Matrix, RegExp":function(i,s){return i.create(Mu(i.toArray(),s))}});return t},{isTransformFunction:!0});function gP(e,r){return _m(e,function(t,n,a){return Ra(r,t,[n+1],a,"filter")})}var LV="forEach",zV=["typed"],Sy=F(LV,zV,e=>{var{typed:r}=e;function t(a,i,s){var l,c;return a[0]&&(l=a[0].compile().evaluate(s)),a[1]&&(at(a[1])||Oa(a[1])?c=a[1].compile().evaluate(s):c=lf(a[1],i,s)),n(l,c)}t.rawArgs=!0;var n=r("forEach",{"Array | Matrix, function":function(i,s){var l=function c(o,u){if(Array.isArray(o))_o(o,function(m,d){c(m,u.concat(d+1))});else return Ra(s,o,u,i,"forEach")};l(i.valueOf(),[])}});return t},{isTransformFunction:!0});var UV="index",WV=["Index","getMatrixDataType"],Ny=F(UV,WV,e=>{var{Index:r,getMatrixDataType:t}=e;return function(){for(var a=[],i=0,s=arguments.length;i0?0:2;else if(l&&l.isSet===!0)l=l.map(function(o){return o-1});else if(Mr(l)||Qe(l))t(l)!=="boolean"&&(l=l.map(function(o){return o-1}));else if(sr(l))l--;else if(rr(l))l=l.toNumber()-1;else if(typeof l!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");a[i]=l}var c=new r;return r.apply(c,a),c}},{isTransformFunction:!0});var YV="map",HV=["typed"],Ay=F(YV,HV,e=>{var{typed:r}=e;function t(a,i,s){var l,c;return a[0]&&(l=a[0].compile().evaluate(s)),a[1]&&(at(a[1])||Oa(a[1])?c=a[1].compile().evaluate(s):c=lf(a[1],i,s)),n(l,c)}t.rawArgs=!0;var n=r("map",{"Array, function":function(i,s){return yP(i,s,i)},"Matrix, function":function(i,s){return i.create(yP(i.valueOf(),s,i))}});return t},{isTransformFunction:!0});function yP(e,r,t){function n(a,i){return Array.isArray(a)?Kn(a,function(s,l){return n(s,i.concat(l+1))}):Ra(r,a,i,t,"map")}return n(e,[])}function Cn(e){if(e.length===2&&Nt(e[0])){e=e.slice();var r=e[1];sr(r)?e[1]=r-1:rr(r)&&(e[1]=r.minus(1))}return e}var $V="max",GV=["typed","config","numeric","larger"],My=F($V,GV,e=>{var{typed:r,config:t,numeric:n,larger:a}=e,i=ef({typed:r,config:t,numeric:n,larger:a});return r("max",{"...any":function(l){l=Cn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var VV="mean",ZV=["typed","add","divide"],Cy=F(VV,ZV,e=>{var{typed:r,add:t,divide:n}=e,a=of({typed:r,add:t,divide:n});return r("mean",{"...any":function(s){s=Cn(s);try{return a.apply(null,s)}catch(l){throw mt(l)}}})},{isTransformFunction:!0});var QV="min",XV=["typed","config","numeric","smaller"],Ey=F(QV,XV,e=>{var{typed:r,config:t,numeric:n,smaller:a}=e,i=rf({typed:r,config:t,numeric:n,smaller:a});return r("min",{"...any":function(l){l=Cn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var JV="range",KV=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Ty=F(JV,KV,e=>{var{typed:r,config:t,matrix:n,bignumber:a,smaller:i,smallerEq:s,larger:l,largerEq:c,add:o,isPositive:u}=e,m=$u({typed:r,config:t,matrix:n,bignumber:a,smaller:i,smallerEq:s,larger:l,largerEq:c,add:o,isPositive:u});return r("range",{"...any":function(h){var y=h.length-1,v=h[y];return typeof v!="boolean"&&h.push(!0),m.apply(null,h)}})},{isTransformFunction:!0});var jV="row",eZ=["typed","Index","matrix","range"],Fy=F(jV,eZ,e=>{var{typed:r,Index:t,matrix:n,range:a}=e,i=Gu({typed:r,Index:t,matrix:n,range:a});return r("row",{"...any":function(l){var c=l.length-1,o=l[c];sr(o)&&(l[c]=o-1);try{return i.apply(null,l)}catch(u){throw mt(u)}}})},{isTransformFunction:!0});var rZ="subset",tZ=["typed","matrix","zeros","add"],_y=F(rZ,tZ,e=>{var{typed:r,matrix:t,zeros:n,add:a}=e,i=Vu({typed:r,matrix:t,zeros:n,add:a});return r("subset",{"...any":function(l){try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var nZ="concat",aZ=["typed","matrix","isInteger"],Oy=F(nZ,aZ,e=>{var{typed:r,matrix:t,isInteger:n}=e,a=Uu({typed:r,matrix:t,isInteger:n});return r("concat",{"...any":function(s){var l=s.length-1,c=s[l];sr(c)?s[l]=c-1:rr(c)&&(s[l]=c.minus(1));try{return a.apply(null,s)}catch(o){throw mt(o)}}})},{isTransformFunction:!0});var xP="diff",iZ=["typed","matrix","subtract","number","bignumber"],By=F(xP,iZ,e=>{var{typed:r,matrix:t,subtract:n,number:a,bignumber:i}=e,s=Yu({typed:r,matrix:t,subtract:n,number:a,bignumber:i});return r(xP,{"...any":function(c){c=Cn(c);try{return s.apply(null,c)}catch(o){throw mt(o)}}})},{isTransformFunction:!0});var oZ="std",sZ=["typed","map","sqrt","variance"],Py=F(oZ,sZ,e=>{var{typed:r,map:t,sqrt:n,variance:a}=e,i=ff({typed:r,map:t,sqrt:n,variance:a});return r("std",{"...any":function(l){l=Cn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var bP="sum",uZ=["typed","config","add","numeric"],Iy=F(bP,uZ,e=>{var{typed:r,config:t,add:n,numeric:a}=e,i=nf({typed:r,config:t,add:n,numeric:a});return r(bP,{"...any":function(l){l=Cn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var fZ="quantileSeq",cZ=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Ry=F(fZ,cZ,e=>{var{typed:r,bignumber:t,add:n,subtract:a,divide:i,multiply:s,partitionSelect:l,compare:c,isInteger:o,smaller:u,smallerEq:m,larger:d}=e,h=uf({typed:r,bignumber:t,add:n,subtract:a,divide:i,multiply:s,partitionSelect:l,compare:c,isInteger:o,smaller:u,smallerEq:m,larger:d});return r("quantileSeq",{"Array | Matrix, number | BigNumber":h,"Array | Matrix, number | BigNumber, number":(v,x,w)=>h(v,x,y(w)),"Array | Matrix, number | BigNumber, boolean":h,"Array | Matrix, number | BigNumber, boolean, number":(v,x,w,C)=>h(v,x,w,y(C)),"Array | Matrix, Array | Matrix":h,"Array | Matrix, Array | Matrix, number":(v,x,w)=>h(v,x,y(w)),"Array | Matrix, Array | Matrix, boolean":h,"Array | Matrix, Array | Matrix, boolean, number":(v,x,w,C)=>h(v,x,w,y(C))});function y(v){return Cn([[],v])[1]}},{isTransformFunction:!0});var wP="cumsum",lZ=["typed","add","unaryPlus"],qy=F(wP,lZ,e=>{var{typed:r,add:t,unaryPlus:n}=e,a=af({typed:r,add:t,unaryPlus:n});return r(wP,{"...any":function(s){if(s.length===2&&Nt(s[0])){var l=s[1];sr(l)?s[1]=l-1:rr(l)&&(s[1]=l.minus(1))}try{return a.apply(null,s)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var DP="variance",mZ=["typed","add","subtract","multiply","divide","apply","isNaN"],ky=F(DP,mZ,e=>{var{typed:r,add:t,subtract:n,multiply:a,divide:i,apply:s,isNaN:l}=e,c=sf({typed:r,add:t,subtract:n,multiply:a,divide:i,apply:s,isNaN:l});return r(DP,{"...any":function(u){u=Cn(u);try{return c.apply(null,u)}catch(m){throw mt(m)}}})},{isTransformFunction:!0});var SP="print",pZ=["typed","matrix","zeros","add"],Ly=F(SP,pZ,e=>{var{typed:r,matrix:t,zeros:n,add:a}=e,i=Qu({typed:r,matrix:t,zeros:n,add:a});return r(SP,{"string, Object | Array":function(c,o){return i(s(c),o)},"string, Object | Array, number | Object":function(c,o,u){return i(s(c),o,u)}});function s(l){return l.replace(qd,c=>{var o=c.slice(1).split("."),u=o.map(function(m){return!isNaN(m)&&m.length>0?parseInt(m)-1:m});return"$"+u.join(".")})}},{isTransformFunction:!0});var dZ="and",hZ=["typed","matrix","zeros","add","equalScalar","not","concat"],zy=F(dZ,hZ,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:s}=e,l=ju({typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:s});function c(o,u,m){var d=o[0].compile().evaluate(m);if(!Nt(d)&&!l(d,!0))return!1;var h=o[1].compile().evaluate(m);return l(d,h)}return c.rawArgs=!0,c},{isTransformFunction:!0});var vZ="or",gZ=["typed","matrix","equalScalar","DenseMatrix","concat"],Uy=F(vZ,gZ,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=e,s=zu({typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i});function l(c,o,u){var m=c[0].compile().evaluate(u);if(!Nt(m)&&s(m,!1))return!0;var d=c[1].compile().evaluate(u);return s(m,d)}return l.rawArgs=!0,l},{isTransformFunction:!0});var yZ="bitAnd",xZ=["typed","matrix","zeros","add","equalScalar","not","concat"],Wy=F(yZ,xZ,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:s}=e,l=ku({typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:s});function c(o,u,m){var d=o[0].compile().evaluate(m);if(!Nt(d)){if(isNaN(d))return NaN;if(d===0||d===!1)return 0}var h=o[1].compile().evaluate(m);return l(d,h)}return c.rawArgs=!0,c},{isTransformFunction:!0});var bZ="bitOr",wZ=["typed","matrix","equalScalar","DenseMatrix","concat"],Yy=F(bZ,wZ,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=e,s=Lu({typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i});function l(c,o,u){var m=c[0].compile().evaluate(u);if(!Nt(m)){if(isNaN(m))return NaN;if(m===-1)return-1;if(m===!0)return 1}var d=c[1].compile().evaluate(u);return s(m,d)}return l.rawArgs=!0,l},{isTransformFunction:!0});var Ge=Ym({config:Oe}),pt=Hm({}),ID=p0({BigNumber:Ge,config:Oe}),NP=s0({}),AP=W0({BigNumber:Ge,config:Oe}),Wo=$m({}),RD=w0({Complex:pt}),MP=f0({BigNumber:Ge,config:Oe}),CP=v0({BigNumber:Ge,config:Oe}),EP=y0({BigNumber:Ge,config:Oe}),kc=Vm({}),TP=c0({BigNumber:Ge,config:Oe}),FP=u0({}),_P=d0({BigNumber:Ge,config:Oe}),OP=Gm({}),qD=Im({}),BP=x0({BigNumber:Ge,config:Oe}),PP=sy({BigNumber:Ge,config:Oe}),kD=m0({BigNumber:Ge,config:Oe}),IP=o0({}),RP=D0({}),Fr=Qm({Matrix:kc}),qP=J0({BigNumber:Ge,config:Oe}),kP=h0({BigNumber:Ge,config:Oe}),Hy=l0({BigNumber:Ge,config:Oe}),LP=i0({}),zP=b0({BigNumber:Ge,config:Oe}),te=Pm({BigNumber:Ge,Complex:pt,DenseMatrix:Fr,Fraction:Wo}),$y=Sp({BigNumber:Ge,config:Oe,typed:te}),UP=X0({BigNumber:Ge,config:Oe}),En=Np({typed:te}),WP=_h({Complex:pt,config:Oe,typed:te}),YP=Bh({BigNumber:Ge,typed:te}),HP=Ih({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),Qt=Mp({typed:te}),$P=Kp({typed:te}),GP=kh({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),VP=zh({typed:te}),LD=Uh({typed:te}),ZP=Yh({Complex:pt,config:Oe,typed:te}),ta=dp({BigNumber:Ge,typed:te}),QP=Xp({typed:te}),XP=pp({typed:te}),JP=Xm({typed:te}),Lc=Og({typed:te}),zc=hp({Complex:pt,typed:te}),Yo=jp({typed:te}),Gy=Hh({typed:te}),KP=Gh({BigNumber:Ge,typed:te}),jP=Zh({BigNumber:Ge,typed:te}),eI=Fp({typed:te}),Ir=fp({config:Oe,typed:te}),rI=Td({typed:te}),zD=_p({typed:te}),tI=Op({Complex:pt,typed:te}),nI=sd({typed:te}),aI=fd({typed:te}),mf=Bd({typed:te}),Vy=cd({typed:te}),iI=Rd({format:mf,typed:te}),Zy=ed({typed:te}),zn=jm({typed:te}),ao=rp({typed:te}),Ho=ap({typed:te}),La=ip({typed:te}),oI=g0({BigNumber:Ge,config:Oe}),sI=Ig({Complex:pt,typed:te}),uI=Rp({Complex:pt,config:Oe,typed:te}),UD=qp({Complex:pt,config:Oe,typed:te}),$o=pd({typed:te}),Ot=kp({typed:te}),Uc=td({typed:te}),Bi=lp({typed:te}),fI=Id({format:mf,typed:te}),cI=Ug({config:Oe,typed:te}),lI=Qu({typed:te}),mI=Wg({config:Oe,typed:te}),Qy=rd({typed:te}),pI=Xh({BigNumber:Ge,typed:te}),WD=Up({BigNumber:Ge,Fraction:Wo,complex:zc,typed:te}),Wc=Kh({typed:te}),Pi=cp({Matrix:kc,equalScalar:Ir,typed:te}),dI=wp({typed:te}),hI=Yp({typed:te}),vI=mp({typed:te}),xa=Cp({typed:te}),gI=ev({typed:te}),YD=sp({typed:te}),yI=Oh({Complex:pt,config:Oe,typed:te}),xI=Rh({BigNumber:Ge,typed:te}),Xy=Lo({isInteger:zn,typed:te}),bI=qh({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),wI=Pd({format:mf,typed:te}),DI=Bg({typed:te}),SI=$h({typed:te}),NI=Qh({BigNumber:Ge,typed:te}),pf=op({typed:te}),AI=Ld({typed:te}),MI=Yg({config:Oe,typed:te}),CI=Jh({BigNumber:Ge,typed:te}),EI=jh({typed:te}),TI=Th({SparseMatrix:Pi,typed:te}),za=Wp({Complex:pt,config:Oe,typed:te}),FI=rv({typed:te}),fi=Dp({typed:te}),_I=Ph({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),OI=Vh({BigNumber:Ge,typed:te}),Ps=vp({Fraction:Wo,typed:te}),Go=tp({typed:te}),$e=gp({DenseMatrix:Fr,Matrix:kc,SparseMatrix:Pi,typed:te}),BI=yp({isZero:La,matrix:$e,typed:te}),PI=_d({isNaN:pf,isNumeric:Go,typed:te}),Ua=zd({bignumber:ta,fraction:Ps,number:Bi}),HD=Od({config:Oe,multiplyScalar:Ot,numeric:Ua,typed:te}),$D=gd({isInteger:zn,matrix:$e,typed:te}),cn=wd({matrix:$e,config:Oe,typed:te}),II=Dd({matrix:$e,typed:te}),df=Sd({matrix:$e,typed:te}),GD=$p({BigNumber:Ge,config:Oe,matrix:$e,typed:te}),ln=Ad({BigNumber:Ge,config:Oe,matrix:$e,typed:te}),RI=Lh({Complex:pt,config:Oe,typed:te}),VD=Ep({BigNumber:Ge,Complex:pt,Fraction:Wo,config:Oe,isNegative:ao,matrix:$e,typed:te,unaryMinus:fi}),Gr=Uu({isInteger:zn,matrix:$e,typed:te}),qI=ad({prod:HD,size:cn,typed:te}),Jy=Nd({conj:Yo,transpose:df,typed:te}),ZD=od({DenseMatrix:Fr,SparseMatrix:Pi,matrix:$e,typed:te}),Mt=Ud({numeric:Ua,typed:te}),hf=Zd({DenseMatrix:Fr,concat:Gr,divideScalar:Mt,equalScalar:Ir,matrix:$e,typed:te}),ba=sh({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),vf=ud({matrix:$e,typed:te}),kI=np({isNumeric:Go,typed:te}),io=ld({BigNumber:Ge,DenseMatrix:Fr,SparseMatrix:Pi,config:Oe,matrix:$e,typed:te}),LI=md({matrix:$e,multiplyScalar:Ot,typed:te}),Yc=vh({DenseMatrix:Fr,concat:Gr,config:Oe,matrix:$e,typed:te}),zI=jd({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),QD=Qd({DenseMatrix:Fr,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te}),Ky=bp({flatten:vf,matrix:$e,size:cn,typed:te}),UI=zp({BigNumber:Ge,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),WI=dd({BigNumber:Ge,config:Oe,matrix:$e,typed:te}),jy=og({addScalar:Qt,complex:zc,conj:Yo,divideScalar:Mt,equal:ba,identity:io,isZero:La,matrix:$e,multiplyScalar:Ot,sign:WD,sqrt:za,subtractScalar:xa,typed:te,unaryMinus:fi,zeros:ln}),YI=yd({config:Oe,matrix:$e}),HI=eh({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),Is=Yd({BigNumber:Ge,DenseMatrix:Fr,config:Oe,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),Tn=ch({DenseMatrix:Fr,concat:Gr,config:Oe,matrix:$e,typed:te}),Bt=Hp({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,subtractScalar:xa,typed:te,unaryMinus:fi}),$I=kd({concat:Gr,matrix:$e,typed:te}),GI=xh({DenseMatrix:Fr,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,typed:te}),ex=Xd({DenseMatrix:Fr,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te}),VI=nd({DenseMatrix:Fr,concat:Gr,matrix:$e,typed:te}),Lr=mv({DenseMatrix:Fr,SparseMatrix:Pi,addScalar:Qt,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),ZI=Wh({BigNumber:Ge,DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),QI=ku({concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),XI=Lu({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),JI=Jp({DenseMatrix:Fr,concat:Gr,matrix:$e,typed:te}),KI=Gg({addScalar:Qt,combinations:Lc,divideScalar:Mt,isInteger:zn,isNegative:ao,multiplyScalar:Ot,typed:te}),Vo=nh({BigNumber:Ge,DenseMatrix:Fr,Fraction:Wo,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,typed:te}),XD=ih({concat:Gr,matrix:$e,typed:te}),jI=af({add:Lr,typed:te,unaryPlus:$y}),rx=gh({equal:ba,typed:te}),e4=Yu({matrix:$e,number:Bi,subtract:Bt,typed:te}),r4=Mg({abs:En,addScalar:Qt,deepEqual:rx,divideScalar:Mt,multiplyScalar:Ot,sqrt:za,subtractScalar:xa,typed:te}),Hc=hv({addScalar:Qt,conj:Yo,multiplyScalar:Ot,size:cn,typed:te}),t4=uh({compareText:XD,isZero:La,typed:te}),JD=Pu({DenseMatrix:Fr,config:Oe,equalScalar:Ir,matrix:$e,round:Is,typed:te,zeros:ln}),n4=Pp({BigNumber:Ge,DenseMatrix:Fr,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,round:Is,typed:te,zeros:ln}),a4=pv({abs:En,addScalar:Qt,divideScalar:Mt,isPositive:Ho,multiplyScalar:Ot,smaller:Tn,sqrt:za,typed:te}),KD=Dh({DenseMatrix:Fr,smaller:Tn}),bn=Sh({ImmutableDenseMatrix:KD,getMatrixDataType:Vy}),Fn=dh({DenseMatrix:Fr,concat:Gr,config:Oe,matrix:$e,typed:te}),tx=Hd({Complex:pt,config:Oe,divideScalar:Mt,typed:te}),i4=Jd({DenseMatrix:Fr,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te}),o4=xp({flatten:vf,matrix:$e,size:cn,typed:te}),s4=rf({config:Oe,numeric:Ua,smaller:Tn,typed:te}),jD=Iu({DenseMatrix:Fr,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,round:Is,typed:te,zeros:ln}),it=Lp({addScalar:Qt,dot:Hc,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,typed:te}),u4=Gd({Complex:pt,config:Oe,divideScalar:Mt,typed:te}),f4=zu({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),$c=bh({compare:Vo,isNaN:pf,isNumeric:Go,typed:te}),c4=rh({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),eS=fg({SparseMatrix:Pi,abs:En,add:Lr,divideScalar:Mt,larger:Fn,largerEq:Yc,multiply:it,subtract:Bt,transpose:df,typed:te}),na=Vu({add:Lr,matrix:$e,typed:te,zeros:ln}),nx=nf({add:Lr,config:Oe,numeric:Ua,typed:te}),l4=vv({add:Lr,matrix:$e,typed:te}),rS=Kd({DenseMatrix:Fr,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te}),m4=t0({Complex:pt,add:Lr,multiply:it,number:Bi,typed:te}),ax=Tp({DenseMatrix:Fr,config:Oe,equalScalar:Ir,matrix:$e,round:Is,typed:te,zeros:ln}),ci=ah({compare:Vo,typed:te}),p4=Vg({addScalar:Qt,combinations:Lc,isInteger:zn,isNegative:ao,isPositive:Ho,larger:Fn,typed:te}),d4=id({matrix:$e,multiply:it,subtract:Bt,typed:te}),tS=vg({divideScalar:Mt,isZero:La,matrix:$e,multiply:it,subtractScalar:xa,typed:te,unaryMinus:fi}),h4=Zp({concat:Gr,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,typed:te}),nS=Nh({larger:Fn,smaller:Tn}),aS=Bp({Complex:pt,DenseMatrix:Fr,ceil:ax,equalScalar:Ir,floor:JD,matrix:$e,typed:te,zeros:ln}),iS=gv({Index:bn,typed:te}),v4=Cg({abs:En,add:Lr,addScalar:Qt,config:Oe,divideScalar:Mt,equalScalar:Ir,flatten:vf,isNumeric:Go,isZero:La,matrix:$e,multiply:it,multiplyScalar:Ot,smaller:Tn,subtract:Bt,typed:te}),g4=Gp({BigNumber:Ge,add:Lr,config:Oe,equal:ba,isInteger:zn,mod:jD,smaller:Tn,typed:te,xgcd:GD}),y4=Ip({concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),x4=$d({Complex:pt,config:Oe,divideScalar:Mt,log:tx,typed:te}),ix=ef({config:Oe,larger:Fn,numeric:Ua,typed:te}),b4=tv({DenseMatrix:Fr,Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),w4=av({DenseMatrix:Fr,Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),D4=ov({Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),S4=uv({Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),Rs=mh({DenseMatrix:Fr,concat:Gr,config:Oe,matrix:$e,typed:te}),N4=wh({compare:Vo,compareNatural:ci,matrix:$e,typed:te}),A4=ju({concat:Gr,equalScalar:Ir,matrix:$e,not:Uc,typed:te,zeros:ln}),qs=$u({bignumber:ta,matrix:$e,add:Lr,config:Oe,isPositive:Ho,larger:Fn,largerEq:Yc,smaller:Tn,smallerEq:Rs,typed:te}),M4=Gu({Index:bn,matrix:$e,range:qs,typed:te}),oS=nv({DenseMatrix:Fr,Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),C4=sv({Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),sS=cv({Index:bn,concat:Gr,setDifference:oS,size:cn,subset:na,typed:te}),uS=Ah({FibonacciHeap:nS,addScalar:Qt,equalScalar:Ir}),fS=Wu({Index:bn,matrix:$e,range:qs,typed:te}),Zo=gg({abs:En,addScalar:Qt,det:tS,divideScalar:Mt,identity:io,matrix:$e,multiply:it,typed:te,unaryMinus:fi}),cS=ig({DenseMatrix:Fr,Spa:uS,SparseMatrix:Pi,abs:En,addScalar:Qt,divideScalar:Mt,equalScalar:Ir,larger:Fn,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te,unaryMinus:fi}),E4=yg({Complex:pt,add:Lr,ctranspose:Jy,deepEqual:rx,divideScalar:Mt,dot:Hc,dotDivide:hf,equal:ba,inv:Zo,matrix:$e,multiply:it,typed:te}),wa=Wd({Complex:pt,config:Oe,fraction:Ps,identity:io,inv:Zo,matrix:$e,multiply:it,number:Bi,typed:te}),lS=iv({DenseMatrix:Fr,Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),T4=lv({Index:bn,concat:Gr,setIntersect:lS,setSymDifference:sS,size:cn,subset:na,typed:te}),F4=wg({abs:En,add:Lr,identity:io,inv:Zo,map:$o,max:ix,multiply:it,size:cn,sqrt:za,subtract:Bt,typed:te}),wr=Ch({BigNumber:Ge,Complex:pt,Fraction:Wo,abs:En,addScalar:Qt,config:Oe,divideScalar:Mt,equal:ba,fix:aS,format:mf,isNumeric:Go,multiplyScalar:Ot,number:Bi,pow:wa,round:Is,subtractScalar:xa}),_4=T0({BigNumber:Ge,Unit:wr,config:Oe}),O4=cy({BigNumber:Ge,Unit:wr,config:Oe}),B4=K0({BigNumber:Ge,Unit:wr,config:Oe}),P4=O0({BigNumber:Ge,Unit:wr,config:Oe}),I4=ey({BigNumber:Ge,Unit:wr,config:Oe}),R4=B0({BigNumber:Ge,Unit:wr,config:Oe}),q4=F0({BigNumber:Ge,Unit:wr,config:Oe}),k4=$0({BigNumber:Ge,Unit:wr,config:Oe}),L4=Vd({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,pow:wa,typed:te}),z4=E0({BigNumber:Ge,Unit:wr,config:Oe}),U4=_0({BigNumber:Ge,Unit:wr,config:Oe}),W4=bg({abs:En,add:Lr,identity:io,inv:Zo,multiply:it,typed:te}),Y4=ry({BigNumber:Ge,Unit:wr,config:Oe}),mS=Md({addScalar:Qt,ceil:ax,conj:Yo,divideScalar:Mt,dotDivide:hf,exp:zD,i:RD,log2:UD,matrix:$e,multiplyScalar:Ot,pow:wa,tau:kD,typed:te}),ox=Pg({BigNumber:Ge,Complex:pt,config:Oe,multiplyScalar:Ot,pow:wa,typed:te}),H4=N0({BigNumber:Ge,Unit:wr,config:Oe}),$4=Y0({BigNumber:Ge,Unit:wr,config:Oe}),G4=Cd({conj:Yo,dotDivide:hf,fft:mS,typed:te}),V4=q0({BigNumber:Ge,Unit:wr,config:Oe}),Z4=ny({BigNumber:Ge,Unit:wr,config:Oe}),Q4=C0({BigNumber:Ge,Unit:wr,config:Oe}),X4=ly({BigNumber:Ge,Unit:wr,config:Oe}),J4=iy({BigNumber:Ge,Unit:wr,config:Oe}),K4=G0({BigNumber:Ge,Unit:wr,config:Oe}),j4=R0({BigNumber:Ge,Unit:wr,config:Oe}),eR=gy({BigNumber:Ge,Unit:wr,config:Oe}),rR=dy({BigNumber:Ge,Unit:wr,config:Oe}),tR=yy({BigNumber:Ge,Unit:wr,config:Oe}),nR=H0({BigNumber:Ge,Unit:wr,config:Oe}),aR=V0({BigNumber:Ge,Unit:wr,config:Oe}),iR=M0({BigNumber:Ge,Unit:wr,config:Oe}),oR=Z0({BigNumber:Ge,Unit:wr,config:Oe}),sR=uy({BigNumber:Ge,Unit:wr,config:Oe}),uR=S0({BigNumber:Ge,Unit:wr,config:Oe}),fR=fy({BigNumber:Ge,Unit:wr,config:Oe}),cR=Q0({BigNumber:Ge,Unit:wr,config:Oe}),lR=j0({BigNumber:Ge,Unit:wr,config:Oe}),mR=k0({BigNumber:Ge,Unit:wr,config:Oe}),pR=Fh({Unit:wr,typed:te}),an=Ag({divideScalar:Mt,equalScalar:Ir,inv:Zo,matrix:$e,multiply:it,typed:te}),dR=z0({BigNumber:Ge,Unit:wr,config:Oe}),gf=Rg({gamma:ox,typed:te}),hR=ty({BigNumber:Ge,Unit:wr,config:Oe}),vR=py({BigNumber:Ge,Unit:wr,config:Oe}),gR=P0({BigNumber:Ge,Unit:wr,config:Oe}),pS=cg({DenseMatrix:Fr,lsolve:QD,lup:cS,matrix:$e,slu:eS,typed:te,usolve:ex}),yR=I0({BigNumber:Ge,Unit:wr,config:Oe}),xR=my({BigNumber:Ge,Unit:wr,config:Oe}),bR=kg({add:Lr,divide:an,factorial:gf,isInteger:zn,isPositive:Ho,multiply:it,typed:te}),wR=Lg({factorial:gf,typed:te}),DR=hy({BigNumber:Ge,Unit:wr,config:Oe}),SR=lg({add:Lr,cbrt:VD,divide:an,equalScalar:Ir,im:Zy,isZero:La,multiply:it,re:Qy,sqrt:za,subtract:Bt,typeOf:YD,typed:te,unaryMinus:fi}),NR=fv({compareNatural:ci,typed:te}),AR=Ed({abs:En,add:Lr,bignumber:ta,divide:an,isNegative:ao,isPositive:Ho,larger:Fn,map:$o,matrix:$e,max:ix,multiply:it,smaller:Tn,subtract:Bt,typed:te,unaryMinus:fi}),dS=Hg({bignumber:ta,addScalar:Qt,combinations:Lc,divideScalar:Mt,factorial:gf,isInteger:zn,isNegative:ao,larger:Fn,multiplyScalar:Ot,number:Bi,pow:wa,subtractScalar:xa,typed:te}),MR=Eh({Unit:wr,typed:te}),CR=$g({addScalar:Qt,isInteger:zn,isNegative:ao,stirlingS2:dS,typed:te}),hS=xg({abs:En,add:Lr,addScalar:Qt,atan:LD,bignumber:ta,column:fS,complex:zc,config:Oe,cos:Gy,diag:ZD,divideScalar:Mt,dot:Hc,equal:ba,flatten:vf,im:Zy,inv:Zo,larger:Fn,matrix:$e,matrixFromColumns:Ky,multiply:it,multiplyScalar:Ot,number:Bi,qr:jy,re:Qy,reshape:$D,sin:Wc,size:cn,smaller:Tn,sqrt:za,subtract:Bt,typed:te,usolve:ex,usolveAll:rS}),ER=U0({BigNumber:Ge,Unit:wr,config:Oe}),TR=ay({BigNumber:Ge,Unit:wr,config:Oe}),FR=qg({divide:an,dotDivide:hf,isNumeric:Go,log:tx,map:$o,matrix:$e,multiply:it,sum:nx,typed:te}),vS=of({add:Lr,divide:an,typed:te}),_R=oy({BigNumber:Ge,Unit:wr,config:Oe}),OR=A0({BigNumber:Ge,Unit:wr,config:Oe}),BR=uf({bignumber:ta,add:Lr,compare:Vo,divide:an,isInteger:zn,larger:Fn,multiply:it,partitionSelect:$c,smaller:Tn,smallerEq:Rs,subtract:Bt,typed:te}),sx=sf({add:Lr,apply:Xy,divide:an,isNaN:pf,multiply:it,subtract:Bt,typed:te}),PR=L0({BigNumber:Ge,Unit:wr,config:Oe}),gS=Tg({add:Lr,compare:Vo,divide:an,partitionSelect:$c,typed:te}),IR=_g({add:Lr,divide:an,matrix:$e,mean:vS,multiply:it,pow:wa,sqrt:za,subtract:Bt,sum:nx,typed:te}),RR=n0({Complex:pt,add:Lr,divide:an,matrix:$e,multiply:it,typed:te}),qR=Fg({abs:En,map:$o,median:gS,subtract:Bt,typed:te}),kR=ff({map:$o,sqrt:za,typed:te,variance:sx}),LR=Fd({BigNumber:Ge,Complex:pt,add:Lr,config:Oe,divide:an,equal:ba,factorial:gf,gamma:ox,isNegative:ao,multiply:it,pi:Hy,pow:wa,sin:Wc,smallerEq:Rs,subtract:Bt,typed:te}),ux=dv({abs:En,add:Lr,conj:Yo,ctranspose:Jy,eigs:hS,equalScalar:Ir,larger:Fn,matrix:$e,multiply:it,pow:wa,smaller:Tn,sqrt:za,typed:te}),yS=bd({BigNumber:Ge,DenseMatrix:Fr,SparseMatrix:Pi,addScalar:Qt,config:Oe,cos:Gy,matrix:$e,multiplyScalar:Ot,norm:ux,sin:Wc,typed:te,unaryMinus:fi}),zR=vy({BigNumber:Ge,Unit:wr,config:Oe}),xS=Sg({identity:io,matrix:$e,multiply:it,norm:ux,qr:jy,subtract:Bt,typed:te}),UR=xd({multiply:it,rotationMatrix:yS,typed:te}),bS=Dg({abs:En,add:Lr,concat:Gr,identity:io,index:iS,lusolve:pS,matrix:$e,matrixFromColumns:Ky,multiply:it,range:qs,schur:xS,subset:na,subtract:Bt,transpose:df,typed:te}),WR=Ng({matrix:$e,multiply:it,sylvester:bS,transpose:df,typed:te});var yf={},xf={},YR={},_n=xv({mathWithTransform:xf}),bf=Wv({Node:_n}),oo=Hv({Node:_n}),ks=Gv({Node:_n}),HR=Xv({Node:_n}),wf=Nv({Node:_n}),$R=Fv({Node:_n,ResultSet:qD}),GR=Ov({Node:_n}),Qo=Rv({Node:_n}),VR=Zv({Node:_n}),DZ=a0({classes:YR}),wS=pg({math:yf,typed:te}),ZR=kv({Node:_n,typed:te}),SZ=hg({Chain:wS,typed:te}),Df=zv({Node:_n,size:cn}),Sf=Dv({Node:_n,subset:na}),QR=Ev({matrix:$e,Node:_n,subset:na}),Xo=Jv({Unit:wr,Node:_n,math:yf}),Jo=jv({Node:_n,SymbolNode:Xo,math:yf}),Wa=eg({AccessorNode:Sf,ArrayNode:wf,AssignmentNode:QR,BlockNode:$R,ConditionalNode:GR,ConstantNode:Qo,FunctionAssignmentNode:ZR,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,RangeNode:VR,RelationalNode:HR,SymbolNode:Xo,config:Oe,numeric:Ua,typed:te}),XR=Kg({ConstantNode:Qo,FunctionNode:Jo,OperatorNode:oo,ParenthesisNode:ks,parse:Wa,typed:te}),DS=Xg({bignumber:ta,fraction:Ps,AccessorNode:Sf,ArrayNode:wf,ConstantNode:Qo,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,SymbolNode:Xo,config:Oe,mathWithTransform:xf,matrix:$e,typed:te}),NZ=rg({parse:Wa,typed:te}),SS=Jg({AccessorNode:Sf,ArrayNode:wf,ConstantNode:Qo,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,SymbolNode:Xo,add:Lr,divide:an,equal:ba,isZero:La,multiply:it,parse:Wa,pow:wa,subtract:Bt,typed:te}),NS=tg({parse:Wa,typed:te}),JR=mg({evaluate:NS}),KR=ng({evaluate:NS}),fx=Qg({bignumber:ta,fraction:Ps,AccessorNode:Sf,ArrayNode:wf,ConstantNode:Qo,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,SymbolNode:Xo,add:Lr,config:Oe,divide:an,equal:ba,isZero:La,mathWithTransform:xf,matrix:$e,multiply:it,parse:Wa,pow:wa,resolve:XR,simplifyConstant:DS,simplifyCore:SS,subtract:Bt,typed:te}),AZ=jg({OperatorNode:oo,parse:Wa,simplify:fx,typed:te}),MZ=Zg({parse:Wa,typed:te}),CZ=ag({Parser:KR,typed:te}),EZ=r0({bignumber:ta,fraction:Ps,AccessorNode:Sf,ArrayNode:wf,ConstantNode:Qo,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,SymbolNode:Xo,add:Lr,config:Oe,divide:an,equal:ba,isZero:La,mathWithTransform:xf,matrix:$e,multiply:it,parse:Wa,pow:wa,simplify:fx,simplifyConstant:DS,simplifyCore:SS,subtract:Bt,typed:te}),TZ=e0({ConstantNode:Qo,FunctionNode:Jo,OperatorNode:oo,ParenthesisNode:ks,SymbolNode:Xo,config:Oe,equal:ba,isZero:La,numeric:Ua,parse:Wa,simplify:fx,typed:te}),FZ=dg({Help:JR,mathWithTransform:xf,typed:te});ht(yf,{e:ID,false:NP,fineStructure:AP,i:RD,Infinity:MP,LN10:CP,LOG10E:EP,NaN:TP,null:FP,phi:_P,SQRT1_2:BP,sackurTetrode:PP,tau:kD,true:IP,E:ID,version:RP,efimovFactor:qP,LN2:kP,pi:Hy,replacer:LP,reviver:DZ,SQRT2:zP,typed:te,unaryPlus:$y,PI:Hy,weakMixingAngle:UP,abs:En,acos:WP,acot:YP,acsc:HP,addScalar:Qt,arg:$P,asech:GP,asinh:VP,atan:LD,atanh:ZP,bignumber:ta,bitNot:QP,boolean:XP,clone:JP,combinations:Lc,complex:zc,conj:Yo,cos:Gy,cot:KP,csc:jP,cube:eI,equalScalar:Ir,erf:rI,exp:zD,expm1:tI,filter:nI,forEach:aI,format:mf,getMatrixDataType:Vy,hex:iI,im:Zy,isInteger:zn,isNegative:ao,isPositive:Ho,isZero:La,LOG2E:oI,lgamma:sI,log10:uI,log2:UD,map:$o,multiplyScalar:Ot,not:Uc,number:Bi,oct:fI,pickRandom:cI,print:lI,random:mI,re:Qy,sec:pI,sign:WD,sin:Wc,splitUnit:dI,square:hI,string:vI,subtractScalar:xa,tan:gI,typeOf:YD,acosh:yI,acsch:xI,apply:Xy,asec:bI,bin:wI,chain:SZ,combinationsWithRep:DI,cosh:SI,csch:NI,isNaN:pf,isPrime:AI,randomInt:MI,sech:CI,sinh:EI,sparse:TI,sqrt:za,tanh:FI,unaryMinus:fi,acoth:_I,coth:OI,fraction:Ps,isNumeric:Go,matrix:$e,matrixFromFunction:BI,mode:PI,numeric:Ua,prod:HD,reshape:$D,size:cn,squeeze:II,transpose:df,xgcd:GD,zeros:ln,asin:RI,cbrt:VD,concat:Gr,count:qI,ctranspose:Jy,diag:ZD,divideScalar:Mt,dotDivide:hf,equal:ba,flatten:vf,hasNumericValue:kI,identity:io,kron:LI,largerEq:Yc,leftShift:zI,lsolve:QD,matrixFromColumns:Ky,nthRoot:UI,ones:WI,qr:jy,resize:YI,rightArithShift:HI,round:Is,smaller:Tn,subtract:Bt,to:$I,unequal:GI,usolve:ex,xor:VI,add:Lr,atan2:ZI,bitAnd:QI,bitOr:XI,bitXor:JI,catalan:KI,compare:Vo,compareText:XD,cumsum:jI,deepEqual:rx,diff:e4,distance:r4,dot:Hc,equalText:t4,floor:JD,gcd:n4,hypot:a4,larger:Fn,log:tx,lsolveAll:i4,matrixFromRows:o4,min:s4,mod:jD,multiply:it,nthRoots:u4,or:f4,partitionSelect:$c,rightLogShift:c4,slu:eS,subset:na,sum:nx,trace:l4,usolveAll:rS,zpk2tf:m4,ceil:ax,compareNatural:ci,composition:p4,cross:d4,det:tS,dotMultiply:h4,fix:aS,index:iS,intersect:v4,invmod:g4,lcm:y4,log1p:x4,max:ix,setCartesian:b4,setDistinct:w4,setIsSubset:D4,setPowerset:S4,smallerEq:Rs,sort:N4,and:A4,range:qs,row:M4,setDifference:oS,setMultiplicity:C4,setSymDifference:sS,column:fS,inv:Zo,lup:cS,pinv:E4,pow:wa,setIntersect:lS,setUnion:T4,sqrtm:F4,vacuumImpedance:_4,wienDisplacement:O4,atomicMass:B4,bohrMagneton:P4,boltzmann:I4,conductanceQuantum:R4,coulomb:q4,deuteronMass:k4,dotPow:L4,electricConstant:z4,elementaryCharge:U4,expm:W4,faraday:Y4,fft:mS,gamma:ox,gravitationConstant:H4,hartreeEnergy:$4,ifft:G4,klitzing:V4,loschmidt:Z4,magneticConstant:Q4,molarMass:X4,molarPlanckConstant:J4,neutronMass:K4,nuclearMagneton:j4,planckCharge:eR,planckLength:rR,planckTemperature:tR,protonMass:nR,quantumOfCirculation:aR,reducedPlanckConstant:iR,rydberg:oR,secondRadiation:sR,speedOfLight:uR,stefanBoltzmann:fR,thomsonCrossSection:cR,avogadro:lR,bohrRadius:mR,createUnit:pR,divide:an,electronMass:dR,factorial:gf,firstRadiation:hR,gravity:vR,inverseConductanceQuantum:gR,lusolve:pS,magneticFluxQuantum:yR,molarMassC12:xR,multinomial:bR,parse:Wa,permutations:wR,planckMass:DR,polynomialRoot:SR,resolve:XR,setSize:NR,simplifyConstant:DS,solveODE:AR,stirlingS2:dS,unit:MR,bellNumbers:CR,compile:NZ,eigs:hS,fermiCoupling:ER,gasConstant:TR,kldivergence:FR,mean:vS,molarVolume:_R,planckConstant:OR,quantileSeq:BR,simplifyCore:SS,variance:sx,classicalElectronRadius:PR,evaluate:NS,median:gS,simplify:fx,symbolicEqual:AZ,corr:IR,freqz:RR,leafCount:MZ,mad:qR,parser:CZ,rationalize:EZ,std:kR,zeta:LR,derivative:TZ,norm:ux,rotationMatrix:yS,help:FZ,planckTime:zR,schur:xS,rotate:UR,sylvester:bS,lyap:WR,config:Oe});ht(xf,yf,{filter:Dy({typed:te}),forEach:Sy({typed:te}),map:Ay({typed:te}),apply:by({isInteger:zn,typed:te}),or:Uy({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),and:zy({add:Lr,concat:Gr,equalScalar:Ir,matrix:$e,not:Uc,typed:te,zeros:ln}),concat:Oy({isInteger:zn,matrix:$e,typed:te}),max:My({config:Oe,larger:Fn,numeric:Ua,typed:te}),print:Ly({add:Lr,matrix:$e,typed:te,zeros:ln}),bitAnd:Wy({add:Lr,concat:Gr,equalScalar:Ir,matrix:$e,not:Uc,typed:te,zeros:ln}),diff:By({bignumber:ta,matrix:$e,number:Bi,subtract:Bt,typed:te}),min:Ey({config:Oe,numeric:Ua,smaller:Tn,typed:te}),subset:_y({add:Lr,matrix:$e,typed:te,zeros:ln}),bitOr:Yy({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),cumsum:qy({add:Lr,typed:te,unaryPlus:$y}),index:Ny({Index:bn,getMatrixDataType:Vy}),sum:Iy({add:Lr,config:Oe,numeric:Ua,typed:te}),range:Ty({bignumber:ta,matrix:$e,add:Lr,config:Oe,isPositive:Ho,larger:Fn,largerEq:Yc,smaller:Tn,smallerEq:Rs,typed:te}),row:Fy({Index:bn,matrix:$e,range:qs,typed:te}),column:wy({Index:bn,matrix:$e,range:qs,typed:te}),mean:Cy({add:Lr,divide:an,typed:te}),quantileSeq:Ry({add:Lr,bignumber:ta,compare:Vo,divide:an,isInteger:zn,larger:Fn,multiply:it,partitionSelect:$c,smaller:Tn,smallerEq:Rs,subtract:Bt,typed:te}),variance:ky({add:Lr,apply:Xy,divide:an,isNaN:pf,multiply:it,subtract:Bt,typed:te}),std:Py({map:$o,sqrt:za,typed:te,variance:sx})});ht(YR,{BigNumber:Ge,Complex:pt,Fraction:Wo,Matrix:kc,Node:_n,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,Range:OP,RelationalNode:HR,ResultSet:qD,ArrayNode:wf,BlockNode:$R,ConditionalNode:GR,ConstantNode:Qo,DenseMatrix:Fr,RangeNode:VR,Chain:wS,FunctionAssignmentNode:ZR,SparseMatrix:Pi,IndexNode:Df,ImmutableDenseMatrix:KD,Index:bn,AccessorNode:Sf,AssignmentNode:QR,FibonacciHeap:nS,Spa:uS,Unit:wr,SymbolNode:Xo,FunctionNode:Jo,Help:JR,Parser:KR});wS.createProxy(yf);var AS=PD;var n5=ma(Nm(),1);var e5=ma(jR(),1);function r5(e){var r=new e5.default;return e.on=r.on.bind(r),e.off=r.off.bind(r),e.once=r.once.bind(r),e.emit=r.emit.bind(r),e}function t5(e,r,t,n){function a(x,w){var C=arguments.length;if(C!==1&&C!==2)throw new ga("import",C,1,2);w||(w={});function b(O,_,E){if(Array.isArray(_))_.forEach(L=>b(O,L));else if(typeof _=="object")for(var T in _)Xe(_,T)&&b(O,_[T],T);else if(Ms(_)||E!==void 0){var R=Ms(_)?y(_)?_.fn+".transform":_.fn:E;if(Xe(O,R)&&O[R]!==_&&!w.silent)throw new Error('Cannot import "'+R+'" twice');O[R]=_}else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}var N={};b(N,x);for(var M in N)if(Xe(N,M)){var S=N[M];if(Ms(S))o(S,w);else if(u(S))i(M,S,w);else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}}function i(x,w,C){if(C.wrap&&typeof w=="function"&&(w=c(w)),m(w)&&(w=e(x,{[w.signature]:w})),e.isTypedFunction(t[x])&&e.isTypedFunction(w)){C.override?w=e(x,w.signatures):w=e(t[x],w),t[x]=w,delete n[x],s(x,w),t.emit("import",x,function(){return w});return}if(t[x]===void 0||C.override){t[x]=w,delete n[x],s(x,w),t.emit("import",x,function(){return w});return}if(!C.silent)throw new Error('Cannot import "'+x+'": already exists')}function s(x,w){w&&typeof w.transform=="function"?(t.expression.transform[x]=w.transform,d(x)&&(t.expression.mathWithTransform[x]=w.transform)):(delete t.expression.transform[x],d(x)&&(t.expression.mathWithTransform[x]=w))}function l(x){delete t.expression.transform[x],d(x)?t.expression.mathWithTransform[x]=t[x]:delete t.expression.mathWithTransform[x]}function c(x){var w=function(){for(var b=[],N=0,M=arguments.length;N2&&arguments[2]!==void 0?arguments[2]:x.fn;if(Jb(C,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(C));var b=y(x)?t.expression.transform:t,N=C in t.expression.transform,M=Xe(b,C)?b[C]:void 0,S=function(){var _={};x.dependencies.map(ew).forEach(T=>{if(Jb(T,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(T));T==="math"?_.math=t:T==="mathWithTransform"?_.mathWithTransform=t.expression.mathWithTransform:T==="classes"?_.classes=t:_[T]=t[T]});var E=x(_);if(E&&typeof E.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(M===void 0||w.override)return E;if(e.isTypedFunction(M)&&e.isTypedFunction(E))return e(M,E);if(w.silent)return M;throw new Error('Cannot import "'+C+'": already exists')};!x.meta||x.meta.lazy!==!1?(Du(b,C,S),M&&N?l(C):(y(x)||h(x))&&Du(t.expression.mathWithTransform,C,()=>b[C])):(b[C]=S(),M&&N?l(C):(y(x)||h(x))&&Du(t.expression.mathWithTransform,C,()=>b[C])),n[C]=x,t.emit("import",C,S)}function u(x){return typeof x=="function"||typeof x=="number"||typeof x=="string"||typeof x=="boolean"||x===null||Ht(x)||Kt(x)||rr(x)||da(x)||Qe(x)||Array.isArray(x)}function m(x){return typeof x=="function"&&typeof x.signature=="string"}function d(x){return!Xe(v,x)}function h(x){return x.fn.indexOf(".")===-1&&!Xe(v,x.fn)&&(!x.meta||!x.meta.isClass)}function y(x){return x!==void 0&&x.meta!==void 0&&x.meta.isTransformFunction===!0||!1}var v={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return a}function cx(e,r){var t=ht({},Ss,r);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var n=r5({isNumber:sr,isComplex:Kt,isBigNumber:rr,isFraction:da,isUnit:Ht,isString:St,isArray:Mr,isMatrix:Qe,isCollection:Nt,isDenseMatrix:Ji,isSparseMatrix:ha,isRange:Fo,isIndex:Mi,isBoolean:fm,isResultSet:cm,isHelp:xu,isFunction:lm,isDate:mm,isRegExp:pm,isObject:Ci,isNull:dm,isUndefined:hm,isAccessorNode:Ln,isArrayNode:jt,isAssignmentNode:vm,isBlockNode:gm,isConditionalNode:ym,isConstantNode:xr,isFunctionAssignmentNode:Oa,isFunctionNode:yn,isIndexNode:Jn,isNode:Nr,isObjectNode:Ei,isOperatorNode:ct,isParenthesisNode:en,isRangeNode:xm,isRelationalNode:bm,isSymbolNode:at,isChain:bu});n.config=ZA(t,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}};var a=[],i=[];function s(u){if(Ms(u))return u(n);var m=u[Object.keys(u)[0]];if(Ms(m))return m(n);if(!$A(u))throw console.warn("Factory object with properties \`type\`, \`name\`, and \`factory\` expected",u),new Error("Factory object with properties \`type\`, \`name\`, and \`factory\` expected");var d=a.indexOf(u),h;return d===-1?(u.math===!0?h=u.factory(n.type,t,s,n.typed,n):h=u.factory(n.type,t,s,n.typed),a.push(u),i.push(h)):h=i[d],h}var l={};function c(){for(var u=arguments.length,m=new Array(u),d=0;d{Ub(l).forEach(u=>{u&&u.meta&&u.meta.recreateOnConfigChange&&o(u,{override:!0})})}),n.create=cx.bind(null,e),n.factory=F,n.import(Ub(YA(e))),n.ArgumentsError=ga,n.DimensionError=pr,n.IndexError=tn,n}var LS=ma(um());var i5=ma(a5()),TS=class{constructor(){this.lang="en";this.all={en:{hintText:{dragDropModifierKeys:"Hold \${1} to Pin and \${2} to Copy",createListItem:"Select/Create List Item Frame",dragDropProperties:"Drag and drop properties to link them into the list",newItem:"+ New",selectNote:"Select Note...",newFrame:"New"},defaults:{spaceNote:"Current Note",spaceContext:"Current Space"},commands:{h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",columns:"Columns",tabs:"Tabs",button:"Button",label:"Label",column:"Column",idea:"New",group:"Group",paragraph:"Text",card:"Card",progress:"Progress",rating:"Rating",circularProgress:"Circular Progress",list:"Bullet List","ordered-list":"Numbered List",todo:"To-do List",quote:"Quote",internal:"Link to Note",context:"Embed Existing Context",flow:"Embed Note or Space",board:"New Board",divider:"Divider",note:"Note Block",link:"Web Link",callout:"Callout",bookmark:"Bookmark",table:"New Table",codeblock:"Code Block",toggle:"Toggle",emoji:"Emoji",image:"Image",newNote:"New Note",tag:"Tag",makeMenu:"Flow Menu",selectStyle:"Style",toggleKeyboard:"Toggle Keyboard",rows:"Rows",masonry:"Gallery"},styles:{bold:"Bold",italics:"Italics",strikethrough:"Strikethrough",code:"Code",link:"Web Link",blocklink:"Link to Note",textColor:"Text Color",highlight:"Highlight"},commandsSuggest:{noResult:"No result"},commandPalette:{enable:"Enable",disabled:"Disable",openFlow:"Open Flow Blocks in Selection",closeFlow:"Close Flow Blocks in Selection",toggleBold:"Toggle Bold",toggleItalics:"Toggle Italics",openSpaces:"Open Spaces",blink:"Blink",openFileContext:"Open Explorer",convertPathToSpace:"Convert to Space",revealFile:"Reveal File in Spaces",releaseNotes:"Release Notes",toggleBacklinks:"Toggle Backlinks",collapseAllFolders:"Collapse All Folders",addFileSpace:"Add File to Space",removeFileSpace:"Remove File from Space"},frames:{sections:{kit:"Kit",paths:"Paths"},label:{label:"Label",description:"Label"},note:{label:"Note",description:"Link to a note"},table:{label:"Table",description:"Table"},context:{label:"Context",description:"Display a context view from another space"},calendar:{label:"Calendar View"},field:{label:"Field",description:"Dynamic node that displays a value based on property type"},event:{label:"Event"},divider:{label:"Divider",description:"Divider to separate your content"},button:{label:"Button",description:"Buttons can perform actions and open links"},callout:{label:"Callout",description:"Callout to highlight important information"},toggle:{label:"Toggle",description:"Toggle to show/hide content"}},menu:{layout:"Layout",enterFlowState:"Enter Flow State",exitFlowState:"Exit Flow State",newView:"New View",calendarView:"Calendar View",dayView:"Day View",closeSpace:"Close Space in Focus",customView:"Custom View",detailsView:"Details View",catalogView:"Catalog View",galleryView:"Gallery View",deleteContext:"Delete Context",openSpace:"Open Space",revealInDefault:"Reveal in Finder",revealInExplorer:"Reveal in Explorer",setNone:"None",fileMetadataDescription:"This note only",openFilePane:"Open in a new pane",rename:"Rename",changeToFolderNote:"New Space from Note",moveFile:"Move file to...",moveFolder:"Move folder to...",duplicate:"Make a copy",edit:"Edit",delete:"Delete",getHelp:"Make.md Community",vault:"Vault",openVault:"Open Another Vault",openVaultInFolder:"Open Vault Folder",obSettings:"Obsidian Settings",commandPalette:"Command Palette",backToSpace:"Back to Spaces",collapseAllSections:"Collapse All Spaces",expandAllSections:"Expand All Spaces",collapseAllFolders:"Collapse All Folders",expandAllFolders:"Expand All Folders",spaceTitle:"Add/Remove in Space",home:"Home",waypoints:"Waypoints",none:"None",tableView:"Table View",cardView:"Card View",boardView:"Board View",listView:"List View",flowView:"Flow View",groupBy:"Group",sortBy:"Sort",filters:"Filters",newFilter:"New Filter",clearFilters:"Clear Filters",hide:"Hide",unhideFields:"Unhide All Properties",importDataview:"Import All Dataview Properties",saveAllProperties:"Save All Properties to Files",mergeProperties:"Merge Properties",removeFromSpace:"Unpin from Space",removeFromWaypoints:"Unpin from Waypoints",editCode:"Edit Code",editProperties:"Edit Properties",properties:"Properties",deleteProperty:"Delete Property",hideProperty:"Hide Property",unhideProperty:"Unhide Property",saveProperty:"Save Property",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",deleteRow:"Delete Item",collapseAll:"Collapse All",customSort:"Custom Sort",groupSpaces:"Group Spaces",fileNameSortAlphaAsc:"File Name (A to Z)",fileNameSortAlphaDesc:"File Name (Z to A)",fileNameSortNumericalAsc:"File Name (1 to 9)",fileNameSortNumericalDesc:"File Name (9 to 1)",createdTimeSortAsc:"Created Time (new to old)",createdTimeSortDesc:"Created Time (old to new)",modifiedTimeSortAsc:"Modified Time (new to old)",modifiedTimeSortDesc:"Modified Time (old to new)",sizeSortAsc:"Size (smallest to largest)",sizeSortDesc:"Size (largest to smallest)",spaces:"Spaces",tags:"Tags",manageHiddenFiles:"Manage Hidden Files",manageActions:"Manage Actions",deleteSpace:"Delete",changeColor:"Change Color",changePropertyType:"Change Type",deleteFiles:"Delete Files",createFolderSpace:"Create Space from Folder",folder:"Folder",syncToContext:"Add Property to Context",setIcon:"Set Icon",copyEmbedLink:"Copy Embed Link",moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",groupNodes:"Group Nodes",moveFrame:"Move Frame",renameFrame:"Rename Frame",deleteFrame:"Delete Frame",insertAbove:"Insert Above",insertBelow:"Insert Below"},editor:{rows:"Rows",columns:"Columns",catalog:"Catalog",gallery:"Gallery",grid:"Grid",scaleToFit:"Change to Fit",scaleToFill:"Change to Fill",fit:"Fit",strokeNone:"None",strokeSolid:"Solid",strokeDotted:"Dotted",strokeDashed:"Dashed",size:"Size",gap:"Gap",marginLeft:"Left",marginTop:"Top",marginRight:"Right",marginBottom:"Bottom",minimize:"Minimize",paddingLeft:"Left",paddingTop:"Top",paddingRight:"Right",paddingBottom:"Bottom",unlinkProperty:"Unlink Property",linkedProperty:"Linked Property",linkProperty:"Link Property",currentSpace:"Current Space",linkName:"\${1} Link",linkThumbnail:"\${1} Thumbnail",linkSticker:"\${1} Sticker",opacity:"Opacity",shadowSpread:"Spread",shadowBlur:"Blur",width:"Width",height:"Height",margin:"Margin",padding:"Padding",bold:"Bold",italic:"Italic",underline:"Underline",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Align Justify",numberOfLines:"Lines",createVerticalSection:"Create Vertical Section",createHorizontalSection:"Create Horizontal Section",themeColors:"Theme Colors",uiColors:"UI Colors",hex:"Hex"},buttons:{add:"Add",alias:"Alias",addFilter:"Add Filter",loadMore:"Load More",addCondition:"Add Condition",customize:"Customize",moreOptions:"More Options",saveProperty:"Save Property",newNote:"New Note",changeIcon:"Change Sticker",removeIcon:"Remove Sticker",addIcon:"Add Sticker",addCover:"Add Cover",addDisplay:"Display Name",changeBanner:"Change Cover",changeBannerShort:"Cover",saveChanges:"Save Changes",removeBanner:"Remove Cover",rename:"Change Name",editFrame:"Edit Frame",saveSpace:"Save Space",createSpace:"New Space",createFolder:"New Folder",createNote:"New Note",createCanvas:"New Canvas",addIntoSpace:"New Pin",addSmartSearch:"Add Live Search",addItem:"Add Item",addProperty:"Add Property",editProperty:"Edit Property",addContext:"Add Context",cancel:"Cancel",search:"Search",delete:"Delete",toggleFlow:"Toggle Flow",openFlow:"Open Flow",hideFlow:"Hide Flow",openLink:"Open Link",addToSpace:"Add to Space",addToSpaceShort:"Pin",addTag:"Add Tag",tag:"Tag",syncFields:"Sync Properties",convertTable:"Convert to Markdown",cutTable:"Cut Table",deleteTable:"Delete From Note",blink:"Blink",addFile:"Add Item",merge:"Merge",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",deleteView:"Delete View",renameTable:"Rename Table",renameTag:"Rename Tag",createTag:"Create Tag",currentFolder:"Current Folder",sync:"Sync",pasteCSS:"Paste CSS",save:"Save",run:"Run"},metadataTypes:{fileName:"File Name",contexts:"Contexts",path:"Path",folder:"Folder",sticker:"Sticker",color:"Color",created:"Created",lastModified:"Last Modified",extension:"Extension",size:"Size",tags:"Tags",inlinks:"Linked Mentions",outlinks:"Links",label:"Label",fileMetadata:"File Metadata",frontmatter:"Frontmatter"},filterTypes:{contains:"contains",notContains:"does not contain",is:"is",isNot:"is not",before:"before",after:"on or after",anyOf:"is any of",noneOf:"is none of",checked:"is checked",unchecked:"is unchecked",isEmpty:"is empty",isNotEmpty:"is not empty",isSameDate:"is same date",isSameDateAsToday:"today"},sortTypes:{alphaAsc:"A to Z",alphaDesc:"Z to A",earliest:"Earliest",latest:"Latest",checkAsc:"Checked \\u2192 Unchecked",checkDesc:"Unchecked \\u2192 Checked",itemsAsc:"Least Items",itemsDesc:"Most Items"},properties:{defaultField:"Name",audio:{label:"Audio",description:"Audio"},text:{label:"Text",description:"Text field"},number:{label:"Number",description:"Number field with optional unit"},boolean:{label:"Yes/No",description:"Yes or No toggle to indicate the status"},date:{label:"Date",description:"Select a date from a calendar"},option:{label:"Option",description:"Select one or multiple option from a list"},file:{label:"File"},link:{label:"Link",description:"Link to another note or a website"},tags:{label:"Tags",description:"Use tags to quickly organize your items"},object:{label:"Object",description:"Store any complex objects"},context:{label:"Relation",description:"Connect to another context property and create a relation"},image:{label:"Image",description:"Select any image from your system or from the internet"},color:{label:"Color",description:"Use colors to label your items or status"},space:{label:"Context",description:"Link to a context"},icon:{label:"Sticker",description:"Use stickers to uniquely label your items or status"},super:{label:"Super Property",links:"Open Link",properties:"Update Property",api:"API",obsidianCommands:"Run Command",runCommand:"Run Command",performAction:"Perform Action",whenClicked:"When Clicked"},fileProperty:{name:"Name",label:"Formula",createdTime:"Created",modifiedTime:"Last Edited",sticker:"Sticker",links:"Links",tags:"Tags",spaces:"Spaces",extension:"Extension",size:"Size",preview:"Note Preview",parentFolder:"Folder",description:"Use a formula to dynamically display a property"}},views:{navigator:"Navigator",explorer:"Explorer",space:"Space"},subViews:{spaceItems:"Items",spaceContext:"Context",spaceLists:"Lists",spaceActions:"Actions",spaceTemplates:"Templates",smartSearch:"Live Searches",filesAndFolders:"Files and Folders"},labels:{duplicateTable:"Duplicate Table",pinned:"Pinned",live:"Pinned by Live Search",moveTable:"Move Table",editFormula:"Edit Formula",editObject:"Edit Object",properties:"Properties",newAction:"Action",newTable:"List",template:"Template",createFolder:"New Folder Name",rename:"Rename",createNew:"New",default:"Default",done:"Done",changeCoverShort:"Change",reposition:"Reposition",tables:"Tables",selectDateFormat:"Select/Type Date Format",renameSection:"Edit Space",createSection:"New Folder",createNote:"New Note",contextMaker:"Context Maker",select:"Select",pinnedItems:"Pinned Items",collapse:"Collapse",expand:"Expand",all:"All",none:"None",view:"View",findStickers:"Find Sticker",mergeProperties:"Merge Properties",placeholder:"Type '\${1}' for commands",notePlaceholder:"New Note for \${1}",itemsSelected:"\${1} Selected",selectNote:"Select Note",selectIcon:"Select Icon",selectImage:"Select Image",selectSpace:"Select Space",styleSmall:"Small",styleMedium:"Medium",styleLarge:"Large",hiddenFilePattern:"Name, Suffixes and Extension",hiddenFileSpecific:"Exclude specific files and folders",textPlaceholder:"Enter Text",noFile:"is not created yet. Click to create.",navigatorSearchPlaceholder:"Search by Text or Filters",blinkPlaceholder:"Quickly Search a File, Folder, Tag... Press Tab to Edit",searchPlaceholder:"Type to search...",contextItemSelectPlaceholder:"Find Item",linkItemSelectPlaceholder:"Find or Create Note",pinNotePlaceholder:"Select a Note or Space to Pin",optionItemSelectPlaceholder:"Select Option",viewItemSelectPlaceholder:"Select View",tagItemSelectPlaceholder:"Find Tag",spaceSelectPlaceholder:"Select any Folder or Tag",propertyItemSelectPlaceholder:"Select Property",sortItemSelectPlaceholder:"Select Sort",filterItemSelectPlaceholder:"Select Filter",imageSelectPlaceholder:"Select an image or paste a URL",imageNotFoundPlaceholder:"No Images Found",syncFrontmatterProperty:"Sync Frontmatter Property",newProperty:"New Property",newPropertyShort:"New Property",propertyType:"Type",propertyDynamic:"Dyanmic",propertyValueSpace:"Space",propertyValueProperty:"Property",propertyLookup:"Edit Formula",existingFrontmatter:"Existing Property",dateFormat:"Date Format",propertyFileProp:"Property",multiple:"Multiple",filesCount:"{$1} Files",hiddenFiles:"Hidden Files",addExtension:"Add Rule",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",renameTable:"Rename Table",syncMetadata:"Sync Metadata",syncProperties:"Sync Properties",selectContext:"Select Context",metadata:"Metadata",backlinks:"Backlinks",spaces:"Spaces",contexts:"Contexts",content:"Content",deleteSpace:"Delete Space",deleteFiles:"Delete Files",outgoingLinks:"Outgoing Links",moveTo:"Move to",addTo:"Pin to",copyTo:"Copy to",reorderIn:"Reorder in",border:"Border",corners:"Corners",color:"Color",backgroundColor:"Background",cornerRadius:"Radius",onClick:"On Click",layout:"Layout",element:"Element",name:"Name",display:"Display",alignment:"Alignment",margin:"Margin",padding:"Padding",gap:"Gap",width:"Width",height:"Height",opacity:"Opacity",shadow:"Shadow",shadowBlur:"Blur",shadowSpread:"Spread",typography:"Typography",layers:"Layers",fontSize:"Size",props:"Props",styles:"Styles",events:"Events",code:"Code",selectedLayers:"\${1} Layers"},descriptions:{spaceActions:"Create actions that runs when you press a button",spaceLists:"Create lists to track data and organize them in your space",spaceItems:"Add new items to the space or pin items to the space",spaceTemplates:"Create templates to quickly add items to your space",smartSearch:"Automatically pin notes to this space based on a set of searches",hiddenFileOptions:"Exclude any files and folders by name, suffix or extension.",deleteSpace:"Deleting the space will also delete the folder and its contents.",deleteFiles:"Delete \${1} files/folders and their contents?",addContext:"Contexts lets you connect properties from your tags",spaceProperties:"Define Properties for your Space Items",syncMetadata:"Select which fields from your notes to start syncing with the context.",syncProperties:"Contexts defines and syncs the same fields across your notes depending on their folder or tag.",selectContext:"Select which folder or tag context you want to sync the fields."},flowView:{emptyDoc:"Empty Document",itemsCount:" Items",emptyFolder:"This Folder is Empty"},notice:{duplicateFile:"Folder already contains note with same name",addedToSection:"Added to Space",fileExists:"File Already Exists",folderExists:"Folder Already Exists",noPropertyName:"Property Name is Required",noPropertiesFound:"No Properties Found",duplicatePropertyName:"Duplicate Property Name",newSpaceName:"Enter a name for your space",duplicateSpaceName:"Space name already exists",cantConvertNoteToSpace:"The view is not a note",templateSaved:"Template saved to space: ",tableDeleted:"Table removed from note, you can find the table in the folder space"},settings:{layoutVertical:"Vertical",layoutHorizontal:"Horizontal",sectionSidebar:"Spaces",sectionEditor:"Maker Mode",sectionFlow:"Flow",sectionAdvanced:"Advanced",sectionDataview:"Dataview",sectionContext:"Context",sectionStickers:"Stickers",sectionNavigator:"Navigator",sectionDefault:"Default Spaces",sectionSpaceView:"Space View",sectionBlink:"Blink",sectionInlineContext:"Inline Context",sectionFlowBlock:"Flow Block",sectionFlowMenu:"Flow Menu",sectionFlowStyler:"Flow Styler",experimental:{name:"Experimental",desc:"Experimental features that are subject to change and may not be optimized for performance"},generateThumbnails:{name:"Generate Thumbnails",desc:"Create thumbnails for images to speed up performance"},minimalThemeFix:{name:"Minimal Theme Fix",description:"Apply fixes for the popular theme Minimal"},inlineStickerMenu:{name:"Inline Stickers",desc:"Add inline stickers by typing :"},openSpacesOnLaunch:{name:"Open Spaces as Default Tab",desc:"Open the Spaces tab when Obsidian launches"},defaultSpaceTemplate:{name:"Default Space Template",desc:"Select the default template for new spaces"},defaultDateFormat:{name:"Default Date Format",desc:"Set the default date format, example: yyyy-MM-dd (see https://date-fns.org/v2.30.0/docs/format)"},newNotePlaceholder:{name:"New Note Placeholder",desc:"Default name for new notes"},folderIndentationLines:{name:"Show Folder Indentation Lines",desc:"Turn on to show a line on the left of folders to indicate indentation"},folderNoteLocation:{name:"Folder Note Location Inside Folder",desc:"Turn on to have folder notes inside the folder, turn off to have it outside"},folderViewDefault:{name:"Show Folder Note by Default",desc:"Show the folder note by default when opening a folder"},internalLinkFlowEditor:{name:"Show Toggles to Open Flow Editor on Links",desc:"Turn on to toggle Flow Blocks directly in inline links"},internalLinkSticker:{name:"Show Stickers on Links",desc:"Turn on to toggle stickers shown directly by beside internal links"},syncContextToFrontmatter:{name:"Sync Context Fields to Frontmatter",desc:"Turn on to automatically save all context fields to frontmatter fields, not just existing frontmatter fields."},syncFormulaToFrontmatter:{name:"Sync Formula Fields to Frontmatter",desc:"Turn on to save calculated formula values to frontmatter fields."},inlineBacklinks:{name:"Show Inline Backlinks (Inline Context required)",desc:"Show editable backlinks at the bottom of your notes"},dataviewInlineContext:{name:"Show Dataview in Inline Context",desc:"Show dataview when inline context is enabled"},inlineContextExplorer:{name:"Inline Context",desc:"Display the context and a banner at the top of your notes"},inlineContextProperties:{name:"Inline Context Properties",desc:"Show the properties in the inline context"},inlineContextExpanded:{name:"Auto Expand Inline Context",desc:"Expand the inline context sections when opening a note"},inlineContextHorizontal:{name:"Inline Title and Sticker Layout",desc:"Layout for inline title and sticker in Inline Context"},hideFrontmatter:{name:"Hide Context Properties",desc:"Hide properties you have added in context from the Obsidian properties panel"},openFileContext:{name:"Auto Open Explorer",desc:"Automatically open explorer panel in the right panel"},folderNote:{name:"Enable Folder Note",desc:"Access the folder note in the folder page and hide the folder note from spaces"},folderNoteName:{name:"Folder Note Name",desc:"Name of the folder note, keep blank to use the same name as the folder"},expandFolder:{name:"Auto Expand Folder",desc:"Auto expand folders on click"},hoverPreview:{name:"Preview on Hover",desc:"Preview on Hover while holding Control/Command key"},activeFile:{name:"Reveal Active File",desc:"Automatically reveal the active file in Spaces"},contexts:{name:"Contexts",desc:"Contexts allows you to have full control over the metadata of your files"},spaces:{name:"Navigator",desc:"The navigator lets you create and organize your spaces"},spacesStickers:{name:"Stickers",desc:"Use Emojis to make it easier to find your notes"},spacesAlias:{name:"Alias",desc:"Use the alias metadata to show in Spaces"},spacesFileExplorerDual:{name:"Compatibility Mode",desc:"This will improve the compatibility of plugins while using Spaces"},spacesDeleteOption:{name:"Delete File Option",desc:"Select how you want files to be deleted"},spacesDeleteOptions:{permanant:"Delete Permanently",trash:"Move to Obsidian Trash","system-trash":"Move to System Trash"},flowState:{name:"Flow State",desc:"Toggle the flow state"},hideRibbon:{name:"App Ribbon",desc:"Show/hide the left menu aka. ribbon"},spaceView:{name:"Space View",desc:"Open the space view when you click on a space"},defaultSpaces:{name:"Default Spaces",desc:"Recommended spaces for quickly organizing your vault"},homeSpace:{name:"Home Space",desc:"An easy-to-access space where you can add/organize your other spaces"},tagSpaces:{name:"Tag Spaces",desc:"Automatically create spaces for each of your tags"},readableLineWidth:{name:"Readable Line Width",desc:"Use Readable Line Width"},sidebarTabs:{name:"Sidebar Tabs",desc:"Show/hide other sidebar tabs"},spacesPerformance:{name:"Performance Mode",desc:"Turn on performance mode for Spaces, may affect scrolling appearance. Requires Restart"},indexSVG:{name:"Use SVGs as Stickers",desc:"Use any svg file in your vault as a sticker"},inlineStyler:{name:"Flow Styler",desc:"Select text to add styling"},inlineStylerColor:{name:"Text and Highlight Colors \\u{1F9EA}",desc:"Select text color and highlight color, (this may change in the future because of the limitations with HTML and Obsidian)"},spaceRowHeight:{name:"Row Height",desc:"The height for each row in spaces (in pixels), default is 29"},contextPagination:{name:"Table View Pagination",desc:"Number of items per page in table view"},coverHeight:{name:"Cover Height",desc:"The height for the cover of the note or space, default is 200"},makeChar:{name:"Flow Menu Trigger",desc:"Character to open the Flow Menu"},mobileMakeBar:{name:"Flow Styler (Mobile)",desc:"Replaces the mobile toolbar"},editorMarkSans:{name:"Mark Sans \\u{1F9EA}",desc:"Use the editor without Markdown."},editorMakerMode:{name:"Flow (Beta)",desc:"An integrated and intuitive editor experience"},editorMakePlacholder:{name:"Flow Menu Hint Text",desc:"Show a hint text on how to open the Flow Menu Shortcut"},blink:{name:"Blink",desc:"A faster way to search and edit your notes"},editorMakeMenu:{name:"Flow Menu",desc:"Open the Flow menu to quickly add content"},editorMakeMenuTrigger:{name:"Flow Menu Shortcut",desc:"Trigger key to use flow menu"},editorFlowReplace:{name:"Flow Block",desc:"Open your internal links or toggle your embeds in the flow block."},editorFlowStyle:{name:"Flow Block Style",desc:"Select a theme for your flow block",seamless:"Seamless",classic:"Classic",minimal:"Minimal"}}}};this.lang="en";let r=i5.default.locale();["en"].includes(r)&&(this.lang=r)}get texts(){return this.all.en}},Br=new TS().texts;var FS=e=>e.lastIndexOf("/")!=-1?e.lastIndexOf(".")!=-1?MA(e.substring(e.lastIndexOf("/")+1,e.lastIndexOf("."))):e.substring(e.lastIndexOf("/")+1):e.lastIndexOf(".")!=-1?e.substring(0,e.lastIndexOf(".")):e;var kZ=ma(um());var BZ=(e,r)=>{let t=n=>n=="builtin"?"Builtin":n=="api"?"Spaces":"Action";return[...(e.actionsIndex.get(r)??[]).map(n=>({name:n.schema.name,description:"Action",value:\`\${r}/#;\${n.schema.id}\`,section:"Action"}))??[],...[...e.cli.allCommands()].map(n=>({name:n.schema.name,description:t(n.schema.type),value:n.path,section:t(n.schema.type)}))]};var o5=({field:e,value:r})=>r=="ctime"?{value:"parseDate(prop('File')['metadata']['ctime'])",type:"date"}:{value:"",type:"string"},lx=(e,r,t,n)=>{let a=bc(e);if(a)return r=="fileprop"&&a.field?o5(a):(r=="option"&&a.source?.length>0&&(a.source=="$commands"?a.options=t.cli.allCommands():a.source=="$links"?a.options=t.spaceManager.allPaths().map(i=>({name:i,value:i})):a.source=="$super"?a.options=BZ(t,n):a.source=="$properties"&&(a.options=t.contextsIndex.get(n)?.contextTable?.cols?.map(i=>({name:i.name,value:i.name}))??[])),[...s5(r).configKeys??[],"alias","default"].reduce((i,s)=>({...i,[s]:a[s]}),{}));if(!r)return{};if(!a)if(r=="context")e?.length>0?a={space:e}:a={};else if(r.startsWith("date"))e?.length>0?a={format:e}:a={};else if(r.startsWith("fileprop"))if(e?.length>0){let[i,s]=e.split(".");a=o5({field:i,value:s})}else a={};else r.startsWith("option")&&(e?.length>0?a={options:gn(e).map(s=>({name:s,value:s}))}:a={});return a??{}};var s5=(e,r)=>r==Xn?Af.find(t=>t.type=="file"):r=="tags"?Af.find(t=>t.type=="tags-multi"):r=="aliases"?Af.find(t=>t.type=="option-multi"):r=="sticker"?Af.find(t=>e=="icon"):Af.find(t=>e==t.type)||Af.find(t=>e==t.multiType),Af=[{type:"unknown",label:"",restricted:!0,icon:"ui//file-question"},{type:"any",label:"",restricted:!0,icon:"ui//wildcard",multi:!0,multiType:"any-multi"},{type:"text",label:Br.properties.text.label,metadata:!0,icon:"ui//text",primative:!0,description:Br.properties.text.description},{type:"number",label:Br.properties.number.label,metadata:!0,icon:"ui//binary",configKeys:["unit"],primative:!0,description:Br.properties.number.description},{type:"boolean",label:Br.properties.boolean.label,metadata:!0,icon:"ui//check-square",primative:!0,description:Br.properties.boolean.description},{type:"date",label:Br.properties.date.label,metadata:!0,icon:"ui//calendar",configKeys:["format"],primative:!0,description:Br.properties.date.description},{type:"option",label:Br.properties.option.label,multi:!0,multiType:"option-multi",icon:"ui//list",configKeys:["options","source"],description:Br.properties.option.description},{type:"tags-multi",label:Br.properties.tags.label,icon:"ui//tags",description:Br.properties.tags.description},{type:"file",label:Br.properties.file.label,restricted:!0,icon:"ui//mk-make-h3"},{type:"fileprop",label:Br.properties.fileProperty.label,icon:"ui//formula",configKeys:["field","value","type"],description:Br.properties.fileProperty.description},{type:"link",label:Br.properties.link.label,multi:!0,multiType:"link-multi",metadata:!0,icon:"ui//file-text",primative:!0,description:Br.properties.link.description},{type:"context",label:Br.properties.context.label,icon:"ui//mk-make-note",multi:!0,multiType:"context-multi",configKeys:["space"],description:Br.properties.context.description},{type:"object",label:Br.properties.object.label,multi:!0,multiType:"object-multi",metadata:!0,icon:"ui//list-tree",configKeys:["type","typeName"],description:Br.properties.object.description},{type:"icon",label:Br.properties.icon.label,multi:!0,multiType:"icon-multi",icon:"ui//gem",restricted:!0,primative:!0,description:Br.properties.icon.description},{type:"image",label:Br.properties.image.label,multi:!0,multiType:"image-multi",metadata:!0,icon:"ui//mk-make-image",primative:!0,description:Br.properties.image.description},{type:"color",label:Br.properties.color.label,icon:"ui//mk-make-image",restricted:!0,description:Br.properties.color.description},{type:"space",label:Br.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Br.properties.space.description},{type:"table",label:Br.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Br.properties.space.description},{type:"super",label:Br.properties.super.label,icon:"ui//zap",restricted:!0,configKeys:["dynamic","field"]},{type:"input",label:Br.properties.super.label,icon:"ui//input",restricted:!0}];var li="files",dx={id:li,name:"Items",type:"db",primary:"true"},PZ="filesView",IZ={id:PZ,name:"All",type:"view",def:JSON.stringify({db:li,icon:"ui//file-stack"})},RZ="main",qZ=e=>({id:e,name:e,type:"frame",def:"",predicate:"",primary:"true"}),E4e={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[qZ(RZ),IZ]},mx={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[dx]},u5={uniques:["name,schemaId"],cols:["name","schemaId","type","value","attrs","hidden","unique","primary"]},px={...u5,rows:[{name:Xn,schemaId:li,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""},{name:Br.properties.fileProperty.createdTime,schemaId:li,type:"fileprop",value:Xn+".ctime",hidden:"",unique:"",attrs:"",primary:"true"}]};var T4e=[{name:Br.properties.defaultField,schemaId:"",type:"text",primary:"true"}],_S={...u5,rows:[{name:Xn,schemaId:li,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""}]};var F4e={schema:dx,cols:px.rows,rows:[]},_4e={schema:dx,cols:px.rows,rows:[]},O4e={schema:dx,cols:_S.rows,rows:[]},f5=(e,r)=>e.filter(t=>r.find(n=>n.id==t.schemaId&&n.type=="db")).reduce((t,n)=>({...t,...t[n.schemaId]?{[n.schemaId]:{uniques:n.unique=="true"?[...t[n.schemaId].uniques,n.name]:t[n.schemaId].uniques,cols:[...t[n.schemaId].cols,n.name],rows:[]}}:{[n.schemaId]:{uniques:n.unique=="true"?[n.name]:[],cols:[n.name],rows:[]}}}),{});var B4e={m_schema:mx,m_fields:px,...f5(px.rows,mx.rows)},P4e={m_schema:mx,m_fields:_S,...f5(_S.rows,mx.rows)};var OS="spaces://$tags";var pRe={name:Br.menu.waypoints,readOnly:!1,path:"spaces://$waypoints",label:{name:Br.menu.waypoints,thumbnail:"",sticker:"ui//tags",color:""},type:"default"},dRe={name:Br.menu.tags,readOnly:!1,path:"spaces://$tags",label:{thumbnail:"",name:Br.menu.tags,sticker:"ui//tags",color:""},type:"default"},hRe={name:Br.menu.vault,readOnly:!1,path:"/",label:{thumbnail:"",name:Br.menu.vault,sticker:"ui//vault",color:""},type:"default"};var c5=(e,r,t,n,a,i,s)=>{if(!t)return"";let l=new Map;Object.keys(a).forEach(o=>l.set(o,a[o])),l.set("$properties",n),l.set("$paths",r),i&&l.set("$current",i);let c;try{e.evaluate("current = _current()",l),c=e.evaluate(t,l),c=Ds("",c)}catch(o){if(c="",s)throw o;console.log(i,t,o)}return c};var BS=e=>{let r=new Map;e.filter(s=>s.type=="fileprop"||s.name.startsWith("tags")).forEach(s=>{let{value:l}=lx(s.value,s.type),c=[];try{let u=Wa(l).filter(m=>m.type=="FunctionNode").filter(m=>m.fn.name=="prop"&&m.args[0].type=="ConstantNode").map(m=>m.args[0]?.value);c.push(...u)}catch{}let o=s.name;r.has(o)||r.set(o,new Set);for(let u of c){let m=u;m!==o&&r.get(o).add(m)}});let t=new Set,n=[],a=new Set,i=s=>{if(a.has(s))throw new Error("Circular dependency detected");if(!t.has(s)){a.add(s);let l=r.get(s)||new Set;for(let c of l)i(c);t.add(s),a.delete(s),n.push(s)}};for(let s of e)t.has(s.name)||i(s.name);return n},l5=(e,r,t,n,a,i)=>{if(!t)return{};let s=i??BS(n),l=r.get(t[Xn])?.metadata?.property??{},c=Object.keys(l).filter(m=>n.some(d=>d.name==m)).reduce((m,d)=>({...m,[d]:Ds(d,l[d])}),{}),o=s.map(m=>n.find(d=>d.name==m)).filter(m=>m&&(m.type=="fileprop"||m.name=="tags")),u=n.reduce((m,d)=>({...m,[d.name]:d}),{});return{...t,...c,...o.reduce((m,d)=>{let{value:h}=lx(d.value,d.type);return{...m,[d.name]:c5(e,r,h,u,{...t,...m},a)}},{})}};var m5=(e,r)=>{let t=e?gn(e):[],n=r?gn(r):[];return n.every(a=>t.some(i=>i==a))&&t.every(a=>n.some(i=>i==a))},Mf=(e,r)=>e==r,PS=(e,r)=>(e??"").length==0,IS=(e,r)=>(e??"").toLowerCase().includes((r??"").toLowerCase()),RS=(e,r)=>parseFloat(e)>parseFloat(r),qS=(e,r)=>parseInt(e){let t=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),n=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return t.valueOf()>=n.valueOf()},d5=(e,r)=>{let t=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),n=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return t.valueOf(){let t=e?gn(e):[],n=r?gn(r):[];return t.length==0?!1:n.some(a=>t.some(i=>i==a))},h5=(e,r)=>{if(!e)return!1;let t=new Date(\`\${e.toString().replace(".",":")}\`),n=new Date(\`\${r}\`);return t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()},v5=e=>{if(!e)return!1;let r=new Date(\`\${e.toString()}T00:00\`),t=new Date;return r.getMonth()===t.getMonth()&&r.getDate()===t.getDate()};var Cf={isNotEmpty:{type:["text","file","number","option","option-multi","link","link-multi","image"],fn:(e,r)=>!PS(e,""),valueType:"none"},isEmpty:{type:["text","file","number","option","option-multi","link","link-multi","image"],fn:(e,r)=>PS(e,""),valueType:"none"},include:{fn:(e,r)=>IS(e,r),type:["text","file","link","image"],valueType:"text"},notInclude:{type:["text","file","link","image"],fn:(e,r)=>!IS(e,r),valueType:"text"},is:{type:["text"],fn:(e,r)=>Mf(e,r),valueType:"text"},isNot:{type:["text"],fn:(e,r)=>!Mf(e,r),valueType:"text"},equal:{type:["number"],fn:(e,r)=>Mf(e,r),valueType:"number"},isLink:{type:["link","context"],fn:(e,r)=>Mf(e,r),valueType:"link"},isNotLink:{type:["link","context"],fn:(e,r)=>!Mf(e,r),valueType:"link"},isGreatThan:{type:["number"],fn:(e,r)=>RS(e,r),valueType:"number"},isLessThan:{type:["number"],fn:(e,r)=>qS(e,r),valueType:"number"},isLessThanOrEqual:{type:["number"],fn:(e,r)=>!RS(e,r),valueType:"number"},isGreatThanOrEqual:{type:["number"],fn:(e,r)=>!qS(e,r),valueType:"number"},dateBefore:{type:["date"],fn:(e,r)=>d5(e,r),valueType:"date"},dateAfter:{type:["date"],fn:(e,r)=>p5(e,r),valueType:"date"},isSameDate:{type:["date"],fn:(e,r)=>h5(e,r),valueType:"date"},isSameDateAsToday:{type:["date"],fn:(e,r)=>v5(e,r),valueType:"none"},isExactList:{type:["option","option-multi","link-multi","context-multi","tags-multi"],fn:(e,r)=>m5(e,r),valueType:"list"},isAnyInList:{type:["option","context","link","option-multi","link-multi","context-multi","tags-multi"],fn:(e,r)=>kS(e,r),valueType:"list"},isNoneInList:{type:["option","context","link","option-multi","link-multi","context-multi","tags-multi"],fn:(e,r)=>!kS(e,r),valueType:"list"},isTrue:{type:["boolean"],fn:(e,r)=>e=="true",valueType:"none"},isFalse:{type:["boolean"],fn:(e,r)=>e!="true",valueType:"none"}};var zZ=(e,r,t)=>r.reduce((a,i)=>{let[s,l]=a,c=i.type=="context"?g5(l,i,t):i.type=="path"?x5(l,i,t):i.type=="frontmatter"?y5(l,i,t):b5(l,i,t),o=l.filter(u=>!c.includes(u));return[[...s,...c],o]},[[],e])[0],UZ=(e,r,t)=>r.reduce((n,a)=>a.type=="context"?g5(n,a,t):a.type=="path"?x5(n,a,t):a.type=="frontmatter"?y5(n,a,t):b5(n,a,t),e),g5=(e,r,t)=>{let n=Cf[r.fn];return!n||n.valueType!="none"&&r.value.length==0?[]:e.filter(a=>{let[i,s]=r.field.split("."),l=a.metadata?.property;if(!a.spaces?.includes(i)||!l||!l[s])return!1;let c=!0;if(n){let o=r.fType=="property"?t[r.value]:r.value;c=n.fn(Ds(s,l[s]),o)}return c})},y5=(e,r,t)=>{let n=Cf[r.fn];return!n||n.valueType!="none"&&r.value.length==0?[]:e.filter(a=>{let i=a.metadata?.property;if(!i||i[r.field]===void 0)return!1;let s=!0;if(n){let l=r.fType=="property"?t[r.value]:r.value;s=n.fn(Ds(r.field,i[r.field]),l)}return s})},x5=(e,r,t)=>{let n=Cf[r.fn];return!n||n.valueType!="none"&&r.value.length==0?[]:e.filter(a=>{let i="";r.field=="outlinks"?i=ws(a.outlinks??[]):r.field=="inlinks"?i=ws(a.metadata?.inlinks??[]):r.field=="tags"&&(i=ws(a.tags??[]));let s=!0;if(n){let l=r.fType=="property"?t[r.value]:r.value;s=n.fn(i,l)}return s})},b5=(e,r,t)=>{let n=Cf[r.fn];return!n||n.valueType!="none"&&r.value.length==0?[]:e.filter(a=>{let i=!0;if(n){let s=r.fType=="property"?t[r.value]:r.value;i=n.fn(a.metadata?.[r.type]?.[r.field],s)}return i})},w5=(e,r,t)=>e.reduce((a,i)=>!a||i.filters.length==0?!1:i.type=="any"?zZ([r],i.filters,t).length>0:UZ([r],i.filters,t).length>0,!0);var D5=(e,r)=>e.hiddenExtensions.some(t=>r.endsWith(t))||r.startsWith(e.spacesFolder+"/#")||e.hiddenFiles.some(t=>t==r);var S5=(e,r,t,n,a,i)=>{let s={};if(!e)return{changed:!1,cache:null};if(!r)return{changed:!1,cache:{path:e.path,schemas:[],outlinks:[],contexts:[],paths:[],contextTable:null,spaceMap:s,dbExists:!1}};let l=Object.values(r).map(N=>N.schema),c=r[li]?.rows?.map(N=>N[Xn])??[],o=t.filter(N=>!c.includes(N)),u=[...NA(t??[],c),...o],m=BS(r[li].cols),d=[...r[li].rows.filter(N=>t.includes(N[Xn])),...o.map(N=>({[Xn]:N}))].map(N=>l5(i,a,N,r[li].cols,a.get(e.path),m)),h={...r[li],rows:d},y=h.cols?.filter(N=>N.type.startsWith("context"))??[],v=h.cols?.filter(N=>N.type.startsWith("link"))??[],x=pa(y.map(N=>N.value));y.forEach(N=>{s[N.name]={},h.rows.forEach(M=>{gn(M[N.name]).forEach(S=>s[N.name][S]=[...s[N.name][S]??[],M[Xn]])})});let w=pa(h.rows.reduce((N,M)=>pa([...N,...[...y,...v].flatMap(S=>gn(M[S.name]).map(O=>wc(O)))]),[])),C={contextTable:h,path:e.path,contexts:x,outlinks:w,paths:u,schemas:l,spaceMap:s,dbExists:n},b=!1;return LS.default.isEqual(h,r)||(b=!0),{changed:b,cache:C}},N5=(e,r,t,n)=>{let a={};for(let[i,s]of e){let l=r.enableFolderNote?t.get(i)?.space.notePath??i:i,c=e.get(l)??s;if(!s)continue;let o=s?.parent??"",u=s?.type??"",m=s?.subtype??"",d=c?.label,h=n?.get(i),{changed:y,cache:v}=zS(i,r,t,c,d,u,m,o,h);a[i]={changed:y,cache:v}}return a},zS=(e,r,t,n,a,i,s,l,c)=>{let o=(W,k,q)=>W?.length>0||W?.length>0?W:k=="space"?q=="Spaces/Home"?"ui//home":q=="/"?"ui//vault":q.startsWith("spaces://")?"ui//tags":"ui//folder":"ui//file",u={label:n?.label,path:e,name:FS(e),readOnly:n?.readOnly},m=[],d=n?.tags?.map(W=>W)??[],h=D5(r,e),y=(W,k,q=new Set)=>{let K=[];for(let z of k){let oe=W.get(z)?.contexts??[];for(let le of oe)q.has(le)||(K.push(le),q.add(le),K.push(...y(W,[xc(le)],q)))}return K};if(t.has(l))for(let W of t.get(l).contexts??[])m.push(W);m.push(...d);let v=a?.name,x=n?.property?sm(n.property[r.fmKeyAlias]):[],w=o(a?.sticker,i,e),C=a?.color??"",b=n?.resolvedLinks??[],N=!1,M,S={...u,name:v,tags:pa(m),type:i,subtype:s,parent:l,label:{name:r.spacesUseAlias&&x?.length>0?x[0]:v,sticker:w,color:C,thumbnail:a?.thumbnail??"",preview:a?.preview??""},metadata:{...n},outlinks:b},O=[],_=[],E=[];s=="tag"&&O.push(OS);for(let W of m)O.push(xc(W));let T=new Set,R=(W,k)=>{if(!T.has(W)){if(T.add(W),k.dependencies?.length>0)for(let q of k.dependencies)t.has(q)&&R(q,t.get(q));if(k.space.notePath==e&&k.path!=k.space.notePath&&(N=!0,M=k.path,h=!0),s!="tag"&&s!="default"&&k.space&&k.space.path==l){O.push(W);return}if(k.metadata?.filters?.length>0&&w5(k.metadata.filters,{...S,spaces:O},k.properties)){O.push(W),E.push(W);return}if(k.metadata?.links?.length>0&&(k.metadata?.links??[]).find(K=>K==S.path)){O.push(W),_.push(W);return}}};for(let[W,k]of t)R(W,k);let L=y(t,O);O.push(...L.map(W=>xc(W))),S.tags.push(...L),N&&(S.metadata.spacePath=M);let H=h?{...S,spaces:[],hidden:h}:{...S,spaces:pa(O),linkedSpaces:_,liveSpaces:E,hidden:h},V=!0;return c&&LS.default.isEqual(H,c)&&(V=!1),{changed:V,cache:H}};function A5(e){let{path:r,settings:t,spacesCache:n,pathMetadata:a,label:i,type:s,subtype:l,parent:c,oldMetadata:o}=e;return zS(r,t,n,a,i,s,l,c,o)}function US(e,r){let{space:t,mdb:n,paths:a,dbExists:i,pathsIndex:s}=e;return S5(t,n,a,i,s,r)}function M5(e,r){let{map:t,pathsIndex:n}=e,a=new Map;for(let[i,s]of t)a.set(i,US({...s,pathsIndex:n},r));return a}function C5(e){let{pathCache:r,settings:t,spacesCache:n,oldMetadata:a}=e;return N5(r,t,n,a)}var WZ=self,YZ={...AS,createAdd:F("add",[],()=>function(r,t){return r+t}),createEqual:F("equal",[],()=>function(r,t){return r==t}),createUnequal:F("unequal",[],()=>function(r,t){return r!=t})},HZ={matrix:"Array"},WS=cx(YZ,HZ);WS.import(Lb,{override:!0});WZ.onmessage=async e=>{let{payload:r,job:t}=e.data,n;t.type=="path"?n=A5(r):t.type=="context"?n=US(r,WS):t.type=="contexts"?n=M5(r,WS):t.type=="paths"&&(n=C5(r));try{postMessage({job:t,result:n})}catch(a){console.log(a),postMessage({job:t,result:{$error:\`Failed to index \${t.type} \${t.path}: \${a}\`}})}}; /*! * decimal.js v10.4.3 * An arbitrary-precision Decimal type for JavaScript. @@ -113927,8 +113941,7 @@ var PropertiesView = (props) => { newCols.filter((f2) => !props.excludeKeys?.some((g) => g == f2.name)) ); setExcludeKeys([ - ...props.superstate.settings.hideFrontmatter ? columns.map((f2) => f2.name) : [], - ...props.excludeKeys ?? [] + ...props.superstate.settings.hideFrontmatter ? columns.map((f2) => f2.name) : [] ]); setValues( linkContextRow( @@ -117335,6 +117348,10 @@ var HeaderPropertiesView = (props) => { const toggleCollapsed = () => { startTransition(() => setCollapsed((f2) => !f2)); }; + const excludedKeys = [ + ...FMMetadataKeys(props.superstate.settings), + ...FMSpaceKeys(props.superstate.settings) + ]; return /* @__PURE__ */ import_react79.default.createElement("div", { className: "mk-props-contexts" }, !readMode && props.collapseSpaces && /* @__PURE__ */ import_react79.default.createElement("div", { @@ -117438,9 +117455,8 @@ var HeaderPropertiesView = (props) => { force: true, compactMode: false, excludeKeys: [ - ...FMMetadataKeys(props.superstate.settings), - "tags", - ...FMSpaceKeys(props.superstate.settings) + ...excludedKeys, + props.superstate.settings.fmKeyAlias ], editable: true }), /* @__PURE__ */ import_react79.default.createElement("div", { @@ -117463,7 +117479,10 @@ var HeaderPropertiesView = (props) => { dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//options") } - }))))); + })))), excludedKeys.length > 0 && /* @__PURE__ */ import_react79.default.createElement("style", null, `${excludedKeys.map((f2) => `.metadata-property[data-property-key="${f2}"]`).join(", ")} + { + display: none; + }`)); }; // src/core/react/components/Explorer/Explorer.tsx @@ -132334,14 +132353,7 @@ var ContextListView = (props) => { // src/core/react/components/SpaceView/Contexts/ContextListContainer.tsx var ContextListContainer = (props) => { const { pathState } = (0, import_react138.useContext)(PathContext); - const { - predicate, - editMode, - setEditMode, - dbSchema, - filteredData, - tableData - } = (0, import_react138.useContext)(ContextEditorContext); + const { predicate, editMode, setEditMode, dbSchema, tableData } = (0, import_react138.useContext)(ContextEditorContext); const { frameSchema } = (0, import_react138.useContext)(FramesMDBContext); const [editSection, setEditSection] = (0, import_react138.useState)(null); const [selectedIndex, setSelectedIndex] = (0, import_react138.useState)(null); @@ -132528,7 +132540,7 @@ var BacklinkItem = (props) => { (0, import_react140.useEffect)(() => { refreshBlock(props.path); }, [props.path]); - const [collapsed, setCollapsed] = (0, import_react140.useState)(false); + const [collapsed, setCollapsed] = (0, import_react140.useState)(true); return /* @__PURE__ */ import_react140.default.createElement(import_react140.default.Fragment, null, /* @__PURE__ */ import_react140.default.createElement("div", { className: "mk-path-backlink-title" }, /* @__PURE__ */ import_react140.default.createElement(PathCrumb, { @@ -134670,6 +134682,13 @@ var TreeItem = (props) => { () => setPathState(superstate.pathsIndex.get(data2.item.path)), [data2.item.path] ); + const openAuxClick = (e5) => { + if (e5.button == 1) { + superstate.ui.openPath(pathState.path, "tab"); + setActivePath(pathState.path); + setSelectedPaths([data2]); + } + }; const openPathAtTarget = (path2, e5) => { if (e5.shiftKey) { onSelectRange(path2.id); @@ -134867,6 +134886,7 @@ var TreeItem = (props) => { onMouseLeave: mouseOut, onMouseEnter: hoverItem, onKeyDown, + onAuxClick: openAuxClick, onClick: (e5) => openPathAtTarget(data2, e5), onContextMenu: (e5) => handleRightClick(e5), ...dropProps, @@ -142565,7 +142585,7 @@ var FlowEditor = class extends nosuper(import_obsidian15.HoverPopover) { "vertical" ); this.targetRect = this.targetEl?.getBoundingClientRect(); - this.oldPopover = this.parent?.flowEditor; + this.oldPopover = this.parent?.flowEditors.find((he) => he.id !== this.id); this.document = this.targetEl?.ownerDocument ?? window.activeDocument ?? window.document; this.id = genId(); this.hoverEl = this.document.defaultView.createDiv({ @@ -142702,7 +142722,9 @@ var FlowEditor = class extends nosuper(import_obsidian15.HoverPopover) { { once: true, capture: true } ); if (this.parent) { - this.parent.flowEditor = this; + if (!this.parent.flowEditors) + this.parent.flowEditors = []; + this.parent.flowEditors.push(this); this.parent.view.addChild(this); } await this.onShowCallback?.(this); @@ -142760,13 +142782,15 @@ var FlowEditor = class extends nosuper(import_obsidian15.HoverPopover) { this.shownPos = mouseCoords; this.targetEl.replaceChildren(this.hoverEl); this.onShow(); - app.workspace.onLayoutChange(); + this.plugin.app.workspace.onLayoutChange(); this.load(); } onHide() { this.oldPopover = null; - if (this.parent?.flowEditor === this) { - this.parent.flowEditor = null; + if (this.parent?.flowEditors.find((he) => he == this)) { + this.parent.flowEditors = this.parent.flowEditors.filter( + (he) => he.id !== this.id + ); } } hide() { @@ -142922,47 +142946,26 @@ var patchWorkspace = (plugin) => { return function(newLeaf, direction) { let leaf = old.call(this, newLeaf, direction); if (leaf.isFlowBlock) { + const currentLeafId = leaf.id; let foundLeaf = false; plugin.app.workspace.iterateLeaves((_leaf) => { - if (_leaf.flowEditor) { - _leaf.flowEditor.leaves().forEach((l2) => { - if (l2.id == leaf.id) { - foundLeaf = true; - leaf = _leaf; - return; - } + if (_leaf.flowEditors && !foundLeaf) { + _leaf.flowEditors.forEach((f2) => { + f2.leaves().forEach((l2) => { + if (l2.id == currentLeafId) { + foundLeaf = true; + leaf = _leaf; + return; + } + }); }); - if (foundLeaf) - return true; } - leaf = _leaf; return; }, plugin.app.workspace["rootSplit"]); } return leaf; }; }, - iterateLeaves(old) { - return function(arg1, arg2) { - if (old.call(this, arg1, arg2)) - return true; - const cb = typeof arg1 === "function" ? arg1 : arg2; - const parent = typeof arg1 === "function" ? arg2 : arg1; - if (!parent) - return false; - if (layoutChanging) - return false; - if (parent === plugin.app.workspace.rootSplit || import_obsidian16.WorkspaceContainer && parent instanceof import_obsidian16.WorkspaceContainer) { - for (const popover of FlowEditor.popoversForWindow( - parent.win - )) { - if (old.call(this, cb, popover.rootSplit)) - return true; - } - } - return false; - }; - }, openLinkText(old) { return function openLinkText(linkText, sourcePath, newLeaf, openViewState) { if (linkText.startsWith("spaces://")) { @@ -143011,6 +143014,55 @@ var patchWorkspace = (plugin) => { }); plugin.register(uninstaller); }; +var patchWorkspaceLeaf = (plugin) => { + plugin.register( + around(import_obsidian16.WorkspaceLeaf.prototype, { + getRoot(old) { + return function() { + const top2 = old.call(this); + return top2.getRoot === this.getRoot ? top2 : top2.getRoot(); + }; + }, + setViewState(old) { + return async function(viewState, eState) { + const result = await old.call(this, viewState, eState); + try { + if (this.flowEditors) { + for (const he of this.flowEditors) { + he.hide(); + } + } + this.flowEditors = []; + } catch { + } + return result; + }; + }, + setEphemeralState(old) { + return function(state) { + old.call(this, state); + if (state.focus && this.view?.getViewType() === "empty") { + this.view.contentEl.tabIndex = -1; + this.view.contentEl.focus(); + } + }; + } + }) + ); + plugin.register( + around(import_obsidian16.WorkspaceItem.prototype, { + getContainer(old) { + return function() { + if (!old) + return; + if (!this.parentSplit || this instanceof import_obsidian16.WorkspaceContainer) + return old.call(this); + return this.parentSplit.getContainer(); + }; + } + }) + ); +}; // src/adapters/obsidian/utils/flow/flow.tsx var import_react186 = __toESM(require_react()); @@ -153378,14 +153430,6 @@ var MakeMDPlugin = class extends import_obsidian28.Plugin { } }); } - this.addCommand({ - id: "mk-test", - name: "Open Test Page", - callback: () => { - this.testPage(); - }, - hotkeys: [] - }); if (this.superstate.settings.blinkEnabled) { this.addCommand({ id: "mk-blink", @@ -153421,6 +153465,7 @@ var MakeMDPlugin = class extends import_obsidian28.Plugin { } loadFlowEditor() { patchWorkspace(this); + patchWorkspaceLeaf(this); document.body.classList.toggle("mk-flow-replace", this.superstate.settings.editorFlow); document.body.classList.toggle( "mk-flow-" + this.superstate.settings.editorFlowStyle, diff --git a/manifest.json b/manifest.json index 9e43694..ef6df31 100755 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "make-md", "name": "MAKE.md", - "version": "0.9.994", + "version": "0.9.995", "minAppVersion": "0.16.0", "description": "Make.md brings powerful and modern note-taking features to Obsidian. Capture, organize and connect information with more flexibility without any code.", "author": "MAKE.md", diff --git a/src/adapters/obsidian/types/obsidian.d.ts b/src/adapters/obsidian/types/obsidian.d.ts index 5fd629a..6180721 100644 --- a/src/adapters/obsidian/types/obsidian.d.ts +++ b/src/adapters/obsidian/types/obsidian.d.ts @@ -1,5 +1,5 @@ import { EditorView } from "@codemirror/view"; -import { FlowEditorParent } from "adapters/obsidian/ui/editors/FlowEditor"; +import { FlowEditor, FlowEditorParent } from "adapters/obsidian/ui/editors/FlowEditor"; declare module "obsidian" { export enum PopoverState { @@ -126,12 +126,15 @@ declare module "obsidian" { children: any[]; } interface WorkspaceLeaf { + id: string; containerEl: HTMLElement; tabHeaderInnerTitleEl: HTMLElement; tabHeaderInnerIconEl: HTMLElement; history: { backHistory: any[]; }; + isFlowBlock?: boolean; + flowEditors?: FlowEditor[]; } interface Editor { cm: EditorView; diff --git a/src/adapters/obsidian/ui/editors/FlowEditor.tsx b/src/adapters/obsidian/ui/editors/FlowEditor.tsx index 0519999..6f0a294 100644 --- a/src/adapters/obsidian/ui/editors/FlowEditor.tsx +++ b/src/adapters/obsidian/ui/editors/FlowEditor.tsx @@ -27,7 +27,7 @@ import { import { genId } from "core/utils/uuid"; export interface FlowEditorParent { - flowEditor: FlowEditor | null; + flowEditors: FlowEditor[] | null; containerEl?: HTMLElement; view?: View; dom?: HTMLElement; @@ -77,7 +77,7 @@ export class FlowEditor extends nosuper(HoverPopover) { hideNavBarEl: HTMLElement; - oldPopover = this.parent?.flowEditor; + oldPopover = this.parent?.flowEditors.find((he) => he.id !== this.id); document: Document = this.targetEl?.ownerDocument ?? window.activeDocument ?? window.document; @@ -275,7 +275,8 @@ export class FlowEditor extends nosuper(HoverPopover) { ); if (this.parent) { - this.parent.flowEditor = this; + if (!this.parent.flowEditors) this.parent.flowEditors = []; + this.parent.flowEditors.push(this); this.parent.view.addChild(this); } await this.onShowCallback?.(this); @@ -349,14 +350,16 @@ export class FlowEditor extends nosuper(HoverPopover) { this.shownPos = mouseCoords; this.targetEl.replaceChildren(this.hoverEl); this.onShow(); - app.workspace.onLayoutChange(); + this.plugin.app.workspace.onLayoutChange(); this.load(); } onHide() { this.oldPopover = null; - if (this.parent?.flowEditor === this) { - this.parent.flowEditor = null; + if (this.parent?.flowEditors.find((he) => he == this)) { + this.parent.flowEditors = this.parent.flowEditors.filter( + (he) => he.id !== this.id + ); } } diff --git a/src/adapters/obsidian/utils/patches.ts b/src/adapters/obsidian/utils/patches.ts index 51ea802..d9b4ed4 100644 --- a/src/adapters/obsidian/utils/patches.ts +++ b/src/adapters/obsidian/utils/patches.ts @@ -41,66 +41,64 @@ export const patchWorkspace = (plugin: MakeMDPlugin) => { }, getLeaf(old) { + //Patch get leaf to always return root leaf if leaf is a flow block return function (newLeaf?: "split", direction?: SplitDirection) { - let leaf = old.call(this, newLeaf, direction); - + let leaf : WorkspaceLeaf = old.call(this, newLeaf, direction); if (leaf.isFlowBlock) { + const currentLeafId = leaf.id let foundLeaf = false; plugin.app.workspace.iterateLeaves((_leaf) => { - //@ts-ignore - if (_leaf.flowEditor) { - //@ts-ignore - _leaf.flowEditor.leaves().forEach((l) => { - if (l.id == leaf.id) { - foundLeaf = true; - leaf = _leaf; - return; - } + if (_leaf.flowEditors && !foundLeaf) { + _leaf.flowEditors.forEach((f) => { + f.leaves().forEach((l) => { + if (l.id == currentLeafId) { + foundLeaf = true; + leaf = _leaf; + return; + } + }) + }) - if (foundLeaf) return true; } - leaf = _leaf return; - }, plugin.app.workspace["rootSplit"]!); - } return leaf; }; }, - iterateLeaves(old) { - type leafIterator = (item: WorkspaceLeaf) => boolean | void; - return function (arg1, arg2) { - // Fast exit if desired leaf found - if (old.call(this, arg1, arg2)) return true; + // iterateLeaves(old) { + // type leafIterator = (item: WorkspaceLeaf) => boolean | void; + // return function (arg1, arg2) { + // // Fast exit if desired leaf found + // if (old.call(this, arg1, arg2)) return true; - // Handle old/new API parameter swap - const cb: leafIterator = ( - typeof arg1 === "function" ? arg1 : arg2 - ) as leafIterator; - const parent: WorkspaceItem = ( - typeof arg1 === "function" ? arg2 : arg1 - ) as WorkspaceItem; + // // Handle old/new API parameter swap + // const cb: leafIterator = ( + // typeof arg1 === "function" ? arg1 : arg2 + // ) as leafIterator; + // const parent: WorkspaceItem = ( + // typeof arg1 === "function" ? arg2 : arg1 + // ) as WorkspaceItem; - if (!parent) return false; // <- during app startup, rootSplit can be null - if (layoutChanging) return false; // Don't let HEs close during workspace change + // if (!parent) return false; // <- during app startup, rootSplit can be null + // if (layoutChanging) return false; // Don't let HEs close during workspace change - // 0.14.x doesn't have WorkspaceContainer; this can just be an instanceof check once 15.x is mandatory: - if ( - parent === plugin.app.workspace.rootSplit || - (WorkspaceContainer && parent instanceof WorkspaceContainer) - ) { - for (const popover of FlowEditor.popoversForWindow( - (parent as WorkspaceContainer).win - )) { - // Use old API here for compat w/0.14.x - if (old.call(this, cb, popover.rootSplit)) return true; - } - } - return false; - }; - }, + // // 0.14.x doesn't have WorkspaceContainer; this can just be an instanceof check once 15.x is mandatory: + // if ( + // parent === plugin.app.workspace.rootSplit || + // (WorkspaceContainer && parent instanceof WorkspaceContainer) + // ) { + // for (const popover of FlowEditor.popoversForWindow( + // (parent as WorkspaceContainer).win + // )) { + // // Use old API here for compat w/0.14.x + // if (old.call(this, cb, popover.rootSplit)) return true; + // } + // } + // return false; + // }; + // }, openLinkText(old) { return function openLinkText(linkText: string, sourcePath: string, newLeaf?: PaneType | boolean, openViewState?: OpenViewState) { if (linkText.startsWith('spaces://')) { @@ -170,32 +168,16 @@ export const patchWorkspaceLeaf = (plugin: MakeMDPlugin) => { return top.getRoot === this.getRoot ? top : top.getRoot(); }; }, - onResize(old) { - return function () { - this.view?.onResize(); - }; - }, setViewState(old) { return async function (viewState: ViewState, eState?: unknown) { const result = await old.call(this, viewState, eState); try { - const he = FlowEditor.forLeaf(this); - if (he) { - if (viewState.type) - he.hoverEl.setAttribute( - "data-active-view-type", - viewState.type - ); - const titleEl = he.hoverEl.querySelector(".popover-title"); - if (titleEl) { - titleEl.textContent = this.view?.getDisplayText(); - if (this.view?.file?.path) { - titleEl.setAttribute("data-path", this.view.file.path); - } else { - titleEl.removeAttribute("data-path"); - } + if (this.flowEditors) { + for (const he of this.flowEditors) { + he.hide(); } } + this.flowEditors = []; } catch {} return result; }; diff --git a/src/core/i18n.ts b/src/core/i18n.ts index beb5b68..cd91f52 100644 --- a/src/core/i18n.ts +++ b/src/core/i18n.ts @@ -149,7 +149,7 @@ class T { newView: "New View", calendarView: "Calendar View", dayView: "Day View", - closeSpace: "Close Space", + closeSpace: "Close Space in Focus", customView: "Custom View", detailsView: "Details View", catalogView: "Catalog View", @@ -774,7 +774,7 @@ class T { }, hideFrontmatter: { name: "Hide Context Properties", - desc: "Hide properties you have addeed in context from the Obsidian properties panel", + desc: "Hide properties you have added in context from the Obsidian properties panel", }, openFileContext: { name: "Auto Open Explorer", diff --git a/src/core/react/components/Explorer/PropertiesView.tsx b/src/core/react/components/Explorer/PropertiesView.tsx index 85eb286..aed8ee5 100644 --- a/src/core/react/components/Explorer/PropertiesView.tsx +++ b/src/core/react/components/Explorer/PropertiesView.tsx @@ -106,7 +106,6 @@ export const PropertiesView = (props: { ...(props.superstate.settings.hideFrontmatter ? columns.map((f) => f.name) : []), - ...(props.excludeKeys ?? []), ]); setValues( linkContextRow( diff --git a/src/core/react/components/MarkdownEditor/Backlinks.tsx b/src/core/react/components/MarkdownEditor/Backlinks.tsx index 8f89154..a42aed9 100644 --- a/src/core/react/components/MarkdownEditor/Backlinks.tsx +++ b/src/core/react/components/MarkdownEditor/Backlinks.tsx @@ -39,7 +39,7 @@ const BacklinkItem = (props: { useEffect(() => { refreshBlock(props.path); }, [props.path]); - const [collapsed, setCollapsed] = useState(false); + const [collapsed, setCollapsed] = useState(true); return ( <> diff --git a/src/core/react/components/Navigator/SpaceTree/SpaceTreeItem.tsx b/src/core/react/components/Navigator/SpaceTree/SpaceTreeItem.tsx index 44e9def..ef24a55 100644 --- a/src/core/react/components/Navigator/SpaceTree/SpaceTreeItem.tsx +++ b/src/core/react/components/Navigator/SpaceTree/SpaceTreeItem.tsx @@ -117,6 +117,13 @@ export const TreeItem = (props: TreeItemProps) => { () => setPathState(superstate.pathsIndex.get(data.item.path)), [data.item.path] ); + const openAuxClick = (e: React.MouseEvent) => { + if (e.button == 1) { + superstate.ui.openPath(pathState.path, "tab"); + setActivePath(pathState.path); + setSelectedPaths([data]); + } + }; const openPathAtTarget = (path: TreeNode, e: React.MouseEvent) => { if (e.shiftKey) { onSelectRange(path.id as string); @@ -338,6 +345,7 @@ export const TreeItem = (props: TreeItemProps) => { onMouseLeave={mouseOut} onMouseEnter={hoverItem} onKeyDown={onKeyDown} + onAuxClick={openAuxClick} onClick={(e) => openPathAtTarget(data, e)} onContextMenu={(e) => handleRightClick(e)} {...dropProps} diff --git a/src/core/react/components/SpaceView/Contexts/ContextListContainer.tsx b/src/core/react/components/SpaceView/Contexts/ContextListContainer.tsx index 537e162..6e57bd2 100644 --- a/src/core/react/components/SpaceView/Contexts/ContextListContainer.tsx +++ b/src/core/react/components/SpaceView/Contexts/ContextListContainer.tsx @@ -26,14 +26,8 @@ export const ContextListContainer = (props: { setView?: (view: string) => void; }) => { const { pathState } = useContext(PathContext); - const { - predicate, - editMode, - setEditMode, - dbSchema, - filteredData, - tableData, - } = useContext(ContextEditorContext); + const { predicate, editMode, setEditMode, dbSchema, tableData } = + useContext(ContextEditorContext); const { frameSchema } = useContext(FramesMDBContext); const [editSection, setEditSection] = useState(null); const [selectedIndex, setSelectedIndex] = useState(null); diff --git a/src/core/react/components/SpaceView/Contexts/SpaceEditor/HeaderPropertiesView.tsx b/src/core/react/components/SpaceView/Contexts/SpaceEditor/HeaderPropertiesView.tsx index 8001355..e20b7c2 100644 --- a/src/core/react/components/SpaceView/Contexts/SpaceEditor/HeaderPropertiesView.tsx +++ b/src/core/react/components/SpaceView/Contexts/SpaceEditor/HeaderPropertiesView.tsx @@ -384,6 +384,10 @@ export const HeaderPropertiesView = (props: { const toggleCollapsed = () => { startTransition(() => setCollapsed((f) => !f)); }; + const excludedKeys = [ + ...FMMetadataKeys(props.superstate.settings), + ...FMSpaceKeys(props.superstate.settings), + ]; return (
{!readMode && props.collapseSpaces && ( @@ -529,9 +533,8 @@ export const HeaderPropertiesView = (props: { force={true} compactMode={false} excludeKeys={[ - ...FMMetadataKeys(props.superstate.settings), - "tags", - ...FMSpaceKeys(props.superstate.settings), + ...excludedKeys, + props.superstate.settings.fmKeyAlias, ]} editable={true} > @@ -563,6 +566,16 @@ export const HeaderPropertiesView = (props: {
)} + {excludedKeys.length > 0 && ( + + )} ); }; diff --git a/src/core/react/components/SpaceView/Contexts/TableView/TableView.tsx b/src/core/react/components/SpaceView/Contexts/TableView/TableView.tsx index 4c34afc..536241a 100644 --- a/src/core/react/components/SpaceView/Contexts/TableView/TableView.tsx +++ b/src/core/react/components/SpaceView/Contexts/TableView/TableView.tsx @@ -190,12 +190,6 @@ export const TableView = (props: { superstate: Superstate }) => { } }; - const toggleFlow = (path: string) => { - setOpenFlows((f) => - f.find((p) => p == path) ? f.filter((p) => p != path) : uniq([...f, path]) - ); - }; - const selectItem = (modifier: PointerModifiers, index: string) => { if (modifier.metaKey) { props.superstate.ui.openPath( diff --git a/src/core/react/components/UI/Menus/contexts/newSpacePropertyMenu.tsx b/src/core/react/components/UI/Menus/contexts/newSpacePropertyMenu.tsx index 1ad4a14..46c285e 100644 --- a/src/core/react/components/UI/Menus/contexts/newSpacePropertyMenu.tsx +++ b/src/core/react/components/UI/Menus/contexts/newSpacePropertyMenu.tsx @@ -178,6 +178,7 @@ const NewPropertyMenuComponent = ( !existingCols.some((g) => g.name == f.name) && ![ ...FMMetadataKeys(props.superstate.settings), + props.superstate.settings.fmKeyAlias, "tags", ...FMSpaceKeys(props.superstate.settings), ].some((g) => g == f.name) diff --git a/src/core/react/components/UI/Menus/navigator/spaceContextMenu.tsx b/src/core/react/components/UI/Menus/navigator/spaceContextMenu.tsx index 700b3fe..c8dc2a6 100644 --- a/src/core/react/components/UI/Menus/navigator/spaceContextMenu.tsx +++ b/src/core/react/components/UI/Menus/navigator/spaceContextMenu.tsx @@ -43,6 +43,15 @@ export const showSpaceContextMenu = ( const space = superstate.spacesIndex.get(path.path); if (!space) return; const menuOptions: SelectOption[] = []; + menuOptions.push({ + name: i18n.menu.openFilePane, + icon: "ui//go-to-file", + onClick: (e) => { + superstate.ui.openPath(path.path, true); + }, + }); + menuOptions.push(menuSeparator); + menuOptions.push({ name: "New", type: SelectOptionType.Submenu, diff --git a/src/core/react/components/UI/Stickers/PathSticker/PathSticker.tsx b/src/core/react/components/UI/Stickers/PathSticker/PathSticker.tsx index c832a8c..0498209 100644 --- a/src/core/react/components/UI/Stickers/PathSticker/PathSticker.tsx +++ b/src/core/react/components/UI/Stickers/PathSticker/PathSticker.tsx @@ -22,6 +22,7 @@ export const PathStickerView = (props: { if (!pathState) return; e.preventDefault(); + e.stopPropagation(); const menuOptions: SelectOption[] = []; menuOptions.push({ name: t.buttons.changeIcon, @@ -59,6 +60,7 @@ export const PathStickerView = (props: { return false; }; const triggerStickerMenu = (e: React.MouseEvent) => { + e.stopPropagation(); if (pathState?.type == "space") { props.superstate.ui.openPalette( (_props: { hide: () => void }) => ( diff --git a/src/core/react/context/ContextEditorContext.tsx b/src/core/react/context/ContextEditorContext.tsx index 83e71e2..d31261a 100644 --- a/src/core/react/context/ContextEditorContext.tsx +++ b/src/core/react/context/ContextEditorContext.tsx @@ -165,7 +165,8 @@ export const ContextEditorProvider: React.FC< let schemas = props.superstate.contextsIndex.get(contextPath)?.schemas; if (!schemas) schemas = await props.superstate.spaceManager.tablesForSpace(contextPath); - if (schemas && !isEqual(schemaTable, schemas)) { + + if (schemas && !isEqual(schemaTable?.rows, schemas)) { setSchemaTable(() => ({ ...defaultSchema, rows: schemas, @@ -234,6 +235,10 @@ export const ContextEditorProvider: React.FC< "contextStateUpdated", refreshMDB ); + props.superstate.eventsDispatcher.addListener( + "spaceStateUpdated", + refreshMDB + ); props.superstate.eventsDispatcher.addListener( "pathStateUpdated", @@ -245,6 +250,10 @@ export const ContextEditorProvider: React.FC< "contextStateUpdated", refreshMDB ); + props.superstate.eventsDispatcher.removeListener( + "spaceStateUpdated", + refreshMDB + ); props.superstate.eventsDispatcher.removeListener( "pathStateUpdated", diff --git a/src/core/types/space.ts b/src/core/types/space.ts index 27b9a56..b31db13 100644 --- a/src/core/types/space.ts +++ b/src/core/types/space.ts @@ -8,7 +8,7 @@ import { PathState, SpaceState } from "./superstate" -export const FMMetadataKeys = (settings: MakeMDSettings) => [ settings.fmKeyAlias, settings.fmKeyBanner, settings.fmKeySticker, settings.fmKeyColor, settings.fmKeyBanner, settings.fmKeyBannerOffset] +export const FMMetadataKeys = (settings: MakeMDSettings) => [settings.fmKeyBanner, settings.fmKeySticker, settings.fmKeyColor, settings.fmKeyBanner, settings.fmKeyBannerOffset] export type SpaceSort = { field: string, asc: boolean, diff --git a/src/css/Editor/Flow/FlowEditor.css b/src/css/Editor/Flow/FlowEditor.css index da862fa..7d28a25 100644 --- a/src/css/Editor/Flow/FlowEditor.css +++ b/src/css/Editor/Flow/FlowEditor.css @@ -67,6 +67,10 @@ div:not(.mk-flowspace-editor) > background: none !important; } +.mk-floweditor .view-content .pdf-container { + min-height: 600px; +} + .mk-floweditor-sticker { display: inline-block; --icon-container-size: 20px; diff --git a/src/css/Panels/FileContext.css b/src/css/Panels/FileContext.css index 2462a18..8f32699 100644 --- a/src/css/Panels/FileContext.css +++ b/src/css/Panels/FileContext.css @@ -93,11 +93,7 @@ body .markdown-source-view.mod-cm6.mod-cm6.is-readable-line-width .mk-inline-tit -.mk-path-backlink-title:hover .mk-collapse { - opacity: 1; -} .mk-path-backlink-title .mk-collapse { - opacity: 0; width: 24px !important; height: 24px !important; } @@ -105,7 +101,7 @@ body .markdown-source-view.mod-cm6.mod-cm6.is-readable-line-width .mk-inline-tit transform: rotate(90deg) } .mk-path-backlink-title .mk-collapse.mk-collapsed svg { - transform: rotate(-90deg) + transform: rotate(0deg) } .mk-path-backlink-title .mk-collapse:hover { background: var(--mk-ui-background-hover) !important; diff --git a/src/main.ts b/src/main.ts index 6908b3f..1b3886b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -55,7 +55,7 @@ import { convertPathToSpace } from "core/superstate/utils/path"; import { FilesystemMiddleware, FilesystemSpaceAdapter, SpaceManager, Superstate, UIManager } from "makemd-core"; import { mkLogo } from "adapters/obsidian/ui/icons"; -import { patchFilesPlugin, patchWorkspace } from "adapters/obsidian/utils/patches"; +import { patchFilesPlugin, patchWorkspace, patchWorkspaceLeaf } from "adapters/obsidian/utils/patches"; import { safelyParseJSON } from "utils/parsers"; import { modifyFlowDom } from "./adapters/obsidian/utils/flow/flow"; @@ -505,16 +505,16 @@ loadViews () { }, }); } - this.addCommand({ - id: "mk-test", - name: "Open Test Page", - callback: () => { - this.testPage() - }, - hotkeys: [ + // this.addCommand({ + // id: "mk-test", + // name: "Open Test Page", + // callback: () => { + // this.testPage() + // }, + // hotkeys: [ - ], - }); + // ], + // }); if (this.superstate.settings.blinkEnabled) { this.addCommand({ id: "mk-blink", @@ -562,6 +562,7 @@ loadViews () { loadFlowEditor() { patchWorkspace(this); + patchWorkspaceLeaf(this); document.body.classList.toggle("mk-flow-replace", this.superstate.settings.editorFlow); document.body.classList.toggle( "mk-flow-" + this.superstate.settings.editorFlowStyle, diff --git a/styles.css b/styles.css index a4e3bfe..e28d404 100644 --- a/styles.css +++ b/styles.css @@ -742,6 +742,9 @@ div:not(.mk-flowspace-editor) > .mk-floweditor .cm-content { .mk-floweditor .view-content { background: none !important; } +.mk-floweditor .view-content .pdf-container { + min-height: 600px; +} .mk-floweditor-sticker { display: inline-block; --icon-container-size: 20px; @@ -2859,11 +2862,7 @@ body .markdown-source-view.mod-cm6.mod-cm6.is-readable-line-width .mk-inline-tit .mk-backlinks { padding-top: 8px; } -.mk-path-backlink-title:hover .mk-collapse { - opacity: 1; -} .mk-path-backlink-title .mk-collapse { - opacity: 0; width: 24px !important; height: 24px !important; } @@ -2871,7 +2870,7 @@ body .markdown-source-view.mod-cm6.mod-cm6.is-readable-line-width .mk-inline-tit transform: rotate(90deg); } .mk-path-backlink-title .mk-collapse.mk-collapsed svg { - transform: rotate(-90deg); + transform: rotate(0deg); } .mk-path-backlink-title .mk-collapse:hover { background: var(--mk-ui-background-hover) !important;