exports.id = 9715;
exports.ids = [9715];
exports.modules = {

/***/ 463981:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

/*
 *  This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
var __values = (this && this.__values) || function(o) {
    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
    if (m) return m.call(o);
    if (o && typeof o.length === "number") return {
        next: function () {
            if (o && i >= o.length) o = void 0;
            return { value: o && o[i++], done: !o };
        }
    };
    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
var __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.shallowCompare = exports.is_different_array = exports.is_different = exports.all_fields_equal = exports.field_cmp = exports.timestamp_cmp = exports.cmp_array = exports.cmp_moment = exports.cmp_Date = exports.cmp = void 0;
var lodash_1 = __webpack_require__(988593);
function cmp(a, b) {
    if (a < b) {
        return -1;
    }
    else if (a > b) {
        return 1;
    }
    return 0;
}
exports.cmp = cmp;
/*
compare two Date | undefined | null objects.

null and undefined are considered equal to each other.

null_last:
  - true: nulls are infinitely in the future
  - false: nulls are the dawn of mankind
*/
function cmp_Date(a, b, null_last) {
    if (null_last === void 0) { null_last = false; }
    if (a == null) {
        if (b == null) {
            return 0;
        }
        return null_last ? 1 : -1;
    }
    // a != null
    if (b == null) {
        return null_last ? -1 : 1;
    }
    if (a < b)
        return -1;
    if (a > b)
        return 1;
    return 0; // note: a == b for Date objects doesn't work as expected, but that's OK here.
}
exports.cmp_Date = cmp_Date;
function cmp_moment(a, b, null_last) {
    if (null_last === void 0) { null_last = false; }
    return cmp_Date(a === null || a === void 0 ? void 0 : a.toDate(), b === null || b === void 0 ? void 0 : b.toDate(), null_last);
}
exports.cmp_moment = cmp_moment;
function cmp_array(a, b) {
    var end = Math.max(a.length, b.length);
    for (var i = 0; i < end; i++) {
        var c = cmp(a[i], b[i]);
        if (c) {
            return c;
        }
    }
    return 0;
}
exports.cmp_array = cmp_array;
function timestamp_cmp(a, b, field) {
    if (field == null) {
        field = "timestamp";
    }
    return -cmp_Date(a[field], b[field]);
}
exports.timestamp_cmp = timestamp_cmp;
function field_cmp(field) {
    return function (a, b) { return cmp(a[field], b[field]); };
}
exports.field_cmp = field_cmp;
function all_fields_equal(a, b, fields, verbose) {
    return !is_different(a, b, fields, verbose);
}
exports.all_fields_equal = all_fields_equal;
function is_different(a, b, fields, verbose) {
    var e_1, _a, e_2, _b, e_3, _c;
    if (verbose != null) {
        return is_different_verbose(a, b, fields, verbose);
    }
    var field;
    if (a == null) {
        if (b == null) {
            return false; // they are the same
        }
        try {
            // a not defined but b is
            for (var fields_1 = __values(fields), fields_1_1 = fields_1.next(); !fields_1_1.done; fields_1_1 = fields_1.next()) {
                field = fields_1_1.value;
                if (b[field] != null) {
                    return true;
                }
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (fields_1_1 && !fields_1_1.done && (_a = fields_1.return)) _a.call(fields_1);
            }
            finally { if (e_1) throw e_1.error; }
        }
        return false;
    }
    if (b == null) {
        try {
            // a is defined or would be handled above
            for (var fields_2 = __values(fields), fields_2_1 = fields_2.next(); !fields_2_1.done; fields_2_1 = fields_2.next()) {
                field = fields_2_1.value;
                if (a[field] != null) {
                    return true; // different
                }
            }
        }
        catch (e_2_1) { e_2 = { error: e_2_1 }; }
        finally {
            try {
                if (fields_2_1 && !fields_2_1.done && (_b = fields_2.return)) _b.call(fields_2);
            }
            finally { if (e_2) throw e_2.error; }
        }
        return false; // same
    }
    try {
        for (var fields_3 = __values(fields), fields_3_1 = fields_3.next(); !fields_3_1.done; fields_3_1 = fields_3.next()) {
            field = fields_3_1.value;
            if (a[field] !== b[field]) {
                return true;
            }
        }
    }
    catch (e_3_1) { e_3 = { error: e_3_1 }; }
    finally {
        try {
            if (fields_3_1 && !fields_3_1.done && (_c = fields_3.return)) _c.call(fields_3);
        }
        finally { if (e_3) throw e_3.error; }
    }
    return false;
}
exports.is_different = is_different;
// Use for debugging purposes only -- copy code from above to avoid making that
// code more complicated and possibly slower.
function is_different_verbose(a, b, fields, verbose) {
    var e_4, _a, e_5, _b, e_6, _c;
    function log() {
        var x = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            x[_i] = arguments[_i];
        }
        console.log.apply(console, __spreadArray(["is_different_verbose", verbose], __read(x), false));
    }
    var field;
    if (a == null) {
        if (b == null) {
            log("both null");
            return false; // they are the same
        }
        try {
            // a not defined but b is
            for (var fields_4 = __values(fields), fields_4_1 = fields_4.next(); !fields_4_1.done; fields_4_1 = fields_4.next()) {
                field = fields_4_1.value;
                if (b[field] != null) {
                    log("a not defined but b is");
                    return true;
                }
            }
        }
        catch (e_4_1) { e_4 = { error: e_4_1 }; }
        finally {
            try {
                if (fields_4_1 && !fields_4_1.done && (_a = fields_4.return)) _a.call(fields_4);
            }
            finally { if (e_4) throw e_4.error; }
        }
        return false;
    }
    if (b == null) {
        try {
            // a is defined or would be handled above
            for (var fields_5 = __values(fields), fields_5_1 = fields_5.next(); !fields_5_1.done; fields_5_1 = fields_5.next()) {
                field = fields_5_1.value;
                if (a[field] != null) {
                    log("b null and \"".concat(field, "\" of a is not null"));
                    return true; // different
                }
            }
        }
        catch (e_5_1) { e_5 = { error: e_5_1 }; }
        finally {
            try {
                if (fields_5_1 && !fields_5_1.done && (_b = fields_5.return)) _b.call(fields_5);
            }
            finally { if (e_5) throw e_5.error; }
        }
        return false; // same
    }
    try {
        for (var fields_6 = __values(fields), fields_6_1 = fields_6.next(); !fields_6_1.done; fields_6_1 = fields_6.next()) {
            field = fields_6_1.value;
            if (a[field] !== b[field]) {
                log("field \"".concat(field, "\" differs"), a[field], b[field]);
                return true;
            }
        }
    }
    catch (e_6_1) { e_6 = { error: e_6_1 }; }
    finally {
        try {
            if (fields_6_1 && !fields_6_1.done && (_c = fields_6.return)) _c.call(fields_6);
        }
        finally { if (e_6) throw e_6.error; }
    }
    log("same");
    return false;
}
var is_different_array = function (a, b) { return !(0, lodash_1.isEqual)(a, b); };
exports.is_different_array = is_different_array;
// See https://stackoverflow.com/questions/22266826/how-can-i-do-a-shallow-comparison-of-the-properties-of-two-objects-with-javascri/22266891#22266891
var shallowCompare = function (obj1, obj2) {
    return Object.keys(obj1).length === Object.keys(obj2).length &&
        Object.keys(obj1).every(function (key) { return obj2.hasOwnProperty(key) && obj1[key] === obj2[key]; });
};
exports.shallowCompare = shallowCompare;
//# sourceMappingURL=cmp.js.map

