server.mjs 48 KB

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