@sheetxl/formulas-extended 0.8.0-beta.12 → 0.8.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/esm/{B2E-ZG8fILqD-sK1.mjs → B8SoM9jQdDXwtgKl.mjs} +1 -1
- package/browser/esm/{Ci4ASx39Ynmcu_Rv.mjs → BBakdOGC1cqfF6Iu.mjs} +1 -1
- package/{node/esm/l_mAU10VLex7MbNS.mjs → browser/esm/BKOSUaPOspNA3UiR.mjs} +1 -1
- package/browser/esm/{3YF5WqtiNL_6UP5n.mjs → BYB98ngJrP8aUEUh.mjs} +1 -1
- package/{node/esm/Ho2ku6yiOsikJBtk.mjs → browser/esm/Bg9SWNEspWJ7vEAh.mjs} +1 -1
- package/browser/esm/{Cc7LIKPWiyCgJqYn.mjs → BjazhB-rkLGqWTP9.mjs} +1 -1
- package/{node/esm/DVbiWA-_uacThTwT.mjs → browser/esm/BnqqSrfJVCEx19PQ.mjs} +1 -1
- package/{node/esm/BDqS1P5pTbn9aAV_.mjs → browser/esm/BtNcXw7rVlHo7gOf.mjs} +1 -1
- package/{node/esm/CZJOUlr4oLNPJITg.mjs → browser/esm/BymHQ6d0GuLbbJvM.mjs} +1 -1
- package/{node/esm/BB1d7qGfuPz7e-f7.mjs → browser/esm/C0LxMpWsn2I0bY9l.mjs} +1 -1
- package/{node/esm/Bv61jGkVgv0dkZ5e.mjs → browser/esm/CA-J-CuKvqHcKua5.mjs} +1 -1
- package/browser/esm/{pUCLFwRpkkiUF_c2.mjs → CQpm3BBIhHls0ymg.mjs} +1 -1
- package/browser/esm/{BB3P4ykXH-rBCOGY.mjs → CZssZc0NRsK86rhA.mjs} +1 -1
- package/browser/esm/{BckB_3BgZOuSlZFK.mjs → CayxCfr6Req5OBnt.mjs} +1 -1
- package/{node/esm/kTIyJgfiglzdgupY.mjs → browser/esm/CwLe_zJj5hXFWIYA.mjs} +1 -1
- package/browser/esm/{BdRI3Llx4gJRAgEK.mjs → CwfGkuVMc5cxV4zD.mjs} +1 -1
- package/browser/esm/{C_iF7M9kaGbs3TCH.mjs → DDAPeOZHl2lPDy8F.mjs} +1 -1
- package/browser/esm/{D4OUOSNs4L6CaX6_.mjs → DGL-3YiIvZL1aezr.mjs} +1 -1
- package/browser/esm/{D0-OgCQX5hIZ6lNv.mjs → DnC76PQFsjGNd0ED.mjs} +1 -1
- package/browser/esm/{5VSZrR_zA2OmxqwM.mjs → La5T3OKHn32uWF7E.mjs} +1 -1
- package/{node/esm/Bv-tN3y9Dc4WI9P_.mjs → browser/esm/XHM3EQlFTOHq3jQP.mjs} +1 -1
- package/browser/esm/declarations.mjs +2 -2
- package/browser/esm/index.mjs +59 -56
- package/{node/esm/QPgwxV6CKVRfiMgU.mjs → browser/esm/lPwbrKEbLIYzRLFP.mjs} +1 -1
- package/node/esm/{B2E-ZG8fILqD-sK1.mjs → B8SoM9jQdDXwtgKl.mjs} +1 -1
- package/node/esm/{Ci4ASx39Ynmcu_Rv.mjs → BBakdOGC1cqfF6Iu.mjs} +1 -1
- package/{browser/esm/l_mAU10VLex7MbNS.mjs → node/esm/BKOSUaPOspNA3UiR.mjs} +1 -1
- package/node/esm/{3YF5WqtiNL_6UP5n.mjs → BYB98ngJrP8aUEUh.mjs} +1 -1
- package/{browser/esm/Ho2ku6yiOsikJBtk.mjs → node/esm/Bg9SWNEspWJ7vEAh.mjs} +1 -1
- package/{browser/esm/DVbiWA-_uacThTwT.mjs → node/esm/BnqqSrfJVCEx19PQ.mjs} +1 -1
- package/{browser/esm/BDqS1P5pTbn9aAV_.mjs → node/esm/BtNcXw7rVlHo7gOf.mjs} +1 -1
- package/{browser/esm/CZJOUlr4oLNPJITg.mjs → node/esm/BymHQ6d0GuLbbJvM.mjs} +1 -1
- package/{browser/esm/BB1d7qGfuPz7e-f7.mjs → node/esm/C0LxMpWsn2I0bY9l.mjs} +1 -1
- package/{browser/esm/Bv61jGkVgv0dkZ5e.mjs → node/esm/CA-J-CuKvqHcKua5.mjs} +1 -1
- package/node/esm/{pUCLFwRpkkiUF_c2.mjs → CQpm3BBIhHls0ymg.mjs} +1 -1
- package/node/esm/{BckB_3BgZOuSlZFK.mjs → CayxCfr6Req5OBnt.mjs} +1 -1
- package/node/esm/{CNXBMkJ9KPYEmoGF.mjs → CiAc0OZCRv1uRsiF.mjs} +1 -1
- package/{browser/esm/kTIyJgfiglzdgupY.mjs → node/esm/CwLe_zJj5hXFWIYA.mjs} +1 -1
- package/node/esm/{C_iF7M9kaGbs3TCH.mjs → DDAPeOZHl2lPDy8F.mjs} +1 -1
- package/node/esm/{D4OUOSNs4L6CaX6_.mjs → DGL-3YiIvZL1aezr.mjs} +1 -1
- package/node/esm/{Mdb0g5H17I3Oon-f.mjs → D_YJXQ3IoCVzkEWy.mjs} +1 -1
- package/node/esm/{D0-OgCQX5hIZ6lNv.mjs → DnC76PQFsjGNd0ED.mjs} +1 -1
- package/node/esm/{5VSZrR_zA2OmxqwM.mjs → La5T3OKHn32uWF7E.mjs} +1 -1
- package/{browser/esm/Bv-tN3y9Dc4WI9P_.mjs → node/esm/XHM3EQlFTOHq3jQP.mjs} +1 -1
- package/node/esm/declarations.mjs +2 -2
- package/node/esm/index.mjs +153 -150
- package/{browser/esm/QPgwxV6CKVRfiMgU.mjs → node/esm/lPwbrKEbLIYzRLFP.mjs} +1 -1
- package/node/esm/{CoiYUgAPry1qUyhB.mjs → shH8FSZ-wXbrxVx7.mjs} +1 -1
- package/package.json +3 -3
- package/types/src/_utils/AnyArgs.d.ts +0 -12
- package/types/src/_utils/FinanaceSolver.d.ts +0 -27
- package/types/src/_utils/FinanceAmor.d.ts +0 -9
- package/types/src/_utils/FinanceCashflow.d.ts +0 -17
- package/types/src/_utils/FinanceCoupon.d.ts +0 -63
- package/types/src/_utils/FinanceDate.d.ts +0 -7
- package/types/src/_utils/FinanceDayCount.d.ts +0 -74
- package/types/src/_utils/FinanceOdd.d.ts +0 -62
- package/types/src/_utils/FinanceSecurity.d.ts +0 -21
- package/types/src/_utils/FinanceUtils.d.ts +0 -34
- package/types/src/financial/ACCRINT.d.ts +0 -23
- package/types/src/financial/AMORDEGRC.d.ts +0 -22
- package/types/src/financial/Cashflow.d.ts +0 -49
- package/types/src/financial/Coupon.d.ts +0 -14
- package/types/src/financial/Date.d.ts +0 -29
- package/types/src/financial/Depreciation.d.ts +0 -9
- package/types/src/financial/Odd.d.ts +0 -18
- package/types/src/financial/Security.d.ts +0 -10
- package/types/src/financial/SecurityMaturity.d.ts +0 -40
- package/types/src/financial/TBill.d.ts +0 -17
- package/types/src/financial/VDB.d.ts +0 -17
package/node/esm/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/formulas-extended - Formulas Enterprise - TypeScript formulas compatible with Excel built-ins. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/formulas-extended - Formulas Enterprise - TypeScript formulas compatible with Excel built-ins. - v0.8.0-beta.14
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
import { S as t, _ as n, a as e, b as r, c as o, d as i, f as u, g as s, h as a, i as l, l as f, m as c, n as h, o as m, p as N, r as g, s as p, t as d, u as y, v as M, x as
|
|
8
|
-
import { FormulaContext as b, FormulaError as B, IRange as x, ScalarType as
|
|
7
|
+
import { S as t, _ as n, a as e, b as r, c as o, d as i, f as u, g as s, h as a, i as l, l as f, m as c, n as h, o as m, p as N, r as g, s as p, t as d, u as y, v as M, x as I, y as w } from "./D_YJXQ3IoCVzkEWy.mjs";
|
|
8
|
+
import { FormulaContext as b, FormulaError as B, IRange as x, ScalarType as C, ValueKind as R } from "@sheetxl/primitives";
|
|
9
9
|
var E = Object.defineProperty, A = (t, n) => {
|
|
10
10
|
let e = {};
|
|
11
11
|
for (var r in t) E(e, r, {
|
|
@@ -323,13 +323,13 @@ function mt(t, n, e, r, o, i, u = 0, s = !0) {
|
|
|
323
323
|
let a;
|
|
324
324
|
if (e > n && i) {
|
|
325
325
|
a = n;
|
|
326
|
-
for (let t = n; t < e;) a = t, t =
|
|
327
|
-
} else a =
|
|
328
|
-
const l = 3 === o ? 365 / r : 1 === o ? n -
|
|
326
|
+
for (let t = n; t < e;) a = t, t = wt(t, u, s);
|
|
327
|
+
} else a = wt(n, -u, s);
|
|
328
|
+
const l = 3 === o ? 365 / r : 1 === o ? n - wt(n, -u, s) : 360 / r;
|
|
329
329
|
let f = Mt(Math.max(t, a), e, o) / l;
|
|
330
330
|
for (let n = a; n > t;) {
|
|
331
|
-
const e =
|
|
332
|
-
t <= e ? i && (f += 1) : f += Mt(t, n, o) /
|
|
331
|
+
const e = wt(n, -u, s);
|
|
332
|
+
t <= e ? i && (f += 1) : f += Mt(t, n, o) / It(e, n, r, o), n = e;
|
|
333
333
|
}
|
|
334
334
|
return f;
|
|
335
335
|
}(p, Math.floor(f), d, N, g, a);
|
|
@@ -354,8 +354,8 @@ function yt(t, n) {
|
|
|
354
354
|
const e = X(t), r = X(n);
|
|
355
355
|
return 31 === e.d && (e.d = 30), 31 === r.d && (r.d = 30), gt(e, r);
|
|
356
356
|
}
|
|
357
|
-
var Mt = (t, n, e) => 0 === e ? dt(t, n, !1) : 4 === e ? yt(t, n) : n - t,
|
|
358
|
-
function
|
|
357
|
+
var Mt = (t, n, e) => 0 === e ? dt(t, n, !1) : 4 === e ? yt(t, n) : n - t, It = (t, n, e, r) => 1 === r ? n - t : 3 === r ? 365 / e : 4 === r ? yt(t, n) : dt(t, n, !0);
|
|
358
|
+
function wt(t, n, e) {
|
|
359
359
|
if (t < 1) throw B.BuiltIn.Num;
|
|
360
360
|
const r = W(X(t), n), o = H(r.y, r.m, e ? z(r.y, r.m) : r.d);
|
|
361
361
|
if (o < 1 || o > 2958465) throw B.BuiltIn.Num;
|
|
@@ -391,7 +391,7 @@ var Bt = (t) => {
|
|
|
391
391
|
let e = Math.abs(n), r = 1, o = t;
|
|
392
392
|
for (; e > 0;) e % 2 == 1 && (r *= o), o *= o, e = Math.floor(e / 2);
|
|
393
393
|
return n < 0 ? 1 / r : r;
|
|
394
|
-
},
|
|
394
|
+
}, Ct = (t) => t >= 2147483648 || t <= -2147483649 || Number.isNaN(t) ? -2147483648 : Math.trunc(t), Rt = (t, n = 0) => {
|
|
395
395
|
const e = 10 ** n, r = Number(Math.abs(t).toPrecision(15));
|
|
396
396
|
return Math.sign(t) * Math.round(r * e) / e;
|
|
397
397
|
}, Et = A({ AMORDEGRC: () => vt }), At = 1e6;
|
|
@@ -402,27 +402,27 @@ function vt(t, n, e, r, o, i, u = 0) {
|
|
|
402
402
|
if (g <= 2) return NaN;
|
|
403
403
|
const p = c * (g <= 4 ? 1.5 : g <= 6 ? 2 : 2.5), d = Math.ceil(g);
|
|
404
404
|
if (a - l === 0) return 0;
|
|
405
|
-
const y =
|
|
405
|
+
const y = Rt(Math.min(a * p * N, a - l));
|
|
406
406
|
if (0 === f) return y;
|
|
407
407
|
let M = a - y;
|
|
408
|
-
const
|
|
409
|
-
let
|
|
410
|
-
if (
|
|
411
|
-
if (
|
|
408
|
+
const I = Math.min(f, d - 3);
|
|
409
|
+
let w = 1;
|
|
410
|
+
if (I >= 1) {
|
|
411
|
+
if (I - 1 <= At) for (; w < I; w++) {
|
|
412
412
|
if (M < l) return 0;
|
|
413
413
|
M -= M * p;
|
|
414
414
|
}
|
|
415
|
-
else M *= xt(1 - p,
|
|
415
|
+
else M *= xt(1 - p, I - 1), w = I;
|
|
416
416
|
if (M < l) return 0;
|
|
417
|
-
if (f ===
|
|
418
|
-
M -= M * p,
|
|
417
|
+
if (f === I) return Rt(M * p);
|
|
418
|
+
M -= M * p, w++;
|
|
419
419
|
}
|
|
420
|
-
for (;
|
|
420
|
+
for (; w <= f; w++) {
|
|
421
421
|
if (M < l) return 0;
|
|
422
|
-
const t = d -
|
|
422
|
+
const t = d - w;
|
|
423
423
|
if (t < 1) return 0;
|
|
424
424
|
const n = t <= 2 ? M / t : M * p;
|
|
425
|
-
if (
|
|
425
|
+
if (w === f) return Rt(n);
|
|
426
426
|
M -= n;
|
|
427
427
|
}
|
|
428
428
|
return 0;
|
|
@@ -611,7 +611,7 @@ function Ht(t, n) {
|
|
|
611
611
|
return i;
|
|
612
612
|
}
|
|
613
613
|
function Wt(t, n = .1) {
|
|
614
|
-
if (b.formatResults("0%"), b.getArgs().getKindAt(0) ===
|
|
614
|
+
if (b.formatResults("0%"), b.getArgs().getKindAt(0) === R.Error) throw t[0];
|
|
615
615
|
if (n <= -1 || 1 + n === n) throw B.BuiltIn.Value;
|
|
616
616
|
if (void 0 === t) throw B.BuiltIn.Value;
|
|
617
617
|
const e = [];
|
|
@@ -890,7 +890,7 @@ function Mn(t, n, e, r) {
|
|
|
890
890
|
const h = u.findIndex((n) => an(n) <= t);
|
|
891
891
|
return ln(u[h], u[h - 1]);
|
|
892
892
|
}
|
|
893
|
-
function
|
|
893
|
+
function In(t, n, e, r) {
|
|
894
894
|
const o = k(t), i = k(n), u = Math.floor(o), s = Math.floor(i);
|
|
895
895
|
if (!J(o) || !J(i) || u >= s) throw B.BuiltIn.Num;
|
|
896
896
|
const a = Math.trunc(q(e));
|
|
@@ -904,7 +904,7 @@ function wn(t, n, e, r) {
|
|
|
904
904
|
basis: f
|
|
905
905
|
};
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function wn(t, n, e, r) {
|
|
908
908
|
const o = pn(t, n, e), i = dn(t, n, e, r), u = 1 === r ? i + yn(t, n, e, r) : Mn(t, n, e, r);
|
|
909
909
|
return {
|
|
910
910
|
N: o,
|
|
@@ -914,7 +914,7 @@ function In(t, n, e, r) {
|
|
|
914
914
|
};
|
|
915
915
|
}
|
|
916
916
|
function bn(t, n, e, r, o, i, u) {
|
|
917
|
-
const { N: s, A: a, E: l, DSC: f } =
|
|
917
|
+
const { N: s, A: a, E: l, DSC: f } = wn(t, n, i, u);
|
|
918
918
|
if (Number.isNaN(s)) return NaN;
|
|
919
919
|
const c = 100 * e / i, h = r / i;
|
|
920
920
|
if (1 === s) return (c + o) / (h * f / l + 1) - c * a / l;
|
|
@@ -925,7 +925,7 @@ function bn(t, n, e, r, o, i, u) {
|
|
|
925
925
|
return N + o / m - c * a / l;
|
|
926
926
|
}
|
|
927
927
|
function Bn(t, n, e, r, o, i) {
|
|
928
|
-
const { N: u, A: s, E: a, DSC: l } =
|
|
928
|
+
const { N: u, A: s, E: a, DSC: l } = wn(t, n, o, i);
|
|
929
929
|
if (Number.isNaN(u)) return NaN;
|
|
930
930
|
const f = l / a - 1, c = 1 + r / o, h = 100 * e / o;
|
|
931
931
|
let m = 0, N = 0;
|
|
@@ -939,35 +939,35 @@ function Bn(t, n, e, r, o, i) {
|
|
|
939
939
|
return m += g * d, N += d, m / N / o;
|
|
940
940
|
}
|
|
941
941
|
var xn = A({
|
|
942
|
-
COUPDAYBS: () =>
|
|
943
|
-
COUPDAYS: () =>
|
|
942
|
+
COUPDAYBS: () => Cn,
|
|
943
|
+
COUPDAYS: () => Rn,
|
|
944
944
|
COUPDAYSNC: () => En,
|
|
945
945
|
COUPNCD: () => An,
|
|
946
946
|
COUPNUM: () => Dn,
|
|
947
947
|
COUPPCD: () => vn
|
|
948
948
|
});
|
|
949
|
-
function
|
|
950
|
-
const o =
|
|
949
|
+
function Cn(t, n, e, r = 0) {
|
|
950
|
+
const o = In(t, n, e, r);
|
|
951
951
|
return dn(o.settlement, o.maturity, o.frequency, o.basis);
|
|
952
952
|
}
|
|
953
|
-
function
|
|
954
|
-
const o =
|
|
953
|
+
function Rn(t, n, e, r = 0) {
|
|
954
|
+
const o = In(t, n, e, r);
|
|
955
955
|
return Mn(o.settlement, o.maturity, o.frequency, o.basis);
|
|
956
956
|
}
|
|
957
957
|
function En(t, n, e, r = 0) {
|
|
958
|
-
const o =
|
|
958
|
+
const o = In(t, n, e, r);
|
|
959
959
|
return yn(o.settlement, o.maturity, o.frequency, o.basis);
|
|
960
960
|
}
|
|
961
961
|
function An(t, n, e, r = 0) {
|
|
962
|
-
const o =
|
|
962
|
+
const o = In(t, n, e, r);
|
|
963
963
|
return gn(o.settlement, o.maturity, o.frequency);
|
|
964
964
|
}
|
|
965
965
|
function vn(t, n, e, r = 0) {
|
|
966
|
-
const o =
|
|
966
|
+
const o = In(t, n, e, r);
|
|
967
967
|
return Nn(o.settlement, o.maturity, o.frequency);
|
|
968
968
|
}
|
|
969
969
|
function Dn(t, n, e, r = 0) {
|
|
970
|
-
const o =
|
|
970
|
+
const o = In(t, n, e, r);
|
|
971
971
|
return pn(o.settlement, o.maturity, o.frequency);
|
|
972
972
|
}
|
|
973
973
|
var Fn = A({
|
|
@@ -1001,12 +1001,12 @@ function Vn(t, n, e = 0) {
|
|
|
1001
1001
|
}
|
|
1002
1002
|
function Tn(t, n, e = !1) {
|
|
1003
1003
|
if (!J(t) || !J(n)) return NaN;
|
|
1004
|
-
const r = Math.floor(t),
|
|
1005
|
-
return e ? (
|
|
1004
|
+
const r = .5 / 86400, o = Math.floor(t + r), i = Math.floor(n + r);
|
|
1005
|
+
return e ? (i >= o ? 1 : -1) * Q(o, i, 4).days : function(t, n) {
|
|
1006
1006
|
const e = K(t), r = K(n), o = e.year, i = e.month;
|
|
1007
1007
|
let u = e.day, s = r.year, a = r.month, l = r.day;
|
|
1008
1008
|
return 2 === i ? 3 === K(t + 1).month && (u = 30) : 31 === u && (u = 30), 31 === l && (u < 30 ? (12 === a ? (s += 1, a = 1) : a += 1, l = 1) : l = 30), Z(o, i, u, s, a, l);
|
|
1009
|
-
}(
|
|
1009
|
+
}(o, i);
|
|
1010
1010
|
}
|
|
1011
1011
|
var Pn = A({
|
|
1012
1012
|
AMORLINC: () => qn,
|
|
@@ -1027,12 +1027,12 @@ function $n(t, n, e, r) {
|
|
|
1027
1027
|
}
|
|
1028
1028
|
function kn(t, n, e, r, o = 12) {
|
|
1029
1029
|
if (b.formatResults(Bt(b.getRuntime())), t < 0 || n < 0 || e <= 0 || r <= 0) return NaN;
|
|
1030
|
-
const i =
|
|
1030
|
+
const i = Ct(o);
|
|
1031
1031
|
if (i < 1 || i > 12) return NaN;
|
|
1032
|
-
const u =
|
|
1032
|
+
const u = Ct(e), s = Ct(r);
|
|
1033
1033
|
if (s > u + (i < 12 ? 1 : 0)) return NaN;
|
|
1034
1034
|
if (0 === t) return 0;
|
|
1035
|
-
const a =
|
|
1035
|
+
const a = Rt(1 - xt(n / t, 1 / e), 3);
|
|
1036
1036
|
if (0 === a) return 0;
|
|
1037
1037
|
const l = t * a * (i / 12), f = Math.max(s, 1);
|
|
1038
1038
|
if (1 === f) return l;
|
|
@@ -1141,7 +1141,7 @@ function Zn(t, n, e, r, o, i) {
|
|
|
1141
1141
|
let l = X(r);
|
|
1142
1142
|
for (let t = 0; t < s; t++) l = W(l, -u), a.push(Gn(l));
|
|
1143
1143
|
if (a[a.length - 1] < 1) throw B.BuiltIn.Num;
|
|
1144
|
-
const f = (t, n) => Q(t, n, i).days, c =
|
|
1144
|
+
const f = (t, n) => Q(t, n, i).days, c = wn(t, r, o, i);
|
|
1145
1145
|
if (Number.isNaN(c.N)) throw B.BuiltIn.Num;
|
|
1146
1146
|
const h = c.E, m = f(e, r);
|
|
1147
1147
|
if (m === h) throw B.BuiltIn.Num;
|
|
@@ -1161,12 +1161,12 @@ function Zn(t, n, e, r, o, i) {
|
|
|
1161
1161
|
const r = a[s - n], u = a[s - n - 1], l = 1 === i ? u - r : 3 === i ? 365 / o : 360 / o, c = Math.max(r, e);
|
|
1162
1162
|
t > c && u > c && (g += f(c, Math.min(u, t)) / l), p += 0 === n ? u > e ? f(e, u) / l : 0 : 1;
|
|
1163
1163
|
}
|
|
1164
|
-
const d = X(t), y = H(d.y, d.m, z(d.y, d.m)), M = y < r && gn(y - 1, r, o) === y,
|
|
1164
|
+
const d = X(t), y = H(d.y, d.m, z(d.y, d.m)), M = y < r && gn(y - 1, r, o) === y, I = G(X(r)) && t !== y && !M ? 1 : 0;
|
|
1165
1165
|
return {
|
|
1166
1166
|
N,
|
|
1167
1167
|
A: g,
|
|
1168
1168
|
DC: p,
|
|
1169
|
-
u: c.N - 1 +
|
|
1169
|
+
u: c.N - 1 + I + (2 === i || 3 === i ? gn(t, r, o) - t : c.DSC) / h
|
|
1170
1170
|
};
|
|
1171
1171
|
}
|
|
1172
1172
|
var Qn = (t) => Number.isFinite(t) ? t : 0;
|
|
@@ -1268,8 +1268,8 @@ function ue(t, n, e, r, o, i, u, s = 0) {
|
|
|
1268
1268
|
i
|
|
1269
1269
|
], u, s), [l, f, c] = a.dates, [h, m, N] = a.numbers;
|
|
1270
1270
|
if (!(c < l && l < f) || h < 0 || m <= 0 || N <= 0) throw B.BuiltIn.Num;
|
|
1271
|
-
const { A: g, DC: p, DSC: d } = Kn(l, f, c, a.frequency, a.basis), y = 100 * h / a.frequency, M = N + Qn(y * p),
|
|
1272
|
-
return (M -
|
|
1271
|
+
const { A: g, DC: p, DSC: d } = Kn(l, f, c, a.frequency, a.basis), y = 100 * h / a.frequency, M = N + Qn(y * p), I = m + Qn(y * g);
|
|
1272
|
+
return (M - I) / I * (a.frequency / d);
|
|
1273
1273
|
}
|
|
1274
1274
|
var se = A({
|
|
1275
1275
|
DURATION: () => le,
|
|
@@ -1303,11 +1303,11 @@ function ce(t, n, e, r, o, i, u = 0) {
|
|
|
1303
1303
|
o
|
|
1304
1304
|
], i, u), [a, l, f] = s.numbers;
|
|
1305
1305
|
if (a < 0 || l <= 0 || f <= 0) throw B.BuiltIn.Num;
|
|
1306
|
-
const { settlement: c, maturity: h, frequency: m, basis: N } = s, g =
|
|
1306
|
+
const { settlement: c, maturity: h, frequency: m, basis: N } = s, g = wn(c, h, m, N);
|
|
1307
1307
|
if (Number.isNaN(g.N)) throw B.BuiltIn.Num;
|
|
1308
1308
|
if (g.N > 1) {
|
|
1309
1309
|
const t = te(Jn(a, l, nt(c, h, N)), (t) => bn(c, h, a, t, f, m, N) - l, (t) => function(t, n, e, r, o, i, u) {
|
|
1310
|
-
const { N: s, A: a, E: l, DSC: f } =
|
|
1310
|
+
const { N: s, A: a, E: l, DSC: f } = wn(t, n, i, u);
|
|
1311
1311
|
if (Number.isNaN(s)) return NaN;
|
|
1312
1312
|
const c = 100 * e / i, h = 1 + r / i;
|
|
1313
1313
|
let m = -o * (s - 1 + f / l) / i / h ** (s + f / l);
|
|
@@ -1360,12 +1360,12 @@ function Me(t, n, e, r, o, i = 0) {
|
|
|
1360
1360
|
if (u.rate < 0 || u.x <= 0) throw B.BuiltIn.Num;
|
|
1361
1361
|
return ((1 + u.DIM / u.B * u.rate) / (u.x / 100 + u.A / u.B * u.rate) - 1) / (u.DSM / u.B);
|
|
1362
1362
|
}
|
|
1363
|
-
var
|
|
1363
|
+
var Ie = A({
|
|
1364
1364
|
TBILLEQ: () => Be,
|
|
1365
|
-
TBILLPRICE: () =>
|
|
1365
|
+
TBILLPRICE: () => we,
|
|
1366
1366
|
TBILLYIELD: () => be
|
|
1367
1367
|
});
|
|
1368
|
-
function
|
|
1368
|
+
function we(t, n, e) {
|
|
1369
1369
|
const r = at(t, n, e), o = 100 * (1 - ct(r.x * r.days) / 360);
|
|
1370
1370
|
if (o < 0) throw B.BuiltIn.Num;
|
|
1371
1371
|
return o;
|
|
@@ -1386,8 +1386,8 @@ function Be(t, n, e) {
|
|
|
1386
1386
|
const u = r.days / (r.days > 365 ? 366 : 365);
|
|
1387
1387
|
return (-2 * u + 2 * Math.sqrt(u * u - (2 * u - 1) * (1 - 1 / i))) / (2 * u - 1);
|
|
1388
1388
|
}
|
|
1389
|
-
var xe = A({ VDB: () =>
|
|
1390
|
-
function
|
|
1389
|
+
var xe = A({ VDB: () => Re }), Ce = 1e7;
|
|
1390
|
+
function Re(t, n, e, r, o, i = 2, u = !1) {
|
|
1391
1391
|
if (b.formatResults(Bt(b.getRuntime())), t < 0 || n < 0 || e < 0 || i < 0 || r < 0 || o > e || r > o) return NaN;
|
|
1392
1392
|
if (0 === e) throw B.BuiltIn.Div0;
|
|
1393
1393
|
if (r === o) return 0;
|
|
@@ -1416,7 +1416,7 @@ function Ce(t, n, e, r, o, i = 2, u = !1) {
|
|
|
1416
1416
|
}
|
|
1417
1417
|
s -= o;
|
|
1418
1418
|
}
|
|
1419
|
-
if (i >
|
|
1419
|
+
if (i > Ce) return s * xt(1 - r, i);
|
|
1420
1420
|
for (let t = 1; t <= i; t++) {
|
|
1421
1421
|
let o;
|
|
1422
1422
|
if (a) o = l;
|
|
@@ -1699,22 +1699,22 @@ function Xe(t, n, e, r, o = 1, i, u, s = 0) {
|
|
|
1699
1699
|
if (u && !$e(u, t.getRowCount())) return B.BuiltIn.Value;
|
|
1700
1700
|
const { measures: m, vertical: N } = a, g = n.getColumnCount(), p = Pe(i, f, N ? g : m.length);
|
|
1701
1701
|
if (B.isError(p)) return p;
|
|
1702
|
-
let d = t, y = n, M = u,
|
|
1702
|
+
let d = t, y = n, M = u, I = null, w = null;
|
|
1703
1703
|
if (l.hasHeader) {
|
|
1704
1704
|
if (d.getRowCount() < 2) return B.BuiltIn.Value;
|
|
1705
|
-
|
|
1705
|
+
I = He(d), w = He(y), d = ze(d), y = ze(y), M && (M = ze(M));
|
|
1706
1706
|
}
|
|
1707
1707
|
const x = new ke(d, M);
|
|
1708
1708
|
if (0 === x.getRecordCount()) return B.BuiltIn.Value;
|
|
1709
|
-
const
|
|
1709
|
+
const C = Ye(y), R = new Array(C.length), E = /* @__PURE__ */ new Map(), A = (t) => {
|
|
1710
1710
|
let n = E.get(t);
|
|
1711
|
-
return n || (n = m.map((n) => (N ?
|
|
1711
|
+
return n || (n = m.map((n) => (N ? C.map((t, n) => n) : [n.column]).map((e) => De(n, x.getMembers(C[e], t), ((t) => () => R[t] ??= x.getMembers(C[t], null))(e)))), E.set(t, n), n);
|
|
1712
1712
|
}, v = p.byValue, D = x.sort(p, (t) => N ? A(t)[0][v.measure] : A(t)[v.measure][0], h), F = h ? Ke(D, c) : x.lines(D, c), S = [];
|
|
1713
1713
|
if (N) {
|
|
1714
1714
|
l.show && S.push([
|
|
1715
|
-
...We(
|
|
1715
|
+
...We(I, f),
|
|
1716
1716
|
"",
|
|
1717
|
-
...
|
|
1717
|
+
...C.map((t, n) => w ? w[n] : Ue(n))
|
|
1718
1718
|
]);
|
|
1719
1719
|
for (const t of F) {
|
|
1720
1720
|
const n = x.keyCells(t, c), e = A(t.node);
|
|
@@ -1725,7 +1725,7 @@ function Xe(t, n, e, r, o = 1, i, u, s = 0) {
|
|
|
1725
1725
|
]);
|
|
1726
1726
|
}
|
|
1727
1727
|
} else {
|
|
1728
|
-
a.named && S.push([...new Array(f).fill(""), ...m.map((t) => t.label)]), l.show && S.push([...We(
|
|
1728
|
+
a.named && S.push([...new Array(f).fill(""), ...m.map((t) => t.label)]), l.show && S.push([...We(I, f), ...m.map((t) => w ? w[t.column] : Ue(t.column))]);
|
|
1729
1729
|
for (const t of F) {
|
|
1730
1730
|
const n = x.keyCells(t, c);
|
|
1731
1731
|
for (const e of A(t.node)) n.push(e[0]);
|
|
@@ -1770,16 +1770,16 @@ function Qe(t, n, e, r, o, i = 1, u, s = 1, a, l, f = 0) {
|
|
|
1770
1770
|
if (h.vertical && Math.abs(p) > 1) return B.BuiltIn.Value;
|
|
1771
1771
|
if (!Number.isInteger(f) || f < 0 || f > 4) return B.BuiltIn.Value;
|
|
1772
1772
|
if (l && !$e(l, c)) return B.BuiltIn.Value;
|
|
1773
|
-
const { measures: y, vertical: M } = h,
|
|
1773
|
+
const { measures: y, vertical: M } = h, I = e.getColumnCount(), w = M ? I : y.length, x = Pe(u, N, w);
|
|
1774
1774
|
if (B.isError(x)) return x;
|
|
1775
|
-
const
|
|
1776
|
-
if (B.isError(
|
|
1777
|
-
let
|
|
1775
|
+
const C = Pe(a, g, w);
|
|
1776
|
+
if (B.isError(C)) return C;
|
|
1777
|
+
let R = t, E = n, A = e, v = l, D = null, F = null, S = null;
|
|
1778
1778
|
if (m.hasHeader) {
|
|
1779
1779
|
if (c < 2) return B.BuiltIn.Value;
|
|
1780
|
-
|
|
1780
|
+
R && (D = Je(R), R = ze(R)), E && (F = Je(E), E = ze(E)), S = Je(A), A = ze(A), v && (v = ze(v));
|
|
1781
1781
|
}
|
|
1782
|
-
const V =
|
|
1782
|
+
const V = R ? new ke(R, v) : null, T = E ? new ke(E, v) : null;
|
|
1783
1783
|
if (0 === (V ?? T).getRecordCount()) return B.BuiltIn.Value;
|
|
1784
1784
|
const O = new tr(V, T, Ye(A), v), $ = (t, n, e, r) => {
|
|
1785
1785
|
const o = O.members(t, n, r);
|
|
@@ -1795,8 +1795,8 @@ function Qe(t, n, e, r, o, i = 1, u, s = 1, a, l, f = 0) {
|
|
|
1795
1795
|
}, k = (t) => (n, e) => M ? $(n, e, y[0], t.measure) : $(n, e, y[t.measure], y[t.measure].column), L = [{
|
|
1796
1796
|
kind: "total",
|
|
1797
1797
|
node: null
|
|
1798
|
-
}], q = V ? V.lines(V.sort(x, (t) => k(x.byValue)(t, null), !1), p) : L, _ = T ? T.lines(T.sort(
|
|
1799
|
-
for (const t of _) if (M) for (let n = 0; n <
|
|
1798
|
+
}], q = V ? V.lines(V.sort(x, (t) => k(x.byValue)(t, null), !1), p) : L, _ = T ? T.lines(T.sort(C, (t) => k(C.byValue)(null, t), !1), d) : L, j = [];
|
|
1799
|
+
for (const t of _) if (M) for (let n = 0; n < I; n++) j.push({
|
|
1800
1800
|
line: t,
|
|
1801
1801
|
measure: -1,
|
|
1802
1802
|
column: n
|
|
@@ -1806,7 +1806,7 @@ function Qe(t, n, e, r, o, i = 1, u, s = 1, a, l, f = 0) {
|
|
|
1806
1806
|
measure: n,
|
|
1807
1807
|
column: y[n].column
|
|
1808
1808
|
});
|
|
1809
|
-
const U = !!T && !h.named &&
|
|
1809
|
+
const U = !!T && !h.named && I > 1, Y = N + (M ? 1 : 0), z = () => new Array(Y).fill(""), G = [];
|
|
1810
1810
|
if (m.show && T) {
|
|
1811
1811
|
const t = [];
|
|
1812
1812
|
for (let n = 0; n < g; n++) t.push(F ? String(F[n] ?? "") : je(n));
|
|
@@ -1882,9 +1882,9 @@ function er(t, n, e, r = 1, o = 1, i = 1) {
|
|
|
1882
1882
|
if (c > 2147483647) return B.BuiltIn.Num;
|
|
1883
1883
|
const h = hr(s, r);
|
|
1884
1884
|
if (B.isError(h)) return h;
|
|
1885
|
-
const { alpha: m, beta: N, gamma: g, period: p, b0: d } = h, { L: y, T: M, S:
|
|
1885
|
+
const { alpha: m, beta: N, gamma: g, period: p, b0: d } = h, { L: y, T: M, S: I, finalIndex: w } = cr(s, m, N, g, p, d).finalState;
|
|
1886
1886
|
let b = y + c * M;
|
|
1887
|
-
return p > 1 && (b +=
|
|
1887
|
+
return p > 1 && (b += I[((w + Math.round(c)) % p + p) % p]), b;
|
|
1888
1888
|
}
|
|
1889
1889
|
function rr(t, n, e, r = .95, o = 1, i = 1, u = 1) {
|
|
1890
1890
|
if (r < 0 || r >= 1) return B.BuiltIn.Num;
|
|
@@ -2168,7 +2168,7 @@ function Nr(t, n, e) {
|
|
|
2168
2168
|
for (let n = 0; n < t.length; n++) N[m][n] = t[n];
|
|
2169
2169
|
N[m].fx = t.fx;
|
|
2170
2170
|
}
|
|
2171
|
-
const p = (t, n) => t.fx - n.fx, d = n.slice(), y = n.slice(), M = n.slice(),
|
|
2171
|
+
const p = (t, n) => t.fx - n.fx, d = n.slice(), y = n.slice(), M = n.slice(), I = n.slice();
|
|
2172
2172
|
for (let n = 0; n < r; ++n) {
|
|
2173
2173
|
if (N.sort(p), e.history) {
|
|
2174
2174
|
const t = N.map((t) => {
|
|
@@ -2190,7 +2190,7 @@ function Nr(t, n, e) {
|
|
|
2190
2190
|
d[t] /= m;
|
|
2191
2191
|
}
|
|
2192
2192
|
const n = N[m];
|
|
2193
|
-
if (mr(y, 1 + a, d, -a, n), y.fx = t(y), y.fx < N[0].fx) mr(
|
|
2193
|
+
if (mr(y, 1 + a, d, -a, n), y.fx = t(y), y.fx < N[0].fx) mr(I, 1 + l, d, -l, n), I.fx = t(I), g(I.fx < y.fx ? I : y);
|
|
2194
2194
|
else if (y.fx >= N[m - 1].fx) {
|
|
2195
2195
|
let e = !1;
|
|
2196
2196
|
if (y.fx > n.fx ? (mr(M, 1 + f, d, -f, n), M.fx = t(M), M.fx < n.fx ? g(M) : e = !0) : (mr(M, 1 - f * a, d, f * a, n), M.fx = t(M), M.fx < y.fx ? g(M) : e = !0), e) {
|
|
@@ -2205,7 +2205,7 @@ function Nr(t, n, e) {
|
|
|
2205
2205
|
};
|
|
2206
2206
|
}
|
|
2207
2207
|
var gr = Object.freeze({ includeEmpty: !0 }), pr = (Object.freeze({ axis: x.Axis.Column }), Object.freeze({ axis: x.Axis.Row }), Object.freeze({
|
|
2208
|
-
type:
|
|
2208
|
+
type: C.Number,
|
|
2209
2209
|
axis: x.Axis.Row
|
|
2210
2210
|
})), dr = (t, n, e = !1) => {
|
|
2211
2211
|
const r = t.getRowCount(), o = t.getColumnCount(), i = r * o;
|
|
@@ -2275,7 +2275,7 @@ var gr = Object.freeze({ includeEmpty: !0 }), pr = (Object.freeze({ axis: x.Axis
|
|
|
2275
2275
|
throw B.BuiltIn.Value;
|
|
2276
2276
|
}
|
|
2277
2277
|
throw B.BuiltIn.Value;
|
|
2278
|
-
},
|
|
2278
|
+
}, Ir = (t, n, e) => {
|
|
2279
2279
|
let r, o, i;
|
|
2280
2280
|
if (n && n.size > 0) {
|
|
2281
2281
|
const e = ((t, n) => {
|
|
@@ -2308,7 +2308,7 @@ var gr = Object.freeze({ includeEmpty: !0 }), pr = (Object.freeze({ axis: x.Axis
|
|
|
2308
2308
|
u[t] = n;
|
|
2309
2309
|
}
|
|
2310
2310
|
return u;
|
|
2311
|
-
},
|
|
2311
|
+
}, wr = (t, n, e) => {
|
|
2312
2312
|
const r = t.length, o = n.length > 0 ? n[0].length : 0, i = [], u = [];
|
|
2313
2313
|
e && (i.push(new Array(r).fill(1)), u.push(o));
|
|
2314
2314
|
for (let t = o - 1; t >= 0; t--) {
|
|
@@ -2318,20 +2318,20 @@ var gr = Object.freeze({ includeEmpty: !0 }), pr = (Object.freeze({ axis: x.Axis
|
|
|
2318
2318
|
}
|
|
2319
2319
|
const s = [], a = [], l = [];
|
|
2320
2320
|
for (let t = 0; t < i.length; t++) {
|
|
2321
|
-
const n = i[t].slice(), e = Math.sqrt(
|
|
2321
|
+
const n = i[t].slice(), e = Math.sqrt(Cr(n, n)), o = new Array(a.length).fill(0);
|
|
2322
2322
|
for (let t = 0; t < 2; t++) for (let t = 0; t < a.length; t++) {
|
|
2323
|
-
const e =
|
|
2323
|
+
const e = Cr(a[t], n);
|
|
2324
2324
|
for (let o = 0; o < r; o++) n[o] -= e * a[t][o];
|
|
2325
2325
|
o[t] += e;
|
|
2326
2326
|
}
|
|
2327
|
-
const u = Math.sqrt(
|
|
2327
|
+
const u = Math.sqrt(Cr(n, n));
|
|
2328
2328
|
if (!(u <= 1e-10 * (e || 1))) {
|
|
2329
2329
|
for (let t = 0; t < r; t++) n[t] /= u;
|
|
2330
2330
|
o.push(u), a.push(n), l.push(o), s.push(t);
|
|
2331
2331
|
}
|
|
2332
2332
|
}
|
|
2333
2333
|
const f = s.length, c = new Array(f);
|
|
2334
|
-
for (let n = 0; n < f; n++) c[n] =
|
|
2334
|
+
for (let n = 0; n < f; n++) c[n] = Cr(a[n], t);
|
|
2335
2335
|
const h = new Array(f).fill(0);
|
|
2336
2336
|
for (let t = f - 1; t >= 0; t--) {
|
|
2337
2337
|
let n = c[t];
|
|
@@ -2373,16 +2373,16 @@ var gr = Object.freeze({ includeEmpty: !0 }), pr = (Object.freeze({ axis: x.Axis
|
|
|
2373
2373
|
for (let e = 0; e < r; e++) y += (t[e] - n) * (t[e] - n);
|
|
2374
2374
|
} else for (let n = 0; n < r; n++) y += t[n] * t[n];
|
|
2375
2375
|
e && 0 === y && (d = 0);
|
|
2376
|
-
const M = y - d,
|
|
2376
|
+
const M = y - d, I = e ? f - 1 : f, w = r - I - (e ? 1 : 0), b = w > 0 ? d / w : 0, B = w > 0 ? Math.sqrt(b) : 0, x = new Array(o + 1).fill(0);
|
|
2377
2377
|
for (let t = 0; t <= o; t++) x[t] = B * Math.sqrt(Math.max(g[t], 0));
|
|
2378
2378
|
return {
|
|
2379
2379
|
coefficients: N,
|
|
2380
2380
|
standardErrors: x,
|
|
2381
|
-
kEffective:
|
|
2382
|
-
df:
|
|
2381
|
+
kEffective: I,
|
|
2382
|
+
df: w,
|
|
2383
2383
|
sey: B,
|
|
2384
2384
|
r2: 0 === y ? 1 : M / y,
|
|
2385
|
-
f:
|
|
2385
|
+
f: w > 0 && I > 0 && 0 !== b ? M / I / b : null,
|
|
2386
2386
|
ssReg: M,
|
|
2387
2387
|
ssResid: d,
|
|
2388
2388
|
predict: p
|
|
@@ -2418,11 +2418,11 @@ var gr = Object.freeze({ includeEmpty: !0 }), pr = (Object.freeze({ axis: x.Axis
|
|
|
2418
2418
|
i[t] = u;
|
|
2419
2419
|
}
|
|
2420
2420
|
return i;
|
|
2421
|
-
},
|
|
2421
|
+
}, Cr = (t, n) => {
|
|
2422
2422
|
let e = 0;
|
|
2423
2423
|
for (let r = 0; r < t.length; r++) e += t[r] * n[r];
|
|
2424
2424
|
return e;
|
|
2425
|
-
},
|
|
2425
|
+
}, Rr = A({
|
|
2426
2426
|
GROWTH: () => Fr,
|
|
2427
2427
|
LINEST: () => Ar,
|
|
2428
2428
|
LOGEST: () => vr,
|
|
@@ -2434,7 +2434,7 @@ function Ar(t, n, e, r) {
|
|
|
2434
2434
|
Er();
|
|
2435
2435
|
const o = dr(t, n);
|
|
2436
2436
|
return yr(e, !0, (t) => {
|
|
2437
|
-
const n =
|
|
2437
|
+
const n = wr(o.ys, o.xs, t);
|
|
2438
2438
|
return yr(r, !1, (e) => e ? br(n, n.coefficients, t) : [n.coefficients.slice()]);
|
|
2439
2439
|
});
|
|
2440
2440
|
}
|
|
@@ -2442,7 +2442,7 @@ function vr(t, n, e, r) {
|
|
|
2442
2442
|
Er();
|
|
2443
2443
|
const o = dr(t, n, !0);
|
|
2444
2444
|
return yr(e, !0, (t) => {
|
|
2445
|
-
const n =
|
|
2445
|
+
const n = wr(o.ys, o.xs, t), e = Sr(n);
|
|
2446
2446
|
return yr(r, !1, (r) => r ? br(n, e, t) : [e]);
|
|
2447
2447
|
});
|
|
2448
2448
|
}
|
|
@@ -2450,16 +2450,16 @@ function Dr(t, n, e, r) {
|
|
|
2450
2450
|
Er();
|
|
2451
2451
|
const o = dr(t, n);
|
|
2452
2452
|
return yr(r, !0, (t) => {
|
|
2453
|
-
const n =
|
|
2454
|
-
return
|
|
2453
|
+
const n = wr(o.ys, o.xs, t);
|
|
2454
|
+
return Ir(o, e, n.predict);
|
|
2455
2455
|
});
|
|
2456
2456
|
}
|
|
2457
2457
|
function Fr(t, n, e, r) {
|
|
2458
2458
|
Er();
|
|
2459
2459
|
const o = dr(t, n, !0);
|
|
2460
2460
|
return yr(r, !0, (t) => {
|
|
2461
|
-
const n =
|
|
2462
|
-
return
|
|
2461
|
+
const n = wr(o.ys, o.xs, t).coefficients.map(Math.exp), r = o.k;
|
|
2462
|
+
return Ir(o, e, (t) => {
|
|
2463
2463
|
let e = n[r];
|
|
2464
2464
|
for (let o = 0; o < r; o++) e *= n[r - 1 - o] ** t[o];
|
|
2465
2465
|
return Number.isFinite(e) ? e : B.BuiltIn.Num;
|
|
@@ -2470,14 +2470,17 @@ var Sr = (t) => t.coefficients.map((t) => {
|
|
|
2470
2470
|
const n = Math.exp(t);
|
|
2471
2471
|
return Number.isFinite(n) ? n : B.BuiltIn.Num;
|
|
2472
2472
|
}), Vr = A({
|
|
2473
|
-
TTEST: () =>
|
|
2474
|
-
T_TEST: () =>
|
|
2475
|
-
})
|
|
2476
|
-
|
|
2477
|
-
return
|
|
2478
|
-
}
|
|
2473
|
+
TTEST: () => Pr,
|
|
2474
|
+
T_TEST: () => Or
|
|
2475
|
+
}), Tr = (t) => {
|
|
2476
|
+
const n = t.getCode();
|
|
2477
|
+
return n === B.Code.Null || n === B.Code.GettingData ? B.BuiltIn.Num : t;
|
|
2478
|
+
};
|
|
2479
2479
|
function Pr(t, n, e, r) {
|
|
2480
|
-
|
|
2480
|
+
return Or(t, n, e, r);
|
|
2481
|
+
}
|
|
2482
|
+
function Or(t, n, e, r) {
|
|
2483
|
+
if (e = Math.floor(e + $r), r = Math.floor(r + $r), 1 !== e && 2 !== e || r < 1 || r > 3) return NaN;
|
|
2481
2484
|
for (const e of [t, n]) if (1 === e.size && e.isIReferenceRange) {
|
|
2482
2485
|
if (e.hasError()) throw e.firstError();
|
|
2483
2486
|
if (e.entries({ includeEmpty: !1 }).next().done) throw B.BuiltIn.Value;
|
|
@@ -2488,14 +2491,14 @@ function Pr(t, n, e, r) {
|
|
|
2488
2491
|
if (e.rows * e.columns !== r.rows * r.columns) throw B.BuiltIn.NA;
|
|
2489
2492
|
const i = [], u = [];
|
|
2490
2493
|
for (const [[e, r]] of t.flatten().alignValues([n.flatten()])) {
|
|
2491
|
-
if (B.isError(e)) throw e;
|
|
2492
|
-
if (B.isError(r)) throw r;
|
|
2494
|
+
if (B.isError(e)) throw Tr(e);
|
|
2495
|
+
if (B.isError(r)) throw Tr(r);
|
|
2493
2496
|
"number" == typeof e && "number" == typeof r && (i.push(e), u.push(r));
|
|
2494
2497
|
}
|
|
2495
2498
|
if (i.length < 2) throw B.BuiltIn.Div0;
|
|
2496
2499
|
o = function(t, n) {
|
|
2497
2500
|
const e = t.length;
|
|
2498
|
-
if (!Number.isFinite(
|
|
2501
|
+
if (!Number.isFinite(qr(t)) || !Number.isFinite(qr(n))) return { error: B.BuiltIn.Num };
|
|
2499
2502
|
let r = 0;
|
|
2500
2503
|
for (let o = 0; o < e; o++) r += t[o] - n[o];
|
|
2501
2504
|
const o = r / e;
|
|
@@ -2510,8 +2513,8 @@ function Pr(t, n, e, r) {
|
|
|
2510
2513
|
};
|
|
2511
2514
|
}(i, u);
|
|
2512
2515
|
} else {
|
|
2513
|
-
if (t.hasError()) throw t.firstError();
|
|
2514
|
-
if (n.hasError()) throw n.firstError();
|
|
2516
|
+
if (t.hasError()) throw Tr(t.firstError());
|
|
2517
|
+
if (n.hasError()) throw Tr(n.firstError());
|
|
2515
2518
|
const e = t.getValuesFlat(pr), i = n.getValuesFlat(pr);
|
|
2516
2519
|
if (e.length < 2 || i.length < 2) throw B.BuiltIn.Div0;
|
|
2517
2520
|
o = 2 === r ? function(t, n) {
|
|
@@ -2547,14 +2550,14 @@ function Pr(t, n, e, r) {
|
|
|
2547
2550
|
const e = .5 * function(t, n, e) {
|
|
2548
2551
|
if (e <= 0) return 0;
|
|
2549
2552
|
if (e >= 1) return 1;
|
|
2550
|
-
const r =
|
|
2551
|
-
return e < (t + 1) / (t + n + 2) ? o *
|
|
2553
|
+
const r = Lr(t) + Lr(n) - Lr(t + n), o = Math.exp(Math.log(e) * t + Math.log(1 - e) * n - r);
|
|
2554
|
+
return e < (t + 1) / (t + n + 2) ? o * kr(t, n, e) / t : 1 - o * kr(n, t, 1 - e) / n;
|
|
2552
2555
|
}(n / 2, .5, n / (n + t * t));
|
|
2553
2556
|
return t >= 0 ? 1 - e : e;
|
|
2554
2557
|
}(-o.x, o.df) * e;
|
|
2555
2558
|
}
|
|
2556
|
-
var
|
|
2557
|
-
function
|
|
2559
|
+
var $r = 2 ** -22;
|
|
2560
|
+
function kr(t, n, e) {
|
|
2558
2561
|
const r = 1e-30, o = t + n, i = t + 1, u = t - 1;
|
|
2559
2562
|
let s = 1, a = 1 - o * e / i;
|
|
2560
2563
|
Math.abs(a) < r && (a = r), a = 1 / a;
|
|
@@ -2568,7 +2571,7 @@ function $r(t, n, e) {
|
|
|
2568
2571
|
}
|
|
2569
2572
|
return l;
|
|
2570
2573
|
}
|
|
2571
|
-
function
|
|
2574
|
+
function Lr(t) {
|
|
2572
2575
|
const n = [
|
|
2573
2576
|
.9999999999998099,
|
|
2574
2577
|
676.5203681218851,
|
|
@@ -2580,19 +2583,19 @@ function kr(t) {
|
|
|
2580
2583
|
9984369578019572e-21,
|
|
2581
2584
|
1.5056327351493116e-7
|
|
2582
2585
|
];
|
|
2583
|
-
if (t < .5) return Math.log(Math.PI / Math.sin(Math.PI * t)) -
|
|
2586
|
+
if (t < .5) return Math.log(Math.PI / Math.sin(Math.PI * t)) - Lr(1 - t);
|
|
2584
2587
|
t--;
|
|
2585
2588
|
let e = n[0];
|
|
2586
2589
|
for (let r = 1; r < 9; r++) e += n[r] / (t + r);
|
|
2587
2590
|
const r = t + 7.5;
|
|
2588
2591
|
return .5 * Math.log(2 * Math.PI) + (t + .5) * Math.log(r) - r + Math.log(e);
|
|
2589
2592
|
}
|
|
2590
|
-
function
|
|
2593
|
+
function qr(t) {
|
|
2591
2594
|
let n = 0;
|
|
2592
2595
|
for (const e of t) n += e * e;
|
|
2593
2596
|
return n;
|
|
2594
2597
|
}
|
|
2595
|
-
var
|
|
2598
|
+
var _r = "\\p{L}\\p{N}_", jr = {
|
|
2596
2599
|
alpha: "\\p{L}",
|
|
2597
2600
|
digit: "\\p{Nd}",
|
|
2598
2601
|
alnum: "\\p{L}\\p{N}",
|
|
@@ -2601,13 +2604,13 @@ var qr = "\\p{L}\\p{N}_", _r = {
|
|
|
2601
2604
|
space: "\\s",
|
|
2602
2605
|
blank: "\\t\\p{Zs}",
|
|
2603
2606
|
punct: "\\p{P}\\p{S}",
|
|
2604
|
-
word:
|
|
2607
|
+
word: _r,
|
|
2605
2608
|
cntrl: "\\p{Cc}",
|
|
2606
2609
|
xdigit: "0-9A-Fa-f",
|
|
2607
2610
|
ascii: "\\x00-\\x7F",
|
|
2608
2611
|
print: "\\P{C}",
|
|
2609
2612
|
graph: "\\P{C}"
|
|
2610
|
-
},
|
|
2613
|
+
}, Ur = {
|
|
2611
2614
|
alpha: "\\P{L}",
|
|
2612
2615
|
digit: "\\P{Nd}",
|
|
2613
2616
|
upper: "\\P{Lu}",
|
|
@@ -2616,19 +2619,19 @@ var qr = "\\p{L}\\p{N}_", _r = {
|
|
|
2616
2619
|
cntrl: "\\P{Cc}",
|
|
2617
2620
|
print: "\\p{C}",
|
|
2618
2621
|
graph: "\\p{C}"
|
|
2619
|
-
},
|
|
2622
|
+
}, Yr = `(?:(?<=[${_r}])(?![${_r}])|(?<![${_r}])(?=[${_r}]))`, zr = `(?:(?<=[${_r}])(?=[${_r}])|(?<![${_r}])(?![${_r}]))`, Gr = (t, n) => {
|
|
2620
2623
|
if (!t.startsWith("[:", n)) return null;
|
|
2621
2624
|
const e = t.indexOf(":]", n + 2);
|
|
2622
2625
|
if (-1 === e) return null;
|
|
2623
2626
|
let r = t.slice(n + 2, e);
|
|
2624
2627
|
const o = r.startsWith("^");
|
|
2625
2628
|
o && (r = r.slice(1));
|
|
2626
|
-
const i = o ?
|
|
2629
|
+
const i = o ? Ur[r] : jr[r];
|
|
2627
2630
|
return void 0 === i ? null : {
|
|
2628
2631
|
emit: i,
|
|
2629
2632
|
next: e + 2
|
|
2630
2633
|
};
|
|
2631
|
-
},
|
|
2634
|
+
}, Xr = (t, n) => {
|
|
2632
2635
|
if (!t.startsWith("(?", n)) return null;
|
|
2633
2636
|
let e = n + 2, r = "", o = "", i = !1;
|
|
2634
2637
|
for (; e < t.length;) {
|
|
@@ -2649,13 +2652,13 @@ var qr = "\\p{L}\\p{N}_", _r = {
|
|
|
2649
2652
|
group: !0,
|
|
2650
2653
|
next: e + 1
|
|
2651
2654
|
} : null;
|
|
2652
|
-
},
|
|
2655
|
+
}, Hr = (t) => t.replace(/[^ims]/g, ""), Wr = (t) => (new RegExp(`${t.source}|`, t.flags.replace("g", "")).exec("")?.length ?? 1) - 1, Kr = (t, n, e = "") => {
|
|
2653
2656
|
const r = (n ? "i" : "") + e, o = (t, n) => {
|
|
2654
2657
|
try {
|
|
2655
2658
|
const e = new RegExp(t, n ? `${r}u` : r);
|
|
2656
2659
|
return {
|
|
2657
2660
|
regex: e,
|
|
2658
|
-
groups:
|
|
2661
|
+
groups: Wr(e)
|
|
2659
2662
|
};
|
|
2660
2663
|
} catch {
|
|
2661
2664
|
return null;
|
|
@@ -2681,7 +2684,7 @@ var qr = "\\p{L}\\p{N}_", _r = {
|
|
|
2681
2684
|
if ("C" === o) throw new SyntaxError("the any-byte escape is not supported");
|
|
2682
2685
|
if (r) {
|
|
2683
2686
|
if ("w" === o) {
|
|
2684
|
-
n +=
|
|
2687
|
+
n += _r, e += 2;
|
|
2685
2688
|
continue;
|
|
2686
2689
|
}
|
|
2687
2690
|
if ("d" === o) {
|
|
@@ -2698,19 +2701,19 @@ var qr = "\\p{L}\\p{N}_", _r = {
|
|
|
2698
2701
|
continue;
|
|
2699
2702
|
}
|
|
2700
2703
|
if ("b" === o) {
|
|
2701
|
-
n +=
|
|
2704
|
+
n += Yr, e += 2;
|
|
2702
2705
|
continue;
|
|
2703
2706
|
}
|
|
2704
2707
|
if ("B" === o) {
|
|
2705
|
-
n +=
|
|
2708
|
+
n += zr, e += 2;
|
|
2706
2709
|
continue;
|
|
2707
2710
|
}
|
|
2708
2711
|
if ("w" === o) {
|
|
2709
|
-
n += `[${
|
|
2712
|
+
n += `[${_r}]`, e += 2;
|
|
2710
2713
|
continue;
|
|
2711
2714
|
}
|
|
2712
2715
|
if ("W" === o) {
|
|
2713
|
-
n += `[^${
|
|
2716
|
+
n += `[^${_r}]`, e += 2;
|
|
2714
2717
|
continue;
|
|
2715
2718
|
}
|
|
2716
2719
|
if ("d" === o) {
|
|
@@ -2726,7 +2729,7 @@ var qr = "\\p{L}\\p{N}_", _r = {
|
|
|
2726
2729
|
continue;
|
|
2727
2730
|
}
|
|
2728
2731
|
if (r) {
|
|
2729
|
-
const o =
|
|
2732
|
+
const o = Gr(t, e);
|
|
2730
2733
|
if (o) {
|
|
2731
2734
|
n += o.emit, e = o.next;
|
|
2732
2735
|
continue;
|
|
@@ -2742,10 +2745,10 @@ var qr = "\\p{L}\\p{N}_", _r = {
|
|
|
2742
2745
|
r = !0, n += u, e += 1, "^" === t[e] && (n += "^", e += 1), "]" === t[e] && (n += "\\]", e += 1);
|
|
2743
2746
|
continue;
|
|
2744
2747
|
}
|
|
2745
|
-
const s =
|
|
2748
|
+
const s = Xr(t, e);
|
|
2746
2749
|
if (s) {
|
|
2747
2750
|
s.on.includes("U") && (o = !0), s.off.includes("U") && (o = !1);
|
|
2748
|
-
const t =
|
|
2751
|
+
const t = Hr(s.on), r = Hr(s.off);
|
|
2749
2752
|
s.group ? n += t || r ? `(?${t}${r ? `-${r}` : ""}:` : "(?:" : (t || r) && (n += `(?${t}${r ? `-${r}` : ""}:`, i.push(")")), e = s.next;
|
|
2750
2753
|
continue;
|
|
2751
2754
|
}
|
|
@@ -2768,21 +2771,21 @@ var qr = "\\p{L}\\p{N}_", _r = {
|
|
|
2768
2771
|
}
|
|
2769
2772
|
const u = i.replace(/\\([pP])\{([A-Za-z_]+)\}/g, "\\$1{Script=$2}");
|
|
2770
2773
|
return o(i, !0) ?? (u === i ? null : o(u, !0)) ?? o(t, !1) ?? B.BuiltIn.Value;
|
|
2771
|
-
},
|
|
2774
|
+
}, Zr = (t, n) => {
|
|
2772
2775
|
const e = Math.trunc(t);
|
|
2773
2776
|
return e >= 0 && e <= n ? e : B.BuiltIn.Value;
|
|
2774
|
-
},
|
|
2775
|
-
REGEXEXTRACT: () =>
|
|
2776
|
-
REGEXMATCH: () =>
|
|
2777
|
-
REGEXREPLACE: () =>
|
|
2778
|
-
REGEXTEST: () =>
|
|
2777
|
+
}, Qr = A({
|
|
2778
|
+
REGEXEXTRACT: () => Jr,
|
|
2779
|
+
REGEXMATCH: () => to,
|
|
2780
|
+
REGEXREPLACE: () => no,
|
|
2781
|
+
REGEXTEST: () => eo
|
|
2779
2782
|
});
|
|
2780
|
-
function
|
|
2781
|
-
const o =
|
|
2783
|
+
function Jr(t, n, e = 0, r = 0) {
|
|
2784
|
+
const o = Zr(e, 2);
|
|
2782
2785
|
if (B.isError(o)) return o;
|
|
2783
|
-
const i =
|
|
2786
|
+
const i = Zr(r, 1);
|
|
2784
2787
|
if (B.isError(i)) return i;
|
|
2785
|
-
const u =
|
|
2788
|
+
const u = Kr(n, 1 === i);
|
|
2786
2789
|
if (B.isError(u)) return u;
|
|
2787
2790
|
const { regex: s } = u;
|
|
2788
2791
|
if (0 === o) {
|
|
@@ -2797,14 +2800,14 @@ function Qr(t, n, e = 0, r = 0) {
|
|
|
2797
2800
|
const a = t.match(s);
|
|
2798
2801
|
return a ? b.createRange().replace([a.slice(1).map((t) => t ?? B.BuiltIn.NA)]) : B.BuiltIn.NA;
|
|
2799
2802
|
}
|
|
2800
|
-
function
|
|
2801
|
-
const r =
|
|
2803
|
+
function to(t, n, e = !1) {
|
|
2804
|
+
const r = Kr(n, e);
|
|
2802
2805
|
return B.isError(r) ? r : r.regex.test(t);
|
|
2803
2806
|
}
|
|
2804
|
-
function
|
|
2805
|
-
const i =
|
|
2807
|
+
function no(t, n, e, r = 0, o = 0) {
|
|
2808
|
+
const i = Zr(o, 1);
|
|
2806
2809
|
if (B.isError(i)) return i;
|
|
2807
|
-
const u =
|
|
2810
|
+
const u = Kr(n, 1 === i);
|
|
2808
2811
|
if (B.isError(u)) return u;
|
|
2809
2812
|
const { regex: s, groups: a } = u, l = ((t, n) => {
|
|
2810
2813
|
let e = "", r = 0;
|
|
@@ -2876,11 +2879,11 @@ function to(t, n, e, r = 0, o = 0) {
|
|
|
2876
2879
|
const N = h[m], g = N.index;
|
|
2877
2880
|
return t.slice(0, g) + N[0].replace(s, l) + t.slice(g + N[0].length);
|
|
2878
2881
|
}
|
|
2879
|
-
function
|
|
2880
|
-
const r =
|
|
2882
|
+
function eo(t, n, e = 0) {
|
|
2883
|
+
const r = Zr(e, 1);
|
|
2881
2884
|
if (B.isError(r)) return r;
|
|
2882
|
-
const o =
|
|
2885
|
+
const o = Kr(n, 1 === r);
|
|
2883
2886
|
return B.isError(o) ? o : o.regex.test(t);
|
|
2884
2887
|
}
|
|
2885
|
-
var
|
|
2886
|
-
export {
|
|
2888
|
+
var ro = () => import("./CayxCfr6Req5OBnt.mjs"), oo = () => import("./B8SoM9jQdDXwtgKl.mjs"), io = () => import("./BymHQ6d0GuLbbJvM.mjs"), uo = () => import("./BnqqSrfJVCEx19PQ.mjs"), so = () => import("./C0LxMpWsn2I0bY9l.mjs"), ao = () => import("./Bg9SWNEspWJ7vEAh.mjs"), lo = () => import("./DnC76PQFsjGNd0ED.mjs"), fo = () => import("./CQpm3BBIhHls0ymg.mjs"), co = () => import("./XHM3EQlFTOHq3jQP.mjs"), ho = () => import("./La5T3OKHn32uWF7E.mjs"), mo = () => import("./BtNcXw7rVlHo7gOf.mjs"), No = () => import("./BKOSUaPOspNA3UiR.mjs"), go = () => import("./lPwbrKEbLIYzRLFP.mjs"), po = () => import("./DDAPeOZHl2lPDy8F.mjs"), yo = () => import("./CA-J-CuKvqHcKua5.mjs"), Mo = () => import("./DGL-3YiIvZL1aezr.mjs"), Io = () => import("./BYB98ngJrP8aUEUh.mjs"), wo = () => import("./BBakdOGC1cqfF6Iu.mjs"), bo = () => import("./shH8FSZ-wXbrxVx7.mjs"), Bo = () => import("./CiAc0OZCRv1uRsiF.mjs"), xo = () => import("./CwLe_zJj5hXFWIYA.mjs"), Co = (b, B, x) => (x || (x = /* @__PURE__ */ new Map()), B(x, b, v, t, ro, "Cube"), B(x, b, ht, I, oo, "Financial"), B(x, b, Et, r, io, "Financial"), B(x, b, Dt, M, uo, "Financial", w), B(x, b, Xt, n, so, "Financial"), B(x, b, Jt, s, ao, "Financial"), B(x, b, xn, a, lo, "Financial"), B(x, b, Fn, c, fo, "Financial"), B(x, b, Pn, N, co, "Financial"), B(x, b, _n, u, ho, "Financial"), B(x, b, ne, i, mo, "Financial"), B(x, b, se, y, No, "Financial"), B(x, b, he, f, go, "Financial"), B(x, b, Ie, o, po, "Financial"), B(x, b, xe, p, yo, "Financial"), B(x, b, Ge, m, Mo, "Lookup & Reference"), B(x, b, Ze, e, Io, "Lookup & Reference"), B(x, b, nr, l, wo, "Statistical"), B(x, b, Rr, g, bo, "Statistical"), B(x, b, Vr, h, Bo, "Statistical"), B(x, b, Qr, d, xo, "Text"), x);
|
|
2889
|
+
export { Co as default };
|