/***/ }),

/***/ 855588:
/***/ (function(__unused_webpack_module, exports) {

"use strict";

/*
 *  This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
var __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.done2 = exports.done1 = exports.done = void 0;
// This is a convenience function to provide as a callback when working interactively.
function _done(n) {
    var args = [];
    for (var _i = 1; _i < arguments.length; _i++) {
        args[_i - 1] = arguments[_i];
    }
    var start_time = new Date().valueOf();
    var f = function () {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            args[_i] = arguments[_i];
        }
        if (n !== 1) {
            try {
                args = [JSON.stringify(args, null, n)];
            }
            catch (error) { }
        }
        // do nothing
        console.log.apply(console, __spreadArray(["*** TOTALLY DONE! (".concat((new Date().valueOf() - start_time) / 1000, "s since start) ")], __read(Array.from(args)), false));
    };
    if (args.length > 0) {
        f.apply(void 0, __spreadArray([], __read(Array.from(args || [])), false));
    }
    else {
        return f;
    }
}
function done() {
    var args = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
    }
    return _done.apply(void 0, __spreadArray([0], __read(Array.from(args)), false));
}
exports.done = done;
function done1() {
    var args = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
    }
    return _done.apply(void 0, __spreadArray([1], __read(Array.from(args)), false));
}
exports.done1 = done1;
function done2() {
    var args = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
    }
    return _done.apply(void 0, __spreadArray([2], __read(Array.from(args)), false));
}
exports.done2 = done2;
//# sourceMappingURL=done.js.map

/***/ }),

