feat: init

This commit is contained in:
2026-02-13 22:02:30 +01:00
commit 8f9ff830fb
16711 changed files with 3307340 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
fallbackTag: {
type: StringConstructor;
default: () => string;
};
fallback: {
type: StringConstructor;
default: () => string;
};
placeholder: {
type: StringConstructor;
};
placeholderTag: {
type: StringConstructor;
};
keepFallback: {
type: BooleanConstructor;
default: () => boolean;
};
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>[] | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "ssr-error"[], "ssr-error", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
fallbackTag: {
type: StringConstructor;
default: () => string;
};
fallback: {
type: StringConstructor;
default: () => string;
};
placeholder: {
type: StringConstructor;
};
placeholderTag: {
type: StringConstructor;
};
keepFallback: {
type: BooleanConstructor;
default: () => boolean;
};
}>> & Readonly<{
"onSsr-error"?: ((...args: any[]) => any) | undefined;
}>, {
fallback: string;
fallbackTag: string;
keepFallback: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

View File

@@ -0,0 +1,54 @@
import { createElementBlock, defineComponent, onMounted, shallowRef, useId } from "vue";
import { useState } from "../composables/state.js";
const VALID_TAG_RE = /^[a-z][a-z0-9-]*$/i;
function sanitizeTag(tag, fallback) {
return VALID_TAG_RE.test(tag) ? tag : fallback;
}
export default defineComponent({
name: "NuxtClientFallback",
inheritAttrs: false,
props: {
fallbackTag: {
type: String,
default: () => "div"
},
fallback: {
type: String,
default: () => ""
},
placeholder: {
type: String
},
placeholderTag: {
type: String
},
keepFallback: {
type: Boolean,
default: () => false
}
},
emits: ["ssr-error"],
setup(props, ctx) {
const mounted = shallowRef(false);
const ssrFailed = useState(useId());
if (ssrFailed.value) {
onMounted(() => {
mounted.value = true;
});
}
return () => {
if (ssrFailed.value) {
if (!mounted.value || props.keepFallback) {
const slot = ctx.slots.placeholder || ctx.slots.fallback;
if (slot) {
return slot();
}
const fallbackStr = props.placeholder || props.fallback;
const fallbackTag = sanitizeTag(props.placeholderTag || props.fallbackTag, "div");
return createElementBlock(fallbackTag, null, fallbackStr);
}
}
return ctx.slots.default?.();
};
}
});

View File

@@ -0,0 +1,57 @@
declare const NuxtClientFallbackServer: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
fallbackTag: {
type: StringConstructor;
default: () => string;
};
fallback: {
type: StringConstructor;
default: () => string;
};
placeholder: {
type: StringConstructor;
};
placeholderTag: {
type: StringConstructor;
};
keepFallback: {
type: BooleanConstructor;
default: () => boolean;
};
}>, {
ssrFailed: import("vue").ShallowRef<boolean, boolean>;
ssrVNodes: {
getBuffer(): import("./utils.js").SSRBuffer;
push(item: import("./utils.js").SSRBufferItem): void;
};
} | {
ssrFailed: boolean;
ssrVNodes: never[];
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
'ssr-error'(_error: unknown): true;
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
fallbackTag: {
type: StringConstructor;
default: () => string;
};
fallback: {
type: StringConstructor;
default: () => string;
};
placeholder: {
type: StringConstructor;
};
placeholderTag: {
type: StringConstructor;
};
keepFallback: {
type: BooleanConstructor;
default: () => boolean;
};
}>> & Readonly<{
"onSsr-error"?: ((_error: unknown) => any) | undefined;
}>, {
fallback: string;
fallbackTag: string;
keepFallback: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default NuxtClientFallbackServer;

View File

@@ -0,0 +1,84 @@
import { defineComponent, getCurrentInstance, onErrorCaptured, shallowRef, useId } from "vue";
import { ssrRenderAttrs, ssrRenderSlot, ssrRenderVNode } from "vue/server-renderer";
import { isPromise } from "@vue/shared";
import { useState } from "../composables/state.js";
import { createBuffer } from "./utils.js";
const VALID_TAG_RE = /^[a-z][a-z0-9-]*$/i;
function sanitizeTag(tag, fallback) {
return VALID_TAG_RE.test(tag) ? tag : fallback;
}
const NuxtClientFallbackServer = defineComponent({
name: "NuxtClientFallback",
inheritAttrs: false,
props: {
fallbackTag: {
type: String,
default: () => "div"
},
fallback: {
type: String,
default: () => ""
},
placeholder: {
type: String
},
placeholderTag: {
type: String
},
keepFallback: {
type: Boolean,
default: () => false
}
},
emits: {
"ssr-error"(_error) {
return true;
}
},
async setup(_, ctx) {
const vm = getCurrentInstance();
const ssrFailed = shallowRef(false);
const error = useState(useId());
onErrorCaptured((err) => {
error.value = true;
ssrFailed.value = true;
ctx.emit("ssr-error", err);
return false;
});
try {
const defaultSlot = ctx.slots.default?.();
const ssrVNodes = createBuffer();
if (defaultSlot) {
for (let i = 0; i < defaultSlot.length; i++) {
ssrRenderVNode(ssrVNodes.push, defaultSlot[i], vm);
}
}
const buffer = ssrVNodes.getBuffer();
if (buffer.hasAsync) {
await Promise.all(buffer.filter(isPromise));
}
return { ssrFailed, ssrVNodes };
} catch (ssrError) {
error.value = true;
ctx.emit("ssr-error", ssrError);
return { ssrFailed: true, ssrVNodes: [] };
}
},
ssrRender(ctx, push, parent) {
if (ctx.ssrFailed) {
const { fallback, placeholder } = ctx.$slots;
if (fallback || placeholder) {
ssrRenderSlot(ctx.$slots, fallback ? "fallback" : "placeholder", {}, null, push, parent);
} else {
const content = ctx.placeholder || ctx.fallback;
const tag = sanitizeTag(ctx.placeholderTag || ctx.fallbackTag, "div");
push(`<${tag}${ssrRenderAttrs(ctx.$attrs)}>${content}</${tag}>`);
}
} else {
push("<!--[-->");
push(ctx.ssrVNodes.getBuffer());
push("<!--]-->");
}
}
});
export default NuxtClientFallbackServer;

26
node_modules/nuxt/dist/app/components/client-only.d.ts generated vendored Normal file
View File

@@ -0,0 +1,26 @@
import type { ComponentOptions, InjectionKey, SlotsType, VNode } from 'vue';
export declare const clientOnlySymbol: InjectionKey<boolean>;
declare const _default: import("vue").DefineComponent<{
placeholder?: any;
fallback?: any;
placeholderTag?: any;
fallbackTag?: any;
}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}> | VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>[] | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
placeholder?: any;
fallback?: any;
placeholderTag?: any;
fallbackTag?: any;
}> & Readonly<{}>, {}, SlotsType<{
default?: () => VNode[];
/**
* Specify a content to be rendered on the server and displayed until `<ClientOnly>` is mounted in the browser.
*/
fallback?: () => VNode[];
placeholder?: () => VNode[];
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;
export declare function createClientOnly<T extends ComponentOptions>(component: T): any;

130
node_modules/nuxt/dist/app/components/client-only.js generated vendored Normal file
View File

@@ -0,0 +1,130 @@
import { cloneVNode, createElementBlock, defineComponent, getCurrentInstance, h, onMounted, provide, shallowRef } from "vue";
import { isPromise } from "@vue/shared";
import { useNuxtApp } from "../nuxt.js";
import ServerPlaceholder from "./server-placeholder.js";
import { elToStaticVNode } from "./utils.js";
export const clientOnlySymbol = Symbol.for("nuxt:client-only");
const STATIC_DIV = "<div></div>";
export default defineComponent({
name: "ClientOnly",
inheritAttrs: false,
props: ["fallback", "placeholder", "placeholderTag", "fallbackTag"],
...import.meta.dev && {
slots: Object
},
setup(props, { slots, attrs }) {
const mounted = shallowRef(false);
onMounted(() => {
mounted.value = true;
});
if (import.meta.dev) {
const nuxtApp = useNuxtApp();
nuxtApp._isNuxtPageUsed = true;
nuxtApp._isNuxtLayoutUsed = true;
}
const vm = getCurrentInstance();
if (vm) {
vm._nuxtClientOnly = true;
}
provide(clientOnlySymbol, true);
return () => {
if (mounted.value) {
const vnodes = slots.default?.();
if (vnodes && vnodes.length === 1) {
return [cloneVNode(vnodes[0], attrs)];
}
return vnodes;
}
const slot = slots.fallback || slots.placeholder;
if (slot) {
return h(slot);
}
const fallbackStr = props.fallback || props.placeholder || "";
const fallbackTag = props.fallbackTag || props.placeholderTag || "span";
return createElementBlock(fallbackTag, attrs, fallbackStr);
};
}
});
const cache = /* @__PURE__ */ new WeakMap();
// @__NO_SIDE_EFFECTS__
export function createClientOnly(component) {
if (import.meta.server) {
return ServerPlaceholder;
}
if (cache.has(component)) {
return cache.get(component);
}
const clone = { ...component };
if (clone.render) {
clone.render = (ctx, cache2, $props, $setup, $data, $options) => {
if ($setup.mounted$ ?? ctx.mounted$) {
const res = component.render?.bind(ctx)(ctx, cache2, $props, $setup, $data, $options);
return res.children === null || typeof res.children === "string" ? cloneVNode(res) : h(res);
}
return elToStaticVNode(ctx._.vnode.el, STATIC_DIV);
};
} else {
clone.template &&= `
<template v-if="mounted$">${component.template}</template>
<template v-else>${STATIC_DIV}</template>
`;
}
clone.setup = (props, ctx) => {
const nuxtApp = useNuxtApp();
const mounted$ = shallowRef(nuxtApp.isHydrating === false);
const instance = getCurrentInstance();
if (nuxtApp.isHydrating) {
const attrs = { ...instance.attrs };
const directives = extractDirectives(instance);
for (const key in attrs) {
delete instance.attrs[key];
}
onMounted(() => {
Object.assign(instance.attrs, attrs);
instance.vnode.dirs = directives;
});
}
onMounted(() => {
mounted$.value = true;
});
const setupState = component.setup?.(props, ctx) || {};
if (isPromise(setupState)) {
return Promise.resolve(setupState).then((setupState2) => {
if (typeof setupState2 !== "function") {
setupState2 ||= {};
setupState2.mounted$ = mounted$;
return setupState2;
}
return (...args) => {
if (mounted$.value || !nuxtApp.isHydrating) {
const res = setupState2(...args);
return res.children === null || typeof res.children === "string" ? cloneVNode(res) : h(res);
}
return elToStaticVNode(instance?.vnode.el, STATIC_DIV);
};
});
} else {
if (typeof setupState === "function") {
return (...args) => {
if (mounted$.value) {
const res = setupState(...args);
const attrs = clone.inheritAttrs !== false ? ctx.attrs : void 0;
return res.children === null || typeof res.children === "string" ? cloneVNode(res, attrs) : h(res, attrs);
}
return elToStaticVNode(instance?.vnode.el, STATIC_DIV);
};
}
return Object.assign(setupState, { mounted$ });
}
};
cache.set(component, clone);
return clone;
}
function extractDirectives(instance) {
if (!instance || !instance.vnode.dirs) {
return null;
}
const directives = instance.vnode.dirs;
instance.vnode.dirs = null;
return directives;
}

11
node_modules/nuxt/dist/app/components/dev-only.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
import type { SlotsType, VNode } from 'vue';
declare const _default: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>[] | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, SlotsType<{
default?: () => VNode[];
/**
* If you ever require to have a replacement during production.
*/
fallback?: () => VNode[];
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

14
node_modules/nuxt/dist/app/components/dev-only.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
import { defineComponent } from "vue";
export default defineComponent({
name: "DevOnly",
inheritAttrs: false,
...import.meta.dev && {
slots: Object
},
setup(_, props) {
if (import.meta.dev) {
return () => props.slots.default?.();
}
return () => props.slots.fallback?.();
}
});

View File

@@ -0,0 +1,51 @@
declare const _default: typeof __VLS_export;
export default _default;
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
appName: {
type: StringConstructor;
default: string;
};
status: {
type: NumberConstructor;
default: number;
};
statusText: {
type: StringConstructor;
default: string;
};
description: {
type: StringConstructor;
default: string;
};
backHome: {
type: StringConstructor;
default: string;
};
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
appName: {
type: StringConstructor;
default: string;
};
status: {
type: NumberConstructor;
default: number;
};
statusText: {
type: StringConstructor;
default: string;
};
description: {
type: StringConstructor;
default: string;
};
backHome: {
type: StringConstructor;
default: string;
};
}>> & Readonly<{}>, {
appName: string;
status: number;
statusText: string;
description: string;
backHome: string;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;

48
node_modules/nuxt/dist/app/components/error-404.vue generated vendored Normal file
View File

@@ -0,0 +1,48 @@
<script setup>
import { useHead } from "#imports";
const props = defineProps({
appName: {
type: String,
default: "Nuxt"
},
status: {
type: Number,
default: 404
},
statusText: {
type: String,
default: "Page not found"
},
description: {
type: String,
default: "Sorry, the page you are looking for could not be found."
},
backHome: {
type: String,
default: "Go back home"
}
});
useHead({
title: `${props.status} - ${props.statusText} | ${props.appName}`,
script: [
{
innerHTML: `!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`
}
],
style: [
{
innerHTML: `*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }`
}
]
});
</script>
<template>
<div class="antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide"><div class="max-w-520px text-center"><h1 class="font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]" v-text="status" /><h2 class="font-semibold mb-2 sm:text-3xl text-2xl" v-text="statusText" /><p class="mb-4 px-2 text-[#64748B] text-md" v-text="description" /><div class="flex items-center justify-center w-full"><NuxtLink to="/" class="font-medium hover:text-[#00DC82] text-sm underline underline-offset-3">
{{ backHome }}
</NuxtLink></div></div></div>
</template>
<style scoped>
.grid{display:grid}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.max-w-520px{max-width:520px}.min-h-screen{min-height:100vh}.w-full{width:100%}.flex{display:flex}.place-content-center{place-content:center}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-hidden{overflow:hidden}.bg-white{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-2{padding-left:.5rem;padding-right:.5rem}.text-center{text-align:center}.text-\[80px\]{font-size:80px}.text-2xl{font-size:1.5rem;line-height:2rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-\[\#020420\]{--un-text-opacity:1;color:rgb(2 4 32/var(--un-text-opacity))}.text-\[\#64748B\]{--un-text-opacity:1;color:rgb(100 116 139/var(--un-text-opacity))}.hover\:text-\[\#00DC82\]:hover{--un-text-opacity:1;color:rgb(0 220 130/var(--un-text-opacity))}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-none{line-height:1}.tracking-wide{letter-spacing:.025em}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.tabular-nums{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)}.underline{text-decoration-line:underline}.underline-offset-3{text-underline-offset:3px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(prefers-color-scheme:dark){.dark\:bg-\[\#020420\]{--un-bg-opacity:1;background-color:rgb(2 4 32/var(--un-bg-opacity))}.dark\:text-white{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media(min-width:640px){.sm\:text-\[110px\]{font-size:110px}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}}
</style>

View File

@@ -0,0 +1,51 @@
declare const _default: typeof __VLS_export;
export default _default;
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
appName: {
type: StringConstructor;
default: string;
};
status: {
type: NumberConstructor;
default: number;
};
statusText: {
type: StringConstructor;
default: string;
};
description: {
type: StringConstructor;
default: string;
};
backHome: {
type: StringConstructor;
default: string;
};
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
appName: {
type: StringConstructor;
default: string;
};
status: {
type: NumberConstructor;
default: number;
};
statusText: {
type: StringConstructor;
default: string;
};
description: {
type: StringConstructor;
default: string;
};
backHome: {
type: StringConstructor;
default: string;
};
}>> & Readonly<{}>, {
appName: string;
status: number;
statusText: string;
description: string;
backHome: string;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;

View File

@@ -0,0 +1,51 @@
declare const _default: typeof __VLS_export;
export default _default;
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
appName: {
type: StringConstructor;
default: string;
};
status: {
type: NumberConstructor;
default: number;
};
statusText: {
type: StringConstructor;
default: string;
};
description: {
type: StringConstructor;
default: string;
};
refresh: {
type: StringConstructor;
default: string;
};
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
appName: {
type: StringConstructor;
default: string;
};
status: {
type: NumberConstructor;
default: number;
};
statusText: {
type: StringConstructor;
default: string;
};
description: {
type: StringConstructor;
default: string;
};
refresh: {
type: StringConstructor;
default: string;
};
}>> & Readonly<{}>, {
appName: string;
status: number;
statusText: string;
description: string;
refresh: string;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;

46
node_modules/nuxt/dist/app/components/error-500.vue generated vendored Normal file
View File

@@ -0,0 +1,46 @@
<script setup>
import { useHead } from "#imports";
const props = defineProps({
appName: {
type: String,
default: "Nuxt"
},
status: {
type: Number,
default: 500
},
statusText: {
type: String,
default: "Internal server error"
},
description: {
type: String,
default: "This page is temporarily unavailable."
},
refresh: {
type: String,
default: "Refresh this page"
}
});
useHead({
title: `${props.status} - ${props.statusText} | ${props.appName}`,
script: [
{
innerHTML: `!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`
}
],
style: [
{
innerHTML: `*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }`
}
]
});
</script>
<template>
<div class="antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide"><div class="max-w-520px text-center"><h1 class="font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]" v-text="status" /><h2 class="font-semibold mb-2 sm:text-3xl text-2xl" v-text="statusText" /><p class="mb-4 px-2 text-[#64748B] text-md" v-text="description" /></div></div>
</template>
<style scoped>
.grid{display:grid}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.max-w-520px{max-width:520px}.min-h-screen{min-height:100vh}.place-content-center{place-content:center}.overflow-hidden{overflow:hidden}.bg-white{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-2{padding-left:.5rem;padding-right:.5rem}.text-center{text-align:center}.text-\[80px\]{font-size:80px}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[\#020420\]{--un-text-opacity:1;color:rgb(2 4 32/var(--un-text-opacity))}.text-\[\#64748B\]{--un-text-opacity:1;color:rgb(100 116 139/var(--un-text-opacity))}.font-semibold{font-weight:600}.leading-none{line-height:1}.tracking-wide{letter-spacing:.025em}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.tabular-nums{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(prefers-color-scheme:dark){.dark\:bg-\[\#020420\]{--un-bg-opacity:1;background-color:rgb(2 4 32/var(--un-bg-opacity))}.dark\:text-white{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media(min-width:640px){.sm\:text-\[110px\]{font-size:110px}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}}
</style>

View File

@@ -0,0 +1,51 @@
declare const _default: typeof __VLS_export;
export default _default;
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
appName: {
type: StringConstructor;
default: string;
};
status: {
type: NumberConstructor;
default: number;
};
statusText: {
type: StringConstructor;
default: string;
};
description: {
type: StringConstructor;
default: string;
};
refresh: {
type: StringConstructor;
default: string;
};
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
appName: {
type: StringConstructor;
default: string;
};
status: {
type: NumberConstructor;
default: number;
};
statusText: {
type: StringConstructor;
default: string;
};
description: {
type: StringConstructor;
default: string;
};
refresh: {
type: StringConstructor;
default: string;
};
}>> & Readonly<{}>, {
appName: string;
status: number;
statusText: string;
description: string;
refresh: string;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;

3
node_modules/nuxt/dist/app/components/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export { defineNuxtLink } from './nuxt-link.js';
export type { NuxtLinkOptions, NuxtLinkProps } from './nuxt-link.js';
export type { NuxtTimeProps } from './nuxt-time.vue.js';

1
node_modules/nuxt/dist/app/components/index.js generated vendored Normal file
View File

@@ -0,0 +1 @@
export { defineNuxtLink } from "./nuxt-link.js";

View File

@@ -0,0 +1,7 @@
import type { InjectionKey } from 'vue';
import type { RouteLocationNormalizedLoaded } from 'vue-router';
export interface LayoutMeta {
isCurrent: (route: RouteLocationNormalizedLoaded) => boolean;
}
export declare const LayoutMetaSymbol: InjectionKey<LayoutMeta>;
export declare const PageRouteSymbol: InjectionKey<RouteLocationNormalizedLoaded>;

2
node_modules/nuxt/dist/app/components/injections.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export const LayoutMetaSymbol = Symbol("layout-meta");
export const PageRouteSymbol = Symbol("route");

View File

@@ -0,0 +1,20 @@
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
context: {
type: () => {
name: string;
props?: Record<string, any>;
};
required: true;
};
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
context: {
type: () => {
name: string;
props?: Record<string, any>;
};
required: true;
};
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

View File

@@ -0,0 +1,28 @@
import { createVNode, defineComponent, onErrorCaptured } from "vue";
import { injectHead } from "../composables/head.js";
import { createError } from "../composables/error.js";
import { islandComponents } from "#build/components.islands.mjs";
export default defineComponent({
name: "IslandRenderer",
props: {
context: {
type: Object,
required: true
}
},
setup(props) {
const head = injectHead();
head.entries.clear();
const component = islandComponents[props.context.name];
if (!component) {
throw createError({
status: 404,
statusText: `Island component not found: ${props.context.name}`
});
}
onErrorCaptured((e) => {
console.log(e);
});
return () => createVNode(component || "span", { ...props.context.props, "data-island-uid": "" });
}
});

View File

@@ -0,0 +1,24 @@
type __VLS_Slots = {
error(props: {
error: Error;
clearError: () => void;
}): any;
default(): any;
};
declare function clearError(): void;
declare const __VLS_base: import("vue").DefineComponent<{}, {
error: import("vue").ShallowRef<Error | null, Error | null>;
clearError: typeof clearError;
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
error: (error: Error) => any;
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
onError?: ((error: Error) => any) | undefined;
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
declare const _default: typeof __VLS_export;
export default _default;
type __VLS_WithSlots<T, S> = T & {
new (): {
$slots: S;
};
};

View File

@@ -0,0 +1,46 @@
<template>
<slot
v-if="error"
v-bind="{ error, clearError }"
name="error"
/>
<slot
v-else
name="default"
/>
</template>
<script setup>
import { onErrorCaptured, shallowRef } from "vue";
import { useNuxtApp } from "../nuxt";
import { onNuxtReady } from "../composables/ready";
defineOptions({
name: "NuxtErrorBoundary",
inheritAttrs: false
});
const emit = defineEmits(["error"]);
defineSlots();
const error = shallowRef(null);
function clearError() {
error.value = null;
}
if (import.meta.client) {
let handleError = function(...args) {
const [err, instance, info] = args;
emit("error", err);
nuxtApp.hooks.callHook("vue:error", err, instance, info);
error.value = err;
};
const nuxtApp = useNuxtApp();
onErrorCaptured((err, instance, info) => {
if (!nuxtApp.isHydrating) {
handleError(err, instance, info);
} else {
onNuxtReady(() => handleError(err, instance, info));
}
return false;
});
}
defineExpose({ error, clearError });
</script>

View File

@@ -0,0 +1,24 @@
type __VLS_Slots = {
error(props: {
error: Error;
clearError: () => void;
}): any;
default(): any;
};
declare function clearError(): void;
declare const __VLS_base: import("vue").DefineComponent<{}, {
error: import("vue").ShallowRef<Error | null, Error | null>;
clearError: typeof clearError;
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
error: (error: Error) => any;
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
onError?: ((error: Error) => any) | undefined;
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
declare const _default: typeof __VLS_export;
export default _default;
type __VLS_WithSlots<T, S> = T & {
new (): {
$slots: S;
};
};

View File

@@ -0,0 +1,7 @@
declare const _default: typeof __VLS_export;
export default _default;
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
error: ObjectConstructor;
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
error: ObjectConstructor;
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;

View File

@@ -0,0 +1,27 @@
<template>
<ErrorTemplate v-bind="{ status, statusText, statusCode: status, statusMessage: statusText, description, stack }" />
</template>
<script setup>
import { defineAsyncComponent } from "vue";
import { escapeHtml } from "@vue/shared";
const props = defineProps({
error: Object
});
const _error = props.error;
const stacktrace = import.meta.dev && _error.stack ? _error.stack.split("\n").splice(1).map((line) => {
const text = line.replace("webpack:/", "").replace(".vue", ".js").trim();
return {
text,
internal: line.includes("node_modules") && !line.includes(".cache") || line.includes("internal") || line.includes("new Promise")
};
}).map((i) => `<span class="stack${i.internal ? " internal" : ""}">${escapeHtml(i.text)}</span>`).join("\n") : "";
const status = Number(_error.statusCode || 500);
const is404 = status === 404;
const statusText = _error.statusMessage ?? (is404 ? "Page Not Found" : "Internal Server Error");
const description = _error.message || _error.toString();
const stack = import.meta.dev && !is404 ? _error.description || `<pre>${stacktrace}</pre>` : void 0;
const _Error404 = defineAsyncComponent(() => import("./error-404.vue"));
const _Error = defineAsyncComponent(() => import("./error-500.vue"));
const ErrorTemplate = is404 ? _Error404 : _Error;
</script>

View File

@@ -0,0 +1,7 @@
declare const _default: typeof __VLS_export;
export default _default;
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
error: ObjectConstructor;
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
error: ObjectConstructor;
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;

70
node_modules/nuxt/dist/app/components/nuxt-island.d.ts generated vendored Normal file
View File

@@ -0,0 +1,70 @@
import type { PropType, RendererNode, VNode } from 'vue';
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
name: {
type: StringConstructor;
required: true;
};
lazy: BooleanConstructor;
props: {
type: ObjectConstructor;
default: () => undefined;
};
context: {
type: ObjectConstructor;
default: () => {};
};
scopeId: {
type: PropType<string | undefined | null>;
default: () => undefined;
};
source: {
type: StringConstructor;
default: () => undefined;
};
dangerouslyLoadClientComponents: {
type: BooleanConstructor;
default: boolean;
};
}>, (_ctx: any, _cache: any) => (VNode<RendererNode, import("vue").RendererElement, {
[key: string]: any;
}> | VNode<RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>[])[] | VNode<any, any, {
[key: string]: any;
}>[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "error"[], "error", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
name: {
type: StringConstructor;
required: true;
};
lazy: BooleanConstructor;
props: {
type: ObjectConstructor;
default: () => undefined;
};
context: {
type: ObjectConstructor;
default: () => {};
};
scopeId: {
type: PropType<string | undefined | null>;
default: () => undefined;
};
source: {
type: StringConstructor;
default: () => undefined;
};
dangerouslyLoadClientComponents: {
type: BooleanConstructor;
default: boolean;
};
}>> & Readonly<{
onError?: ((...args: any[]) => any) | undefined;
}>, {
props: Record<string, any>;
source: string;
scopeId: string | null | undefined;
lazy: boolean;
context: Record<string, any>;
dangerouslyLoadClientComponents: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

331
node_modules/nuxt/dist/app/components/nuxt-island.js generated vendored Normal file
View File

@@ -0,0 +1,331 @@
import { Fragment, Teleport, computed, createStaticVNode, createVNode, defineComponent, getCurrentInstance, h, nextTick, onBeforeUnmount, onMounted, ref, shallowRef, toRaw, watch, withMemo } from "vue";
import { debounce } from "perfect-debounce";
import { hash } from "ohash";
import { appendResponseHeader } from "h3";
import { randomUUID } from "uncrypto";
import { joinURL, withQuery } from "ufo";
import { useNuxtApp, useRuntimeConfig } from "../nuxt.js";
import { createError } from "../composables/error.js";
import { prerenderRoutes, useRequestEvent } from "../composables/ssr.js";
import { injectHead } from "../composables/head.js";
import { getFragmentHTML, isEndFragment, isStartFragment } from "./utils.js";
import { appBaseURL, remoteComponentIslands, selectiveClient } from "#build/nuxt.config.mjs";
const pKey = "_islandPromises";
const SSR_UID_RE = /data-island-uid="([^"]*)"/;
const DATA_ISLAND_UID_RE = /data-island-uid(="")?(?!="[^"])/g;
const SLOTNAME_RE = /data-island-slot="([^"]*)"/g;
const SLOT_FALLBACK_RE = / data-island-slot="([^"]*)"[^>]*>/g;
const ISLAND_SCOPE_ID_RE = /^<[^> ]*/;
let id = 1;
const getId = import.meta.client ? () => (id++).toString() : randomUUID;
const components = import.meta.client ? /* @__PURE__ */ new Map() : void 0;
async function loadComponents(source = appBaseURL, paths) {
if (!paths) {
return;
}
const promises = [];
for (const [component, item] of Object.entries(paths)) {
if (!components.has(component)) {
promises.push((async () => {
const chunkSource = joinURL(source, item.chunk);
const c = await import(
/* @vite-ignore */
chunkSource
).then((m) => m.default || m);
components.set(component, c);
})());
}
}
await Promise.all(promises);
}
export default defineComponent({
name: "NuxtIsland",
inheritAttrs: false,
props: {
name: {
type: String,
required: true
},
lazy: Boolean,
props: {
type: Object,
default: () => void 0
},
context: {
type: Object,
default: () => ({})
},
scopeId: {
type: String,
default: () => void 0
},
source: {
type: String,
default: () => void 0
},
dangerouslyLoadClientComponents: {
type: Boolean,
default: false
}
},
emits: ["error"],
async setup(props, { slots, expose, emit }) {
let canTeleport = import.meta.server;
const teleportKey = shallowRef(0);
const key = shallowRef(0);
const canLoadClientComponent = computed(() => selectiveClient && (props.dangerouslyLoadClientComponents || !props.source));
const error = ref(null);
const config = useRuntimeConfig();
const nuxtApp = useNuxtApp();
const filteredProps = computed(() => props.props ? Object.fromEntries(Object.entries(props.props).filter(([key2]) => !key2.startsWith("data-v-"))) : {});
const hashId = computed(() => hash([props.name, filteredProps.value, props.context, props.source]).replace(/[-_]/g, ""));
const instance = getCurrentInstance();
const event = useRequestEvent();
let activeHead;
const eventFetch = import.meta.server ? event.fetch : globalThis.fetch;
const mounted = shallowRef(false);
onMounted(() => {
mounted.value = true;
teleportKey.value++;
});
onBeforeUnmount(() => {
if (activeHead) {
activeHead.dispose();
}
});
function setPayload(key2, result) {
const toRevive = {};
if (result.props) {
toRevive.props = result.props;
}
if (result.slots) {
toRevive.slots = result.slots;
}
if (result.components) {
toRevive.components = result.components;
}
if (result.head) {
toRevive.head = result.head;
}
nuxtApp.payload.data[key2] = {
__nuxt_island: {
key: key2,
...import.meta.server && import.meta.prerender ? {} : { params: { ...props.context, props: props.props ? JSON.stringify(props.props) : void 0 } },
result: toRevive
},
...result
};
}
const payloads = {};
if (instance.vnode.el) {
const slots2 = toRaw(nuxtApp.payload.data[`${props.name}_${hashId.value}`])?.slots;
if (slots2) {
payloads.slots = slots2;
}
if (selectiveClient) {
const components2 = toRaw(nuxtApp.payload.data[`${props.name}_${hashId.value}`])?.components;
if (components2) {
payloads.components = components2;
}
}
}
const ssrHTML = ref("");
if (import.meta.client && instance.vnode?.el) {
if (import.meta.dev) {
let currentEl = instance.vnode.el;
let startEl = null;
let isFirstElement = true;
while (currentEl) {
if (isEndFragment(currentEl)) {
if (startEl !== currentEl.previousSibling) {
console.warn(`[\`Server components(and islands)\`] "${props.name}" must have a single root element. (HTML comments are considered elements as well.)`);
}
break;
} else if (!isStartFragment(currentEl) && isFirstElement) {
isFirstElement = false;
if (currentEl.nodeType === 1) {
startEl = currentEl;
}
}
currentEl = currentEl.nextSibling;
}
}
ssrHTML.value = getFragmentHTML(instance.vnode.el, true)?.join("") || "";
const key2 = `${props.name}_${hashId.value}`;
nuxtApp.payload.data[key2] ||= {};
nuxtApp.payload.data[key2].html = ssrHTML.value.replaceAll(new RegExp(`data-island-uid="${ssrHTML.value.match(SSR_UID_RE)?.[1] || ""}"`, "g"), `data-island-uid=""`);
}
const uid = ref(ssrHTML.value.match(SSR_UID_RE)?.[1] || getId());
const currentSlots = new Set(Object.keys(slots));
const availableSlots = computed(() => new Set([...ssrHTML.value.matchAll(SLOTNAME_RE)].map((m) => m[1])));
const html = computed(() => {
let html2 = ssrHTML.value;
if (props.scopeId) {
html2 = html2.replace(ISLAND_SCOPE_ID_RE, (full) => full + " " + props.scopeId);
}
if (import.meta.client && !canLoadClientComponent.value) {
for (const [key2, value] of Object.entries(payloads.components || {})) {
html2 = html2.replace(new RegExp(` data-island-uid="${uid.value}" data-island-component="${key2}"[^>]*>`), (full) => {
return full + value.html;
});
}
}
if (payloads.slots) {
return html2.replaceAll(SLOT_FALLBACK_RE, (full, slotName) => {
if (!currentSlots.has(slotName)) {
return full + (payloads.slots?.[slotName]?.fallback || "");
}
return full;
});
}
return html2;
});
const head = injectHead();
async function _fetchComponent(force = false) {
const key2 = `${props.name}_${hashId.value}`;
if (!force && nuxtApp.payload.data[key2]?.html) {
return nuxtApp.payload.data[key2];
}
const url = remoteComponentIslands && props.source ? joinURL(props.source, `/__nuxt_island/${key2}.json`) : `/__nuxt_island/${key2}.json`;
if (import.meta.server && import.meta.prerender) {
nuxtApp.runWithContext(() => prerenderRoutes(url));
}
const r = await eventFetch(withQuery(import.meta.dev && import.meta.client || props.source ? url : joinURL(config.app.baseURL ?? "", url), {
...props.context,
props: props.props ? JSON.stringify(props.props) : void 0
}));
if (!r.ok) {
throw createError({ status: r.status, statusText: r.statusText });
}
try {
const result = await r.json();
if (import.meta.server && import.meta.prerender) {
const hints = r.headers.get("x-nitro-prerender");
if (hints) {
appendResponseHeader(event, "x-nitro-prerender", hints);
}
}
setPayload(key2, result);
return result;
} catch (e) {
if (r.status !== 200) {
throw new Error(e.toString(), { cause: r });
}
throw e;
}
}
async function fetchComponent(force = false) {
nuxtApp[pKey] ||= {};
nuxtApp[pKey][uid.value] ||= _fetchComponent(force).finally(() => {
delete nuxtApp[pKey][uid.value];
});
try {
const res = await nuxtApp[pKey][uid.value];
ssrHTML.value = res.html.replaceAll(DATA_ISLAND_UID_RE, `data-island-uid="${uid.value}"`);
key.value++;
error.value = null;
payloads.slots = res.slots || {};
payloads.components = res.components || {};
if (selectiveClient && import.meta.client) {
if (canLoadClientComponent.value && res.components) {
await loadComponents(props.source, res.components);
}
}
if (res?.head) {
if (activeHead) {
activeHead.patch(res.head);
} else {
activeHead = head.push(res.head);
}
}
if (import.meta.client) {
nextTick(() => {
canTeleport = true;
teleportKey.value++;
});
}
} catch (e) {
error.value = e;
emit("error", e);
}
}
expose({
refresh: () => fetchComponent(true)
});
if (import.meta.hot) {
import.meta.hot.on(`nuxt-server-component:${props.name}`, () => {
fetchComponent(true);
});
}
if (import.meta.client) {
watch(props, debounce(() => fetchComponent(), 100), { deep: true });
}
if (import.meta.client && !instance.vnode.el && props.lazy) {
fetchComponent();
} else if (import.meta.server || !instance.vnode.el || !nuxtApp.payload.serverRendered) {
await fetchComponent();
} else if (selectiveClient && canLoadClientComponent.value) {
await loadComponents(props.source, payloads.components);
}
return (_ctx, _cache) => {
if (!html.value || error.value) {
return [slots.fallback?.({ error: error.value }) ?? createVNode("div")];
}
return [
withMemo([key.value], () => {
return createVNode(Fragment, { key: key.value }, [h(createStaticVNode(html.value || "<div></div>", 1))]);
}, _cache, 0),
// should away be triggered ONE tick after re-rendering the static node
withMemo([teleportKey.value], () => {
const teleports = [];
const isKeyOdd = teleportKey.value === 0 || !!(teleportKey.value && !(teleportKey.value % 2));
if (uid.value && html.value && (import.meta.server || props.lazy ? canTeleport : mounted.value || instance.vnode?.el)) {
for (const slot in slots) {
if (availableSlots.value.has(slot)) {
teleports.push(
createVNode(
Teleport,
// use different selectors for even and odd teleportKey to force trigger the teleport
{ to: import.meta.client ? `${isKeyOdd ? "div" : ""}[data-island-uid="${uid.value}"][data-island-slot="${slot}"]` : `uid=${uid.value};slot=${slot}` },
{ default: () => (payloads.slots?.[slot]?.props?.length ? payloads.slots[slot].props : [{}]).map((data) => slots[slot]?.(data)) }
)
);
}
}
if (selectiveClient) {
if (import.meta.server) {
if (payloads.components) {
for (const [id2, info] of Object.entries(payloads.components)) {
const { html: html2, slots: slots2 } = info;
let replaced = html2.replaceAll("data-island-uid", `data-island-uid="${uid.value}"`);
for (const slot in slots2) {
replaced = replaced.replaceAll(`data-island-slot="${slot}">`, (full) => full + slots2[slot]);
}
teleports.push(createVNode(Teleport, { to: `uid=${uid.value};client=${id2}` }, {
default: () => [createStaticVNode(replaced, 1)]
}));
}
}
} else if (canLoadClientComponent.value && payloads.components) {
for (const [id2, info] of Object.entries(payloads.components)) {
const { props: props2, slots: slots2 } = info;
const component = components.get(id2);
const vnode = createVNode(Teleport, { to: `${isKeyOdd ? "div" : ""}[data-island-uid='${uid.value}'][data-island-component="${id2}"]` }, {
default: () => {
return [h(component, props2, Object.fromEntries(Object.entries(slots2 || {}).map(([k, v]) => [
k,
() => createStaticVNode(`<div style="display: contents" data-island-uid data-island-slot="${k}">${v}</div>`, 1)
])))];
}
});
teleports.push(vnode);
}
}
}
}
return h(Fragment, teleports);
}, _cache, 1)
];
};
}
});

14
node_modules/nuxt/dist/app/components/nuxt-layout.d.ts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
import type { DefineComponent, ExtractPublicPropTypes, MaybeRef, PropType } from 'vue';
import type { PageMeta } from '../../pages/runtime/composables.js';
declare const nuxtLayoutProps: {
name: {
type: PropType<unknown extends PageMeta["layout"] ? MaybeRef<string | false> : PageMeta["layout"]>;
default: null;
};
fallback: {
type: PropType<unknown extends PageMeta["layout"] ? MaybeRef<string> : PageMeta["layout"]>;
default: null;
};
};
declare const _default: DefineComponent<ExtractPublicPropTypes<typeof nuxtLayoutProps>>;
export default _default;

174
node_modules/nuxt/dist/app/components/nuxt-layout.js generated vendored Normal file
View File

@@ -0,0 +1,174 @@
import { Suspense, computed, defineComponent, h, inject, mergeProps, nextTick, onMounted, provide, shallowReactive, shallowRef, unref } from "vue";
import { useRoute, useRouter } from "../composables/router.js";
import { useNuxtApp } from "../nuxt.js";
import { _wrapInTransition } from "./utils.js";
import { LayoutMetaSymbol, PageRouteSymbol } from "./injections.js";
import { useRoute as useVueRouterRoute } from "#build/pages";
import layouts from "#build/layouts";
import { appLayoutTransition as defaultLayoutTransition } from "#build/nuxt.config.mjs";
import _routeRulesMatcher from "#build/route-rules.mjs";
const routeRulesMatcher = _routeRulesMatcher;
const LayoutLoader = defineComponent({
name: "LayoutLoader",
inheritAttrs: false,
props: {
name: String,
layoutProps: Object
},
setup(props, context) {
return () => h(layouts[props.name], props.layoutProps, context.slots);
}
});
const nuxtLayoutProps = {
name: {
type: [String, Boolean, Object],
default: null
},
fallback: {
type: [String, Object],
default: null
}
};
export default defineComponent({
name: "NuxtLayout",
inheritAttrs: false,
props: nuxtLayoutProps,
setup(props, context) {
const nuxtApp = useNuxtApp();
const injectedRoute = inject(PageRouteSymbol);
const shouldUseEagerRoute = !injectedRoute || injectedRoute === useRoute();
const route = shouldUseEagerRoute ? useVueRouterRoute() : injectedRoute;
const layout = computed(() => {
let layout2 = unref(props.name) ?? route?.meta.layout ?? routeRulesMatcher(route?.path).appLayout ?? "default";
if (layout2 && !(layout2 in layouts)) {
if (import.meta.dev && layout2 !== "default") {
console.warn(`Invalid layout \`${layout2}\` selected.`);
}
if (props.fallback) {
layout2 = unref(props.fallback);
}
}
return layout2;
});
const layoutRef = shallowRef();
context.expose({ layoutRef });
const done = nuxtApp.deferHydration();
if (import.meta.client && nuxtApp.isHydrating) {
const removeErrorHook = nuxtApp.hooks.hookOnce("app:error", done);
useRouter().beforeEach(removeErrorHook);
}
if (import.meta.dev) {
nuxtApp._isNuxtLayoutUsed = true;
}
let lastLayout;
return () => {
const hasLayout = layout.value && layout.value in layouts;
const transitionProps = route?.meta.layoutTransition ?? defaultLayoutTransition;
const previouslyRenderedLayout = lastLayout;
lastLayout = layout.value;
return _wrapInTransition(hasLayout && transitionProps, {
default: () => h(Suspense, { suspensible: true, onResolve: () => {
nextTick(done);
} }, {
default: () => h(
LayoutProvider,
{
layoutProps: mergeProps(context.attrs, route.meta.layoutProps ?? {}, { ref: layoutRef }),
key: layout.value || void 0,
name: layout.value,
shouldProvide: !props.name,
isRenderingNewLayout: (name) => {
return name !== previouslyRenderedLayout && name === layout.value;
},
hasTransition: !!transitionProps
},
context.slots
)
})
}).default();
};
}
});
const LayoutProvider = defineComponent({
name: "NuxtLayoutProvider",
inheritAttrs: false,
props: {
name: {
type: [String, Boolean]
},
layoutProps: {
type: Object
},
hasTransition: {
type: Boolean
},
shouldProvide: {
type: Boolean
},
isRenderingNewLayout: {
type: Function,
required: true
}
},
setup(props, context) {
const name = props.name;
if (props.shouldProvide) {
provide(LayoutMetaSymbol, {
// When name=false, always return true so NuxtPage doesn't skip rendering
isCurrent: (route) => name === false || name === (route.meta.layout ?? routeRulesMatcher(route.path).appLayout ?? "default")
});
}
const injectedRoute = inject(PageRouteSymbol);
const isNotWithinNuxtPage = injectedRoute && injectedRoute === useRoute();
if (isNotWithinNuxtPage) {
const vueRouterRoute = useVueRouterRoute();
const reactiveChildRoute = {};
for (const _key in vueRouterRoute) {
const key = _key;
Object.defineProperty(reactiveChildRoute, key, {
enumerable: true,
get: () => {
return props.isRenderingNewLayout(props.name) ? vueRouterRoute[key] : injectedRoute[key];
}
});
}
provide(PageRouteSymbol, shallowReactive(reactiveChildRoute));
}
let vnode;
if (import.meta.dev && import.meta.client) {
onMounted(() => {
nextTick(() => {
if (["#comment", "#text"].includes(vnode?.el?.nodeName)) {
if (name) {
console.warn(`[nuxt] \`${name}\` layout does not have a single root node and will cause errors when navigating between routes.`);
} else {
console.warn("[nuxt] `<NuxtLayout>` needs to be passed a single root node in its default slot.");
}
}
});
});
}
return () => {
if (!name || typeof name === "string" && !(name in layouts)) {
if (import.meta.dev && import.meta.client && props.hasTransition) {
vnode = context.slots.default?.();
return vnode;
}
return context.slots.default?.();
}
if (import.meta.dev && import.meta.client && props.hasTransition) {
vnode = h(
LayoutLoader,
{ key: name, layoutProps: props.layoutProps, name },
context.slots
);
return vnode;
}
return h(
LayoutLoader,
{ key: name, layoutProps: props.layoutProps, name },
context.slots
);
};
}
});

101
node_modules/nuxt/dist/app/components/nuxt-link.d.ts generated vendored Normal file
View File

@@ -0,0 +1,101 @@
import type { AllowedComponentProps, AnchorHTMLAttributes, DefineSetupFnComponent, SlotsType, UnwrapRef, VNode, VNodeProps } from 'vue';
import type { RouteLocation, RouteLocationRaw, RouterLinkProps, UseLinkReturn } from 'vue-router';
import type { NuxtApp } from '../nuxt.js';
/**
* `<NuxtLink>` is a drop-in replacement for both Vue Router's `<RouterLink>` component and HTML's `<a>` tag.
* @see https://nuxt.com/docs/4.x/api/components/nuxt-link
*/
export interface NuxtLinkProps<CustomProp extends boolean = false> extends Omit<RouterLinkProps, 'to'> {
custom?: CustomProp;
/**
* Route Location the link should navigate to when clicked on.
*/
to?: RouteLocationRaw;
/**
* An alias for `to`. If used with `to`, `href` will be ignored
*/
href?: NuxtLinkProps['to'];
/**
* Forces the link to be considered as external (true) or internal (false). This is helpful to handle edge-cases
*/
external?: boolean;
/**
* Where to display the linked URL, as the name for a browsing context.
*/
target?: '_blank' | '_parent' | '_self' | '_top' | (string & {}) | null;
/**
* A rel attribute value to apply on the link. Defaults to "noopener noreferrer" for external links.
*/
rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {}) | null;
/**
* If set to true, no rel attribute will be added to the link
*/
noRel?: boolean;
/**
* A class to apply to links that have been prefetched.
*/
prefetchedClass?: string;
/**
* When enabled will prefetch middleware, layouts and payloads of links in the viewport.
*/
prefetch?: boolean;
/**
* Allows controlling when to prefetch links. By default, prefetch is triggered only on visibility.
*/
prefetchOn?: 'visibility' | 'interaction' | Partial<{
visibility: boolean;
interaction: boolean;
}>;
/**
* Escape hatch to disable `prefetch` attribute.
*/
noPrefetch?: boolean;
/**
* An option to either add or remove trailing slashes in the `href` for this specific link.
* Overrides the global `trailingSlash` option if provided.
*/
trailingSlash?: 'append' | 'remove';
}
/**
* Create a NuxtLink component with given options as defaults.
* @see https://nuxt.com/docs/4.x/api/components/nuxt-link
*/
export interface NuxtLinkOptions extends Partial<Pick<RouterLinkProps, 'activeClass' | 'exactActiveClass'>>, Partial<Pick<NuxtLinkProps, 'prefetch' | 'prefetchedClass'>> {
/**
* The name of the component.
* @default "NuxtLink"
*/
componentName?: string;
/**
* A default `rel` attribute value applied on external links. Defaults to `"noopener noreferrer"`. Set it to `""` to disable.
*/
externalRelAttribute?: string | null;
/**
* An option to either add or remove trailing slashes in the `href`.
* If unset or not matching the valid values `append` or `remove`, it will be ignored.
*/
trailingSlash?: 'append' | 'remove';
/**
* Allows controlling default setting for when to prefetch links. By default, prefetch is triggered only on visibility.
*/
prefetchOn?: Exclude<NuxtLinkProps['prefetchOn'], string>;
}
type NuxtLinkDefaultSlotProps<CustomProp extends boolean = false> = CustomProp extends true ? {
href: string;
navigate: (e?: MouseEvent) => Promise<void>;
prefetch: (nuxtApp?: NuxtApp) => Promise<void>;
route: (RouteLocation & {
href: string;
}) | undefined;
rel: string | null;
target: '_blank' | '_parent' | '_self' | '_top' | (string & {}) | null;
isExternal: boolean;
isActive: false;
isExactActive: false;
} : UnwrapRef<UseLinkReturn>;
type NuxtLinkSlots<CustomProp extends boolean = false> = {
default?: (props: NuxtLinkDefaultSlotProps<CustomProp>) => VNode[];
};
export declare function defineNuxtLink(options: NuxtLinkOptions): (new <CustomProp extends boolean = false>(props: NuxtLinkProps<CustomProp> & VNodeProps & AllowedComponentProps & Omit<AnchorHTMLAttributes, keyof NuxtLinkProps<CustomProp>>) => InstanceType<DefineSetupFnComponent<NuxtLinkProps<CustomProp> & VNodeProps & AllowedComponentProps & Omit<AnchorHTMLAttributes, keyof NuxtLinkProps<CustomProp>>, [], SlotsType<NuxtLinkSlots<CustomProp>>>>) & Record<string, any>;
declare const _default: (new <CustomProp extends boolean = false>(props: NuxtLinkProps<CustomProp> & VNodeProps & AllowedComponentProps & Omit<AnchorHTMLAttributes, keyof NuxtLinkProps<CustomProp>>) => InstanceType<DefineSetupFnComponent<NuxtLinkProps<CustomProp> & VNodeProps & AllowedComponentProps & Omit<AnchorHTMLAttributes, keyof NuxtLinkProps<CustomProp>>, [], SlotsType<NuxtLinkSlots<CustomProp>>>>) & Record<string, any>;
export default _default;

423
node_modules/nuxt/dist/app/components/nuxt-link.js generated vendored Normal file
View File

@@ -0,0 +1,423 @@
import { computed, defineComponent, h, inject, onBeforeUnmount, onMounted, provide, ref, resolveComponent, shallowRef } from "vue";
import { hasProtocol, joinURL, parseQuery, withTrailingSlash, withoutTrailingSlash } from "ufo";
import { preloadRouteComponents } from "../composables/preload.js";
import { onNuxtReady } from "../composables/ready.js";
import { encodeRoutePath, navigateTo, resolveRouteObject, useRouter } from "../composables/router.js";
import { useNuxtApp, useRuntimeConfig } from "../nuxt.js";
import { cancelIdleCallback, requestIdleCallback } from "../compat/idle-callback.js";
import { nuxtLinkDefaults } from "#build/nuxt.config.mjs";
import { hashMode } from "#build/router.options.mjs";
const firstNonUndefined = (...args) => args.find((arg) => arg !== void 0);
const NuxtLinkDevKeySymbol = Symbol("nuxt-link-dev-key");
// @__NO_SIDE_EFFECTS__
export function defineNuxtLink(options) {
const componentName = options.componentName || "NuxtLink";
function checkPropConflicts(props, main, sub) {
if (import.meta.dev && props[main] !== void 0 && props[sub] !== void 0) {
console.warn(`[${componentName}] \`${main}\` and \`${sub}\` cannot be used together. \`${sub}\` will be ignored.`);
}
}
function isHashLinkWithoutHashMode(link) {
return !hashMode && typeof link === "string" && link.startsWith("#");
}
function resolveTrailingSlashBehavior(to, resolve, trailingSlash) {
const effectiveTrailingSlash = trailingSlash ?? options.trailingSlash;
if (!to || effectiveTrailingSlash !== "append" && effectiveTrailingSlash !== "remove") {
return to;
}
if (typeof to === "string") {
return applyTrailingSlashBehavior(to, effectiveTrailingSlash);
}
const path = "path" in to && to.path !== void 0 ? to.path : resolve(to).path;
const resolvedPath = {
...to,
name: void 0,
// named routes would otherwise always override trailing slash behavior
path: applyTrailingSlashBehavior(path, effectiveTrailingSlash)
};
return resolvedPath;
}
function useNuxtLink(props) {
const router = useRouter();
const config = useRuntimeConfig();
const hasTarget = computed(() => !!props.target && props.target !== "_self");
const isAbsoluteUrl = computed(() => {
const path = props.to || props.href || "";
return typeof path === "string" && hasProtocol(path, { acceptRelative: true });
});
const builtinRouterLink = resolveComponent("RouterLink");
const useBuiltinLink = builtinRouterLink && typeof builtinRouterLink !== "string" ? builtinRouterLink.useLink : void 0;
const isExternal = computed(() => {
if (props.external) {
return true;
}
const path = props.to || props.href || "";
if (typeof path === "object") {
return false;
}
return path === "" || isAbsoluteUrl.value;
});
const to = computed(() => {
checkPropConflicts(props, "to", "href");
const path = props.to || props.href || "";
if (isExternal.value) {
return path;
}
return resolveTrailingSlashBehavior(path, router.resolve, props.trailingSlash);
});
const link = isExternal.value ? void 0 : useBuiltinLink?.({ ...props, to });
const href = computed(() => {
const effectiveTrailingSlash = props.trailingSlash ?? options.trailingSlash;
if (!to.value || isAbsoluteUrl.value || isHashLinkWithoutHashMode(to.value)) {
return to.value;
}
if (isExternal.value) {
const path = typeof to.value === "object" && "path" in to.value ? resolveRouteObject(to.value) : to.value;
const href2 = typeof path === "object" ? router.resolve(path).href : path;
return applyTrailingSlashBehavior(href2, effectiveTrailingSlash);
}
if (typeof to.value === "object") {
return router.resolve(to.value)?.href ?? null;
}
return applyTrailingSlashBehavior(joinURL(config.app.baseURL, to.value), effectiveTrailingSlash);
});
return {
to,
hasTarget,
isAbsoluteUrl,
isExternal,
//
href,
isActive: link?.isActive ?? computed(() => to.value === router.currentRoute.value.path),
isExactActive: link?.isExactActive ?? computed(() => to.value === router.currentRoute.value.path),
route: link?.route ?? computed(() => router.resolve(to.value)),
async navigate(_e) {
await navigateTo(href.value, { replace: props.replace, external: isExternal.value || hasTarget.value });
}
};
}
return defineComponent({
name: componentName,
props: {
// Routing
to: {
type: [String, Object],
default: void 0,
required: false
},
href: {
type: [String, Object],
default: void 0,
required: false
},
// Attributes
target: {
type: String,
default: void 0,
required: false
},
rel: {
type: String,
default: void 0,
required: false
},
noRel: {
type: Boolean,
default: void 0,
required: false
},
// Prefetching
prefetch: {
type: Boolean,
default: void 0,
required: false
},
prefetchOn: {
type: [String, Object],
default: void 0,
required: false
},
noPrefetch: {
type: Boolean,
default: void 0,
required: false
},
// Styling
activeClass: {
type: String,
default: void 0,
required: false
},
exactActiveClass: {
type: String,
default: void 0,
required: false
},
prefetchedClass: {
type: String,
default: void 0,
required: false
},
// Vue Router's `<RouterLink>` additional props
replace: {
type: Boolean,
default: void 0,
required: false
},
ariaCurrentValue: {
type: String,
default: void 0,
required: false
},
// Edge cases handling
external: {
type: Boolean,
default: void 0,
required: false
},
// Slot API
custom: {
type: Boolean,
default: void 0,
required: false
},
// Behavior
trailingSlash: {
type: String,
default: void 0,
required: false
}
},
useLink: useNuxtLink,
setup(props, { slots }) {
const router = useRouter();
const { to, href, navigate, isExternal, hasTarget, isAbsoluteUrl } = useNuxtLink(props);
const prefetched = shallowRef(false);
const el = import.meta.server ? void 0 : ref(null);
const elRef = import.meta.server ? void 0 : (ref2) => {
el.value = props.custom ? ref2?.$el?.nextElementSibling : ref2?.$el;
};
function shouldPrefetch(mode) {
if (import.meta.server) {
return;
}
return !prefetched.value && (typeof props.prefetchOn === "string" ? props.prefetchOn === mode : props.prefetchOn?.[mode] ?? options.prefetchOn?.[mode]) && (props.prefetch ?? options.prefetch) !== false && props.noPrefetch !== true && props.target !== "_blank" && !isSlowConnection();
}
async function prefetch(nuxtApp = useNuxtApp()) {
if (import.meta.server) {
return;
}
if (prefetched.value) {
return;
}
prefetched.value = true;
const path = typeof to.value === "string" ? to.value : isExternal.value ? resolveRouteObject(to.value) : router.resolve(to.value).fullPath;
const normalizedPath = isExternal.value ? new URL(path, window.location.href).href : path;
await Promise.all([
nuxtApp.hooks.callHook("link:prefetch", normalizedPath).catch(() => {
}),
!isExternal.value && !hasTarget.value && preloadRouteComponents(to.value, router).catch(() => {
})
]);
}
if (import.meta.client) {
checkPropConflicts(props, "noPrefetch", "prefetch");
if (shouldPrefetch("visibility")) {
const nuxtApp = useNuxtApp();
let idleId;
let unobserve = null;
onMounted(() => {
const observer = useObserver();
onNuxtReady(() => {
idleId = requestIdleCallback(() => {
if (el?.value?.tagName) {
unobserve = observer.observe(el.value, async () => {
unobserve?.();
unobserve = null;
await prefetch(nuxtApp);
});
}
});
});
});
onBeforeUnmount(() => {
if (idleId) {
cancelIdleCallback(idleId);
}
unobserve?.();
unobserve = null;
});
}
}
if (import.meta.dev && import.meta.server && !props.custom) {
const isNuxtLinkChild = inject(NuxtLinkDevKeySymbol, false);
if (isNuxtLinkChild) {
console.log("[nuxt] [NuxtLink] You can't nest one <a> inside another <a>. This will cause a hydration error on client-side. You can pass the `custom` prop to take full control of the markup.");
} else {
provide(NuxtLinkDevKeySymbol, true);
}
}
return () => {
if (!isExternal.value && !hasTarget.value && !isHashLinkWithoutHashMode(to.value)) {
const routerLinkProps = {
ref: elRef,
to: to.value,
activeClass: props.activeClass || options.activeClass,
exactActiveClass: props.exactActiveClass || options.exactActiveClass,
replace: props.replace,
ariaCurrentValue: props.ariaCurrentValue,
custom: props.custom
};
if (!props.custom) {
if (import.meta.client) {
if (shouldPrefetch("interaction")) {
routerLinkProps.onPointerenter = prefetch.bind(null, void 0);
routerLinkProps.onFocus = prefetch.bind(null, void 0);
}
if (prefetched.value) {
routerLinkProps.class = props.prefetchedClass || options.prefetchedClass;
}
}
routerLinkProps.rel = props.rel || void 0;
}
return h(
resolveComponent("RouterLink"),
routerLinkProps,
slots.default
);
}
const target = props.target || null;
checkPropConflicts(props, "noRel", "rel");
const rel = firstNonUndefined(
// converts `""` to `null` to prevent the attribute from being added as empty (`rel=""`)
props.noRel ? "" : props.rel,
options.externalRelAttribute,
/*
* A fallback rel of `noopener noreferrer` is applied for external links or links that open in a new tab.
* This solves a reverse tabnapping security flaw in browsers pre-2021 as well as improving privacy.
*/
isAbsoluteUrl.value || hasTarget.value ? "noopener noreferrer" : ""
) || null;
if (props.custom) {
if (!slots.default) {
return null;
}
return slots.default({
href: href.value,
navigate,
prefetch,
get route() {
if (!href.value) {
return void 0;
}
const url = new URL(href.value, import.meta.client ? window.location.href : "http://localhost");
return {
path: url.pathname,
fullPath: url.pathname,
get query() {
return parseQuery(url.search);
},
hash: url.hash,
params: {},
name: void 0,
matched: [],
redirectedFrom: void 0,
meta: {},
href: href.value
};
},
rel,
target,
isExternal: isExternal.value || hasTarget.value,
isActive: false,
isExactActive: false
});
}
return h("a", {
ref: el,
href: href.value || null,
// converts `""` to `null` to prevent the attribute from being added as empty (`href=""`)
rel,
target,
onClick: async (event) => {
if (isExternal.value || hasTarget.value) {
return;
}
event.preventDefault();
try {
const encodedHref = encodeRoutePath(href.value);
return await (props.replace ? router.replace(encodedHref) : router.push(encodedHref));
} finally {
if (import.meta.client && isHashLinkWithoutHashMode(to.value)) {
const rawHash = to.value.slice(1);
let hash = rawHash;
try {
hash = decodeURIComponent(rawHash);
} catch {
}
const el2 = document.getElementById(hash);
el2?.focus();
}
}
}
}, slots.default?.());
};
}
});
}
export default /* @__PURE__ */ defineNuxtLink(nuxtLinkDefaults);
function applyTrailingSlashBehavior(to, trailingSlash) {
const normalizeFn = trailingSlash === "append" ? withTrailingSlash : withoutTrailingSlash;
const hasProtocolDifferentFromHttp = hasProtocol(to) && !to.startsWith("http");
if (hasProtocolDifferentFromHttp) {
return to;
}
return normalizeFn(to, true);
}
function useObserver() {
if (import.meta.server) {
return;
}
const nuxtApp = useNuxtApp();
if (nuxtApp._observer) {
return nuxtApp._observer;
}
let observer = null;
const callbacks = /* @__PURE__ */ new Map();
const observe = (element, callback) => {
observer ||= new IntersectionObserver((entries) => {
for (const entry of entries) {
const callback2 = callbacks.get(entry.target);
const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;
if (isVisible && callback2) {
callback2();
}
}
});
callbacks.set(element, callback);
observer.observe(element);
return () => {
callbacks.delete(element);
observer?.unobserve(element);
if (callbacks.size === 0) {
observer?.disconnect();
observer = null;
}
};
};
const _observer = nuxtApp._observer = {
observe
};
return _observer;
}
const IS_2G_RE = /2g/;
function isSlowConnection() {
if (import.meta.server) {
return;
}
const cn = navigator.connection;
if (cn && (cn.saveData || IS_2G_RE.test(cn.effectiveType))) {
return true;
}
return false;
}

View File

@@ -0,0 +1,78 @@
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
throttle: {
type: NumberConstructor;
default: number;
};
duration: {
type: NumberConstructor;
default: number;
};
hideDelay: {
type: NumberConstructor;
default: number;
};
resetDelay: {
type: NumberConstructor;
default: number;
};
height: {
type: NumberConstructor;
default: number;
};
color: {
type: (BooleanConstructor | StringConstructor)[];
default: string;
};
errorColor: {
type: StringConstructor;
default: string;
};
estimatedProgress: {
type: () => (duration: number, elapsed: number) => number;
required: false;
};
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
throttle: {
type: NumberConstructor;
default: number;
};
duration: {
type: NumberConstructor;
default: number;
};
hideDelay: {
type: NumberConstructor;
default: number;
};
resetDelay: {
type: NumberConstructor;
default: number;
};
height: {
type: NumberConstructor;
default: number;
};
color: {
type: (BooleanConstructor | StringConstructor)[];
default: string;
};
errorColor: {
type: StringConstructor;
default: string;
};
estimatedProgress: {
type: () => (duration: number, elapsed: number) => number;
required: false;
};
}>> & Readonly<{}>, {
duration: number;
height: number;
throttle: number;
hideDelay: number;
resetDelay: number;
color: string | boolean;
errorColor: string;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

View File

@@ -0,0 +1,75 @@
import { defineComponent, h } from "vue";
import { useLoadingIndicator } from "../composables/loading-indicator.js";
export default defineComponent({
name: "NuxtLoadingIndicator",
props: {
throttle: {
type: Number,
default: 200
},
duration: {
type: Number,
default: 2e3
},
hideDelay: {
type: Number,
default: 500
},
resetDelay: {
type: Number,
default: 400
},
height: {
type: Number,
default: 3
},
color: {
type: [String, Boolean],
default: "repeating-linear-gradient(to right,#00dc82 0%,#34cdfe 50%,#0047e1 100%)"
},
errorColor: {
type: String,
default: "repeating-linear-gradient(to right,#f87171 0%,#ef4444 100%)"
},
estimatedProgress: {
type: Function,
required: false
}
},
setup(props, { slots, expose }) {
const { progress, isLoading, error, start, finish, clear } = useLoadingIndicator({
duration: props.duration,
throttle: props.throttle,
hideDelay: props.hideDelay,
resetDelay: props.resetDelay,
estimatedProgress: props.estimatedProgress
});
expose({
progress,
isLoading,
error,
start,
finish,
clear
});
return () => h("div", {
class: "nuxt-loading-indicator",
style: {
position: "fixed",
top: 0,
right: 0,
left: 0,
pointerEvents: "none",
width: "auto",
height: `${props.height}px`,
opacity: isLoading.value ? 1 : 0,
background: error.value ? props.errorColor : props.color || void 0,
backgroundSize: `${progress.value > 0 ? 100 / progress.value * 100 : 0}% auto`,
transform: `scaleX(${progress.value}%)`,
transformOrigin: "left",
transition: "transform 0.1s, height 0.4s, opacity 0.4s",
zIndex: 999999
}
}, slots);
}
});

View File

@@ -0,0 +1,3 @@
declare const _default: typeof __VLS_export;
export default _default;
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;

60
node_modules/nuxt/dist/app/components/nuxt-root.vue generated vendored Normal file
View File

@@ -0,0 +1,60 @@
<template>
<Suspense @resolve="onResolve">
<div v-if="abortRender" />
<ErrorComponent
v-else-if="error"
:error="error"
/>
<IslandRenderer
v-else-if="islandContext"
:context="islandContext"
/>
<component
:is="SingleRenderer"
v-else-if="SingleRenderer"
/>
<AppComponent v-else />
</Suspense>
</template>
<script setup>
import { defineAsyncComponent, onErrorCaptured, onServerPrefetch, provide } from "vue";
import { useNuxtApp } from "../nuxt";
import { isNuxtError, showError, useError } from "../composables/error";
import { useRoute, useRouter } from "../composables/router";
import { PageRouteSymbol } from "../components/injections";
import AppComponent from "#build/app-component.mjs";
import ErrorComponent from "#build/error-component.mjs";
import { componentIslands } from "#build/nuxt.config.mjs";
const IslandRenderer = import.meta.server && componentIslands ? defineAsyncComponent(() => import("./island-renderer").then((r) => r.default || r)) : () => null;
const nuxtApp = useNuxtApp();
const onResolve = nuxtApp.deferHydration();
if (import.meta.client && nuxtApp.isHydrating) {
const removeErrorHook = nuxtApp.hooks.hookOnce("app:error", onResolve);
useRouter().beforeEach(removeErrorHook);
}
const url = import.meta.server ? nuxtApp.ssrContext.url : window.location.pathname;
const SingleRenderer = import.meta.test && import.meta.dev && import.meta.server && url.startsWith("/__nuxt_component_test__/") && defineAsyncComponent(() => import("#build/test-component-wrapper.mjs").then((r) => r.default(import.meta.server ? url : window.location.href)));
provide(PageRouteSymbol, useRoute());
const results = nuxtApp.hooks.callHookWith((hooks) => hooks.map((hook) => hook()), "vue:setup");
if (import.meta.dev && results && results.some((i) => i && "then" in i)) {
console.error("[nuxt] Error in `vue:setup`. Callbacks must be synchronous.");
}
const error = useError();
const abortRender = import.meta.server && error.value && !nuxtApp.ssrContext.error;
const BOT_RE = /bot\b|chrome-lighthouse|facebookexternalhit|google\b/i;
onErrorCaptured((err, target, info) => {
nuxtApp.hooks.callHook("vue:error", err, target, info).catch((hookError) => console.error("[nuxt] Error in `vue:error` hook", hookError));
if (import.meta.client && BOT_RE.test(navigator.userAgent)) {
nuxtApp.hooks.callHook("app:error", err);
console.error(`[nuxt] Not rendering error page for bot with user agent \`${navigator.userAgent}\`:`, err);
return false;
}
if (import.meta.server || isNuxtError(err) && (err.fatal || err.unhandled)) {
const p = nuxtApp.runWithContext(() => showError(err));
onServerPrefetch(() => p);
return false;
}
});
const islandContext = import.meta.server && nuxtApp.ssrContext.islandContext;
</script>

View File

@@ -0,0 +1,3 @@
declare const _default: typeof __VLS_export;
export default _default;
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;

View File

@@ -0,0 +1,26 @@
import type { Politeness } from 'nuxt/app';
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
atomic: {
type: BooleanConstructor;
default: boolean;
};
politeness: {
type: () => Politeness;
default: string;
};
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
atomic: {
type: BooleanConstructor;
default: boolean;
};
politeness: {
type: () => Politeness;
default: string;
};
}>> & Readonly<{}>, {
politeness: Politeness;
atomic: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

View File

@@ -0,0 +1,48 @@
import { defineComponent, h } from "vue";
import { useRouteAnnouncer } from "../composables/route-announcer.js";
export default defineComponent({
name: "NuxtRouteAnnouncer",
props: {
atomic: {
type: Boolean,
default: false
},
politeness: {
type: String,
default: "polite"
}
},
setup(props, { slots, expose }) {
const { set, polite, assertive, message, politeness } = useRouteAnnouncer({ politeness: props.politeness });
expose({
set,
polite,
assertive,
message,
politeness
});
return () => h("span", {
class: "nuxt-route-announcer",
style: {
position: "absolute"
}
}, h("span", {
"role": "alert",
"aria-live": politeness.value,
"aria-atomic": props.atomic,
"style": {
"border": "0",
"clip": "rect(0 0 0 0)",
"clip-path": "inset(50%)",
"height": "1px",
"width": "1px",
"overflow": "hidden",
"position": "absolute",
"white-space": "nowrap",
"word-wrap": "normal",
"margin": "-1px",
"padding": "0"
}
}, slots.default ? slots.default({ message: message.value }) : message.value));
}
});

View File

@@ -0,0 +1,6 @@
export declare const NuxtImg: {
setup: () => never;
};
export declare const NuxtPicture: {
setup: () => never;
};

14
node_modules/nuxt/dist/app/components/nuxt-stubs.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
import { createError } from "../composables/error.js";
function renderStubMessage(name) {
throw createError({
fatal: true,
status: 500,
statusText: `${name} is provided by @nuxt/image. Check your console to install it or run 'npx nuxt module add @nuxt/image'`
});
}
export const NuxtImg = {
setup: () => renderStubMessage("<NuxtImg>")
};
export const NuxtPicture = {
setup: () => renderStubMessage("<NuxtPicture>")
};

View File

@@ -0,0 +1,22 @@
import type { InjectionKey } from 'vue';
export declare const NuxtTeleportIslandSymbol: InjectionKey<false | string>;
/**
* component only used with componentsIsland
* this teleport the component in SSR only if it needs to be hydrated on client
*/
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
nuxtClient: {
type: BooleanConstructor;
default: boolean;
};
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>[] | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
nuxtClient: {
type: BooleanConstructor;
default: boolean;
};
}>> & Readonly<{}>, {
nuxtClient: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

View File

@@ -0,0 +1,38 @@
import { Teleport, defineComponent, h, inject, provide, useId } from "vue";
import { useNuxtApp } from "../nuxt.js";
import paths from "#build/component-chunk";
import { buildAssetsURL } from "#internal/nuxt/paths";
export const NuxtTeleportIslandSymbol = Symbol("NuxtTeleportIslandComponent");
export default defineComponent({
name: "NuxtTeleportIslandComponent",
inheritAttrs: false,
props: {
nuxtClient: {
type: Boolean,
default: false
}
},
setup(props, { slots }) {
const nuxtApp = useNuxtApp();
const to = useId();
if (!nuxtApp.ssrContext?.islandContext || !props.nuxtClient || inject(NuxtTeleportIslandSymbol, false)) {
return () => slots.default?.();
}
provide(NuxtTeleportIslandSymbol, to);
const islandContext = nuxtApp.ssrContext.islandContext;
return () => {
const slot = slots.default()[0];
const slotType = slot.type;
const name = slotType.__name || slotType.name;
islandContext.components[to] = {
chunk: import.meta.dev ? buildAssetsURL(paths[name]) : paths[name],
props: slot.props || {}
};
return [h("div", {
"style": "display: contents;",
"data-island-uid": "",
"data-island-component": to
}, []), h(Teleport, { to }, slot)];
};
}
});

View File

@@ -0,0 +1,32 @@
import type { VNode } from 'vue';
/**
* component only used within islands for slot teleport
*/
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
name: {
type: StringConstructor;
required: true;
};
/**
* must be an array to handle v-for
*/
props: {
type: () => Array<any>;
};
}>, (() => VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}> | undefined) | (() => VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>[]), {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
name: {
type: StringConstructor;
required: true;
};
/**
* must be an array to handle v-for
*/
props: {
type: () => Array<any>;
};
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

View File

@@ -0,0 +1,53 @@
import { Teleport, createVNode, defineComponent, h, inject } from "vue";
import { useNuxtApp } from "../nuxt.js";
import { NuxtTeleportIslandSymbol } from "./nuxt-teleport-island-component.js";
export default defineComponent({
name: "NuxtTeleportIslandSlot",
inheritAttrs: false,
props: {
name: {
type: String,
required: true
},
/**
* must be an array to handle v-for
*/
props: {
type: Object
}
},
setup(props, { slots }) {
const nuxtApp = useNuxtApp();
const islandContext = nuxtApp.ssrContext?.islandContext;
if (!islandContext) {
return () => slots.default?.()[0];
}
const componentName = inject(NuxtTeleportIslandSymbol, false);
islandContext.slots[props.name] = {
props: props.props || []
};
return () => {
const vnodes = [];
if (nuxtApp.ssrContext?.islandContext && slots.default) {
vnodes.push(h("div", {
"style": "display: contents;",
"data-island-uid": "",
"data-island-slot": props.name
}, {
// Teleport in slot to not be hydrated client-side with the staticVNode
default: () => [createVNode(Teleport, { to: `island-slot=${componentName};${props.name}` }, slots.default?.())]
}));
} else {
vnodes.push(h("div", {
"style": "display: contents;",
"data-island-uid": "",
"data-island-slot": props.name
}));
}
if (slots.fallback) {
vnodes.push(h(Teleport, { to: `island-fallback=${props.name}` }, slots.fallback()));
}
return vnodes;
};
}
});

View File

@@ -0,0 +1,37 @@
export interface NuxtTimeProps {
locale?: string;
datetime: string | number | Date;
localeMatcher?: 'best fit' | 'lookup';
weekday?: 'long' | 'short' | 'narrow';
era?: 'long' | 'short' | 'narrow';
year?: 'numeric' | '2-digit';
month?: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow';
day?: 'numeric' | '2-digit';
hour?: 'numeric' | '2-digit';
minute?: 'numeric' | '2-digit';
second?: 'numeric' | '2-digit';
timeZoneName?: 'short' | 'long' | 'shortOffset' | 'longOffset' | 'shortGeneric' | 'longGeneric';
formatMatcher?: 'best fit' | 'basic';
hour12?: boolean;
timeZone?: string;
calendar?: string;
dayPeriod?: 'narrow' | 'short' | 'long';
numberingSystem?: string;
dateStyle?: 'full' | 'long' | 'medium' | 'short';
timeStyle?: 'full' | 'long' | 'medium' | 'short';
hourCycle?: 'h11' | 'h12' | 'h23' | 'h24';
relative?: boolean;
numeric?: 'always' | 'auto';
relativeStyle?: 'long' | 'short' | 'narrow';
title?: boolean | string;
}
declare global {
interface Window {
_nuxtTimeNow?: number;
}
}
declare const __VLS_export: import("vue").DefineComponent<NuxtTimeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NuxtTimeProps> & Readonly<{}>, {
hour12: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
declare const _default: typeof __VLS_export;
export default _default;

159
node_modules/nuxt/dist/app/components/nuxt-time.vue generated vendored Normal file
View File

@@ -0,0 +1,159 @@
<script setup>
import { computed, getCurrentInstance, onBeforeUnmount, ref } from "vue";
import { onPrehydrate } from "../composables/ssr";
import { useNuxtApp } from "../nuxt";
const props = defineProps({
locale: { type: String, required: false },
datetime: { type: [String, Number, Date], required: true },
localeMatcher: { type: String, required: false },
weekday: { type: String, required: false },
era: { type: String, required: false },
year: { type: String, required: false },
month: { type: String, required: false },
day: { type: String, required: false },
hour: { type: String, required: false },
minute: { type: String, required: false },
second: { type: String, required: false },
timeZoneName: { type: String, required: false },
formatMatcher: { type: String, required: false },
hour12: { type: Boolean, required: false, default: void 0 },
timeZone: { type: String, required: false },
calendar: { type: String, required: false },
dayPeriod: { type: String, required: false },
numberingSystem: { type: String, required: false },
dateStyle: { type: String, required: false },
timeStyle: { type: String, required: false },
hourCycle: { type: String, required: false },
relative: { type: Boolean, required: false },
numeric: { type: String, required: false },
relativeStyle: { type: String, required: false },
title: { type: [Boolean, String], required: false }
});
const el = getCurrentInstance()?.vnode.el;
const renderedDate = el?.getAttribute("datetime");
const _locale = el?.getAttribute("data-locale");
const nuxtApp = useNuxtApp();
const date = computed(() => {
const date2 = props.datetime;
if (renderedDate && nuxtApp.isHydrating) {
return new Date(renderedDate);
}
if (!props.datetime) {
return /* @__PURE__ */ new Date();
}
return new Date(date2);
});
const now = ref(import.meta.client && nuxtApp.isHydrating && window._nuxtTimeNow ? new Date(window._nuxtTimeNow) : /* @__PURE__ */ new Date());
if (import.meta.client && props.relative) {
const handler = () => {
now.value = /* @__PURE__ */ new Date();
};
const interval = setInterval(handler, 1e3);
onBeforeUnmount(() => clearInterval(interval));
}
const formatter = computed(() => {
const { locale: propsLocale, relative, relativeStyle, ...rest } = props;
if (relative) {
return new Intl.RelativeTimeFormat(_locale ?? propsLocale, { ...rest, style: relativeStyle });
}
return new Intl.DateTimeFormat(_locale ?? propsLocale, rest);
});
const formattedDate = computed(() => {
if (isInvalidDate.value) {
return date.value.toString();
}
if (!props.relative) {
return formatter.value.format(date.value);
}
const diffInSeconds = (date.value.getTime() - now.value.getTime()) / 1e3;
const units = [
{ unit: "second", seconds: 1, threshold: 60 },
// 60 seconds → minute
{ unit: "minute", seconds: 60, threshold: 60 },
// 60 minutes → hour
{ unit: "hour", seconds: 3600, threshold: 24 },
// 24 hours → day
{ unit: "day", seconds: 86400, threshold: 30 },
// ~30 days → month
{ unit: "month", seconds: 2592e3, threshold: 12 },
// 12 months → year
{ unit: "year", seconds: 31536e3, threshold: Infinity }
];
const { unit, seconds } = units.find(({ seconds: seconds2, threshold }) => Math.abs(diffInSeconds / seconds2) < threshold) || units[units.length - 1];
const value = diffInSeconds / seconds;
return formatter.value.format(Math.round(value), unit);
});
const isInvalidDate = computed(() => Number.isNaN(date.value.getTime()));
const isoDate = computed(() => isInvalidDate.value ? void 0 : date.value.toISOString());
const title = computed(() => props.title === true ? isoDate.value : typeof props.title === "string" ? props.title : void 0);
const dataset = {};
if (import.meta.server) {
for (const prop in props) {
if (prop !== "datetime") {
const value = props?.[prop];
if (value) {
const propInKebabCase = prop.split(/(?=[A-Z])/).join("-");
dataset[`data-${propInKebabCase}`] = props?.[prop];
}
}
}
onPrehydrate((el2) => {
const now2 = window._nuxtTimeNow ||= Date.now();
const toCamelCase = (name, index) => {
if (index > 0) {
return name[0].toUpperCase() + name.slice(1);
}
return name;
};
const datetime = el2.getAttribute("datetime");
if (!datetime) {
return;
}
const date2 = new Date(datetime);
if (Number.isNaN(date2.getTime())) {
return;
}
const options = {};
for (const name of el2.getAttributeNames()) {
if (name.startsWith("data-")) {
let optionName = name.slice(5).split("-").map(toCamelCase).join("");
if (optionName === "relativeStyle") {
optionName = "style";
}
options[optionName] = el2.getAttribute(name);
}
}
if (options.relative) {
const diffInSeconds = (date2.getTime() - now2) / 1e3;
const units = [
{ unit: "second", seconds: 1, threshold: 60 },
// 60 seconds → minute
{ unit: "minute", seconds: 60, threshold: 60 },
// 60 minutes → hour
{ unit: "hour", seconds: 3600, threshold: 24 },
// 24 hours → day
{ unit: "day", seconds: 86400, threshold: 30 },
// ~30 days → month
{ unit: "month", seconds: 2592e3, threshold: 12 },
// 12 months → year
{ unit: "year", seconds: 31536e3, threshold: Infinity }
];
const { unit, seconds } = units.find(({ seconds: seconds2, threshold }) => Math.abs(diffInSeconds / seconds2) < threshold) || units[units.length - 1];
const value = diffInSeconds / seconds;
const formatter2 = new Intl.RelativeTimeFormat(options.locale, options);
el2.textContent = formatter2.format(Math.round(value), unit);
} else {
const formatter2 = new Intl.DateTimeFormat(options.locale, options);
el2.textContent = formatter2.format(date2);
}
});
}
</script>
<template>
<time
v-bind="dataset"
:datetime="isoDate"
:title="title"
>{{ formattedDate }}</time>
</template>

View File

@@ -0,0 +1,37 @@
export interface NuxtTimeProps {
locale?: string;
datetime: string | number | Date;
localeMatcher?: 'best fit' | 'lookup';
weekday?: 'long' | 'short' | 'narrow';
era?: 'long' | 'short' | 'narrow';
year?: 'numeric' | '2-digit';
month?: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow';
day?: 'numeric' | '2-digit';
hour?: 'numeric' | '2-digit';
minute?: 'numeric' | '2-digit';
second?: 'numeric' | '2-digit';
timeZoneName?: 'short' | 'long' | 'shortOffset' | 'longOffset' | 'shortGeneric' | 'longGeneric';
formatMatcher?: 'best fit' | 'basic';
hour12?: boolean;
timeZone?: string;
calendar?: string;
dayPeriod?: 'narrow' | 'short' | 'long';
numberingSystem?: string;
dateStyle?: 'full' | 'long' | 'medium' | 'short';
timeStyle?: 'full' | 'long' | 'medium' | 'short';
hourCycle?: 'h11' | 'h12' | 'h23' | 'h24';
relative?: boolean;
numeric?: 'always' | 'auto';
relativeStyle?: 'long' | 'short' | 'narrow';
title?: boolean | string;
}
declare global {
interface Window {
_nuxtTimeNow?: number;
}
}
declare const __VLS_export: import("vue").DefineComponent<NuxtTimeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NuxtTimeProps> & Readonly<{}>, {
hour12: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
declare const _default: typeof __VLS_export;
export default _default;

View File

@@ -0,0 +1,48 @@
import type { Ref, VNode } from 'vue';
import type { RouteLocationNormalizedLoaded } from 'vue-router';
export declare const defineRouteProvider: (name?: string) => import("vue").DefineComponent<import("vue").ExtractPropTypes<{
route: {
type: () => RouteLocationNormalizedLoaded;
required: true;
};
vnode: () => VNode;
vnodeRef: () => Ref<any>;
renderKey: StringConstructor;
trackRootNodes: BooleanConstructor;
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}> | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
route: {
type: () => RouteLocationNormalizedLoaded;
required: true;
};
vnode: () => VNode;
vnodeRef: () => Ref<any>;
renderKey: StringConstructor;
trackRootNodes: BooleanConstructor;
}>> & Readonly<{}>, {
trackRootNodes: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export declare const RouteProvider: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
route: {
type: () => RouteLocationNormalizedLoaded;
required: true;
};
vnode: () => VNode;
vnodeRef: () => Ref<any>;
renderKey: StringConstructor;
trackRootNodes: BooleanConstructor;
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}> | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
route: {
type: () => RouteLocationNormalizedLoaded;
required: true;
};
vnode: () => VNode;
vnodeRef: () => Ref<any>;
renderKey: StringConstructor;
trackRootNodes: BooleanConstructor;
}>> & Readonly<{}>, {
trackRootNodes: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;

View File

@@ -0,0 +1,49 @@
import { defineComponent, h, nextTick, onMounted, provide, shallowReactive } from "vue";
import { PageRouteSymbol } from "./injections.js";
export const defineRouteProvider = (name = "RouteProvider") => defineComponent({
name,
props: {
route: {
type: Object,
required: true
},
vnode: Object,
vnodeRef: Object,
renderKey: String,
trackRootNodes: Boolean
},
setup(props) {
const previousKey = props.renderKey;
const previousRoute = props.route;
const route = {};
for (const key in props.route) {
Object.defineProperty(route, key, {
get: () => previousKey === props.renderKey ? props.route[key] : previousRoute[key],
enumerable: true
});
}
provide(PageRouteSymbol, shallowReactive(route));
let vnode;
if (import.meta.dev && import.meta.client && props.trackRootNodes) {
onMounted(() => {
nextTick(() => {
if (["#comment", "#text"].includes(vnode?.el?.nodeName)) {
const filename = vnode?.type?.__file;
console.warn(`[nuxt] \`${filename}\` does not have a single root node and will cause errors when navigating between routes.`);
}
});
});
}
return () => {
if (!props.vnode) {
return props.vnode;
}
if (import.meta.dev && import.meta.client) {
vnode = h(props.vnode, { ref: props.vnodeRef });
return vnode;
}
return h(props.vnode, { ref: props.vnodeRef });
};
}
});
export const RouteProvider = defineRouteProvider();

View File

@@ -0,0 +1,2 @@
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

View File

@@ -0,0 +1,7 @@
import { createElementBlock, defineComponent } from "vue";
export default defineComponent({
name: "ServerPlaceholder",
render() {
return createElementBlock("div");
}
});

View File

@@ -0,0 +1,4 @@
declare const _default: (url: string) => import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

View File

@@ -0,0 +1,27 @@
import { defineComponent, h } from "vue";
import { parseQuery } from "vue-router";
import { resolve } from "pathe";
import destr from "destr";
import { devRootDir } from "#build/nuxt.config.mjs";
export default (url) => defineComponent({
name: "NuxtTestComponentWrapper",
inheritAttrs: false,
async setup(props, { attrs }) {
const query = parseQuery(new URL(url, "http://localhost").search);
const urlProps = query.props ? destr(query.props) : {};
const path = resolve(query.path);
if (!path.startsWith(devRootDir)) {
throw new Error(`[nuxt] Cannot access path outside of project root directory: \`${path}\`.`);
}
const comp = await import(
/* @vite-ignore */
path
).then((r) => r.default);
return () => [
h("div", "Component Test Wrapper for " + path),
h("div", { id: "nuxt-component-root" }, [
h(comp, { ...attrs, ...props, ...urlProps })
])
];
}
});

48
node_modules/nuxt/dist/app/components/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1,48 @@
import type { RendererNode, VNode } from 'vue';
import type { RouteLocationNormalized } from 'vue-router';
/**
* Internal utility
* @private
*/
export declare const _wrapInTransition: (props: any, children: any) => {
default: () => any;
};
/**
* Utility used within router guards
* return true if the route has been changed with a page change during navigation
*/
export declare function isChangingPage(to: RouteLocationNormalized, from: RouteLocationNormalized): boolean;
export type SSRBuffer = SSRBufferItem[] & {
hasAsync?: boolean;
};
export type SSRBufferItem = string | SSRBuffer | Promise<SSRBuffer>;
/**
* create buffer retrieved from @vue/server-renderer
* @see https://github.com/vuejs/core/blob/9617dd4b2abc07a5dc40de6e5b759e851b4d0da1/packages/server-renderer/src/render.ts#L57
* @private
*/
export declare function createBuffer(): {
getBuffer(): SSRBuffer;
push(item: SSRBufferItem): void;
};
/**
* helper for NuxtIsland to generate a correct array for scoped data
*/
export declare function vforToArray(source: any): any[];
/**
* Retrieve the HTML content from an element
* Handles `<!--[-->` Fragment elements
* @param element the element to retrieve the HTML
* @param withoutSlots purge all slots from the HTML string retrieved
* @returns {string[]|undefined} An array of string which represent the content of each element. Use `.join('')` to retrieve a component vnode.el HTML
*/
export declare function getFragmentHTML(element: RendererNode | null, withoutSlots?: boolean): string[] | undefined;
/**
* Return a static vnode from an element
* Default to a div if the element is not found and if a fallback is not provided
* @param el renderer node retrieved from the component internal instance
* @param staticNodeFallback fallback string to use if the element is not found. Must be a valid HTML string
*/
export declare function elToStaticVNode(el: RendererNode | null, staticNodeFallback?: string): VNode;
export declare function isStartFragment(element: RendererNode): boolean;
export declare function isEndFragment(element: RendererNode): boolean;

126
node_modules/nuxt/dist/app/components/utils.js generated vendored Normal file
View File

@@ -0,0 +1,126 @@
import { Transition, createStaticVNode, h } from "vue";
import { isString, isPromise, isArray, isObject } from "@vue/shared";
import { START_LOCATION } from "#build/pages";
export const _wrapInTransition = (props, children) => {
return { default: () => import.meta.client && props ? h(Transition, props === true ? {} : props, children) : children.default?.() };
};
const ROUTE_KEY_PARENTHESES_RE = /(:\w+)\([^)]+\)/g;
const ROUTE_KEY_SYMBOLS_RE = /(:\w+)[?+*]/g;
const ROUTE_KEY_NORMAL_RE = /:\w+/g;
function generateRouteKey(route) {
const source = route?.meta.key ?? route.path.replace(ROUTE_KEY_PARENTHESES_RE, "$1").replace(ROUTE_KEY_SYMBOLS_RE, "$1").replace(ROUTE_KEY_NORMAL_RE, (r) => route.params[r.slice(1)]?.toString() || "");
return typeof source === "function" ? source(route) : source;
}
export function isChangingPage(to, from) {
if (to === from || from === START_LOCATION) {
return false;
}
if (generateRouteKey(to) !== generateRouteKey(from)) {
return true;
}
const areComponentsSame = to.matched.every(
(comp, index) => comp.components && comp.components.default === from.matched[index]?.components?.default
);
if (areComponentsSame) {
return false;
}
return true;
}
export function createBuffer() {
let appendable = false;
const buffer = [];
return {
getBuffer() {
return buffer;
},
push(item) {
const isStringItem = isString(item);
if (appendable && isStringItem) {
buffer[buffer.length - 1] += item;
} else {
buffer.push(item);
}
appendable = isStringItem;
if (isPromise(item) || isArray(item) && item.hasAsync) {
buffer.hasAsync = true;
}
}
};
}
export function vforToArray(source) {
if (isArray(source)) {
return source;
} else if (isString(source)) {
return source.split("");
} else if (typeof source === "number") {
if (import.meta.dev && !Number.isInteger(source)) {
console.warn(`The v-for range expect an integer value but got ${source}.`);
}
const array = [];
for (let i = 0; i < source; i++) {
array[i] = i;
}
return array;
} else if (isObject(source)) {
if (source[Symbol.iterator]) {
return Array.from(
source,
(item) => item
);
} else {
const keys = Object.keys(source);
const array = new Array(keys.length);
for (let i = 0, l = keys.length; i < l; i++) {
const key = keys[i];
array[i] = source[key];
}
return array;
}
}
return [];
}
export function getFragmentHTML(element, withoutSlots = false) {
if (element) {
if (element.nodeName === "#comment" && element.nodeValue === "[") {
return getFragmentChildren(element, [], withoutSlots);
}
if (withoutSlots) {
const clone = element.cloneNode(true);
clone.querySelectorAll("[data-island-slot]").forEach((n) => {
n.innerHTML = "";
});
return [clone.outerHTML];
}
return [element.outerHTML];
}
}
function getFragmentChildren(element, blocks = [], withoutSlots = false) {
if (element && element.nodeName) {
if (isEndFragment(element)) {
return blocks;
} else if (!isStartFragment(element)) {
const clone = element.cloneNode(true);
if (withoutSlots) {
clone.querySelectorAll?.("[data-island-slot]").forEach((n) => {
n.innerHTML = "";
});
}
blocks.push(clone.outerHTML);
}
getFragmentChildren(element.nextSibling, blocks, withoutSlots);
}
return blocks;
}
export function elToStaticVNode(el, staticNodeFallback) {
const fragment = el ? getFragmentHTML(el) : staticNodeFallback ? [staticNodeFallback] : void 0;
if (fragment) {
return createStaticVNode(fragment.join(""), fragment.length);
}
return h("div");
}
export function isStartFragment(element) {
return element.nodeName === "#comment" && element.nodeValue === "[";
}
export function isEndFragment(element) {
return element.nodeName === "#comment" && element.nodeValue === "]";
}

24
node_modules/nuxt/dist/app/components/welcome.d.vue.ts generated vendored Normal file
View File

@@ -0,0 +1,24 @@
declare const _default: typeof __VLS_export;
export default _default;
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
appName: {
type: StringConstructor;
default: string;
};
title: {
type: StringConstructor;
default: string;
};
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
appName: {
type: StringConstructor;
default: string;
};
title: {
type: StringConstructor;
default: string;
};
}>> & Readonly<{}>, {
appName: string;
title: string;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;

34
node_modules/nuxt/dist/app/components/welcome.vue generated vendored Normal file

File diff suppressed because one or more lines are too long

24
node_modules/nuxt/dist/app/components/welcome.vue.d.ts generated vendored Normal file
View File

@@ -0,0 +1,24 @@
declare const _default: typeof __VLS_export;
export default _default;
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
appName: {
type: StringConstructor;
default: string;
};
title: {
type: StringConstructor;
default: string;
};
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
appName: {
type: StringConstructor;
default: string;
};
title: {
type: StringConstructor;
default: string;
};
}>> & Readonly<{}>, {
appName: string;
title: string;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;