feat(blog): add file-based blog with dynamic slugs, MDX content and layout shell

- Introduced blog routing using Next.js App Router
- Implemented dynamic [slug] pages for blog posts
- Added MDX-based content loading via lib/posts
- Integrated shared TopBar layout with navigation
- Established clear content, lib and component separation
This commit is contained in:
PascalSchattenburg
2026-01-22 14:14:15 +01:00
parent b717952234
commit d147843c76
10412 changed files with 2475583 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
export type ActionRevalidationKind = 0 | 1 | 2;
export declare const ActionDidNotRevalidate = 0;
export declare const ActionDidRevalidateStaticAndDynamic = 1;
export declare const ActionDidRevalidateDynamicOnly = 2;

View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
ActionDidNotRevalidate: null,
ActionDidRevalidateDynamicOnly: null,
ActionDidRevalidateStaticAndDynamic: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
ActionDidNotRevalidate: function() {
return ActionDidNotRevalidate;
},
ActionDidRevalidateDynamicOnly: function() {
return ActionDidRevalidateDynamicOnly;
},
ActionDidRevalidateStaticAndDynamic: function() {
return ActionDidRevalidateStaticAndDynamic;
}
});
const ActionDidNotRevalidate = 0;
const ActionDidRevalidateStaticAndDynamic = 1;
const ActionDidRevalidateDynamicOnly = 2;
//# sourceMappingURL=action-revalidation-kind.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/action-revalidation-kind.ts"],"sourcesContent":["export type ActionRevalidationKind = 0 | 1 | 2\n\nexport const ActionDidNotRevalidate = 0\nexport const ActionDidRevalidateStaticAndDynamic = 1\nexport const ActionDidRevalidateDynamicOnly = 2\n"],"names":["ActionDidNotRevalidate","ActionDidRevalidateDynamicOnly","ActionDidRevalidateStaticAndDynamic"],"mappings":";;;;;;;;;;;;;;;;IAEaA,sBAAsB;eAAtBA;;IAEAC,8BAA8B;eAA9BA;;IADAC,mCAAmC;eAAnCA;;;AADN,MAAMF,yBAAyB;AAC/B,MAAME,sCAAsC;AAC5C,MAAMD,iCAAiC","ignoreList":[0]}

View File

@@ -0,0 +1,15 @@
import type React from 'react';
import type { JSX } from 'react';
import type { LoadableGeneratedOptions, DynamicOptionsLoadingProps, Loader, LoaderComponent } from './lazy-dynamic/types';
export { type LoadableGeneratedOptions, type DynamicOptionsLoadingProps, type Loader, type LoaderComponent, };
export type DynamicOptions<P = {}> = LoadableGeneratedOptions & {
loading?: () => JSX.Element | null;
loader?: Loader<P>;
loadableGenerated?: LoadableGeneratedOptions;
modules?: string[];
ssr?: boolean;
};
export type LoadableOptions<P = {}> = DynamicOptions<P>;
export type LoadableFn<P = {}> = (opts: LoadableOptions<P>) => React.ComponentType<P>;
export type LoadableComponent<P = {}> = React.ComponentType<P>;
export default function dynamic<P = {}>(dynamicOptions: DynamicOptions<P> | Loader<P>, options?: DynamicOptions<P>): React.ComponentType<P>;

View File

@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return dynamic;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _loadable = /*#__PURE__*/ _interop_require_default._(require("./lazy-dynamic/loadable"));
function dynamic(dynamicOptions, options) {
const loadableOptions = {};
if (typeof dynamicOptions === 'function') {
loadableOptions.loader = dynamicOptions;
}
const mergedOptions = {
...loadableOptions,
...options
};
return (0, _loadable.default)({
...mergedOptions,
modules: mergedOptions.loadableGenerated?.modules
});
}
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=app-dynamic.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/app-dynamic.tsx"],"sourcesContent":["import type React from 'react'\nimport type { JSX } from 'react'\nimport Loadable from './lazy-dynamic/loadable'\n\nimport type {\n LoadableGeneratedOptions,\n DynamicOptionsLoadingProps,\n Loader,\n LoaderComponent,\n} from './lazy-dynamic/types'\n\nexport {\n type LoadableGeneratedOptions,\n type DynamicOptionsLoadingProps,\n type Loader,\n type LoaderComponent,\n}\n\nexport type DynamicOptions<P = {}> = LoadableGeneratedOptions & {\n loading?: () => JSX.Element | null\n loader?: Loader<P>\n loadableGenerated?: LoadableGeneratedOptions\n modules?: string[]\n ssr?: boolean\n}\n\nexport type LoadableOptions<P = {}> = DynamicOptions<P>\n\nexport type LoadableFn<P = {}> = (\n opts: LoadableOptions<P>\n) => React.ComponentType<P>\n\nexport type LoadableComponent<P = {}> = React.ComponentType<P>\n\nexport default function dynamic<P = {}>(\n dynamicOptions: DynamicOptions<P> | Loader<P>,\n options?: DynamicOptions<P>\n): React.ComponentType<P> {\n const loadableOptions: LoadableOptions<P> = {}\n\n if (typeof dynamicOptions === 'function') {\n loadableOptions.loader = dynamicOptions\n }\n\n const mergedOptions = {\n ...loadableOptions,\n ...options,\n }\n\n return Loadable({\n ...mergedOptions,\n modules: mergedOptions.loadableGenerated?.modules,\n })\n}\n"],"names":["dynamic","dynamicOptions","options","loadableOptions","loader","mergedOptions","Loadable","modules","loadableGenerated"],"mappings":";;;;+BAkCA;;;eAAwBA;;;;mEAhCH;AAgCN,SAASA,QACtBC,cAA6C,EAC7CC,OAA2B;IAE3B,MAAMC,kBAAsC,CAAC;IAE7C,IAAI,OAAOF,mBAAmB,YAAY;QACxCE,gBAAgBC,MAAM,GAAGH;IAC3B;IAEA,MAAMI,gBAAgB;QACpB,GAAGF,eAAe;QAClB,GAAGD,OAAO;IACZ;IAEA,OAAOI,IAAAA,iBAAQ,EAAC;QACd,GAAGD,aAAa;QAChBE,SAASF,cAAcG,iBAAiB,EAAED;IAC5C;AACF","ignoreList":[0]}

View File

@@ -0,0 +1,57 @@
import type { FocusAndScrollRef, PrefetchKind } from '../../client/components/router-reducer/router-reducer-types';
import type { Params } from '../../server/request/params';
import type { FlightRouterState, FlightSegmentPath, CacheNode } from './app-router-types';
import React from 'react';
export interface NavigateOptions {
scroll?: boolean;
}
export interface PrefetchOptions {
kind: PrefetchKind;
onInvalidate?: () => void;
}
export interface AppRouterInstance {
/**
* Navigate to the previous history entry.
*/
back(): void;
/**
* Navigate to the next history entry.
*/
forward(): void;
/**
* Refresh the current page.
*/
refresh(): void;
/**
* Navigate to the provided href.
* Pushes a new history entry.
*/
push(href: string, options?: NavigateOptions): void;
/**
* Navigate to the provided href.
* Replaces the current history entry.
*/
replace(href: string, options?: NavigateOptions): void;
/**
* Prefetch the provided href.
*/
prefetch(href: string, options?: PrefetchOptions): void;
}
export declare const AppRouterContext: React.Context<AppRouterInstance | null>;
export declare const LayoutRouterContext: React.Context<{
parentTree: FlightRouterState;
parentCacheNode: CacheNode;
parentSegmentPath: FlightSegmentPath | null;
parentParams: Params;
debugNameContext: string;
url: string;
isActive: boolean;
} | null>;
export declare const GlobalLayoutRouterContext: React.Context<{
tree: FlightRouterState;
focusAndScrollRef: FocusAndScrollRef;
nextUrl: string | null;
previousNextUrl: string | null;
}>;
export declare const TemplateContext: React.Context<React.ReactNode>;
export declare const MissingSlotContext: React.Context<Set<string>>;

View File

@@ -0,0 +1,50 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
AppRouterContext: null,
GlobalLayoutRouterContext: null,
LayoutRouterContext: null,
MissingSlotContext: null,
TemplateContext: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
AppRouterContext: function() {
return AppRouterContext;
},
GlobalLayoutRouterContext: function() {
return GlobalLayoutRouterContext;
},
LayoutRouterContext: function() {
return LayoutRouterContext;
},
MissingSlotContext: function() {
return MissingSlotContext;
},
TemplateContext: function() {
return TemplateContext;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
const AppRouterContext = _react.default.createContext(null);
const LayoutRouterContext = _react.default.createContext(null);
const GlobalLayoutRouterContext = _react.default.createContext(null);
const TemplateContext = _react.default.createContext(null);
if (process.env.NODE_ENV !== 'production') {
AppRouterContext.displayName = 'AppRouterContext';
LayoutRouterContext.displayName = 'LayoutRouterContext';
GlobalLayoutRouterContext.displayName = 'GlobalLayoutRouterContext';
TemplateContext.displayName = 'TemplateContext';
}
const MissingSlotContext = _react.default.createContext(new Set());
//# sourceMappingURL=app-router-context.shared-runtime.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/app-router-context.shared-runtime.ts"],"sourcesContent":["'use client'\n\nimport type {\n FocusAndScrollRef,\n PrefetchKind,\n} from '../../client/components/router-reducer/router-reducer-types'\nimport type { Params } from '../../server/request/params'\nimport type {\n FlightRouterState,\n FlightSegmentPath,\n CacheNode,\n} from './app-router-types'\nimport React from 'react'\n\nexport interface NavigateOptions {\n scroll?: boolean\n}\n\nexport interface PrefetchOptions {\n kind: PrefetchKind\n onInvalidate?: () => void\n}\n\nexport interface AppRouterInstance {\n /**\n * Navigate to the previous history entry.\n */\n back(): void\n /**\n * Navigate to the next history entry.\n */\n forward(): void\n /**\n * Refresh the current page.\n */\n refresh(): void\n /**\n * Refresh the current page. Use in development only.\n * @internal\n */\n hmrRefresh(): void\n /**\n * Navigate to the provided href.\n * Pushes a new history entry.\n */\n push(href: string, options?: NavigateOptions): void\n /**\n * Navigate to the provided href.\n * Replaces the current history entry.\n */\n replace(href: string, options?: NavigateOptions): void\n /**\n * Prefetch the provided href.\n */\n prefetch(href: string, options?: PrefetchOptions): void\n}\n\nexport const AppRouterContext = React.createContext<AppRouterInstance | null>(\n null\n)\nexport const LayoutRouterContext = React.createContext<{\n parentTree: FlightRouterState\n parentCacheNode: CacheNode\n parentSegmentPath: FlightSegmentPath | null\n parentParams: Params\n debugNameContext: string\n url: string\n isActive: boolean\n} | null>(null)\n\nexport const GlobalLayoutRouterContext = React.createContext<{\n tree: FlightRouterState\n focusAndScrollRef: FocusAndScrollRef\n nextUrl: string | null\n previousNextUrl: string | null\n}>(null as any)\n\nexport const TemplateContext = React.createContext<React.ReactNode>(null as any)\n\nif (process.env.NODE_ENV !== 'production') {\n AppRouterContext.displayName = 'AppRouterContext'\n LayoutRouterContext.displayName = 'LayoutRouterContext'\n GlobalLayoutRouterContext.displayName = 'GlobalLayoutRouterContext'\n TemplateContext.displayName = 'TemplateContext'\n}\n\nexport const MissingSlotContext = React.createContext<Set<string>>(new Set())\n"],"names":["AppRouterContext","GlobalLayoutRouterContext","LayoutRouterContext","MissingSlotContext","TemplateContext","React","createContext","process","env","NODE_ENV","displayName","Set"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;IAyDaA,gBAAgB;eAAhBA;;IAaAC,yBAAyB;eAAzBA;;IAVAC,mBAAmB;eAAnBA;;IA0BAC,kBAAkB;eAAlBA;;IATAC,eAAe;eAAfA;;;;gEAjEK;AA6CX,MAAMJ,mBAAmBK,cAAK,CAACC,aAAa,CACjD;AAEK,MAAMJ,sBAAsBG,cAAK,CAACC,aAAa,CAQ5C;AAEH,MAAML,4BAA4BI,cAAK,CAACC,aAAa,CAKzD;AAEI,MAAMF,kBAAkBC,cAAK,CAACC,aAAa,CAAkB;AAEpE,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACzCT,iBAAiBU,WAAW,GAAG;IAC/BR,oBAAoBQ,WAAW,GAAG;IAClCT,0BAA0BS,WAAW,GAAG;IACxCN,gBAAgBM,WAAW,GAAG;AAChC;AAEO,MAAMP,qBAAqBE,cAAK,CAACC,aAAa,CAAc,IAAIK","ignoreList":[0]}

View File

@@ -0,0 +1,194 @@
/**
* App Router types - Client-safe types for the Next.js App Router
*
* This file contains type definitions that can be safely imported
* by both client-side and server-side code without circular dependencies.
*/
import type React from 'react';
export type LoadingModuleData = [React.JSX.Element, React.ReactNode, React.ReactNode] | null;
/** viewport metadata node */
export type HeadData = React.ReactNode;
export type ChildSegmentMap = Map<string, CacheNode>;
/**
* Cache node used in app-router / layout-router.
*/
export type CacheNode = {
/**
* When rsc is not null, it represents the RSC data for the
* corresponding segment.
*
* `null` is a valid React Node but because segment data is always a
* <LayoutRouter> component, we can use `null` to represent empty. When it is
* null, it represents missing data, and rendering should suspend.
*/
rsc: React.ReactNode;
/**
* Represents a static version of the segment that can be shown immediately,
* and may or may not contain dynamic holes. It's prefetched before a
* navigation occurs.
*
* During rendering, we will choose whether to render `rsc` or `prefetchRsc`
* with `useDeferredValue`. As with the `rsc` field, a value of `null` means
* no value was provided. In this case, the LayoutRouter will go straight to
* rendering the `rsc` value; if that one is also missing, it will suspend and
* trigger a lazy fetch.
*/
prefetchRsc: React.ReactNode;
prefetchHead: HeadData | null;
head: HeadData;
loading: LoadingModuleData | Promise<LoadingModuleData>;
parallelRoutes: Map<string, ChildSegmentMap>;
/**
* The timestamp of the navigation that last updated the CacheNode's data. If
* a CacheNode is reused from a previous navigation, this value is not
* updated. Used to track the staleness of the data.
*/
navigatedAt: number;
};
export type DynamicParamTypes = 'catchall' | 'catchall-intercepted-(..)(..)' | 'catchall-intercepted-(.)' | 'catchall-intercepted-(..)' | 'catchall-intercepted-(...)' | 'optional-catchall' | 'dynamic' | 'dynamic-intercepted-(..)(..)' | 'dynamic-intercepted-(.)' | 'dynamic-intercepted-(..)' | 'dynamic-intercepted-(...)';
export type DynamicParamTypesShort = 'c' | 'ci(..)(..)' | 'ci(.)' | 'ci(..)' | 'ci(...)' | 'oc' | 'd' | 'di(..)(..)' | 'di(.)' | 'di(..)' | 'di(...)';
export type Segment = string | [
paramName: string,
paramCacheKey: string,
dynamicParamType: DynamicParamTypesShort
];
/**
* Router state
*/
export type FlightRouterState = [
segment: Segment,
parallelRoutes: {
[parallelRouterKey: string]: FlightRouterState;
},
url?: string | null,
/**
* "refresh" and "refetch", despite being similarly named, have different
* semantics:
* - "refetch" is used during a request to inform the server where rendering
* should start from.
*
* - "refresh" is used by the client to mark that a segment should re-fetch the
* data from the server for the current segment. It uses the "url" property
* above to determine where to fetch from.
*
* - "inside-shared-layout" is used during a prefetch request to inform the
* server that even if the segment matches, it should be treated as if it's
* within the "new" part of a navigation — inside the shared layout. If
* the segment doesn't match, then it has no effect, since it would be
* treated as new regardless. If it does match, though, the server does not
* need to render it, because the client already has it.
*
* - "metadata-only" instructs the server to skip rendering the segments and
* only send the head data.
*
* A bit confusing, but that's because it has only one extremely narrow use
* case — during a non-PPR prefetch, the server uses it to find the first
* loading boundary beneath a shared layout.
*
* TODO: We should rethink the protocol for dynamic requests. It might not
* make sense for the client to send a FlightRouterState, since this type is
* overloaded with concerns.
*/
refresh?: 'refetch' | 'refresh' | 'inside-shared-layout' | 'metadata-only' | null,
isRootLayout?: boolean,
/**
* Only present when responding to a tree prefetch request. Indicates whether
* there is a loading boundary somewhere in the tree. The client cache uses
* this to determine if it can skip the data prefetch request.
*/
hasLoadingBoundary?: HasLoadingBoundary
];
export declare const enum HasLoadingBoundary {
SegmentHasLoadingBoundary = 1,
SubtreeHasLoadingBoundary = 2,
SubtreeHasNoLoadingBoundary = 3
}
/**
* Individual Flight response path
*/
export type FlightSegmentPath = any[] | [
segment: Segment,
parallelRouterKey: string,
segment: Segment,
parallelRouterKey: string,
segment: Segment,
parallelRouterKey: string
];
/**
* Represents a tree of segments and the Flight data (i.e. React nodes) that
* correspond to each one. The tree is isomorphic to the FlightRouterState;
* however in the future we want to be able to fetch arbitrary partial segments
* without having to fetch all its children. So this response format will
* likely change.
*/
export type CacheNodeSeedData = [
node: React.ReactNode | null,
parallelRoutes: {
[parallelRouterKey: string]: CacheNodeSeedData | null;
},
loading: LoadingModuleData | Promise<LoadingModuleData>,
isPartial: boolean,
/** TODO: this doesn't feel like it belongs here, because it's only used during build, in `collectSegmentData` */
hasRuntimePrefetch: boolean
];
export type FlightDataSegment = [
Segment,
FlightRouterState,
CacheNodeSeedData | null,
HeadData,
boolean
];
export type FlightDataPath = any[] | [
...FlightSegmentPath[],
...FlightDataSegment
];
/**
* The Flight response data
*/
export type FlightData = Array<FlightDataPath> | string;
export type ActionResult = Promise<any>;
export type InitialRSCPayload = {
/** buildId */
b: string;
/** initialCanonicalUrlParts */
c: string[];
/** initialRenderedSearch */
q: string;
/** couldBeIntercepted */
i: boolean;
/** initialFlightData */
f: FlightDataPath[];
/** missingSlots */
m: Set<string> | undefined;
/** GlobalError */
G: [React.ComponentType<any>, React.ReactNode | undefined];
/** prerendered */
S: boolean;
};
export type NavigationFlightResponse = {
/** buildId */
b: string;
/** flightData */
f: FlightData;
/** prerendered */
S: boolean;
/** renderedSearch */
q: string;
/** couldBeIntercepted */
i: boolean;
/** runtimePrefetch - [isPartial, staleTime]. Only present in runtime prefetch responses. */
rp?: [boolean, number];
};
export type ActionFlightResponse = {
/** actionResult */
a: ActionResult;
/** buildId */
b: string;
/** flightData */
f: FlightData;
/** renderedSearch */
q: string;
/** couldBeIntercepted */
i: boolean;
};
export type RSCPayload = InitialRSCPayload | NavigationFlightResponse | ActionFlightResponse;

View File

@@ -0,0 +1,27 @@
/**
* App Router types - Client-safe types for the Next.js App Router
*
* This file contains type definitions that can be safely imported
* by both client-side and server-side code without circular dependencies.
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "HasLoadingBoundary", {
enumerable: true,
get: function() {
return HasLoadingBoundary;
}
});
var HasLoadingBoundary = /*#__PURE__*/ function(HasLoadingBoundary) {
// There is a loading boundary in this particular segment
HasLoadingBoundary[HasLoadingBoundary["SegmentHasLoadingBoundary"] = 1] = "SegmentHasLoadingBoundary";
// There is a loading boundary somewhere in the subtree (but not in
// this segment)
HasLoadingBoundary[HasLoadingBoundary["SubtreeHasLoadingBoundary"] = 2] = "SubtreeHasLoadingBoundary";
// There is no loading boundary in this segment or any of its descendants
HasLoadingBoundary[HasLoadingBoundary["SubtreeHasNoLoadingBoundary"] = 3] = "SubtreeHasNoLoadingBoundary";
return HasLoadingBoundary;
}({});
//# sourceMappingURL=app-router-types.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,20 @@
export declare class BloomFilter {
numItems: number;
errorRate: number;
numBits: number;
numHashes: number;
bitArray: number[];
constructor(numItems: number, errorRate?: number);
static from(items: string[], errorRate?: number): BloomFilter;
export(): {
numItems: number;
errorRate: number;
numBits: number;
numHashes: number;
bitArray: number[];
};
import(data: ReturnType<(typeof this)['export']>): void;
add(item: string): void;
contains(item: string): boolean;
getHashValues(item: string): number[];
}

View File

@@ -0,0 +1,85 @@
// minimal implementation MurmurHash2 hash function
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "BloomFilter", {
enumerable: true,
get: function() {
return BloomFilter;
}
});
function murmurhash2(str) {
let h = 0;
for(let i = 0; i < str.length; i++){
const c = str.charCodeAt(i);
h = Math.imul(h ^ c, 0x5bd1e995);
h ^= h >>> 13;
h = Math.imul(h, 0x5bd1e995);
}
return h >>> 0;
}
// default to 0.01% error rate as the filter compresses very well
const DEFAULT_ERROR_RATE = 0.0001;
class BloomFilter {
constructor(numItems, errorRate = DEFAULT_ERROR_RATE){
this.numItems = numItems;
this.errorRate = errorRate;
this.numBits = Math.ceil(-(numItems * Math.log(errorRate)) / (Math.log(2) * Math.log(2)));
this.numHashes = Math.ceil(this.numBits / numItems * Math.log(2));
this.bitArray = new Array(this.numBits).fill(0);
}
static from(items, errorRate = DEFAULT_ERROR_RATE) {
const filter = new BloomFilter(items.length, errorRate);
for (const item of items){
filter.add(item);
}
return filter;
}
export() {
const data = {
numItems: this.numItems,
errorRate: this.errorRate,
numBits: this.numBits,
numHashes: this.numHashes,
bitArray: this.bitArray
};
if (process.env.NEXT_RUNTIME === 'nodejs') {
if (this.errorRate < DEFAULT_ERROR_RATE) {
const filterData = JSON.stringify(data);
const gzipSize = require('next/dist/compiled/gzip-size').sync(filterData);
if (gzipSize > 1024) {
console.warn(`Creating filter with error rate less than 0.1% (0.001) can increase the size dramatically proceed with caution. Received error rate ${this.errorRate} resulted in size ${filterData.length} bytes, ${gzipSize} bytes (gzip)`);
}
}
}
return data;
}
import(data) {
this.numItems = data.numItems;
this.errorRate = data.errorRate;
this.numBits = data.numBits;
this.numHashes = data.numHashes;
this.bitArray = data.bitArray;
}
add(item) {
const hashValues = this.getHashValues(item);
hashValues.forEach((hash)=>{
this.bitArray[hash] = 1;
});
}
contains(item) {
const hashValues = this.getHashValues(item);
return hashValues.every((hash)=>this.bitArray[hash]);
}
getHashValues(item) {
const hashValues = [];
for(let i = 1; i <= this.numHashes; i++){
const hash = murmurhash2(`${item}${i}`) % this.numBits;
hashValues.push(hash);
}
return hashValues;
}
}
//# sourceMappingURL=bloom-filter.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,121 @@
import MODERN_BROWSERSLIST_TARGET from './modern-browserslist-target';
export { MODERN_BROWSERSLIST_TARGET };
export type ValueOf<T> = Required<T>[keyof T];
export declare const COMPILER_NAMES: {
readonly client: "client";
readonly server: "server";
readonly edgeServer: "edge-server";
};
export type CompilerNameValues = ValueOf<typeof COMPILER_NAMES>;
export declare const COMPILER_INDEXES: {
[compilerKey in CompilerNameValues]: number;
};
export { UNDERSCORE_NOT_FOUND_ROUTE, UNDERSCORE_NOT_FOUND_ROUTE_ENTRY, UNDERSCORE_GLOBAL_ERROR_ROUTE, UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY, } from './entry-constants';
export declare enum AdapterOutputType {
/**
* `PAGES` represents all the React pages that are under `pages/`.
*/
PAGES = "PAGES",
/**
* `PAGES_API` represents all the API routes under `pages/api/`.
*/
PAGES_API = "PAGES_API",
/**
* `APP_PAGE` represents all the React pages that are under `app/` with the
* filename of `page.{j,t}s{,x}`.
*/
APP_PAGE = "APP_PAGE",
/**
* `APP_ROUTE` represents all the API routes and metadata routes that are under `app/` with the
* filename of `route.{j,t}s{,x}`.
*/
APP_ROUTE = "APP_ROUTE",
/**
* `PRERENDER` represents an ISR enabled route that might
* have a seeded cache entry or fallback generated during build
*/
PRERENDER = "PRERENDER",
/**
* `STATIC_FILE` represents a static file (ie /_next/static)
*/
STATIC_FILE = "STATIC_FILE",
/**
* `MIDDLEWARE` represents the middleware output if present
*/
MIDDLEWARE = "MIDDLEWARE"
}
export declare const PHASE_EXPORT = "phase-export";
export declare const PHASE_ANALYZE = "phase-analyze";
export declare const PHASE_PRODUCTION_BUILD = "phase-production-build";
export declare const PHASE_PRODUCTION_SERVER = "phase-production-server";
export declare const PHASE_DEVELOPMENT_SERVER = "phase-development-server";
export declare const PHASE_TEST = "phase-test";
export declare const PHASE_INFO = "phase-info";
export type PHASE_TYPE = typeof PHASE_INFO | typeof PHASE_TEST | typeof PHASE_EXPORT | typeof PHASE_ANALYZE | typeof PHASE_PRODUCTION_BUILD | typeof PHASE_PRODUCTION_SERVER | typeof PHASE_DEVELOPMENT_SERVER;
export declare const PAGES_MANIFEST = "pages-manifest.json";
export declare const WEBPACK_STATS = "webpack-stats.json";
export declare const APP_PATHS_MANIFEST = "app-paths-manifest.json";
export declare const APP_PATH_ROUTES_MANIFEST = "app-path-routes-manifest.json";
export declare const BUILD_MANIFEST = "build-manifest.json";
export declare const FUNCTIONS_CONFIG_MANIFEST = "functions-config-manifest.json";
export declare const SUBRESOURCE_INTEGRITY_MANIFEST = "subresource-integrity-manifest";
export declare const NEXT_FONT_MANIFEST = "next-font-manifest";
export declare const EXPORT_MARKER = "export-marker.json";
export declare const EXPORT_DETAIL = "export-detail.json";
export declare const PRERENDER_MANIFEST = "prerender-manifest.json";
export declare const ROUTES_MANIFEST = "routes-manifest.json";
export declare const IMAGES_MANIFEST = "images-manifest.json";
export declare const SERVER_FILES_MANIFEST = "required-server-files";
export declare const DEV_CLIENT_PAGES_MANIFEST = "_devPagesManifest.json";
export declare const MIDDLEWARE_MANIFEST = "middleware-manifest.json";
export declare const TURBOPACK_CLIENT_MIDDLEWARE_MANIFEST = "_clientMiddlewareManifest.json";
export declare const TURBOPACK_CLIENT_BUILD_MANIFEST = "client-build-manifest.json";
export declare const DEV_CLIENT_MIDDLEWARE_MANIFEST = "_devMiddlewareManifest.json";
export declare const REACT_LOADABLE_MANIFEST = "react-loadable-manifest.json";
export declare const SERVER_DIRECTORY = "server";
export declare const CONFIG_FILES: string[];
export declare const BUILD_ID_FILE = "BUILD_ID";
export declare const BLOCKED_PAGES: string[];
export declare const CLIENT_PUBLIC_FILES_PATH = "public";
export declare const CLIENT_STATIC_FILES_PATH = "static";
export declare const STRING_LITERAL_DROP_BUNDLE = "__NEXT_DROP_CLIENT_FILE__";
export declare const NEXT_BUILTIN_DOCUMENT = "__NEXT_BUILTIN_DOCUMENT__";
export declare const BARREL_OPTIMIZATION_PREFIX = "__barrel_optimize__";
export declare const CLIENT_REFERENCE_MANIFEST = "client-reference-manifest";
export declare const SERVER_REFERENCE_MANIFEST = "server-reference-manifest";
export declare const MIDDLEWARE_BUILD_MANIFEST = "middleware-build-manifest";
export declare const MIDDLEWARE_REACT_LOADABLE_MANIFEST = "middleware-react-loadable-manifest";
export declare const INTERCEPTION_ROUTE_REWRITE_MANIFEST = "interception-route-rewrite-manifest";
export declare const DYNAMIC_CSS_MANIFEST = "dynamic-css-manifest";
export declare const CLIENT_STATIC_FILES_RUNTIME_MAIN = "main";
export declare const CLIENT_STATIC_FILES_RUNTIME_MAIN_APP = "main-app";
export declare const APP_CLIENT_INTERNALS = "app-pages-internals";
export declare const CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH = "react-refresh";
export declare const CLIENT_STATIC_FILES_RUNTIME_WEBPACK = "webpack";
export declare const CLIENT_STATIC_FILES_RUNTIME_POLYFILLS = "polyfills";
export declare const CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL: unique symbol;
export declare const DEFAULT_RUNTIME_WEBPACK = "webpack-runtime";
export declare const EDGE_RUNTIME_WEBPACK = "edge-runtime-webpack";
export declare const STATIC_PROPS_ID = "__N_SSG";
export declare const SERVER_PROPS_ID = "__N_SSP";
export declare const DEFAULT_SERIF_FONT: {
name: string;
xAvgCharWidth: number;
azAvgWidth: number;
unitsPerEm: number;
};
export declare const DEFAULT_SANS_SERIF_FONT: {
name: string;
xAvgCharWidth: number;
azAvgWidth: number;
unitsPerEm: number;
};
export declare const STATIC_STATUS_PAGES: string[];
export declare const TRACE_OUTPUT_VERSION = 1;
export declare const TURBO_TRACE_DEFAULT_MEMORY_LIMIT = 6000;
export declare const RSC_MODULE_TYPES: {
readonly client: "client";
readonly server: "server";
};
export declare const EDGE_UNSUPPORTED_NODE_APIS: string[];
export declare const SYSTEM_ENTRYPOINTS: Set<string>;

