server.mjs 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197
  1. 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";
  2. import { $fetch } from "ofetch";
  3. import { baseURL } from "#internal/nuxt/paths";
  4. import { createHooks } from "hookable";
  5. import { getContext } from "unctx";
  6. import { sanitizeStatusCode, createError as createError$1 } from "h3";
  7. import { getActiveHead, CapoPlugin } from "unhead";
  8. import { defineHeadPlugin } from "@unhead/shared";
  9. import { START_LOCATION, createMemoryHistory, createRouter as createRouter$1, RouterView } from "vue-router";
  10. import { toRouteMatcher, createRouter } from "radix3";
  11. import { defu } from "defu";
  12. import { hasProtocol, isScriptProtocol, joinURL, withQuery } from "ufo";
  13. import { ssrRenderAttrs, ssrRenderComponent, ssrRenderSuspense, ssrRenderVNode } from "vue/server-renderer";
  14. if (!globalThis.$fetch) {
  15. globalThis.$fetch = $fetch.create({
  16. baseURL: baseURL()
  17. });
  18. }
  19. const appPageTransition = false;
  20. const appKeepalive = false;
  21. const nuxtLinkDefaults = { "componentName": "NuxtLink", "prefetch": true, "prefetchOn": { "visibility": true } };
  22. const appId = "nuxt-app";
  23. function getNuxtAppCtx(id = appId) {
  24. return getContext(id, {
  25. asyncContext: false
  26. });
  27. }
  28. const NuxtPluginIndicator = "__nuxt_plugin";
  29. function createNuxtApp(options) {
  30. var _a;
  31. let hydratingCount = 0;
  32. const nuxtApp = {
  33. _id: options.id || appId || "nuxt-app",
  34. _scope: effectScope(),
  35. provide: void 0,
  36. globalName: "nuxt",
  37. versions: {
  38. get nuxt() {
  39. return "3.13.2";
  40. },
  41. get vue() {
  42. return nuxtApp.vueApp.version;
  43. }
  44. },
  45. payload: shallowReactive({
  46. ...((_a = options.ssrContext) == null ? void 0 : _a.payload) || {},
  47. data: shallowReactive({}),
  48. state: reactive({}),
  49. once: /* @__PURE__ */ new Set(),
  50. _errors: shallowReactive({})
  51. }),
  52. static: {
  53. data: {}
  54. },
  55. runWithContext(fn) {
  56. if (nuxtApp._scope.active && !getCurrentScope()) {
  57. return nuxtApp._scope.run(() => callWithNuxt(nuxtApp, fn));
  58. }
  59. return callWithNuxt(nuxtApp, fn);
  60. },
  61. isHydrating: false,
  62. deferHydration() {
  63. if (!nuxtApp.isHydrating) {
  64. return () => {
  65. };
  66. }
  67. hydratingCount++;
  68. let called = false;
  69. return () => {
  70. if (called) {
  71. return;
  72. }
  73. called = true;
  74. hydratingCount--;
  75. if (hydratingCount === 0) {
  76. nuxtApp.isHydrating = false;
  77. return nuxtApp.callHook("app:suspense:resolve");
  78. }
  79. };
  80. },
  81. _asyncDataPromises: {},
  82. _asyncData: shallowReactive({}),
  83. _payloadRevivers: {},
  84. ...options
  85. };
  86. {
  87. nuxtApp.payload.serverRendered = true;
  88. }
  89. if (nuxtApp.ssrContext) {
  90. nuxtApp.payload.path = nuxtApp.ssrContext.url;
  91. nuxtApp.ssrContext.nuxt = nuxtApp;
  92. nuxtApp.ssrContext.payload = nuxtApp.payload;
  93. nuxtApp.ssrContext.config = {
  94. public: nuxtApp.ssrContext.runtimeConfig.public,
  95. app: nuxtApp.ssrContext.runtimeConfig.app
  96. };
  97. }
  98. nuxtApp.hooks = createHooks();
  99. nuxtApp.hook = nuxtApp.hooks.hook;
  100. {
  101. const contextCaller = async function(hooks, args) {
  102. for (const hook of hooks) {
  103. await nuxtApp.runWithContext(() => hook(...args));
  104. }
  105. };
  106. nuxtApp.hooks.callHook = (name, ...args) => nuxtApp.hooks.callHookWith(contextCaller, name, ...args);
  107. }
  108. nuxtApp.callHook = nuxtApp.hooks.callHook;
  109. nuxtApp.provide = (name, value) => {
  110. const $name = "$" + name;
  111. defineGetter(nuxtApp, $name, value);
  112. defineGetter(nuxtApp.vueApp.config.globalProperties, $name, value);
  113. };
  114. defineGetter(nuxtApp.vueApp, "$nuxt", nuxtApp);
  115. defineGetter(nuxtApp.vueApp.config.globalProperties, "$nuxt", nuxtApp);
  116. const runtimeConfig = options.ssrContext.runtimeConfig;
  117. nuxtApp.provide("config", runtimeConfig);
  118. return nuxtApp;
  119. }
  120. function registerPluginHooks(nuxtApp, plugin2) {
  121. if (plugin2.hooks) {
  122. nuxtApp.hooks.addHooks(plugin2.hooks);
  123. }
  124. }
  125. async function applyPlugin(nuxtApp, plugin2) {
  126. if (typeof plugin2 === "function") {
  127. const { provide: provide2 } = await nuxtApp.runWithContext(() => plugin2(nuxtApp)) || {};
  128. if (provide2 && typeof provide2 === "object") {
  129. for (const key in provide2) {
  130. nuxtApp.provide(key, provide2[key]);
  131. }
  132. }
  133. }
  134. }
  135. async function applyPlugins(nuxtApp, plugins2) {
  136. var _a, _b, _c, _d;
  137. const resolvedPlugins = [];
  138. const unresolvedPlugins = [];
  139. const parallels = [];
  140. const errors = [];
  141. let promiseDepth = 0;
  142. async function executePlugin(plugin2) {
  143. var _a2;
  144. const unresolvedPluginsForThisPlugin = ((_a2 = plugin2.dependsOn) == null ? void 0 : _a2.filter((name) => plugins2.some((p) => p._name === name) && !resolvedPlugins.includes(name))) ?? [];
  145. if (unresolvedPluginsForThisPlugin.length > 0) {
  146. unresolvedPlugins.push([new Set(unresolvedPluginsForThisPlugin), plugin2]);
  147. } else {
  148. const promise = applyPlugin(nuxtApp, plugin2).then(async () => {
  149. if (plugin2._name) {
  150. resolvedPlugins.push(plugin2._name);
  151. await Promise.all(unresolvedPlugins.map(async ([dependsOn, unexecutedPlugin]) => {
  152. if (dependsOn.has(plugin2._name)) {
  153. dependsOn.delete(plugin2._name);
  154. if (dependsOn.size === 0) {
  155. promiseDepth++;
  156. await executePlugin(unexecutedPlugin);
  157. }
  158. }
  159. }));
  160. }
  161. });
  162. if (plugin2.parallel) {
  163. parallels.push(promise.catch((e) => errors.push(e)));
  164. } else {
  165. await promise;
  166. }
  167. }
  168. }
  169. for (const plugin2 of plugins2) {
  170. if (((_a = nuxtApp.ssrContext) == null ? void 0 : _a.islandContext) && ((_b = plugin2.env) == null ? void 0 : _b.islands) === false) {
  171. continue;
  172. }
  173. registerPluginHooks(nuxtApp, plugin2);
  174. }
  175. for (const plugin2 of plugins2) {
  176. if (((_c = nuxtApp.ssrContext) == null ? void 0 : _c.islandContext) && ((_d = plugin2.env) == null ? void 0 : _d.islands) === false) {
  177. continue;
  178. }
  179. await executePlugin(plugin2);
  180. }
  181. await Promise.all(parallels);
  182. if (promiseDepth) {
  183. for (let i = 0; i < promiseDepth; i++) {
  184. await Promise.all(parallels);
  185. }
  186. }
  187. if (errors.length) {
  188. throw errors[0];
  189. }
  190. }
  191. // @__NO_SIDE_EFFECTS__
  192. function defineNuxtPlugin(plugin2) {
  193. if (typeof plugin2 === "function") {
  194. return plugin2;
  195. }
  196. const _name = plugin2._name || plugin2.name;
  197. delete plugin2.name;
  198. return Object.assign(plugin2.setup || (() => {
  199. }), plugin2, { [NuxtPluginIndicator]: true, _name });
  200. }
  201. function callWithNuxt(nuxt, setup, args) {
  202. const fn = () => setup();
  203. const nuxtAppCtx = getNuxtAppCtx(nuxt._id);
  204. {
  205. return nuxt.vueApp.runWithContext(() => nuxtAppCtx.callAsync(nuxt, fn));
  206. }
  207. }
  208. function tryUseNuxtApp(id) {
  209. var _a;
  210. let nuxtAppInstance;
  211. if (hasInjectionContext()) {
  212. nuxtAppInstance = (_a = getCurrentInstance()) == null ? void 0 : _a.appContext.app.$nuxt;
  213. }
  214. nuxtAppInstance = nuxtAppInstance || getNuxtAppCtx(id).tryUse();
  215. return nuxtAppInstance || null;
  216. }
  217. function useNuxtApp(id) {
  218. const nuxtAppInstance = tryUseNuxtApp(id);
  219. if (!nuxtAppInstance) {
  220. {
  221. throw new Error("[nuxt] instance unavailable");
  222. }
  223. }
  224. return nuxtAppInstance;
  225. }
  226. // @__NO_SIDE_EFFECTS__
  227. function useRuntimeConfig(_event) {
  228. return useNuxtApp().$config;
  229. }
  230. function defineGetter(obj, key, val) {
  231. Object.defineProperty(obj, key, { get: () => val });
  232. }
  233. const LayoutMetaSymbol = Symbol("layout-meta");
  234. const PageRouteSymbol = Symbol("route");
  235. const useRouter = () => {
  236. var _a;
  237. return (_a = useNuxtApp()) == null ? void 0 : _a.$router;
  238. };
  239. const useRoute = () => {
  240. if (hasInjectionContext()) {
  241. return inject(PageRouteSymbol, useNuxtApp()._route);
  242. }
  243. return useNuxtApp()._route;
  244. };
  245. // @__NO_SIDE_EFFECTS__
  246. function defineNuxtRouteMiddleware(middleware) {
  247. return middleware;
  248. }
  249. const isProcessingMiddleware = () => {
  250. try {
  251. if (useNuxtApp()._processingMiddleware) {
  252. return true;
  253. }
  254. } catch {
  255. return false;
  256. }
  257. return false;
  258. };
  259. const navigateTo = (to, options) => {
  260. if (!to) {
  261. to = "/";
  262. }
  263. const toPath = typeof to === "string" ? to : "path" in to ? resolveRouteObject(to) : useRouter().resolve(to).href;
  264. const isExternalHost = hasProtocol(toPath, { acceptRelative: true });
  265. const isExternal = (options == null ? void 0 : options.external) || isExternalHost;
  266. if (isExternal) {
  267. if (!(options == null ? void 0 : options.external)) {
  268. throw new Error("Navigating to an external URL is not allowed by default. Use `navigateTo(url, { external: true })`.");
  269. }
  270. const { protocol } = new URL(toPath, "http://localhost");
  271. if (protocol && isScriptProtocol(protocol)) {
  272. throw new Error(`Cannot navigate to a URL with '${protocol}' protocol.`);
  273. }
  274. }
  275. const inMiddleware = isProcessingMiddleware();
  276. const router = useRouter();
  277. const nuxtApp = useNuxtApp();
  278. {
  279. if (nuxtApp.ssrContext) {
  280. const fullPath = typeof to === "string" || isExternal ? toPath : router.resolve(to).fullPath || "/";
  281. const location2 = isExternal ? toPath : joinURL((/* @__PURE__ */ useRuntimeConfig()).app.baseURL, fullPath);
  282. const redirect = async function(response) {
  283. await nuxtApp.callHook("app:redirected");
  284. const encodedLoc = location2.replace(/"/g, "%22");
  285. const encodedHeader = encodeURL(location2, isExternalHost);
  286. nuxtApp.ssrContext._renderResponse = {
  287. statusCode: sanitizeStatusCode((options == null ? void 0 : options.redirectCode) || 302, 302),
  288. body: `<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=${encodedLoc}"></head></html>`,
  289. headers: { location: encodedHeader }
  290. };
  291. return response;
  292. };
  293. if (!isExternal && inMiddleware) {
  294. router.afterEach((final) => final.fullPath === fullPath ? redirect(false) : void 0);
  295. return to;
  296. }
  297. return redirect(!inMiddleware ? void 0 : (
  298. /* abort route navigation */
  299. false
  300. ));
  301. }
  302. }
  303. if (isExternal) {
  304. nuxtApp._scope.stop();
  305. if (options == null ? void 0 : options.replace) {
  306. (void 0).replace(toPath);
  307. } else {
  308. (void 0).href = toPath;
  309. }
  310. if (inMiddleware) {
  311. if (!nuxtApp.isHydrating) {
  312. return false;
  313. }
  314. return new Promise(() => {
  315. });
  316. }
  317. return Promise.resolve();
  318. }
  319. return (options == null ? void 0 : options.replace) ? router.replace(to) : router.push(to);
  320. };
  321. function resolveRouteObject(to) {
  322. return withQuery(to.path || "", to.query || {}) + (to.hash || "");
  323. }
  324. function encodeURL(location2, isExternalHost = false) {
  325. const url = new URL(location2, "http://localhost");
  326. if (!isExternalHost) {
  327. return url.pathname + url.search + url.hash;
  328. }
  329. if (location2.startsWith("//")) {
  330. return url.toString().replace(url.protocol, "");
  331. }
  332. return url.toString();
  333. }
  334. const NUXT_ERROR_SIGNATURE = "__nuxt_error";
  335. const useError = () => toRef(useNuxtApp().payload, "error");
  336. const showError = (error) => {
  337. const nuxtError = createError(error);
  338. try {
  339. const nuxtApp = useNuxtApp();
  340. const error2 = useError();
  341. if (false) ;
  342. error2.value = error2.value || nuxtError;
  343. } catch {
  344. throw nuxtError;
  345. }
  346. return nuxtError;
  347. };
  348. const isNuxtError = (error) => !!error && typeof error === "object" && NUXT_ERROR_SIGNATURE in error;
  349. const createError = (error) => {
  350. const nuxtError = createError$1(error);
  351. Object.defineProperty(nuxtError, NUXT_ERROR_SIGNATURE, {
  352. value: true,
  353. configurable: false,
  354. writable: false
  355. });
  356. return nuxtError;
  357. };
  358. version[0] === "3";
  359. function resolveUnref(r) {
  360. return typeof r === "function" ? r() : unref(r);
  361. }
  362. function resolveUnrefHeadInput(ref2) {
  363. if (ref2 instanceof Promise || ref2 instanceof Date || ref2 instanceof RegExp)
  364. return ref2;
  365. const root = resolveUnref(ref2);
  366. if (!ref2 || !root)
  367. return root;
  368. if (Array.isArray(root))
  369. return root.map((r) => resolveUnrefHeadInput(r));
  370. if (typeof root === "object") {
  371. const resolved = {};
  372. for (const k in root) {
  373. if (!Object.prototype.hasOwnProperty.call(root, k)) {
  374. continue;
  375. }
  376. if (k === "titleTemplate" || k[0] === "o" && k[1] === "n") {
  377. resolved[k] = unref(root[k]);
  378. continue;
  379. }
  380. resolved[k] = resolveUnrefHeadInput(root[k]);
  381. }
  382. return resolved;
  383. }
  384. return root;
  385. }
  386. defineHeadPlugin({
  387. hooks: {
  388. "entries:resolve": (ctx) => {
  389. for (const entry2 of ctx.entries)
  390. entry2.resolvedInput = resolveUnrefHeadInput(entry2.input);
  391. }
  392. }
  393. });
  394. const headSymbol = "usehead";
  395. const _global = typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  396. const globalKey$1 = "__unhead_injection_handler__";
  397. function setHeadInjectionHandler(handler) {
  398. _global[globalKey$1] = handler;
  399. }
  400. function injectHead() {
  401. if (globalKey$1 in _global) {
  402. return _global[globalKey$1]();
  403. }
  404. const head = inject(headSymbol);
  405. if (!head && process.env.NODE_ENV !== "production")
  406. console.warn("Unhead is missing Vue context, falling back to shared context. This may have unexpected results.");
  407. return head || getActiveHead();
  408. }
  409. [CapoPlugin({ track: true })];
  410. const unhead_KgADcZ0jPj = /* @__PURE__ */ defineNuxtPlugin({
  411. name: "nuxt:head",
  412. enforce: "pre",
  413. setup(nuxtApp) {
  414. const head = nuxtApp.ssrContext.head;
  415. setHeadInjectionHandler(
  416. // need a fresh instance of the nuxt app to avoid parallel requests interfering with each other
  417. () => useNuxtApp().vueApp._context.provides.usehead
  418. );
  419. nuxtApp.vueApp.use(head);
  420. }
  421. });
  422. function createContext(opts = {}) {
  423. let currentInstance;
  424. let isSingleton = false;
  425. const checkConflict = (instance) => {
  426. if (currentInstance && currentInstance !== instance) {
  427. throw new Error("Context conflict");
  428. }
  429. };
  430. let als;
  431. if (opts.asyncContext) {
  432. const _AsyncLocalStorage = opts.AsyncLocalStorage || globalThis.AsyncLocalStorage;
  433. if (_AsyncLocalStorage) {
  434. als = new _AsyncLocalStorage();
  435. } else {
  436. console.warn("[unctx] `AsyncLocalStorage` is not provided.");
  437. }
  438. }
  439. const _getCurrentInstance = () => {
  440. if (als && currentInstance === void 0) {
  441. const instance = als.getStore();
  442. if (instance !== void 0) {
  443. return instance;
  444. }
  445. }
  446. return currentInstance;
  447. };
  448. return {
  449. use: () => {
  450. const _instance = _getCurrentInstance();
  451. if (_instance === void 0) {
  452. throw new Error("Context is not available");
  453. }
  454. return _instance;
  455. },
  456. tryUse: () => {
  457. return _getCurrentInstance();
  458. },
  459. set: (instance, replace) => {
  460. if (!replace) {
  461. checkConflict(instance);
  462. }
  463. currentInstance = instance;
  464. isSingleton = true;
  465. },
  466. unset: () => {
  467. currentInstance = void 0;
  468. isSingleton = false;
  469. },
  470. call: (instance, callback) => {
  471. checkConflict(instance);
  472. currentInstance = instance;
  473. try {
  474. return als ? als.run(instance, callback) : callback();
  475. } finally {
  476. if (!isSingleton) {
  477. currentInstance = void 0;
  478. }
  479. }
  480. },
  481. async callAsync(instance, callback) {
  482. currentInstance = instance;
  483. const onRestore = () => {
  484. currentInstance = instance;
  485. };
  486. const onLeave = () => currentInstance === instance ? onRestore : void 0;
  487. asyncHandlers.add(onLeave);
  488. try {
  489. const r = als ? als.run(instance, callback) : callback();
  490. if (!isSingleton) {
  491. currentInstance = void 0;
  492. }
  493. return await r;
  494. } finally {
  495. asyncHandlers.delete(onLeave);
  496. }
  497. }
  498. };
  499. }
  500. function createNamespace(defaultOpts = {}) {
  501. const contexts = {};
  502. return {
  503. get(key, opts = {}) {
  504. if (!contexts[key]) {
  505. contexts[key] = createContext({ ...defaultOpts, ...opts });
  506. }
  507. contexts[key];
  508. return contexts[key];
  509. }
  510. };
  511. }
  512. const _globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : {};
  513. const globalKey = "__unctx__";
  514. _globalThis[globalKey] || (_globalThis[globalKey] = createNamespace());
  515. const asyncHandlersKey = "__unctx_async_handlers__";
  516. const asyncHandlers = _globalThis[asyncHandlersKey] || (_globalThis[asyncHandlersKey] = /* @__PURE__ */ new Set());
  517. function executeAsync(function_) {
  518. const restores = [];
  519. for (const leaveHandler of asyncHandlers) {
  520. const restore2 = leaveHandler();
  521. if (restore2) {
  522. restores.push(restore2);
  523. }
  524. }
  525. const restore = () => {
  526. for (const restore2 of restores) {
  527. restore2();
  528. }
  529. };
  530. let awaitable = function_();
  531. if (awaitable && typeof awaitable === "object" && "catch" in awaitable) {
  532. awaitable = awaitable.catch((error) => {
  533. restore();
  534. throw error;
  535. });
  536. }
  537. return [awaitable, restore];
  538. }
  539. const interpolatePath = (route, match) => {
  540. return match.path.replace(/(:\w+)\([^)]+\)/g, "$1").replace(/(:\w+)[?+*]/g, "$1").replace(/:\w+/g, (r) => {
  541. var _a;
  542. return ((_a = route.params[r.slice(1)]) == null ? void 0 : _a.toString()) || "";
  543. });
  544. };
  545. const generateRouteKey$1 = (routeProps, override) => {
  546. const matchedRoute = routeProps.route.matched.find((m) => {
  547. var _a;
  548. return ((_a = m.components) == null ? void 0 : _a.default) === routeProps.Component.type;
  549. });
  550. const source = override ?? (matchedRoute == null ? void 0 : matchedRoute.meta.key) ?? (matchedRoute && interpolatePath(routeProps.route, matchedRoute));
  551. return typeof source === "function" ? source(routeProps.route) : source;
  552. };
  553. const wrapInKeepAlive = (props, children) => {
  554. return { default: () => children };
  555. };
  556. function toArray(value) {
  557. return Array.isArray(value) ? value : [value];
  558. }
  559. async function getRouteRules(url) {
  560. {
  561. const _routeRulesMatcher = toRouteMatcher(
  562. createRouter({ routes: (/* @__PURE__ */ useRuntimeConfig()).nitro.routeRules })
  563. );
  564. return defu({}, ..._routeRulesMatcher.matchAll(url).reverse());
  565. }
  566. }
  567. const _routes = [
  568. {
  569. name: "index",
  570. path: "/",
  571. component: () => import("./_nuxt/index-CPaUT6RS.js")
  572. },
  573. {
  574. name: "login",
  575. path: "/login",
  576. component: () => import("./_nuxt/login-C0jWU6fx.js")
  577. },
  578. {
  579. name: "register",
  580. path: "/register",
  581. component: () => import("./_nuxt/register-hicBJgDn.js")
  582. }
  583. ];
  584. const _wrapIf = (component, props, slots) => {
  585. props = props === true ? {} : props;
  586. return { default: () => {
  587. var _a;
  588. return props ? h(component, props, slots) : (_a = slots.default) == null ? void 0 : _a.call(slots);
  589. } };
  590. };
  591. function generateRouteKey(route) {
  592. const source = (route == null ? void 0 : route.meta.key) ?? route.path.replace(/(:\w+)\([^)]+\)/g, "$1").replace(/(:\w+)[?+*]/g, "$1").replace(/:\w+/g, (r) => {
  593. var _a;
  594. return ((_a = route.params[r.slice(1)]) == null ? void 0 : _a.toString()) || "";
  595. });
  596. return typeof source === "function" ? source(route) : source;
  597. }
  598. function isChangingPage(to, from) {
  599. if (to === from || from === START_LOCATION) {
  600. return false;
  601. }
  602. if (generateRouteKey(to) !== generateRouteKey(from)) {
  603. return true;
  604. }
  605. const areComponentsSame = to.matched.every(
  606. (comp, index) => {
  607. var _a, _b;
  608. return comp.components && comp.components.default === ((_b = (_a = from.matched[index]) == null ? void 0 : _a.components) == null ? void 0 : _b.default);
  609. }
  610. );
  611. if (areComponentsSame) {
  612. return false;
  613. }
  614. return true;
  615. }
  616. const routerOptions0 = {
  617. scrollBehavior(to, from, savedPosition) {
  618. var _a;
  619. const nuxtApp = useNuxtApp();
  620. const behavior = ((_a = useRouter().options) == null ? void 0 : _a.scrollBehaviorType) ?? "auto";
  621. let position = savedPosition || void 0;
  622. const routeAllowsScrollToTop = typeof to.meta.scrollToTop === "function" ? to.meta.scrollToTop(to, from) : to.meta.scrollToTop;
  623. if (!position && from && to && routeAllowsScrollToTop !== false && isChangingPage(to, from)) {
  624. position = { left: 0, top: 0 };
  625. }
  626. if (to.path === from.path) {
  627. if (from.hash && !to.hash) {
  628. return { left: 0, top: 0 };
  629. }
  630. if (to.hash) {
  631. return { el: to.hash, top: _getHashElementScrollMarginTop(to.hash), behavior };
  632. }
  633. return false;
  634. }
  635. const hasTransition = (route) => !!(route.meta.pageTransition ?? appPageTransition);
  636. const hookToWait = hasTransition(from) && hasTransition(to) ? "page:transition:finish" : "page:finish";
  637. return new Promise((resolve) => {
  638. nuxtApp.hooks.hookOnce(hookToWait, async () => {
  639. await new Promise((resolve2) => setTimeout(resolve2, 0));
  640. if (to.hash) {
  641. position = { el: to.hash, top: _getHashElementScrollMarginTop(to.hash), behavior };
  642. }
  643. resolve(position);
  644. });
  645. });
  646. }
  647. };
  648. function _getHashElementScrollMarginTop(selector) {
  649. try {
  650. const elem = (void 0).querySelector(selector);
  651. if (elem) {
  652. return (Number.parseFloat(getComputedStyle(elem).scrollMarginTop) || 0) + (Number.parseFloat(getComputedStyle((void 0).documentElement).scrollPaddingTop) || 0);
  653. }
  654. } catch {
  655. }
  656. return 0;
  657. }
  658. const configRouterOptions = {
  659. hashMode: false,
  660. scrollBehaviorType: "auto"
  661. };
  662. const routerOptions = {
  663. ...configRouterOptions,
  664. ...routerOptions0
  665. };
  666. const validate = /* @__PURE__ */ defineNuxtRouteMiddleware(async (to) => {
  667. var _a;
  668. let __temp, __restore;
  669. if (!((_a = to.meta) == null ? void 0 : _a.validate)) {
  670. return;
  671. }
  672. const nuxtApp = useNuxtApp();
  673. const router = useRouter();
  674. const result = ([__temp, __restore] = executeAsync(() => Promise.resolve(to.meta.validate(to))), __temp = await __temp, __restore(), __temp);
  675. if (result === true) {
  676. return;
  677. }
  678. const error = createError({
  679. statusCode: result && result.statusCode || 404,
  680. statusMessage: result && result.statusMessage || `Page Not Found: ${to.fullPath}`,
  681. data: {
  682. path: to.fullPath
  683. }
  684. });
  685. const unsub = router.beforeResolve((final) => {
  686. unsub();
  687. if (final === to) {
  688. const unsub2 = router.afterEach(async () => {
  689. unsub2();
  690. await nuxtApp.runWithContext(() => showError(error));
  691. });
  692. return false;
  693. }
  694. });
  695. });
  696. const manifest_45route_45rule = /* @__PURE__ */ defineNuxtRouteMiddleware(async (to) => {
  697. {
  698. return;
  699. }
  700. });
  701. const globalMiddleware = [
  702. validate,
  703. manifest_45route_45rule
  704. ];
  705. const namedMiddleware = {};
  706. const plugin = /* @__PURE__ */ defineNuxtPlugin({
  707. name: "nuxt:router",
  708. enforce: "pre",
  709. async setup(nuxtApp) {
  710. var _a, _b, _c;
  711. let __temp, __restore;
  712. let routerBase = (/* @__PURE__ */ useRuntimeConfig()).app.baseURL;
  713. if (routerOptions.hashMode && !routerBase.includes("#")) {
  714. routerBase += "#";
  715. }
  716. const history = ((_a = routerOptions.history) == null ? void 0 : _a.call(routerOptions, routerBase)) ?? createMemoryHistory(routerBase);
  717. const routes = routerOptions.routes ? ([__temp, __restore] = executeAsync(() => routerOptions.routes(_routes)), __temp = await __temp, __restore(), __temp) ?? _routes : _routes;
  718. let startPosition;
  719. const router = createRouter$1({
  720. ...routerOptions,
  721. scrollBehavior: (to, from, savedPosition) => {
  722. if (from === START_LOCATION) {
  723. startPosition = savedPosition;
  724. return;
  725. }
  726. if (routerOptions.scrollBehavior) {
  727. router.options.scrollBehavior = routerOptions.scrollBehavior;
  728. if ("scrollRestoration" in (void 0).history) {
  729. const unsub = router.beforeEach(() => {
  730. unsub();
  731. (void 0).history.scrollRestoration = "manual";
  732. });
  733. }
  734. return routerOptions.scrollBehavior(to, START_LOCATION, startPosition || savedPosition);
  735. }
  736. },
  737. history,
  738. routes
  739. });
  740. nuxtApp.vueApp.use(router);
  741. const previousRoute = shallowRef(router.currentRoute.value);
  742. router.afterEach((_to, from) => {
  743. previousRoute.value = from;
  744. });
  745. Object.defineProperty(nuxtApp.vueApp.config.globalProperties, "previousRoute", {
  746. get: () => previousRoute.value
  747. });
  748. const initialURL = nuxtApp.ssrContext.url;
  749. const _route = shallowRef(router.currentRoute.value);
  750. const syncCurrentRoute = () => {
  751. _route.value = router.currentRoute.value;
  752. };
  753. nuxtApp.hook("page:finish", syncCurrentRoute);
  754. router.afterEach((to, from) => {
  755. var _a2, _b2, _c2, _d;
  756. 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)) {
  757. syncCurrentRoute();
  758. }
  759. });
  760. const route = {};
  761. for (const key in _route.value) {
  762. Object.defineProperty(route, key, {
  763. get: () => _route.value[key],
  764. enumerable: true
  765. });
  766. }
  767. nuxtApp._route = shallowReactive(route);
  768. nuxtApp._middleware = nuxtApp._middleware || {
  769. global: [],
  770. named: {}
  771. };
  772. useError();
  773. if (!((_b = nuxtApp.ssrContext) == null ? void 0 : _b.islandContext)) {
  774. router.afterEach(async (to, _from, failure) => {
  775. delete nuxtApp._processingMiddleware;
  776. if (failure) {
  777. await nuxtApp.callHook("page:loading:end");
  778. }
  779. if ((failure == null ? void 0 : failure.type) === 4) {
  780. return;
  781. }
  782. if (to.matched.length === 0) {
  783. await nuxtApp.runWithContext(() => showError(createError$1({
  784. statusCode: 404,
  785. fatal: false,
  786. statusMessage: `Page not found: ${to.fullPath}`,
  787. data: {
  788. path: to.fullPath
  789. }
  790. })));
  791. } else if (to.redirectedFrom && to.fullPath !== initialURL) {
  792. await nuxtApp.runWithContext(() => navigateTo(to.fullPath || "/"));
  793. }
  794. });
  795. }
  796. try {
  797. if (true) {
  798. ;
  799. [__temp, __restore] = executeAsync(() => router.push(initialURL)), await __temp, __restore();
  800. ;
  801. }
  802. ;
  803. [__temp, __restore] = executeAsync(() => router.isReady()), await __temp, __restore();
  804. ;
  805. } catch (error2) {
  806. [__temp, __restore] = executeAsync(() => nuxtApp.runWithContext(() => showError(error2))), await __temp, __restore();
  807. }
  808. const resolvedInitialRoute = router.currentRoute.value;
  809. syncCurrentRoute();
  810. if ((_c = nuxtApp.ssrContext) == null ? void 0 : _c.islandContext) {
  811. return { provide: { router } };
  812. }
  813. const initialLayout = nuxtApp.payload.state._layout;
  814. router.beforeEach(async (to, from) => {
  815. var _a2, _b2;
  816. await nuxtApp.callHook("page:loading:start");
  817. to.meta = reactive(to.meta);
  818. if (nuxtApp.isHydrating && initialLayout && !isReadonly(to.meta.layout)) {
  819. to.meta.layout = initialLayout;
  820. }
  821. nuxtApp._processingMiddleware = true;
  822. if (!((_a2 = nuxtApp.ssrContext) == null ? void 0 : _a2.islandContext)) {
  823. const middlewareEntries = /* @__PURE__ */ new Set([...globalMiddleware, ...nuxtApp._middleware.global]);
  824. for (const component of to.matched) {
  825. const componentMiddleware = component.meta.middleware;
  826. if (!componentMiddleware) {
  827. continue;
  828. }
  829. for (const entry2 of toArray(componentMiddleware)) {
  830. middlewareEntries.add(entry2);
  831. }
  832. }
  833. {
  834. const routeRules = await nuxtApp.runWithContext(() => getRouteRules(to.path));
  835. if (routeRules.appMiddleware) {
  836. for (const key in routeRules.appMiddleware) {
  837. if (routeRules.appMiddleware[key]) {
  838. middlewareEntries.add(key);
  839. } else {
  840. middlewareEntries.delete(key);
  841. }
  842. }
  843. }
  844. }
  845. for (const entry2 of middlewareEntries) {
  846. 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;
  847. if (!middleware) {
  848. throw new Error(`Unknown route middleware: '${entry2}'.`);
  849. }
  850. const result = await nuxtApp.runWithContext(() => middleware(to, from));
  851. {
  852. if (result === false || result instanceof Error) {
  853. const error2 = result || createError$1({
  854. statusCode: 404,
  855. statusMessage: `Page Not Found: ${initialURL}`
  856. });
  857. await nuxtApp.runWithContext(() => showError(error2));
  858. return false;
  859. }
  860. }
  861. if (result === true) {
  862. continue;
  863. }
  864. if (result || result === false) {
  865. return result;
  866. }
  867. }
  868. }
  869. });
  870. router.onError(async () => {
  871. delete nuxtApp._processingMiddleware;
  872. await nuxtApp.callHook("page:loading:end");
  873. });
  874. nuxtApp.hooks.hookOnce("app:created", async () => {
  875. try {
  876. if ("name" in resolvedInitialRoute) {
  877. resolvedInitialRoute.name = void 0;
  878. }
  879. await router.replace({
  880. ...resolvedInitialRoute,
  881. force: true
  882. });
  883. router.options.scrollBehavior = routerOptions.scrollBehavior;
  884. } catch (error2) {
  885. await nuxtApp.runWithContext(() => showError(error2));
  886. }
  887. });
  888. return { provide: { router } };
  889. }
  890. });
  891. function definePayloadReducer(name, reduce) {
  892. {
  893. useNuxtApp().ssrContext._payloadReducers[name] = reduce;
  894. }
  895. }
  896. const reducers = [
  897. ["NuxtError", (data) => isNuxtError(data) && data.toJSON()],
  898. ["EmptyShallowRef", (data) => isRef(data) && isShallow(data) && !data.value && (typeof data.value === "bigint" ? "0n" : JSON.stringify(data.value) || "_")],
  899. ["EmptyRef", (data) => isRef(data) && !data.value && (typeof data.value === "bigint" ? "0n" : JSON.stringify(data.value) || "_")],
  900. ["ShallowRef", (data) => isRef(data) && isShallow(data) && data.value],
  901. ["ShallowReactive", (data) => isReactive(data) && isShallow(data) && toRaw(data)],
  902. ["Ref", (data) => isRef(data) && data.value],
  903. ["Reactive", (data) => isReactive(data) && toRaw(data)]
  904. ];
  905. const revive_payload_server_eJ33V7gbc6 = /* @__PURE__ */ defineNuxtPlugin({
  906. name: "nuxt:revive-payload:server",
  907. setup() {
  908. for (const [reducer, fn] of reducers) {
  909. definePayloadReducer(reducer, fn);
  910. }
  911. }
  912. });
  913. const components_plugin_KR1HBZs4kY = /* @__PURE__ */ defineNuxtPlugin({
  914. name: "nuxt:global-components"
  915. });
  916. const plugins = [
  917. unhead_KgADcZ0jPj,
  918. plugin,
  919. revive_payload_server_eJ33V7gbc6,
  920. components_plugin_KR1HBZs4kY
  921. ];
  922. const RouteProvider = defineComponent({
  923. props: {
  924. vnode: {
  925. type: Object,
  926. required: true
  927. },
  928. route: {
  929. type: Object,
  930. required: true
  931. },
  932. vnodeRef: Object,
  933. renderKey: String,
  934. trackRootNodes: Boolean
  935. },
  936. setup(props) {
  937. const previousKey = props.renderKey;
  938. const previousRoute = props.route;
  939. const route = {};
  940. for (const key in props.route) {
  941. Object.defineProperty(route, key, {
  942. get: () => previousKey === props.renderKey ? props.route[key] : previousRoute[key],
  943. enumerable: true
  944. });
  945. }
  946. provide(PageRouteSymbol, shallowReactive(route));
  947. return () => {
  948. return h(props.vnode, { ref: props.vnodeRef });
  949. };
  950. }
  951. });
  952. const __nuxt_component_0 = defineComponent({
  953. name: "NuxtPage",
  954. inheritAttrs: false,
  955. props: {
  956. name: {
  957. type: String
  958. },
  959. transition: {
  960. type: [Boolean, Object],
  961. default: void 0
  962. },
  963. keepalive: {
  964. type: [Boolean, Object],
  965. default: void 0
  966. },
  967. route: {
  968. type: Object
  969. },
  970. pageKey: {
  971. type: [Function, String],
  972. default: null
  973. }
  974. },
  975. setup(props, { attrs, slots, expose }) {
  976. const nuxtApp = useNuxtApp();
  977. const pageRef = ref();
  978. const forkRoute = inject(PageRouteSymbol, null);
  979. let previousPageKey;
  980. expose({ pageRef });
  981. inject(LayoutMetaSymbol, null);
  982. let vnode;
  983. const done = nuxtApp.deferHydration();
  984. if (props.pageKey) {
  985. watch(() => props.pageKey, (next, prev) => {
  986. if (next !== prev) {
  987. nuxtApp.callHook("page:loading:start");
  988. }
  989. });
  990. }
  991. return () => {
  992. return h(RouterView, { name: props.name, route: props.route, ...attrs }, {
  993. default: (routeProps) => {
  994. if (!routeProps.Component) {
  995. done();
  996. return;
  997. }
  998. const key = generateRouteKey$1(routeProps, props.pageKey);
  999. if (!nuxtApp.isHydrating && !hasChildrenRoutes(forkRoute, routeProps.route, routeProps.Component) && previousPageKey === key) {
  1000. nuxtApp.callHook("page:loading:end");
  1001. }
  1002. previousPageKey = key;
  1003. const hasTransition = !!(props.transition ?? routeProps.route.meta.pageTransition ?? appPageTransition);
  1004. const transitionProps = hasTransition && _mergeTransitionProps([
  1005. props.transition,
  1006. routeProps.route.meta.pageTransition,
  1007. appPageTransition,
  1008. { onAfterLeave: () => {
  1009. nuxtApp.callHook("page:transition:finish", routeProps.Component);
  1010. } }
  1011. ].filter(Boolean));
  1012. const keepaliveConfig = props.keepalive ?? routeProps.route.meta.keepalive ?? appKeepalive;
  1013. vnode = _wrapIf(
  1014. Transition,
  1015. hasTransition && transitionProps,
  1016. wrapInKeepAlive(
  1017. keepaliveConfig,
  1018. h(Suspense, {
  1019. suspensible: true,
  1020. onPending: () => nuxtApp.callHook("page:start", routeProps.Component),
  1021. onResolve: () => {
  1022. nextTick(() => nuxtApp.callHook("page:finish", routeProps.Component).then(() => nuxtApp.callHook("page:loading:end")).finally(done));
  1023. }
  1024. }, {
  1025. default: () => {
  1026. const providerVNode = h(RouteProvider, {
  1027. key: key || void 0,
  1028. vnode: slots.default ? h(Fragment, void 0, slots.default(routeProps)) : routeProps.Component,
  1029. route: routeProps.route,
  1030. renderKey: key || void 0,
  1031. trackRootNodes: hasTransition,
  1032. vnodeRef: pageRef
  1033. });
  1034. return providerVNode;
  1035. }
  1036. })
  1037. )
  1038. ).default();
  1039. return vnode;
  1040. }
  1041. });
  1042. };
  1043. }
  1044. });
  1045. function _mergeTransitionProps(routeProps) {
  1046. const _props = routeProps.map((prop) => ({
  1047. ...prop,
  1048. onAfterLeave: prop.onAfterLeave ? toArray(prop.onAfterLeave) : void 0
  1049. }));
  1050. return defu(..._props);
  1051. }
  1052. function hasChildrenRoutes(fork, newRoute, Component) {
  1053. if (!fork) {
  1054. return false;
  1055. }
  1056. const index = newRoute.matched.findIndex((m) => {
  1057. var _a;
  1058. return ((_a = m.components) == null ? void 0 : _a.default) === (Component == null ? void 0 : Component.type);
  1059. });
  1060. return index < newRoute.matched.length - 1;
  1061. }
  1062. const _export_sfc = (sfc, props) => {
  1063. const target = sfc.__vccOpts || sfc;
  1064. for (const [key, val] of props) {
  1065. target[key] = val;
  1066. }
  1067. return target;
  1068. };
  1069. const _sfc_main$2 = {};
  1070. function _sfc_ssrRender(_ctx, _push, _parent, _attrs) {
  1071. const _component_NuxtPage = __nuxt_component_0;
  1072. _push(`<div${ssrRenderAttrs(_attrs)}>`);
  1073. _push(ssrRenderComponent(_component_NuxtPage, null, null, _parent));
  1074. _push(`</div>`);
  1075. }
  1076. const _sfc_setup$2 = _sfc_main$2.setup;
  1077. _sfc_main$2.setup = (props, ctx) => {
  1078. const ssrContext = useSSRContext();
  1079. (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("app.vue");
  1080. return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
  1081. };
  1082. const AppComponent = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender]]);
  1083. const _sfc_main$1 = {
  1084. __name: "nuxt-error-page",
  1085. __ssrInlineRender: true,
  1086. props: {
  1087. error: Object
  1088. },
  1089. setup(__props) {
  1090. const props = __props;
  1091. const _error = props.error;
  1092. _error.stack ? _error.stack.split("\n").splice(1).map((line) => {
  1093. const text = line.replace("webpack:/", "").replace(".vue", ".js").trim();
  1094. return {
  1095. text,
  1096. internal: line.includes("node_modules") && !line.includes(".cache") || line.includes("internal") || line.includes("new Promise")
  1097. };
  1098. }).map((i) => `<span class="stack${i.internal ? " internal" : ""}">${i.text}</span>`).join("\n") : "";
  1099. const statusCode = Number(_error.statusCode || 500);
  1100. const is404 = statusCode === 404;
  1101. const statusMessage = _error.statusMessage ?? (is404 ? "Page Not Found" : "Internal Server Error");
  1102. const description = _error.message || _error.toString();
  1103. const stack = void 0;
  1104. const _Error404 = defineAsyncComponent(() => import("./_nuxt/error-404-Dj6KT2oP.js"));
  1105. const _Error = defineAsyncComponent(() => import("./_nuxt/error-500-B0Hn6rMk.js"));
  1106. const ErrorTemplate = is404 ? _Error404 : _Error;
  1107. return (_ctx, _push, _parent, _attrs) => {
  1108. _push(ssrRenderComponent(unref(ErrorTemplate), mergeProps({ statusCode: unref(statusCode), statusMessage: unref(statusMessage), description: unref(description), stack: unref(stack) }, _attrs), null, _parent));
  1109. };
  1110. }
  1111. };
  1112. const _sfc_setup$1 = _sfc_main$1.setup;
  1113. _sfc_main$1.setup = (props, ctx) => {
  1114. const ssrContext = useSSRContext();
  1115. (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("node_modules/nuxt/dist/app/components/nuxt-error-page.vue");
  1116. return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
  1117. };
  1118. const _sfc_main = {
  1119. __name: "nuxt-root",
  1120. __ssrInlineRender: true,
  1121. setup(__props) {
  1122. const IslandRenderer = () => null;
  1123. const nuxtApp = useNuxtApp();
  1124. nuxtApp.deferHydration();
  1125. nuxtApp.ssrContext.url;
  1126. const SingleRenderer = false;
  1127. provide(PageRouteSymbol, useRoute());
  1128. nuxtApp.hooks.callHookWith((hooks) => hooks.map((hook) => hook()), "vue:setup");
  1129. const error = useError();
  1130. const abortRender = error.value && !nuxtApp.ssrContext.error;
  1131. onErrorCaptured((err, target, info) => {
  1132. nuxtApp.hooks.callHook("vue:error", err, target, info).catch((hookError) => console.error("[nuxt] Error in `vue:error` hook", hookError));
  1133. {
  1134. const p = nuxtApp.runWithContext(() => showError(err));
  1135. onServerPrefetch(() => p);
  1136. return false;
  1137. }
  1138. });
  1139. const islandContext = nuxtApp.ssrContext.islandContext;
  1140. return (_ctx, _push, _parent, _attrs) => {
  1141. ssrRenderSuspense(_push, {
  1142. default: () => {
  1143. if (unref(abortRender)) {
  1144. _push(`<div></div>`);
  1145. } else if (unref(error)) {
  1146. _push(ssrRenderComponent(unref(_sfc_main$1), { error: unref(error) }, null, _parent));
  1147. } else if (unref(islandContext)) {
  1148. _push(ssrRenderComponent(unref(IslandRenderer), { context: unref(islandContext) }, null, _parent));
  1149. } else if (unref(SingleRenderer)) {
  1150. ssrRenderVNode(_push, createVNode(resolveDynamicComponent(unref(SingleRenderer)), null, null), _parent);
  1151. } else {
  1152. _push(ssrRenderComponent(unref(AppComponent), null, null, _parent));
  1153. }
  1154. },
  1155. _: 1
  1156. });
  1157. };
  1158. }
  1159. };
  1160. const _sfc_setup = _sfc_main.setup;
  1161. _sfc_main.setup = (props, ctx) => {
  1162. const ssrContext = useSSRContext();
  1163. (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("node_modules/nuxt/dist/app/components/nuxt-root.vue");
  1164. return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
  1165. };
  1166. let entry;
  1167. {
  1168. entry = async function createNuxtAppServer(ssrContext) {
  1169. const vueApp = createApp(_sfc_main);
  1170. const nuxt = createNuxtApp({ vueApp, ssrContext });
  1171. try {
  1172. await applyPlugins(nuxt, plugins);
  1173. await nuxt.hooks.callHook("app:created", vueApp);
  1174. } catch (error) {
  1175. await nuxt.hooks.callHook("app:error", error);
  1176. nuxt.payload.error = nuxt.payload.error || createError(error);
  1177. }
  1178. if (ssrContext == null ? void 0 : ssrContext._renderResponse) {
  1179. throw new Error("skipping render");
  1180. }
  1181. return vueApp;
  1182. };
  1183. }
  1184. const entry$1 = (ssrContext) => entry(ssrContext);
  1185. export {
  1186. _export_sfc as _,
  1187. navigateTo as a,
  1188. useNuxtApp as b,
  1189. useRuntimeConfig as c,
  1190. resolveUnrefHeadInput as d,
  1191. entry$1 as default,
  1192. injectHead as i,
  1193. nuxtLinkDefaults as n,
  1194. resolveRouteObject as r,
  1195. useRouter as u
  1196. };
  1197. //# sourceMappingURL=server.mjs.map