/***/ 840165:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

/*
 *  This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
/*
 * decaffeinate suggestions:
 * DS207: Consider shorter variations of null checks
 * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
 */
//##############################################################################
//
// CoCalc: Collaborative web-based calculation
// Copyright (C) 2017, Sagemath Inc.
// AGPLv3
//
//##############################################################################
/*
Custom Prop Validation for immutable.js types, so they work just like other
React prop-types.

FUTURE: Put prop validation code in a debug area so that it doesn't get loaded for production

In addition to React Prop checks, we implement the following type checkers:
immutable,
immutable.List,
immutable.Map,
immutable.Set,
immutable.Stack,
which may be chained with .isRequired just like normal React prop checks

Additional validations may be added with the following signature
rtypes.custom_checker_name<function (
        props,
        propName,
        componentName,
        location,
        propFullName,
        secret
    ) => <Error-Like-Object or null>
>
Check React lib to see if this has changed.

*/
var check_is_immutable = function (props, propName, componentName, location, propFullName) {
    if (componentName == null) {
        componentName = "ANONYMOUS";
    }
    if (props[propName] == null || props[propName].toJS != null) {
        return null;
    }
    else {
        var type = typeof props[propName];
        return new Error("Invalid prop `".concat(propName, "` of") +
            " type ".concat(type, " supplied to") +
            " `".concat(componentName, "`, expected an immutable collection or frozen object."));
    }
};
var allow_isRequired = function (validate) {
    var check_type = function (isRequired, props, propName, componentName, location) {
        if (componentName == null) {
            componentName = "ANONYMOUS";
        }
        if (props[propName] == null && isRequired) {
            return new Error("Required prop `".concat(propName, "` was not specified in `").concat(componentName, "`"));
        }
        return validate(props, propName, componentName, location);
    };
    var chainedCheckType = check_type.bind(null, false);
    chainedCheckType.isRequired = check_type.bind(null, true);
    chainedCheckType.isRequired.category = "IMMUTABLE";
    chainedCheckType.category = "IMMUTABLE";
    return chainedCheckType;
};
var create_immutable_type_required_chain = function (validate) {
    var check_type = function (immutable_type_name, props, propName, componentName) {
        if (componentName == null) {
            componentName = "ANONYMOUS";
        }
        if (immutable_type_name && props[propName] != null) {
            var T = immutable_type_name;
            if (props[propName].toJS == null) {
                return new Error("NOT EVEN IMMUTABLE, wanted immutable.".concat(T, " ").concat(props, ", ").concat(propName));
            }
            if (__webpack_require__(805687)["".concat(T)]["is".concat(T)](props[propName])) {
                return null;
            }
            else {
                return new Error("Component `".concat(componentName, "`") +
                    " expected ".concat(propName, " to be an immutable.").concat(T) +
                    " but was supplied ".concat(props[propName]));
            }
        }
        else {
            return validate(props, propName, componentName, location);
        }
    };
    // To add more immutable.js types, mimic code below.
    var check_immutable_chain = allow_isRequired(check_type.bind(null, undefined));
    check_immutable_chain.Map = allow_isRequired(check_type.bind(null, "Map"));
    check_immutable_chain.List = allow_isRequired(check_type.bind(null, "List"));
    check_immutable_chain.Set = allow_isRequired(check_type.bind(null, "Set"));
    check_immutable_chain.Stack = allow_isRequired(check_type.bind(null, "Stack"));
    check_immutable_chain.category = "IMMUTABLE";
    return check_immutable_chain;
};
exports.immutable = create_immutable_type_required_chain(check_is_immutable);
//# sourceMappingURL=immutable-types.js.map