View File

@@ -0,0 +1,448 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
APP_CLIENT_INTERNALS: null,
APP_PATHS_MANIFEST: null,
APP_PATH_ROUTES_MANIFEST: null,
AdapterOutputType: null,
BARREL_OPTIMIZATION_PREFIX: null,
BLOCKED_PAGES: null,
BUILD_ID_FILE: null,
BUILD_MANIFEST: null,
CLIENT_PUBLIC_FILES_PATH: null,
CLIENT_REFERENCE_MANIFEST: null,
CLIENT_STATIC_FILES_PATH: null,
CLIENT_STATIC_FILES_RUNTIME_MAIN: null,
CLIENT_STATIC_FILES_RUNTIME_MAIN_APP: null,
CLIENT_STATIC_FILES_RUNTIME_POLYFILLS: null,
CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL: null,
CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH: null,
CLIENT_STATIC_FILES_RUNTIME_WEBPACK: null,
COMPILER_INDEXES: null,
COMPILER_NAMES: null,
CONFIG_FILES: null,
DEFAULT_RUNTIME_WEBPACK: null,
DEFAULT_SANS_SERIF_FONT: null,
DEFAULT_SERIF_FONT: null,
DEV_CLIENT_MIDDLEWARE_MANIFEST: null,
DEV_CLIENT_PAGES_MANIFEST: null,
DYNAMIC_CSS_MANIFEST: null,
EDGE_RUNTIME_WEBPACK: null,
EDGE_UNSUPPORTED_NODE_APIS: null,
EXPORT_DETAIL: null,
EXPORT_MARKER: null,
FUNCTIONS_CONFIG_MANIFEST: null,
IMAGES_MANIFEST: null,
INTERCEPTION_ROUTE_REWRITE_MANIFEST: null,
MIDDLEWARE_BUILD_MANIFEST: null,
MIDDLEWARE_MANIFEST: null,
MIDDLEWARE_REACT_LOADABLE_MANIFEST: null,
MODERN_BROWSERSLIST_TARGET: null,
NEXT_BUILTIN_DOCUMENT: null,
NEXT_FONT_MANIFEST: null,
PAGES_MANIFEST: null,
PHASE_ANALYZE: null,
PHASE_DEVELOPMENT_SERVER: null,
PHASE_EXPORT: null,
PHASE_INFO: null,
PHASE_PRODUCTION_BUILD: null,
PHASE_PRODUCTION_SERVER: null,
PHASE_TEST: null,
PRERENDER_MANIFEST: null,
REACT_LOADABLE_MANIFEST: null,
ROUTES_MANIFEST: null,
RSC_MODULE_TYPES: null,
SERVER_DIRECTORY: null,
SERVER_FILES_MANIFEST: null,
SERVER_PROPS_ID: null,
SERVER_REFERENCE_MANIFEST: null,
STATIC_PROPS_ID: null,
STATIC_STATUS_PAGES: null,
STRING_LITERAL_DROP_BUNDLE: null,
SUBRESOURCE_INTEGRITY_MANIFEST: null,
SYSTEM_ENTRYPOINTS: null,
TRACE_OUTPUT_VERSION: null,
TURBOPACK_CLIENT_BUILD_MANIFEST: null,
TURBOPACK_CLIENT_MIDDLEWARE_MANIFEST: null,
TURBO_TRACE_DEFAULT_MEMORY_LIMIT: null,
UNDERSCORE_GLOBAL_ERROR_ROUTE: null,
UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY: null,
UNDERSCORE_NOT_FOUND_ROUTE: null,
UNDERSCORE_NOT_FOUND_ROUTE_ENTRY: null,
WEBPACK_STATS: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
APP_CLIENT_INTERNALS: function() {
return APP_CLIENT_INTERNALS;
},
APP_PATHS_MANIFEST: function() {
return APP_PATHS_MANIFEST;
},
APP_PATH_ROUTES_MANIFEST: function() {
return APP_PATH_ROUTES_MANIFEST;
},
AdapterOutputType: function() {
return AdapterOutputType;
},
BARREL_OPTIMIZATION_PREFIX: function() {
return BARREL_OPTIMIZATION_PREFIX;
},
BLOCKED_PAGES: function() {
return BLOCKED_PAGES;
},
BUILD_ID_FILE: function() {
return BUILD_ID_FILE;
},
BUILD_MANIFEST: function() {
return BUILD_MANIFEST;
},
CLIENT_PUBLIC_FILES_PATH: function() {
return CLIENT_PUBLIC_FILES_PATH;
},
CLIENT_REFERENCE_MANIFEST: function() {
return CLIENT_REFERENCE_MANIFEST;
},
CLIENT_STATIC_FILES_PATH: function() {
return CLIENT_STATIC_FILES_PATH;
},
CLIENT_STATIC_FILES_RUNTIME_MAIN: function() {
return CLIENT_STATIC_FILES_RUNTIME_MAIN;
},
CLIENT_STATIC_FILES_RUNTIME_MAIN_APP: function() {
return CLIENT_STATIC_FILES_RUNTIME_MAIN_APP;
},
CLIENT_STATIC_FILES_RUNTIME_POLYFILLS: function() {
return CLIENT_STATIC_FILES_RUNTIME_POLYFILLS;
},
CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL: function() {
return CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL;
},
CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH: function() {
return CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH;
},
CLIENT_STATIC_FILES_RUNTIME_WEBPACK: function() {
return CLIENT_STATIC_FILES_RUNTIME_WEBPACK;
},
COMPILER_INDEXES: function() {
return COMPILER_INDEXES;
},
COMPILER_NAMES: function() {
return COMPILER_NAMES;
},
CONFIG_FILES: function() {
return CONFIG_FILES;
},
DEFAULT_RUNTIME_WEBPACK: function() {
return DEFAULT_RUNTIME_WEBPACK;
},
DEFAULT_SANS_SERIF_FONT: function() {
return DEFAULT_SANS_SERIF_FONT;
},
DEFAULT_SERIF_FONT: function() {
return DEFAULT_SERIF_FONT;
},
DEV_CLIENT_MIDDLEWARE_MANIFEST: function() {
return DEV_CLIENT_MIDDLEWARE_MANIFEST;
},
DEV_CLIENT_PAGES_MANIFEST: function() {
return DEV_CLIENT_PAGES_MANIFEST;
},
DYNAMIC_CSS_MANIFEST: function() {
return DYNAMIC_CSS_MANIFEST;
},
EDGE_RUNTIME_WEBPACK: function() {
return EDGE_RUNTIME_WEBPACK;
},
EDGE_UNSUPPORTED_NODE_APIS: function() {
return EDGE_UNSUPPORTED_NODE_APIS;
},
EXPORT_DETAIL: function() {
return EXPORT_DETAIL;
},
EXPORT_MARKER: function() {
return EXPORT_MARKER;
},
FUNCTIONS_CONFIG_MANIFEST: function() {
return FUNCTIONS_CONFIG_MANIFEST;
},
IMAGES_MANIFEST: function() {
return IMAGES_MANIFEST;
},
INTERCEPTION_ROUTE_REWRITE_MANIFEST: function() {
return INTERCEPTION_ROUTE_REWRITE_MANIFEST;
},
MIDDLEWARE_BUILD_MANIFEST: function() {
return MIDDLEWARE_BUILD_MANIFEST;
},
MIDDLEWARE_MANIFEST: function() {
return MIDDLEWARE_MANIFEST;
},
MIDDLEWARE_REACT_LOADABLE_MANIFEST: function() {
return MIDDLEWARE_REACT_LOADABLE_MANIFEST;
},
MODERN_BROWSERSLIST_TARGET: function() {
return _modernbrowserslisttarget.default;
},
NEXT_BUILTIN_DOCUMENT: function() {
return NEXT_BUILTIN_DOCUMENT;
},
NEXT_FONT_MANIFEST: function() {
return NEXT_FONT_MANIFEST;
},
PAGES_MANIFEST: function() {
return PAGES_MANIFEST;
},
PHASE_ANALYZE: function() {
return PHASE_ANALYZE;
},
PHASE_DEVELOPMENT_SERVER: function() {
return PHASE_DEVELOPMENT_SERVER;
},
PHASE_EXPORT: function() {
return PHASE_EXPORT;
},
PHASE_INFO: function() {
return PHASE_INFO;
},
PHASE_PRODUCTION_BUILD: function() {
return PHASE_PRODUCTION_BUILD;
},
PHASE_PRODUCTION_SERVER: function() {
return PHASE_PRODUCTION_SERVER;
},
PHASE_TEST: function() {
return PHASE_TEST;
},
PRERENDER_MANIFEST: function() {
return PRERENDER_MANIFEST;
},
REACT_LOADABLE_MANIFEST: function() {
return REACT_LOADABLE_MANIFEST;
},
ROUTES_MANIFEST: function() {
return ROUTES_MANIFEST;
},
RSC_MODULE_TYPES: function() {
return RSC_MODULE_TYPES;
},
SERVER_DIRECTORY: function() {
return SERVER_DIRECTORY;
},
SERVER_FILES_MANIFEST: function() {
return SERVER_FILES_MANIFEST;
},
SERVER_PROPS_ID: function() {
return SERVER_PROPS_ID;
},
SERVER_REFERENCE_MANIFEST: function() {
return SERVER_REFERENCE_MANIFEST;
},
STATIC_PROPS_ID: function() {
return STATIC_PROPS_ID;
},
STATIC_STATUS_PAGES: function() {
return STATIC_STATUS_PAGES;
},
STRING_LITERAL_DROP_BUNDLE: function() {
return STRING_LITERAL_DROP_BUNDLE;
},
SUBRESOURCE_INTEGRITY_MANIFEST: function() {
return SUBRESOURCE_INTEGRITY_MANIFEST;
},
SYSTEM_ENTRYPOINTS: function() {
return SYSTEM_ENTRYPOINTS;
},
TRACE_OUTPUT_VERSION: function() {
return TRACE_OUTPUT_VERSION;
},
TURBOPACK_CLIENT_BUILD_MANIFEST: function() {
return TURBOPACK_CLIENT_BUILD_MANIFEST;
},
TURBOPACK_CLIENT_MIDDLEWARE_MANIFEST: function() {
return TURBOPACK_CLIENT_MIDDLEWARE_MANIFEST;
},
TURBO_TRACE_DEFAULT_MEMORY_LIMIT: function() {
return TURBO_TRACE_DEFAULT_MEMORY_LIMIT;
},
UNDERSCORE_GLOBAL_ERROR_ROUTE: function() {
return _entryconstants.UNDERSCORE_GLOBAL_ERROR_ROUTE;
},
UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY: function() {
return _entryconstants.UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY;
},
UNDERSCORE_NOT_FOUND_ROUTE: function() {
return _entryconstants.UNDERSCORE_NOT_FOUND_ROUTE;
},
UNDERSCORE_NOT_FOUND_ROUTE_ENTRY: function() {
return _entryconstants.UNDERSCORE_NOT_FOUND_ROUTE_ENTRY;
},
WEBPACK_STATS: function() {
return WEBPACK_STATS;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _modernbrowserslisttarget = /*#__PURE__*/ _interop_require_default._(require("./modern-browserslist-target"));
const _entryconstants = require("./entry-constants");
const COMPILER_NAMES = {
client: 'client',
server: 'server',
edgeServer: 'edge-server'
};
const COMPILER_INDEXES = {
[COMPILER_NAMES.client]: 0,
[COMPILER_NAMES.server]: 1,
[COMPILER_NAMES.edgeServer]: 2
};
var AdapterOutputType = /*#__PURE__*/ function(AdapterOutputType) {
/**
* `PAGES` represents all the React pages that are under `pages/`.
*/ AdapterOutputType["PAGES"] = "PAGES";
/**
* `PAGES_API` represents all the API routes under `pages/api/`.
*/ AdapterOutputType["PAGES_API"] = "PAGES_API";
/**
* `APP_PAGE` represents all the React pages that are under `app/` with the
* filename of `page.{j,t}s{,x}`.
*/ AdapterOutputType["APP_PAGE"] = "APP_PAGE";
/**
* `APP_ROUTE` represents all the API routes and metadata routes that are under `app/` with the
* filename of `route.{j,t}s{,x}`.
*/ AdapterOutputType["APP_ROUTE"] = "APP_ROUTE";
/**
* `PRERENDER` represents an ISR enabled route that might
* have a seeded cache entry or fallback generated during build
*/ AdapterOutputType["PRERENDER"] = "PRERENDER";
/**
* `STATIC_FILE` represents a static file (ie /_next/static)
*/ AdapterOutputType["STATIC_FILE"] = "STATIC_FILE";
/**
* `MIDDLEWARE` represents the middleware output if present
*/ AdapterOutputType["MIDDLEWARE"] = "MIDDLEWARE";
return AdapterOutputType;
}({});
const PHASE_EXPORT = 'phase-export';
const PHASE_ANALYZE = 'phase-analyze';
const PHASE_PRODUCTION_BUILD = 'phase-production-build';
const PHASE_PRODUCTION_SERVER = 'phase-production-server';
const PHASE_DEVELOPMENT_SERVER = 'phase-development-server';
const PHASE_TEST = 'phase-test';
const PHASE_INFO = 'phase-info';
const PAGES_MANIFEST = 'pages-manifest.json';
const WEBPACK_STATS = 'webpack-stats.json';
const APP_PATHS_MANIFEST = 'app-paths-manifest.json';
const APP_PATH_ROUTES_MANIFEST = 'app-path-routes-manifest.json';
const BUILD_MANIFEST = 'build-manifest.json';
const FUNCTIONS_CONFIG_MANIFEST = 'functions-config-manifest.json';
const SUBRESOURCE_INTEGRITY_MANIFEST = 'subresource-integrity-manifest';
const NEXT_FONT_MANIFEST = 'next-font-manifest';
const EXPORT_MARKER = 'export-marker.json';
const EXPORT_DETAIL = 'export-detail.json';
const PRERENDER_MANIFEST = 'prerender-manifest.json';
const ROUTES_MANIFEST = 'routes-manifest.json';
const IMAGES_MANIFEST = 'images-manifest.json';
const SERVER_FILES_MANIFEST = 'required-server-files';
const DEV_CLIENT_PAGES_MANIFEST = '_devPagesManifest.json';
const MIDDLEWARE_MANIFEST = 'middleware-manifest.json';
const TURBOPACK_CLIENT_MIDDLEWARE_MANIFEST = '_clientMiddlewareManifest.json';
const TURBOPACK_CLIENT_BUILD_MANIFEST = 'client-build-manifest.json';
const DEV_CLIENT_MIDDLEWARE_MANIFEST = '_devMiddlewareManifest.json';
const REACT_LOADABLE_MANIFEST = 'react-loadable-manifest.json';
const SERVER_DIRECTORY = 'server';
const CONFIG_FILES = [
'next.config.js',
'next.config.mjs',
'next.config.ts',
// process.features can be undefined on Edge runtime
// TODO: Remove `as any` once we bump @types/node to v22.10.0+
...process?.features?.typescript ? [
'next.config.mts'
] : []
];
const BUILD_ID_FILE = 'BUILD_ID';
const BLOCKED_PAGES = [
'/_document',
'/_app',
'/_error'
];
const CLIENT_PUBLIC_FILES_PATH = 'public';
const CLIENT_STATIC_FILES_PATH = 'static';
const STRING_LITERAL_DROP_BUNDLE = '__NEXT_DROP_CLIENT_FILE__';
const NEXT_BUILTIN_DOCUMENT = '__NEXT_BUILTIN_DOCUMENT__';
const BARREL_OPTIMIZATION_PREFIX = '__barrel_optimize__';
const CLIENT_REFERENCE_MANIFEST = 'client-reference-manifest';
const SERVER_REFERENCE_MANIFEST = 'server-reference-manifest';
const MIDDLEWARE_BUILD_MANIFEST = 'middleware-build-manifest';
const MIDDLEWARE_REACT_LOADABLE_MANIFEST = 'middleware-react-loadable-manifest';
const INTERCEPTION_ROUTE_REWRITE_MANIFEST = 'interception-route-rewrite-manifest';
const DYNAMIC_CSS_MANIFEST = 'dynamic-css-manifest';
const CLIENT_STATIC_FILES_RUNTIME_MAIN = `main`;
const CLIENT_STATIC_FILES_RUNTIME_MAIN_APP = `${CLIENT_STATIC_FILES_RUNTIME_MAIN}-app`;
const APP_CLIENT_INTERNALS = 'app-pages-internals';
const CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH = `react-refresh`;
const CLIENT_STATIC_FILES_RUNTIME_WEBPACK = `webpack`;
const CLIENT_STATIC_FILES_RUNTIME_POLYFILLS = 'polyfills';
const CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL = Symbol(CLIENT_STATIC_FILES_RUNTIME_POLYFILLS);
const DEFAULT_RUNTIME_WEBPACK = 'webpack-runtime';
const EDGE_RUNTIME_WEBPACK = 'edge-runtime-webpack';
const STATIC_PROPS_ID = '__N_SSG';
const SERVER_PROPS_ID = '__N_SSP';
const DEFAULT_SERIF_FONT = {
name: 'Times New Roman',
xAvgCharWidth: 821,
azAvgWidth: 854.3953488372093,
unitsPerEm: 2048
};
const DEFAULT_SANS_SERIF_FONT = {
name: 'Arial',
xAvgCharWidth: 904,
azAvgWidth: 934.5116279069767,
unitsPerEm: 2048
};
const STATIC_STATUS_PAGES = [
'/500'
];
const TRACE_OUTPUT_VERSION = 1;
const TURBO_TRACE_DEFAULT_MEMORY_LIMIT = 6000;
const RSC_MODULE_TYPES = {
client: 'client',
server: 'server'
};
const EDGE_UNSUPPORTED_NODE_APIS = [
'clearImmediate',
'setImmediate',
'BroadcastChannel',
'ByteLengthQueuingStrategy',
'CompressionStream',
'CountQueuingStrategy',
'DecompressionStream',
'DomException',
'MessageChannel',
'MessageEvent',
'MessagePort',
'ReadableByteStreamController',
'ReadableStreamBYOBRequest',
'ReadableStreamDefaultController',
'TransformStreamDefaultController',
'WritableStreamDefaultController'
];
const SYSTEM_ENTRYPOINTS = new Set([
CLIENT_STATIC_FILES_RUNTIME_MAIN,
CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH,
CLIENT_STATIC_FILES_RUNTIME_MAIN_APP
]);
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=constants.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,10 @@
import type { DeepReadonly } from './deep-readonly';
/**
* Recursively freezes an object and all of its properties. This prevents the
* object from being modified at runtime. When the JS runtime is running in
* strict mode, any attempts to modify a frozen object will throw an error.
*
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze
* @param obj The object to freeze.
*/
export declare function deepFreeze<T extends object>(obj: T): DeepReadonly<T>;

View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "deepFreeze", {
enumerable: true,
get: function() {
return deepFreeze;
}
});
function deepFreeze(obj) {
// If the object is already frozen, there's no need to freeze it again.
if (Object.isFrozen(obj)) return obj;
// An array is an object, but we also want to freeze each element in the array
// as well.
if (Array.isArray(obj)) {
for (const item of obj){
if (!item || typeof item !== 'object') continue;
deepFreeze(item);
}
return Object.freeze(obj);
}
for (const value of Object.values(obj)){
if (!value || typeof value !== 'object') continue;
deepFreeze(value);
}
return Object.freeze(obj);
}
//# sourceMappingURL=deep-freeze.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/deep-freeze.ts"],"sourcesContent":["import type { DeepReadonly } from './deep-readonly'\n\n/**\n * Recursively freezes an object and all of its properties. This prevents the\n * object from being modified at runtime. When the JS runtime is running in\n * strict mode, any attempts to modify a frozen object will throw an error.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze\n * @param obj The object to freeze.\n */\nexport function deepFreeze<T extends object>(obj: T): DeepReadonly<T> {\n // If the object is already frozen, there's no need to freeze it again.\n if (Object.isFrozen(obj)) return obj as DeepReadonly<T>\n\n // An array is an object, but we also want to freeze each element in the array\n // as well.\n if (Array.isArray(obj)) {\n for (const item of obj) {\n if (!item || typeof item !== 'object') continue\n deepFreeze(item)\n }\n\n return Object.freeze(obj) as DeepReadonly<T>\n }\n\n for (const value of Object.values(obj)) {\n if (!value || typeof value !== 'object') continue\n deepFreeze(value)\n }\n\n return Object.freeze(obj) as DeepReadonly<T>\n}\n"],"names":["deepFreeze","obj","Object","isFrozen","Array","isArray","item","freeze","value","values"],"mappings":";;;;+BAUgBA;;;eAAAA;;;AAAT,SAASA,WAA6BC,GAAM;IACjD,uEAAuE;IACvE,IAAIC,OAAOC,QAAQ,CAACF,MAAM,OAAOA;IAEjC,8EAA8E;IAC9E,WAAW;IACX,IAAIG,MAAMC,OAAO,CAACJ,MAAM;QACtB,KAAK,MAAMK,QAAQL,IAAK;YACtB,IAAI,CAACK,QAAQ,OAAOA,SAAS,UAAU;YACvCN,WAAWM;QACb;QAEA,OAAOJ,OAAOK,MAAM,CAACN;IACvB;IAEA,KAAK,MAAMO,SAASN,OAAOO,MAAM,CAACR,KAAM;QACtC,IAAI,CAACO,SAAS,OAAOA,UAAU,UAAU;QACzCR,WAAWQ;IACb;IAEA,OAAON,OAAOK,MAAM,CAACN;AACvB","ignoreList":[0]}

