123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530 |
- import { effectScope, shallowReactive, reactive, getCurrentScope, hasInjectionContext, getCurrentInstance, inject, toRef, version, unref, h, shallowRef, isReadonly, isRef, isShallow, isReactive, toRaw, ref, computed, defineComponent, provide, Suspense, nextTick, mergeProps, Transition, watch, Fragment, withCtx, createVNode, useSSRContext, onErrorCaptured, onServerPrefetch, resolveDynamicComponent, createApp } from "vue";
- import { $fetch as $fetch$1 } from "ofetch";
- import { baseURL } from "#internal/nuxt/paths";
- import { createHooks } from "hookable";
- import { getContext } from "unctx";
- import { sanitizeStatusCode, createError as createError$1 } from "h3";
- import { getActiveHead, CapoPlugin } from "unhead";
- import { defineHeadPlugin } from "@unhead/shared";
- import { START_LOCATION, createMemoryHistory, createRouter as createRouter$1, useRoute as useRoute$1, RouterView } from "vue-router";
- import { toRouteMatcher, createRouter } from "radix3";
- import { defu } from "defu";
- import { hasProtocol, isScriptProtocol, joinURL, withQuery } from "ufo";
- import { createPinia } from "pinia";
- import { ssrRenderComponent, ssrRenderAttrs, ssrRenderSuspense, ssrRenderVNode } from "vue/server-renderer";
- if (!globalThis.$fetch) {
- globalThis.$fetch = $fetch$1.create({
- baseURL: baseURL()
- });
- }
- const appLayoutTransition = false;
- const appPageTransition = false;
- const appKeepalive = false;
- const nuxtLinkDefaults = { "componentName": "NuxtLink", "prefetch": true, "prefetchOn": { "visibility": true } };
- const asyncDataDefaults = { "value": null, "errorValue": null, "deep": true };
- const appId = "nuxt-app";
- function getNuxtAppCtx(id = appId) {
- return getContext(id, {
- asyncContext: false
- });
- }
- const NuxtPluginIndicator = "__nuxt_plugin";
- function createNuxtApp(options) {
- var _a;
- let hydratingCount = 0;
- const nuxtApp = {
- _id: options.id || appId || "nuxt-app",
- _scope: effectScope(),
- provide: void 0,
- globalName: "nuxt",
- versions: {
- get nuxt() {
- return "3.15.2";
- },
- get vue() {
- return nuxtApp.vueApp.version;
- }
- },
- payload: shallowReactive({
- ...((_a = options.ssrContext) == null ? void 0 : _a.payload) || {},
- data: shallowReactive({}),
- state: reactive({}),
- once: /* @__PURE__ */ new Set(),
- _errors: shallowReactive({})
- }),
- static: {
- data: {}
- },
- runWithContext(fn) {
- if (nuxtApp._scope.active && !getCurrentScope()) {
- return nuxtApp._scope.run(() => callWithNuxt(nuxtApp, fn));
- }
- return callWithNuxt(nuxtApp, fn);
- },
- isHydrating: false,
- deferHydration() {
- if (!nuxtApp.isHydrating) {
- return () => {
- };
- }
- hydratingCount++;
- let called = false;
- return () => {
- if (called) {
- return;
- }
- called = true;
- hydratingCount--;
- if (hydratingCount === 0) {
- nuxtApp.isHydrating = false;
- return nuxtApp.callHook("app:suspense:resolve");
- }
- };
- },
- _asyncDataPromises: {},
- _asyncData: shallowReactive({}),
- _payloadRevivers: {},
- ...options
- };
- {
- nuxtApp.payload.serverRendered = true;
- }
- if (nuxtApp.ssrContext) {
- nuxtApp.payload.path = nuxtApp.ssrContext.url;
- nuxtApp.ssrContext.nuxt = nuxtApp;
- nuxtApp.ssrContext.payload = nuxtApp.payload;
- nuxtApp.ssrContext.config = {
- public: nuxtApp.ssrContext.runtimeConfig.public,
- app: nuxtApp.ssrContext.runtimeConfig.app
- };
- }
- nuxtApp.hooks = createHooks();
- nuxtApp.hook = nuxtApp.hooks.hook;
- {
- const contextCaller = async function(hooks, args) {
- for (const hook of hooks) {
- await nuxtApp.runWithContext(() => hook(...args));
- }
- };
- nuxtApp.hooks.callHook = (name, ...args) => nuxtApp.hooks.callHookWith(contextCaller, name, ...args);
- }
- nuxtApp.callHook = nuxtApp.hooks.callHook;
- nuxtApp.provide = (name, value) => {
- const $name = "$" + name;
- defineGetter(nuxtApp, $name, value);
- defineGetter(nuxtApp.vueApp.config.globalProperties, $name, value);
- };
- defineGetter(nuxtApp.vueApp, "$nuxt", nuxtApp);
- defineGetter(nuxtApp.vueApp.config.globalProperties, "$nuxt", nuxtApp);
- const runtimeConfig = options.ssrContext.runtimeConfig;
- nuxtApp.provide("config", runtimeConfig);
- return nuxtApp;
- }
- function registerPluginHooks(nuxtApp, plugin2) {
- if (plugin2.hooks) {
- nuxtApp.hooks.addHooks(plugin2.hooks);
- }
- }
- async function applyPlugin(nuxtApp, plugin2) {
- if (typeof plugin2 === "function") {
- const { provide: provide2 } = await nuxtApp.runWithContext(() => plugin2(nuxtApp)) || {};
- if (provide2 && typeof provide2 === "object") {
- for (const key in provide2) {
- nuxtApp.provide(key, provide2[key]);
- }
- }
- }
- }
- async function applyPlugins(nuxtApp, plugins2) {
- var _a, _b, _c, _d;
- const resolvedPlugins = [];
- const unresolvedPlugins = [];
- const parallels = [];
- const errors = [];
- let promiseDepth = 0;
- async function executePlugin(plugin2) {
- var _a2;
- const unresolvedPluginsForThisPlugin = ((_a2 = plugin2.dependsOn) == null ? void 0 : _a2.filter((name) => plugins2.some((p) => p._name === name) && !resolvedPlugins.includes(name))) ?? [];
- if (unresolvedPluginsForThisPlugin.length > 0) {
- unresolvedPlugins.push([new Set(unresolvedPluginsForThisPlugin), plugin2]);
- } else {
- const promise = applyPlugin(nuxtApp, plugin2).then(async () => {
- if (plugin2._name) {
- resolvedPlugins.push(plugin2._name);
- await Promise.all(unresolvedPlugins.map(async ([dependsOn, unexecutedPlugin]) => {
- if (dependsOn.has(plugin2._name)) {
- dependsOn.delete(plugin2._name);
- if (dependsOn.size === 0) {
- promiseDepth++;
- await executePlugin(unexecutedPlugin);
- }
- }
- }));
- }
- });
- if (plugin2.parallel) {
- parallels.push(promise.catch((e) => errors.push(e)));
- } else {
- await promise;
- }
- }
- }
- for (const plugin2 of plugins2) {
- if (((_a = nuxtApp.ssrContext) == null ? void 0 : _a.islandContext) && ((_b = plugin2.env) == null ? void 0 : _b.islands) === false) {
- continue;
- }
- registerPluginHooks(nuxtApp, plugin2);
- }
- for (const plugin2 of plugins2) {
- if (((_c = nuxtApp.ssrContext) == null ? void 0 : _c.islandContext) && ((_d = plugin2.env) == null ? void 0 : _d.islands) === false) {
- continue;
- }
- await executePlugin(plugin2);
- }
- await Promise.all(parallels);
- if (promiseDepth) {
- for (let i = 0; i < promiseDepth; i++) {
- await Promise.all(parallels);
- }
- }
- if (errors.length) {
- throw errors[0];
- }
- }
- // @__NO_SIDE_EFFECTS__
- function defineNuxtPlugin(plugin2) {
- if (typeof plugin2 === "function") {
- return plugin2;
- }
- const _name = plugin2._name || plugin2.name;
- delete plugin2.name;
- return Object.assign(plugin2.setup || (() => {
- }), plugin2, { [NuxtPluginIndicator]: true, _name });
- }
- function callWithNuxt(nuxt, setup, args) {
- const fn = () => setup();
- const nuxtAppCtx = getNuxtAppCtx(nuxt._id);
- {
- return nuxt.vueApp.runWithContext(() => nuxtAppCtx.callAsync(nuxt, fn));
- }
- }
- function tryUseNuxtApp(id) {
- var _a;
- let nuxtAppInstance;
- if (hasInjectionContext()) {
- nuxtAppInstance = (_a = getCurrentInstance()) == null ? void 0 : _a.appContext.app.$nuxt;
- }
- nuxtAppInstance = nuxtAppInstance || getNuxtAppCtx(id).tryUse();
- return nuxtAppInstance || null;
- }
- function useNuxtApp(id) {
- const nuxtAppInstance = tryUseNuxtApp(id);
- if (!nuxtAppInstance) {
- {
- throw new Error("[nuxt] instance unavailable");
- }
- }
- return nuxtAppInstance;
- }
- // @__NO_SIDE_EFFECTS__
- function useRuntimeConfig(_event) {
- return useNuxtApp().$config;
- }
- function defineGetter(obj, key, val) {
- Object.defineProperty(obj, key, { get: () => val });
- }
- const LayoutMetaSymbol = Symbol("layout-meta");
- const PageRouteSymbol = Symbol("route");
- const useRouter = () => {
- var _a;
- return (_a = useNuxtApp()) == null ? void 0 : _a.$router;
- };
- const useRoute = () => {
- if (hasInjectionContext()) {
- return inject(PageRouteSymbol, useNuxtApp()._route);
- }
- return useNuxtApp()._route;
- };
- // @__NO_SIDE_EFFECTS__
- function defineNuxtRouteMiddleware(middleware) {
- return middleware;
- }
- const isProcessingMiddleware = () => {
- try {
- if (useNuxtApp()._processingMiddleware) {
- return true;
- }
- } catch {
- return false;
- }
- return false;
- };
- const URL_QUOTE_RE = /"/g;
- const navigateTo = (to, options) => {
- if (!to) {
- to = "/";
- }
- const toPath = typeof to === "string" ? to : "path" in to ? resolveRouteObject(to) : useRouter().resolve(to).href;
- const isExternalHost = hasProtocol(toPath, { acceptRelative: true });
- const isExternal = (options == null ? void 0 : options.external) || isExternalHost;
- if (isExternal) {
- if (!(options == null ? void 0 : options.external)) {
- throw new Error("Navigating to an external URL is not allowed by default. Use `navigateTo(url, { external: true })`.");
- }
- const { protocol } = new URL(toPath, "http://localhost");
- if (protocol && isScriptProtocol(protocol)) {
- throw new Error(`Cannot navigate to a URL with '${protocol}' protocol.`);
- }
- }
- const inMiddleware = isProcessingMiddleware();
- const router = useRouter();
- const nuxtApp = useNuxtApp();
- {
- if (nuxtApp.ssrContext) {
- const fullPath = typeof to === "string" || isExternal ? toPath : router.resolve(to).fullPath || "/";
- const location2 = isExternal ? toPath : joinURL((/* @__PURE__ */ useRuntimeConfig()).app.baseURL, fullPath);
- const redirect = async function(response) {
- await nuxtApp.callHook("app:redirected");
- const encodedLoc = location2.replace(URL_QUOTE_RE, "%22");
- const encodedHeader = encodeURL(location2, isExternalHost);
- nuxtApp.ssrContext._renderResponse = {
- statusCode: sanitizeStatusCode((options == null ? void 0 : options.redirectCode) || 302, 302),
- body: `<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=${encodedLoc}"></head></html>`,
- headers: { location: encodedHeader }
- };
- return response;
- };
- if (!isExternal && inMiddleware) {
- router.afterEach((final) => final.fullPath === fullPath ? redirect(false) : void 0);
- return to;
- }
- return redirect(!inMiddleware ? void 0 : (
- /* abort route navigation */
- false
- ));
- }
- }
- if (isExternal) {
- nuxtApp._scope.stop();
- if (options == null ? void 0 : options.replace) {
- (void 0).replace(toPath);
- } else {
- (void 0).href = toPath;
- }
- if (inMiddleware) {
- if (!nuxtApp.isHydrating) {
- return false;
- }
- return new Promise(() => {
- });
- }
- return Promise.resolve();
- }
- return (options == null ? void 0 : options.replace) ? router.replace(to) : router.push(to);
- };
- function resolveRouteObject(to) {
- return withQuery(to.path || "", to.query || {}) + (to.hash || "");
- }
- function encodeURL(location2, isExternalHost = false) {
- const url = new URL(location2, "http://localhost");
- if (!isExternalHost) {
- return url.pathname + url.search + url.hash;
- }
- if (location2.startsWith("//")) {
- return url.toString().replace(url.protocol, "");
- }
- return url.toString();
- }
- const NUXT_ERROR_SIGNATURE = "__nuxt_error";
- const useError = () => toRef(useNuxtApp().payload, "error");
- const showError = (error) => {
- const nuxtError = createError(error);
- try {
- const nuxtApp = useNuxtApp();
- const error2 = useError();
- if (false) ;
- error2.value = error2.value || nuxtError;
- } catch {
- throw nuxtError;
- }
- return nuxtError;
- };
- const isNuxtError = (error) => !!error && typeof error === "object" && NUXT_ERROR_SIGNATURE in error;
- const createError = (error) => {
- const nuxtError = createError$1(error);
- Object.defineProperty(nuxtError, NUXT_ERROR_SIGNATURE, {
- value: true,
- configurable: false,
- writable: false
- });
- return nuxtError;
- };
- version[0] === "3";
- function resolveUnref(r) {
- return typeof r === "function" ? r() : unref(r);
- }
- function resolveUnrefHeadInput(ref2) {
- if (ref2 instanceof Promise || ref2 instanceof Date || ref2 instanceof RegExp)
- return ref2;
- const root = resolveUnref(ref2);
- if (!ref2 || !root)
- return root;
- if (Array.isArray(root))
- return root.map((r) => resolveUnrefHeadInput(r));
- if (typeof root === "object") {
- const resolved = {};
- for (const k in root) {
- if (!Object.prototype.hasOwnProperty.call(root, k)) {
- continue;
- }
- if (k === "titleTemplate" || k[0] === "o" && k[1] === "n") {
- resolved[k] = unref(root[k]);
- continue;
- }
- resolved[k] = resolveUnrefHeadInput(root[k]);
- }
- return resolved;
- }
- return root;
- }
- defineHeadPlugin({
- hooks: {
- "entries:resolve": (ctx) => {
- for (const entry2 of ctx.entries)
- entry2.resolvedInput = resolveUnrefHeadInput(entry2.input);
- }
- }
- });
- const headSymbol = "usehead";
- const _global = typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
- const globalKey$1 = "__unhead_injection_handler__";
- function setHeadInjectionHandler(handler) {
- _global[globalKey$1] = handler;
- }
- function injectHead() {
- if (globalKey$1 in _global) {
- return _global[globalKey$1]();
- }
- const head = inject(headSymbol);
- if (!head && process.env.NODE_ENV !== "production")
- console.warn("Unhead is missing Vue context, falling back to shared context. This may have unexpected results.");
- return head || getActiveHead();
- }
- [CapoPlugin({ track: true })];
- const unhead_KgADcZ0jPj = /* @__PURE__ */ defineNuxtPlugin({
- name: "nuxt:head",
- enforce: "pre",
- setup(nuxtApp) {
- const head = nuxtApp.ssrContext.head;
- setHeadInjectionHandler(
- // need a fresh instance of the nuxt app to avoid parallel requests interfering with each other
- () => useNuxtApp().vueApp._context.provides.usehead
- );
- nuxtApp.vueApp.use(head);
- }
- });
- function createContext(opts = {}) {
- let currentInstance;
- let isSingleton = false;
- const checkConflict = (instance) => {
- if (currentInstance && currentInstance !== instance) {
- throw new Error("Context conflict");
- }
- };
- let als;
- if (opts.asyncContext) {
- const _AsyncLocalStorage = opts.AsyncLocalStorage || globalThis.AsyncLocalStorage;
- if (_AsyncLocalStorage) {
- als = new _AsyncLocalStorage();
- } else {
- console.warn("[unctx] `AsyncLocalStorage` is not provided.");
- }
- }
- const _getCurrentInstance = () => {
- if (als) {
- const instance = als.getStore();
- if (instance !== void 0) {
- return instance;
- }
- }
- return currentInstance;
- };
- return {
- use: () => {
- const _instance = _getCurrentInstance();
- if (_instance === void 0) {
- throw new Error("Context is not available");
- }
- return _instance;
- },
- tryUse: () => {
- return _getCurrentInstance();
- },
- set: (instance, replace) => {
- if (!replace) {
- checkConflict(instance);
- }
- currentInstance = instance;
- isSingleton = true;
- },
- unset: () => {
- currentInstance = void 0;
- isSingleton = false;
- },
- call: (instance, callback) => {
- checkConflict(instance);
- currentInstance = instance;
- try {
- return als ? als.run(instance, callback) : callback();
- } finally {
- if (!isSingleton) {
- currentInstance = void 0;
- }
- }
- },
- async callAsync(instance, callback) {
- currentInstance = instance;
- const onRestore = () => {
- currentInstance = instance;
- };
- const onLeave = () => currentInstance === instance ? onRestore : void 0;
- asyncHandlers.add(onLeave);
- try {
- const r = als ? als.run(instance, callback) : callback();
- if (!isSingleton) {
- currentInstance = void 0;
- }
- return await r;
- } finally {
- asyncHandlers.delete(onLeave);
- }
- }
- };
- }
- function createNamespace(defaultOpts = {}) {
- const contexts = {};
- return {
- get(key, opts = {}) {
- if (!contexts[key]) {
- contexts[key] = createContext({ ...defaultOpts, ...opts });
- }
- return contexts[key];
- }
- };
- }
- const _globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : {};
- const globalKey = "__unctx__";
- _globalThis[globalKey] || (_globalThis[globalKey] = createNamespace());
- const asyncHandlersKey = "__unctx_async_handlers__";
- const asyncHandlers = _globalThis[asyncHandlersKey] || (_globalThis[asyncHandlersKey] = /* @__PURE__ */ new Set());
- function executeAsync(function_) {
- const restores = [];
- for (const leaveHandler of asyncHandlers) {
- const restore2 = leaveHandler();
- if (restore2) {
- restores.push(restore2);
- }
- }
- const restore = () => {
- for (const restore2 of restores) {
- restore2();
- }
- };
- let awaitable = function_();
- if (awaitable && typeof awaitable === "object" && "catch" in awaitable) {
- awaitable = awaitable.catch((error) => {
- restore();
- throw error;
- });
- }
- return [awaitable, restore];
- }
- const ROUTE_KEY_PARENTHESES_RE$1 = /(:\w+)\([^)]+\)/g;
- const ROUTE_KEY_SYMBOLS_RE$1 = /(:\w+)[?+*]/g;
- const ROUTE_KEY_NORMAL_RE$1 = /:\w+/g;
- const interpolatePath = (route, match) => {
- return match.path.replace(ROUTE_KEY_PARENTHESES_RE$1, "$1").replace(ROUTE_KEY_SYMBOLS_RE$1, "$1").replace(ROUTE_KEY_NORMAL_RE$1, (r) => {
- var _a;
- return ((_a = route.params[r.slice(1)]) == null ? void 0 : _a.toString()) || "";
- });
- };
- const generateRouteKey$1 = (routeProps, override) => {
- const matchedRoute = routeProps.route.matched.find((m) => {
- var _a;
- return ((_a = m.components) == null ? void 0 : _a.default) === routeProps.Component.type;
- });
- const source = override ?? (matchedRoute == null ? void 0 : matchedRoute.meta.key) ?? (matchedRoute && interpolatePath(routeProps.route, matchedRoute));
- return typeof source === "function" ? source(routeProps.route) : source;
- };
- const wrapInKeepAlive = (props, children) => {
- return { default: () => children };
- };
- function toArray(value) {
- return Array.isArray(value) ? value : [value];
- }
- async function getRouteRules(arg) {
- const path = typeof arg === "string" ? arg : arg.path;
- {
- useNuxtApp().ssrContext._preloadManifest = true;
- const _routeRulesMatcher = toRouteMatcher(
- createRouter({ routes: (/* @__PURE__ */ useRuntimeConfig()).nitro.routeRules })
- );
- return defu({}, ..._routeRulesMatcher.matchAll(path).reverse());
- }
- }
- function handleHotUpdate(_router, _generateRoutes) {
- }
- const _routes = [
- {
- name: "dir-dir-id",
- path: "/:dir()/:dir()/:id()",
- component: () => import("./_nuxt/_id_-CY4S08zh.js")
- },
- {
- name: "dir-dir-list-id",
- path: "/:dir()/:dir()/list-:id()",
- component: () => import("./_nuxt/list-_id_-By6mIPL6.js")
- },
- {
- name: "dir-id",
- path: "/:dir()/:id()",
- component: () => import("./_nuxt/_id_-DSKwGPjq.js")
- },
- {
- name: "dir-index.html",
- path: "/:dir()/index.html",
- component: () => import("./_nuxt/index.html-DZvbkZ4V.js")
- },
- {
- name: "dir-list-id",
- path: "/:dir()/list-:id()",
- component: () => import("./_nuxt/list-_id_-DSsbG6f8.js")
- },
- {
- name: "about-dir-dir-id",
- path: "/about/:dir()/:dir()/:id()",
- component: () => import("./_nuxt/_id_-BYaqDGP_.js")
- },
- {
- name: "about-dir-index.html",
- path: "/about/:dir()/index.html",
- component: () => import("./_nuxt/index.html-CGLEEYXF.js")
- },
- {
- name: "about-dir-list-id",
- path: "/about/:dir()/list-:id()",
- component: () => import("./_nuxt/list-_id_-Bkf2uAQN.js")
- },
- {
- name: "advertising-adDetail",
- path: "/advertising/adDetail",
- component: () => import("./_nuxt/adDetail-DiEtJ07k.js")
- },
- {
- name: "advertising",
- path: "/advertising",
- component: () => import("./_nuxt/index-DJajLbTi.js")
- },
- {
- name: "index",
- path: "/",
- component: () => import("./_nuxt/index-BDsvj-bv.js")
- },
- {
- name: "search-id",
- path: "/search/:id()",
- component: () => import("./_nuxt/_id_-DYJ3XEyk.js")
- },
- {
- name: "topic-id",
- path: "/topic/:id()",
- component: () => import("./_nuxt/_id_-CwA5PBWj.js")
- },
- {
- name: "topic",
- path: "/topic",
- component: () => import("./_nuxt/index-BwfKHbcJ.js")
- }
- ];
- const _wrapIf = (component, props, slots) => {
- props = props === true ? {} : props;
- return { default: () => {
- var _a;
- return props ? h(component, props, slots) : (_a = slots.default) == null ? void 0 : _a.call(slots);
- } };
- };
- const ROUTE_KEY_PARENTHESES_RE = /(:\w+)\([^)]+\)/g;
- const ROUTE_KEY_SYMBOLS_RE = /(:\w+)[?+*]/g;
- const ROUTE_KEY_NORMAL_RE = /:\w+/g;
- function generateRouteKey(route) {
- const source = (route == null ? void 0 : route.meta.key) ?? route.path.replace(ROUTE_KEY_PARENTHESES_RE, "$1").replace(ROUTE_KEY_SYMBOLS_RE, "$1").replace(ROUTE_KEY_NORMAL_RE, (r) => {
- var _a;
- return ((_a = route.params[r.slice(1)]) == null ? void 0 : _a.toString()) || "";
- });
- return typeof source === "function" ? source(route) : source;
- }
- function isChangingPage(to, from) {
- if (to === from || from === START_LOCATION) {
- return false;
- }
- if (generateRouteKey(to) !== generateRouteKey(from)) {
- return true;
- }
- const areComponentsSame = to.matched.every(
- (comp, index) => {
- var _a, _b;
- return comp.components && comp.components.default === ((_b = (_a = from.matched[index]) == null ? void 0 : _a.components) == null ? void 0 : _b.default);
- }
- );
- if (areComponentsSame) {
- return false;
- }
- return true;
- }
- const routerOptions0 = {
- scrollBehavior(to, from, savedPosition) {
- var _a;
- const nuxtApp = useNuxtApp();
- const behavior = ((_a = useRouter().options) == null ? void 0 : _a.scrollBehaviorType) ?? "auto";
- let position = savedPosition || void 0;
- const routeAllowsScrollToTop = typeof to.meta.scrollToTop === "function" ? to.meta.scrollToTop(to, from) : to.meta.scrollToTop;
- if (!position && from && to && routeAllowsScrollToTop !== false && isChangingPage(to, from)) {
- position = { left: 0, top: 0 };
- }
- if (to.path === from.path) {
- if (from.hash && !to.hash) {
- return { left: 0, top: 0 };
- }
- if (to.hash) {
- return { el: to.hash, top: _getHashElementScrollMarginTop(to.hash), behavior };
- }
- return false;
- }
- const hasTransition = (route) => !!(route.meta.pageTransition ?? appPageTransition);
- const hookToWait = hasTransition(from) && hasTransition(to) ? "page:transition:finish" : "page:finish";
- return new Promise((resolve) => {
- nuxtApp.hooks.hookOnce(hookToWait, async () => {
- await new Promise((resolve2) => setTimeout(resolve2, 0));
- if (to.hash) {
- position = { el: to.hash, top: _getHashElementScrollMarginTop(to.hash), behavior };
- }
- resolve(position);
- });
- });
- }
- };
- function _getHashElementScrollMarginTop(selector) {
- try {
- const elem = (void 0).querySelector(selector);
- if (elem) {
- return (Number.parseFloat(getComputedStyle(elem).scrollMarginTop) || 0) + (Number.parseFloat(getComputedStyle((void 0).documentElement).scrollPaddingTop) || 0);
- }
- } catch {
- }
- return 0;
- }
- const routerOptions1 = {
- routes: async (routes) => {
- return [
- ...routes
- //...routeData,
- ];
- }
- };
- const configRouterOptions = {
- hashMode: false,
- scrollBehaviorType: "auto"
- };
- const hashMode = routerOptions0.hashMode ?? false;
- const routerOptions = {
- ...configRouterOptions,
- ...routerOptions0,
- ...routerOptions1
- };
- const validate = /* @__PURE__ */ defineNuxtRouteMiddleware(async (to) => {
- var _a;
- let __temp, __restore;
- if (!((_a = to.meta) == null ? void 0 : _a.validate)) {
- return;
- }
- const nuxtApp = useNuxtApp();
- const router = useRouter();
- const result = ([__temp, __restore] = executeAsync(() => Promise.resolve(to.meta.validate(to))), __temp = await __temp, __restore(), __temp);
- if (result === true) {
- return;
- }
- const error = createError({
- statusCode: result && result.statusCode || 404,
- statusMessage: result && result.statusMessage || `Page Not Found: ${to.fullPath}`,
- data: {
- path: to.fullPath
- }
- });
- const unsub = router.beforeResolve((final) => {
- unsub();
- if (final === to) {
- const unsub2 = router.afterEach(async () => {
- unsub2();
- await nuxtApp.runWithContext(() => showError(error));
- });
- return false;
- }
- });
- });
- const manifest_45route_45rule = /* @__PURE__ */ defineNuxtRouteMiddleware(async (to) => {
- {
- return;
- }
- });
- const globalMiddleware = [
- validate,
- manifest_45route_45rule
- ];
- const namedMiddleware = {
- auth: () => import("./_nuxt/auth-DWp-I46x.js")
- };
- const plugin = /* @__PURE__ */ defineNuxtPlugin({
- name: "nuxt:router",
- enforce: "pre",
- async setup(nuxtApp) {
- var _a, _b, _c;
- let __temp, __restore;
- let routerBase = (/* @__PURE__ */ useRuntimeConfig()).app.baseURL;
- if (hashMode && !routerBase.includes("#")) {
- routerBase += "#";
- }
- const history = ((_a = routerOptions.history) == null ? void 0 : _a.call(routerOptions, routerBase)) ?? createMemoryHistory(routerBase);
- const routes = routerOptions.routes ? ([__temp, __restore] = executeAsync(() => routerOptions.routes(_routes)), __temp = await __temp, __restore(), __temp) ?? _routes : _routes;
- let startPosition;
- const router = createRouter$1({
- ...routerOptions,
- scrollBehavior: (to, from, savedPosition) => {
- if (from === START_LOCATION) {
- startPosition = savedPosition;
- return;
- }
- if (routerOptions.scrollBehavior) {
- router.options.scrollBehavior = routerOptions.scrollBehavior;
- if ("scrollRestoration" in (void 0).history) {
- const unsub = router.beforeEach(() => {
- unsub();
- (void 0).history.scrollRestoration = "manual";
- });
- }
- return routerOptions.scrollBehavior(to, START_LOCATION, startPosition || savedPosition);
- }
- },
- history,
- routes
- });
- handleHotUpdate(router, routerOptions.routes ? routerOptions.routes : (routes2) => routes2);
- nuxtApp.vueApp.use(router);
- const previousRoute = shallowRef(router.currentRoute.value);
- router.afterEach((_to, from) => {
- previousRoute.value = from;
- });
- Object.defineProperty(nuxtApp.vueApp.config.globalProperties, "previousRoute", {
- get: () => previousRoute.value
- });
- const initialURL = nuxtApp.ssrContext.url;
- const _route = shallowRef(router.currentRoute.value);
- const syncCurrentRoute = () => {
- _route.value = router.currentRoute.value;
- };
- nuxtApp.hook("page:finish", syncCurrentRoute);
- router.afterEach((to, from) => {
- var _a2, _b2, _c2, _d;
- if (((_b2 = (_a2 = to.matched[0]) == null ? void 0 : _a2.components) == null ? void 0 : _b2.default) === ((_d = (_c2 = from.matched[0]) == null ? void 0 : _c2.components) == null ? void 0 : _d.default)) {
- syncCurrentRoute();
- }
- });
- const route = {};
- for (const key in _route.value) {
- Object.defineProperty(route, key, {
- get: () => _route.value[key],
- enumerable: true
- });
- }
- nuxtApp._route = shallowReactive(route);
- nuxtApp._middleware = nuxtApp._middleware || {
- global: [],
- named: {}
- };
- useError();
- if (!((_b = nuxtApp.ssrContext) == null ? void 0 : _b.islandContext)) {
- router.afterEach(async (to, _from, failure) => {
- delete nuxtApp._processingMiddleware;
- if (failure) {
- await nuxtApp.callHook("page:loading:end");
- }
- if ((failure == null ? void 0 : failure.type) === 4) {
- return;
- }
- if (to.redirectedFrom && to.fullPath !== initialURL) {
- await nuxtApp.runWithContext(() => navigateTo(to.fullPath || "/"));
- }
- });
- }
- try {
- if (true) {
- ;
- [__temp, __restore] = executeAsync(() => router.push(initialURL)), await __temp, __restore();
- ;
- }
- ;
- [__temp, __restore] = executeAsync(() => router.isReady()), await __temp, __restore();
- ;
- } catch (error2) {
- [__temp, __restore] = executeAsync(() => nuxtApp.runWithContext(() => showError(error2))), await __temp, __restore();
- }
- const resolvedInitialRoute = router.currentRoute.value;
- syncCurrentRoute();
- if ((_c = nuxtApp.ssrContext) == null ? void 0 : _c.islandContext) {
- return { provide: { router } };
- }
- const initialLayout = nuxtApp.payload.state._layout;
- router.beforeEach(async (to, from) => {
- var _a2, _b2;
- await nuxtApp.callHook("page:loading:start");
- to.meta = reactive(to.meta);
- if (nuxtApp.isHydrating && initialLayout && !isReadonly(to.meta.layout)) {
- to.meta.layout = initialLayout;
- }
- nuxtApp._processingMiddleware = true;
- if (!((_a2 = nuxtApp.ssrContext) == null ? void 0 : _a2.islandContext)) {
- const middlewareEntries = /* @__PURE__ */ new Set([...globalMiddleware, ...nuxtApp._middleware.global]);
- for (const component of to.matched) {
- const componentMiddleware = component.meta.middleware;
- if (!componentMiddleware) {
- continue;
- }
- for (const entry2 of toArray(componentMiddleware)) {
- middlewareEntries.add(entry2);
- }
- }
- {
- const routeRules = await nuxtApp.runWithContext(() => getRouteRules({ path: to.path }));
- if (routeRules.appMiddleware) {
- for (const key in routeRules.appMiddleware) {
- if (routeRules.appMiddleware[key]) {
- middlewareEntries.add(key);
- } else {
- middlewareEntries.delete(key);
- }
- }
- }
- }
- for (const entry2 of middlewareEntries) {
- const middleware = typeof entry2 === "string" ? nuxtApp._middleware.named[entry2] || await ((_b2 = namedMiddleware[entry2]) == null ? void 0 : _b2.call(namedMiddleware).then((r) => r.default || r)) : entry2;
- if (!middleware) {
- throw new Error(`Unknown route middleware: '${entry2}'.`);
- }
- const result = await nuxtApp.runWithContext(() => middleware(to, from));
- {
- if (result === false || result instanceof Error) {
- const error2 = result || createError$1({
- statusCode: 404,
- statusMessage: `Page Not Found: ${initialURL}`
- });
- await nuxtApp.runWithContext(() => showError(error2));
- return false;
- }
- }
- if (result === true) {
- continue;
- }
- if (result || result === false) {
- return result;
- }
- }
- }
- });
- router.onError(async () => {
- delete nuxtApp._processingMiddleware;
- await nuxtApp.callHook("page:loading:end");
- });
- router.afterEach(async (to, _from) => {
- if (to.matched.length === 0) {
- await nuxtApp.runWithContext(() => showError(createError$1({
- statusCode: 404,
- fatal: false,
- statusMessage: `Page not found: ${to.fullPath}`,
- data: {
- path: to.fullPath
- }
- })));
- }
- });
- nuxtApp.hooks.hookOnce("app:created", async () => {
- try {
- if ("name" in resolvedInitialRoute) {
- resolvedInitialRoute.name = void 0;
- }
- await router.replace({
- ...resolvedInitialRoute,
- force: true
- });
- router.options.scrollBehavior = routerOptions.scrollBehavior;
- } catch (error2) {
- await nuxtApp.runWithContext(() => showError(error2));
- }
- });
- return { provide: { router } };
- }
- });
- function definePayloadReducer(name, reduce) {
- {
- useNuxtApp().ssrContext._payloadReducers[name] = reduce;
- }
- }
- const reducers = [
- ["NuxtError", (data) => isNuxtError(data) && data.toJSON()],
- ["EmptyShallowRef", (data) => isRef(data) && isShallow(data) && !data.value && (typeof data.value === "bigint" ? "0n" : JSON.stringify(data.value) || "_")],
- ["EmptyRef", (data) => isRef(data) && !data.value && (typeof data.value === "bigint" ? "0n" : JSON.stringify(data.value) || "_")],
- ["ShallowRef", (data) => isRef(data) && isShallow(data) && data.value],
- ["ShallowReactive", (data) => isReactive(data) && isShallow(data) && toRaw(data)],
- ["Ref", (data) => isRef(data) && data.value],
- ["Reactive", (data) => isReactive(data) && toRaw(data)]
- ];
- const revive_payload_server_eJ33V7gbc6 = /* @__PURE__ */ defineNuxtPlugin({
- name: "nuxt:revive-payload:server",
- setup() {
- for (const [reducer, fn] of reducers) {
- definePayloadReducer(reducer, fn);
- }
- }
- });
- const components_plugin_KR1HBZs4kY = /* @__PURE__ */ defineNuxtPlugin({
- name: "nuxt:global-components"
- });
- const element_plus_elM4AXquKi = /* @__PURE__ */ defineNuxtPlugin(() => {
- });
- const globals_W2yFmejOiw = /* @__PURE__ */ defineNuxtPlugin((nuxtApp) => {
- nuxtApp.provide("webUrl", "http://apipre1.bjzxtw.org.cn:29501");
- nuxtApp.provide("CwebUrl", "http://nwpre.bjzxtw.org.cn");
- nuxtApp.provide("BwebUrl", "http://adminpre.bjzxtw.org.cn");
- nuxtApp.provide("LoginWebUrl", "http://adminpre.bjzxtw.org.cn/adminapi");
- nuxtApp.provide("userUrl", "http://localhost:3000");
- });
- const pinia_Uphuq97G1L = /* @__PURE__ */ defineNuxtPlugin((nuxtApp) => {
- const pinia = createPinia();
- nuxtApp.vueApp.use(pinia);
- return {
- provide: {
- pinia
- }
- };
- });
- const plugins = [
- unhead_KgADcZ0jPj,
- plugin,
- revive_payload_server_eJ33V7gbc6,
- components_plugin_KR1HBZs4kY,
- element_plus_elM4AXquKi,
- globals_W2yFmejOiw,
- pinia_Uphuq97G1L
- ];
- function defaultEstimatedProgress(duration, elapsed) {
- const completionPercentage = elapsed / duration * 100;
- return 2 / Math.PI * 100 * Math.atan(completionPercentage / 50);
- }
- function createLoadingIndicator(opts = {}) {
- opts.estimatedProgress || defaultEstimatedProgress;
- const nuxtApp = useNuxtApp();
- const progress = ref(0);
- const isLoading = ref(false);
- const error = ref(false);
- const start = () => {
- error.value = false;
- set(0);
- };
- function set(at = 0) {
- if (nuxtApp.isHydrating) {
- return;
- }
- if (at >= 100) {
- return finish();
- }
- progress.value = at < 0 ? 0 : at;
- {
- isLoading.value = true;
- }
- }
- function finish(opts2 = {}) {
- progress.value = 100;
- if (opts2.error) {
- error.value = true;
- }
- if (opts2.force) {
- progress.value = 0;
- isLoading.value = false;
- }
- }
- function clear() {
- }
- let _cleanup = () => {
- };
- return {
- _cleanup,
- progress: computed(() => progress.value),
- isLoading: computed(() => isLoading.value),
- error: computed(() => error.value),
- start,
- set,
- finish,
- clear
- };
- }
- function useLoadingIndicator(opts = {}) {
- const nuxtApp = useNuxtApp();
- const indicator = nuxtApp._loadingIndicator = nuxtApp._loadingIndicator || createLoadingIndicator(opts);
- return indicator;
- }
- const __nuxt_component_0 = defineComponent({
- name: "NuxtLoadingIndicator",
- props: {
- throttle: {
- type: Number,
- default: 200
- },
- duration: {
- type: Number,
- default: 2e3
- },
- height: {
- type: Number,
- default: 3
- },
- color: {
- type: [String, Boolean],
- default: "repeating-linear-gradient(to right,#00dc82 0%,#34cdfe 50%,#0047e1 100%)"
- },
- errorColor: {
- type: String,
- default: "repeating-linear-gradient(to right,#f87171 0%,#ef4444 100%)"
- },
- estimatedProgress: {
- type: Function,
- required: false
- }
- },
- setup(props, { slots, expose }) {
- const { progress, isLoading, error, start, finish, clear } = useLoadingIndicator({
- duration: props.duration,
- throttle: props.throttle,
- estimatedProgress: props.estimatedProgress
- });
- expose({
- progress,
- isLoading,
- error,
- start,
- finish,
- clear
- });
- return () => h("div", {
- class: "nuxt-loading-indicator",
- style: {
- position: "fixed",
- top: 0,
- right: 0,
- left: 0,
- pointerEvents: "none",
- width: "auto",
- height: `${props.height}px`,
- opacity: isLoading.value ? 1 : 0,
- background: error.value ? props.errorColor : props.color || void 0,
- backgroundSize: `${100 / progress.value * 100}% auto`,
- transform: `scaleX(${progress.value}%)`,
- transformOrigin: "left",
- transition: "transform 0.1s, height 0.4s, opacity 0.4s",
- zIndex: 999999
- }
- }, slots);
- }
- });
- const layouts = {};
- const LayoutLoader = defineComponent({
- name: "LayoutLoader",
- inheritAttrs: false,
- props: {
- name: String,
- layoutProps: Object
- },
- setup(props, context) {
- return () => h(layouts[props.name], props.layoutProps, context.slots);
- }
- });
- const __nuxt_component_1 = defineComponent({
- name: "NuxtLayout",
- inheritAttrs: false,
- props: {
- name: {
- type: [String, Boolean, Object],
- default: null
- },
- fallback: {
- type: [String, Object],
- default: null
- }
- },
- setup(props, context) {
- const nuxtApp = useNuxtApp();
- const injectedRoute = inject(PageRouteSymbol);
- const route = injectedRoute === useRoute() ? useRoute$1() : injectedRoute;
- const layout = computed(() => {
- let layout2 = unref(props.name) ?? route.meta.layout ?? "default";
- if (layout2 && !(layout2 in layouts)) {
- if (props.fallback) {
- layout2 = unref(props.fallback);
- }
- }
- return layout2;
- });
- const layoutRef = ref();
- context.expose({ layoutRef });
- const done = nuxtApp.deferHydration();
- return () => {
- const hasLayout = layout.value && layout.value in layouts;
- const transitionProps = route.meta.layoutTransition ?? appLayoutTransition;
- return _wrapIf(Transition, hasLayout && transitionProps, {
- default: () => h(Suspense, { suspensible: true, onResolve: () => {
- nextTick(done);
- } }, {
- default: () => h(
- LayoutProvider,
- {
- layoutProps: mergeProps(context.attrs, { ref: layoutRef }),
- key: layout.value || void 0,
- name: layout.value,
- shouldProvide: !props.name,
- hasTransition: !!transitionProps
- },
- context.slots
- )
- })
- }).default();
- };
- }
- });
- const LayoutProvider = defineComponent({
- name: "NuxtLayoutProvider",
- inheritAttrs: false,
- props: {
- name: {
- type: [String, Boolean]
- },
- layoutProps: {
- type: Object
- },
- hasTransition: {
- type: Boolean
- },
- shouldProvide: {
- type: Boolean
- }
- },
- setup(props, context) {
- const name = props.name;
- if (props.shouldProvide) {
- provide(LayoutMetaSymbol, {
- isCurrent: (route) => name === (route.meta.layout ?? "default")
- });
- }
- return () => {
- var _a, _b;
- if (!name || typeof name === "string" && !(name in layouts)) {
- return (_b = (_a = context.slots).default) == null ? void 0 : _b.call(_a);
- }
- return h(
- LayoutLoader,
- { key: name, layoutProps: props.layoutProps, name },
- context.slots
- );
- };
- }
- });
- const RouteProvider = defineComponent({
- props: {
- vnode: {
- type: Object,
- required: true
- },
- route: {
- type: Object,
- required: true
- },
- vnodeRef: Object,
- renderKey: String,
- trackRootNodes: Boolean
- },
- setup(props) {
- const previousKey = props.renderKey;
- const previousRoute = props.route;
- const route = {};
- for (const key in props.route) {
- Object.defineProperty(route, key, {
- get: () => previousKey === props.renderKey ? props.route[key] : previousRoute[key],
- enumerable: true
- });
- }
- provide(PageRouteSymbol, shallowReactive(route));
- return () => {
- return h(props.vnode, { ref: props.vnodeRef });
- };
- }
- });
- const __nuxt_component_2 = defineComponent({
- name: "NuxtPage",
- inheritAttrs: false,
- props: {
- name: {
- type: String
- },
- transition: {
- type: [Boolean, Object],
- default: void 0
- },
- keepalive: {
- type: [Boolean, Object],
- default: void 0
- },
- route: {
- type: Object
- },
- pageKey: {
- type: [Function, String],
- default: null
- }
- },
- setup(props, { attrs, slots, expose }) {
- const nuxtApp = useNuxtApp();
- const pageRef = ref();
- const forkRoute = inject(PageRouteSymbol, null);
- let previousPageKey;
- expose({ pageRef });
- inject(LayoutMetaSymbol, null);
- let vnode;
- const done = nuxtApp.deferHydration();
- if (props.pageKey) {
- watch(() => props.pageKey, (next, prev) => {
- if (next !== prev) {
- nuxtApp.callHook("page:loading:start");
- }
- });
- }
- let pageLoadingEndHookAlreadyCalled = false;
- return () => {
- return h(RouterView, { name: props.name, route: props.route, ...attrs }, {
- default: (routeProps) => {
- if (!routeProps.Component) {
- done();
- return;
- }
- const key = generateRouteKey$1(routeProps, props.pageKey);
- if (!nuxtApp.isHydrating && !hasChildrenRoutes(forkRoute, routeProps.route, routeProps.Component) && previousPageKey === key) {
- nuxtApp.callHook("page:loading:end");
- pageLoadingEndHookAlreadyCalled = true;
- }
- previousPageKey = key;
- const hasTransition = !!(props.transition ?? routeProps.route.meta.pageTransition ?? appPageTransition);
- const transitionProps = hasTransition && _mergeTransitionProps([
- props.transition,
- routeProps.route.meta.pageTransition,
- appPageTransition,
- { onAfterLeave: () => {
- nuxtApp.callHook("page:transition:finish", routeProps.Component);
- } }
- ].filter(Boolean));
- const keepaliveConfig = props.keepalive ?? routeProps.route.meta.keepalive ?? appKeepalive;
- vnode = _wrapIf(
- Transition,
- hasTransition && transitionProps,
- wrapInKeepAlive(
- keepaliveConfig,
- h(Suspense, {
- suspensible: true,
- onPending: () => nuxtApp.callHook("page:start", routeProps.Component),
- onResolve: () => {
- nextTick(() => nuxtApp.callHook("page:finish", routeProps.Component).then(() => {
- if (!pageLoadingEndHookAlreadyCalled) {
- return nuxtApp.callHook("page:loading:end");
- }
- pageLoadingEndHookAlreadyCalled = false;
- }).finally(done));
- }
- }, {
- default: () => {
- const providerVNode = h(RouteProvider, {
- key: key || void 0,
- vnode: slots.default ? h(Fragment, void 0, slots.default(routeProps)) : routeProps.Component,
- route: routeProps.route,
- renderKey: key || void 0,
- trackRootNodes: hasTransition,
- vnodeRef: pageRef
- });
- return providerVNode;
- }
- })
- )
- ).default();
- return vnode;
- }
- });
- };
- }
- });
- function _mergeTransitionProps(routeProps) {
- const _props = routeProps.map((prop) => ({
- ...prop,
- onAfterLeave: prop.onAfterLeave ? toArray(prop.onAfterLeave) : void 0
- }));
- return defu(..._props);
- }
- function hasChildrenRoutes(fork, newRoute, Component) {
- if (!fork) {
- return false;
- }
- const index = newRoute.matched.findIndex((m) => {
- var _a;
- return ((_a = m.components) == null ? void 0 : _a.default) === (Component == null ? void 0 : Component.type);
- });
- return index < newRoute.matched.length - 1;
- }
- const _export_sfc = (sfc, props) => {
- const target = sfc.__vccOpts || sfc;
- for (const [key, val] of props) {
- target[key] = val;
- }
- return target;
- };
- const _sfc_main$2 = {};
- function _sfc_ssrRender(_ctx, _push, _parent, _attrs) {
- const _component_NuxtLoadingIndicator = __nuxt_component_0;
- const _component_NuxtLayout = __nuxt_component_1;
- const _component_NuxtPage = __nuxt_component_2;
- _push(`<!--[-->`);
- _push(ssrRenderComponent(_component_NuxtLoadingIndicator, { color: "#49A769" }, null, _parent));
- _push(ssrRenderComponent(_component_NuxtLayout, null, {
- default: withCtx((_, _push2, _parent2, _scopeId) => {
- if (_push2) {
- _push2(ssrRenderComponent(_component_NuxtPage, null, null, _parent2, _scopeId));
- } else {
- return [
- createVNode(_component_NuxtPage)
- ];
- }
- }),
- _: 1
- }, _parent));
- _push(`<!--]-->`);
- }
- const _sfc_setup$2 = _sfc_main$2.setup;
- _sfc_main$2.setup = (props, ctx) => {
- const ssrContext = useSSRContext();
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("app.vue");
- return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
- };
- const AppComponent = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender]]);
- const _sfc_main$1 = {
- __name: "error",
- __ssrInlineRender: true,
- setup(__props) {
- useRouter();
- return (_ctx, _push, _parent, _attrs) => {
- _push(`<div${ssrRenderAttrs(mergeProps({ class: "errorBox" }, _attrs))} data-v-ea3a617f><img src="https://img.bjzxtw.org.cn/pre/public/error/404.png" alt="遇到了网络错误!" data-v-ea3a617f><div class="goHome" data-v-ea3a617f> 返回网站首页 </div></div>`);
- };
- }
- };
- const _sfc_setup$1 = _sfc_main$1.setup;
- _sfc_main$1.setup = (props, ctx) => {
- const ssrContext = useSSRContext();
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("error.vue");
- return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
- };
- const ErrorComponent = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ea3a617f"]]);
- const _sfc_main = {
- __name: "nuxt-root",
- __ssrInlineRender: true,
- setup(__props) {
- const IslandRenderer = () => null;
- const nuxtApp = useNuxtApp();
- nuxtApp.deferHydration();
- nuxtApp.ssrContext.url;
- const SingleRenderer = false;
- provide(PageRouteSymbol, useRoute());
- nuxtApp.hooks.callHookWith((hooks) => hooks.map((hook) => hook()), "vue:setup");
- const error = useError();
- const abortRender = error.value && !nuxtApp.ssrContext.error;
- onErrorCaptured((err, target, info) => {
- nuxtApp.hooks.callHook("vue:error", err, target, info).catch((hookError) => console.error("[nuxt] Error in `vue:error` hook", hookError));
- {
- const p = nuxtApp.runWithContext(() => showError(err));
- onServerPrefetch(() => p);
- return false;
- }
- });
- const islandContext = nuxtApp.ssrContext.islandContext;
- return (_ctx, _push, _parent, _attrs) => {
- ssrRenderSuspense(_push, {
- default: () => {
- if (unref(abortRender)) {
- _push(`<div></div>`);
- } else if (unref(error)) {
- _push(ssrRenderComponent(unref(ErrorComponent), { error: unref(error) }, null, _parent));
- } else if (unref(islandContext)) {
- _push(ssrRenderComponent(unref(IslandRenderer), { context: unref(islandContext) }, null, _parent));
- } else if (unref(SingleRenderer)) {
- ssrRenderVNode(_push, createVNode(resolveDynamicComponent(unref(SingleRenderer)), null, null), _parent);
- } else {
- _push(ssrRenderComponent(unref(AppComponent), null, null, _parent));
- }
- },
- _: 1
- });
- };
- }
- };
- const _sfc_setup = _sfc_main.setup;
- _sfc_main.setup = (props, ctx) => {
- const ssrContext = useSSRContext();
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("node_modules/nuxt/dist/app/components/nuxt-root.vue");
- return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
- };
- let entry;
- {
- entry = async function createNuxtAppServer(ssrContext) {
- const vueApp = createApp(_sfc_main);
- const nuxt = createNuxtApp({ vueApp, ssrContext });
- try {
- await applyPlugins(nuxt, plugins);
- await nuxt.hooks.callHook("app:created", vueApp);
- } catch (error) {
- await nuxt.hooks.callHook("app:error", error);
- nuxt.payload.error = nuxt.payload.error || createError(error);
- }
- if (ssrContext == null ? void 0 : ssrContext._renderResponse) {
- throw new Error("skipping render");
- }
- return vueApp;
- };
- }
- const entry$1 = (ssrContext) => entry(ssrContext);
- export {
- _export_sfc as _,
- useRoute as a,
- asyncDataDefaults as b,
- createError as c,
- useRouter as d,
- entry$1 as default,
- resolveRouteObject as e,
- navigateTo as f,
- useRuntimeConfig as g,
- hashMode as h,
- injectHead as i,
- defineNuxtRouteMiddleware as j,
- nuxtLinkDefaults as n,
- resolveUnrefHeadInput as r,
- useNuxtApp as u
- };
- //# sourceMappingURL=server.mjs.map
|