/***/ }),

/***/ 690211:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

/*
 *  This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
var __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.wrap_log = exports.log = exports.get_uptime = exports.get_start_time_ts = void 0;
var misc_1 = __webpack_require__(477389);
var smc_logger_timestamp, smc_logger_timestamp_last, smc_start_time;
smc_logger_timestamp =
    smc_logger_timestamp_last =
        smc_start_time =
            new Date().getTime() / 1000.0;
var get_start_time_ts = function () { return new Date(smc_start_time * 1000); };
exports.get_start_time_ts = get_start_time_ts;
var get_uptime = function () {
    return (0, misc_1.seconds2hms)(new Date().getTime() / 1000.0 - smc_start_time);
};
exports.get_uptime = get_uptime;
function log() {
    var _a, _b;
    var _args = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        _args[_i] = arguments[_i];
    }
    smc_logger_timestamp = new Date().getTime() / 1000.0;
    var t = (0, misc_1.seconds2hms)(smc_logger_timestamp - smc_start_time);
    var dt = (0, misc_1.seconds2hms)(smc_logger_timestamp - smc_logger_timestamp_last);
    // support for string interpolation for the actual console.log
    var _c = __read(Array.from(Array.prototype.slice.call(arguments))), msg = _c[0], args = _c.slice(1);
    var prompt = "[".concat(t, " \u0394 ").concat(dt, " - ").concat(new Date().toISOString(), "]");
    if (typeof msg == "string") {
        prompt = "".concat(prompt, " ").concat(msg);
        (_a = console).log_original.apply(_a, __spreadArray([prompt], __read(Array.from(args)), false));
    }
    else {
        (_b = console).log_original.apply(_b, __spreadArray([prompt, msg], __read(Array.from(args)), false));
    }
    smc_logger_timestamp_last = smc_logger_timestamp;
}
exports.log = log;
function wrap_log() {
    if (!misc_1.RUNNING_IN_NODE && typeof window != "undefined") {
        window.console.log_original = window.console.log;
        window.console.log = log;
    }
}
exports.wrap_log = wrap_log;
//# sourceMappingURL=log.js.map

/***/ }),

/***/ 416779:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