View File

@@ -0,0 +1,8 @@
/**
* A type that represents a deeply readonly object. This is similar to
* TypeScript's `Readonly` type, but it recursively applies the `readonly`
* modifier to all properties of an object and all elements of arrays.
*/
export type DeepReadonly<T> = T extends (infer R)[] ? ReadonlyArray<DeepReadonly<R>> : T extends object ? {
readonly [K in keyof T]: DeepReadonly<T[K]>;
} : T;

View File

@@ -0,0 +1,10 @@
/**
* A type that represents a deeply readonly object. This is similar to
* TypeScript's `Readonly` type, but it recursively applies the `readonly`
* modifier to all properties of an object and all elements of arrays.
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//# sourceMappingURL=deep-readonly.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/deep-readonly.ts"],"sourcesContent":["/**\n * A type that represents a deeply readonly object. This is similar to\n * TypeScript's `Readonly` type, but it recursively applies the `readonly`\n * modifier to all properties of an object and all elements of arrays.\n */\nexport type DeepReadonly<T> = T extends (infer R)[]\n ? ReadonlyArray<DeepReadonly<R>>\n : T extends object\n ? {\n readonly [K in keyof T]: DeepReadonly<T[K]>\n }\n : T\n"],"names":[],"mappings":"AAAA;;;;CAIC","ignoreList":[0]}

View File

@@ -0,0 +1,2 @@
export declare function getDeploymentId(): string | undefined;
export declare function getDeploymentIdQueryOrEmptyString(): string;

View File

@@ -0,0 +1,36 @@
// This could also be a variable instead of a function, but some unit tests want to change the ID at
// runtime. Even though that would never happen in a real deployment.
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
getDeploymentId: null,
getDeploymentIdQueryOrEmptyString: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
getDeploymentId: function() {
return getDeploymentId;
},
getDeploymentIdQueryOrEmptyString: function() {
return getDeploymentIdQueryOrEmptyString;
}
});
function getDeploymentId() {
return process.env.NEXT_DEPLOYMENT_ID;
}
function getDeploymentIdQueryOrEmptyString() {
let deploymentId = getDeploymentId();
if (deploymentId) {
return `?dpl=${deploymentId}`;
}
return '';
}
//# sourceMappingURL=deployment-id.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/deployment-id.ts"],"sourcesContent":["// This could also be a variable instead of a function, but some unit tests want to change the ID at\n// runtime. Even though that would never happen in a real deployment.\nexport function getDeploymentId(): string | undefined {\n return process.env.NEXT_DEPLOYMENT_ID\n}\n\nexport function getDeploymentIdQueryOrEmptyString(): string {\n let deploymentId = getDeploymentId()\n if (deploymentId) {\n return `?dpl=${deploymentId}`\n }\n return ''\n}\n"],"names":["getDeploymentId","getDeploymentIdQueryOrEmptyString","process","env","NEXT_DEPLOYMENT_ID","deploymentId"],"mappings":"AAAA,oGAAoG;AACpG,qEAAqE;;;;;;;;;;;;;;;;IACrDA,eAAe;eAAfA;;IAIAC,iCAAiC;eAAjCA;;;AAJT,SAASD;IACd,OAAOE,QAAQC,GAAG,CAACC,kBAAkB;AACvC;AAEO,SAASH;IACd,IAAII,eAAeL;IACnB,IAAIK,cAAc;QAChB,OAAO,CAAC,KAAK,EAAEA,cAAc;IAC/B;IACA,OAAO;AACT","ignoreList":[0]}

View File

@@ -0,0 +1,5 @@
export function dset<T extends object, V>(
obj: T,
keys: string | ArrayLike<string | number>,
value: V
): void

View File

