Your Name 1912bcd25b
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
chore: sync all remaining local workspace changes
2026-05-08 11:26:57 +08:00

723 lines
23 KiB
JavaScript

/*
* Extracted from browser-delivered Turbopack chunk: ffa5de913d3f001d.98ff1c0dc5.js
* Module id: 567281
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e, t, r) => {
"use strict";
Object.defineProperty(r, "__esModule", { value: !0 });
var n,
a = {
EntryStatus: function () {
return S;
},
canNewFetchStrategyProvideMoreContent: function () {
return ea;
},
convertRouteTreeToFlightRouterState: function () {
return function e(t) {
let r = {};
if (null !== t.slots) for (let n in t.slots) r[n] = e(t.slots[n]);
return [t.segment, r, null, null, t.isRootLayout];
};
},
createDetachedSegmentCacheEntry: function () {
return K;
},
fetchRouteOnCacheMiss: function () {
return Y;
},
fetchSegmentOnCacheMiss: function () {
return Q;
},
fetchSegmentPrefetchesUsingDynamicRequest: function () {
return J;
},
getCurrentCacheVersion: function () {
return A;
},
getStaleTimeMs: function () {
return E;
},
overwriteRevalidatingSegmentCacheEntry: function () {
return B;
},
pingInvalidationListeners: function () {
return N;
},
readOrCreateRevalidatingSegmentEntry: function () {
return H;
},
readOrCreateRouteCacheEntry: function () {
return I;
},
readOrCreateSegmentCacheEntry: function () {
return x;
},
readRouteCacheEntry: function () {
return F;
},
readSegmentCacheEntry: function () {
return U;
},
requestOptimisticRouteCacheEntry: function () {
return L;
},
revalidateEntireCache: function () {
return C;
},
upgradeToPendingSegment: function () {
return V;
},
upsertSegmentEntry: function () {
return $;
},
waitForSegmentCacheEntry: function () {
return k;
},
};
for (var l in a) Object.defineProperty(r, l, { enumerable: !0, get: a[l] });
let u = e.r(369209),
o = e.r(231570),
i = e.r(687946),
s = e.r(116713),
c = e.r(409369),
f = e.r(364422),
d = e.r(523712),
h = e.r(133087),
p = e.r(600602),
y = e.r(358758),
g = e.r(574797),
v = e.r(511933),
_ = e.r(871798),
b = e.r(394096),
R = e.r(745347),
m = e.r(393354),
P = e.r(69624);
function E(e) {
return 1e3 * Math.max(e, 30);
}
var S =
(((n = {})[(n.Empty = 0)] = "Empty"),
(n[(n.Pending = 1)] = "Pending"),
(n[(n.Fulfilled = 2)] = "Fulfilled"),
(n[(n.Rejected = 3)] = "Rejected"),
n);
let O = ["", {}, null, "metadata-only"],
T = (0, y.createCacheMap)(),
w = (0, y.createCacheMap)(),
j = null,
M = 0;
function A() {
return M;
}
function C(e, t) {
M++,
(0, s.startRevalidationCooldown)(),
(0, b.pingVisibleLinks)(e, t),
N(e, t);
}
function N(e, t) {
if (null !== j) {
let r = j;
for (let n of ((j = null), r))
(0, s.isPrefetchTaskDirty)(n, e, t) &&
(function (e) {
let t = e.onInvalidate;
if (null !== t) {
e.onInvalidate = null;
try {
t();
} catch (e) {
"function" == typeof reportError
? reportError(e)
: console.error(e);
}
}
})(n);
}
}
function F(e, t) {
let r = (0, c.getRouteVaryPath)(t.pathname, t.search, t.nextUrl);
return (0, y.getFromCacheMap)(e, M, T, r, !1);
}
function U(e, t) {
return (0, y.getFromCacheMap)(e, M, w, t, !1);
}
function k(e) {
let t = e.promise;
return (
null === t && (t = e.promise = (0, P.createPromiseWithResolvers)()),
t.promise
);
}
function I(e, t, r) {
null !== t.onInvalidate && (null === j ? (j = new Set([t])) : j.add(t));
let n = F(e, r);
if (null !== n) return n;
let a = {
canonicalUrl: null,
status: 0,
blockedTasks: null,
tree: null,
metadata: null,
couldBeIntercepted: !0,
isPPREnabled: !1,
renderedSearch: null,
ref: null,
size: 0,
staleAt: 1 / 0,
version: M,
},
l = (0, c.getRouteVaryPath)(r.pathname, r.search, r.nextUrl);
return (0, y.setInCacheMap)(T, l, a, !1), a;
}
function L(e, t, r) {
let n = t.search;
if ("" === n) return null;
let a = new URL(t);
a.search = "";
let l = F(e, (0, h.createCacheKey)(a.href, r));
if (null === l || 2 !== l.status) return null;
let u = new URL(l.canonicalUrl, t.origin),
o = "" !== u.search ? u.search : n,
i = "" !== l.renderedSearch ? l.renderedSearch : n,
s = new URL(l.canonicalUrl, location.origin);
return (
(s.search = o),
{
canonicalUrl: (0, d.createHrefFromUrl)(s),
status: 2,
blockedTasks: null,
tree: D(l.tree, i),
metadata: D(l.metadata, i),
couldBeIntercepted: l.couldBeIntercepted,
isPPREnabled: l.isPPREnabled,
renderedSearch: i,
ref: null,
size: 0,
staleAt: l.staleAt,
version: l.version,
}
);
}
function D(e, t) {
let r = null,
n = e.slots;
if (null !== n)
for (let e in ((r = {}), n)) {
let a = n[e];
r[e] = D(a, t);
}
return e.isPage
? {
requestKey: e.requestKey,
segment: e.segment,
varyPath: (0, c.clonePageVaryPathWithNewSearchParams)(
e.varyPath,
t,
),
isPage: !0,
slots: r,
isRootLayout: e.isRootLayout,
hasLoadingBoundary: e.hasLoadingBoundary,
hasRuntimePrefetch: e.hasRuntimePrefetch,
}
: {
requestKey: e.requestKey,
segment: e.segment,
varyPath: e.varyPath,
isPage: !1,
slots: r,
isRootLayout: e.isRootLayout,
hasLoadingBoundary: e.hasLoadingBoundary,
hasRuntimePrefetch: e.hasRuntimePrefetch,
};
}
function x(e, t, r, n) {
let a = U(e, n.varyPath);
if (null !== a) return a;
let l = (0, c.getSegmentVaryPathForRequest)(t, n),
u = K(r.staleAt);
return (0, y.setInCacheMap)(w, l, u, !1), u;
}
function H(e, t, r, n) {
var a;
let l = ((a = n.varyPath), (0, y.getFromCacheMap)(e, M, w, a, !0));
if (null !== l) return l;
let u = (0, c.getSegmentVaryPathForRequest)(t, n),
o = K(r.staleAt);
return (0, y.setInCacheMap)(w, u, o, !0), o;
}
function B(e, t, r) {
let n = (0, c.getSegmentVaryPathForRequest)(e, r),
a = K(t.staleAt);
return (0, y.setInCacheMap)(w, n, a, !0), a;
}
function $(e, t, r) {
if ((0, y.isValueExpired)(e, M, r)) return null;
let n = U(e, t);
if (null !== n) {
var a;
if (
(r.fetchStrategy !== n.fetchStrategy &&
((a = n.fetchStrategy), !(a < r.fetchStrategy))) ||
(!n.isPartial && r.isPartial)
)
return (r.status = 3), (r.loading = null), (r.rsc = null), null;
(0, y.deleteFromCacheMap)(n);
}
return (0, y.setInCacheMap)(w, t, r, !1), r;
}
function K(e) {
return {
status: 0,
fetchStrategy: m.FetchStrategy.PPR,
rsc: null,
loading: null,
isPartial: !0,
promise: null,
ref: null,
size: 0,
staleAt: e,
version: 0,
};
}
function V(e, t) {
return (
(e.status = 1),
(e.fetchStrategy = t),
t === m.FetchStrategy.Full && (e.isPartial = !1),
(e.version = M),
e
);
}
function q(e) {
let t = e.blockedTasks;
if (null !== t) {
for (let e of t) (0, s.pingPrefetchTask)(e);
e.blockedTasks = null;
}
}
function G(e, t, r, n, a, l, o, i) {
let s = {
requestKey: g.HEAD_REQUEST_KEY,
segment: g.HEAD_REQUEST_KEY,
varyPath: r,
isPage: !0,
slots: null,
isRootLayout: !1,
hasLoadingBoundary: u.HasLoadingBoundary.SubtreeHasNoLoadingBoundary,
hasRuntimePrefetch: !1,
};
return (
(e.status = 2),
(e.tree = t),
(e.metadata = s),
(e.staleAt = n),
(e.couldBeIntercepted = a),
(e.canonicalUrl = l),
(e.renderedSearch = o),
(e.isPPREnabled = i),
q(e),
e
);
}
function W(e, t, r, n, a) {
return (
(e.status = 2),
(e.rsc = t),
(e.loading = r),
(e.staleAt = n),
(e.isPartial = a),
null !== e.promise && (e.promise.resolve(e), (e.promise = null)),
e
);
}
function X(e, t) {
(e.status = 3), (e.staleAt = t), q(e);
}
function z(e, t) {
(e.status = 3),
(e.staleAt = t),
null !== e.promise && (e.promise.resolve(null), (e.promise = null));
}
async function Y(e, t, r) {
let n = r.pathname,
a = r.search,
l = r.nextUrl,
s = {
[o.RSC_HEADER]: "1",
[o.NEXT_ROUTER_PREFETCH_HEADER]: "1",
[o.NEXT_ROUTER_SEGMENT_PREFETCH_HEADER]: "/_tree",
};
null !== l && (s[o.NEXT_URL] = l);
try {
let r,
h,
b = new URL(n + a, location.origin);
if (
((r = await er(b, s)),
(h = null !== r && r.redirected ? new URL(r.url) : b),
!r || !r.ok || 204 === r.status || !r.body)
)
return X(e, Date.now() + 1e4), null;
let S = (0, d.createHrefFromUrl)(h),
O = r.headers.get("vary"),
w = null !== O && O.includes(o.NEXT_URL),
j = (0, P.createPromiseWithResolvers)(),
M = "2" === r.headers.get(o.NEXT_DID_POSTPONE_HEADER);
if (M) {
let t,
n,
a = en(r.body, j.resolve, function (t) {
(0, y.setSizeInCacheMap)(e, t);
}),
l = await (0, i.createFromNextReadableStream)(a, s);
if (l.buildId !== (0, f.getAppBuildId)())
return X(e, Date.now() + 1e4), null;
let o = (0, p.getRenderedPathname)(r),
d = (0, p.getRenderedSearch)(r),
h = { metadataVaryPath: null },
v =
((t = o.split("/").filter((e) => "" !== e)),
(n = g.ROOT_SEGMENT_REQUEST_KEY),
(function e(t, r, n, a, l, o, i, s) {
let f,
d,
h = null,
y = t.slots;
if (null !== y)
for (let t in ((f = !1),
(d = (0, c.finalizeLayoutVaryPath)(a, n)),
(h = {}),
y)) {
let r,
u,
f,
d = y[t],
v = d.name,
_ = d.paramType,
b = d.paramKey;
if (null !== _) {
let e = (0, p.parseDynamicParamFromURLPart)(_, l, o),
t =
null !== b
? b
: (0, p.getCacheKeyForDynamicParam)(e, "");
(f = (0, c.appendLayoutVaryPath)(n, t)),
(u = [v, t, _]),
(r = !0);
} else
(f = n),
(u = v),
(r = (0, p.doesStaticSegmentAppearInURL)(v));
let R = r ? o + 1 : o,
m = (0, g.createSegmentRequestKeyPart)(u),
P = (0, g.appendSegmentRequestKeyPart)(a, t, m);
h[t] = e(d, u, f, P, l, R, i, s);
}
else
a.endsWith(R.PAGE_SEGMENT_KEY)
? ((f = !0),
(d = (0, c.finalizePageVaryPath)(a, i, n)),
null === s.metadataVaryPath &&
(s.metadataVaryPath = (0, c.finalizeMetadataVaryPath)(
a,
i,
n,
)))
: ((f = !1), (d = (0, c.finalizeLayoutVaryPath)(a, n)));
return {
requestKey: a,
segment: r,
varyPath: d,
isPage: f,
slots: h,
isRootLayout: t.isRootLayout,
hasLoadingBoundary:
u.HasLoadingBoundary.SegmentHasLoadingBoundary,
hasRuntimePrefetch: t.hasRuntimePrefetch,
};
})(l.tree, n, null, g.ROOT_SEGMENT_REQUEST_KEY, t, 0, d, h)),
_ = h.metadataVaryPath;
if (null === _) return X(e, Date.now() + 1e4), null;
let b = E(l.staleTime);
G(e, v, _, Date.now() + b, w, S, d, M);
} else {
let n = en(r.body, j.resolve, function (t) {
(0, y.setSizeInCacheMap)(e, t);
}),
a = await (0, i.createFromNextReadableStream)(n, s);
if (a.b !== (0, f.getAppBuildId)())
return X(e, Date.now() + 1e4), null;
!(function (e, t, r, n, a, l, i, s, f) {
let d = (0, p.getRenderedSearch)(n),
h = (0, v.normalizeFlightData)(a.f);
if ("string" == typeof h || 1 !== h.length) return X(l, e + 1e4);
let y = h[0];
if (!y.isRootRender) return X(l, e + 1e4);
let b = y.tree,
m =
"number" == typeof a.rp?.[1]
? a.rp[1]
: parseInt(
n.headers.get(o.NEXT_ROUTER_STALE_TIME_HEADER) ?? "",
10,
),
P = isNaN(m) ? _.STATIC_STALETIME_MS : E(m),
S = "1" === n.headers.get(o.NEXT_DID_POSTPONE_HEADER),
O = { metadataVaryPath: null },
T = (function e(t, r, n, a, l) {
let o,
i,
s,
f,
d = t[0];
if (Array.isArray(d)) {
s = !1;
let e = d[1];
(i = (0, c.appendLayoutVaryPath)(n, e)),
(f = (0, c.finalizeLayoutVaryPath)(r, i)),
(o = d);
} else
(i = n),
r.endsWith(R.PAGE_SEGMENT_KEY)
? ((s = !0),
(o = R.PAGE_SEGMENT_KEY),
(f = (0, c.finalizePageVaryPath)(r, a, i)),
null === l.metadataVaryPath &&
(l.metadataVaryPath = (0, c.finalizeMetadataVaryPath)(
r,
a,
i,
)))
: ((s = !1),
(o = d),
(f = (0, c.finalizeLayoutVaryPath)(r, i)));
let h = null,
p = t[1];
for (let t in p) {
let n = p[t],
u = n[0],
o = (0, g.createSegmentRequestKeyPart)(u),
s = e(
n,
(0, g.appendSegmentRequestKeyPart)(r, t, o),
i,
a,
l,
);
null === h ? (h = { [t]: s }) : (h[t] = s);
}
return {
requestKey: r,
segment: o,
varyPath: f,
isPage: s,
slots: h,
isRootLayout: !0 === t[4],
hasLoadingBoundary:
void 0 !== t[5]
? t[5]
: u.HasLoadingBoundary.SubtreeHasNoLoadingBoundary,
hasRuntimePrefetch: !1,
};
})(b, g.ROOT_SEGMENT_REQUEST_KEY, null, d, O),
w = O.metadataVaryPath;
if (null === w) return X(l, e + 1e4);
let j = G(l, T, w, e + P, i, s, d, f);
ee(e, t, r, n, a, S, j, null);
})(Date.now(), t, m.FetchStrategy.LoadingBoundary, r, a, e, w, S, M);
}
if (!w) {
let t = (0, c.getFulfilledRouteVaryPath)(n, a, l, w);
(0, y.setInCacheMap)(T, t, e, !1);
}
return { value: null, closed: j.promise };
} catch (t) {
return X(e, Date.now() + 1e4), null;
}
}
async function Q(e, t, r, n) {
let a = new URL(e.canonicalUrl, location.origin),
l = r.nextUrl,
u = n.requestKey,
s = u === g.ROOT_SEGMENT_REQUEST_KEY ? "/_index" : u,
c = {
[o.RSC_HEADER]: "1",
[o.NEXT_ROUTER_PREFETCH_HEADER]: "1",
[o.NEXT_ROUTER_SEGMENT_PREFETCH_HEADER]: s,
};
null !== l && (c[o.NEXT_URL] = l);
try {
let r = await er(a, c);
if (
!r ||
!r.ok ||
204 === r.status ||
"2" !== r.headers.get(o.NEXT_DID_POSTPONE_HEADER) ||
!r.body
)
return z(t, Date.now() + 1e4), null;
let n = (0, P.createPromiseWithResolvers)(),
l = en(r.body, n.resolve, function (e) {
(0, y.setSizeInCacheMap)(t, e);
}),
u = await (0, i.createFromNextReadableStream)(l, c);
if (u.buildId !== (0, f.getAppBuildId)())
return z(t, Date.now() + 1e4), null;
return {
value: W(t, u.rsc, u.loading, e.staleAt, u.isPartial),
closed: n.promise,
};
} catch (e) {
return z(t, Date.now() + 1e4), null;
}
}
async function J(e, t, r, n, a) {
let l = e.key,
u = new URL(t.canonicalUrl, location.origin),
s = l.nextUrl;
1 === a.size && a.has(t.metadata.requestKey) && (n = O);
let c = {
[o.RSC_HEADER]: "1",
[o.NEXT_ROUTER_STATE_TREE_HEADER]: (0,
v.prepareFlightRouterStateForRequest)(n),
};
switch ((null !== s && (c[o.NEXT_URL] = s), r)) {
case m.FetchStrategy.Full:
break;
case m.FetchStrategy.PPRRuntime:
c[o.NEXT_ROUTER_PREFETCH_HEADER] = "2";
break;
case m.FetchStrategy.LoadingBoundary:
c[o.NEXT_ROUTER_PREFETCH_HEADER] = "1";
}
try {
let n = await er(u, c);
if (
!n ||
!n.ok ||
!n.body ||
(0, p.getRenderedSearch)(n) !== t.renderedSearch
)
return Z(a, Date.now() + 1e4), null;
let l = (0, P.createPromiseWithResolvers)(),
o = null,
s = en(n.body, l.resolve, function (e) {
if (null === o) return;
let t = e / o.length;
for (let e of o) (0, y.setSizeInCacheMap)(e, t);
}),
f = await (0, i.createFromNextReadableStream)(s, c),
d = r === m.FetchStrategy.PPRRuntime && f.rp?.[0] === !0;
return (
(o = ee(Date.now(), e, r, n, f, d, t, a)),
{ value: null, closed: l.promise }
);
} catch (e) {
return Z(a, Date.now() + 1e4), null;
}
}
function Z(e, t) {
let r = [];
for (let n of e.values())
1 === n.status ? z(n, t) : 2 === n.status && r.push(n);
return r;
}
function ee(e, t, r, n, a, l, u, i) {
if (a.b !== (0, f.getAppBuildId)())
return null !== i && Z(i, e + 1e4), null;
let s = (0, v.normalizeFlightData)(a.f);
if ("string" == typeof s) return null;
let c =
"number" == typeof a.rp?.[1]
? a.rp[1]
: parseInt(
n.headers.get(o.NEXT_ROUTER_STALE_TIME_HEADER) ?? "",
10,
),
d = e + (isNaN(c) ? _.STATIC_STALETIME_MS : E(c));
for (let n of s) {
let a = n.seedData;
if (null !== a) {
let o = n.segmentPath,
s = u.tree;
for (let t = 0; t < o.length; t += 2) {
let r = o[t];
if (s?.slots?.[r] === void 0)
return null !== i && Z(i, e + 1e4), null;
s = s.slots[r];
}
!(function e(t, r, n, a, l, u, o, i, s) {
let c = o[0];
et(t, n, a, c, o[2], null === c || i, u, l, s);
let f = l.slots;
if (null !== f) {
let l = o[1];
for (let o in f) {
let c = f[o],
d = l[o];
null != d && e(t, r, n, a, c, u, d, i, s);
}
}
})(e, t, r, u, s, d, a, l, i);
}
let o = n.head;
null !== o && et(e, r, u, o, null, n.isHeadPartial, d, u.metadata, i);
}
return null !== i ? Z(i, e + 1e4) : null;
}
function et(e, t, r, n, a, l, u, o, i) {
let s = null !== i ? i.get(o.requestKey) : void 0;
if (void 0 !== s) W(s, n, a, u, l);
else {
let i = x(e, t, r, o);
if (0 === i.status) W(V(i, t), n, a, u, l);
else {
let r = W(V(K(u), t), n, a, u, l);
$(e, (0, c.getSegmentVaryPathForRequest)(t, o), r);
}
}
}
async function er(e, t) {
let r = await (0, i.createFetch)(e, t, "low", !1);
if (!r.ok) return null;
{
let e = r.headers.get("content-type");
if (!(e && e.startsWith(o.RSC_CONTENT_TYPE_HEADER))) return null;
}
return r;
}
function en(e, t, r) {
let n = 0,
a = e.getReader();
return new ReadableStream({
async pull(e) {
for (;;) {
let { done: l, value: u } = await a.read();
if (!l) {
e.enqueue(u), r((n += u.byteLength));
continue;
}
t();
return;
}
},
});
}
function ea(e, t) {
return e < t;
}
("function" == typeof r.default ||
("object" == typeof r.default && null !== r.default)) &&
void 0 === r.default.__esModule &&
(Object.defineProperty(r.default, "__esModule", { value: !0 }),
Object.assign(r.default, r),
(t.exports = r.default));
};
export default moduleFactory;