/*
 *  This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.map_mutate_out_undefined = exports.map_without_undefined = exports.is_zero_map = exports.sum = exports.map_max = exports.map_min = exports.map_limit = void 0;
var lodash_1 = __webpack_require__(988593);
var type_checking_1 = __webpack_require__(307614);
// compare the values in a map a by the values of b
// or just by b if b is a number, using func(a, b)
function map_comp_fn(func, fallback) {
    return function (a, b) {
        var _a;
        var c = {};
        if (typeof b === "number") {
            for (var k in a) {
                var v = a[k];
                c[k] = func(v, b);
            }
        }
        else {
            for (var k in a) {
                var v = a[k];
                c[k] = func(v, (_a = b[k]) !== null && _a !== void 0 ? _a : fallback);
            }
        }
        return c;
    };
}
exports.map_limit = map_comp_fn(Math.min, Number.MAX_VALUE);
exports.map_min = exports.map_limit;
exports.map_max = map_comp_fn(Math.max, Number.MIN_VALUE);
// arithmetic sum of an array
function sum(arr, start) {
    if (start === void 0) { start = 0; }
    if (start == null) {
        start = 0;
    }
    return (0, lodash_1.reduce)(arr, function (a, b) { return a + b; }, start);
}
exports.sum = sum;
// returns true if the given map is undefined or empty, or all the values are falsy
function is_zero_map(map) {
    if (map == null) {
        return true;
    }
    for (var k in map) {
        if (map[k]) {
            return false;
        }
    }
    return true;
}
exports.is_zero_map = is_zero_map;
// Returns copy of map with no undefined/null values (recursive).
// Doesn't modify map.  If map is an array, just returns it
// with no change even if it has undefined values.
function map_without_undefined(map) {
    if (map == null) {
        return;
    }
    if ((0, type_checking_1.is_array)(map)) {
        return map;
    }
    var new_map = {};
    for (var k in map) {
        var v = map[k];
        if (v == null) {
            continue;
        }
        else {
            new_map[k] = (0, type_checking_1.is_object)(v) ? map_without_undefined(v) : v;
        }
    }
    return new_map;
}
exports.map_without_undefined = map_without_undefined;
// modify map in places deleting keys with null or undefined
// values; NOT recursive.
function map_mutate_out_undefined(map) {
    for (var k in map) {
        var v = map[k];
        if (v == null) {
            delete map[k];
        }
    }
}
exports.map_mutate_out_undefined = map_mutate_out_undefined;
//# sourceMappingURL=maps.js.map

/***/ }),

/***/ 962860:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