@@ -0,0 +1,34 @@
/*
The MIT License (MIT)
Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ // This file is based on https://github.com/lukeed/dset/blob/v3.1.3/src/index.js
// It's been edited for the needs of this script
// See the LICENSE at the top of the file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "dset", {
enumerable: true,
get: function() {
return dset;
}
});
function dset(obj, keys, val) {
keys.split && (keys = keys.split('.'));
var i = 0, l = keys.length, t = obj, x, k;
while(i < l){
k = keys[i++];
if (k === '__proto__' || k === 'constructor' || k === 'prototype') break;
t = t[k] = i === l ? val : typeof (x = t[k]) === typeof keys ? x : keys[i] * 0 !== 0 || !!~('' + keys[i]).indexOf('.') ? {} : [];
}
}
//# sourceMappingURL=dset.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/dset.js"],"sourcesContent":["/*\nThe MIT License (MIT)\n\nCopyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n// This file is based on https://github.com/lukeed/dset/blob/v3.1.3/src/index.js\n// It's been edited for the needs of this script\n// See the LICENSE at the top of the file\n\nexport function dset(obj, keys, val) {\n keys.split && (keys = keys.split('.'))\n var i = 0,\n l = keys.length,\n t = obj,\n x,\n k\n while (i < l) {\n k = keys[i++]\n if (k === '__proto__' || k === 'constructor' || k === 'prototype') break\n t = t[k] =\n i === l\n ? val\n : typeof (x = t[k]) === typeof keys\n ? x\n : keys[i] * 0 !== 0 || !!~('' + keys[i]).indexOf('.')\n ? {}\n : []\n }\n}\n"],"names":["dset","obj","keys","val","split","i","l","length","t","x","k","indexOf"],"mappings":"AAAA;;;;;;;;;;AAUA,GAEA,gFAAgF;AAChF,gDAAgD;AAChD,yCAAyC;;;;;+BAEzBA;;;eAAAA;;;AAAT,SAASA,KAAKC,GAAG,EAAEC,IAAI,EAAEC,GAAG;IACjCD,KAAKE,KAAK,IAAKF,CAAAA,OAAOA,KAAKE,KAAK,CAAC,IAAG;IACpC,IAAIC,IAAI,GACNC,IAAIJ,KAAKK,MAAM,EACfC,IAAIP,KACJQ,GACAC;IACF,MAAOL,IAAIC,EAAG;QACZI,IAAIR,IAAI,CAACG,IAAI;QACb,IAAIK,MAAM,eAAeA,MAAM,iBAAiBA,MAAM,aAAa;QACnEF,IAAIA,CAAC,CAACE,EAAE,GACNL,MAAMC,IACFH,MACA,OAAQM,CAAAA,IAAID,CAAC,CAACE,EAAE,AAAD,MAAO,OAAOR,OAC3BO,IACAP,IAAI,CAACG,EAAE,GAAG,MAAM,KAAK,CAAC,CAAC,CAAC,AAAC,CAAA,KAAKH,IAAI,CAACG,EAAE,AAAD,EAAGM,OAAO,CAAC,OAC7C,CAAC,IACD,EAAE;IACd;AACF","ignoreList":[0]}

View File

@@ -0,0 +1,38 @@
import React from 'react';
type ComponentModule<P = {}> = {
default: React.ComponentType<P>;
};
export declare type LoaderComponent<P = {}> = Promise<React.ComponentType<P> | ComponentModule<P>>;
export declare type Loader<P = {}> = (() => LoaderComponent<P>) | LoaderComponent<P>;
export type LoaderMap = {
[module: string]: () => Loader<any>;
};
export type LoadableGeneratedOptions = {
webpack?(): any;
modules?(): LoaderMap;
};
export type DynamicOptionsLoadingProps = {
error?: Error | null;
isLoading?: boolean;
pastDelay?: boolean;
retry?: () => void;
timedOut?: boolean;
};
export type DynamicOptions<P = {}> = LoadableGeneratedOptions & {
loading?: (loadingProps: DynamicOptionsLoadingProps) => React.ReactNode;
loader?: Loader<P> | LoaderMap;
loadableGenerated?: LoadableGeneratedOptions;
ssr?: boolean;
};
export type LoadableOptions<P = {}> = DynamicOptions<P>;
export type LoadableFn<P = {}> = (opts: LoadableOptions<P>) => React.ComponentType<P>;
export type LoadableComponent<P = {}> = React.ComponentType<P>;
export declare function noSSR<P = {}>(LoadableInitializer: LoadableFn<P>, loadableOptions: DynamicOptions<P>): React.ComponentType<P>;
/**
* This function lets you dynamically import a component.
* It uses [React.lazy()](https://react.dev/reference/react/lazy) with [Suspense](https://react.dev/reference/react/Suspense) under the hood.
*
* Read more: [Next.js Docs: `next/dynamic`](https://nextjs.org/docs/app/building-your-application/optimizing/lazy-loading#nextdynamic)
*/
export default function dynamic<P = {}>(dynamicOptions: DynamicOptions<P> | Loader<P>, options?: DynamicOptions<P>): React.ComponentType<P>;
export {};

View File

@@ -0,0 +1,130 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
default: null,
noSSR: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
/**
* This function lets you dynamically import a component.
* It uses [React.lazy()](https://react.dev/reference/react/lazy) with [Suspense](https://react.dev/reference/react/Suspense) under the hood.
*
* Read more: [Next.js Docs: `next/dynamic`](https://nextjs.org/docs/app/building-your-application/optimizing/lazy-loading#nextdynamic)
*/ default: function() {
return dynamic;
},
noSSR: function() {
return noSSR;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _jsxruntime = require("react/jsx-runtime");
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
const _loadablesharedruntime = /*#__PURE__*/ _interop_require_default._(require("./loadable.shared-runtime"));
const isServerSide = typeof window === 'undefined';
// Normalize loader to return the module as form { default: Component } for `React.lazy`.
// Also for backward compatible since next/dynamic allows to resolve a component directly with loader
// Client component reference proxy need to be converted to a module.
function convertModule(mod) {
return {
default: mod?.default || mod
};
}
function noSSR(LoadableInitializer, loadableOptions) {
// Removing webpack and modules means react-loadable won't try preloading
delete loadableOptions.webpack;
delete loadableOptions.modules;
// This check is necessary to prevent react-loadable from initializing on the server
if (!isServerSide) {
return LoadableInitializer(loadableOptions);
}
const Loading = loadableOptions.loading;
// This will only be rendered on the server side
return ()=>/*#__PURE__*/ (0, _jsxruntime.jsx)(Loading, {
error: null,
isLoading: true,
pastDelay: false,
timedOut: false
});
}
function dynamic(dynamicOptions, options) {
let loadableFn = _loadablesharedruntime.default;
let loadableOptions = {
// A loading component is not required, so we default it
loading: ({ error, isLoading, pastDelay })=>{
if (!pastDelay) return null;
if (process.env.NODE_ENV !== 'production') {
if (isLoading) {
return null;
}
if (error) {
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("p", {
children: [
error.message,
/*#__PURE__*/ (0, _jsxruntime.jsx)("br", {}),
error.stack
]
});
}
}
return null;
}
};
// Support for direct import(), eg: dynamic(import('../hello-world'))
// Note that this is only kept for the edge case where someone is passing in a promise as first argument
// The react-loadable babel plugin will turn dynamic(import('../hello-world')) into dynamic(() => import('../hello-world'))
// To make sure we don't execute the import without rendering first
if (dynamicOptions instanceof Promise) {
loadableOptions.loader = ()=>dynamicOptions;
// Support for having import as a function, eg: dynamic(() => import('../hello-world'))
} else if (typeof dynamicOptions === 'function') {
loadableOptions.loader = dynamicOptions;
// Support for having first argument being options, eg: dynamic({loader: import('../hello-world')})
} else if (typeof dynamicOptions === 'object') {
loadableOptions = {
...loadableOptions,
...dynamicOptions
};
}
// Support for passing options, eg: dynamic(import('../hello-world'), {loading: () => <p>Loading something</p>})
loadableOptions = {
...loadableOptions,
...options
};
const loaderFn = loadableOptions.loader;
const loader = ()=>loaderFn != null ? loaderFn().then(convertModule) : Promise.resolve(convertModule(()=>null));
// coming from build/babel/plugins/react-loadable-plugin.js
if (loadableOptions.loadableGenerated) {
loadableOptions = {
...loadableOptions,
...loadableOptions.loadableGenerated
};
delete loadableOptions.loadableGenerated;
}
// support for disabling server side rendering, eg: dynamic(() => import('../hello-world'), {ssr: false}).
if (typeof loadableOptions.ssr === 'boolean' && !loadableOptions.ssr) {
delete loadableOptions.webpack;
delete loadableOptions.modules;
return noSSR(loadableFn, loadableOptions);
}
return loadableFn({
...loadableOptions,
loader: loader
});
}
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=dynamic.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
export declare function encodeURIPath(file: string): string;

View File

@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "encodeURIPath", {
enumerable: true,
get: function() {
return encodeURIPath;
}
});
function encodeURIPath(file) {
return file.split('/').map((p)=>encodeURIComponent(p)).join('/');
}
//# sourceMappingURL=encode-uri-path.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/encode-uri-path.ts"],"sourcesContent":["export function encodeURIPath(file: string) {\n return file\n .split('/')\n .map((p) => encodeURIComponent(p))\n .join('/')\n}\n"],"names":["encodeURIPath","file","split","map","p","encodeURIComponent","join"],"mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA,cAAcC,IAAY;IACxC,OAAOA,KACJC,KAAK,CAAC,KACNC,GAAG,CAAC,CAACC,IAAMC,mBAAmBD,IAC9BE,IAAI,CAAC;AACV","ignoreList":[0]}

View File

@@ -0,0 +1,4 @@
export declare const UNDERSCORE_NOT_FOUND_ROUTE = "/_not-found";
export declare const UNDERSCORE_NOT_FOUND_ROUTE_ENTRY = "/_not-found/page";
export declare const UNDERSCORE_GLOBAL_ERROR_ROUTE = "/_global-error";
export declare const UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY = "/_global-error/page";

View File

@@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
UNDERSCORE_GLOBAL_ERROR_ROUTE: null,
UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY: null,
UNDERSCORE_NOT_FOUND_ROUTE: null,
UNDERSCORE_NOT_FOUND_ROUTE_ENTRY: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
UNDERSCORE_GLOBAL_ERROR_ROUTE: function() {
return UNDERSCORE_GLOBAL_ERROR_ROUTE;
},
UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY: function() {
return UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY;
},
UNDERSCORE_NOT_FOUND_ROUTE: function() {
return UNDERSCORE_NOT_FOUND_ROUTE;
},
UNDERSCORE_NOT_FOUND_ROUTE_ENTRY: function() {
return UNDERSCORE_NOT_FOUND_ROUTE_ENTRY;
}
});
const UNDERSCORE_NOT_FOUND_ROUTE = '/_not-found';
const UNDERSCORE_NOT_FOUND_ROUTE_ENTRY = `${UNDERSCORE_NOT_FOUND_ROUTE}/page`;
const UNDERSCORE_GLOBAL_ERROR_ROUTE = '/_global-error';
const UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY = `${UNDERSCORE_GLOBAL_ERROR_ROUTE}/page`;
//# sourceMappingURL=entry-constants.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/entry-constants.ts"],"sourcesContent":["export const UNDERSCORE_NOT_FOUND_ROUTE = '/_not-found'\nexport const UNDERSCORE_NOT_FOUND_ROUTE_ENTRY = `${UNDERSCORE_NOT_FOUND_ROUTE}/page`\nexport const UNDERSCORE_GLOBAL_ERROR_ROUTE = '/_global-error'\nexport const UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY = `${UNDERSCORE_GLOBAL_ERROR_ROUTE}/page`\n"],"names":["UNDERSCORE_GLOBAL_ERROR_ROUTE","UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY","UNDERSCORE_NOT_FOUND_ROUTE","UNDERSCORE_NOT_FOUND_ROUTE_ENTRY"],"mappings":";;;;;;;;;;;;;;;;;IAEaA,6BAA6B;eAA7BA;;IACAC,mCAAmC;eAAnCA;;IAHAC,0BAA0B;eAA1BA;;IACAC,gCAAgC;eAAhCA;;;AADN,MAAMD,6BAA6B;AACnC,MAAMC,mCAAmC,GAAGD,2BAA2B,KAAK,CAAC;AAC7E,MAAMF,gCAAgC;AACtC,MAAMC,sCAAsC,GAAGD,8BAA8B,KAAK,CAAC","ignoreList":[0]}

View File

@@ -0,0 +1,3 @@
export declare function getErrorSource(error: Error): 'server' | 'edge-server' | null;
export type ErrorSourceType = 'edge-server' | 'server';
export declare function decorateServerError(error: Error, type: ErrorSourceType): void;

View File

@@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
decorateServerError: null,
getErrorSource: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
decorateServerError: function() {
return decorateServerError;
},
getErrorSource: function() {
return getErrorSource;
}
});
const symbolError = Symbol.for('NextjsError');
function getErrorSource(error) {
return error[symbolError] || null;
}
function decorateServerError(error, type) {
Object.defineProperty(error, symbolError, {
writable: false,
enumerable: false,
configurable: false,
value: type
});
}
//# sourceMappingURL=error-source.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/error-source.ts"],"sourcesContent":["const symbolError = Symbol.for('NextjsError')\n\nexport function getErrorSource(error: Error): 'server' | 'edge-server' | null {\n return (error as any)[symbolError] || null\n}\n\nexport type ErrorSourceType = 'edge-server' | 'server'\n\nexport function decorateServerError(error: Error, type: ErrorSourceType) {\n Object.defineProperty(error, symbolError, {\n writable: false,\n enumerable: false,\n configurable: false,\n value: type,\n })\n}\n"],"names":["decorateServerError","getErrorSource","symbolError","Symbol","for","error","type","Object","defineProperty","writable","enumerable","configurable","value"],"mappings":";;;;;;;;;;;;;;;IAQgBA,mBAAmB;eAAnBA;;IANAC,cAAc;eAAdA;;;AAFhB,MAAMC,cAAcC,OAAOC,GAAG,CAAC;AAExB,SAASH,eAAeI,KAAY;IACzC,OAAO,AAACA,KAAa,CAACH,YAAY,IAAI;AACxC;AAIO,SAASF,oBAAoBK,KAAY,EAAEC,IAAqB;IACrEC,OAAOC,cAAc,CAACH,OAAOH,aAAa;QACxCO,UAAU;QACVC,YAAY;QACZC,cAAc;QACdC,OAAON;IACT;AACF","ignoreList":[0]}

View File

@@ -0,0 +1,6 @@
export declare function isStableBuild(): boolean;
export declare class CanaryOnlyConfigError extends Error {
constructor(arg: {
feature: string;
} | string);
}

View File

@@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
CanaryOnlyConfigError: null,
isStableBuild: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
CanaryOnlyConfigError: function() {
return CanaryOnlyConfigError;
},
isStableBuild: function() {
return isStableBuild;
}
});
function isStableBuild() {
return !"16.1.4"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
}
class CanaryOnlyConfigError extends Error {
constructor(arg){
if (typeof arg === 'object' && 'feature' in arg) {
super(`The experimental feature "${arg.feature}" can only be enabled when using the latest canary version of Next.js.`);
} else {
super(arg);
}
// This error is meant to interrupt the server start/build process
// but the stack trace isn't meaningful, as it points to internal code.
this.stack = undefined;
}
}
//# sourceMappingURL=canary-only-config-error.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/errors/canary-only-config-error.ts"],"sourcesContent":["export function isStableBuild() {\n return (\n !process.env.__NEXT_VERSION?.includes('canary') &&\n !process.env.__NEXT_TEST_MODE &&\n !process.env.NEXT_PRIVATE_LOCAL_DEV\n )\n}\n\nexport class CanaryOnlyConfigError extends Error {\n constructor(arg: { feature: string } | string) {\n if (typeof arg === 'object' && 'feature' in arg) {\n super(\n `The experimental feature \"${arg.feature}\" can only be enabled when using the latest canary version of Next.js.`\n )\n } else {\n super(arg)\n }\n\n // This error is meant to interrupt the server start/build process\n // but the stack trace isn't meaningful, as it points to internal code.\n this.stack = undefined\n }\n}\n"],"names":["CanaryOnlyConfigError","isStableBuild","process","env","__NEXT_VERSION","includes","__NEXT_TEST_MODE","NEXT_PRIVATE_LOCAL_DEV","Error","constructor","arg","feature","stack","undefined"],"mappings":";;;;;;;;;;;;;;;IAQaA,qBAAqB;eAArBA;;IARGC,aAAa;eAAbA;;;AAAT,SAASA;IACd,OACE,CAACC,QAAQC,GAAG,CAACC,cAAc,EAAEC,SAAS,aACtC,CAACH,QAAQC,GAAG,CAACG,gBAAgB,IAC7B,CAACJ,QAAQC,GAAG,CAACI,sBAAsB;AAEvC;AAEO,MAAMP,8BAA8BQ;IACzCC,YAAYC,GAAiC,CAAE;QAC7C,IAAI,OAAOA,QAAQ,YAAY,aAAaA,KAAK;YAC/C,KAAK,CACH,CAAC,0BAA0B,EAAEA,IAAIC,OAAO,CAAC,sEAAsE,CAAC;QAEpH,OAAO;YACL,KAAK,CAACD;QACR;QAEA,kEAAkE;QAClE,uEAAuE;QACvE,IAAI,CAACE,KAAK,GAAGC;IACf;AACF","ignoreList":[0]}

View File

@@ -0,0 +1 @@
export declare const MISSING_ROOT_TAGS_ERROR = "NEXT_MISSING_ROOT_TAGS";

View File

@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "MISSING_ROOT_TAGS_ERROR", {
enumerable: true,
get: function() {
return MISSING_ROOT_TAGS_ERROR;
}
});
const MISSING_ROOT_TAGS_ERROR = 'NEXT_MISSING_ROOT_TAGS';
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=constants.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/errors/constants.ts"],"sourcesContent":["export const MISSING_ROOT_TAGS_ERROR = 'NEXT_MISSING_ROOT_TAGS'\n"],"names":["MISSING_ROOT_TAGS_ERROR"],"mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,0BAA0B","ignoreList":[0]}

View File

@@ -0,0 +1 @@
export declare function throwEmptyGenerateStaticParamsError(): never;

View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "throwEmptyGenerateStaticParamsError", {
enumerable: true,
get: function() {
return throwEmptyGenerateStaticParamsError;
}
});
function throwEmptyGenerateStaticParamsError() {
const error = Object.defineProperty(new Error('When using Cache Components, all `generateStaticParams` functions must return at least one result. ' + 'This is to ensure that we can perform build-time validation that there is no other dynamic accesses that would cause a runtime error.\n\n' + 'Learn more: https://nextjs.org/docs/messages/empty-generate-static-params'), "__NEXT_ERROR_CODE", {
value: "E898",
enumerable: false,
configurable: true
});
error.name = 'EmptyGenerateStaticParamsError';
// This error is meant to interrupt the server start/build process
// but the stack trace isn't meaningful, as it points to internal code.
error.stack = undefined;
throw error;
}
//# sourceMappingURL=empty-generate-static-params-error.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/errors/empty-generate-static-params-error.ts"],"sourcesContent":["export function throwEmptyGenerateStaticParamsError(): never {\n const error = new Error(\n 'When using Cache Components, all `generateStaticParams` functions must return at least one result. ' +\n 'This is to ensure that we can perform build-time validation that there is no other dynamic accesses that would cause a runtime error.\\n\\n' +\n 'Learn more: https://nextjs.org/docs/messages/empty-generate-static-params'\n )\n error.name = 'EmptyGenerateStaticParamsError'\n // This error is meant to interrupt the server start/build process\n // but the stack trace isn't meaningful, as it points to internal code.\n error.stack = undefined\n\n throw error\n}\n"],"names":["throwEmptyGenerateStaticParamsError","error","Error","name","stack","undefined"],"mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA;IACd,MAAMC,QAAQ,qBAIb,CAJa,IAAIC,MAChB,wGACE,8IACA,8EAHU,qBAAA;eAAA;oBAAA;sBAAA;IAId;IACAD,MAAME,IAAI,GAAG;IACb,kEAAkE;IAClE,uEAAuE;IACvEF,MAAMG,KAAK,GAAGC;IAEd,MAAMJ;AACR","ignoreList":[0]}

View File

@@ -0,0 +1,3 @@
export declare class HardDeprecatedConfigError extends Error {
constructor(message: string);
}

View File

@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "HardDeprecatedConfigError", {
enumerable: true,
get: function() {
return HardDeprecatedConfigError;
}
});
class HardDeprecatedConfigError extends Error {
constructor(message){
super(message);
// This error is meant to interrupt the server start/build process
// but the stack trace isn't meaningful, as it points to internal code.
this.stack = undefined;
}
}
//# sourceMappingURL=hard-deprecated-config-error.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/errors/hard-deprecated-config-error.ts"],"sourcesContent":["export class HardDeprecatedConfigError extends Error {\n constructor(message: string) {\n super(message)\n\n // This error is meant to interrupt the server start/build process\n // but the stack trace isn't meaningful, as it points to internal code.\n this.stack = undefined\n }\n}\n"],"names":["HardDeprecatedConfigError","Error","constructor","message","stack","undefined"],"mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,kCAAkCC;IAC7CC,YAAYC,OAAe,CAAE;QAC3B,KAAK,CAACA;QAEN,kEAAkE;QAClE,uEAAuE;QACvE,IAAI,CAACC,KAAK,GAAGC;IACf;AACF","ignoreList":[0]}

