mini-program-cljs
Version:
1 lines • 96.1 kB
JavaScript
["^ ","~:resource-id",["~:shadow.build.classpath/resource","goog/math/long.js"],"~:js","goog.loadModule(function(exports) {\n \"use strict\";\n goog.module(\"goog.math.Long\");\n goog.module.declareLegacyNamespace();\n /** @const */ var asserts = goog.require(\"goog.asserts\");\n /** @const */ var reflect = goog.require(\"goog.reflect\");\n /**\n * @final\n * @struct\n * @constructor\n * @param {number} low\n * @param {number} high\n */\n var Long = function(low, high) {\n /** @private @const @type {number} */ this.low_ = low | 0;\n /** @private @const @type {number} */ this.high_ = high | 0;\n };\n /**\n * @return {number}\n */\n Long.prototype.toInt = function() {\n return this.low_;\n };\n /**\n * @return {number}\n */\n Long.prototype.toNumber = function() {\n return this.high_ * TWO_PWR_32_DBL_ + this.getLowBitsUnsigned();\n };\n /**\n * @return {boolean}\n */\n Long.prototype.isSafeInteger = function() {\n var top11Bits = this.high_ >> 21;\n return top11Bits == 0 || top11Bits == -1 && !(this.low_ == 0 && this.high_ == (4292870144 | 0));\n };\n /**\n * @param {number=} opt_radix\n * @return {string}\n * @override\n */\n Long.prototype.toString = function(opt_radix) {\n var radix = opt_radix || 10;\n if (radix < 2 || 36 < radix) {\n throw new Error(\"radix out of range: \" + radix);\n }\n if (this.isSafeInteger()) {\n var asNumber = this.toNumber();\n return radix == 10 ? \"\" + asNumber : asNumber.toString(radix);\n }\n var safeDigits = 14 - (radix >> 2);\n var radixPowSafeDigits = Math.pow(radix, safeDigits);\n var radixToPower = Long.fromBits(radixPowSafeDigits, radixPowSafeDigits / TWO_PWR_32_DBL_);\n var remDiv = this.div(radixToPower);\n var val = Math.abs(this.subtract(remDiv.multiply(radixToPower)).toNumber());\n var digits = radix == 10 ? \"\" + val : val.toString(radix);\n if (digits.length < safeDigits) {\n digits = \"0000000000000\".substr(digits.length - safeDigits) + digits;\n }\n val = remDiv.toNumber();\n return (radix == 10 ? val : val.toString(radix)) + digits;\n };\n /**\n * @return {number}\n */\n Long.prototype.getHighBits = function() {\n return this.high_;\n };\n /**\n * @return {number}\n */\n Long.prototype.getLowBits = function() {\n return this.low_;\n };\n /**\n * @return {number}\n */\n Long.prototype.getLowBitsUnsigned = function() {\n return this.low_ >>> 0;\n };\n /**\n * @return {number}\n */\n Long.prototype.getNumBitsAbs = function() {\n if (this.isNegative()) {\n if (this.equals(Long.getMinValue())) {\n return 64;\n } else {\n return this.negate().getNumBitsAbs();\n }\n } else {\n var val = this.high_ != 0 ? this.high_ : this.low_;\n for (var bit = 31; bit > 0; bit--) {\n if ((val & 1 << bit) != 0) {\n break;\n }\n }\n return this.high_ != 0 ? bit + 33 : bit + 1;\n }\n };\n /**\n * @return {boolean}\n */\n Long.prototype.isZero = function() {\n return this.low_ == 0 && this.high_ == 0;\n };\n /**\n * @return {boolean}\n */\n Long.prototype.isNegative = function() {\n return this.high_ < 0;\n };\n /**\n * @return {boolean}\n */\n Long.prototype.isOdd = function() {\n return (this.low_ & 1) == 1;\n };\n /**\n * @param {?Long} other\n * @return {boolean}\n */\n Long.prototype.equals = function(other) {\n return this.low_ == other.low_ && this.high_ == other.high_;\n };\n /**\n * @param {?Long} other\n * @return {boolean}\n */\n Long.prototype.notEquals = function(other) {\n return !this.equals(other);\n };\n /**\n * @param {?Long} other\n * @return {boolean}\n */\n Long.prototype.lessThan = function(other) {\n return this.compare(other) < 0;\n };\n /**\n * @param {?Long} other\n * @return {boolean}\n */\n Long.prototype.lessThanOrEqual = function(other) {\n return this.compare(other) <= 0;\n };\n /**\n * @param {?Long} other\n * @return {boolean}\n */\n Long.prototype.greaterThan = function(other) {\n return this.compare(other) > 0;\n };\n /**\n * @param {?Long} other\n * @return {boolean}\n */\n Long.prototype.greaterThanOrEqual = function(other) {\n return this.compare(other) >= 0;\n };\n /**\n * @param {?Long} other\n * @return {number}\n */\n Long.prototype.compare = function(other) {\n if (this.high_ == other.high_) {\n if (this.low_ == other.low_) {\n return 0;\n }\n return this.getLowBitsUnsigned() > other.getLowBitsUnsigned() ? 1 : -1;\n }\n return this.high_ > other.high_ ? 1 : -1;\n };\n /**\n * @return {!Long}\n */\n Long.prototype.negate = function() {\n var negLow = ~this.low_ + 1 | 0;\n var overflowFromLow = !negLow;\n var negHigh = ~this.high_ + overflowFromLow | 0;\n return Long.fromBits(negLow, negHigh);\n };\n /**\n * @param {?Long} other\n * @return {!Long}\n */\n Long.prototype.add = function(other) {\n var a48 = this.high_ >>> 16;\n var a32 = this.high_ & 65535;\n var a16 = this.low_ >>> 16;\n var a00 = this.low_ & 65535;\n var b48 = other.high_ >>> 16;\n var b32 = other.high_ & 65535;\n var b16 = other.low_ >>> 16;\n var b00 = other.low_ & 65535;\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 + b00;\n c16 += c00 >>> 16;\n c00 &= 65535;\n c16 += a16 + b16;\n c32 += c16 >>> 16;\n c16 &= 65535;\n c32 += a32 + b32;\n c48 += c32 >>> 16;\n c32 &= 65535;\n c48 += a48 + b48;\n c48 &= 65535;\n return Long.fromBits(c16 << 16 | c00, c48 << 16 | c32);\n };\n /**\n * @param {?Long} other\n * @return {!Long}\n */\n Long.prototype.subtract = function(other) {\n return this.add(other.negate());\n };\n /**\n * @param {?Long} other\n * @return {!Long}\n */\n Long.prototype.multiply = function(other) {\n if (this.isZero()) {\n return this;\n }\n if (other.isZero()) {\n return other;\n }\n var a48 = this.high_ >>> 16;\n var a32 = this.high_ & 65535;\n var a16 = this.low_ >>> 16;\n var a00 = this.low_ & 65535;\n var b48 = other.high_ >>> 16;\n var b32 = other.high_ & 65535;\n var b16 = other.low_ >>> 16;\n var b00 = other.low_ & 65535;\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 * b00;\n c16 += c00 >>> 16;\n c00 &= 65535;\n c16 += a16 * b00;\n c32 += c16 >>> 16;\n c16 &= 65535;\n c16 += a00 * b16;\n c32 += c16 >>> 16;\n c16 &= 65535;\n c32 += a32 * b00;\n c48 += c32 >>> 16;\n c32 &= 65535;\n c32 += a16 * b16;\n c48 += c32 >>> 16;\n c32 &= 65535;\n c32 += a00 * b32;\n c48 += c32 >>> 16;\n c32 &= 65535;\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\n c48 &= 65535;\n return Long.fromBits(c16 << 16 | c00, c48 << 16 | c32);\n };\n /**\n * @param {?Long} other\n * @return {!Long}\n */\n Long.prototype.div = function(other) {\n if (other.isZero()) {\n throw new Error(\"division by zero\");\n }\n if (this.isNegative()) {\n if (this.equals(Long.getMinValue())) {\n if (other.equals(Long.getOne()) || other.equals(Long.getNegOne())) {\n return Long.getMinValue();\n }\n if (other.equals(Long.getMinValue())) {\n return Long.getOne();\n }\n var halfThis = this.shiftRight(1);\n var approx = halfThis.div(other).shiftLeft(1);\n if (approx.equals(Long.getZero())) {\n return other.isNegative() ? Long.getOne() : Long.getNegOne();\n }\n var rem = this.subtract(other.multiply(approx));\n var result = approx.add(rem.div(other));\n return result;\n }\n if (other.isNegative()) {\n return this.negate().div(other.negate());\n }\n return this.negate().div(other).negate();\n }\n if (this.isZero()) {\n return Long.getZero();\n }\n if (other.isNegative()) {\n if (other.equals(Long.getMinValue())) {\n return Long.getZero();\n }\n return this.div(other.negate()).negate();\n }\n var res = Long.getZero();\n var rem = this;\n while (rem.greaterThanOrEqual(other)) {\n var approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));\n var log2 = Math.ceil(Math.log(approx) / Math.LN2);\n var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48);\n var approxRes = Long.fromNumber(approx);\n var approxRem = approxRes.multiply(other);\n while (approxRem.isNegative() || approxRem.greaterThan(rem)) {\n approx -= delta;\n approxRes = Long.fromNumber(approx);\n approxRem = approxRes.multiply(other);\n }\n if (approxRes.isZero()) {\n approxRes = Long.getOne();\n }\n res = res.add(approxRes);\n rem = rem.subtract(approxRem);\n }\n return res;\n };\n /**\n * @param {?Long} other\n * @return {!Long}\n */\n Long.prototype.modulo = function(other) {\n return this.subtract(this.div(other).multiply(other));\n };\n /**\n * @return {!Long}\n */\n Long.prototype.not = function() {\n return Long.fromBits(~this.low_, ~this.high_);\n };\n /**\n * @param {?Long} other\n * @return {!Long}\n */\n Long.prototype.and = function(other) {\n return Long.fromBits(this.low_ & other.low_, this.high_ & other.high_);\n };\n /**\n * @param {?Long} other\n * @return {!Long}\n */\n Long.prototype.or = function(other) {\n return Long.fromBits(this.low_ | other.low_, this.high_ | other.high_);\n };\n /**\n * @param {?Long} other\n * @return {!Long}\n */\n Long.prototype.xor = function(other) {\n return Long.fromBits(this.low_ ^ other.low_, this.high_ ^ other.high_);\n };\n /**\n * @param {number} numBits\n * @return {!Long}\n */\n Long.prototype.shiftLeft = function(numBits) {\n numBits &= 63;\n if (numBits == 0) {\n return this;\n } else {\n var low = this.low_;\n if (numBits < 32) {\n var high = this.high_;\n return Long.fromBits(low << numBits, high << numBits | low >>> 32 - numBits);\n } else {\n return Long.fromBits(0, low << numBits - 32);\n }\n }\n };\n /**\n * @param {number} numBits\n * @return {!Long}\n */\n Long.prototype.shiftRight = function(numBits) {\n numBits &= 63;\n if (numBits == 0) {\n return this;\n } else {\n var high = this.high_;\n if (numBits < 32) {\n var low = this.low_;\n return Long.fromBits(low >>> numBits | high << 32 - numBits, high >> numBits);\n } else {\n return Long.fromBits(high >> numBits - 32, high >= 0 ? 0 : -1);\n }\n }\n };\n /**\n * @param {number} numBits\n * @return {!Long}\n */\n Long.prototype.shiftRightUnsigned = function(numBits) {\n numBits &= 63;\n if (numBits == 0) {\n return this;\n } else {\n var high = this.high_;\n if (numBits < 32) {\n var low = this.low_;\n return Long.fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits);\n } else {\n if (numBits == 32) {\n return Long.fromBits(high, 0);\n } else {\n return Long.fromBits(high >>> numBits - 32, 0);\n }\n }\n }\n };\n /**\n * @param {number} value\n * @return {!Long}\n */\n Long.fromInt = function(value) {\n var intValue = value | 0;\n asserts.assert(value === intValue, \"value should be a 32-bit integer\");\n if (-128 <= intValue && intValue < 128) {\n return getCachedIntValue_(intValue);\n } else {\n return new Long(intValue, intValue < 0 ? -1 : 0);\n }\n };\n /**\n * @param {number} value\n * @return {!Long}\n */\n Long.fromNumber = function(value) {\n if (value > 0) {\n if (value >= TWO_PWR_63_DBL_) {\n return Long.getMaxValue();\n }\n return new Long(value, value / TWO_PWR_32_DBL_);\n } else {\n if (value < 0) {\n if (value <= -TWO_PWR_63_DBL_) {\n return Long.getMinValue();\n }\n return (new Long(-value, -value / TWO_PWR_32_DBL_)).negate();\n } else {\n return Long.getZero();\n }\n }\n };\n /**\n * @param {number} lowBits\n * @param {number} highBits\n * @return {!Long}\n */\n Long.fromBits = function(lowBits, highBits) {\n return new Long(lowBits, highBits);\n };\n /**\n * @param {string} str\n * @param {number=} opt_radix\n * @return {!Long}\n */\n Long.fromString = function(str, opt_radix) {\n if (str.charAt(0) == \"-\") {\n return Long.fromString(str.substring(1), opt_radix).negate();\n }\n var numberValue = parseInt(str, opt_radix || 10);\n if (numberValue <= MAX_SAFE_INTEGER_) {\n return new Long(numberValue % TWO_PWR_32_DBL_ | 0, numberValue / TWO_PWR_32_DBL_ | 0);\n }\n if (str.length == 0) {\n throw new Error(\"number format error: empty string\");\n }\n if (str.indexOf(\"-\") >= 0) {\n throw new Error('number format error: interior \"-\" character: ' + str);\n }\n var radix = opt_radix || 10;\n if (radix < 2 || 36 < radix) {\n throw new Error(\"radix out of range: \" + radix);\n }\n var radixToPower = Long.fromNumber(Math.pow(radix, 8));\n var result = Long.getZero();\n for (var i = 0; i < str.length; i += 8) {\n var size = Math.min(8, str.length - i);\n var value = parseInt(str.substring(i, i + size), radix);\n if (size < 8) {\n var power = Long.fromNumber(Math.pow(radix, size));\n result = result.multiply(power).add(Long.fromNumber(value));\n } else {\n result = result.multiply(radixToPower);\n result = result.add(Long.fromNumber(value));\n }\n }\n return result;\n };\n /**\n * @param {string} str\n * @param {number=} opt_radix\n * @return {boolean}\n */\n Long.isStringInRange = function(str, opt_radix) {\n var radix = opt_radix || 10;\n if (radix < 2 || 36 < radix) {\n throw new Error(\"radix out of range: \" + radix);\n }\n var extremeValue = str.charAt(0) == \"-\" ? MIN_VALUE_FOR_RADIX_[radix] : MAX_VALUE_FOR_RADIX_[radix];\n if (str.length < extremeValue.length) {\n return true;\n } else {\n if (str.length == extremeValue.length && str <= extremeValue) {\n return true;\n } else {\n return false;\n }\n }\n };\n /**\n * @public\n * @return {!Long}\n */\n Long.getZero = function() {\n return ZERO_;\n };\n /**\n * @public\n * @return {!Long}\n */\n Long.getOne = function() {\n return ONE_;\n };\n /**\n * @public\n * @return {!Long}\n */\n Long.getNegOne = function() {\n return NEG_ONE_;\n };\n /**\n * @public\n * @return {!Long}\n */\n Long.getMaxValue = function() {\n return MAX_VALUE_;\n };\n /**\n * @public\n * @return {!Long}\n */\n Long.getMinValue = function() {\n return MIN_VALUE_;\n };\n /**\n * @public\n * @return {!Long}\n */\n Long.getTwoPwr24 = function() {\n return TWO_PWR_24_;\n };\n exports = Long;\n /** @private @const @type {!Object<number,!Long>} */ var IntCache_ = {};\n /**\n * @private\n * @param {number} value\n * @return {!Long}\n */\n function getCachedIntValue_(value) {\n return reflect.cache(IntCache_, value, function(val) {\n return new Long(val, val < 0 ? -1 : 0);\n });\n }\n /** @private @const @type {!Array<string>} */ var MAX_VALUE_FOR_RADIX_ = [\"\", \"\", \"111111111111111111111111111111111111111111111111111111111111111\", \"2021110011022210012102010021220101220221\", \"13333333333333333333333333333333\", \"1104332401304422434310311212\", \"1540241003031030222122211\", \"22341010611245052052300\", \"777777777777777777777\", \"67404283172107811827\", \"9223372036854775807\", \"1728002635214590697\", \"41a792678515120367\", \"10b269549075433c37\", \"4340724c6c71dc7a7\", \"160e2ad3246366807\", \"7fffffffffffffff\", \n \"33d3d8307b214008\", \"16agh595df825fa7\", \"ba643dci0ffeehh\", \"5cbfjia3fh26ja7\", \"2heiciiie82dh97\", \"1adaibb21dckfa7\", \"i6k448cf4192c2\", \"acd772jnc9l0l7\", \"64ie1focnn5g77\", \"3igoecjbmca687\", \"27c48l5b37oaop\", \"1bk39f3ah3dmq7\", \"q1se8f0m04isb\", \"hajppbc1fc207\", \"bm03i95hia437\", \"7vvvvvvvvvvvv\", \"5hg4ck9jd4u37\", \"3tdtk1v8j6tpp\", \"2pijmikexrxp7\", \"1y2p0ij32e8e7\"];\n /** @private @const @type {!Array<string>} */ var MIN_VALUE_FOR_RADIX_ = [\"\", \"\", \"-1000000000000000000000000000000000000000000000000000000000000000\", \"-2021110011022210012102010021220101220222\", \"-20000000000000000000000000000000\", \"-1104332401304422434310311213\", \"-1540241003031030222122212\", \"-22341010611245052052301\", \"-1000000000000000000000\", \"-67404283172107811828\", \"-9223372036854775808\", \"-1728002635214590698\", \"-41a792678515120368\", \"-10b269549075433c38\", \"-4340724c6c71dc7a8\", \"-160e2ad3246366808\", \n \"-8000000000000000\", \"-33d3d8307b214009\", \"-16agh595df825fa8\", \"-ba643dci0ffeehi\", \"-5cbfjia3fh26ja8\", \"-2heiciiie82dh98\", \"-1adaibb21dckfa8\", \"-i6k448cf4192c3\", \"-acd772jnc9l0l8\", \"-64ie1focnn5g78\", \"-3igoecjbmca688\", \"-27c48l5b37oaoq\", \"-1bk39f3ah3dmq8\", \"-q1se8f0m04isc\", \"-hajppbc1fc208\", \"-bm03i95hia438\", \"-8000000000000\", \"-5hg4ck9jd4u38\", \"-3tdtk1v8j6tpq\", \"-2pijmikexrxp8\", \"-1y2p0ij32e8e8\"];\n /** @private @const @type {number} */ var MAX_SAFE_INTEGER_ = 9007199254740991;\n /** @private @const @type {number} */ var TWO_PWR_32_DBL_ = 4294967296;\n /** @private @const @type {number} */ var TWO_PWR_63_DBL_ = 0x7fffffffffffffff;\n /** @private @const @type {!Long} */ var ZERO_ = Long.fromBits(0, 0);\n /** @private @const @type {!Long} */ var ONE_ = Long.fromBits(1, 0);\n /** @private @const @type {!Long} */ var NEG_ONE_ = Long.fromBits(-1, -1);\n /** @private @const @type {!Long} */ var MAX_VALUE_ = Long.fromBits(4294967295, 2147483647);\n /** @private @const @type {!Long} */ var MIN_VALUE_ = Long.fromBits(0, 2147483648);\n /** @private @const @type {!Long} */ var TWO_PWR_24_ = Long.fromBits(1 << 24, 0);\n return exports;\n});\n","~:source","// Copyright 2009 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * @fileoverview Defines a Long class for representing a 64-bit two's-complement\n * integer value, which faithfully simulates the behavior of a Java \"long\". This\n * implementation is derived from LongLib in GWT.\n *\n */\n\ngoog.module('goog.math.Long');\ngoog.module.declareLegacyNamespace();\n\nconst asserts = goog.require('goog.asserts');\nconst reflect = goog.require('goog.reflect');\n\n/**\n * Represents a 64-bit two's-complement integer, given its low and high 32-bit\n * values as *signed* integers. See the from* functions below for more\n * convenient ways of constructing Longs.\n *\n * The internal representation of a long is the two given signed, 32-bit values.\n * We use 32-bit pieces because these are the size of integers on which\n * JavaScript performs bit-operations. For operations like addition and\n * multiplication, we split each number into 16-bit pieces, which can easily be\n * multiplied within JavaScript's floating-point representation without overflow\n * or change in sign.\n *\n * In the algorithms below, we frequently reduce the negative case to the\n * positive case by negating the input(s) and then post-processing the result.\n * Note that we must ALWAYS check specially whether those values are MIN_VALUE\n * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\n * a positive number, it overflows back into a negative). Not handling this\n * case would often result in infinite recursion.\n * @final\n */\nclass Long {\n /**\n * @param {number} low The low (signed) 32 bits of the long.\n * @param {number} high The high (signed) 32 bits of the long.\n */\n constructor(low, high) {\n /**\n * @const {number}\n * @private\n */\n this.low_ = low | 0; // force into 32 signed bits.\n\n /**\n * @const {number}\n * @private\n */\n this.high_ = high | 0; // force into 32 signed bits.\n }\n\n /** @return {number} The value, assuming it is a 32-bit integer. */\n toInt() {\n return this.low_;\n }\n\n /**\n * @return {number} The closest floating-point representation to this value.\n */\n toNumber() {\n return this.high_ * TWO_PWR_32_DBL_ + this.getLowBitsUnsigned();\n }\n\n /**\n * @return {boolean} if can be exactly represented using number (i.e.\n * abs(value) < 2^53).\n */\n isSafeInteger() {\n var top11Bits = this.high_ >> 21;\n // If top11Bits are all 0s, then the number is between [0, 2^53-1]\n return top11Bits == 0\n // If top11Bits are all 1s, then the number is between [-1, -2^53]\n || (top11Bits == -1\n // and exclude -2^53\n && !(this.low_ == 0 && this.high_ == (0xffe00000 | 0)));\n }\n\n /**\n * @param {number=} opt_radix The radix in which the text should be written.\n * @return {string} The textual representation of this value.\n * @override\n */\n toString(opt_radix) {\n var radix = opt_radix || 10;\n if (radix < 2 || 36 < radix) {\n throw new Error('radix out of range: ' + radix);\n }\n\n // We can avoid very expensive division based code path for some common\n // cases.\n if (this.isSafeInteger()) {\n var asNumber = this.toNumber();\n // Shortcutting for radix 10 (common case) to avoid boxing via toString:\n // https://jsperf.com/tostring-vs-vs-if\n return radix == 10 ? ('' + asNumber) : asNumber.toString(radix);\n }\n\n // We need to split 64bit integer into: `a * radix**safeDigits + b` where\n // neither `a` nor `b` exceeds 53 bits, meaning that safeDigits can be any\n // number in a range: [(63 - 53) / log2(radix); 53 / log2(radix)].\n\n // Other options that need to be benchmarked:\n // 11..16 - (radix >> 2);\n // 10..13 - (radix >> 3);\n // 10..11 - (radix >> 4);\n var safeDigits = 14 - (radix >> 2);\n\n var radixPowSafeDigits = Math.pow(radix, safeDigits);\n var radixToPower =\n Long.fromBits(radixPowSafeDigits, radixPowSafeDigits / TWO_PWR_32_DBL_);\n\n var remDiv = this.div(radixToPower);\n var val = Math.abs(this.subtract(remDiv.multiply(radixToPower)).toNumber());\n var digits = radix == 10 ? ('' + val) : val.toString(radix);\n\n if (digits.length < safeDigits) {\n // Up to 13 leading 0s we might need to insert as the greatest safeDigits\n // value is 14 (for radix 2).\n digits = '0000000000000'.substr(digits.length - safeDigits) + digits;\n }\n\n val = remDiv.toNumber();\n return (radix == 10 ? val : val.toString(radix)) + digits;\n }\n\n /** @return {number} The high 32-bits as a signed value. */\n getHighBits() {\n return this.high_;\n }\n\n /** @return {number} The low 32-bits as a signed value. */\n getLowBits() {\n return this.low_;\n }\n\n /** @return {number} The low 32-bits as an unsigned value. */\n getLowBitsUnsigned() {\n // The right shifting fixes negative values in the case when\n // intval >= 2^31; for more details see\n // https://github.com/google/closure-library/pull/498\n return this.low_ >>> 0;\n }\n\n /**\n * @return {number} Returns the number of bits needed to represent the\n * absolute value of this Long.\n */\n getNumBitsAbs() {\n if (this.isNegative()) {\n if (this.equals(Long.getMinValue())) {\n return 64;\n } else {\n return this.negate().getNumBitsAbs();\n }\n } else {\n var val = this.high_ != 0 ? this.high_ : this.low_;\n for (var bit = 31; bit > 0; bit--) {\n if ((val & (1 << bit)) != 0) {\n break;\n }\n }\n return this.high_ != 0 ? bit + 33 : bit + 1;\n }\n }\n\n /** @return {boolean} Whether this value is zero. */\n isZero() {\n // Check low part first as there is high chance it's not 0.\n return this.low_ == 0 && this.high_ == 0;\n }\n\n /** @return {boolean} Whether this value is negative. */\n isNegative() {\n return this.high_ < 0;\n }\n\n /** @return {boolean} Whether this value is odd. */\n isOdd() {\n return (this.low_ & 1) == 1;\n }\n\n /**\n * @param {?Long} other Long to compare against.\n * @return {boolean} Whether this Long equals the other.\n */\n equals(other) {\n // Compare low parts first as there is higher chance they are different.\n return (this.low_ == other.low_) && (this.high_ == other.high_);\n }\n\n /**\n * @param {?Long} other Long to compare against.\n * @return {boolean} Whether this Long does not equal the other.\n */\n notEquals(other) {\n return !this.equals(other);\n }\n\n /**\n * @param {?Long} other Long to compare against.\n * @return {boolean} Whether this Long is less than the other.\n */\n lessThan(other) {\n return this.compare(other) < 0;\n }\n\n /**\n * @param {?Long} other Long to compare against.\n * @return {boolean} Whether this Long is less than or equal to the other.\n */\n lessThanOrEqual(other) {\n return this.compare(other) <= 0;\n }\n\n /**\n * @param {?Long} other Long to compare against.\n * @return {boolean} Whether this Long is greater than the other.\n */\n greaterThan(other) {\n return this.compare(other) > 0;\n }\n\n /**\n * @param {?Long} other Long to compare against.\n * @return {boolean} Whether this Long is greater than or equal to the other.\n */\n greaterThanOrEqual(other) {\n return this.compare(other) >= 0;\n }\n\n /**\n * Compares this Long with the given one.\n * @param {?Long} other Long to compare against.\n * @return {number} 0 if they are the same, 1 if the this is greater, and -1\n * if the given one is greater.\n */\n compare(other) {\n if (this.high_ == other.high_) {\n if (this.low_ == other.low_) {\n return 0;\n }\n return this.getLowBitsUnsigned() > other.getLowBitsUnsigned() ? 1 : -1;\n }\n return this.high_ > other.high_ ? 1 : -1;\n }\n\n /** @return {!Long} The negation of this value. */\n negate() {\n var negLow = (~this.low_ + 1) | 0;\n var overflowFromLow = !negLow;\n var negHigh = (~this.high_ + overflowFromLow) | 0;\n return Long.fromBits(negLow, negHigh);\n }\n\n /**\n * Returns the sum of this and the given Long.\n * @param {?Long} other Long to add to this one.\n * @return {!Long} The sum of this and the given Long.\n */\n add(other) {\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\n\n var a48 = this.high_ >>> 16;\n var a32 = this.high_ & 0xFFFF;\n var a16 = this.low_ >>> 16;\n var a00 = this.low_ & 0xFFFF;\n\n var b48 = other.high_ >>> 16;\n var b32 = other.high_ & 0xFFFF;\n var b16 = other.low_ >>> 16;\n var b00 = other.low_ & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 + b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 + b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 + b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 + b48;\n c48 &= 0xFFFF;\n return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32);\n }\n\n /**\n * Returns the difference of this and the given Long.\n * @param {?Long} other Long to subtract from this.\n * @return {!Long} The difference of this and the given Long.\n */\n subtract(other) {\n return this.add(other.negate());\n }\n\n /**\n * Returns the product of this and the given long.\n * @param {?Long} other Long to multiply with this.\n * @return {!Long} The product of this and the other.\n */\n multiply(other) {\n if (this.isZero()) {\n return this;\n }\n if (other.isZero()) {\n return other;\n }\n\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\n // We can skip products that would overflow.\n\n var a48 = this.high_ >>> 16;\n var a32 = this.high_ & 0xFFFF;\n var a16 = this.low_ >>> 16;\n var a00 = this.low_ & 0xFFFF;\n\n var b48 = other.high_ >>> 16;\n var b32 = other.high_ & 0xFFFF;\n var b16 = other.low_ >>> 16;\n var b00 = other.low_ & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 * b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 * b00;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c16 += a00 * b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 * b00;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a16 * b16;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a00 * b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\n c48 &= 0xFFFF;\n return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32);\n }\n\n /**\n * Returns this Long divided by the given one.\n * @param {?Long} other Long by which to divide.\n * @return {!Long} This Long divided by the given one.\n */\n div(other) {\n if (other.isZero()) {\n throw new Error('division by zero');\n }\n if (this.isNegative()) {\n if (this.equals(Long.getMinValue())) {\n if (other.equals(Long.getOne()) || other.equals(Long.getNegOne())) {\n return Long.getMinValue(); // recall -MIN_VALUE == MIN_VALUE\n }\n if (other.equals(Long.getMinValue())) {\n return Long.getOne();\n }\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\n var halfThis = this.shiftRight(1);\n var approx = halfThis.div(other).shiftLeft(1);\n if (approx.equals(Long.getZero())) {\n return other.isNegative() ? Long.getOne() : Long.getNegOne();\n }\n var rem = this.subtract(other.multiply(approx));\n var result = approx.add(rem.div(other));\n return result;\n }\n if (other.isNegative()) {\n return this.negate().div(other.negate());\n }\n return this.negate().div(other).negate();\n }\n if (this.isZero()) {\n return Long.getZero();\n }\n if (other.isNegative()) {\n if (other.equals(Long.getMinValue())) {\n return Long.getZero();\n }\n return this.div(other.negate()).negate();\n }\n\n // Repeat the following until the remainder is less than other: find a\n // floating-point that approximates remainder / other *from below*, add this\n // into the result, and subtract it from the remainder. It is critical that\n // the approximate value is less than or equal to the real value so that the\n // remainder never becomes negative.\n var res = Long.getZero();\n var rem = this;\n while (rem.greaterThanOrEqual(other)) {\n // Approximate the result of division. This may be a little greater or\n // smaller than the actual value.\n var approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));\n\n // We will tweak the approximate result by changing it in the 48-th digit\n // or the smallest non-fractional digit, whichever is larger.\n var log2 = Math.ceil(Math.log(approx) / Math.LN2);\n var delta = (log2 <= 48) ? 1 : Math.pow(2, log2 - 48);\n\n // Decrease the approximation until it is smaller than the remainder. Note\n // that if it is too large, the product overflows and is negative.\n var approxRes = Long.fromNumber(approx);\n var approxRem = approxRes.multiply(other);\n while (approxRem.isNegative() || approxRem.greaterThan(rem)) {\n approx -= delta;\n approxRes = Long.fromNumber(approx);\n approxRem = approxRes.multiply(other);\n }\n\n // We know the answer can't be zero... and actually, zero would cause\n // infinite recursion since we would make no progress.\n if (approxRes.isZero()) {\n approxRes = Long.getOne();\n }\n\n res = res.add(approxRes);\n rem = rem.subtract(approxRem);\n }\n return res;\n }\n\n /**\n * Returns this Long modulo the given one.\n * @param {?Long} other Long by which to mod.\n * @return {!Long} This Long modulo the given one.\n */\n modulo(other) {\n return this.subtract(this.div(other).multiply(other));\n }\n\n /** @return {!Long} The bitwise-NOT of this value. */\n not() {\n return Long.fromBits(~this.low_, ~this.high_);\n }\n\n /**\n * Returns the bitwise-AND of this Long and the given one.\n * @param {?Long} other The Long with which to AND.\n * @return {!Long} The bitwise-AND of this and the other.\n */\n and(other) {\n return Long.fromBits(this.low_ & other.low_, this.high_ & other.high_);\n }\n\n /**\n * Returns the bitwise-OR of this Long and the given one.\n * @param {?Long} other The Long with which to OR.\n * @return {!Long} The bitwise-OR of this and the other.\n */\n or(other) {\n return Long.fromBits(this.low_ | other.low_, this.high_ | other.high_);\n }\n\n /**\n * Returns the bitwise-XOR of this Long and the given one.\n * @param {?Long} other The Long with which to XOR.\n * @return {!Long} The bitwise-XOR of this and the other.\n */\n xor(other) {\n return Long.fromBits(this.low_ ^ other.low_, this.high_ ^ other.high_);\n }\n\n /**\n * Returns this Long with bits shifted to the left by the given amount.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!Long} This shifted to the left by the given amount.\n */\n shiftLeft(numBits) {\n numBits &= 63;\n if (numBits == 0) {\n return this;\n } else {\n var low = this.low_;\n if (numBits < 32) {\n var high = this.high_;\n return Long.fromBits(\n low << numBits, (high << numBits) | (low >>> (32 - numBits)));\n } else {\n return Long.fromBits(0, low << (numBits - 32));\n }\n }\n }\n\n /**\n * Returns this Long with bits shifted to the right by the given amount.\n * The new leading bits match the current sign bit.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!Long} This shifted to the right by the given amount.\n */\n shiftRight(numBits) {\n numBits &= 63;\n if (numBits == 0) {\n return this;\n } else {\n var high = this.high_;\n if (numBits < 32) {\n var low = this.low_;\n return Long.fromBits(\n (low >>> numBits) | (high << (32 - numBits)), high >> numBits);\n } else {\n return Long.fromBits(high >> (numBits - 32), high >= 0 ? 0 : -1);\n }\n }\n }\n\n /**\n * Returns this Long with bits shifted to the right by the given amount, with\n * zeros placed into the new leading bits.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!Long} This shifted to the right by the given amount,\n * with zeros placed into the new leading bits.\n */\n shiftRightUnsigned(numBits) {\n numBits &= 63;\n if (numBits == 0) {\n return this;\n } else {\n var high = this.high_;\n if (numBits < 32) {\n var low = this.low_;\n return Long.fromBits(\n (low >>> numBits) | (high << (32 - numBits)), high >>> numBits);\n } else if (numBits == 32) {\n return Long.fromBits(high, 0);\n } else {\n return Long.fromBits(high >>> (numBits - 32), 0);\n }\n }\n }\n\n /**\n * Returns a Long representing the given (32-bit) integer value.\n * @param {number} value The 32-bit integer in question.\n * @return {!Long} The corresponding Long value.\n */\n static fromInt(value) {\n var intValue = value | 0;\n asserts.assert(value === intValue, 'value should be a 32-bit integer');\n\n if (-128 <= intValue && intValue < 128) {\n return getCachedIntValue_(intValue);\n } else {\n return new Long(intValue, intValue < 0 ? -1 : 0);\n }\n }\n\n /**\n * Returns a Long representing the given value.\n * NaN will be returned as zero. Infinity is converted to max value and\n * -Infinity to min value.\n * @param {number} value The number in question.\n * @return {!Long} The corresponding Long value.\n */\n static fromNumber(value) {\n if (value > 0) {\n if (value >= TWO_PWR_63_DBL_) {\n return Long.getMaxValue();\n }\n return new Long(value, value / TWO_PWR_32_DBL_);\n } else if (value < 0) {\n if (value <= -TWO_PWR_63_DBL_) {\n return Long.getMinValue();\n }\n return new Long(-value, -value / TWO_PWR_32_DBL_).negate();\n } else {\n // NaN or 0.\n return Long.getZero();\n }\n }\n\n /**\n * Returns a Long representing the 64-bit integer that comes by concatenating\n * the given high and low bits. Each is assumed to use 32 bits.\n * @param {number} lowBits The low 32-bits.\n * @param {number} highBits The high 32-bits.\n * @return {!Long} The corresponding Long value.\n */\n static fromBits(lowBits, highBits) {\n return new Long(lowBits, highBits);\n }\n\n /**\n * Returns a Long representation of the given string, written using the given\n * radix.\n * @param {string} str The textual representation of the Long.\n * @param {number=} opt_radix The radix in which the text is written.\n * @return {!Long} The corresponding Long value.\n */\n static fromString(str, opt_radix) {\n if (str.charAt(0) == '-') {\n return Long.fromString(str.substring(1), opt_radix).negate();\n }\n\n // We can avoid very expensive multiply based code path for some common\n // cases.\n var numberValue = parseInt(str, opt_radix || 10);\n if (numberValue <= MAX_SAFE_INTEGER_) {\n return new Long(\n (numberValue % TWO_PWR_32_DBL_) | 0,\n (numberValue / TWO_PWR_32_DBL_) | 0);\n }\n\n if (str.length == 0) {\n throw new Error('number format error: empty string');\n }\n if (str.indexOf('-') >= 0) {\n throw new Error('number format error: interior \"-\" character: ' + str);\n }\n\n var radix = opt_radix || 10;\n if (radix < 2 || 36 < radix) {\n throw new Error('radix out of range: ' + radix);\n }\n\n // Do several (8) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated multiply.\n var radixToPower = Long.fromNumber(Math.pow(radix, 8));\n\n var result = Long.getZero();\n for (var i = 0; i < str.length; i += 8) {\n var size = Math.min(8, str.length - i);\n var value = parseInt(str.substring(i, i + size), radix);\n if (size < 8) {\n var power = Long.fromNumber(Math.pow(radix, size));\n result = result.multiply(power).add(Long.fromNumber(value));\n } else {\n result = result.multiply(radixToPower);\n result = result.add(Long.fromNumber(value));\n }\n }\n return result;\n }\n\n /**\n * Returns the boolean value of whether the input string is within a Long's\n * range. Assumes an input string containing only numeric characters with an\n * optional preceding '-'.\n * @param {string} str The textual representation of the Long.\n * @param {number=} opt_radix The radix in which the text is written.\n * @return {boolean} Whether the string is within the range of a Long.\n */\n static isStringInRange(str, opt_radix) {\n var radix = opt_radix || 10;\n if (radix < 2 || 36 < radix) {\n throw new Error('radix out of range: ' + radix);\n }\n\n var extremeValue = (str.charAt(0) == '-') ? MIN_VALUE_FOR_RADIX_[radix] :\n MAX_VALUE_FOR_RADIX_[radix];\n\n if (str.length < extremeValue.length) {\n return true;\n } else if (str.length == extremeValue.length && str <= extremeValue) {\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @return {!Long}\n * @public\n */\n static getZero() {\n return ZERO_;\n }\n\n /**\n * @return {!Long}\n * @public\n */\n static getOne() {\n return ONE_;\n }\n\n /**\n * @return {!Long}\n * @public\n */\n static getNegOne() {\n return NEG_ONE_;\n }\n\n /**\n * @return {!Long}\n * @public\n */\n static getMaxValue() {\n return MAX_VALUE_;\n }\n\n /**\n * @return {!Long}\n * @public\n */\n static getMinValue() {\n return MIN_VALUE_;\n }\n\n /**\n * @return {!Long}\n * @public\n */\n static getTwoPwr24() {\n return TWO_PWR_24_;\n }\n}\n\nexports = Long;\n\n// NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the\n// from* methods on which they depend.\n\n\n/**\n * A cache of the Long representations of small integer values.\n * @type {!Object<number, !Long>}\n * @private @const\n */\nconst IntCache_ = {};\n\n\n/**\n * Returns a cached long number representing the given (32-bit) integer value.\n * @param {number} value The 32-bit integer in question.\n * @return {!Long} The corresponding Long value.\n * @private\n */\nfunction getCachedIntValue_(value) {\n return reflect.cache(IntCache_, value, function(val) {\n return new Long(val, val < 0 ? -1 : 0);\n });\n}\n\n/**\n * The array of maximum values of a Long in string representation for a given\n * radix between 2 and 36, inclusive.\n * @private @const {!Array<string>}\n */\nconst MAX_VALUE_FOR_RADIX_ = [\n '', '', // unused\n '111111111111111111111111111111111111111111111111111111111111111',\n // base 2\n '2021110011022210012102010021220101220221', // base 3\n '13333333333333333333333333333333', // base 4\n '1104332401304422434310311212', // base 5\n '1540241003031030222122211', // base 6\n '22341010611245052052300', // base 7\n '777777777777777777777', // base 8\n '67404283172107811827', // base 9\n '9223372036854775807', // base 10\n '1728002635214590697', // base 11\n '41a792678515120367', // base 12\n '10b269549075433c37', // base 13\n '4340724c6c71dc7a7', // base 14\n '160e2ad3246366807', // base 15\n '7fffffffffffffff', // base 16\n '33d3d8307b214008', // base 17\n '16agh595df825fa7', // base 18\n 'ba643dci0ffeehh', // base 19\n '5cbfjia3fh26ja7', // base 20\n '2heiciiie82dh97', // base 21\n '1adaibb21dckfa7', // base 22\n 'i6k448cf4192c2', // base 23\n 'acd772jnc9l0l7', // base 24\n '64ie1focnn5g77', // base 25\n '3igoecjbmca687', // base 26\n '27c48l5b37oaop', // base 27\n '1bk39f3ah3dmq7', // base 28\n 'q1se8f0m04isb', // base 29\n 'hajppbc1fc207', // base 30\n 'bm03i95hia437', // base 31\n '7vvvvvvvvvvvv', // base 32\n '5hg4ck9jd4u37', // base 33\n '3tdtk1v8j6tpp', // base 34\n '2pijmikexrxp7', // base 35\n '1y2p0ij32e8e7' // base 36\n];\n\n\n/**\n * The array of minimum values of a Long in string representation for a given\n * radix between 2 and 36, inclusive.\n * @private @const {!Array<string>}\n */\nconst MIN_VALUE_FOR_RADIX_ = [\n '', '', // unused\n '-1000000000000000000000000000000000000000000000000000000000000000',\n // base 2\n '-2021110011022210012102010021220101220222', // base 3\n '-20000000000000000000000000000000', // base 4\n '-1104332401304422434310311213', // base 5\n '-1540241003031030222122212', // base 6\n '-22341010611245052052301', // base 7\n '-1000000000000000000000', // base 8\n '-67404283172107811828', // base 9\n '-9223372036854775808', // base 10\n '-1728002635214590698', // base 11\n '-41a792678515120368', // base 12\n '-10b269549075433c38', // base 13\n '-4340724c6c71dc7a8', // base 14\n '-160e2ad3246366808', // base 15\n '-8000000000000000', // base 16\n '-33d3d8307b214009', // base 17\n '-16agh595df825fa8', // base 18\n '-ba643dci0ffeehi', // base 19\n '-5cbfjia3fh26ja8', // base 20\n '-2heiciiie82dh98', // base 21\n '-1adaibb21dckfa8', // base 22\n '-i6k448cf4192c3', // base 23\n '-acd772jnc9l0l8', // base 24\n '-64ie1focnn5g78', // base 25\n '-3igoecjbmca688', // base 26\n '-27c48l5b37oaoq', // base 27\n '-1bk39f3ah3dmq8', // base 28\n '-q1se8f0m04isc', // base 29\n '-hajppbc1fc208', // base 30\n '-bm03i95hia438', // base 31\n '-8000000000000', // base 32\n '-5hg4ck9jd4u38', // base 33\n '-3tdtk1v8j6tpq', // base 34\n '-2pijmikexrxp8', // base 35\n '-1y2p0ij32e8e8' // base 36\n];\n\n/**\n * TODO(goktug): Replace with Number.MAX_SAFE_INTEGER when polyfil is guaranteed\n * to be removed.\n * @type {number}\n * @private @const\n */\nconst MAX_SAFE_INTEGER_ = 0x1fffffffffffff;\n\n// NOTE: the compiler should inline these constant values below and then remove\n// these variables, so there should be no runtime penalty for these.\n\n/**\n * Number used repeated below in calculations. This must appear before the\n * first call to any from* function above.\n * @const {number}\n * @private\n */\nconst TWO_PWR_32_DBL_ = 0x100000000;\n\n\n/**\n * @const {number}\n * @private\n */\nconst TWO_PWR_63_DBL_ = 0x8000000000000000;\n\n\n/**\n * @private @const {!Long}\n */\nconst ZERO_ = Long.fromBits(0, 0);\n\n\n/**\n * @private @const {!Long}\n */\nconst ONE_ = Long.fromBits(1, 0);\n\n/**\n * @private @const {!Long}\n */\nconst NEG_ONE_ = Long.fromBits(-1, -1);\n\n/**\n * @private @const {!Long}\n */\nconst MAX_VALUE_ = Long.fromBits(0xFFFFFFFF, 0x7FFFFFFF);\n\n/**\n * @private @const {!Long}\n */\nconst MIN_VALUE_ = Long.fromBits(0, 0x80000000);\n\n/**\n * @private @const {!Long}\n */\nconst TWO_PWR_24_ = Long.fromBits(1 << 24, 0);\n","~:compiled-at",1584073468305,"~:source-map-json","{\n\"version\":3,\n\"file\":\"goog.math.long.js\",\n\"lineCount\":581,\n\"mappings\":\"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