import { escape } from 'html-escaper';
import { Traverse } from 'neotraverse/modern';
import * as z from 'zod/v4';
import { k as renderElement, l as generateCspDigest, h as spreadAttributes, u as unescapeHTML, a as renderTemplate, g as AstroError, U as UnknownContentCollectionError, R as RenderUndefinedEntryError, n as createHeadAndContent, r as renderComponent, A as AstroUserError } from './prerender_DM8EEygr.mjs';
import { c as createComponent } from './astro-component_zOMRFNdO.mjs';
import 'clsx';
import { removeBase, isRemotePath, prependForwardSlash } from '@astrojs/internal-helpers/path';
import 'piccolore';
import * as devalue from 'devalue';
import i18next from 'i18next';
function renderScriptElement({ props, children }) {
return renderElement("script", {
props,
children
});
}
function renderUniqueStylesheet(result, sheet) {
if (sheet.type === "external") {
if (Array.from(result.styles).some((s) => s.props.href === sheet.src)) return "";
return renderElement("link", { props: { rel: "stylesheet", href: sheet.src }, children: "" });
}
if (sheet.type === "inline") {
if (Array.from(result.styles).some((s) => s.children.includes(sheet.content))) return "";
return renderElement("style", { props: {}, children: sheet.content });
}
}
function createSvgComponent({ meta, attributes, children, styles }) {
const hasStyles = styles.length > 0;
const Component = createComponent({
async factory(result, props) {
const normalizedProps = normalizeProps(attributes, props);
if (hasStyles && result.cspDestination) {
for (const style of styles) {
const hash = await generateCspDigest(style, result.cspAlgorithm);
result._metadata.extraStyleHashes.push(hash);
}
}
return renderTemplate``;
},
propagation: hasStyles ? "self" : "none"
});
Object.defineProperty(Component, "toJSON", {
value: () => meta,
enumerable: false
});
return Object.assign(Component, meta);
}
const ATTRS_TO_DROP = ["xmlns", "xmlns:xlink", "version"];
const DEFAULT_ATTRS = {};
function dropAttributes(attributes) {
for (const attr of ATTRS_TO_DROP) {
delete attributes[attr];
}
return attributes;
}
function normalizeProps(attributes, props) {
return dropAttributes({ ...DEFAULT_ATTRS, ...attributes, ...props });
}
const CONTENT_IMAGE_FLAG = "astroContentImageFlag";
const IMAGE_IMPORT_PREFIX = "__ASTRO_IMAGE_";
const VALID_INPUT_FORMATS = [
"jpeg",
"jpg",
"png",
"tiff",
"webp",
"gif",
"svg",
"avif"
];
const VALID_SUPPORTED_FORMATS = [
"jpeg",
"jpg",
"png",
"tiff",
"webp",
"gif",
"svg",
"avif"
];
const DEFAULT_OUTPUT_FORMAT = "webp";
const DEFAULT_HASH_PROPS = [
"src",
"width",
"height",
"format",
"quality",
"fit",
"position",
"background"
];
function imageSrcToImportId(imageSrc, filePath) {
imageSrc = removeBase(imageSrc, IMAGE_IMPORT_PREFIX);
if (isRemotePath(imageSrc)) {
return;
}
const ext = imageSrc.split(".").at(-1)?.toLowerCase();
if (!ext || !VALID_INPUT_FORMATS.includes(ext)) {
return;
}
const params = new URLSearchParams(CONTENT_IMAGE_FLAG);
if (filePath) {
params.set("importer", filePath);
}
return `${imageSrc}?${params.toString()}`;
}
class ImmutableDataStore {
_collections = /* @__PURE__ */ new Map();
constructor() {
this._collections = /* @__PURE__ */ new Map();
}
get(collectionName, key) {
return this._collections.get(collectionName)?.get(String(key));
}
entries(collectionName) {
const collection = this._collections.get(collectionName) ?? /* @__PURE__ */ new Map();
return [...collection.entries()];
}
values(collectionName) {
const collection = this._collections.get(collectionName) ?? /* @__PURE__ */ new Map();
return [...collection.values()];
}
keys(collectionName) {
const collection = this._collections.get(collectionName) ?? /* @__PURE__ */ new Map();
return [...collection.keys()];
}
has(collectionName, key) {
const collection = this._collections.get(collectionName);
if (collection) {
return collection.has(String(key));
}
return false;
}
hasCollection(collectionName) {
return this._collections.has(collectionName);
}
collections() {
return this._collections;
}
/**
* Attempts to load a DataStore from the virtual module.
* This only works in Vite.
*/
static async fromModule() {
try {
const data = await import('./_astro_data-layer-content_Cmfc1iOE.mjs');
if (data.default instanceof Map) {
return ImmutableDataStore.fromMap(data.default);
}
const map = devalue.unflatten(data.default);
return ImmutableDataStore.fromMap(map);
} catch {
}
return new ImmutableDataStore();
}
static async fromMap(data) {
const store = new ImmutableDataStore();
store._collections = data;
return store;
}
}
function dataStoreSingleton() {
let instance = void 0;
return {
get: async () => {
if (!instance) {
instance = ImmutableDataStore.fromModule();
}
return instance;
},
set: (store) => {
instance = store;
}
};
}
const globalDataStore = dataStoreSingleton();
z.object({
tags: z.array(z.string()).optional(),
lastModified: z.date().optional()
});
function createGetCollection({
liveCollections
}) {
return async function getCollection(collection, filter) {
if (collection in liveCollections) {
throw new AstroError({
...UnknownContentCollectionError,
message: `Collection "${collection}" is a live collection. Use getLiveCollection() instead of getCollection().`
});
}
const hasFilter = typeof filter === "function";
const store = await globalDataStore.get();
if (store.hasCollection(collection)) {
const { default: imageAssetMap } = await import('./content-assets_BAMCPLHh.mjs');
const result = [];
for (const rawEntry of store.values(collection)) {
const data = updateImageReferencesInData(rawEntry.data, rawEntry.filePath, imageAssetMap);
let entry = {
...rawEntry,
data,
collection
};
if (hasFilter && !filter(entry)) {
continue;
}
result.push(entry);
}
return result;
} else {
console.warn(
`The collection ${JSON.stringify(
collection
)} does not exist or is empty. Please check your content config file for errors.`
);
return [];
}
};
}
function createGetEntry({ liveCollections }) {
return async function getEntry(collectionOrLookupObject, lookup) {
let collection, lookupId;
if (typeof collectionOrLookupObject === "string") {
collection = collectionOrLookupObject;
if (!lookup)
throw new AstroError({
...UnknownContentCollectionError,
message: "`getEntry()` requires an entry identifier as the second argument."
});
lookupId = lookup;
} else {
collection = collectionOrLookupObject.collection;
lookupId = "id" in collectionOrLookupObject ? collectionOrLookupObject.id : collectionOrLookupObject.slug;
}
if (collection in liveCollections) {
throw new AstroError({
...UnknownContentCollectionError,
message: `Collection "${collection}" is a live collection. Use getLiveEntry() instead of getEntry().`
});
}
if (typeof lookupId === "object") {
throw new AstroError({
...UnknownContentCollectionError,
message: `The entry identifier must be a string. Received object.`
});
}
const store = await globalDataStore.get();
if (store.hasCollection(collection)) {
const entry = store.get(collection, lookupId);
if (!entry) {
console.warn(`Entry ${collection} → ${lookupId} was not found.`);
return;
}
const { default: imageAssetMap } = await import('./content-assets_BAMCPLHh.mjs');
entry.data = updateImageReferencesInData(entry.data, entry.filePath, imageAssetMap);
const result = {
...entry,
collection
};
warnForPropertyAccess(
result.data,
"slug",
`[content] Attempted to access deprecated property on "${collection}" entry.
The "slug" property is no longer automatically added to entries. Please use the "id" property instead.`
);
warnForPropertyAccess(
result,
"render",
`[content] Invalid attempt to access "render()" method on "${collection}" entry.
To render an entry, use "render(entry)" from "astro:content".`
);
return result;
}
return void 0;
};
}
function warnForPropertyAccess(entry, prop, message) {
if (!(prop in entry)) {
let _value = void 0;
Object.defineProperty(entry, prop, {
get() {
if (_value === void 0) {
console.error(message);
}
return _value;
},
set(v) {
_value = v;
},
enumerable: false
});
}
}
const CONTENT_LAYER_IMAGE_REGEX = /__ASTRO_IMAGE_="([^"]+)"/g;
async function updateImageReferencesInBody(html, fileName) {
const { default: imageAssetMap } = await import('./content-assets_BAMCPLHh.mjs');
const imageObjects = /* @__PURE__ */ new Map();
const { getImage } = await import('./_virtual_astro_get-image_B78SXbXJ.mjs');
for (const [_full, imagePath] of html.matchAll(CONTENT_LAYER_IMAGE_REGEX)) {
try {
const decodedImagePath = JSON.parse(imagePath.replaceAll(""", '"'));
let image;
if (URL.canParse(decodedImagePath.src)) {
image = await getImage(decodedImagePath);
} else {
const id = imageSrcToImportId(decodedImagePath.src, fileName);
const imported = imageAssetMap.get(id);
if (!id || imageObjects.has(id) || !imported) {
continue;
}
image = await getImage({ ...decodedImagePath, src: imported });
}
imageObjects.set(imagePath, image);
} catch {
throw new Error(`Failed to parse image reference: ${imagePath}`);
}
}
return html.replaceAll(CONTENT_LAYER_IMAGE_REGEX, (full, imagePath) => {
const image = imageObjects.get(imagePath);
if (!image) {
return full;
}
const { index, ...attributes } = image.attributes;
return Object.entries({
...attributes,
src: image.src,
srcset: image.srcSet.attribute,
// This attribute is used by the toolbar audit
...{}
}).map(([key, value]) => value ? `${key}="${escape(value)}"` : "").join(" ");
});
}
function updateImageReferencesInData(data, fileName, imageAssetMap) {
return new Traverse(data).map(function(ctx, val) {
if (typeof val === "string" && val.startsWith(IMAGE_IMPORT_PREFIX)) {
const src = val.replace(IMAGE_IMPORT_PREFIX, "");
const id = imageSrcToImportId(src, fileName);
if (!id) {
ctx.update(src);
return;
}
const imported = imageAssetMap?.get(id);
if (imported) {
if (imported.__svgData) {
const { __svgData: svgData, ...meta } = imported;
ctx.update(createSvgComponent({ meta, ...svgData }));
} else {
ctx.update(imported);
}
} else {
ctx.update(src);
}
}
});
}
async function renderEntry(entry) {
if (!entry) {
throw new AstroError(RenderUndefinedEntryError);
}
if (entry.deferredRender) {
try {
const { default: contentModules } = await import('./content-modules_DWClcio9.mjs');
const renderEntryImport = contentModules.get(entry.filePath);
return render({
collection: "",
id: entry.id,
renderEntryImport
});
} catch (e) {
console.error(e);
}
}
const html = entry?.rendered?.metadata?.imagePaths?.length && entry.filePath ? await updateImageReferencesInBody(entry.rendered.html, entry.filePath) : entry?.rendered?.html;
const Content = createComponent(() => renderTemplate`${unescapeHTML(html)}`);
return {
Content,
headings: entry?.rendered?.metadata?.headings ?? [],
remarkPluginFrontmatter: entry?.rendered?.metadata?.frontmatter ?? {}
};
}
async function render({
collection,
id,
renderEntryImport
}) {
const UnexpectedRenderError = new AstroError({
...UnknownContentCollectionError,
message: `Unexpected error while rendering ${String(collection)} → ${String(id)}.`
});
if (typeof renderEntryImport !== "function") throw UnexpectedRenderError;
const baseMod = await renderEntryImport();
if (baseMod == null || typeof baseMod !== "object") throw UnexpectedRenderError;
const { default: defaultMod } = baseMod;
if (isPropagatedAssetsModule(defaultMod)) {
const { collectedStyles, collectedLinks, collectedScripts, getMod } = defaultMod;
if (typeof getMod !== "function") throw UnexpectedRenderError;
const propagationMod = await getMod();
if (propagationMod == null || typeof propagationMod !== "object") throw UnexpectedRenderError;
const Content = createComponent({
factory(result, baseProps, slots) {
let styles = "", links = "", scripts = "";
if (Array.isArray(collectedStyles)) {
styles = collectedStyles.map((style) => {
return renderUniqueStylesheet(result, {
type: "inline",
content: style
});
}).join("");
}
if (Array.isArray(collectedLinks)) {
links = collectedLinks.map((link) => {
return renderUniqueStylesheet(result, {
type: "external",
src: isRemotePath(link) ? link : prependForwardSlash(link)
});
}).join("");
}
if (Array.isArray(collectedScripts)) {
scripts = collectedScripts.map((script) => renderScriptElement(script)).join("");
}
let props = baseProps;
if (id.endsWith("mdx")) {
props = {
components: propagationMod.components ?? {},
...baseProps
};
}
return createHeadAndContent(
unescapeHTML(styles + links + scripts),
renderTemplate`${renderComponent(
result,
"Content",
propagationMod.Content,
props,
slots
)}`
);
},
propagation: "self"
});
return {
Content,
headings: propagationMod.getHeadings?.() ?? [],
remarkPluginFrontmatter: propagationMod.frontmatter ?? {}
};
} else if (baseMod.Content && typeof baseMod.Content === "function") {
return {
Content: baseMod.Content,
headings: baseMod.getHeadings?.() ?? [],
remarkPluginFrontmatter: baseMod.frontmatter ?? {}
};
} else {
throw UnexpectedRenderError;
}
}
function isPropagatedAssetsModule(module) {
return typeof module === "object" && module != null && "__astroPropagation" in module;
}
// astro-head-inject
const liveCollections = {};
const getCollection = createGetCollection({
liveCollections,
});
const getEntry = createGetEntry({
liveCollections,
});
const starlightConfig = {"social":[{"icon":"github","label":"GitHub","href":"https://github.com/withastro/starlight"}],"tableOfContents":{"minHeadingLevel":2,"maxHeadingLevel":3},"editLink":{},"sidebar":[{"label":"Guides","translations":{},"collapsed":false,"items":[{"label":"Example Guide","translations":{},"slug":"guides/example","attrs":{}}]},{"label":"Reference","translations":{},"collapsed":false,"autogenerate":{"directory":"reference","attrs":{}}}],"head":[],"lastUpdated":false,"pagination":true,"favicon":{"href":"/favicon.svg","type":"image/svg+xml"},"components":{"Search":"@astrojs/starlight/components/Search.astro"},"titleDelimiter":"|","credits":false,"pagefind":{"ranking":{"pageLength":0.1,"termFrequency":0.1,"termSaturation":2,"termSimilarity":9}},"title":{"en":"My Docs"},"isMultilingual":false,"defaultLocale":{"label":"English","lang":"en","dir":"ltr"}};
const project = {"build":{"format":"directory"},"root":"file:///C:/Users/Harun/OneDrive/Desktop/my%20pc%20desktop/","srcDir":"file:///C:/Users/Harun/OneDrive/Desktop/my%20pc%20desktop/src/","trailingSlash":"ignore"};
function ensureLeadingSlash(href) {
if (href[0] !== "/") href = "/" + href;
return href;
}
function ensureTrailingSlash(href) {
if (href[href.length - 1] !== "/") href += "/";
return href;
}
function stripLeadingSlash(href) {
if (href[0] === "/") href = href.slice(1);
return href;
}
function stripTrailingSlash(href) {
if (href[href.length - 1] === "/") href = href.slice(0, -1);
return href;
}
function stripLeadingAndTrailingSlashes(href) {
href = stripLeadingSlash(href);
href = stripTrailingSlash(href);
return href;
}
function stripHtmlExtension(path) {
const pathWithoutTrailingSlash = stripTrailingSlash(path);
return pathWithoutTrailingSlash.endsWith(".html") ? pathWithoutTrailingSlash.slice(0, -5) : path;
}
function ensureHtmlExtension(path) {
path = stripLeadingAndTrailingSlashes(path);
if (!path.endsWith(".html")) {
path = path ? path + ".html" : "/index.html";
}
return ensureLeadingSlash(path);
}
function stripExtension(path) {
const periodIndex = path.lastIndexOf(".");
return path.slice(0, periodIndex > -1 ? periodIndex : void 0);
}
function getCollectionPathFromRoot(collection, { root, srcDir }) {
return (srcDir ).replace(
root ,
""
) + "content/" + collection;
}
const wellKnownRTL = ["ar", "fa", "he", "prs", "ps", "syc", "ug", "ur"];
const BuiltInDefaultLocale = { ...getLocaleInfo("en"), lang: "en" };
function getLocaleInfo(lang) {
try {
const locale = new Intl.Locale(lang);
const label = new Intl.DisplayNames(locale, { type: "language" }).of(lang);
if (!label || lang === label) throw new Error("Label not found.");
return {
label: label[0]?.toLocaleUpperCase(locale) + label.slice(1),
dir: getLocaleDir(locale)
};
} catch {
throw new AstroUserError(
`Failed to get locale information for the '${lang}' locale.`,
"Make sure to provide a valid BCP-47 tags (e.g. en, ar, or zh-CN)."
);
}
}
function getLocaleDir(locale) {
if ("textInfo" in locale) {
return locale.textInfo.direction;
} else if ("getTextInfo" in locale) {
return locale.getTextInfo().direction;
}
return wellKnownRTL.includes(locale.language) ? "rtl" : "ltr";
}
function pickLang(dictionary, lang) {
return dictionary[lang];
}
const pluginTranslations = {};
function builtinI18nSchema() {
return z.object({
...z.strictObject({ ...starlightI18nSchema().required().shape }).shape,
...pagefindI18nSchema().shape,
...expressiveCodeI18nSchema().shape
});
}
function starlightI18nSchema() {
return z.object({
"skipLink.label": z.string().meta({
description: "Text displayed in the accessible “Skip link” when a keyboard user first tabs into a page."
}),
"search.label": z.string().meta({ description: "Text displayed in the search bar." }),
"search.ctrlKey": z.string().meta({
description: "Visible representation of the Control key potentially used in the shortcut key to open the search modal."
}),
"search.cancelLabel": z.string().meta({ description: "Text for the “Cancel” button that closes the search modal." }),
"search.devWarning": z.string().meta({
description: "Warning displayed when opening the Search in a dev environment."
}),
"themeSelect.accessibleLabel": z.string().meta({ description: "Accessible label for the theme selection dropdown." }),
"themeSelect.dark": z.string().meta({ description: "Name of the dark color theme." }),
"themeSelect.light": z.string().meta({ description: "Name of the light color theme." }),
"themeSelect.auto": z.string().meta({
description: "Name of the automatic color theme that syncs with system preferences."
}),
"languageSelect.accessibleLabel": z.string().meta({ description: "Accessible label for the language selection dropdown." }),
"menuButton.accessibleLabel": z.string().meta({ description: "Accessible label for the mobile menu button." }),
"sidebarNav.accessibleLabel": z.string().meta({
description: "Accessible label for the main sidebar `