View File

@@ -0,0 +1,4 @@
import { UsageError } from './usage-error';
export declare class MissingDefaultParallelRouteError extends UsageError {
constructor(fullSegmentPath: string, slotName: string);
}

View File

@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "MissingDefaultParallelRouteError", {
enumerable: true,
get: function() {
return MissingDefaultParallelRouteError;
}
});
const _usageerror = require("./usage-error");
class MissingDefaultParallelRouteError extends _usageerror.UsageError {
constructor(fullSegmentPath, slotName){
super(`Missing required default.js file for parallel route at ${fullSegmentPath}\n` + `The parallel route slot "${slotName}" is missing a default.js file. When using parallel routes, each slot must have a default.js file to serve as a fallback.\n\n` + `Create a default.js file at: ${fullSegmentPath}/default.js`, 'https://nextjs.org/docs/messages/slot-missing-default');
this.name = 'MissingDefaultParallelRouteError';
}
}
//# sourceMappingURL=missing-default-parallel-route-error.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/errors/missing-default-parallel-route-error.ts"],"sourcesContent":["import { UsageError } from './usage-error'\n\nexport class MissingDefaultParallelRouteError extends UsageError {\n constructor(fullSegmentPath: string, slotName: string) {\n super(\n `Missing required default.js file for parallel route at ${fullSegmentPath}\\n` +\n `The parallel route slot \"${slotName}\" is missing a default.js file. When using parallel routes, each slot must have a default.js file to serve as a fallback.\\n\\n` +\n `Create a default.js file at: ${fullSegmentPath}/default.js`,\n 'https://nextjs.org/docs/messages/slot-missing-default'\n )\n\n this.name = 'MissingDefaultParallelRouteError'\n }\n}\n"],"names":["MissingDefaultParallelRouteError","UsageError","constructor","fullSegmentPath","slotName","name"],"mappings":";;;;+BAEaA;;;eAAAA;;;4BAFc;AAEpB,MAAMA,yCAAyCC,sBAAU;IAC9DC,YAAYC,eAAuB,EAAEC,QAAgB,CAAE;QACrD,KAAK,CACH,CAAC,uDAAuD,EAAED,gBAAgB,EAAE,CAAC,GAC3E,CAAC,yBAAyB,EAAEC,SAAS,6HAA6H,CAAC,GACnK,CAAC,6BAA6B,EAAED,gBAAgB,WAAW,CAAC,EAC9D;QAGF,IAAI,CAACE,IAAI,GAAG;IACd;AACF","ignoreList":[0]}

View File

@@ -0,0 +1,3 @@
export declare class UsageError extends Error {
constructor(message: string, docUrl: string);
}

View File

@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "UsageError", {
enumerable: true,
get: function() {
return UsageError;
}
});
class UsageError extends Error {
constructor(message, docUrl){
super(`${message}\n\nLearn more: ${docUrl}`);
this.name = 'UsageError';
// This error is meant to interrupt the server start/build process
// but the stack trace isn't meaningful, as it points to internal code.
this.stack = undefined;
}
}
//# sourceMappingURL=usage-error.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/errors/usage-error.ts"],"sourcesContent":["export class UsageError extends Error {\n constructor(message: string, docUrl: string) {\n super(`${message}\\n\\nLearn more: ${docUrl}`)\n this.name = 'UsageError'\n\n // This error is meant to interrupt the server start/build process\n // but the stack trace isn't meaningful, as it points to internal code.\n this.stack = undefined\n }\n}\n"],"names":["UsageError","Error","constructor","message","docUrl","name","stack","undefined"],"mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,mBAAmBC;IAC9BC,YAAYC,OAAe,EAAEC,MAAc,CAAE;QAC3C,KAAK,CAAC,GAAGD,QAAQ,gBAAgB,EAAEC,QAAQ;QAC3C,IAAI,CAACC,IAAI,GAAG;QAEZ,kEAAkE;QAClE,uEAAuE;QACvE,IAAI,CAACC,KAAK,GAAGC;IACf;AACF","ignoreList":[0]}

View File

@@ -0,0 +1 @@
export declare function escapeStringRegexp(str: string): string;

View File

@@ -0,0 +1,22 @@
// regexp is based on https://github.com/sindresorhus/escape-string-regexp
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "escapeStringRegexp", {
enumerable: true,
get: function() {
return escapeStringRegexp;
}
});
const reHasRegExp = /[|\\{}()[\]^$+*?.-]/;
const reReplaceRegExp = /[|\\{}()[\]^$+*?.-]/g;
function escapeStringRegexp(str) {
// see also: https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/escapeRegExp.js#L23
if (reHasRegExp.test(str)) {
return str.replace(reReplaceRegExp, '\\$&');
}
return str;
}
//# sourceMappingURL=escape-regexp.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/escape-regexp.ts"],"sourcesContent":["// regexp is based on https://github.com/sindresorhus/escape-string-regexp\nconst reHasRegExp = /[|\\\\{}()[\\]^$+*?.-]/\nconst reReplaceRegExp = /[|\\\\{}()[\\]^$+*?.-]/g\n\nexport function escapeStringRegexp(str: string) {\n // see also: https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/escapeRegExp.js#L23\n if (reHasRegExp.test(str)) {\n return str.replace(reReplaceRegExp, '\\\\$&')\n }\n return str\n}\n"],"names":["escapeStringRegexp","reHasRegExp","reReplaceRegExp","str","test","replace"],"mappings":"AAAA,0EAA0E;;;;;+BAI1DA;;;eAAAA;;;AAHhB,MAAMC,cAAc;AACpB,MAAMC,kBAAkB;AAEjB,SAASF,mBAAmBG,GAAW;IAC5C,+GAA+G;IAC/G,IAAIF,YAAYG,IAAI,CAACD,MAAM;QACzB,OAAOA,IAAIE,OAAO,CAACH,iBAAiB;IACtC;IACA,OAAOC;AACT","ignoreList":[0]}

View File

@@ -0,0 +1,8 @@
import type { NextConfig } from '../../server/config-shared';
/**
* Find the closest matching `quality` in the list of `config.qualities`
* @param quality the quality prop passed to the image component
* @param config the "images" configuration from next.config.js
* @returns the closest matching quality value
*/
export declare function findClosestQuality(quality: number | undefined, config: NextConfig['images'] | undefined): number;

View File

@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "findClosestQuality", {
enumerable: true,
get: function() {
return findClosestQuality;
}
});
function findClosestQuality(quality, config) {
const q = quality || 75;
if (!config?.qualities?.length) {
return q;
}
return config.qualities.reduce((prev, cur)=>Math.abs(cur - q) < Math.abs(prev - q) ? cur : prev, 0);
}
//# sourceMappingURL=find-closest-quality.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/find-closest-quality.ts"],"sourcesContent":["import type { NextConfig } from '../../server/config-shared'\n\n/**\n * Find the closest matching `quality` in the list of `config.qualities`\n * @param quality the quality prop passed to the image component\n * @param config the \"images\" configuration from next.config.js\n * @returns the closest matching quality value\n */\nexport function findClosestQuality(\n quality: number | undefined,\n config: NextConfig['images'] | undefined\n): number {\n const q = quality || 75\n if (!config?.qualities?.length) {\n return q\n }\n return config.qualities.reduce(\n (prev, cur) => (Math.abs(cur - q) < Math.abs(prev - q) ? cur : prev),\n 0\n )\n}\n"],"names":["findClosestQuality","quality","config","q","qualities","length","reduce","prev","cur","Math","abs"],"mappings":";;;;+BAQgBA;;;eAAAA;;;AAAT,SAASA,mBACdC,OAA2B,EAC3BC,MAAwC;IAExC,MAAMC,IAAIF,WAAW;IACrB,IAAI,CAACC,QAAQE,WAAWC,QAAQ;QAC9B,OAAOF;IACT;IACA,OAAOD,OAAOE,SAAS,CAACE,MAAM,CAC5B,CAACC,MAAMC,MAASC,KAAKC,GAAG,CAACF,MAAML,KAAKM,KAAKC,GAAG,CAACH,OAAOJ,KAAKK,MAAMD,MAC/D;AAEJ","ignoreList":[0]}

View File

@@ -0,0 +1,13 @@
declare const FNV_PRIMES: {
readonly 32: bigint;
readonly 64: bigint;
readonly 128: bigint;
readonly 256: bigint;
readonly 512: bigint;
readonly 1024: bigint;
};
export default function fnv1a(inputString: string, { size, seed, }?: {
size?: keyof typeof FNV_PRIMES;
seed?: number;
}): bigint;
export {};

View File

@@ -0,0 +1,56 @@
// source: https://github.com/sindresorhus/fnv1a
// FNV_PRIMES and FNV_OFFSETS from
// http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return fnv1a;
}
});
const FNV_PRIMES = {
32: BigInt(16777619),
64: BigInt(1099511628211),
128: BigInt(309485009821345068724781371),
256: BigInt(374144419156711147060143317175368453031918731002211),
512: BigInt(35835915874844867368919076489095108449946327955754392558399825615420669938882575126094039892345713852759),
1024: BigInt(5016456510113118655434598811035278955030765345404790744303017523831112055108147451509157692220295382716162651878526895249385292291816524375083746691371804094271873160484737966720260389217684476157468082573)
};
const FNV_OFFSETS = {
32: BigInt(2166136261),
64: BigInt(14695981039346656037),
128: BigInt(144066263297769815596495629667062367629),
256: BigInt(100029257958052580907070968620625704837092796014241193945225284501741471925557),
512: BigInt(9659303129496669498009435400716310466090418745672637896108374329434462657994582932197716438449813051892206539805784495328239340083876191928701583869517785),
1024: BigInt(14197795064947621068722070641403218320880622795441933960878474914617582723252296732303717722150864096521202355549365628174669108571814760471015076148029755969804077320157692458563003215304957150157403644460363550505412711285966361610267868082893823963790439336411086884584107735010676915)
};
function fnv1a(inputString, { size = 32, seed = 0 } = {}) {
if (!FNV_PRIMES[size]) {
throw Object.defineProperty(new Error('The `size` option must be one of 32, 64, 128, 256, 512, or 1024'), "__NEXT_ERROR_CODE", {
value: "E462",
enumerable: false,
configurable: true
});
}
let hash = FNV_OFFSETS[size] ^ BigInt(seed);
const fnvPrime = FNV_PRIMES[size];
// Handle Unicode code points > 0x7f
let isUnicoded = false;
for(let index = 0; index < inputString.length; index++){
let characterCode = inputString.charCodeAt(index);
// Non-ASCII characters trigger the Unicode escape logic
if (characterCode > 0x7f && !isUnicoded) {
inputString = unescape(encodeURIComponent(inputString));
characterCode = inputString.charCodeAt(index);
isUnicoded = true;
}
hash ^= BigInt(characterCode);
hash = BigInt.asUintN(size, hash * fnvPrime);
}
return hash;
}
//# sourceMappingURL=fnv1a.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/fnv1a.ts"],"sourcesContent":["// source: https://github.com/sindresorhus/fnv1a\n// FNV_PRIMES and FNV_OFFSETS from\n// http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param\n\nconst FNV_PRIMES = {\n 32: BigInt(16_777_619),\n 64: BigInt(1_099_511_628_211),\n 128: BigInt(309_485_009_821_345_068_724_781_371),\n 256: BigInt(\n 374_144_419_156_711_147_060_143_317_175_368_453_031_918_731_002_211\n ),\n 512: BigInt(\n 35_835_915_874_844_867_368_919_076_489_095_108_449_946_327_955_754_392_558_399_825_615_420_669_938_882_575_126_094_039_892_345_713_852_759\n ),\n 1024: BigInt(\n 5_016_456_510_113_118_655_434_598_811_035_278_955_030_765_345_404_790_744_303_017_523_831_112_055_108_147_451_509_157_692_220_295_382_716_162_651_878_526_895_249_385_292_291_816_524_375_083_746_691_371_804_094_271_873_160_484_737_966_720_260_389_217_684_476_157_468_082_573\n ),\n} as const\n\nconst FNV_OFFSETS = {\n 32: BigInt(2_166_136_261),\n 64: BigInt(14_695_981_039_346_656_037),\n 128: BigInt(144_066_263_297_769_815_596_495_629_667_062_367_629),\n 256: BigInt(\n 100_029_257_958_052_580_907_070_968_620_625_704_837_092_796_014_241_193_945_225_284_501_741_471_925_557\n ),\n 512: BigInt(\n 9_659_303_129_496_669_498_009_435_400_716_310_466_090_418_745_672_637_896_108_374_329_434_462_657_994_582_932_197_716_438_449_813_051_892_206_539_805_784_495_328_239_340_083_876_191_928_701_583_869_517_785\n ),\n 1024: BigInt(\n 14_197_795_064_947_621_068_722_070_641_403_218_320_880_622_795_441_933_960_878_474_914_617_582_723_252_296_732_303_717_722_150_864_096_521_202_355_549_365_628_174_669_108_571_814_760_471_015_076_148_029_755_969_804_077_320_157_692_458_563_003_215_304_957_150_157_403_644_460_363_550_505_412_711_285_966_361_610_267_868_082_893_823_963_790_439_336_411_086_884_584_107_735_010_676_915\n ),\n} as const\n\nexport default function fnv1a(\n inputString: string,\n {\n size = 32,\n seed = 0,\n }: {\n size?: keyof typeof FNV_PRIMES\n seed?: number\n } = {}\n) {\n if (!FNV_PRIMES[size]) {\n throw new Error(\n 'The `size` option must be one of 32, 64, 128, 256, 512, or 1024'\n )\n }\n\n let hash: bigint = FNV_OFFSETS[size] ^ BigInt(seed)\n const fnvPrime = FNV_PRIMES[size]\n\n // Handle Unicode code points > 0x7f\n let isUnicoded = false\n\n for (let index = 0; index < inputString.length; index++) {\n let characterCode = inputString.charCodeAt(index)\n\n // Non-ASCII characters trigger the Unicode escape logic\n if (characterCode > 0x7f && !isUnicoded) {\n inputString = unescape(encodeURIComponent(inputString))\n characterCode = inputString.charCodeAt(index)\n isUnicoded = true\n }\n\n hash ^= BigInt(characterCode)\n hash = BigInt.asUintN(size, hash * fnvPrime)\n }\n\n return hash\n}\n"],"names":["fnv1a","FNV_PRIMES","BigInt","FNV_OFFSETS","inputString","size","seed","Error","hash","fnvPrime","isUnicoded","index","length","characterCode","charCodeAt","unescape","encodeURIComponent","asUintN"],"mappings":"AAAA,gDAAgD;AAChD,kCAAkC;AAClC,iEAAiE;;;;;+BAgCjE;;;eAAwBA;;;AA9BxB,MAAMC,aAAa;IACjB,IAAIC,OAAO;IACX,IAAIA,OAAO;IACX,KAAKA,OAAO;IACZ,KAAKA,OACH;IAEF,KAAKA,OACH;IAEF,MAAMA,OACJ;AAEJ;AAEA,MAAMC,cAAc;IAClB,IAAID,OAAO;IACX,IAAIA,OAAO;IACX,KAAKA,OAAO;IACZ,KAAKA,OACH;IAEF,KAAKA,OACH;IAEF,MAAMA,OACJ;AAEJ;AAEe,SAASF,MACtBI,WAAmB,EACnB,EACEC,OAAO,EAAE,EACTC,OAAO,CAAC,EAIT,GAAG,CAAC,CAAC;IAEN,IAAI,CAACL,UAAU,CAACI,KAAK,EAAE;QACrB,MAAM,qBAEL,CAFK,IAAIE,MACR,oEADI,qBAAA;mBAAA;wBAAA;0BAAA;QAEN;IACF;IAEA,IAAIC,OAAeL,WAAW,CAACE,KAAK,GAAGH,OAAOI;IAC9C,MAAMG,WAAWR,UAAU,CAACI,KAAK;IAEjC,oCAAoC;IACpC,IAAIK,aAAa;IAEjB,IAAK,IAAIC,QAAQ,GAAGA,QAAQP,YAAYQ,MAAM,EAAED,QAAS;QACvD,IAAIE,gBAAgBT,YAAYU,UAAU,CAACH;QAE3C,wDAAwD;QACxD,IAAIE,gBAAgB,QAAQ,CAACH,YAAY;YACvCN,cAAcW,SAASC,mBAAmBZ;YAC1CS,gBAAgBT,YAAYU,UAAU,CAACH;YACvCD,aAAa;QACf;QAEAF,QAAQN,OAAOW;QACfL,OAAON,OAAOe,OAAO,CAACZ,MAAMG,OAAOC;IACrC;IAEA,OAAOD;AACT","ignoreList":[0]}

View File

@@ -0,0 +1 @@
export default function formatWebpackMessages(json: any, verbose?: boolean): any;

View File

