{ "version": 3, "sources": ["../../../../node_modules/base-x/src/index.js", "../../../../node_modules/base64-js/index.js", "../../../../node_modules/ieee754/index.js", "../../../../node_modules/buffer/index.js", "../../../../node_modules/preact/src/constants.js", "../../../../node_modules/preact/src/util.js", "../../../../node_modules/preact/src/options.js", "../../../../node_modules/preact/src/create-element.js", "../../../../node_modules/preact/src/component.js", "../../../../node_modules/preact/src/diff/props.js", "../../../../node_modules/preact/src/create-context.js", "../../../../node_modules/preact/src/diff/children.js", "../../../../node_modules/preact/src/diff/index.js", "../../../../node_modules/preact/src/render.js", "../../../../node_modules/preact/src/clone-element.js", "../../../../node_modules/preact/src/diff/catch-error.js", "../../../../node_modules/preact/hooks/src/index.js", "../../../../node_modules/preact/compat/src/util.js", "../../../../node_modules/preact/compat/src/hooks.js", "../../../../node_modules/preact/compat/src/PureComponent.js", "../../../../node_modules/preact/compat/src/memo.js", "../../../../node_modules/preact/compat/src/forwardRef.js", "../../../../node_modules/preact/compat/src/Children.js", "../../../../node_modules/preact/compat/src/suspense.js", "../../../../node_modules/preact/compat/src/suspense-list.js", "../../../../node_modules/preact/src/constants.js", "../../../../node_modules/preact/compat/src/portals.js", "../../../../node_modules/preact/compat/src/render.js", "../../../../node_modules/preact/compat/src/index.js", "../../../../node_modules/classnames/index.js", "../../../lib.shared.utils/to_string.ts", "../../../lib.shared.utils/index.ts", "../../../../node_modules/mobx/src/errors.ts", "../../../../node_modules/mobx/src/utils/global.ts", "../../../../node_modules/mobx/src/utils/utils.ts", "../../../../node_modules/mobx/src/api/decorators.ts", "../../../../node_modules/mobx/src/core/atom.ts", "../../../../node_modules/mobx/src/utils/comparer.ts", "../../../../node_modules/mobx/src/types/modifiers.ts", "../../../../node_modules/mobx/src/types/overrideannotation.ts", "../../../../node_modules/mobx/src/types/actionannotation.ts", "../../../../node_modules/mobx/src/types/flowannotation.ts", "../../../../node_modules/mobx/src/types/computedannotation.ts", "../../../../node_modules/mobx/src/types/observableannotation.ts", "../../../../node_modules/mobx/src/types/autoannotation.ts", "../../../../node_modules/mobx/src/api/observable.ts", "../../../../node_modules/mobx/src/api/computed.ts", "../../../../node_modules/mobx/src/core/action.ts", "../../../../node_modules/mobx/src/types/observablevalue.ts", "../../../../node_modules/mobx/src/core/computedvalue.ts", "../../../../node_modules/mobx/src/core/derivation.ts", "../../../../node_modules/mobx/src/core/globalstate.ts", "../../../../node_modules/mobx/src/core/observable.ts", "../../../../node_modules/mobx/src/core/reaction.ts", "../../../../node_modules/mobx/src/core/spy.ts", "../../../../node_modules/mobx/src/api/action.ts", "../../../../node_modules/mobx/src/api/autorun.ts", "../../../../node_modules/mobx/src/api/become-observed.ts", "../../../../node_modules/mobx/src/api/configure.ts", "../../../../node_modules/mobx/src/api/extendobservable.ts", "../../../../node_modules/mobx/src/api/extras.ts", "../../../../node_modules/mobx/src/api/flow.ts", "../../../../node_modules/mobx/src/api/intercept-read.ts", "../../../../node_modules/mobx/src/api/intercept.ts", "../../../../node_modules/mobx/src/api/iscomputed.ts", "../../../../node_modules/mobx/src/api/isobservable.ts", "../../../../node_modules/mobx/src/api/object-api.ts", "../../../../node_modules/mobx/src/api/observe.ts", "../../../../node_modules/mobx/src/api/tojs.ts", "../../../../node_modules/mobx/src/api/trace.ts", "../../../../node_modules/mobx/src/api/transaction.ts", "../../../../node_modules/mobx/src/api/when.ts", "../../../../node_modules/mobx/src/types/dynamicobject.ts", "../../../../node_modules/mobx/src/types/intercept-utils.ts", "../../../../node_modules/mobx/src/types/listen-utils.ts", "../../../../node_modules/mobx/src/api/makeObservable.ts", "../../../../node_modules/mobx/src/types/observablearray.ts", "../../../../node_modules/mobx/src/types/observablemap.ts", "../../../../node_modules/mobx/src/types/observableset.ts", "../../../../node_modules/mobx/src/types/observableobject.ts", "../../../../node_modules/mobx/src/types/legacyobservablearray.ts", "../../../../node_modules/mobx/src/types/type-utils.ts", "../../../../node_modules/mobx/src/utils/eq.ts", "../../../../node_modules/mobx/src/utils/iterable.ts", "../../../../node_modules/mobx/src/api/annotation.ts", "../../../../node_modules/mobx/src/mobx.ts", "../../../lib.web.utils/index.ts"], "sourcesContent": ["'use strict'\n// base-x encoding / decoding\n// Copyright (c) 2018 base-x contributors\n// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)\n// Distributed under the MIT software license, see the accompanying\n// file LICENSE or http://www.opensource.org/licenses/mit-license.php.\nfunction base (ALPHABET) {\n if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }\n var BASE_MAP = new Uint8Array(256)\n for (var j = 0; j < BASE_MAP.length; j++) {\n BASE_MAP[j] = 255\n }\n for (var i = 0; i < ALPHABET.length; i++) {\n var x = ALPHABET.charAt(i)\n var xc = x.charCodeAt(0)\n if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }\n BASE_MAP[xc] = i\n }\n var BASE = ALPHABET.length\n var LEADER = ALPHABET.charAt(0)\n var FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up\n var iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up\n function encode (source) {\n if (source instanceof Uint8Array) {\n } else if (ArrayBuffer.isView(source)) {\n source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength)\n } else if (Array.isArray(source)) {\n source = Uint8Array.from(source)\n }\n if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }\n if (source.length === 0) { return '' }\n // Skip & count leading zeroes.\n var zeroes = 0\n var length = 0\n var pbegin = 0\n var pend = source.length\n while (pbegin !== pend && source[pbegin] === 0) {\n pbegin++\n zeroes++\n }\n // Allocate enough space in big-endian base58 representation.\n var size = ((pend - pbegin) * iFACTOR + 1) >>> 0\n var b58 = new Uint8Array(size)\n // Process the bytes.\n while (pbegin !== pend) {\n var carry = source[pbegin]\n // Apply \"b58 = b58 * 256 + ch\".\n var i = 0\n for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {\n carry += (256 * b58[it1]) >>> 0\n b58[it1] = (carry % BASE) >>> 0\n carry = (carry / BASE) >>> 0\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i\n pbegin++\n }\n // Skip leading zeroes in base58 result.\n var it2 = size - length\n while (it2 !== size && b58[it2] === 0) {\n it2++\n }\n // Translate the result into a string.\n var str = LEADER.repeat(zeroes)\n for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]) }\n return str\n }\n function decodeUnsafe (source) {\n if (typeof source !== 'string') { throw new TypeError('Expected String') }\n if (source.length === 0) { return new Uint8Array() }\n var psz = 0\n // Skip and count leading '1's.\n var zeroes = 0\n var length = 0\n while (source[psz] === LEADER) {\n zeroes++\n psz++\n }\n // Allocate enough space in big-endian base256 representation.\n var size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.\n var b256 = new Uint8Array(size)\n // Process the characters.\n while (source[psz]) {\n // Decode character\n var carry = BASE_MAP[source.charCodeAt(psz)]\n // Invalid character\n if (carry === 255) { return }\n var i = 0\n for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {\n carry += (BASE * b256[it3]) >>> 0\n b256[it3] = (carry % 256) >>> 0\n carry = (carry / 256) >>> 0\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i\n psz++\n }\n // Skip leading zeroes in b256.\n var it4 = size - length\n while (it4 !== size && b256[it4] === 0) {\n it4++\n }\n var vch = new Uint8Array(zeroes + (size - it4))\n var j = zeroes\n while (it4 !== size) {\n vch[j++] = b256[it4++]\n }\n return vch\n }\n function decode (string) {\n var buffer = decodeUnsafe(string)\n if (buffer) { return buffer }\n throw new Error('Non-base' + BASE + ' character')\n }\n return {\n encode: encode,\n decodeUnsafe: decodeUnsafe,\n decode: decode\n }\n}\nmodule.exports = base\n", "'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n", "exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n", "/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <https://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol.for === 'function')\n ? Symbol.for('nodejs.util.inspect.custom')\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nvar K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n var arr = new Uint8Array(1)\n var proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n var buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayLike(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n var valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n var b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(\n value[Symbol.toPrimitive]('string'), encodingOrOffset, length\n )\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n var length = byteLength(string, encoding) | 0\n var buf = createBuffer(length)\n\n var actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n var buf = createBuffer(length)\n for (var i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n var buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n var buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n buf = Buffer.from(buf)\n }\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n var len = string.length\n var mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return '<Buffer ' + str + '>'\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n var strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (var i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n var len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nvar hexSliceLookupTable = (function () {\n var alphabet = '0123456789abcdef'\n var table = new Array(256)\n for (var i = 0; i < 16; ++i) {\n var i16 = i * 16\n for (var j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n", "/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n", "import { EMPTY_ARR } from './constants';\n\nexport const isArray = Array.isArray;\n\n/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\t// @ts-expect-error We change the type of `obj` to be `O & P`\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\n * @param {import('./index').ContainerNode} node The node to remove\n */\nexport function removeNode(node) {\n\tif (node && node.parentNode) node.parentNode.removeChild(node);\n}\n\nexport const slice = EMPTY_ARR.slice;\n", "import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n", "import { slice } from './util';\nimport options from './options';\nimport { NULL, UNDEFINED } from './constants';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor for this\n * virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array<import('.').ComponentChildren>} [children] The children of the\n * virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != NULL) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === UNDEFINED) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, NULL);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\t/** @type {import('./internal').VNode} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: NULL,\n\t\t_parent: NULL,\n\t\t_depth: 0,\n\t\t_dom: NULL,\n\t\t_component: NULL,\n\t\tconstructor: UNDEFINED,\n\t\t_original: original == NULL ? ++vnodeId : original,\n\t\t_index: -1,\n\t\t_flags: 0\n\t};\n\n\t// Only invoke the vnode hook if this was *not* a direct copy:\n\tif (original == NULL && options.vnode != NULL) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: NULL };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != NULL && vnode.constructor == UNDEFINED;\n", "import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\nimport { MODE_HYDRATE, NULL } from './constants';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function BaseComponent(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {import('./internal').Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nBaseComponent.prototype.setState = function (update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != NULL && this._nextState !== this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == NULL) return;\n\n\tif (this._vnode) {\n\t\tif (callback) {\n\t\t\tthis._stateCallbacks.push(callback);\n\t\t}\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {import('./internal').Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nBaseComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](https://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {ComponentChildren | void}\n */\nBaseComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == NULL) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._index + 1)\n\t\t\t: NULL;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != NULL && sibling._dom != NULL) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : NULL;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tlet oldVNode = component._vnode,\n\t\toldDom = oldVNode._dom,\n\t\tcommitQueue = [],\n\t\trefQueue = [];\n\n\tif (component._parentDom) {\n\t\tconst newVNode = assign({}, oldVNode);\n\t\tnewVNode._original = oldVNode._original + 1;\n\t\tif (options.vnode) options.vnode(newVNode);\n\n\t\tdiff(\n\t\t\tcomponent._parentDom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tcomponent._parentDom.namespaceURI,\n\t\t\toldVNode._flags & MODE_HYDRATE ? [oldDom] : NULL,\n\t\t\tcommitQueue,\n\t\t\toldDom == NULL ? getDomSibling(oldVNode) : oldDom,\n\t\t\t!!(oldVNode._flags & MODE_HYDRATE),\n\t\t\trefQueue\n\t\t);\n\n\t\tnewVNode._original = oldVNode._original;\n\t\tnewVNode._parent._children[newVNode._index] = newVNode;\n\t\tcommitRoot(commitQueue, newVNode, refQueue);\n\n\t\tif (newVNode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(newVNode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != NULL && vnode._component != NULL) {\n\t\tvnode._dom = vnode._component.base = NULL;\n\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\tlet child = vnode._children[i];\n\t\t\tif (child != NULL && child._dom != NULL) {\n\t\t\t\tvnode._dom = vnode._component.base = child._dom;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array<import('./internal').Component>}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce !== options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/**\n * @param {import('./internal').Component} a\n * @param {import('./internal').Component} b\n */\nconst depthSort = (a, b) => a._vnode._depth - b._vnode._depth;\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\tlet c,\n\t\tl = 1;\n\n\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t// process() calls from getting scheduled while `queue` is still being consumed.\n\twhile (rerenderQueue.length) {\n\t\t// Keep the rerender queue sorted by (depth, insertion order). The queue\n\t\t// will initially be sorted on the first iteration only if it has more than 1 item.\n\t\t//\n\t\t// New items can be added to the queue e.g. when rerendering a provider, so we want to\n\t\t// keep the order from top to bottom with those new items so we can handle them in a\n\t\t// single pass\n\t\tif (rerenderQueue.length > l) {\n\t\t\trerenderQueue.sort(depthSort);\n\t\t}\n\n\t\tc = rerenderQueue.shift();\n\t\tl = rerenderQueue.length;\n\n\t\tif (c._dirty) {\n\t\t\trenderComponent(c);\n\t\t}\n\t}\n\tprocess._rerenderCount = 0;\n}\n\nprocess._rerenderCount = 0;\n", "import { IS_NON_DIMENSIONAL, NULL, SVG_NAMESPACE } from '../constants';\nimport options from '../options';\n\nfunction setStyle(style, key, value) {\n\tif (key[0] == '-') {\n\t\tstyle.setProperty(key, value == NULL ? '' : value);\n\t} else if (value == NULL) {\n\t\tstyle[key] = '';\n\t} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n\t\tstyle[key] = value;\n\t} else {\n\t\tstyle[key] = value + 'px';\n\t}\n}\n\nconst CAPTURE_REGEX = /(PointerCapture)$|Capture$/i;\n\n// A logical clock to solve issues like https://github.com/preactjs/preact/issues/3927.\n// When the DOM performs an event it leaves micro-ticks in between bubbling up which means that\n// an event can trigger on a newly reated DOM-node while the event bubbles up.\n//\n// Originally inspired by Vue\n// (https://github.com/vuejs/core/blob/caeb8a68811a1b0f79/packages/runtime-dom/src/modules/events.ts#L90-L101),\n// but modified to use a logical clock instead of Date.now() in case event handlers get attached\n// and events get dispatched during the same millisecond.\n//\n// The clock is incremented after each new event dispatch. This allows 1 000 000 new events\n// per second for over 280 years before the value reaches Number.MAX_SAFE_INTEGER (2**53 - 1).\nlet eventClock = 0;\n\n/**\n * Set a property value on a DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {string} namespace Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, namespace) {\n\tlet useCapture;\n\n\to: if (name == 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] !== oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] == 'o' && name[1] == 'n') {\n\t\tuseCapture = name != (name = name.replace(CAPTURE_REGEX, '$1'));\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (\n\t\t\tname.toLowerCase() in dom ||\n\t\t\tname == 'onFocusOut' ||\n\t\t\tname == 'onFocusIn'\n\t\t)\n\t\t\tname = name.toLowerCase().slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tvalue._attached = eventClock;\n\t\t\t\tdom.addEventListener(\n\t\t\t\t\tname,\n\t\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\t\tuseCapture\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tvalue._attached = oldValue._attached;\n\t\t\t}\n\t\t} else {\n\t\t\tdom.removeEventListener(\n\t\t\t\tname,\n\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\tuseCapture\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif (namespace == SVG_NAMESPACE) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname != 'width' &&\n\t\t\tname != 'height' &&\n\t\t\tname != 'href' &&\n\t\t\tname != 'list' &&\n\t\t\tname != 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname != 'tabIndex' &&\n\t\t\tname != 'download' &&\n\t\t\tname != 'rowSpan' &&\n\t\t\tname != 'colSpan' &&\n\t\t\tname != 'role' &&\n\t\t\tname != 'popover' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == NULL ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// aria- and data- attributes have no boolean representation.\n\t\t// A `false` value is different from the attribute not being\n\t\t// present, so we can't remove it. For non-boolean aria\n\t\t// attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost too many bytes. On top of\n\t\t// that other frameworks generally stringify `false`.\n\n\t\tif (typeof value == 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (value != NULL && (value !== false || name[4] == '-')) {\n\t\t\tdom.setAttribute(name, name == 'popover' && value == true ? '' : value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Create an event proxy function.\n * @param {boolean} useCapture Is the event handler for the capture phase.\n * @private\n */\nfunction createEventProxy(useCapture) {\n\t/**\n\t * Proxy an event to hooked event handlers\n\t * @param {import('../internal').PreactEvent} e The event object from the browser\n\t * @private\n\t */\n\treturn function (e) {\n\t\tif (this._listeners) {\n\t\t\tconst eventHandler = this._listeners[e.type + useCapture];\n\t\t\tif (e._dispatched == NULL) {\n\t\t\t\te._dispatched = eventClock++;\n\n\t\t\t\t// When `e._dispatched` is smaller than the time when the targeted event\n\t\t\t\t// handler was attached we know we have bubbled up to an element that was added\n\t\t\t\t// during patching the DOM.\n\t\t\t} else if (e._dispatched < eventHandler._attached) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn eventHandler(options.event ? options.event(e) : e);\n\t\t}\n\t};\n}\n\nconst eventProxy = createEventProxy(false);\nconst eventProxyCapture = createEventProxy(true);\n", "import { enqueueRender } from './component';\nimport { NULL } from './constants';\n\nexport let i = 0;\n\nexport function createContext(defaultValue) {\n\tfunction Context(props) {\n\t\tif (!this.getChildContext) {\n\t\t\t/** @type {Set<import('./internal').Component> | null} */\n\t\t\tlet subs = new Set();\n\t\t\tlet ctx = {};\n\t\t\tctx[Context._id] = this;\n\n\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\tthis.componentWillUnmount = () => {\n\t\t\t\tsubs = NULL;\n\t\t\t};\n\n\t\t\tthis.shouldComponentUpdate = function (_props) {\n\t\t\t\t// @ts-expect-error even\n\t\t\t\tif (this.props.value !== _props.value) {\n\t\t\t\t\tsubs.forEach(c => {\n\t\t\t\t\t\tc._force = true;\n\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.sub = c => {\n\t\t\t\tsubs.add(c);\n\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\tif (subs) {\n\t\t\t\t\t\tsubs.delete(c);\n\t\t\t\t\t}\n\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\treturn props.children;\n\t}\n\n\tContext._id = '__cC' + i++;\n\tContext._defaultValue = defaultValue;\n\n\t/** @type {import('./internal').FunctionComponent} */\n\tContext.Consumer = (props, contextValue) => {\n\t\treturn props.children(contextValue);\n\t};\n\n\t// we could also get rid of _contextRef entirely\n\tContext.Provider =\n\t\tContext._contextRef =\n\t\tContext.Consumer.contextType =\n\t\t\tContext;\n\n\treturn Context;\n}\n", "import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport {\n\tEMPTY_OBJ,\n\tEMPTY_ARR,\n\tINSERT_VNODE,\n\tMATCHED,\n\tUNDEFINED,\n\tNULL\n} from '../constants';\nimport { isArray } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * Diff the children of a virtual node\n * @param {PreactElement} parentDom The DOM element whose children are being\n * diffed\n * @param {ComponentChildren[]} renderResult\n * @param {VNode} newParentVNode The new virtual node whose children should be\n * diff'ed against oldParentVNode\n * @param {VNode} oldParentVNode The old virtual node whose children should be\n * diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\tlet i,\n\t\t/** @type {VNode} */\n\t\toldVNode,\n\t\t/** @type {VNode} */\n\t\tchildVNode,\n\t\t/** @type {PreactElement} */\n\t\tnewDom,\n\t\t/** @type {PreactElement} */\n\t\tfirstChildDom;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\t/** @type {VNode[]} */\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet newChildrenLength = renderResult.length;\n\n\toldDom = constructNewChildrenArray(\n\t\tnewParentVNode,\n\t\trenderResult,\n\t\toldChildren,\n\t\toldDom,\n\t\tnewChildrenLength\n\t);\n\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\tchildVNode = newParentVNode._children[i];\n\t\tif (childVNode == NULL) continue;\n\n\t\t// At this point, constructNewChildrenArray has assigned _index to be the\n\t\t// matchingIndex for this VNode's oldVNode (or -1 if there is no oldVNode).\n\t\tif (childVNode._index === -1) {\n\t\t\toldVNode = EMPTY_OBJ;\n\t\t} else {\n\t\t\toldVNode = oldChildren[childVNode._index] || EMPTY_OBJ;\n\t\t}\n\n\t\t// Update childVNode._index to its final index\n\t\tchildVNode._index = i;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tlet result = diff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\n\t\t// Adjust DOM nodes\n\t\tnewDom = childVNode._dom;\n\t\tif (childVNode.ref && oldVNode.ref != childVNode.ref) {\n\t\t\tif (oldVNode.ref) {\n\t\t\t\tapplyRef(oldVNode.ref, NULL, childVNode);\n\t\t\t}\n\t\t\trefQueue.push(\n\t\t\t\tchildVNode.ref,\n\t\t\t\tchildVNode._component || newDom,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t}\n\n\t\tif (firstChildDom == NULL && newDom != NULL) {\n\t\t\tfirstChildDom = newDom;\n\t\t}\n\n\t\tif (\n\t\t\tchildVNode._flags & INSERT_VNODE ||\n\t\t\toldVNode._children === childVNode._children\n\t\t) {\n\t\t\toldDom = insert(childVNode, oldDom, parentDom);\n\t\t} else if (typeof childVNode.type == 'function' && result !== UNDEFINED) {\n\t\t\toldDom = result;\n\t\t} else if (newDom) {\n\t\t\toldDom = newDom.nextSibling;\n\t\t}\n\n\t\t// Unset diffing flags\n\t\tchildVNode._flags &= ~(INSERT_VNODE | MATCHED);\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} newParentVNode\n * @param {ComponentChildren[]} renderResult\n * @param {VNode[]} oldChildren\n */\nfunction constructNewChildrenArray(\n\tnewParentVNode,\n\trenderResult,\n\toldChildren,\n\toldDom,\n\tnewChildrenLength\n) {\n\t/** @type {number} */\n\tlet i;\n\t/** @type {VNode} */\n\tlet childVNode;\n\t/** @type {VNode} */\n\tlet oldVNode;\n\n\tlet oldChildrenLength = oldChildren.length,\n\t\tremainingOldChildren = oldChildrenLength;\n\n\tlet skew = 0;\n\n\tnewParentVNode._children = new Array(newChildrenLength);\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\t// @ts-expect-error We are reusing the childVNode variable to hold both the\n\t\t// pre and post normalized childVNode\n\t\tchildVNode = renderResult[i];\n\n\t\tif (\n\t\t\tchildVNode == NULL ||\n\t\t\ttypeof childVNode == 'boolean' ||\n\t\t\ttypeof childVNode == 'function'\n\t\t) {\n\t\t\tnewParentVNode._children[i] = NULL;\n\t\t\tcontinue;\n\t\t}\n\t\t// If this newVNode is being reused (e.g. <div>{reuse}{reuse}</div>) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (\n\t\t\ttypeof childVNode == 'string' ||\n\t\t\ttypeof childVNode == 'number' ||\n\t\t\t// eslint-disable-next-line valid-typeof\n\t\t\ttypeof childVNode == 'bigint' ||\n\t\t\tchildVNode.constructor == String\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tNULL,\n\t\t\t\tchildVNode,\n\t\t\t\tNULL,\n\t\t\t\tNULL,\n\t\t\t\tNULL\n\t\t\t);\n\t\t} else if (isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tNULL,\n\t\t\t\tNULL,\n\t\t\t\tNULL\n\t\t\t);\n\t\t} else if (childVNode.constructor === UNDEFINED && childVNode._depth > 0) {\n\t\t\t// VNode is already in use, clone it. This can happen in the following\n\t\t\t// scenario:\n\t\t\t// const reuse = <div />\n\t\t\t// <div>{reuse}<span />{reuse}</div>\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tchildVNode.ref ? childVNode.ref : NULL,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tchildVNode = newParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\tconst skewedIndex = i + skew;\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Temporarily store the matchingIndex on the _index property so we can pull\n\t\t// out the oldVNode in diffChildren. We'll override this to the VNode's\n\t\t// final index after using this property to get the oldVNode\n\t\tconst matchingIndex = (childVNode._index = findMatchingIndex(\n\t\t\tchildVNode,\n\t\t\toldChildren,\n\t\t\tskewedIndex,\n\t\t\tremainingOldChildren\n\t\t));\n\n\t\toldVNode = NULL;\n\t\tif (matchingIndex !== -1) {\n\t\t\toldVNode = oldChildren[matchingIndex];\n\t\t\tremainingOldChildren--;\n\t\t\tif (oldVNode) {\n\t\t\t\toldVNode._flags |= MATCHED;\n\t\t\t}\n\t\t}\n\n\t\t// Here, we define isMounting for the purposes of the skew diffing\n\t\t// algorithm. Nodes that are unsuspending are considered mounting and we detect\n\t\t// this by checking if oldVNode._original === null\n\t\tconst isMounting = oldVNode == NULL || oldVNode._original === NULL;\n\n\t\tif (isMounting) {\n\t\t\tif (matchingIndex == -1) {\n\t\t\t\tskew--;\n\t\t\t}\n\n\t\t\t// If we are mounting a DOM VNode, mark it for insertion\n\t\t\tif (typeof childVNode.type != 'function') {\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t} else if (matchingIndex != skewedIndex) {\n\t\t\t// When we move elements around i.e. [0, 1, 2] --> [1, 0, 2]\n\t\t\t// --> we diff 1, we find it at position 1 while our skewed index is 0 and our skew is 0\n\t\t\t// we set the skew to 1 as we found an offset.\n\t\t\t// --> we diff 0, we find it at position 0 while our skewed index is at 2 and our skew is 1\n\t\t\t// this makes us increase the skew again.\n\t\t\t// --> we diff 2, we find it at position 2 while our skewed index is at 4 and our skew is 2\n\t\t\t//\n\t\t\t// this becomes an optimization question where currently we see a 1 element offset as an insertion\n\t\t\t// or deletion i.e. we optimize for [0, 1, 2] --> [9, 0, 1, 2]\n\t\t\t// while a more than 1 offset we see as a swap.\n\t\t\t// We could probably build heuristics for having an optimized course of action here as well, but\n\t\t\t// might go at the cost of some bytes.\n\t\t\t//\n\t\t\t// If we wanted to optimize for i.e. only swaps we'd just do the last two code-branches and have\n\t\t\t// only the first item be a re-scouting and all the others fall in their skewed counter-part.\n\t\t\t// We could also further optimize for swaps\n\t\t\tif (matchingIndex == skewedIndex - 1) {\n\t\t\t\tskew--;\n\t\t\t} else if (matchingIndex == skewedIndex + 1) {\n\t\t\t\tskew++;\n\t\t\t} else {\n\t\t\t\tif (matchingIndex > skewedIndex) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\n\t\t\t\t// Move this VNode's DOM if the original index (matchingIndex) doesn't\n\t\t\t\t// match the new skew index (i + new skew)\n\t\t\t\t// In the former two branches we know that it matches after skewing\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any. Loop forwards so that as we\n\t// unmount DOM from the beginning of the oldChildren, we can adjust oldDom to\n\t// point to the next child, which needs to be the first DOM node that won't be\n\t// unmounted.\n\tif (remainingOldChildren) {\n\t\tfor (i = 0; i < oldChildrenLength; i++) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode != NULL && (oldVNode._flags & MATCHED) == 0) {\n\t\t\t\tif (oldVNode._dom == oldDom) {\n\t\t\t\t\toldDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\n\t\t\t\tunmount(oldVNode, oldVNode);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} parentVNode\n * @param {PreactElement} oldDom\n * @param {PreactElement} parentDom\n * @returns {PreactElement}\n */\nfunction insert(parentVNode, oldDom, parentDom) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\n\tif (typeof parentVNode.type == 'function') {\n\t\tlet children = parentVNode._children;\n\t\tfor (let i = 0; children && i < children.length; i++) {\n\t\t\tif (children[i]) {\n\t\t\t\t// If we enter this code path on sCU bailout, where we copy\n\t\t\t\t// oldVNode._children to newVNode._children, we need to update the old\n\t\t\t\t// children's _parent pointer to point to the newVNode (parentVNode\n\t\t\t\t// here).\n\t\t\t\tchildren[i]._parent = parentVNode;\n\t\t\t\toldDom = insert(children[i], oldDom, parentDom);\n\t\t\t}\n\t\t}\n\n\t\treturn oldDom;\n\t} else if (parentVNode._dom != oldDom) {\n\t\tif (oldDom && parentVNode.type && !parentDom.contains(oldDom)) {\n\t\t\toldDom = getDomSibling(parentVNode);\n\t\t}\n\t\tparentDom.insertBefore(parentVNode._dom, oldDom || NULL);\n\t\toldDom = parentVNode._dom;\n\t}\n\n\tdo {\n\t\toldDom = oldDom && oldDom.nextSibling;\n\t} while (oldDom != NULL && oldDom.nodeType == 8);\n\n\treturn oldDom;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {ComponentChildren} children The unflattened children of a virtual\n * node\n * @returns {VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == NULL || typeof children == 'boolean') {\n\t} else if (isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\n/**\n * @param {VNode} childVNode\n * @param {VNode[]} oldChildren\n * @param {number} skewedIndex\n * @param {number} remainingOldChildren\n * @returns {number}\n */\nfunction findMatchingIndex(\n\tchildVNode,\n\toldChildren,\n\tskewedIndex,\n\tremainingOldChildren\n) {\n\tconst key = childVNode.key;\n\tconst type = childVNode.type;\n\tlet oldVNode = oldChildren[skewedIndex];\n\n\t// We only need to perform a search if there are more children\n\t// (remainingOldChildren) to search. However, if the oldVNode we just looked\n\t// at skewedIndex was not already used in this diff, then there must be at\n\t// least 1 other (so greater than 1) remainingOldChildren to attempt to match\n\t// against. So the following condition checks that ensuring\n\t// remainingOldChildren > 1 if the oldVNode is not already used/matched. Else\n\t// if the oldVNode was null or matched, then there could needs to be at least\n\t// 1 (aka `remainingOldChildren > 0`) children to find and compare against.\n\t//\n\t// If there is an unkeyed functional VNode, that isn't a built-in like our Fragment,\n\t// we should not search as we risk re-using state of an unrelated VNode. (reverted for now)\n\tlet shouldSearch =\n\t\t// (typeof type != 'function' || type === Fragment || key) &&\n\t\tremainingOldChildren >\n\t\t(oldVNode != NULL && (oldVNode._flags & MATCHED) == 0 ? 1 : 0);\n\n\tif (\n\t\toldVNode === NULL ||\n\t\t(oldVNode &&\n\t\t\tkey == oldVNode.key &&\n\t\t\ttype === oldVNode.type &&\n\t\t\t(oldVNode._flags & MATCHED) == 0)\n\t) {\n\t\treturn skewedIndex;\n\t} else if (shouldSearch) {\n\t\tlet x = skewedIndex - 1;\n\t\tlet y = skewedIndex + 1;\n\t\twhile (x >= 0 || y < oldChildren.length) {\n\t\t\tif (x >= 0) {\n\t\t\t\toldVNode = oldChildren[x];\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\t(oldVNode._flags & MATCHED) == 0 &&\n\t\t\t\t\tkey == oldVNode.key &&\n\t\t\t\t\ttype === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\treturn x;\n\t\t\t\t}\n\t\t\t\tx--;\n\t\t\t}\n\n\t\t\tif (y < oldChildren.length) {\n\t\t\t\toldVNode = oldChildren[y];\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\t(oldVNode._flags & MATCHED) == 0 &&\n\t\t\t\t\tkey == oldVNode.key &&\n\t\t\t\t\ttype === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\treturn y;\n\t\t\t\t}\n\t\t\t\ty++;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn -1;\n}\n", "import {\n\tEMPTY_OBJ,\n\tMATH_NAMESPACE,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tNULL,\n\tRESET_MODE,\n\tSVG_NAMESPACE,\n\tUNDEFINED,\n\tXHTML_NAMESPACE\n} from '../constants';\nimport { BaseComponent, getDomSibling } from '../component';\nimport { Fragment } from '../create-element';\nimport { diffChildren } from './children';\nimport { setProperty } from './props';\nimport { assign, isArray, removeNode, slice } from '../util';\nimport options from '../options';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * @template {any} T\n * @typedef {import('../internal').Ref<T>} Ref<T>\n */\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {PreactElement} parentDom The parent of the DOM element\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\t/** @type {any} */\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== UNDEFINED) return NULL;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._flags & MODE_SUSPENDED) {\n\t\tisHydrating = !!(oldVNode._flags & MODE_HYDRATE);\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\touter: if (typeof newType == 'function') {\n\t\ttry {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\t\t\tconst isClassComponent =\n\t\t\t\t'prototype' in newType && newType.prototype.render;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif (isClassComponent) {\n\t\t\t\t\t// @ts-expect-error The check above verifies that newType is suppose to be constructed\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-expect-error Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new BaseComponent(\n\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tc.props = newProps;\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc.context = componentContext;\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (isClassComponent && c._nextState == NULL) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\n\t\t\tif (isClassComponent && newType.getDerivedStateFromProps != NULL) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\t\t\tc._vnode = newVNode;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == NULL &&\n\t\t\t\t\tc.componentWillMount != NULL\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidMount != NULL) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == NULL &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != NULL\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t!c._force &&\n\t\t\t\t\t((c.shouldComponentUpdate != NULL &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false) ||\n\t\t\t\t\t\tnewVNode._original == oldVNode._original)\n\t\t\t\t) {\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original != oldVNode._original) {\n\t\t\t\t\t\t// When we are dealing with a bail because of sCU we have to update\n\t\t\t\t\t\t// the props, state and dirty-state.\n\t\t\t\t\t\t// when we are dealing with strict-equality we don't as the child could still\n\t\t\t\t\t\t// be dirtied see #3883\n\t\t\t\t\t\tc.props = newProps;\n\t\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t\tc._dirty = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tnewVNode._children.some(vnode => {\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t\t}\n\t\t\t\t\tc._stateCallbacks = [];\n\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != NULL) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidUpdate != NULL) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc._parentDom = parentDom;\n\t\t\tc._force = false;\n\n\t\t\tlet renderHook = options._render,\n\t\t\t\tcount = 0;\n\t\t\tif (isClassComponent) {\n\t\t\t\tc.state = c._nextState;\n\t\t\t\tc._dirty = false;\n\n\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t}\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t} else {\n\t\t\t\tdo {\n\t\t\t\t\tc._dirty = false;\n\t\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\t\t// Handle setState called in render, see #2553\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t} while (c._dirty && ++count < 25);\n\t\t\t}\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != NULL) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (isClassComponent && !isNew && c.getSnapshotBeforeUpdate != NULL) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet isTopLevelFragment =\n\t\t\t\ttmp != NULL && tmp.type === Fragment && tmp.key == NULL;\n\t\t\tlet renderResult = isTopLevelFragment ? tmp.props.children : tmp;\n\n\t\t\tif (isTopLevelFragment) {\n\t\t\t\ttmp.props.children = NULL;\n\t\t\t}\n\n\t\t\toldDom = diffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tisArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnamespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._flags &= RESET_MODE;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = NULL;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tnewVNode._original = NULL;\n\t\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\t\tif (isHydrating || excessDomChildren != NULL) {\n\t\t\t\tif (e.then) {\n\t\t\t\t\tnewVNode._flags |= isHydrating\n\t\t\t\t\t\t? MODE_HYDRATE | MODE_SUSPENDED\n\t\t\t\t\t\t: MODE_SUSPENDED;\n\n\t\t\t\t\twhile (oldDom && oldDom.nodeType == 8 && oldDom.nextSibling) {\n\t\t\t\t\t\toldDom = oldDom.nextSibling;\n\t\t\t\t\t}\n\n\t\t\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = NULL;\n\t\t\t\t\tnewVNode._dom = oldDom;\n\t\t\t\t} else {\n\t\t\t\t\tfor (let i = excessDomChildren.length; i--; ) {\n\t\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t}\n\t\t\toptions._catchError(e, newVNode, oldVNode);\n\t\t}\n\t} else if (\n\t\texcessDomChildren == NULL &&\n\t\tnewVNode._original == oldVNode._original\n\t) {\n\t\tnewVNode._children = oldVNode._children;\n\t\tnewVNode._dom = oldVNode._dom;\n\t} else {\n\t\toldDom = newVNode._dom = diffElementNodes(\n\t\t\toldVNode._dom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\t}\n\n\tif ((tmp = options.diffed)) tmp(newVNode);\n\n\treturn newVNode._flags & MODE_SUSPENDED ? undefined : oldDom;\n}\n\n/**\n * @param {Array<Component>} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {VNode} root\n */\nexport function commitRoot(commitQueue, root, refQueue) {\n\tfor (let i = 0; i < refQueue.length; i++) {\n\t\tapplyRef(refQueue[i], refQueue[++i], refQueue[++i]);\n\t}\n\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\t// @ts-expect-error Reuse the commitQueue variable here so the type changes\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\t// @ts-expect-error See above comment on commitQueue\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {PreactElement} dom The DOM element representing the virtual nodes\n * being diffed\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n * @returns {PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating,\n\trefQueue\n) {\n\tlet oldProps = oldVNode.props;\n\tlet newProps = newVNode.props;\n\tlet nodeType = /** @type {string} */ (newVNode.type);\n\t/** @type {any} */\n\tlet i;\n\t/** @type {{ __html?: string }} */\n\tlet newHtml;\n\t/** @type {{ __html?: string }} */\n\tlet oldHtml;\n\t/** @type {ComponentChildren} */\n\tlet newChildren;\n\tlet value;\n\tlet inputValue;\n\tlet checked;\n\n\t// Tracks entering and exiting namespaces when descending through the tree.\n\tif (nodeType == 'svg') namespace = SVG_NAMESPACE;\n\telse if (nodeType == 'math') namespace = MATH_NAMESPACE;\n\telse if (!namespace) namespace = XHTML_NAMESPACE;\n\n\tif (excessDomChildren != NULL) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tvalue = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tvalue &&\n\t\t\t\t'setAttribute' in value == !!nodeType &&\n\t\t\t\t(nodeType ? value.localName == nodeType : value.nodeType == 3)\n\t\t\t) {\n\t\t\t\tdom = value;\n\t\t\t\texcessDomChildren[i] = NULL;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == NULL) {\n\t\tif (nodeType == NULL) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tdom = document.createElementNS(\n\t\t\tnamespace,\n\t\t\tnodeType,\n\t\t\tnewProps.is && newProps\n\t\t);\n\n\t\t// we are creating a new node, so we can assume this is a new subtree (in\n\t\t// case we are hydrating), this deopts the hydrate\n\t\tif (isHydrating) {\n\t\t\tif (options._hydrationMismatch)\n\t\t\t\toptions._hydrationMismatch(newVNode, excessDomChildren);\n\t\t\tisHydrating = false;\n\t\t}\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = NULL;\n\t}\n\n\tif (nodeType === NULL) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data !== newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren = excessDomChildren && slice.call(dom.childNodes);\n\n\t\toldProps = oldVNode.props || EMPTY_OBJ;\n\n\t\t// If we are in a situation where we are not hydrating but are using\n\t\t// existing DOM (e.g. replaceNode) we should read the existing DOM\n\t\t// attributes to diff them\n\t\tif (!isHydrating && excessDomChildren != NULL) {\n\t\t\toldProps = {};\n\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\tvalue = dom.attributes[i];\n\t\t\t\toldProps[value.name] = value.value;\n\t\t\t}\n\t\t}\n\n\t\tfor (i in oldProps) {\n\t\t\tvalue = oldProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\toldHtml = value;\n\t\t\t} else if (!(i in newProps)) {\n\t\t\t\tif (\n\t\t\t\t\t(i == 'value' && 'defaultValue' in newProps) ||\n\t\t\t\t\t(i == 'checked' && 'defaultChecked' in newProps)\n\t\t\t\t) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tsetProperty(dom, i, NULL, value, namespace);\n\t\t\t}\n\t\t}\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tfor (i in newProps) {\n\t\t\tvalue = newProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t\tnewChildren = value;\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\tnewHtml = value;\n\t\t\t} else if (i == 'value') {\n\t\t\t\tinputValue = value;\n\t\t\t} else if (i == 'checked') {\n\t\t\t\tchecked = value;\n\t\t\t} else if (\n\t\t\t\t(!isHydrating || typeof value == 'function') &&\n\t\t\t\toldProps[i] !== value\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, value, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\tif (\n\t\t\t\t!isHydrating &&\n\t\t\t\t(!oldHtml ||\n\t\t\t\t\t(newHtml.__html !== oldHtml.__html &&\n\t\t\t\t\t\tnewHtml.__html !== dom.innerHTML))\n\t\t\t) {\n\t\t\t\tdom.innerHTML = newHtml.__html;\n\t\t\t}\n\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\tif (oldHtml) dom.innerHTML = '';\n\n\t\t\tdiffChildren(\n\t\t\t\t// @ts-expect-error\n\t\t\t\tnewVNode.type === 'template' ? dom.content : dom,\n\t\t\t\tisArray(newChildren) ? newChildren : [newChildren],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnodeType == 'foreignObject' ? XHTML_NAMESPACE : namespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\texcessDomChildren\n\t\t\t\t\t? excessDomChildren[0]\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\t// Remove children that are not part of any vnode.\n\t\t\tif (excessDomChildren != NULL) {\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// As above, don't diff props during hydration\n\t\tif (!isHydrating) {\n\t\t\ti = 'value';\n\t\t\tif (nodeType == 'progress' && inputValue == NULL) {\n\t\t\t\tdom.removeAttribute('value');\n\t\t\t} else if (\n\t\t\t\tinputValue !== UNDEFINED &&\n\t\t\t\t// #2756 For the <progress>-element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(inputValue !== dom[i] ||\n\t\t\t\t\t(nodeType == 'progress' && !inputValue) ||\n\t\t\t\t\t// This is only for IE 11 to fix <select> value not being updated.\n\t\t\t\t\t// To avoid a stale select value we need to set the option.value\n\t\t\t\t\t// again, which triggers IE11 to re-evaluate the select value\n\t\t\t\t\t(nodeType == 'option' && inputValue !== oldProps[i]))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, inputValue, oldProps[i], namespace);\n\t\t\t}\n\n\t\t\ti = 'checked';\n\t\t\tif (checked !== UNDEFINED && checked !== dom[i]) {\n\t\t\t\tsetProperty(dom, i, checked, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {Ref<any> & { _unmount?: unknown }} ref\n * @param {any} value\n * @param {VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') {\n\t\t\tlet hasRefUnmount = typeof ref._unmount == 'function';\n\t\t\tif (hasRefUnmount) {\n\t\t\t\t// @ts-ignore TS doesn't like moving narrowing checks into variables\n\t\t\t\tref._unmount();\n\t\t\t}\n\n\t\t\tif (!hasRefUnmount || value != NULL) {\n\t\t\t\t// Store the cleanup function on the function\n\t\t\t\t// instance object itself to avoid shape\n\t\t\t\t// transitioning vnode\n\t\t\t\tref._unmount = ref(value);\n\t\t\t}\n\t\t} else ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {VNode} vnode The virtual node to unmount\n * @param {VNode} parentVNode The parent of the VNode that initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current === vnode._dom) {\n\t\t\tapplyRef(r, NULL, parentVNode);\n\t\t}\n\t}\n\n\tif ((r = vnode._component) != NULL) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = NULL;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) {\n\t\t\t\tunmount(\n\t\t\t\t\tr[i],\n\t\t\t\t\tparentVNode,\n\t\t\t\t\tskipRemove || typeof vnode.type != 'function'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!skipRemove) {\n\t\tremoveNode(vnode._dom);\n\t}\n\n\tvnode._component = vnode._parent = vnode._dom = UNDEFINED;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n", "import { EMPTY_OBJ, NULL } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { slice } from './util';\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to render into\n * @param {import('./internal').PreactElement | object} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\t// https://github.com/preactjs/preact/issues/3794\n\tif (parentDom == document) {\n\t\tparentDom = document.documentElement;\n\t}\n\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in\n\t// hydration mode or not by passing the `hydrate` function instead of a DOM\n\t// element..\n\tlet isHydrating = typeof replaceNode == 'function';\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? NULL\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\n\tvnode = ((!isHydrating && replaceNode) || parentDom)._children =\n\t\tcreateElement(Fragment, NULL, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [],\n\t\trefQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\tvnode,\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.namespaceURI,\n\t\t!isHydrating && replaceNode\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t\t? NULL\n\t\t\t\t: parentDom.firstChild\n\t\t\t\t\t? slice.call(parentDom.childNodes)\n\t\t\t\t\t: NULL,\n\t\tcommitQueue,\n\t\t!isHydrating && replaceNode\n\t\t\t? replaceNode\n\t\t\t: oldVNode\n\t\t\t\t? oldVNode._dom\n\t\t\t\t: parentDom.firstChild,\n\t\tisHydrating,\n\t\trefQueue\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode, refQueue);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, hydrate);\n}\n", "import { assign, slice } from './util';\nimport { createVNode } from './create-element';\nimport { NULL, UNDEFINED } from './constants';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its\n * children.\n * @param {import('./internal').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array<import('./internal').ComponentChildren>} rest Any additional arguments will be used\n * as replacement children.\n * @returns {import('./internal').VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\n\tlet defaultProps;\n\n\tif (vnode.type && vnode.type.defaultProps) {\n\t\tdefaultProps = vnode.type.defaultProps;\n\t}\n\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse if (props[i] === UNDEFINED && defaultProps !== UNDEFINED) {\n\t\t\tnormalizedProps[i] = defaultProps[i];\n\t\t} else {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t}\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\tNULL\n\t);\n}\n", "import { NULL } from '../constants';\n\n/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').VNode} vnode The vnode that threw the error that was caught (except\n * for unmounting when this parameter is the highest parent that was being\n * unmounted)\n * @param {import('../internal').VNode} [oldVNode]\n * @param {import('../internal').ErrorInfo} [errorInfo]\n */\nexport function _catchError(error, vnode, oldVNode, errorInfo) {\n\t/** @type {import('../internal').Component} */\n\tlet component,\n\t\t/** @type {import('../internal').ComponentType} */\n\t\tctor,\n\t\t/** @type {boolean} */\n\t\thandled;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != NULL) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != NULL) {\n\t\t\t\t\tcomponent.componentDidCatch(error, errorInfo || {});\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n", "import { options as _options } from 'preact';\n\n/** @type {number} */\nlet currentIndex;\n\n/** @type {import('./internal').Component} */\nlet currentComponent;\n\n/** @type {import('./internal').Component} */\nlet previousComponent;\n\n/** @type {number} */\nlet currentHook = 0;\n\n/** @type {Array<import('./internal').Component>} */\nlet afterPaintEffects = [];\n\n// Cast to use internal Options type\nconst options = /** @type {import('./internal').Options} */ (_options);\n\nlet oldBeforeDiff = options._diff;\nlet oldBeforeRender = options._render;\nlet oldAfterDiff = options.diffed;\nlet oldCommit = options._commit;\nlet oldBeforeUnmount = options.unmount;\nlet oldRoot = options._root;\n\nconst RAF_TIMEOUT = 100;\nlet prevRaf;\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._diff = vnode => {\n\tcurrentComponent = null;\n\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n};\n\noptions._root = (vnode, parentDom) => {\n\tif (vnode && parentDom._children && parentDom._children._mask) {\n\t\tvnode._mask = parentDom._children._mask;\n\t}\n\n\tif (oldRoot) oldRoot(vnode, parentDom);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._render = vnode => {\n\tif (oldBeforeRender) oldBeforeRender(vnode);\n\n\tcurrentComponent = vnode._component;\n\tcurrentIndex = 0;\n\n\tconst hooks = currentComponent.__hooks;\n\tif (hooks) {\n\t\tif (previousComponent === currentComponent) {\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentComponent._renderCallbacks = [];\n\t\t\thooks._list.forEach(hookItem => {\n\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t}\n\t\t\t\thookItem._pendingArgs = hookItem._nextValue = undefined;\n\t\t\t});\n\t\t} else {\n\t\t\thooks._pendingEffects.forEach(invokeCleanup);\n\t\t\thooks._pendingEffects.forEach(invokeEffect);\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentIndex = 0;\n\t\t}\n\t}\n\tpreviousComponent = currentComponent;\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.diffed = vnode => {\n\tif (oldAfterDiff) oldAfterDiff(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tif (c.__hooks._pendingEffects.length) afterPaint(afterPaintEffects.push(c));\n\t\tc.__hooks._list.forEach(hookItem => {\n\t\t\tif (hookItem._pendingArgs) {\n\t\t\t\thookItem._args = hookItem._pendingArgs;\n\t\t\t}\n\t\t\thookItem._pendingArgs = undefined;\n\t\t});\n\t}\n\tpreviousComponent = currentComponent = null;\n};\n\n// TODO: Improve typing of commitQueue parameter\n/** @type {(vnode: import('./internal').VNode, commitQueue: any) => void} */\noptions._commit = (vnode, commitQueue) => {\n\tcommitQueue.some(component => {\n\t\ttry {\n\t\t\tcomponent._renderCallbacks.forEach(invokeCleanup);\n\t\t\tcomponent._renderCallbacks = component._renderCallbacks.filter(cb =>\n\t\t\t\tcb._value ? invokeEffect(cb) : true\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tcommitQueue.some(c => {\n\t\t\t\tif (c._renderCallbacks) c._renderCallbacks = [];\n\t\t\t});\n\t\t\tcommitQueue = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t});\n\n\tif (oldCommit) oldCommit(vnode, commitQueue);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.unmount = vnode => {\n\tif (oldBeforeUnmount) oldBeforeUnmount(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tlet hasErrored;\n\t\tc.__hooks._list.forEach(s => {\n\t\t\ttry {\n\t\t\t\tinvokeCleanup(s);\n\t\t\t} catch (e) {\n\t\t\t\thasErrored = e;\n\t\t\t}\n\t\t});\n\t\tc.__hooks = undefined;\n\t\tif (hasErrored) options._catchError(hasErrored, c._vnode);\n\t}\n};\n\n/**\n * Get a hook's state from the currentComponent\n * @param {number} index The index of the hook to get\n * @param {number} type The index of the hook to get\n * @returns {any}\n */\nfunction getHookState(index, type) {\n\tif (options._hook) {\n\t\toptions._hook(currentComponent, index, currentHook || type);\n\t}\n\tcurrentHook = 0;\n\n\t// Largely inspired by:\n\t// * https://github.com/michael-klein/funcy.js/blob/f6be73468e6ec46b0ff5aa3cc4c9baf72a29025a/src/hooks/core_hooks.mjs\n\t// * https://github.com/michael-klein/funcy.js/blob/650beaa58c43c33a74820a3c98b3c7079cf2e333/src/renderer.mjs\n\t// Other implementations to look at:\n\t// * https://codesandbox.io/s/mnox05qp8\n\tconst hooks =\n\t\tcurrentComponent.__hooks ||\n\t\t(currentComponent.__hooks = {\n\t\t\t_list: [],\n\t\t\t_pendingEffects: []\n\t\t});\n\n\tif (index >= hooks._list.length) {\n\t\thooks._list.push({});\n\t}\n\n\treturn hooks._list[index];\n}\n\n/**\n * @template {unknown} S\n * @param {import('./index').Dispatch<import('./index').StateUpdater<S>>} [initialState]\n * @returns {[S, (state: S) => void]}\n */\nexport function useState(initialState) {\n\tcurrentHook = 1;\n\treturn useReducer(invokeOrReturn, initialState);\n}\n\n/**\n * @template {unknown} S\n * @template {unknown} A\n * @param {import('./index').Reducer<S, A>} reducer\n * @param {import('./index').Dispatch<import('./index').StateUpdater<S>>} initialState\n * @param {(initialState: any) => void} [init]\n * @returns {[ S, (state: S) => void ]}\n */\nexport function useReducer(reducer, initialState, init) {\n\t/** @type {import('./internal').ReducerHookState} */\n\tconst hookState = getHookState(currentIndex++, 2);\n\thookState._reducer = reducer;\n\tif (!hookState._component) {\n\t\thookState._value = [\n\t\t\t!init ? invokeOrReturn(undefined, initialState) : init(initialState),\n\n\t\t\taction => {\n\t\t\t\tconst currentValue = hookState._nextValue\n\t\t\t\t\t? hookState._nextValue[0]\n\t\t\t\t\t: hookState._value[0];\n\t\t\t\tconst nextValue = hookState._reducer(currentValue, action);\n\n\t\t\t\tif (currentValue !== nextValue) {\n\t\t\t\t\thookState._nextValue = [nextValue, hookState._value[1]];\n\t\t\t\t\thookState._component.setState({});\n\t\t\t\t}\n\t\t\t}\n\t\t];\n\n\t\thookState._component = currentComponent;\n\n\t\tif (!currentComponent._hasScuFromHooks) {\n\t\t\tcurrentComponent._hasScuFromHooks = true;\n\t\t\tlet prevScu = currentComponent.shouldComponentUpdate;\n\t\t\tconst prevCWU = currentComponent.componentWillUpdate;\n\n\t\t\t// If we're dealing with a forced update `shouldComponentUpdate` will\n\t\t\t// not be called. But we use that to update the hook values, so we\n\t\t\t// need to call it.\n\t\t\tcurrentComponent.componentWillUpdate = function (p, s, c) {\n\t\t\t\tif (this._force) {\n\t\t\t\t\tlet tmp = prevScu;\n\t\t\t\t\t// Clear to avoid other sCU hooks from being called\n\t\t\t\t\tprevScu = undefined;\n\t\t\t\t\tupdateHookState(p, s, c);\n\t\t\t\t\tprevScu = tmp;\n\t\t\t\t}\n\n\t\t\t\tif (prevCWU) prevCWU.call(this, p, s, c);\n\t\t\t};\n\n\t\t\t// This SCU has the purpose of bailing out after repeated updates\n\t\t\t// to stateful hooks.\n\t\t\t// we store the next value in _nextValue[0] and keep doing that for all\n\t\t\t// state setters, if we have next states and\n\t\t\t// all next states within a component end up being equal to their original state\n\t\t\t// we are safe to bail out for this specific component.\n\t\t\t/**\n\t\t\t *\n\t\t\t * @type {import('./internal').Component[\"shouldComponentUpdate\"]}\n\t\t\t */\n\t\t\t// @ts-ignore - We don't use TS to downtranspile\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction updateHookState(p, s, c) {\n\t\t\t\tif (!hookState._component.__hooks) return true;\n\n\t\t\t\t/** @type {(x: import('./internal').HookState) => x is import('./internal').ReducerHookState} */\n\t\t\t\tconst isStateHook = x => !!x._component;\n\t\t\t\tconst stateHooks =\n\t\t\t\t\thookState._component.__hooks._list.filter(isStateHook);\n\n\t\t\t\tconst allHooksEmpty = stateHooks.every(x => !x._nextValue);\n\t\t\t\t// When we have no updated hooks in the component we invoke the previous SCU or\n\t\t\t\t// traverse the VDOM tree further.\n\t\t\t\tif (allHooksEmpty) {\n\t\t\t\t\treturn prevScu ? prevScu.call(this, p, s, c) : true;\n\t\t\t\t}\n\n\t\t\t\t// We check whether we have components with a nextValue set that\n\t\t\t\t// have values that aren't equal to one another this pushes\n\t\t\t\t// us to update further down the tree\n\t\t\t\tlet shouldUpdate = hookState._component.props !== p;\n\t\t\t\tstateHooks.forEach(hookItem => {\n\t\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\t\tconst currentValue = hookItem._value[0];\n\t\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t\t\thookItem._nextValue = undefined;\n\t\t\t\t\t\tif (currentValue !== hookItem._value[0]) shouldUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn prevScu\n\t\t\t\t\t? prevScu.call(this, p, s, c) || shouldUpdate\n\t\t\t\t\t: shouldUpdate;\n\t\t\t}\n\n\t\t\tcurrentComponent.shouldComponentUpdate = updateHookState;\n\t\t}\n\t}\n\n\treturn hookState._nextValue || hookState._value;\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 3);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent.__hooks._pendingEffects.push(state);\n\t}\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useLayoutEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 4);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent._renderCallbacks.push(state);\n\t}\n}\n\n/** @type {(initialValue: unknown) => unknown} */\nexport function useRef(initialValue) {\n\tcurrentHook = 5;\n\treturn useMemo(() => ({ current: initialValue }), []);\n}\n\n/**\n * @param {object} ref\n * @param {() => object} createHandle\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useImperativeHandle(ref, createHandle, args) {\n\tcurrentHook = 6;\n\tuseLayoutEffect(\n\t\t() => {\n\t\t\tif (typeof ref == 'function') {\n\t\t\t\tconst result = ref(createHandle());\n\t\t\t\treturn () => {\n\t\t\t\t\tref(null);\n\t\t\t\t\tif (result && typeof result == 'function') result();\n\t\t\t\t};\n\t\t\t} else if (ref) {\n\t\t\t\tref.current = createHandle();\n\t\t\t\treturn () => (ref.current = null);\n\t\t\t}\n\t\t},\n\t\targs == null ? args : args.concat(ref)\n\t);\n}\n\n/**\n * @template {unknown} T\n * @param {() => T} factory\n * @param {unknown[]} args\n * @returns {T}\n */\nexport function useMemo(factory, args) {\n\t/** @type {import('./internal').MemoHookState<T>} */\n\tconst state = getHookState(currentIndex++, 7);\n\tif (argsChanged(state._args, args)) {\n\t\tstate._value = factory();\n\t\tstate._args = args;\n\t\tstate._factory = factory;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * @param {() => void} callback\n * @param {unknown[]} args\n * @returns {() => void}\n */\nexport function useCallback(callback, args) {\n\tcurrentHook = 8;\n\treturn useMemo(() => callback, args);\n}\n\n/**\n * @param {import('./internal').PreactContext} context\n */\nexport function useContext(context) {\n\tconst provider = currentComponent.context[context._id];\n\t// We could skip this call here, but than we'd not call\n\t// `options._hook`. We need to do that in order to make\n\t// the devtools aware of this hook.\n\t/** @type {import('./internal').ContextHookState} */\n\tconst state = getHookState(currentIndex++, 9);\n\t// The devtools needs access to the context object to\n\t// be able to pull of the default value when no provider\n\t// is present in the tree.\n\tstate._context = context;\n\tif (!provider) return context._defaultValue;\n\t// This is probably not safe to convert to \"!\"\n\tif (state._value == null) {\n\t\tstate._value = true;\n\t\tprovider.sub(currentComponent);\n\t}\n\treturn provider.props.value;\n}\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {<T>(value: T, cb?: (value: T) => string | number) => void}\n */\nexport function useDebugValue(value, formatter) {\n\tif (options.useDebugValue) {\n\t\toptions.useDebugValue(\n\t\t\tformatter ? formatter(value) : /** @type {any}*/ (value)\n\t\t);\n\t}\n}\n\n/**\n * @param {(error: unknown, errorInfo: import('preact').ErrorInfo) => void} cb\n * @returns {[unknown, () => void]}\n */\nexport function useErrorBoundary(cb) {\n\t/** @type {import('./internal').ErrorBoundaryHookState} */\n\tconst state = getHookState(currentIndex++, 10);\n\tconst errState = useState();\n\tstate._value = cb;\n\tif (!currentComponent.componentDidCatch) {\n\t\tcurrentComponent.componentDidCatch = (err, errorInfo) => {\n\t\t\tif (state._value) state._value(err, errorInfo);\n\t\t\terrState[1](err);\n\t\t};\n\t}\n\treturn [\n\t\terrState[0],\n\t\t() => {\n\t\t\terrState[1](undefined);\n\t\t}\n\t];\n}\n\n/** @type {() => string} */\nexport function useId() {\n\t/** @type {import('./internal').IdHookState} */\n\tconst state = getHookState(currentIndex++, 11);\n\tif (!state._value) {\n\t\t// Grab either the root node or the nearest async boundary node.\n\t\t/** @type {import('./internal').VNode} */\n\t\tlet root = currentComponent._vnode;\n\t\twhile (root !== null && !root._mask && root._parent !== null) {\n\t\t\troot = root._parent;\n\t\t}\n\n\t\tlet mask = root._mask || (root._mask = [0, 0]);\n\t\tstate._value = 'P' + mask[0] + '-' + mask[1]++;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * After paint effects consumer.\n */\nfunction flushAfterPaintEffects() {\n\tlet component;\n\twhile ((component = afterPaintEffects.shift())) {\n\t\tif (!component._parentDom || !component.__hooks) continue;\n\t\ttry {\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeCleanup);\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeEffect);\n\t\t\tcomponent.__hooks._pendingEffects = [];\n\t\t} catch (e) {\n\t\t\tcomponent.__hooks._pendingEffects = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t}\n}\n\nlet HAS_RAF = typeof requestAnimationFrame == 'function';\n\n/**\n * Schedule a callback to be invoked after the browser has a chance to paint a new frame.\n * Do this by combining requestAnimationFrame (rAF) + setTimeout to invoke a callback after\n * the next browser frame.\n *\n * Also, schedule a timeout in parallel to the the rAF to ensure the callback is invoked\n * even if RAF doesn't fire (for example if the browser tab is not visible)\n *\n * @param {() => void} callback\n */\nfunction afterNextFrame(callback) {\n\tconst done = () => {\n\t\tclearTimeout(timeout);\n\t\tif (HAS_RAF) cancelAnimationFrame(raf);\n\t\tsetTimeout(callback);\n\t};\n\tconst timeout = setTimeout(done, RAF_TIMEOUT);\n\n\tlet raf;\n\tif (HAS_RAF) {\n\t\traf = requestAnimationFrame(done);\n\t}\n}\n\n// Note: if someone used options.debounceRendering = requestAnimationFrame,\n// then effects will ALWAYS run on the NEXT frame instead of the current one, incurring a ~16ms delay.\n// Perhaps this is not such a big deal.\n/**\n * Schedule afterPaintEffects flush after the browser paints\n * @param {number} newQueueLength\n * @returns {void}\n */\nfunction afterPaint(newQueueLength) {\n\tif (newQueueLength === 1 || prevRaf !== options.requestAnimationFrame) {\n\t\tprevRaf = options.requestAnimationFrame;\n\t\t(prevRaf || afterNextFrame)(flushAfterPaintEffects);\n\t}\n}\n\n/**\n * @param {import('./internal').HookState} hook\n * @returns {void}\n */\nfunction invokeCleanup(hook) {\n\t// A hook cleanup can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\tlet cleanup = hook._cleanup;\n\tif (typeof cleanup == 'function') {\n\t\thook._cleanup = undefined;\n\t\tcleanup();\n\t}\n\n\tcurrentComponent = comp;\n}\n\n/**\n * Invoke a Hook's effect\n * @param {import('./internal').EffectHookState} hook\n * @returns {void}\n */\nfunction invokeEffect(hook) {\n\t// A hook call can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\thook._cleanup = hook._value();\n\tcurrentComponent = comp;\n}\n\n/**\n * @param {unknown[]} oldArgs\n * @param {unknown[]} newArgs\n * @returns {boolean}\n */\nfunction argsChanged(oldArgs, newArgs) {\n\treturn (\n\t\t!oldArgs ||\n\t\toldArgs.length !== newArgs.length ||\n\t\tnewArgs.some((arg, index) => arg !== oldArgs[index])\n\t);\n}\n\n/**\n * @template Arg\n * @param {Arg} arg\n * @param {(arg: Arg) => any} f\n * @returns {any}\n */\nfunction invokeOrReturn(arg, f) {\n\treturn typeof f == 'function' ? f(arg) : f;\n}\n", "/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Check if two objects have a different shape\n * @param {object} a\n * @param {object} b\n * @returns {boolean}\n */\nexport function shallowDiffers(a, b) {\n\tfor (let i in a) if (i !== '__source' && !(i in b)) return true;\n\tfor (let i in b) if (i !== '__source' && a[i] !== b[i]) return true;\n\treturn false;\n}\n\n/**\n * Check if two values are the same value\n * @param {*} x\n * @param {*} y\n * @returns {boolean}\n */\nexport function is(x, y) {\n\treturn (x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\n", "import { useState, useLayoutEffect, useEffect } from 'preact/hooks';\nimport { is } from './util';\n\n/**\n * This is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84\n * on a high level this cuts out the warnings, ... and attempts a smaller implementation\n * @typedef {{ _value: any; _getSnapshot: () => any }} Store\n */\nexport function useSyncExternalStore(subscribe, getSnapshot) {\n\tconst value = getSnapshot();\n\n\t/**\n\t * @typedef {{ _instance: Store }} StoreRef\n\t * @type {[StoreRef, (store: StoreRef) => void]}\n\t */\n\tconst [{ _instance }, forceUpdate] = useState({\n\t\t_instance: { _value: value, _getSnapshot: getSnapshot }\n\t});\n\n\tuseLayoutEffect(() => {\n\t\t_instance._value = value;\n\t\t_instance._getSnapshot = getSnapshot;\n\n\t\tif (didSnapshotChange(_instance)) {\n\t\t\tforceUpdate({ _instance });\n\t\t}\n\t}, [subscribe, value, getSnapshot]);\n\n\tuseEffect(() => {\n\t\tif (didSnapshotChange(_instance)) {\n\t\t\tforceUpdate({ _instance });\n\t\t}\n\n\t\treturn subscribe(() => {\n\t\t\tif (didSnapshotChange(_instance)) {\n\t\t\t\tforceUpdate({ _instance });\n\t\t\t}\n\t\t});\n\t}, [subscribe]);\n\n\treturn value;\n}\n\n/** @type {(inst: Store) => boolean} */\nfunction didSnapshotChange(inst) {\n\tconst latestGetSnapshot = inst._getSnapshot;\n\tconst prevValue = inst._value;\n\ttry {\n\t\tconst nextValue = latestGetSnapshot();\n\t\treturn !is(prevValue, nextValue);\n\t} catch (error) {\n\t\treturn true;\n\t}\n}\n\nexport function startTransition(cb) {\n\tcb();\n}\n\nexport function useDeferredValue(val) {\n\treturn val;\n}\n\nexport function useTransition() {\n\treturn [false, startTransition];\n}\n\n// TODO: in theory this should be done after a VNode is diffed as we want to insert\n// styles/... before it attaches\nexport const useInsertionEffect = useLayoutEffect;\n", "import { Component } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Component class with a predefined `shouldComponentUpdate` implementation\n */\nexport function PureComponent(p, c) {\n\tthis.props = p;\n\tthis.context = c;\n}\nPureComponent.prototype = new Component();\n// Some third-party libraries check if this property is present\nPureComponent.prototype.isPureReactComponent = true;\nPureComponent.prototype.shouldComponentUpdate = function (props, state) {\n\treturn shallowDiffers(this.props, props) || shallowDiffers(this.state, state);\n};\n", "import { createElement } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Memoize a component, so that it only updates when the props actually have\n * changed. This was previously known as `React.pure`.\n * @param {import('./internal').FunctionComponent} c functional component\n * @param {(prev: object, next: object) => boolean} [comparer] Custom equality function\n * @returns {import('./internal').FunctionComponent}\n */\nexport function memo(c, comparer) {\n\tfunction shouldUpdate(nextProps) {\n\t\tlet ref = this.props.ref;\n\t\tlet updateRef = ref == nextProps.ref;\n\t\tif (!updateRef && ref) {\n\t\t\tref.call ? ref(null) : (ref.current = null);\n\t\t}\n\n\t\tif (!comparer) {\n\t\t\treturn shallowDiffers(this.props, nextProps);\n\t\t}\n\n\t\treturn !comparer(this.props, nextProps) || !updateRef;\n\t}\n\n\tfunction Memoed(props) {\n\t\tthis.shouldComponentUpdate = shouldUpdate;\n\t\treturn createElement(c, props);\n\t}\n\tMemoed.displayName = 'Memo(' + (c.displayName || c.name) + ')';\n\tMemoed.prototype.isReactComponent = true;\n\tMemoed._forwarded = true;\n\treturn Memoed;\n}\n", "import { options } from 'preact';\nimport { assign } from './util';\n\nlet oldDiffHook = options._diff;\noptions._diff = vnode => {\n\tif (vnode.type && vnode.type._forwarded && vnode.ref) {\n\t\tvnode.props.ref = vnode.ref;\n\t\tvnode.ref = null;\n\t}\n\tif (oldDiffHook) oldDiffHook(vnode);\n};\n\nexport const REACT_FORWARD_SYMBOL =\n\t(typeof Symbol != 'undefined' &&\n\t\tSymbol.for &&\n\t\tSymbol.for('react.forward_ref')) ||\n\t0xf47;\n\n/**\n * Pass ref down to a child. This is mainly used in libraries with HOCs that\n * wrap components. Using `forwardRef` there is an easy way to get a reference\n * of the wrapped component instead of one of the wrapper itself.\n * @param {import('./index').ForwardFn} fn\n * @returns {import('./internal').FunctionComponent}\n */\nexport function forwardRef(fn) {\n\tfunction Forwarded(props) {\n\t\tlet clone = assign({}, props);\n\t\tdelete clone.ref;\n\t\treturn fn(clone, props.ref || null);\n\t}\n\n\t// mobx-react checks for this being present\n\tForwarded.$$typeof = REACT_FORWARD_SYMBOL;\n\t// mobx-react heavily relies on implementation details.\n\t// It expects an object here with a `render` property,\n\t// and prototype.render will fail. Without this\n\t// mobx-react throws.\n\tForwarded.render = Forwarded;\n\n\tForwarded.prototype.isReactComponent = Forwarded._forwarded = true;\n\tForwarded.displayName = 'ForwardRef(' + (fn.displayName || fn.name) + ')';\n\treturn Forwarded;\n}\n", "import { toChildArray } from 'preact';\n\nconst mapFn = (children, fn) => {\n\tif (children == null) return null;\n\treturn toChildArray(toChildArray(children).map(fn));\n};\n\n// This API is completely unnecessary for Preact, so it's basically passthrough.\nexport const Children = {\n\tmap: mapFn,\n\tforEach: mapFn,\n\tcount(children) {\n\t\treturn children ? toChildArray(children).length : 0;\n\t},\n\tonly(children) {\n\t\tconst normalized = toChildArray(children);\n\t\tif (normalized.length !== 1) throw 'Children.only';\n\t\treturn normalized[0];\n\t},\n\ttoArray: toChildArray\n};\n", "import { Component, createElement, options, Fragment } from 'preact';\nimport { MODE_HYDRATE } from '../../src/constants';\nimport { assign } from './util';\n\nconst oldCatchError = options._catchError;\noptions._catchError = function (error, newVNode, oldVNode, errorInfo) {\n\tif (error.then) {\n\t\t/** @type {import('./internal').Component} */\n\t\tlet component;\n\t\tlet vnode = newVNode;\n\n\t\tfor (; (vnode = vnode._parent); ) {\n\t\t\tif ((component = vnode._component) && component._childDidSuspend) {\n\t\t\t\tif (newVNode._dom == null) {\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t}\n\t\t\t\t// Don't call oldCatchError if we found a Suspense\n\t\t\t\treturn component._childDidSuspend(error, newVNode);\n\t\t\t}\n\t\t}\n\t}\n\toldCatchError(error, newVNode, oldVNode, errorInfo);\n};\n\nconst oldUnmount = options.unmount;\noptions.unmount = function (vnode) {\n\t/** @type {import('./internal').Component} */\n\tconst component = vnode._component;\n\tif (component && component._onResolve) {\n\t\tcomponent._onResolve();\n\t}\n\n\t// if the component is still hydrating\n\t// most likely it is because the component is suspended\n\t// we set the vnode.type as `null` so that it is not a typeof function\n\t// so the unmount will remove the vnode._dom\n\tif (component && vnode._flags & MODE_HYDRATE) {\n\t\tvnode.type = null;\n\t}\n\n\tif (oldUnmount) oldUnmount(vnode);\n};\n\nfunction detachedClone(vnode, detachedParent, parentDom) {\n\tif (vnode) {\n\t\tif (vnode._component && vnode._component.__hooks) {\n\t\t\tvnode._component.__hooks._list.forEach(effect => {\n\t\t\t\tif (typeof effect._cleanup == 'function') effect._cleanup();\n\t\t\t});\n\n\t\t\tvnode._component.__hooks = null;\n\t\t}\n\n\t\tvnode = assign({}, vnode);\n\t\tif (vnode._component != null) {\n\t\t\tif (vnode._component._parentDom === parentDom) {\n\t\t\t\tvnode._component._parentDom = detachedParent;\n\t\t\t}\n\t\t\tvnode._component = null;\n\t\t}\n\n\t\tvnode._children =\n\t\t\tvnode._children &&\n\t\t\tvnode._children.map(child =>\n\t\t\t\tdetachedClone(child, detachedParent, parentDom)\n\t\t\t);\n\t}\n\n\treturn vnode;\n}\n\nfunction removeOriginal(vnode, detachedParent, originalParent) {\n\tif (vnode && originalParent) {\n\t\tvnode._original = null;\n\t\tvnode._children =\n\t\t\tvnode._children &&\n\t\t\tvnode._children.map(child =>\n\t\t\t\tremoveOriginal(child, detachedParent, originalParent)\n\t\t\t);\n\n\t\tif (vnode._component) {\n\t\t\tif (vnode._component._parentDom === detachedParent) {\n\t\t\t\tif (vnode._dom) {\n\t\t\t\t\toriginalParent.appendChild(vnode._dom);\n\t\t\t\t}\n\t\t\t\tvnode._component._force = true;\n\t\t\t\tvnode._component._parentDom = originalParent;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn vnode;\n}\n\n// having custom inheritance instead of a class here saves a lot of bytes\nexport function Suspense() {\n\t// we do not call super here to golf some bytes...\n\tthis._pendingSuspensionCount = 0;\n\tthis._suspenders = null;\n\tthis._detachOnNextRender = null;\n}\n\n// Things we do here to save some bytes but are not proper JS inheritance:\n// - call `new Component()` as the prototype\n// - do not set `Suspense.prototype.constructor` to `Suspense`\nSuspense.prototype = new Component();\n\n/**\n * @this {import('./internal').SuspenseComponent}\n * @param {Promise} promise The thrown promise\n * @param {import('./internal').VNode<any, any>} suspendingVNode The suspending component\n */\nSuspense.prototype._childDidSuspend = function (promise, suspendingVNode) {\n\tconst suspendingComponent = suspendingVNode._component;\n\n\t/** @type {import('./internal').SuspenseComponent} */\n\tconst c = this;\n\n\tif (c._suspenders == null) {\n\t\tc._suspenders = [];\n\t}\n\tc._suspenders.push(suspendingComponent);\n\n\tconst resolve = suspended(c._vnode);\n\n\tlet resolved = false;\n\tconst onResolved = () => {\n\t\tif (resolved) return;\n\n\t\tresolved = true;\n\t\tsuspendingComponent._onResolve = null;\n\n\t\tif (resolve) {\n\t\t\tresolve(onSuspensionComplete);\n\t\t} else {\n\t\t\tonSuspensionComplete();\n\t\t}\n\t};\n\n\tsuspendingComponent._onResolve = onResolved;\n\n\tconst onSuspensionComplete = () => {\n\t\tif (!--c._pendingSuspensionCount) {\n\t\t\t// If the suspension was during hydration we don't need to restore the\n\t\t\t// suspended children into the _children array\n\t\t\tif (c.state._suspended) {\n\t\t\t\tconst suspendedVNode = c.state._suspended;\n\t\t\t\tc._vnode._children[0] = removeOriginal(\n\t\t\t\t\tsuspendedVNode,\n\t\t\t\t\tsuspendedVNode._component._parentDom,\n\t\t\t\t\tsuspendedVNode._component._originalParentDom\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tc.setState({ _suspended: (c._detachOnNextRender = null) });\n\n\t\t\tlet suspended;\n\t\t\twhile ((suspended = c._suspenders.pop())) {\n\t\t\t\tsuspended.forceUpdate();\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * We do not set `suspended: true` during hydration because we want the actual markup\n\t * to remain on screen and hydrate it when the suspense actually gets resolved.\n\t * While in non-hydration cases the usual fallback -> component flow would occour.\n\t */\n\tif (\n\t\t!c._pendingSuspensionCount++ &&\n\t\t!(suspendingVNode._flags & MODE_HYDRATE)\n\t) {\n\t\tc.setState({ _suspended: (c._detachOnNextRender = c._vnode._children[0]) });\n\t}\n\tpromise.then(onResolved, onResolved);\n};\n\nSuspense.prototype.componentWillUnmount = function () {\n\tthis._suspenders = [];\n};\n\n/**\n * @this {import('./internal').SuspenseComponent}\n * @param {import('./internal').SuspenseComponent[\"props\"]} props\n * @param {import('./internal').SuspenseState} state\n */\nSuspense.prototype.render = function (props, state) {\n\tif (this._detachOnNextRender) {\n\t\t// When the Suspense's _vnode was created by a call to createVNode\n\t\t// (i.e. due to a setState further up in the tree)\n\t\t// it's _children prop is null, in this case we \"forget\" about the parked vnodes to detach\n\t\tif (this._vnode._children) {\n\t\t\tconst detachedParent = document.createElement('div');\n\t\t\tconst detachedComponent = this._vnode._children[0]._component;\n\t\t\tthis._vnode._children[0] = detachedClone(\n\t\t\t\tthis._detachOnNextRender,\n\t\t\t\tdetachedParent,\n\t\t\t\t(detachedComponent._originalParentDom = detachedComponent._parentDom)\n\t\t\t);\n\t\t}\n\n\t\tthis._detachOnNextRender = null;\n\t}\n\n\t// Wrap fallback tree in a VNode that prevents itself from being marked as aborting mid-hydration:\n\t/** @type {import('./internal').VNode} */\n\tconst fallback =\n\t\tstate._suspended && createElement(Fragment, null, props.fallback);\n\tif (fallback) fallback._flags &= ~MODE_HYDRATE;\n\n\treturn [\n\t\tcreateElement(Fragment, null, state._suspended ? null : props.children),\n\t\tfallback\n\t];\n};\n\n/**\n * Checks and calls the parent component's _suspended method, passing in the\n * suspended vnode. This is a way for a parent (e.g. SuspenseList) to get notified\n * that one of its children/descendants suspended.\n *\n * The parent MAY return a callback. The callback will get called when the\n * suspension resolves, notifying the parent of the fact.\n * Moreover, the callback gets function `unsuspend` as a parameter. The resolved\n * child descendant will not actually get unsuspended until `unsuspend` gets called.\n * This is a way for the parent to delay unsuspending.\n *\n * If the parent does not return a callback then the resolved vnode\n * gets unsuspended immediately when it resolves.\n *\n * @param {import('./internal').VNode} vnode\n * @returns {((unsuspend: () => void) => void)?}\n */\nexport function suspended(vnode) {\n\t/** @type {import('./internal').Component} */\n\tlet component = vnode._parent._component;\n\treturn component && component._suspended && component._suspended(vnode);\n}\n\nexport function lazy(loader) {\n\tlet prom;\n\tlet component;\n\tlet error;\n\n\tfunction Lazy(props) {\n\t\tif (!prom) {\n\t\t\tprom = loader();\n\t\t\tprom.then(\n\t\t\t\texports => {\n\t\t\t\t\tcomponent = exports.default || exports;\n\t\t\t\t},\n\t\t\t\te => {\n\t\t\t\t\terror = e;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!component) {\n\t\t\tthrow prom;\n\t\t}\n\n\t\treturn createElement(component, props);\n\t}\n\n\tLazy.displayName = 'Lazy';\n\tLazy._forwarded = true;\n\treturn Lazy;\n}\n", "import { Component, toChildArray } from 'preact';\nimport { suspended } from './suspense.js';\n\n// Indexes to linked list nodes (nodes are stored as arrays to save bytes).\nconst SUSPENDED_COUNT = 0;\nconst RESOLVED_COUNT = 1;\nconst NEXT_NODE = 2;\n\n// Having custom inheritance instead of a class here saves a lot of bytes.\nexport function SuspenseList() {\n\tthis._next = null;\n\tthis._map = null;\n}\n\n// Mark one of child's earlier suspensions as resolved.\n// Some pending callbacks may become callable due to this\n// (e.g. the last suspended descendant gets resolved when\n// revealOrder === 'together'). Process those callbacks as well.\nconst resolve = (list, child, node) => {\n\tif (++node[RESOLVED_COUNT] === node[SUSPENDED_COUNT]) {\n\t\t// The number a child (or any of its descendants) has been suspended\n\t\t// matches the number of times it's been resolved. Therefore we\n\t\t// mark the child as completely resolved by deleting it from ._map.\n\t\t// This is used to figure out when *all* children have been completely\n\t\t// resolved when revealOrder is 'together'.\n\t\tlist._map.delete(child);\n\t}\n\n\t// If revealOrder is falsy then we can do an early exit, as the\n\t// callbacks won't get queued in the node anyway.\n\t// If revealOrder is 'together' then also do an early exit\n\t// if all suspended descendants have not yet been resolved.\n\tif (\n\t\t!list.props.revealOrder ||\n\t\t(list.props.revealOrder[0] === 't' && list._map.size)\n\t) {\n\t\treturn;\n\t}\n\n\t// Walk the currently suspended children in order, calling their\n\t// stored callbacks on the way. Stop if we encounter a child that\n\t// has not been completely resolved yet.\n\tnode = list._next;\n\twhile (node) {\n\t\twhile (node.length > 3) {\n\t\t\tnode.pop()();\n\t\t}\n\t\tif (node[RESOLVED_COUNT] < node[SUSPENDED_COUNT]) {\n\t\t\tbreak;\n\t\t}\n\t\tlist._next = node = node[NEXT_NODE];\n\t}\n};\n\n// Things we do here to save some bytes but are not proper JS inheritance:\n// - call `new Component()` as the prototype\n// - do not set `Suspense.prototype.constructor` to `Suspense`\nSuspenseList.prototype = new Component();\n\nSuspenseList.prototype._suspended = function (child) {\n\tconst list = this;\n\tconst delegated = suspended(list._vnode);\n\n\tlet node = list._map.get(child);\n\tnode[SUSPENDED_COUNT]++;\n\n\treturn unsuspend => {\n\t\tconst wrappedUnsuspend = () => {\n\t\t\tif (!list.props.revealOrder) {\n\t\t\t\t// Special case the undefined (falsy) revealOrder, as there\n\t\t\t\t// is no need to coordinate a specific order or unsuspends.\n\t\t\t\tunsuspend();\n\t\t\t} else {\n\t\t\t\tnode.push(unsuspend);\n\t\t\t\tresolve(list, child, node);\n\t\t\t}\n\t\t};\n\t\tif (delegated) {\n\t\t\tdelegated(wrappedUnsuspend);\n\t\t} else {\n\t\t\twrappedUnsuspend();\n\t\t}\n\t};\n};\n\nSuspenseList.prototype.render = function (props) {\n\tthis._next = null;\n\tthis._map = new Map();\n\n\tconst children = toChildArray(props.children);\n\tif (props.revealOrder && props.revealOrder[0] === 'b') {\n\t\t// If order === 'backwards' (or, well, anything starting with a 'b')\n\t\t// then flip the child list around so that the last child will be\n\t\t// the first in the linked list.\n\t\tchildren.reverse();\n\t}\n\t// Build the linked list. Iterate through the children in reverse order\n\t// so that `_next` points to the first linked list node to be resolved.\n\tfor (let i = children.length; i--; ) {\n\t\t// Create a new linked list node as an array of form:\n\t\t// \t[suspended_count, resolved_count, next_node]\n\t\t// where suspended_count and resolved_count are numeric counters for\n\t\t// keeping track how many times a node has been suspended and resolved.\n\t\t//\n\t\t// Note that suspended_count starts from 1 instead of 0, so we can block\n\t\t// processing callbacks until componentDidMount has been called. In a sense\n\t\t// node is suspended at least until componentDidMount gets called!\n\t\t//\n\t\t// Pending callbacks are added to the end of the node:\n\t\t// \t[suspended_count, resolved_count, next_node, callback_0, callback_1, ...]\n\t\tthis._map.set(children[i], (this._next = [1, 0, this._next]));\n\t}\n\treturn props.children;\n};\n\nSuspenseList.prototype.componentDidUpdate =\n\tSuspenseList.prototype.componentDidMount = function () {\n\t\t// Iterate through all children after mounting for two reasons:\n\t\t// 1. As each node[SUSPENDED_COUNT] starts from 1, this iteration increases\n\t\t// each node[RELEASED_COUNT] by 1, therefore balancing the counters.\n\t\t// The nodes can now be completely consumed from the linked list.\n\t\t// 2. Handle nodes that might have gotten resolved between render and\n\t\t// componentDidMount.\n\t\tthis._map.forEach((node, child) => {\n\t\t\tresolve(this, child, node);\n\t\t});\n\t};\n", "/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n", "import { createElement, render } from 'preact';\n\n/**\n * @param {import('../../src/index').RenderableProps<{ context: any }>} props\n */\nfunction ContextProvider(props) {\n\tthis.getChildContext = () => props.context;\n\treturn props.children;\n}\n\n/**\n * Portal component\n * @this {import('./internal').Component}\n * @param {object | null | undefined} props\n *\n * TODO: use createRoot() instead of fake root\n */\nfunction Portal(props) {\n\tconst _this = this;\n\tlet container = props._container;\n\n\t_this.componentWillUnmount = function () {\n\t\trender(null, _this._temp);\n\t\t_this._temp = null;\n\t\t_this._container = null;\n\t};\n\n\t// When we change container we should clear our old container and\n\t// indicate a new mount.\n\tif (_this._container && _this._container !== container) {\n\t\t_this.componentWillUnmount();\n\t}\n\n\tif (!_this._temp) {\n\t\t_this._container = container;\n\n\t\t// Create a fake DOM parent node that manages a subset of `container`'s children:\n\t\t_this._temp = {\n\t\t\tnodeType: 1,\n\t\t\tparentNode: container,\n\t\t\tchildNodes: [],\n\t\t\tcontains: () => true,\n\t\t\t// Technically this isn't needed\n\t\t\tappendChild(child) {\n\t\t\t\tthis.childNodes.push(child);\n\t\t\t\t_this._container.appendChild(child);\n\t\t\t},\n\t\t\tinsertBefore(child, before) {\n\t\t\t\tthis.childNodes.push(child);\n\t\t\t\t_this._container.insertBefore(child, before);\n\t\t\t},\n\t\t\tremoveChild(child) {\n\t\t\t\tthis.childNodes.splice(this.childNodes.indexOf(child) >>> 1, 1);\n\t\t\t\t_this._container.removeChild(child);\n\t\t\t}\n\t\t};\n\t}\n\n\t// Render our wrapping element into temp.\n\trender(\n\t\tcreateElement(ContextProvider, { context: _this.context }, props._vnode),\n\t\t_this._temp\n\t);\n}\n\n/**\n * Create a `Portal` to continue rendering the vnode tree at a different DOM node\n * @param {import('./internal').VNode} vnode The vnode to render\n * @param {import('./internal').PreactElement} container The DOM node to continue rendering in to.\n */\nexport function createPortal(vnode, container) {\n\tconst el = createElement(Portal, { _vnode: vnode, _container: container });\n\tel.containerInfo = container;\n\treturn el;\n}\n", "import {\n\trender as preactRender,\n\thydrate as preactHydrate,\n\toptions,\n\ttoChildArray,\n\tComponent\n} from 'preact';\nimport {\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tuseEffect,\n\tuseId,\n\tuseImperativeHandle,\n\tuseLayoutEffect,\n\tuseMemo,\n\tuseReducer,\n\tuseRef,\n\tuseState\n} from 'preact/hooks';\nimport {\n\tuseDeferredValue,\n\tuseInsertionEffect,\n\tuseSyncExternalStore,\n\tuseTransition\n} from './index';\n\nexport const REACT_ELEMENT_TYPE =\n\t(typeof Symbol != 'undefined' && Symbol.for && Symbol.for('react.element')) ||\n\t0xeac7;\n\nconst CAMEL_PROPS =\n\t/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;\nconst ON_ANI = /^on(Ani|Tra|Tou|BeforeInp|Compo)/;\nconst CAMEL_REPLACE = /[A-Z0-9]/g;\nconst IS_DOM = typeof document !== 'undefined';\n\n// Input types for which onchange should not be converted to oninput.\n// type=\"file|checkbox|radio\", plus \"range\" in IE11.\n// (IE11 doesn't support Symbol, which we use here to turn `rad` into `ra` which matches \"range\")\nconst onChangeInputType = type =>\n\t(typeof Symbol != 'undefined' && typeof Symbol() == 'symbol'\n\t\t? /fil|che|rad/\n\t\t: /fil|che|ra/\n\t).test(type);\n\n// Some libraries like `react-virtualized` explicitly check for this.\nComponent.prototype.isReactComponent = {};\n\n// `UNSAFE_*` lifecycle hooks\n// Preact only ever invokes the unprefixed methods.\n// Here we provide a base \"fallback\" implementation that calls any defined UNSAFE_ prefixed method.\n// - If a component defines its own `componentDidMount()` (including via defineProperty), use that.\n// - If a component defines `UNSAFE_componentDidMount()`, `componentDidMount` is the alias getter/setter.\n// - If anything assigns to an `UNSAFE_*` property, the assignment is forwarded to the unprefixed property.\n// See https://github.com/preactjs/preact/issues/1941\n[\n\t'componentWillMount',\n\t'componentWillReceiveProps',\n\t'componentWillUpdate'\n].forEach(key => {\n\tObject.defineProperty(Component.prototype, key, {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn this['UNSAFE_' + key];\n\t\t},\n\t\tset(v) {\n\t\t\tObject.defineProperty(this, key, {\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: v\n\t\t\t});\n\t\t}\n\t});\n});\n\n/**\n * Proxy render() since React returns a Component reference.\n * @param {import('./internal').VNode} vnode VNode tree to render\n * @param {import('./internal').PreactElement} parent DOM node to render vnode tree into\n * @param {() => void} [callback] Optional callback that will be called after rendering\n * @returns {import('./internal').Component | null} The root component reference or null\n */\nexport function render(vnode, parent, callback) {\n\t// React destroys any existing DOM nodes, see #1727\n\t// ...but only on the first render, see #1828\n\tif (parent._children == null) {\n\t\tparent.textContent = '';\n\t}\n\n\tpreactRender(vnode, parent);\n\tif (typeof callback == 'function') callback();\n\n\treturn vnode ? vnode._component : null;\n}\n\nexport function hydrate(vnode, parent, callback) {\n\tpreactHydrate(vnode, parent);\n\tif (typeof callback == 'function') callback();\n\n\treturn vnode ? vnode._component : null;\n}\n\nlet oldEventHook = options.event;\noptions.event = e => {\n\tif (oldEventHook) e = oldEventHook(e);\n\n\te.persist = empty;\n\te.isPropagationStopped = isPropagationStopped;\n\te.isDefaultPrevented = isDefaultPrevented;\n\treturn (e.nativeEvent = e);\n};\n\nfunction empty() {}\n\nfunction isPropagationStopped() {\n\treturn this.cancelBubble;\n}\n\nfunction isDefaultPrevented() {\n\treturn this.defaultPrevented;\n}\n\nconst classNameDescriptorNonEnumberable = {\n\tenumerable: false,\n\tconfigurable: true,\n\tget() {\n\t\treturn this.class;\n\t}\n};\n\nfunction handleDomVNode(vnode) {\n\tlet props = vnode.props,\n\t\ttype = vnode.type,\n\t\tnormalizedProps = {};\n\n\tlet isNonDashedType = type.indexOf('-') === -1;\n\tfor (let i in props) {\n\t\tlet value = props[i];\n\n\t\tif (\n\t\t\t(i === 'value' && 'defaultValue' in props && value == null) ||\n\t\t\t// Emulate React's behavior of not rendering the contents of noscript tags on the client.\n\t\t\t(IS_DOM && i === 'children' && type === 'noscript') ||\n\t\t\ti === 'class' ||\n\t\t\ti === 'className'\n\t\t) {\n\t\t\t// Skip applying value if it is null/undefined and we already set\n\t\t\t// a default value\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet lowerCased = i.toLowerCase();\n\t\tif (i === 'defaultValue' && 'value' in props && props.value == null) {\n\t\t\t// `defaultValue` is treated as a fallback `value` when a value prop is present but null/undefined.\n\t\t\t// `defaultValue` for Elements with no value prop is the same as the DOM defaultValue property.\n\t\t\ti = 'value';\n\t\t} else if (i === 'download' && value === true) {\n\t\t\t// Calling `setAttribute` with a truthy value will lead to it being\n\t\t\t// passed as a stringified value, e.g. `download=\"true\"`. React\n\t\t\t// converts it to an empty string instead, otherwise the attribute\n\t\t\t// value will be used as the file name and the file will be called\n\t\t\t// \"true\" upon downloading it.\n\t\t\tvalue = '';\n\t\t} else if (lowerCased === 'translate' && value === 'no') {\n\t\t\tvalue = false;\n\t\t} else if (lowerCased[0] === 'o' && lowerCased[1] === 'n') {\n\t\t\tif (lowerCased === 'ondoubleclick') {\n\t\t\t\ti = 'ondblclick';\n\t\t\t} else if (\n\t\t\t\tlowerCased === 'onchange' &&\n\t\t\t\t(type === 'input' || type === 'textarea') &&\n\t\t\t\t!onChangeInputType(props.type)\n\t\t\t) {\n\t\t\t\tlowerCased = i = 'oninput';\n\t\t\t} else if (lowerCased === 'onfocus') {\n\t\t\t\ti = 'onfocusin';\n\t\t\t} else if (lowerCased === 'onblur') {\n\t\t\t\ti = 'onfocusout';\n\t\t\t} else if (ON_ANI.test(i)) {\n\t\t\t\ti = lowerCased;\n\t\t\t}\n\t\t} else if (isNonDashedType && CAMEL_PROPS.test(i)) {\n\t\t\ti = i.replace(CAMEL_REPLACE, '-$&').toLowerCase();\n\t\t} else if (value === null) {\n\t\t\tvalue = undefined;\n\t\t}\n\n\t\t// Add support for onInput and onChange, see #3561\n\t\t// if we have an oninput prop already change it to oninputCapture\n\t\tif (lowerCased === 'oninput') {\n\t\t\ti = lowerCased;\n\t\t\tif (normalizedProps[i]) {\n\t\t\t\ti = 'oninputCapture';\n\t\t\t}\n\t\t}\n\n\t\tnormalizedProps[i] = value;\n\t}\n\n\t// Add support for array select values: <select multiple value={[]} />\n\tif (\n\t\ttype == 'select' &&\n\t\tnormalizedProps.multiple &&\n\t\tArray.isArray(normalizedProps.value)\n\t) {\n\t\t// forEach() always returns undefined, which we abuse here to unset the value prop.\n\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\tchild.props.selected =\n\t\t\t\tnormalizedProps.value.indexOf(child.props.value) != -1;\n\t\t});\n\t}\n\n\t// Adding support for defaultValue in select tag\n\tif (type == 'select' && normalizedProps.defaultValue != null) {\n\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\tif (normalizedProps.multiple) {\n\t\t\t\tchild.props.selected =\n\t\t\t\t\tnormalizedProps.defaultValue.indexOf(child.props.value) != -1;\n\t\t\t} else {\n\t\t\t\tchild.props.selected =\n\t\t\t\t\tnormalizedProps.defaultValue == child.props.value;\n\t\t\t}\n\t\t});\n\t}\n\n\tif (props.class && !props.className) {\n\t\tnormalizedProps.class = props.class;\n\t\tObject.defineProperty(\n\t\t\tnormalizedProps,\n\t\t\t'className',\n\t\t\tclassNameDescriptorNonEnumberable\n\t\t);\n\t} else if (props.className && !props.class) {\n\t\tnormalizedProps.class = normalizedProps.className = props.className;\n\t} else if (props.class && props.className) {\n\t\tnormalizedProps.class = normalizedProps.className = props.className;\n\t}\n\n\tvnode.props = normalizedProps;\n}\n\nlet oldVNodeHook = options.vnode;\noptions.vnode = vnode => {\n\t// only normalize props on Element nodes\n\tif (typeof vnode.type === 'string') {\n\t\thandleDomVNode(vnode);\n\t}\n\n\tvnode.$$typeof = REACT_ELEMENT_TYPE;\n\n\tif (oldVNodeHook) oldVNodeHook(vnode);\n};\n\n// Only needed for react-relay\nlet currentComponent;\nconst oldBeforeRender = options._render;\noptions._render = function (vnode) {\n\tif (oldBeforeRender) {\n\t\toldBeforeRender(vnode);\n\t}\n\tcurrentComponent = vnode._component;\n};\n\nconst oldDiffed = options.diffed;\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.diffed = function (vnode) {\n\tif (oldDiffed) {\n\t\toldDiffed(vnode);\n\t}\n\n\tconst props = vnode.props;\n\tconst dom = vnode._dom;\n\n\tif (\n\t\tdom != null &&\n\t\tvnode.type === 'textarea' &&\n\t\t'value' in props &&\n\t\tprops.value !== dom.value\n\t) {\n\t\tdom.value = props.value == null ? '' : props.value;\n\t}\n\n\tcurrentComponent = null;\n};\n\n// This is a very very private internal function for React it\n// is used to sort-of do runtime dependency injection.\nexport const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {\n\tReactCurrentDispatcher: {\n\t\tcurrent: {\n\t\t\treadContext(context) {\n\t\t\t\treturn currentComponent._globalContext[context._id].props.value;\n\t\t\t},\n\t\t\tuseCallback,\n\t\t\tuseContext,\n\t\t\tuseDebugValue,\n\t\t\tuseDeferredValue,\n\t\t\tuseEffect,\n\t\t\tuseId,\n\t\t\tuseImperativeHandle,\n\t\t\tuseInsertionEffect,\n\t\t\tuseLayoutEffect,\n\t\t\tuseMemo,\n\t\t\t// useMutableSource, // experimental-only and replaced by uSES, likely not worth supporting\n\t\t\tuseReducer,\n\t\t\tuseRef,\n\t\t\tuseState,\n\t\t\tuseSyncExternalStore,\n\t\t\tuseTransition\n\t\t}\n\t}\n};\n", "import {\n\tcreateElement,\n\trender as preactRender,\n\tcloneElement as preactCloneElement,\n\tcreateRef,\n\tComponent,\n\tcreateContext,\n\tFragment\n} from 'preact';\nimport {\n\tuseState,\n\tuseId,\n\tuseReducer,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue\n} from 'preact/hooks';\nimport {\n\tuseInsertionEffect,\n\tstartTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tuseTransition\n} from './hooks';\nimport { PureComponent } from './PureComponent';\nimport { memo } from './memo';\nimport { forwardRef } from './forwardRef';\nimport { Children } from './Children';\nimport { Suspense, lazy } from './suspense';\nimport { SuspenseList } from './suspense-list';\nimport { createPortal } from './portals';\nimport {\n\thydrate,\n\trender,\n\tREACT_ELEMENT_TYPE,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n} from './render';\n\nconst version = '18.3.1'; // trick libraries to think we are react\n\n/**\n * Legacy version of createElement.\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor\n */\nfunction createFactory(type) {\n\treturn createElement.bind(null, type);\n}\n\n/**\n * Check if the passed element is a valid (p)react node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isValidElement(element) {\n\treturn !!element && element.$$typeof === REACT_ELEMENT_TYPE;\n}\n\n/**\n * Check if the passed element is a Fragment node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isFragment(element) {\n\treturn isValidElement(element) && element.type === Fragment;\n}\n\n/**\n * Check if the passed element is a Memo node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isMemo(element) {\n\treturn (\n\t\t!!element &&\n\t\t!!element.displayName &&\n\t\t(typeof element.displayName === 'string' ||\n\t\t\telement.displayName instanceof String) &&\n\t\telement.displayName.startsWith('Memo(')\n\t);\n}\n\n/**\n * Wrap `cloneElement` to abort if the passed element is not a valid element and apply\n * all vnode normalizations.\n * @param {import('./internal').VNode} element The vnode to clone\n * @param {object} props Props to add when cloning\n * @param {Array<import('./internal').ComponentChildren>} rest Optional component children\n */\nfunction cloneElement(element) {\n\tif (!isValidElement(element)) return element;\n\treturn preactCloneElement.apply(null, arguments);\n}\n\n/**\n * Remove a component tree from the DOM, including state and event handlers.\n * @param {import('./internal').PreactElement} container\n * @returns {boolean}\n */\nfunction unmountComponentAtNode(container) {\n\tif (container._children) {\n\t\tpreactRender(null, container);\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Get the matching DOM node for a component\n * @param {import('./internal').Component} component\n * @returns {import('./internal').PreactElement | null}\n */\nfunction findDOMNode(component) {\n\treturn (\n\t\t(component &&\n\t\t\t(component.base || (component.nodeType === 1 && component))) ||\n\t\tnull\n\t);\n}\n\n/**\n * Deprecated way to control batched rendering inside the reconciler, but we\n * already schedule in batches inside our rendering code\n * @template Arg\n * @param {(arg: Arg) => void} callback function that triggers the updated\n * @param {Arg} [arg] Optional argument that can be passed to the callback\n */\n// eslint-disable-next-line camelcase\nconst unstable_batchedUpdates = (callback, arg) => callback(arg);\n\n/**\n * In React, `flushSync` flushes the entire tree and forces a rerender. It's\n * implmented here as a no-op.\n * @template Arg\n * @template Result\n * @param {(arg: Arg) => Result} callback function that runs before the flush\n * @param {Arg} [arg] Optional argument that can be passed to the callback\n * @returns\n */\nconst flushSync = (callback, arg) => callback(arg);\n\n/**\n * Strict Mode is not implemented in Preact, so we provide a stand-in for it\n * that just renders its children without imposing any restrictions.\n */\nconst StrictMode = Fragment;\n\n// compat to react-is\nexport const isElement = isValidElement;\n\nexport * from 'preact/hooks';\nexport {\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\tisFragment,\n\tisMemo,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tflushSync,\n\tuseInsertionEffect,\n\tstartTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tuseTransition,\n\t// eslint-disable-next-line camelcase\n\tunstable_batchedUpdates,\n\tStrictMode,\n\tSuspense,\n\tSuspenseList,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n\n// React copies the named exports to the default one.\nexport default {\n\tuseState,\n\tuseId,\n\tuseReducer,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseInsertionEffect,\n\tuseTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tstartTransition,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\tisElement,\n\tisFragment,\n\tisMemo,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tflushSync,\n\tunstable_batchedUpdates,\n\tStrictMode,\n\tSuspense,\n\tSuspenseList,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n", "/*!\n Copyright (c) 2018 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString === Object.prototype.toString) {\n\t\t\t\t\tfor (var key in arg) {\n\t\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n", "declare const window: any\n\nexport function class_name(obj: any): string {\n let result: string = typeof obj\n if (result === \"function\") {\n return obj.name\n }\n if (result === \"object\") {\n if (obj === null) {\n result = \"null\"\n } else {\n const c = obj.constructor as any\n if (c) {\n result = c.displayName || c.name\n if (!result) {\n // Special handling for protobuf messages ...\n if (obj.$type) {\n result = obj.$type.name\n }\n }\n if (!result) {\n try {\n // Workaround for IE -- see https://goo.gl/IUuSNO ...\n const a = /function\\s+([^\\s(]+)/.exec(c.toString())\n result = a![1]\n } catch {\n result = \"???\"\n }\n }\n } else {\n result = \"???\"\n }\n }\n }\n return result\n}\n\n/**\n * Converts `obj` to JSON just like ``JSON.stringify` does,\n * but handles circular values and errors.\n *\n * Adapted from https://github.com/moll/json-stringify-safe/blob/master/stringify.js\n */\nexport function safe_JSON_stringify(obj: any, replacer?: any, spaces?: number): string {\n function to_JSON(x: any) {\n const stack: any = []\n const keys: any = []\n\n function cycle_replacer(key: string, value: any) {\n if (stack[0] === value) {\n return \"<circular ref: ~>\"\n }\n return \"<circular ref: ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \">\"\n }\n\n function serializer(this: any, key: string, value: any) {\n if (process.env.RUNNING_IN_BROWSER) {\n if (value === window) {\n return \"<window>\"\n }\n }\n if (stack.length > 0) {\n const pos = stack.indexOf(this)\n if (pos !== -1) {\n stack.splice(pos + 1)\n keys.splice(pos, Infinity, key)\n } else {\n stack.push(this)\n keys.push(key)\n }\n // Handle circular references.\n if (stack.indexOf(value) !== -1) {\n value = cycle_replacer.call(this, key, value)\n }\n } else {\n stack.push(value)\n }\n return replacer ? replacer.call(this, key, value) : value\n }\n return JSON.stringify(x, serializer, spaces)\n }\n\n try {\n return to_JSON(obj)\n } catch {\n try {\n if (typeof obj === \"object\") {\n const o: any = {}\n for (const [k, v] of Object.entries(obj)) {\n if (typeof v !== \"function\") {\n try {\n to_JSON(v)\n } catch {\n o[k] = \"<Could not be converted to JSON>\"\n continue\n }\n o[k] = v\n }\n }\n return to_JSON(o)\n }\n } catch {\n /* Ignored. */\n }\n return \"<Could not be converted to JSON>\"\n }\n}\n\nfunction element_to_string(elm: {tagName: string; className: string; id: string}) {\n const tag_name = elm.tagName.toLowerCase()\n let s = \"<\" + tag_name\n if (elm.id) {\n s += ' id=\"' + elm.id + '\"'\n }\n if (elm.className) {\n s += ' class=\"' + elm.className + '\"'\n }\n if ((elm as any).src) {\n s += ' src=\"' + (elm as any).src + '\"'\n }\n if ((elm as any).href) {\n s += ' href=\"' + (elm as any).href + '\"'\n }\n s += \">\"\n return s\n}\n\nexport function safe_to_string(x: any) {\n try {\n if (x.tagName) {\n return element_to_string(x)\n } else if (typeof x === \"number\") {\n return x.toString()\n } else if (x instanceof Error) {\n return error_to_string(x)\n } else {\n return safe_JSON_stringify(x)\n }\n } catch {\n try {\n return \"\" + x\n } catch (error2) {\n try {\n return \"??? -- \" + error2\n } catch {\n return \"???\"\n }\n }\n }\n}\n\nexport function error_to_string(error: any) {\n let s = \"\" + error\n try {\n let stack: string = (error as any).stacktrace || error.stack\n if (stack) {\n stack = \"\" + stack\n if (error.message && stack.indexOf(error.message) >= 0) {\n s = stack\n } else {\n s = s + \"\\n\" + stack\n }\n }\n } catch {\n // Ignored\n }\n if (s.startsWith(\"[object\")) {\n // No error? What do we have here? Assemble a string with all properties ...\n const a = []\n for (const k in error) {\n // Note: We want *all* properties of the error (except functions),\n // therefore we don't filter with hasOwnProperty ...\n const v: any = (error as any)[k]\n if (typeof v === \"function\") {\n continue\n }\n a.push(`${k}: ${safe_to_string(v)}`)\n }\n s = a.join(\"\\n\\t\")\n }\n return s\n}\n", "import BaseX from \"base-x\"\nimport {Buffer} from \"buffer\"\nimport {class_name, error_to_string, safe_JSON_stringify, safe_to_string} from \"./to_string\"\n\nexport {class_name, error_to_string, safe_JSON_stringify, safe_to_string}\n\n/**\n * Because we are in a `shared` module, we cannot use neither of the types `node` nor `dom`.\n * That's why we use this minimal declaration here.\n */\ndeclare type URL = {\n hostname: string\n protocol: string\n}\n\n/**\n * Because we are in a `shared` module, we cannot use neither of the types `node` nor `dom`.\n * That's why we use this minimal declaration here.\n */\ndeclare const URL: {\n prototype: URL\n new (url: string, base?: string | URL): URL\n}\n\nexport type CancelablePromise<T> = Promise<T> & {cancel: () => void}\n\nexport function is_UID(uid: any, prefix?: string): boolean {\n return !!(\n uid &&\n typeof uid === \"string\" &&\n uid.length >= 17 &&\n (!prefix || uid.startsWith(prefix))\n )\n}\n\nexport const as_UID = (x: any) => {\n if (is_UID(x)) {\n return x\n }\n throw new Error(\"Not an UID: \" + safe_to_string(x))\n}\n\nexport function CancelablePromise_resolve<T>(value: T): CancelablePromise<T> {\n const p = Promise.resolve(value) as CancelablePromise<T>\n p.cancel = nop\n return p\n}\n\nexport function CancelablePromise_reject<T extends Error>(value: T): CancelablePromise<T> {\n const p = Promise.reject(value) as CancelablePromise<T>\n p.cancel = nop\n return p\n}\n\nexport function full_name(account: {given_name?: string; family_name?: string} | undefined) {\n if (!account) {\n return \"...\"\n }\n const {given_name, family_name} = account\n let s = given_name || \"\"\n if (family_name) {\n if (s) {\n s += \" \"\n }\n s += family_name\n }\n return s.trim()\n}\n\nconst base62 = BaseX(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\")\n\n/**\n * See https://www.wikidata.org/wiki/Q809817\n */\nexport function encode_b62(buf: Buffer | Uint8Array): string {\n assert(\n buf.byteLength < 256,\n \"Buffer too large - only up to 255 bytes allowed for performance reasons\",\n )\n return base62.encode(buf)\n}\n\n/**\n * See https://www.wikidata.org/wiki/Q809817\n */\nexport function decode_b62(s: string): Buffer {\n assert(\n s.length < 344, // 343 == len(encode_b64(255 * [0xff]))\n \"String too large - only up to 343 characters allowed for performance reasons\",\n )\n return Buffer.from(base62.decode(s))\n}\n\n/**\n * See https://en.wikipedia.org/wiki/Base64#RFC_4648\n */\nexport function encode_b64url(buf: Buffer) {\n return buf.toString(\"base64\").replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=/g, \"\")\n}\n\n/**\n * See https://en.wikipedia.org/wiki/Base64#RFC_4648\n */\nexport function decode_b64url(s: string) {\n if (s.length % 4 !== 0) {\n s += \"===\".slice(0, 4 - (s.length % 4))\n }\n s = s.replace(/-/g, \"+\").replace(/_/g, \"/\")\n return Buffer.from(s, \"base64\")\n}\n\nexport function assert_never(x: never): any {\n const class_name_ = class_name(x)\n if (x && typeof x === \"object\" && class_name_ !== \"Object\") {\n throw new Error(\n `assert_never(...) called with ${class_name_} instance: ${safe_to_string(x)}`,\n )\n } else {\n throw new Error(`assert_never(${safe_to_string(x)})`)\n }\n}\n\nexport function is_never_compile_time_check(arg: never) {\n return arg\n}\n\n/**\n * Throws an ``Error`` if the first parameter is falsy.\n * See https://developer.mozilla.org/de/docs/Glossary/Falsy\n */\nexport function assert<T>(\n should_be_true: T,\n msg_or_function?: string | (() => string),\n): asserts should_be_true {\n if (!should_be_true) {\n if (typeof msg_or_function === \"string\") {\n throw new Error(msg_or_function)\n } else {\n let msg: string\n try {\n msg = msg_or_function ? msg_or_function() : \"assertion error\"\n } catch (error) {\n msg = \"Failed to produce error message: \" + error.message\n }\n throw new Error(msg)\n }\n }\n}\n\n/**\n * Make sure the given value is never null.\n */\nexport function not_null<T>(o: T, error_msg?: string): NonNullable<T> {\n if (o === null) {\n throw new Error(`Unexpected call: not_null(null)${error_msg ? \": \" + error_msg : \"\"}`)\n } else if (typeof o === \"undefined\") {\n throw new Error(`Unexpected call: not_null(undefined)${error_msg ? \": \" + error_msg : \"\"}`)\n }\n return o!\n}\n\n/**\n * Helper function to be used in ``Array.sort`` for sorting in ascending order.\n */\nexport function compare(a: any, b: any): number {\n if (a < b) {\n return -1\n }\n if (a > b) {\n return 1\n }\n return 0\n}\n\n/**\n * Convert `MyCamelCase` to `my_camel_case`.\n */\nexport function camel_case_to_underscore(s: string): string {\n // First replace MyURLResponse with MyURL_Response.\n s = s.replace(/([A-Z]+)([A-Z])/g, (_, m1, m2) => `_${m1}_${m2}`.toLowerCase())\n return s.replace(/(?!^)([A-Z]+)/g, \"_$1\").toLowerCase()\n}\n\n/**\n * Convert `my_camel_case` to `MyCamelCase`.\n */\nexport function underscore_to_camelcase(s: string): string {\n s = s[0].toUpperCase() + s.slice(1)\n return s.replace(/_[a-z]/g, function (g) {\n return g[1].toUpperCase()\n })\n}\n\nexport function truncate(s: string, max_length: number, filler = \"...\") {\n if (s.length <= max_length) {\n return s\n }\n return s.substring(0, max_length - filler.length) + \"...\"\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function nop(..._: any[]): any {\n // Nothing to do.\n}\n\nexport async function ignore_errors<T>(f: () => (T | undefined) | Promise<T | undefined>) {\n try {\n return await f()\n } catch {\n // Ignored\n }\n}\n\nexport async function sleep(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms))\n}\n\n/**\n * Returns a new Set containing all items of `set1` and `set2`.\n */\nexport function Set_union<T>(set1: Set<T>, set2: Set<T>): Set<T> {\n return new Set([...set1, ...set2])\n}\n\n/**\n * Returns a new Set containing all items which are both in `set1` and in `set2`.\n */\nexport function Set_intersection<T>(set1: Set<T>, set2: Set<T>): Set<T> {\n return new Set(Array.from(set1).filter((item) => set2.has(item)))\n}\n\n/**\n * Returns a new Set containing all items of `set1`, which are not in `set2`.\n */\nexport function Set_difference<T>(set1: Set<T>, set2: Set<T>): Set<T> {\n return new Set(Array.from(set1).filter((item) => !set2.has(item)))\n}\n\n/**\n * Returns a new Set containing all items of `set1`, which are not in `set2` and vice versa.\n */\nexport function Set_symmetric_difference<T>(set1: Set<T>, set2: Set<T>): Set<T> {\n return new Set(\n Array.from(set1)\n .filter((x) => !set2.has(x))\n .concat(Array.from(set2).filter((x) => !set1.has(x))),\n )\n}\n\nexport function Set_equal<T>(set1: Set<T>, set2: Set<T>): boolean {\n if (set1.size !== set2.size) {\n return false\n }\n for (const x of set1) {\n if (!set2.has(x)) {\n return false\n }\n }\n return true\n}\n\nexport class TimeoutError extends Error {\n constructor(message: string) {\n super(message)\n // This is needed according to https://goo.gl/N2zvkR\n Object.setPrototypeOf(this, TimeoutError.prototype)\n }\n}\n\n/**\n * Decorate the given `promise` so that it automatically rejects after the given\n * timeout if it was not resolved or rejected before. (Will not decorate the given\n * `promise` if the given `timeout` is less than or equals 0.)\n */\nexport function with_timeout<T, P extends Promise<T>>(\n millis: number,\n promise: P,\n opts: {description?: string} = {},\n): P {\n if (millis <= 0) {\n return promise\n }\n // Note: We construct the `Error` here, so that it has a meaningful stack trace.\n const timeout_error = new TimeoutError(\n `Timeout after ${millis} ms${opts.description ? \" - \" + opts.description : \"\"}`,\n )\n let promise_pending = true\n let cancel_timeout: any\n const result: any = Promise.race([\n promise.then(\n (value: T) => {\n promise_pending = false\n clearTimeout(cancel_timeout)\n return value\n },\n (error: Error) => {\n promise_pending = false\n clearTimeout(cancel_timeout)\n throw error\n },\n ),\n new Promise(\n (_, reject) =>\n (cancel_timeout = setTimeout(() => {\n reject(timeout_error)\n if (promise_pending && (promise as any).cancel) {\n ;(promise as any).cancel()\n }\n }, millis)),\n ),\n ])\n if ((promise as any).cancel) {\n result.cancel = (promise as any).cancel.bind(promise)\n }\n return result\n}\n\nexport type ControllablePromise<T> = Promise<T> & {\n resolve: (value: T) => void\n reject: (error: Error) => void\n}\n\nexport function new_ControllablePromise<T>(): ControllablePromise<T> {\n let resolve_: (value: T) => void\n let reject_: (error: Error) => void\n const promise = new Promise((resolve, reject) => {\n resolve_ = resolve\n reject_ = reject\n })\n promise.catch(nop) // Make sure a promise rejection is never unhandled.\n return Object.assign(promise, {\n resolve: resolve_!,\n reject: reject_!,\n }) as any\n}\n\ntype ControllableCancelablePromise<T> = ControllablePromise<T> & CancelablePromise<T>\n\nexport function new_ControllableCancelablePromise<T>(): ControllableCancelablePromise<T> {\n const p = new_ControllablePromise<T>() as ControllablePromise<T> & CancelablePromise<T>\n p.cancel = () => p.reject(new Error(\"Canceled\"))\n return p\n}\n\nexport function flatten<T>(a: Array<Array<T>>): Array<T> {\n return Array.prototype.concat.apply(\n [],\n a.map((x: any) => (x.toJS ? x.toJS() : x)),\n )\n}\n\n/**\n * Apply batches asynchronously.\n */\nexport class AsyncBatch<Key, Value extends ControllablePromise<any>> {\n private pending = new Map<Key, Value>()\n private schedule_timeout_id: any\n private closed = false\n\n constructor(\n private apply_batch: (batch: Map<Key, Value>) => void | Promise<void>,\n private opts: {\n schedule_interval_ms: number\n batch_size: number\n },\n ) {}\n\n get(key: Key): Value | undefined {\n return this.pending.get(key)\n }\n\n schedule(key: Key, promise: Value) {\n this.pending.set(key, promise)\n this.schedule_next_run()\n }\n\n async close() {\n clearTimeout(this.schedule_timeout_id)\n this.closed = true\n for (const promise of this.pending.values()) {\n promise.catch(nop)\n promise.reject(new Error(\"AsyncBatch is closed\"))\n }\n }\n\n private schedule_next_run() {\n if (this.closed) {\n throw new Error(\"AsyncBatch is closed\")\n }\n // Wrapping the actual scheduling in an `async` block makes sure we do not miss a scheduled\n // entry and do not run `this.apply_batch` twice on entries.\n ;(async () => {\n if (!this.schedule_timeout_id && this.pending.size) {\n this.schedule_timeout_id = setTimeout(this.run, this.opts.schedule_interval_ms)\n }\n })().catch(nop)\n }\n\n private run = async () => {\n const batch = [...this.pending.entries()].slice(0, this.opts.batch_size)\n if (!batch.length) {\n return\n }\n batch.forEach((x) => this.pending.delete(x[0]))\n try {\n await this.apply_batch(new Map(batch))\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Failed to apply patch, batch will not be retried again\", error)\n } finally {\n this.schedule_timeout_id = 0\n if (this.pending.size && !this.closed) {\n this.schedule_next_run()\n }\n }\n }\n}\n\n/**\n * Extract the domain part of an URL.\n */\nexport function extract_domain(url: string, remove_prefixes = [\"www\", \"ftp\"]): string | undefined {\n try {\n const domain = new URL(url.includes(\"://\") ? url : `https://${url}`).hostname\n const parts = domain.split(\".\")\n if (remove_prefixes.includes(parts[0])) {\n return parts.slice(1).join(\".\")\n }\n return domain.toLowerCase() || undefined\n } catch {\n return undefined\n }\n}\n\n/**\n * Extract the pathname part of an URL.\n */\nexport function extract_path(url?: string) {\n if (!url) {\n return \"\"\n }\n let i = url.indexOf(\"//\")\n if (i >= 0) {\n const j = url.indexOf(\"/\", i + 2)\n if (j < 0) {\n return \"\"\n }\n url = url.substr(j)\n } else {\n i = url.indexOf(\"/\")\n if (i > 0) {\n const s = url.substr(0, i)\n // We don't know if `s` is a hostname or a dirname, therefore we use a heuristic.\n if (s.indexOf(\".\") > 0) {\n url = url.substr(i)\n }\n }\n }\n i = url.indexOf(\"?\")\n if (i >= 0) {\n url = url.substr(0, i)\n }\n i = url.indexOf(\"#\")\n if (i >= 0) {\n url = url.substr(0, i)\n }\n return url\n}\n\n/**\n * Test whether the given string is a valid URL with protocols http or https and not longer than\n * `max_len`.\n */\nexport function is_valid_HTTP_URL(s: string, max_len: number): boolean {\n if (s.includes(\" \")) {\n return false\n }\n try {\n const url = new URL(s)\n const {protocol, hostname} = url\n if (\n !is_valid_IP_format(hostname, {remove_enclosing_IPv6_URL_brackets: true}) &&\n ((hostname.indexOf(\".\") < 0 && hostname !== \"localhost\") ||\n hostname.lastIndexOf(\".\") > hostname.length - 3)\n ) {\n return false\n }\n return [\"http:\", \"https:\"].includes(protocol) && s.length <= max_len\n } catch {\n return false\n }\n}\n\n/**\n * This is by no means a valid IP check. We just want to make sure that the basic\n * syntax seems correct.\n */\nexport function is_valid_IP_format(\n s: string,\n opts: {remove_enclosing_IPv6_URL_brackets?: boolean} = {},\n) {\n if (s.includes(\".\")) {\n const parts = s.split(\".\")\n return parts.length === 4 && parts.map((x) => parseInt(x)).every((x) => x >= 0 && x <= 255)\n }\n if (!s.includes(\":\")) {\n return false\n }\n if (opts.remove_enclosing_IPv6_URL_brackets) {\n if (s.startsWith(\"[\")) {\n s = s.substr(1)\n }\n if (s.endsWith(\"]\")) {\n s = s.substr(0, s.length - 1)\n }\n }\n const parts = s.split(\":\")\n return (\n parts.length > 2 &&\n parts.map((x) => (!x ? 0 : parseInt(x, 16))).every((x) => x >= 0 && x <= 65535)\n )\n}\n\nexport function is_IP_URL(s: string) {\n try {\n return is_valid_IP_format(new URL(s).hostname, {remove_enclosing_IPv6_URL_brackets: true})\n } catch {\n return false\n }\n}\n\nconst UNDEFINED = {\n toString: () => \"undefined\",\n}\n\nexport function memoize<T>(fn: () => T): () => T {\n const memoize_wrapper = () => {\n let v = (memoize_wrapper as any).__memoized_value__\n if (v === undefined) {\n v = fn()\n if (v === undefined) {\n v = UNDEFINED\n }\n ;(memoize_wrapper as any).__memoized_value__ = v\n }\n if (v === UNDEFINED) {\n return undefined\n }\n return v\n }\n return memoize_wrapper\n}\n\n/**\n * Note: This function consumes the given array.\n */\nexport function split_into_batches<T>(\n a: Array<T>,\n {max_batch_size: m}: {max_batch_size: number},\n): Array<Array<T>> {\n const batches: Array<Array<T>> = []\n const m2 = 2 * m\n while (a.length >= m2) {\n batches.push(a.splice(0, m))\n }\n if (a.length) {\n if (a.length <= m) {\n batches.push(a)\n } else {\n // Make the last two batches about the same size.\n const n = Math.ceil(a.length / 2)\n batches.push(a.splice(0, n))\n if (a.length) {\n batches.push(a)\n }\n }\n }\n return batches\n}\n\n/**\n * Returns `min` if `x < min`,\n * returns `max` if `x > max`,\n * returns x otherwise.\n */\nexport function clamp(x: number, [min, max]: [number, number]) {\n if (x < min) {\n return min\n }\n if (x > max) {\n return max\n }\n return x\n}\n\nexport function common_prefix(s1: string, s2: string): string {\n const n = Math.min(s1.length, s2.length)\n let i = 0\n while (i < n && s1.charAt(i) === s2.charAt(i)) {\n ++i\n }\n return s1.slice(0, i)\n}\n\n/**\n * We just lowercase the email, that's all. But still, use this function!\n */\nexport function normalize_email(email: string) {\n return email ? email.toLowerCase() : email\n}\n\n/**\n * Return all values of an enum of type `string -> number`.\n */\nexport function enum_values<T extends Record<keyof T, number>>(e: T): number[] {\n return Object.keys(e)\n .map((x) => parseInt(x))\n .filter((x) => !isNaN(x)) as any as number[]\n}\n\n/**\n * Return all entries of an enum of type `string -> number`.\n */\nexport function enum_entries<T extends Record<keyof T, number>>(e: T): [string, number][] {\n return Object.keys(e)\n .map((x) => parseInt(x))\n .filter((x) => !isNaN(x))\n .map((x) => [(e as any)[x], x]) as [string, number][]\n}\n\nexport function escape_html(s: string): string {\n return s.replace(/&/g, \"&\").replace(/</g, \"<\").replace(/>/g, \">\")\n}\n\n/**\n * Copied from https://github.com/darkskyapp/string-hash/blob/v1.1.3/index.js\n */\nexport function fast_string_hash(s: string) {\n let hash = 5381,\n i = s.length\n while (i) {\n hash = (hash * 33) ^ s.charCodeAt(--i)\n }\n /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed\n * integers. Since we want the results to be always positive, convert the\n * signed int to an unsigned by doing an unsigned bitshift. */\n return hash >>> 0\n}\n\nexport function are_arrays_equal<T>(a1: ArrayLike<T>, a2: ArrayLike<T>): boolean {\n if (a1 === a2) {\n return true\n }\n if (a1.length != a2.length) {\n return false\n }\n for (let i = 0; i < a1.length; i++) {\n if (a1[i] !== a2[i]) {\n return false\n }\n }\n return true\n}\n\n/**\n * Only call `f` once when the number of calls reaches `threshold` and then every `every` calls\n * if given.\n */\nexport function run_on_threshold(threshold: number, every?: number) {\n let n = 0\n return function (f: (num_calls: number) => void) {\n n += 1\n if (\n n === threshold ||\n (n > threshold && typeof every === \"number\" && (n - threshold) % every === 0)\n ) {\n f(n)\n }\n }\n}\n\nexport function anonymize_ip(ip: string) {\n // Anonymize the IP according to https://support.google.com/analytics/answer/2763052\n // IPv4: Only use the first 3 groups\n // IPv6: Ignore the last 80 bits (5 groups) - so basically keep the first 3 groups\n return (\n ip\n .replace(/::ffff:(.*)/i, \"$1\") // Mapped IPv4.\n // eslint-disable-next-line sonarjs/existing-groups\n .replace(/(\\d+\\.\\d+\\.\\d+\\.)\\d+/, \"$10\")\n .replace(/(.+?:.+?:.+?:).+/, \"$1:\")\n )\n}\n\nexport function as_array<T>(x: Iterable<T>): Array<T> {\n if (Array.isArray(x)) {\n return x\n }\n return Array.from(x)\n}\n\nexport function as_uint8array(x: Iterable<number> | Buffer | Uint8Array): Uint8Array {\n // Note: We cannot use `x instanceof Uint8Array` here, because that would\n // be true for `Buffer` instances (`Buffer` extends `Uint8Array`).\n return x.constructor.name === \"Uint8Array\" ? (x as Uint8Array) : new Uint8Array(x)\n}\n\n/**\n * This is a mix between `Promise.all()` and `Promise.allSettled()` as it will return all values\n * if all promise resolve or throw an error if at least one promise gets rejected.\n */\nexport async function all_finished<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(\n values: readonly [\n T1 | PromiseLike<T1>,\n T2 | PromiseLike<T2>,\n T3 | PromiseLike<T3>,\n T4 | PromiseLike<T4>,\n T5 | PromiseLike<T5>,\n T6 | PromiseLike<T6>,\n T7 | PromiseLike<T7>,\n T8 | PromiseLike<T8>,\n T9 | PromiseLike<T9>,\n T10 | PromiseLike<T10>,\n ],\n): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>\nexport async function all_finished<T1, T2, T3, T4, T5, T6, T7, T8, T9>(\n values: readonly [\n T1 | PromiseLike<T1>,\n T2 | PromiseLike<T2>,\n T3 | PromiseLike<T3>,\n T4 | PromiseLike<T4>,\n T5 | PromiseLike<T5>,\n T6 | PromiseLike<T6>,\n T7 | PromiseLike<T7>,\n T8 | PromiseLike<T8>,\n T9 | PromiseLike<T9>,\n ],\n): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>\nexport async function all_finished<T1, T2, T3, T4, T5, T6, T7, T8>(\n values: readonly [\n T1 | PromiseLike<T1>,\n T2 | PromiseLike<T2>,\n T3 | PromiseLike<T3>,\n T4 | PromiseLike<T4>,\n T5 | PromiseLike<T5>,\n T6 | PromiseLike<T6>,\n T7 | PromiseLike<T7>,\n T8 | PromiseLike<T8>,\n ],\n): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>\nexport async function all_finished<T1, T2, T3, T4, T5, T6, T7>(\n values: readonly [\n T1 | PromiseLike<T1>,\n T2 | PromiseLike<T2>,\n T3 | PromiseLike<T3>,\n T4 | PromiseLike<T4>,\n T5 | PromiseLike<T5>,\n T6 | PromiseLike<T6>,\n T7 | PromiseLike<T7>,\n ],\n): Promise<[T1, T2, T3, T4, T5, T6, T7]>\nexport async function all_finished<T1, T2, T3, T4, T5, T6>(\n values: readonly [\n T1 | PromiseLike<T1>,\n T2 | PromiseLike<T2>,\n T3 | PromiseLike<T3>,\n T4 | PromiseLike<T4>,\n T5 | PromiseLike<T5>,\n T6 | PromiseLike<T6>,\n ],\n): Promise<[T1, T2, T3, T4, T5, T6]>\nexport async function all_finished<T1, T2, T3, T4, T5>(\n values: readonly [\n T1 | PromiseLike<T1>,\n T2 | PromiseLike<T2>,\n T3 | PromiseLike<T3>,\n T4 | PromiseLike<T4>,\n T5 | PromiseLike<T5>,\n ],\n): Promise<[T1, T2, T3, T4, T5]>\nexport async function all_finished<T1, T2, T3, T4>(\n values: readonly [\n T1 | PromiseLike<T1>,\n T2 | PromiseLike<T2>,\n T3 | PromiseLike<T3>,\n T4 | PromiseLike<T4>,\n ],\n): Promise<[T1, T2, T3, T4]>\nexport async function all_finished<T1, T2, T3>(\n values: readonly [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>],\n): Promise<[T1, T2, T3]>\nexport async function all_finished<T1, T2>(\n values: readonly [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>],\n): Promise<[T1, T2]>\nexport async function all_finished<T>(values: readonly (T | PromiseLike<T>)[]): Promise<T[]>\nexport async function all_finished<T>(values: readonly (T | PromiseLike<T>)[]): Promise<T[]> {\n let error: any\n const res: any = await Promise.all(\n values.map((x) =>\n (x as any).catch?.((e: any) => {\n if (!error) {\n error = e\n }\n }),\n ),\n )\n if (error) {\n throw error\n }\n return res\n}\n\nexport function shorten_string(s: string, max_length: number) {\n if (s.length <= max_length) {\n return s\n }\n return s.substring(0, max_length - 3) + \"...\"\n}\n", "const niceErrors = {\n 0: `Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'`,\n 1(annotationType, key: PropertyKey) {\n return `Cannot apply '${annotationType}' to '${key.toString()}': Field not found.`\n },\n /*\n 2(prop) {\n return `invalid decorator for '${prop.toString()}'`\n },\n 3(prop) {\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\n },\n 4(prop) {\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\n },\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: `Invalid annotation`,\n 13: `Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)`,\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: `Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)`,\n 16: `Modification exception: the internal structure of an observable array was changed.`,\n 17(index, length) {\n return `[mobx.array] Index out of bounds, ${index} is larger than ${length}`\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name\n },\n 20(other) {\n return \"Cannot initialize map from \" + other\n },\n 21(dataStructure) {\n return `Cannot convert to map from '${dataStructure}'`\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24(thing) {\n return \"Cannot obtain administration from \" + thing\n },\n 25(property, name) {\n return `the entry '${property}' does not exist in the observable map '${name}'`\n },\n 26: \"please specify a property\",\n 27(property, name) {\n return `no observable property '${property.toString()}' found on the observable object '${name}'`\n },\n 28(thing) {\n return \"Cannot obtain atom from \" + thing\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32(name, derivation) {\n return `Cycle detected in computation ${name}: ${derivation}`\n },\n 33(name) {\n return `The setter of computed value '${name}' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?`\n },\n 34(name) {\n return `[ComputedValue '${name}'] It is not possible to assign a new value to a computed value.`\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37(method) {\n return `[mobx] \\`observableArray.${method}()\\` mutates the array in-place, which is not allowed inside a derivation. Use \\`array.slice().${method}()\\` instead`\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n} as const\n\nconst errors: typeof niceErrors = __DEV__ ? niceErrors : ({} as any)\n\nexport function die(error: string | keyof typeof errors, ...args: any[]): never {\n if (__DEV__) {\n let e: any = typeof error === \"string\" ? error : errors[error]\n if (typeof e === \"function\") e = e.apply(null, args as any)\n throw new Error(`[MobX] ${e}`)\n }\n throw new Error(\n typeof error === \"number\"\n ? `[MobX] minified error nr: ${error}${\n args.length ? \" \" + args.map(String).join(\",\") : \"\"\n }. Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts`\n : `[MobX] ${error}`\n )\n}\n", "declare const window: any\ndeclare const self: any\n\nconst mockGlobal = {}\n\nexport function getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis\n }\n if (typeof window !== \"undefined\") {\n return window\n }\n if (typeof global !== \"undefined\") {\n return global\n }\n if (typeof self !== \"undefined\") {\n return self\n }\n return mockGlobal\n}\n", "import { globalState, die } from \"../internal\"\n\n// We shorten anything used > 5 times\nexport const assign = Object.assign\nexport const getDescriptor = Object.getOwnPropertyDescriptor\nexport const defineProperty = Object.defineProperty\nexport const objectPrototype = Object.prototype\n\nexport const EMPTY_ARRAY = []\nObject.freeze(EMPTY_ARRAY)\n\nexport const EMPTY_OBJECT = {}\nObject.freeze(EMPTY_OBJECT)\n\nexport interface Lambda {\n (): void\n name?: string\n}\n\nconst hasProxy = typeof Proxy !== \"undefined\"\nconst plainObjectString = Object.toString()\n\nexport function assertProxies() {\n if (!hasProxy) {\n die(\n __DEV__\n ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\"\n : \"Proxy not available\"\n )\n }\n}\n\nexport function warnAboutProxyRequirement(msg: string) {\n if (__DEV__ && globalState.verifyProxies) {\n die(\n \"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" +\n msg\n )\n }\n}\n\nexport function getNextId() {\n return ++globalState.mobxGuid\n}\n\n/**\n * Makes sure that the provided function is invoked at most once.\n */\nexport function once(func: Lambda): Lambda {\n let invoked = false\n return function () {\n if (invoked) {\n return\n }\n invoked = true\n return (func as any).apply(this, arguments)\n }\n}\n\nexport const noop = () => {}\n\nexport function isFunction(fn: any): fn is Function {\n return typeof fn === \"function\"\n}\n\nexport function isString(value: any): value is string {\n return typeof value === \"string\"\n}\n\nexport function isStringish(value: any): value is string | number | symbol {\n const t = typeof value\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true\n }\n return false\n}\n\nexport function isObject(value: any): value is Object {\n return value !== null && typeof value === \"object\"\n}\n\nexport function isPlainObject(value: any) {\n if (!isObject(value)) {\n return false\n }\n const proto = Object.getPrototypeOf(value)\n if (proto == null) {\n return true\n }\n const protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor\n return (\n typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString\n )\n}\n\n// https://stackoverflow.com/a/37865170\nexport function isGenerator(obj: any): boolean {\n const constructor = obj?.constructor\n if (!constructor) {\n return false\n }\n if (\n \"GeneratorFunction\" === constructor.name ||\n \"GeneratorFunction\" === constructor.displayName\n ) {\n return true\n }\n return false\n}\n\nexport function addHiddenProp(object: any, propName: PropertyKey, value: any) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value\n })\n}\n\nexport function addHiddenFinalProp(object: any, propName: PropertyKey, value: any) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value\n })\n}\n\nexport function createInstanceofPredicate<T>(\n name: string,\n theClass: new (...args: any[]) => T\n): (x: any) => x is T {\n const propName = \"isMobX\" + name\n theClass.prototype[propName] = true\n return function (x) {\n return isObject(x) && x[propName] === true\n } as any\n}\n\n/**\n * Yields true for both native and observable Map, even across different windows.\n */\nexport function isES6Map(thing: unknown): thing is Map<any, any> {\n return thing != null && Object.prototype.toString.call(thing) === \"[object Map]\"\n}\n\n/**\n * Makes sure a Map is an instance of non-inherited native or observable Map.\n */\nexport function isPlainES6Map(thing: Map<unknown, unknown>): boolean {\n const mapProto = Object.getPrototypeOf(thing)\n const objectProto = Object.getPrototypeOf(mapProto)\n const nullProto = Object.getPrototypeOf(objectProto)\n return nullProto === null\n}\n\n/**\n * Yields true for both native and observable Set, even across different windows.\n */\nexport function isES6Set(thing: unknown): thing is Set<any> {\n return thing != null && Object.prototype.toString.call(thing) === \"[object Set]\"\n}\n\nconst hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\"\n\n/**\n * Returns the following: own enumerable keys and symbols.\n */\nexport function getPlainObjectKeys(object: any) {\n const keys = Object.keys(object)\n // Not supported in IE, so there are not going to be symbol props anyway...\n if (!hasGetOwnPropertySymbols) {\n return keys\n }\n const symbols = Object.getOwnPropertySymbols(object)\n if (!symbols.length) {\n return keys\n }\n return [...keys, ...symbols.filter(s => objectPrototype.propertyIsEnumerable.call(object, s))]\n}\n\n// From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\nexport const ownKeys: (target: any) => Array<string | symbol> =\n typeof Reflect !== \"undefined\" && Reflect.ownKeys\n ? Reflect.ownKeys\n : hasGetOwnPropertySymbols\n ? obj => Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj) as any)\n : /* istanbul ignore next */ Object.getOwnPropertyNames\n\nexport function stringifyKey(key: any): string {\n if (typeof key === \"string\") {\n return key\n }\n if (typeof key === \"symbol\") {\n return key.toString()\n }\n return new String(key).toString()\n}\n\nexport function toPrimitive(value: any) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value\n}\n\nexport function hasProp(target: Object, prop: PropertyKey): boolean {\n return objectPrototype.hasOwnProperty.call(target, prop)\n}\n\n// From Immer utils\nexport const getOwnPropertyDescriptors =\n Object.getOwnPropertyDescriptors ||\n function getOwnPropertyDescriptors(target: any) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n const res: any = {}\n // Note: without polyfill for ownKeys, symbols won't be picked up\n ownKeys(target).forEach(key => {\n res[key] = getDescriptor(target, key)\n })\n return res\n }\n\nexport function getFlag(flags: number, mask: number) {\n return !!(flags & mask)\n}\n\nexport function setFlag(flags: number, mask: number, newValue: boolean): number {\n if (newValue) {\n flags |= mask\n } else {\n flags &= ~mask\n }\n return flags\n}\n", "import { Annotation, addHiddenProp, AnnotationsMap, hasProp, die, isOverride } from \"../internal\"\n\nimport type { Decorator } from \"../types/decorator_fills\"\n\nexport const storedAnnotationsSymbol = Symbol(\"mobx-stored-annotations\")\n\n/**\n * Creates a function that acts as\n * - decorator\n * - annotation object\n */\nexport function createDecoratorAnnotation<D extends Decorator = Decorator>(\n annotation: Annotation\n): PropertyDecorator & Annotation & D {\n function decorator(target, property) {\n if (is20223Decorator(property)) {\n return annotation.decorate_20223_(target, property)\n } else {\n storeAnnotation(target, property, annotation)\n }\n }\n return Object.assign(decorator, annotation) as any\n}\n\n/**\n * Stores annotation to prototype,\n * so it can be inspected later by `makeObservable` called from constructor\n */\nexport function storeAnnotation(prototype: any, key: PropertyKey, annotation: Annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, {\n // Inherit annotations\n ...prototype[storedAnnotationsSymbol]\n })\n }\n // @override must override something\n if (__DEV__ && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n const fieldName = `${prototype.constructor.name}.prototype.${key.toString()}`\n die(\n `'${fieldName}' is decorated with 'override', ` +\n `but no such decorated member was found on prototype.`\n )\n }\n // Cannot re-decorate\n assertNotDecorated(prototype, annotation, key)\n\n // Ignore override\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation\n }\n}\n\nfunction assertNotDecorated(prototype: object, annotation: Annotation, key: PropertyKey) {\n if (__DEV__ && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n const fieldName = `${prototype.constructor.name}.prototype.${key.toString()}`\n const currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_\n const requestedAnnotationType = annotation.annotationType_\n die(\n `Cannot apply '@${requestedAnnotationType}' to '${fieldName}':` +\n `\\nThe field is already decorated with '@${currentAnnotationType}'.` +\n `\\nRe-decorating fields is not allowed.` +\n `\\nUse '@override' decorator for methods overridden by subclass.`\n )\n }\n}\n\n/**\n * Collects annotations from prototypes and stores them on target (instance)\n */\nexport function collectStoredAnnotations(target): AnnotationsMap<any, any> {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n // if (__DEV__ && !target[storedAnnotationsSymbol]) {\n // die(\n // `No annotations were passed to makeObservable, but no decorated members have been found either`\n // )\n // }\n // We need a copy as we will remove annotation from the list once it's applied.\n addHiddenProp(target, storedAnnotationsSymbol, { ...target[storedAnnotationsSymbol] })\n }\n return target[storedAnnotationsSymbol]\n}\n\nexport function is20223Decorator(context): context is DecoratorContext {\n return typeof context == \"object\" && typeof context[\"kind\"] == \"string\"\n}\n\nexport function assert20223DecoratorType(\n context: DecoratorContext,\n types: DecoratorContext[\"kind\"][]\n) {\n if (__DEV__ && !types.includes(context.kind)) {\n die(\n `The decorator applied to '${String(context.name)}' cannot be used on a ${\n context.kind\n } element`\n )\n }\n}\n", "import {\n IDerivationState_,\n IObservable,\n IDerivation,\n createInstanceofPredicate,\n endBatch,\n getNextId,\n noop,\n onBecomeObserved,\n onBecomeUnobserved,\n propagateChanged,\n reportObserved,\n startBatch,\n Lambda\n} from \"../internal\"\n\nimport { getFlag, setFlag } from \"../utils/utils\"\n\nexport const $mobx = Symbol(\"mobx administration\")\n\nexport interface IAtom extends IObservable {\n reportObserved(): boolean\n reportChanged(): void\n}\n\nexport class Atom implements IAtom {\n private static readonly isBeingObservedMask_ = 0b001\n private static readonly isPendingUnobservationMask_ = 0b010\n private static readonly diffValueMask_ = 0b100\n private flags_ = 0b000\n\n observers_ = new Set<IDerivation>()\n\n lastAccessedBy_ = 0\n lowestObserverState_ = IDerivationState_.NOT_TRACKING_\n /**\n * Create a new atom. For debugging purposes it is recommended to give it a name.\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\n */\n constructor(public name_ = __DEV__ ? \"Atom@\" + getNextId() : \"Atom\") {}\n\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n get isBeingObserved(): boolean {\n return getFlag(this.flags_, Atom.isBeingObservedMask_)\n }\n set isBeingObserved(newValue: boolean) {\n this.flags_ = setFlag(this.flags_, Atom.isBeingObservedMask_, newValue)\n }\n\n get isPendingUnobservation(): boolean {\n return getFlag(this.flags_, Atom.isPendingUnobservationMask_)\n }\n set isPendingUnobservation(newValue: boolean) {\n this.flags_ = setFlag(this.flags_, Atom.isPendingUnobservationMask_, newValue)\n }\n\n get diffValue(): 0 | 1 {\n return getFlag(this.flags_, Atom.diffValueMask_) ? 1 : 0\n }\n set diffValue(newValue: 0 | 1) {\n this.flags_ = setFlag(this.flags_, Atom.diffValueMask_, newValue === 1 ? true : false)\n }\n\n // onBecomeObservedListeners\n public onBOL: Set<Lambda> | undefined\n // onBecomeUnobservedListeners\n public onBUOL: Set<Lambda> | undefined\n\n public onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(listener => listener())\n }\n }\n\n public onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(listener => listener())\n }\n }\n\n /**\n * Invoke this method to notify mobx that your atom has been used somehow.\n * Returns true if there is currently a reactive context.\n */\n public reportObserved(): boolean {\n return reportObserved(this)\n }\n\n /**\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\n */\n public reportChanged() {\n startBatch()\n propagateChanged(this)\n endBatch()\n }\n\n toString() {\n return this.name_\n }\n}\n\nexport const isAtom = createInstanceofPredicate(\"Atom\", Atom)\n\nexport function createAtom(\n name: string,\n onBecomeObservedHandler: () => void = noop,\n onBecomeUnobservedHandler: () => void = noop\n): IAtom {\n const atom = new Atom(name)\n // default `noop` listener will not initialize the hook Set\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler)\n }\n\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler)\n }\n return atom\n}\n", "import { deepEqual } from \"../internal\"\n\nexport interface IEqualsComparer<T> {\n (a: T, b: T): boolean\n}\n\nfunction identityComparer(a: any, b: any): boolean {\n return a === b\n}\n\nfunction structuralComparer(a: any, b: any): boolean {\n return deepEqual(a, b)\n}\n\nfunction shallowComparer(a: any, b: any): boolean {\n return deepEqual(a, b, 1)\n}\n\nfunction defaultComparer(a: any, b: any): boolean {\n if (Object.is) {\n return Object.is(a, b)\n }\n\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b\n}\n\nexport const comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n default: defaultComparer,\n shallow: shallowComparer\n}\n", "import {\n deepEqual,\n isES6Map,\n isES6Set,\n isObservable,\n isObservableArray,\n isObservableMap,\n isObservableSet,\n isObservableObject,\n isPlainObject,\n observable,\n die,\n isAction,\n autoAction,\n flow,\n isFlow,\n isGenerator\n} from \"../internal\"\n\nexport interface IEnhancer<T> {\n (newValue: T, oldValue: T | undefined, name: string): T\n}\n\nexport function deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) {\n return v\n }\n\n // something that can be converted and mutated?\n if (Array.isArray(v)) {\n return observable.array(v, { name })\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, { name })\n }\n if (isES6Map(v)) {\n return observable.map(v, { name })\n }\n if (isES6Set(v)) {\n return observable.set(v, { name })\n }\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v)\n } else {\n return autoAction(name, v)\n }\n }\n return v\n}\n\nexport function shallowEnhancer(v, _, name): any {\n if (v === undefined || v === null) {\n return v\n }\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n return v\n }\n if (Array.isArray(v)) {\n return observable.array(v, { name, deep: false })\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, { name, deep: false })\n }\n if (isES6Map(v)) {\n return observable.map(v, { name, deep: false })\n }\n if (isES6Set(v)) {\n return observable.set(v, { name, deep: false })\n }\n\n if (__DEV__) {\n die(\n \"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\"\n )\n }\n}\n\nexport function referenceEnhancer(newValue?) {\n // never turn into an observable\n return newValue\n}\n\nexport function refStructEnhancer(v, oldValue): any {\n if (__DEV__ && isObservable(v)) {\n die(`observable.struct should not be used with observable values`)\n }\n if (deepEqual(v, oldValue)) {\n return oldValue\n }\n return v\n}\n", "import {\n die,\n Annotation,\n hasProp,\n createDecoratorAnnotation,\n ObservableObjectAdministration,\n MakeResult\n} from \"../internal\"\n\nimport type { ClassMethodDecorator } from \"./decorator_fills\"\n\nconst OVERRIDE = \"override\"\n\nexport const override: Annotation & PropertyDecorator & ClassMethodDecorator =\n createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_,\n extend_,\n decorate_20223_\n })\n\nexport function isOverride(annotation: Annotation): boolean {\n return annotation.annotationType_ === OVERRIDE\n}\n\nfunction make_(this: Annotation, adm: ObservableObjectAdministration, key): MakeResult {\n // Must not be plain object\n if (__DEV__ && adm.isPlainObject_) {\n die(\n `Cannot apply '${this.annotationType_}' to '${adm.name_}.${key.toString()}':` +\n `\\n'${this.annotationType_}' cannot be used on plain objects.`\n )\n }\n // Must override something\n if (__DEV__ && !hasProp(adm.appliedAnnotations_!, key)) {\n die(\n `'${adm.name_}.${key.toString()}' is annotated with '${this.annotationType_}', ` +\n `but no such annotated member was found on prototype.`\n )\n }\n return MakeResult.Cancel\n}\n\nfunction extend_(this: Annotation, adm, key, descriptor, proxyTrap): boolean {\n die(`'${this.annotationType_}' can only be used with 'makeObservable'`)\n}\n\nfunction decorate_20223_(this: Annotation, desc, context: DecoratorContext) {\n console.warn(`'${this.annotationType_}' cannot be used with decorators - this is a no-op`)\n}\n", "import {\n ObservableObjectAdministration,\n createAction,\n isAction,\n defineProperty,\n die,\n isFunction,\n Annotation,\n globalState,\n MakeResult,\n assert20223DecoratorType\n} from \"../internal\"\n\nexport function createActionAnnotation(name: string, options?: object): Annotation {\n return {\n annotationType_: name,\n options_: options,\n make_,\n extend_,\n decorate_20223_\n }\n}\n\nfunction make_(\n this: Annotation,\n adm: ObservableObjectAdministration,\n key: PropertyKey,\n descriptor: PropertyDescriptor,\n source: object\n): MakeResult {\n // bound\n if (this.options_?.bound) {\n return this.extend_(adm, key, descriptor, false) === null\n ? MakeResult.Cancel\n : MakeResult.Break\n }\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null\n ? MakeResult.Cancel\n : MakeResult.Continue\n }\n // prototype\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return MakeResult.Break\n }\n const actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false)\n defineProperty(source, key, actionDescriptor)\n return MakeResult.Continue\n}\n\nfunction extend_(\n this: Annotation,\n adm: ObservableObjectAdministration,\n key: PropertyKey,\n descriptor: PropertyDescriptor,\n proxyTrap: boolean\n): boolean | null {\n const actionDescriptor = createActionDescriptor(adm, this, key, descriptor)\n return adm.defineProperty_(key, actionDescriptor, proxyTrap)\n}\n\nfunction decorate_20223_(this: Annotation, mthd, context: DecoratorContext) {\n if (__DEV__) {\n assert20223DecoratorType(context, [\"method\", \"field\"])\n }\n const { kind, name, addInitializer } = context\n const ann = this\n\n const _createAction = m =>\n createAction(ann.options_?.name ?? name!.toString(), m, ann.options_?.autoAction ?? false)\n\n if (kind == \"field\") {\n return function (initMthd) {\n let mthd = initMthd\n if (!isAction(mthd)) {\n mthd = _createAction(mthd)\n }\n if (ann.options_?.bound) {\n mthd = mthd.bind(this)\n mthd.isMobxAction = true\n }\n return mthd\n }\n }\n\n if (kind == \"method\") {\n if (!isAction(mthd)) {\n mthd = _createAction(mthd)\n }\n\n if (this.options_?.bound) {\n addInitializer(function () {\n const self = this as any\n const bound = self[name].bind(self)\n bound.isMobxAction = true\n self[name] = bound\n })\n }\n\n return mthd\n }\n\n die(\n `Cannot apply '${ann.annotationType_}' to '${String(name)}' (kind: ${kind}):` +\n `\\n'${ann.annotationType_}' can only be used on properties with a function value.`\n )\n}\n\nfunction assertActionDescriptor(\n adm: ObservableObjectAdministration,\n { annotationType_ }: Annotation,\n key: PropertyKey,\n { value }: PropertyDescriptor\n) {\n if (__DEV__ && !isFunction(value)) {\n die(\n `Cannot apply '${annotationType_}' to '${adm.name_}.${key.toString()}':` +\n `\\n'${annotationType_}' can only be used on properties with a function value.`\n )\n }\n}\n\nexport function createActionDescriptor(\n adm: ObservableObjectAdministration,\n annotation: Annotation,\n key: PropertyKey,\n descriptor: PropertyDescriptor,\n // provides ability to disable safeDescriptors for prototypes\n safeDescriptors: boolean = globalState.safeDescriptors\n) {\n assertActionDescriptor(adm, annotation, key, descriptor)\n let { value } = descriptor\n if (annotation.options_?.bound) {\n value = value.bind(adm.proxy_ ?? adm.target_)\n }\n return {\n value: createAction(\n annotation.options_?.name ?? key.toString(),\n value,\n annotation.options_?.autoAction ?? false,\n // https://github.com/mobxjs/mobx/discussions/3140\n annotation.options_?.bound ? adm.proxy_ ?? adm.target_ : undefined\n ),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n }\n}\n", "import {\n ObservableObjectAdministration,\n Annotation,\n defineProperty,\n die,\n flow,\n isFlow,\n isFunction,\n globalState,\n MakeResult,\n hasProp,\n assert20223DecoratorType\n} from \"../internal\"\n\nexport function createFlowAnnotation(name: string, options?: object): Annotation {\n return {\n annotationType_: name,\n options_: options,\n make_,\n extend_,\n decorate_20223_\n }\n}\n\nfunction make_(\n this: Annotation,\n adm: ObservableObjectAdministration,\n key: PropertyKey,\n descriptor: PropertyDescriptor,\n source: object\n): MakeResult {\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null\n ? MakeResult.Cancel\n : MakeResult.Continue\n }\n // prototype\n // bound - must annotate protos to support super.flow()\n if (this.options_?.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n if (this.extend_(adm, key, descriptor, false) === null) {\n return MakeResult.Cancel\n }\n }\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return MakeResult.Break\n }\n const flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false)\n defineProperty(source, key, flowDescriptor)\n return MakeResult.Continue\n}\n\nfunction extend_(\n this: Annotation,\n adm: ObservableObjectAdministration,\n key: PropertyKey,\n descriptor: PropertyDescriptor,\n proxyTrap: boolean\n): boolean | null {\n const flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, this.options_?.bound)\n return adm.defineProperty_(key, flowDescriptor, proxyTrap)\n}\n\nfunction decorate_20223_(this: Annotation, mthd, context: ClassMethodDecoratorContext) {\n if (__DEV__) {\n assert20223DecoratorType(context, [\"method\"])\n }\n const { name, addInitializer } = context\n\n if (!isFlow(mthd)) {\n mthd = flow(mthd)\n }\n\n if (this.options_?.bound) {\n addInitializer(function () {\n const self = this as any\n const bound = self[name].bind(self)\n bound.isMobXFlow = true\n self[name] = bound\n })\n }\n\n return mthd\n}\n\nfunction assertFlowDescriptor(\n adm: ObservableObjectAdministration,\n { annotationType_ }: Annotation,\n key: PropertyKey,\n { value }: PropertyDescriptor\n) {\n if (__DEV__ && !isFunction(value)) {\n die(\n `Cannot apply '${annotationType_}' to '${adm.name_}.${key.toString()}':` +\n `\\n'${annotationType_}' can only be used on properties with a generator function value.`\n )\n }\n}\n\nfunction createFlowDescriptor(\n adm: ObservableObjectAdministration,\n annotation: Annotation,\n key: PropertyKey,\n descriptor: PropertyDescriptor,\n bound: boolean,\n // provides ability to disable safeDescriptors for prototypes\n safeDescriptors: boolean = globalState.safeDescriptors\n): PropertyDescriptor {\n assertFlowDescriptor(adm, annotation, key, descriptor)\n let { value } = descriptor\n // In case of flow.bound, the descriptor can be from already annotated prototype\n if (!isFlow(value)) {\n value = flow(value)\n }\n if (bound) {\n // We do not keep original function around, so we bind the existing flow\n value = value.bind(adm.proxy_ ?? adm.target_)\n // This is normally set by `flow`, but `bind` returns new function...\n value.isMobXFlow = true\n }\n return {\n value,\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n }\n}\n", "import {\n ObservableObjectAdministration,\n die,\n Annotation,\n MakeResult,\n assert20223DecoratorType,\n $mobx,\n asObservableObject,\n ComputedValue\n} from \"../internal\"\n\nexport function createComputedAnnotation(name: string, options?: object): Annotation {\n return {\n annotationType_: name,\n options_: options,\n make_,\n extend_,\n decorate_20223_\n }\n}\n\nfunction make_(\n this: Annotation,\n adm: ObservableObjectAdministration,\n key: PropertyKey,\n descriptor: PropertyDescriptor\n): MakeResult {\n return this.extend_(adm, key, descriptor, false) === null ? MakeResult.Cancel : MakeResult.Break\n}\n\nfunction extend_(\n this: Annotation,\n adm: ObservableObjectAdministration,\n key: PropertyKey,\n descriptor: PropertyDescriptor,\n proxyTrap: boolean\n): boolean | null {\n assertComputedDescriptor(adm, this, key, descriptor)\n return adm.defineComputedProperty_(\n key,\n {\n ...this.options_,\n get: descriptor.get,\n set: descriptor.set\n },\n proxyTrap\n )\n}\n\nfunction decorate_20223_(this: Annotation, get, context: ClassGetterDecoratorContext) {\n if (__DEV__) {\n assert20223DecoratorType(context, [\"getter\"])\n }\n const ann = this\n const { name: key, addInitializer } = context\n\n addInitializer(function () {\n const adm: ObservableObjectAdministration = asObservableObject(this)[$mobx]\n const options = {\n ...ann.options_,\n get,\n context: this\n }\n options.name ||= __DEV__\n ? `${adm.name_}.${key.toString()}`\n : `ObservableObject.${key.toString()}`\n adm.values_.set(key, new ComputedValue(options))\n })\n\n return function () {\n return this[$mobx].getObservablePropValue_(key)\n }\n}\n\nfunction assertComputedDescriptor(\n adm: ObservableObjectAdministration,\n { annotationType_ }: Annotation,\n key: PropertyKey,\n { get }: PropertyDescriptor\n) {\n if (__DEV__ && !get) {\n die(\n `Cannot apply '${annotationType_}' to '${adm.name_}.${key.toString()}':` +\n `\\n'${annotationType_}' can only be used on getter(+setter) properties.`\n )\n }\n}\n", "import {\n ObservableObjectAdministration,\n deepEnhancer,\n die,\n Annotation,\n MakeResult,\n assert20223DecoratorType,\n ObservableValue,\n asObservableObject,\n $mobx\n} from \"../internal\"\n\nexport function createObservableAnnotation(name: string, options?: object): Annotation {\n return {\n annotationType_: name,\n options_: options,\n make_,\n extend_,\n decorate_20223_\n }\n}\n\nfunction make_(\n this: Annotation,\n adm: ObservableObjectAdministration,\n key: PropertyKey,\n descriptor: PropertyDescriptor\n): MakeResult {\n return this.extend_(adm, key, descriptor, false) === null ? MakeResult.Cancel : MakeResult.Break\n}\n\nfunction extend_(\n this: Annotation,\n adm: ObservableObjectAdministration,\n key: PropertyKey,\n descriptor: PropertyDescriptor,\n proxyTrap: boolean\n): boolean | null {\n assertObservableDescriptor(adm, this, key, descriptor)\n return adm.defineObservableProperty_(\n key,\n descriptor.value,\n this.options_?.enhancer ?? deepEnhancer,\n proxyTrap\n )\n}\n\nfunction decorate_20223_(\n this: Annotation,\n desc,\n context: ClassAccessorDecoratorContext | ClassFieldDecoratorContext\n) {\n if (__DEV__) {\n if (context.kind === \"field\") {\n throw die(\n `Please use \\`@observable accessor ${String(\n context.name\n )}\\` instead of \\`@observable ${String(context.name)}\\``\n )\n }\n assert20223DecoratorType(context, [\"accessor\"])\n }\n\n const ann = this\n const { kind, name } = context\n\n // The laziness here is not ideal... It's a workaround to how 2022.3 Decorators are implemented:\n // `addInitializer` callbacks are executed _before_ any accessors are defined (instead of the ideal-for-us right after each).\n // This means that, if we were to do our stuff in an `addInitializer`, we'd attempt to read a private slot\n // before it has been initialized. The runtime doesn't like that and throws a `Cannot read private member\n // from an object whose class did not declare it` error.\n // TODO: it seems that this will not be required anymore in the final version of the spec\n // See TODO: link\n const initializedObjects = new WeakSet()\n\n function initializeObservable(target, value) {\n const adm: ObservableObjectAdministration = asObservableObject(target)[$mobx]\n const observable = new ObservableValue(\n value,\n ann.options_?.enhancer ?? deepEnhancer,\n __DEV__ ? `${adm.name_}.${name.toString()}` : `ObservableObject.${name.toString()}`,\n false\n )\n adm.values_.set(name, observable)\n initializedObjects.add(target)\n }\n\n if (kind == \"accessor\") {\n return {\n get() {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, desc.get.call(this))\n }\n return this[$mobx].getObservablePropValue_(name)\n },\n set(value) {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, value)\n }\n return this[$mobx].setObservablePropValue_(name, value)\n },\n init(value) {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, value)\n }\n return value\n }\n }\n }\n\n return\n}\n\nfunction assertObservableDescriptor(\n adm: ObservableObjectAdministration,\n { annotationType_ }: Annotation,\n key: PropertyKey,\n descriptor: PropertyDescriptor\n) {\n if (__DEV__ && !(\"value\" in descriptor)) {\n die(\n `Cannot apply '${annotationType_}' to '${adm.name_}.${key.toString()}':` +\n `\\n'${annotationType_}' cannot be used on getter/setter properties`\n )\n }\n}\n", "import {\n ObservableObjectAdministration,\n observable,\n Annotation,\n defineProperty,\n createAction,\n globalState,\n flow,\n computed,\n autoAction,\n isGenerator,\n MakeResult,\n die\n} from \"../internal\"\n\nconst AUTO = \"true\"\n\nexport const autoAnnotation: Annotation = createAutoAnnotation()\n\nexport function createAutoAnnotation(options?: object): Annotation {\n return {\n annotationType_: AUTO,\n options_: options,\n make_,\n extend_,\n decorate_20223_\n }\n}\n\nfunction make_(\n adm: ObservableObjectAdministration,\n key: PropertyKey,\n descriptor: PropertyDescriptor,\n source: object\n): MakeResult {\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source)\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n const set = createAction(key.toString(), descriptor.set) as (v: any) => void\n // own\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set\n }) === null\n ? MakeResult.Cancel\n : MakeResult.Continue\n }\n // proto\n defineProperty(source, key, {\n configurable: true,\n set\n })\n return MakeResult.Continue\n }\n // function on proto -> autoAction/flow\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n if (isGenerator(descriptor.value)) {\n const flowAnnotation = this.options_?.autoBind ? flow.bound : flow\n return flowAnnotation.make_(adm, key, descriptor, source)\n }\n const actionAnnotation = this.options_?.autoBind ? autoAction.bound : autoAction\n return actionAnnotation.make_(adm, key, descriptor, source)\n }\n // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n let observableAnnotation = this.options_?.deep === false ? observable.ref : observable\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && this.options_?.autoBind) {\n descriptor.value = descriptor.value.bind(adm.proxy_ ?? adm.target_)\n }\n return observableAnnotation.make_(adm, key, descriptor, source)\n}\n\nfunction extend_(\n adm: ObservableObjectAdministration,\n key: PropertyKey,\n descriptor: PropertyDescriptor,\n proxyTrap: boolean\n): boolean | null {\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap)\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(\n key,\n {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set) as (v: any) => void\n },\n proxyTrap\n )\n }\n // other -> observable\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && this.options_?.autoBind) {\n descriptor.value = descriptor.value.bind(adm.proxy_ ?? adm.target_)\n }\n let observableAnnotation = this.options_?.deep === false ? observable.ref : observable\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap)\n}\n\nfunction decorate_20223_(this: Annotation, desc, context: ClassGetterDecoratorContext) {\n die(`'${this.annotationType_}' cannot be used as a decorator`)\n}\n", "import {\n IEnhancer,\n IEqualsComparer,\n IObservableArray,\n IObservableMapInitialValues,\n IObservableSetInitialValues,\n IObservableValue,\n ObservableMap,\n ObservableSet,\n ObservableValue,\n asDynamicObservableObject,\n createObservableArray,\n deepEnhancer,\n extendObservable,\n isES6Map,\n isES6Set,\n isObservable,\n isPlainObject,\n referenceEnhancer,\n Annotation,\n shallowEnhancer,\n refStructEnhancer,\n AnnotationsMap,\n asObservableObject,\n storeAnnotation,\n createDecoratorAnnotation,\n createLegacyArray,\n globalState,\n assign,\n isStringish,\n createObservableAnnotation,\n createAutoAnnotation,\n is20223Decorator,\n initObservable\n} from \"../internal\"\n\nimport type { ClassAccessorDecorator, ClassFieldDecorator } from \"../types/decorator_fills\"\n\nexport const OBSERVABLE = \"observable\"\nexport const OBSERVABLE_REF = \"observable.ref\"\nexport const OBSERVABLE_SHALLOW = \"observable.shallow\"\nexport const OBSERVABLE_STRUCT = \"observable.struct\"\n\nexport type CreateObservableOptions = {\n name?: string\n equals?: IEqualsComparer<any>\n deep?: boolean\n defaultDecorator?: Annotation\n proxy?: boolean\n autoBind?: boolean\n}\n\n// Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\nexport const defaultCreateObservableOptions: CreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n}\nObject.freeze(defaultCreateObservableOptions)\n\nexport function asCreateObservableOptions(thing: any): CreateObservableOptions {\n return thing || defaultCreateObservableOptions\n}\n\nconst observableAnnotation = createObservableAnnotation(OBSERVABLE)\nconst observableRefAnnotation = createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n})\nconst observableShallowAnnotation = createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n})\nconst observableStructAnnotation = createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n})\nconst observableDecoratorAnnotation =\n createDecoratorAnnotation<ClassAccessorDecorator>(observableAnnotation)\n\nexport function getEnhancerFromOptions(options: CreateObservableOptions): IEnhancer<any> {\n return options.deep === true\n ? deepEnhancer\n : options.deep === false\n ? referenceEnhancer\n : getEnhancerFromAnnotation(options.defaultDecorator)\n}\n\nexport function getAnnotationFromOptions(\n options?: CreateObservableOptions\n): Annotation | undefined {\n return options ? options.defaultDecorator ?? createAutoAnnotation(options) : undefined\n}\n\nexport function getEnhancerFromAnnotation(annotation?: Annotation): IEnhancer<any> {\n return !annotation ? deepEnhancer : annotation.options_?.enhancer ?? deepEnhancer\n}\n\n/**\n * Turns an object, array or function into a reactive structure.\n * @param v the value which should become observable.\n */\nfunction createObservable(v: any, arg2?: any, arg3?: any) {\n // @observable someProp; (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return observableAnnotation.decorate_20223_(v, arg2)\n }\n\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation)\n return\n }\n\n // already observable - ignore\n if (isObservable(v)) {\n return v\n }\n\n // plain object\n if (isPlainObject(v)) {\n return observable.object(v, arg2, arg3)\n }\n\n // Array\n if (Array.isArray(v)) {\n return observable.array(v, arg2)\n }\n\n // Map\n if (isES6Map(v)) {\n return observable.map(v, arg2)\n }\n\n // Set\n if (isES6Set(v)) {\n return observable.set(v, arg2)\n }\n\n // other object - ignore\n if (typeof v === \"object\" && v !== null) {\n return v\n }\n\n // anything else\n return observable.box(v, arg2)\n}\nassign(createObservable, observableDecoratorAnnotation)\n\nexport interface IObservableValueFactory {\n <T>(value: T, options?: CreateObservableOptions): IObservableValue<T>\n <T>(value?: T, options?: CreateObservableOptions): IObservableValue<T | undefined>\n}\n\nexport interface IObservableFactory\n extends Annotation,\n PropertyDecorator,\n ClassAccessorDecorator,\n ClassFieldDecorator {\n // TODO: remove ClassFieldDecorator, this is only temporarily support for legacy decorators\n <T = any>(value: T[], options?: CreateObservableOptions): IObservableArray<T>\n <T = any>(value: Set<T>, options?: CreateObservableOptions): ObservableSet<T>\n <K = any, V = any>(value: Map<K, V>, options?: CreateObservableOptions): ObservableMap<K, V>\n <T extends object>(\n value: T,\n decorators?: AnnotationsMap<T, never>,\n options?: CreateObservableOptions\n ): T\n\n box: IObservableValueFactory\n array: <T = any>(initialValues?: T[], options?: CreateObservableOptions) => IObservableArray<T>\n set: <T = any>(\n initialValues?: IObservableSetInitialValues<T>,\n options?: CreateObservableOptions\n ) => ObservableSet<T>\n map: <K = any, V = any>(\n initialValues?: IObservableMapInitialValues<K, V>,\n options?: CreateObservableOptions\n ) => ObservableMap<K, V>\n object: <T = any>(\n props: T,\n decorators?: AnnotationsMap<T, never>,\n options?: CreateObservableOptions\n ) => T\n\n /**\n * Decorator that creates an observable that only observes the references, but doesn't try to turn the assigned value into an observable.ts.\n */\n ref: Annotation & PropertyDecorator & ClassAccessorDecorator & ClassFieldDecorator\n /**\n * Decorator that creates an observable converts its value (objects, maps or arrays) into a shallow observable structure\n */\n shallow: Annotation & PropertyDecorator & ClassAccessorDecorator & ClassFieldDecorator\n deep: Annotation & PropertyDecorator & ClassAccessorDecorator & ClassFieldDecorator\n struct: Annotation & PropertyDecorator & ClassAccessorDecorator & ClassFieldDecorator\n}\n\nconst observableFactories: IObservableFactory = {\n box<T = any>(value: T, options?: CreateObservableOptions): IObservableValue<T> {\n const o = asCreateObservableOptions(options)\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals)\n },\n array<T = any>(initialValues?: T[], options?: CreateObservableOptions): IObservableArray<T> {\n const o = asCreateObservableOptions(options)\n return (\n globalState.useProxies === false || o.proxy === false\n ? createLegacyArray\n : createObservableArray\n )(initialValues, getEnhancerFromOptions(o), o.name)\n },\n map<K = any, V = any>(\n initialValues?: IObservableMapInitialValues<K, V>,\n options?: CreateObservableOptions\n ): ObservableMap<K, V> {\n const o = asCreateObservableOptions(options)\n return new ObservableMap<K, V>(initialValues, getEnhancerFromOptions(o), o.name)\n },\n set<T = any>(\n initialValues?: IObservableSetInitialValues<T>,\n options?: CreateObservableOptions\n ): ObservableSet<T> {\n const o = asCreateObservableOptions(options)\n return new ObservableSet<T>(initialValues, getEnhancerFromOptions(o), o.name)\n },\n object<T extends object = any>(\n props: T,\n decorators?: AnnotationsMap<T, never>,\n options?: CreateObservableOptions\n ): T {\n return initObservable(() =>\n extendObservable(\n globalState.useProxies === false || options?.proxy === false\n ? asObservableObject({}, options)\n : asDynamicObservableObject({}, options),\n props,\n decorators\n )\n )\n },\n ref: createDecoratorAnnotation(observableRefAnnotation),\n shallow: createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: createDecoratorAnnotation(observableStructAnnotation)\n} as any\n\n// eslint-disable-next-line\nexport var observable: IObservableFactory = assign(createObservable, observableFactories)\n", "import {\n ComputedValue,\n IComputedValueOptions,\n Annotation,\n storeAnnotation,\n createDecoratorAnnotation,\n isStringish,\n isPlainObject,\n isFunction,\n die,\n IComputedValue,\n createComputedAnnotation,\n comparer,\n is20223Decorator\n} from \"../internal\"\n\nimport type { ClassGetterDecorator } from \"../types/decorator_fills\"\n\nexport const COMPUTED = \"computed\"\nexport const COMPUTED_STRUCT = \"computed.struct\"\n\nexport interface IComputedFactory extends Annotation, PropertyDecorator, ClassGetterDecorator {\n // @computed(opts)\n <T>(options: IComputedValueOptions<T>): Annotation & PropertyDecorator & ClassGetterDecorator\n // computed(fn, opts)\n <T>(func: () => T, options?: IComputedValueOptions<T>): IComputedValue<T>\n\n struct: Annotation & PropertyDecorator & ClassGetterDecorator\n}\n\nconst computedAnnotation = createComputedAnnotation(COMPUTED)\nconst computedStructAnnotation = createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n})\n\n/**\n * Decorator for class properties: @computed get value() { return expr; }.\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\n */\nexport const computed: IComputedFactory = function computed(arg1, arg2) {\n if (is20223Decorator(arg2)) {\n // @computed (2022.3 Decorators)\n return computedAnnotation.decorate_20223_(arg1, arg2)\n }\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation)\n }\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1))\n }\n\n // computed(expr, options?)\n if (__DEV__) {\n if (!isFunction(arg1)) {\n die(\"First argument to `computed` should be an expression.\")\n }\n if (isFunction(arg2)) {\n die(\n \"A setter as second argument is no longer supported, use `{ set: fn }` option instead\"\n )\n }\n }\n const opts: IComputedValueOptions<any> = isPlainObject(arg2) ? arg2 : {}\n opts.get = arg1\n opts.name ||= arg1.name || \"\" /* for generated name */\n\n return new ComputedValue(opts)\n} as any\n\nObject.assign(computed, computedAnnotation)\n\ncomputed.struct = createDecoratorAnnotation(computedStructAnnotation)\n", "import {\n IDerivation,\n endBatch,\n globalState,\n isSpyEnabled,\n spyReportEnd,\n spyReportStart,\n startBatch,\n untrackedEnd,\n untrackedStart,\n isFunction,\n allowStateReadsStart,\n allowStateReadsEnd,\n ACTION,\n EMPTY_ARRAY,\n die,\n getDescriptor,\n defineProperty\n} from \"../internal\"\n\n// we don't use globalState for these in order to avoid possible issues with multiple\n// mobx versions\nlet currentActionId = 0\nlet nextActionId = 1\nconst isFunctionNameConfigurable = getDescriptor(() => {}, \"name\")?.configurable ?? false\n\n// we can safely recycle this object\nconst tmpNameDescriptor: PropertyDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n}\n\nexport function createAction(\n actionName: string,\n fn: Function,\n autoAction: boolean = false,\n ref?: Object\n): Function {\n if (__DEV__) {\n if (!isFunction(fn)) {\n die(\"`action` can only be invoked on functions\")\n }\n if (typeof actionName !== \"string\" || !actionName) {\n die(`actions should have valid names, got: '${actionName}'`)\n }\n }\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments)\n }\n res.isMobxAction = true\n res.toString = () => fn.toString()\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName\n defineProperty(res, \"name\", tmpNameDescriptor)\n }\n return res\n}\n\nexport function executeAction(\n actionName: string,\n canRunAsDerivation: boolean,\n fn: Function,\n scope?: any,\n args?: IArguments\n) {\n const runInfo = _startAction(actionName, canRunAsDerivation, scope, args)\n try {\n return fn.apply(scope, args)\n } catch (err) {\n runInfo.error_ = err\n throw err\n } finally {\n _endAction(runInfo)\n }\n}\n\nexport interface IActionRunInfo {\n prevDerivation_: IDerivation | null\n prevAllowStateChanges_: boolean\n prevAllowStateReads_: boolean\n notifySpy_: boolean\n startTime_: number\n error_?: any\n parentActionId_: number\n actionId_: number\n runAsAction_?: boolean\n}\n\nexport function _startAction(\n actionName: string,\n canRunAsDerivation: boolean, // true for autoAction\n scope: any,\n args?: IArguments\n): IActionRunInfo {\n const notifySpy_ = __DEV__ && isSpyEnabled() && !!actionName\n let startTime_: number = 0\n if (__DEV__ && notifySpy_) {\n startTime_ = Date.now()\n const flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n })\n }\n const prevDerivation_ = globalState.trackingDerivation\n const runAsAction = !canRunAsDerivation || !prevDerivation_\n startBatch()\n let prevAllowStateChanges_ = globalState.allowStateChanges // by default preserve previous allow\n if (runAsAction) {\n untrackedStart()\n prevAllowStateChanges_ = allowStateChangesStart(true)\n }\n const prevAllowStateReads_ = allowStateReadsStart(true)\n const runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_,\n prevAllowStateChanges_,\n prevAllowStateReads_,\n notifySpy_,\n startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n }\n currentActionId = runInfo.actionId_\n return runInfo\n}\n\nexport function _endAction(runInfo: IActionRunInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30)\n }\n currentActionId = runInfo.parentActionId_\n\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true\n }\n allowStateChangesEnd(runInfo.prevAllowStateChanges_)\n allowStateReadsEnd(runInfo.prevAllowStateReads_)\n endBatch()\n if (runInfo.runAsAction_) {\n untrackedEnd(runInfo.prevDerivation_)\n }\n if (__DEV__ && runInfo.notifySpy_) {\n spyReportEnd({ time: Date.now() - runInfo.startTime_ })\n }\n globalState.suppressReactionErrors = false\n}\n\nexport function allowStateChanges<T>(allowStateChanges: boolean, func: () => T): T {\n const prev = allowStateChangesStart(allowStateChanges)\n try {\n return func()\n } finally {\n allowStateChangesEnd(prev)\n }\n}\n\nexport function allowStateChangesStart(allowStateChanges: boolean) {\n const prev = globalState.allowStateChanges\n globalState.allowStateChanges = allowStateChanges\n return prev\n}\n\nexport function allowStateChangesEnd(prev: boolean) {\n globalState.allowStateChanges = prev\n}\n", "import {\n Atom,\n IEnhancer,\n IInterceptable,\n IEqualsComparer,\n IInterceptor,\n IListenable,\n Lambda,\n checkIfStateModificationsAreAllowed,\n comparer,\n createInstanceofPredicate,\n getNextId,\n hasInterceptors,\n hasListeners,\n interceptChange,\n isSpyEnabled,\n notifyListeners,\n registerInterceptor,\n registerListener,\n spyReport,\n spyReportEnd,\n spyReportStart,\n toPrimitive,\n globalState,\n IUNCHANGED,\n UPDATE\n} from \"../internal\"\n\nexport interface IValueWillChange<T> {\n object: IObservableValue<T>\n type: \"update\"\n newValue: T\n}\n\nexport type IValueDidChange<T = any> = {\n type: \"update\"\n observableKind: \"value\"\n object: IObservableValue<T>\n debugObjectName: string\n newValue: T\n oldValue: T | undefined\n}\nexport type IBoxDidChange<T = any> =\n | {\n type: \"create\"\n observableKind: \"value\"\n object: IObservableValue<T>\n debugObjectName: string\n newValue: T\n }\n | IValueDidChange<T>\n\nexport interface IObservableValue<T> {\n get(): T\n set(value: T): void\n}\n\nconst CREATE = \"create\"\n\nexport class ObservableValue<T>\n extends Atom\n implements IObservableValue<T>, IInterceptable<IValueWillChange<T>>, IListenable\n{\n hasUnreportedChange_ = false\n interceptors_\n changeListeners_\n value_\n dehancer: any\n\n constructor(\n value: T,\n public enhancer: IEnhancer<T>,\n public name_ = __DEV__ ? \"ObservableValue@\" + getNextId() : \"ObservableValue\",\n notifySpy = true,\n private equals: IEqualsComparer<any> = comparer.default\n ) {\n super(name_)\n this.value_ = enhancer(value, undefined, name_)\n if (__DEV__ && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: \"\" + this.value_\n })\n }\n }\n\n private dehanceValue(value: T): T {\n if (this.dehancer !== undefined) {\n return this.dehancer(value)\n }\n return value\n }\n\n public set(newValue: T) {\n const oldValue = this.value_\n newValue = this.prepareNewValue_(newValue) as any\n if (newValue !== globalState.UNCHANGED) {\n const notifySpy = isSpyEnabled()\n if (__DEV__ && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue,\n oldValue\n })\n }\n this.setNewValue_(newValue)\n if (__DEV__ && notifySpy) {\n spyReportEnd()\n }\n }\n }\n\n private prepareNewValue_(newValue): T | IUNCHANGED {\n checkIfStateModificationsAreAllowed(this)\n if (hasInterceptors(this)) {\n const change = interceptChange<IValueWillChange<T>>(this, {\n object: this,\n type: UPDATE,\n newValue\n })\n if (!change) {\n return globalState.UNCHANGED\n }\n newValue = change.newValue\n }\n // apply modifier\n newValue = this.enhancer(newValue, this.value_, this.name_)\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue\n }\n\n setNewValue_(newValue: T) {\n const oldValue = this.value_\n this.value_ = newValue\n this.reportChanged()\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue,\n oldValue\n })\n }\n }\n\n public get(): T {\n this.reportObserved()\n return this.dehanceValue(this.value_)\n }\n\n intercept_(handler: IInterceptor<IValueWillChange<T>>): Lambda {\n return registerInterceptor(this, handler)\n }\n\n observe_(listener: (change: IValueDidChange<T>) => void, fireImmediately?: boolean): Lambda {\n if (fireImmediately) {\n listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n })\n }\n return registerListener(this, listener)\n }\n\n raw() {\n // used by MST ot get undehanced value\n return this.value_\n }\n\n toJSON() {\n return this.get()\n }\n\n toString() {\n return `${this.name_}[${this.value_}]`\n }\n\n valueOf(): T {\n return toPrimitive(this.get())\n }\n\n [Symbol.toPrimitive]() {\n return this.valueOf()\n }\n}\n\nexport const isObservableValue = createInstanceofPredicate(\"ObservableValue\", ObservableValue) as (\n x: any\n) => x is IObservableValue<any>\n", "import {\n CaughtException,\n IDerivation,\n IDerivationState_,\n IEqualsComparer,\n IObservable,\n Lambda,\n TraceMode,\n autorun,\n clearObserving,\n comparer,\n createAction,\n createInstanceofPredicate,\n endBatch,\n getNextId,\n globalState,\n isCaughtException,\n isSpyEnabled,\n propagateChangeConfirmed,\n propagateMaybeChanged,\n reportObserved,\n shouldCompute,\n spyReport,\n startBatch,\n toPrimitive,\n trackDerivedFunction,\n untrackedEnd,\n untrackedStart,\n UPDATE,\n die,\n allowStateChangesStart,\n allowStateChangesEnd\n} from \"../internal\"\n\nimport { getFlag, setFlag } from \"../utils/utils\"\n\nexport interface IComputedValue<T> {\n get(): T\n set(value: T): void\n}\n\nexport interface IComputedValueOptions<T> {\n get?: () => T\n set?: (value: T) => void\n name?: string\n equals?: IEqualsComparer<T>\n context?: any\n requiresReaction?: boolean\n keepAlive?: boolean\n}\n\nexport type IComputedDidChange<T = any> = {\n type: \"update\"\n observableKind: \"computed\"\n object: unknown\n debugObjectName: string\n newValue: T\n oldValue: T | undefined\n}\n\n/**\n * A node in the state dependency root that observes other nodes, and can be observed itself.\n *\n * ComputedValue will remember the result of the computation for the duration of the batch, or\n * while being observed.\n *\n * During this time it will recompute only when one of its direct dependencies changed,\n * but only when it is being accessed with `ComputedValue.get()`.\n *\n * Implementation description:\n * 1. First time it's being accessed it will compute and remember result\n * give back remembered result until 2. happens\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\n * 3. When it's being accessed, recompute if any shallow dependency changed.\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\n * go to step 2. either way\n *\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\n */\nexport class ComputedValue<T> implements IObservable, IComputedValue<T>, IDerivation {\n dependenciesState_ = IDerivationState_.NOT_TRACKING_\n observing_: IObservable[] = [] // nodes we are looking at. Our value depends on these nodes\n newObserving_ = null // during tracking it's an array with new observed observers\n observers_ = new Set<IDerivation>()\n runId_ = 0\n lastAccessedBy_ = 0\n lowestObserverState_ = IDerivationState_.UP_TO_DATE_\n unboundDepsCount_ = 0\n protected value_: T | undefined | CaughtException = new CaughtException(null)\n name_: string\n triggeredBy_?: string\n\n private static readonly isComputingMask_ = 0b00001\n private static readonly isRunningSetterMask_ = 0b00010\n private static readonly isBeingObservedMask_ = 0b00100\n private static readonly isPendingUnobservationMask_ = 0b01000\n private static readonly diffValueMask_ = 0b10000\n private flags_ = 0b00000\n\n derivation: () => T // N.B: unminified as it is used by MST\n setter_?: (value: T) => void\n isTracing_: TraceMode = TraceMode.NONE\n scope_: Object | undefined\n private equals_: IEqualsComparer<any>\n private requiresReaction_: boolean | undefined\n keepAlive_: boolean\n\n /**\n * Create a new computed value based on a function expression.\n *\n * The `name` property is for debug purposes only.\n *\n * The `equals` property specifies the comparer function to use to determine if a newly produced\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\n * Structural comparison can be convenient if you always produce a new aggregated object and\n * don't want to notify observers if it is structurally the same.\n * This is useful for working with vectors, mouse coordinates etc.\n */\n constructor(options: IComputedValueOptions<T>) {\n if (!options.get) {\n die(31)\n }\n this.derivation = options.get!\n this.name_ = options.name || (__DEV__ ? \"ComputedValue@\" + getNextId() : \"ComputedValue\")\n if (options.set) {\n this.setter_ = createAction(\n __DEV__ ? this.name_ + \"-setter\" : \"ComputedValue-setter\",\n options.set\n ) as any\n }\n this.equals_ =\n options.equals ||\n ((options as any).compareStructural || (options as any).struct\n ? comparer.structural\n : comparer.default)\n this.scope_ = options.context\n this.requiresReaction_ = options.requiresReaction\n this.keepAlive_ = !!options.keepAlive\n }\n\n onBecomeStale_() {\n propagateMaybeChanged(this)\n }\n\n public onBOL: Set<Lambda> | undefined\n public onBUOL: Set<Lambda> | undefined\n\n public onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(listener => listener())\n }\n }\n\n public onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(listener => listener())\n }\n }\n\n // to check for cycles\n private get isComputing(): boolean {\n return getFlag(this.flags_, ComputedValue.isComputingMask_)\n }\n private set isComputing(newValue: boolean) {\n this.flags_ = setFlag(this.flags_, ComputedValue.isComputingMask_, newValue)\n }\n\n private get isRunningSetter(): boolean {\n return getFlag(this.flags_, ComputedValue.isRunningSetterMask_)\n }\n private set isRunningSetter(newValue: boolean) {\n this.flags_ = setFlag(this.flags_, ComputedValue.isRunningSetterMask_, newValue)\n }\n\n get isBeingObserved(): boolean {\n return getFlag(this.flags_, ComputedValue.isBeingObservedMask_)\n }\n set isBeingObserved(newValue: boolean) {\n this.flags_ = setFlag(this.flags_, ComputedValue.isBeingObservedMask_, newValue)\n }\n\n get isPendingUnobservation(): boolean {\n return getFlag(this.flags_, ComputedValue.isPendingUnobservationMask_)\n }\n set isPendingUnobservation(newValue: boolean) {\n this.flags_ = setFlag(this.flags_, ComputedValue.isPendingUnobservationMask_, newValue)\n }\n\n get diffValue(): 0 | 1 {\n return getFlag(this.flags_, ComputedValue.diffValueMask_) ? 1 : 0\n }\n set diffValue(newValue: 0 | 1) {\n this.flags_ = setFlag(\n this.flags_,\n ComputedValue.diffValueMask_,\n newValue === 1 ? true : false\n )\n }\n\n /**\n * Returns the current value of this computed value.\n * Will evaluate its computation first if needed.\n */\n public get(): T {\n if (this.isComputing) {\n die(32, this.name_, this.derivation)\n }\n if (\n globalState.inBatch === 0 &&\n // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 &&\n !this.keepAlive_\n ) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_()\n startBatch() // See perf test 'computed memoization'\n this.value_ = this.computeValue_(false)\n endBatch()\n }\n } else {\n reportObserved(this)\n if (shouldCompute(this)) {\n let prevTrackingContext = globalState.trackingContext\n if (this.keepAlive_ && !prevTrackingContext) {\n globalState.trackingContext = this\n }\n if (this.trackAndCompute()) {\n propagateChangeConfirmed(this)\n }\n globalState.trackingContext = prevTrackingContext\n }\n }\n const result = this.value_!\n\n if (isCaughtException(result)) {\n throw result.cause\n }\n return result\n }\n\n public set(value: T) {\n if (this.setter_) {\n if (this.isRunningSetter) {\n die(33, this.name_)\n }\n this.isRunningSetter = true\n try {\n this.setter_.call(this.scope_, value)\n } finally {\n this.isRunningSetter = false\n }\n } else {\n die(34, this.name_)\n }\n }\n\n trackAndCompute(): boolean {\n // N.B: unminified as it is used by MST\n const oldValue = this.value_\n const wasSuspended =\n /* see #1208 */ this.dependenciesState_ === IDerivationState_.NOT_TRACKING_\n const newValue = this.computeValue_(true)\n\n const changed =\n wasSuspended ||\n isCaughtException(oldValue) ||\n isCaughtException(newValue) ||\n !this.equals_(oldValue, newValue)\n\n if (changed) {\n this.value_ = newValue\n\n if (__DEV__ && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue,\n newValue\n } as IComputedDidChange)\n }\n }\n\n return changed\n }\n\n computeValue_(track: boolean) {\n this.isComputing = true\n // don't allow state changes during computation\n const prev = allowStateChangesStart(false)\n let res: T | CaughtException\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_)\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_)\n } else {\n try {\n res = this.derivation.call(this.scope_)\n } catch (e) {\n res = new CaughtException(e)\n }\n }\n }\n allowStateChangesEnd(prev)\n this.isComputing = false\n return res\n }\n\n suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this)\n this.value_ = undefined // don't hold on to computed value!\n if (__DEV__ && this.isTracing_ !== TraceMode.NONE) {\n console.log(\n `[mobx.trace] Computed value '${this.name_}' was suspended and it will recompute on the next access.`\n )\n }\n }\n }\n\n observe_(listener: (change: IComputedDidChange<T>) => void, fireImmediately?: boolean): Lambda {\n let firstTime = true\n let prevValue: T | undefined = undefined\n return autorun(() => {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n let newValue = this.get()\n if (!firstTime || fireImmediately) {\n const prevU = untrackedStart()\n listener({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n newValue,\n oldValue: prevValue\n })\n untrackedEnd(prevU)\n }\n firstTime = false\n prevValue = newValue\n })\n }\n\n warnAboutUntrackedRead_() {\n if (!__DEV__) {\n return\n }\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\n `[mobx.trace] Computed value '${this.name_}' is being read outside a reactive context. Doing a full recompute.`\n )\n }\n if (\n typeof this.requiresReaction_ === \"boolean\"\n ? this.requiresReaction_\n : globalState.computedRequiresReaction\n ) {\n console.warn(\n `[mobx] Computed value '${this.name_}' is being read outside a reactive context. Doing a full recompute.`\n )\n }\n }\n\n toString() {\n return `${this.name_}[${this.derivation.toString()}]`\n }\n\n valueOf(): T {\n return toPrimitive(this.get())\n }\n\n [Symbol.toPrimitive]() {\n return this.valueOf()\n }\n}\n\nexport const isComputedValue = createInstanceofPredicate(\"ComputedValue\", ComputedValue)\n", "import {\n IAtom,\n IDepTreeNode,\n IObservable,\n addObserver,\n globalState,\n isComputedValue,\n removeObserver\n} from \"../internal\"\n\nexport enum IDerivationState_ {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n NOT_TRACKING_ = -1,\n // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n UP_TO_DATE_ = 0,\n // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n POSSIBLY_STALE_ = 1,\n // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n STALE_ = 2\n}\n\nexport enum TraceMode {\n NONE,\n LOG,\n BREAK\n}\n\n/**\n * A derivation is everything that can be derived from the state (all the atoms) in a pure manner.\n * See https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\n */\nexport interface IDerivation extends IDepTreeNode {\n observing_: IObservable[]\n newObserving_: null | IObservable[]\n dependenciesState_: IDerivationState_\n /**\n * Id of the current run of a derivation. Each time the derivation is tracked\n * this number is increased by one. This number is globally unique\n */\n runId_: number\n /**\n * amount of dependencies used by the derivation in this run, which has not been bound yet.\n */\n unboundDepsCount_: number\n onBecomeStale_(): void\n isTracing_: TraceMode\n\n /**\n * warn if the derivation has no dependencies after creation/update\n */\n requiresObservable_?: boolean\n}\n\nexport class CaughtException {\n constructor(public cause: any) {\n // Empty\n }\n}\n\nexport function isCaughtException(e: any): e is CaughtException {\n return e instanceof CaughtException\n}\n\n/**\n * Finds out whether any dependency of the derivation has actually changed.\n * If dependenciesState is 1 then it will recalculate dependencies,\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\n *\n * By iterating over the dependencies in the same order that they were reported and\n * stopping on the first change, all the recalculations are only called for ComputedValues\n * that will be tracked by derivation. That is because we assume that if the first x\n * dependencies of the derivation doesn't change then the derivation should run the same way\n * up until accessing x-th dependency.\n */\nexport function shouldCompute(derivation: IDerivation): boolean {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true\n case IDerivationState_.POSSIBLY_STALE_: {\n // state propagation can occur outside of action/reactive context #2195\n const prevAllowStateReads = allowStateReadsStart(true)\n const prevUntracked = untrackedStart() // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n const obs = derivation.observing_,\n l = obs.length\n for (let i = 0; i < l; i++) {\n const obj = obs[i]\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get()\n } else {\n try {\n obj.get()\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked)\n allowStateReadsEnd(prevAllowStateReads)\n return true\n }\n }\n // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n if ((derivation.dependenciesState_ as any) === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked)\n allowStateReadsEnd(prevAllowStateReads)\n return true\n }\n }\n }\n changeDependenciesStateTo0(derivation)\n untrackedEnd(prevUntracked)\n allowStateReadsEnd(prevAllowStateReads)\n return false\n }\n }\n}\n\nexport function isComputingDerivation() {\n return globalState.trackingDerivation !== null // filter out actions inside computations\n}\n\nexport function checkIfStateModificationsAreAllowed(atom: IAtom) {\n if (!__DEV__) {\n return\n }\n const hasObservers = atom.observers_.size > 0\n // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n if (\n !globalState.allowStateChanges &&\n (hasObservers || globalState.enforceActions === \"always\")\n ) {\n console.warn(\n \"[MobX] \" +\n (globalState.enforceActions\n ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \"\n : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") +\n atom.name_\n )\n }\n}\n\nexport function checkIfStateReadsAreAllowed(observable: IObservable) {\n if (__DEV__ && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\n `[mobx] Observable '${observable.name_}' being read outside a reactive context.`\n )\n }\n}\n\n/**\n * Executes the provided function `f` and tracks which observables are being accessed.\n * The tracking information is stored on the `derivation` object and the derivation is registered\n * as observer of any of the accessed observables.\n */\nexport function trackDerivedFunction<T>(derivation: IDerivation, f: () => T, context: any) {\n const prevAllowStateReads = allowStateReadsStart(true)\n changeDependenciesStateTo0(derivation)\n // Preallocate array; will be trimmed by bindDependencies.\n derivation.newObserving_ = new Array(\n // Reserve constant space for initial dependencies, dynamic space otherwise.\n // See https://github.com/mobxjs/mobx/pull/3833\n derivation.runId_ === 0 ? 100 : derivation.observing_.length\n )\n derivation.unboundDepsCount_ = 0\n derivation.runId_ = ++globalState.runId\n const prevTracking = globalState.trackingDerivation\n globalState.trackingDerivation = derivation\n globalState.inBatch++\n let result\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context)\n } else {\n try {\n result = f.call(context)\n } catch (e) {\n result = new CaughtException(e)\n }\n }\n globalState.inBatch--\n globalState.trackingDerivation = prevTracking\n bindDependencies(derivation)\n\n warnAboutDerivationWithoutDependencies(derivation)\n allowStateReadsEnd(prevAllowStateReads)\n return result\n}\n\nfunction warnAboutDerivationWithoutDependencies(derivation: IDerivation) {\n if (!__DEV__) {\n return\n }\n\n if (derivation.observing_.length !== 0) {\n return\n }\n\n if (\n typeof derivation.requiresObservable_ === \"boolean\"\n ? derivation.requiresObservable_\n : globalState.reactionRequiresObservable\n ) {\n console.warn(\n `[mobx] Derivation '${derivation.name_}' is created/updated without reading any observable value.`\n )\n }\n}\n\n/**\n * diffs newObserving with observing.\n * update observing to be newObserving with unique observables\n * notify observers that become observed/unobserved\n */\nfunction bindDependencies(derivation: IDerivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n const prevObserving = derivation.observing_\n const observing = (derivation.observing_ = derivation.newObserving_!)\n let lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_\n\n // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n let i0 = 0,\n l = derivation.unboundDepsCount_\n for (let i = 0; i < l; i++) {\n const dep = observing[i]\n if (dep.diffValue === 0) {\n dep.diffValue = 1\n if (i0 !== i) {\n observing[i0] = dep\n }\n i0++\n }\n\n // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n if ((dep as any as IDerivation).dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = (dep as any as IDerivation).dependenciesState_\n }\n }\n observing.length = i0\n\n derivation.newObserving_ = null // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n l = prevObserving.length\n while (l--) {\n const dep = prevObserving[l]\n if (dep.diffValue === 0) {\n removeObserver(dep, derivation)\n }\n dep.diffValue = 0\n }\n\n // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n while (i0--) {\n const dep = observing[i0]\n if (dep.diffValue === 1) {\n dep.diffValue = 0\n addObserver(dep, derivation)\n }\n }\n\n // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState\n derivation.onBecomeStale_()\n }\n}\n\nexport function clearObserving(derivation: IDerivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n const obs = derivation.observing_\n derivation.observing_ = []\n let i = obs.length\n while (i--) {\n removeObserver(obs[i], derivation)\n }\n\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_\n}\n\nexport function untracked<T>(action: () => T): T {\n const prev = untrackedStart()\n try {\n return action()\n } finally {\n untrackedEnd(prev)\n }\n}\n\nexport function untrackedStart(): IDerivation | null {\n const prev = globalState.trackingDerivation\n globalState.trackingDerivation = null\n return prev\n}\n\nexport function untrackedEnd(prev: IDerivation | null) {\n globalState.trackingDerivation = prev\n}\n\nexport function allowStateReadsStart(allowStateReads: boolean) {\n const prev = globalState.allowStateReads\n globalState.allowStateReads = allowStateReads\n return prev\n}\n\nexport function allowStateReadsEnd(prev: boolean) {\n globalState.allowStateReads = prev\n}\n\n/**\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\n *\n */\nexport function changeDependenciesStateTo0(derivation: IDerivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n return\n }\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_\n\n const obs = derivation.observing_\n let i = obs.length\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_\n }\n}\n", "import { IDerivation, IObservable, Reaction, die, getGlobal } from \"../internal\"\nimport { ComputedValue } from \"./computedvalue\"\n\n/**\n * These values will persist if global state is reset\n */\nconst persistentKeys: (keyof MobXGlobals)[] = [\n \"mobxGuid\",\n \"spyListeners\",\n \"enforceActions\",\n \"computedRequiresReaction\",\n \"reactionRequiresObservable\",\n \"observableRequiresReaction\",\n \"allowStateReads\",\n \"disableErrorBoundaries\",\n \"runId\",\n \"UNCHANGED\",\n \"useProxies\"\n]\n\nexport type IUNCHANGED = {}\n\nexport class MobXGlobals {\n /**\n * MobXGlobals version.\n * MobX compatiblity with other versions loaded in memory as long as this version matches.\n * It indicates that the global state still stores similar information\n *\n * N.B: this version is unrelated to the package version of MobX, and is only the version of the\n * internal state storage of MobX, and can be the same across many different package versions\n */\n version = 6\n\n /**\n * globally unique token to signal unchanged\n */\n UNCHANGED: IUNCHANGED = {}\n\n /**\n * Currently running derivation\n */\n trackingDerivation: IDerivation | null = null\n\n /**\n * Currently running reaction. This determines if we currently have a reactive context.\n * (Tracking derivation is also set for temporal tracking of computed values inside actions,\n * but trackingReaction can only be set by a form of Reaction)\n */\n trackingContext: Reaction | ComputedValue<any> | null = null\n\n /**\n * Each time a derivation is tracked, it is assigned a unique run-id\n */\n runId = 0\n\n /**\n * 'guid' for general purpose. Will be persisted amongst resets.\n */\n mobxGuid = 0\n\n /**\n * Are we in a batch block? (and how many of them)\n */\n inBatch: number = 0\n\n /**\n * Observables that don't have observers anymore, and are about to be\n * suspended, unless somebody else accesses it in the same batch\n *\n * @type {IObservable[]}\n */\n pendingUnobservations: IObservable[] = []\n\n /**\n * List of scheduled, not yet executed, reactions.\n */\n pendingReactions: Reaction[] = []\n\n /**\n * Are we currently processing reactions?\n */\n isRunningReactions = false\n\n /**\n * Is it allowed to change observables at this point?\n * In general, MobX doesn't allow that when running computations and React.render.\n * To ensure that those functions stay pure.\n */\n allowStateChanges = false\n\n /**\n * Is it allowed to read observables at this point?\n * Used to hold the state needed for `observableRequiresReaction`\n */\n allowStateReads = true\n\n /**\n * If strict mode is enabled, state changes are by default not allowed\n */\n enforceActions: boolean | \"always\" = true\n\n /**\n * Spy callbacks\n */\n spyListeners: { (change: any): void }[] = []\n\n /**\n * Globally attached error handlers that react specifically to errors in reactions\n */\n globalReactionErrorHandlers: ((error: any, derivation: IDerivation) => void)[] = []\n\n /**\n * Warn if computed values are accessed outside a reactive context\n */\n computedRequiresReaction = false\n\n /**\n * (Experimental)\n * Warn if you try to create to derivation / reactive context without accessing any observable.\n */\n reactionRequiresObservable = false\n\n /**\n * (Experimental)\n * Warn if observables are accessed outside a reactive context\n */\n observableRequiresReaction = false\n\n /*\n * Don't catch and rethrow exceptions. This is useful for inspecting the state of\n * the stack when an exception occurs while debugging.\n */\n disableErrorBoundaries = false\n\n /*\n * If true, we are already handling an exception in an action. Any errors in reactions should be suppressed, as\n * they are not the cause, see: https://github.com/mobxjs/mobx/issues/1836\n */\n suppressReactionErrors = false\n\n useProxies = true\n /*\n * print warnings about code that would fail if proxies weren't available\n */\n verifyProxies = false\n\n /**\n * False forces all object's descriptors to\n * writable: true\n * configurable: true\n */\n safeDescriptors = true\n}\n\nlet canMergeGlobalState = true\nlet isolateCalled = false\n\nexport let globalState: MobXGlobals = (function () {\n let global = getGlobal()\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n canMergeGlobalState = false\n }\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n canMergeGlobalState = false\n }\n\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(() => {\n if (!isolateCalled) {\n die(35)\n }\n }, 1)\n return new MobXGlobals()\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1\n if (!global.__mobxGlobals.UNCHANGED) {\n global.__mobxGlobals.UNCHANGED = {}\n } // make merge backward compatible\n return global.__mobxGlobals\n } else {\n global.__mobxInstanceCount = 1\n return (global.__mobxGlobals = new MobXGlobals())\n }\n})()\n\nexport function isolateGlobalState() {\n if (\n globalState.pendingReactions.length ||\n globalState.inBatch ||\n globalState.isRunningReactions\n ) {\n die(36)\n }\n isolateCalled = true\n if (canMergeGlobalState) {\n let global = getGlobal()\n if (--global.__mobxInstanceCount === 0) {\n global.__mobxGlobals = undefined\n }\n globalState = new MobXGlobals()\n }\n}\n\nexport function getGlobalState(): any {\n return globalState\n}\n\n/**\n * For testing purposes only; this will break the internal state of existing observables,\n * but can be used to get back at a stable state after throwing errors\n */\nexport function resetGlobalState() {\n const defaultGlobals = new MobXGlobals()\n for (let key in defaultGlobals) {\n if (persistentKeys.indexOf(key as any) === -1) {\n globalState[key] = defaultGlobals[key]\n }\n }\n globalState.allowStateChanges = !globalState.enforceActions\n}\n", "import {\n Lambda,\n ComputedValue,\n IDependencyTree,\n IDerivation,\n IDerivationState_,\n TraceMode,\n getDependencyTree,\n globalState,\n runReactions,\n checkIfStateReadsAreAllowed\n} from \"../internal\"\n\nexport interface IDepTreeNode {\n name_: string\n observing_?: IObservable[]\n}\n\nexport interface IObservable extends IDepTreeNode {\n diffValue: number\n /**\n * Id of the derivation *run* that last accessed this observable.\n * If this id equals the *run* id of the current derivation,\n * the dependency is already established\n */\n lastAccessedBy_: number\n isBeingObserved: boolean\n\n lowestObserverState_: IDerivationState_ // Used to avoid redundant propagations\n isPendingUnobservation: boolean // Used to push itself to global.pendingUnobservations at most once per batch.\n\n observers_: Set<IDerivation>\n\n onBUO(): void\n onBO(): void\n\n onBUOL: Set<Lambda> | undefined\n onBOL: Set<Lambda> | undefined\n}\n\nexport function hasObservers(observable: IObservable): boolean {\n return observable.observers_ && observable.observers_.size > 0\n}\n\nexport function getObservers(observable: IObservable): Set<IDerivation> {\n return observable.observers_\n}\n\n// function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\nexport function addObserver(observable: IObservable, node: IDerivation) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n\n observable.observers_.add(node)\n if (observable.lowestObserverState_ > node.dependenciesState_) {\n observable.lowestObserverState_ = node.dependenciesState_\n }\n\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n}\n\nexport function removeObserver(observable: IObservable, node: IDerivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_.delete(node)\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable)\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n}\n\nexport function queueForUnobservation(observable: IObservable) {\n if (observable.isPendingUnobservation === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation = true\n globalState.pendingUnobservations.push(observable)\n }\n}\n\n/**\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\n * Avoids unnecessary recalculations.\n */\nexport function startBatch() {\n globalState.inBatch++\n}\n\nexport function endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions()\n // the batch is actually about to finish, all unobserving should happen here.\n const list = globalState.pendingUnobservations\n for (let i = 0; i < list.length; i++) {\n const observable = list[i]\n observable.isPendingUnobservation = false\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved = false\n observable.onBUO()\n }\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_()\n }\n }\n }\n globalState.pendingUnobservations = []\n }\n}\n\nexport function reportObserved(observable: IObservable): boolean {\n checkIfStateReadsAreAllowed(observable)\n\n const derivation = globalState.trackingDerivation\n if (derivation !== null) {\n /**\n * Simple optimization, give each derivation run an unique id (runId)\n * Check if last time this observable was accessed the same runId is used\n * if this is the case, the relation is already known\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_\n // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n derivation.newObserving_![derivation.unboundDepsCount_++] = observable\n if (!observable.isBeingObserved && globalState.trackingContext) {\n observable.isBeingObserved = true\n observable.onBO()\n }\n }\n return observable.isBeingObserved\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable)\n }\n\n return false\n}\n\n// function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n\n/**\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\n * It will propagate changes to observers from previous run\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\n * Hopefully self reruning autoruns aren't a feature people should depend on\n * Also most basic use cases should be ok\n */\n\n// Called by Atom when its value changes\nexport function propagateChanged(observable: IObservable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_\n\n // Ideally we use for..of here, but the downcompiled version is really slow...\n observable.observers_.forEach(d => {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if (__DEV__ && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable)\n }\n d.onBecomeStale_()\n }\n d.dependenciesState_ = IDerivationState_.STALE_\n })\n // invariantLOS(observable, \"changed end\");\n}\n\n// Called by ComputedValue when it recalculate and its value changed\nexport function propagateChangeConfirmed(observable: IObservable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_\n\n observable.observers_.forEach(d => {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_\n if (__DEV__ && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable)\n }\n } else if (\n d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_\n }\n })\n // invariantLOS(observable, \"confirmed end\");\n}\n\n// Used by computed when its dependency changed, but we don't wan't to immediately recompute.\nexport function propagateMaybeChanged(observable: IObservable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n return\n }\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_\n\n observable.observers_.forEach(d => {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_\n d.onBecomeStale_()\n }\n })\n // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation: IDerivation, observable: IObservable) {\n console.log(\n `[mobx.trace] '${derivation.name_}' is invalidated due to a change in: '${observable.name_}'`\n )\n if (derivation.isTracing_ === TraceMode.BREAK) {\n const lines = []\n printDepTree(getDependencyTree(derivation), lines, 1)\n\n // prettier-ignore\n new Function(\n`debugger;\n/*\nTracing '${derivation.name_}'\n\nYou are entering this break point because derivation '${derivation.name_}' is being traced and '${observable.name_}' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n${derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\"}\n\nThe dependencies for this derivation are:\n\n${lines.join(\"\\n\")}\n*/\n `)()\n }\n}\n\nfunction printDepTree(tree: IDependencyTree, lines: string[], depth: number) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\")\n return\n }\n lines.push(`${\"\\t\".repeat(depth - 1)}${tree.name}`)\n if (tree.dependencies) {\n tree.dependencies.forEach(child => printDepTree(child, lines, depth + 1))\n }\n}\n", "import {\n $mobx,\n IDerivation,\n IDerivationState_,\n IObservable,\n Lambda,\n TraceMode,\n clearObserving,\n createInstanceofPredicate,\n endBatch,\n getNextId,\n globalState,\n isCaughtException,\n isSpyEnabled,\n shouldCompute,\n spyReport,\n spyReportEnd,\n spyReportStart,\n startBatch,\n trace,\n trackDerivedFunction,\n GenericAbortSignal\n} from \"../internal\"\n\nimport { getFlag, setFlag } from \"../utils/utils\"\n\n/**\n * Reactions are a special kind of derivations. Several things distinguishes them from normal reactive computations\n *\n * 1) They will always run, whether they are used by other computations or not.\n * This means that they are very suitable for triggering side effects like logging, updating the DOM and making network requests.\n * 2) They are not observable themselves\n * 3) They will always run after any 'normal' derivations\n * 4) They are allowed to change the state and thereby triggering themselves again, as long as they make sure the state propagates to a stable state in a reasonable amount of iterations.\n *\n * The state machine of a Reaction is as follows:\n *\n * 1) after creating, the reaction should be started by calling `runReaction` or by scheduling it (see also `autorun`)\n * 2) the `onInvalidate` handler should somehow result in a call to `this.track(someFunction)`\n * 3) all observables accessed in `someFunction` will be observed by this reaction.\n * 4) as soon as some of the dependencies has changed the Reaction will be rescheduled for another run (after the current mutation or transaction). `isScheduled` will yield true once a dependency is stale and during this period\n * 5) `onInvalidate` will be called, and we are back at step 1.\n *\n */\n\nexport interface IReactionPublic {\n dispose(): void\n trace(enterBreakPoint?: boolean): void\n}\n\nexport interface IReactionDisposer {\n (): void\n [$mobx]: Reaction\n}\n\nexport class Reaction implements IDerivation, IReactionPublic {\n observing_: IObservable[] = [] // nodes we are looking at. Our value depends on these nodes\n newObserving_: IObservable[] = []\n dependenciesState_ = IDerivationState_.NOT_TRACKING_\n runId_ = 0\n unboundDepsCount_ = 0\n\n private static readonly isDisposedMask_ = 0b00001\n private static readonly isScheduledMask_ = 0b00010\n private static readonly isTrackPendingMask_ = 0b00100\n private static readonly isRunningMask_ = 0b01000\n private static readonly diffValueMask_ = 0b10000\n private flags_ = 0b00000\n\n isTracing_: TraceMode = TraceMode.NONE\n\n constructor(\n public name_: string = __DEV__ ? \"Reaction@\" + getNextId() : \"Reaction\",\n private onInvalidate_: () => void,\n private errorHandler_?: (error: any, derivation: IDerivation) => void,\n public requiresObservable_?\n ) {}\n\n get isDisposed() {\n return getFlag(this.flags_, Reaction.isDisposedMask_)\n }\n set isDisposed(newValue: boolean) {\n this.flags_ = setFlag(this.flags_, Reaction.isDisposedMask_, newValue)\n }\n\n get isScheduled() {\n return getFlag(this.flags_, Reaction.isScheduledMask_)\n }\n set isScheduled(newValue: boolean) {\n this.flags_ = setFlag(this.flags_, Reaction.isScheduledMask_, newValue)\n }\n\n get isTrackPending() {\n return getFlag(this.flags_, Reaction.isTrackPendingMask_)\n }\n set isTrackPending(newValue: boolean) {\n this.flags_ = setFlag(this.flags_, Reaction.isTrackPendingMask_, newValue)\n }\n\n get isRunning() {\n return getFlag(this.flags_, Reaction.isRunningMask_)\n }\n set isRunning(newValue: boolean) {\n this.flags_ = setFlag(this.flags_, Reaction.isRunningMask_, newValue)\n }\n\n get diffValue(): 0 | 1 {\n return getFlag(this.flags_, Reaction.diffValueMask_) ? 1 : 0\n }\n set diffValue(newValue: 0 | 1) {\n this.flags_ = setFlag(this.flags_, Reaction.diffValueMask_, newValue === 1 ? true : false)\n }\n\n onBecomeStale_() {\n this.schedule_()\n }\n\n schedule_() {\n if (!this.isScheduled) {\n this.isScheduled = true\n globalState.pendingReactions.push(this)\n runReactions()\n }\n }\n\n /**\n * internal, use schedule() if you intend to kick off a reaction\n */\n runReaction_() {\n if (!this.isDisposed) {\n startBatch()\n this.isScheduled = false\n const prev = globalState.trackingContext\n globalState.trackingContext = this\n if (shouldCompute(this)) {\n this.isTrackPending = true\n\n try {\n this.onInvalidate_()\n if (__DEV__ && this.isTrackPending && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n })\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e)\n }\n }\n globalState.trackingContext = prev\n endBatch()\n }\n }\n\n track(fn: () => void) {\n if (this.isDisposed) {\n return\n // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n startBatch()\n const notify = isSpyEnabled()\n let startTime\n if (__DEV__ && notify) {\n startTime = Date.now()\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n })\n }\n this.isRunning = true\n const prevReaction = globalState.trackingContext // reactions could create reactions...\n globalState.trackingContext = this\n const result = trackDerivedFunction(this, fn, undefined)\n globalState.trackingContext = prevReaction\n this.isRunning = false\n this.isTrackPending = false\n if (this.isDisposed) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this)\n }\n if (isCaughtException(result)) {\n this.reportExceptionInDerivation_(result.cause)\n }\n if (__DEV__ && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n })\n }\n endBatch()\n }\n\n reportExceptionInDerivation_(error: any) {\n if (this.errorHandler_) {\n this.errorHandler_(error, this)\n return\n }\n\n if (globalState.disableErrorBoundaries) {\n throw error\n }\n\n const message = __DEV__\n ? `[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '${this}'`\n : `[mobx] uncaught error in '${this}'`\n if (!globalState.suppressReactionErrors) {\n console.error(message, error)\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (__DEV__) { console.warn(`[mobx] (error in reaction '${this.name_}' suppressed, fix error of causing action below)`) } // prettier-ignore\n\n if (__DEV__ && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message,\n error: \"\" + error\n })\n }\n\n globalState.globalReactionErrorHandlers.forEach(f => f(error, this))\n }\n\n dispose() {\n if (!this.isDisposed) {\n this.isDisposed = true\n if (!this.isRunning) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch()\n clearObserving(this)\n endBatch()\n }\n }\n }\n\n getDisposer_(abortSignal?: GenericAbortSignal): IReactionDisposer {\n const dispose = (() => {\n this.dispose()\n abortSignal?.removeEventListener?.(\"abort\", dispose)\n }) as IReactionDisposer\n abortSignal?.addEventListener?.(\"abort\", dispose)\n dispose[$mobx] = this\n\n return dispose\n }\n\n toString() {\n return `Reaction[${this.name_}]`\n }\n\n trace(enterBreakPoint: boolean = false) {\n trace(this, enterBreakPoint)\n }\n}\n\nexport function onReactionError(handler: (error: any, derivation: IDerivation) => void): Lambda {\n globalState.globalReactionErrorHandlers.push(handler)\n return () => {\n const idx = globalState.globalReactionErrorHandlers.indexOf(handler)\n if (idx >= 0) {\n globalState.globalReactionErrorHandlers.splice(idx, 1)\n }\n }\n}\n\n/**\n * Magic number alert!\n * Defines within how many times a reaction is allowed to re-trigger itself\n * until it is assumed that this is gonna be a never ending loop...\n */\nconst MAX_REACTION_ITERATIONS = 100\n\nlet reactionScheduler: (fn: () => void) => void = f => f()\n\nexport function runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n return\n }\n reactionScheduler(runReactionsHelper)\n}\n\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true\n const allReactions = globalState.pendingReactions\n let iterations = 0\n\n // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error(\n __DEV__\n ? `Reaction doesn't converge to a stable state after ${MAX_REACTION_ITERATIONS} iterations.` +\n ` Probably there is a cycle in the reactive function: ${allReactions[0]}`\n : `[mobx] cycle in reaction: ${allReactions[0]}`\n )\n allReactions.splice(0) // clear reactions\n }\n let remainingReactions = allReactions.splice(0)\n for (let i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_()\n }\n }\n globalState.isRunningReactions = false\n}\n\nexport const isReaction = createInstanceofPredicate(\"Reaction\", Reaction)\n\nexport function setReactionScheduler(fn: (f: () => void) => void) {\n const baseScheduler = reactionScheduler\n reactionScheduler = f => fn(() => baseScheduler(f))\n}\n", "import { IComputedDidChange } from \"./computedvalue\"\nimport { IValueDidChange, IBoxDidChange } from \"./../types/observablevalue\"\nimport { IObjectDidChange } from \"./../types/observableobject\"\nimport { IArrayDidChange } from \"./../types/observablearray\"\nimport { Lambda, globalState, once, ISetDidChange, IMapDidChange } from \"../internal\"\n\nexport function isSpyEnabled() {\n return __DEV__ && !!globalState.spyListeners.length\n}\n\nexport type PureSpyEvent =\n | { type: \"action\"; name: string; object: unknown; arguments: unknown[] }\n | { type: \"scheduled-reaction\"; name: string }\n | { type: \"reaction\"; name: string }\n | { type: \"error\"; name: string; message: string; error: string }\n | IComputedDidChange<unknown>\n | IObjectDidChange<unknown>\n | IArrayDidChange<unknown>\n | IMapDidChange<unknown, unknown>\n | ISetDidChange<unknown>\n | IValueDidChange<unknown>\n | IBoxDidChange<unknown>\n | { type: \"report-end\"; spyReportEnd: true; time?: number }\n\ntype SpyEvent = PureSpyEvent & { spyReportStart?: true }\n\nexport function spyReport(event: SpyEvent) {\n if (!__DEV__) {\n return\n } // dead code elimination can do the rest\n if (!globalState.spyListeners.length) {\n return\n }\n const listeners = globalState.spyListeners\n for (let i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event)\n }\n}\n\nexport function spyReportStart(event: PureSpyEvent) {\n if (!__DEV__) {\n return\n }\n const change = { ...event, spyReportStart: true as const }\n spyReport(change)\n}\n\nconst END_EVENT: SpyEvent = { type: \"report-end\", spyReportEnd: true }\n\nexport function spyReportEnd(change?: { time?: number }) {\n if (!__DEV__) {\n return\n }\n if (change) {\n spyReport({ ...change, type: \"report-end\", spyReportEnd: true })\n } else {\n spyReport(END_EVENT)\n }\n}\n\nexport function spy(listener: (change: SpyEvent) => void): Lambda {\n if (!__DEV__) {\n console.warn(`[mobx.spy] Is a no-op in production builds`)\n return function () {}\n } else {\n globalState.spyListeners.push(listener)\n return once(() => {\n globalState.spyListeners = globalState.spyListeners.filter(l => l !== listener)\n })\n }\n}\n", "import {\n createAction,\n executeAction,\n Annotation,\n storeAnnotation,\n die,\n isFunction,\n isStringish,\n createDecoratorAnnotation,\n createActionAnnotation,\n is20223Decorator\n} from \"../internal\"\n\nimport type { ClassFieldDecorator, ClassMethodDecorator } from \"../types/decorator_fills\"\n\nexport const ACTION = \"action\"\nexport const ACTION_BOUND = \"action.bound\"\nexport const AUTOACTION = \"autoAction\"\nexport const AUTOACTION_BOUND = \"autoAction.bound\"\n\nconst DEFAULT_ACTION_NAME = \"<unnamed action>\"\n\nconst actionAnnotation = createActionAnnotation(ACTION)\nconst actionBoundAnnotation = createActionAnnotation(ACTION_BOUND, {\n bound: true\n})\nconst autoActionAnnotation = createActionAnnotation(AUTOACTION, {\n autoAction: true\n})\nconst autoActionBoundAnnotation = createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n})\n\nexport interface IActionFactory\n extends Annotation,\n PropertyDecorator,\n ClassMethodDecorator,\n ClassFieldDecorator {\n // nameless actions\n <T extends Function | undefined | null>(fn: T): T\n // named actions\n <T extends Function | undefined | null>(name: string, fn: T): T\n\n // named decorator\n (customName: string): PropertyDecorator &\n Annotation &\n ClassMethodDecorator &\n ClassFieldDecorator\n\n // decorator (name no longer supported)\n bound: Annotation & PropertyDecorator & ClassMethodDecorator & ClassFieldDecorator\n}\n\nfunction createActionFactory(autoAction: boolean): IActionFactory {\n const res: IActionFactory = function action(arg1, arg2?): any {\n // action(fn() {})\n if (isFunction(arg1)) {\n return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction)\n }\n // action(\"name\", fn() {})\n if (isFunction(arg2)) {\n return createAction(arg1, arg2, autoAction)\n }\n // @action (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return (autoAction ? autoActionAnnotation : actionAnnotation).decorate_20223_(\n arg1,\n arg2\n )\n }\n // @action\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation)\n }\n // action(\"name\") & @action(\"name\")\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(\n createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction\n })\n )\n }\n\n if (__DEV__) {\n die(\"Invalid arguments for `action`\")\n }\n } as IActionFactory\n return res\n}\n\nexport const action: IActionFactory = createActionFactory(false)\nObject.assign(action, actionAnnotation)\nexport const autoAction: IActionFactory = createActionFactory(true)\nObject.assign(autoAction, autoActionAnnotation)\n\naction.bound = createDecoratorAnnotation(actionBoundAnnotation)\nautoAction.bound = createDecoratorAnnotation(autoActionBoundAnnotation)\n\nexport function runInAction<T>(fn: () => T): T {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined)\n}\n\nexport function isAction(thing: any) {\n return isFunction(thing) && thing.isMobxAction === true\n}\n", "import {\n EMPTY_OBJECT,\n IEqualsComparer,\n IReactionDisposer,\n IReactionPublic,\n Lambda,\n Reaction,\n action,\n comparer,\n getNextId,\n isAction,\n isFunction,\n isPlainObject,\n die,\n allowStateChanges,\n GenericAbortSignal\n} from \"../internal\"\n\nexport interface IAutorunOptions {\n delay?: number\n name?: string\n /**\n * Experimental.\n * Warns if the view doesn't track observables\n */\n requiresObservable?: boolean\n scheduler?: (callback: () => void) => any\n onError?: (error: any) => void\n signal?: GenericAbortSignal\n}\n\n/**\n * Creates a named reactive view and keeps it alive, so that the view is always\n * updated if one of the dependencies changes, even when the view is not further used by something else.\n * @param view The reactive view\n * @returns disposer function, which can be used to stop the view from being updated in the future.\n */\nexport function autorun(\n view: (r: IReactionPublic) => any,\n opts: IAutorunOptions = EMPTY_OBJECT\n): IReactionDisposer {\n if (__DEV__) {\n if (!isFunction(view)) {\n die(\"Autorun expects a function as first argument\")\n }\n if (isAction(view)) {\n die(\"Autorun does not accept actions since actions are untrackable\")\n }\n }\n\n const name: string =\n opts?.name ?? (__DEV__ ? (view as any).name || \"Autorun@\" + getNextId() : \"Autorun\")\n const runSync = !opts.scheduler && !opts.delay\n let reaction: Reaction\n\n if (runSync) {\n // normal autorun\n reaction = new Reaction(\n name,\n function (this: Reaction) {\n this.track(reactionRunner)\n },\n opts.onError,\n opts.requiresObservable\n )\n } else {\n const scheduler = createSchedulerFromOptions(opts)\n // debounced autorun\n let isScheduled = false\n\n reaction = new Reaction(\n name,\n () => {\n if (!isScheduled) {\n isScheduled = true\n scheduler(() => {\n isScheduled = false\n if (!reaction.isDisposed) {\n reaction.track(reactionRunner)\n }\n })\n }\n },\n opts.onError,\n opts.requiresObservable\n )\n }\n\n function reactionRunner() {\n view(reaction)\n }\n\n if (!opts?.signal?.aborted) {\n reaction.schedule_()\n }\n return reaction.getDisposer_(opts?.signal)\n}\n\nexport type IReactionOptions<T, FireImmediately extends boolean> = IAutorunOptions & {\n fireImmediately?: FireImmediately\n equals?: IEqualsComparer<T>\n}\n\nconst run = (f: Lambda) => f()\n\nfunction createSchedulerFromOptions(opts: IAutorunOptions) {\n return opts.scheduler\n ? opts.scheduler\n : opts.delay\n ? (f: Lambda) => setTimeout(f, opts.delay!)\n : run\n}\n\nexport function reaction<T, FireImmediately extends boolean = false>(\n expression: (r: IReactionPublic) => T,\n effect: (\n arg: T,\n prev: FireImmediately extends true ? T | undefined : T,\n r: IReactionPublic\n ) => void,\n opts: IReactionOptions<T, FireImmediately> = EMPTY_OBJECT\n): IReactionDisposer {\n if (__DEV__) {\n if (!isFunction(expression) || !isFunction(effect)) {\n die(\"First and second argument to reaction should be functions\")\n }\n if (!isPlainObject(opts)) {\n die(\"Third argument of reactions should be an object\")\n }\n }\n const name = opts.name ?? (__DEV__ ? \"Reaction@\" + getNextId() : \"Reaction\")\n const effectAction = action(\n name,\n opts.onError ? wrapErrorHandler(opts.onError, effect) : effect\n )\n const runSync = !opts.scheduler && !opts.delay\n const scheduler = createSchedulerFromOptions(opts)\n\n let firstTime = true\n let isScheduled = false\n let value: T\n\n const equals: IEqualsComparer<T> = (opts as any).compareStructural\n ? comparer.structural\n : opts.equals || comparer.default\n\n const r = new Reaction(\n name,\n () => {\n if (firstTime || runSync) {\n reactionRunner()\n } else if (!isScheduled) {\n isScheduled = true\n scheduler!(reactionRunner)\n }\n },\n opts.onError,\n opts.requiresObservable\n )\n\n function reactionRunner() {\n isScheduled = false\n if (r.isDisposed) {\n return\n }\n let changed: boolean = false\n const oldValue = value\n r.track(() => {\n const nextValue = allowStateChanges(false, () => expression(r))\n changed = firstTime || !equals(value, nextValue)\n value = nextValue\n })\n\n // This casting is nesessary as TS cannot infer proper type in current function implementation\n type OldValue = FireImmediately extends true ? T | undefined : T\n if (firstTime && opts.fireImmediately!) {\n effectAction(value, oldValue as OldValue, r)\n } else if (!firstTime && changed) {\n effectAction(value, oldValue as OldValue, r)\n }\n firstTime = false\n }\n\n if (!opts?.signal?.aborted) {\n r.schedule_()\n }\n return r.getDisposer_(opts?.signal)\n}\n\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments)\n } catch (e) {\n errorHandler.call(this, e)\n }\n }\n}\n", "import {\n IComputedValue,\n IObservable,\n IObservableArray,\n Lambda,\n ObservableMap,\n getAtom,\n ObservableSet,\n isFunction,\n IObservableValue\n} from \"../internal\"\n\nconst ON_BECOME_OBSERVED = \"onBO\"\nconst ON_BECOME_UNOBSERVED = \"onBUO\"\n\nexport function onBecomeObserved(\n value:\n | IObservable\n | IComputedValue<any>\n | IObservableArray<any>\n | ObservableMap<any, any>\n | ObservableSet<any>\n | IObservableValue<any>,\n listener: Lambda\n): Lambda\nexport function onBecomeObserved<K, V = any>(\n value: ObservableMap<K, V> | Object,\n property: K,\n listener: Lambda\n): Lambda\nexport function onBecomeObserved(thing, arg2, arg3?): Lambda {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3)\n}\n\nexport function onBecomeUnobserved(\n value:\n | IObservable\n | IComputedValue<any>\n | IObservableArray<any>\n | ObservableMap<any, any>\n | ObservableSet<any>\n | IObservableValue<any>,\n listener: Lambda\n): Lambda\nexport function onBecomeUnobserved<K, V = any>(\n value: ObservableMap<K, V> | Object,\n property: K,\n listener: Lambda\n): Lambda\nexport function onBecomeUnobserved(thing, arg2, arg3?): Lambda {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3)\n}\n\nfunction interceptHook(hook: \"onBO\" | \"onBUO\", thing, arg2, arg3) {\n const atom: IObservable =\n typeof arg3 === \"function\" ? getAtom(thing, arg2) : (getAtom(thing) as any)\n const cb = isFunction(arg3) ? arg3 : arg2\n const listenersKey = `${hook}L` as \"onBOL\" | \"onBUOL\"\n\n if (atom[listenersKey]) {\n atom[listenersKey]!.add(cb)\n } else {\n atom[listenersKey] = new Set<Lambda>([cb])\n }\n\n return function () {\n const hookListeners = atom[listenersKey]\n if (hookListeners) {\n hookListeners.delete(cb)\n if (hookListeners.size === 0) {\n delete atom[listenersKey]\n }\n }\n }\n}\n", "import { globalState, isolateGlobalState, setReactionScheduler } from \"../internal\"\n\nconst NEVER = \"never\"\nconst ALWAYS = \"always\"\nconst OBSERVED = \"observed\"\n// const IF_AVAILABLE = \"ifavailable\"\n\nexport function configure(options: {\n enforceActions?: \"never\" | \"always\" | \"observed\"\n computedRequiresReaction?: boolean\n /**\n * Warn if you try to create to derivation / reactive context without accessing any observable.\n */\n reactionRequiresObservable?: boolean\n /**\n * Warn if observables are accessed outside a reactive context\n */\n observableRequiresReaction?: boolean\n isolateGlobalState?: boolean\n disableErrorBoundaries?: boolean\n safeDescriptors?: boolean\n reactionScheduler?: (f: () => void) => void\n useProxies?: \"always\" | \"never\" | \"ifavailable\"\n}): void {\n if (options.isolateGlobalState === true) {\n isolateGlobalState()\n }\n const { useProxies, enforceActions } = options\n if (useProxies !== undefined) {\n globalState.useProxies =\n useProxies === ALWAYS\n ? true\n : useProxies === NEVER\n ? false\n : typeof Proxy !== \"undefined\"\n }\n if (useProxies === \"ifavailable\") {\n globalState.verifyProxies = true\n }\n if (enforceActions !== undefined) {\n const ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED\n globalState.enforceActions = ea\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true\n }\n ;[\n \"computedRequiresReaction\",\n \"reactionRequiresObservable\",\n \"observableRequiresReaction\",\n \"disableErrorBoundaries\",\n \"safeDescriptors\"\n ].forEach(key => {\n if (key in options) {\n globalState[key] = !!options[key]\n }\n })\n globalState.allowStateReads = !globalState.observableRequiresReaction\n if (__DEV__ && globalState.disableErrorBoundaries === true) {\n console.warn(\n \"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\"\n )\n }\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler)\n }\n}\n", "import {\n CreateObservableOptions,\n isObservableMap,\n AnnotationsMap,\n asObservableObject,\n isPlainObject,\n ObservableObjectAdministration,\n isObservable,\n die,\n getOwnPropertyDescriptors,\n $mobx,\n ownKeys,\n initObservable\n} from \"../internal\"\n\nexport function extendObservable<A extends Object, B extends Object>(\n target: A,\n properties: B,\n annotations?: AnnotationsMap<B, never>,\n options?: CreateObservableOptions\n): A & B {\n if (__DEV__) {\n if (arguments.length > 4) {\n die(\"'extendObservable' expected 2-4 arguments\")\n }\n if (typeof target !== \"object\") {\n die(\"'extendObservable' expects an object as first argument\")\n }\n if (isObservableMap(target)) {\n die(\"'extendObservable' should not be used on maps, use map.merge instead\")\n }\n if (!isPlainObject(properties)) {\n die(`'extendObservable' only accepts plain objects as second argument`)\n }\n if (isObservable(properties) || isObservable(annotations)) {\n die(`Extending an object with another observable (object) is not supported`)\n }\n }\n // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n const descriptors = getOwnPropertyDescriptors(properties)\n\n initObservable(() => {\n const adm: ObservableObjectAdministration = asObservableObject(target, options)[$mobx]\n ownKeys(descriptors).forEach(key => {\n adm.extend_(\n key,\n descriptors[key as any],\n // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true\n )\n })\n })\n\n return target as any\n}\n", "import { IDepTreeNode, getAtom, getObservers, hasObservers } from \"../internal\"\n\nexport interface IDependencyTree {\n name: string\n dependencies?: IDependencyTree[]\n}\n\nexport interface IObserverTree {\n name: string\n observers?: IObserverTree[]\n}\n\nexport function getDependencyTree(thing: any, property?: string): IDependencyTree {\n return nodeToDependencyTree(getAtom(thing, property))\n}\n\nfunction nodeToDependencyTree(node: IDepTreeNode): IDependencyTree {\n const result: IDependencyTree = {\n name: node.name_\n }\n if (node.observing_ && node.observing_.length > 0) {\n result.dependencies = unique(node.observing_).map(nodeToDependencyTree)\n }\n return result\n}\n\nexport function getObserverTree(thing: any, property?: string): IObserverTree {\n return nodeToObserverTree(getAtom(thing, property))\n}\n\nfunction nodeToObserverTree(node: IDepTreeNode): IObserverTree {\n const result: IObserverTree = {\n name: node.name_\n }\n if (hasObservers(node as any)) {\n result.observers = Array.from(<any>getObservers(node as any)).map(<any>nodeToObserverTree)\n }\n return result\n}\n\nfunction unique<T>(list: T[]): T[] {\n return Array.from(new Set(list))\n}\n", "import {\n action,\n noop,\n die,\n isFunction,\n Annotation,\n isStringish,\n storeAnnotation,\n createFlowAnnotation,\n createDecoratorAnnotation,\n is20223Decorator\n} from \"../internal\"\n\nimport type { ClassMethodDecorator } from \"../types/decorator_fills\"\n\nexport const FLOW = \"flow\"\n\nlet generatorId = 0\n\nexport function FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\"\n}\nFlowCancellationError.prototype = Object.create(Error.prototype)\n\nexport function isFlowCancellationError(error: Error) {\n return error instanceof FlowCancellationError\n}\n\nexport type CancellablePromise<T> = Promise<T> & { cancel(): void }\n\ninterface Flow extends Annotation, PropertyDecorator, ClassMethodDecorator {\n <R, Args extends any[]>(\n generator: (...args: Args) => Generator<any, R, any> | AsyncGenerator<any, R, any>\n ): (...args: Args) => CancellablePromise<R>\n bound: Annotation & PropertyDecorator & ClassMethodDecorator\n}\n\nconst flowAnnotation = createFlowAnnotation(\"flow\")\nconst flowBoundAnnotation = createFlowAnnotation(\"flow.bound\", { bound: true })\n\nexport const flow: Flow = Object.assign(\n function flow(arg1, arg2?) {\n // @flow (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return flowAnnotation.decorate_20223_(arg1, arg2)\n }\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation)\n }\n // flow(fn)\n if (__DEV__ && arguments.length !== 1) {\n die(`Flow expects single argument with generator function`)\n }\n const generator = arg1\n const name = generator.name || \"<unnamed flow>\"\n\n // Implementation based on https://github.com/tj/co/blob/master/index.js\n const res = function () {\n const ctx = this\n const args = arguments\n const runId = ++generatorId\n const gen = action(`${name} - runid: ${runId} - init`, generator).apply(ctx, args)\n let rejector: (error: any) => void\n let pendingPromise: CancellablePromise<any> | undefined = undefined\n\n const promise = new Promise(function (resolve, reject) {\n let stepId = 0\n rejector = reject\n\n function onFulfilled(res: any) {\n pendingPromise = undefined\n let ret\n try {\n ret = action(\n `${name} - runid: ${runId} - yield ${stepId++}`,\n gen.next\n ).call(gen, res)\n } catch (e) {\n return reject(e)\n }\n\n next(ret)\n }\n\n function onRejected(err: any) {\n pendingPromise = undefined\n let ret\n try {\n ret = action(\n `${name} - runid: ${runId} - yield ${stepId++}`,\n gen.throw!\n ).call(gen, err)\n } catch (e) {\n return reject(e)\n }\n next(ret)\n }\n\n function next(ret: any) {\n if (isFunction(ret?.then)) {\n // an async iterator\n ret.then(next, reject)\n return\n }\n if (ret.done) {\n return resolve(ret.value)\n }\n pendingPromise = Promise.resolve(ret.value) as any\n return pendingPromise!.then(onFulfilled, onRejected)\n }\n\n onFulfilled(undefined) // kick off the process\n }) as any\n\n promise.cancel = action(`${name} - runid: ${runId} - cancel`, function () {\n try {\n if (pendingPromise) {\n cancelPromise(pendingPromise)\n }\n // Finally block can return (or yield) stuff..\n const res = gen.return!(undefined as any)\n // eat anything that promise would do, it's cancelled!\n const yieldedPromise = Promise.resolve(res.value)\n yieldedPromise.then(noop, noop)\n cancelPromise(yieldedPromise) // maybe it can be cancelled :)\n // reject our original promise\n rejector(new FlowCancellationError())\n } catch (e) {\n rejector(e) // there could be a throwing finally block\n }\n })\n return promise\n }\n res.isMobXFlow = true\n return res\n } as any,\n flowAnnotation\n)\n\nflow.bound = createDecoratorAnnotation(flowBoundAnnotation)\n\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) {\n promise.cancel()\n }\n}\n\nexport function flowResult<T>(\n result: T\n): T extends Generator<any, infer R, any>\n ? CancellablePromise<R>\n : T extends CancellablePromise<any>\n ? T\n : never {\n return result as any // just tricking TypeScript :)\n}\n\nexport function isFlow(fn: any): boolean {\n return fn?.isMobXFlow === true\n}\n", "import {\n IObservableArray,\n IObservableValue,\n Lambda,\n ObservableMap,\n getAdministration,\n isObservableArray,\n isObservableMap,\n isObservableObject,\n isObservableValue,\n ObservableSet,\n die,\n isStringish\n} from \"../internal\"\n\nexport type ReadInterceptor<T> = (value: any) => T\n\n/** Experimental feature right now, tested indirectly via Mobx-State-Tree */\nexport function interceptReads<T>(value: IObservableValue<T>, handler: ReadInterceptor<T>): Lambda\nexport function interceptReads<T>(\n observableArray: IObservableArray<T>,\n handler: ReadInterceptor<T>\n): Lambda\nexport function interceptReads<K, V>(\n observableMap: ObservableMap<K, V>,\n handler: ReadInterceptor<V>\n): Lambda\nexport function interceptReads<V>(\n observableSet: ObservableSet<V>,\n handler: ReadInterceptor<V>\n): Lambda\nexport function interceptReads(\n object: Object,\n property: string,\n handler: ReadInterceptor<any>\n): Lambda\nexport function interceptReads(thing, propOrHandler?, handler?): Lambda {\n let target\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing)\n } else if (isObservableObject(thing)) {\n if (__DEV__ && !isStringish(propOrHandler)) {\n return die(\n `InterceptReads can only be used with a specific property, not with an object in general`\n )\n }\n target = getAdministration(thing, propOrHandler)\n } else if (__DEV__) {\n return die(`Expected observable map, object or array as first array`)\n }\n if (__DEV__ && target.dehancer !== undefined) {\n return die(`An intercept reader was already established`)\n }\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler\n return () => {\n target.dehancer = undefined\n }\n}\n", "import {\n IArrayWillChange,\n IArrayWillSplice,\n IInterceptor,\n IMapWillChange,\n IObjectWillChange,\n IObservableArray,\n IObservableValue,\n IValueWillChange,\n Lambda,\n ObservableMap,\n getAdministration,\n ObservableSet,\n ISetWillChange,\n isFunction\n} from \"../internal\"\n\nexport function intercept<T>(\n value: IObservableValue<T>,\n handler: IInterceptor<IValueWillChange<T>>\n): Lambda\nexport function intercept<T>(\n observableArray: IObservableArray<T> | Array<T>,\n handler: IInterceptor<IArrayWillChange<T> | IArrayWillSplice<T>>\n): Lambda\nexport function intercept<K, V>(\n observableMap: ObservableMap<K, V> | Map<K, V>,\n handler: IInterceptor<IMapWillChange<K, V>>\n): Lambda\nexport function intercept<V>(\n observableSet: ObservableSet<V> | Set<V>,\n handler: IInterceptor<ISetWillChange<V>>\n): Lambda\nexport function intercept<K, V>(\n observableMap: ObservableMap<K, V> | Map<K, V>,\n property: K,\n handler: IInterceptor<IValueWillChange<V>>\n): Lambda\nexport function intercept(object: object, handler: IInterceptor<IObjectWillChange>): Lambda\nexport function intercept<T extends object, K extends keyof T>(\n object: T,\n property: K,\n handler: IInterceptor<IValueWillChange<T[K]>>\n): Lambda\nexport function intercept(thing, propOrHandler?, handler?): Lambda {\n if (isFunction(handler)) {\n return interceptProperty(thing, propOrHandler, handler)\n } else {\n return interceptInterceptable(thing, propOrHandler)\n }\n}\n\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler)\n}\n\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler)\n}\n", "import { $mobx, getAtom, isComputedValue, isObservableObject, die, isStringish } from \"../internal\"\n\nexport function _isComputed(value, property?: PropertyKey): boolean {\n if (property === undefined) {\n return isComputedValue(value)\n }\n if (isObservableObject(value) === false) {\n return false\n }\n if (!value[$mobx].values_.has(property)) {\n return false\n }\n const atom = getAtom(value, property)\n return isComputedValue(atom)\n}\n\nexport function isComputed(value: any): boolean {\n if (__DEV__ && arguments.length > 1) {\n return die(\n `isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property`\n )\n }\n return _isComputed(value)\n}\n\nexport function isComputedProp(value: any, propName: PropertyKey): boolean {\n if (__DEV__ && !isStringish(propName)) {\n return die(`isComputed expected a property name as second argument`)\n }\n return _isComputed(value, propName)\n}\n", "import {\n $mobx,\n isAtom,\n isComputedValue,\n isObservableArray,\n isObservableMap,\n isObservableObject,\n isReaction,\n die,\n isStringish\n} from \"../internal\"\n\nfunction _isObservable(value, property?: PropertyKey): boolean {\n if (!value) {\n return false\n }\n if (property !== undefined) {\n if (__DEV__ && (isObservableMap(value) || isObservableArray(value))) {\n return die(\n \"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\"\n )\n }\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property)\n }\n return false\n }\n // For first check, see #701\n return (\n isObservableObject(value) ||\n !!value[$mobx] ||\n isAtom(value) ||\n isReaction(value) ||\n isComputedValue(value)\n )\n}\n\nexport function isObservable(value: any): boolean {\n if (__DEV__ && arguments.length !== 1) {\n die(\n `isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property`\n )\n }\n return _isObservable(value)\n}\n\nexport function isObservableProp(value: any, propName: PropertyKey): boolean {\n if (__DEV__ && !isStringish(propName)) {\n return die(`expected a property name as second argument`)\n }\n return _isObservable(value, propName)\n}\n", "import {\n $mobx,\n IIsObservableObject,\n IObservableArray,\n ObservableMap,\n ObservableSet,\n ObservableObjectAdministration,\n endBatch,\n isObservableArray,\n isObservableMap,\n isObservableSet,\n isObservableObject,\n startBatch,\n die\n} from \"../internal\"\n\nexport function keys<K>(map: ObservableMap<K, any>): ReadonlyArray<K>\nexport function keys<T>(ar: IObservableArray<T>): ReadonlyArray<number>\nexport function keys<T>(set: ObservableSet<T>): ReadonlyArray<T>\nexport function keys<T extends Object>(obj: T): ReadonlyArray<PropertyKey>\nexport function keys(obj: any): any {\n if (isObservableObject(obj)) {\n return (\n (obj as any as IIsObservableObject)[$mobx] as ObservableObjectAdministration\n ).keys_()\n }\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys())\n }\n if (isObservableArray(obj)) {\n return obj.map((_, index) => index)\n }\n die(5)\n}\n\nexport function values<K, T>(map: ObservableMap<K, T>): ReadonlyArray<T>\nexport function values<T>(set: ObservableSet<T>): ReadonlyArray<T>\nexport function values<T>(ar: IObservableArray<T>): ReadonlyArray<T>\nexport function values<T = any>(obj: T): ReadonlyArray<T extends object ? T[keyof T] : any>\nexport function values(obj: any): string[] {\n if (isObservableObject(obj)) {\n return keys(obj).map(key => obj[key])\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(key => obj.get(key))\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.values())\n }\n if (isObservableArray(obj)) {\n return obj.slice()\n }\n die(6)\n}\n\nexport function entries<K, T>(map: ObservableMap<K, T>): ReadonlyArray<[K, T]>\nexport function entries<T>(set: ObservableSet<T>): ReadonlyArray<[T, T]>\nexport function entries<T>(ar: IObservableArray<T>): ReadonlyArray<[number, T]>\nexport function entries<T = any>(\n obj: T\n): ReadonlyArray<[string, T extends object ? T[keyof T] : any]>\nexport function entries(obj: any): any {\n if (isObservableObject(obj)) {\n return keys(obj).map(key => [key, obj[key]])\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(key => [key, obj.get(key)])\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.entries())\n }\n if (isObservableArray(obj)) {\n return obj.map((key, index) => [index, key])\n }\n die(7)\n}\n\nexport function set<V>(obj: ObservableMap<PropertyKey, V>, values: { [key: string]: V })\nexport function set<K, V>(obj: ObservableMap<K, V>, key: K, value: V)\nexport function set<T>(obj: ObservableSet<T>, value: T)\nexport function set<T>(obj: IObservableArray<T>, index: number, value: T)\nexport function set<T extends Object>(obj: T, values: { [key: string]: any })\nexport function set<T extends Object>(obj: T, key: PropertyKey, value: any)\nexport function set(obj: any, key: any, value?: any): void {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch()\n const values = key\n try {\n for (let key in values) {\n set(obj, key, values[key])\n }\n } finally {\n endBatch()\n }\n return\n }\n if (isObservableObject(obj)) {\n ;(obj as any as IIsObservableObject)[$mobx].set_(key, value)\n } else if (isObservableMap(obj)) {\n obj.set(key, value)\n } else if (isObservableSet(obj)) {\n obj.add(key)\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10)\n }\n if (key < 0) {\n die(`Invalid index: '${key}'`)\n }\n startBatch()\n if (key >= obj.length) {\n obj.length = key + 1\n }\n obj[key] = value\n endBatch()\n } else {\n die(8)\n }\n}\n\nexport function remove<K, V>(obj: ObservableMap<K, V>, key: K)\nexport function remove<T>(obj: ObservableSet<T>, key: T)\nexport function remove<T>(obj: IObservableArray<T>, index: number)\nexport function remove<T extends Object>(obj: T, key: string)\nexport function remove(obj: any, key: any): void {\n if (isObservableObject(obj)) {\n ;(obj as any as IIsObservableObject)[$mobx].delete_(key)\n } else if (isObservableMap(obj)) {\n obj.delete(key)\n } else if (isObservableSet(obj)) {\n obj.delete(key)\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10)\n }\n obj.splice(key, 1)\n } else {\n die(9)\n }\n}\n\nexport function has<K>(obj: ObservableMap<K, any>, key: K): boolean\nexport function has<T>(obj: ObservableSet<T>, key: T): boolean\nexport function has<T>(obj: IObservableArray<T>, index: number): boolean\nexport function has<T extends Object>(obj: T, key: string): boolean\nexport function has(obj: any, key: any): boolean {\n if (isObservableObject(obj)) {\n return (obj as any as IIsObservableObject)[$mobx].has_(key)\n } else if (isObservableMap(obj)) {\n return obj.has(key)\n } else if (isObservableSet(obj)) {\n return obj.has(key)\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length\n }\n die(10)\n}\n\nexport function get<K, V>(obj: ObservableMap<K, V>, key: K): V | undefined\nexport function get<T>(obj: IObservableArray<T>, index: number): T | undefined\nexport function get<T extends Object>(obj: T, key: string): any\nexport function get(obj: any, key: any): any {\n if (!has(obj, key)) {\n return undefined\n }\n if (isObservableObject(obj)) {\n return (obj as any as IIsObservableObject)[$mobx].get_(key)\n } else if (isObservableMap(obj)) {\n return obj.get(key)\n } else if (isObservableArray(obj)) {\n return obj[key]\n }\n die(11)\n}\n\nexport function apiDefineProperty(obj: Object, key: PropertyKey, descriptor: PropertyDescriptor) {\n if (isObservableObject(obj)) {\n return (obj as any as IIsObservableObject)[$mobx].defineProperty_(key, descriptor)\n }\n die(39)\n}\n\nexport function apiOwnKeys(obj: Object) {\n if (isObservableObject(obj)) {\n return (obj as any as IIsObservableObject)[$mobx].ownKeys_()\n }\n die(38)\n}\n", "import {\n IArrayDidChange,\n IComputedValue,\n IMapDidChange,\n IObjectDidChange,\n IObservableArray,\n IObservableValue,\n IValueDidChange,\n Lambda,\n ObservableMap,\n getAdministration,\n ObservableSet,\n ISetDidChange,\n isFunction\n} from \"../internal\"\n\nexport function observe<T>(\n value: IObservableValue<T> | IComputedValue<T>,\n listener: (change: IValueDidChange<T>) => void,\n fireImmediately?: boolean\n): Lambda\nexport function observe<T>(\n observableArray: IObservableArray<T> | Array<T>,\n listener: (change: IArrayDidChange<T>) => void,\n fireImmediately?: boolean\n): Lambda\nexport function observe<V>(\n // ObservableSet/ObservableMap are required despite they implement Set/Map: https://github.com/mobxjs/mobx/pull/3180#discussion_r746542929\n observableSet: ObservableSet<V> | Set<V>,\n listener: (change: ISetDidChange<V>) => void,\n fireImmediately?: boolean\n): Lambda\nexport function observe<K, V>(\n observableMap: ObservableMap<K, V> | Map<K, V>,\n listener: (change: IMapDidChange<K, V>) => void,\n fireImmediately?: boolean\n): Lambda\nexport function observe<K, V>(\n observableMap: ObservableMap<K, V> | Map<K, V>,\n property: K,\n listener: (change: IValueDidChange<V>) => void,\n fireImmediately?: boolean\n): Lambda\nexport function observe(\n object: Object,\n listener: (change: IObjectDidChange) => void,\n fireImmediately?: boolean\n): Lambda\nexport function observe<T, K extends keyof T>(\n object: T,\n property: K,\n listener: (change: IValueDidChange<T[K]>) => void,\n fireImmediately?: boolean\n): Lambda\nexport function observe(thing, propOrCb?, cbOrFire?, fireImmediately?): Lambda {\n if (isFunction(cbOrFire)) {\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately)\n } else {\n return observeObservable(thing, propOrCb, cbOrFire)\n }\n}\n\nfunction observeObservable(thing, listener, fireImmediately: boolean) {\n return getAdministration(thing).observe_(listener, fireImmediately)\n}\n\nfunction observeObservableProperty(thing, property, listener, fireImmediately: boolean) {\n return getAdministration(thing, property).observe_(listener, fireImmediately)\n}\n", "import {\n isObservable,\n isObservableArray,\n isObservableValue,\n isObservableMap,\n isObservableSet,\n isComputedValue,\n die,\n apiOwnKeys,\n objectPrototype\n} from \"../internal\"\n\nfunction cache<K, V>(map: Map<any, any>, key: K, value: V): V {\n map.set(key, value)\n return value\n}\n\nfunction toJSHelper(source, __alreadySeen: Map<any, any>) {\n if (\n source == null ||\n typeof source !== \"object\" ||\n source instanceof Date ||\n !isObservable(source)\n ) {\n return source\n }\n\n if (isObservableValue(source) || isComputedValue(source)) {\n return toJSHelper(source.get(), __alreadySeen)\n }\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source)\n }\n if (isObservableArray(source)) {\n const res = cache(__alreadySeen, source, new Array(source.length))\n source.forEach((value, idx) => {\n res[idx] = toJSHelper(value, __alreadySeen)\n })\n return res\n }\n if (isObservableSet(source)) {\n const res = cache(__alreadySeen, source, new Set())\n source.forEach(value => {\n res.add(toJSHelper(value, __alreadySeen))\n })\n return res\n }\n if (isObservableMap(source)) {\n const res = cache(__alreadySeen, source, new Map())\n source.forEach((value, key) => {\n res.set(key, toJSHelper(value, __alreadySeen))\n })\n return res\n } else {\n // must be observable object\n const res = cache(__alreadySeen, source, {})\n apiOwnKeys(source).forEach((key: any) => {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n res[key] = toJSHelper(source[key], __alreadySeen)\n }\n })\n return res\n }\n}\n\n/**\n * Recursively converts an observable to it's non-observable native counterpart.\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\n * Computed and other non-enumerable properties are completely ignored.\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\n */\nexport function toJS<T>(source: T, options?: any): T {\n if (__DEV__ && options) {\n die(\"toJS no longer supports options\")\n }\n return toJSHelper(source, new Map())\n}\n", "import { TraceMode, die, getAtom, globalState } from \"../internal\"\n\nexport function trace(thing?: any, prop?: string, enterBreakPoint?: boolean): void\nexport function trace(thing?: any, enterBreakPoint?: boolean): void\nexport function trace(enterBreakPoint?: boolean): void\nexport function trace(...args: any[]): void {\n if (!__DEV__) {\n return\n }\n let enterBreakPoint = false\n if (typeof args[args.length - 1] === \"boolean\") {\n enterBreakPoint = args.pop()\n }\n const derivation = getAtomFromArgs(args)\n if (!derivation) {\n return die(\n `'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly`\n )\n }\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(`[mobx.trace] '${derivation.name_}' tracing enabled`)\n }\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG\n}\n\nfunction getAtomFromArgs(args): any {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation\n case 1:\n return getAtom(args[0])\n case 2:\n return getAtom(args[0], args[1])\n }\n}\n", "import { endBatch, startBatch } from \"../internal\"\n\n/**\n * During a transaction no views are updated until the end of the transaction.\n * The transaction will be run synchronously nonetheless.\n *\n * @param action a function that updates some reactive state\n * @returns any value that was returned by the 'action' parameter.\n */\nexport function transaction<T>(action: () => T, thisArg = undefined): T {\n startBatch()\n try {\n return action.apply(thisArg)\n } finally {\n endBatch()\n }\n}\n", "import {\n $mobx,\n IReactionDisposer,\n Lambda,\n autorun,\n createAction,\n getNextId,\n die,\n allowStateChanges,\n GenericAbortSignal\n} from \"../internal\"\n\nexport interface IWhenOptions {\n name?: string\n timeout?: number\n onError?: (error: any) => void\n signal?: GenericAbortSignal\n}\n\nexport function when(\n predicate: () => boolean,\n opts?: IWhenOptions\n): Promise<void> & { cancel(): void }\nexport function when(\n predicate: () => boolean,\n effect: Lambda,\n opts?: IWhenOptions\n): IReactionDisposer\nexport function when(predicate: any, arg1?: any, arg2?: any): any {\n if (arguments.length === 1 || (arg1 && typeof arg1 === \"object\")) {\n return whenPromise(predicate, arg1)\n }\n return _when(predicate, arg1, arg2 || {})\n}\n\nfunction _when(predicate: () => boolean, effect: Lambda, opts: IWhenOptions): IReactionDisposer {\n let timeoutHandle: any\n if (typeof opts.timeout === \"number\") {\n const error = new Error(\"WHEN_TIMEOUT\")\n timeoutHandle = setTimeout(() => {\n if (!disposer[$mobx].isDisposed) {\n disposer()\n if (opts.onError) {\n opts.onError(error)\n } else {\n throw error\n }\n }\n }, opts.timeout)\n }\n\n opts.name = __DEV__ ? opts.name || \"When@\" + getNextId() : \"When\"\n const effectAction = createAction(\n __DEV__ ? opts.name + \"-effect\" : \"When-effect\",\n effect as Function\n )\n // eslint-disable-next-line\n var disposer = autorun(r => {\n // predicate should not change state\n let cond = allowStateChanges(false, predicate)\n if (cond) {\n r.dispose()\n if (timeoutHandle) {\n clearTimeout(timeoutHandle)\n }\n effectAction()\n }\n }, opts)\n return disposer\n}\n\nfunction whenPromise(\n predicate: () => boolean,\n opts?: IWhenOptions\n): Promise<void> & { cancel(): void } {\n if (__DEV__ && opts && opts.onError) {\n return die(`the options 'onError' and 'promise' cannot be combined`)\n }\n if (opts?.signal?.aborted) {\n return Object.assign(Promise.reject(new Error(\"WHEN_ABORTED\")), { cancel: () => null })\n }\n let cancel\n let abort\n const res = new Promise((resolve, reject) => {\n let disposer = _when(predicate, resolve as Lambda, { ...opts, onError: reject })\n cancel = () => {\n disposer()\n reject(new Error(\"WHEN_CANCELLED\"))\n }\n abort = () => {\n disposer()\n reject(new Error(\"WHEN_ABORTED\"))\n }\n opts?.signal?.addEventListener?.(\"abort\", abort)\n }).finally(() => opts?.signal?.removeEventListener?.(\"abort\", abort))\n ;(res as any).cancel = cancel\n return res as any\n}\n", "import {\n $mobx,\n IIsObservableObject,\n ObservableObjectAdministration,\n warnAboutProxyRequirement,\n assertProxies,\n die,\n isStringish,\n globalState,\n CreateObservableOptions,\n asObservableObject\n} from \"../internal\"\n\nfunction getAdm(target): ObservableObjectAdministration {\n return target[$mobx]\n}\n\n// Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\nconst objectProxyTraps: ProxyHandler<any> = {\n has(target: IIsObservableObject, name: PropertyKey): boolean {\n if (__DEV__ && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\n \"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\"\n )\n }\n return getAdm(target).has_(name)\n },\n get(target: IIsObservableObject, name: PropertyKey): any {\n return getAdm(target).get_(name)\n },\n set(target: IIsObservableObject, name: PropertyKey, value: any): boolean {\n if (!isStringish(name)) {\n return false\n }\n if (__DEV__ && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\n \"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\"\n )\n }\n // null (intercepted) -> true (success)\n return getAdm(target).set_(name, value, true) ?? true\n },\n deleteProperty(target: IIsObservableObject, name: PropertyKey): boolean {\n if (__DEV__) {\n warnAboutProxyRequirement(\n \"delete properties from an observable object. Use 'remove' from 'mobx' instead.\"\n )\n }\n if (!isStringish(name)) {\n return false\n }\n // null (intercepted) -> true (success)\n return getAdm(target).delete_(name, true) ?? true\n },\n defineProperty(\n target: IIsObservableObject,\n name: PropertyKey,\n descriptor: PropertyDescriptor\n ): boolean {\n if (__DEV__) {\n warnAboutProxyRequirement(\n \"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\"\n )\n }\n // null (intercepted) -> true (success)\n return getAdm(target).defineProperty_(name, descriptor) ?? true\n },\n ownKeys(target: IIsObservableObject): ArrayLike<string | symbol> {\n if (__DEV__ && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\n \"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\"\n )\n }\n return getAdm(target).ownKeys_()\n },\n preventExtensions(target) {\n die(13)\n }\n}\n\nexport function asDynamicObservableObject(\n target: any,\n options?: CreateObservableOptions\n): IIsObservableObject {\n assertProxies()\n target = asObservableObject(target, options)\n return (target[$mobx].proxy_ ??= new Proxy(target, objectProxyTraps))\n}\n", "import { Lambda, once, untrackedEnd, untrackedStart, die } from \"../internal\"\n\nexport type IInterceptor<T> = (change: T) => T | null\n\nexport interface IInterceptable<T> {\n interceptors_: IInterceptor<T>[] | undefined\n}\n\nexport function hasInterceptors(interceptable: IInterceptable<any>) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0\n}\n\nexport function registerInterceptor<T>(\n interceptable: IInterceptable<T>,\n handler: IInterceptor<T>\n): Lambda {\n const interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = [])\n interceptors.push(handler)\n return once(() => {\n const idx = interceptors.indexOf(handler)\n if (idx !== -1) {\n interceptors.splice(idx, 1)\n }\n })\n}\n\nexport function interceptChange<T>(\n interceptable: IInterceptable<T | null>,\n change: T | null\n): T | null {\n const prevU = untrackedStart()\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n const interceptors = [...(interceptable.interceptors_ || [])]\n for (let i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change)\n if (change && !(change as any).type) {\n die(14)\n }\n if (!change) {\n break\n }\n }\n return change\n } finally {\n untrackedEnd(prevU)\n }\n}\n", "import { Lambda, once, untrackedEnd, untrackedStart } from \"../internal\"\n\nexport interface IListenable {\n changeListeners_: Function[] | undefined\n}\n\nexport function hasListeners(listenable: IListenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0\n}\n\nexport function registerListener(listenable: IListenable, handler: Function): Lambda {\n const listeners = listenable.changeListeners_ || (listenable.changeListeners_ = [])\n listeners.push(handler)\n return once(() => {\n const idx = listeners.indexOf(handler)\n if (idx !== -1) {\n listeners.splice(idx, 1)\n }\n })\n}\n\nexport function notifyListeners<T>(listenable: IListenable, change: T) {\n const prevU = untrackedStart()\n let listeners = listenable.changeListeners_\n if (!listeners) {\n return\n }\n listeners = listeners.slice()\n for (let i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change)\n }\n untrackedEnd(prevU)\n}\n", "import {\n $mobx,\n asObservableObject,\n AnnotationsMap,\n CreateObservableOptions,\n ObservableObjectAdministration,\n collectStoredAnnotations,\n isPlainObject,\n isObservableObject,\n die,\n ownKeys,\n extendObservable,\n addHiddenProp,\n storedAnnotationsSymbol,\n initObservable\n} from \"../internal\"\n\n// Hack based on https://github.com/Microsoft/TypeScript/issues/14829#issuecomment-322267089\n// We need this, because otherwise, AdditionalKeys is going to be inferred to be any\n// set of superfluous keys. But, we rather want to get a compile error unless AdditionalKeys is\n// _explicity_ passed as generic argument\n// Fixes: https://github.com/mobxjs/mobx/issues/2325#issuecomment-691070022\ntype NoInfer<T> = [T][T extends any ? 0 : never]\n\ntype MakeObservableOptions = Omit<CreateObservableOptions, \"proxy\">\n\nexport function makeObservable<T extends object, AdditionalKeys extends PropertyKey = never>(\n target: T,\n annotations?: AnnotationsMap<T, NoInfer<AdditionalKeys>>,\n options?: MakeObservableOptions\n): T {\n initObservable(() => {\n const adm: ObservableObjectAdministration = asObservableObject(target, options)[$mobx]\n if (__DEV__ && annotations && target[storedAnnotationsSymbol]) {\n die(\n `makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.`\n )\n }\n // Default to decorators\n annotations ??= collectStoredAnnotations(target)\n\n // Annotate\n ownKeys(annotations).forEach(key => adm.make_(key, annotations![key]))\n })\n return target\n}\n\n// proto[keysSymbol] = new Set<PropertyKey>()\nconst keysSymbol = Symbol(\"mobx-keys\")\n\nexport function makeAutoObservable<T extends object, AdditionalKeys extends PropertyKey = never>(\n target: T,\n overrides?: AnnotationsMap<T, NoInfer<AdditionalKeys>>,\n options?: MakeObservableOptions\n): T {\n if (__DEV__) {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n die(`'makeAutoObservable' can only be used for classes that don't have a superclass`)\n }\n if (isObservableObject(target)) {\n die(`makeAutoObservable can only be used on objects not already made observable`)\n }\n }\n\n // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options)\n }\n\n initObservable(() => {\n const adm: ObservableObjectAdministration = asObservableObject(target, options)[$mobx]\n\n // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n if (!target[keysSymbol]) {\n const proto = Object.getPrototypeOf(target)\n const keys = new Set([...ownKeys(target), ...ownKeys(proto)])\n keys.delete(\"constructor\")\n keys.delete($mobx)\n addHiddenProp(proto, keysSymbol, keys)\n }\n\n target[keysSymbol].forEach(key =>\n adm.make_(\n key,\n // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true\n )\n )\n })\n\n return target\n}\n", "import {\n $mobx,\n Atom,\n EMPTY_ARRAY,\n IAtom,\n IEnhancer,\n IInterceptable,\n IInterceptor,\n IListenable,\n Lambda,\n addHiddenFinalProp,\n checkIfStateModificationsAreAllowed,\n createInstanceofPredicate,\n getNextId,\n hasInterceptors,\n hasListeners,\n interceptChange,\n isObject,\n isSpyEnabled,\n notifyListeners,\n registerInterceptor,\n registerListener,\n spyReportEnd,\n spyReportStart,\n assertProxies,\n reserveArrayBuffer,\n hasProp,\n die,\n globalState,\n initObservable\n} from \"../internal\"\n\nconst SPLICE = \"splice\"\nexport const UPDATE = \"update\"\nexport const MAX_SPLICE_SIZE = 10000 // See e.g. https://github.com/mobxjs/mobx/issues/859\n\nexport interface IObservableArray<T = any> extends Array<T> {\n spliceWithArray(index: number, deleteCount?: number, newItems?: T[]): T[]\n clear(): T[]\n replace(newItems: T[]): T[]\n remove(value: T): boolean\n toJSON(): T[]\n}\n\ninterface IArrayBaseChange<T> {\n object: IObservableArray<T>\n observableKind: \"array\"\n debugObjectName: string\n index: number\n}\n\nexport type IArrayDidChange<T = any> = IArrayUpdate<T> | IArraySplice<T>\n\nexport interface IArrayUpdate<T = any> extends IArrayBaseChange<T> {\n type: \"update\"\n newValue: T\n oldValue: T\n}\n\nexport interface IArraySplice<T = any> extends IArrayBaseChange<T> {\n type: \"splice\"\n added: T[]\n addedCount: number\n removed: T[]\n removedCount: number\n}\n\nexport interface IArrayWillChange<T = any> {\n object: IObservableArray<T>\n index: number\n type: \"update\"\n newValue: T\n}\n\nexport interface IArrayWillSplice<T = any> {\n object: IObservableArray<T>\n index: number\n type: \"splice\"\n added: T[]\n removedCount: number\n}\n\nconst arrayTraps = {\n get(target, name) {\n const adm: ObservableArrayAdministration = target[$mobx]\n if (name === $mobx) {\n return adm\n }\n if (name === \"length\") {\n return adm.getArrayLength_()\n }\n if (typeof name === \"string\" && !isNaN(name as any)) {\n return adm.get_(parseInt(name))\n }\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name]\n }\n return target[name]\n },\n set(target, name, value): boolean {\n const adm: ObservableArrayAdministration = target[$mobx]\n if (name === \"length\") {\n adm.setArrayLength_(value)\n }\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value\n } else {\n // numeric string\n adm.set_(parseInt(name), value)\n }\n return true\n },\n preventExtensions() {\n die(15)\n }\n}\n\nexport class ObservableArrayAdministration\n implements IInterceptable<IArrayWillChange<any> | IArrayWillSplice<any>>, IListenable\n{\n atom_: IAtom\n readonly values_: any[] = [] // this is the prop that gets proxied, so can't replace it!\n interceptors_\n changeListeners_\n enhancer_: (newV: any, oldV: any | undefined) => any\n dehancer: any\n proxy_!: IObservableArray<any>\n lastKnownLength_ = 0\n\n constructor(\n name = __DEV__ ? \"ObservableArray@\" + getNextId() : \"ObservableArray\",\n enhancer: IEnhancer<any>,\n public owned_: boolean,\n public legacyMode_: boolean\n ) {\n this.atom_ = new Atom(name)\n this.enhancer_ = (newV, oldV) =>\n enhancer(newV, oldV, __DEV__ ? name + \"[..]\" : \"ObservableArray[..]\")\n }\n\n dehanceValue_(value: any): any {\n if (this.dehancer !== undefined) {\n return this.dehancer(value)\n }\n return value\n }\n\n dehanceValues_(values: any[]): any[] {\n if (this.dehancer !== undefined && values.length > 0) {\n return values.map(this.dehancer) as any\n }\n return values\n }\n\n intercept_(handler: IInterceptor<IArrayWillChange<any> | IArrayWillSplice<any>>): Lambda {\n return registerInterceptor<IArrayWillChange<any> | IArrayWillSplice<any>>(this, handler)\n }\n\n observe_(\n listener: (changeData: IArrayDidChange<any>) => void,\n fireImmediately = false\n ): Lambda {\n if (fireImmediately) {\n listener(<IArraySplice<any>>{\n observableKind: \"array\",\n object: this.proxy_ as any,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n })\n }\n return registerListener(this, listener)\n }\n\n getArrayLength_(): number {\n this.atom_.reportObserved()\n return this.values_.length\n }\n\n setArrayLength_(newLength: number) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n die(\"Out of range: \" + newLength)\n }\n let currentLength = this.values_.length\n if (newLength === currentLength) {\n return\n } else if (newLength > currentLength) {\n const newItems = new Array(newLength - currentLength)\n for (let i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined\n } // No Array.fill everywhere...\n this.spliceWithArray_(currentLength, 0, newItems)\n } else {\n this.spliceWithArray_(newLength, currentLength - newLength)\n }\n }\n\n updateArrayLength_(oldLength: number, delta: number) {\n if (oldLength !== this.lastKnownLength_) {\n die(16)\n }\n this.lastKnownLength_ += delta\n if (this.legacyMode_ && delta > 0) {\n reserveArrayBuffer(oldLength + delta + 1)\n }\n }\n\n spliceWithArray_(index: number, deleteCount?: number, newItems?: any[]): any[] {\n checkIfStateModificationsAreAllowed(this.atom_)\n const length = this.values_.length\n\n if (index === undefined) {\n index = 0\n } else if (index > length) {\n index = length\n } else if (index < 0) {\n index = Math.max(0, length + index)\n }\n\n if (arguments.length === 1) {\n deleteCount = length - index\n } else if (deleteCount === undefined || deleteCount === null) {\n deleteCount = 0\n } else {\n deleteCount = Math.max(0, Math.min(deleteCount, length - index))\n }\n\n if (newItems === undefined) {\n newItems = EMPTY_ARRAY\n }\n\n if (hasInterceptors(this)) {\n const change = interceptChange<IArrayWillSplice<any>>(this as any, {\n object: this.proxy_ as any,\n type: SPLICE,\n index,\n removedCount: deleteCount,\n added: newItems\n })\n if (!change) {\n return EMPTY_ARRAY\n }\n deleteCount = change.removedCount\n newItems = change.added\n }\n\n newItems =\n newItems.length === 0 ? newItems : newItems.map(v => this.enhancer_(v, undefined))\n if (this.legacyMode_ || __DEV__) {\n const lengthDelta = newItems.length - deleteCount\n this.updateArrayLength_(length, lengthDelta) // checks if internal array wasn't modified\n }\n const res = this.spliceItemsIntoValues_(index, deleteCount, newItems)\n\n if (deleteCount !== 0 || newItems.length !== 0) {\n this.notifyArraySplice_(index, newItems, res)\n }\n return this.dehanceValues_(res)\n }\n\n spliceItemsIntoValues_(index: number, deleteCount: number, newItems: any[]): any[] {\n if (newItems.length < MAX_SPLICE_SIZE) {\n return this.values_.splice(index, deleteCount, ...newItems)\n } else {\n // The items removed by the splice\n const res = this.values_.slice(index, index + deleteCount)\n // The items that that should remain at the end of the array\n let oldItems = this.values_.slice(index + deleteCount)\n // New length is the previous length + addition count - deletion count\n this.values_.length += newItems.length - deleteCount\n for (let i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i]\n }\n for (let i = 0; i < oldItems.length; i++) {\n this.values_[index + newItems.length + i] = oldItems[i]\n }\n return res\n }\n }\n\n notifyArrayChildUpdate_(index: number, newValue: any, oldValue: any) {\n const notifySpy = !this.owned_ && isSpyEnabled()\n const notify = hasListeners(this)\n const change: IArrayDidChange | null =\n notify || notifySpy\n ? ({\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index,\n newValue,\n oldValue\n } as const)\n : null\n\n // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n if (__DEV__ && notifySpy) {\n spyReportStart(change!)\n }\n this.atom_.reportChanged()\n if (notify) {\n notifyListeners(this, change)\n }\n if (__DEV__ && notifySpy) {\n spyReportEnd()\n }\n }\n\n notifyArraySplice_(index: number, added: any[], removed: any[]) {\n const notifySpy = !this.owned_ && isSpyEnabled()\n const notify = hasListeners(this)\n const change: IArraySplice | null =\n notify || notifySpy\n ? ({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index,\n removed,\n added,\n removedCount: removed.length,\n addedCount: added.length\n } as const)\n : null\n\n if (__DEV__ && notifySpy) {\n spyReportStart(change!)\n }\n this.atom_.reportChanged()\n // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n if (notify) {\n notifyListeners(this, change)\n }\n if (__DEV__ && notifySpy) {\n spyReportEnd()\n }\n }\n\n get_(index: number): any | undefined {\n if (this.legacyMode_ && index >= this.values_.length) {\n console.warn(\n __DEV__\n ? `[mobx.array] Attempt to read an array index (${index}) that is out of bounds (${this.values_.length}). Please check length first. Out of bound indices will not be tracked by MobX`\n : `[mobx] Out of bounds read: ${index}`\n )\n return undefined\n }\n this.atom_.reportObserved()\n return this.dehanceValue_(this.values_[index])\n }\n\n set_(index: number, newValue: any) {\n const values = this.values_\n if (this.legacyMode_ && index > values.length) {\n // out of bounds\n die(17, index, values.length)\n }\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_)\n const oldValue = values[index]\n if (hasInterceptors(this)) {\n const change = interceptChange<IArrayWillChange<any>>(this as any, {\n type: UPDATE,\n object: this.proxy_ as any, // since \"this\" is the real array we need to pass its proxy\n index,\n newValue\n })\n if (!change) {\n return\n }\n newValue = change.newValue\n }\n newValue = this.enhancer_(newValue, oldValue)\n const changed = newValue !== oldValue\n if (changed) {\n values[index] = newValue\n this.notifyArrayChildUpdate_(index, newValue, oldValue)\n }\n } else {\n // For out of bound index, we don't create an actual sparse array,\n // but rather fill the holes with undefined (same as setArrayLength_).\n // This could be considered a bug.\n const newItems = new Array(index + 1 - values.length)\n for (let i = 0; i < newItems.length - 1; i++) {\n newItems[i] = undefined\n } // No Array.fill everywhere...\n newItems[newItems.length - 1] = newValue\n this.spliceWithArray_(values.length, 0, newItems)\n }\n }\n}\n\nexport function createObservableArray<T>(\n initialValues: T[] | undefined,\n enhancer: IEnhancer<T>,\n name = __DEV__ ? \"ObservableArray@\" + getNextId() : \"ObservableArray\",\n owned = false\n): IObservableArray<T> {\n assertProxies()\n return initObservable(() => {\n const adm = new ObservableArrayAdministration(name, enhancer, owned, false)\n addHiddenFinalProp(adm.values_, $mobx, adm)\n const proxy = new Proxy(adm.values_, arrayTraps) as any\n adm.proxy_ = proxy\n if (initialValues && initialValues.length) {\n adm.spliceWithArray_(0, 0, initialValues)\n }\n return proxy\n })\n}\n\n// eslint-disable-next-line\nexport var arrayExtensions = {\n clear(): any[] {\n return this.splice(0)\n },\n\n replace(newItems: any[]) {\n const adm: ObservableArrayAdministration = this[$mobx]\n return adm.spliceWithArray_(0, adm.values_.length, newItems)\n },\n\n // Used by JSON.stringify\n toJSON(): any[] {\n return this.slice()\n },\n\n /*\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\n * since these functions alter the inner structure of the array, the have side effects.\n * Because the have side effects, they should not be used in computed function,\n * and for that reason the do not call dependencyState.notifyObserved\n */\n splice(index: number, deleteCount?: number, ...newItems: any[]): any[] {\n const adm: ObservableArrayAdministration = this[$mobx]\n switch (arguments.length) {\n case 0:\n return []\n case 1:\n return adm.spliceWithArray_(index)\n case 2:\n return adm.spliceWithArray_(index, deleteCount)\n }\n return adm.spliceWithArray_(index, deleteCount, newItems)\n },\n\n spliceWithArray(index: number, deleteCount?: number, newItems?: any[]): any[] {\n return (this[$mobx] as ObservableArrayAdministration).spliceWithArray_(\n index,\n deleteCount,\n newItems\n )\n },\n\n push(...items: any[]): number {\n const adm: ObservableArrayAdministration = this[$mobx]\n adm.spliceWithArray_(adm.values_.length, 0, items)\n return adm.values_.length\n },\n\n pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0]\n },\n\n shift() {\n return this.splice(0, 1)[0]\n },\n\n unshift(...items: any[]): number {\n const adm: ObservableArrayAdministration = this[$mobx]\n adm.spliceWithArray_(0, 0, items)\n return adm.values_.length\n },\n\n reverse(): any[] {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\")\n }\n this.replace(this.slice().reverse())\n return this\n },\n\n sort(): any[] {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\")\n }\n const copy = this.slice()\n copy.sort.apply(copy, arguments)\n this.replace(copy)\n return this\n },\n\n remove(value: any): boolean {\n const adm: ObservableArrayAdministration = this[$mobx]\n const idx = adm.dehanceValues_(adm.values_).indexOf(value)\n if (idx > -1) {\n this.splice(idx, 1)\n return true\n }\n return false\n }\n}\n\n/**\n * Wrap function from prototype\n * Without this, everything works as well, but this works\n * faster as everything works on unproxied values\n */\naddArrayExtension(\"at\", simpleFunc)\naddArrayExtension(\"concat\", simpleFunc)\naddArrayExtension(\"flat\", simpleFunc)\naddArrayExtension(\"includes\", simpleFunc)\naddArrayExtension(\"indexOf\", simpleFunc)\naddArrayExtension(\"join\", simpleFunc)\naddArrayExtension(\"lastIndexOf\", simpleFunc)\naddArrayExtension(\"slice\", simpleFunc)\naddArrayExtension(\"toString\", simpleFunc)\naddArrayExtension(\"toLocaleString\", simpleFunc)\naddArrayExtension(\"toSorted\", simpleFunc)\naddArrayExtension(\"toSpliced\", simpleFunc)\naddArrayExtension(\"with\", simpleFunc)\n// map\naddArrayExtension(\"every\", mapLikeFunc)\naddArrayExtension(\"filter\", mapLikeFunc)\naddArrayExtension(\"find\", mapLikeFunc)\naddArrayExtension(\"findIndex\", mapLikeFunc)\naddArrayExtension(\"findLast\", mapLikeFunc)\naddArrayExtension(\"findLastIndex\", mapLikeFunc)\naddArrayExtension(\"flatMap\", mapLikeFunc)\naddArrayExtension(\"forEach\", mapLikeFunc)\naddArrayExtension(\"map\", mapLikeFunc)\naddArrayExtension(\"some\", mapLikeFunc)\naddArrayExtension(\"toReversed\", mapLikeFunc)\n// reduce\naddArrayExtension(\"reduce\", reduceLikeFunc)\naddArrayExtension(\"reduceRight\", reduceLikeFunc)\n\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName)\n }\n}\n\n// Report and delegate to dehanced array\nfunction simpleFunc(funcName) {\n return function () {\n const adm: ObservableArrayAdministration = this[$mobx]\n adm.atom_.reportObserved()\n const dehancedValues = adm.dehanceValues_(adm.values_)\n return dehancedValues[funcName].apply(dehancedValues, arguments)\n }\n}\n\n// Make sure callbacks receive correct array arg #2326\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n const adm: ObservableArrayAdministration = this[$mobx]\n adm.atom_.reportObserved()\n const dehancedValues = adm.dehanceValues_(adm.values_)\n return dehancedValues[funcName]((element, index) => {\n return callback.call(thisArg, element, index, this)\n })\n }\n}\n\n// Make sure callbacks receive correct array arg #2326\nfunction reduceLikeFunc(funcName) {\n return function () {\n const adm: ObservableArrayAdministration = this[$mobx]\n adm.atom_.reportObserved()\n const dehancedValues = adm.dehanceValues_(adm.values_)\n // #2432 - reduce behavior depends on arguments.length\n const callback = arguments[0]\n arguments[0] = (accumulator, currentValue, index) => {\n return callback(accumulator, currentValue, index, this)\n }\n return dehancedValues[funcName].apply(dehancedValues, arguments)\n }\n}\n\nconst isObservableArrayAdministration = createInstanceofPredicate(\n \"ObservableArrayAdministration\",\n ObservableArrayAdministration\n)\n\nexport function isObservableArray(thing): thing is IObservableArray<any> {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx])\n}\n", "import {\n $mobx,\n IEnhancer,\n IInterceptable,\n IInterceptor,\n IListenable,\n Lambda,\n ObservableValue,\n checkIfStateModificationsAreAllowed,\n createAtom,\n createInstanceofPredicate,\n makeIterable,\n deepEnhancer,\n getNextId,\n getPlainObjectKeys,\n hasInterceptors,\n hasListeners,\n interceptChange,\n isES6Map,\n isPlainES6Map,\n isPlainObject,\n isSpyEnabled,\n notifyListeners,\n referenceEnhancer,\n registerInterceptor,\n registerListener,\n spyReportEnd,\n spyReportStart,\n stringifyKey,\n transaction,\n untracked,\n onBecomeUnobserved,\n globalState,\n die,\n isFunction,\n UPDATE,\n IAtom,\n PureSpyEvent,\n initObservable\n} from \"../internal\"\n\nexport interface IKeyValueMap<V = any> {\n [key: string]: V\n}\n\nexport type IMapEntry<K = any, V = any> = [K, V]\nexport type IReadonlyMapEntry<K = any, V = any> = readonly [K, V]\nexport type IMapEntries<K = any, V = any> = IMapEntry<K, V>[]\nexport type IReadonlyMapEntries<K = any, V = any> = IReadonlyMapEntry<K, V>[]\n\nexport type IMapDidChange<K = any, V = any> = { observableKind: \"map\"; debugObjectName: string } & (\n | {\n object: ObservableMap<K, V>\n name: K // actual the key or index, but this is based on the ancient .observe proposal for consistency\n type: \"update\"\n newValue: V\n oldValue: V\n }\n | {\n object: ObservableMap<K, V>\n name: K\n type: \"add\"\n newValue: V\n }\n | {\n object: ObservableMap<K, V>\n name: K\n type: \"delete\"\n oldValue: V\n }\n)\n\nexport interface IMapWillChange<K = any, V = any> {\n object: ObservableMap<K, V>\n type: \"update\" | \"add\" | \"delete\"\n name: K\n newValue?: V\n}\n\nconst ObservableMapMarker = {}\n\nexport const ADD = \"add\"\nexport const DELETE = \"delete\"\n\nexport type IObservableMapInitialValues<K = any, V = any> =\n | IMapEntries<K, V>\n | IReadonlyMapEntries<K, V>\n | IKeyValueMap<V>\n | Map<K, V>\n\n// just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\nexport class ObservableMap<K = any, V = any>\n implements Map<K, V>, IInterceptable<IMapWillChange<K, V>>, IListenable\n{\n [$mobx] = ObservableMapMarker\n data_!: Map<K, ObservableValue<V>>\n hasMap_!: Map<K, ObservableValue<boolean>> // hasMap, not hashMap >-).\n keysAtom_!: IAtom\n interceptors_\n changeListeners_\n dehancer: any\n\n constructor(\n initialData?: IObservableMapInitialValues<K, V>,\n public enhancer_: IEnhancer<V> = deepEnhancer,\n public name_ = __DEV__ ? \"ObservableMap@\" + getNextId() : \"ObservableMap\"\n ) {\n if (!isFunction(Map)) {\n die(18)\n }\n initObservable(() => {\n this.keysAtom_ = createAtom(__DEV__ ? `${this.name_}.keys()` : \"ObservableMap.keys()\")\n this.data_ = new Map()\n this.hasMap_ = new Map()\n if (initialData) {\n this.merge(initialData)\n }\n })\n }\n\n private has_(key: K): boolean {\n return this.data_.has(key)\n }\n\n has(key: K): boolean {\n if (!globalState.trackingDerivation) {\n return this.has_(key)\n }\n\n let entry = this.hasMap_.get(key)\n if (!entry) {\n const newEntry = (entry = new ObservableValue(\n this.has_(key),\n referenceEnhancer,\n __DEV__ ? `${this.name_}.${stringifyKey(key)}?` : \"ObservableMap.key?\",\n false\n ))\n this.hasMap_.set(key, newEntry)\n onBecomeUnobserved(newEntry, () => this.hasMap_.delete(key))\n }\n\n return entry.get()\n }\n\n set(key: K, value: V) {\n const hasKey = this.has_(key)\n if (hasInterceptors(this)) {\n const change = interceptChange<IMapWillChange<K, V>>(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n })\n if (!change) {\n return this\n }\n value = change.newValue!\n }\n if (hasKey) {\n this.updateValue_(key, value)\n } else {\n this.addValue_(key, value)\n }\n return this\n }\n\n delete(key: K): boolean {\n checkIfStateModificationsAreAllowed(this.keysAtom_)\n if (hasInterceptors(this)) {\n const change = interceptChange<IMapWillChange<K, V>>(this, {\n type: DELETE,\n object: this,\n name: key\n })\n if (!change) {\n return false\n }\n }\n if (this.has_(key)) {\n const notifySpy = isSpyEnabled()\n const notify = hasListeners(this)\n const change: IMapDidChange<K, V> | null =\n notify || notifySpy\n ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: (<any>this.data_.get(key)).value_,\n name: key\n }\n : null\n\n if (__DEV__ && notifySpy) {\n spyReportStart(change! as PureSpyEvent)\n } // TODO fix type\n transaction(() => {\n this.keysAtom_.reportChanged()\n this.hasMap_.get(key)?.setNewValue_(false)\n const observable = this.data_.get(key)!\n observable.setNewValue_(undefined as any)\n this.data_.delete(key)\n })\n if (notify) {\n notifyListeners(this, change)\n }\n if (__DEV__ && notifySpy) {\n spyReportEnd()\n }\n return true\n }\n return false\n }\n\n private updateValue_(key: K, newValue: V | undefined) {\n const observable = this.data_.get(key)!\n newValue = (observable as any).prepareNewValue_(newValue) as V\n if (newValue !== globalState.UNCHANGED) {\n const notifySpy = isSpyEnabled()\n const notify = hasListeners(this)\n const change: IMapDidChange<K, V> | null =\n notify || notifySpy\n ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: (observable as any).value_,\n name: key,\n newValue\n }\n : null\n if (__DEV__ && notifySpy) {\n spyReportStart(change! as PureSpyEvent)\n } // TODO fix type\n observable.setNewValue_(newValue as V)\n if (notify) {\n notifyListeners(this, change)\n }\n if (__DEV__ && notifySpy) {\n spyReportEnd()\n }\n }\n }\n\n private addValue_(key: K, newValue: V) {\n checkIfStateModificationsAreAllowed(this.keysAtom_)\n transaction(() => {\n const observable = new ObservableValue(\n newValue,\n this.enhancer_,\n __DEV__ ? `${this.name_}.${stringifyKey(key)}` : \"ObservableMap.key\",\n false\n )\n this.data_.set(key, observable)\n newValue = (observable as any).value_ // value might have been changed\n this.hasMap_.get(key)?.setNewValue_(true)\n this.keysAtom_.reportChanged()\n })\n const notifySpy = isSpyEnabled()\n const notify = hasListeners(this)\n const change: IMapDidChange<K, V> | null =\n notify || notifySpy\n ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue\n }\n : null\n if (__DEV__ && notifySpy) {\n spyReportStart(change! as PureSpyEvent)\n } // TODO fix type\n if (notify) {\n notifyListeners(this, change)\n }\n if (__DEV__ && notifySpy) {\n spyReportEnd()\n }\n }\n\n get(key: K): V | undefined {\n if (this.has(key)) {\n return this.dehanceValue_(this.data_.get(key)!.get())\n }\n return this.dehanceValue_(undefined)\n }\n\n private dehanceValue_<X extends V | undefined>(value: X): X {\n if (this.dehancer !== undefined) {\n return this.dehancer(value)\n }\n return value\n }\n\n keys(): MapIterator<K> {\n this.keysAtom_.reportObserved()\n return this.data_.keys()\n }\n\n values(): MapIterator<V> {\n const self = this\n const keys = this.keys()\n return makeIterableForMap({\n next() {\n const { done, value } = keys.next()\n return {\n done,\n value: done ? (undefined as any) : self.get(value)\n }\n }\n })\n }\n\n entries(): MapIterator<IMapEntry<K, V>> {\n const self = this\n const keys = this.keys()\n return makeIterableForMap({\n next() {\n const { done, value } = keys.next()\n return {\n done,\n value: done ? (undefined as any) : ([value, self.get(value)!] as [K, V])\n }\n }\n })\n }\n\n [Symbol.iterator]() {\n return this.entries()\n }\n\n forEach(callback: (value: V, key: K, object: Map<K, V>) => void, thisArg?) {\n for (const [key, value] of this) {\n callback.call(thisArg, value, key, this)\n }\n }\n\n /** Merge another object into this object, returns this. */\n merge(other?: IObservableMapInitialValues<K, V>): ObservableMap<K, V> {\n if (isObservableMap(other)) {\n other = new Map(other)\n }\n transaction(() => {\n if (isPlainObject(other)) {\n getPlainObjectKeys(other).forEach((key: any) =>\n this.set(key as K, (other as IKeyValueMap)[key])\n )\n } else if (Array.isArray(other)) {\n other.forEach(([key, value]) => this.set(key, value))\n } else if (isES6Map(other)) {\n if (!isPlainES6Map(other)) {\n die(19, other)\n }\n other.forEach((value, key) => this.set(key, value))\n } else if (other !== null && other !== undefined) {\n die(20, other)\n }\n })\n return this\n }\n\n clear() {\n transaction(() => {\n untracked(() => {\n for (const key of this.keys()) {\n this.delete(key)\n }\n })\n })\n }\n\n replace(values: IObservableMapInitialValues<K, V>): ObservableMap<K, V> {\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(() => {\n // Convert to map so we can do quick key lookups\n const replacementMap = convertToMap(values)\n const orderedData = new Map()\n // Used for optimization\n let keysReportChangedCalled = false\n // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n for (const key of this.data_.keys()) {\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n const deleted = this.delete(key)\n // Was the key removed?\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true\n } else {\n // Delete prevented by interceptor\n const value = this.data_.get(key)\n orderedData.set(key, value)\n }\n }\n }\n // Merge entries\n for (const [key, value] of replacementMap.entries()) {\n // We will want to know whether a new key is added\n const keyExisted = this.data_.has(key)\n // Add or update value\n this.set(key, value)\n // The addition could have been prevent by interceptor\n if (this.data_.has(key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n const value = this.data_.get(key)\n orderedData.set(key, value)\n // Was a new key added?\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true\n }\n }\n }\n // Check for possible key order change\n if (!keysReportChangedCalled) {\n if (this.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n this.keysAtom_.reportChanged()\n } else {\n const iter1 = this.data_.keys()\n const iter2 = orderedData.keys()\n let next1 = iter1.next()\n let next2 = iter2.next()\n while (!next1.done) {\n if (next1.value !== next2.value) {\n this.keysAtom_.reportChanged()\n break\n }\n next1 = iter1.next()\n next2 = iter2.next()\n }\n }\n }\n // Use correctly ordered map\n this.data_ = orderedData\n })\n return this\n }\n\n get size(): number {\n this.keysAtom_.reportObserved()\n return this.data_.size\n }\n\n toString(): string {\n return \"[object ObservableMap]\"\n }\n\n toJSON(): [K, V][] {\n return Array.from(this)\n }\n\n get [Symbol.toStringTag]() {\n return \"Map\"\n }\n\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */\n observe_(listener: (changes: IMapDidChange<K, V>) => void, fireImmediately?: boolean): Lambda {\n if (__DEV__ && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with maps.\")\n }\n return registerListener(this, listener)\n }\n\n intercept_(handler: IInterceptor<IMapWillChange<K, V>>): Lambda {\n return registerInterceptor(this, handler)\n }\n}\n\n// eslint-disable-next-line\nexport var isObservableMap = createInstanceofPredicate(\"ObservableMap\", ObservableMap) as (\n thing: any\n) => thing is ObservableMap<any, any>\n\nfunction makeIterableForMap<T>(iterator: Iterator<T>): MapIterator<T> {\n iterator[Symbol.toStringTag] = \"MapIterator\"\n return makeIterable<T, BuiltinIteratorReturn>(iterator)\n}\n\nfunction convertToMap(dataStructure: any): Map<any, any> {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure)\n } else if (isPlainObject(dataStructure)) {\n const map = new Map()\n for (const key in dataStructure) {\n map.set(key, dataStructure[key])\n }\n return map\n } else {\n return die(21, dataStructure)\n }\n}\n", "import {\n $mobx,\n createAtom,\n deepEnhancer,\n getNextId,\n IEnhancer,\n isSpyEnabled,\n hasListeners,\n IListenable,\n registerListener,\n Lambda,\n spyReportStart,\n notifyListeners,\n spyReportEnd,\n createInstanceofPredicate,\n makeIterable,\n hasInterceptors,\n interceptChange,\n IInterceptable,\n IInterceptor,\n registerInterceptor,\n checkIfStateModificationsAreAllowed,\n untracked,\n transaction,\n isES6Set,\n IAtom,\n DELETE,\n ADD,\n die,\n isFunction,\n initObservable\n} from \"../internal\"\n\nconst ObservableSetMarker = {}\n\nexport type IObservableSetInitialValues<T> = Set<T> | readonly T[]\n\nexport type ISetDidChange<T = any> =\n | {\n object: ObservableSet<T>\n observableKind: \"set\"\n debugObjectName: string\n type: \"add\"\n newValue: T\n }\n | {\n object: ObservableSet<T>\n observableKind: \"set\"\n debugObjectName: string\n type: \"delete\"\n oldValue: T\n }\n\nexport type ISetWillChange<T = any> =\n | {\n type: \"delete\"\n object: ObservableSet<T>\n oldValue: T\n }\n | {\n type: \"add\"\n object: ObservableSet<T>\n newValue: T\n }\n\nexport class ObservableSet<T = any> implements Set<T>, IInterceptable<ISetWillChange>, IListenable {\n [$mobx] = ObservableSetMarker\n private data_: Set<any> = new Set()\n atom_!: IAtom\n changeListeners_\n interceptors_\n dehancer: any\n enhancer_: (newV: any, oldV: any | undefined) => any\n\n constructor(\n initialData?: IObservableSetInitialValues<T>,\n enhancer: IEnhancer<T> = deepEnhancer,\n public name_ = __DEV__ ? \"ObservableSet@\" + getNextId() : \"ObservableSet\"\n ) {\n if (!isFunction(Set)) {\n die(22)\n }\n this.enhancer_ = (newV, oldV) => enhancer(newV, oldV, name_)\n initObservable(() => {\n this.atom_ = createAtom(this.name_)\n if (initialData) {\n this.replace(initialData)\n }\n })\n }\n\n private dehanceValue_<X extends T | undefined>(value: X): X {\n if (this.dehancer !== undefined) {\n return this.dehancer(value)\n }\n return value\n }\n\n clear() {\n transaction(() => {\n untracked(() => {\n for (const value of this.data_.values()) {\n this.delete(value)\n }\n })\n })\n }\n\n forEach(callbackFn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any) {\n for (const value of this) {\n callbackFn.call(thisArg, value, value, this)\n }\n }\n\n get size() {\n this.atom_.reportObserved()\n return this.data_.size\n }\n\n add(value: T) {\n checkIfStateModificationsAreAllowed(this.atom_)\n if (hasInterceptors(this)) {\n const change = interceptChange<ISetWillChange<T>>(this, {\n type: ADD,\n object: this,\n newValue: value\n })\n if (!change) {\n return this\n }\n // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n }\n if (!this.has(value)) {\n transaction(() => {\n this.data_.add(this.enhancer_(value, undefined))\n this.atom_.reportChanged()\n })\n const notifySpy = __DEV__ && isSpyEnabled()\n const notify = hasListeners(this)\n const change =\n notify || notifySpy\n ? <ISetDidChange<T>>{\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n }\n : null\n if (notifySpy && __DEV__) {\n spyReportStart(change!)\n }\n if (notify) {\n notifyListeners(this, change)\n }\n if (notifySpy && __DEV__) {\n spyReportEnd()\n }\n }\n\n return this\n }\n\n delete(value: T) {\n if (hasInterceptors(this)) {\n const change = interceptChange<ISetWillChange<T>>(this, {\n type: DELETE,\n object: this,\n oldValue: value\n })\n if (!change) {\n return false\n }\n }\n if (this.has(value)) {\n const notifySpy = __DEV__ && isSpyEnabled()\n const notify = hasListeners(this)\n const change =\n notify || notifySpy\n ? <ISetDidChange<T>>{\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n }\n : null\n\n if (notifySpy && __DEV__) {\n spyReportStart(change!)\n }\n transaction(() => {\n this.atom_.reportChanged()\n this.data_.delete(value)\n })\n if (notify) {\n notifyListeners(this, change)\n }\n if (notifySpy && __DEV__) {\n spyReportEnd()\n }\n return true\n }\n return false\n }\n\n has(value: T) {\n this.atom_.reportObserved()\n return this.data_.has(this.dehanceValue_(value))\n }\n\n entries() {\n const values = this.values()\n return makeIterableForSet<[T, T]>({\n next() {\n const { value, done } = values.next()\n return !done ? { value: [value, value], done } : { value: undefined, done }\n }\n })\n }\n\n keys(): SetIterator<T> {\n return this.values()\n }\n\n values(): SetIterator<T> {\n this.atom_.reportObserved()\n const self = this\n const values = this.data_.values()\n return makeIterableForSet({\n next() {\n const { value, done } = values.next()\n return !done\n ? { value: self.dehanceValue_(value), done }\n : { value: undefined, done }\n }\n })\n }\n\n intersection<U>(otherSet: ReadonlySetLike<U> | Set<U>): Set<T & U> {\n if (isES6Set(otherSet) && !isObservableSet(otherSet)) {\n return otherSet.intersection(this)\n } else {\n const dehancedSet = new Set(this)\n return dehancedSet.intersection(otherSet)\n }\n }\n\n union<U>(otherSet: ReadonlySetLike<U> | Set<U>): Set<T | U> {\n if (isES6Set(otherSet) && !isObservableSet(otherSet)) {\n return otherSet.union(this)\n } else {\n const dehancedSet = new Set(this)\n return dehancedSet.union(otherSet)\n }\n }\n\n difference<U>(otherSet: ReadonlySetLike<U>): Set<T> {\n return new Set(this).difference(otherSet)\n }\n\n symmetricDifference<U>(otherSet: ReadonlySetLike<U> | Set<U>): Set<T | U> {\n if (isES6Set(otherSet) && !isObservableSet(otherSet)) {\n return otherSet.symmetricDifference(this)\n } else {\n const dehancedSet = new Set(this)\n return dehancedSet.symmetricDifference(otherSet)\n }\n }\n\n isSubsetOf(otherSet: ReadonlySetLike<unknown>): boolean {\n return new Set(this).isSubsetOf(otherSet)\n }\n\n isSupersetOf(otherSet: ReadonlySetLike<unknown>): boolean {\n return new Set(this).isSupersetOf(otherSet)\n }\n\n isDisjointFrom(otherSet: ReadonlySetLike<unknown> | Set<unknown>): boolean {\n if (isES6Set(otherSet) && !isObservableSet(otherSet)) {\n return otherSet.isDisjointFrom(this)\n } else {\n const dehancedSet = new Set(this)\n return dehancedSet.isDisjointFrom(otherSet)\n }\n }\n\n replace(other: ObservableSet<T> | IObservableSetInitialValues<T>): ObservableSet<T> {\n if (isObservableSet(other)) {\n other = new Set(other)\n }\n\n transaction(() => {\n if (Array.isArray(other)) {\n this.clear()\n other.forEach(value => this.add(value))\n } else if (isES6Set(other)) {\n this.clear()\n other.forEach(value => this.add(value))\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other)\n }\n })\n\n return this\n }\n observe_(listener: (changes: ISetDidChange<T>) => void, fireImmediately?: boolean): Lambda {\n // ... 'fireImmediately' could also be true?\n if (__DEV__ && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with sets.\")\n }\n return registerListener(this, listener)\n }\n\n intercept_(handler: IInterceptor<ISetWillChange<T>>): Lambda {\n return registerInterceptor(this, handler)\n }\n\n toJSON(): T[] {\n return Array.from(this)\n }\n\n toString(): string {\n return \"[object ObservableSet]\"\n }\n\n [Symbol.iterator]() {\n return this.values()\n }\n\n get [Symbol.toStringTag]() {\n return \"Set\"\n }\n}\n\n// eslint-disable-next-line\nexport var isObservableSet = createInstanceofPredicate(\"ObservableSet\", ObservableSet) as (\n thing: any\n) => thing is ObservableSet<any>\n\nfunction makeIterableForSet<T>(iterator: Iterator<T>): SetIterator<T> {\n iterator[Symbol.toStringTag] = \"SetIterator\"\n return makeIterable<T, BuiltinIteratorReturn>(iterator)\n}\n", "import {\n CreateObservableOptions,\n getAnnotationFromOptions,\n propagateChanged,\n isAnnotation,\n $mobx,\n Atom,\n Annotation,\n ComputedValue,\n IAtom,\n IComputedValueOptions,\n IEnhancer,\n IInterceptable,\n IListenable,\n Lambda,\n ObservableValue,\n addHiddenProp,\n createInstanceofPredicate,\n endBatch,\n getNextId,\n hasInterceptors,\n hasListeners,\n interceptChange,\n isObject,\n isPlainObject,\n isSpyEnabled,\n notifyListeners,\n referenceEnhancer,\n registerInterceptor,\n registerListener,\n spyReportEnd,\n spyReportStart,\n startBatch,\n stringifyKey,\n globalState,\n ADD,\n UPDATE,\n die,\n hasProp,\n getDescriptor,\n storedAnnotationsSymbol,\n ownKeys,\n isOverride,\n defineProperty,\n autoAnnotation,\n getAdministration,\n getDebugName,\n objectPrototype,\n MakeResult,\n checkIfStateModificationsAreAllowed\n} from \"../internal\"\n\nconst descriptorCache = Object.create(null)\n\nexport type IObjectDidChange<T = any> = {\n observableKind: \"object\"\n name: PropertyKey\n object: T\n debugObjectName: string\n} & (\n | {\n type: \"add\"\n newValue: any\n }\n | {\n type: \"update\"\n oldValue: any\n newValue: any\n }\n | {\n type: \"remove\"\n oldValue: any\n }\n)\n\nexport type IObjectWillChange<T = any> =\n | {\n object: T\n type: \"update\" | \"add\"\n name: PropertyKey\n newValue: any\n }\n | {\n object: T\n type: \"remove\"\n name: PropertyKey\n }\n\nconst REMOVE = \"remove\"\n\nexport class ObservableObjectAdministration\n implements IInterceptable<IObjectWillChange>, IListenable\n{\n keysAtom_: IAtom\n changeListeners_\n interceptors_\n proxy_: any\n isPlainObject_: boolean\n appliedAnnotations_?: object\n private pendingKeys_: undefined | Map<PropertyKey, ObservableValue<boolean>>\n\n constructor(\n public target_: any,\n public values_ = new Map<PropertyKey, ObservableValue<any> | ComputedValue<any>>(),\n public name_: string,\n // Used anytime annotation is not explicitely provided\n public defaultAnnotation_: Annotation = autoAnnotation\n ) {\n this.keysAtom_ = new Atom(__DEV__ ? `${this.name_}.keys` : \"ObservableObject.keys\")\n // Optimization: we use this frequently\n this.isPlainObject_ = isPlainObject(this.target_)\n if (__DEV__ && !isAnnotation(this.defaultAnnotation_)) {\n die(`defaultAnnotation must be valid annotation`)\n }\n if (__DEV__) {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {}\n }\n }\n\n getObservablePropValue_(key: PropertyKey): any {\n return this.values_.get(key)!.get()\n }\n\n setObservablePropValue_(key: PropertyKey, newValue): boolean | null {\n const observable = this.values_.get(key)\n if (observable instanceof ComputedValue) {\n observable.set(newValue)\n return true\n }\n\n // intercept\n if (hasInterceptors(this)) {\n const change = interceptChange<IObjectWillChange>(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue\n })\n if (!change) {\n return null\n }\n newValue = (change as any).newValue\n }\n newValue = (observable as any).prepareNewValue_(newValue)\n\n // notify spy & observers\n if (newValue !== globalState.UNCHANGED) {\n const notify = hasListeners(this)\n const notifySpy = __DEV__ && isSpyEnabled()\n const change: IObjectDidChange | null =\n notify || notifySpy\n ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: (observable as any).value_,\n name: key,\n newValue\n }\n : null\n\n if (__DEV__ && notifySpy) {\n spyReportStart(change!)\n }\n ;(observable as ObservableValue<any>).setNewValue_(newValue)\n if (notify) {\n notifyListeners(this, change)\n }\n if (__DEV__ && notifySpy) {\n spyReportEnd()\n }\n }\n return true\n }\n\n get_(key: PropertyKey): any {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key)\n }\n return this.target_[key]\n }\n\n /**\n * @param {PropertyKey} key\n * @param {any} value\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */\n set_(key: PropertyKey, value: any, proxyTrap: boolean = false): boolean | null {\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value)\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value)\n } else {\n // Non-observable\n this.target_[key] = value\n return true\n }\n } else {\n // New prop\n return this.extend_(\n key,\n { value, enumerable: true, writable: true, configurable: true },\n this.defaultAnnotation_,\n proxyTrap\n )\n }\n }\n\n // Trap for \"in\"\n has_(key: PropertyKey): boolean {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_\n }\n this.pendingKeys_ ||= new Map()\n let entry = this.pendingKeys_.get(key)\n if (!entry) {\n entry = new ObservableValue(\n key in this.target_,\n referenceEnhancer,\n __DEV__ ? `${this.name_}.${stringifyKey(key)}?` : \"ObservableObject.key?\",\n false\n )\n this.pendingKeys_.set(key, entry)\n }\n return entry.get()\n }\n\n /**\n * @param {PropertyKey} key\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\n */\n make_(key: PropertyKey, annotation: Annotation | boolean): void {\n if (annotation === true) {\n annotation = this.defaultAnnotation_\n }\n if (annotation === false) {\n return\n }\n assertAnnotable(this, annotation, key)\n if (!(key in this.target_)) {\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if (this.target_[storedAnnotationsSymbol]?.[key]) {\n return // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, `${this.name_}.${key.toString()}`)\n }\n }\n let source = this.target_\n while (source && source !== objectPrototype) {\n const descriptor = getDescriptor(source, key)\n if (descriptor) {\n const outcome = annotation.make_(this, key, descriptor, source)\n if (outcome === MakeResult.Cancel) {\n return\n }\n if (outcome === MakeResult.Break) {\n break\n }\n }\n source = Object.getPrototypeOf(source)\n }\n recordAnnotationApplied(this, annotation, key)\n }\n\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */\n extend_(\n key: PropertyKey,\n descriptor: PropertyDescriptor,\n annotation: Annotation | boolean,\n proxyTrap: boolean = false\n ): boolean | null {\n if (annotation === true) {\n annotation = this.defaultAnnotation_\n }\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap)\n }\n assertAnnotable(this, annotation, key)\n const outcome = annotation.extend_(this, key, descriptor, proxyTrap)\n if (outcome) {\n recordAnnotationApplied(this, annotation, key)\n }\n return outcome\n }\n\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */\n defineProperty_(\n key: PropertyKey,\n descriptor: PropertyDescriptor,\n proxyTrap: boolean = false\n ): boolean | null {\n checkIfStateModificationsAreAllowed(this.keysAtom_)\n try {\n startBatch()\n\n // Delete\n const deleteOutcome = this.delete_(key)\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome\n }\n\n // ADD interceptor\n if (hasInterceptors(this)) {\n const change = interceptChange<IObjectWillChange>(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n })\n if (!change) {\n return null\n }\n const { newValue } = change as any\n if (descriptor.value !== newValue) {\n descriptor = {\n ...descriptor,\n value: newValue\n }\n }\n }\n\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false\n }\n } else {\n defineProperty(this.target_, key, descriptor)\n }\n\n // Notify\n this.notifyPropertyAddition_(key, descriptor.value)\n } finally {\n endBatch()\n }\n return true\n }\n\n // If original descriptor becomes relevant, move this to annotation directly\n defineObservableProperty_(\n key: PropertyKey,\n value: any,\n enhancer: IEnhancer<any>,\n proxyTrap: boolean = false\n ): boolean | null {\n checkIfStateModificationsAreAllowed(this.keysAtom_)\n try {\n startBatch()\n\n // Delete\n const deleteOutcome = this.delete_(key)\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome\n }\n\n // ADD interceptor\n if (hasInterceptors(this)) {\n const change = interceptChange<IObjectWillChange>(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n })\n if (!change) {\n return null\n }\n value = (change as any).newValue\n }\n\n const cachedDescriptor = getCachedObservablePropDescriptor(key)\n const descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }\n\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false\n }\n } else {\n defineProperty(this.target_, key, descriptor)\n }\n\n const observable = new ObservableValue(\n value,\n enhancer,\n __DEV__ ? `${this.name_}.${key.toString()}` : \"ObservableObject.key\",\n false\n )\n\n this.values_.set(key, observable)\n\n // Notify (value possibly changed by ObservableValue)\n this.notifyPropertyAddition_(key, observable.value_)\n } finally {\n endBatch()\n }\n return true\n }\n\n // If original descriptor becomes relevant, move this to annotation directly\n defineComputedProperty_(\n key: PropertyKey,\n options: IComputedValueOptions<any>,\n proxyTrap: boolean = false\n ): boolean | null {\n checkIfStateModificationsAreAllowed(this.keysAtom_)\n try {\n startBatch()\n\n // Delete\n const deleteOutcome = this.delete_(key)\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome\n }\n\n // ADD interceptor\n if (hasInterceptors(this)) {\n const change = interceptChange<IObjectWillChange>(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n })\n if (!change) {\n return null\n }\n }\n options.name ||= __DEV__ ? `${this.name_}.${key.toString()}` : \"ObservableObject.key\"\n options.context = this.proxy_ || this.target_\n const cachedDescriptor = getCachedObservablePropDescriptor(key)\n const descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }\n\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false\n }\n } else {\n defineProperty(this.target_, key, descriptor)\n }\n\n this.values_.set(key, new ComputedValue(options))\n\n // Notify\n this.notifyPropertyAddition_(key, undefined)\n } finally {\n endBatch()\n }\n return true\n }\n\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */\n delete_(key: PropertyKey, proxyTrap: boolean = false): boolean | null {\n checkIfStateModificationsAreAllowed(this.keysAtom_)\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true\n }\n\n // Intercept\n if (hasInterceptors(this)) {\n const change = interceptChange<IObjectWillChange>(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n })\n // Cancelled\n if (!change) {\n return null\n }\n }\n\n // Delete\n try {\n startBatch()\n const notify = hasListeners(this)\n const notifySpy = __DEV__ && isSpyEnabled()\n const observable = this.values_.get(key)\n // Value needed for spies/listeners\n let value = undefined\n // Optimization: don't pull the value unless we will need it\n if (!observable && (notify || notifySpy)) {\n value = getDescriptor(this.target_, key)?.value\n }\n // delete prop (do first, may fail)\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false\n }\n } else {\n delete this.target_[key]\n }\n // Allow re-annotating this field\n if (__DEV__) {\n delete this.appliedAnnotations_![key]\n }\n // Clear observable\n if (observable) {\n this.values_.delete(key)\n // for computed, value is undefined\n if (observable instanceof ObservableValue) {\n value = observable.value_\n }\n // Notify: autorun(() => obj[key]), see #1796\n propagateChanged(observable)\n }\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged()\n\n // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n this.pendingKeys_?.get(key)?.set(key in this.target_)\n\n // Notify spies/listeners\n if (notify || notifySpy) {\n const change: IObjectDidChange = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n }\n if (__DEV__ && notifySpy) {\n spyReportStart(change!)\n }\n if (notify) {\n notifyListeners(this, change)\n }\n if (__DEV__ && notifySpy) {\n spyReportEnd()\n }\n }\n } finally {\n endBatch()\n }\n return true\n }\n\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */\n observe_(callback: (changes: IObjectDidChange) => void, fireImmediately?: boolean): Lambda {\n if (__DEV__ && fireImmediately === true) {\n die(\"`observe` doesn't support the fire immediately property for observable objects.\")\n }\n return registerListener(this, callback)\n }\n\n intercept_(handler): Lambda {\n return registerInterceptor(this, handler)\n }\n\n notifyPropertyAddition_(key: PropertyKey, value: any) {\n const notify = hasListeners(this)\n const notifySpy = __DEV__ && isSpyEnabled()\n if (notify || notifySpy) {\n const change: IObjectDidChange | null =\n notify || notifySpy\n ? ({\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } as const)\n : null\n\n if (__DEV__ && notifySpy) {\n spyReportStart(change!)\n }\n if (notify) {\n notifyListeners(this, change)\n }\n if (__DEV__ && notifySpy) {\n spyReportEnd()\n }\n }\n\n this.pendingKeys_?.get(key)?.set(true)\n\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged()\n }\n\n ownKeys_(): Array<string | symbol> {\n this.keysAtom_.reportObserved()\n return ownKeys(this.target_)\n }\n\n keys_(): PropertyKey[] {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved()\n return Object.keys(this.target_)\n }\n}\n\nexport interface IIsObservableObject {\n [$mobx]: ObservableObjectAdministration\n}\n\nexport function asObservableObject(\n target: any,\n options?: CreateObservableOptions\n): IIsObservableObject {\n if (__DEV__ && options && isObservableObject(target)) {\n die(`Options can't be provided for already observable objects.`)\n }\n\n if (hasProp(target, $mobx)) {\n if (__DEV__ && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\n `Cannot convert '${getDebugName(target)}' into observable object:` +\n `\\nThe target is already observable of different type.` +\n `\\nExtending builtins is not supported.`\n )\n }\n return target\n }\n\n if (__DEV__ && !Object.isExtensible(target)) {\n die(\"Cannot make the designated object observable; it is not extensible\")\n }\n\n const name =\n options?.name ??\n (__DEV__\n ? `${\n isPlainObject(target) ? \"ObservableObject\" : target.constructor.name\n }@${getNextId()}`\n : \"ObservableObject\")\n\n const adm = new ObservableObjectAdministration(\n target,\n new Map(),\n String(name),\n getAnnotationFromOptions(options)\n )\n\n addHiddenProp(target, $mobx, adm)\n\n return target\n}\n\nconst isObservableObjectAdministration = createInstanceofPredicate(\n \"ObservableObjectAdministration\",\n ObservableObjectAdministration\n)\n\nfunction getCachedObservablePropDescriptor(key) {\n return (\n descriptorCache[key] ||\n (descriptorCache[key] = {\n get() {\n return this[$mobx].getObservablePropValue_(key)\n },\n set(value) {\n return this[$mobx].setObservablePropValue_(key, value)\n }\n })\n )\n}\n\nexport function isObservableObject(thing: any): boolean {\n if (isObject(thing)) {\n return isObservableObjectAdministration((thing as any)[$mobx])\n }\n return false\n}\n\nexport function recordAnnotationApplied(\n adm: ObservableObjectAdministration,\n annotation: Annotation,\n key: PropertyKey\n) {\n if (__DEV__) {\n adm.appliedAnnotations_![key] = annotation\n }\n // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n delete adm.target_[storedAnnotationsSymbol]?.[key]\n}\n\nfunction assertAnnotable(\n adm: ObservableObjectAdministration,\n annotation: Annotation,\n key: PropertyKey\n) {\n // Valid annotation\n if (__DEV__ && !isAnnotation(annotation)) {\n die(`Cannot annotate '${adm.name_}.${key.toString()}': Invalid annotation.`)\n }\n\n /*\n // Configurable, not sealed, not frozen\n // Possibly not needed, just a little better error then the one thrown by engine.\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\n if (__DEV__) {\n const configurable = getDescriptor(adm.target_, key)?.configurable\n const frozen = Object.isFrozen(adm.target_)\n const sealed = Object.isSealed(adm.target_)\n if (!configurable || frozen || sealed) {\n const fieldName = `${adm.name_}.${key.toString()}`\n const requestedAnnotationType = annotation.annotationType_\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\n if (frozen) {\n error += `\\nObject is frozen.`\n }\n if (sealed) {\n error += `\\nObject is sealed.`\n }\n if (!configurable) {\n error += `\\nproperty is not configurable.`\n // Mention only if caused by us to avoid confusion\n if (hasProp(adm.appliedAnnotations!, key)) {\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\n }\n }\n die(error)\n }\n }\n */\n\n // Not annotated\n if (__DEV__ && !isOverride(annotation) && hasProp(adm.appliedAnnotations_!, key)) {\n const fieldName = `${adm.name_}.${key.toString()}`\n const currentAnnotationType = adm.appliedAnnotations_![key].annotationType_\n const requestedAnnotationType = annotation.annotationType_\n die(\n `Cannot apply '${requestedAnnotationType}' to '${fieldName}':` +\n `\\nThe field is already annotated with '${currentAnnotationType}'.` +\n `\\nRe-annotating fields is not allowed.` +\n `\\nUse 'override' annotation for methods overridden by subclass.`\n )\n }\n}\n", "import {\n getNextId,\n addHiddenFinalProp,\n makeIterable,\n addHiddenProp,\n ObservableArrayAdministration,\n $mobx,\n arrayExtensions,\n IEnhancer,\n isObservableArray,\n IObservableArray,\n defineProperty,\n initObservable\n} from \"../internal\"\n\n// Bug in safari 9.* (or iOS 9 safari mobile). See #364\nconst ENTRY_0 = createArrayEntryDescriptor(0)\n\nconst safariPrototypeSetterInheritanceBug = (() => {\n let v = false\n const p = {}\n Object.defineProperty(p, \"0\", {\n set: () => {\n v = true\n }\n })\n Object.create(p)[\"0\"] = 1\n return v === false\n})()\n\n/**\n * This array buffer contains two lists of properties, so that all arrays\n * can recycle their property definitions, which significantly improves performance of creating\n * properties on the fly.\n */\nlet OBSERVABLE_ARRAY_BUFFER_SIZE = 0\n\n// Typescript workaround to make sure ObservableArray extends Array\nclass StubArray {}\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto)\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto\n } else {\n ctor.prototype = proto\n }\n}\ninherit(StubArray, Array.prototype)\n\n// Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\n\nexport class LegacyObservableArray<T> extends StubArray {\n constructor(\n initialValues: T[] | undefined,\n enhancer: IEnhancer<T>,\n name = __DEV__ ? \"ObservableArray@\" + getNextId() : \"ObservableArray\",\n owned = false\n ) {\n super()\n initObservable(() => {\n const adm = new ObservableArrayAdministration(name, enhancer, owned, true)\n adm.proxy_ = this as any\n addHiddenFinalProp(this, $mobx, adm)\n\n if (initialValues && initialValues.length) {\n // @ts-ignore\n this.spliceWithArray(0, 0, initialValues)\n }\n\n if (safariPrototypeSetterInheritanceBug) {\n // Seems that Safari won't use numeric prototype setter until any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(this, \"0\", ENTRY_0)\n }\n })\n }\n\n concat(...arrays: T[][]): T[] {\n ;(this[$mobx] as ObservableArrayAdministration).atom_.reportObserved()\n return Array.prototype.concat.apply(\n (this as any).slice(),\n //@ts-ignore\n arrays.map(a => (isObservableArray(a) ? a.slice() : a))\n )\n }\n\n get length(): number {\n return (this[$mobx] as ObservableArrayAdministration).getArrayLength_()\n }\n\n set length(newLength: number) {\n ;(this[$mobx] as ObservableArrayAdministration).setArrayLength_(newLength)\n }\n\n get [Symbol.toStringTag]() {\n return \"Array\"\n }\n\n [Symbol.iterator]() {\n const self = this\n let nextIndex = 0\n return makeIterable({\n next() {\n return nextIndex < self.length\n ? { value: self[nextIndex++], done: false }\n : { done: true, value: undefined }\n }\n })\n }\n}\n\nObject.entries(arrayExtensions).forEach(([prop, fn]) => {\n if (prop !== \"concat\") {\n addHiddenProp(LegacyObservableArray.prototype, prop, fn)\n }\n})\n\nfunction createArrayEntryDescriptor(index: number) {\n return {\n enumerable: false,\n configurable: true,\n get: function () {\n return this[$mobx].get_(index)\n },\n set: function (value) {\n this[$mobx].set_(index, value)\n }\n }\n}\n\nfunction createArrayBufferItem(index: number) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index))\n}\n\nexport function reserveArrayBuffer(max: number) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (let index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index)\n }\n OBSERVABLE_ARRAY_BUFFER_SIZE = max\n }\n}\n\nreserveArrayBuffer(1000)\n\nexport function createLegacyArray<T>(\n initialValues: T[] | undefined,\n enhancer: IEnhancer<T>,\n name?: string\n): IObservableArray<T> {\n return new LegacyObservableArray(initialValues, enhancer, name) as any\n}\n", "import { isAction } from \"../api/action\"\nimport {\n $mobx,\n IDepTreeNode,\n isAtom,\n isComputedValue,\n isObservableArray,\n isObservableMap,\n isObservableObject,\n isReaction,\n isObservableSet,\n die,\n isFunction,\n allowStateChangesStart,\n untrackedStart,\n allowStateChangesEnd,\n untrackedEnd,\n startBatch,\n endBatch\n} from \"../internal\"\n\nexport function getAtom(thing: any, property?: PropertyKey): IDepTreeNode {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) {\n die(23)\n }\n return (thing as any)[$mobx].atom_\n }\n if (isObservableSet(thing)) {\n return thing.atom_\n }\n if (isObservableMap(thing)) {\n if (property === undefined) {\n return thing.keysAtom_\n }\n const observable = thing.data_.get(property) || thing.hasMap_.get(property)\n if (!observable) {\n die(25, property, getDebugName(thing))\n }\n return observable\n }\n if (property && !thing[$mobx]) {\n thing[property]\n } // See #1072\n if (isObservableObject(thing)) {\n if (!property) {\n return die(26)\n }\n const observable = (thing as any)[$mobx].values_.get(property)\n if (!observable) {\n die(27, property, getDebugName(thing))\n }\n return observable\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx]\n }\n }\n die(28)\n}\n\nexport function getAdministration(thing: any, property?: string) {\n if (!thing) {\n die(29)\n }\n if (property !== undefined) {\n return getAdministration(getAtom(thing, property))\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing\n }\n if (isObservableMap(thing) || isObservableSet(thing)) {\n return thing\n }\n if (thing[$mobx]) {\n return thing[$mobx]\n }\n die(24, thing)\n}\n\nexport function getDebugName(thing: any, property?: string): string {\n let named\n if (property !== undefined) {\n named = getAtom(thing, property)\n } else if (isAction(thing)) {\n return thing.name\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing)\n } else {\n // valid for arrays as well\n named = getAtom(thing)\n }\n return named.name_\n}\n\n/**\n * Helper function for initializing observable structures, it applies:\n * 1. allowStateChanges so we don't violate enforceActions.\n * 2. untracked so we don't accidentaly subscribe to anything observable accessed during init in case the observable is created inside derivation.\n * 3. batch to avoid state version updates\n */\nexport function initObservable<T>(cb: () => T): T {\n const derivation = untrackedStart()\n const allowStateChanges = allowStateChangesStart(true)\n startBatch()\n try {\n return cb()\n } finally {\n endBatch()\n allowStateChangesEnd(allowStateChanges)\n untrackedEnd(derivation)\n }\n}\n", "import {\n isES6Map,\n isObservableArray,\n isObservableMap,\n isES6Set,\n isObservableSet,\n hasProp,\n isFunction,\n objectPrototype\n} from \"../internal\"\n\ndeclare const Symbol\nconst toString = objectPrototype.toString\n\nexport function deepEqual(a: any, b: any, depth: number = -1): boolean {\n return eq(a, b, depth)\n}\n\n// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\nfunction eq(a: any, b: any, depth: number, aStack?: any[], bStack?: any[]) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) {\n return a !== 0 || 1 / a === 1 / b\n }\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null) {\n return false\n }\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a) {\n return b !== b\n }\n // Exhaust primitive checks\n const type = typeof a\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n return false\n }\n\n // Compare `[[Class]]` names.\n const className = toString.call(a)\n if (className !== toString.call(b)) {\n return false\n }\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\":\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) {\n return +b !== +b\n }\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b\n case \"[object Symbol]\":\n return (\n typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b)\n )\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++\n }\n break\n }\n // Unwrap any wrapped objects.\n a = unwrap(a)\n b = unwrap(b)\n\n const areArrays = className === \"[object Array]\"\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") {\n return false\n }\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n const aCtor = a.constructor,\n bCtor = b.constructor\n if (\n aCtor !== bCtor &&\n !(\n isFunction(aCtor) &&\n aCtor instanceof aCtor &&\n isFunction(bCtor) &&\n bCtor instanceof bCtor\n ) &&\n \"constructor\" in a &&\n \"constructor\" in b\n ) {\n return false\n }\n }\n\n if (depth === 0) {\n return false\n } else if (depth < 0) {\n depth = -1\n }\n\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || []\n bStack = bStack || []\n let length = aStack.length\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) {\n return bStack[length] === b\n }\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a)\n bStack.push(b)\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length\n if (length !== b.length) {\n return false\n }\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n return false\n }\n }\n } else {\n // Deep compare objects.\n const keys = Object.keys(a)\n let key\n length = keys.length\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (Object.keys(b).length !== length) {\n return false\n }\n while (length--) {\n // Deep compare each member\n key = keys[length]\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n return false\n }\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop()\n bStack.pop()\n return true\n}\n\nfunction unwrap(a: any) {\n if (isObservableArray(a)) {\n return a.slice()\n }\n if (isES6Map(a) || isObservableMap(a)) {\n return Array.from(a.entries())\n }\n if (isES6Set(a) || isObservableSet(a)) {\n return Array.from(a.entries())\n }\n return a\n}\n", "import { getGlobal } from \"../internal\"\n\n// safely get iterator prototype if available\nconst maybeIteratorPrototype = getGlobal().Iterator?.prototype || {}\n\nexport function makeIterable<T, TReturn = unknown>(\n iterator: Iterator<T>\n): IteratorObject<T, TReturn> {\n iterator[Symbol.iterator] = getSelf\n return Object.assign(Object.create(maybeIteratorPrototype), iterator)\n}\n\nfunction getSelf() {\n return this\n}\n", "import { ObservableObjectAdministration, isFunction } from \"../internal\"\n\nexport const enum MakeResult {\n Cancel,\n Break,\n Continue\n}\n\nexport type Annotation = {\n annotationType_: string\n make_(\n adm: ObservableObjectAdministration,\n key: PropertyKey,\n descriptor: PropertyDescriptor,\n source: object\n ): MakeResult\n extend_(\n adm: ObservableObjectAdministration,\n key: PropertyKey,\n descriptor: PropertyDescriptor,\n proxyTrap: boolean\n ): boolean | null\n decorate_20223_(value: any, context: DecoratorContext)\n options_?: any\n}\n\nexport type AnnotationMapEntry =\n | Annotation\n | true /* follow the default decorator, usually deep */\n | false /* don't decorate this property */\n\n// AdditionalFields can be used to declare additional keys that can be used, for example to be able to\n// declare annotations for private/ protected members, see #2339\nexport type AnnotationsMap<T, AdditionalFields extends PropertyKey> = {\n [P in Exclude<keyof T, \"toString\">]?: AnnotationMapEntry\n} & Record<AdditionalFields, AnnotationMapEntry>\n\nexport function isAnnotation(thing: any) {\n return (\n // Can be function\n thing instanceof Object &&\n typeof thing.annotationType_ === \"string\" &&\n isFunction(thing.make_) &&\n isFunction(thing.extend_)\n )\n}\n\nexport function isAnnotationMapEntry(thing: any) {\n return typeof thing === \"boolean\" || isAnnotation(thing)\n}\n", "/**\n * (c) Michel Weststrate 2015 - 2020\n * MIT Licensed\n *\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\n * this is a good place to start:\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\n *\n * Source folders:\n * ===============\n *\n * - api/ Most of the public static methods exposed by the module can be found here.\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\n * - utils/ Utility stuff.\n *\n */\nimport { die } from \"./errors\"\nimport { getGlobal } from \"./utils/global\"\n;[\"Symbol\", \"Map\", \"Set\"].forEach(m => {\n let g = getGlobal()\n if (typeof g[m] === \"undefined\") {\n die(`MobX requires global '${m}' to be available or polyfilled`)\n }\n})\n\nimport { spy, getDebugName, $mobx } from \"./internal\"\n\nexport {\n IObservable,\n IDepTreeNode,\n Reaction,\n IReactionPublic,\n IReactionDisposer,\n untracked,\n IAtom,\n createAtom,\n spy,\n IComputedValue,\n IEqualsComparer,\n comparer,\n IEnhancer,\n IInterceptable,\n IInterceptor,\n IListenable,\n IObjectWillChange,\n IObjectDidChange,\n isObservableObject,\n IValueDidChange,\n IValueWillChange,\n IObservableValue,\n isObservableValue as isBoxedObservable,\n IObservableArray,\n IArrayWillChange,\n IArrayWillSplice,\n IArraySplice,\n IArrayUpdate,\n IArrayDidChange,\n isObservableArray,\n IKeyValueMap,\n ObservableMap,\n IMapEntries,\n IMapEntry,\n IMapWillChange,\n IMapDidChange,\n isObservableMap,\n IObservableMapInitialValues,\n ObservableSet,\n isObservableSet,\n ISetDidChange,\n ISetWillChange,\n IObservableSetInitialValues,\n transaction,\n observable,\n IObservableFactory,\n CreateObservableOptions,\n computed,\n IComputedFactory,\n isObservable,\n isObservableProp,\n isComputed,\n isComputedProp,\n extendObservable,\n observe,\n intercept,\n autorun,\n IAutorunOptions,\n reaction,\n IReactionOptions,\n when,\n IWhenOptions,\n action,\n isAction,\n runInAction,\n IActionFactory,\n keys,\n values,\n entries,\n set,\n remove,\n has,\n get,\n apiOwnKeys as ownKeys,\n apiDefineProperty as defineProperty,\n configure,\n onBecomeObserved,\n onBecomeUnobserved,\n flow,\n isFlow,\n flowResult,\n FlowCancellationError,\n isFlowCancellationError,\n toJS,\n trace,\n IObserverTree,\n IDependencyTree,\n getDependencyTree,\n getObserverTree,\n resetGlobalState as _resetGlobalState,\n getGlobalState as _getGlobalState,\n getDebugName,\n getAtom,\n getAdministration as _getAdministration,\n allowStateChanges as _allowStateChanges,\n runInAction as _allowStateChangesInsideComputed, // This has become the default behavior in Mobx 6\n Lambda,\n $mobx,\n isComputingDerivation as _isComputingDerivation,\n onReactionError,\n interceptReads as _interceptReads,\n IComputedValueOptions,\n IActionRunInfo,\n _startAction,\n _endAction,\n allowStateReadsStart as _allowStateReadsStart,\n allowStateReadsEnd as _allowStateReadsEnd,\n makeObservable,\n makeAutoObservable,\n autoAction as _autoAction,\n AnnotationsMap,\n AnnotationMapEntry,\n override\n} from \"./internal\"\n\n// Devtools support\ndeclare const __MOBX_DEVTOOLS_GLOBAL_HOOK__: { injectMobx: (any) => void }\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy,\n extras: {\n getDebugName\n },\n $mobx\n })\n}\n", "import {memoize, nop} from \"@cling/lib.shared.utils\"\nimport React from \"react\"\nimport classNames_ from \"classnames\"\nexport const classNames = classNames_\n\n/**\n * ``true`` if running on mobile device.\n * See https://exceptionshub.com/how-to-detect-a-mobile-device-with-javascript.html\n */\nexport const running_on_mobile_device = memoize(\n (): boolean =>\n /Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(\n navigator.userAgent,\n ) ||\n // iPad Pro detection (https://stackoverflow.com/a/58017456) ...\n (/Mac/.test(navigator.userAgent) && navigator.maxTouchPoints > 0),\n)\n\nexport const running_on_tablet = memoize(\n (): boolean => running_on_mobile_device() && window.innerWidth > 1000,\n)\n\nexport const running_on_phone = memoize(\n (): boolean => running_on_mobile_device() && !running_on_tablet(),\n)\n\n/**\n * ``true`` if running on Android.\n * We assume that everything that is mobile and not iOS is Android for now.\n */\nexport const running_on_android = memoize(\n (): boolean => running_on_mobile_device() && !running_on_ios(),\n)\n\n/**\n * ``true`` if running on iOS.\n * See https://stackoverflow.com/questions/9038625/detect-if-device-is-ios\n */\nexport const running_on_ios = memoize(\n (): boolean =>\n (/iPhone|iPad|iPod/i.test(navigator.userAgent) && !(window as any).MSStream) ||\n // iPad Pro detection (https://stackoverflow.com/a/58017456) ...\n (/Mac/.test(navigator.userAgent) && navigator.maxTouchPoints > 0),\n)\n\n/**\n * ``true`` if running on iOS 13 and above ...\n */\nexport const running_on_ios_13_and_above = memoize(\n (): boolean => running_on_ios() && (window as any).visualViewport,\n)\n\n/**\n * ``true`` if running on a Mac.\n */\nexport const running_on_mac = memoize((): boolean => navigator.platform.startsWith(\"Mac\"))\n\n/**\n * ``true`` if running on a Safari/Mac.\n */\nexport const running_on_mac_safari = memoize(\n (): boolean =>\n navigator.vendor.includes(\"Apple\") && !running_on_mobile_device() && running_on_mac(),\n)\n\n/**\n * `true` if running as PWA.\n */\nexport const running_as_pwa = memoize(\n (): boolean =>\n (navigator as any).standalone || window.matchMedia(\"(display-mode: standalone)\").matches,\n)\n\n/**\n * Checks for all kinds of bots like GoogleBot.\n */\nexport const scraped_by_search_bot = memoize((): boolean =>\n /Mediapartners-Google|Googlebot|AdsBot-Google|APIs-Google|FeedFetcher-Google|Google-Read-Aloud|DuplexWeb-Google|Google Favicon|googleweblight|Storebot-Google|Google Page Speed/i.test(\n navigator.userAgent,\n ),\n)\n\nexport const input_capture_supported = memoize((): boolean => {\n const elm = document.createElement(\"input\")\n return elm.capture !== undefined\n})\n\n/**\n * ``true`` if passive events are supported.\n * See https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection\n */\nexport const passive_events_supported: boolean = (function () {\n let result = false\n try {\n const opts = Object.defineProperty({}, \"passive\", {\n get: function () {\n result = true\n return undefined\n },\n })\n addEventListener(\"test\", null as any, opts)\n } catch {\n // Ignored\n }\n return result\n})()\n\nexport function can_enter_fullscreen() {\n if (window.outerHeight >= window.screen.height) {\n // browser window is already in fullscreen ...\n return false\n }\n // Check if a fullscreen API is available ...\n const d = document as any\n return !!(\n d.exitFullscreen ||\n d.mozCancelFullScreen ||\n d.webkitExitFullscreen ||\n d.msExitFullscreen\n )\n}\n\nexport function enter_fullscreen(e: HTMLElement, on_exit_fullscreen: () => void) {\n const d = document as any\n if (e.requestFullscreen) {\n e.requestFullscreen().catch(nop)\n const f = () => {\n if (!d.fullscreenElement) {\n d.removeEventListener(\"fullscreenchange\", f)\n on_exit_fullscreen()\n }\n }\n d.addEventListener(\"fullscreenchange\", f)\n } else if ((e as any).mozRequestFullScreen) {\n ;(e as any).mozRequestFullScreen()\n const f = () => {\n if (!d.mozFullScreenElement) {\n d.removeEventListener(\"mozfullscreenchange\", f)\n on_exit_fullscreen()\n }\n }\n d.addEventListener(\"mozfullscreenchange\", f)\n } else if ((e as any).webkitRequestFullscreen) {\n ;(e as any).webkitRequestFullscreen()\n const f = () => {\n if (!d.webkitFullscreenElement) {\n d.removeEventListener(\"webkitfullscreenchange\", f)\n on_exit_fullscreen()\n }\n }\n d.addEventListener(\"webkitfullscreenchange\", f)\n } else if ((e as any).msRequestFullscreen) {\n ;(e as any).msRequestFullscreen()\n const f = () => {\n if (!d.msFullscreenElement) {\n d.removeEventListener(\"onmsfullscreenchange\", f)\n on_exit_fullscreen()\n }\n }\n d.addEventListener(\"onmsfullscreenchange\", f)\n }\n}\n\nexport function can_exit_fullscreen() {\n const d = document as any\n return !!(\n d.fullscreenElement ||\n d.mozFullScreenElement ||\n d.webkitFullscreenElement ||\n d.msFullscreenElement\n )\n}\n\nexport function exit_fullscreen() {\n const d = document as any\n if (d.exitFullscreen) {\n d.exitFullscreen().catch(nop)\n } else if (d.mozCancelFullScreen) {\n d.mozCancelFullScreen()\n } else if (d.webkitExitFullscreen) {\n d.webkitExitFullscreen()\n } else if (d.msExitFullscreen) {\n d.msExitFullscreen()\n }\n}\n\nexport function cancel_event(e?: {preventDefault: () => void; stopPropagation: () => void}) {\n e?.preventDefault()\n e?.stopPropagation()\n}\n\n/**\n * Call `callback` when the user navigates back using the browser-back-button.\n *\n * Important: This functionality cannot be nested, i.e. trapping back over multiple UI contexts\n * is not supported and will not work.\n *\n * @return a dispose-function that must be called at the end of the UI context\n * (on `componentWillUnmount()` for example).\n */\nlet _trap_browser_back_initialized = false\nlet _trap_browser_back_callback:\n | {\n id: string\n callback: () => void\n }\n | undefined\nlet _trap_browser_back_suspended = false\nexport function trap_browser_back(id: string, callback: () => void): () => void {\n if (!_trap_browser_back_initialized) {\n _trap_browser_back_initialized = true\n window.addEventListener(\"popstate\", () => {\n if (_trap_browser_back_callback && !_trap_browser_back_suspended) {\n _trap_browser_back_callback.callback()\n _trap_browser_back_callback = undefined\n }\n _trap_browser_back_suspended = false\n })\n }\n _trap_browser_back_callback = {callback, id}\n history.pushState({managed_by_cling: true, id}, \"Cling\")\n return () => {\n if (_trap_browser_back_callback && _trap_browser_back_callback.id !== id) {\n return\n }\n // Pop state ...\n setTimeout(() => {\n if (history.state && history.state.managed_by_cling) {\n _trap_browser_back_suspended = true\n history.back()\n }\n }, 0)\n }\n}\n\n/**\n * Note: The library `perfect_scrollbar` will *not* be loaded, it has to be present. If it is\n * not present, nothing happens.\n */\nexport function with_perfect_scrollbar(\n elm: any,\n opts: {\n dir: \"horizontal\" | \"vertical\"\n handlers?: Array<\"click-rail\" | \"drag-thumb\" | \"wheel\" | \"touch\">\n hide_until_active?: boolean\n } = {dir: \"vertical\"},\n) {\n if (!window.PerfectScrollbar || scraped_by_search_bot()) {\n return elm\n }\n const {ref, onMouseEnter} = elm\n const className = elm.props.className\n const {dir, handlers, hide_until_active} = opts\n let ps: typeof PerfectScrollbar\n return React.cloneElement(elm, {\n className: hide_until_active ? className : `${className || \"\"} ps--always-visible`,\n onMouseEnter: (e: React.MouseEvent) => {\n if (onMouseEnter) {\n onMouseEnter(e)\n }\n if (ps) {\n ps.update()\n }\n },\n ref: (elm_ref: ReactRef<any>) => {\n if (typeof ref === \"function\") {\n ref(elm_ref)\n } else if (ref) {\n ref.current = elm_ref\n }\n if (ps) {\n ps.destroy()\n ps = null\n }\n if (elm_ref) {\n const perfect_scrollbar_opts = {\n suppressScrollX: dir === \"vertical\",\n suppressScrollY: dir === \"horizontal\",\n } as any\n if (handlers) {\n perfect_scrollbar_opts[\"handlers\"] = handlers\n }\n ps = new PerfectScrollbar(elm_ref, perfect_scrollbar_opts)\n }\n },\n })\n}\n\n/**\n * Taken from https://stackoverflow.com/a/27374365\n */\nexport function clear_cookies() {\n document.cookie.split(\";\").forEach(function (c) {\n document.cookie = c\n .replace(/^ +/, \"\")\n .replace(/=.*/, \"=;expires=\" + new Date().toUTCString() + \";path=/\")\n // For example, the Intercom cookie uses this domain.\n document.cookie = c\n .replace(/^ +/, \"\")\n .replace(/=.*/, \"=;expires=\" + new Date().toUTCString() + \";path=/;domain=.cling.com\")\n })\n}\n\n/**\n * Test whether at least transparent WebP is supported according to\n * https://developers.google.com/speed/webp/faq#how_can_i_detect_browser_support_for_webp\n */\nexport const is_webp_supported = memoize(async (): Promise<boolean> => {\n return await new Promise((resolve) => {\n const img = new Image()\n img.onload = () => {\n resolve(img.width > 0 && img.height > 0)\n }\n img.onerror = () => {\n resolve(false)\n }\n img.src =\n \"data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==\"\n })\n})\n\nexport const is_avif_supported = memoize(async (): Promise<boolean> => {\n return await new Promise((resolve) => {\n const img = new Image()\n img.onload = () => {\n resolve(img.width > 0 && img.height > 0)\n }\n img.onerror = () => {\n resolve(false)\n }\n img.src =\n \"data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=\"\n })\n})\n\nexport function detect_scrollbar_width() {\n const container = document.createElement(\"div\")\n container.style.visibility = \"hidden\"\n container.style.overflow = \"scroll\"\n document.body.appendChild(container)\n const inner = document.createElement(\"div\")\n container.appendChild(inner)\n const result = container.offsetWidth - inner.offsetWidth\n document.body.removeChild(container)\n return result\n}\n"], "mappings": "wEAAA,IAAAA,GAAAC,GAAA,CAAAC,GAAAC,KAAA,cAMA,SAASC,GAAMC,EAAU,CACvB,GAAIA,EAAS,QAAU,IAAO,MAAM,IAAI,UAAU,mBAAmB,EAErE,QADIC,EAAW,IAAI,WAAW,GAAG,EACxBC,EAAI,EAAGA,EAAID,EAAS,OAAQC,IACnCD,EAASC,CAAC,EAAI,IAEhB,QAASC,EAAI,EAAGA,EAAIH,EAAS,OAAQG,IAAK,CACxC,IAAIC,EAAIJ,EAAS,OAAOG,CAAC,EACrBE,EAAKD,EAAE,WAAW,CAAC,EACvB,GAAIH,EAASI,CAAE,IAAM,IAAO,MAAM,IAAI,UAAUD,EAAI,eAAe,EACnEH,EAASI,CAAE,EAAIF,CACjB,CACA,IAAIG,EAAON,EAAS,OAChBO,EAASP,EAAS,OAAO,CAAC,EAC1BQ,EAAS,KAAK,IAAIF,CAAI,EAAI,KAAK,IAAI,GAAG,EACtCG,EAAU,KAAK,IAAI,GAAG,EAAI,KAAK,IAAIH,CAAI,EAC3C,SAASI,EAAQC,EAAQ,CAOvB,GANIA,aAAkB,aACX,YAAY,OAAOA,CAAM,EAClCA,EAAS,IAAI,WAAWA,EAAO,OAAQA,EAAO,WAAYA,EAAO,UAAU,EAClE,MAAM,QAAQA,CAAM,IAC7BA,EAAS,WAAW,KAAKA,CAAM,IAE7B,EAAEA,aAAkB,YAAe,MAAM,IAAI,UAAU,qBAAqB,EAChF,GAAIA,EAAO,SAAW,EAAK,MAAO,GAMlC,QAJIC,EAAS,EACTC,EAAS,EACTC,EAAS,EACTC,EAAOJ,EAAO,OACXG,IAAWC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,EAAQC,EAAI,MAAQ,GAAKA,EAAI,OAAS,CAAC,CAC3C,EACAA,EAAI,QAAU,IAAM,CAChBD,EAAQ,EAAK,CACjB,EACAC,EAAI,IACA,ybACR,CAAC,CACJ,EAEM,SAASE,IAAyB,CACrC,IAAMC,EAAY,SAAS,cAAc,KAAK,EAC9CA,EAAU,MAAM,WAAa,SAC7BA,EAAU,MAAM,SAAW,SAC3B,SAAS,KAAK,YAAYA,CAAS,EACnC,IAAMC,EAAQ,SAAS,cAAc,KAAK,EAC1CD,EAAU,YAAYC,CAAK,EAC3B,IAAMC,EAASF,EAAU,YAAcC,EAAM,YAC7C,gBAAS,KAAK,YAAYD,CAAS,EAC5BE,CACX,CAVgBC,EAAAJ,GAAA", "names": ["require_src", "__commonJSMin", "exports", "module", "base", "ALPHABET", "BASE_MAP", "j", "i", "x", "xc", "BASE", "LEADER", "FACTOR", "iFACTOR", "encode", "source", "zeroes", "length", "pbegin", "pend", "size", "b58", "carry", "it1", "it2", "str", "__name", "decodeUnsafe", "psz", "b256", "it3", "it4", "vch", "decode", "string", "buffer", "require_base64_js", "__commonJSMin", "exports", "byteLength", "toByteArray", "fromByteArray", "lookup", "revLookup", "Arr", "code", "i", "len", "getLens", "b64", "validLen", "placeHoldersLen", "__name", "lens", "_byteLength", "tmp", "arr", "curByte", "tripletToBase64", "num", "encodeChunk", "uint8", "start", "end", "output", "extraBytes", "parts", "maxChunkLength", "len2", "require_ieee754", "__commonJSMin", "exports", "buffer", "offset", "isLE", "mLen", "nBytes", "e", "m", "eLen", "eMax", "eBias", "nBits", "i", "d", "s", "value", "rt", "require_buffer", "__commonJSMin", "exports", "base64", "ieee754", "customInspectSymbol", "Buffer", "SlowBuffer", "K_MAX_LENGTH", "typedArraySupport", "arr", "proto", "__name", "createBuffer", "length", "buf", "arg", "encodingOrOffset", "allocUnsafe", "from", "value", "fromString", "fromArrayLike", "isInstance", "fromArrayBuffer", "valueOf", "b", "fromObject", "assertSize", "size", "alloc", "fill", "encoding", "checked", "string", "byteLength", "actual", "array", "i", "byteOffset", "obj", "len", "numberIsNaN", "a", "x", "y", "list", "buffer", "pos", "mustMatch", "loweredCase", "utf8ToBytes", "base64ToBytes", "slowToString", "start", "end", "hexSlice", "utf8Slice", "asciiSlice", "latin1Slice", "base64Slice", "utf16leSlice", "swap", "n", "m", "str", "max", "target", "thisStart", "thisEnd", "thisCopy", "targetCopy", "bidirectionalIndexOf", "val", "dir", "arrayIndexOf", "indexSize", "arrLength", "valLength", "read", "foundIndex", "found", "j", "hexWrite", "offset", "remaining", "strLen", "parsed", "utf8Write", "blitBuffer", "asciiWrite", "asciiToBytes", "latin1Write", "base64Write", "ucs2Write", "utf16leToBytes", "res", "firstByte", "codePoint", "bytesPerSequence", "secondByte", "thirdByte", "fourthByte", "tempCodePoint", "decodeCodePointsArray", "MAX_ARGUMENTS_LENGTH", "codePoints", "ret", "out", "hexSliceLookupTable", "bytes", "newBuf", "checkOffset", "ext", "noAssert", "mul", "checkInt", "min", "maxBytes", "limit", "sub", "checkIEEE754", "writeFloat", "littleEndian", "writeDouble", "targetStart", "code", "INVALID_BASE64_RE", "base64clean", "units", "leadSurrogate", "byteArray", "c", "hi", "lo", "src", "dst", "type", "alphabet", "table", "i16", "assign", "obj", "props", "i", "removeNode", "node", "parentNode", "removeChild", "createElement", "type", "children", "key", "ref", "normalizedProps", "arguments", "length", "slice", "call", "defaultProps", "createVNode", "original", "vnode", "__k", "__", "__b", "__e", "__c", "constructor", "__v", "vnodeId", "__i", "__u", "options", "createRef", "current", "Fragment", "BaseComponent", "context", "this", "getDomSibling", "childIndex", "sibling", "updateParentDomPointers", "child", "base", "enqueueRender", "c", "__d", "rerenderQueue", "push", "process", "__r", "prevDebounce", "debounceRendering", "defer", "component", "newVNode", "oldVNode", "oldDom", "commitQueue", "refQueue", "l", "sort", "depthSort", "shift", "__P", "diff", "__n", "namespaceURI", "commitRoot", "diffChildren", "parentDom", "renderResult", "newParentVNode", "oldParentVNode", "globalContext", "namespace", "excessDomChildren", "isHydrating", "childVNode", "newDom", "firstChildDom", "result", "oldChildren", "EMPTY_ARR", "newChildrenLength", "constructNewChildrenArray", "EMPTY_OBJ", "applyRef", "insert", "nextSibling", "skewedIndex", "matchingIndex", "oldChildrenLength", "remainingOldChildren", "skew", "Array", "String", "isArray", "findMatchingIndex", "unmount", "parentVNode", "contains", "insertBefore", "nodeType", "toChildArray", "out", "some", "x", "y", "setStyle", "style", "value", "setProperty", "IS_NON_DIMENSIONAL", "test", "dom", "name", "oldValue", "useCapture", "o", "cssText", "replace", "CAPTURE_REGEX", "toLowerCase", "_attached", "eventClock", "addEventListener", "eventProxyCapture", "eventProxy", "removeEventListener", "e", "removeAttribute", "setAttribute", "createEventProxy", "eventHandler", "_dispatched", "event", "tmp", "isNew", "oldProps", "oldState", "snapshot", "clearProcessingException", "newProps", "isClassComponent", "provider", "componentContext", "renderHook", "count", "isTopLevelFragment", "newType", "outer", "prototype", "render", "contextType", "__E", "doRender", "sub", "state", "__h", "_sb", "__s", "getDerivedStateFromProps", "componentWillMount", "componentDidMount", "componentWillReceiveProps", "shouldComponentUpdate", "componentWillUpdate", "componentDidUpdate", "getChildContext", "getSnapshotBeforeUpdate", "then", "MODE_HYDRATE", "indexOf", "diffElementNodes", "diffed", "root", "cb", "newHtml", "oldHtml", "newChildren", "inputValue", "checked", "localName", "document", "createTextNode", "createElementNS", "is", "__m", "data", "childNodes", "attributes", "__html", "innerHTML", "content", "hasRefUnmount", "skipRemove", "r", "componentWillUnmount", "replaceNode", "documentElement", "firstChild", "hydrate", "cloneElement", "createContext", "defaultValue", "Context", "subs", "ctx", "Set", "_props", "forEach", "add", "old", "delete", "Provider", "__l", "Consumer", "contextValue", "isValidElement", "init_preact_module", "__esmMin", "__name", "error", "errorInfo", "ctor", "handled", "getDerivedStateFromError", "setState", "componentDidCatch", "undefined", "update", "callback", "s", "forceUpdate", "Promise", "bind", "resolve", "setTimeout", "a", "b", "getHookState", "index", "type", "options", "__h", "currentComponent", "currentHook", "hooks", "__H", "__", "length", "push", "useState", "initialState", "useReducer", "invokeOrReturn", "reducer", "init", "hookState", "currentIndex", "_reducer", "__c", "action", "currentValue", "__N", "nextValue", "setState", "__f", "updateHookState", "__name", "p", "s", "c", "stateHooks", "filter", "x", "every", "prevScu", "call", "this", "shouldUpdate", "props", "forEach", "hookItem", "shouldComponentUpdate", "prevCWU", "componentWillUpdate", "__e", "tmp", "useEffect", "callback", "args", "state", "__s", "argsChanged", "_pendingArgs", "useLayoutEffect", "useRef", "initialValue", "useMemo", "current", "useImperativeHandle", "ref", "createHandle", "result", "concat", "factory", "useCallback", "useContext", "context", "provider", "sub", "value", "useDebugValue", "formatter", "n", "useErrorBoundary", "cb", "errState", "componentDidCatch", "err", "errorInfo", "undefined", "useId", "root", "__v", "__m", "mask", "flushAfterPaintEffects", "component", "afterPaintEffects", "shift", "__P", "invokeCleanup", "invokeEffect", "e", "afterNextFrame", "raf", "done", "clearTimeout", "timeout", "HAS_RAF", "cancelAnimationFrame", "setTimeout", "requestAnimationFrame", "hook", "comp", "cleanup", "oldArgs", "newArgs", "some", "arg", "f", "previousComponent", "prevRaf", "oldBeforeDiff", "oldBeforeRender", "oldAfterDiff", "oldCommit", "oldBeforeUnmount", "oldRoot", "_options", "__b", "__r", "diffed", "unmount", "vnode", "parentDom", "__k", "commitQueue", "hasErrored", "assign", "obj", "props", "i", "shallowDiffers", "a", "b", "useSyncExternalStore", "subscribe", "getSnapshot", "value", "_useState", "useState", "_instance", "__", "_getSnapshot", "forceUpdate", "useLayoutEffect", "didSnapshotChange", "useEffect", "inst", "x", "y", "latestGetSnapshot", "prevValue", "nextValue", "error", "startTransition", "cb", "useDeferredValue", "val", "useTransition", "PureComponent", "p", "c", "this", "context", "memo", "comparer", "shouldUpdate", "nextProps", "ref", "updateRef", "call", "current", "Memoed", "shouldComponentUpdate", "createElement", "displayName", "name", "prototype", "isReactComponent", "__f", "forwardRef", "fn", "Forwarded", "clone", "$$typeof", "REACT_FORWARD_SYMBOL", "render", "detachedClone", "vnode", "detachedParent", "parentDom", "__c", "__H", "forEach", "effect", "__P", "__k", "map", "child", "removeOriginal", "originalParent", "__v", "__e", "appendChild", "Suspense", "__u", "_suspenders", "__b", "suspended", "component", "__a", "lazy", "loader", "prom", "Lazy", "then", "exports", "default", "e", "SuspenseList", "_next", "_map", "ContextProvider", "getChildContext", "children", "Portal", "_this", "container", "_container", "componentWillUnmount", "_temp", "nodeType", "parentNode", "childNodes", "contains", "__name", "push", "insertBefore", "before", "removeChild", "splice", "indexOf", "createPortal", "el", "containerInfo", "parent", "callback", "textContent", "preactRender", "hydrate", "preactHydrate", "empty", "isPropagationStopped", "cancelBubble", "isDefaultPrevented", "defaultPrevented", "createFactory", "type", "bind", "isValidElement", "element", "REACT_ELEMENT_TYPE", "isFragment", "Fragment", "isMemo", "String", "startsWith", "cloneElement", "preactCloneElement", "apply", "arguments", "unmountComponentAtNode", "findDOMNode", "base", "useInsertionEffect", "oldDiffHook", "mapFn", "Children", "oldCatchError", "oldUnmount", "resolve", "CAMEL_PROPS", "ON_ANI", "CAMEL_REPLACE", "IS_DOM", "onChangeInputType", "oldEventHook", "currentComponent", "classNameDescriptorNonEnumberable", "oldVNodeHook", "oldBeforeRender", "oldDiffed", "__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED", "version", "unstable_batchedUpdates", "flushSync", "StrictMode", "isElement", "index", "Component", "isPureReactComponent", "state", "options", "Symbol", "for", "toChildArray", "count", "length", "only", "normalized", "toArray", "newVNode", "oldVNode", "errorInfo", "unmount", "__R", "promise", "suspendingVNode", "suspendingComponent", "resolved", "onResolved", "onSuspensionComplete", "suspendedVNode", "__O", "setState", "pop", "document", "detachedComponent", "fallback", "list", "node", "delete", "revealOrder", "size", "delegated", "get", "unsuspend", "wrappedUnsuspend", "Map", "reverse", "set", "componentDidUpdate", "componentDidMount", "test", "key", "Object", "defineProperty", "configurable", "v", "writable", "event", "persist", "nativeEvent", "enumerable", "class", "normalizedProps", "isNonDashedType", "lowerCased", "toLowerCase", "replace", "multiple", "Array", "isArray", "selected", "defaultValue", "className", "__r", "diffed", "dom", "ReactCurrentDispatcher", "readContext", "__n", "useCallback", "useContext", "useDebugValue", "useId", "useImperativeHandle", "useMemo", "useReducer", "useRef", "arg", "createContext", "createRef", "require_classnames", "__commonJSMin", "exports", "module", "hasOwn", "classNames", "classes", "i", "arg", "argType", "inner", "key", "__name", "class_name", "obj", "result", "c", "__name", "safe_JSON_stringify", "replacer", "spaces", "to_JSON", "x", "stack", "keys", "cycle_replacer", "key", "value", "serializer", "pos", "o", "k", "v", "element_to_string", "elm", "s", "safe_to_string", "error_to_string", "error2", "error", "a", "import_base_x", "import_buffer", "is_UID", "uid", "prefix", "__name", "full_name", "account", "given_name", "family_name", "s", "__name", "base62", "BaseX", "encode_b62", "buf", "assert", "encode_b64url", "buf", "__name", "decode_b64url", "s", "assert_never", "x", "class_name_", "class_name", "safe_to_string", "assert", "should_be_true", "msg_or_function", "msg", "error", "__name", "not_null", "o", "error_msg", "camel_case_to_underscore", "s", "_", "m1", "m2", "__name", "truncate", "s", "max_length", "filler", "__name", "nop", "_", "ignore_errors", "f", "_TimeoutError", "message", "__name", "TimeoutError", "with_timeout", "millis", "promise", "opts", "timeout_error", "promise_pending", "cancel_timeout", "result", "value", "error", "_", "reject", "new_ControllablePromise", "resolve_", "reject_", "resolve", "nop", "flatten", "a", "x", "__name", "extract_domain", "url", "remove_prefixes", "domain", "parts", "__name", "extract_path", "i", "j", "UNDEFINED", "__name", "memoize", "fn", "memoize_wrapper", "v", "normalize_email", "email", "__name", "escape_html", "s", "__name", "fast_string_hash", "hash", "i", "all_finished", "values", "error", "res", "x", "e", "__name", "die", "error", "args", "Array", "_len", "_key", "arguments", "process", "e", "Error", "length", "map", "String", "join", "mockGlobal", "getGlobal", "globalThis", "window", "global", "self", "assign", "Object", "getDescriptor", "getOwnPropertyDescriptor", "defineProperty", "objectPrototype", "prototype", "EMPTY_ARRAY", "freeze", "EMPTY_OBJECT", "hasProxy", "Proxy", "plainObjectString", "toString", "assertProxies", "once", "func", "invoked", "apply", "arguments", "noop", "__name", "isFunction", "fn", "isStringish", "value", "t", "isObject", "isPlainObject", "proto", "Object", "getPrototypeOf", "protoConstructor", "hasOwnProperty", "call", "constructor", "toString", "plainObjectString", "isGenerator", "obj", "name", "displayName", "addHiddenProp", "object", "propName", "defineProperty", "enumerable", "writable", "configurable", "addHiddenFinalProp", "createInstanceofPredicate", "theClass", "prototype", "x", "isES6Map", "thing", "isPlainES6Map", "mapProto", "objectProto", "nullProto", "isES6Set", "hasGetOwnPropertySymbols", "getOwnPropertySymbols", "getPlainObjectKeys", "keys", "symbols", "length", "concat", "filter", "s", "objectPrototype", "propertyIsEnumerable", "ownKeys", "Reflect", "getOwnPropertyNames", "toPrimitive", "value", "hasProp", "target", "prop", "objectPrototype", "hasOwnProperty", "call", "getOwnPropertyDescriptors", "Object", "__name", "res", "ownKeys", "forEach", "key", "getDescriptor", "getFlag", "flags", "mask", "setFlag", "newValue", "storedAnnotationsSymbol", "Symbol", "createDecoratorAnnotation", "annotation", "decorator", "property", "is20223Decorator", "decorate_20223_", "storeAnnotation", "assign", "prototype", "addHiddenProp", "_extends", "process", "fieldName", "assertNotDecorated", "isOverride", "currentAnnotationType", "requestedAnnotationType", "collectStoredAnnotations", "context", "$mobx", "Symbol", "Atom", "name_", "flags_", "observers_", "Set", "lastAccessedBy_", "lowestObserverState_", "IDerivationState_", "NOT_TRACKING_", "onBOL", "onBUOL", "_proto", "prototype", "onBO", "__name", "forEach", "listener", "onBUO", "reportObserved", "reportChanged", "startBatch", "propagateChanged", "endBatch", "toString", "_createClass", "key", "get", "getFlag", "isBeingObservedMask_", "set", "newValue", "setFlag", "isPendingUnobservationMask_", "diffValueMask_", "isAtom", "createInstanceofPredicate", "createAtom", "name", "onBecomeObservedHandler", "onBecomeUnobservedHandler", "noop", "atom", "onBecomeObserved", "onBecomeUnobserved", "identityComparer", "a", "b", "structuralComparer", "deepEqual", "shallowComparer", "defaultComparer", "Object", "is", "comparer", "identity", "structural", "shallow", "deepEnhancer", "v", "_", "isObservable", "Array", "isArray", "observable", "array", "isPlainObject", "object", "undefined", "isES6Map", "map", "isES6Set", "isAction", "isFlow", "isGenerator", "flow", "autoAction", "shallowEnhancer", "isObservableObject", "isObservableArray", "isObservableMap", "isObservableSet", "deep", "referenceEnhancer", "refStructEnhancer", "oldValue", "OVERRIDE", "isOverride", "annotation", "annotationType_", "OVERRIDE", "createActionAnnotation", "name", "options", "annotationType_", "options_", "make_", "extend_", "decorate_20223_", "adm", "key", "descriptor", "source", "_this$options_", "bound", "target_", "isAction", "value", "actionDescriptor", "createActionDescriptor", "defineProperty", "proxyTrap", "defineProperty_", "mthd", "context", "kind", "addInitializer", "ann", "_createAction", "__name", "m", "_ann$options_$name", "_ann$options_", "_ann$options_$autoAct", "_ann$options_2", "createAction", "toString", "autoAction", "initMthd", "_ann$options_3", "bind", "isMobxAction", "_this$options_2", "self", "die", "String", "assertActionDescriptor", "_ref", "_ref2", "annotation", "safeDescriptors", "globalState", "_annotation$options_", "_adm$proxy_", "proxy_", "_annotation$options_$", "_annotation$options_2", "_annotation$options_$2", "_annotation$options_3", "_annotation$options_4", "_adm$proxy_2", "undefined", "configurable", "isPlainObject_", "enumerable", "writable", "createFlowAnnotation", "hasProp", "isFlow", "flowDescriptor", "createFlowDescriptor", "flow", "_this$options_3", "isMobXFlow", "assertFlowDescriptor", "createComputedAnnotation", "assertComputedDescriptor", "defineComputedProperty_", "_extends", "get", "set", "asObservableObject", "$mobx", "values_", "ComputedValue", "getObservablePropValue_", "createObservableAnnotation", "assertObservableDescriptor", "defineObservableProperty_", "_this$options_$enhanc", "enhancer", "deepEnhancer", "desc", "initializedObjects", "WeakSet", "initializeObservable", "target", "observable", "ObservableValue", "_ann$options_$enhance", "add", "has", "call", "setObservablePropValue_", "init", "AUTO", "autoAnnotation", "createAutoAnnotation", "computed", "isGenerator", "flowAnnotation", "autoBind", "actionAnnotation", "observableAnnotation", "deep", "ref", "_this$options_4", "_this$options_5", "_this$options_6", "OBSERVABLE", "OBSERVABLE_REF", "OBSERVABLE_SHALLOW", "OBSERVABLE_STRUCT", "defaultCreateObservableOptions", "defaultDecorator", "proxy", "Object", "freeze", "asCreateObservableOptions", "thing", "observableRefAnnotation", "referenceEnhancer", "observableShallowAnnotation", "shallowEnhancer", "observableStructAnnotation", "refStructEnhancer", "observableDecoratorAnnotation", "createDecoratorAnnotation", "getEnhancerFromOptions", "getEnhancerFromAnnotation", "getAnnotationFromOptions", "_options$defaultDecor", "createObservable", "v", "arg2", "arg3", "is20223Decorator", "isStringish", "storeAnnotation", "isObservable", "isPlainObject", "object", "Array", "isArray", "array", "isES6Map", "map", "isES6Set", "box", "assign", "observableFactories", "o", "equals", "initialValues", "useProxies", "createLegacyArray", "createObservableArray", "ObservableMap", "ObservableSet", "props", "decorators", "initObservable", "extendObservable", "asDynamicObservableObject", "shallow", "struct", "COMPUTED", "COMPUTED_STRUCT", "computedAnnotation", "computedStructAnnotation", "comparer", "structural", "arg1", "opts", "currentActionId", "nextActionId", "isFunctionNameConfigurable", "_getDescriptor$config", "_getDescriptor", "getDescriptor", "tmpNameDescriptor", "actionName", "fn", "res", "executeAction", "arguments", "canRunAsDerivation", "scope", "args", "runInfo", "_startAction", "apply", "err", "error_", "_endAction", "notifySpy_", "process", "startTime_", "flattenedArgs", "prevDerivation_", "trackingDerivation", "runAsAction", "startBatch", "prevAllowStateChanges_", "allowStateChanges", "untrackedStart", "allowStateChangesStart", "prevAllowStateReads_", "allowStateReadsStart", "runAsAction_", "actionId_", "parentActionId_", "suppressReactionErrors", "allowStateChangesEnd", "allowStateReadsEnd", "endBatch", "untrackedEnd", "func", "prev", "ObservableValue", "_Atom", "value", "enhancer", "name_", "notifySpy", "equals", "comparer", "_this", "call", "hasUnreportedChange_", "interceptors_", "changeListeners_", "value_", "dehancer", "undefined", "_inheritsLoose", "_proto", "prototype", "dehanceValue", "__name", "set", "newValue", "oldValue", "prepareNewValue_", "globalState", "UNCHANGED", "isSpyEnabled", "setNewValue_", "checkIfStateModificationsAreAllowed", "hasInterceptors", "change", "interceptChange", "object", "type", "UPDATE", "reportChanged", "hasListeners", "notifyListeners", "get", "reportObserved", "intercept_", "handler", "registerInterceptor", "observe_", "listener", "fireImmediately", "observableKind", "debugObjectName", "registerListener", "raw", "toJSON", "toString", "valueOf", "toPrimitive", "Symbol", "Atom", "ComputedValue", "options", "dependenciesState_", "IDerivationState_", "NOT_TRACKING_", "observing_", "newObserving_", "observers_", "Set", "runId_", "lastAccessedBy_", "lowestObserverState_", "UP_TO_DATE_", "unboundDepsCount_", "value_", "CaughtException", "name_", "triggeredBy_", "flags_", "derivation", "setter_", "isTracing_", "TraceMode", "NONE", "scope_", "equals_", "requiresReaction_", "keepAlive_", "onBOL", "onBUOL", "get", "die", "name", "set", "createAction", "equals", "compareStructural", "struct", "comparer", "structural", "context", "requiresReaction", "keepAlive", "_proto", "prototype", "onBecomeStale_", "__name", "propagateMaybeChanged", "onBO", "forEach", "listener", "onBUO", "isComputing", "globalState", "inBatch", "size", "shouldCompute", "warnAboutUntrackedRead_", "startBatch", "computeValue_", "endBatch", "reportObserved", "prevTrackingContext", "trackingContext", "trackAndCompute", "propagateChangeConfirmed", "result", "isCaughtException", "cause", "value", "isRunningSetter", "call", "oldValue", "wasSuspended", "newValue", "changed", "track", "prev", "allowStateChangesStart", "res", "trackDerivedFunction", "disableErrorBoundaries", "e", "allowStateChangesEnd", "suspend_", "clearObserving", "undefined", "observe_", "fireImmediately", "firstTime", "prevValue", "autorun", "_this", "prevU", "untrackedStart", "observableKind", "debugObjectName", "type", "UPDATE", "object", "untrackedEnd", "toString", "valueOf", "toPrimitive", "Symbol", "_createClass", "key", "getFlag", "isComputingMask_", "setFlag", "isRunningSetterMask_", "isBeingObservedMask_", "isPendingUnobservationMask_", "diffValueMask_", "isComputedValue", "createInstanceofPredicate", "STALE_", "POSSIBLY_STALE_", "prevAllowStateReads", "allowStateReadsStart", "prevUntracked", "obs", "l", "length", "i", "obj", "allowStateReadsEnd", "changeDependenciesStateTo0", "checkIfStateModificationsAreAllowed", "atom", "hasObservers", "trackDerivedFunction", "derivation", "f", "context", "prevAllowStateReads", "allowStateReadsStart", "changeDependenciesStateTo0", "newObserving_", "Array", "runId_", "observing_", "length", "unboundDepsCount_", "globalState", "runId", "prevTracking", "trackingDerivation", "inBatch", "result", "disableErrorBoundaries", "call", "e", "CaughtException", "bindDependencies", "allowStateReadsEnd", "bindDependencies", "derivation", "prevObserving", "observing_", "observing", "newObserving_", "lowestNewObservingDerivationState", "IDerivationState_", "UP_TO_DATE_", "i0", "l", "unboundDepsCount_", "i", "dep", "diffValue", "dependenciesState_", "length", "removeObserver", "addObserver", "onBecomeStale_", "clearObserving", "obs", "NOT_TRACKING_", "untracked", "action", "prev", "untrackedStart", "untrackedEnd", "globalState", "trackingDerivation", "allowStateReadsStart", "allowStateReads", "allowStateReadsEnd", "changeDependenciesStateTo0", "lowestObserverState_", "MobXGlobals", "__name", "version", "UNCHANGED", "trackingDerivation", "trackingContext", "runId", "mobxGuid", "inBatch", "pendingUnobservations", "pendingReactions", "isRunningReactions", "allowStateChanges", "allowStateReads", "enforceActions", "spyListeners", "globalReactionErrorHandlers", "computedRequiresReaction", "reactionRequiresObservable", "observableRequiresReaction", "disableErrorBoundaries", "suppressReactionErrors", "useProxies", "verifyProxies", "safeDescriptors", "canMergeGlobalState", "isolateCalled", "globalState", "global", "getGlobal", "__mobxInstanceCount", "__mobxGlobals", "setTimeout", "die", "isolateGlobalState", "length", "undefined", "addObserver", "observable", "node", "observers_", "add", "lowestObserverState_", "dependenciesState_", "removeObserver", "size", "queueForUnobservation", "isPendingUnobservation", "globalState", "pendingUnobservations", "push", "startBatch", "inBatch", "endBatch", "runReactions", "list", "i", "length", "isBeingObserved", "onBUO", "ComputedValue", "suspend_", "reportObserved", "derivation", "trackingDerivation", "runId_", "lastAccessedBy_", "newObserving_", "unboundDepsCount_", "trackingContext", "onBO", "propagateChanged", "IDerivationState_", "STALE_", "forEach", "d", "UP_TO_DATE_", "onBecomeStale_", "propagateChangeConfirmed", "POSSIBLY_STALE_", "propagateMaybeChanged", "Reaction", "name_", "onInvalidate_", "errorHandler_", "requiresObservable_", "observing_", "newObserving_", "dependenciesState_", "IDerivationState_", "NOT_TRACKING_", "runId_", "unboundDepsCount_", "flags_", "isTracing_", "TraceMode", "NONE", "_proto", "prototype", "onBecomeStale_", "__name", "schedule_", "isScheduled", "globalState", "pendingReactions", "push", "runReactions", "runReaction_", "isDisposed", "startBatch", "prev", "trackingContext", "shouldCompute", "isTrackPending", "e", "reportExceptionInDerivation_", "endBatch", "track", "fn", "notify", "isSpyEnabled", "startTime", "isRunning", "prevReaction", "result", "trackDerivedFunction", "undefined", "clearObserving", "isCaughtException", "cause", "error", "disableErrorBoundaries", "message", "suppressReactionErrors", "console", "globalReactionErrorHandlers", "forEach", "f", "_this", "dispose", "getDisposer_", "abortSignal", "_this2", "removeEventListener", "addEventListener", "$mobx", "toString", "trace", "enterBreakPoint", "_createClass", "key", "get", "getFlag", "isDisposedMask_", "set", "newValue", "setFlag", "isScheduledMask_", "isTrackPendingMask_", "isRunningMask_", "diffValueMask_", "MAX_REACTION_ITERATIONS", "reactionScheduler", "__name", "f", "runReactions", "globalState", "inBatch", "isRunningReactions", "runReactionsHelper", "allReactions", "pendingReactions", "iterations", "length", "console", "error", "splice", "remainingReactions", "i", "l", "runReaction_", "isReaction", "createInstanceofPredicate", "Reaction", "setReactionScheduler", "fn", "baseScheduler", "isSpyEnabled", "process", "spy", "listener", "console", "warn", "ACTION", "ACTION_BOUND", "AUTOACTION", "AUTOACTION_BOUND", "DEFAULT_ACTION_NAME", "actionAnnotation", "createActionAnnotation", "actionBoundAnnotation", "bound", "autoActionAnnotation", "autoAction", "autoActionBoundAnnotation", "createActionFactory", "res", "__name", "arg1", "arg2", "isFunction", "createAction", "name", "is20223Decorator", "decorate_20223_", "isStringish", "storeAnnotation", "createDecoratorAnnotation", "action", "Object", "assign", "runInAction", "fn", "executeAction", "undefined", "isAction", "thing", "isMobxAction", "autorun", "view", "opts", "EMPTY_OBJECT", "_opts$name", "_opts", "runSync", "scheduler", "delay", "reaction", "Reaction", "track", "reactionRunner", "onError", "requiresObservable", "createSchedulerFromOptions", "isScheduled", "isDisposed", "_opts2", "signal", "aborted", "schedule_", "getDisposer_", "_opts3", "run", "f", "setTimeout", "expression", "effect", "_opts$name2", "effectAction", "wrapErrorHandler", "firstTime", "value", "equals", "compareStructural", "comparer", "structural", "r", "changed", "oldValue", "nextValue", "allowStateChanges", "fireImmediately", "_opts4", "_opts5", "errorHandler", "baseFn", "apply", "arguments", "e", "call", "ON_BECOME_OBSERVED", "ON_BECOME_UNOBSERVED", "onBecomeObserved", "arg3", "interceptHook", "onBecomeUnobserved", "hook", "atom", "getAtom", "cb", "listenersKey", "add", "Set", "hookListeners", "size", "NEVER", "ALWAYS", "OBSERVED", "configure", "options", "isolateGlobalState", "useProxies", "enforceActions", "globalState", "Proxy", "verifyProxies", "ea", "forEach", "key", "allowStateReads", "observableRequiresReaction", "reactionScheduler", "setReactionScheduler", "extendObservable", "target", "properties", "annotations", "descriptors", "getOwnPropertyDescriptors", "initObservable", "adm", "asObservableObject", "$mobx", "ownKeys", "extend_", "getDependencyTree", "property", "nodeToDependencyTree", "node", "result", "name_", "observing_", "length", "dependencies", "unique", "map", "unique", "list", "Array", "from", "Set", "generatorId", "FlowCancellationError", "message", "prototype", "Object", "create", "Error", "flowAnnotation", "createFlowAnnotation", "flowBoundAnnotation", "bound", "flow", "Object", "assign", "__name", "arg1", "arg2", "is20223Decorator", "decorate_20223_", "isStringish", "storeAnnotation", "generator", "name", "res", "ctx", "args", "arguments", "runId", "generatorId", "gen", "action", "apply", "rejector", "pendingPromise", "undefined", "promise", "Promise", "resolve", "reject", "stepId", "onFulfilled", "ret", "next", "call", "e", "onRejected", "err", "isFunction", "then", "done", "value", "cancel", "cancelPromise", "yieldedPromise", "noop", "FlowCancellationError", "isMobXFlow", "createDecoratorAnnotation", "isFlow", "fn", "isMobXFlow", "_isObservable", "value", "property", "undefined", "isObservableObject", "$mobx", "values_", "has", "isAtom", "isReaction", "isComputedValue", "isObservable", "trace", "enterBreakPoint", "_len", "args", "_key", "arguments", "derivation", "getAtomFromArgs", "length", "globalState", "trackingDerivation", "getAtom", "transaction", "action", "thisArg", "undefined", "startBatch", "apply", "endBatch", "getAdm", "target", "$mobx", "objectProxyTraps", "has", "__name", "name", "has_", "get", "get_", "set", "value", "isStringish", "_getAdm$set_", "set_", "deleteProperty", "_getAdm$delete_", "delete_", "defineProperty", "descriptor", "_getAdm$definePropert", "defineProperty_", "ownKeys", "ownKeys_", "preventExtensions", "die", "asDynamicObservableObject", "options", "assertProxies", "asObservableObject", "_target$$mobx$proxy_", "_target$$mobx", "proxy_", "Proxy", "hasInterceptors", "interceptable", "interceptors_", "undefined", "length", "registerInterceptor", "handler", "interceptors", "push", "once", "idx", "indexOf", "splice", "interceptChange", "change", "prevU", "untrackedStart", "concat", "i", "l", "type", "untrackedEnd", "hasListeners", "listenable", "changeListeners_", "registerListener", "listeners", "notifyListeners", "slice", "makeObservable", "annotations", "initObservable", "adm", "_annotations", "collectStoredAnnotations", "forEach", "key", "make_", "SPLICE", "UPDATE", "MAX_SPLICE_SIZE", "arrayTraps", "get", "__name", "target", "name", "adm", "$mobx", "getArrayLength_", "isNaN", "get_", "parseInt", "hasProp", "arrayExtensions", "set", "value", "setArrayLength_", "set_", "preventExtensions", "die", "ObservableArrayAdministration", "enhancer", "owned_", "legacyMode_", "atom_", "values_", "interceptors_", "changeListeners_", "enhancer_", "dehancer", "proxy_", "lastKnownLength_", "Atom", "newV", "oldV", "_proto", "prototype", "dehanceValue_", "undefined", "dehanceValues_", "values", "length", "map", "intercept_", "handler", "registerInterceptor", "observe_", "listener", "fireImmediately", "observableKind", "object", "debugObjectName", "name_", "type", "index", "added", "slice", "addedCount", "removed", "removedCount", "registerListener", "reportObserved", "newLength", "currentLength", "newItems", "Array", "i", "spliceWithArray_", "updateArrayLength_", "oldLength", "delta", "reserveArrayBuffer", "deleteCount", "checkIfStateModificationsAreAllowed", "Math", "max", "arguments", "min", "EMPTY_ARRAY", "hasInterceptors", "change", "interceptChange", "v", "_this", "lengthDelta", "res", "spliceItemsIntoValues_", "notifyArraySplice_", "_this$values_", "splice", "apply", "concat", "oldItems", "notifyArrayChildUpdate_", "newValue", "oldValue", "notifySpy", "isSpyEnabled", "notify", "hasListeners", "reportChanged", "notifyListeners", "console", "warn", "changed", "createObservableArray", "initialValues", "owned", "assertProxies", "initObservable", "addHiddenFinalProp", "proxy", "Proxy", "clear", "replace", "toJSON", "_len", "_key", "spliceWithArray", "push", "_len2", "items", "_key2", "pop", "shift", "unshift", "_len3", "_key3", "reverse", "globalState", "trackingDerivation", "sort", "copy", "remove", "idx", "indexOf", "addArrayExtension", "simpleFunc", "mapLikeFunc", "reduceLikeFunc", "funcName", "funcFactory", "dehancedValues", "callback", "thisArg", "element", "call", "_this2", "accumulator", "currentValue", "_this3", "isObservableArrayAdministration", "createInstanceofPredicate", "isObservableArray", "thing", "isObject", "ObservableMapMarker", "ADD", "DELETE", "ObservableMap", "initialData", "deepEnhancer", "data_", "hasMap_", "keysAtom_", "isFunction", "Map", "createAtom", "merge", "has_", "key", "has", "entry", "newEntry", "ObservableValue", "referenceEnhancer", "onBecomeUnobserved", "hasKey", "updateValue_", "addValue_", "value_", "transaction", "_this3$hasMap_$get", "setNewValue_", "observable", "prepareNewValue_", "UNCHANGED", "_this4", "_this4$hasMap_$get", "keys", "self", "makeIterableForMap", "next", "_keys$next", "done", "entries", "_keys$next2", "Symbol", "iterator", "forEach", "_iterator", "_createForOfIteratorHelperLoose", "_step", "_step$value", "other", "isObservableMap", "isPlainObject", "getPlainObjectKeys", "_this5", "isArray", "_ref", "isES6Map", "isPlainES6Map", "untracked", "_iterator2", "_this6", "_step2", "replacementMap", "convertToMap", "orderedData", "keysReportChangedCalled", "_iterator3", "_this7", "_step3", "deleted", "_iterator4", "_step4", "_step4$value", "keyExisted", "size", "iter1", "iter2", "next1", "next2", "toString", "from", "_createClass", "toStringTag", "makeIterable", "dataStructure", "ObservableSetMarker", "ObservableSet", "Set", "callbackFn", "add", "process", "makeIterableForSet", "_values$next", "_values$next2", "intersection", "otherSet", "isES6Set", "isObservableSet", "dehancedSet", "union", "difference", "symmetricDifference", "isSubsetOf", "isSupersetOf", "isDisjointFrom", "descriptorCache", "Object", "create", "REMOVE", "ObservableObjectAdministration", "target_", "defaultAnnotation_", "autoAnnotation", "isPlainObject_", "appliedAnnotations_", "pendingKeys_", "getObservablePropValue_", "setObservablePropValue_", "ComputedValue", "proxyTrap", "Reflect", "extend_", "enumerable", "writable", "configurable", "make_", "annotation", "assertAnnotable", "_this$target_$storedA", "storedAnnotationsSymbol", "annotationType_", "source", "objectPrototype", "descriptor", "getDescriptor", "outcome", "getPrototypeOf", "recordAnnotationApplied", "defineProperty_", "startBatch", "deleteOutcome", "delete_", "_extends", "defineProperty", "notifyPropertyAddition_", "endBatch", "defineObservableProperty_", "cachedDescriptor", "getCachedObservablePropDescriptor", "safeDescriptors", "defineComputedProperty_", "options", "context", "_this$pendingKeys_", "_getDescriptor", "deleteProperty", "propagateChanged", "_this$pendingKeys_2", "ownKeys_", "ownKeys", "keys_", "asObservableObject", "_options$name", "String", "getAnnotationFromOptions", "addHiddenProp", "isObservableObjectAdministration", "isObservableObject", "_adm$target_$storedAn", "fieldName", "currentAnnotationType", "requestedAnnotationType", "ENTRY_0", "createArrayEntryDescriptor", "safariPrototypeSetterInheritanceBug", "p", "OBSERVABLE_ARRAY_BUFFER_SIZE", "StubArray", "inherit", "ctor", "proto", "setPrototypeOf", "__proto__", "LegacyObservableArray", "_StubArray", "_inheritsLoose", "arrays", "a", "nextIndex", "prop", "fn", "createArrayBufferItem", "createLegacyArray", "getAtom", "property", "getDebugName", "isAtom", "isComputedValue", "isReaction", "getAdministration", "named", "isAction", "cb", "derivation", "untrackedStart", "allowStateChanges", "allowStateChangesStart", "allowStateChangesEnd", "untrackedEnd", "deepEqual", "b", "depth", "eq", "aStack", "bStack", "className", "valueOf", "unwrap", "areArrays", "aCtor", "constructor", "bCtor", "maybeIteratorPrototype", "_getGlobal$Iterator", "getGlobal", "Iterator", "getSelf", "assign", "forEach", "m", "g", "getGlobal", "die", "__MOBX_DEVTOOLS_GLOBAL_HOOK__", "injectMobx", "spy", "extras", "getDebugName", "$mobx", "init_compat_module", "import_classnames", "classNames", "classNames_", "running_on_mobile_device", "memoize", "running_on_tablet", "running_on_phone", "running_on_android", "running_on_ios", "running_on_ios_13_and_above", "running_on_mac", "running_on_mac_safari", "running_as_pwa", "scraped_by_search_bot", "input_capture_supported", "passive_events_supported", "result", "opts", "__name", "can_enter_fullscreen", "d", "enter_fullscreen", "on_exit_fullscreen", "nop", "f", "can_exit_fullscreen", "exit_fullscreen", "cancel_event", "_trap_browser_back_initialized", "_trap_browser_back_callback", "_trap_browser_back_suspended", "trap_browser_back", "id", "callback", "with_perfect_scrollbar", "elm", "ref", "onMouseEnter", "className", "dir", "handlers", "hide_until_active", "ps", "Rn", "e", "elm_ref", "perfect_scrollbar_opts", "is_webp_supported", "memoize", "resolve", "img", "is_avif_supported", "detect_scrollbar_width", "container", "inner", "result", "__name"] }