/*
 *  This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
//##############################################################################
//
// CoCalc: Collaborative web-based calculation
// Copyright (C) 2017, Sagemath Inc.
// AGPLv3
//
//##############################################################################
/*
Handling of input opts to functions and type checking.
*/
var DEBUG, TEST_MODE, val;
var PropTypes = __webpack_require__(430195);
var immutable_types = __webpack_require__(840165);
/*
Testing related env/DEVEL/DEBUG stuff
*/
if (__guard__(typeof process !== "undefined" && process !== null
    ? process.env
    : undefined, function (x) { return x.DEVEL; }) &&
    !__guard__(typeof process !== "undefined" && process !== null
        ? process.env
        : undefined, function (x1) { return x1.SMC_TEST; })) {
    // Running on node and DEVEL is set and not running under test suite
    DEBUG = true;
}
else {
    DEBUG = false;
}
// console.debug only logs if DEBUG is true
if (DEBUG) {
    console.debug = console.log;
}
else {
    console.debug = function () { };
}
if (__guard__(typeof process !== "undefined" && process !== null
    ? process.env
    : undefined, function (x2) { return x2.SMC_TEST; })) {
    // in test mode we *do* want exception to get thrown below when type checks fails
    TEST_MODE = true;
}
// Checks property types on a target object with checkers in a declaration.
// Declarations should throw an Error for mismatches and undefined if OK.
var types = (exports.types = function (target, declaration, identifier) {
    if (identifier == null) {
        identifier = "check.types";
    }
    if (typeof target !== "object") {
        throw new Error("Types was given a non-object to check");
    }
    if (typeof declaration !== "object") {
        throw new Error("Types was given a ".concat(typeof declaration, " as a declaration instead of an object"));
    }
    return PropTypes.checkPropTypes(declaration, target, "checking a", identifier);
});
for (var key in PropTypes) {
    val = PropTypes[key];
    if (key !== "checkPropTypes" && key !== "PropTypes") {
        types[key] = val;
    }
}
types.immutable = immutable_types.immutable;
// Returns a new object with properties determined by those of obj1 and
// obj2.  The properties in obj1 *must* all also appear in obj2.  If an
// obj2 property has value "defaults.required", then it must appear in
// obj1.  For each property P of obj2 not specified in obj1, the
// corresponding value obj1[P] is set (all in a new copy of obj1) to
// be obj2[P].
exports.defaults = function (obj1, obj2, allow_extra, strict) {
    var err;
    if (strict == null) {
        strict = false;
    }
    if (obj1 == null) {
        obj1 = {};
    }
    var error = function () {
        try {
            return "(obj1=".concat(exports.trunc(exports.to_json(obj1), 1024), ", obj2=").concat(exports.trunc(exports.to_json(obj2), 1024), ")");
        }
        catch (err) {
            return "";
        }
    };
    if (obj1 == null) {
        // useful special case
        obj1 = {};
    }
    if (typeof obj1 !== "object") {
        // We put explicit traces before the errors in this function,
        // since otherwise they can be very hard to debug.
        err = "BUG -- Traceback -- misc.defaults -- TypeError: function takes inputs as an object ".concat(error());
        if (strict || DEBUG || TEST_MODE) {
            throw new Error(err);
        }
        else {
            console.log(err);
            console.trace();
            return obj2;
        }
    }
    var r = {};
    for (var prop in obj2) {
        val = obj2[prop];
        if (obj1.hasOwnProperty(prop) && obj1[prop] != null) {
            if (obj2[prop] === exports.defaults.required && obj1[prop] == null) {
                err = "misc.defaults -- TypeError: property '".concat(prop, "' must be specified: ").concat(error());
                if (strict || DEBUG || TEST_MODE) {
                    throw new Error(err);
                }
                else {
                    console.warn(err);
                    console.trace();
                }
            }
            r[prop] = obj1[prop];
        }
        else if (obj2[prop] != null) {
            // only record not undefined properties
            if (obj2[prop] === exports.defaults.required) {
                err = "misc.defaults -- TypeError: property '".concat(prop, "' must be specified: ").concat(error());
                if (strict || DEBUG || TEST_MODE) {
                    throw new Error(err);
                }
                else {
                    console.warn(err);
                    console.trace();
                }
            }
            else {
                r[prop] = obj2[prop];
            }
        }
    }
    if (!allow_extra) {
        for (prop in obj1) {
            val = obj1[prop];
            if (!obj2.hasOwnProperty(prop)) {
                err = "misc.defaults -- TypeError: got an unexpected argument '".concat(prop, "' ").concat(error());
                console.trace();
                if (strict || DEBUG || TEST_MODE) {
                    throw new Error(err);
                }
                else {
                    console.warn(err);
                }
            }
        }
    }
    return r;
};
// WARNING -- don't accidentally use this as a default:
var required = (exports.required = exports.defaults.required =
    "__!!!!!!this is a required property!!!!!!__");
function __guard__(value, transform) {
    return typeof value !== "undefined" && value !== null
        ? transform(value)
        : undefined;
}
//# sourceMappingURL=opts.js.map

/***/ }),

/***/ 307614:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

/*
 *  This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.is_set = exports.is_date = exports.is_object = exports.is_string = exports.is_integer = exports.is_array = void 0;
function is_array(obj) {
    return Object.prototype.toString.call(obj) === "[object Array]";
}
exports.is_array = is_array;
function is_integer(obj) {
    var _a, _b;
    return (_b = (_a = Number.isInteger) === null || _a === void 0 ? void 0 : _a.call(Number, obj)) !== null && _b !== void 0 ? _b : (typeof obj
        === "number" && obj
        % 1 === 0);
}
exports.is_integer = is_integer;
function is_string(obj) {
    return typeof obj === "string";
}
exports.is_string = is_string;
// An object -- this is more constraining that typeof(obj) == 'object', e.g., it does
// NOT include Date.
function is_object(obj) {
    return Object.prototype.toString.call(obj) === "[object Object]";
}
exports.is_object = is_object;
function is_date(obj) {
    return obj instanceof Date;
}
exports.is_date = is_date;
function is_set(obj) {
    return Object.prototype.toString.call(obj) === "[object Set]";
}
exports.is_set = is_set;
//# sourceMappingURL=type-checking.js.map

/***/ })

};
;