@@ -0,0 +1,164 @@
/**
MIT License
Copyright (c) 2015-present, Facebook, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return formatWebpackMessages;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _stripansi = /*#__PURE__*/ _interop_require_default._(require("next/dist/compiled/strip-ansi"));
// This file is based on https://github.com/facebook/create-react-app/blob/7b1a32be6ec9f99a6c9a3c66813f3ac09c4736b9/packages/react-dev-utils/formatWebpackMessages.js
// It's been edited to remove chalk and CRA-specific logic
const friendlySyntaxErrorLabel = 'Syntax error:';
const WEBPACK_BREAKING_CHANGE_POLYFILLS = '\n\nBREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.';
function isLikelyASyntaxError(message) {
return (0, _stripansi.default)(message).includes(friendlySyntaxErrorLabel);
}
let hadMissingSassError = false;
// Cleans up webpack error messages.
function formatMessage(message, verbose, importTraceNote) {
// TODO: Replace this once webpack 5 is stable
if (typeof message === 'object' && message.message) {
const filteredModuleTrace = message.moduleTrace && message.moduleTrace.filter((trace)=>!/next-(middleware|client-pages|route|edge-function)-loader\.js/.test(trace.originName));
let body = message.message;
const breakingChangeIndex = body.indexOf(WEBPACK_BREAKING_CHANGE_POLYFILLS);
if (breakingChangeIndex >= 0) {
body = body.slice(0, breakingChangeIndex);
}
// TODO: Rspack currently doesn't populate moduleName correctly in some cases,
// fall back to moduleIdentifier as a workaround
if (process.env.NEXT_RSPACK && !message.moduleName && !message.file && message.moduleIdentifier) {
const parts = message.moduleIdentifier.split('!');
message.moduleName = parts[parts.length - 1];
}
message = (message.moduleName ? (0, _stripansi.default)(message.moduleName) + '\n' : '') + (message.file ? (0, _stripansi.default)(message.file) + '\n' : '') + body + (message.details && verbose ? '\n' + message.details : '') + (filteredModuleTrace && filteredModuleTrace.length ? (importTraceNote || '\n\nImport trace for requested module:') + filteredModuleTrace.map((trace)=>`\n${trace.moduleName}`).join('') : '') + (message.stack && verbose ? '\n' + message.stack : '');
}
let lines = message.split('\n');
// Strip Webpack-added headers off errors/warnings
// https://github.com/webpack/webpack/blob/master/lib/ModuleError.js
lines = lines.filter((line)=>!/Module [A-z ]+\(from/.test(line));
// Transform parsing error into syntax error
// TODO: move this to our ESLint formatter?
lines = lines.map((line)=>{
const parsingError = /Line (\d+):(?:(\d+):)?\s*Parsing error: (.+)$/.exec(line);
if (!parsingError) {
return line;
}
const [, errorLine, errorColumn, errorMessage] = parsingError;
return `${friendlySyntaxErrorLabel} ${errorMessage} (${errorLine}:${errorColumn})`;
});
message = lines.join('\n');
// Smoosh syntax errors (commonly found in CSS)
message = message.replace(/SyntaxError\s+\((\d+):(\d+)\)\s*(.+?)\n/g, `${friendlySyntaxErrorLabel} $3 ($1:$2)\n`);
// Clean up export errors
message = message.replace(/^.*export '(.+?)' was not found in '(.+?)'.*$/gm, `Attempted import error: '$1' is not exported from '$2'.`);
message = message.replace(/^.*export 'default' \(imported as '(.+?)'\) was not found in '(.+?)'.*$/gm, `Attempted import error: '$2' does not contain a default export (imported as '$1').`);
message = message.replace(/^.*export '(.+?)' \(imported as '(.+?)'\) was not found in '(.+?)'.*$/gm, `Attempted import error: '$1' is not exported from '$3' (imported as '$2').`);
lines = message.split('\n');
// Remove leading newline
if (lines.length > 2 && lines[1].trim() === '') {
lines.splice(1, 1);
}
// Cleans up verbose "module not found" messages for files and packages.
if (lines[1] && lines[1].startsWith('Module not found: ')) {
lines = [
lines[0],
lines[1].replace('Error: ', '').replace('Module not found: Cannot find file:', 'Cannot find file:'),
...lines.slice(2)
];
}
// Add helpful message for users trying to use Sass for the first time
if (lines[1] && lines[1].match(/Cannot find module.+sass/)) {
// ./file.module.scss (<<loader info>>) => ./file.module.scss
const firstLine = lines[0].split('!');
lines[0] = firstLine[firstLine.length - 1];
lines[1] = "To use Next.js' built-in Sass support, you first need to install `sass`.\n";
lines[1] += 'Run `npm i sass` or `yarn add sass` inside your workspace.\n';
lines[1] += '\nLearn more: https://nextjs.org/docs/messages/install-sass';
// dispose of unhelpful stack trace
lines = lines.slice(0, 2);
hadMissingSassError = true;
} else if (hadMissingSassError && message.match(/(sass-loader|resolve-url-loader: CSS error)/)) {
// dispose of unhelpful stack trace following missing sass module
lines = [];
}
if (!verbose) {
message = lines.join('\n');
// Internal stacks are generally useless so we strip them... with the
// exception of stacks containing `webpack:` because they're normally
// from user code generated by Webpack. For more information see
// https://github.com/facebook/create-react-app/pull/1050
message = message.replace(/^\s*at\s((?!webpack:).)*:\d+:\d+[\s)]*(\n|$)/gm, '') // at ... ...:x:y
;
message = message.replace(/^\s*at\s<anonymous>(\n|$)/gm, '') // at <anonymous>
;
message = message.replace(/File was processed with these loaders:\n(.+[\\/](next[\\/]dist[\\/].+|@next[\\/]react-refresh-utils[\\/]loader)\.js\n)*You may need an additional loader to handle the result of these loaders.\n/g, '');
lines = message.split('\n');
}
// Remove duplicated newlines
lines = lines.filter((line, index, arr)=>index === 0 || line.trim() !== '' || line.trim() !== arr[index - 1].trim());
// Reassemble the message
message = lines.join('\n');
return message.trim();
}
function formatWebpackMessages(json, verbose) {
const formattedErrors = json.errors.map((message)=>{
const isUnknownNextFontError = message.message.includes('An error occurred in `next/font`.');
return formatMessage(message, isUnknownNextFontError || verbose);
});
const formattedWarnings = json.warnings.map((message)=>{
return formatMessage(message, verbose);
});
// Reorder errors to put the most relevant ones first.
let reactServerComponentsError = -1;
for(let i = 0; i < formattedErrors.length; i++){
const error = formattedErrors[i];
if (error.includes('ReactServerComponentsError')) {
reactServerComponentsError = i;
break;
}
}
// Move the reactServerComponentsError to the top if it exists
if (reactServerComponentsError !== -1) {
const error = formattedErrors.splice(reactServerComponentsError, 1);
formattedErrors.unshift(error[0]);
}
const result = {
...json,
errors: formattedErrors,
warnings: formattedWarnings
};
if (!verbose && result.errors.some(isLikelyASyntaxError)) {
// If there are any syntax errors, show just them.
result.errors = result.errors.filter(isLikelyASyntaxError);
result.warnings = [];
}
return result;
}
//# sourceMappingURL=format-webpack-messages.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,10 @@
import type { OutgoingHttpHeaders } from 'http';
/**
* Takes an object with a hostname property (like a parsed URL) and some
* headers that may contain Host and returns the preferred hostname.
* @param parsed An object containing a hostname property.
* @param headers A dictionary with headers containing a `host`.
*/
export declare function getHostname(parsed: {
hostname?: string | null;
}, headers?: OutgoingHttpHeaders): string | undefined;

View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getHostname", {
enumerable: true,
get: function() {
return getHostname;
}
});
function getHostname(parsed, headers) {
// Get the hostname from the headers if it exists, otherwise use the parsed
// hostname.
let hostname;
if (headers?.host && !Array.isArray(headers.host)) {
hostname = headers.host.toString().split(':', 1)[0];
} else if (parsed.hostname) {
hostname = parsed.hostname;
} else return;
return hostname.toLowerCase();
}
//# sourceMappingURL=get-hostname.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/get-hostname.ts"],"sourcesContent":["import type { OutgoingHttpHeaders } from 'http'\n\n/**\n * Takes an object with a hostname property (like a parsed URL) and some\n * headers that may contain Host and returns the preferred hostname.\n * @param parsed An object containing a hostname property.\n * @param headers A dictionary with headers containing a `host`.\n */\nexport function getHostname(\n parsed: { hostname?: string | null },\n headers?: OutgoingHttpHeaders\n): string | undefined {\n // Get the hostname from the headers if it exists, otherwise use the parsed\n // hostname.\n let hostname: string\n if (headers?.host && !Array.isArray(headers.host)) {\n hostname = headers.host.toString().split(':', 1)[0]\n } else if (parsed.hostname) {\n hostname = parsed.hostname\n } else return\n\n return hostname.toLowerCase()\n}\n"],"names":["getHostname","parsed","headers","hostname","host","Array","isArray","toString","split","toLowerCase"],"mappings":";;;;+BAQgBA;;;eAAAA;;;AAAT,SAASA,YACdC,MAAoC,EACpCC,OAA6B;IAE7B,2EAA2E;IAC3E,YAAY;IACZ,IAAIC;IACJ,IAAID,SAASE,QAAQ,CAACC,MAAMC,OAAO,CAACJ,QAAQE,IAAI,GAAG;QACjDD,WAAWD,QAAQE,IAAI,CAACG,QAAQ,GAAGC,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE;IACrD,OAAO,IAAIP,OAAOE,QAAQ,EAAE;QAC1BA,WAAWF,OAAOE,QAAQ;IAC5B,OAAO;IAEP,OAAOA,SAASM,WAAW;AAC7B","ignoreList":[0]}

View File

@@ -0,0 +1,95 @@
import type { ImageConfigComplete, ImageLoaderProps, ImageLoaderPropsWithConfig } from './image-config';
import type { CSSProperties, JSX } from 'react';
export interface StaticImageData {
src: string;
height: number;
width: number;
blurDataURL?: string;
blurWidth?: number;
blurHeight?: number;
}
export interface StaticRequire {
default: StaticImageData;
}
export type StaticImport = StaticRequire | StaticImageData;
export type ImageProps = Omit<JSX.IntrinsicElements['img'], 'src' | 'srcSet' | 'ref' | 'alt' | 'width' | 'height' | 'loading'> & {
src: string | StaticImport;
alt: string;
width?: number | `${number}`;
height?: number | `${number}`;
fill?: boolean;
loader?: ImageLoader;
quality?: number | `${number}`;
preload?: boolean;
/**
* @deprecated Use `preload` prop instead.
* See https://nextjs.org/docs/app/api-reference/components/image#preload
*/
priority?: boolean;
loading?: LoadingValue;
placeholder?: PlaceholderValue;
blurDataURL?: string;
unoptimized?: boolean;
overrideSrc?: string;
/**
* @deprecated Use `onLoad` instead.
* @see https://nextjs.org/docs/app/api-reference/components/image#onload
*/
onLoadingComplete?: OnLoadingComplete;
/**
* @deprecated Use `fill` prop instead of `layout="fill"` or change import to `next/legacy/image`.
* @see https://nextjs.org/docs/api-reference/next/legacy/image
*/
layout?: string;
/**
* @deprecated Use `style` prop instead.
*/
objectFit?: string;
/**
* @deprecated Use `style` prop instead.
*/
objectPosition?: string;
/**
* @deprecated This prop does not do anything.
*/
lazyBoundary?: string;
/**
* @deprecated This prop does not do anything.
*/
lazyRoot?: string;
};
export type ImgProps = Omit<ImageProps, 'src' | 'loader'> & {
loading: LoadingValue;
width: number | undefined;
height: number | undefined;
style: NonNullable<JSX.IntrinsicElements['img']['style']>;
sizes: string | undefined;
srcSet: string | undefined;
src: string;
};
declare const VALID_LOADING_VALUES: readonly ["lazy", "eager", undefined];
type LoadingValue = (typeof VALID_LOADING_VALUES)[number];
export type ImageLoader = (p: ImageLoaderProps) => string;
type ImageLoaderWithConfig = (p: ImageLoaderPropsWithConfig) => string;
export type PlaceholderValue = 'blur' | 'empty' | `data:image/${string}`;
export type OnLoad = React.ReactEventHandler<HTMLImageElement> | undefined;
export type OnLoadingComplete = (img: HTMLImageElement) => void;
export type PlaceholderStyle = Partial<Pick<CSSProperties, 'backgroundSize' | 'backgroundPosition' | 'backgroundRepeat' | 'backgroundImage'>>;
/**
* A shared function, used on both client and server, to generate the props for <img>.
*/
export declare function getImgProps({ src, sizes, unoptimized, priority, preload, loading, className, quality, width, height, fill, style, overrideSrc, onLoad, onLoadingComplete, placeholder, blurDataURL, fetchPriority, decoding, layout, objectFit, objectPosition, lazyBoundary, lazyRoot, ...rest }: ImageProps, _state: {
defaultLoader: ImageLoaderWithConfig;
imgConf: ImageConfigComplete;
showAltText?: boolean;
blurComplete?: boolean;
}): {
props: ImgProps;
meta: {
unoptimized: boolean;
preload: boolean;
placeholder: NonNullable<ImageProps['placeholder']>;
fill: boolean;
};
};
export {};

View File

