|
@@ -0,0 +1,1197 @@
|
|
|
+import { effectScope, shallowReactive, reactive, getCurrentScope, hasInjectionContext, getCurrentInstance, inject, toRef, version, unref, h, shallowRef, isReadonly, isRef, isShallow, isReactive, toRaw, defineComponent, provide, ref, watch, Suspense, nextTick, Fragment, Transition, useSSRContext, defineAsyncComponent, mergeProps, onErrorCaptured, onServerPrefetch, createVNode, resolveDynamicComponent, createApp } from "vue";
|
|
|
+import { $fetch } 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, RouterView } from "vue-router";
|
|
|
+import { toRouteMatcher, createRouter } from "radix3";
|
|
|
+import { defu } from "defu";
|
|
|
+import { hasProtocol, isScriptProtocol, joinURL, withQuery } from "ufo";
|
|
|
+import { ssrRenderAttrs, ssrRenderComponent, ssrRenderSuspense, ssrRenderVNode } from "vue/server-renderer";
|
|
|
+if (!globalThis.$fetch) {
|
|
|
+ globalThis.$fetch = $fetch.create({
|
|
|
+ baseURL: baseURL()
|
|
|
+ });
|
|
|
+}
|
|
|
+const appPageTransition = false;
|
|
|
+const appKeepalive = false;
|
|
|
+const nuxtLinkDefaults = { "componentName": "NuxtLink", "prefetch": true, "prefetchOn": { "visibility": 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.13.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 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(/"/g, "%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 && currentInstance === void 0) {
|
|
|
+ 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 });
|
|
|
+ }
|
|
|
+ contexts[key];
|
|
|
+ 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 interpolatePath = (route, match) => {
|
|
|
+ return match.path.replace(/(:\w+)\([^)]+\)/g, "$1").replace(/(:\w+)[?+*]/g, "$1").replace(/:\w+/g, (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(url) {
|
|
|
+ {
|
|
|
+ const _routeRulesMatcher = toRouteMatcher(
|
|
|
+ createRouter({ routes: (/* @__PURE__ */ useRuntimeConfig()).nitro.routeRules })
|
|
|
+ );
|
|
|
+ return defu({}, ..._routeRulesMatcher.matchAll(url).reverse());
|
|
|
+ }
|
|
|
+}
|
|
|
+const _routes = [
|
|
|
+ {
|
|
|
+ name: "index",
|
|
|
+ path: "/",
|
|
|
+ component: () => import("./_nuxt/index-CPaUT6RS.js")
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "login",
|
|
|
+ path: "/login",
|
|
|
+ component: () => import("./_nuxt/login-C0jWU6fx.js")
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "register",
|
|
|
+ path: "/register",
|
|
|
+ component: () => import("./_nuxt/register-hicBJgDn.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);
|
|
|
+ } };
|
|
|
+};
|
|
|
+function generateRouteKey(route) {
|
|
|
+ const source = (route == null ? void 0 : route.meta.key) ?? route.path.replace(/(:\w+)\([^)]+\)/g, "$1").replace(/(:\w+)[?+*]/g, "$1").replace(/:\w+/g, (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 configRouterOptions = {
|
|
|
+ hashMode: false,
|
|
|
+ scrollBehaviorType: "auto"
|
|
|
+};
|
|
|
+const routerOptions = {
|
|
|
+ ...configRouterOptions,
|
|
|
+ ...routerOptions0
|
|
|
+};
|
|
|
+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 = {};
|
|
|
+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 (routerOptions.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
|
|
|
+ });
|
|
|
+ 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.matched.length === 0) {
|
|
|
+ await nuxtApp.runWithContext(() => showError(createError$1({
|
|
|
+ statusCode: 404,
|
|
|
+ fatal: false,
|
|
|
+ statusMessage: `Page not found: ${to.fullPath}`,
|
|
|
+ data: {
|
|
|
+ path: to.fullPath
|
|
|
+ }
|
|
|
+ })));
|
|
|
+ } else 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(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");
|
|
|
+ });
|
|
|
+ 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 plugins = [
|
|
|
+ unhead_KgADcZ0jPj,
|
|
|
+ plugin,
|
|
|
+ revive_payload_server_eJ33V7gbc6,
|
|
|
+ components_plugin_KR1HBZs4kY
|
|
|
+];
|
|
|
+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_0 = 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");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ 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");
|
|
|
+ }
|
|
|
+ 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(() => nuxtApp.callHook("page:loading:end")).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_NuxtPage = __nuxt_component_0;
|
|
|
+ _push(`<div${ssrRenderAttrs(_attrs)}>`);
|
|
|
+ _push(ssrRenderComponent(_component_NuxtPage, null, null, _parent));
|
|
|
+ _push(`</div>`);
|
|
|
+}
|
|
|
+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: "nuxt-error-page",
|
|
|
+ __ssrInlineRender: true,
|
|
|
+ props: {
|
|
|
+ error: Object
|
|
|
+ },
|
|
|
+ setup(__props) {
|
|
|
+ const props = __props;
|
|
|
+ const _error = props.error;
|
|
|
+ _error.stack ? _error.stack.split("\n").splice(1).map((line) => {
|
|
|
+ const text = line.replace("webpack:/", "").replace(".vue", ".js").trim();
|
|
|
+ return {
|
|
|
+ text,
|
|
|
+ internal: line.includes("node_modules") && !line.includes(".cache") || line.includes("internal") || line.includes("new Promise")
|
|
|
+ };
|
|
|
+ }).map((i) => `<span class="stack${i.internal ? " internal" : ""}">${i.text}</span>`).join("\n") : "";
|
|
|
+ const statusCode = Number(_error.statusCode || 500);
|
|
|
+ const is404 = statusCode === 404;
|
|
|
+ const statusMessage = _error.statusMessage ?? (is404 ? "Page Not Found" : "Internal Server Error");
|
|
|
+ const description = _error.message || _error.toString();
|
|
|
+ const stack = void 0;
|
|
|
+ const _Error404 = defineAsyncComponent(() => import("./_nuxt/error-404-Dj6KT2oP.js"));
|
|
|
+ const _Error = defineAsyncComponent(() => import("./_nuxt/error-500-B0Hn6rMk.js"));
|
|
|
+ const ErrorTemplate = is404 ? _Error404 : _Error;
|
|
|
+ return (_ctx, _push, _parent, _attrs) => {
|
|
|
+ _push(ssrRenderComponent(unref(ErrorTemplate), mergeProps({ statusCode: unref(statusCode), statusMessage: unref(statusMessage), description: unref(description), stack: unref(stack) }, _attrs), null, _parent));
|
|
|
+ };
|
|
|
+ }
|
|
|
+};
|
|
|
+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("node_modules/nuxt/dist/app/components/nuxt-error-page.vue");
|
|
|
+ return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
|
|
+};
|
|
|
+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(_sfc_main$1), { 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 _,
|
|
|
+ navigateTo as a,
|
|
|
+ useNuxtApp as b,
|
|
|
+ useRuntimeConfig as c,
|
|
|
+ resolveUnrefHeadInput as d,
|
|
|
+ entry$1 as default,
|
|
|
+ injectHead as i,
|
|
|
+ nuxtLinkDefaults as n,
|
|
|
+ resolveRouteObject as r,
|
|
|
+ useRouter as u
|
|
|
+};
|
|
|
+//# sourceMappingURL=server.mjs.map
|