{"ast":null,"code":"\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nexports.__esModule = true;\nexports[\"default\"] = connect;\n\nvar DevOverlay = _interopRequireWildcard(require(\"@next/react-dev-overlay/lib/client\"));\n\nvar _stripAnsi = _interopRequireDefault(require(\"next/dist/compiled/strip-ansi\"));\n\nvar _eventsource = require(\"./eventsource\");\n\nvar _formatWebpackMessages = _interopRequireDefault(require(\"./format-webpack-messages\"));\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  DevOverlay.register();\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    onUnrecoverableError: function onUnrecoverableError() {\n      hadRuntimeError = true;\n    }\n  };\n} // Remember some state related to hot module replacement.\n\n\nvar isFirstCompilation = true;\nvar mostRecentCompilationHash = null;\nvar hasCompileErrors = false;\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 onSuccessfulHotUpdate(hasUpdates) {\n      // Only dismiss it when we're sure it's a hot update.\n      // Otherwise it would flicker right before the reload.\n      onFastRefresh(hasUpdates);\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(hasUpdates) {\n      // Only dismiss it when we're sure it's a hot update.\n      // Otherwise it would flicker right before the reload.\n      onFastRefresh(hasUpdates);\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  DevOverlay.onBuildError(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 onFastRefresh(hasUpdates) {\n  DevOverlay.onBuildOk();\n\n  if (hasUpdates) {\n    DevOverlay.onRefresh();\n  }\n\n  console.log('[Fast Refresh] done');\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        console.log('[Fast Refresh] rebuilding');\n        break;\n      }\n\n    case 'built':\n    case 'sync':\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    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('[Fast Refresh] performing full reload\\n\\n' + \"Fast Refresh will perform a full reload when you edit a file that's imported by modules outside of the React tree.\\n\" + 'You might have a file which renders a React component but also exports a value that is imported by a non-React component.\\n' + 'Consider migrating the non-React component export to a separate file and importing it into both files.\\n\\n' + 'It is also possible you are using class components at the top-level of your application, which disables Fast Refresh.\\n' + 'Fast Refresh requires at least one function component in your React tree.');\n      } else if (hadRuntimeError) {\n        console.warn('[Fast Refresh] performing full reload because your application had an unrecoverable error');\n      }\n\n      window.location.reload();\n      return;\n    }\n\n    var hasUpdates = Boolean(updatedModules.length);\n\n    if (typeof onHotUpdateSuccess === 'function') {\n      // Maybe we want to do something.\n      onHotUpdateSuccess(hasUpdates);\n    }\n\n    if (isUpdateAvailable()) {\n      // While we were updating, there was a new update! Do it again.\n      tryApplyUpdates(hasUpdates ? undefined : onHotUpdateSuccess);\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":["/Users/captainsafia/github.com/nteract/commuter/node_modules/next/dist/client/dev/error-overlay/hot-dev-client.js"],"names":["_interopRequireDefault","require","_interopRequireWildcard","exports","__esModule","connect","DevOverlay","_stripAnsi","_eventsource","_formatWebpackMessages","hadRuntimeError","customHmrEventHandler","options","register","getEventSourceWrapper","addMessageListener","event","data","processMessage","ex","console","warn","subscribeToHmrEvent","handler","onUnrecoverableError","isFirstCompilation","mostRecentCompilationHash","hasCompileErrors","clearOutdatedErrors","clear","handleSuccess","isHotUpdate","tryApplyUpdates","onSuccessfulHotUpdate","hasUpdates","onFastRefresh","handleWarnings","warnings","printWarnings","formatted","errors","i","length","handleErrors","onBuildError","error","process","env","__NEXT_TEST_MODE","self","__NEXT_HMR_CB","onBuildOk","onRefresh","log","handleAvailableHash","hash","e","obj","JSON","parse","action","hasErrors","Boolean","hasWarnings","isUpdateAvailable","__webpack_hash__","canApplyUpdates","module","hot","status","afterApplyUpdates","fn","removeStatusHandler","addStatusHandler","onHotUpdateSuccess","handleApplyUpdates","err","updatedModules","window","location","reload","undefined","check","then"],"mappings":"AAAA;;AAAa,IAAIA,sBAAsB,GAACC,OAAO,CAAC,8CAAD,CAAlC;;AAAmF,IAAIC,uBAAuB,GAACD,OAAO,CAAC,+CAAD,CAAnC;;AAAqFE,OAAO,CAACC,UAAR,GAAmB,IAAnB;AAAwBD,OAAO,WAAP,GAAgBE,OAAhB;;AAAwB,IAAIC,UAAU,GAACJ,uBAAuB,CAACD,OAAO,CAAC,oCAAD,CAAR,CAAtC;;AAAsF,IAAIM,UAAU,GAACP,sBAAsB,CAACC,OAAO,CAAC,+BAAD,CAAR,CAArC;;AAAgF,IAAIO,YAAY,GAACP,OAAO,CAAC,eAAD,CAAxB;;AAA0C,IAAIQ,sBAAsB,GAACT,sBAAsB,CAACC,OAAO,CAAC,2BAAD,CAAR,CAAjD;AAAwF;;;;;;;;;;;;;;;;;;;;;;;AAsBzgB;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,IAAIS,eAAe,GAAC,KAApB;AAA0B,IAAIC,qBAAJ;;AAA0B,SAASN,OAAT,CAAiBO,OAAjB,EAAyB;AAACN,EAAAA,UAAU,CAACO,QAAX;AAAsB,GAAC,GAAEL,YAAY,CAACM,qBAAhB,EAAuCF,OAAvC,EAAgDG,kBAAhD,CAAmE,UAAAC,KAAK,EAAE;AAAC;AAC/K,QAAGA,KAAK,CAACC,IAAN,KAAa,cAAhB,EAA+B;AAAC;AAAQ;;AAAA,QAAG;AAACC,MAAAA,cAAc,CAACF,KAAD,CAAd;AAAuB,KAA3B,CAA2B,OAAMG,EAAN,EAAS;AAACC,MAAAA,OAAO,CAACC,IAAR,CAAa,0BAAwBL,KAAK,CAACC,IAA9B,GAAmC,IAAnC,GAAwCE,EAArD;AAA0D;AAAC,GADpC;AACsC,SAAM;AAACG,IAAAA,mBAAD,+BAAqBC,OAArB,EAA6B;AAACZ,MAAAA,qBAAqB,GAACY,OAAtB;AAA+B,K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AAACF,IAAAA,kBAAkB,CAAC,IAAD,EAAME,cAAN,CAAlB;AAAyC,GAArG,EAAsG,UAAAD,GAAG,EAAE;AAACD,IAAAA,kBAAkB,CAACC,GAAD,EAAK,IAAL,CAAlB;AAA8B,GAA1I;AAA6I","sourcesContent":["\"use strict\";var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");var _interopRequireWildcard=require(\"@babel/runtime/helpers/interopRequireWildcard\");exports.__esModule=true;exports.default=connect;var DevOverlay=_interopRequireWildcard(require(\"@next/react-dev-overlay/lib/client\"));var _stripAnsi=_interopRequireDefault(require(\"next/dist/compiled/strip-ansi\"));var _eventsource=require(\"./eventsource\");var _formatWebpackMessages=_interopRequireDefault(require(\"./format-webpack-messages\"));/**\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){DevOverlay.register();(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;},onUnrecoverableError(){hadRuntimeError=true;}};}// Remember some state related to hot module replacement.\nvar isFirstCompilation=true;var mostRecentCompilationHash=null;var hasCompileErrors=false;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 onSuccessfulHotUpdate(hasUpdates){// Only dismiss it when we're sure it's a hot update.\n// Otherwise it would flicker right before the reload.\nonFastRefresh(hasUpdates);});}}// 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(hasUpdates){// Only dismiss it when we're sure it's a hot update.\n// Otherwise it would flicker right before the reload.\nonFastRefresh(hasUpdates);});}}// 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.\nDevOverlay.onBuildError(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 onFastRefresh(hasUpdates){DevOverlay.onBuildOk();if(hasUpdates){DevOverlay.onRefresh();}console.log('[Fast Refresh] done');}// 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':{console.log('[Fast Refresh] rebuilding');break;}case'built':case'sync':{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();}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('[Fast Refresh] performing full reload\\n\\n'+\"Fast Refresh will perform a full reload when you edit a file that's imported by modules outside of the React tree.\\n\"+'You might have a file which renders a React component but also exports a value that is imported by a non-React component.\\n'+'Consider migrating the non-React component export to a separate file and importing it into both files.\\n\\n'+'It is also possible you are using class components at the top-level of your application, which disables Fast Refresh.\\n'+'Fast Refresh requires at least one function component in your React tree.');}else if(hadRuntimeError){console.warn('[Fast Refresh] performing full reload because your application had an unrecoverable error');}window.location.reload();return;}var hasUpdates=Boolean(updatedModules.length);if(typeof onHotUpdateSuccess==='function'){// Maybe we want to do something.\nonHotUpdateSuccess(hasUpdates);}if(isUpdateAvailable()){// While we were updating, there was a new update! Do it again.\ntryApplyUpdates(hasUpdates?undefined:onHotUpdateSuccess);}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"}