@@ -0,0 +1,579 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getImgProps", {
enumerable: true,
get: function() {
return getImgProps;
}
});
const _warnonce = require("./utils/warn-once");
const _deploymentid = require("./deployment-id");
const _imageblursvg = require("./image-blur-svg");
const _imageconfig = require("./image-config");
const VALID_LOADING_VALUES = [
'lazy',
'eager',
undefined
];
// Object-fit values that are not valid background-size values
const INVALID_BACKGROUND_SIZE_VALUES = [
'-moz-initial',
'fill',
'none',
'scale-down',
undefined
];
function isStaticRequire(src) {
return src.default !== undefined;
}
function isStaticImageData(src) {
return src.src !== undefined;
}
function isStaticImport(src) {
return !!src && typeof src === 'object' && (isStaticRequire(src) || isStaticImageData(src));
}
const allImgs = new Map();
let perfObserver;
function getInt(x) {
if (typeof x === 'undefined') {
return x;
}
if (typeof x === 'number') {
return Number.isFinite(x) ? x : NaN;
}
if (typeof x === 'string' && /^[0-9]+$/.test(x)) {
return parseInt(x, 10);
}
return NaN;
}
function getWidths({ deviceSizes, allSizes }, width, sizes) {
if (sizes) {
// Find all the "vw" percent sizes used in the sizes prop
const viewportWidthRe = /(^|\s)(1?\d?\d)vw/g;
const percentSizes = [];
for(let match; match = viewportWidthRe.exec(sizes); match){
percentSizes.push(parseInt(match[2]));
}
if (percentSizes.length) {
const smallestRatio = Math.min(...percentSizes) * 0.01;
return {
widths: allSizes.filter((s)=>s >= deviceSizes[0] * smallestRatio),
kind: 'w'
};
}
return {
widths: allSizes,
kind: 'w'
};
}
if (typeof width !== 'number') {
return {
widths: deviceSizes,
kind: 'w'
};
}
const widths = [
...new Set(// > This means that most OLED screens that say they are 3x resolution,
// > are actually 3x in the green color, but only 1.5x in the red and
// > blue colors. Showing a 3x resolution image in the app vs a 2x
// > resolution image will be visually the same, though the 3x image
// > takes significantly more data. Even true 3x resolution screens are
// > wasteful as the human eye cannot see that level of detail without
// > something like a magnifying glass.
// https://blog.twitter.com/engineering/en_us/topics/infrastructure/2019/capping-image-fidelity-on-ultra-high-resolution-devices.html
[
width,
width * 2 /*, width * 3*/
].map((w)=>allSizes.find((p)=>p >= w) || allSizes[allSizes.length - 1]))
];
return {
widths,
kind: 'x'
};
}
function generateImgAttrs({ config, src, unoptimized, width, quality, sizes, loader }) {
if (unoptimized) {
const deploymentId = (0, _deploymentid.getDeploymentId)();
if (src.startsWith('/') && !src.startsWith('//') && deploymentId) {
const sep = src.includes('?') ? '&' : '?';
src = `${src}${sep}dpl=${deploymentId}`;
}
return {
src,
srcSet: undefined,
sizes: undefined
};
}
const { widths, kind } = getWidths(config, width, sizes);
const last = widths.length - 1;
return {
sizes: !sizes && kind === 'w' ? '100vw' : sizes,
srcSet: widths.map((w, i)=>`${loader({
config,
src,
quality,
width: w
})} ${kind === 'w' ? w : i + 1}${kind}`).join(', '),
// It's intended to keep `src` the last attribute because React updates
// attributes in order. If we keep `src` the first one, Safari will
// immediately start to fetch `src`, before `sizes` and `srcSet` are even
// updated by React. That causes multiple unnecessary requests if `srcSet`
// and `sizes` are defined.
// This bug cannot be reproduced in Chrome or Firefox.
src: loader({
config,
src,
quality,
width: widths[last]
})
};
}
function getImgProps({ src, sizes, unoptimized = false, priority = false, preload = false, loading, className, quality, width, height, fill = false, style, overrideSrc, onLoad, onLoadingComplete, placeholder = 'empty', blurDataURL, fetchPriority, decoding = 'async', layout, objectFit, objectPosition, lazyBoundary, lazyRoot, ...rest }, _state) {
const { imgConf, showAltText, blurComplete, defaultLoader } = _state;
let config;
let c = imgConf || _imageconfig.imageConfigDefault;
if ('allSizes' in c) {
config = c;
} else {
const allSizes = [
...c.deviceSizes,
...c.imageSizes
].sort((a, b)=>a - b);
const deviceSizes = c.deviceSizes.sort((a, b)=>a - b);
const qualities = c.qualities?.sort((a, b)=>a - b);
config = {
...c,
allSizes,
deviceSizes,
qualities
};
}
if (typeof defaultLoader === 'undefined') {
throw Object.defineProperty(new Error('images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config'), "__NEXT_ERROR_CODE", {
value: "E163",
enumerable: false,
configurable: true
});
}
let loader = rest.loader || defaultLoader;
// Remove property so it's not spread on <img> element
delete rest.loader;
delete rest.srcSet;
// This special value indicates that the user
// didn't define a "loader" prop or "loader" config.
const isDefaultLoader = '__next_img_default' in loader;
if (isDefaultLoader) {
if (config.loader === 'custom') {
throw Object.defineProperty(new Error(`Image with src "${src}" is missing "loader" prop.` + `\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader`), "__NEXT_ERROR_CODE", {
value: "E252",
enumerable: false,
configurable: true
});
}
} else {
// The user defined a "loader" prop or config.
// Since the config object is internal only, we
// must not pass it to the user-defined "loader".
const customImageLoader = loader;
loader = (obj)=>{
const { config: _, ...opts } = obj;
return customImageLoader(opts);
};
}
if (layout) {
if (layout === 'fill') {
fill = true;
}
const layoutToStyle = {
intrinsic: {
maxWidth: '100%',
height: 'auto'
},
responsive: {
width: '100%',
height: 'auto'
}
};
const layoutToSizes = {
responsive: '100vw',
fill: '100vw'
};
const layoutStyle = layoutToStyle[layout];
if (layoutStyle) {
style = {
...style,
...layoutStyle
};
}
const layoutSizes = layoutToSizes[layout];
if (layoutSizes && !sizes) {
sizes = layoutSizes;
}
}
let staticSrc = '';
let widthInt = getInt(width);
let heightInt = getInt(height);
let blurWidth;
let blurHeight;
if (isStaticImport(src)) {
const staticImageData = isStaticRequire(src) ? src.default : src;
if (!staticImageData.src) {
throw Object.defineProperty(new Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(staticImageData)}`), "__NEXT_ERROR_CODE", {
value: "E460",
enumerable: false,
configurable: true
});
}
if (!staticImageData.height || !staticImageData.width) {
throw Object.defineProperty(new Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(staticImageData)}`), "__NEXT_ERROR_CODE", {
value: "E48",
enumerable: false,
configurable: true
});
}
blurWidth = staticImageData.blurWidth;
blurHeight = staticImageData.blurHeight;
blurDataURL = blurDataURL || staticImageData.blurDataURL;
staticSrc = staticImageData.src;
if (!fill) {
if (!widthInt && !heightInt) {
widthInt = staticImageData.width;
heightInt = staticImageData.height;
} else if (widthInt && !heightInt) {
const ratio = widthInt / staticImageData.width;
heightInt = Math.round(staticImageData.height * ratio);
} else if (!widthInt && heightInt) {
const ratio = heightInt / staticImageData.height;
widthInt = Math.round(staticImageData.width * ratio);
}
}
}
src = typeof src === 'string' ? src : staticSrc;
let isLazy = !priority && !preload && (loading === 'lazy' || typeof loading === 'undefined');
if (!src || src.startsWith('data:') || src.startsWith('blob:')) {
// https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
unoptimized = true;
isLazy = false;
}
if (config.unoptimized) {
unoptimized = true;
}
if (isDefaultLoader && !config.dangerouslyAllowSVG && src.split('?', 1)[0].endsWith('.svg')) {
// Special case to make svg serve as-is to avoid proxying
// through the built-in Image Optimization API.
unoptimized = true;
}
const qualityInt = getInt(quality);
if (process.env.NODE_ENV !== 'production') {
if (config.output === 'export' && isDefaultLoader && !unoptimized) {
throw Object.defineProperty(new Error(`Image Optimization using the default loader is not compatible with \`{ output: 'export' }\`.
Possible solutions:
- Remove \`{ output: 'export' }\` and run "next start" to run server mode including the Image Optimization API.
- Configure \`{ images: { unoptimized: true } }\` in \`next.config.js\` to disable the Image Optimization API.
Read more: https://nextjs.org/docs/messages/export-image-api`), "__NEXT_ERROR_CODE", {
value: "E500",
enumerable: false,
configurable: true
});
}
if (!src) {
// React doesn't show the stack trace and there's
// no `src` to help identify which image, so we
// instead console.error(ref) during mount.
unoptimized = true;
} else {
if (fill) {
if (width) {
throw Object.defineProperty(new Error(`Image with src "${src}" has both "width" and "fill" properties. Only one should be used.`), "__NEXT_ERROR_CODE", {
value: "E96",
enumerable: false,
configurable: true
});
}
if (height) {
throw Object.defineProperty(new Error(`Image with src "${src}" has both "height" and "fill" properties. Only one should be used.`), "__NEXT_ERROR_CODE", {
value: "E115",
enumerable: false,
configurable: true
});
}
if (style?.position && style.position !== 'absolute') {
throw Object.defineProperty(new Error(`Image with src "${src}" has both "fill" and "style.position" properties. Images with "fill" always use position absolute - it cannot be modified.`), "__NEXT_ERROR_CODE", {
value: "E216",
enumerable: false,
configurable: true
});
}
if (style?.width && style.width !== '100%') {
throw Object.defineProperty(new Error(`Image with src "${src}" has both "fill" and "style.width" properties. Images with "fill" always use width 100% - it cannot be modified.`), "__NEXT_ERROR_CODE", {
value: "E73",
enumerable: false,
configurable: true
});
}
if (style?.height && style.height !== '100%') {
throw Object.defineProperty(new Error(`Image with src "${src}" has both "fill" and "style.height" properties. Images with "fill" always use height 100% - it cannot be modified.`), "__NEXT_ERROR_CODE", {
value: "E404",
enumerable: false,
configurable: true
});
}
} else {
if (typeof widthInt === 'undefined') {
throw Object.defineProperty(new Error(`Image with src "${src}" is missing required "width" property.`), "__NEXT_ERROR_CODE", {
value: "E451",
enumerable: false,
configurable: true
});
} else if (isNaN(widthInt)) {
throw Object.defineProperty(new Error(`Image with src "${src}" has invalid "width" property. Expected a numeric value in pixels but received "${width}".`), "__NEXT_ERROR_CODE", {
value: "E66",
enumerable: false,
configurable: true
});
}
if (typeof heightInt === 'undefined') {
throw Object.defineProperty(new Error(`Image with src "${src}" is missing required "height" property.`), "__NEXT_ERROR_CODE", {
value: "E397",
enumerable: false,
configurable: true
});
} else if (isNaN(heightInt)) {
throw Object.defineProperty(new Error(`Image with src "${src}" has invalid "height" property. Expected a numeric value in pixels but received "${height}".`), "__NEXT_ERROR_CODE", {
value: "E444",
enumerable: false,
configurable: true
});
}
// eslint-disable-next-line no-control-regex
if (/^[\x00-\x20]/.test(src)) {
throw Object.defineProperty(new Error(`Image with src "${src}" cannot start with a space or control character. Use src.trimStart() to remove it or encodeURIComponent(src) to keep it.`), "__NEXT_ERROR_CODE", {
value: "E176",
enumerable: false,
configurable: true
});
}
// eslint-disable-next-line no-control-regex
if (/[\x00-\x20]$/.test(src)) {
throw Object.defineProperty(new Error(`Image with src "${src}" cannot end with a space or control character. Use src.trimEnd() to remove it or encodeURIComponent(src) to keep it.`), "__NEXT_ERROR_CODE", {
value: "E21",
enumerable: false,
configurable: true
});
}
}
}
if (!VALID_LOADING_VALUES.includes(loading)) {
throw Object.defineProperty(new Error(`Image with src "${src}" has invalid "loading" property. Provided "${loading}" should be one of ${VALID_LOADING_VALUES.map(String).join(',')}.`), "__NEXT_ERROR_CODE", {
value: "E357",
enumerable: false,
configurable: true
});
}
if (priority && loading === 'lazy') {
throw Object.defineProperty(new Error(`Image with src "${src}" has both "priority" and "loading='lazy'" properties. Only one should be used.`), "__NEXT_ERROR_CODE", {
value: "E218",
enumerable: false,
configurable: true
});
}
if (preload && loading === 'lazy') {
throw Object.defineProperty(new Error(`Image with src "${src}" has both "preload" and "loading='lazy'" properties. Only one should be used.`), "__NEXT_ERROR_CODE", {
value: "E803",
enumerable: false,
configurable: true
});
}
if (preload && priority) {
throw Object.defineProperty(new Error(`Image with src "${src}" has both "preload" and "priority" properties. Only "preload" should be used.`), "__NEXT_ERROR_CODE", {
value: "E802",
enumerable: false,
configurable: true
});
}
if (placeholder !== 'empty' && placeholder !== 'blur' && !placeholder.startsWith('data:image/')) {
throw Object.defineProperty(new Error(`Image with src "${src}" has invalid "placeholder" property "${placeholder}".`), "__NEXT_ERROR_CODE", {
value: "E431",
enumerable: false,
configurable: true
});
}
if (placeholder !== 'empty') {
if (widthInt && heightInt && widthInt * heightInt < 1600) {
(0, _warnonce.warnOnce)(`Image with src "${src}" is smaller than 40x40. Consider removing the "placeholder" property to improve performance.`);
}
}
if (qualityInt && config.qualities && !config.qualities.includes(qualityInt)) {
(0, _warnonce.warnOnce)(`Image with src "${src}" is using quality "${qualityInt}" which is not configured in images.qualities [${config.qualities.join(', ')}]. Please update your config to [${[
...config.qualities,
qualityInt
].sort().join(', ')}].` + `\nRead more: https://nextjs.org/docs/messages/next-image-unconfigured-qualities`);
}
if (placeholder === 'blur' && !blurDataURL) {
const VALID_BLUR_EXT = [
'jpeg',
'png',
'webp',
'avif'
] // should match next-image-loader
;
throw Object.defineProperty(new Error(`Image with src "${src}" has "placeholder='blur'" property but is missing the "blurDataURL" property.
Possible solutions:
- Add a "blurDataURL" property, the contents should be a small Data URL to represent the image
- Change the "src" property to a static import with one of the supported file types: ${VALID_BLUR_EXT.join(',')} (animated images not supported)
- Remove the "placeholder" property, effectively no blur effect
Read more: https://nextjs.org/docs/messages/placeholder-blur-data-url`), "__NEXT_ERROR_CODE", {
value: "E371",
enumerable: false,
configurable: true
});
}
if ('ref' in rest) {
(0, _warnonce.warnOnce)(`Image with src "${src}" is using unsupported "ref" property. Consider using the "onLoad" property instead.`);
}
if (!unoptimized && !isDefaultLoader) {
const urlStr = loader({
config,
src,
width: widthInt || 400,
quality: qualityInt || 75
});
let url;
try {
url = new URL(urlStr);
} catch (err) {}
if (urlStr === src || url && url.pathname === src && !url.search) {
(0, _warnonce.warnOnce)(`Image with src "${src}" has a "loader" property that does not implement width. Please implement it or use the "unoptimized" property instead.` + `\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader-width`);
}
}
if (onLoadingComplete) {
(0, _warnonce.warnOnce)(`Image with src "${src}" is using deprecated "onLoadingComplete" property. Please use the "onLoad" property instead.`);
}
for (const [legacyKey, legacyValue] of Object.entries({
layout,
objectFit,
objectPosition,
lazyBoundary,
lazyRoot
})){
if (legacyValue) {
(0, _warnonce.warnOnce)(`Image with src "${src}" has legacy prop "${legacyKey}". Did you forget to run the codemod?` + `\nRead more: https://nextjs.org/docs/messages/next-image-upgrade-to-13`);
}
}
if (typeof window !== 'undefined' && !perfObserver && window.PerformanceObserver) {
perfObserver = new PerformanceObserver((entryList)=>{
for (const entry of entryList.getEntries()){
// @ts-ignore - missing "LargestContentfulPaint" class with "element" prop
const imgSrc = entry?.element?.src || '';
const lcpImage = allImgs.get(imgSrc);
if (lcpImage && lcpImage.loading === 'lazy' && lcpImage.placeholder === 'empty' && !lcpImage.src.startsWith('data:') && !lcpImage.src.startsWith('blob:')) {
// https://web.dev/lcp/#measure-lcp-in-javascript
(0, _warnonce.warnOnce)(`Image with src "${lcpImage.src}" was detected as the Largest Contentful Paint (LCP). Please add the \`loading="eager"\` property if this image is above the fold.` + `\nRead more: https://nextjs.org/docs/app/api-reference/components/image#loading`);
}
}
});
try {
perfObserver.observe({
type: 'largest-contentful-paint',
buffered: true
});
} catch (err) {
// Log error but don't crash the app
console.error(err);
}
}
}
const imgStyle = Object.assign(fill ? {
position: 'absolute',
height: '100%',
width: '100%',
left: 0,
top: 0,
right: 0,
bottom: 0,
objectFit,
objectPosition
} : {}, showAltText ? {} : {
color: 'transparent'
}, style);
const backgroundImage = !blurComplete && placeholder !== 'empty' ? placeholder === 'blur' ? `url("data:image/svg+xml;charset=utf-8,${(0, _imageblursvg.getImageBlurSvg)({
widthInt,
heightInt,
blurWidth,
blurHeight,
blurDataURL: blurDataURL || '',
objectFit: imgStyle.objectFit
})}")` : `url("${placeholder}")` // assume `data:image/`
: null;
const backgroundSize = !INVALID_BACKGROUND_SIZE_VALUES.includes(imgStyle.objectFit) ? imgStyle.objectFit : imgStyle.objectFit === 'fill' ? '100% 100%' // the background-size equivalent of `fill`
: 'cover';
let placeholderStyle = backgroundImage ? {
backgroundSize,
backgroundPosition: imgStyle.objectPosition || '50% 50%',
backgroundRepeat: 'no-repeat',
backgroundImage
} : {};
if (process.env.NODE_ENV === 'development') {
if (placeholderStyle.backgroundImage && placeholder === 'blur' && blurDataURL?.startsWith('/')) {
// During `next dev`, we don't want to generate blur placeholders with webpack
// because it can delay starting the dev server. Instead, `next-image-loader.js`
// will inline a special url to lazily generate the blur placeholder at request time.
placeholderStyle.backgroundImage = `url("${blurDataURL}")`;
}
}
const imgAttributes = generateImgAttrs({
config,
src,
unoptimized,
width: widthInt,
quality: qualityInt,
sizes,
loader
});
const loadingFinal = isLazy ? 'lazy' : loading;
if (process.env.NODE_ENV !== 'production') {
if (typeof window !== 'undefined') {
let fullUrl;
try {
fullUrl = new URL(imgAttributes.src);
} catch (e) {
fullUrl = new URL(imgAttributes.src, window.location.href);
}
allImgs.set(fullUrl.href, {
src,
loading: loadingFinal,
placeholder
});
}
}
const props = {
...rest,
loading: loadingFinal,
fetchPriority,
width: widthInt,
height: heightInt,
decoding,
className,
style: {
...imgStyle,
...placeholderStyle
},
sizes: imgAttributes.sizes,
srcSet: imgAttributes.srcSet,
src: overrideSrc || imgAttributes.src
};
const meta = {
unoptimized,
preload: preload || priority,
placeholder,
fill
};
return {
props,
meta
};
}
//# sourceMappingURL=get-img-props.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
export declare function getRspackCore(): any;

View File

@@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getRspackCore", {
enumerable: true,
get: function() {
return getRspackCore;
}
});
const _log = require("../../build/output/log");
function getRspackCore() {
warnRspack();
try {
// eslint-disable-next-line @next/internal/typechecked-require
return require('next-rspack/rspack-core');
} catch (e) {
if (e instanceof Error && 'code' in e && e.code === 'MODULE_NOT_FOUND') {
throw Object.defineProperty(new Error('@rspack/core is not available. Please make sure `next-rspack` is correctly installed.'), "__NEXT_ERROR_CODE", {
value: "E647",
enumerable: false,
configurable: true
});
}
throw e;
}
}
function warnRspack() {
if (process.env.__NEXT_TEST_MODE) {
return;
}
(0, _log.warnOnce)(`\`next-rspack\` is currently experimental. It's not an official Next.js plugin, and is supported by the Rspack team in partnership with Next.js. Help improve Next.js and Rspack by providing feedback at https://github.com/vercel/next.js/discussions/77800`);
}
//# sourceMappingURL=get-rspack.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/get-rspack.ts"],"sourcesContent":["import { warnOnce } from '../../build/output/log'\n\nexport function getRspackCore() {\n warnRspack()\n try {\n // eslint-disable-next-line @next/internal/typechecked-require\n return require('next-rspack/rspack-core')\n } catch (e) {\n if (e instanceof Error && 'code' in e && e.code === 'MODULE_NOT_FOUND') {\n throw new Error(\n '@rspack/core is not available. Please make sure `next-rspack` is correctly installed.'\n )\n }\n\n throw e\n }\n}\n\nfunction warnRspack() {\n if (process.env.__NEXT_TEST_MODE) {\n return\n }\n warnOnce(\n `\\`next-rspack\\` is currently experimental. It's not an official Next.js plugin, and is supported by the Rspack team in partnership with Next.js. Help improve Next.js and Rspack by providing feedback at https://github.com/vercel/next.js/discussions/77800`\n )\n}\n"],"names":["getRspackCore","warnRspack","require","e","Error","code","process","env","__NEXT_TEST_MODE","warnOnce"],"mappings":";;;;+BAEgBA;;;eAAAA;;;qBAFS;AAElB,SAASA;IACdC;IACA,IAAI;QACF,8DAA8D;QAC9D,OAAOC,QAAQ;IACjB,EAAE,OAAOC,GAAG;QACV,IAAIA,aAAaC,SAAS,UAAUD,KAAKA,EAAEE,IAAI,KAAK,oBAAoB;YACtE,MAAM,qBAEL,CAFK,IAAID,MACR,0FADI,qBAAA;uBAAA;4BAAA;8BAAA;YAEN;QACF;QAEA,MAAMD;IACR;AACF;AAEA,SAASF;IACP,IAAIK,QAAQC,GAAG,CAACC,gBAAgB,EAAE;QAChC;IACF;IACAC,IAAAA,aAAQ,EACN,CAAC,6PAA6P,CAAC;AAEnQ","ignoreList":[0]}

View File

@@ -0,0 +1,8 @@
import { webpack } from 'next/dist/compiled/webpack/webpack';
/**
* Depending on if Rspack is active or not, returns the appropriate set of
* webpack-compatible api.
*
* @returns webpack bundler
*/
export default function getWebpackBundler(): typeof webpack;

View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, /**
* Depending on if Rspack is active or not, returns the appropriate set of
* webpack-compatible api.
*
* @returns webpack bundler
*/ "default", {
enumerable: true,
get: function() {
return getWebpackBundler;
}
});
const _webpack = require("next/dist/compiled/webpack/webpack");
const _getrspack = require("./get-rspack");
function getWebpackBundler() {
return process.env.NEXT_RSPACK ? (0, _getrspack.getRspackCore)() : _webpack.webpack;
}
//# sourceMappingURL=get-webpack-bundler.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/get-webpack-bundler.ts"],"sourcesContent":["import { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { getRspackCore } from './get-rspack'\n\n/**\n * Depending on if Rspack is active or not, returns the appropriate set of\n * webpack-compatible api.\n *\n * @returns webpack bundler\n */\nexport default function getWebpackBundler(): typeof webpack {\n return process.env.NEXT_RSPACK ? getRspackCore() : webpack\n}\n"],"names":["getWebpackBundler","process","env","NEXT_RSPACK","getRspackCore","webpack"],"mappings":";;;;+BAGA;;;;;CAKC,GACD;;;eAAwBA;;;yBATA;2BACM;AAQf,SAASA;IACtB,OAAOC,QAAQC,GAAG,CAACC,WAAW,GAAGC,IAAAA,wBAAa,MAAKC,gBAAO;AAC5D","ignoreList":[0]}

View File

@@ -0,0 +1,2 @@
export declare function djb2Hash(str: string): number;
export declare function hexHash(str: string): string;

View File

@@ -0,0 +1,42 @@
// http://www.cse.yorku.ca/~oz/hash.html
// More specifically, 32-bit hash via djbxor
// (ref: https://gist.github.com/eplawless/52813b1d8ad9af510d85?permalink_comment_id=3367765#gistcomment-3367765)
// This is due to number type differences between rust for turbopack to js number types,
// where rust does not have easy way to repreesnt js's 53-bit float number type for the matching
// overflow behavior. This is more `correct` in terms of having canonical hash across different runtime / implementation
// as can gaurantee determinstic output from 32bit hash.
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
djb2Hash: null,
hexHash: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
djb2Hash: function() {
return djb2Hash;
},
hexHash: function() {
return hexHash;
}
});
function djb2Hash(str) {
let hash = 5381;
for(let i = 0; i < str.length; i++){
const char = str.charCodeAt(i);
hash = (hash << 5) + hash + char & 0xffffffff;
}
return hash >>> 0;
}
function hexHash(str) {
return djb2Hash(str).toString(36).slice(0, 5);
}
//# sourceMappingURL=hash.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/hash.ts"],"sourcesContent":["// http://www.cse.yorku.ca/~oz/hash.html\n// More specifically, 32-bit hash via djbxor\n// (ref: https://gist.github.com/eplawless/52813b1d8ad9af510d85?permalink_comment_id=3367765#gistcomment-3367765)\n// This is due to number type differences between rust for turbopack to js number types,\n// where rust does not have easy way to repreesnt js's 53-bit float number type for the matching\n// overflow behavior. This is more `correct` in terms of having canonical hash across different runtime / implementation\n// as can gaurantee determinstic output from 32bit hash.\nexport function djb2Hash(str: string) {\n let hash = 5381\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i)\n hash = ((hash << 5) + hash + char) & 0xffffffff\n }\n return hash >>> 0\n}\n\nexport function hexHash(str: string) {\n return djb2Hash(str).toString(36).slice(0, 5)\n}\n"],"names":["djb2Hash","hexHash","str","hash","i","length","char","charCodeAt","toString","slice"],"mappings":"AAAA,wCAAwC;AACxC,4CAA4C;AAC5C,iHAAiH;AACjH,wFAAwF;AACxF,gGAAgG;AAChG,wHAAwH;AACxH,wDAAwD;;;;;;;;;;;;;;;;IACxCA,QAAQ;eAARA;;IASAC,OAAO;eAAPA;;;AATT,SAASD,SAASE,GAAW;IAClC,IAAIC,OAAO;IACX,IAAK,IAAIC,IAAI,GAAGA,IAAIF,IAAIG,MAAM,EAAED,IAAK;QACnC,MAAME,OAAOJ,IAAIK,UAAU,CAACH;QAC5BD,OAAO,AAAEA,CAAAA,QAAQ,CAAA,IAAKA,OAAOG,OAAQ;IACvC;IACA,OAAOH,SAAS;AAClB;AAEO,SAASF,QAAQC,GAAW;IACjC,OAAOF,SAASE,KAAKM,QAAQ,CAAC,IAAIC,KAAK,CAAC,GAAG;AAC7C","ignoreList":[0]}

