You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
24 KiB

2 years ago
{"ast":null,"code":"/* global __webpack_require__ */\nvar Refresh = require('react-refresh/runtime');\n/**\n * Extracts exports from a webpack module object.\n * @param {string} moduleId A Webpack module ID.\n * @returns {*} An exports object from the module.\n */\n\n\nfunction getModuleExports(moduleId) {\n if (typeof moduleId === 'undefined') {\n // `moduleId` is unavailable, which indicates that this module is not in the cache,\n // which means we won't be able to capture any exports,\n // and thus they cannot be refreshed safely.\n // These are likely runtime or dynamically generated modules.\n return {};\n }\n\n var maybeModule = __webpack_require__.c[moduleId];\n\n if (typeof maybeModule === 'undefined') {\n // `moduleId` is available but the module in cache is unavailable,\n // which indicates the module is somehow corrupted (e.g. broken Webpacak `module` globals).\n // We will warn the user (as this is likely a mistake) and assume they cannot be refreshed.\n console.warn('[React Refresh] Failed to get exports for module: ' + moduleId + '.');\n return {};\n }\n\n var exportsOrPromise = maybeModule.exports;\n\n if (typeof Promise !== 'undefined' && exportsOrPromise instanceof Promise) {\n return exportsOrPromise.then(function (exports) {\n return exports;\n });\n }\n\n return exportsOrPromise;\n}\n/**\n * Calculates the signature of a React refresh boundary.\n * If this signature changes, it's unsafe to accept the boundary.\n *\n * This implementation is based on the one in [Metro](https://github.com/facebook/metro/blob/907d6af22ac6ebe58572be418e9253a90665ecbd/packages/metro/src/lib/polyfills/require.js#L795-L816).\n * @param {*} moduleExports A Webpack module exports object.\n * @returns {string[]} A React refresh boundary signature array.\n */\n\n\nfunction getReactRefreshBoundarySignature(moduleExports) {\n var signature = [];\n signature.push(Refresh.getFamilyByType(moduleExports));\n\n if (moduleExports == null || typeof moduleExports !== 'object') {\n // Exit if we can't iterate over exports.\n return signature;\n }\n\n for (var key in moduleExports) {\n if (key === '__esModule') {\n continue;\n }\n\n signature.push(key);\n signature.push(Refresh.getFamilyByType(moduleExports[key]));\n }\n\n return signature;\n}\n/**\n * Creates a helper that performs a delayed React refresh.\n * @returns {function(function(): void): void} A debounced React refresh function.\n */\n\n\nfunction createDebounceUpdate() {\n /**\n * A cached setTimeout handler.\n * @type {number | undefined}\n */\n var refreshTimeout;\n /**\n * Performs react refresh on a delay and clears the error overlay.\n * @param {function(): void} callback\n * @returns {void}\n */\n\n function enqueueUpdate(callback) {\n if (typeof refreshTimeout === 'undefined') {\n refreshTimeout = setTimeout(function () {\n refreshTimeout = undefined;\n Refresh.performReactRefresh();\n callback();\n }, 30);\n }\n }\n\n return enqueueUpdate;\n}\n/**\n * Checks if all exports are likely a React component.\n *\n * This implementation is based on the one in [Metro](https://github.com/facebook/metro/blob/febdba2383113c88296c61e28e4ef6a7f4939fda/packages/metro/src/lib/polyfills/require.js#L748-L774).\n * @param {*} moduleExports A Webpack module exports object.\n * @returns {boolean} Whether the exports are React component like.\n */\n\n\nfunction isReactRefreshBoundary(moduleExports) {\n if (Refresh.isLikelyComponentType(moduleExports)) {\n return true;\n }\n\n if (moduleExports === undefined || moduleExports === null || typeof moduleExports !== 'object') {\n // Exit if we can't iterate over exports.\n return false;\n }\n\n var hasExports = false;\n var areAllExportsComponents = true;\n\n for (var key in moduleExports) {\n hasExports = true; // This is the ES Module indicator flag\n\n if (key === '__esModule') {\n continue;\n } // We can (and have to) safely execute getters here,\n // as Webpack manually assi