appwrite-cli 13.3.2 → 13.4.0
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/CHANGELOG.md +8 -0
- package/README.md +2 -2
- package/dist/bundle-win-arm64.mjs +750 -1987
- package/dist/cli.cjs +750 -1987
- package/dist/index.js +672 -1941
- package/dist/lib/commands/push.d.ts.map +1 -1
- package/dist/lib/constants.d.ts +1 -1
- package/dist/lib/json.d.ts.map +1 -1
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/commands/push.ts +24 -2
- package/lib/commands/services/databases.ts +32 -8
- package/lib/commands/services/projects.ts +6 -4
- package/lib/commands/services/tables-db.ts +32 -8
- package/lib/constants.ts +1 -1
- package/lib/json.ts +10 -2
- package/package.json +2 -3
- package/scoop/appwrite.config.json +3 -3
package/dist/index.js
CHANGED
|
@@ -3536,11 +3536,11 @@ var require_assignValue = __commonJS({
|
|
|
3536
3536
|
// node_modules/lodash/_isIndex.js
|
|
3537
3537
|
var require_isIndex = __commonJS({
|
|
3538
3538
|
"node_modules/lodash/_isIndex.js"(exports, module) {
|
|
3539
|
-
var
|
|
3539
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
3540
3540
|
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
3541
3541
|
function isIndex(value, length) {
|
|
3542
3542
|
var type = typeof value;
|
|
3543
|
-
length = length == null ?
|
|
3543
|
+
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
3544
3544
|
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
3545
3545
|
}
|
|
3546
3546
|
module.exports = isIndex;
|
|
@@ -9780,9 +9780,9 @@ var require_distinctUntilKeyChanged = __commonJS({
|
|
|
9780
9780
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9781
9781
|
exports.distinctUntilKeyChanged = void 0;
|
|
9782
9782
|
var distinctUntilChanged_1 = require_distinctUntilChanged();
|
|
9783
|
-
function distinctUntilKeyChanged(key,
|
|
9783
|
+
function distinctUntilKeyChanged(key, compare) {
|
|
9784
9784
|
return distinctUntilChanged_1.distinctUntilChanged(function(x, y) {
|
|
9785
|
-
return
|
|
9785
|
+
return compare ? compare(x[key], y[key]) : x[key] === y[key];
|
|
9786
9786
|
});
|
|
9787
9787
|
}
|
|
9788
9788
|
exports.distinctUntilKeyChanged = distinctUntilKeyChanged;
|
|
@@ -14160,9 +14160,9 @@ var require_baseRest = __commonJS({
|
|
|
14160
14160
|
// node_modules/lodash/isLength.js
|
|
14161
14161
|
var require_isLength = __commonJS({
|
|
14162
14162
|
"node_modules/lodash/isLength.js"(exports, module) {
|
|
14163
|
-
var
|
|
14163
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
14164
14164
|
function isLength(value) {
|
|
14165
|
-
return typeof value == "number" && value > -1 && value % 1 == 0 && value <=
|
|
14165
|
+
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
14166
14166
|
}
|
|
14167
14167
|
module.exports = isLength;
|
|
14168
14168
|
}
|
|
@@ -15323,10 +15323,10 @@ var require_clone = __commonJS({
|
|
|
15323
15323
|
"node_modules/lodash/clone.js"(exports, module) {
|
|
15324
15324
|
var baseClone = require_baseClone();
|
|
15325
15325
|
var CLONE_SYMBOLS_FLAG = 4;
|
|
15326
|
-
function
|
|
15326
|
+
function clone2(value) {
|
|
15327
15327
|
return baseClone(value, CLONE_SYMBOLS_FLAG);
|
|
15328
15328
|
}
|
|
15329
|
-
module.exports =
|
|
15329
|
+
module.exports = clone2;
|
|
15330
15330
|
}
|
|
15331
15331
|
});
|
|
15332
15332
|
|
|
@@ -18152,9 +18152,9 @@ var require_log_symbols = __commonJS({
|
|
|
18152
18152
|
// node_modules/clone/clone.js
|
|
18153
18153
|
var require_clone2 = __commonJS({
|
|
18154
18154
|
"node_modules/clone/clone.js"(exports, module) {
|
|
18155
|
-
var
|
|
18155
|
+
var clone2 = (function() {
|
|
18156
18156
|
"use strict";
|
|
18157
|
-
function
|
|
18157
|
+
function clone3(parent, circular, depth, prototype) {
|
|
18158
18158
|
var filter;
|
|
18159
18159
|
if (typeof circular === "object") {
|
|
18160
18160
|
depth = circular.depth;
|
|
@@ -18179,12 +18179,12 @@ var require_clone2 = __commonJS({
|
|
|
18179
18179
|
if (typeof parent2 != "object") {
|
|
18180
18180
|
return parent2;
|
|
18181
18181
|
}
|
|
18182
|
-
if (
|
|
18182
|
+
if (clone3.__isArray(parent2)) {
|
|
18183
18183
|
child = [];
|
|
18184
|
-
} else if (
|
|
18184
|
+
} else if (clone3.__isRegExp(parent2)) {
|
|
18185
18185
|
child = new RegExp(parent2.source, __getRegExpFlags(parent2));
|
|
18186
18186
|
if (parent2.lastIndex) child.lastIndex = parent2.lastIndex;
|
|
18187
|
-
} else if (
|
|
18187
|
+
} else if (clone3.__isDate(parent2)) {
|
|
18188
18188
|
child = new Date(parent2.getTime());
|
|
18189
18189
|
} else if (useBuffer && Buffer.isBuffer(parent2)) {
|
|
18190
18190
|
if (Buffer.allocUnsafe) {
|
|
@@ -18225,7 +18225,7 @@ var require_clone2 = __commonJS({
|
|
|
18225
18225
|
}
|
|
18226
18226
|
return _clone(parent, depth);
|
|
18227
18227
|
}
|
|
18228
|
-
|
|
18228
|
+
clone3.clonePrototype = function clonePrototype(parent) {
|
|
18229
18229
|
if (parent === null)
|
|
18230
18230
|
return null;
|
|
18231
18231
|
var c = function() {
|
|
@@ -18237,22 +18237,22 @@ var require_clone2 = __commonJS({
|
|
|
18237
18237
|
return Object.prototype.toString.call(o);
|
|
18238
18238
|
}
|
|
18239
18239
|
;
|
|
18240
|
-
|
|
18240
|
+
clone3.__objToStr = __objToStr;
|
|
18241
18241
|
function __isDate(o) {
|
|
18242
18242
|
return typeof o === "object" && __objToStr(o) === "[object Date]";
|
|
18243
18243
|
}
|
|
18244
18244
|
;
|
|
18245
|
-
|
|
18245
|
+
clone3.__isDate = __isDate;
|
|
18246
18246
|
function __isArray(o) {
|
|
18247
18247
|
return typeof o === "object" && __objToStr(o) === "[object Array]";
|
|
18248
18248
|
}
|
|
18249
18249
|
;
|
|
18250
|
-
|
|
18250
|
+
clone3.__isArray = __isArray;
|
|
18251
18251
|
function __isRegExp(o) {
|
|
18252
18252
|
return typeof o === "object" && __objToStr(o) === "[object RegExp]";
|
|
18253
18253
|
}
|
|
18254
18254
|
;
|
|
18255
|
-
|
|
18255
|
+
clone3.__isRegExp = __isRegExp;
|
|
18256
18256
|
function __getRegExpFlags(re) {
|
|
18257
18257
|
var flags = "";
|
|
18258
18258
|
if (re.global) flags += "g";
|
|
@@ -18261,11 +18261,11 @@ var require_clone2 = __commonJS({
|
|
|
18261
18261
|
return flags;
|
|
18262
18262
|
}
|
|
18263
18263
|
;
|
|
18264
|
-
|
|
18265
|
-
return
|
|
18264
|
+
clone3.__getRegExpFlags = __getRegExpFlags;
|
|
18265
|
+
return clone3;
|
|
18266
18266
|
})();
|
|
18267
18267
|
if (typeof module === "object" && module.exports) {
|
|
18268
|
-
module.exports =
|
|
18268
|
+
module.exports = clone2;
|
|
18269
18269
|
}
|
|
18270
18270
|
}
|
|
18271
18271
|
});
|
|
@@ -18273,12 +18273,12 @@ var require_clone2 = __commonJS({
|
|
|
18273
18273
|
// node_modules/defaults/index.js
|
|
18274
18274
|
var require_defaults2 = __commonJS({
|
|
18275
18275
|
"node_modules/defaults/index.js"(exports, module) {
|
|
18276
|
-
var
|
|
18276
|
+
var clone2 = require_clone2();
|
|
18277
18277
|
module.exports = function(options, defaults) {
|
|
18278
18278
|
options = options || {};
|
|
18279
18279
|
Object.keys(defaults).forEach(function(key) {
|
|
18280
18280
|
if (typeof options[key] === "undefined") {
|
|
18281
|
-
options[key] =
|
|
18281
|
+
options[key] = clone2(defaults[key]);
|
|
18282
18282
|
}
|
|
18283
18283
|
});
|
|
18284
18284
|
return options;
|
|
@@ -19586,9 +19586,9 @@ var require_stream_duplex = __commonJS({
|
|
|
19586
19586
|
}
|
|
19587
19587
|
});
|
|
19588
19588
|
|
|
19589
|
-
// node_modules/
|
|
19589
|
+
// node_modules/safe-buffer/index.js
|
|
19590
19590
|
var require_safe_buffer = __commonJS({
|
|
19591
|
-
"node_modules/
|
|
19591
|
+
"node_modules/safe-buffer/index.js"(exports, module) {
|
|
19592
19592
|
var buffer = __require("buffer");
|
|
19593
19593
|
var Buffer2 = buffer.Buffer;
|
|
19594
19594
|
function copyProps(src, dst) {
|
|
@@ -19605,6 +19605,7 @@ var require_safe_buffer = __commonJS({
|
|
|
19605
19605
|
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
19606
19606
|
return Buffer2(arg, encodingOrOffset, length);
|
|
19607
19607
|
}
|
|
19608
|
+
SafeBuffer.prototype = Object.create(Buffer2.prototype);
|
|
19608
19609
|
copyProps(Buffer2, SafeBuffer);
|
|
19609
19610
|
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
19610
19611
|
if (typeof arg === "number") {
|
|
@@ -45677,10 +45678,10 @@ var require_mock_utils = __commonJS({
|
|
|
45677
45678
|
}
|
|
45678
45679
|
}
|
|
45679
45680
|
function buildHeadersFromArray(headers) {
|
|
45680
|
-
const
|
|
45681
|
+
const clone2 = headers.slice();
|
|
45681
45682
|
const entries = [];
|
|
45682
|
-
for (let index = 0; index <
|
|
45683
|
-
entries.push([
|
|
45683
|
+
for (let index = 0; index < clone2.length; index += 2) {
|
|
45684
|
+
entries.push([clone2[index], clone2[index + 1]]);
|
|
45684
45685
|
}
|
|
45685
45686
|
return Object.fromEntries(entries);
|
|
45686
45687
|
}
|
|
@@ -52607,14 +52608,14 @@ var require_undici = __commonJS({
|
|
|
52607
52608
|
}
|
|
52608
52609
|
});
|
|
52609
52610
|
|
|
52610
|
-
// node_modules/bignumber.js/bignumber.js
|
|
52611
|
+
// node_modules/json-bigint/node_modules/bignumber.js/bignumber.js
|
|
52611
52612
|
var require_bignumber = __commonJS({
|
|
52612
|
-
"node_modules/bignumber.js/bignumber.js"(exports, module) {
|
|
52613
|
+
"node_modules/json-bigint/node_modules/bignumber.js/bignumber.js"(exports, module) {
|
|
52613
52614
|
(function(globalObject) {
|
|
52614
52615
|
"use strict";
|
|
52615
|
-
var
|
|
52616
|
-
function
|
|
52617
|
-
var div, convertBase, parseNumeric, P =
|
|
52616
|
+
var BigNumber2, isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE = 1e14, LOG_BASE = 14, MAX_SAFE_INTEGER = 9007199254740991, POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], SQRT_BASE = 1e7, MAX = 1e9;
|
|
52617
|
+
function clone2(configObject) {
|
|
52618
|
+
var div, convertBase, parseNumeric, P = BigNumber3.prototype = { constructor: BigNumber3, toString: null, valueOf: null }, ONE = new BigNumber3(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP = -1e7, MAX_EXP = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = {
|
|
52618
52619
|
prefix: "",
|
|
52619
52620
|
groupSize: 3,
|
|
52620
52621
|
secondaryGroupSize: 0,
|
|
@@ -52625,9 +52626,9 @@ var require_bignumber = __commonJS({
|
|
|
52625
52626
|
// non-breaking space
|
|
52626
52627
|
suffix: ""
|
|
52627
52628
|
}, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true;
|
|
52628
|
-
function
|
|
52629
|
+
function BigNumber3(v, b) {
|
|
52629
52630
|
var alphabet, c, caseChanged, e, i, isNum, len, str, x = this;
|
|
52630
|
-
if (!(x instanceof
|
|
52631
|
+
if (!(x instanceof BigNumber3)) return new BigNumber3(v, b);
|
|
52631
52632
|
if (b == null) {
|
|
52632
52633
|
if (v && v._isBigNumber === true) {
|
|
52633
52634
|
x.s = v.s;
|
|
@@ -52655,7 +52656,7 @@ var require_bignumber = __commonJS({
|
|
|
52655
52656
|
}
|
|
52656
52657
|
str = String(v);
|
|
52657
52658
|
} else {
|
|
52658
|
-
if (!
|
|
52659
|
+
if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);
|
|
52659
52660
|
x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;
|
|
52660
52661
|
}
|
|
52661
52662
|
if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
|
|
@@ -52667,17 +52668,17 @@ var require_bignumber = __commonJS({
|
|
|
52667
52668
|
e = str.length;
|
|
52668
52669
|
}
|
|
52669
52670
|
} else {
|
|
52670
|
-
|
|
52671
|
+
intCheck(b, 2, ALPHABET.length, "Base");
|
|
52671
52672
|
if (b == 10 && alphabetHasNormalDecimalDigits) {
|
|
52672
|
-
x = new
|
|
52673
|
+
x = new BigNumber3(v);
|
|
52673
52674
|
return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
|
|
52674
52675
|
}
|
|
52675
52676
|
str = String(v);
|
|
52676
52677
|
if (isNum = typeof v == "number") {
|
|
52677
52678
|
if (v * 0 != 0) return parseNumeric(x, str, isNum, b);
|
|
52678
52679
|
x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;
|
|
52679
|
-
if (
|
|
52680
|
-
throw Error(
|
|
52680
|
+
if (BigNumber3.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) {
|
|
52681
|
+
throw Error(tooManyDigits + v);
|
|
52681
52682
|
}
|
|
52682
52683
|
} else {
|
|
52683
52684
|
x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
|
|
@@ -52711,8 +52712,8 @@ var require_bignumber = __commonJS({
|
|
|
52711
52712
|
for (len = str.length; str.charCodeAt(--len) === 48; ) ;
|
|
52712
52713
|
if (str = str.slice(i, ++len)) {
|
|
52713
52714
|
len -= i;
|
|
52714
|
-
if (isNum &&
|
|
52715
|
-
throw Error(
|
|
52715
|
+
if (isNum && BigNumber3.DEBUG && len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {
|
|
52716
|
+
throw Error(tooManyDigits + x.s * v);
|
|
52716
52717
|
}
|
|
52717
52718
|
if ((e = e - i - 1) > MAX_EXP) {
|
|
52718
52719
|
x.c = x.e = null;
|
|
@@ -52721,14 +52722,14 @@ var require_bignumber = __commonJS({
|
|
|
52721
52722
|
} else {
|
|
52722
52723
|
x.e = e;
|
|
52723
52724
|
x.c = [];
|
|
52724
|
-
i = (e + 1) %
|
|
52725
|
-
if (e < 0) i +=
|
|
52725
|
+
i = (e + 1) % LOG_BASE;
|
|
52726
|
+
if (e < 0) i += LOG_BASE;
|
|
52726
52727
|
if (i < len) {
|
|
52727
52728
|
if (i) x.c.push(+str.slice(0, i));
|
|
52728
|
-
for (len -=
|
|
52729
|
-
x.c.push(+str.slice(i, i +=
|
|
52729
|
+
for (len -= LOG_BASE; i < len; ) {
|
|
52730
|
+
x.c.push(+str.slice(i, i += LOG_BASE));
|
|
52730
52731
|
}
|
|
52731
|
-
i =
|
|
52732
|
+
i = LOG_BASE - (str = str.slice(i)).length;
|
|
52732
52733
|
} else {
|
|
52733
52734
|
i -= len;
|
|
52734
52735
|
}
|
|
@@ -52739,56 +52740,56 @@ var require_bignumber = __commonJS({
|
|
|
52739
52740
|
x.c = [x.e = 0];
|
|
52740
52741
|
}
|
|
52741
52742
|
}
|
|
52742
|
-
|
|
52743
|
-
|
|
52744
|
-
|
|
52745
|
-
|
|
52746
|
-
|
|
52747
|
-
|
|
52748
|
-
|
|
52749
|
-
|
|
52750
|
-
|
|
52751
|
-
|
|
52752
|
-
|
|
52753
|
-
|
|
52743
|
+
BigNumber3.clone = clone2;
|
|
52744
|
+
BigNumber3.ROUND_UP = 0;
|
|
52745
|
+
BigNumber3.ROUND_DOWN = 1;
|
|
52746
|
+
BigNumber3.ROUND_CEIL = 2;
|
|
52747
|
+
BigNumber3.ROUND_FLOOR = 3;
|
|
52748
|
+
BigNumber3.ROUND_HALF_UP = 4;
|
|
52749
|
+
BigNumber3.ROUND_HALF_DOWN = 5;
|
|
52750
|
+
BigNumber3.ROUND_HALF_EVEN = 6;
|
|
52751
|
+
BigNumber3.ROUND_HALF_CEIL = 7;
|
|
52752
|
+
BigNumber3.ROUND_HALF_FLOOR = 8;
|
|
52753
|
+
BigNumber3.EUCLID = 9;
|
|
52754
|
+
BigNumber3.config = BigNumber3.set = function(obj) {
|
|
52754
52755
|
var p, v;
|
|
52755
52756
|
if (obj != null) {
|
|
52756
52757
|
if (typeof obj == "object") {
|
|
52757
52758
|
if (obj.hasOwnProperty(p = "DECIMAL_PLACES")) {
|
|
52758
52759
|
v = obj[p];
|
|
52759
|
-
|
|
52760
|
+
intCheck(v, 0, MAX, p);
|
|
52760
52761
|
DECIMAL_PLACES = v;
|
|
52761
52762
|
}
|
|
52762
52763
|
if (obj.hasOwnProperty(p = "ROUNDING_MODE")) {
|
|
52763
52764
|
v = obj[p];
|
|
52764
|
-
|
|
52765
|
+
intCheck(v, 0, 8, p);
|
|
52765
52766
|
ROUNDING_MODE = v;
|
|
52766
52767
|
}
|
|
52767
52768
|
if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) {
|
|
52768
52769
|
v = obj[p];
|
|
52769
52770
|
if (v && v.pop) {
|
|
52770
|
-
|
|
52771
|
-
|
|
52771
|
+
intCheck(v[0], -MAX, 0, p);
|
|
52772
|
+
intCheck(v[1], 0, MAX, p);
|
|
52772
52773
|
TO_EXP_NEG = v[0];
|
|
52773
52774
|
TO_EXP_POS = v[1];
|
|
52774
52775
|
} else {
|
|
52775
|
-
|
|
52776
|
+
intCheck(v, -MAX, MAX, p);
|
|
52776
52777
|
TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
|
|
52777
52778
|
}
|
|
52778
52779
|
}
|
|
52779
52780
|
if (obj.hasOwnProperty(p = "RANGE")) {
|
|
52780
52781
|
v = obj[p];
|
|
52781
52782
|
if (v && v.pop) {
|
|
52782
|
-
|
|
52783
|
-
|
|
52783
|
+
intCheck(v[0], -MAX, -1, p);
|
|
52784
|
+
intCheck(v[1], 1, MAX, p);
|
|
52784
52785
|
MIN_EXP = v[0];
|
|
52785
52786
|
MAX_EXP = v[1];
|
|
52786
52787
|
} else {
|
|
52787
|
-
|
|
52788
|
+
intCheck(v, -MAX, MAX, p);
|
|
52788
52789
|
if (v) {
|
|
52789
52790
|
MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
|
|
52790
52791
|
} else {
|
|
52791
|
-
throw Error(
|
|
52792
|
+
throw Error(bignumberError + p + " cannot be zero: " + v);
|
|
52792
52793
|
}
|
|
52793
52794
|
}
|
|
52794
52795
|
}
|
|
@@ -52800,29 +52801,29 @@ var require_bignumber = __commonJS({
|
|
|
52800
52801
|
CRYPTO = v;
|
|
52801
52802
|
} else {
|
|
52802
52803
|
CRYPTO = !v;
|
|
52803
|
-
throw Error(
|
|
52804
|
+
throw Error(bignumberError + "crypto unavailable");
|
|
52804
52805
|
}
|
|
52805
52806
|
} else {
|
|
52806
52807
|
CRYPTO = v;
|
|
52807
52808
|
}
|
|
52808
52809
|
} else {
|
|
52809
|
-
throw Error(
|
|
52810
|
+
throw Error(bignumberError + p + " not true or false: " + v);
|
|
52810
52811
|
}
|
|
52811
52812
|
}
|
|
52812
52813
|
if (obj.hasOwnProperty(p = "MODULO_MODE")) {
|
|
52813
52814
|
v = obj[p];
|
|
52814
|
-
|
|
52815
|
+
intCheck(v, 0, 9, p);
|
|
52815
52816
|
MODULO_MODE = v;
|
|
52816
52817
|
}
|
|
52817
52818
|
if (obj.hasOwnProperty(p = "POW_PRECISION")) {
|
|
52818
52819
|
v = obj[p];
|
|
52819
|
-
|
|
52820
|
+
intCheck(v, 0, MAX, p);
|
|
52820
52821
|
POW_PRECISION = v;
|
|
52821
52822
|
}
|
|
52822
52823
|
if (obj.hasOwnProperty(p = "FORMAT")) {
|
|
52823
52824
|
v = obj[p];
|
|
52824
52825
|
if (typeof v == "object") FORMAT = v;
|
|
52825
|
-
else throw Error(
|
|
52826
|
+
else throw Error(bignumberError + p + " not an object: " + v);
|
|
52826
52827
|
}
|
|
52827
52828
|
if (obj.hasOwnProperty(p = "ALPHABET")) {
|
|
52828
52829
|
v = obj[p];
|
|
@@ -52830,11 +52831,11 @@ var require_bignumber = __commonJS({
|
|
|
52830
52831
|
alphabetHasNormalDecimalDigits = v.slice(0, 10) == "0123456789";
|
|
52831
52832
|
ALPHABET = v;
|
|
52832
52833
|
} else {
|
|
52833
|
-
throw Error(
|
|
52834
|
+
throw Error(bignumberError + p + " invalid: " + v);
|
|
52834
52835
|
}
|
|
52835
52836
|
}
|
|
52836
52837
|
} else {
|
|
52837
|
-
throw Error(
|
|
52838
|
+
throw Error(bignumberError + "Object expected: " + obj);
|
|
52838
52839
|
}
|
|
52839
52840
|
}
|
|
52840
52841
|
return {
|
|
@@ -52849,22 +52850,22 @@ var require_bignumber = __commonJS({
|
|
|
52849
52850
|
ALPHABET
|
|
52850
52851
|
};
|
|
52851
52852
|
};
|
|
52852
|
-
|
|
52853
|
+
BigNumber3.isBigNumber = function(v) {
|
|
52853
52854
|
if (!v || v._isBigNumber !== true) return false;
|
|
52854
|
-
if (!
|
|
52855
|
+
if (!BigNumber3.DEBUG) return true;
|
|
52855
52856
|
var i, n, c = v.c, e = v.e, s = v.s;
|
|
52856
52857
|
out: if ({}.toString.call(c) == "[object Array]") {
|
|
52857
|
-
if ((s === 1 || s === -1) && e >= -
|
|
52858
|
+
if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
|
|
52858
52859
|
if (c[0] === 0) {
|
|
52859
52860
|
if (e === 0 && c.length === 1) return true;
|
|
52860
52861
|
break out;
|
|
52861
52862
|
}
|
|
52862
|
-
i = (e + 1) %
|
|
52863
|
-
if (i < 1) i +=
|
|
52863
|
+
i = (e + 1) % LOG_BASE;
|
|
52864
|
+
if (i < 1) i += LOG_BASE;
|
|
52864
52865
|
if (String(c[0]).length == i) {
|
|
52865
52866
|
for (i = 0; i < c.length; i++) {
|
|
52866
52867
|
n = c[i];
|
|
52867
|
-
if (n < 0 || n >=
|
|
52868
|
+
if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;
|
|
52868
52869
|
}
|
|
52869
52870
|
if (n !== 0) return true;
|
|
52870
52871
|
}
|
|
@@ -52872,26 +52873,26 @@ var require_bignumber = __commonJS({
|
|
|
52872
52873
|
} else if (c === null && e === null && (s === null || s === 1 || s === -1)) {
|
|
52873
52874
|
return true;
|
|
52874
52875
|
}
|
|
52875
|
-
throw Error(
|
|
52876
|
+
throw Error(bignumberError + "Invalid BigNumber: " + v);
|
|
52876
52877
|
};
|
|
52877
|
-
|
|
52878
|
+
BigNumber3.maximum = BigNumber3.max = function() {
|
|
52878
52879
|
return maxOrMin(arguments, -1);
|
|
52879
52880
|
};
|
|
52880
|
-
|
|
52881
|
+
BigNumber3.minimum = BigNumber3.min = function() {
|
|
52881
52882
|
return maxOrMin(arguments, 1);
|
|
52882
52883
|
};
|
|
52883
|
-
|
|
52884
|
+
BigNumber3.random = (function() {
|
|
52884
52885
|
var pow2_53 = 9007199254740992;
|
|
52885
52886
|
var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
|
|
52886
|
-
return
|
|
52887
|
+
return mathfloor(Math.random() * pow2_53);
|
|
52887
52888
|
} : function() {
|
|
52888
52889
|
return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
|
|
52889
52890
|
};
|
|
52890
52891
|
return function(dp) {
|
|
52891
|
-
var a, b, e, k, v, i = 0, c = [], rand = new
|
|
52892
|
+
var a, b, e, k, v, i = 0, c = [], rand = new BigNumber3(ONE);
|
|
52892
52893
|
if (dp == null) dp = DECIMAL_PLACES;
|
|
52893
|
-
else
|
|
52894
|
-
k =
|
|
52894
|
+
else intCheck(dp, 0, MAX);
|
|
52895
|
+
k = mathceil(dp / LOG_BASE);
|
|
52895
52896
|
if (CRYPTO) {
|
|
52896
52897
|
if (crypto.getRandomValues) {
|
|
52897
52898
|
a = crypto.getRandomValues(new Uint32Array(k *= 2));
|
|
@@ -52921,7 +52922,7 @@ var require_bignumber = __commonJS({
|
|
|
52921
52922
|
i = k / 7;
|
|
52922
52923
|
} else {
|
|
52923
52924
|
CRYPTO = false;
|
|
52924
|
-
throw Error(
|
|
52925
|
+
throw Error(bignumberError + "crypto unavailable");
|
|
52925
52926
|
}
|
|
52926
52927
|
}
|
|
52927
52928
|
if (!CRYPTO) {
|
|
@@ -52931,26 +52932,26 @@ var require_bignumber = __commonJS({
|
|
|
52931
52932
|
}
|
|
52932
52933
|
}
|
|
52933
52934
|
k = c[--i];
|
|
52934
|
-
dp %=
|
|
52935
|
+
dp %= LOG_BASE;
|
|
52935
52936
|
if (k && dp) {
|
|
52936
|
-
v =
|
|
52937
|
-
c[i] =
|
|
52937
|
+
v = POWS_TEN[LOG_BASE - dp];
|
|
52938
|
+
c[i] = mathfloor(k / v) * v;
|
|
52938
52939
|
}
|
|
52939
52940
|
for (; c[i] === 0; c.pop(), i--) ;
|
|
52940
52941
|
if (i < 0) {
|
|
52941
52942
|
c = [e = 0];
|
|
52942
52943
|
} else {
|
|
52943
|
-
for (e = -1; c[0] === 0; c.splice(0, 1), e -=
|
|
52944
|
+
for (e = -1; c[0] === 0; c.splice(0, 1), e -= LOG_BASE) ;
|
|
52944
52945
|
for (i = 1, v = c[0]; v >= 10; v /= 10, i++) ;
|
|
52945
|
-
if (i <
|
|
52946
|
+
if (i < LOG_BASE) e -= LOG_BASE - i;
|
|
52946
52947
|
}
|
|
52947
52948
|
rand.e = e;
|
|
52948
52949
|
rand.c = c;
|
|
52949
52950
|
return rand;
|
|
52950
52951
|
};
|
|
52951
52952
|
})();
|
|
52952
|
-
|
|
52953
|
-
var i = 1, args = arguments, sum = new
|
|
52953
|
+
BigNumber3.sum = function() {
|
|
52954
|
+
var i = 1, args = arguments, sum = new BigNumber3(args[0]);
|
|
52954
52955
|
for (; i < args.length; ) sum = sum.plus(args[i++]);
|
|
52955
52956
|
return sum;
|
|
52956
52957
|
};
|
|
@@ -52977,11 +52978,11 @@ var require_bignumber = __commonJS({
|
|
|
52977
52978
|
k = POW_PRECISION;
|
|
52978
52979
|
POW_PRECISION = 0;
|
|
52979
52980
|
str = str.replace(".", "");
|
|
52980
|
-
y = new
|
|
52981
|
+
y = new BigNumber3(baseIn);
|
|
52981
52982
|
x = y.pow(str.length - i);
|
|
52982
52983
|
POW_PRECISION = k;
|
|
52983
52984
|
y.c = toBaseOut(
|
|
52984
|
-
|
|
52985
|
+
toFixedPoint(coeffToString(x.c), x.e, "0"),
|
|
52985
52986
|
10,
|
|
52986
52987
|
baseOut,
|
|
52987
52988
|
decimal
|
|
@@ -53009,7 +53010,7 @@ var require_bignumber = __commonJS({
|
|
|
53009
53010
|
r = r || d < 0 || xc[d + 1] != null;
|
|
53010
53011
|
r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : i > k || i == k && (rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == (x.s < 0 ? 8 : 7));
|
|
53011
53012
|
if (d < 1 || !xc[0]) {
|
|
53012
|
-
str = r ?
|
|
53013
|
+
str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);
|
|
53013
53014
|
} else {
|
|
53014
53015
|
xc.length = d;
|
|
53015
53016
|
if (r) {
|
|
@@ -53023,26 +53024,26 @@ var require_bignumber = __commonJS({
|
|
|
53023
53024
|
}
|
|
53024
53025
|
for (k = xc.length; !xc[--k]; ) ;
|
|
53025
53026
|
for (i = 0, str = ""; i <= k; str += alphabet.charAt(xc[i++])) ;
|
|
53026
|
-
str =
|
|
53027
|
+
str = toFixedPoint(str, e, alphabet.charAt(0));
|
|
53027
53028
|
}
|
|
53028
53029
|
return str;
|
|
53029
53030
|
};
|
|
53030
53031
|
})();
|
|
53031
53032
|
div = /* @__PURE__ */ (function() {
|
|
53032
53033
|
function multiply(x, k, base) {
|
|
53033
|
-
var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k %
|
|
53034
|
+
var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0;
|
|
53034
53035
|
for (x = x.slice(); i--; ) {
|
|
53035
|
-
xlo = x[i] %
|
|
53036
|
-
xhi = x[i] /
|
|
53036
|
+
xlo = x[i] % SQRT_BASE;
|
|
53037
|
+
xhi = x[i] / SQRT_BASE | 0;
|
|
53037
53038
|
m = khi * xlo + xhi * klo;
|
|
53038
|
-
temp = klo * xlo + m %
|
|
53039
|
-
carry = (temp / base | 0) + (m /
|
|
53039
|
+
temp = klo * xlo + m % SQRT_BASE * SQRT_BASE + carry;
|
|
53040
|
+
carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;
|
|
53040
53041
|
x[i] = temp % base;
|
|
53041
53042
|
}
|
|
53042
53043
|
if (carry) x = [carry].concat(x);
|
|
53043
53044
|
return x;
|
|
53044
53045
|
}
|
|
53045
|
-
function
|
|
53046
|
+
function compare2(a, b, aL, bL) {
|
|
53046
53047
|
var i, cmp;
|
|
53047
53048
|
if (aL != bL) {
|
|
53048
53049
|
cmp = aL > bL ? 1 : -1;
|
|
@@ -53068,7 +53069,7 @@ var require_bignumber = __commonJS({
|
|
|
53068
53069
|
return function(x, y, dp, rm, base) {
|
|
53069
53070
|
var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, yL, yz, s = x.s == y.s ? 1 : -1, xc = x.c, yc = y.c;
|
|
53070
53071
|
if (!xc || !xc[0] || !yc || !yc[0]) {
|
|
53071
|
-
return new
|
|
53072
|
+
return new BigNumber3(
|
|
53072
53073
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
53073
53074
|
!x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : (
|
|
53074
53075
|
// Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
|
|
@@ -53076,14 +53077,14 @@ var require_bignumber = __commonJS({
|
|
|
53076
53077
|
)
|
|
53077
53078
|
);
|
|
53078
53079
|
}
|
|
53079
|
-
q = new
|
|
53080
|
+
q = new BigNumber3(s);
|
|
53080
53081
|
qc = q.c = [];
|
|
53081
53082
|
e = x.e - y.e;
|
|
53082
53083
|
s = dp + e + 1;
|
|
53083
53084
|
if (!base) {
|
|
53084
|
-
base =
|
|
53085
|
-
e =
|
|
53086
|
-
s = s /
|
|
53085
|
+
base = BASE;
|
|
53086
|
+
e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);
|
|
53087
|
+
s = s / LOG_BASE | 0;
|
|
53087
53088
|
}
|
|
53088
53089
|
for (i = 0; yc[i] == (xc[i] || 0); i++) ;
|
|
53089
53090
|
if (yc[i] > (xc[i] || 0)) e--;
|
|
@@ -53095,7 +53096,7 @@ var require_bignumber = __commonJS({
|
|
|
53095
53096
|
yL = yc.length;
|
|
53096
53097
|
i = 0;
|
|
53097
53098
|
s += 2;
|
|
53098
|
-
n =
|
|
53099
|
+
n = mathfloor(base / (yc[0] + 1));
|
|
53099
53100
|
if (n > 1) {
|
|
53100
53101
|
yc = multiply(yc, n, base);
|
|
53101
53102
|
xc = multiply(xc, n, base);
|
|
@@ -53112,17 +53113,17 @@ var require_bignumber = __commonJS({
|
|
|
53112
53113
|
if (yc[1] >= base / 2) yc0++;
|
|
53113
53114
|
do {
|
|
53114
53115
|
n = 0;
|
|
53115
|
-
cmp =
|
|
53116
|
+
cmp = compare2(yc, rem, yL, remL);
|
|
53116
53117
|
if (cmp < 0) {
|
|
53117
53118
|
rem0 = rem[0];
|
|
53118
53119
|
if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);
|
|
53119
|
-
n =
|
|
53120
|
+
n = mathfloor(rem0 / yc0);
|
|
53120
53121
|
if (n > 1) {
|
|
53121
53122
|
if (n >= base) n = base - 1;
|
|
53122
53123
|
prod = multiply(yc, n, base);
|
|
53123
53124
|
prodL = prod.length;
|
|
53124
53125
|
remL = rem.length;
|
|
53125
|
-
while (
|
|
53126
|
+
while (compare2(prod, rem, prodL, remL) == 1) {
|
|
53126
53127
|
n--;
|
|
53127
53128
|
subtract(prod, yL < prodL ? yz : yc, prodL, base);
|
|
53128
53129
|
prodL = prod.length;
|
|
@@ -53139,7 +53140,7 @@ var require_bignumber = __commonJS({
|
|
|
53139
53140
|
subtract(rem, prod, remL, base);
|
|
53140
53141
|
remL = rem.length;
|
|
53141
53142
|
if (cmp == -1) {
|
|
53142
|
-
while (
|
|
53143
|
+
while (compare2(yc, rem, yL, remL) < 1) {
|
|
53143
53144
|
n++;
|
|
53144
53145
|
subtract(rem, yL < remL ? yz : yc, remL, base);
|
|
53145
53146
|
remL = rem.length;
|
|
@@ -53160,9 +53161,9 @@ var require_bignumber = __commonJS({
|
|
|
53160
53161
|
more = rem[0] != null;
|
|
53161
53162
|
if (!qc[0]) qc.splice(0, 1);
|
|
53162
53163
|
}
|
|
53163
|
-
if (base ==
|
|
53164
|
+
if (base == BASE) {
|
|
53164
53165
|
for (i = 1, s = qc[0]; s >= 10; s /= 10, i++) ;
|
|
53165
|
-
round(q, dp + (q.e = i + e *
|
|
53166
|
+
round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);
|
|
53166
53167
|
} else {
|
|
53167
53168
|
q.e = e;
|
|
53168
53169
|
q.r = +more;
|
|
@@ -53173,24 +53174,24 @@ var require_bignumber = __commonJS({
|
|
|
53173
53174
|
function format(n, i, rm, id) {
|
|
53174
53175
|
var c0, e, ne, len, str;
|
|
53175
53176
|
if (rm == null) rm = ROUNDING_MODE;
|
|
53176
|
-
else
|
|
53177
|
+
else intCheck(rm, 0, 8);
|
|
53177
53178
|
if (!n.c) return n.toString();
|
|
53178
53179
|
c0 = n.c[0];
|
|
53179
53180
|
ne = n.e;
|
|
53180
53181
|
if (i == null) {
|
|
53181
|
-
str =
|
|
53182
|
-
str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ?
|
|
53182
|
+
str = coeffToString(n.c);
|
|
53183
|
+
str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ? toExponential(str, ne) : toFixedPoint(str, ne, "0");
|
|
53183
53184
|
} else {
|
|
53184
|
-
n = round(new
|
|
53185
|
+
n = round(new BigNumber3(n), i, rm);
|
|
53185
53186
|
e = n.e;
|
|
53186
|
-
str =
|
|
53187
|
+
str = coeffToString(n.c);
|
|
53187
53188
|
len = str.length;
|
|
53188
53189
|
if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {
|
|
53189
53190
|
for (; len < i; str += "0", len++) ;
|
|
53190
|
-
str =
|
|
53191
|
+
str = toExponential(str, e);
|
|
53191
53192
|
} else {
|
|
53192
53193
|
i -= ne + (id === 2 && e > ne);
|
|
53193
|
-
str =
|
|
53194
|
+
str = toFixedPoint(str, e, "0");
|
|
53194
53195
|
if (e + 1 > len) {
|
|
53195
53196
|
if (--i > 0) for (str += "."; i--; str += "0") ;
|
|
53196
53197
|
} else {
|
|
@@ -53205,10 +53206,10 @@ var require_bignumber = __commonJS({
|
|
|
53205
53206
|
return n.s < 0 && c0 ? "-" + str : str;
|
|
53206
53207
|
}
|
|
53207
53208
|
function maxOrMin(args, n) {
|
|
53208
|
-
var k, y, i = 1, x = new
|
|
53209
|
+
var k, y, i = 1, x = new BigNumber3(args[0]);
|
|
53209
53210
|
for (; i < args.length; i++) {
|
|
53210
|
-
y = new
|
|
53211
|
-
if (!y.s || (k =
|
|
53211
|
+
y = new BigNumber3(args[i]);
|
|
53212
|
+
if (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) {
|
|
53212
53213
|
x = y;
|
|
53213
53214
|
}
|
|
53214
53215
|
}
|
|
@@ -53218,7 +53219,7 @@ var require_bignumber = __commonJS({
|
|
|
53218
53219
|
var i = 1, j = c.length;
|
|
53219
53220
|
for (; !c[--j]; c.pop()) ;
|
|
53220
53221
|
for (j = c[0]; j >= 10; j /= 10, i++) ;
|
|
53221
|
-
if ((e = i + e *
|
|
53222
|
+
if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {
|
|
53222
53223
|
n.c = n.e = null;
|
|
53223
53224
|
} else if (e < MIN_EXP) {
|
|
53224
53225
|
n.c = [n.e = 0];
|
|
@@ -53244,10 +53245,10 @@ var require_bignumber = __commonJS({
|
|
|
53244
53245
|
base = b;
|
|
53245
53246
|
s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1");
|
|
53246
53247
|
}
|
|
53247
|
-
if (str != s) return new
|
|
53248
|
+
if (str != s) return new BigNumber3(s, base);
|
|
53248
53249
|
}
|
|
53249
|
-
if (
|
|
53250
|
-
throw Error(
|
|
53250
|
+
if (BigNumber3.DEBUG) {
|
|
53251
|
+
throw Error(bignumberError + "Not a" + (b ? " base " + b : "") + " number: " + str);
|
|
53251
53252
|
}
|
|
53252
53253
|
x.s = null;
|
|
53253
53254
|
}
|
|
@@ -53255,34 +53256,34 @@ var require_bignumber = __commonJS({
|
|
|
53255
53256
|
};
|
|
53256
53257
|
})();
|
|
53257
53258
|
function round(x, sd, rm, r) {
|
|
53258
|
-
var d, i, j, k, n, ni, rd, xc = x.c, pows10 =
|
|
53259
|
+
var d, i, j, k, n, ni, rd, xc = x.c, pows10 = POWS_TEN;
|
|
53259
53260
|
if (xc) {
|
|
53260
53261
|
out: {
|
|
53261
53262
|
for (d = 1, k = xc[0]; k >= 10; k /= 10, d++) ;
|
|
53262
53263
|
i = sd - d;
|
|
53263
53264
|
if (i < 0) {
|
|
53264
|
-
i +=
|
|
53265
|
+
i += LOG_BASE;
|
|
53265
53266
|
j = sd;
|
|
53266
53267
|
n = xc[ni = 0];
|
|
53267
|
-
rd =
|
|
53268
|
+
rd = mathfloor(n / pows10[d - j - 1] % 10);
|
|
53268
53269
|
} else {
|
|
53269
|
-
ni =
|
|
53270
|
+
ni = mathceil((i + 1) / LOG_BASE);
|
|
53270
53271
|
if (ni >= xc.length) {
|
|
53271
53272
|
if (r) {
|
|
53272
53273
|
for (; xc.length <= ni; xc.push(0)) ;
|
|
53273
53274
|
n = rd = 0;
|
|
53274
53275
|
d = 1;
|
|
53275
|
-
i %=
|
|
53276
|
-
j = i -
|
|
53276
|
+
i %= LOG_BASE;
|
|
53277
|
+
j = i - LOG_BASE + 1;
|
|
53277
53278
|
} else {
|
|
53278
53279
|
break out;
|
|
53279
53280
|
}
|
|
53280
53281
|
} else {
|
|
53281
53282
|
n = k = xc[ni];
|
|
53282
53283
|
for (d = 1; k >= 10; k /= 10, d++) ;
|
|
53283
|
-
i %=
|
|
53284
|
-
j = i -
|
|
53285
|
-
rd = j < 0 ? 0 :
|
|
53284
|
+
i %= LOG_BASE;
|
|
53285
|
+
j = i - LOG_BASE + d;
|
|
53286
|
+
rd = j < 0 ? 0 : mathfloor(n / pows10[d - j - 1] % 10);
|
|
53286
53287
|
}
|
|
53287
53288
|
}
|
|
53288
53289
|
r = r || sd < 0 || // Are there any non-zero digits after the rounding digit?
|
|
@@ -53295,7 +53296,7 @@ var require_bignumber = __commonJS({
|
|
|
53295
53296
|
xc.length = 0;
|
|
53296
53297
|
if (r) {
|
|
53297
53298
|
sd -= x.e + 1;
|
|
53298
|
-
xc[0] = pows10[(
|
|
53299
|
+
xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];
|
|
53299
53300
|
x.e = -sd || 0;
|
|
53300
53301
|
} else {
|
|
53301
53302
|
xc[0] = x.e = 0;
|
|
@@ -53308,8 +53309,8 @@ var require_bignumber = __commonJS({
|
|
|
53308
53309
|
ni--;
|
|
53309
53310
|
} else {
|
|
53310
53311
|
xc.length = ni + 1;
|
|
53311
|
-
k = pows10[
|
|
53312
|
-
xc[ni] = j > 0 ?
|
|
53312
|
+
k = pows10[LOG_BASE - i];
|
|
53313
|
+
xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;
|
|
53313
53314
|
}
|
|
53314
53315
|
if (r) {
|
|
53315
53316
|
for (; ; ) {
|
|
@@ -53319,12 +53320,12 @@ var require_bignumber = __commonJS({
|
|
|
53319
53320
|
for (k = 1; j >= 10; j /= 10, k++) ;
|
|
53320
53321
|
if (i != k) {
|
|
53321
53322
|
x.e++;
|
|
53322
|
-
if (xc[0] ==
|
|
53323
|
+
if (xc[0] == BASE) xc[0] = 1;
|
|
53323
53324
|
}
|
|
53324
53325
|
break;
|
|
53325
53326
|
} else {
|
|
53326
53327
|
xc[ni] += k;
|
|
53327
|
-
if (xc[ni] !=
|
|
53328
|
+
if (xc[ni] != BASE) break;
|
|
53328
53329
|
xc[ni--] = 0;
|
|
53329
53330
|
k = 1;
|
|
53330
53331
|
}
|
|
@@ -53343,71 +53344,71 @@ var require_bignumber = __commonJS({
|
|
|
53343
53344
|
function valueOf(n) {
|
|
53344
53345
|
var str, e = n.e;
|
|
53345
53346
|
if (e === null) return n.toString();
|
|
53346
|
-
str =
|
|
53347
|
-
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ?
|
|
53347
|
+
str = coeffToString(n.c);
|
|
53348
|
+
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(str, e) : toFixedPoint(str, e, "0");
|
|
53348
53349
|
return n.s < 0 ? "-" + str : str;
|
|
53349
53350
|
}
|
|
53350
53351
|
P.absoluteValue = P.abs = function() {
|
|
53351
|
-
var x = new
|
|
53352
|
+
var x = new BigNumber3(this);
|
|
53352
53353
|
if (x.s < 0) x.s = 1;
|
|
53353
53354
|
return x;
|
|
53354
53355
|
};
|
|
53355
53356
|
P.comparedTo = function(y, b) {
|
|
53356
|
-
return
|
|
53357
|
+
return compare(this, new BigNumber3(y, b));
|
|
53357
53358
|
};
|
|
53358
53359
|
P.decimalPlaces = P.dp = function(dp, rm) {
|
|
53359
53360
|
var c, n, v, x = this;
|
|
53360
53361
|
if (dp != null) {
|
|
53361
|
-
|
|
53362
|
+
intCheck(dp, 0, MAX);
|
|
53362
53363
|
if (rm == null) rm = ROUNDING_MODE;
|
|
53363
|
-
else
|
|
53364
|
-
return round(new
|
|
53364
|
+
else intCheck(rm, 0, 8);
|
|
53365
|
+
return round(new BigNumber3(x), dp + x.e + 1, rm);
|
|
53365
53366
|
}
|
|
53366
53367
|
if (!(c = x.c)) return null;
|
|
53367
|
-
n = ((v = c.length - 1) -
|
|
53368
|
+
n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
|
|
53368
53369
|
if (v = c[v]) for (; v % 10 == 0; v /= 10, n--) ;
|
|
53369
53370
|
if (n < 0) n = 0;
|
|
53370
53371
|
return n;
|
|
53371
53372
|
};
|
|
53372
53373
|
P.dividedBy = P.div = function(y, b) {
|
|
53373
|
-
return div(this, new
|
|
53374
|
+
return div(this, new BigNumber3(y, b), DECIMAL_PLACES, ROUNDING_MODE);
|
|
53374
53375
|
};
|
|
53375
53376
|
P.dividedToIntegerBy = P.idiv = function(y, b) {
|
|
53376
|
-
return div(this, new
|
|
53377
|
+
return div(this, new BigNumber3(y, b), 0, 1);
|
|
53377
53378
|
};
|
|
53378
53379
|
P.exponentiatedBy = P.pow = function(n, m) {
|
|
53379
53380
|
var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, x = this;
|
|
53380
|
-
n = new
|
|
53381
|
+
n = new BigNumber3(n);
|
|
53381
53382
|
if (n.c && !n.isInteger()) {
|
|
53382
|
-
throw Error(
|
|
53383
|
+
throw Error(bignumberError + "Exponent not an integer: " + valueOf(n));
|
|
53383
53384
|
}
|
|
53384
|
-
if (m != null) m = new
|
|
53385
|
+
if (m != null) m = new BigNumber3(m);
|
|
53385
53386
|
nIsBig = n.e > 14;
|
|
53386
53387
|
if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {
|
|
53387
|
-
y = new
|
|
53388
|
+
y = new BigNumber3(Math.pow(+valueOf(x), nIsBig ? n.s * (2 - isOdd(n)) : +valueOf(n)));
|
|
53388
53389
|
return m ? y.mod(m) : y;
|
|
53389
53390
|
}
|
|
53390
53391
|
nIsNeg = n.s < 0;
|
|
53391
53392
|
if (m) {
|
|
53392
|
-
if (m.c ? !m.c[0] : !m.s) return new
|
|
53393
|
+
if (m.c ? !m.c[0] : !m.s) return new BigNumber3(NaN);
|
|
53393
53394
|
isModExp = !nIsNeg && x.isInteger() && m.isInteger();
|
|
53394
53395
|
if (isModExp) x = x.mod(m);
|
|
53395
53396
|
} else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) {
|
|
53396
|
-
k = x.s < 0 &&
|
|
53397
|
+
k = x.s < 0 && isOdd(n) ? -0 : 0;
|
|
53397
53398
|
if (x.e > -1) k = 1 / k;
|
|
53398
|
-
return new
|
|
53399
|
+
return new BigNumber3(nIsNeg ? 1 / k : k);
|
|
53399
53400
|
} else if (POW_PRECISION) {
|
|
53400
|
-
k =
|
|
53401
|
+
k = mathceil(POW_PRECISION / LOG_BASE + 2);
|
|
53401
53402
|
}
|
|
53402
53403
|
if (nIsBig) {
|
|
53403
|
-
half = new
|
|
53404
|
+
half = new BigNumber3(0.5);
|
|
53404
53405
|
if (nIsNeg) n.s = 1;
|
|
53405
|
-
nIsOdd =
|
|
53406
|
+
nIsOdd = isOdd(n);
|
|
53406
53407
|
} else {
|
|
53407
53408
|
i = Math.abs(+valueOf(n));
|
|
53408
53409
|
nIsOdd = i % 2;
|
|
53409
53410
|
}
|
|
53410
|
-
y = new
|
|
53411
|
+
y = new BigNumber3(ONE);
|
|
53411
53412
|
for (; ; ) {
|
|
53412
53413
|
if (nIsOdd) {
|
|
53413
53414
|
y = y.times(x);
|
|
@@ -53419,14 +53420,14 @@ var require_bignumber = __commonJS({
|
|
|
53419
53420
|
}
|
|
53420
53421
|
}
|
|
53421
53422
|
if (i) {
|
|
53422
|
-
i =
|
|
53423
|
+
i = mathfloor(i / 2);
|
|
53423
53424
|
if (i === 0) break;
|
|
53424
53425
|
nIsOdd = i % 2;
|
|
53425
53426
|
} else {
|
|
53426
53427
|
n = n.times(half);
|
|
53427
53428
|
round(n, n.e + 1, 1);
|
|
53428
53429
|
if (n.e > 14) {
|
|
53429
|
-
nIsOdd =
|
|
53430
|
+
nIsOdd = isOdd(n);
|
|
53430
53431
|
} else {
|
|
53431
53432
|
i = +valueOf(n);
|
|
53432
53433
|
if (i === 0) break;
|
|
@@ -53445,31 +53446,31 @@ var require_bignumber = __commonJS({
|
|
|
53445
53446
|
return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;
|
|
53446
53447
|
};
|
|
53447
53448
|
P.integerValue = function(rm) {
|
|
53448
|
-
var n = new
|
|
53449
|
+
var n = new BigNumber3(this);
|
|
53449
53450
|
if (rm == null) rm = ROUNDING_MODE;
|
|
53450
|
-
else
|
|
53451
|
+
else intCheck(rm, 0, 8);
|
|
53451
53452
|
return round(n, n.e + 1, rm);
|
|
53452
53453
|
};
|
|
53453
53454
|
P.isEqualTo = P.eq = function(y, b) {
|
|
53454
|
-
return
|
|
53455
|
+
return compare(this, new BigNumber3(y, b)) === 0;
|
|
53455
53456
|
};
|
|
53456
53457
|
P.isFinite = function() {
|
|
53457
53458
|
return !!this.c;
|
|
53458
53459
|
};
|
|
53459
53460
|
P.isGreaterThan = P.gt = function(y, b) {
|
|
53460
|
-
return
|
|
53461
|
+
return compare(this, new BigNumber3(y, b)) > 0;
|
|
53461
53462
|
};
|
|
53462
53463
|
P.isGreaterThanOrEqualTo = P.gte = function(y, b) {
|
|
53463
|
-
return (b =
|
|
53464
|
+
return (b = compare(this, new BigNumber3(y, b))) === 1 || b === 0;
|
|
53464
53465
|
};
|
|
53465
53466
|
P.isInteger = function() {
|
|
53466
|
-
return !!this.c &&
|
|
53467
|
+
return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
|
|
53467
53468
|
};
|
|
53468
53469
|
P.isLessThan = P.lt = function(y, b) {
|
|
53469
|
-
return
|
|
53470
|
+
return compare(this, new BigNumber3(y, b)) < 0;
|
|
53470
53471
|
};
|
|
53471
53472
|
P.isLessThanOrEqualTo = P.lte = function(y, b) {
|
|
53472
|
-
return (b =
|
|
53473
|
+
return (b = compare(this, new BigNumber3(y, b))) === -1 || b === 0;
|
|
53473
53474
|
};
|
|
53474
53475
|
P.isNaN = function() {
|
|
53475
53476
|
return !this.s;
|
|
@@ -53485,25 +53486,25 @@ var require_bignumber = __commonJS({
|
|
|
53485
53486
|
};
|
|
53486
53487
|
P.minus = function(y, b) {
|
|
53487
53488
|
var i, j, t, xLTy, x = this, a = x.s;
|
|
53488
|
-
y = new
|
|
53489
|
+
y = new BigNumber3(y, b);
|
|
53489
53490
|
b = y.s;
|
|
53490
|
-
if (!a || !b) return new
|
|
53491
|
+
if (!a || !b) return new BigNumber3(NaN);
|
|
53491
53492
|
if (a != b) {
|
|
53492
53493
|
y.s = -b;
|
|
53493
53494
|
return x.plus(y);
|
|
53494
53495
|
}
|
|
53495
|
-
var xe = x.e /
|
|
53496
|
+
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
53496
53497
|
if (!xe || !ye) {
|
|
53497
|
-
if (!xc || !yc) return xc ? (y.s = -b, y) : new
|
|
53498
|
+
if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber3(yc ? x : NaN);
|
|
53498
53499
|
if (!xc[0] || !yc[0]) {
|
|
53499
|
-
return yc[0] ? (y.s = -b, y) : new
|
|
53500
|
+
return yc[0] ? (y.s = -b, y) : new BigNumber3(xc[0] ? x : (
|
|
53500
53501
|
// IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
|
|
53501
53502
|
ROUNDING_MODE == 3 ? -0 : 0
|
|
53502
53503
|
));
|
|
53503
53504
|
}
|
|
53504
53505
|
}
|
|
53505
|
-
xe =
|
|
53506
|
-
ye =
|
|
53506
|
+
xe = bitFloor(xe);
|
|
53507
|
+
ye = bitFloor(ye);
|
|
53507
53508
|
xc = xc.slice();
|
|
53508
53509
|
if (a = xe - ye) {
|
|
53509
53510
|
if (xLTy = a < 0) {
|
|
@@ -53533,12 +53534,12 @@ var require_bignumber = __commonJS({
|
|
|
53533
53534
|
}
|
|
53534
53535
|
b = (j = yc.length) - (i = xc.length);
|
|
53535
53536
|
if (b > 0) for (; b--; xc[i++] = 0) ;
|
|
53536
|
-
b =
|
|
53537
|
+
b = BASE - 1;
|
|
53537
53538
|
for (; j > a; ) {
|
|
53538
53539
|
if (xc[--j] < yc[j]) {
|
|
53539
53540
|
for (i = j; i && !xc[--i]; xc[i] = b) ;
|
|
53540
53541
|
--xc[i];
|
|
53541
|
-
xc[j] +=
|
|
53542
|
+
xc[j] += BASE;
|
|
53542
53543
|
}
|
|
53543
53544
|
xc[j] -= yc[j];
|
|
53544
53545
|
}
|
|
@@ -53552,11 +53553,11 @@ var require_bignumber = __commonJS({
|
|
|
53552
53553
|
};
|
|
53553
53554
|
P.modulo = P.mod = function(y, b) {
|
|
53554
53555
|
var q, s, x = this;
|
|
53555
|
-
y = new
|
|
53556
|
+
y = new BigNumber3(y, b);
|
|
53556
53557
|
if (!x.c || !y.s || y.c && !y.c[0]) {
|
|
53557
|
-
return new
|
|
53558
|
+
return new BigNumber3(NaN);
|
|
53558
53559
|
} else if (!y.c || x.c && !x.c[0]) {
|
|
53559
|
-
return new
|
|
53560
|
+
return new BigNumber3(x);
|
|
53560
53561
|
}
|
|
53561
53562
|
if (MODULO_MODE == 9) {
|
|
53562
53563
|
s = y.s;
|
|
@@ -53572,7 +53573,7 @@ var require_bignumber = __commonJS({
|
|
|
53572
53573
|
return y;
|
|
53573
53574
|
};
|
|
53574
53575
|
P.multipliedBy = P.times = function(y, b) {
|
|
53575
|
-
var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x = this, xc = x.c, yc = (y = new
|
|
53576
|
+
var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x = this, xc = x.c, yc = (y = new BigNumber3(y, b)).c;
|
|
53576
53577
|
if (!xc || !yc || !xc[0] || !yc[0]) {
|
|
53577
53578
|
if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
|
|
53578
53579
|
y.c = y.e = y.s = null;
|
|
@@ -53587,7 +53588,7 @@ var require_bignumber = __commonJS({
|
|
|
53587
53588
|
}
|
|
53588
53589
|
return y;
|
|
53589
53590
|
}
|
|
53590
|
-
e =
|
|
53591
|
+
e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);
|
|
53591
53592
|
y.s *= x.s;
|
|
53592
53593
|
xcL = xc.length;
|
|
53593
53594
|
ycL = yc.length;
|
|
@@ -53600,8 +53601,8 @@ var require_bignumber = __commonJS({
|
|
|
53600
53601
|
ycL = i;
|
|
53601
53602
|
}
|
|
53602
53603
|
for (i = xcL + ycL, zc = []; i--; zc.push(0)) ;
|
|
53603
|
-
base =
|
|
53604
|
-
sqrtBase =
|
|
53604
|
+
base = BASE;
|
|
53605
|
+
sqrtBase = SQRT_BASE;
|
|
53605
53606
|
for (i = ycL; --i >= 0; ) {
|
|
53606
53607
|
c = 0;
|
|
53607
53608
|
ylo = yc[i] % sqrtBase;
|
|
@@ -53624,26 +53625,26 @@ var require_bignumber = __commonJS({
|
|
|
53624
53625
|
return normalise(y, zc, e);
|
|
53625
53626
|
};
|
|
53626
53627
|
P.negated = function() {
|
|
53627
|
-
var x = new
|
|
53628
|
+
var x = new BigNumber3(this);
|
|
53628
53629
|
x.s = -x.s || null;
|
|
53629
53630
|
return x;
|
|
53630
53631
|
};
|
|
53631
53632
|
P.plus = function(y, b) {
|
|
53632
53633
|
var t, x = this, a = x.s;
|
|
53633
|
-
y = new
|
|
53634
|
+
y = new BigNumber3(y, b);
|
|
53634
53635
|
b = y.s;
|
|
53635
|
-
if (!a || !b) return new
|
|
53636
|
+
if (!a || !b) return new BigNumber3(NaN);
|
|
53636
53637
|
if (a != b) {
|
|
53637
53638
|
y.s = -b;
|
|
53638
53639
|
return x.minus(y);
|
|
53639
53640
|
}
|
|
53640
|
-
var xe = x.e /
|
|
53641
|
+
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
53641
53642
|
if (!xe || !ye) {
|
|
53642
|
-
if (!xc || !yc) return new
|
|
53643
|
-
if (!xc[0] || !yc[0]) return yc[0] ? y : new
|
|
53643
|
+
if (!xc || !yc) return new BigNumber3(a / 0);
|
|
53644
|
+
if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber3(xc[0] ? x : a * 0);
|
|
53644
53645
|
}
|
|
53645
|
-
xe =
|
|
53646
|
-
ye =
|
|
53646
|
+
xe = bitFloor(xe);
|
|
53647
|
+
ye = bitFloor(ye);
|
|
53647
53648
|
xc = xc.slice();
|
|
53648
53649
|
if (a = xe - ye) {
|
|
53649
53650
|
if (a > 0) {
|
|
@@ -53666,8 +53667,8 @@ var require_bignumber = __commonJS({
|
|
|
53666
53667
|
b = a;
|
|
53667
53668
|
}
|
|
53668
53669
|
for (a = 0; b; ) {
|
|
53669
|
-
a = (xc[--b] = xc[b] + yc[b] + a) /
|
|
53670
|
-
xc[b] =
|
|
53670
|
+
a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;
|
|
53671
|
+
xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;
|
|
53671
53672
|
}
|
|
53672
53673
|
if (a) {
|
|
53673
53674
|
xc = [a].concat(xc);
|
|
@@ -53678,14 +53679,14 @@ var require_bignumber = __commonJS({
|
|
|
53678
53679
|
P.precision = P.sd = function(sd, rm) {
|
|
53679
53680
|
var c, n, v, x = this;
|
|
53680
53681
|
if (sd != null && sd !== !!sd) {
|
|
53681
|
-
|
|
53682
|
+
intCheck(sd, 1, MAX);
|
|
53682
53683
|
if (rm == null) rm = ROUNDING_MODE;
|
|
53683
|
-
else
|
|
53684
|
-
return round(new
|
|
53684
|
+
else intCheck(rm, 0, 8);
|
|
53685
|
+
return round(new BigNumber3(x), sd, rm);
|
|
53685
53686
|
}
|
|
53686
53687
|
if (!(c = x.c)) return null;
|
|
53687
53688
|
v = c.length - 1;
|
|
53688
|
-
n = v *
|
|
53689
|
+
n = v * LOG_BASE + 1;
|
|
53689
53690
|
if (v = c[v]) {
|
|
53690
53691
|
for (; v % 10 == 0; v /= 10, n--) ;
|
|
53691
53692
|
for (v = c[0]; v >= 10; v /= 10, n++) ;
|
|
@@ -53694,29 +53695,29 @@ var require_bignumber = __commonJS({
|
|
|
53694
53695
|
return n;
|
|
53695
53696
|
};
|
|
53696
53697
|
P.shiftedBy = function(k) {
|
|
53697
|
-
|
|
53698
|
+
intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
|
|
53698
53699
|
return this.times("1e" + k);
|
|
53699
53700
|
};
|
|
53700
53701
|
P.squareRoot = P.sqrt = function() {
|
|
53701
|
-
var m, n, r, rep, t, x = this, c = x.c, s = x.s, e = x.e, dp = DECIMAL_PLACES + 4, half = new
|
|
53702
|
+
var m, n, r, rep, t, x = this, c = x.c, s = x.s, e = x.e, dp = DECIMAL_PLACES + 4, half = new BigNumber3("0.5");
|
|
53702
53703
|
if (s !== 1 || !c || !c[0]) {
|
|
53703
|
-
return new
|
|
53704
|
+
return new BigNumber3(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);
|
|
53704
53705
|
}
|
|
53705
53706
|
s = Math.sqrt(+valueOf(x));
|
|
53706
53707
|
if (s == 0 || s == 1 / 0) {
|
|
53707
|
-
n =
|
|
53708
|
+
n = coeffToString(c);
|
|
53708
53709
|
if ((n.length + e) % 2 == 0) n += "0";
|
|
53709
53710
|
s = Math.sqrt(+n);
|
|
53710
|
-
e =
|
|
53711
|
+
e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);
|
|
53711
53712
|
if (s == 1 / 0) {
|
|
53712
53713
|
n = "5e" + e;
|
|
53713
53714
|
} else {
|
|
53714
53715
|
n = s.toExponential();
|
|
53715
53716
|
n = n.slice(0, n.indexOf("e") + 1) + e;
|
|
53716
53717
|
}
|
|
53717
|
-
r = new
|
|
53718
|
+
r = new BigNumber3(n);
|
|
53718
53719
|
} else {
|
|
53719
|
-
r = new
|
|
53720
|
+
r = new BigNumber3(s + "");
|
|
53720
53721
|
}
|
|
53721
53722
|
if (r.c[0]) {
|
|
53722
53723
|
e = r.e;
|
|
@@ -53725,7 +53726,7 @@ var require_bignumber = __commonJS({
|
|
|
53725
53726
|
for (; ; ) {
|
|
53726
53727
|
t = r;
|
|
53727
53728
|
r = half.times(t.plus(div(x, t, dp, 1)));
|
|
53728
|
-
if (
|
|
53729
|
+
if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {
|
|
53729
53730
|
if (r.e < e) --s;
|
|
53730
53731
|
n = n.slice(s - 3, s + 1);
|
|
53731
53732
|
if (n == "9999" || !rep && n == "4999") {
|
|
@@ -53753,14 +53754,14 @@ var require_bignumber = __commonJS({
|
|
|
53753
53754
|
};
|
|
53754
53755
|
P.toExponential = function(dp, rm) {
|
|
53755
53756
|
if (dp != null) {
|
|
53756
|
-
|
|
53757
|
+
intCheck(dp, 0, MAX);
|
|
53757
53758
|
dp++;
|
|
53758
53759
|
}
|
|
53759
53760
|
return format(this, dp, rm, 1);
|
|
53760
53761
|
};
|
|
53761
53762
|
P.toFixed = function(dp, rm) {
|
|
53762
53763
|
if (dp != null) {
|
|
53763
|
-
|
|
53764
|
+
intCheck(dp, 0, MAX);
|
|
53764
53765
|
dp = dp + this.e + 1;
|
|
53765
53766
|
}
|
|
53766
53767
|
return format(this, dp, rm);
|
|
@@ -53778,7 +53779,7 @@ var require_bignumber = __commonJS({
|
|
|
53778
53779
|
format2 = FORMAT;
|
|
53779
53780
|
}
|
|
53780
53781
|
} else if (typeof format2 != "object") {
|
|
53781
|
-
throw Error(
|
|
53782
|
+
throw Error(bignumberError + "Argument not an object: " + format2);
|
|
53782
53783
|
}
|
|
53783
53784
|
str = x.toFixed(dp, rm);
|
|
53784
53785
|
if (x.c) {
|
|
@@ -53806,22 +53807,22 @@ var require_bignumber = __commonJS({
|
|
|
53806
53807
|
P.toFraction = function(md) {
|
|
53807
53808
|
var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, x = this, xc = x.c;
|
|
53808
53809
|
if (md != null) {
|
|
53809
|
-
n = new
|
|
53810
|
+
n = new BigNumber3(md);
|
|
53810
53811
|
if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
|
|
53811
|
-
throw Error(
|
|
53812
|
+
throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n));
|
|
53812
53813
|
}
|
|
53813
53814
|
}
|
|
53814
|
-
if (!xc) return new
|
|
53815
|
-
d = new
|
|
53816
|
-
n1 = d0 = new
|
|
53817
|
-
d1 = n0 = new
|
|
53818
|
-
s =
|
|
53815
|
+
if (!xc) return new BigNumber3(x);
|
|
53816
|
+
d = new BigNumber3(ONE);
|
|
53817
|
+
n1 = d0 = new BigNumber3(ONE);
|
|
53818
|
+
d1 = n0 = new BigNumber3(ONE);
|
|
53819
|
+
s = coeffToString(xc);
|
|
53819
53820
|
e = d.e = s.length - x.e - 1;
|
|
53820
|
-
d.c[0] =
|
|
53821
|
+
d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];
|
|
53821
53822
|
md = !md || n.comparedTo(d) > 0 ? e > 0 ? d : n1 : n;
|
|
53822
53823
|
exp = MAX_EXP;
|
|
53823
53824
|
MAX_EXP = 1 / 0;
|
|
53824
|
-
n = new
|
|
53825
|
+
n = new BigNumber3(s);
|
|
53825
53826
|
n0.c[0] = 0;
|
|
53826
53827
|
for (; ; ) {
|
|
53827
53828
|
q = div(n, d, 0, 1);
|
|
@@ -53849,7 +53850,7 @@ var require_bignumber = __commonJS({
|
|
|
53849
53850
|
return +valueOf(this);
|
|
53850
53851
|
};
|
|
53851
53852
|
P.toPrecision = function(sd, rm) {
|
|
53852
|
-
if (sd != null)
|
|
53853
|
+
if (sd != null) intCheck(sd, 1, MAX);
|
|
53853
53854
|
return format(this, sd, rm, 2);
|
|
53854
53855
|
};
|
|
53855
53856
|
P.toString = function(b) {
|
|
@@ -53863,13 +53864,13 @@ var require_bignumber = __commonJS({
|
|
|
53863
53864
|
}
|
|
53864
53865
|
} else {
|
|
53865
53866
|
if (b == null) {
|
|
53866
|
-
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ?
|
|
53867
|
+
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(coeffToString(n.c), e) : toFixedPoint(coeffToString(n.c), e, "0");
|
|
53867
53868
|
} else if (b === 10 && alphabetHasNormalDecimalDigits) {
|
|
53868
|
-
n = round(new
|
|
53869
|
-
str =
|
|
53869
|
+
n = round(new BigNumber3(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);
|
|
53870
|
+
str = toFixedPoint(coeffToString(n.c), n.e, "0");
|
|
53870
53871
|
} else {
|
|
53871
|
-
|
|
53872
|
-
str = convertBase(
|
|
53872
|
+
intCheck(b, 2, ALPHABET.length, "Base");
|
|
53873
|
+
str = convertBase(toFixedPoint(coeffToString(n.c), e, "0"), 10, b, s, true);
|
|
53873
53874
|
}
|
|
53874
53875
|
if (s < 0 && n.c[0]) str = "-" + str;
|
|
53875
53876
|
}
|
|
@@ -53879,25 +53880,25 @@ var require_bignumber = __commonJS({
|
|
|
53879
53880
|
return valueOf(this);
|
|
53880
53881
|
};
|
|
53881
53882
|
P._isBigNumber = true;
|
|
53882
|
-
if (configObject != null)
|
|
53883
|
-
return
|
|
53883
|
+
if (configObject != null) BigNumber3.set(configObject);
|
|
53884
|
+
return BigNumber3;
|
|
53884
53885
|
}
|
|
53885
|
-
function
|
|
53886
|
+
function bitFloor(n) {
|
|
53886
53887
|
var i = n | 0;
|
|
53887
53888
|
return n > 0 || n === i ? i : i - 1;
|
|
53888
53889
|
}
|
|
53889
|
-
function
|
|
53890
|
+
function coeffToString(a) {
|
|
53890
53891
|
var s, z3, i = 1, j = a.length, r = a[0] + "";
|
|
53891
53892
|
for (; i < j; ) {
|
|
53892
53893
|
s = a[i++] + "";
|
|
53893
|
-
z3 =
|
|
53894
|
+
z3 = LOG_BASE - s.length;
|
|
53894
53895
|
for (; z3--; s = "0" + s) ;
|
|
53895
53896
|
r += s;
|
|
53896
53897
|
}
|
|
53897
53898
|
for (j = r.length; r.charCodeAt(--j) === 48; ) ;
|
|
53898
53899
|
return r.slice(0, j + 1 || 1);
|
|
53899
53900
|
}
|
|
53900
|
-
function
|
|
53901
|
+
function compare(x, y) {
|
|
53901
53902
|
var a, b, xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e;
|
|
53902
53903
|
if (!i || !j) return null;
|
|
53903
53904
|
a = xc && !xc[0];
|
|
@@ -53912,19 +53913,19 @@ var require_bignumber = __commonJS({
|
|
|
53912
53913
|
for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;
|
|
53913
53914
|
return k == l ? 0 : k > l ^ a ? 1 : -1;
|
|
53914
53915
|
}
|
|
53915
|
-
function
|
|
53916
|
-
if (n < min || n > max || n !==
|
|
53917
|
-
throw Error(
|
|
53916
|
+
function intCheck(n, min, max, name) {
|
|
53917
|
+
if (n < min || n > max || n !== mathfloor(n)) {
|
|
53918
|
+
throw Error(bignumberError + (name || "Argument") + (typeof n == "number" ? n < min || n > max ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n));
|
|
53918
53919
|
}
|
|
53919
53920
|
}
|
|
53920
|
-
function
|
|
53921
|
+
function isOdd(n) {
|
|
53921
53922
|
var k = n.c.length - 1;
|
|
53922
|
-
return
|
|
53923
|
+
return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;
|
|
53923
53924
|
}
|
|
53924
|
-
function
|
|
53925
|
+
function toExponential(str, e) {
|
|
53925
53926
|
return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e < 0 ? "e" : "e+") + e;
|
|
53926
53927
|
}
|
|
53927
|
-
function
|
|
53928
|
+
function toFixedPoint(str, e, z3) {
|
|
53928
53929
|
var len, zs;
|
|
53929
53930
|
if (e < 0) {
|
|
53930
53931
|
for (zs = z3 + "."; ++e; zs += z3) ;
|
|
@@ -53940,19 +53941,19 @@ var require_bignumber = __commonJS({
|
|
|
53940
53941
|
}
|
|
53941
53942
|
return str;
|
|
53942
53943
|
}
|
|
53943
|
-
|
|
53944
|
-
|
|
53944
|
+
BigNumber2 = clone2();
|
|
53945
|
+
BigNumber2["default"] = BigNumber2.BigNumber = BigNumber2;
|
|
53945
53946
|
if (typeof define == "function" && define.amd) {
|
|
53946
53947
|
define(function() {
|
|
53947
|
-
return
|
|
53948
|
+
return BigNumber2;
|
|
53948
53949
|
});
|
|
53949
53950
|
} else if (typeof module != "undefined" && module.exports) {
|
|
53950
|
-
module.exports =
|
|
53951
|
+
module.exports = BigNumber2;
|
|
53951
53952
|
} else {
|
|
53952
53953
|
if (!globalObject) {
|
|
53953
53954
|
globalObject = typeof self != "undefined" && self ? self : window;
|
|
53954
53955
|
}
|
|
53955
|
-
globalObject.BigNumber =
|
|
53956
|
+
globalObject.BigNumber = BigNumber2;
|
|
53956
53957
|
}
|
|
53957
53958
|
})(exports);
|
|
53958
53959
|
}
|
|
@@ -53961,7 +53962,7 @@ var require_bignumber = __commonJS({
|
|
|
53961
53962
|
// node_modules/json-bigint/lib/stringify.js
|
|
53962
53963
|
var require_stringify = __commonJS({
|
|
53963
53964
|
"node_modules/json-bigint/lib/stringify.js"(exports, module) {
|
|
53964
|
-
var
|
|
53965
|
+
var BigNumber2 = require_bignumber();
|
|
53965
53966
|
var JSON2 = module.exports;
|
|
53966
53967
|
(function() {
|
|
53967
53968
|
"use strict";
|
|
@@ -53986,7 +53987,7 @@ var require_stringify = __commonJS({
|
|
|
53986
53987
|
}) + '"' : '"' + string4 + '"';
|
|
53987
53988
|
}
|
|
53988
53989
|
function str(key, holder) {
|
|
53989
|
-
var i, k, v, length, mind = gap, partial2, value = holder[key],
|
|
53990
|
+
var i, k, v, length, mind = gap, partial2, value = holder[key], isBigNumber2 = value != null && (value instanceof BigNumber2 || BigNumber2.isBigNumber(value));
|
|
53990
53991
|
if (value && typeof value === "object" && typeof value.toJSON === "function") {
|
|
53991
53992
|
value = value.toJSON(key);
|
|
53992
53993
|
}
|
|
@@ -53995,7 +53996,7 @@ var require_stringify = __commonJS({
|
|
|
53995
53996
|
}
|
|
53996
53997
|
switch (typeof value) {
|
|
53997
53998
|
case "string":
|
|
53998
|
-
if (
|
|
53999
|
+
if (isBigNumber2) {
|
|
53999
54000
|
return value;
|
|
54000
54001
|
} else {
|
|
54001
54002
|
return quote(value);
|
|
@@ -54073,7 +54074,7 @@ var require_stringify = __commonJS({
|
|
|
54073
54074
|
// node_modules/json-bigint/lib/parse.js
|
|
54074
54075
|
var require_parse2 = __commonJS({
|
|
54075
54076
|
"node_modules/json-bigint/lib/parse.js"(exports, module) {
|
|
54076
|
-
var
|
|
54077
|
+
var BigNumber2 = null;
|
|
54077
54078
|
var suspectProtoRx = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/;
|
|
54078
54079
|
var suspectConstructorRx = /(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;
|
|
54079
54080
|
var json_parse = function(options) {
|
|
@@ -54173,11 +54174,11 @@ var require_parse2 = __commonJS({
|
|
|
54173
54174
|
if (!isFinite(number5)) {
|
|
54174
54175
|
error49("Bad number");
|
|
54175
54176
|
} else {
|
|
54176
|
-
if (
|
|
54177
|
+
if (BigNumber2 == null) BigNumber2 = require_bignumber();
|
|
54177
54178
|
if (string5.length > 15)
|
|
54178
|
-
return _options.storeAsString ? string5 : _options.useNativeBigInt ? BigInt(string5) : new
|
|
54179
|
+
return _options.storeAsString ? string5 : _options.useNativeBigInt ? BigInt(string5) : new BigNumber2(string5);
|
|
54179
54180
|
else
|
|
54180
|
-
return !_options.alwaysParseAsBig ? number5 : _options.useNativeBigInt ? BigInt(number5) : new
|
|
54181
|
+
return !_options.alwaysParseAsBig ? number5 : _options.useNativeBigInt ? BigInt(number5) : new BigNumber2(number5);
|
|
54181
54182
|
}
|
|
54182
54183
|
}, string4 = function() {
|
|
54183
54184
|
var hex3, i, string5 = "", uffff;
|
|
@@ -61765,14 +61766,14 @@ var require_tar = __commonJS({
|
|
|
61765
61766
|
}
|
|
61766
61767
|
});
|
|
61767
61768
|
|
|
61768
|
-
// node_modules
|
|
61769
|
+
// node_modules/bignumber.js/bignumber.js
|
|
61769
61770
|
var require_bignumber2 = __commonJS({
|
|
61770
|
-
"node_modules
|
|
61771
|
+
"node_modules/bignumber.js/bignumber.js"(exports, module) {
|
|
61771
61772
|
(function(globalObject) {
|
|
61772
61773
|
"use strict";
|
|
61773
|
-
var
|
|
61774
|
-
function
|
|
61775
|
-
var div, convertBase, parseNumeric, P =
|
|
61774
|
+
var BigNumber2, isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE = 1e14, LOG_BASE = 14, MAX_SAFE_INTEGER = 9007199254740991, POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], SQRT_BASE = 1e7, MAX = 1e9;
|
|
61775
|
+
function clone2(configObject) {
|
|
61776
|
+
var div, convertBase, parseNumeric, P = BigNumber3.prototype = { constructor: BigNumber3, toString: null, valueOf: null }, ONE = new BigNumber3(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP = -1e7, MAX_EXP = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = {
|
|
61776
61777
|
prefix: "",
|
|
61777
61778
|
groupSize: 3,
|
|
61778
61779
|
secondaryGroupSize: 0,
|
|
@@ -61783,9 +61784,9 @@ var require_bignumber2 = __commonJS({
|
|
|
61783
61784
|
// non-breaking space
|
|
61784
61785
|
suffix: ""
|
|
61785
61786
|
}, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
61786
|
-
function
|
|
61787
|
+
function BigNumber3(v, b) {
|
|
61787
61788
|
var alphabet, c, caseChanged, e, i, isNum, len, str, x = this;
|
|
61788
|
-
if (!(x instanceof
|
|
61789
|
+
if (!(x instanceof BigNumber3)) return new BigNumber3(v, b);
|
|
61789
61790
|
if (b == null) {
|
|
61790
61791
|
if (v && v._isBigNumber === true) {
|
|
61791
61792
|
x.s = v.s;
|
|
@@ -61813,7 +61814,7 @@ var require_bignumber2 = __commonJS({
|
|
|
61813
61814
|
}
|
|
61814
61815
|
str = String(v);
|
|
61815
61816
|
} else {
|
|
61816
|
-
if (!
|
|
61817
|
+
if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);
|
|
61817
61818
|
x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;
|
|
61818
61819
|
}
|
|
61819
61820
|
if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
|
|
@@ -61825,17 +61826,17 @@ var require_bignumber2 = __commonJS({
|
|
|
61825
61826
|
e = str.length;
|
|
61826
61827
|
}
|
|
61827
61828
|
} else {
|
|
61828
|
-
|
|
61829
|
+
intCheck(b, 2, ALPHABET.length, "Base");
|
|
61829
61830
|
if (b == 10) {
|
|
61830
|
-
x = new
|
|
61831
|
+
x = new BigNumber3(v);
|
|
61831
61832
|
return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
|
|
61832
61833
|
}
|
|
61833
61834
|
str = String(v);
|
|
61834
61835
|
if (isNum = typeof v == "number") {
|
|
61835
61836
|
if (v * 0 != 0) return parseNumeric(x, str, isNum, b);
|
|
61836
61837
|
x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;
|
|
61837
|
-
if (
|
|
61838
|
-
throw Error(
|
|
61838
|
+
if (BigNumber3.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) {
|
|
61839
|
+
throw Error(tooManyDigits + v);
|
|
61839
61840
|
}
|
|
61840
61841
|
} else {
|
|
61841
61842
|
x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
|
|
@@ -61869,8 +61870,8 @@ var require_bignumber2 = __commonJS({
|
|
|
61869
61870
|
for (len = str.length; str.charCodeAt(--len) === 48; ) ;
|
|
61870
61871
|
if (str = str.slice(i, ++len)) {
|
|
61871
61872
|
len -= i;
|
|
61872
|
-
if (isNum &&
|
|
61873
|
-
throw Error(
|
|
61873
|
+
if (isNum && BigNumber3.DEBUG && len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {
|
|
61874
|
+
throw Error(tooManyDigits + x.s * v);
|
|
61874
61875
|
}
|
|
61875
61876
|
if ((e = e - i - 1) > MAX_EXP) {
|
|
61876
61877
|
x.c = x.e = null;
|
|
@@ -61879,14 +61880,14 @@ var require_bignumber2 = __commonJS({
|
|
|
61879
61880
|
} else {
|
|
61880
61881
|
x.e = e;
|
|
61881
61882
|
x.c = [];
|
|
61882
|
-
i = (e + 1) %
|
|
61883
|
-
if (e < 0) i +=
|
|
61883
|
+
i = (e + 1) % LOG_BASE;
|
|
61884
|
+
if (e < 0) i += LOG_BASE;
|
|
61884
61885
|
if (i < len) {
|
|
61885
61886
|
if (i) x.c.push(+str.slice(0, i));
|
|
61886
|
-
for (len -=
|
|
61887
|
-
x.c.push(+str.slice(i, i +=
|
|
61887
|
+
for (len -= LOG_BASE; i < len; ) {
|
|
61888
|
+
x.c.push(+str.slice(i, i += LOG_BASE));
|
|
61888
61889
|
}
|
|
61889
|
-
i =
|
|
61890
|
+
i = LOG_BASE - (str = str.slice(i)).length;
|
|
61890
61891
|
} else {
|
|
61891
61892
|
i -= len;
|
|
61892
61893
|
}
|
|
@@ -61897,56 +61898,56 @@ var require_bignumber2 = __commonJS({
|
|
|
61897
61898
|
x.c = [x.e = 0];
|
|
61898
61899
|
}
|
|
61899
61900
|
}
|
|
61900
|
-
|
|
61901
|
-
|
|
61902
|
-
|
|
61903
|
-
|
|
61904
|
-
|
|
61905
|
-
|
|
61906
|
-
|
|
61907
|
-
|
|
61908
|
-
|
|
61909
|
-
|
|
61910
|
-
|
|
61911
|
-
|
|
61901
|
+
BigNumber3.clone = clone2;
|
|
61902
|
+
BigNumber3.ROUND_UP = 0;
|
|
61903
|
+
BigNumber3.ROUND_DOWN = 1;
|
|
61904
|
+
BigNumber3.ROUND_CEIL = 2;
|
|
61905
|
+
BigNumber3.ROUND_FLOOR = 3;
|
|
61906
|
+
BigNumber3.ROUND_HALF_UP = 4;
|
|
61907
|
+
BigNumber3.ROUND_HALF_DOWN = 5;
|
|
61908
|
+
BigNumber3.ROUND_HALF_EVEN = 6;
|
|
61909
|
+
BigNumber3.ROUND_HALF_CEIL = 7;
|
|
61910
|
+
BigNumber3.ROUND_HALF_FLOOR = 8;
|
|
61911
|
+
BigNumber3.EUCLID = 9;
|
|
61912
|
+
BigNumber3.config = BigNumber3.set = function(obj) {
|
|
61912
61913
|
var p, v;
|
|
61913
61914
|
if (obj != null) {
|
|
61914
61915
|
if (typeof obj == "object") {
|
|
61915
61916
|
if (obj.hasOwnProperty(p = "DECIMAL_PLACES")) {
|
|
61916
61917
|
v = obj[p];
|
|
61917
|
-
|
|
61918
|
+
intCheck(v, 0, MAX, p);
|
|
61918
61919
|
DECIMAL_PLACES = v;
|
|
61919
61920
|
}
|
|
61920
61921
|
if (obj.hasOwnProperty(p = "ROUNDING_MODE")) {
|
|
61921
61922
|
v = obj[p];
|
|
61922
|
-
|
|
61923
|
+
intCheck(v, 0, 8, p);
|
|
61923
61924
|
ROUNDING_MODE = v;
|
|
61924
61925
|
}
|
|
61925
61926
|
if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) {
|
|
61926
61927
|
v = obj[p];
|
|
61927
61928
|
if (v && v.pop) {
|
|
61928
|
-
|
|
61929
|
-
|
|
61929
|
+
intCheck(v[0], -MAX, 0, p);
|
|
61930
|
+
intCheck(v[1], 0, MAX, p);
|
|
61930
61931
|
TO_EXP_NEG = v[0];
|
|
61931
61932
|
TO_EXP_POS = v[1];
|
|
61932
61933
|
} else {
|
|
61933
|
-
|
|
61934
|
+
intCheck(v, -MAX, MAX, p);
|
|
61934
61935
|
TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
|
|
61935
61936
|
}
|
|
61936
61937
|
}
|
|
61937
61938
|
if (obj.hasOwnProperty(p = "RANGE")) {
|
|
61938
61939
|
v = obj[p];
|
|
61939
61940
|
if (v && v.pop) {
|
|
61940
|
-
|
|
61941
|
-
|
|
61941
|
+
intCheck(v[0], -MAX, -1, p);
|
|
61942
|
+
intCheck(v[1], 1, MAX, p);
|
|
61942
61943
|
MIN_EXP = v[0];
|
|
61943
61944
|
MAX_EXP = v[1];
|
|
61944
61945
|
} else {
|
|
61945
|
-
|
|
61946
|
+
intCheck(v, -MAX, MAX, p);
|
|
61946
61947
|
if (v) {
|
|
61947
61948
|
MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
|
|
61948
61949
|
} else {
|
|
61949
|
-
throw Error(
|
|
61950
|
+
throw Error(bignumberError + p + " cannot be zero: " + v);
|
|
61950
61951
|
}
|
|
61951
61952
|
}
|
|
61952
61953
|
}
|
|
@@ -61958,40 +61959,40 @@ var require_bignumber2 = __commonJS({
|
|
|
61958
61959
|
CRYPTO = v;
|
|
61959
61960
|
} else {
|
|
61960
61961
|
CRYPTO = !v;
|
|
61961
|
-
throw Error(
|
|
61962
|
+
throw Error(bignumberError + "crypto unavailable");
|
|
61962
61963
|
}
|
|
61963
61964
|
} else {
|
|
61964
61965
|
CRYPTO = v;
|
|
61965
61966
|
}
|
|
61966
61967
|
} else {
|
|
61967
|
-
throw Error(
|
|
61968
|
+
throw Error(bignumberError + p + " not true or false: " + v);
|
|
61968
61969
|
}
|
|
61969
61970
|
}
|
|
61970
61971
|
if (obj.hasOwnProperty(p = "MODULO_MODE")) {
|
|
61971
61972
|
v = obj[p];
|
|
61972
|
-
|
|
61973
|
+
intCheck(v, 0, 9, p);
|
|
61973
61974
|
MODULO_MODE = v;
|
|
61974
61975
|
}
|
|
61975
61976
|
if (obj.hasOwnProperty(p = "POW_PRECISION")) {
|
|
61976
61977
|
v = obj[p];
|
|
61977
|
-
|
|
61978
|
+
intCheck(v, 0, MAX, p);
|
|
61978
61979
|
POW_PRECISION = v;
|
|
61979
61980
|
}
|
|
61980
61981
|
if (obj.hasOwnProperty(p = "FORMAT")) {
|
|
61981
61982
|
v = obj[p];
|
|
61982
61983
|
if (typeof v == "object") FORMAT = v;
|
|
61983
|
-
else throw Error(
|
|
61984
|
+
else throw Error(bignumberError + p + " not an object: " + v);
|
|
61984
61985
|
}
|
|
61985
61986
|
if (obj.hasOwnProperty(p = "ALPHABET")) {
|
|
61986
61987
|
v = obj[p];
|
|
61987
61988
|
if (typeof v == "string" && !/^.$|[+-.\s]|(.).*\1/.test(v)) {
|
|
61988
61989
|
ALPHABET = v;
|
|
61989
61990
|
} else {
|
|
61990
|
-
throw Error(
|
|
61991
|
+
throw Error(bignumberError + p + " invalid: " + v);
|
|
61991
61992
|
}
|
|
61992
61993
|
}
|
|
61993
61994
|
} else {
|
|
61994
|
-
throw Error(
|
|
61995
|
+
throw Error(bignumberError + "Object expected: " + obj);
|
|
61995
61996
|
}
|
|
61996
61997
|
}
|
|
61997
61998
|
return {
|
|
@@ -62006,22 +62007,22 @@ var require_bignumber2 = __commonJS({
|
|
|
62006
62007
|
ALPHABET
|
|
62007
62008
|
};
|
|
62008
62009
|
};
|
|
62009
|
-
|
|
62010
|
+
BigNumber3.isBigNumber = function(v) {
|
|
62010
62011
|
if (!v || v._isBigNumber !== true) return false;
|
|
62011
|
-
if (!
|
|
62012
|
+
if (!BigNumber3.DEBUG) return true;
|
|
62012
62013
|
var i, n, c = v.c, e = v.e, s = v.s;
|
|
62013
62014
|
out: if ({}.toString.call(c) == "[object Array]") {
|
|
62014
|
-
if ((s === 1 || s === -1) && e >= -
|
|
62015
|
+
if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
|
|
62015
62016
|
if (c[0] === 0) {
|
|
62016
62017
|
if (e === 0 && c.length === 1) return true;
|
|
62017
62018
|
break out;
|
|
62018
62019
|
}
|
|
62019
|
-
i = (e + 1) %
|
|
62020
|
-
if (i < 1) i +=
|
|
62020
|
+
i = (e + 1) % LOG_BASE;
|
|
62021
|
+
if (i < 1) i += LOG_BASE;
|
|
62021
62022
|
if (String(c[0]).length == i) {
|
|
62022
62023
|
for (i = 0; i < c.length; i++) {
|
|
62023
62024
|
n = c[i];
|
|
62024
|
-
if (n < 0 || n >=
|
|
62025
|
+
if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;
|
|
62025
62026
|
}
|
|
62026
62027
|
if (n !== 0) return true;
|
|
62027
62028
|
}
|
|
@@ -62029,26 +62030,26 @@ var require_bignumber2 = __commonJS({
|
|
|
62029
62030
|
} else if (c === null && e === null && (s === null || s === 1 || s === -1)) {
|
|
62030
62031
|
return true;
|
|
62031
62032
|
}
|
|
62032
|
-
throw Error(
|
|
62033
|
+
throw Error(bignumberError + "Invalid BigNumber: " + v);
|
|
62033
62034
|
};
|
|
62034
|
-
|
|
62035
|
+
BigNumber3.maximum = BigNumber3.max = function() {
|
|
62035
62036
|
return maxOrMin(arguments, P.lt);
|
|
62036
62037
|
};
|
|
62037
|
-
|
|
62038
|
+
BigNumber3.minimum = BigNumber3.min = function() {
|
|
62038
62039
|
return maxOrMin(arguments, P.gt);
|
|
62039
62040
|
};
|
|
62040
|
-
|
|
62041
|
+
BigNumber3.random = (function() {
|
|
62041
62042
|
var pow2_53 = 9007199254740992;
|
|
62042
62043
|
var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
|
|
62043
|
-
return
|
|
62044
|
+
return mathfloor(Math.random() * pow2_53);
|
|
62044
62045
|
} : function() {
|
|
62045
62046
|
return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
|
|
62046
62047
|
};
|
|
62047
62048
|
return function(dp) {
|
|
62048
|
-
var a, b, e, k, v, i = 0, c = [], rand = new
|
|
62049
|
+
var a, b, e, k, v, i = 0, c = [], rand = new BigNumber3(ONE);
|
|
62049
62050
|
if (dp == null) dp = DECIMAL_PLACES;
|
|
62050
|
-
else
|
|
62051
|
-
k =
|
|
62051
|
+
else intCheck(dp, 0, MAX);
|
|
62052
|
+
k = mathceil(dp / LOG_BASE);
|
|
62052
62053
|
if (CRYPTO) {
|
|
62053
62054
|
if (crypto.getRandomValues) {
|
|
62054
62055
|
a = crypto.getRandomValues(new Uint32Array(k *= 2));
|
|
@@ -62078,7 +62079,7 @@ var require_bignumber2 = __commonJS({
|
|
|
62078
62079
|
i = k / 7;
|
|
62079
62080
|
} else {
|
|
62080
62081
|
CRYPTO = false;
|
|
62081
|
-
throw Error(
|
|
62082
|
+
throw Error(bignumberError + "crypto unavailable");
|
|
62082
62083
|
}
|
|
62083
62084
|
}
|
|
62084
62085
|
if (!CRYPTO) {
|
|
@@ -62088,26 +62089,26 @@ var require_bignumber2 = __commonJS({
|
|
|
62088
62089
|
}
|
|
62089
62090
|
}
|
|
62090
62091
|
k = c[--i];
|
|
62091
|
-
dp %=
|
|
62092
|
+
dp %= LOG_BASE;
|
|
62092
62093
|
if (k && dp) {
|
|
62093
|
-
v =
|
|
62094
|
-
c[i] =
|
|
62094
|
+
v = POWS_TEN[LOG_BASE - dp];
|
|
62095
|
+
c[i] = mathfloor(k / v) * v;
|
|
62095
62096
|
}
|
|
62096
62097
|
for (; c[i] === 0; c.pop(), i--) ;
|
|
62097
62098
|
if (i < 0) {
|
|
62098
62099
|
c = [e = 0];
|
|
62099
62100
|
} else {
|
|
62100
|
-
for (e = -1; c[0] === 0; c.splice(0, 1), e -=
|
|
62101
|
+
for (e = -1; c[0] === 0; c.splice(0, 1), e -= LOG_BASE) ;
|
|
62101
62102
|
for (i = 1, v = c[0]; v >= 10; v /= 10, i++) ;
|
|
62102
|
-
if (i <
|
|
62103
|
+
if (i < LOG_BASE) e -= LOG_BASE - i;
|
|
62103
62104
|
}
|
|
62104
62105
|
rand.e = e;
|
|
62105
62106
|
rand.c = c;
|
|
62106
62107
|
return rand;
|
|
62107
62108
|
};
|
|
62108
62109
|
})();
|
|
62109
|
-
|
|
62110
|
-
var i = 1, args = arguments, sum = new
|
|
62110
|
+
BigNumber3.sum = function() {
|
|
62111
|
+
var i = 1, args = arguments, sum = new BigNumber3(args[0]);
|
|
62111
62112
|
for (; i < args.length; ) sum = sum.plus(args[i++]);
|
|
62112
62113
|
return sum;
|
|
62113
62114
|
};
|
|
@@ -62134,11 +62135,11 @@ var require_bignumber2 = __commonJS({
|
|
|
62134
62135
|
k = POW_PRECISION;
|
|
62135
62136
|
POW_PRECISION = 0;
|
|
62136
62137
|
str = str.replace(".", "");
|
|
62137
|
-
y = new
|
|
62138
|
+
y = new BigNumber3(baseIn);
|
|
62138
62139
|
x = y.pow(str.length - i);
|
|
62139
62140
|
POW_PRECISION = k;
|
|
62140
62141
|
y.c = toBaseOut(
|
|
62141
|
-
|
|
62142
|
+
toFixedPoint(coeffToString(x.c), x.e, "0"),
|
|
62142
62143
|
10,
|
|
62143
62144
|
baseOut,
|
|
62144
62145
|
decimal
|
|
@@ -62166,7 +62167,7 @@ var require_bignumber2 = __commonJS({
|
|
|
62166
62167
|
r = r || d < 0 || xc[d + 1] != null;
|
|
62167
62168
|
r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : i > k || i == k && (rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == (x.s < 0 ? 8 : 7));
|
|
62168
62169
|
if (d < 1 || !xc[0]) {
|
|
62169
|
-
str = r ?
|
|
62170
|
+
str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);
|
|
62170
62171
|
} else {
|
|
62171
62172
|
xc.length = d;
|
|
62172
62173
|
if (r) {
|
|
@@ -62180,26 +62181,26 @@ var require_bignumber2 = __commonJS({
|
|
|
62180
62181
|
}
|
|
62181
62182
|
for (k = xc.length; !xc[--k]; ) ;
|
|
62182
62183
|
for (i = 0, str = ""; i <= k; str += alphabet.charAt(xc[i++])) ;
|
|
62183
|
-
str =
|
|
62184
|
+
str = toFixedPoint(str, e, alphabet.charAt(0));
|
|
62184
62185
|
}
|
|
62185
62186
|
return str;
|
|
62186
62187
|
};
|
|
62187
62188
|
})();
|
|
62188
62189
|
div = /* @__PURE__ */ (function() {
|
|
62189
62190
|
function multiply(x, k, base) {
|
|
62190
|
-
var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k %
|
|
62191
|
+
var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0;
|
|
62191
62192
|
for (x = x.slice(); i--; ) {
|
|
62192
|
-
xlo = x[i] %
|
|
62193
|
-
xhi = x[i] /
|
|
62193
|
+
xlo = x[i] % SQRT_BASE;
|
|
62194
|
+
xhi = x[i] / SQRT_BASE | 0;
|
|
62194
62195
|
m = khi * xlo + xhi * klo;
|
|
62195
|
-
temp = klo * xlo + m %
|
|
62196
|
-
carry = (temp / base | 0) + (m /
|
|
62196
|
+
temp = klo * xlo + m % SQRT_BASE * SQRT_BASE + carry;
|
|
62197
|
+
carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;
|
|
62197
62198
|
x[i] = temp % base;
|
|
62198
62199
|
}
|
|
62199
62200
|
if (carry) x = [carry].concat(x);
|
|
62200
62201
|
return x;
|
|
62201
62202
|
}
|
|
62202
|
-
function
|
|
62203
|
+
function compare2(a, b, aL, bL) {
|
|
62203
62204
|
var i, cmp;
|
|
62204
62205
|
if (aL != bL) {
|
|
62205
62206
|
cmp = aL > bL ? 1 : -1;
|
|
@@ -62225,7 +62226,7 @@ var require_bignumber2 = __commonJS({
|
|
|
62225
62226
|
return function(x, y, dp, rm, base) {
|
|
62226
62227
|
var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, yL, yz, s = x.s == y.s ? 1 : -1, xc = x.c, yc = y.c;
|
|
62227
62228
|
if (!xc || !xc[0] || !yc || !yc[0]) {
|
|
62228
|
-
return new
|
|
62229
|
+
return new BigNumber3(
|
|
62229
62230
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
62230
62231
|
!x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : (
|
|
62231
62232
|
// Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
|
|
@@ -62233,14 +62234,14 @@ var require_bignumber2 = __commonJS({
|
|
|
62233
62234
|
)
|
|
62234
62235
|
);
|
|
62235
62236
|
}
|
|
62236
|
-
q = new
|
|
62237
|
+
q = new BigNumber3(s);
|
|
62237
62238
|
qc = q.c = [];
|
|
62238
62239
|
e = x.e - y.e;
|
|
62239
62240
|
s = dp + e + 1;
|
|
62240
62241
|
if (!base) {
|
|
62241
|
-
base =
|
|
62242
|
-
e =
|
|
62243
|
-
s = s /
|
|
62242
|
+
base = BASE;
|
|
62243
|
+
e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);
|
|
62244
|
+
s = s / LOG_BASE | 0;
|
|
62244
62245
|
}
|
|
62245
62246
|
for (i = 0; yc[i] == (xc[i] || 0); i++) ;
|
|
62246
62247
|
if (yc[i] > (xc[i] || 0)) e--;
|
|
@@ -62252,7 +62253,7 @@ var require_bignumber2 = __commonJS({
|
|
|
62252
62253
|
yL = yc.length;
|
|
62253
62254
|
i = 0;
|
|
62254
62255
|
s += 2;
|
|
62255
|
-
n =
|
|
62256
|
+
n = mathfloor(base / (yc[0] + 1));
|
|
62256
62257
|
if (n > 1) {
|
|
62257
62258
|
yc = multiply(yc, n, base);
|
|
62258
62259
|
xc = multiply(xc, n, base);
|
|
@@ -62269,17 +62270,17 @@ var require_bignumber2 = __commonJS({
|
|
|
62269
62270
|
if (yc[1] >= base / 2) yc0++;
|
|
62270
62271
|
do {
|
|
62271
62272
|
n = 0;
|
|
62272
|
-
cmp =
|
|
62273
|
+
cmp = compare2(yc, rem, yL, remL);
|
|
62273
62274
|
if (cmp < 0) {
|
|
62274
62275
|
rem0 = rem[0];
|
|
62275
62276
|
if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);
|
|
62276
|
-
n =
|
|
62277
|
+
n = mathfloor(rem0 / yc0);
|
|
62277
62278
|
if (n > 1) {
|
|
62278
62279
|
if (n >= base) n = base - 1;
|
|
62279
62280
|
prod = multiply(yc, n, base);
|
|
62280
62281
|
prodL = prod.length;
|
|
62281
62282
|
remL = rem.length;
|
|
62282
|
-
while (
|
|
62283
|
+
while (compare2(prod, rem, prodL, remL) == 1) {
|
|
62283
62284
|
n--;
|
|
62284
62285
|
subtract(prod, yL < prodL ? yz : yc, prodL, base);
|
|
62285
62286
|
prodL = prod.length;
|
|
@@ -62296,7 +62297,7 @@ var require_bignumber2 = __commonJS({
|
|
|
62296
62297
|
subtract(rem, prod, remL, base);
|
|
62297
62298
|
remL = rem.length;
|
|
62298
62299
|
if (cmp == -1) {
|
|
62299
|
-
while (
|
|
62300
|
+
while (compare2(yc, rem, yL, remL) < 1) {
|
|
62300
62301
|
n++;
|
|
62301
62302
|
subtract(rem, yL < remL ? yz : yc, remL, base);
|
|
62302
62303
|
remL = rem.length;
|
|
@@ -62317,9 +62318,9 @@ var require_bignumber2 = __commonJS({
|
|
|
62317
62318
|
more = rem[0] != null;
|
|
62318
62319
|
if (!qc[0]) qc.splice(0, 1);
|
|
62319
62320
|
}
|
|
62320
|
-
if (base ==
|
|
62321
|
+
if (base == BASE) {
|
|
62321
62322
|
for (i = 1, s = qc[0]; s >= 10; s /= 10, i++) ;
|
|
62322
|
-
round(q, dp + (q.e = i + e *
|
|
62323
|
+
round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);
|
|
62323
62324
|
} else {
|
|
62324
62325
|
q.e = e;
|
|
62325
62326
|
q.r = +more;
|
|
@@ -62330,24 +62331,24 @@ var require_bignumber2 = __commonJS({
|
|
|
62330
62331
|
function format(n, i, rm, id) {
|
|
62331
62332
|
var c0, e, ne, len, str;
|
|
62332
62333
|
if (rm == null) rm = ROUNDING_MODE;
|
|
62333
|
-
else
|
|
62334
|
+
else intCheck(rm, 0, 8);
|
|
62334
62335
|
if (!n.c) return n.toString();
|
|
62335
62336
|
c0 = n.c[0];
|
|
62336
62337
|
ne = n.e;
|
|
62337
62338
|
if (i == null) {
|
|
62338
|
-
str =
|
|
62339
|
-
str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ?
|
|
62339
|
+
str = coeffToString(n.c);
|
|
62340
|
+
str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ? toExponential(str, ne) : toFixedPoint(str, ne, "0");
|
|
62340
62341
|
} else {
|
|
62341
|
-
n = round(new
|
|
62342
|
+
n = round(new BigNumber3(n), i, rm);
|
|
62342
62343
|
e = n.e;
|
|
62343
|
-
str =
|
|
62344
|
+
str = coeffToString(n.c);
|
|
62344
62345
|
len = str.length;
|
|
62345
62346
|
if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {
|
|
62346
62347
|
for (; len < i; str += "0", len++) ;
|
|
62347
|
-
str =
|
|
62348
|
+
str = toExponential(str, e);
|
|
62348
62349
|
} else {
|
|
62349
62350
|
i -= ne;
|
|
62350
|
-
str =
|
|
62351
|
+
str = toFixedPoint(str, e, "0");
|
|
62351
62352
|
if (e + 1 > len) {
|
|
62352
62353
|
if (--i > 0) for (str += "."; i--; str += "0") ;
|
|
62353
62354
|
} else {
|
|
@@ -62362,9 +62363,9 @@ var require_bignumber2 = __commonJS({
|
|
|
62362
62363
|
return n.s < 0 && c0 ? "-" + str : str;
|
|
62363
62364
|
}
|
|
62364
62365
|
function maxOrMin(args, method) {
|
|
62365
|
-
var n, i = 1, m = new
|
|
62366
|
+
var n, i = 1, m = new BigNumber3(args[0]);
|
|
62366
62367
|
for (; i < args.length; i++) {
|
|
62367
|
-
n = new
|
|
62368
|
+
n = new BigNumber3(args[i]);
|
|
62368
62369
|
if (!n.s) {
|
|
62369
62370
|
m = n;
|
|
62370
62371
|
break;
|
|
@@ -62378,7 +62379,7 @@ var require_bignumber2 = __commonJS({
|
|
|
62378
62379
|
var i = 1, j = c.length;
|
|
62379
62380
|
for (; !c[--j]; c.pop()) ;
|
|
62380
62381
|
for (j = c[0]; j >= 10; j /= 10, i++) ;
|
|
62381
|
-
if ((e = i + e *
|
|
62382
|
+
if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {
|
|
62382
62383
|
n.c = n.e = null;
|
|
62383
62384
|
} else if (e < MIN_EXP) {
|
|
62384
62385
|
n.c = [n.e = 0];
|
|
@@ -62404,10 +62405,10 @@ var require_bignumber2 = __commonJS({
|
|
|
62404
62405
|
base = b;
|
|
62405
62406
|
s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1");
|
|
62406
62407
|
}
|
|
62407
|
-
if (str != s) return new
|
|
62408
|
+
if (str != s) return new BigNumber3(s, base);
|
|
62408
62409
|
}
|
|
62409
|
-
if (
|
|
62410
|
-
throw Error(
|
|
62410
|
+
if (BigNumber3.DEBUG) {
|
|
62411
|
+
throw Error(bignumberError + "Not a" + (b ? " base " + b : "") + " number: " + str);
|
|
62411
62412
|
}
|
|
62412
62413
|
x.s = null;
|
|
62413
62414
|
}
|
|
@@ -62415,33 +62416,33 @@ var require_bignumber2 = __commonJS({
|
|
|
62415
62416
|
};
|
|
62416
62417
|
})();
|
|
62417
62418
|
function round(x, sd, rm, r) {
|
|
62418
|
-
var d, i, j, k, n, ni, rd, xc = x.c, pows10 =
|
|
62419
|
+
var d, i, j, k, n, ni, rd, xc = x.c, pows10 = POWS_TEN;
|
|
62419
62420
|
if (xc) {
|
|
62420
62421
|
out: {
|
|
62421
62422
|
for (d = 1, k = xc[0]; k >= 10; k /= 10, d++) ;
|
|
62422
62423
|
i = sd - d;
|
|
62423
62424
|
if (i < 0) {
|
|
62424
|
-
i +=
|
|
62425
|
+
i += LOG_BASE;
|
|
62425
62426
|
j = sd;
|
|
62426
62427
|
n = xc[ni = 0];
|
|
62427
62428
|
rd = n / pows10[d - j - 1] % 10 | 0;
|
|
62428
62429
|
} else {
|
|
62429
|
-
ni =
|
|
62430
|
+
ni = mathceil((i + 1) / LOG_BASE);
|
|
62430
62431
|
if (ni >= xc.length) {
|
|
62431
62432
|
if (r) {
|
|
62432
62433
|
for (; xc.length <= ni; xc.push(0)) ;
|
|
62433
62434
|
n = rd = 0;
|
|
62434
62435
|
d = 1;
|
|
62435
|
-
i %=
|
|
62436
|
-
j = i -
|
|
62436
|
+
i %= LOG_BASE;
|
|
62437
|
+
j = i - LOG_BASE + 1;
|
|
62437
62438
|
} else {
|
|
62438
62439
|
break out;
|
|
62439
62440
|
}
|
|
62440
62441
|
} else {
|
|
62441
62442
|
n = k = xc[ni];
|
|
62442
62443
|
for (d = 1; k >= 10; k /= 10, d++) ;
|
|
62443
|
-
i %=
|
|
62444
|
-
j = i -
|
|
62444
|
+
i %= LOG_BASE;
|
|
62445
|
+
j = i - LOG_BASE + d;
|
|
62445
62446
|
rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0;
|
|
62446
62447
|
}
|
|
62447
62448
|
}
|
|
@@ -62455,7 +62456,7 @@ var require_bignumber2 = __commonJS({
|
|
|
62455
62456
|
xc.length = 0;
|
|
62456
62457
|
if (r) {
|
|
62457
62458
|
sd -= x.e + 1;
|
|
62458
|
-
xc[0] = pows10[(
|
|
62459
|
+
xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];
|
|
62459
62460
|
x.e = -sd || 0;
|
|
62460
62461
|
} else {
|
|
62461
62462
|
xc[0] = x.e = 0;
|
|
@@ -62468,8 +62469,8 @@ var require_bignumber2 = __commonJS({
|
|
|
62468
62469
|
ni--;
|
|
62469
62470
|
} else {
|
|
62470
62471
|
xc.length = ni + 1;
|
|
62471
|
-
k = pows10[
|
|
62472
|
-
xc[ni] = j > 0 ?
|
|
62472
|
+
k = pows10[LOG_BASE - i];
|
|
62473
|
+
xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;
|
|
62473
62474
|
}
|
|
62474
62475
|
if (r) {
|
|
62475
62476
|
for (; ; ) {
|
|
@@ -62479,12 +62480,12 @@ var require_bignumber2 = __commonJS({
|
|
|
62479
62480
|
for (k = 1; j >= 10; j /= 10, k++) ;
|
|
62480
62481
|
if (i != k) {
|
|
62481
62482
|
x.e++;
|
|
62482
|
-
if (xc[0] ==
|
|
62483
|
+
if (xc[0] == BASE) xc[0] = 1;
|
|
62483
62484
|
}
|
|
62484
62485
|
break;
|
|
62485
62486
|
} else {
|
|
62486
62487
|
xc[ni] += k;
|
|
62487
|
-
if (xc[ni] !=
|
|
62488
|
+
if (xc[ni] != BASE) break;
|
|
62488
62489
|
xc[ni--] = 0;
|
|
62489
62490
|
k = 1;
|
|
62490
62491
|
}
|
|
@@ -62503,71 +62504,71 @@ var require_bignumber2 = __commonJS({
|
|
|
62503
62504
|
function valueOf(n) {
|
|
62504
62505
|
var str, e = n.e;
|
|
62505
62506
|
if (e === null) return n.toString();
|
|
62506
|
-
str =
|
|
62507
|
-
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ?
|
|
62507
|
+
str = coeffToString(n.c);
|
|
62508
|
+
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(str, e) : toFixedPoint(str, e, "0");
|
|
62508
62509
|
return n.s < 0 ? "-" + str : str;
|
|
62509
62510
|
}
|
|
62510
62511
|
P.absoluteValue = P.abs = function() {
|
|
62511
|
-
var x = new
|
|
62512
|
+
var x = new BigNumber3(this);
|
|
62512
62513
|
if (x.s < 0) x.s = 1;
|
|
62513
62514
|
return x;
|
|
62514
62515
|
};
|
|
62515
62516
|
P.comparedTo = function(y, b) {
|
|
62516
|
-
return
|
|
62517
|
+
return compare(this, new BigNumber3(y, b));
|
|
62517
62518
|
};
|
|
62518
62519
|
P.decimalPlaces = P.dp = function(dp, rm) {
|
|
62519
62520
|
var c, n, v, x = this;
|
|
62520
62521
|
if (dp != null) {
|
|
62521
|
-
|
|
62522
|
+
intCheck(dp, 0, MAX);
|
|
62522
62523
|
if (rm == null) rm = ROUNDING_MODE;
|
|
62523
|
-
else
|
|
62524
|
-
return round(new
|
|
62524
|
+
else intCheck(rm, 0, 8);
|
|
62525
|
+
return round(new BigNumber3(x), dp + x.e + 1, rm);
|
|
62525
62526
|
}
|
|
62526
62527
|
if (!(c = x.c)) return null;
|
|
62527
|
-
n = ((v = c.length - 1) -
|
|
62528
|
+
n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
|
|
62528
62529
|
if (v = c[v]) for (; v % 10 == 0; v /= 10, n--) ;
|
|
62529
62530
|
if (n < 0) n = 0;
|
|
62530
62531
|
return n;
|
|
62531
62532
|
};
|
|
62532
62533
|
P.dividedBy = P.div = function(y, b) {
|
|
62533
|
-
return div(this, new
|
|
62534
|
+
return div(this, new BigNumber3(y, b), DECIMAL_PLACES, ROUNDING_MODE);
|
|
62534
62535
|
};
|
|
62535
62536
|
P.dividedToIntegerBy = P.idiv = function(y, b) {
|
|
62536
|
-
return div(this, new
|
|
62537
|
+
return div(this, new BigNumber3(y, b), 0, 1);
|
|
62537
62538
|
};
|
|
62538
62539
|
P.exponentiatedBy = P.pow = function(n, m) {
|
|
62539
62540
|
var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, x = this;
|
|
62540
|
-
n = new
|
|
62541
|
+
n = new BigNumber3(n);
|
|
62541
62542
|
if (n.c && !n.isInteger()) {
|
|
62542
|
-
throw Error(
|
|
62543
|
+
throw Error(bignumberError + "Exponent not an integer: " + valueOf(n));
|
|
62543
62544
|
}
|
|
62544
|
-
if (m != null) m = new
|
|
62545
|
+
if (m != null) m = new BigNumber3(m);
|
|
62545
62546
|
nIsBig = n.e > 14;
|
|
62546
62547
|
if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {
|
|
62547
|
-
y = new
|
|
62548
|
+
y = new BigNumber3(Math.pow(+valueOf(x), nIsBig ? 2 - isOdd(n) : +valueOf(n)));
|
|
62548
62549
|
return m ? y.mod(m) : y;
|
|
62549
62550
|
}
|
|
62550
62551
|
nIsNeg = n.s < 0;
|
|
62551
62552
|
if (m) {
|
|
62552
|
-
if (m.c ? !m.c[0] : !m.s) return new
|
|
62553
|
+
if (m.c ? !m.c[0] : !m.s) return new BigNumber3(NaN);
|
|
62553
62554
|
isModExp = !nIsNeg && x.isInteger() && m.isInteger();
|
|
62554
62555
|
if (isModExp) x = x.mod(m);
|
|
62555
62556
|
} else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) {
|
|
62556
|
-
k = x.s < 0 &&
|
|
62557
|
+
k = x.s < 0 && isOdd(n) ? -0 : 0;
|
|
62557
62558
|
if (x.e > -1) k = 1 / k;
|
|
62558
|
-
return new
|
|
62559
|
+
return new BigNumber3(nIsNeg ? 1 / k : k);
|
|
62559
62560
|
} else if (POW_PRECISION) {
|
|
62560
|
-
k =
|
|
62561
|
+
k = mathceil(POW_PRECISION / LOG_BASE + 2);
|
|
62561
62562
|
}
|
|
62562
62563
|
if (nIsBig) {
|
|
62563
|
-
half = new
|
|
62564
|
+
half = new BigNumber3(0.5);
|
|
62564
62565
|
if (nIsNeg) n.s = 1;
|
|
62565
|
-
nIsOdd =
|
|
62566
|
+
nIsOdd = isOdd(n);
|
|
62566
62567
|
} else {
|
|
62567
62568
|
i = Math.abs(+valueOf(n));
|
|
62568
62569
|
nIsOdd = i % 2;
|
|
62569
62570
|
}
|
|
62570
|
-
y = new
|
|
62571
|
+
y = new BigNumber3(ONE);
|
|
62571
62572
|
for (; ; ) {
|
|
62572
62573
|
if (nIsOdd) {
|
|
62573
62574
|
y = y.times(x);
|
|
@@ -62579,14 +62580,14 @@ var require_bignumber2 = __commonJS({
|
|
|
62579
62580
|
}
|
|
62580
62581
|
}
|
|
62581
62582
|
if (i) {
|
|
62582
|
-
i =
|
|
62583
|
+
i = mathfloor(i / 2);
|
|
62583
62584
|
if (i === 0) break;
|
|
62584
62585
|
nIsOdd = i % 2;
|
|
62585
62586
|
} else {
|
|
62586
62587
|
n = n.times(half);
|
|
62587
62588
|
round(n, n.e + 1, 1);
|
|
62588
62589
|
if (n.e > 14) {
|
|
62589
|
-
nIsOdd =
|
|
62590
|
+
nIsOdd = isOdd(n);
|
|
62590
62591
|
} else {
|
|
62591
62592
|
i = +valueOf(n);
|
|
62592
62593
|
if (i === 0) break;
|
|
@@ -62605,31 +62606,31 @@ var require_bignumber2 = __commonJS({
|
|
|
62605
62606
|
return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;
|
|
62606
62607
|
};
|
|
62607
62608
|
P.integerValue = function(rm) {
|
|
62608
|
-
var n = new
|
|
62609
|
+
var n = new BigNumber3(this);
|
|
62609
62610
|
if (rm == null) rm = ROUNDING_MODE;
|
|
62610
|
-
else
|
|
62611
|
+
else intCheck(rm, 0, 8);
|
|
62611
62612
|
return round(n, n.e + 1, rm);
|
|
62612
62613
|
};
|
|
62613
62614
|
P.isEqualTo = P.eq = function(y, b) {
|
|
62614
|
-
return
|
|
62615
|
+
return compare(this, new BigNumber3(y, b)) === 0;
|
|
62615
62616
|
};
|
|
62616
62617
|
P.isFinite = function() {
|
|
62617
62618
|
return !!this.c;
|
|
62618
62619
|
};
|
|
62619
62620
|
P.isGreaterThan = P.gt = function(y, b) {
|
|
62620
|
-
return
|
|
62621
|
+
return compare(this, new BigNumber3(y, b)) > 0;
|
|
62621
62622
|
};
|
|
62622
62623
|
P.isGreaterThanOrEqualTo = P.gte = function(y, b) {
|
|
62623
|
-
return (b =
|
|
62624
|
+
return (b = compare(this, new BigNumber3(y, b))) === 1 || b === 0;
|
|
62624
62625
|
};
|
|
62625
62626
|
P.isInteger = function() {
|
|
62626
|
-
return !!this.c &&
|
|
62627
|
+
return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
|
|
62627
62628
|
};
|
|
62628
62629
|
P.isLessThan = P.lt = function(y, b) {
|
|
62629
|
-
return
|
|
62630
|
+
return compare(this, new BigNumber3(y, b)) < 0;
|
|
62630
62631
|
};
|
|
62631
62632
|
P.isLessThanOrEqualTo = P.lte = function(y, b) {
|
|
62632
|
-
return (b =
|
|
62633
|
+
return (b = compare(this, new BigNumber3(y, b))) === -1 || b === 0;
|
|
62633
62634
|
};
|
|
62634
62635
|
P.isNaN = function() {
|
|
62635
62636
|
return !this.s;
|
|
@@ -62645,25 +62646,25 @@ var require_bignumber2 = __commonJS({
|
|
|
62645
62646
|
};
|
|
62646
62647
|
P.minus = function(y, b) {
|
|
62647
62648
|
var i, j, t, xLTy, x = this, a = x.s;
|
|
62648
|
-
y = new
|
|
62649
|
+
y = new BigNumber3(y, b);
|
|
62649
62650
|
b = y.s;
|
|
62650
|
-
if (!a || !b) return new
|
|
62651
|
+
if (!a || !b) return new BigNumber3(NaN);
|
|
62651
62652
|
if (a != b) {
|
|
62652
62653
|
y.s = -b;
|
|
62653
62654
|
return x.plus(y);
|
|
62654
62655
|
}
|
|
62655
|
-
var xe = x.e /
|
|
62656
|
+
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
62656
62657
|
if (!xe || !ye) {
|
|
62657
|
-
if (!xc || !yc) return xc ? (y.s = -b, y) : new
|
|
62658
|
+
if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber3(yc ? x : NaN);
|
|
62658
62659
|
if (!xc[0] || !yc[0]) {
|
|
62659
|
-
return yc[0] ? (y.s = -b, y) : new
|
|
62660
|
+
return yc[0] ? (y.s = -b, y) : new BigNumber3(xc[0] ? x : (
|
|
62660
62661
|
// IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
|
|
62661
62662
|
ROUNDING_MODE == 3 ? -0 : 0
|
|
62662
62663
|
));
|
|
62663
62664
|
}
|
|
62664
62665
|
}
|
|
62665
|
-
xe =
|
|
62666
|
-
ye =
|
|
62666
|
+
xe = bitFloor(xe);
|
|
62667
|
+
ye = bitFloor(ye);
|
|
62667
62668
|
xc = xc.slice();
|
|
62668
62669
|
if (a = xe - ye) {
|
|
62669
62670
|
if (xLTy = a < 0) {
|
|
@@ -62688,12 +62689,12 @@ var require_bignumber2 = __commonJS({
|
|
|
62688
62689
|
if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s;
|
|
62689
62690
|
b = (j = yc.length) - (i = xc.length);
|
|
62690
62691
|
if (b > 0) for (; b--; xc[i++] = 0) ;
|
|
62691
|
-
b =
|
|
62692
|
+
b = BASE - 1;
|
|
62692
62693
|
for (; j > a; ) {
|
|
62693
62694
|
if (xc[--j] < yc[j]) {
|
|
62694
62695
|
for (i = j; i && !xc[--i]; xc[i] = b) ;
|
|
62695
62696
|
--xc[i];
|
|
62696
|
-
xc[j] +=
|
|
62697
|
+
xc[j] += BASE;
|
|
62697
62698
|
}
|
|
62698
62699
|
xc[j] -= yc[j];
|
|
62699
62700
|
}
|
|
@@ -62707,11 +62708,11 @@ var require_bignumber2 = __commonJS({
|
|
|
62707
62708
|
};
|
|
62708
62709
|
P.modulo = P.mod = function(y, b) {
|
|
62709
62710
|
var q, s, x = this;
|
|
62710
|
-
y = new
|
|
62711
|
+
y = new BigNumber3(y, b);
|
|
62711
62712
|
if (!x.c || !y.s || y.c && !y.c[0]) {
|
|
62712
|
-
return new
|
|
62713
|
+
return new BigNumber3(NaN);
|
|
62713
62714
|
} else if (!y.c || x.c && !x.c[0]) {
|
|
62714
|
-
return new
|
|
62715
|
+
return new BigNumber3(x);
|
|
62715
62716
|
}
|
|
62716
62717
|
if (MODULO_MODE == 9) {
|
|
62717
62718
|
s = y.s;
|
|
@@ -62727,7 +62728,7 @@ var require_bignumber2 = __commonJS({
|
|
|
62727
62728
|
return y;
|
|
62728
62729
|
};
|
|
62729
62730
|
P.multipliedBy = P.times = function(y, b) {
|
|
62730
|
-
var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x = this, xc = x.c, yc = (y = new
|
|
62731
|
+
var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x = this, xc = x.c, yc = (y = new BigNumber3(y, b)).c;
|
|
62731
62732
|
if (!xc || !yc || !xc[0] || !yc[0]) {
|
|
62732
62733
|
if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
|
|
62733
62734
|
y.c = y.e = y.s = null;
|
|
@@ -62742,14 +62743,14 @@ var require_bignumber2 = __commonJS({
|
|
|
62742
62743
|
}
|
|
62743
62744
|
return y;
|
|
62744
62745
|
}
|
|
62745
|
-
e =
|
|
62746
|
+
e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);
|
|
62746
62747
|
y.s *= x.s;
|
|
62747
62748
|
xcL = xc.length;
|
|
62748
62749
|
ycL = yc.length;
|
|
62749
62750
|
if (xcL < ycL) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i;
|
|
62750
62751
|
for (i = xcL + ycL, zc = []; i--; zc.push(0)) ;
|
|
62751
|
-
base =
|
|
62752
|
-
sqrtBase =
|
|
62752
|
+
base = BASE;
|
|
62753
|
+
sqrtBase = SQRT_BASE;
|
|
62753
62754
|
for (i = ycL; --i >= 0; ) {
|
|
62754
62755
|
c = 0;
|
|
62755
62756
|
ylo = yc[i] % sqrtBase;
|
|
@@ -62772,26 +62773,26 @@ var require_bignumber2 = __commonJS({
|
|
|
62772
62773
|
return normalise(y, zc, e);
|
|
62773
62774
|
};
|
|
62774
62775
|
P.negated = function() {
|
|
62775
|
-
var x = new
|
|
62776
|
+
var x = new BigNumber3(this);
|
|
62776
62777
|
x.s = -x.s || null;
|
|
62777
62778
|
return x;
|
|
62778
62779
|
};
|
|
62779
62780
|
P.plus = function(y, b) {
|
|
62780
62781
|
var t, x = this, a = x.s;
|
|
62781
|
-
y = new
|
|
62782
|
+
y = new BigNumber3(y, b);
|
|
62782
62783
|
b = y.s;
|
|
62783
|
-
if (!a || !b) return new
|
|
62784
|
+
if (!a || !b) return new BigNumber3(NaN);
|
|
62784
62785
|
if (a != b) {
|
|
62785
62786
|
y.s = -b;
|
|
62786
62787
|
return x.minus(y);
|
|
62787
62788
|
}
|
|
62788
|
-
var xe = x.e /
|
|
62789
|
+
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
62789
62790
|
if (!xe || !ye) {
|
|
62790
|
-
if (!xc || !yc) return new
|
|
62791
|
-
if (!xc[0] || !yc[0]) return yc[0] ? y : new
|
|
62791
|
+
if (!xc || !yc) return new BigNumber3(a / 0);
|
|
62792
|
+
if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber3(xc[0] ? x : a * 0);
|
|
62792
62793
|
}
|
|
62793
|
-
xe =
|
|
62794
|
-
ye =
|
|
62794
|
+
xe = bitFloor(xe);
|
|
62795
|
+
ye = bitFloor(ye);
|
|
62795
62796
|
xc = xc.slice();
|
|
62796
62797
|
if (a = xe - ye) {
|
|
62797
62798
|
if (a > 0) {
|
|
@@ -62809,8 +62810,8 @@ var require_bignumber2 = __commonJS({
|
|
|
62809
62810
|
b = yc.length;
|
|
62810
62811
|
if (a - b < 0) t = yc, yc = xc, xc = t, b = a;
|
|
62811
62812
|
for (a = 0; b; ) {
|
|
62812
|
-
a = (xc[--b] = xc[b] + yc[b] + a) /
|
|
62813
|
-
xc[b] =
|
|
62813
|
+
a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;
|
|
62814
|
+
xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;
|
|
62814
62815
|
}
|
|
62815
62816
|
if (a) {
|
|
62816
62817
|
xc = [a].concat(xc);
|
|
@@ -62821,14 +62822,14 @@ var require_bignumber2 = __commonJS({
|
|
|
62821
62822
|
P.precision = P.sd = function(sd, rm) {
|
|
62822
62823
|
var c, n, v, x = this;
|
|
62823
62824
|
if (sd != null && sd !== !!sd) {
|
|
62824
|
-
|
|
62825
|
+
intCheck(sd, 1, MAX);
|
|
62825
62826
|
if (rm == null) rm = ROUNDING_MODE;
|
|
62826
|
-
else
|
|
62827
|
-
return round(new
|
|
62827
|
+
else intCheck(rm, 0, 8);
|
|
62828
|
+
return round(new BigNumber3(x), sd, rm);
|
|
62828
62829
|
}
|
|
62829
62830
|
if (!(c = x.c)) return null;
|
|
62830
62831
|
v = c.length - 1;
|
|
62831
|
-
n = v *
|
|
62832
|
+
n = v * LOG_BASE + 1;
|
|
62832
62833
|
if (v = c[v]) {
|
|
62833
62834
|
for (; v % 10 == 0; v /= 10, n--) ;
|
|
62834
62835
|
for (v = c[0]; v >= 10; v /= 10, n++) ;
|
|
@@ -62837,29 +62838,29 @@ var require_bignumber2 = __commonJS({
|
|
|
62837
62838
|
return n;
|
|
62838
62839
|
};
|
|
62839
62840
|
P.shiftedBy = function(k) {
|
|
62840
|
-
|
|
62841
|
+
intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
|
|
62841
62842
|
return this.times("1e" + k);
|
|
62842
62843
|
};
|
|
62843
62844
|
P.squareRoot = P.sqrt = function() {
|
|
62844
|
-
var m, n, r, rep, t, x = this, c = x.c, s = x.s, e = x.e, dp = DECIMAL_PLACES + 4, half = new
|
|
62845
|
+
var m, n, r, rep, t, x = this, c = x.c, s = x.s, e = x.e, dp = DECIMAL_PLACES + 4, half = new BigNumber3("0.5");
|
|
62845
62846
|
if (s !== 1 || !c || !c[0]) {
|
|
62846
|
-
return new
|
|
62847
|
+
return new BigNumber3(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);
|
|
62847
62848
|
}
|
|
62848
62849
|
s = Math.sqrt(+valueOf(x));
|
|
62849
62850
|
if (s == 0 || s == 1 / 0) {
|
|
62850
|
-
n =
|
|
62851
|
+
n = coeffToString(c);
|
|
62851
62852
|
if ((n.length + e) % 2 == 0) n += "0";
|
|
62852
62853
|
s = Math.sqrt(+n);
|
|
62853
|
-
e =
|
|
62854
|
+
e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);
|
|
62854
62855
|
if (s == 1 / 0) {
|
|
62855
62856
|
n = "1e" + e;
|
|
62856
62857
|
} else {
|
|
62857
62858
|
n = s.toExponential();
|
|
62858
62859
|
n = n.slice(0, n.indexOf("e") + 1) + e;
|
|
62859
62860
|
}
|
|
62860
|
-
r = new
|
|
62861
|
+
r = new BigNumber3(n);
|
|
62861
62862
|
} else {
|
|
62862
|
-
r = new
|
|
62863
|
+
r = new BigNumber3(s + "");
|
|
62863
62864
|
}
|
|
62864
62865
|
if (r.c[0]) {
|
|
62865
62866
|
e = r.e;
|
|
@@ -62868,7 +62869,7 @@ var require_bignumber2 = __commonJS({
|
|
|
62868
62869
|
for (; ; ) {
|
|
62869
62870
|
t = r;
|
|
62870
62871
|
r = half.times(t.plus(div(x, t, dp, 1)));
|
|
62871
|
-
if (
|
|
62872
|
+
if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {
|
|
62872
62873
|
if (r.e < e) --s;
|
|
62873
62874
|
n = n.slice(s - 3, s + 1);
|
|
62874
62875
|
if (n == "9999" || !rep && n == "4999") {
|
|
@@ -62896,14 +62897,14 @@ var require_bignumber2 = __commonJS({
|
|
|
62896
62897
|
};
|
|
62897
62898
|
P.toExponential = function(dp, rm) {
|
|
62898
62899
|
if (dp != null) {
|
|
62899
|
-
|
|
62900
|
+
intCheck(dp, 0, MAX);
|
|
62900
62901
|
dp++;
|
|
62901
62902
|
}
|
|
62902
62903
|
return format(this, dp, rm, 1);
|
|
62903
62904
|
};
|
|
62904
62905
|
P.toFixed = function(dp, rm) {
|
|
62905
62906
|
if (dp != null) {
|
|
62906
|
-
|
|
62907
|
+
intCheck(dp, 0, MAX);
|
|
62907
62908
|
dp = dp + this.e + 1;
|
|
62908
62909
|
}
|
|
62909
62910
|
return format(this, dp, rm);
|
|
@@ -62921,7 +62922,7 @@ var require_bignumber2 = __commonJS({
|
|
|
62921
62922
|
format2 = FORMAT;
|
|
62922
62923
|
}
|
|
62923
62924
|
} else if (typeof format2 != "object") {
|
|
62924
|
-
throw Error(
|
|
62925
|
+
throw Error(bignumberError + "Argument not an object: " + format2);
|
|
62925
62926
|
}
|
|
62926
62927
|
str = x.toFixed(dp, rm);
|
|
62927
62928
|
if (x.c) {
|
|
@@ -62944,22 +62945,22 @@ var require_bignumber2 = __commonJS({
|
|
|
62944
62945
|
P.toFraction = function(md) {
|
|
62945
62946
|
var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, x = this, xc = x.c;
|
|
62946
62947
|
if (md != null) {
|
|
62947
|
-
n = new
|
|
62948
|
+
n = new BigNumber3(md);
|
|
62948
62949
|
if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
|
|
62949
|
-
throw Error(
|
|
62950
|
+
throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n));
|
|
62950
62951
|
}
|
|
62951
62952
|
}
|
|
62952
|
-
if (!xc) return new
|
|
62953
|
-
d = new
|
|
62954
|
-
n1 = d0 = new
|
|
62955
|
-
d1 = n0 = new
|
|
62956
|
-
s =
|
|
62953
|
+
if (!xc) return new BigNumber3(x);
|
|
62954
|
+
d = new BigNumber3(ONE);
|
|
62955
|
+
n1 = d0 = new BigNumber3(ONE);
|
|
62956
|
+
d1 = n0 = new BigNumber3(ONE);
|
|
62957
|
+
s = coeffToString(xc);
|
|
62957
62958
|
e = d.e = s.length - x.e - 1;
|
|
62958
|
-
d.c[0] =
|
|
62959
|
+
d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];
|
|
62959
62960
|
md = !md || n.comparedTo(d) > 0 ? e > 0 ? d : n1 : n;
|
|
62960
62961
|
exp = MAX_EXP;
|
|
62961
62962
|
MAX_EXP = 1 / 0;
|
|
62962
|
-
n = new
|
|
62963
|
+
n = new BigNumber3(s);
|
|
62963
62964
|
n0.c[0] = 0;
|
|
62964
62965
|
for (; ; ) {
|
|
62965
62966
|
q = div(n, d, 0, 1);
|
|
@@ -62987,7 +62988,7 @@ var require_bignumber2 = __commonJS({
|
|
|
62987
62988
|
return +valueOf(this);
|
|
62988
62989
|
};
|
|
62989
62990
|
P.toPrecision = function(sd, rm) {
|
|
62990
|
-
if (sd != null)
|
|
62991
|
+
if (sd != null) intCheck(sd, 1, MAX);
|
|
62991
62992
|
return format(this, sd, rm, 2);
|
|
62992
62993
|
};
|
|
62993
62994
|
P.toString = function(b) {
|
|
@@ -63001,13 +63002,13 @@ var require_bignumber2 = __commonJS({
|
|
|
63001
63002
|
}
|
|
63002
63003
|
} else {
|
|
63003
63004
|
if (b == null) {
|
|
63004
|
-
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ?
|
|
63005
|
+
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(coeffToString(n.c), e) : toFixedPoint(coeffToString(n.c), e, "0");
|
|
63005
63006
|
} else if (b === 10) {
|
|
63006
|
-
n = round(new
|
|
63007
|
-
str =
|
|
63007
|
+
n = round(new BigNumber3(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);
|
|
63008
|
+
str = toFixedPoint(coeffToString(n.c), n.e, "0");
|
|
63008
63009
|
} else {
|
|
63009
|
-
|
|
63010
|
-
str = convertBase(
|
|
63010
|
+
intCheck(b, 2, ALPHABET.length, "Base");
|
|
63011
|
+
str = convertBase(toFixedPoint(coeffToString(n.c), e, "0"), 10, b, s, true);
|
|
63011
63012
|
}
|
|
63012
63013
|
if (s < 0 && n.c[0]) str = "-" + str;
|
|
63013
63014
|
}
|
|
@@ -63017,25 +63018,25 @@ var require_bignumber2 = __commonJS({
|
|
|
63017
63018
|
return valueOf(this);
|
|
63018
63019
|
};
|
|
63019
63020
|
P._isBigNumber = true;
|
|
63020
|
-
if (configObject != null)
|
|
63021
|
-
return
|
|
63021
|
+
if (configObject != null) BigNumber3.set(configObject);
|
|
63022
|
+
return BigNumber3;
|
|
63022
63023
|
}
|
|
63023
|
-
function
|
|
63024
|
+
function bitFloor(n) {
|
|
63024
63025
|
var i = n | 0;
|
|
63025
63026
|
return n > 0 || n === i ? i : i - 1;
|
|
63026
63027
|
}
|
|
63027
|
-
function
|
|
63028
|
+
function coeffToString(a) {
|
|
63028
63029
|
var s, z3, i = 1, j = a.length, r = a[0] + "";
|
|
63029
63030
|
for (; i < j; ) {
|
|
63030
63031
|
s = a[i++] + "";
|
|
63031
|
-
z3 =
|
|
63032
|
+
z3 = LOG_BASE - s.length;
|
|
63032
63033
|
for (; z3--; s = "0" + s) ;
|
|
63033
63034
|
r += s;
|
|
63034
63035
|
}
|
|
63035
63036
|
for (j = r.length; r.charCodeAt(--j) === 48; ) ;
|
|
63036
63037
|
return r.slice(0, j + 1 || 1);
|
|
63037
63038
|
}
|
|
63038
|
-
function
|
|
63039
|
+
function compare(x, y) {
|
|
63039
63040
|
var a, b, xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e;
|
|
63040
63041
|
if (!i || !j) return null;
|
|
63041
63042
|
a = xc && !xc[0];
|
|
@@ -63050,19 +63051,19 @@ var require_bignumber2 = __commonJS({
|
|
|
63050
63051
|
for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;
|
|
63051
63052
|
return k == l ? 0 : k > l ^ a ? 1 : -1;
|
|
63052
63053
|
}
|
|
63053
|
-
function
|
|
63054
|
-
if (n < min || n > max || n !==
|
|
63055
|
-
throw Error(
|
|
63054
|
+
function intCheck(n, min, max, name) {
|
|
63055
|
+
if (n < min || n > max || n !== mathfloor(n)) {
|
|
63056
|
+
throw Error(bignumberError + (name || "Argument") + (typeof n == "number" ? n < min || n > max ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n));
|
|
63056
63057
|
}
|
|
63057
63058
|
}
|
|
63058
|
-
function
|
|
63059
|
+
function isOdd(n) {
|
|
63059
63060
|
var k = n.c.length - 1;
|
|
63060
|
-
return
|
|
63061
|
+
return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;
|
|
63061
63062
|
}
|
|
63062
|
-
function
|
|
63063
|
+
function toExponential(str, e) {
|
|
63063
63064
|
return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e < 0 ? "e" : "e+") + e;
|
|
63064
63065
|
}
|
|
63065
|
-
function
|
|
63066
|
+
function toFixedPoint(str, e, z3) {
|
|
63066
63067
|
var len, zs;
|
|
63067
63068
|
if (e < 0) {
|
|
63068
63069
|
for (zs = z3 + "."; ++e; zs += z3) ;
|
|
@@ -63078,19 +63079,19 @@ var require_bignumber2 = __commonJS({
|
|
|
63078
63079
|
}
|
|
63079
63080
|
return str;
|
|
63080
63081
|
}
|
|
63081
|
-
|
|
63082
|
-
|
|
63082
|
+
BigNumber2 = clone2();
|
|
63083
|
+
BigNumber2["default"] = BigNumber2.BigNumber = BigNumber2;
|
|
63083
63084
|
if (typeof define == "function" && define.amd) {
|
|
63084
63085
|
define(function() {
|
|
63085
|
-
return
|
|
63086
|
+
return BigNumber2;
|
|
63086
63087
|
});
|
|
63087
63088
|
} else if (typeof module != "undefined" && module.exports) {
|
|
63088
|
-
module.exports =
|
|
63089
|
+
module.exports = BigNumber2;
|
|
63089
63090
|
} else {
|
|
63090
63091
|
if (!globalObject) {
|
|
63091
63092
|
globalObject = typeof self != "undefined" && self ? self : window;
|
|
63092
63093
|
}
|
|
63093
|
-
globalObject.BigNumber =
|
|
63094
|
+
globalObject.BigNumber = BigNumber2;
|
|
63094
63095
|
}
|
|
63095
63096
|
})(exports);
|
|
63096
63097
|
}
|
|
@@ -70687,7 +70688,7 @@ var id_default = ID;
|
|
|
70687
70688
|
// lib/constants.ts
|
|
70688
70689
|
var SDK_TITLE = "Appwrite";
|
|
70689
70690
|
var SDK_TITLE_LOWER = "appwrite";
|
|
70690
|
-
var SDK_VERSION = "13.
|
|
70691
|
+
var SDK_VERSION = "13.4.0";
|
|
70691
70692
|
var SDK_LOGO = "\n _ _ _ ___ __ _____\n /_\\ _ __ _ ____ ___ __(_) |_ ___ / __\\ / / \\_ \\\n //_\\\\| '_ \\| '_ \\ \\ /\\ / / '__| | __/ _ \\ / / / / / /\\/\n / _ \\ |_) | |_) \\ V V /| | | | || __/ / /___/ /___/\\/ /_\n \\_/ \\_/ .__/| .__/ \\_/\\_/ |_| |_|\\__\\___| \\____/\\____/\\____/\n |_| |_|\n\n";
|
|
70692
70693
|
var EXECUTABLE_NAME = "appwrite";
|
|
70693
70694
|
var NPM_PACKAGE_NAME = "appwrite-cli";
|
|
@@ -84943,1357 +84944,15 @@ function filterBySchema(data, schema) {
|
|
|
84943
84944
|
|
|
84944
84945
|
// lib/json.ts
|
|
84945
84946
|
var import_json_bigint = __toESM(require_json_bigint(), 1);
|
|
84946
|
-
|
|
84947
|
-
// node_modules/bignumber.js/bignumber.mjs
|
|
84948
|
-
var isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;
|
|
84949
|
-
var mathceil = Math.ceil;
|
|
84950
|
-
var mathfloor = Math.floor;
|
|
84951
|
-
var bignumberError = "[BigNumber Error] ";
|
|
84952
|
-
var tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ";
|
|
84953
|
-
var BASE = 1e14;
|
|
84954
|
-
var LOG_BASE = 14;
|
|
84955
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
84956
|
-
var POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13];
|
|
84957
|
-
var SQRT_BASE = 1e7;
|
|
84958
|
-
var MAX = 1e9;
|
|
84959
|
-
function clone2(configObject) {
|
|
84960
|
-
var div, convertBase, parseNumeric, P = BigNumber3.prototype = { constructor: BigNumber3, toString: null, valueOf: null }, ONE = new BigNumber3(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP = -1e7, MAX_EXP = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = {
|
|
84961
|
-
prefix: "",
|
|
84962
|
-
groupSize: 3,
|
|
84963
|
-
secondaryGroupSize: 0,
|
|
84964
|
-
groupSeparator: ",",
|
|
84965
|
-
decimalSeparator: ".",
|
|
84966
|
-
fractionGroupSize: 0,
|
|
84967
|
-
fractionGroupSeparator: "\xA0",
|
|
84968
|
-
// non-breaking space
|
|
84969
|
-
suffix: ""
|
|
84970
|
-
}, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true;
|
|
84971
|
-
function BigNumber3(v, b) {
|
|
84972
|
-
var alphabet, c, caseChanged, e, i, isNum, len, str, x = this;
|
|
84973
|
-
if (!(x instanceof BigNumber3)) return new BigNumber3(v, b);
|
|
84974
|
-
if (b == null) {
|
|
84975
|
-
if (v && v._isBigNumber === true) {
|
|
84976
|
-
x.s = v.s;
|
|
84977
|
-
if (!v.c || v.e > MAX_EXP) {
|
|
84978
|
-
x.c = x.e = null;
|
|
84979
|
-
} else if (v.e < MIN_EXP) {
|
|
84980
|
-
x.c = [x.e = 0];
|
|
84981
|
-
} else {
|
|
84982
|
-
x.e = v.e;
|
|
84983
|
-
x.c = v.c.slice();
|
|
84984
|
-
}
|
|
84985
|
-
return;
|
|
84986
|
-
}
|
|
84987
|
-
if ((isNum = typeof v == "number") && v * 0 == 0) {
|
|
84988
|
-
x.s = 1 / v < 0 ? (v = -v, -1) : 1;
|
|
84989
|
-
if (v === ~~v) {
|
|
84990
|
-
for (e = 0, i = v; i >= 10; i /= 10, e++) ;
|
|
84991
|
-
if (e > MAX_EXP) {
|
|
84992
|
-
x.c = x.e = null;
|
|
84993
|
-
} else {
|
|
84994
|
-
x.e = e;
|
|
84995
|
-
x.c = [v];
|
|
84996
|
-
}
|
|
84997
|
-
return;
|
|
84998
|
-
}
|
|
84999
|
-
str = String(v);
|
|
85000
|
-
} else {
|
|
85001
|
-
if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);
|
|
85002
|
-
x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;
|
|
85003
|
-
}
|
|
85004
|
-
if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
|
|
85005
|
-
if ((i = str.search(/e/i)) > 0) {
|
|
85006
|
-
if (e < 0) e = i;
|
|
85007
|
-
e += +str.slice(i + 1);
|
|
85008
|
-
str = str.substring(0, i);
|
|
85009
|
-
} else if (e < 0) {
|
|
85010
|
-
e = str.length;
|
|
85011
|
-
}
|
|
85012
|
-
} else {
|
|
85013
|
-
intCheck(b, 2, ALPHABET.length, "Base");
|
|
85014
|
-
if (b == 10 && alphabetHasNormalDecimalDigits) {
|
|
85015
|
-
x = new BigNumber3(v);
|
|
85016
|
-
return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
|
|
85017
|
-
}
|
|
85018
|
-
str = String(v);
|
|
85019
|
-
if (isNum = typeof v == "number") {
|
|
85020
|
-
if (v * 0 != 0) return parseNumeric(x, str, isNum, b);
|
|
85021
|
-
x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;
|
|
85022
|
-
if (BigNumber3.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) {
|
|
85023
|
-
throw Error(tooManyDigits + v);
|
|
85024
|
-
}
|
|
85025
|
-
} else {
|
|
85026
|
-
x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
|
|
85027
|
-
}
|
|
85028
|
-
alphabet = ALPHABET.slice(0, b);
|
|
85029
|
-
e = i = 0;
|
|
85030
|
-
for (len = str.length; i < len; i++) {
|
|
85031
|
-
if (alphabet.indexOf(c = str.charAt(i)) < 0) {
|
|
85032
|
-
if (c == ".") {
|
|
85033
|
-
if (i > e) {
|
|
85034
|
-
e = len;
|
|
85035
|
-
continue;
|
|
85036
|
-
}
|
|
85037
|
-
} else if (!caseChanged) {
|
|
85038
|
-
if (str == str.toUpperCase() && (str = str.toLowerCase()) || str == str.toLowerCase() && (str = str.toUpperCase())) {
|
|
85039
|
-
caseChanged = true;
|
|
85040
|
-
i = -1;
|
|
85041
|
-
e = 0;
|
|
85042
|
-
continue;
|
|
85043
|
-
}
|
|
85044
|
-
}
|
|
85045
|
-
return parseNumeric(x, String(v), isNum, b);
|
|
85046
|
-
}
|
|
85047
|
-
}
|
|
85048
|
-
isNum = false;
|
|
85049
|
-
str = convertBase(str, b, 10, x.s);
|
|
85050
|
-
if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
|
|
85051
|
-
else e = str.length;
|
|
85052
|
-
}
|
|
85053
|
-
for (i = 0; str.charCodeAt(i) === 48; i++) ;
|
|
85054
|
-
for (len = str.length; str.charCodeAt(--len) === 48; ) ;
|
|
85055
|
-
if (str = str.slice(i, ++len)) {
|
|
85056
|
-
len -= i;
|
|
85057
|
-
if (isNum && BigNumber3.DEBUG && len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {
|
|
85058
|
-
throw Error(tooManyDigits + x.s * v);
|
|
85059
|
-
}
|
|
85060
|
-
if ((e = e - i - 1) > MAX_EXP) {
|
|
85061
|
-
x.c = x.e = null;
|
|
85062
|
-
} else if (e < MIN_EXP) {
|
|
85063
|
-
x.c = [x.e = 0];
|
|
85064
|
-
} else {
|
|
85065
|
-
x.e = e;
|
|
85066
|
-
x.c = [];
|
|
85067
|
-
i = (e + 1) % LOG_BASE;
|
|
85068
|
-
if (e < 0) i += LOG_BASE;
|
|
85069
|
-
if (i < len) {
|
|
85070
|
-
if (i) x.c.push(+str.slice(0, i));
|
|
85071
|
-
for (len -= LOG_BASE; i < len; ) {
|
|
85072
|
-
x.c.push(+str.slice(i, i += LOG_BASE));
|
|
85073
|
-
}
|
|
85074
|
-
i = LOG_BASE - (str = str.slice(i)).length;
|
|
85075
|
-
} else {
|
|
85076
|
-
i -= len;
|
|
85077
|
-
}
|
|
85078
|
-
for (; i--; str += "0") ;
|
|
85079
|
-
x.c.push(+str);
|
|
85080
|
-
}
|
|
85081
|
-
} else {
|
|
85082
|
-
x.c = [x.e = 0];
|
|
85083
|
-
}
|
|
85084
|
-
}
|
|
85085
|
-
BigNumber3.clone = clone2;
|
|
85086
|
-
BigNumber3.ROUND_UP = 0;
|
|
85087
|
-
BigNumber3.ROUND_DOWN = 1;
|
|
85088
|
-
BigNumber3.ROUND_CEIL = 2;
|
|
85089
|
-
BigNumber3.ROUND_FLOOR = 3;
|
|
85090
|
-
BigNumber3.ROUND_HALF_UP = 4;
|
|
85091
|
-
BigNumber3.ROUND_HALF_DOWN = 5;
|
|
85092
|
-
BigNumber3.ROUND_HALF_EVEN = 6;
|
|
85093
|
-
BigNumber3.ROUND_HALF_CEIL = 7;
|
|
85094
|
-
BigNumber3.ROUND_HALF_FLOOR = 8;
|
|
85095
|
-
BigNumber3.EUCLID = 9;
|
|
85096
|
-
BigNumber3.config = BigNumber3.set = function(obj) {
|
|
85097
|
-
var p, v;
|
|
85098
|
-
if (obj != null) {
|
|
85099
|
-
if (typeof obj == "object") {
|
|
85100
|
-
if (obj.hasOwnProperty(p = "DECIMAL_PLACES")) {
|
|
85101
|
-
v = obj[p];
|
|
85102
|
-
intCheck(v, 0, MAX, p);
|
|
85103
|
-
DECIMAL_PLACES = v;
|
|
85104
|
-
}
|
|
85105
|
-
if (obj.hasOwnProperty(p = "ROUNDING_MODE")) {
|
|
85106
|
-
v = obj[p];
|
|
85107
|
-
intCheck(v, 0, 8, p);
|
|
85108
|
-
ROUNDING_MODE = v;
|
|
85109
|
-
}
|
|
85110
|
-
if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) {
|
|
85111
|
-
v = obj[p];
|
|
85112
|
-
if (v && v.pop) {
|
|
85113
|
-
intCheck(v[0], -MAX, 0, p);
|
|
85114
|
-
intCheck(v[1], 0, MAX, p);
|
|
85115
|
-
TO_EXP_NEG = v[0];
|
|
85116
|
-
TO_EXP_POS = v[1];
|
|
85117
|
-
} else {
|
|
85118
|
-
intCheck(v, -MAX, MAX, p);
|
|
85119
|
-
TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
|
|
85120
|
-
}
|
|
85121
|
-
}
|
|
85122
|
-
if (obj.hasOwnProperty(p = "RANGE")) {
|
|
85123
|
-
v = obj[p];
|
|
85124
|
-
if (v && v.pop) {
|
|
85125
|
-
intCheck(v[0], -MAX, -1, p);
|
|
85126
|
-
intCheck(v[1], 1, MAX, p);
|
|
85127
|
-
MIN_EXP = v[0];
|
|
85128
|
-
MAX_EXP = v[1];
|
|
85129
|
-
} else {
|
|
85130
|
-
intCheck(v, -MAX, MAX, p);
|
|
85131
|
-
if (v) {
|
|
85132
|
-
MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
|
|
85133
|
-
} else {
|
|
85134
|
-
throw Error(bignumberError + p + " cannot be zero: " + v);
|
|
85135
|
-
}
|
|
85136
|
-
}
|
|
85137
|
-
}
|
|
85138
|
-
if (obj.hasOwnProperty(p = "CRYPTO")) {
|
|
85139
|
-
v = obj[p];
|
|
85140
|
-
if (v === !!v) {
|
|
85141
|
-
if (v) {
|
|
85142
|
-
if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) {
|
|
85143
|
-
CRYPTO = v;
|
|
85144
|
-
} else {
|
|
85145
|
-
CRYPTO = !v;
|
|
85146
|
-
throw Error(bignumberError + "crypto unavailable");
|
|
85147
|
-
}
|
|
85148
|
-
} else {
|
|
85149
|
-
CRYPTO = v;
|
|
85150
|
-
}
|
|
85151
|
-
} else {
|
|
85152
|
-
throw Error(bignumberError + p + " not true or false: " + v);
|
|
85153
|
-
}
|
|
85154
|
-
}
|
|
85155
|
-
if (obj.hasOwnProperty(p = "MODULO_MODE")) {
|
|
85156
|
-
v = obj[p];
|
|
85157
|
-
intCheck(v, 0, 9, p);
|
|
85158
|
-
MODULO_MODE = v;
|
|
85159
|
-
}
|
|
85160
|
-
if (obj.hasOwnProperty(p = "POW_PRECISION")) {
|
|
85161
|
-
v = obj[p];
|
|
85162
|
-
intCheck(v, 0, MAX, p);
|
|
85163
|
-
POW_PRECISION = v;
|
|
85164
|
-
}
|
|
85165
|
-
if (obj.hasOwnProperty(p = "FORMAT")) {
|
|
85166
|
-
v = obj[p];
|
|
85167
|
-
if (typeof v == "object") FORMAT = v;
|
|
85168
|
-
else throw Error(bignumberError + p + " not an object: " + v);
|
|
85169
|
-
}
|
|
85170
|
-
if (obj.hasOwnProperty(p = "ALPHABET")) {
|
|
85171
|
-
v = obj[p];
|
|
85172
|
-
if (typeof v == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(v)) {
|
|
85173
|
-
alphabetHasNormalDecimalDigits = v.slice(0, 10) == "0123456789";
|
|
85174
|
-
ALPHABET = v;
|
|
85175
|
-
} else {
|
|
85176
|
-
throw Error(bignumberError + p + " invalid: " + v);
|
|
85177
|
-
}
|
|
85178
|
-
}
|
|
85179
|
-
} else {
|
|
85180
|
-
throw Error(bignumberError + "Object expected: " + obj);
|
|
85181
|
-
}
|
|
85182
|
-
}
|
|
85183
|
-
return {
|
|
85184
|
-
DECIMAL_PLACES,
|
|
85185
|
-
ROUNDING_MODE,
|
|
85186
|
-
EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],
|
|
85187
|
-
RANGE: [MIN_EXP, MAX_EXP],
|
|
85188
|
-
CRYPTO,
|
|
85189
|
-
MODULO_MODE,
|
|
85190
|
-
POW_PRECISION,
|
|
85191
|
-
FORMAT,
|
|
85192
|
-
ALPHABET
|
|
85193
|
-
};
|
|
85194
|
-
};
|
|
85195
|
-
BigNumber3.isBigNumber = function(v) {
|
|
85196
|
-
if (!v || v._isBigNumber !== true) return false;
|
|
85197
|
-
if (!BigNumber3.DEBUG) return true;
|
|
85198
|
-
var i, n, c = v.c, e = v.e, s = v.s;
|
|
85199
|
-
out: if ({}.toString.call(c) == "[object Array]") {
|
|
85200
|
-
if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
|
|
85201
|
-
if (c[0] === 0) {
|
|
85202
|
-
if (e === 0 && c.length === 1) return true;
|
|
85203
|
-
break out;
|
|
85204
|
-
}
|
|
85205
|
-
i = (e + 1) % LOG_BASE;
|
|
85206
|
-
if (i < 1) i += LOG_BASE;
|
|
85207
|
-
if (String(c[0]).length == i) {
|
|
85208
|
-
for (i = 0; i < c.length; i++) {
|
|
85209
|
-
n = c[i];
|
|
85210
|
-
if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;
|
|
85211
|
-
}
|
|
85212
|
-
if (n !== 0) return true;
|
|
85213
|
-
}
|
|
85214
|
-
}
|
|
85215
|
-
} else if (c === null && e === null && (s === null || s === 1 || s === -1)) {
|
|
85216
|
-
return true;
|
|
85217
|
-
}
|
|
85218
|
-
throw Error(bignumberError + "Invalid BigNumber: " + v);
|
|
85219
|
-
};
|
|
85220
|
-
BigNumber3.maximum = BigNumber3.max = function() {
|
|
85221
|
-
return maxOrMin(arguments, -1);
|
|
85222
|
-
};
|
|
85223
|
-
BigNumber3.minimum = BigNumber3.min = function() {
|
|
85224
|
-
return maxOrMin(arguments, 1);
|
|
85225
|
-
};
|
|
85226
|
-
BigNumber3.random = (function() {
|
|
85227
|
-
var pow2_53 = 9007199254740992;
|
|
85228
|
-
var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
|
|
85229
|
-
return mathfloor(Math.random() * pow2_53);
|
|
85230
|
-
} : function() {
|
|
85231
|
-
return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
|
|
85232
|
-
};
|
|
85233
|
-
return function(dp) {
|
|
85234
|
-
var a, b, e, k, v, i = 0, c = [], rand = new BigNumber3(ONE);
|
|
85235
|
-
if (dp == null) dp = DECIMAL_PLACES;
|
|
85236
|
-
else intCheck(dp, 0, MAX);
|
|
85237
|
-
k = mathceil(dp / LOG_BASE);
|
|
85238
|
-
if (CRYPTO) {
|
|
85239
|
-
if (crypto.getRandomValues) {
|
|
85240
|
-
a = crypto.getRandomValues(new Uint32Array(k *= 2));
|
|
85241
|
-
for (; i < k; ) {
|
|
85242
|
-
v = a[i] * 131072 + (a[i + 1] >>> 11);
|
|
85243
|
-
if (v >= 9e15) {
|
|
85244
|
-
b = crypto.getRandomValues(new Uint32Array(2));
|
|
85245
|
-
a[i] = b[0];
|
|
85246
|
-
a[i + 1] = b[1];
|
|
85247
|
-
} else {
|
|
85248
|
-
c.push(v % 1e14);
|
|
85249
|
-
i += 2;
|
|
85250
|
-
}
|
|
85251
|
-
}
|
|
85252
|
-
i = k / 2;
|
|
85253
|
-
} else if (crypto.randomBytes) {
|
|
85254
|
-
a = crypto.randomBytes(k *= 7);
|
|
85255
|
-
for (; i < k; ) {
|
|
85256
|
-
v = (a[i] & 31) * 281474976710656 + a[i + 1] * 1099511627776 + a[i + 2] * 4294967296 + a[i + 3] * 16777216 + (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6];
|
|
85257
|
-
if (v >= 9e15) {
|
|
85258
|
-
crypto.randomBytes(7).copy(a, i);
|
|
85259
|
-
} else {
|
|
85260
|
-
c.push(v % 1e14);
|
|
85261
|
-
i += 7;
|
|
85262
|
-
}
|
|
85263
|
-
}
|
|
85264
|
-
i = k / 7;
|
|
85265
|
-
} else {
|
|
85266
|
-
CRYPTO = false;
|
|
85267
|
-
throw Error(bignumberError + "crypto unavailable");
|
|
85268
|
-
}
|
|
85269
|
-
}
|
|
85270
|
-
if (!CRYPTO) {
|
|
85271
|
-
for (; i < k; ) {
|
|
85272
|
-
v = random53bitInt();
|
|
85273
|
-
if (v < 9e15) c[i++] = v % 1e14;
|
|
85274
|
-
}
|
|
85275
|
-
}
|
|
85276
|
-
k = c[--i];
|
|
85277
|
-
dp %= LOG_BASE;
|
|
85278
|
-
if (k && dp) {
|
|
85279
|
-
v = POWS_TEN[LOG_BASE - dp];
|
|
85280
|
-
c[i] = mathfloor(k / v) * v;
|
|
85281
|
-
}
|
|
85282
|
-
for (; c[i] === 0; c.pop(), i--) ;
|
|
85283
|
-
if (i < 0) {
|
|
85284
|
-
c = [e = 0];
|
|
85285
|
-
} else {
|
|
85286
|
-
for (e = -1; c[0] === 0; c.splice(0, 1), e -= LOG_BASE) ;
|
|
85287
|
-
for (i = 1, v = c[0]; v >= 10; v /= 10, i++) ;
|
|
85288
|
-
if (i < LOG_BASE) e -= LOG_BASE - i;
|
|
85289
|
-
}
|
|
85290
|
-
rand.e = e;
|
|
85291
|
-
rand.c = c;
|
|
85292
|
-
return rand;
|
|
85293
|
-
};
|
|
85294
|
-
})();
|
|
85295
|
-
BigNumber3.sum = function() {
|
|
85296
|
-
var i = 1, args = arguments, sum = new BigNumber3(args[0]);
|
|
85297
|
-
for (; i < args.length; ) sum = sum.plus(args[i++]);
|
|
85298
|
-
return sum;
|
|
85299
|
-
};
|
|
85300
|
-
convertBase = /* @__PURE__ */ (function() {
|
|
85301
|
-
var decimal = "0123456789";
|
|
85302
|
-
function toBaseOut(str, baseIn, baseOut, alphabet) {
|
|
85303
|
-
var j, arr = [0], arrL, i = 0, len = str.length;
|
|
85304
|
-
for (; i < len; ) {
|
|
85305
|
-
for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) ;
|
|
85306
|
-
arr[0] += alphabet.indexOf(str.charAt(i++));
|
|
85307
|
-
for (j = 0; j < arr.length; j++) {
|
|
85308
|
-
if (arr[j] > baseOut - 1) {
|
|
85309
|
-
if (arr[j + 1] == null) arr[j + 1] = 0;
|
|
85310
|
-
arr[j + 1] += arr[j] / baseOut | 0;
|
|
85311
|
-
arr[j] %= baseOut;
|
|
85312
|
-
}
|
|
85313
|
-
}
|
|
85314
|
-
}
|
|
85315
|
-
return arr.reverse();
|
|
85316
|
-
}
|
|
85317
|
-
return function(str, baseIn, baseOut, sign, callerIsToString) {
|
|
85318
|
-
var alphabet, d, e, k, r, x, xc, y, i = str.indexOf("."), dp = DECIMAL_PLACES, rm = ROUNDING_MODE;
|
|
85319
|
-
if (i >= 0) {
|
|
85320
|
-
k = POW_PRECISION;
|
|
85321
|
-
POW_PRECISION = 0;
|
|
85322
|
-
str = str.replace(".", "");
|
|
85323
|
-
y = new BigNumber3(baseIn);
|
|
85324
|
-
x = y.pow(str.length - i);
|
|
85325
|
-
POW_PRECISION = k;
|
|
85326
|
-
y.c = toBaseOut(
|
|
85327
|
-
toFixedPoint(coeffToString(x.c), x.e, "0"),
|
|
85328
|
-
10,
|
|
85329
|
-
baseOut,
|
|
85330
|
-
decimal
|
|
85331
|
-
);
|
|
85332
|
-
y.e = y.c.length;
|
|
85333
|
-
}
|
|
85334
|
-
xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet = ALPHABET, decimal) : (alphabet = decimal, ALPHABET));
|
|
85335
|
-
e = k = xc.length;
|
|
85336
|
-
for (; xc[--k] == 0; xc.pop()) ;
|
|
85337
|
-
if (!xc[0]) return alphabet.charAt(0);
|
|
85338
|
-
if (i < 0) {
|
|
85339
|
-
--e;
|
|
85340
|
-
} else {
|
|
85341
|
-
x.c = xc;
|
|
85342
|
-
x.e = e;
|
|
85343
|
-
x.s = sign;
|
|
85344
|
-
x = div(x, y, dp, rm, baseOut);
|
|
85345
|
-
xc = x.c;
|
|
85346
|
-
r = x.r;
|
|
85347
|
-
e = x.e;
|
|
85348
|
-
}
|
|
85349
|
-
d = e + dp + 1;
|
|
85350
|
-
i = xc[d];
|
|
85351
|
-
k = baseOut / 2;
|
|
85352
|
-
r = r || d < 0 || xc[d + 1] != null;
|
|
85353
|
-
r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : i > k || i == k && (rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == (x.s < 0 ? 8 : 7));
|
|
85354
|
-
if (d < 1 || !xc[0]) {
|
|
85355
|
-
str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);
|
|
85356
|
-
} else {
|
|
85357
|
-
xc.length = d;
|
|
85358
|
-
if (r) {
|
|
85359
|
-
for (--baseOut; ++xc[--d] > baseOut; ) {
|
|
85360
|
-
xc[d] = 0;
|
|
85361
|
-
if (!d) {
|
|
85362
|
-
++e;
|
|
85363
|
-
xc = [1].concat(xc);
|
|
85364
|
-
}
|
|
85365
|
-
}
|
|
85366
|
-
}
|
|
85367
|
-
for (k = xc.length; !xc[--k]; ) ;
|
|
85368
|
-
for (i = 0, str = ""; i <= k; str += alphabet.charAt(xc[i++])) ;
|
|
85369
|
-
str = toFixedPoint(str, e, alphabet.charAt(0));
|
|
85370
|
-
}
|
|
85371
|
-
return str;
|
|
85372
|
-
};
|
|
85373
|
-
})();
|
|
85374
|
-
div = /* @__PURE__ */ (function() {
|
|
85375
|
-
function multiply(x, k, base) {
|
|
85376
|
-
var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0;
|
|
85377
|
-
for (x = x.slice(); i--; ) {
|
|
85378
|
-
xlo = x[i] % SQRT_BASE;
|
|
85379
|
-
xhi = x[i] / SQRT_BASE | 0;
|
|
85380
|
-
m = khi * xlo + xhi * klo;
|
|
85381
|
-
temp = klo * xlo + m % SQRT_BASE * SQRT_BASE + carry;
|
|
85382
|
-
carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;
|
|
85383
|
-
x[i] = temp % base;
|
|
85384
|
-
}
|
|
85385
|
-
if (carry) x = [carry].concat(x);
|
|
85386
|
-
return x;
|
|
85387
|
-
}
|
|
85388
|
-
function compare2(a, b, aL, bL) {
|
|
85389
|
-
var i, cmp;
|
|
85390
|
-
if (aL != bL) {
|
|
85391
|
-
cmp = aL > bL ? 1 : -1;
|
|
85392
|
-
} else {
|
|
85393
|
-
for (i = cmp = 0; i < aL; i++) {
|
|
85394
|
-
if (a[i] != b[i]) {
|
|
85395
|
-
cmp = a[i] > b[i] ? 1 : -1;
|
|
85396
|
-
break;
|
|
85397
|
-
}
|
|
85398
|
-
}
|
|
85399
|
-
}
|
|
85400
|
-
return cmp;
|
|
85401
|
-
}
|
|
85402
|
-
function subtract(a, b, aL, base) {
|
|
85403
|
-
var i = 0;
|
|
85404
|
-
for (; aL--; ) {
|
|
85405
|
-
a[aL] -= i;
|
|
85406
|
-
i = a[aL] < b[aL] ? 1 : 0;
|
|
85407
|
-
a[aL] = i * base + a[aL] - b[aL];
|
|
85408
|
-
}
|
|
85409
|
-
for (; !a[0] && a.length > 1; a.splice(0, 1)) ;
|
|
85410
|
-
}
|
|
85411
|
-
return function(x, y, dp, rm, base) {
|
|
85412
|
-
var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, yL, yz, s = x.s == y.s ? 1 : -1, xc = x.c, yc = y.c;
|
|
85413
|
-
if (!xc || !xc[0] || !yc || !yc[0]) {
|
|
85414
|
-
return new BigNumber3(
|
|
85415
|
-
// Return NaN if either NaN, or both Infinity or 0.
|
|
85416
|
-
!x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : (
|
|
85417
|
-
// Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
|
|
85418
|
-
xc && xc[0] == 0 || !yc ? s * 0 : s / 0
|
|
85419
|
-
)
|
|
85420
|
-
);
|
|
85421
|
-
}
|
|
85422
|
-
q = new BigNumber3(s);
|
|
85423
|
-
qc = q.c = [];
|
|
85424
|
-
e = x.e - y.e;
|
|
85425
|
-
s = dp + e + 1;
|
|
85426
|
-
if (!base) {
|
|
85427
|
-
base = BASE;
|
|
85428
|
-
e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);
|
|
85429
|
-
s = s / LOG_BASE | 0;
|
|
85430
|
-
}
|
|
85431
|
-
for (i = 0; yc[i] == (xc[i] || 0); i++) ;
|
|
85432
|
-
if (yc[i] > (xc[i] || 0)) e--;
|
|
85433
|
-
if (s < 0) {
|
|
85434
|
-
qc.push(1);
|
|
85435
|
-
more = true;
|
|
85436
|
-
} else {
|
|
85437
|
-
xL = xc.length;
|
|
85438
|
-
yL = yc.length;
|
|
85439
|
-
i = 0;
|
|
85440
|
-
s += 2;
|
|
85441
|
-
n = mathfloor(base / (yc[0] + 1));
|
|
85442
|
-
if (n > 1) {
|
|
85443
|
-
yc = multiply(yc, n, base);
|
|
85444
|
-
xc = multiply(xc, n, base);
|
|
85445
|
-
yL = yc.length;
|
|
85446
|
-
xL = xc.length;
|
|
85447
|
-
}
|
|
85448
|
-
xi = yL;
|
|
85449
|
-
rem = xc.slice(0, yL);
|
|
85450
|
-
remL = rem.length;
|
|
85451
|
-
for (; remL < yL; rem[remL++] = 0) ;
|
|
85452
|
-
yz = yc.slice();
|
|
85453
|
-
yz = [0].concat(yz);
|
|
85454
|
-
yc0 = yc[0];
|
|
85455
|
-
if (yc[1] >= base / 2) yc0++;
|
|
85456
|
-
do {
|
|
85457
|
-
n = 0;
|
|
85458
|
-
cmp = compare2(yc, rem, yL, remL);
|
|
85459
|
-
if (cmp < 0) {
|
|
85460
|
-
rem0 = rem[0];
|
|
85461
|
-
if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);
|
|
85462
|
-
n = mathfloor(rem0 / yc0);
|
|
85463
|
-
if (n > 1) {
|
|
85464
|
-
if (n >= base) n = base - 1;
|
|
85465
|
-
prod = multiply(yc, n, base);
|
|
85466
|
-
prodL = prod.length;
|
|
85467
|
-
remL = rem.length;
|
|
85468
|
-
while (compare2(prod, rem, prodL, remL) == 1) {
|
|
85469
|
-
n--;
|
|
85470
|
-
subtract(prod, yL < prodL ? yz : yc, prodL, base);
|
|
85471
|
-
prodL = prod.length;
|
|
85472
|
-
cmp = 1;
|
|
85473
|
-
}
|
|
85474
|
-
} else {
|
|
85475
|
-
if (n == 0) {
|
|
85476
|
-
cmp = n = 1;
|
|
85477
|
-
}
|
|
85478
|
-
prod = yc.slice();
|
|
85479
|
-
prodL = prod.length;
|
|
85480
|
-
}
|
|
85481
|
-
if (prodL < remL) prod = [0].concat(prod);
|
|
85482
|
-
subtract(rem, prod, remL, base);
|
|
85483
|
-
remL = rem.length;
|
|
85484
|
-
if (cmp == -1) {
|
|
85485
|
-
while (compare2(yc, rem, yL, remL) < 1) {
|
|
85486
|
-
n++;
|
|
85487
|
-
subtract(rem, yL < remL ? yz : yc, remL, base);
|
|
85488
|
-
remL = rem.length;
|
|
85489
|
-
}
|
|
85490
|
-
}
|
|
85491
|
-
} else if (cmp === 0) {
|
|
85492
|
-
n++;
|
|
85493
|
-
rem = [0];
|
|
85494
|
-
}
|
|
85495
|
-
qc[i++] = n;
|
|
85496
|
-
if (rem[0]) {
|
|
85497
|
-
rem[remL++] = xc[xi] || 0;
|
|
85498
|
-
} else {
|
|
85499
|
-
rem = [xc[xi]];
|
|
85500
|
-
remL = 1;
|
|
85501
|
-
}
|
|
85502
|
-
} while ((xi++ < xL || rem[0] != null) && s--);
|
|
85503
|
-
more = rem[0] != null;
|
|
85504
|
-
if (!qc[0]) qc.splice(0, 1);
|
|
85505
|
-
}
|
|
85506
|
-
if (base == BASE) {
|
|
85507
|
-
for (i = 1, s = qc[0]; s >= 10; s /= 10, i++) ;
|
|
85508
|
-
round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);
|
|
85509
|
-
} else {
|
|
85510
|
-
q.e = e;
|
|
85511
|
-
q.r = +more;
|
|
85512
|
-
}
|
|
85513
|
-
return q;
|
|
85514
|
-
};
|
|
85515
|
-
})();
|
|
85516
|
-
function format(n, i, rm, id) {
|
|
85517
|
-
var c0, e, ne, len, str;
|
|
85518
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
85519
|
-
else intCheck(rm, 0, 8);
|
|
85520
|
-
if (!n.c) return n.toString();
|
|
85521
|
-
c0 = n.c[0];
|
|
85522
|
-
ne = n.e;
|
|
85523
|
-
if (i == null) {
|
|
85524
|
-
str = coeffToString(n.c);
|
|
85525
|
-
str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ? toExponential(str, ne) : toFixedPoint(str, ne, "0");
|
|
85526
|
-
} else {
|
|
85527
|
-
n = round(new BigNumber3(n), i, rm);
|
|
85528
|
-
e = n.e;
|
|
85529
|
-
str = coeffToString(n.c);
|
|
85530
|
-
len = str.length;
|
|
85531
|
-
if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {
|
|
85532
|
-
for (; len < i; str += "0", len++) ;
|
|
85533
|
-
str = toExponential(str, e);
|
|
85534
|
-
} else {
|
|
85535
|
-
i -= ne + (id === 2 && e > ne);
|
|
85536
|
-
str = toFixedPoint(str, e, "0");
|
|
85537
|
-
if (e + 1 > len) {
|
|
85538
|
-
if (--i > 0) for (str += "."; i--; str += "0") ;
|
|
85539
|
-
} else {
|
|
85540
|
-
i += e - len;
|
|
85541
|
-
if (i > 0) {
|
|
85542
|
-
if (e + 1 == len) str += ".";
|
|
85543
|
-
for (; i--; str += "0") ;
|
|
85544
|
-
}
|
|
85545
|
-
}
|
|
85546
|
-
}
|
|
85547
|
-
}
|
|
85548
|
-
return n.s < 0 && c0 ? "-" + str : str;
|
|
85549
|
-
}
|
|
85550
|
-
function maxOrMin(args, n) {
|
|
85551
|
-
var k, y, i = 1, x = new BigNumber3(args[0]);
|
|
85552
|
-
for (; i < args.length; i++) {
|
|
85553
|
-
y = new BigNumber3(args[i]);
|
|
85554
|
-
if (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) {
|
|
85555
|
-
x = y;
|
|
85556
|
-
}
|
|
85557
|
-
}
|
|
85558
|
-
return x;
|
|
85559
|
-
}
|
|
85560
|
-
function normalise(n, c, e) {
|
|
85561
|
-
var i = 1, j = c.length;
|
|
85562
|
-
for (; !c[--j]; c.pop()) ;
|
|
85563
|
-
for (j = c[0]; j >= 10; j /= 10, i++) ;
|
|
85564
|
-
if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {
|
|
85565
|
-
n.c = n.e = null;
|
|
85566
|
-
} else if (e < MIN_EXP) {
|
|
85567
|
-
n.c = [n.e = 0];
|
|
85568
|
-
} else {
|
|
85569
|
-
n.e = e;
|
|
85570
|
-
n.c = c;
|
|
85571
|
-
}
|
|
85572
|
-
return n;
|
|
85573
|
-
}
|
|
85574
|
-
parseNumeric = /* @__PURE__ */ (function() {
|
|
85575
|
-
var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
|
|
85576
|
-
return function(x, str, isNum, b) {
|
|
85577
|
-
var base, s = isNum ? str : str.replace(whitespaceOrPlus, "");
|
|
85578
|
-
if (isInfinityOrNaN.test(s)) {
|
|
85579
|
-
x.s = isNaN(s) ? null : s < 0 ? -1 : 1;
|
|
85580
|
-
} else {
|
|
85581
|
-
if (!isNum) {
|
|
85582
|
-
s = s.replace(basePrefix, function(m, p1, p2) {
|
|
85583
|
-
base = (p2 = p2.toLowerCase()) == "x" ? 16 : p2 == "b" ? 2 : 8;
|
|
85584
|
-
return !b || b == base ? p1 : m;
|
|
85585
|
-
});
|
|
85586
|
-
if (b) {
|
|
85587
|
-
base = b;
|
|
85588
|
-
s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1");
|
|
85589
|
-
}
|
|
85590
|
-
if (str != s) return new BigNumber3(s, base);
|
|
85591
|
-
}
|
|
85592
|
-
if (BigNumber3.DEBUG) {
|
|
85593
|
-
throw Error(bignumberError + "Not a" + (b ? " base " + b : "") + " number: " + str);
|
|
85594
|
-
}
|
|
85595
|
-
x.s = null;
|
|
85596
|
-
}
|
|
85597
|
-
x.c = x.e = null;
|
|
85598
|
-
};
|
|
85599
|
-
})();
|
|
85600
|
-
function round(x, sd, rm, r) {
|
|
85601
|
-
var d, i, j, k, n, ni, rd, xc = x.c, pows10 = POWS_TEN;
|
|
85602
|
-
if (xc) {
|
|
85603
|
-
out: {
|
|
85604
|
-
for (d = 1, k = xc[0]; k >= 10; k /= 10, d++) ;
|
|
85605
|
-
i = sd - d;
|
|
85606
|
-
if (i < 0) {
|
|
85607
|
-
i += LOG_BASE;
|
|
85608
|
-
j = sd;
|
|
85609
|
-
n = xc[ni = 0];
|
|
85610
|
-
rd = mathfloor(n / pows10[d - j - 1] % 10);
|
|
85611
|
-
} else {
|
|
85612
|
-
ni = mathceil((i + 1) / LOG_BASE);
|
|
85613
|
-
if (ni >= xc.length) {
|
|
85614
|
-
if (r) {
|
|
85615
|
-
for (; xc.length <= ni; xc.push(0)) ;
|
|
85616
|
-
n = rd = 0;
|
|
85617
|
-
d = 1;
|
|
85618
|
-
i %= LOG_BASE;
|
|
85619
|
-
j = i - LOG_BASE + 1;
|
|
85620
|
-
} else {
|
|
85621
|
-
break out;
|
|
85622
|
-
}
|
|
85623
|
-
} else {
|
|
85624
|
-
n = k = xc[ni];
|
|
85625
|
-
for (d = 1; k >= 10; k /= 10, d++) ;
|
|
85626
|
-
i %= LOG_BASE;
|
|
85627
|
-
j = i - LOG_BASE + d;
|
|
85628
|
-
rd = j < 0 ? 0 : mathfloor(n / pows10[d - j - 1] % 10);
|
|
85629
|
-
}
|
|
85630
|
-
}
|
|
85631
|
-
r = r || sd < 0 || // Are there any non-zero digits after the rounding digit?
|
|
85632
|
-
// The expression n % pows10[d - j - 1] returns all digits of n to the right
|
|
85633
|
-
// of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
|
|
85634
|
-
xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]);
|
|
85635
|
-
r = rm < 4 ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && // Check whether the digit to the left of the rounding digit is odd.
|
|
85636
|
-
(i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10 & 1 || rm == (x.s < 0 ? 8 : 7));
|
|
85637
|
-
if (sd < 1 || !xc[0]) {
|
|
85638
|
-
xc.length = 0;
|
|
85639
|
-
if (r) {
|
|
85640
|
-
sd -= x.e + 1;
|
|
85641
|
-
xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];
|
|
85642
|
-
x.e = -sd || 0;
|
|
85643
|
-
} else {
|
|
85644
|
-
xc[0] = x.e = 0;
|
|
85645
|
-
}
|
|
85646
|
-
return x;
|
|
85647
|
-
}
|
|
85648
|
-
if (i == 0) {
|
|
85649
|
-
xc.length = ni;
|
|
85650
|
-
k = 1;
|
|
85651
|
-
ni--;
|
|
85652
|
-
} else {
|
|
85653
|
-
xc.length = ni + 1;
|
|
85654
|
-
k = pows10[LOG_BASE - i];
|
|
85655
|
-
xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;
|
|
85656
|
-
}
|
|
85657
|
-
if (r) {
|
|
85658
|
-
for (; ; ) {
|
|
85659
|
-
if (ni == 0) {
|
|
85660
|
-
for (i = 1, j = xc[0]; j >= 10; j /= 10, i++) ;
|
|
85661
|
-
j = xc[0] += k;
|
|
85662
|
-
for (k = 1; j >= 10; j /= 10, k++) ;
|
|
85663
|
-
if (i != k) {
|
|
85664
|
-
x.e++;
|
|
85665
|
-
if (xc[0] == BASE) xc[0] = 1;
|
|
85666
|
-
}
|
|
85667
|
-
break;
|
|
85668
|
-
} else {
|
|
85669
|
-
xc[ni] += k;
|
|
85670
|
-
if (xc[ni] != BASE) break;
|
|
85671
|
-
xc[ni--] = 0;
|
|
85672
|
-
k = 1;
|
|
85673
|
-
}
|
|
85674
|
-
}
|
|
85675
|
-
}
|
|
85676
|
-
for (i = xc.length; xc[--i] === 0; xc.pop()) ;
|
|
85677
|
-
}
|
|
85678
|
-
if (x.e > MAX_EXP) {
|
|
85679
|
-
x.c = x.e = null;
|
|
85680
|
-
} else if (x.e < MIN_EXP) {
|
|
85681
|
-
x.c = [x.e = 0];
|
|
85682
|
-
}
|
|
85683
|
-
}
|
|
85684
|
-
return x;
|
|
85685
|
-
}
|
|
85686
|
-
function valueOf(n) {
|
|
85687
|
-
var str, e = n.e;
|
|
85688
|
-
if (e === null) return n.toString();
|
|
85689
|
-
str = coeffToString(n.c);
|
|
85690
|
-
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(str, e) : toFixedPoint(str, e, "0");
|
|
85691
|
-
return n.s < 0 ? "-" + str : str;
|
|
85692
|
-
}
|
|
85693
|
-
P.absoluteValue = P.abs = function() {
|
|
85694
|
-
var x = new BigNumber3(this);
|
|
85695
|
-
if (x.s < 0) x.s = 1;
|
|
85696
|
-
return x;
|
|
85697
|
-
};
|
|
85698
|
-
P.comparedTo = function(y, b) {
|
|
85699
|
-
return compare(this, new BigNumber3(y, b));
|
|
85700
|
-
};
|
|
85701
|
-
P.decimalPlaces = P.dp = function(dp, rm) {
|
|
85702
|
-
var c, n, v, x = this;
|
|
85703
|
-
if (dp != null) {
|
|
85704
|
-
intCheck(dp, 0, MAX);
|
|
85705
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
85706
|
-
else intCheck(rm, 0, 8);
|
|
85707
|
-
return round(new BigNumber3(x), dp + x.e + 1, rm);
|
|
85708
|
-
}
|
|
85709
|
-
if (!(c = x.c)) return null;
|
|
85710
|
-
n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
|
|
85711
|
-
if (v = c[v]) for (; v % 10 == 0; v /= 10, n--) ;
|
|
85712
|
-
if (n < 0) n = 0;
|
|
85713
|
-
return n;
|
|
85714
|
-
};
|
|
85715
|
-
P.dividedBy = P.div = function(y, b) {
|
|
85716
|
-
return div(this, new BigNumber3(y, b), DECIMAL_PLACES, ROUNDING_MODE);
|
|
85717
|
-
};
|
|
85718
|
-
P.dividedToIntegerBy = P.idiv = function(y, b) {
|
|
85719
|
-
return div(this, new BigNumber3(y, b), 0, 1);
|
|
85720
|
-
};
|
|
85721
|
-
P.exponentiatedBy = P.pow = function(n, m) {
|
|
85722
|
-
var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, x = this;
|
|
85723
|
-
n = new BigNumber3(n);
|
|
85724
|
-
if (n.c && !n.isInteger()) {
|
|
85725
|
-
throw Error(bignumberError + "Exponent not an integer: " + valueOf(n));
|
|
85726
|
-
}
|
|
85727
|
-
if (m != null) m = new BigNumber3(m);
|
|
85728
|
-
nIsBig = n.e > 14;
|
|
85729
|
-
if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {
|
|
85730
|
-
y = new BigNumber3(Math.pow(+valueOf(x), nIsBig ? n.s * (2 - isOdd(n)) : +valueOf(n)));
|
|
85731
|
-
return m ? y.mod(m) : y;
|
|
85732
|
-
}
|
|
85733
|
-
nIsNeg = n.s < 0;
|
|
85734
|
-
if (m) {
|
|
85735
|
-
if (m.c ? !m.c[0] : !m.s) return new BigNumber3(NaN);
|
|
85736
|
-
isModExp = !nIsNeg && x.isInteger() && m.isInteger();
|
|
85737
|
-
if (isModExp) x = x.mod(m);
|
|
85738
|
-
} else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) {
|
|
85739
|
-
k = x.s < 0 && isOdd(n) ? -0 : 0;
|
|
85740
|
-
if (x.e > -1) k = 1 / k;
|
|
85741
|
-
return new BigNumber3(nIsNeg ? 1 / k : k);
|
|
85742
|
-
} else if (POW_PRECISION) {
|
|
85743
|
-
k = mathceil(POW_PRECISION / LOG_BASE + 2);
|
|
85744
|
-
}
|
|
85745
|
-
if (nIsBig) {
|
|
85746
|
-
half = new BigNumber3(0.5);
|
|
85747
|
-
if (nIsNeg) n.s = 1;
|
|
85748
|
-
nIsOdd = isOdd(n);
|
|
85749
|
-
} else {
|
|
85750
|
-
i = Math.abs(+valueOf(n));
|
|
85751
|
-
nIsOdd = i % 2;
|
|
85752
|
-
}
|
|
85753
|
-
y = new BigNumber3(ONE);
|
|
85754
|
-
for (; ; ) {
|
|
85755
|
-
if (nIsOdd) {
|
|
85756
|
-
y = y.times(x);
|
|
85757
|
-
if (!y.c) break;
|
|
85758
|
-
if (k) {
|
|
85759
|
-
if (y.c.length > k) y.c.length = k;
|
|
85760
|
-
} else if (isModExp) {
|
|
85761
|
-
y = y.mod(m);
|
|
85762
|
-
}
|
|
85763
|
-
}
|
|
85764
|
-
if (i) {
|
|
85765
|
-
i = mathfloor(i / 2);
|
|
85766
|
-
if (i === 0) break;
|
|
85767
|
-
nIsOdd = i % 2;
|
|
85768
|
-
} else {
|
|
85769
|
-
n = n.times(half);
|
|
85770
|
-
round(n, n.e + 1, 1);
|
|
85771
|
-
if (n.e > 14) {
|
|
85772
|
-
nIsOdd = isOdd(n);
|
|
85773
|
-
} else {
|
|
85774
|
-
i = +valueOf(n);
|
|
85775
|
-
if (i === 0) break;
|
|
85776
|
-
nIsOdd = i % 2;
|
|
85777
|
-
}
|
|
85778
|
-
}
|
|
85779
|
-
x = x.times(x);
|
|
85780
|
-
if (k) {
|
|
85781
|
-
if (x.c && x.c.length > k) x.c.length = k;
|
|
85782
|
-
} else if (isModExp) {
|
|
85783
|
-
x = x.mod(m);
|
|
85784
|
-
}
|
|
85785
|
-
}
|
|
85786
|
-
if (isModExp) return y;
|
|
85787
|
-
if (nIsNeg) y = ONE.div(y);
|
|
85788
|
-
return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;
|
|
85789
|
-
};
|
|
85790
|
-
P.integerValue = function(rm) {
|
|
85791
|
-
var n = new BigNumber3(this);
|
|
85792
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
85793
|
-
else intCheck(rm, 0, 8);
|
|
85794
|
-
return round(n, n.e + 1, rm);
|
|
85795
|
-
};
|
|
85796
|
-
P.isEqualTo = P.eq = function(y, b) {
|
|
85797
|
-
return compare(this, new BigNumber3(y, b)) === 0;
|
|
85798
|
-
};
|
|
85799
|
-
P.isFinite = function() {
|
|
85800
|
-
return !!this.c;
|
|
85801
|
-
};
|
|
85802
|
-
P.isGreaterThan = P.gt = function(y, b) {
|
|
85803
|
-
return compare(this, new BigNumber3(y, b)) > 0;
|
|
85804
|
-
};
|
|
85805
|
-
P.isGreaterThanOrEqualTo = P.gte = function(y, b) {
|
|
85806
|
-
return (b = compare(this, new BigNumber3(y, b))) === 1 || b === 0;
|
|
85807
|
-
};
|
|
85808
|
-
P.isInteger = function() {
|
|
85809
|
-
return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
|
|
85810
|
-
};
|
|
85811
|
-
P.isLessThan = P.lt = function(y, b) {
|
|
85812
|
-
return compare(this, new BigNumber3(y, b)) < 0;
|
|
85813
|
-
};
|
|
85814
|
-
P.isLessThanOrEqualTo = P.lte = function(y, b) {
|
|
85815
|
-
return (b = compare(this, new BigNumber3(y, b))) === -1 || b === 0;
|
|
85816
|
-
};
|
|
85817
|
-
P.isNaN = function() {
|
|
85818
|
-
return !this.s;
|
|
85819
|
-
};
|
|
85820
|
-
P.isNegative = function() {
|
|
85821
|
-
return this.s < 0;
|
|
85822
|
-
};
|
|
85823
|
-
P.isPositive = function() {
|
|
85824
|
-
return this.s > 0;
|
|
85825
|
-
};
|
|
85826
|
-
P.isZero = function() {
|
|
85827
|
-
return !!this.c && this.c[0] == 0;
|
|
85828
|
-
};
|
|
85829
|
-
P.minus = function(y, b) {
|
|
85830
|
-
var i, j, t, xLTy, x = this, a = x.s;
|
|
85831
|
-
y = new BigNumber3(y, b);
|
|
85832
|
-
b = y.s;
|
|
85833
|
-
if (!a || !b) return new BigNumber3(NaN);
|
|
85834
|
-
if (a != b) {
|
|
85835
|
-
y.s = -b;
|
|
85836
|
-
return x.plus(y);
|
|
85837
|
-
}
|
|
85838
|
-
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
85839
|
-
if (!xe || !ye) {
|
|
85840
|
-
if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber3(yc ? x : NaN);
|
|
85841
|
-
if (!xc[0] || !yc[0]) {
|
|
85842
|
-
return yc[0] ? (y.s = -b, y) : new BigNumber3(xc[0] ? x : (
|
|
85843
|
-
// IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
|
|
85844
|
-
ROUNDING_MODE == 3 ? -0 : 0
|
|
85845
|
-
));
|
|
85846
|
-
}
|
|
85847
|
-
}
|
|
85848
|
-
xe = bitFloor(xe);
|
|
85849
|
-
ye = bitFloor(ye);
|
|
85850
|
-
xc = xc.slice();
|
|
85851
|
-
if (a = xe - ye) {
|
|
85852
|
-
if (xLTy = a < 0) {
|
|
85853
|
-
a = -a;
|
|
85854
|
-
t = xc;
|
|
85855
|
-
} else {
|
|
85856
|
-
ye = xe;
|
|
85857
|
-
t = yc;
|
|
85858
|
-
}
|
|
85859
|
-
t.reverse();
|
|
85860
|
-
for (b = a; b--; t.push(0)) ;
|
|
85861
|
-
t.reverse();
|
|
85862
|
-
} else {
|
|
85863
|
-
j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b;
|
|
85864
|
-
for (a = b = 0; b < j; b++) {
|
|
85865
|
-
if (xc[b] != yc[b]) {
|
|
85866
|
-
xLTy = xc[b] < yc[b];
|
|
85867
|
-
break;
|
|
85868
|
-
}
|
|
85869
|
-
}
|
|
85870
|
-
}
|
|
85871
|
-
if (xLTy) {
|
|
85872
|
-
t = xc;
|
|
85873
|
-
xc = yc;
|
|
85874
|
-
yc = t;
|
|
85875
|
-
y.s = -y.s;
|
|
85876
|
-
}
|
|
85877
|
-
b = (j = yc.length) - (i = xc.length);
|
|
85878
|
-
if (b > 0) for (; b--; xc[i++] = 0) ;
|
|
85879
|
-
b = BASE - 1;
|
|
85880
|
-
for (; j > a; ) {
|
|
85881
|
-
if (xc[--j] < yc[j]) {
|
|
85882
|
-
for (i = j; i && !xc[--i]; xc[i] = b) ;
|
|
85883
|
-
--xc[i];
|
|
85884
|
-
xc[j] += BASE;
|
|
85885
|
-
}
|
|
85886
|
-
xc[j] -= yc[j];
|
|
85887
|
-
}
|
|
85888
|
-
for (; xc[0] == 0; xc.splice(0, 1), --ye) ;
|
|
85889
|
-
if (!xc[0]) {
|
|
85890
|
-
y.s = ROUNDING_MODE == 3 ? -1 : 1;
|
|
85891
|
-
y.c = [y.e = 0];
|
|
85892
|
-
return y;
|
|
85893
|
-
}
|
|
85894
|
-
return normalise(y, xc, ye);
|
|
85895
|
-
};
|
|
85896
|
-
P.modulo = P.mod = function(y, b) {
|
|
85897
|
-
var q, s, x = this;
|
|
85898
|
-
y = new BigNumber3(y, b);
|
|
85899
|
-
if (!x.c || !y.s || y.c && !y.c[0]) {
|
|
85900
|
-
return new BigNumber3(NaN);
|
|
85901
|
-
} else if (!y.c || x.c && !x.c[0]) {
|
|
85902
|
-
return new BigNumber3(x);
|
|
85903
|
-
}
|
|
85904
|
-
if (MODULO_MODE == 9) {
|
|
85905
|
-
s = y.s;
|
|
85906
|
-
y.s = 1;
|
|
85907
|
-
q = div(x, y, 0, 3);
|
|
85908
|
-
y.s = s;
|
|
85909
|
-
q.s *= s;
|
|
85910
|
-
} else {
|
|
85911
|
-
q = div(x, y, 0, MODULO_MODE);
|
|
85912
|
-
}
|
|
85913
|
-
y = x.minus(q.times(y));
|
|
85914
|
-
if (!y.c[0] && MODULO_MODE == 1) y.s = x.s;
|
|
85915
|
-
return y;
|
|
85916
|
-
};
|
|
85917
|
-
P.multipliedBy = P.times = function(y, b) {
|
|
85918
|
-
var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x = this, xc = x.c, yc = (y = new BigNumber3(y, b)).c;
|
|
85919
|
-
if (!xc || !yc || !xc[0] || !yc[0]) {
|
|
85920
|
-
if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
|
|
85921
|
-
y.c = y.e = y.s = null;
|
|
85922
|
-
} else {
|
|
85923
|
-
y.s *= x.s;
|
|
85924
|
-
if (!xc || !yc) {
|
|
85925
|
-
y.c = y.e = null;
|
|
85926
|
-
} else {
|
|
85927
|
-
y.c = [0];
|
|
85928
|
-
y.e = 0;
|
|
85929
|
-
}
|
|
85930
|
-
}
|
|
85931
|
-
return y;
|
|
85932
|
-
}
|
|
85933
|
-
e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);
|
|
85934
|
-
y.s *= x.s;
|
|
85935
|
-
xcL = xc.length;
|
|
85936
|
-
ycL = yc.length;
|
|
85937
|
-
if (xcL < ycL) {
|
|
85938
|
-
zc = xc;
|
|
85939
|
-
xc = yc;
|
|
85940
|
-
yc = zc;
|
|
85941
|
-
i = xcL;
|
|
85942
|
-
xcL = ycL;
|
|
85943
|
-
ycL = i;
|
|
85944
|
-
}
|
|
85945
|
-
for (i = xcL + ycL, zc = []; i--; zc.push(0)) ;
|
|
85946
|
-
base = BASE;
|
|
85947
|
-
sqrtBase = SQRT_BASE;
|
|
85948
|
-
for (i = ycL; --i >= 0; ) {
|
|
85949
|
-
c = 0;
|
|
85950
|
-
ylo = yc[i] % sqrtBase;
|
|
85951
|
-
yhi = yc[i] / sqrtBase | 0;
|
|
85952
|
-
for (k = xcL, j = i + k; j > i; ) {
|
|
85953
|
-
xlo = xc[--k] % sqrtBase;
|
|
85954
|
-
xhi = xc[k] / sqrtBase | 0;
|
|
85955
|
-
m = yhi * xlo + xhi * ylo;
|
|
85956
|
-
xlo = ylo * xlo + m % sqrtBase * sqrtBase + zc[j] + c;
|
|
85957
|
-
c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi;
|
|
85958
|
-
zc[j--] = xlo % base;
|
|
85959
|
-
}
|
|
85960
|
-
zc[j] = c;
|
|
85961
|
-
}
|
|
85962
|
-
if (c) {
|
|
85963
|
-
++e;
|
|
85964
|
-
} else {
|
|
85965
|
-
zc.splice(0, 1);
|
|
85966
|
-
}
|
|
85967
|
-
return normalise(y, zc, e);
|
|
85968
|
-
};
|
|
85969
|
-
P.negated = function() {
|
|
85970
|
-
var x = new BigNumber3(this);
|
|
85971
|
-
x.s = -x.s || null;
|
|
85972
|
-
return x;
|
|
85973
|
-
};
|
|
85974
|
-
P.plus = function(y, b) {
|
|
85975
|
-
var t, x = this, a = x.s;
|
|
85976
|
-
y = new BigNumber3(y, b);
|
|
85977
|
-
b = y.s;
|
|
85978
|
-
if (!a || !b) return new BigNumber3(NaN);
|
|
85979
|
-
if (a != b) {
|
|
85980
|
-
y.s = -b;
|
|
85981
|
-
return x.minus(y);
|
|
85982
|
-
}
|
|
85983
|
-
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
85984
|
-
if (!xe || !ye) {
|
|
85985
|
-
if (!xc || !yc) return new BigNumber3(a / 0);
|
|
85986
|
-
if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber3(xc[0] ? x : a * 0);
|
|
85987
|
-
}
|
|
85988
|
-
xe = bitFloor(xe);
|
|
85989
|
-
ye = bitFloor(ye);
|
|
85990
|
-
xc = xc.slice();
|
|
85991
|
-
if (a = xe - ye) {
|
|
85992
|
-
if (a > 0) {
|
|
85993
|
-
ye = xe;
|
|
85994
|
-
t = yc;
|
|
85995
|
-
} else {
|
|
85996
|
-
a = -a;
|
|
85997
|
-
t = xc;
|
|
85998
|
-
}
|
|
85999
|
-
t.reverse();
|
|
86000
|
-
for (; a--; t.push(0)) ;
|
|
86001
|
-
t.reverse();
|
|
86002
|
-
}
|
|
86003
|
-
a = xc.length;
|
|
86004
|
-
b = yc.length;
|
|
86005
|
-
if (a - b < 0) {
|
|
86006
|
-
t = yc;
|
|
86007
|
-
yc = xc;
|
|
86008
|
-
xc = t;
|
|
86009
|
-
b = a;
|
|
86010
|
-
}
|
|
86011
|
-
for (a = 0; b; ) {
|
|
86012
|
-
a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;
|
|
86013
|
-
xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;
|
|
86014
|
-
}
|
|
86015
|
-
if (a) {
|
|
86016
|
-
xc = [a].concat(xc);
|
|
86017
|
-
++ye;
|
|
86018
|
-
}
|
|
86019
|
-
return normalise(y, xc, ye);
|
|
86020
|
-
};
|
|
86021
|
-
P.precision = P.sd = function(sd, rm) {
|
|
86022
|
-
var c, n, v, x = this;
|
|
86023
|
-
if (sd != null && sd !== !!sd) {
|
|
86024
|
-
intCheck(sd, 1, MAX);
|
|
86025
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
86026
|
-
else intCheck(rm, 0, 8);
|
|
86027
|
-
return round(new BigNumber3(x), sd, rm);
|
|
86028
|
-
}
|
|
86029
|
-
if (!(c = x.c)) return null;
|
|
86030
|
-
v = c.length - 1;
|
|
86031
|
-
n = v * LOG_BASE + 1;
|
|
86032
|
-
if (v = c[v]) {
|
|
86033
|
-
for (; v % 10 == 0; v /= 10, n--) ;
|
|
86034
|
-
for (v = c[0]; v >= 10; v /= 10, n++) ;
|
|
86035
|
-
}
|
|
86036
|
-
if (sd && x.e + 1 > n) n = x.e + 1;
|
|
86037
|
-
return n;
|
|
86038
|
-
};
|
|
86039
|
-
P.shiftedBy = function(k) {
|
|
86040
|
-
intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
|
|
86041
|
-
return this.times("1e" + k);
|
|
86042
|
-
};
|
|
86043
|
-
P.squareRoot = P.sqrt = function() {
|
|
86044
|
-
var m, n, r, rep, t, x = this, c = x.c, s = x.s, e = x.e, dp = DECIMAL_PLACES + 4, half = new BigNumber3("0.5");
|
|
86045
|
-
if (s !== 1 || !c || !c[0]) {
|
|
86046
|
-
return new BigNumber3(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);
|
|
86047
|
-
}
|
|
86048
|
-
s = Math.sqrt(+valueOf(x));
|
|
86049
|
-
if (s == 0 || s == 1 / 0) {
|
|
86050
|
-
n = coeffToString(c);
|
|
86051
|
-
if ((n.length + e) % 2 == 0) n += "0";
|
|
86052
|
-
s = Math.sqrt(+n);
|
|
86053
|
-
e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);
|
|
86054
|
-
if (s == 1 / 0) {
|
|
86055
|
-
n = "5e" + e;
|
|
86056
|
-
} else {
|
|
86057
|
-
n = s.toExponential();
|
|
86058
|
-
n = n.slice(0, n.indexOf("e") + 1) + e;
|
|
86059
|
-
}
|
|
86060
|
-
r = new BigNumber3(n);
|
|
86061
|
-
} else {
|
|
86062
|
-
r = new BigNumber3(s + "");
|
|
86063
|
-
}
|
|
86064
|
-
if (r.c[0]) {
|
|
86065
|
-
e = r.e;
|
|
86066
|
-
s = e + dp;
|
|
86067
|
-
if (s < 3) s = 0;
|
|
86068
|
-
for (; ; ) {
|
|
86069
|
-
t = r;
|
|
86070
|
-
r = half.times(t.plus(div(x, t, dp, 1)));
|
|
86071
|
-
if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {
|
|
86072
|
-
if (r.e < e) --s;
|
|
86073
|
-
n = n.slice(s - 3, s + 1);
|
|
86074
|
-
if (n == "9999" || !rep && n == "4999") {
|
|
86075
|
-
if (!rep) {
|
|
86076
|
-
round(t, t.e + DECIMAL_PLACES + 2, 0);
|
|
86077
|
-
if (t.times(t).eq(x)) {
|
|
86078
|
-
r = t;
|
|
86079
|
-
break;
|
|
86080
|
-
}
|
|
86081
|
-
}
|
|
86082
|
-
dp += 4;
|
|
86083
|
-
s += 4;
|
|
86084
|
-
rep = 1;
|
|
86085
|
-
} else {
|
|
86086
|
-
if (!+n || !+n.slice(1) && n.charAt(0) == "5") {
|
|
86087
|
-
round(r, r.e + DECIMAL_PLACES + 2, 1);
|
|
86088
|
-
m = !r.times(r).eq(x);
|
|
86089
|
-
}
|
|
86090
|
-
break;
|
|
86091
|
-
}
|
|
86092
|
-
}
|
|
86093
|
-
}
|
|
86094
|
-
}
|
|
86095
|
-
return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);
|
|
86096
|
-
};
|
|
86097
|
-
P.toExponential = function(dp, rm) {
|
|
86098
|
-
if (dp != null) {
|
|
86099
|
-
intCheck(dp, 0, MAX);
|
|
86100
|
-
dp++;
|
|
86101
|
-
}
|
|
86102
|
-
return format(this, dp, rm, 1);
|
|
86103
|
-
};
|
|
86104
|
-
P.toFixed = function(dp, rm) {
|
|
86105
|
-
if (dp != null) {
|
|
86106
|
-
intCheck(dp, 0, MAX);
|
|
86107
|
-
dp = dp + this.e + 1;
|
|
86108
|
-
}
|
|
86109
|
-
return format(this, dp, rm);
|
|
86110
|
-
};
|
|
86111
|
-
P.toFormat = function(dp, rm, format2) {
|
|
86112
|
-
var str, x = this;
|
|
86113
|
-
if (format2 == null) {
|
|
86114
|
-
if (dp != null && rm && typeof rm == "object") {
|
|
86115
|
-
format2 = rm;
|
|
86116
|
-
rm = null;
|
|
86117
|
-
} else if (dp && typeof dp == "object") {
|
|
86118
|
-
format2 = dp;
|
|
86119
|
-
dp = rm = null;
|
|
86120
|
-
} else {
|
|
86121
|
-
format2 = FORMAT;
|
|
86122
|
-
}
|
|
86123
|
-
} else if (typeof format2 != "object") {
|
|
86124
|
-
throw Error(bignumberError + "Argument not an object: " + format2);
|
|
86125
|
-
}
|
|
86126
|
-
str = x.toFixed(dp, rm);
|
|
86127
|
-
if (x.c) {
|
|
86128
|
-
var i, arr = str.split("."), g1 = +format2.groupSize, g2 = +format2.secondaryGroupSize, groupSeparator = format2.groupSeparator || "", intPart = arr[0], fractionPart = arr[1], isNeg = x.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart, len = intDigits.length;
|
|
86129
|
-
if (g2) {
|
|
86130
|
-
i = g1;
|
|
86131
|
-
g1 = g2;
|
|
86132
|
-
g2 = i;
|
|
86133
|
-
len -= i;
|
|
86134
|
-
}
|
|
86135
|
-
if (g1 > 0 && len > 0) {
|
|
86136
|
-
i = len % g1 || g1;
|
|
86137
|
-
intPart = intDigits.substr(0, i);
|
|
86138
|
-
for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);
|
|
86139
|
-
if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);
|
|
86140
|
-
if (isNeg) intPart = "-" + intPart;
|
|
86141
|
-
}
|
|
86142
|
-
str = fractionPart ? intPart + (format2.decimalSeparator || "") + ((g2 = +format2.fractionGroupSize) ? fractionPart.replace(
|
|
86143
|
-
new RegExp("\\d{" + g2 + "}\\B", "g"),
|
|
86144
|
-
"$&" + (format2.fractionGroupSeparator || "")
|
|
86145
|
-
) : fractionPart) : intPart;
|
|
86146
|
-
}
|
|
86147
|
-
return (format2.prefix || "") + str + (format2.suffix || "");
|
|
86148
|
-
};
|
|
86149
|
-
P.toFraction = function(md) {
|
|
86150
|
-
var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, x = this, xc = x.c;
|
|
86151
|
-
if (md != null) {
|
|
86152
|
-
n = new BigNumber3(md);
|
|
86153
|
-
if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
|
|
86154
|
-
throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n));
|
|
86155
|
-
}
|
|
86156
|
-
}
|
|
86157
|
-
if (!xc) return new BigNumber3(x);
|
|
86158
|
-
d = new BigNumber3(ONE);
|
|
86159
|
-
n1 = d0 = new BigNumber3(ONE);
|
|
86160
|
-
d1 = n0 = new BigNumber3(ONE);
|
|
86161
|
-
s = coeffToString(xc);
|
|
86162
|
-
e = d.e = s.length - x.e - 1;
|
|
86163
|
-
d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];
|
|
86164
|
-
md = !md || n.comparedTo(d) > 0 ? e > 0 ? d : n1 : n;
|
|
86165
|
-
exp = MAX_EXP;
|
|
86166
|
-
MAX_EXP = 1 / 0;
|
|
86167
|
-
n = new BigNumber3(s);
|
|
86168
|
-
n0.c[0] = 0;
|
|
86169
|
-
for (; ; ) {
|
|
86170
|
-
q = div(n, d, 0, 1);
|
|
86171
|
-
d2 = d0.plus(q.times(d1));
|
|
86172
|
-
if (d2.comparedTo(md) == 1) break;
|
|
86173
|
-
d0 = d1;
|
|
86174
|
-
d1 = d2;
|
|
86175
|
-
n1 = n0.plus(q.times(d2 = n1));
|
|
86176
|
-
n0 = d2;
|
|
86177
|
-
d = n.minus(q.times(d2 = d));
|
|
86178
|
-
n = d2;
|
|
86179
|
-
}
|
|
86180
|
-
d2 = div(md.minus(d0), d1, 0, 1);
|
|
86181
|
-
n0 = n0.plus(d2.times(n1));
|
|
86182
|
-
d0 = d0.plus(d2.times(d1));
|
|
86183
|
-
n0.s = n1.s = x.s;
|
|
86184
|
-
e = e * 2;
|
|
86185
|
-
r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(
|
|
86186
|
-
div(n0, d0, e, ROUNDING_MODE).minus(x).abs()
|
|
86187
|
-
) < 1 ? [n1, d1] : [n0, d0];
|
|
86188
|
-
MAX_EXP = exp;
|
|
86189
|
-
return r;
|
|
86190
|
-
};
|
|
86191
|
-
P.toNumber = function() {
|
|
86192
|
-
return +valueOf(this);
|
|
86193
|
-
};
|
|
86194
|
-
P.toPrecision = function(sd, rm) {
|
|
86195
|
-
if (sd != null) intCheck(sd, 1, MAX);
|
|
86196
|
-
return format(this, sd, rm, 2);
|
|
86197
|
-
};
|
|
86198
|
-
P.toString = function(b) {
|
|
86199
|
-
var str, n = this, s = n.s, e = n.e;
|
|
86200
|
-
if (e === null) {
|
|
86201
|
-
if (s) {
|
|
86202
|
-
str = "Infinity";
|
|
86203
|
-
if (s < 0) str = "-" + str;
|
|
86204
|
-
} else {
|
|
86205
|
-
str = "NaN";
|
|
86206
|
-
}
|
|
86207
|
-
} else {
|
|
86208
|
-
if (b == null) {
|
|
86209
|
-
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(coeffToString(n.c), e) : toFixedPoint(coeffToString(n.c), e, "0");
|
|
86210
|
-
} else if (b === 10 && alphabetHasNormalDecimalDigits) {
|
|
86211
|
-
n = round(new BigNumber3(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);
|
|
86212
|
-
str = toFixedPoint(coeffToString(n.c), n.e, "0");
|
|
86213
|
-
} else {
|
|
86214
|
-
intCheck(b, 2, ALPHABET.length, "Base");
|
|
86215
|
-
str = convertBase(toFixedPoint(coeffToString(n.c), e, "0"), 10, b, s, true);
|
|
86216
|
-
}
|
|
86217
|
-
if (s < 0 && n.c[0]) str = "-" + str;
|
|
86218
|
-
}
|
|
86219
|
-
return str;
|
|
86220
|
-
};
|
|
86221
|
-
P.valueOf = P.toJSON = function() {
|
|
86222
|
-
return valueOf(this);
|
|
86223
|
-
};
|
|
86224
|
-
P._isBigNumber = true;
|
|
86225
|
-
P[Symbol.toStringTag] = "BigNumber";
|
|
86226
|
-
P[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = P.valueOf;
|
|
86227
|
-
if (configObject != null) BigNumber3.set(configObject);
|
|
86228
|
-
return BigNumber3;
|
|
86229
|
-
}
|
|
86230
|
-
function bitFloor(n) {
|
|
86231
|
-
var i = n | 0;
|
|
86232
|
-
return n > 0 || n === i ? i : i - 1;
|
|
86233
|
-
}
|
|
86234
|
-
function coeffToString(a) {
|
|
86235
|
-
var s, z3, i = 1, j = a.length, r = a[0] + "";
|
|
86236
|
-
for (; i < j; ) {
|
|
86237
|
-
s = a[i++] + "";
|
|
86238
|
-
z3 = LOG_BASE - s.length;
|
|
86239
|
-
for (; z3--; s = "0" + s) ;
|
|
86240
|
-
r += s;
|
|
86241
|
-
}
|
|
86242
|
-
for (j = r.length; r.charCodeAt(--j) === 48; ) ;
|
|
86243
|
-
return r.slice(0, j + 1 || 1);
|
|
86244
|
-
}
|
|
86245
|
-
function compare(x, y) {
|
|
86246
|
-
var a, b, xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e;
|
|
86247
|
-
if (!i || !j) return null;
|
|
86248
|
-
a = xc && !xc[0];
|
|
86249
|
-
b = yc && !yc[0];
|
|
86250
|
-
if (a || b) return a ? b ? 0 : -j : i;
|
|
86251
|
-
if (i != j) return i;
|
|
86252
|
-
a = i < 0;
|
|
86253
|
-
b = k == l;
|
|
86254
|
-
if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;
|
|
86255
|
-
if (!b) return k > l ^ a ? 1 : -1;
|
|
86256
|
-
j = (k = xc.length) < (l = yc.length) ? k : l;
|
|
86257
|
-
for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;
|
|
86258
|
-
return k == l ? 0 : k > l ^ a ? 1 : -1;
|
|
86259
|
-
}
|
|
86260
|
-
function intCheck(n, min, max, name) {
|
|
86261
|
-
if (n < min || n > max || n !== mathfloor(n)) {
|
|
86262
|
-
throw Error(bignumberError + (name || "Argument") + (typeof n == "number" ? n < min || n > max ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n));
|
|
86263
|
-
}
|
|
86264
|
-
}
|
|
86265
|
-
function isOdd(n) {
|
|
86266
|
-
var k = n.c.length - 1;
|
|
86267
|
-
return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;
|
|
86268
|
-
}
|
|
86269
|
-
function toExponential(str, e) {
|
|
86270
|
-
return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e < 0 ? "e" : "e+") + e;
|
|
86271
|
-
}
|
|
86272
|
-
function toFixedPoint(str, e, z3) {
|
|
86273
|
-
var len, zs;
|
|
86274
|
-
if (e < 0) {
|
|
86275
|
-
for (zs = z3 + "."; ++e; zs += z3) ;
|
|
86276
|
-
str = zs + str;
|
|
86277
|
-
} else {
|
|
86278
|
-
len = str.length;
|
|
86279
|
-
if (++e > len) {
|
|
86280
|
-
for (zs = z3, e -= len; --e; zs += z3) ;
|
|
86281
|
-
str += zs;
|
|
86282
|
-
} else if (e < len) {
|
|
86283
|
-
str = str.slice(0, e) + "." + str.slice(e);
|
|
86284
|
-
}
|
|
86285
|
-
}
|
|
86286
|
-
return str;
|
|
86287
|
-
}
|
|
86288
|
-
var BigNumber = clone2();
|
|
86289
|
-
|
|
86290
|
-
// lib/json.ts
|
|
86291
84947
|
var JSONbigParser = (0, import_json_bigint.default)({ storeAsString: false });
|
|
86292
84948
|
var JSONbigSerializer = (0, import_json_bigint.default)({ useNativeBigInt: true });
|
|
86293
84949
|
var MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
|
|
86294
84950
|
var MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
|
|
84951
|
+
function isBigNumber(value) {
|
|
84952
|
+
return value !== null && typeof value === "object" && value._isBigNumber === true && typeof value.isInteger === "function" && typeof value.toFixed === "function" && typeof value.toNumber === "function";
|
|
84953
|
+
}
|
|
86295
84954
|
function reviver(_key, value) {
|
|
86296
|
-
if (
|
|
84955
|
+
if (isBigNumber(value)) {
|
|
86297
84956
|
if (value.isInteger()) {
|
|
86298
84957
|
const str = value.toFixed();
|
|
86299
84958
|
const bi = BigInt(str);
|
|
@@ -87410,7 +86069,7 @@ import path from "path";
|
|
|
87410
86069
|
|
|
87411
86070
|
// node_modules/@appwrite.io/console/dist/esm/sdk.js
|
|
87412
86071
|
var import_json_bigint2 = __toESM(require_json_bigint(), 1);
|
|
87413
|
-
var
|
|
86072
|
+
var import_bignumber = __toESM(require_bignumber2(), 1);
|
|
87414
86073
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
87415
86074
|
function adopt(value) {
|
|
87416
86075
|
return value instanceof P ? value : new P(function(resolve3) {
|
|
@@ -87531,7 +86190,7 @@ var JSONbigSerializer2 = (0, import_json_bigint2.default)({ useNativeBigInt: tru
|
|
|
87531
86190
|
var MAX_SAFE2 = BigInt(Number.MAX_SAFE_INTEGER);
|
|
87532
86191
|
var MIN_SAFE2 = BigInt(Number.MIN_SAFE_INTEGER);
|
|
87533
86192
|
function reviver2(_key, value) {
|
|
87534
|
-
if (
|
|
86193
|
+
if (import_bignumber.default.isBigNumber(value)) {
|
|
87535
86194
|
if (value.isInteger()) {
|
|
87536
86195
|
const str = value.toFixed();
|
|
87537
86196
|
const bi = BigInt(str);
|
|
@@ -87585,7 +86244,7 @@ var Client = class _Client {
|
|
|
87585
86244
|
"x-sdk-name": "Console",
|
|
87586
86245
|
"x-sdk-platform": "console",
|
|
87587
86246
|
"x-sdk-language": "web",
|
|
87588
|
-
"x-sdk-version": "2.
|
|
86247
|
+
"x-sdk-version": "2.3.1",
|
|
87589
86248
|
"X-Appwrite-Response-Format": "1.8.0"
|
|
87590
86249
|
};
|
|
87591
86250
|
this.realtime = {
|
|
@@ -87594,7 +86253,10 @@ var Client = class _Client {
|
|
|
87594
86253
|
heartbeat: void 0,
|
|
87595
86254
|
url: "",
|
|
87596
86255
|
channels: /* @__PURE__ */ new Set(),
|
|
86256
|
+
queries: /* @__PURE__ */ new Set(),
|
|
87597
86257
|
subscriptions: /* @__PURE__ */ new Map(),
|
|
86258
|
+
slotToSubscriptionId: /* @__PURE__ */ new Map(),
|
|
86259
|
+
subscriptionIdToSlot: /* @__PURE__ */ new Map(),
|
|
87598
86260
|
subscriptionsCounter: 0,
|
|
87599
86261
|
reconnect: true,
|
|
87600
86262
|
reconnectAttempts: 0,
|
|
@@ -87629,24 +86291,31 @@ var Client = class _Client {
|
|
|
87629
86291
|
}, 2e4);
|
|
87630
86292
|
},
|
|
87631
86293
|
createSocket: () => {
|
|
87632
|
-
var _a3, _b, _c;
|
|
87633
|
-
if (this.realtime.
|
|
86294
|
+
var _a3, _b, _c, _d;
|
|
86295
|
+
if (this.realtime.subscriptions.size < 1) {
|
|
87634
86296
|
this.realtime.reconnect = false;
|
|
87635
86297
|
(_a3 = this.realtime.socket) === null || _a3 === void 0 ? void 0 : _a3.close();
|
|
87636
86298
|
return;
|
|
87637
86299
|
}
|
|
87638
|
-
const
|
|
87639
|
-
|
|
87640
|
-
channels.set("project", this.config.project);
|
|
87641
|
-
}
|
|
86300
|
+
const encodedProject = encodeURIComponent((_b = this.config.project) !== null && _b !== void 0 ? _b : "");
|
|
86301
|
+
let queryParams = "project=" + encodedProject;
|
|
87642
86302
|
this.realtime.channels.forEach((channel) => {
|
|
87643
|
-
|
|
86303
|
+
queryParams += "&channels[]=" + encodeURIComponent(channel);
|
|
87644
86304
|
});
|
|
87645
|
-
const
|
|
86305
|
+
const selectAllQuery = Query.select(["*"]).toString();
|
|
86306
|
+
this.realtime.subscriptions.forEach((sub, slot) => {
|
|
86307
|
+
const queries = sub.queries.length > 0 ? sub.queries : [selectAllQuery];
|
|
86308
|
+
sub.channels.forEach((channel) => {
|
|
86309
|
+
queries.forEach((query) => {
|
|
86310
|
+
queryParams += "&" + encodeURIComponent(channel) + "[" + slot + "][]=" + encodeURIComponent(query);
|
|
86311
|
+
});
|
|
86312
|
+
});
|
|
86313
|
+
});
|
|
86314
|
+
const url2 = this.config.endpointRealtime + "/realtime?" + queryParams;
|
|
87646
86315
|
if (url2 !== this.realtime.url || // Check if URL is present
|
|
87647
86316
|
!this.realtime.socket || // Check if WebSocket has not been created
|
|
87648
|
-
((
|
|
87649
|
-
if (this.realtime.socket && ((
|
|
86317
|
+
((_c = this.realtime.socket) === null || _c === void 0 ? void 0 : _c.readyState) > WebSocket.OPEN) {
|
|
86318
|
+
if (this.realtime.socket && ((_d = this.realtime.socket) === null || _d === void 0 ? void 0 : _d.readyState) < WebSocket.CLOSING) {
|
|
87650
86319
|
this.realtime.reconnect = false;
|
|
87651
86320
|
this.realtime.socket.close();
|
|
87652
86321
|
}
|
|
@@ -87679,14 +86348,25 @@ var Client = class _Client {
|
|
|
87679
86348
|
const message = JSONbig.parse(event.data);
|
|
87680
86349
|
this.realtime.lastMessage = message;
|
|
87681
86350
|
switch (message.type) {
|
|
87682
|
-
case "connected":
|
|
86351
|
+
case "connected": {
|
|
86352
|
+
const messageData = message.data;
|
|
86353
|
+
if (messageData === null || messageData === void 0 ? void 0 : messageData.subscriptions) {
|
|
86354
|
+
this.realtime.slotToSubscriptionId.clear();
|
|
86355
|
+
this.realtime.subscriptionIdToSlot.clear();
|
|
86356
|
+
for (const [slotStr, subscriptionId] of Object.entries(messageData.subscriptions)) {
|
|
86357
|
+
const slot = Number(slotStr);
|
|
86358
|
+
if (!isNaN(slot) && typeof subscriptionId === "string") {
|
|
86359
|
+
this.realtime.slotToSubscriptionId.set(slot, subscriptionId);
|
|
86360
|
+
this.realtime.subscriptionIdToSlot.set(subscriptionId, slot);
|
|
86361
|
+
}
|
|
86362
|
+
}
|
|
86363
|
+
}
|
|
87683
86364
|
let session = this.config.session;
|
|
87684
86365
|
if (!session) {
|
|
87685
86366
|
const cookie = JSONbig.parse((_a3 = window.localStorage.getItem("cookieFallback")) !== null && _a3 !== void 0 ? _a3 : "{}");
|
|
87686
86367
|
session = cookie === null || cookie === void 0 ? void 0 : cookie[`a_session_${this.config.project}`];
|
|
87687
86368
|
}
|
|
87688
|
-
|
|
87689
|
-
if (session && !messageData.user) {
|
|
86369
|
+
if (session && !(messageData === null || messageData === void 0 ? void 0 : messageData.user)) {
|
|
87690
86370
|
(_b = this.realtime.socket) === null || _b === void 0 ? void 0 : _b.send(JSONbig.stringify({
|
|
87691
86371
|
type: "authentication",
|
|
87692
86372
|
data: {
|
|
@@ -87695,12 +86375,26 @@ var Client = class _Client {
|
|
|
87695
86375
|
}));
|
|
87696
86376
|
}
|
|
87697
86377
|
break;
|
|
87698
|
-
|
|
87699
|
-
|
|
87700
|
-
|
|
86378
|
+
}
|
|
86379
|
+
case "event": {
|
|
86380
|
+
const data = message.data;
|
|
86381
|
+
if (!(data === null || data === void 0 ? void 0 : data.channels))
|
|
86382
|
+
break;
|
|
86383
|
+
const eventSubIds = data.subscriptions;
|
|
86384
|
+
if (eventSubIds && eventSubIds.length > 0) {
|
|
86385
|
+
for (const subscriptionId of eventSubIds) {
|
|
86386
|
+
const slot = this.realtime.subscriptionIdToSlot.get(subscriptionId);
|
|
86387
|
+
if (slot !== void 0) {
|
|
86388
|
+
const subscription = this.realtime.subscriptions.get(slot);
|
|
86389
|
+
if (subscription) {
|
|
86390
|
+
setTimeout(() => subscription.callback(data));
|
|
86391
|
+
}
|
|
86392
|
+
}
|
|
86393
|
+
}
|
|
86394
|
+
} else {
|
|
87701
86395
|
const isSubscribed = data.channels.some((channel) => this.realtime.channels.has(channel));
|
|
87702
86396
|
if (!isSubscribed)
|
|
87703
|
-
|
|
86397
|
+
break;
|
|
87704
86398
|
this.realtime.subscriptions.forEach((subscription) => {
|
|
87705
86399
|
if (data.channels.some((channel) => subscription.channels.includes(channel))) {
|
|
87706
86400
|
setTimeout(() => subscription.callback(data));
|
|
@@ -87708,6 +86402,7 @@ var Client = class _Client {
|
|
|
87708
86402
|
});
|
|
87709
86403
|
}
|
|
87710
86404
|
break;
|
|
86405
|
+
}
|
|
87711
86406
|
case "pong":
|
|
87712
86407
|
break;
|
|
87713
86408
|
// Handle pong response if needed
|
|
@@ -87720,7 +86415,7 @@ var Client = class _Client {
|
|
|
87720
86415
|
console.error(e);
|
|
87721
86416
|
}
|
|
87722
86417
|
},
|
|
87723
|
-
cleanUp: (channels) => {
|
|
86418
|
+
cleanUp: (channels, queries) => {
|
|
87724
86419
|
this.realtime.channels.forEach((channel) => {
|
|
87725
86420
|
if (channels.includes(channel)) {
|
|
87726
86421
|
let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {
|
|
@@ -87731,6 +86426,17 @@ var Client = class _Client {
|
|
|
87731
86426
|
}
|
|
87732
86427
|
}
|
|
87733
86428
|
});
|
|
86429
|
+
this.realtime.queries.forEach((query) => {
|
|
86430
|
+
if (queries.includes(query)) {
|
|
86431
|
+
let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {
|
|
86432
|
+
var _a3;
|
|
86433
|
+
return (_a3 = subscription.queries) === null || _a3 === void 0 ? void 0 : _a3.includes(query);
|
|
86434
|
+
});
|
|
86435
|
+
if (!found) {
|
|
86436
|
+
this.realtime.queries.delete(query);
|
|
86437
|
+
}
|
|
86438
|
+
}
|
|
86439
|
+
});
|
|
87734
86440
|
}
|
|
87735
86441
|
};
|
|
87736
86442
|
}
|
|
@@ -87911,7 +86617,7 @@ var Client = class _Client {
|
|
|
87911
86617
|
* @param {(payload: RealtimeMessage) => void} callback Is called on every realtime update.
|
|
87912
86618
|
* @returns {() => void} Unsubscribes from events.
|
|
87913
86619
|
*/
|
|
87914
|
-
subscribe(channels, callback) {
|
|
86620
|
+
subscribe(channels, callback, queries = []) {
|
|
87915
86621
|
const channelArray = Array.isArray(channels) ? channels : [channels];
|
|
87916
86622
|
const channelStrings = channelArray.map((ch) => {
|
|
87917
86623
|
if (typeof ch === "string") {
|
|
@@ -87923,15 +86629,18 @@ var Client = class _Client {
|
|
|
87923
86629
|
return String(ch);
|
|
87924
86630
|
});
|
|
87925
86631
|
channelStrings.forEach((channel) => this.realtime.channels.add(channel));
|
|
86632
|
+
const queryStrings = (queries !== null && queries !== void 0 ? queries : []).map((q) => typeof q === "string" ? q : q.toString());
|
|
86633
|
+
queryStrings.forEach((query) => this.realtime.queries.add(query));
|
|
87926
86634
|
const counter = this.realtime.subscriptionsCounter++;
|
|
87927
86635
|
this.realtime.subscriptions.set(counter, {
|
|
87928
86636
|
channels: channelStrings,
|
|
86637
|
+
queries: queryStrings,
|
|
87929
86638
|
callback
|
|
87930
86639
|
});
|
|
87931
86640
|
this.realtime.connect();
|
|
87932
86641
|
return () => {
|
|
87933
86642
|
this.realtime.subscriptions.delete(counter);
|
|
87934
|
-
this.realtime.cleanUp(channelStrings);
|
|
86643
|
+
this.realtime.cleanUp(channelStrings, queryStrings);
|
|
87935
86644
|
this.realtime.connect();
|
|
87936
86645
|
};
|
|
87937
86646
|
}
|
|
@@ -89812,7 +88521,8 @@ var Databases = class {
|
|
|
89812
88521
|
key: rest[1],
|
|
89813
88522
|
required: rest[2],
|
|
89814
88523
|
xdefault: rest[3],
|
|
89815
|
-
array: rest[4]
|
|
88524
|
+
array: rest[4],
|
|
88525
|
+
encrypt: rest[5]
|
|
89816
88526
|
};
|
|
89817
88527
|
}
|
|
89818
88528
|
const databaseId = params.databaseId;
|
|
@@ -89821,6 +88531,7 @@ var Databases = class {
|
|
|
89821
88531
|
const required2 = params.required;
|
|
89822
88532
|
const xdefault = params.xdefault;
|
|
89823
88533
|
const array2 = params.array;
|
|
88534
|
+
const encrypt = params.encrypt;
|
|
89824
88535
|
if (typeof databaseId === "undefined") {
|
|
89825
88536
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
89826
88537
|
}
|
|
@@ -89847,6 +88558,9 @@ var Databases = class {
|
|
|
89847
88558
|
if (typeof array2 !== "undefined") {
|
|
89848
88559
|
payload["array"] = array2;
|
|
89849
88560
|
}
|
|
88561
|
+
if (typeof encrypt !== "undefined") {
|
|
88562
|
+
payload["encrypt"] = encrypt;
|
|
88563
|
+
}
|
|
89850
88564
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
89851
88565
|
const apiHeaders = {
|
|
89852
88566
|
"content-type": "application/json"
|
|
@@ -89916,7 +88630,8 @@ var Databases = class {
|
|
|
89916
88630
|
key: rest[1],
|
|
89917
88631
|
required: rest[2],
|
|
89918
88632
|
xdefault: rest[3],
|
|
89919
|
-
array: rest[4]
|
|
88633
|
+
array: rest[4],
|
|
88634
|
+
encrypt: rest[5]
|
|
89920
88635
|
};
|
|
89921
88636
|
}
|
|
89922
88637
|
const databaseId = params.databaseId;
|
|
@@ -89925,6 +88640,7 @@ var Databases = class {
|
|
|
89925
88640
|
const required2 = params.required;
|
|
89926
88641
|
const xdefault = params.xdefault;
|
|
89927
88642
|
const array2 = params.array;
|
|
88643
|
+
const encrypt = params.encrypt;
|
|
89928
88644
|
if (typeof databaseId === "undefined") {
|
|
89929
88645
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
89930
88646
|
}
|
|
@@ -89951,6 +88667,9 @@ var Databases = class {
|
|
|
89951
88667
|
if (typeof array2 !== "undefined") {
|
|
89952
88668
|
payload["array"] = array2;
|
|
89953
88669
|
}
|
|
88670
|
+
if (typeof encrypt !== "undefined") {
|
|
88671
|
+
payload["encrypt"] = encrypt;
|
|
88672
|
+
}
|
|
89954
88673
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
89955
88674
|
const apiHeaders = {
|
|
89956
88675
|
"content-type": "application/json"
|
|
@@ -90396,7 +89115,8 @@ var Databases = class {
|
|
|
90396
89115
|
key: rest[1],
|
|
90397
89116
|
required: rest[2],
|
|
90398
89117
|
xdefault: rest[3],
|
|
90399
|
-
array: rest[4]
|
|
89118
|
+
array: rest[4],
|
|
89119
|
+
encrypt: rest[5]
|
|
90400
89120
|
};
|
|
90401
89121
|
}
|
|
90402
89122
|
const databaseId = params.databaseId;
|
|
@@ -90405,6 +89125,7 @@ var Databases = class {
|
|
|
90405
89125
|
const required2 = params.required;
|
|
90406
89126
|
const xdefault = params.xdefault;
|
|
90407
89127
|
const array2 = params.array;
|
|
89128
|
+
const encrypt = params.encrypt;
|
|
90408
89129
|
if (typeof databaseId === "undefined") {
|
|
90409
89130
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
90410
89131
|
}
|
|
@@ -90431,6 +89152,9 @@ var Databases = class {
|
|
|
90431
89152
|
if (typeof array2 !== "undefined") {
|
|
90432
89153
|
payload["array"] = array2;
|
|
90433
89154
|
}
|
|
89155
|
+
if (typeof encrypt !== "undefined") {
|
|
89156
|
+
payload["encrypt"] = encrypt;
|
|
89157
|
+
}
|
|
90434
89158
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
90435
89159
|
const apiHeaders = {
|
|
90436
89160
|
"content-type": "application/json"
|
|
@@ -90605,7 +89329,8 @@ var Databases = class {
|
|
|
90605
89329
|
size: rest[2],
|
|
90606
89330
|
required: rest[3],
|
|
90607
89331
|
xdefault: rest[4],
|
|
90608
|
-
array: rest[5]
|
|
89332
|
+
array: rest[5],
|
|
89333
|
+
encrypt: rest[6]
|
|
90609
89334
|
};
|
|
90610
89335
|
}
|
|
90611
89336
|
const databaseId = params.databaseId;
|
|
@@ -90615,6 +89340,7 @@ var Databases = class {
|
|
|
90615
89340
|
const required2 = params.required;
|
|
90616
89341
|
const xdefault = params.xdefault;
|
|
90617
89342
|
const array2 = params.array;
|
|
89343
|
+
const encrypt = params.encrypt;
|
|
90618
89344
|
if (typeof databaseId === "undefined") {
|
|
90619
89345
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
90620
89346
|
}
|
|
@@ -90647,6 +89373,9 @@ var Databases = class {
|
|
|
90647
89373
|
if (typeof array2 !== "undefined") {
|
|
90648
89374
|
payload["array"] = array2;
|
|
90649
89375
|
}
|
|
89376
|
+
if (typeof encrypt !== "undefined") {
|
|
89377
|
+
payload["encrypt"] = encrypt;
|
|
89378
|
+
}
|
|
90650
89379
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
90651
89380
|
const apiHeaders = {
|
|
90652
89381
|
"content-type": "application/json"
|
|
@@ -91797,7 +90526,7 @@ var Functions = class {
|
|
|
91797
90526
|
}
|
|
91798
90527
|
listTemplates(paramsOrFirst, ...rest) {
|
|
91799
90528
|
let params;
|
|
91800
|
-
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "runtimes" in paramsOrFirst) {
|
|
90529
|
+
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("runtimes" in paramsOrFirst || "useCases" in paramsOrFirst || "limit" in paramsOrFirst || "offset" in paramsOrFirst || "total" in paramsOrFirst)) {
|
|
91801
90530
|
params = paramsOrFirst || {};
|
|
91802
90531
|
} else {
|
|
91803
90532
|
params = {
|
|
@@ -96574,32 +95303,6 @@ var Organizations = class {
|
|
|
96574
95303
|
};
|
|
96575
95304
|
return this.client.call("patch", uri, apiHeaders, payload);
|
|
96576
95305
|
}
|
|
96577
|
-
updateProjects(paramsOrFirst, ...rest) {
|
|
96578
|
-
let params;
|
|
96579
|
-
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
96580
|
-
params = paramsOrFirst || {};
|
|
96581
|
-
} else {
|
|
96582
|
-
params = {
|
|
96583
|
-
organizationId: paramsOrFirst,
|
|
96584
|
-
projects: rest[0]
|
|
96585
|
-
};
|
|
96586
|
-
}
|
|
96587
|
-
const organizationId = params.organizationId;
|
|
96588
|
-
const projects = params.projects;
|
|
96589
|
-
if (typeof organizationId === "undefined") {
|
|
96590
|
-
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
96591
|
-
}
|
|
96592
|
-
const apiPath = "/organizations/{organizationId}/projects".replace("{organizationId}", organizationId);
|
|
96593
|
-
const payload = {};
|
|
96594
|
-
if (typeof projects !== "undefined") {
|
|
96595
|
-
payload["projects"] = projects;
|
|
96596
|
-
}
|
|
96597
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
96598
|
-
const apiHeaders = {
|
|
96599
|
-
"content-type": "application/json"
|
|
96600
|
-
};
|
|
96601
|
-
return this.client.call("patch", uri, apiHeaders, payload);
|
|
96602
|
-
}
|
|
96603
95306
|
listRegions(paramsOrFirst) {
|
|
96604
95307
|
let params;
|
|
96605
95308
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
@@ -97626,16 +96329,21 @@ var Projects = class {
|
|
|
97626
96329
|
} else {
|
|
97627
96330
|
params = {
|
|
97628
96331
|
projectId: paramsOrFirst,
|
|
97629
|
-
|
|
96332
|
+
queries: rest[0],
|
|
96333
|
+
total: rest[1]
|
|
97630
96334
|
};
|
|
97631
96335
|
}
|
|
97632
96336
|
const projectId = params.projectId;
|
|
96337
|
+
const queries = params.queries;
|
|
97633
96338
|
const total = params.total;
|
|
97634
96339
|
if (typeof projectId === "undefined") {
|
|
97635
96340
|
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
97636
96341
|
}
|
|
97637
96342
|
const apiPath = "/projects/{projectId}/keys".replace("{projectId}", projectId);
|
|
97638
96343
|
const payload = {};
|
|
96344
|
+
if (typeof queries !== "undefined") {
|
|
96345
|
+
payload["queries"] = queries;
|
|
96346
|
+
}
|
|
97639
96347
|
if (typeof total !== "undefined") {
|
|
97640
96348
|
payload["total"] = total;
|
|
97641
96349
|
}
|
|
@@ -97652,12 +96360,14 @@ var Projects = class {
|
|
|
97652
96360
|
projectId: paramsOrFirst,
|
|
97653
96361
|
name: rest[0],
|
|
97654
96362
|
scopes: rest[1],
|
|
97655
|
-
|
|
96363
|
+
keyId: rest[2],
|
|
96364
|
+
expire: rest[3]
|
|
97656
96365
|
};
|
|
97657
96366
|
}
|
|
97658
96367
|
const projectId = params.projectId;
|
|
97659
96368
|
const name = params.name;
|
|
97660
96369
|
const scopes = params.scopes;
|
|
96370
|
+
const keyId = params.keyId;
|
|
97661
96371
|
const expire = params.expire;
|
|
97662
96372
|
if (typeof projectId === "undefined") {
|
|
97663
96373
|
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
@@ -97670,6 +96380,9 @@ var Projects = class {
|
|
|
97670
96380
|
}
|
|
97671
96381
|
const apiPath = "/projects/{projectId}/keys".replace("{projectId}", projectId);
|
|
97672
96382
|
const payload = {};
|
|
96383
|
+
if (typeof keyId !== "undefined") {
|
|
96384
|
+
payload["keyId"] = keyId;
|
|
96385
|
+
}
|
|
97673
96386
|
if (typeof name !== "undefined") {
|
|
97674
96387
|
payload["name"] = name;
|
|
97675
96388
|
}
|
|
@@ -98390,35 +97103,6 @@ var Projects = class {
|
|
|
98390
97103
|
};
|
|
98391
97104
|
return this.client.call("post", uri, apiHeaders, payload);
|
|
98392
97105
|
}
|
|
98393
|
-
updateStatus(paramsOrFirst, ...rest) {
|
|
98394
|
-
let params;
|
|
98395
|
-
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
98396
|
-
params = paramsOrFirst || {};
|
|
98397
|
-
} else {
|
|
98398
|
-
params = {
|
|
98399
|
-
projectId: paramsOrFirst,
|
|
98400
|
-
status: rest[0]
|
|
98401
|
-
};
|
|
98402
|
-
}
|
|
98403
|
-
const projectId = params.projectId;
|
|
98404
|
-
const status = params.status;
|
|
98405
|
-
if (typeof projectId === "undefined") {
|
|
98406
|
-
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
98407
|
-
}
|
|
98408
|
-
if (typeof status === "undefined") {
|
|
98409
|
-
throw new AppwriteException('Missing required parameter: "status"');
|
|
98410
|
-
}
|
|
98411
|
-
const apiPath = "/projects/{projectId}/status".replace("{projectId}", projectId);
|
|
98412
|
-
const payload = {};
|
|
98413
|
-
if (typeof status !== "undefined") {
|
|
98414
|
-
payload["status"] = status;
|
|
98415
|
-
}
|
|
98416
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
98417
|
-
const apiHeaders = {
|
|
98418
|
-
"content-type": "application/json"
|
|
98419
|
-
};
|
|
98420
|
-
return this.client.call("patch", uri, apiHeaders, payload);
|
|
98421
|
-
}
|
|
98422
97106
|
updateTeam(paramsOrFirst, ...rest) {
|
|
98423
97107
|
let params;
|
|
98424
97108
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
@@ -99438,7 +98122,7 @@ var Sites = class {
|
|
|
99438
98122
|
}
|
|
99439
98123
|
listTemplates(paramsOrFirst, ...rest) {
|
|
99440
98124
|
let params;
|
|
99441
|
-
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "frameworks" in paramsOrFirst) {
|
|
98125
|
+
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("frameworks" in paramsOrFirst || "useCases" in paramsOrFirst || "limit" in paramsOrFirst || "offset" in paramsOrFirst)) {
|
|
99442
98126
|
params = paramsOrFirst || {};
|
|
99443
98127
|
} else {
|
|
99444
98128
|
params = {
|
|
@@ -102280,7 +100964,8 @@ var TablesDB = class {
|
|
|
102280
100964
|
key: rest[1],
|
|
102281
100965
|
required: rest[2],
|
|
102282
100966
|
xdefault: rest[3],
|
|
102283
|
-
array: rest[4]
|
|
100967
|
+
array: rest[4],
|
|
100968
|
+
encrypt: rest[5]
|
|
102284
100969
|
};
|
|
102285
100970
|
}
|
|
102286
100971
|
const databaseId = params.databaseId;
|
|
@@ -102289,6 +100974,7 @@ var TablesDB = class {
|
|
|
102289
100974
|
const required2 = params.required;
|
|
102290
100975
|
const xdefault = params.xdefault;
|
|
102291
100976
|
const array2 = params.array;
|
|
100977
|
+
const encrypt = params.encrypt;
|
|
102292
100978
|
if (typeof databaseId === "undefined") {
|
|
102293
100979
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
102294
100980
|
}
|
|
@@ -102315,6 +101001,9 @@ var TablesDB = class {
|
|
|
102315
101001
|
if (typeof array2 !== "undefined") {
|
|
102316
101002
|
payload["array"] = array2;
|
|
102317
101003
|
}
|
|
101004
|
+
if (typeof encrypt !== "undefined") {
|
|
101005
|
+
payload["encrypt"] = encrypt;
|
|
101006
|
+
}
|
|
102318
101007
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
102319
101008
|
const apiHeaders = {
|
|
102320
101009
|
"content-type": "application/json"
|
|
@@ -102384,7 +101073,8 @@ var TablesDB = class {
|
|
|
102384
101073
|
key: rest[1],
|
|
102385
101074
|
required: rest[2],
|
|
102386
101075
|
xdefault: rest[3],
|
|
102387
|
-
array: rest[4]
|
|
101076
|
+
array: rest[4],
|
|
101077
|
+
encrypt: rest[5]
|
|
102388
101078
|
};
|
|
102389
101079
|
}
|
|
102390
101080
|
const databaseId = params.databaseId;
|
|
@@ -102393,6 +101083,7 @@ var TablesDB = class {
|
|
|
102393
101083
|
const required2 = params.required;
|
|
102394
101084
|
const xdefault = params.xdefault;
|
|
102395
101085
|
const array2 = params.array;
|
|
101086
|
+
const encrypt = params.encrypt;
|
|
102396
101087
|
if (typeof databaseId === "undefined") {
|
|
102397
101088
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
102398
101089
|
}
|
|
@@ -102419,6 +101110,9 @@ var TablesDB = class {
|
|
|
102419
101110
|
if (typeof array2 !== "undefined") {
|
|
102420
101111
|
payload["array"] = array2;
|
|
102421
101112
|
}
|
|
101113
|
+
if (typeof encrypt !== "undefined") {
|
|
101114
|
+
payload["encrypt"] = encrypt;
|
|
101115
|
+
}
|
|
102422
101116
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
102423
101117
|
const apiHeaders = {
|
|
102424
101118
|
"content-type": "application/json"
|
|
@@ -102864,7 +101558,8 @@ var TablesDB = class {
|
|
|
102864
101558
|
key: rest[1],
|
|
102865
101559
|
required: rest[2],
|
|
102866
101560
|
xdefault: rest[3],
|
|
102867
|
-
array: rest[4]
|
|
101561
|
+
array: rest[4],
|
|
101562
|
+
encrypt: rest[5]
|
|
102868
101563
|
};
|
|
102869
101564
|
}
|
|
102870
101565
|
const databaseId = params.databaseId;
|
|
@@ -102873,6 +101568,7 @@ var TablesDB = class {
|
|
|
102873
101568
|
const required2 = params.required;
|
|
102874
101569
|
const xdefault = params.xdefault;
|
|
102875
101570
|
const array2 = params.array;
|
|
101571
|
+
const encrypt = params.encrypt;
|
|
102876
101572
|
if (typeof databaseId === "undefined") {
|
|
102877
101573
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
102878
101574
|
}
|
|
@@ -102899,6 +101595,9 @@ var TablesDB = class {
|
|
|
102899
101595
|
if (typeof array2 !== "undefined") {
|
|
102900
101596
|
payload["array"] = array2;
|
|
102901
101597
|
}
|
|
101598
|
+
if (typeof encrypt !== "undefined") {
|
|
101599
|
+
payload["encrypt"] = encrypt;
|
|
101600
|
+
}
|
|
102902
101601
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
102903
101602
|
const apiHeaders = {
|
|
102904
101603
|
"content-type": "application/json"
|
|
@@ -103073,7 +101772,8 @@ var TablesDB = class {
|
|
|
103073
101772
|
size: rest[2],
|
|
103074
101773
|
required: rest[3],
|
|
103075
101774
|
xdefault: rest[4],
|
|
103076
|
-
array: rest[5]
|
|
101775
|
+
array: rest[5],
|
|
101776
|
+
encrypt: rest[6]
|
|
103077
101777
|
};
|
|
103078
101778
|
}
|
|
103079
101779
|
const databaseId = params.databaseId;
|
|
@@ -103083,6 +101783,7 @@ var TablesDB = class {
|
|
|
103083
101783
|
const required2 = params.required;
|
|
103084
101784
|
const xdefault = params.xdefault;
|
|
103085
101785
|
const array2 = params.array;
|
|
101786
|
+
const encrypt = params.encrypt;
|
|
103086
101787
|
if (typeof databaseId === "undefined") {
|
|
103087
101788
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
103088
101789
|
}
|
|
@@ -103115,6 +101816,9 @@ var TablesDB = class {
|
|
|
103115
101816
|
if (typeof array2 !== "undefined") {
|
|
103116
101817
|
payload["array"] = array2;
|
|
103117
101818
|
}
|
|
101819
|
+
if (typeof encrypt !== "undefined") {
|
|
101820
|
+
payload["encrypt"] = encrypt;
|
|
101821
|
+
}
|
|
103118
101822
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
103119
101823
|
const apiHeaders = {
|
|
103120
101824
|
"content-type": "application/json"
|
|
@@ -104754,6 +103458,7 @@ var Scopes;
|
|
|
104754
103458
|
Scopes2["RestorationsWrite"] = "restorations.write";
|
|
104755
103459
|
Scopes2["DomainsRead"] = "domains.read";
|
|
104756
103460
|
Scopes2["DomainsWrite"] = "domains.write";
|
|
103461
|
+
Scopes2["EventsRead"] = "events.read";
|
|
104757
103462
|
})(Scopes || (Scopes = {}));
|
|
104758
103463
|
var AuthenticatorType;
|
|
104759
103464
|
(function(AuthenticatorType2) {
|
|
@@ -105505,12 +104210,12 @@ var ImageFormat;
|
|
|
105505
104210
|
ImageFormat2["Avif"] = "avif";
|
|
105506
104211
|
ImageFormat2["Gif"] = "gif";
|
|
105507
104212
|
})(ImageFormat || (ImageFormat = {}));
|
|
105508
|
-
var
|
|
105509
|
-
(function(
|
|
105510
|
-
|
|
105511
|
-
|
|
105512
|
-
|
|
105513
|
-
})(
|
|
104213
|
+
var BackupServices;
|
|
104214
|
+
(function(BackupServices2) {
|
|
104215
|
+
BackupServices2["Databases"] = "databases";
|
|
104216
|
+
BackupServices2["Functions"] = "functions";
|
|
104217
|
+
BackupServices2["Storage"] = "storage";
|
|
104218
|
+
})(BackupServices || (BackupServices = {}));
|
|
105514
104219
|
var Platform;
|
|
105515
104220
|
(function(Platform2) {
|
|
105516
104221
|
Platform2["Appwrite"] = "appwrite";
|
|
@@ -105551,6 +104256,13 @@ var OrderBy;
|
|
|
105551
104256
|
OrderBy2["Asc"] = "asc";
|
|
105552
104257
|
OrderBy2["Desc"] = "desc";
|
|
105553
104258
|
})(OrderBy || (OrderBy = {}));
|
|
104259
|
+
var RegistrationType;
|
|
104260
|
+
(function(RegistrationType2) {
|
|
104261
|
+
RegistrationType2["New"] = "new";
|
|
104262
|
+
RegistrationType2["Transfer"] = "transfer";
|
|
104263
|
+
RegistrationType2["Renewal"] = "renewal";
|
|
104264
|
+
RegistrationType2["Trade"] = "trade";
|
|
104265
|
+
})(RegistrationType || (RegistrationType = {}));
|
|
105554
104266
|
var FilterType;
|
|
105555
104267
|
(function(FilterType2) {
|
|
105556
104268
|
FilterType2["Premium"] = "premium";
|
|
@@ -105594,6 +104306,7 @@ var Runtime;
|
|
|
105594
104306
|
Runtime2["Dart35"] = "dart-3.5";
|
|
105595
104307
|
Runtime2["Dart38"] = "dart-3.8";
|
|
105596
104308
|
Runtime2["Dart39"] = "dart-3.9";
|
|
104309
|
+
Runtime2["Dart310"] = "dart-3.10";
|
|
105597
104310
|
Runtime2["Dotnet60"] = "dotnet-6.0";
|
|
105598
104311
|
Runtime2["Dotnet70"] = "dotnet-7.0";
|
|
105599
104312
|
Runtime2["Dotnet80"] = "dotnet-8.0";
|
|
@@ -105622,6 +104335,7 @@ var Runtime;
|
|
|
105622
104335
|
Runtime2["Flutter329"] = "flutter-3.29";
|
|
105623
104336
|
Runtime2["Flutter332"] = "flutter-3.32";
|
|
105624
104337
|
Runtime2["Flutter335"] = "flutter-3.35";
|
|
104338
|
+
Runtime2["Flutter338"] = "flutter-3.38";
|
|
105625
104339
|
})(Runtime || (Runtime = {}));
|
|
105626
104340
|
var Runtimes;
|
|
105627
104341
|
(function(Runtimes2) {
|
|
@@ -105661,6 +104375,7 @@ var Runtimes;
|
|
|
105661
104375
|
Runtimes2["Dart35"] = "dart-3.5";
|
|
105662
104376
|
Runtimes2["Dart38"] = "dart-3.8";
|
|
105663
104377
|
Runtimes2["Dart39"] = "dart-3.9";
|
|
104378
|
+
Runtimes2["Dart310"] = "dart-3.10";
|
|
105664
104379
|
Runtimes2["Dotnet60"] = "dotnet-6.0";
|
|
105665
104380
|
Runtimes2["Dotnet70"] = "dotnet-7.0";
|
|
105666
104381
|
Runtimes2["Dotnet80"] = "dotnet-8.0";
|
|
@@ -105689,6 +104404,7 @@ var Runtimes;
|
|
|
105689
104404
|
Runtimes2["Flutter329"] = "flutter-3.29";
|
|
105690
104405
|
Runtimes2["Flutter332"] = "flutter-3.32";
|
|
105691
104406
|
Runtimes2["Flutter335"] = "flutter-3.35";
|
|
104407
|
+
Runtimes2["Flutter338"] = "flutter-3.38";
|
|
105692
104408
|
})(Runtimes || (Runtimes = {}));
|
|
105693
104409
|
var UseCases;
|
|
105694
104410
|
(function(UseCases2) {
|
|
@@ -105839,11 +104555,6 @@ var SMTPSecure;
|
|
|
105839
104555
|
SMTPSecure2["Tls"] = "tls";
|
|
105840
104556
|
SMTPSecure2["Ssl"] = "ssl";
|
|
105841
104557
|
})(SMTPSecure || (SMTPSecure = {}));
|
|
105842
|
-
var Status;
|
|
105843
|
-
(function(Status2) {
|
|
105844
|
-
Status2["Active"] = "active";
|
|
105845
|
-
Status2["Archived"] = "archived";
|
|
105846
|
-
})(Status || (Status = {}));
|
|
105847
104558
|
var EmailTemplateType;
|
|
105848
104559
|
(function(EmailTemplateType2) {
|
|
105849
104560
|
EmailTemplateType2["Verification"] = "verification";
|
|
@@ -106197,6 +104908,7 @@ var BuildRuntime;
|
|
|
106197
104908
|
BuildRuntime2["Dart35"] = "dart-3.5";
|
|
106198
104909
|
BuildRuntime2["Dart38"] = "dart-3.8";
|
|
106199
104910
|
BuildRuntime2["Dart39"] = "dart-3.9";
|
|
104911
|
+
BuildRuntime2["Dart310"] = "dart-3.10";
|
|
106200
104912
|
BuildRuntime2["Dotnet60"] = "dotnet-6.0";
|
|
106201
104913
|
BuildRuntime2["Dotnet70"] = "dotnet-7.0";
|
|
106202
104914
|
BuildRuntime2["Dotnet80"] = "dotnet-8.0";
|
|
@@ -106225,6 +104937,7 @@ var BuildRuntime;
|
|
|
106225
104937
|
BuildRuntime2["Flutter329"] = "flutter-3.29";
|
|
106226
104938
|
BuildRuntime2["Flutter332"] = "flutter-3.32";
|
|
106227
104939
|
BuildRuntime2["Flutter335"] = "flutter-3.35";
|
|
104940
|
+
BuildRuntime2["Flutter338"] = "flutter-3.38";
|
|
106228
104941
|
})(BuildRuntime || (BuildRuntime = {}));
|
|
106229
104942
|
var Adapter;
|
|
106230
104943
|
(function(Adapter2) {
|
|
@@ -106267,14 +104980,6 @@ var ImageGravity;
|
|
|
106267
104980
|
ImageGravity2["Bottom"] = "bottom";
|
|
106268
104981
|
ImageGravity2["Bottomright"] = "bottom-right";
|
|
106269
104982
|
})(ImageGravity || (ImageGravity = {}));
|
|
106270
|
-
var Roles;
|
|
106271
|
-
(function(Roles2) {
|
|
106272
|
-
Roles2["Developer"] = "developer";
|
|
106273
|
-
Roles2["Editor"] = "editor";
|
|
106274
|
-
Roles2["Analyst"] = "analyst";
|
|
106275
|
-
Roles2["Billing"] = "billing";
|
|
106276
|
-
Roles2["Owner"] = "owner";
|
|
106277
|
-
})(Roles || (Roles = {}));
|
|
106278
104983
|
var PasswordHash;
|
|
106279
104984
|
(function(PasswordHash2) {
|
|
106280
104985
|
PasswordHash2["Sha1"] = "sha1";
|
|
@@ -106400,7 +105105,7 @@ var package_default = {
|
|
|
106400
105105
|
type: "module",
|
|
106401
105106
|
homepage: "https://appwrite.io/support",
|
|
106402
105107
|
description: "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
|
|
106403
|
-
version: "13.
|
|
105108
|
+
version: "13.4.0",
|
|
106404
105109
|
license: "BSD-3-Clause",
|
|
106405
105110
|
main: "dist/index.js",
|
|
106406
105111
|
types: "dist/index.d.ts",
|
|
@@ -106429,8 +105134,7 @@ var package_default = {
|
|
|
106429
105134
|
"windows-arm64": "esbuild cli.ts --bundle --loader:.hbs=text --platform=node --target=node18 --format=esm --external:fsevents --outfile=dist/bundle-win-arm64.mjs && pkg dist/bundle-win-arm64.mjs -t node18-win-arm64 -o build/appwrite-cli-win-arm64.exe"
|
|
106430
105135
|
},
|
|
106431
105136
|
dependencies: {
|
|
106432
|
-
"@appwrite.io/console": "^2.
|
|
106433
|
-
"bignumber.js": "^9.0.0",
|
|
105137
|
+
"@appwrite.io/console": "^2.3.1",
|
|
106434
105138
|
chalk: "4.1.2",
|
|
106435
105139
|
chokidar: "^3.6.0",
|
|
106436
105140
|
"cli-progress": "^3.12.0",
|
|
@@ -109926,7 +108630,19 @@ var pushSite = async ({
|
|
|
109926
108630
|
} = result;
|
|
109927
108631
|
failedDeployments.forEach((failed) => {
|
|
109928
108632
|
const { name, deployment, $id } = failed;
|
|
109929
|
-
const
|
|
108633
|
+
const projectId = localConfig.getProject().projectId;
|
|
108634
|
+
const endpoint = localConfig.getEndpoint() || globalConfig2.getEndpoint();
|
|
108635
|
+
let region = "";
|
|
108636
|
+
try {
|
|
108637
|
+
const hostname3 = new URL(endpoint).hostname;
|
|
108638
|
+
const firstSubdomain = hostname3.split(".")[0];
|
|
108639
|
+
if (firstSubdomain.length === 3) {
|
|
108640
|
+
region = firstSubdomain;
|
|
108641
|
+
}
|
|
108642
|
+
} catch {
|
|
108643
|
+
}
|
|
108644
|
+
const projectSlug = region ? `project-${region}-${projectId}` : `project-${projectId}`;
|
|
108645
|
+
const failUrl = `${globalConfig2.getEndpoint().slice(0, -3)}/console/${projectSlug}/sites/site-${$id}/deployments/deployment-${deployment}`;
|
|
109930
108646
|
error48(
|
|
109931
108647
|
`Deployment of ${name} has failed. Check at ${failUrl} for more details
|
|
109932
108648
|
`
|
|
@@ -110034,7 +108750,19 @@ var pushFunction = async ({
|
|
|
110034
108750
|
} = result;
|
|
110035
108751
|
failedDeployments.forEach((failed) => {
|
|
110036
108752
|
const { name, deployment, $id } = failed;
|
|
110037
|
-
const
|
|
108753
|
+
const projectId = localConfig.getProject().projectId;
|
|
108754
|
+
const endpoint = localConfig.getEndpoint() || globalConfig2.getEndpoint();
|
|
108755
|
+
let region = "";
|
|
108756
|
+
try {
|
|
108757
|
+
const hostname3 = new URL(endpoint).hostname;
|
|
108758
|
+
const firstSubdomain = hostname3.split(".")[0];
|
|
108759
|
+
if (firstSubdomain.length === 3) {
|
|
108760
|
+
region = firstSubdomain;
|
|
108761
|
+
}
|
|
108762
|
+
} catch {
|
|
108763
|
+
}
|
|
108764
|
+
const projectSlug = region ? `project-${region}-${projectId}` : `project-${projectId}`;
|
|
108765
|
+
const failUrl = `${globalConfig2.getEndpoint().slice(0, -3)}/console/${projectSlug}/functions/function-${$id}/deployment-${deployment}`;
|
|
110038
108766
|
error48(
|
|
110039
108767
|
`Deployment of ${name} has failed. Check at ${failUrl} for more details
|
|
110040
108768
|
`
|
|
@@ -111936,6 +110664,9 @@ export {
|
|
|
111936
110664
|
};
|
|
111937
110665
|
/*! Bundled license information:
|
|
111938
110666
|
|
|
110667
|
+
safe-buffer/index.js:
|
|
110668
|
+
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
110669
|
+
|
|
111939
110670
|
undici/lib/fetch/body.js:
|
|
111940
110671
|
(*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
|
111941
110672
|
|