View File

@@ -0,0 +1,10 @@
import React from 'react';
export declare const HeadManagerContext: React.Context<{
updateHead?: (state: any) => void;
mountedInstances?: any;
updateScripts?: (state: any) => void;
scripts?: any;
getIsSsr?: () => boolean;
appDir?: boolean;
nonce?: string;
}>;

View File

@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "HeadManagerContext", {
enumerable: true,
get: function() {
return HeadManagerContext;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
const HeadManagerContext = _react.default.createContext({});
if (process.env.NODE_ENV !== 'production') {
HeadManagerContext.displayName = 'HeadManagerContext';
}
//# sourceMappingURL=head-manager-context.shared-runtime.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/head-manager-context.shared-runtime.ts"],"sourcesContent":["import React from 'react'\n\nexport const HeadManagerContext: React.Context<{\n updateHead?: (state: any) => void\n mountedInstances?: any\n updateScripts?: (state: any) => void\n scripts?: any\n getIsSsr?: () => boolean\n\n // Used in app directory, to render script tags as server components.\n appDir?: boolean\n nonce?: string\n}> = React.createContext({})\n\nif (process.env.NODE_ENV !== 'production') {\n HeadManagerContext.displayName = 'HeadManagerContext'\n}\n"],"names":["HeadManagerContext","React","createContext","process","env","NODE_ENV","displayName"],"mappings":";;;;+BAEaA;;;eAAAA;;;;gEAFK;AAEX,MAAMA,qBAURC,cAAK,CAACC,aAAa,CAAC,CAAC;AAE1B,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACzCL,mBAAmBM,WAAW,GAAG;AACnC","ignoreList":[0]}

View File

@@ -0,0 +1,10 @@
import React, { type JSX } from 'react';
export declare function defaultHead(): JSX.Element[];
/**
* This component injects elements to `<head>` of your page.
* To avoid duplicated `tags` in `<head>` you can use the `key` property, which will make sure every tag is only rendered once.
*/
declare function Head({ children }: {
children: React.ReactNode;
}): import("react/jsx-runtime").JSX.Element;
export default Head;

View File

@@ -0,0 +1,163 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
default: null,
defaultHead: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
default: function() {
return _default;
},
defaultHead: function() {
return defaultHead;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _jsxruntime = require("react/jsx-runtime");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _sideeffect = /*#__PURE__*/ _interop_require_default._(require("./side-effect"));
const _headmanagercontextsharedruntime = require("./head-manager-context.shared-runtime");
const _warnonce = require("./utils/warn-once");
function defaultHead() {
const head = [
/*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
charSet: "utf-8"
}, "charset"),
/*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
name: "viewport",
content: "width=device-width"
}, "viewport")
];
return head;
}
function onlyReactElement(list, child) {
// React children can be "string" or "number" in this case we ignore them for backwards compat
if (typeof child === 'string' || typeof child === 'number') {
return list;
}
// Adds support for React.Fragment
if (child.type === _react.default.Fragment) {
return list.concat(// @ts-expect-error @types/react does not remove fragments but this could also return ReactPortal[]
_react.default.Children.toArray(child.props.children).reduce(// @ts-expect-error @types/react does not remove fragments but this could also return ReactPortal[]
(fragmentList, fragmentChild)=>{
if (typeof fragmentChild === 'string' || typeof fragmentChild === 'number') {
return fragmentList;
}
return fragmentList.concat(fragmentChild);
}, []));
}
return list.concat(child);
}
const METATYPES = [
'name',
'httpEquiv',
'charSet',
'itemProp'
];
/*
returns a function for filtering head child elements
which shouldn't be duplicated, like <title/>
Also adds support for deduplicated `key` properties
*/ function unique() {
const keys = new Set();
const tags = new Set();
const metaTypes = new Set();
const metaCategories = {};
return (h)=>{
let isUnique = true;
let hasKey = false;
if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {
hasKey = true;
const key = h.key.slice(h.key.indexOf('$') + 1);
if (keys.has(key)) {
isUnique = false;
} else {
keys.add(key);
}
}
// eslint-disable-next-line default-case
switch(h.type){
case 'title':
case 'base':
if (tags.has(h.type)) {
isUnique = false;
} else {
tags.add(h.type);
}
break;
case 'meta':
for(let i = 0, len = METATYPES.length; i < len; i++){
const metatype = METATYPES[i];
if (!h.props.hasOwnProperty(metatype)) continue;
if (metatype === 'charSet') {
if (metaTypes.has(metatype)) {
isUnique = false;
} else {
metaTypes.add(metatype);
}
} else {
const category = h.props[metatype];
const categories = metaCategories[metatype] || new Set();
if ((metatype !== 'name' || !hasKey) && categories.has(category)) {
isUnique = false;
} else {
categories.add(category);
metaCategories[metatype] = categories;
}
}
}
break;
}
return isUnique;
};
}
/**
*
* @param headChildrenElements List of children of <Head>
*/ function reduceComponents(headChildrenElements) {
return headChildrenElements.reduce(onlyReactElement, []).reverse().concat(defaultHead().reverse()).filter(unique()).reverse().map((c, i)=>{
const key = c.key || i;
if (process.env.NODE_ENV === 'development') {
// omit JSON-LD structured data snippets from the warning
if (c.type === 'script' && c.props['type'] !== 'application/ld+json') {
const srcMessage = c.props['src'] ? `<script> tag with src="${c.props['src']}"` : `inline <script>`;
(0, _warnonce.warnOnce)(`Do not add <script> tags using next/head (see ${srcMessage}). Use next/script instead. \nSee more info here: https://nextjs.org/docs/messages/no-script-tags-in-head-component`);
} else if (c.type === 'link' && c.props['rel'] === 'stylesheet') {
(0, _warnonce.warnOnce)(`Do not add stylesheets using next/head (see <link rel="stylesheet"> tag with href="${c.props['href']}"). Use Document instead. \nSee more info here: https://nextjs.org/docs/messages/no-stylesheets-in-head-component`);
}
}
return /*#__PURE__*/ _react.default.cloneElement(c, {
key
});
});
}
/**
* This component injects elements to `<head>` of your page.
* To avoid duplicated `tags` in `<head>` you can use the `key` property, which will make sure every tag is only rendered once.
*/ function Head({ children }) {
const headManager = (0, _react.useContext)(_headmanagercontextsharedruntime.HeadManagerContext);
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_sideeffect.default, {
reduceComponentsToState: reduceComponents,
headManager: headManager,
children: children
});
}
const _default = Head;
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.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,20 @@
import type { Params } from '../../server/request/params';
import { ReadonlyURLSearchParams } from '../../client/components/readonly-url-search-params';
export declare const SearchParamsContext: import("react").Context<URLSearchParams | null>;
export declare const PathnameContext: import("react").Context<string | null>;
export declare const PathParamsContext: import("react").Context<Params | null>;
export type InstrumentedPromise<T> = Promise<T> & {
status: 'fulfilled';
value: T;
displayName: string;
};
export type NavigationPromises = {
pathname: InstrumentedPromise<string>;
searchParams: InstrumentedPromise<ReadonlyURLSearchParams>;
params: InstrumentedPromise<Params>;
selectedLayoutSegmentPromises?: Map<string, InstrumentedPromise<string | null>>;
selectedLayoutSegmentsPromises?: Map<string, InstrumentedPromise<string[]>>;
};
export declare const NavigationPromisesContext: import("react").Context<NavigationPromises | null>;
export declare function createDevToolsInstrumentedPromise<T>(displayName: string, value: T): InstrumentedPromise<T>;
export { ReadonlyURLSearchParams };

View File

@@ -0,0 +1,60 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
NavigationPromisesContext: null,
PathParamsContext: null,
PathnameContext: null,
ReadonlyURLSearchParams: null,
SearchParamsContext: null,
createDevToolsInstrumentedPromise: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
NavigationPromisesContext: function() {
return NavigationPromisesContext;
},
PathParamsContext: function() {
return PathParamsContext;
},
PathnameContext: function() {
return PathnameContext;
},
ReadonlyURLSearchParams: function() {
return _readonlyurlsearchparams.ReadonlyURLSearchParams;
},
SearchParamsContext: function() {
return SearchParamsContext;
},
createDevToolsInstrumentedPromise: function() {
return createDevToolsInstrumentedPromise;
}
});
const _react = require("react");
const _readonlyurlsearchparams = require("../../client/components/readonly-url-search-params");
const SearchParamsContext = (0, _react.createContext)(null);
const PathnameContext = (0, _react.createContext)(null);
const PathParamsContext = (0, _react.createContext)(null);
const NavigationPromisesContext = (0, _react.createContext)(null);
function createDevToolsInstrumentedPromise(displayName, value) {
const promise = Promise.resolve(value);
promise.status = 'fulfilled';
promise.value = value;
promise.displayName = `${displayName} (SSR)`;
return promise;
}
if (process.env.NODE_ENV !== 'production') {
SearchParamsContext.displayName = 'SearchParamsContext';
PathnameContext.displayName = 'PathnameContext';
PathParamsContext.displayName = 'PathParamsContext';
NavigationPromisesContext.displayName = 'NavigationPromisesContext';
}
//# sourceMappingURL=hooks-client-context.shared-runtime.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/hooks-client-context.shared-runtime.ts"],"sourcesContent":["'use client'\n\nimport { createContext } from 'react'\nimport type { Params } from '../../server/request/params'\nimport { ReadonlyURLSearchParams } from '../../client/components/readonly-url-search-params'\n\nexport const SearchParamsContext = createContext<URLSearchParams | null>(null)\nexport const PathnameContext = createContext<string | null>(null)\nexport const PathParamsContext = createContext<Params | null>(null)\n\n// Dev-only context for Suspense DevTools instrumentation\n// These promises are used to track navigation hook usage in React DevTools\nexport type InstrumentedPromise<T> = Promise<T> & {\n status: 'fulfilled'\n value: T\n displayName: string\n}\n\nexport type NavigationPromises = {\n pathname: InstrumentedPromise<string>\n searchParams: InstrumentedPromise<ReadonlyURLSearchParams>\n params: InstrumentedPromise<Params>\n // Layout segment hooks (updated at each layout boundary)\n selectedLayoutSegmentPromises?: Map<\n string,\n InstrumentedPromise<string | null>\n >\n selectedLayoutSegmentsPromises?: Map<string, InstrumentedPromise<string[]>>\n}\n\nexport const NavigationPromisesContext =\n createContext<NavigationPromises | null>(null)\n\n// Creates an instrumented promise for Suspense DevTools\n// These promises are always fulfilled and exist purely for\n// tracking in React's Suspense DevTools.\nexport function createDevToolsInstrumentedPromise<T>(\n displayName: string,\n value: T\n): InstrumentedPromise<T> {\n const promise = Promise.resolve(value) as InstrumentedPromise<T>\n promise.status = 'fulfilled'\n promise.value = value\n promise.displayName = `${displayName} (SSR)`\n return promise\n}\n\nexport { ReadonlyURLSearchParams }\n\nif (process.env.NODE_ENV !== 'production') {\n SearchParamsContext.displayName = 'SearchParamsContext'\n PathnameContext.displayName = 'PathnameContext'\n PathParamsContext.displayName = 'PathParamsContext'\n NavigationPromisesContext.displayName = 'NavigationPromisesContext'\n}\n"],"names":["NavigationPromisesContext","PathParamsContext","PathnameContext","ReadonlyURLSearchParams","SearchParamsContext","createDevToolsInstrumentedPromise","createContext","displayName","value","promise","Promise","resolve","status","process","env","NODE_ENV"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;IA8BaA,yBAAyB;eAAzBA;;IAtBAC,iBAAiB;eAAjBA;;IADAC,eAAe;eAAfA;;IAwCJC,uBAAuB;eAAvBA,gDAAuB;;IAzCnBC,mBAAmB;eAAnBA;;IA8BGC,iCAAiC;eAAjCA;;;uBAlCc;yCAEU;AAEjC,MAAMD,sBAAsBE,IAAAA,oBAAa,EAAyB;AAClE,MAAMJ,kBAAkBI,IAAAA,oBAAa,EAAgB;AACrD,MAAML,oBAAoBK,IAAAA,oBAAa,EAAgB;AAsBvD,MAAMN,4BACXM,IAAAA,oBAAa,EAA4B;AAKpC,SAASD,kCACdE,WAAmB,EACnBC,KAAQ;IAER,MAAMC,UAAUC,QAAQC,OAAO,CAACH;IAChCC,QAAQG,MAAM,GAAG;IACjBH,QAAQD,KAAK,GAAGA;IAChBC,QAAQF,WAAW,GAAG,GAAGA,YAAY,MAAM,CAAC;IAC5C,OAAOE;AACT;AAIA,IAAII,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACzCX,oBAAoBG,WAAW,GAAG;IAClCL,gBAAgBK,WAAW,GAAG;IAC9BN,kBAAkBM,WAAW,GAAG;IAChCP,0BAA0BO,WAAW,GAAG;AAC1C","ignoreList":[0]}

View File

@@ -0,0 +1,50 @@
import type { BuildManifest } from '../../server/get-page-files';
import type { ServerRuntime } from '../../types';
import type { NEXT_DATA } from './utils';
import type { NextFontManifest } from '../../build/webpack/plugins/next-font-manifest-plugin';
import type { DeepReadonly } from './deep-readonly';
import { type JSX } from 'react';
export type HtmlProps = {
__NEXT_DATA__: NEXT_DATA;
nonce?: string;
dangerousAsPath: string;
docComponentsRendered: {
Html?: boolean;
Main?: boolean;
Head?: boolean;
NextScript?: boolean;
};
buildManifest: BuildManifest;
isDevelopment: boolean;
dynamicImports: string[];
/**
* This manifest is only needed for Pages dir, Production, Webpack
* @see https://github.com/vercel/next.js/pull/72959
*/
dynamicCssManifest: Set<string>;
assetPrefix?: string;
headTags: any[];
unstable_runtimeJS?: false;
unstable_JsPreload?: false;
assetQueryString: string;
scriptLoader: {
afterInteractive?: string[];
beforeInteractive?: any[];
worker?: any[];
};
locale?: string;
disableOptimizedLoading?: boolean;
styles?: React.ReactElement[] | Iterable<React.ReactNode>;
head?: Array<JSX.Element | null>;
crossOrigin?: 'anonymous' | 'use-credentials' | '' | undefined;
optimizeCss?: any;
nextConfigOutput?: 'standalone' | 'export';
nextScriptWorkers?: boolean;
runtime?: ServerRuntime;
hasConcurrentFeatures?: boolean;
largePageDataBytes?: number;
nextFontManifest?: DeepReadonly<NextFontManifest>;
experimentalClientTraceMetadata?: string[];
};
export declare const HtmlContext: import("react").Context<HtmlProps | undefined>;
export declare function useHtmlContext(): HtmlProps;

View File

@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
HtmlContext: null,
useHtmlContext: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
HtmlContext: function() {
return HtmlContext;
},
useHtmlContext: function() {
return useHtmlContext;
}
});
const _react = require("react");
const HtmlContext = (0, _react.createContext)(undefined);
if (process.env.NODE_ENV !== 'production') {
HtmlContext.displayName = 'HtmlContext';
}
function useHtmlContext() {
const context = (0, _react.useContext)(HtmlContext);
if (!context) {
throw Object.defineProperty(new Error(`<Html> should not be imported outside of pages/_document.\n` + 'Read more: https://nextjs.org/docs/messages/no-document-import-in-page'), "__NEXT_ERROR_CODE", {
value: "E67",
enumerable: false,
configurable: true
});
}
return context;
}
//# sourceMappingURL=html-context.shared-runtime.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/html-context.shared-runtime.ts"],"sourcesContent":["import type { BuildManifest } from '../../server/get-page-files'\nimport type { ServerRuntime } from '../../types'\nimport type { NEXT_DATA } from './utils'\nimport type { NextFontManifest } from '../../build/webpack/plugins/next-font-manifest-plugin'\nimport type { DeepReadonly } from './deep-readonly'\n\nimport { createContext, useContext, type JSX } from 'react'\n\nexport type HtmlProps = {\n __NEXT_DATA__: NEXT_DATA\n nonce?: string\n dangerousAsPath: string\n docComponentsRendered: {\n Html?: boolean\n Main?: boolean\n Head?: boolean\n NextScript?: boolean\n }\n buildManifest: BuildManifest\n isDevelopment: boolean\n dynamicImports: string[]\n /**\n * This manifest is only needed for Pages dir, Production, Webpack\n * @see https://github.com/vercel/next.js/pull/72959\n */\n dynamicCssManifest: Set<string>\n assetPrefix?: string\n headTags: any[]\n unstable_runtimeJS?: false\n unstable_JsPreload?: false\n assetQueryString: string\n scriptLoader: {\n afterInteractive?: string[]\n beforeInteractive?: any[]\n worker?: any[]\n }\n locale?: string\n disableOptimizedLoading?: boolean\n styles?: React.ReactElement[] | Iterable<React.ReactNode>\n head?: Array<JSX.Element | null>\n crossOrigin?: 'anonymous' | 'use-credentials' | '' | undefined\n optimizeCss?: any\n nextConfigOutput?: 'standalone' | 'export'\n nextScriptWorkers?: boolean\n runtime?: ServerRuntime\n hasConcurrentFeatures?: boolean\n largePageDataBytes?: number\n nextFontManifest?: DeepReadonly<NextFontManifest>\n experimentalClientTraceMetadata?: string[]\n}\n\nexport const HtmlContext = createContext<HtmlProps | undefined>(undefined)\nif (process.env.NODE_ENV !== 'production') {\n HtmlContext.displayName = 'HtmlContext'\n}\n\nexport function useHtmlContext() {\n const context = useContext(HtmlContext)\n\n if (!context) {\n throw new Error(\n `<Html> should not be imported outside of pages/_document.\\n` +\n 'Read more: https://nextjs.org/docs/messages/no-document-import-in-page'\n )\n }\n\n return context\n}\n"],"names":["HtmlContext","useHtmlContext","createContext","undefined","process","env","NODE_ENV","displayName","context","useContext","Error"],"mappings":";;;;;;;;;;;;;;;IAmDaA,WAAW;eAAXA;;IAKGC,cAAc;eAAdA;;;uBAlDoC;AA6C7C,MAAMD,cAAcE,IAAAA,oBAAa,EAAwBC;AAChE,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACzCN,YAAYO,WAAW,GAAG;AAC5B;AAEO,SAASN;IACd,MAAMO,UAAUC,IAAAA,iBAAU,EAACT;IAE3B,IAAI,CAACQ,SAAS;QACZ,MAAM,qBAGL,CAHK,IAAIE,MACR,CAAC,2DAA2D,CAAC,GAC3D,2EAFE,qBAAA;mBAAA;wBAAA;0BAAA;QAGN;IACF;IAEA,OAAOF;AACT","ignoreList":[0]}

View File

@@ -0,0 +1,2 @@
import type { DomainLocale } from '../../../server/config-shared';
export declare function detectDomainLocale(domainItems?: readonly DomainLocale[], hostname?: string, detectedLocale?: string): DomainLocale | undefined;

Some files were not shown because too many files have changed in this diff Show More