{"ast":null,"code":"\"use strict\";\n\nvar _regeneratorRuntime = require(\"@babel/runtime-corejs2/regenerator\");\n\nvar _Object$keys = require(\"@babel/runtime-corejs2/core-js/object/keys\");\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\n\n_Object$defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar url_1 = require(\"url\");\n/**\n * Utils\n */\n\n\nfunction execOnce(fn) {\n  var _this = this;\n\n  var used = false;\n  var result = null;\n  return function () {\n    if (!used) {\n      used = true;\n\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n\n      result = fn.apply(_this, args);\n    }\n\n    return result;\n  };\n}\n\nexports.execOnce = execOnce;\n\nfunction getLocationOrigin() {\n  var _window$location = window.location,\n      protocol = _window$location.protocol,\n      hostname = _window$location.hostname,\n      port = _window$location.port;\n  return \"\".concat(protocol, \"//\").concat(hostname).concat(port ? ':' + port : '');\n}\n\nexports.getLocationOrigin = getLocationOrigin;\n\nfunction getURL() {\n  var href = window.location.href;\n  var origin = getLocationOrigin();\n  return href.substring(origin.length);\n}\n\nexports.getURL = getURL;\n\nfunction getDisplayName(Component) {\n  return typeof Component === 'string' ? Component : Component.displayName || Component.name || 'Unknown';\n}\n\nexports.getDisplayName = getDisplayName;\n\nfunction isResSent(res) {\n  return res.finished || res.headersSent;\n}\n\nexports.isResSent = isResSent;\n\nfunction loadGetInitialProps(App, ctx) {\n  var _a, message, res, props, _message;\n\n  return _regeneratorRuntime.async(function loadGetInitialProps$(_context) {\n    while (1) {\n      switch (_context.prev = _context.next) {\n        case 0:\n          if (!false) {\n            _context.next = 4;\n            break;\n          }\n\n          if (!((_a = App.prototype) === null || _a === void 0 ? void 0 : _a.getInitialProps)) {\n            _context.next = 4;\n            break;\n          }\n\n          message = \"\\\"\".concat(getDisplayName(App), \".getInitialProps()\\\" is defined as an instance method - visit https://err.sh/zeit/next.js/get-initial-props-as-an-instance-method for more information.\");\n          throw new Error(message);\n\n        case 4:\n          // when called from _app `ctx` is nested in `ctx`\n          res = ctx.res || ctx.ctx && ctx.ctx.res;\n\n          if (App.getInitialProps) {\n            _context.next = 12;\n            break;\n          }\n\n          if (!(ctx.ctx && ctx.Component)) {\n            _context.next = 11;\n            break;\n          }\n\n          _context.next = 9;\n          return _regeneratorRuntime.awrap(loadGetInitialProps(ctx.Component, ctx.ctx));\n\n        case 9:\n          _context.t0 = _context.sent;\n          return _context.abrupt(\"return\", {\n            pageProps: _context.t0\n          });\n\n        case 11:\n          return _context.abrupt(\"return\", {});\n\n        case 12:\n          _context.next = 14;\n          return _regeneratorRuntime.awrap(App.getInitialProps(ctx));\n\n        case 14:\n          props = _context.sent;\n\n          if (!(res && isResSent(res))) {\n            _context.next = 17;\n            break;\n          }\n\n          return _context.abrupt(\"return\", props);\n\n        case 17:\n          if (props) {\n            _context.next = 20;\n            break;\n          }\n\n          _message = \"\\\"\".concat(getDisplayName(App), \".getInitialProps()\\\" should resolve to an object. But found \\\"\").concat(props, \"\\\" instead.\");\n          throw new Error(_message);\n\n        case 20:\n          if (false) {\n            if (_Object$keys(props).length === 0 && !ctx.ctx) {\n              console.warn(\"\".concat(getDisplayName(App), \" returned an empty object from `getInitialProps`. This de-optimizes and prevents automatic static optimization. https://err.sh/zeit/next.js/empty-object-getInitialProps\"));\n            }\n          }\n\n          return _context.abrupt(\"return\", props);\n\n        case 22:\n        case \"end\":\n          return _context.stop();\n      }\n    }\n  });\n}\n\nexports.loadGetInitialProps = loadGetInitialProps;\nexports.urlObjectKeys = ['auth', 'hash', 'host', 'hostname', 'href', 'path', 'pathname', 'port', 'protocol', 'query', 'search', 'slashes'];\n\nfunction formatWithValidation(url, options) {\n  if (false) {\n    if (url !== null && typeof url === 'object') {\n      _Object$keys(url).forEach(function (key) {\n        if (exports.urlObjectKeys.indexOf(key) === -1) {\n          console.warn(\"Unknown key passed via urlObject into url.format: \".concat(key));\n        }\n      });\n    }\n  }\n\n  return url_1.format(url, options);\n}\n\nexports.formatWithValidation = formatWithValidation;\nexports.SP = typeof performance !== 'undefined';\nexports.ST = exports.SP && typeof performance.mark === 'function' && typeof performance.measure === 'function';","map":null,"metadata":{},"sourceType":"script"}