tag and doesn't have a href attribute, or if the 'passHref' property is
- // defined, we specify the current 'href', so that repetition is not needed by the user
-
-
- if (props.passHref || child.type === 'a' && !('href' in child.props)) {
- var curLocale = typeof locale !== 'undefined' ? locale : router && router.locale; // we only render domain locales if we are currently on a domain locale
- // so that locale links are still visitable in development/preview envs
-
- var localeDomain = router && router.isLocaleDomain && (0, _router.getDomainLocale)(as, curLocale, router && router.locales, router && router.domainLocales);
- childProps.href = localeDomain || (0, _router.addBasePath)((0, _router.addLocale)(as, curLocale, router && router.defaultLocale));
- }
-
- return /*#__PURE__*/_react["default"].cloneElement(child, childProps);
-}
-
-_s(Link, "7cX92ILFgstKFyzTMH+g73G4t5k=");
-
-_c = Link;
-var _default = Link;
-exports.default = _default;
-
-var _c;
-
-$RefreshReg$(_c, "Link");
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/client/normalize-trailing-slash.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/next/dist/client/normalize-trailing-slash.js ***!
- \*******************************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-exports.__esModule = true;
-exports.removePathTrailingSlash = removePathTrailingSlash;
-exports.normalizePathTrailingSlash = void 0;
-/**
-* Removes the trailing slash of a path if there is one. Preserves the root path `/`.
-*/
-
-function removePathTrailingSlash(path) {
- return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;
-}
-/**
-* Normalizes the trailing slash of a path according to the `trailingSlash` option
-* in `next.config.js`.
-*/
-
-
-var normalizePathTrailingSlash = true ? function (path) {
- if (/\.[^/]+\/?$/.test(path)) {
- return removePathTrailingSlash(path);
- } else if (path.endsWith('/')) {
- return path;
- } else {
- return path + '/';
- }
-} : 0;
-exports.normalizePathTrailingSlash = normalizePathTrailingSlash;
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/client/request-idle-callback.js":
-/*!****************************************************************!*\
- !*** ./node_modules/next/dist/client/request-idle-callback.js ***!
- \****************************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-exports.__esModule = true;
-exports.cancelIdleCallback = exports.requestIdleCallback = void 0;
-
-var requestIdleCallback = typeof self !== 'undefined' && self.requestIdleCallback || function (cb) {
- var start = Date.now();
- return setTimeout(function () {
- cb({
- didTimeout: false,
- timeRemaining: function timeRemaining() {
- return Math.max(0, 50 - (Date.now() - start));
- }
- });
- }, 1);
-};
-
-exports.requestIdleCallback = requestIdleCallback;
-
-var cancelIdleCallback = typeof self !== 'undefined' && self.cancelIdleCallback || function (id) {
- return clearTimeout(id);
-};
-
-exports.cancelIdleCallback = cancelIdleCallback;
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/client/route-loader.js":
-/*!*******************************************************!*\
- !*** ./node_modules/next/dist/client/route-loader.js ***!
- \*******************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/next/node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
-exports.__esModule = true;
-exports.markAssetError = markAssetError;
-exports.isAssetError = isAssetError;
-exports.getClientBuildManifest = getClientBuildManifest;
-exports.default = void 0;
-
-var _getAssetPathFromRoute = _interopRequireDefault(__webpack_require__(/*! ../next-server/lib/router/utils/get-asset-path-from-route */ "./node_modules/next/dist/next-server/lib/router/utils/get-asset-path-from-route.js"));
-
-var _requestIdleCallback = __webpack_require__(/*! ./request-idle-callback */ "./node_modules/next/dist/client/request-idle-callback.js"); // 3.8s was arbitrarily chosen as it's what https://web.dev/interactive
-// considers as "Good" time-to-interactive. We must assume something went
-// wrong beyond this point, and then fall-back to a full page transition to
-// show the user something of value.
-
-
-var MS_MAX_IDLE_DELAY = 3800;
-
-function withFuture(key, map, generator) {
- var entry = map.get(key);
-
- if (entry) {
- if ('future' in entry) {
- return entry.future;
- }
-
- return Promise.resolve(entry);
- }
-
- var resolver;
- var prom = new Promise(function (resolve) {
- resolver = resolve;
- });
- map.set(key, entry = {
- resolve: resolver,
- future: prom
- });
- return generator ? // eslint-disable-next-line no-sequences
- generator().then(function (value) {
- return resolver(value), value;
- }) : prom;
-}
-
-function hasPrefetch(link) {
- try {
- link = document.createElement('link');
- return (// detect IE11 since it supports prefetch but isn't detected
- // with relList.support
- !!window.MSInputMethodContext && !!document.documentMode || link.relList.supports('prefetch')
- );
- } catch (_unused) {
- return false;
- }
-}
-
-var canPrefetch = hasPrefetch();
-
-function prefetchViaDom(href, as, link) {
- return new Promise(function (res, rej) {
- if (document.querySelector("link[rel=\"prefetch\"][href^=\"".concat(href, "\"]"))) {
- return res();
- }
-
- link = document.createElement('link'); // The order of property assignment here is intentional:
-
- if (as) link.as = as;
- link.rel = "prefetch";
- link.crossOrigin = undefined;
- link.onload = res;
- link.onerror = rej; // `href` should always be last:
-
- link.href = href;
- document.head.appendChild(link);
- });
-}
-
-var ASSET_LOAD_ERROR = Symbol('ASSET_LOAD_ERROR'); // TODO: unexport
-
-function markAssetError(err) {
- return Object.defineProperty(err, ASSET_LOAD_ERROR, {});
-}
-
-function isAssetError(err) {
- return err && ASSET_LOAD_ERROR in err;
-}
-
-function appendScript(src, script) {
- return new Promise(function (resolve, reject) {
- script = document.createElement('script'); // The order of property assignment here is intentional.
- // 1. Setup success/failure hooks in case the browser synchronously
- // executes when `src` is set.
-
- script.onload = resolve;
-
- script.onerror = function () {
- return reject(markAssetError(new Error("Failed to load script: ".concat(src))));
- }; // 2. Configure the cross-origin attribute before setting `src` in case the
- // browser begins to fetch.
-
-
- script.crossOrigin = undefined; // 3. Finally, set the source and inject into the DOM in case the child
- // must be appended for fetching to start.
-
- script.src = src;
- document.body.appendChild(script);
- });
-} // Resolve a promise that times out after given amount of milliseconds.
-
-
-function resolvePromiseWithTimeout(p, ms, err) {
- return new Promise(function (resolve, reject) {
- var cancelled = false;
- p.then(function (r) {
- // Resolved, cancel the timeout
- cancelled = true;
- resolve(r);
- })["catch"](reject);
- (0, _requestIdleCallback.requestIdleCallback)(function () {
- return setTimeout(function () {
- if (!cancelled) {
- reject(err);
- }
- }, ms);
- });
- });
-} // TODO: stop exporting or cache the failure
-// It'd be best to stop exporting this. It's an implementation detail. We're
-// only exporting it for backwards compatibilty with the `page-loader`.
-// Only cache this response as a last resort if we cannot eliminate all other
-// code branches that use the Build Manifest Callback and push them through
-// the Route Loader interface.
-
-
-function getClientBuildManifest() {
- if (self.__BUILD_MANIFEST) {
- return Promise.resolve(self.__BUILD_MANIFEST);
- }
-
- var onBuildManifest = new Promise(function (resolve) {
- // Mandatory because this is not concurrent safe:
- var cb = self.__BUILD_MANIFEST_CB;
-
- self.__BUILD_MANIFEST_CB = function () {
- resolve(self.__BUILD_MANIFEST);
- cb && cb();
- };
- });
- return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));
-}
-
-function getFilesForRoute(assetPrefix, route) {
- if (true) {
- return Promise.resolve({
- scripts: [assetPrefix + '/_next/static/chunks/pages' + encodeURI((0, _getAssetPathFromRoute["default"])(route, '.js'))],
- // Styles are handled by `style-loader` in development:
- css: []
- });
- }
-
- return getClientBuildManifest().then(function (manifest) {
- if (!(route in manifest)) {
- throw markAssetError(new Error("Failed to lookup route: ".concat(route)));
- }
-
- var allFiles = manifest[route].map(function (entry) {
- return assetPrefix + '/_next/' + encodeURI(entry);
- });
- return {
- scripts: allFiles.filter(function (v) {
- return v.endsWith('.js');
- }),
- css: allFiles.filter(function (v) {
- return v.endsWith('.css');
- })
- };
- });
-}
-
-function createRouteLoader(assetPrefix) {
- var entrypoints = new Map();
- var loadedScripts = new Map();
- var styleSheets = new Map();
- var routes = new Map();
-
- function maybeExecuteScript(src) {
- var prom = loadedScripts.get(src);
-
- if (prom) {
- return prom;
- } // Skip executing script if it's already in the DOM:
-
-
- if (document.querySelector("script[src^=\"".concat(src, "\"]"))) {
- return Promise.resolve();
- }
-
- loadedScripts.set(src, prom = appendScript(src));
- return prom;
- }
-
- function fetchStyleSheet(href) {
- var prom = styleSheets.get(href);
-
- if (prom) {
- return prom;
- }
-
- styleSheets.set(href, prom = fetch(href).then(function (res) {
- if (!res.ok) {
- throw new Error("Failed to load stylesheet: ".concat(href));
- }
-
- return res.text().then(function (text) {
- return {
- href: href,
- content: text
- };
- });
- })["catch"](function (err) {
- throw markAssetError(err);
- }));
- return prom;
- }
-
- return {
- whenEntrypoint: function whenEntrypoint(route) {
- return withFuture(route, entrypoints);
- },
- onEntrypoint: function onEntrypoint(route, execute) {
- Promise.resolve(execute).then(function (fn) {
- return fn();
- }).then(function (exports) {
- return {
- component: exports && exports["default"] || exports,
- exports: exports
- };
- }, function (err) {
- return {
- error: err
- };
- }).then(function (input) {
- var old = entrypoints.get(route);
- entrypoints.set(route, input);
- if (old && 'resolve' in old) old.resolve(input);
- });
- },
- loadRoute: function loadRoute(route, prefetch) {
- var _this = this;
-
- return withFuture(route, routes, function () {
- return resolvePromiseWithTimeout(getFilesForRoute(assetPrefix, route).then(function (_ref) {
- var scripts = _ref.scripts,
- css = _ref.css;
- return Promise.all([entrypoints.has(route) ? [] : Promise.all(scripts.map(maybeExecuteScript)), Promise.all(css.map(fetchStyleSheet))]);
- }).then(function (res) {
- return _this.whenEntrypoint(route).then(function (entrypoint) {
- return {
- entrypoint: entrypoint,
- styles: res[1]
- };
- });
- }), MS_MAX_IDLE_DELAY, markAssetError(new Error("Route did not complete loading: ".concat(route)))).then(function (_ref2) {
- var entrypoint = _ref2.entrypoint,
- styles = _ref2.styles;
- var res = Object.assign({
- styles: styles
- }, entrypoint);
- return 'error' in entrypoint ? entrypoint : res;
- })["catch"](function (err) {
- if (prefetch) {
- // we don't want to cache errors during prefetch
- throw err;
- }
-
- return {
- error: err
- };
- });
- });
- },
- prefetch: function prefetch(route) {
- var _this2 = this;
-
- // https://github.com/GoogleChromeLabs/quicklink/blob/453a661fa1fa940e2d2e044452398e38c67a98fb/src/index.mjs#L115-L118
- // License: Apache 2.0
- var cn;
-
- if (cn = navigator.connection) {
- // Don't prefetch if using 2G or if Save-Data is enabled.
- if (cn.saveData || /2g/.test(cn.effectiveType)) return Promise.resolve();
- }
-
- return getFilesForRoute(assetPrefix, route).then(function (output) {
- return Promise.all(canPrefetch ? output.scripts.map(function (script) {
- return prefetchViaDom(script, 'script');
- }) : []);
- }).then(function () {
- (0, _requestIdleCallback.requestIdleCallback)(function () {
- return _this2.loadRoute(route, true)["catch"](function () {});
- });
- })["catch"]( // swallow prefetch errors
- function () {});
- }
- };
-}
-
-var _default = createRouteLoader;
-exports.default = _default;
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/client/router.js":
-/*!*************************************************!*\
- !*** ./node_modules/next/dist/client/router.js ***!
- \*************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-var _construct = __webpack_require__(/*! ./node_modules/next/node_modules/@babel/runtime/helpers/construct */ "./node_modules/next/node_modules/@babel/runtime/helpers/construct.js");
-
-var _s = $RefreshSig$();
-
-function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
-
-function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-
-function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
-
-var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/next/node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
-
-var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/next/node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
-exports.__esModule = true;
-exports.useRouter = useRouter;
-exports.makePublicRouterInstance = makePublicRouterInstance;
-exports.createRouter = exports.withRouter = exports.default = void 0;
-
-var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
-
-var _router2 = _interopRequireWildcard(__webpack_require__(/*! ../next-server/lib/router/router */ "./node_modules/next/dist/next-server/lib/router/router.js"));
-
-exports.Router = _router2["default"];
-exports.NextRouter = _router2.NextRouter;
-
-var _routerContext = __webpack_require__(/*! ../next-server/lib/router-context */ "./node_modules/next/dist/next-server/lib/router-context.js");
-
-var _withRouter = _interopRequireDefault(__webpack_require__(/*! ./with-router */ "./node_modules/next/dist/client/with-router.js"));
-
-exports.withRouter = _withRouter["default"];
-/* global window */
-
-var singletonRouter = {
- router: null,
- // holds the actual router instance
- readyCallbacks: [],
- ready: function ready(cb) {
- if (this.router) return cb();
-
- if (true) {
- this.readyCallbacks.push(cb);
- }
- }
-}; // Create public properties and methods of the router in the singletonRouter
-
-var urlPropertyFields = ['pathname', 'route', 'query', 'asPath', 'components', 'isFallback', 'basePath', 'locale', 'locales', 'defaultLocale', 'isReady', 'isPreview', 'isLocaleDomain'];
-var routerEvents = ['routeChangeStart', 'beforeHistoryChange', 'routeChangeComplete', 'routeChangeError', 'hashChangeStart', 'hashChangeComplete'];
-var coreMethodFields = ['push', 'replace', 'reload', 'back', 'prefetch', 'beforePopState']; // Events is a static property on the router, the router doesn't have to be initialized to use it
-
-Object.defineProperty(singletonRouter, 'events', {
- get: function get() {
- return _router2["default"].events;
- }
-});
-urlPropertyFields.forEach(function (field) {
- // Here we need to use Object.defineProperty because, we need to return
- // the property assigned to the actual router
- // The value might get changed as we change routes and this is the
- // proper way to access it
- Object.defineProperty(singletonRouter, field, {
- get: function get() {
- var router = getRouter();
- return router[field];
- }
- });
-});
-coreMethodFields.forEach(function (field) {
- // We don't really know the types here, so we add them later instead
- ;
-
- singletonRouter[field] = function () {
- var router = getRouter();
- return router[field].apply(router, arguments);
- };
-});
-routerEvents.forEach(function (event) {
- singletonRouter.ready(function () {
- _router2["default"].events.on(event, function () {
- var eventField = "on".concat(event.charAt(0).toUpperCase()).concat(event.substring(1));
- var _singletonRouter = singletonRouter;
-
- if (_singletonRouter[eventField]) {
- try {
- _singletonRouter[eventField].apply(_singletonRouter, arguments);
- } catch (err) {
- console.error("Error when running the Router event: ".concat(eventField));
- console.error("".concat(err.message, "\n").concat(err.stack));
- }
- }
- });
- });
-});
-
-function getRouter() {
- if (!singletonRouter.router) {
- var message = 'No router instance found.\n' + 'You should only use "next/router" inside the client side of your app.\n';
- throw new Error(message);
- }
-
- return singletonRouter.router;
-} // Export the singletonRouter and this is the public API.
-
-
-var _default = singletonRouter; // Reexport the withRoute HOC
-
-exports.default = _default;
-
-function useRouter() {
- _s();
-
- return _react["default"].useContext(_routerContext.RouterContext);
-} // INTERNAL APIS
-// -------------
-// (do not use following exports inside the app)
-// Create a router and assign it as the singleton instance.
-// This is used in client side when we are initilizing the app.
-// This should **not** use inside the server.
-
-
-_s(useRouter, "gDsCjeeItUuvgOWf1v4qoK9RF6k=");
-
-var createRouter = function createRouter() {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- singletonRouter.router = _construct(_router2["default"], args);
- singletonRouter.readyCallbacks.forEach(function (cb) {
- return cb();
- });
- singletonRouter.readyCallbacks = [];
- return singletonRouter.router;
-}; // This function is used to create the `withRouter` router instance
-
-
-exports.createRouter = createRouter;
-
-function makePublicRouterInstance(router) {
- var _router = router;
- var instance = {};
-
- var _iterator = _createForOfIteratorHelper(urlPropertyFields),
- _step;
-
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var property = _step.value;
-
- if (typeof _router[property] === 'object') {
- instance[property] = Object.assign(Array.isArray(_router[property]) ? [] : {}, _router[property]); // makes sure query is not stateful
-
- continue;
- }
-
- instance[property] = _router[property];
- } // Events is a static property on the router, the router doesn't have to be initialized to use it
-
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
-
- instance.events = _router2["default"].events;
- coreMethodFields.forEach(function (field) {
- instance[field] = function () {
- return _router[field].apply(_router, arguments);
- };
- });
- return instance;
-}
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/client/use-intersection.js":
-/*!***********************************************************!*\
- !*** ./node_modules/next/dist/client/use-intersection.js ***!
- \***********************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-var _slicedToArray = __webpack_require__(/*! ./node_modules/next/node_modules/@babel/runtime/helpers/slicedToArray */ "./node_modules/next/node_modules/@babel/runtime/helpers/slicedToArray.js");
-
-exports.__esModule = true;
-exports.useIntersection = useIntersection;
-
-var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js");
-
-var _requestIdleCallback = __webpack_require__(/*! ./request-idle-callback */ "./node_modules/next/dist/client/request-idle-callback.js");
-
-var hasIntersectionObserver = typeof IntersectionObserver !== 'undefined';
-
-function useIntersection(_ref) {
- var rootMargin = _ref.rootMargin,
- disabled = _ref.disabled;
- var isDisabled = disabled || !hasIntersectionObserver;
- var unobserve = (0, _react.useRef)();
-
- var _ref2 = (0, _react.useState)(false),
- _ref3 = _slicedToArray(_ref2, 2),
- visible = _ref3[0],
- setVisible = _ref3[1];
-
- var setRef = (0, _react.useCallback)(function (el) {
- if (unobserve.current) {
- unobserve.current();
- unobserve.current = undefined;
- }
-
- if (isDisabled || visible) return;
-
- if (el && el.tagName) {
- unobserve.current = observe(el, function (isVisible) {
- return isVisible && setVisible(isVisible);
- }, {
- rootMargin: rootMargin
- });
- }
- }, [isDisabled, rootMargin, visible]);
- (0, _react.useEffect)(function () {
- if (!hasIntersectionObserver) {
- if (!visible) {
- var idleCallback = (0, _requestIdleCallback.requestIdleCallback)(function () {
- return setVisible(true);
- });
- return function () {
- return (0, _requestIdleCallback.cancelIdleCallback)(idleCallback);
- };
- }
- }
- }, [visible]);
- return [setRef, visible];
-}
-
-function observe(element, callback, options) {
- var _createObserver = createObserver(options),
- id = _createObserver.id,
- observer = _createObserver.observer,
- elements = _createObserver.elements;
-
- elements.set(element, callback);
- observer.observe(element);
- return function unobserve() {
- elements["delete"](element);
- observer.unobserve(element); // Destroy observer when there's nothing left to watch:
-
- if (elements.size === 0) {
- observer.disconnect();
- observers["delete"](id);
- }
- };
-}
-
-var observers = new Map();
-
-function createObserver(options) {
- var id = options.rootMargin || '';
- var instance = observers.get(id);
-
- if (instance) {
- return instance;
- }
-
- var elements = new Map();
- var observer = new IntersectionObserver(function (entries) {
- entries.forEach(function (entry) {
- var callback = elements.get(entry.target);
- var isVisible = entry.isIntersecting || entry.intersectionRatio > 0;
-
- if (callback && isVisible) {
- callback(isVisible);
- }
- });
- }, options);
- observers.set(id, instance = {
- id: id,
- observer: observer,
- elements: elements
- });
- return instance;
-}
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/client/with-router.js":
-/*!******************************************************!*\
- !*** ./node_modules/next/dist/client/with-router.js ***!
- \******************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/next/node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
-exports.__esModule = true;
-exports.default = withRouter;
-
-var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
-
-var _router = __webpack_require__(/*! ./router */ "./node_modules/next/dist/client/router.js");
-
-function withRouter(ComposedComponent) {
- function WithRouterWrapper(props) {
- return /*#__PURE__*/_react["default"].createElement(ComposedComponent, Object.assign({
- router: (0, _router.useRouter)()
- }, props));
- }
-
- WithRouterWrapper.getInitialProps = ComposedComponent.getInitialProps // This is needed to allow checking for custom getInitialProps in _app
- ;
- WithRouterWrapper.origGetInitialProps = ComposedComponent.origGetInitialProps;
-
- if (true) {
- var name = ComposedComponent.displayName || ComposedComponent.name || 'Unknown';
- WithRouterWrapper.displayName = "withRouter(".concat(name, ")");
- }
-
- return WithRouterWrapper;
-}
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/next-server/lib/dynamic.js":
-/*!***********************************************************!*\
- !*** ./node_modules/next/dist/next-server/lib/dynamic.js ***!
- \***********************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-var _defineProperty = __webpack_require__(/*! ./node_modules/next/node_modules/@babel/runtime/helpers/defineProperty */ "./node_modules/next/node_modules/@babel/runtime/helpers/defineProperty.js");
-
-function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
-
-function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
-
-exports.__esModule = true;
-exports.noSSR = noSSR;
-exports.default = dynamic;
-
-var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
-
-var _loadable = _interopRequireDefault(__webpack_require__(/*! ./loadable */ "./node_modules/next/dist/next-server/lib/loadable.js"));
-
-function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- };
-}
-
-var isServerSide = false;
-
-function noSSR(LoadableInitializer, loadableOptions) {
- // Removing webpack and modules means react-loadable won't try preloading
- delete loadableOptions.webpack;
- delete loadableOptions.modules; // This check is necessary to prevent react-loadable from initializing on the server
-
- if (!isServerSide) {
- return LoadableInitializer(loadableOptions);
- }
-
- var Loading = loadableOptions.loading; // This will only be rendered on the server side
-
- return function () {
- return /*#__PURE__*/_react["default"].createElement(Loading, {
- error: null,
- isLoading: true,
- pastDelay: false,
- timedOut: false
- });
- };
-} // function dynamic(options: O):
-
-
-function dynamic(dynamicOptions, options) {
- var loadableFn = _loadable["default"];
- var loadableOptions = {
- // A loading component is not required, so we default it
- loading: function loading(_ref) {
- var error = _ref.error,
- isLoading = _ref.isLoading,
- pastDelay = _ref.pastDelay;
- if (!pastDelay) return null;
-
- if (true) {
- if (isLoading) {
- return null;
- }
-
- if (error) {
- return /*#__PURE__*/_react["default"].createElement("p", null, error.message, /*#__PURE__*/_react["default"].createElement("br", null), error.stack);
- }
- }
-
- return null;
- }
- }; // Support for direct import(), eg: dynamic(import('../hello-world'))
- // Note that this is only kept for the edge case where someone is passing in a promise as first argument
- // The react-loadable babel plugin will turn dynamic(import('../hello-world')) into dynamic(() => import('../hello-world'))
- // To make sure we don't execute the import without rendering first
-
- if (dynamicOptions instanceof Promise) {
- loadableOptions.loader = function () {
- return dynamicOptions;
- }; // Support for having import as a function, eg: dynamic(() => import('../hello-world'))
-
- } else if (typeof dynamicOptions === 'function') {
- loadableOptions.loader = dynamicOptions; // Support for having first argument being options, eg: dynamic({loader: import('../hello-world')})
- } else if (typeof dynamicOptions === 'object') {
- loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), dynamicOptions);
- } // Support for passing options, eg: dynamic(import('../hello-world'), {loading: () =>
Loading something
})
-
-
- loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), options);
-
- if (typeof dynamicOptions === 'object' && !(dynamicOptions instanceof Promise)) {
- // show deprecation warning for `modules` key in development
- if (true) {
- if (dynamicOptions.modules) {
- console.warn('The modules option for next/dynamic has been deprecated. See here for more info https://nextjs.org/docs/messages/next-dynamic-modules');
- }
- } // Support for `render` when using a mapping, eg: `dynamic({ modules: () => {return {HelloWorld: import('../hello-world')}, render(props, loaded) {} } })
-
-
- if (dynamicOptions.render) {
- loadableOptions.render = function (loaded, props) {
- return dynamicOptions.render(props, loaded);
- };
- } // Support for `modules` when using a mapping, eg: `dynamic({ modules: () => {return {HelloWorld: import('../hello-world')}, render(props, loaded) {} } })
-
-
- if (dynamicOptions.modules) {
- loadableFn = _loadable["default"].Map;
- var loadModules = {};
- var modules = dynamicOptions.modules();
- Object.keys(modules).forEach(function (key) {
- var value = modules[key];
-
- if (typeof value.then === 'function') {
- loadModules[key] = function () {
- return value.then(function (mod) {
- return mod["default"] || mod;
- });
- };
-
- return;
- }
-
- loadModules[key] = value;
- });
- loadableOptions.loader = loadModules;
- }
- } // coming from build/babel/plugins/react-loadable-plugin.js
-
-
- if (loadableOptions.loadableGenerated) {
- loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), loadableOptions.loadableGenerated);
- delete loadableOptions.loadableGenerated;
- } // support for disabling server side rendering, eg: dynamic(import('../hello-world'), {ssr: false})
-
-
- if (typeof loadableOptions.ssr === 'boolean') {
- if (!loadableOptions.ssr) {
- delete loadableOptions.ssr;
- return noSSR(loadableFn, loadableOptions);
- }
-
- delete loadableOptions.ssr;
- }
-
- return loadableFn(loadableOptions);
-}
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/next-server/lib/i18n/detect-domain-locale.js":
-/*!*****************************************************************************!*\
- !*** ./node_modules/next/dist/next-server/lib/i18n/detect-domain-locale.js ***!
- \*****************************************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
-
-function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-
-function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
-
-exports.__esModule = true;
-exports.detectDomainLocale = detectDomainLocale;
-
-function detectDomainLocale(domainItems, hostname, detectedLocale) {
- var domainItem;
-
- if (domainItems) {
- if (detectedLocale) {
- detectedLocale = detectedLocale.toLowerCase();
- }
-
- var _iterator = _createForOfIteratorHelper(domainItems),
- _step;
-
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var item = _step.value;
-
- var _item$domain, _item$locales; // remove port if present
-
-
- var domainHostname = (_item$domain = item.domain) == null ? void 0 : _item$domain.split(':')[0].toLowerCase();
-
- if (hostname === domainHostname || detectedLocale === item.defaultLocale.toLowerCase() || (_item$locales = item.locales) != null && _item$locales.some(function (locale) {
- return locale.toLowerCase() === detectedLocale;
- })) {
- domainItem = item;
- break;
- }
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- }
-
- return domainItem;
-}
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/next-server/lib/i18n/normalize-locale-path.js":
-/*!******************************************************************************!*\
- !*** ./node_modules/next/dist/next-server/lib/i18n/normalize-locale-path.js ***!
- \******************************************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-exports.__esModule = true;
-exports.normalizeLocalePath = normalizeLocalePath;
-
-function normalizeLocalePath(pathname, locales) {
- var detectedLocale; // first item will be empty string from splitting at first char
-
- var pathnameParts = pathname.split('/');
- (locales || []).some(function (locale) {
- if (pathnameParts[1].toLowerCase() === locale.toLowerCase()) {
- detectedLocale = locale;
- pathnameParts.splice(1, 1);
- pathname = pathnameParts.join('/') || '/';
- return true;
- }
-
- return false;
- });
- return {
- pathname: pathname,
- detectedLocale: detectedLocale
- };
-}
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/next-server/lib/loadable-context.js":
-/*!********************************************************************!*\
- !*** ./node_modules/next/dist/next-server/lib/loadable-context.js ***!
- \********************************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-exports.__esModule = true;
-exports.LoadableContext = void 0;
-
-var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
-
-function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- };
-}
-
-var LoadableContext = /*#__PURE__*/_react["default"].createContext(null);
-
-exports.LoadableContext = LoadableContext;
-
-if (true) {
- LoadableContext.displayName = 'LoadableContext';
-}
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/next-server/lib/loadable.js":
-/*!************************************************************!*\
- !*** ./node_modules/next/dist/next-server/lib/loadable.js ***!
- \************************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-var _defineProperty = __webpack_require__(/*! ./node_modules/next/node_modules/@babel/runtime/helpers/defineProperty */ "./node_modules/next/node_modules/@babel/runtime/helpers/defineProperty.js");
-
-var _classCallCheck = __webpack_require__(/*! ./node_modules/next/node_modules/@babel/runtime/helpers/classCallCheck */ "./node_modules/next/node_modules/@babel/runtime/helpers/classCallCheck.js");
-
-var _createClass = __webpack_require__(/*! ./node_modules/next/node_modules/@babel/runtime/helpers/createClass */ "./node_modules/next/node_modules/@babel/runtime/helpers/createClass.js");
-
-function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
-
-function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
-
-function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
-
-function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-
-function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
-
-exports.__esModule = true;
-exports.default = void 0;
-
-var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
-
-var _useSubscription = __webpack_require__(/*! use-subscription */ "./node_modules/use-subscription/index.js");
-
-var _loadableContext = __webpack_require__(/*! ./loadable-context */ "./node_modules/next/dist/next-server/lib/loadable-context.js");
-
-function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- };
-}
-/**
-@copyright (c) 2017-present James Kyle
-MIT License
-Permission 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:
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-THE 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
-*/
-// https://github.com/jamiebuilds/react-loadable/blob/v5.5.0/src/index.js
-// Modified to be compatible with webpack 4 / Next.js
-
-
-var ALL_INITIALIZERS = [];
-var READY_INITIALIZERS = [];
-var initialized = false;
-
-function load(loader) {
- var promise = loader();
- var state = {
- loading: true,
- loaded: null,
- error: null
- };
- state.promise = promise.then(function (loaded) {
- state.loading = false;
- state.loaded = loaded;
- return loaded;
- })["catch"](function (err) {
- state.loading = false;
- state.error = err;
- throw err;
- });
- return state;
-}
-
-function loadMap(obj) {
- var state = {
- loading: false,
- loaded: {},
- error: null
- };
- var promises = [];
-
- try {
- Object.keys(obj).forEach(function (key) {
- var result = load(obj[key]);
-
- if (!result.loading) {
- state.loaded[key] = result.loaded;
- state.error = result.error;
- } else {
- state.loading = true;
- }
-
- promises.push(result.promise);
- result.promise.then(function (res) {
- state.loaded[key] = res;
- })["catch"](function (err) {
- state.error = err;
- });
- });
- } catch (err) {
- state.error = err;
- }
-
- state.promise = Promise.all(promises).then(function (res) {
- state.loading = false;
- return res;
- })["catch"](function (err) {
- state.loading = false;
- throw err;
- });
- return state;
-}
-
-function resolve(obj) {
- return obj && obj.__esModule ? obj["default"] : obj;
-}
-
-function render(loaded, props) {
- return /*#__PURE__*/_react["default"].createElement(resolve(loaded), props);
-}
-
-function createLoadableComponent(loadFn, options) {
- var _s = $RefreshSig$();
-
- var opts = Object.assign({
- loader: null,
- loading: null,
- delay: 200,
- timeout: null,
- render: render,
- webpack: null,
- modules: null
- }, options);
- var subscription = null;
-
- function init() {
- if (!subscription) {
- var sub = new LoadableSubscription(loadFn, opts);
- subscription = {
- getCurrentValue: sub.getCurrentValue.bind(sub),
- subscribe: sub.subscribe.bind(sub),
- retry: sub.retry.bind(sub),
- promise: sub.promise.bind(sub)
- };
- }
-
- return subscription.promise();
- } // Server only
-
-
- if (false) {} // Client only
-
-
- if (!initialized && true && typeof opts.webpack === 'function') {
- var moduleIds = opts.webpack();
- READY_INITIALIZERS.push(function (ids) {
- var _iterator = _createForOfIteratorHelper(moduleIds),
- _step;
-
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var moduleId = _step.value;
-
- if (ids.indexOf(moduleId) !== -1) {
- return init();
- }
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- });
- }
-
- var LoadableComponent = function LoadableComponent(props, ref) {
- _s();
-
- init();
-
- var context = _react["default"].useContext(_loadableContext.LoadableContext);
-
- var state = (0, _useSubscription.useSubscription)(subscription);
-
- _react["default"].useImperativeHandle(ref, function () {
- return {
- retry: subscription.retry
- };
- }, []);
-
- if (context && Array.isArray(opts.modules)) {
- opts.modules.forEach(function (moduleName) {
- context(moduleName);
- });
- }
-
- return _react["default"].useMemo(function () {
- if (state.loading || state.error) {
- return /*#__PURE__*/_react["default"].createElement(opts.loading, {
- isLoading: state.loading,
- pastDelay: state.pastDelay,
- timedOut: state.timedOut,
- error: state.error,
- retry: subscription.retry
- });
- } else if (state.loaded) {
- return opts.render(state.loaded, props);
- } else {
- return null;
- }
- }, [props, state]);
- };
-
- _s(LoadableComponent, "Bp87+qHhaUk8bOFGKxqLWPW1xR0=", true);
-
- LoadableComponent.preload = function () {
- return init();
- };
-
- LoadableComponent.displayName = 'LoadableComponent';
- return /*#__PURE__*/_react["default"].forwardRef(LoadableComponent);
-}
-
-var LoadableSubscription = /*#__PURE__*/function () {
- function LoadableSubscription(loadFn, opts) {
- _classCallCheck(this, LoadableSubscription);
-
- this._loadFn = loadFn;
- this._opts = opts;
- this._callbacks = new Set();
- this._delay = null;
- this._timeout = null;
- this.retry();
- }
-
- _createClass(LoadableSubscription, [{
- key: "promise",
- value: function promise() {
- return this._res.promise;
- }
- }, {
- key: "retry",
- value: function retry() {
- var _this = this;
-
- this._clearTimeouts();
-
- this._res = this._loadFn(this._opts.loader);
- this._state = {
- pastDelay: false,
- timedOut: false
- };
- var res = this._res,
- opts = this._opts;
-
- if (res.loading) {
- if (typeof opts.delay === 'number') {
- if (opts.delay === 0) {
- this._state.pastDelay = true;
- } else {
- this._delay = setTimeout(function () {
- _this._update({
- pastDelay: true
- });
- }, opts.delay);
- }
- }
-
- if (typeof opts.timeout === 'number') {
- this._timeout = setTimeout(function () {
- _this._update({
- timedOut: true
- });
- }, opts.timeout);
- }
- }
-
- this._res.promise.then(function () {
- _this._update({});
-
- _this._clearTimeouts();
- })["catch"](function (_err) {
- _this._update({});
-
- _this._clearTimeouts();
- });
-
- this._update({});
- }
- }, {
- key: "_update",
- value: function _update(partial) {
- this._state = _objectSpread(_objectSpread({}, this._state), {}, {
- error: this._res.error,
- loaded: this._res.loaded,
- loading: this._res.loading
- }, partial);
-
- this._callbacks.forEach(function (callback) {
- return callback();
- });
- }
- }, {
- key: "_clearTimeouts",
- value: function _clearTimeouts() {
- clearTimeout(this._delay);
- clearTimeout(this._timeout);
- }
- }, {
- key: "getCurrentValue",
- value: function getCurrentValue() {
- return this._state;
- }
- }, {
- key: "subscribe",
- value: function subscribe(callback) {
- var _this2 = this;
-
- this._callbacks.add(callback);
-
- return function () {
- _this2._callbacks["delete"](callback);
- };
- }
- }]);
-
- return LoadableSubscription;
-}();
-
-function Loadable(opts) {
- return createLoadableComponent(load, opts);
-}
-
-_c = Loadable;
-
-function LoadableMap(opts) {
- if (typeof opts.render !== 'function') {
- throw new Error('LoadableMap requires a `render(loaded, props)` function');
- }
-
- return createLoadableComponent(loadMap, opts);
-}
-
-_c2 = LoadableMap;
-Loadable.Map = LoadableMap;
-
-function flushInitializers(initializers, ids) {
- var promises = [];
-
- while (initializers.length) {
- var init = initializers.pop();
- promises.push(init(ids));
- }
-
- return Promise.all(promises).then(function () {
- if (initializers.length) {
- return flushInitializers(initializers, ids);
- }
- });
-}
-
-Loadable.preloadAll = function () {
- return new Promise(function (resolveInitializers, reject) {
- flushInitializers(ALL_INITIALIZERS).then(resolveInitializers, reject);
- });
-};
-
-Loadable.preloadReady = function () {
- var ids = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- return new Promise(function (resolvePreload) {
- var res = function res() {
- initialized = true;
- return resolvePreload();
- }; // We always will resolve, errors should be handled within loading UIs.
-
-
- flushInitializers(READY_INITIALIZERS, ids).then(res, res);
- });
-};
-
-if (true) {
- window.__NEXT_PRELOADREADY = Loadable.preloadReady;
-}
-
-var _default = Loadable;
-exports.default = _default;
-
-var _c, _c2;
-
-$RefreshReg$(_c, "Loadable");
-$RefreshReg$(_c2, "LoadableMap");
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/next-server/lib/mitt.js":
-/*!********************************************************!*\
- !*** ./node_modules/next/dist/next-server/lib/mitt.js ***!
- \********************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-exports.__esModule = true;
-exports.default = mitt;
-/*
-MIT License
-Copyright (c) Jason Miller (https://jasonformat.com/)
-Permission 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:
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-THE 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.
-*/
-// This file is based on https://github.com/developit/mitt/blob/v1.1.3/src/index.js
-// It's been edited for the needs of this script
-// See the LICENSE at the top of the file
-
-function mitt() {
- var all = Object.create(null);
- return {
- on: function on(type, handler) {
- ;
- (all[type] || (all[type] = [])).push(handler);
- },
- off: function off(type, handler) {
- if (all[type]) {
- all[type].splice(all[type].indexOf(handler) >>> 0, 1);
- }
- },
- emit: function emit(type) {
- for (var _len = arguments.length, evts = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- evts[_key - 1] = arguments[_key];
- }
-
- // eslint-disable-next-line array-callback-return
- ;
- (all[type] || []).slice().map(function (handler) {
- handler.apply(void 0, evts);
- });
- }
- };
-}
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/next-server/lib/router-context.js":
-/*!******************************************************************!*\
- !*** ./node_modules/next/dist/next-server/lib/router-context.js ***!
- \******************************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-exports.__esModule = true;
-exports.RouterContext = void 0;
-
-var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
-
-function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- };
-}
-
-var RouterContext = /*#__PURE__*/_react["default"].createContext(null);
-
-exports.RouterContext = RouterContext;
-
-if (true) {
- RouterContext.displayName = 'RouterContext';
-}
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/next-server/lib/router/router.js":
-/*!*****************************************************************!*\
- !*** ./node_modules/next/dist/next-server/lib/router/router.js ***!
- \*****************************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-var _regeneratorRuntime = __webpack_require__(/*! ./node_modules/next/node_modules/@babel/runtime/regenerator */ "./node_modules/next/node_modules/@babel/runtime/regenerator/index.js");
-
-var _asyncToGenerator = __webpack_require__(/*! ./node_modules/next/node_modules/@babel/runtime/helpers/asyncToGenerator */ "./node_modules/next/node_modules/@babel/runtime/helpers/asyncToGenerator.js");
-
-var _classCallCheck = __webpack_require__(/*! ./node_modules/next/node_modules/@babel/runtime/helpers/classCallCheck */ "./node_modules/next/node_modules/@babel/runtime/helpers/classCallCheck.js");
-
-var _createClass = __webpack_require__(/*! ./node_modules/next/node_modules/@babel/runtime/helpers/createClass */ "./node_modules/next/node_modules/@babel/runtime/helpers/createClass.js");
-
-var _slicedToArray = __webpack_require__(/*! ./node_modules/next/node_modules/@babel/runtime/helpers/slicedToArray */ "./node_modules/next/node_modules/@babel/runtime/helpers/slicedToArray.js");
-
-exports.__esModule = true;
-exports.getDomainLocale = getDomainLocale;
-exports.addLocale = addLocale;
-exports.delLocale = delLocale;
-exports.hasBasePath = hasBasePath;
-exports.addBasePath = addBasePath;
-exports.delBasePath = delBasePath;
-exports.isLocalURL = isLocalURL;
-exports.interpolateAs = interpolateAs;
-exports.resolveHref = resolveHref;
-exports.default = void 0;
-
-var _normalizeTrailingSlash = __webpack_require__(/*! ../../../client/normalize-trailing-slash */ "./node_modules/next/dist/client/normalize-trailing-slash.js");
-
-var _routeLoader = __webpack_require__(/*! ../../../client/route-loader */ "./node_modules/next/dist/client/route-loader.js");
-
-var _denormalizePagePath = __webpack_require__(/*! ../../server/denormalize-page-path */ "./node_modules/next/dist/next-server/server/denormalize-page-path.js");
-
-var _normalizeLocalePath = __webpack_require__(/*! ../i18n/normalize-locale-path */ "./node_modules/next/dist/next-server/lib/i18n/normalize-locale-path.js");
-
-var _mitt = _interopRequireDefault(__webpack_require__(/*! ../mitt */ "./node_modules/next/dist/next-server/lib/mitt.js"));
-
-var _utils = __webpack_require__(/*! ../utils */ "./node_modules/next/dist/next-server/lib/utils.js");
-
-var _isDynamic = __webpack_require__(/*! ./utils/is-dynamic */ "./node_modules/next/dist/next-server/lib/router/utils/is-dynamic.js");
-
-var _parseRelativeUrl = __webpack_require__(/*! ./utils/parse-relative-url */ "./node_modules/next/dist/next-server/lib/router/utils/parse-relative-url.js");
-
-var _querystring = __webpack_require__(/*! ./utils/querystring */ "./node_modules/next/dist/next-server/lib/router/utils/querystring.js");
-
-var _resolveRewrites = _interopRequireDefault(__webpack_require__(/*! ./utils/resolve-rewrites */ "?ca47"));
-
-var _routeMatcher = __webpack_require__(/*! ./utils/route-matcher */ "./node_modules/next/dist/next-server/lib/router/utils/route-matcher.js");
-
-var _routeRegex = __webpack_require__(/*! ./utils/route-regex */ "./node_modules/next/dist/next-server/lib/router/utils/route-regex.js");
-
-function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- };
-} // tslint:disable:no-console
-
-
-var detectDomainLocale;
-
-if (true) {
- detectDomainLocale = __webpack_require__(/*! ../i18n/detect-domain-locale */ "./node_modules/next/dist/next-server/lib/i18n/detect-domain-locale.js").detectDomainLocale;
-}
-
-var basePath = false || '';
-
-function buildCancellationError() {
- return Object.assign(new Error('Route Cancelled'), {
- cancelled: true
- });
-}
-
-function addPathPrefix(path, prefix) {
- return prefix && path.startsWith('/') ? path === '/' ? (0, _normalizeTrailingSlash.normalizePathTrailingSlash)(prefix) : "".concat(prefix).concat(pathNoQueryHash(path) === '/' ? path.substring(1) : path) : path;
-}
-
-function getDomainLocale(path, locale, locales, domainLocales) {
- if (true) {
- locale = locale || (0, _normalizeLocalePath.normalizeLocalePath)(path, locales).detectedLocale;
- var detectedDomain = detectDomainLocale(domainLocales, undefined, locale);
-
- if (detectedDomain) {
- return "http".concat(detectedDomain.http ? '' : 's', "://").concat(detectedDomain.domain).concat(basePath || '').concat(locale === detectedDomain.defaultLocale ? '' : "/".concat(locale)).concat(path);
- }
-
- return false;
- }
-
- return false;
-}
-
-function addLocale(path, locale, defaultLocale) {
- if (true) {
- var pathname = pathNoQueryHash(path);
- var pathLower = pathname.toLowerCase();
- var localeLower = locale && locale.toLowerCase();
- return locale && locale !== defaultLocale && !pathLower.startsWith('/' + localeLower + '/') && pathLower !== '/' + localeLower ? addPathPrefix(path, '/' + locale) : path;
- }
-
- return path;
-}
-
-function delLocale(path, locale) {
- if (true) {
- var pathname = pathNoQueryHash(path);
- var pathLower = pathname.toLowerCase();
- var localeLower = locale && locale.toLowerCase();
- return locale && (pathLower.startsWith('/' + localeLower + '/') || pathLower === '/' + localeLower) ? (pathname.length === locale.length + 1 ? '/' : '') + path.substr(locale.length + 1) : path;
- }
-
- return path;
-}
-
-function pathNoQueryHash(path) {
- var queryIndex = path.indexOf('?');
- var hashIndex = path.indexOf('#');
-
- if (queryIndex > -1 || hashIndex > -1) {
- path = path.substring(0, queryIndex > -1 ? queryIndex : hashIndex);
- }
-
- return path;
-}
-
-function hasBasePath(path) {
- path = pathNoQueryHash(path);
- return path === basePath || path.startsWith(basePath + '/');
-}
-
-function addBasePath(path) {
- // we only add the basepath on relative urls
- return addPathPrefix(path, basePath);
-}
-
-function delBasePath(path) {
- path = path.slice(basePath.length);
- if (!path.startsWith('/')) path = "/".concat(path);
- return path;
-}
-/**
-* Detects whether a given url is routable by the Next.js router (browser only).
-*/
-
-
-function isLocalURL(url) {
- // prevent a hydration mismatch on href for url with anchor refs
- if (url.startsWith('/') || url.startsWith('#')) return true;
-
- try {
- // absolute urls can be local if they are on the same origin
- var locationOrigin = (0, _utils.getLocationOrigin)();
- var resolved = new URL(url, locationOrigin);
- return resolved.origin === locationOrigin && hasBasePath(resolved.pathname);
- } catch (_) {
- return false;
- }
-}
-
-function interpolateAs(route, asPathname, query) {
- var interpolatedRoute = '';
- var dynamicRegex = (0, _routeRegex.getRouteRegex)(route);
- var dynamicGroups = dynamicRegex.groups;
- var dynamicMatches = // Try to match the dynamic route against the asPath
- (asPathname !== route ? (0, _routeMatcher.getRouteMatcher)(dynamicRegex)(asPathname) : '') || // Fall back to reading the values from the href
- // TODO: should this take priority; also need to change in the router.
- query;
- interpolatedRoute = route;
- var params = Object.keys(dynamicGroups);
-
- if (!params.every(function (param) {
- var value = dynamicMatches[param] || '';
- var _dynamicGroups$param = dynamicGroups[param],
- repeat = _dynamicGroups$param.repeat,
- optional = _dynamicGroups$param.optional; // support single-level catch-all
- // TODO: more robust handling for user-error (passing `/`)
-
- var replaced = "[".concat(repeat ? '...' : '').concat(param, "]");
-
- if (optional) {
- replaced = "".concat(!value ? '/' : '', "[").concat(replaced, "]");
- }
-
- if (repeat && !Array.isArray(value)) value = [value];
- return (optional || param in dynamicMatches) && ( // Interpolate group into data URL if present
- interpolatedRoute = interpolatedRoute.replace(replaced, repeat ? value.map( // these values should be fully encoded instead of just
- // path delimiter escaped since they are being inserted
- // into the URL and we expect URL encoded segments
- // when parsing dynamic route params
- function (segment) {
- return encodeURIComponent(segment);
- }).join('/') : encodeURIComponent(value)) || '/');
- })) {
- interpolatedRoute = ''; // did not satisfy all requirements
- // n.b. We ignore this error because we handle warning for this case in
- // development in the `` component directly.
- }
-
- return {
- params: params,
- result: interpolatedRoute
- };
-}
-
-function omitParmsFromQuery(query, params) {
- var filteredQuery = {};
- Object.keys(query).forEach(function (key) {
- if (!params.includes(key)) {
- filteredQuery[key] = query[key];
- }
- });
- return filteredQuery;
-}
-/**
-* Resolves a given hyperlink with a certain router state (basePath not included).
-* Preserves absolute urls.
-*/
-
-
-function resolveHref(currentPath, href, resolveAs) {
- // we use a dummy base url for relative urls
- var base;
-
- try {
- base = new URL(currentPath, 'http://n');
- } catch (_) {
- // fallback to / for invalid asPath values e.g. //
- base = new URL('/', 'http://n');
- }
-
- var urlAsString = typeof href === 'string' ? href : (0, _utils.formatWithValidation)(href); // Return because it cannot be routed by the Next.js router
-
- if (!isLocalURL(urlAsString)) {
- return resolveAs ? [urlAsString] : urlAsString;
- }
-
- try {
- var finalUrl = new URL(urlAsString, base);
- finalUrl.pathname = (0, _normalizeTrailingSlash.normalizePathTrailingSlash)(finalUrl.pathname);
- var interpolatedAs = '';
-
- if ((0, _isDynamic.isDynamicRoute)(finalUrl.pathname) && finalUrl.searchParams && resolveAs) {
- var query = (0, _querystring.searchParamsToUrlQuery)(finalUrl.searchParams);
-
- var _interpolateAs = interpolateAs(finalUrl.pathname, finalUrl.pathname, query),
- result = _interpolateAs.result,
- params = _interpolateAs.params;
-
- if (result) {
- interpolatedAs = (0, _utils.formatWithValidation)({
- pathname: result,
- hash: finalUrl.hash,
- query: omitParmsFromQuery(query, params)
- });
- }
- } // if the origin didn't change, it means we received a relative href
-
-
- var resolvedHref = finalUrl.origin === base.origin ? finalUrl.href.slice(finalUrl.origin.length) : finalUrl.href;
- return resolveAs ? [resolvedHref, interpolatedAs || resolvedHref] : resolvedHref;
- } catch (_) {
- return resolveAs ? [urlAsString] : urlAsString;
- }
-}
-
-function stripOrigin(url) {
- var origin = (0, _utils.getLocationOrigin)();
- return url.startsWith(origin) ? url.substring(origin.length) : url;
-}
-
-function prepareUrlAs(router, url, as) {
- // If url and as provided as an object representation,
- // we'll format them into the string version here.
- var _resolveHref = resolveHref(router.asPath, url, true),
- _resolveHref2 = _slicedToArray(_resolveHref, 2),
- resolvedHref = _resolveHref2[0],
- resolvedAs = _resolveHref2[1];
-
- var origin = (0, _utils.getLocationOrigin)();
- var hrefHadOrigin = resolvedHref.startsWith(origin);
- var asHadOrigin = resolvedAs && resolvedAs.startsWith(origin);
- resolvedHref = stripOrigin(resolvedHref);
- resolvedAs = resolvedAs ? stripOrigin(resolvedAs) : resolvedAs;
- var preparedUrl = hrefHadOrigin ? resolvedHref : addBasePath(resolvedHref);
- var preparedAs = as ? stripOrigin(resolveHref(router.asPath, as)) : resolvedAs || resolvedHref;
- return {
- url: preparedUrl,
- as: asHadOrigin ? preparedAs : addBasePath(preparedAs)
- };
-}
-
-function resolveDynamicRoute(pathname, pages) {
- var cleanPathname = (0, _normalizeTrailingSlash.removePathTrailingSlash)((0, _denormalizePagePath.denormalizePagePath)(pathname));
-
- if (cleanPathname === '/404' || cleanPathname === '/_error') {
- return pathname;
- } // handle resolving href for dynamic routes
-
-
- if (!pages.includes(cleanPathname)) {
- // eslint-disable-next-line array-callback-return
- pages.some(function (page) {
- if ((0, _isDynamic.isDynamicRoute)(page) && (0, _routeRegex.getRouteRegex)(page).re.test(cleanPathname)) {
- pathname = page;
- return true;
- }
- });
- }
-
- return (0, _normalizeTrailingSlash.removePathTrailingSlash)(pathname);
-}
-
-var manualScrollRestoration = false && 0;
-var SSG_DATA_NOT_FOUND = Symbol('SSG_DATA_NOT_FOUND');
-
-function fetchRetry(url, attempts) {
- return fetch(url, {
- // Cookies are required to be present for Next.js' SSG "Preview Mode".
- // Cookies may also be required for `getServerSideProps`.
- //
- // > `fetch` won’t send cookies, unless you set the credentials init
- // > option.
- // https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
- //
- // > For maximum browser compatibility when it comes to sending &
- // > receiving cookies, always supply the `credentials: 'same-origin'`
- // > option instead of relying on the default.
- // https://github.com/github/fetch#caveats
- credentials: 'same-origin'
- }).then(function (res) {
- if (!res.ok) {
- if (attempts > 1 && res.status >= 500) {
- return fetchRetry(url, attempts - 1);
- }
-
- if (res.status === 404) {
- return res.json().then(function (data) {
- if (data.notFound) {
- return {
- notFound: SSG_DATA_NOT_FOUND
- };
- }
-
- throw new Error("Failed to load static props");
- });
- }
-
- throw new Error("Failed to load static props");
- }
-
- return res.json();
- });
-}
-
-function fetchNextData(dataHref, isServerRender) {
- return fetchRetry(dataHref, isServerRender ? 3 : 1)["catch"](function (err) {
- // We should only trigger a server-side transition if this was caused
- // on a client-side transition. Otherwise, we'd get into an infinite
- // loop.
- if (!isServerRender) {
- (0, _routeLoader.markAssetError)(err);
- }
-
- throw err;
- });
-}
-
-var Router = /*#__PURE__*/function () {
- /**
- * Map of all components loaded in `Router`
- */
- // Static Data Cache
- // In-flight Server Data Requests, for deduping
- function Router(_pathname, _query, _as, _ref) {
- var _this = this;
-
- var initialProps = _ref.initialProps,
- pageLoader = _ref.pageLoader,
- App = _ref.App,
- wrapApp = _ref.wrapApp,
- Component = _ref.Component,
- err = _ref.err,
- subscription = _ref.subscription,
- isFallback = _ref.isFallback,
- locale = _ref.locale,
- locales = _ref.locales,
- defaultLocale = _ref.defaultLocale,
- domainLocales = _ref.domainLocales,
- isPreview = _ref.isPreview;
-
- _classCallCheck(this, Router);
-
- this.route = void 0;
- this.pathname = void 0;
- this.query = void 0;
- this.asPath = void 0;
- this.basePath = void 0;
- this.components = void 0;
- this.sdc = {};
- this.sdr = {};
- this.sub = void 0;
- this.clc = void 0;
- this.pageLoader = void 0;
- this._bps = void 0;
- this.events = void 0;
- this._wrapApp = void 0;
- this.isSsr = void 0;
- this.isFallback = void 0;
- this._inFlightRoute = void 0;
- this._shallow = void 0;
- this.locale = void 0;
- this.locales = void 0;
- this.defaultLocale = void 0;
- this.domainLocales = void 0;
- this.isReady = void 0;
- this.isPreview = void 0;
- this.isLocaleDomain = void 0;
- this._idx = 0;
-
- this.onPopState = function (e) {
- var state = e.state;
-
- if (!state) {
- // We get state as undefined for two reasons.
- // 1. With older safari (< 8) and older chrome (< 34)
- // 2. When the URL changed with #
- //
- // In the both cases, we don't need to proceed and change the route.
- // (as it's already changed)
- // But we can simply replace the state with the new changes.
- // Actually, for (1) we don't need to nothing. But it's hard to detect that event.
- // So, doing the following for (1) does no harm.
- var _pathname2 = _this.pathname,
- query = _this.query;
-
- _this.changeState('replaceState', (0, _utils.formatWithValidation)({
- pathname: addBasePath(_pathname2),
- query: query
- }), (0, _utils.getURL)());
-
- return;
- }
-
- if (!state.__N) {
- return;
- }
-
- var forcedScroll;
- var url = state.url,
- as = state.as,
- options = state.options,
- idx = state.idx;
-
- if (false) { var v; }
-
- _this._idx = idx;
-
- var _ref2 = (0, _parseRelativeUrl.parseRelativeUrl)(url),
- pathname = _ref2.pathname; // Make sure we don't re-render on initial load,
- // can be caused by navigating back from an external site
-
-
- if (_this.isSsr && as === _this.asPath && pathname === _this.pathname) {
- return;
- } // If the downstream application returns falsy, return.
- // They will then be responsible for handling the event.
-
-
- if (_this._bps && !_this._bps(state)) {
- return;
- }
-
- _this.change('replaceState', url, as, Object.assign({}, options, {
- shallow: options.shallow && _this._shallow,
- locale: options.locale || _this.defaultLocale
- }), forcedScroll);
- }; // represents the current component key
-
-
- this.route = (0, _normalizeTrailingSlash.removePathTrailingSlash)(_pathname); // set up the component cache (by route keys)
-
- this.components = {}; // We should not keep the cache, if there's an error
- // Otherwise, this cause issues when when going back and
- // come again to the errored page.
-
- if (_pathname !== '/_error') {
- this.components[this.route] = {
- Component: Component,
- initial: true,
- props: initialProps,
- err: err,
- __N_SSG: initialProps && initialProps.__N_SSG,
- __N_SSP: initialProps && initialProps.__N_SSP
- };
- }
-
- this.components['/_app'] = {
- Component: App,
- styleSheets: [
- /* /_app does not need its stylesheets managed */
- ]
- }; // Backwards compat for Router.router.events
- // TODO: Should be remove the following major version as it was never documented
-
- this.events = Router.events;
- this.pageLoader = pageLoader;
- this.pathname = _pathname;
- this.query = _query; // if auto prerendered and dynamic route wait to update asPath
- // until after mount to prevent hydration mismatch
-
- var autoExportDynamic = (0, _isDynamic.isDynamicRoute)(_pathname) && self.__NEXT_DATA__.autoExport;
-
- this.asPath = autoExportDynamic ? _pathname : _as;
- this.basePath = basePath;
- this.sub = subscription;
- this.clc = null;
- this._wrapApp = wrapApp; // make sure to ignore extra popState in safari on navigating
- // back from external site
-
- this.isSsr = true;
- this.isFallback = isFallback;
- this.isReady = !!(self.__NEXT_DATA__.gssp || self.__NEXT_DATA__.gip || !autoExportDynamic && !self.location.search && !false);
- this.isPreview = !!isPreview;
- this.isLocaleDomain = false;
-
- if (true) {
- this.locale = locale;
- this.locales = locales;
- this.defaultLocale = defaultLocale;
- this.domainLocales = domainLocales;
- this.isLocaleDomain = !!detectDomainLocale(domainLocales, self.location.hostname);
- }
-
- if (true) {
- // make sure "as" doesn't start with double slashes or else it can
- // throw an error as it's considered invalid
- if (_as.substr(0, 2) !== '//') {
- // in order for `e.state` to work on the `onpopstate` event
- // we have to register the initial route upon initialization
- this.changeState('replaceState', (0, _utils.formatWithValidation)({
- pathname: addBasePath(_pathname),
- query: _query
- }), (0, _utils.getURL)(), {
- locale: locale
- });
- }
-
- window.addEventListener('popstate', this.onPopState); // enable custom scroll restoration handling when available
- // otherwise fallback to browser's default handling
-
- if (false) {}
- }
- }
-
- _createClass(Router, [{
- key: "reload",
- value: function reload() {
- window.location.reload();
- }
- /**
- * Go back in history
- */
-
- }, {
- key: "back",
- value: function back() {
- window.history.back();
- }
- /**
- * Performs a `pushState` with arguments
- * @param url of the route
- * @param as masks `url` for the browser
- * @param options object you can define `shallow` and other options
- */
-
- }, {
- key: "push",
- value: function push(url, as) {
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
-
- if (false) {}
-
- ;
-
- var _prepareUrlAs = prepareUrlAs(this, url, as);
-
- url = _prepareUrlAs.url;
- as = _prepareUrlAs.as;
- return this.change('pushState', url, as, options);
- }
- /**
- * Performs a `replaceState` with arguments
- * @param url of the route
- * @param as masks `url` for the browser
- * @param options object you can define `shallow` and other options
- */
-
- }, {
- key: "replace",
- value: function replace(url, as) {
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- ;
-
- var _prepareUrlAs2 = prepareUrlAs(this, url, as);
-
- url = _prepareUrlAs2.url;
- as = _prepareUrlAs2.as;
- return this.change('replaceState', url, as, options);
- }
- }, {
- key: "change",
- value: function () {
- var _change = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(method, url, as, options, forcedScroll) {
- var _options$scroll, shouldResolveHref, localeChange, parsedAs, localePathResult, didNavigate, _this$locales, detectedDomain, asNoBasePath, _options$shallow, shallow, routeProps, cleanedAs, parsed, pathname, query, pages, rewrites, _yield, resolvedAs, rewritesResult, route, _parsedAs, asPathname, routeRegex, routeMatch, shouldInterpolate, interpolatedAs, missingParams, _self$__NEXT_DATA__$p, _self$__NEXT_DATA__$p2, routeInfo, _routeInfo, error, props, __N_SSG, __N_SSP, destination, parsedHref, _prepareUrlAs3, newUrl, newAs, notFoundRoute, appComp, isValidShallowRoute;
-
- return _regeneratorRuntime.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- if (isLocalURL(url)) {
- _context.next = 3;
- break;
- }
-
- window.location.href = url;
- return _context.abrupt("return", false);
-
- case 3:
- shouldResolveHref = url === as || options._h; // for static pages with query params in the URL we delay
- // marking the router ready until after the query is updated
-
- if (options._h) {
- this.isReady = true;
- } // Default to scroll reset behavior unless explicitly specified to be
- // `false`! This makes the behavior between using `Router#push` and a
- // `` consistent.
-
-
- options.scroll = !!((_options$scroll = options.scroll) != null ? _options$scroll : true);
- localeChange = options.locale !== this.locale;
-
- if (false) {}
-
- this.locale = options.locale === false ? this.defaultLocale : options.locale || this.locale;
-
- if (typeof options.locale === 'undefined') {
- options.locale = this.locale;
- }
-
- parsedAs = (0, _parseRelativeUrl.parseRelativeUrl)(hasBasePath(as) ? delBasePath(as) : as);
- localePathResult = (0, _normalizeLocalePath.normalizeLocalePath)(parsedAs.pathname, this.locales);
-
- if (localePathResult.detectedLocale) {
- this.locale = localePathResult.detectedLocale;
- parsedAs.pathname = addBasePath(parsedAs.pathname);
- as = (0, _utils.formatWithValidation)(parsedAs);
- url = addBasePath((0, _normalizeLocalePath.normalizeLocalePath)(hasBasePath(url) ? delBasePath(url) : url, this.locales).pathname);
- }
-
- didNavigate = false; // we need to wrap this in the env check again since regenerator runtime
- // moves this on its own due to the return
-
- if (true) {
- // if the locale isn't configured hard navigate to show 404 page
- if (!((_this$locales = this.locales) != null && _this$locales.includes(this.locale))) {
- parsedAs.pathname = addLocale(parsedAs.pathname, this.locale);
- window.location.href = (0, _utils.formatWithValidation)(parsedAs); // this was previously a return but was removed in favor
- // of better dead code elimination with regenerator runtime
-
- didNavigate = true;
- }
- }
-
- detectedDomain = detectDomainLocale(this.domainLocales, undefined, this.locale); // we need to wrap this in the env check again since regenerator runtime
- // moves this on its own due to the return
-
- if (true) {
- // if we are navigating to a domain locale ensure we redirect to the
- // correct domain
- if (!didNavigate && detectedDomain && this.isLocaleDomain && self.location.hostname !== detectedDomain.domain) {
- asNoBasePath = delBasePath(as);
- window.location.href = "http".concat(detectedDomain.http ? '' : 's', "://").concat(detectedDomain.domain).concat(addBasePath("".concat(this.locale === detectedDomain.defaultLocale ? '' : "/".concat(this.locale)).concat(asNoBasePath === '/' ? '' : asNoBasePath) || '/')); // this was previously a return but was removed in favor
- // of better dead code elimination with regenerator runtime
-
- didNavigate = true;
- }
- }
-
- if (!didNavigate) {
- _context.next = 19;
- break;
- }
-
- return _context.abrupt("return", new Promise(function () {}));
-
- case 19:
- if (!options._h) {
- this.isSsr = false;
- } // marking route changes as a navigation start entry
-
-
- if (_utils.ST) {
- performance.mark('routeChange');
- }
-
- _options$shallow = options.shallow, shallow = _options$shallow === void 0 ? false : _options$shallow;
- routeProps = {
- shallow: shallow
- };
-
- if (this._inFlightRoute) {
- this.abortComponentLoad(this._inFlightRoute, routeProps);
- }
-
- as = addBasePath(addLocale(hasBasePath(as) ? delBasePath(as) : as, options.locale, this.defaultLocale));
- cleanedAs = delLocale(hasBasePath(as) ? delBasePath(as) : as, this.locale);
- this._inFlightRoute = as; // If the url change is only related to a hash change
- // We should not proceed. We should only change the state.
- // WARNING: `_h` is an internal option for handing Next.js client-side
- // hydration. Your app should _never_ use this property. It may change at
- // any time without notice.
-
- if (!(!options._h && this.onlyAHashChange(cleanedAs))) {
- _context.next = 35;
- break;
- }
-
- this.asPath = cleanedAs;
- Router.events.emit('hashChangeStart', as, routeProps); // TODO: do we need the resolved href when only a hash change?
-
- this.changeState(method, url, as, options);
- this.scrollToHash(cleanedAs);
- this.notify(this.components[this.route], null);
- Router.events.emit('hashChangeComplete', as, routeProps);
- return _context.abrupt("return", true);
-
- case 35:
- parsed = (0, _parseRelativeUrl.parseRelativeUrl)(url);
- pathname = parsed.pathname, query = parsed.query; // The build manifest needs to be loaded before auto-static dynamic pages
- // get their query parameters to allow ensuring they can be parsed properly
- // when rewritten to
-
- _context.prev = 37;
- _context.next = 40;
- return this.pageLoader.getPageList();
-
- case 40:
- pages = _context.sent;
- _context.next = 43;
- return (0, _routeLoader.getClientBuildManifest)();
-
- case 43:
- _yield = _context.sent;
- rewrites = _yield.__rewrites;
- _context.next = 51;
- break;
-
- case 47:
- _context.prev = 47;
- _context.t0 = _context["catch"](37);
- // If we fail to resolve the page list or client-build manifest, we must
- // do a server-side transition:
- window.location.href = as;
- return _context.abrupt("return", false);
-
- case 51:
- // If asked to change the current URL we should reload the current page
- // (not location.reload() but reload getInitialProps and other Next.js stuffs)
- // We also need to set the method = replaceState always
- // as this should not go into the history (That's how browsers work)
- // We should compare the new asPath to the current asPath, not the url
- if (!this.urlIsNew(cleanedAs) && !localeChange) {
- method = 'replaceState';
- } // we need to resolve the as value using rewrites for dynamic SSG
- // pages to allow building the data URL correctly
-
-
- resolvedAs = as; // url and as should always be prefixed with basePath by this
- // point by either next/link or router.push/replace so strip the
- // basePath from the pathname to match the pages dir 1-to-1
-
- pathname = pathname ? (0, _normalizeTrailingSlash.removePathTrailingSlash)(delBasePath(pathname)) : pathname;
-
- if (shouldResolveHref && pathname !== '/_error') {
- if (false) {} else {
- parsed.pathname = resolveDynamicRoute(pathname, pages);
-
- if (parsed.pathname !== pathname) {
- pathname = parsed.pathname;
- url = (0, _utils.formatWithValidation)(parsed);
- }
- }
- }
-
- route = (0, _normalizeTrailingSlash.removePathTrailingSlash)(pathname);
-
- if (isLocalURL(as)) {
- _context.next = 61;
- break;
- }
-
- if (false) {}
-
- throw new Error("Invalid href: \"".concat(url, "\" and as: \"").concat(as, "\", received relative href and external as") + "\nSee more info: https://nextjs.org/docs/messages/invalid-relative-url-external-as");
-
- case 59:
- window.location.href = as;
- return _context.abrupt("return", false);
-
- case 61:
- resolvedAs = delLocale(delBasePath(resolvedAs), this.locale);
-
- if (!(0, _isDynamic.isDynamicRoute)(route)) {
- _context.next = 77;
- break;
- }
-
- _parsedAs = (0, _parseRelativeUrl.parseRelativeUrl)(resolvedAs);
- asPathname = _parsedAs.pathname;
- routeRegex = (0, _routeRegex.getRouteRegex)(route);
- routeMatch = (0, _routeMatcher.getRouteMatcher)(routeRegex)(asPathname);
- shouldInterpolate = route === asPathname;
- interpolatedAs = shouldInterpolate ? interpolateAs(route, asPathname, query) : {};
-
- if (!(!routeMatch || shouldInterpolate && !interpolatedAs.result)) {
- _context.next = 76;
- break;
- }
-
- missingParams = Object.keys(routeRegex.groups).filter(function (param) {
- return !query[param];
- });
-
- if (!(missingParams.length > 0)) {
- _context.next = 74;
- break;
- }
-
- if (true) {
- console.warn("".concat(shouldInterpolate ? "Interpolating href" : "Mismatching `as` and `href`", " failed to manually provide ") + "the params: ".concat(missingParams.join(', '), " in the `href`'s `query`"));
- }
-
- throw new Error((shouldInterpolate ? "The provided `href` (".concat(url, ") value is missing query values (").concat(missingParams.join(', '), ") to be interpolated properly. ") : "The provided `as` value (".concat(asPathname, ") is incompatible with the `href` value (").concat(route, "). ")) + "Read more: https://nextjs.org/docs/messages/".concat(shouldInterpolate ? 'href-interpolation-failed' : 'incompatible-href-as'));
-
- case 74:
- _context.next = 77;
- break;
-
- case 76:
- if (shouldInterpolate) {
- as = (0, _utils.formatWithValidation)(Object.assign({}, _parsedAs, {
- pathname: interpolatedAs.result,
- query: omitParmsFromQuery(query, interpolatedAs.params)
- }));
- } else {
- // Merge params into `query`, overwriting any specified in search
- Object.assign(query, routeMatch);
- }
-
- case 77:
- Router.events.emit('routeChangeStart', as, routeProps);
- _context.prev = 78;
- _context.next = 81;
- return this.getRouteInfo(route, pathname, query, as, resolvedAs, routeProps);
-
- case 81:
- routeInfo = _context.sent;
- _routeInfo = routeInfo, error = _routeInfo.error, props = _routeInfo.props, __N_SSG = _routeInfo.__N_SSG, __N_SSP = _routeInfo.__N_SSP; // handle redirect on client-transition
-
- if (!((__N_SSG || __N_SSP) && props)) {
- _context.next = 108;
- break;
- }
-
- if (!(props.pageProps && props.pageProps.__N_REDIRECT)) {
- _context.next = 94;
- break;
- }
-
- destination = props.pageProps.__N_REDIRECT; // check if destination is internal (resolves to a page) and attempt
- // client-navigation if it is falling back to hard navigation if
- // it's not
-
- if (!destination.startsWith('/')) {
- _context.next = 92;
- break;
- }
-
- parsedHref = (0, _parseRelativeUrl.parseRelativeUrl)(destination);
- parsedHref.pathname = resolveDynamicRoute(parsedHref.pathname, pages);
-
- if (!pages.includes(parsedHref.pathname)) {
- _context.next = 92;
- break;
- }
-
- _prepareUrlAs3 = prepareUrlAs(this, destination, destination), newUrl = _prepareUrlAs3.url, newAs = _prepareUrlAs3.as;
- return _context.abrupt("return", this.change(method, newUrl, newAs, options));
-
- case 92:
- window.location.href = destination;
- return _context.abrupt("return", new Promise(function () {}));
-
- case 94:
- this.isPreview = !!props.__N_PREVIEW; // handle SSG data 404
-
- if (!(props.notFound === SSG_DATA_NOT_FOUND)) {
- _context.next = 108;
- break;
- }
-
- _context.prev = 96;
- _context.next = 99;
- return this.fetchComponent('/404');
-
- case 99:
- notFoundRoute = '/404';
- _context.next = 105;
- break;
-
- case 102:
- _context.prev = 102;
- _context.t1 = _context["catch"](96);
- notFoundRoute = '/_error';
-
- case 105:
- _context.next = 107;
- return this.getRouteInfo(notFoundRoute, notFoundRoute, query, as, resolvedAs, {
- shallow: false
- });
-
- case 107:
- routeInfo = _context.sent;
-
- case 108:
- Router.events.emit('beforeHistoryChange', as, routeProps);
- this.changeState(method, url, as, options);
-
- if (true) {
- appComp = this.components['/_app'].Component;
- window.next.isPrerendered = appComp.getInitialProps === appComp.origGetInitialProps && !routeInfo.Component.getInitialProps;
- } // shallow routing is only allowed for same page URL changes.
-
-
- isValidShallowRoute = options.shallow && this.route === route;
-
- if (options._h && pathname === '/_error' && ((_self$__NEXT_DATA__$p = self.__NEXT_DATA__.props) == null ? void 0 : (_self$__NEXT_DATA__$p2 = _self$__NEXT_DATA__$p.pageProps) == null ? void 0 : _self$__NEXT_DATA__$p2.statusCode) === 500 && props != null && props.pageProps) {
- // ensure statusCode is still correct for static 500 page
- // when updating query information
- props.pageProps.statusCode = 500;
- }
-
- _context.next = 115;
- return this.set(route, pathname, query, cleanedAs, routeInfo, forcedScroll || (isValidShallowRoute || !options.scroll ? null : {
- x: 0,
- y: 0
- }))["catch"](function (e) {
- if (e.cancelled) error = error || e;else throw e;
- });
-
- case 115:
- if (!error) {
- _context.next = 118;
- break;
- }
-
- Router.events.emit('routeChangeError', error, cleanedAs, routeProps);
- throw error;
-
- case 118:
- if (true) {
- if (this.locale) {
- document.documentElement.lang = this.locale;
- }
- }
-
- Router.events.emit('routeChangeComplete', as, routeProps);
- return _context.abrupt("return", true);
-
- case 123:
- _context.prev = 123;
- _context.t2 = _context["catch"](78);
-
- if (!_context.t2.cancelled) {
- _context.next = 127;
- break;
- }
-
- return _context.abrupt("return", false);
-
- case 127:
- throw _context.t2;
-
- case 128:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this, [[37, 47], [78, 123], [96, 102]]);
- }));
-
- function change(_x, _x2, _x3, _x4, _x5) {
- return _change.apply(this, arguments);
- }
-
- return change;
- }()
- }, {
- key: "changeState",
- value: function changeState(method, url, as) {
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
-
- if (true) {
- if (typeof window.history === 'undefined') {
- console.error("Warning: window.history is not available.");
- return;
- }
-
- if (typeof window.history[method] === 'undefined') {
- console.error("Warning: window.history.".concat(method, " is not available"));
- return;
- }
- }
-
- if (method !== 'pushState' || (0, _utils.getURL)() !== as) {
- this._shallow = options.shallow;
- window.history[method]({
- url: url,
- as: as,
- options: options,
- __N: true,
- idx: this._idx = method !== 'pushState' ? this._idx : this._idx + 1
- }, // Most browsers currently ignores this parameter, although they may use it in the future.
- // Passing the empty string here should be safe against future changes to the method.
- // https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState
- '', as);
- }
- }
- }, {
- key: "handleRouteInfoError",
- value: function () {
- var _handleRouteInfoError = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(err, pathname, query, as, routeProps, loadErrorFail) {
- var Component, styleSheets, props, _yield$this$fetchComp, routeInfo;
-
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- if (!err.cancelled) {
- _context2.next = 2;
- break;
- }
-
- throw err;
-
- case 2:
- if (!((0, _routeLoader.isAssetError)(err) || loadErrorFail)) {
- _context2.next = 6;
- break;
- }
-
- Router.events.emit('routeChangeError', err, as, routeProps); // If we can't load the page it could be one of following reasons
- // 1. Page doesn't exists
- // 2. Page does exist in a different zone
- // 3. Internal error while loading the page
- // So, doing a hard reload is the proper way to deal with this.
-
- window.location.href = as; // Changing the URL doesn't block executing the current code path.
- // So let's throw a cancellation error stop the routing logic.
-
- throw buildCancellationError();
-
- case 6:
- _context2.prev = 6;
-
- if (!(typeof Component === 'undefined' || typeof styleSheets === 'undefined')) {
- _context2.next = 14;
- break;
- }
-
- ;
- _context2.next = 11;
- return this.fetchComponent('/_error');
-
- case 11:
- _yield$this$fetchComp = _context2.sent;
- Component = _yield$this$fetchComp.page;
- styleSheets = _yield$this$fetchComp.styleSheets;
-
- case 14:
- routeInfo = {
- props: props,
- Component: Component,
- styleSheets: styleSheets,
- err: err,
- error: err
- };
-
- if (routeInfo.props) {
- _context2.next = 26;
- break;
- }
-
- _context2.prev = 16;
- _context2.next = 19;
- return this.getInitialProps(Component, {
- err: err,
- pathname: pathname,
- query: query
- });
-
- case 19:
- routeInfo.props = _context2.sent;
- _context2.next = 26;
- break;
-
- case 22:
- _context2.prev = 22;
- _context2.t0 = _context2["catch"](16);
- console.error('Error in error page `getInitialProps`: ', _context2.t0);
- routeInfo.props = {};
-
- case 26:
- return _context2.abrupt("return", routeInfo);
-
- case 29:
- _context2.prev = 29;
- _context2.t1 = _context2["catch"](6);
- return _context2.abrupt("return", this.handleRouteInfoError(_context2.t1, pathname, query, as, routeProps, true));
-
- case 32:
- case "end":
- return _context2.stop();
- }
- }
- }, _callee2, this, [[6, 29], [16, 22]]);
- }));
-
- function handleRouteInfoError(_x6, _x7, _x8, _x9, _x10, _x11) {
- return _handleRouteInfoError.apply(this, arguments);
- }
-
- return handleRouteInfoError;
- }()
- }, {
- key: "getRouteInfo",
- value: function () {
- var _getRouteInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(route, pathname, query, as, resolvedAs, routeProps) {
- var _this2 = this;
-
- var existingRouteInfo, cachedRouteInfo, routeInfo, Component, __N_SSG, __N_SSP, _require, isValidElementType, dataHref, props;
-
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- _context3.prev = 0;
- existingRouteInfo = this.components[route];
-
- if (!(routeProps.shallow && existingRouteInfo && this.route === route)) {
- _context3.next = 4;
- break;
- }
-
- return _context3.abrupt("return", existingRouteInfo);
-
- case 4:
- cachedRouteInfo = existingRouteInfo && 'initial' in existingRouteInfo ? undefined : existingRouteInfo;
-
- if (!cachedRouteInfo) {
- _context3.next = 9;
- break;
- }
-
- _context3.t0 = cachedRouteInfo;
- _context3.next = 12;
- break;
-
- case 9:
- _context3.next = 11;
- return this.fetchComponent(route).then(function (res) {
- return {
- Component: res.page,
- styleSheets: res.styleSheets,
- __N_SSG: res.mod.__N_SSG,
- __N_SSP: res.mod.__N_SSP
- };
- });
-
- case 11:
- _context3.t0 = _context3.sent;
-
- case 12:
- routeInfo = _context3.t0;
- Component = routeInfo.Component, __N_SSG = routeInfo.__N_SSG, __N_SSP = routeInfo.__N_SSP;
-
- if (false) {}
-
- _require = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js"), isValidElementType = _require.isValidElementType;
-
- if (isValidElementType(Component)) {
- _context3.next = 18;
- break;
- }
-
- throw new Error("The default export is not a React Component in page: \"".concat(pathname, "\""));
-
- case 18:
- if (__N_SSG || __N_SSP) {
- dataHref = this.pageLoader.getDataHref((0, _utils.formatWithValidation)({
- pathname: pathname,
- query: query
- }), resolvedAs, __N_SSG, this.locale);
- }
-
- _context3.next = 21;
- return this._getData(function () {
- return __N_SSG ? _this2._getStaticData(dataHref) : __N_SSP ? _this2._getServerData(dataHref) : _this2.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
- {
- pathname: pathname,
- query: query,
- asPath: as,
- locale: _this2.locale,
- locales: _this2.locales,
- defaultLocale: _this2.defaultLocale
- });
- });
-
- case 21:
- props = _context3.sent;
- routeInfo.props = props;
- this.components[route] = routeInfo;
- return _context3.abrupt("return", routeInfo);
-
- case 27:
- _context3.prev = 27;
- _context3.t1 = _context3["catch"](0);
- return _context3.abrupt("return", this.handleRouteInfoError(_context3.t1, pathname, query, as, routeProps));
-
- case 30:
- case "end":
- return _context3.stop();
- }
- }
- }, _callee3, this, [[0, 27]]);
- }));
-
- function getRouteInfo(_x12, _x13, _x14, _x15, _x16, _x17) {
- return _getRouteInfo.apply(this, arguments);
- }
-
- return getRouteInfo;
- }()
- }, {
- key: "set",
- value: function set(route, pathname, query, as, data, resetScroll) {
- this.isFallback = false;
- this.route = route;
- this.pathname = pathname;
- this.query = query;
- this.asPath = as;
- return this.notify(data, resetScroll);
- }
- /**
- * Callback to execute before replacing router state
- * @param cb callback to be executed
- */
-
- }, {
- key: "beforePopState",
- value: function beforePopState(cb) {
- this._bps = cb;
- }
- }, {
- key: "onlyAHashChange",
- value: function onlyAHashChange(as) {
- if (!this.asPath) return false;
-
- var _this$asPath$split = this.asPath.split('#'),
- _this$asPath$split2 = _slicedToArray(_this$asPath$split, 2),
- oldUrlNoHash = _this$asPath$split2[0],
- oldHash = _this$asPath$split2[1];
-
- var _as$split = as.split('#'),
- _as$split2 = _slicedToArray(_as$split, 2),
- newUrlNoHash = _as$split2[0],
- newHash = _as$split2[1]; // Makes sure we scroll to the provided hash if the url/hash are the same
-
-
- if (newHash && oldUrlNoHash === newUrlNoHash && oldHash === newHash) {
- return true;
- } // If the urls are change, there's more than a hash change
-
-
- if (oldUrlNoHash !== newUrlNoHash) {
- return false;
- } // If the hash has changed, then it's a hash only change.
- // This check is necessary to handle both the enter and
- // leave hash === '' cases. The identity case falls through
- // and is treated as a next reload.
-
-
- return oldHash !== newHash;
- }
- }, {
- key: "scrollToHash",
- value: function scrollToHash(as) {
- var _as$split3 = as.split('#'),
- _as$split4 = _slicedToArray(_as$split3, 2),
- hash = _as$split4[1]; // Scroll to top if the hash is just `#` with no value or `#top`
- // To mirror browsers
-
-
- if (hash === '' || hash === 'top') {
- window.scrollTo(0, 0);
- return;
- } // First we check if the element by id is found
-
-
- var idEl = document.getElementById(hash);
-
- if (idEl) {
- idEl.scrollIntoView();
- return;
- } // If there's no element with the id, we check the `name` property
- // To mirror browsers
-
-
- var nameEl = document.getElementsByName(hash)[0];
-
- if (nameEl) {
- nameEl.scrollIntoView();
- }
- }
- }, {
- key: "urlIsNew",
- value: function urlIsNew(asPath) {
- return this.asPath !== asPath;
- }
- /**
- * Prefetch page code, you may wait for the data during page rendering.
- * This feature only works in production!
- * @param url the href of prefetched page
- * @param asPath the as path of the prefetched page
- */
-
- }, {
- key: "prefetch",
- value: function () {
- var _prefetch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(url) {
- var _this3 = this;
-
- var asPath,
- options,
- parsed,
- pathname,
- parsedAs,
- localePathResult,
- pages,
- resolvedAs,
- rewrites,
- _yield2,
- rewritesResult,
- route,
- _args4 = arguments;
-
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
- while (1) {
- switch (_context4.prev = _context4.next) {
- case 0:
- asPath = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : url;
- options = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {};
- parsed = (0, _parseRelativeUrl.parseRelativeUrl)(url);
- pathname = parsed.pathname;
-
- if (true) {
- if (options.locale === false) {
- pathname = (0, _normalizeLocalePath.normalizeLocalePath)(pathname, this.locales).pathname;
- parsed.pathname = pathname;
- url = (0, _utils.formatWithValidation)(parsed);
- parsedAs = (0, _parseRelativeUrl.parseRelativeUrl)(asPath);
- localePathResult = (0, _normalizeLocalePath.normalizeLocalePath)(parsedAs.pathname, this.locales);
- parsedAs.pathname = localePathResult.pathname;
- options.locale = localePathResult.detectedLocale || this.defaultLocale;
- asPath = (0, _utils.formatWithValidation)(parsedAs);
- }
- }
-
- _context4.next = 7;
- return this.pageLoader.getPageList();
-
- case 7:
- pages = _context4.sent;
- resolvedAs = asPath;
-
- if (true) {
- _context4.next = 19;
- break;
- }
-
- _context4.next = 12;
- return (0, _routeLoader.getClientBuildManifest)();
-
- case 12:
- _yield2 = _context4.sent;
- rewrites = _yield2.__rewrites;
- rewritesResult = (0, _resolveRewrites["default"])(addBasePath(addLocale(asPath, this.locale)), pages, rewrites, parsed.query, function (p) {
- return resolveDynamicRoute(p, pages);
- }, this.locales);
- resolvedAs = delLocale(delBasePath(rewritesResult.asPath), this.locale);
-
- if (rewritesResult.matchedPage && rewritesResult.resolvedHref) {
- // if this directly matches a page we need to update the href to
- // allow the correct page chunk to be loaded
- pathname = rewritesResult.resolvedHref;
- parsed.pathname = pathname;
- url = (0, _utils.formatWithValidation)(parsed);
- }
-
- _context4.next = 21;
- break;
-
- case 19:
- parsed.pathname = resolveDynamicRoute(parsed.pathname, pages);
-
- if (parsed.pathname !== pathname) {
- pathname = parsed.pathname;
- url = (0, _utils.formatWithValidation)(parsed);
- }
-
- case 21:
- route = (0, _normalizeTrailingSlash.removePathTrailingSlash)(pathname); // Prefetch is not supported in development mode because it would trigger on-demand-entries
-
- if (false) {}
-
- return _context4.abrupt("return");
-
- case 24:
- _context4.next = 26;
- return Promise.all([this.pageLoader._isSsg(route).then(function (isSsg) {
- return isSsg ? _this3._getStaticData(_this3.pageLoader.getDataHref(url, resolvedAs, true, typeof options.locale !== 'undefined' ? options.locale : _this3.locale)) : false;
- }), this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](route)]);
-
- case 26:
- case "end":
- return _context4.stop();
- }
- }
- }, _callee4, this);
- }));
-
- function prefetch(_x18) {
- return _prefetch.apply(this, arguments);
- }
-
- return prefetch;
- }()
- }, {
- key: "fetchComponent",
- value: function () {
- var _fetchComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(route) {
- var cancelled, cancel, componentResult, error;
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
- while (1) {
- switch (_context5.prev = _context5.next) {
- case 0:
- cancelled = false;
-
- cancel = this.clc = function () {
- cancelled = true;
- };
-
- _context5.next = 4;
- return this.pageLoader.loadPage(route);
-
- case 4:
- componentResult = _context5.sent;
-
- if (!cancelled) {
- _context5.next = 9;
- break;
- }
-
- error = new Error("Abort fetching component for route: \"".concat(route, "\""));
- error.cancelled = true;
- throw error;
-
- case 9:
- if (cancel === this.clc) {
- this.clc = null;
- }
-
- return _context5.abrupt("return", componentResult);
-
- case 11:
- case "end":
- return _context5.stop();
- }
- }
- }, _callee5, this);
- }));
-
- function fetchComponent(_x19) {
- return _fetchComponent.apply(this, arguments);
- }
-
- return fetchComponent;
- }()
- }, {
- key: "_getData",
- value: function _getData(fn) {
- var _this4 = this;
-
- var cancelled = false;
-
- var cancel = function cancel() {
- cancelled = true;
- };
-
- this.clc = cancel;
- return fn().then(function (data) {
- if (cancel === _this4.clc) {
- _this4.clc = null;
- }
-
- if (cancelled) {
- var err = new Error('Loading initial props cancelled');
- err.cancelled = true;
- throw err;
- }
-
- return data;
- });
- }
- }, {
- key: "_getStaticData",
- value: function _getStaticData(dataHref) {
- var _this5 = this;
-
- var _URL = new URL(dataHref, window.location.href),
- cacheKey = _URL.href;
-
- if (false) {}
-
- return fetchNextData(dataHref, this.isSsr).then(function (data) {
- _this5.sdc[cacheKey] = data;
- return data;
- });
- }
- }, {
- key: "_getServerData",
- value: function _getServerData(dataHref) {
- var _this6 = this;
-
- var _URL2 = new URL(dataHref, window.location.href),
- resourceKey = _URL2.href;
-
- if (this.sdr[resourceKey]) {
- return this.sdr[resourceKey];
- }
-
- return this.sdr[resourceKey] = fetchNextData(dataHref, this.isSsr).then(function (data) {
- delete _this6.sdr[resourceKey];
- return data;
- })["catch"](function (err) {
- delete _this6.sdr[resourceKey];
- throw err;
- });
- }
- }, {
- key: "getInitialProps",
- value: function getInitialProps(Component, ctx) {
- var App = this.components['/_app'].Component;
-
- var AppTree = this._wrapApp(App);
-
- ctx.AppTree = AppTree;
- return (0, _utils.loadGetInitialProps)(App, {
- AppTree: AppTree,
- Component: Component,
- router: this,
- ctx: ctx
- });
- }
- }, {
- key: "abortComponentLoad",
- value: function abortComponentLoad(as, routeProps) {
- if (this.clc) {
- Router.events.emit('routeChangeError', buildCancellationError(), as, routeProps);
- this.clc();
- this.clc = null;
- }
- }
- }, {
- key: "notify",
- value: function notify(data, resetScroll) {
- return this.sub(data, this.components['/_app'].Component, resetScroll);
- }
- }]);
-
- return Router;
-}();
-
-exports.default = Router;
-Router.events = (0, _mitt["default"])();
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/next-server/lib/router/utils/format-url.js":
-/*!***************************************************************************!*\
- !*** ./node_modules/next/dist/next-server/lib/router/utils/format-url.js ***!
- \***************************************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-exports.__esModule = true;
-exports.formatUrl = formatUrl;
-
-var querystring = _interopRequireWildcard(__webpack_require__(/*! ./querystring */ "./node_modules/next/dist/next-server/lib/router/utils/querystring.js"));
-
-function _getRequireWildcardCache() {
- if (typeof WeakMap !== "function") return null;
- var cache = new WeakMap();
-
- _getRequireWildcardCache = function _getRequireWildcardCache() {
- return cache;
- };
-
- return cache;
-}
-
-function _interopRequireWildcard(obj) {
- if (obj && obj.__esModule) {
- return obj;
- }
-
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
- return {
- "default": obj
- };
- }
-
- var cache = _getRequireWildcardCache();
-
- if (cache && cache.has(obj)) {
- return cache.get(obj);
- }
-
- var newObj = {};
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
-
- for (var key in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
-
- if (desc && (desc.get || desc.set)) {
- Object.defineProperty(newObj, key, desc);
- } else {
- newObj[key] = obj[key];
- }
- }
- }
-
- newObj["default"] = obj;
-
- if (cache) {
- cache.set(obj, newObj);
- }
-
- return newObj;
-} // Format function modified from nodejs
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission 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:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE 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.
-
-
-var slashedProtocols = /https?|ftp|gopher|file/;
-
-function formatUrl(urlObj) {
- var auth = urlObj.auth,
- hostname = urlObj.hostname;
- var protocol = urlObj.protocol || '';
- var pathname = urlObj.pathname || '';
- var hash = urlObj.hash || '';
- var query = urlObj.query || '';
- var host = false;
- auth = auth ? encodeURIComponent(auth).replace(/%3A/i, ':') + '@' : '';
-
- if (urlObj.host) {
- host = auth + urlObj.host;
- } else if (hostname) {
- host = auth + (~hostname.indexOf(':') ? "[".concat(hostname, "]") : hostname);
-
- if (urlObj.port) {
- host += ':' + urlObj.port;
- }
- }
-
- if (query && typeof query === 'object') {
- query = String(querystring.urlQueryToSearchParams(query));
- }
-
- var search = urlObj.search || query && "?".concat(query) || '';
- if (protocol && protocol.substr(-1) !== ':') protocol += ':';
-
- if (urlObj.slashes || (!protocol || slashedProtocols.test(protocol)) && host !== false) {
- host = '//' + (host || '');
- if (pathname && pathname[0] !== '/') pathname = '/' + pathname;
- } else if (!host) {
- host = '';
- }
-
- if (hash && hash[0] !== '#') hash = '#' + hash;
- if (search && search[0] !== '?') search = '?' + search;
- pathname = pathname.replace(/[?#]/g, encodeURIComponent);
- search = search.replace('#', '%23');
- return "".concat(protocol).concat(host).concat(pathname).concat(search).concat(hash);
-}
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/next-server/lib/router/utils/get-asset-path-from-route.js":
-/*!******************************************************************************************!*\
- !*** ./node_modules/next/dist/next-server/lib/router/utils/get-asset-path-from-route.js ***!
- \******************************************************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-exports.__esModule = true;
-exports.default = getAssetPathFromRoute; // Translates a logical route into its pages asset path (relative from a common prefix)
-// "asset path" being its javascript file, data file, prerendered html,...
-
-function getAssetPathFromRoute(route) {
- var ext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
- var path = route === '/' ? '/index' : /^\/index(\/|$)/.test(route) ? "/index".concat(route) : "".concat(route);
- return path + ext;
-}
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/next-server/lib/router/utils/is-dynamic.js":
-/*!***************************************************************************!*\
- !*** ./node_modules/next/dist/next-server/lib/router/utils/is-dynamic.js ***!
- \***************************************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-exports.__esModule = true;
-exports.isDynamicRoute = isDynamicRoute; // Identify /[param]/ in route string
-
-var TEST_ROUTE = /\/\[[^/]+?\](?=\/|$)/;
-
-function isDynamicRoute(route) {
- return TEST_ROUTE.test(route);
-}
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/next-server/lib/router/utils/parse-relative-url.js":
-/*!***********************************************************************************!*\
- !*** ./node_modules/next/dist/next-server/lib/router/utils/parse-relative-url.js ***!
- \***********************************************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-exports.__esModule = true;
-exports.parseRelativeUrl = parseRelativeUrl;
-
-var _utils = __webpack_require__(/*! ../../utils */ "./node_modules/next/dist/next-server/lib/utils.js");
-
-var _querystring = __webpack_require__(/*! ./querystring */ "./node_modules/next/dist/next-server/lib/router/utils/querystring.js");
-/**
-* Parses path-relative urls (e.g. `/hello/world?foo=bar`). If url isn't path-relative
-* (e.g. `./hello`) then at least base must be.
-* Absolute urls are rejected with one exception, in the browser, absolute urls that are on
-* the current origin will be parsed as relative
-*/
-
-
-function parseRelativeUrl(url, base) {
- var globalBase = new URL( false ? 0 : (0, _utils.getLocationOrigin)());
- var resolvedBase = base ? new URL(base, globalBase) : globalBase;
-
- var _URL = new URL(url, resolvedBase),
- pathname = _URL.pathname,
- searchParams = _URL.searchParams,
- search = _URL.search,
- hash = _URL.hash,
- href = _URL.href,
- origin = _URL.origin;
-
- if (origin !== globalBase.origin) {
- throw new Error("invariant: invalid relative URL, router received ".concat(url));
- }
-
- return {
- pathname: pathname,
- query: (0, _querystring.searchParamsToUrlQuery)(searchParams),
- search: search,
- hash: hash,
- href: href.slice(globalBase.origin.length)
- };
-}
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/next-server/lib/router/utils/querystring.js":
-/*!****************************************************************************!*\
- !*** ./node_modules/next/dist/next-server/lib/router/utils/querystring.js ***!
- \****************************************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-var _slicedToArray = __webpack_require__(/*! ./node_modules/next/node_modules/@babel/runtime/helpers/slicedToArray */ "./node_modules/next/node_modules/@babel/runtime/helpers/slicedToArray.js");
-
-exports.__esModule = true;
-exports.searchParamsToUrlQuery = searchParamsToUrlQuery;
-exports.urlQueryToSearchParams = urlQueryToSearchParams;
-exports.assign = assign;
-
-function searchParamsToUrlQuery(searchParams) {
- var query = {};
- searchParams.forEach(function (value, key) {
- if (typeof query[key] === 'undefined') {
- query[key] = value;
- } else if (Array.isArray(query[key])) {
- ;
- query[key].push(value);
- } else {
- query[key] = [query[key], value];
- }
- });
- return query;
-}
-
-function stringifyUrlQueryParam(param) {
- if (typeof param === 'string' || typeof param === 'number' && !isNaN(param) || typeof param === 'boolean') {
- return String(param);
- } else {
- return '';
- }
-}
-
-function urlQueryToSearchParams(urlQuery) {
- var result = new URLSearchParams();
- Object.entries(urlQuery).forEach(function (_ref) {
- var _ref2 = _slicedToArray(_ref, 2),
- key = _ref2[0],
- value = _ref2[1];
-
- if (Array.isArray(value)) {
- value.forEach(function (item) {
- return result.append(key, stringifyUrlQueryParam(item));
- });
- } else {
- result.set(key, stringifyUrlQueryParam(value));
- }
- });
- return result;
-}
-
-function assign(target) {
- for (var _len = arguments.length, searchParamsList = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- searchParamsList[_key - 1] = arguments[_key];
- }
-
- searchParamsList.forEach(function (searchParams) {
- Array.from(searchParams.keys()).forEach(function (key) {
- return target["delete"](key);
- });
- searchParams.forEach(function (value, key) {
- return target.append(key, value);
- });
- });
- return target;
-}
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/next-server/lib/router/utils/route-matcher.js":
-/*!******************************************************************************!*\
- !*** ./node_modules/next/dist/next-server/lib/router/utils/route-matcher.js ***!
- \******************************************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-exports.__esModule = true;
-exports.getRouteMatcher = getRouteMatcher;
-
-function getRouteMatcher(routeRegex) {
- var re = routeRegex.re,
- groups = routeRegex.groups;
- return function (pathname) {
- var routeMatch = re.exec(pathname);
-
- if (!routeMatch) {
- return false;
- }
-
- var decode = function decode(param) {
- try {
- return decodeURIComponent(param);
- } catch (_) {
- var err = new Error('failed to decode param');
- err.code = 'DECODE_FAILED';
- throw err;
- }
- };
-
- var params = {};
- Object.keys(groups).forEach(function (slugName) {
- var g = groups[slugName];
- var m = routeMatch[g.pos];
-
- if (m !== undefined) {
- params[slugName] = ~m.indexOf('/') ? m.split('/').map(function (entry) {
- return decode(entry);
- }) : g.repeat ? [decode(m)] : decode(m);
- }
- });
- return params;
- };
-}
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/next-server/lib/router/utils/route-regex.js":
-/*!****************************************************************************!*\
- !*** ./node_modules/next/dist/next-server/lib/router/utils/route-regex.js ***!
- \****************************************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-exports.__esModule = true;
-exports.getRouteRegex = getRouteRegex; // this isn't importing the escape-string-regex module
-// to reduce bytes
-
-function escapeRegex(str) {
- return str.replace(/[|\\{}()[\]^$+*?.-]/g, '\\$&');
-}
-
-function parseParameter(param) {
- var optional = param.startsWith('[') && param.endsWith(']');
-
- if (optional) {
- param = param.slice(1, -1);
- }
-
- var repeat = param.startsWith('...');
-
- if (repeat) {
- param = param.slice(3);
- }
-
- return {
- key: param,
- repeat: repeat,
- optional: optional
- };
-}
-
-function getRouteRegex(normalizedRoute) {
- var segments = (normalizedRoute.replace(/\/$/, '') || '/').slice(1).split('/');
- var groups = {};
- var groupIndex = 1;
- var parameterizedRoute = segments.map(function (segment) {
- if (segment.startsWith('[') && segment.endsWith(']')) {
- var _parseParameter = parseParameter(segment.slice(1, -1)),
- key = _parseParameter.key,
- optional = _parseParameter.optional,
- repeat = _parseParameter.repeat;
-
- groups[key] = {
- pos: groupIndex++,
- repeat: repeat,
- optional: optional
- };
- return repeat ? optional ? '(?:/(.+?))?' : '/(.+?)' : '/([^/]+?)';
- } else {
- return "/".concat(escapeRegex(segment));
- }
- }).join(''); // dead code eliminate for browser since it's only needed
- // while generating routes-manifest
-
- if (false) { var namedParameterizedRoute, routeKeys, getSafeRouteKey, routeKeyCharLength, routeKeyCharCode; }
-
- return {
- re: new RegExp("^".concat(parameterizedRoute, "(?:/)?$")),
- groups: groups
- };
-}
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/next/dist/next-server/lib/utils.js":
-/*!*********************************************************!*\
- !*** ./node_modules/next/dist/next-server/lib/utils.js ***!
- \*********************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* module decorator */ module = __webpack_require__.nmd(module);
-
-
-var _regeneratorRuntime = __webpack_require__(/*! ./node_modules/next/node_modules/@babel/runtime/regenerator */ "./node_modules/next/node_modules/@babel/runtime/regenerator/index.js");
-
-var _asyncToGenerator = __webpack_require__(/*! ./node_modules/next/node_modules/@babel/runtime/helpers/asyncToGenerator */ "./node_modules/next/node_modules/@babel/runtime/helpers/asyncToGenerator.js");
-
-exports.__esModule = true;
-exports.execOnce = execOnce;
-exports.getLocationOrigin = getLocationOrigin;
-exports.getURL = getURL;
-exports.getDisplayName = getDisplayName;
-exports.isResSent = isResSent;
-exports.loadGetInitialProps = loadGetInitialProps;
-exports.formatWithValidation = formatWithValidation;
-exports.ST = exports.SP = exports.urlObjectKeys = void 0;
-
-var _formatUrl = __webpack_require__(/*! ./router/utils/format-url */ "./node_modules/next/dist/next-server/lib/router/utils/format-url.js");
-/**
-* Utils
-*/
-
-
-function execOnce(fn) {
- var used = false;
- var result;
- return function () {
- if (!used) {
- used = true;
- result = fn.apply(void 0, arguments);
- }
-
- return result;
- };
-}
-
-function getLocationOrigin() {
- var _window$location = window.location,
- protocol = _window$location.protocol,
- hostname = _window$location.hostname,
- port = _window$location.port;
- return "".concat(protocol, "//").concat(hostname).concat(port ? ':' + port : '');
-}
-
-function getURL() {
- var href = window.location.href;
- var origin = getLocationOrigin();
- return href.substring(origin.length);
-}
-
-function getDisplayName(Component) {
- return typeof Component === 'string' ? Component : Component.displayName || Component.name || 'Unknown';
-}
-
-function isResSent(res) {
- return res.finished || res.headersSent;
-}
-
-function loadGetInitialProps(_x, _x2) {
- return _loadGetInitialProps.apply(this, arguments);
-}
-
-function _loadGetInitialProps() {
- _loadGetInitialProps = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(App, ctx) {
- var _App$prototype, message, res, props, _message;
-
- return _regeneratorRuntime.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- if (false) {}
-
- if (!((_App$prototype = App.prototype) != null && _App$prototype.getInitialProps)) {
- _context.next = 4;
- break;
- }
-
- message = "\"".concat(getDisplayName(App), ".getInitialProps()\" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.");
- throw new Error(message);
-
- case 4:
- // when called from _app `ctx` is nested in `ctx`
- res = ctx.res || ctx.ctx && ctx.ctx.res;
-
- if (App.getInitialProps) {
- _context.next = 12;
- break;
- }
-
- if (!(ctx.ctx && ctx.Component)) {
- _context.next = 11;
- break;
- }
-
- _context.next = 9;
- return loadGetInitialProps(ctx.Component, ctx.ctx);
-
- case 9:
- _context.t0 = _context.sent;
- return _context.abrupt("return", {
- pageProps: _context.t0
- });
-
- case 11:
- return _context.abrupt("return", {});
-
- case 12:
- _context.next = 14;
- return App.getInitialProps(ctx);
-
- case 14:
- props = _context.sent;
-
- if (!(res && isResSent(res))) {
- _context.next = 17;
- break;
- }
-
- return _context.abrupt("return", props);
-
- case 17:
- if (props) {
- _context.next = 20;
- break;
- }
-
- _message = "\"".concat(getDisplayName(App), ".getInitialProps()\" should resolve to an object. But found \"").concat(props, "\" instead.");
- throw new Error(_message);
-
- case 20:
- if (true) {
- if (Object.keys(props).length === 0 && !ctx.ctx) {
- console.warn("".concat(getDisplayName(App), " returned an empty object from `getInitialProps`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps"));
- }
- }
-
- return _context.abrupt("return", props);
-
- case 22:
- case "end":
- return _context.stop();
- }
- }
- }, _callee);
- }));
- return _loadGetInitialProps.apply(this, arguments);
-}
-
-var urlObjectKeys = ['auth', 'hash', 'host', 'hostname', 'href', 'path', 'pathname', 'port', 'protocol', 'query', 'search', 'slashes'];
-exports.urlObjectKeys = urlObjectKeys;
-
-function formatWithValidation(url) {
- if (true) {
- if (url !== null && typeof url === 'object') {
- Object.keys(url).forEach(function (key) {
- if (urlObjectKeys.indexOf(key) === -1) {
- console.warn("Unknown key passed via urlObject into url.format: ".concat(key));
- }
- });
- }
- }
-
- return (0, _formatUrl.formatUrl)(url);
-}
-
-var SP = typeof performance !== 'undefined';
-exports.SP = SP;
-var ST = SP && typeof performance.mark === 'function' && typeof performance.measure === 'function';
-exports.ST = ST;
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./pages/yamaha/Product/Motor_Detail.js":
-/*!**********************************************!*\
- !*** ./pages/yamaha/Product/Motor_Detail.js ***!
- \**********************************************/
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "__N_SSP": function() { return /* binding */ __N_SSP; }
-/* harmony export */ });
-/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-dev-runtime */ "./node_modules/react/jsx-dev-runtime.js");
-/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var E_Project_Templae_tbg_company_ecomm_web_node_modules_next_node_modules_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/next/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/next/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _components_App_NavbarYamaha__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/_App/NavbarYamaha */ "./components/_App/NavbarYamaha.js");
-/* harmony import */ var _components_App_FooterYamaha__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/_App/FooterYamaha */ "./components/_App/FooterYamaha.js");
-/* harmony import */ var _components_Yamaha_Product_Motor_Detail__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/Yamaha/Product/Motor_Detail */ "./components/Yamaha/Product/Motor_Detail.js");
-/* module decorator */ module = __webpack_require__.hmd(module);
-
-
-
-var _jsxFileName = "E:\\Project\\Templae\\tbg-company-ecomm-web\\pages\\yamaha\\Product\\Motor_Detail.js";
-
-
-
-
-
-var Shop = function Shop(_ref) {
- var detailproduct = _ref.detailproduct,
- backend = _ref.backend,
- user = _ref.user,
- props = (0,E_Project_Templae_tbg_company_ecomm_web_node_modules_next_node_modules_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__.default)(_ref, ["detailproduct", "backend", "user"]);
-
- return /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
- children: [/*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_components_App_NavbarYamaha__WEBPACK_IMPORTED_MODULE_3__.default, {}, void 0, false, {
- fileName: _jsxFileName,
- lineNumber: 13,
- columnNumber: 13
- }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_components_Yamaha_Product_Motor_Detail__WEBPACK_IMPORTED_MODULE_5__.default, {
- detailproduct: detailproduct,
- backend: backend,
- user: user
- }, void 0, false, {
- fileName: _jsxFileName,
- lineNumber: 15,
- columnNumber: 13
- }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_components_App_FooterYamaha__WEBPACK_IMPORTED_MODULE_4__.default, {}, void 0, false, {
- fileName: _jsxFileName,
- lineNumber: 17,
- columnNumber: 13
- }, this)]
- }, void 0, true);
-};
-
-_c = Shop;
-var __N_SSP = true;
-/* harmony default export */ __webpack_exports__["default"] = (Shop);
-
-var _c;
-
-$RefreshReg$(_c, "Shop");
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./utils/ActiveLink.js":
-/*!*****************************!*\
- !*** ./utils/ActiveLink.js ***!
- \*****************************/
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var E_Project_Templae_tbg_company_ecomm_web_node_modules_next_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/next/node_modules/@babel/runtime/helpers/esm/defineProperty */ "./node_modules/next/node_modules/@babel/runtime/helpers/esm/defineProperty.js");
-/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-dev-runtime */ "./node_modules/react/jsx-dev-runtime.js");
-/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var E_Project_Templae_tbg_company_ecomm_web_node_modules_next_node_modules_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/next/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/next/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
-/* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! next/router */ "./node_modules/next/router.js");
-/* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_router__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! next/link */ "./node_modules/next/link.js");
-/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
-/* module decorator */ module = __webpack_require__.hmd(module);
-
-
-
-
-var _jsxFileName = "E:\\Project\\Templae\\tbg-company-ecomm-web\\utils\\ActiveLink.js",
- _this = undefined;
-
-function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
-
-function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0,E_Project_Templae_tbg_company_ecomm_web_node_modules_next_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
-
-
-
-
-
-var ActiveLink = function ActiveLink(_ref) {
- var router = _ref.router,
- children = _ref.children,
- props = (0,E_Project_Templae_tbg_company_ecomm_web_node_modules_next_node_modules_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__.default)(_ref, ["router", "children"]);
-
- var child = react__WEBPACK_IMPORTED_MODULE_5__.Children.only(children);
- var className = child.props.className || '';
-
- if (router.pathname === props.href && props.activeClassName) {
- className = "".concat(className, " ").concat(props.activeClassName).trim();
- }
-
- delete props.activeClassName;
- return /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxDEV)((next_link__WEBPACK_IMPORTED_MODULE_4___default()), _objectSpread(_objectSpread({}, props), {}, {
- children: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default().cloneElement(child, {
- className: className
- })
- }), void 0, false, {
- fileName: _jsxFileName,
- lineNumber: 15,
- columnNumber: 12
- }, _this);
-};
-
-_c = ActiveLink;
-/* harmony default export */ __webpack_exports__["default"] = (_c2 = (0,next_router__WEBPACK_IMPORTED_MODULE_3__.withRouter)(ActiveLink));
-
-var _c, _c2;
-
-$RefreshReg$(_c, "ActiveLink");
-$RefreshReg$(_c2, "%default%");
-
-;
- var _a, _b;
- // Legacy CSS implementations will `eval` browser code in a Node.js context
- // to extract CSS. For backwards compatibility, we need to check we're in a
- // browser context before continuing.
- if (typeof self !== 'undefined' &&
- // AMP / No-JS mode does not inject these helpers:
- '$RefreshHelpers$' in self) {
- var currentExports = module.__proto__.exports;
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
- // This cannot happen in MainTemplate because the exports mismatch between
- // templating and execution.
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
- // A module can be accepted automatically based on its exports, e.g. when
- // it is a Refresh Boundary.
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
- // Save the previous exports on update so we can compare the boundary
- // signatures.
- module.hot.dispose(function (data) {
- data.prevExports = currentExports;
- });
- // Unconditionally accept an update to this module, we'll check if it's
- // still a Refresh Boundary later.
- module.hot.accept();
- // This field is set when the previous version of this module was a
- // Refresh Boundary, letting us know we need to check for invalidation or
- // enqueue an update.
- if (prevExports !== null) {
- // A boundary can become ineligible if its exports are incompatible
- // with the previous exports.
- //
- // For example, if you add/remove/change exports, we'll want to
- // re-execute the importing modules, and force those components to
- // re-render. Similarly, if you convert a class component to a
- // function, we want to invalidate the boundary.
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
- module.hot.invalidate();
- }
- else {
- self.$RefreshHelpers$.scheduleUpdate();
- }
- }
- }
- else {
- // Since we just executed the code for the module, it's possible that the
- // new exports made it ineligible for being a boundary.
- // We only care about the case when we were _previously_ a boundary,
- // because we already accepted this update (accidental side effect).
- var isNoLongerABoundary = prevExports !== null;
- if (isNoLongerABoundary) {
- module.hot.invalidate();
- }
- }
- }
-
-
-/***/ }),
-
-/***/ "./node_modules/base64-js/index.js":
-/*!*****************************************!*\
- !*** ./node_modules/base64-js/index.js ***!
- \*****************************************/
-/***/ (function(__unused_webpack_module, exports) {
-
-"use strict";
-
-
-exports.byteLength = byteLength
-exports.toByteArray = toByteArray
-exports.fromByteArray = fromByteArray
-
-var lookup = []
-var revLookup = []
-var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
-
-var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
-for (var i = 0, len = code.length; i < len; ++i) {
- lookup[i] = code[i]
- revLookup[code.charCodeAt(i)] = i
-}
-
-// Support decoding URL-safe base64 strings, as Node.js does.
-// See: https://en.wikipedia.org/wiki/Base64#URL_applications
-revLookup['-'.charCodeAt(0)] = 62
-revLookup['_'.charCodeAt(0)] = 63
-
-function getLens (b64) {
- var len = b64.length
-
- if (len % 4 > 0) {
- throw new Error('Invalid string. Length must be a multiple of 4')
- }
-
- // Trim off extra bytes after placeholder bytes are found
- // See: https://github.com/beatgammit/base64-js/issues/42
- var validLen = b64.indexOf('=')
- if (validLen === -1) validLen = len
-
- var placeHoldersLen = validLen === len
- ? 0
- : 4 - (validLen % 4)
-
- return [validLen, placeHoldersLen]
-}
-
-// base64 is 4/3 + up to two characters of the original data
-function byteLength (b64) {
- var lens = getLens(b64)
- var validLen = lens[0]
- var placeHoldersLen = lens[1]
- return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
-}
-
-function _byteLength (b64, validLen, placeHoldersLen) {
- return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
-}
-
-function toByteArray (b64) {
- var tmp
- var lens = getLens(b64)
- var validLen = lens[0]
- var placeHoldersLen = lens[1]
-
- var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
-
- var curByte = 0
-
- // if there are placeholders, only get up to the last complete 4 chars
- var len = placeHoldersLen > 0
- ? validLen - 4
- : validLen
-
- var i
- for (i = 0; i < len; i += 4) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 18) |
- (revLookup[b64.charCodeAt(i + 1)] << 12) |
- (revLookup[b64.charCodeAt(i + 2)] << 6) |
- revLookup[b64.charCodeAt(i + 3)]
- arr[curByte++] = (tmp >> 16) & 0xFF
- arr[curByte++] = (tmp >> 8) & 0xFF
- arr[curByte++] = tmp & 0xFF
- }
-
- if (placeHoldersLen === 2) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 2) |
- (revLookup[b64.charCodeAt(i + 1)] >> 4)
- arr[curByte++] = tmp & 0xFF
- }
-
- if (placeHoldersLen === 1) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 10) |
- (revLookup[b64.charCodeAt(i + 1)] << 4) |
- (revLookup[b64.charCodeAt(i + 2)] >> 2)
- arr[curByte++] = (tmp >> 8) & 0xFF
- arr[curByte++] = tmp & 0xFF
- }
-
- return arr
-}
-
-function tripletToBase64 (num) {
- return lookup[num >> 18 & 0x3F] +
- lookup[num >> 12 & 0x3F] +
- lookup[num >> 6 & 0x3F] +
- lookup[num & 0x3F]
-}
-
-function encodeChunk (uint8, start, end) {
- var tmp
- var output = []
- for (var i = start; i < end; i += 3) {
- tmp =
- ((uint8[i] << 16) & 0xFF0000) +
- ((uint8[i + 1] << 8) & 0xFF00) +
- (uint8[i + 2] & 0xFF)
- output.push(tripletToBase64(tmp))
- }
- return output.join('')
-}
-
-function fromByteArray (uint8) {
- var tmp
- var len = uint8.length
- var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
- var parts = []
- var maxChunkLength = 16383 // must be multiple of 3
-
- // go through the array every three bytes, we'll deal with trailing stuff later
- for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
- parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
- }
-
- // pad the end with zeros, but make sure to not forget the extra bytes
- if (extraBytes === 1) {
- tmp = uint8[len - 1]
- parts.push(
- lookup[tmp >> 2] +
- lookup[(tmp << 4) & 0x3F] +
- '=='
- )
- } else if (extraBytes === 2) {
- tmp = (uint8[len - 2] << 8) + uint8[len - 1]
- parts.push(
- lookup[tmp >> 10] +
- lookup[(tmp >> 4) & 0x3F] +
- lookup[(tmp << 2) & 0x3F] +
- '='
- )
- }
-
- return parts.join('')
-}
-
-
-/***/ }),
-
-/***/ "./node_modules/buffer/index.js":
-/*!**************************************!*\
- !*** ./node_modules/buffer/index.js ***!
- \**************************************/
-/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh
- * @license MIT
- */
-/* eslint-disable no-proto */
-
-
-
-var base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js")
-var ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js")
-var customInspectSymbol =
- (typeof Symbol === 'function' && typeof Symbol.for === 'function')
- ? Symbol.for('nodejs.util.inspect.custom')
- : null
-
-exports.Buffer = Buffer
-exports.SlowBuffer = SlowBuffer
-exports.INSPECT_MAX_BYTES = 50
-
-var K_MAX_LENGTH = 0x7fffffff
-exports.kMaxLength = K_MAX_LENGTH
-
-/**
- * If `Buffer.TYPED_ARRAY_SUPPORT`:
- * === true Use Uint8Array implementation (fastest)
- * === false Print warning and recommend using `buffer` v4.x which has an Object
- * implementation (most compatible, even IE6)
- *
- * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
- * Opera 11.6+, iOS 4.2+.
- *
- * We report that the browser does not support typed arrays if the are not subclassable
- * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
- * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
- * for __proto__ and has a buggy typed array implementation.
- */
-Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
-
-if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
- typeof console.error === 'function') {
- console.error(
- 'This browser lacks typed array (Uint8Array) support which is required by ' +
- '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
- )
-}
-
-function typedArraySupport () {
- // Can typed array instances can be augmented?
- try {
- var arr = new Uint8Array(1)
- var proto = { foo: function () { return 42 } }
- Object.setPrototypeOf(proto, Uint8Array.prototype)
- Object.setPrototypeOf(arr, proto)
- return arr.foo() === 42
- } catch (e) {
- return false
- }
-}
-
-Object.defineProperty(Buffer.prototype, 'parent', {
- enumerable: true,
- get: function () {
- if (!Buffer.isBuffer(this)) return undefined
- return this.buffer
- }
-})
-
-Object.defineProperty(Buffer.prototype, 'offset', {
- enumerable: true,
- get: function () {
- if (!Buffer.isBuffer(this)) return undefined
- return this.byteOffset
- }
-})
-
-function createBuffer (length) {
- if (length > K_MAX_LENGTH) {
- throw new RangeError('The value "' + length + '" is invalid for option "size"')
- }
- // Return an augmented `Uint8Array` instance
- var buf = new Uint8Array(length)
- Object.setPrototypeOf(buf, Buffer.prototype)
- return buf
-}
-
-/**
- * The Buffer constructor returns instances of `Uint8Array` that have their
- * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
- * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
- * and the `Uint8Array` methods. Square bracket notation works as expected -- it
- * returns a single octet.
- *
- * The `Uint8Array` prototype remains unmodified.
- */
-
-function Buffer (arg, encodingOrOffset, length) {
- // Common case.
- if (typeof arg === 'number') {
- if (typeof encodingOrOffset === 'string') {
- throw new TypeError(
- 'The "string" argument must be of type string. Received type number'
- )
- }
- return allocUnsafe(arg)
- }
- return from(arg, encodingOrOffset, length)
-}
-
-Buffer.poolSize = 8192 // not used by this implementation
-
-function from (value, encodingOrOffset, length) {
- if (typeof value === 'string') {
- return fromString(value, encodingOrOffset)
- }
-
- if (ArrayBuffer.isView(value)) {
- return fromArrayLike(value)
- }
-
- if (value == null) {
- throw new TypeError(
- 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
- 'or Array-like Object. Received type ' + (typeof value)
- )
- }
-
- if (isInstance(value, ArrayBuffer) ||
- (value && isInstance(value.buffer, ArrayBuffer))) {
- return fromArrayBuffer(value, encodingOrOffset, length)
- }
-
- if (typeof SharedArrayBuffer !== 'undefined' &&
- (isInstance(value, SharedArrayBuffer) ||
- (value && isInstance(value.buffer, SharedArrayBuffer)))) {
- return fromArrayBuffer(value, encodingOrOffset, length)
- }
-
- if (typeof value === 'number') {
- throw new TypeError(
- 'The "value" argument must not be of type number. Received type number'
- )
- }
-
- var valueOf = value.valueOf && value.valueOf()
- if (valueOf != null && valueOf !== value) {
- return Buffer.from(valueOf, encodingOrOffset, length)
- }
-
- var b = fromObject(value)
- if (b) return b
-
- if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&
- typeof value[Symbol.toPrimitive] === 'function') {
- return Buffer.from(
- value[Symbol.toPrimitive]('string'), encodingOrOffset, length
- )
- }
-
- throw new TypeError(
- 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
- 'or Array-like Object. Received type ' + (typeof value)
- )
-}
-
-/**
- * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
- * if value is a number.
- * Buffer.from(str[, encoding])
- * Buffer.from(array)
- * Buffer.from(buffer)
- * Buffer.from(arrayBuffer[, byteOffset[, length]])
- **/
-Buffer.from = function (value, encodingOrOffset, length) {
- return from(value, encodingOrOffset, length)
-}
-
-// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
-// https://github.com/feross/buffer/pull/148
-Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)
-Object.setPrototypeOf(Buffer, Uint8Array)
-
-function assertSize (size) {
- if (typeof size !== 'number') {
- throw new TypeError('"size" argument must be of type number')
- } else if (size < 0) {
- throw new RangeError('The value "' + size + '" is invalid for option "size"')
- }
-}
-
-function alloc (size, fill, encoding) {
- assertSize(size)
- if (size <= 0) {
- return createBuffer(size)
- }
- if (fill !== undefined) {
- // Only pay attention to encoding if it's a string. This
- // prevents accidentally sending in a number that would
- // be interpretted as a start offset.
- return typeof encoding === 'string'
- ? createBuffer(size).fill(fill, encoding)
- : createBuffer(size).fill(fill)
- }
- return createBuffer(size)
-}
-
-/**
- * Creates a new filled Buffer instance.
- * alloc(size[, fill[, encoding]])
- **/
-Buffer.alloc = function (size, fill, encoding) {
- return alloc(size, fill, encoding)
-}
-
-function allocUnsafe (size) {
- assertSize(size)
- return createBuffer(size < 0 ? 0 : checked(size) | 0)
-}
-
-/**
- * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
- * */
-Buffer.allocUnsafe = function (size) {
- return allocUnsafe(size)
-}
-/**
- * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
- */
-Buffer.allocUnsafeSlow = function (size) {
- return allocUnsafe(size)
-}
-
-function fromString (string, encoding) {
- if (typeof encoding !== 'string' || encoding === '') {
- encoding = 'utf8'
- }
-
- if (!Buffer.isEncoding(encoding)) {
- throw new TypeError('Unknown encoding: ' + encoding)
- }
-
- var length = byteLength(string, encoding) | 0
- var buf = createBuffer(length)
-
- var actual = buf.write(string, encoding)
-
- if (actual !== length) {
- // Writing a hex string, for example, that contains invalid characters will
- // cause everything after the first invalid character to be ignored. (e.g.
- // 'abxxcd' will be treated as 'ab')
- buf = buf.slice(0, actual)
- }
-
- return buf
-}
-
-function fromArrayLike (array) {
- var length = array.length < 0 ? 0 : checked(array.length) | 0
- var buf = createBuffer(length)
- for (var i = 0; i < length; i += 1) {
- buf[i] = array[i] & 255
- }
- return buf
-}
-
-function fromArrayBuffer (array, byteOffset, length) {
- if (byteOffset < 0 || array.byteLength < byteOffset) {
- throw new RangeError('"offset" is outside of buffer bounds')
- }
-
- if (array.byteLength < byteOffset + (length || 0)) {
- throw new RangeError('"length" is outside of buffer bounds')
- }
-
- var buf
- if (byteOffset === undefined && length === undefined) {
- buf = new Uint8Array(array)
- } else if (length === undefined) {
- buf = new Uint8Array(array, byteOffset)
- } else {
- buf = new Uint8Array(array, byteOffset, length)
- }
-
- // Return an augmented `Uint8Array` instance
- Object.setPrototypeOf(buf, Buffer.prototype)
-
- return buf
-}
-
-function fromObject (obj) {
- if (Buffer.isBuffer(obj)) {
- var len = checked(obj.length) | 0
- var buf = createBuffer(len)
-
- if (buf.length === 0) {
- return buf
- }
-
- obj.copy(buf, 0, 0, len)
- return buf
- }
-
- if (obj.length !== undefined) {
- if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
- return createBuffer(0)
- }
- return fromArrayLike(obj)
- }
-
- if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
- return fromArrayLike(obj.data)
- }
-}
-
-function checked (length) {
- // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
- // length is NaN (which is otherwise coerced to zero.)
- if (length >= K_MAX_LENGTH) {
- throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
- 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
- }
- return length | 0
-}
-
-function SlowBuffer (length) {
- if (+length != length) { // eslint-disable-line eqeqeq
- length = 0
- }
- return Buffer.alloc(+length)
-}
-
-Buffer.isBuffer = function isBuffer (b) {
- return b != null && b._isBuffer === true &&
- b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false
-}
-
-Buffer.compare = function compare (a, b) {
- if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)
- if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)
- if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
- throw new TypeError(
- 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
- )
- }
-
- if (a === b) return 0
-
- var x = a.length
- var y = b.length
-
- for (var i = 0, len = Math.min(x, y); i < len; ++i) {
- if (a[i] !== b[i]) {
- x = a[i]
- y = b[i]
- break
- }
- }
-
- if (x < y) return -1
- if (y < x) return 1
- return 0
-}
-
-Buffer.isEncoding = function isEncoding (encoding) {
- switch (String(encoding).toLowerCase()) {
- case 'hex':
- case 'utf8':
- case 'utf-8':
- case 'ascii':
- case 'latin1':
- case 'binary':
- case 'base64':
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return true
- default:
- return false
- }
-}
-
-Buffer.concat = function concat (list, length) {
- if (!Array.isArray(list)) {
- throw new TypeError('"list" argument must be an Array of Buffers')
- }
-
- if (list.length === 0) {
- return Buffer.alloc(0)
- }
-
- var i
- if (length === undefined) {
- length = 0
- for (i = 0; i < list.length; ++i) {
- length += list[i].length
- }
- }
-
- var buffer = Buffer.allocUnsafe(length)
- var pos = 0
- for (i = 0; i < list.length; ++i) {
- var buf = list[i]
- if (isInstance(buf, Uint8Array)) {
- buf = Buffer.from(buf)
- }
- if (!Buffer.isBuffer(buf)) {
- throw new TypeError('"list" argument must be an Array of Buffers')
- }
- buf.copy(buffer, pos)
- pos += buf.length
- }
- return buffer
-}
-
-function byteLength (string, encoding) {
- if (Buffer.isBuffer(string)) {
- return string.length
- }
- if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
- return string.byteLength
- }
- if (typeof string !== 'string') {
- throw new TypeError(
- 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' +
- 'Received type ' + typeof string
- )
- }
-
- var len = string.length
- var mustMatch = (arguments.length > 2 && arguments[2] === true)
- if (!mustMatch && len === 0) return 0
-
- // Use a for loop to avoid recursion
- var loweredCase = false
- for (;;) {
- switch (encoding) {
- case 'ascii':
- case 'latin1':
- case 'binary':
- return len
- case 'utf8':
- case 'utf-8':
- return utf8ToBytes(string).length
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return len * 2
- case 'hex':
- return len >>> 1
- case 'base64':
- return base64ToBytes(string).length
- default:
- if (loweredCase) {
- return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8
- }
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
-}
-Buffer.byteLength = byteLength
-
-function slowToString (encoding, start, end) {
- var loweredCase = false
-
- // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
- // property of a typed array.
-
- // This behaves neither like String nor Uint8Array in that we set start/end
- // to their upper/lower bounds if the value passed is out of range.
- // undefined is handled specially as per ECMA-262 6th Edition,
- // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
- if (start === undefined || start < 0) {
- start = 0
- }
- // Return early if start > this.length. Done here to prevent potential uint32
- // coercion fail below.
- if (start > this.length) {
- return ''
- }
-
- if (end === undefined || end > this.length) {
- end = this.length
- }
-
- if (end <= 0) {
- return ''
- }
-
- // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
- end >>>= 0
- start >>>= 0
-
- if (end <= start) {
- return ''
- }
-
- if (!encoding) encoding = 'utf8'
-
- while (true) {
- switch (encoding) {
- case 'hex':
- return hexSlice(this, start, end)
-
- case 'utf8':
- case 'utf-8':
- return utf8Slice(this, start, end)
-
- case 'ascii':
- return asciiSlice(this, start, end)
-
- case 'latin1':
- case 'binary':
- return latin1Slice(this, start, end)
-
- case 'base64':
- return base64Slice(this, start, end)
-
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return utf16leSlice(this, start, end)
-
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = (encoding + '').toLowerCase()
- loweredCase = true
- }
- }
-}
-
-// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
-// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
-// reliably in a browserify context because there could be multiple different
-// copies of the 'buffer' package in use. This method works even for Buffer
-// instances that were created from another copy of the `buffer` package.
-// See: https://github.com/feross/buffer/issues/154
-Buffer.prototype._isBuffer = true
-
-function swap (b, n, m) {
- var i = b[n]
- b[n] = b[m]
- b[m] = i
-}
-
-Buffer.prototype.swap16 = function swap16 () {
- var len = this.length
- if (len % 2 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 16-bits')
- }
- for (var i = 0; i < len; i += 2) {
- swap(this, i, i + 1)
- }
- return this
-}
-
-Buffer.prototype.swap32 = function swap32 () {
- var len = this.length
- if (len % 4 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 32-bits')
- }
- for (var i = 0; i < len; i += 4) {
- swap(this, i, i + 3)
- swap(this, i + 1, i + 2)
- }
- return this
-}
-
-Buffer.prototype.swap64 = function swap64 () {
- var len = this.length
- if (len % 8 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 64-bits')
- }
- for (var i = 0; i < len; i += 8) {
- swap(this, i, i + 7)
- swap(this, i + 1, i + 6)
- swap(this, i + 2, i + 5)
- swap(this, i + 3, i + 4)
- }
- return this
-}
-
-Buffer.prototype.toString = function toString () {
- var length = this.length
- if (length === 0) return ''
- if (arguments.length === 0) return utf8Slice(this, 0, length)
- return slowToString.apply(this, arguments)
-}
-
-Buffer.prototype.toLocaleString = Buffer.prototype.toString
-
-Buffer.prototype.equals = function equals (b) {
- if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
- if (this === b) return true
- return Buffer.compare(this, b) === 0
-}
-
-Buffer.prototype.inspect = function inspect () {
- var str = ''
- var max = exports.INSPECT_MAX_BYTES
- str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()
- if (this.length > max) str += ' ... '
- return ''
-}
-if (customInspectSymbol) {
- Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect
-}
-
-Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
- if (isInstance(target, Uint8Array)) {
- target = Buffer.from(target, target.offset, target.byteLength)
- }
- if (!Buffer.isBuffer(target)) {
- throw new TypeError(
- 'The "target" argument must be one of type Buffer or Uint8Array. ' +
- 'Received type ' + (typeof target)
- )
- }
-
- if (start === undefined) {
- start = 0
- }
- if (end === undefined) {
- end = target ? target.length : 0
- }
- if (thisStart === undefined) {
- thisStart = 0
- }
- if (thisEnd === undefined) {
- thisEnd = this.length
- }
-
- if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
- throw new RangeError('out of range index')
- }
-
- if (thisStart >= thisEnd && start >= end) {
- return 0
- }
- if (thisStart >= thisEnd) {
- return -1
- }
- if (start >= end) {
- return 1
- }
-
- start >>>= 0
- end >>>= 0
- thisStart >>>= 0
- thisEnd >>>= 0
-
- if (this === target) return 0
-
- var x = thisEnd - thisStart
- var y = end - start
- var len = Math.min(x, y)
-
- var thisCopy = this.slice(thisStart, thisEnd)
- var targetCopy = target.slice(start, end)
-
- for (var i = 0; i < len; ++i) {
- if (thisCopy[i] !== targetCopy[i]) {
- x = thisCopy[i]
- y = targetCopy[i]
- break
- }
- }
-
- if (x < y) return -1
- if (y < x) return 1
- return 0
-}
-
-// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
-// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
-//
-// Arguments:
-// - buffer - a Buffer to search
-// - val - a string, Buffer, or number
-// - byteOffset - an index into `buffer`; will be clamped to an int32
-// - encoding - an optional encoding, relevant is val is a string
-// - dir - true for indexOf, false for lastIndexOf
-function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
- // Empty buffer means no match
- if (buffer.length === 0) return -1
-
- // Normalize byteOffset
- if (typeof byteOffset === 'string') {
- encoding = byteOffset
- byteOffset = 0
- } else if (byteOffset > 0x7fffffff) {
- byteOffset = 0x7fffffff
- } else if (byteOffset < -0x80000000) {
- byteOffset = -0x80000000
- }
- byteOffset = +byteOffset // Coerce to Number.
- if (numberIsNaN(byteOffset)) {
- // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
- byteOffset = dir ? 0 : (buffer.length - 1)
- }
-
- // Normalize byteOffset: negative offsets start from the end of the buffer
- if (byteOffset < 0) byteOffset = buffer.length + byteOffset
- if (byteOffset >= buffer.length) {
- if (dir) return -1
- else byteOffset = buffer.length - 1
- } else if (byteOffset < 0) {
- if (dir) byteOffset = 0
- else return -1
- }
-
- // Normalize val
- if (typeof val === 'string') {
- val = Buffer.from(val, encoding)
- }
-
- // Finally, search either indexOf (if dir is true) or lastIndexOf
- if (Buffer.isBuffer(val)) {
- // Special case: looking for empty string/buffer always fails
- if (val.length === 0) {
- return -1
- }
- return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
- } else if (typeof val === 'number') {
- val = val & 0xFF // Search for a byte value [0-255]
- if (typeof Uint8Array.prototype.indexOf === 'function') {
- if (dir) {
- return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
- } else {
- return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
- }
- }
- return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)
- }
-
- throw new TypeError('val must be string, number or Buffer')
-}
-
-function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
- var indexSize = 1
- var arrLength = arr.length
- var valLength = val.length
-
- if (encoding !== undefined) {
- encoding = String(encoding).toLowerCase()
- if (encoding === 'ucs2' || encoding === 'ucs-2' ||
- encoding === 'utf16le' || encoding === 'utf-16le') {
- if (arr.length < 2 || val.length < 2) {
- return -1
- }
- indexSize = 2
- arrLength /= 2
- valLength /= 2
- byteOffset /= 2
- }
- }
-
- function read (buf, i) {
- if (indexSize === 1) {
- return buf[i]
- } else {
- return buf.readUInt16BE(i * indexSize)
- }
- }
-
- var i
- if (dir) {
- var foundIndex = -1
- for (i = byteOffset; i < arrLength; i++) {
- if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
- if (foundIndex === -1) foundIndex = i
- if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
- } else {
- if (foundIndex !== -1) i -= i - foundIndex
- foundIndex = -1
- }
- }
- } else {
- if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
- for (i = byteOffset; i >= 0; i--) {
- var found = true
- for (var j = 0; j < valLength; j++) {
- if (read(arr, i + j) !== read(val, j)) {
- found = false
- break
- }
- }
- if (found) return i
- }
- }
-
- return -1
-}
-
-Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
- return this.indexOf(val, byteOffset, encoding) !== -1
-}
-
-Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
-}
-
-Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
-}
-
-function hexWrite (buf, string, offset, length) {
- offset = Number(offset) || 0
- var remaining = buf.length - offset
- if (!length) {
- length = remaining
- } else {
- length = Number(length)
- if (length > remaining) {
- length = remaining
- }
- }
-
- var strLen = string.length
-
- if (length > strLen / 2) {
- length = strLen / 2
- }
- for (var i = 0; i < length; ++i) {
- var parsed = parseInt(string.substr(i * 2, 2), 16)
- if (numberIsNaN(parsed)) return i
- buf[offset + i] = parsed
- }
- return i
-}
-
-function utf8Write (buf, string, offset, length) {
- return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
-}
-
-function asciiWrite (buf, string, offset, length) {
- return blitBuffer(asciiToBytes(string), buf, offset, length)
-}
-
-function latin1Write (buf, string, offset, length) {
- return asciiWrite(buf, string, offset, length)
-}
-
-function base64Write (buf, string, offset, length) {
- return blitBuffer(base64ToBytes(string), buf, offset, length)
-}
-
-function ucs2Write (buf, string, offset, length) {
- return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
-}
-
-Buffer.prototype.write = function write (string, offset, length, encoding) {
- // Buffer#write(string)
- if (offset === undefined) {
- encoding = 'utf8'
- length = this.length
- offset = 0
- // Buffer#write(string, encoding)
- } else if (length === undefined && typeof offset === 'string') {
- encoding = offset
- length = this.length
- offset = 0
- // Buffer#write(string, offset[, length][, encoding])
- } else if (isFinite(offset)) {
- offset = offset >>> 0
- if (isFinite(length)) {
- length = length >>> 0
- if (encoding === undefined) encoding = 'utf8'
- } else {
- encoding = length
- length = undefined
- }
- } else {
- throw new Error(
- 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
- )
- }
-
- var remaining = this.length - offset
- if (length === undefined || length > remaining) length = remaining
-
- if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
- throw new RangeError('Attempt to write outside buffer bounds')
- }
-
- if (!encoding) encoding = 'utf8'
-
- var loweredCase = false
- for (;;) {
- switch (encoding) {
- case 'hex':
- return hexWrite(this, string, offset, length)
-
- case 'utf8':
- case 'utf-8':
- return utf8Write(this, string, offset, length)
-
- case 'ascii':
- return asciiWrite(this, string, offset, length)
-
- case 'latin1':
- case 'binary':
- return latin1Write(this, string, offset, length)
-
- case 'base64':
- // Warning: maxLength not taken into account in base64Write
- return base64Write(this, string, offset, length)
-
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return ucs2Write(this, string, offset, length)
-
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
-}
-
-Buffer.prototype.toJSON = function toJSON () {
- return {
- type: 'Buffer',
- data: Array.prototype.slice.call(this._arr || this, 0)
- }
-}
-
-function base64Slice (buf, start, end) {
- if (start === 0 && end === buf.length) {
- return base64.fromByteArray(buf)
- } else {
- return base64.fromByteArray(buf.slice(start, end))
- }
-}
-
-function utf8Slice (buf, start, end) {
- end = Math.min(buf.length, end)
- var res = []
-
- var i = start
- while (i < end) {
- var firstByte = buf[i]
- var codePoint = null
- var bytesPerSequence = (firstByte > 0xEF) ? 4
- : (firstByte > 0xDF) ? 3
- : (firstByte > 0xBF) ? 2
- : 1
-
- if (i + bytesPerSequence <= end) {
- var secondByte, thirdByte, fourthByte, tempCodePoint
-
- switch (bytesPerSequence) {
- case 1:
- if (firstByte < 0x80) {
- codePoint = firstByte
- }
- break
- case 2:
- secondByte = buf[i + 1]
- if ((secondByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
- if (tempCodePoint > 0x7F) {
- codePoint = tempCodePoint
- }
- }
- break
- case 3:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
- if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
- codePoint = tempCodePoint
- }
- }
- break
- case 4:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- fourthByte = buf[i + 3]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
- if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
- codePoint = tempCodePoint
- }
- }
- }
- }
-
- if (codePoint === null) {
- // we did not generate a valid codePoint so insert a
- // replacement char (U+FFFD) and advance only 1 byte
- codePoint = 0xFFFD
- bytesPerSequence = 1
- } else if (codePoint > 0xFFFF) {
- // encode to utf16 (surrogate pair dance)
- codePoint -= 0x10000
- res.push(codePoint >>> 10 & 0x3FF | 0xD800)
- codePoint = 0xDC00 | codePoint & 0x3FF
- }
-
- res.push(codePoint)
- i += bytesPerSequence
- }
-
- return decodeCodePointsArray(res)
-}
-
-// Based on http://stackoverflow.com/a/22747272/680742, the browser with
-// the lowest limit is Chrome, with 0x10000 args.
-// We go 1 magnitude less, for safety
-var MAX_ARGUMENTS_LENGTH = 0x1000
-
-function decodeCodePointsArray (codePoints) {
- var len = codePoints.length
- if (len <= MAX_ARGUMENTS_LENGTH) {
- return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
- }
-
- // Decode in chunks to avoid "call stack size exceeded".
- var res = ''
- var i = 0
- while (i < len) {
- res += String.fromCharCode.apply(
- String,
- codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
- )
- }
- return res
-}
-
-function asciiSlice (buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
-
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i] & 0x7F)
- }
- return ret
-}
-
-function latin1Slice (buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
-
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i])
- }
- return ret
-}
-
-function hexSlice (buf, start, end) {
- var len = buf.length
-
- if (!start || start < 0) start = 0
- if (!end || end < 0 || end > len) end = len
-
- var out = ''
- for (var i = start; i < end; ++i) {
- out += hexSliceLookupTable[buf[i]]
- }
- return out
-}
-
-function utf16leSlice (buf, start, end) {
- var bytes = buf.slice(start, end)
- var res = ''
- for (var i = 0; i < bytes.length; i += 2) {
- res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
- }
- return res
-}
-
-Buffer.prototype.slice = function slice (start, end) {
- var len = this.length
- start = ~~start
- end = end === undefined ? len : ~~end
-
- if (start < 0) {
- start += len
- if (start < 0) start = 0
- } else if (start > len) {
- start = len
- }
-
- if (end < 0) {
- end += len
- if (end < 0) end = 0
- } else if (end > len) {
- end = len
- }
-
- if (end < start) end = start
-
- var newBuf = this.subarray(start, end)
- // Return an augmented `Uint8Array` instance
- Object.setPrototypeOf(newBuf, Buffer.prototype)
-
- return newBuf
-}
-
-/*
- * Need to make sure that buffer isn't trying to write out of bounds.
- */
-function checkOffset (offset, ext, length) {
- if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
- if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
-}
-
-Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
-
- return val
-}
-
-Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) {
- checkOffset(offset, byteLength, this.length)
- }
-
- var val = this[offset + --byteLength]
- var mul = 1
- while (byteLength > 0 && (mul *= 0x100)) {
- val += this[offset + --byteLength] * mul
- }
-
- return val
-}
-
-Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 1, this.length)
- return this[offset]
-}
-
-Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- return this[offset] | (this[offset + 1] << 8)
-}
-
-Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- return (this[offset] << 8) | this[offset + 1]
-}
-
-Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return ((this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16)) +
- (this[offset + 3] * 0x1000000)
-}
-
-Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset] * 0x1000000) +
- ((this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- this[offset + 3])
-}
-
-Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
- mul *= 0x80
-
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
-
- return val
-}
-
-Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var i = byteLength
- var mul = 1
- var val = this[offset + --i]
- while (i > 0 && (mul *= 0x100)) {
- val += this[offset + --i] * mul
- }
- mul *= 0x80
-
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
-
- return val
-}
-
-Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 1, this.length)
- if (!(this[offset] & 0x80)) return (this[offset])
- return ((0xff - this[offset] + 1) * -1)
-}
-
-Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset] | (this[offset + 1] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
-}
-
-Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset + 1] | (this[offset] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
-}
-
-Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16) |
- (this[offset + 3] << 24)
-}
-
-Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset] << 24) |
- (this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- (this[offset + 3])
-}
-
-Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, true, 23, 4)
-}
-
-Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, false, 23, 4)
-}
-
-Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, true, 52, 8)
-}
-
-Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, false, 52, 8)
-}
-
-function checkInt (buf, value, offset, ext, max, min) {
- if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
- if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
- if (offset + ext > buf.length) throw new RangeError('Index out of range')
-}
-
-Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength) - 1
- checkInt(this, value, offset, byteLength, maxBytes, 0)
- }
-
- var mul = 1
- var i = 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength) - 1
- checkInt(this, value, offset, byteLength, maxBytes, 0)
- }
-
- var i = byteLength - 1
- var mul = 1
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
- this[offset] = (value & 0xff)
- return offset + 1
-}
-
-Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- return offset + 2
-}
-
-Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- return offset + 2
-}
-
-Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- this[offset + 3] = (value >>> 24)
- this[offset + 2] = (value >>> 16)
- this[offset + 1] = (value >>> 8)
- this[offset] = (value & 0xff)
- return offset + 4
-}
-
-Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- return offset + 4
-}
-
-Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- var limit = Math.pow(2, (8 * byteLength) - 1)
-
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
-
- var i = 0
- var mul = 1
- var sub = 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
- sub = 1
- }
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- var limit = Math.pow(2, (8 * byteLength) - 1)
-
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
-
- var i = byteLength - 1
- var mul = 1
- var sub = 0
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
- sub = 1
- }
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
- if (value < 0) value = 0xff + value + 1
- this[offset] = (value & 0xff)
- return offset + 1
-}
-
-Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- return offset + 2
-}
-
-Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- return offset + 2
-}
-
-Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- this[offset + 2] = (value >>> 16)
- this[offset + 3] = (value >>> 24)
- return offset + 4
-}
-
-Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- if (value < 0) value = 0xffffffff + value + 1
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- return offset + 4
-}
-
-function checkIEEE754 (buf, value, offset, ext, max, min) {
- if (offset + ext > buf.length) throw new RangeError('Index out of range')
- if (offset < 0) throw new RangeError('Index out of range')
-}
-
-function writeFloat (buf, value, offset, littleEndian, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
- }
- ieee754.write(buf, value, offset, littleEndian, 23, 4)
- return offset + 4
-}
-
-Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
- return writeFloat(this, value, offset, true, noAssert)
-}
-
-Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
- return writeFloat(this, value, offset, false, noAssert)
-}
-
-function writeDouble (buf, value, offset, littleEndian, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
- }
- ieee754.write(buf, value, offset, littleEndian, 52, 8)
- return offset + 8
-}
-
-Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
- return writeDouble(this, value, offset, true, noAssert)
-}
-
-Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
- return writeDouble(this, value, offset, false, noAssert)
-}
-
-// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
-Buffer.prototype.copy = function copy (target, targetStart, start, end) {
- if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')
- if (!start) start = 0
- if (!end && end !== 0) end = this.length
- if (targetStart >= target.length) targetStart = target.length
- if (!targetStart) targetStart = 0
- if (end > 0 && end < start) end = start
-
- // Copy 0 bytes; we're done
- if (end === start) return 0
- if (target.length === 0 || this.length === 0) return 0
-
- // Fatal error conditions
- if (targetStart < 0) {
- throw new RangeError('targetStart out of bounds')
- }
- if (start < 0 || start >= this.length) throw new RangeError('Index out of range')
- if (end < 0) throw new RangeError('sourceEnd out of bounds')
-
- // Are we oob?
- if (end > this.length) end = this.length
- if (target.length - targetStart < end - start) {
- end = target.length - targetStart + start
- }
-
- var len = end - start
-
- if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
- // Use built-in when available, missing from IE11
- this.copyWithin(targetStart, start, end)
- } else if (this === target && start < targetStart && targetStart < end) {
- // descending copy from end
- for (var i = len - 1; i >= 0; --i) {
- target[i + targetStart] = this[i + start]
- }
- } else {
- Uint8Array.prototype.set.call(
- target,
- this.subarray(start, end),
- targetStart
- )
- }
-
- return len
-}
-
-// Usage:
-// buffer.fill(number[, offset[, end]])
-// buffer.fill(buffer[, offset[, end]])
-// buffer.fill(string[, offset[, end]][, encoding])
-Buffer.prototype.fill = function fill (val, start, end, encoding) {
- // Handle string cases:
- if (typeof val === 'string') {
- if (typeof start === 'string') {
- encoding = start
- start = 0
- end = this.length
- } else if (typeof end === 'string') {
- encoding = end
- end = this.length
- }
- if (encoding !== undefined && typeof encoding !== 'string') {
- throw new TypeError('encoding must be a string')
- }
- if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
- throw new TypeError('Unknown encoding: ' + encoding)
- }
- if (val.length === 1) {
- var code = val.charCodeAt(0)
- if ((encoding === 'utf8' && code < 128) ||
- encoding === 'latin1') {
- // Fast path: If `val` fits into a single byte, use that numeric value.
- val = code
- }
- }
- } else if (typeof val === 'number') {
- val = val & 255
- } else if (typeof val === 'boolean') {
- val = Number(val)
- }
-
- // Invalid ranges are not set to a default, so can range check early.
- if (start < 0 || this.length < start || this.length < end) {
- throw new RangeError('Out of range index')
- }
-
- if (end <= start) {
- return this
- }
-
- start = start >>> 0
- end = end === undefined ? this.length : end >>> 0
-
- if (!val) val = 0
-
- var i
- if (typeof val === 'number') {
- for (i = start; i < end; ++i) {
- this[i] = val
- }
- } else {
- var bytes = Buffer.isBuffer(val)
- ? val
- : Buffer.from(val, encoding)
- var len = bytes.length
- if (len === 0) {
- throw new TypeError('The value "' + val +
- '" is invalid for argument "value"')
- }
- for (i = 0; i < end - start; ++i) {
- this[i + start] = bytes[i % len]
- }
- }
-
- return this
-}
-
-// HELPER FUNCTIONS
-// ================
-
-var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
-
-function base64clean (str) {
- // Node takes equal signs as end of the Base64 encoding
- str = str.split('=')[0]
- // Node strips out invalid characters like \n and \t from the string, base64-js does not
- str = str.trim().replace(INVALID_BASE64_RE, '')
- // Node converts strings with length < 2 to ''
- if (str.length < 2) return ''
- // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
- while (str.length % 4 !== 0) {
- str = str + '='
- }
- return str
-}
-
-function utf8ToBytes (string, units) {
- units = units || Infinity
- var codePoint
- var length = string.length
- var leadSurrogate = null
- var bytes = []
-
- for (var i = 0; i < length; ++i) {
- codePoint = string.charCodeAt(i)
-
- // is surrogate component
- if (codePoint > 0xD7FF && codePoint < 0xE000) {
- // last char was a lead
- if (!leadSurrogate) {
- // no lead yet
- if (codePoint > 0xDBFF) {
- // unexpected trail
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- } else if (i + 1 === length) {
- // unpaired lead
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- }
-
- // valid lead
- leadSurrogate = codePoint
-
- continue
- }
-
- // 2 leads in a row
- if (codePoint < 0xDC00) {
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- leadSurrogate = codePoint
- continue
- }
-
- // valid surrogate pair
- codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
- } else if (leadSurrogate) {
- // valid bmp char, but last char was a lead
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- }
-
- leadSurrogate = null
-
- // encode utf8
- if (codePoint < 0x80) {
- if ((units -= 1) < 0) break
- bytes.push(codePoint)
- } else if (codePoint < 0x800) {
- if ((units -= 2) < 0) break
- bytes.push(
- codePoint >> 0x6 | 0xC0,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x10000) {
- if ((units -= 3) < 0) break
- bytes.push(
- codePoint >> 0xC | 0xE0,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x110000) {
- if ((units -= 4) < 0) break
- bytes.push(
- codePoint >> 0x12 | 0xF0,
- codePoint >> 0xC & 0x3F | 0x80,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else {
- throw new Error('Invalid code point')
- }
- }
-
- return bytes
-}
-
-function asciiToBytes (str) {
- var byteArray = []
- for (var i = 0; i < str.length; ++i) {
- // Node's code seems to be doing this and not & 0x7F..
- byteArray.push(str.charCodeAt(i) & 0xFF)
- }
- return byteArray
-}
-
-function utf16leToBytes (str, units) {
- var c, hi, lo
- var byteArray = []
- for (var i = 0; i < str.length; ++i) {
- if ((units -= 2) < 0) break
-
- c = str.charCodeAt(i)
- hi = c >> 8
- lo = c % 256
- byteArray.push(lo)
- byteArray.push(hi)
- }
-
- return byteArray
-}
-
-function base64ToBytes (str) {
- return base64.toByteArray(base64clean(str))
-}
-
-function blitBuffer (src, dst, offset, length) {
- for (var i = 0; i < length; ++i) {
- if ((i + offset >= dst.length) || (i >= src.length)) break
- dst[i + offset] = src[i]
- }
- return i
-}
-
-// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass
-// the `instanceof` check but they should be treated as of that type.
-// See: https://github.com/feross/buffer/issues/166
-function isInstance (obj, type) {
- return obj instanceof type ||
- (obj != null && obj.constructor != null && obj.constructor.name != null &&
- obj.constructor.name === type.name)
-}
-function numberIsNaN (obj) {
- // For IE11 support
- return obj !== obj // eslint-disable-line no-self-compare
-}
-
-// Create lookup table for `toString('hex')`
-// See: https://github.com/feross/buffer/issues/219
-var hexSliceLookupTable = (function () {
- var alphabet = '0123456789abcdef'
- var table = new Array(256)
- for (var i = 0; i < 16; ++i) {
- var i16 = i * 16
- for (var j = 0; j < 16; ++j) {
- table[i16 + j] = alphabet[i] + alphabet[j]
- }
- }
- return table
-})()
-
-
-/***/ }),
-
-/***/ "./node_modules/clsx/dist/clsx.m.js":
-/*!******************************************!*\
- !*** ./node_modules/clsx/dist/clsx.m.js ***!
- \******************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": function() { return /* export default binding */ __WEBPACK_DEFAULT_EXPORT__; }
-/* harmony export */ });
-function toVal(mix) {
- var k, y, str='';
-
- if (typeof mix === 'string' || typeof mix === 'number') {
- str += mix;
- } else if (typeof mix === 'object') {
- if (Array.isArray(mix)) {
- for (k=0; k < mix.length; k++) {
- if (mix[k]) {
- if (y = toVal(mix[k])) {
- str && (str += ' ');
- str += y;
- }
- }
- }
- } else {
- for (k in mix) {
- if (mix[k]) {
- str && (str += ' ');
- str += k;
- }
- }
- }
- }
-
- return str;
-}
-
-/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__() {
- var i=0, tmp, x, str='';
- while (i < arguments.length) {
- if (tmp = arguments[i++]) {
- if (x = toVal(tmp)) {
- str && (str += ' ');
- str += x
- }
- }
- }
- return str;
-}
-
-
-/***/ }),
-
-/***/ "./node_modules/dom-helpers/esm/addClass.js":
-/*!**************************************************!*\
- !*** ./node_modules/dom-helpers/esm/addClass.js ***!
- \**************************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": function() { return /* binding */ addClass; }
-/* harmony export */ });
-/* harmony import */ var _hasClass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hasClass */ "./node_modules/dom-helpers/esm/hasClass.js");
-
-/**
- * Adds a CSS class to a given element.
- *
- * @param element the element
- * @param className the CSS class name
- */
-
-function addClass(element, className) {
- if (element.classList) element.classList.add(className);else if (!(0,_hasClass__WEBPACK_IMPORTED_MODULE_0__.default)(element, className)) if (typeof element.className === 'string') element.className = element.className + " " + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + " " + className);
-}
-
-/***/ }),
-
-/***/ "./node_modules/dom-helpers/esm/hasClass.js":
-/*!**************************************************!*\
- !*** ./node_modules/dom-helpers/esm/hasClass.js ***!
- \**************************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": function() { return /* binding */ hasClass; }
-/* harmony export */ });
-/**
- * Checks if a given element has a CSS class.
- *
- * @param element the element
- * @param className the CSS class name
- */
-function hasClass(element, className) {
- if (element.classList) return !!className && element.classList.contains(className);
- return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
-}
-
-/***/ }),
-
-/***/ "./node_modules/dom-helpers/esm/removeClass.js":
-/*!*****************************************************!*\
- !*** ./node_modules/dom-helpers/esm/removeClass.js ***!
- \*****************************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": function() { return /* binding */ removeClass; }
-/* harmony export */ });
-function replaceClassName(origClass, classToRemove) {
- return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
-}
-/**
- * Removes a CSS class from a given element.
- *
- * @param element the element
- * @param className the CSS class name
- */
-
-
-function removeClass(element, className) {
- if (element.classList) {
- element.classList.remove(className);
- } else if (typeof element.className === 'string') {
- element.className = replaceClassName(element.className, className);
- } else {
- element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));
- }
-}
-
-/***/ }),
-
-/***/ "./node_modules/domelementtype/index.js":
-/*!**********************************************!*\
- !*** ./node_modules/domelementtype/index.js ***!
- \**********************************************/
-/***/ (function(module) {
-
-//Types of elements found in the DOM
-module.exports = {
- Text: "text", //Text
- Directive: "directive", // ... ?>
- Comment: "comment", //
- Script: "script", //