diff --git a/dist/chunk-2GR5DWQ4.js b/dist/chunk-2GR5DWQ4.js deleted file mode 100644 index 1176670..0000000 --- a/dist/chunk-2GR5DWQ4.js +++ /dev/null @@ -1,5047 +0,0 @@ -import { - __commonJS, - __toESM -} from "./chunk-4ATCX2XT.js"; - -// node_modules/assertion-error/index.js -var require_assertion_error = __commonJS({ - "node_modules/assertion-error/index.js"(exports, module) { - function exclude() { - var excludes = [].slice.call(arguments); - function excludeProps(res, obj) { - Object.keys(obj).forEach(function(key) { - if (!~excludes.indexOf(key)) - res[key] = obj[key]; - }); - } - return function extendExclude() { - var args = [].slice.call(arguments), i = 0, res = {}; - for (; i < args.length; i++) { - excludeProps(res, args[i]); - } - return res; - }; - } - module.exports = AssertionError2; - function AssertionError2(message, _props, ssf) { - var extend = exclude("name", "message", "stack", "constructor", "toJSON"), props = extend(_props || {}); - this.message = message || "Unspecified AssertionError"; - this.showDiff = false; - for (var key in props) { - this[key] = props[key]; - } - ssf = ssf || AssertionError2; - if (Error.captureStackTrace) { - Error.captureStackTrace(this, ssf); - } else { - try { - throw new Error(); - } catch (e) { - this.stack = e.stack; - } - } - } - AssertionError2.prototype = Object.create(Error.prototype); - AssertionError2.prototype.name = "AssertionError"; - AssertionError2.prototype.constructor = AssertionError2; - AssertionError2.prototype.toJSON = function(stack) { - var extend = exclude("constructor", "toJSON", "stack"), props = extend({ name: this.name }, this); - if (false !== stack && this.stack) { - props.stack = this.stack; - } - return props; - }; - } -}); - -// node_modules/pathval/index.js -var require_pathval = __commonJS({ - "node_modules/pathval/index.js"(exports, module) { - "use strict"; - function hasProperty(obj, name) { - if (typeof obj === "undefined" || obj === null) { - return false; - } - return name in Object(obj); - } - function parsePath(path) { - var str = path.replace(/([^\\])\[/g, "$1.["); - var parts = str.match(/(\\\.|[^.]+?)+/g); - return parts.map(function mapMatches(value) { - if (value === "constructor" || value === "__proto__" || value === "prototype") { - return {}; - } - var regexp = /^\[(\d+)\]$/; - var mArr = regexp.exec(value); - var parsed = null; - if (mArr) { - parsed = { i: parseFloat(mArr[1]) }; - } else { - parsed = { p: value.replace(/\\([.[\]])/g, "$1") }; - } - return parsed; - }); - } - function internalGetPathValue(obj, parsed, pathDepth) { - var temporaryValue = obj; - var res = null; - pathDepth = typeof pathDepth === "undefined" ? parsed.length : pathDepth; - for (var i = 0; i < pathDepth; i++) { - var part = parsed[i]; - if (temporaryValue) { - if (typeof part.p === "undefined") { - temporaryValue = temporaryValue[part.i]; - } else { - temporaryValue = temporaryValue[part.p]; - } - if (i === pathDepth - 1) { - res = temporaryValue; - } - } - } - return res; - } - function internalSetPathValue(obj, val, parsed) { - var tempObj = obj; - var pathDepth = parsed.length; - var part = null; - for (var i = 0; i < pathDepth; i++) { - var propName = null; - var propVal = null; - part = parsed[i]; - if (i === pathDepth - 1) { - propName = typeof part.p === "undefined" ? part.i : part.p; - tempObj[propName] = val; - } else if (typeof part.p !== "undefined" && tempObj[part.p]) { - tempObj = tempObj[part.p]; - } else if (typeof part.i !== "undefined" && tempObj[part.i]) { - tempObj = tempObj[part.i]; - } else { - var next = parsed[i + 1]; - propName = typeof part.p === "undefined" ? part.i : part.p; - propVal = typeof next.p === "undefined" ? [] : {}; - tempObj[propName] = propVal; - tempObj = tempObj[propName]; - } - } - } - function getPathInfo(obj, path) { - var parsed = parsePath(path); - var last = parsed[parsed.length - 1]; - var info = { - parent: parsed.length > 1 ? internalGetPathValue(obj, parsed, parsed.length - 1) : obj, - name: last.p || last.i, - value: internalGetPathValue(obj, parsed) - }; - info.exists = hasProperty(info.parent, info.name); - return info; - } - function getPathValue(obj, path) { - var info = getPathInfo(obj, path); - return info.value; - } - function setPathValue(obj, path, val) { - var parsed = parsePath(path); - internalSetPathValue(obj, val, parsed); - return obj; - } - module.exports = { - hasProperty, - getPathInfo, - getPathValue, - setPathValue - }; - } -}); - -// node_modules/chai/lib/chai/utils/flag.js -var require_flag = __commonJS({ - "node_modules/chai/lib/chai/utils/flag.js"(exports, module) { - module.exports = function flag(obj, key, value) { - var flags = obj.__flags || (obj.__flags = /* @__PURE__ */ Object.create(null)); - if (arguments.length === 3) { - flags[key] = value; - } else { - return flags[key]; - } - }; - } -}); - -// node_modules/chai/lib/chai/utils/test.js -var require_test = __commonJS({ - "node_modules/chai/lib/chai/utils/test.js"(exports, module) { - var flag = require_flag(); - module.exports = function test(obj, args) { - var negate = flag(obj, "negate"), expr = args[0]; - return negate ? !expr : expr; - }; - } -}); - -// node_modules/type-detect/type-detect.js -var require_type_detect = __commonJS({ - "node_modules/type-detect/type-detect.js"(exports, module) { - (function(global2, factory) { - typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global2.typeDetect = factory(); - })(exports, function() { - "use strict"; - var promiseExists = typeof Promise === "function"; - var globalObject = typeof self === "object" ? self : global; - var symbolExists = typeof Symbol !== "undefined"; - var mapExists = typeof Map !== "undefined"; - var setExists = typeof Set !== "undefined"; - var weakMapExists = typeof WeakMap !== "undefined"; - var weakSetExists = typeof WeakSet !== "undefined"; - var dataViewExists = typeof DataView !== "undefined"; - var symbolIteratorExists = symbolExists && typeof Symbol.iterator !== "undefined"; - var symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== "undefined"; - var setEntriesExists = setExists && typeof Set.prototype.entries === "function"; - var mapEntriesExists = mapExists && typeof Map.prototype.entries === "function"; - var setIteratorPrototype = setEntriesExists && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()); - var mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()); - var arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === "function"; - var arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]()); - var stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === "function"; - var stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(""[Symbol.iterator]()); - var toStringLeftSliceLength = 8; - var toStringRightSliceLength = -1; - function typeDetect(obj) { - var typeofObj = typeof obj; - if (typeofObj !== "object") { - return typeofObj; - } - if (obj === null) { - return "null"; - } - if (obj === globalObject) { - return "global"; - } - if (Array.isArray(obj) && (symbolToStringTagExists === false || !(Symbol.toStringTag in obj))) { - return "Array"; - } - if (typeof window === "object" && window !== null) { - if (typeof window.location === "object" && obj === window.location) { - return "Location"; - } - if (typeof window.document === "object" && obj === window.document) { - return "Document"; - } - if (typeof window.navigator === "object") { - if (typeof window.navigator.mimeTypes === "object" && obj === window.navigator.mimeTypes) { - return "MimeTypeArray"; - } - if (typeof window.navigator.plugins === "object" && obj === window.navigator.plugins) { - return "PluginArray"; - } - } - if ((typeof window.HTMLElement === "function" || typeof window.HTMLElement === "object") && obj instanceof window.HTMLElement) { - if (obj.tagName === "BLOCKQUOTE") { - return "HTMLQuoteElement"; - } - if (obj.tagName === "TD") { - return "HTMLTableDataCellElement"; - } - if (obj.tagName === "TH") { - return "HTMLTableHeaderCellElement"; - } - } - } - var stringTag = symbolToStringTagExists && obj[Symbol.toStringTag]; - if (typeof stringTag === "string") { - return stringTag; - } - var objPrototype = Object.getPrototypeOf(obj); - if (objPrototype === RegExp.prototype) { - return "RegExp"; - } - if (objPrototype === Date.prototype) { - return "Date"; - } - if (promiseExists && objPrototype === Promise.prototype) { - return "Promise"; - } - if (setExists && objPrototype === Set.prototype) { - return "Set"; - } - if (mapExists && objPrototype === Map.prototype) { - return "Map"; - } - if (weakSetExists && objPrototype === WeakSet.prototype) { - return "WeakSet"; - } - if (weakMapExists && objPrototype === WeakMap.prototype) { - return "WeakMap"; - } - if (dataViewExists && objPrototype === DataView.prototype) { - return "DataView"; - } - if (mapExists && objPrototype === mapIteratorPrototype) { - return "Map Iterator"; - } - if (setExists && objPrototype === setIteratorPrototype) { - return "Set Iterator"; - } - if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) { - return "Array Iterator"; - } - if (stringIteratorExists && objPrototype === stringIteratorPrototype) { - return "String Iterator"; - } - if (objPrototype === null) { - return "Object"; - } - return Object.prototype.toString.call(obj).slice(toStringLeftSliceLength, toStringRightSliceLength); - } - return typeDetect; - }); - } -}); - -// node_modules/chai/lib/chai/utils/expectTypes.js -var require_expectTypes = __commonJS({ - "node_modules/chai/lib/chai/utils/expectTypes.js"(exports, module) { - var AssertionError2 = require_assertion_error(); - var flag = require_flag(); - var type = require_type_detect(); - module.exports = function expectTypes(obj, types) { - var flagMsg = flag(obj, "message"); - var ssfi = flag(obj, "ssfi"); - flagMsg = flagMsg ? flagMsg + ": " : ""; - obj = flag(obj, "object"); - types = types.map(function(t) { - return t.toLowerCase(); - }); - types.sort(); - var str = types.map(function(t, index) { - var art = ~["a", "e", "i", "o", "u"].indexOf(t.charAt(0)) ? "an" : "a"; - var or = types.length > 1 && index === types.length - 1 ? "or " : ""; - return or + art + " " + t; - }).join(", "); - var objType = type(obj).toLowerCase(); - if (!types.some(function(expected) { - return objType === expected; - })) { - throw new AssertionError2( - flagMsg + "object tested must be " + str + ", but " + objType + " given", - void 0, - ssfi - ); - } - }; - } -}); - -// node_modules/chai/lib/chai/utils/getActual.js -var require_getActual = __commonJS({ - "node_modules/chai/lib/chai/utils/getActual.js"(exports, module) { - module.exports = function getActual(obj, args) { - return args.length > 4 ? args[4] : obj._obj; - }; - } -}); - -// node_modules/get-func-name/index.js -var require_get_func_name = __commonJS({ - "node_modules/get-func-name/index.js"(exports, module) { - "use strict"; - var toString = Function.prototype.toString; - var functionNameMatch = /\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\s\(\/]+)/; - var maxFunctionSourceLength = 512; - function getFuncName(aFunc) { - if (typeof aFunc !== "function") { - return null; - } - var name = ""; - if (typeof Function.prototype.name === "undefined" && typeof aFunc.name === "undefined") { - var functionSource = toString.call(aFunc); - if (functionSource.indexOf("(") > maxFunctionSourceLength) { - return name; - } - var match = functionSource.match(functionNameMatch); - if (match) { - name = match[1]; - } - } else { - name = aFunc.name; - } - return name; - } - module.exports = getFuncName; - } -}); - -// (disabled):node_modules/util/util.js -var require_util = __commonJS({ - "(disabled):node_modules/util/util.js"() { - } -}); - -// node_modules/loupe/loupe.js -var require_loupe = __commonJS({ - "node_modules/loupe/loupe.js"(exports, module) { - (function(global2, factory) { - typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.loupe = {})); - })(exports, function(exports2) { - "use strict"; - function _typeof(obj) { - "@babel/helpers - typeof"; - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function(obj2) { - return typeof obj2; - }; - } else { - _typeof = function(obj2) { - return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }; - } - return _typeof(obj); - } - function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); - } - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) - return arr; - } - function _iterableToArrayLimit(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) - return; - var _arr = []; - var _n = true; - var _d = false; - var _e = void 0; - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - if (i && _arr.length === i) - break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) - _i["return"](); - } finally { - if (_d) - throw _e; - } - } - return _arr; - } - function _unsupportedIterableToArray(o, minLen) { - if (!o) - return; - if (typeof o === "string") - return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) - n = o.constructor.name; - if (n === "Map" || n === "Set") - return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) - return _arrayLikeToArray(o, minLen); - } - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) - len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) - arr2[i] = arr[i]; - return arr2; - } - function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - var ansiColors = { - bold: ["1", "22"], - dim: ["2", "22"], - italic: ["3", "23"], - underline: ["4", "24"], - // 5 & 6 are blinking - inverse: ["7", "27"], - hidden: ["8", "28"], - strike: ["9", "29"], - // 10-20 are fonts - // 21-29 are resets for 1-9 - black: ["30", "39"], - red: ["31", "39"], - green: ["32", "39"], - yellow: ["33", "39"], - blue: ["34", "39"], - magenta: ["35", "39"], - cyan: ["36", "39"], - white: ["37", "39"], - brightblack: ["30;1", "39"], - brightred: ["31;1", "39"], - brightgreen: ["32;1", "39"], - brightyellow: ["33;1", "39"], - brightblue: ["34;1", "39"], - brightmagenta: ["35;1", "39"], - brightcyan: ["36;1", "39"], - brightwhite: ["37;1", "39"], - grey: ["90", "39"] - }; - var styles = { - special: "cyan", - number: "yellow", - bigint: "yellow", - boolean: "yellow", - undefined: "grey", - null: "bold", - string: "green", - symbol: "green", - date: "magenta", - regexp: "red" - }; - var truncator = "\u2026"; - function colorise(value, styleType) { - var color = ansiColors[styles[styleType]] || ansiColors[styleType]; - if (!color) { - return String(value); - } - return "\x1B[".concat(color[0], "m").concat(String(value), "\x1B[").concat(color[1], "m"); - } - function normaliseOptions() { - var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref$showHidden = _ref.showHidden, showHidden = _ref$showHidden === void 0 ? false : _ref$showHidden, _ref$depth = _ref.depth, depth = _ref$depth === void 0 ? 2 : _ref$depth, _ref$colors = _ref.colors, colors = _ref$colors === void 0 ? false : _ref$colors, _ref$customInspect = _ref.customInspect, customInspect = _ref$customInspect === void 0 ? true : _ref$customInspect, _ref$showProxy = _ref.showProxy, showProxy = _ref$showProxy === void 0 ? false : _ref$showProxy, _ref$maxArrayLength = _ref.maxArrayLength, maxArrayLength = _ref$maxArrayLength === void 0 ? Infinity : _ref$maxArrayLength, _ref$breakLength = _ref.breakLength, breakLength = _ref$breakLength === void 0 ? Infinity : _ref$breakLength, _ref$seen = _ref.seen, seen = _ref$seen === void 0 ? [] : _ref$seen, _ref$truncate = _ref.truncate, truncate2 = _ref$truncate === void 0 ? Infinity : _ref$truncate, _ref$stylize = _ref.stylize, stylize = _ref$stylize === void 0 ? String : _ref$stylize; - var options = { - showHidden: Boolean(showHidden), - depth: Number(depth), - colors: Boolean(colors), - customInspect: Boolean(customInspect), - showProxy: Boolean(showProxy), - maxArrayLength: Number(maxArrayLength), - breakLength: Number(breakLength), - truncate: Number(truncate2), - seen, - stylize - }; - if (options.colors) { - options.stylize = colorise; - } - return options; - } - function truncate(string, length) { - var tail = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : truncator; - string = String(string); - var tailLength = tail.length; - var stringLength = string.length; - if (tailLength > length && stringLength > tailLength) { - return tail; - } - if (stringLength > length && stringLength > tailLength) { - return "".concat(string.slice(0, length - tailLength)).concat(tail); - } - return string; - } - function inspectList(list, options, inspectItem) { - var separator = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ", "; - inspectItem = inspectItem || options.inspect; - var size = list.length; - if (size === 0) - return ""; - var originalLength = options.truncate; - var output = ""; - var peek = ""; - var truncated = ""; - for (var i = 0; i < size; i += 1) { - var last = i + 1 === list.length; - var secondToLast = i + 2 === list.length; - truncated = "".concat(truncator, "(").concat(list.length - i, ")"); - var value = list[i]; - options.truncate = originalLength - output.length - (last ? 0 : separator.length); - var string = peek || inspectItem(value, options) + (last ? "" : separator); - var nextLength = output.length + string.length; - var truncatedLength = nextLength + truncated.length; - if (last && nextLength > originalLength && output.length + truncated.length <= originalLength) { - break; - } - if (!last && !secondToLast && truncatedLength > originalLength) { - break; - } - peek = last ? "" : inspectItem(list[i + 1], options) + (secondToLast ? "" : separator); - if (!last && secondToLast && truncatedLength > originalLength && nextLength + peek.length > originalLength) { - break; - } - output += string; - if (!last && !secondToLast && nextLength + peek.length >= originalLength) { - truncated = "".concat(truncator, "(").concat(list.length - i - 1, ")"); - break; - } - truncated = ""; - } - return "".concat(output).concat(truncated); - } - function quoteComplexKey(key) { - if (key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) { - return key; - } - return JSON.stringify(key).replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"); - } - function inspectProperty(_ref2, options) { - var _ref3 = _slicedToArray(_ref2, 2), key = _ref3[0], value = _ref3[1]; - options.truncate -= 2; - if (typeof key === "string") { - key = quoteComplexKey(key); - } else if (typeof key !== "number") { - key = "[".concat(options.inspect(key, options), "]"); - } - options.truncate -= key.length; - value = options.inspect(value, options); - return "".concat(key, ": ").concat(value); - } - function inspectArray(array, options) { - var nonIndexProperties = Object.keys(array).slice(array.length); - if (!array.length && !nonIndexProperties.length) - return "[]"; - options.truncate -= 4; - var listContents = inspectList(array, options); - options.truncate -= listContents.length; - var propertyContents = ""; - if (nonIndexProperties.length) { - propertyContents = inspectList(nonIndexProperties.map(function(key) { - return [key, array[key]]; - }), options, inspectProperty); - } - return "[ ".concat(listContents).concat(propertyContents ? ", ".concat(propertyContents) : "", " ]"); - } - var toString = Function.prototype.toString; - var functionNameMatch = /\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\s\(\/]+)/; - var maxFunctionSourceLength = 512; - function getFuncName(aFunc) { - if (typeof aFunc !== "function") { - return null; - } - var name = ""; - if (typeof Function.prototype.name === "undefined" && typeof aFunc.name === "undefined") { - var functionSource = toString.call(aFunc); - if (functionSource.indexOf("(") > maxFunctionSourceLength) { - return name; - } - var match = functionSource.match(functionNameMatch); - if (match) { - name = match[1]; - } - } else { - name = aFunc.name; - } - return name; - } - var getFuncName_1 = getFuncName; - var getArrayName = function getArrayName2(array) { - if (typeof Buffer === "function" && array instanceof Buffer) { - return "Buffer"; - } - if (array[Symbol.toStringTag]) { - return array[Symbol.toStringTag]; - } - return getFuncName_1(array.constructor); - }; - function inspectTypedArray(array, options) { - var name = getArrayName(array); - options.truncate -= name.length + 4; - var nonIndexProperties = Object.keys(array).slice(array.length); - if (!array.length && !nonIndexProperties.length) - return "".concat(name, "[]"); - var output = ""; - for (var i = 0; i < array.length; i++) { - var string = "".concat(options.stylize(truncate(array[i], options.truncate), "number")).concat(i === array.length - 1 ? "" : ", "); - options.truncate -= string.length; - if (array[i] !== array.length && options.truncate <= 3) { - output += "".concat(truncator, "(").concat(array.length - array[i] + 1, ")"); - break; - } - output += string; - } - var propertyContents = ""; - if (nonIndexProperties.length) { - propertyContents = inspectList(nonIndexProperties.map(function(key) { - return [key, array[key]]; - }), options, inspectProperty); - } - return "".concat(name, "[ ").concat(output).concat(propertyContents ? ", ".concat(propertyContents) : "", " ]"); - } - function inspectDate(dateObject, options) { - var stringRepresentation = dateObject.toJSON(); - if (stringRepresentation === null) { - return "Invalid Date"; - } - var split = stringRepresentation.split("T"); - var date = split[0]; - return options.stylize("".concat(date, "T").concat(truncate(split[1], options.truncate - date.length - 1)), "date"); - } - function inspectFunction(func, options) { - var name = getFuncName_1(func); - if (!name) { - return options.stylize("[Function]", "special"); - } - return options.stylize("[Function ".concat(truncate(name, options.truncate - 11), "]"), "special"); - } - function inspectMapEntry(_ref, options) { - var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1]; - options.truncate -= 4; - key = options.inspect(key, options); - options.truncate -= key.length; - value = options.inspect(value, options); - return "".concat(key, " => ").concat(value); - } - function mapToEntries(map) { - var entries = []; - map.forEach(function(value, key) { - entries.push([key, value]); - }); - return entries; - } - function inspectMap(map, options) { - var size = map.size - 1; - if (size <= 0) { - return "Map{}"; - } - options.truncate -= 7; - return "Map{ ".concat(inspectList(mapToEntries(map), options, inspectMapEntry), " }"); - } - var isNaN = Number.isNaN || function(i) { - return i !== i; - }; - function inspectNumber(number, options) { - if (isNaN(number)) { - return options.stylize("NaN", "number"); - } - if (number === Infinity) { - return options.stylize("Infinity", "number"); - } - if (number === -Infinity) { - return options.stylize("-Infinity", "number"); - } - if (number === 0) { - return options.stylize(1 / number === Infinity ? "+0" : "-0", "number"); - } - return options.stylize(truncate(number, options.truncate), "number"); - } - function inspectBigInt(number, options) { - var nums = truncate(number.toString(), options.truncate - 1); - if (nums !== truncator) - nums += "n"; - return options.stylize(nums, "bigint"); - } - function inspectRegExp(value, options) { - var flags = value.toString().split("/")[2]; - var sourceLength = options.truncate - (2 + flags.length); - var source = value.source; - return options.stylize("/".concat(truncate(source, sourceLength), "/").concat(flags), "regexp"); - } - function arrayFromSet(set) { - var values = []; - set.forEach(function(value) { - values.push(value); - }); - return values; - } - function inspectSet(set, options) { - if (set.size === 0) - return "Set{}"; - options.truncate -= 7; - return "Set{ ".concat(inspectList(arrayFromSet(set), options), " }"); - } - var stringEscapeChars = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]", "g"); - var escapeCharacters = { - "\b": "\\b", - " ": "\\t", - "\n": "\\n", - "\f": "\\f", - "\r": "\\r", - "'": "\\'", - "\\": "\\\\" - }; - var hex = 16; - var unicodeLength = 4; - function escape(char) { - return escapeCharacters[char] || "\\u".concat("0000".concat(char.charCodeAt(0).toString(hex)).slice(-unicodeLength)); - } - function inspectString(string, options) { - if (stringEscapeChars.test(string)) { - string = string.replace(stringEscapeChars, escape); - } - return options.stylize("'".concat(truncate(string, options.truncate - 2), "'"), "string"); - } - function inspectSymbol(value) { - if ("description" in Symbol.prototype) { - return value.description ? "Symbol(".concat(value.description, ")") : "Symbol()"; - } - return value.toString(); - } - var getPromiseValue = function getPromiseValue2() { - return "Promise{\u2026}"; - }; - try { - var _process$binding = process.binding("util"), getPromiseDetails = _process$binding.getPromiseDetails, kPending = _process$binding.kPending, kRejected = _process$binding.kRejected; - if (Array.isArray(getPromiseDetails(Promise.resolve()))) { - getPromiseValue = function getPromiseValue2(value, options) { - var _getPromiseDetails = getPromiseDetails(value), _getPromiseDetails2 = _slicedToArray(_getPromiseDetails, 2), state = _getPromiseDetails2[0], innerValue = _getPromiseDetails2[1]; - if (state === kPending) { - return "Promise{}"; - } - return "Promise".concat(state === kRejected ? "!" : "", "{").concat(options.inspect(innerValue, options), "}"); - }; - } - } catch (notNode) { - } - var inspectPromise = getPromiseValue; - function inspectObject(object, options) { - var properties = Object.getOwnPropertyNames(object); - var symbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : []; - if (properties.length === 0 && symbols.length === 0) { - return "{}"; - } - options.truncate -= 4; - options.seen = options.seen || []; - if (options.seen.indexOf(object) >= 0) { - return "[Circular]"; - } - options.seen.push(object); - var propertyContents = inspectList(properties.map(function(key) { - return [key, object[key]]; - }), options, inspectProperty); - var symbolContents = inspectList(symbols.map(function(key) { - return [key, object[key]]; - }), options, inspectProperty); - options.seen.pop(); - var sep = ""; - if (propertyContents && symbolContents) { - sep = ", "; - } - return "{ ".concat(propertyContents).concat(sep).concat(symbolContents, " }"); - } - var toStringTag = typeof Symbol !== "undefined" && Symbol.toStringTag ? Symbol.toStringTag : false; - function inspectClass(value, options) { - var name = ""; - if (toStringTag && toStringTag in value) { - name = value[toStringTag]; - } - name = name || getFuncName_1(value.constructor); - if (!name || name === "_class") { - name = ""; - } - options.truncate -= name.length; - return "".concat(name).concat(inspectObject(value, options)); - } - function inspectArguments(args, options) { - if (args.length === 0) - return "Arguments[]"; - options.truncate -= 13; - return "Arguments[ ".concat(inspectList(args, options), " ]"); - } - var errorKeys = ["stack", "line", "column", "name", "message", "fileName", "lineNumber", "columnNumber", "number", "description"]; - function inspectObject$1(error, options) { - var properties = Object.getOwnPropertyNames(error).filter(function(key) { - return errorKeys.indexOf(key) === -1; - }); - var name = error.name; - options.truncate -= name.length; - var message = ""; - if (typeof error.message === "string") { - message = truncate(error.message, options.truncate); - } else { - properties.unshift("message"); - } - message = message ? ": ".concat(message) : ""; - options.truncate -= message.length + 5; - var propertyContents = inspectList(properties.map(function(key) { - return [key, error[key]]; - }), options, inspectProperty); - return "".concat(name).concat(message).concat(propertyContents ? " { ".concat(propertyContents, " }") : ""); - } - function inspectAttribute(_ref, options) { - var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1]; - options.truncate -= 3; - if (!value) { - return "".concat(options.stylize(key, "yellow")); - } - return "".concat(options.stylize(key, "yellow"), "=").concat(options.stylize('"'.concat(value, '"'), "string")); - } - function inspectHTMLCollection(collection, options) { - return inspectList(collection, options, inspectHTML, "\n"); - } - function inspectHTML(element, options) { - var properties = element.getAttributeNames(); - var name = element.tagName.toLowerCase(); - var head = options.stylize("<".concat(name), "special"); - var headClose = options.stylize(">", "special"); - var tail = options.stylize(""), "special"); - options.truncate -= name.length * 2 + 5; - var propertyContents = ""; - if (properties.length > 0) { - propertyContents += " "; - propertyContents += inspectList(properties.map(function(key) { - return [key, element.getAttribute(key)]; - }), options, inspectAttribute, " "); - } - options.truncate -= propertyContents.length; - var truncate2 = options.truncate; - var children = inspectHTMLCollection(element.children, options); - if (children && children.length > truncate2) { - children = "".concat(truncator, "(").concat(element.children.length, ")"); - } - return "".concat(head).concat(propertyContents).concat(headClose).concat(children).concat(tail); - } - var symbolsSupported = typeof Symbol === "function" && typeof Symbol.for === "function"; - var chaiInspect = symbolsSupported ? Symbol.for("chai/inspect") : "@@chai/inspect"; - var nodeInspect = false; - try { - var nodeUtil = require_util(); - nodeInspect = nodeUtil.inspect ? nodeUtil.inspect.custom : false; - } catch (noNodeInspect) { - nodeInspect = false; - } - function FakeMap() { - this.key = "chai/loupe__" + Math.random() + Date.now(); - } - FakeMap.prototype = { - // eslint-disable-next-line object-shorthand - get: function get(key) { - return key[this.key]; - }, - // eslint-disable-next-line object-shorthand - has: function has(key) { - return this.key in key; - }, - // eslint-disable-next-line object-shorthand - set: function set(key, value) { - if (Object.isExtensible(key)) { - Object.defineProperty(key, this.key, { - // eslint-disable-next-line object-shorthand - value, - configurable: true - }); - } - } - }; - var constructorMap = new (typeof WeakMap === "function" ? WeakMap : FakeMap)(); - var stringTagMap = {}; - var baseTypesMap = { - undefined: function undefined$1(value, options) { - return options.stylize("undefined", "undefined"); - }, - null: function _null(value, options) { - return options.stylize(null, "null"); - }, - boolean: function boolean(value, options) { - return options.stylize(value, "boolean"); - }, - Boolean: function Boolean2(value, options) { - return options.stylize(value, "boolean"); - }, - number: inspectNumber, - Number: inspectNumber, - bigint: inspectBigInt, - BigInt: inspectBigInt, - string: inspectString, - String: inspectString, - function: inspectFunction, - Function: inspectFunction, - symbol: inspectSymbol, - // A Symbol polyfill will return `Symbol` not `symbol` from typedetect - Symbol: inspectSymbol, - Array: inspectArray, - Date: inspectDate, - Map: inspectMap, - Set: inspectSet, - RegExp: inspectRegExp, - Promise: inspectPromise, - // WeakSet, WeakMap are totally opaque to us - WeakSet: function WeakSet2(value, options) { - return options.stylize("WeakSet{\u2026}", "special"); - }, - WeakMap: function WeakMap2(value, options) { - return options.stylize("WeakMap{\u2026}", "special"); - }, - Arguments: inspectArguments, - Int8Array: inspectTypedArray, - Uint8Array: inspectTypedArray, - Uint8ClampedArray: inspectTypedArray, - Int16Array: inspectTypedArray, - Uint16Array: inspectTypedArray, - Int32Array: inspectTypedArray, - Uint32Array: inspectTypedArray, - Float32Array: inspectTypedArray, - Float64Array: inspectTypedArray, - Generator: function Generator() { - return ""; - }, - DataView: function DataView2() { - return ""; - }, - ArrayBuffer: function ArrayBuffer() { - return ""; - }, - Error: inspectObject$1, - HTMLCollection: inspectHTMLCollection, - NodeList: inspectHTMLCollection - }; - var inspectCustom = function inspectCustom2(value, options, type) { - if (chaiInspect in value && typeof value[chaiInspect] === "function") { - return value[chaiInspect](options); - } - if (nodeInspect && nodeInspect in value && typeof value[nodeInspect] === "function") { - return value[nodeInspect](options.depth, options); - } - if ("inspect" in value && typeof value.inspect === "function") { - return value.inspect(options.depth, options); - } - if ("constructor" in value && constructorMap.has(value.constructor)) { - return constructorMap.get(value.constructor)(value, options); - } - if (stringTagMap[type]) { - return stringTagMap[type](value, options); - } - return ""; - }; - var toString$1 = Object.prototype.toString; - function inspect(value, options) { - options = normaliseOptions(options); - options.inspect = inspect; - var _options = options, customInspect = _options.customInspect; - var type = value === null ? "null" : _typeof(value); - if (type === "object") { - type = toString$1.call(value).slice(8, -1); - } - if (baseTypesMap[type]) { - return baseTypesMap[type](value, options); - } - if (customInspect && value) { - var output = inspectCustom(value, options, type); - if (output) { - if (typeof output === "string") - return output; - return inspect(output, options); - } - } - var proto = value ? Object.getPrototypeOf(value) : false; - if (proto === Object.prototype || proto === null) { - return inspectObject(value, options); - } - if (value && typeof HTMLElement === "function" && value instanceof HTMLElement) { - return inspectHTML(value, options); - } - if ("constructor" in value) { - if (value.constructor !== Object) { - return inspectClass(value, options); - } - return inspectObject(value, options); - } - if (value === Object(value)) { - return inspectObject(value, options); - } - return options.stylize(String(value), type); - } - function registerConstructor(constructor, inspector) { - if (constructorMap.has(constructor)) { - return false; - } - constructorMap.set(constructor, inspector); - return true; - } - function registerStringTag(stringTag, inspector) { - if (stringTag in stringTagMap) { - return false; - } - stringTagMap[stringTag] = inspector; - return true; - } - var custom = chaiInspect; - exports2.custom = custom; - exports2.default = inspect; - exports2.inspect = inspect; - exports2.registerConstructor = registerConstructor; - exports2.registerStringTag = registerStringTag; - Object.defineProperty(exports2, "__esModule", { value: true }); - }); - } -}); - -// node_modules/chai/lib/chai/config.js -var require_config = __commonJS({ - "node_modules/chai/lib/chai/config.js"(exports, module) { - module.exports = { - /** - * ### config.includeStack - * - * User configurable property, influences whether stack trace - * is included in Assertion error message. Default of false - * suppresses stack trace in the error message. - * - * chai.config.includeStack = true; // enable stack on error - * - * @param {Boolean} - * @api public - */ - includeStack: false, - /** - * ### config.showDiff - * - * User configurable property, influences whether or not - * the `showDiff` flag should be included in the thrown - * AssertionErrors. `false` will always be `false`; `true` - * will be true when the assertion has requested a diff - * be shown. - * - * @param {Boolean} - * @api public - */ - showDiff: true, - /** - * ### config.truncateThreshold - * - * User configurable property, sets length threshold for actual and - * expected values in assertion errors. If this threshold is exceeded, for - * example for large data structures, the value is replaced with something - * like `[ Array(3) ]` or `{ Object (prop1, prop2) }`. - * - * Set it to zero if you want to disable truncating altogether. - * - * This is especially userful when doing assertions on arrays: having this - * set to a reasonable large value makes the failure messages readily - * inspectable. - * - * chai.config.truncateThreshold = 0; // disable truncating - * - * @param {Number} - * @api public - */ - truncateThreshold: 40, - /** - * ### config.useProxy - * - * User configurable property, defines if chai will use a Proxy to throw - * an error when a non-existent property is read, which protects users - * from typos when using property-based assertions. - * - * Set it to false if you want to disable this feature. - * - * chai.config.useProxy = false; // disable use of Proxy - * - * This feature is automatically disabled regardless of this config value - * in environments that don't support proxies. - * - * @param {Boolean} - * @api public - */ - useProxy: true, - /** - * ### config.proxyExcludedKeys - * - * User configurable property, defines which properties should be ignored - * instead of throwing an error if they do not exist on the assertion. - * This is only applied if the environment Chai is running in supports proxies and - * if the `useProxy` configuration setting is enabled. - * By default, `then` and `inspect` will not throw an error if they do not exist on the - * assertion object because the `.inspect` property is read by `util.inspect` (for example, when - * using `console.log` on the assertion object) and `.then` is necessary for promise type-checking. - * - * // By default these keys will not throw an error if they do not exist on the assertion object - * chai.config.proxyExcludedKeys = ['then', 'inspect']; - * - * @param {Array} - * @api public - */ - proxyExcludedKeys: ["then", "catch", "inspect", "toJSON"], - /** - * ### config.deepEqual - * - * User configurable property, defines which a custom function to use for deepEqual - * comparisons. - * By default, the function used is the one from the `deep-eql` package without custom comparator. - * - * // use a custom comparator - * chai.config.deepEqual = (expected, actual) => { - * return chai.util.eql(expected, actual, { - * comparator: (expected, actual) => { - * // for non number comparison, use the default behavior - * if(typeof expected !== 'number') return null; - * // allow a difference of 10 between compared numbers - * return typeof actual === 'number' && Math.abs(actual - expected) < 10 - * } - * }) - * }; - * - * @param {Function} - * @api public - */ - deepEqual: null - }; - } -}); - -// node_modules/chai/lib/chai/utils/inspect.js -var require_inspect = __commonJS({ - "node_modules/chai/lib/chai/utils/inspect.js"(exports, module) { - var getName = require_get_func_name(); - var loupe = require_loupe(); - var config2 = require_config(); - module.exports = inspect; - function inspect(obj, showHidden, depth, colors) { - var options = { - colors, - depth: typeof depth === "undefined" ? 2 : depth, - showHidden, - truncate: config2.truncateThreshold ? config2.truncateThreshold : Infinity - }; - return loupe.inspect(obj, options); - } - } -}); - -// node_modules/chai/lib/chai/utils/objDisplay.js -var require_objDisplay = __commonJS({ - "node_modules/chai/lib/chai/utils/objDisplay.js"(exports, module) { - var inspect = require_inspect(); - var config2 = require_config(); - module.exports = function objDisplay(obj) { - var str = inspect(obj), type = Object.prototype.toString.call(obj); - if (config2.truncateThreshold && str.length >= config2.truncateThreshold) { - if (type === "[object Function]") { - return !obj.name || obj.name === "" ? "[Function]" : "[Function: " + obj.name + "]"; - } else if (type === "[object Array]") { - return "[ Array(" + obj.length + ") ]"; - } else if (type === "[object Object]") { - var keys = Object.keys(obj), kstr = keys.length > 2 ? keys.splice(0, 2).join(", ") + ", ..." : keys.join(", "); - return "{ Object (" + kstr + ") }"; - } else { - return str; - } - } else { - return str; - } - }; - } -}); - -// node_modules/chai/lib/chai/utils/getMessage.js -var require_getMessage = __commonJS({ - "node_modules/chai/lib/chai/utils/getMessage.js"(exports, module) { - var flag = require_flag(); - var getActual = require_getActual(); - var objDisplay = require_objDisplay(); - module.exports = function getMessage(obj, args) { - var negate = flag(obj, "negate"), val = flag(obj, "object"), expected = args[3], actual = getActual(obj, args), msg = negate ? args[2] : args[1], flagMsg = flag(obj, "message"); - if (typeof msg === "function") - msg = msg(); - msg = msg || ""; - msg = msg.replace(/#\{this\}/g, function() { - return objDisplay(val); - }).replace(/#\{act\}/g, function() { - return objDisplay(actual); - }).replace(/#\{exp\}/g, function() { - return objDisplay(expected); - }); - return flagMsg ? flagMsg + ": " + msg : msg; - }; - } -}); - -// node_modules/chai/lib/chai/utils/transferFlags.js -var require_transferFlags = __commonJS({ - "node_modules/chai/lib/chai/utils/transferFlags.js"(exports, module) { - module.exports = function transferFlags(assertion, object, includeAll) { - var flags = assertion.__flags || (assertion.__flags = /* @__PURE__ */ Object.create(null)); - if (!object.__flags) { - object.__flags = /* @__PURE__ */ Object.create(null); - } - includeAll = arguments.length === 3 ? includeAll : true; - for (var flag in flags) { - if (includeAll || flag !== "object" && flag !== "ssfi" && flag !== "lockSsfi" && flag != "message") { - object.__flags[flag] = flags[flag]; - } - } - }; - } -}); - -// node_modules/deep-eql/index.js -var require_deep_eql = __commonJS({ - "node_modules/deep-eql/index.js"(exports, module) { - "use strict"; - var type = require_type_detect(); - function FakeMap() { - this._key = "chai/deep-eql__" + Math.random() + Date.now(); - } - FakeMap.prototype = { - get: function get(key) { - return key[this._key]; - }, - set: function set(key, value) { - if (Object.isExtensible(key)) { - Object.defineProperty(key, this._key, { - value, - configurable: true - }); - } - } - }; - var MemoizeMap = typeof WeakMap === "function" ? WeakMap : FakeMap; - function memoizeCompare(leftHandOperand, rightHandOperand, memoizeMap) { - if (!memoizeMap || isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) { - return null; - } - var leftHandMap = memoizeMap.get(leftHandOperand); - if (leftHandMap) { - var result = leftHandMap.get(rightHandOperand); - if (typeof result === "boolean") { - return result; - } - } - return null; - } - function memoizeSet(leftHandOperand, rightHandOperand, memoizeMap, result) { - if (!memoizeMap || isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) { - return; - } - var leftHandMap = memoizeMap.get(leftHandOperand); - if (leftHandMap) { - leftHandMap.set(rightHandOperand, result); - } else { - leftHandMap = new MemoizeMap(); - leftHandMap.set(rightHandOperand, result); - memoizeMap.set(leftHandOperand, leftHandMap); - } - } - module.exports = deepEqual; - module.exports.MemoizeMap = MemoizeMap; - function deepEqual(leftHandOperand, rightHandOperand, options) { - if (options && options.comparator) { - return extensiveDeepEqual(leftHandOperand, rightHandOperand, options); - } - var simpleResult = simpleEqual(leftHandOperand, rightHandOperand); - if (simpleResult !== null) { - return simpleResult; - } - return extensiveDeepEqual(leftHandOperand, rightHandOperand, options); - } - function simpleEqual(leftHandOperand, rightHandOperand) { - if (leftHandOperand === rightHandOperand) { - return leftHandOperand !== 0 || 1 / leftHandOperand === 1 / rightHandOperand; - } - if (leftHandOperand !== leftHandOperand && // eslint-disable-line no-self-compare - rightHandOperand !== rightHandOperand) { - return true; - } - if (isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) { - return false; - } - return null; - } - function extensiveDeepEqual(leftHandOperand, rightHandOperand, options) { - options = options || {}; - options.memoize = options.memoize === false ? false : options.memoize || new MemoizeMap(); - var comparator = options && options.comparator; - var memoizeResultLeft = memoizeCompare(leftHandOperand, rightHandOperand, options.memoize); - if (memoizeResultLeft !== null) { - return memoizeResultLeft; - } - var memoizeResultRight = memoizeCompare(rightHandOperand, leftHandOperand, options.memoize); - if (memoizeResultRight !== null) { - return memoizeResultRight; - } - if (comparator) { - var comparatorResult = comparator(leftHandOperand, rightHandOperand); - if (comparatorResult === false || comparatorResult === true) { - memoizeSet(leftHandOperand, rightHandOperand, options.memoize, comparatorResult); - return comparatorResult; - } - var simpleResult = simpleEqual(leftHandOperand, rightHandOperand); - if (simpleResult !== null) { - return simpleResult; - } - } - var leftHandType = type(leftHandOperand); - if (leftHandType !== type(rightHandOperand)) { - memoizeSet(leftHandOperand, rightHandOperand, options.memoize, false); - return false; - } - memoizeSet(leftHandOperand, rightHandOperand, options.memoize, true); - var result = extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandType, options); - memoizeSet(leftHandOperand, rightHandOperand, options.memoize, result); - return result; - } - function extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandType, options) { - switch (leftHandType) { - case "String": - case "Number": - case "Boolean": - case "Date": - return deepEqual(leftHandOperand.valueOf(), rightHandOperand.valueOf()); - case "Promise": - case "Symbol": - case "function": - case "WeakMap": - case "WeakSet": - return leftHandOperand === rightHandOperand; - case "Error": - return keysEqual(leftHandOperand, rightHandOperand, ["name", "message", "code"], options); - case "Arguments": - case "Int8Array": - case "Uint8Array": - case "Uint8ClampedArray": - case "Int16Array": - case "Uint16Array": - case "Int32Array": - case "Uint32Array": - case "Float32Array": - case "Float64Array": - case "Array": - return iterableEqual(leftHandOperand, rightHandOperand, options); - case "RegExp": - return regexpEqual(leftHandOperand, rightHandOperand); - case "Generator": - return generatorEqual(leftHandOperand, rightHandOperand, options); - case "DataView": - return iterableEqual(new Uint8Array(leftHandOperand.buffer), new Uint8Array(rightHandOperand.buffer), options); - case "ArrayBuffer": - return iterableEqual(new Uint8Array(leftHandOperand), new Uint8Array(rightHandOperand), options); - case "Set": - return entriesEqual(leftHandOperand, rightHandOperand, options); - case "Map": - return entriesEqual(leftHandOperand, rightHandOperand, options); - case "Temporal.PlainDate": - case "Temporal.PlainTime": - case "Temporal.PlainDateTime": - case "Temporal.Instant": - case "Temporal.ZonedDateTime": - case "Temporal.PlainYearMonth": - case "Temporal.PlainMonthDay": - return leftHandOperand.equals(rightHandOperand); - case "Temporal.Duration": - return leftHandOperand.total("nanoseconds") === rightHandOperand.total("nanoseconds"); - case "Temporal.TimeZone": - case "Temporal.Calendar": - return leftHandOperand.toString() === rightHandOperand.toString(); - default: - return objectEqual(leftHandOperand, rightHandOperand, options); - } - } - function regexpEqual(leftHandOperand, rightHandOperand) { - return leftHandOperand.toString() === rightHandOperand.toString(); - } - function entriesEqual(leftHandOperand, rightHandOperand, options) { - if (leftHandOperand.size !== rightHandOperand.size) { - return false; - } - if (leftHandOperand.size === 0) { - return true; - } - var leftHandItems = []; - var rightHandItems = []; - leftHandOperand.forEach(function gatherEntries(key, value) { - leftHandItems.push([key, value]); - }); - rightHandOperand.forEach(function gatherEntries(key, value) { - rightHandItems.push([key, value]); - }); - return iterableEqual(leftHandItems.sort(), rightHandItems.sort(), options); - } - function iterableEqual(leftHandOperand, rightHandOperand, options) { - var length = leftHandOperand.length; - if (length !== rightHandOperand.length) { - return false; - } - if (length === 0) { - return true; - } - var index = -1; - while (++index < length) { - if (deepEqual(leftHandOperand[index], rightHandOperand[index], options) === false) { - return false; - } - } - return true; - } - function generatorEqual(leftHandOperand, rightHandOperand, options) { - return iterableEqual(getGeneratorEntries(leftHandOperand), getGeneratorEntries(rightHandOperand), options); - } - function hasIteratorFunction(target) { - return typeof Symbol !== "undefined" && typeof target === "object" && typeof Symbol.iterator !== "undefined" && typeof target[Symbol.iterator] === "function"; - } - function getIteratorEntries(target) { - if (hasIteratorFunction(target)) { - try { - return getGeneratorEntries(target[Symbol.iterator]()); - } catch (iteratorError) { - return []; - } - } - return []; - } - function getGeneratorEntries(generator) { - var generatorResult = generator.next(); - var accumulator = [generatorResult.value]; - while (generatorResult.done === false) { - generatorResult = generator.next(); - accumulator.push(generatorResult.value); - } - return accumulator; - } - function getEnumerableKeys(target) { - var keys = []; - for (var key in target) { - keys.push(key); - } - return keys; - } - function getEnumerableSymbols(target) { - var keys = []; - var allKeys = Object.getOwnPropertySymbols(target); - for (var i = 0; i < allKeys.length; i += 1) { - var key = allKeys[i]; - if (Object.getOwnPropertyDescriptor(target, key).enumerable) { - keys.push(key); - } - } - return keys; - } - function keysEqual(leftHandOperand, rightHandOperand, keys, options) { - var length = keys.length; - if (length === 0) { - return true; - } - for (var i = 0; i < length; i += 1) { - if (deepEqual(leftHandOperand[keys[i]], rightHandOperand[keys[i]], options) === false) { - return false; - } - } - return true; - } - function objectEqual(leftHandOperand, rightHandOperand, options) { - var leftHandKeys = getEnumerableKeys(leftHandOperand); - var rightHandKeys = getEnumerableKeys(rightHandOperand); - var leftHandSymbols = getEnumerableSymbols(leftHandOperand); - var rightHandSymbols = getEnumerableSymbols(rightHandOperand); - leftHandKeys = leftHandKeys.concat(leftHandSymbols); - rightHandKeys = rightHandKeys.concat(rightHandSymbols); - if (leftHandKeys.length && leftHandKeys.length === rightHandKeys.length) { - if (iterableEqual(mapSymbols(leftHandKeys).sort(), mapSymbols(rightHandKeys).sort()) === false) { - return false; - } - return keysEqual(leftHandOperand, rightHandOperand, leftHandKeys, options); - } - var leftHandEntries = getIteratorEntries(leftHandOperand); - var rightHandEntries = getIteratorEntries(rightHandOperand); - if (leftHandEntries.length && leftHandEntries.length === rightHandEntries.length) { - leftHandEntries.sort(); - rightHandEntries.sort(); - return iterableEqual(leftHandEntries, rightHandEntries, options); - } - if (leftHandKeys.length === 0 && leftHandEntries.length === 0 && rightHandKeys.length === 0 && rightHandEntries.length === 0) { - return true; - } - return false; - } - function isPrimitive(value) { - return value === null || typeof value !== "object"; - } - function mapSymbols(arr) { - return arr.map(function mapSymbol(entry) { - if (typeof entry === "symbol") { - return entry.toString(); - } - return entry; - }); - } - } -}); - -// node_modules/chai/lib/chai/utils/isProxyEnabled.js -var require_isProxyEnabled = __commonJS({ - "node_modules/chai/lib/chai/utils/isProxyEnabled.js"(exports, module) { - var config2 = require_config(); - module.exports = function isProxyEnabled() { - return config2.useProxy && typeof Proxy !== "undefined" && typeof Reflect !== "undefined"; - }; - } -}); - -// node_modules/chai/lib/chai/utils/addProperty.js -var require_addProperty = __commonJS({ - "node_modules/chai/lib/chai/utils/addProperty.js"(exports, module) { - var chai2 = require_chai(); - var flag = require_flag(); - var isProxyEnabled = require_isProxyEnabled(); - var transferFlags = require_transferFlags(); - module.exports = function addProperty(ctx, name, getter) { - getter = getter === void 0 ? function() { - } : getter; - Object.defineProperty( - ctx, - name, - { - get: function propertyGetter() { - if (!isProxyEnabled() && !flag(this, "lockSsfi")) { - flag(this, "ssfi", propertyGetter); - } - var result = getter.call(this); - if (result !== void 0) - return result; - var newAssertion = new chai2.Assertion(); - transferFlags(this, newAssertion); - return newAssertion; - }, - configurable: true - } - ); - }; - } -}); - -// node_modules/chai/lib/chai/utils/addLengthGuard.js -var require_addLengthGuard = __commonJS({ - "node_modules/chai/lib/chai/utils/addLengthGuard.js"(exports, module) { - var fnLengthDesc = Object.getOwnPropertyDescriptor(function() { - }, "length"); - module.exports = function addLengthGuard(fn, assertionName, isChainable) { - if (!fnLengthDesc.configurable) - return fn; - Object.defineProperty(fn, "length", { - get: function() { - if (isChainable) { - throw Error("Invalid Chai property: " + assertionName + '.length. Due to a compatibility issue, "length" cannot directly follow "' + assertionName + '". Use "' + assertionName + '.lengthOf" instead.'); - } - throw Error("Invalid Chai property: " + assertionName + '.length. See docs for proper usage of "' + assertionName + '".'); - } - }); - return fn; - }; - } -}); - -// node_modules/chai/lib/chai/utils/getProperties.js -var require_getProperties = __commonJS({ - "node_modules/chai/lib/chai/utils/getProperties.js"(exports, module) { - module.exports = function getProperties(object) { - var result = Object.getOwnPropertyNames(object); - function addProperty(property) { - if (result.indexOf(property) === -1) { - result.push(property); - } - } - var proto = Object.getPrototypeOf(object); - while (proto !== null) { - Object.getOwnPropertyNames(proto).forEach(addProperty); - proto = Object.getPrototypeOf(proto); - } - return result; - }; - } -}); - -// node_modules/chai/lib/chai/utils/proxify.js -var require_proxify = __commonJS({ - "node_modules/chai/lib/chai/utils/proxify.js"(exports, module) { - var config2 = require_config(); - var flag = require_flag(); - var getProperties = require_getProperties(); - var isProxyEnabled = require_isProxyEnabled(); - var builtins = ["__flags", "__methods", "_obj", "assert"]; - module.exports = function proxify(obj, nonChainableMethodName) { - if (!isProxyEnabled()) - return obj; - return new Proxy(obj, { - get: function proxyGetter(target, property) { - if (typeof property === "string" && config2.proxyExcludedKeys.indexOf(property) === -1 && !Reflect.has(target, property)) { - if (nonChainableMethodName) { - throw Error("Invalid Chai property: " + nonChainableMethodName + "." + property + '. See docs for proper usage of "' + nonChainableMethodName + '".'); - } - var suggestion = null; - var suggestionDistance = 4; - getProperties(target).forEach(function(prop) { - if (!Object.prototype.hasOwnProperty(prop) && builtins.indexOf(prop) === -1) { - var dist = stringDistanceCapped( - property, - prop, - suggestionDistance - ); - if (dist < suggestionDistance) { - suggestion = prop; - suggestionDistance = dist; - } - } - }); - if (suggestion !== null) { - throw Error("Invalid Chai property: " + property + '. Did you mean "' + suggestion + '"?'); - } else { - throw Error("Invalid Chai property: " + property); - } - } - if (builtins.indexOf(property) === -1 && !flag(target, "lockSsfi")) { - flag(target, "ssfi", proxyGetter); - } - return Reflect.get(target, property); - } - }); - }; - function stringDistanceCapped(strA, strB, cap) { - if (Math.abs(strA.length - strB.length) >= cap) { - return cap; - } - var memo = []; - for (var i = 0; i <= strA.length; i++) { - memo[i] = Array(strB.length + 1).fill(0); - memo[i][0] = i; - } - for (var j = 0; j < strB.length; j++) { - memo[0][j] = j; - } - for (var i = 1; i <= strA.length; i++) { - var ch = strA.charCodeAt(i - 1); - for (var j = 1; j <= strB.length; j++) { - if (Math.abs(i - j) >= cap) { - memo[i][j] = cap; - continue; - } - memo[i][j] = Math.min( - memo[i - 1][j] + 1, - memo[i][j - 1] + 1, - memo[i - 1][j - 1] + (ch === strB.charCodeAt(j - 1) ? 0 : 1) - ); - } - } - return memo[strA.length][strB.length]; - } - } -}); - -// node_modules/chai/lib/chai/utils/addMethod.js -var require_addMethod = __commonJS({ - "node_modules/chai/lib/chai/utils/addMethod.js"(exports, module) { - var addLengthGuard = require_addLengthGuard(); - var chai2 = require_chai(); - var flag = require_flag(); - var proxify = require_proxify(); - var transferFlags = require_transferFlags(); - module.exports = function addMethod(ctx, name, method) { - var methodWrapper = function() { - if (!flag(this, "lockSsfi")) { - flag(this, "ssfi", methodWrapper); - } - var result = method.apply(this, arguments); - if (result !== void 0) - return result; - var newAssertion = new chai2.Assertion(); - transferFlags(this, newAssertion); - return newAssertion; - }; - addLengthGuard(methodWrapper, name, false); - ctx[name] = proxify(methodWrapper, name); - }; - } -}); - -// node_modules/chai/lib/chai/utils/overwriteProperty.js -var require_overwriteProperty = __commonJS({ - "node_modules/chai/lib/chai/utils/overwriteProperty.js"(exports, module) { - var chai2 = require_chai(); - var flag = require_flag(); - var isProxyEnabled = require_isProxyEnabled(); - var transferFlags = require_transferFlags(); - module.exports = function overwriteProperty(ctx, name, getter) { - var _get = Object.getOwnPropertyDescriptor(ctx, name), _super = function() { - }; - if (_get && "function" === typeof _get.get) - _super = _get.get; - Object.defineProperty( - ctx, - name, - { - get: function overwritingPropertyGetter() { - if (!isProxyEnabled() && !flag(this, "lockSsfi")) { - flag(this, "ssfi", overwritingPropertyGetter); - } - var origLockSsfi = flag(this, "lockSsfi"); - flag(this, "lockSsfi", true); - var result = getter(_super).call(this); - flag(this, "lockSsfi", origLockSsfi); - if (result !== void 0) { - return result; - } - var newAssertion = new chai2.Assertion(); - transferFlags(this, newAssertion); - return newAssertion; - }, - configurable: true - } - ); - }; - } -}); - -// node_modules/chai/lib/chai/utils/overwriteMethod.js -var require_overwriteMethod = __commonJS({ - "node_modules/chai/lib/chai/utils/overwriteMethod.js"(exports, module) { - var addLengthGuard = require_addLengthGuard(); - var chai2 = require_chai(); - var flag = require_flag(); - var proxify = require_proxify(); - var transferFlags = require_transferFlags(); - module.exports = function overwriteMethod(ctx, name, method) { - var _method = ctx[name], _super = function() { - throw new Error(name + " is not a function"); - }; - if (_method && "function" === typeof _method) - _super = _method; - var overwritingMethodWrapper = function() { - if (!flag(this, "lockSsfi")) { - flag(this, "ssfi", overwritingMethodWrapper); - } - var origLockSsfi = flag(this, "lockSsfi"); - flag(this, "lockSsfi", true); - var result = method(_super).apply(this, arguments); - flag(this, "lockSsfi", origLockSsfi); - if (result !== void 0) { - return result; - } - var newAssertion = new chai2.Assertion(); - transferFlags(this, newAssertion); - return newAssertion; - }; - addLengthGuard(overwritingMethodWrapper, name, false); - ctx[name] = proxify(overwritingMethodWrapper, name); - }; - } -}); - -// node_modules/chai/lib/chai/utils/addChainableMethod.js -var require_addChainableMethod = __commonJS({ - "node_modules/chai/lib/chai/utils/addChainableMethod.js"(exports, module) { - var addLengthGuard = require_addLengthGuard(); - var chai2 = require_chai(); - var flag = require_flag(); - var proxify = require_proxify(); - var transferFlags = require_transferFlags(); - var canSetPrototype = typeof Object.setPrototypeOf === "function"; - var testFn = function() { - }; - var excludeNames = Object.getOwnPropertyNames(testFn).filter(function(name) { - var propDesc = Object.getOwnPropertyDescriptor(testFn, name); - if (typeof propDesc !== "object") - return true; - return !propDesc.configurable; - }); - var call = Function.prototype.call; - var apply = Function.prototype.apply; - module.exports = function addChainableMethod(ctx, name, method, chainingBehavior) { - if (typeof chainingBehavior !== "function") { - chainingBehavior = function() { - }; - } - var chainableBehavior = { - method, - chainingBehavior - }; - if (!ctx.__methods) { - ctx.__methods = {}; - } - ctx.__methods[name] = chainableBehavior; - Object.defineProperty( - ctx, - name, - { - get: function chainableMethodGetter() { - chainableBehavior.chainingBehavior.call(this); - var chainableMethodWrapper = function() { - if (!flag(this, "lockSsfi")) { - flag(this, "ssfi", chainableMethodWrapper); - } - var result = chainableBehavior.method.apply(this, arguments); - if (result !== void 0) { - return result; - } - var newAssertion = new chai2.Assertion(); - transferFlags(this, newAssertion); - return newAssertion; - }; - addLengthGuard(chainableMethodWrapper, name, true); - if (canSetPrototype) { - var prototype = Object.create(this); - prototype.call = call; - prototype.apply = apply; - Object.setPrototypeOf(chainableMethodWrapper, prototype); - } else { - var asserterNames = Object.getOwnPropertyNames(ctx); - asserterNames.forEach(function(asserterName) { - if (excludeNames.indexOf(asserterName) !== -1) { - return; - } - var pd = Object.getOwnPropertyDescriptor(ctx, asserterName); - Object.defineProperty(chainableMethodWrapper, asserterName, pd); - }); - } - transferFlags(this, chainableMethodWrapper); - return proxify(chainableMethodWrapper); - }, - configurable: true - } - ); - }; - } -}); - -// node_modules/chai/lib/chai/utils/overwriteChainableMethod.js -var require_overwriteChainableMethod = __commonJS({ - "node_modules/chai/lib/chai/utils/overwriteChainableMethod.js"(exports, module) { - var chai2 = require_chai(); - var transferFlags = require_transferFlags(); - module.exports = function overwriteChainableMethod(ctx, name, method, chainingBehavior) { - var chainableBehavior = ctx.__methods[name]; - var _chainingBehavior = chainableBehavior.chainingBehavior; - chainableBehavior.chainingBehavior = function overwritingChainableMethodGetter() { - var result = chainingBehavior(_chainingBehavior).call(this); - if (result !== void 0) { - return result; - } - var newAssertion = new chai2.Assertion(); - transferFlags(this, newAssertion); - return newAssertion; - }; - var _method = chainableBehavior.method; - chainableBehavior.method = function overwritingChainableMethodWrapper() { - var result = method(_method).apply(this, arguments); - if (result !== void 0) { - return result; - } - var newAssertion = new chai2.Assertion(); - transferFlags(this, newAssertion); - return newAssertion; - }; - }; - } -}); - -// node_modules/chai/lib/chai/utils/compareByInspect.js -var require_compareByInspect = __commonJS({ - "node_modules/chai/lib/chai/utils/compareByInspect.js"(exports, module) { - var inspect = require_inspect(); - module.exports = function compareByInspect(a, b) { - return inspect(a) < inspect(b) ? -1 : 1; - }; - } -}); - -// node_modules/chai/lib/chai/utils/getOwnEnumerablePropertySymbols.js -var require_getOwnEnumerablePropertySymbols = __commonJS({ - "node_modules/chai/lib/chai/utils/getOwnEnumerablePropertySymbols.js"(exports, module) { - module.exports = function getOwnEnumerablePropertySymbols(obj) { - if (typeof Object.getOwnPropertySymbols !== "function") - return []; - return Object.getOwnPropertySymbols(obj).filter(function(sym) { - return Object.getOwnPropertyDescriptor(obj, sym).enumerable; - }); - }; - } -}); - -// node_modules/chai/lib/chai/utils/getOwnEnumerableProperties.js -var require_getOwnEnumerableProperties = __commonJS({ - "node_modules/chai/lib/chai/utils/getOwnEnumerableProperties.js"(exports, module) { - var getOwnEnumerablePropertySymbols = require_getOwnEnumerablePropertySymbols(); - module.exports = function getOwnEnumerableProperties(obj) { - return Object.keys(obj).concat(getOwnEnumerablePropertySymbols(obj)); - }; - } -}); - -// node_modules/check-error/index.js -var require_check_error = __commonJS({ - "node_modules/check-error/index.js"(exports, module) { - "use strict"; - var getFunctionName = require_get_func_name(); - function compatibleInstance(thrown, errorLike) { - return errorLike instanceof Error && thrown === errorLike; - } - function compatibleConstructor(thrown, errorLike) { - if (errorLike instanceof Error) { - return thrown.constructor === errorLike.constructor || thrown instanceof errorLike.constructor; - } else if (errorLike.prototype instanceof Error || errorLike === Error) { - return thrown.constructor === errorLike || thrown instanceof errorLike; - } - return false; - } - function compatibleMessage(thrown, errMatcher) { - var comparisonString = typeof thrown === "string" ? thrown : thrown.message; - if (errMatcher instanceof RegExp) { - return errMatcher.test(comparisonString); - } else if (typeof errMatcher === "string") { - return comparisonString.indexOf(errMatcher) !== -1; - } - return false; - } - function getConstructorName(errorLike) { - var constructorName = errorLike; - if (errorLike instanceof Error) { - constructorName = getFunctionName(errorLike.constructor); - } else if (typeof errorLike === "function") { - constructorName = getFunctionName(errorLike); - if (constructorName === "") { - var newConstructorName = getFunctionName(new errorLike()); - constructorName = newConstructorName || constructorName; - } - } - return constructorName; - } - function getMessage(errorLike) { - var msg = ""; - if (errorLike && errorLike.message) { - msg = errorLike.message; - } else if (typeof errorLike === "string") { - msg = errorLike; - } - return msg; - } - module.exports = { - compatibleInstance, - compatibleConstructor, - compatibleMessage, - getMessage, - getConstructorName - }; - } -}); - -// node_modules/chai/lib/chai/utils/isNaN.js -var require_isNaN = __commonJS({ - "node_modules/chai/lib/chai/utils/isNaN.js"(exports, module) { - function isNaN(value) { - return value !== value; - } - module.exports = Number.isNaN || isNaN; - } -}); - -// node_modules/chai/lib/chai/utils/getOperator.js -var require_getOperator = __commonJS({ - "node_modules/chai/lib/chai/utils/getOperator.js"(exports, module) { - var type = require_type_detect(); - var flag = require_flag(); - function isObjectType(obj) { - var objectType = type(obj); - var objectTypes = ["Array", "Object", "function"]; - return objectTypes.indexOf(objectType) !== -1; - } - module.exports = function getOperator(obj, args) { - var operator = flag(obj, "operator"); - var negate = flag(obj, "negate"); - var expected = args[3]; - var msg = negate ? args[2] : args[1]; - if (operator) { - return operator; - } - if (typeof msg === "function") - msg = msg(); - msg = msg || ""; - if (!msg) { - return void 0; - } - if (/\shave\s/.test(msg)) { - return void 0; - } - var isObject = isObjectType(expected); - if (/\snot\s/.test(msg)) { - return isObject ? "notDeepStrictEqual" : "notStrictEqual"; - } - return isObject ? "deepStrictEqual" : "strictEqual"; - }; - } -}); - -// node_modules/chai/lib/chai/utils/index.js -var require_utils = __commonJS({ - "node_modules/chai/lib/chai/utils/index.js"(exports) { - var pathval = require_pathval(); - exports.test = require_test(); - exports.type = require_type_detect(); - exports.expectTypes = require_expectTypes(); - exports.getMessage = require_getMessage(); - exports.getActual = require_getActual(); - exports.inspect = require_inspect(); - exports.objDisplay = require_objDisplay(); - exports.flag = require_flag(); - exports.transferFlags = require_transferFlags(); - exports.eql = require_deep_eql(); - exports.getPathInfo = pathval.getPathInfo; - exports.hasProperty = pathval.hasProperty; - exports.getName = require_get_func_name(); - exports.addProperty = require_addProperty(); - exports.addMethod = require_addMethod(); - exports.overwriteProperty = require_overwriteProperty(); - exports.overwriteMethod = require_overwriteMethod(); - exports.addChainableMethod = require_addChainableMethod(); - exports.overwriteChainableMethod = require_overwriteChainableMethod(); - exports.compareByInspect = require_compareByInspect(); - exports.getOwnEnumerablePropertySymbols = require_getOwnEnumerablePropertySymbols(); - exports.getOwnEnumerableProperties = require_getOwnEnumerableProperties(); - exports.checkError = require_check_error(); - exports.proxify = require_proxify(); - exports.addLengthGuard = require_addLengthGuard(); - exports.isProxyEnabled = require_isProxyEnabled(); - exports.isNaN = require_isNaN(); - exports.getOperator = require_getOperator(); - } -}); - -// node_modules/chai/lib/chai/assertion.js -var require_assertion = __commonJS({ - "node_modules/chai/lib/chai/assertion.js"(exports, module) { - var config2 = require_config(); - module.exports = function(_chai, util2) { - var AssertionError2 = _chai.AssertionError, flag = util2.flag; - _chai.Assertion = Assertion2; - function Assertion2(obj, msg, ssfi, lockSsfi) { - flag(this, "ssfi", ssfi || Assertion2); - flag(this, "lockSsfi", lockSsfi); - flag(this, "object", obj); - flag(this, "message", msg); - flag(this, "eql", config2.deepEqual || util2.eql); - return util2.proxify(this); - } - Object.defineProperty(Assertion2, "includeStack", { - get: function() { - console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."); - return config2.includeStack; - }, - set: function(value) { - console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."); - config2.includeStack = value; - } - }); - Object.defineProperty(Assertion2, "showDiff", { - get: function() { - console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."); - return config2.showDiff; - }, - set: function(value) { - console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."); - config2.showDiff = value; - } - }); - Assertion2.addProperty = function(name, fn) { - util2.addProperty(this.prototype, name, fn); - }; - Assertion2.addMethod = function(name, fn) { - util2.addMethod(this.prototype, name, fn); - }; - Assertion2.addChainableMethod = function(name, fn, chainingBehavior) { - util2.addChainableMethod(this.prototype, name, fn, chainingBehavior); - }; - Assertion2.overwriteProperty = function(name, fn) { - util2.overwriteProperty(this.prototype, name, fn); - }; - Assertion2.overwriteMethod = function(name, fn) { - util2.overwriteMethod(this.prototype, name, fn); - }; - Assertion2.overwriteChainableMethod = function(name, fn, chainingBehavior) { - util2.overwriteChainableMethod(this.prototype, name, fn, chainingBehavior); - }; - Assertion2.prototype.assert = function(expr, msg, negateMsg, expected, _actual, showDiff) { - var ok = util2.test(this, arguments); - if (false !== showDiff) - showDiff = true; - if (void 0 === expected && void 0 === _actual) - showDiff = false; - if (true !== config2.showDiff) - showDiff = false; - if (!ok) { - msg = util2.getMessage(this, arguments); - var actual = util2.getActual(this, arguments); - var assertionErrorObjectProperties = { - actual, - expected, - showDiff - }; - var operator = util2.getOperator(this, arguments); - if (operator) { - assertionErrorObjectProperties.operator = operator; - } - throw new AssertionError2( - msg, - assertionErrorObjectProperties, - config2.includeStack ? this.assert : flag(this, "ssfi") - ); - } - }; - Object.defineProperty( - Assertion2.prototype, - "_obj", - { - get: function() { - return flag(this, "object"); - }, - set: function(val) { - flag(this, "object", val); - } - } - ); - }; - } -}); - -// node_modules/chai/lib/chai/core/assertions.js -var require_assertions = __commonJS({ - "node_modules/chai/lib/chai/core/assertions.js"(exports, module) { - module.exports = function(chai2, _) { - var Assertion2 = chai2.Assertion, AssertionError2 = chai2.AssertionError, flag = _.flag; - [ - "to", - "be", - "been", - "is", - "and", - "has", - "have", - "with", - "that", - "which", - "at", - "of", - "same", - "but", - "does", - "still", - "also" - ].forEach(function(chain) { - Assertion2.addProperty(chain); - }); - Assertion2.addProperty("not", function() { - flag(this, "negate", true); - }); - Assertion2.addProperty("deep", function() { - flag(this, "deep", true); - }); - Assertion2.addProperty("nested", function() { - flag(this, "nested", true); - }); - Assertion2.addProperty("own", function() { - flag(this, "own", true); - }); - Assertion2.addProperty("ordered", function() { - flag(this, "ordered", true); - }); - Assertion2.addProperty("any", function() { - flag(this, "any", true); - flag(this, "all", false); - }); - Assertion2.addProperty("all", function() { - flag(this, "all", true); - flag(this, "any", false); - }); - function an(type, msg) { - if (msg) - flag(this, "message", msg); - type = type.toLowerCase(); - var obj = flag(this, "object"), article = ~["a", "e", "i", "o", "u"].indexOf(type.charAt(0)) ? "an " : "a "; - this.assert( - type === _.type(obj).toLowerCase(), - "expected #{this} to be " + article + type, - "expected #{this} not to be " + article + type - ); - } - Assertion2.addChainableMethod("an", an); - Assertion2.addChainableMethod("a", an); - function SameValueZero(a, b) { - return _.isNaN(a) && _.isNaN(b) || a === b; - } - function includeChainingBehavior() { - flag(this, "contains", true); - } - function include(val, msg) { - if (msg) - flag(this, "message", msg); - var obj = flag(this, "object"), objType = _.type(obj).toLowerCase(), flagMsg = flag(this, "message"), negate = flag(this, "negate"), ssfi = flag(this, "ssfi"), isDeep = flag(this, "deep"), descriptor = isDeep ? "deep " : "", isEql = isDeep ? flag(this, "eql") : SameValueZero; - flagMsg = flagMsg ? flagMsg + ": " : ""; - var included = false; - switch (objType) { - case "string": - included = obj.indexOf(val) !== -1; - break; - case "weakset": - if (isDeep) { - throw new AssertionError2( - flagMsg + "unable to use .deep.include with WeakSet", - void 0, - ssfi - ); - } - included = obj.has(val); - break; - case "map": - obj.forEach(function(item) { - included = included || isEql(item, val); - }); - break; - case "set": - if (isDeep) { - obj.forEach(function(item) { - included = included || isEql(item, val); - }); - } else { - included = obj.has(val); - } - break; - case "array": - if (isDeep) { - included = obj.some(function(item) { - return isEql(item, val); - }); - } else { - included = obj.indexOf(val) !== -1; - } - break; - default: - if (val !== Object(val)) { - throw new AssertionError2( - flagMsg + "the given combination of arguments (" + objType + " and " + _.type(val).toLowerCase() + ") is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a " + _.type(val).toLowerCase(), - void 0, - ssfi - ); - } - var props = Object.keys(val), firstErr = null, numErrs = 0; - props.forEach(function(prop) { - var propAssertion = new Assertion2(obj); - _.transferFlags(this, propAssertion, true); - flag(propAssertion, "lockSsfi", true); - if (!negate || props.length === 1) { - propAssertion.property(prop, val[prop]); - return; - } - try { - propAssertion.property(prop, val[prop]); - } catch (err) { - if (!_.checkError.compatibleConstructor(err, AssertionError2)) { - throw err; - } - if (firstErr === null) - firstErr = err; - numErrs++; - } - }, this); - if (negate && props.length > 1 && numErrs === props.length) { - throw firstErr; - } - return; - } - this.assert( - included, - "expected #{this} to " + descriptor + "include " + _.inspect(val), - "expected #{this} to not " + descriptor + "include " + _.inspect(val) - ); - } - Assertion2.addChainableMethod("include", include, includeChainingBehavior); - Assertion2.addChainableMethod("contain", include, includeChainingBehavior); - Assertion2.addChainableMethod("contains", include, includeChainingBehavior); - Assertion2.addChainableMethod("includes", include, includeChainingBehavior); - Assertion2.addProperty("ok", function() { - this.assert( - flag(this, "object"), - "expected #{this} to be truthy", - "expected #{this} to be falsy" - ); - }); - Assertion2.addProperty("true", function() { - this.assert( - true === flag(this, "object"), - "expected #{this} to be true", - "expected #{this} to be false", - flag(this, "negate") ? false : true - ); - }); - Assertion2.addProperty("false", function() { - this.assert( - false === flag(this, "object"), - "expected #{this} to be false", - "expected #{this} to be true", - flag(this, "negate") ? true : false - ); - }); - Assertion2.addProperty("null", function() { - this.assert( - null === flag(this, "object"), - "expected #{this} to be null", - "expected #{this} not to be null" - ); - }); - Assertion2.addProperty("undefined", function() { - this.assert( - void 0 === flag(this, "object"), - "expected #{this} to be undefined", - "expected #{this} not to be undefined" - ); - }); - Assertion2.addProperty("NaN", function() { - this.assert( - _.isNaN(flag(this, "object")), - "expected #{this} to be NaN", - "expected #{this} not to be NaN" - ); - }); - function assertExist() { - var val = flag(this, "object"); - this.assert( - val !== null && val !== void 0, - "expected #{this} to exist", - "expected #{this} to not exist" - ); - } - Assertion2.addProperty("exist", assertExist); - Assertion2.addProperty("exists", assertExist); - Assertion2.addProperty("empty", function() { - var val = flag(this, "object"), ssfi = flag(this, "ssfi"), flagMsg = flag(this, "message"), itemsCount; - flagMsg = flagMsg ? flagMsg + ": " : ""; - switch (_.type(val).toLowerCase()) { - case "array": - case "string": - itemsCount = val.length; - break; - case "map": - case "set": - itemsCount = val.size; - break; - case "weakmap": - case "weakset": - throw new AssertionError2( - flagMsg + ".empty was passed a weak collection", - void 0, - ssfi - ); - case "function": - var msg = flagMsg + ".empty was passed a function " + _.getName(val); - throw new AssertionError2(msg.trim(), void 0, ssfi); - default: - if (val !== Object(val)) { - throw new AssertionError2( - flagMsg + ".empty was passed non-string primitive " + _.inspect(val), - void 0, - ssfi - ); - } - itemsCount = Object.keys(val).length; - } - this.assert( - 0 === itemsCount, - "expected #{this} to be empty", - "expected #{this} not to be empty" - ); - }); - function checkArguments() { - var obj = flag(this, "object"), type = _.type(obj); - this.assert( - "Arguments" === type, - "expected #{this} to be arguments but got " + type, - "expected #{this} to not be arguments" - ); - } - Assertion2.addProperty("arguments", checkArguments); - Assertion2.addProperty("Arguments", checkArguments); - function assertEqual(val, msg) { - if (msg) - flag(this, "message", msg); - var obj = flag(this, "object"); - if (flag(this, "deep")) { - var prevLockSsfi = flag(this, "lockSsfi"); - flag(this, "lockSsfi", true); - this.eql(val); - flag(this, "lockSsfi", prevLockSsfi); - } else { - this.assert( - val === obj, - "expected #{this} to equal #{exp}", - "expected #{this} to not equal #{exp}", - val, - this._obj, - true - ); - } - } - Assertion2.addMethod("equal", assertEqual); - Assertion2.addMethod("equals", assertEqual); - Assertion2.addMethod("eq", assertEqual); - function assertEql(obj, msg) { - if (msg) - flag(this, "message", msg); - var eql = flag(this, "eql"); - this.assert( - eql(obj, flag(this, "object")), - "expected #{this} to deeply equal #{exp}", - "expected #{this} to not deeply equal #{exp}", - obj, - this._obj, - true - ); - } - Assertion2.addMethod("eql", assertEql); - Assertion2.addMethod("eqls", assertEql); - function assertAbove(n, msg) { - if (msg) - flag(this, "message", msg); - var obj = flag(this, "object"), doLength = flag(this, "doLength"), flagMsg = flag(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag(this, "ssfi"), objType = _.type(obj).toLowerCase(), nType = _.type(n).toLowerCase(), errorMessage, shouldThrow = true; - if (doLength && objType !== "map" && objType !== "set") { - new Assertion2(obj, flagMsg, ssfi, true).to.have.property("length"); - } - if (!doLength && (objType === "date" && nType !== "date")) { - errorMessage = msgPrefix + "the argument to above must be a date"; - } else if (nType !== "number" && (doLength || objType === "number")) { - errorMessage = msgPrefix + "the argument to above must be a number"; - } else if (!doLength && (objType !== "date" && objType !== "number")) { - var printObj = objType === "string" ? "'" + obj + "'" : obj; - errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date"; - } else { - shouldThrow = false; - } - if (shouldThrow) { - throw new AssertionError2(errorMessage, void 0, ssfi); - } - if (doLength) { - var descriptor = "length", itemsCount; - if (objType === "map" || objType === "set") { - descriptor = "size"; - itemsCount = obj.size; - } else { - itemsCount = obj.length; - } - this.assert( - itemsCount > n, - "expected #{this} to have a " + descriptor + " above #{exp} but got #{act}", - "expected #{this} to not have a " + descriptor + " above #{exp}", - n, - itemsCount - ); - } else { - this.assert( - obj > n, - "expected #{this} to be above #{exp}", - "expected #{this} to be at most #{exp}", - n - ); - } - } - Assertion2.addMethod("above", assertAbove); - Assertion2.addMethod("gt", assertAbove); - Assertion2.addMethod("greaterThan", assertAbove); - function assertLeast(n, msg) { - if (msg) - flag(this, "message", msg); - var obj = flag(this, "object"), doLength = flag(this, "doLength"), flagMsg = flag(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag(this, "ssfi"), objType = _.type(obj).toLowerCase(), nType = _.type(n).toLowerCase(), errorMessage, shouldThrow = true; - if (doLength && objType !== "map" && objType !== "set") { - new Assertion2(obj, flagMsg, ssfi, true).to.have.property("length"); - } - if (!doLength && (objType === "date" && nType !== "date")) { - errorMessage = msgPrefix + "the argument to least must be a date"; - } else if (nType !== "number" && (doLength || objType === "number")) { - errorMessage = msgPrefix + "the argument to least must be a number"; - } else if (!doLength && (objType !== "date" && objType !== "number")) { - var printObj = objType === "string" ? "'" + obj + "'" : obj; - errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date"; - } else { - shouldThrow = false; - } - if (shouldThrow) { - throw new AssertionError2(errorMessage, void 0, ssfi); - } - if (doLength) { - var descriptor = "length", itemsCount; - if (objType === "map" || objType === "set") { - descriptor = "size"; - itemsCount = obj.size; - } else { - itemsCount = obj.length; - } - this.assert( - itemsCount >= n, - "expected #{this} to have a " + descriptor + " at least #{exp} but got #{act}", - "expected #{this} to have a " + descriptor + " below #{exp}", - n, - itemsCount - ); - } else { - this.assert( - obj >= n, - "expected #{this} to be at least #{exp}", - "expected #{this} to be below #{exp}", - n - ); - } - } - Assertion2.addMethod("least", assertLeast); - Assertion2.addMethod("gte", assertLeast); - Assertion2.addMethod("greaterThanOrEqual", assertLeast); - function assertBelow(n, msg) { - if (msg) - flag(this, "message", msg); - var obj = flag(this, "object"), doLength = flag(this, "doLength"), flagMsg = flag(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag(this, "ssfi"), objType = _.type(obj).toLowerCase(), nType = _.type(n).toLowerCase(), errorMessage, shouldThrow = true; - if (doLength && objType !== "map" && objType !== "set") { - new Assertion2(obj, flagMsg, ssfi, true).to.have.property("length"); - } - if (!doLength && (objType === "date" && nType !== "date")) { - errorMessage = msgPrefix + "the argument to below must be a date"; - } else if (nType !== "number" && (doLength || objType === "number")) { - errorMessage = msgPrefix + "the argument to below must be a number"; - } else if (!doLength && (objType !== "date" && objType !== "number")) { - var printObj = objType === "string" ? "'" + obj + "'" : obj; - errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date"; - } else { - shouldThrow = false; - } - if (shouldThrow) { - throw new AssertionError2(errorMessage, void 0, ssfi); - } - if (doLength) { - var descriptor = "length", itemsCount; - if (objType === "map" || objType === "set") { - descriptor = "size"; - itemsCount = obj.size; - } else { - itemsCount = obj.length; - } - this.assert( - itemsCount < n, - "expected #{this} to have a " + descriptor + " below #{exp} but got #{act}", - "expected #{this} to not have a " + descriptor + " below #{exp}", - n, - itemsCount - ); - } else { - this.assert( - obj < n, - "expected #{this} to be below #{exp}", - "expected #{this} to be at least #{exp}", - n - ); - } - } - Assertion2.addMethod("below", assertBelow); - Assertion2.addMethod("lt", assertBelow); - Assertion2.addMethod("lessThan", assertBelow); - function assertMost(n, msg) { - if (msg) - flag(this, "message", msg); - var obj = flag(this, "object"), doLength = flag(this, "doLength"), flagMsg = flag(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag(this, "ssfi"), objType = _.type(obj).toLowerCase(), nType = _.type(n).toLowerCase(), errorMessage, shouldThrow = true; - if (doLength && objType !== "map" && objType !== "set") { - new Assertion2(obj, flagMsg, ssfi, true).to.have.property("length"); - } - if (!doLength && (objType === "date" && nType !== "date")) { - errorMessage = msgPrefix + "the argument to most must be a date"; - } else if (nType !== "number" && (doLength || objType === "number")) { - errorMessage = msgPrefix + "the argument to most must be a number"; - } else if (!doLength && (objType !== "date" && objType !== "number")) { - var printObj = objType === "string" ? "'" + obj + "'" : obj; - errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date"; - } else { - shouldThrow = false; - } - if (shouldThrow) { - throw new AssertionError2(errorMessage, void 0, ssfi); - } - if (doLength) { - var descriptor = "length", itemsCount; - if (objType === "map" || objType === "set") { - descriptor = "size"; - itemsCount = obj.size; - } else { - itemsCount = obj.length; - } - this.assert( - itemsCount <= n, - "expected #{this} to have a " + descriptor + " at most #{exp} but got #{act}", - "expected #{this} to have a " + descriptor + " above #{exp}", - n, - itemsCount - ); - } else { - this.assert( - obj <= n, - "expected #{this} to be at most #{exp}", - "expected #{this} to be above #{exp}", - n - ); - } - } - Assertion2.addMethod("most", assertMost); - Assertion2.addMethod("lte", assertMost); - Assertion2.addMethod("lessThanOrEqual", assertMost); - Assertion2.addMethod("within", function(start, finish, msg) { - if (msg) - flag(this, "message", msg); - var obj = flag(this, "object"), doLength = flag(this, "doLength"), flagMsg = flag(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag(this, "ssfi"), objType = _.type(obj).toLowerCase(), startType = _.type(start).toLowerCase(), finishType = _.type(finish).toLowerCase(), errorMessage, shouldThrow = true, range = startType === "date" && finishType === "date" ? start.toISOString() + ".." + finish.toISOString() : start + ".." + finish; - if (doLength && objType !== "map" && objType !== "set") { - new Assertion2(obj, flagMsg, ssfi, true).to.have.property("length"); - } - if (!doLength && (objType === "date" && (startType !== "date" || finishType !== "date"))) { - errorMessage = msgPrefix + "the arguments to within must be dates"; - } else if ((startType !== "number" || finishType !== "number") && (doLength || objType === "number")) { - errorMessage = msgPrefix + "the arguments to within must be numbers"; - } else if (!doLength && (objType !== "date" && objType !== "number")) { - var printObj = objType === "string" ? "'" + obj + "'" : obj; - errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date"; - } else { - shouldThrow = false; - } - if (shouldThrow) { - throw new AssertionError2(errorMessage, void 0, ssfi); - } - if (doLength) { - var descriptor = "length", itemsCount; - if (objType === "map" || objType === "set") { - descriptor = "size"; - itemsCount = obj.size; - } else { - itemsCount = obj.length; - } - this.assert( - itemsCount >= start && itemsCount <= finish, - "expected #{this} to have a " + descriptor + " within " + range, - "expected #{this} to not have a " + descriptor + " within " + range - ); - } else { - this.assert( - obj >= start && obj <= finish, - "expected #{this} to be within " + range, - "expected #{this} to not be within " + range - ); - } - }); - function assertInstanceOf(constructor, msg) { - if (msg) - flag(this, "message", msg); - var target = flag(this, "object"); - var ssfi = flag(this, "ssfi"); - var flagMsg = flag(this, "message"); - try { - var isInstanceOf = target instanceof constructor; - } catch (err) { - if (err instanceof TypeError) { - flagMsg = flagMsg ? flagMsg + ": " : ""; - throw new AssertionError2( - flagMsg + "The instanceof assertion needs a constructor but " + _.type(constructor) + " was given.", - void 0, - ssfi - ); - } - throw err; - } - var name = _.getName(constructor); - if (name === null) { - name = "an unnamed constructor"; - } - this.assert( - isInstanceOf, - "expected #{this} to be an instance of " + name, - "expected #{this} to not be an instance of " + name - ); - } - ; - Assertion2.addMethod("instanceof", assertInstanceOf); - Assertion2.addMethod("instanceOf", assertInstanceOf); - function assertProperty(name, val, msg) { - if (msg) - flag(this, "message", msg); - var isNested = flag(this, "nested"), isOwn = flag(this, "own"), flagMsg = flag(this, "message"), obj = flag(this, "object"), ssfi = flag(this, "ssfi"), nameType = typeof name; - flagMsg = flagMsg ? flagMsg + ": " : ""; - if (isNested) { - if (nameType !== "string") { - throw new AssertionError2( - flagMsg + "the argument to property must be a string when using nested syntax", - void 0, - ssfi - ); - } - } else { - if (nameType !== "string" && nameType !== "number" && nameType !== "symbol") { - throw new AssertionError2( - flagMsg + "the argument to property must be a string, number, or symbol", - void 0, - ssfi - ); - } - } - if (isNested && isOwn) { - throw new AssertionError2( - flagMsg + 'The "nested" and "own" flags cannot be combined.', - void 0, - ssfi - ); - } - if (obj === null || obj === void 0) { - throw new AssertionError2( - flagMsg + "Target cannot be null or undefined.", - void 0, - ssfi - ); - } - var isDeep = flag(this, "deep"), negate = flag(this, "negate"), pathInfo = isNested ? _.getPathInfo(obj, name) : null, value = isNested ? pathInfo.value : obj[name], isEql = isDeep ? flag(this, "eql") : (val1, val2) => val1 === val2; - ; - var descriptor = ""; - if (isDeep) - descriptor += "deep "; - if (isOwn) - descriptor += "own "; - if (isNested) - descriptor += "nested "; - descriptor += "property "; - var hasProperty; - if (isOwn) - hasProperty = Object.prototype.hasOwnProperty.call(obj, name); - else if (isNested) - hasProperty = pathInfo.exists; - else - hasProperty = _.hasProperty(obj, name); - if (!negate || arguments.length === 1) { - this.assert( - hasProperty, - "expected #{this} to have " + descriptor + _.inspect(name), - "expected #{this} to not have " + descriptor + _.inspect(name) - ); - } - if (arguments.length > 1) { - this.assert( - hasProperty && isEql(val, value), - "expected #{this} to have " + descriptor + _.inspect(name) + " of #{exp}, but got #{act}", - "expected #{this} to not have " + descriptor + _.inspect(name) + " of #{act}", - val, - value - ); - } - flag(this, "object", value); - } - Assertion2.addMethod("property", assertProperty); - function assertOwnProperty(name, value, msg) { - flag(this, "own", true); - assertProperty.apply(this, arguments); - } - Assertion2.addMethod("ownProperty", assertOwnProperty); - Assertion2.addMethod("haveOwnProperty", assertOwnProperty); - function assertOwnPropertyDescriptor(name, descriptor, msg) { - if (typeof descriptor === "string") { - msg = descriptor; - descriptor = null; - } - if (msg) - flag(this, "message", msg); - var obj = flag(this, "object"); - var actualDescriptor = Object.getOwnPropertyDescriptor(Object(obj), name); - var eql = flag(this, "eql"); - if (actualDescriptor && descriptor) { - this.assert( - eql(descriptor, actualDescriptor), - "expected the own property descriptor for " + _.inspect(name) + " on #{this} to match " + _.inspect(descriptor) + ", got " + _.inspect(actualDescriptor), - "expected the own property descriptor for " + _.inspect(name) + " on #{this} to not match " + _.inspect(descriptor), - descriptor, - actualDescriptor, - true - ); - } else { - this.assert( - actualDescriptor, - "expected #{this} to have an own property descriptor for " + _.inspect(name), - "expected #{this} to not have an own property descriptor for " + _.inspect(name) - ); - } - flag(this, "object", actualDescriptor); - } - Assertion2.addMethod("ownPropertyDescriptor", assertOwnPropertyDescriptor); - Assertion2.addMethod("haveOwnPropertyDescriptor", assertOwnPropertyDescriptor); - function assertLengthChain() { - flag(this, "doLength", true); - } - function assertLength(n, msg) { - if (msg) - flag(this, "message", msg); - var obj = flag(this, "object"), objType = _.type(obj).toLowerCase(), flagMsg = flag(this, "message"), ssfi = flag(this, "ssfi"), descriptor = "length", itemsCount; - switch (objType) { - case "map": - case "set": - descriptor = "size"; - itemsCount = obj.size; - break; - default: - new Assertion2(obj, flagMsg, ssfi, true).to.have.property("length"); - itemsCount = obj.length; - } - this.assert( - itemsCount == n, - "expected #{this} to have a " + descriptor + " of #{exp} but got #{act}", - "expected #{this} to not have a " + descriptor + " of #{act}", - n, - itemsCount - ); - } - Assertion2.addChainableMethod("length", assertLength, assertLengthChain); - Assertion2.addChainableMethod("lengthOf", assertLength, assertLengthChain); - function assertMatch(re, msg) { - if (msg) - flag(this, "message", msg); - var obj = flag(this, "object"); - this.assert( - re.exec(obj), - "expected #{this} to match " + re, - "expected #{this} not to match " + re - ); - } - Assertion2.addMethod("match", assertMatch); - Assertion2.addMethod("matches", assertMatch); - Assertion2.addMethod("string", function(str, msg) { - if (msg) - flag(this, "message", msg); - var obj = flag(this, "object"), flagMsg = flag(this, "message"), ssfi = flag(this, "ssfi"); - new Assertion2(obj, flagMsg, ssfi, true).is.a("string"); - this.assert( - ~obj.indexOf(str), - "expected #{this} to contain " + _.inspect(str), - "expected #{this} to not contain " + _.inspect(str) - ); - }); - function assertKeys(keys) { - var obj = flag(this, "object"), objType = _.type(obj), keysType = _.type(keys), ssfi = flag(this, "ssfi"), isDeep = flag(this, "deep"), str, deepStr = "", actual, ok = true, flagMsg = flag(this, "message"); - flagMsg = flagMsg ? flagMsg + ": " : ""; - var mixedArgsMsg = flagMsg + "when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments"; - if (objType === "Map" || objType === "Set") { - deepStr = isDeep ? "deeply " : ""; - actual = []; - obj.forEach(function(val, key) { - actual.push(key); - }); - if (keysType !== "Array") { - keys = Array.prototype.slice.call(arguments); - } - } else { - actual = _.getOwnEnumerableProperties(obj); - switch (keysType) { - case "Array": - if (arguments.length > 1) { - throw new AssertionError2(mixedArgsMsg, void 0, ssfi); - } - break; - case "Object": - if (arguments.length > 1) { - throw new AssertionError2(mixedArgsMsg, void 0, ssfi); - } - keys = Object.keys(keys); - break; - default: - keys = Array.prototype.slice.call(arguments); - } - keys = keys.map(function(val) { - return typeof val === "symbol" ? val : String(val); - }); - } - if (!keys.length) { - throw new AssertionError2(flagMsg + "keys required", void 0, ssfi); - } - var len = keys.length, any = flag(this, "any"), all = flag(this, "all"), expected = keys, isEql = isDeep ? flag(this, "eql") : (val1, val2) => val1 === val2; - if (!any && !all) { - all = true; - } - if (any) { - ok = expected.some(function(expectedKey) { - return actual.some(function(actualKey) { - return isEql(expectedKey, actualKey); - }); - }); - } - if (all) { - ok = expected.every(function(expectedKey) { - return actual.some(function(actualKey) { - return isEql(expectedKey, actualKey); - }); - }); - if (!flag(this, "contains")) { - ok = ok && keys.length == actual.length; - } - } - if (len > 1) { - keys = keys.map(function(key) { - return _.inspect(key); - }); - var last = keys.pop(); - if (all) { - str = keys.join(", ") + ", and " + last; - } - if (any) { - str = keys.join(", ") + ", or " + last; - } - } else { - str = _.inspect(keys[0]); - } - str = (len > 1 ? "keys " : "key ") + str; - str = (flag(this, "contains") ? "contain " : "have ") + str; - this.assert( - ok, - "expected #{this} to " + deepStr + str, - "expected #{this} to not " + deepStr + str, - expected.slice(0).sort(_.compareByInspect), - actual.sort(_.compareByInspect), - true - ); - } - Assertion2.addMethod("keys", assertKeys); - Assertion2.addMethod("key", assertKeys); - function assertThrows(errorLike, errMsgMatcher, msg) { - if (msg) - flag(this, "message", msg); - var obj = flag(this, "object"), ssfi = flag(this, "ssfi"), flagMsg = flag(this, "message"), negate = flag(this, "negate") || false; - new Assertion2(obj, flagMsg, ssfi, true).is.a("function"); - if (errorLike instanceof RegExp || typeof errorLike === "string") { - errMsgMatcher = errorLike; - errorLike = null; - } - var caughtErr; - try { - obj(); - } catch (err) { - caughtErr = err; - } - var everyArgIsUndefined = errorLike === void 0 && errMsgMatcher === void 0; - var everyArgIsDefined = Boolean(errorLike && errMsgMatcher); - var errorLikeFail = false; - var errMsgMatcherFail = false; - if (everyArgIsUndefined || !everyArgIsUndefined && !negate) { - var errorLikeString = "an error"; - if (errorLike instanceof Error) { - errorLikeString = "#{exp}"; - } else if (errorLike) { - errorLikeString = _.checkError.getConstructorName(errorLike); - } - this.assert( - caughtErr, - "expected #{this} to throw " + errorLikeString, - "expected #{this} to not throw an error but #{act} was thrown", - errorLike && errorLike.toString(), - caughtErr instanceof Error ? caughtErr.toString() : typeof caughtErr === "string" ? caughtErr : caughtErr && _.checkError.getConstructorName(caughtErr) - ); - } - if (errorLike && caughtErr) { - if (errorLike instanceof Error) { - var isCompatibleInstance = _.checkError.compatibleInstance(caughtErr, errorLike); - if (isCompatibleInstance === negate) { - if (everyArgIsDefined && negate) { - errorLikeFail = true; - } else { - this.assert( - negate, - "expected #{this} to throw #{exp} but #{act} was thrown", - "expected #{this} to not throw #{exp}" + (caughtErr && !negate ? " but #{act} was thrown" : ""), - errorLike.toString(), - caughtErr.toString() - ); - } - } - } - var isCompatibleConstructor = _.checkError.compatibleConstructor(caughtErr, errorLike); - if (isCompatibleConstructor === negate) { - if (everyArgIsDefined && negate) { - errorLikeFail = true; - } else { - this.assert( - negate, - "expected #{this} to throw #{exp} but #{act} was thrown", - "expected #{this} to not throw #{exp}" + (caughtErr ? " but #{act} was thrown" : ""), - errorLike instanceof Error ? errorLike.toString() : errorLike && _.checkError.getConstructorName(errorLike), - caughtErr instanceof Error ? caughtErr.toString() : caughtErr && _.checkError.getConstructorName(caughtErr) - ); - } - } - } - if (caughtErr && errMsgMatcher !== void 0 && errMsgMatcher !== null) { - var placeholder = "including"; - if (errMsgMatcher instanceof RegExp) { - placeholder = "matching"; - } - var isCompatibleMessage = _.checkError.compatibleMessage(caughtErr, errMsgMatcher); - if (isCompatibleMessage === negate) { - if (everyArgIsDefined && negate) { - errMsgMatcherFail = true; - } else { - this.assert( - negate, - "expected #{this} to throw error " + placeholder + " #{exp} but got #{act}", - "expected #{this} to throw error not " + placeholder + " #{exp}", - errMsgMatcher, - _.checkError.getMessage(caughtErr) - ); - } - } - } - if (errorLikeFail && errMsgMatcherFail) { - this.assert( - negate, - "expected #{this} to throw #{exp} but #{act} was thrown", - "expected #{this} to not throw #{exp}" + (caughtErr ? " but #{act} was thrown" : ""), - errorLike instanceof Error ? errorLike.toString() : errorLike && _.checkError.getConstructorName(errorLike), - caughtErr instanceof Error ? caughtErr.toString() : caughtErr && _.checkError.getConstructorName(caughtErr) - ); - } - flag(this, "object", caughtErr); - } - ; - Assertion2.addMethod("throw", assertThrows); - Assertion2.addMethod("throws", assertThrows); - Assertion2.addMethod("Throw", assertThrows); - function respondTo(method, msg) { - if (msg) - flag(this, "message", msg); - var obj = flag(this, "object"), itself = flag(this, "itself"), context = "function" === typeof obj && !itself ? obj.prototype[method] : obj[method]; - this.assert( - "function" === typeof context, - "expected #{this} to respond to " + _.inspect(method), - "expected #{this} to not respond to " + _.inspect(method) - ); - } - Assertion2.addMethod("respondTo", respondTo); - Assertion2.addMethod("respondsTo", respondTo); - Assertion2.addProperty("itself", function() { - flag(this, "itself", true); - }); - function satisfy(matcher, msg) { - if (msg) - flag(this, "message", msg); - var obj = flag(this, "object"); - var result = matcher(obj); - this.assert( - result, - "expected #{this} to satisfy " + _.objDisplay(matcher), - "expected #{this} to not satisfy" + _.objDisplay(matcher), - flag(this, "negate") ? false : true, - result - ); - } - Assertion2.addMethod("satisfy", satisfy); - Assertion2.addMethod("satisfies", satisfy); - function closeTo(expected, delta, msg) { - if (msg) - flag(this, "message", msg); - var obj = flag(this, "object"), flagMsg = flag(this, "message"), ssfi = flag(this, "ssfi"); - new Assertion2(obj, flagMsg, ssfi, true).is.a("number"); - if (typeof expected !== "number" || typeof delta !== "number") { - flagMsg = flagMsg ? flagMsg + ": " : ""; - var deltaMessage = delta === void 0 ? ", and a delta is required" : ""; - throw new AssertionError2( - flagMsg + "the arguments to closeTo or approximately must be numbers" + deltaMessage, - void 0, - ssfi - ); - } - this.assert( - Math.abs(obj - expected) <= delta, - "expected #{this} to be close to " + expected + " +/- " + delta, - "expected #{this} not to be close to " + expected + " +/- " + delta - ); - } - Assertion2.addMethod("closeTo", closeTo); - Assertion2.addMethod("approximately", closeTo); - function isSubsetOf(subset, superset, cmp, contains, ordered) { - if (!contains) { - if (subset.length !== superset.length) - return false; - superset = superset.slice(); - } - return subset.every(function(elem, idx) { - if (ordered) - return cmp ? cmp(elem, superset[idx]) : elem === superset[idx]; - if (!cmp) { - var matchIdx = superset.indexOf(elem); - if (matchIdx === -1) - return false; - if (!contains) - superset.splice(matchIdx, 1); - return true; - } - return superset.some(function(elem2, matchIdx2) { - if (!cmp(elem, elem2)) - return false; - if (!contains) - superset.splice(matchIdx2, 1); - return true; - }); - }); - } - Assertion2.addMethod("members", function(subset, msg) { - if (msg) - flag(this, "message", msg); - var obj = flag(this, "object"), flagMsg = flag(this, "message"), ssfi = flag(this, "ssfi"); - new Assertion2(obj, flagMsg, ssfi, true).to.be.an("array"); - new Assertion2(subset, flagMsg, ssfi, true).to.be.an("array"); - var contains = flag(this, "contains"); - var ordered = flag(this, "ordered"); - var subject, failMsg, failNegateMsg; - if (contains) { - subject = ordered ? "an ordered superset" : "a superset"; - failMsg = "expected #{this} to be " + subject + " of #{exp}"; - failNegateMsg = "expected #{this} to not be " + subject + " of #{exp}"; - } else { - subject = ordered ? "ordered members" : "members"; - failMsg = "expected #{this} to have the same " + subject + " as #{exp}"; - failNegateMsg = "expected #{this} to not have the same " + subject + " as #{exp}"; - } - var cmp = flag(this, "deep") ? flag(this, "eql") : void 0; - this.assert( - isSubsetOf(subset, obj, cmp, contains, ordered), - failMsg, - failNegateMsg, - subset, - obj, - true - ); - }); - function oneOf(list, msg) { - if (msg) - flag(this, "message", msg); - var expected = flag(this, "object"), flagMsg = flag(this, "message"), ssfi = flag(this, "ssfi"), contains = flag(this, "contains"), isDeep = flag(this, "deep"), eql = flag(this, "eql"); - new Assertion2(list, flagMsg, ssfi, true).to.be.an("array"); - if (contains) { - this.assert( - list.some(function(possibility) { - return expected.indexOf(possibility) > -1; - }), - "expected #{this} to contain one of #{exp}", - "expected #{this} to not contain one of #{exp}", - list, - expected - ); - } else { - if (isDeep) { - this.assert( - list.some(function(possibility) { - return eql(expected, possibility); - }), - "expected #{this} to deeply equal one of #{exp}", - "expected #{this} to deeply equal one of #{exp}", - list, - expected - ); - } else { - this.assert( - list.indexOf(expected) > -1, - "expected #{this} to be one of #{exp}", - "expected #{this} to not be one of #{exp}", - list, - expected - ); - } - } - } - Assertion2.addMethod("oneOf", oneOf); - function assertChanges(subject, prop, msg) { - if (msg) - flag(this, "message", msg); - var fn = flag(this, "object"), flagMsg = flag(this, "message"), ssfi = flag(this, "ssfi"); - new Assertion2(fn, flagMsg, ssfi, true).is.a("function"); - var initial; - if (!prop) { - new Assertion2(subject, flagMsg, ssfi, true).is.a("function"); - initial = subject(); - } else { - new Assertion2(subject, flagMsg, ssfi, true).to.have.property(prop); - initial = subject[prop]; - } - fn(); - var final = prop === void 0 || prop === null ? subject() : subject[prop]; - var msgObj = prop === void 0 || prop === null ? initial : "." + prop; - flag(this, "deltaMsgObj", msgObj); - flag(this, "initialDeltaValue", initial); - flag(this, "finalDeltaValue", final); - flag(this, "deltaBehavior", "change"); - flag(this, "realDelta", final !== initial); - this.assert( - initial !== final, - "expected " + msgObj + " to change", - "expected " + msgObj + " to not change" - ); - } - Assertion2.addMethod("change", assertChanges); - Assertion2.addMethod("changes", assertChanges); - function assertIncreases(subject, prop, msg) { - if (msg) - flag(this, "message", msg); - var fn = flag(this, "object"), flagMsg = flag(this, "message"), ssfi = flag(this, "ssfi"); - new Assertion2(fn, flagMsg, ssfi, true).is.a("function"); - var initial; - if (!prop) { - new Assertion2(subject, flagMsg, ssfi, true).is.a("function"); - initial = subject(); - } else { - new Assertion2(subject, flagMsg, ssfi, true).to.have.property(prop); - initial = subject[prop]; - } - new Assertion2(initial, flagMsg, ssfi, true).is.a("number"); - fn(); - var final = prop === void 0 || prop === null ? subject() : subject[prop]; - var msgObj = prop === void 0 || prop === null ? initial : "." + prop; - flag(this, "deltaMsgObj", msgObj); - flag(this, "initialDeltaValue", initial); - flag(this, "finalDeltaValue", final); - flag(this, "deltaBehavior", "increase"); - flag(this, "realDelta", final - initial); - this.assert( - final - initial > 0, - "expected " + msgObj + " to increase", - "expected " + msgObj + " to not increase" - ); - } - Assertion2.addMethod("increase", assertIncreases); - Assertion2.addMethod("increases", assertIncreases); - function assertDecreases(subject, prop, msg) { - if (msg) - flag(this, "message", msg); - var fn = flag(this, "object"), flagMsg = flag(this, "message"), ssfi = flag(this, "ssfi"); - new Assertion2(fn, flagMsg, ssfi, true).is.a("function"); - var initial; - if (!prop) { - new Assertion2(subject, flagMsg, ssfi, true).is.a("function"); - initial = subject(); - } else { - new Assertion2(subject, flagMsg, ssfi, true).to.have.property(prop); - initial = subject[prop]; - } - new Assertion2(initial, flagMsg, ssfi, true).is.a("number"); - fn(); - var final = prop === void 0 || prop === null ? subject() : subject[prop]; - var msgObj = prop === void 0 || prop === null ? initial : "." + prop; - flag(this, "deltaMsgObj", msgObj); - flag(this, "initialDeltaValue", initial); - flag(this, "finalDeltaValue", final); - flag(this, "deltaBehavior", "decrease"); - flag(this, "realDelta", initial - final); - this.assert( - final - initial < 0, - "expected " + msgObj + " to decrease", - "expected " + msgObj + " to not decrease" - ); - } - Assertion2.addMethod("decrease", assertDecreases); - Assertion2.addMethod("decreases", assertDecreases); - function assertDelta(delta, msg) { - if (msg) - flag(this, "message", msg); - var msgObj = flag(this, "deltaMsgObj"); - var initial = flag(this, "initialDeltaValue"); - var final = flag(this, "finalDeltaValue"); - var behavior = flag(this, "deltaBehavior"); - var realDelta = flag(this, "realDelta"); - var expression; - if (behavior === "change") { - expression = Math.abs(final - initial) === Math.abs(delta); - } else { - expression = realDelta === Math.abs(delta); - } - this.assert( - expression, - "expected " + msgObj + " to " + behavior + " by " + delta, - "expected " + msgObj + " to not " + behavior + " by " + delta - ); - } - Assertion2.addMethod("by", assertDelta); - Assertion2.addProperty("extensible", function() { - var obj = flag(this, "object"); - var isExtensible = obj === Object(obj) && Object.isExtensible(obj); - this.assert( - isExtensible, - "expected #{this} to be extensible", - "expected #{this} to not be extensible" - ); - }); - Assertion2.addProperty("sealed", function() { - var obj = flag(this, "object"); - var isSealed = obj === Object(obj) ? Object.isSealed(obj) : true; - this.assert( - isSealed, - "expected #{this} to be sealed", - "expected #{this} to not be sealed" - ); - }); - Assertion2.addProperty("frozen", function() { - var obj = flag(this, "object"); - var isFrozen = obj === Object(obj) ? Object.isFrozen(obj) : true; - this.assert( - isFrozen, - "expected #{this} to be frozen", - "expected #{this} to not be frozen" - ); - }); - Assertion2.addProperty("finite", function(msg) { - var obj = flag(this, "object"); - this.assert( - typeof obj === "number" && isFinite(obj), - "expected #{this} to be a finite number", - "expected #{this} to not be a finite number" - ); - }); - }; - } -}); - -// node_modules/chai/lib/chai/interface/expect.js -var require_expect = __commonJS({ - "node_modules/chai/lib/chai/interface/expect.js"(exports, module) { - module.exports = function(chai2, util2) { - chai2.expect = function(val, message) { - return new chai2.Assertion(val, message); - }; - chai2.expect.fail = function(actual, expected, message, operator) { - if (arguments.length < 2) { - message = actual; - actual = void 0; - } - message = message || "expect.fail()"; - throw new chai2.AssertionError(message, { - actual, - expected, - operator - }, chai2.expect.fail); - }; - }; - } -}); - -// node_modules/chai/lib/chai/interface/should.js -var require_should = __commonJS({ - "node_modules/chai/lib/chai/interface/should.js"(exports, module) { - module.exports = function(chai2, util2) { - var Assertion2 = chai2.Assertion; - function loadShould() { - function shouldGetter() { - if (this instanceof String || this instanceof Number || this instanceof Boolean || typeof Symbol === "function" && this instanceof Symbol || typeof BigInt === "function" && this instanceof BigInt) { - return new Assertion2(this.valueOf(), null, shouldGetter); - } - return new Assertion2(this, null, shouldGetter); - } - function shouldSetter(value) { - Object.defineProperty(this, "should", { - value, - enumerable: true, - configurable: true, - writable: true - }); - } - Object.defineProperty(Object.prototype, "should", { - set: shouldSetter, - get: shouldGetter, - configurable: true - }); - var should2 = {}; - should2.fail = function(actual, expected, message, operator) { - if (arguments.length < 2) { - message = actual; - actual = void 0; - } - message = message || "should.fail()"; - throw new chai2.AssertionError(message, { - actual, - expected, - operator - }, should2.fail); - }; - should2.equal = function(val1, val2, msg) { - new Assertion2(val1, msg).to.equal(val2); - }; - should2.Throw = function(fn, errt, errs, msg) { - new Assertion2(fn, msg).to.Throw(errt, errs); - }; - should2.exist = function(val, msg) { - new Assertion2(val, msg).to.exist; - }; - should2.not = {}; - should2.not.equal = function(val1, val2, msg) { - new Assertion2(val1, msg).to.not.equal(val2); - }; - should2.not.Throw = function(fn, errt, errs, msg) { - new Assertion2(fn, msg).to.not.Throw(errt, errs); - }; - should2.not.exist = function(val, msg) { - new Assertion2(val, msg).to.not.exist; - }; - should2["throw"] = should2["Throw"]; - should2.not["throw"] = should2.not["Throw"]; - return should2; - } - ; - chai2.should = loadShould; - chai2.Should = loadShould; - }; - } -}); - -// node_modules/chai/lib/chai/interface/assert.js -var require_assert = __commonJS({ - "node_modules/chai/lib/chai/interface/assert.js"(exports, module) { - module.exports = function(chai2, util2) { - var Assertion2 = chai2.Assertion, flag = util2.flag; - var assert2 = chai2.assert = function(express, errmsg) { - var test = new Assertion2(null, null, chai2.assert, true); - test.assert( - express, - errmsg, - "[ negation message unavailable ]" - ); - }; - assert2.fail = function(actual, expected, message, operator) { - if (arguments.length < 2) { - message = actual; - actual = void 0; - } - message = message || "assert.fail()"; - throw new chai2.AssertionError(message, { - actual, - expected, - operator - }, assert2.fail); - }; - assert2.isOk = function(val, msg) { - new Assertion2(val, msg, assert2.isOk, true).is.ok; - }; - assert2.isNotOk = function(val, msg) { - new Assertion2(val, msg, assert2.isNotOk, true).is.not.ok; - }; - assert2.equal = function(act, exp, msg) { - var test = new Assertion2(act, msg, assert2.equal, true); - test.assert( - exp == flag(test, "object"), - "expected #{this} to equal #{exp}", - "expected #{this} to not equal #{act}", - exp, - act, - true - ); - }; - assert2.notEqual = function(act, exp, msg) { - var test = new Assertion2(act, msg, assert2.notEqual, true); - test.assert( - exp != flag(test, "object"), - "expected #{this} to not equal #{exp}", - "expected #{this} to equal #{act}", - exp, - act, - true - ); - }; - assert2.strictEqual = function(act, exp, msg) { - new Assertion2(act, msg, assert2.strictEqual, true).to.equal(exp); - }; - assert2.notStrictEqual = function(act, exp, msg) { - new Assertion2(act, msg, assert2.notStrictEqual, true).to.not.equal(exp); - }; - assert2.deepEqual = assert2.deepStrictEqual = function(act, exp, msg) { - new Assertion2(act, msg, assert2.deepEqual, true).to.eql(exp); - }; - assert2.notDeepEqual = function(act, exp, msg) { - new Assertion2(act, msg, assert2.notDeepEqual, true).to.not.eql(exp); - }; - assert2.isAbove = function(val, abv, msg) { - new Assertion2(val, msg, assert2.isAbove, true).to.be.above(abv); - }; - assert2.isAtLeast = function(val, atlst, msg) { - new Assertion2(val, msg, assert2.isAtLeast, true).to.be.least(atlst); - }; - assert2.isBelow = function(val, blw, msg) { - new Assertion2(val, msg, assert2.isBelow, true).to.be.below(blw); - }; - assert2.isAtMost = function(val, atmst, msg) { - new Assertion2(val, msg, assert2.isAtMost, true).to.be.most(atmst); - }; - assert2.isTrue = function(val, msg) { - new Assertion2(val, msg, assert2.isTrue, true).is["true"]; - }; - assert2.isNotTrue = function(val, msg) { - new Assertion2(val, msg, assert2.isNotTrue, true).to.not.equal(true); - }; - assert2.isFalse = function(val, msg) { - new Assertion2(val, msg, assert2.isFalse, true).is["false"]; - }; - assert2.isNotFalse = function(val, msg) { - new Assertion2(val, msg, assert2.isNotFalse, true).to.not.equal(false); - }; - assert2.isNull = function(val, msg) { - new Assertion2(val, msg, assert2.isNull, true).to.equal(null); - }; - assert2.isNotNull = function(val, msg) { - new Assertion2(val, msg, assert2.isNotNull, true).to.not.equal(null); - }; - assert2.isNaN = function(val, msg) { - new Assertion2(val, msg, assert2.isNaN, true).to.be.NaN; - }; - assert2.isNotNaN = function(val, msg) { - new Assertion2(val, msg, assert2.isNotNaN, true).not.to.be.NaN; - }; - assert2.exists = function(val, msg) { - new Assertion2(val, msg, assert2.exists, true).to.exist; - }; - assert2.notExists = function(val, msg) { - new Assertion2(val, msg, assert2.notExists, true).to.not.exist; - }; - assert2.isUndefined = function(val, msg) { - new Assertion2(val, msg, assert2.isUndefined, true).to.equal(void 0); - }; - assert2.isDefined = function(val, msg) { - new Assertion2(val, msg, assert2.isDefined, true).to.not.equal(void 0); - }; - assert2.isFunction = function(val, msg) { - new Assertion2(val, msg, assert2.isFunction, true).to.be.a("function"); - }; - assert2.isNotFunction = function(val, msg) { - new Assertion2(val, msg, assert2.isNotFunction, true).to.not.be.a("function"); - }; - assert2.isObject = function(val, msg) { - new Assertion2(val, msg, assert2.isObject, true).to.be.a("object"); - }; - assert2.isNotObject = function(val, msg) { - new Assertion2(val, msg, assert2.isNotObject, true).to.not.be.a("object"); - }; - assert2.isArray = function(val, msg) { - new Assertion2(val, msg, assert2.isArray, true).to.be.an("array"); - }; - assert2.isNotArray = function(val, msg) { - new Assertion2(val, msg, assert2.isNotArray, true).to.not.be.an("array"); - }; - assert2.isString = function(val, msg) { - new Assertion2(val, msg, assert2.isString, true).to.be.a("string"); - }; - assert2.isNotString = function(val, msg) { - new Assertion2(val, msg, assert2.isNotString, true).to.not.be.a("string"); - }; - assert2.isNumber = function(val, msg) { - new Assertion2(val, msg, assert2.isNumber, true).to.be.a("number"); - }; - assert2.isNotNumber = function(val, msg) { - new Assertion2(val, msg, assert2.isNotNumber, true).to.not.be.a("number"); - }; - assert2.isFinite = function(val, msg) { - new Assertion2(val, msg, assert2.isFinite, true).to.be.finite; - }; - assert2.isBoolean = function(val, msg) { - new Assertion2(val, msg, assert2.isBoolean, true).to.be.a("boolean"); - }; - assert2.isNotBoolean = function(val, msg) { - new Assertion2(val, msg, assert2.isNotBoolean, true).to.not.be.a("boolean"); - }; - assert2.typeOf = function(val, type, msg) { - new Assertion2(val, msg, assert2.typeOf, true).to.be.a(type); - }; - assert2.notTypeOf = function(val, type, msg) { - new Assertion2(val, msg, assert2.notTypeOf, true).to.not.be.a(type); - }; - assert2.instanceOf = function(val, type, msg) { - new Assertion2(val, msg, assert2.instanceOf, true).to.be.instanceOf(type); - }; - assert2.notInstanceOf = function(val, type, msg) { - new Assertion2(val, msg, assert2.notInstanceOf, true).to.not.be.instanceOf(type); - }; - assert2.include = function(exp, inc, msg) { - new Assertion2(exp, msg, assert2.include, true).include(inc); - }; - assert2.notInclude = function(exp, inc, msg) { - new Assertion2(exp, msg, assert2.notInclude, true).not.include(inc); - }; - assert2.deepInclude = function(exp, inc, msg) { - new Assertion2(exp, msg, assert2.deepInclude, true).deep.include(inc); - }; - assert2.notDeepInclude = function(exp, inc, msg) { - new Assertion2(exp, msg, assert2.notDeepInclude, true).not.deep.include(inc); - }; - assert2.nestedInclude = function(exp, inc, msg) { - new Assertion2(exp, msg, assert2.nestedInclude, true).nested.include(inc); - }; - assert2.notNestedInclude = function(exp, inc, msg) { - new Assertion2(exp, msg, assert2.notNestedInclude, true).not.nested.include(inc); - }; - assert2.deepNestedInclude = function(exp, inc, msg) { - new Assertion2(exp, msg, assert2.deepNestedInclude, true).deep.nested.include(inc); - }; - assert2.notDeepNestedInclude = function(exp, inc, msg) { - new Assertion2(exp, msg, assert2.notDeepNestedInclude, true).not.deep.nested.include(inc); - }; - assert2.ownInclude = function(exp, inc, msg) { - new Assertion2(exp, msg, assert2.ownInclude, true).own.include(inc); - }; - assert2.notOwnInclude = function(exp, inc, msg) { - new Assertion2(exp, msg, assert2.notOwnInclude, true).not.own.include(inc); - }; - assert2.deepOwnInclude = function(exp, inc, msg) { - new Assertion2(exp, msg, assert2.deepOwnInclude, true).deep.own.include(inc); - }; - assert2.notDeepOwnInclude = function(exp, inc, msg) { - new Assertion2(exp, msg, assert2.notDeepOwnInclude, true).not.deep.own.include(inc); - }; - assert2.match = function(exp, re, msg) { - new Assertion2(exp, msg, assert2.match, true).to.match(re); - }; - assert2.notMatch = function(exp, re, msg) { - new Assertion2(exp, msg, assert2.notMatch, true).to.not.match(re); - }; - assert2.property = function(obj, prop, msg) { - new Assertion2(obj, msg, assert2.property, true).to.have.property(prop); - }; - assert2.notProperty = function(obj, prop, msg) { - new Assertion2(obj, msg, assert2.notProperty, true).to.not.have.property(prop); - }; - assert2.propertyVal = function(obj, prop, val, msg) { - new Assertion2(obj, msg, assert2.propertyVal, true).to.have.property(prop, val); - }; - assert2.notPropertyVal = function(obj, prop, val, msg) { - new Assertion2(obj, msg, assert2.notPropertyVal, true).to.not.have.property(prop, val); - }; - assert2.deepPropertyVal = function(obj, prop, val, msg) { - new Assertion2(obj, msg, assert2.deepPropertyVal, true).to.have.deep.property(prop, val); - }; - assert2.notDeepPropertyVal = function(obj, prop, val, msg) { - new Assertion2(obj, msg, assert2.notDeepPropertyVal, true).to.not.have.deep.property(prop, val); - }; - assert2.ownProperty = function(obj, prop, msg) { - new Assertion2(obj, msg, assert2.ownProperty, true).to.have.own.property(prop); - }; - assert2.notOwnProperty = function(obj, prop, msg) { - new Assertion2(obj, msg, assert2.notOwnProperty, true).to.not.have.own.property(prop); - }; - assert2.ownPropertyVal = function(obj, prop, value, msg) { - new Assertion2(obj, msg, assert2.ownPropertyVal, true).to.have.own.property(prop, value); - }; - assert2.notOwnPropertyVal = function(obj, prop, value, msg) { - new Assertion2(obj, msg, assert2.notOwnPropertyVal, true).to.not.have.own.property(prop, value); - }; - assert2.deepOwnPropertyVal = function(obj, prop, value, msg) { - new Assertion2(obj, msg, assert2.deepOwnPropertyVal, true).to.have.deep.own.property(prop, value); - }; - assert2.notDeepOwnPropertyVal = function(obj, prop, value, msg) { - new Assertion2(obj, msg, assert2.notDeepOwnPropertyVal, true).to.not.have.deep.own.property(prop, value); - }; - assert2.nestedProperty = function(obj, prop, msg) { - new Assertion2(obj, msg, assert2.nestedProperty, true).to.have.nested.property(prop); - }; - assert2.notNestedProperty = function(obj, prop, msg) { - new Assertion2(obj, msg, assert2.notNestedProperty, true).to.not.have.nested.property(prop); - }; - assert2.nestedPropertyVal = function(obj, prop, val, msg) { - new Assertion2(obj, msg, assert2.nestedPropertyVal, true).to.have.nested.property(prop, val); - }; - assert2.notNestedPropertyVal = function(obj, prop, val, msg) { - new Assertion2(obj, msg, assert2.notNestedPropertyVal, true).to.not.have.nested.property(prop, val); - }; - assert2.deepNestedPropertyVal = function(obj, prop, val, msg) { - new Assertion2(obj, msg, assert2.deepNestedPropertyVal, true).to.have.deep.nested.property(prop, val); - }; - assert2.notDeepNestedPropertyVal = function(obj, prop, val, msg) { - new Assertion2(obj, msg, assert2.notDeepNestedPropertyVal, true).to.not.have.deep.nested.property(prop, val); - }; - assert2.lengthOf = function(exp, len, msg) { - new Assertion2(exp, msg, assert2.lengthOf, true).to.have.lengthOf(len); - }; - assert2.hasAnyKeys = function(obj, keys, msg) { - new Assertion2(obj, msg, assert2.hasAnyKeys, true).to.have.any.keys(keys); - }; - assert2.hasAllKeys = function(obj, keys, msg) { - new Assertion2(obj, msg, assert2.hasAllKeys, true).to.have.all.keys(keys); - }; - assert2.containsAllKeys = function(obj, keys, msg) { - new Assertion2(obj, msg, assert2.containsAllKeys, true).to.contain.all.keys(keys); - }; - assert2.doesNotHaveAnyKeys = function(obj, keys, msg) { - new Assertion2(obj, msg, assert2.doesNotHaveAnyKeys, true).to.not.have.any.keys(keys); - }; - assert2.doesNotHaveAllKeys = function(obj, keys, msg) { - new Assertion2(obj, msg, assert2.doesNotHaveAllKeys, true).to.not.have.all.keys(keys); - }; - assert2.hasAnyDeepKeys = function(obj, keys, msg) { - new Assertion2(obj, msg, assert2.hasAnyDeepKeys, true).to.have.any.deep.keys(keys); - }; - assert2.hasAllDeepKeys = function(obj, keys, msg) { - new Assertion2(obj, msg, assert2.hasAllDeepKeys, true).to.have.all.deep.keys(keys); - }; - assert2.containsAllDeepKeys = function(obj, keys, msg) { - new Assertion2(obj, msg, assert2.containsAllDeepKeys, true).to.contain.all.deep.keys(keys); - }; - assert2.doesNotHaveAnyDeepKeys = function(obj, keys, msg) { - new Assertion2(obj, msg, assert2.doesNotHaveAnyDeepKeys, true).to.not.have.any.deep.keys(keys); - }; - assert2.doesNotHaveAllDeepKeys = function(obj, keys, msg) { - new Assertion2(obj, msg, assert2.doesNotHaveAllDeepKeys, true).to.not.have.all.deep.keys(keys); - }; - assert2.throws = function(fn, errorLike, errMsgMatcher, msg) { - if ("string" === typeof errorLike || errorLike instanceof RegExp) { - errMsgMatcher = errorLike; - errorLike = null; - } - var assertErr = new Assertion2(fn, msg, assert2.throws, true).to.throw(errorLike, errMsgMatcher); - return flag(assertErr, "object"); - }; - assert2.doesNotThrow = function(fn, errorLike, errMsgMatcher, msg) { - if ("string" === typeof errorLike || errorLike instanceof RegExp) { - errMsgMatcher = errorLike; - errorLike = null; - } - new Assertion2(fn, msg, assert2.doesNotThrow, true).to.not.throw(errorLike, errMsgMatcher); - }; - assert2.operator = function(val, operator, val2, msg) { - var ok; - switch (operator) { - case "==": - ok = val == val2; - break; - case "===": - ok = val === val2; - break; - case ">": - ok = val > val2; - break; - case ">=": - ok = val >= val2; - break; - case "<": - ok = val < val2; - break; - case "<=": - ok = val <= val2; - break; - case "!=": - ok = val != val2; - break; - case "!==": - ok = val !== val2; - break; - default: - msg = msg ? msg + ": " : msg; - throw new chai2.AssertionError( - msg + 'Invalid operator "' + operator + '"', - void 0, - assert2.operator - ); - } - var test = new Assertion2(ok, msg, assert2.operator, true); - test.assert( - true === flag(test, "object"), - "expected " + util2.inspect(val) + " to be " + operator + " " + util2.inspect(val2), - "expected " + util2.inspect(val) + " to not be " + operator + " " + util2.inspect(val2) - ); - }; - assert2.closeTo = function(act, exp, delta, msg) { - new Assertion2(act, msg, assert2.closeTo, true).to.be.closeTo(exp, delta); - }; - assert2.approximately = function(act, exp, delta, msg) { - new Assertion2(act, msg, assert2.approximately, true).to.be.approximately(exp, delta); - }; - assert2.sameMembers = function(set1, set2, msg) { - new Assertion2(set1, msg, assert2.sameMembers, true).to.have.same.members(set2); - }; - assert2.notSameMembers = function(set1, set2, msg) { - new Assertion2(set1, msg, assert2.notSameMembers, true).to.not.have.same.members(set2); - }; - assert2.sameDeepMembers = function(set1, set2, msg) { - new Assertion2(set1, msg, assert2.sameDeepMembers, true).to.have.same.deep.members(set2); - }; - assert2.notSameDeepMembers = function(set1, set2, msg) { - new Assertion2(set1, msg, assert2.notSameDeepMembers, true).to.not.have.same.deep.members(set2); - }; - assert2.sameOrderedMembers = function(set1, set2, msg) { - new Assertion2(set1, msg, assert2.sameOrderedMembers, true).to.have.same.ordered.members(set2); - }; - assert2.notSameOrderedMembers = function(set1, set2, msg) { - new Assertion2(set1, msg, assert2.notSameOrderedMembers, true).to.not.have.same.ordered.members(set2); - }; - assert2.sameDeepOrderedMembers = function(set1, set2, msg) { - new Assertion2(set1, msg, assert2.sameDeepOrderedMembers, true).to.have.same.deep.ordered.members(set2); - }; - assert2.notSameDeepOrderedMembers = function(set1, set2, msg) { - new Assertion2(set1, msg, assert2.notSameDeepOrderedMembers, true).to.not.have.same.deep.ordered.members(set2); - }; - assert2.includeMembers = function(superset, subset, msg) { - new Assertion2(superset, msg, assert2.includeMembers, true).to.include.members(subset); - }; - assert2.notIncludeMembers = function(superset, subset, msg) { - new Assertion2(superset, msg, assert2.notIncludeMembers, true).to.not.include.members(subset); - }; - assert2.includeDeepMembers = function(superset, subset, msg) { - new Assertion2(superset, msg, assert2.includeDeepMembers, true).to.include.deep.members(subset); - }; - assert2.notIncludeDeepMembers = function(superset, subset, msg) { - new Assertion2(superset, msg, assert2.notIncludeDeepMembers, true).to.not.include.deep.members(subset); - }; - assert2.includeOrderedMembers = function(superset, subset, msg) { - new Assertion2(superset, msg, assert2.includeOrderedMembers, true).to.include.ordered.members(subset); - }; - assert2.notIncludeOrderedMembers = function(superset, subset, msg) { - new Assertion2(superset, msg, assert2.notIncludeOrderedMembers, true).to.not.include.ordered.members(subset); - }; - assert2.includeDeepOrderedMembers = function(superset, subset, msg) { - new Assertion2(superset, msg, assert2.includeDeepOrderedMembers, true).to.include.deep.ordered.members(subset); - }; - assert2.notIncludeDeepOrderedMembers = function(superset, subset, msg) { - new Assertion2(superset, msg, assert2.notIncludeDeepOrderedMembers, true).to.not.include.deep.ordered.members(subset); - }; - assert2.oneOf = function(inList, list, msg) { - new Assertion2(inList, msg, assert2.oneOf, true).to.be.oneOf(list); - }; - assert2.changes = function(fn, obj, prop, msg) { - if (arguments.length === 3 && typeof obj === "function") { - msg = prop; - prop = null; - } - new Assertion2(fn, msg, assert2.changes, true).to.change(obj, prop); - }; - assert2.changesBy = function(fn, obj, prop, delta, msg) { - if (arguments.length === 4 && typeof obj === "function") { - var tmpMsg = delta; - delta = prop; - msg = tmpMsg; - } else if (arguments.length === 3) { - delta = prop; - prop = null; - } - new Assertion2(fn, msg, assert2.changesBy, true).to.change(obj, prop).by(delta); - }; - assert2.doesNotChange = function(fn, obj, prop, msg) { - if (arguments.length === 3 && typeof obj === "function") { - msg = prop; - prop = null; - } - return new Assertion2(fn, msg, assert2.doesNotChange, true).to.not.change(obj, prop); - }; - assert2.changesButNotBy = function(fn, obj, prop, delta, msg) { - if (arguments.length === 4 && typeof obj === "function") { - var tmpMsg = delta; - delta = prop; - msg = tmpMsg; - } else if (arguments.length === 3) { - delta = prop; - prop = null; - } - new Assertion2(fn, msg, assert2.changesButNotBy, true).to.change(obj, prop).but.not.by(delta); - }; - assert2.increases = function(fn, obj, prop, msg) { - if (arguments.length === 3 && typeof obj === "function") { - msg = prop; - prop = null; - } - return new Assertion2(fn, msg, assert2.increases, true).to.increase(obj, prop); - }; - assert2.increasesBy = function(fn, obj, prop, delta, msg) { - if (arguments.length === 4 && typeof obj === "function") { - var tmpMsg = delta; - delta = prop; - msg = tmpMsg; - } else if (arguments.length === 3) { - delta = prop; - prop = null; - } - new Assertion2(fn, msg, assert2.increasesBy, true).to.increase(obj, prop).by(delta); - }; - assert2.doesNotIncrease = function(fn, obj, prop, msg) { - if (arguments.length === 3 && typeof obj === "function") { - msg = prop; - prop = null; - } - return new Assertion2(fn, msg, assert2.doesNotIncrease, true).to.not.increase(obj, prop); - }; - assert2.increasesButNotBy = function(fn, obj, prop, delta, msg) { - if (arguments.length === 4 && typeof obj === "function") { - var tmpMsg = delta; - delta = prop; - msg = tmpMsg; - } else if (arguments.length === 3) { - delta = prop; - prop = null; - } - new Assertion2(fn, msg, assert2.increasesButNotBy, true).to.increase(obj, prop).but.not.by(delta); - }; - assert2.decreases = function(fn, obj, prop, msg) { - if (arguments.length === 3 && typeof obj === "function") { - msg = prop; - prop = null; - } - return new Assertion2(fn, msg, assert2.decreases, true).to.decrease(obj, prop); - }; - assert2.decreasesBy = function(fn, obj, prop, delta, msg) { - if (arguments.length === 4 && typeof obj === "function") { - var tmpMsg = delta; - delta = prop; - msg = tmpMsg; - } else if (arguments.length === 3) { - delta = prop; - prop = null; - } - new Assertion2(fn, msg, assert2.decreasesBy, true).to.decrease(obj, prop).by(delta); - }; - assert2.doesNotDecrease = function(fn, obj, prop, msg) { - if (arguments.length === 3 && typeof obj === "function") { - msg = prop; - prop = null; - } - return new Assertion2(fn, msg, assert2.doesNotDecrease, true).to.not.decrease(obj, prop); - }; - assert2.doesNotDecreaseBy = function(fn, obj, prop, delta, msg) { - if (arguments.length === 4 && typeof obj === "function") { - var tmpMsg = delta; - delta = prop; - msg = tmpMsg; - } else if (arguments.length === 3) { - delta = prop; - prop = null; - } - return new Assertion2(fn, msg, assert2.doesNotDecreaseBy, true).to.not.decrease(obj, prop).by(delta); - }; - assert2.decreasesButNotBy = function(fn, obj, prop, delta, msg) { - if (arguments.length === 4 && typeof obj === "function") { - var tmpMsg = delta; - delta = prop; - msg = tmpMsg; - } else if (arguments.length === 3) { - delta = prop; - prop = null; - } - new Assertion2(fn, msg, assert2.decreasesButNotBy, true).to.decrease(obj, prop).but.not.by(delta); - }; - assert2.ifError = function(val) { - if (val) { - throw val; - } - }; - assert2.isExtensible = function(obj, msg) { - new Assertion2(obj, msg, assert2.isExtensible, true).to.be.extensible; - }; - assert2.isNotExtensible = function(obj, msg) { - new Assertion2(obj, msg, assert2.isNotExtensible, true).to.not.be.extensible; - }; - assert2.isSealed = function(obj, msg) { - new Assertion2(obj, msg, assert2.isSealed, true).to.be.sealed; - }; - assert2.isNotSealed = function(obj, msg) { - new Assertion2(obj, msg, assert2.isNotSealed, true).to.not.be.sealed; - }; - assert2.isFrozen = function(obj, msg) { - new Assertion2(obj, msg, assert2.isFrozen, true).to.be.frozen; - }; - assert2.isNotFrozen = function(obj, msg) { - new Assertion2(obj, msg, assert2.isNotFrozen, true).to.not.be.frozen; - }; - assert2.isEmpty = function(val, msg) { - new Assertion2(val, msg, assert2.isEmpty, true).to.be.empty; - }; - assert2.isNotEmpty = function(val, msg) { - new Assertion2(val, msg, assert2.isNotEmpty, true).to.not.be.empty; - }; - (function alias(name, as) { - assert2[as] = assert2[name]; - return alias; - })("isOk", "ok")("isNotOk", "notOk")("throws", "throw")("throws", "Throw")("isExtensible", "extensible")("isNotExtensible", "notExtensible")("isSealed", "sealed")("isNotSealed", "notSealed")("isFrozen", "frozen")("isNotFrozen", "notFrozen")("isEmpty", "empty")("isNotEmpty", "notEmpty"); - }; - } -}); - -// node_modules/chai/lib/chai.js -var require_chai = __commonJS({ - "node_modules/chai/lib/chai.js"(exports) { - var used = []; - exports.version = "4.3.8"; - exports.AssertionError = require_assertion_error(); - var util2 = require_utils(); - exports.use = function(fn) { - if (!~used.indexOf(fn)) { - fn(exports, util2); - used.push(fn); - } - return exports; - }; - exports.util = util2; - var config2 = require_config(); - exports.config = config2; - var assertion = require_assertion(); - exports.use(assertion); - var core2 = require_assertions(); - exports.use(core2); - var expect2 = require_expect(); - exports.use(expect2); - var should2 = require_should(); - exports.use(should2); - var assert2 = require_assert(); - exports.use(assert2); - } -}); - -// node_modules/chai/index.js -var require_chai2 = __commonJS({ - "node_modules/chai/index.js"(exports, module) { - module.exports = require_chai(); - } -}); - -// node_modules/chai/index.mjs -var import_index = __toESM(require_chai2(), 1); -var expect = import_index.default.expect; -var version = import_index.default.version; -var Assertion = import_index.default.Assertion; -var AssertionError = import_index.default.AssertionError; -var util = import_index.default.util; -var config = import_index.default.config; -var use = import_index.default.use; -var should = import_index.default.should; -var assert = import_index.default.assert; -var core = import_index.default.core; - -// node_modules/testeranto/dist/module/core.js -var defaultTestResource = { name: "", fs: ".", ports: [] }; -var defaultTestResourceRequirement = { - ports: 0 -}; -var BaseSuite = class { - constructor(name, index, givens = {}, checks = []) { - this.name = name; - this.index = index; - this.givens = givens; - this.checks = checks; - this.fails = []; - } - toObj() { - return { - name: this.name, - givens: Object.keys(this.givens).map((k) => this.givens[k].toObj()), - fails: this.fails - }; - } - setup(s, artifactory) { - return new Promise((res) => res(s)); - } - test(t) { - return t; - } - async run(input, testResourceConfiguration, artifactory, tLog) { - this.testResourceConfiguration = testResourceConfiguration; - const suiteArtifactory = (fPath, value) => artifactory(`suite-${this.index}-${this.name}/${fPath}`, value); - const subject = await this.setup(input, suiteArtifactory); - tLog("\nSuite:", this.index, this.name); - for (const k of Object.keys(this.givens)) { - const giver = this.givens[k]; - try { - this.store = await giver.give(subject, k, testResourceConfiguration, this.test, suiteArtifactory, tLog); - } catch (e) { - console.error(e); - this.fails.push(giver); - return this; - } - } - for (const [ndx, thater] of this.checks.entries()) { - await thater.check(subject, thater.name, testResourceConfiguration, this.test, suiteArtifactory, tLog); - } - for (const k of Object.keys(this.givens)) { - const giver = this.givens[k]; - giver.afterAll(this.store, artifactory); - } - return this; - } -}; -var BaseGiven = class { - constructor(name, features, whens, thens) { - this.name = name; - this.features = features; - this.whens = whens; - this.thens = thens; - } - beforeAll(store, artifactory) { - return store; - } - afterAll(store, artifactory) { - return store; - } - toObj() { - return { - name: this.name, - whens: this.whens.map((w) => w.toObj()), - thens: this.thens.map((t) => t.toObj()), - error: this.error ? [this.error, this.error.stack] : null, - features: this.features - }; - } - async afterEach(store, key, artifactory) { - return store; - } - async give(subject, key, testResourceConfiguration, tester, artifactory, tLog) { - tLog(` - Given: ${this.name}`); - const givenArtifactory = (fPath, value) => artifactory(`given-${key}/${fPath}`, value); - try { - this.store = await this.givenThat(subject, testResourceConfiguration, givenArtifactory); - for (const whenStep of this.whens) { - await whenStep.test(this.store, testResourceConfiguration, tLog); - } - for (const thenStep of this.thens) { - const t = await thenStep.test(this.store, testResourceConfiguration, tLog); - tester(t); - } - } catch (e) { - this.error = e; - tLog(e); - tLog("\x07"); - } finally { - try { - await this.afterEach(this.store, key, givenArtifactory); - } catch (e) { - console.error("afterEach failed! no error will be recorded!", e); - } - } - return this.store; - } -}; -var BaseWhen = class { - constructor(name, actioner) { - this.name = name; - this.actioner = actioner; - } - toObj() { - return { - name: this.name, - error: this.error - }; - } - async test(store, testResourceConfiguration, tLog) { - tLog(" When:", this.name); - try { - return await this.andWhen(store, this.actioner, testResourceConfiguration); - } catch (e) { - this.error = true; - throw e; - } - } -}; -var BaseThen = class { - constructor(name, thenCB) { - this.name = name; - this.thenCB = thenCB; - } - toObj() { - return { - name: this.name, - error: this.error - }; - } - async test(store, testResourceConfiguration, tLog) { - tLog(" Then:", this.name); - try { - return this.thenCB(await this.butThen(store, testResourceConfiguration)); - } catch (e) { - console.log("test failed", e); - this.error = true; - throw e; - } - } -}; -var BaseCheck = class { - constructor(name, features, checkCB, whens, thens) { - this.name = name; - this.features = features; - this.checkCB = checkCB; - this.whens = whens; - this.thens = thens; - } - async afterEach(store, key, cb) { - return; - } - async check(subject, key, testResourceConfiguration, tester, artifactory, tLog) { - tLog(` - Check: ${this.name}`); - const store = await this.checkThat(subject, testResourceConfiguration, artifactory); - await this.checkCB(Object.entries(this.whens).reduce((a, [key2, when]) => { - a[key2] = async (payload) => { - return await when(payload, testResourceConfiguration).test(store, testResourceConfiguration, tLog); - }; - return a; - }, {}), Object.entries(this.thens).reduce((a, [key2, then]) => { - a[key2] = async (payload) => { - const t = await then(payload, testResourceConfiguration).test(store, testResourceConfiguration, tLog); - tester(t); - }; - return a; - }, {})); - await this.afterEach(store, key); - return; - } -}; -var TesterantoLevelZero = class { - constructor(cc, suitesOverrides, givenOverides, whenOverides, thenOverides, checkOverides) { - this.cc = cc; - this.constructorator = cc; - this.suitesOverrides = suitesOverrides; - this.givenOverides = givenOverides; - this.whenOverides = whenOverides; - this.thenOverides = thenOverides; - this.checkOverides = checkOverides; - } - Suites() { - return this.suitesOverrides; - } - Given() { - return this.givenOverides; - } - When() { - return this.whenOverides; - } - Then() { - return this.thenOverides; - } - Check() { - return this.checkOverides; - } -}; -var TesterantoLevelOne = class { - constructor(testImplementation, testSpecification, input, suiteKlasser, givenKlasser, whenKlasser, thenKlasser, checkKlasser, testResourceRequirement, logWriter) { - const classySuites = Object.entries(testImplementation.Suites).reduce((a, [key], index) => { - a[key] = (somestring, givens, checks) => { - return new suiteKlasser.prototype.constructor(somestring, index, givens, checks); - }; - return a; - }, {}); - const classyGivens = Object.keys(testImplementation.Givens).reduce((a, key) => { - a[key] = (features, whens, thens, ...xtrasW) => { - return new givenKlasser.prototype.constructor(key, features, whens, thens, testImplementation.Givens[key](...xtrasW)); - }; - return a; - }, {}); - const classyWhens = Object.entries(testImplementation.Whens).reduce((a, [key, whEn]) => { - a[key] = (payload) => { - return new whenKlasser.prototype.constructor(`${whEn.name}: ${payload && payload.toString()}`, whEn(payload)); - }; - return a; - }, {}); - const classyThens = Object.entries(testImplementation.Thens).reduce((a, [key, thEn]) => { - a[key] = (expected, x) => { - return new thenKlasser.prototype.constructor(`${thEn.name}: ${expected && expected.toString()}`, thEn(expected)); - }; - return a; - }, {}); - const classyChecks = Object.entries(testImplementation.Checks).reduce((a, [key, z]) => { - a[key] = (somestring, features, callback) => { - return new checkKlasser.prototype.constructor(somestring, features, callback, classyWhens, classyThens); - }; - return a; - }, {}); - const classyTesteranto = new class extends TesterantoLevelZero { - }(input, classySuites, classyGivens, classyWhens, classyThens, classyChecks); - const suites = testSpecification( - /* @ts-ignore:next-line */ - classyTesteranto.Suites(), - classyTesteranto.Given(), - classyTesteranto.When(), - classyTesteranto.Then(), - classyTesteranto.Check(), - logWriter - ); - const suiteRunner = (suite) => async (testResourceConfiguration, tLog) => { - return await suite.run(input, testResourceConfiguration, (fPath, value) => logWriter.testArtiFactoryfileWriter(tLog)(testResourceConfiguration.fs + "/" + fPath, value), tLog); - }; - const toReturn = suites.map((suite) => { - const runner = suiteRunner(suite); - return { - test: suite, - testResourceRequirement, - toObj: () => { - return suite.toObj(); - }, - runner, - receiveTestResourceConfig: async function(testResourceConfiguration = defaultTestResource) { - console.log(`testResourceConfiguration ${JSON.stringify(testResourceConfiguration, null, 2)}`); - await logWriter.mkdirSync(testResourceConfiguration.fs); - const logFilePath = `${testResourceConfiguration.fs}/log.txt`; - const access = await logWriter.createWriteStream(logFilePath); - const tLog = (...l) => { - console.log(...l); - access.write(`${l.toString()} -`); - }; - const suiteDone = await runner(testResourceConfiguration, tLog); - const resultsFilePath = `${testResourceConfiguration.fs}/results.json`; - logWriter.writeFileSync(resultsFilePath, JSON.stringify(suiteDone.toObj(), null, 2)); - access.close(); - const numberOfFailures = Object.keys(suiteDone.givens).filter((k) => { - return suiteDone.givens[k].error; - }).length; - console.log(`exiting gracefully with ${numberOfFailures} failures.`); - return numberOfFailures !== 0; - } - }; - }); - return toReturn; - } -}; -var TesterantoLevelTwo = class extends TesterantoLevelOne { - constructor(input, testSpecification, testImplementation, testInterface, testResourceRequirement = defaultTestResourceRequirement, assertioner, beforeEach, afterEach, afterAll, butThen, andWhen, actionHandler, logWriter) { - super(testImplementation, testSpecification, input, class extends BaseSuite { - async setup(s, artifactory) { - return (testInterface.beforeAll || (async (input2, artificer) => input2))(s, artifactory, this.testResourceConfiguration); - } - test(t) { - return assertioner(t); - } - }, class Given extends BaseGiven { - constructor(name, features, whens, thens, initialValues) { - super(name, features, whens, thens); - this.initialValues = initialValues; - } - async givenThat(subject, testResource, artifactory) { - return beforeEach(subject, this.initialValues, testResource, (fPath, value) => ( - // TODO does not work? - artifactory(`beforeEach/${fPath}`, value) - )); - } - afterEach(store, key, artifactory) { - return new Promise((res) => res(afterEach(store, key, (fPath, value) => artifactory(`after/${fPath}`, value)))); - } - afterAll(store, artifactory) { - return afterAll(store, (fPath, value) => ( - // TODO does not work? - artifactory(`afterAll4-${this.name}/${fPath}`, value) - )); - } - }, class When extends BaseWhen { - constructor(name, actioner, payload) { - super(name, (store) => { - return actionHandler(actioner); - }); - this.payload = payload; - } - async andWhen(store, actioner, testResource) { - return await andWhen(store, actioner, testResource); - } - }, class Then extends BaseThen { - constructor(name, callback) { - super(name, callback); - } - async butThen(store, testResourceConfiguration) { - return await butThen(store, this.thenCB, testResourceConfiguration); - } - }, class Check extends BaseCheck { - constructor(name, features, checkCallback, whens, thens, initialValues) { - super(name, features, checkCallback, whens, thens); - this.initialValues = initialValues; - } - async checkThat(subject, testResourceConfiguration, artifactory) { - return beforeEach(subject, this.initialValues, testResourceConfiguration, (fPath, value) => artifactory(`before/${fPath}`, value)); - } - afterEach(store, key, artifactory) { - return new Promise((res) => res(afterEach(store, key, (fPath, value) => ( - // TODO does not work? - artifactory(`afterEach2-${this.name}/${fPath}`, value) - )))); - } - }, testResourceRequirement, logWriter); - } -}; - -// node_modules/testeranto/dist/module/Web.js -var webSocket = new WebSocket("ws://localhost:8080"); -var Web_default = async (input, testSpecification, testImplementation, testInterface, testResourceRequirement = defaultTestResourceRequirement) => { - const mrt = new TesterantoLevelTwo(input, testSpecification, testImplementation, testInterface, testResourceRequirement, testInterface.assertioner || (async (t2) => t2), testInterface.beforeEach || async function(subject, initialValues, testResource) { - return subject; - }, testInterface.afterEach || (async (s) => s), testInterface.afterAll || ((store) => void 0), testInterface.butThen || (async (a) => a), testInterface.andWhen, testInterface.actionHandler || function(b) { - return b; - }, window.NodeWriter); - const t = mrt[0]; - const testResourceArg = decodeURIComponent(new URLSearchParams(location.search).get("requesting") || ""); - try { - const partialTestResource = JSON.parse(testResourceArg); - if (partialTestResource.fs && partialTestResource.ports) { - const failed = await t.receiveTestResourceConfig(partialTestResource); - window.exit(failed); - } else { - console.log("test configuration is incomplete", partialTestResource); - console.log("requesting test resources via ws", testResourceRequirement); - webSocket.addEventListener("open", (event) => { - webSocket.addEventListener("message", (event2) => { - console.log("Message from server ", event2.data); - }); - const r = JSON.stringify({ - type: "testeranto:hola", - data: { - testResourceRequirement - } - }); - webSocket.send(r); - console.log("awaiting test resources via websocket...", r); - webSocket.onmessage = async (msg) => { - console.log("message: ", msg); - const resourcesFromPm2 = msg.data.testResourceConfiguration; - const secondTestResource = Object.assign(Object.assign({ fs: "." }, JSON.parse(JSON.stringify(partialTestResource))), JSON.parse(JSON.stringify(resourcesFromPm2))); - console.log("secondTestResource", secondTestResource); - const failed = await t.receiveTestResourceConfig(partialTestResource); - webSocket.send(JSON.stringify({ - type: "testeranto:adios", - data: { - testResourceConfiguration: t.test.testResourceConfiguration, - results: t.toObj() - } - })); - document.write("all done"); - }; - }); - } - } catch (e) { - console.error(e); - process.exit(-1); - } -}; - -export { - assert, - Web_default -}; -/*! Bundled license information: - -assertion-error/index.js: - (*! - * assertion-error - * Copyright(c) 2013 Jake Luer - * MIT Licensed - *) - (*! - * Return a function that will copy properties from - * one object to another excluding any originally - * listed. Returned function will create a new `{}`. - * - * @param {String} excluded properties ... - * @return {Function} - *) - (*! - * Primary Exports - *) - (*! - * Inherit from Error.prototype - *) - (*! - * Statically set name - *) - (*! - * Ensure correct constructor - *) - -chai/lib/chai/utils/flag.js: - (*! - * Chai - flag utility - * Copyright(c) 2012-2014 Jake Luer - * MIT Licensed - *) - -chai/lib/chai/utils/test.js: - (*! - * Chai - test utility - * Copyright(c) 2012-2014 Jake Luer - * MIT Licensed - *) - (*! - * Module dependencies - *) - -chai/lib/chai/utils/expectTypes.js: - (*! - * Chai - expectTypes utility - * Copyright(c) 2012-2014 Jake Luer - * MIT Licensed - *) - -chai/lib/chai/utils/getActual.js: - (*! - * Chai - getActual utility - * Copyright(c) 2012-2014 Jake Luer - * MIT Licensed - *) - -chai/lib/chai/utils/objDisplay.js: - (*! - * Chai - flag utility - * Copyright(c) 2012-2014 Jake Luer - * MIT Licensed - *) - (*! - * Module dependencies - *) - -chai/lib/chai/utils/getMessage.js: - (*! - * Chai - message composition utility - * Copyright(c) 2012-2014 Jake Luer - * MIT Licensed - *) - (*! - * Module dependencies - *) - -chai/lib/chai/utils/transferFlags.js: - (*! - * Chai - transferFlags utility - * Copyright(c) 2012-2014 Jake Luer - * MIT Licensed - *) - -deep-eql/index.js: - (*! - * deep-eql - * Copyright(c) 2013 Jake Luer - * MIT Licensed - *) - (*! - * Check to see if the MemoizeMap has recorded a result of the two operands - * - * @param {Mixed} leftHandOperand - * @param {Mixed} rightHandOperand - * @param {MemoizeMap} memoizeMap - * @returns {Boolean|null} result - *) - (*! - * Set the result of the equality into the MemoizeMap - * - * @param {Mixed} leftHandOperand - * @param {Mixed} rightHandOperand - * @param {MemoizeMap} memoizeMap - * @param {Boolean} result - *) - (*! - * Primary Export - *) - (*! - * The main logic of the `deepEqual` function. - * - * @param {Mixed} leftHandOperand - * @param {Mixed} rightHandOperand - * @param {Object} [options] (optional) Additional options - * @param {Array} [options.comparator] (optional) Override default algorithm, determining custom equality. - * @param {Array} [options.memoize] (optional) Provide a custom memoization object which will cache the results of - complex objects for a speed boost. By passing `false` you can disable memoization, but this will cause circular - references to blow the stack. - * @return {Boolean} equal match - *) - (*! - * Compare two Regular Expressions for equality. - * - * @param {RegExp} leftHandOperand - * @param {RegExp} rightHandOperand - * @return {Boolean} result - *) - (*! - * Compare two Sets/Maps for equality. Faster than other equality functions. - * - * @param {Set} leftHandOperand - * @param {Set} rightHandOperand - * @param {Object} [options] (Optional) - * @return {Boolean} result - *) - (*! - * Simple equality for flat iterable objects such as Arrays, TypedArrays or Node.js buffers. - * - * @param {Iterable} leftHandOperand - * @param {Iterable} rightHandOperand - * @param {Object} [options] (Optional) - * @return {Boolean} result - *) - (*! - * Simple equality for generator objects such as those returned by generator functions. - * - * @param {Iterable} leftHandOperand - * @param {Iterable} rightHandOperand - * @param {Object} [options] (Optional) - * @return {Boolean} result - *) - (*! - * Determine if the given object has an @@iterator function. - * - * @param {Object} target - * @return {Boolean} `true` if the object has an @@iterator function. - *) - (*! - * Gets all iterator entries from the given Object. If the Object has no @@iterator function, returns an empty array. - * This will consume the iterator - which could have side effects depending on the @@iterator implementation. - * - * @param {Object} target - * @returns {Array} an array of entries from the @@iterator function - *) - (*! - * Gets all entries from a Generator. This will consume the generator - which could have side effects. - * - * @param {Generator} target - * @returns {Array} an array of entries from the Generator. - *) - (*! - * Gets all own and inherited enumerable keys from a target. - * - * @param {Object} target - * @returns {Array} an array of own and inherited enumerable keys from the target. - *) - (*! - * Determines if two objects have matching values, given a set of keys. Defers to deepEqual for the equality check of - * each key. If any value of the given key is not equal, the function will return false (early). - * - * @param {Mixed} leftHandOperand - * @param {Mixed} rightHandOperand - * @param {Array} keys An array of keys to compare the values of leftHandOperand and rightHandOperand against - * @param {Object} [options] (Optional) - * @return {Boolean} result - *) - (*! - * Recursively check the equality of two Objects. Once basic sameness has been established it will defer to `deepEqual` - * for each enumerable key in the object. - * - * @param {Mixed} leftHandOperand - * @param {Mixed} rightHandOperand - * @param {Object} [options] (Optional) - * @return {Boolean} result - *) - (*! - * Returns true if the argument is a primitive. - * - * This intentionally returns true for all objects that can be compared by reference, - * including functions and symbols. - * - * @param {Mixed} value - * @return {Boolean} result - *) - -chai/lib/chai/utils/isProxyEnabled.js: - (*! - * Chai - isProxyEnabled helper - * Copyright(c) 2012-2014 Jake Luer - * MIT Licensed - *) - -chai/lib/chai/utils/addProperty.js: - (*! - * Chai - addProperty utility - * Copyright(c) 2012-2014 Jake Luer - * MIT Licensed - *) - -chai/lib/chai/utils/addLengthGuard.js: - (*! - * Chai - addLengthGuard utility - * Copyright(c) 2012-2014 Jake Luer - * MIT Licensed - *) - -chai/lib/chai/utils/getProperties.js: - (*! - * Chai - getProperties utility - * Copyright(c) 2012-2014 Jake Luer - * MIT Licensed - *) - -chai/lib/chai/utils/proxify.js: - (*! - * Chai - proxify utility - * Copyright(c) 2012-2014 Jake Luer - * MIT Licensed - *) - -chai/lib/chai/utils/addMethod.js: - (*! - * Chai - addMethod utility - * Copyright(c) 2012-2014 Jake Luer - * MIT Licensed - *) - -chai/lib/chai/utils/overwriteProperty.js: - (*! - * Chai - overwriteProperty utility - * Copyright(c) 2012-2014 Jake Luer - * MIT Licensed - *) - -chai/lib/chai/utils/overwriteMethod.js: - (*! - * Chai - overwriteMethod utility - * Copyright(c) 2012-2014 Jake Luer - * MIT Licensed - *) - -chai/lib/chai/utils/addChainableMethod.js: - (*! - * Chai - addChainingMethod utility - * Copyright(c) 2012-2014 Jake Luer - * MIT Licensed - *) - (*! - * Module dependencies - *) - (*! - * Module variables - *) - -chai/lib/chai/utils/overwriteChainableMethod.js: - (*! - * Chai - overwriteChainableMethod utility - * Copyright(c) 2012-2014 Jake Luer - * MIT Licensed - *) - -chai/lib/chai/utils/compareByInspect.js: - (*! - * Chai - compareByInspect utility - * Copyright(c) 2011-2016 Jake Luer - * MIT Licensed - *) - (*! - * Module dependencies - *) - -chai/lib/chai/utils/getOwnEnumerablePropertySymbols.js: - (*! - * Chai - getOwnEnumerablePropertySymbols utility - * Copyright(c) 2011-2016 Jake Luer - * MIT Licensed - *) - -chai/lib/chai/utils/getOwnEnumerableProperties.js: - (*! - * Chai - getOwnEnumerableProperties utility - * Copyright(c) 2011-2016 Jake Luer - * MIT Licensed - *) - (*! - * Module dependencies - *) - -chai/lib/chai/utils/isNaN.js: - (*! - * Chai - isNaN utility - * Copyright(c) 2012-2015 Sakthipriyan Vairamani - * MIT Licensed - *) - -chai/lib/chai/utils/index.js: - (*! - * chai - * Copyright(c) 2011 Jake Luer - * MIT Licensed - *) - (*! - * Dependencies that are used for multiple exports are required here only once - *) - (*! - * test utility - *) - (*! - * type utility - *) - (*! - * expectTypes utility - *) - (*! - * message utility - *) - (*! - * actual utility - *) - (*! - * Inspect util - *) - (*! - * Object Display util - *) - (*! - * Flag utility - *) - (*! - * Flag transferring utility - *) - (*! - * Deep equal utility - *) - (*! - * Deep path info - *) - (*! - * Check if a property exists - *) - (*! - * Function name - *) - (*! - * add Property - *) - (*! - * add Method - *) - (*! - * overwrite Property - *) - (*! - * overwrite Method - *) - (*! - * Add a chainable method - *) - (*! - * Overwrite chainable method - *) - (*! - * Compare by inspect method - *) - (*! - * Get own enumerable property symbols method - *) - (*! - * Get own enumerable properties method - *) - (*! - * Checks error against a given set of criteria - *) - (*! - * Proxify util - *) - (*! - * addLengthGuard util - *) - (*! - * isProxyEnabled helper - *) - (*! - * isNaN method - *) - (*! - * getOperator method - *) - -chai/lib/chai/assertion.js: - (*! - * chai - * http://chaijs.com - * Copyright(c) 2011-2014 Jake Luer - * MIT Licensed - *) - (*! - * Module dependencies. - *) - (*! - * Module export. - *) - (*! - * Assertion Constructor - * - * Creates object for chaining. - * - * `Assertion` objects contain metadata in the form of flags. Three flags can - * be assigned during instantiation by passing arguments to this constructor: - * - * - `object`: This flag contains the target of the assertion. For example, in - * the assertion `expect(numKittens).to.equal(7);`, the `object` flag will - * contain `numKittens` so that the `equal` assertion can reference it when - * needed. - * - * - `message`: This flag contains an optional custom error message to be - * prepended to the error message that's generated by the assertion when it - * fails. - * - * - `ssfi`: This flag stands for "start stack function indicator". It - * contains a function reference that serves as the starting point for - * removing frames from the stack trace of the error that's created by the - * assertion when it fails. The goal is to provide a cleaner stack trace to - * end users by removing Chai's internal functions. Note that it only works - * in environments that support `Error.captureStackTrace`, and only when - * `Chai.config.includeStack` hasn't been set to `false`. - * - * - `lockSsfi`: This flag controls whether or not the given `ssfi` flag - * should retain its current value, even as assertions are chained off of - * this object. This is usually set to `true` when creating a new assertion - * from within another assertion. It's also temporarily set to `true` before - * an overwritten assertion gets called by the overwriting assertion. - * - * - `eql`: This flag contains the deepEqual function to be used by the assertion. - * - * @param {Mixed} obj target of the assertion - * @param {String} msg (optional) custom error message - * @param {Function} ssfi (optional) starting point for removing stack frames - * @param {Boolean} lockSsfi (optional) whether or not the ssfi flag is locked - * @api private - *) - (*! - * ### ._obj - * - * Quick reference to stored `actual` value for plugin developers. - * - * @api private - *) - -chai/lib/chai/core/assertions.js: - (*! - * chai - * http://chaijs.com - * Copyright(c) 2011-2014 Jake Luer - * MIT Licensed - *) - -chai/lib/chai/interface/expect.js: - (*! - * chai - * Copyright(c) 2011-2014 Jake Luer - * MIT Licensed - *) - -chai/lib/chai/interface/should.js: - (*! - * chai - * Copyright(c) 2011-2014 Jake Luer - * MIT Licensed - *) - -chai/lib/chai/interface/assert.js: - (*! - * chai - * Copyright(c) 2011-2014 Jake Luer - * MIT Licensed - *) - (*! - * Chai dependencies. - *) - (*! - * Module export. - *) - (*! - * ### .ifError(object) - * - * Asserts if value is not a false value, and throws if it is a true value. - * This is added to allow for chai to be a drop-in replacement for Node's - * assert class. - * - * var err = new Error('I am a custom error'); - * assert.ifError(err); // Rethrows err! - * - * @name ifError - * @param {Object} object - * @namespace Assert - * @api public - *) - (*! - * Aliases. - *) - -chai/lib/chai.js: - (*! - * chai - * Copyright(c) 2011-2014 Jake Luer - * MIT Licensed - *) - (*! - * Chai version - *) - (*! - * Assertion Error - *) - (*! - * Utils for plugins (not exported) - *) - (*! - * Utility Functions - *) - (*! - * Configuration - *) - (*! - * Primary `Assertion` prototype - *) - (*! - * Core Assertions - *) - (*! - * Expect interface - *) - (*! - * Should interface - *) - (*! - * Assert interface - *) -*/ diff --git a/dist/chunk-S6FS72L5.js b/dist/chunk-S6FS72L5.js deleted file mode 100644 index 2df9e2c..0000000 --- a/dist/chunk-S6FS72L5.js +++ /dev/null @@ -1,55 +0,0 @@ -import { - require_client, - require_react -} from "./chunk-YI7SC5VN.js"; -import { - __toESM -} from "./chunk-4ATCX2XT.js"; - -// src/ClassicalComponent.tsx -var import_react = __toESM(require_react()); -var import_client = __toESM(require_client()); -var ClassicalComponent = class extends import_react.default.Component { - constructor(props) { - super(props); - this.state = { - count: 0 - }; - } - // componentDidMount() { - // console.info("componentDidMount"); - // // const x = fetch("http://www.google.com") - // // .then((response) => response.text()) - // // .then(x => { - // // console.warn("i am a genius", x) - // // }); - // // console.info("x", x); - // // const y = fetch("http://www.google.com/", { mode: `no-cors` }) - // // // .then((response) => response.text()) - // // .then(x => { - // // console.log("i am a genius!") - // // }); - // // console.info(y); - // } - render() { - return /* @__PURE__ */ import_react.default.createElement("div", { style: { border: "3px solid green" } }, /* @__PURE__ */ import_react.default.createElement("h1", null, "Hello Marcus"), /* @__PURE__ */ import_react.default.createElement("pre", { id: "theProps" }, JSON.stringify(this.props)), /* @__PURE__ */ import_react.default.createElement("p", null, "foo: ", this.props.foo), /* @__PURE__ */ import_react.default.createElement("pre", { id: "theState" }, JSON.stringify(this.state)), /* @__PURE__ */ import_react.default.createElement("p", null, "count: ", this.state.count, " times"), /* @__PURE__ */ import_react.default.createElement("button", { id: "theButton", onClick: async () => { - this.setState({ count: this.state.count + 1 }); - } }, "Click")); - } -}; -var LaunchClassicalComponent = () => { - document.addEventListener("DOMContentLoaded", function() { - const elem = document.getElementById("root"); - if (elem) { - console.log("DOMContentLoaded and root found", ClassicalComponent); - import_client.default.createRoot(elem).render(import_react.default.createElement(ClassicalComponent)); - } - }); -}; -var ClassicalComponent_default = LaunchClassicalComponent; - -export { - ClassicalComponent, - LaunchClassicalComponent, - ClassicalComponent_default -}; diff --git a/dist/chunk-YI7SC5VN.js b/dist/chunk-YI7SC5VN.js deleted file mode 100644 index 73fe8d2..0000000 --- a/dist/chunk-YI7SC5VN.js +++ /dev/null @@ -1,23539 +0,0 @@ -import { - __commonJS -} from "./chunk-4ATCX2XT.js"; - -// node_modules/react/cjs/react.development.js -var require_react_development = __commonJS({ - "node_modules/react/cjs/react.development.js"(exports, module) { - "use strict"; - if (true) { - (function() { - "use strict"; - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") { - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); - } - var ReactVersion = "18.2.0"; - var REACT_ELEMENT_TYPE = Symbol.for("react.element"); - var REACT_PORTAL_TYPE = Symbol.for("react.portal"); - var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); - var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); - var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); - var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); - var REACT_CONTEXT_TYPE = Symbol.for("react.context"); - var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); - var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); - var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); - var REACT_MEMO_TYPE = Symbol.for("react.memo"); - var REACT_LAZY_TYPE = Symbol.for("react.lazy"); - var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); - var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = "@@iterator"; - function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== "object") { - return null; - } - var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - if (typeof maybeIterator === "function") { - return maybeIterator; - } - return null; - } - var ReactCurrentDispatcher = { - /** - * @internal - * @type {ReactComponent} - */ - current: null - }; - var ReactCurrentBatchConfig = { - transition: null - }; - var ReactCurrentActQueue = { - current: null, - // Used to reproduce behavior of `batchedUpdates` in legacy mode. - isBatchingLegacy: false, - didScheduleLegacyUpdate: false - }; - var ReactCurrentOwner = { - /** - * @internal - * @type {ReactComponent} - */ - current: null - }; - var ReactDebugCurrentFrame = {}; - var currentExtraStackFrame = null; - function setExtraStackFrame(stack) { - { - currentExtraStackFrame = stack; - } - } - { - ReactDebugCurrentFrame.setExtraStackFrame = function(stack) { - { - currentExtraStackFrame = stack; - } - }; - ReactDebugCurrentFrame.getCurrentStack = null; - ReactDebugCurrentFrame.getStackAddendum = function() { - var stack = ""; - if (currentExtraStackFrame) { - stack += currentExtraStackFrame; - } - var impl = ReactDebugCurrentFrame.getCurrentStack; - if (impl) { - stack += impl() || ""; - } - return stack; - }; - } - var enableScopeAPI = false; - var enableCacheElement = false; - var enableTransitionTracing = false; - var enableLegacyHidden = false; - var enableDebugTracing = false; - var ReactSharedInternals = { - ReactCurrentDispatcher, - ReactCurrentBatchConfig, - ReactCurrentOwner - }; - { - ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame; - ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue; - } - function warn(format) { - { - { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - printWarning("warn", format, args); - } - } - } - function error(format) { - { - { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - printWarning("error", format, args); - } - } - } - function printWarning(level, format, args) { - { - var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame2.getStackAddendum(); - if (stack !== "") { - format += "%s"; - args = args.concat([stack]); - } - var argsWithFormat = args.map(function(item) { - return String(item); - }); - argsWithFormat.unshift("Warning: " + format); - Function.prototype.apply.call(console[level], console, argsWithFormat); - } - } - var didWarnStateUpdateForUnmountedComponent = {}; - function warnNoop(publicInstance, callerName) { - { - var _constructor = publicInstance.constructor; - var componentName = _constructor && (_constructor.displayName || _constructor.name) || "ReactClass"; - var warningKey = componentName + "." + callerName; - if (didWarnStateUpdateForUnmountedComponent[warningKey]) { - return; - } - error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, componentName); - didWarnStateUpdateForUnmountedComponent[warningKey] = true; - } - } - var ReactNoopUpdateQueue = { - /** - * Checks whether or not this composite component is mounted. - * @param {ReactClass} publicInstance The instance we want to test. - * @return {boolean} True if mounted, false otherwise. - * @protected - * @final - */ - isMounted: function(publicInstance) { - return false; - }, - /** - * Forces an update. This should only be invoked when it is known with - * certainty that we are **not** in a DOM transaction. - * - * You may want to call this when you know that some deeper aspect of the - * component's state has changed but `setState` was not called. - * - * This will not invoke `shouldComponentUpdate`, but it will invoke - * `componentWillUpdate` and `componentDidUpdate`. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @param {?function} callback Called after component is updated. - * @param {?string} callerName name of the calling function in the public API. - * @internal - */ - enqueueForceUpdate: function(publicInstance, callback, callerName) { - warnNoop(publicInstance, "forceUpdate"); - }, - /** - * Replaces all of the state. Always use this or `setState` to mutate state. - * You should treat `this.state` as immutable. - * - * There is no guarantee that `this.state` will be immediately updated, so - * accessing `this.state` after calling this method may return the old value. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @param {object} completeState Next state. - * @param {?function} callback Called after component is updated. - * @param {?string} callerName name of the calling function in the public API. - * @internal - */ - enqueueReplaceState: function(publicInstance, completeState, callback, callerName) { - warnNoop(publicInstance, "replaceState"); - }, - /** - * Sets a subset of the state. This only exists because _pendingState is - * internal. This provides a merging strategy that is not available to deep - * properties which is confusing. TODO: Expose pendingState or don't use it - * during the merge. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @param {object} partialState Next partial state to be merged with state. - * @param {?function} callback Called after component is updated. - * @param {?string} Name of the calling function in the public API. - * @internal - */ - enqueueSetState: function(publicInstance, partialState, callback, callerName) { - warnNoop(publicInstance, "setState"); - } - }; - var assign = Object.assign; - var emptyObject = {}; - { - Object.freeze(emptyObject); - } - function Component(props, context, updater) { - this.props = props; - this.context = context; - this.refs = emptyObject; - this.updater = updater || ReactNoopUpdateQueue; - } - Component.prototype.isReactComponent = {}; - Component.prototype.setState = function(partialState, callback) { - if (typeof partialState !== "object" && typeof partialState !== "function" && partialState != null) { - throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); - } - this.updater.enqueueSetState(this, partialState, callback, "setState"); - }; - Component.prototype.forceUpdate = function(callback) { - this.updater.enqueueForceUpdate(this, callback, "forceUpdate"); - }; - { - var deprecatedAPIs = { - isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."], - replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."] - }; - var defineDeprecationWarning = function(methodName, info) { - Object.defineProperty(Component.prototype, methodName, { - get: function() { - warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]); - return void 0; - } - }); - }; - for (var fnName in deprecatedAPIs) { - if (deprecatedAPIs.hasOwnProperty(fnName)) { - defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); - } - } - } - function ComponentDummy() { - } - ComponentDummy.prototype = Component.prototype; - function PureComponent(props, context, updater) { - this.props = props; - this.context = context; - this.refs = emptyObject; - this.updater = updater || ReactNoopUpdateQueue; - } - var pureComponentPrototype = PureComponent.prototype = new ComponentDummy(); - pureComponentPrototype.constructor = PureComponent; - assign(pureComponentPrototype, Component.prototype); - pureComponentPrototype.isPureReactComponent = true; - function createRef() { - var refObject = { - current: null - }; - { - Object.seal(refObject); - } - return refObject; - } - var isArrayImpl = Array.isArray; - function isArray(a) { - return isArrayImpl(a); - } - function typeName(value) { - { - var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag; - var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; - return type; - } - } - function willCoercionThrow(value) { - { - try { - testStringCoercion(value); - return false; - } catch (e) { - return true; - } - } - } - function testStringCoercion(value) { - return "" + value; - } - function checkKeyStringCoercion(value) { - { - if (willCoercionThrow(value)) { - error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value)); - return testStringCoercion(value); - } - } - } - function getWrappedName(outerType, innerType, wrapperName) { - var displayName = outerType.displayName; - if (displayName) { - return displayName; - } - var functionName = innerType.displayName || innerType.name || ""; - return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName; - } - function getContextName(type) { - return type.displayName || "Context"; - } - function getComponentNameFromType(type) { - if (type == null) { - return null; - } - { - if (typeof type.tag === "number") { - error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."); - } - } - if (typeof type === "function") { - return type.displayName || type.name || null; - } - if (typeof type === "string") { - return type; - } - switch (type) { - case REACT_FRAGMENT_TYPE: - return "Fragment"; - case REACT_PORTAL_TYPE: - return "Portal"; - case REACT_PROFILER_TYPE: - return "Profiler"; - case REACT_STRICT_MODE_TYPE: - return "StrictMode"; - case REACT_SUSPENSE_TYPE: - return "Suspense"; - case REACT_SUSPENSE_LIST_TYPE: - return "SuspenseList"; - } - if (typeof type === "object") { - switch (type.$$typeof) { - case REACT_CONTEXT_TYPE: - var context = type; - return getContextName(context) + ".Consumer"; - case REACT_PROVIDER_TYPE: - var provider = type; - return getContextName(provider._context) + ".Provider"; - case REACT_FORWARD_REF_TYPE: - return getWrappedName(type, type.render, "ForwardRef"); - case REACT_MEMO_TYPE: - var outerName = type.displayName || null; - if (outerName !== null) { - return outerName; - } - return getComponentNameFromType(type.type) || "Memo"; - case REACT_LAZY_TYPE: { - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - try { - return getComponentNameFromType(init(payload)); - } catch (x) { - return null; - } - } - } - } - return null; - } - var hasOwnProperty = Object.prototype.hasOwnProperty; - var RESERVED_PROPS = { - key: true, - ref: true, - __self: true, - __source: true - }; - var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs; - { - didWarnAboutStringRefs = {}; - } - function hasValidRef(config) { - { - if (hasOwnProperty.call(config, "ref")) { - var getter = Object.getOwnPropertyDescriptor(config, "ref").get; - if (getter && getter.isReactWarning) { - return false; - } - } - } - return config.ref !== void 0; - } - function hasValidKey(config) { - { - if (hasOwnProperty.call(config, "key")) { - var getter = Object.getOwnPropertyDescriptor(config, "key").get; - if (getter && getter.isReactWarning) { - return false; - } - } - } - return config.key !== void 0; - } - function defineKeyPropWarningGetter(props, displayName) { - var warnAboutAccessingKey = function() { - { - if (!specialPropKeyWarningShown) { - specialPropKeyWarningShown = true; - error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName); - } - } - }; - warnAboutAccessingKey.isReactWarning = true; - Object.defineProperty(props, "key", { - get: warnAboutAccessingKey, - configurable: true - }); - } - function defineRefPropWarningGetter(props, displayName) { - var warnAboutAccessingRef = function() { - { - if (!specialPropRefWarningShown) { - specialPropRefWarningShown = true; - error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName); - } - } - }; - warnAboutAccessingRef.isReactWarning = true; - Object.defineProperty(props, "ref", { - get: warnAboutAccessingRef, - configurable: true - }); - } - function warnIfStringRefCannotBeAutoConverted(config) { - { - if (typeof config.ref === "string" && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) { - var componentName = getComponentNameFromType(ReactCurrentOwner.current.type); - if (!didWarnAboutStringRefs[componentName]) { - error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref); - didWarnAboutStringRefs[componentName] = true; - } - } - } - } - var ReactElement = function(type, key, ref, self, source, owner, props) { - var element = { - // This tag allows us to uniquely identify this as a React Element - $$typeof: REACT_ELEMENT_TYPE, - // Built-in properties that belong on the element - type, - key, - ref, - props, - // Record the component responsible for creating this element. - _owner: owner - }; - { - element._store = {}; - Object.defineProperty(element._store, "validated", { - configurable: false, - enumerable: false, - writable: true, - value: false - }); - Object.defineProperty(element, "_self", { - configurable: false, - enumerable: false, - writable: false, - value: self - }); - Object.defineProperty(element, "_source", { - configurable: false, - enumerable: false, - writable: false, - value: source - }); - if (Object.freeze) { - Object.freeze(element.props); - Object.freeze(element); - } - } - return element; - }; - function createElement(type, config, children) { - var propName; - var props = {}; - var key = null; - var ref = null; - var self = null; - var source = null; - if (config != null) { - if (hasValidRef(config)) { - ref = config.ref; - { - warnIfStringRefCannotBeAutoConverted(config); - } - } - if (hasValidKey(config)) { - { - checkKeyStringCoercion(config.key); - } - key = "" + config.key; - } - self = config.__self === void 0 ? null : config.__self; - source = config.__source === void 0 ? null : config.__source; - for (propName in config) { - if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { - props[propName] = config[propName]; - } - } - } - var childrenLength = arguments.length - 2; - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = Array(childrenLength); - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 2]; - } - { - if (Object.freeze) { - Object.freeze(childArray); - } - } - props.children = childArray; - } - if (type && type.defaultProps) { - var defaultProps = type.defaultProps; - for (propName in defaultProps) { - if (props[propName] === void 0) { - props[propName] = defaultProps[propName]; - } - } - } - { - if (key || ref) { - var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type; - if (key) { - defineKeyPropWarningGetter(props, displayName); - } - if (ref) { - defineRefPropWarningGetter(props, displayName); - } - } - } - return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); - } - function cloneAndReplaceKey(oldElement, newKey) { - var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); - return newElement; - } - function cloneElement(element, config, children) { - if (element === null || element === void 0) { - throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + "."); - } - var propName; - var props = assign({}, element.props); - var key = element.key; - var ref = element.ref; - var self = element._self; - var source = element._source; - var owner = element._owner; - if (config != null) { - if (hasValidRef(config)) { - ref = config.ref; - owner = ReactCurrentOwner.current; - } - if (hasValidKey(config)) { - { - checkKeyStringCoercion(config.key); - } - key = "" + config.key; - } - var defaultProps; - if (element.type && element.type.defaultProps) { - defaultProps = element.type.defaultProps; - } - for (propName in config) { - if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { - if (config[propName] === void 0 && defaultProps !== void 0) { - props[propName] = defaultProps[propName]; - } else { - props[propName] = config[propName]; - } - } - } - } - var childrenLength = arguments.length - 2; - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = Array(childrenLength); - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 2]; - } - props.children = childArray; - } - return ReactElement(element.type, key, ref, self, source, owner, props); - } - function isValidElement(object) { - return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; - } - var SEPARATOR = "."; - var SUBSEPARATOR = ":"; - function escape(key) { - var escapeRegex = /[=:]/g; - var escaperLookup = { - "=": "=0", - ":": "=2" - }; - var escapedString = key.replace(escapeRegex, function(match) { - return escaperLookup[match]; - }); - return "$" + escapedString; - } - var didWarnAboutMaps = false; - var userProvidedKeyEscapeRegex = /\/+/g; - function escapeUserProvidedKey(text) { - return text.replace(userProvidedKeyEscapeRegex, "$&/"); - } - function getElementKey(element, index) { - if (typeof element === "object" && element !== null && element.key != null) { - { - checkKeyStringCoercion(element.key); - } - return escape("" + element.key); - } - return index.toString(36); - } - function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { - var type = typeof children; - if (type === "undefined" || type === "boolean") { - children = null; - } - var invokeCallback = false; - if (children === null) { - invokeCallback = true; - } else { - switch (type) { - case "string": - case "number": - invokeCallback = true; - break; - case "object": - switch (children.$$typeof) { - case REACT_ELEMENT_TYPE: - case REACT_PORTAL_TYPE: - invokeCallback = true; - } - } - } - if (invokeCallback) { - var _child = children; - var mappedChild = callback(_child); - var childKey = nameSoFar === "" ? SEPARATOR + getElementKey(_child, 0) : nameSoFar; - if (isArray(mappedChild)) { - var escapedChildKey = ""; - if (childKey != null) { - escapedChildKey = escapeUserProvidedKey(childKey) + "/"; - } - mapIntoArray(mappedChild, array, escapedChildKey, "", function(c) { - return c; - }); - } else if (mappedChild != null) { - if (isValidElement(mappedChild)) { - { - if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) { - checkKeyStringCoercion(mappedChild.key); - } - } - mappedChild = cloneAndReplaceKey( - mappedChild, - // Keep both the (mapped) and old keys if they differ, just as - // traverseAllChildren used to do for objects as children - escapedPrefix + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key - (mappedChild.key && (!_child || _child.key !== mappedChild.key) ? ( - // $FlowFixMe Flow incorrectly thinks existing element's key can be a number - // eslint-disable-next-line react-internal/safe-string-coercion - escapeUserProvidedKey("" + mappedChild.key) + "/" - ) : "") + childKey - ); - } - array.push(mappedChild); - } - return 1; - } - var child; - var nextName; - var subtreeCount = 0; - var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR; - if (isArray(children)) { - for (var i = 0; i < children.length; i++) { - child = children[i]; - nextName = nextNamePrefix + getElementKey(child, i); - subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); - } - } else { - var iteratorFn = getIteratorFn(children); - if (typeof iteratorFn === "function") { - var iterableChildren = children; - { - if (iteratorFn === iterableChildren.entries) { - if (!didWarnAboutMaps) { - warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."); - } - didWarnAboutMaps = true; - } - } - var iterator = iteratorFn.call(iterableChildren); - var step; - var ii = 0; - while (!(step = iterator.next()).done) { - child = step.value; - nextName = nextNamePrefix + getElementKey(child, ii++); - subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); - } - } else if (type === "object") { - var childrenString = String(children); - throw new Error("Objects are not valid as a React child (found: " + (childrenString === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString) + "). If you meant to render a collection of children, use an array instead."); - } - } - return subtreeCount; - } - function mapChildren(children, func, context) { - if (children == null) { - return children; - } - var result = []; - var count = 0; - mapIntoArray(children, result, "", "", function(child) { - return func.call(context, child, count++); - }); - return result; - } - function countChildren(children) { - var n = 0; - mapChildren(children, function() { - n++; - }); - return n; - } - function forEachChildren(children, forEachFunc, forEachContext) { - mapChildren(children, function() { - forEachFunc.apply(this, arguments); - }, forEachContext); - } - function toArray(children) { - return mapChildren(children, function(child) { - return child; - }) || []; - } - function onlyChild(children) { - if (!isValidElement(children)) { - throw new Error("React.Children.only expected to receive a single React element child."); - } - return children; - } - function createContext(defaultValue) { - var context = { - $$typeof: REACT_CONTEXT_TYPE, - // As a workaround to support multiple concurrent renderers, we categorize - // some renderers as primary and others as secondary. We only expect - // there to be two concurrent renderers at most: React Native (primary) and - // Fabric (secondary); React DOM (primary) and React ART (secondary). - // Secondary renderers store their context values on separate fields. - _currentValue: defaultValue, - _currentValue2: defaultValue, - // Used to track how many concurrent renderers this context currently - // supports within in a single renderer. Such as parallel server rendering. - _threadCount: 0, - // These are circular - Provider: null, - Consumer: null, - // Add these to use same hidden class in VM as ServerContext - _defaultValue: null, - _globalName: null - }; - context.Provider = { - $$typeof: REACT_PROVIDER_TYPE, - _context: context - }; - var hasWarnedAboutUsingNestedContextConsumers = false; - var hasWarnedAboutUsingConsumerProvider = false; - var hasWarnedAboutDisplayNameOnConsumer = false; - { - var Consumer = { - $$typeof: REACT_CONTEXT_TYPE, - _context: context - }; - Object.defineProperties(Consumer, { - Provider: { - get: function() { - if (!hasWarnedAboutUsingConsumerProvider) { - hasWarnedAboutUsingConsumerProvider = true; - error("Rendering is not supported and will be removed in a future major release. Did you mean to render instead?"); - } - return context.Provider; - }, - set: function(_Provider) { - context.Provider = _Provider; - } - }, - _currentValue: { - get: function() { - return context._currentValue; - }, - set: function(_currentValue) { - context._currentValue = _currentValue; - } - }, - _currentValue2: { - get: function() { - return context._currentValue2; - }, - set: function(_currentValue2) { - context._currentValue2 = _currentValue2; - } - }, - _threadCount: { - get: function() { - return context._threadCount; - }, - set: function(_threadCount) { - context._threadCount = _threadCount; - } - }, - Consumer: { - get: function() { - if (!hasWarnedAboutUsingNestedContextConsumers) { - hasWarnedAboutUsingNestedContextConsumers = true; - error("Rendering is not supported and will be removed in a future major release. Did you mean to render instead?"); - } - return context.Consumer; - } - }, - displayName: { - get: function() { - return context.displayName; - }, - set: function(displayName) { - if (!hasWarnedAboutDisplayNameOnConsumer) { - warn("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", displayName); - hasWarnedAboutDisplayNameOnConsumer = true; - } - } - } - }); - context.Consumer = Consumer; - } - { - context._currentRenderer = null; - context._currentRenderer2 = null; - } - return context; - } - var Uninitialized = -1; - var Pending = 0; - var Resolved = 1; - var Rejected = 2; - function lazyInitializer(payload) { - if (payload._status === Uninitialized) { - var ctor = payload._result; - var thenable = ctor(); - thenable.then(function(moduleObject2) { - if (payload._status === Pending || payload._status === Uninitialized) { - var resolved = payload; - resolved._status = Resolved; - resolved._result = moduleObject2; - } - }, function(error2) { - if (payload._status === Pending || payload._status === Uninitialized) { - var rejected = payload; - rejected._status = Rejected; - rejected._result = error2; - } - }); - if (payload._status === Uninitialized) { - var pending = payload; - pending._status = Pending; - pending._result = thenable; - } - } - if (payload._status === Resolved) { - var moduleObject = payload._result; - { - if (moduleObject === void 0) { - error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", moduleObject); - } - } - { - if (!("default" in moduleObject)) { - error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", moduleObject); - } - } - return moduleObject.default; - } else { - throw payload._result; - } - } - function lazy(ctor) { - var payload = { - // We use these fields to store the result. - _status: Uninitialized, - _result: ctor - }; - var lazyType = { - $$typeof: REACT_LAZY_TYPE, - _payload: payload, - _init: lazyInitializer - }; - { - var defaultProps; - var propTypes; - Object.defineProperties(lazyType, { - defaultProps: { - configurable: true, - get: function() { - return defaultProps; - }, - set: function(newDefaultProps) { - error("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."); - defaultProps = newDefaultProps; - Object.defineProperty(lazyType, "defaultProps", { - enumerable: true - }); - } - }, - propTypes: { - configurable: true, - get: function() { - return propTypes; - }, - set: function(newPropTypes) { - error("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."); - propTypes = newPropTypes; - Object.defineProperty(lazyType, "propTypes", { - enumerable: true - }); - } - } - }); - } - return lazyType; - } - function forwardRef(render) { - { - if (render != null && render.$$typeof === REACT_MEMO_TYPE) { - error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."); - } else if (typeof render !== "function") { - error("forwardRef requires a render function but was given %s.", render === null ? "null" : typeof render); - } else { - if (render.length !== 0 && render.length !== 2) { - error("forwardRef render functions accept exactly two parameters: props and ref. %s", render.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."); - } - } - if (render != null) { - if (render.defaultProps != null || render.propTypes != null) { - error("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"); - } - } - } - var elementType = { - $$typeof: REACT_FORWARD_REF_TYPE, - render - }; - { - var ownName; - Object.defineProperty(elementType, "displayName", { - enumerable: false, - configurable: true, - get: function() { - return ownName; - }, - set: function(name) { - ownName = name; - if (!render.name && !render.displayName) { - render.displayName = name; - } - } - }); - } - return elementType; - } - var REACT_MODULE_REFERENCE; - { - REACT_MODULE_REFERENCE = Symbol.for("react.module.reference"); - } - function isValidElementType(type) { - if (typeof type === "string" || typeof type === "function") { - return true; - } - if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) { - return true; - } - if (typeof type === "object" && type !== null) { - if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object - // types supported by any Flight configuration anywhere since - // we don't know which Flight build this will end up being used - // with. - type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) { - return true; - } - } - return false; - } - function memo(type, compare) { - { - if (!isValidElementType(type)) { - error("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type); - } - } - var elementType = { - $$typeof: REACT_MEMO_TYPE, - type, - compare: compare === void 0 ? null : compare - }; - { - var ownName; - Object.defineProperty(elementType, "displayName", { - enumerable: false, - configurable: true, - get: function() { - return ownName; - }, - set: function(name) { - ownName = name; - if (!type.name && !type.displayName) { - type.displayName = name; - } - } - }); - } - return elementType; - } - function resolveDispatcher() { - var dispatcher = ReactCurrentDispatcher.current; - { - if (dispatcher === null) { - error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."); - } - } - return dispatcher; - } - function useContext(Context) { - var dispatcher = resolveDispatcher(); - { - if (Context._context !== void 0) { - var realContext = Context._context; - if (realContext.Consumer === Context) { - error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"); - } else if (realContext.Provider === Context) { - error("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?"); - } - } - } - return dispatcher.useContext(Context); - } - function useState(initialState) { - var dispatcher = resolveDispatcher(); - return dispatcher.useState(initialState); - } - function useReducer(reducer, initialArg, init) { - var dispatcher = resolveDispatcher(); - return dispatcher.useReducer(reducer, initialArg, init); - } - function useRef(initialValue) { - var dispatcher = resolveDispatcher(); - return dispatcher.useRef(initialValue); - } - function useEffect(create, deps) { - var dispatcher = resolveDispatcher(); - return dispatcher.useEffect(create, deps); - } - function useInsertionEffect(create, deps) { - var dispatcher = resolveDispatcher(); - return dispatcher.useInsertionEffect(create, deps); - } - function useLayoutEffect(create, deps) { - var dispatcher = resolveDispatcher(); - return dispatcher.useLayoutEffect(create, deps); - } - function useCallback(callback, deps) { - var dispatcher = resolveDispatcher(); - return dispatcher.useCallback(callback, deps); - } - function useMemo(create, deps) { - var dispatcher = resolveDispatcher(); - return dispatcher.useMemo(create, deps); - } - function useImperativeHandle(ref, create, deps) { - var dispatcher = resolveDispatcher(); - return dispatcher.useImperativeHandle(ref, create, deps); - } - function useDebugValue(value, formatterFn) { - { - var dispatcher = resolveDispatcher(); - return dispatcher.useDebugValue(value, formatterFn); - } - } - function useTransition() { - var dispatcher = resolveDispatcher(); - return dispatcher.useTransition(); - } - function useDeferredValue(value) { - var dispatcher = resolveDispatcher(); - return dispatcher.useDeferredValue(value); - } - function useId() { - var dispatcher = resolveDispatcher(); - return dispatcher.useId(); - } - function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { - var dispatcher = resolveDispatcher(); - return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); - } - var disabledDepth = 0; - var prevLog; - var prevInfo; - var prevWarn; - var prevError; - var prevGroup; - var prevGroupCollapsed; - var prevGroupEnd; - function disabledLog() { - } - disabledLog.__reactDisabledLog = true; - function disableLogs() { - { - if (disabledDepth === 0) { - prevLog = console.log; - prevInfo = console.info; - prevWarn = console.warn; - prevError = console.error; - prevGroup = console.group; - prevGroupCollapsed = console.groupCollapsed; - prevGroupEnd = console.groupEnd; - var props = { - configurable: true, - enumerable: true, - value: disabledLog, - writable: true - }; - Object.defineProperties(console, { - info: props, - log: props, - warn: props, - error: props, - group: props, - groupCollapsed: props, - groupEnd: props - }); - } - disabledDepth++; - } - } - function reenableLogs() { - { - disabledDepth--; - if (disabledDepth === 0) { - var props = { - configurable: true, - enumerable: true, - writable: true - }; - Object.defineProperties(console, { - log: assign({}, props, { - value: prevLog - }), - info: assign({}, props, { - value: prevInfo - }), - warn: assign({}, props, { - value: prevWarn - }), - error: assign({}, props, { - value: prevError - }), - group: assign({}, props, { - value: prevGroup - }), - groupCollapsed: assign({}, props, { - value: prevGroupCollapsed - }), - groupEnd: assign({}, props, { - value: prevGroupEnd - }) - }); - } - if (disabledDepth < 0) { - error("disabledDepth fell below zero. This is a bug in React. Please file an issue."); - } - } - } - var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher; - var prefix; - function describeBuiltInComponentFrame(name, source, ownerFn) { - { - if (prefix === void 0) { - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = match && match[1] || ""; - } - } - return "\n" + prefix + name; - } - } - var reentry = false; - var componentFrameCache; - { - var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map; - componentFrameCache = new PossiblyWeakMap(); - } - function describeNativeComponentFrame(fn, construct) { - if (!fn || reentry) { - return ""; - } - { - var frame = componentFrameCache.get(fn); - if (frame !== void 0) { - return frame; - } - } - var control; - reentry = true; - var previousPrepareStackTrace = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - var previousDispatcher; - { - previousDispatcher = ReactCurrentDispatcher$1.current; - ReactCurrentDispatcher$1.current = null; - disableLogs(); - } - try { - if (construct) { - var Fake = function() { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function() { - throw Error(); - } - }); - if (typeof Reflect === "object" && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - control = x; - } - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x) { - control = x; - } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x) { - control = x; - } - fn(); - } - } catch (sample) { - if (sample && control && typeof sample.stack === "string") { - var sampleLines = sample.stack.split("\n"); - var controlLines = control.stack.split("\n"); - var s = sampleLines.length - 1; - var c = controlLines.length - 1; - while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { - c--; - } - for (; s >= 1 && c >= 0; s--, c--) { - if (sampleLines[s] !== controlLines[c]) { - if (s !== 1 || c !== 1) { - do { - s--; - c--; - if (c < 0 || sampleLines[s] !== controlLines[c]) { - var _frame = "\n" + sampleLines[s].replace(" at new ", " at "); - if (fn.displayName && _frame.includes("")) { - _frame = _frame.replace("", fn.displayName); - } - { - if (typeof fn === "function") { - componentFrameCache.set(fn, _frame); - } - } - return _frame; - } - } while (s >= 1 && c >= 0); - } - break; - } - } - } - } finally { - reentry = false; - { - ReactCurrentDispatcher$1.current = previousDispatcher; - reenableLogs(); - } - Error.prepareStackTrace = previousPrepareStackTrace; - } - var name = fn ? fn.displayName || fn.name : ""; - var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; - { - if (typeof fn === "function") { - componentFrameCache.set(fn, syntheticFrame); - } - } - return syntheticFrame; - } - function describeFunctionComponentFrame(fn, source, ownerFn) { - { - return describeNativeComponentFrame(fn, false); - } - } - function shouldConstruct(Component2) { - var prototype = Component2.prototype; - return !!(prototype && prototype.isReactComponent); - } - function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { - if (type == null) { - return ""; - } - if (typeof type === "function") { - { - return describeNativeComponentFrame(type, shouldConstruct(type)); - } - } - if (typeof type === "string") { - return describeBuiltInComponentFrame(type); - } - switch (type) { - case REACT_SUSPENSE_TYPE: - return describeBuiltInComponentFrame("Suspense"); - case REACT_SUSPENSE_LIST_TYPE: - return describeBuiltInComponentFrame("SuspenseList"); - } - if (typeof type === "object") { - switch (type.$$typeof) { - case REACT_FORWARD_REF_TYPE: - return describeFunctionComponentFrame(type.render); - case REACT_MEMO_TYPE: - return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); - case REACT_LAZY_TYPE: { - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - try { - return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); - } catch (x) { - } - } - } - } - return ""; - } - var loggedTypeFailures = {}; - var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; - function setCurrentlyValidatingElement(element) { - { - if (element) { - var owner = element._owner; - var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); - ReactDebugCurrentFrame$1.setExtraStackFrame(stack); - } else { - ReactDebugCurrentFrame$1.setExtraStackFrame(null); - } - } - } - function checkPropTypes(typeSpecs, values, location, componentName, element) { - { - var has = Function.call.bind(hasOwnProperty); - for (var typeSpecName in typeSpecs) { - if (has(typeSpecs, typeSpecName)) { - var error$1 = void 0; - try { - if (typeof typeSpecs[typeSpecName] !== "function") { - var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); - err.name = "Invariant Violation"; - throw err; - } - error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); - } catch (ex) { - error$1 = ex; - } - if (error$1 && !(error$1 instanceof Error)) { - setCurrentlyValidatingElement(element); - error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1); - setCurrentlyValidatingElement(null); - } - if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { - loggedTypeFailures[error$1.message] = true; - setCurrentlyValidatingElement(element); - error("Failed %s type: %s", location, error$1.message); - setCurrentlyValidatingElement(null); - } - } - } - } - } - function setCurrentlyValidatingElement$1(element) { - { - if (element) { - var owner = element._owner; - var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); - setExtraStackFrame(stack); - } else { - setExtraStackFrame(null); - } - } - } - var propTypesMisspellWarningShown; - { - propTypesMisspellWarningShown = false; - } - function getDeclarationErrorAddendum() { - if (ReactCurrentOwner.current) { - var name = getComponentNameFromType(ReactCurrentOwner.current.type); - if (name) { - return "\n\nCheck the render method of `" + name + "`."; - } - } - return ""; - } - function getSourceInfoErrorAddendum(source) { - if (source !== void 0) { - var fileName = source.fileName.replace(/^.*[\\\/]/, ""); - var lineNumber = source.lineNumber; - return "\n\nCheck your code at " + fileName + ":" + lineNumber + "."; - } - return ""; - } - function getSourceInfoErrorAddendumForProps(elementProps) { - if (elementProps !== null && elementProps !== void 0) { - return getSourceInfoErrorAddendum(elementProps.__source); - } - return ""; - } - var ownerHasKeyUseWarning = {}; - function getCurrentComponentErrorInfo(parentType) { - var info = getDeclarationErrorAddendum(); - if (!info) { - var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name; - if (parentName) { - info = "\n\nCheck the top-level render call using <" + parentName + ">."; - } - } - return info; - } - function validateExplicitKey(element, parentType) { - if (!element._store || element._store.validated || element.key != null) { - return; - } - element._store.validated = true; - var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); - if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { - return; - } - ownerHasKeyUseWarning[currentComponentErrorInfo] = true; - var childOwner = ""; - if (element && element._owner && element._owner !== ReactCurrentOwner.current) { - childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + "."; - } - { - setCurrentlyValidatingElement$1(element); - error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); - setCurrentlyValidatingElement$1(null); - } - } - function validateChildKeys(node, parentType) { - if (typeof node !== "object") { - return; - } - if (isArray(node)) { - for (var i = 0; i < node.length; i++) { - var child = node[i]; - if (isValidElement(child)) { - validateExplicitKey(child, parentType); - } - } - } else if (isValidElement(node)) { - if (node._store) { - node._store.validated = true; - } - } else if (node) { - var iteratorFn = getIteratorFn(node); - if (typeof iteratorFn === "function") { - if (iteratorFn !== node.entries) { - var iterator = iteratorFn.call(node); - var step; - while (!(step = iterator.next()).done) { - if (isValidElement(step.value)) { - validateExplicitKey(step.value, parentType); - } - } - } - } - } - } - function validatePropTypes(element) { - { - var type = element.type; - if (type === null || type === void 0 || typeof type === "string") { - return; - } - var propTypes; - if (typeof type === "function") { - propTypes = type.propTypes; - } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. - // Inner props are checked in the reconciler. - type.$$typeof === REACT_MEMO_TYPE)) { - propTypes = type.propTypes; - } else { - return; - } - if (propTypes) { - var name = getComponentNameFromType(type); - checkPropTypes(propTypes, element.props, "prop", name, element); - } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) { - propTypesMisspellWarningShown = true; - var _name = getComponentNameFromType(type); - error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown"); - } - if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) { - error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); - } - } - } - function validateFragmentProps(fragment) { - { - var keys = Object.keys(fragment.props); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key !== "children" && key !== "key") { - setCurrentlyValidatingElement$1(fragment); - error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key); - setCurrentlyValidatingElement$1(null); - break; - } - } - if (fragment.ref !== null) { - setCurrentlyValidatingElement$1(fragment); - error("Invalid attribute `ref` supplied to `React.Fragment`."); - setCurrentlyValidatingElement$1(null); - } - } - } - function createElementWithValidation(type, props, children) { - var validType = isValidElementType(type); - if (!validType) { - var info = ""; - if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) { - info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; - } - var sourceInfo = getSourceInfoErrorAddendumForProps(props); - if (sourceInfo) { - info += sourceInfo; - } else { - info += getDeclarationErrorAddendum(); - } - var typeString; - if (type === null) { - typeString = "null"; - } else if (isArray(type)) { - typeString = "array"; - } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) { - typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"; - info = " Did you accidentally export a JSX literal instead of a component?"; - } else { - typeString = typeof type; - } - { - error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info); - } - } - var element = createElement.apply(this, arguments); - if (element == null) { - return element; - } - if (validType) { - for (var i = 2; i < arguments.length; i++) { - validateChildKeys(arguments[i], type); - } - } - if (type === REACT_FRAGMENT_TYPE) { - validateFragmentProps(element); - } else { - validatePropTypes(element); - } - return element; - } - var didWarnAboutDeprecatedCreateFactory = false; - function createFactoryWithValidation(type) { - var validatedFactory = createElementWithValidation.bind(null, type); - validatedFactory.type = type; - { - if (!didWarnAboutDeprecatedCreateFactory) { - didWarnAboutDeprecatedCreateFactory = true; - warn("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead."); - } - Object.defineProperty(validatedFactory, "type", { - enumerable: false, - get: function() { - warn("Factory.type is deprecated. Access the class directly before passing it to createFactory."); - Object.defineProperty(this, "type", { - value: type - }); - return type; - } - }); - } - return validatedFactory; - } - function cloneElementWithValidation(element, props, children) { - var newElement = cloneElement.apply(this, arguments); - for (var i = 2; i < arguments.length; i++) { - validateChildKeys(arguments[i], newElement.type); - } - validatePropTypes(newElement); - return newElement; - } - function startTransition(scope, options) { - var prevTransition = ReactCurrentBatchConfig.transition; - ReactCurrentBatchConfig.transition = {}; - var currentTransition = ReactCurrentBatchConfig.transition; - { - ReactCurrentBatchConfig.transition._updatedFibers = /* @__PURE__ */ new Set(); - } - try { - scope(); - } finally { - ReactCurrentBatchConfig.transition = prevTransition; - { - if (prevTransition === null && currentTransition._updatedFibers) { - var updatedFibersCount = currentTransition._updatedFibers.size; - if (updatedFibersCount > 10) { - warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."); - } - currentTransition._updatedFibers.clear(); - } - } - } - } - var didWarnAboutMessageChannel = false; - var enqueueTaskImpl = null; - function enqueueTask(task) { - if (enqueueTaskImpl === null) { - try { - var requireString = ("require" + Math.random()).slice(0, 7); - var nodeRequire = module && module[requireString]; - enqueueTaskImpl = nodeRequire.call(module, "timers").setImmediate; - } catch (_err) { - enqueueTaskImpl = function(callback) { - { - if (didWarnAboutMessageChannel === false) { - didWarnAboutMessageChannel = true; - if (typeof MessageChannel === "undefined") { - error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."); - } - } - } - var channel = new MessageChannel(); - channel.port1.onmessage = callback; - channel.port2.postMessage(void 0); - }; - } - } - return enqueueTaskImpl(task); - } - var actScopeDepth = 0; - var didWarnNoAwaitAct = false; - function act(callback) { - { - var prevActScopeDepth = actScopeDepth; - actScopeDepth++; - if (ReactCurrentActQueue.current === null) { - ReactCurrentActQueue.current = []; - } - var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy; - var result; - try { - ReactCurrentActQueue.isBatchingLegacy = true; - result = callback(); - if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) { - var queue = ReactCurrentActQueue.current; - if (queue !== null) { - ReactCurrentActQueue.didScheduleLegacyUpdate = false; - flushActQueue(queue); - } - } - } catch (error2) { - popActScope(prevActScopeDepth); - throw error2; - } finally { - ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy; - } - if (result !== null && typeof result === "object" && typeof result.then === "function") { - var thenableResult = result; - var wasAwaited = false; - var thenable = { - then: function(resolve, reject) { - wasAwaited = true; - thenableResult.then(function(returnValue2) { - popActScope(prevActScopeDepth); - if (actScopeDepth === 0) { - recursivelyFlushAsyncActWork(returnValue2, resolve, reject); - } else { - resolve(returnValue2); - } - }, function(error2) { - popActScope(prevActScopeDepth); - reject(error2); - }); - } - }; - { - if (!didWarnNoAwaitAct && typeof Promise !== "undefined") { - Promise.resolve().then(function() { - }).then(function() { - if (!wasAwaited) { - didWarnNoAwaitAct = true; - error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"); - } - }); - } - } - return thenable; - } else { - var returnValue = result; - popActScope(prevActScopeDepth); - if (actScopeDepth === 0) { - var _queue = ReactCurrentActQueue.current; - if (_queue !== null) { - flushActQueue(_queue); - ReactCurrentActQueue.current = null; - } - var _thenable = { - then: function(resolve, reject) { - if (ReactCurrentActQueue.current === null) { - ReactCurrentActQueue.current = []; - recursivelyFlushAsyncActWork(returnValue, resolve, reject); - } else { - resolve(returnValue); - } - } - }; - return _thenable; - } else { - var _thenable2 = { - then: function(resolve, reject) { - resolve(returnValue); - } - }; - return _thenable2; - } - } - } - } - function popActScope(prevActScopeDepth) { - { - if (prevActScopeDepth !== actScopeDepth - 1) { - error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "); - } - actScopeDepth = prevActScopeDepth; - } - } - function recursivelyFlushAsyncActWork(returnValue, resolve, reject) { - { - var queue = ReactCurrentActQueue.current; - if (queue !== null) { - try { - flushActQueue(queue); - enqueueTask(function() { - if (queue.length === 0) { - ReactCurrentActQueue.current = null; - resolve(returnValue); - } else { - recursivelyFlushAsyncActWork(returnValue, resolve, reject); - } - }); - } catch (error2) { - reject(error2); - } - } else { - resolve(returnValue); - } - } - } - var isFlushing = false; - function flushActQueue(queue) { - { - if (!isFlushing) { - isFlushing = true; - var i = 0; - try { - for (; i < queue.length; i++) { - var callback = queue[i]; - do { - callback = callback(true); - } while (callback !== null); - } - queue.length = 0; - } catch (error2) { - queue = queue.slice(i + 1); - throw error2; - } finally { - isFlushing = false; - } - } - } - } - var createElement$1 = createElementWithValidation; - var cloneElement$1 = cloneElementWithValidation; - var createFactory = createFactoryWithValidation; - var Children = { - map: mapChildren, - forEach: forEachChildren, - count: countChildren, - toArray, - only: onlyChild - }; - exports.Children = Children; - exports.Component = Component; - exports.Fragment = REACT_FRAGMENT_TYPE; - exports.Profiler = REACT_PROFILER_TYPE; - exports.PureComponent = PureComponent; - exports.StrictMode = REACT_STRICT_MODE_TYPE; - exports.Suspense = REACT_SUSPENSE_TYPE; - exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals; - exports.cloneElement = cloneElement$1; - exports.createContext = createContext; - exports.createElement = createElement$1; - exports.createFactory = createFactory; - exports.createRef = createRef; - exports.forwardRef = forwardRef; - exports.isValidElement = isValidElement; - exports.lazy = lazy; - exports.memo = memo; - exports.startTransition = startTransition; - exports.unstable_act = act; - exports.useCallback = useCallback; - exports.useContext = useContext; - exports.useDebugValue = useDebugValue; - exports.useDeferredValue = useDeferredValue; - exports.useEffect = useEffect; - exports.useId = useId; - exports.useImperativeHandle = useImperativeHandle; - exports.useInsertionEffect = useInsertionEffect; - exports.useLayoutEffect = useLayoutEffect; - exports.useMemo = useMemo; - exports.useReducer = useReducer; - exports.useRef = useRef; - exports.useState = useState; - exports.useSyncExternalStore = useSyncExternalStore; - exports.useTransition = useTransition; - exports.version = ReactVersion; - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") { - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); - } - })(); - } - } -}); - -// node_modules/react/index.js -var require_react = __commonJS({ - "node_modules/react/index.js"(exports, module) { - "use strict"; - if (false) { - module.exports = null; - } else { - module.exports = require_react_development(); - } - } -}); - -// node_modules/scheduler/cjs/scheduler.development.js -var require_scheduler_development = __commonJS({ - "node_modules/scheduler/cjs/scheduler.development.js"(exports) { - "use strict"; - if (true) { - (function() { - "use strict"; - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") { - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); - } - var enableSchedulerDebugging = false; - var enableProfiling = false; - var frameYieldMs = 5; - function push(heap, node) { - var index = heap.length; - heap.push(node); - siftUp(heap, node, index); - } - function peek(heap) { - return heap.length === 0 ? null : heap[0]; - } - function pop(heap) { - if (heap.length === 0) { - return null; - } - var first = heap[0]; - var last = heap.pop(); - if (last !== first) { - heap[0] = last; - siftDown(heap, last, 0); - } - return first; - } - function siftUp(heap, node, i) { - var index = i; - while (index > 0) { - var parentIndex = index - 1 >>> 1; - var parent = heap[parentIndex]; - if (compare(parent, node) > 0) { - heap[parentIndex] = node; - heap[index] = parent; - index = parentIndex; - } else { - return; - } - } - } - function siftDown(heap, node, i) { - var index = i; - var length = heap.length; - var halfLength = length >>> 1; - while (index < halfLength) { - var leftIndex = (index + 1) * 2 - 1; - var left = heap[leftIndex]; - var rightIndex = leftIndex + 1; - var right = heap[rightIndex]; - if (compare(left, node) < 0) { - if (rightIndex < length && compare(right, left) < 0) { - heap[index] = right; - heap[rightIndex] = node; - index = rightIndex; - } else { - heap[index] = left; - heap[leftIndex] = node; - index = leftIndex; - } - } else if (rightIndex < length && compare(right, node) < 0) { - heap[index] = right; - heap[rightIndex] = node; - index = rightIndex; - } else { - return; - } - } - } - function compare(a, b) { - var diff = a.sortIndex - b.sortIndex; - return diff !== 0 ? diff : a.id - b.id; - } - var ImmediatePriority = 1; - var UserBlockingPriority = 2; - var NormalPriority = 3; - var LowPriority = 4; - var IdlePriority = 5; - function markTaskErrored(task, ms) { - } - var hasPerformanceNow = typeof performance === "object" && typeof performance.now === "function"; - if (hasPerformanceNow) { - var localPerformance = performance; - exports.unstable_now = function() { - return localPerformance.now(); - }; - } else { - var localDate = Date; - var initialTime = localDate.now(); - exports.unstable_now = function() { - return localDate.now() - initialTime; - }; - } - var maxSigned31BitInt = 1073741823; - var IMMEDIATE_PRIORITY_TIMEOUT = -1; - var USER_BLOCKING_PRIORITY_TIMEOUT = 250; - var NORMAL_PRIORITY_TIMEOUT = 5e3; - var LOW_PRIORITY_TIMEOUT = 1e4; - var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; - var taskQueue = []; - var timerQueue = []; - var taskIdCounter = 1; - var currentTask = null; - var currentPriorityLevel = NormalPriority; - var isPerformingWork = false; - var isHostCallbackScheduled = false; - var isHostTimeoutScheduled = false; - var localSetTimeout = typeof setTimeout === "function" ? setTimeout : null; - var localClearTimeout = typeof clearTimeout === "function" ? clearTimeout : null; - var localSetImmediate = typeof setImmediate !== "undefined" ? setImmediate : null; - var isInputPending = typeof navigator !== "undefined" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null; - function advanceTimers(currentTime) { - var timer = peek(timerQueue); - while (timer !== null) { - if (timer.callback === null) { - pop(timerQueue); - } else if (timer.startTime <= currentTime) { - pop(timerQueue); - timer.sortIndex = timer.expirationTime; - push(taskQueue, timer); - } else { - return; - } - timer = peek(timerQueue); - } - } - function handleTimeout(currentTime) { - isHostTimeoutScheduled = false; - advanceTimers(currentTime); - if (!isHostCallbackScheduled) { - if (peek(taskQueue) !== null) { - isHostCallbackScheduled = true; - requestHostCallback(flushWork); - } else { - var firstTimer = peek(timerQueue); - if (firstTimer !== null) { - requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); - } - } - } - } - function flushWork(hasTimeRemaining, initialTime2) { - isHostCallbackScheduled = false; - if (isHostTimeoutScheduled) { - isHostTimeoutScheduled = false; - cancelHostTimeout(); - } - isPerformingWork = true; - var previousPriorityLevel = currentPriorityLevel; - try { - if (enableProfiling) { - try { - return workLoop(hasTimeRemaining, initialTime2); - } catch (error) { - if (currentTask !== null) { - var currentTime = exports.unstable_now(); - markTaskErrored(currentTask, currentTime); - currentTask.isQueued = false; - } - throw error; - } - } else { - return workLoop(hasTimeRemaining, initialTime2); - } - } finally { - currentTask = null; - currentPriorityLevel = previousPriorityLevel; - isPerformingWork = false; - } - } - function workLoop(hasTimeRemaining, initialTime2) { - var currentTime = initialTime2; - advanceTimers(currentTime); - currentTask = peek(taskQueue); - while (currentTask !== null && !enableSchedulerDebugging) { - if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) { - break; - } - var callback = currentTask.callback; - if (typeof callback === "function") { - currentTask.callback = null; - currentPriorityLevel = currentTask.priorityLevel; - var didUserCallbackTimeout = currentTask.expirationTime <= currentTime; - var continuationCallback = callback(didUserCallbackTimeout); - currentTime = exports.unstable_now(); - if (typeof continuationCallback === "function") { - currentTask.callback = continuationCallback; - } else { - if (currentTask === peek(taskQueue)) { - pop(taskQueue); - } - } - advanceTimers(currentTime); - } else { - pop(taskQueue); - } - currentTask = peek(taskQueue); - } - if (currentTask !== null) { - return true; - } else { - var firstTimer = peek(timerQueue); - if (firstTimer !== null) { - requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); - } - return false; - } - } - function unstable_runWithPriority(priorityLevel, eventHandler) { - switch (priorityLevel) { - case ImmediatePriority: - case UserBlockingPriority: - case NormalPriority: - case LowPriority: - case IdlePriority: - break; - default: - priorityLevel = NormalPriority; - } - var previousPriorityLevel = currentPriorityLevel; - currentPriorityLevel = priorityLevel; - try { - return eventHandler(); - } finally { - currentPriorityLevel = previousPriorityLevel; - } - } - function unstable_next(eventHandler) { - var priorityLevel; - switch (currentPriorityLevel) { - case ImmediatePriority: - case UserBlockingPriority: - case NormalPriority: - priorityLevel = NormalPriority; - break; - default: - priorityLevel = currentPriorityLevel; - break; - } - var previousPriorityLevel = currentPriorityLevel; - currentPriorityLevel = priorityLevel; - try { - return eventHandler(); - } finally { - currentPriorityLevel = previousPriorityLevel; - } - } - function unstable_wrapCallback(callback) { - var parentPriorityLevel = currentPriorityLevel; - return function() { - var previousPriorityLevel = currentPriorityLevel; - currentPriorityLevel = parentPriorityLevel; - try { - return callback.apply(this, arguments); - } finally { - currentPriorityLevel = previousPriorityLevel; - } - }; - } - function unstable_scheduleCallback(priorityLevel, callback, options) { - var currentTime = exports.unstable_now(); - var startTime2; - if (typeof options === "object" && options !== null) { - var delay = options.delay; - if (typeof delay === "number" && delay > 0) { - startTime2 = currentTime + delay; - } else { - startTime2 = currentTime; - } - } else { - startTime2 = currentTime; - } - var timeout; - switch (priorityLevel) { - case ImmediatePriority: - timeout = IMMEDIATE_PRIORITY_TIMEOUT; - break; - case UserBlockingPriority: - timeout = USER_BLOCKING_PRIORITY_TIMEOUT; - break; - case IdlePriority: - timeout = IDLE_PRIORITY_TIMEOUT; - break; - case LowPriority: - timeout = LOW_PRIORITY_TIMEOUT; - break; - case NormalPriority: - default: - timeout = NORMAL_PRIORITY_TIMEOUT; - break; - } - var expirationTime = startTime2 + timeout; - var newTask = { - id: taskIdCounter++, - callback, - priorityLevel, - startTime: startTime2, - expirationTime, - sortIndex: -1 - }; - if (startTime2 > currentTime) { - newTask.sortIndex = startTime2; - push(timerQueue, newTask); - if (peek(taskQueue) === null && newTask === peek(timerQueue)) { - if (isHostTimeoutScheduled) { - cancelHostTimeout(); - } else { - isHostTimeoutScheduled = true; - } - requestHostTimeout(handleTimeout, startTime2 - currentTime); - } - } else { - newTask.sortIndex = expirationTime; - push(taskQueue, newTask); - if (!isHostCallbackScheduled && !isPerformingWork) { - isHostCallbackScheduled = true; - requestHostCallback(flushWork); - } - } - return newTask; - } - function unstable_pauseExecution() { - } - function unstable_continueExecution() { - if (!isHostCallbackScheduled && !isPerformingWork) { - isHostCallbackScheduled = true; - requestHostCallback(flushWork); - } - } - function unstable_getFirstCallbackNode() { - return peek(taskQueue); - } - function unstable_cancelCallback(task) { - task.callback = null; - } - function unstable_getCurrentPriorityLevel() { - return currentPriorityLevel; - } - var isMessageLoopRunning = false; - var scheduledHostCallback = null; - var taskTimeoutID = -1; - var frameInterval = frameYieldMs; - var startTime = -1; - function shouldYieldToHost() { - var timeElapsed = exports.unstable_now() - startTime; - if (timeElapsed < frameInterval) { - return false; - } - return true; - } - function requestPaint() { - } - function forceFrameRate(fps) { - if (fps < 0 || fps > 125) { - console["error"]("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"); - return; - } - if (fps > 0) { - frameInterval = Math.floor(1e3 / fps); - } else { - frameInterval = frameYieldMs; - } - } - var performWorkUntilDeadline = function() { - if (scheduledHostCallback !== null) { - var currentTime = exports.unstable_now(); - startTime = currentTime; - var hasTimeRemaining = true; - var hasMoreWork = true; - try { - hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime); - } finally { - if (hasMoreWork) { - schedulePerformWorkUntilDeadline(); - } else { - isMessageLoopRunning = false; - scheduledHostCallback = null; - } - } - } else { - isMessageLoopRunning = false; - } - }; - var schedulePerformWorkUntilDeadline; - if (typeof localSetImmediate === "function") { - schedulePerformWorkUntilDeadline = function() { - localSetImmediate(performWorkUntilDeadline); - }; - } else if (typeof MessageChannel !== "undefined") { - var channel = new MessageChannel(); - var port = channel.port2; - channel.port1.onmessage = performWorkUntilDeadline; - schedulePerformWorkUntilDeadline = function() { - port.postMessage(null); - }; - } else { - schedulePerformWorkUntilDeadline = function() { - localSetTimeout(performWorkUntilDeadline, 0); - }; - } - function requestHostCallback(callback) { - scheduledHostCallback = callback; - if (!isMessageLoopRunning) { - isMessageLoopRunning = true; - schedulePerformWorkUntilDeadline(); - } - } - function requestHostTimeout(callback, ms) { - taskTimeoutID = localSetTimeout(function() { - callback(exports.unstable_now()); - }, ms); - } - function cancelHostTimeout() { - localClearTimeout(taskTimeoutID); - taskTimeoutID = -1; - } - var unstable_requestPaint = requestPaint; - var unstable_Profiling = null; - exports.unstable_IdlePriority = IdlePriority; - exports.unstable_ImmediatePriority = ImmediatePriority; - exports.unstable_LowPriority = LowPriority; - exports.unstable_NormalPriority = NormalPriority; - exports.unstable_Profiling = unstable_Profiling; - exports.unstable_UserBlockingPriority = UserBlockingPriority; - exports.unstable_cancelCallback = unstable_cancelCallback; - exports.unstable_continueExecution = unstable_continueExecution; - exports.unstable_forceFrameRate = forceFrameRate; - exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel; - exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode; - exports.unstable_next = unstable_next; - exports.unstable_pauseExecution = unstable_pauseExecution; - exports.unstable_requestPaint = unstable_requestPaint; - exports.unstable_runWithPriority = unstable_runWithPriority; - exports.unstable_scheduleCallback = unstable_scheduleCallback; - exports.unstable_shouldYield = shouldYieldToHost; - exports.unstable_wrapCallback = unstable_wrapCallback; - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") { - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); - } - })(); - } - } -}); - -// node_modules/scheduler/index.js -var require_scheduler = __commonJS({ - "node_modules/scheduler/index.js"(exports, module) { - "use strict"; - if (false) { - module.exports = null; - } else { - module.exports = require_scheduler_development(); - } - } -}); - -// node_modules/react-dom/cjs/react-dom.development.js -var require_react_dom_development = __commonJS({ - "node_modules/react-dom/cjs/react-dom.development.js"(exports) { - "use strict"; - if (true) { - (function() { - "use strict"; - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") { - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); - } - var React = require_react(); - var Scheduler = require_scheduler(); - var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - var suppressWarning = false; - function setSuppressWarning(newSuppressWarning) { - { - suppressWarning = newSuppressWarning; - } - } - function warn(format) { - { - if (!suppressWarning) { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - printWarning("warn", format, args); - } - } - } - function error(format) { - { - if (!suppressWarning) { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - printWarning("error", format, args); - } - } - } - function printWarning(level, format, args) { - { - var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame2.getStackAddendum(); - if (stack !== "") { - format += "%s"; - args = args.concat([stack]); - } - var argsWithFormat = args.map(function(item) { - return String(item); - }); - argsWithFormat.unshift("Warning: " + format); - Function.prototype.apply.call(console[level], console, argsWithFormat); - } - } - var FunctionComponent = 0; - var ClassComponent = 1; - var IndeterminateComponent = 2; - var HostRoot = 3; - var HostPortal = 4; - var HostComponent = 5; - var HostText = 6; - var Fragment = 7; - var Mode = 8; - var ContextConsumer = 9; - var ContextProvider = 10; - var ForwardRef = 11; - var Profiler = 12; - var SuspenseComponent = 13; - var MemoComponent = 14; - var SimpleMemoComponent = 15; - var LazyComponent = 16; - var IncompleteClassComponent = 17; - var DehydratedFragment = 18; - var SuspenseListComponent = 19; - var ScopeComponent = 21; - var OffscreenComponent = 22; - var LegacyHiddenComponent = 23; - var CacheComponent = 24; - var TracingMarkerComponent = 25; - var enableClientRenderFallbackOnTextMismatch = true; - var enableNewReconciler = false; - var enableLazyContextPropagation = false; - var enableLegacyHidden = false; - var enableSuspenseAvoidThisFallback = false; - var disableCommentsAsDOMContainers = true; - var enableCustomElementPropertySupport = false; - var warnAboutStringRefs = false; - var enableSchedulingProfiler = true; - var enableProfilerTimer = true; - var enableProfilerCommitHooks = true; - var allNativeEvents = /* @__PURE__ */ new Set(); - var registrationNameDependencies = {}; - var possibleRegistrationNames = {}; - function registerTwoPhaseEvent(registrationName, dependencies) { - registerDirectEvent(registrationName, dependencies); - registerDirectEvent(registrationName + "Capture", dependencies); - } - function registerDirectEvent(registrationName, dependencies) { - { - if (registrationNameDependencies[registrationName]) { - error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", registrationName); - } - } - registrationNameDependencies[registrationName] = dependencies; - { - var lowerCasedName = registrationName.toLowerCase(); - possibleRegistrationNames[lowerCasedName] = registrationName; - if (registrationName === "onDoubleClick") { - possibleRegistrationNames.ondblclick = registrationName; - } - } - for (var i = 0; i < dependencies.length; i++) { - allNativeEvents.add(dependencies[i]); - } - } - var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"); - var hasOwnProperty = Object.prototype.hasOwnProperty; - function typeName(value) { - { - var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag; - var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; - return type; - } - } - function willCoercionThrow(value) { - { - try { - testStringCoercion(value); - return false; - } catch (e) { - return true; - } - } - } - function testStringCoercion(value) { - return "" + value; - } - function checkAttributeStringCoercion(value, attributeName) { - { - if (willCoercionThrow(value)) { - error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.", attributeName, typeName(value)); - return testStringCoercion(value); - } - } - } - function checkKeyStringCoercion(value) { - { - if (willCoercionThrow(value)) { - error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value)); - return testStringCoercion(value); - } - } - } - function checkPropStringCoercion(value, propName) { - { - if (willCoercionThrow(value)) { - error("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName(value)); - return testStringCoercion(value); - } - } - } - function checkCSSPropertyStringCoercion(value, propName) { - { - if (willCoercionThrow(value)) { - error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName(value)); - return testStringCoercion(value); - } - } - } - function checkHtmlStringCoercion(value) { - { - if (willCoercionThrow(value)) { - error("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value)); - return testStringCoercion(value); - } - } - } - function checkFormFieldValueStringCoercion(value) { - { - if (willCoercionThrow(value)) { - error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before before using it here.", typeName(value)); - return testStringCoercion(value); - } - } - } - var RESERVED = 0; - var STRING = 1; - var BOOLEANISH_STRING = 2; - var BOOLEAN = 3; - var OVERLOADED_BOOLEAN = 4; - var NUMERIC = 5; - var POSITIVE_NUMERIC = 6; - var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; - var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var VALID_ATTRIBUTE_NAME_REGEX = new RegExp("^[" + ATTRIBUTE_NAME_START_CHAR + "][" + ATTRIBUTE_NAME_CHAR + "]*$"); - var illegalAttributeNameCache = {}; - var validatedAttributeNameCache = {}; - function isAttributeNameSafe(attributeName) { - if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { - return true; - } - if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { - return false; - } - if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { - validatedAttributeNameCache[attributeName] = true; - return true; - } - illegalAttributeNameCache[attributeName] = true; - { - error("Invalid attribute name: `%s`", attributeName); - } - return false; - } - function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { - if (propertyInfo !== null) { - return propertyInfo.type === RESERVED; - } - if (isCustomComponentTag) { - return false; - } - if (name.length > 2 && (name[0] === "o" || name[0] === "O") && (name[1] === "n" || name[1] === "N")) { - return true; - } - return false; - } - function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { - if (propertyInfo !== null && propertyInfo.type === RESERVED) { - return false; - } - switch (typeof value) { - case "function": - case "symbol": - return true; - case "boolean": { - if (isCustomComponentTag) { - return false; - } - if (propertyInfo !== null) { - return !propertyInfo.acceptsBooleans; - } else { - var prefix2 = name.toLowerCase().slice(0, 5); - return prefix2 !== "data-" && prefix2 !== "aria-"; - } - } - default: - return false; - } - } - function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { - if (value === null || typeof value === "undefined") { - return true; - } - if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) { - return true; - } - if (isCustomComponentTag) { - return false; - } - if (propertyInfo !== null) { - switch (propertyInfo.type) { - case BOOLEAN: - return !value; - case OVERLOADED_BOOLEAN: - return value === false; - case NUMERIC: - return isNaN(value); - case POSITIVE_NUMERIC: - return isNaN(value) || value < 1; - } - } - return false; - } - function getPropertyInfo(name) { - return properties.hasOwnProperty(name) ? properties[name] : null; - } - function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL2, removeEmptyString) { - this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; - this.attributeName = attributeName; - this.attributeNamespace = attributeNamespace; - this.mustUseProperty = mustUseProperty; - this.propertyName = name; - this.type = type; - this.sanitizeURL = sanitizeURL2; - this.removeEmptyString = removeEmptyString; - } - var properties = {}; - var reservedProps = [ - "children", - "dangerouslySetInnerHTML", - // TODO: This prevents the assignment of defaultValue to regular - // elements (not just inputs). Now that ReactDOMInput assigns to the - // defaultValue property -- do we need this? - "defaultValue", - "defaultChecked", - "innerHTML", - "suppressContentEditableWarning", - "suppressHydrationWarning", - "style" - ]; - reservedProps.forEach(function(name) { - properties[name] = new PropertyInfoRecord( - name, - RESERVED, - false, - // mustUseProperty - name, - // attributeName - null, - // attributeNamespace - false, - // sanitizeURL - false - ); - }); - [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(_ref) { - var name = _ref[0], attributeName = _ref[1]; - properties[name] = new PropertyInfoRecord( - name, - STRING, - false, - // mustUseProperty - attributeName, - // attributeName - null, - // attributeNamespace - false, - // sanitizeURL - false - ); - }); - ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(name) { - properties[name] = new PropertyInfoRecord( - name, - BOOLEANISH_STRING, - false, - // mustUseProperty - name.toLowerCase(), - // attributeName - null, - // attributeNamespace - false, - // sanitizeURL - false - ); - }); - ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(name) { - properties[name] = new PropertyInfoRecord( - name, - BOOLEANISH_STRING, - false, - // mustUseProperty - name, - // attributeName - null, - // attributeNamespace - false, - // sanitizeURL - false - ); - }); - [ - "allowFullScreen", - "async", - // Note: there is a special case that prevents it from being written to the DOM - // on the client side because the browsers are inconsistent. Instead we call focus(). - "autoFocus", - "autoPlay", - "controls", - "default", - "defer", - "disabled", - "disablePictureInPicture", - "disableRemotePlayback", - "formNoValidate", - "hidden", - "loop", - "noModule", - "noValidate", - "open", - "playsInline", - "readOnly", - "required", - "reversed", - "scoped", - "seamless", - // Microdata - "itemScope" - ].forEach(function(name) { - properties[name] = new PropertyInfoRecord( - name, - BOOLEAN, - false, - // mustUseProperty - name.toLowerCase(), - // attributeName - null, - // attributeNamespace - false, - // sanitizeURL - false - ); - }); - [ - "checked", - // Note: `option.selected` is not updated if `select.multiple` is - // disabled with `removeAttribute`. We have special logic for handling this. - "multiple", - "muted", - "selected" - // NOTE: if you add a camelCased prop to this list, - // you'll need to set attributeName to name.toLowerCase() - // instead in the assignment below. - ].forEach(function(name) { - properties[name] = new PropertyInfoRecord( - name, - BOOLEAN, - true, - // mustUseProperty - name, - // attributeName - null, - // attributeNamespace - false, - // sanitizeURL - false - ); - }); - [ - "capture", - "download" - // NOTE: if you add a camelCased prop to this list, - // you'll need to set attributeName to name.toLowerCase() - // instead in the assignment below. - ].forEach(function(name) { - properties[name] = new PropertyInfoRecord( - name, - OVERLOADED_BOOLEAN, - false, - // mustUseProperty - name, - // attributeName - null, - // attributeNamespace - false, - // sanitizeURL - false - ); - }); - [ - "cols", - "rows", - "size", - "span" - // NOTE: if you add a camelCased prop to this list, - // you'll need to set attributeName to name.toLowerCase() - // instead in the assignment below. - ].forEach(function(name) { - properties[name] = new PropertyInfoRecord( - name, - POSITIVE_NUMERIC, - false, - // mustUseProperty - name, - // attributeName - null, - // attributeNamespace - false, - // sanitizeURL - false - ); - }); - ["rowSpan", "start"].forEach(function(name) { - properties[name] = new PropertyInfoRecord( - name, - NUMERIC, - false, - // mustUseProperty - name.toLowerCase(), - // attributeName - null, - // attributeNamespace - false, - // sanitizeURL - false - ); - }); - var CAMELIZE = /[\-\:]([a-z])/g; - var capitalize = function(token) { - return token[1].toUpperCase(); - }; - [ - "accent-height", - "alignment-baseline", - "arabic-form", - "baseline-shift", - "cap-height", - "clip-path", - "clip-rule", - "color-interpolation", - "color-interpolation-filters", - "color-profile", - "color-rendering", - "dominant-baseline", - "enable-background", - "fill-opacity", - "fill-rule", - "flood-color", - "flood-opacity", - "font-family", - "font-size", - "font-size-adjust", - "font-stretch", - "font-style", - "font-variant", - "font-weight", - "glyph-name", - "glyph-orientation-horizontal", - "glyph-orientation-vertical", - "horiz-adv-x", - "horiz-origin-x", - "image-rendering", - "letter-spacing", - "lighting-color", - "marker-end", - "marker-mid", - "marker-start", - "overline-position", - "overline-thickness", - "paint-order", - "panose-1", - "pointer-events", - "rendering-intent", - "shape-rendering", - "stop-color", - "stop-opacity", - "strikethrough-position", - "strikethrough-thickness", - "stroke-dasharray", - "stroke-dashoffset", - "stroke-linecap", - "stroke-linejoin", - "stroke-miterlimit", - "stroke-opacity", - "stroke-width", - "text-anchor", - "text-decoration", - "text-rendering", - "underline-position", - "underline-thickness", - "unicode-bidi", - "unicode-range", - "units-per-em", - "v-alphabetic", - "v-hanging", - "v-ideographic", - "v-mathematical", - "vector-effect", - "vert-adv-y", - "vert-origin-x", - "vert-origin-y", - "word-spacing", - "writing-mode", - "xmlns:xlink", - "x-height" - // NOTE: if you add a camelCased prop to this list, - // you'll need to set attributeName to name.toLowerCase() - // instead in the assignment below. - ].forEach(function(attributeName) { - var name = attributeName.replace(CAMELIZE, capitalize); - properties[name] = new PropertyInfoRecord( - name, - STRING, - false, - // mustUseProperty - attributeName, - null, - // attributeNamespace - false, - // sanitizeURL - false - ); - }); - [ - "xlink:actuate", - "xlink:arcrole", - "xlink:role", - "xlink:show", - "xlink:title", - "xlink:type" - // NOTE: if you add a camelCased prop to this list, - // you'll need to set attributeName to name.toLowerCase() - // instead in the assignment below. - ].forEach(function(attributeName) { - var name = attributeName.replace(CAMELIZE, capitalize); - properties[name] = new PropertyInfoRecord( - name, - STRING, - false, - // mustUseProperty - attributeName, - "http://www.w3.org/1999/xlink", - false, - // sanitizeURL - false - ); - }); - [ - "xml:base", - "xml:lang", - "xml:space" - // NOTE: if you add a camelCased prop to this list, - // you'll need to set attributeName to name.toLowerCase() - // instead in the assignment below. - ].forEach(function(attributeName) { - var name = attributeName.replace(CAMELIZE, capitalize); - properties[name] = new PropertyInfoRecord( - name, - STRING, - false, - // mustUseProperty - attributeName, - "http://www.w3.org/XML/1998/namespace", - false, - // sanitizeURL - false - ); - }); - ["tabIndex", "crossOrigin"].forEach(function(attributeName) { - properties[attributeName] = new PropertyInfoRecord( - attributeName, - STRING, - false, - // mustUseProperty - attributeName.toLowerCase(), - // attributeName - null, - // attributeNamespace - false, - // sanitizeURL - false - ); - }); - var xlinkHref = "xlinkHref"; - properties[xlinkHref] = new PropertyInfoRecord( - "xlinkHref", - STRING, - false, - // mustUseProperty - "xlink:href", - "http://www.w3.org/1999/xlink", - true, - // sanitizeURL - false - ); - ["src", "href", "action", "formAction"].forEach(function(attributeName) { - properties[attributeName] = new PropertyInfoRecord( - attributeName, - STRING, - false, - // mustUseProperty - attributeName.toLowerCase(), - // attributeName - null, - // attributeNamespace - true, - // sanitizeURL - true - ); - }); - var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i; - var didWarn = false; - function sanitizeURL(url) { - { - if (!didWarn && isJavaScriptProtocol.test(url)) { - didWarn = true; - error("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(url)); - } - } - } - function getValueForProperty(node, name, expected, propertyInfo) { - { - if (propertyInfo.mustUseProperty) { - var propertyName = propertyInfo.propertyName; - return node[propertyName]; - } else { - { - checkAttributeStringCoercion(expected, name); - } - if (propertyInfo.sanitizeURL) { - sanitizeURL("" + expected); - } - var attributeName = propertyInfo.attributeName; - var stringValue = null; - if (propertyInfo.type === OVERLOADED_BOOLEAN) { - if (node.hasAttribute(attributeName)) { - var value = node.getAttribute(attributeName); - if (value === "") { - return true; - } - if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { - return value; - } - if (value === "" + expected) { - return expected; - } - return value; - } - } else if (node.hasAttribute(attributeName)) { - if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { - return node.getAttribute(attributeName); - } - if (propertyInfo.type === BOOLEAN) { - return expected; - } - stringValue = node.getAttribute(attributeName); - } - if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { - return stringValue === null ? expected : stringValue; - } else if (stringValue === "" + expected) { - return expected; - } else { - return stringValue; - } - } - } - } - function getValueForAttribute(node, name, expected, isCustomComponentTag) { - { - if (!isAttributeNameSafe(name)) { - return; - } - if (!node.hasAttribute(name)) { - return expected === void 0 ? void 0 : null; - } - var value = node.getAttribute(name); - { - checkAttributeStringCoercion(expected, name); - } - if (value === "" + expected) { - return expected; - } - return value; - } - } - function setValueForProperty(node, name, value, isCustomComponentTag) { - var propertyInfo = getPropertyInfo(name); - if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) { - return; - } - if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) { - value = null; - } - if (isCustomComponentTag || propertyInfo === null) { - if (isAttributeNameSafe(name)) { - var _attributeName = name; - if (value === null) { - node.removeAttribute(_attributeName); - } else { - { - checkAttributeStringCoercion(value, name); - } - node.setAttribute(_attributeName, "" + value); - } - } - return; - } - var mustUseProperty = propertyInfo.mustUseProperty; - if (mustUseProperty) { - var propertyName = propertyInfo.propertyName; - if (value === null) { - var type = propertyInfo.type; - node[propertyName] = type === BOOLEAN ? false : ""; - } else { - node[propertyName] = value; - } - return; - } - var attributeName = propertyInfo.attributeName, attributeNamespace = propertyInfo.attributeNamespace; - if (value === null) { - node.removeAttribute(attributeName); - } else { - var _type = propertyInfo.type; - var attributeValue; - if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) { - attributeValue = ""; - } else { - { - { - checkAttributeStringCoercion(value, attributeName); - } - attributeValue = "" + value; - } - if (propertyInfo.sanitizeURL) { - sanitizeURL(attributeValue.toString()); - } - } - if (attributeNamespace) { - node.setAttributeNS(attributeNamespace, attributeName, attributeValue); - } else { - node.setAttribute(attributeName, attributeValue); - } - } - } - var REACT_ELEMENT_TYPE = Symbol.for("react.element"); - var REACT_PORTAL_TYPE = Symbol.for("react.portal"); - var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); - var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); - var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); - var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); - var REACT_CONTEXT_TYPE = Symbol.for("react.context"); - var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); - var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); - var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); - var REACT_MEMO_TYPE = Symbol.for("react.memo"); - var REACT_LAZY_TYPE = Symbol.for("react.lazy"); - var REACT_SCOPE_TYPE = Symbol.for("react.scope"); - var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"); - var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); - var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"); - var REACT_CACHE_TYPE = Symbol.for("react.cache"); - var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"); - var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = "@@iterator"; - function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== "object") { - return null; - } - var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - if (typeof maybeIterator === "function") { - return maybeIterator; - } - return null; - } - var assign = Object.assign; - var disabledDepth = 0; - var prevLog; - var prevInfo; - var prevWarn; - var prevError; - var prevGroup; - var prevGroupCollapsed; - var prevGroupEnd; - function disabledLog() { - } - disabledLog.__reactDisabledLog = true; - function disableLogs() { - { - if (disabledDepth === 0) { - prevLog = console.log; - prevInfo = console.info; - prevWarn = console.warn; - prevError = console.error; - prevGroup = console.group; - prevGroupCollapsed = console.groupCollapsed; - prevGroupEnd = console.groupEnd; - var props = { - configurable: true, - enumerable: true, - value: disabledLog, - writable: true - }; - Object.defineProperties(console, { - info: props, - log: props, - warn: props, - error: props, - group: props, - groupCollapsed: props, - groupEnd: props - }); - } - disabledDepth++; - } - } - function reenableLogs() { - { - disabledDepth--; - if (disabledDepth === 0) { - var props = { - configurable: true, - enumerable: true, - writable: true - }; - Object.defineProperties(console, { - log: assign({}, props, { - value: prevLog - }), - info: assign({}, props, { - value: prevInfo - }), - warn: assign({}, props, { - value: prevWarn - }), - error: assign({}, props, { - value: prevError - }), - group: assign({}, props, { - value: prevGroup - }), - groupCollapsed: assign({}, props, { - value: prevGroupCollapsed - }), - groupEnd: assign({}, props, { - value: prevGroupEnd - }) - }); - } - if (disabledDepth < 0) { - error("disabledDepth fell below zero. This is a bug in React. Please file an issue."); - } - } - } - var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; - var prefix; - function describeBuiltInComponentFrame(name, source, ownerFn) { - { - if (prefix === void 0) { - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = match && match[1] || ""; - } - } - return "\n" + prefix + name; - } - } - var reentry = false; - var componentFrameCache; - { - var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map; - componentFrameCache = new PossiblyWeakMap(); - } - function describeNativeComponentFrame(fn, construct) { - if (!fn || reentry) { - return ""; - } - { - var frame = componentFrameCache.get(fn); - if (frame !== void 0) { - return frame; - } - } - var control; - reentry = true; - var previousPrepareStackTrace = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - var previousDispatcher; - { - previousDispatcher = ReactCurrentDispatcher.current; - ReactCurrentDispatcher.current = null; - disableLogs(); - } - try { - if (construct) { - var Fake = function() { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function() { - throw Error(); - } - }); - if (typeof Reflect === "object" && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - control = x; - } - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x) { - control = x; - } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x) { - control = x; - } - fn(); - } - } catch (sample) { - if (sample && control && typeof sample.stack === "string") { - var sampleLines = sample.stack.split("\n"); - var controlLines = control.stack.split("\n"); - var s = sampleLines.length - 1; - var c = controlLines.length - 1; - while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { - c--; - } - for (; s >= 1 && c >= 0; s--, c--) { - if (sampleLines[s] !== controlLines[c]) { - if (s !== 1 || c !== 1) { - do { - s--; - c--; - if (c < 0 || sampleLines[s] !== controlLines[c]) { - var _frame = "\n" + sampleLines[s].replace(" at new ", " at "); - if (fn.displayName && _frame.includes("")) { - _frame = _frame.replace("", fn.displayName); - } - { - if (typeof fn === "function") { - componentFrameCache.set(fn, _frame); - } - } - return _frame; - } - } while (s >= 1 && c >= 0); - } - break; - } - } - } - } finally { - reentry = false; - { - ReactCurrentDispatcher.current = previousDispatcher; - reenableLogs(); - } - Error.prepareStackTrace = previousPrepareStackTrace; - } - var name = fn ? fn.displayName || fn.name : ""; - var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; - { - if (typeof fn === "function") { - componentFrameCache.set(fn, syntheticFrame); - } - } - return syntheticFrame; - } - function describeClassComponentFrame(ctor, source, ownerFn) { - { - return describeNativeComponentFrame(ctor, true); - } - } - function describeFunctionComponentFrame(fn, source, ownerFn) { - { - return describeNativeComponentFrame(fn, false); - } - } - function shouldConstruct(Component) { - var prototype = Component.prototype; - return !!(prototype && prototype.isReactComponent); - } - function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { - if (type == null) { - return ""; - } - if (typeof type === "function") { - { - return describeNativeComponentFrame(type, shouldConstruct(type)); - } - } - if (typeof type === "string") { - return describeBuiltInComponentFrame(type); - } - switch (type) { - case REACT_SUSPENSE_TYPE: - return describeBuiltInComponentFrame("Suspense"); - case REACT_SUSPENSE_LIST_TYPE: - return describeBuiltInComponentFrame("SuspenseList"); - } - if (typeof type === "object") { - switch (type.$$typeof) { - case REACT_FORWARD_REF_TYPE: - return describeFunctionComponentFrame(type.render); - case REACT_MEMO_TYPE: - return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); - case REACT_LAZY_TYPE: { - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - try { - return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); - } catch (x) { - } - } - } - } - return ""; - } - function describeFiber(fiber) { - var owner = fiber._debugOwner ? fiber._debugOwner.type : null; - var source = fiber._debugSource; - switch (fiber.tag) { - case HostComponent: - return describeBuiltInComponentFrame(fiber.type); - case LazyComponent: - return describeBuiltInComponentFrame("Lazy"); - case SuspenseComponent: - return describeBuiltInComponentFrame("Suspense"); - case SuspenseListComponent: - return describeBuiltInComponentFrame("SuspenseList"); - case FunctionComponent: - case IndeterminateComponent: - case SimpleMemoComponent: - return describeFunctionComponentFrame(fiber.type); - case ForwardRef: - return describeFunctionComponentFrame(fiber.type.render); - case ClassComponent: - return describeClassComponentFrame(fiber.type); - default: - return ""; - } - } - function getStackByFiberInDevAndProd(workInProgress2) { - try { - var info = ""; - var node = workInProgress2; - do { - info += describeFiber(node); - node = node.return; - } while (node); - return info; - } catch (x) { - return "\nError generating stack: " + x.message + "\n" + x.stack; - } - } - function getWrappedName(outerType, innerType, wrapperName) { - var displayName = outerType.displayName; - if (displayName) { - return displayName; - } - var functionName = innerType.displayName || innerType.name || ""; - return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName; - } - function getContextName(type) { - return type.displayName || "Context"; - } - function getComponentNameFromType(type) { - if (type == null) { - return null; - } - { - if (typeof type.tag === "number") { - error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."); - } - } - if (typeof type === "function") { - return type.displayName || type.name || null; - } - if (typeof type === "string") { - return type; - } - switch (type) { - case REACT_FRAGMENT_TYPE: - return "Fragment"; - case REACT_PORTAL_TYPE: - return "Portal"; - case REACT_PROFILER_TYPE: - return "Profiler"; - case REACT_STRICT_MODE_TYPE: - return "StrictMode"; - case REACT_SUSPENSE_TYPE: - return "Suspense"; - case REACT_SUSPENSE_LIST_TYPE: - return "SuspenseList"; - } - if (typeof type === "object") { - switch (type.$$typeof) { - case REACT_CONTEXT_TYPE: - var context = type; - return getContextName(context) + ".Consumer"; - case REACT_PROVIDER_TYPE: - var provider = type; - return getContextName(provider._context) + ".Provider"; - case REACT_FORWARD_REF_TYPE: - return getWrappedName(type, type.render, "ForwardRef"); - case REACT_MEMO_TYPE: - var outerName = type.displayName || null; - if (outerName !== null) { - return outerName; - } - return getComponentNameFromType(type.type) || "Memo"; - case REACT_LAZY_TYPE: { - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - try { - return getComponentNameFromType(init(payload)); - } catch (x) { - return null; - } - } - } - } - return null; - } - function getWrappedName$1(outerType, innerType, wrapperName) { - var functionName = innerType.displayName || innerType.name || ""; - return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName); - } - function getContextName$1(type) { - return type.displayName || "Context"; - } - function getComponentNameFromFiber(fiber) { - var tag = fiber.tag, type = fiber.type; - switch (tag) { - case CacheComponent: - return "Cache"; - case ContextConsumer: - var context = type; - return getContextName$1(context) + ".Consumer"; - case ContextProvider: - var provider = type; - return getContextName$1(provider._context) + ".Provider"; - case DehydratedFragment: - return "DehydratedFragment"; - case ForwardRef: - return getWrappedName$1(type, type.render, "ForwardRef"); - case Fragment: - return "Fragment"; - case HostComponent: - return type; - case HostPortal: - return "Portal"; - case HostRoot: - return "Root"; - case HostText: - return "Text"; - case LazyComponent: - return getComponentNameFromType(type); - case Mode: - if (type === REACT_STRICT_MODE_TYPE) { - return "StrictMode"; - } - return "Mode"; - case OffscreenComponent: - return "Offscreen"; - case Profiler: - return "Profiler"; - case ScopeComponent: - return "Scope"; - case SuspenseComponent: - return "Suspense"; - case SuspenseListComponent: - return "SuspenseList"; - case TracingMarkerComponent: - return "TracingMarker"; - case ClassComponent: - case FunctionComponent: - case IncompleteClassComponent: - case IndeterminateComponent: - case MemoComponent: - case SimpleMemoComponent: - if (typeof type === "function") { - return type.displayName || type.name || null; - } - if (typeof type === "string") { - return type; - } - break; - } - return null; - } - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var current = null; - var isRendering = false; - function getCurrentFiberOwnerNameInDevOrNull() { - { - if (current === null) { - return null; - } - var owner = current._debugOwner; - if (owner !== null && typeof owner !== "undefined") { - return getComponentNameFromFiber(owner); - } - } - return null; - } - function getCurrentFiberStackInDev() { - { - if (current === null) { - return ""; - } - return getStackByFiberInDevAndProd(current); - } - } - function resetCurrentFiber() { - { - ReactDebugCurrentFrame.getCurrentStack = null; - current = null; - isRendering = false; - } - } - function setCurrentFiber(fiber) { - { - ReactDebugCurrentFrame.getCurrentStack = fiber === null ? null : getCurrentFiberStackInDev; - current = fiber; - isRendering = false; - } - } - function getCurrentFiber() { - { - return current; - } - } - function setIsRendering(rendering) { - { - isRendering = rendering; - } - } - function toString(value) { - return "" + value; - } - function getToStringValue(value) { - switch (typeof value) { - case "boolean": - case "number": - case "string": - case "undefined": - return value; - case "object": - { - checkFormFieldValueStringCoercion(value); - } - return value; - default: - return ""; - } - } - var hasReadOnlyValue = { - button: true, - checkbox: true, - image: true, - hidden: true, - radio: true, - reset: true, - submit: true - }; - function checkControlledValueProps(tagName, props) { - { - if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) { - error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."); - } - if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) { - error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`."); - } - } - } - function isCheckable(elem) { - var type = elem.type; - var nodeName = elem.nodeName; - return nodeName && nodeName.toLowerCase() === "input" && (type === "checkbox" || type === "radio"); - } - function getTracker(node) { - return node._valueTracker; - } - function detachTracker(node) { - node._valueTracker = null; - } - function getValueFromNode(node) { - var value = ""; - if (!node) { - return value; - } - if (isCheckable(node)) { - value = node.checked ? "true" : "false"; - } else { - value = node.value; - } - return value; - } - function trackValueOnNode(node) { - var valueField = isCheckable(node) ? "checked" : "value"; - var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); - { - checkFormFieldValueStringCoercion(node[valueField]); - } - var currentValue = "" + node[valueField]; - if (node.hasOwnProperty(valueField) || typeof descriptor === "undefined" || typeof descriptor.get !== "function" || typeof descriptor.set !== "function") { - return; - } - var get2 = descriptor.get, set2 = descriptor.set; - Object.defineProperty(node, valueField, { - configurable: true, - get: function() { - return get2.call(this); - }, - set: function(value) { - { - checkFormFieldValueStringCoercion(value); - } - currentValue = "" + value; - set2.call(this, value); - } - }); - Object.defineProperty(node, valueField, { - enumerable: descriptor.enumerable - }); - var tracker = { - getValue: function() { - return currentValue; - }, - setValue: function(value) { - { - checkFormFieldValueStringCoercion(value); - } - currentValue = "" + value; - }, - stopTracking: function() { - detachTracker(node); - delete node[valueField]; - } - }; - return tracker; - } - function track(node) { - if (getTracker(node)) { - return; - } - node._valueTracker = trackValueOnNode(node); - } - function updateValueIfChanged(node) { - if (!node) { - return false; - } - var tracker = getTracker(node); - if (!tracker) { - return true; - } - var lastValue = tracker.getValue(); - var nextValue = getValueFromNode(node); - if (nextValue !== lastValue) { - tracker.setValue(nextValue); - return true; - } - return false; - } - function getActiveElement(doc) { - doc = doc || (typeof document !== "undefined" ? document : void 0); - if (typeof doc === "undefined") { - return null; - } - try { - return doc.activeElement || doc.body; - } catch (e) { - return doc.body; - } - } - var didWarnValueDefaultValue = false; - var didWarnCheckedDefaultChecked = false; - var didWarnControlledToUncontrolled = false; - var didWarnUncontrolledToControlled = false; - function isControlled(props) { - var usesChecked = props.type === "checkbox" || props.type === "radio"; - return usesChecked ? props.checked != null : props.value != null; - } - function getHostProps(element, props) { - var node = element; - var checked = props.checked; - var hostProps = assign({}, props, { - defaultChecked: void 0, - defaultValue: void 0, - value: void 0, - checked: checked != null ? checked : node._wrapperState.initialChecked - }); - return hostProps; - } - function initWrapperState(element, props) { - { - checkControlledValueProps("input", props); - if (props.checked !== void 0 && props.defaultChecked !== void 0 && !didWarnCheckedDefaultChecked) { - error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type); - didWarnCheckedDefaultChecked = true; - } - if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue) { - error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type); - didWarnValueDefaultValue = true; - } - } - var node = element; - var defaultValue = props.defaultValue == null ? "" : props.defaultValue; - node._wrapperState = { - initialChecked: props.checked != null ? props.checked : props.defaultChecked, - initialValue: getToStringValue(props.value != null ? props.value : defaultValue), - controlled: isControlled(props) - }; - } - function updateChecked(element, props) { - var node = element; - var checked = props.checked; - if (checked != null) { - setValueForProperty(node, "checked", checked, false); - } - } - function updateWrapper(element, props) { - var node = element; - { - var controlled = isControlled(props); - if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { - error("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"); - didWarnUncontrolledToControlled = true; - } - if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) { - error("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"); - didWarnControlledToUncontrolled = true; - } - } - updateChecked(element, props); - var value = getToStringValue(props.value); - var type = props.type; - if (value != null) { - if (type === "number") { - if (value === 0 && node.value === "" || // We explicitly want to coerce to number here if possible. - // eslint-disable-next-line - node.value != value) { - node.value = toString(value); - } - } else if (node.value !== toString(value)) { - node.value = toString(value); - } - } else if (type === "submit" || type === "reset") { - node.removeAttribute("value"); - return; - } - { - if (props.hasOwnProperty("value")) { - setDefaultValue(node, props.type, value); - } else if (props.hasOwnProperty("defaultValue")) { - setDefaultValue(node, props.type, getToStringValue(props.defaultValue)); - } - } - { - if (props.checked == null && props.defaultChecked != null) { - node.defaultChecked = !!props.defaultChecked; - } - } - } - function postMountWrapper(element, props, isHydrating2) { - var node = element; - if (props.hasOwnProperty("value") || props.hasOwnProperty("defaultValue")) { - var type = props.type; - var isButton = type === "submit" || type === "reset"; - if (isButton && (props.value === void 0 || props.value === null)) { - return; - } - var initialValue = toString(node._wrapperState.initialValue); - if (!isHydrating2) { - { - if (initialValue !== node.value) { - node.value = initialValue; - } - } - } - { - node.defaultValue = initialValue; - } - } - var name = node.name; - if (name !== "") { - node.name = ""; - } - { - node.defaultChecked = !node.defaultChecked; - node.defaultChecked = !!node._wrapperState.initialChecked; - } - if (name !== "") { - node.name = name; - } - } - function restoreControlledState(element, props) { - var node = element; - updateWrapper(node, props); - updateNamedCousins(node, props); - } - function updateNamedCousins(rootNode, props) { - var name = props.name; - if (props.type === "radio" && name != null) { - var queryRoot = rootNode; - while (queryRoot.parentNode) { - queryRoot = queryRoot.parentNode; - } - { - checkAttributeStringCoercion(name, "name"); - } - var group = queryRoot.querySelectorAll("input[name=" + JSON.stringify("" + name) + '][type="radio"]'); - for (var i = 0; i < group.length; i++) { - var otherNode = group[i]; - if (otherNode === rootNode || otherNode.form !== rootNode.form) { - continue; - } - var otherProps = getFiberCurrentPropsFromNode(otherNode); - if (!otherProps) { - throw new Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported."); - } - updateValueIfChanged(otherNode); - updateWrapper(otherNode, otherProps); - } - } - } - function setDefaultValue(node, type, value) { - if ( - // Focused number inputs synchronize on blur. See ChangeEventPlugin.js - type !== "number" || getActiveElement(node.ownerDocument) !== node - ) { - if (value == null) { - node.defaultValue = toString(node._wrapperState.initialValue); - } else if (node.defaultValue !== toString(value)) { - node.defaultValue = toString(value); - } - } - } - var didWarnSelectedSetOnOption = false; - var didWarnInvalidChild = false; - var didWarnInvalidInnerHTML = false; - function validateProps(element, props) { - { - if (props.value == null) { - if (typeof props.children === "object" && props.children !== null) { - React.Children.forEach(props.children, function(child) { - if (child == null) { - return; - } - if (typeof child === "string" || typeof child === "number") { - return; - } - if (!didWarnInvalidChild) { - didWarnInvalidChild = true; - error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to