{"version":3,"sources":["webpack://_N_E/../../../next-server/lib/amp.ts","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/classCallCheck.js","webpack://_N_E/../../../../../next-server/lib/router/utils/is-dynamic.ts","webpack://_N_E/../../client/with-router.tsx","webpack://_N_E/../../../../../next-server/lib/router/utils/querystring.ts","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/inherits.js","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","webpack://_N_E/../../../../../next-server/lib/router/utils/format-url.ts","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/interopRequireWildcard.js","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/arrayLikeToArray.js","webpack://_N_E/../../../next-server/lib/head.tsx","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/typeof.js","webpack://_N_E/../../../next-server/lib/head-manager-context.ts","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/arrayWithHoles.js","webpack://_N_E/./node_modules/next/dist/build/polyfills/object-assign.js","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/getPrototypeOf.js","webpack://_N_E/../../client/normalize-trailing-slash.ts","webpack://_N_E/../../../next-server/lib/side-effect.tsx","webpack://_N_E/../../../../../next-server/lib/router/utils/route-regex.ts","webpack://_N_E/../../../next-server/lib/mitt.ts","webpack://_N_E/../../../../next-server/lib/router/router.ts","webpack://_N_E/../../../next-server/lib/utils.ts","webpack://_N_E/../../../../../next-server/lib/router/utils/route-matcher.ts","webpack://_N_E/../../../../../next-server/lib/router/utils/parse-relative-url.ts","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/createClass.js","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/nonIterableSpread.js","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js","webpack://_N_E/./node_modules/regenerator-runtime/runtime.js","webpack://_N_E/../../../next-server/lib/amp-context.ts","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/toConsumableArray.js","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","webpack://_N_E/../../client/router.ts","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/defineProperty.js","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/nonIterableRest.js","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/construct.js","webpack://_N_E/../../../next-server/lib/router-context.ts","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/asyncToGenerator.js","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/assertThisInitialized.js","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/setPrototypeOf.js","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/iterableToArray.js","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/regenerator/index.js","webpack://_N_E/./node_modules/next/node_modules/@babel/runtime/helpers/slicedToArray.js"],"names":["isInAmpMode","React","AmpStateContext","ampFirst","hybrid","hasQuery","module","exports","instance","Constructor","TypeError","route","TEST_ROUTE","router","WithRouterWrapper","ComposedComponent","getInitialProps","query","searchParams","Array","result","Object","value","item","searchParamsList","key","target","setPrototypeOf","subClass","superClass","prototype","create","constructor","writable","configurable","arrayLikeToArray","arr","isArray","urlObj","protocol","pathname","hash","host","auth","encodeURIComponent","hostname","String","querystring","search","slashedProtocols","_typeof","_getRequireWildcardCache","WeakMap","cache","obj","__esModule","has","get","newObj","hasPropertyDescriptor","defineProperty","getOwnPropertyDescriptor","hasOwnProperty","call","desc","set","len","length","i","arr2","defaultHead","inAmpMode","head","charSet","name","content","onlyReactElement","child","list","fragmentChild","fragmentList","METATYPES","reduceComponents","headElements","headElementChildren","headElement","props","keys","tags","metaTypes","metaCategories","h","isUnique","metatype","category","categories","unique","c","Head","ampState","useContext","headManager","HeadManagerContext","reduceComponentsToState","Symbol","iterator","o","minLen","n","toString","slice","from","test","assign","bind","default","_getPrototypeOf","getPrototypeOf","__proto__","removePathTrailingSlash","path","normalizePathTrailingSlash","isServer","_hasHeadManager","emitChange","this","Component","segments","normalizedRoute","groups","groupIndex","parameterizedRoute","segment","param","optional","repeat","parseParameter","pos","str","re","RegExp","all","on","off","emit","handler","basePath","buildCancellationError","Error","cancelled","hasBasePath","addBasePath","delBasePath","isLocalURL","url","locationOrigin","resolved","URL","_","resolveHref","currentPath","base","urlAsString","href","formatWithValidation","finalUrl","PAGE_LOAD_ERROR","markLoadingError","err","prepareUrlAs","as","tryParseRelativeUrl","parseRelativeUrl","fetchNextData","dataHref","fetchRetry","fetch","credentials","res","attempts","isServerRender","Router","asPath","components","sdc","sub","clc","pageLoader","_bps","events","_wrapApp","isSsr","isFallback","_inFlightRoute","e","state","__N_SSG","initialProps","__N_SSP","isDynamicRoute","__NEXT_DATA__","window","mod","data","newData","options","change","ST","performance","cleanedAs","onlyAHashChange","parsed","searchParamsToUrlQuery","urlIsNew","method","shallow","routeRegex","getRouteRegex","routeMatch","getRouteMatcher","missingParams","asPathname","getRouteInfo","routeInfo","getURL","__N","fetchComponent","page","error","console","handleRouteInfoError","cachedRouteInfo","then","getDataHref","_getData","notify","split","newHash","oldUrlNoHash","oldHash","idEl","document","nameEl","Promise","prefetchData","cancel","loadPage","componentResult","fn","AppTree","ctx","loadGetInitialProps","used","origin","getLocationOrigin","formatUrl","port","getDisplayName","isResSent","App","pageProps","message","SP","decode","decodeURIComponent","params","slugName","g","m","entry","resolvedBase","DUMMY_BASE","_defineProperties","descriptor","enumerable","protoProps","staticProps","Reflect","construct","sham","Proxy","Date","runtime","undefined","Op","hasOwn","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","context","Context","_invoke","GenStateSuspendedStart","arg","GenStateExecuting","GenStateCompleted","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","done","GenStateSuspendedYield","makeInvokeMethod","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","resolve","reject","invoke","__await","unwrapped","info","resultName","next","nextLoc","pushTryEntry","locs","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","displayName","isGeneratorFunction","genFun","ctor","mark","awrap","async","iter","object","reverse","pop","skipTempReset","prev","charAt","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","Function","arrayWithoutHoles","iterableToArray","unsupportedIterableToArray","nonIterableSpread","_arr","_n","_d","_e","_s","_i","RouterContext","_router","coreMethodFields","field","singletonRouter","readyCallbacks","ready","cb","urlPropertyFields","getRouter","event","eventField","_singletonRouter","isNativeReflectConstruct","_construct","Parent","args","Class","a","apply","arguments","asyncGeneratorStep","gen","_next","_throw","ReferenceError","_setPrototypeOf","p","assertThisInitialized","arrayWithHoles","iterableToArrayLimit","nonIterableRest"],"mappings":"8IAWO,WAEL,OAAOA,EAAYC,qBAAiBC,EAApC,mBAbF,I,EAAA,G,EAAA,Y,2BACA,YAEO,SAASF,IAIC,6DAJV,GAIU,IAHfG,gBAGe,aAFfC,cAEe,aADfC,SAEA,OAAOF,GAAaC,SADL,Y,qBCDjBE,EAAOC,QANP,SAAyBC,EAAUC,GACjC,KAAMD,aAAoBC,GACxB,MAAM,IAAIC,UAAU,uC,qECCjB,SAAwBC,GAC7B,O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+P,K,qBCD1F,IAAI5T,EAAU,EAAQ,QAElB0X,EAAwB,EAAQ,QAUpCta,EAAOC,QARP,SAAoCiS,EAAMzO,GACxC,OAAIA,GAA2B,WAAlBb,EAAQa,IAAsC,oBAATA,EAI3C6W,EAAsBpI,GAHpBzO,I,qBCNXzD,EAAOC,QAAU,EAAQ,S,qBCAzB,IAAIsa,EAAiB,EAAQ,QAEzBC,EAAuB,EAAQ,QAE/BtC,EAA6B,EAAQ,QAErCuC,EAAkB,EAAQ,QAM9Bza,EAAOC,QAJP,SAAwB6B,EAAKgC,GAC3B,OAAOyW,EAAezY,IAAQ0Y,EAAqB1Y,EAAKgC,IAAMoU,EAA2BpW,EAAKgC,IAAM2W","file":"static/chunks/commons.8747e23c27b0dd437666.js","sourcesContent":["import React from 'react'\nimport { AmpStateContext } from './amp-context'\n\nexport function isInAmpMode({\n ampFirst = false,\n hybrid = false,\n hasQuery = false,\n} = {}): boolean {\n return ampFirst || (hybrid && hasQuery)\n}\n\nexport function useAmp(): boolean {\n // Don't assign the context value to a variable to save bytes\n return isInAmpMode(React.useContext(AmpStateContext))\n}\n","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","// Identify /[param]/ in route string\nconst TEST_ROUTE = /\\/\\[[^/]+?\\](?=\\/|$)/\n\nexport function isDynamicRoute(route: string): boolean {\n return TEST_ROUTE.test(route)\n}\n","import React from 'react'\nimport { NextComponentType, NextPageContext } from '../next-server/lib/utils'\nimport { NextRouter, useRouter } from './router'\n\nexport type WithRouterProps = {\n router: NextRouter\n}\n\nexport type ExcludeRouterProps

= Pick<\n P,\n Exclude\n>\n\nexport default function withRouter<\n P extends WithRouterProps,\n C = NextPageContext\n>(\n ComposedComponent: NextComponentType\n): React.ComponentType> {\n function WithRouterWrapper(props: any) {\n return \n }\n\n WithRouterWrapper.getInitialProps = ComposedComponent.getInitialProps\n // This is needed to allow checking for custom getInitialProps in _app\n ;(WithRouterWrapper as any).origGetInitialProps = (ComposedComponent as any).origGetInitialProps\n if (process.env.NODE_ENV !== 'production') {\n const name =\n ComposedComponent.displayName || ComposedComponent.name || 'Unknown'\n WithRouterWrapper.displayName = `withRouter(${name})`\n }\n\n return WithRouterWrapper\n}\n","import { ParsedUrlQuery } from 'querystring'\n\nexport function searchParamsToUrlQuery(\n searchParams: URLSearchParams\n): ParsedUrlQuery {\n const query: ParsedUrlQuery = {}\n searchParams.forEach((value, key) => {\n if (typeof query[key] === 'undefined') {\n query[key] = value\n } else if (Array.isArray(query[key])) {\n ;(query[key] as string[]).push(value)\n } else {\n query[key] = [query[key] as string, value]\n }\n })\n return query\n}\n\nexport function urlQueryToSearchParams(\n urlQuery: ParsedUrlQuery\n): URLSearchParams {\n const result = new URLSearchParams()\n Object.entries(urlQuery).forEach(([key, value]) => {\n if (Array.isArray(value)) {\n value.forEach((item) => result.append(key, item))\n } else {\n result.set(key, value)\n }\n })\n return result\n}\n\nexport function assign(\n target: URLSearchParams,\n ...searchParamsList: URLSearchParams[]\n): URLSearchParams {\n searchParamsList.forEach((searchParams) => {\n Array.from(searchParams.keys()).forEach((key) => target.delete(key))\n searchParams.forEach((value, key) => target.append(key, value))\n })\n return target\n}\n","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","var arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\n\nmodule.exports = _arrayWithoutHoles;","// Format function modified from nodejs\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport { UrlObject } from 'url'\nimport { ParsedUrlQuery } from 'querystring'\nimport * as querystring from './querystring'\n\nconst slashedProtocols = /https?|ftp|gopher|file/\n\nexport function formatUrl(urlObj: UrlObject) {\n let { auth, hostname } = urlObj\n let protocol = urlObj.protocol || ''\n let pathname = urlObj.pathname || ''\n let hash = urlObj.hash || ''\n let query = urlObj.query || ''\n let host: string | false = false\n\n auth = auth ? encodeURIComponent(auth).replace(/%3A/i, ':') + '@' : ''\n\n if (urlObj.host) {\n host = auth + urlObj.host\n } else if (hostname) {\n host = auth + (~hostname.indexOf(':') ? `[${hostname}]` : hostname)\n if (urlObj.port) {\n host += ':' + urlObj.port\n }\n }\n\n if (query && typeof query === 'object') {\n query = String(querystring.urlQueryToSearchParams(query as ParsedUrlQuery))\n }\n\n let search = urlObj.search || (query && `?${query}`) || ''\n\n if (protocol && protocol.substr(-1) !== ':') protocol += ':'\n\n if (\n urlObj.slashes ||\n ((!protocol || slashedProtocols.test(protocol)) && host !== false)\n ) {\n host = '//' + (host || '')\n if (pathname && pathname[0] !== '/') pathname = '/' + pathname\n } else if (!host) {\n host = ''\n }\n\n if (hash && hash[0] !== '#') hash = '#' + hash\n if (search && search[0] !== '?') search = '?' + search\n\n pathname = pathname.replace(/[?#]/g, encodeURIComponent)\n search = search.replace('#', '%23')\n\n return `${protocol}${host}${pathname}${search}${hash}`\n}\n","var _typeof = require(\"../helpers/typeof\");\n\nfunction _getRequireWildcardCache() {\n if (typeof WeakMap !== \"function\") return null;\n var cache = new WeakMap();\n\n _getRequireWildcardCache = function _getRequireWildcardCache() {\n return cache;\n };\n\n return cache;\n}\n\nfunction _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n }\n\n if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") {\n return {\n \"default\": obj\n };\n }\n\n var cache = _getRequireWildcardCache();\n\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n\n var newObj = {};\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n\n newObj[\"default\"] = obj;\n\n if (cache) {\n cache.set(obj, newObj);\n }\n\n return newObj;\n}\n\nmodule.exports = _interopRequireWildcard;","function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nmodule.exports = _arrayLikeToArray;","import React, { useContext } from 'react'\nimport Effect from './side-effect'\nimport { AmpStateContext } from './amp-context'\nimport { HeadManagerContext } from './head-manager-context'\nimport { isInAmpMode } from './amp'\n\ntype WithInAmpMode = {\n inAmpMode?: boolean\n}\n\nexport function defaultHead(inAmpMode = false): JSX.Element[] {\n const head = []\n if (!inAmpMode) {\n head.push()\n }\n return head\n}\n\nfunction onlyReactElement(\n list: Array>,\n child: React.ReactChild\n): Array> {\n // React children can be \"string\" or \"number\" in this case we ignore them for backwards compat\n if (typeof child === 'string' || typeof child === 'number') {\n return list\n }\n // Adds support for React.Fragment\n if (child.type === React.Fragment) {\n return list.concat(\n React.Children.toArray(child.props.children).reduce(\n (\n fragmentList: Array>,\n fragmentChild: React.ReactChild\n ): Array> => {\n if (\n typeof fragmentChild === 'string' ||\n typeof fragmentChild === 'number'\n ) {\n return fragmentList\n }\n return fragmentList.concat(fragmentChild)\n },\n []\n )\n )\n }\n return list.concat(child)\n}\n\nconst METATYPES = ['name', 'httpEquiv', 'charSet', 'itemProp']\n\n/*\n returns a function for filtering head child elements\n which shouldn't be duplicated, like \n Also adds support for deduplicated `key` properties\n*/\nfunction unique() {\n const keys = new Set()\n const tags = new Set()\n const metaTypes = new Set()\n const metaCategories: { [metatype: string]: Set<string> } = {}\n\n return (h: React.ReactElement<any>) => {\n let isUnique = true\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n const key = h.key.slice(h.key.indexOf('$') + 1)\n if (keys.has(key)) {\n isUnique = false\n } else {\n keys.add(key)\n }\n }\n\n // eslint-disable-next-line default-case\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n isUnique = false\n } else {\n tags.add(h.type)\n }\n break\n case 'meta':\n for (let i = 0, len = METATYPES.length; i < len; i++) {\n const metatype = METATYPES[i]\n if (!h.props.hasOwnProperty(metatype)) continue\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n isUnique = false\n } else {\n metaTypes.add(metatype)\n }\n } else {\n const category = h.props[metatype]\n const categories = metaCategories[metatype] || new Set()\n if (categories.has(category)) {\n isUnique = false\n } else {\n categories.add(category)\n metaCategories[metatype] = categories\n }\n }\n }\n break\n }\n\n return isUnique\n }\n}\n\n/**\n *\n * @param headElements List of multiple <Head> instances\n */\nfunction reduceComponents(\n headElements: Array<React.ReactElement<any>>,\n props: WithInAmpMode\n) {\n return headElements\n .reduce(\n (list: React.ReactChild[], headElement: React.ReactElement<any>) => {\n const headElementChildren = React.Children.toArray(\n headElement.props.children\n )\n return list.concat(headElementChildren)\n },\n []\n )\n .reduce(onlyReactElement, [])\n .reverse()\n .concat(defaultHead(props.inAmpMode))\n .filter(unique())\n .reverse()\n .map((c: React.ReactElement<any>, i: number) => {\n const key = c.key || i\n if (process.env.__NEXT_OPTIMIZE_FONTS) {\n if (\n c.type === 'link' &&\n c.props['href'] &&\n // TODO(prateekbh@): Replace this with const from `constants` when the tree shaking works.\n ['https://fonts.googleapis.com/css'].some((url) =>\n c.props['href'].startsWith(url)\n )\n ) {\n const newProps = { ...(c.props || {}) }\n newProps['data-href'] = newProps['href']\n newProps['href'] = undefined\n return React.cloneElement(c, newProps)\n }\n }\n return React.cloneElement(c, { key })\n })\n}\n\n/**\n * This component injects elements to `<head>` of your page.\n * To avoid duplicated `tags` in `<head>` you can use the `key` property, which will make sure every tag is only rendered once.\n */\nfunction Head({ children }: { children: React.ReactNode }) {\n const ampState = useContext(AmpStateContext)\n const headManager = useContext(HeadManagerContext)\n return (\n <Effect\n reduceComponentsToState={reduceComponents}\n headManager={headManager}\n inAmpMode={isInAmpMode(ampState)}\n >\n {children}\n </Effect>\n )\n}\n\n// TODO: Remove in the next major release\nHead.rewind = () => {}\n\nexport default Head\n","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","import React from 'react'\n\nexport const HeadManagerContext: React.Context<{\n updateHead?: (state: any) => void\n mountedInstances?: any\n}> = React.createContext({})\n\nif (process.env.NODE_ENV !== 'production') {\n HeadManagerContext.displayName = 'HeadManagerContext'\n}\n","var arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray;","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;","\"use strict\";var assign=Object.assign.bind(Object);module.exports=assign;module.exports.default=module.exports;\n//# sourceMappingURL=object-assign.js.map","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","/**\n * Removes the trailing slash of a path if there is one. Preserves the root path `/`.\n */\nexport function removePathTrailingSlash(path: string): string {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path\n}\n\n/**\n * Normalizes the trailing slash of a path according to the `trailingSlash` option\n * in `next.config.js`.\n */\nexport const normalizePathTrailingSlash = process.env.__NEXT_TRAILING_SLASH\n ? (path: string): string => {\n if (/\\.[^/]+\\/?$/.test(path)) {\n return removePathTrailingSlash(path)\n } else if (path.endsWith('/')) {\n return path\n } else {\n return path + '/'\n }\n }\n : removePathTrailingSlash\n","import React, { Component } from 'react'\n\nconst isServer = typeof window === 'undefined'\n\ntype State = JSX.Element[] | undefined\n\ntype SideEffectProps = {\n reduceComponentsToState: <T>(\n components: Array<React.ReactElement<any>>,\n props: T\n ) => State\n handleStateChange?: (state: State) => void\n headManager: any\n inAmpMode?: boolean\n}\n\nexport default class extends Component<SideEffectProps> {\n private _hasHeadManager: boolean\n\n emitChange = (): void => {\n if (this._hasHeadManager) {\n this.props.headManager.updateHead(\n this.props.reduceComponentsToState(\n [...this.props.headManager.mountedInstances],\n this.props\n )\n )\n }\n }\n\n constructor(props: any) {\n super(props)\n this._hasHeadManager =\n this.props.headManager && this.props.headManager.mountedInstances\n\n if (isServer && this._hasHeadManager) {\n this.props.headManager.mountedInstances.add(this)\n this.emitChange()\n }\n }\n componentDidMount() {\n if (this._hasHeadManager) {\n this.props.headManager.mountedInstances.add(this)\n }\n this.emitChange()\n }\n componentDidUpdate() {\n this.emitChange()\n }\n componentWillUnmount() {\n if (this._hasHeadManager) {\n this.props.headManager.mountedInstances.delete(this)\n }\n this.emitChange()\n }\n\n render() {\n return null\n }\n}\n","interface Group {\n pos: number\n repeat: boolean\n optional: boolean\n}\n\n// this isn't importing the escape-string-regex module\n// to reduce bytes\nfunction escapeRegex(str: string) {\n return str.replace(/[|\\\\{}()[\\]^$+*?.-]/g, '\\\\$&')\n}\n\nfunction parseParameter(param: string) {\n const optional = param.startsWith('[') && param.endsWith(']')\n if (optional) {\n param = param.slice(1, -1)\n }\n const repeat = param.startsWith('...')\n if (repeat) {\n param = param.slice(3)\n }\n return { key: param, repeat, optional }\n}\n\nexport function getRouteRegex(\n normalizedRoute: string\n): {\n re: RegExp\n namedRegex?: string\n routeKeys?: { [named: string]: string }\n groups: { [groupName: string]: Group }\n} {\n const segments = (normalizedRoute.replace(/\\/$/, '') || '/')\n .slice(1)\n .split('/')\n\n const groups: { [groupName: string]: Group } = {}\n let groupIndex = 1\n const parameterizedRoute = segments\n .map((segment) => {\n if (segment.startsWith('[') && segment.endsWith(']')) {\n const { key, optional, repeat } = parseParameter(segment.slice(1, -1))\n groups[key] = { pos: groupIndex++, repeat, optional }\n return repeat ? (optional ? '(?:/(.+?))?' : '/(.+?)') : '/([^/]+?)'\n } else {\n return `/${escapeRegex(segment)}`\n }\n })\n .join('')\n\n // dead code eliminate for browser since it's only needed\n // while generating routes-manifest\n if (typeof window === 'undefined') {\n let routeKeyCharCode = 97\n let routeKeyCharLength = 1\n\n // builds a minimal routeKey using only a-z and minimal number of characters\n const getSafeRouteKey = () => {\n let routeKey = ''\n\n for (let i = 0; i < routeKeyCharLength; i++) {\n routeKey += String.fromCharCode(routeKeyCharCode)\n routeKeyCharCode++\n\n if (routeKeyCharCode > 122) {\n routeKeyCharLength++\n routeKeyCharCode = 97\n }\n }\n return routeKey\n }\n\n const routeKeys: { [named: string]: string } = {}\n\n let namedParameterizedRoute = segments\n .map((segment) => {\n if (segment.startsWith('[') && segment.endsWith(']')) {\n const { key, optional, repeat } = parseParameter(segment.slice(1, -1))\n // replace any non-word characters since they can break\n // the named regex\n let cleanedKey = key.replace(/\\W/g, '')\n let invalidKey = false\n\n // check if the key is still invalid and fallback to using a known\n // safe key\n if (cleanedKey.length === 0 || cleanedKey.length > 30) {\n invalidKey = true\n }\n if (!isNaN(parseInt(cleanedKey.substr(0, 1)))) {\n invalidKey = true\n }\n\n if (invalidKey) {\n cleanedKey = getSafeRouteKey()\n }\n\n routeKeys[cleanedKey] = key\n return repeat\n ? optional\n ? `(?:/(?<${cleanedKey}>.+?))?`\n : `/(?<${cleanedKey}>.+?)`\n : `/(?<${cleanedKey}>[^/]+?)`\n } else {\n return `/${escapeRegex(segment)}`\n }\n })\n .join('')\n\n return {\n re: new RegExp(`^${parameterizedRoute}(?:/)?$`),\n groups,\n routeKeys,\n namedRegex: `^${namedParameterizedRoute}(?:/)?$`,\n }\n }\n\n return {\n re: new RegExp(`^${parameterizedRoute}(?:/)?$`),\n groups,\n }\n}\n","/*\nMIT License\n\nCopyright (c) Jason Miller (https://jasonformat.com/)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n// This file is based on https://github.com/developit/mitt/blob/v1.1.3/src/index.js\n// It's been edited for the needs of this script\n// See the LICENSE at the top of the file\n\ntype Handler = (...evts: any[]) => void\n\nexport type MittEmitter = {\n on(type: string, handler: Handler): void\n off(type: string, handler: Handler): void\n emit(type: string, ...evts: any[]): void\n}\n\nexport default function mitt(): MittEmitter {\n const all: { [s: string]: Handler[] } = Object.create(null)\n\n return {\n on(type: string, handler: Handler) {\n ;(all[type] || (all[type] = [])).push(handler)\n },\n\n off(type: string, handler: Handler) {\n if (all[type]) {\n // tslint:disable-next-line:no-bitwise\n all[type].splice(all[type].indexOf(handler) >>> 0, 1)\n }\n },\n\n emit(type: string, ...evts: any[]) {\n // eslint-disable-next-line array-callback-return\n ;(all[type] || []).slice().map((handler: Handler) => {\n handler(...evts)\n })\n },\n }\n}\n","/* global __NEXT_DATA__ */\n// tslint:disable:no-console\nimport { ParsedUrlQuery } from 'querystring'\nimport { ComponentType } from 'react'\nimport { UrlObject } from 'url'\nimport mitt, { MittEmitter } from '../mitt'\nimport {\n AppContextType,\n formatWithValidation,\n getURL,\n loadGetInitialProps,\n NextPageContext,\n ST,\n getLocationOrigin,\n} from '../utils'\nimport { isDynamicRoute } from './utils/is-dynamic'\nimport { getRouteMatcher } from './utils/route-matcher'\nimport { getRouteRegex } from './utils/route-regex'\nimport { searchParamsToUrlQuery } from './utils/querystring'\nimport { parseRelativeUrl } from './utils/parse-relative-url'\nimport {\n removePathTrailingSlash,\n normalizePathTrailingSlash,\n} from '../../../client/normalize-trailing-slash'\n\ninterface TransitionOptions {\n shallow?: boolean\n}\n\ninterface NextHistoryState {\n url: string\n as: string\n options: TransitionOptions\n}\n\ntype HistoryState = null | { __N: false } | ({ __N: true } & NextHistoryState)\n\nconst basePath = (process.env.__NEXT_ROUTER_BASEPATH as string) || ''\n\nfunction buildCancellationError() {\n return Object.assign(new Error('Route Cancelled'), {\n cancelled: true,\n })\n}\n\nexport function hasBasePath(path: string): boolean {\n return path === basePath || path.startsWith(basePath + '/')\n}\n\nexport function addBasePath(path: string): string {\n // we only add the basepath on relative urls\n return basePath && path.startsWith('/')\n ? path === '/'\n ? normalizePathTrailingSlash(basePath)\n : basePath + path\n : path\n}\n\nexport function delBasePath(path: string): string {\n return path.slice(basePath.length) || '/'\n}\n\n/**\n * Detects whether a given url is routable by the Next.js router (browser only).\n */\nexport function isLocalURL(url: string): boolean {\n if (url.startsWith('/')) return true\n try {\n // absolute urls can be local if they are on the same origin\n const locationOrigin = getLocationOrigin()\n const resolved = new URL(url, locationOrigin)\n return resolved.origin === locationOrigin && hasBasePath(resolved.pathname)\n } catch (_) {\n return false\n }\n}\n\ntype Url = UrlObject | string\n\n/**\n * Resolves a given hyperlink with a certain router state (basePath not included).\n * Preserves absolute urls.\n */\nexport function resolveHref(currentPath: string, href: Url): string {\n // we use a dummy base url for relative urls\n const base = new URL(currentPath, 'http://n')\n const urlAsString =\n typeof href === 'string' ? href : formatWithValidation(href)\n try {\n const finalUrl = new URL(urlAsString, base)\n finalUrl.pathname = normalizePathTrailingSlash(finalUrl.pathname)\n // if the origin didn't change, it means we received a relative href\n return finalUrl.origin === base.origin\n ? finalUrl.href.slice(finalUrl.origin.length)\n : finalUrl.href\n } catch (_) {\n return urlAsString\n }\n}\n\nconst PAGE_LOAD_ERROR = Symbol('PAGE_LOAD_ERROR')\nexport function markLoadingError(err: Error): Error {\n return Object.defineProperty(err, PAGE_LOAD_ERROR, {})\n}\n\nfunction prepareUrlAs(router: NextRouter, url: Url, as: Url) {\n // If url and as provided as an object representation,\n // we'll format them into the string version here.\n return {\n url: addBasePath(resolveHref(router.pathname, url)),\n as: as ? addBasePath(resolveHref(router.pathname, as)) : as,\n }\n}\n\nfunction tryParseRelativeUrl(\n url: string\n): null | ReturnType<typeof parseRelativeUrl> {\n try {\n return parseRelativeUrl(url)\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n setTimeout(() => {\n throw new Error(\n `Invalid href passed to router: ${url} https://err.sh/vercel/next.js/invalid-href-passed`\n )\n }, 0)\n }\n return null\n }\n}\n\ntype ComponentRes = { page: ComponentType; mod: any }\n\nexport type BaseRouter = {\n route: string\n pathname: string\n query: ParsedUrlQuery\n asPath: string\n basePath: string\n}\n\nexport type NextRouter = BaseRouter &\n Pick<\n Router,\n | 'push'\n | 'replace'\n | 'reload'\n | 'back'\n | 'prefetch'\n | 'beforePopState'\n | 'events'\n | 'isFallback'\n >\n\nexport type PrefetchOptions = {\n priority?: boolean\n}\n\ntype RouteInfo = {\n Component: ComponentType\n __N_SSG?: boolean\n __N_SSP?: boolean\n props?: any\n err?: Error\n error?: any\n}\n\ntype Subscription = (data: RouteInfo, App?: ComponentType) => Promise<void>\n\ntype BeforePopStateCallback = (state: NextHistoryState) => boolean\n\ntype ComponentLoadCancel = (() => void) | null\n\ntype HistoryMethod = 'replaceState' | 'pushState'\n\nconst manualScrollRestoration =\n process.env.__NEXT_SCROLL_RESTORATION &&\n typeof window !== 'undefined' &&\n 'scrollRestoration' in window.history\n\nfunction fetchRetry(url: string, attempts: number): Promise<any> {\n return fetch(url, {\n // Cookies are required to be present for Next.js' SSG \"Preview Mode\".\n // Cookies may also be required for `getServerSideProps`.\n //\n // > `fetch` won’t send cookies, unless you set the credentials init\n // > option.\n // https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch\n //\n // > For maximum browser compatibility when it comes to sending &\n // > receiving cookies, always supply the `credentials: 'same-origin'`\n // > option instead of relying on the default.\n // https://github.com/github/fetch#caveats\n credentials: 'same-origin',\n }).then((res) => {\n if (!res.ok) {\n if (attempts > 1 && res.status >= 500) {\n return fetchRetry(url, attempts - 1)\n }\n throw new Error(`Failed to load static props`)\n }\n\n return res.json()\n })\n}\n\nfunction fetchNextData(dataHref: string, isServerRender: boolean) {\n return fetchRetry(dataHref, isServerRender ? 3 : 1).catch((err: Error) => {\n // We should only trigger a server-side transition if this was caused\n // on a client-side transition. Otherwise, we'd get into an infinite\n // loop.\n if (!isServerRender) {\n markLoadingError(err)\n }\n throw err\n })\n}\n\nexport default class Router implements BaseRouter {\n route: string\n pathname: string\n query: ParsedUrlQuery\n asPath: string\n basePath: string\n\n /**\n * Map of all components loaded in `Router`\n */\n components: { [pathname: string]: RouteInfo }\n // Static Data Cache\n sdc: { [asPath: string]: object } = {}\n sub: Subscription\n clc: ComponentLoadCancel\n pageLoader: any\n _bps: BeforePopStateCallback | undefined\n events: MittEmitter\n _wrapApp: (App: ComponentType) => any\n isSsr: boolean\n isFallback: boolean\n _inFlightRoute?: string\n\n static events: MittEmitter = mitt()\n\n constructor(\n pathname: string,\n query: ParsedUrlQuery,\n as: string,\n {\n initialProps,\n pageLoader,\n App,\n wrapApp,\n Component,\n err,\n subscription,\n isFallback,\n }: {\n subscription: Subscription\n initialProps: any\n pageLoader: any\n Component: ComponentType\n App: ComponentType\n wrapApp: (App: ComponentType) => any\n err?: Error\n isFallback: boolean\n }\n ) {\n // represents the current component key\n this.route = removePathTrailingSlash(pathname)\n\n // set up the component cache (by route keys)\n this.components = {}\n // We should not keep the cache, if there's an error\n // Otherwise, this cause issues when when going back and\n // come again to the errored page.\n if (pathname !== '/_error') {\n this.components[this.route] = {\n Component,\n props: initialProps,\n err,\n __N_SSG: initialProps && initialProps.__N_SSG,\n __N_SSP: initialProps && initialProps.__N_SSP,\n }\n }\n\n this.components['/_app'] = { Component: App }\n\n // Backwards compat for Router.router.events\n // TODO: Should be remove the following major version as it was never documented\n this.events = Router.events\n\n this.pageLoader = pageLoader\n this.pathname = pathname\n this.query = query\n // if auto prerendered and dynamic route wait to update asPath\n // until after mount to prevent hydration mismatch\n this.asPath =\n // @ts-ignore this is temporarily global (attached to window)\n isDynamicRoute(pathname) && __NEXT_DATA__.autoExport ? pathname : as\n this.basePath = basePath\n this.sub = subscription\n this.clc = null\n this._wrapApp = wrapApp\n // make sure to ignore extra popState in safari on navigating\n // back from external site\n this.isSsr = true\n\n this.isFallback = isFallback\n\n if (typeof window !== 'undefined') {\n // make sure \"as\" doesn't start with double slashes or else it can\n // throw an error as it's considered invalid\n if (as.substr(0, 2) !== '//') {\n // in order for `e.state` to work on the `onpopstate` event\n // we have to register the initial route upon initialization\n this.changeState(\n 'replaceState',\n formatWithValidation({ pathname: addBasePath(pathname), query }),\n getURL()\n )\n }\n\n window.addEventListener('popstate', this.onPopState)\n\n // enable custom scroll restoration handling when available\n // otherwise fallback to browser's default handling\n if (process.env.__NEXT_SCROLL_RESTORATION) {\n if (manualScrollRestoration) {\n window.history.scrollRestoration = 'manual'\n\n let scrollDebounceTimeout: undefined | NodeJS.Timeout\n\n const debouncedScrollSave = () => {\n if (scrollDebounceTimeout) clearTimeout(scrollDebounceTimeout)\n\n scrollDebounceTimeout = setTimeout(() => {\n const { url, as: curAs, options } = history.state\n this.changeState(\n 'replaceState',\n url,\n curAs,\n Object.assign({}, options, {\n _N_X: window.scrollX,\n _N_Y: window.scrollY,\n })\n )\n }, 10)\n }\n\n window.addEventListener('scroll', debouncedScrollSave)\n }\n }\n }\n }\n\n onPopState = (e: PopStateEvent): void => {\n const state = e.state as HistoryState\n\n if (!state) {\n // We get state as undefined for two reasons.\n // 1. With older safari (< 8) and older chrome (< 34)\n // 2. When the URL changed with #\n //\n // In the both cases, we don't need to proceed and change the route.\n // (as it's already changed)\n // But we can simply replace the state with the new changes.\n // Actually, for (1) we don't need to nothing. But it's hard to detect that event.\n // So, doing the following for (1) does no harm.\n const { pathname, query } = this\n this.changeState(\n 'replaceState',\n formatWithValidation({ pathname: addBasePath(pathname), query }),\n getURL()\n )\n return\n }\n\n if (!state.__N) {\n return\n }\n\n const { url, as, options } = state\n\n const { pathname } = parseRelativeUrl(url)\n\n // Make sure we don't re-render on initial load,\n // can be caused by navigating back from an external site\n if (this.isSsr && as === this.asPath && pathname === this.pathname) {\n return\n }\n\n // If the downstream application returns falsy, return.\n // They will then be responsible for handling the event.\n if (this._bps && !this._bps(state)) {\n return\n }\n\n this.change('replaceState', url, as, options)\n }\n\n update(route: string, mod: any) {\n const Component: ComponentType = mod.default || mod\n const data = this.components[route]\n if (!data) {\n throw new Error(`Cannot update unavailable route: ${route}`)\n }\n\n const newData = Object.assign({}, data, {\n Component,\n __N_SSG: mod.__N_SSG,\n __N_SSP: mod.__N_SSP,\n })\n this.components[route] = newData\n\n // pages/_app.js updated\n if (route === '/_app') {\n this.notify(this.components[this.route])\n return\n }\n\n if (route === this.route) {\n this.notify(newData)\n }\n }\n\n reload(): void {\n window.location.reload()\n }\n\n /**\n * Go back in history\n */\n back() {\n window.history.back()\n }\n\n /**\n * Performs a `pushState` with arguments\n * @param url of the route\n * @param as masks `url` for the browser\n * @param options object you can define `shallow` and other options\n */\n push(url: Url, as: Url = url, options: TransitionOptions = {}) {\n ;({ url, as } = prepareUrlAs(this, url, as))\n return this.change('pushState', url, as, options)\n }\n\n /**\n * Performs a `replaceState` with arguments\n * @param url of the route\n * @param as masks `url` for the browser\n * @param options object you can define `shallow` and other options\n */\n replace(url: Url, as: Url = url, options: TransitionOptions = {}) {\n ;({ url, as } = prepareUrlAs(this, url, as))\n return this.change('replaceState', url, as, options)\n }\n\n async change(\n method: HistoryMethod,\n url: string,\n as: string,\n options: TransitionOptions\n ): Promise<boolean> {\n if (!isLocalURL(url)) {\n window.location.href = url\n return false\n }\n\n if (!(options as any)._h) {\n this.isSsr = false\n }\n // marking route changes as a navigation start entry\n if (ST) {\n performance.mark('routeChange')\n }\n\n if (this._inFlightRoute) {\n this.abortComponentLoad(this._inFlightRoute)\n }\n\n const cleanedAs = hasBasePath(as) ? delBasePath(as) : as\n this._inFlightRoute = as\n\n // If the url change is only related to a hash change\n // We should not proceed. We should only change the state.\n\n // WARNING: `_h` is an internal option for handing Next.js client-side\n // hydration. Your app should _never_ use this property. It may change at\n // any time without notice.\n if (!(options as any)._h && this.onlyAHashChange(cleanedAs)) {\n this.asPath = cleanedAs\n Router.events.emit('hashChangeStart', as)\n this.changeState(method, url, as, options)\n this.scrollToHash(cleanedAs)\n this.notify(this.components[this.route])\n Router.events.emit('hashChangeComplete', as)\n return true\n }\n\n const parsed = tryParseRelativeUrl(url)\n\n if (!parsed) return false\n\n let { pathname, searchParams } = parsed\n const query = searchParamsToUrlQuery(searchParams)\n\n // url and as should always be prefixed with basePath by this\n // point by either next/link or router.push/replace so strip the\n // basePath from the pathname to match the pages dir 1-to-1\n pathname = pathname\n ? removePathTrailingSlash(delBasePath(pathname))\n : pathname\n\n // If asked to change the current URL we should reload the current page\n // (not location.reload() but reload getInitialProps and other Next.js stuffs)\n // We also need to set the method = replaceState always\n // as this should not go into the history (That's how browsers work)\n // We should compare the new asPath to the current asPath, not the url\n if (!this.urlIsNew(cleanedAs)) {\n method = 'replaceState'\n }\n\n const route = removePathTrailingSlash(pathname)\n const { shallow = false } = options\n\n if (isDynamicRoute(route)) {\n const { pathname: asPathname } = parseRelativeUrl(cleanedAs)\n const routeRegex = getRouteRegex(route)\n const routeMatch = getRouteMatcher(routeRegex)(asPathname)\n if (!routeMatch) {\n const missingParams = Object.keys(routeRegex.groups).filter(\n (param) => !query[param]\n )\n\n if (missingParams.length > 0) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Mismatching \\`as\\` and \\`href\\` failed to manually provide ` +\n `the params: ${missingParams.join(\n ', '\n )} in the \\`href\\`'s \\`query\\``\n )\n }\n\n throw new Error(\n `The provided \\`as\\` value (${asPathname}) is incompatible with the \\`href\\` value (${route}). ` +\n `Read more: https://err.sh/vercel/next.js/incompatible-href-as`\n )\n }\n } else {\n // Merge params into `query`, overwriting any specified in search\n Object.assign(query, routeMatch)\n }\n }\n\n Router.events.emit('routeChangeStart', as)\n\n try {\n const routeInfo = await this.getRouteInfo(\n route,\n pathname,\n query,\n as,\n shallow\n )\n const { error } = routeInfo\n\n Router.events.emit('beforeHistoryChange', as)\n this.changeState(method, url, as, options)\n\n if (process.env.NODE_ENV !== 'production') {\n const appComp: any = this.components['/_app'].Component\n ;(window as any).next.isPrerendered =\n appComp.getInitialProps === appComp.origGetInitialProps &&\n !(routeInfo.Component as any).getInitialProps\n }\n\n await this.set(route, pathname!, query, cleanedAs, routeInfo)\n\n if (error) {\n Router.events.emit('routeChangeError', error, cleanedAs)\n throw error\n }\n\n if (process.env.__NEXT_SCROLL_RESTORATION) {\n if (manualScrollRestoration && '_N_X' in options) {\n window.scrollTo((options as any)._N_X, (options as any)._N_Y)\n }\n }\n Router.events.emit('routeChangeComplete', as)\n\n return true\n } catch (err) {\n if (err.cancelled) {\n return false\n }\n throw err\n }\n }\n\n changeState(\n method: HistoryMethod,\n url: string,\n as: string,\n options: TransitionOptions = {}\n ): void {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof window.history === 'undefined') {\n console.error(`Warning: window.history is not available.`)\n return\n }\n\n if (typeof window.history[method] === 'undefined') {\n console.error(`Warning: window.history.${method} is not available`)\n return\n }\n }\n\n if (method !== 'pushState' || getURL() !== as) {\n window.history[method](\n {\n url,\n as,\n options,\n __N: true,\n } as HistoryState,\n // Most browsers currently ignores this parameter, although they may use it in the future.\n // Passing the empty string here should be safe against future changes to the method.\n // https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState\n '',\n as\n )\n }\n }\n\n async handleRouteInfoError(\n err: Error & { code: any; cancelled: boolean },\n pathname: string,\n query: ParsedUrlQuery,\n as: string,\n loadErrorFail?: boolean\n ): Promise<RouteInfo> {\n if (err.cancelled) {\n // bubble up cancellation errors\n throw err\n }\n\n if (PAGE_LOAD_ERROR in err || loadErrorFail) {\n Router.events.emit('routeChangeError', err, as)\n\n // If we can't load the page it could be one of following reasons\n // 1. Page doesn't exists\n // 2. Page does exist in a different zone\n // 3. Internal error while loading the page\n\n // So, doing a hard reload is the proper way to deal with this.\n window.location.href = as\n\n // Changing the URL doesn't block executing the current code path.\n // So let's throw a cancellation error stop the routing logic.\n throw buildCancellationError()\n }\n\n try {\n const { page: Component } = await this.fetchComponent('/_error')\n const routeInfo: RouteInfo = { Component, err, error: err }\n\n try {\n routeInfo.props = await this.getInitialProps(Component, {\n err,\n pathname,\n query,\n } as any)\n } catch (gipErr) {\n console.error('Error in error page `getInitialProps`: ', gipErr)\n routeInfo.props = {}\n }\n\n return routeInfo\n } catch (routeInfoErr) {\n return this.handleRouteInfoError(routeInfoErr, pathname, query, as, true)\n }\n }\n\n async getRouteInfo(\n route: string,\n pathname: string,\n query: any,\n as: string,\n shallow: boolean = false\n ): Promise<RouteInfo> {\n try {\n const cachedRouteInfo = this.components[route]\n\n if (shallow && cachedRouteInfo && this.route === route) {\n return cachedRouteInfo\n }\n\n const routeInfo = cachedRouteInfo\n ? cachedRouteInfo\n : await this.fetchComponent(route).then(\n (res) =>\n ({\n Component: res.page,\n __N_SSG: res.mod.__N_SSG,\n __N_SSP: res.mod.__N_SSP,\n } as RouteInfo)\n )\n\n const { Component, __N_SSG, __N_SSP } = routeInfo\n\n if (process.env.NODE_ENV !== 'production') {\n const { isValidElementType } = require('react-is')\n if (!isValidElementType(Component)) {\n throw new Error(\n `The default export is not a React Component in page: \"${pathname}\"`\n )\n }\n }\n\n let dataHref: string | undefined\n\n if (__N_SSG || __N_SSP) {\n dataHref = this.pageLoader.getDataHref(\n formatWithValidation({ pathname, query }),\n as,\n __N_SSG\n )\n }\n\n const props = await this._getData<RouteInfo>(() =>\n __N_SSG\n ? this._getStaticData(dataHref!)\n : __N_SSP\n ? this._getServerData(dataHref!)\n : this.getInitialProps(\n Component,\n // we provide AppTree later so this needs to be `any`\n {\n pathname,\n query,\n asPath: as,\n } as any\n )\n )\n routeInfo.props = props\n this.components[route] = routeInfo\n return routeInfo\n } catch (err) {\n return this.handleRouteInfoError(err, pathname, query, as)\n }\n }\n\n set(\n route: string,\n pathname: string,\n query: ParsedUrlQuery,\n as: string,\n data: RouteInfo\n ): Promise<void> {\n this.isFallback = false\n\n this.route = route\n this.pathname = pathname\n this.query = query\n this.asPath = as\n return this.notify(data)\n }\n\n /**\n * Callback to execute before replacing router state\n * @param cb callback to be executed\n */\n beforePopState(cb: BeforePopStateCallback) {\n this._bps = cb\n }\n\n onlyAHashChange(as: string): boolean {\n if (!this.asPath) return false\n const [oldUrlNoHash, oldHash] = this.asPath.split('#')\n const [newUrlNoHash, newHash] = as.split('#')\n\n // Makes sure we scroll to the provided hash if the url/hash are the same\n if (newHash && oldUrlNoHash === newUrlNoHash && oldHash === newHash) {\n return true\n }\n\n // If the urls are change, there's more than a hash change\n if (oldUrlNoHash !== newUrlNoHash) {\n return false\n }\n\n // If the hash has changed, then it's a hash only change.\n // This check is necessary to handle both the enter and\n // leave hash === '' cases. The identity case falls through\n // and is treated as a next reload.\n return oldHash !== newHash\n }\n\n scrollToHash(as: string): void {\n const [, hash] = as.split('#')\n // Scroll to top if the hash is just `#` with no value\n if (hash === '') {\n window.scrollTo(0, 0)\n return\n }\n\n // First we check if the element by id is found\n const idEl = document.getElementById(hash)\n if (idEl) {\n idEl.scrollIntoView()\n return\n }\n // If there's no element with the id, we check the `name` property\n // To mirror browsers\n const nameEl = document.getElementsByName(hash)[0]\n if (nameEl) {\n nameEl.scrollIntoView()\n }\n }\n\n urlIsNew(asPath: string): boolean {\n return this.asPath !== asPath\n }\n\n /**\n * Prefetch page code, you may wait for the data during page rendering.\n * This feature only works in production!\n * @param url the href of prefetched page\n * @param asPath the as path of the prefetched page\n */\n async prefetch(\n url: string,\n asPath: string = url,\n options: PrefetchOptions = {}\n ): Promise<void> {\n const parsed = tryParseRelativeUrl(url)\n\n if (!parsed) return\n\n const { pathname } = parsed\n\n // Prefetch is not supported in development mode because it would trigger on-demand-entries\n if (process.env.NODE_ENV !== 'production') {\n return\n }\n\n const route = removePathTrailingSlash(pathname)\n await Promise.all([\n this.pageLoader.prefetchData(url, asPath),\n this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](route),\n ])\n }\n\n async fetchComponent(route: string): Promise<ComponentRes> {\n let cancelled = false\n const cancel = (this.clc = () => {\n cancelled = true\n })\n\n const componentResult = await this.pageLoader.loadPage(route)\n\n if (cancelled) {\n const error: any = new Error(\n `Abort fetching component for route: \"${route}\"`\n )\n error.cancelled = true\n throw error\n }\n\n if (cancel === this.clc) {\n this.clc = null\n }\n\n return componentResult\n }\n\n _getData<T>(fn: () => Promise<T>): Promise<T> {\n let cancelled = false\n const cancel = () => {\n cancelled = true\n }\n this.clc = cancel\n return fn().then((data) => {\n if (cancel === this.clc) {\n this.clc = null\n }\n\n if (cancelled) {\n const err: any = new Error('Loading initial props cancelled')\n err.cancelled = true\n throw err\n }\n\n return data\n })\n }\n\n _getStaticData(dataHref: string): Promise<object> {\n const { href: cacheKey } = new URL(dataHref, window.location.href)\n if (process.env.NODE_ENV === 'production' && this.sdc[cacheKey]) {\n return Promise.resolve(this.sdc[cacheKey])\n }\n return fetchNextData(dataHref, this.isSsr).then((data) => {\n this.sdc[cacheKey] = data\n return data\n })\n }\n\n _getServerData(dataHref: string): Promise<object> {\n return fetchNextData(dataHref, this.isSsr)\n }\n\n getInitialProps(\n Component: ComponentType,\n ctx: NextPageContext\n ): Promise<any> {\n const { Component: App } = this.components['/_app']\n const AppTree = this._wrapApp(App)\n ctx.AppTree = AppTree\n return loadGetInitialProps<AppContextType<Router>>(App, {\n AppTree,\n Component,\n router: this,\n ctx,\n })\n }\n\n abortComponentLoad(as: string): void {\n if (this.clc) {\n Router.events.emit('routeChangeError', buildCancellationError(), as)\n this.clc()\n this.clc = null\n }\n }\n\n notify(data: RouteInfo): Promise<void> {\n return this.sub(data, this.components['/_app'].Component)\n }\n}\n","import { IncomingMessage, ServerResponse } from 'http'\nimport { ParsedUrlQuery } from 'querystring'\nimport { ComponentType } from 'react'\nimport { UrlObject } from 'url'\nimport { formatUrl } from './router/utils/format-url'\nimport { ManifestItem } from '../server/load-components'\nimport { NextRouter } from './router/router'\nimport { Env } from '../../lib/load-env-config'\nimport { BuildManifest } from '../server/get-page-files'\n\n/**\n * Types used by both next and next-server\n */\n\nexport type NextComponentType<\n C extends BaseContext = NextPageContext,\n IP = {},\n P = {}\n> = ComponentType<P> & {\n /**\n * Used for initial page load data population. Data returned from `getInitialProps` is serialized when server rendered.\n * Make sure to return plain `Object` without using `Date`, `Map`, `Set`.\n * @param ctx Context of `page`\n */\n getInitialProps?(context: C): IP | Promise<IP>\n}\n\nexport type DocumentType = NextComponentType<\n DocumentContext,\n DocumentInitialProps,\n DocumentProps\n> & {\n renderDocument(\n Document: DocumentType,\n props: DocumentProps\n ): React.ReactElement\n}\n\nexport type AppType = NextComponentType<\n AppContextType,\n AppInitialProps,\n AppPropsType\n>\n\nexport type AppTreeType = ComponentType<\n AppInitialProps & { [name: string]: any }\n>\n\n/**\n * Web vitals provided to _app.reportWebVitals by Core Web Vitals plugin developed by Google Chrome team.\n * https://nextjs.org/blog/next-9-4#integrated-web-vitals-reporting\n */\nexport type NextWebVitalsMetric = {\n id: string\n label: string\n name: string\n startTime: number\n value: number\n}\n\nexport type Enhancer<C> = (Component: C) => C\n\nexport type ComponentsEnhancer =\n | {\n enhanceApp?: Enhancer<AppType>\n enhanceComponent?: Enhancer<NextComponentType>\n }\n | Enhancer<NextComponentType>\n\nexport type RenderPageResult = {\n html: string\n head?: Array<JSX.Element | null>\n}\n\nexport type RenderPage = (\n options?: ComponentsEnhancer\n) => RenderPageResult | Promise<RenderPageResult>\n\nexport type BaseContext = {\n res?: ServerResponse\n [k: string]: any\n}\n\nexport type NEXT_DATA = {\n props: any\n page: string\n query: ParsedUrlQuery\n buildId: string\n assetPrefix?: string\n runtimeConfig?: { [key: string]: any }\n nextExport?: boolean\n autoExport?: boolean\n isFallback?: boolean\n dynamicIds?: string[]\n err?: Error & { statusCode?: number }\n gsp?: boolean\n gssp?: boolean\n customServer?: boolean\n gip?: boolean\n appGip?: boolean\n}\n\n/**\n * `Next` context\n */\n// tslint:disable-next-line interface-name\nexport interface NextPageContext {\n /**\n * Error object if encountered during rendering\n */\n err?: (Error & { statusCode?: number }) | null\n /**\n * `HTTP` request object.\n */\n req?: IncomingMessage\n /**\n * `HTTP` response object.\n */\n res?: ServerResponse\n /**\n * Path section of `URL`.\n */\n pathname: string\n /**\n * Query string section of `URL` parsed as an object.\n */\n query: ParsedUrlQuery\n /**\n * `String` of the actual path including query.\n */\n asPath?: string\n /**\n * `Component` the tree of the App to use if needing to render separately\n */\n AppTree: AppTreeType\n}\n\nexport type AppContextType<R extends NextRouter = NextRouter> = {\n Component: NextComponentType<NextPageContext>\n AppTree: AppTreeType\n ctx: NextPageContext\n router: R\n}\n\nexport type AppInitialProps = {\n pageProps: any\n}\n\nexport type AppPropsType<\n R extends NextRouter = NextRouter,\n P = {}\n> = AppInitialProps & {\n Component: NextComponentType<NextPageContext, any, P>\n router: R\n __N_SSG?: boolean\n __N_SSP?: boolean\n}\n\nexport type DocumentContext = NextPageContext & {\n renderPage: RenderPage\n}\n\nexport type DocumentInitialProps = RenderPageResult & {\n styles?: React.ReactElement[] | React.ReactFragment\n}\n\nexport type DocumentProps = DocumentInitialProps & {\n __NEXT_DATA__: NEXT_DATA\n dangerousAsPath: string\n buildManifest: BuildManifest\n ampPath: string\n inAmpMode: boolean\n hybridAmp: boolean\n isDevelopment: boolean\n files: string[]\n dynamicImports: ManifestItem[]\n assetPrefix?: string\n canonicalBase: string\n headTags: any[]\n unstable_runtimeJS?: false\n devOnlyCacheBusterQueryString: string\n}\n\n/**\n * Next `API` route request\n */\nexport interface NextApiRequest extends IncomingMessage {\n /**\n * Object of `query` values from url\n */\n query: {\n [key: string]: string | string[]\n }\n /**\n * Object of `cookies` from header\n */\n cookies: {\n [key: string]: string\n }\n\n body: any\n\n env: Env\n\n preview?: boolean\n /**\n * Preview data set on the request, if any\n * */\n previewData?: any\n}\n\n/**\n * Send body of response\n */\ntype Send<T> = (body: T) => void\n\n/**\n * Next `API` route response\n */\nexport type NextApiResponse<T = any> = ServerResponse & {\n /**\n * Send data `any` data in response\n */\n send: Send<T>\n /**\n * Send data `json` data in response\n */\n json: Send<T>\n status: (statusCode: number) => NextApiResponse<T>\n redirect(url: string): NextApiResponse<T>\n redirect(status: number, url: string): NextApiResponse<T>\n\n /**\n * Set preview data for Next.js' prerender mode\n */\n setPreviewData: (\n data: object | string,\n options?: {\n /**\n * Specifies the number (in seconds) for the preview session to last for.\n * The given number will be converted to an integer by rounding down.\n * By default, no maximum age is set and the preview session finishes\n * when the client shuts down (browser is closed).\n */\n maxAge?: number\n }\n ) => NextApiResponse<T>\n clearPreviewData: () => NextApiResponse<T>\n}\n\n/**\n * Next `API` route handler\n */\nexport type NextApiHandler<T = any> = (\n req: NextApiRequest,\n res: NextApiResponse<T>\n) => void | Promise<void>\n\n/**\n * Utils\n */\nexport function execOnce<T extends (...args: any[]) => ReturnType<T>>(\n fn: T\n): T {\n let used = false\n let result: ReturnType<T>\n\n return ((...args: any[]) => {\n if (!used) {\n used = true\n result = fn(...args)\n }\n return result\n }) as T\n}\n\nexport function getLocationOrigin() {\n const { protocol, hostname, port } = window.location\n return `${protocol}//${hostname}${port ? ':' + port : ''}`\n}\n\nexport function getURL() {\n const { href } = window.location\n const origin = getLocationOrigin()\n return href.substring(origin.length)\n}\n\nexport function getDisplayName<P>(Component: ComponentType<P>) {\n return typeof Component === 'string'\n ? Component\n : Component.displayName || Component.name || 'Unknown'\n}\n\nexport function isResSent(res: ServerResponse) {\n return res.finished || res.headersSent\n}\n\nexport async function loadGetInitialProps<\n C extends BaseContext,\n IP = {},\n P = {}\n>(App: NextComponentType<C, IP, P>, ctx: C): Promise<IP> {\n if (process.env.NODE_ENV !== 'production') {\n if (App.prototype?.getInitialProps) {\n const message = `\"${getDisplayName(\n App\n )}.getInitialProps()\" is defined as an instance method - visit https://err.sh/vercel/next.js/get-initial-props-as-an-instance-method for more information.`\n throw new Error(message)\n }\n }\n // when called from _app `ctx` is nested in `ctx`\n const res = ctx.res || (ctx.ctx && ctx.ctx.res)\n\n if (!App.getInitialProps) {\n if (ctx.ctx && ctx.Component) {\n // @ts-ignore pageProps default\n return {\n pageProps: await loadGetInitialProps(ctx.Component, ctx.ctx),\n }\n }\n return {} as IP\n }\n\n const props = await App.getInitialProps(ctx)\n\n if (res && isResSent(res)) {\n return props\n }\n\n if (!props) {\n const message = `\"${getDisplayName(\n App\n )}.getInitialProps()\" should resolve to an object. But found \"${props}\" instead.`\n throw new Error(message)\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (Object.keys(props).length === 0 && !ctx.ctx) {\n console.warn(\n `${getDisplayName(\n App\n )} returned an empty object from \\`getInitialProps\\`. This de-optimizes and prevents automatic static optimization. https://err.sh/vercel/next.js/empty-object-getInitialProps`\n )\n }\n }\n\n return props\n}\n\nexport const urlObjectKeys = [\n 'auth',\n 'hash',\n 'host',\n 'hostname',\n 'href',\n 'path',\n 'pathname',\n 'port',\n 'protocol',\n 'query',\n 'search',\n 'slashes',\n]\n\nexport function formatWithValidation(url: UrlObject): string {\n if (process.env.NODE_ENV === 'development') {\n if (url !== null && typeof url === 'object') {\n Object.keys(url).forEach((key) => {\n if (urlObjectKeys.indexOf(key) === -1) {\n console.warn(\n `Unknown key passed via urlObject into url.format: ${key}`\n )\n }\n })\n }\n }\n\n return formatUrl(url)\n}\n\nexport const SP = typeof performance !== 'undefined'\nexport const ST =\n SP &&\n typeof performance.mark === 'function' &&\n typeof performance.measure === 'function'\n","import { getRouteRegex } from './route-regex'\n\nexport function getRouteMatcher(routeRegex: ReturnType<typeof getRouteRegex>) {\n const { re, groups } = routeRegex\n return (pathname: string | null | undefined) => {\n const routeMatch = re.exec(pathname!)\n if (!routeMatch) {\n return false\n }\n\n const decode = (param: string) => {\n try {\n return decodeURIComponent(param)\n } catch (_) {\n const err: Error & { code?: string } = new Error(\n 'failed to decode param'\n )\n err.code = 'DECODE_FAILED'\n throw err\n }\n }\n const params: { [paramName: string]: string | string[] } = {}\n\n Object.keys(groups).forEach((slugName: string) => {\n const g = groups[slugName]\n const m = routeMatch[g.pos]\n if (m !== undefined) {\n params[slugName] = ~m.indexOf('/')\n ? m.split('/').map((entry) => decode(entry))\n : g.repeat\n ? [decode(m)]\n : decode(m)\n }\n })\n return params\n }\n}\n","import { getLocationOrigin } from '../../utils'\n\nconst DUMMY_BASE = new URL(\n typeof window === 'undefined' ? 'http://n' : getLocationOrigin()\n)\n\n/**\n * Parses path-relative urls (e.g. `/hello/world?foo=bar`). If url isn't path-relative\n * (e.g. `./hello`) then at least base must be.\n * Absolute urls are rejected with one exception, in the browser, absolute urls that are on\n * the current origin will be parsed as relative\n */\nexport function parseRelativeUrl(url: string, base?: string) {\n const resolvedBase = base ? new URL(base, DUMMY_BASE) : DUMMY_BASE\n const {\n pathname,\n searchParams,\n search,\n hash,\n href,\n origin,\n protocol,\n } = new URL(url, resolvedBase)\n if (\n origin !== DUMMY_BASE.origin ||\n (protocol !== 'http:' && protocol !== 'https:')\n ) {\n throw new Error('invariant: invalid relative URL')\n }\n return {\n pathname,\n searchParams,\n search,\n hash,\n href: href.slice(DUMMY_BASE.origin.length),\n }\n}\n","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableSpread;","function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nmodule.exports = _isNativeReflectConstruct;","/**\n * Copyright (c) 2014-present, Facebook, Inc.\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\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","import React from 'react'\n\nexport const AmpStateContext: React.Context<any> = React.createContext({})\n\nif (process.env.NODE_ENV !== 'production') {\n AmpStateContext.displayName = 'AmpStateContext'\n}\n","var arrayWithoutHoles = require(\"./arrayWithoutHoles\");\n\nvar iterableToArray = require(\"./iterableToArray\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;","function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;","/* global window */\nimport React from 'react'\nimport Router, { NextRouter } from '../next-server/lib/router/router'\nimport { RouterContext } from '../next-server/lib/router-context'\n\ntype ClassArguments<T> = T extends new (...args: infer U) => any ? U : any\n\ntype RouterArgs = ClassArguments<typeof Router>\n\ntype SingletonRouterBase = {\n router: Router | null\n readyCallbacks: Array<() => any>\n ready(cb: () => any): void\n}\n\nexport { Router, NextRouter }\n\nexport type SingletonRouter = SingletonRouterBase & NextRouter\n\nconst singletonRouter: SingletonRouterBase = {\n router: null, // holds the actual router instance\n readyCallbacks: [],\n ready(cb: () => void) {\n if (this.router) return cb()\n if (typeof window !== 'undefined') {\n this.readyCallbacks.push(cb)\n }\n },\n}\n\n// Create public properties and methods of the router in the singletonRouter\nconst urlPropertyFields = [\n 'pathname',\n 'route',\n 'query',\n 'asPath',\n 'components',\n 'isFallback',\n 'basePath',\n]\nconst routerEvents = [\n 'routeChangeStart',\n 'beforeHistoryChange',\n 'routeChangeComplete',\n 'routeChangeError',\n 'hashChangeStart',\n 'hashChangeComplete',\n]\nconst coreMethodFields = [\n 'push',\n 'replace',\n 'reload',\n 'back',\n 'prefetch',\n 'beforePopState',\n]\n\n// Events is a static property on the router, the router doesn't have to be initialized to use it\nObject.defineProperty(singletonRouter, 'events', {\n get() {\n return Router.events\n },\n})\n\nurlPropertyFields.forEach((field) => {\n // Here we need to use Object.defineProperty because, we need to return\n // the property assigned to the actual router\n // The value might get changed as we change routes and this is the\n // proper way to access it\n Object.defineProperty(singletonRouter, field, {\n get() {\n const router = getRouter() as any\n return router[field] as string\n },\n })\n})\n\ncoreMethodFields.forEach((field) => {\n // We don't really know the types here, so we add them later instead\n ;(singletonRouter as any)[field] = (...args: any[]) => {\n const router = getRouter() as any\n return router[field](...args)\n }\n})\n\nrouterEvents.forEach((event) => {\n singletonRouter.ready(() => {\n Router.events.on(event, (...args) => {\n const eventField = `on${event.charAt(0).toUpperCase()}${event.substring(\n 1\n )}`\n const _singletonRouter = singletonRouter as any\n if (_singletonRouter[eventField]) {\n try {\n _singletonRouter[eventField](...args)\n } catch (err) {\n // tslint:disable-next-line:no-console\n console.error(`Error when running the Router event: ${eventField}`)\n // tslint:disable-next-line:no-console\n console.error(`${err.message}\\n${err.stack}`)\n }\n }\n })\n })\n})\n\nfunction getRouter(): Router {\n if (!singletonRouter.router) {\n const message =\n 'No router instance found.\\n' +\n 'You should only use \"next/router\" inside the client side of your app.\\n'\n throw new Error(message)\n }\n return singletonRouter.router\n}\n\n// Export the singletonRouter and this is the public API.\nexport default singletonRouter as SingletonRouter\n\n// Reexport the withRoute HOC\nexport { default as withRouter } from './with-router'\n\nexport function useRouter(): NextRouter {\n return React.useContext(RouterContext)\n}\n\n// INTERNAL APIS\n// -------------\n// (do not use following exports inside the app)\n\n// Create a router and assign it as the singleton instance.\n// This is used in client side when we are initilizing the app.\n// This should **not** use inside the server.\nexport const createRouter = (...args: RouterArgs): Router => {\n singletonRouter.router = new Router(...args)\n singletonRouter.readyCallbacks.forEach((cb) => cb())\n singletonRouter.readyCallbacks = []\n\n return singletonRouter.router\n}\n\n// This function is used to create the `withRouter` router instance\nexport function makePublicRouterInstance(router: Router): NextRouter {\n const _router = router as any\n const instance = {} as any\n\n for (const property of urlPropertyFields) {\n if (typeof _router[property] === 'object') {\n instance[property] = Object.assign({}, _router[property]) // makes sure query is not stateful\n continue\n }\n\n instance[property] = _router[property]\n }\n\n // Events is a static property on the router, the router doesn't have to be initialized to use it\n instance.events = Router.events\n\n coreMethodFields.forEach((field) => {\n instance[field] = (...args: any[]) => {\n return _router[field](...args)\n }\n })\n\n return instance\n}\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableRest;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nvar isNativeReflectConstruct = require(\"./isNativeReflectConstruct\");\n\nfunction _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n module.exports = _construct = Reflect.construct;\n } else {\n module.exports = _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}\n\nmodule.exports = _construct;","import React from 'react'\nimport { NextRouter } from './router/router'\n\nexport const RouterContext = React.createContext<NextRouter>(null as any)\n\nif (process.env.NODE_ENV !== 'production') {\n RouterContext.displayName = 'RouterContext'\n}\n","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator;","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","module.exports = require(\"regenerator-runtime\");\n","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;"],"sourceRoot":""}