Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

1 wiersz
33 KiB

  1. {"ast":null,"code":"\"use strict\";\n\nvar _slicedToArray = require(\"@babel/runtime/helpers/slicedToArray\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports[\"default\"] = connect;\n\nvar _unfetch = _interopRequireDefault(require(\"next/dist/build/polyfills/unfetch\"));\n\nvar ErrorOverlay = _interopRequireWildcard(require(\"next/dist/compiled/react-error-overlay\"));\n\nvar _stripAnsi = _interopRequireDefault(require(\"next/dist/compiled/strip-ansi\"));\n\nvar _eventsource = require(\"./eventsource\");\n\nvar _formatWebpackMessages = _interopRequireDefault(require(\"./format-webpack-messages\"));\n\nvar _sourceMapSupport = require(\"./source-map-support\");\n/**\n* MIT License\n*\n* Copyright (c) 2013-present, Facebook, Inc.\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*/\n// This file is a modified version of the Create React App HMR dev client that\n// can be found here:\n// https://github.com/facebook/create-react-app/blob/v3.4.1/packages/react-dev-utils/webpackHotDevClient.js\n// This alternative WebpackDevServer combines the functionality of:\n// https://github.com/webpack/webpack-dev-server/blob/webpack-1/client/index.js\n// https://github.com/webpack/webpack/blob/webpack-1/hot/dev-server.js\n// It only supports their simplest configuration (hot updates on same server).\n// It makes some opinionated choices on top, like adding a syntax error overlay\n// that looks similar to our console output. The error overlay is inspired by:\n// https://github.com/glenjamin/webpack-hot-middleware\n\n\nvar hadRuntimeError = false;\nvar customHmrEventHandler;\n\nfunction connect(options) {\n // Open stack traces in an editor.\n ErrorOverlay.setEditorHandler(function editorHandler(_ref) {\n var fileName = _ref.fileName,\n lineNumber = _ref.lineNumber,\n colNumber = _ref.colNumber; // Resolve invalid paths coming from react-error-overlay\n\n var resolvedFilename = fileName.replace(/^webpack:\\/\\//, '');\n (0, _unfetch[\"default\"])('/_next/development/open-stack-frame-in-editor' + (\"?fileName=\" + window.encodeURIComponent(resolvedFilename)) + (\"&lineNumber=\" + (lineNumber || 1)) + (\"&colNumber=\" + (colNumber || 1)));\n }); // We need to keep track of if there has been a runtime error.\n // Essentially, we cannot guarantee application state was not corrupted by the\n // runtime error. To prevent confusing behavior, we forcibly reload the entire\n // application. This is handled below when we are notified of a compile (code\n // change).\n // See https://github.com/facebook/create-react-app/issues/3096\n\n ErrorOverlay.startReportingRuntimeErrors({\n onError: function onError() {\n hadRuntimeError = true;\n }\n });\n\n if (module.hot && typeof module.hot.dispose === 'function') {\n module.hot.dispose(function () {\n // TODO: why do we need this?\n ErrorOverlay.stopReportingRuntimeErrors();\n });\n }\n\n (0, _eventsource.getEventSourceWrapper)(options).addMessageListener(function (event) {\n // This is the heartbeat event\n if (event.data === \"\\uD83D\\uDC93\") {\n return;\n }\n\n try {\n processMessage(event);\n } catch (ex) {\n console.warn('Invalid HMR message: ' + event.data + '\\n' + ex);\n }\n });\n return {\n subscribeToHmrEvent: function subscribeToHmrEvent(handler) {\n customHmrEventHandler = handler;\n },\n reportRuntimeError: function reportRuntimeError(err) {\n ErrorOverlay.reportRuntimeError(err);\n },\n prepareError: function prepareError(err) {\n // Temporary workaround for https://github.com/facebook/create-react-app/issues/4760\n // Should be removed once the fix lands\n hadRuntimeError = true; // react-error-overlay expects a type of `Error`\n\n var error = new Error(err.message);\n error.name = err.name;\n error.stack = err.stack; // __NEXT_DIST_DIR is provided by webpack\n\n (0, _sourceMapSupport.rewriteStacktrace)(error, process.env.__NEXT_DIST_DIR);\n return error;\n }\n };\n} // Remember some state related to hot module replacement.\n\n\nvar isFirstCompilation = true;\nvar mostRecentCompilationHash = null;\nvar hasCompileErrors = false;\nvar hmrEventCount = 0;\n\nfunction clearOutdatedErrors() {\n // Clean up outdated compile errors, if any.\n if (typeof console !== 'undefined' && typeof console.clear === 'function') {\n if (hasCompileErrors) {\n console.clear();\n }\n }\n} // Successful compilation.\n\n\nfunction handleSuccess() {\n clearOutdatedErrors();\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false; // Attempt to apply hot updates or reload.\n\n if (isHotUpdate) {\n tryApplyUpdates(function onHotUpdateSuccess() {\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n tryDismissErrorOverlay();\n });\n }\n} // Compilation with warnings (e.g. ESLint).\n\n\nfunction handleWarnings(warnings) {\n clearOutdatedErrors();\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = (0, _formatWebpackMessages[\"default\"])({\n warnings: warnings,\n errors: []\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn('There were more warnings in other files.\\n' + 'You can find a complete log in the terminal.');\n break;\n }\n\n console.warn((0, _stripAnsi[\"default\"])(formatted.warnings[i]));\n }\n }\n }\n\n printWarnings(); // Attempt to apply hot updates or reload.\n\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n tryDismissErrorOverlay();\n });\n }\n} // Compilation with errors (e.g. syntax error or missing modules).\n\n\nfunction handleErrors(errors) {\n clearOutdatedErrors();\n isFirstCompilation = false;\n hasCompileErrors = true; // \"Massage\" webpack messages.\n\n var formatted = (0, _formatWebpackMessages[\"default\"])({\n errors: errors,\n warnings: []\n }); // Only show the first error.\n\n ErrorOverlay.reportBuildError(formatted.errors[0]); // Also log them to the console.\n\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n for (var i = 0; i < formatted.errors.length; i++) {\n console.error((0, _stripAnsi[\"default\"])(formatted.errors[i]));\n }\n } // Do not attempt to reload now.\n // We will reload on next success instead.\n\n\n if (process.env.__NEXT_TEST_MODE) {\n if (self.__NEXT_HMR_CB) {\n self.__NEXT_HMR_CB(formatted.errors[0]);\n\n self.__NEXT_HMR_CB = null;\n }\n }\n}\n\nfunction tryDismissErrorOverlay() {\n if (!hasCompileErrors) {\n ErrorOverlay.dismissBuildError();\n }\n} // There is a newer version of the code available.\n\n\nfunction handleAvailableHash(hash) {\n // Update last known compilation hash.\n mostRecentCompilationHash = hash;\n} // Handle messages from the server.\n\n\nfunction processMessage(e) {\n var obj = JSON.parse(e.data);\n\n switch (obj.action) {\n case 'building':\n {\n ++hmrEventCount;\n console.log('[HMR] bundle ' + (obj.name ? \"'\" + obj.name + \"' \" : '') + 'rebuilding');\n break;\n }\n\n case 'built':\n case 'sync':\n {\n if (obj.action === 'built') ++hmrEventCount;\n\n if (obj.hash) {\n handleAvailableHash(obj.hash);\n }\n\n var errors = obj.errors,\n warnings = obj.warnings;\n var hasErrors = Boolean(errors && errors.length);\n\n if (hasErrors) {\n return handleErrors(errors);\n }\n\n var hasWarnings = Boolean(warnings && warnings.length);\n\n if (hasWarnings) {\n return handleWarnings(warnings);\n }\n\n return handleSuccess();\n }\n\n case 'typeChecked':\n {\n var display = function display() {\n // Another update has started, ignore type update:\n if (!canApplyUpdates() || eventId !== hmrEventCount) {\n return;\n } // TypeScript errors to not take priority over compillation errors\n\n\n if (hasCompileErrors) {\n return;\n }\n\n handleErrors(_errors);\n }; // We need to defer this until we're in an idle state.\n\n\n var eventId = ++hmrEventCount;\n\n var _obj$data = _slicedToArray(obj.data, 1),\n _errors = _obj$data[0].errors;\n\n var _hasErrors = Boolean(_errors && _errors.length); // Disregard event if there are no errors to report.\n\n\n if (!_hasErrors) {\n // We need to _try_ dismissing the error overlay, as code may not have\n // changed, for example, when only types are updated.\n // n.b. `handleSuccess` only dismisses the overlay if code was updated.\n tryDismissErrorOverlay();\n break;\n }\n\n if (canApplyUpdates()) {\n display();\n } else {\n afterApplyUpdates(display);\n }\n\n break;\n }\n\n default:\n {\n if (customHmrEventHandler) {\n customHmrEventHandler(obj);\n break;\n }\n\n break;\n }\n }\n} // Is there a newer version of this code available?\n\n\nfunction isUpdateAvailable() {\n /* globals __webpack_hash__ */\n // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by Webpack.\n return mostRecentCompilationHash !== __webpack_hash__;\n} // Webpack disallows updates in other states.\n\n\nfunction canApplyUpdates() {\n return module.hot.status() === 'idle';\n}\n\nfunction afterApplyUpdates(fn) {\n if (canApplyUpdates()) {\n fn();\n } else {\n var handler = function handler(status) {\n if (status === 'idle') {\n module.hot.removeStatusHandler(handler);\n fn();\n }\n };\n\n module.hot.addStatusHandler(handler);\n }\n} // Attempt to update code on the fly, fall back to a hard reload.\n\n\nfunction tryApplyUpdates(onHotUpdateSuccess) {\n if (!module.hot) {\n // HotModuleReplacementPlugin is not in Webpack configuration.\n console.error('HotModuleReplacementPlugin is not in Webpack configuration.'); // window.location.reload();\n\n return;\n }\n\n if (!isUpdateAvailable() || !canApplyUpdates()) {\n return;\n }\n\n function handleApplyUpdates(err, updatedModules) {\n if (err || hadRuntimeError || !updatedModules) {\n if (err) {\n console.warn('Error while applying updates, reloading page', err);\n }\n\n if (hadRuntimeError) {\n console.warn('Had runtime error previously, reloading page');\n }\n\n window.location.reload();\n return;\n }\n\n if (typeof onHotUpdateSuccess === 'function') {\n // Maybe we want to do something.\n onHotUpdateSuccess();\n }\n\n if (isUpdateAvailable()) {\n // While we were updating, there was a new update! Do it again.\n tryApplyUpdates();\n } else {\n if (process.env.__NEXT_TEST_MODE) {\n afterApplyUpdates(function () {\n if (self.__NEXT_HMR_CB) {\n self.__NEXT_HMR_CB();\n\n self.__NEXT_HMR_CB = null;\n }\n });\n }\n }\n } // https://webpack.js.org/api/hot-module-replacement/#check\n\n\n module.hot.check(\n /* autoApply */\n true).then(function (updatedModules) {\n handleApplyUpdates(null, updatedModules);\n }, function (err) {\n handleApplyUpdates(err, null);\n });\n}","map":{"version":3,"sources":["C:/Thamrin Brothers/tbg-ecomm-nextjs/node_modules/next/dist/client/dev/error-overlay/hot-dev-client.js"],"names":["_interopRequireWildcard","require","_interopRequireDefault","exports","__esModule","connect","_unfetch","ErrorOverlay","_stripAnsi","_eventsource","_formatWebpackMessages","_sourceMapSupport","hadRuntimeError","customHmrEventHandler","options","setEditorHandler","editorHandler","_ref","fileName","lineNumber","colNumber","resolvedFilename","replace","window","encodeURIComponent","startReportingRuntimeErrors","onError","module","hot","dispose","stopReportingRuntimeErrors","getEventSourceWrapper","addMessageListener","event","data","processMessage","ex","console","warn","subscribeToHmrEvent","handler","reportRuntimeError","err","prepareError","error","Error","message","name","stack","rewriteStacktrace","process","env","__NEXT_DIST_DIR","isFirstCompilation","mostRecentCompilationHash","hasCompileErrors","hmrEventCount","clearOutdatedErrors","clear","handleSuccess","isHotUpdate","tryApplyUpdates","onHotUpdateSuccess","tryDismissErrorOverlay","handleWarnings","warnings","printWarnings","formatted","errors","i","length","onSuccessfulHotUpdate","handleErrors","reportBuildError","__NEXT_TEST_MODE","self","__NEXT_HMR_CB","dismissBuildError","handleAvailableHash","hash","e","obj","JSON","parse","action","log","hasErrors","Boolean","hasWarnings","display","canApplyUpdates","eventId","_errors","_hasErrors","afterApplyUpdates","isUpdateAvailable","__webpack_hash__","status","fn","removeStatusHandler","addStatusHandler","handleApplyUpdates","updatedModules","location","reload","check","then"],"mappings":"AAAA;;;;AAAa,IAAIA,uBAAuB,GAACC,OAAO,CAAC,+CAAD,CAAnC;;AAAqF,IAAIC,sBAAsB,GAACD,OAAO,CAAC,8CAAD,CAAlC;;AAAmFE,OAAO,CAACC,UAAR,GAAmB,IAAnB;AAAwBD,OAAO,WAAP,GAAgBE,OAAhB;;AAAwB,IAAIC,QAAQ,GAACJ,sBAAsB,CAACD,OAAO,CAAC,mCAAD,CAAR,CAAnC;;AAAkF,IAAIM,YAAY,GAACP,uBAAuB,CAACC,OAAO,CAAC,wCAAD,CAAR,CAAxC;;AAA4F,IAAIO,UAAU,GAACN,sBAAsB,CAACD,OAAO,CAAC,+BAAD,CAAR,CAArC;;AAAgF,IAAIQ,YAAY,GAACR,OAAO,CAAC,eAAD,CAAxB;;AAA0C,IAAIS,sBAAsB,GAACR,sBAAsB,CAACD,OAAO,CAAC,2BAAD,CAAR,CAAjD;;AAAwF,IAAIU,iBAAiB,GAACV,OAAO,CAAC,sBAAD,CAA7B;AAAsD;AAC3pB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,IAAIW,eAAe,GAAC,KAApB;AAA0B,IAAIC,qBAAJ;;AAA0B,SAASR,OAAT,CAAiBS,OAAjB,EAAyB;AAAC;AAC9EP,EAAAA,YAAY,CAACQ,gBAAb,CAA8B,SAASC,aAAT,CAAuBC,IAAvB,EAA4B;AAAC,QAAIC,QAAJ,GAAmCD,IAAnC,CAAIC,QAAJ;AAAA,QAAaC,UAAb,GAAmC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EAAK,IAAL,CAAlB;AAA8B,GAA1I;AAA6I","sourcesContent":["\"use strict\";var _interopRequireWildcard=require(\"@babel/runtime/helpers/interopRequireWildcard\");var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");exports.__esModule=true;exports.default=connect;var _unfetch=_interopRequireDefault(require(\"next/dist/build/polyfills/unfetch\"));var ErrorOverlay=_interopRequireWildcard(require(\"next/dist/compiled/react-error-overlay\"));var _stripAnsi=_interopRequireDefault(require(\"next/dist/compiled/strip-ansi\"));var _eventsource=require(\"./eventsource\");var _formatWebpackMessages=_interopRequireDefault(require(\"./format-webpack-messages\"));var _sourceMapSupport=require(\"./source-map-support\");/**\n * MIT License\n *\n * Copyright (c) 2013-present, Facebook, Inc.\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 */ // This file is a modified version of the Create React App HMR dev client that\n// can be found here:\n// https://github.com/facebook/create-react-app/blob/v3.4.1/packages/react-dev-utils/webpackHotDevClient.js\n// This alternative WebpackDevServer combines the functionality of:\n// https://github.com/webpack/webpack-dev-server/blob/webpack-1/client/index.js\n// https://github.com/webpack/webpack/blob/webpack-1/hot/dev-server.js\n// It only supports their simplest configuration (hot updates on same server).\n// It makes some opinionated choices on top, like adding a syntax error overlay\n// that looks similar to our console output. The error overlay is inspired by:\n// https://github.com/glenjamin/webpack-hot-middleware\nvar hadRuntimeError=false;var customHmrEventHandler;function connect(options){// Open stack traces in an editor.\nErrorOverlay.setEditorHandler(function editorHandler(_ref){var{fileName,lineNumber,colNumber}=_ref;// Resolve invalid paths coming from react-error-overlay\nvar resolvedFilename=fileName.replace(/^webpack:\\/\\//,'');(0,_unfetch.default)('/_next/development/open-stack-frame-in-editor'+(\"?fileName=\"+window.encodeURIComponent(resolvedFilename))+(\"&lineNumber=\"+(lineNumber||1))+(\"&colNumber=\"+(colNumber||1)));});// We need to keep track of if there has been a runtime error.\n// Essentially, we cannot guarantee application state was not corrupted by the\n// runtime error. To prevent confusing behavior, we forcibly reload the entire\n// application. This is handled below when we are notified of a compile (code\n// change).\n// See https://github.com/facebook/create-react-app/issues/3096\nErrorOverlay.startReportingRuntimeErrors({onError:function onError(){hadRuntimeError=true;}});if(module.hot&&typeof module.hot.dispose==='function'){module.hot.dispose(function(){// TODO: why do we need this?\nErrorOverlay.stopReportingRuntimeErrors();});}(0,_eventsource.getEventSourceWrapper)(options).addMessageListener(event=>{// This is the heartbeat event\nif(event.data==='\\uD83D\\uDC93'){return;}try{processMessage(event);}catch(ex){console.warn('Invalid HMR message: '+event.data+'\\n'+ex);}});return{subscribeToHmrEvent(handler){customHmrEventHandler=handler;},reportRuntimeError(err){ErrorOverlay.reportRuntimeError(err);},prepareError(err){// Temporary workaround for https://github.com/facebook/create-react-app/issues/4760\n// Should be removed once the fix lands\nhadRuntimeError=true;// react-error-overlay expects a type of `Error`\nvar error=new Error(err.message);error.name=err.name;error.stack=err.stack;// __NEXT_DIST_DIR is provided by webpack\n(0,_sourceMapSupport.rewriteStacktrace)(error,process.env.__NEXT_DIST_DIR);return error;}};}// Remember some state related to hot module replacement.\nvar isFirstCompilation=true;var mostRecentCompilationHash=null;var hasCompileErrors=false;var hmrEventCount=0;function clearOutdatedErrors(){// Clean up outdated compile errors, if any.\nif(typeof console!=='undefined'&&typeof console.clear==='function'){if(hasCompileErrors){console.clear();}}}// Successful compilation.\nfunction handleSuccess(){clearOutdatedErrors();var isHotUpdate=!isFirstCompilation;isFirstCompilation=false;hasCompileErrors=false;// Attempt to apply hot updates or reload.\nif(isHotUpdate){tryApplyUpdates(function onHotUpdateSuccess(){// Only dismiss it when we're sure it's a hot update.\n// Otherwise it would flicker right before the reload.\ntryDismissErrorOverlay();});}}// Compilation with warnings (e.g. ESLint).\nfunction handleWarnings(warnings){clearOutdatedErrors();var isHotUpdate=!isFirstCompilation;isFirstCompilation=false;hasCompileErrors=false;function printWarnings(){// Print warnings to the console.\nvar formatted=(0,_formatWebpackMessages.default)({warnings:warnings,errors:[]});if(typeof console!=='undefined'&&typeof console.warn==='function'){for(var i=0;i<formatted.warnings.length;i++){if(i===5){console.warn('There were more warnings in other files.\\n'+'You can find a complete log in the terminal.');break;}console.warn((0,_stripAnsi.default)(formatted.warnings[i]));}}}printWarnings();// Attempt to apply hot updates or reload.\nif(isHotUpdate){tryApplyUpdates(function onSuccessfulHotUpdate(){// Only dismiss it when we're sure it's a hot update.\n// Otherwise it would flicker right before the reload.\ntryDismissErrorOverlay();});}}// Compilation with errors (e.g. syntax error or missing modules).\nfunction handleErrors(errors){clearOutdatedErrors();isFirstCompilation=false;hasCompileErrors=true;// \"Massage\" webpack messages.\nvar formatted=(0,_formatWebpackMessages.default)({errors:errors,warnings:[]});// Only show the first error.\nErrorOverlay.reportBuildError(formatted.errors[0]);// Also log them to the console.\nif(typeof console!=='undefined'&&typeof console.error==='function'){for(var i=0;i<formatted.errors.length;i++){console.error((0,_stripAnsi.default)(formatted.errors[i]));}}// Do not attempt to reload now.\n// We will reload on next success instead.\nif(process.env.__NEXT_TEST_MODE){if(self.__NEXT_HMR_CB){self.__NEXT_HMR_CB(formatted.errors[0]);self.__NEXT_HMR_CB=null;}}}function tryDismissErrorOverlay(){if(!hasCompileErrors){ErrorOverlay.dismissBuildError();}}// There is a newer version of the code available.\nfunction handleAvailableHash(hash){// Update last known compilation hash.\nmostRecentCompilationHash=hash;}// Handle messages from the server.\nfunction processMessage(e){var obj=JSON.parse(e.data);switch(obj.action){case'building':{++hmrEventCount;console.log('[HMR] bundle '+(obj.name?\"'\"+obj.name+\"' \":'')+'rebuilding');break;}case'built':case'sync':{if(obj.action==='built')++hmrEventCount;if(obj.hash){handleAvailableHash(obj.hash);}var{errors,warnings}=obj;var hasErrors=Boolean(errors&&errors.length);if(hasErrors){return handleErrors(errors);}var hasWarnings=Boolean(warnings&&warnings.length);if(hasWarnings){return handleWarnings(warnings);}return handleSuccess();}case'typeChecked':{var eventId=++hmrEventCount;var[{errors:_errors}]=obj.data;var _hasErrors=Boolean(_errors&&_errors.length);// Disregard event if there are no errors to report.\nif(!_hasErrors){// We need to _try_ dismissing the error overlay, as code may not have\n// changed, for example, when only types are updated.\n// n.b. `handleSuccess` only dismisses the overlay if code was updated.\ntryDismissErrorOverlay();break;}function display(){// Another update has started, ignore type update:\nif(!canApplyUpdates()||eventId!==hmrEventCount){return;}// TypeScript errors to not take priority over compillation errors\nif(hasCompileErrors){return;}handleErrors(_errors);}// We need to defer this until we're in an idle state.\nif(canApplyUpdates()){display();}else{afterApplyUpdates(display);}break;}default:{if(customHmrEventHandler){customHmrEventHandler(obj);break;}break;}}}// Is there a newer version of this code available?\nfunction isUpdateAvailable(){/* globals __webpack_hash__ */ // __webpack_hash__ is the hash of the current compilation.\n// It's a global variable injected by Webpack.\nreturn mostRecentCompilationHash!==__webpack_hash__;}// Webpack disallows updates in other states.\nfunction canApplyUpdates(){return module.hot.status()==='idle';}function afterApplyUpdates(fn){if(canApplyUpdates()){fn();}else{function handler(status){if(status==='idle'){module.hot.removeStatusHandler(handler);fn();}}module.hot.addStatusHandler(handler);}}// Attempt to update code on the fly, fall back to a hard reload.\nfunction tryApplyUpdates(onHotUpdateSuccess){if(!module.hot){// HotModuleReplacementPlugin is not in Webpack configuration.\nconsole.error('HotModuleReplacementPlugin is not in Webpack configuration.');// window.location.reload();\nreturn;}if(!isUpdateAvailable()||!canApplyUpdates()){return;}function handleApplyUpdates(err,updatedModules){if(err||hadRuntimeError||!updatedModules){if(err){console.warn('Error while applying updates, reloading page',err);}if(hadRuntimeError){console.warn('Had runtime error previously, reloading page');}window.location.reload();return;}if(typeof onHotUpdateSuccess==='function'){// Maybe we want to do something.\nonHotUpdateSuccess();}if(isUpdateAvailable()){// While we were updating, there was a new update! Do it again.\ntryApplyUpdates();}else{if(process.env.__NEXT_TEST_MODE){afterApplyUpdates(()=>{if(self.__NEXT_HMR_CB){self.__NEXT_HMR_CB();self.__NEXT_HMR_CB=null;}});}}}// https://webpack.js.org/api/hot-module-replacement/#check\nmodule.hot.check(/* autoApply */true).then(updatedModules=>{handleApplyUpdates(null,updatedModules);},err=>{handleApplyUpdates(err,null);});}"]},"metadata":{},"sourceType":"script"}