1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-12-12 15:51:06 +01:00
upscayl/renderer/.next/static/chunks/react-refresh.js
Nayam Amarshe 0e1e2d1229 Init
2022-08-02 14:28:24 +05:30

62 lines
75 KiB
JavaScript

// runtime can't be in strict mode because a global variable is assign and maybe created.
/*
* ATTENTION: An "eval-source-map" devtool has been used.
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([["react-refresh"],{
/***/ "../node_modules/next/dist/compiled/@next/react-refresh-utils/dist/internal/helpers.js":
/*!*********************************************************************************************!*\
!*** ../node_modules/next/dist/compiled/@next/react-refresh-utils/dist/internal/helpers.js ***!
\*********************************************************************************************/
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval(__webpack_require__.ts("\n/**\n * MIT License\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n// This file is copied from the Metro JavaScript bundler, with minor tweaks for\n// webpack 4 compatibility.\n//\n// https://github.com/facebook/metro/blob/d6b9685c730d0d63577db40f41369157f28dfa3a/packages/metro/src/lib/polyfills/require.js\nconst runtime_1 = __importDefault(__webpack_require__(/*! next/dist/compiled/react-refresh/runtime */ \"../node_modules/next/dist/compiled/react-refresh/runtime.js\"));\nfunction isSafeExport(key) {\n return (key === '__esModule' ||\n key === '__N_SSG' ||\n key === '__N_SSP' ||\n key === '__N_RSC' ||\n // TODO: remove this key from page config instead of allow listing it\n key === 'config');\n}\nfunction registerExportsForReactRefresh(moduleExports, moduleID) {\n runtime_1.default.register(moduleExports, moduleID + ' %exports%');\n if (moduleExports == null || typeof moduleExports !== 'object') {\n // Exit if we can't iterate over exports.\n // (This is important for legacy environments.)\n return;\n }\n for (var key in moduleExports) {\n if (isSafeExport(key)) {\n continue;\n }\n var exportValue = moduleExports[key];\n var typeID = moduleID + ' %exports% ' + key;\n runtime_1.default.register(exportValue, typeID);\n }\n}\nfunction isReactRefreshBoundary(moduleExports) {\n if (runtime_1.default.isLikelyComponentType(moduleExports)) {\n return true;\n }\n if (moduleExports == null || typeof moduleExports !== 'object') {\n // Exit if we can't iterate over exports.\n return false;\n }\n var hasExports = false;\n var areAllExportsComponents = true;\n for (var key in moduleExports) {\n hasExports = true;\n if (isSafeExport(key)) {\n continue;\n }\n var exportValue = moduleExports[key];\n if (!runtime_1.default.isLikelyComponentType(exportValue)) {\n areAllExportsComponents = false;\n }\n }\n return hasExports && areAllExportsComponents;\n}\nfunction shouldInvalidateReactRefreshBoundary(prevExports, nextExports) {\n var prevSignature = getRefreshBoundarySignature(prevExports);\n var nextSignature = getRefreshBoundarySignature(nextExports);\n if (prevSignature.length !== nextSignature.length) {\n return true;\n }\n for (var i = 0; i < nextSignature.length; i++) {\n if (prevSignature[i] !== nextSignature[i]) {\n return true;\n }\n }\n return false;\n}\nfunction getRefreshBoundarySignature(moduleExports) {\n var signature = [];\n signature.push(runtime_1.default.getFamilyByType(moduleExports));\n if (moduleExports == null || typeof moduleExports !== 'object') {\n // Exit if we can't iterate over exports.\n // (This is important for legacy environments.)\n return signature;\n }\n for (var key in moduleExports) {\n if (isSafeExport(key)) {\n continue;\n }\n var exportValue = moduleExports[key];\n signature.push(key);\n signature.push(runtime_1.default.getFamilyByType(exportValue));\n }\n return signature;\n}\nvar isUpdateScheduled = false;\nfunction scheduleUpdate() {\n if (isUpdateScheduled) {\n return;\n }\n function canApplyUpdate() {\n return module.hot.status() === 'idle';\n }\n isUpdateScheduled = true;\n setTimeout(function () {\n isUpdateScheduled = false;\n // Only trigger refresh if the webpack HMR state is idle\n if (canApplyUpdate()) {\n try {\n runtime_1.default.performReactRefresh();\n }\n catch (err) {\n console.warn('Warning: Failed to re-render. We will retry on the next Fast Refresh event.\\n' +\n err);\n }\n return;\n }\n return scheduleUpdate();\n }, 30);\n}\n// Needs to be compatible with IE11\nexports[\"default\"] = {\n registerExportsForReactRefresh: registerExportsForReactRefresh,\n isReactRefreshBoundary: isReactRefreshBoundary,\n shouldInvalidateReactRefreshBoundary: shouldInvalidateReactRefreshBoundary,\n getRefreshBoundarySignature: getRefreshBoundarySignature,\n scheduleUpdate: scheduleUpdate,\n};\n//# sourceMappingURL=helpers.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi4vbm9kZV9tb2R1bGVzL25leHQvZGlzdC9jb21waWxlZC9AbmV4dC9yZWFjdC1yZWZyZXNoLXV0aWxzL2Rpc3QvaW50ZXJuYWwvaGVscGVycy5qcy5qcyIsIm1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ICAgIGdldFJlZnJlc2hCb3VuZGFyeVNpZ25hdHVyZTogZ2V0UmVmcmVzaEJvdW5kYXJ5U2lnbmF0dXJlLFxuICAgIHNjaGVkdWxlVXBkYXRlOiBzY2hlZHVsZVVwZGF0ZSxcbn07XG4vLyMgc291cmNlTWFwcGluZ1VSTD1oZWxwZXJzLmpzLm1hcCJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///../node_modules/next/dist/compiled/@next/react-refresh-utils/dist/internal/helpers.js\n"));
/***/ }),
/***/ "../node_modules/next/dist/compiled/@next/react-refresh-utils/dist/runtime.js":
/*!************************************************************************************!*\
!*** ../node_modules/next/dist/compiled/@next/react-refresh-utils/dist/runtime.js ***!
\************************************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
eval(__webpack_require__.ts("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst runtime_1 = __importDefault(__webpack_require__(/*! next/dist/compiled/react-refresh/runtime */ \"../node_modules/next/dist/compiled/react-refresh/runtime.js\"));\nconst helpers_1 = __importDefault(__webpack_require__(/*! ./internal/helpers */ \"../node_modules/next/dist/compiled/@next/react-refresh-utils/dist/internal/helpers.js\"));\n// Hook into ReactDOM initialization\nruntime_1.default.injectIntoGlobalHook(self);\n// Register global helpers\nself.$RefreshHelpers$ = helpers_1.default;\n// Register a helper for module execution interception\nself.$RefreshInterceptModuleExecution$ = function (webpackModuleId) {\n var prevRefreshReg = self.$RefreshReg$;\n var prevRefreshSig = self.$RefreshSig$;\n self.$RefreshReg$ = function (type, id) {\n runtime_1.default.register(type, webpackModuleId + ' ' + id);\n };\n self.$RefreshSig$ = runtime_1.default.createSignatureFunctionForTransform;\n // Modeled after `useEffect` cleanup pattern:\n // https://reactjs.org/docs/hooks-effect.html#effects-with-cleanup\n return function () {\n self.$RefreshReg$ = prevRefreshReg;\n self.$RefreshSig$ = prevRefreshSig;\n };\n};\n//# sourceMappingURL=runtime.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi4vbm9kZV9tb2R1bGVzL25leHQvZGlzdC9jb21waWxlZC9AbmV4dC9yZWFjdC1yZWZyZXNoLXV0aWxzL2Rpc3QvcnVudGltZS5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiO0FBQ0EsNkNBQTZDO0FBQzdDO0FBQ0EsOENBQTZDLEVBQUUsYUFBYSxFQUFDO0FBQzdELGtDQUFrQyxtQkFBTyxDQUFDLDZHQUEwQztBQUNwRixrQ0FBa0MsbUJBQU8sQ0FBQyxpSEFBb0I7QUFDOUQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi4vbm9kZV9tb2R1bGVzL25leHQvZGlzdC9jb21waWxlZC9AbmV4dC9yZWFjdC1yZWZyZXNoLXV0aWxzL2Rpc3QvcnVudGltZS5qcz81ODk0Il0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xudmFyIF9faW1wb3J0RGVmYXVsdCA9ICh0aGlzICYmIHRoaXMuX19pbXBvcnREZWZhdWx0KSB8fCBmdW5jdGlvbiAobW9kKSB7XG4gICAgcmV0dXJuIChtb2QgJiYgbW9kLl9fZXNNb2R1bGUpID8gbW9kIDogeyBcImRlZmF1bHRcIjogbW9kIH07XG59O1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlOiB0cnVlIH0pO1xuY29uc3QgcnVudGltZV8xID0gX19pbXBvcnREZWZ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mZmVjdC5odG1sI2VmZmVjdHMtd2l0aC1jbGVhbnVwXG4gICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgc2VsZi4kUmVmcmVzaFJlZyQgPSBwcmV2UmVmcmVzaFJlZztcbiAgICAgICAgc2VsZi4kUmVmcmVzaFNpZyQgPSBwcmV2UmVmcmVzaFNpZztcbiAgICB9O1xufTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXJ1bnRpbWUuanMubWFwIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///../node_modules/next/dist/compiled/@next/react-refresh-utils/dist/runtime.js\n"));
/***/ }),
/***/ "../node_modules/next/dist/compiled/react-refresh/cjs/react-refresh-runtime.development.js":
/*!*************************************************************************************************!*\
!*** ../node_modules/next/dist/compiled/react-refresh/cjs/react-refresh-runtime.development.js ***!
\*************************************************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
eval(__webpack_require__.ts("/**\n * @license React\n * react-refresh-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nif (true) {\n (function() {\n'use strict';\n\n// ATTENTION\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\n\nvar PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // We never remove these associations.\n// It's OK to reference families, but use WeakMap/Set for types.\n\nvar allFamiliesByID = new Map();\nvar allFamiliesByType = new PossiblyWeakMap();\nvar allSignaturesByType = new PossiblyWeakMap(); // This WeakMap is read by React, so we only put families\n// that have actually been edited here. This keeps checks fast.\n// $FlowIssue\n\nvar updatedFamiliesByType = new PossiblyWeakMap(); // This is cleared on every performReactRefresh() call.\n// It is an array of [Family, NextType] tuples.\n\nvar pendingUpdates = []; // This is injected by the renderer via DevTools global hook.\n\nvar helpersByRendererID = new Map();\nvar helpersByRoot = new Map(); // We keep track of mounted roots so we can schedule updates.\n\nvar mountedRoots = new Set(); // If a root captures an error, we remember it so we can retry on edit.\n\nvar failedRoots = new Set(); // In environments that support WeakMap, we also remember the last element for every root.\n// It needs to be weak because we do this even for roots that failed to mount.\n// If there is no WeakMap, we won't attempt to do retrying.\n// $FlowIssue\n\nvar rootElements = // $FlowIssue\ntypeof WeakMap === 'function' ? new WeakMap() : null;\nvar isPerformingRefresh = false;\n\nfunction computeFullKey(signature) {\n if (signature.fullKey !== null) {\n return signature.fullKey;\n }\n\n var fullKey = signature.ownKey;\n var hooks;\n\n try {\n hooks = signature.getCustomHooks();\n } catch (err) {\n // This can happen in an edge case, e.g. if expression like Foo.useSomething\n // depends on Foo which is lazily initialized during rendering.\n // In that case just assume we'll have to remount.\n signature.forceReset = true;\n signature.fullKey = fullKey;\n return fullKey;\n }\n\n for (var i = 0; i < hooks.length; i++) {\n var hook = hooks[i];\n\n if (typeof hook !== 'function') {\n // Something's wrong. Assume we need to remount.\n signature.forceReset = true;\n signature.fullKey = fullKey;\n return fullKey;\n }\n\n var nestedHookSignature = allSignaturesByType.get(hook);\n\n if (nestedHookSignature === undefined) {\n // No signature means Hook wasn't in the source code, e.g. in a library.\n // We'll skip it because we can assume it won't change during this session.\n continue;\n }\n\n var nestedHookKey = computeFullKey(nestedHookSignature);\n\n if (nestedHookSignature.forceReset) {\n signature.forceReset = true;\n }\n\n fullKey += '\\n---\\n' + nestedHookKey;\n }\n\n signature.fullKey = fullKey;\n return fullKey;\n}\n\nfunction haveEqualSignatures(prevType, nextType) {\n var prevSignature = allSignaturesByType.get(prevType);\n var nextSignature = allSignaturesByType.get(nextType);\n\n if (prevSignature === undefined && nextSignature === undefined) {\n return true;\n }\n\n if (prevSignature === undefined || nextSignature === undefined) {\n return false;\n }\n\n if (computeFullKey(prevSignature) !== computeFullKey(nextSignature)) {\n return false;\n }\n\n if (nextSignature.forceReset) {\n return false;\n }\n\n return true;\n}\n\nfunction isReactClass(type) {\n return type.prototype && type.prototype.isReactComponent;\n}\n\nfunction canPreserveStateBetween(prevType, nextType) {\n if (isReactClass(prevType) || isReactClass(nextType)) {\n return false;\n }\n\n if (haveEqualSignatures(prevType, nextType)) {\n return true;\n }\n\n return false;\n}\n\nfunction resolveFamily(type) {\n // Only check updated types to keep lookups fast.\n return updatedFamiliesByType.get(type);\n} // If we didn't care about IE11, we could use new Map/Set(iterable).\n\n\nfunction cloneMap(map) {\n var clone = new Map();\n map.forEach(function (value, key) {\n clone.set(key, value);\n });\n return clone;\n}\n\nfunction cloneSet(set) {\n var clone = new Set();\n set.forEach(function (value) {\n clone.add(value);\n });\n return clone;\n} // This is a safety mechanism to protect against rogue getters and Proxies.\n\n\nfunction getProperty(object, property) {\n try {\n return object[property];\n } catch (err) {\n // Intentionally ignore.\n return undefined;\n }\n}\n\nfunction performReactRefresh() {\n\n if (pendingUpdates.length === 0) {\n return null;\n }\n\n if (isPerformingRefresh) {\n return null;\n }\n\n isPerformingRefresh = true;\n\n try {\n var staleFamilies = new Set();\n var updatedFamilies = new Set();\n var updates = pendingUpdates;\n pendingUpdates = [];\n updates.forEach(function (_ref) {\n var family = _ref[0],\n nextType = _ref[1];\n // Now that we got a real edit, we can create associations\n // that will be read by the React reconciler.\n var prevType = family.current;\n updatedFamiliesByType.set(prevType, family);\n updatedFamiliesByType.set(nextType, family);\n family.current = nextType; // Determine whether this should be a re-render or a re-mount.\n\n if (canPreserveStateBetween(prevType, nextType)) {\n updatedFamilies.add(family);\n } else {\n staleFamilies.add(family);\n }\n }); // TODO: rename these fields to something more meaningful.\n\n var update = {\n updatedFamilies: updatedFamilies,\n // Families that will re-render preserving state\n staleFamilies: staleFamilies // Families that will be remounted\n\n };\n helpersByRendererID.forEach(function (helpers) {\n // Even if there are no roots, set the handler on first update.\n // This ensures that if *new* roots are mounted, they'll use the resolve handler.\n helpers.setRefreshHandler(resolveFamily);\n });\n var didError = false;\n var firstError = null; // We snapshot maps and sets that are mutated during commits.\n // If we don't do this, there is a risk they will be mutated while\n // we iterate over them. For example, trying to recover a failed root\n // may cause another root to be added to the failed list -- an infinite loop.\n\n var failedRootsSnapshot = cloneSet(failedRoots);\n var mountedRootsSnapshot = cloneSet(mountedRoots);\n var helpersByRootSnapshot = cloneMap(helpersByRoot);\n failedRootsSnapshot.forEach(function (root) {\n var helpers = helpersByRootSnapshot.get(root);\n\n if (helpers === undefined) {\n throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n }\n\n if (!failedRoots.has(root)) {// No longer failed.\n }\n\n if (rootElements === null) {\n return;\n }\n\n if (!rootElements.has(root)) {\n return;\n }\n\n var element = rootElements.get(root);\n\n try {\n helpers.scheduleRoot(root, element);\n } catch (err) {\n if (!didError) {\n didError = true;\n firstError = err;\n } // Keep trying other roots.\n\n }\n });\n mountedRootsSnapshot.forEach(function (root) {\n var helpers = helpersByRootSnapshot.get(root);\n\n if (helpers === undefined) {\n throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n }\n\n if (!mountedRoots.has(root)) {// No longer mounted.\n }\n\n try {\n helpers.scheduleRefresh(root, update);\n } catch (err) {\n if (!didError) {\n didError = true;\n firstError = err;\n } // Keep trying other roots.\n\n }\n });\n\n if (didError) {\n throw firstError;\n }\n\n return update;\n } finally {\n isPerformingRefresh = false;\n }\n}\nfunction register(type, id) {\n {\n if (type === null) {\n return;\n }\n\n if (typeof type !== 'function' && typeof type !== 'object') {\n return;\n } // This can happen in an edge case, e.g. if we register\n // return value of a HOC but it returns a cached component.\n // Ignore anything but the first registration for each type.\n\n\n if (allFamiliesByType.has(type)) {\n return;\n } // Create family or remember to update it.\n // None of this bookkeeping affects reconciliation\n // until the first performReactRefresh() call above.\n\n\n var family = allFamiliesByID.get(id);\n\n if (family === undefined) {\n family = {\n current: type\n };\n allFamiliesByID.set(id, family);\n } else {\n pendingUpdates.push([family, type]);\n }\n\n allFamiliesByType.set(type, family); // Visit inner types because we might not have registered them.\n\n if (typeof type === 'object' && type !== null) {\n switch (getProperty(type, '$$typeof')) {\n case REACT_FORWARD_REF_TYPE:\n register(type.render, id + '$render');\n break;\n\n case REACT_MEMO_TYPE:\n register(type.type, id + '$type');\n break;\n }\n }\n }\n}\nfunction setSignature(type, key) {\n var forceReset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var getCustomHooks = arguments.length > 3 ? arguments[3] : undefined;\n\n {\n if (!allSignaturesByType.has(type)) {\n allSignaturesByType.set(type, {\n forceReset: forceReset,\n ownKey: key,\n fullKey: null,\n getCustomHooks: getCustomHooks || function () {\n return [];\n }\n });\n } // Visit inner types because we might not have signed them.\n\n\n if (typeof type === 'object' && type !== null) {\n switch (getProperty(type, '$$typeof')) {\n case REACT_FORWARD_REF_TYPE:\n setSignature(type.render, key, forceReset, getCustomHooks);\n break;\n\n case REACT_MEMO_TYPE:\n setSignature(type.type, key, forceReset, getCustomHooks);\n break;\n }\n }\n }\n} // This is lazily called during first render for a type.\n// It captures Hook list at that time so inline requires don't break comparisons.\n\nfunction collectCustomHooksForSignature(type) {\n {\n var signature = allSignaturesByType.get(type);\n\n if (signature !== undefined) {\n computeFullKey(signature);\n }\n }\n}\nfunction getFamilyByID(id) {\n {\n return allFamiliesByID.get(id);\n }\n}\nfunction getFamilyByType(type) {\n {\n return allFamiliesByType.get(type);\n }\n}\nfunction findAffectedHostInstances(families) {\n {\n var affectedInstances = new Set();\n mountedRoots.forEach(function (root) {\n var helpers = helpersByRoot.get(root);\n\n if (helpers === undefined) {\n throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n }\n\n var instancesForRoot = helpers.findHostInstancesForRefresh(root, families);\n instancesForRoot.forEach(function (inst) {\n affectedInstances.add(inst);\n });\n });\n return affectedInstances;\n }\n}\nfunction injectIntoGlobalHook(globalObject) {\n {\n // For React Native, the global hook will be set up by require('react-devtools-core').\n // That code will run before us. So we need to monkeypatch functions on existing hook.\n // For React Web, the global hook will be set up by the extension.\n // This will also run before us.\n var hook = globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__;\n\n if (hook === undefined) {\n // However, if there is no DevTools extension, we'll need to set up the global hook ourselves.\n // Note that in this case it's important that renderer code runs *after* this method call.\n // Otherwise, the renderer will think that there is no global hook, and won't do the injection.\n var nextID = 0;\n globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = {\n renderers: new Map(),\n supportsFiber: true,\n inject: function (injected) {\n return nextID++;\n },\n onScheduleFiberRoot: function (id, root, children) {},\n onCommitFiberRoot: function (id, root, maybePriorityLevel, didError) {},\n onCommitFiberUnmount: function () {}\n };\n }\n\n if (hook.isDisabled) {\n // This isn't a real property on the hook, but it can be set to opt out\n // of DevTools integration and associated warnings and logs.\n // Using console['warn'] to evade Babel and ESLint\n console['warn']('Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). ' + 'Fast Refresh is not compatible with this shim and will be disabled.');\n return;\n } // Here, we just want to get a reference to scheduleRefresh.\n\n\n var oldInject = hook.inject;\n\n hook.inject = function (injected) {\n var id = oldInject.apply(this, arguments);\n\n if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {\n // This version supports React Refresh.\n helpersByRendererID.set(id, injected);\n }\n\n return id;\n }; // Do the same for any already injected roots.\n // This is useful if ReactDOM has already been initialized.\n // https://github.com/facebook/react/issues/17626\n\n\n hook.renderers.forEach(function (injected, id) {\n if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {\n // This version supports React Refresh.\n helpersByRendererID.set(id, injected);\n }\n }); // We also want to track currently mounted roots.\n\n var oldOnCommitFiberRoot = hook.onCommitFiberRoot;\n\n var oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || function () {};\n\n hook.onScheduleFiberRoot = function (id, root, children) {\n if (!isPerformingRefresh) {\n // If it was intentionally scheduled, don't attempt to restore.\n // This includes intentionally scheduled unmounts.\n failedRoots.delete(root);\n\n if (rootElements !== null) {\n rootElements.set(root, children);\n }\n }\n\n return oldOnScheduleFiberRoot.apply(this, arguments);\n };\n\n hook.onCommitFiberRoot = function (id, root, maybePriorityLevel, didError) {\n var helpers = helpersByRendererID.get(id);\n\n if (helpers !== undefined) {\n helpersByRoot.set(root, helpers);\n var current = root.current;\n var alternate = current.alternate; // We need to determine whether this root has just (un)mounted.\n // This logic is copy-pasted from similar logic in the DevTools backend.\n // If this breaks with some refactoring, you'll want to update DevTools too.\n\n if (alternate !== null) {\n var wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null && mountedRoots.has(root);\n var isMounted = current.memoizedState != null && current.memoizedState.element != null;\n\n if (!wasMounted && isMounted) {\n // Mount a new root.\n mountedRoots.add(root);\n failedRoots.delete(root);\n } else if (wasMounted && isMounted) ; else if (wasMounted && !isMounted) {\n // Unmount an existing root.\n mountedRoots.delete(root);\n\n if (didError) {\n // We'll remount it on future edits.\n failedRoots.add(root);\n } else {\n helpersByRoot.delete(root);\n }\n } else if (!wasMounted && !isMounted) {\n if (didError) {\n // We'll remount it on future edits.\n failedRoots.add(root);\n }\n }\n } else {\n // Mount a new root.\n mountedRoots.add(root);\n }\n } // Always call the decorated DevTools hook.\n\n\n return oldOnCommitFiberRoot.apply(this, arguments);\n };\n }\n}\nfunction hasUnrecoverableErrors() {\n // TODO: delete this after removing dependency in RN.\n return false;\n} // Exposed for testing.\n\nfunction _getMountedRootCount() {\n {\n return mountedRoots.size;\n }\n} // This is a wrapper over more primitive functions for setting signature.\n// Signatures let us decide whether the Hook order has changed on refresh.\n//\n// This function is intended to be used as a transform target, e.g.:\n// var _s = createSignatureFunctionForTransform()\n//\n// function Hello() {\n// const [foo, setFoo] = useState(0);\n// const value = useCustomHook();\n// _s(); /* Call without arguments triggers collecting the custom Hook list.\n// * This doesn't happen during the module evaluation because we\n// * don't want to change the module order with inline requires.\n// * Next calls are noops. */\n// return <h1>Hi</h1>;\n// }\n//\n// /* Call with arguments attaches the signature to the type: */\n// _s(\n// Hello,\n// 'useState{[foo, setFoo]}(0)',\n// () => [useCustomHook], /* Lazy to avoid triggering inline requires */\n// );\n\nfunction createSignatureFunctionForTransform() {\n {\n var savedType;\n var hasCustomHooks;\n var didCollectHooks = false;\n return function (type, key, forceReset, getCustomHooks) {\n if (typeof key === 'string') {\n // We're in the initial phase that associates signatures\n // with the functions. Note this may be called multiple times\n // in HOC chains like _s(hoc1(_s(hoc2(_s(actualFunction))))).\n if (!savedType) {\n // We're in the innermost call, so this is the actual type.\n savedType = type;\n hasCustomHooks = typeof getCustomHooks === 'function';\n } // Set the signature for all types (even wrappers!) in case\n // they have no signatures of their own. This is to prevent\n // problems like https://github.com/facebook/react/issues/20417.\n\n\n if (type != null && (typeof type === 'function' || typeof type === 'object')) {\n setSignature(type, key, forceReset, getCustomHooks);\n }\n\n return type;\n } else {\n // We're in the _s() call without arguments, which means\n // this is the time to collect custom Hook signatures.\n // Only do this once. This path is hot and runs *inside* every render!\n if (!didCollectHooks && hasCustomHooks) {\n didCollectHooks = true;\n collectCustomHooksForSignature(savedType);\n }\n }\n };\n }\n}\nfunction isLikelyComponentType(type) {\n {\n switch (typeof type) {\n case 'function':\n {\n // First, deal with classes.\n if (type.prototype != null) {\n if (type.prototype.isReactComponent) {\n // React class.\n return true;\n }\n\n var ownNames = Object.getOwnPropertyNames(type.prototype);\n\n if (ownNames.length > 1 || ownNames[0] !== 'constructor') {\n // This looks like a class.\n return false;\n } // eslint-disable-next-line no-proto\n\n\n if (type.prototype.__proto__ !== Object.prototype) {\n // It has a superclass.\n return false;\n } // Pass through.\n // This looks like a regular function with empty prototype.\n\n } // For plain functions and arrows, use name as a heuristic.\n\n\n var name = type.name || type.displayName;\n return typeof name === 'string' && /^[A-Z]/.test(name);\n }\n\n case 'object':\n {\n if (type != null) {\n switch (getProperty(type, '$$typeof')) {\n case REACT_FORWARD_REF_TYPE:\n case REACT_MEMO_TYPE:\n // Definitely React components.\n return true;\n\n default:\n return false;\n }\n }\n\n return false;\n }\n\n default:\n {\n return false;\n }\n }\n }\n}\n\nexports._getMountedRootCount = _getMountedRootCount;\nexports.collectCustomHooksForSignature = collectCustomHooksForSignature;\nexports.createSignatureFunctionForTransform = createSignatureFunctionForTransform;\nexports.findAffectedHostInstances = findAffectedHostInstances;\nexports.getFamilyByID = getFamilyByID;\nexports.getFamilyByType = getFamilyByType;\nexports.hasUnrecoverableErrors = hasUnrecoverableErrors;\nexports.injectIntoGlobalHook = injectIntoGlobalHook;\nexports.isLikelyComponentType = isLikelyComponentType;\nexports.performReactRefresh = performReactRefresh;\nexports.register = register;\nexports.setSignature = setSignature;\n })();\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi4vbm9kZV9tb2R1bGVzL25leHQvZGlzdC9jb21waWxlZC9yZWFjdC1yZWZyZXNoL2Nqcy9yZWFjdC1yZWZyZXNoLXJ1bnRpbWUuZGV2ZWxvcG1lbnQuanMuanMiLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVhOztBQUViLElBQUksSUFBcUM7QUFDekM7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUEscUVBQXFFO0FBQ3JFOztBQUVBO0FBQ0E7QUFDQSxpREFBaUQ7QUFDakQ7QUFDQTs7QUFFQSxtREFBbUQ7QUFDbkQ7O0FBRUEseUJBQXlCOztBQUV6QjtBQUNBLCtCQUErQjs7QUFFL0IsOEJBQThCOztBQUU5Qiw2QkFBNkI7QUFDN0I7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQSxJQUFJO0FBQ0o7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEsa0JBQWtCLGtCQUFrQjtBQUNwQzs7QUFFQTtBQUNBO0FBQ0E7QUF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RzLmhhcyhyb290KSkge1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICAgIHZhciBlbGVtZW50ID0gcm9vdEVsZW1lbnRzLmdldChyb290KTtcblxuICAgICAgdHJ5IHtcbiAgICAgICAgaGVscGVycy5zY2hlZHVsZVJvb3Qocm9vdCwgZWxlbWVudCk7XG4gICAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgICAgaWYgKCFkaWRFcnJvcikge1xuICAgICAgICAgIGRpZEVycm9yID0gdHJ1ZTtcbiAgICAgICAgICBmaXJzdEVycm9yID0gZXJyO1xuICAgICAgICB9IC8vIEtlZXAgdHJ5aW5nIG90aGVyIHJvb3RzLlxuXG4gICAgICB9XG4gICAgfSk7XG4gICAgbW91bnRlZFJvb3RzU25hcHNob3QuZm9yRWFjaChmdW5jdGlvbiAocm9vdCkge1xuICAgICAgdmFyIGhlbHBlcnMgPSBoZWxwZXJzQnlSb290U25hcHNob3QuZ2V0KHJvb3QpO1xuXG4gICAgICBpZiAoaGVscGVycyA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcignQ291bGQgbm90IGZpbmQgaGVscGVycyBmb3IgYSByb290LiBUaGlzIGlzIGEgYnVnIGluIFJlYWN0IFJlZnJlc2guJyk7XG4gICAgICB9XG5cbiAgICAgIGlmICghbW91bnRlZFJvb3RzLmhhcyhyb290KSkgey8vIE5vIGxvbmdlciBtb3VudGVkLlxuICAgICAgfVxuXG4gICAgICB0cnkge1xuICAgICAgICBoZWxwZXJzLnNjaGVkdWxlUmVmcmVzaChyb290LCB1cGRhdGUpO1xuICAgICAgfSBjYXRjaCAoZXJyKSB7XG4gICAgICAgIGlmICghZGlkRXJyb3IpIHtcbiAgICAgICAgICBkaWRFcnJvciA9IHRydWU7XG4gICAgICAgICAgZmlyc3RFcnJvciA9IGVycjtcbiAgICAgICAgfSAvLyBLZWVwIHRyeWluZyBvdGhlciByb290cy5cblxuICAgICAgfVxuICAgIH0pO1x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ICAgICAvLyBNb3VudCBhIG5ldyByb290LlxuICAgICAgICAgICAgbW91bnRlZFJvb3RzLmFkZChyb290KTtcbiAgICAgICAgICAgIGZhaWxlZFJvb3RzLmRlbGV0ZShyb290KTtcbiAgICAgICAgICB9IGVsc2UgaWYgKHdhc01vdW50ZWQgJiYgaXNNb3VudGVkKSA7IGVsc2UgaWYgKHdhc01vdW50ZWQgJiYgIWlzTW91bnRlZCkge1xuICAgICAgICAgICAgLy8gVW5tb3VudCBhbiBleGlzdGluZyByb290LlxuICAgICAgICAgICAgbW91bnRlZFJvb3RzLmRlbGV0ZShyb290KTtcblxuICAgICAgICAgICAgaWYgKGRpZEVycm9yKSB7XG4gICAgICAgICAgICAgIC8vIFdlJ2xsIHJlbW91bnQgaXQgb24gZnV0dXJlIGVkaXRzLlxuICAgICAgICAgICAgICBmYWlsZWRSb290cy5hZGQocm9vdCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBoZWxwZXJzQnlSb290LmRlbGV0ZShyb290KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2UgaWYgKCF3YXNNb3VudGVkICYmICFpc01vdW50ZWQpIHtcbiAgICAgICAgICAgIGlmIChkaWRFcnJvcikge1xuICAgICAgICAgICAgICAvLyBXZSdsbCByZW1vdW50IGl0IG9uIGZ1dHVyZSBlZGl0cy5cbiAgICAgICAgICAgICAgZmFpbGVkUm9vdHMuYWRkKHJvb3QpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvLyBNb3VudCBhIG5ldyByb290LlxuICAgICAgICAgIG1vdW50ZWRSb290cy5hZGQocm9vdCk7XG4gICAgICAgIH1cbiAgICAgIH0gLy8gQWx3YXlzIGNhbGwgdGhlIGRlY29yYXRlZCBEZXZUb29scyBob29rLlxuXG5cbiAgICAgIHJldHVybiBvbGRPbkNvbW1pdEZpYmVyUm9vdC5hcHBseSh0aGlzLCBh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VxuICAgICAgICBpZiAoIWRpZENvbGxlY3RIb29rcyAmJiBoYXNDdXN0b21Ib29rcykge1xuICAgICAgICAgIGRpZENvbGxlY3RIb29rcyA9IHRydWU7XG4gICAgICAgICAgY29sbGVjdEN1c3RvbUhvb2tzRm9yU2lnbmF0dXJlKHNhdmVkVHlwZSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9O1xuICB9XG59XG5mdW5jdGlvbiBpc0xpa2VseUNvbXBvbmVudFR5cGUodHlwZSkge1xuICB7XG4gICAgc3dpdGNoICh0eXBlb2YgdHlwZSkge1xuICAgICAgY2FzZSAnZnVuY3Rpb24nOlxuICAgICAgICB7XG4gICAgICAgICAgLy8gRmlyc3QsIGRlYWwgd2l0aCBjbGFzc2VzLlxuICAgICAgICAgIGlmICh0eXBlLnByb3RvdHlwZSAhPSBudWxsKSB7XG4gICAgICAgICAgICBpZiAodHlwZS5wcm90b3R5cGUuaXNSZWFjdENvbXBvbmVudCkge1xuICAgICAgICAgICAgICAvLyBSZWFjdCBjbGFzcy5cbiAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBvd25OYW1lcyA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzKHR5cGUucHJvdG90eXBlKTtcblxuICAgICAgICAgICAgaWYgKG93bk5hbWVzLmxlbmd0aCA+IDEgfHwgb3duTmFtZXNbMF0gIT09ICdjb25zdHJ1Y3RvcicpIHtcbiAgICAgICAgICAgICAgLy8gVGhpcyBsb29rcyBsaWtlIGEgY2xhc3MuXG4gICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH0gLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXByb3RvXG5cblxuICAgICAgICAgICAgaWYgKHR5cGUucHJvdG90eXBlLl9fcHJvdG9fXyAhPT0gT2JqZWN0LnByb3RvdHlwZSkge1xuICAgICAgICAgICAgICAvLyBJdCBoYXMgYSBzdXBlcmNsYXNzLlxuICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9IC8vIFBhc3MgdGhyb3VnaC5cbiAgICAgICAgICAgIC8vIFRoaXMgbG9va3MgbGlrZSBhIHJlZ3VsYXIgZnVuY3Rpb24gd2l0aCBlbXB0eSBwcm90b3R5cGUuXG5cbiAgICAgICAgICB9IC8vIEZvciBwbGFpbiBmdW5jdGlvbnMgYW5kIGFycm93cywgdXNlIG5hbWUgYXMgYSBoZXVyaXN0aWMuXG5cblxuICAgICAgICAgIHZhciBuYW1lID0gdHlwZS5uYW1lIHx8IHR5cGUuZGlzcGxheU5hbWU7XG4gICAgICAgICAgcmV0dXJuIHR5cGVvZiBuYW1lID09PSAnc3RyaW5nJyAmJiAvXltBLVpdLy50ZXN0KG5hbWUpO1xuICAgICAgICB9XG5cbiAgICAgIGNhc2UgJ29iamVjdCc6XG4gICAgICAgIHtcbiAgICAgICAgICBpZiAodHlwZSAhPSBudWxsKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKGdldFByb3BlcnR5KHR5cGUsICckJHR5cGVvZicpKSB7XG4gICAgICAgICAgICAgIGNhc2UgUkVBQ1RfRk9SV0FSRF9SRUZfVFlQRTpcbiAgICAgICAgICAgICAgY2FzZSBSRUFDVF9NRU1PX1RZUEU6XG4gICAgICAgICAgICAgICAgLy8gRGVmaW5pdGVseSBSZWFjdCBjb21wb25lbnRzLlxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuXG4gICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICBkZWZhdWx0OlxuICAgICAgICB7XG4gICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgfVxuICB9XG59XG5cbmV4cG9ydHMuX2dldE1vdW50ZWRSb290Q291bnQgPSBfZ2V0TW91bnRlZFJvb3RDb3VudDtcbmV4cG9ydHMuY29sbGVjdEN1c3RvbUhvb2tzRm9yU2lnbmF0dXJlID0gY29sbGVjdEN1c3RvbUhvb2tzRm9yU2lnbmF0dXJlO1xuZXhwb3J0cy5jcmVhdGVTaWduYXR1cmVGdW5jdGlvbkZvclRyYW5zZm9ybSA9IGNyZWF0ZVNpZ25hdHVyZUZ1bmN0aW9uRm9yVHJhbnNmb3JtO1xuZXhwb3J0cy5maW5kQWZmZWN0ZWRIb3N0SW5zdGFuY2VzID0gZmluZEFmZmVjdGVkSG9zdEluc3RhbmNlcztcbmV4cG9ydHMuZ2V0RmFtaWx5QnlJRCA9IGdldEZhbWlseUJ5SUQ7XG5leHBvcnRzLmdldEZhbWlseUJ5VHlwZSA9IGdldEZhbWlseUJ5VHlwZTtcbmV4cG9ydHMuaGFzVW5yZWNvdmVyYWJsZUVycm9ycyA9IGhhc1VucmVjb3ZlcmFibGVFcnJvcnM7XG5leHBvcnRzLmluamVjdEludG9HbG9iYWxIb29rID0gaW5qZWN0SW50b0dsb2JhbEhvb2s7XG5leHBvcnRzLmlzTGlrZWx5Q29tcG9uZW50VHlwZSA9IGlzTGlrZWx5Q29tcG9uZW50VHlwZTtcbmV4cG9ydHMucGVyZm9ybVJlYWN0UmVmcmVzaCA9IHBlcmZvcm1SZWFjdFJlZnJlc2g7XG5leHBvcnRzLnJlZ2lzdGVyID0gcmVnaXN0ZXI7XG5leHBvcnRzLnNldFNpZ25hdHVyZSA9IHNldFNpZ25hdHVyZTtcbiAgfSkoKTtcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///../node_modules/next/dist/compiled/react-refresh/cjs/react-refresh-runtime.development.js\n"));
/***/ }),
/***/ "../node_modules/next/dist/compiled/react-refresh/runtime.js":
/*!*******************************************************************!*\
!*** ../node_modules/next/dist/compiled/react-refresh/runtime.js ***!
\*******************************************************************/
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
eval(__webpack_require__.ts("\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ./cjs/react-refresh-runtime.development.js */ \"../node_modules/next/dist/compiled/react-refresh/cjs/react-refresh-runtime.development.js\");\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi4vbm9kZV9tb2R1bGVzL25leHQvZGlzdC9jb21waWxlZC9yZWFjdC1yZWZyZXNoL3J1bnRpbWUuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7O0FBRWIsSUFBSSxLQUFxQyxFQUFFLEVBRTFDLENBQUM7QUFDRixFQUFFLG1MQUFzRTtBQUN4RSIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi4vbm9kZV9tb2R1bGVzL25leHQvZGlzdC9jb21waWxlZC9yZWFjdC1yZWZyZXNoL3J1bnRpbWUuanM/MjgzNyJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG5cbmlmIChwcm9jZXNzLmVudi5OT0RFX0VOViA9PT0gJ3Byb2R1Y3Rpb24nKSB7XG4gIG1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9janMvcmVhY3QtcmVmcmVzaC1ydW50aW1lLnByb2R1Y3Rpb24ubWluLmpzJyk7XG59IGVsc2Uge1xuICBtb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4vY2pzL3JlYWN0LXJlZnJlc2gtcnVudGltZS5kZXZlbG9wbWVudC5qcycpO1xufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///../node_modules/next/dist/compiled/react-refresh/runtime.js\n"));
/***/ })
},
/******/ function(__webpack_require__) { // webpackRuntimeModules
/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
/******/ var __webpack_exports__ = (__webpack_exec__("../node_modules/next/dist/compiled/@next/react-refresh-utils/dist/runtime.js"));
/******/ _N_E = __webpack_exports__;
/******/ }
]);