Files
old-kitabcitab-frontend/kitabcitab/.next/cache/webpack/server-development/1.pack

12748 lines
1.3 MiB
Plaintext
Raw Normal View History

wpc<00><10>webpack/lib/cache/PackFileCacheStrategy<67>PackContentItems <10>@<40><00>Compilation/modules|/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/link.js<6A>Compilation/modules|external commonjs "next/router"/ResolverCachePlugin|normal|default|fullySpecified=|false|dependencyType=|commonjs|modules=[|0=|node_modules|]|fallback=|false|exportsFields=[|0=|exports|]|importsFields=[|0=|imports|]|conditionNames=[|0=|node|1=|require|]|descriptionFiles=[|0=|package.json|]|extensions=[|0=|.js|1=|.json|2=|.node|]|enforceExtensions=|false|symlinks=|true|mainFields=[|0=|main|]|mainFiles=[|0=|index|]|roots=[|]|preferRelative=|false|preferAbsolute=|false|restrictions=[|]|path=|/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next|request=|./dist/client/link<1E>ResolverCachePlugin|normal|default|fullySpecified=|false|dependencyType=|unknown|path=|/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next|request=|./dist/client/linkCompilation/modules|/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/link.js<6A>Compilation/modules|external commonjs "react-icons/ai"DResolverCachePlugin|normal|default|fullySpecified=|false|dependencyType=|commonjs|modules=[|0=|node_modules|]|fallback=|false|exportsFields=[|0=|exports|]|importsFields=[|0=|imports|]|conditionNames=[|0=|node|1=|require|]|descriptionFiles=[|0=|package.json|]|extensions=[|0=|.js|1=|.json|2=|.node|]|enforceExtensions=|false|symlinks=|true|mainFields=[|0=|main|]|mainFiles=[|0=|index|]|roots=[|]|preferRelative=|false|preferAbsolute=|false|restrictions=[|]|path=|/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client|request=|../shared/lib/router/routerNResolverCachePlugin|normal|default|fullySpecified=|false|dependencyType=|commonjs|modules=[|0=|node_modules|]|fallback=|false|exportsFields=[|0=|exports|]|importsFields=[|0=|imports|]|conditionNames=[|0=|node|1=|require|]|descriptionFiles=[|0=|package.json|]|extensions=[|0=|.js|1=|.json|2=|.node|]|enforceExtensions=|false|symlinks=|true|mainFields=[|0=|main|]|mainFiles=[|0=|index|]|roots=[|]|preferRelative=|false|preferAbsolute=|false|restrictions=[|]|path=|/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client|request=|../shared/lib/router/utils/format-url5ResolverCachePlugin|normal|default|fullySpecified=|false|dependencyType=|commonjs|modules=[|0=|node_modules|]|fallback=|false|exportsFields=[|0=|exports|]|importsFields=[|0=|imports|]|conditionNames=[|0=|node|1=|require|]|descriptionFiles=[|0=|package.json|]|extensions=[|0=|.js|1=|.json|2=|.node|]|enforceExtensions=|false|symlinks=|true|mainFields=[|0=|main|]|mainFiles=[|0=|index|]|roots=[|]|preferRelative=|false|preferAbsolute=|false|restrictions=[|]|path=|/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client|request=|./add-localeEResolverCachePlugin|normal|default|fullySpecified=|false|dependencyType=|commonjs|modules=[|0=|node_modules|]|fallback=|false|exportsFields=[|0=|exports|]|importsFields=[|0=|imports|]|conditionNames=[|0=|node|1=|require|]|descriptionFiles=[|0=|package.json|]|extensions=[|0=|.js|1=|.json|2=|.node|]|enforceExtensions=|false|symlinks=|true|mainFields=[|0=|main|]|mainFiles=[|0=|index|]|roots=[|]|preferRelative=|false|preferAbsolute=|false|restrictions=[|]|path=|/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client|request=|../shared/lib/router-contextIResolverCachePlugin|normal|default|fullySpecified=|false|dependencyType=|commonjs|modules=[|0=|node_modules|]|fallback=|false|exportsFields=[|0=|exports|]|importsFields=[|0=|imports|]|conditionNames=[|0=|node|1=|require|]|descriptionFiles=[|0=|package.json|]|extensions=[|0=|.js|1=|.json|2=|.node|]|enforceExtensions=|false|symlinks=|true|mainFields=[|0=|main|]|mainFiles=[|0=|index|]|roots=[|]|preferRelative=|false|preferAbsolute=|false|restrictions=
<EFBFBD>webpack://./node_modules/next/link.js<12><10><02>exportsType<70>defaultObject<17>dynamic<69>redirect <0A>javascript/auto<11>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next<02>fullySpecified  <15>` <0C>cacheable<6C>parsed<65>fileDependencies<65>contextDependencies<65>missingDependencies<65>buildDependencies<65>valueDependencies<65>hash<73>assets<74>assetsInfo<66>topLevelDeclarations<6E>snapshot <01>webpack/DefinePlugin_hash<73>e01dc77f<17>2839d7a52cf83012<10><10>webpack/lib/FileSystemInfo<66>Snapshot@ <00>=<3D><>kxB<15><>next@13.1.1<02>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/link.js<6A>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/package.json<10>webpack/lib/dependencies/CommonJsExportRequireDependency `.<11>module.exports <0A>./dist/client/link<15><15> `.<10>webpack/lib/ExternalModule<10>next/router<65>commonjs<15><>javascript/dynamic  <02>async<15> <15><03>strict<15><>module  <10>webpack/lib/dependencies/StaticExportsDependency<10>webpack/lib/cache/ResolverCachePlugin`<0F>_ResolverCachePluginCacheMiss<73>context<78>path<74>request<73>query<72>fragment<15><>directory<72>file<6C>internalÓdescriptionFilePath<74>descriptionFileData<74>descriptionFileRoot<6F>relativePath  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/link.js<18><> <15>` <20>_args<67>_from<6F>_id<69>_inBundle<6C>_integrity<74>_location<6F>_phantomChildren<65>_requested<65>_requiredBy<42>_resolved<65>_spec<65>_where<72>bin<69>bugs<67>dependencies<65>description<6F>devDependencies<65>engines<65>files<65>homepage<67>license<73>main<69>name<6D>optionalDependencies<65>peerDependencies<65>peerDependenciesMeta<74>repository<72>resolutions<6E>scripts<74>taskr<6B>types<65>version<15><>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab<15><15> <0A>sha512-R5eBAaIa3X7LJeYvv1bMdGnAVF4fVToEjim7MkflceFPuANY3YyvFxXee/A+acrSYwYPvOvf7f6v/BM/48ea5w==<3D>/next<03>nanoid<69>picocolors<72>source-map-js<17>3.3.4<EFBFBD>1.0.0<EFBFBD>1.0.2<08>type<70>registry<72>raw<15><>escapedName<6D>rawSpec<65>saveSpec<65>fetchSpec<15> <15><>next<15><>13.1.1`<60><01>/<17>https://registry.npmjs.org/next/-/next-13.1.1.tgz<15><15><15><>dist/bin/next<08>url<72>https://github.com/vercel/next.js/issues`<12>@next/env<6E>@next/swc-android-arm-eabi<62>@next/swc-android-arm64<36>@next/swc-darwin-arm64<36>@next/swc-darwin-x64<36>@next/swc-freebsd-x64<36>@next/swc-linux-arm-gnueabihf<68>@next/swc-linux-arm64-gnu<6E>@next/swc-linux-arm64-musl<73>@next/swc-linux-x64-gnu<6E>@next/swc-linux-x64-musl<73>@next/swc-win32-arm64-msvc<76>@next/swc-win32-ia32-msvc<76>@next/swc-win32-x64-msvc<76>@swc/helpers<72>caniuse-lite<74>postcss<73>styled-jsx<15><15><15><15><15><15><15><15><15><15><15><15><15><15><>0.4.14<EFBFBD>^1.0.30001406<EFBFBD>8.4.14<EFBFBD>5.1.1<17>The React Framework@<40><00>@ampproject/toolbox-optimizer<65>@babel/code-frame<6D>@babel/core<72>@babel/eslint-parser<65>@babel/generator<6F>@babel/plugin-proposal-class-properties<65>@babel/plugin-proposal-export-namespace-from<6F>@babel/plugin-proposal-numeric-separator<6F>@babel/plugin-proposal-object-rest-spread<61>@babel/plugin-syntax-bigint<6E>@babel/plugin-syntax-dynamic-import<72>@babel/plugin-syntax-import-assertions<6E>@babel/plugin-syntax-jsx<73>@babel/plugin-transform-modules-commonjs<6A>@babel/plugin-transform-runtime<6D>@babel/preset-env<6E>@babel/preset-react<63>@babel/preset-typescript<70>@babel/runtime<6D>@babel/traverse<73>@babel/types<65>@edge-runtime/primitives<65>@hapi/accept<70>@napi-rs/cli<6C>@napi-rs/triples<65>@next/polyfill-module<6C>@next/polyfill-nomodule<6C>@next/react-dev-overlay<61>@next/react-refresh-utils<6C>@next/swc<77>@segment/ajv-human-errors<72>@taskr/clear<61>@taskr/esnext<78>@types/amphtml-validator<6F>@types/babel__code-frame<6D>@types/babel__core<72>@types/babel__generator<6F>@types/babel__template<74>@types/babel__traverse<73>@types/bytes<65>@types/ci-info<66>@types/compression<6F>@types/content-disposition<6F>@types/content-type<70>@types/cookie<69>@types/cross-spawn<77>@types/debug<75>@types/fresh<73>@types/glob<6F>@types/jsonwebtoken<65>@types/lodash<73>@types/lodash.curry<72>@types/lru-cache<68>@types/micromatch<63>@types/node-fetch<63>@types/path-to-regexp<78>@types/platform<72>@types/react<63>@types/react-dom<6F>@types/react-is<69>@types/semver<65>@types/send<6E>@types/shell-quote<74>@types/tar<61>@types/text-table<6C>@types/ua-parser-js<6A>@types/uuid<69>@types/webpack-sources1<73>@types/ws<77>@vercel/ncc<63>@vercel/nft<66>acorn<72>ajv<6A>amphtml-validator<6F>anser<65>arg<72>assert<72>async-retry<72>async-
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>7.0.2<EFBFBD>7.1.12<EFBFBD>7.6.2<EFBFBD>7.4.0<EFBFBD>7.11.0<EFBFBD>3.1.1<15><>0.0.36<EFBFBD>0.5.4<EFBFBD>1.1.3<EFBFBD>0.3.3<EFBFBD>6.0.0<EFBFBD>4.1.5<EFBFBD>0.5.0<EFBFBD>7.1.1<EFBFBD>8.3.7<EFBFBD>4.14.149<EFBFBD>4.1.6<EFBFBD>5.1.0<EFBFBD>4.0.2<EFBFBD>2.6.1<EFBFBD>1.7.0<EFBFBD>1.3.4<EFBFBD>16.9.17<EFBFBD>16.9.4<EFBFBD>16.7.1<EFBFBD>7.3.1<EFBFBD>0.14.4<EFBFBD>1.7.1<EFBFBD>4.0.3<EFBFBD>0.2.1<EFBFBD>0.7.36<EFBFBD>8.3.1<EFBFBD>npm:@types/webpack-sources@0.1.5<EFBFBD>8.2.0<EFBFBD>0.34.0<EFBFBD>0.22.6<EFBFBD>8.5.0<EFBFBD>8.11.0<EFBFBD>1.0.35<EFBFBD>1.4.9<EFBFBD>4.1.0҅1.2.3<EFBFBD>3.0.0І0.4.24<EFBFBD>0.2.0<EFBFBD>4.20.2<EFBFBD>5.6.0օ2.4.2<EFBFBD>github:watson/ci-info#f43f6a1cefff47fb361c88cf4b943fdbcaafe540<34>1.1.2<EFBFBD>3.0.3<EFBFBD>1.7.4<EFBFBD>5.0.0<16><><EFBFBD><EFBFBD><EFBFBD>0.5.3<EFBFBD>1.0.4<EFBFBD>0.4.1<EFBFBD>6.0.5<EFBFBD>3.12.0<EFBFBD>1.5.1<EFBFBD>3.0.1<15><>4.1.1<EFBFBD>2.0.1<EFBFBD>4.19.0<15><>3.3.0<EFBFBD>3.3.1<15><>0.5.2<15><>7.1.7<16><><EFBFBD><EFBFBD><EFBFBD>1.18.1<16><><EFBFBD><EFBFBD>ͅ0.1.2<16><><EFBFBD><EFBFBD><15><>2.2.0<EFBFBD>27.0.0-next.5<EFBFBD>2.2.1<EFBFBD>8.5.1<EFBFBD>npm:loader-utils@2.0.0<EFBFBD>npm:loader-utils@3.1.3<15><16><><EFBFBD><EFBFBD><EFBFBD>4.0.4<EFBFBD>2.4.3<EFBFBD>3.1.32<EFBFBD>0.3.4ą2.6.7<EFBFBD>5.3.3<15><>0.3.0<EFBFBD>3.1.0<EFBFBD>1.0.1<EFBFBD>6.1.0<EFBFBD>1.3.6<15>ԅ4.0.0<15><15><>7.4.3<15>ą4.2.0<EFBFBD>0.11.10<EFBFBD>2.1.1…2.4.1<EFBFBD>18.2.0<EFBFBD>0.12.0<EFBFBD>0.13.4<EFBFBD>12.4.0<EFBFBD>npm:schema-utils@2.7.1<EFBFBD>npm:schema-utils@3.0.0<EFBFBD>7.3.2<EFBFBD>0.17.1<EFBFBD>1.0.5<EFBFBD>1.7.3<EFBFBD>0.6.1<EFBFBD>0.1.10<15><15><15><>1.3.0<15><>6.1.11<15><>5.14.1<15><>2.0.12<EFBFBD>0.0.1<EFBFBD>0.7.28<EFBFBD>5.14.0<EFBFBD>3.4.1<EFBFBD>0.12.4<EFBFBD>8.3.2<15><>2.4.0<15><>5.74.0<EFBFBD>npm:webpack-sources@1.4.3<EFBFBD>npm:webpack-sources@3.2.3<EFBFBD>8.2.3<08>node<64>>=14.6.0`.<2E>dist<73>app.js<6A>app.d.ts<74>babel.js<6A>babel.d.ts<74>client.js<6A>client.d.ts<74>compat<61>config.js<6A>config.d.ts<74>constants.js<6A>constants.d.ts<74>document.js<6A>document.d.ts<74>dynamic.js<6A>dynamic.d.ts<74>error.js<6A>error.d.ts<74>future<72>legacy<63>script.js<6A>script.d.ts<74>server.js<6A>server.d.ts<74>head.js<6A>head.d.ts<74>image.js<6A>image.d.ts<74>link.js<6A>link.d.ts<74>router.js<6A>router.d.ts<74>jest.js<6A>jest.d.ts<74>amp.js<6A>amp.d.ts<74>index.d.ts<74>types/index.d.ts<74>types/global.d.ts<74>types/compiled.d.ts<74>image-types/global.d.ts<74>font<6E>navigation.js<6A>navigation.d.ts<74>headers.js<6A>headers.d.ts<17>https://nextjs.org<72>MIT<49>./dist/server/next.jsh<><68><EFBFBD>` s<><73><EFBFBD>t<><74><EFBFBD>u<><75><EFBFBD>v<><76><EFBFBD>w<><77><EFBFBD>x<><78><EFBFBD>y<><79><EFBFBD>z<><7A><EFBFBD>{<7B><><EFBFBD>|<7C><><EFBFBD>}<7D><><EFBFBD>~<7E><><EFBFBD><><7F><EFBFBD>h<><68><EFBFBD>h<><68><EFBFBD>h<><68><EFBFBD>h<><68><EFBFBD>h<><68><EFBFBD>h<><68><EFBFBD>h<><68><EFBFBD>h<><68><EFBFBD>h<><68><EFBFBD>h<><68><EFBFBD>h<><68><EFBFBD>h<><68><EFBFBD>h<><68><EFBFBD><05>fibers<72>node-sass<73>react<63>react-dom<6F>sass<17>>= 3.1.0<EFBFBD>^6.0.0 || ^7.0.0<EFBFBD>^18.2.0<15><>^1.3.0<15><15><15><08>optional <15> <15> M<><4D><EFBFBD>\<5C><><EFBFBD><17>git<69>git+https://github.com/vercel/next.js.git<16><><EFBFBD><EFBFBD>j<><6A><EFBFBD>h<><68><EFBFBD><EFBFBD>1.0.30001406<08>build<6C>dev<65>ncc-compiled<65>prepublishOnly<6C>release<73>start0<><30><EFBFBD><EFBFBD>typescript<17>pnpm release && pnpm types,<2C><><EFBFBD><EFBFBD>ncc cache clean && taskr ncc<63>cd ../../ && turbo run build<6C>taskr release<73>node server.js<6A>tsc --declaration --emitDeclarationOnly --declarationDir dist<73>tsec --noEmit<08>requires<03>./taskfile-ncc.js<6A>./taskfile-swc.js<6A>./taskfile-watch.js<15>9<><39><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>./dist/client/link.js@ A<><41>kxB <01>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules  <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> p?<3F><>kxB <1A><><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend<6E>/home/ismail/Desktop<6F>/home/ismail<69>/home<6D>/<15><15><15><15><15><15>@<16><><EFBFBD><EFBFBD>@<01>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client@<16><><EFBFBD><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist<16><><EFBFBD><EFBFBD>@<03>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/package.json<6F>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/package.json<6F>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/link<16><><EFBFBD><EFBFBD> <03>issuer<65>issuerLayer<65>compiler<16><><EFBFBD><EFBFBD><11>server<16><><EFBFBD><EFBFBD><18><> <16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD><15>@ A<><41>kxB <15><15> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><15><15>
<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/SourceMapSource~E"use strict";
"use client";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _interop_require_default = require("@swc/helpers/lib/_interop_require_default.js").default;
var _object_without_properties_loose = require("@swc/helpers/lib/_object_without_properties_loose.js").default;
var _react = _interop_require_default(require("react"));
var _router = require("../shared/lib/router/router");
var _formatUrl = require("../shared/lib/router/utils/format-url");
var _addLocale = require("./add-locale");
var _routerContext = require("../shared/lib/router-context");
var _appRouterContext = require("../shared/lib/app-router-context");
var _useIntersection = require("./use-intersection");
var _getDomainLocale = require("./get-domain-locale");
var _addBasePath = require("./add-base-path");
const prefetched = new Set();
function prefetch(router, href, as, options) {
if ("undefined" === "undefined") {
return;
}
if (!(0, _router).isLocalURL(href)) {
return;
}
// We should only dedupe requests when experimental.optimisticClientCache is
// disabled.
if (!options.bypassPrefetchedCheck) {
const locale = typeof options.locale !== "undefined" ? options.locale : "locale" in router ? router.locale : undefined;
const prefetchedKey = href + "%" + as + "%" + locale;
// If we've already fetched the key, then don't prefetch it again!
if (prefetched.has(prefetchedKey)) {
return;
}
// Mark this URL as prefetched.
prefetched.add(prefetchedKey);
}
// Prefetch the JSON page if asked (only in the client)
// We need to handle a prefetch error here since we may be
// loading with priority which can reject but we don't
// want to force navigation since this is only a prefetch
Promise.resolve(router.prefetch(href, as, options)).catch((err)=>{
if ("development" !== "production") {
// rethrow to show invalid URL errors
throw err;
}
});
}
function isModifiedEvent(event) {
const { target } = event.currentTarget;
return target && target !== "_self" || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.nativeEvent && event.nativeEvent.which === 2;
}
function linkClicked(e, router, href, as, replace, shallow, scroll, locale, isAppRouter, prefetchEnabled) {
const { nodeName } = e.currentTarget;
// anchors inside an svg have a lowercase nodeName
const isAnchorNodeName = nodeName.toUpperCase() === "A";
if (isAnchorNodeName && (isModifiedEvent(e) || !(0, _router).isLocalURL(href))) {
// ignore click for browsers default behavior
return;
}
e.preventDefault();
const navigate = ()=>{
// If the router is an NextRouter instance it will have `beforePopState`
if ("beforePopState" in router) {
router[replace ? "replace" : "push"](href, as, {
shallow,
locale,
scroll
});
} else {
router[replace ? "replace" : "push"](as || href, {
forceOptimisticNavigation: !prefetchEnabled
});
}
};
if (isAppRouter) {
// @ts-expect-error startTransition exists.
_react.default.startTransition(navigate);
} else {
navigate();
}
}
function formatStringOrUrl(urlObjOrString) {
if (typeof urlObjOrString === "string") {
return urlObjOrString;
}
return (0, _formatUrl).formatUrl(urlObjOrString);
}
/**
* React Component that enables client-side transitions between routes.
*/ const Link = /*#__PURE__*/ _react.default.forwardRef(function LinkComponent(props, forwardedRef) {
if ("development" !== "production") {
function createPropError(args) {
return new Error(`Failed prop type: The prop \`${args.key}\` expects a ${args.expected} in \`<Link>\`, but got \`${args.actual}\` instead.` + ("undefined" !== "undefined" ? "\nOpen your browser's console to view the Component stack trace." : ""));
}
// TypeScript trick for type-guarding:
const requiredPropsGuard = {
href: true
};
const requiredProps = Object.keys(requiredPropsGuard);
requiredProps.forEach((key)=>{
if (key === "href") {
if (props[key] == null || typeof props[key] !== "string" && typeof props[key] !== "object") {
throw createPropError({
key,
expected: "`string` or `object`",
actual: props[key] === null ? "null" : typeof props[key]
});
}
} else {
// TypeScript trick for type-guarding:
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _ = key;
}
});
// TypeScript trick for type-guarding:
const optionalPropsGuard = {
as: true,
replace: true,
scroll: true,
shallow: true,
passHref: true,
prefetch: true,
locale: true,
onClick: true,
onMouseEnter: true,
onTouchStart: true,
legacyBehavior: true
};
const optionalProps = Object.keys(optionalPropsGuard);
optionalProps.forEach((key)=>{
const valType = typeof props[key];
if (key === "as") {
if (props[key] && valType !== "string" && valType !== "object") {
throw createPropError({
key,
expected: "`string` or `object`",
actual: valType
});
}
} else if (key === "locale") {
if (props[key] && valType !== "string") {
throw createPropError({
key,
expected: "`string`",
actual: valType
});
}
} else if (key === "onClick" || key === "onMouseEnter" || key === "onTouchStart") {
if (props[key] && valType !== "function") {
throw createPropError({
key,
expected: "`function`",
actual: valType
});
}
} else if (key === "replace" || key === "scroll" || key === "shallow" || key === "passHref" || key === "prefetch" || key === "legacyBehavior") {
if (props[key] != null && valType !== "boolean") {
throw createPropError({
key,
expected: "`boolean`",
actual: valType
});
}
} else {
// TypeScript trick for type-guarding:
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _ = key;
}
});
// This hook is in a conditional but that is ok because `process.env.NODE_ENV` never changes
// eslint-disable-next-line react-hooks/rules-of-hooks
const hasWarned = _react.default.useRef(false);
if (props.prefetch && !hasWarned.current) {
hasWarned.current = true;
console.warn("Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://nextjs.org/docs/messages/prefetch-true-deprecated");
}
}
let children;
const { href: hrefProp , as: asProp , children: childrenProp , prefetch: prefetchProp , passHref , replace , shallow , scroll , locale , onClick , onMouseEnter: onMouseEnterProp , onTouchStart: onTouchStartProp , legacyBehavior =process.env.__NEXT_NEW_LINK_BEHAVIOR === false } = props, restProps = _object_without_properties_loose(props, [
"href",
"as",
"children",
"prefetch",
"passHref",
"replace",
"shallow",
"scroll",
"locale",
"onClick",
"onMouseEnter",
"onTouchStart",
"legacyBehavior"
]);
children = childrenProp;
if (legacyBehavior && (typeof children === "string" || typeof children === "number")) {
children = /*#__PURE__*/ _react.default.createElement("a", null, children);
}
const prefetchEnabled = prefetchProp !== false;
const pagesRouter = _react.default.useContext(_routerContext.RouterContext);
const appRouter = _react.default.useContext(_appRouterContext.AppRouterContext);
const router = pagesRouter != null ? pagesRouter : appRouter;
// We're in the app directory if there is no pages router.
const isAppRouter = !pagesRouter;
if ("development" !== "production") {
if (isAppRouter && !asProp) {
let href;
if (typeof hrefProp === "string") {
href = hrefProp;
} else if (typeof hrefProp === "object" && typeof hrefProp.pathname === "string") {
href = hrefProp.pathname;
}
if (href) {
const hasDynamicSegment = href.split("/").some((segment)=>segment.startsWith("[") && segment.endsWith("]"));
if (hasDynamicSegment) {
throw new Error(`Dynamic href \`${href}\` found in <Link> while using the \`/app\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`);
}
}
}
}
const { href: href1 , as } = _react.default.useMemo(()=>{
if (!pagesRouter) {
const resolvedHref = formatStringOrUrl(hrefProp);
return {
href: resolvedHref,
as: asProp ? formatStringOrUrl(asProp) : resolvedHref
};
}
const [resolvedHref1, resolvedAs] = (0, _router).resolveHref(pagesRouter, hrefProp, true);
return {
href: resolvedHref1,
as: asProp ? (0, _router).resolveHref(pagesRouter, asProp) : resolvedAs || resolvedHref1
};
}, [
pagesRouter,
hrefProp,
asProp
]);
const previousHref = _react.default.useRef(href1);
const previousAs = _react.default.useRef(as);
// This will return the first child, if multiple are provided it will throw an error
let child;
if (legacyBehavior) {
if ("development" === "development") {
if (onClick) {
console.warn(`"onClick" was passed to <Link> with \`href\` of \`${hrefProp}\` but "legacyBehavior" was set. The legacy behavior requires onClick be set on the child of next/link`);
}
if (onMouseEnterProp) {
console.warn(`"onMouseEnter" was passed to <Link> with \`href\` of \`${hrefProp}\` but "legacyBehavior" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`);
}
try {
child = _react.default.Children.only(children);
} catch (err) {
if (!children) {
throw new Error(`No children were passed to <Link> with \`href\` of \`${hrefProp}\` but one child is required https://nextjs.org/docs/messages/link-no-children`);
}
throw new Error(`Multiple children were passed to <Link> with \`href\` of \`${hrefProp}\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` + ("undefined" !== "undefined" ? " \nOpen your browser's console to view the Component stack trace." : ""));
}
} else {
child = _react.default.Children.only(children);
}
} else {
if ("development" === "development") {
var ref;
if (((ref = children) == null ? void 0 : ref.type) === "a") {
throw new Error("Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor");
}
}
}
const childRef = legacyBehavior ? child && typeof child === "object" && child.ref : forwardedRef;
const [setIntersectionRef, isVisible, resetVisible] = (0, _useIntersection).useIntersection({
rootMargin: "200px"
});
const setRef = _react.default.useCallback((el)=>{
// Before the link getting observed, check if visible state need to be reset
if (previousAs.current !== as || previousHref.current !== href1) {
resetVisible();
previousAs.current = as;
previousHref.current = href1;
}
setIntersectionRef(el);
if (childRef) {
if (typeof childRef === "function") childRef(el);
else if (typeof childRef === "object") {
childRef.current = el;
}
}
}, [
as,
childRef,
href1,
resetVisible,
setIntersectionRef
]);
// Prefetch the URL if we haven't already and it's visible.
_react.default.useEffect(()=>{
// in dev, we only prefetch on hover to avoid wasting resources as the prefetch will trigger compiling the page.
if ("development" !== "production") {
return;
}
if (!router) {
return;
}
// If we don't need to prefetch the URL, don't do prefetch.
if (!isVisible || !prefetchEnabled) {
return;
}
// Prefetch the URL.
prefetch(router, href1, as, {
locale
});
}, [
as,
href1,
isVisible,
locale,
prefetchEnabled,
pagesRouter == null ? void 0 : pagesRouter.locale,
router
]);
const childProps = {
ref: setRef,
onClick (e) {
if ("development" !== "production") {
if (!e) {
throw new Error(`Component rendered inside next/link has to pass click event to "onClick" prop.`);
}
}
if (!legacyBehavior && typeof onClick === "function") {
onClick(e);
}
if (legacyBehavior && child.props && typeof child.props.onClick === "function") {
child.props.onClick(e);
}
if (!router) {
return;
}
if (e.defaultPrevented) {
return;
}
linkClicked(e, router, href1, as, replace, shallow, scroll, locale, isAppRouter, prefetchEnabled);
},
onMouseEnter (e) {
if (!legacyBehavior && typeof onMouseEnterProp === "function") {
onMouseEnterProp(e);
}
if (legacyBehavior && child.props && typeof child.props.onMouseEnter === "function") {
child.props.onMouseEnter(e);
}
if (!router) {
return;
}
if (!prefetchEnabled && isAppRouter) {
return;
}
prefetch(router, href1, as, {
locale,
priority: true,
// @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}
bypassPrefetchedCheck: true
});
},
onTouchStart (e) {
if (!legacyBehavior && typeof onTouchStartProp === "function") {
onTouchStartProp(e);
}
if (legacyBehavior && child.props && typeof child.props.onTouchStart === "function") {
child.props.onTouchStart(e);
}
if (!router) {
return;
}
if (!prefetchEnabled && isAppRouter) {
return;
}
prefetch(router, href1, as, {
locale,
priority: true,
// @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}
bypassPrefetchedCheck: true
});
}
};
// If child is an <a> 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 (!legacyBehavior || passHref || child.type === "a" && !("href" in child.props)) {
const curLocale = typeof locale !== "undefined" ? locale : pagesRouter == null ? void 0 : pagesRouter.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
const localeDomain = (pagesRouter == null ? void 0 : pagesRouter.isLocaleDomain) && (0, _getDomainLocale).getDomainLocale(as, curLocale, pagesRouter == null ? void 0 : pagesRouter.locales, pagesRouter == null ? void 0 : pagesRouter.domainLocales);
childProps.href = localeDomain || (0, _addBasePath).addBasePath((0, _addLocale).addLocale(as, curLocale, pagesRouter == null ? void 0 : pagesRouter.defaultLocale));
}
return legacyBehavior ? /*#__PURE__*/ _react.default.cloneElement(child, childProps) : /*#__PURE__*/ _react.default.createElement("a", Object.assign({}, restProps, childProps), children);
});
var _default = Link;
exports.default = _default;
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=link.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/link.js<1F>x{"version":3,"sources":["webpack://./node_modules/next/dist/client/link.js"],"sourcesContent":["\"use client\";\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _interop_require_default = require(\"@swc/helpers/lib/_interop_require_default.js\").default;\nvar _object_without_properties_loose = require(\"@swc/helpers/lib/_object_without_properties_loose.js\").default;\nvar _react = _interop_require_default(require(\"react\"));\nvar _router = require(\"../shared/lib/router/router\");\nvar _formatUrl = require(\"../shared/lib/router/utils/format-url\");\nvar _addLocale = require(\"./add-locale\");\nvar _routerContext = require(\"../shared/lib/router-context\");\nvar _appRouterContext = require(\"../shared/lib/app-router-context\");\nvar _useIntersection = require(\"./use-intersection\");\nvar _getDomainLocale = require(\"./get-domain-locale\");\nvar _addBasePath = require(\"./add-base-path\");\n\nconst prefetched = new Set();\nfunction prefetch(router, href, as, options) {\n if (typeof window === 'undefined') {\n return;\n }\n if (!(0, _router).isLocalURL(href)) {\n return;\n }\n // We should only dedupe requests when experimental.optimisticClientCache is\n // disabled.\n if (!options.bypassPrefetchedCheck) {\n const locale = // Let the link's locale prop override the default router locale.\n typeof options.locale !== 'undefined' ? options.locale : 'locale' in router ? router.locale : undefined;\n const prefetchedKey = href + '%' + as + '%' + locale;\n // If we've already fetched the key, then don't prefetch it again!\n if (prefetched.has(prefetchedKey)) {\n return;\n }\n // Mark this URL as prefetched.\n prefetched.add(prefetchedKey);\n }\n // Prefetch the JSON page if asked (only in the client)\n // We need to handle a prefetch error here since we may be\n // loading with priority which can reject but we don't\n // want to force navigation since this is only a prefetch\n Promise.resolve(router.prefetch(href, as, options)).catch((err)=>{\n if (process.env.NODE_ENV !== 'production') {\n // rethrow to show invalid URL errors\n throw err;\n }\n });\n}\nfunction isModifiedEvent(event) {\n const { target } = event.currentTarget;\n return target && target !== '_self' || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.nativeEvent && event.nativeEvent.which === 2;\n}\nfunction linkClicked(e, router, href, as, replace, shallow, scroll, locale, isAppRouter, prefetchEnabled) {\n const { nodeName } = e.currentTarget;\n // anchors inside an svg have a lowercase nodeName\n const isAnchorNodeName = nodeName.toUpperCase() === 'A';\n if (isAnchorNodeName && (isModifiedEvent(e) || !(0, _router).isLocalURL(href))) {\n // ignore click for browsers default behavior\n return;\n }\n e.preventDefault();\n const navigate = ()=>{\n // If the router is an NextRouter instance it will have `beforePopState`\n if ('beforePopState' in router) {\n router[replace ? 'replace' : 'push'](href, as, {\n shallow,\n locale,\n scroll\n });\n } else {\n router[replace ? 'replace' : 'push'](as || href, {\n forceOptimisticNavigation: !prefetchEnabled\n });\n }\n };\n if (isAppRouter) {\n // @ts-expect-error startTransition exists.\n _react.default.startTransition(navigate);\n } else {\n navigate();\n }\n}\nfunction formatStringOrUrl(urlObjOrString) {\n if (typeof urlObjOrString === 'string') {\n return urlObjOrString;\n }\n return (0, _formatUrl).formatUrl(urlObjOrString);\n}\n/**\n * React Component that enables client-side transition
`  ` <10>webpack/lib/dependencies/RequireHeaderDependencya Aov b& 6 A<><00>
b
4 A<><00> c  A A  c  ( A:A c  < A{<00> cC A<><00> c4 A<><00> c5 A(/ c-<15> A<><00> c<15> A<><00> c+. <15> A<><00> a\@<40><02> false A<><00> `^@<40>`^@<02>0 A<><00> `^@<40>`^@<40><15> A<><00> C<><00><00> <15> A<>"<00>" @<40>@<40><15> A)5) @<40>@ <02>{} A<>-. @`@ <15> AF-a- C<00>,<02>0 Ad-<00>- C<00>'<15> A..M. @@  <15> A
4(4 @*@, <15> Aw6<00>6 @D` @H`  `<10>webpack/lib/dependencies/CommonJsExportsDependencyc ] aI\<17>Object.defineProperty(exports) <01>__esModule  a_n<11>exports <01>default `<10>webpack/lib/dependencies/CommonJsFullRequireDependencya <15> <0C>@swc/helpers/lib/_interop_require_default.js<15> A<><00> b^ <15> <0C>@swc/helpers/lib/_object_without_properties_loose.js<15> AG b'n<10>webpack/lib/dependencies/CommonJsRequireDependency@=<3D><><EFBFBD>=<3D><><EFBFBD>Aw~ b& 6<01>../shared/lib/router/router<15>A<><00>
b
4<01>../shared/lib/router/utils/format-url<15>A<><00> c  A<01>./add-locale<15>A" c  (<01>../shared/lib/router-context<15>AB` c  <<01>../shared/lib/app-router-context<15>A<><00> cC<01>./use-intersection<15>A<><00> c4<01>./get-domain-locale<15>A<> c5<01>./add-base-path<15>A0A c-A<>C<00>C`<60><15> @<40>@<40>`<10>webpack/lib/dependencies/CommonJsSelfReferenceDependencyaAD#D<15><15>@<40>` @<40>`A=DLD<15><15>@<40>`5@<40>`DA]DlD<15><15>@<40>`U@<40>`dA<>D<00>D<15><15><15>@<40>`yA<79><00>A<>D<00>D<15><15>@<40>`@<40>`)AE'E<15><15>@<40>`@<40>`!A)E0E<15>@<40>`#@<40>`*A7EEE<10><><EFBFBD>@<40>@<40>`AHEWE<15><15>@<40>`@<40>`$ <0B>react-icons/ai<10><><EFBFBD><15><11><><EFBFBD>@<12><><EFBFBD> <14><><EFBFBD> <16><><EFBFBD><EFBFBD><17><><EFBFBD>  
 %<25><><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/router.js<18><> <16><><EFBFBD><EFBFBD>$<24><><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>./dist/shared/lib/router/router.js @ C<><43>kxB%<25><><EFBFBD>&<26><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><02>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/package.json<6F>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/router*<2A><><EFBFBD>0<><30><EFBFBD> @5<><35><EFBFBD> @5<><35><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/package.json<6F>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/package.json @<15> @<03>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router<65>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib<69>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared  <09><><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/format-url.js<18><> <16><><EFBFBD><EFBFBD><08><><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>./dist/shared/lib/router/utils/format-url.js @ C<><43>kxB <09><><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils<0F><><EFBFBD><15><><EFBFBD><15><15> @<03>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/package.json<15><>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/format-url <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/add-locale.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>./dist/client/add-locale.js @ C<><43>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><00><><EFBFBD><08><><EFBFBD> @ <0B><><EFBFBD> <0C><><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/add-locale <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router-context.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>./dist/shared/lib/router-context.js @ C<><43>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><15><15><01>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router-context<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15> <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/app-router-context.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>./dist/shared/lib/app-router-context.js @ C<><43>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><15><15><01>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/app-router-context<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15> <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/use-intersection.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>./dist/client/use-intersection.js @ C<><43>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> @<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/use-intersection <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/get-domain-locale.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>./dist/client/get-domain-locale.js @ C<><43>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>~<7E><><EFBFBD><16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> @<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/get-domain-locale <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/add-base-path.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>s<><73><EFBFBD><EFBFBD>./dist/client/add-base-path.js @ C<><43>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>p<><70><EFBFBD><16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> @<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/add-base-path <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD><15><18><> ~<7E><><EFBFBD><16><><EFBFBD><EFBFBD>f<><66><EFBFBD><15> @ PC<50><43>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>d<><64><EFBFBD>y<><79><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15> <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD><15><18><> v<><76><EFBFBD><16><><EFBFBD><EFBFBD>^<5E><><EFBFBD><15> @ `C<><43>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>\<5C><><EFBFBD>q<><71><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15> <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD><15><18><> n<><6E><EFBFBD><16><><EFBFBD><EFBFBD>V<><56><EFBFBD><15> @ pC<70><43>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>T<><54><EFBFBD>i<><69><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15> <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD><15><18><> f<><66><EFBFBD><16><><EFBFBD><EFBFBD>N<><4E><EFBFBD><15> @ <00>C<EFBFBD><43>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>L<><4C><EFBFBD>a<><61><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15>H"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addLocale = void 0;
var _normalizeTrailingSlash = require("./normalize-trailing-slash");
const addLocale = (path, ...args)=>{
if (process.env.__NEXT_I18N_SUPPORT) {
return (0, _normalizeTrailingSlash).normalizePathTrailingSlash(require("../shared/lib/router/utils/add-locale").addLocale(path, ...args));
}
return path;
};
exports.addLocale = addLocale;
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=add-locale.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/add-locale.js/{"version":3,"sources":["webpack://./node_modules/next/dist/client/add-locale.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.addLocale = void 0;\nvar _normalizeTrailingSlash = require(\"./normalize-trailing-slash\");\nconst addLocale = (path, ...args)=>{\n if (process.env.__NEXT_I18N_SUPPORT) {\n return (0, _normalizeTrailingSlash).normalizePathTrailingSlash(require('../shared/lib/router/utils/add-locale').addLocale(path, ...args));\n }\n return path;\n};\nexports.addLocale = addLocale;\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=add-locale.js.map"],"names":["Object","defineProperty","exports","value","addLocale","_normalizeTrailingSlash","require","path","args","process","env","__NEXT_I18N_SUPPORT","normalizePathTrailingSlash","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,SAAS,GAAG,KAAK;AACzB,IAAIC,0BAA0BC,QAAQ;AACtC,MAAMF,YAAY,CAACG,MAAM,GAAGC,OAAO;IAC/B,IAAIC,QAAQC,GAAG,CAACC,mBAAmB,EAAE;QACjC,OAAO,AAAC,CAAA,GAAGN,uBAAuB,AAAD,EAAGO,0BAA0B,CAACN,QAAQ,yCAAyCF,SAAS,CAACG,SAASC;IACvI,CAAC;IACD,OAAOD;AACX;AACAL,QAAQE,SAAS,GAAGA;AAEpB,IAAI,AAAC,CAAA,OAAOF,QAAQW,OAAO,KAAK,cAAe,OAAOX,QAAQW,OAAO,KAAK,YAAYX,QAAQW,OAAO,KAAK,IAAI,KAAM,OAAOX,QAAQW,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKd,OAAOC,cAAc,CAACC,QAAQW,OAAO,EAAE,cAAc;QAAEV,OAAO,IAAI;IAAC;IACnEH,OAAOe,MAAM,CAACb,QAAQW,OAAO,EAAEX;IAC/Bc,OAAOd,OAAO,GAAGA,QAAQW,OAAO;AAClC,CAAC,CAED,sCAAsC","file":"x"}`=<3D><><EFBFBD>  @<40><><EFBFBD>@<40><><EFBFBD><EFBFBD>C<><43><EFBFBD> <15><16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD>P<><50><EFBFBD><EFBFBD>webpack/DefinePlugin process.env.__NEXT_I18N_SUPPORTP<><50><EFBFBD><EFBFBD>false<17>68e2ec9b28f6055f <02>_normalizeTrailingSlash<73>addLocale @ <00>=<3D><>kxB9<><39><EFBFBD>N<><4E><EFBFBD><15>P<><50><EFBFBD><06>`  ` A<><00> bC<15>A<><00> 
<16><><EFBFBD><EFBFBD>A<00> b)
` aOa;N<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> aQb@<40><><EFBFBD><EFBFBD><15> `<02>./normalize-trailing-slash<15>A<><00> bCA<><00>@<40><><EFBFBD><EFBFBD><15> c A<><00><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c A<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c5DA#2<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>cUdAGa<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>by@<40>A<><00><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c)A<><00><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c!A<><00><16><><EFBFBD><EFBFBD>c#*A<> &<26><><EFBFBD>cA<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c$="use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getDomainLocale = getDomainLocale;
const basePath = process.env.__NEXT_ROUTER_BASEPATH || "";
function getDomainLocale(path, locale, locales, domainLocales) {
if (process.env.__NEXT_I18N_SUPPORT) {
const normalizeLocalePath = require("./normalize-locale-path").normalizeLocalePath;
const detectDomainLocale = require("./detect-domain-locale").detectDomainLocale;
const target = locale || normalizeLocalePath(path, locales).detectedLocale;
const domain = detectDomainLocale(domainLocales, undefined, target);
if (domain) {
const proto = `http${domain.http ? "" : "s"}://`;
const finalLocale = target === domain.defaultLocale ? "" : `/${target}`;
return `${proto}${domain.domain}${basePath}${finalLocale}${path}`;
}
return false;
} else {
return false;
}
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=get-domain-locale.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/get-domain-locale.js\ {"version":3,"sources":["webpack://./node_modules/next/dist/client/get-domain-locale.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getDomainLocale = getDomainLocale;\nconst basePath = process.env.__NEXT_ROUTER_BASEPATH || '';\nfunction getDomainLocale(path, locale, locales, domainLocales) {\n if (process.env.__NEXT_I18N_SUPPORT) {\n const normalizeLocalePath = require('./normalize-locale-path').normalizeLocalePath;\n const detectDomainLocale = require('./detect-domain-locale').detectDomainLocale;\n const target = locale || normalizeLocalePath(path, locales).detectedLocale;\n const domain = detectDomainLocale(domainLocales, undefined, target);\n if (domain) {\n const proto = `http${domain.http ? '' : 's'}://`;\n const finalLocale = target === domain.defaultLocale ? '' : `/${target}`;\n return `${proto}${domain.domain}${basePath}${finalLocale}${path}`;\n }\n return false;\n } else {\n return false;\n }\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=get-domain-locale.js.map"],"names":["Object","defineProperty","exports","value","getDomainLocale","basePath","process","env","__NEXT_ROUTER_BASEPATH","path","locale","locales","domainLocales","__NEXT_I18N_SUPPORT","normalizeLocalePath","require","detectDomainLocale","target","detectedLocale","domain","undefined","proto","http","finalLocale","defaultLocale","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,eAAe,GAAGA;AAC1B,MAAMC,WAAWC,QAAQC,GAAG,CAACC,sBAAsB,IAAI;AACvD,SAASJ,gBAAgBK,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAEC,aAAa,EAAE;IAC3D,IAAIN,QAAQC,GAAG,CAACM,mBAAmB,EAAE;QACjC,MAAMC,sBAAsBC,QAAQ,2BAA2BD,mBAAmB;QAClF,MAAME,qBAAqBD,QAAQ,0BAA0BC,kBAAkB;QAC/E,MAAMC,SAASP,UAAUI,oBAAoBL,MAAME,SAASO,cAAc;QAC1E,MAAMC,SAASH,mBAAmBJ,eAAeQ,WAAWH;QAC5D,IAAIE,QAAQ;YACR,MAAME,QAAQ,CAAC,IAAI,EAAEF,OAAOG,IAAI,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC;YAChD,MAAMC,cAAcN,WAAWE,OAAOK,aAAa,GAAG,KAAK,CAAC,CAAC,EAAEP,OAAO,CAAC;YACvE,OAAO,CAAC,EAAEI,MAAM,EAAEF,OAAOA,MAAM,CAAC,EAAEd,SAAS,EAAEkB,YAAY,EAAEd,KAAK,CAAC;QACrE,CAAC;QACD,OAAO,KAAK;IAChB,OAAO;QACH,OAAO,KAAK;IAChB,CAAC;AACL;AAEA,IAAI,AAAC,CAAA,OAAOP,QAAQuB,OAAO,KAAK,cAAe,OAAOvB,QAAQuB,OAAO,KAAK,YAAYvB,QAAQuB,OAAO,KAAK,IAAI,KAAM,OAAOvB,QAAQuB,OAAO,CAACC,UAAU,KAAK,aAAa;IACrK1B,OAAOC,cAAc,CAACC,QAAQuB,OAAO,EAAE,cAAc;QAAEtB,OAAO,IAAI;IAAC;IACnEH,OAAO2B,MAAM,CAACzB,QAAQuB,OAAO,EAAEvB;IAC/B0B,OAAO1B,OAAO,GAAGA,QAAQuB,OAAO;AAClC,CAAC,CAED,6CAA6C","file":"x"}`<16><><EFBFBD><EFBFBD>  <16><><EFBFBD><EFBFBD>@N<><4E><EFBFBD><16><><EFBFBD><EFBFBD> <15>q<><71><EFBFBD> r<><72><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>webpack/DefinePlugin process.env.__NEXT_ROUTER_BASEPATH<15>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>""<15><17>c5f659a8d1e98c46 <02>getDomainLocale<6C>basePath @ <00>=<3D><>kxB<16><><EFBFBD><EFBFBD><08><><EFBFBD>p<><70><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><06>`  ` <16><><EFBFBD><EFBFBD>A<><00> b9<15>A a<16><><EFBFBD><EFBFBD>A!<00> b)` aOa;N<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> aQh@<40><><EFBFBD><EFBFBD><15> `)A<><00><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c A<><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c5DA <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>cUdA5O<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>by@<40>A}<00><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c)A<><00><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c!A<><00><16><><EFBFBD><EFBFBD>c#*A<><00><16><><EFBFBD><EFBFBD>cA<> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c$<1F> "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useIntersection = useIntersection;
var _react = require("react");
var _requestIdleCallback = require("./request-idle-callback");
const hasIntersectionObserver = typeof IntersectionObserver === "function";
const observers = new Map();
const idList = [];
function createObserver(options) {
const id = {
root: options.root || null,
margin: options.rootMargin || ""
};
const existing = idList.find((obj)=>obj.root === id.root && obj.margin === id.margin);
let instance;
if (existing) {
instance = observers.get(existing);
if (instance) {
return instance;
}
}
const elements = new Map();
const observer = new IntersectionObserver((entries)=>{
entries.forEach((entry)=>{
const callback = elements.get(entry.target);
const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;
if (callback && isVisible) {
callback(isVisible);
}
});
}, options);
instance = {
id,
observer,
elements
};
idList.push(id);
observers.set(id, instance);
return instance;
}
function observe(element, callback, options) {
const { id , observer , elements } = createObserver(options);
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);
const index = idList.findIndex((obj)=>obj.root === id.root && obj.margin === id.margin);
if (index > -1) {
idList.splice(index, 1);
}
}
};
}
function useIntersection({ rootRef , rootMargin , disabled }) {
const isDisabled = disabled || !hasIntersectionObserver;
const [visible, setVisible] = (0, _react).useState(false);
const [element, setElement] = (0, _react).useState(null);
(0, _react).useEffect(()=>{
if (hasIntersectionObserver) {
if (isDisabled || visible) return;
if (element && element.tagName) {
const unobserve = observe(element, (isVisible)=>isVisible && setVisible(isVisible), {
root: rootRef == null ? void 0 : rootRef.current,
rootMargin
});
return unobserve;
}
} else {
if (!visible) {
const idleCallback = (0, _requestIdleCallback).requestIdleCallback(()=>setVisible(true));
return ()=>(0, _requestIdleCallback).cancelIdleCallback(idleCallback);
}
}
}, [
element,
isDisabled,
rootMargin,
rootRef,
visible
]);
const resetVisible = (0, _react).useCallback(()=>{
setVisible(false);
}, []);
return [
setElement,
visible,
resetVisible
];
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=use-intersection.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/use-intersection.js{"version":3,"sources":["webpack://./node_modules/next/dist/client/use-intersection.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.useIntersection = useIntersection;\nvar _react = require(\"react\");\nvar _requestIdleCallback = require(\"./request-idle-callback\");\nconst hasIntersectionObserver = typeof IntersectionObserver === 'function';\nconst observers = new Map();\nconst idList = [];\nfunction createObserver(options) {\n const id = {\n root: options.root || null,\n margin: options.rootMargin || ''\n };\n const existing = idList.find((obj)=>obj.root === id.root && obj.margin === id.margin);\n let instance;\n if (existing) {\n instance = observers.get(existing);\n if (instance) {\n return instance;\n }\n }\n const elements = new Map();\n const observer = new IntersectionObserver((entries)=>{\n entries.forEach((entry)=>{\n const callback = elements.get(entry.target);\n const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;\n if (callback && isVisible) {\n callback(isVisible);\n }\n });\n }, options);\n instance = {\n id,\n observer,\n elements\n };\n idList.push(id);\n observers.set(id, instance);\n return instance;\n}\nfunction observe(element, callback, options) {\n const { id , observer , elements } = createObserver(options);\n elements.set(element, callback);\n observer.observe(element);\n return function unobserve() {\n elements.delete(element);\n observer.unobserve(element);\n // Destroy observer when there's nothing left to watch:\n if (elements.size === 0) {\n observer.disconnect();\n observers.delete(id);\n const index = idList.findIndex((obj)=>obj.root === id.root && obj.margin === id.margin);\n if (index > -1) {\n idList.splice(index, 1);\n }\n }\n };\n}\nfunction useIntersection({ rootRef , rootMargin , disabled }) {\n const isDisabled = disabled || !hasIntersectionObserver;\n const [visible, setVisible] = (0, _react).useState(false);\n const [element, setElement] = (0, _react).useState(null);\n (0, _react).useEffect(()=>{\n if (hasIntersectionObserver) {\n if (isDisabled || visible) return;\n if (element && element.tagName) {\n const unobserve = observe(element, (isVisible)=>isVisible && setVisible(isVisible), {\n root: rootRef == null ? void 0 : rootRef.current,\n rootMargin\n });\n return unobserve;\n }\n } else {\n if (!visible) {\n const idleCallback = (0, _requestIdleCallback).requestIdleCallback(()=>setVisible(true));\n return ()=>(0, _requestIdleCallback).cancelIdleCallback(idleCallback);\n }\n }\n }, [\n element,\n isDisabled,\n rootMargin,\n rootRef,\n visible\n ]);\n const resetVisible = (0, _react).useCallback(()=>{\n setVisible(false);\n }, []);\n return [\n setElement,\n visible,\n resetVisible\n ];\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=use-intersection.js.map"],"names":["Object","defineProperty","exports","value","useIntersection","_react","require","_requestIdleCallback","hasIntersectionObserver","IntersectionObserver","observers","Map","idList",
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addBasePath = addBasePath;
var _addPathPrefix = require("../shared/lib/router/utils/add-path-prefix");
var _normalizeTrailingSlash = require("./normalize-trailing-slash");
const basePath = process.env.__NEXT_ROUTER_BASEPATH || "";
function addBasePath(path, required) {
if (process.env.__NEXT_MANUAL_CLIENT_BASE_PATH) {
if (!required) {
return path;
}
}
return (0, _normalizeTrailingSlash).normalizePathTrailingSlash((0, _addPathPrefix).addPathPrefix(path, basePath));
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=add-base-path.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/add-base-path.js|{"version":3,"sources":["webpack://./node_modules/next/dist/client/add-base-path.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.addBasePath = addBasePath;\nvar _addPathPrefix = require(\"../shared/lib/router/utils/add-path-prefix\");\nvar _normalizeTrailingSlash = require(\"./normalize-trailing-slash\");\nconst basePath = process.env.__NEXT_ROUTER_BASEPATH || '';\nfunction addBasePath(path, required) {\n if (process.env.__NEXT_MANUAL_CLIENT_BASE_PATH) {\n if (!required) {\n return path;\n }\n }\n return (0, _normalizeTrailingSlash).normalizePathTrailingSlash((0, _addPathPrefix).addPathPrefix(path, basePath));\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=add-base-path.js.map"],"names":["Object","defineProperty","exports","value","addBasePath","_addPathPrefix","require","_normalizeTrailingSlash","basePath","process","env","__NEXT_ROUTER_BASEPATH","path","required","__NEXT_MANUAL_CLIENT_BASE_PATH","normalizePathTrailingSlash","addPathPrefix","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,WAAW,GAAGA;AACtB,IAAIC,iBAAiBC,QAAQ;AAC7B,IAAIC,0BAA0BD,QAAQ;AACtC,MAAME,WAAWC,QAAQC,GAAG,CAACC,sBAAsB,IAAI;AACvD,SAASP,YAAYQ,IAAI,EAAEC,QAAQ,EAAE;IACjC,IAAIJ,QAAQC,GAAG,CAACI,8BAA8B,EAAE;QAC5C,IAAI,CAACD,UAAU;YACX,OAAOD;QACX,CAAC;IACL,CAAC;IACD,OAAO,AAAC,CAAA,GAAGL,uBAAuB,AAAD,EAAGQ,0BAA0B,CAAC,AAAC,CAAA,GAAGV,cAAc,AAAD,EAAGW,aAAa,CAACJ,MAAMJ;AAC3G;AAEA,IAAI,AAAC,CAAA,OAAON,QAAQe,OAAO,KAAK,cAAe,OAAOf,QAAQe,OAAO,KAAK,YAAYf,QAAQe,OAAO,KAAK,IAAI,KAAM,OAAOf,QAAQe,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKlB,OAAOC,cAAc,CAACC,QAAQe,OAAO,EAAE,cAAc;QAAEd,OAAO,IAAI;IAAC;IACnEH,OAAOmB,MAAM,CAACjB,QAAQe,OAAO,EAAEf;IAC/BkB,OAAOlB,OAAO,GAAGA,QAAQe,OAAO;AAClC,CAAC,CAED,yCAAyC","file":"x"}`q<><71><EFBFBD>  t<><74><EFBFBD>@<40><><EFBFBD><EFBFBD>w<><77><EFBFBD> <15><16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>z<><7A><EFBFBD><EFBFBD>webpack/DefinePlugin process.env.__NEXT_MANUAL_CLIENT_BASE_PATH<16><><EFBFBD><EFBFBD>z<><7A><EFBFBD>4<><34><EFBFBD><17>868bb70450d3cc11 <04>_addPathPrefix4<><34><EFBFBD><EFBFBD>addBasePathz<><7A><EFBFBD> @ <00>=<3D><>kxBn<><6E><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><06>`  ` A<><00> bJA<><00> bC<12><><EFBFBD>A8 b9#<23><><EFBFBD>Ao<00>
a<19><><EFBFBD>A<><00>
b4` aOa;N$<24><><EFBFBD>%<25><><EFBFBD> aQd@&<26><><EFBFBD><15> `!<02>../shared/lib/router/utils/add-path-prefix<15>A<><00> bJ.<2E><><EFBFBD>.<2E><><EFBFBD>A<> bCAds<1E><><EFBFBD><1F><><EFBFBD>c A<><00><1B><><EFBFBD><1C><><EFBFBD>c5DA<><00><18><><EFBFBD><19><><EFBFBD>cUdA<><00><15><><EFBFBD><16><><EFBFBD><11><><EFBFBD>by@<40>A(<12><><EFBFBD><13><><EFBFBD>c)Ahw<0F><><EFBFBD><10><><EFBFBD>c!Ay<00> <0C><><EFBFBD>c#*A<><00>X<><58><EFBFBD>cA<><00><06><><EFBFBD><07><><EFBFBD>c$ <0B>next/dist/shared/lib/router-context.jsX<><58><EFBFBD><17><><EFBFBD>Y<><59><EFBFBD>@Z<><5A><EFBFBD> \<5C><><EFBFBD> .<2E><><EFBFBD>_<><5F><EFBFBD>  
 <0B>next/dist/shared/lib/app-router-context.jsP<><50><EFBFBD><12><><EFBFBD>Q<><51><EFBFBD>@R<><52><EFBFBD> T<><54><EFBFBD> &<26><><EFBFBD>W<><57><EFBFBD>  
 e<><65><EFBFBD> <16><><EFBFBD><EFBFBD>g<><67><EFBFBD>@<40><><EFBFBD><EFBFBD>@<40><><EFBFBD><18><> :<3A><><EFBFBD>e<><65><EFBFBD>"<22><><EFBFBD>A<><41><EFBFBD> @ <00>C<EFBFBD><43>kxBg<><67><EFBFBD>h<><68><EFBFBD> <20><><EFBFBD>5<><35><EFBFBD>C<><43><EFBFBD>D<><44><EFBFBD>o<><6F><EFBFBD>u<><75><EFBFBD>S<><53><EFBFBD>K<><4B><EFBFBD><1F>L"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.matchesMiddleware = matchesMiddleware;
exports.isLocalURL = isLocalURL;
exports.interpolateAs = interpolateAs;
exports.resolveHref = resolveHref;
exports.createKey = createKey;
exports.default = void 0;
var _async_to_generator = require("@swc/helpers/lib/_async_to_generator.js").default;
var _extends = require("@swc/helpers/lib/_extends.js").default;
var _interop_require_default = require("@swc/helpers/lib/_interop_require_default.js").default;
var _interop_require_wildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
var _normalizeTrailingSlash = require("../../../client/normalize-trailing-slash");
var _removeTrailingSlash = require("./utils/remove-trailing-slash");
var _routeLoader = require("../../../client/route-loader");
var _script = require("../../../client/script");
var _isError = _interop_require_wildcard(require("../../../lib/is-error"));
var _denormalizePagePath = require("../page-path/denormalize-page-path");
var _normalizeLocalePath = require("../i18n/normalize-locale-path");
var _mitt = _interop_require_default(require("../mitt"));
var _utils = require("../utils");
var _isDynamic = require("./utils/is-dynamic");
var _parseRelativeUrl = require("./utils/parse-relative-url");
var _querystring = require("./utils/querystring");
var _resolveRewrites = _interop_require_default(require("./utils/resolve-rewrites"));
var _routeMatcher = require("./utils/route-matcher");
var _routeRegex = require("./utils/route-regex");
var _formatUrl = require("./utils/format-url");
var _detectDomainLocale = require("../../../client/detect-domain-locale");
var _parsePath = require("./utils/parse-path");
var _addLocale = require("../../../client/add-locale");
var _removeLocale = require("../../../client/remove-locale");
var _removeBasePath = require("../../../client/remove-base-path");
var _addBasePath = require("../../../client/add-base-path");
var _hasBasePath = require("../../../client/has-base-path");
var _isApiRoute = require("../../../lib/is-api-route");
var _getNextPathnameInfo = require("./utils/get-next-pathname-info");
var _formatNextPathnameInfo = require("./utils/format-next-pathname-info");
var _compareStates = require("./utils/compare-states");
var _isBot = require("./utils/is-bot");
function buildCancellationError() {
return Object.assign(new Error("Route Cancelled"), {
cancelled: true
});
}
function matchesMiddleware(options) {
return _matchesMiddleware.apply(this, arguments);
}
function _matchesMiddleware() {
_matchesMiddleware = _async_to_generator(function*(options) {
const matchers = yield Promise.resolve(options.router.pageLoader.getMiddleware());
if (!matchers) return false;
const { pathname: asPathname } = (0, _parsePath).parsePath(options.asPath);
// remove basePath first since path prefix has to be in the order of `/${basePath}/${locale}`
const cleanedAs = (0, _hasBasePath).hasBasePath(asPathname) ? (0, _removeBasePath).removeBasePath(asPathname) : asPathname;
const asWithBasePathAndLocale = (0, _addBasePath).addBasePath((0, _addLocale).addLocale(cleanedAs, options.locale));
// Check only path match on client. Matching "has" should be done on server
// where we can access more info such as headers, HttpOnly cookie, etc.
return matchers.some((m)=>new RegExp(m.regexp).test(asWithBasePathAndLocale));
});
return _matchesMiddleware.apply(this, arguments);
}
function stripOrigin(url) {
const origin = (0, _utils).getLocationOrigin();
return url.startsWith(origin) ? url.substring(origin.length) : url;
}
function omit(object, keys) {
const omitted = {};
Object.keys(object).forEach((key)=>{
if (!keys.includes(key)) {
omitted[key] = object[key];
}
});
return omitted;
}
function isLocalURL(url) {
// prevent a hydration mismatch on href for url with anchor refs
if (!(0, _utils).isAbsoluteUrl(url)) return true;
try {
// absolute urls can be local if they are on the same origin
const locationOrigin = (0, _utils).getLocationOrigin();
const resolved = new URL(url, locationOrigin);
return resolved.origin === locationOrigin && (0, _hasBasePath).hasBasePath(resolved.pathname);
} catch (_) {
return false;
}
}
function interpolateAs(route, asPathname, query) {
let interpolatedRoute = "";
const dynamicRegex = (0, _routeRegex).getRouteRegex(route);
const dynamicGroups = dynamicRegex.groups;
const dynamicMatches = (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;
const params = Object.keys(dynamicGroups);
if (!params.every((param)=>{
let value = dynamicMatches[param] || "";
const { repeat , optional } = dynamicGroups[param];
// support single-level catch-all
// TODO: more robust handling for user-error (passing `/`)
let replaced = `[${repeat ? "..." : ""}${param}]`;
if (optional) {
replaced = `${!value ? "/" : ""}[${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(// path delimiter escaped since they are being inserted
// into the URL and we expect URL encoded segments
// when parsing dynamic route params
(segment)=>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 `<Link>` component directly.
}
return {
params,
result: interpolatedRoute
};
}
function resolveHref(router, href, resolveAs) {
// we use a dummy base url for relative urls
let base;
let urlAsString = typeof href === "string" ? href : (0, _formatUrl).formatWithValidation(href);
// repeated slashes and backslashes in the URL are considered
// invalid and will never match a Next.js page/file
const urlProtoMatch = urlAsString.match(/^[a-zA-Z]{1,}:\/\//);
const urlAsStringNoProto = urlProtoMatch ? urlAsString.slice(urlProtoMatch[0].length) : urlAsString;
const urlParts = urlAsStringNoProto.split("?");
if ((urlParts[0] || "").match(/(\/\/|\\)/)) {
console.error(`Invalid href passed to next/router: ${urlAsString}, repeated forward-slashes (//) or backslashes \\ are not valid in the href`);
const normalizedUrl = (0, _utils).normalizeRepeatedSlashes(urlAsStringNoProto);
urlAsString = (urlProtoMatch ? urlProtoMatch[0] : "") + normalizedUrl;
}
// Return because it cannot be routed by the Next.js router
if (!isLocalURL(urlAsString)) {
return resolveAs ? [
urlAsString
] : urlAsString;
}
try {
base = new URL(urlAsString.startsWith("#") ? router.asPath : router.pathname, "http://n");
} catch (_) {
// fallback to / for invalid asPath values e.g. //
base = new URL("/", "http://n");
}
try {
const finalUrl = new URL(urlAsString, base);
finalUrl.pathname = (0, _normalizeTrailingSlash).normalizePathTrailingSlash(finalUrl.pathname);
let interpolatedAs = "";
if ((0, _isDynamic).isDynamicRoute(finalUrl.pathname) && finalUrl.searchParams && resolveAs) {
const query = (0, _querystring).searchParamsToUrlQuery(finalUrl.searchParams);
const { result , params } = interpolateAs(finalUrl.pathname, finalUrl.pathname, query);
if (result) {
interpolatedAs = (0, _formatUrl).formatWithValidation({
pathname: result,
hash: finalUrl.hash,
query: omit(query, params)
});
}
}
// if the origin didn't change, it means we received a relative href
const resolvedHref = finalUrl.origin === base.origin ? finalUrl.href.slice(finalUrl.origin.length) : finalUrl.href;
return resolveAs ? [
resolvedHref,
interpolatedAs || resolvedHref
] : resolvedHref;
} catch (_1) {
return resolveAs ? [
urlAsString
] : urlAsString;
}
}
function prepareUrlAs(router, url, as) {
// If url and as provided as an object representation,
// we'll format them into the string version here.
let [resolvedHref, resolvedAs] = resolveHref(router, url, true);
const origin = (0, _utils).getLocationOrigin();
const hrefWasAbsolute = resolvedHref.startsWith(origin);
const asWasAbsolute = resolvedAs && resolvedAs.startsWith(origin);
resolvedHref = stripOrigin(resolvedHref);
resolvedAs = resolvedAs ? stripOrigin(resolvedAs) : resolvedAs;
const preparedUrl = hrefWasAbsolute ? resolvedHref : (0, _addBasePath).addBasePath(resolvedHref);
const preparedAs = as ? stripOrigin(resolveHref(router, as)) : resolvedAs || resolvedHref;
return {
url: preparedUrl,
as: asWasAbsolute ? preparedAs : (0, _addBasePath).addBasePath(preparedAs)
};
}
function resolveDynamicRoute(pathname, pages) {
const cleanPathname = (0, _removeTrailingSlash).removeTrailingSlash((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((page)=>{
if ((0, _isDynamic).isDynamicRoute(page) && (0, _routeRegex).getRouteRegex(page).re.test(cleanPathname)) {
pathname = page;
return true;
}
});
}
return (0, _removeTrailingSlash).removeTrailingSlash(pathname);
}
function getMiddlewareData(source, response, options) {
const nextConfig = {
basePath: options.router.basePath,
i18n: {
locales: options.router.locales
},
trailingSlash: Boolean(process.env.__NEXT_TRAILING_SLASH)
};
const rewriteHeader = response.headers.get("x-nextjs-rewrite");
let rewriteTarget = rewriteHeader || response.headers.get("x-nextjs-matched-path");
const matchedPath = response.headers.get("x-matched-path");
if (matchedPath && !rewriteTarget && !matchedPath.includes("__next_data_catchall") && !matchedPath.includes("/_error") && !matchedPath.includes("/404")) {
// leverage x-matched-path to detect next.config.js rewrites
rewriteTarget = matchedPath;
}
if (rewriteTarget) {
if (rewriteTarget.startsWith("/")) {
const parsedRewriteTarget = (0, _parseRelativeUrl).parseRelativeUrl(rewriteTarget);
const pathnameInfo = (0, _getNextPathnameInfo).getNextPathnameInfo(parsedRewriteTarget.pathname, {
nextConfig,
parseData: true
});
let fsPathname = (0, _removeTrailingSlash).removeTrailingSlash(pathnameInfo.pathname);
return Promise.all([
options.router.pageLoader.getPageList(),
(0, _routeLoader).getClientBuildManifest()
]).then(([pages, { __rewrites: rewrites }])=>{
let as = (0, _addLocale).addLocale(pathnameInfo.pathname, pathnameInfo.locale);
if ((0, _isDynamic).isDynamicRoute(as) || !rewriteHeader && pages.includes((0, _normalizeLocalePath).normalizeLocalePath((0, _removeBasePath).removeBasePath(as), options.router.locales).pathname)) {
const parsedSource = (0, _getNextPathnameInfo).getNextPathnameInfo((0, _parseRelativeUrl).parseRelativeUrl(source).pathname, {
parseData: true
});
as = (0, _addBasePath).addBasePath(parsedSource.pathname);
parsedRewriteTarget.pathname = as;
}
if (process.env.__NEXT_HAS_REWRITES) {
const result = (0, _resolveRewrites).default(as, pages, rewrites, parsedRewriteTarget.query, (path)=>resolveDynamicRoute(path, pages), options.router.locales);
if (result.matchedPage) {
parsedRewriteTarget.pathname = result.parsedAs.pathname;
as = parsedRewriteTarget.pathname;
Object.assign(parsedRewriteTarget.query, result.parsedAs.query);
}
} else if (!pages.includes(fsPathname)) {
const resolvedPathname = resolveDynamicRoute(fsPathname, pages);
if (resolvedPathname !== fsPathname) {
fsPathname = resolvedPathname;
}
}
const resolvedHref = !pages.includes(fsPathname) ? resolveDynamicRoute((0, _normalizeLocalePath).normalizeLocalePath((0, _removeBasePath).removeBasePath(parsedRewriteTarget.pathname), options.router.locales).pathname, pages) : fsPathname;
if ((0, _isDynamic).isDynamicRoute(resolvedHref)) {
const matches = (0, _routeMatcher).getRouteMatcher((0, _routeRegex).getRouteRegex(resolvedHref))(as);
Object.assign(parsedRewriteTarget.query, matches || {});
}
return {
type: "rewrite",
parsedAs: parsedRewriteTarget,
resolvedHref
};
});
}
const src = (0, _parsePath).parsePath(source);
const pathname = (0, _formatNextPathnameInfo).formatNextPathnameInfo(_extends({}, (0, _getNextPathnameInfo).getNextPathnameInfo(src.pathname, {
nextConfig,
parseData: true
}), {
defaultLocale: options.router.defaultLocale,
buildId: ""
}));
return Promise.resolve({
type: "redirect-external",
destination: `${pathname}${src.query}${src.hash}`
});
}
const redirectTarget = response.headers.get("x-nextjs-redirect");
if (redirectTarget) {
if (redirectTarget.startsWith("/")) {
const src1 = (0, _parsePath).parsePath(redirectTarget);
const pathname1 = (0, _formatNextPathnameInfo).formatNextPathnameInfo(_extends({}, (0, _getNextPathnameInfo).getNextPathnameInfo(src1.pathname, {
nextConfig,
parseData: true
}), {
defaultLocale: options.router.defaultLocale,
buildId: ""
}));
return Promise.resolve({
type: "redirect-internal",
newAs: `${pathname1}${src1.query}${src1.hash}`,
newUrl: `${pathname1}${src1.query}${src1.hash}`
});
}
return Promise.resolve({
type: "redirect-external",
destination: redirectTarget
});
}
return Promise.resolve({
type: "next"
});
}
function withMiddlewareEffects(options) {
return _withMiddlewareEffects.apply(this, arguments);
}
function _withMiddlewareEffects() {
_withMiddlewareEffects = _async_to_generator(function*(options) {
const matches = yield matchesMiddleware(options);
if (!matches || !options.fetchData) {
return null;
}
try {
const data = yield options.fetchData();
const effect = yield getMiddlewareData(data.dataHref, data.response, options);
return {
dataHref: data.dataHref,
json: data.json,
response: data.response,
text: data.text,
cacheKey: data.cacheKey,
effect
};
} catch (e) {
/**
* TODO: Revisit this in the future.
* For now we will not consider middleware data errors to be fatal.
* maybe we should revisit in the future.
*/ return null;
}
});
return _withMiddlewareEffects.apply(this, arguments);
}
const manualScrollRestoration = process.env.__NEXT_SCROLL_RESTORATION && "undefined" !== "undefined" && "scrollRestoration" in window.history && !!function() {
try {
let v = "__next";
// eslint-disable-next-line no-sequences
return sessionStorage.setItem(v, v), sessionStorage.removeItem(v), true;
} catch (n) {}
}();
const SSG_DATA_NOT_FOUND = Symbol("SSG_DATA_NOT_FOUND");
function fetchRetry(url, attempts, options) {
return fetch(url, {
// Cookies are required to be present for Next.js' SSG "Preview Mode".
// Cookies may also be required for `getServerSideProps`.
//
// > `fetch` wont 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",
method: options.method || "GET",
headers: Object.assign({}, options.headers, {
"x-nextjs-data": "1"
})
}).then((response)=>{
return !response.ok && attempts > 1 && response.status >= 500 ? fetchRetry(url, attempts - 1, options) : response;
});
}
function handleSmoothScroll(fn) {
const htmlElement = document.documentElement;
const existing = htmlElement.style.scrollBehavior;
htmlElement.style.scrollBehavior = "auto";
// In Chrome-based browsers we need to force reflow before calling `scrollTo`.
// Otherwise it will not pickup the change in scrollBehavior
// More info here: https://github.com/vercel/next.js/issues/40719#issuecomment-1336248042
htmlElement.getClientRects();
fn();
htmlElement.style.scrollBehavior = existing;
}
function tryToParseAsJSON(text) {
try {
return JSON.parse(text);
} catch (error) {
return null;
}
}
function fetchNextData({ dataHref , inflightCache , isPrefetch , hasMiddleware , isServerRender , parseJSON , persistCache , isBackground , unstable_skipClientCache }) {
const { href: cacheKey } = new URL(dataHref, window.location.href);
var ref1;
const getData = (params)=>{
return fetchRetry(dataHref, isServerRender ? 3 : 1, {
headers: Object.assign({}, isPrefetch ? {
purpose: "prefetch"
} : {}, isPrefetch && hasMiddleware ? {
"x-middleware-prefetch": "1"
} : {}),
method: (ref1 = params == null ? void 0 : params.method) != null ? ref1 : "GET"
}).then((response)=>{
if (response.ok && (params == null ? void 0 : params.method) === "HEAD") {
return {
dataHref,
response,
text: "",
json: {},
cacheKey
};
}
return response.text().then((text)=>{
if (!response.ok) {
/**
* When the data response is a redirect because of a middleware
* we do not consider it an error. The headers must bring the
* mapped location.
* TODO: Change the status code in the handler.
*/ if (hasMiddleware && [
301,
302,
307,
308
].includes(response.status)) {
return {
dataHref,
response,
text,
json: {},
cacheKey
};
}
if (!hasMiddleware && response.status === 404) {
var ref;
if ((ref = tryToParseAsJSON(text)) == null ? void 0 : ref.notFound) {
return {
dataHref,
json: {
notFound: SSG_DATA_NOT_FOUND
},
response,
text,
cacheKey
};
}
}
const error = new Error(`Failed to load static props`);
/**
* 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(error);
}
throw error;
}
return {
dataHref,
json: parseJSON ? tryToParseAsJSON(text) : null,
response,
text,
cacheKey
};
});
}).then((data)=>{
if (!persistCache || "development" !== "production" || data.response.headers.get("x-middleware-cache") === "no-cache") {
delete inflightCache[cacheKey];
}
return data;
}).catch((err)=>{
if (!unstable_skipClientCache) {
delete inflightCache[cacheKey];
}
if (err.message === "Failed to fetch") {
(0, _routeLoader).markAssetError(err);
}
throw err;
});
};
// when skipping client cache we wait to update
// inflight cache until successful data response
// this allows racing click event with fetching newer data
// without blocking navigation when stale data is available
if (unstable_skipClientCache && persistCache) {
return getData({}).then((data)=>{
inflightCache[cacheKey] = Promise.resolve(data);
return data;
});
}
if (inflightCache[cacheKey] !== undefined) {
return inflightCache[cacheKey];
}
return inflightCache[cacheKey] = getData(isBackground ? {
method: "HEAD"
} : {});
}
function createKey() {
return Math.random().toString(36).slice(2, 10);
}
function handleHardNavigation({ url , router }) {
// ensure we don't trigger a hard navigation to the same
// URL as this can end up with an infinite refresh
if (url === (0, _addBasePath).addBasePath((0, _addLocale).addLocale(router.asPath, router.locale))) {
throw new Error(`Invariant: attempted to hard navigate to the same URL ${url} ${location.href}`);
}
window.location.href = url;
}
const getCancelledHandler = ({ route , router })=>{
let cancelled = false;
const cancel = router.clc = ()=>{
cancelled = true;
};
const handleCancelled = ()=>{
if (cancelled) {
const error = new Error(`Abort fetching component for route: "${route}"`);
error.cancelled = true;
throw error;
}
if (cancel === router.clc) {
router.clc = null;
}
};
return handleCancelled;
};
class Router {
reload() {
window.location.reload();
}
/**
* Go back in history
*/ back() {
window.history.back();
}
/**
* Go forward in history
*/ forward() {
window.history.forward();
}
/**
* 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
*/ push(url, as, options = {}) {
if (process.env.__NEXT_SCROLL_RESTORATION) {
// TODO: remove in the future when we update history before route change
// is complete, as the popstate event should handle this capture.
if (manualScrollRestoration) {
try {
// Snapshot scroll position right before navigating to a new page:
sessionStorage.setItem("__next_scroll_" + this._key, JSON.stringify({
x: self.pageXOffset,
y: self.pageYOffset
}));
} catch (e) {}
}
}
({ url , as } = prepareUrlAs(this, url, 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
*/ replace(url, as, options = {}) {
({ url , as } = prepareUrlAs(this, url, as));
return this.change("replaceState", url, as, options);
}
change(method, url, as, options, forcedScroll) {
var _this = this;
return _async_to_generator(function*() {
if (!isLocalURL(url)) {
handleHardNavigation({
url,
router: _this
});
return false;
}
// 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.
const isQueryUpdating = options._h === 1;
let shouldResolveHref = isQueryUpdating || options._shouldResolveHref || (0, _parsePath).parsePath(url).pathname === (0, _parsePath).parsePath(as).pathname;
const nextState = _extends({}, _this.state);
// for static pages with query params in the URL we delay
// marking the router ready until after the query is updated
// or a navigation has occurred
const readyStateChange = _this.isReady !== true;
_this.isReady = true;
const isSsr = _this.isSsr;
if (!isQueryUpdating) {
_this.isSsr = false;
}
// if a route transition is already in progress before
// the query updating is triggered ignore query updating
if (isQueryUpdating && _this.clc) {
return false;
}
const prevLocale = nextState.locale;
if (process.env.__NEXT_I18N_SUPPORT) {
nextState.locale = options.locale === false ? _this.defaultLocale : options.locale || nextState.locale;
if (typeof options.locale === "undefined") {
options.locale = nextState.locale;
}
const parsedAs = (0, _parseRelativeUrl).parseRelativeUrl((0, _hasBasePath).hasBasePath(as) ? (0, _removeBasePath).removeBasePath(as) : as);
const localePathResult = (0, _normalizeLocalePath).normalizeLocalePath(parsedAs.pathname, _this.locales);
if (localePathResult.detectedLocale) {
nextState.locale = localePathResult.detectedLocale;
parsedAs.pathname = (0, _addBasePath).addBasePath(parsedAs.pathname);
as = (0, _formatUrl).formatWithValidation(parsedAs);
url = (0, _addBasePath).addBasePath((0, _normalizeLocalePath).normalizeLocalePath((0, _hasBasePath).hasBasePath(url) ? (0, _removeBasePath).removeBasePath(url) : url, _this.locales).pathname);
}
let 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 (process.env.__NEXT_I18N_SUPPORT) {
var ref;
// if the locale isn't configured hard navigate to show 404 page
if (!((ref = _this.locales) == null ? void 0 : ref.includes(nextState.locale))) {
parsedAs.pathname = (0, _addLocale).addLocale(parsedAs.pathname, nextState.locale);
handleHardNavigation({
url: (0, _formatUrl).formatWithValidation(parsedAs),
router: _this
});
// this was previously a return but was removed in favor
// of better dead code elimination with regenerator runtime
didNavigate = true;
}
}
const detectedDomain = (0, _detectDomainLocale).detectDomainLocale(_this.domainLocales, undefined, nextState.locale);
// we need to wrap this in the env check again since regenerator runtime
// moves this on its own due to the return
if (process.env.__NEXT_I18N_SUPPORT) {
// 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) {
const asNoBasePath = (0, _removeBasePath).removeBasePath(as);
handleHardNavigation({
url: `http${detectedDomain.http ? "" : "s"}://${detectedDomain.domain}${(0, _addBasePath).addBasePath(`${nextState.locale === detectedDomain.defaultLocale ? "" : `/${nextState.locale}`}${asNoBasePath === "/" ? "" : asNoBasePath}` || "/")}`,
router: _this
});
// this was previously a return but was removed in favor
// of better dead code elimination with regenerator runtime
didNavigate = true;
}
}
if (didNavigate) {
return new Promise(()=>{});
}
}
// marking route changes as a navigation start entry
if (_utils.ST) {
performance.mark("routeChange");
}
const { shallow =false , scroll =true } = options;
const routeProps = {
shallow
};
if (_this._inFlightRoute && _this.clc) {
if (!isSsr) {
Router.events.emit("routeChangeError", buildCancellationError(), _this._inFlightRoute, routeProps);
}
_this.clc();
_this.clc = null;
}
as = (0, _addBasePath).addBasePath((0, _addLocale).addLocale((0, _hasBasePath).hasBasePath(as) ? (0, _removeBasePath).removeBasePath(as) : as, options.locale, _this.defaultLocale));
const cleanedAs = (0, _removeLocale).removeLocale((0, _hasBasePath).hasBasePath(as) ? (0, _removeBasePath).removeBasePath(as) : as, nextState.locale);
_this._inFlightRoute = as;
const localeChange = prevLocale !== nextState.locale;
// If the url change is only related to a hash change
// We should not proceed. We should only change the state.
if (!isQueryUpdating && _this.onlyAHashChange(cleanedAs) && !localeChange) {
nextState.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, _extends({}, options, {
scroll: false
}));
if (scroll) {
_this.scrollToHash(cleanedAs);
}
try {
yield _this.set(nextState, _this.components[nextState.route], null);
} catch (err) {
if ((0, _isError).default(err) && err.cancelled) {
Router.events.emit("routeChangeError", err, cleanedAs, routeProps);
}
throw err;
}
Router.events.emit("hashChangeComplete", as, routeProps);
return true;
}
let parsed = (0, _parseRelativeUrl).parseRelativeUrl(url);
let { pathname , query } = parsed;
// 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
let pages, rewrites;
try {
[pages, { __rewrites: rewrites }] = yield Promise.all([
_this.pageLoader.getPageList(),
(0, _routeLoader).getClientBuildManifest(),
_this.pageLoader.getMiddleware()
]);
} catch (err1) {
// If we fail to resolve the page list or client-build manifest, we must
// do a server-side transition:
handleHardNavigation({
url: as,
router: _this
});
return false;
}
// 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
let 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, _removeTrailingSlash).removeTrailingSlash((0, _removeBasePath).removeBasePath(pathname)) : pathname;
let route = (0, _removeTrailingSlash).removeTrailingSlash(pathname);
const parsedAsPathname = as.startsWith("/") && (0, _parseRelativeUrl).parseRelativeUrl(as).pathname;
const isMiddlewareRewrite = !!(parsedAsPathname && route !== parsedAsPathname && (!(0, _isDynamic).isDynamicRoute(route) || !(0, _routeMatcher).getRouteMatcher((0, _routeRegex).getRouteRegex(route))(parsedAsPathname)));
// we don't attempt resolve asPath when we need to execute
// middleware as the resolving will occur server-side
const isMiddlewareMatch = !options.shallow && (yield matchesMiddleware({
asPath: as,
locale: nextState.locale,
router: _this
}));
if (isQueryUpdating && isMiddlewareMatch) {
shouldResolveHref = false;
}
if (shouldResolveHref && pathname !== "/_error") {
options._shouldResolveHref = true;
if (process.env.__NEXT_HAS_REWRITES && as.startsWith("/")) {
const rewritesResult = (0, _resolveRewrites).default((0, _addBasePath).addBasePath((0, _addLocale).addLocale(cleanedAs, nextState.locale), true), pages, rewrites, query, (p)=>resolveDynamicRoute(p, pages), _this.locales);
if (rewritesResult.externalDest) {
handleHardNavigation({
url: as,
router: _this
});
return true;
}
if (!isMiddlewareMatch) {
resolvedAs = rewritesResult.asPath;
}
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 = (0, _addBasePath).addBasePath(pathname);
if (!isMiddlewareMatch) {
url = (0, _formatUrl).formatWithValidation(parsed);
}
}
} else {
parsed.pathname = resolveDynamicRoute(pathname, pages);
if (parsed.pathname !== pathname) {
pathname = parsed.pathname;
parsed.pathname = (0, _addBasePath).addBasePath(pathname);
if (!isMiddlewareMatch) {
url = (0, _formatUrl).formatWithValidation(parsed);
}
}
}
}
if (!isLocalURL(as)) {
if ("development" !== "production") {
throw new Error(`Invalid href: "${url}" and as: "${as}", received relative href and external as` + `\nSee more info: https://nextjs.org/docs/messages/invalid-relative-url-external-as`);
}
handleHardNavigation({
url: as,
router: _this
});
return false;
}
resolvedAs = (0, _removeLocale).removeLocale((0, _removeBasePath).removeBasePath(resolvedAs), nextState.locale);
route = (0, _removeTrailingSlash).removeTrailingSlash(pathname);
let routeMatch = false;
if ((0, _isDynamic).isDynamicRoute(route)) {
const parsedAs1 = (0, _parseRelativeUrl).parseRelativeUrl(resolvedAs);
const asPathname = parsedAs1.pathname;
const routeRegex = (0, _routeRegex).getRouteRegex(route);
routeMatch = (0, _routeMatcher).getRouteMatcher(routeRegex)(asPathname);
const shouldInterpolate = route === asPathname;
const interpolatedAs = shouldInterpolate ? interpolateAs(route, asPathname, query) : {};
if (!routeMatch || shouldInterpolate && !interpolatedAs.result) {
const missingParams = Object.keys(routeRegex.groups).filter((param)=>!query[param] && !routeRegex.groups[param].optional);
if (missingParams.length > 0 && !isMiddlewareMatch) {
if ("development" !== "production") {
console.warn(`${shouldInterpolate ? `Interpolating href` : `Mismatching \`as\` and \`href\``} failed to manually provide ` + `the params: ${missingParams.join(", ")} in the \`href\`'s \`query\``);
}
throw new Error((shouldInterpolate ? `The provided \`href\` (${url}) value is missing query values (${missingParams.join(", ")}) to be interpolated properly. ` : `The provided \`as\` value (${asPathname}) is incompatible with the \`href\` value (${route}). `) + `Read more: https://nextjs.org/docs/messages/${shouldInterpolate ? "href-interpolation-failed" : "incompatible-href-as"}`);
}
} else if (shouldInterpolate) {
as = (0, _formatUrl).formatWithValidation(Object.assign({}, parsedAs1, {
pathname: interpolatedAs.result,
query: omit(query, interpolatedAs.params)
}));
} else {
// Merge params into `query`, overwriting any specified in search
Object.assign(query, routeMatch);
}
}
if (!isQueryUpdating) {
Router.events.emit("routeChangeStart", as, routeProps);
}
try {
var ref2, ref3, ref4;
let routeInfo = yield _this.getRouteInfo({
route,
pathname,
query,
as,
resolvedAs,
routeProps,
locale: nextState.locale,
isPreview: nextState.isPreview,
hasMiddleware: isMiddlewareMatch,
unstable_skipClientCache: options.unstable_skipClientCache,
isQueryUpdating: isQueryUpdating && !_this.isFallback,
isMiddlewareRewrite
});
if ("route" in routeInfo && isMiddlewareMatch) {
pathname = routeInfo.route || route;
route = pathname;
if (!routeProps.shallow) {
query = Object.assign({}, routeInfo.query || {}, query);
}
const cleanedParsedPathname = (0, _hasBasePath).hasBasePath(parsed.pathname) ? (0, _removeBasePath).removeBasePath(parsed.pathname) : parsed.pathname;
if (routeMatch && pathname !== cleanedParsedPathname) {
Object.keys(routeMatch).forEach((key)=>{
if (routeMatch && query[key] === routeMatch[key]) {
delete query[key];
}
});
}
if ((0, _isDynamic).isDynamicRoute(pathname)) {
const prefixedAs = !routeProps.shallow && routeInfo.resolvedAs ? routeInfo.resolvedAs : (0, _addBasePath).addBasePath((0, _addLocale).addLocale(new URL(as, location.href).pathname, nextState.locale), true);
let rewriteAs = prefixedAs;
if ((0, _hasBasePath).hasBasePath(rewriteAs)) {
rewriteAs = (0, _removeBasePath).removeBasePath(rewriteAs);
}
if (process.env.__NEXT_I18N_SUPPORT) {
const localeResult = (0, _normalizeLocalePath).normalizeLocalePath(rewriteAs, _this.locales);
nextState.locale = localeResult.detectedLocale || nextState.locale;
rewriteAs = localeResult.pathname;
}
const routeRegex1 = (0, _routeRegex).getRouteRegex(pathname);
const curRouteMatch = (0, _routeMatcher).getRouteMatcher(routeRegex1)(new URL(rewriteAs, location.href).pathname);
if (curRouteMatch) {
Object.assign(query, curRouteMatch);
}
}
}
// If the routeInfo brings a redirect we simply apply it.
if ("type" in routeInfo) {
if (routeInfo.type === "redirect-internal") {
return _this.change(method, routeInfo.newUrl, routeInfo.newAs, options);
} else {
handleHardNavigation({
url: routeInfo.destination,
router: _this
});
return new Promise(()=>{});
}
}
const component = routeInfo.Component;
if (component && component.unstable_scriptLoader) {
const scripts = [].concat(component.unstable_scriptLoader());
scripts.forEach((script)=>{
(0, _script).handleClientScriptLoad(script.props);
});
}
// handle redirect on client-transition
if ((routeInfo.__N_SSG || routeInfo.__N_SSP) && routeInfo.props) {
if (routeInfo.props.pageProps && routeInfo.props.pageProps.__N_REDIRECT) {
// Use the destination from redirect without adding locale
options.locale = false;
const destination = routeInfo.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("/") && routeInfo.props.pageProps.__N_REDIRECT_BASE_PATH !== false) {
const parsedHref = (0, _parseRelativeUrl).parseRelativeUrl(destination);
parsedHref.pathname = resolveDynamicRoute(parsedHref.pathname, pages);
const { url: newUrl , as: newAs } = prepareUrlAs(_this, destination, destination);
return _this.change(method, newUrl, newAs, options);
}
handleHardNavigation({
url: destination,
router: _this
});
return new Promise(()=>{});
}
nextState.isPreview = !!routeInfo.props.__N_PREVIEW;
// handle SSG data 404
if (routeInfo.props.notFound === SSG_DATA_NOT_FOUND) {
let notFoundRoute;
try {
yield _this.fetchComponent("/404");
notFoundRoute = "/404";
} catch (_) {
notFoundRoute = "/_error";
}
routeInfo = yield _this.getRouteInfo({
route: notFoundRoute,
pathname: notFoundRoute,
query,
as,
resolvedAs,
routeProps: {
shallow: false
},
locale: nextState.locale,
isPreview: nextState.isPreview
});
if ("type" in routeInfo) {
throw new Error(`Unexpected middleware effect on /404`);
}
}
}
if (isQueryUpdating && _this.pathname === "/_error" && ((ref2 = self.__NEXT_DATA__.props) == null ? void 0 : (ref3 = ref2.pageProps) == null ? void 0 : ref3.statusCode) === 500 && ((ref4 = routeInfo.props) == null ? void 0 : ref4.pageProps)) {
// ensure statusCode is still correct for static 500 page
// when updating query information
routeInfo.props.pageProps.statusCode = 500;
}
var _route;
// shallow routing is only allowed for same page URL changes.
const isValidShallowRoute = options.shallow && nextState.route === ((_route = routeInfo.route) != null ? _route : route);
var _scroll;
const shouldScroll = (_scroll = options.scroll) != null ? _scroll : !isQueryUpdating && !isValidShallowRoute;
const resetScroll = shouldScroll ? {
x: 0,
y: 0
} : null;
const upcomingScrollState = forcedScroll != null ? forcedScroll : resetScroll;
// the new state that the router gonna set
const upcomingRouterState = _extends({}, nextState, {
route,
pathname,
query,
asPath: cleanedAs,
isFallback: false
});
// When the page being rendered is the 404 page, we should only update the
// query parameters. Route changes here might add the basePath when it
// wasn't originally present. This is also why this block is before the
// below `changeState` call which updates the browser's history (changing
// the URL).
if (isQueryUpdating && (_this.pathname === "/404" || _this.pathname === "/_error")) {
var ref5, ref6, ref7;
routeInfo = yield _this.getRouteInfo({
route: _this.pathname,
pathname: _this.pathname,
query,
as,
resolvedAs,
routeProps: {
shallow: false
},
locale: nextState.locale,
isPreview: nextState.isPreview
});
if ("type" in routeInfo) {
throw new Error(`Unexpected middleware effect on ${_this.pathname}`);
}
if (_this.pathname === "/_error" && ((ref5 = self.__NEXT_DATA__.props) == null ? void 0 : (ref6 = ref5.pageProps) == null ? void 0 : ref6.statusCode) === 500 && ((ref7 = routeInfo.props) == null ? void 0 : ref7.pageProps)) {
// ensure statusCode is still correct for static 500 page
// when updating query information
routeInfo.props.pageProps.statusCode = 500;
}
try {
yield _this.set(upcomingRouterState, routeInfo, upcomingScrollState);
} catch (err2) {
if ((0, _isError).default(err2) && err2.cancelled) {
Router.events.emit("routeChangeError", err2, cleanedAs, routeProps);
}
throw err2;
}
return true;
}
Router.events.emit("beforeHistoryChange", as, routeProps);
_this.changeState(method, url, as, options);
// for query updates we can skip it if the state is unchanged and we don't
// need to scroll
// https://github.com/vercel/next.js/issues/37139
const canSkipUpdating = isQueryUpdating && !upcomingScrollState && !readyStateChange && !localeChange && (0, _compareStates).compareRouterStates(upcomingRouterState, _this.state);
if (!canSkipUpdating) {
try {
yield _this.set(upcomingRouterState, routeInfo, upcomingScrollState);
} catch (e) {
if (e.cancelled) routeInfo.error = routeInfo.error || e;
else throw e;
}
if (routeInfo.error) {
if (!isQueryUpdating) {
Router.events.emit("routeChangeError", routeInfo.error, cleanedAs, routeProps);
}
throw routeInfo.error;
}
if (process.env.__NEXT_I18N_SUPPORT) {
if (nextState.locale) {
document.documentElement.lang = nextState.locale;
}
}
if (!isQueryUpdating) {
Router.events.emit("routeChangeComplete", as, routeProps);
}
// A hash mark # is the optional last part of a URL
const hashRegex = /#.+$/;
if (shouldScroll && hashRegex.test(as)) {
_this.scrollToHash(as);
}
}
return true;
} catch (err11) {
if ((0, _isError).default(err11) && err11.cancelled) {
return false;
}
throw err11;
}
})();
}
changeState(method, url, as, options = {}) {
if ("development" !== "production") {
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.${method} is not available`);
return;
}
}
if (method !== "pushState" || (0, _utils).getURL() !== as) {
this._shallow = options.shallow;
window.history[method]({
url,
as,
options,
__N: true,
key: this._key = method !== "pushState" ? this._key : createKey()
}, // 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);
}
}
handleRouteInfoError(err, pathname, query, as, routeProps, loadErrorFail) {
var _this = this;
return _async_to_generator(function*() {
console.error(err);
if (err.cancelled) {
// bubble up cancellation errors
throw err;
}
if ((0, _routeLoader).isAssetError(err) || loadErrorFail) {
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.
handleHardNavigation({
url: as,
router: _this
});
// Changing the URL doesn't block executing the current code path.
// So let's throw a cancellation error stop the routing logic.
throw buildCancellationError();
}
try {
let props;
const { page: Component , styleSheets } = yield _this.fetchComponent("/_error");
const routeInfo = {
props,
Component,
styleSheets,
err,
error: err
};
if (!routeInfo.props) {
try {
routeInfo.props = yield _this.getInitialProps(Component, {
err,
pathname,
query
});
} catch (gipErr) {
console.error("Error in error page `getInitialProps`: ", gipErr);
routeInfo.props = {};
}
}
return routeInfo;
} catch (routeInfoErr) {
return _this.handleRouteInfoError((0, _isError).default(routeInfoErr) ? routeInfoErr : new Error(routeInfoErr + ""), pathname, query, as, routeProps, true);
}
})();
}
getRouteInfo({ route: requestedRoute , pathname , query , as , resolvedAs , routeProps , locale , hasMiddleware , isPreview , unstable_skipClientCache , isQueryUpdating , isMiddlewareRewrite }) {
var _this = this;
return _async_to_generator(function*() {
/**
* This `route` binding can change if there's a rewrite
* so we keep a reference to the original requested route
* so we can store the cache for it and avoid re-requesting every time
* for shallow routing purposes.
*/ let route = requestedRoute;
try {
var ref, ref8, ref9, ref10;
const handleCancelled = getCancelledHandler({
route,
router: _this
});
let existingInfo = _this.components[route];
if (routeProps.shallow && existingInfo && _this.route === route) {
return existingInfo;
}
if (hasMiddleware) {
existingInfo = undefined;
}
let cachedRouteInfo = existingInfo && !("initial" in existingInfo) && "development" !== "development" ? existingInfo : undefined;
const isBackground = isQueryUpdating;
const fetchNextDataParams = {
dataHref: _this.pageLoader.getDataHref({
href: (0, _formatUrl).formatWithValidation({
pathname,
query
}),
skipInterpolation: true,
asPath: resolvedAs,
locale
}),
hasMiddleware: true,
isServerRender: _this.isSsr,
parseJSON: true,
inflightCache: isBackground ? _this.sbc : _this.sdc,
persistCache: !isPreview,
isPrefetch: false,
unstable_skipClientCache,
isBackground
};
let data = isQueryUpdating && !isMiddlewareRewrite ? null : yield withMiddlewareEffects({
fetchData: ()=>fetchNextData(fetchNextDataParams),
asPath: resolvedAs,
locale: locale,
router: _this
}).catch((err)=>{
// we don't hard error during query updating
// as it's un-necessary and doesn't need to be fatal
// unless it is a fallback route and the props can't
// be loaded
if (isQueryUpdating) {
return null;
}
throw err;
});
if (isQueryUpdating) {
if (!data) {
data = {
json: self.__NEXT_DATA__.props
};
} else {
data.json = self.__NEXT_DATA__.props;
}
}
handleCancelled();
if ((data == null ? void 0 : (ref = data.effect) == null ? void 0 : ref.type) === "redirect-internal" || (data == null ? void 0 : (ref8 = data.effect) == null ? void 0 : ref8.type) === "redirect-external") {
return data.effect;
}
if ((data == null ? void 0 : (ref9 = data.effect) == null ? void 0 : ref9.type) === "rewrite") {
const resolvedRoute = (0, _removeTrailingSlash).removeTrailingSlash(data.effect.resolvedHref);
const pages = yield _this.pageLoader.getPageList();
// during query updating the page must match although during
// client-transition a redirect that doesn't match a page
// can be returned and this should trigger a hard navigation
// which is valid for incremental migration
if (!isQueryUpdating || pages.includes(resolvedRoute)) {
route = resolvedRoute;
pathname = data.effect.resolvedHref;
query = _extends({}, query, data.effect.parsedAs.query);
resolvedAs = (0, _removeBasePath).removeBasePath((0, _normalizeLocalePath).normalizeLocalePath(data.effect.parsedAs.pathname, _this.locales).pathname);
// Check again the cache with the new destination.
existingInfo = _this.components[route];
if (routeProps.shallow && existingInfo && _this.route === route && !hasMiddleware) {
// If we have a match with the current route due to rewrite,
// we can copy the existing information to the rewritten one.
// Then, we return the information along with the matched route.
return _extends({}, existingInfo, {
route
});
}
}
}
if ((0, _isApiRoute).isAPIRoute(route)) {
handleHardNavigation({
url: as,
router: _this
});
return new Promise(()=>{});
}
const routeInfo = cachedRouteInfo || (yield _this.fetchComponent(route).then((res)=>({
Component: res.page,
styleSheets: res.styleSheets,
__N_SSG: res.mod.__N_SSG,
__N_SSP: res.mod.__N_SSP
})));
if ("development" !== "production") {
const { isValidElementType } = require("next/dist/compiled/react-is");
if (!isValidElementType(routeInfo.Component)) {
throw new Error(`The default export is not a React Component in page: "${pathname}"`);
}
}
const wasBailedPrefetch = data == null ? void 0 : (ref10 = data.response) == null ? void 0 : ref10.headers.get("x-middleware-skip");
const shouldFetchData = routeInfo.__N_SSG || routeInfo.__N_SSP;
// For non-SSG prefetches that bailed before sending data
// we clear the cache to fetch full response
if (wasBailedPrefetch && (data == null ? void 0 : data.dataHref)) {
delete _this.sdc[data.dataHref];
}
const { props , cacheKey } = yield _this._getData(_async_to_generator(function*() {
if (shouldFetchData) {
if ((data == null ? void 0 : data.json) && !wasBailedPrefetch) {
return {
cacheKey: data.cacheKey,
props: data.json
};
}
const dataHref = (data == null ? void 0 : data.dataHref) ? data.dataHref : _this.pageLoader.getDataHref({
href: (0, _formatUrl).formatWithValidation({
pathname,
query
}),
asPath: resolvedAs,
locale
});
const fetched = yield fetchNextData({
dataHref,
isServerRender: _this.isSsr,
parseJSON: true,
inflightCache: wasBailedPrefetch ? {} : _this.sdc,
persistCache: !isPreview,
isPrefetch: false,
unstable_skipClientCache
});
return {
cacheKey: fetched.cacheKey,
props: fetched.json || {}
};
}
return {
headers: {},
props: yield _this.getInitialProps(routeInfo.Component, {
pathname,
query,
asPath: as,
locale,
locales: _this.locales,
defaultLocale: _this.defaultLocale
})
};
}));
// Only bust the data cache for SSP routes although
// middleware can skip cache per request with
// x-middleware-cache: no-cache as well
if (routeInfo.__N_SSP && fetchNextDataParams.dataHref && cacheKey) {
delete _this.sdc[cacheKey];
}
// we kick off a HEAD request in the background
// when a non-prefetch request is made to signal revalidation
if (!_this.isPreview && routeInfo.__N_SSG && "development" !== "development" && !isQueryUpdating) {
fetchNextData(Object.assign({}, fetchNextDataParams, {
isBackground: true,
persistCache: false,
inflightCache: _this.sbc
})).catch(()=>{});
}
props.pageProps = Object.assign({}, props.pageProps);
routeInfo.props = props;
routeInfo.route = route;
routeInfo.query = query;
routeInfo.resolvedAs = resolvedAs;
_this.components[route] = routeInfo;
return routeInfo;
} catch (err) {
return _this.handleRouteInfoError((0, _isError).getProperError(err), pathname, query, as, routeProps);
}
})();
}
set(state, data, resetScroll) {
this.state = state;
return this.sub(data, this.components["/_app"].Component, resetScroll);
}
/**
* Callback to execute before replacing router state
* @param cb callback to be executed
*/ beforePopState(cb) {
this._bps = cb;
}
onlyAHashChange(as) {
if (!this.asPath) return false;
const [oldUrlNoHash, oldHash] = this.asPath.split("#");
const [newUrlNoHash, newHash] = as.split("#");
// 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;
}
scrollToHash(as) {
const [, hash = ""] = as.split("#");
// Scroll to top if the hash is just `#` with no value or `#top`
// To mirror browsers
if (hash === "" || hash === "top") {
handleSmoothScroll(()=>window.scrollTo(0, 0));
return;
}
// Decode hash to make non-latin anchor works.
const rawHash = decodeURIComponent(hash);
// First we check if the element by id is found
const idEl = document.getElementById(rawHash);
if (idEl) {
handleSmoothScroll(()=>idEl.scrollIntoView());
return;
}
// If there's no element with the id, we check the `name` property
// To mirror browsers
const nameEl = document.getElementsByName(rawHash)[0];
if (nameEl) {
handleSmoothScroll(()=>nameEl.scrollIntoView());
}
}
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
*/ prefetch(url, asPath = url, options = {}) {
var _this = this;
return _async_to_generator(function*() {
// Prefetch is not supported in development mode because it would trigger on-demand-entries
if ("development" !== "production") {
return;
}
if ("undefined" !== "undefined" && (0, _isBot).isBot(window.navigator.userAgent)) {
// No prefetches for bots that render the link since they are typically navigating
// links via the equivalent of a hard navigation and hence never utilize these
// prefetches.
return;
}
let parsed = (0, _parseRelativeUrl).parseRelativeUrl(url);
let { pathname , query } = parsed;
const originalPathname = pathname;
if (process.env.__NEXT_I18N_SUPPORT) {
if (options.locale === false) {
pathname = (0, _normalizeLocalePath).normalizeLocalePath(pathname, _this.locales).pathname;
parsed.pathname = pathname;
url = (0, _formatUrl).formatWithValidation(parsed);
let parsedAs = (0, _parseRelativeUrl).parseRelativeUrl(asPath);
const localePathResult = (0, _normalizeLocalePath).normalizeLocalePath(parsedAs.pathname, _this.locales);
parsedAs.pathname = localePathResult.pathname;
options.locale = localePathResult.detectedLocale || _this.defaultLocale;
asPath = (0, _formatUrl).formatWithValidation(parsedAs);
}
}
const pages = yield _this.pageLoader.getPageList();
let resolvedAs = asPath;
const locale = typeof options.locale !== "undefined" ? options.locale || undefined : _this.locale;
const isMiddlewareMatch = yield matchesMiddleware({
asPath: asPath,
locale: locale,
router: _this
});
if (process.env.__NEXT_HAS_REWRITES && asPath.startsWith("/")) {
let rewrites;
({ __rewrites: rewrites } = yield (0, _routeLoader).getClientBuildManifest());
const rewritesResult = (0, _resolveRewrites).default((0, _addBasePath).addBasePath((0, _addLocale).addLocale(asPath, _this.locale), true), pages, rewrites, parsed.query, (p)=>resolveDynamicRoute(p, pages), _this.locales);
if (rewritesResult.externalDest) {
return;
}
if (!isMiddlewareMatch) {
resolvedAs = (0, _removeLocale).removeLocale((0, _removeBasePath).removeBasePath(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;
if (!isMiddlewareMatch) {
url = (0, _formatUrl).formatWithValidation(parsed);
}
}
}
parsed.pathname = resolveDynamicRoute(parsed.pathname, pages);
if ((0, _isDynamic).isDynamicRoute(parsed.pathname)) {
pathname = parsed.pathname;
parsed.pathname = pathname;
Object.assign(query, (0, _routeMatcher).getRouteMatcher((0, _routeRegex).getRouteRegex(parsed.pathname))((0, _parsePath).parsePath(asPath).pathname) || {});
if (!isMiddlewareMatch) {
url = (0, _formatUrl).formatWithValidation(parsed);
}
}
const data = process.env.__NEXT_MIDDLEWARE_PREFETCH === "strict" ? null : yield withMiddlewareEffects({
fetchData: ()=>fetchNextData({
dataHref: _this.pageLoader.getDataHref({
href: (0, _formatUrl).formatWithValidation({
pathname: originalPathname,
query
}),
skipInterpolation: true,
asPath: resolvedAs,
locale
}),
hasMiddleware: true,
isServerRender: _this.isSsr,
parseJSON: true,
inflightCache: _this.sdc,
persistCache: !_this.isPreview,
isPrefetch: true
}),
asPath: asPath,
locale: locale,
router: _this
});
/**
* If there was a rewrite we apply the effects of the rewrite on the
* current parameters for the prefetch.
*/ if ((data == null ? void 0 : data.effect.type) === "rewrite") {
parsed.pathname = data.effect.resolvedHref;
pathname = data.effect.resolvedHref;
query = _extends({}, query, data.effect.parsedAs.query);
resolvedAs = data.effect.parsedAs.pathname;
url = (0, _formatUrl).formatWithValidation(parsed);
}
/**
* If there is a redirect to an external destination then we don't have
* to prefetch content as it will be unused.
*/ if ((data == null ? void 0 : data.effect.type) === "redirect-external") {
return;
}
const route = (0, _removeTrailingSlash).removeTrailingSlash(pathname);
yield Promise.all([
_this.pageLoader._isSsg(route).then((isSsg)=>{
return isSsg ? fetchNextData({
dataHref: (data == null ? void 0 : data.json) ? data == null ? void 0 : data.dataHref : _this.pageLoader.getDataHref({
href: url,
asPath: resolvedAs,
locale: locale
}),
isServerRender: false,
parseJSON: true,
inflightCache: _this.sdc,
persistCache: !_this.isPreview,
isPrefetch: true,
unstable_skipClientCache: options.unstable_skipClientCache || options.priority && !!process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE
}).then(()=>false) : false;
}),
_this.pageLoader[options.priority ? "loadPage" : "prefetch"](route)
]);
})();
}
fetchComponent(route) {
var _this = this;
return _async_to_generator(function*() {
const handleCancelled = getCancelledHandler({
route,
router: _this
});
try {
const componentResult = yield _this.pageLoader.loadPage(route);
handleCancelled();
return componentResult;
} catch (err) {
handleCancelled();
throw err;
}
})();
}
_getData(fn) {
let cancelled = false;
const cancel = ()=>{
cancelled = true;
};
this.clc = cancel;
return fn().then((data)=>{
if (cancel === this.clc) {
this.clc = null;
}
if (cancelled) {
const err = new Error("Loading initial props cancelled");
err.cancelled = true;
throw err;
}
return data;
});
}
_getFlightData(dataHref) {
// Do not cache RSC flight response since it's not a static resource
return fetchNextData({
dataHref,
isServerRender: true,
parseJSON: false,
inflightCache: this.sdc,
persistCache: false,
isPrefetch: false
}).then(({ text })=>({
data: text
}));
}
getInitialProps(Component, ctx) {
const { Component: App } = this.components["/_app"];
const AppTree = this._wrapApp(App);
ctx.AppTree = AppTree;
return (0, _utils).loadGetInitialProps(App, {
AppTree,
Component,
router: this,
ctx
});
}
get route() {
return this.state.route;
}
get pathname() {
return this.state.pathname;
}
get query() {
return this.state.query;
}
get asPath() {
return this.state.asPath;
}
get locale() {
return this.state.locale;
}
get isFallback() {
return this.state.isFallback;
}
get isPreview() {
return this.state.isPreview;
}
constructor(pathname1, query1, as1, { initialProps , pageLoader , App , wrapApp , Component , err , subscription , isFallback , locale , locales , defaultLocale , domainLocales , isPreview }){
// Server Data Cache (full data requests)
this.sdc = {};
// Server Background Cache (HEAD requests)
this.sbc = {};
this.isFirstPopStateEvent = true;
this._key = createKey();
this.onPopState = (e)=>{
const { isFirstPopStateEvent } = this;
this.isFirstPopStateEvent = false;
const 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.
const { pathname , query } = this;
this.changeState("replaceState", (0, _formatUrl).formatWithValidation({
pathname: (0, _addBasePath).addBasePath(pathname),
query
}), (0, _utils).getURL());
return;
}
// __NA is used to identify if the history entry can be handled by the app-router.
if (state.__NA) {
window.location.reload();
return;
}
if (!state.__N) {
return;
}
// Safari fires popstateevent when reopening the browser.
if (isFirstPopStateEvent && this.locale === state.options.locale && state.as === this.asPath) {
return;
}
let forcedScroll;
const { url , as , options , key } = state;
if (process.env.__NEXT_SCROLL_RESTORATION) {
if (manualScrollRestoration) {
if (this._key !== key) {
// Snapshot current scroll position:
try {
sessionStorage.setItem("__next_scroll_" + this._key, JSON.stringify({
x: self.pageXOffset,
y: self.pageYOffset
}));
} catch (e1) {}
// Restore old scroll position:
try {
const v = sessionStorage.getItem("__next_scroll_" + key);
forcedScroll = JSON.parse(v);
} catch (e11) {
forcedScroll = {
x: 0,
y: 0
};
}
}
}
}
this._key = key;
const { pathname: pathname1 } = (0, _parseRelativeUrl).parseRelativeUrl(url);
// Make sure we don't re-render on initial load,
// can be caused by navigating back from an external site
if (this.isSsr && as === (0, _addBasePath).addBasePath(this.asPath) && pathname1 === (0, _addBasePath).addBasePath(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,
// @ts-ignore internal value not exposed on types
_h: 0
}), forcedScroll);
};
// represents the current component key
const route = (0, _removeTrailingSlash).removeTrailingSlash(pathname1);
// 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 (pathname1 !== "/_error") {
this.components[route] = {
Component,
initial: true,
props: initialProps,
err,
__N_SSG: initialProps && initialProps.__N_SSG,
__N_SSP: initialProps && initialProps.__N_SSP
};
}
this.components["/_app"] = {
Component: App,
styleSheets: []
};
// 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;
// if auto prerendered and dynamic route wait to update asPath
// until after mount to prevent hydration mismatch
const autoExportDynamic = (0, _isDynamic).isDynamicRoute(pathname1) && self.__NEXT_DATA__.autoExport;
this.basePath = process.env.__NEXT_ROUTER_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.isLocaleDomain = false;
this.isReady = !!(self.__NEXT_DATA__.gssp || self.__NEXT_DATA__.gip || self.__NEXT_DATA__.appGip && !self.__NEXT_DATA__.gsp || !autoExportDynamic && !self.location.search && !process.env.__NEXT_HAS_REWRITES);
if (process.env.__NEXT_I18N_SUPPORT) {
this.locales = locales;
this.defaultLocale = defaultLocale;
this.domainLocales = domainLocales;
this.isLocaleDomain = !!(0, _detectDomainLocale).detectDomainLocale(domainLocales, self.location.hostname);
}
this.state = {
route,
pathname: pathname1,
query: query1,
asPath: autoExportDynamic ? pathname1 : as1,
isPreview: !!isPreview,
locale: process.env.__NEXT_I18N_SUPPORT ? locale : undefined,
isFallback
};
this._initialMatchesMiddlewarePromise = Promise.resolve(false);
if ("undefined" !== "undefined") {
// make sure "as" doesn't start with double slashes or else it can
// throw an error as it's considered invalid
if (!as1.startsWith("//")) {
// in order for `e.state` to work on the `onpopstate` event
// we have to register the initial route upon initialization
const options = {
locale
};
const asPath = (0, _utils).getURL();
this._initialMatchesMiddlewarePromise = matchesMiddleware({
router: this,
locale,
asPath
}).then((matches)=>{
options._shouldResolveHref = as1 !== pathname1;
this.changeState("replaceState", matches ? asPath : (0, _formatUrl).formatWithValidation({
pathname: (0, _addBasePath).addBasePath(pathname1),
query: query1
}), asPath, options);
return matches;
});
}
window.addEventListener("popstate", this.onPopState);
// enable custom scroll restoration handling when available
// otherwise fallback to browser's default handling
if (process.env.__NEXT_SCROLL_RESTORATION) {
if (manualScrollRestoration) {
window.history.scrollRestoration = "manual";
}
}
}
}
}
Router.events = (0, _mitt).default();
exports.default = Router; //# sourceMappingURL=router.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/shared/lib/router/router.js,:{"version":3,"sources":["webpack://./node_modules/next/dist/shared/lib/router/router.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.matchesMiddleware = matchesMiddleware;\nexports.isLocalURL = isLocalURL;\nexports.interpolateAs = interpolateAs;\nexports.resolveHref = resolveHref;\nexports.createKey = createKey;\nexports.default = void 0;\nvar _async_to_generator = require(\"@swc/helpers/lib/_async_to_generator.js\").default;\nvar _extends = require(\"@swc/helpers/lib/_extends.js\").default;\nvar _interop_require_default = require(\"@swc/helpers/lib/_interop_require_default.js\").default;\nvar _interop_require_wildcard = require(\"@swc/helpers/lib/_interop_require_wildcard.js\").default;\nvar _normalizeTrailingSlash = require(\"../../../client/normalize-trailing-slash\");\nvar _removeTrailingSlash = require(\"./utils/remove-trailing-slash\");\nvar _routeLoader = require(\"../../../client/route-loader\");\nvar _script = require(\"../../../client/script\");\nvar _isError = _interop_require_wildcard(require(\"../../../lib/is-error\"));\nvar _denormalizePagePath = require(\"../page-path/denormalize-page-path\");\nvar _normalizeLocalePath = require(\"../i18n/normalize-locale-path\");\nvar _mitt = _interop_require_default(require(\"../mitt\"));\nvar _utils = require(\"../utils\");\nvar _isDynamic = require(\"./utils/is-dynamic\");\nvar _parseRelativeUrl = require(\"./utils/parse-relative-url\");\nvar _querystring = require(\"./utils/querystring\");\nvar _resolveRewrites = _interop_require_default(require(\"./utils/resolve-rewrites\"));\nvar _routeMatcher = require(\"./utils/route-matcher\");\nvar _routeRegex = require(\"./utils/route-regex\");\nvar _formatUrl = require(\"./utils/format-url\");\nvar _detectDomainLocale = require(\"../../../client/detect-domain-locale\");\nvar _parsePath = require(\"./utils/parse-path\");\nvar _addLocale = require(\"../../../client/add-locale\");\nvar _removeLocale = require(\"../../../client/remove-locale\");\nvar _removeBasePath = require(\"../../../client/remove-base-path\");\nvar _addBasePath = require(\"../../../client/add-base-path\");\nvar _hasBasePath = require(\"../../../client/has-base-path\");\nvar _isApiRoute = require(\"../../../lib/is-api-route\");\nvar _getNextPathnameInfo = require(\"./utils/get-next-pathname-info\");\nvar _formatNextPathnameInfo = require(\"./utils/format-next-pathname-info\");\nvar _compareStates = require(\"./utils/compare-states\");\nvar _isBot = require(\"./utils/is-bot\");\nfunction buildCancellationError() {\n return Object.assign(new Error('Route Cancelled'), {\n cancelled: true\n });\n}\nfunction matchesMiddleware(options) {\n return _matchesMiddleware.apply(this, arguments);\n}\nfunction _matchesMiddleware() {\n _matchesMiddleware = _async_to_generator(function*(options) {\n const matchers = yield Promise.resolve(options.router.pageLoader.getMiddleware());\n if (!matchers) return false;\n const { pathname: asPathname } = (0, _parsePath).parsePath(options.asPath);\n // remove basePath first since path prefix has to be in the order of `/${basePath}/${locale}`\n const cleanedAs = (0, _hasBasePath).hasBasePath(asPathname) ? (0, _removeBasePath).removeBasePath(asPathname) : asPathname;\n const asWithBasePathAndLocale = (0, _addBasePath).addBasePath((0, _addLocale).addLocale(cleanedAs, options.locale));\n // Check only path match on client. Matching \"has\" should be done on server\n // where we can access more info such as headers, HttpOnly cookie, etc.\n return matchers.some((m)=>new RegExp(m.regexp).test(asWithBasePathAndLocale));\n });\n return _matchesMiddleware.apply(this, arguments);\n}\nfunction stripOrigin(url) {\n const origin = (0, _utils).getLocationOrigin();\n return url.startsWith(origin) ? url.substring(origin
<00>
 @R` @T` (<28><><EFBFBD>A<>
#  @U` @Z` <1E><><EFBFBD>A% -  @U`^@Z` $<24><><EFBFBD>A<>   @^` @i` <1A><><EFBFBD>A <00> @^`1@i`  <20><><EFBFBD>A<><00> @r` @<40>` <16><><EFBFBD>A<>d @r`K@<40>`  <09><><EFBFBD>A<><00> @<40>`@<40>`<06>0A<><00> @<40>`O@<40>`S<16><><EFBFBD><EFBFBD>A#/# @<40>`lA<6C><00><16><><EFBFBD>A<>4<00>4 @D` @Z`  <0C><><EFBFBD>A<>4<00>8 @D`7@Z` <16><><EFBFBD><EFBFBD>A<>A<00>A @<40>`@<40>`@<10><><EFBFBD>ApC<00>C C<><00><00><00><0E><><EFBFBD>A<>C<00>C @<40>@<40> <04><><EFBFBD>A<>C<00>D @<40>`-@<40> <16><><EFBFBD><EFBFBD>A<>E<00>E @<40>`@<40>`H<06>0A<>E<00>E @<40>`6@<40>`<<06><><EFBFBD>AJFeF @<40>@<40> <16><><EFBFBD><EFBFBD>AgF3L @<40>`)@<40> `)aOa;N<07><><EFBFBD><08><><EFBFBD> aQj@ <09><><EFBFBD>L<><4C><EFBFBD> `-A<><00>@<06><><EFBFBD>M<><4D><EFBFBD> `A<><00>@<03><><EFBFBD>K<><4B><EFBFBD> `%A<><00>@<00><><EFBFBD>I<><49><EFBFBD> `!A<><00>@<40><><EFBFBD><EFBFBD>P<><50><EFBFBD> `A
@<40><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>
`<16><><EFBFBD><EFBFBD> <0C>@swc/helpers/lib/_async_to_generator.js<15>A>x c  T<16><><EFBFBD><EFBFBD> <0C>@swc/helpers/lib/_extends.js<15>A<><00> c  ><16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>A<> c  ^<16><><EFBFBD><EFBFBD> <0C>@swc/helpers/lib/_interop_require_wildcard.js<15>A:z c `<02>../../../client/normalize-trailing-slash<15>A<><00> cQ<02>./utils/remove-trailing-slash<15>A<> cC<02>../../../client/route-loader<15>A/M c:<02>../../../client/script<15>Af~ c/<02>../../../lib/is-error<15>A<><00> c)I<02>../page-path/denormalize-page-path<15>A<> cH<02>../i18n/normalize-locale-path<15>A:Y cC<02>../mitt<15>A<><00> c%7<02>../utils<15>A<><00> c  <02>./utils/is-dynamic<15>A<><00> c.<02>./utils/parse-relative-url<15>A$ c=<02>./utils/querystring<15>ABW c1<02>./utils/resolve-rewrites<15>A<><00> c0S<02>./utils/route-matcher<15>A<><00> c4<02>./utils/route-regex<15>A c0<02>./utils/format-url<15>A1E c.<02>../../../client/detect-domain-locale<15>Aj<00> cI<02>./utils/parse-path<15>A<><00> c  .<02>../../../client/add-locale<15>A<><00> c!!6<02>../../../client/remove-locale<15>A6 c""<<02>../../../client/remove-base-path<15>AWy c##A<02>../../../client/add-base-path<15>A<><00> c$$;<02>../../../client/has-base-path<15>A<><00> c%%;<02>../../../lib/is-api-route<15>A+ c&&6<02>./utils/get-next-pathname-info<15>AQq c''D<02>./utils/format-next-pathname-info<15>A<><00> c((J<02>./utils/compare-states<15>A<><00> c))6<02>./utils/is-bot<15>A   c* *&<02>next/dist/compiled/react-is<15>AS<41>p<> @<40>`4@<40>`ZAbLqL@<40><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> @<40>@<40>` <0B>next/dist/shared/lib/router/utils/format-url.js<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>  
 <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>./dist/shared/lib/router/utils/add-path-prefix.js @ @D<><44>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/add-path-prefix<16><><EFBFBD><EFBFBD><04><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/normalize-trailing-slash.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>./dist/client/normalize-trailing-slash.js @ @D<><44>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> @<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/normalize-trailing-slash <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/request-idle-callback.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>./dist/client/request-idle-callback.js @ `E<><45>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> @<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/request-idle-callback <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><1A><><EFBFBD>@<40><><EFBFBD><EFBFBD><15><18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15> @ pE<70><45>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><1F>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.normalizePathTrailingSlash = void 0;
var _removeTrailingSlash = require("../shared/lib/router/utils/remove-trailing-slash");
var _parsePath = require("../shared/lib/router/utils/parse-path");
const normalizePathTrailingSlash = (path)=>{
if (!path.startsWith("/") || process.env.__NEXT_MANUAL_TRAILING_SLASH) {
return path;
}
const { pathname , query , hash } = (0, _parsePath).parsePath(path);
if (process.env.__NEXT_TRAILING_SLASH) {
if (/\.[^/]+\/?$/.test(pathname)) {
return `${(0, _removeTrailingSlash).removeTrailingSlash(pathname)}${query}${hash}`;
} else if (pathname.endsWith("/")) {
return `${pathname}${query}${hash}`;
} else {
return `${pathname}/${query}${hash}`;
}
}
return `${(0, _removeTrailingSlash).removeTrailingSlash(pathname)}${query}${hash}`;
};
exports.normalizePathTrailingSlash = normalizePathTrailingSlash;
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=normalize-trailing-slash.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/normalize-trailing-slash.js {"version":3,"sources":["webpack://./node_modules/next/dist/client/normalize-trailing-slash.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.normalizePathTrailingSlash = void 0;\nvar _removeTrailingSlash = require(\"../shared/lib/router/utils/remove-trailing-slash\");\nvar _parsePath = require(\"../shared/lib/router/utils/parse-path\");\nconst normalizePathTrailingSlash = (path)=>{\n if (!path.startsWith('/') || process.env.__NEXT_MANUAL_TRAILING_SLASH) {\n return path;\n }\n const { pathname , query , hash } = (0, _parsePath).parsePath(path);\n if (process.env.__NEXT_TRAILING_SLASH) {\n if (/\\.[^/]+\\/?$/.test(pathname)) {\n return `${(0, _removeTrailingSlash).removeTrailingSlash(pathname)}${query}${hash}`;\n } else if (pathname.endsWith('/')) {\n return `${pathname}${query}${hash}`;\n } else {\n return `${pathname}/${query}${hash}`;\n }\n }\n return `${(0, _removeTrailingSlash).removeTrailingSlash(pathname)}${query}${hash}`;\n};\nexports.normalizePathTrailingSlash = normalizePathTrailingSlash;\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=normalize-trailing-slash.js.map"],"names":["Object","defineProperty","exports","value","normalizePathTrailingSlash","_removeTrailingSlash","require","_parsePath","path","startsWith","process","env","__NEXT_MANUAL_TRAILING_SLASH","pathname","query","hash","parsePath","__NEXT_TRAILING_SLASH","test","removeTrailingSlash","endsWith","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,0BAA0B,GAAG,KAAK;AAC1C,IAAIC,uBAAuBC,QAAQ;AACnC,IAAIC,aAAaD,QAAQ;AACzB,MAAMF,6BAA6B,CAACI,OAAO;IACvC,IAAI,CAACA,KAAKC,UAAU,CAAC,QAAQC,QAAQC,GAAG,CAACC,4BAA4B,EAAE;QACnE,OAAOJ;IACX,CAAC;IACD,MAAM,EAAEK,SAAQ,EAAGC,MAAK,EAAGC,KAAI,EAAG,GAAG,AAAC,CAAA,GAAGR,UAAU,AAAD,EAAGS,SAAS,CAACR;IAC/D,IAAIE,QAAQC,GAAG,CAACM,qBAAqB,EAAE;QACnC,IAAI,cAAcC,IAAI,CAACL,WAAW;YAC9B,OAAO,CAAC,EAAE,AAAC,CAAA,GAAGR,oBAAoB,AAAD,EAAGc,mBAAmB,CAACN,UAAU,EAAEC,MAAM,EAAEC,KAAK,CAAC;QACtF,OAAO,IAAIF,SAASO,QAAQ,CAAC,MAAM;YAC/B,OAAO,CAAC,EAAEP,SAAS,EAAEC,MAAM,EAAEC,KAAK,CAAC;QACvC,OAAO;YACH,OAAO,CAAC,EAAEF,SAAS,CAAC,EAAEC,MAAM,EAAEC,KAAK,CAAC;QACxC,CAAC;IACL,CAAC;IACD,OAAO,CAAC,EAAE,AAAC,CAAA,GAAGV,oBAAoB,AAAD,EAAGc,mBAAmB,CAACN,UAAU,EAAEC,MAAM,EAAEC,KAAK,CAAC;AACtF;AACAb,QAAQE,0BAA0B,GAAGA;AAErC,IAAI,AAAC,CAAA,OAAOF,QAAQmB,OAAO,KAAK,cAAe,OAAOnB,QAAQmB,OAAO,KAAK,YAAYnB,QAAQmB,OAAO,KAAK,IAAI,KAAM,OAAOnB,QAAQmB,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKtB,OAAOC,cAAc,CAACC,QAAQmB,OAAO,EAAE,cAAc;QAAElB,OAAO,IAAI;IAAC;IACnEH,OAAOuB,MAAM,CAACrB,QAAQmB,OAAO,EAAEnB;IAC/BsB,OAAOtB,OAAO,GAAGA,QAAQmB,OAAO;AAClC,CAAC,CAED,oDAAoD","file":"x"}`|<7C><><EFBFBD>  <><7F><EFBFBD>@<40><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <15><16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>webpack/DefinePlugin process.env.__NEXT_MANUAL_TRAILING_SLASHk<><6B><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>undefined><3E><><EFBFBD><17>397fbb062fd97ec3 s<><73><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>normalizePathTrailingSlash @ <00>=<3D><>kxBy<><79><EFBFBD><16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD><06>`  ` A<><00> bVA<><00> bA<15>Ag<00> b! I.<2E><><EFBFBD>A! c $<24><><EFBFBD>A#a c +`aOa;N/<2F><><EFBFBD>0<><30><EFBFBD> aQs@1<><31><EFBFBD><15> `+<02>../shared/lib/router/utils/remove-trailing-slash<15>A<><00> bV<02>../shared/lib/router/utils/parse-path<15>A<> bAA<><00>@(<28><><EFBFBD><15> c?A
%<25><><EFBFBD>&<26><><EFBFBD>c A3B"<22><><EFBFBD>#<23><><EFBFBD>c5DASb<1F><><EFBFBD> <20><><EFBFBD>cUdAw<00><1C><><EFBFBD><1D><><EFBFBD><18><><EFBFBD>by@<40>A<><00><19><><EFBFBD><1A><><EFBFBD>c)A<16><><EFBFBD><17><><EFBFBD>c!A&<13><><EFBFBD>c#*A-;_<><5F><EFBFBD>cA>M <0A><><EFBFBD><0E><><EFBFBD>c$ <0B>next/dist/shared/lib/router/utils/add-path-prefix.js_<><5F><EFBFBD><16><><EFBFBD><EFBFBD>`<60><><EFBFBD>@a<><61><EFBFBD> c<><63><EFBFBD> 5<><35><EFBFBD>f<><66><EFBFBD>  
 t<><74><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD><15><18><> I<><49><EFBFBD>t<><74><EFBFBD>1<><31><EFBFBD><15> @ <00>E<EFBFBD><45>kxBv<><76><EFBFBD>w<><77><EFBFBD>/<2F><><EFBFBD>D<><44><EFBFBD><15><16><><EFBFBD><EFBFBD>~<7E><><EFBFBD><16><><EFBFBD><EFBFBD><15>G"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return _objectWithoutPropertiesLoose;
}
});
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for(i = 0; i < sourceKeys.length; i++){
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
<EFBFBD>webpack://./node_modules/@swc/helpers/lib/_object_without_properties_loose.js`"<22><><EFBFBD><11><><EFBFBD>$<24><><EFBFBD> %<25><><EFBFBD><11>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/@swc/helpers/lib'<27><><EFBFBD><10>sideEffectFree  <15><16><><EFBFBD><EFBFBD> 3<><33><EFBFBD>4<><34><EFBFBD><17>103368b3fe76b612 <01>_objectWithoutPropertiesLoose @ <00>=<3D><>kxB<01>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/@swc/helpers<72>@swc/helpers@0.4.14<02>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/@swc/helpers/lib/_object_without_properties_loose.js<6A>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/@swc/helpers/package.json<06>`  ` aOa;N<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> `Q@<40>`{@<40><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> 
<1F>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.cancelIdleCallback = exports.requestIdleCallback = void 0;
const requestIdleCallback = typeof self !== "undefined" && self.requestIdleCallback && self.requestIdleCallback.bind(window) || function(cb) {
let start = Date.now();
return self.setTimeout(function() {
cb({
didTimeout: false,
timeRemaining: function() {
return Math.max(0, 50 - (Date.now() - start));
}
});
}, 1);
};
exports.requestIdleCallback = requestIdleCallback;
const cancelIdleCallback = typeof self !== "undefined" && self.cancelIdleCallback && self.cancelIdleCallback.bind(window) || function(id) {
return clearTimeout(id);
};
exports.cancelIdleCallback = cancelIdleCallback;
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=request-idle-callback.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/request-idle-callback.js<1F> {"version":3,"sources":["webpack://./node_modules/next/dist/client/request-idle-callback.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.cancelIdleCallback = exports.requestIdleCallback = void 0;\nconst requestIdleCallback = typeof self !== 'undefined' && self.requestIdleCallback && self.requestIdleCallback.bind(window) || function(cb) {\n let start = Date.now();\n return self.setTimeout(function() {\n cb({\n didTimeout: false,\n timeRemaining: function() {\n return Math.max(0, 50 - (Date.now() - start));\n }\n });\n }, 1);\n};\nexports.requestIdleCallback = requestIdleCallback;\nconst cancelIdleCallback = typeof self !== 'undefined' && self.cancelIdleCallback && self.cancelIdleCallback.bind(window) || function(id) {\n return clearTimeout(id);\n};\nexports.cancelIdleCallback = cancelIdleCallback;\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=request-idle-callback.js.map"],"names":["Object","defineProperty","exports","value","cancelIdleCallback","requestIdleCallback","self","bind","window","cb","start","Date","now","setTimeout","didTimeout","timeRemaining","Math","max","id","clearTimeout","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,kBAAkB,GAAGF,QAAQG,mBAAmB,GAAG,KAAK;AAChE,MAAMA,sBAAsB,OAAOC,SAAS,eAAeA,KAAKD,mBAAmB,IAAIC,KAAKD,mBAAmB,CAACE,IAAI,CAACC,WAAW,SAASC,EAAE,EAAE;IACzI,IAAIC,QAAQC,KAAKC,GAAG;IACpB,OAAON,KAAKO,UAAU,CAAC,WAAW;QAC9BJ,GAAG;YACCK,YAAY,KAAK;YACjBC,eAAe,WAAW;gBACtB,OAAOC,KAAKC,GAAG,CAAC,GAAG,KAAMN,CAAAA,KAAKC,GAAG,KAAKF,KAAI;YAC9C;QACJ;IACJ,GAAG;AACP;AACAR,QAAQG,mBAAmB,GAAGA;AAC9B,MAAMD,qBAAqB,OAAOE,SAAS,eAAeA,KAAKF,kBAAkB,IAAIE,KAAKF,kBAAkB,CAACG,IAAI,CAACC,WAAW,SAASU,EAAE,EAAE;IACtI,OAAOC,aAAaD;AACxB;AACAhB,QAAQE,kBAAkB,GAAGA;AAE7B,IAAI,AAAC,CAAA,OAAOF,QAAQkB,OAAO,KAAK,cAAe,OAAOlB,QAAQkB,OAAO,KAAK,YAAYlB,QAAQkB,OAAO,KAAK,IAAI,KAAM,OAAOlB,QAAQkB,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKrB,OAAOC,cAAc,CAACC,QAAQkB,OAAO,EAAE,cAAc;QAAEjB,OAAO,IAAI;IAAC;IACnEH,OAAOsB,MAAM,CAACpB,QAAQkB,OAAO,EAAElB;IAC/BqB,OAAOrB,OAAO,GAAGA,QAAQkB,OAAO;AAClC,CAAC,CAED,iDAAiD","file":"x"}`<16><><EFBFBD><EFBFBD>  <02><><EFBFBD>@V<><56><EFBFBD><05><><EFBFBD> <15>y<><79><EFBFBD> z<><7A><EFBFBD><12><><EFBFBD><13><><EFBFBD><17>fc608cfb704e6b0e <02>requestIdleCallback<63>cancelIdleCallback @ <00>=<3D><>kxB<16><><EFBFBD><EFBFBD><12><><EFBFBD>a<><61><EFBFBD><14><><EFBFBD><06>`  ` `aOa;N<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> aQk@<40><><EFBFBD><EFBFBD><15> `A`n@<40>@<40><><EFBFBD><EFBFBD><15> bAA"=@<40><><EFBFBD><EFBFBD><15> c1A@<40><><EFBFBD><EFBFBD><15> c/A>M<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c Agv<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c5DA<><00><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>cUdA<><00><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>by@<40>A<><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c)ABQ<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c!ASZ<16><><EFBFBD><EFBFBD>c#*Aao<16><><EFBFBD><EFBFBD>cAr<00><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c$ 
<EFBFBD><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js<18><> <16><><EFBFBD><EFBFBD> <09><><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>./dist/shared/lib/router/utils/remove-trailing-slash.js @ F<><46>kxB
<EFBFBD><EFBFBD><EFBFBD> <0B><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><01><><EFBFBD><11><><EFBFBD><17><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> @<02><><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/parse-path.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>./dist/shared/lib/router/utils/parse-path.js @ F<><46>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD><03><><EFBFBD> <09><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> @<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/parse-path <0B>next/dist/shared/lib/router/utils/remove-trailing-slash.js<16><><EFBFBD><EFBFBD>J<><4A><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>  
 <0B>next/dist/shared/lib/router/utils/parse-path.js<16><><EFBFBD><EFBFBD>E<><45><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>  
 <16><><EFBFBD><EFBFBD>  <16><><EFBFBD><EFBFBD><18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> @ K<><4B>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD>  <15><18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15> @ K<><4B>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15> <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/route-loader.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>./dist/client/route-loader.js @ K<><4B>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> @<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/route-loader <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/script.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>{<7B><><EFBFBD><EFBFBD>./dist/client/script.js @ K<><4B>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>x<><78><EFBFBD><16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> @<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/script <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/lib/is-error.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>m<><6D><EFBFBD><EFBFBD>./dist/lib/is-error.js @ K<><4B>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>j<><6A><EFBFBD><><7F><EFBFBD><15><>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/lib<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> @<16><><EFBFBD><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/lib/package.json<6F>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/lib/is-error <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/page-path/denormalize-page-path.js<18><> u<><75><EFBFBD><16><><EFBFBD><EFBFBD>]<5D><><EFBFBD><EFBFBD>./dist/shared/lib/page-path/denormalize-page-path.js @ K<><4B>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>Z<><5A><EFBFBD>o<><6F><EFBFBD><15><>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/page-path<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>{<7B><><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/page-path/package.json<6F>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/page-path/denormalize-page-path<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><><7F><EFBFBD> <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js<18><> g<><67><EFBFBD><16><><EFBFBD><EFBFBD>O<><4F><EFBFBD><EFBFBD>./dist/shared/lib/i18n/normalize-locale-path.js @ K<><4B>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>L<><4C><EFBFBD>a<><61><EFBFBD><15><>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/i18nz<><7A><EFBFBD>{<7B><><EFBFBD>m<><6D><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/i18n/package.json<6F>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/i18n/normalize-locale-path<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>q<><71><EFBFBD> <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/mitt.js<18><> Y<><59><EFBFBD><16><><EFBFBD><EFBFBD>A<><41><EFBFBD><EFBFBD>./dist/shared/lib/mitt.js @ K<><4B>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>><3E><><EFBFBD>S<><53><EFBFBD><15>m<><6D><EFBFBD>n<><6E><EFBFBD>`<60><><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/mitt<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>e<><65><EFBFBD> y<><79><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/utils.js<18><> M<><4D><EFBFBD>x<><78><EFBFBD>5<><35><EFBFBD><EFBFBD>./dist/shared/lib/utils.js @ K<><4B>kxBy<><79><EFBFBD>z<><7A><EFBFBD>2<><32><EFBFBD>G<><47><EFBFBD><15>a<><61><EFBFBD>b<><62><EFBFBD>T<><54><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/utils<><7F><EFBFBD><16><><EFBFBD><EFBFBD>Y<><59><EFBFBD> m<><6D><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/is-dynamic.js<18><> A<><41><EFBFBD>l<><6C><EFBFBD>)<29><><EFBFBD><EFBFBD>./dist/shared/lib/router/utils/is-dynamic.js @ K<><4B>kxBm<><6D><EFBFBD>n<><6E><EFBFBD>&<26><><EFBFBD>;<3B><><EFBFBD><15>d<><64><EFBFBD>H<><48><EFBFBD>f<><66><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/is-dynamics<><73><EFBFBD>y<><79><EFBFBD>U<><55><EFBFBD>M<><4D><EFBFBD> a<><61><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/parse-relative-url.js<18><> 5<><35><EFBFBD>`<60><><EFBFBD><1D><><EFBFBD><EFBFBD>./dist/shared/lib/router/utils/parse-relative-url.js @ K<><4B>kxBa<><61><EFBFBD>b<><62><EFBFBD><1A><><EFBFBD>/<2F><><EFBFBD><15>X<><58><EFBFBD><<3C><><EFBFBD>Z<><5A><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabci
<EFBFBD><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <0B><><EFBFBD><14><><EFBFBD><16><><EFBFBD><EFBFBD><1C><><EFBFBD><11><><EFBFBD><10><><EFBFBD><16><><EFBFBD><16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/remove-locale.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>./dist/client/remove-locale.js @ K<><4B>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15> <09><><EFBFBD><05><><EFBFBD> <0B><><EFBFBD><16><><EFBFBD><EFBFBD> @<16><><EFBFBD><EFBFBD><10><><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/remove-locale <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/remove-base-path.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>./dist/client/remove-base-path.js @ K<><4B>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> @<16><><EFBFBD><EFBFBD><02><><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/remove-base-path <16><><EFBFBD><EFBFBD>  +<2B><><EFBFBD><18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>,<2C><><EFBFBD> @ K<><4B>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>(<28><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>.<2E><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/has-base-path.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>./dist/client/has-base-path.js @ K<><4B>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> @<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/has-base-path <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/lib/is-api-route.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>./dist/lib/is-api-route.js @ K<><4B>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><1A><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> @<16><><EFBFBD><EFBFBD><1B><><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/lib/is-api-route <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>y<><79><EFBFBD><EFBFBD>./dist/shared/lib/router/utils/get-next-pathname-info.js @ K<><4B>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>v<><76><EFBFBD><16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js<18><> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>m<><6D><EFBFBD><EFBFBD>./dist/shared/lib/router/utils/format-next-pathname-info.js @ K<><4B>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>j<><6A><EFBFBD><><7F><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/compare-states.js<18><> y<><79><EFBFBD><16><><EFBFBD><EFBFBD>a<><61><EFBFBD><EFBFBD>./dist/shared/lib/router/utils/compare-states.js @ K<><4B>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>^<5E><><EFBFBD>s<><73><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/compare-states<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/is-bot.js<18><> m<><6D><EFBFBD><16><><EFBFBD><EFBFBD>U<><55><EFBFBD><EFBFBD>./dist/shared/lib/router/utils/is-bot.js @ K<><4B>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>R<><52><EFBFBD>g<><67><EFBFBD><15><16><><EFBFBD><EFBFBD>t<><74><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/is-bot<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>y<><79><EFBFBD> <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/react-is/index.js<18><> <20>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/react-is/package.json
<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>keywords<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>z<><7A><EFBFBD><08><><EFBFBD><EFBFBD>Brand checking of React Elements.<2E>index.js<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><><7F><EFBFBD>j<><6A><EFBFBD><EFBFBD>https://github.com/facebook/react.git<69>packages/react-isW<><57><EFBFBD>P<><50><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>https://github.com/facebook/react/issues<17>https://reactjs.org/<05>LICENSE<53>README.md<15><>cjs/<2F>umd/<17>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/react-is<69>./index.js @ K<><4B>kxBy<><79><EFBFBD>z<><7A><EFBFBD>2<><32><EFBFBD>G<><47><EFBFBD>T<><54><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>Z<><5A><EFBFBD> @<15><15><15><>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled @<05>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/package.json<15><>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/react-is.js<6A>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/react-is.json<6F>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/react-is.node e<><65><EFBFBD> <16><><EFBFBD><EFBFBD>A<><41><EFBFBD>@<40><><EFBFBD><EFBFBD>y<><79><EFBFBD><18><> :<3A><><EFBFBD>e<><65><EFBFBD>"<22><><EFBFBD>z<><7A><EFBFBD> @ <00>K<EFBFBD><4B>kxBg<><67><EFBFBD>h<><68><EFBFBD> <20><><EFBFBD>5<><35><EFBFBD>v<><76><EFBFBD>r<><72><EFBFBD>B<><42><EFBFBD>z<><7A><EFBFBD>|<7C><><EFBFBD>n<><6E><EFBFBD>t<><74><EFBFBD>H<><48><EFBFBD> \<5C><><EFBFBD> <16><><EFBFBD><EFBFBD>8<><38><EFBFBD>@<40><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><18><> 1<><31><EFBFBD>\<5C><><EFBFBD><19><><EFBFBD><16><><EFBFBD><EFBFBD> @ <00>K<EFBFBD><4B>kxB^<5E><><EFBFBD>_<><5F><EFBFBD><17><><EFBFBD>,<2C><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>f<><66><EFBFBD>l<><6C><EFBFBD>@<40><><EFBFBD><16><><EFBFBD><EFBFBD> T<><54><EFBFBD> y<><79><EFBFBD>0<><30><EFBFBD>@z<><7A><EFBFBD>[<5B><><EFBFBD><18><> )<29><><EFBFBD>T<><54><EFBFBD><11><><EFBFBD>\<5C><><EFBFBD> @ <00>K<EFBFBD><4B>kxBV<><56><EFBFBD>W<><57><EFBFBD><0F><><EFBFBD>$<24><><EFBFBD>X<><58><EFBFBD>a<><61><EFBFBD>1<><31><EFBFBD>i<><69><EFBFBD>^<5E><><EFBFBD>]<5D><><EFBFBD>c<><63><EFBFBD>7<><37><EFBFBD> K<><4B><EFBFBD> p<><70><EFBFBD>'<27><><EFBFBD>@q<><71><EFBFBD><16><><EFBFBD><EFBFBD><18><>  <20><><EFBFBD>K<><4B><EFBFBD><08><><EFBFBD><16><><EFBFBD><EFBFBD> @ <00>K<EFBFBD><4B>kxBM<><4D><EFBFBD>N<><4E><EFBFBD><06><><EFBFBD><1B><><EFBFBD><16><><EFBFBD><EFBFBD>X<><58><EFBFBD>(<28><><EFBFBD>`<60><><EFBFBD><16><><EFBFBD><EFBFBD>T<><54><EFBFBD>Z<><5A><EFBFBD>.<2E><><EFBFBD> B<><42><EFBFBD> g<><67><EFBFBD><1E><><EFBFBD>@h<><68><EFBFBD>u<><75><EFBFBD><18><> <17><><EFBFBD>B<><42><EFBFBD><16><><EFBFBD><EFBFBD>v<><76><EFBFBD> @ L<><4C>kxBD<><44><EFBFBD>E<><45><EFBFBD><16><><EFBFBD><EFBFBD><12><><EFBFBD>r<><72><EFBFBD>O<><4F><EFBFBD>L<><4C><EFBFBD>R<><52><EFBFBD>&<26><><EFBFBD>z<><7A><EFBFBD> :<3A><><EFBFBD> _<><5F><EFBFBD><16><><EFBFBD>@`<60><><EFBFBD>{<7B><><EFBFBD><18><> <0F><><EFBFBD>:<3A><><EFBFBD><16><><EFBFBD><EFBFBD>|<7C><><EFBFBD> @ L<><4C>kxB<<3C><><EFBFBD>=<3D><><EFBFBD><16><><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>x<><78><EFBFBD>G<><47><EFBFBD>D<><44><EFBFBD>J<><4A><EFBFBD><1E><><EFBFBD><16><><EFBFBD><EFBFBD> 2<><32><EFBFBD> W<><57><EFBFBD><0E><><EFBFBD>@X<><58><EFBFBD><15><><EFBFBD><18><> <07><><EFBFBD>2<><32><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD> @ 0L<30><4C>kxB4<><34><EFBFBD>5<><35><EFBFBD><16><><EFBFBD><EFBFBD><02><><EFBFBD><12><><EFBFBD>?<3F><><EFBFBD><<3C><><EFBFBD>B<><42><EFBFBD><16><><EFBFBD><1A><><EFBFBD> *<2A><><EFBFBD> O<><4F><EFBFBD><06><><EFBFBD>@P<><50><EFBFBD>,<2C><><EFBFBD><18><> <16><><EFBFBD><EFBFBD>*<2A><><EFBFBD><16><><EFBFBD><EFBFBD>-<2D><><EFBFBD> @ 0L<30><4C>kxB,<2C><><EFBFBD>-<2D><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>)<29><><EFBFBD>7<><37><EFBFBD>4<><34><EFBFBD>:<3A><><EFBFBD><0E><><EFBFBD>1<><31><EFBFBD> "<22><><EFBFBD> G<><47><EFBFBD><16><><EFBFBD><EFBFBD>@H<><48><EFBFBD>2<><32><EFBFBD><18><> <16><><EFBFBD><EFBFBD>"<22><><EFBFBD><16><><EFBFBD><EFBFBD>3<><33><EFBFBD> @ @L<><4C>kxB$<24><><EFBFBD>%<25><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>/<2F><><EFBFBD>/<2F><><EFBFBD>,<2C><><EFBFBD>2<><32><EFBFBD><06><><EFBFBD>7<><37><EFBFBD> <1A><><EFBFBD> ?<3F><><EFBFBD><16><><EFBFBD><EFBFBD>@@<40><><EFBFBD>A<><41><EFBFBD><18><> <16><><EFBFBD><EFBFBD><1A><><EFBFBD><16><><EFBFBD><EFBFBD>B<><42><EFBFBD> @ @L<><4C>kxB<1C><><EFBFBD><1D><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>><3E><><EFBFBD>'<27><><EFBFBD>$<24><><EFBFBD>*<2A><><EFBFBD><16><><EFBFBD><EFBFBD>F<><46><EFBFBD> <12><><EFBFBD> 7<><37><EFBFBD><16><><EFBFBD><EFBFBD>@8<><38><EFBFBD>G<><47><EFBFBD><18><> <16><><EFBFBD><EFBFBD><12><><EFBFBD><16><><EFBFBD><EFBFBD>H<><48><EFBFBD> @ PL<50><4C>kxB<14><><EFBFBD><15><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>D<><44><EFBFBD>c<><63><EFBFBD><1C><><EFBFBD>"<22><><EFBFBD><16><><EFBFBD><EFBFBD>L<><4C><EFBFBD><1F>."use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.markAssetError = markAssetError;
exports.isAssetError = isAssetError;
exports.getClientBuildManifest = getClientBuildManifest;
exports.createRouteLoader = createRouteLoader;
var _interop_require_default = require("@swc/helpers/lib/_interop_require_default.js").default;
var _getAssetPathFromRoute = _interop_require_default(require("../shared/lib/router/utils/get-asset-path-from-route"));
var _trustedTypes = require("./trusted-types");
var _requestIdleCallback = require("./request-idle-callback");
// 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.
const MS_MAX_IDLE_DELAY = 3800;
function withFuture(key, map, generator) {
let entry = map.get(key);
if (entry) {
if ("future" in entry) {
return entry.future;
}
return Promise.resolve(entry);
}
let resolver;
const prom = new Promise((resolve)=>{
resolver = resolve;
});
map.set(key, entry = {
resolve: resolver,
future: prom
});
return generator ? generator() // eslint-disable-next-line no-sequences
.then((value)=>(resolver(value), value)).catch((err)=>{
map.delete(key);
throw err;
}) : prom;
}
const ASSET_LOAD_ERROR = Symbol("ASSET_LOAD_ERROR");
function markAssetError(err) {
return Object.defineProperty(err, ASSET_LOAD_ERROR, {});
}
function isAssetError(err) {
return err && ASSET_LOAD_ERROR in err;
}
function hasPrefetch(link) {
try {
link = document.createElement("link");
return(// with relList.support
!!window.MSInputMethodContext && !!document.documentMode || link.relList.supports("prefetch"));
} catch (e) {
return false;
}
}
const canPrefetch = hasPrefetch();
function prefetchViaDom(href, as, link) {
return new Promise((resolve, reject)=>{
const selector = `
link[rel="prefetch"][href^="${href}"],
link[rel="preload"][href^="${href}"],
script[src^="${href}"]`;
if (document.querySelector(selector)) {
return resolve();
}
link = document.createElement("link");
// The order of property assignment here is intentional:
if (as) link.as = as;
link.rel = `prefetch`;
link.crossOrigin = process.env.__NEXT_CROSS_ORIGIN;
link.onload = resolve;
link.onerror = ()=>reject(markAssetError(new Error(`Failed to prefetch: ${href}`)));
// `href` should always be last:
link.href = href;
document.head.appendChild(link);
});
}
function appendScript(src, script) {
return new Promise((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 = ()=>reject(markAssetError(new Error(`Failed to load script: ${src}`)));
// 2. Configure the cross-origin attribute before setting `src` in case the
// browser begins to fetch.
script.crossOrigin = process.env.__NEXT_CROSS_ORIGIN;
// 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);
});
}
// We wait for pages to be built in dev before we start the route transition
// timeout to prevent an un-necessary hard navigation in development.
let devBuildPromise;
// Resolve a promise that times out after given amount of milliseconds.
function resolvePromiseWithTimeout(p, ms, err) {
return new Promise((resolve, reject)=>{
let cancelled = false;
p.then((r)=>{
// Resolved, cancel the timeout
cancelled = true;
resolve(r);
}).catch(reject);
// We wrap these checks separately for better dead-code elimination in
// production bundles.
if ("development" === "development") {
(devBuildPromise || Promise.resolve()).then(()=>{
(0, _requestIdleCallback).requestIdleCallback(()=>setTimeout(()=>{
if (!cancelled) {
reject(err);
}
}, ms));
});
}
if ("development" !== "development") {
(0, _requestIdleCallback).requestIdleCallback(()=>setTimeout(()=>{
if (!cancelled) {
reject(err);
}
}, ms));
}
});
}
function getClientBuildManifest() {
if (self.__BUILD_MANIFEST) {
return Promise.resolve(self.__BUILD_MANIFEST);
}
const onBuildManifest = new Promise((resolve)=>{
// Mandatory because this is not concurrent safe:
const cb = self.__BUILD_MANIFEST_CB;
self.__BUILD_MANIFEST_CB = ()=>{
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 ("development" === "development") {
const scriptUrl = assetPrefix + "/_next/static/chunks/pages" + encodeURI((0, _getAssetPathFromRoute).default(route, ".js"));
return Promise.resolve({
scripts: [
(0, _trustedTypes).__unsafeCreateTrustedScriptURL(scriptUrl)
],
// Styles are handled by `style-loader` in development:
css: []
});
}
return getClientBuildManifest().then((manifest)=>{
if (!(route in manifest)) {
throw markAssetError(new Error(`Failed to lookup route: ${route}`));
}
const allFiles = manifest[route].map((entry)=>assetPrefix + "/_next/" + encodeURI(entry));
return {
scripts: allFiles.filter((v)=>v.endsWith(".js")).map((v)=>(0, _trustedTypes).__unsafeCreateTrustedScriptURL(v)),
css: allFiles.filter((v)=>v.endsWith(".css"))
};
});
}
function createRouteLoader(assetPrefix) {
const entrypoints = new Map();
const loadedScripts = new Map();
const styleSheets = new Map();
const routes = new Map();
function maybeExecuteScript(src) {
// With HMR we might need to "reload" scripts when they are
// disposed and readded. Executing scripts twice has no functional
// differences
if ("development" !== "development") {
let prom = loadedScripts.get(src.toString());
if (prom) {
return prom;
}
// Skip executing script if it's already in the DOM:
if (document.querySelector(`script[src^="${src}"]`)) {
return Promise.resolve();
}
loadedScripts.set(src.toString(), prom = appendScript(src));
return prom;
} else {
return appendScript(src);
}
}
function fetchStyleSheet(href) {
let prom = styleSheets.get(href);
if (prom) {
return prom;
}
styleSheets.set(href, prom = fetch(href).then((res)=>{
if (!res.ok) {
throw new Error(`Failed to load stylesheet: ${href}`);
}
return res.text().then((text)=>({
href: href,
content: text
}));
}).catch((err)=>{
throw markAssetError(err);
}));
return prom;
}
return {
whenEntrypoint (route) {
return withFuture(route, entrypoints);
},
onEntrypoint (route, execute) {
(execute ? Promise.resolve().then(()=>execute()).then((exports1)=>({
component: exports1 && exports1.default || exports1,
exports: exports1
}), (err)=>({
error: err
})) : Promise.resolve(undefined)).then((input)=>{
const old = entrypoints.get(route);
if (old && "resolve" in old) {
if (input) {
entrypoints.set(route, input);
old.resolve(input);
}
} else {
if (input) {
entrypoints.set(route, input);
} else {
entrypoints.delete(route);
}
// when this entrypoint has been resolved before
// the route is outdated and we want to invalidate
// this cache entry
routes.delete(route);
}
});
},
loadRoute (route, prefetch) {
return withFuture(route, routes, ()=>{
let devBuildPromiseResolve;
if ("development" === "development") {
devBuildPromise = new Promise((resolve)=>{
devBuildPromiseResolve = resolve;
});
}
return resolvePromiseWithTimeout(getFilesForRoute(assetPrefix, route).then(({ scripts , css })=>{
return Promise.all([
entrypoints.has(route) ? [] : Promise.all(scripts.map(maybeExecuteScript)),
Promise.all(css.map(fetchStyleSheet))
]);
}).then((res)=>{
return this.whenEntrypoint(route).then((entrypoint)=>({
entrypoint,
styles: res[1]
}));
}), MS_MAX_IDLE_DELAY, markAssetError(new Error(`Route did not complete loading: ${route}`))).then(({ entrypoint , styles })=>{
const res = Object.assign({
styles: styles
}, entrypoint);
return "error" in entrypoint ? entrypoint : res;
}).catch((err)=>{
if (prefetch) {
// we don't want to cache errors during prefetch
throw err;
}
return {
error: err
};
}).finally(()=>{
return devBuildPromiseResolve == null ? void 0 : devBuildPromiseResolve();
});
});
},
prefetch (route) {
// https://github.com/GoogleChromeLabs/quicklink/blob/453a661fa1fa940e2d2e044452398e38c67a98fb/src/index.mjs#L115-L118
// License: Apache 2.0
let 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((output)=>Promise.all(canPrefetch ? output.scripts.map((script)=>prefetchViaDom(script.toString(), "script")) : [])).then(()=>{
(0, _requestIdleCallback).requestIdleCallback(()=>this.loadRoute(route, true).catch(()=>{}));
}).catch(()=>{});
}
};
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=route-loader.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/route-loader.jsU{"version":3,"sources":["webpack://./node_modules/next/dist/client/route-loader.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.markAssetError = markAssetError;\nexports.isAssetError = isAssetError;\nexports.getClientBuildManifest = getClientBuildManifest;\nexports.createRouteLoader = createRouteLoader;\nvar _interop_require_default = require(\"@swc/helpers/lib/_interop_require_default.js\").default;\nvar _getAssetPathFromRoute = _interop_require_default(require(\"../shared/lib/router/utils/get-asset-path-from-route\"));\nvar _trustedTypes = require(\"./trusted-types\");\nvar _requestIdleCallback = require(\"./request-idle-callback\");\n// 3.8s was arbitrarily chosen as it's what https://web.dev/interactive\n// considers as \"Good\" time-to-interactive. We must assume something went\n// wrong beyond this point, and then fall-back to a full page transition to\n// show the user something of value.\nconst MS_MAX_IDLE_DELAY = 3800;\nfunction withFuture(key, map, generator) {\n let entry = map.get(key);\n if (entry) {\n if ('future' in entry) {\n return entry.future;\n }\n return Promise.resolve(entry);\n }\n let resolver;\n const prom = new Promise((resolve)=>{\n resolver = resolve;\n });\n map.set(key, entry = {\n resolve: resolver,\n future: prom\n });\n return generator ? generator()// eslint-disable-next-line no-sequences\n .then((value)=>(resolver(value), value)).catch((err)=>{\n map.delete(key);\n throw err;\n }) : prom;\n}\nconst ASSET_LOAD_ERROR = Symbol('ASSET_LOAD_ERROR');\nfunction markAssetError(err) {\n return Object.defineProperty(err, ASSET_LOAD_ERROR, {});\n}\nfunction isAssetError(err) {\n return err && ASSET_LOAD_ERROR in err;\n}\nfunction hasPrefetch(link) {\n try {\n link = document.createElement('link');\n return(// detect IE11 since it supports prefetch but isn't detected\n // with relList.support\n (!!window.MSInputMethodContext && !!document.documentMode) || link.relList.supports('prefetch'));\n } catch (e) {\n return false;\n }\n}\nconst canPrefetch = hasPrefetch();\nfunction prefetchViaDom(href, as, link) {\n return new Promise((resolve, reject)=>{\n const selector = `\n link[rel=\"prefetch\"][href^=\"${href}\"],\n link[rel=\"preload\"][href^=\"${href}\"],\n script[src^=\"${href}\"]`;\n if (document.querySelector(selector)) {\n return resolve();\n }\n link = document.createElement('link');\n // The order of property assignment here is intentional:\n if (as) link.as = as;\n link.rel = `prefetch`;\n link.crossOrigin = process.env.__NEXT_CROSS_ORIGIN;\n link.onload = resolve;\n link.onerror = ()=>reject(markAssetError(new Error(`Failed to prefetch: ${href}`)));\n // `href` should always be last:\n link.href = href;\n document.head.appendChild(link);\n });\n}\nfunction appendScript(src, script) {\n return new Promise((resolve, reject)=>{\n script = document.createElement('script');\n // The order of property assignment here is intentional.\n // 1. Setup success/failure hooks in case the browser synchronously\n // executes when `src` is set.\n script.onload = resolve;\n script.onerror = ()=>reject(markAssetError(new Error(`Failed to load script: ${src}`)));\n // 2. Configure the cross-origin attribute before setting `src` in case the\n // browser begins to fetch.\n script.crossOrigin = process.env.__NEXT_CROSS_ORIGIN;\n // 3. Finally, set the source and inject into the DOM in case the child\n // must be appended for fetching to start.\n script.src = src;\n document.body.appendChild(script);\n });
b6
uA<><00> c  .A*1 c  =#<23><><EFBFBD>A<> <00>  cFF:!<21><><EFBFBD>AB a  cXX<<17><><EFBFBD>A<><00> cmu \<5C><><EFBFBD>A3 cv| R<><52><EFBFBD>A5  cv-| <11><><EFBFBD>Ay<00> @<40>@<40>V<><56><EFBFBD>A<><00> @<40>@<40> L<><4C><EFBFBD>A<>h @<40>`-@<40>  <0B><><EFBFBD>A$3$ @<40>`@<40>``aOa;NU<><55><EFBFBD>V<><56><EFBFBD> aQg@W<><57><EFBFBD><15> `'`z@<40>@T<><54><EFBFBD><15> `#A<><00>@Q<><51><EFBFBD><15> `7A<><00>@N<><4E><EFBFBD><15> `-M<><4D><EFBFBD> P<><50><EFBFBD>P<><50><EFBFBD>A&e b ^<02>../shared/lib/router/utils/get-asset-path-from-route<15>A<><00>
b6
u<02>./trusted-types<15>A<>  c  .<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>A2K c  =AH-W-@<40><><EFBFBD>A<><41><EFBFBD>@` @`Aq-<00>-=<3D><><EFBFBD>><3E><><EFBFBD>@`5@`DA<>-<00>-:<3A><><EFBFBD>;<3B><><EFBFBD>@`U@`dA<>-<00>-7<><37><EFBFBD>8<><38><EFBFBD>3<><33><EFBFBD>@`yA<00>A<>- .4<><34><EFBFBD>5<><35><EFBFBD>@`@`)AL.[.1<><31><EFBFBD>2<><32><EFBFBD>@!`@!`!A].d..<2E><><EFBFBD>@!`#@!`*Ak.y.z<><7A><EFBFBD>@"@"`A|.<00>.(<28><><EFBFBD>)<29><><EFBFBD>@"`@"`$<1F>)"use strict";
"use client";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.handleClientScriptLoad = handleClientScriptLoad;
exports.initScriptLoader = initScriptLoader;
exports.default = void 0;
var _extends = require("@swc/helpers/lib/_extends.js").default;
var _interop_require_default = require("@swc/helpers/lib/_interop_require_default.js").default;
var _interop_require_wildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
var _object_without_properties_loose = require("@swc/helpers/lib/_object_without_properties_loose.js").default;
var _reactDom = _interop_require_default(require("react-dom"));
var _react = _interop_require_wildcard(require("react"));
var _headManagerContext = require("../shared/lib/head-manager-context");
var _headManager = require("./head-manager");
var _requestIdleCallback = require("./request-idle-callback");
const ScriptCache = new Map();
const LoadCache = new Set();
const ignoreProps = [
"onLoad",
"onReady",
"dangerouslySetInnerHTML",
"children",
"onError",
"strategy"
];
const loadScript = (props)=>{
const { src , id , onLoad =()=>{} , onReady =null , dangerouslySetInnerHTML , children ="" , strategy ="afterInteractive" , onError } = props;
const cacheKey = id || src;
// Script has already loaded
if (cacheKey && LoadCache.has(cacheKey)) {
return;
}
// Contents of this script are already loading/loaded
if (ScriptCache.has(src)) {
LoadCache.add(cacheKey);
// It is possible that multiple `next/script` components all have same "src", but has different "onLoad"
// This is to make sure the same remote script will only load once, but "onLoad" are executed in order
ScriptCache.get(src).then(onLoad, onError);
return;
}
/** Execute after the script first loaded */ const afterLoad = ()=>{
// Run onReady for the first time after load event
if (onReady) {
onReady();
}
// add cacheKey to LoadCache when load successfully
LoadCache.add(cacheKey);
};
const el = document.createElement("script");
const loadPromise = new Promise((resolve, reject)=>{
el.addEventListener("load", function(e) {
resolve();
if (onLoad) {
onLoad.call(this, e);
}
afterLoad();
});
el.addEventListener("error", function(e) {
reject(e);
});
}).catch(function(e) {
if (onError) {
onError(e);
}
});
if (dangerouslySetInnerHTML) {
el.innerHTML = dangerouslySetInnerHTML.__html || "";
afterLoad();
} else if (children) {
el.textContent = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : "";
afterLoad();
} else if (src) {
el.src = src;
// do not add cacheKey into LoadCache for remote script here
// cacheKey will be added to LoadCache when it is actually loaded (see loadPromise above)
ScriptCache.set(src, loadPromise);
}
for (const [k, value] of Object.entries(props)){
if (value === undefined || ignoreProps.includes(k)) {
continue;
}
const attr = _headManager.DOMAttributeNames[k] || k.toLowerCase();
el.setAttribute(attr, value);
}
if (strategy === "worker") {
el.setAttribute("type", "text/partytown");
}
el.setAttribute("data-nscript", strategy);
document.body.appendChild(el);
};
function handleClientScriptLoad(props) {
const { strategy ="afterInteractive" } = props;
if (strategy === "lazyOnload") {
window.addEventListener("load", ()=>{
(0, _requestIdleCallback).requestIdleCallback(()=>loadScript(props));
});
} else {
loadScript(props);
}
}
function loadLazyScript(props) {
if (document.readyState === "complete") {
(0, _requestIdleCallback).requestIdleCallback(()=>loadScript(props));
} else {
window.addEventListener("load", ()=>{
(0, _requestIdleCallback).requestIdleCallback(()=>loadScript(props));
});
}
}
function addBeforeInteractiveToCache() {
const scripts = [
...document.querySelectorAll('[data-nscript="beforeInteractive"]'),
...document.querySelectorAll('[data-nscript="beforePageRender"]')
];
scripts.forEach((script)=>{
const cacheKey = script.id || script.getAttribute("src");
LoadCache.add(cacheKey);
});
}
function initScriptLoader(scriptLoaderItems) {
scriptLoaderItems.forEach(handleClientScriptLoad);
addBeforeInteractiveToCache();
}
function Script(props) {
const { id , src ="" , onLoad =()=>{} , onReady =null , strategy ="afterInteractive" , onError } = props, restProps = _object_without_properties_loose(props, [
"id",
"src",
"onLoad",
"onReady",
"strategy",
"onError"
]);
// Context is available only during SSR
const { updateScripts , scripts , getIsSsr , appDir , nonce } = (0, _react).useContext(_headManagerContext.HeadManagerContext);
/**
* - First mount:
* 1. The useEffect for onReady executes
* 2. hasOnReadyEffectCalled.current is false, but the script hasn't loaded yet (not in LoadCache)
* onReady is skipped, set hasOnReadyEffectCalled.current to true
* 3. The useEffect for loadScript executes
* 4. hasLoadScriptEffectCalled.current is false, loadScript executes
* Once the script is loaded, the onLoad and onReady will be called by then
* [If strict mode is enabled / is wrapped in <OffScreen /> component]
* 5. The useEffect for onReady executes again
* 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped
* 7. The useEffect for loadScript executes again
* 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped
*
* - Second mount:
* 1. The useEffect for onReady executes
* 2. hasOnReadyEffectCalled.current is false, but the script has already loaded (found in LoadCache)
* onReady is called, set hasOnReadyEffectCalled.current to true
* 3. The useEffect for loadScript executes
* 4. The script is already loaded, loadScript bails out
* [If strict mode is enabled / is wrapped in <OffScreen /> component]
* 5. The useEffect for onReady executes again
* 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped
* 7. The useEffect for loadScript executes again
* 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped
*/ const hasOnReadyEffectCalled = (0, _react).useRef(false);
(0, _react).useEffect(()=>{
const cacheKey = id || src;
if (!hasOnReadyEffectCalled.current) {
// Run onReady if script has loaded before but component is re-mounted
if (onReady && cacheKey && LoadCache.has(cacheKey)) {
onReady();
}
hasOnReadyEffectCalled.current = true;
}
}, [
onReady,
id,
src
]);
const hasLoadScriptEffectCalled = (0, _react).useRef(false);
(0, _react).useEffect(()=>{
if (!hasLoadScriptEffectCalled.current) {
if (strategy === "afterInteractive") {
loadScript(props);
} else if (strategy === "lazyOnload") {
loadLazyScript(props);
}
hasLoadScriptEffectCalled.current = true;
}
}, [
props,
strategy
]);
if (strategy === "beforeInteractive" || strategy === "worker") {
if (updateScripts) {
scripts[strategy] = (scripts[strategy] || []).concat([
_extends({
id,
src,
onLoad,
onReady,
onError
}, restProps)
]);
updateScripts(scripts);
} else if (getIsSsr && getIsSsr()) {
// Script has already loaded during SSR
LoadCache.add(id || src);
} else if (getIsSsr && !getIsSsr()) {
loadScript(props);
}
}
// For the app directory, we need React Float to preload these scripts.
if (appDir) {
// Before interactive scripts need to be loaded by Next.js' runtime instead
// of native <script> tags, because they no longer have `defer`.
if (strategy === "beforeInteractive") {
if (!src) {
// For inlined scripts, we put the content in `children`.
if (restProps.dangerouslySetInnerHTML) {
restProps.children = restProps.dangerouslySetInnerHTML.__html;
delete restProps.dangerouslySetInnerHTML;
}
return /*#__PURE__*/ _react.default.createElement("script", {
nonce: nonce,
dangerouslySetInnerHTML: {
__html: `(self.__next_s=self.__next_s||[]).push(${JSON.stringify([
0,
_extends({}, restProps)
])})`
}
});
}
// @ts-ignore
_reactDom.default.preload(src, restProps.integrity ? {
as: "script",
integrity: restProps.integrity
} : {
as: "script"
});
return /*#__PURE__*/ _react.default.createElement("script", {
nonce: nonce,
dangerouslySetInnerHTML: {
__html: `(self.__next_s=self.__next_s||[]).push(${JSON.stringify([
src
])})`
}
});
} else if (strategy === "afterInteractive") {
if (src) {
// @ts-ignore
_reactDom.default.preload(src, restProps.integrity ? {
as: "script",
integrity: restProps.integrity
} : {
as: "script"
});
}
}
}
return null;
}
Object.defineProperty(Script, "__nextScript", {
value: true
});
var _default = Script;
exports.default = _default;
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=script.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/script.js<1F>F{"version":3,"sources":["webpack://./node_modules/next/dist/client/script.js"],"sourcesContent":["\"use client\";\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.handleClientScriptLoad = handleClientScriptLoad;\nexports.initScriptLoader = initScriptLoader;\nexports.default = void 0;\nvar _extends = require(\"@swc/helpers/lib/_extends.js\").default;\nvar _interop_require_default = require(\"@swc/helpers/lib/_interop_require_default.js\").default;\nvar _interop_require_wildcard = require(\"@swc/helpers/lib/_interop_require_wildcard.js\").default;\nvar _object_without_properties_loose = require(\"@swc/helpers/lib/_object_without_properties_loose.js\").default;\nvar _reactDom = _interop_require_default(require(\"react-dom\"));\nvar _react = _interop_require_wildcard(require(\"react\"));\nvar _headManagerContext = require(\"../shared/lib/head-manager-context\");\nvar _headManager = require(\"./head-manager\");\nvar _requestIdleCallback = require(\"./request-idle-callback\");\n\nconst ScriptCache = new Map();\nconst LoadCache = new Set();\nconst ignoreProps = [\n 'onLoad',\n 'onReady',\n 'dangerouslySetInnerHTML',\n 'children',\n 'onError',\n 'strategy', \n];\nconst loadScript = (props)=>{\n const { src , id , onLoad =()=>{} , onReady =null , dangerouslySetInnerHTML , children ='' , strategy ='afterInteractive' , onError , } = props;\n const cacheKey = id || src;\n // Script has already loaded\n if (cacheKey && LoadCache.has(cacheKey)) {\n return;\n }\n // Contents of this script are already loading/loaded\n if (ScriptCache.has(src)) {\n LoadCache.add(cacheKey);\n // It is possible that multiple `next/script` components all have same \"src\", but has different \"onLoad\"\n // This is to make sure the same remote script will only load once, but \"onLoad\" are executed in order\n ScriptCache.get(src).then(onLoad, onError);\n return;\n }\n /** Execute after the script first loaded */ const afterLoad = ()=>{\n // Run onReady for the first time after load event\n if (onReady) {\n onReady();\n }\n // add cacheKey to LoadCache when load successfully\n LoadCache.add(cacheKey);\n };\n const el = document.createElement('script');\n const loadPromise = new Promise((resolve, reject)=>{\n el.addEventListener('load', function(e) {\n resolve();\n if (onLoad) {\n onLoad.call(this, e);\n }\n afterLoad();\n });\n el.addEventListener('error', function(e) {\n reject(e);\n });\n }).catch(function(e) {\n if (onError) {\n onError(e);\n }\n });\n if (dangerouslySetInnerHTML) {\n el.innerHTML = dangerouslySetInnerHTML.__html || '';\n afterLoad();\n } else if (children) {\n el.textContent = typeof children === 'string' ? children : Array.isArray(children) ? children.join('') : '';\n afterLoad();\n } else if (src) {\n el.src = src;\n // do not add cacheKey into LoadCache for remote script here\n // cacheKey will be added to LoadCache when it is actually loaded (see loadPromise above)\n ScriptCache.set(src, loadPromise);\n }\n for (const [k, value] of Object.entries(props)){\n if (value === undefined || ignoreProps.includes(k)) {\n continue;\n }\n const attr = _headManager.DOMAttributeNames[k] || k.toLowerCase();\n el.setAttribute(attr, value);\n }\n if (strategy === 'worker') {\n el.setAttribute('type', 'text/partytown');\n }\n el.setAttribute('data-nscript', strategy);\n document.body.appendChild(el);\n};\nfunction handleClientScriptLoad(props) {\n const { strategy ='afterInteractive' } = props;\n if (strategy === 'lazyOnload') {\n wi
b
^<16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>A<><00> c `<16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>AO c ' n-<2D><><EFBFBD>-<2D><><EFBFBD>A<><00> c ) =*<2A><><EFBFBD>*<2A><><EFBFBD>A<><00> c'7<02>../shared/lib/head-manager-context<15>A<> cG<02>./head-manager<15>A/? c,o<><6F><EFBFBD>o<><6F><EFBFBD>Ae~ c=AJ(Y(@<40><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> @@`Ar(<00>(<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@ ` @ `A<>(<00>(<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@ `5@ `DA<>(<00>(<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@ `U@ `dA<>(<00>(<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@ `yA <00>A')6)<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@
`@
`)Av)<00>)<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@ `@ `!A<>)<00>)<16><><EFBFBD><EFBFBD>@ `#@ `*A<>)<00>) <0A><><EFBFBD>@@`A<>)<00>)<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@`@`$<1F>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.detectDomainLocale = void 0;
const detectDomainLocale = (...args)=>{
if (process.env.__NEXT_I18N_SUPPORT) {
return require("../shared/lib/i18n/detect-domain-locale").detectDomainLocale(...args);
}
};
exports.detectDomainLocale = detectDomainLocale;
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=detect-domain-locale.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/detect-domain-locale.jsH{"version":3,"sources":["webpack://./node_modules/next/dist/client/detect-domain-locale.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.detectDomainLocale = void 0;\nconst detectDomainLocale = (...args)=>{\n if (process.env.__NEXT_I18N_SUPPORT) {\n return require('../shared/lib/i18n/detect-domain-locale').detectDomainLocale(...args);\n }\n};\nexports.detectDomainLocale = detectDomainLocale;\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=detect-domain-locale.js.map"],"names":["Object","defineProperty","exports","value","detectDomainLocale","args","process","env","__NEXT_I18N_SUPPORT","require","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,kBAAkB,GAAG,KAAK;AAClC,MAAMA,qBAAqB,CAAC,GAAGC,OAAO;IAClC,IAAIC,QAAQC,GAAG,CAACC,mBAAmB,EAAE;QACjC,OAAOC,QAAQ,2CAA2CL,kBAAkB,IAAIC;IACpF,CAAC;AACL;AACAH,QAAQE,kBAAkB,GAAGA;AAE7B,IAAI,AAAC,CAAA,OAAOF,QAAQQ,OAAO,KAAK,cAAe,OAAOR,QAAQQ,OAAO,KAAK,YAAYR,QAAQQ,OAAO,KAAK,IAAI,KAAM,OAAOR,QAAQQ,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKX,OAAOC,cAAc,CAACC,QAAQQ,OAAO,EAAE,cAAc;QAAEP,OAAO,IAAI;IAAC;IACnEH,OAAOY,MAAM,CAACV,QAAQQ,OAAO,EAAER;IAC/BW,OAAOX,OAAO,GAAGA,QAAQQ,OAAO;AAClC,CAAC,CAED,gDAAgD","file":"x"}`<16><><EFBFBD><EFBFBD>  <16><><EFBFBD><EFBFBD>@5<><35><EFBFBD><16><><EFBFBD><EFBFBD> <15>X<><58><EFBFBD> Y<><59><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><17>ba2461a29a5e6bd8 <01>detectDomainLocale @ <00>=<3D><>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><02><><EFBFBD><16><><EFBFBD><EFBFBD><06>`  ` <16><><EFBFBD><EFBFBD>A<><00>  <16><><EFBFBD><EFBFBD>A<>- b) ` aOa;N<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> aQk@<40><><EFBFBD><EFBFBD><15> `#A1K@<40><><EFBFBD><EFBFBD><15> c /An}<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c A<><00><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c 5 DA<><00><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c U dA<><00><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>b y @<40>A#2<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c  )Ar<00><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c!A<><00><16><><EFBFBD><EFBFBD>c#*A<><00><16><><EFBFBD><EFBFBD>cA<><00>}<7D><><EFBFBD>~<7E><><EFBFBD>c$$"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.removeLocale = removeLocale;
var _parsePath = require("../shared/lib/router/utils/parse-path");
function removeLocale(path, locale) {
if (process.env.__NEXT_I18N_SUPPORT) {
const { pathname } = (0, _parsePath).parsePath(path);
const pathLower = pathname.toLowerCase();
const localeLower = locale == null ? void 0 : locale.toLowerCase();
return locale && (pathLower.startsWith(`/${localeLower}/`) || pathLower === `/${localeLower}`) ? `${pathname.length === locale.length + 1 ? `/` : ``}${path.slice(locale.length + 1)}` : path;
}
return path;
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=remove-locale.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/remove-locale.js<1F> {"version":3,"sources":["webpack://./node_modules/next/dist/client/remove-locale.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.removeLocale = removeLocale;\nvar _parsePath = require(\"../shared/lib/router/utils/parse-path\");\nfunction removeLocale(path, locale) {\n if (process.env.__NEXT_I18N_SUPPORT) {\n const { pathname } = (0, _parsePath).parsePath(path);\n const pathLower = pathname.toLowerCase();\n const localeLower = locale == null ? void 0 : locale.toLowerCase();\n return locale && (pathLower.startsWith(`/${localeLower}/`) || pathLower === `/${localeLower}`) ? `${pathname.length === locale.length + 1 ? `/` : ``}${path.slice(locale.length + 1)}` : path;\n }\n return path;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=remove-locale.js.map"],"names":["Object","defineProperty","exports","value","removeLocale","_parsePath","require","path","locale","process","env","__NEXT_I18N_SUPPORT","pathname","parsePath","pathLower","toLowerCase","localeLower","startsWith","length","slice","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,YAAY,GAAGA;AACvB,IAAIC,aAAaC,QAAQ;AACzB,SAASF,aAAaG,IAAI,EAAEC,MAAM,EAAE;IAChC,IAAIC,QAAQC,GAAG,CAACC,mBAAmB,EAAE;QACjC,MAAM,EAAEC,SAAQ,EAAG,GAAG,AAAC,CAAA,GAAGP,UAAU,AAAD,EAAGQ,SAAS,CAACN;QAChD,MAAMO,YAAYF,SAASG,WAAW;QACtC,MAAMC,cAAcR,UAAU,IAAI,GAAG,KAAK,IAAIA,OAAOO,WAAW,EAAE;QAClE,OAAOP,UAAWM,CAAAA,UAAUG,UAAU,CAAC,CAAC,CAAC,EAAED,YAAY,CAAC,CAAC,KAAKF,cAAc,CAAC,CAAC,EAAEE,YAAY,CAAC,AAAD,IAAK,CAAC,EAAEJ,SAASM,MAAM,KAAKV,OAAOU,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAEX,KAAKY,KAAK,CAACX,OAAOU,MAAM,GAAG,GAAG,CAAC,GAAGX,IAAI;IACjM,CAAC;IACD,OAAOA;AACX;AAEA,IAAI,AAAC,CAAA,OAAOL,QAAQkB,OAAO,KAAK,cAAe,OAAOlB,QAAQkB,OAAO,KAAK,YAAYlB,QAAQkB,OAAO,KAAK,IAAI,KAAM,OAAOlB,QAAQkB,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKrB,OAAOC,cAAc,CAACC,QAAQkB,OAAO,EAAE,cAAc;QAAEjB,OAAO,IAAI;IAAC;IACnEH,OAAOsB,MAAM,CAACpB,QAAQkB,OAAO,EAAElB;IAC/BqB,OAAOrB,OAAO,GAAGA,QAAQkB,OAAO;AAClC,CAAC,CAED,yCAAyC","file":"x"}`<16><><EFBFBD><EFBFBD>  <16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <15><1A><><EFBFBD> <1B><><EFBFBD><16><><EFBFBD><EFBFBD>c<><63><EFBFBD><16><><EFBFBD><EFBFBD>d<><64><EFBFBD><17>8b318615bc3ee2e0 <16><><EFBFBD><EFBFBD><EFBFBD>removeLocale @ <00>=<3D><>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><06>`  ` A<><00> bAX<><58><EFBFBD>A<> a N<><4E><EFBFBD>A<00> b) ` aOa;NY<><59><EFBFBD>Z<><5A><EFBFBD> aQe@[<5B><><EFBFBD><15> `#-<2D><><EFBFBD>-<2D><><EFBFBD>A<><00> bAA<><00>V<><56><EFBFBD>W<><57><EFBFBD>c A<><00>S<><53><EFBFBD>T<><54><EFBFBD>c5DA<> P<><50><EFBFBD>Q<><51><EFBFBD>cUdA :M<><4D><EFBFBD>N<><4E><EFBFBD>I<><49><EFBFBD>by@<40>AhwJ<><4A><EFBFBD>K<><4B><EFBFBD>c)A<><00>G<><47><EFBFBD>H<><48><EFBFBD>c!A<><00>D<><44><EFBFBD>c#*A<><00><16><><EFBFBD><EFBFBD>cA<><00>><3E><><EFBFBD>?<3F><><EFBFBD>c$<1F>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.removeBasePath = removeBasePath;
var _hasBasePath = require("./has-base-path");
const basePath = process.env.__NEXT_ROUTER_BASEPATH || "";
function removeBasePath(path) {
if (process.env.__NEXT_MANUAL_CLIENT_BASE_PATH) {
if (!(0, _hasBasePath).hasBasePath(path)) {
return path;
}
}
path = path.slice(basePath.length);
if (!path.startsWith("/")) path = `/${path}`;
return path;
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=remove-base-path.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/remove-base-path.js{"version":3,"sources":["webpack://./node_modules/next/dist/client/remove-base-path.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.removeBasePath = removeBasePath;\nvar _hasBasePath = require(\"./has-base-path\");\nconst basePath = process.env.__NEXT_ROUTER_BASEPATH || '';\nfunction removeBasePath(path) {\n if (process.env.__NEXT_MANUAL_CLIENT_BASE_PATH) {\n if (!(0, _hasBasePath).hasBasePath(path)) {\n return path;\n }\n }\n path = path.slice(basePath.length);\n if (!path.startsWith('/')) path = `/${path}`;\n return path;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=remove-base-path.js.map"],"names":["Object","defineProperty","exports","value","removeBasePath","_hasBasePath","require","basePath","process","env","__NEXT_ROUTER_BASEPATH","path","__NEXT_MANUAL_CLIENT_BASE_PATH","hasBasePath","slice","length","startsWith","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,cAAc,GAAGA;AACzB,IAAIC,eAAeC,QAAQ;AAC3B,MAAMC,WAAWC,QAAQC,GAAG,CAACC,sBAAsB,IAAI;AACvD,SAASN,eAAeO,IAAI,EAAE;IAC1B,IAAIH,QAAQC,GAAG,CAACG,8BAA8B,EAAE;QAC5C,IAAI,CAAC,AAAC,CAAA,GAAGP,YAAY,AAAD,EAAGQ,WAAW,CAACF,OAAO;YACtC,OAAOA;QACX,CAAC;IACL,CAAC;IACDA,OAAOA,KAAKG,KAAK,CAACP,SAASQ,MAAM;IACjC,IAAI,CAACJ,KAAKK,UAAU,CAAC,MAAML,OAAO,CAAC,CAAC,EAAEA,KAAK,CAAC;IAC5C,OAAOA;AACX;AAEA,IAAI,AAAC,CAAA,OAAOT,QAAQe,OAAO,KAAK,cAAe,OAAOf,QAAQe,OAAO,KAAK,YAAYf,QAAQe,OAAO,KAAK,IAAI,KAAM,OAAOf,QAAQe,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKlB,OAAOC,cAAc,CAACC,QAAQe,OAAO,EAAE,cAAc;QAAEd,OAAO,IAAI;IAAC;IACnEH,OAAOmB,MAAM,CAACjB,QAAQe,OAAO,EAAEf;IAC/BkB,OAAOlB,OAAO,GAAGA,QAAQe,OAAO;AAClC,CAAC,CAED,4CAA4C","file":"x"}`a<><61><EFBFBD>  d<><64><EFBFBD>@<40><><EFBFBD><EFBFBD>g<><67><EFBFBD> <15><16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD>t<><74><EFBFBD>j<><6A><EFBFBD><16><><EFBFBD><EFBFBD>u<><75><EFBFBD>k<><6B><EFBFBD>%<25><><EFBFBD><17>1ed2da8478863a90 l<><6C><EFBFBD><EFBFBD>removeBasePathl<><6C><EFBFBD> @ <00>=<3D><>kxB`<60><><EFBFBD>u<><75><EFBFBD><16><><EFBFBD><EFBFBD>w<><77><EFBFBD><06>`  ` A<><00> b-<06><><EFBFBD>A<><00> b9<17><><EFBFBD>A 6 a  <0A><><EFBFBD>A8<00> b4 ` aOa;N<18><><EFBFBD><19><><EFBFBD> aQg@<1A><><EFBFBD><15> `'<02>./has-base-path<15>A<><00> b-A<14><><EFBFBD><15><><EFBFBD>c A9H<11><><EFBFBD><12><><EFBFBD>c5DAYh<0E><><EFBFBD><0F><><EFBFBD>cUdA}<00> <0B><><EFBFBD> <0C><><EFBFBD><07><><EFBFBD>by@<40>A<><00><08><><EFBFBD> <09><><EFBFBD>c)A#<05><><EFBFBD><06><><EFBFBD>c!A%,<02><><EFBFBD>c#*A3AN<><4E><EFBFBD>cADS<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c$<1F>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.hasBasePath = hasBasePath;
var _pathHasPrefix = require("../shared/lib/router/utils/path-has-prefix");
const basePath = process.env.__NEXT_ROUTER_BASEPATH || "";
function hasBasePath(path) {
return (0, _pathHasPrefix).pathHasPrefix(path, basePath);
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=has-base-path.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/has-base-path.js]{"version":3,"sources":["webpack://./node_modules/next/dist/client/has-base-path.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.hasBasePath = hasBasePath;\nvar _pathHasPrefix = require(\"../shared/lib/router/utils/path-has-prefix\");\nconst basePath = process.env.__NEXT_ROUTER_BASEPATH || '';\nfunction hasBasePath(path) {\n return (0, _pathHasPrefix).pathHasPrefix(path, basePath);\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=has-base-path.js.map"],"names":["Object","defineProperty","exports","value","hasBasePath","_pathHasPrefix","require","basePath","process","env","__NEXT_ROUTER_BASEPATH","path","pathHasPrefix","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,WAAW,GAAGA;AACtB,IAAIC,iBAAiBC,QAAQ;AAC7B,MAAMC,WAAWC,QAAQC,GAAG,CAACC,sBAAsB,IAAI;AACvD,SAASN,YAAYO,IAAI,EAAE;IACvB,OAAO,AAAC,CAAA,GAAGN,cAAc,AAAD,EAAGO,aAAa,CAACD,MAAMJ;AACnD;AAEA,IAAI,AAAC,CAAA,OAAOL,QAAQW,OAAO,KAAK,cAAe,OAAOX,QAAQW,OAAO,KAAK,YAAYX,QAAQW,OAAO,KAAK,IAAI,KAAM,OAAOX,QAAQW,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKd,OAAOC,cAAc,CAACC,QAAQW,OAAO,EAAE,cAAc;QAAEV,OAAO,IAAI;IAAC;IACnEH,OAAOe,MAAM,CAACb,QAAQW,OAAO,EAAEX;IAC/Bc,OAAOd,OAAO,GAAGA,QAAQW,OAAO;AAClC,CAAC,CAED,yCAAyC","file":"x"}`<1F><><EFBFBD>  "<22><><EFBFBD>@v<><76><EFBFBD>%<25><><EFBFBD> <15><16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD>2<><32><EFBFBD>(<28><><EFBFBD>3<><33><EFBFBD>)<29><><EFBFBD><17>2460a75986990d76 <03>_pathHasPrefix<69>hasBasePath)<29><><EFBFBD> @ <00>=<3D><>kxB<1D><><EFBFBD>2<><32><EFBFBD><16><><EFBFBD><EFBFBD>4<><34><EFBFBD><06>`  ` A<><00> bJ<16><><EFBFBD><EFBFBD>A<><00> b9` aOa;N<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> aQd@<40><><EFBFBD><EFBFBD><15> `!<02>../shared/lib/router/utils/path-has-prefix<15>A<><00> bJAds<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c A<><00><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c 5 DA<><00><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c U dA<><00><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>b y @<40>A(<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c  )Ahw<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c!Ay<00><16><><EFBFBD><EFBFBD>c#*A<><00><0F><><EFBFBD>cA<><00><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c$"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isAPIRoute = isAPIRoute;
function isAPIRoute(value) {
return value === "/api" || Boolean(value == null ? void 0 : value.startsWith("/api/"));
}
//# sourceMappingURL=is-api-route.js.map<61>webpack://./node_modules/next/dist/lib/is-api-route.js`<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD>@}<7D><><EFBFBD><16><><EFBFBD><EFBFBD> <15>\<5C><><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><17>e6d4d8dacbc31f2d <01>isAPIRoute @ <00>=<3D><>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>Y<><59><EFBFBD><16><><EFBFBD><EFBFBD><06>`  ` aOa;N<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> aQc@<40><><EFBFBD><EFBFBD><15> ` <0B>next/dist/shared/lib/mitt.js<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>  
 <0B>next/dist/shared/lib/utils.js<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>  
 <0B>next/dist/shared/lib/router/utils/is-dynamic.js<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>  
 <0B>next/dist/shared/lib/router/utils/parse-relative-url.js<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>  
 <0B>next/dist/shared/lib/router/utils/querystring.js<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>  
 <0B>next/dist/shared/lib/router/utils/resolve-rewrites.js<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>  
 <0B>next/dist/shared/lib/router/utils/route-matcher.js<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>  
 <0B>next/dist/shared/lib/router/utils/route-regex.js<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>  
 <0B>next/dist/shared/lib/router/utils/get-next-pathname-info.js<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>  
 <0B>next/dist/shared/lib/router/utils/format-next-pathname-info.js<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>  
 <0B>next/dist/shared/lib/router/utils/compare-states.js<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD> |<7C><><EFBFBD><16><><EFBFBD><EFBFBD>  
 <0B>next/dist/shared/lib/router/utils/is-bot.js<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD> t<><74><EFBFBD><16><><EFBFBD><EFBFBD>  
 <0B>next/dist/shared/lib/page-path/denormalize-page-path.js<16><><EFBFBD><EFBFBD>d<><64><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD> l<><6C><EFBFBD><16><><EFBFBD><EFBFBD>  
 <0B>next/dist/shared/lib/i18n/normalize-locale-path.js<16><><EFBFBD><EFBFBD>_<><5F><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD> d<><64><EFBFBD><16><><EFBFBD><EFBFBD>  
 <16><><EFBFBD><EFBFBD>  <16><><EFBFBD><EFBFBD><18><> x<><78><EFBFBD><16><><EFBFBD><EFBFBD>`<60><><EFBFBD><16><><EFBFBD><EFBFBD> @ <00>M<EFBFBD><4D>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>^<5E><><EFBFBD>s<><73><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js<18><> n<><6E><EFBFBD><16><><EFBFBD><EFBFBD>V<><56><EFBFBD><EFBFBD>./dist/shared/lib/router/utils/path-has-prefix.js @ <00>M<EFBFBD><4D>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>S<><53><EFBFBD>h<><68><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>u<><75><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/path-has-prefix<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>|<7C><><EFBFBD> <16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><18><> c<><63><EFBFBD><16><><EFBFBD><EFBFBD>K<><4B><EFBFBD><16><><EFBFBD><EFBFBD> @ <00>M<EFBFBD><4D>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>I<><49><EFBFBD>^<5E><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/get-asset-path-from-route.js<18><> Y<><59><EFBFBD><16><><EFBFBD><EFBFBD>A<><41><EFBFBD><EFBFBD>./dist/shared/lib/router/utils/get-asset-path-from-route.js @ <00>O<EFBFBD><4F>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>><3E><><EFBFBD>S<><53><EFBFBD><15>|<7C><><EFBFBD>~<7E><><EFBFBD>`<60><><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/router/utils/get-asset-path-from-route<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>m<><6D><EFBFBD>g<><67><EFBFBD> y<><79><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/trusted-types.js<18><> M<><4D><EFBFBD>x<><78><EFBFBD>5<><35><EFBFBD><EFBFBD>./dist/client/trusted-types.js @ <00>O<EFBFBD><4F>kxBy<><79><EFBFBD>z<><7A><EFBFBD>2<><32><EFBFBD>G<><47><EFBFBD><15><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> @<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/trusted-types k<><6B><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/head-manager-context.js<18><> ?<3F><><EFBFBD>j<><6A><EFBFBD>'<27><><EFBFBD><EFBFBD>./dist/shared/lib/head-manager-context.js @ <00>O<EFBFBD><4F>kxBk<><6B><EFBFBD>l<><6C><EFBFBD>$<24><><EFBFBD>9<><39><EFBFBD><15>S<><53><EFBFBD>T<><54><EFBFBD><01>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/shared/lib/head-manager-contextq<><71><EFBFBD>w<><77><EFBFBD>M<><4D><EFBFBD> _<><5F><EFBFBD>  <0C>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/head-manager.js<18><> 3<><33><EFBFBD>^<5E><><EFBFBD><1B><><EFBFBD><EFBFBD>./dist/client/head-manager.js @ <00>O<EFBFBD><4F>kxB_<><5F><EFBFBD>`<60><><EFBFBD><18><><EFBFBD>-<2D><><EFBFBD><15>j<><6A><EFBFBD>f<><66><EFBFBD>l<><6C><EFBFBD> @q<><71><EFBFBD>r<><72><EFBFBD><EFBFBD>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/head-manager '<27><><EFBFBD>5<><35><EFBFBD>'<27><><EFBFBD>6<><36><EFBFBD>@7<><37><EFBFBD> 9<><39><EFBFBD>  <0B><><EFBFBD><<3C><><EFBFBD>  
 <0B>next/dist/shared/lib/router/utils/path-has-prefix.js-<2D><><EFBFBD><16><><EFBFBD><EFBFBD>.<2E><><EFBFBD>@/<2F><><EFBFBD> 1<><31><EFBFBD> <03><><EFBFBD>4<><34><EFBFBD>  
 B<><42><EFBFBD> g<><67><EFBFBD><16><><EFBFBD><EFBFBD>@h<><68><EFBFBD><15><18><> <17><><EFBFBD>B<><42><EFBFBD><16><><EFBFBD><EFBFBD><15> @ <00>O<EFBFBD><4F>kxBD<><44><EFBFBD>E<><45><EFBFBD><16><><EFBFBD><EFBFBD><12><><EFBFBD><15>O<><4F><EFBFBD>L<><4C><EFBFBD>R<><52><EFBFBD><15> :<3A><><EFBFBD> _<><5F><EFBFBD>n<><6E><EFBFBD>@`<60><><EFBFBD><15><18><> <0F><><EFBFBD>:<3A><><EFBFBD><16><><EFBFBD><EFBFBD><15> @ P<><50>kxB<<3C><><EFBFBD>=<3D><><EFBFBD><16><><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><15>G<><47><EFBFBD>D<><44><EFBFBD>J<><4A><EFBFBD><15>3"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return _asyncToGenerator;
}
});
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function() {
var self = this, args = arguments;
return new Promise(function(resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
<EFBFBD>webpack://./node_modules/@swc/helpers/lib/_async_to_generator.js`<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>  <15>a<><61><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><17>52e5b1be3749b3c6 <02>asyncGeneratorStep<65>_asyncToGenerator @ <00>=<3D><>kxB<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><02>/home/ismail/Desktop/kitabcitab-frontend/kitabcitab/node_modules/@swc/helpers/lib/_async_to_generator.js<16><><EFBFBD><EFBFBD><06>`  ` aOa;N<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> `Q@<40>`{@<40><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> 
<1F>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = initHeadManager;
exports.isEqualNode = isEqualNode;
exports.DOMAttributeNames = void 0;
function initHeadManager() {
return {
mountedInstances: new Set(),
updateHead: (head)=>{
const tags = {};
head.forEach((h)=>{
if (// it won't be inlined. In this case revert to the original behavior
h.type === "link" && h.props["data-optimized-fonts"]) {
if (document.querySelector(`style[data-href="${h.props["data-href"]}"]`)) {
return;
} else {
h.props.href = h.props["data-href"];
h.props["data-href"] = undefined;
}
}
const components = tags[h.type] || [];
components.push(h);
tags[h.type] = components;
});
const titleComponent = tags.title ? tags.title[0] : null;
let title = "";
if (titleComponent) {
const { children } = titleComponent.props;
title = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : "";
}
if (title !== document.title) document.title = title;
[
"meta",
"base",
"link",
"style",
"script"
].forEach((type)=>{
updateElements(type, tags[type] || []);
});
}
};
}
const DOMAttributeNames = {
acceptCharset: "accept-charset",
className: "class",
htmlFor: "for",
httpEquiv: "http-equiv",
noModule: "noModule"
};
exports.DOMAttributeNames = DOMAttributeNames;
function reactElementToDOM({ type , props }) {
const el = document.createElement(type);
for(const p in props){
if (!props.hasOwnProperty(p)) continue;
if (p === "children" || p === "dangerouslySetInnerHTML") continue;
// we don't render undefined props to the DOM
if (props[p] === undefined) continue;
const attr = DOMAttributeNames[p] || p.toLowerCase();
if (type === "script" && (attr === "async" || attr === "defer" || attr === "noModule")) {
el[attr] = !!props[p];
} else {
el.setAttribute(attr, props[p]);
}
}
const { children , dangerouslySetInnerHTML } = props;
if (dangerouslySetInnerHTML) {
el.innerHTML = dangerouslySetInnerHTML.__html || "";
} else if (children) {
el.textContent = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : "";
}
return el;
}
function isEqualNode(oldTag, newTag) {
if (oldTag instanceof HTMLElement && newTag instanceof HTMLElement) {
const nonce = newTag.getAttribute("nonce");
// Only strip the nonce if `oldTag` has had it stripped. An element's nonce attribute will not
// be stripped if there is no content security policy response header that includes a nonce.
if (nonce && !oldTag.getAttribute("nonce")) {
const cloneTag = newTag.cloneNode(true);
cloneTag.setAttribute("nonce", "");
cloneTag.nonce = nonce;
return nonce === oldTag.nonce && oldTag.isEqualNode(cloneTag);
}
}
return oldTag.isEqualNode(newTag);
}
function updateElements(type, components) {
const headEl = document.getElementsByTagName("head")[0];
const headCountEl = headEl.querySelector("meta[name=next-head-count]");
if ("development" !== "production") {
if (!headCountEl) {
console.error("Warning: next-head-count is missing. https://nextjs.org/docs/messages/next-head-count-missing");
return;
}
}
const headCount = Number(headCountEl.content);
const oldTags = [];
for(let i = 0, j = headCountEl.previousElementSibling; i < headCount; i++, j = (j == null ? void 0 : j.previousElementSibling) || null){
var ref;
if ((j == null ? void 0 : (ref = j.tagName) == null ? void 0 : ref.toLowerCase()) === type) {
oldTags.push(j);
}
}
const newTags = components.map(reactElementToDOM).filter((newTag)=>{
for(let k = 0, len = oldTags.length; k < len; k++){
const oldTag = oldTags[k];
if (isEqualNode(oldTag, newTag)) {
oldTags.splice(k, 1);
return false;
}
}
return true;
});
oldTags.forEach((t)=>{
var ref;
return (ref = t.parentNode) == null ? void 0 : ref.removeChild(t);
});
newTags.forEach((t)=>headEl.insertBefore(t, headCountEl));
headCountEl.content = (headCount - oldTags.length + newTags.length).toString();
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=head-manager.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/head-manager.js<1F>({"version":3,"sources":["webpack://./node_modules/next/dist/client/head-manager.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = initHeadManager;\nexports.isEqualNode = isEqualNode;\nexports.DOMAttributeNames = void 0;\nfunction initHeadManager() {\n return {\n mountedInstances: new Set(),\n updateHead: (head)=>{\n const tags = {};\n head.forEach((h)=>{\n if (// If the font tag is loaded only on client navigation\n // it won't be inlined. In this case revert to the original behavior\n h.type === 'link' && h.props['data-optimized-fonts']) {\n if (document.querySelector(`style[data-href=\"${h.props['data-href']}\"]`)) {\n return;\n } else {\n h.props.href = h.props['data-href'];\n h.props['data-href'] = undefined;\n }\n }\n const components = tags[h.type] || [];\n components.push(h);\n tags[h.type] = components;\n });\n const titleComponent = tags.title ? tags.title[0] : null;\n let title = '';\n if (titleComponent) {\n const { children } = titleComponent.props;\n title = typeof children === 'string' ? children : Array.isArray(children) ? children.join('') : '';\n }\n if (title !== document.title) document.title = title;\n [\n 'meta',\n 'base',\n 'link',\n 'style',\n 'script'\n ].forEach((type)=>{\n updateElements(type, tags[type] || []);\n });\n }\n };\n}\nconst DOMAttributeNames = {\n acceptCharset: 'accept-charset',\n className: 'class',\n htmlFor: 'for',\n httpEquiv: 'http-equiv',\n noModule: 'noModule'\n};\nexports.DOMAttributeNames = DOMAttributeNames;\nfunction reactElementToDOM({ type , props }) {\n const el = document.createElement(type);\n for(const p in props){\n if (!props.hasOwnProperty(p)) continue;\n if (p === 'children' || p === 'dangerouslySetInnerHTML') continue;\n // we don't render undefined props to the DOM\n if (props[p] === undefined) continue;\n const attr = DOMAttributeNames[p] || p.toLowerCase();\n if (type === 'script' && (attr === 'async' || attr === 'defer' || attr === 'noModule')) {\n el[attr] = !!props[p];\n } else {\n el.setAttribute(attr, props[p]);\n }\n }\n const { children , dangerouslySetInnerHTML } = props;\n if (dangerouslySetInnerHTML) {\n el.innerHTML = dangerouslySetInnerHTML.__html || '';\n } else if (children) {\n el.textContent = typeof children === 'string' ? children : Array.isArray(children) ? children.join('') : '';\n }\n return el;\n}\nfunction isEqualNode(oldTag, newTag) {\n if (oldTag instanceof HTMLElement && newTag instanceof HTMLElement) {\n const nonce = newTag.getAttribute('nonce');\n // Only strip the nonce if `oldTag` has had it stripped. An element's nonce attribute will not\n // be stripped if there is no content security policy response header that includes a nonce.\n if (nonce && !oldTag.getAttribute('nonce')) {\n const cloneTag = newTag.cloneNode(true);\n cloneTag.setAttribute('nonce', '');\n cloneTag.nonce = nonce;\n return nonce === oldTag.nonce && oldTag.isEqualNode(cloneTag);\n }\n }\n return oldTag.isEqualNode(newTag);\n}\nfunction updateElements(type, components) {\n const headEl = document.getElementsByTagName('head')[0];\n const headCountEl = headEl.querySelector('meta[name=next-head-count]');\
^"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.__unsafeCreateTrustedScriptURL = __unsafeCreateTrustedScriptURL;
/**
* Stores the Trusted Types Policy. Starts as undefined and can be set to null
* if Trusted Types is not supported in the browser.
*/ let policy;
/**
* Getter for the Trusted Types Policy. If it is undefined, it is instantiated
* here or set to null if Trusted Types is not supported in the browser.
*/ function getPolicy() {
if (typeof policy === "undefined" && "undefined" !== "undefined") {
var ref;
policy = ((ref = window.trustedTypes) == null ? void 0 : ref.createPolicy("nextjs", {
createHTML: (input)=>input,
createScript: (input)=>input,
createScriptURL: (input)=>input
})) || null;
}
return policy;
}
function __unsafeCreateTrustedScriptURL(url) {
var ref;
return ((ref = getPolicy()) == null ? void 0 : ref.createScriptURL(url)) || url;
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=trusted-types.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/trusted-types.jsc
{"version":3,"sources":["webpack://./node_modules/next/dist/client/trusted-types.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.__unsafeCreateTrustedScriptURL = __unsafeCreateTrustedScriptURL;\n/**\n * Stores the Trusted Types Policy. Starts as undefined and can be set to null\n * if Trusted Types is not supported in the browser.\n */ let policy;\n/**\n * Getter for the Trusted Types Policy. If it is undefined, it is instantiated\n * here or set to null if Trusted Types is not supported in the browser.\n */ function getPolicy() {\n if (typeof policy === 'undefined' && typeof window !== 'undefined') {\n var ref;\n policy = ((ref = window.trustedTypes) == null ? void 0 : ref.createPolicy('nextjs', {\n createHTML: (input)=>input,\n createScript: (input)=>input,\n createScriptURL: (input)=>input\n })) || null;\n }\n return policy;\n}\nfunction __unsafeCreateTrustedScriptURL(url) {\n var ref;\n return ((ref = getPolicy()) == null ? void 0 : ref.createScriptURL(url)) || url;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=trusted-types.js.map"],"names":["Object","defineProperty","exports","value","__unsafeCreateTrustedScriptURL","policy","getPolicy","ref","window","trustedTypes","createPolicy","createHTML","input","createScript","createScriptURL","url","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,8BAA8B,GAAGA;AACzC;;;CAGC,GAAG,IAAIC;AACR;;;CAGC,GAAG,SAASC,YAAY;IACrB,IAAI,OAAOD,WAAW,eAAe,gBAAkB,aAAa;QAChE,IAAIE;QACJF,SAAS,AAAC,CAAA,AAACE,CAAAA,MAAMC,OAAOC,YAAY,AAAD,KAAM,IAAI,GAAG,KAAK,IAAIF,IAAIG,YAAY,CAAC,UAAU;YAChFC,YAAY,CAACC,QAAQA;YACrBC,cAAc,CAACD,QAAQA;YACvBE,iBAAiB,CAACF,QAAQA;QAC9B,EAAE,AAAD,KAAM,IAAI;IACf,CAAC;IACD,OAAOP;AACX;AACA,SAASD,+BAA+BW,GAAG,EAAE;IACzC,IAAIR;IACJ,OAAO,AAAC,CAAA,AAACA,CAAAA,MAAMD,WAAU,KAAM,IAAI,GAAG,KAAK,IAAIC,IAAIO,eAAe,CAACC,IAAI,AAAD,KAAMA;AAChF;AAEA,IAAI,AAAC,CAAA,OAAOb,QAAQc,OAAO,KAAK,cAAe,OAAOd,QAAQc,OAAO,KAAK,YAAYd,QAAQc,OAAO,KAAK,IAAI,KAAM,OAAOd,QAAQc,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKjB,OAAOC,cAAc,CAACC,QAAQc,OAAO,EAAE,cAAc;QAAEb,OAAO,IAAI;IAAC;IACnEH,OAAOkB,MAAM,CAAChB,QAAQc,OAAO,EAAEd;IAC/BiB,OAAOjB,OAAO,GAAGA,QAAQc,OAAO;AAClC,CAAC,CAED,yCAAyC","file":"x"}`{<7B><><EFBFBD>  ~<7E><><EFBFBD>@<40><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <15><16><><EFBFBD><EFBFBD> <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><17>fabe9d3e2b2e4c92 <03>getPolicy<63>__unsafeCreateTrustedScriptURL<52>policy @ <00>=<3D><>kxBx<><78><EFBFBD><16><><EFBFBD><EFBFBD>A<><41><EFBFBD><16><><EFBFBD><EFBFBD><06>`  ` <16><><EFBFBD><EFBFBD>A/8 cF` aOa;N6<><36><EFBFBD>7<><37><EFBFBD> aQw@8<><38><EFBFBD><15> `GA<><00>5<><35><EFBFBD>6<><36><EFBFBD>c A%2<><32><EFBFBD>3<><33><EFBFBD>c5DA6E/<2F><><EFBFBD>0<><30><EFBFBD>cUdAZt,<2C><><EFBFBD>-<2D><><EFBFBD>(<28><><EFBFBD>by@<40>A<><00>)<29><><EFBFBD>*<2A><><EFBFBD>c)A<>&<26><><EFBFBD>'<27><><EFBFBD>c  !A #<23><><EFBFBD>c # *Ao<><6F><EFBFBD>c!!A!0<1D><><EFBFBD><1E><><EFBFBD>c!!$ <16><><EFBFBD><EFBFBD>p<><70><EFBFBD><16><><EFBFBD><EFBFBD>q<><71><EFBFBD>@r<><72><EFBFBD> t<><74><EFBFBD> F<><46><EFBFBD>w<><77><EFBFBD>  
<03>sources<65>runtimeRequirements<74>data<01>javascript<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/CachedSource d<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/OriginalSource/module.exports = require('./dist/client/link')
<EFBFBD>webpack://./node_modules/next/link.js`-<2D>module.exports = __webpack_require__(/*! ./dist/client/link */ "./node_modules/next/dist/client/link.js")/<2F><><EFBFBD><EFBFBD>source<63>size<7A>mapsE<><45><EFBFBD>jmodule.exports = __webpack_require__(/*! ./dist/client/link */ "./node_modules/next/dist/client/link.js")
<01>{"filename":"[file].map[query]","module":true,"columns":true,"noSources":false,"namespace":"kitabcitab"}<02>map<61>bufferedMap<16><><EFBFBD><EFBFBD>q<><71><EFBFBD><EFBFBD>mappings<15><>sourcesContent<6E>names<03>x AAAA,yGAA8C'<27><><EFBFBD>%<25><><EFBFBD>T<><54><EFBFBD><EFBFBD>__webpack_require__<15><15>(module.exports = require("next/router");<3B>external commonjs "next/router"M<><4D><EFBFBD><15><15> %<25><10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/SourceMapSource<10>~E"use strict";
"use client";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _interop_require_default = require("@swc/helpers/lib/_interop_require_default.js").default;
var _object_without_properties_loose = require("@swc/helpers/lib/_object_without_properties_loose.js").default;
var _react = _interop_require_default(require("react"));
var _router = require("../shared/lib/router/router");
var _formatUrl = require("../shared/lib/router/utils/format-url");
var _addLocale = require("./add-locale");
var _routerContext = require("../shared/lib/router-context");
var _appRouterContext = require("../shared/lib/app-router-context");
var _useIntersection = require("./use-intersection");
var _getDomainLocale = require("./get-domain-locale");
var _addBasePath = require("./add-base-path");
const prefetched = new Set();
function prefetch(router, href, as, options) {
if ("undefined" === "undefined") {
return;
}
if (!(0, _router).isLocalURL(href)) {
return;
}
// We should only dedupe requests when experimental.optimisticClientCache is
// disabled.
if (!options.bypassPrefetchedCheck) {
const locale = typeof options.locale !== "undefined" ? options.locale : "locale" in router ? router.locale : undefined;
const prefetchedKey = href + "%" + as + "%" + locale;
// If we've already fetched the key, then don't prefetch it again!
if (prefetched.has(prefetchedKey)) {
return;
}
// Mark this URL as prefetched.
prefetched.add(prefetchedKey);
}
// Prefetch the JSON page if asked (only in the client)
// We need to handle a prefetch error here since we may be
// loading with priority which can reject but we don't
// want to force navigation since this is only a prefetch
Promise.resolve(router.prefetch(href, as, options)).catch((err)=>{
if ("development" !== "production") {
// rethrow to show invalid URL errors
throw err;
}
});
}
function isModifiedEvent(event) {
const { target } = event.currentTarget;
return target && target !== "_self" || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.nativeEvent && event.nativeEvent.which === 2;
}
function linkClicked(e, router, href, as, replace, shallow, scroll, locale, isAppRouter, prefetchEnabled) {
const { nodeName } = e.currentTarget;
// anchors inside an svg have a lowercase nodeName
const isAnchorNodeName = nodeName.toUpperCase() === "A";
if (isAnchorNodeName && (isModifiedEvent(e) || !(0, _router).isLocalURL(href))) {
// ignore click for browsers default behavior
return;
}
e.preventDefault();
const navigate = ()=>{
// If the router is an NextRouter instance it will have `beforePopState`
if ("beforePopState" in router) {
router[replace ? "replace" : "push"](href, as, {
shallow,
locale,
scroll
});
} else {
router[replace ? "replace" : "push"](as || href, {
forceOptimisticNavigation: !prefetchEnabled
});
}
};
if (isAppRouter) {
// @ts-expect-error startTransition exists.
_react.default.startTransition(navigate);
} else {
navigate();
}
}
function formatStringOrUrl(urlObjOrString) {
if (typeof urlObjOrString === "string") {
return urlObjOrString;
}
return (0, _formatUrl).formatUrl(urlObjOrString);
}
/**
* React Component that enables client-side transitions between routes.
*/ const Link = /*#__PURE__*/ _react.default.forwardRef(function LinkComponent(props, forwardedRef) {
if ("development" !== "production") {
function createPropError(args) {
return new Error(`Failed prop type: The prop \`${args.key}\` expects a ${args.expected} in \`<Link>\`, but got \`${args.actual}\` instead.` + ("undefined" !== "undefined" ? "\nOpen your browser's console to view the Component stack trace." : ""));
}
// TypeScript trick for type-guarding:
const requiredPropsGuard = {
href: true
};
const requiredProps = Object.keys(requiredPropsGuard);
requiredProps.forEach((key)=>{
if (key === "href") {
if (props[key] == null || typeof props[key] !== "string" && typeof props[key] !== "object") {
throw createPropError({
key,
expected: "`string` or `object`",
actual: props[key] === null ? "null" : typeof props[key]
});
}
} else {
// TypeScript trick for type-guarding:
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _ = key;
}
});
// TypeScript trick for type-guarding:
const optionalPropsGuard = {
as: true,
replace: true,
scroll: true,
shallow: true,
passHref: true,
prefetch: true,
locale: true,
onClick: true,
onMouseEnter: true,
onTouchStart: true,
legacyBehavior: true
};
const optionalProps = Object.keys(optionalPropsGuard);
optionalProps.forEach((key)=>{
const valType = typeof props[key];
if (key === "as") {
if (props[key] && valType !== "string" && valType !== "object") {
throw createPropError({
key,
expected: "`string` or `object`",
actual: valType
});
}
} else if (key === "locale") {
if (props[key] && valType !== "string") {
throw createPropError({
key,
expected: "`string`",
actual: valType
});
}
} else if (key === "onClick" || key === "onMouseEnter" || key === "onTouchStart") {
if (props[key] && valType !== "function") {
throw createPropError({
key,
expected: "`function`",
actual: valType
});
}
} else if (key === "replace" || key === "scroll" || key === "shallow" || key === "passHref" || key === "prefetch" || key === "legacyBehavior") {
if (props[key] != null && valType !== "boolean") {
throw createPropError({
key,
expected: "`boolean`",
actual: valType
});
}
} else {
// TypeScript trick for type-guarding:
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _ = key;
}
});
// This hook is in a conditional but that is ok because `process.env.NODE_ENV` never changes
// eslint-disable-next-line react-hooks/rules-of-hooks
const hasWarned = _react.default.useRef(false);
if (props.prefetch && !hasWarned.current) {
hasWarned.current = true;
console.warn("Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://nextjs.org/docs/messages/prefetch-true-deprecated");
}
}
let children;
const { href: hrefProp , as: asProp , children: childrenProp , prefetch: prefetchProp , passHref , replace , shallow , scroll , locale , onClick , onMouseEnter: onMouseEnterProp , onTouchStart: onTouchStartProp , legacyBehavior =process.env.__NEXT_NEW_LINK_BEHAVIOR === false } = props, restProps = _object_without_properties_loose(props, [
"href",
"as",
"children",
"prefetch",
"passHref",
"replace",
"shallow",
"scroll",
"locale",
"onClick",
"onMouseEnter",
"onTouchStart",
"legacyBehavior"
]);
children = childrenProp;
if (legacyBehavior && (typeof children === "string" || typeof children === "number")) {
children = /*#__PURE__*/ _react.default.createElement("a", null, children);
}
const prefetchEnabled = prefetchProp !== false;
const pagesRouter = _react.default.useContext(_routerContext.RouterContext);
const appRouter = _react.default.useContext(_appRouterContext.AppRouterContext);
const router = pagesRouter != null ? pagesRouter : appRouter;
// We're in the app directory if there is no pages router.
const isAppRouter = !pagesRouter;
if ("development" !== "production") {
if (isAppRouter && !asProp) {
let href;
if (typeof hrefProp === "string") {
href = hrefProp;
} else if (typeof hrefProp === "object" && typeof hrefProp.pathname === "string") {
href = hrefProp.pathname;
}
if (href) {
const hasDynamicSegment = href.split("/").some((segment)=>segment.startsWith("[") && segment.endsWith("]"));
if (hasDynamicSegment) {
throw new Error(`Dynamic href \`${href}\` found in <Link> while using the \`/app\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`);
}
}
}
}
const { href: href1 , as } = _react.default.useMemo(()=>{
if (!pagesRouter) {
const resolvedHref = formatStringOrUrl(hrefProp);
return {
href: resolvedHref,
as: asProp ? formatStringOrUrl(asProp) : resolvedHref
};
}
const [resolvedHref1, resolvedAs] = (0, _router).resolveHref(pagesRouter, hrefProp, true);
return {
href: resolvedHref1,
as: asProp ? (0, _router).resolveHref(pagesRouter, asProp) : resolvedAs || resolvedHref1
};
}, [
pagesRouter,
hrefProp,
asProp
]);
const previousHref = _react.default.useRef(href1);
const previousAs = _react.default.useRef(as);
// This will return the first child, if multiple are provided it will throw an error
let child;
if (legacyBehavior) {
if ("development" === "development") {
if (onClick) {
console.warn(`"onClick" was passed to <Link> with \`href\` of \`${hrefProp}\` but "legacyBehavior" was set. The legacy behavior requires onClick be set on the child of next/link`);
}
if (onMouseEnterProp) {
console.warn(`"onMouseEnter" was passed to <Link> with \`href\` of \`${hrefProp}\` but "legacyBehavior" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`);
}
try {
child = _react.default.Children.only(children);
} catch (err) {
if (!children) {
throw new Error(`No children were passed to <Link> with \`href\` of \`${hrefProp}\` but one child is required https://nextjs.org/docs/messages/link-no-children`);
}
throw new Error(`Multiple children were passed to <Link> with \`href\` of \`${hrefProp}\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` + ("undefined" !== "undefined" ? " \nOpen your browser's console to view the Component stack trace." : ""));
}
} else {
child = _react.default.Children.only(children);
}
} else {
if ("development" === "development") {
var ref;
if (((ref = children) == null ? void 0 : ref.type) === "a") {
throw new Error("Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor");
}
}
}
const childRef = legacyBehavior ? child && typeof child === "object" && child.ref : forwardedRef;
const [setIntersectionRef, isVisible, resetVisible] = (0, _useIntersection).useIntersection({
rootMargin: "200px"
});
const setRef = _react.default.useCallback((el)=>{
// Before the link getting observed, check if visible state need to be reset
if (previousAs.current !== as || previousHref.current !== href1) {
resetVisible();
previousAs.current = as;
previousHref.current = href1;
}
setIntersectionRef(el);
if (childRef) {
if (typeof childRef === "function") childRef(el);
else if (typeof childRef === "object") {
childRef.current = el;
}
}
}, [
as,
childRef,
href1,
resetVisible,
setIntersectionRef
]);
// Prefetch the URL if we haven't already and it's visible.
_react.default.useEffect(()=>{
// in dev, we only prefetch on hover to avoid wasting resources as the prefetch will trigger compiling the page.
if ("development" !== "production") {
return;
}
if (!router) {
return;
}
// If we don't need to prefetch the URL, don't do prefetch.
if (!isVisible || !prefetchEnabled) {
return;
}
// Prefetch the URL.
prefetch(router, href1, as, {
locale
});
}, [
as,
href1,
isVisible,
locale,
prefetchEnabled,
pagesRouter == null ? void 0 : pagesRouter.locale,
router
]);
const childProps = {
ref: setRef,
onClick (e) {
if ("development" !== "production") {
if (!e) {
throw new Error(`Component rendered inside next/link has to pass click event to "onClick" prop.`);
}
}
if (!legacyBehavior && typeof onClick === "function") {
onClick(e);
}
if (legacyBehavior && child.props && typeof child.props.onClick === "function") {
child.props.onClick(e);
}
if (!router) {
return;
}
if (e.defaultPrevented) {
return;
}
linkClicked(e, router, href1, as, replace, shallow, scroll, locale, isAppRouter, prefetchEnabled);
},
onMouseEnter (e) {
if (!legacyBehavior && typeof onMouseEnterProp === "function") {
onMouseEnterProp(e);
}
if (legacyBehavior && child.props && typeof child.props.onMouseEnter === "function") {
child.props.onMouseEnter(e);
}
if (!router) {
return;
}
if (!prefetchEnabled && isAppRouter) {
return;
}
prefetch(router, href1, as, {
locale,
priority: true,
// @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}
bypassPrefetchedCheck: true
});
},
onTouchStart (e) {
if (!legacyBehavior && typeof onTouchStartProp === "function") {
onTouchStartProp(e);
}
if (legacyBehavior && child.props && typeof child.props.onTouchStart === "function") {
child.props.onTouchStart(e);
}
if (!router) {
return;
}
if (!prefetchEnabled && isAppRouter) {
return;
}
prefetch(router, href1, as, {
locale,
priority: true,
// @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}
bypassPrefetchedCheck: true
});
}
};
// If child is an <a> 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 (!legacyBehavior || passHref || child.type === "a" && !("href" in child.props)) {
const curLocale = typeof locale !== "undefined" ? locale : pagesRouter == null ? void 0 : pagesRouter.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
const localeDomain = (pagesRouter == null ? void 0 : pagesRouter.isLocaleDomain) && (0, _getDomainLocale).getDomainLocale(as, curLocale, pagesRouter == null ? void 0 : pagesRouter.locales, pagesRouter == null ? void 0 : pagesRouter.domainLocales);
childProps.href = localeDomain || (0, _addBasePath).addBasePath((0, _addLocale).addLocale(as, curLocale, pagesRouter == null ? void 0 : pagesRouter.defaultLocale));
}
return legacyBehavior ? /*#__PURE__*/ _react.default.cloneElement(child, childProps) : /*#__PURE__*/ _react.default.createElement("a", Object.assign({}, restProps, childProps), children);
});
var _default = Link;
exports.default = _default;
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=link.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/link.js<1F>x{"version":3,"sources":["webpack://./node_modules/next/dist/client/link.js"],"sourcesContent":["\"use client\";\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _interop_require_default = require(\"@swc/helpers/lib/_interop_require_default.js\").default;\nvar _object_without_properties_loose = require(\"@swc/helpers/lib/_object_without_properties_loose.js\").default;\nvar _react = _interop_require_default(require(\"react\"));\nvar _router = require(\"../shared/lib/router/router\");\nvar _formatUrl = require(\"../shared/lib/router/utils/format-url\");\nvar _addLocale = require(\"./add-locale\");\nvar _routerContext = require(\"../shared/lib/router-context\");\nvar _appRouterContext = require(\"../shared/lib/app-router-context\");\nvar _useIntersection = require(\"./use-intersection\");\nvar _getDomainLocale = require(\"./get-domain-locale\");\nvar _addBasePath = require(\"./add-base-path\");\n\nconst prefetched = new Set();\nfunction prefetch(router, href, as, options) {\n if (typeof window === 'undefined') {\n return;\n }\n if (!(0, _router).isLocalURL(href)) {\n return;\n }\n // We should only dedupe requests when experimental.optimisticClientCache is\n // disabled.\n if (!options.bypassPrefetchedCheck) {\n const locale = // Let the link's locale prop override the default router locale.\n typeof options.locale !== 'undefined' ? options.locale : 'locale' in router ? router.locale : undefined;\n const prefetchedKey = href + '%' + as + '%' + locale;\n // If we've already fetched the key, then don't prefetch it again!\n if (prefetched.has(prefetchedKey)) {\n return;\n }\n // Mark this URL as prefetched.\n prefetched.add(prefetchedKey);\n }\n // Prefetch the JSON page if asked (only in the client)\n // We need to handle a prefetch error here since we may be\n // loading with priority which can reject but we don't\n // want to force navigation since this is only a prefetch\n Promise.resolve(router.prefetch(href, as, options)).catch((err)=>{\n if (process.env.NODE_ENV !== 'production') {\n // rethrow to show invalid URL errors\n throw err;\n }\n });\n}\nfunction isModifiedEvent(event) {\n const { target } = event.currentTarget;\n return target && target !== '_self' || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.nativeEvent && event.nativeEvent.which === 2;\n}\nfunction linkClicked(e, router, href, as, replace, shallow, scroll, locale, isAppRouter, prefetchEnabled) {\n const { nodeName } = e.currentTarget;\n // anchors inside an svg have a lowercase nodeName\n const isAnchorNodeName = nodeName.toUpperCase() === 'A';\n if (isAnchorNodeName && (isModifiedEvent(e) || !(0, _router).isLocalURL(href))) {\n // ignore click for browsers default behavior\n return;\n }\n e.preventDefault();\n const navigate = ()=>{\n // If the router is an NextRouter instance it will have `beforePopState`\n if ('beforePopState' in router) {\n router[replace ? 'replace' : 'push'](href, as, {\n shallow,\n locale,\n scroll\n });\n } else {\n router[replace ? 'replace' : 'push'](as || href, {\n forceOptimisticNavigation: !prefetchEnabled\n });\n }\n };\n if (isAppRouter) {\n // @ts-expect-error startTransition exists.\n _react.default.startTransition(navigate);\n } else {\n navigate();\n }\n}\nfunction formatStringOrUrl(urlObjOrString) {\n if (typeof urlObjOrString === 'string') {\n return urlObjOrString;\n }\n return (0, _formatUrl).formatUrl(urlObjOrString);\n}\n/**\n * React Component that enables client-side transition
4'4w6<00>6<00>C<00>C<00><18>Object.defineProperty(exports, "__esModule", (<18>))<18>exports["default"]<1E>(__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ "./node_modules/@swc/helpers/lib/_interop_require_default.js")["default"])<1E>(__webpack_require__(/*! @swc/helpers/lib/_object_without_properties_loose.js */ "./node_modules/@swc/helpers/lib/_object_without_properties_loose.js")["default"])<18>__webpack_require__<18>/*! react */ "react"<15><18>/*! ../shared/lib/router/router */ "./node_modules/next/dist/shared/lib/router/router.js"<15><18>/*! ../shared/lib/router/utils/format-url */ "../shared/lib/router/utils/format-url"<15><18>/*! ./add-locale */ "./node_modules/next/dist/client/add-locale.js"<15><18>/*! ../shared/lib/router-context */ "../shared/lib/router-context"<15><18>/*! ../shared/lib/app-router-context */ "../shared/lib/app-router-context"<15><18>/*! ./use-intersection */ "./node_modules/next/dist/client/use-intersection.js"<15><18>/*! ./get-domain-locale */ "./node_modules/next/dist/client/get-domain-locale.js"<15><18>/*! ./add-base-path */ "./node_modules/next/dist/client/add-base-path.js"<18>true<15><15><18> false<18>0<15><15><15><15><18>0<18>{}<15><15><15><15><15>ZF
"use client";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ "./node_modules/@swc/helpers/lib/_interop_require_default.js")["default"]);
var _object_without_properties_loose = (__webpack_require__(/*! @swc/helpers/lib/_object_without_properties_loose.js */ "./node_modules/@swc/helpers/lib/_object_without_properties_loose.js")["default"]);
var _react = _interop_require_default(__webpack_require__(/*! react */ "react"));
var _router = __webpack_require__(/*! ../shared/lib/router/router */ "./node_modules/next/dist/shared/lib/router/router.js");
var _formatUrl = __webpack_require__(/*! ../shared/lib/router/utils/format-url */ "../shared/lib/router/utils/format-url");
var _addLocale = __webpack_require__(/*! ./add-locale */ "./node_modules/next/dist/client/add-locale.js");
var _routerContext = __webpack_require__(/*! ../shared/lib/router-context */ "../shared/lib/router-context");
var _appRouterContext = __webpack_require__(/*! ../shared/lib/app-router-context */ "../shared/lib/app-router-context");
var _useIntersection = __webpack_require__(/*! ./use-intersection */ "./node_modules/next/dist/client/use-intersection.js");
var _getDomainLocale = __webpack_require__(/*! ./get-domain-locale */ "./node_modules/next/dist/client/get-domain-locale.js");
var _addBasePath = __webpack_require__(/*! ./add-base-path */ "./node_modules/next/dist/client/add-base-path.js");
const prefetched = new Set();
function prefetch(router, href, as, options) {
if (true) {
return;
}
if (!(0, _router).isLocalURL(href)) {
return;
}
// We should only dedupe requests when experimental.optimisticClientCache is
// disabled.
if (!options.bypassPrefetchedCheck) {
const locale = typeof options.locale !== "undefined" ? options.locale : "locale" in router ? router.locale : undefined;
const prefetchedKey = href + "%" + as + "%" + locale;
// If we've already fetched the key, then don't prefetch it again!
if (prefetched.has(prefetchedKey)) {
return;
}
// Mark this URL as prefetched.
prefetched.add(prefetchedKey);
}
// Prefetch the JSON page if asked (only in the client)
// We need to handle a prefetch error here since we may be
// loading with priority which can reject but we don't
// want to force navigation since this is only a prefetch
Promise.resolve(router.prefetch(href, as, options)).catch((err)=>{
if (true) {
// rethrow to show invalid URL errors
throw err;
}
});
}
function isModifiedEvent(event) {
const { target } = event.currentTarget;
return target && target !== "_self" || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.nativeEvent && event.nativeEvent.which === 2;
}
function linkClicked(e, router, href, as, replace, shallow, scroll, locale, isAppRouter, prefetchEnabled) {
const { nodeName } = e.currentTarget;
// anchors inside an svg have a lowercase nodeName
const isAnchorNodeName = nodeName.toUpperCase() === "A";
if (isAnchorNodeName && (isModifiedEvent(e) || !(0, _router).isLocalURL(href))) {
// ignore click for browsers default behavior
return;
}
e.preventDefault();
const navigate = ()=>{
// If the router is an NextRouter instance it will have `beforePopState`
if ("beforePopState" in router) {
router[replace ? "replace" : "push"](href, as, {
shallow,
locale,
scroll
});
} else {
router[replace ? "replace" : "push"](as || href, {
forceOptimisticNavigation: !prefetchEnabled
});
}
};
if (isAppRouter) {
// @ts-expect-error startTransition exists.
_react.default.startTransition(navigate);
} else {
navigate();
}
}
function formatStringOrUrl(urlObjOrString) {
if (typeof urlObjOrString === "string") {
return urlObjOrString;
}
return (0, _formatUrl).formatUrl(urlObjOrString);
}
/**
* React Component that enables client-side transitions between routes.
*/ const Link = /*#__PURE__*/ _react.default.forwardRef(function LinkComponent(props, forwardedRef) {
if (true) {
function createPropError(args) {
return new Error(`Failed prop type: The prop \`${args.key}\` expects a ${args.expected} in \`<Link>\`, but got \`${args.actual}\` instead.` + ( false ? 0 : ""));
}
// TypeScript trick for type-guarding:
const requiredPropsGuard = {
href: true
};
const requiredProps = Object.keys(requiredPropsGuard);
requiredProps.forEach((key)=>{
if (key === "href") {
if (props[key] == null || typeof props[key] !== "string" && typeof props[key] !== "object") {
throw createPropError({
key,
expected: "`string` or `object`",
actual: props[key] === null ? "null" : typeof props[key]
});
}
} else {
// TypeScript trick for type-guarding:
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _ = key;
}
});
// TypeScript trick for type-guarding:
const optionalPropsGuard = {
as: true,
replace: true,
scroll: true,
shallow: true,
passHref: true,
prefetch: true,
locale: true,
onClick: true,
onMouseEnter: true,
onTouchStart: true,
legacyBehavior: true
};
const optionalProps = Object.keys(optionalPropsGuard);
optionalProps.forEach((key)=>{
const valType = typeof props[key];
if (key === "as") {
if (props[key] && valType !== "string" && valType !== "object") {
throw createPropError({
key,
expected: "`string` or `object`",
actual: valType
});
}
} else if (key === "locale") {
if (props[key] && valType !== "string") {
throw createPropError({
key,
expected: "`string`",
actual: valType
});
}
} else if (key === "onClick" || key === "onMouseEnter" || key === "onTouchStart") {
if (props[key] && valType !== "function") {
throw createPropError({
key,
expected: "`function`",
actual: valType
});
}
} else if (key === "replace" || key === "scroll" || key === "shallow" || key === "passHref" || key === "prefetch" || key === "legacyBehavior") {
if (props[key] != null && valType !== "boolean") {
throw createPropError({
key,
expected: "`boolean`",
actual: valType
});
}
} else {
// TypeScript trick for type-guarding:
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _ = key;
}
});
// This hook is in a conditional but that is ok because `process.env.NODE_ENV` never changes
// eslint-disable-next-line react-hooks/rules-of-hooks
const hasWarned = _react.default.useRef(false);
if (props.prefetch && !hasWarned.current) {
hasWarned.current = true;
console.warn("Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://nextjs.org/docs/messages/prefetch-true-deprecated");
}
}
let children;
const { href: hrefProp , as: asProp , children: childrenProp , prefetch: prefetchProp , passHref , replace , shallow , scroll , locale , onClick , onMouseEnter: onMouseEnterProp , onTouchStart: onTouchStartProp , legacyBehavior =true === false } = props, restProps = _object_without_properties_loose(props, [
"href",
"as",
"children",
"prefetch",
"passHref",
"replace",
"shallow",
"scroll",
"locale",
"onClick",
"onMouseEnter",
"onTouchStart",
"legacyBehavior"
]);
children = childrenProp;
if (legacyBehavior && (typeof children === "string" || typeof children === "number")) {
children = /*#__PURE__*/ _react.default.createElement("a", null, children);
}
const prefetchEnabled = prefetchProp !== false;
const pagesRouter = _react.default.useContext(_routerContext.RouterContext);
const appRouter = _react.default.useContext(_appRouterContext.AppRouterContext);
const router = pagesRouter != null ? pagesRouter : appRouter;
// We're in the app directory if there is no pages router.
const isAppRouter = !pagesRouter;
if (true) {
if (isAppRouter && !asProp) {
let href;
if (typeof hrefProp === "string") {
href = hrefProp;
} else if (typeof hrefProp === "object" && typeof hrefProp.pathname === "string") {
href = hrefProp.pathname;
}
if (href) {
const hasDynamicSegment = href.split("/").some((segment)=>segment.startsWith("[") && segment.endsWith("]"));
if (hasDynamicSegment) {
throw new Error(`Dynamic href \`${href}\` found in <Link> while using the \`/app\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`);
}
}
}
}
const { href: href1 , as } = _react.default.useMemo(()=>{
if (!pagesRouter) {
const resolvedHref = formatStringOrUrl(hrefProp);
return {
href: resolvedHref,
as: asProp ? formatStringOrUrl(asProp) : resolvedHref
};
}
const [resolvedHref1, resolvedAs] = (0, _router).resolveHref(pagesRouter, hrefProp, true);
return {
href: resolvedHref1,
as: asProp ? (0, _router).resolveHref(pagesRouter, asProp) : resolvedAs || resolvedHref1
};
}, [
pagesRouter,
hrefProp,
asProp
]);
const previousHref = _react.default.useRef(href1);
const previousAs = _react.default.useRef(as);
// This will return the first child, if multiple are provided it will throw an error
let child;
if (legacyBehavior) {
if (true) {
if (onClick) {
console.warn(`"onClick" was passed to <Link> with \`href\` of \`${hrefProp}\` but "legacyBehavior" was set. The legacy behavior requires onClick be set on the child of next/link`);
}
if (onMouseEnterProp) {
console.warn(`"onMouseEnter" was passed to <Link> with \`href\` of \`${hrefProp}\` but "legacyBehavior" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`);
}
try {
child = _react.default.Children.only(children);
} catch (err) {
if (!children) {
throw new Error(`No children were passed to <Link> with \`href\` of \`${hrefProp}\` but one child is required https://nextjs.org/docs/messages/link-no-children`);
}
throw new Error(`Multiple children were passed to <Link> with \`href\` of \`${hrefProp}\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` + ( false ? 0 : ""));
}
} else {}
} else {
if (true) {
var ref;
if (((ref = children) == null ? void 0 : ref.type) === "a") {
throw new Error("Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor");
}
}
}
const childRef = legacyBehavior ? child && typeof child === "object" && child.ref : forwardedRef;
const [setIntersectionRef, isVisible, resetVisible] = (0, _useIntersection).useIntersection({
rootMargin: "200px"
});
const setRef = _react.default.useCallback((el)=>{
// Before the link getting observed, check if visible state need to be reset
if (previousAs.current !== as || previousHref.current !== href1) {
resetVisible();
previousAs.current = as;
previousHref.current = href1;
}
setIntersectionRef(el);
if (childRef) {
if (typeof childRef === "function") childRef(el);
else if (typeof childRef === "object") {
childRef.current = el;
}
}
}, [
as,
childRef,
href1,
resetVisible,
setIntersectionRef
]);
// Prefetch the URL if we haven't already and it's visible.
_react.default.useEffect(()=>{
// in dev, we only prefetch on hover to avoid wasting resources as the prefetch will trigger compiling the page.
if (true) {
return;
}
if (!router) {
return;
}
// If we don't need to prefetch the URL, don't do prefetch.
if (!isVisible || !prefetchEnabled) {
return;
}
// Prefetch the URL.
prefetch(router, href1, as, {
locale
});
}, [
as,
href1,
isVisible,
locale,
prefetchEnabled,
pagesRouter == null ? void 0 : pagesRouter.locale,
router
]);
const childProps = {
ref: setRef,
onClick (e) {
if (true) {
if (!e) {
throw new Error(`Component rendered inside next/link has to pass click event to "onClick" prop.`);
}
}
if (!legacyBehavior && typeof onClick === "function") {
onClick(e);
}
if (legacyBehavior && child.props && typeof child.props.onClick === "function") {
child.props.onClick(e);
}
if (!router) {
return;
}
if (e.defaultPrevented) {
return;
}
linkClicked(e, router, href1, as, replace, shallow, scroll, locale, isAppRouter, prefetchEnabled);
},
onMouseEnter (e) {
if (!legacyBehavior && typeof onMouseEnterProp === "function") {
onMouseEnterProp(e);
}
if (legacyBehavior && child.props && typeof child.props.onMouseEnter === "function") {
child.props.onMouseEnter(e);
}
if (!router) {
return;
}
if (!prefetchEnabled && isAppRouter) {
return;
}
prefetch(router, href1, as, {
locale,
priority: true,
// @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}
bypassPrefetchedCheck: true
});
},
onTouchStart (e) {
if (!legacyBehavior && typeof onTouchStartProp === "function") {
onTouchStartProp(e);
}
if (legacyBehavior && child.props && typeof child.props.onTouchStart === "function") {
child.props.onTouchStart(e);
}
if (!router) {
return;
}
if (!prefetchEnabled && isAppRouter) {
return;
}
prefetch(router, href1, as, {
locale,
priority: true,
// @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}
bypassPrefetchedCheck: true
});
}
};
// If child is an <a> 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 (!legacyBehavior || passHref || child.type === "a" && !("href" in child.props)) {
const curLocale = typeof locale !== "undefined" ? locale : pagesRouter == null ? void 0 : pagesRouter.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
const localeDomain = (pagesRouter == null ? void 0 : pagesRouter.isLocaleDomain) && (0, _getDomainLocale).getDomainLocale(as, curLocale, pagesRouter == null ? void 0 : pagesRouter.locales, pagesRouter == null ? void 0 : pagesRouter.domainLocales);
childProps.href = localeDomain || (0, _addBasePath).addBasePath((0, _addLocale).addLocale(as, curLocale, pagesRouter == null ? void 0 : pagesRouter.defaultLocale));
}
return legacyBehavior ? /*#__PURE__*/ _react.default.cloneElement(child, childProps) : /*#__PURE__*/ _react.default.createElement("a", Object.assign({}, restProps, childProps), children);
});
var _default = Link;
exports["default"] = _default;
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=link.js.map
<15><15><15><03>x<1F>'AACa;AADb;AAEAA,8CAA6C;IACzCG,OAAO,IAAI;AACf,CAAC,EAAC;AACFD,kBAAe,GAAG,KAAK;AACvB,IAAIG,2BAA2BC,mJAA+D;AAC9F,IAAIC,mCAAmCD,mKAAuE;AAC9G,IAAIE,SAASH,yBAAyBC,mBAAOA,CAAC,oBAAO;AACrD,IAAIG,UAAUH,mBAAOA,CAAC,yFAA6B;AACnD,IAAII,aAAaJ,mBAAOA,CAAC,oFAAuC;AAChE,IAAIK,aAAaL,mBAAOA,CAAC,mEAAc;AACvC,IAAIM,iBAAiBN,mBAAOA,CAAC,kEAA8B;AAC3D,IAAIO,oBAAoBP,mBAAOA,CAAC,0EAAkC;AAClE,IAAIQ,mBAAmBR,mBAAOA,CAAC,+EAAoB;AACnD,IAAIS,mBAAmBT,mBAAOA,CAAC,iFAAqB;AACpD,IAAIU,eAAeV,mBAAOA,CAAC,yEAAiB;AAE5C,MAAMW,aAAa,IAAIC;AACvB,SAASC,SAASC,MAAM,EAAEC,IAAI,EAAEC,EAAE,EAAEC,OAAO,EAAE;IACzC,IAAI,IAAkB,EAAa;QAC/B;IACJ,CAAC;IACD,IAAI,CAAC,CAAC,GAAGd,OAAO,EAAEe,UAAU,CAACH,OAAO;QAChC;IACJ,CAAC;IACD,4EAA4E;IAC5E,YAAY;IACZ,IAAI,CAACE,QAAQE,qBAAqB,EAAE;QAChC,MAAMC,SACN,OAAOH,QAAQG,MAAM,KAAK,cAAcH,QAAQG,MAAM,GAAG,YAAYN,SAASA,OAAOM,MAAM,GAAGC,SAAS;QACvG,MAAMC,gBAAgBP,OAAO,MAAMC,KAAK,MAAMI;QAC9C,kEAAkE;QAClE,IAAIT,WAAWY,GAAG,CAACD,gBAAgB;YAC/B;QACJ,CAAC;QACD,+BAA+B;QAC/BX,WAAWa,GAAG,CAACF;IACnB,CAAC;IACD,uDAAuD;IACvD,0DAA0D;IAC1D,sDAAsD;IACtD,yDAAyD;IACzDG,QAAQC,OAAO,CAACZ,OAAOD,QAAQ,CAACE,MAAMC,IAAIC,UAAUU,KAAK,CAAC,CAACC,MAAM;QAC7D,IAAIC,IAAyB,EAAc;YACvC,qCAAqC;YACrC,MAAMD,IAAI;QACd,CAAC;IACL;AACJ;AACA,SAASE,gBAAgBC,KAAK,EAAE;IAC5B,MAAM,EAAEC,OAAM,EAAG,GAAGD,MAAME,aAAa;IACvC,OAAOD,UAAUA,WAAW,WAAWD,MAAMG,OAAO,IAAIH,MAAMI,OAAO,IAAIJ,MAAMK,QAAQ,IAAIL,MAAMM,MAAM,IAAIN,MAAMO,WAAW,IAAIP,MAAMO,WAAW,CAACC,KAAK,KAAK;AAChK;AACA,SAASC,YAAYC,CAAC,EAAE3B,MAAM,EAAEC,IAAI,EAAEC,EAAE,EAAE0B,OAAO,EAAEC,OAAO,EAAEC,MAAM,EAAExB,MAAM,EAAEyB,WAAW,EAAEC,eAAe,EAAE;IACtG,MAAM,EAAEC,SAAQ,EAAG,GAAGN,EAAER,aAAa;IACrC,kDAAkD;IAClD,MAAMe,mBAAmBD,SAASE,WAAW,OAAO;IACpD,IAAID,oBAAqBlB,CAAAA,gBAAgBW,MAAM,CAAC,CAAC,GAAGtC,OAAO,EAAEe,UAAU,CAACH,KAAI,GAAI;QAC5E,8CAA8C;QAC9C;IACJ,CAAC;IACD0B,EAAES,cAAc;IAChB,MAAMC,WAAW,IAAI;QACjB,wEAAwE;QACxE,IAAI,oBAAoBrC,QAAQ;YAC5BA,MAAM,CAAC4B,UAAU,YAAY,MAAM,CAAC,CAAC3B,MAAMC,IAAI;gBAC3C2B;gBACAvB;gBACAwB;YACJ;QACJ,OAAO;YACH9B,MAAM,CAAC4B,UAAU,YAAY,MAAM,CAAC,CAAC1B,MAAMD,MAAM;gBAC7CqC,2BAA2B,CAACN;YAChC;QACJ,CAAC;IACL;IACA,IAAID,aAAa;QACb,2CAA2C;QAC3C3C,OAAOJ,OAAO,CAACuD,eAAe,CAACF;IACnC,OAAO;QACHA;IACJ,CAAC;AACL;AACA,SAASG,kBAAkBC,cAAc,EAAE;IACvC,IAAI,OAAOA,mBAAmB,UAAU;QACpC,OAAOA;IACX,CAAC;IACD,OAAO,CAAC,GAAGnD,UAAU,EAAEoD,SAAS,CAACD;AACrC;AACA;;CAEC,GAAG,MAAME,OAAO,WAAW,GAAGvD,OAAOJ,OAAO,CAAC4D,UAAU,CAAC,SAASC,cAAcC,KAAK,EAAEC,YAAY,EAAE;IACjG,IAAIhC,IAAyB,EAAc;QACvC,SAASiC,gBAAgBC,IAAI,EAAE;YAC3B,OAAO,IAAIC,MAAM,CAAC,6BAA6B,EAAED,KAAKE,GAAG,CAAC,aAAa,EAAEF,KAAKG,QAAQ,CAAC,0BAA0B,EAAEH,KAAKI,MAAM,CAAC,WAAW,CAAC,GAAI,OAAkB,GAAc,CAAkE,GAAG,EAAE;QAC1P;QACA,sCAAsC;QACtC,MAAMC,qBAAqB;YACvBrD,MAAM,IAAI;QACd;QACA,MAAMsD,gBAAgB3E,OAAO4E,IAAI,CAACF;QAClCC,cAAcE,OAAO,CAAC,CAACN,MAAM;YACzB,IAAIA,QAAQ,QAAQ;gBAChB,IAAIL,KAAK,CAACK,IAAI,IAAI,IAAI,IAAI,OAAOL,KAAK,CAACK,IAAI,KAAK,YAAY,OAAOL,KAAK,CAACK,IAAI,KAAK,UAAU;oBACxF,MAAMH,gBAAgB;wBAClBG;wBACAC,UAAU;wBACVC,QAAQP,KAAK,CAACK,IAAI,KAAK,IAAI,GAAG,SAAS,OAAOL,KAAK,CAACK,IAAI;oBAC5D,GAAG;gBACP,CAAC;YACL,OAAO;gBACH,sCAAsC;gBACtC,6DAA6D;gBAC7D,MAAMO,IAAIP;YACd,CAAC;QACL;QACA,sCAAsC;QACtC,MAAMQ,qBAAqB;YACvBzD,IAAI,IAAI;YACR0B,SAAS,IAAI;YACbE,QAAQ,IAAI;YACZD,SAAS,IAAI;YACb+B,UAAU,IAAI;YACd7D,UAAU,IAAI;YACdO,QAAQ,IAAI;YACZuD,SAAS,IAAI;YACbC,cAAc,IAAI;YAClBC,cAAc,IAAI;YAClBC,gBAAgB,IAAI;QACxB;QACA,MAAMC,gBAAgBrF,OAAO4E,IAAI,CAACG;QAClCM,cAAcR,OAAO,CAAC,CAACN,MAAM;YACzB,MAAMe,UAAU,OAAOpB,KAAK,CAACK,IAAI;YACjC,IAAIA,QAAQ,MAAM;gBACd,IAAIL,KAAK,CAACK,IAAI,IAAIe,YAAY,YAAYA,YAAY,UAAU;oBAC5D,MAAMlB,gBAAgB;wBAClBG;wBACAC,UAAU;wBACVC,QAAQa;oBACZ,GAAG;gBACP,CAAC;YACL,OAAO,IAAIf,QAAQ,UAAU;gBACzB,IAAIL,KAAK,CAACK,IAAI,IAAIe,YAAY,UAAU;oBACpC,MAAMlB,gBAAgB;wBAClBG;wBACAC,UAAU;wBACVC,QAAQa;oBACZ,GAAG;gBACP,CAAC;YACL,OAAO,IAAIf,QAAQ,aAAaA,QAAQ,kBAAkBA,QAAQ,gBAAgB;gBAC9E,IAAIL,KAAK,CAACK,IAAI,IAAIe,YAAY,YAAY;oBACtC,MAAMlB,gBAAgB;wBAClBG;wBACAC,UAAU;wBACVC,QAAQa;oBACZ,GAAG;gBACP,CAAC;YACL,OAAO,IAAIf,QAAQ,aAAaA,QAAQ,YAAYA,QAAQ,aAAaA,QAAQ,cAAcA,QAAQ,cAAcA,QAAQ,kBAAkB;gBAC3I,IAAIL,KAAK,CAACK,IAAI,IAAI,IAAI,IAAIe,YAAY,WAAW;oBAC7C,MAAMlB,gBAAgB;wBAClBG;wBACAC,UAAU;wBACVC,QAAQa;oBACZ,GAAG;gBACP,CAAC;YACL,OAAO;gBACH,sCAAsC;gBACtC
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _interop_require_default = require("@swc/helpers/lib/_interop_require_default.js").default;
var _object_without_properties_loose = require("@swc/helpers/lib/_object_without_properties_loose.js").default;
var _react = _interop_require_default(require("react"));
var _router = require("../shared/lib/router/router");
var _formatUrl = require("../shared/lib/router/utils/format-url");
var _addLocale = require("./add-locale");
var _routerContext = require("../shared/lib/router-context");
var _appRouterContext = require("../shared/lib/app-router-context");
var _useIntersection = require("./use-intersection");
var _getDomainLocale = require("./get-domain-locale");
var _addBasePath = require("./add-base-path");
const prefetched = new Set();
function prefetch(router, href, as, options) {
if (typeof window === 'undefined') {
return;
}
if (!(0, _router).isLocalURL(href)) {
return;
}
// We should only dedupe requests when experimental.optimisticClientCache is
// disabled.
if (!options.bypassPrefetchedCheck) {
const locale = // Let the link's locale prop override the default router locale.
typeof options.locale !== 'undefined' ? options.locale : 'locale' in router ? router.locale : undefined;
const prefetchedKey = href + '%' + as + '%' + locale;
// If we've already fetched the key, then don't prefetch it again!
if (prefetched.has(prefetchedKey)) {
return;
}
// Mark this URL as prefetched.
prefetched.add(prefetchedKey);
}
// Prefetch the JSON page if asked (only in the client)
// We need to handle a prefetch error here since we may be
// loading with priority which can reject but we don't
// want to force navigation since this is only a prefetch
Promise.resolve(router.prefetch(href, as, options)).catch((err)=>{
if (process.env.NODE_ENV !== 'production') {
// rethrow to show invalid URL errors
throw err;
}
});
}
function isModifiedEvent(event) {
const { target } = event.currentTarget;
return target && target !== '_self' || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.nativeEvent && event.nativeEvent.which === 2;
}
function linkClicked(e, router, href, as, replace, shallow, scroll, locale, isAppRouter, prefetchEnabled) {
const { nodeName } = e.currentTarget;
// anchors inside an svg have a lowercase nodeName
const isAnchorNodeName = nodeName.toUpperCase() === 'A';
if (isAnchorNodeName && (isModifiedEvent(e) || !(0, _router).isLocalURL(href))) {
// ignore click for browsers default behavior
return;
}
e.preventDefault();
const navigate = ()=>{
// If the router is an NextRouter instance it will have `beforePopState`
if ('beforePopState' in router) {
router[replace ? 'replace' : 'push'](href, as, {
shallow,
locale,
scroll
});
} else {
router[replace ? 'replace' : 'push'](as || href, {
forceOptimisticNavigation: !prefetchEnabled
});
}
};
if (isAppRouter) {
// @ts-expect-error startTransition exists.
_react.default.startTransition(navigate);
} else {
navigate();
}
}
function formatStringOrUrl(urlObjOrString) {
if (typeof urlObjOrString === 'string') {
return urlObjOrString;
}
return (0, _formatUrl).formatUrl(urlObjOrString);
}
/**
* React Component that enables client-side transitions between routes.
*/ const Link = /*#__PURE__*/ _react.default.forwardRef(function LinkComponent(props, forwardedRef) {
if (process.env.NODE_ENV !== 'production') {
function createPropError(args) {
return new Error(`Failed prop type: The prop \`${args.key}\` expects a ${args.expected} in \`<Link>\`, but got \`${args.actual}\` instead.` + (typeof window !== 'undefined' ? "\nOpen your browser's console to view the Component stack trace." : ''));
}
// TypeScript trick for type-guarding:
const requiredPropsGuard = {
href: true
};
const requiredProps = Object.keys(requiredPropsGuard);
requiredProps.forEach((key)=>{
if (key === 'href') {
if (props[key] == null || typeof props[key] !== 'string' && typeof props[key] !== 'object') {
throw createPropError({
key,
expected: '`string` or `object`',
actual: props[key] === null ? 'null' : typeof props[key]
});
}
} else {
// TypeScript trick for type-guarding:
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _ = key;
}
});
// TypeScript trick for type-guarding:
const optionalPropsGuard = {
as: true,
replace: true,
scroll: true,
shallow: true,
passHref: true,
prefetch: true,
locale: true,
onClick: true,
onMouseEnter: true,
onTouchStart: true,
legacyBehavior: true
};
const optionalProps = Object.keys(optionalPropsGuard);
optionalProps.forEach((key)=>{
const valType = typeof props[key];
if (key === 'as') {
if (props[key] && valType !== 'string' && valType !== 'object') {
throw createPropError({
key,
expected: '`string` or `object`',
actual: valType
});
}
} else if (key === 'locale') {
if (props[key] && valType !== 'string') {
throw createPropError({
key,
expected: '`string`',
actual: valType
});
}
} else if (key === 'onClick' || key === 'onMouseEnter' || key === 'onTouchStart') {
if (props[key] && valType !== 'function') {
throw createPropError({
key,
expected: '`function`',
actual: valType
});
}
} else if (key === 'replace' || key === 'scroll' || key === 'shallow' || key === 'passHref' || key === 'prefetch' || key === 'legacyBehavior') {
if (props[key] != null && valType !== 'boolean') {
throw createPropError({
key,
expected: '`boolean`',
actual: valType
});
}
} else {
// TypeScript trick for type-guarding:
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _ = key;
}
});
// This hook is in a conditional but that is ok because `process.env.NODE_ENV` never changes
// eslint-disable-next-line react-hooks/rules-of-hooks
const hasWarned = _react.default.useRef(false);
if (props.prefetch && !hasWarned.current) {
hasWarned.current = true;
console.warn('Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://nextjs.org/docs/messages/prefetch-true-deprecated');
}
}
let children;
const { href: hrefProp , as: asProp , children: childrenProp , prefetch: prefetchProp , passHref , replace , shallow , scroll , locale , onClick , onMouseEnter: onMouseEnterProp , onTouchStart: onTouchStartProp , // @ts-expect-error this is inlined as a literal boolean not a string
legacyBehavior =process.env.__NEXT_NEW_LINK_BEHAVIOR === false } = props, restProps = _object_without_properties_loose(props, [
"href",
"as",
"children",
"prefetch",
"passHref",
"replace",
"shallow",
"scroll",
"locale",
"onClick",
"onMouseEnter",
"onTouchStart",
"legacyBehavior"
]);
children = childrenProp;
if (legacyBehavior && (typeof children === 'string' || typeof children === 'number')) {
children = /*#__PURE__*/ _react.default.createElement("a", null, children);
}
const prefetchEnabled = prefetchProp !== false;
const pagesRouter = _react.default.useContext(_routerContext.RouterContext);
const appRouter = _react.default.useContext(_appRouterContext.AppRouterContext);
const router = pagesRouter != null ? pagesRouter : appRouter;
// We're in the app directory if there is no pages router.
const isAppRouter = !pagesRouter;
if (process.env.NODE_ENV !== 'production') {
if (isAppRouter && !asProp) {
let href;
if (typeof hrefProp === 'string') {
href = hrefProp;
} else if (typeof hrefProp === 'object' && typeof hrefProp.pathname === 'string') {
href = hrefProp.pathname;
}
if (href) {
const hasDynamicSegment = href.split('/').some((segment)=>segment.startsWith('[') && segment.endsWith(']'));
if (hasDynamicSegment) {
throw new Error(`Dynamic href \`${href}\` found in <Link> while using the \`/app\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`);
}
}
}
}
const { href , as } = _react.default.useMemo(()=>{
if (!pagesRouter) {
const resolvedHref = formatStringOrUrl(hrefProp);
return {
href: resolvedHref,
as: asProp ? formatStringOrUrl(asProp) : resolvedHref
};
}
const [resolvedHref, resolvedAs] = (0, _router).resolveHref(pagesRouter, hrefProp, true);
return {
href: resolvedHref,
as: asProp ? (0, _router).resolveHref(pagesRouter, asProp) : resolvedAs || resolvedHref
};
}, [
pagesRouter,
hrefProp,
asProp
]);
const previousHref = _react.default.useRef(href);
const previousAs = _react.default.useRef(as);
// This will return the first child, if multiple are provided it will throw an error
let child;
if (legacyBehavior) {
if (process.env.NODE_ENV === 'development') {
if (onClick) {
console.warn(`"onClick" was passed to <Link> with \`href\` of \`${hrefProp}\` but "legacyBehavior" was set. The legacy behavior requires onClick be set on the child of next/link`);
}
if (onMouseEnterProp) {
console.warn(`"onMouseEnter" was passed to <Link> with \`href\` of \`${hrefProp}\` but "legacyBehavior" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`);
}
try {
child = _react.default.Children.only(children);
} catch (err) {
if (!children) {
throw new Error(`No children were passed to <Link> with \`href\` of \`${hrefProp}\` but one child is required https://nextjs.org/docs/messages/link-no-children`);
}
throw new Error(`Multiple children were passed to <Link> with \`href\` of \`${hrefProp}\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` + (typeof window !== 'undefined' ? " \nOpen your browser's console to view the Component stack trace." : ''));
}
} else {
child = _react.default.Children.only(children);
}
} else {
if (process.env.NODE_ENV === 'development') {
var ref;
if (((ref = children) == null ? void 0 : ref.type) === 'a') {
throw new Error('Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor');
}
}
}
const childRef = legacyBehavior ? child && typeof child === 'object' && child.ref : forwardedRef;
const [setIntersectionRef, isVisible, resetVisible] = (0, _useIntersection).useIntersection({
rootMargin: '200px'
});
const setRef = _react.default.useCallback((el)=>{
// Before the link getting observed, check if visible state need to be reset
if (previousAs.current !== as || previousHref.current !== href) {
resetVisible();
previousAs.current = as;
previousHref.current = href;
}
setIntersectionRef(el);
if (childRef) {
if (typeof childRef === 'function') childRef(el);
else if (typeof childRef === 'object') {
childRef.current = el;
}
}
}, [
as,
childRef,
href,
resetVisible,
setIntersectionRef
]);
// Prefetch the URL if we haven't already and it's visible.
_react.default.useEffect(()=>{
// in dev, we only prefetch on hover to avoid wasting resources as the prefetch will trigger compiling the page.
if (process.env.NODE_ENV !== 'production') {
return;
}
if (!router) {
return;
}
// If we don't need to prefetch the URL, don't do prefetch.
if (!isVisible || !prefetchEnabled) {
return;
}
// Prefetch the URL.
prefetch(router, href, as, {
locale
});
}, [
as,
href,
isVisible,
locale,
prefetchEnabled,
pagesRouter == null ? void 0 : pagesRouter.locale,
router,
]);
const childProps = {
ref: setRef,
onClick (e) {
if (process.env.NODE_ENV !== 'production') {
if (!e) {
throw new Error(`Component rendered inside next/link has to pass click event to "onClick" prop.`);
}
}
if (!legacyBehavior && typeof onClick === 'function') {
onClick(e);
}
if (legacyBehavior && child.props && typeof child.props.onClick === 'function') {
child.props.onClick(e);
}
if (!router) {
return;
}
if (e.defaultPrevented) {
return;
}
linkClicked(e, router, href, as, replace, shallow, scroll, locale, isAppRouter, prefetchEnabled);
},
onMouseEnter (e) {
if (!legacyBehavior && typeof onMouseEnterProp === 'function') {
onMouseEnterProp(e);
}
if (legacyBehavior && child.props && typeof child.props.onMouseEnter === 'function') {
child.props.onMouseEnter(e);
}
if (!router) {
return;
}
if (!prefetchEnabled && isAppRouter) {
return;
}
prefetch(router, href, as, {
locale,
priority: true,
// @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}
bypassPrefetchedCheck: true
});
},
onTouchStart (e) {
if (!legacyBehavior && typeof onTouchStartProp === 'function') {
onTouchStartProp(e);
}
if (legacyBehavior && child.props && typeof child.props.onTouchStart === 'function') {
child.props.onTouchStart(e);
}
if (!router) {
return;
}
if (!prefetchEnabled && isAppRouter) {
return;
}
prefetch(router, href, as, {
locale,
priority: true,
// @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}
bypassPrefetchedCheck: true
});
}
};
// If child is an <a> 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 (!legacyBehavior || passHref || child.type === 'a' && !('href' in child.props)) {
const curLocale = typeof locale !== 'undefined' ? locale : pagesRouter == null ? void 0 : pagesRouter.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
const localeDomain = (pagesRouter == null ? void 0 : pagesRouter.isLocaleDomain) && (0, _getDomainLocale).getDomainLocale(as, curLocale, pagesRouter == null ? void 0 : pagesRouter.locales, pagesRouter == null ? void 0 : pagesRouter.domainLocales);
childProps.href = localeDomain || (0, _addBasePath).addBasePath((0, _addLocale).addLocale(as, curLocale, pagesRouter == null ? void 0 : pagesRouter.defaultLocale));
}
return legacyBehavior ? /*#__PURE__*/ _react.default.cloneElement(child, childProps) : /*#__PURE__*/ _react.default.createElement("a", Object.assign({}, restProps, childProps), children);
});
var _default = Link;
exports.default = _default;
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=link.js.map@<40><00>Object<63>defineProperty<16><><EFBFBD><EFBFBD><EFBFBD>value<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>require<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>Set<16><><EFBFBD><EFBFBD><EFBFBD>router<65>href<65>as<61>options$<24><><EFBFBD><EFBFBD>bypassPrefetchedCheck<63>locale<16><><EFBFBD><EFBFBD><EFBFBD>prefetchedKey<65>has<61>add<64>Promise<73>resolve<76>catch<63>err6<><36><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>event<6E>target<65>currentTarget<65>metaKey<65>ctrlKey<65>shiftKey<65>altKey<65>nativeEvent<6E>which<16><><EFBFBD><EFBFBD><EFBFBD>e<EFBFBD>replace<63>shallow<6F>scroll<6C>isAppRouter<65>prefetchEnabled<65>nodeName<6D>isAnchorNodeName<6D>toUpperCase<73>preventDefault<6C>navigate<74>forceOptimisticNavigation<6F>startTransition|<7C><><EFBFBD><EFBFBD>urlObjOrString<6E>formatUrl}<7D><><EFBFBD><EFBFBD>forwardRef<65>LinkComponent<6E>props<70>forwardedRef<65>createPropError<6F>args<67>Error<6F>key<65>expected<65>actual<61>requiredPropsGuard<72>requiredProps<70>keys<79>forEach<63>_<EFBFBD>optionalPropsGuard<72>passHref<65>onClick<63>onMouseEnter<65>onTouchStart<72>legacyBehavior<6F>optionalProps<70>valType<70>hasWarned<65>useRef<65>current<6E>console<6C>warn<72>children<65>hrefProp<6F>asProp<6F>childrenProp<6F>prefetchProp<6F>onMouseEnterProp<6F>onTouchStartProp<6F>env<6E>__NEXT_NEW_LINK_BEHAVIOR<4F>restProps<70>createElement<6E>pagesRouter<65>useContext<78>RouterContext<78>appRouter<65>AppRouterContext<78>pathname<6D>hasDynamicSegment<6E>split<69>some<6D>segment<6E>startsWith<74>endsWith<74>useMemo<6D>resolvedHref<65>resolvedAs<16><><EFBFBD><EFBFBD><EFBFBD>previousHref<65>previousAs<41>child<6C>Children<65>only<6C>ref'<27><><EFBFBD><EFBFBD>childRef<65>setIntersectionRef<65>isVisible<6C>resetVisible<16><><EFBFBD><EFBFBD><EFBFBD>rootMargin<69>setRef<65>useCallback<63>el<65>useEffect<63>childProps<70>defaultPrevented<65>priority<74>curLocale<6C>localeDomain<69>isLocaleDomain<16><><EFBFBD><EFBFBD><EFBFBD>locales<65>domainLocales3<><33><EFBFBD>h<><68><EFBFBD><EFBFBD>defaultLocale<6C>cloneElement<6E>assign,<2C><><EFBFBD>j<><6A><EFBFBD><16><><EFBFBD><EFBFBD><03>__webpack_exports__q<><71><EFBFBD><16><><EFBFBD><EFBFBD>V<><56><EFBFBD>W<><57><EFBFBD>+module.exports = require("react-icons/ai");<3B>external commonjs "react-icons/ai"r<><72><EFBFBD>Q<><51><EFBFBD>R<><52><EFBFBD> <00> <10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/SourceMapSource<10>H"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addLocale = void 0;
var _normalizeTrailingSlash = require("./normalize-trailing-slash");
const addLocale = (path, ...args)=>{
if (process.env.__NEXT_I18N_SUPPORT) {
return (0, _normalizeTrailingSlash).normalizePathTrailingSlash(require("../shared/lib/router/utils/add-locale").addLocale(path, ...args));
}
return path;
};
exports.addLocale = addLocale;
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=add-locale.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/add-locale.js/{"version":3,"sources":["webpack://./node_modules/next/dist/client/add-locale.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.addLocale = void 0;\nvar _normalizeTrailingSlash = require(\"./normalize-trailing-slash\");\nconst addLocale = (path, ...args)=>{\n if (process.env.__NEXT_I18N_SUPPORT) {\n return (0, _normalizeTrailingSlash).normalizePathTrailingSlash(require('../shared/lib/router/utils/add-locale').addLocale(path, ...args));\n }\n return path;\n};\nexports.addLocale = addLocale;\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=add-locale.js.map"],"names":["Object","defineProperty","exports","value","addLocale","_normalizeTrailingSlash","require","path","args","process","env","__NEXT_I18N_SUPPORT","normalizePathTrailingSlash","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,SAAS,GAAG,KAAK;AACzB,IAAIC,0BAA0BC,QAAQ;AACtC,MAAMF,YAAY,CAACG,MAAM,GAAGC,OAAO;IAC/B,IAAIC,QAAQC,GAAG,CAACC,mBAAmB,EAAE;QACjC,OAAO,AAAC,CAAA,GAAGN,uBAAuB,AAAD,EAAGO,0BAA0B,CAACN,QAAQ,yCAAyCF,SAAS,CAACG,SAASC;IACvI,CAAC;IACD,OAAOD;AACX;AACAL,QAAQE,SAAS,GAAGA;AAEpB,IAAI,AAAC,CAAA,OAAOF,QAAQW,OAAO,KAAK,cAAe,OAAOX,QAAQW,OAAO,KAAK,YAAYX,QAAQW,OAAO,KAAK,IAAI,KAAM,OAAOX,QAAQW,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKd,OAAOC,cAAc,CAACC,QAAQW,OAAO,EAAE,cAAc;QAAEV,OAAO,IAAI;IAAC;IACnEH,OAAOe,MAAM,CAACb,QAAQW,OAAO,EAAEX;IAC/Bc,OAAOd,OAAO,GAAGA,QAAQW,OAAO;AAClC,CAAC,CAED,sCAAsC","file":"x"} f :NNQaI<61><00><00><00><00><00><00><00><00><00><18>Object.defineProperty(exports, "__esModule", (<18>))<18>exports.addLocale<18>__webpack_require__<18>/*! ./normalize-trailing-slash */ "./node_modules/next/dist/client/normalize-trailing-slash.js"<18>false<18>{}<15>V<><56><EFBFBD><1F>
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.addLocale = void 0;
var _normalizeTrailingSlash = __webpack_require__(/*! ./normalize-trailing-slash */ "./node_modules/next/dist/client/normalize-trailing-slash.js");
const addLocale = (path, ...args)=>{
if (false) {}
return path;
};
exports.addLocale = addLocale;
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=add-locale.js.map
W<><57><EFBFBD>Z<><5A><EFBFBD>^<5E><><EFBFBD><03>xAAAa;AACbA,8CAA6C;IACzCG,OAAO,IAAI;AACf,CAAC,EAAC;AACFD,iBAAiB,GAAG,KAAK;AACzB,IAAIG,0BAA0BC,mBAAOA,CAAC,+FAA4B;AAClE,MAAMF,YAAY,CAACG,MAAM,GAAGC,OAAO;IAC/B,IAAIC,KAA+B,EAAE,EAEpC;IACD,OAAOF;AACX;AACAL,iBAAiB,GAAGE;AAEpB,IAAI,CAAC,OAAOF,QAAQW,OAAO,KAAK,cAAe,OAAOX,QAAQW,OAAO,KAAK,YAAYX,QAAQW,OAAO,KAAK,IAAI,KAAM,OAAOX,QAAQW,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKd,OAAOC,cAAc,CAACC,QAAQW,OAAO,EAAE,cAAc;QAAEV,OAAO,IAAI;IAAC;IACnEH,OAAOe,MAAM,CAACb,QAAQW,OAAO,EAAEX;IAC/Bc,OAAOd,OAAO,GAAGA,QAAQW,OAAO;AAClC,CAAC,CAED,sCAAsC<01>webpack://./node_modules/next/dist/client/add-locale.js9"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addLocale = void 0;
var _normalizeTrailingSlash = require("./normalize-trailing-slash");
const addLocale = (path, ...args)=>{
if (process.env.__NEXT_I18N_SUPPORT) {
return (0, _normalizeTrailingSlash).normalizePathTrailingSlash(require('../shared/lib/router/utils/add-locale').addLocale(path, ...args));
}
return path;
};
exports.addLocale = addLocale;
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=add-locale.js.map`s<><73><EFBFBD>t<><74><EFBFBD>Y<><59><EFBFBD>u<><75><EFBFBD>P<><50><EFBFBD>O<><4F><EFBFBD>v<><76><EFBFBD><16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD><15><>__NEXT_I18N_SUPPORT<0F><><EFBFBD>Y<><59><EFBFBD>T<><54><EFBFBD><15><16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD>\<5C><><EFBFBD>A<><41><EFBFBD>B<><42><EFBFBD> s<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/SourceMapSource<10>="use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getDomainLocale = getDomainLocale;
const basePath = process.env.__NEXT_ROUTER_BASEPATH || "";
function getDomainLocale(path, locale, locales, domainLocales) {
if (process.env.__NEXT_I18N_SUPPORT) {
const normalizeLocalePath = require("./normalize-locale-path").normalizeLocalePath;
const detectDomainLocale = require("./detect-domain-locale").detectDomainLocale;
const target = locale || normalizeLocalePath(path, locales).detectedLocale;
const domain = detectDomainLocale(domainLocales, undefined, target);
if (domain) {
const proto = `http${domain.http ? "" : "s"}://`;
const finalLocale = target === domain.defaultLocale ? "" : `/${target}`;
return `${proto}${domain.domain}${basePath}${finalLocale}${path}`;
}
return false;
} else {
return false;
}
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=get-domain-locale.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/get-domain-locale.js\ {"version":3,"sources":["webpack://./node_modules/next/dist/client/get-domain-locale.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getDomainLocale = getDomainLocale;\nconst basePath = process.env.__NEXT_ROUTER_BASEPATH || '';\nfunction getDomainLocale(path, locale, locales, domainLocales) {\n if (process.env.__NEXT_I18N_SUPPORT) {\n const normalizeLocalePath = require('./normalize-locale-path').normalizeLocalePath;\n const detectDomainLocale = require('./detect-domain-locale').detectDomainLocale;\n const target = locale || normalizeLocalePath(path, locales).detectedLocale;\n const domain = detectDomainLocale(domainLocales, undefined, target);\n if (domain) {\n const proto = `http${domain.http ? '' : 's'}://`;\n const finalLocale = target === domain.defaultLocale ? '' : `/${target}`;\n return `${proto}${domain.domain}${basePath}${finalLocale}${path}`;\n }\n return false;\n } else {\n return false;\n }\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=get-domain-locale.js.map"],"names":["Object","defineProperty","exports","value","getDomainLocale","basePath","process","env","__NEXT_ROUTER_BASEPATH","path","locale","locales","domainLocales","__NEXT_I18N_SUPPORT","normalizeLocalePath","require","detectDomainLocale","target","detectedLocale","domain","undefined","proto","http","finalLocale","defaultLocale","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,eAAe,GAAGA;AAC1B,MAAMC,WAAWC,QAAQC,GAAG,CAACC,sBAAsB,IAAI;AACvD,SAASJ,gBAAgBK,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAEC,aAAa,EAAE;IAC3D,IAAIN,QAAQC,GAAG,CAACM,mBAAmB,EAAE;QACjC,MAAMC,sBAAsBC,QAAQ,2BAA2BD,mBAAmB;QAClF,MAAME,qBAAqBD,QAAQ,0BAA0BC,kBAAkB;QAC/E,MAAMC,SAASP,UAAUI,oBAAoBL,MAAME,SAASO,cAAc;QAC1E,MAAMC,SAASH,mBAAmBJ,eAAeQ,WAAWH;QAC5D,IAAIE,QAAQ;YACR,MAAME,QAAQ,CAAC,IAAI,EAAEF,OAAOG,IAAI,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC;YAChD,MAAMC,cAAcN,WAAWE,OAAOK,aAAa,GAAG,KAAK,CAAC,CAAC,EAAEP,OAAO,CAAC;YACvE,OAAO,CAAC,EAAEI,MAAM,EAAEF,OAAOA,MAAM,CAAC,EAAEd,SAAS,EAAEkB,YAAY,EAAEd,KAAK,CAAC;QACrE,CAAC;QACD,OAAO,KAAK;IAChB,OAAO;QACH,OAAO,KAAK;IAChB,CAAC;AACL;AAEA,IAAI,AAAC,CAAA,OAAOP,QAAQuB,OAAO,KAAK,cAAe,OAAOvB,QAAQuB,OAAO,KAAK,YAAYvB,QAAQuB,OAAO,KAAK,IAAI,KAAM,OAAOvB,QAAQuB,OAAO,CAACC,UAAU,KAAK,aAAa;IACrK1B,OAAOC,cAAc,CAACC,QAAQuB,OAAO,EAAE,cAAc;QAAEtB,OAAO,IAAI;IAAC;IACnEH,OAAO2B,MAAM,CAACzB,QAAQuB,OAAO,EAAEvB;IAC/B0B,OAAO1B,OAAO,GAAGA,QAAQuB,OAAO;AAClC,CAAC,CAED,6CAA6C","file":"x"}f :NNQgE<67><00>!<00><00><18>Object.defineProperty(exports, "__esModule", (<18>))<18>exports.getDomainLocale<18> false<18>false<18>{}F<><46><EFBFBD><1F>
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.getDomainLocale = getDomainLocale;
const basePath = false || "";
function getDomainLocale(path, locale, locales, domainLocales) {
if (false) {} else {
return false;
}
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=get-domain-locale.js.map
G<><47><EFBFBD>J<><4A><EFBFBD>N<><4E><EFBFBD><03>xAAAa;AACbA,8CAA6C;IACzCG,OAAO,IAAI;AACf,CAAC,EAAC;AACFD,uBAAuB,GAAGE;AAC1B,MAAMC,WAAWC,MAAkC,IAAI;AACvD,SAASF,gBAAgBK,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAEC,aAAa,EAAE;IAC3D,IAAIN,KAA+B,EAAE,EAWpC,MAAM;QACH,OAAO,KAAK;IAChB,CAAC;AACL;AAEA,IAAI,CAAC,OAAOJ,QAAQuB,OAAO,KAAK,cAAe,OAAOvB,QAAQuB,OAAO,KAAK,YAAYvB,QAAQuB,OAAO,KAAK,IAAI,KAAM,OAAOvB,QAAQuB,OAAO,CAACC,UAAU,KAAK,aAAa;IACrK1B,OAAOC,cAAc,CAACC,QAAQuB,OAAO,EAAE,cAAc;QAAEtB,OAAO,IAAI;IAAC;IACnEH,OAAO2B,MAAM,CAACzB,QAAQuB,OAAO,EAAEvB;IAC/B0B,OAAO1B,OAAO,GAAGA,QAAQuB,OAAO;AAClC,CAAC,CAED,6CAA6C<01>webpack://./node_modules/next/dist/client/get-domain-locale.js."use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getDomainLocale = getDomainLocale;
const basePath = process.env.__NEXT_ROUTER_BASEPATH || '';
function getDomainLocale(path, locale, locales, domainLocales) {
if (process.env.__NEXT_I18N_SUPPORT) {
const normalizeLocalePath = require('./normalize-locale-path').normalizeLocalePath;
const detectDomainLocale = require('./detect-domain-locale').detectDomainLocale;
const target = locale || normalizeLocalePath(path, locales).detectedLocale;
const domain = detectDomainLocale(domainLocales, undefined, target);
if (domain) {
const proto = `http${domain.http ? '' : 's'}://`;
const finalLocale = target === domain.defaultLocale ? '' : `/${target}`;
return `${proto}${domain.domain}${basePath}${finalLocale}${path}`;
}
return false;
} else {
return false;
}
}
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=get-domain-locale.js.map`c<><63><EFBFBD>d<><64><EFBFBD>I<><49><EFBFBD>e<><65><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15><>__NEXT_ROUTER_BASEPATH<16><><EFBFBD><EFBFBD>l<><6C><EFBFBD><15><15><15><>normalizeLocalePathd<><64><EFBFBD><16><><EFBFBD><EFBFBD>t<><74><EFBFBD><EFBFBD>detectedLocale<6C>domain<16><><EFBFBD><EFBFBD><EFBFBD>proto<74>http<74>finalLocale<15>C<><43><EFBFBD>><3E><><EFBFBD><15><16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD>+<2B><><EFBFBD>,<2C><><EFBFBD> 5,<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/SourceMapSource<10><1F> "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useIntersection = useIntersection;
var _react = require("react");
var _requestIdleCallback = require("./request-idle-callback");
const hasIntersectionObserver = typeof IntersectionObserver === "function";
const observers = new Map();
const idList = [];
function createObserver(options) {
const id = {
root: options.root || null,
margin: options.rootMargin || ""
};
const existing = idList.find((obj)=>obj.root === id.root && obj.margin === id.margin);
let instance;
if (existing) {
instance = observers.get(existing);
if (instance) {
return instance;
}
}
const elements = new Map();
const observer = new IntersectionObserver((entries)=>{
entries.forEach((entry)=>{
const callback = elements.get(entry.target);
const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;
if (callback && isVisible) {
callback(isVisible);
}
});
}, options);
instance = {
id,
observer,
elements
};
idList.push(id);
observers.set(id, instance);
return instance;
}
function observe(element, callback, options) {
const { id , observer , elements } = createObserver(options);
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);
const index = idList.findIndex((obj)=>obj.root === id.root && obj.margin === id.margin);
if (index > -1) {
idList.splice(index, 1);
}
}
};
}
function useIntersection({ rootRef , rootMargin , disabled }) {
const isDisabled = disabled || !hasIntersectionObserver;
const [visible, setVisible] = (0, _react).useState(false);
const [element, setElement] = (0, _react).useState(null);
(0, _react).useEffect(()=>{
if (hasIntersectionObserver) {
if (isDisabled || visible) return;
if (element && element.tagName) {
const unobserve = observe(element, (isVisible)=>isVisible && setVisible(isVisible), {
root: rootRef == null ? void 0 : rootRef.current,
rootMargin
});
return unobserve;
}
} else {
if (!visible) {
const idleCallback = (0, _requestIdleCallback).requestIdleCallback(()=>setVisible(true));
return ()=>(0, _requestIdleCallback).cancelIdleCallback(idleCallback);
}
}
}, [
element,
isDisabled,
rootMargin,
rootRef,
visible
]);
const resetVisible = (0, _react).useCallback(()=>{
setVisible(false);
}, []);
return [
setElement,
visible,
resetVisible
];
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=use-intersection.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/use-intersection.js{"version":3,"sources":["webpack://./node_modules/next/dist/client/use-intersection.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.useIntersection = useIntersection;\nvar _react = require(\"react\");\nvar _requestIdleCallback = require(\"./request-idle-callback\");\nconst hasIntersectionObserver = typeof IntersectionObserver === 'function';\nconst observers = new Map();\nconst idList = [];\nfunction createObserver(options) {\n const id = {\n root: options.root || null,\n margin: options.rootMargin || ''\n };\n const existing = idList.find((obj)=>obj.root === id.root && obj.margin === id.margin);\n let instance;\n if (existing) {\n instance = observers.get(existing);\n if (instance) {\n return instance;\n }\n }\n const elements = new Map();\n const observer = new IntersectionObserver((entries)=>{\n entries.forEach((entry)=>{\n const callback = elements.get(entry.target);\n const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;\n if (callback && isVisible) {\n callback(isVisible);\n }\n });\n }, options);\n instance = {\n id,\n observer,\n elements\n };\n idList.push(id);\n observers.set(id, instance);\n return instance;\n}\nfunction observe(element, callback, options) {\n const { id , observer , elements } = createObserver(options);\n elements.set(element, callback);\n observer.observe(element);\n return function unobserve() {\n elements.delete(element);\n observer.unobserve(element);\n // Destroy observer when there's nothing left to watch:\n if (elements.size === 0) {\n observer.disconnect();\n observers.delete(id);\n const index = idList.findIndex((obj)=>obj.root === id.root && obj.margin === id.margin);\n if (index > -1) {\n idList.splice(index, 1);\n }\n }\n };\n}\nfunction useIntersection({ rootRef , rootMargin , disabled }) {\n const isDisabled = disabled || !hasIntersectionObserver;\n const [visible, setVisible] = (0, _react).useState(false);\n const [element, setElement] = (0, _react).useState(null);\n (0, _react).useEffect(()=>{\n if (hasIntersectionObserver) {\n if (isDisabled || visible) return;\n if (element && element.tagName) {\n const unobserve = observe(element, (isVisible)=>isVisible && setVisible(isVisible), {\n root: rootRef == null ? void 0 : rootRef.current,\n rootMargin\n });\n return unobserve;\n }\n } else {\n if (!visible) {\n const idleCallback = (0, _requestIdleCallback).requestIdleCallback(()=>setVisible(true));\n return ()=>(0, _requestIdleCallback).cancelIdleCallback(idleCallback);\n }\n }\n }, [\n element,\n isDisabled,\n rootMargin,\n rootRef,\n visible\n ]);\n const resetVisible = (0, _react).useCallback(()=>{\n setVisible(false);\n }, []);\n return [\n setElement,\n visible,\n resetVisible\n ];\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=use-intersection.js.map"],"names":["Object","defineProperty","exports","value","useIntersection","_react","require","_requestIdleCallback","hasIntersectionObserver","IntersectionObserver","observers","Map","idList",
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.useIntersection = useIntersection;
var _react = __webpack_require__(/*! react */ "react");
var _requestIdleCallback = __webpack_require__(/*! ./request-idle-callback */ "./node_modules/next/dist/client/request-idle-callback.js");
const hasIntersectionObserver = typeof IntersectionObserver === "function";
const observers = new Map();
const idList = [];
function createObserver(options) {
const id = {
root: options.root || null,
margin: options.rootMargin || ""
};
const existing = idList.find((obj)=>obj.root === id.root && obj.margin === id.margin);
let instance;
if (existing) {
instance = observers.get(existing);
if (instance) {
return instance;
}
}
const elements = new Map();
const observer = new IntersectionObserver((entries)=>{
entries.forEach((entry)=>{
const callback = elements.get(entry.target);
const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;
if (callback && isVisible) {
callback(isVisible);
}
});
}, options);
instance = {
id,
observer,
elements
};
idList.push(id);
observers.set(id, instance);
return instance;
}
function observe(element, callback, options) {
const { id , observer , elements } = createObserver(options);
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);
const index = idList.findIndex((obj)=>obj.root === id.root && obj.margin === id.margin);
if (index > -1) {
idList.splice(index, 1);
}
}
};
}
function useIntersection({ rootRef , rootMargin , disabled }) {
const isDisabled = disabled || !hasIntersectionObserver;
const [visible, setVisible] = (0, _react).useState(false);
const [element, setElement] = (0, _react).useState(null);
(0, _react).useEffect(()=>{
if (hasIntersectionObserver) {
if (isDisabled || visible) return;
if (element && element.tagName) {
const unobserve = observe(element, (isVisible)=>isVisible && setVisible(isVisible), {
root: rootRef == null ? void 0 : rootRef.current,
rootMargin
});
return unobserve;
}
} else {
if (!visible) {
const idleCallback = (0, _requestIdleCallback).requestIdleCallback(()=>setVisible(true));
return ()=>(0, _requestIdleCallback).cancelIdleCallback(idleCallback);
}
}
}, [
element,
isDisabled,
rootMargin,
rootRef,
visible
]);
const resetVisible = (0, _react).useCallback(()=>{
setVisible(false);
}, []);
return [
setElement,
visible,
resetVisible
];
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=use-intersection.js.map
1<><31><EFBFBD>4<><34><EFBFBD>8<><38><EFBFBD><03>x?
AAAa;AACbA,8CAA6C;IACzCG,OAAO,IAAI;AACf,CAAC,EAAC;AACFD,uBAAuB,GAAGE;AAC1B,IAAIC,SAASC,mBAAOA,CAAC,oBAAO;AAC5B,IAAIC,uBAAuBD,mBAAOA,CAAC,yFAAyB;AAC5D,MAAME,0BAA0B,OAAOC,yBAAyB;AAChE,MAAMC,YAAY,IAAIC;AACtB,MAAMC,SAAS,EAAE;AACjB,SAASC,eAAeC,OAAO,EAAE;IAC7B,MAAMC,KAAK;QACPC,MAAMF,QAAQE,IAAI,IAAI,IAAI;QAC1BC,QAAQH,QAAQI,UAAU,IAAI;IAClC;IACA,MAAMC,WAAWP,OAAOQ,IAAI,CAAC,CAACC,MAAMA,IAAIL,IAAI,KAAKD,GAAGC,IAAI,IAAIK,IAAIJ,MAAM,KAAKF,GAAGE,MAAM;IACpF,IAAIK;IACJ,IAAIH,UAAU;QACVG,WAAWZ,UAAUa,GAAG,CAACJ;QACzB,IAAIG,UAAU;YACV,OAAOA;QACX,CAAC;IACL,CAAC;IACD,MAAME,WAAW,IAAIb;IACrB,MAAMc,WAAW,IAAIhB,qBAAqB,CAACiB,UAAU;QACjDA,QAAQC,OAAO,CAAC,CAACC,QAAQ;YACrB,MAAMC,WAAWL,SAASD,GAAG,CAACK,MAAME,MAAM;YAC1C,MAAMC,YAAYH,MAAMI,cAAc,IAAIJ,MAAMK,iBAAiB,GAAG;YACpE,IAAIJ,YAAYE,WAAW;gBACvBF,SAASE;YACb,CAAC;QACL;IACJ,GAAGjB;IACHQ,WAAW;QACPP;QACAU;QACAD;IACJ;IACAZ,OAAOsB,IAAI,CAACnB;IACZL,UAAUyB,GAAG,CAACpB,IAAIO;IAClB,OAAOA;AACX;AACA,SAASc,QAAQC,OAAO,EAAER,QAAQ,EAAEf,OAAO,EAAE;IACzC,MAAM,EAAEC,GAAE,EAAGU,SAAQ,EAAGD,SAAQ,EAAG,GAAGX,eAAeC;IACrDU,SAASW,GAAG,CAACE,SAASR;IACtBJ,SAASW,OAAO,CAACC;IACjB,OAAO,SAASC,YAAY;QACxBd,SAASe,MAAM,CAACF;QAChBZ,SAASa,SAAS,CAACD;QACnB,uDAAuD;QACvD,IAAIb,SAASgB,IAAI,KAAK,GAAG;YACrBf,SAASgB,UAAU;YACnB/B,UAAU6B,MAAM,CAACxB;YACjB,MAAM2B,QAAQ9B,OAAO+B,SAAS,CAAC,CAACtB,MAAMA,IAAIL,IAAI,KAAKD,GAAGC,IAAI,IAAIK,IAAIJ,MAAM,KAAKF,GAAGE,MAAM;YACtF,IAAIyB,QAAQ,CAAC,GAAG;gBACZ9B,OAAOgC,MAAM,CAACF,OAAO;YACzB,CAAC;QACL,CAAC;IACL;AACJ;AACA,SAAStC,gBAAgB,EAAEyC,QAAO,EAAG3B,WAAU,EAAG4B,SAAQ,EAAG,EAAE;IAC3D,MAAMC,aAAaD,YAAY,CAACtC;IAChC,MAAM,CAACwC,SAASC,WAAW,GAAG,CAAC,GAAG5C,MAAM,EAAE6C,QAAQ,CAAC,KAAK;IACxD,MAAM,CAACb,SAASc,WAAW,GAAG,CAAC,GAAG9C,MAAM,EAAE6C,QAAQ,CAAC,IAAI;IACtD,IAAG7C,MAAM,EAAE+C,SAAS,CAAC,IAAI;QACtB,IAAI5C,yBAAyB;YACzB,IAAIuC,cAAcC,SAAS;YAC3B,IAAIX,WAAWA,QAAQgB,OAAO,EAAE;gBAC5B,MAAMf,YAAYF,QAAQC,SAAS,CAACN,YAAYA,aAAakB,WAAWlB,YAAY;oBAChFf,MAAM6B,WAAW,IAAI,GAAG,KAAK,IAAIA,QAAQS,OAAO;oBAChDpC;gBACJ;gBACA,OAAOoB;YACX,CAAC;QACL,OAAO;YACH,IAAI,CAACU,SAAS;gBACV,MAAMO,eAAe,CAAC,GAAGhD,oBAAoB,EAAEiD,mBAAmB,CAAC,IAAIP,WAAW,IAAI;gBACtF,OAAO,IAAI,CAAC,GAAG1C,oBAAoB,EAAEkD,kBAAkB,CAACF;YAC5D,CAAC;QACL,CAAC;IACL,GAAG;QACClB;QACAU;QACA7B;QACA2B;QACAG;KACH;IACD,MAAMU,eAAe,CAAC,GAAGrD,MAAM,EAAEsD,WAAW,CAAC,IAAI;QAC7CV,WAAW,KAAK;IACpB,GAAG,EAAE;IACL,OAAO;QACHE;QACAH;QACAU;KACH;AACL;AAEA,IAAI,CAAC,OAAOxD,QAAQ0D,OAAO,KAAK,cAAe,OAAO1D,QAAQ0D,OAAO,KAAK,YAAY1D,QAAQ0D,OAAO,KAAK,IAAI,KAAM,OAAO1D,QAAQ0D,OAAO,CAACC,UAAU,KAAK,aAAa;IACrK7D,OAAOC,cAAc,CAACC,QAAQ0D,OAAO,EAAE,cAAc;QAAEzD,OAAO,IAAI;IAAC;IACnEH,OAAO8D,MAAM,CAAC5D,QAAQ0D,OAAO,EAAE1D;IAC/B6D,OAAO7D,OAAO,GAAGA,QAAQ0D,OAAO;AAClC,CAAC,CAED,4CAA4C<01>webpack://./node_modules/next/dist/client/use-intersection.js<1F> "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useIntersection = useIntersection;
var _react = require("react");
var _requestIdleCallback = require("./request-idle-callback");
const hasIntersectionObserver = typeof IntersectionObserver === 'function';
const observers = new Map();
const idList = [];
function createObserver(options) {
const id = {
root: options.root || null,
margin: options.rootMargin || ''
};
const existing = idList.find((obj)=>obj.root === id.root && obj.margin === id.margin);
let instance;
if (existing) {
instance = observers.get(existing);
if (instance) {
return instance;
}
}
const elements = new Map();
const observer = new IntersectionObserver((entries)=>{
entries.forEach((entry)=>{
const callback = elements.get(entry.target);
const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;
if (callback && isVisible) {
callback(isVisible);
}
});
}, options);
instance = {
id,
observer,
elements
};
idList.push(id);
observers.set(id, instance);
return instance;
}
function observe(element, callback, options) {
const { id , observer , elements } = createObserver(options);
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);
const index = idList.findIndex((obj)=>obj.root === id.root && obj.margin === id.margin);
if (index > -1) {
idList.splice(index, 1);
}
}
};
}
function useIntersection({ rootRef , rootMargin , disabled }) {
const isDisabled = disabled || !hasIntersectionObserver;
const [visible, setVisible] = (0, _react).useState(false);
const [element, setElement] = (0, _react).useState(null);
(0, _react).useEffect(()=>{
if (hasIntersectionObserver) {
if (isDisabled || visible) return;
if (element && element.tagName) {
const unobserve = observe(element, (isVisible)=>isVisible && setVisible(isVisible), {
root: rootRef == null ? void 0 : rootRef.current,
rootMargin
});
return unobserve;
}
} else {
if (!visible) {
const idleCallback = (0, _requestIdleCallback).requestIdleCallback(()=>setVisible(true));
return ()=>(0, _requestIdleCallback).cancelIdleCallback(idleCallback);
}
}
}, [
element,
isDisabled,
rootMargin,
rootRef,
visible
]);
const resetVisible = (0, _react).useCallback(()=>{
setVisible(false);
}, []);
return [
setElement,
visible,
resetVisible
];
}
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=use-intersection.js.map`@M<><4D><EFBFBD>N<><4E><EFBFBD>3<><33><EFBFBD>O<><4F><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>P<><50><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>IntersectionObserver<16><><EFBFBD><EFBFBD><EFBFBD>Map<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>S<><53><EFBFBD><EFBFBD>id<69>root<6F>margin<15><>existing<6E>find<6E>obj<62>instance<63>get<65>elements<74>observer<65>entriesv<><76><EFBFBD><EFBFBD>entry<72>callbackQ<><51><EFBFBD><15><>isIntersecting<6E>intersectionRatio<69>push<73>set<16><><EFBFBD><EFBFBD><EFBFBD>element<6E>unobserve<76>delete<12><><EFBFBD><EFBFBD>disconnect<63>index<65>findIndex<65>splice<63>rootRef<65>disabled<65>isDisabled<65>visible<6C>setVisible<6C>useState<74>setElement<15><>tagNamel<><6C><EFBFBD><EFBFBD>idleCallbackB<><42><EFBFBD>C<><43><EFBFBD><15><15><11><><EFBFBD> <0C><><EFBFBD><15>o<><6F><EFBFBD><15>h<><68><EFBFBD><14><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/SourceMapSource<10><1F>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addBasePath = addBasePath;
var _addPathPrefix = require("../shared/lib/router/utils/add-path-prefix");
var _normalizeTrailingSlash = require("./normalize-trailing-slash");
const basePath = process.env.__NEXT_ROUTER_BASEPATH || "";
function addBasePath(path, required) {
if (process.env.__NEXT_MANUAL_CLIENT_BASE_PATH) {
if (!required) {
return path;
}
}
return (0, _normalizeTrailingSlash).normalizePathTrailingSlash((0, _addPathPrefix).addPathPrefix(path, basePath));
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=add-base-path.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/add-base-path.js|{"version":3,"sources":["webpack://./node_modules/next/dist/client/add-base-path.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.addBasePath = addBasePath;\nvar _addPathPrefix = require(\"../shared/lib/router/utils/add-path-prefix\");\nvar _normalizeTrailingSlash = require(\"./normalize-trailing-slash\");\nconst basePath = process.env.__NEXT_ROUTER_BASEPATH || '';\nfunction addBasePath(path, required) {\n if (process.env.__NEXT_MANUAL_CLIENT_BASE_PATH) {\n if (!required) {\n return path;\n }\n }\n return (0, _normalizeTrailingSlash).normalizePathTrailingSlash((0, _addPathPrefix).addPathPrefix(path, basePath));\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=add-base-path.js.map"],"names":["Object","defineProperty","exports","value","addBasePath","_addPathPrefix","require","_normalizeTrailingSlash","basePath","process","env","__NEXT_ROUTER_BASEPATH","path","required","__NEXT_MANUAL_CLIENT_BASE_PATH","normalizePathTrailingSlash","addPathPrefix","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,WAAW,GAAGA;AACtB,IAAIC,iBAAiBC,QAAQ;AAC7B,IAAIC,0BAA0BD,QAAQ;AACtC,MAAME,WAAWC,QAAQC,GAAG,CAACC,sBAAsB,IAAI;AACvD,SAASP,YAAYQ,IAAI,EAAEC,QAAQ,EAAE;IACjC,IAAIJ,QAAQC,GAAG,CAACI,8BAA8B,EAAE;QAC5C,IAAI,CAACD,UAAU;YACX,OAAOD;QACX,CAAC;IACL,CAAC;IACD,OAAO,AAAC,CAAA,GAAGL,uBAAuB,AAAD,EAAGQ,0BAA0B,CAAC,AAAC,CAAA,GAAGV,cAAc,AAAD,EAAGW,aAAa,CAACJ,MAAMJ;AAC3G;AAEA,IAAI,AAAC,CAAA,OAAON,QAAQe,OAAO,KAAK,cAAe,OAAOf,QAAQe,OAAO,KAAK,YAAYf,QAAQe,OAAO,KAAK,IAAI,KAAM,OAAOf,QAAQe,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKlB,OAAOC,cAAc,CAACC,QAAQe,OAAO,EAAE,cAAc;QAAEd,OAAO,IAAI;IAAC;IACnEH,OAAOmB,MAAM,CAACjB,QAAQe,OAAO,EAAEf;IAC/BkB,OAAOlB,OAAO,GAAGA,QAAQe,OAAO;AAClC,CAAC,CAED,yCAAyC","file":"x"}h :NNQcM<63><00><00><00><00><00><00>7o<00><00><00><00><18>Object.defineProperty(exports, "__esModule", (<18>))<18>exports.addBasePath<18>__webpack_require__<18>/*! ../shared/lib/router/utils/add-path-prefix */ "../shared/lib/router/utils/add-path-prefix"<15><18>/*! ./normalize-trailing-slash */ "./node_modules/next/dist/client/normalize-trailing-slash.js"<18> false<18>false<18>{}<16><><EFBFBD><EFBFBD><1F>
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.addBasePath = addBasePath;
var _addPathPrefix = __webpack_require__(/*! ../shared/lib/router/utils/add-path-prefix */ "../shared/lib/router/utils/add-path-prefix");
var _normalizeTrailingSlash = __webpack_require__(/*! ./normalize-trailing-slash */ "./node_modules/next/dist/client/normalize-trailing-slash.js");
const basePath = false || "";
function addBasePath(path, required) {
if (false) {}
return (0, _normalizeTrailingSlash).normalizePathTrailingSlash((0, _addPathPrefix).addPathPrefix(path, basePath));
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=add-base-path.js.map
<16><><EFBFBD><EFBFBD><02><><EFBFBD><06><><EFBFBD><03>x~AAAa;AACbA,8CAA6C;IACzCG,OAAO,IAAI;AACf,CAAC,EAAC;AACFD,mBAAmB,GAAGE;AACtB,IAAIC,iBAAiBC,mBAAOA,CAAC,8FAA4C;AACzE,IAAIC,0BAA0BD,mBAAOA,CAAC,+FAA4B;AAClE,MAAME,WAAWC,MAAkC,IAAI;AACvD,SAASL,YAAYQ,IAAI,EAAEC,QAAQ,EAAE;IACjC,IAAIJ,KAA0C,EAAE,EAI/C;IACD,OAAO,CAAC,GAAGF,uBAAuB,EAAEQ,0BAA0B,CAAC,CAAC,GAAGV,cAAc,EAAEW,aAAa,CAACJ,MAAMJ;AAC3G;AAEA,IAAI,CAAC,OAAON,QAAQe,OAAO,KAAK,cAAe,OAAOf,QAAQe,OAAO,KAAK,YAAYf,QAAQe,OAAO,KAAK,IAAI,KAAM,OAAOf,QAAQe,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKlB,OAAOC,cAAc,CAACC,QAAQe,OAAO,EAAE,cAAc;QAAEd,OAAO,IAAI;IAAC;IACnEH,OAAOmB,MAAM,CAACjB,QAAQe,OAAO,EAAEf;IAC/BkB,OAAOlB,OAAO,GAAGA,QAAQe,OAAO;AAClC,CAAC,CAED,yCAAyC<01>webpack://./node_modules/next/dist/client/add-base-path.js<1F>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addBasePath = addBasePath;
var _addPathPrefix = require("../shared/lib/router/utils/add-path-prefix");
var _normalizeTrailingSlash = require("./normalize-trailing-slash");
const basePath = process.env.__NEXT_ROUTER_BASEPATH || '';
function addBasePath(path, required) {
if (process.env.__NEXT_MANUAL_CLIENT_BASE_PATH) {
if (!required) {
return path;
}
}
return (0, _normalizeTrailingSlash).normalizePathTrailingSlash((0, _addPathPrefix).addPathPrefix(path, basePath));
}
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=add-base-path.js.map`<1B><><EFBFBD><1C><><EFBFBD><01><><EFBFBD><1D><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><1E><><EFBFBD><16><><EFBFBD><EFBFBD>><3E><><EFBFBD>c<><63><EFBFBD>f<><66><EFBFBD><15>j<><6A><EFBFBD><EFBFBD>required<65>__NEXT_MANUAL_CLIENT_BASE_PATH<16><><EFBFBD><EFBFBD><EFBFBD>addPathPrefix<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><15>]<5D><><EFBFBD><15>V<><56><EFBFBD><02><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>Cmodule.exports = require("next/dist/shared/lib/router-context.js");<3B>external commonjs "next/dist/shared/lib/router-context.js"<03><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>Gmodule.exports = require("next/dist/shared/lib/app-router-context.js");<3B>external commonjs "next/dist/shared/lib/app-router-context.js"<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <00><><10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/SourceMapSource<10><1F>L"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.matchesMiddleware = matchesMiddleware;
exports.isLocalURL = isLocalURL;
exports.interpolateAs = interpolateAs;
exports.resolveHref = resolveHref;
exports.createKey = createKey;
exports.default = void 0;
var _async_to_generator = require("@swc/helpers/lib/_async_to_generator.js").default;
var _extends = require("@swc/helpers/lib/_extends.js").default;
var _interop_require_default = require("@swc/helpers/lib/_interop_require_default.js").default;
var _interop_require_wildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
var _normalizeTrailingSlash = require("../../../client/normalize-trailing-slash");
var _removeTrailingSlash = require("./utils/remove-trailing-slash");
var _routeLoader = require("../../../client/route-loader");
var _script = require("../../../client/script");
var _isError = _interop_require_wildcard(require("../../../lib/is-error"));
var _denormalizePagePath = require("../page-path/denormalize-page-path");
var _normalizeLocalePath = require("../i18n/normalize-locale-path");
var _mitt = _interop_require_default(require("../mitt"));
var _utils = require("../utils");
var _isDynamic = require("./utils/is-dynamic");
var _parseRelativeUrl = require("./utils/parse-relative-url");
var _querystring = require("./utils/querystring");
var _resolveRewrites = _interop_require_default(require("./utils/resolve-rewrites"));
var _routeMatcher = require("./utils/route-matcher");
var _routeRegex = require("./utils/route-regex");
var _formatUrl = require("./utils/format-url");
var _detectDomainLocale = require("../../../client/detect-domain-locale");
var _parsePath = require("./utils/parse-path");
var _addLocale = require("../../../client/add-locale");
var _removeLocale = require("../../../client/remove-locale");
var _removeBasePath = require("../../../client/remove-base-path");
var _addBasePath = require("../../../client/add-base-path");
var _hasBasePath = require("../../../client/has-base-path");
var _isApiRoute = require("../../../lib/is-api-route");
var _getNextPathnameInfo = require("./utils/get-next-pathname-info");
var _formatNextPathnameInfo = require("./utils/format-next-pathname-info");
var _compareStates = require("./utils/compare-states");
var _isBot = require("./utils/is-bot");
function buildCancellationError() {
return Object.assign(new Error("Route Cancelled"), {
cancelled: true
});
}
function matchesMiddleware(options) {
return _matchesMiddleware.apply(this, arguments);
}
function _matchesMiddleware() {
_matchesMiddleware = _async_to_generator(function*(options) {
const matchers = yield Promise.resolve(options.router.pageLoader.getMiddleware());
if (!matchers) return false;
const { pathname: asPathname } = (0, _parsePath).parsePath(options.asPath);
// remove basePath first since path prefix has to be in the order of `/${basePath}/${locale}`
const cleanedAs = (0, _hasBasePath).hasBasePath(asPathname) ? (0, _removeBasePath).removeBasePath(asPathname) : asPathname;
const asWithBasePathAndLocale = (0, _addBasePath).addBasePath((0, _addLocale).addLocale(cleanedAs, options.locale));
// Check only path match on client. Matching "has" should be done on server
// where we can access more info such as headers, HttpOnly cookie, etc.
return matchers.some((m)=>new RegExp(m.regexp).test(asWithBasePathAndLocale));
});
return _matchesMiddleware.apply(this, arguments);
}
function stripOrigin(url) {
const origin = (0, _utils).getLocationOrigin();
return url.startsWith(origin) ? url.substring(origin.length) : url;
}
function omit(object, keys) {
const omitted = {};
Object.keys(object).forEach((key)=>{
if (!keys.includes(key)) {
omitted[key] = object[key];
}
});
return omitted;
}
function isLocalURL(url) {
// prevent a hydration mismatch on href for url with anchor refs
if (!(0, _utils).isAbsoluteUrl(url)) return true;
try {
// absolute urls can be local if they are on the same origin
const locationOrigin = (0, _utils).getLocationOrigin();
const resolved = new URL(url, locationOrigin);
return resolved.origin === locationOrigin && (0, _hasBasePath).hasBasePath(resolved.pathname);
} catch (_) {
return false;
}
}
function interpolateAs(route, asPathname, query) {
let interpolatedRoute = "";
const dynamicRegex = (0, _routeRegex).getRouteRegex(route);
const dynamicGroups = dynamicRegex.groups;
const dynamicMatches = (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;
const params = Object.keys(dynamicGroups);
if (!params.every((param)=>{
let value = dynamicMatches[param] || "";
const { repeat , optional } = dynamicGroups[param];
// support single-level catch-all
// TODO: more robust handling for user-error (passing `/`)
let replaced = `[${repeat ? "..." : ""}${param}]`;
if (optional) {
replaced = `${!value ? "/" : ""}[${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(// path delimiter escaped since they are being inserted
// into the URL and we expect URL encoded segments
// when parsing dynamic route params
(segment)=>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 `<Link>` component directly.
}
return {
params,
result: interpolatedRoute
};
}
function resolveHref(router, href, resolveAs) {
// we use a dummy base url for relative urls
let base;
let urlAsString = typeof href === "string" ? href : (0, _formatUrl).formatWithValidation(href);
// repeated slashes and backslashes in the URL are considered
// invalid and will never match a Next.js page/file
const urlProtoMatch = urlAsString.match(/^[a-zA-Z]{1,}:\/\//);
const urlAsStringNoProto = urlProtoMatch ? urlAsString.slice(urlProtoMatch[0].length) : urlAsString;
const urlParts = urlAsStringNoProto.split("?");
if ((urlParts[0] || "").match(/(\/\/|\\)/)) {
console.error(`Invalid href passed to next/router: ${urlAsString}, repeated forward-slashes (//) or backslashes \\ are not valid in the href`);
const normalizedUrl = (0, _utils).normalizeRepeatedSlashes(urlAsStringNoProto);
urlAsString = (urlProtoMatch ? urlProtoMatch[0] : "") + normalizedUrl;
}
// Return because it cannot be routed by the Next.js router
if (!isLocalURL(urlAsString)) {
return resolveAs ? [
urlAsString
] : urlAsString;
}
try {
base = new URL(urlAsString.startsWith("#") ? router.asPath : router.pathname, "http://n");
} catch (_) {
// fallback to / for invalid asPath values e.g. //
base = new URL("/", "http://n");
}
try {
const finalUrl = new URL(urlAsString, base);
finalUrl.pathname = (0, _normalizeTrailingSlash).normalizePathTrailingSlash(finalUrl.pathname);
let interpolatedAs = "";
if ((0, _isDynamic).isDynamicRoute(finalUrl.pathname) && finalUrl.searchParams && resolveAs) {
const query = (0, _querystring).searchParamsToUrlQuery(finalUrl.searchParams);
const { result , params } = interpolateAs(finalUrl.pathname, finalUrl.pathname, query);
if (result) {
interpolatedAs = (0, _formatUrl).formatWithValidation({
pathname: result,
hash: finalUrl.hash,
query: omit(query, params)
});
}
}
// if the origin didn't change, it means we received a relative href
const resolvedHref = finalUrl.origin === base.origin ? finalUrl.href.slice(finalUrl.origin.length) : finalUrl.href;
return resolveAs ? [
resolvedHref,
interpolatedAs || resolvedHref
] : resolvedHref;
} catch (_1) {
return resolveAs ? [
urlAsString
] : urlAsString;
}
}
function prepareUrlAs(router, url, as) {
// If url and as provided as an object representation,
// we'll format them into the string version here.
let [resolvedHref, resolvedAs] = resolveHref(router, url, true);
const origin = (0, _utils).getLocationOrigin();
const hrefWasAbsolute = resolvedHref.startsWith(origin);
const asWasAbsolute = resolvedAs && resolvedAs.startsWith(origin);
resolvedHref = stripOrigin(resolvedHref);
resolvedAs = resolvedAs ? stripOrigin(resolvedAs) : resolvedAs;
const preparedUrl = hrefWasAbsolute ? resolvedHref : (0, _addBasePath).addBasePath(resolvedHref);
const preparedAs = as ? stripOrigin(resolveHref(router, as)) : resolvedAs || resolvedHref;
return {
url: preparedUrl,
as: asWasAbsolute ? preparedAs : (0, _addBasePath).addBasePath(preparedAs)
};
}
function resolveDynamicRoute(pathname, pages) {
const cleanPathname = (0, _removeTrailingSlash).removeTrailingSlash((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((page)=>{
if ((0, _isDynamic).isDynamicRoute(page) && (0, _routeRegex).getRouteRegex(page).re.test(cleanPathname)) {
pathname = page;
return true;
}
});
}
return (0, _removeTrailingSlash).removeTrailingSlash(pathname);
}
function getMiddlewareData(source, response, options) {
const nextConfig = {
basePath: options.router.basePath,
i18n: {
locales: options.router.locales
},
trailingSlash: Boolean(process.env.__NEXT_TRAILING_SLASH)
};
const rewriteHeader = response.headers.get("x-nextjs-rewrite");
let rewriteTarget = rewriteHeader || response.headers.get("x-nextjs-matched-path");
const matchedPath = response.headers.get("x-matched-path");
if (matchedPath && !rewriteTarget && !matchedPath.includes("__next_data_catchall") && !matchedPath.includes("/_error") && !matchedPath.includes("/404")) {
// leverage x-matched-path to detect next.config.js rewrites
rewriteTarget = matchedPath;
}
if (rewriteTarget) {
if (rewriteTarget.startsWith("/")) {
const parsedRewriteTarget = (0, _parseRelativeUrl).parseRelativeUrl(rewriteTarget);
const pathnameInfo = (0, _getNextPathnameInfo).getNextPathnameInfo(parsedRewriteTarget.pathname, {
nextConfig,
parseData: true
});
let fsPathname = (0, _removeTrailingSlash).removeTrailingSlash(pathnameInfo.pathname);
return Promise.all([
options.router.pageLoader.getPageList(),
(0, _routeLoader).getClientBuildManifest()
]).then(([pages, { __rewrites: rewrites }])=>{
let as = (0, _addLocale).addLocale(pathnameInfo.pathname, pathnameInfo.locale);
if ((0, _isDynamic).isDynamicRoute(as) || !rewriteHeader && pages.includes((0, _normalizeLocalePath).normalizeLocalePath((0, _removeBasePath).removeBasePath(as), options.router.locales).pathname)) {
const parsedSource = (0, _getNextPathnameInfo).getNextPathnameInfo((0, _parseRelativeUrl).parseRelativeUrl(source).pathname, {
parseData: true
});
as = (0, _addBasePath).addBasePath(parsedSource.pathname);
parsedRewriteTarget.pathname = as;
}
if (process.env.__NEXT_HAS_REWRITES) {
const result = (0, _resolveRewrites).default(as, pages, rewrites, parsedRewriteTarget.query, (path)=>resolveDynamicRoute(path, pages), options.router.locales);
if (result.matchedPage) {
parsedRewriteTarget.pathname = result.parsedAs.pathname;
as = parsedRewriteTarget.pathname;
Object.assign(parsedRewriteTarget.query, result.parsedAs.query);
}
} else if (!pages.includes(fsPathname)) {
const resolvedPathname = resolveDynamicRoute(fsPathname, pages);
if (resolvedPathname !== fsPathname) {
fsPathname = resolvedPathname;
}
}
const resolvedHref = !pages.includes(fsPathname) ? resolveDynamicRoute((0, _normalizeLocalePath).normalizeLocalePath((0, _removeBasePath).removeBasePath(parsedRewriteTarget.pathname), options.router.locales).pathname, pages) : fsPathname;
if ((0, _isDynamic).isDynamicRoute(resolvedHref)) {
const matches = (0, _routeMatcher).getRouteMatcher((0, _routeRegex).getRouteRegex(resolvedHref))(as);
Object.assign(parsedRewriteTarget.query, matches || {});
}
return {
type: "rewrite",
parsedAs: parsedRewriteTarget,
resolvedHref
};
});
}
const src = (0, _parsePath).parsePath(source);
const pathname = (0, _formatNextPathnameInfo).formatNextPathnameInfo(_extends({}, (0, _getNextPathnameInfo).getNextPathnameInfo(src.pathname, {
nextConfig,
parseData: true
}), {
defaultLocale: options.router.defaultLocale,
buildId: ""
}));
return Promise.resolve({
type: "redirect-external",
destination: `${pathname}${src.query}${src.hash}`
});
}
const redirectTarget = response.headers.get("x-nextjs-redirect");
if (redirectTarget) {
if (redirectTarget.startsWith("/")) {
const src1 = (0, _parsePath).parsePath(redirectTarget);
const pathname1 = (0, _formatNextPathnameInfo).formatNextPathnameInfo(_extends({}, (0, _getNextPathnameInfo).getNextPathnameInfo(src1.pathname, {
nextConfig,
parseData: true
}), {
defaultLocale: options.router.defaultLocale,
buildId: ""
}));
return Promise.resolve({
type: "redirect-internal",
newAs: `${pathname1}${src1.query}${src1.hash}`,
newUrl: `${pathname1}${src1.query}${src1.hash}`
});
}
return Promise.resolve({
type: "redirect-external",
destination: redirectTarget
});
}
return Promise.resolve({
type: "next"
});
}
function withMiddlewareEffects(options) {
return _withMiddlewareEffects.apply(this, arguments);
}
function _withMiddlewareEffects() {
_withMiddlewareEffects = _async_to_generator(function*(options) {
const matches = yield matchesMiddleware(options);
if (!matches || !options.fetchData) {
return null;
}
try {
const data = yield options.fetchData();
const effect = yield getMiddlewareData(data.dataHref, data.response, options);
return {
dataHref: data.dataHref,
json: data.json,
response: data.response,
text: data.text,
cacheKey: data.cacheKey,
effect
};
} catch (e) {
/**
* TODO: Revisit this in the future.
* For now we will not consider middleware data errors to be fatal.
* maybe we should revisit in the future.
*/ return null;
}
});
return _withMiddlewareEffects.apply(this, arguments);
}
const manualScrollRestoration = process.env.__NEXT_SCROLL_RESTORATION && "undefined" !== "undefined" && "scrollRestoration" in window.history && !!function() {
try {
let v = "__next";
// eslint-disable-next-line no-sequences
return sessionStorage.setItem(v, v), sessionStorage.removeItem(v), true;
} catch (n) {}
}();
const SSG_DATA_NOT_FOUND = Symbol("SSG_DATA_NOT_FOUND");
function fetchRetry(url, attempts, options) {
return fetch(url, {
// Cookies are required to be present for Next.js' SSG "Preview Mode".
// Cookies may also be required for `getServerSideProps`.
//
// > `fetch` wont 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",
method: options.method || "GET",
headers: Object.assign({}, options.headers, {
"x-nextjs-data": "1"
})
}).then((response)=>{
return !response.ok && attempts > 1 && response.status >= 500 ? fetchRetry(url, attempts - 1, options) : response;
});
}
function handleSmoothScroll(fn) {
const htmlElement = document.documentElement;
const existing = htmlElement.style.scrollBehavior;
htmlElement.style.scrollBehavior = "auto";
// In Chrome-based browsers we need to force reflow before calling `scrollTo`.
// Otherwise it will not pickup the change in scrollBehavior
// More info here: https://github.com/vercel/next.js/issues/40719#issuecomment-1336248042
htmlElement.getClientRects();
fn();
htmlElement.style.scrollBehavior = existing;
}
function tryToParseAsJSON(text) {
try {
return JSON.parse(text);
} catch (error) {
return null;
}
}
function fetchNextData({ dataHref , inflightCache , isPrefetch , hasMiddleware , isServerRender , parseJSON , persistCache , isBackground , unstable_skipClientCache }) {
const { href: cacheKey } = new URL(dataHref, window.location.href);
var ref1;
const getData = (params)=>{
return fetchRetry(dataHref, isServerRender ? 3 : 1, {
headers: Object.assign({}, isPrefetch ? {
purpose: "prefetch"
} : {}, isPrefetch && hasMiddleware ? {
"x-middleware-prefetch": "1"
} : {}),
method: (ref1 = params == null ? void 0 : params.method) != null ? ref1 : "GET"
}).then((response)=>{
if (response.ok && (params == null ? void 0 : params.method) === "HEAD") {
return {
dataHref,
response,
text: "",
json: {},
cacheKey
};
}
return response.text().then((text)=>{
if (!response.ok) {
/**
* When the data response is a redirect because of a middleware
* we do not consider it an error. The headers must bring the
* mapped location.
* TODO: Change the status code in the handler.
*/ if (hasMiddleware && [
301,
302,
307,
308
].includes(response.status)) {
return {
dataHref,
response,
text,
json: {},
cacheKey
};
}
if (!hasMiddleware && response.status === 404) {
var ref;
if ((ref = tryToParseAsJSON(text)) == null ? void 0 : ref.notFound) {
return {
dataHref,
json: {
notFound: SSG_DATA_NOT_FOUND
},
response,
text,
cacheKey
};
}
}
const error = new Error(`Failed to load static props`);
/**
* 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(error);
}
throw error;
}
return {
dataHref,
json: parseJSON ? tryToParseAsJSON(text) : null,
response,
text,
cacheKey
};
});
}).then((data)=>{
if (!persistCache || "development" !== "production" || data.response.headers.get("x-middleware-cache") === "no-cache") {
delete inflightCache[cacheKey];
}
return data;
}).catch((err)=>{
if (!unstable_skipClientCache) {
delete inflightCache[cacheKey];
}
if (err.message === "Failed to fetch") {
(0, _routeLoader).markAssetError(err);
}
throw err;
});
};
// when skipping client cache we wait to update
// inflight cache until successful data response
// this allows racing click event with fetching newer data
// without blocking navigation when stale data is available
if (unstable_skipClientCache && persistCache) {
return getData({}).then((data)=>{
inflightCache[cacheKey] = Promise.resolve(data);
return data;
});
}
if (inflightCache[cacheKey] !== undefined) {
return inflightCache[cacheKey];
}
return inflightCache[cacheKey] = getData(isBackground ? {
method: "HEAD"
} : {});
}
function createKey() {
return Math.random().toString(36).slice(2, 10);
}
function handleHardNavigation({ url , router }) {
// ensure we don't trigger a hard navigation to the same
// URL as this can end up with an infinite refresh
if (url === (0, _addBasePath).addBasePath((0, _addLocale).addLocale(router.asPath, router.locale))) {
throw new Error(`Invariant: attempted to hard navigate to the same URL ${url} ${location.href}`);
}
window.location.href = url;
}
const getCancelledHandler = ({ route , router })=>{
let cancelled = false;
const cancel = router.clc = ()=>{
cancelled = true;
};
const handleCancelled = ()=>{
if (cancelled) {
const error = new Error(`Abort fetching component for route: "${route}"`);
error.cancelled = true;
throw error;
}
if (cancel === router.clc) {
router.clc = null;
}
};
return handleCancelled;
};
class Router {
reload() {
window.location.reload();
}
/**
* Go back in history
*/ back() {
window.history.back();
}
/**
* Go forward in history
*/ forward() {
window.history.forward();
}
/**
* 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
*/ push(url, as, options = {}) {
if (process.env.__NEXT_SCROLL_RESTORATION) {
// TODO: remove in the future when we update history before route change
// is complete, as the popstate event should handle this capture.
if (manualScrollRestoration) {
try {
// Snapshot scroll position right before navigating to a new page:
sessionStorage.setItem("__next_scroll_" + this._key, JSON.stringify({
x: self.pageXOffset,
y: self.pageYOffset
}));
} catch (e) {}
}
}
({ url , as } = prepareUrlAs(this, url, 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
*/ replace(url, as, options = {}) {
({ url , as } = prepareUrlAs(this, url, as));
return this.change("replaceState", url, as, options);
}
change(method, url, as, options, forcedScroll) {
var _this = this;
return _async_to_generator(function*() {
if (!isLocalURL(url)) {
handleHardNavigation({
url,
router: _this
});
return false;
}
// 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.
const isQueryUpdating = options._h === 1;
let shouldResolveHref = isQueryUpdating || options._shouldResolveHref || (0, _parsePath).parsePath(url).pathname === (0, _parsePath).parsePath(as).pathname;
const nextState = _extends({}, _this.state);
// for static pages with query params in the URL we delay
// marking the router ready until after the query is updated
// or a navigation has occurred
const readyStateChange = _this.isReady !== true;
_this.isReady = true;
const isSsr = _this.isSsr;
if (!isQueryUpdating) {
_this.isSsr = false;
}
// if a route transition is already in progress before
// the query updating is triggered ignore query updating
if (isQueryUpdating && _this.clc) {
return false;
}
const prevLocale = nextState.locale;
if (process.env.__NEXT_I18N_SUPPORT) {
nextState.locale = options.locale === false ? _this.defaultLocale : options.locale || nextState.locale;
if (typeof options.locale === "undefined") {
options.locale = nextState.locale;
}
const parsedAs = (0, _parseRelativeUrl).parseRelativeUrl((0, _hasBasePath).hasBasePath(as) ? (0, _removeBasePath).removeBasePath(as) : as);
const localePathResult = (0, _normalizeLocalePath).normalizeLocalePath(parsedAs.pathname, _this.locales);
if (localePathResult.detectedLocale) {
nextState.locale = localePathResult.detectedLocale;
parsedAs.pathname = (0, _addBasePath).addBasePath(parsedAs.pathname);
as = (0, _formatUrl).formatWithValidation(parsedAs);
url = (0, _addBasePath).addBasePath((0, _normalizeLocalePath).normalizeLocalePath((0, _hasBasePath).hasBasePath(url) ? (0, _removeBasePath).removeBasePath(url) : url, _this.locales).pathname);
}
let 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 (process.env.__NEXT_I18N_SUPPORT) {
var ref;
// if the locale isn't configured hard navigate to show 404 page
if (!((ref = _this.locales) == null ? void 0 : ref.includes(nextState.locale))) {
parsedAs.pathname = (0, _addLocale).addLocale(parsedAs.pathname, nextState.locale);
handleHardNavigation({
url: (0, _formatUrl).formatWithValidation(parsedAs),
router: _this
});
// this was previously a return but was removed in favor
// of better dead code elimination with regenerator runtime
didNavigate = true;
}
}
const detectedDomain = (0, _detectDomainLocale).detectDomainLocale(_this.domainLocales, undefined, nextState.locale);
// we need to wrap this in the env check again since regenerator runtime
// moves this on its own due to the return
if (process.env.__NEXT_I18N_SUPPORT) {
// 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) {
const asNoBasePath = (0, _removeBasePath).removeBasePath(as);
handleHardNavigation({
url: `http${detectedDomain.http ? "" : "s"}://${detectedDomain.domain}${(0, _addBasePath).addBasePath(`${nextState.locale === detectedDomain.defaultLocale ? "" : `/${nextState.locale}`}${asNoBasePath === "/" ? "" : asNoBasePath}` || "/")}`,
router: _this
});
// this was previously a return but was removed in favor
// of better dead code elimination with regenerator runtime
didNavigate = true;
}
}
if (didNavigate) {
return new Promise(()=>{});
}
}
// marking route changes as a navigation start entry
if (_utils.ST) {
performance.mark("routeChange");
}
const { shallow =false , scroll =true } = options;
const routeProps = {
shallow
};
if (_this._inFlightRoute && _this.clc) {
if (!isSsr) {
Router.events.emit("routeChangeError", buildCancellationError(), _this._inFlightRoute, routeProps);
}
_this.clc();
_this.clc = null;
}
as = (0, _addBasePath).addBasePath((0, _addLocale).addLocale((0, _hasBasePath).hasBasePath(as) ? (0, _removeBasePath).removeBasePath(as) : as, options.locale, _this.defaultLocale));
const cleanedAs = (0, _removeLocale).removeLocale((0, _hasBasePath).hasBasePath(as) ? (0, _removeBasePath).removeBasePath(as) : as, nextState.locale);
_this._inFlightRoute = as;
const localeChange = prevLocale !== nextState.locale;
// If the url change is only related to a hash change
// We should not proceed. We should only change the state.
if (!isQueryUpdating && _this.onlyAHashChange(cleanedAs) && !localeChange) {
nextState.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, _extends({}, options, {
scroll: false
}));
if (scroll) {
_this.scrollToHash(cleanedAs);
}
try {
yield _this.set(nextState, _this.components[nextState.route], null);
} catch (err) {
if ((0, _isError).default(err) && err.cancelled) {
Router.events.emit("routeChangeError", err, cleanedAs, routeProps);
}
throw err;
}
Router.events.emit("hashChangeComplete", as, routeProps);
return true;
}
let parsed = (0, _parseRelativeUrl).parseRelativeUrl(url);
let { pathname , query } = parsed;
// 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
let pages, rewrites;
try {
[pages, { __rewrites: rewrites }] = yield Promise.all([
_this.pageLoader.getPageList(),
(0, _routeLoader).getClientBuildManifest(),
_this.pageLoader.getMiddleware()
]);
} catch (err1) {
// If we fail to resolve the page list or client-build manifest, we must
// do a server-side transition:
handleHardNavigation({
url: as,
router: _this
});
return false;
}
// 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
let 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, _removeTrailingSlash).removeTrailingSlash((0, _removeBasePath).removeBasePath(pathname)) : pathname;
let route = (0, _removeTrailingSlash).removeTrailingSlash(pathname);
const parsedAsPathname = as.startsWith("/") && (0, _parseRelativeUrl).parseRelativeUrl(as).pathname;
const isMiddlewareRewrite = !!(parsedAsPathname && route !== parsedAsPathname && (!(0, _isDynamic).isDynamicRoute(route) || !(0, _routeMatcher).getRouteMatcher((0, _routeRegex).getRouteRegex(route))(parsedAsPathname)));
// we don't attempt resolve asPath when we need to execute
// middleware as the resolving will occur server-side
const isMiddlewareMatch = !options.shallow && (yield matchesMiddleware({
asPath: as,
locale: nextState.locale,
router: _this
}));
if (isQueryUpdating && isMiddlewareMatch) {
shouldResolveHref = false;
}
if (shouldResolveHref && pathname !== "/_error") {
options._shouldResolveHref = true;
if (process.env.__NEXT_HAS_REWRITES && as.startsWith("/")) {
const rewritesResult = (0, _resolveRewrites).default((0, _addBasePath).addBasePath((0, _addLocale).addLocale(cleanedAs, nextState.locale), true), pages, rewrites, query, (p)=>resolveDynamicRoute(p, pages), _this.locales);
if (rewritesResult.externalDest) {
handleHardNavigation({
url: as,
router: _this
});
return true;
}
if (!isMiddlewareMatch) {
resolvedAs = rewritesResult.asPath;
}
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 = (0, _addBasePath).addBasePath(pathname);
if (!isMiddlewareMatch) {
url = (0, _formatUrl).formatWithValidation(parsed);
}
}
} else {
parsed.pathname = resolveDynamicRoute(pathname, pages);
if (parsed.pathname !== pathname) {
pathname = parsed.pathname;
parsed.pathname = (0, _addBasePath).addBasePath(pathname);
if (!isMiddlewareMatch) {
url = (0, _formatUrl).formatWithValidation(parsed);
}
}
}
}
if (!isLocalURL(as)) {
if ("development" !== "production") {
throw new Error(`Invalid href: "${url}" and as: "${as}", received relative href and external as` + `\nSee more info: https://nextjs.org/docs/messages/invalid-relative-url-external-as`);
}
handleHardNavigation({
url: as,
router: _this
});
return false;
}
resolvedAs = (0, _removeLocale).removeLocale((0, _removeBasePath).removeBasePath(resolvedAs), nextState.locale);
route = (0, _removeTrailingSlash).removeTrailingSlash(pathname);
let routeMatch = false;
if ((0, _isDynamic).isDynamicRoute(route)) {
const parsedAs1 = (0, _parseRelativeUrl).parseRelativeUrl(resolvedAs);
const asPathname = parsedAs1.pathname;
const routeRegex = (0, _routeRegex).getRouteRegex(route);
routeMatch = (0, _routeMatcher).getRouteMatcher(routeRegex)(asPathname);
const shouldInterpolate = route === asPathname;
const interpolatedAs = shouldInterpolate ? interpolateAs(route, asPathname, query) : {};
if (!routeMatch || shouldInterpolate && !interpolatedAs.result) {
const missingParams = Object.keys(routeRegex.groups).filter((param)=>!query[param] && !routeRegex.groups[param].optional);
if (missingParams.length > 0 && !isMiddlewareMatch) {
if ("development" !== "production") {
console.warn(`${shouldInterpolate ? `Interpolating href` : `Mismatching \`as\` and \`href\``} failed to manually provide ` + `the params: ${missingParams.join(", ")} in the \`href\`'s \`query\``);
}
throw new Error((shouldInterpolate ? `The provided \`href\` (${url}) value is missing query values (${missingParams.join(", ")}) to be interpolated properly. ` : `The provided \`as\` value (${asPathname}) is incompatible with the \`href\` value (${route}). `) + `Read more: https://nextjs.org/docs/messages/${shouldInterpolate ? "href-interpolation-failed" : "incompatible-href-as"}`);
}
} else if (shouldInterpolate) {
as = (0, _formatUrl).formatWithValidation(Object.assign({}, parsedAs1, {
pathname: interpolatedAs.result,
query: omit(query, interpolatedAs.params)
}));
} else {
// Merge params into `query`, overwriting any specified in search
Object.assign(query, routeMatch);
}
}
if (!isQueryUpdating) {
Router.events.emit("routeChangeStart", as, routeProps);
}
try {
var ref2, ref3, ref4;
let routeInfo = yield _this.getRouteInfo({
route,
pathname,
query,
as,
resolvedAs,
routeProps,
locale: nextState.locale,
isPreview: nextState.isPreview,
hasMiddleware: isMiddlewareMatch,
unstable_skipClientCache: options.unstable_skipClientCache,
isQueryUpdating: isQueryUpdating && !_this.isFallback,
isMiddlewareRewrite
});
if ("route" in routeInfo && isMiddlewareMatch) {
pathname = routeInfo.route || route;
route = pathname;
if (!routeProps.shallow) {
query = Object.assign({}, routeInfo.query || {}, query);
}
const cleanedParsedPathname = (0, _hasBasePath).hasBasePath(parsed.pathname) ? (0, _removeBasePath).removeBasePath(parsed.pathname) : parsed.pathname;
if (routeMatch && pathname !== cleanedParsedPathname) {
Object.keys(routeMatch).forEach((key)=>{
if (routeMatch && query[key] === routeMatch[key]) {
delete query[key];
}
});
}
if ((0, _isDynamic).isDynamicRoute(pathname)) {
const prefixedAs = !routeProps.shallow && routeInfo.resolvedAs ? routeInfo.resolvedAs : (0, _addBasePath).addBasePath((0, _addLocale).addLocale(new URL(as, location.href).pathname, nextState.locale), true);
let rewriteAs = prefixedAs;
if ((0, _hasBasePath).hasBasePath(rewriteAs)) {
rewriteAs = (0, _removeBasePath).removeBasePath(rewriteAs);
}
if (process.env.__NEXT_I18N_SUPPORT) {
const localeResult = (0, _normalizeLocalePath).normalizeLocalePath(rewriteAs, _this.locales);
nextState.locale = localeResult.detectedLocale || nextState.locale;
rewriteAs = localeResult.pathname;
}
const routeRegex1 = (0, _routeRegex).getRouteRegex(pathname);
const curRouteMatch = (0, _routeMatcher).getRouteMatcher(routeRegex1)(new URL(rewriteAs, location.href).pathname);
if (curRouteMatch) {
Object.assign(query, curRouteMatch);
}
}
}
// If the routeInfo brings a redirect we simply apply it.
if ("type" in routeInfo) {
if (routeInfo.type === "redirect-internal") {
return _this.change(method, routeInfo.newUrl, routeInfo.newAs, options);
} else {
handleHardNavigation({
url: routeInfo.destination,
router: _this
});
return new Promise(()=>{});
}
}
const component = routeInfo.Component;
if (component && component.unstable_scriptLoader) {
const scripts = [].concat(component.unstable_scriptLoader());
scripts.forEach((script)=>{
(0, _script).handleClientScriptLoad(script.props);
});
}
// handle redirect on client-transition
if ((routeInfo.__N_SSG || routeInfo.__N_SSP) && routeInfo.props) {
if (routeInfo.props.pageProps && routeInfo.props.pageProps.__N_REDIRECT) {
// Use the destination from redirect without adding locale
options.locale = false;
const destination = routeInfo.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("/") && routeInfo.props.pageProps.__N_REDIRECT_BASE_PATH !== false) {
const parsedHref = (0, _parseRelativeUrl).parseRelativeUrl(destination);
parsedHref.pathname = resolveDynamicRoute(parsedHref.pathname, pages);
const { url: newUrl , as: newAs } = prepareUrlAs(_this, destination, destination);
return _this.change(method, newUrl, newAs, options);
}
handleHardNavigation({
url: destination,
router: _this
});
return new Promise(()=>{});
}
nextState.isPreview = !!routeInfo.props.__N_PREVIEW;
// handle SSG data 404
if (routeInfo.props.notFound === SSG_DATA_NOT_FOUND) {
let notFoundRoute;
try {
yield _this.fetchComponent("/404");
notFoundRoute = "/404";
} catch (_) {
notFoundRoute = "/_error";
}
routeInfo = yield _this.getRouteInfo({
route: notFoundRoute,
pathname: notFoundRoute,
query,
as,
resolvedAs,
routeProps: {
shallow: false
},
locale: nextState.locale,
isPreview: nextState.isPreview
});
if ("type" in routeInfo) {
throw new Error(`Unexpected middleware effect on /404`);
}
}
}
if (isQueryUpdating && _this.pathname === "/_error" && ((ref2 = self.__NEXT_DATA__.props) == null ? void 0 : (ref3 = ref2.pageProps) == null ? void 0 : ref3.statusCode) === 500 && ((ref4 = routeInfo.props) == null ? void 0 : ref4.pageProps)) {
// ensure statusCode is still correct for static 500 page
// when updating query information
routeInfo.props.pageProps.statusCode = 500;
}
var _route;
// shallow routing is only allowed for same page URL changes.
const isValidShallowRoute = options.shallow && nextState.route === ((_route = routeInfo.route) != null ? _route : route);
var _scroll;
const shouldScroll = (_scroll = options.scroll) != null ? _scroll : !isQueryUpdating && !isValidShallowRoute;
const resetScroll = shouldScroll ? {
x: 0,
y: 0
} : null;
const upcomingScrollState = forcedScroll != null ? forcedScroll : resetScroll;
// the new state that the router gonna set
const upcomingRouterState = _extends({}, nextState, {
route,
pathname,
query,
asPath: cleanedAs,
isFallback: false
});
// When the page being rendered is the 404 page, we should only update the
// query parameters. Route changes here might add the basePath when it
// wasn't originally present. This is also why this block is before the
// below `changeState` call which updates the browser's history (changing
// the URL).
if (isQueryUpdating && (_this.pathname === "/404" || _this.pathname === "/_error")) {
var ref5, ref6, ref7;
routeInfo = yield _this.getRouteInfo({
route: _this.pathname,
pathname: _this.pathname,
query,
as,
resolvedAs,
routeProps: {
shallow: false
},
locale: nextState.locale,
isPreview: nextState.isPreview
});
if ("type" in routeInfo) {
throw new Error(`Unexpected middleware effect on ${_this.pathname}`);
}
if (_this.pathname === "/_error" && ((ref5 = self.__NEXT_DATA__.props) == null ? void 0 : (ref6 = ref5.pageProps) == null ? void 0 : ref6.statusCode) === 500 && ((ref7 = routeInfo.props) == null ? void 0 : ref7.pageProps)) {
// ensure statusCode is still correct for static 500 page
// when updating query information
routeInfo.props.pageProps.statusCode = 500;
}
try {
yield _this.set(upcomingRouterState, routeInfo, upcomingScrollState);
} catch (err2) {
if ((0, _isError).default(err2) && err2.cancelled) {
Router.events.emit("routeChangeError", err2, cleanedAs, routeProps);
}
throw err2;
}
return true;
}
Router.events.emit("beforeHistoryChange", as, routeProps);
_this.changeState(method, url, as, options);
// for query updates we can skip it if the state is unchanged and we don't
// need to scroll
// https://github.com/vercel/next.js/issues/37139
const canSkipUpdating = isQueryUpdating && !upcomingScrollState && !readyStateChange && !localeChange && (0, _compareStates).compareRouterStates(upcomingRouterState, _this.state);
if (!canSkipUpdating) {
try {
yield _this.set(upcomingRouterState, routeInfo, upcomingScrollState);
} catch (e) {
if (e.cancelled) routeInfo.error = routeInfo.error || e;
else throw e;
}
if (routeInfo.error) {
if (!isQueryUpdating) {
Router.events.emit("routeChangeError", routeInfo.error, cleanedAs, routeProps);
}
throw routeInfo.error;
}
if (process.env.__NEXT_I18N_SUPPORT) {
if (nextState.locale) {
document.documentElement.lang = nextState.locale;
}
}
if (!isQueryUpdating) {
Router.events.emit("routeChangeComplete", as, routeProps);
}
// A hash mark # is the optional last part of a URL
const hashRegex = /#.+$/;
if (shouldScroll && hashRegex.test(as)) {
_this.scrollToHash(as);
}
}
return true;
} catch (err11) {
if ((0, _isError).default(err11) && err11.cancelled) {
return false;
}
throw err11;
}
})();
}
changeState(method, url, as, options = {}) {
if ("development" !== "production") {
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.${method} is not available`);
return;
}
}
if (method !== "pushState" || (0, _utils).getURL() !== as) {
this._shallow = options.shallow;
window.history[method]({
url,
as,
options,
__N: true,
key: this._key = method !== "pushState" ? this._key : createKey()
}, // 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);
}
}
handleRouteInfoError(err, pathname, query, as, routeProps, loadErrorFail) {
var _this = this;
return _async_to_generator(function*() {
console.error(err);
if (err.cancelled) {
// bubble up cancellation errors
throw err;
}
if ((0, _routeLoader).isAssetError(err) || loadErrorFail) {
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.
handleHardNavigation({
url: as,
router: _this
});
// Changing the URL doesn't block executing the current code path.
// So let's throw a cancellation error stop the routing logic.
throw buildCancellationError();
}
try {
let props;
const { page: Component , styleSheets } = yield _this.fetchComponent("/_error");
const routeInfo = {
props,
Component,
styleSheets,
err,
error: err
};
if (!routeInfo.props) {
try {
routeInfo.props = yield _this.getInitialProps(Component, {
err,
pathname,
query
});
} catch (gipErr) {
console.error("Error in error page `getInitialProps`: ", gipErr);
routeInfo.props = {};
}
}
return routeInfo;
} catch (routeInfoErr) {
return _this.handleRouteInfoError((0, _isError).default(routeInfoErr) ? routeInfoErr : new Error(routeInfoErr + ""), pathname, query, as, routeProps, true);
}
})();
}
getRouteInfo({ route: requestedRoute , pathname , query , as , resolvedAs , routeProps , locale , hasMiddleware , isPreview , unstable_skipClientCache , isQueryUpdating , isMiddlewareRewrite }) {
var _this = this;
return _async_to_generator(function*() {
/**
* This `route` binding can change if there's a rewrite
* so we keep a reference to the original requested route
* so we can store the cache for it and avoid re-requesting every time
* for shallow routing purposes.
*/ let route = requestedRoute;
try {
var ref, ref8, ref9, ref10;
const handleCancelled = getCancelledHandler({
route,
router: _this
});
let existingInfo = _this.components[route];
if (routeProps.shallow && existingInfo && _this.route === route) {
return existingInfo;
}
if (hasMiddleware) {
existingInfo = undefined;
}
let cachedRouteInfo = existingInfo && !("initial" in existingInfo) && "development" !== "development" ? existingInfo : undefined;
const isBackground = isQueryUpdating;
const fetchNextDataParams = {
dataHref: _this.pageLoader.getDataHref({
href: (0, _formatUrl).formatWithValidation({
pathname,
query
}),
skipInterpolation: true,
asPath: resolvedAs,
locale
}),
hasMiddleware: true,
isServerRender: _this.isSsr,
parseJSON: true,
inflightCache: isBackground ? _this.sbc : _this.sdc,
persistCache: !isPreview,
isPrefetch: false,
unstable_skipClientCache,
isBackground
};
let data = isQueryUpdating && !isMiddlewareRewrite ? null : yield withMiddlewareEffects({
fetchData: ()=>fetchNextData(fetchNextDataParams),
asPath: resolvedAs,
locale: locale,
router: _this
}).catch((err)=>{
// we don't hard error during query updating
// as it's un-necessary and doesn't need to be fatal
// unless it is a fallback route and the props can't
// be loaded
if (isQueryUpdating) {
return null;
}
throw err;
});
if (isQueryUpdating) {
if (!data) {
data = {
json: self.__NEXT_DATA__.props
};
} else {
data.json = self.__NEXT_DATA__.props;
}
}
handleCancelled();
if ((data == null ? void 0 : (ref = data.effect) == null ? void 0 : ref.type) === "redirect-internal" || (data == null ? void 0 : (ref8 = data.effect) == null ? void 0 : ref8.type) === "redirect-external") {
return data.effect;
}
if ((data == null ? void 0 : (ref9 = data.effect) == null ? void 0 : ref9.type) === "rewrite") {
const resolvedRoute = (0, _removeTrailingSlash).removeTrailingSlash(data.effect.resolvedHref);
const pages = yield _this.pageLoader.getPageList();
// during query updating the page must match although during
// client-transition a redirect that doesn't match a page
// can be returned and this should trigger a hard navigation
// which is valid for incremental migration
if (!isQueryUpdating || pages.includes(resolvedRoute)) {
route = resolvedRoute;
pathname = data.effect.resolvedHref;
query = _extends({}, query, data.effect.parsedAs.query);
resolvedAs = (0, _removeBasePath).removeBasePath((0, _normalizeLocalePath).normalizeLocalePath(data.effect.parsedAs.pathname, _this.locales).pathname);
// Check again the cache with the new destination.
existingInfo = _this.components[route];
if (routeProps.shallow && existingInfo && _this.route === route && !hasMiddleware) {
// If we have a match with the current route due to rewrite,
// we can copy the existing information to the rewritten one.
// Then, we return the information along with the matched route.
return _extends({}, existingInfo, {
route
});
}
}
}
if ((0, _isApiRoute).isAPIRoute(route)) {
handleHardNavigation({
url: as,
router: _this
});
return new Promise(()=>{});
}
const routeInfo = cachedRouteInfo || (yield _this.fetchComponent(route).then((res)=>({
Component: res.page,
styleSheets: res.styleSheets,
__N_SSG: res.mod.__N_SSG,
__N_SSP: res.mod.__N_SSP
})));
if ("development" !== "production") {
const { isValidElementType } = require("next/dist/compiled/react-is");
if (!isValidElementType(routeInfo.Component)) {
throw new Error(`The default export is not a React Component in page: "${pathname}"`);
}
}
const wasBailedPrefetch = data == null ? void 0 : (ref10 = data.response) == null ? void 0 : ref10.headers.get("x-middleware-skip");
const shouldFetchData = routeInfo.__N_SSG || routeInfo.__N_SSP;
// For non-SSG prefetches that bailed before sending data
// we clear the cache to fetch full response
if (wasBailedPrefetch && (data == null ? void 0 : data.dataHref)) {
delete _this.sdc[data.dataHref];
}
const { props , cacheKey } = yield _this._getData(_async_to_generator(function*() {
if (shouldFetchData) {
if ((data == null ? void 0 : data.json) && !wasBailedPrefetch) {
return {
cacheKey: data.cacheKey,
props: data.json
};
}
const dataHref = (data == null ? void 0 : data.dataHref) ? data.dataHref : _this.pageLoader.getDataHref({
href: (0, _formatUrl).formatWithValidation({
pathname,
query
}),
asPath: resolvedAs,
locale
});
const fetched = yield fetchNextData({
dataHref,
isServerRender: _this.isSsr,
parseJSON: true,
inflightCache: wasBailedPrefetch ? {} : _this.sdc,
persistCache: !isPreview,
isPrefetch: false,
unstable_skipClientCache
});
return {
cacheKey: fetched.cacheKey,
props: fetched.json || {}
};
}
return {
headers: {},
props: yield _this.getInitialProps(routeInfo.Component, {
pathname,
query,
asPath: as,
locale,
locales: _this.locales,
defaultLocale: _this.defaultLocale
})
};
}));
// Only bust the data cache for SSP routes although
// middleware can skip cache per request with
// x-middleware-cache: no-cache as well
if (routeInfo.__N_SSP && fetchNextDataParams.dataHref && cacheKey) {
delete _this.sdc[cacheKey];
}
// we kick off a HEAD request in the background
// when a non-prefetch request is made to signal revalidation
if (!_this.isPreview && routeInfo.__N_SSG && "development" !== "development" && !isQueryUpdating) {
fetchNextData(Object.assign({}, fetchNextDataParams, {
isBackground: true,
persistCache: false,
inflightCache: _this.sbc
})).catch(()=>{});
}
props.pageProps = Object.assign({}, props.pageProps);
routeInfo.props = props;
routeInfo.route = route;
routeInfo.query = query;
routeInfo.resolvedAs = resolvedAs;
_this.components[route] = routeInfo;
return routeInfo;
} catch (err) {
return _this.handleRouteInfoError((0, _isError).getProperError(err), pathname, query, as, routeProps);
}
})();
}
set(state, data, resetScroll) {
this.state = state;
return this.sub(data, this.components["/_app"].Component, resetScroll);
}
/**
* Callback to execute before replacing router state
* @param cb callback to be executed
*/ beforePopState(cb) {
this._bps = cb;
}
onlyAHashChange(as) {
if (!this.asPath) return false;
const [oldUrlNoHash, oldHash] = this.asPath.split("#");
const [newUrlNoHash, newHash] = as.split("#");
// 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;
}
scrollToHash(as) {
const [, hash = ""] = as.split("#");
// Scroll to top if the hash is just `#` with no value or `#top`
// To mirror browsers
if (hash === "" || hash === "top") {
handleSmoothScroll(()=>window.scrollTo(0, 0));
return;
}
// Decode hash to make non-latin anchor works.
const rawHash = decodeURIComponent(hash);
// First we check if the element by id is found
const idEl = document.getElementById(rawHash);
if (idEl) {
handleSmoothScroll(()=>idEl.scrollIntoView());
return;
}
// If there's no element with the id, we check the `name` property
// To mirror browsers
const nameEl = document.getElementsByName(rawHash)[0];
if (nameEl) {
handleSmoothScroll(()=>nameEl.scrollIntoView());
}
}
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
*/ prefetch(url, asPath = url, options = {}) {
var _this = this;
return _async_to_generator(function*() {
// Prefetch is not supported in development mode because it would trigger on-demand-entries
if ("development" !== "production") {
return;
}
if ("undefined" !== "undefined" && (0, _isBot).isBot(window.navigator.userAgent)) {
// No prefetches for bots that render the link since they are typically navigating
// links via the equivalent of a hard navigation and hence never utilize these
// prefetches.
return;
}
let parsed = (0, _parseRelativeUrl).parseRelativeUrl(url);
let { pathname , query } = parsed;
const originalPathname = pathname;
if (process.env.__NEXT_I18N_SUPPORT) {
if (options.locale === false) {
pathname = (0, _normalizeLocalePath).normalizeLocalePath(pathname, _this.locales).pathname;
parsed.pathname = pathname;
url = (0, _formatUrl).formatWithValidation(parsed);
let parsedAs = (0, _parseRelativeUrl).parseRelativeUrl(asPath);
const localePathResult = (0, _normalizeLocalePath).normalizeLocalePath(parsedAs.pathname, _this.locales);
parsedAs.pathname = localePathResult.pathname;
options.locale = localePathResult.detectedLocale || _this.defaultLocale;
asPath = (0, _formatUrl).formatWithValidation(parsedAs);
}
}
const pages = yield _this.pageLoader.getPageList();
let resolvedAs = asPath;
const locale = typeof options.locale !== "undefined" ? options.locale || undefined : _this.locale;
const isMiddlewareMatch = yield matchesMiddleware({
asPath: asPath,
locale: locale,
router: _this
});
if (process.env.__NEXT_HAS_REWRITES && asPath.startsWith("/")) {
let rewrites;
({ __rewrites: rewrites } = yield (0, _routeLoader).getClientBuildManifest());
const rewritesResult = (0, _resolveRewrites).default((0, _addBasePath).addBasePath((0, _addLocale).addLocale(asPath, _this.locale), true), pages, rewrites, parsed.query, (p)=>resolveDynamicRoute(p, pages), _this.locales);
if (rewritesResult.externalDest) {
return;
}
if (!isMiddlewareMatch) {
resolvedAs = (0, _removeLocale).removeLocale((0, _removeBasePath).removeBasePath(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;
if (!isMiddlewareMatch) {
url = (0, _formatUrl).formatWithValidation(parsed);
}
}
}
parsed.pathname = resolveDynamicRoute(parsed.pathname, pages);
if ((0, _isDynamic).isDynamicRoute(parsed.pathname)) {
pathname = parsed.pathname;
parsed.pathname = pathname;
Object.assign(query, (0, _routeMatcher).getRouteMatcher((0, _routeRegex).getRouteRegex(parsed.pathname))((0, _parsePath).parsePath(asPath).pathname) || {});
if (!isMiddlewareMatch) {
url = (0, _formatUrl).formatWithValidation(parsed);
}
}
const data = process.env.__NEXT_MIDDLEWARE_PREFETCH === "strict" ? null : yield withMiddlewareEffects({
fetchData: ()=>fetchNextData({
dataHref: _this.pageLoader.getDataHref({
href: (0, _formatUrl).formatWithValidation({
pathname: originalPathname,
query
}),
skipInterpolation: true,
asPath: resolvedAs,
locale
}),
hasMiddleware: true,
isServerRender: _this.isSsr,
parseJSON: true,
inflightCache: _this.sdc,
persistCache: !_this.isPreview,
isPrefetch: true
}),
asPath: asPath,
locale: locale,
router: _this
});
/**
* If there was a rewrite we apply the effects of the rewrite on the
* current parameters for the prefetch.
*/ if ((data == null ? void 0 : data.effect.type) === "rewrite") {
parsed.pathname = data.effect.resolvedHref;
pathname = data.effect.resolvedHref;
query = _extends({}, query, data.effect.parsedAs.query);
resolvedAs = data.effect.parsedAs.pathname;
url = (0, _formatUrl).formatWithValidation(parsed);
}
/**
* If there is a redirect to an external destination then we don't have
* to prefetch content as it will be unused.
*/ if ((data == null ? void 0 : data.effect.type) === "redirect-external") {
return;
}
const route = (0, _removeTrailingSlash).removeTrailingSlash(pathname);
yield Promise.all([
_this.pageLoader._isSsg(route).then((isSsg)=>{
return isSsg ? fetchNextData({
dataHref: (data == null ? void 0 : data.json) ? data == null ? void 0 : data.dataHref : _this.pageLoader.getDataHref({
href: url,
asPath: resolvedAs,
locale: locale
}),
isServerRender: false,
parseJSON: true,
inflightCache: _this.sdc,
persistCache: !_this.isPreview,
isPrefetch: true,
unstable_skipClientCache: options.unstable_skipClientCache || options.priority && !!process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE
}).then(()=>false) : false;
}),
_this.pageLoader[options.priority ? "loadPage" : "prefetch"](route)
]);
})();
}
fetchComponent(route) {
var _this = this;
return _async_to_generator(function*() {
const handleCancelled = getCancelledHandler({
route,
router: _this
});
try {
const componentResult = yield _this.pageLoader.loadPage(route);
handleCancelled();
return componentResult;
} catch (err) {
handleCancelled();
throw err;
}
})();
}
_getData(fn) {
let cancelled = false;
const cancel = ()=>{
cancelled = true;
};
this.clc = cancel;
return fn().then((data)=>{
if (cancel === this.clc) {
this.clc = null;
}
if (cancelled) {
const err = new Error("Loading initial props cancelled");
err.cancelled = true;
throw err;
}
return data;
});
}
_getFlightData(dataHref) {
// Do not cache RSC flight response since it's not a static resource
return fetchNextData({
dataHref,
isServerRender: true,
parseJSON: false,
inflightCache: this.sdc,
persistCache: false,
isPrefetch: false
}).then(({ text })=>({
data: text
}));
}
getInitialProps(Component, ctx) {
const { Component: App } = this.components["/_app"];
const AppTree = this._wrapApp(App);
ctx.AppTree = AppTree;
return (0, _utils).loadGetInitialProps(App, {
AppTree,
Component,
router: this,
ctx
});
}
get route() {
return this.state.route;
}
get pathname() {
return this.state.pathname;
}
get query() {
return this.state.query;
}
get asPath() {
return this.state.asPath;
}
get locale() {
return this.state.locale;
}
get isFallback() {
return this.state.isFallback;
}
get isPreview() {
return this.state.isPreview;
}
constructor(pathname1, query1, as1, { initialProps , pageLoader , App , wrapApp , Component , err , subscription , isFallback , locale , locales , defaultLocale , domainLocales , isPreview }){
// Server Data Cache (full data requests)
this.sdc = {};
// Server Background Cache (HEAD requests)
this.sbc = {};
this.isFirstPopStateEvent = true;
this._key = createKey();
this.onPopState = (e)=>{
const { isFirstPopStateEvent } = this;
this.isFirstPopStateEvent = false;
const 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.
const { pathname , query } = this;
this.changeState("replaceState", (0, _formatUrl).formatWithValidation({
pathname: (0, _addBasePath).addBasePath(pathname),
query
}), (0, _utils).getURL());
return;
}
// __NA is used to identify if the history entry can be handled by the app-router.
if (state.__NA) {
window.location.reload();
return;
}
if (!state.__N) {
return;
}
// Safari fires popstateevent when reopening the browser.
if (isFirstPopStateEvent && this.locale === state.options.locale && state.as === this.asPath) {
return;
}
let forcedScroll;
const { url , as , options , key } = state;
if (process.env.__NEXT_SCROLL_RESTORATION) {
if (manualScrollRestoration) {
if (this._key !== key) {
// Snapshot current scroll position:
try {
sessionStorage.setItem("__next_scroll_" + this._key, JSON.stringify({
x: self.pageXOffset,
y: self.pageYOffset
}));
} catch (e1) {}
// Restore old scroll position:
try {
const v = sessionStorage.getItem("__next_scroll_" + key);
forcedScroll = JSON.parse(v);
} catch (e11) {
forcedScroll = {
x: 0,
y: 0
};
}
}
}
}
this._key = key;
const { pathname: pathname1 } = (0, _parseRelativeUrl).parseRelativeUrl(url);
// Make sure we don't re-render on initial load,
// can be caused by navigating back from an external site
if (this.isSsr && as === (0, _addBasePath).addBasePath(this.asPath) && pathname1 === (0, _addBasePath).addBasePath(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,
// @ts-ignore internal value not exposed on types
_h: 0
}), forcedScroll);
};
// represents the current component key
const route = (0, _removeTrailingSlash).removeTrailingSlash(pathname1);
// 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 (pathname1 !== "/_error") {
this.components[route] = {
Component,
initial: true,
props: initialProps,
err,
__N_SSG: initialProps && initialProps.__N_SSG,
__N_SSP: initialProps && initialProps.__N_SSP
};
}
this.components["/_app"] = {
Component: App,
styleSheets: []
};
// 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;
// if auto prerendered and dynamic route wait to update asPath
// until after mount to prevent hydration mismatch
const autoExportDynamic = (0, _isDynamic).isDynamicRoute(pathname1) && self.__NEXT_DATA__.autoExport;
this.basePath = process.env.__NEXT_ROUTER_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.isLocaleDomain = false;
this.isReady = !!(self.__NEXT_DATA__.gssp || self.__NEXT_DATA__.gip || self.__NEXT_DATA__.appGip && !self.__NEXT_DATA__.gsp || !autoExportDynamic && !self.location.search && !process.env.__NEXT_HAS_REWRITES);
if (process.env.__NEXT_I18N_SUPPORT) {
this.locales = locales;
this.defaultLocale = defaultLocale;
this.domainLocales = domainLocales;
this.isLocaleDomain = !!(0, _detectDomainLocale).detectDomainLocale(domainLocales, self.location.hostname);
}
this.state = {
route,
pathname: pathname1,
query: query1,
asPath: autoExportDynamic ? pathname1 : as1,
isPreview: !!isPreview,
locale: process.env.__NEXT_I18N_SUPPORT ? locale : undefined,
isFallback
};
this._initialMatchesMiddlewarePromise = Promise.resolve(false);
if ("undefined" !== "undefined") {
// make sure "as" doesn't start with double slashes or else it can
// throw an error as it's considered invalid
if (!as1.startsWith("//")) {
// in order for `e.state` to work on the `onpopstate` event
// we have to register the initial route upon initialization
const options = {
locale
};
const asPath = (0, _utils).getURL();
this._initialMatchesMiddlewarePromise = matchesMiddleware({
router: this,
locale,
asPath
}).then((matches)=>{
options._shouldResolveHref = as1 !== pathname1;
this.changeState("replaceState", matches ? asPath : (0, _formatUrl).formatWithValidation({
pathname: (0, _addBasePath).addBasePath(pathname1),
query: query1
}), asPath, options);
return matches;
});
}
window.addEventListener("popstate", this.onPopState);
// enable custom scroll restoration handling when available
// otherwise fallback to browser's default handling
if (process.env.__NEXT_SCROLL_RESTORATION) {
if (manualScrollRestoration) {
window.history.scrollRestoration = "manual";
}
}
}
}
}
Router.events = (0, _mitt).default();
exports.default = Router; //# sourceMappingURL=router.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/shared/lib/router/router.js,:{"version":3,"sources":["webpack://./node_modules/next/dist/shared/lib/router/router.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.matchesMiddleware = matchesMiddleware;\nexports.isLocalURL = isLocalURL;\nexports.interpolateAs = interpolateAs;\nexports.resolveHref = resolveHref;\nexports.createKey = createKey;\nexports.default = void 0;\nvar _async_to_generator = require(\"@swc/helpers/lib/_async_to_generator.js\").default;\nvar _extends = require(\"@swc/helpers/lib/_extends.js\").default;\nvar _interop_require_default = require(\"@swc/helpers/lib/_interop_require_default.js\").default;\nvar _interop_require_wildcard = require(\"@swc/helpers/lib/_interop_require_wildcard.js\").default;\nvar _normalizeTrailingSlash = require(\"../../../client/normalize-trailing-slash\");\nvar _removeTrailingSlash = require(\"./utils/remove-trailing-slash\");\nvar _routeLoader = require(\"../../../client/route-loader\");\nvar _script = require(\"../../../client/script\");\nvar _isError = _interop_require_wildcard(require(\"../../../lib/is-error\"));\nvar _denormalizePagePath = require(\"../page-path/denormalize-page-path\");\nvar _normalizeLocalePath = require(\"../i18n/normalize-locale-path\");\nvar _mitt = _interop_require_default(require(\"../mitt\"));\nvar _utils = require(\"../utils\");\nvar _isDynamic = require(\"./utils/is-dynamic\");\nvar _parseRelativeUrl = require(\"./utils/parse-relative-url\");\nvar _querystring = require(\"./utils/querystring\");\nvar _resolveRewrites = _interop_require_default(require(\"./utils/resolve-rewrites\"));\nvar _routeMatcher = require(\"./utils/route-matcher\");\nvar _routeRegex = require(\"./utils/route-regex\");\nvar _formatUrl = require(\"./utils/format-url\");\nvar _detectDomainLocale = require(\"../../../client/detect-domain-locale\");\nvar _parsePath = require(\"./utils/parse-path\");\nvar _addLocale = require(\"../../../client/add-locale\");\nvar _removeLocale = require(\"../../../client/remove-locale\");\nvar _removeBasePath = require(\"../../../client/remove-base-path\");\nvar _addBasePath = require(\"../../../client/add-base-path\");\nvar _hasBasePath = require(\"../../../client/has-base-path\");\nvar _isApiRoute = require(\"../../../lib/is-api-route\");\nvar _getNextPathnameInfo = require(\"./utils/get-next-pathname-info\");\nvar _formatNextPathnameInfo = require(\"./utils/format-next-pathname-info\");\nvar _compareStates = require(\"./utils/compare-states\");\nvar _isBot = require(\"./utils/is-bot\");\nfunction buildCancellationError() {\n return Object.assign(new Error('Route Cancelled'), {\n cancelled: true\n });\n}\nfunction matchesMiddleware(options) {\n return _matchesMiddleware.apply(this, arguments);\n}\nfunction _matchesMiddleware() {\n _matchesMiddleware = _async_to_generator(function*(options) {\n const matchers = yield Promise.resolve(options.router.pageLoader.getMiddleware());\n if (!matchers) return false;\n const { pathname: asPathname } = (0, _parsePath).parsePath(options.asPath);\n // remove basePath first since path prefix has to be in the order of `/${basePath}/${locale}`\n const cleanedAs = (0, _hasBasePath).hasBasePath(asPathname) ? (0, _removeBasePath).removeBasePath(asPathname) : asPathname;\n const asWithBasePathAndLocale = (0, _addBasePath).addBasePath((0, _addLocale).addLocale(cleanedAs, options.locale));\n // Check only path match on client. Matching \"has\" should be done on server\n // where we can access more info such as headers, HttpOnly cookie, etc.\n return matchers.some((m)=>new RegExp(m.regexp).test(asWithBasePathAndLocale));\n });\n return _matchesMiddleware.apply(this, arguments);\n}\nfunction stripOrigin(url) {\n const origin = (0, _utils).getLocationOrigin();\n return url.startsWith(origin) ? url.substring(origin
>w<00><00><00>:y<00><00><00><00><00><00><00>'-/L^d_f}<00><00><00><00><00><00><00>28:X<00><00><00><00><00><00><00><00><00><00><00><00>#:@_BV<00><00><00><00><00><00><00><00><00><00>)/1Dbhj<00><00><00><00><00><00><00><00><00>_5OUWx<00><00><00><00><00><00><00><00>*IOQp<00><00><00><00><00><00><00><00> _  )2)r0<00>0<00>0<00>2<00>@<00>@<00>@<00>AUCU<00>^__Za&iDiGi<00>vp<><00><><00><>o<><00><><00><>|<7C><00><><00><>˥_Υ<01><1E><<3C>?<3F><00><><00><><00><><00><><00><><00><><12>K<>Q<>S<>o<>a<>p<>s<><00><>
<00>
<00>
" % , <00>   <00><00><00>]<5D>c<00><00><00><00>#.#<00>4<00>4<00>4<00>8<00>A<00>ApC<00>C<00>C<00>C<00>C<00>D<00>E<00>E<00>E<00>EJFdFgF2LbLpL<00><18>Object.defineProperty(exports, "__esModule", (<18>))<18>exports.matchesMiddleware<18>exports.isLocalURL<18>exports.interpolateAs<18>exports.resolveHref<18>exports.createKey<18>exports["default"]<1E>(__webpack_require__(/*! @swc/helpers/lib/_async_to_generator.js */ "./node_modules/@swc/helpers/lib/_async_to_generator.js")["default"])<18>(__webpack_require__(/*! @swc/helpers/lib/_extends.js */ "./node_modules/@swc/helpers/lib/_extends.js")["default"])<1E>(__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ "./node_modules/@swc/helpers/lib/_interop_require_default.js")["default"])<1E>(__webpack_require__(/*! @swc/helpers/lib/_interop_require_wildcard.js */ "./node_modules/@swc/helpers/lib/_interop_require_wildcard.js")["default"])<18>__webpack_require__<18>/*! ../../../client/normalize-trailing-slash */ "./node_modules/next/dist/client/normalize-trailing-slash.js"<15><18>/*! ./utils/remove-trailing-slash */ "../shared/lib/router/utils/remove-trailing-slash"<15><18>/*! ../../../client/route-loader */ "./node_modules/next/dist/client/route-loader.js"<15><18>/*! ../../../client/script */ "./node_modules/next/dist/client/script.js"<15><18>/*! ../../../lib/is-error */ "./node_modules/next/dist/lib/is-error.js"<15><18>/*! ../page-path/denormalize-page-path */ "../page-path/denormalize-page-path"<15><18>/*! ../i18n/normalize-locale-path */ "../i18n/normalize-locale-path"<15><18>/*! ../mitt */ "../mitt"<15><18>/*! ../utils */ "../utils"<15><18>/*! ./utils/is-dynamic */ "./utils/is-dynamic"<15><18>/*! ./utils/parse-relative-url */ "./utils/parse-relative-url"<15><18>/*! ./utils/querystring */ "./utils/querystring"<15><18>/*! ./utils/resolve-rewrites */ "./utils/resolve-rewrites"<15><18>/*! ./utils/route-matcher */ "./utils/route-matcher"<15><18>/*! ./utils/route-regex */ "./utils/route-regex"<15><18>/*! ./utils/format-url */ "../shared/lib/router/utils/format-url"<15><18>/*! ../../../client/detect-domain-locale */ "./node_modules/next/dist/client/detect-domain-locale.js"<15><18>/*! ./utils/parse-path */ "../shared/lib/router/utils/parse-path"<15><18>/*! ../../../client/add-locale */ "./node_modules/next/dist/client/add-locale.js"<15><18>/*! ../../../client/remove-locale */ "./node_modules/next/dist/client/remove-locale.js"<15><18>/*! ../../../client/remove-base-path */ "./node_modules/next/dist/client/remove-base-path.js"<15><18>/*! ../../../client/add-base-path */ "./node_modules/next/dist/client/add-base-path.js"<15><18>/*! ../../../client/has-base-path */ "./node_modules/next/dist/client/has-base-path.js"<15><18>/*! ../../../lib/is-api-route */ "./node_modules/next/dist/lib/is-api-route.js"<15><18>/*! ./utils/get-next-pathname-info */ "./utils/get-next-pathname-info"<15><18>/*! ./utils/format-next-pathname-info */ "./utils/format-next-pathname-info"<15><18>/*! ./utils/compare-states */ "./utils/compare-states"<15><18>/*! ./utils/is-bot */ "./utils/is-bot"<18>false<15><18>{}<18> false<18>0<18>0<15><15><15><18>{ var ref; }<15><15><18>true<15><15><15><15><15><15><18>0<15><15><18>/*! next/dist/compiled/react-is */ "next/dist/compiled/react-is"<18>0<15><15><15><15><15><15><15><15><15><18>0<15><15><15><15><15><15><15><15><18>0<15><15><15><16><><EFBFBD><EFBFBD><1F>"
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.matchesMiddleware = matchesMiddleware;
exports.isLocalURL = isLocalURL;
exports.interpolateAs = interpolateAs;
exports.resolveHref = resolveHref;
exports.createKey = createKey;
exports["default"] = void 0;
var _async_to_generator = (__webpack_require__(/*! @swc/helpers/lib/_async_to_generator.js */ "./node_modules/@swc/helpers/lib/_async_to_generator.js")["default"]);
var _extends = (__webpack_require__(/*! @swc/helpers/lib/_extends.js */ "./node_modules/@swc/helpers/lib/_extends.js")["default"]);
var _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ "./node_modules/@swc/helpers/lib/_interop_require_default.js")["default"]);
var _interop_require_wildcard = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_wildcard.js */ "./node_modules/@swc/helpers/lib/_interop_require_wildcard.js")["default"]);
var _normalizeTrailingSlash = __webpack_require__(/*! ../../../client/normalize-trailing-slash */ "./node_modules/next/dist/client/normalize-trailing-slash.js");
var _removeTrailingSlash = __webpack_require__(/*! ./utils/remove-trailing-slash */ "../shared/lib/router/utils/remove-trailing-slash");
var _routeLoader = __webpack_require__(/*! ../../../client/route-loader */ "./node_modules/next/dist/client/route-loader.js");
var _script = __webpack_require__(/*! ../../../client/script */ "./node_modules/next/dist/client/script.js");
var _isError = _interop_require_wildcard(__webpack_require__(/*! ../../../lib/is-error */ "./node_modules/next/dist/lib/is-error.js"));
var _denormalizePagePath = __webpack_require__(/*! ../page-path/denormalize-page-path */ "../page-path/denormalize-page-path");
var _normalizeLocalePath = __webpack_require__(/*! ../i18n/normalize-locale-path */ "../i18n/normalize-locale-path");
var _mitt = _interop_require_default(__webpack_require__(/*! ../mitt */ "../mitt"));
var _utils = __webpack_require__(/*! ../utils */ "../utils");
var _isDynamic = __webpack_require__(/*! ./utils/is-dynamic */ "./utils/is-dynamic");
var _parseRelativeUrl = __webpack_require__(/*! ./utils/parse-relative-url */ "./utils/parse-relative-url");
var _querystring = __webpack_require__(/*! ./utils/querystring */ "./utils/querystring");
var _resolveRewrites = _interop_require_default(__webpack_require__(/*! ./utils/resolve-rewrites */ "./utils/resolve-rewrites"));
var _routeMatcher = __webpack_require__(/*! ./utils/route-matcher */ "./utils/route-matcher");
var _routeRegex = __webpack_require__(/*! ./utils/route-regex */ "./utils/route-regex");
var _formatUrl = __webpack_require__(/*! ./utils/format-url */ "../shared/lib/router/utils/format-url");
var _detectDomainLocale = __webpack_require__(/*! ../../../client/detect-domain-locale */ "./node_modules/next/dist/client/detect-domain-locale.js");
var _parsePath = __webpack_require__(/*! ./utils/parse-path */ "../shared/lib/router/utils/parse-path");
var _addLocale = __webpack_require__(/*! ../../../client/add-locale */ "./node_modules/next/dist/client/add-locale.js");
var _removeLocale = __webpack_require__(/*! ../../../client/remove-locale */ "./node_modules/next/dist/client/remove-locale.js");
var _removeBasePath = __webpack_require__(/*! ../../../client/remove-base-path */ "./node_modules/next/dist/client/remove-base-path.js");
var _addBasePath = __webpack_require__(/*! ../../../client/add-base-path */ "./node_modules/next/dist/client/add-base-path.js");
var _hasBasePath = __webpack_require__(/*! ../../../client/has-base-path */ "./node_modules/next/dist/client/has-base-path.js");
var _isApiRoute = __webpack_require__(/*! ../../../lib/is-api-route */ "./node_modules/next/dist/lib/is-api-route.js");
var _getNextPathnameInfo = __webpack_require__(/*! ./utils/get-next-pathname-info */ "./utils/get-next-pathname-info");
var _formatNextPathnameInfo = __webpack_require__(/*! ./utils/format-next-pathname-info */ "./utils/format-next-pathname-info");
var _compareStates = __webpack_require__(/*! ./utils/compare-states */ "./utils/compare-states");
var _isBot = __webpack_require__(/*! ./utils/is-bot */ "./utils/is-bot");
function buildCancellationError() {
return Object.assign(new Error("Route Cancelled"), {
cancelled: true
});
}
function matchesMiddleware(options) {
return _matchesMiddleware.apply(this, arguments);
}
function _matchesMiddleware() {
_matchesMiddleware = _async_to_generator(function*(options) {
const matchers = yield Promise.resolve(options.router.pageLoader.getMiddleware());
if (!matchers) return false;
const { pathname: asPathname } = (0, _parsePath).parsePath(options.asPath);
// remove basePath first since path prefix has to be in the order of `/${basePath}/${locale}`
const cleanedAs = (0, _hasBasePath).hasBasePath(asPathname) ? (0, _removeBasePath).removeBasePath(asPathname) : asPathname;
const asWithBasePathAndLocale = (0, _addBasePath).addBasePath((0, _addLocale).addLocale(cleanedAs, options.locale));
// Check only path match on client. Matching "has" should be done on server
// where we can access more info such as headers, HttpOnly cookie, etc.
return matchers.some((m)=>new RegExp(m.regexp).test(asWithBasePathAndLocale));
});
return _matchesMiddleware.apply(this, arguments);
}
function stripOrigin(url) {
const origin = (0, _utils).getLocationOrigin();
return url.startsWith(origin) ? url.substring(origin.length) : url;
}
function omit(object, keys) {
const omitted = {};
Object.keys(object).forEach((key)=>{
if (!keys.includes(key)) {
omitted[key] = object[key];
}
});
return omitted;
}
function isLocalURL(url) {
// prevent a hydration mismatch on href for url with anchor refs
if (!(0, _utils).isAbsoluteUrl(url)) return true;
try {
// absolute urls can be local if they are on the same origin
const locationOrigin = (0, _utils).getLocationOrigin();
const resolved = new URL(url, locationOrigin);
return resolved.origin === locationOrigin && (0, _hasBasePath).hasBasePath(resolved.pathname);
} catch (_) {
return false;
}
}
function interpolateAs(route, asPathname, query) {
let interpolatedRoute = "";
const dynamicRegex = (0, _routeRegex).getRouteRegex(route);
const dynamicGroups = dynamicRegex.groups;
const dynamicMatches = (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;
const params = Object.keys(dynamicGroups);
if (!params.every((param)=>{
let value = dynamicMatches[param] || "";
const { repeat , optional } = dynamicGroups[param];
// support single-level catch-all
// TODO: more robust handling for user-error (passing `/`)
let replaced = `[${repeat ? "..." : ""}${param}]`;
if (optional) {
replaced = `${!value ? "/" : ""}[${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(// path delimiter escaped since they are being inserted
// into the URL and we expect URL encoded segments
// when parsing dynamic route params
(segment)=>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 `<Link>` component directly.
}
return {
params,
result: interpolatedRoute
};
}
function resolveHref(router, href, resolveAs) {
// we use a dummy base url for relative urls
let base;
let urlAsString = typeof href === "string" ? href : (0, _formatUrl).formatWithValidation(href);
// repeated slashes and backslashes in the URL are considered
// invalid and will never match a Next.js page/file
const urlProtoMatch = urlAsString.match(/^[a-zA-Z]{1,}:\/\//);
const urlAsStringNoProto = urlProtoMatch ? urlAsString.slice(urlProtoMatch[0].length) : urlAsString;
const urlParts = urlAsStringNoProto.split("?");
if ((urlParts[0] || "").match(/(\/\/|\\)/)) {
console.error(`Invalid href passed to next/router: ${urlAsString}, repeated forward-slashes (//) or backslashes \\ are not valid in the href`);
const normalizedUrl = (0, _utils).normalizeRepeatedSlashes(urlAsStringNoProto);
urlAsString = (urlProtoMatch ? urlProtoMatch[0] : "") + normalizedUrl;
}
// Return because it cannot be routed by the Next.js router
if (!isLocalURL(urlAsString)) {
return resolveAs ? [
urlAsString
] : urlAsString;
}
try {
base = new URL(urlAsString.startsWith("#") ? router.asPath : router.pathname, "http://n");
} catch (_) {
// fallback to / for invalid asPath values e.g. //
base = new URL("/", "http://n");
}
try {
const finalUrl = new URL(urlAsString, base);
finalUrl.pathname = (0, _normalizeTrailingSlash).normalizePathTrailingSlash(finalUrl.pathname);
let interpolatedAs = "";
if ((0, _isDynamic).isDynamicRoute(finalUrl.pathname) && finalUrl.searchParams && resolveAs) {
const query = (0, _querystring).searchParamsToUrlQuery(finalUrl.searchParams);
const { result , params } = interpolateAs(finalUrl.pathname, finalUrl.pathname, query);
if (result) {
interpolatedAs = (0, _formatUrl).formatWithValidation({
pathname: result,
hash: finalUrl.hash,
query: omit(query, params)
});
}
}
// if the origin didn't change, it means we received a relative href
const resolvedHref = finalUrl.origin === base.origin ? finalUrl.href.slice(finalUrl.origin.length) : finalUrl.href;
return resolveAs ? [
resolvedHref,
interpolatedAs || resolvedHref
] : resolvedHref;
} catch (_1) {
return resolveAs ? [
urlAsString
] : urlAsString;
}
}
function prepareUrlAs(router, url, as) {
// If url and as provided as an object representation,
// we'll format them into the string version here.
let [resolvedHref, resolvedAs] = resolveHref(router, url, true);
const origin = (0, _utils).getLocationOrigin();
const hrefWasAbsolute = resolvedHref.startsWith(origin);
const asWasAbsolute = resolvedAs && resolvedAs.startsWith(origin);
resolvedHref = stripOrigin(resolvedHref);
resolvedAs = resolvedAs ? stripOrigin(resolvedAs) : resolvedAs;
const preparedUrl = hrefWasAbsolute ? resolvedHref : (0, _addBasePath).addBasePath(resolvedHref);
const preparedAs = as ? stripOrigin(resolveHref(router, as)) : resolvedAs || resolvedHref;
return {
url: preparedUrl,
as: asWasAbsolute ? preparedAs : (0, _addBasePath).addBasePath(preparedAs)
};
}
function resolveDynamicRoute(pathname, pages) {
const cleanPathname = (0, _removeTrailingSlash).removeTrailingSlash((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((page)=>{
if ((0, _isDynamic).isDynamicRoute(page) && (0, _routeRegex).getRouteRegex(page).re.test(cleanPathname)) {
pathname = page;
return true;
}
});
}
return (0, _removeTrailingSlash).removeTrailingSlash(pathname);
}
function getMiddlewareData(source, response, options) {
const nextConfig = {
basePath: options.router.basePath,
i18n: {
locales: options.router.locales
},
trailingSlash: Boolean(false)
};
const rewriteHeader = response.headers.get("x-nextjs-rewrite");
let rewriteTarget = rewriteHeader || response.headers.get("x-nextjs-matched-path");
const matchedPath = response.headers.get("x-matched-path");
if (matchedPath && !rewriteTarget && !matchedPath.includes("__next_data_catchall") && !matchedPath.includes("/_error") && !matchedPath.includes("/404")) {
// leverage x-matched-path to detect next.config.js rewrites
rewriteTarget = matchedPath;
}
if (rewriteTarget) {
if (rewriteTarget.startsWith("/")) {
const parsedRewriteTarget = (0, _parseRelativeUrl).parseRelativeUrl(rewriteTarget);
const pathnameInfo = (0, _getNextPathnameInfo).getNextPathnameInfo(parsedRewriteTarget.pathname, {
nextConfig,
parseData: true
});
let fsPathname = (0, _removeTrailingSlash).removeTrailingSlash(pathnameInfo.pathname);
return Promise.all([
options.router.pageLoader.getPageList(),
(0, _routeLoader).getClientBuildManifest()
]).then(([pages, { __rewrites: rewrites }])=>{
let as = (0, _addLocale).addLocale(pathnameInfo.pathname, pathnameInfo.locale);
if ((0, _isDynamic).isDynamicRoute(as) || !rewriteHeader && pages.includes((0, _normalizeLocalePath).normalizeLocalePath((0, _removeBasePath).removeBasePath(as), options.router.locales).pathname)) {
const parsedSource = (0, _getNextPathnameInfo).getNextPathnameInfo((0, _parseRelativeUrl).parseRelativeUrl(source).pathname, {
parseData: true
});
as = (0, _addBasePath).addBasePath(parsedSource.pathname);
parsedRewriteTarget.pathname = as;
}
if (false) {} else if (!pages.includes(fsPathname)) {
const resolvedPathname = resolveDynamicRoute(fsPathname, pages);
if (resolvedPathname !== fsPathname) {
fsPathname = resolvedPathname;
}
}
const resolvedHref = !pages.includes(fsPathname) ? resolveDynamicRoute((0, _normalizeLocalePath).normalizeLocalePath((0, _removeBasePath).removeBasePath(parsedRewriteTarget.pathname), options.router.locales).pathname, pages) : fsPathname;
if ((0, _isDynamic).isDynamicRoute(resolvedHref)) {
const matches = (0, _routeMatcher).getRouteMatcher((0, _routeRegex).getRouteRegex(resolvedHref))(as);
Object.assign(parsedRewriteTarget.query, matches || {});
}
return {
type: "rewrite",
parsedAs: parsedRewriteTarget,
resolvedHref
};
});
}
const src = (0, _parsePath).parsePath(source);
const pathname = (0, _formatNextPathnameInfo).formatNextPathnameInfo(_extends({}, (0, _getNextPathnameInfo).getNextPathnameInfo(src.pathname, {
nextConfig,
parseData: true
}), {
defaultLocale: options.router.defaultLocale,
buildId: ""
}));
return Promise.resolve({
type: "redirect-external",
destination: `${pathname}${src.query}${src.hash}`
});
}
const redirectTarget = response.headers.get("x-nextjs-redirect");
if (redirectTarget) {
if (redirectTarget.startsWith("/")) {
const src1 = (0, _parsePath).parsePath(redirectTarget);
const pathname1 = (0, _formatNextPathnameInfo).formatNextPathnameInfo(_extends({}, (0, _getNextPathnameInfo).getNextPathnameInfo(src1.pathname, {
nextConfig,
parseData: true
}), {
defaultLocale: options.router.defaultLocale,
buildId: ""
}));
return Promise.resolve({
type: "redirect-internal",
newAs: `${pathname1}${src1.query}${src1.hash}`,
newUrl: `${pathname1}${src1.query}${src1.hash}`
});
}
return Promise.resolve({
type: "redirect-external",
destination: redirectTarget
});
}
return Promise.resolve({
type: "next"
});
}
function withMiddlewareEffects(options) {
return _withMiddlewareEffects.apply(this, arguments);
}
function _withMiddlewareEffects() {
_withMiddlewareEffects = _async_to_generator(function*(options) {
const matches = yield matchesMiddleware(options);
if (!matches || !options.fetchData) {
return null;
}
try {
const data = yield options.fetchData();
const effect = yield getMiddlewareData(data.dataHref, data.response, options);
return {
dataHref: data.dataHref,
json: data.json,
response: data.response,
text: data.text,
cacheKey: data.cacheKey,
effect
};
} catch (e) {
/**
* TODO: Revisit this in the future.
* For now we will not consider middleware data errors to be fatal.
* maybe we should revisit in the future.
*/ return null;
}
});
return _withMiddlewareEffects.apply(this, arguments);
}
const manualScrollRestoration = false && 0;
const SSG_DATA_NOT_FOUND = Symbol("SSG_DATA_NOT_FOUND");
function fetchRetry(url, attempts, options) {
return fetch(url, {
// Cookies are required to be present for Next.js' SSG "Preview Mode".
// Cookies may also be required for `getServerSideProps`.
//
// > `fetch` wont 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",
method: options.method || "GET",
headers: Object.assign({}, options.headers, {
"x-nextjs-data": "1"
})
}).then((response)=>{
return !response.ok && attempts > 1 && response.status >= 500 ? fetchRetry(url, attempts - 1, options) : response;
});
}
function handleSmoothScroll(fn) {
const htmlElement = document.documentElement;
const existing = htmlElement.style.scrollBehavior;
htmlElement.style.scrollBehavior = "auto";
// In Chrome-based browsers we need to force reflow before calling `scrollTo`.
// Otherwise it will not pickup the change in scrollBehavior
// More info here: https://github.com/vercel/next.js/issues/40719#issuecomment-1336248042
htmlElement.getClientRects();
fn();
htmlElement.style.scrollBehavior = existing;
}
function tryToParseAsJSON(text) {
try {
return JSON.parse(text);
} catch (error) {
return null;
}
}
function fetchNextData({ dataHref , inflightCache , isPrefetch , hasMiddleware , isServerRender , parseJSON , persistCache , isBackground , unstable_skipClientCache }) {
const { href: cacheKey } = new URL(dataHref, window.location.href);
var ref1;
const getData = (params)=>{
return fetchRetry(dataHref, isServerRender ? 3 : 1, {
headers: Object.assign({}, isPrefetch ? {
purpose: "prefetch"
} : {}, isPrefetch && hasMiddleware ? {
"x-middleware-prefetch": "1"
} : {}),
method: (ref1 = params == null ? void 0 : params.method) != null ? ref1 : "GET"
}).then((response)=>{
if (response.ok && (params == null ? void 0 : params.method) === "HEAD") {
return {
dataHref,
response,
text: "",
json: {},
cacheKey
};
}
return response.text().then((text)=>{
if (!response.ok) {
/**
* When the data response is a redirect because of a middleware
* we do not consider it an error. The headers must bring the
* mapped location.
* TODO: Change the status code in the handler.
*/ if (hasMiddleware && [
301,
302,
307,
308
].includes(response.status)) {
return {
dataHref,
response,
text,
json: {},
cacheKey
};
}
if (!hasMiddleware && response.status === 404) {
var ref;
if ((ref = tryToParseAsJSON(text)) == null ? void 0 : ref.notFound) {
return {
dataHref,
json: {
notFound: SSG_DATA_NOT_FOUND
},
response,
text,
cacheKey
};
}
}
const error = new Error(`Failed to load static props`);
/**
* 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(error);
}
throw error;
}
return {
dataHref,
json: parseJSON ? tryToParseAsJSON(text) : null,
response,
text,
cacheKey
};
});
}).then((data)=>{
if (!persistCache || "development" !== "production" || 0) {
delete inflightCache[cacheKey];
}
return data;
}).catch((err)=>{
if (!unstable_skipClientCache) {
delete inflightCache[cacheKey];
}
if (err.message === "Failed to fetch") {
(0, _routeLoader).markAssetError(err);
}
throw err;
});
};
// when skipping client cache we wait to update
// inflight cache until successful data response
// this allows racing click event with fetching newer data
// without blocking navigation when stale data is available
if (unstable_skipClientCache && persistCache) {
return getData({}).then((data)=>{
inflightCache[cacheKey] = Promise.resolve(data);
return data;
});
}
if (inflightCache[cacheKey] !== undefined) {
return inflightCache[cacheKey];
}
return inflightCache[cacheKey] = getData(isBackground ? {
method: "HEAD"
} : {});
}
function createKey() {
return Math.random().toString(36).slice(2, 10);
}
function handleHardNavigation({ url , router }) {
// ensure we don't trigger a hard navigation to the same
// URL as this can end up with an infinite refresh
if (url === (0, _addBasePath).addBasePath((0, _addLocale).addLocale(router.asPath, router.locale))) {
throw new Error(`Invariant: attempted to hard navigate to the same URL ${url} ${location.href}`);
}
window.location.href = url;
}
const getCancelledHandler = ({ route , router })=>{
let cancelled = false;
const cancel = router.clc = ()=>{
cancelled = true;
};
const handleCancelled = ()=>{
if (cancelled) {
const error = new Error(`Abort fetching component for route: "${route}"`);
error.cancelled = true;
throw error;
}
if (cancel === router.clc) {
router.clc = null;
}
};
return handleCancelled;
};
class Router {
reload() {
window.location.reload();
}
/**
* Go back in history
*/ back() {
window.history.back();
}
/**
* Go forward in history
*/ forward() {
window.history.forward();
}
/**
* 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
*/ push(url, as, options = {}) {
if (false) {}
({ url , as } = prepareUrlAs(this, url, 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
*/ replace(url, as, options = {}) {
({ url , as } = prepareUrlAs(this, url, as));
return this.change("replaceState", url, as, options);
}
change(method, url, as, options, forcedScroll) {
var _this = this;
return _async_to_generator(function*() {
if (!isLocalURL(url)) {
handleHardNavigation({
url,
router: _this
});
return false;
}
// 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.
const isQueryUpdating = options._h === 1;
let shouldResolveHref = isQueryUpdating || options._shouldResolveHref || (0, _parsePath).parsePath(url).pathname === (0, _parsePath).parsePath(as).pathname;
const nextState = _extends({}, _this.state);
// for static pages with query params in the URL we delay
// marking the router ready until after the query is updated
// or a navigation has occurred
const readyStateChange = _this.isReady !== true;
_this.isReady = true;
const isSsr = _this.isSsr;
if (!isQueryUpdating) {
_this.isSsr = false;
}
// if a route transition is already in progress before
// the query updating is triggered ignore query updating
if (isQueryUpdating && _this.clc) {
return false;
}
const prevLocale = nextState.locale;
if (false) { var ref; }
// marking route changes as a navigation start entry
if (_utils.ST) {
performance.mark("routeChange");
}
const { shallow =false , scroll =true } = options;
const routeProps = {
shallow
};
if (_this._inFlightRoute && _this.clc) {
if (!isSsr) {
Router.events.emit("routeChangeError", buildCancellationError(), _this._inFlightRoute, routeProps);
}
_this.clc();
_this.clc = null;
}
as = (0, _addBasePath).addBasePath((0, _addLocale).addLocale((0, _hasBasePath).hasBasePath(as) ? (0, _removeBasePath).removeBasePath(as) : as, options.locale, _this.defaultLocale));
const cleanedAs = (0, _removeLocale).removeLocale((0, _hasBasePath).hasBasePath(as) ? (0, _removeBasePath).removeBasePath(as) : as, nextState.locale);
_this._inFlightRoute = as;
const localeChange = prevLocale !== nextState.locale;
// If the url change is only related to a hash change
// We should not proceed. We should only change the state.
if (!isQueryUpdating && _this.onlyAHashChange(cleanedAs) && !localeChange) {
nextState.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, _extends({}, options, {
scroll: false
}));
if (scroll) {
_this.scrollToHash(cleanedAs);
}
try {
yield _this.set(nextState, _this.components[nextState.route], null);
} catch (err) {
if ((0, _isError).default(err) && err.cancelled) {
Router.events.emit("routeChangeError", err, cleanedAs, routeProps);
}
throw err;
}
Router.events.emit("hashChangeComplete", as, routeProps);
return true;
}
let parsed = (0, _parseRelativeUrl).parseRelativeUrl(url);
let { pathname , query } = parsed;
// 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
let pages, rewrites;
try {
[pages, { __rewrites: rewrites }] = yield Promise.all([
_this.pageLoader.getPageList(),
(0, _routeLoader).getClientBuildManifest(),
_this.pageLoader.getMiddleware()
]);
} catch (err1) {
// If we fail to resolve the page list or client-build manifest, we must
// do a server-side transition:
handleHardNavigation({
url: as,
router: _this
});
return false;
}
// 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
let 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, _removeTrailingSlash).removeTrailingSlash((0, _removeBasePath).removeBasePath(pathname)) : pathname;
let route = (0, _removeTrailingSlash).removeTrailingSlash(pathname);
const parsedAsPathname = as.startsWith("/") && (0, _parseRelativeUrl).parseRelativeUrl(as).pathname;
const isMiddlewareRewrite = !!(parsedAsPathname && route !== parsedAsPathname && (!(0, _isDynamic).isDynamicRoute(route) || !(0, _routeMatcher).getRouteMatcher((0, _routeRegex).getRouteRegex(route))(parsedAsPathname)));
// we don't attempt resolve asPath when we need to execute
// middleware as the resolving will occur server-side
const isMiddlewareMatch = !options.shallow && (yield matchesMiddleware({
asPath: as,
locale: nextState.locale,
router: _this
}));
if (isQueryUpdating && isMiddlewareMatch) {
shouldResolveHref = false;
}
if (shouldResolveHref && pathname !== "/_error") {
options._shouldResolveHref = true;
if (false) {} else {
parsed.pathname = resolveDynamicRoute(pathname, pages);
if (parsed.pathname !== pathname) {
pathname = parsed.pathname;
parsed.pathname = (0, _addBasePath).addBasePath(pathname);
if (!isMiddlewareMatch) {
url = (0, _formatUrl).formatWithValidation(parsed);
}
}
}
}
if (!isLocalURL(as)) {
if (true) {
throw new Error(`Invalid href: "${url}" and as: "${as}", received relative href and external as` + `\nSee more info: https://nextjs.org/docs/messages/invalid-relative-url-external-as`);
}
handleHardNavigation({
url: as,
router: _this
});
return false;
}
resolvedAs = (0, _removeLocale).removeLocale((0, _removeBasePath).removeBasePath(resolvedAs), nextState.locale);
route = (0, _removeTrailingSlash).removeTrailingSlash(pathname);
let routeMatch = false;
if ((0, _isDynamic).isDynamicRoute(route)) {
const parsedAs1 = (0, _parseRelativeUrl).parseRelativeUrl(resolvedAs);
const asPathname = parsedAs1.pathname;
const routeRegex = (0, _routeRegex).getRouteRegex(route);
routeMatch = (0, _routeMatcher).getRouteMatcher(routeRegex)(asPathname);
const shouldInterpolate = route === asPathname;
const interpolatedAs = shouldInterpolate ? interpolateAs(route, asPathname, query) : {};
if (!routeMatch || shouldInterpolate && !interpolatedAs.result) {
const missingParams = Object.keys(routeRegex.groups).filter((param)=>!query[param] && !routeRegex.groups[param].optional);
if (missingParams.length > 0 && !isMiddlewareMatch) {
if (true) {
console.warn(`${shouldInterpolate ? `Interpolating href` : `Mismatching \`as\` and \`href\``} failed to manually provide ` + `the params: ${missingParams.join(", ")} in the \`href\`'s \`query\``);
}
throw new Error((shouldInterpolate ? `The provided \`href\` (${url}) value is missing query values (${missingParams.join(", ")}) to be interpolated properly. ` : `The provided \`as\` value (${asPathname}) is incompatible with the \`href\` value (${route}). `) + `Read more: https://nextjs.org/docs/messages/${shouldInterpolate ? "href-interpolation-failed" : "incompatible-href-as"}`);
}
} else if (shouldInterpolate) {
as = (0, _formatUrl).formatWithValidation(Object.assign({}, parsedAs1, {
pathname: interpolatedAs.result,
query: omit(query, interpolatedAs.params)
}));
} else {
// Merge params into `query`, overwriting any specified in search
Object.assign(query, routeMatch);
}
}
if (!isQueryUpdating) {
Router.events.emit("routeChangeStart", as, routeProps);
}
try {
var ref2, ref3, ref4;
let routeInfo = yield _this.getRouteInfo({
route,
pathname,
query,
as,
resolvedAs,
routeProps,
locale: nextState.locale,
isPreview: nextState.isPreview,
hasMiddleware: isMiddlewareMatch,
unstable_skipClientCache: options.unstable_skipClientCache,
isQueryUpdating: isQueryUpdating && !_this.isFallback,
isMiddlewareRewrite
});
if ("route" in routeInfo && isMiddlewareMatch) {
pathname = routeInfo.route || route;
route = pathname;
if (!routeProps.shallow) {
query = Object.assign({}, routeInfo.query || {}, query);
}
const cleanedParsedPathname = (0, _hasBasePath).hasBasePath(parsed.pathname) ? (0, _removeBasePath).removeBasePath(parsed.pathname) : parsed.pathname;
if (routeMatch && pathname !== cleanedParsedPathname) {
Object.keys(routeMatch).forEach((key)=>{
if (routeMatch && query[key] === routeMatch[key]) {
delete query[key];
}
});
}
if ((0, _isDynamic).isDynamicRoute(pathname)) {
const prefixedAs = !routeProps.shallow && routeInfo.resolvedAs ? routeInfo.resolvedAs : (0, _addBasePath).addBasePath((0, _addLocale).addLocale(new URL(as, location.href).pathname, nextState.locale), true);
let rewriteAs = prefixedAs;
if ((0, _hasBasePath).hasBasePath(rewriteAs)) {
rewriteAs = (0, _removeBasePath).removeBasePath(rewriteAs);
}
if (false) {}
const routeRegex1 = (0, _routeRegex).getRouteRegex(pathname);
const curRouteMatch = (0, _routeMatcher).getRouteMatcher(routeRegex1)(new URL(rewriteAs, location.href).pathname);
if (curRouteMatch) {
Object.assign(query, curRouteMatch);
}
}
}
// If the routeInfo brings a redirect we simply apply it.
if ("type" in routeInfo) {
if (routeInfo.type === "redirect-internal") {
return _this.change(method, routeInfo.newUrl, routeInfo.newAs, options);
} else {
handleHardNavigation({
url: routeInfo.destination,
router: _this
});
return new Promise(()=>{});
}
}
const component = routeInfo.Component;
if (component && component.unstable_scriptLoader) {
const scripts = [].concat(component.unstable_scriptLoader());
scripts.forEach((script)=>{
(0, _script).handleClientScriptLoad(script.props);
});
}
// handle redirect on client-transition
if ((routeInfo.__N_SSG || routeInfo.__N_SSP) && routeInfo.props) {
if (routeInfo.props.pageProps && routeInfo.props.pageProps.__N_REDIRECT) {
// Use the destination from redirect without adding locale
options.locale = false;
const destination = routeInfo.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("/") && routeInfo.props.pageProps.__N_REDIRECT_BASE_PATH !== false) {
const parsedHref = (0, _parseRelativeUrl).parseRelativeUrl(destination);
parsedHref.pathname = resolveDynamicRoute(parsedHref.pathname, pages);
const { url: newUrl , as: newAs } = prepareUrlAs(_this, destination, destination);
return _this.change(method, newUrl, newAs, options);
}
handleHardNavigation({
url: destination,
router: _this
});
return new Promise(()=>{});
}
nextState.isPreview = !!routeInfo.props.__N_PREVIEW;
// handle SSG data 404
if (routeInfo.props.notFound === SSG_DATA_NOT_FOUND) {
let notFoundRoute;
try {
yield _this.fetchComponent("/404");
notFoundRoute = "/404";
} catch (_) {
notFoundRoute = "/_error";
}
routeInfo = yield _this.getRouteInfo({
route: notFoundRoute,
pathname: notFoundRoute,
query,
as,
resolvedAs,
routeProps: {
shallow: false
},
locale: nextState.locale,
isPreview: nextState.isPreview
});
if ("type" in routeInfo) {
throw new Error(`Unexpected middleware effect on /404`);
}
}
}
if (isQueryUpdating && _this.pathname === "/_error" && ((ref2 = self.__NEXT_DATA__.props) == null ? void 0 : (ref3 = ref2.pageProps) == null ? void 0 : ref3.statusCode) === 500 && ((ref4 = routeInfo.props) == null ? void 0 : ref4.pageProps)) {
// ensure statusCode is still correct for static 500 page
// when updating query information
routeInfo.props.pageProps.statusCode = 500;
}
var _route;
// shallow routing is only allowed for same page URL changes.
const isValidShallowRoute = options.shallow && nextState.route === ((_route = routeInfo.route) != null ? _route : route);
var _scroll;
const shouldScroll = (_scroll = options.scroll) != null ? _scroll : !isQueryUpdating && !isValidShallowRoute;
const resetScroll = shouldScroll ? {
x: 0,
y: 0
} : null;
const upcomingScrollState = forcedScroll != null ? forcedScroll : resetScroll;
// the new state that the router gonna set
const upcomingRouterState = _extends({}, nextState, {
route,
pathname,
query,
asPath: cleanedAs,
isFallback: false
});
// When the page being rendered is the 404 page, we should only update the
// query parameters. Route changes here might add the basePath when it
// wasn't originally present. This is also why this block is before the
// below `changeState` call which updates the browser's history (changing
// the URL).
if (isQueryUpdating && (_this.pathname === "/404" || _this.pathname === "/_error")) {
var ref5, ref6, ref7;
routeInfo = yield _this.getRouteInfo({
route: _this.pathname,
pathname: _this.pathname,
query,
as,
resolvedAs,
routeProps: {
shallow: false
},
locale: nextState.locale,
isPreview: nextState.isPreview
});
if ("type" in routeInfo) {
throw new Error(`Unexpected middleware effect on ${_this.pathname}`);
}
if (_this.pathname === "/_error" && ((ref5 = self.__NEXT_DATA__.props) == null ? void 0 : (ref6 = ref5.pageProps) == null ? void 0 : ref6.statusCode) === 500 && ((ref7 = routeInfo.props) == null ? void 0 : ref7.pageProps)) {
// ensure statusCode is still correct for static 500 page
// when updating query information
routeInfo.props.pageProps.statusCode = 500;
}
try {
yield _this.set(upcomingRouterState, routeInfo, upcomingScrollState);
} catch (err2) {
if ((0, _isError).default(err2) && err2.cancelled) {
Router.events.emit("routeChangeError", err2, cleanedAs, routeProps);
}
throw err2;
}
return true;
}
Router.events.emit("beforeHistoryChange", as, routeProps);
_this.changeState(method, url, as, options);
// for query updates we can skip it if the state is unchanged and we don't
// need to scroll
// https://github.com/vercel/next.js/issues/37139
const canSkipUpdating = isQueryUpdating && !upcomingScrollState && !readyStateChange && !localeChange && (0, _compareStates).compareRouterStates(upcomingRouterState, _this.state);
if (!canSkipUpdating) {
try {
yield _this.set(upcomingRouterState, routeInfo, upcomingScrollState);
} catch (e) {
if (e.cancelled) routeInfo.error = routeInfo.error || e;
else throw e;
}
if (routeInfo.error) {
if (!isQueryUpdating) {
Router.events.emit("routeChangeError", routeInfo.error, cleanedAs, routeProps);
}
throw routeInfo.error;
}
if (false) {}
if (!isQueryUpdating) {
Router.events.emit("routeChangeComplete", as, routeProps);
}
// A hash mark # is the optional last part of a URL
const hashRegex = /#.+$/;
if (shouldScroll && hashRegex.test(as)) {
_this.scrollToHash(as);
}
}
return true;
} catch (err11) {
if ((0, _isError).default(err11) && err11.cancelled) {
return false;
}
throw err11;
}
})();
}
changeState(method, url, as, options = {}) {
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.${method} is not available`);
return;
}
}
if (method !== "pushState" || (0, _utils).getURL() !== as) {
this._shallow = options.shallow;
window.history[method]({
url,
as,
options,
__N: true,
key: this._key = method !== "pushState" ? this._key : createKey()
}, // 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);
}
}
handleRouteInfoError(err, pathname, query, as, routeProps, loadErrorFail) {
var _this = this;
return _async_to_generator(function*() {
console.error(err);
if (err.cancelled) {
// bubble up cancellation errors
throw err;
}
if ((0, _routeLoader).isAssetError(err) || loadErrorFail) {
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.
handleHardNavigation({
url: as,
router: _this
});
// Changing the URL doesn't block executing the current code path.
// So let's throw a cancellation error stop the routing logic.
throw buildCancellationError();
}
try {
let props;
const { page: Component , styleSheets } = yield _this.fetchComponent("/_error");
const routeInfo = {
props,
Component,
styleSheets,
err,
error: err
};
if (!routeInfo.props) {
try {
routeInfo.props = yield _this.getInitialProps(Component, {
err,
pathname,
query
});
} catch (gipErr) {
console.error("Error in error page `getInitialProps`: ", gipErr);
routeInfo.props = {};
}
}
return routeInfo;
} catch (routeInfoErr) {
return _this.handleRouteInfoError((0, _isError).default(routeInfoErr) ? routeInfoErr : new Error(routeInfoErr + ""), pathname, query, as, routeProps, true);
}
})();
}
getRouteInfo({ route: requestedRoute , pathname , query , as , resolvedAs , routeProps , locale , hasMiddleware , isPreview , unstable_skipClientCache , isQueryUpdating , isMiddlewareRewrite }) {
var _this = this;
return _async_to_generator(function*() {
/**
* This `route` binding can change if there's a rewrite
* so we keep a reference to the original requested route
* so we can store the cache for it and avoid re-requesting every time
* for shallow routing purposes.
*/ let route = requestedRoute;
try {
var ref, ref8, ref9, ref10;
const handleCancelled = getCancelledHandler({
route,
router: _this
});
let existingInfo = _this.components[route];
if (routeProps.shallow && existingInfo && _this.route === route) {
return existingInfo;
}
if (hasMiddleware) {
existingInfo = undefined;
}
let cachedRouteInfo = existingInfo && !("initial" in existingInfo) && "development" !== "development" ? 0 : undefined;
const isBackground = isQueryUpdating;
const fetchNextDataParams = {
dataHref: _this.pageLoader.getDataHref({
href: (0, _formatUrl).formatWithValidation({
pathname,
query
}),
skipInterpolation: true,
asPath: resolvedAs,
locale
}),
hasMiddleware: true,
isServerRender: _this.isSsr,
parseJSON: true,
inflightCache: isBackground ? _this.sbc : _this.sdc,
persistCache: !isPreview,
isPrefetch: false,
unstable_skipClientCache,
isBackground
};
let data = isQueryUpdating && !isMiddlewareRewrite ? null : yield withMiddlewareEffects({
fetchData: ()=>fetchNextData(fetchNextDataParams),
asPath: resolvedAs,
locale: locale,
router: _this
}).catch((err)=>{
// we don't hard error during query updating
// as it's un-necessary and doesn't need to be fatal
// unless it is a fallback route and the props can't
// be loaded
if (isQueryUpdating) {
return null;
}
throw err;
});
if (isQueryUpdating) {
if (!data) {
data = {
json: self.__NEXT_DATA__.props
};
} else {
data.json = self.__NEXT_DATA__.props;
}
}
handleCancelled();
if ((data == null ? void 0 : (ref = data.effect) == null ? void 0 : ref.type) === "redirect-internal" || (data == null ? void 0 : (ref8 = data.effect) == null ? void 0 : ref8.type) === "redirect-external") {
return data.effect;
}
if ((data == null ? void 0 : (ref9 = data.effect) == null ? void 0 : ref9.type) === "rewrite") {
const resolvedRoute = (0, _removeTrailingSlash).removeTrailingSlash(data.effect.resolvedHref);
const pages = yield _this.pageLoader.getPageList();
// during query updating the page must match although during
// client-transition a redirect that doesn't match a page
// can be returned and this should trigger a hard navigation
// which is valid for incremental migration
if (!isQueryUpdating || pages.includes(resolvedRoute)) {
route = resolvedRoute;
pathname = data.effect.resolvedHref;
query = _extends({}, query, data.effect.parsedAs.query);
resolvedAs = (0, _removeBasePath).removeBasePath((0, _normalizeLocalePath).normalizeLocalePath(data.effect.parsedAs.pathname, _this.locales).pathname);
// Check again the cache with the new destination.
existingInfo = _this.components[route];
if (routeProps.shallow && existingInfo && _this.route === route && !hasMiddleware) {
// If we have a match with the current route due to rewrite,
// we can copy the existing information to the rewritten one.
// Then, we return the information along with the matched route.
return _extends({}, existingInfo, {
route
});
}
}
}
if ((0, _isApiRoute).isAPIRoute(route)) {
handleHardNavigation({
url: as,
router: _this
});
return new Promise(()=>{});
}
const routeInfo = cachedRouteInfo || (yield _this.fetchComponent(route).then((res)=>({
Component: res.page,
styleSheets: res.styleSheets,
__N_SSG: res.mod.__N_SSG,
__N_SSP: res.mod.__N_SSP
})));
if (true) {
const { isValidElementType } = __webpack_require__(/*! next/dist/compiled/react-is */ "next/dist/compiled/react-is");
if (!isValidElementType(routeInfo.Component)) {
throw new Error(`The default export is not a React Component in page: "${pathname}"`);
}
}
const wasBailedPrefetch = data == null ? void 0 : (ref10 = data.response) == null ? void 0 : ref10.headers.get("x-middleware-skip");
const shouldFetchData = routeInfo.__N_SSG || routeInfo.__N_SSP;
// For non-SSG prefetches that bailed before sending data
// we clear the cache to fetch full response
if (wasBailedPrefetch && (data == null ? void 0 : data.dataHref)) {
delete _this.sdc[data.dataHref];
}
const { props , cacheKey } = yield _this._getData(_async_to_generator(function*() {
if (shouldFetchData) {
if ((data == null ? void 0 : data.json) && !wasBailedPrefetch) {
return {
cacheKey: data.cacheKey,
props: data.json
};
}
const dataHref = (data == null ? void 0 : data.dataHref) ? data.dataHref : _this.pageLoader.getDataHref({
href: (0, _formatUrl).formatWithValidation({
pathname,
query
}),
asPath: resolvedAs,
locale
});
const fetched = yield fetchNextData({
dataHref,
isServerRender: _this.isSsr,
parseJSON: true,
inflightCache: wasBailedPrefetch ? {} : _this.sdc,
persistCache: !isPreview,
isPrefetch: false,
unstable_skipClientCache
});
return {
cacheKey: fetched.cacheKey,
props: fetched.json || {}
};
}
return {
headers: {},
props: yield _this.getInitialProps(routeInfo.Component, {
pathname,
query,
asPath: as,
locale,
locales: _this.locales,
defaultLocale: _this.defaultLocale
})
};
}));
// Only bust the data cache for SSP routes although
// middleware can skip cache per request with
// x-middleware-cache: no-cache as well
if (routeInfo.__N_SSP && fetchNextDataParams.dataHref && cacheKey) {
delete _this.sdc[cacheKey];
}
// we kick off a HEAD request in the background
// when a non-prefetch request is made to signal revalidation
if (!_this.isPreview && routeInfo.__N_SSG && "development" !== "development" && 0) {}
props.pageProps = Object.assign({}, props.pageProps);
routeInfo.props = props;
routeInfo.route = route;
routeInfo.query = query;
routeInfo.resolvedAs = resolvedAs;
_this.components[route] = routeInfo;
return routeInfo;
} catch (err) {
return _this.handleRouteInfoError((0, _isError).getProperError(err), pathname, query, as, routeProps);
}
})();
}
set(state, data, resetScroll) {
this.state = state;
return this.sub(data, this.components["/_app"].Component, resetScroll);
}
/**
* Callback to execute before replacing router state
* @param cb callback to be executed
*/ beforePopState(cb) {
this._bps = cb;
}
onlyAHashChange(as) {
if (!this.asPath) return false;
const [oldUrlNoHash, oldHash] = this.asPath.split("#");
const [newUrlNoHash, newHash] = as.split("#");
// 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;
}
scrollToHash(as) {
const [, hash = ""] = as.split("#");
// Scroll to top if the hash is just `#` with no value or `#top`
// To mirror browsers
if (hash === "" || hash === "top") {
handleSmoothScroll(()=>window.scrollTo(0, 0));
return;
}
// Decode hash to make non-latin anchor works.
const rawHash = decodeURIComponent(hash);
// First we check if the element by id is found
const idEl = document.getElementById(rawHash);
if (idEl) {
handleSmoothScroll(()=>idEl.scrollIntoView());
return;
}
// If there's no element with the id, we check the `name` property
// To mirror browsers
const nameEl = document.getElementsByName(rawHash)[0];
if (nameEl) {
handleSmoothScroll(()=>nameEl.scrollIntoView());
}
}
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
*/ prefetch(url, asPath = url, options = {}) {
var _this = this;
return _async_to_generator(function*() {
// Prefetch is not supported in development mode because it would trigger on-demand-entries
if (true) {
return;
}
if (false) {}
let parsed = (0, _parseRelativeUrl).parseRelativeUrl(url);
let { pathname , query } = parsed;
const originalPathname = pathname;
if (false) {}
const pages = yield _this.pageLoader.getPageList();
let resolvedAs = asPath;
const locale = typeof options.locale !== "undefined" ? options.locale || undefined : _this.locale;
const isMiddlewareMatch = yield matchesMiddleware({
asPath: asPath,
locale: locale,
router: _this
});
if (false) {}
parsed.pathname = resolveDynamicRoute(parsed.pathname, pages);
if ((0, _isDynamic).isDynamicRoute(parsed.pathname)) {
pathname = parsed.pathname;
parsed.pathname = pathname;
Object.assign(query, (0, _routeMatcher).getRouteMatcher((0, _routeRegex).getRouteRegex(parsed.pathname))((0, _parsePath).parsePath(asPath).pathname) || {});
if (!isMiddlewareMatch) {
url = (0, _formatUrl).formatWithValidation(parsed);
}
}
const data = false ? 0 : yield withMiddlewareEffects({
fetchData: ()=>fetchNextData({
dataHref: _this.pageLoader.getDataHref({
href: (0, _formatUrl).formatWithValidation({
pathname: originalPathname,
query
}),
skipInterpolation: true,
asPath: resolvedAs,
locale
}),
hasMiddleware: true,
isServerRender: _this.isSsr,
parseJSON: true,
inflightCache: _this.sdc,
persistCache: !_this.isPreview,
isPrefetch: true
}),
asPath: asPath,
locale: locale,
router: _this
});
/**
* If there was a rewrite we apply the effects of the rewrite on the
* current parameters for the prefetch.
*/ if ((data == null ? void 0 : data.effect.type) === "rewrite") {
parsed.pathname = data.effect.resolvedHref;
pathname = data.effect.resolvedHref;
query = _extends({}, query, data.effect.parsedAs.query);
resolvedAs = data.effect.parsedAs.pathname;
url = (0, _formatUrl).formatWithValidation(parsed);
}
/**
* If there is a redirect to an external destination then we don't have
* to prefetch content as it will be unused.
*/ if ((data == null ? void 0 : data.effect.type) === "redirect-external") {
return;
}
const route = (0, _removeTrailingSlash).removeTrailingSlash(pathname);
yield Promise.all([
_this.pageLoader._isSsg(route).then((isSsg)=>{
return isSsg ? fetchNextData({
dataHref: (data == null ? void 0 : data.json) ? data == null ? void 0 : data.dataHref : _this.pageLoader.getDataHref({
href: url,
asPath: resolvedAs,
locale: locale
}),
isServerRender: false,
parseJSON: true,
inflightCache: _this.sdc,
persistCache: !_this.isPreview,
isPrefetch: true,
unstable_skipClientCache: options.unstable_skipClientCache || options.priority && !!true
}).then(()=>false) : false;
}),
_this.pageLoader[options.priority ? "loadPage" : "prefetch"](route)
]);
})();
}
fetchComponent(route) {
var _this = this;
return _async_to_generator(function*() {
const handleCancelled = getCancelledHandler({
route,
router: _this
});
try {
const componentResult = yield _this.pageLoader.loadPage(route);
handleCancelled();
return componentResult;
} catch (err) {
handleCancelled();
throw err;
}
})();
}
_getData(fn) {
let cancelled = false;
const cancel = ()=>{
cancelled = true;
};
this.clc = cancel;
return fn().then((data)=>{
if (cancel === this.clc) {
this.clc = null;
}
if (cancelled) {
const err = new Error("Loading initial props cancelled");
err.cancelled = true;
throw err;
}
return data;
});
}
_getFlightData(dataHref) {
// Do not cache RSC flight response since it's not a static resource
return fetchNextData({
dataHref,
isServerRender: true,
parseJSON: false,
inflightCache: this.sdc,
persistCache: false,
isPrefetch: false
}).then(({ text })=>({
data: text
}));
}
getInitialProps(Component, ctx) {
const { Component: App } = this.components["/_app"];
const AppTree = this._wrapApp(App);
ctx.AppTree = AppTree;
return (0, _utils).loadGetInitialProps(App, {
AppTree,
Component,
router: this,
ctx
});
}
get route() {
return this.state.route;
}
get pathname() {
return this.state.pathname;
}
get query() {
return this.state.query;
}
get asPath() {
return this.state.asPath;
}
get locale() {
return this.state.locale;
}
get isFallback() {
return this.state.isFallback;
}
get isPreview() {
return this.state.isPreview;
}
constructor(pathname1, query1, as1, { initialProps , pageLoader , App , wrapApp , Component , err , subscription , isFallback , locale , locales , defaultLocale , domainLocales , isPreview }){
// Server Data Cache (full data requests)
this.sdc = {};
// Server Background Cache (HEAD requests)
this.sbc = {};
this.isFirstPopStateEvent = true;
this._key = createKey();
this.onPopState = (e)=>{
const { isFirstPopStateEvent } = this;
this.isFirstPopStateEvent = false;
const 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.
const { pathname , query } = this;
this.changeState("replaceState", (0, _formatUrl).formatWithValidation({
pathname: (0, _addBasePath).addBasePath(pathname),
query
}), (0, _utils).getURL());
return;
}
// __NA is used to identify if the history entry can be handled by the app-router.
if (state.__NA) {
window.location.reload();
return;
}
if (!state.__N) {
return;
}
// Safari fires popstateevent when reopening the browser.
if (isFirstPopStateEvent && this.locale === state.options.locale && state.as === this.asPath) {
return;
}
let forcedScroll;
const { url , as , options , key } = state;
if (false) {}
this._key = key;
const { pathname: pathname1 } = (0, _parseRelativeUrl).parseRelativeUrl(url);
// Make sure we don't re-render on initial load,
// can be caused by navigating back from an external site
if (this.isSsr && as === (0, _addBasePath).addBasePath(this.asPath) && pathname1 === (0, _addBasePath).addBasePath(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,
// @ts-ignore internal value not exposed on types
_h: 0
}), forcedScroll);
};
// represents the current component key
const route = (0, _removeTrailingSlash).removeTrailingSlash(pathname1);
// 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 (pathname1 !== "/_error") {
this.components[route] = {
Component,
initial: true,
props: initialProps,
err,
__N_SSG: initialProps && initialProps.__N_SSG,
__N_SSP: initialProps && initialProps.__N_SSP
};
}
this.components["/_app"] = {
Component: App,
styleSheets: []
};
// 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;
// if auto prerendered and dynamic route wait to update asPath
// until after mount to prevent hydration mismatch
const autoExportDynamic = (0, _isDynamic).isDynamicRoute(pathname1) && self.__NEXT_DATA__.autoExport;
this.basePath = false || "";
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.isLocaleDomain = false;
this.isReady = !!(self.__NEXT_DATA__.gssp || self.__NEXT_DATA__.gip || self.__NEXT_DATA__.appGip && !self.__NEXT_DATA__.gsp || !autoExportDynamic && !self.location.search && !false);
if (false) {}
this.state = {
route,
pathname: pathname1,
query: query1,
asPath: autoExportDynamic ? pathname1 : as1,
isPreview: !!isPreview,
locale: false ? 0 : undefined,
isFallback
};
this._initialMatchesMiddlewarePromise = Promise.resolve(false);
if (false) {}
}
}
Router.events = (0, _mitt).default();
exports["default"] = Router; //# sourceMappingURL=router.js.map
<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><03>x8<>AAAa;AACbA,8CAA6C;IACzCG,OAAO,IAAI;AACf,CAAC,EAAC;AACFD,yBAAyB,GAAGE;AAC5BF,kBAAkB,GAAGG;AACrBH,qBAAqB,GAAGI;AACxBJ,mBAAmB,GAAGK;AACtBL,iBAAiB,GAAGM;AACpBN,kBAAe,GAAG,KAAK;AACvB,IAAIQ,sBAAsBC,yIAA0D;AACpF,IAAIC,WAAWD,mHAA+C;AAC9D,IAAIE,2BAA2BF,mJAA+D;AAC9F,IAAIG,4BAA4BH,qJAAgE;AAChG,IAAII,0BAA0BJ,mBAAOA,CAAC,6GAA0C;AAChF,IAAIK,uBAAuBL,mBAAOA,CAAC,uFAA+B;AAClE,IAAIM,eAAeN,mBAAOA,CAAC,qFAA8B;AACzD,IAAIO,UAAUP,mBAAOA,CAAC,yEAAwB;AAC9C,IAAIQ,WAAWL,0BAA0BH,mBAAOA,CAAC,uEAAuB;AACxE,IAAIS,uBAAuBT,mBAAOA,CAAC,8EAAoC;AACvE,IAAIU,uBAAuBV,mBAAOA,CAAC,oEAA+B;AAClE,IAAIW,QAAQT,yBAAyBF,mBAAOA,CAAC,wBAAS;AACtD,IAAIY,SAASZ,mBAAOA,CAAC,0BAAU;AAC/B,IAAIa,aAAab,mBAAOA,CAAC,8CAAoB;AAC7C,IAAIc,oBAAoBd,mBAAOA,CAAC,8DAA4B;AAC5D,IAAIe,eAAef,mBAAOA,CAAC,gDAAqB;AAChD,IAAIgB,mBAAmBd,yBAAyBF,mBAAOA,CAAC,0DAA0B;AAClF,IAAIiB,gBAAgBjB,mBAAOA,CAAC,oDAAuB;AACnD,IAAIkB,cAAclB,mBAAOA,CAAC,gDAAqB;AAC/C,IAAImB,aAAanB,mBAAOA,CAAC,iEAAoB;AAC7C,IAAIoB,sBAAsBpB,mBAAOA,CAAC,qGAAsC;AACxE,IAAIqB,aAAarB,mBAAOA,CAAC,iEAAoB;AAC7C,IAAIsB,aAAatB,mBAAOA,CAAC,iFAA4B;AACrD,IAAIuB,gBAAgBvB,mBAAOA,CAAC,uFAA+B;AAC3D,IAAIwB,kBAAkBxB,mBAAOA,CAAC,6FAAkC;AAChE,IAAIyB,eAAezB,mBAAOA,CAAC,uFAA+B;AAC1D,IAAI0B,eAAe1B,mBAAOA,CAAC,uFAA+B;AAC1D,IAAI2B,cAAc3B,mBAAOA,CAAC,+EAA2B;AACrD,IAAI4B,uBAAuB5B,mBAAOA,CAAC,sEAAgC;AACnE,IAAI6B,0BAA0B7B,mBAAOA,CAAC,4EAAmC;AACzE,IAAI8B,iBAAiB9B,mBAAOA,CAAC,sDAAwB;AACrD,IAAI+B,SAAS/B,mBAAOA,CAAC,sCAAgB;AACrC,SAASgC,yBAAyB;IAC9B,OAAO3C,OAAO4C,MAAM,CAAC,IAAIC,MAAM,oBAAoB;QAC/CC,WAAW,IAAI;IACnB;AACJ;AACA,SAAS1C,kBAAkB2C,OAAO,EAAE;IAChC,OAAOC,mBAAmBC,KAAK,CAAC,IAAI,EAAEC;AAC1C;AACA,SAASF,qBAAqB;IAC1BA,qBAAqBtC,oBAAoB,UAAUqC,OAAO,EAAE;QACxD,MAAMI,WAAW,MAAMC,QAAQC,OAAO,CAACN,QAAQO,MAAM,CAACC,UAAU,CAACC,aAAa;QAC9E,IAAI,CAACL,UAAU,OAAO,KAAK;QAC3B,MAAM,EAAEM,UAAUC,WAAU,EAAG,GAAG,CAAC,GAAG1B,UAAU,EAAE2B,SAAS,CAACZ,QAAQa,MAAM;QAC1E,6FAA6F;QAC7F,MAAMC,YAAY,CAAC,GAAGxB,YAAY,EAAEyB,WAAW,CAACJ,cAAc,CAAC,GAAGvB,eAAe,EAAE4B,cAAc,CAACL,cAAcA,UAAU;QAC1H,MAAMM,0BAA0B,CAAC,GAAG5B,YAAY,EAAE6B,WAAW,CAAC,CAAC,GAAGhC,UAAU,EAAEiC,SAAS,CAACL,WAAWd,QAAQoB,MAAM;QACjH,2EAA2E;QAC3E,uEAAuE;QACvE,OAAOhB,SAASiB,IAAI,CAAC,CAACC,IAAI,IAAIC,OAAOD,EAAEE,MAAM,EAAEC,IAAI,CAACR;IACxD;IACA,OAAOhB,mBAAmBC,KAAK,CAAC,IAAI,EAAEC;AAC1C;AACA,SAASuB,YAAYC,GAAG,EAAE;IACtB,MAAMC,SAAS,CAAC,GAAGpD,MAAM,EAAEqD,iBAAiB;IAC5C,OAAOF,IAAIG,UAAU,CAACF,UAAUD,IAAII,SAAS,CAACH,OAAOI,MAAM,IAAIL,GAAG;AACtE;AACA,SAASM,KAAKC,MAAM,EAAEC,IAAI,EAAE;IACxB,MAAMC,UAAU,CAAC;IACjBnF,OAAOkF,IAAI,CAACD,QAAQG,OAAO,CAAC,CAACC,MAAM;QAC/B,IAAI,CAACH,KAAKI,QAAQ,CAACD,MAAM;YACrBF,OAAO,CAACE,IAAI,GAAGJ,MAAM,CAACI,IAAI;QAC9B,CAAC;IACL;IACA,OAAOF;AACX;AACA,SAAS9E,WAAWqE,GAAG,EAAE;IACrB,gEAAgE;IAChE,IAAI,CAAC,CAAC,GAAGnD,MAAM,EAAEgE,aAAa,CAACb,MAAM,OAAO,IAAI;IAChD,IAAI;QACA,4DAA4D;QAC5D,MAAMc,iBAAiB,CAAC,GAAGjE,MAAM,EAAEqD,iBAAiB;QACpD,MAAMa,WAAW,IAAIC,IAAIhB,KAAKc;QAC9B,OAAOC,SAASd,MAAM,KAAKa,kBAAkB,CAAC,GAAGnD,YAAY,EAAEyB,WAAW,CAAC2B,SAAShC,QAAQ;IAChG,EAAE,OAAOkC,GAAG;QACR,OAAO,KAAK;IAChB;AACJ;AACA,SAASrF,cAAcsF,KAAK,EAAElC,UAAU,EAAEmC,KAAK,EAAE;IAC7C,IAAIC,oBAAoB;IACxB,MAAMC,eAAe,CAAC,GAAGlE,WAAW,EAAEmE,aAAa,CAACJ;IACpD,MAAMK,gBAAgBF,aAAaG,MAAM;IACzC,MAAMC,iBACN,CAACzC,eAAekC,QAAQ,CAAC,GAAGhE,aAAa,EAAEwE,eAAe,CAACL,cAAcrC,cAAc,EAAE,KAAK,gDAAgD;IAC9I,sEAAsE;IACtEmC;IACAC,oBAAoBF;IACpB,MAAMS,SAASrG,OAAOkF,IAAI,CAACe;IAC3B,IAAI,CAACI,OAAOC,KAAK,CAAC,CAACC,QAAQ;QACvB,IAAIpG,QAAQgG,cAAc,CAACI,MAAM,IAAI;QACrC,MAAM,EAAEC,OAAM,EAAGC,SAAQ,EAAG,GAAGR,aAAa,CAACM,MAAM;QACnD,iCAAiC;QACjC,0DAA0D;QAC1D,IAAIG,WAAW,CAAC,CAAC,EAAEF,SAAS,QAAQ,EAAE,CAAC,EAAED,MAAM,CAAC,CAAC;QACjD,IAAIE,UAAU;YACVC,WAAW,CAAC,EAAE,CAACvG,QAAQ,MAAM,EAAE,CAAC,CAAC,EAAEuG,SAAS,CAAC,CAAC;QAClD,CAAC;QACD,IAAIF,UAAU,CAACG,MAAMC,OAAO,CAACzG,QAAQA,QAAQ;YACzCA;SACH;QACD,OAAO,CAACsG,YAAYF,SAASJ,cAAa,KAAM,6CAA6C;QAC5FL,CAAAA,oBAAoBA,kBAAkBe,OAAO,CAACH,UAAUF,SAASrG,MAAM2G,GAAG,CAC3E,uDAAuD;QACvD,kDAAkD;QAClD,oCAAoC;QACpC,CAACC,UAAUC,mBAAmBD,UAAUE,IAAI,CAAC,OAAOD,mBAAmB7G,MAAM,KAAK,GAAE;IACxF,IAAI;QACA2F,oBAAoB,GAAG,mCAAmC;;IAE9D,uEAAuE;IACvE,kDAAkD;IAClD,CAAC;IACD,OAAO;QACHO;QACAa,QAAQpB;IACZ;AACJ;AACA,SAASvF,YAAY+C,MAAM,EAAE6D,IAAI,EAAEC,SAAS,EAAE;IAC1
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.matchesMiddleware = matchesMiddleware;
exports.isLocalURL = isLocalURL;
exports.interpolateAs = interpolateAs;
exports.resolveHref = resolveHref;
exports.createKey = createKey;
exports.default = void 0;
var _async_to_generator = require("@swc/helpers/lib/_async_to_generator.js").default;
var _extends = require("@swc/helpers/lib/_extends.js").default;
var _interop_require_default = require("@swc/helpers/lib/_interop_require_default.js").default;
var _interop_require_wildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
var _normalizeTrailingSlash = require("../../../client/normalize-trailing-slash");
var _removeTrailingSlash = require("./utils/remove-trailing-slash");
var _routeLoader = require("../../../client/route-loader");
var _script = require("../../../client/script");
var _isError = _interop_require_wildcard(require("../../../lib/is-error"));
var _denormalizePagePath = require("../page-path/denormalize-page-path");
var _normalizeLocalePath = require("../i18n/normalize-locale-path");
var _mitt = _interop_require_default(require("../mitt"));
var _utils = require("../utils");
var _isDynamic = require("./utils/is-dynamic");
var _parseRelativeUrl = require("./utils/parse-relative-url");
var _querystring = require("./utils/querystring");
var _resolveRewrites = _interop_require_default(require("./utils/resolve-rewrites"));
var _routeMatcher = require("./utils/route-matcher");
var _routeRegex = require("./utils/route-regex");
var _formatUrl = require("./utils/format-url");
var _detectDomainLocale = require("../../../client/detect-domain-locale");
var _parsePath = require("./utils/parse-path");
var _addLocale = require("../../../client/add-locale");
var _removeLocale = require("../../../client/remove-locale");
var _removeBasePath = require("../../../client/remove-base-path");
var _addBasePath = require("../../../client/add-base-path");
var _hasBasePath = require("../../../client/has-base-path");
var _isApiRoute = require("../../../lib/is-api-route");
var _getNextPathnameInfo = require("./utils/get-next-pathname-info");
var _formatNextPathnameInfo = require("./utils/format-next-pathname-info");
var _compareStates = require("./utils/compare-states");
var _isBot = require("./utils/is-bot");
function buildCancellationError() {
return Object.assign(new Error('Route Cancelled'), {
cancelled: true
});
}
function matchesMiddleware(options) {
return _matchesMiddleware.apply(this, arguments);
}
function _matchesMiddleware() {
_matchesMiddleware = _async_to_generator(function*(options) {
const matchers = yield Promise.resolve(options.router.pageLoader.getMiddleware());
if (!matchers) return false;
const { pathname: asPathname } = (0, _parsePath).parsePath(options.asPath);
// remove basePath first since path prefix has to be in the order of `/${basePath}/${locale}`
const cleanedAs = (0, _hasBasePath).hasBasePath(asPathname) ? (0, _removeBasePath).removeBasePath(asPathname) : asPathname;
const asWithBasePathAndLocale = (0, _addBasePath).addBasePath((0, _addLocale).addLocale(cleanedAs, options.locale));
// Check only path match on client. Matching "has" should be done on server
// where we can access more info such as headers, HttpOnly cookie, etc.
return matchers.some((m)=>new RegExp(m.regexp).test(asWithBasePathAndLocale));
});
return _matchesMiddleware.apply(this, arguments);
}
function stripOrigin(url) {
const origin = (0, _utils).getLocationOrigin();
return url.startsWith(origin) ? url.substring(origin.length) : url;
}
function omit(object, keys) {
const omitted = {};
Object.keys(object).forEach((key)=>{
if (!keys.includes(key)) {
omitted[key] = object[key];
}
});
return omitted;
}
function isLocalURL(url) {
// prevent a hydration mismatch on href for url with anchor refs
if (!(0, _utils).isAbsoluteUrl(url)) return true;
try {
// absolute urls can be local if they are on the same origin
const locationOrigin = (0, _utils).getLocationOrigin();
const resolved = new URL(url, locationOrigin);
return resolved.origin === locationOrigin && (0, _hasBasePath).hasBasePath(resolved.pathname);
} catch (_) {
return false;
}
}
function interpolateAs(route, asPathname, query) {
let interpolatedRoute = '';
const dynamicRegex = (0, _routeRegex).getRouteRegex(route);
const dynamicGroups = dynamicRegex.groups;
const 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;
const params = Object.keys(dynamicGroups);
if (!params.every((param)=>{
let value = dynamicMatches[param] || '';
const { repeat , optional } = dynamicGroups[param];
// support single-level catch-all
// TODO: more robust handling for user-error (passing `/`)
let replaced = `[${repeat ? '...' : ''}${param}]`;
if (optional) {
replaced = `${!value ? '/' : ''}[${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
(segment)=>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 `<Link>` component directly.
}
return {
params,
result: interpolatedRoute
};
}
function resolveHref(router, href, resolveAs) {
// we use a dummy base url for relative urls
let base;
let urlAsString = typeof href === 'string' ? href : (0, _formatUrl).formatWithValidation(href);
// repeated slashes and backslashes in the URL are considered
// invalid and will never match a Next.js page/file
const urlProtoMatch = urlAsString.match(/^[a-zA-Z]{1,}:\/\//);
const urlAsStringNoProto = urlProtoMatch ? urlAsString.slice(urlProtoMatch[0].length) : urlAsString;
const urlParts = urlAsStringNoProto.split('?');
if ((urlParts[0] || '').match(/(\/\/|\\)/)) {
console.error(`Invalid href passed to next/router: ${urlAsString}, repeated forward-slashes (//) or backslashes \\ are not valid in the href`);
const normalizedUrl = (0, _utils).normalizeRepeatedSlashes(urlAsStringNoProto);
urlAsString = (urlProtoMatch ? urlProtoMatch[0] : '') + normalizedUrl;
}
// Return because it cannot be routed by the Next.js router
if (!isLocalURL(urlAsString)) {
return resolveAs ? [
urlAsString
] : urlAsString;
}
try {
base = new URL(urlAsString.startsWith('#') ? router.asPath : router.pathname, 'http://n');
} catch (_) {
// fallback to / for invalid asPath values e.g. //
base = new URL('/', 'http://n');
}
try {
const finalUrl = new URL(urlAsString, base);
finalUrl.pathname = (0, _normalizeTrailingSlash).normalizePathTrailingSlash(finalUrl.pathname);
let interpolatedAs = '';
if ((0, _isDynamic).isDynamicRoute(finalUrl.pathname) && finalUrl.searchParams && resolveAs) {
const query = (0, _querystring).searchParamsToUrlQuery(finalUrl.searchParams);
const { result , params } = interpolateAs(finalUrl.pathname, finalUrl.pathname, query);
if (result) {
interpolatedAs = (0, _formatUrl).formatWithValidation({
pathname: result,
hash: finalUrl.hash,
query: omit(query, params)
});
}
}
// if the origin didn't change, it means we received a relative href
const resolvedHref = finalUrl.origin === base.origin ? finalUrl.href.slice(finalUrl.origin.length) : finalUrl.href;
return resolveAs ? [
resolvedHref,
interpolatedAs || resolvedHref
] : resolvedHref;
} catch (_1) {
return resolveAs ? [
urlAsString
] : urlAsString;
}
}
function prepareUrlAs(router, url, as) {
// If url and as provided as an object representation,
// we'll format them into the string version here.
let [resolvedHref, resolvedAs] = resolveHref(router, url, true);
const origin = (0, _utils).getLocationOrigin();
const hrefWasAbsolute = resolvedHref.startsWith(origin);
const asWasAbsolute = resolvedAs && resolvedAs.startsWith(origin);
resolvedHref = stripOrigin(resolvedHref);
resolvedAs = resolvedAs ? stripOrigin(resolvedAs) : resolvedAs;
const preparedUrl = hrefWasAbsolute ? resolvedHref : (0, _addBasePath).addBasePath(resolvedHref);
const preparedAs = as ? stripOrigin(resolveHref(router, as)) : resolvedAs || resolvedHref;
return {
url: preparedUrl,
as: asWasAbsolute ? preparedAs : (0, _addBasePath).addBasePath(preparedAs)
};
}
function resolveDynamicRoute(pathname, pages) {
const cleanPathname = (0, _removeTrailingSlash).removeTrailingSlash((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((page)=>{
if ((0, _isDynamic).isDynamicRoute(page) && (0, _routeRegex).getRouteRegex(page).re.test(cleanPathname)) {
pathname = page;
return true;
}
});
}
return (0, _removeTrailingSlash).removeTrailingSlash(pathname);
}
function getMiddlewareData(source, response, options) {
const nextConfig = {
basePath: options.router.basePath,
i18n: {
locales: options.router.locales
},
trailingSlash: Boolean(process.env.__NEXT_TRAILING_SLASH)
};
const rewriteHeader = response.headers.get('x-nextjs-rewrite');
let rewriteTarget = rewriteHeader || response.headers.get('x-nextjs-matched-path');
const matchedPath = response.headers.get('x-matched-path');
if (matchedPath && !rewriteTarget && !matchedPath.includes('__next_data_catchall') && !matchedPath.includes('/_error') && !matchedPath.includes('/404')) {
// leverage x-matched-path to detect next.config.js rewrites
rewriteTarget = matchedPath;
}
if (rewriteTarget) {
if (rewriteTarget.startsWith('/')) {
const parsedRewriteTarget = (0, _parseRelativeUrl).parseRelativeUrl(rewriteTarget);
const pathnameInfo = (0, _getNextPathnameInfo).getNextPathnameInfo(parsedRewriteTarget.pathname, {
nextConfig,
parseData: true
});
let fsPathname = (0, _removeTrailingSlash).removeTrailingSlash(pathnameInfo.pathname);
return Promise.all([
options.router.pageLoader.getPageList(),
(0, _routeLoader).getClientBuildManifest(),
]).then(([pages, { __rewrites: rewrites }])=>{
let as = (0, _addLocale).addLocale(pathnameInfo.pathname, pathnameInfo.locale);
if ((0, _isDynamic).isDynamicRoute(as) || !rewriteHeader && pages.includes((0, _normalizeLocalePath).normalizeLocalePath((0, _removeBasePath).removeBasePath(as), options.router.locales).pathname)) {
const parsedSource = (0, _getNextPathnameInfo).getNextPathnameInfo((0, _parseRelativeUrl).parseRelativeUrl(source).pathname, {
parseData: true
});
as = (0, _addBasePath).addBasePath(parsedSource.pathname);
parsedRewriteTarget.pathname = as;
}
if (process.env.__NEXT_HAS_REWRITES) {
const result = (0, _resolveRewrites).default(as, pages, rewrites, parsedRewriteTarget.query, (path)=>resolveDynamicRoute(path, pages), options.router.locales);
if (result.matchedPage) {
parsedRewriteTarget.pathname = result.parsedAs.pathname;
as = parsedRewriteTarget.pathname;
Object.assign(parsedRewriteTarget.query, result.parsedAs.query);
}
} else if (!pages.includes(fsPathname)) {
const resolvedPathname = resolveDynamicRoute(fsPathname, pages);
if (resolvedPathname !== fsPathname) {
fsPathname = resolvedPathname;
}
}
const resolvedHref = !pages.includes(fsPathname) ? resolveDynamicRoute((0, _normalizeLocalePath).normalizeLocalePath((0, _removeBasePath).removeBasePath(parsedRewriteTarget.pathname), options.router.locales).pathname, pages) : fsPathname;
if ((0, _isDynamic).isDynamicRoute(resolvedHref)) {
const matches = (0, _routeMatcher).getRouteMatcher((0, _routeRegex).getRouteRegex(resolvedHref))(as);
Object.assign(parsedRewriteTarget.query, matches || {});
}
return {
type: 'rewrite',
parsedAs: parsedRewriteTarget,
resolvedHref
};
});
}
const src = (0, _parsePath).parsePath(source);
const pathname = (0, _formatNextPathnameInfo).formatNextPathnameInfo(_extends({}, (0, _getNextPathnameInfo).getNextPathnameInfo(src.pathname, {
nextConfig,
parseData: true
}), {
defaultLocale: options.router.defaultLocale,
buildId: ''
}));
return Promise.resolve({
type: 'redirect-external',
destination: `${pathname}${src.query}${src.hash}`
});
}
const redirectTarget = response.headers.get('x-nextjs-redirect');
if (redirectTarget) {
if (redirectTarget.startsWith('/')) {
const src = (0, _parsePath).parsePath(redirectTarget);
const pathname = (0, _formatNextPathnameInfo).formatNextPathnameInfo(_extends({}, (0, _getNextPathnameInfo).getNextPathnameInfo(src.pathname, {
nextConfig,
parseData: true
}), {
defaultLocale: options.router.defaultLocale,
buildId: ''
}));
return Promise.resolve({
type: 'redirect-internal',
newAs: `${pathname}${src.query}${src.hash}`,
newUrl: `${pathname}${src.query}${src.hash}`
});
}
return Promise.resolve({
type: 'redirect-external',
destination: redirectTarget
});
}
return Promise.resolve({
type: 'next'
});
}
function withMiddlewareEffects(options) {
return _withMiddlewareEffects.apply(this, arguments);
}
function _withMiddlewareEffects() {
_withMiddlewareEffects = _async_to_generator(function*(options) {
const matches = yield matchesMiddleware(options);
if (!matches || !options.fetchData) {
return null;
}
try {
const data = yield options.fetchData();
const effect = yield getMiddlewareData(data.dataHref, data.response, options);
return {
dataHref: data.dataHref,
json: data.json,
response: data.response,
text: data.text,
cacheKey: data.cacheKey,
effect
};
} catch (e) {
/**
* TODO: Revisit this in the future.
* For now we will not consider middleware data errors to be fatal.
* maybe we should revisit in the future.
*/ return null;
}
});
return _withMiddlewareEffects.apply(this, arguments);
}
const manualScrollRestoration = process.env.__NEXT_SCROLL_RESTORATION && typeof window !== 'undefined' && 'scrollRestoration' in window.history && !!function() {
try {
let v = '__next';
// eslint-disable-next-line no-sequences
return sessionStorage.setItem(v, v), sessionStorage.removeItem(v), true;
} catch (n) {}
}();
const SSG_DATA_NOT_FOUND = Symbol('SSG_DATA_NOT_FOUND');
function fetchRetry(url, attempts, options) {
return fetch(url, {
// Cookies are required to be present for Next.js' SSG "Preview Mode".
// Cookies may also be required for `getServerSideProps`.
//
// > `fetch` wont 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',
method: options.method || 'GET',
headers: Object.assign({}, options.headers, {
'x-nextjs-data': '1'
})
}).then((response)=>{
return !response.ok && attempts > 1 && response.status >= 500 ? fetchRetry(url, attempts - 1, options) : response;
});
}
function handleSmoothScroll(fn) {
const htmlElement = document.documentElement;
const existing = htmlElement.style.scrollBehavior;
htmlElement.style.scrollBehavior = 'auto';
// In Chrome-based browsers we need to force reflow before calling `scrollTo`.
// Otherwise it will not pickup the change in scrollBehavior
// More info here: https://github.com/vercel/next.js/issues/40719#issuecomment-1336248042
htmlElement.getClientRects();
fn();
htmlElement.style.scrollBehavior = existing;
}
function tryToParseAsJSON(text) {
try {
return JSON.parse(text);
} catch (error) {
return null;
}
}
function fetchNextData({ dataHref , inflightCache , isPrefetch , hasMiddleware , isServerRender , parseJSON , persistCache , isBackground , unstable_skipClientCache }) {
const { href: cacheKey } = new URL(dataHref, window.location.href);
var ref1;
const getData = (params)=>{
return fetchRetry(dataHref, isServerRender ? 3 : 1, {
headers: Object.assign({}, isPrefetch ? {
purpose: 'prefetch'
} : {}, isPrefetch && hasMiddleware ? {
'x-middleware-prefetch': '1'
} : {}),
method: (ref1 = params == null ? void 0 : params.method) != null ? ref1 : 'GET'
}).then((response)=>{
if (response.ok && (params == null ? void 0 : params.method) === 'HEAD') {
return {
dataHref,
response,
text: '',
json: {},
cacheKey
};
}
return response.text().then((text)=>{
if (!response.ok) {
/**
* When the data response is a redirect because of a middleware
* we do not consider it an error. The headers must bring the
* mapped location.
* TODO: Change the status code in the handler.
*/ if (hasMiddleware && [
301,
302,
307,
308
].includes(response.status)) {
return {
dataHref,
response,
text,
json: {},
cacheKey
};
}
if (!hasMiddleware && response.status === 404) {
var ref;
if ((ref = tryToParseAsJSON(text)) == null ? void 0 : ref.notFound) {
return {
dataHref,
json: {
notFound: SSG_DATA_NOT_FOUND
},
response,
text,
cacheKey
};
}
}
const error = new Error(`Failed to load static props`);
/**
* 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(error);
}
throw error;
}
return {
dataHref,
json: parseJSON ? tryToParseAsJSON(text) : null,
response,
text,
cacheKey
};
});
}).then((data)=>{
if (!persistCache || process.env.NODE_ENV !== 'production' || data.response.headers.get('x-middleware-cache') === 'no-cache') {
delete inflightCache[cacheKey];
}
return data;
}).catch((err)=>{
if (!unstable_skipClientCache) {
delete inflightCache[cacheKey];
}
if (err.message === 'Failed to fetch') {
(0, _routeLoader).markAssetError(err);
}
throw err;
});
};
// when skipping client cache we wait to update
// inflight cache until successful data response
// this allows racing click event with fetching newer data
// without blocking navigation when stale data is available
if (unstable_skipClientCache && persistCache) {
return getData({}).then((data)=>{
inflightCache[cacheKey] = Promise.resolve(data);
return data;
});
}
if (inflightCache[cacheKey] !== undefined) {
return inflightCache[cacheKey];
}
return inflightCache[cacheKey] = getData(isBackground ? {
method: 'HEAD'
} : {});
}
function createKey() {
return Math.random().toString(36).slice(2, 10);
}
function handleHardNavigation({ url , router }) {
// ensure we don't trigger a hard navigation to the same
// URL as this can end up with an infinite refresh
if (url === (0, _addBasePath).addBasePath((0, _addLocale).addLocale(router.asPath, router.locale))) {
throw new Error(`Invariant: attempted to hard navigate to the same URL ${url} ${location.href}`);
}
window.location.href = url;
}
const getCancelledHandler = ({ route , router })=>{
let cancelled = false;
const cancel = router.clc = ()=>{
cancelled = true;
};
const handleCancelled = ()=>{
if (cancelled) {
const error = new Error(`Abort fetching component for route: "${route}"`);
error.cancelled = true;
throw error;
}
if (cancel === router.clc) {
router.clc = null;
}
};
return handleCancelled;
};
class Router {
reload() {
window.location.reload();
}
/**
* Go back in history
*/ back() {
window.history.back();
}
/**
* Go forward in history
*/ forward() {
window.history.forward();
}
/**
* 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
*/ push(url, as, options = {}) {
if (process.env.__NEXT_SCROLL_RESTORATION) {
// TODO: remove in the future when we update history before route change
// is complete, as the popstate event should handle this capture.
if (manualScrollRestoration) {
try {
// Snapshot scroll position right before navigating to a new page:
sessionStorage.setItem('__next_scroll_' + this._key, JSON.stringify({
x: self.pageXOffset,
y: self.pageYOffset
}));
} catch (e) {}
}
}
({ url , as } = prepareUrlAs(this, url, 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
*/ replace(url, as, options = {}) {
({ url , as } = prepareUrlAs(this, url, as));
return this.change('replaceState', url, as, options);
}
change(method, url, as, options, forcedScroll) {
var _this = this;
return _async_to_generator(function*() {
if (!isLocalURL(url)) {
handleHardNavigation({
url,
router: _this
});
return false;
}
// 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.
const isQueryUpdating = options._h === 1;
let shouldResolveHref = isQueryUpdating || options._shouldResolveHref || (0, _parsePath).parsePath(url).pathname === (0, _parsePath).parsePath(as).pathname;
const nextState = _extends({}, _this.state);
// for static pages with query params in the URL we delay
// marking the router ready until after the query is updated
// or a navigation has occurred
const readyStateChange = _this.isReady !== true;
_this.isReady = true;
const isSsr = _this.isSsr;
if (!isQueryUpdating) {
_this.isSsr = false;
}
// if a route transition is already in progress before
// the query updating is triggered ignore query updating
if (isQueryUpdating && _this.clc) {
return false;
}
const prevLocale = nextState.locale;
if (process.env.__NEXT_I18N_SUPPORT) {
nextState.locale = options.locale === false ? _this.defaultLocale : options.locale || nextState.locale;
if (typeof options.locale === 'undefined') {
options.locale = nextState.locale;
}
const parsedAs = (0, _parseRelativeUrl).parseRelativeUrl((0, _hasBasePath).hasBasePath(as) ? (0, _removeBasePath).removeBasePath(as) : as);
const localePathResult = (0, _normalizeLocalePath).normalizeLocalePath(parsedAs.pathname, _this.locales);
if (localePathResult.detectedLocale) {
nextState.locale = localePathResult.detectedLocale;
parsedAs.pathname = (0, _addBasePath).addBasePath(parsedAs.pathname);
as = (0, _formatUrl).formatWithValidation(parsedAs);
url = (0, _addBasePath).addBasePath((0, _normalizeLocalePath).normalizeLocalePath((0, _hasBasePath).hasBasePath(url) ? (0, _removeBasePath).removeBasePath(url) : url, _this.locales).pathname);
}
let 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 (process.env.__NEXT_I18N_SUPPORT) {
var ref;
// if the locale isn't configured hard navigate to show 404 page
if (!((ref = _this.locales) == null ? void 0 : ref.includes(nextState.locale))) {
parsedAs.pathname = (0, _addLocale).addLocale(parsedAs.pathname, nextState.locale);
handleHardNavigation({
url: (0, _formatUrl).formatWithValidation(parsedAs),
router: _this
});
// this was previously a return but was removed in favor
// of better dead code elimination with regenerator runtime
didNavigate = true;
}
}
const detectedDomain = (0, _detectDomainLocale).detectDomainLocale(_this.domainLocales, undefined, nextState.locale);
// we need to wrap this in the env check again since regenerator runtime
// moves this on its own due to the return
if (process.env.__NEXT_I18N_SUPPORT) {
// 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) {
const asNoBasePath = (0, _removeBasePath).removeBasePath(as);
handleHardNavigation({
url: `http${detectedDomain.http ? '' : 's'}://${detectedDomain.domain}${(0, _addBasePath).addBasePath(`${nextState.locale === detectedDomain.defaultLocale ? '' : `/${nextState.locale}`}${asNoBasePath === '/' ? '' : asNoBasePath}` || '/')}`,
router: _this
});
// this was previously a return but was removed in favor
// of better dead code elimination with regenerator runtime
didNavigate = true;
}
}
if (didNavigate) {
return new Promise(()=>{});
}
}
// marking route changes as a navigation start entry
if (_utils.ST) {
performance.mark('routeChange');
}
const { shallow =false , scroll =true } = options;
const routeProps = {
shallow
};
if (_this._inFlightRoute && _this.clc) {
if (!isSsr) {
Router.events.emit('routeChangeError', buildCancellationError(), _this._inFlightRoute, routeProps);
}
_this.clc();
_this.clc = null;
}
as = (0, _addBasePath).addBasePath((0, _addLocale).addLocale((0, _hasBasePath).hasBasePath(as) ? (0, _removeBasePath).removeBasePath(as) : as, options.locale, _this.defaultLocale));
const cleanedAs = (0, _removeLocale).removeLocale((0, _hasBasePath).hasBasePath(as) ? (0, _removeBasePath).removeBasePath(as) : as, nextState.locale);
_this._inFlightRoute = as;
const localeChange = prevLocale !== nextState.locale;
// If the url change is only related to a hash change
// We should not proceed. We should only change the state.
if (!isQueryUpdating && _this.onlyAHashChange(cleanedAs) && !localeChange) {
nextState.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, _extends({}, options, {
scroll: false
}));
if (scroll) {
_this.scrollToHash(cleanedAs);
}
try {
yield _this.set(nextState, _this.components[nextState.route], null);
} catch (err) {
if ((0, _isError).default(err) && err.cancelled) {
Router.events.emit('routeChangeError', err, cleanedAs, routeProps);
}
throw err;
}
Router.events.emit('hashChangeComplete', as, routeProps);
return true;
}
let parsed = (0, _parseRelativeUrl).parseRelativeUrl(url);
let { pathname , query } = parsed;
// 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
let pages, rewrites;
try {
[pages, { __rewrites: rewrites }] = yield Promise.all([
_this.pageLoader.getPageList(),
(0, _routeLoader).getClientBuildManifest(),
_this.pageLoader.getMiddleware(),
]);
} catch (err) {
// If we fail to resolve the page list or client-build manifest, we must
// do a server-side transition:
handleHardNavigation({
url: as,
router: _this
});
return false;
}
// 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
let 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, _removeTrailingSlash).removeTrailingSlash((0, _removeBasePath).removeBasePath(pathname)) : pathname;
let route = (0, _removeTrailingSlash).removeTrailingSlash(pathname);
const parsedAsPathname = as.startsWith('/') && (0, _parseRelativeUrl).parseRelativeUrl(as).pathname;
const isMiddlewareRewrite = !!(parsedAsPathname && route !== parsedAsPathname && (!(0, _isDynamic).isDynamicRoute(route) || !(0, _routeMatcher).getRouteMatcher((0, _routeRegex).getRouteRegex(route))(parsedAsPathname)));
// we don't attempt resolve asPath when we need to execute
// middleware as the resolving will occur server-side
const isMiddlewareMatch = !options.shallow && (yield matchesMiddleware({
asPath: as,
locale: nextState.locale,
router: _this
}));
if (isQueryUpdating && isMiddlewareMatch) {
shouldResolveHref = false;
}
if (shouldResolveHref && pathname !== '/_error') {
options._shouldResolveHref = true;
if (process.env.__NEXT_HAS_REWRITES && as.startsWith('/')) {
const rewritesResult = (0, _resolveRewrites).default((0, _addBasePath).addBasePath((0, _addLocale).addLocale(cleanedAs, nextState.locale), true), pages, rewrites, query, (p)=>resolveDynamicRoute(p, pages), _this.locales);
if (rewritesResult.externalDest) {
handleHardNavigation({
url: as,
router: _this
});
return true;
}
if (!isMiddlewareMatch) {
resolvedAs = rewritesResult.asPath;
}
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 = (0, _addBasePath).addBasePath(pathname);
if (!isMiddlewareMatch) {
url = (0, _formatUrl).formatWithValidation(parsed);
}
}
} else {
parsed.pathname = resolveDynamicRoute(pathname, pages);
if (parsed.pathname !== pathname) {
pathname = parsed.pathname;
parsed.pathname = (0, _addBasePath).addBasePath(pathname);
if (!isMiddlewareMatch) {
url = (0, _formatUrl).formatWithValidation(parsed);
}
}
}
}
if (!isLocalURL(as)) {
if (process.env.NODE_ENV !== 'production') {
throw new Error(`Invalid href: "${url}" and as: "${as}", received relative href and external as` + `\nSee more info: https://nextjs.org/docs/messages/invalid-relative-url-external-as`);
}
handleHardNavigation({
url: as,
router: _this
});
return false;
}
resolvedAs = (0, _removeLocale).removeLocale((0, _removeBasePath).removeBasePath(resolvedAs), nextState.locale);
route = (0, _removeTrailingSlash).removeTrailingSlash(pathname);
let routeMatch = false;
if ((0, _isDynamic).isDynamicRoute(route)) {
const parsedAs = (0, _parseRelativeUrl).parseRelativeUrl(resolvedAs);
const asPathname = parsedAs.pathname;
const routeRegex = (0, _routeRegex).getRouteRegex(route);
routeMatch = (0, _routeMatcher).getRouteMatcher(routeRegex)(asPathname);
const shouldInterpolate = route === asPathname;
const interpolatedAs = shouldInterpolate ? interpolateAs(route, asPathname, query) : {};
if (!routeMatch || shouldInterpolate && !interpolatedAs.result) {
const missingParams = Object.keys(routeRegex.groups).filter((param)=>!query[param] && !routeRegex.groups[param].optional);
if (missingParams.length > 0 && !isMiddlewareMatch) {
if (process.env.NODE_ENV !== 'production') {
console.warn(`${shouldInterpolate ? `Interpolating href` : `Mismatching \`as\` and \`href\``} failed to manually provide ` + `the params: ${missingParams.join(', ')} in the \`href\`'s \`query\``);
}
throw new Error((shouldInterpolate ? `The provided \`href\` (${url}) value is missing query values (${missingParams.join(', ')}) to be interpolated properly. ` : `The provided \`as\` value (${asPathname}) is incompatible with the \`href\` value (${route}). `) + `Read more: https://nextjs.org/docs/messages/${shouldInterpolate ? 'href-interpolation-failed' : 'incompatible-href-as'}`);
}
} else if (shouldInterpolate) {
as = (0, _formatUrl).formatWithValidation(Object.assign({}, parsedAs, {
pathname: interpolatedAs.result,
query: omit(query, interpolatedAs.params)
}));
} else {
// Merge params into `query`, overwriting any specified in search
Object.assign(query, routeMatch);
}
}
if (!isQueryUpdating) {
Router.events.emit('routeChangeStart', as, routeProps);
}
try {
var ref2, ref3, ref4;
let routeInfo = yield _this.getRouteInfo({
route,
pathname,
query,
as,
resolvedAs,
routeProps,
locale: nextState.locale,
isPreview: nextState.isPreview,
hasMiddleware: isMiddlewareMatch,
unstable_skipClientCache: options.unstable_skipClientCache,
isQueryUpdating: isQueryUpdating && !_this.isFallback,
isMiddlewareRewrite
});
if ('route' in routeInfo && isMiddlewareMatch) {
pathname = routeInfo.route || route;
route = pathname;
if (!routeProps.shallow) {
query = Object.assign({}, routeInfo.query || {}, query);
}
const cleanedParsedPathname = (0, _hasBasePath).hasBasePath(parsed.pathname) ? (0, _removeBasePath).removeBasePath(parsed.pathname) : parsed.pathname;
if (routeMatch && pathname !== cleanedParsedPathname) {
Object.keys(routeMatch).forEach((key)=>{
if (routeMatch && query[key] === routeMatch[key]) {
delete query[key];
}
});
}
if ((0, _isDynamic).isDynamicRoute(pathname)) {
const prefixedAs = !routeProps.shallow && routeInfo.resolvedAs ? routeInfo.resolvedAs : (0, _addBasePath).addBasePath((0, _addLocale).addLocale(new URL(as, location.href).pathname, nextState.locale), true);
let rewriteAs = prefixedAs;
if ((0, _hasBasePath).hasBasePath(rewriteAs)) {
rewriteAs = (0, _removeBasePath).removeBasePath(rewriteAs);
}
if (process.env.__NEXT_I18N_SUPPORT) {
const localeResult = (0, _normalizeLocalePath).normalizeLocalePath(rewriteAs, _this.locales);
nextState.locale = localeResult.detectedLocale || nextState.locale;
rewriteAs = localeResult.pathname;
}
const routeRegex = (0, _routeRegex).getRouteRegex(pathname);
const curRouteMatch = (0, _routeMatcher).getRouteMatcher(routeRegex)(new URL(rewriteAs, location.href).pathname);
if (curRouteMatch) {
Object.assign(query, curRouteMatch);
}
}
}
// If the routeInfo brings a redirect we simply apply it.
if ('type' in routeInfo) {
if (routeInfo.type === 'redirect-internal') {
return _this.change(method, routeInfo.newUrl, routeInfo.newAs, options);
} else {
handleHardNavigation({
url: routeInfo.destination,
router: _this
});
return new Promise(()=>{});
}
}
const component = routeInfo.Component;
if (component && component.unstable_scriptLoader) {
const scripts = [].concat(component.unstable_scriptLoader());
scripts.forEach((script)=>{
(0, _script).handleClientScriptLoad(script.props);
});
}
// handle redirect on client-transition
if ((routeInfo.__N_SSG || routeInfo.__N_SSP) && routeInfo.props) {
if (routeInfo.props.pageProps && routeInfo.props.pageProps.__N_REDIRECT) {
// Use the destination from redirect without adding locale
options.locale = false;
const destination = routeInfo.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('/') && routeInfo.props.pageProps.__N_REDIRECT_BASE_PATH !== false) {
const parsedHref = (0, _parseRelativeUrl).parseRelativeUrl(destination);
parsedHref.pathname = resolveDynamicRoute(parsedHref.pathname, pages);
const { url: newUrl , as: newAs } = prepareUrlAs(_this, destination, destination);
return _this.change(method, newUrl, newAs, options);
}
handleHardNavigation({
url: destination,
router: _this
});
return new Promise(()=>{});
}
nextState.isPreview = !!routeInfo.props.__N_PREVIEW;
// handle SSG data 404
if (routeInfo.props.notFound === SSG_DATA_NOT_FOUND) {
let notFoundRoute;
try {
yield _this.fetchComponent('/404');
notFoundRoute = '/404';
} catch (_) {
notFoundRoute = '/_error';
}
routeInfo = yield _this.getRouteInfo({
route: notFoundRoute,
pathname: notFoundRoute,
query,
as,
resolvedAs,
routeProps: {
shallow: false
},
locale: nextState.locale,
isPreview: nextState.isPreview
});
if ('type' in routeInfo) {
throw new Error(`Unexpected middleware effect on /404`);
}
}
}
if (isQueryUpdating && _this.pathname === '/_error' && ((ref2 = self.__NEXT_DATA__.props) == null ? void 0 : (ref3 = ref2.pageProps) == null ? void 0 : ref3.statusCode) === 500 && ((ref4 = routeInfo.props) == null ? void 0 : ref4.pageProps)) {
// ensure statusCode is still correct for static 500 page
// when updating query information
routeInfo.props.pageProps.statusCode = 500;
}
var _route;
// shallow routing is only allowed for same page URL changes.
const isValidShallowRoute = options.shallow && nextState.route === ((_route = routeInfo.route) != null ? _route : route);
var _scroll;
const shouldScroll = (_scroll = options.scroll) != null ? _scroll : !isQueryUpdating && !isValidShallowRoute;
const resetScroll = shouldScroll ? {
x: 0,
y: 0
} : null;
const upcomingScrollState = forcedScroll != null ? forcedScroll : resetScroll;
// the new state that the router gonna set
const upcomingRouterState = _extends({}, nextState, {
route,
pathname,
query,
asPath: cleanedAs,
isFallback: false
});
// When the page being rendered is the 404 page, we should only update the
// query parameters. Route changes here might add the basePath when it
// wasn't originally present. This is also why this block is before the
// below `changeState` call which updates the browser's history (changing
// the URL).
if (isQueryUpdating && (_this.pathname === '/404' || _this.pathname === '/_error')) {
var ref5, ref6, ref7;
routeInfo = yield _this.getRouteInfo({
route: _this.pathname,
pathname: _this.pathname,
query,
as,
resolvedAs,
routeProps: {
shallow: false
},
locale: nextState.locale,
isPreview: nextState.isPreview
});
if ('type' in routeInfo) {
throw new Error(`Unexpected middleware effect on ${_this.pathname}`);
}
if (_this.pathname === '/_error' && ((ref5 = self.__NEXT_DATA__.props) == null ? void 0 : (ref6 = ref5.pageProps) == null ? void 0 : ref6.statusCode) === 500 && ((ref7 = routeInfo.props) == null ? void 0 : ref7.pageProps)) {
// ensure statusCode is still correct for static 500 page
// when updating query information
routeInfo.props.pageProps.statusCode = 500;
}
try {
yield _this.set(upcomingRouterState, routeInfo, upcomingScrollState);
} catch (err) {
if ((0, _isError).default(err) && err.cancelled) {
Router.events.emit('routeChangeError', err, cleanedAs, routeProps);
}
throw err;
}
return true;
}
Router.events.emit('beforeHistoryChange', as, routeProps);
_this.changeState(method, url, as, options);
// for query updates we can skip it if the state is unchanged and we don't
// need to scroll
// https://github.com/vercel/next.js/issues/37139
const canSkipUpdating = isQueryUpdating && !upcomingScrollState && !readyStateChange && !localeChange && (0, _compareStates).compareRouterStates(upcomingRouterState, _this.state);
if (!canSkipUpdating) {
try {
yield _this.set(upcomingRouterState, routeInfo, upcomingScrollState);
} catch (e) {
if (e.cancelled) routeInfo.error = routeInfo.error || e;
else throw e;
}
if (routeInfo.error) {
if (!isQueryUpdating) {
Router.events.emit('routeChangeError', routeInfo.error, cleanedAs, routeProps);
}
throw routeInfo.error;
}
if (process.env.__NEXT_I18N_SUPPORT) {
if (nextState.locale) {
document.documentElement.lang = nextState.locale;
}
}
if (!isQueryUpdating) {
Router.events.emit('routeChangeComplete', as, routeProps);
}
// A hash mark # is the optional last part of a URL
const hashRegex = /#.+$/;
if (shouldScroll && hashRegex.test(as)) {
_this.scrollToHash(as);
}
}
return true;
} catch (err1) {
if ((0, _isError).default(err1) && err1.cancelled) {
return false;
}
throw err1;
}
})();
}
changeState(method, url, as, options = {}) {
if (process.env.NODE_ENV !== 'production') {
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.${method} is not available`);
return;
}
}
if (method !== 'pushState' || (0, _utils).getURL() !== as) {
this._shallow = options.shallow;
window.history[method]({
url,
as,
options,
__N: true,
key: this._key = method !== 'pushState' ? this._key : createKey()
}, // 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);
}
}
handleRouteInfoError(err, pathname, query, as, routeProps, loadErrorFail) {
var _this = this;
return _async_to_generator(function*() {
console.error(err);
if (err.cancelled) {
// bubble up cancellation errors
throw err;
}
if ((0, _routeLoader).isAssetError(err) || loadErrorFail) {
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.
handleHardNavigation({
url: as,
router: _this
});
// Changing the URL doesn't block executing the current code path.
// So let's throw a cancellation error stop the routing logic.
throw buildCancellationError();
}
try {
let props;
const { page: Component , styleSheets } = yield _this.fetchComponent('/_error');
const routeInfo = {
props,
Component,
styleSheets,
err,
error: err
};
if (!routeInfo.props) {
try {
routeInfo.props = yield _this.getInitialProps(Component, {
err,
pathname,
query
});
} catch (gipErr) {
console.error('Error in error page `getInitialProps`: ', gipErr);
routeInfo.props = {};
}
}
return routeInfo;
} catch (routeInfoErr) {
return _this.handleRouteInfoError((0, _isError).default(routeInfoErr) ? routeInfoErr : new Error(routeInfoErr + ''), pathname, query, as, routeProps, true);
}
})();
}
getRouteInfo({ route: requestedRoute , pathname , query , as , resolvedAs , routeProps , locale , hasMiddleware , isPreview , unstable_skipClientCache , isQueryUpdating , isMiddlewareRewrite }) {
var _this = this;
return _async_to_generator(function*() {
/**
* This `route` binding can change if there's a rewrite
* so we keep a reference to the original requested route
* so we can store the cache for it and avoid re-requesting every time
* for shallow routing purposes.
*/ let route = requestedRoute;
try {
var ref, ref8, ref9, ref10;
const handleCancelled = getCancelledHandler({
route,
router: _this
});
let existingInfo = _this.components[route];
if (routeProps.shallow && existingInfo && _this.route === route) {
return existingInfo;
}
if (hasMiddleware) {
existingInfo = undefined;
}
let cachedRouteInfo = existingInfo && !('initial' in existingInfo) && process.env.NODE_ENV !== 'development' ? existingInfo : undefined;
const isBackground = isQueryUpdating;
const fetchNextDataParams = {
dataHref: _this.pageLoader.getDataHref({
href: (0, _formatUrl).formatWithValidation({
pathname,
query
}),
skipInterpolation: true,
asPath: resolvedAs,
locale
}),
hasMiddleware: true,
isServerRender: _this.isSsr,
parseJSON: true,
inflightCache: isBackground ? _this.sbc : _this.sdc,
persistCache: !isPreview,
isPrefetch: false,
unstable_skipClientCache,
isBackground
};
let data = isQueryUpdating && !isMiddlewareRewrite ? null : yield withMiddlewareEffects({
fetchData: ()=>fetchNextData(fetchNextDataParams),
asPath: resolvedAs,
locale: locale,
router: _this
}).catch((err)=>{
// we don't hard error during query updating
// as it's un-necessary and doesn't need to be fatal
// unless it is a fallback route and the props can't
// be loaded
if (isQueryUpdating) {
return null;
}
throw err;
});
if (isQueryUpdating) {
if (!data) {
data = {
json: self.__NEXT_DATA__.props
};
} else {
data.json = self.__NEXT_DATA__.props;
}
}
handleCancelled();
if ((data == null ? void 0 : (ref = data.effect) == null ? void 0 : ref.type) === 'redirect-internal' || (data == null ? void 0 : (ref8 = data.effect) == null ? void 0 : ref8.type) === 'redirect-external') {
return data.effect;
}
if ((data == null ? void 0 : (ref9 = data.effect) == null ? void 0 : ref9.type) === 'rewrite') {
const resolvedRoute = (0, _removeTrailingSlash).removeTrailingSlash(data.effect.resolvedHref);
const pages = yield _this.pageLoader.getPageList();
// during query updating the page must match although during
// client-transition a redirect that doesn't match a page
// can be returned and this should trigger a hard navigation
// which is valid for incremental migration
if (!isQueryUpdating || pages.includes(resolvedRoute)) {
route = resolvedRoute;
pathname = data.effect.resolvedHref;
query = _extends({}, query, data.effect.parsedAs.query);
resolvedAs = (0, _removeBasePath).removeBasePath((0, _normalizeLocalePath).normalizeLocalePath(data.effect.parsedAs.pathname, _this.locales).pathname);
// Check again the cache with the new destination.
existingInfo = _this.components[route];
if (routeProps.shallow && existingInfo && _this.route === route && !hasMiddleware) {
// If we have a match with the current route due to rewrite,
// we can copy the existing information to the rewritten one.
// Then, we return the information along with the matched route.
return _extends({}, existingInfo, {
route
});
}
}
}
if ((0, _isApiRoute).isAPIRoute(route)) {
handleHardNavigation({
url: as,
router: _this
});
return new Promise(()=>{});
}
const routeInfo = cachedRouteInfo || (yield _this.fetchComponent(route).then((res)=>({
Component: res.page,
styleSheets: res.styleSheets,
__N_SSG: res.mod.__N_SSG,
__N_SSP: res.mod.__N_SSP
})));
if (process.env.NODE_ENV !== 'production') {
const { isValidElementType } = require('next/dist/compiled/react-is');
if (!isValidElementType(routeInfo.Component)) {
throw new Error(`The default export is not a React Component in page: "${pathname}"`);
}
}
const wasBailedPrefetch = data == null ? void 0 : (ref10 = data.response) == null ? void 0 : ref10.headers.get('x-middleware-skip');
const shouldFetchData = routeInfo.__N_SSG || routeInfo.__N_SSP;
// For non-SSG prefetches that bailed before sending data
// we clear the cache to fetch full response
if (wasBailedPrefetch && (data == null ? void 0 : data.dataHref)) {
delete _this.sdc[data.dataHref];
}
const { props , cacheKey } = yield _this._getData(_async_to_generator(function*() {
if (shouldFetchData) {
if ((data == null ? void 0 : data.json) && !wasBailedPrefetch) {
return {
cacheKey: data.cacheKey,
props: data.json
};
}
const dataHref = (data == null ? void 0 : data.dataHref) ? data.dataHref : _this.pageLoader.getDataHref({
href: (0, _formatUrl).formatWithValidation({
pathname,
query
}),
asPath: resolvedAs,
locale
});
const fetched = yield fetchNextData({
dataHref,
isServerRender: _this.isSsr,
parseJSON: true,
inflightCache: wasBailedPrefetch ? {} : _this.sdc,
persistCache: !isPreview,
isPrefetch: false,
unstable_skipClientCache
});
return {
cacheKey: fetched.cacheKey,
props: fetched.json || {}
};
}
return {
headers: {},
props: yield _this.getInitialProps(routeInfo.Component, // we provide AppTree later so this needs to be `any`
{
pathname,
query,
asPath: as,
locale,
locales: _this.locales,
defaultLocale: _this.defaultLocale
})
};
}));
// Only bust the data cache for SSP routes although
// middleware can skip cache per request with
// x-middleware-cache: no-cache as well
if (routeInfo.__N_SSP && fetchNextDataParams.dataHref && cacheKey) {
delete _this.sdc[cacheKey];
}
// we kick off a HEAD request in the background
// when a non-prefetch request is made to signal revalidation
if (!_this.isPreview && routeInfo.__N_SSG && process.env.NODE_ENV !== 'development' && !isQueryUpdating) {
fetchNextData(Object.assign({}, fetchNextDataParams, {
isBackground: true,
persistCache: false,
inflightCache: _this.sbc
})).catch(()=>{});
}
props.pageProps = Object.assign({}, props.pageProps);
routeInfo.props = props;
routeInfo.route = route;
routeInfo.query = query;
routeInfo.resolvedAs = resolvedAs;
_this.components[route] = routeInfo;
return routeInfo;
} catch (err) {
return _this.handleRouteInfoError((0, _isError).getProperError(err), pathname, query, as, routeProps);
}
})();
}
set(state, data, resetScroll) {
this.state = state;
return this.sub(data, this.components['/_app'].Component, resetScroll);
}
/**
* Callback to execute before replacing router state
* @param cb callback to be executed
*/ beforePopState(cb) {
this._bps = cb;
}
onlyAHashChange(as) {
if (!this.asPath) return false;
const [oldUrlNoHash, oldHash] = this.asPath.split('#');
const [newUrlNoHash, newHash] = as.split('#');
// 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;
}
scrollToHash(as) {
const [, hash = ''] = as.split('#');
// Scroll to top if the hash is just `#` with no value or `#top`
// To mirror browsers
if (hash === '' || hash === 'top') {
handleSmoothScroll(()=>window.scrollTo(0, 0));
return;
}
// Decode hash to make non-latin anchor works.
const rawHash = decodeURIComponent(hash);
// First we check if the element by id is found
const idEl = document.getElementById(rawHash);
if (idEl) {
handleSmoothScroll(()=>idEl.scrollIntoView());
return;
}
// If there's no element with the id, we check the `name` property
// To mirror browsers
const nameEl = document.getElementsByName(rawHash)[0];
if (nameEl) {
handleSmoothScroll(()=>nameEl.scrollIntoView());
}
}
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
*/ prefetch(url, asPath = url, options = {}) {
var _this = this;
return _async_to_generator(function*() {
// Prefetch is not supported in development mode because it would trigger on-demand-entries
if (process.env.NODE_ENV !== 'production') {
return;
}
if (typeof window !== 'undefined' && (0, _isBot).isBot(window.navigator.userAgent)) {
// No prefetches for bots that render the link since they are typically navigating
// links via the equivalent of a hard navigation and hence never utilize these
// prefetches.
return;
}
let parsed = (0, _parseRelativeUrl).parseRelativeUrl(url);
let { pathname , query } = parsed;
const originalPathname = pathname;
if (process.env.__NEXT_I18N_SUPPORT) {
if (options.locale === false) {
pathname = (0, _normalizeLocalePath).normalizeLocalePath(pathname, _this.locales).pathname;
parsed.pathname = pathname;
url = (0, _formatUrl).formatWithValidation(parsed);
let parsedAs = (0, _parseRelativeUrl).parseRelativeUrl(asPath);
const localePathResult = (0, _normalizeLocalePath).normalizeLocalePath(parsedAs.pathname, _this.locales);
parsedAs.pathname = localePathResult.pathname;
options.locale = localePathResult.detectedLocale || _this.defaultLocale;
asPath = (0, _formatUrl).formatWithValidation(parsedAs);
}
}
const pages = yield _this.pageLoader.getPageList();
let resolvedAs = asPath;
const locale = typeof options.locale !== 'undefined' ? options.locale || undefined : _this.locale;
const isMiddlewareMatch = yield matchesMiddleware({
asPath: asPath,
locale: locale,
router: _this
});
if (process.env.__NEXT_HAS_REWRITES && asPath.startsWith('/')) {
let rewrites;
({ __rewrites: rewrites } = yield (0, _routeLoader).getClientBuildManifest());
const rewritesResult = (0, _resolveRewrites).default((0, _addBasePath).addBasePath((0, _addLocale).addLocale(asPath, _this.locale), true), pages, rewrites, parsed.query, (p)=>resolveDynamicRoute(p, pages), _this.locales);
if (rewritesResult.externalDest) {
return;
}
if (!isMiddlewareMatch) {
resolvedAs = (0, _removeLocale).removeLocale((0, _removeBasePath).removeBasePath(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;
if (!isMiddlewareMatch) {
url = (0, _formatUrl).formatWithValidation(parsed);
}
}
}
parsed.pathname = resolveDynamicRoute(parsed.pathname, pages);
if ((0, _isDynamic).isDynamicRoute(parsed.pathname)) {
pathname = parsed.pathname;
parsed.pathname = pathname;
Object.assign(query, (0, _routeMatcher).getRouteMatcher((0, _routeRegex).getRouteRegex(parsed.pathname))((0, _parsePath).parsePath(asPath).pathname) || {});
if (!isMiddlewareMatch) {
url = (0, _formatUrl).formatWithValidation(parsed);
}
}
const data = process.env.__NEXT_MIDDLEWARE_PREFETCH === 'strict' ? null : yield withMiddlewareEffects({
fetchData: ()=>fetchNextData({
dataHref: _this.pageLoader.getDataHref({
href: (0, _formatUrl).formatWithValidation({
pathname: originalPathname,
query
}),
skipInterpolation: true,
asPath: resolvedAs,
locale
}),
hasMiddleware: true,
isServerRender: _this.isSsr,
parseJSON: true,
inflightCache: _this.sdc,
persistCache: !_this.isPreview,
isPrefetch: true
}),
asPath: asPath,
locale: locale,
router: _this
});
/**
* If there was a rewrite we apply the effects of the rewrite on the
* current parameters for the prefetch.
*/ if ((data == null ? void 0 : data.effect.type) === 'rewrite') {
parsed.pathname = data.effect.resolvedHref;
pathname = data.effect.resolvedHref;
query = _extends({}, query, data.effect.parsedAs.query);
resolvedAs = data.effect.parsedAs.pathname;
url = (0, _formatUrl).formatWithValidation(parsed);
}
/**
* If there is a redirect to an external destination then we don't have
* to prefetch content as it will be unused.
*/ if ((data == null ? void 0 : data.effect.type) === 'redirect-external') {
return;
}
const route = (0, _removeTrailingSlash).removeTrailingSlash(pathname);
yield Promise.all([
_this.pageLoader._isSsg(route).then((isSsg)=>{
return isSsg ? fetchNextData({
dataHref: (data == null ? void 0 : data.json) ? data == null ? void 0 : data.dataHref : _this.pageLoader.getDataHref({
href: url,
asPath: resolvedAs,
locale: locale
}),
isServerRender: false,
parseJSON: true,
inflightCache: _this.sdc,
persistCache: !_this.isPreview,
isPrefetch: true,
unstable_skipClientCache: options.unstable_skipClientCache || options.priority && !!process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE
}).then(()=>false) : false;
}),
_this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](route),
]);
})();
}
fetchComponent(route) {
var _this = this;
return _async_to_generator(function*() {
const handleCancelled = getCancelledHandler({
route,
router: _this
});
try {
const componentResult = yield _this.pageLoader.loadPage(route);
handleCancelled();
return componentResult;
} catch (err) {
handleCancelled();
throw err;
}
})();
}
_getData(fn) {
let cancelled = false;
const cancel = ()=>{
cancelled = true;
};
this.clc = cancel;
return fn().then((data)=>{
if (cancel === this.clc) {
this.clc = null;
}
if (cancelled) {
const err = new Error('Loading initial props cancelled');
err.cancelled = true;
throw err;
}
return data;
});
}
_getFlightData(dataHref) {
// Do not cache RSC flight response since it's not a static resource
return fetchNextData({
dataHref,
isServerRender: true,
parseJSON: false,
inflightCache: this.sdc,
persistCache: false,
isPrefetch: false
}).then(({ text })=>({
data: text
}));
}
getInitialProps(Component, ctx) {
const { Component: App } = this.components['/_app'];
const AppTree = this._wrapApp(App);
ctx.AppTree = AppTree;
return (0, _utils).loadGetInitialProps(App, {
AppTree,
Component,
router: this,
ctx
});
}
get route() {
return this.state.route;
}
get pathname() {
return this.state.pathname;
}
get query() {
return this.state.query;
}
get asPath() {
return this.state.asPath;
}
get locale() {
return this.state.locale;
}
get isFallback() {
return this.state.isFallback;
}
get isPreview() {
return this.state.isPreview;
}
constructor(pathname1, query1, as1, { initialProps , pageLoader , App , wrapApp , Component , err , subscription , isFallback , locale , locales , defaultLocale , domainLocales , isPreview }){
// Server Data Cache (full data requests)
this.sdc = {};
// Server Background Cache (HEAD requests)
this.sbc = {};
this.isFirstPopStateEvent = true;
this._key = createKey();
this.onPopState = (e)=>{
const { isFirstPopStateEvent } = this;
this.isFirstPopStateEvent = false;
const 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.
const { pathname , query } = this;
this.changeState('replaceState', (0, _formatUrl).formatWithValidation({
pathname: (0, _addBasePath).addBasePath(pathname),
query
}), (0, _utils).getURL());
return;
}
// __NA is used to identify if the history entry can be handled by the app-router.
if (state.__NA) {
window.location.reload();
return;
}
if (!state.__N) {
return;
}
// Safari fires popstateevent when reopening the browser.
if (isFirstPopStateEvent && this.locale === state.options.locale && state.as === this.asPath) {
return;
}
let forcedScroll;
const { url , as , options , key } = state;
if (process.env.__NEXT_SCROLL_RESTORATION) {
if (manualScrollRestoration) {
if (this._key !== key) {
// Snapshot current scroll position:
try {
sessionStorage.setItem('__next_scroll_' + this._key, JSON.stringify({
x: self.pageXOffset,
y: self.pageYOffset
}));
} catch (e) {}
// Restore old scroll position:
try {
const v = sessionStorage.getItem('__next_scroll_' + key);
forcedScroll = JSON.parse(v);
} catch (e1) {
forcedScroll = {
x: 0,
y: 0
};
}
}
}
}
this._key = key;
const { pathname } = (0, _parseRelativeUrl).parseRelativeUrl(url);
// Make sure we don't re-render on initial load,
// can be caused by navigating back from an external site
if (this.isSsr && as === (0, _addBasePath).addBasePath(this.asPath) && pathname === (0, _addBasePath).addBasePath(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,
// @ts-ignore internal value not exposed on types
_h: 0
}), forcedScroll);
};
// represents the current component key
const route = (0, _removeTrailingSlash).removeTrailingSlash(pathname1);
// 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 (pathname1 !== '/_error') {
this.components[route] = {
Component,
initial: true,
props: initialProps,
err,
__N_SSG: initialProps && initialProps.__N_SSG,
__N_SSP: initialProps && initialProps.__N_SSP
};
}
this.components['/_app'] = {
Component: App,
styleSheets: []
};
// 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;
// if auto prerendered and dynamic route wait to update asPath
// until after mount to prevent hydration mismatch
const autoExportDynamic = (0, _isDynamic).isDynamicRoute(pathname1) && self.__NEXT_DATA__.autoExport;
this.basePath = process.env.__NEXT_ROUTER_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.isLocaleDomain = false;
this.isReady = !!(self.__NEXT_DATA__.gssp || self.__NEXT_DATA__.gip || self.__NEXT_DATA__.appGip && !self.__NEXT_DATA__.gsp || !autoExportDynamic && !self.location.search && !process.env.__NEXT_HAS_REWRITES);
if (process.env.__NEXT_I18N_SUPPORT) {
this.locales = locales;
this.defaultLocale = defaultLocale;
this.domainLocales = domainLocales;
this.isLocaleDomain = !!(0, _detectDomainLocale).detectDomainLocale(domainLocales, self.location.hostname);
}
this.state = {
route,
pathname: pathname1,
query: query1,
asPath: autoExportDynamic ? pathname1 : as1,
isPreview: !!isPreview,
locale: process.env.__NEXT_I18N_SUPPORT ? locale : undefined,
isFallback
};
this._initialMatchesMiddlewarePromise = Promise.resolve(false);
if (typeof window !== 'undefined') {
// make sure "as" doesn't start with double slashes or else it can
// throw an error as it's considered invalid
if (!as1.startsWith('//')) {
// in order for `e.state` to work on the `onpopstate` event
// we have to register the initial route upon initialization
const options = {
locale
};
const asPath = (0, _utils).getURL();
this._initialMatchesMiddlewarePromise = matchesMiddleware({
router: this,
locale,
asPath
}).then((matches)=>{
options._shouldResolveHref = as1 !== pathname1;
this.changeState('replaceState', matches ? asPath : (0, _formatUrl).formatWithValidation({
pathname: (0, _addBasePath).addBasePath(pathname1),
query: query1
}), asPath, options);
return matches;
});
}
window.addEventListener('popstate', this.onPopState);
// enable custom scroll restoration handling when available
// otherwise fallback to browser's default handling
if (process.env.__NEXT_SCROLL_RESTORATION) {
if (manualScrollRestoration) {
window.history.scrollRestoration = 'manual';
}
}
}
}
}
Router.events = (0, _mitt).default();
exports.default = Router;
//# sourceMappingURL=router.js.map@<40><16><><EFBFBD><EFBFBD><00><><EFBFBD><16><><EFBFBD><EFBFBD><01><><EFBFBD>(<28><><EFBFBD>,<2C><><EFBFBD>-<2D><><EFBFBD>.<2E><><EFBFBD>8<><38><EFBFBD><16><><EFBFBD><EFBFBD> <0C><><EFBFBD><02><><EFBFBD> <0A><><EFBFBD><16><><EFBFBD><EFBFBD><0E><><EFBFBD><16><><EFBFBD><EFBFBD><0F><><EFBFBD><10><><EFBFBD><11><><EFBFBD><12><><EFBFBD><13><><EFBFBD><14><><EFBFBD><15><><EFBFBD><16><><EFBFBD><17><><EFBFBD><18><><EFBFBD><19><><EFBFBD><1A><><EFBFBD><1B><><EFBFBD><1C><><EFBFBD><16><><EFBFBD><EFBFBD><1D><><EFBFBD><1E><><EFBFBD><16><><EFBFBD><EFBFBD><1F><><EFBFBD> <20><><EFBFBD><16><><EFBFBD><EFBFBD>!<21><><EFBFBD>"<22><><EFBFBD>#<23><><EFBFBD>$<24><><EFBFBD>%<25><><EFBFBD>&<26><><EFBFBD>'<27><><EFBFBD>v<><76><EFBFBD>.<2E><><EFBFBD><EFBFBD>cancelled<06><><EFBFBD>(<28><><EFBFBD><EFBFBD>apply<6C>arguments<74>matchers <09><><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><00><><EFBFBD><EFBFBD>pageLoader<65>getMiddlewareM<><4D><EFBFBD><EFBFBD>asPathname<6D>parsePath<74>asPath<74>cleanedAs<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>asWithBasePathAndLocale<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>K<><4B><EFBFBD><EFBFBD>m<EFBFBD>RegExp<78>regexp<78>test<1C><><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>origin<69>getLocationOriginH<><48><EFBFBD><EFBFBD>substring<6E>length<19><><EFBFBD><EFBFBD>object!<21><><EFBFBD><EFBFBD>omitted!<21><><EFBFBD><1B><><EFBFBD><EFBFBD>includes<65>isAbsoluteUrl<72>locationOrigin<69>resolved<65>URL<52>_<EFBFBD>route6<><36><EFBFBD><EFBFBD>interpolatedRoute<74>dynamicRegex<65>getRouteRegex<65>dynamicGroups<70>groups<70>dynamicMatches<65>getRouteMatcher<65>params<6D>every<72>param<61>repeat<13><><EFBFBD><EFBFBD>replaced<65>Array<61>isArray<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>encodeURIComponent<6E>join<69>result<16><><EFBFBD><EFBFBD><EFBFBD>resolveAs<41>base<73>urlAsString<6E>formatWithValidation<6F>urlProtoMatch<63>match<63>urlAsStringNoProto<74>slice<63>urlParts!<21><><EFBFBD> <0A><><EFBFBD><EFBFBD>error<6F>normalizedUrl<72>normalizeRepeatedSlashes<65>finalUrld<><64><EFBFBD><EFBFBD>interpolatedAs<41>isDynamicRoute<74>searchParams<6D>searchParamsToUrlQuery<16><><EFBFBD><EFBFBD><1F><><EFBFBD><EFBFBD>_1<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><1F><><EFBFBD><EFBFBD>hrefWasAbsolute<74>asWasAbsolute<74>preparedUrl<72>preparedAs<16><><EFBFBD><EFBFBD><EFBFBD>pages<65>cleanPathname<6D>removeTrailingSlash<73>denormalizePagePath<74>page<67>re<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>response<73>nextConfig<16><><EFBFBD><EFBFBD><EFBFBD>i18n(<28><><EFBFBD><EFBFBD>trailingSlash<73>Boolean<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>__NEXT_TRAILING_SLASH<53>rewriteHeader<65>headersl<><6C><EFBFBD><EFBFBD>rewriteTarget<65>matchedPath<74>parsedRewriteTarget<65>parseRelativeUrl<72>pathnameInfo<66>getNextPathnameInfo<66>parseData<74>fsPathname<6D>all<6C>getPageList <09><><EFBFBD><EFBFBD>then<65>__rewrites<65>rewritesA<><41><EFBFBD><EFBFBD>parsedSource<63>__NEXT_HAS_REWRITES<16><><EFBFBD><EFBFBD><EFBFBD>matchedPage<67>parsedAs<41>resolvedPathname<6D>matches(<28><><EFBFBD><EFBFBD>src<72>formatNextPathnameInfo<10><><EFBFBD><EFBFBD>buildId<49>destination<6F>redirectTarget<65>newAs<41>newUrl<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>fetchDatal<><6C><EFBFBD><EFBFBD>effect<63>dataHref<65>json<6F>text<78>cacheKey<65>e<16><><EFBFBD><EFBFBD><EFBFBD>__NEXT_SCROLL_RESTORATION<4F>window<6F>history<72>v<EFBFBD>sessionStorage<67>setItem<65>removeItem<65>n<16><><EFBFBD><EFBFBD><EFBFBD>Symbol<16><><EFBFBD><EFBFBD><EFBFBD>attempts<74>fetch<63>credentials<6C>method<6F>ok<6F>status<16><><EFBFBD><EFBFBD><EFBFBD>fn<66>htmlElement<6E>document<6E>documentElement7<><37><EFBFBD><EFBFBD>style<6C>scrollBehavior<6F>getClientRects<16><><EFBFBD><EFBFBD><EFBFBD>JSON<4F>parse<16><><EFBFBD><EFBFBD><EFBFBD>inflightCache<68>isPrefetch<63>hasMiddleware<72>isServerRender<65>parseJSON<4F>persistCache<68>isBackground<6E>unstable_skipClientCache<68>location<6F>ref1<66>getData<74>purpose<16><><EFBFBD><EFBFBD><EFBFBD>notFound<16><><EFBFBD><EFBFBD>}<7D><><EFBFBD>~<7E><><EFBFBD><EFBFBD>message<06><><EFBFBD><EFBFBD>Math<74>random<6F>toString<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>cancel<65>clc<6C>handleCancelled<16><><EFBFBD><EFBFBD><EFBFBD>reload<61>back<63>forward'<27><><EFBFBD><EFBFBD>_key<65>stringify<66>x<EFBFBD>self<6C>pageXOffset<65>y<EFBFBD>pageYOffset<65>change<67>forcedScroll<6C>_this<69>isQueryUpdating<6E>_h<5F>shouldResolveHref<65>_shouldResolveHref<65>nextState<74>state<74>readyStateChange<67>isReady<64>isSsr<73>prevLocale<16><><EFBFBD><EFBFBD><EFBFBD>localePathResult<16><><EFBFBD><EFBFBD><EFBFBD>didNavigate<74>detectedDomain<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>hostname<16><><EFBFBD><EFBFBD><EFBFBD>asNoBasePath<16><><EFBFBD><EFBFBD><EFBFBD>ST<53>performance<63>marke<><65><EFBFBD>f<><66><EFBFBD><EFBFBD>routeProps<70>_inFlightRoutee<><65><EFBFBD><EFBFBD>emit<16><><EFBFBD><EFBFBD><EFBFBD>localeChange<67>onlyAHashChange<67>changeState<74>scrollToHash<07><><EFBFBD><EFBFBD>components]<5D><><EFBFBD><EFBFBD>urlIsNew<65>parsedAsPathname<6D>isMiddlewareRewrite<74>isMiddlewareMatch<63>rewritesResult<6C>p<EFBFBD>externalDest<73>routeMatch<63>routeRegex<65>shouldInterpolate<74>missingParams<6D>filtery<><79><EFBFBD><EFBFBD>ref2<66>ref3<66>ref4<66>routeInfo<66>getRouteInfo<66>isPreview<65>isFallback<63>cleanedParsedPathname<6D>prefixedAs<41>rewriteAs<41>localeResult<6C>curRouteMatch<63>component<6E>Component<6E>unstable_scriptLoader<16><><EFBFBD><EFBFBD><EFBFBD>concat<61>script<16><><EFBFBD><EFBFBD>P<><50><EFBFBD><EFBFBD>__N_SSG<53>__N_SSP<53>pageProps<70>__N_REDIRECT<43>__N_REDIRECT_BASE_PATH<54>parsedHref<65>__N_PREVIEW<45>notFoundRoute<74>fetchComponent<6E>__NEXT_DATA__<5F>statusCode<64>_route<74>isValidShallowRoute<74>_scroll<6C>shouldScroll<6C>resetScroll<6C>upcomingScrollState<74>upcomingRouterState<74>ref5<66>ref6<66>ref7<66>canSkipUpdating<6E>compareRouterStates<65>lang<6E>hashRegex<65>err1<72>getURL<52>_shallow<6F>__N<5F>handleRouteInfoError<6F>loadErrorFaild<><64><EFBFBD><EFBFBD>styleSheets<74>getInitialProps<70>gipErr<72>routeInfoErr<72>requestedRoute<74>ref8<66>ref9<66>ref10<31>existingInfo<66>cachedRouteInfo<66>fetchNextDataParams<6D>getDataHref<65>skipInterpolation<6F>sbc<62>sdc<64>resolvedRoute*<2A><><EFBFBD><EFBFBD>res<65>mod<6F>isValidElementType<70>wasBailedPrefetch<63>shouldFetchData<74>_getData<74>fetched<65>getProperError<6F>sub<75>beforePopState<74>cb<63>_bps<70>oldUrlNoHash<73>oldHash<73>newUrlNoHash<73>newHash<73>scrollTo<54>rawHash<73>decodeURIComponent<6E>idEl<45>getElementById<49>scrollIntoView<65>nameEl<45>getElementsByName~<7E><><EFBFBD><EFBFBD>isBot<6F>navigator<6F>userAgent<6E>originalPathname<6D>__NEXT_MIDDLEWARE_PREFETCH<43>_isSsg<73>isSsgF<><46><EFBFBD><EFBFBD>__NEXT_OPTIMISTIC_CLIENT_CACHE<48>componentResult<6C>loadPage<67>_getFlightData<74>ctx<74>App<70>AppTree<65>_wrapApp<70>loadGetInitialProps<70>constructor<6F>pathname1<65>query1<79>as1<73>initialProps<70>wrapApp<70>subscription<6F>isFirstPopStateEvent<6E>onPopState<74>__NA<4E>getItem<65>e1<65>initial<61>autoExportDynamic<69>autoExport\<5C><><EFBFBD><EFBFBD>gssp<73>gip<69>appGip<69>gsp<73>search<63>_initialMatchesMiddlewarePromise<73>addEventListener<65>scrollRestoration/<2F><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>Lmodule.exports = require("ne
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.normalizePathTrailingSlash = void 0;
var _removeTrailingSlash = require("../shared/lib/router/utils/remove-trailing-slash");
var _parsePath = require("../shared/lib/router/utils/parse-path");
const normalizePathTrailingSlash = (path)=>{
if (!path.startsWith("/") || process.env.__NEXT_MANUAL_TRAILING_SLASH) {
return path;
}
const { pathname , query , hash } = (0, _parsePath).parsePath(path);
if (process.env.__NEXT_TRAILING_SLASH) {
if (/\.[^/]+\/?$/.test(pathname)) {
return `${(0, _removeTrailingSlash).removeTrailingSlash(pathname)}${query}${hash}`;
} else if (pathname.endsWith("/")) {
return `${pathname}${query}${hash}`;
} else {
return `${pathname}/${query}${hash}`;
}
}
return `${(0, _removeTrailingSlash).removeTrailingSlash(pathname)}${query}${hash}`;
};
exports.normalizePathTrailingSlash = normalizePathTrailingSlash;
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=normalize-trailing-slash.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/normalize-trailing-slash.js {"version":3,"sources":["webpack://./node_modules/next/dist/client/normalize-trailing-slash.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.normalizePathTrailingSlash = void 0;\nvar _removeTrailingSlash = require(\"../shared/lib/router/utils/remove-trailing-slash\");\nvar _parsePath = require(\"../shared/lib/router/utils/parse-path\");\nconst normalizePathTrailingSlash = (path)=>{\n if (!path.startsWith('/') || process.env.__NEXT_MANUAL_TRAILING_SLASH) {\n return path;\n }\n const { pathname , query , hash } = (0, _parsePath).parsePath(path);\n if (process.env.__NEXT_TRAILING_SLASH) {\n if (/\\.[^/]+\\/?$/.test(pathname)) {\n return `${(0, _removeTrailingSlash).removeTrailingSlash(pathname)}${query}${hash}`;\n } else if (pathname.endsWith('/')) {\n return `${pathname}${query}${hash}`;\n } else {\n return `${pathname}/${query}${hash}`;\n }\n }\n return `${(0, _removeTrailingSlash).removeTrailingSlash(pathname)}${query}${hash}`;\n};\nexports.normalizePathTrailingSlash = normalizePathTrailingSlash;\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=normalize-trailing-slash.js.map"],"names":["Object","defineProperty","exports","value","normalizePathTrailingSlash","_removeTrailingSlash","require","_parsePath","path","startsWith","process","env","__NEXT_MANUAL_TRAILING_SLASH","pathname","query","hash","parsePath","__NEXT_TRAILING_SLASH","test","removeTrailingSlash","endsWith","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,0BAA0B,GAAG,KAAK;AAC1C,IAAIC,uBAAuBC,QAAQ;AACnC,IAAIC,aAAaD,QAAQ;AACzB,MAAMF,6BAA6B,CAACI,OAAO;IACvC,IAAI,CAACA,KAAKC,UAAU,CAAC,QAAQC,QAAQC,GAAG,CAACC,4BAA4B,EAAE;QACnE,OAAOJ;IACX,CAAC;IACD,MAAM,EAAEK,SAAQ,EAAGC,MAAK,EAAGC,KAAI,EAAG,GAAG,AAAC,CAAA,GAAGR,UAAU,AAAD,EAAGS,SAAS,CAACR;IAC/D,IAAIE,QAAQC,GAAG,CAACM,qBAAqB,EAAE;QACnC,IAAI,cAAcC,IAAI,CAACL,WAAW;YAC9B,OAAO,CAAC,EAAE,AAAC,CAAA,GAAGR,oBAAoB,AAAD,EAAGc,mBAAmB,CAACN,UAAU,EAAEC,MAAM,EAAEC,KAAK,CAAC;QACtF,OAAO,IAAIF,SAASO,QAAQ,CAAC,MAAM;YAC/B,OAAO,CAAC,EAAEP,SAAS,EAAEC,MAAM,EAAEC,KAAK,CAAC;QACvC,OAAO;YACH,OAAO,CAAC,EAAEF,SAAS,CAAC,EAAEC,MAAM,EAAEC,KAAK,CAAC;QACxC,CAAC;IACL,CAAC;IACD,OAAO,CAAC,EAAE,AAAC,CAAA,GAAGV,oBAAoB,AAAD,EAAGc,mBAAmB,CAACN,UAAU,EAAEC,MAAM,EAAEC,KAAK,CAAC;AACtF;AACAb,QAAQE,0BAA0B,GAAGA;AAErC,IAAI,AAAC,CAAA,OAAOF,QAAQmB,OAAO,KAAK,cAAe,OAAOnB,QAAQmB,OAAO,KAAK,YAAYnB,QAAQmB,OAAO,KAAK,IAAI,KAAM,OAAOnB,QAAQmB,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKtB,OAAOC,cAAc,CAACC,QAAQmB,OAAO,EAAE,cAAc;QAAElB,OAAO,IAAI;IAAC;IACnEH,OAAOuB,MAAM,CAACrB,QAAQmB,OAAO,EAAEnB;IAC/BsB,OAAOtB,OAAO,GAAGA,QAAQmB,OAAO;AAClC,CAAC,CAED,oDAAoD","file":"x"}h :NNQrO<72><00><00><00><00><00><00>g<00> #`<00><00><00><18>Object.defineProperty(exports, "__esModule", (<18>))<18>exports.normalizePathTrailingSlash<18>__webpack_require__<18>/*! ../shared/lib/router/utils/remove-trailing-slash */ "../shared/lib/router/utils/remove-trailing-slash"<15><18>/*! ../shared/lib/router/utils/parse-path */ "../shared/lib/router/utils/parse-path"<18>undefined<18>false<18>{}<15><16><><EFBFBD><EFBFBD><1F>
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.normalizePathTrailingSlash = void 0;
var _removeTrailingSlash = __webpack_require__(/*! ../shared/lib/router/utils/remove-trailing-slash */ "../shared/lib/router/utils/remove-trailing-slash");
var _parsePath = __webpack_require__(/*! ../shared/lib/router/utils/parse-path */ "../shared/lib/router/utils/parse-path");
const normalizePathTrailingSlash = (path)=>{
if (!path.startsWith("/") || undefined) {
return path;
}
const { pathname , query , hash } = (0, _parsePath).parsePath(path);
if (false) {}
return `${(0, _removeTrailingSlash).removeTrailingSlash(pathname)}${query}${hash}`;
};
exports.normalizePathTrailingSlash = normalizePathTrailingSlash;
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=normalize-trailing-slash.js.map
<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><03>xAAAa;AACbA,8CAA6C;IACzCG,OAAO,IAAI;AACf,CAAC,EAAC;AACFD,kCAAkC,GAAG,KAAK;AAC1C,IAAIG,uBAAuBC,mBAAOA,CAAC,0GAAkD;AACrF,IAAIC,aAAaD,mBAAOA,CAAC,oFAAuC;AAChE,MAAMF,6BAA6B,CAACI,OAAO;IACvC,IAAI,CAACA,KAAKC,UAAU,CAAC,QAAQC,SAAwC,EAAE;QACnE,OAAOF;IACX,CAAC;IACD,MAAM,EAAEK,SAAQ,EAAGC,MAAK,EAAGC,KAAI,EAAG,GAAG,CAAC,GAAGR,UAAU,EAAES,SAAS,CAACR;IAC/D,IAAIE,KAAiC,EAAE,EAQtC;IACD,OAAO,CAAC,EAAE,CAAC,GAAGL,oBAAoB,EAAEc,mBAAmB,CAACN,UAAU,EAAEC,MAAM,EAAEC,KAAK,CAAC;AACtF;AACAb,kCAAkC,GAAGE;AAErC,IAAI,CAAC,OAAOF,QAAQmB,OAAO,KAAK,cAAe,OAAOnB,QAAQmB,OAAO,KAAK,YAAYnB,QAAQmB,OAAO,KAAK,IAAI,KAAM,OAAOnB,QAAQmB,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKtB,OAAOC,cAAc,CAACC,QAAQmB,OAAO,EAAE,cAAc;QAAElB,OAAO,IAAI;IAAC;IACnEH,OAAOuB,MAAM,CAACrB,QAAQmB,OAAO,EAAEnB;IAC/BsB,OAAOtB,OAAO,GAAGA,QAAQmB,OAAO;AAClC,CAAC,CAED,oDAAoD<01>webpack://./node_modules/next/dist/client/normalize-trailing-slash.jsw"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.normalizePathTrailingSlash = void 0;
var _removeTrailingSlash = require("../shared/lib/router/utils/remove-trailing-slash");
var _parsePath = require("../shared/lib/router/utils/parse-path");
const normalizePathTrailingSlash = (path)=>{
if (!path.startsWith('/') || process.env.__NEXT_MANUAL_TRAILING_SLASH) {
return path;
}
const { pathname , query , hash } = (0, _parsePath).parsePath(path);
if (process.env.__NEXT_TRAILING_SLASH) {
if (/\.[^/]+\/?$/.test(pathname)) {
return `${(0, _removeTrailingSlash).removeTrailingSlash(pathname)}${query}${hash}`;
} else if (pathname.endsWith('/')) {
return `${pathname}${query}${hash}`;
} else {
return `${pathname}/${query}${hash}`;
}
}
return `${(0, _removeTrailingSlash).removeTrailingSlash(pathname)}${query}${hash}`;
};
exports.normalizePathTrailingSlash = normalizePathTrailingSlash;
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=normalize-trailing-slash.js.map`<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>__NEXT_MANUAL_TRAILING_SLASH<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><19><><EFBFBD><16><><EFBFBD><EFBFBD><1A><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>q<><71><EFBFBD>r<><72><EFBFBD>Qmodule.exports = require("next/dist/shared/lib/router/utils/add-path-prefix.js");<3B>external commonjs "next/dist/shared/lib/router/utils/add-path-prefix.js"<16><><EFBFBD><EFBFBD>l<><6C><EFBFBD>m<><6D><EFBFBD> <00><10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/OriginalSourceG"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return _objectWithoutPropertiesLoose;
}
});
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for(i = 0; i < sourceKeys.length; i++){
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
<EFBFBD>webpack://./node_modules/@swc/helpers/lib/_object_without_properties_loose.jsf :NNQzA<7A><00><00><18>Object.defineProperty(exports, "__esModule", (<18>))<18>Object.defineProperty(exports, "default", (<15>q<><71><EFBFBD>>
Object.defineProperty(exports, "__esModule", ({
value: true
}));
Object.defineProperty(exports, "default", ({
enumerable: true,
get: function() {
return _objectWithoutPropertiesLoose;
}
}));
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for(i = 0; i < sourceKeys.length; i++){
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
r<><72><EFBFBD>u<><75><EFBFBD>y<><79><EFBFBD><03>x<1F>AAAa;AACb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,2CAA0C;AAC1C;AACA;AACA;AACA;AACA,CAAC,EAAC;AACF;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA;AACA;AACA;AACA;AACA<16><><EFBFBD><EFBFBD><><7F><EFBFBD><08><><EFBFBD>_<><5F><EFBFBD>`<60><><EFBFBD> <00><10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/SourceMapSource<10><1F>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.cancelIdleCallback = exports.requestIdleCallback = void 0;
const requestIdleCallback = typeof self !== "undefined" && self.requestIdleCallback && self.requestIdleCallback.bind(window) || function(cb) {
let start = Date.now();
return self.setTimeout(function() {
cb({
didTimeout: false,
timeRemaining: function() {
return Math.max(0, 50 - (Date.now() - start));
}
});
}, 1);
};
exports.requestIdleCallback = requestIdleCallback;
const cancelIdleCallback = typeof self !== "undefined" && self.cancelIdleCallback && self.cancelIdleCallback.bind(window) || function(id) {
return clearTimeout(id);
2023-01-04 02:30:44 +01:00
};
exports.cancelIdleCallback = cancelIdleCallback;
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=request-idle-callback.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/request-idle-callback.js<1F> {"version":3,"sources":["webpack://./node_modules/next/dist/client/request-idle-callback.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.cancelIdleCallback = exports.requestIdleCallback = void 0;\nconst requestIdleCallback = typeof self !== 'undefined' && self.requestIdleCallback && self.requestIdleCallback.bind(window) || function(cb) {\n let start = Date.now();\n return self.setTimeout(function() {\n cb({\n didTimeout: false,\n timeRemaining: function() {\n return Math.max(0, 50 - (Date.now() - start));\n }\n });\n }, 1);\n};\nexports.requestIdleCallback = requestIdleCallback;\nconst cancelIdleCallback = typeof self !== 'undefined' && self.cancelIdleCallback && self.cancelIdleCallback.bind(window) || function(id) {\n return clearTimeout(id);\n};\nexports.cancelIdleCallback = cancelIdleCallback;\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=request-idle-callback.js.map"],"names":["Object","defineProperty","exports","value","cancelIdleCallback","requestIdleCallback","self","bind","window","cb","start","Date","now","setTimeout","didTimeout","timeRemaining","Math","max","id","clearTimeout","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,kBAAkB,GAAGF,QAAQG,mBAAmB,GAAG,KAAK;AAChE,MAAMA,sBAAsB,OAAOC,SAAS,eAAeA,KAAKD,mBAAmB,IAAIC,KAAKD,mBAAmB,CAACE,IAAI,CAACC,WAAW,SAASC,EAAE,EAAE;IACzI,IAAIC,QAAQC,KAAKC,GAAG;IACpB,OAAON,KAAKO,UAAU,CAAC,WAAW;QAC9BJ,GAAG;YACCK,YAAY,KAAK;YACjBC,eAAe,WAAW;gBACtB,OAAOC,KAAKC,GAAG,CAAC,GAAG,KAAMN,CAAAA,KAAKC,GAAG,KAAKF,KAAI;YAC9C;QACJ;IACJ,GAAG;AACP;AACAR,QAAQG,mBAAmB,GAAGA;AAC9B,MAAMD,qBAAqB,OAAOE,SAAS,eAAeA,KAAKF,kBAAkB,IAAIE,KAAKF,kBAAkB,CAACG,IAAI,CAACC,WAAW,SAASU,EAAE,EAAE;IACtI,OAAOC,aAAaD;AACxB;AACAhB,QAAQE,kBAAkB,GAAGA;AAE7B,IAAI,AAAC,CAAA,OAAOF,QAAQkB,OAAO,KAAK,cAAe,OAAOlB,QAAQkB,OAAO,KAAK,YAAYlB,QAAQkB,OAAO,KAAK,IAAI,KAAM,OAAOlB,QAAQkB,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKrB,OAAOC,cAAc,CAACC,QAAQkB,OAAO,EAAE,cAAc;QAAEjB,OAAO,IAAI;IAAC;IACnEH,OAAOsB,MAAM,CAACpB,QAAQkB,OAAO,EAAElB;IAC/BqB,OAAOrB,OAAO,GAAGA,QAAQkB,OAAO;AAClC,CAAC,CAED,iDAAiD","file":"x"}g :NNQjnD<6E>"<<00><18>Object.defineProperty(exports, "__esModule", (<18>))<18>exports.cancelIdleCallback<18>exports.requestIdleCallback<15><15>d<><64><EFBFBD><1F>
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.cancelIdleCallback = exports.requestIdleCallback = void 0;
const requestIdleCallback = typeof self !== "undefined" && self.requestIdleCallback && self.requestIdleCallback.bind(window) || function(cb) {
let start = Date.now();
return self.setTimeout(function() {
cb({
didTimeout: false,
timeRemaining: function() {
return Math.max(0, 50 - (Date.now() - start));
}
});
}, 1);
};
exports.requestIdleCallback = requestIdleCallback;
const cancelIdleCallback = typeof self !== "undefined" && self.cancelIdleCallback && self.cancelIdleCallback.bind(window) || function(id) {
return clearTimeout(id);
};
exports.cancelIdleCallback = cancelIdleCallback;
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=request-idle-callback.js.map
e<><65><EFBFBD>h<><68><EFBFBD>l<><6C><EFBFBD><03>xnAAAa;AACbA,8CAA6C;IACzCG,OAAO,IAAI;AACf,CAAC,EAAC;AACFD,0BAA0B,GAAGA,2BAA2B,GAAG,KAAK;AAChE,MAAMG,sBAAsB,OAAOC,SAAS,eAAeA,KAAKD,mBAAmB,IAAIC,KAAKD,mBAAmB,CAACE,IAAI,CAACC,WAAW,SAASC,EAAE,EAAE;IACzI,IAAIC,QAAQC,KAAKC,GAAG;IACpB,OAAON,KAAKO,UAAU,CAAC,WAAW;QAC9BJ,GAAG;YACCK,YAAY,KAAK;YACjBC,eAAe,WAAW;gBACtB,OAAOC,KAAKC,GAAG,CAAC,GAAG,KAAMN,CAAAA,KAAKC,GAAG,KAAKF,KAAI;YAC9C;QACJ;IACJ,GAAG;AACP;AACAR,2BAA2B,GAAGG;AAC9B,MAAMD,qBAAqB,OAAOE,SAAS,eAAeA,KAAKF,kBAAkB,IAAIE,KAAKF,kBAAkB,CAACG,IAAI,CAACC,WAAW,SAASU,EAAE,EAAE;IACtI,OAAOC,aAAaD;AACxB;AACAhB,0BAA0B,GAAGE;AAE7B,IAAI,CAAC,OAAOF,QAAQkB,OAAO,KAAK,cAAe,OAAOlB,QAAQkB,OAAO,KAAK,YAAYlB,QAAQkB,OAAO,KAAK,IAAI,KAAM,OAAOlB,QAAQkB,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKrB,OAAOC,cAAc,CAACC,QAAQkB,OAAO,EAAE,cAAc;QAAEjB,OAAO,IAAI;IAAC;IACnEH,OAAOsB,MAAM,CAACpB,QAAQkB,OAAO,EAAElB;IAC/BqB,OAAOrB,OAAO,GAAGA,QAAQkB,OAAO;AAClC,CAAC,CAED,iDAAiD<01>webpack://./node_modules/next/dist/client/request-idle-callback.js<1F>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.cancelIdleCallback = exports.requestIdleCallback = void 0;
const requestIdleCallback = typeof self !== 'undefined' && self.requestIdleCallback && self.requestIdleCallback.bind(window) || function(cb) {
let start = Date.now();
return self.setTimeout(function() {
cb({
didTimeout: false,
timeRemaining: function() {
return Math.max(0, 50 - (Date.now() - start));
}
});
}, 1);
};
exports.requestIdleCallback = requestIdleCallback;
const cancelIdleCallback = typeof self !== 'undefined' && self.cancelIdleCallback && self.cancelIdleCallback.bind(window) || function(id) {
return clearTimeout(id);
};
exports.cancelIdleCallback = cancelIdleCallback;
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=request-idle-callback.js.map`<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>g<><67><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>bind<16><><EFBFBD><EFBFBD><15><16><><EFBFBD><EFBFBD><EFBFBD>Date<74>now<6F>setTimeout<75>didTimeout<75>timeRemaining<0F><><EFBFBD><EFBFBD>max/<2F><><EFBFBD><EFBFBD>clearTimeout`<60><><EFBFBD>[<5B><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>H<><48><EFBFBD>I<><49><EFBFBD>Wmodule.exports = require("next/dist/shared/lib/router/utils/remove-trailing-slash.js");<3B>external commonjs "next/dist/shared/lib/router/utils/remove-trailing-slash.js"d<><64><EFBFBD>C<><43><EFBFBD>D<><44><EFBFBD>Lmodule.exports = require("next/dist/shared/lib/router/utils/parse-path.js");<3B>external commonjs "next/dist/shared/lib/router/utils/parse-path.js"_<><5F><EFBFBD>><3E><><EFBFBD>?<3F><><EFBFBD> W<><10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/SourceMapSource<10><1F>."use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.markAssetError = markAssetError;
exports.isAssetError = isAssetError;
exports.getClientBuildManifest = getClientBuildManifest;
exports.createRouteLoader = createRouteLoader;
var _interop_require_default = require("@swc/helpers/lib/_interop_require_default.js").default;
var _getAssetPathFromRoute = _interop_require_default(require("../shared/lib/router/utils/get-asset-path-from-route"));
var _trustedTypes = require("./trusted-types");
var _requestIdleCallback = require("./request-idle-callback");
// 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.
const MS_MAX_IDLE_DELAY = 3800;
function withFuture(key, map, generator) {
let entry = map.get(key);
if (entry) {
if ("future" in entry) {
return entry.future;
}
return Promise.resolve(entry);
}
let resolver;
const prom = new Promise((resolve)=>{
resolver = resolve;
});
map.set(key, entry = {
resolve: resolver,
future: prom
});
return generator ? generator() // eslint-disable-next-line no-sequences
.then((value)=>(resolver(value), value)).catch((err)=>{
map.delete(key);
throw err;
}) : prom;
}
const ASSET_LOAD_ERROR = Symbol("ASSET_LOAD_ERROR");
function markAssetError(err) {
return Object.defineProperty(err, ASSET_LOAD_ERROR, {});
}
function isAssetError(err) {
return err && ASSET_LOAD_ERROR in err;
}
function hasPrefetch(link) {
try {
link = document.createElement("link");
return(// with relList.support
!!window.MSInputMethodContext && !!document.documentMode || link.relList.supports("prefetch"));
} catch (e) {
return false;
}
}
const canPrefetch = hasPrefetch();
function prefetchViaDom(href, as, link) {
return new Promise((resolve, reject)=>{
const selector = `
link[rel="prefetch"][href^="${href}"],
link[rel="preload"][href^="${href}"],
script[src^="${href}"]`;
if (document.querySelector(selector)) {
return resolve();
}
link = document.createElement("link");
// The order of property assignment here is intentional:
if (as) link.as = as;
link.rel = `prefetch`;
link.crossOrigin = process.env.__NEXT_CROSS_ORIGIN;
link.onload = resolve;
link.onerror = ()=>reject(markAssetError(new Error(`Failed to prefetch: ${href}`)));
// `href` should always be last:
link.href = href;
document.head.appendChild(link);
});
}
function appendScript(src, script) {
return new Promise((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 = ()=>reject(markAssetError(new Error(`Failed to load script: ${src}`)));
// 2. Configure the cross-origin attribute before setting `src` in case the
// browser begins to fetch.
script.crossOrigin = process.env.__NEXT_CROSS_ORIGIN;
// 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);
});
}
// We wait for pages to be built in dev before we start the route transition
// timeout to prevent an un-necessary hard navigation in development.
let devBuildPromise;
// Resolve a promise that times out after given amount of milliseconds.
function resolvePromiseWithTimeout(p, ms, err) {
return new Promise((resolve, reject)=>{
let cancelled = false;
p.then((r)=>{
// Resolved, cancel the timeout
cancelled = true;
resolve(r);
}).catch(reject);
// We wrap these checks separately for better dead-code elimination in
// production bundles.
if ("development" === "development") {
(devBuildPromise || Promise.resolve()).then(()=>{
(0, _requestIdleCallback).requestIdleCallback(()=>setTimeout(()=>{
if (!cancelled) {
reject(err);
}
}, ms));
});
}
if ("development" !== "development") {
(0, _requestIdleCallback).requestIdleCallback(()=>setTimeout(()=>{
if (!cancelled) {
reject(err);
}
}, ms));
}
});
}
function getClientBuildManifest() {
if (self.__BUILD_MANIFEST) {
return Promise.resolve(self.__BUILD_MANIFEST);
}
const onBuildManifest = new Promise((resolve)=>{
// Mandatory because this is not concurrent safe:
const cb = self.__BUILD_MANIFEST_CB;
self.__BUILD_MANIFEST_CB = ()=>{
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 ("development" === "development") {
const scriptUrl = assetPrefix + "/_next/static/chunks/pages" + encodeURI((0, _getAssetPathFromRoute).default(route, ".js"));
return Promise.resolve({
scripts: [
(0, _trustedTypes).__unsafeCreateTrustedScriptURL(scriptUrl)
],
// Styles are handled by `style-loader` in development:
css: []
});
}
return getClientBuildManifest().then((manifest)=>{
if (!(route in manifest)) {
throw markAssetError(new Error(`Failed to lookup route: ${route}`));
}
const allFiles = manifest[route].map((entry)=>assetPrefix + "/_next/" + encodeURI(entry));
return {
scripts: allFiles.filter((v)=>v.endsWith(".js")).map((v)=>(0, _trustedTypes).__unsafeCreateTrustedScriptURL(v)),
css: allFiles.filter((v)=>v.endsWith(".css"))
};
});
}
function createRouteLoader(assetPrefix) {
const entrypoints = new Map();
const loadedScripts = new Map();
const styleSheets = new Map();
const routes = new Map();
function maybeExecuteScript(src) {
// With HMR we might need to "reload" scripts when they are
// disposed and readded. Executing scripts twice has no functional
// differences
if ("development" !== "development") {
let prom = loadedScripts.get(src.toString());
if (prom) {
return prom;
}
// Skip executing script if it's already in the DOM:
if (document.querySelector(`script[src^="${src}"]`)) {
return Promise.resolve();
}
loadedScripts.set(src.toString(), prom = appendScript(src));
return prom;
} else {
return appendScript(src);
}
}
function fetchStyleSheet(href) {
let prom = styleSheets.get(href);
if (prom) {
return prom;
}
styleSheets.set(href, prom = fetch(href).then((res)=>{
if (!res.ok) {
throw new Error(`Failed to load stylesheet: ${href}`);
}
return res.text().then((text)=>({
href: href,
content: text
}));
}).catch((err)=>{
throw markAssetError(err);
}));
return prom;
}
return {
whenEntrypoint (route) {
return withFuture(route, entrypoints);
},
onEntrypoint (route, execute) {
(execute ? Promise.resolve().then(()=>execute()).then((exports1)=>({
component: exports1 && exports1.default || exports1,
exports: exports1
}), (err)=>({
error: err
})) : Promise.resolve(undefined)).then((input)=>{
const old = entrypoints.get(route);
if (old && "resolve" in old) {
if (input) {
entrypoints.set(route, input);
old.resolve(input);
}
} else {
if (input) {
entrypoints.set(route, input);
} else {
entrypoints.delete(route);
}
// when this entrypoint has been resolved before
// the route is outdated and we want to invalidate
// this cache entry
routes.delete(route);
}
});
},
loadRoute (route, prefetch) {
return withFuture(route, routes, ()=>{
let devBuildPromiseResolve;
if ("development" === "development") {
devBuildPromise = new Promise((resolve)=>{
devBuildPromiseResolve = resolve;
});
}
return resolvePromiseWithTimeout(getFilesForRoute(assetPrefix, route).then(({ scripts , css })=>{
return Promise.all([
entrypoints.has(route) ? [] : Promise.all(scripts.map(maybeExecuteScript)),
Promise.all(css.map(fetchStyleSheet))
]);
}).then((res)=>{
return this.whenEntrypoint(route).then((entrypoint)=>({
entrypoint,
styles: res[1]
}));
}), MS_MAX_IDLE_DELAY, markAssetError(new Error(`Route did not complete loading: ${route}`))).then(({ entrypoint , styles })=>{
const res = Object.assign({
styles: styles
}, entrypoint);
return "error" in entrypoint ? entrypoint : res;
}).catch((err)=>{
if (prefetch) {
// we don't want to cache errors during prefetch
throw err;
}
return {
error: err
};
}).finally(()=>{
return devBuildPromiseResolve == null ? void 0 : devBuildPromiseResolve();
});
});
},
prefetch (route) {
// https://github.com/GoogleChromeLabs/quicklink/blob/453a661fa1fa940e2d2e044452398e38c67a98fb/src/index.mjs#L115-L118
// License: Apache 2.0
let 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((output)=>Promise.all(canPrefetch ? output.scripts.map((script)=>prefetchViaDom(script.toString(), "script")) : [])).then(()=>{
(0, _requestIdleCallback).requestIdleCallback(()=>this.loadRoute(route, true).catch(()=>{}));
}).catch(()=>{});
}
};
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=route-loader.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/route-loader.jsU{"version":3,"sources":["webpack://./node_modules/next/dist/client/route-loader.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.markAssetError = markAssetError;\nexports.isAssetError = isAssetError;\nexports.getClientBuildManifest = getClientBuildManifest;\nexports.createRouteLoader = createRouteLoader;\nvar _interop_require_default = require(\"@swc/helpers/lib/_interop_require_default.js\").default;\nvar _getAssetPathFromRoute = _interop_require_default(require(\"../shared/lib/router/utils/get-asset-path-from-route\"));\nvar _trustedTypes = require(\"./trusted-types\");\nvar _requestIdleCallback = require(\"./request-idle-callback\");\n// 3.8s was arbitrarily chosen as it's what https://web.dev/interactive\n// considers as \"Good\" time-to-interactive. We must assume something went\n// wrong beyond this point, and then fall-back to a full page transition to\n// show the user something of value.\nconst MS_MAX_IDLE_DELAY = 3800;\nfunction withFuture(key, map, generator) {\n let entry = map.get(key);\n if (entry) {\n if ('future' in entry) {\n return entry.future;\n }\n return Promise.resolve(entry);\n }\n let resolver;\n const prom = new Promise((resolve)=>{\n resolver = resolve;\n });\n map.set(key, entry = {\n resolve: resolver,\n future: prom\n });\n return generator ? generator()// eslint-disable-next-line no-sequences\n .then((value)=>(resolver(value), value)).catch((err)=>{\n map.delete(key);\n throw err;\n }) : prom;\n}\nconst ASSET_LOAD_ERROR = Symbol('ASSET_LOAD_ERROR');\nfunction markAssetError(err) {\n return Object.defineProperty(err, ASSET_LOAD_ERROR, {});\n}\nfunction isAssetError(err) {\n return err && ASSET_LOAD_ERROR in err;\n}\nfunction hasPrefetch(link) {\n try {\n link = document.createElement('link');\n return(// detect IE11 since it supports prefetch but isn't detected\n // with relList.support\n (!!window.MSInputMethodContext && !!document.documentMode) || link.relList.supports('prefetch'));\n } catch (e) {\n return false;\n }\n}\nconst canPrefetch = hasPrefetch();\nfunction prefetchViaDom(href, as, link) {\n return new Promise((resolve, reject)=>{\n const selector = `\n link[rel=\"prefetch\"][href^=\"${href}\"],\n link[rel=\"preload\"][href^=\"${href}\"],\n script[src^=\"${href}\"]`;\n if (document.querySelector(selector)) {\n return resolve();\n }\n link = document.createElement('link');\n // The order of property assignment here is intentional:\n if (as) link.as = as;\n link.rel = `prefetch`;\n link.crossOrigin = process.env.__NEXT_CROSS_ORIGIN;\n link.onload = resolve;\n link.onerror = ()=>reject(markAssetError(new Error(`Failed to prefetch: ${href}`)));\n // `href` should always be last:\n link.href = href;\n document.head.appendChild(link);\n });\n}\nfunction appendScript(src, script) {\n return new Promise((resolve, reject)=>{\n script = document.createElement('script');\n // The order of property assignment here is intentional.\n // 1. Setup success/failure hooks in case the browser synchronously\n // executes when `src` is set.\n script.onload = resolve;\n script.onerror = ()=>reject(markAssetError(new Error(`Failed to load script: ${src}`)));\n // 2. Configure the cross-origin attribute before setting `src` in case the\n // browser begins to fetch.\n script.crossOrigin = process.env.__NEXT_CROSS_ORIGIN;\n // 3. Finally, set the source and inject into the DOM in case the child\n // must be appended for fetching to start.\n script.src = src;\n document.body.appendChild(script);\n });
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.markAssetError = markAssetError;
exports.isAssetError = isAssetError;
exports.getClientBuildManifest = getClientBuildManifest;
exports.createRouteLoader = createRouteLoader;
var _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ "./node_modules/@swc/helpers/lib/_interop_require_default.js")["default"]);
var _getAssetPathFromRoute = _interop_require_default(__webpack_require__(/*! ../shared/lib/router/utils/get-asset-path-from-route */ "../shared/lib/router/utils/get-asset-path-from-route"));
var _trustedTypes = __webpack_require__(/*! ./trusted-types */ "./node_modules/next/dist/client/trusted-types.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.
const MS_MAX_IDLE_DELAY = 3800;
function withFuture(key, map, generator) {
let entry = map.get(key);
if (entry) {
if ("future" in entry) {
return entry.future;
}
return Promise.resolve(entry);
}
let resolver;
const prom = new Promise((resolve)=>{
resolver = resolve;
});
map.set(key, entry = {
resolve: resolver,
future: prom
});
return generator ? generator() // eslint-disable-next-line no-sequences
.then((value)=>(resolver(value), value)).catch((err)=>{
map.delete(key);
throw err;
}) : prom;
}
const ASSET_LOAD_ERROR = Symbol("ASSET_LOAD_ERROR");
function markAssetError(err) {
return Object.defineProperty(err, ASSET_LOAD_ERROR, {});
}
function isAssetError(err) {
return err && ASSET_LOAD_ERROR in err;
}
function hasPrefetch(link) {
try {
link = document.createElement("link");
return(// with relList.support
!!window.MSInputMethodContext && !!document.documentMode || link.relList.supports("prefetch"));
} catch (e) {
return false;
}
}
const canPrefetch = hasPrefetch();
function prefetchViaDom(href, as, link) {
return new Promise((resolve, reject)=>{
const selector = `
link[rel="prefetch"][href^="${href}"],
link[rel="preload"][href^="${href}"],
script[src^="${href}"]`;
if (document.querySelector(selector)) {
return resolve();
}
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 = resolve;
link.onerror = ()=>reject(markAssetError(new Error(`Failed to prefetch: ${href}`)));
// `href` should always be last:
link.href = href;
document.head.appendChild(link);
});
}
function appendScript(src, script) {
return new Promise((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 = ()=>reject(markAssetError(new Error(`Failed to load script: ${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);
});
}
// We wait for pages to be built in dev before we start the route transition
// timeout to prevent an un-necessary hard navigation in development.
let devBuildPromise;
// Resolve a promise that times out after given amount of milliseconds.
function resolvePromiseWithTimeout(p, ms, err) {
return new Promise((resolve, reject)=>{
let cancelled = false;
p.then((r)=>{
// Resolved, cancel the timeout
cancelled = true;
resolve(r);
}).catch(reject);
// We wrap these checks separately for better dead-code elimination in
// production bundles.
if (true) {
(devBuildPromise || Promise.resolve()).then(()=>{
(0, _requestIdleCallback).requestIdleCallback(()=>setTimeout(()=>{
if (!cancelled) {
reject(err);
}
}, ms));
});
}
if (false) {}
});
}
function getClientBuildManifest() {
if (self.__BUILD_MANIFEST) {
return Promise.resolve(self.__BUILD_MANIFEST);
}
const onBuildManifest = new Promise((resolve)=>{
// Mandatory because this is not concurrent safe:
const cb = self.__BUILD_MANIFEST_CB;
self.__BUILD_MANIFEST_CB = ()=>{
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) {
const scriptUrl = assetPrefix + "/_next/static/chunks/pages" + encodeURI((0, _getAssetPathFromRoute).default(route, ".js"));
return Promise.resolve({
scripts: [
(0, _trustedTypes).__unsafeCreateTrustedScriptURL(scriptUrl)
],
// Styles are handled by `style-loader` in development:
css: []
});
}
return getClientBuildManifest().then((manifest)=>{
if (!(route in manifest)) {
throw markAssetError(new Error(`Failed to lookup route: ${route}`));
}
const allFiles = manifest[route].map((entry)=>assetPrefix + "/_next/" + encodeURI(entry));
return {
scripts: allFiles.filter((v)=>v.endsWith(".js")).map((v)=>(0, _trustedTypes).__unsafeCreateTrustedScriptURL(v)),
css: allFiles.filter((v)=>v.endsWith(".css"))
};
});
}
function createRouteLoader(assetPrefix) {
const entrypoints = new Map();
const loadedScripts = new Map();
const styleSheets = new Map();
const routes = new Map();
function maybeExecuteScript(src) {
// With HMR we might need to "reload" scripts when they are
// disposed and readded. Executing scripts twice has no functional
// differences
if (false) {} else {
return appendScript(src);
}
}
function fetchStyleSheet(href) {
let prom = styleSheets.get(href);
if (prom) {
return prom;
}
styleSheets.set(href, prom = fetch(href).then((res)=>{
if (!res.ok) {
throw new Error(`Failed to load stylesheet: ${href}`);
}
return res.text().then((text)=>({
href: href,
content: text
}));
}).catch((err)=>{
throw markAssetError(err);
}));
return prom;
}
return {
whenEntrypoint (route) {
return withFuture(route, entrypoints);
},
onEntrypoint (route, execute) {
(execute ? Promise.resolve().then(()=>execute()).then((exports1)=>({
component: exports1 && exports1.default || exports1,
exports: exports1
}), (err)=>({
error: err
})) : Promise.resolve(undefined)).then((input)=>{
const old = entrypoints.get(route);
if (old && "resolve" in old) {
if (input) {
entrypoints.set(route, input);
old.resolve(input);
}
} else {
if (input) {
entrypoints.set(route, input);
} else {
entrypoints.delete(route);
}
// when this entrypoint has been resolved before
// the route is outdated and we want to invalidate
// this cache entry
routes.delete(route);
}
});
},
loadRoute (route, prefetch) {
return withFuture(route, routes, ()=>{
let devBuildPromiseResolve;
if (true) {
devBuildPromise = new Promise((resolve)=>{
devBuildPromiseResolve = resolve;
});
}
return resolvePromiseWithTimeout(getFilesForRoute(assetPrefix, route).then(({ scripts , css })=>{
return Promise.all([
entrypoints.has(route) ? [] : Promise.all(scripts.map(maybeExecuteScript)),
Promise.all(css.map(fetchStyleSheet))
]);
}).then((res)=>{
return this.whenEntrypoint(route).then((entrypoint)=>({
entrypoint,
styles: res[1]
}));
}), MS_MAX_IDLE_DELAY, markAssetError(new Error(`Route did not complete loading: ${route}`))).then(({ entrypoint , styles })=>{
const res = Object.assign({
styles: styles
}, entrypoint);
return "error" in entrypoint ? entrypoint : res;
}).catch((err)=>{
if (prefetch) {
// we don't want to cache errors during prefetch
throw err;
}
return {
error: err
};
}).finally(()=>{
return devBuildPromiseResolve == null ? void 0 : devBuildPromiseResolve();
});
});
},
prefetch (route) {
// https://github.com/GoogleChromeLabs/quicklink/blob/453a661fa1fa940e2d2e044452398e38c67a98fb/src/index.mjs#L115-L118
// License: Apache 2.0
let 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((output)=>Promise.all(canPrefetch ? output.scripts.map((script)=>prefetchViaDom(script.toString(), "script")) : [])).then(()=>{
(0, _requestIdleCallback).requestIdleCallback(()=>this.loadRoute(route, true).catch(()=>{}));
}).catch(()=>{});
}
};
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=route-loader.js.map
D<><44><EFBFBD>G<><47><EFBFBD>K<><4B><EFBFBD><03>x<1F>AAAa;AACbA,8CAA6C;IACzCG,OAAO,IAAI;AACf,CAAC,EAAC;AACFD,sBAAsB,GAAGE;AACzBF,oBAAoB,GAAGG;AACvBH,8BAA8B,GAAGI;AACjCJ,yBAAyB,GAAGK;AAC5B,IAAIC,2BAA2BC,mJAA+D;AAC9F,IAAIE,yBAAyBH,yBAAyBC,mBAAOA,CAAC,kHAAsD;AACpH,IAAIG,gBAAgBH,mBAAOA,CAAC,yEAAiB;AAC7C,IAAII,uBAAuBJ,mBAAOA,CAAC,yFAAyB;AAC5D,uEAAuE;AACvE,yEAAyE;AACzE,2EAA2E;AAC3E,oCAAoC;AACpC,MAAMK,oBAAoB;AAC1B,SAASC,WAAWC,GAAG,EAAEC,GAAG,EAAEC,SAAS,EAAE;IACrC,IAAIC,QAAQF,IAAIG,GAAG,CAACJ;IACpB,IAAIG,OAAO;QACP,IAAI,YAAYA,OAAO;YACnB,OAAOA,MAAME,MAAM;QACvB,CAAC;QACD,OAAOC,QAAQC,OAAO,CAACJ;IAC3B,CAAC;IACD,IAAIK;IACJ,MAAMC,OAAO,IAAIH,QAAQ,CAACC,UAAU;QAChCC,WAAWD;IACf;IACAN,IAAIS,GAAG,CAACV,KAAKG,QAAQ;QACjBI,SAASC;QACTH,QAAQI;IACZ;IACA,OAAOP,YAAYA,YAAW,wCAAwC;KACrES,IAAI,CAAC,CAACxB,QAASqB,CAAAA,SAASrB,QAAQA,KAAK,GAAGyB,KAAK,CAAC,CAACC,MAAM;QAClDZ,IAAIa,MAAM,CAACd;QACX,MAAMa,IAAI;IACd,KAAKJ,IAAI;AACb;AACA,MAAMM,mBAAmBC,OAAO;AAChC,SAAS5B,eAAeyB,GAAG,EAAE;IACzB,OAAO7B,OAAOC,cAAc,CAAC4B,KAAKE,kBAAkB,CAAC;AACzD;AACA,SAAS1B,aAAawB,GAAG,EAAE;IACvB,OAAOA,OAAOE,oBAAoBF;AACtC;AACA,SAASI,YAAYC,IAAI,EAAE;IACvB,IAAI;QACAA,OAAOC,SAASC,aAAa,CAAC;QAC9B,OAEA,uBADuB;QACtB,CAAC,CAACC,OAAOC,oBAAoB,IAAI,CAAC,CAACH,SAASI,YAAY,IAAKL,KAAKM,OAAO,CAACC,QAAQ,CAAC;IACxF,EAAE,OAAOC,GAAG;QACR,OAAO,KAAK;IAChB;AACJ;AACA,MAAMC,cAAcV;AACpB,SAASW,eAAeC,IAAI,EAAEC,EAAE,EAAEZ,IAAI,EAAE;IACpC,OAAO,IAAIZ,QAAQ,CAACC,SAASwB,SAAS;QAClC,MAAMC,WAAW,CAAC;kCACQ,EAAEH,KAAK;iCACR,EAAEA,KAAK;mBACrB,EAAEA,KAAK,EAAE,CAAC;QACrB,IAAIV,SAASc,aAAa,CAACD,WAAW;YAClC,OAAOzB;QACX,CAAC;QACDW,OAAOC,SAASC,aAAa,CAAC;QAC9B,wDAAwD;QACxD,IAAIU,IAAIZ,KAAKY,EAAE,GAAGA;QAClBZ,KAAKgB,GAAG,GAAG,CAAC,QAAQ,CAAC;QACrBhB,KAAKiB,WAAW,GAAGC,SAA+B;QAClDlB,KAAKqB,MAAM,GAAGhC;QACdW,KAAKsB,OAAO,GAAG,IAAIT,OAAO3C,eAAe,IAAIqD,MAAM,CAAC,oBAAoB,EAAEZ,KAAK,CAAC;QAChF,gCAAgC;QAChCX,KAAKW,IAAI,GAAGA;QACZV,SAASuB,IAAI,CAACC,WAAW,CAACzB;IAC9B;AACJ;AACA,SAAS0B,aAAaC,GAAG,EAAEC,MAAM,EAAE;IAC/B,OAAO,IAAIxC,QAAQ,CAACC,SAASwB,SAAS;QAClCe,SAAS3B,SAASC,aAAa,CAAC;QAChC,wDAAwD;QACxD,mEAAmE;QACnE,iCAAiC;QACjC0B,OAAOP,MAAM,GAAGhC;QAChBuC,OAAON,OAAO,GAAG,IAAIT,OAAO3C,eAAe,IAAIqD,MAAM,CAAC,uBAAuB,EAAEI,IAAI,CAAC;QACpF,2EAA2E;QAC3E,8BAA8B;QAC9BC,OAAOX,WAAW,GAAGC,SAA+B;QACpD,uEAAuE;QACvE,6CAA6C;QAC7CU,OAAOD,GAAG,GAAGA;QACb1B,SAAS4B,IAAI,CAACJ,WAAW,CAACG;IAC9B;AACJ;AACA,4EAA4E;AAC5E,qEAAqE;AACrE,IAAIE;AACJ,uEAAuE;AACvE,SAASC,0BAA0BC,CAAC,EAAEC,EAAE,EAAEtC,GAAG,EAAE;IAC3C,OAAO,IAAIP,QAAQ,CAACC,SAASwB,SAAS;QAClC,IAAIqB,YAAY,KAAK;QACrBF,EAAEvC,IAAI,CAAC,CAAC0C,IAAI;YACR,+BAA+B;YAC/BD,YAAY,IAAI;YAChB7C,QAAQ8C;QACZ,GAAGzC,KAAK,CAACmB;QACT,sEAAsE;QACtE,sBAAsB;QACtB,IAAIK,IAAyB,EAAe;YACvCY,CAAAA,mBAAmB1C,QAAQC,OAAO,EAAC,EAAGI,IAAI,CAAC,IAAI;gBAC3C,IAAGd,oBAAoB,EAAEyD,mBAAmB,CAAC,IAAIC,WAAW,IAAI;wBACzD,IAAI,CAACH,WAAW;4BACZrB,OAAOlB;wBACX,CAAC;oBACL,GAAGsC;YACX;QACJ,CAAC;QACD,IAAIf,KAAyB,EAAe,EAM3C;IACL;AACJ;AACA,SAAS9C,yBAAyB;IAC9B,IAAIkE,KAAKC,gBAAgB,EAAE;QACvB,OAAOnD,QAAQC,OAAO,CAACiD,KAAKC,gBAAgB;IAChD,CAAC;IACD,MAAMC,kBAAkB,IAAIpD,QAAQ,CAACC,UAAU;QAC3C,iDAAiD;QACjD,MAAMoD,KAAKH,KAAKI,mBAAmB;QACnCJ,KAAKI,mBAAmB,GAAG,IAAI;YAC3BrD,QAAQiD,KAAKC,gBAAgB;YAC7BE,MAAMA;QACV;IACJ;IACA,OAAOV,0BAA0BS,iBAAiB5D,mBAAmBV,eAAe,IAAIqD,MAAM;AAClG;AACA,SAASoB,iBAAiBC,WAAW,EAAEC,KAAK,EAAE;IAC1C,IAAI3B,IAAyB,EAAe;QACxC,MAAM4B,YAAYF,cAAc,+BAA+BG,UAAU,CAAC,GAAGtE,sBAAsB,EAAED,OAAO,CAACqE,OAAO;QACpH,OAAOzD,QAAQC,OAAO,CAAC;YACnB2D,SAAS;gBACJ,IAAGtE,aAAa,EAAEuE,8BAA8B,CAACH;aACrD;YACD,uDAAuD;YACvDI,KAAK,EAAE;QACX;IACJ,CAAC;IACD,OAAO9E,yBAAyBqB,IAAI,CAAC,CAAC0D,WAAW;QAC7C,IAAI,CAAEN,CAAAA,SAASM,QAAO,GAAI;YACtB,MAAMjF,eAAe,IAAIqD,MAAM,CAAC,wBAAwB,EAAEsB,MAAM,CAAC,GAAG;QACxE,CAAC;QACD,MAAMO,WAAWD,QAAQ,CAACN,MAAM,CAAC9D,GAAG,CAAC,CAACE,QAAQ2D,cAAc,YAAYG,UAAU9D;QAClF,OAAO;YACH+D,SAASI,SAASC,MAAM,CAAC,CAACC,IAAIA,EAAEC,QAAQ,CAAC,QAAQxE,GAAG,CAAC,CAACuE,IAAI,CAAC,GAAG5E,aAAa,EAAEuE,8BAA8B,CAACK;YAC5GJ,KAAKE,SAASC,MAAM,CAAC,CAACC,IAAIA,EAAEC,QAAQ,CAAC;QACzC;IACJ;AACJ;AACA,SAASlF,kBAAkBuE,WAAW,EAAE;IACpC,MAAMY,cAAc,IAAIC;IACxB,MAAMC,gBAAgB,IAAID;IAC1B,MAAME,cAAc,IAAIF;IACxB,MAAMG,SAAS,IAAIH;IACnB,SAASI,mBAAmBlC,GAAG,EAAE;QAC7B,2DAA2D;QAC3D,kEAAkE;QAClE,cAAc;QACd,IAAIT,KAAyB,EAAe,EAW3C,MAAM
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.markAssetError = markAssetError;
exports.isAssetError = isAssetError;
exports.getClientBuildManifest = getClientBuildManifest;
exports.createRouteLoader = createRouteLoader;
var _interop_require_default = require("@swc/helpers/lib/_interop_require_default.js").default;
var _getAssetPathFromRoute = _interop_require_default(require("../shared/lib/router/utils/get-asset-path-from-route"));
var _trustedTypes = require("./trusted-types");
var _requestIdleCallback = require("./request-idle-callback");
// 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.
const MS_MAX_IDLE_DELAY = 3800;
function withFuture(key, map, generator) {
let entry = map.get(key);
if (entry) {
if ('future' in entry) {
return entry.future;
}
return Promise.resolve(entry);
}
let resolver;
const prom = new Promise((resolve)=>{
resolver = resolve;
});
map.set(key, entry = {
resolve: resolver,
future: prom
});
return generator ? generator()// eslint-disable-next-line no-sequences
.then((value)=>(resolver(value), value)).catch((err)=>{
map.delete(key);
throw err;
}) : prom;
}
const ASSET_LOAD_ERROR = Symbol('ASSET_LOAD_ERROR');
function markAssetError(err) {
return Object.defineProperty(err, ASSET_LOAD_ERROR, {});
}
function isAssetError(err) {
return err && ASSET_LOAD_ERROR in err;
}
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 (e) {
return false;
}
}
const canPrefetch = hasPrefetch();
function prefetchViaDom(href, as, link) {
return new Promise((resolve, reject)=>{
const selector = `
link[rel="prefetch"][href^="${href}"],
link[rel="preload"][href^="${href}"],
script[src^="${href}"]`;
if (document.querySelector(selector)) {
return resolve();
}
link = document.createElement('link');
// The order of property assignment here is intentional:
if (as) link.as = as;
link.rel = `prefetch`;
link.crossOrigin = process.env.__NEXT_CROSS_ORIGIN;
link.onload = resolve;
link.onerror = ()=>reject(markAssetError(new Error(`Failed to prefetch: ${href}`)));
// `href` should always be last:
link.href = href;
document.head.appendChild(link);
});
}
function appendScript(src, script) {
return new Promise((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 = ()=>reject(markAssetError(new Error(`Failed to load script: ${src}`)));
// 2. Configure the cross-origin attribute before setting `src` in case the
// browser begins to fetch.
script.crossOrigin = process.env.__NEXT_CROSS_ORIGIN;
// 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);
});
}
// We wait for pages to be built in dev before we start the route transition
// timeout to prevent an un-necessary hard navigation in development.
let devBuildPromise;
// Resolve a promise that times out after given amount of milliseconds.
function resolvePromiseWithTimeout(p, ms, err) {
return new Promise((resolve, reject)=>{
let cancelled = false;
p.then((r)=>{
// Resolved, cancel the timeout
cancelled = true;
resolve(r);
}).catch(reject);
// We wrap these checks separately for better dead-code elimination in
// production bundles.
if (process.env.NODE_ENV === 'development') {
(devBuildPromise || Promise.resolve()).then(()=>{
(0, _requestIdleCallback).requestIdleCallback(()=>setTimeout(()=>{
if (!cancelled) {
reject(err);
}
}, ms));
});
}
if (process.env.NODE_ENV !== 'development') {
(0, _requestIdleCallback).requestIdleCallback(()=>setTimeout(()=>{
if (!cancelled) {
reject(err);
}
}, ms));
}
});
}
function getClientBuildManifest() {
if (self.__BUILD_MANIFEST) {
return Promise.resolve(self.__BUILD_MANIFEST);
}
const onBuildManifest = new Promise((resolve)=>{
// Mandatory because this is not concurrent safe:
const cb = self.__BUILD_MANIFEST_CB;
self.__BUILD_MANIFEST_CB = ()=>{
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 (process.env.NODE_ENV === 'development') {
const scriptUrl = assetPrefix + '/_next/static/chunks/pages' + encodeURI((0, _getAssetPathFromRoute).default(route, '.js'));
return Promise.resolve({
scripts: [
(0, _trustedTypes).__unsafeCreateTrustedScriptURL(scriptUrl)
],
// Styles are handled by `style-loader` in development:
css: []
});
}
return getClientBuildManifest().then((manifest)=>{
if (!(route in manifest)) {
throw markAssetError(new Error(`Failed to lookup route: ${route}`));
}
const allFiles = manifest[route].map((entry)=>assetPrefix + '/_next/' + encodeURI(entry));
return {
scripts: allFiles.filter((v)=>v.endsWith('.js')).map((v)=>(0, _trustedTypes).__unsafeCreateTrustedScriptURL(v)),
css: allFiles.filter((v)=>v.endsWith('.css'))
};
});
}
function createRouteLoader(assetPrefix) {
const entrypoints = new Map();
const loadedScripts = new Map();
const styleSheets = new Map();
const routes = new Map();
function maybeExecuteScript(src) {
// With HMR we might need to "reload" scripts when they are
// disposed and readded. Executing scripts twice has no functional
// differences
if (process.env.NODE_ENV !== 'development') {
let prom = loadedScripts.get(src.toString());
if (prom) {
return prom;
}
// Skip executing script if it's already in the DOM:
if (document.querySelector(`script[src^="${src}"]`)) {
return Promise.resolve();
}
loadedScripts.set(src.toString(), prom = appendScript(src));
return prom;
} else {
return appendScript(src);
}
}
function fetchStyleSheet(href) {
let prom = styleSheets.get(href);
if (prom) {
return prom;
}
styleSheets.set(href, prom = fetch(href).then((res)=>{
if (!res.ok) {
throw new Error(`Failed to load stylesheet: ${href}`);
}
return res.text().then((text)=>({
href: href,
content: text
}));
}).catch((err)=>{
throw markAssetError(err);
}));
return prom;
}
return {
whenEntrypoint (route) {
return withFuture(route, entrypoints);
},
onEntrypoint (route, execute) {
(execute ? Promise.resolve().then(()=>execute()).then((exports)=>({
component: exports && exports.default || exports,
exports: exports
}), (err)=>({
error: err
})) : Promise.resolve(undefined)).then((input)=>{
const old = entrypoints.get(route);
if (old && 'resolve' in old) {
if (input) {
entrypoints.set(route, input);
old.resolve(input);
}
} else {
if (input) {
entrypoints.set(route, input);
} else {
entrypoints.delete(route);
}
// when this entrypoint has been resolved before
// the route is outdated and we want to invalidate
// this cache entry
routes.delete(route);
}
});
},
loadRoute (route, prefetch) {
return withFuture(route, routes, ()=>{
let devBuildPromiseResolve;
if (process.env.NODE_ENV === 'development') {
devBuildPromise = new Promise((resolve)=>{
devBuildPromiseResolve = resolve;
});
}
return resolvePromiseWithTimeout(getFilesForRoute(assetPrefix, route).then(({ scripts , css })=>{
return Promise.all([
entrypoints.has(route) ? [] : Promise.all(scripts.map(maybeExecuteScript)),
Promise.all(css.map(fetchStyleSheet)),
]);
}).then((res)=>{
return this.whenEntrypoint(route).then((entrypoint)=>({
entrypoint,
styles: res[1]
}));
}), MS_MAX_IDLE_DELAY, markAssetError(new Error(`Route did not complete loading: ${route}`))).then(({ entrypoint , styles })=>{
const res = Object.assign({
styles: styles
}, entrypoint);
return 'error' in entrypoint ? entrypoint : res;
}).catch((err)=>{
if (prefetch) {
// we don't want to cache errors during prefetch
throw err;
}
return {
error: err
};
}).finally(()=>{
return devBuildPromiseResolve == null ? void 0 : devBuildPromiseResolve();
});
});
},
prefetch (route) {
// https://github.com/GoogleChromeLabs/quicklink/blob/453a661fa1fa940e2d2e044452398e38c67a98fb/src/index.mjs#L115-L118
// License: Apache 2.0
let 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((output)=>Promise.all(canPrefetch ? output.scripts.map((script)=>prefetchViaDom(script.toString(), 'script')) : [])).then(()=>{
(0, _requestIdleCallback).requestIdleCallback(()=>this.loadRoute(route, true).catch(()=>{}));
}).catch(// swallow prefetch errors
()=>{});
}
};
}
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=route-loader.js.map@<40>`<60><><EFBFBD>a<><61><EFBFBD>F<><46><EFBFBD>b<><62><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>c<><63><EFBFBD>G<><47><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD>generator<1F><><EFBFBD><1B><><EFBFBD>j<><6A><EFBFBD>m<><6D><EFBFBD>n<><6E><EFBFBD><EFBFBD>resolver<65>prom"<22><><EFBFBD><16><><EFBFBD><EFBFBD>m<><6D><EFBFBD>n<><6E><EFBFBD>%<25><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>link<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>MSInputMethodContext<78>documentMode<64>relList<73>supports<74>e<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>^<5E><><EFBFBD>_<><5F><EFBFBD><EFBFBD>reject<63>selector<6F>querySelector<6F>rel<65>crossOrigin<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>__NEXT_CROSS_ORIGIN<49>onload<61>onerror<><7F><EFBFBD><EFBFBD>head<61>appendChild<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>body<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>msM<><4D><EFBFBD><EFBFBD>rd<><64><EFBFBD><15><16><><EFBFBD><EFBFBD><EFBFBD>__BUILD_MANIFEST<53>onBuildManifest^<5E><><EFBFBD><EFBFBD>__BUILD_MANIFEST_CB<16><><EFBFBD><EFBFBD><EFBFBD>assetPrefixb<><62><EFBFBD><EFBFBD>scriptUrl<72>encodeURI<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>css<73>manifest<73>allFiles <0C><><EFBFBD><EFBFBD>v<16><><EFBFBD><EFBFBD><EFBFBD>entrypoints<16><><EFBFBD><EFBFBD><EFBFBD>loadedScripts;<3B><><EFBFBD><EFBFBD>routes<65>maybeExecuteScript<16><><EFBFBD><EFBFBD><EFBFBD>fetchStyleSheet<16><><EFBFBD><EFBFBD>H<><48><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>content<6E>whenEntrypoint<6E>onEntrypoint<6E>execute<10><><EFBFBD>o<><6F><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>input<75>old<6C>loadRoute<16><><EFBFBD><EFBFBD><EFBFBD>devBuildPromiseResolve<16><><EFBFBD><EFBFBD>B<><42><EFBFBD><EFBFBD>entrypoint<6E>styles<16><><EFBFBD><EFBFBD><EFBFBD>finally<6C>cnU<><55><EFBFBD><EFBFBD>connection<6F>saveData><3E><><EFBFBD><EFBFBD>effectiveType<70>output<10><><EFBFBD>s<><73><EFBFBD><16><><EFBFBD><EFBFBD><18><><EFBFBD>l<><6C><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <00>v<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/SourceMapSource<10><1F>)"use strict";
"use client";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.handleClientScriptLoad = handleClientScriptLoad;
exports.initScriptLoader = initScriptLoader;
exports.default = void 0;
var _extends = require("@swc/helpers/lib/_extends.js").default;
var _interop_require_default = require("@swc/helpers/lib/_interop_require_default.js").default;
var _interop_require_wildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
var _object_without_properties_loose = require("@swc/helpers/lib/_object_without_properties_loose.js").default;
var _reactDom = _interop_require_default(require("react-dom"));
var _react = _interop_require_wildcard(require("react"));
var _headManagerContext = require("../shared/lib/head-manager-context");
var _headManager = require("./head-manager");
var _requestIdleCallback = require("./request-idle-callback");
const ScriptCache = new Map();
const LoadCache = new Set();
const ignoreProps = [
"onLoad",
"onReady",
"dangerouslySetInnerHTML",
"children",
"onError",
"strategy"
];
const loadScript = (props)=>{
const { src , id , onLoad =()=>{} , onReady =null , dangerouslySetInnerHTML , children ="" , strategy ="afterInteractive" , onError } = props;
const cacheKey = id || src;
// Script has already loaded
if (cacheKey && LoadCache.has(cacheKey)) {
return;
}
// Contents of this script are already loading/loaded
if (ScriptCache.has(src)) {
LoadCache.add(cacheKey);
// It is possible that multiple `next/script` components all have same "src", but has different "onLoad"
// This is to make sure the same remote script will only load once, but "onLoad" are executed in order
ScriptCache.get(src).then(onLoad, onError);
return;
}
/** Execute after the script first loaded */ const afterLoad = ()=>{
// Run onReady for the first time after load event
if (onReady) {
onReady();
}
// add cacheKey to LoadCache when load successfully
LoadCache.add(cacheKey);
};
const el = document.createElement("script");
const loadPromise = new Promise((resolve, reject)=>{
el.addEventListener("load", function(e) {
resolve();
if (onLoad) {
onLoad.call(this, e);
}
afterLoad();
});
el.addEventListener("error", function(e) {
reject(e);
});
}).catch(function(e) {
if (onError) {
onError(e);
}
});
if (dangerouslySetInnerHTML) {
el.innerHTML = dangerouslySetInnerHTML.__html || "";
afterLoad();
} else if (children) {
el.textContent = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : "";
afterLoad();
} else if (src) {
el.src = src;
// do not add cacheKey into LoadCache for remote script here
// cacheKey will be added to LoadCache when it is actually loaded (see loadPromise above)
ScriptCache.set(src, loadPromise);
}
for (const [k, value] of Object.entries(props)){
if (value === undefined || ignoreProps.includes(k)) {
continue;
}
const attr = _headManager.DOMAttributeNames[k] || k.toLowerCase();
el.setAttribute(attr, value);
}
if (strategy === "worker") {
el.setAttribute("type", "text/partytown");
}
el.setAttribute("data-nscript", strategy);
document.body.appendChild(el);
};
function handleClientScriptLoad(props) {
const { strategy ="afterInteractive" } = props;
if (strategy === "lazyOnload") {
window.addEventListener("load", ()=>{
(0, _requestIdleCallback).requestIdleCallback(()=>loadScript(props));
});
} else {
loadScript(props);
}
}
function loadLazyScript(props) {
if (document.readyState === "complete") {
(0, _requestIdleCallback).requestIdleCallback(()=>loadScript(props));
} else {
window.addEventListener("load", ()=>{
(0, _requestIdleCallback).requestIdleCallback(()=>loadScript(props));
});
}
}
function addBeforeInteractiveToCache() {
const scripts = [
...document.querySelectorAll('[data-nscript="beforeInteractive"]'),
...document.querySelectorAll('[data-nscript="beforePageRender"]')
];
scripts.forEach((script)=>{
const cacheKey = script.id || script.getAttribute("src");
LoadCache.add(cacheKey);
});
}
function initScriptLoader(scriptLoaderItems) {
scriptLoaderItems.forEach(handleClientScriptLoad);
addBeforeInteractiveToCache();
}
function Script(props) {
const { id , src ="" , onLoad =()=>{} , onReady =null , strategy ="afterInteractive" , onError } = props, restProps = _object_without_properties_loose(props, [
"id",
"src",
"onLoad",
"onReady",
"strategy",
"onError"
]);
// Context is available only during SSR
const { updateScripts , scripts , getIsSsr , appDir , nonce } = (0, _react).useContext(_headManagerContext.HeadManagerContext);
/**
* - First mount:
* 1. The useEffect for onReady executes
* 2. hasOnReadyEffectCalled.current is false, but the script hasn't loaded yet (not in LoadCache)
* onReady is skipped, set hasOnReadyEffectCalled.current to true
* 3. The useEffect for loadScript executes
* 4. hasLoadScriptEffectCalled.current is false, loadScript executes
* Once the script is loaded, the onLoad and onReady will be called by then
* [If strict mode is enabled / is wrapped in <OffScreen /> component]
* 5. The useEffect for onReady executes again
* 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped
* 7. The useEffect for loadScript executes again
* 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped
*
* - Second mount:
* 1. The useEffect for onReady executes
* 2. hasOnReadyEffectCalled.current is false, but the script has already loaded (found in LoadCache)
* onReady is called, set hasOnReadyEffectCalled.current to true
* 3. The useEffect for loadScript executes
* 4. The script is already loaded, loadScript bails out
* [If strict mode is enabled / is wrapped in <OffScreen /> component]
* 5. The useEffect for onReady executes again
* 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped
* 7. The useEffect for loadScript executes again
* 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped
*/ const hasOnReadyEffectCalled = (0, _react).useRef(false);
(0, _react).useEffect(()=>{
const cacheKey = id || src;
if (!hasOnReadyEffectCalled.current) {
// Run onReady if script has loaded before but component is re-mounted
if (onReady && cacheKey && LoadCache.has(cacheKey)) {
onReady();
}
hasOnReadyEffectCalled.current = true;
}
}, [
onReady,
id,
src
]);
const hasLoadScriptEffectCalled = (0, _react).useRef(false);
(0, _react).useEffect(()=>{
if (!hasLoadScriptEffectCalled.current) {
if (strategy === "afterInteractive") {
loadScript(props);
} else if (strategy === "lazyOnload") {
loadLazyScript(props);
}
hasLoadScriptEffectCalled.current = true;
}
}, [
props,
strategy
]);
if (strategy === "beforeInteractive" || strategy === "worker") {
if (updateScripts) {
scripts[strategy] = (scripts[strategy] || []).concat([
_extends({
id,
src,
onLoad,
onReady,
onError
}, restProps)
]);
updateScripts(scripts);
} else if (getIsSsr && getIsSsr()) {
// Script has already loaded during SSR
LoadCache.add(id || src);
} else if (getIsSsr && !getIsSsr()) {
loadScript(props);
}
}
// For the app directory, we need React Float to preload these scripts.
if (appDir) {
// Before interactive scripts need to be loaded by Next.js' runtime instead
// of native <script> tags, because they no longer have `defer`.
if (strategy === "beforeInteractive") {
if (!src) {
// For inlined scripts, we put the content in `children`.
if (restProps.dangerouslySetInnerHTML) {
restProps.children = restProps.dangerouslySetInnerHTML.__html;
delete restProps.dangerouslySetInnerHTML;
}
return /*#__PURE__*/ _react.default.createElement("script", {
nonce: nonce,
dangerouslySetInnerHTML: {
__html: `(self.__next_s=self.__next_s||[]).push(${JSON.stringify([
0,
_extends({}, restProps)
])})`
}
});
}
// @ts-ignore
_reactDom.default.preload(src, restProps.integrity ? {
as: "script",
integrity: restProps.integrity
} : {
as: "script"
});
return /*#__PURE__*/ _react.default.createElement("script", {
nonce: nonce,
dangerouslySetInnerHTML: {
__html: `(self.__next_s=self.__next_s||[]).push(${JSON.stringify([
src
])})`
}
});
} else if (strategy === "afterInteractive") {
if (src) {
// @ts-ignore
_reactDom.default.preload(src, restProps.integrity ? {
as: "script",
integrity: restProps.integrity
} : {
as: "script"
});
}
}
}
return null;
}
Object.defineProperty(Script, "__nextScript", {
value: true
});
var _default = Script;
exports.default = _default;
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=script.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/script.js<1F>F{"version":3,"sources":["webpack://./node_modules/next/dist/client/script.js"],"sourcesContent":["\"use client\";\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.handleClientScriptLoad = handleClientScriptLoad;\nexports.initScriptLoader = initScriptLoader;\nexports.default = void 0;\nvar _extends = require(\"@swc/helpers/lib/_extends.js\").default;\nvar _interop_require_default = require(\"@swc/helpers/lib/_interop_require_default.js\").default;\nvar _interop_require_wildcard = require(\"@swc/helpers/lib/_interop_require_wildcard.js\").default;\nvar _object_without_properties_loose = require(\"@swc/helpers/lib/_object_without_properties_loose.js\").default;\nvar _reactDom = _interop_require_default(require(\"react-dom\"));\nvar _react = _interop_require_wildcard(require(\"react\"));\nvar _headManagerContext = require(\"../shared/lib/head-manager-context\");\nvar _headManager = require(\"./head-manager\");\nvar _requestIdleCallback = require(\"./request-idle-callback\");\n\nconst ScriptCache = new Map();\nconst LoadCache = new Set();\nconst ignoreProps = [\n 'onLoad',\n 'onReady',\n 'dangerouslySetInnerHTML',\n 'children',\n 'onError',\n 'strategy', \n];\nconst loadScript = (props)=>{\n const { src , id , onLoad =()=>{} , onReady =null , dangerouslySetInnerHTML , children ='' , strategy ='afterInteractive' , onError , } = props;\n const cacheKey = id || src;\n // Script has already loaded\n if (cacheKey && LoadCache.has(cacheKey)) {\n return;\n }\n // Contents of this script are already loading/loaded\n if (ScriptCache.has(src)) {\n LoadCache.add(cacheKey);\n // It is possible that multiple `next/script` components all have same \"src\", but has different \"onLoad\"\n // This is to make sure the same remote script will only load once, but \"onLoad\" are executed in order\n ScriptCache.get(src).then(onLoad, onError);\n return;\n }\n /** Execute after the script first loaded */ const afterLoad = ()=>{\n // Run onReady for the first time after load event\n if (onReady) {\n onReady();\n }\n // add cacheKey to LoadCache when load successfully\n LoadCache.add(cacheKey);\n };\n const el = document.createElement('script');\n const loadPromise = new Promise((resolve, reject)=>{\n el.addEventListener('load', function(e) {\n resolve();\n if (onLoad) {\n onLoad.call(this, e);\n }\n afterLoad();\n });\n el.addEventListener('error', function(e) {\n reject(e);\n });\n }).catch(function(e) {\n if (onError) {\n onError(e);\n }\n });\n if (dangerouslySetInnerHTML) {\n el.innerHTML = dangerouslySetInnerHTML.__html || '';\n afterLoad();\n } else if (children) {\n el.textContent = typeof children === 'string' ? children : Array.isArray(children) ? children.join('') : '';\n afterLoad();\n } else if (src) {\n el.src = src;\n // do not add cacheKey into LoadCache for remote script here\n // cacheKey will be added to LoadCache when it is actually loaded (see loadPromise above)\n ScriptCache.set(src, loadPromise);\n }\n for (const [k, value] of Object.entries(props)){\n if (value === undefined || ignoreProps.includes(k)) {\n continue;\n }\n const attr = _headManager.DOMAttributeNames[k] || k.toLowerCase();\n el.setAttribute(attr, value);\n }\n if (strategy === 'worker') {\n el.setAttribute('type', 'text/partytown');\n }\n el.setAttribute('data-nscript', strategy);\n document.body.appendChild(el);\n};\nfunction handleClientScriptLoad(props) {\n const { strategy ='afterInteractive' } = props;\n if (strategy === 'lazyOnload') {\n wi
"use client";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.handleClientScriptLoad = handleClientScriptLoad;
exports.initScriptLoader = initScriptLoader;
exports["default"] = void 0;
var _extends = (__webpack_require__(/*! @swc/helpers/lib/_extends.js */ "./node_modules/@swc/helpers/lib/_extends.js")["default"]);
var _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ "./node_modules/@swc/helpers/lib/_interop_require_default.js")["default"]);
var _interop_require_wildcard = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_wildcard.js */ "./node_modules/@swc/helpers/lib/_interop_require_wildcard.js")["default"]);
var _object_without_properties_loose = (__webpack_require__(/*! @swc/helpers/lib/_object_without_properties_loose.js */ "./node_modules/@swc/helpers/lib/_object_without_properties_loose.js")["default"]);
var _reactDom = _interop_require_default(__webpack_require__(/*! react-dom */ "react-dom"));
var _react = _interop_require_wildcard(__webpack_require__(/*! react */ "react"));
var _headManagerContext = __webpack_require__(/*! ../shared/lib/head-manager-context */ "./head-manager-context");
var _headManager = __webpack_require__(/*! ./head-manager */ "./node_modules/next/dist/client/head-manager.js");
var _requestIdleCallback = __webpack_require__(/*! ./request-idle-callback */ "./node_modules/next/dist/client/request-idle-callback.js");
const ScriptCache = new Map();
const LoadCache = new Set();
const ignoreProps = [
"onLoad",
"onReady",
"dangerouslySetInnerHTML",
"children",
"onError",
"strategy"
];
const loadScript = (props)=>{
const { src , id , onLoad =()=>{} , onReady =null , dangerouslySetInnerHTML , children ="" , strategy ="afterInteractive" , onError } = props;
const cacheKey = id || src;
// Script has already loaded
if (cacheKey && LoadCache.has(cacheKey)) {
return;
}
// Contents of this script are already loading/loaded
if (ScriptCache.has(src)) {
LoadCache.add(cacheKey);
// It is possible that multiple `next/script` components all have same "src", but has different "onLoad"
// This is to make sure the same remote script will only load once, but "onLoad" are executed in order
ScriptCache.get(src).then(onLoad, onError);
return;
}
/** Execute after the script first loaded */ const afterLoad = ()=>{
// Run onReady for the first time after load event
if (onReady) {
onReady();
}
// add cacheKey to LoadCache when load successfully
LoadCache.add(cacheKey);
};
const el = document.createElement("script");
const loadPromise = new Promise((resolve, reject)=>{
el.addEventListener("load", function(e) {
resolve();
if (onLoad) {
onLoad.call(this, e);
}
afterLoad();
});
el.addEventListener("error", function(e) {
reject(e);
});
}).catch(function(e) {
if (onError) {
onError(e);
}
});
if (dangerouslySetInnerHTML) {
el.innerHTML = dangerouslySetInnerHTML.__html || "";
afterLoad();
} else if (children) {
el.textContent = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : "";
afterLoad();
} else if (src) {
el.src = src;
// do not add cacheKey into LoadCache for remote script here
// cacheKey will be added to LoadCache when it is actually loaded (see loadPromise above)
ScriptCache.set(src, loadPromise);
}
for (const [k, value] of Object.entries(props)){
if (value === undefined || ignoreProps.includes(k)) {
continue;
}
const attr = _headManager.DOMAttributeNames[k] || k.toLowerCase();
el.setAttribute(attr, value);
}
if (strategy === "worker") {
el.setAttribute("type", "text/partytown");
}
el.setAttribute("data-nscript", strategy);
document.body.appendChild(el);
};
function handleClientScriptLoad(props) {
const { strategy ="afterInteractive" } = props;
if (strategy === "lazyOnload") {
window.addEventListener("load", ()=>{
(0, _requestIdleCallback).requestIdleCallback(()=>loadScript(props));
});
} else {
loadScript(props);
}
}
function loadLazyScript(props) {
if (document.readyState === "complete") {
(0, _requestIdleCallback).requestIdleCallback(()=>loadScript(props));
} else {
window.addEventListener("load", ()=>{
(0, _requestIdleCallback).requestIdleCallback(()=>loadScript(props));
});
}
}
function addBeforeInteractiveToCache() {
const scripts = [
...document.querySelectorAll('[data-nscript="beforeInteractive"]'),
...document.querySelectorAll('[data-nscript="beforePageRender"]')
];
scripts.forEach((script)=>{
const cacheKey = script.id || script.getAttribute("src");
LoadCache.add(cacheKey);
});
}
function initScriptLoader(scriptLoaderItems) {
scriptLoaderItems.forEach(handleClientScriptLoad);
addBeforeInteractiveToCache();
}
function Script(props) {
const { id , src ="" , onLoad =()=>{} , onReady =null , strategy ="afterInteractive" , onError } = props, restProps = _object_without_properties_loose(props, [
"id",
"src",
"onLoad",
"onReady",
"strategy",
"onError"
]);
// Context is available only during SSR
const { updateScripts , scripts , getIsSsr , appDir , nonce } = (0, _react).useContext(_headManagerContext.HeadManagerContext);
/**
* - First mount:
* 1. The useEffect for onReady executes
* 2. hasOnReadyEffectCalled.current is false, but the script hasn't loaded yet (not in LoadCache)
* onReady is skipped, set hasOnReadyEffectCalled.current to true
* 3. The useEffect for loadScript executes
* 4. hasLoadScriptEffectCalled.current is false, loadScript executes
* Once the script is loaded, the onLoad and onReady will be called by then
* [If strict mode is enabled / is wrapped in <OffScreen /> component]
* 5. The useEffect for onReady executes again
* 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped
* 7. The useEffect for loadScript executes again
* 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped
*
* - Second mount:
* 1. The useEffect for onReady executes
* 2. hasOnReadyEffectCalled.current is false, but the script has already loaded (found in LoadCache)
* onReady is called, set hasOnReadyEffectCalled.current to true
* 3. The useEffect for loadScript executes
* 4. The script is already loaded, loadScript bails out
* [If strict mode is enabled / is wrapped in <OffScreen /> component]
* 5. The useEffect for onReady executes again
* 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped
* 7. The useEffect for loadScript executes again
* 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped
*/ const hasOnReadyEffectCalled = (0, _react).useRef(false);
(0, _react).useEffect(()=>{
const cacheKey = id || src;
if (!hasOnReadyEffectCalled.current) {
// Run onReady if script has loaded before but component is re-mounted
if (onReady && cacheKey && LoadCache.has(cacheKey)) {
onReady();
}
hasOnReadyEffectCalled.current = true;
}
}, [
onReady,
id,
src
]);
const hasLoadScriptEffectCalled = (0, _react).useRef(false);
(0, _react).useEffect(()=>{
if (!hasLoadScriptEffectCalled.current) {
if (strategy === "afterInteractive") {
loadScript(props);
} else if (strategy === "lazyOnload") {
loadLazyScript(props);
}
hasLoadScriptEffectCalled.current = true;
}
}, [
props,
strategy
]);
if (strategy === "beforeInteractive" || strategy === "worker") {
if (updateScripts) {
scripts[strategy] = (scripts[strategy] || []).concat([
_extends({
id,
src,
onLoad,
onReady,
onError
}, restProps)
]);
updateScripts(scripts);
} else if (getIsSsr && getIsSsr()) {
// Script has already loaded during SSR
LoadCache.add(id || src);
} else if (getIsSsr && !getIsSsr()) {
loadScript(props);
}
}
// For the app directory, we need React Float to preload these scripts.
if (appDir) {
// Before interactive scripts need to be loaded by Next.js' runtime instead
// of native <script> tags, because they no longer have `defer`.
if (strategy === "beforeInteractive") {
if (!src) {
// For inlined scripts, we put the content in `children`.
if (restProps.dangerouslySetInnerHTML) {
restProps.children = restProps.dangerouslySetInnerHTML.__html;
delete restProps.dangerouslySetInnerHTML;
}
return /*#__PURE__*/ _react.default.createElement("script", {
nonce: nonce,
dangerouslySetInnerHTML: {
__html: `(self.__next_s=self.__next_s||[]).push(${JSON.stringify([
0,
_extends({}, restProps)
])})`
}
});
}
// @ts-ignore
_reactDom.default.preload(src, restProps.integrity ? {
as: "script",
integrity: restProps.integrity
} : {
as: "script"
});
return /*#__PURE__*/ _react.default.createElement("script", {
nonce: nonce,
dangerouslySetInnerHTML: {
__html: `(self.__next_s=self.__next_s||[]).push(${JSON.stringify([
src
])})`
}
});
} else if (strategy === "afterInteractive") {
if (src) {
// @ts-ignore
_reactDom.default.preload(src, restProps.integrity ? {
as: "script",
integrity: restProps.integrity
} : {
as: "script"
});
}
}
}
return null;
}
Object.defineProperty(Script, "__nextScript", {
value: true
});
var _default = Script;
exports["default"] = _default;
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=script.js.map
<03><><EFBFBD><06><><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><03>x<1F>AACa;AADb;AAEAA,8CAA6C;IACzCG,OAAO,IAAI;AACf,CAAC,EAAC;AACFD,8BAA8B,GAAGE;AACjCF,wBAAwB,GAAGG;AAC3BH,kBAAe,GAAG,KAAK;AACvB,IAAIK,WAAWC,mHAA+C;AAC9D,IAAIC,2BAA2BD,mJAA+D;AAC9F,IAAIE,4BAA4BF,qJAAgE;AAChG,IAAIG,mCAAmCH,mKAAuE;AAC9G,IAAII,YAAYH,yBAAyBD,mBAAOA,CAAC,4BAAW;AAC5D,IAAIK,SAASH,0BAA0BF,mBAAOA,CAAC,oBAAO;AACtD,IAAIM,sBAAsBN,mBAAOA,CAAC,kEAAoC;AACtE,IAAIO,eAAeP,mBAAOA,CAAC,uEAAgB;AAC3C,IAAIQ,uBAAuBR,mBAAOA,CAAC,yFAAyB;AAE5D,MAAMS,cAAc,IAAIC;AACxB,MAAMC,YAAY,IAAIC;AACtB,MAAMC,cAAc;IAChB;IACA;IACA;IACA;IACA;IACA;CACH;AACD,MAAMC,aAAa,CAACC,QAAQ;IACxB,MAAM,EAAEC,IAAG,EAAGC,GAAE,EAAGC,QAAQ,IAAI,CAAC,EAAC,EAAGC,SAAS,IAAI,GAAGC,wBAAuB,EAAGC,UAAU,GAAE,EAAGC,UAAU,mBAAkB,EAAGC,QAAO,EAAK,GAAGR;IAC3I,MAAMS,WAAWP,MAAMD;IACvB,4BAA4B;IAC5B,IAAIQ,YAAYb,UAAUc,GAAG,CAACD,WAAW;QACrC;IACJ,CAAC;IACD,qDAAqD;IACrD,IAAIf,YAAYgB,GAAG,CAACT,MAAM;QACtBL,UAAUe,GAAG,CAACF;QACd,wGAAwG;QACxG,sGAAsG;QACtGf,YAAYkB,GAAG,CAACX,KAAKY,IAAI,CAACV,QAAQK;QAClC;IACJ,CAAC;IACD,0CAA0C,GAAG,MAAMM,YAAY,IAAI;QAC/D,kDAAkD;QAClD,IAAIV,SAAS;YACTA;QACJ,CAAC;QACD,mDAAmD;QACnDR,UAAUe,GAAG,CAACF;IAClB;IACA,MAAMM,KAAKC,SAASC,aAAa,CAAC;IAClC,MAAMC,cAAc,IAAIC,QAAQ,CAACC,SAASC,SAAS;QAC/CN,GAAGO,gBAAgB,CAAC,QAAQ,SAASC,CAAC,EAAE;YACpCH;YACA,IAAIjB,QAAQ;gBACRA,OAAOqB,IAAI,CAAC,IAAI,EAAED;YACtB,CAAC;YACDT;QACJ;QACAC,GAAGO,gBAAgB,CAAC,SAAS,SAASC,CAAC,EAAE;YACrCF,OAAOE;QACX;IACJ,GAAGE,KAAK,CAAC,SAASF,CAAC,EAAE;QACjB,IAAIf,SAAS;YACTA,QAAQe;QACZ,CAAC;IACL;IACA,IAAIlB,yBAAyB;QACzBU,GAAGW,SAAS,GAAGrB,wBAAwBsB,MAAM,IAAI;QACjDb;IACJ,OAAO,IAAIR,UAAU;QACjBS,GAAGa,WAAW,GAAG,OAAOtB,aAAa,WAAWA,WAAWuB,MAAMC,OAAO,CAACxB,YAAYA,SAASyB,IAAI,CAAC,MAAM,EAAE;QAC3GjB;IACJ,OAAO,IAAIb,KAAK;QACZc,GAAGd,GAAG,GAAGA;QACT,4DAA4D;QAC5D,yFAAyF;QACzFP,YAAYsC,GAAG,CAAC/B,KAAKiB;IACzB,CAAC;IACD,KAAK,MAAM,CAACe,GAAGrD,MAAM,IAAIH,OAAOyD,OAAO,CAAClC,OAAO;QAC3C,IAAIpB,UAAUuD,aAAarC,YAAYsC,QAAQ,CAACH,IAAI;YAChD,QAAS;QACb,CAAC;QACD,MAAMI,OAAO7C,aAAa8C,iBAAiB,CAACL,EAAE,IAAIA,EAAEM,WAAW;QAC/DxB,GAAGyB,YAAY,CAACH,MAAMzD;IAC1B;IACA,IAAI2B,aAAa,UAAU;QACvBQ,GAAGyB,YAAY,CAAC,QAAQ;IAC5B,CAAC;IACDzB,GAAGyB,YAAY,CAAC,gBAAgBjC;IAChCS,SAASyB,IAAI,CAACC,WAAW,CAAC3B;AAC9B;AACA,SAASlC,uBAAuBmB,KAAK,EAAE;IACnC,MAAM,EAAEO,UAAU,mBAAkB,EAAG,GAAGP;IAC1C,IAAIO,aAAa,cAAc;QAC3BoC,OAAOrB,gBAAgB,CAAC,QAAQ,IAAI;YAC/B,IAAG7B,oBAAoB,EAAEmD,mBAAmB,CAAC,IAAI7C,WAAWC;QACjE;IACJ,OAAO;QACHD,WAAWC;IACf,CAAC;AACL;AACA,SAAS6C,eAAe7C,KAAK,EAAE;IAC3B,IAAIgB,SAAS8B,UAAU,KAAK,YAAY;QACnC,IAAGrD,oBAAoB,EAAEmD,mBAAmB,CAAC,IAAI7C,WAAWC;IACjE,OAAO;QACH2C,OAAOrB,gBAAgB,CAAC,QAAQ,IAAI;YAC/B,IAAG7B,oBAAoB,EAAEmD,mBAAmB,CAAC,IAAI7C,WAAWC;QACjE;IACJ,CAAC;AACL;AACA,SAAS+C,8BAA8B;IACnC,MAAMC,UAAU;WACThC,SAASiC,gBAAgB,CAAC;WAC1BjC,SAASiC,gBAAgB,CAAC;KAChC;IACDD,QAAQE,OAAO,CAAC,CAACC,SAAS;QACtB,MAAM1C,WAAW0C,OAAOjD,EAAE,IAAIiD,OAAOC,YAAY,CAAC;QAClDxD,UAAUe,GAAG,CAACF;IAClB;AACJ;AACA,SAAS3B,iBAAiBuE,iBAAiB,EAAE;IACzCA,kBAAkBH,OAAO,CAACrE;IAC1BkE;AACJ;AACA,SAASO,OAAOtD,KAAK,EAAE;IACnB,MAAM,EAAEE,GAAE,EAAGD,KAAK,GAAE,EAAGE,QAAQ,IAAI,CAAC,EAAC,EAAGC,SAAS,IAAI,GAAGG,UAAU,mBAAkB,EAAGC,QAAO,EAAG,GAAGR,OAAOuD,YAAYnE,iCAAiCY,OAAO;QAC3J;QACA;QACA;QACA;QACA;QACA;KACH;IACD,uCAAuC;IACvC,MAAM,EAAEwD,cAAa,EAAGR,QAAO,EAAGS,SAAQ,EAAGC,OAAM,EAAGC,MAAK,EAAG,GAAG,CAAC,GAAGrE,MAAM,EAAEsE,UAAU,CAACrE,oBAAoBsE,kBAAkB;IAC9H;;;;;;;;;;;;;;;;;;;;;;;;;GAyBD,GAAG,MAAMC,yBAAyB,CAAC,GAAGxE,MAAM,EAAEyE,MAAM,CAAC,KAAK;IACxD,IAAGzE,MAAM,EAAE0E,SAAS,CAAC,IAAI;QACtB,MAAMvD,WAAWP,MAAMD;QACvB,IAAI,CAAC6D,uBAAuBG,OAAO,EAAE;YACjC,sEAAsE;YACtE,IAAI7D,WAAWK,YAAYb,UAAUc,GAAG,CAACD,WAAW;gBAChDL;YACJ,CAAC;YACD0D,uBAAuBG,OAAO,GAAG,IAAI;QACzC,CAAC;IACL,GAAG;QACC7D;QACAF;QACAD;KACH;IACD,MAAMiE,4BAA4B,CAAC,GAAG5E,MAAM,EAAEyE,MAAM,CAAC,KAAK;IACzD,IAAGzE,MAAM,EAAE0E,SAAS,CAAC,IAAI;QACtB,IAAI,CAACE,0BAA0BD,OAAO,EAAE;YACpC,IAAI1D,aAAa,oBAAoB;gBACjCR,WAAWC;YACf,OAAO,IAAIO,aAAa,cAAc;gBAClCsC,eAAe7C;YACnB,CAAC;YACDkE,0BAA0BD,OAAO,GAAG,IAAI;QAC5C,CAAC;IACL,GAAG;QACCjE;QACAO;KACH;IACD,IAAIA,aAAa,uBAAuBA,aAAa,UAAU;QAC3D,IAAIiD,eAAe;YACfR,OAAO,CAACzC,SAAS,GAAG,CAACyC,OAAO,CAACzC,SAAS,IAAI,EAAE,EAAE4D,MAAM,CAAC;gBACjDnF,SAAS;oBACLkB;oBACAD;oBACAE;oBACAC;oBACAI;gBACJ,GAAG+C;aACN;YACDC,cAAcR;QAClB,OAAO,IAAIS,YAAYA,YAA
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.handleClientScriptLoad = handleClientScriptLoad;
exports.initScriptLoader = initScriptLoader;
exports.default = void 0;
var _extends = require("@swc/helpers/lib/_extends.js").default;
var _interop_require_default = require("@swc/helpers/lib/_interop_require_default.js").default;
var _interop_require_wildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
var _object_without_properties_loose = require("@swc/helpers/lib/_object_without_properties_loose.js").default;
var _reactDom = _interop_require_default(require("react-dom"));
var _react = _interop_require_wildcard(require("react"));
var _headManagerContext = require("../shared/lib/head-manager-context");
var _headManager = require("./head-manager");
var _requestIdleCallback = require("./request-idle-callback");
const ScriptCache = new Map();
const LoadCache = new Set();
const ignoreProps = [
'onLoad',
'onReady',
'dangerouslySetInnerHTML',
'children',
'onError',
'strategy',
];
const loadScript = (props)=>{
const { src , id , onLoad =()=>{} , onReady =null , dangerouslySetInnerHTML , children ='' , strategy ='afterInteractive' , onError , } = props;
const cacheKey = id || src;
// Script has already loaded
if (cacheKey && LoadCache.has(cacheKey)) {
return;
}
// Contents of this script are already loading/loaded
if (ScriptCache.has(src)) {
LoadCache.add(cacheKey);
// It is possible that multiple `next/script` components all have same "src", but has different "onLoad"
// This is to make sure the same remote script will only load once, but "onLoad" are executed in order
ScriptCache.get(src).then(onLoad, onError);
return;
}
/** Execute after the script first loaded */ const afterLoad = ()=>{
// Run onReady for the first time after load event
if (onReady) {
onReady();
}
// add cacheKey to LoadCache when load successfully
LoadCache.add(cacheKey);
};
const el = document.createElement('script');
const loadPromise = new Promise((resolve, reject)=>{
el.addEventListener('load', function(e) {
resolve();
if (onLoad) {
onLoad.call(this, e);
}
afterLoad();
});
el.addEventListener('error', function(e) {
reject(e);
});
}).catch(function(e) {
if (onError) {
onError(e);
}
});
if (dangerouslySetInnerHTML) {
el.innerHTML = dangerouslySetInnerHTML.__html || '';
afterLoad();
} else if (children) {
el.textContent = typeof children === 'string' ? children : Array.isArray(children) ? children.join('') : '';
afterLoad();
} else if (src) {
el.src = src;
// do not add cacheKey into LoadCache for remote script here
// cacheKey will be added to LoadCache when it is actually loaded (see loadPromise above)
ScriptCache.set(src, loadPromise);
}
for (const [k, value] of Object.entries(props)){
if (value === undefined || ignoreProps.includes(k)) {
continue;
}
const attr = _headManager.DOMAttributeNames[k] || k.toLowerCase();
el.setAttribute(attr, value);
}
if (strategy === 'worker') {
el.setAttribute('type', 'text/partytown');
}
el.setAttribute('data-nscript', strategy);
document.body.appendChild(el);
};
function handleClientScriptLoad(props) {
const { strategy ='afterInteractive' } = props;
if (strategy === 'lazyOnload') {
window.addEventListener('load', ()=>{
(0, _requestIdleCallback).requestIdleCallback(()=>loadScript(props));
});
} else {
loadScript(props);
}
}
function loadLazyScript(props) {
if (document.readyState === 'complete') {
(0, _requestIdleCallback).requestIdleCallback(()=>loadScript(props));
} else {
window.addEventListener('load', ()=>{
(0, _requestIdleCallback).requestIdleCallback(()=>loadScript(props));
});
}
}
function addBeforeInteractiveToCache() {
const scripts = [
...document.querySelectorAll('[data-nscript="beforeInteractive"]'),
...document.querySelectorAll('[data-nscript="beforePageRender"]'),
];
scripts.forEach((script)=>{
const cacheKey = script.id || script.getAttribute('src');
LoadCache.add(cacheKey);
});
}
function initScriptLoader(scriptLoaderItems) {
scriptLoaderItems.forEach(handleClientScriptLoad);
addBeforeInteractiveToCache();
}
function Script(props) {
const { id , src ='' , onLoad =()=>{} , onReady =null , strategy ='afterInteractive' , onError } = props, restProps = _object_without_properties_loose(props, [
"id",
"src",
"onLoad",
"onReady",
"strategy",
"onError"
]);
// Context is available only during SSR
const { updateScripts , scripts , getIsSsr , appDir , nonce } = (0, _react).useContext(_headManagerContext.HeadManagerContext);
/**
* - First mount:
* 1. The useEffect for onReady executes
* 2. hasOnReadyEffectCalled.current is false, but the script hasn't loaded yet (not in LoadCache)
* onReady is skipped, set hasOnReadyEffectCalled.current to true
* 3. The useEffect for loadScript executes
* 4. hasLoadScriptEffectCalled.current is false, loadScript executes
* Once the script is loaded, the onLoad and onReady will be called by then
* [If strict mode is enabled / is wrapped in <OffScreen /> component]
* 5. The useEffect for onReady executes again
* 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped
* 7. The useEffect for loadScript executes again
* 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped
*
* - Second mount:
* 1. The useEffect for onReady executes
* 2. hasOnReadyEffectCalled.current is false, but the script has already loaded (found in LoadCache)
* onReady is called, set hasOnReadyEffectCalled.current to true
* 3. The useEffect for loadScript executes
* 4. The script is already loaded, loadScript bails out
* [If strict mode is enabled / is wrapped in <OffScreen /> component]
* 5. The useEffect for onReady executes again
* 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped
* 7. The useEffect for loadScript executes again
* 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped
*/ const hasOnReadyEffectCalled = (0, _react).useRef(false);
(0, _react).useEffect(()=>{
const cacheKey = id || src;
if (!hasOnReadyEffectCalled.current) {
// Run onReady if script has loaded before but component is re-mounted
if (onReady && cacheKey && LoadCache.has(cacheKey)) {
onReady();
}
hasOnReadyEffectCalled.current = true;
}
}, [
onReady,
id,
src
]);
const hasLoadScriptEffectCalled = (0, _react).useRef(false);
(0, _react).useEffect(()=>{
if (!hasLoadScriptEffectCalled.current) {
if (strategy === 'afterInteractive') {
loadScript(props);
} else if (strategy === 'lazyOnload') {
loadLazyScript(props);
}
hasLoadScriptEffectCalled.current = true;
}
}, [
props,
strategy
]);
if (strategy === 'beforeInteractive' || strategy === 'worker') {
if (updateScripts) {
scripts[strategy] = (scripts[strategy] || []).concat([
_extends({
id,
src,
onLoad,
onReady,
onError
}, restProps),
]);
updateScripts(scripts);
} else if (getIsSsr && getIsSsr()) {
// Script has already loaded during SSR
LoadCache.add(id || src);
} else if (getIsSsr && !getIsSsr()) {
loadScript(props);
}
}
// For the app directory, we need React Float to preload these scripts.
if (appDir) {
// Before interactive scripts need to be loaded by Next.js' runtime instead
// of native <script> tags, because they no longer have `defer`.
if (strategy === 'beforeInteractive') {
if (!src) {
// For inlined scripts, we put the content in `children`.
if (restProps.dangerouslySetInnerHTML) {
restProps.children = restProps.dangerouslySetInnerHTML.__html;
delete restProps.dangerouslySetInnerHTML;
}
return /*#__PURE__*/ _react.default.createElement("script", {
nonce: nonce,
dangerouslySetInnerHTML: {
__html: `(self.__next_s=self.__next_s||[]).push(${JSON.stringify([
0,
_extends({}, restProps),
])})`
}
});
}
// @ts-ignore
_reactDom.default.preload(src, restProps.integrity ? {
as: 'script',
integrity: restProps.integrity
} : {
as: 'script'
});
return /*#__PURE__*/ _react.default.createElement("script", {
nonce: nonce,
dangerouslySetInnerHTML: {
__html: `(self.__next_s=self.__next_s||[]).push(${JSON.stringify([
src,
])})`
}
});
} else if (strategy === 'afterInteractive') {
if (src) {
// @ts-ignore
_reactDom.default.preload(src, restProps.integrity ? {
as: 'script',
integrity: restProps.integrity
} : {
as: 'script'
});
}
}
}
return null;
}
Object.defineProperty(Script, '__nextScript', {
value: true
});
var _default = Script;
exports.default = _default;
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=script.js.map`d<1F><><EFBFBD> <20><><EFBFBD><05><><EFBFBD>!<21><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><06><><EFBFBD>-<2D><><EFBFBD>"<22><><EFBFBD><16><><EFBFBD><EFBFBD>.<2E><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><><7F><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>#<23><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>J<><4A><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>onLoad<61>onReady<64>dangerouslySetInnerHTML`<60><><EFBFBD><EFBFBD>strategy<67>onError<16><><EFBFBD><EFBFBD>&<26><><EFBFBD>'<27><><EFBFBD><16><><EFBFBD><EFBFBD>t<><74><EFBFBD><EFBFBD>afterLoad<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>g<><67><EFBFBD><EFBFBD>loadPromise&<26><><EFBFBD>'<27><><EFBFBD><15>_<><5F><EFBFBD><EFBFBD>e<EFBFBD>call'<27><><EFBFBD><EFBFBD>innerHTML<4D>__html<6D>textContent;<3B><><EFBFBD><<3C><><EFBFBD>><3E><><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>k<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>)<29><><EFBFBD><EFBFBD>attre<><65><EFBFBD><EFBFBD>toLowerCase<73>setAttribute<15><15><16><><EFBFBD><EFBFBD>)<29><><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>readyState<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>querySelectorAllE<><45><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>getAttribute<74>scriptLoaderItems<16><><EFBFBD><EFBFBD>Z<><5A><EFBFBD><EFBFBD>updateScripts<74>getIsSsr<73>appDir<69>nonceY<><59><EFBFBD><EFBFBD>HeadManagerContext<78>hasOnReadyEffectCalledG<><47><EFBFBD>s<><73><EFBFBD>H<><48><EFBFBD><EFBFBD>hasLoadScriptEffectCalled<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>preload<61>integrity <0B><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>{<7B><><EFBFBD>I<><49><EFBFBD>|<7C><><EFBFBD><16><><EFBFBD><EFBFBD>B<><42><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>  <10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/SourceMapSource<10><1F>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.detectDomainLocale = void 0;
const detectDomainLocale = (...args)=>{
if (process.env.__NEXT_I18N_SUPPORT) {
return require("../shared/lib/i18n/detect-domain-locale").detectDomainLocale(...args);
}
};
exports.detectDomainLocale = detectDomainLocale;
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=detect-domain-locale.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/detect-domain-locale.jsH{"version":3,"sources":["webpack://./node_modules/next/dist/client/detect-domain-locale.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.detectDomainLocale = void 0;\nconst detectDomainLocale = (...args)=>{\n if (process.env.__NEXT_I18N_SUPPORT) {\n return require('../shared/lib/i18n/detect-domain-locale').detectDomainLocale(...args);\n }\n};\nexports.detectDomainLocale = detectDomainLocale;\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=detect-domain-locale.js.map"],"names":["Object","defineProperty","exports","value","detectDomainLocale","args","process","env","__NEXT_I18N_SUPPORT","require","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,kBAAkB,GAAG,KAAK;AAClC,MAAMA,qBAAqB,CAAC,GAAGC,OAAO;IAClC,IAAIC,QAAQC,GAAG,CAACC,mBAAmB,EAAE;QACjC,OAAOC,QAAQ,2CAA2CL,kBAAkB,IAAIC;IACpF,CAAC;AACL;AACAH,QAAQE,kBAAkB,GAAGA;AAE7B,IAAI,AAAC,CAAA,OAAOF,QAAQQ,OAAO,KAAK,cAAe,OAAOR,QAAQQ,OAAO,KAAK,YAAYR,QAAQQ,OAAO,KAAK,IAAI,KAAM,OAAOR,QAAQQ,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKX,OAAOC,cAAc,CAACC,QAAQQ,OAAO,EAAE,cAAc;QAAEP,OAAO,IAAI;IAAC;IACnEH,OAAOY,MAAM,CAACV,QAAQQ,OAAO,EAAER;IAC/BW,OAAOX,OAAO,GAAGA,QAAQQ,OAAO;AAClC,CAAC,CAED,gDAAgD","file":"x"}f :NNQjE<6A><00><00>,1J<00><18>Object.defineProperty(exports, "__esModule", (<18>))<18>exports.detectDomainLocale<18>false<18>{}<15><16><><EFBFBD><EFBFBD>]
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.detectDomainLocale = void 0;
const detectDomainLocale = (...args)=>{
if (false) {}
};
exports.detectDomainLocale = detectDomainLocale;
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=detect-domain-locale.js.map
<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><03>x<1F>AAAa;AACbA,8CAA6C;IACzCG,OAAO,IAAI;AACf,CAAC,EAAC;AACFD,0BAA0B,GAAG,KAAK;AAClC,MAAME,qBAAqB,CAAC,GAAGC,OAAO;IAClC,IAAIC,KAA+B,EAAE,EAEpC;AACL;AACAJ,0BAA0B,GAAGE;AAE7B,IAAI,CAAC,OAAOF,QAAQQ,OAAO,KAAK,cAAe,OAAOR,QAAQQ,OAAO,KAAK,YAAYR,QAAQQ,OAAO,KAAK,IAAI,KAAM,OAAOR,QAAQQ,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKX,OAAOC,cAAc,CAACC,QAAQQ,OAAO,EAAE,cAAc;QAAEP,OAAO,IAAI;IAAC;IACnEH,OAAOY,MAAM,CAACV,QAAQQ,OAAO,EAAER;IAC/BW,OAAOX,OAAO,GAAGA,QAAQQ,OAAO;AAClC,CAAC,CAED,gDAAgD<01>webpack://./node_modules/next/dist/client/detect-domain-locale.js<1F>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.detectDomainLocale = void 0;
const detectDomainLocale = (...args)=>{
if (process.env.__NEXT_I18N_SUPPORT) {
return require('../shared/lib/i18n/detect-domain-locale').detectDomainLocale(...args);
}
};
exports.detectDomainLocale = detectDomainLocale;
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=detect-domain-locale.js.map`<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>.<2E><><EFBFBD>#<23><><EFBFBD>=<3D><><EFBFBD>@<40><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>l<><6C><EFBFBD>:<3A><><EFBFBD>m<><6D><EFBFBD>3<><33><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <00><10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/SourceMapSource<10>$"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.removeLocale = removeLocale;
var _parsePath = require("../shared/lib/router/utils/parse-path");
function removeLocale(path, locale) {
if (process.env.__NEXT_I18N_SUPPORT) {
const { pathname } = (0, _parsePath).parsePath(path);
const pathLower = pathname.toLowerCase();
const localeLower = locale == null ? void 0 : locale.toLowerCase();
return locale && (pathLower.startsWith(`/${localeLower}/`) || pathLower === `/${localeLower}`) ? `${pathname.length === locale.length + 1 ? `/` : ``}${path.slice(locale.length + 1)}` : path;
}
return path;
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=remove-locale.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/remove-locale.js<1F> {"version":3,"sources":["webpack://./node_modules/next/dist/client/remove-locale.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.removeLocale = removeLocale;\nvar _parsePath = require(\"../shared/lib/router/utils/parse-path\");\nfunction removeLocale(path, locale) {\n if (process.env.__NEXT_I18N_SUPPORT) {\n const { pathname } = (0, _parsePath).parsePath(path);\n const pathLower = pathname.toLowerCase();\n const localeLower = locale == null ? void 0 : locale.toLowerCase();\n return locale && (pathLower.startsWith(`/${localeLower}/`) || pathLower === `/${localeLower}`) ? `${pathname.length === locale.length + 1 ? `/` : ``}${path.slice(locale.length + 1)}` : path;\n }\n return path;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=remove-locale.js.map"],"names":["Object","defineProperty","exports","value","removeLocale","_parsePath","require","path","locale","process","env","__NEXT_I18N_SUPPORT","pathname","parsePath","pathLower","toLowerCase","localeLower","startsWith","length","slice","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,YAAY,GAAGA;AACvB,IAAIC,aAAaC,QAAQ;AACzB,SAASF,aAAaG,IAAI,EAAEC,MAAM,EAAE;IAChC,IAAIC,QAAQC,GAAG,CAACC,mBAAmB,EAAE;QACjC,MAAM,EAAEC,SAAQ,EAAG,GAAG,AAAC,CAAA,GAAGP,UAAU,AAAD,EAAGQ,SAAS,CAACN;QAChD,MAAMO,YAAYF,SAASG,WAAW;QACtC,MAAMC,cAAcR,UAAU,IAAI,GAAG,KAAK,IAAIA,OAAOO,WAAW,EAAE;QAClE,OAAOP,UAAWM,CAAAA,UAAUG,UAAU,CAAC,CAAC,CAAC,EAAED,YAAY,CAAC,CAAC,KAAKF,cAAc,CAAC,CAAC,EAAEE,YAAY,CAAC,AAAD,IAAK,CAAC,EAAEJ,SAASM,MAAM,KAAKV,OAAOU,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAEX,KAAKY,KAAK,CAACX,OAAOU,MAAM,GAAG,GAAG,CAAC,GAAGX,IAAI;IACjM,CAAC;IACD,OAAOA;AACX;AAEA,IAAI,AAAC,CAAA,OAAOL,QAAQkB,OAAO,KAAK,cAAe,OAAOlB,QAAQkB,OAAO,KAAK,YAAYlB,QAAQkB,OAAO,KAAK,IAAI,KAAM,OAAOlB,QAAQkB,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKrB,OAAOC,cAAc,CAACC,QAAQkB,OAAO,EAAE,cAAc;QAAEjB,OAAO,IAAI;IAAC;IACnEH,OAAOsB,MAAM,CAACpB,QAAQkB,OAAO,EAAElB;IAC/BqB,OAAOrB,OAAO,GAAGA,QAAQkB,OAAO;AAClC,CAAC,CAED,yCAAyC","file":"x"}f :NNQdG<64><00><00><00><00><00><00><18>Object.defineProperty(exports, "__esModule", (<18>))<18>exports.removeLocale<18>__webpack_require__<18>/*! ../shared/lib/router/utils/parse-path */ "../shared/lib/router/utils/parse-path"<18>false<18>{}<16><><EFBFBD><EFBFBD><1F>
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.removeLocale = removeLocale;
var _parsePath = __webpack_require__(/*! ../shared/lib/router/utils/parse-path */ "../shared/lib/router/utils/parse-path");
function removeLocale(path, locale) {
if (false) {}
return path;
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=remove-locale.js.map
<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><03>x<1F>AAAa;AACbA,8CAA6C;IACzCG,OAAO,IAAI;AACf,CAAC,EAAC;AACFD,oBAAoB,GAAGE;AACvB,IAAIC,aAAaC,mBAAOA,CAAC,oFAAuC;AAChE,SAASF,aAAaG,IAAI,EAAEC,MAAM,EAAE;IAChC,IAAIC,KAA+B,EAAE,EAKpC;IACD,OAAOF;AACX;AAEA,IAAI,CAAC,OAAOL,QAAQkB,OAAO,KAAK,cAAe,OAAOlB,QAAQkB,OAAO,KAAK,YAAYlB,QAAQkB,OAAO,KAAK,IAAI,KAAM,OAAOlB,QAAQkB,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKrB,OAAOC,cAAc,CAACC,QAAQkB,OAAO,EAAE,cAAc;QAAEjB,OAAO,IAAI;IAAC;IACnEH,OAAOsB,MAAM,CAACpB,QAAQkB,OAAO,EAAElB;IAC/BqB,OAAOrB,OAAO,GAAGA,QAAQkB,OAAO;AAClC,CAAC,CAED,yCAAyC<01>webpack://./node_modules/next/dist/client/remove-locale.js"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.removeLocale = removeLocale;
var _parsePath = require("../shared/lib/router/utils/parse-path");
function removeLocale(path, locale) {
if (process.env.__NEXT_I18N_SUPPORT) {
const { pathname } = (0, _parsePath).parsePath(path);
const pathLower = pathname.toLowerCase();
const localeLower = locale == null ? void 0 : locale.toLowerCase();
return locale && (pathLower.startsWith(`/${localeLower}/`) || pathLower === `/${localeLower}`) ? `${pathname.length === locale.length + 1 ? `/` : ``}${path.slice(locale.length + 1)}` : path;
}
return path;
}
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=remove-locale.js.map`<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>]<5D><><EFBFBD><05><><EFBFBD><16><><EFBFBD><EFBFBD>5<><35><EFBFBD><16><><EFBFBD><EFBFBD>.<2E><><EFBFBD>1<><31><EFBFBD>s<><73><EFBFBD>:<3A><><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>pathLowerҋlocaleLower=<3D><><EFBFBD><16><><EFBFBD><EFBFBD><17><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>[<5B><><EFBFBD>)<29><><EFBFBD>\<5C><><EFBFBD>"<22><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <00> <10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/SourceMapSource<10><1F>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.removeBasePath = removeBasePath;
var _hasBasePath = require("./has-base-path");
const basePath = process.env.__NEXT_ROUTER_BASEPATH || "";
function removeBasePath(path) {
if (process.env.__NEXT_MANUAL_CLIENT_BASE_PATH) {
if (!(0, _hasBasePath).hasBasePath(path)) {
return path;
}
}
path = path.slice(basePath.length);
if (!path.startsWith("/")) path = `/${path}`;
return path;
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=remove-base-path.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/remove-base-path.js{"version":3,"sources":["webpack://./node_modules/next/dist/client/remove-base-path.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.removeBasePath = removeBasePath;\nvar _hasBasePath = require(\"./has-base-path\");\nconst basePath = process.env.__NEXT_ROUTER_BASEPATH || '';\nfunction removeBasePath(path) {\n if (process.env.__NEXT_MANUAL_CLIENT_BASE_PATH) {\n if (!(0, _hasBasePath).hasBasePath(path)) {\n return path;\n }\n }\n path = path.slice(basePath.length);\n if (!path.startsWith('/')) path = `/${path}`;\n return path;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=remove-base-path.js.map"],"names":["Object","defineProperty","exports","value","removeBasePath","_hasBasePath","require","basePath","process","env","__NEXT_ROUTER_BASEPATH","path","__NEXT_MANUAL_CLIENT_BASE_PATH","hasBasePath","slice","length","startsWith","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,cAAc,GAAGA;AACzB,IAAIC,eAAeC,QAAQ;AAC3B,MAAMC,WAAWC,QAAQC,GAAG,CAACC,sBAAsB,IAAI;AACvD,SAASN,eAAeO,IAAI,EAAE;IAC1B,IAAIH,QAAQC,GAAG,CAACG,8BAA8B,EAAE;QAC5C,IAAI,CAAC,AAAC,CAAA,GAAGP,YAAY,AAAD,EAAGQ,WAAW,CAACF,OAAO;YACtC,OAAOA;QACX,CAAC;IACL,CAAC;IACDA,OAAOA,KAAKG,KAAK,CAACP,SAASQ,MAAM;IACjC,IAAI,CAACJ,KAAKK,UAAU,CAAC,MAAML,OAAO,CAAC,CAAC,EAAEA,KAAK,CAAC;IAC5C,OAAOA;AACX;AAEA,IAAI,AAAC,CAAA,OAAOT,QAAQe,OAAO,KAAK,cAAe,OAAOf,QAAQe,OAAO,KAAK,YAAYf,QAAQe,OAAO,KAAK,IAAI,KAAM,OAAOf,QAAQe,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKlB,OAAOC,cAAc,CAACC,QAAQe,OAAO,EAAE,cAAc;QAAEd,OAAO,IAAI;IAAC;IACnEH,OAAOmB,MAAM,CAACjB,QAAQe,OAAO,EAAEf;IAC/BkB,OAAOlB,OAAO,GAAGA,QAAQe,OAAO;AAClC,CAAC,CAED,4CAA4C","file":"x"} f :NNQfI<66><00><00><00><00><00> 58<00><00><18>Object.defineProperty(exports, "__esModule", (<18>))<18>exports.removeBasePath<18>__webpack_require__<18>/*! ./has-base-path */ "./node_modules/next/dist/client/has-base-path.js"<18> false<18>false<18>{}<16><><EFBFBD><EFBFBD> 
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.removeBasePath = removeBasePath;
var _hasBasePath = __webpack_require__(/*! ./has-base-path */ "./node_modules/next/dist/client/has-base-path.js");
const basePath = false || "";
function removeBasePath(path) {
if (false) {}
path = path.slice(basePath.length);
if (!path.startsWith("/")) path = `/${path}`;
return path;
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=remove-base-path.js.map
<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><03>xnAAAa;AACbA,8CAA6C;IACzCG,OAAO,IAAI;AACf,CAAC,EAAC;AACFD,sBAAsB,GAAGE;AACzB,IAAIC,eAAeC,mBAAOA,CAAC,yEAAiB;AAC5C,MAAMC,WAAWC,MAAkC,IAAI;AACvD,SAASJ,eAAeO,IAAI,EAAE;IAC1B,IAAIH,KAA0C,EAAE,EAI/C;IACDG,OAAOA,KAAKG,KAAK,CAACP,SAASQ,MAAM;IACjC,IAAI,CAACJ,KAAKK,UAAU,CAAC,MAAML,OAAO,CAAC,CAAC,EAAEA,KAAK,CAAC;IAC5C,OAAOA;AACX;AAEA,IAAI,CAAC,OAAOT,QAAQe,OAAO,KAAK,cAAe,OAAOf,QAAQe,OAAO,KAAK,YAAYf,QAAQe,OAAO,KAAK,IAAI,KAAM,OAAOf,QAAQe,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKlB,OAAOC,cAAc,CAACC,QAAQe,OAAO,EAAE,cAAc;QAAEd,OAAO,IAAI;IAAC;IACnEH,OAAOmB,MAAM,CAACjB,QAAQe,OAAO,EAAEf;IAC/BkB,OAAOlB,OAAO,GAAGA,QAAQe,OAAO;AAClC,CAAC,CAED,4CAA4C<01>webpack://./node_modules/next/dist/client/remove-base-path.jsu"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.removeBasePath = removeBasePath;
var _hasBasePath = require("./has-base-path");
const basePath = process.env.__NEXT_ROUTER_BASEPATH || '';
function removeBasePath(path) {
if (process.env.__NEXT_MANUAL_CLIENT_BASE_PATH) {
if (!(0, _hasBasePath).hasBasePath(path)) {
return path;
}
}
path = path.slice(basePath.length);
if (!path.startsWith('/')) path = `/${path}`;
return path;
}
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=remove-base-path.js.map`<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><1D><><EFBFBD> <20><><EFBFBD>r<><72><EFBFBD>$<24><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><08><><EFBFBD><16><><EFBFBD><EFBFBD>.<2E><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>L<><4C><EFBFBD><1A><><EFBFBD>M<><4D><EFBFBD><13><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> n <10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/SourceMapSource<10><1F>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.hasBasePath = hasBasePath;
var _pathHasPrefix = require("../shared/lib/router/utils/path-has-prefix");
const basePath = process.env.__NEXT_ROUTER_BASEPATH || "";
function hasBasePath(path) {
return (0, _pathHasPrefix).pathHasPrefix(path, basePath);
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=has-base-path.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/has-base-path.js]{"version":3,"sources":["webpack://./node_modules/next/dist/client/has-base-path.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.hasBasePath = hasBasePath;\nvar _pathHasPrefix = require(\"../shared/lib/router/utils/path-has-prefix\");\nconst basePath = process.env.__NEXT_ROUTER_BASEPATH || '';\nfunction hasBasePath(path) {\n return (0, _pathHasPrefix).pathHasPrefix(path, basePath);\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=has-base-path.js.map"],"names":["Object","defineProperty","exports","value","hasBasePath","_pathHasPrefix","require","basePath","process","env","__NEXT_ROUTER_BASEPATH","path","pathHasPrefix","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,WAAW,GAAGA;AACtB,IAAIC,iBAAiBC,QAAQ;AAC7B,MAAMC,WAAWC,QAAQC,GAAG,CAACC,sBAAsB,IAAI;AACvD,SAASN,YAAYO,IAAI,EAAE;IACvB,OAAO,AAAC,CAAA,GAAGN,cAAc,AAAD,EAAGO,aAAa,CAACD,MAAMJ;AACnD;AAEA,IAAI,AAAC,CAAA,OAAOL,QAAQW,OAAO,KAAK,cAAe,OAAOX,QAAQW,OAAO,KAAK,YAAYX,QAAQW,OAAO,KAAK,IAAI,KAAM,OAAOX,QAAQW,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKd,OAAOC,cAAc,CAACC,QAAQW,OAAO,EAAE,cAAc;QAAEV,OAAO,IAAI;IAAC;IACnEH,OAAOe,MAAM,CAACb,QAAQW,OAAO,EAAEX;IAC/Bc,OAAOd,OAAO,GAAGA,QAAQW,OAAO;AAClC,CAAC,CAED,yCAAyC","file":"x"}f :NNQcE<63><00><00><00><00><00><00><18>Object.defineProperty(exports, "__esModule", (<18>))<18>exports.hasBasePath<18>__webpack_require__<18>/*! ../shared/lib/router/utils/path-has-prefix */ "../shared/lib/router/utils/path-has-prefix"<18> false<16><><EFBFBD><EFBFBD><1F>
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.hasBasePath = hasBasePath;
var _pathHasPrefix = __webpack_require__(/*! ../shared/lib/router/utils/path-has-prefix */ "../shared/lib/router/utils/path-has-prefix");
const basePath = false || "";
function hasBasePath(path) {
return (0, _pathHasPrefix).pathHasPrefix(path, basePath);
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=has-base-path.js.map
<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><03>xAAAa;AACbA,8CAA6C;IACzCG,OAAO,IAAI;AACf,CAAC,EAAC;AACFD,mBAAmB,GAAGE;AACtB,IAAIC,iBAAiBC,mBAAOA,CAAC,8FAA4C;AACzE,MAAMC,WAAWC,MAAkC,IAAI;AACvD,SAASJ,YAAYO,IAAI,EAAE;IACvB,OAAO,CAAC,GAAGN,cAAc,EAAEO,aAAa,CAACD,MAAMJ;AACnD;AAEA,IAAI,CAAC,OAAOL,QAAQW,OAAO,KAAK,cAAe,OAAOX,QAAQW,OAAO,KAAK,YAAYX,QAAQW,OAAO,KAAK,IAAI,KAAM,OAAOX,QAAQW,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKd,OAAOC,cAAc,CAACC,QAAQW,OAAO,EAAE,cAAc;QAAEV,OAAO,IAAI;IAAC;IACnEH,OAAOe,MAAM,CAACb,QAAQW,OAAO,EAAEX;IAC/Bc,OAAOd,OAAO,GAAGA,QAAQW,OAAO;AAClC,CAAC,CAED,yCAAyC<01>webpack://./node_modules/next/dist/client/has-base-path.js<1F>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.hasBasePath = hasBasePath;
var _pathHasPrefix = require("../shared/lib/router/utils/path-has-prefix");
const basePath = process.env.__NEXT_ROUTER_BASEPATH || '';
function hasBasePath(path) {
return (0, _pathHasPrefix).pathHasPrefix(path, basePath);
}
2023-01-04 02:30:44 +01:00
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=has-base-path.js.map`<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><0E><><EFBFBD><11><><EFBFBD>c<><63><EFBFBD><15><><EFBFBD><EFBFBD>pathHasPrefix<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><<3C><><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>=<3D><><EFBFBD><03><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> A<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/OriginalSource"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isAPIRoute = isAPIRoute;
function isAPIRoute(value) {
return value === "/api" || Boolean(value == null ? void 0 : value.startsWith("/api/"));
}
2023-01-04 02:30:44 +01:00
//# sourceMappingURL=is-api-route.js.map<61>webpack://./node_modules/next/dist/lib/is-api-route.jsf :NNQb<51><18>Object.defineProperty(exports, "__esModule", (<18>))<18>exports.isAPIRoute<16><><EFBFBD><EFBFBD> 
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.isAPIRoute = isAPIRoute;
function isAPIRoute(value) {
return value === "/api" || Boolean(value == null ? void 0 : value.startsWith("/api/"));
}
2023-01-04 02:30:44 +01:00
//# sourceMappingURL=is-api-route.js.map <16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><03>xGAAAa;AACb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAkB;AAClB;AACA;AACA;;AAEA<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>0<><30><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>9module.exports = require("next/dist/shared/lib/mitt.js");<3B>external commonjs "next/dist/shared/lib/mitt.js"<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>:module.exports = require("next/dist/shared/lib/utils.js");<3B>external commonjs "next/dist/shared/lib/utils.js"<16><><EFBFBD><EFBFBD>}<7D><><EFBFBD>~<7E><><EFBFBD>Lmodule.exports = require("next/dist/shared/lib/router/utils/is-dynamic.js");<3B>external commonjs "next/dist/shared/lib/router/utils/is-dynamic.js"<16><><EFBFBD><EFBFBD>x<><78><EFBFBD>y<><79><EFBFBD>Tmodule.exports = require("next/dist/shared/lib/router/utils/parse-relative-url.js");<3B>external commonjs "next/dist/shared/lib/router/utils/parse-relative-url.js"<16><><EFBFBD><EFBFBD>s<><73><EFBFBD>t<><74><EFBFBD>Mmodule.exports = require("next/dist/shared/lib/router/utils/querystring.js");<3B>external commonjs "next/dist/shared/lib/router/utils/querystring.js"<16><><EFBFBD><EFBFBD>n<><6E><EFBFBD>o<><6F><EFBFBD>Rmodule.exports = require("next/dist/shared/lib/router/utils/resolve-rewrites.js");<3B>external commonjs "next/dist/shared/lib/router/utils/resolve-rewrites.js"<16><><EFBFBD><EFBFBD>i<><69><EFBFBD>j<><6A><EFBFBD>Omodule.exports = require("next/dist/shared/lib/router/utils/route-matcher.js");<3B>external commonjs "next/dist/shared/lib/router/utils/route-matcher.js"<16><><EFBFBD><EFBFBD>d<><64><EFBFBD>e<><65><EFBFBD>Mmodule.exports = require("next/dist/shared/lib/router/utils/route-regex.js");<3B>external commonjs "next/dist/shared/lib/router/utils/route-regex.js"<16><><EFBFBD><EFBFBD>_<><5F><EFBFBD>`<60><><EFBFBD>Xmodule.exports = require("next/dist/shared/lib/router/utils/get-next-pathname-info.js");<3B>external commonjs "next/dist/shared/lib/router/utils/get-next-pathname-info.js"{<7B><><EFBFBD>Z<><5A><EFBFBD>[<5B><><EFBFBD>[module.exports = require("next/dist/shared/lib/router/utils/format-next-pathname-info.js");<3B>external commonjs "next/dist/shared/lib/router/utils/format-next-pathname-info.js"v<><76><EFBFBD>U<><55><EFBFBD>V<><56><EFBFBD>Pmodule.exports = require("next/dist/shared/lib/router/utils/compare-states.js");<3B>external commonjs "next/dist/shared/lib/router/utils/compare-states.js"q<><71><EFBFBD>P<><50><EFBFBD>Q<><51><EFBFBD>Hmodule.exports = require("next/dist/shared/lib/router/utils/is-bot.js");<3B>external commonjs "next/dist/shared/lib/router/utils/is-bot.js"l<><6C><EFBFBD>K<><4B><EFBFBD>L<><4C><EFBFBD>Tmodule.exports = require("next/dist/shared/lib/page-path/denormalize-page-path.js");<3B>external commonjs "next/dist/shared/lib/page-path/denormalize-page-path.js"g<><67><EFBFBD>F<><46><EFBFBD>G<><47><EFBFBD>Omodule.exports = require("next/dist/shared/lib/i18n/normalize-locale-path.js");<3B>external commonjs "next/dist/shared/lib/i18n/normalize-locale-path.js"b<><62><EFBFBD>A<><41><EFBFBD>B<><42><EFBFBD>&module.exports = require("react-dom");<3B>external commonjs "react-dom"]<5D><><EFBFBD><<3C><><EFBFBD>=<3D><><EFBFBD>Qmodule.exports = require("next/dist/shared/lib/router/utils/path-has-prefix.js");<3B>external commonjs "next/dist/shared/lib/router/utils/path-has-prefix.js"X<><58><EFBFBD>7<><37><EFBFBD>8<><38><EFBFBD> <00><10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/OriginalSource3"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return _asyncToGenerator;
}
});
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function() {
var self = this, args = arguments;
return new Promise(function(resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
<EFBFBD>webpack://./node_modules/@swc/helpers/lib/_async_to_generator.jsf :NNQzA<7A><00><00><18>Object.defineProperty(exports, "__esModule", (<18>))<18>Object.defineProperty(exports, "default", (<15><<3C><><EFBFBD>*
Object.defineProperty(exports, "__esModule", ({
value: true
}));
Object.defineProperty(exports, "default", ({
enumerable: true,
get: function() {
return _asyncToGenerator;
}
}));
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function() {
var self = this, args = arguments;
return new Promise(function(resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
=<3D><><EFBFBD>@<40><><EFBFBD>D<><44><EFBFBD><03>x<1F>AAAa;AACb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,2CAA0C;AAC1C;AACA;AACA;AACA;AACA,CAAC,EAAC;AACF;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>*<2A><><EFBFBD>+<2B><><EFBFBD> S?<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/SourceMapSource<10><1F>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = initHeadManager;
exports.isEqualNode = isEqualNode;
exports.DOMAttributeNames = void 0;
function initHeadManager() {
return {
mountedInstances: new Set(),
updateHead: (head)=>{
const tags = {};
head.forEach((h)=>{
if (// it won't be inlined. In this case revert to the original behavior
h.type === "link" && h.props["data-optimized-fonts"]) {
if (document.querySelector(`style[data-href="${h.props["data-href"]}"]`)) {
return;
} else {
h.props.href = h.props["data-href"];
h.props["data-href"] = undefined;
}
}
const components = tags[h.type] || [];
components.push(h);
tags[h.type] = components;
});
const titleComponent = tags.title ? tags.title[0] : null;
let title = "";
if (titleComponent) {
const { children } = titleComponent.props;
title = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : "";
}
if (title !== document.title) document.title = title;
[
"meta",
"base",
"link",
"style",
"script"
].forEach((type)=>{
updateElements(type, tags[type] || []);
});
}
};
}
const DOMAttributeNames = {
acceptCharset: "accept-charset",
className: "class",
htmlFor: "for",
httpEquiv: "http-equiv",
noModule: "noModule"
};
exports.DOMAttributeNames = DOMAttributeNames;
function reactElementToDOM({ type , props }) {
const el = document.createElement(type);
for(const p in props){
if (!props.hasOwnProperty(p)) continue;
if (p === "children" || p === "dangerouslySetInnerHTML") continue;
// we don't render undefined props to the DOM
if (props[p] === undefined) continue;
const attr = DOMAttributeNames[p] || p.toLowerCase();
if (type === "script" && (attr === "async" || attr === "defer" || attr === "noModule")) {
el[attr] = !!props[p];
} else {
el.setAttribute(attr, props[p]);
}
}
const { children , dangerouslySetInnerHTML } = props;
if (dangerouslySetInnerHTML) {
el.innerHTML = dangerouslySetInnerHTML.__html || "";
} else if (children) {
el.textContent = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : "";
}
return el;
}
function isEqualNode(oldTag, newTag) {
if (oldTag instanceof HTMLElement && newTag instanceof HTMLElement) {
const nonce = newTag.getAttribute("nonce");
// Only strip the nonce if `oldTag` has had it stripped. An element's nonce attribute will not
// be stripped if there is no content security policy response header that includes a nonce.
if (nonce && !oldTag.getAttribute("nonce")) {
const cloneTag = newTag.cloneNode(true);
cloneTag.setAttribute("nonce", "");
cloneTag.nonce = nonce;
return nonce === oldTag.nonce && oldTag.isEqualNode(cloneTag);
}
}
return oldTag.isEqualNode(newTag);
}
function updateElements(type, components) {
const headEl = document.getElementsByTagName("head")[0];
const headCountEl = headEl.querySelector("meta[name=next-head-count]");
if ("development" !== "production") {
if (!headCountEl) {
console.error("Warning: next-head-count is missing. https://nextjs.org/docs/messages/next-head-count-missing");
return;
}
}
const headCount = Number(headCountEl.content);
const oldTags = [];
for(let i = 0, j = headCountEl.previousElementSibling; i < headCount; i++, j = (j == null ? void 0 : j.previousElementSibling) || null){
var ref;
if ((j == null ? void 0 : (ref = j.tagName) == null ? void 0 : ref.toLowerCase()) === type) {
oldTags.push(j);
}
}
const newTags = components.map(reactElementToDOM).filter((newTag)=>{
for(let k = 0, len = oldTags.length; k < len; k++){
const oldTag = oldTags[k];
if (isEqualNode(oldTag, newTag)) {
oldTags.splice(k, 1);
return false;
}
}
return true;
});
oldTags.forEach((t)=>{
var ref;
return (ref = t.parentNode) == null ? void 0 : ref.removeChild(t);
});
newTags.forEach((t)=>headEl.insertBefore(t, headCountEl));
headCountEl.content = (headCount - oldTags.length + newTags.length).toString();
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=head-manager.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/head-manager.js<1F>({"version":3,"sources":["webpack://./node_modules/next/dist/client/head-manager.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = initHeadManager;\nexports.isEqualNode = isEqualNode;\nexports.DOMAttributeNames = void 0;\nfunction initHeadManager() {\n return {\n mountedInstances: new Set(),\n updateHead: (head)=>{\n const tags = {};\n head.forEach((h)=>{\n if (// If the font tag is loaded only on client navigation\n // it won't be inlined. In this case revert to the original behavior\n h.type === 'link' && h.props['data-optimized-fonts']) {\n if (document.querySelector(`style[data-href=\"${h.props['data-href']}\"]`)) {\n return;\n } else {\n h.props.href = h.props['data-href'];\n h.props['data-href'] = undefined;\n }\n }\n const components = tags[h.type] || [];\n components.push(h);\n tags[h.type] = components;\n });\n const titleComponent = tags.title ? tags.title[0] : null;\n let title = '';\n if (titleComponent) {\n const { children } = titleComponent.props;\n title = typeof children === 'string' ? children : Array.isArray(children) ? children.join('') : '';\n }\n if (title !== document.title) document.title = title;\n [\n 'meta',\n 'base',\n 'link',\n 'style',\n 'script'\n ].forEach((type)=>{\n updateElements(type, tags[type] || []);\n });\n }\n };\n}\nconst DOMAttributeNames = {\n acceptCharset: 'accept-charset',\n className: 'class',\n htmlFor: 'for',\n httpEquiv: 'http-equiv',\n noModule: 'noModule'\n};\nexports.DOMAttributeNames = DOMAttributeNames;\nfunction reactElementToDOM({ type , props }) {\n const el = document.createElement(type);\n for(const p in props){\n if (!props.hasOwnProperty(p)) continue;\n if (p === 'children' || p === 'dangerouslySetInnerHTML') continue;\n // we don't render undefined props to the DOM\n if (props[p] === undefined) continue;\n const attr = DOMAttributeNames[p] || p.toLowerCase();\n if (type === 'script' && (attr === 'async' || attr === 'defer' || attr === 'noModule')) {\n el[attr] = !!props[p];\n } else {\n el.setAttribute(attr, props[p]);\n }\n }\n const { children , dangerouslySetInnerHTML } = props;\n if (dangerouslySetInnerHTML) {\n el.innerHTML = dangerouslySetInnerHTML.__html || '';\n } else if (children) {\n el.textContent = typeof children === 'string' ? children : Array.isArray(children) ? children.join('') : '';\n }\n return el;\n}\nfunction isEqualNode(oldTag, newTag) {\n if (oldTag instanceof HTMLElement && newTag instanceof HTMLElement) {\n const nonce = newTag.getAttribute('nonce');\n // Only strip the nonce if `oldTag` has had it stripped. An element's nonce attribute will not\n // be stripped if there is no content security policy response header that includes a nonce.\n if (nonce && !oldTag.getAttribute('nonce')) {\n const cloneTag = newTag.cloneNode(true);\n cloneTag.setAttribute('nonce', '');\n cloneTag.nonce = nonce;\n return nonce === oldTag.nonce && oldTag.isEqualNode(cloneTag);\n }\n }\n return oldTag.isEqualNode(newTag);\n}\nfunction updateElements(type, components) {\n const headEl = document.getElementsByTagName('head')[0];\n const headCountEl = headEl.querySelector('meta[name=next-head-count]');\
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = initHeadManager;
exports.isEqualNode = isEqualNode;
exports.DOMAttributeNames = void 0;
function initHeadManager() {
return {
mountedInstances: new Set(),
updateHead: (head)=>{
const tags = {};
head.forEach((h)=>{
if (// it won't be inlined. In this case revert to the original behavior
h.type === "link" && h.props["data-optimized-fonts"]) {
if (document.querySelector(`style[data-href="${h.props["data-href"]}"]`)) {
return;
} else {
h.props.href = h.props["data-href"];
h.props["data-href"] = undefined;
}
}
const components = tags[h.type] || [];
components.push(h);
tags[h.type] = components;
});
const titleComponent = tags.title ? tags.title[0] : null;
let title = "";
if (titleComponent) {
const { children } = titleComponent.props;
title = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : "";
}
if (title !== document.title) document.title = title;
[
"meta",
"base",
"link",
"style",
"script"
].forEach((type)=>{
updateElements(type, tags[type] || []);
});
}
};
}
const DOMAttributeNames = {
acceptCharset: "accept-charset",
className: "class",
htmlFor: "for",
httpEquiv: "http-equiv",
noModule: "noModule"
};
exports.DOMAttributeNames = DOMAttributeNames;
function reactElementToDOM({ type , props }) {
const el = document.createElement(type);
for(const p in props){
if (!props.hasOwnProperty(p)) continue;
if (p === "children" || p === "dangerouslySetInnerHTML") continue;
// we don't render undefined props to the DOM
if (props[p] === undefined) continue;
const attr = DOMAttributeNames[p] || p.toLowerCase();
if (type === "script" && (attr === "async" || attr === "defer" || attr === "noModule")) {
el[attr] = !!props[p];
} else {
el.setAttribute(attr, props[p]);
}
}
const { children , dangerouslySetInnerHTML } = props;
if (dangerouslySetInnerHTML) {
el.innerHTML = dangerouslySetInnerHTML.__html || "";
} else if (children) {
el.textContent = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : "";
}
return el;
}
function isEqualNode(oldTag, newTag) {
if (oldTag instanceof HTMLElement && newTag instanceof HTMLElement) {
const nonce = newTag.getAttribute("nonce");
// Only strip the nonce if `oldTag` has had it stripped. An element's nonce attribute will not
// be stripped if there is no content security policy response header that includes a nonce.
if (nonce && !oldTag.getAttribute("nonce")) {
const cloneTag = newTag.cloneNode(true);
cloneTag.setAttribute("nonce", "");
cloneTag.nonce = nonce;
return nonce === oldTag.nonce && oldTag.isEqualNode(cloneTag);
}
}
return oldTag.isEqualNode(newTag);
}
function updateElements(type, components) {
const headEl = document.getElementsByTagName("head")[0];
const headCountEl = headEl.querySelector("meta[name=next-head-count]");
if (true) {
if (!headCountEl) {
console.error("Warning: next-head-count is missing. https://nextjs.org/docs/messages/next-head-count-missing");
return;
}
}
const headCount = Number(headCountEl.content);
const oldTags = [];
for(let i = 0, j = headCountEl.previousElementSibling; i < headCount; i++, j = (j == null ? void 0 : j.previousElementSibling) || null){
var ref;
if ((j == null ? void 0 : (ref = j.tagName) == null ? void 0 : ref.toLowerCase()) === type) {
oldTags.push(j);
}
}
const newTags = components.map(reactElementToDOM).filter((newTag)=>{
for(let k = 0, len = oldTags.length; k < len; k++){
const oldTag = oldTags[k];
if (isEqualNode(oldTag, newTag)) {
oldTags.splice(k, 1);
return false;
}
}
return true;
});
oldTags.forEach((t)=>{
var ref;
return (ref = t.parentNode) == null ? void 0 : ref.removeChild(t);
});
newTags.forEach((t)=>headEl.insertBefore(t, headCountEl));
headCountEl.content = (headCount - oldTags.length + newTags.length).toString();
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=head-manager.js.map
0<><30><EFBFBD>3<><33><EFBFBD>7<><37><EFBFBD><03>x<1F>AAAa;AACbA,8CAA6C;IACzCG,OAAO,IAAI;AACf,CAAC,EAAC;AACFD,kBAAe,GAAGG;AAClBH,mBAAmB,GAAGI;AACtBJ,yBAAyB,GAAG,KAAK;AACjC,SAASG,kBAAkB;IACvB,OAAO;QACHG,kBAAkB,IAAIC;QACtBC,YAAY,CAACC,OAAO;YAChB,MAAMC,OAAO,CAAC;YACdD,KAAKE,OAAO,CAAC,CAACC,IAAI;gBACd,IACA,oEAAoE;gBACpEA,EAAEC,IAAI,KAAK,UAAUD,EAAEE,KAAK,CAAC,uBAAuB,EAAE;oBAClD,IAAIC,SAASC,aAAa,CAAC,CAAC,iBAAiB,EAAEJ,EAAEE,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,GAAG;wBACtE;oBACJ,OAAO;wBACHF,EAAEE,KAAK,CAACG,IAAI,GAAGL,EAAEE,KAAK,CAAC,YAAY;wBACnCF,EAAEE,KAAK,CAAC,YAAY,GAAGI;oBAC3B,CAAC;gBACL,CAAC;gBACD,MAAMC,aAAaT,IAAI,CAACE,EAAEC,IAAI,CAAC,IAAI,EAAE;gBACrCM,WAAWC,IAAI,CAACR;gBAChBF,IAAI,CAACE,EAAEC,IAAI,CAAC,GAAGM;YACnB;YACA,MAAME,iBAAiBX,KAAKY,KAAK,GAAGZ,KAAKY,KAAK,CAAC,EAAE,GAAG,IAAI;YACxD,IAAIA,QAAQ;YACZ,IAAID,gBAAgB;gBAChB,MAAM,EAAEE,SAAQ,EAAG,GAAGF,eAAeP,KAAK;gBAC1CQ,QAAQ,OAAOC,aAAa,WAAWA,WAAWC,MAAMC,OAAO,CAACF,YAAYA,SAASG,IAAI,CAAC,MAAM,EAAE;YACtG,CAAC;YACD,IAAIJ,UAAUP,SAASO,KAAK,EAAEP,SAASO,KAAK,GAAGA;YAC/C;gBACI;gBACA;gBACA;gBACA;gBACA;aACH,CAACX,OAAO,CAAC,CAACE,OAAO;gBACdc,eAAed,MAAMH,IAAI,CAACG,KAAK,IAAI,EAAE;YACzC;QACJ;IACJ;AACJ;AACA,MAAMR,oBAAoB;IACtBuB,eAAe;IACfC,WAAW;IACXC,SAAS;IACTC,WAAW;IACXC,UAAU;AACd;AACAhC,yBAAyB,GAAGK;AAC5B,SAAS4B,kBAAkB,EAAEpB,KAAI,EAAGC,MAAK,EAAG,EAAE;IAC1C,MAAMoB,KAAKnB,SAASoB,aAAa,CAACtB;IAClC,IAAI,MAAMuB,KAAKtB,MAAM;QACjB,IAAI,CAACA,MAAMuB,cAAc,CAACD,IAAI,QAAS;QACvC,IAAIA,MAAM,cAAcA,MAAM,2BAA2B,QAAS;QAClE,6CAA6C;QAC7C,IAAItB,KAAK,CAACsB,EAAE,KAAKlB,WAAW,QAAS;QACrC,MAAMoB,OAAOjC,iBAAiB,CAAC+B,EAAE,IAAIA,EAAEG,WAAW;QAClD,IAAI1B,SAAS,YAAayB,CAAAA,SAAS,WAAWA,SAAS,WAAWA,SAAS,UAAS,GAAI;YACpFJ,EAAE,CAACI,KAAK,GAAG,CAAC,CAACxB,KAAK,CAACsB,EAAE;QACzB,OAAO;YACHF,GAAGM,YAAY,CAACF,MAAMxB,KAAK,CAACsB,EAAE;QAClC,CAAC;IACL;IACA,MAAM,EAAEb,SAAQ,EAAGkB,wBAAuB,EAAG,GAAG3B;IAChD,IAAI2B,yBAAyB;QACzBP,GAAGQ,SAAS,GAAGD,wBAAwBE,MAAM,IAAI;IACrD,OAAO,IAAIpB,UAAU;QACjBW,GAAGU,WAAW,GAAG,OAAOrB,aAAa,WAAWA,WAAWC,MAAMC,OAAO,CAACF,YAAYA,SAASG,IAAI,CAAC,MAAM,EAAE;IAC/G,CAAC;IACD,OAAOQ;AACX;AACA,SAAS9B,YAAYyC,MAAM,EAAEC,MAAM,EAAE;IACjC,IAAID,kBAAkBE,eAAeD,kBAAkBC,aAAa;QAChE,MAAMC,QAAQF,OAAOG,YAAY,CAAC;QAClC,8FAA8F;QAC9F,4FAA4F;QAC5F,IAAID,SAAS,CAACH,OAAOI,YAAY,CAAC,UAAU;YACxC,MAAMC,WAAWJ,OAAOK,SAAS,CAAC,IAAI;YACtCD,SAASV,YAAY,CAAC,SAAS;YAC/BU,SAASF,KAAK,GAAGA;YACjB,OAAOA,UAAUH,OAAOG,KAAK,IAAIH,OAAOzC,WAAW,CAAC8C;QACxD,CAAC;IACL,CAAC;IACD,OAAOL,OAAOzC,WAAW,CAAC0C;AAC9B;AACA,SAASnB,eAAed,IAAI,EAAEM,UAAU,EAAE;IACtC,MAAMiC,SAASrC,SAASsC,oBAAoB,CAAC,OAAO,CAAC,EAAE;IACvD,MAAMC,cAAcF,OAAOpC,aAAa,CAAC;IACzC,IAAIuC,IAAyB,EAAc;QACvC,IAAI,CAACD,aAAa;YACdE,QAAQC,KAAK,CAAC;YACd;QACJ,CAAC;IACL,CAAC;IACD,MAAMC,YAAYC,OAAOL,YAAYM,OAAO;IAC5C,MAAMC,UAAU,EAAE;IAClB,IAAI,IAAIC,IAAI,GAAGC,IAAIT,YAAYU,sBAAsB,EAAEF,IAAIJ,WAAWI,KAAKC,IAAI,CAACA,KAAK,IAAI,GAAG,KAAK,IAAIA,EAAEC,sBAAsB,KAAK,IAAI,CAAC;QACnI,IAAIC;QACJ,IAAI,CAACF,KAAK,IAAI,GAAG,KAAK,IAAI,CAACE,MAAMF,EAAEG,OAAO,KAAK,IAAI,GAAG,KAAK,IAAID,IAAI1B,WAAW,EAAE,MAAM1B,MAAM;YACxFgD,QAAQzC,IAAI,CAAC2C;QACjB,CAAC;IACL;IACA,MAAMI,UAAUhD,WAAWiD,GAAG,CAACnC,mBAAmBoC,MAAM,CAAC,CAACvB,SAAS;QAC/D,IAAI,IAAIwB,IAAI,GAAGC,MAAMV,QAAQW,MAAM,EAAEF,IAAIC,KAAKD,IAAI;YAC9C,MAAMzB,SAASgB,OAAO,CAACS,EAAE;YACzB,IAAIlE,YAAYyC,QAAQC,SAAS;gBAC7Be,QAAQY,MAAM,CAACH,GAAG;gBAClB,OAAO,KAAK;YAChB,CAAC;QACL;QACA,OAAO,IAAI;IACf;IACAT,QAAQlD,OAAO,CAAC,CAAC+D,IAAI;QACjB,IAAIT;QACJ,OAAO,CAACA,MAAMS,EAAEC,UAAU,KAAK,IAAI,GAAG,KAAK,IAAIV,IAAIW,WAAW,CAACF,EAAE;IACrE;IACAP,QAAQxD,OAAO,CAAC,CAAC+D,IAAItB,OAAOyB,YAAY,CAACH,GAAGpB;IAC5CA,YAAYM,OAAO,GAAG,CAACF,YAAYG,QAAQW,MAAM,GAAGL,QAAQK,MAAM,EAAEM,QAAQ;AAChF;AAEA,IAAI,CAAC,OAAO9E,QAAQE,OAAO,KAAK,cAAe,OAAOF,QAAQE,OAAO,KAAK,YAAYF,QAAQE,OAAO,KAAK,IAAI,KAAM,OAAOF,QAAQE,OAAO,CAAC6E,UAAU,KAAK,aAAa;IACrKjF,OAAOC,cAAc,CAACC,QAAQE,OAAO,EAAE,cAAc;QAAED,OAAO,IAAI;IAAC;IACnEH,OAAOkF,MAAM,CAAChF,QAAQE,OAAO,EAAEF;IAC/BiF,OAAOjF,OAAO,GAAGA,QAAQE,OAAO;AAClC,CAAC,CAED,wCAAwC<01>webpack://./node_modules/next/dist/client/head-manager.js<1F>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = initHeadManager;
exports.isEqualNode = isEqualNode;
exports.DOMAttributeNames = void 0;
function initHeadManager() {
return {
mountedInstances: new Set(),
updateHead: (head)=>{
const tags = {};
head.forEach((h)=>{
if (// If the font tag is loaded only on client navigation
// it won't be inlined. In this case revert to the original behavior
h.type === 'link' && h.props['data-optimized-fonts']) {
if (document.querySelector(`style[data-href="${h.props['data-href']}"]`)) {
return;
} else {
h.props.href = h.props['data-href'];
h.props['data-href'] = undefined;
}
}
const components = tags[h.type] || [];
components.push(h);
tags[h.type] = components;
});
const titleComponent = tags.title ? tags.title[0] : null;
let title = '';
if (titleComponent) {
const { children } = titleComponent.props;
title = typeof children === 'string' ? children : Array.isArray(children) ? children.join('') : '';
}
if (title !== document.title) document.title = title;
[
'meta',
'base',
'link',
'style',
'script'
].forEach((type)=>{
updateElements(type, tags[type] || []);
});
}
};
}
const DOMAttributeNames = {
acceptCharset: 'accept-charset',
className: 'class',
htmlFor: 'for',
httpEquiv: 'http-equiv',
noModule: 'noModule'
};
exports.DOMAttributeNames = DOMAttributeNames;
function reactElementToDOM({ type , props }) {
const el = document.createElement(type);
for(const p in props){
if (!props.hasOwnProperty(p)) continue;
if (p === 'children' || p === 'dangerouslySetInnerHTML') continue;
// we don't render undefined props to the DOM
if (props[p] === undefined) continue;
const attr = DOMAttributeNames[p] || p.toLowerCase();
if (type === 'script' && (attr === 'async' || attr === 'defer' || attr === 'noModule')) {
el[attr] = !!props[p];
} else {
el.setAttribute(attr, props[p]);
}
}
const { children , dangerouslySetInnerHTML } = props;
if (dangerouslySetInnerHTML) {
el.innerHTML = dangerouslySetInnerHTML.__html || '';
} else if (children) {
el.textContent = typeof children === 'string' ? children : Array.isArray(children) ? children.join('') : '';
}
return el;
}
function isEqualNode(oldTag, newTag) {
if (oldTag instanceof HTMLElement && newTag instanceof HTMLElement) {
const nonce = newTag.getAttribute('nonce');
// Only strip the nonce if `oldTag` has had it stripped. An element's nonce attribute will not
// be stripped if there is no content security policy response header that includes a nonce.
if (nonce && !oldTag.getAttribute('nonce')) {
const cloneTag = newTag.cloneNode(true);
cloneTag.setAttribute('nonce', '');
cloneTag.nonce = nonce;
return nonce === oldTag.nonce && oldTag.isEqualNode(cloneTag);
}
}
return oldTag.isEqualNode(newTag);
}
function updateElements(type, components) {
const headEl = document.getElementsByTagName('head')[0];
const headCountEl = headEl.querySelector('meta[name=next-head-count]');
if (process.env.NODE_ENV !== 'production') {
if (!headCountEl) {
console.error('Warning: next-head-count is missing. https://nextjs.org/docs/messages/next-head-count-missing');
return;
}
}
const headCount = Number(headCountEl.content);
const oldTags = [];
for(let i = 0, j = headCountEl.previousElementSibling; i < headCount; i++, j = (j == null ? void 0 : j.previousElementSibling) || null){
var ref;
if ((j == null ? void 0 : (ref = j.tagName) == null ? void 0 : ref.toLowerCase()) === type) {
oldTags.push(j);
}
}
const newTags = components.map(reactElementToDOM).filter((newTag)=>{
for(let k = 0, len = oldTags.length; k < len; k++){
const oldTag = oldTags[k];
if (isEqualNode(oldTag, newTag)) {
oldTags.splice(k, 1);
return false;
}
}
return true;
});
oldTags.forEach((t)=>{
var ref;
return (ref = t.parentNode) == null ? void 0 : ref.removeChild(t);
});
newTags.forEach((t)=>headEl.insertBefore(t, headCountEl));
headCountEl.content = (headCount - oldTags.length + newTags.length).toString();
2023-01-04 02:30:44 +01:00
}
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=head-manager.js.map`TL<><4C><EFBFBD>M<><4D><EFBFBD>2<><32><EFBFBD>N<><4E><EFBFBD>3<><33><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>mountedInstancesO<><4F><EFBFBD><EFBFBD>updateHead<16><><EFBFBD><EFBFBD><EFBFBD>tags<><7F><EFBFBD><EFBFBD>h<16><><EFBFBD><EFBFBD>t<><74><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>O<><4F><EFBFBD><16><><EFBFBD><EFBFBD><07><><EFBFBD> <0A><><EFBFBD><EFBFBD>titleComponent<6E>title<16><><EFBFBD><EFBFBD>n<><6E><EFBFBD>o<><6F><EFBFBD>q<><71><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>acceptCharset<65>className<6D>htmlFor<6F>httpEquiv<69>noModule<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>hasOwnProperty-<2D><><EFBFBD>.<2E><><EFBFBD>/<2F><><EFBFBD>$<24><><EFBFBD>*<2A><><EFBFBD>+<2B><><EFBFBD>,<2C><><EFBFBD><EFBFBD>oldTag<61>newTag<61>HTMLElement4<><34><EFBFBD>/<2F><><EFBFBD><EFBFBD>cloneTag<61>cloneNode<64>headEl<45>getElementsByTagName<6D>headCountEl<16><><EFBFBD><EFBFBD>{<7B><><EFBFBD>n<><6E><EFBFBD><EFBFBD>headCount<6E>Number<16><><EFBFBD><EFBFBD><EFBFBD>oldTags<67>i<EFBFBD>j<EFBFBD>previousElementSibling<16><><EFBFBD><EFBFBD> <09><><EFBFBD><EFBFBD>newTags<14><><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>k<EFBFBD>lenE<><45><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>t<EFBFBD>parentNode<64>removeChild<6C>insertBefore<16><><EFBFBD><EFBFBD><12><><EFBFBD><16><><EFBFBD><EFBFBD>u<><75><EFBFBD><16><><EFBFBD><EFBFBD>n<><6E><EFBFBD><16><><EFBFBD><EFBFBD><00><><EFBFBD>[module.exports = require("next/dist/shared/lib/router/utils/get-asset-path-from-route.js");<3B>external commonjs "next/dist/shared/lib/router/utils/get-asset-path-from-route.js"<1B><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD> <00><10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/SourceMapSource<10>^"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.__unsafeCreateTrustedScriptURL = __unsafeCreateTrustedScriptURL;
/**
* Stores the Trusted Types Policy. Starts as undefined and can be set to null
* if Trusted Types is not supported in the browser.
*/ let policy;
/**
* Getter for the Trusted Types Policy. If it is undefined, it is instantiated
* here or set to null if Trusted Types is not supported in the browser.
*/ function getPolicy() {
if (typeof policy === "undefined" && "undefined" !== "undefined") {
var ref;
policy = ((ref = window.trustedTypes) == null ? void 0 : ref.createPolicy("nextjs", {
createHTML: (input)=>input,
createScript: (input)=>input,
createScriptURL: (input)=>input
})) || null;
}
return policy;
}
function __unsafeCreateTrustedScriptURL(url) {
var ref;
return ((ref = getPolicy()) == null ? void 0 : ref.createScriptURL(url)) || url;
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=trusted-types.js.map
<1E>webpack://./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use!./node_modules/next/dist/client/trusted-types.jsc
{"version":3,"sources":["webpack://./node_modules/next/dist/client/trusted-types.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.__unsafeCreateTrustedScriptURL = __unsafeCreateTrustedScriptURL;\n/**\n * Stores the Trusted Types Policy. Starts as undefined and can be set to null\n * if Trusted Types is not supported in the browser.\n */ let policy;\n/**\n * Getter for the Trusted Types Policy. If it is undefined, it is instantiated\n * here or set to null if Trusted Types is not supported in the browser.\n */ function getPolicy() {\n if (typeof policy === 'undefined' && typeof window !== 'undefined') {\n var ref;\n policy = ((ref = window.trustedTypes) == null ? void 0 : ref.createPolicy('nextjs', {\n createHTML: (input)=>input,\n createScript: (input)=>input,\n createScriptURL: (input)=>input\n })) || null;\n }\n return policy;\n}\nfunction __unsafeCreateTrustedScriptURL(url) {\n var ref;\n return ((ref = getPolicy()) == null ? void 0 : ref.createScriptURL(url)) || url;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=trusted-types.js.map"],"names":["Object","defineProperty","exports","value","__unsafeCreateTrustedScriptURL","policy","getPolicy","ref","window","trustedTypes","createPolicy","createHTML","input","createScript","createScriptURL","url","default","__esModule","assign","module"],"mappings":"AAAA;AACAA,OAAOC,cAAc,CAACC,SAAS,cAAc;IACzCC,OAAO,IAAI;AACf;AACAD,QAAQE,8BAA8B,GAAGA;AACzC;;;CAGC,GAAG,IAAIC;AACR;;;CAGC,GAAG,SAASC,YAAY;IACrB,IAAI,OAAOD,WAAW,eAAe,gBAAkB,aAAa;QAChE,IAAIE;QACJF,SAAS,AAAC,CAAA,AAACE,CAAAA,MAAMC,OAAOC,YAAY,AAAD,KAAM,IAAI,GAAG,KAAK,IAAIF,IAAIG,YAAY,CAAC,UAAU;YAChFC,YAAY,CAACC,QAAQA;YACrBC,cAAc,CAACD,QAAQA;YACvBE,iBAAiB,CAACF,QAAQA;QAC9B,EAAE,AAAD,KAAM,IAAI;IACf,CAAC;IACD,OAAOP;AACX;AACA,SAASD,+BAA+BW,GAAG,EAAE;IACzC,IAAIR;IACJ,OAAO,AAAC,CAAA,AAACA,CAAAA,MAAMD,WAAU,KAAM,IAAI,GAAG,KAAK,IAAIC,IAAIO,eAAe,CAACC,IAAI,AAAD,KAAMA;AAChF;AAEA,IAAI,AAAC,CAAA,OAAOb,QAAQc,OAAO,KAAK,cAAe,OAAOd,QAAQc,OAAO,KAAK,YAAYd,QAAQc,OAAO,KAAK,IAAI,KAAM,OAAOd,QAAQc,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKjB,OAAOC,cAAc,CAACC,QAAQc,OAAO,EAAE,cAAc;QAAEb,OAAO,IAAI;IAAC;IACnEH,OAAOkB,MAAM,CAAChB,QAAQc,OAAO,EAAEd;IAC/BiB,OAAOjB,OAAO,GAAGA,QAAQc,OAAO;AAClC,CAAC,CAED,yCAAyC","file":"x"}f :NNQvA/7<00><18>Object.defineProperty(exports, "__esModule", (<18>))<18>exports.__unsafeCreateTrustedScriptURL<18>{ var ref; }<16><><EFBFBD><EFBFBD>V
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.__unsafeCreateTrustedScriptURL = __unsafeCreateTrustedScriptURL;
/**
* Stores the Trusted Types Policy. Starts as undefined and can be set to null
* if Trusted Types is not supported in the browser.
*/ let policy;
/**
* Getter for the Trusted Types Policy. If it is undefined, it is instantiated
* here or set to null if Trusted Types is not supported in the browser.
*/ function getPolicy() {
if (typeof policy === "undefined" && "undefined" !== "undefined") { var ref; }
return policy;
}
function __unsafeCreateTrustedScriptURL(url) {
var ref;
return ((ref = getPolicy()) == null ? void 0 : ref.createScriptURL(url)) || url;
}
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
Object.defineProperty(exports.default, "__esModule", {
value: true
});
Object.assign(exports.default, exports);
module.exports = exports.default;
} //# sourceMappingURL=trusted-types.js.map
<00><><EFBFBD><03><><EFBFBD><07><><EFBFBD><03>xjAAAa;AACbA,8CAA6C;IACzCG,OAAO,IAAI;AACf,CAAC,EAAC;AACFD,sCAAsC,GAAGE;AACzC;;;CAGC,GAAG,IAAIC;AACR;;;CAGC,GAAG,SAASC,YAAY;IACrB,IAAI,OAAOD,WAAW,eAAe,gBAAkB,aAAa,YAOnE;IACD,OAAOA;AACX;AACA,SAASD,+BAA+BW,GAAG,EAAE;IACzC,IAAIR;IACJ,OAAO,CAAC,CAACA,MAAMD,WAAU,KAAM,IAAI,GAAG,KAAK,IAAIC,IAAIO,eAAe,CAACC,IAAI,KAAKA;AAChF;AAEA,IAAI,CAAC,OAAOb,QAAQc,OAAO,KAAK,cAAe,OAAOd,QAAQc,OAAO,KAAK,YAAYd,QAAQc,OAAO,KAAK,IAAI,KAAM,OAAOd,QAAQc,OAAO,CAACC,UAAU,KAAK,aAAa;IACrKjB,OAAOC,cAAc,CAACC,QAAQc,OAAO,EAAE,cAAc;QAAEb,OAAO,IAAI;IAAC;IACnEH,OAAOkB,MAAM,CAAChB,QAAQc,OAAO,EAAEd;IAC/BiB,OAAOjB,OAAO,GAAGA,QAAQc,OAAO;AAClC,CAAC,CAED,yCAAyC<01>webpack://./node_modules/next/dist/client/trusted-types.jsQ"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.__unsafeCreateTrustedScriptURL = __unsafeCreateTrustedScriptURL;
/**
* Stores the Trusted Types Policy. Starts as undefined and can be set to null
* if Trusted Types is not supported in the browser.
*/ let policy;
/**
* Getter for the Trusted Types Policy. If it is undefined, it is instantiated
* here or set to null if Trusted Types is not supported in the browser.
*/ function getPolicy() {
if (typeof policy === 'undefined' && typeof window !== 'undefined') {
var ref;
policy = ((ref = window.trustedTypes) == null ? void 0 : ref.createPolicy('nextjs', {
createHTML: (input)=>input,
createScript: (input)=>input,
createScriptURL: (input)=>input
})) || null;
}
return policy;
}
function __unsafeCreateTrustedScriptURL(url) {
var ref;
return ((ref = getPolicy()) == null ? void 0 : ref.createScriptURL(url)) || url;
}
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=trusted-types.js.map`<1C><><EFBFBD><1D><><EFBFBD><02><><EFBFBD><1E><><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><><7F><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>trustedTypes<65>createPolicy<63>createHTML<16><><EFBFBD><EFBFBD><EFBFBD>createScript<70>createScriptURL<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>\<5C><><EFBFBD><16><><EFBFBD><EFBFBD>U<><55><EFBFBD><16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>8module.exports = require("next/dist/compiled/react-is");<3B>external commonjs "next/dist/compiled/react-is"<02><><EFBFBD>